text: /*!
   * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
   * For licensing, see LICENSE.md.
   */
  !function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 of %1","Align center":"Align center","Align left":"Align left","Align right":"Align right",Aquamarine:"Aquamarine",Big:"Big",Black:"Black",Blue:"Blue",Bold:"Bold","Bulleted List":"Bulleted List",Cancel:"Cancel","Cannot upload file:":"Cannot upload file:","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading",Column:"Column","Could not insert image at the current position.":"Could not insert image at the current position.","Could not obtain resized image URL.":"Could not obtain resized image URL.","Decrease indent":"Decrease indent",Default:"Default","Delete column":"Delete column","Delete row":"Delete row","Dim grey":"Dim grey","Document colors":"Document colors",Downloadable:"Downloadable","Dropdown toolbar":"Dropdown toolbar","Editor toolbar":"Editor toolbar","Enter image caption":"Enter image caption","Font Background Color":"Font Background Color","Font Color":"Font Color","Font Family":"Font Family","Font Size":"Font Size","Full size image":"Full size image",Green:"Green",Grey:"Grey","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",Huge:"Huge","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","Increase indent":"Increase indent","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert image":"Insert image","Insert image or file":"Insert image or file","Insert media":"Insert media","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","Inserting image failed":"Inserting image failed",Italic:"Italic",Justify:"Justify","Left aligned image":"Left aligned image","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey","Media URL":"Media URL","media widget":"media widget","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",Next:"Next","Numbered List":"Numbered List","Open in a new tab":"Open in a new tab",Orange:"Orange",Original:"Original",Paragraph:"Paragraph","Paste the media URL in the input.":"Paste the media URL in the input.",Previous:"Previous",Purple:"Purple",Red:"Red",Redo:"Redo","Remove color":"Remove color","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image",Row:"Row",Save:"Save","Select all":"Select all","Select column":"Select column","Select row":"Select row","Selecting resized image failed":"Selecting resized image failed","Show more items":"Show more items","Side image":"Side image",Small:"Small","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically",Strikethrough:"Strikethrough","Table toolbar":"Table toolbar","Text alignment":"Text alignment","Text alignment toolbar":"Text alignment toolbar","Text alternative":"Text alternative","The URL must not be empty.":"The URL must not be empty.","This media URL is not supported.":"This media URL is not supported.",Tiny:"Tiny","Tip: Paste the URL into the content to embed faster.":"Tip: Paste the URL into the content to embed faster.",Turquoise:"Turquoise",Undo:"Undo","Upload failed":"Upload failed","Upload in progress":"Upload in progress",White:"White","Widget toolbar":"Widget toolbar",Yellow:"Yellow"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MindtrexEditor=t():e.MindtrexEditor=t()}(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=107)}([function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));class i extends Error{constructor(e,t,n){let i=o(e);n&&(i+=" "+JSON.stringify(n)),super(i),this.name="CKEditorError",this.context=t,this.data=n}is(e){return"CKEditorError"===e}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;const n=new i(e.message,t);throw n.stack=e.stack,n}}function o(e){return e+` Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-${e}\n`}},function(e,t,n){"use strict";var i,o=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},r=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),s=[];function a(e){for(var t=-1,n=0;n<s.length;n++)if(s[n].identifier===e){t=n;break}return t}function l(e,t){for(var n={},i=[],o=0;o<e.length;o++){var r=e[o],l=t.base?r[0]+t.base:r[0],c=n[l]||0,d="".concat(l," ").concat(c);n[l]=c+1;var u=a(d),h={css:r[1],media:r[2],sourceMap:r[3]};-1!==u?(s[u].references++,s[u].updater(h)):s.push({identifier:d,updater:f(h,t),references:1}),i.push(d)}return i}function c(e){var t=document.createElement("style"),i=e.attributes||{};if(void 0===i.nonce){var o=n.nc;o&&(i.nonce=o)}if(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),"function"==typeof e.insert)e.insert(t);else{var s=r(e.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(t)}return t}var d,u=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function h(e,t,n,i){var o=n?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(e.styleSheet)e.styleSheet.cssText=u(t,o);else{var r=document.createTextNode(o),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(r,s[t]):e.appendChild(r)}}function m(e,t,n){var i=n.css,o=n.media,r=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}var g=null,p=0;function f(e,t){var n,i,o;if(t.singleton){var r=p++;n=g||(g=c(t)),i=h.bind(null,n,r,!1),o=h.bind(null,n,r,!0)}else n=c(t),i=m.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var n=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var i=0;i<n.length;i++){var o=a(n[i]);s[o].references--}for(var r=l(e,t),c=0;c<n.length;c++){var d=a(n[c]);0===s[d].references&&(s[d].updater(),s.splice(d,1))}n=r}}}},,function(e,t,n){"use strict";var i=n(7),o="object"==typeof self&&self&&self.Object===Object&&self,r=i.a||o||Function("return this")();t.a=r},function(e,t,n){"use strict";(function(e){var i=n(3),o=n(12),r="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=r&&"object"==typeof e&&e&&!e.nodeType&&e,a=s&&s.exports===r?i.a.Buffer:void 0,l=(a?a.isBuffer:void 0)||o.a;t.a=l}).call(this,n(9)(e))},function(e,t,n){"use strict";(function(e){var i=n(7),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,r=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=r&&r.exports===o&&i.a.process,a=function(){try{var e=r&&r.require&&r.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();t.a=a}).call(this,n(9)(e))},function(e,t,n){"use strict";(function(e){var t=n(0);const i="object"==typeof window?window:e;if(i.CKEDITOR_VERSION)throw new t.b("ckeditor-duplicated-modules",null);i.CKEDITOR_VERSION="23.0.0"}).call(this,n(10))},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(this,n(10))},function(e,t,n){"use strict";(function(e){var i=n(3),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,r=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=r&&r.exports===o?i.a.Buffer:void 0,a=s?s.allocUnsafe:void 0;t.a=function(e,t){if(t)return e.slice();var n=e.length,i=a?a(n):new e.constructor(n);return e.copy(i),i}}).call(this,n(9)(e))},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var i=n(1),o=n(55);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t,n){"use strict";t.a=function(){return!1}},function(e){e.exports=JSON.parse('{"ar":{"latex":"LaTeX","cancel":"إلغاء","accept":"إدراج","manual":"الدليل","insert_math":"إدراج صيغة رياضية - MathType","insert_chem":"إدراج صيغة كيميائية - ChemType","minimize":"تصغير","maximize":"تكبير","fullscreen":"ملء الشاشة","exit_fullscreen":"الخروج من ملء الشاشة","close":"إغلاق","mathtype":"MathType","title_modalwindow":"نافذة MathType مشروطة","close_modal_warning":"هل تريد المغادرة بالتأكيد؟ ستُفقد التغييرات التي أجريتها.","latex_name_label":"صيغة Latex","browser_no_compatible":"المستعرض غير متوافق مع تقنية AJAX. الرجاء استخدام أحدث إصدار من Mozilla Firefox.","error_convert_accessibility":"حدث خطأ أثناء التحويل من MathML إلى نص قابل للاستخدام.","exception_cross_site":"البرمجة النصية للمواقع المشتركة مسموح بها لـ HTTP فقط.","exception_high_surrogate":"المركّب المرتفع غير متبوع بمركّب منخفض في fixedCharCodeAt()‎","exception_string_length":"سلسلة غير صالحة. يجب أن يكون الطول من مضاعفات العدد 4","exception_key_nonobject":"Object.keys مستدعاة على غير كائن","exception_null_or_undefined":" هذا فارغ أو غير محدد","exception_not_function":" ليست دالة","exception_invalid_date_format":"تنسيق تاريخ غير صالح: ","exception_casting":"لا يمكن الصياغة ","exception_casting_to":" إلى "},"ca":{"latex":"LaTeX","cancel":"Cancel·lar","accept":"Inserir","manual":"Manual","insert_math":"Inserir fórmula matemàtica - MathType","insert_chem":"Inserir fórmula química - ChemType","minimize":"Minimitza","maximize":"Maximitza","fullscreen":"Pantalla completa","exit_fullscreen":"Sortir de la pantalla complera","close":"Tanca","mathtype":"MathType","title_modalwindow":" Finestra modal de MathType","close_modal_warning":"N\'estàs segur que vols sortir? Es perdran els canvis que has fet.","latex_name_label":"Fórmula en Latex","browser_no_compatible":"El teu navegador no és compatible amb AJAX. Si us plau, usa la darrera versió de Mozilla Firefox.","error_convert_accessibility":"Error en convertir de MathML a text accessible.","exception_cross_site":"Els scripts de llocs creuats només estan permesos per HTTP.","exception_high_surrogate":"Subrogat alt no seguit de subrogat baix a fixedCharCodeAt()","exception_string_length":"Cadena invàlida. La longitud ha de ser un múltiple de 4","exception_key_nonobject":"Object.keys anomenat a non-object","exception_null_or_undefined":" això és null o no definit","exception_not_function":" no és una funció","exception_invalid_date_format":"Format de data invàlid : ","exception_casting":"No es pot emetre ","exception_casting_to":" a "},"cs":{"latex":"LaTeX","cancel":"Storno","accept":"Vložit","manual":"Příručka","insert_math":"Vložit matematický vzorec - MathType","insert_chem":"Vložení chemického vzorce – ChemType","minimize":"Minimalizovat","maximize":"Maximalizovat","fullscreen":"Celá obrazovka","exit_fullscreen":"Opustit režim celé obrazovky","close":"Zavřít","mathtype":"MathType","title_modalwindow":"Modální okno MathType","close_modal_warning":"Opravdu chcete okno zavřít? Provedené změny budou ztraceny.","latex_name_label":"Vzorec v LaTeXu","browser_no_compatible":"Váš prohlížeč nepodporuje technologii AJAX. Použijte nejnovější verzi prohlížeče Mozilla Firefox.","error_convert_accessibility":"Při převodu kódu MathML na čitelný text došlo k chybě.","exception_cross_site":"Skriptování mezi více servery je povoleno jen v HTTP.","exception_high_surrogate":"Ve funkci fixedCharCodeAt() nenásleduje po první části kódu znaku druhá část","exception_string_length":"Neplatný řetězec. Délka musí být násobkem 4.","exception_key_nonobject":"Funkce Object.keys byla použita pro prvek, který není objektem","exception_null_or_undefined":" hodnota je null nebo není definovaná","exception_not_function":" není funkce","exception_invalid_date_format":"Neplatný formát data: ","exception_casting":"Nelze přetypovat ","exception_casting_to":" na "},"da":{"latex":"LaTeX","cancel":"Annuller","accept":"Indsæt","manual":"Brugervejledning","insert_math":"Indsæt matematisk formel - MathType","insert_chem":"Indsæt en kemisk formel - ChemType","minimize":"Minimer","maximize":"Maksimer","fullscreen":"Fuld skærm","exit_fullscreen":"Afslut Fuld skærm","close":"Luk","mathtype":"MathType","title_modalwindow":"MathType-modalvindue","close_modal_warning":"Er du sikker på, du vil lukke? Dine ændringer går tabt.","latex_name_label":"LaTex-formel","browser_no_compatible":"Din browser er ikke kompatibel med AJAX-teknologi. Brug den nyeste version af Mozilla Firefox.","error_convert_accessibility":"Fejl under konvertering fra MathML til tilgængelig tekst.","exception_cross_site":"Scripts på tværs af websteder er kun tilladt for HTTP.","exception_high_surrogate":"Et højt erstatningstegn er ikke fulgt af et lavt erstatningstegn i fixedCharCodeAt()","exception_string_length":"Ugyldig streng. Længden skal være et multiplum af 4","exception_key_nonobject":"Object.keys kaldet ved ikke-objekt","exception_null_or_undefined":" dette er nul eller ikke defineret","exception_not_function":" er ikke en funktion","exception_invalid_date_format":"Ugyldigt datoformat: ","exception_casting":"Kan ikke beregne ","exception_casting_to":" til "},"de":{"latex":"LaTeX","cancel":"Abbrechen","accept":"Einfügen","manual":"Handbuch","insert_math":"Mathematische Formel einfügen - MathType","insert_chem":"Eine chemische Formel einfügen – ChemType","minimize":"Verkleinern","maximize":"Vergrößern","fullscreen":"Vollbild","exit_fullscreen":"Vollbild schließen","close":"Schließen","mathtype":"MathType","title_modalwindow":"Modales MathType-Fenster","close_modal_warning":"Bist du sicher, dass du das Programm verlassen willst? Alle vorgenommenen Änderungen gehen damit verloren.","latex_name_label":"Latex-Formel","browser_no_compatible":"Dein Browser ist nicht mit der AJAX-Technologie kompatibel. Verwende bitte die neueste Version von Mozilla Firefox.","error_convert_accessibility":"Fehler beim Konvertieren von MathML in barrierefreien Text.","exception_cross_site":"Cross-Site-Scripting ist nur bei HTTP zulässig.","exception_high_surrogate":"Hoher Ersatz bei bei festerZeichenkodierungbei() nicht von niedrigem Ersatz befolgt.","exception_string_length":"Ungültige Zeichenfolge. Länge muss ein Vielfaches von 4 sein.","exception_key_nonobject":"Object.keys wurde für ein Nicht-Objekt aufgerufen.","exception_null_or_undefined":" Das ist Null oder nicht definiert.","exception_not_function":" ist keine Funktion","exception_invalid_date_format":"Ungültiges Datumsformat: ","exception_casting":"Umwandlung nicht möglich ","exception_casting_to":" zu "},"el":{"latex":"LaTeX","cancel":"Άκυρο","accept":"Εισαγωγή","manual":"Χειροκίνητα","insert_math":"Εισαγωγή μαθηματικού τύπου - MathType","insert_chem":"Εισαγωγή χημικού τύπου - ChemType","minimize":"Ελαχιστοποίηση","maximize":"Μεγιστοποίηση","fullscreen":"Πλήρης οθόνη","exit_fullscreen":"Έξοδος από πλήρη οθόνη","close":"Κλείσιμο","mathtype":"MathType","title_modalwindow":"Τροπικό παράθυρο MathType","close_modal_warning":"Επιθυμείτε σίγουρα αποχώρηση; Θα χαθούν οι αλλαγές που έχετε κάνει.","latex_name_label":"Τύπος LaTeX","browser_no_compatible":"Το πρόγραμμα περιήγησής σας δεν είναι συμβατό με την τεχνολογία AJAX. Χρησιμοποιήστε την πιο πρόσφατη έκδοση του Mozilla Firefox.","error_convert_accessibility":"Σφάλμα κατά τη μετατροπή από MathML σε προσβάσιμο κείμενο.","exception_cross_site":"Το XSS (Cross site scripting) επιτρέπεται μόνο για HTTP.","exception_high_surrogate":"Το υψηλό υποκατάστατο δεν ακολουθείται από χαμηλό υποκατάστατο στο fixedCharCodeAt()","exception_string_length":"Μη έγκυρη συμβολοσειρά. Το μήκος πρέπει να είναι πολλαπλάσιο του 4","exception_key_nonobject":"Έγινε κλήση του Object.keys σε μη αντικείμενο","exception_null_or_undefined":" αυτό είναι μηδενικό ή δεν έχει οριστεί","exception_not_function":" δεν είναι συνάρτηση","exception_invalid_date_format":"Μη έγκυρη μορφή ημερομηνίας: ","exception_casting":"Δεν είναι δυνατή η μετατροπή ","exception_casting_to":" σε "},"en":{"latex":"LaTeX","cancel":"Cancel","accept":"Insert","manual":"Manual","insert_math":"Insert a math equation - MathType","insert_chem":"Insert a chemistry formula - ChemType","minimize":"Minimize","maximize":"Maximize","fullscreen":"Full-screen","exit_fullscreen":"Exit full-screen","close":"Close","mathtype":"MathType","title_modalwindow":"MathType modal window","close_modal_warning":"Are you sure you want to leave? The changes you made will be lost.","latex_name_label":"Latex Formula","browser_no_compatible":"Your browser is not compatible with AJAX technology. Please, use the latest version of Mozilla Firefox.","error_convert_accessibility":"Error converting from MathML to accessible text.","exception_cross_site":"Cross site scripting is only allowed for HTTP.","exception_high_surrogate":"High surrogate not followed by low surrogate in fixedCharCodeAt()","exception_string_length":"Invalid string. Length must be a multiple of 4","exception_key_nonobject":"Object.keys called on non-object","exception_null_or_undefined":" this is null or not defined","exception_not_function":" is not a function","exception_invalid_date_format":"Invalid date format : ","exception_casting":"Cannot cast ","exception_casting_to":" to "},"es":{"latex":"LaTeX","cancel":"Cancelar","accept":"Insertar","manual":"Manual","insert_math":"Insertar fórmula matemática - MathType","insert_chem":"Insertar fórmula química - ChemType","minimize":"Minimizar","maximize":"Maximizar","fullscreen":"Pantalla completa","exit_fullscreen":"Salir de pantalla completa","close":"Cerrar","mathtype":"MathType","title_modalwindow":"Ventana modal de MathType","close_modal_warning":"Seguro que quieres cerrar? Los cambios que has hecho se perderán","latex_name_label":"Formula en Latex","browser_no_compatible":"Tu navegador no es complatible con AJAX. Por favor, usa la última version de Mozilla Firefox.","error_convert_accessibility":"Error conviertiendo una fórmula MathML a texto accesible.","exception_cross_site":"Cross site scripting solo está permitido para HTTP.","exception_high_surrogate":"Subrogado alto no seguido por subrogado bajo en fixedCharCodeAt()","exception_string_length":"Cadena no válida. La longitud debe ser múltiplo de 4","exception_key_nonobject":"Object.keys called on non-object","exception_null_or_undefined":" esto es null o no definido","exception_not_function":" no es una función","exception_invalid_date_format":"Formato de fecha inválido: ","exception_casting":"No se puede emitir","exception_casting_to":" a "},"et":{"latex":"LaTeX","cancel":"Loobu","accept":"Lisa","manual":"Käsiraamat","insert_math":"Lisa matemaatiline valem – WIRIS","insert_chem":"Lisa keemiline valem – ChemType","minimize":"Minimeeri","maximize":"Maksimeeri","fullscreen":"Täiskuva","exit_fullscreen":"Välju täiskuvalt","close":"Sule","mathtype":"MathType","title_modalwindow":"MathType\'i modaalaken","close_modal_warning":"Kas soovite kindlasti lahkuda? Tehtud muudatused lähevad kaduma.","latex_name_label":"Latexi valem","browser_no_compatible":"Teie brauser ei ühildu AJAXi tehnoloogiaga. Palun kasutage Mozilla Firefoxi uusimat versiooni.","error_convert_accessibility":"Tõrge teisendamisel MathML-ist muudetavaks tekstiks.","exception_cross_site":"Ristskriptimine on lubatud ainult HTTP kasutamisel.","exception_high_surrogate":"Funktsioonis fixedCharCodeAt() ei järgne kõrgemale asendusliikmele madalam asendusliige.","exception_string_length":"Vigane string. Pikkus peab olema 4 kordne.","exception_key_nonobject":"Protseduur Object.keys kutsuti mitteobjekti korral.","exception_null_or_undefined":" see on null või määramata","exception_not_function":" ei ole funktsioon","exception_invalid_date_format":"Sobimatu kuupäeva kuju: ","exception_casting":"Esitamine ei õnnestu ","exception_casting_to":" – "},"eu":{"latex":"LaTeX","cancel":"Ezeztatu","accept":"Txertatu","manual":"Gida","insert_math":"Txertatu matematikako formula - MathType","insert_chem":"Txertatu formula kimiko bat - ChemType","minimize":"Ikonotu","maximize":"Maximizatu","fullscreen":"Pantaila osoa","exit_fullscreen":"Irten pantaila osotik","close":"Itxi","mathtype":"MathType","title_modalwindow":"MathType leiho modala","close_modal_warning":"Ziur irten nahi duzula? Egiten dituzun aldaketak galdu egingo dira.","latex_name_label":"LaTex Formula","browser_no_compatible":"Zure arakatzailea ez da bateragarria AJAX teknologiarekin. Erabili Mozilla Firefoxen azken bertsioa.","error_convert_accessibility":"Errorea MathMLtik testu irisgarrira bihurtzean.","exception_cross_site":"Gune arteko scriptak HTTPrako soilik onartzen dira.","exception_high_surrogate":"Ordezko baxuak ez dio ordezko altuari jarraitzen, hemen: fixedCharCodeAt()","exception_string_length":"Kate baliogabea. Luzerak 4ren multiploa izan behar du","exception_key_nonobject":"Object.keys deitu zaio objektua ez den zerbaiti","exception_null_or_undefined":" nulua edo definitu gabea da","exception_not_function":" ez da funtzio bat","exception_invalid_date_format":"Data-formatu baliogabea : ","exception_casting":"Ezin da igorri ","exception_casting_to":" honi "},"fi":{"latex":"LaTeX","cancel":"Peruuta","accept":"Lisää","manual":"Manual","insert_math":"Liitä matemaattinen kaava - MathType","insert_chem":"Lisää kemian kaava - ChemType","minimize":"Pienennä","maximize":"Suurenna","fullscreen":"Koko ruutu","exit_fullscreen":"Poistu koko ruudun tilasta","close":"Sulje","mathtype":"MathType","title_modalwindow":"MathTypen modaalinen ikkuna","close_modal_warning":"Oletko varma, että haluat poistua? Menetät tekemäsi muutokset.","latex_name_label":"Latex-kaava","browser_no_compatible":"Selaimesi ei tue AJAX-tekniikkaa. Ole hyvä ja käytä uusinta Firefox-versiota.","error_convert_accessibility":"Virhe muunnettaessa MathML:stä tekstiksi.","exception_cross_site":"Cross site scripting sallitaan vain HTTP:llä.","exception_high_surrogate":"fixedCharCodeAt(): yläsijaismerkkiä ei seurannut alasijaismerkki","exception_string_length":"Epäkelpo merkkijono. Pituuden on oltava 4:n kerrannainen","exception_key_nonobject":"Object.keys kutsui muuta kuin oliota","exception_null_or_undefined":" tämä on null tai ei määritelty","exception_not_function":" ei ole funktio","exception_invalid_date_format":"Virheellinen päivämäärämuoto : ","exception_casting":"Ei voida muuntaa tyyppiä ","exception_casting_to":" tyyppiin "},"fr":{"latex":"LaTeX","cancel":"Annuler","accept":"Insérer","manual":"Manuel","insert_math":"Insérer une formule mathématique - MathType","insert_chem":"Insérer une formule chimique - ChemType","minimize":"Minimiser","maximize":"Maximiser","fullscreen":"Plein écran","exit_fullscreen":"Quitter le plein écran","close":"Fermer","mathtype":"MathType","title_modalwindow":"Fenêtre modale MathType","close_modal_warning":"Confirmez-vous vouloir fermer ? Les changements effectués seront perdus.","latex_name_label":"Formule LaTeX","browser_no_compatible":"Votre navigateur n’est pas compatible avec la technologie AJAX. Veuillez utiliser la dernière version de Mozilla Firefox.","error_convert_accessibility":"Une erreur de conversion du format MathML en texte accessible est survenue.","exception_cross_site":"Le cross-site scripting n’est autorisé que pour HTTP.","exception_high_surrogate":"Substitut élevé non suivi d’un substitut inférieur dans fixedCharCodeAt()","exception_string_length":"Chaîne non valide. Longueur limitée aux multiples de 4","exception_key_nonobject":"Object.keys appelé sur un non-objet","exception_null_or_undefined":" nul ou non défini","exception_not_function":" n’est pas une fonction","exception_invalid_date_format":"Format de date non valide : ","exception_casting":"Impossible de convertir ","exception_casting_to":" sur "},"gl":{"latex":"LaTeX","cancel":"Cancelar","accept":"Inserir","manual":"Manual","insert_math":"Inserir unha fórmula matemática - MathType","insert_chem":"Inserir unha fórmula química - ChemType","minimize":"Minimizar","maximize":"Maximizar","fullscreen":"Pantalla completa","exit_fullscreen":"Saír da pantalla completa","close":"Pechar","mathtype":"MathType","title_modalwindow":"Ventá modal de MathType","close_modal_warning":"Seguro que quere saír? Perderanse os cambios realizados.","latex_name_label":"Fórmula Latex","browser_no_compatible":"O seu explorador non é compatible coa tecnoloxía AJAX. Use a versión máis recente de Mozilla Firefox.","error_convert_accessibility":"Erro ao converter de MathML a texto accesible.","exception_cross_site":"Os scripts de sitios só se permiten para HTTP.","exception_high_surrogate":"Suplente superior non seguido por suplente inferior en fixedCharCodeAt()","exception_string_length":"Cadea non válida. A lonxitude debe ser un múltiplo de 4","exception_key_nonobject":"Claves de obxecto chamadas en non obxecto","exception_null_or_undefined":" nulo ou non definido","exception_not_function":" non é unha función","exception_invalid_date_format":"Formato de data non válido: ","exception_casting":"Non se pode converter ","exception_casting_to":" a "},"he":{"latex":"LaTeX","cancel":"ביטול","accept":"הוסף","manual":"מדריך","insert_math":"הוסף נוסחה מתמטית - MathType","insert_chem":"הוספת כתיבה כימית - ChemType","minimize":"מזערי","maximize":"מרבי","fullscreen":"מסך מלא","exit_fullscreen":"יציאה ממצב מסך מלא","close":"סגירה","mathtype":"MathType","title_modalwindow":"חלון מודאלי של MathType","close_modal_warning":"האם לצאת? שינויים אשר בוצעו ימחקו.","latex_name_label":"נוסחת Latex","browser_no_compatible":"הדפדפן שלך אינו תואם לטכנולוגיית AJAX. יש להשתמש בגרסה העדכנית ביותר של Mozilla Firefox.","error_convert_accessibility":"שגיאה בהמרה מ-MathML לטקסט נגיש.","exception_cross_site":"סקריפטינג חוצה-אתרים מורשה עבור HTTP בלבד.","exception_high_surrogate":"ערך ממלא מקום גבוה אינו מופיע אחרי ערך ממלא מקום נמוך ב-fixedCharCodeAt()‎","exception_string_length":"מחרוזת לא חוקית. האורך חייב להיות כפולה של 4","exception_key_nonobject":"בוצעה קריאה אל Object.keys ברכיב שאינו אובייקט","exception_null_or_undefined":" הוא Null או לא מוגדר","exception_not_function":"איננה פונקציה","exception_invalid_date_format":"תסדיר תאריך אינו תקין : ","exception_casting":"לא ניתן להמיר ","exception_casting_to":" ל "},"hr":{"latex":"LaTeX","cancel":"Poništi","accept":"Umetni","manual":"Priručnik","insert_math":"Umetnite matematičku formulu - MathType","insert_chem":"Umetnite kemijsku formulu - ChemType","minimize":"Minimiziraj","maximize":"Maksimiziraj","fullscreen":"Cijeli zaslon","exit_fullscreen":"Izlaz iz prikaza na cijelom zaslonu","close":"Zatvori","mathtype":"MathType","title_modalwindow":"MathType modalni prozor","close_modal_warning":"Sigurno želite zatvoriti? Izgubit će se unesene promjene.","latex_name_label":"Latex formula","browser_no_compatible":"Vaš preglednik nije kompatibilan s AJAX tehnologijom. Upotrijebite najnoviju verziju Mozilla Firefoxa.","error_convert_accessibility":"Pogreška konverzije iz MathML-a u dostupni tekst.","exception_cross_site":"Skriptiranje na različitim web-mjestima dopušteno je samo za HTTP.","exception_high_surrogate":"Iza visoke zamjene ne slijedi niska zamjena u fixedCharCodeAt()","exception_string_length":"Nevažeći niz. Duljina mora biti višekratnik broja 4","exception_key_nonobject":"Object.keys pozvano na ne-objekt","exception_null_or_undefined":" ovo je nula ili nije definirano","exception_not_function":" nije funkcija","exception_invalid_date_format":"Nevažeći format datuma : ","exception_casting":"Ne može se poslati ","exception_casting_to":" na "},"hu":{"latex":"LaTeX","cancel":"Mégsem","accept":"Beszúrás","manual":"Kézikönyv","insert_math":"Matematikai képlet beszúrása - MathType","insert_chem":"Kémiai képet beillesztése - ChemType","minimize":"Kis méret","maximize":"Nagy méret","fullscreen":"Teljes képernyő","exit_fullscreen":"Teljes képernyő elhagyása","close":"Bezárás","mathtype":"MathType","title_modalwindow":"MathType modális ablak","close_modal_warning":"Biztosan kilép? A módosítások el fognak veszni.","latex_name_label":"Latex képlet","browser_no_compatible":"A böngészője nem kompatibilis az AJAX technológiával. Használja a Mozilla Firefox legújabb verzióját.","error_convert_accessibility":"Hiba lépett fel a MathML szöveggé történő konvertálása során.","exception_cross_site":"Az oldalak közti scriptelés csak HTTP esetén engedélyezett.","exception_high_surrogate":"A magas helyettesítő karaktert nem alacsony helyettesítő karakter követi a fixedCharCodeAt() esetében","exception_string_length":"Érvénytelen karakterlánc. A hossznak a 4 többszörösének kell lennie","exception_key_nonobject":"Az Object.keys egy nem objektumra került meghívásra","exception_null_or_undefined":" null vagy nem definiált","exception_not_function":" nem függvény","exception_invalid_date_format":"Érvénytelen dátumformátum: ","exception_casting":"Nem alkalmazható ","exception_casting_to":" erre "},"id":{"latex":"LaTeX","cancel":"Membatalkan","accept":"Masukkan","manual":"Manual","insert_math":"Masukkan rumus matematika - MathType","insert_chem":"Masukkan rumus kimia - ChemType","minimize":"Minikan","maximize":"Perbesar","fullscreen":"Layar penuh","exit_fullscreen":"Keluar layar penuh","close":"Tutup","mathtype":"MathType","title_modalwindow":"Jendela modal MathType","close_modal_warning":"Anda yakin ingin keluar? Anda akan kehilangan perubahan yang Anda buat.","latex_name_label":"Rumus Latex","browser_no_compatible":"Penjelajah Anda tidak kompatibel dengan teknologi AJAX. Harap gunakan Mozilla Firefox versi terbaru.","error_convert_accessibility":"Kesalahan konversi dari MathML menjadi teks yang dapat diakses.","exception_cross_site":"Skrip lintas situs hanya diizinkan untuk HTTP.","exception_high_surrogate":"Pengganti tinggi tidak diikuti oleh pengganti rendah di fixedCharCodeAt()","exception_string_length":"String tidak valid. Panjang harus kelipatan 4","exception_key_nonobject":"Object.keys meminta nonobjek","exception_null_or_undefined":" ini tidak berlaku atau tidak didefinisikan","exception_not_function":" bukan sebuah fungsi","exception_invalid_date_format":"Format tanggal tidak valid : ","exception_casting":"Tidak dapat mentransmisikan ","exception_casting_to":" untuk "},"it":{"latex":"LaTeX","cancel":"Annulla","accept":"Inserisci","manual":"Manuale","insert_math":"Inserisci una formula matematica - MathType","insert_chem":"Inserisci una formula chimica - ChemType","minimize":"Riduci a icona","maximize":"Ingrandisci","fullscreen":"Schermo intero","exit_fullscreen":"Esci da schermo intero","close":"Chiudi","mathtype":"MathType","title_modalwindow":"Finestra modale di MathType","close_modal_warning":"Confermi di voler uscire? Le modifiche effettuate andranno perse.","latex_name_label":"Formula LaTeX","browser_no_compatible":"Il tuo browser non è compatibile con la tecnologia AJAX. Utilizza la versione più recente di Mozilla Firefox.","error_convert_accessibility":"Errore durante la conversione da MathML in testo accessibile.","exception_cross_site":"Lo scripting tra siti è consentito solo per HTTP.","exception_high_surrogate":"Surrogato alto non seguito da surrogato basso in fixedCharCodeAt()","exception_string_length":"Stringa non valida. La lunghezza deve essere un multiplo di 4","exception_key_nonobject":"Metodo Object.keys richiamato in un elemento non oggetto","exception_null_or_undefined":" questo è un valore null o non definito","exception_not_function":" non è una funzione","exception_invalid_date_format":"Formato di data non valido: ","exception_casting":"Impossibile eseguire il cast ","exception_casting_to":" a "},"ja":{"latex":"LaTeX","cancel":"キャンセル","accept":"挿入","manual":"マニュアル","insert_math":"数式を挿入 - MathType","insert_chem":"化学式を挿入 - ChemType","minimize":"最小化","maximize":"最大化","fullscreen":"全画面表示","exit_fullscreen":"全画面表示を解除","close":"閉じる","mathtype":"MathType","title_modalwindow":"MathType モードウィンドウ","close_modal_warning":"このページから移動してもよろしいですか？変更内容は失われます。","latex_name_label":"LaTeX 数式","browser_no_compatible":"お使いのブラウザは、AJAX 技術と互換性がありません。Mozilla Firefox の最新バージョンをご使用ください。","error_convert_accessibility":"MathML からアクセシブルなテキストへの変換中にエラーが発生しました。","exception_cross_site":"クロスサイトスクリプティングは、HTTP のみに許可されています。","exception_high_surrogate":"fixedCharCodeAt（）で上位サロゲートの後に下位サロゲートがありません","exception_string_length":"無効な文字列です。長さは4の倍数である必要があります","exception_key_nonobject":"Object.keys が非オブジェクトで呼び出されました","exception_null_or_undefined":" null であるか、定義されていません","exception_not_function":" は関数ではありません","exception_invalid_date_format":"無効な日付形式: ","exception_casting":"次にキャスト ","exception_casting_to":" できません "},"ko":{"latex":"LaTeX","cancel":"취소","accept":"삽입","manual":"설명서","insert_math":"수학 공식 삽입 - MathType","insert_chem":"화학 공식 입력하기 - ChemType","minimize":"최소화","maximize":"최대화","fullscreen":"전체 화면","exit_fullscreen":"전체 화면 나가기","close":"닫기","mathtype":"MathType","title_modalwindow":"MathType 모달 창","close_modal_warning":"정말로 나가시겠습니까? 변경 사항이 손실됩니다.","latex_name_label":"Latex 공식","browser_no_compatible":"사용자의 브라우저는 AJAX 기술과 호환되지 않습니다. Mozilla Firefox 최신 버전을 사용하십시오.","error_convert_accessibility":"MathML로부터 접근 가능한 텍스트로 오류 변환.","exception_cross_site":"사이트 교차 스크립팅은 HTTP 환경에서만 사용할 수 있습니다.","exception_high_surrogate":"fixedCharCodeAt()에서는 상위 서러게이트 뒤에 하위 서러게이트가 붙지 않습니다","exception_string_length":"유효하지 않은 스트링입니다. 길이는 4의 배수여야 합니다","exception_key_nonobject":"Object.keys가 non-object를 요청하였습니다","exception_null_or_undefined":" Null값이거나 정의되지 않았습니다","exception_not_function":" 함수가 아닙니다","exception_invalid_date_format":"유효하지 않은 날짜 포맷 : ","exception_casting":"캐스팅할 수 없습니다 ","exception_casting_to":" (으)로 "},"nl":{"latex":"LaTeX","cancel":"Annuleren","insert_chem":"Een scheikundige formule invoegen - ChemType","minimize":"Minimaliseer","maximize":"Maximaliseer","fullscreen":"Schermvullend","exit_fullscreen":"Verlaat volledig scherm","close":"Sluit","mathtype":"MathType","title_modalwindow":"Modaal venster MathType","close_modal_warning":"Weet je zeker dat je de app wilt sluiten? De gemaakte wijzigingen gaan verloren.","latex_name_label":"LaTeX-formule","browser_no_compatible":"Je browser is niet compatibel met AJAX-technologie. Gebruik de meest recente versie van Mozilla Firefox.","error_convert_accessibility":"Fout bij conversie van MathML naar toegankelijke tekst.","exception_cross_site":"Cross-site scripting is alleen toegestaan voor HTTP.","exception_high_surrogate":"Hoog surrogaat niet gevolgd door laag surrogaat in fixedCharCodeAt()","exception_string_length":"Ongeldige tekenreeks. Lengte moet een veelvoud van 4 zijn","exception_key_nonobject":"Object.keys opgeroepen voor niet-object","exception_null_or_undefined":" dit is nul of niet gedefinieerd","exception_not_function":" is geen functie","exception_invalid_date_format":"Ongeldige datumnotatie: ","exception_casting":"Kan niet weergeven ","exception_casting_to":" op "},"no":{"latex":"LaTeX","cancel":"Avbryt","accept":"Set inn","manual":"Håndbok","insert_math":"Sett inn matematikkformel - MathType","insert_chem":"Set inn ein kjemisk formel – ChemType","minimize":"Minimer","maximize":"Maksimer","fullscreen":"Fullskjerm","exit_fullscreen":"Avslutt fullskjerm","close":"Lukk","mathtype":"MathType","title_modalwindow":"Modalt MathType-vindu","close_modal_warning":"Er du sikker på at du vil gå ut? Endringane du har gjort, vil gå tapt.","latex_name_label":"LaTeX-formel","browser_no_compatible":"Nettlesaren er ikkje kompatibel med AJAX-teknologien. Bruk den nyaste versjonen av Mozilla Firefox.","error_convert_accessibility":"Feil under konvertering frå MathML til tilgjengeleg tekst.","exception_cross_site":"Skripting på tvers av nettstadar er bere tillaten med HTTP.","exception_high_surrogate":"Høgt surrogat er ikkje etterfølgt av lågt surrogat i fixedCharCodeAt()","exception_string_length":"Ugyldig streng. Lengda må vera deleleg på 4","exception_key_nonobject":"Object.keys kalla på eit ikkje-objekt","exception_null_or_undefined":" dette er null eller ikkje definert","exception_not_function":" er ikkje ein funksjon","exception_invalid_date_format":"Ugyldig datoformat: ","exception_casting":"Kan ikkje bruka casting ","exception_casting_to":" til "},"nb":{"latex":"LaTeX","cancel":"Avbryt","accept":"Insert","manual":"Håndbok","insert_math":"Sett inn matematikkformel - MathType","insert_chem":"Sett inn en kjemisk formel – ChemType","minimize":"Minimer","maximize":"Maksimer","fullscreen":"Fullskjerm","exit_fullscreen":"Avslutt fullskjerm","close":"Lukk","mathtype":"MathType","title_modalwindow":"Modalt MathType-vindu","close_modal_warning":"Er du sikker på at du vil gå ut? Endringene du har gjort, vil gå tapt.","latex_name_label":"LaTeX-formel","browser_no_compatible":"Nettleseren er ikke kompatibel med AJAX-teknologien. Bruk den nyeste versjonen av Mozilla Firefox.","error_convert_accessibility":"Feil under konvertering fra MathML til tilgjengelig tekst.","exception_cross_site":"Skripting på tvers av nettsteder er bare tillatt med HTTP.","exception_high_surrogate":"Høyt surrogat etterfølges ikke av lavt surrogat i fixedCharCodeAt()","exception_string_length":"Ugyldig streng. Lengden må være delelig på 4","exception_key_nonobject":"Object.keys kalte på et ikke-objekt","exception_null_or_undefined":" dette er null eller ikke definert","exception_not_function":" er ikke en funksjon","exception_invalid_date_format":"Ugyldig datoformat: ","exception_casting":"Kan ikke bruke casting ","exception_casting_to":" til "},"nn":{"latex":"LaTeX","cancel":"Avbryt","accept":"Set inn","manual":"Håndbok","insert_math":"Sett inn matematikkformel - MathType","insert_chem":"Set inn ein kjemisk formel – ChemType","minimize":"Minimer","maximize":"Maksimer","fullscreen":"Fullskjerm","exit_fullscreen":"Avslutt fullskjerm","close":"Lukk","mathtype":"MathType","title_modalwindow":"Modalt MathType-vindu","close_modal_warning":"Er du sikker på at du vil gå ut? Endringane du har gjort, vil gå tapt.","latex_name_label":"LaTeX-formel","browser_no_compatible":"Nettlesaren er ikkje kompatibel med AJAX-teknologien. Bruk den nyaste versjonen av Mozilla Firefox.","error_convert_accessibility":"Feil under konvertering frå MathML til tilgjengeleg tekst.","exception_cross_site":"Skripting på tvers av nettstadar er bere tillaten med HTTP.","exception_high_surrogate":"Høgt surrogat er ikkje etterfølgt av lågt surrogat i fixedCharCodeAt()","exception_string_length":"Ugyldig streng. Lengda må vera deleleg på 4","exception_key_nonobject":"Object.keys kalla på eit ikkje-objekt","exception_null_or_undefined":" dette er null eller ikkje definert","exception_not_function":" er ikkje ein funksjon","exception_invalid_date_format":"Ugyldig datoformat: ","exception_casting":"Kan ikkje bruka casting ","exception_casting_to":" til "},"pl":{"latex":"LaTeX","cancel":"Anuluj","accept":"Wstaw","manual":"Instrukcja","insert_math":"Wstaw formułę matematyczną - MathType","insert_chem":"Wstaw wzór chemiczny — ChemType","minimize":"Minimalizuj","maximize":"Maksymalizuj","fullscreen":"Pełny ekran","exit_fullscreen":"Opuść tryb pełnoekranowy","close":"Zamknij","mathtype":"MathType","title_modalwindow":"Okno modalne MathType","close_modal_warning":"Czy na pewno chcesz zamknąć? Wprowadzone zmiany zostaną utracone.","latex_name_label":"Wzór Latex","browser_no_compatible":"Twoja przeglądarka jest niezgodna z technologią AJAX Użyj najnowszej wersji Mozilla Firefox.","error_convert_accessibility":"Błąd podczas konwertowania z formatu MathML na dostępny tekst.","exception_cross_site":"Krzyżowanie skryptów witryny jest dozwolone tylko dla HTTP.","exception_high_surrogate":"Brak niskiego surogatu po wysokim surogacie w fixedCharCodeAt()","exception_string_length":"Niewłaściwy ciąg znaków. Długość musi być wielokrotnością liczby 4.","exception_key_nonobject":"Argumentem wywołanej funkcji Object.key nie jest obiekt.","exception_null_or_undefined":" jest zerowy lub niezdefiniowany","exception_not_function":" nie jest funkcją","exception_invalid_date_format":"Nieprawidłowy format daty: ","exception_casting":"Nie można rzutować ","exception_casting_to":" na "},"pt":{"latex":"LaTeX","cancel":"Cancelar","accept":"Inserir","manual":"Manual","insert_math":"Inserir fórmula matemática - MathType","insert_chem":"Inserir uma fórmula química - ChemType","minimize":"Minimizar","maximize":"Maximizar","fullscreen":"Ecrã completo","exit_fullscreen":"Sair do ecrã completo","close":"Fechar","mathtype":"MathType","title_modalwindow":"Janela modal do MathType","close_modal_warning":"Pretende sair? As alterações efetuadas serão perdidas.","latex_name_label":"Fórmula Latex","browser_no_compatible":"O seu navegador não é compatível com a tecnologia AJAX. Utilize a versão mais recente do Mozilla Firefox.","error_convert_accessibility":"Erro ao converter de MathML para texto acessível.","exception_cross_site":"O processamento de scripts em vários sites só é permitido para HTTP.","exception_high_surrogate":"Substituto alto não seguido por um substituto baixo em fixedCharCodeAt()","exception_string_length":"Cadeia inválida. O comprimento tem de ser um múltiplo de 4","exception_key_nonobject":"Object.keys chamou um não-objeto","exception_null_or_undefined":" é nulo ou não está definido","exception_not_function":" não é uma função","exception_invalid_date_format":"Formato de data inválido: ","exception_casting":"Não é possível adicionar ","exception_casting_to":" até "},"pt_br":{"latex":"LaTeX","cancel":"Cancelar","accept":"Inserir","manual":"Manual","insert_math":"Inserir fórmula matemática - MathType","insert_chem":"Insira uma fórmula química - ChemType","minimize":"Minimizar","maximize":"Maximizar","fullscreen":"Tela cheia","exit_fullscreen":"Sair de tela cheia","close":"Fechar","mathtype":"MathType","title_modalwindow":"Janela modal do MathType","close_modal_warning":"Tem certeza de que deseja sair? Todas as alterações serão perdidas.","latex_name_label":"Fórmula LaTeX","browser_no_compatible":"O navegador não é compatível com a tecnologia AJAX. Use a versão mais recente do Mozilla Firefox.","error_convert_accessibility":"Erro ao converter de MathML para texto acessível.","exception_cross_site":"O uso de scripts entre sites só é permitido para HTTP.","exception_high_surrogate":"High surrogate não seguido de low surrogate em fixedCharCodeAt()","exception_string_length":"String inválida. O comprimento deve ser um múltiplo de 4","exception_key_nonobject":"Object.keys chamados em não objeto","exception_null_or_undefined":" isto é nulo ou não definido","exception_not_function":" não é uma função","exception_invalid_date_format":"Formato de data inválido: ","exception_casting":"Não é possível transmitir ","exception_casting_to":" para "},"ro":{"latex":"LaTeX","cancel":"Anulare","accept":"Inserați","manual":"Ghid","insert_math":"Inserați o formulă matematică - MathType","insert_chem":"Inserați o formulă chimică - ChemType","minimize":"Minimizați","maximize":"Maximizați","fullscreen":"Afișați pe tot ecranul","exit_fullscreen":"Opriți afișarea pe tot ecranul","close":"Închideți","mathtype":"MathType","title_modalwindow":"Fereastră modală MathType","close_modal_warning":"Sigur doriți să ieșiți? Modificările realizate se vor pierde.","latex_name_label":"Formulă Latex","browser_no_compatible":"Browserul dvs. nu este compatibil cu tehnologia AJAX. Utilizați cea mai recentă versiune de Mozilla Firefox.","error_convert_accessibility":"Eroare la convertirea din MathML în text accesibil.","exception_cross_site":"Scriptarea între site‑uri este permisă doar pentru HTTP.","exception_high_surrogate":"Surogatul superior nu este urmat de un surogat inferior în fixedCharCodeAt()","exception_string_length":"Șir nevalid. Lungimea trebuie să fie multiplu de 4","exception_key_nonobject":"Object.keys a apelat un non-obiect","exception_null_or_undefined":" este null sau nu este definit","exception_not_function":" nu este funcție","exception_invalid_date_format":"Format de dată nevalid: ","exception_casting":"nu se poate difuza ","exception_casting_to":" către "},"ru":{"latex":"LaTeX","cancel":"отмена","accept":"Вставка","manual":"вручную","insert_math":"Вставить математическую формулу: WIRIS","insert_chem":"Вставить химическую формулу — ChemType","minimize":"Свернуть","maximize":"Развернуть","fullscreen":"На весь экран","exit_fullscreen":"Выйти из полноэкранного режима","close":"Закрыть","mathtype":"MathType","title_modalwindow":"Режимное окно MathType","close_modal_warning":"Вы уверены, что хотите выйти? Все внесенные изменения будут утрачены.","latex_name_label":"Формула Latex","browser_no_compatible":"Ваш браузер несовместим с технологией AJAX. Используйте последнюю версию Mozilla Firefox.","error_convert_accessibility":"При преобразовании формулы в текст допустимого формата произошла ошибка.","exception_cross_site":"Межсайтовые сценарии доступны только для HTTP.","exception_high_surrogate":"Младший символ-заместитель не сопровождает старший символ-заместитель в исправленном методе CharCodeAt()","exception_string_length":"Недопустимая строка. Длинна должна быть кратной 4.","exception_key_nonobject":"Метод Object.keys вызван не для объекта","exception_null_or_undefined":" значение пустое или не определено","exception_not_function":" не функция","exception_invalid_date_format":"Недопустимый формат даты: ","exception_casting":"Не удается привести ","exception_casting_to":" к "},"sv":{"latex":"LaTeX","cancel":"Avbryt","accept":"Infoga","manual":"Bruksanvisning","insert_math":"Infoga matematisk formel - MathType","insert_chem":"Infoga en kemiformel – ChemType","minimize":"Minimera","maximize":"Maximera","fullscreen":"Helskärm","exit_fullscreen":"Stäng helskärm","close":"Stäng","mathtype":"MathType","title_modalwindow":"MathType modulfönster","close_modal_warning":"Vill du avsluta? Inga ändringar kommer att sparas.","latex_name_label":"Latex-formel","browser_no_compatible":"Din webbläsare är inte kompatibel med AJAX-teknik. Använd den senaste versionen av Mozilla Firefox.","error_convert_accessibility":"Det uppstod ett fel vid konvertering från MathML till åtkomlig text.","exception_cross_site":"Skriptkörning över flera sajter är endast tillåtet för HTTP.","exception_high_surrogate":"Hög surrogat följs inte av låg surrogat i fixedCharCodeAt()","exception_string_length":"Ogiltig sträng. Längden måste vara en multipel av 4","exception_key_nonobject":"Object.keys anropade icke-objekt","exception_null_or_undefined":" det är null eller inte definierat","exception_not_function":" är inte en funktion","exception_invalid_date_format":"Ogiltigt datumformat: ","exception_casting":"Går inte att konvertera ","exception_casting_to":" till "},"tr":{"latex":"LaTeX","cancel":"Vazgeç","accept":"Ekle","manual":"Kılavuz","insert_math":"Matematik formülü ekle - MathType","insert_chem":"Kimya formülü ekleyin - ChemType","minimize":"Simge Durumuna Küçült","maximize":"Ekranı Kapla","fullscreen":"Tam Ekran","exit_fullscreen":"Tam Ekrandan Çık","close":"Kapat","mathtype":"MathType","title_modalwindow":"MathType kalıcı penceresi","close_modal_warning":"Çıkmak istediğinizden emin misiniz? Yaptığınız değişiklikler kaybolacak.","latex_name_label":"Latex Formülü","browser_no_compatible":"Tarayıcınız AJAX teknolojisiyle uyumlu değil. Lütfen en güncel Mozilla Firefox sürümünü kullanın.","error_convert_accessibility":"MathML biçiminden erişilebilir metne dönüştürme hatası.","exception_cross_site":"Siteler arası komut dosyası yazma işlemine yalnızca HTTP için izin verilir.","exception_high_surrogate":"fixedCharCodeAt() fonksiyonunda üst vekilin ardından alt vekil gelmiyor","exception_string_length":"Geçersiz dizgi. Uzunluk, 4\'ün katlarından biri olmalıdır","exception_key_nonobject":"Nesne olmayan öğe üzerinde Object.keys çağrıldı","exception_null_or_undefined":" bu değer boş veya tanımlanmamış","exception_not_function":" bir fonksiyon değil","exception_invalid_date_format":"Geçersiz tarih biçimi: ","exception_casting":"Tür dönüştürülemiyor ","exception_casting_to":" hedef: "},"zh":{"latex":"LaTeX","cancel":"取消","accept":"插入","manual":"手册","insert_math":"插入数学公式 - MathType","insert_chem":"插入化学分子式 - ChemType","minimize":"最小化","maximize":"最大化","fullscreen":"全屏幕","exit_fullscreen":"退出全屏幕","close":"关闭","mathtype":"MathType","title_modalwindow":"MathType 模式窗口","close_modal_warning":"您确定要离开吗？您所做的修改将丢失。","latex_name_label":"Latex 分子式","browser_no_compatible":"您的浏览器不兼容 AJAX 技术。请使用最新版 Mozilla Firefox。","error_convert_accessibility":"将 MathML 转换为可访问文本时出错。","exception_cross_site":"仅 HTTP 允许跨站脚本。","exception_high_surrogate":"fixedCharCodeAt() 中的高位代理之后未跟随低位代理","exception_string_length":"无效字符串。长度必须是 4 的倍数","exception_key_nonobject":"非对象调用了 Object.keys","exception_null_or_undefined":" 该值为空或未定义","exception_not_function":" 不是一个函数","exception_invalid_date_format":"无效日期格式： ","exception_casting":"无法转换 ","exception_casting_to":" 为 "},"":{}}')},function(e,t,n){e.exports=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function i(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function l(e,t,n){return(l=a()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&s(o,n.prototype),o}).apply(null,arguments)}function c(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e,t,n){return(d="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}var u=function(e){return Object.keys(e).map((function(t){return e[t]}))},h=function(e){return Array.prototype.slice.call(e)},m=function(e){console.warn("".concat("SweetAlert2:"," ").concat(e))},g=function(e){console.error("".concat("SweetAlert2:"," ").concat(e))},p=[],f=function(e,t){var n;n='"'.concat(e,'" is deprecated and will be removed in the next major release. Please use "').concat(t,'" instead.'),-1===p.indexOf(n)&&(p.push(n),m(n))},w=function(e){return"function"==typeof e?e():e},b=function(e){return e&&"function"==typeof e.toPromise},_=function(e){return b(e)?e.toPromise():Promise.resolve(e)},k=function(e){return e&&Promise.resolve(e)===e},v=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),y=function(t){return t instanceof Element||function(t){return"object"===e(t)&&t.jquery}(t)},x=function(e){var t={};for(var n in e)t[e[n]]="swal2-"+e[n];return t},A=x(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","toast-column","show","hide","close","title","header","content","html-container","actions","confirm","deny","cancel","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"]),C=x(["success","warning","info","question","error"]),T=function(){return document.body.querySelector(".".concat(A.container))},E=function(e){var t=T();return t?t.querySelector(e):null},M=function(e){return E(".".concat(e))},P=function(){return M(A.popup)},S=function(){var e=P();return h(e.querySelectorAll(".".concat(A.icon)))},I=function(){var e=S().filter((function(e){return he(e)}));return e.length?e[0]:null},O=function(){return M(A.title)},N=function(){return M(A.content)},z=function(){return M(A.image)},R=function(){return M(A["progress-steps"])},L=function(){return M(A["validation-message"])},j=function(){return E(".".concat(A.actions," .").concat(A.confirm))},D=function(){return E(".".concat(A.actions," .").concat(A.deny))},B=function(){return E(".".concat(A.loader))},V=function(){return E(".".concat(A.actions," .").concat(A.cancel))},F=function(){return M(A.actions)},H=function(){return M(A.header)},U=function(){return M(A.footer)},W=function(){return M(A["timer-progress-bar"])},$=function(){return M(A.close)},q=function(){var e=h(P().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((function(e,t){return(e=parseInt(e.getAttribute("tabindex")))>(t=parseInt(t.getAttribute("tabindex")))?1:e<t?-1:0})),t=h(P().querySelectorAll('\n  a[href],\n  area[href],\n  input:not([disabled]),\n  select:not([disabled]),\n  textarea:not([disabled]),\n  button:not([disabled]),\n  iframe,\n  object,\n  embed,\n  [tabindex="0"],\n  [contenteditable],\n  audio[controls],\n  video[controls],\n  summary\n')).filter((function(e){return"-1"!==e.getAttribute("tabindex")}));return function(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(e.concat(t)).filter((function(e){return he(e)}))},Y=function(){return!J()&&!document.body.classList.contains(A["no-backdrop"])},J=function(){return document.body.classList.contains(A["toast-shown"])},K=function(){return P().hasAttribute("data-loading")},X={previousBodyPadding:null},G=function(e,t){if(e.textContent="",t){var n=(new DOMParser).parseFromString(t,"text/html");h(n.querySelector("head").childNodes).forEach((function(t){e.appendChild(t)})),h(n.querySelector("body").childNodes).forEach((function(t){e.appendChild(t)}))}},Q=function(e,t){if(!t)return!1;for(var n=t.split(/\s+/),i=0;i<n.length;i++)if(!e.classList.contains(n[i]))return!1;return!0},Z=function(t,n,i){if(function(e,t){h(e.classList).forEach((function(n){-1===u(A).indexOf(n)&&-1===u(C).indexOf(n)&&-1===u(t.showClass).indexOf(n)&&e.classList.remove(n)}))}(t,n),n.customClass&&n.customClass[i]){if("string"!=typeof n.customClass[i]&&!n.customClass[i].forEach)return m("Invalid type of customClass.".concat(i,'! Expected string or iterable object, got "').concat(e(n.customClass[i]),'"'));oe(t,n.customClass[i])}};function ee(e,t){if(!t)return null;switch(t){case"select":case"textarea":case"file":return se(e,A[t]);case"checkbox":return e.querySelector(".".concat(A.checkbox," input"));case"radio":return e.querySelector(".".concat(A.radio," input:checked"))||e.querySelector(".".concat(A.radio," input:first-child"));case"range":return e.querySelector(".".concat(A.range," input"));default:return se(e,A.input)}}var te,ne=function(e){if(e.focus(),"file"!==e.type){var t=e.value;e.value="",e.value=t}},ie=function(e,t,n){e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((function(t){e.forEach?e.forEach((function(e){n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},oe=function(e,t){ie(e,t,!0)},re=function(e,t){ie(e,t,!1)},se=function(e,t){for(var n=0;n<e.childNodes.length;n++)if(Q(e.childNodes[n],t))return e.childNodes[n]},ae=function(e,t,n){n||0===parseInt(n)?e.style[t]="number"==typeof n?"".concat(n,"px"):n:e.style.removeProperty(t)},le=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e.style.display=t},ce=function(e){e.style.display="none"},de=function(e,t,n,i){var o=e.querySelector(t);o&&(o.style[n]=i)},ue=function(e,t,n){t?le(e,n):ce(e)},he=function(e){return!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length))},me=function(e){return!!(e.scrollHeight>e.clientHeight)},ge=function(e){var t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),i=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||i>0},pe=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=W();he(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((function(){n.style.transition="width ".concat(e/1e3,"s linear"),n.style.width="0%"}),10))},fe=function(){return"undefined"==typeof window||"undefined"==typeof document},we='\n <div aria-labelledby="'.concat(A.title,'" aria-describedby="').concat(A.content,'" class="').concat(A.popup,'" tabindex="-1">\n   <div class="').concat(A.header,'">\n     <ul class="').concat(A["progress-steps"],'"></ul>\n     <div class="').concat(A.icon," ").concat(C.error,'"></div>\n     <div class="').concat(A.icon," ").concat(C.question,'"></div>\n     <div class="').concat(A.icon," ").concat(C.warning,'"></div>\n     <div class="').concat(A.icon," ").concat(C.info,'"></div>\n     <div class="').concat(A.icon," ").concat(C.success,'"></div>\n     <img class="').concat(A.image,'" />\n     <h2 class="').concat(A.title,'" id="').concat(A.title,'"></h2>\n     <button type="button" class="').concat(A.close,'"></button>\n   </div>\n   <div class="').concat(A.content,'">\n     <div id="').concat(A.content,'" class="').concat(A["html-container"],'"></div>\n     <input class="').concat(A.input,'" />\n     <input type="file" class="').concat(A.file,'" />\n     <div class="').concat(A.range,'">\n       <input type="range" />\n       <output></output>\n     </div>\n     <select class="').concat(A.select,'"></select>\n     <div class="').concat(A.radio,'"></div>\n     <label for="').concat(A.checkbox,'" class="').concat(A.checkbox,'">\n       <input type="checkbox" />\n       <span class="').concat(A.label,'"></span>\n     </label>\n     <textarea class="').concat(A.textarea,'"></textarea>\n     <div class="').concat(A["validation-message"],'" id="').concat(A["validation-message"],'"></div>\n   </div>\n   <div class="').concat(A.actions,'">\n     <div class="').concat(A.loader,'"></div>\n     <button type="button" class="').concat(A.confirm,'"></button>\n     <button type="button" class="').concat(A.deny,'"></button>\n     <button type="button" class="').concat(A.cancel,'"></button>\n   </div>\n   <div class="').concat(A.footer,'"></div>\n   <div class="').concat(A["timer-progress-bar-container"],'">\n     <div class="').concat(A["timer-progress-bar"],'"></div>\n   </div>\n </div>\n').replace(/(^|\n)\s*/g,""),be=function(e){yn.isVisible()&&te!==e.target.value&&yn.resetValidationMessage(),te=e.target.value},_e=function(e){var t,n=!!(t=T())&&(t.parentNode.removeChild(t),re([document.documentElement,document.body],[A["no-backdrop"],A["toast-shown"],A["has-column"]]),!0);if(fe())g("SweetAlert2 requires document to initialize");else{var i=document.createElement("div");i.className=A.container,n&&oe(i,A["no-transition"]),G(i,we);var o,r,s,a,l,c,d,u,h,m="string"==typeof(o=e.target)?document.querySelector(o):o;m.appendChild(i),function(e){var t=P();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")}(e),function(e){"rtl"===window.getComputedStyle(e).direction&&oe(T(),A.rtl)}(m),r=N(),s=se(r,A.input),a=se(r,A.file),l=r.querySelector(".".concat(A.range," input")),c=r.querySelector(".".concat(A.range," output")),d=se(r,A.select),u=r.querySelector(".".concat(A.checkbox," input")),h=se(r,A.textarea),s.oninput=be,a.onchange=be,d.onchange=be,u.onchange=be,h.oninput=be,l.oninput=function(e){be(e),c.value=l.value},l.onchange=function(e){be(e),l.nextSibling.value=l.value}}},ke=function(t,n){t instanceof HTMLElement?n.appendChild(t):"object"===e(t)?ve(t,n):t&&G(n,t)},ve=function(e,t){e.jquery?ye(t,e):G(t,e.toString())},ye=function(e,t){if(e.textContent="",0 in t)for(var n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},xe=function(){if(fe())return!1;var e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&void 0!==e.style[n])return t[n];return!1}(),Ae=function(e,t){var n=F(),i=B(),o=j(),r=D(),s=V();t.showConfirmButton||t.showDenyButton||t.showCancelButton||ce(n),Z(n,t,"actions"),Ce(o,"confirm",t),Ce(r,"deny",t),Ce(s,"cancel",t),i.innerHTML=t.loaderHtml,t.buttonsStyling?function(e,t,n,i){if(oe([e,t,n],A.styled),i.confirmButtonColor&&(e.style.backgroundColor=i.confirmButtonColor),i.denyButtonColor&&(t.style.backgroundColor=i.denyButtonColor),i.cancelButtonColor&&(n.style.backgroundColor=i.cancelButtonColor),!K()){var o=window.getComputedStyle(e).getPropertyValue("background-color");e.style.borderLeftColor=o,e.style.borderRightColor=o}}(o,r,s,t):re([o,r,s],A.styled),t.reverseButtons&&(n.insertBefore(s,i),n.insertBefore(r,i),n.insertBefore(o,i))};function Ce(e,t,n){var i;ue(e,n["show".concat((i=t,i.charAt(0).toUpperCase()+i.slice(1)),"Button")],"inline-block"),G(e,n["".concat(t,"ButtonText")]),e.setAttribute("aria-label",n["".concat(t,"ButtonAriaLabel")]),e.className=A[t],Z(e,n,"".concat(t,"Button")),oe(e,n["".concat(t,"ButtonClass")])}var Te=function(e,t){var n=T();if(n){!function(e,t){"string"==typeof t?e.style.background=t:t||oe([document.documentElement,document.body],A["no-backdrop"])}(n,t.backdrop),!t.backdrop&&t.allowOutsideClick&&m('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),function(e,t){t in A?oe(e,A[t]):(m('The "position" parameter is not valid, defaulting to "center"'),oe(e,A.center))}(n,t.position),function(e,t){if(t&&"string"==typeof t){var n="grow-".concat(t);n in A&&oe(e,A[n])}}(n,t.grow),Z(n,t,"container");var i=document.body.getAttribute("data-swal2-queue-step");i&&(n.setAttribute("data-queue-step",i),document.body.removeAttribute("data-swal2-queue-step"))}},Ee={promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap},Me=["input","file","range","select","radio","checkbox","textarea"],Pe=function(e){if(!Re[e.input])return g('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(e.input,'"'));var t=ze(e.input),n=Re[e.input](t,e);le(n),setTimeout((function(){ne(n)}))},Se=function(e,t){var n=ee(N(),e);if(n)for(var i in function(e){for(var t=0;t<e.attributes.length;t++){var n=e.attributes[t].name;-1===["type","value","style"].indexOf(n)&&e.removeAttribute(n)}}(n),t)"range"===e&&"placeholder"===i||n.setAttribute(i,t[i])},Ie=function(e){var t=ze(e.input);e.customClass&&oe(t,e.customClass.input)},Oe=function(e,t){e.placeholder&&!t.inputPlaceholder||(e.placeholder=t.inputPlaceholder)},Ne=function(e,t,n){if(n.inputLabel){e.id=A.input;var i=document.createElement("label"),o=A["input-label"];i.setAttribute("for",e.id),i.className=o,i.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",i)}},ze=function(e){var t=A[e]?A[e]:A.input;return se(N(),t)},Re={};Re.text=Re.email=Re.password=Re.number=Re.tel=Re.url=function(t,n){return"string"==typeof n.inputValue||"number"==typeof n.inputValue?t.value=n.inputValue:k(n.inputValue)||m('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(e(n.inputValue),'"')),Ne(t,t,n),Oe(t,n),t.type=n.input,t},Re.file=function(e,t){return Ne(e,e,t),Oe(e,t),e},Re.range=function(e,t){var n=e.querySelector("input"),i=e.querySelector("output");return n.value=t.inputValue,n.type=t.input,i.value=t.inputValue,Ne(n,e,t),e},Re.select=function(e,t){if(e.textContent="",t.inputPlaceholder){var n=document.createElement("option");G(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return Ne(e,e,t),e},Re.radio=function(e){return e.textContent="",e},Re.checkbox=function(e,t){var n=ee(N(),"checkbox");n.value=1,n.id=A.checkbox,n.checked=Boolean(t.inputValue);var i=e.querySelector("span");return G(i,t.inputPlaceholder),e},Re.textarea=function(e,t){if(e.value=t.inputValue,Oe(e,t),Ne(e,e,t),"MutationObserver"in window){var n=parseInt(window.getComputedStyle(P()).width),i=parseInt(window.getComputedStyle(P()).paddingLeft)+parseInt(window.getComputedStyle(P()).paddingRight);new MutationObserver((function(){var t=e.offsetWidth+i;P().style.width=t>n?"".concat(t,"px"):null})).observe(e,{attributes:!0,attributeFilter:["style"]})}return e};var Le=function(e,t){var n=N().querySelector("#".concat(A.content));t.html?(ke(t.html,n),le(n,"block")):t.text?(n.textContent=t.text,le(n,"block")):ce(n),function(e,t){var n=N(),i=Ee.innerParams.get(e),o=!i||t.input!==i.input;Me.forEach((function(e){var i=A[e],r=se(n,i);Se(e,t.inputAttributes),r.className=i,o&&ce(r)})),t.input&&(o&&Pe(t),Ie(t))}(e,t),Z(N(),t,"content")},je=function(){for(var e=S(),t=0;t<e.length;t++)ce(e[t])},De=function(e,t){Fe(e,t),Be(),Z(e,t,"icon")},Be=function(){for(var e=P(),t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix"),i=0;i<n.length;i++)n[i].style.backgroundColor=t},Ve=function(e,t){e.textContent="",t.iconHtml?G(e,He(t.iconHtml)):"success"===t.icon?G(e,'\n      <div class="swal2-success-circular-line-left"></div>\n      <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n      <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n      <div class="swal2-success-circular-line-right"></div>\n    '):"error"===t.icon?G(e,'\n      <span class="swal2-x-mark">\n        <span class="swal2-x-mark-line-left"></span>\n        <span class="swal2-x-mark-line-right"></span>\n      </span>\n    '):G(e,He({question:"?",warning:"!",info:"i"}[t.icon]))},Fe=function(e,t){if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(var n=0,i=[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"];n<i.length;n++)de(e,i[n],"backgroundColor",t.iconColor);de(e,".swal2-success-ring","borderColor",t.iconColor)}},He=function(e){return'<div class="'.concat(A["icon-content"],'">').concat(e,"</div>")},Ue=[],We=function(){return T()&&T().getAttribute("data-queue-step")},$e=function(e,t){var n=R();if(!t.progressSteps||0===t.progressSteps.length)return ce(n);le(n),n.textContent="";var i=parseInt(void 0===t.currentProgressStep?We():t.currentProgressStep);i>=t.progressSteps.length&&m("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),t.progressSteps.forEach((function(e,o){var r=function(e){var t=document.createElement("li");return oe(t,A["progress-step"]),G(t,e),t}(e);if(n.appendChild(r),o===i&&oe(r,A["active-progress-step"]),o!==t.progressSteps.length-1){var s=function(e){var t=document.createElement("li");return oe(t,A["progress-step-line"]),e.progressStepsDistance&&(t.style.width=e.progressStepsDistance),t}(t);n.appendChild(s)}}))},qe=function(e,t){var n=H();Z(n,t,"header"),$e(0,t),function(e,t){var n=Ee.innerParams.get(e);if(n&&t.icon===n.icon&&I())De(I(),t);else if(je(),t.icon)if(-1!==Object.keys(C).indexOf(t.icon)){var i=E(".".concat(A.icon,".").concat(C[t.icon]));le(i),Ve(i,t),De(i,t),oe(i,t.showClass.icon)}else g('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"'))}(e,t),function(e,t){var n=z();if(!t.imageUrl)return ce(n);le(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt),ae(n,"width",t.imageWidth),ae(n,"height",t.imageHeight),n.className=A.image,Z(n,t,"image")}(0,t),function(e,t){var n=O();ue(n,t.title||t.titleText),t.title&&ke(t.title,n),t.titleText&&(n.innerText=t.titleText),Z(n,t,"title")}(0,t),function(e,t){var n=$();G(n,t.closeButtonHtml),Z(n,t,"closeButton"),ue(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel)}(0,t)},Ye=function(e,t){e.className="".concat(A.popup," ").concat(he(e)?t.showClass.popup:""),t.toast?(oe([document.documentElement,document.body],A["toast-shown"]),oe(e,A.toast)):oe(e,A.modal),Z(e,t,"popup"),"string"==typeof t.customClass&&oe(e,t.customClass),t.icon&&oe(e,A["icon-".concat(t.icon)])},Je=function(e,t){!function(e,t){var n=P();ae(n,"width",t.width),ae(n,"padding",t.padding),t.background&&(n.style.background=t.background),Ye(n,t)}(0,t),Te(0,t),qe(e,t),Le(e,t),Ae(0,t),function(e,t){var n=U();ue(n,t.footer),t.footer&&ke(t.footer,n),Z(n,t,"footer")}(0,t),"function"==typeof t.didRender?t.didRender(P()):"function"==typeof t.onRender&&t.onRender(P())},Ke=function(){return j()&&j().click()},Xe=function(){var e=P();e||yn.fire(),e=P();var t=F(),n=j(),i=B();le(t),ce(n),oe([e,t],A.loading),le(i),e.setAttribute("data-loading",!0),e.setAttribute("aria-busy",!0),e.focus()},Ge={},Qe=function(){return new Promise((function(e){var t=window.scrollX,n=window.scrollY;Ge.restoreFocusTimeout=setTimeout((function(){Ge.previousActiveElement&&Ge.previousActiveElement.focus?(Ge.previousActiveElement.focus(),Ge.previousActiveElement=null):document.body&&document.body.focus(),e()}),100),void 0!==t&&void 0!==n&&window.scrollTo(t,n)}))},Ze=function(){if(Ge.timeout)return function(){var e=W(),t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";var n=parseInt(window.getComputedStyle(e).width),i=parseInt(t/n*100);e.style.removeProperty("transition"),e.style.width="".concat(i,"%")}(),Ge.timeout.stop()},et=function(){if(Ge.timeout){var e=Ge.timeout.start();return pe(e),e}},tt={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,toast:!1,animation:!0,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:void 0,target:"body",backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,showCloseButton:!1,closeButtonHtml:"&times;",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,onBeforeOpen:void 0,onOpen:void 0,willOpen:void 0,didOpen:void 0,onRender:void 0,didRender:void 0,onClose:void 0,onAfterClose:void 0,willClose:void 0,didClose:void 0,onDestroy:void 0,didDestroy:void 0,scrollbarPadding:!0},nt=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","imageAlt","imageHeight","imageUrl","imageWidth","onAfterClose","onClose","onDestroy","progressSteps","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],it={animation:'showClass" and "hideClass',onBeforeOpen:"willOpen",onOpen:"didOpen",onRender:"didRender",onClose:"willClose",onAfterClose:"didClose",onDestroy:"didDestroy"},ot=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","heightAuto","keydownListenerCapture"],rt=function(e){return Object.prototype.hasOwnProperty.call(tt,e)},st=function(e){return it[e]},at=function(e){rt(e)||m('Unknown parameter "'.concat(e,'"'))},lt=function(e){-1!==ot.indexOf(e)&&m('The parameter "'.concat(e,'" is incompatible with toasts'))},ct=function(e){st(e)&&f(e,st(e))},dt=Object.freeze({isValidParameter:rt,isUpdatableParameter:function(e){return-1!==nt.indexOf(e)},isDeprecatedParameter:st,argsToParams:function(t){var n={};return"object"!==e(t[0])||y(t[0])?["title","html","icon"].forEach((function(i,o){var r=t[o];"string"==typeof r||y(r)?n[i]=r:void 0!==r&&g("Unexpected type of ".concat(i,'! Expected "string" or "Element", got ').concat(e(r)))})):o(n,t[0]),n},isVisible:function(){return he(P())},clickConfirm:Ke,clickDeny:function(){return D()&&D().click()},clickCancel:function(){return V()&&V().click()},getContainer:T,getPopup:P,getTitle:O,getContent:N,getHtmlContainer:function(){return M(A["html-container"])},getImage:z,getIcon:I,getIcons:S,getInputLabel:function(){return M(A["input-label"])},getCloseButton:$,getActions:F,getConfirmButton:j,getDenyButton:D,getCancelButton:V,getHeader:H,getFooter:U,getTimerProgressBar:W,getFocusableElements:q,getValidationMessage:L,isLoading:K,fire:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return l(e,n)},mixin:function(e){return function(n){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(m,n);var l,u,h=(l=m,u=a(),function(){var e,t=r(l);if(u){var n=r(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return c(this,e)});function m(){return t(this,m),h.apply(this,arguments)}return i(m,[{key:"_main",value:function(t){return d(r(m.prototype),"_main",this).call(this,o({},e,t))}}]),m}(this)},queue:function(e){var t=this;Ue=e;var n=function(e,t){Ue=[],e(t)},i=[];return new Promise((function(e){!function o(r,s){r<Ue.length?(document.body.setAttribute("data-swal2-queue-step",r),t.fire(Ue[r]).then((function(t){void 0!==t.value?(i.push(t.value),o(r+1,s)):n(e,{dismiss:t.dismiss})}))):n(e,{value:i})}(0)}))},getQueueStep:We,insertQueueStep:function(e,t){return t&&t<Ue.length?Ue.splice(t,0,e):Ue.push(e)},deleteQueueStep:function(e){void 0!==Ue[e]&&Ue.splice(e,1)},showLoading:Xe,enableLoading:Xe,getTimerLeft:function(){return Ge.timeout&&Ge.timeout.getTimerLeft()},stopTimer:Ze,resumeTimer:et,toggleTimer:function(){var e=Ge.timeout;return e&&(e.running?Ze():et())},increaseTimer:function(e){if(Ge.timeout){var t=Ge.timeout.increase(e);return pe(t,!0),t}},isTimerRunning:function(){return Ge.timeout&&Ge.timeout.isRunning()}});function ut(){var e=Ee.innerParams.get(this);if(e){var t=Ee.domCache.get(this);ce(t.loader),e.showConfirmButton?le(t.confirmButton):e.showConfirmButton||e.showCancelButton||ce(t.actions),re([t.popup,t.actions],A.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}}var ht=function(){null===X.previousBodyPadding&&document.body.scrollHeight>window.innerHeight&&(X.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(X.previousBodyPadding+function(){var e=document.createElement("div");e.className=A["scrollbar-measure"],document.body.appendChild(e);var t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t}(),"px"))},mt=function(){navigator.userAgent.match(/(CriOS|FxiOS|EdgiOS|YaBrowser|UCBrowser)/i)||P().scrollHeight>window.innerHeight-44&&(T().style.paddingBottom="".concat(44,"px"))},gt=function(){var e,t=T();t.ontouchstart=function(t){e=pt(t)},t.ontouchmove=function(t){e&&(t.preventDefault(),t.stopPropagation())}},pt=function(e){var t=e.target,n=T();return!(e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType||t!==n&&(me(n)||"INPUT"===t.tagName||me(N())&&N().contains(t)))},ft=function(){return!!window.MSInputMethodContext&&!!document.documentMode},wt=function(){var e=T(),t=P();e.style.removeProperty("align-items"),t.offsetTop<0&&(e.style.alignItems="flex-start")},bt={swalPromiseResolve:new WeakMap};function _t(e,t,n,i){n?Ct(e,i):(Qe().then((function(){return Ct(e,i)})),Ge.keydownTarget.removeEventListener("keydown",Ge.keydownHandler,{capture:Ge.keydownListenerCapture}),Ge.keydownHandlerAdded=!1),t.parentNode&&!document.body.getAttribute("data-swal2-queue-step")&&t.parentNode.removeChild(t),Y()&&(null!==X.previousBodyPadding&&(document.body.style.paddingRight="".concat(X.previousBodyPadding,"px"),X.previousBodyPadding=null),function(){if(Q(document.body,A.iosfix)){var e=parseInt(document.body.style.top,10);re(document.body,A.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}}(),"undefined"!=typeof window&&ft()&&window.removeEventListener("resize",wt),h(document.body.children).forEach((function(e){e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))),re([document.documentElement,document.body],[A.shown,A["height-auto"],A["no-backdrop"],A["toast-shown"],A["toast-column"]])}function kt(e){var t=P();if(t){e=vt(e);var n=Ee.innerParams.get(this);if(n&&!Q(t,n.hideClass.popup)){var i=bt.swalPromiseResolve.get(this);re(t,n.showClass.popup),oe(t,n.hideClass.popup);var o=T();re(o,n.showClass.backdrop),oe(o,n.hideClass.backdrop),yt(this,t,n),i(e)}}}var vt=function(e){return void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:o({isConfirmed:!1,isDenied:!1,isDismissed:!1},e)},yt=function(e,t,n){var i=T(),o=xe&&ge(t),r=n.onClose,s=n.onAfterClose,a=n.willClose,l=n.didClose;xt(t,a,r),o?At(e,t,i,l||s):_t(e,i,J(),l||s)},xt=function(e,t,n){null!==t&&"function"==typeof t?t(e):null!==n&&"function"==typeof n&&n(e)},At=function(e,t,n,i){Ge.swalCloseEventFinishedCallback=_t.bind(null,e,n,J(),i),t.addEventListener(xe,(function(e){e.target===t&&(Ge.swalCloseEventFinishedCallback(),delete Ge.swalCloseEventFinishedCallback)}))},Ct=function(e,t){setTimeout((function(){"function"==typeof t&&t(),e._destroy()}))};function Tt(e,t,n){var i=Ee.domCache.get(e);t.forEach((function(e){i[e].disabled=n}))}function Et(e,t){if(!e)return!1;if("radio"===e.type)for(var n=e.parentNode.parentNode.querySelectorAll("input"),i=0;i<n.length;i++)n[i].disabled=t;else e.disabled=t}var Mt=function(){function e(n,i){t(this,e),this.callback=n,this.remaining=i,this.running=!1,this.start()}return i(e,[{key:"start",value:function(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}},{key:"stop",value:function(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date-this.started),this.remaining}},{key:"increase",value:function(e){var t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}},{key:"getTimerLeft",value:function(){return this.running&&(this.stop(),this.start()),this.remaining}},{key:"isRunning",value:function(){return this.running}}]),e}(),Pt={email:function(e,t){return/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address")},url:function(e,t){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")}};function St(e){!function(e){e.inputValidator||Object.keys(Pt).forEach((function(t){e.input===t&&(e.inputValidator=Pt[t])}))}(e),e.showLoaderOnConfirm&&!e.preConfirm&&m("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),e.animation=w(e.animation),function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(m('Target parameter is not valid, defaulting to "body"'),e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />")),_e(e)}var It,Ot=function(e){var t=T(),n=P();"function"==typeof e.willOpen?e.willOpen(n):"function"==typeof e.onBeforeOpen&&e.onBeforeOpen(n);var i=window.getComputedStyle(document.body).overflowY;jt(t,n,e),setTimeout((function(){Rt(t,n)}),10),Y()&&(Lt(t,e.scrollbarPadding,i),h(document.body.children).forEach((function(e){e===T()||function(e,t){if("function"==typeof e.contains)return e.contains(t)}(e,T())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))}))),J()||Ge.previousActiveElement||(Ge.previousActiveElement=document.activeElement),Nt(n,e),re(t,A["no-transition"])},Nt=function(e,t){"function"==typeof t.didOpen?setTimeout((function(){return t.didOpen(e)})):"function"==typeof t.onOpen&&setTimeout((function(){return t.onOpen(e)}))},zt=function e(t){var n=P();if(t.target===n){var i=T();n.removeEventListener(xe,e),i.style.overflowY="auto"}},Rt=function(e,t){xe&&ge(t)?(e.style.overflowY="hidden",t.addEventListener(xe,zt)):e.style.overflowY="auto"},Lt=function(e,t,n){!function(){if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!Q(document.body,A.iosfix)){var e=document.body.scrollTop;document.body.style.top="".concat(-1*e,"px"),oe(document.body,A.iosfix),gt(),mt()}}(),"undefined"!=typeof window&&ft()&&(wt(),window.addEventListener("resize",wt)),t&&"hidden"!==n&&ht(),setTimeout((function(){e.scrollTop=0}))},jt=function(e,t,n){oe(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),le(t),setTimeout((function(){oe(t,n.showClass.popup),t.style.removeProperty("opacity")}),10),oe([document.documentElement,document.body],A.shown),n.heightAuto&&n.backdrop&&!n.toast&&oe([document.documentElement,document.body],A["height-auto"])},Dt=function(e){return e.checked?1:0},Bt=function(e){return e.checked?e.value:null},Vt=function(e){return e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null},Ft=function(t,n){var i=N(),o=function(e){return Ut[n.input](i,Wt(e),n)};b(n.inputOptions)||k(n.inputOptions)?(Xe(),_(n.inputOptions).then((function(e){t.hideLoading(),o(e)}))):"object"===e(n.inputOptions)?o(n.inputOptions):g("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(e(n.inputOptions)))},Ht=function(e,t){var n=e.getInput();ce(n),_(t.inputValue).then((function(i){n.value="number"===t.input?parseFloat(i)||0:"".concat(i),le(n),n.focus(),e.hideLoading()})).catch((function(t){g("Error in inputValue promise: ".concat(t)),n.value="",le(n),n.focus(),e.hideLoading()}))},Ut={select:function(e,t,n){var i=se(e,A.select),o=function(e,t,i){var o=document.createElement("option");o.value=i,G(o,t),n.inputValue.toString()===i.toString()&&(o.selected=!0),e.appendChild(o)};t.forEach((function(e){var t=e[0],n=e[1];if(Array.isArray(n)){var r=document.createElement("optgroup");r.label=t,r.disabled=!1,i.appendChild(r),n.forEach((function(e){return o(r,e[1],e[0])}))}else o(i,n,t)})),i.focus()},radio:function(e,t,n){var i=se(e,A.radio);t.forEach((function(e){var t=e[0],o=e[1],r=document.createElement("input"),s=document.createElement("label");r.type="radio",r.name=A.radio,r.value=t,n.inputValue.toString()===t.toString()&&(r.checked=!0);var a=document.createElement("span");G(a,o),a.className=A.label,s.appendChild(r),s.appendChild(a),i.appendChild(s)}));var o=i.querySelectorAll("input");o.length&&o[0].focus()}},Wt=function t(n){var i=[];return"undefined"!=typeof Map&&n instanceof Map?n.forEach((function(n,o){var r=n;"object"===e(r)&&(r=t(r)),i.push([o,r])})):Object.keys(n).forEach((function(o){var r=n[o];"object"===e(r)&&(r=t(r)),i.push([o,r])})),i},$t=function(e,t){var n=function(e,t){var n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return Dt(n);case"radio":return Bt(n);case"file":return Vt(n);default:return t.inputAutoTrim?n.value.trim():n.value}}(e,t);t.inputValidator?(e.disableInput(),Promise.resolve().then((function(){return _(t.inputValidator(n,t.validationMessage))})).then((function(i){e.enableButtons(),e.enableInput(),i?e.showValidationMessage(i):Jt(e,t,n)}))):e.getInput().checkValidity()?Jt(e,t,n):(e.enableButtons(),e.showValidationMessage(t.validationMessage))},qt=function(e){e.closePopup({isDenied:!0,value:!1})},Yt=function(e,t){e.closePopup({isConfirmed:!0,value:t})},Jt=function(e,t,n){t.showLoaderOnConfirm&&Xe(),t.preConfirm?(e.resetValidationMessage(),Promise.resolve().then((function(){return _(t.preConfirm(n,t.validationMessage))})).then((function(t){he(L())||!1===t?e.hideLoading():Yt(e,void 0===t?n:t)}))):Yt(e,n)},Kt=function(e,t,n){for(var i=q(),o=0;o<i.length;o++)return(t+=n)===i.length?t=0:-1===t&&(t=i.length-1),i[t].focus();P().focus()},Xt=["ArrowRight","ArrowDown","Right","Down"],Gt=["ArrowLeft","ArrowUp","Left","Up"],Qt=["Escape","Esc"],Zt=function(e,t,n){var i=Ee.innerParams.get(e);i.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?en(e,t,i):"Tab"===t.key?tn(t,i):-1!==[].concat(Xt,Gt).indexOf(t.key)?nn(t.key):-1!==Qt.indexOf(t.key)&&on(t,i,n)},en=function(e,t,n){if(!t.isComposing&&t.target&&e.getInput()&&t.target.outerHTML===e.getInput().outerHTML){if(-1!==["textarea","file"].indexOf(n.input))return;Ke(),t.preventDefault()}},tn=function(e,t){for(var n=e.target,i=q(),o=-1,r=0;r<i.length;r++)if(n===i[r]){o=r;break}e.shiftKey?Kt(0,o,-1):Kt(0,o,1),e.stopPropagation(),e.preventDefault()},nn=function(e){if(-1!==[j(),D(),V()].indexOf(document.activeElement)){var t=-1!==Xt.indexOf(e)?"nextElementSibling":"previousElementSibling",n=document.activeElement[t];n&&n.focus()}},on=function(e,t,n){w(t.allowEscapeKey)&&(e.preventDefault(),n(v.esc))},rn=function(e,t,n){t.popup.onclick=function(){var t=Ee.innerParams.get(e);t.showConfirmButton||t.showDenyButton||t.showCancelButton||t.showCloseButton||t.input||n(v.close)}},sn=!1,an=function(e){e.popup.onmousedown=function(){e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(sn=!0)}}},ln=function(e){e.container.onmousedown=function(){e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(sn=!0)}}},cn=function(e,t,n){t.container.onclick=function(i){var o=Ee.innerParams.get(e);sn?sn=!1:i.target===t.container&&w(o.allowOutsideClick)&&n(v.backdrop)}},dn=function(e){var t=o({},tt.showClass,e.showClass),n=o({},tt.hideClass,e.hideClass),i=o({},tt,e);return i.showClass=t,i.hideClass=n,!1===e.animation&&(i.showClass={popup:"swal2-noanimation",backdrop:"swal2-noanimation"},i.hideClass={}),i},un=function(e,t,n){return new Promise((function(i){var o=function(t){e.closePopup({isDismissed:!0,dismiss:t})};bt.swalPromiseResolve.set(e,i),t.confirmButton.onclick=function(){return function(e,t){e.disableButtons(),t.input?$t(e,t):Jt(e,t,!0)}(e,n)},t.denyButton.onclick=function(){return function(e){e.disableButtons(),qt(e)}(e)},t.cancelButton.onclick=function(){return function(e,t){e.disableButtons(),t(v.cancel)}(e,o)},t.closeButton.onclick=function(){return o(v.close)},function(e,t,n){Ee.innerParams.get(e).toast?rn(e,t,n):(an(t),ln(t),cn(e,t,n))}(e,t,o),function(e,t,n,i){t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1),n.toast||(t.keydownHandler=function(t){return Zt(e,t,i)},t.keydownTarget=n.keydownListenerCapture?window:P(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)}(e,Ge,n,o),n.toast&&(n.input||n.footer||n.showCloseButton)?oe(document.body,A["toast-column"]):re(document.body,A["toast-column"]),function(e,t){"select"===t.input||"radio"===t.input?Ft(e,t):-1!==["text","email","number","tel","textarea"].indexOf(t.input)&&(b(t.inputValue)||k(t.inputValue))&&Ht(e,t)}(e,n),Ot(n),mn(Ge,n,o),gn(t,n),setTimeout((function(){t.container.scrollTop=0}))}))},hn=function(e){var t={popup:P(),container:T(),content:N(),actions:F(),confirmButton:j(),denyButton:D(),cancelButton:V(),loader:B(),closeButton:$(),validationMessage:L(),progressSteps:R()};return Ee.domCache.set(e,t),t},mn=function(e,t,n){var i=W();ce(i),t.timer&&(e.timeout=new Mt((function(){n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(le(i),setTimeout((function(){e.timeout.running&&pe(t.timer)}))))},gn=function(e,t){if(!t.toast)return w(t.allowEnterKey)?void(pn(e,t)||Kt(0,-1,1)):fn()},pn=function(e,t){return t.focusDeny&&he(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&he(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!he(e.confirmButton)||(e.confirmButton.focus(),0))},fn=function(){document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()},wn=function(e){"function"==typeof e.didDestroy?e.didDestroy():"function"==typeof e.onDestroy&&e.onDestroy()},bn=function(e){delete e.params,delete Ge.keydownHandler,delete Ge.keydownTarget,_n(Ee),_n(bt)},_n=function(e){for(var t in e)e[t]=new WeakMap},kn=Object.freeze({hideLoading:ut,disableLoading:ut,getInput:function(e){var t=Ee.innerParams.get(e||this),n=Ee.domCache.get(e||this);return n?ee(n.content,t.input):null},close:kt,closePopup:kt,closeModal:kt,closeToast:kt,enableButtons:function(){Tt(this,["confirmButton","denyButton","cancelButton"],!1)},disableButtons:function(){Tt(this,["confirmButton","denyButton","cancelButton"],!0)},enableInput:function(){return Et(this.getInput(),!1)},disableInput:function(){return Et(this.getInput(),!0)},showValidationMessage:function(e){var t=Ee.domCache.get(this),n=Ee.innerParams.get(this);G(t.validationMessage,e),t.validationMessage.className=A["validation-message"],n.customClass&&n.customClass.validationMessage&&oe(t.validationMessage,n.customClass.validationMessage),le(t.validationMessage);var i=this.getInput();i&&(i.setAttribute("aria-invalid",!0),i.setAttribute("aria-describedBy",A["validation-message"]),ne(i),oe(i,A.inputerror))},resetValidationMessage:function(){var e=Ee.domCache.get(this);e.validationMessage&&ce(e.validationMessage);var t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedBy"),re(t,A.inputerror))},getProgressSteps:function(){return Ee.domCache.get(this).progressSteps},_main:function(e){!function(e){for(var t in e)at(t),e.toast&&lt(t),ct(t)}(e),Ge.currentInstance&&Ge.currentInstance._destroy(),Ge.currentInstance=this;var t=dn(e);St(t),Object.freeze(t),Ge.timeout&&(Ge.timeout.stop(),delete Ge.timeout),clearTimeout(Ge.restoreFocusTimeout);var n=hn(this);return Je(this,t),Ee.innerParams.set(this,t),un(this,n,t)},update:function(e){var t=P(),n=Ee.innerParams.get(this);if(!t||Q(t,n.hideClass.popup))return m("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");var i={};Object.keys(e).forEach((function(t){yn.isUpdatableParameter(t)?i[t]=e[t]:m('Invalid parameter to update: "'.concat(t,'". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js\n\nIf you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md'))}));var r=o({},n,i);Je(this,r),Ee.innerParams.set(this,r),Object.defineProperties(this,{params:{value:o({},this.params,e),writable:!1,enumerable:!0}})},_destroy:function(){var e=Ee.domCache.get(this),t=Ee.innerParams.get(this);t&&(e.popup&&Ge.swalCloseEventFinishedCallback&&(Ge.swalCloseEventFinishedCallback(),delete Ge.swalCloseEventFinishedCallback),Ge.deferDisposalTimer&&(clearTimeout(Ge.deferDisposalTimer),delete Ge.deferDisposalTimer),wn(t),bn(this))}}),vn=function(){function e(){if(t(this,e),"undefined"!=typeof window){"undefined"==typeof Promise&&g("This package requires a Promise library, please include a shim to enable it in this browser (See: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2#1-ie-support)"),It=this;for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var r=Object.freeze(this.constructor.argsToParams(i));Object.defineProperties(this,{params:{value:r,writable:!1,enumerable:!0,configurable:!0}});var s=this._main(this.params);Ee.promise.set(this,s)}}return i(e,[{key:"then",value:function(e){return Ee.promise.get(this).then(e)}},{key:"finally",value:function(e){return Ee.promise.get(this).finally(e)}}]),e}();o(vn.prototype,kn),o(vn,dt),Object.keys(kn).forEach((function(e){vn[e]=function(){var t;if(It)return(t=It)[e].apply(t,arguments)}})),vn.DismissReason=v,vn.version="10.5.1";var yn=vn;return yn.default=yn,yn}(),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2),"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,'.swal2-popup.swal2-toast{flex-direction:row;align-items:center;width:auto;padding:.625em;overflow-y:hidden;background:#fff;box-shadow:0 0 .625em #d9d9d9}.swal2-popup.swal2-toast .swal2-header{flex-direction:row;padding:0}.swal2-popup.swal2-toast .swal2-title{flex-grow:1;justify-content:flex-start;margin:0 .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{position:static;width:.8em;height:.8em;line-height:.8}.swal2-popup.swal2-toast .swal2-content{justify-content:flex-start;padding:0;font-size:1em}.swal2-popup.swal2-toast .swal2-icon{width:2em;min-width:2em;height:2em;margin:0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{font-size:.25em}}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{flex-basis:auto!important;width:auto;height:auto;margin:0 .3125em;padding:0}.swal2-popup.swal2-toast .swal2-styled{margin:0 .3125em;padding:.3125em .625em;font-size:1em}.swal2-popup.swal2-toast .swal2-styled:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px rgba(50,100,150,.4)}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:flex;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;flex-direction:row;align-items:center;justify-content:center;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-top{align-items:flex-start}.swal2-container.swal2-top-left,.swal2-container.swal2-top-start{align-items:flex-start;justify-content:flex-start}.swal2-container.swal2-top-end,.swal2-container.swal2-top-right{align-items:flex-start;justify-content:flex-end}.swal2-container.swal2-center{align-items:center}.swal2-container.swal2-center-left,.swal2-container.swal2-center-start{align-items:center;justify-content:flex-start}.swal2-container.swal2-center-end,.swal2-container.swal2-center-right{align-items:center;justify-content:flex-end}.swal2-container.swal2-bottom{align-items:flex-end}.swal2-container.swal2-bottom-left,.swal2-container.swal2-bottom-start{align-items:flex-end;justify-content:flex-start}.swal2-container.swal2-bottom-end,.swal2-container.swal2-bottom-right{align-items:flex-end;justify-content:flex-end}.swal2-container.swal2-bottom-end>:first-child,.swal2-container.swal2-bottom-left>:first-child,.swal2-container.swal2-bottom-right>:first-child,.swal2-container.swal2-bottom-start>:first-child,.swal2-container.swal2-bottom>:first-child{margin-top:auto}.swal2-container.swal2-grow-fullscreen>.swal2-modal{display:flex!important;flex:1;align-self:stretch;justify-content:center}.swal2-container.swal2-grow-row>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-grow-column{flex:1;flex-direction:column}.swal2-container.swal2-grow-column.swal2-bottom,.swal2-container.swal2-grow-column.swal2-center,.swal2-container.swal2-grow-column.swal2-top{align-items:center}.swal2-container.swal2-grow-column.swal2-bottom-left,.swal2-container.swal2-grow-column.swal2-bottom-start,.swal2-container.swal2-grow-column.swal2-center-left,.swal2-container.swal2-grow-column.swal2-center-start,.swal2-container.swal2-grow-column.swal2-top-left,.swal2-container.swal2-grow-column.swal2-top-start{align-items:flex-start}.swal2-container.swal2-grow-column.swal2-bottom-end,.swal2-container.swal2-grow-column.swal2-bottom-right,.swal2-container.swal2-grow-column.swal2-center-end,.swal2-container.swal2-grow-column.swal2-center-right,.swal2-container.swal2-grow-column.swal2-top-end,.swal2-container.swal2-grow-column.swal2-top-right{align-items:flex-end}.swal2-container.swal2-grow-column>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-no-transition{transition:none!important}.swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right):not(.swal2-grow-fullscreen)>.swal2-modal{margin:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-container .swal2-modal{margin:0!important}}.swal2-popup{display:none;position:relative;box-sizing:border-box;flex-direction:column;justify-content:center;width:32em;max-width:100%;padding:1.25em;border:none;border-radius:.3125em;background:#fff;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-header{display:flex;flex-direction:column;align-items:center;padding:0 1.8em}.swal2-title{position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:100%;margin:1.25em auto 0;padding:0 1.6em}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#3085d6 transparent #3085d6 transparent}.swal2-styled{margin:.3125em;padding:.625em 2em;box-shadow:none;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#3085d6;color:#fff;font-size:1.0625em}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dd6b55;color:#fff;font-size:1.0625em}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#aaa;color:#fff;font-size:1.0625em}.swal2-styled:focus{outline:0;box-shadow:0 0 0 1px #fff,0 0 0 3px rgba(50,100,150,.4)}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1.25em 0 0;padding:1em 0 0;border-top:1px solid #eee;color:#545454;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;height:.25em;overflow:hidden;border-bottom-right-radius:.3125em;border-bottom-left-radius:.3125em}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:1.25em auto}.swal2-close{position:absolute;z-index:2;top:0;right:0;align-items:center;justify-content:center;width:1.2em;height:1.2em;padding:0;overflow:hidden;transition:color .1s ease-out;border:none;border-radius:0;background:0 0;color:#ccc;font-family:serif;font-size:2.5em;line-height:1.2;cursor:pointer}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close::-moz-focus-inner{border:0}.swal2-content{z-index:1;justify-content:center;margin:0;padding:0 1.6em;color:#545454;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em auto}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:100%;transition:border-color .3s,box-shadow .3s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06);color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:0 0 3px #c4e6f5}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::-ms-input-placeholder,.swal2-input::-ms-input-placeholder,.swal2-textarea::-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em auto;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-input[type=number]{max-width:10em}.swal2-file{background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto}.swal2-validation-message{display:none;align-items:center;justify-content:center;margin:0 -2.7em;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:1.25em auto 1.875em;border:.25em solid transparent;border-radius:50%;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:0 0 1.25em;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#3085d6;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#3085d6}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#3085d6}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{right:auto;left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@supports (-ms-accelerator:true){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@-moz-document url-prefix(){.swal2-close:focus{outline:2px solid rgba(50,100,150,.4)}}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{top:auto;right:auto;bottom:auto;left:auto;max-width:calc(100% - .625em * 2);background-color:transparent!important}body.swal2-no-backdrop .swal2-container>.swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-no-backdrop .swal2-container.swal2-top{top:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-container.swal2-top-left,body.swal2-no-backdrop .swal2-container.swal2-top-start{top:0;left:0}body.swal2-no-backdrop .swal2-container.swal2-top-end,body.swal2-no-backdrop .swal2-container.swal2-top-right{top:0;right:0}body.swal2-no-backdrop .swal2-container.swal2-center{top:50%;left:50%;transform:translate(-50%,-50%)}body.swal2-no-backdrop .swal2-container.swal2-center-left,body.swal2-no-backdrop .swal2-container.swal2-center-start{top:50%;left:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-container.swal2-center-end,body.swal2-no-backdrop .swal2-container.swal2-center-right{top:50%;right:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-container.swal2-bottom{bottom:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-container.swal2-bottom-left,body.swal2-no-backdrop .swal2-container.swal2-bottom-start{bottom:0;left:0}body.swal2-no-backdrop .swal2-container.swal2-bottom-end,body.swal2-no-backdrop .swal2-container.swal2-bottom-right{right:0;bottom:0}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{background-color:transparent}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}body.swal2-toast-column .swal2-toast{flex-direction:column;align-items:stretch}body.swal2-toast-column .swal2-toast .swal2-actions{flex:1;align-self:stretch;height:2.2em;margin-top:.3125em}body.swal2-toast-column .swal2-toast .swal2-loading{justify-content:center}body.swal2-toast-column .swal2-toast .swal2-input{height:2em;margin:.3125em auto;font-size:1em}body.swal2-toast-column .swal2-toast .swal2-validation-message{font-size:1em}')},function(e,t,n){var i=n(1),o=n(16);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck-hidden{display:none!important}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{box-sizing:border-box;width:auto;height:auto;position:static}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999);--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border-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:#5c5c5c;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-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)}"},function(e,t,n){var i=n(1),o=n(18);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}"},function(e,t,n){var i=n(1),o=n(20);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck.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{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after{top:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_n{top:calc(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)}'},function(e,t,n){var i=n(1),o=n(22);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button .ck-button__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}"},function(e,t,n){var i=n(1),o=n(24);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{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-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__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}"},function(e,t,n){var i=n(1),o=n(26);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row 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_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__items>*{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small);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>*,.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)}"},function(e,t,n){var i=n(1),o=n(28);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;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)}"},function(e,t,n){var i=n(1),o=n(30);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-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))}"},function(e,t,n){var i=n(1),o=n(32);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-toolbar-dropdown .ck.ck-toolbar .ck.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar-dropdown .ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}"},function(e,t,n){var i=n(1),o=n(34);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}"},function(e,t,n){var i=n(1),o=n(36);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-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)}'},function(e,t,n){var i=n(1),o=n(38);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck .ck-link_selected{background: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)}"},function(e,t,n){var i=n(1),o=n(40);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-placeholder:before,.ck .ck-placeholder:before{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)}"},function(e,t,n){var i=n(1),o=n(42);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.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)}"},function(e,t,n){var i=n(1),o=n(44);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(e,t,n){var i=n(1),o=n(46);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}"},function(e,t,n){var i=n(1),o=n(48);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}"},function(e,t,n){var i=n(1),o=n(50);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.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)}"},function(e,t,n){var i=n(1),o=n(52);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck .ck-button.ck-color-table__remove-color{display:flex;align-items:center;width:100%}label.ck.ck-color-grid__label{font-weight:unset}.ck .ck-button.ck-color-table__remove-color{padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck .ck-button.ck-color-table__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-base-border)}[dir=ltr] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard)}"},function(e,t,n){var i=n(1),o=n(54);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck-content .text-tiny{font-size:.7em}.ck-content .text-small{font-size:.85em}.ck-content .text-big{font-size:1.4em}.ck-content .text-huge{font-size:1.8em}"},function(e,t){e.exports=".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}"},function(e,t,n){var i=n(1),o=n(57);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.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-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}}'},function(e,t,n){var i=n(1),o=n(59);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-resizer-size:10px;--ck-resizer-border-width:1px;--ck-resizer-border-radius:2px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-tooltip-offset:10px;--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2}.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:var(--ck-spacing-small)}.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)}: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))}.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 .ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover .ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover .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))}"},function(e,t,n){var i=n(1),o=n(61);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".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_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view>.ck.ck-label{width:100%;text-overflow:ellipsis;overflow:hidden}"},function(e,t,n){var i=n(1),o=n(63);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{box-shadow:var(--ck-inner-shadow),0 0;background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition:box-shadow .2s ease-in-out,border .2s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),var(--ck-inner-shadow)}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"},function(e,t,n){var i=n(1),o=n(65);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-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%}}.ck.ck-text-alternative-form{padding:var(--ck-spacing-standard)}.ck.ck-text-alternative-form:focus{outline:none}[dir=ltr] .ck.ck-text-alternative-form>:not(:first-child),[dir=rtl] .ck.ck-text-alternative-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-text-alternative-form{padding:0;width:calc(var(--ck-input-text-width)*0.8)}.ck.ck-text-alternative-form .ck-labeled-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-text-alternative-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-text-alternative-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-text-alternative-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-text-alternative-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-text-alternative-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-text-alternative-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}"},function(e,t,n){var i=n(1),o=n(67);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.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}"},function(e,t,n){var i=n(1),o=n(69);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.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}"},function(e,t,n){var i=n(1),o=n(71);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck-content .image{display:table;clear:both;text-align:center;margin:1em auto}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:50px}"},function(e,t,n){var i=n(1),o=n(73);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}"},function(e,t,n){var i=n(1),o=n(75);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;position:absolute;pointer-events:none;left:0;top:0;outline:1px solid var(--ck-color-resizer)}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{position:absolute;pointer-events:all;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);cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{top:var(--ck-resizer-offset);right:var(--ck-resizer-offset);cursor:nesw-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset);cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset);cursor:nesw-resize}"},function(e,t,n){var i=n(1),o=n(77);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck-content .image.image_resized{max-width:100%;display:block;box-sizing:border-box}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}[dir=ltr] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-left:var(--ck-spacing-standard)}.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label{width:4em}"},function(e,t,n){var i=n(1),o=n(79);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=":root{--ck-image-style-spacing:1.5em}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}"},function(e,t,n){var i=n(1),o=n(81);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-editor__editable .image{position:relative}.ck.ck-editor__editable .image .ck-progress-bar{position:absolute;top:0;left:0}.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}"},function(e,t,n){var i=n(1),o=n(83);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports='.ck-image-upload-complete-icon{display:block;position:absolute;top:10px;right:10px;border-radius:50%}.ck-image-upload-complete-icon:after{content:"";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20px;--ck-image-upload-icon-width:2px}.ck-image-upload-complete-icon{width:var(--ck-image-upload-icon-size);height:var(--ck-image-upload-icon-size);opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:var(--ck-image-upload-icon-size);animation-delay:0ms,3s}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}'},function(e,t,n){var i=n(1),o=n(85);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports='.ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}'},function(e,t,n){var i=n(1),o=n(87);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports='.ck-media__wrapper .ck-media__placeholder{display:flex;flex-direction:column;align-items:center}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:block}@media (hover:none){.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:none}}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url{max-width:100%;position:relative}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url:hover .ck-tooltip{visibility:visible;opacity:1}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-media__placeholder__url__text{overflow:hidden;display:block}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck-media__placeholder__icon *{display:none}.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper>:not(.ck-media__placeholder),.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder{pointer-events:none}:root{--ck-media-embed-placeholder-icon-size:3em;--ck-color-media-embed-placeholder-url-text:#757575;--ck-color-media-embed-placeholder-url-text-hover:var(--ck-color-base-text)}.ck-media__wrapper{margin:0 auto}.ck-media__wrapper .ck-media__placeholder{padding:calc(var(--ck-spacing-standard)*3);background:var(--ck-color-base-foreground)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon{min-width:var(--ck-media-embed-placeholder-icon-size);height:var(--ck-media-embed-placeholder-icon-size);margin-bottom:var(--ck-spacing-large);background-position:50%;background-size:cover}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon .ck-icon{width:100%;height:100%}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text{color:var(--ck-color-media-embed-placeholder-url-text);white-space:nowrap;text-align:center;font-style:italic;text-overflow:ellipsis}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:var(--ck-color-media-embed-placeholder-url-text-hover);cursor:pointer;text-decoration:underline}.ck-media__wrapper[data-oembed-url*="open.spotify.com"]{max-width:300px;max-height:380px}.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSkgc2NhbGUoLjk4MDEyKSI+PHJlY3Qgcnk9IjUuMjM4IiByeD0iNS4yMzgiIHk9IjIzMS4zOTkiIHg9IjE3Ni4wMzEiIGhlaWdodD0iNjAuMDk5IiB3aWR0aD0iNjAuMDk5IiBmaWxsPSIjMzRhNjY4IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0yMDYuNDc3IDI2MC45bC0yOC45ODcgMjguOTg3YTUuMjE4IDUuMjE4IDAgMDAzLjc4IDEuNjFoNDkuNjIxYzEuNjk0IDAgMy4xOS0uNzk4IDQuMTQ2LTIuMDM3eiIgZmlsbD0iIzVjODhjNSIvPjxwYXRoIGQ9Ik0yMjYuNzQyIDIyMi45ODhjLTkuMjY2IDAtMTYuNzc3IDcuMTctMTYuNzc3IDE2LjAxNC4wMDcgMi43NjIuNjYzIDUuNDc0IDIuMDkzIDcuODc1LjQzLjcwMy44MyAxLjQwOCAxLjE5IDIuMTA3LjMzMy41MDIuNjUgMS4wMDUuOTUgMS41MDguMzQzLjQ3Ny42NzMuOTU3Ljk4OCAxLjQ0IDEuMzEgMS43NjkgMi41IDMuNTAyIDMuNjM3IDUuMTY4Ljc5MyAxLjI3NSAxLjY4MyAyLjY0IDIuNDY2IDMuOTkgMi4zNjMgNC4wOTQgNC4wMDcgOC4wOTIgNC42IDEzLjkxNHYuMDEyYy4xODIuNDEyLjUxNi42NjYuODc5LjY2Ny40MDMtLjAwMS43NjgtLjMxNC45My0uNzk5LjYwMy01Ljc1NiAyLjIzOC05LjcyOSA0LjU4NS0xMy43OTQuNzgyLTEuMzUgMS42NzMtMi43MTUgMi40NjUtMy45OSAxLjEzNy0xLjY2NiAyLjMyOC0zLjQgMy42MzgtNS4xNjkuMzE1LS40ODIuNjQ1LS45NjIuOTg4LTEuNDM5LjMtLjUwMy42MTctMS4wMDYuOTUtMS41MDguMzU5LS43Ljc2LTEuNDA0IDEuMTktMi4xMDcgMS40MjYtMi40MDIgMi01LjExNCAyLjAwNC03Ljg3NSAwLTguODQ0LTcuNTExLTE2LjAxNC0xNi43NzYtMTYuMDE0eiIgZmlsbD0iI2RkNGIzZSIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48ZWxsaXBzZSByeT0iNS41NjQiIHJ4PSI1LjgyOCIgY3k9IjIzOS4wMDIiIGN4PSIyMjYuNzQyIiBmaWxsPSIjODAyZDI3IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0xOTAuMzAxIDIzNy4yODNjLTQuNjcgMC04LjQ1NyAzLjg1My04LjQ1NyA4LjYwNnMzLjc4NiA4LjYwNyA4LjQ1NyA4LjYwN2MzLjA0MyAwIDQuODA2LS45NTggNi4zMzctMi41MTYgMS41My0xLjU1NyAyLjA4Ny0zLjkxMyAyLjA4Ny02LjI5IDAtLjM2Mi0uMDIzLS43MjItLjA2NC0xLjA3OWgtOC4yNTd2My4wNDNoNC44NWMtLjE5Ny43NTktLjUzMSAxLjQ1LTEuMDU4IDEuOTg2LS45NDIuOTU4LTIuMDI4IDEuNTQ4LTMuOTAxIDEuNTQ4LTIuODc2IDAtNS4yMDgtMi4zNzItNS4yMDgtNS4yOTkgMC0yLjkyNiAyLjMzMi01LjI5OSA1LjIwOC01LjI5OSAxLjM5OSAwIDIuNjE4LjQwNyAzLjU4NCAxLjI5M2wyLjM4MS0yLjM4YzAtLjAwMi0uMDAzLS4wMDQtLjAwNC0uMDA1LTEuNTg4LTEuNTI0LTMuNjItMi4yMTUtNS45NTUtMi4yMTV6bTQuNDMgNS42NmwuMDAzLjAwNnYtLjAwM3oiIGZpbGw9IiNmZmYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxNS4xODQgMjUxLjkyOWwtNy45OCA3Ljk3OSAyOC40NzcgMjguNDc1YTUuMjMzIDUuMjMzIDAgMDAuNDQ5LTIuMTIzdi0zMS4xNjVjLS40NjkuNjc1LS45MzQgMS4zNDktMS4zODIgMi4wMDUtLjc5MiAxLjI3NS0xLjY4MiAyLjY0LTIuNDY1IDMuOTktMi4zNDcgNC4wNjUtMy45ODIgOC4wMzgtNC41ODUgMTMuNzk0LS4xNjIuNDg1LS41MjcuNzk4LS45My43OTktLjM2My0uMDAxLS42OTctLjI1NS0uODc5LS42Njd2LS4wMTJjLS41OTMtNS44MjItMi4yMzctOS44Mi00LjYtMTMuOTE0LS43ODMtMS4zNS0xLjY3My0yLjcxNS0yLjQ2Ni0zLjk5LTEuMTM3LTEuNjY2LTIuMzI3LTMuNC0zLjYzNy01LjE2OWwtLjAwMi0uMDAzeiIgZmlsbD0iI2MzYzNjMyIvPjxwYXRoIGQ9Ik0yMTIuOTgzIDI0OC40OTVsLTM2Ljk1MiAzNi45NTN2LjgxMmE1LjIyNyA1LjIyNyAwIDAwNS4yMzggNS4yMzhoMS4wMTVsMzUuNjY2LTM1LjY2NmExMzYuMjc1IDEzNi4yNzUgMCAwMC0yLjc2NC0zLjkgMzcuNTc1IDM3LjU3NSAwIDAwLS45ODktMS40NCAzNS4xMjcgMzUuMTI3IDAgMDAtLjk1LTEuNTA4Yy0uMDgzLS4xNjItLjE3Ni0uMzI2LS4yNjQtLjQ4OXoiIGZpbGw9IiNmZGRjNGYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxMS45OTggMjYxLjA4M2wtNi4xNTIgNi4xNTEgMjQuMjY0IDI0LjI2NGguNzgxYTUuMjI3IDUuMjI3IDAgMDA1LjIzOS01LjIzOHYtMS4wNDV6IiBmaWxsPSIjZmZmIiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjwvZz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder{background:#4268b3}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik05NjcuNDg0IDBINTYuNTE3QzI1LjMwNCAwIDAgMjUuMzA0IDAgNTYuNTE3djkxMC45NjZDMCA5OTguNjk0IDI1LjI5NyAxMDI0IDU2LjUyMiAxMDI0SDU0N1Y2MjhINDE0VjQ3M2gxMzNWMzU5LjAyOWMwLTEzMi4yNjIgODAuNzczLTIwNC4yODIgMTk4Ljc1Ni0yMDQuMjgyIDU2LjUxMyAwIDEwNS4wODYgNC4yMDggMTE5LjI0NCA2LjA4OVYyOTlsLTgxLjYxNi4wMzdjLTYzLjk5MyAwLTc2LjM4NCAzMC40OTItNzYuMzg0IDc1LjIzNlY0NzNoMTUzLjQ4N2wtMTkuOTg2IDE1NUg3MDd2Mzk2aDI2MC40ODRjMzEuMjEzIDAgNTYuNTE2LTI1LjMwMyA1Ni41MTYtNTYuNTE2VjU2LjUxNUMxMDI0IDI1LjMwMyA5OTguNjk3IDAgOTY3LjQ4NCAwIiBmaWxsPSIjRkZGRkZFIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#cdf}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder{background:linear-gradient(-135deg,#1400c7,#b800b1,#f50000)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIC4xNTloNTAzLjg0MVY1MDMuOTRIMHoiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48cGF0aCBkPSJNMjUxLjkyMS4xNTljLTY4LjQxOCAwLTc2Ljk5Ny4yOS0xMDMuODY3IDEuNTE2LTI2LjgxNCAxLjIyMy00NS4xMjcgNS40ODItNjEuMTUxIDExLjcxLTE2LjU2NiA2LjQzNy0zMC42MTUgMTUuMDUxLTQ0LjYyMSAyOS4wNTYtMTQuMDA1IDE0LjAwNi0yMi42MTkgMjguMDU1LTI5LjA1NiA0NC42MjEtNi4yMjggMTYuMDI0LTEwLjQ4NyAzNC4zMzctMTEuNzEgNjEuMTUxQy4yOSAxNzUuMDgzIDAgMTgzLjY2MiAwIDI1Mi4wOGMwIDY4LjQxNy4yOSA3Ni45OTYgMS41MTYgMTAzLjg2NiAxLjIyMyAyNi44MTQgNS40ODIgNDUuMTI3IDExLjcxIDYxLjE1MSA2LjQzNyAxNi41NjYgMTUuMDUxIDMwLjYxNSAyOS4wNTYgNDQuNjIxIDE0LjAwNiAxNC4wMDUgMjguMDU1IDIyLjYxOSA0NC42MjEgMjkuMDU3IDE2LjAyNCA2LjIyNyAzNC4zMzcgMTAuNDg2IDYxLjE1MSAxMS43MDkgMjYuODcgMS4yMjYgMzUuNDQ5IDEuNTE2IDEwMy44NjcgMS41MTYgNjguNDE3IDAgNzYuOTk2LS4yOSAxMDMuODY2LTEuNTE2IDI2LjgxNC0xLjIyMyA0NS4xMjctNS40ODIgNjEuMTUxLTExLjcwOSAxNi41NjYtNi40MzggMzAuNjE1LTE1LjA1MiA0NC42MjEtMjkuMDU3IDE0LjAwNS0xNC4wMDYgMjIuNjE5LTI4LjA1NSAyOS4wNTctNDQuNjIxIDYuMjI3LTE2LjAyNCAxMC40ODYtMzQuMzM3IDExLjcwOS02MS4xNTEgMS4yMjYtMjYuODcgMS41MTYtMzUuNDQ5IDEuNTE2LTEwMy44NjYgMC02OC40MTgtLjI5LTc2Ljk5Ny0xLjUxNi0xMDMuODY3LTEuMjIzLTI2LjgxNC01LjQ4Mi00NS4xMjctMTEuNzA5LTYxLjE1MS02LjQzOC0xNi41NjYtMTUuMDUyLTMwLjYxNS0yOS4wNTctNDQuNjIxLTE0LjAwNi0xNC4wMDUtMjguMDU1LTIyLjYxOS00NC42MjEtMjkuMDU2LTE2LjAyNC02LjIyOC0zNC4zMzctMTAuNDg3LTYxLjE1MS0xMS43MUMzMjguOTE3LjQ0OSAzMjAuMzM4LjE1OSAyNTEuOTIxLjE1OXptMCA0NS4zOTFjNjcuMjY1IDAgNzUuMjMzLjI1NyAxMDEuNzk3IDEuNDY5IDI0LjU2MiAxLjEyIDM3LjkwMSA1LjIyNCA0Ni43NzggOC42NzQgMTEuNzU5IDQuNTcgMjAuMTUxIDEwLjAyOSAyOC45NjYgMTguODQ1IDguODE2IDguODE1IDE0LjI3NSAxNy4yMDcgMTguODQ1IDI4Ljk2NiAzLjQ1IDguODc3IDcuNTU0IDIyLjIxNiA4LjY3NCA0Ni43NzggMS4yMTIgMjYuNTY0IDEuNDY5IDM0LjUzMiAxLjQ2OSAxMDEuNzk4IDAgNjcuMjY1LS4yNTcgNzUuMjMzLTEuNDY5IDEwMS43OTctMS4xMiAyNC41NjItNS4yMjQgMzcuOTAxLTguNjc0IDQ2Ljc3OC00LjU3IDExLjc1OS0xMC4wMjkgMjAuMTUxLTE4Ljg0NSAyOC45NjYtOC44MTUgOC44MTYtMTcuMjA3IDE0LjI3NS0yOC45NjYgMTguODQ1LTguODc3IDMuNDUtMjIuMjE2IDcuNTU0LTQ2Ljc3OCA4LjY3NC0yNi41NiAxLjIxMi0zNC41MjcgMS40NjktMTAxLjc5NyAxLjQ2OS02Ny4yNzEgMC03NS4yMzctLjI1Ny0xMDEuNzk4LTEuNDY5LTI0LjU2Mi0xLjEyLTM3LjkwMS01LjIyNC00Ni43NzgtOC42NzQtMTEuNzU5LTQuNTctMjAuMTUxLTEwLjAyOS0yOC45NjYtMTguODQ1LTguODE1LTguODE1LTE0LjI3NS0xNy4yMDctMTguODQ1LTI4Ljk2Ni0zLjQ1LTguODc3LTcuNTU0LTIyLjIxNi04LjY3NC00Ni43NzgtMS4yMTItMjYuNTY0LTEuNDY5LTM0LjUzMi0xLjQ2OS0xMDEuNzk3IDAtNjcuMjY2LjI1Ny03NS4yMzQgMS40NjktMTAxLjc5OCAxLjEyLTI0LjU2MiA1LjIyNC0zNy45MDEgOC42NzQtNDYuNzc4IDQuNTctMTEuNzU5IDEwLjAyOS0yMC4xNTEgMTguODQ1LTI4Ljk2NiA4LjgxNS04LjgxNiAxNy4yMDctMTQuMjc1IDI4Ljk2Ni0xOC44NDUgOC44NzctMy40NSAyMi4yMTYtNy41NTQgNDYuNzc4LTguNjc0IDI2LjU2NC0xLjIxMiAzNC41MzItMS40NjkgMTAxLjc5OC0xLjQ2OXoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48cGF0aCBkPSJNMjUxLjkyMSAzMzYuMDUzYy00Ni4zNzggMC04My45NzQtMzcuNTk2LTgzLjk3NC04My45NzMgMC00Ni4zNzggMzcuNTk2LTgzLjk3NCA4My45NzQtODMuOTc0IDQ2LjM3NyAwIDgzLjk3MyAzNy41OTYgODMuOTczIDgzLjk3NCAwIDQ2LjM3Ny0zNy41OTYgODMuOTczLTgzLjk3MyA4My45NzN6bTAtMjEzLjMzOGMtNzEuNDQ3IDAtMTI5LjM2NSA1Ny45MTgtMTI5LjM2NSAxMjkuMzY1IDAgNzEuNDQ2IDU3LjkxOCAxMjkuMzY0IDEyOS4zNjUgMTI5LjM2NCA3MS40NDYgMCAxMjkuMzY0LTU3LjkxOCAxMjkuMzY0LTEyOS4zNjQgMC03MS40NDctNTcuOTE4LTEyOS4zNjUtMTI5LjM2NC0xMjkuMzY1ek00MTYuNjI3IDExNy42MDRjMCAxNi42OTYtMTMuNTM1IDMwLjIzLTMwLjIzMSAzMC4yMy0xNi42OTUgMC0zMC4yMy0xMy41MzQtMzAuMjMtMzAuMjMgMC0xNi42OTYgMTMuNTM1LTMwLjIzMSAzMC4yMy0zMC4yMzEgMTYuNjk2IDAgMzAuMjMxIDEzLjUzNSAzMC4yMzEgMzAuMjMxIiBmaWxsPSIjRkZGIi8+PC9nPjwvc3ZnPg==)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#ffe0fe}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder{background:linear-gradient(90deg,#71c6f4,#0d70a5)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwMHpNMTYzLjQgMzA1LjVjODguNyAwIDEzNy4yLTczLjUgMTM3LjItMTM3LjIgMC0yLjEgMC00LjItLjEtNi4yIDkuNC02LjggMTcuNi0xNS4zIDI0LjEtMjUtOC42IDMuOC0xNy45IDYuNC0yNy43IDcuNiAxMC02IDE3LjYtMTUuNCAyMS4yLTI2LjctOS4zIDUuNS0xOS42IDkuNS0zMC42IDExLjctOC44LTkuNC0yMS4zLTE1LjItMzUuMi0xNS4yLTI2LjYgMC00OC4yIDIxLjYtNDguMiA0OC4yIDAgMy44LjQgNy41IDEuMyAxMS00MC4xLTItNzUuNi0yMS4yLTk5LjQtNTAuNC00LjEgNy4xLTYuNSAxNS40LTYuNSAyNC4yIDAgMTYuNyA4LjUgMzEuNSAyMS41IDQwLjEtNy45LS4yLTE1LjMtMi40LTIxLjgtNnYuNmMwIDIzLjQgMTYuNiA0Mi44IDM4LjcgNDcuMy00IDEuMS04LjMgMS43LTEyLjcgMS43LTMuMSAwLTYuMS0uMy05LjEtLjkgNi4xIDE5LjIgMjMuOSAzMy4xIDQ1IDMzLjUtMTYuNSAxMi45LTM3LjMgMjAuNi01OS45IDIwLjYtMy45IDAtNy43LS4yLTExLjUtLjcgMjEuMSAxMy44IDQ2LjUgMjEuOCA3My43IDIxLjgiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text{color:#b8e6ff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}'},function(e,t,n){var i=n(1),o=n(89);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-media-form{display:flex;align-items:flex-start;flex-direction:row;flex-wrap:nowrap}.ck.ck-media-form .ck-labeled-field-view{display:inline-block}.ck.ck-media-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-media-form{flex-wrap:wrap}.ck.ck-media-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-media-form .ck-button{flex-basis:50%}}.ck.ck-media-form{padding:var(--ck-spacing-standard)}.ck.ck-media-form:focus{outline:none}[dir=ltr] .ck.ck-media-form>:not(:first-child),[dir=rtl] .ck.ck-media-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-media-form{padding:0;width:calc(var(--ck-input-text-width)*0.8)}.ck.ck-media-form .ck-labeled-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-media-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-media-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-media-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-media-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-media-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-media-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-media-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}"},function(e,t,n){var i=n(1),o=n(91);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck-content .media{clear:both;margin:1em 0;display:block;min-width:15em}"},function(e,t,n){var i=n(1),o=n(93);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.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}"},function(e,t,n){var i=n(1),o=n(95);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.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__action{border-top-right-radius:unset;border-bottom-right-radius:unset}[dir=rtl] .ck.ck-splitbutton>.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-radius:0}.ck-rounded-corners [dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow,[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow.ck-rounded-corners{border-radius:var(--ck-border-radius);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)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled){border-left-color:var(--ck-color-split-button-hover-border)}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled){border-right-color:var(--ck-color-split-button-hover-border)}.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}"},function(e,t,n){var i=n(1),o=n(97);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.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)}"},function(e,t,n){var i=n(1),o=n(99);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.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_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget_selected{outline:unset}'},function(e,t,n){var i=n(1),o=n(101);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck-content .table{margin:1em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;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}"},function(module,__webpack_exports__,__webpack_require__){"use strict";var md5,_unused_webpack_default_export=md5;!function(){var HxOverrides=function(){};HxOverrides.__name__=!0,HxOverrides.dateStr=function(e){var t=e.getMonth()+1,n=e.getDate(),i=e.getHours(),o=e.getMinutes(),r=e.getSeconds();return e.getFullYear()+"-"+(t<10?"0"+t:""+t)+"-"+(n<10?"0"+n:""+n)+" "+(i<10?"0"+i:""+i)+":"+(o<10?"0"+o:""+o)+":"+(r<10?"0"+r:""+r)},HxOverrides.strDate=function(e){switch(e.length){case 8:var t=e.split(":"),n=new Date;return n.setTime(0),n.setUTCHours(t[0]),n.setUTCMinutes(t[1]),n.setUTCSeconds(t[2]),n;case 10:t=e.split("-");return new Date(t[0],t[1]-1,t[2],0,0,0);case 19:var i=(t=e.split(" "))[0].split("-"),o=t[1].split(":");return new Date(i[0],i[1]-1,i[2],o[0],o[1],o[2]);default:throw"Invalid date format : "+e}},HxOverrides.cca=function(e,t){var n=e.charCodeAt(t);if(n==n)return n},HxOverrides.substr=function(e,t,n){return null!=t&&0!=t&&null!=n&&n<0?"":(null==n&&(n=e.length),t<0?(t=e.length+t)<0&&(t=0):n<0&&(n=e.length+n-t),e.substr(t,n))},HxOverrides.remove=function(e,t){for(var n=0,i=e.length;n<i;){if(e[n]==t)return e.splice(n,1),!0;n++}return!1},HxOverrides.iter=function(e){return{cur:0,arr:e,hasNext:function(){return this.cur<this.arr.length},next:function(){return this.arr[this.cur++]}}};var IntIter=function(e,t){this.min=e,this.max=t};IntIter.__name__=!0,IntIter.prototype={next:function(){return this.min++},hasNext:function(){return this.min<this.max},__class__:IntIter};var Std=function(){};Std.__name__=!0,Std.is=function(e,t){return js.Boot.__instanceof(e,t)},Std.string=function(e){return js.Boot.__string_rec(e,"")},Std.int=function(e){return 0|e},Std.parseInt=function(e){var t=parseInt(e,10);return 0!=t||120!=HxOverrides.cca(e,1)&&88!=HxOverrides.cca(e,1)||(t=parseInt(e)),isNaN(t)?null:t},Std.parseFloat=function(e){return parseFloat(e)},Std.random=function(e){return Math.floor(Math.random()*e)};var com=com||{};com.wiris||(com.wiris={}),com.wiris.js||(com.wiris.js={}),com.wiris.js.JsPluginTools=function(){this.tryReady()},com.wiris.js.JsPluginTools.__name__=!0,com.wiris.js.JsPluginTools.main=function(){var e;e=com.wiris.js.JsPluginTools.getInstance(),haxe.Timer.delay($bind(e,e.tryReady),100)},com.wiris.js.JsPluginTools.getInstance=function(){return null==com.wiris.js.JsPluginTools.instance&&(com.wiris.js.JsPluginTools.instance=new com.wiris.js.JsPluginTools),com.wiris.js.JsPluginTools.instance},com.wiris.js.JsPluginTools.bypassEncapsulation=function(){null==window.com&&(window.com={}),null==window.com.wiris&&(window.com.wiris={}),null==window.com.wiris.js&&(window.com.wiris.js={}),null==window.com.wiris.js.JsPluginTools&&(window.com.wiris.js.JsPluginTools=com.wiris.js.JsPluginTools.getInstance())},com.wiris.js.JsPluginTools.prototype={md5encode:function(e){return haxe.Md5.encode(e)},doLoad:function(){this.ready=!0,com.wiris.js.JsPluginTools.instance=this,com.wiris.js.JsPluginTools.bypassEncapsulation()},tryReady:function(){this.ready=!1,js.Lib.document.readyState&&(this.doLoad(),this.ready=!0),this.ready||haxe.Timer.delay($bind(this,this.tryReady),100)},__class__:com.wiris.js.JsPluginTools};var haxe=haxe||{};haxe.Log=function(){},haxe.Log.__name__=!0,haxe.Log.trace=function(e,t){js.Boot.__trace(e,t)},haxe.Log.clear=function(){js.Boot.__clear_trace()},haxe.Md5=function(){},haxe.Md5.__name__=!0,haxe.Md5.encode=function(e){return(new haxe.Md5).doEncode(e)},haxe.Md5.prototype={doEncode:function(e){for(var t=this.str2blks(e),n=1732584193,i=-271733879,o=-1732584194,r=271733878,s=0;s<t.length;){var a=n,l=i,c=o,d=r;0,n=this.ff(n,i,o,r,t[s],7,-680876936),r=this.ff(r,n,i,o,t[s+1],12,-389564586),o=this.ff(o,r,n,i,t[s+2],17,606105819),i=this.ff(i,o,r,n,t[s+3],22,-1044525330),n=this.ff(n,i,o,r,t[s+4],7,-176418897),r=this.ff(r,n,i,o,t[s+5],12,1200080426),o=this.ff(o,r,n,i,t[s+6],17,-1473231341),i=this.ff(i,o,r,n,t[s+7],22,-45705983),n=this.ff(n,i,o,r,t[s+8],7,1770035416),r=this.ff(r,n,i,o,t[s+9],12,-1958414417),o=this.ff(o,r,n,i,t[s+10],17,-42063),i=this.ff(i,o,r,n,t[s+11],22,-1990404162),n=this.ff(n,i,o,r,t[s+12],7,1804603682),r=this.ff(r,n,i,o,t[s+13],12,-40341101),o=this.ff(o,r,n,i,t[s+14],17,-1502002290),i=this.ff(i,o,r,n,t[s+15],22,1236535329),n=this.gg(n,i,o,r,t[s+1],5,-165796510),r=this.gg(r,n,i,o,t[s+6],9,-1069501632),o=this.gg(o,r,n,i,t[s+11],14,643717713),i=this.gg(i,o,r,n,t[s],20,-373897302),n=this.gg(n,i,o,r,t[s+5],5,-701558691),r=this.gg(r,n,i,o,t[s+10],9,38016083),o=this.gg(o,r,n,i,t[s+15],14,-660478335),i=this.gg(i,o,r,n,t[s+4],20,-405537848),n=this.gg(n,i,o,r,t[s+9],5,568446438),r=this.gg(r,n,i,o,t[s+14],9,-1019803690),o=this.gg(o,r,n,i,t[s+3],14,-187363961),i=this.gg(i,o,r,n,t[s+8],20,1163531501),n=this.gg(n,i,o,r,t[s+13],5,-1444681467),r=this.gg(r,n,i,o,t[s+2],9,-51403784),o=this.gg(o,r,n,i,t[s+7],14,1735328473),i=this.gg(i,o,r,n,t[s+12],20,-1926607734),n=this.hh(n,i,o,r,t[s+5],4,-378558),r=this.hh(r,n,i,o,t[s+8],11,-2022574463),o=this.hh(o,r,n,i,t[s+11],16,1839030562),i=this.hh(i,o,r,n,t[s+14],23,-35309556),n=this.hh(n,i,o,r,t[s+1],4,-1530992060),r=this.hh(r,n,i,o,t[s+4],11,1272893353),o=this.hh(o,r,n,i,t[s+7],16,-155497632),i=this.hh(i,o,r,n,t[s+10],23,-1094730640),n=this.hh(n,i,o,r,t[s+13],4,681279174),r=this.hh(r,n,i,o,t[s],11,-358537222),o=this.hh(o,r,n,i,t[s+3],16,-722521979),i=this.hh(i,o,r,n,t[s+6],23,76029189),n=this.hh(n,i,o,r,t[s+9],4,-640364487),r=this.hh(r,n,i,o,t[s+12],11,-421815835),o=this.hh(o,r,n,i,t[s+15],16,530742520),i=this.hh(i,o,r,n,t[s+2],23,-995338651),n=this.ii(n,i,o,r,t[s],6,-198630844),r=this.ii(r,n,i,o,t[s+7],10,1126891415),o=this.ii(o,r,n,i,t[s+14],15,-1416354905),i=this.ii(i,o,r,n,t[s+5],21,-57434055),n=this.ii(n,i,o,r,t[s+12],6,1700485571),r=this.ii(r,n,i,o,t[s+3],10,-1894986606),o=this.ii(o,r,n,i,t[s+10],15,-1051523),i=this.ii(i,o,r,n,t[s+1],21,-2054922799),n=this.ii(n,i,o,r,t[s+8],6,1873313359),r=this.ii(r,n,i,o,t[s+15],10,-30611744),o=this.ii(o,r,n,i,t[s+6],15,-1560198380),i=this.ii(i,o,r,n,t[s+13],21,1309151649),n=this.ii(n,i,o,r,t[s+4],6,-145523070),r=this.ii(r,n,i,o,t[s+11],10,-1120210379),o=this.ii(o,r,n,i,t[s+2],15,718787259),i=this.ii(i,o,r,n,t[s+9],21,-343485551),n=this.addme(n,a),i=this.addme(i,l),o=this.addme(o,c),r=this.addme(r,d),s+=16}return this.rhex(n)+this.rhex(i)+this.rhex(o)+this.rhex(r)},ii:function(e,t,n,i,o,r,s){return this.cmn(this.bitXOR(n,this.bitOR(t,~i)),e,t,o,r,s)},hh:function(e,t,n,i,o,r,s){return this.cmn(this.bitXOR(this.bitXOR(t,n),i),e,t,o,r,s)},gg:function(e,t,n,i,o,r,s){return this.cmn(this.bitOR(this.bitAND(t,i),this.bitAND(n,~i)),e,t,o,r,s)},ff:function(e,t,n,i,o,r,s){return this.cmn(this.bitOR(this.bitAND(t,n),this.bitAND(~t,i)),e,t,o,r,s)},cmn:function(e,t,n,i,o,r){return this.addme(this.rol(this.addme(this.addme(t,e),this.addme(i,r)),o),n)},rol:function(e,t){return e<<t|e>>>32-t},str2blks:function(e){for(var t=1+(e.length+8>>6),n=new Array,i=0,o=16*t;i<o;){n[r=i++]=0}for(var r=0;r<e.length;)n[r>>2]|=HxOverrides.cca(e,r)<<(8*e.length+r)%4*8,r++;n[r>>2]|=128<<(8*e.length+r)%4*8;var s=8*e.length,a=16*t-2;return n[a]=255&s,n[a]|=(s>>>8&255)<<8,n[a]|=(s>>>16&255)<<16,n[a]|=(s>>>24&255)<<24,n},rhex:function(e){for(var t="",n=0;n<4;){var i=n++;t+="0123456789abcdef".charAt(e>>8*i+4&15)+"0123456789abcdef".charAt(e>>8*i&15)}return t},addme:function(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n},bitAND:function(e,t){return(e>>>1&t>>>1)<<1|1&e&t},bitXOR:function(e,t){return(e>>>1^t>>>1)<<1|1&e^1&t},bitOR:function(e,t){return(e>>>1|t>>>1)<<1|(1&e|1&t)},__class__:haxe.Md5},haxe.Timer=function(e){var t=this;this.id=window.setInterval((function(){t.run()}),e)},haxe.Timer.__name__=!0,haxe.Timer.delay=function(e,t){var n=new haxe.Timer(t);return n.run=function(){n.stop(),e()},n},haxe.Timer.measure=function(e,t){var n=haxe.Timer.stamp(),i=e();return haxe.Log.trace(haxe.Timer.stamp()-n+"s",t),i},haxe.Timer.stamp=function(){return(new Date).getTime()/1e3},haxe.Timer.prototype={run:function(){},stop:function(){null!=this.id&&(window.clearInterval(this.id),this.id=null)},__class__:haxe.Timer};var js=js||{},$_;function $bind(e,t){var n=function(){return n.method.apply(n.scope,arguments)};return n.scope=e,n.method=t,n}js.Boot=function(){},js.Boot.__name__=!0,js.Boot.__unhtml=function(e){return e.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;")},js.Boot.__trace=function(e,t){var n,i=null!=t?t.fileName+":"+t.lineNumber+": ":"";i+=js.Boot.__string_rec(e,""),"undefined"!=typeof document&&null!=(n=document.getElementById("haxe:trace"))?n.innerHTML+=js.Boot.__unhtml(i)+"<br/>":"undefined"!=typeof console&&null!=console.log&&console.log(i)},js.Boot.__clear_trace=function(){var e=document.getElementById("haxe:trace");null!=e&&(e.innerHTML="")},js.Boot.isClass=function(e){return e.__name__},js.Boot.isEnum=function(e){return e.__ename__},js.Boot.getClass=function(e){return e.__class__},js.Boot.__string_rec=function(e,t){if(null==e)return"null";if(t.length>=5)return"<...>";var n=typeof e;switch("function"==n&&(e.__name__||e.__ename__)&&(n="object"),n){case"object":if(e instanceof Array){if(e.__enum__){if(2==e.length)return e[0];var i=e[0]+"(";t+="\t";for(var o=2,r=e.length;o<r;){i+=2!=(s=o++)?","+js.Boot.__string_rec(e[s],t):js.Boot.__string_rec(e[s],t)}return i+")"}var s,a=e.length;i="[";t+="\t";for(r=0;r<a;){var l=r++;i+=(l>0?",":"")+js.Boot.__string_rec(e[l],t)}return i+="]"}var c;try{c=e.toString}catch(e){return"???"}if(null!=c&&c!=Object.toString){var d=e.toString();if("[object Object]"!=d)return d}var u=null;i="{\n";t+="\t";var h=null!=e.hasOwnProperty;for(var u in e)h&&!e.hasOwnProperty(u)||"prototype"!=u&&"__class__"!=u&&"__super__"!=u&&"__interfaces__"!=u&&"__properties__"!=u&&(2!=i.length&&(i+=", \n"),i+=t+u+" : "+js.Boot.__string_rec(e[u],t));return i+="\n"+(t=t.substring(1))+"}";case"function":return"<function>";case"string":return e;default:return String(e)}},js.Boot.__interfLoop=function(e,t){if(null==e)return!1;if(e==t)return!0;var n=e.__interfaces__;if(null!=n)for(var i=0,o=n.length;i<o;){var r=n[i++];if(r==t||js.Boot.__interfLoop(r,t))return!0}return js.Boot.__interfLoop(e.__super__,t)},js.Boot.__instanceof=function(e,t){try{if(e instanceof t)return t!=Array||null==e.__enum__;if(js.Boot.__interfLoop(e.__class__,t))return!0}catch(e){if(null==t)return!1}switch(t){case Int:return Math.ceil(e%2147483648)===e;case Float:return"number"==typeof e;case Bool:return!0===e||!1===e;case String:return"string"==typeof e;case Dynamic:return!0;default:return null!=e&&(t==Class&&null!=e.__name__||(t==Enum&&null!=e.__ename__||e.__enum__==t))}},js.Boot.__cast=function(e,t){if(js.Boot.__instanceof(e,t))return e;throw"Cannot cast "+Std.string(e)+" to "+Std.string(t)},js.Lib=function(){},js.Lib.__name__=!0,js.Lib.debug=function(){},js.Lib.alert=function(e){alert(js.Boot.__string_rec(e,""))},js.Lib.eval=function(code){return eval(code)},js.Lib.setErrorHandler=function(e){js.Lib.onerror=e},Array.prototype.indexOf&&(HxOverrides.remove=function(e,t){var n=e.indexOf(t);return-1!=n&&(e.splice(n,1),!0)}),Math.__name__=["Math"],Math.NaN=Number.NaN,Math.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,Math.POSITIVE_INFINITY=Number.POSITIVE_INFINITY,Math.isFinite=function(e){return isFinite(e)},Math.isNaN=function(e){return isNaN(e)},String.prototype.__class__=String,String.__name__=!0,Array.prototype.__class__=Array,Array.__name__=!0,Date.prototype.__class__=Date,Date.__name__=["Date"];var Int={__name__:["Int"]},Dynamic={__name__:["Dynamic"]},Float=Number;Float.__name__=["Float"];var Bool=Boolean;Bool.__ename__=["Bool"];var Class={__name__:["Class"]},Enum={},Void={__ename__:["Void"]};"undefined"!=typeof document&&(js.Lib.document=document),"undefined"!=typeof window&&(js.Lib.window=window,js.Lib.window.onerror=function(e,t,n){var i=js.Lib.onerror;return null!=i&&i(e,[t+":"+n])}),com.wiris.js.JsPluginTools.main(),delete Array.prototype.__class__}(),function(){var HxOverrides=function(){};HxOverrides.__name__=!0,HxOverrides.dateStr=function(e){var t=e.getMonth()+1,n=e.getDate(),i=e.getHours(),o=e.getMinutes(),r=e.getSeconds();return e.getFullYear()+"-"+(t<10?"0"+t:""+t)+"-"+(n<10?"0"+n:""+n)+" "+(i<10?"0"+i:""+i)+":"+(o<10?"0"+o:""+o)+":"+(r<10?"0"+r:""+r)},HxOverrides.strDate=function(e){switch(e.length){case 8:var t=e.split(":"),n=new Date;return n.setTime(0),n.setUTCHours(t[0]),n.setUTCMinutes(t[1]),n.setUTCSeconds(t[2]),n;case 10:t=e.split("-");return new Date(t[0],t[1]-1,t[2],0,0,0);case 19:var i=(t=e.split(" "))[0].split("-"),o=t[1].split(":");return new Date(i[0],i[1]-1,i[2],o[0],o[1],o[2]);default:throw"Invalid date format : "+e}},HxOverrides.cca=function(e,t){var n=e.charCodeAt(t);if(n==n)return n},HxOverrides.substr=function(e,t,n){return null!=t&&0!=t&&null!=n&&n<0?"":(null==n&&(n=e.length),t<0?(t=e.length+t)<0&&(t=0):n<0&&(n=e.length+n-t),e.substr(t,n))},HxOverrides.remove=function(e,t){for(var n=0,i=e.length;n<i;){if(e[n]==t)return e.splice(n,1),!0;n++}return!1},HxOverrides.iter=function(e){return{cur:0,arr:e,hasNext:function(){return this.cur<this.arr.length},next:function(){return this.arr[this.cur++]}}};var IntIter=function(e,t){this.min=e,this.max=t};IntIter.__name__=!0,IntIter.prototype={next:function(){return this.min++},hasNext:function(){return this.min<this.max},__class__:IntIter};var Std=function(){};Std.__name__=!0,Std.is=function(e,t){return js.Boot.__instanceof(e,t)},Std.string=function(e){return js.Boot.__string_rec(e,"")},Std.int=function(e){return 0|e},Std.parseInt=function(e){var t=parseInt(e,10);return 0!=t||120!=HxOverrides.cca(e,1)&&88!=HxOverrides.cca(e,1)||(t=parseInt(e)),isNaN(t)?null:t},Std.parseFloat=function(e){return parseFloat(e)},Std.random=function(e){return Math.floor(Math.random()*e)};var com=com||{};com.wiris||(com.wiris={}),com.wiris.js||(com.wiris.js={}),com.wiris.js.JsPluginTools=function(){this.tryReady()},com.wiris.js.JsPluginTools.__name__=!0,com.wiris.js.JsPluginTools.main=function(){var e;e=com.wiris.js.JsPluginTools.getInstance(),haxe.Timer.delay($bind(e,e.tryReady),100)},com.wiris.js.JsPluginTools.getInstance=function(){return null==com.wiris.js.JsPluginTools.instance&&(com.wiris.js.JsPluginTools.instance=new com.wiris.js.JsPluginTools),com.wiris.js.JsPluginTools.instance},com.wiris.js.JsPluginTools.bypassEncapsulation=function(){null==window.com&&(window.com={}),null==window.com.wiris&&(window.com.wiris={}),null==window.com.wiris.js&&(window.com.wiris.js={}),null==window.com.wiris.js.JsPluginTools&&(window.com.wiris.js.JsPluginTools=com.wiris.js.JsPluginTools.getInstance())},com.wiris.js.JsPluginTools.prototype={md5encode:function(e){return haxe.Md5.encode(e)},doLoad:function(){this.ready=!0,com.wiris.js.JsPluginTools.instance=this,com.wiris.js.JsPluginTools.bypassEncapsulation()},tryReady:function(){this.ready=!1,js.Lib.document.readyState&&(this.doLoad(),this.ready=!0),this.ready||haxe.Timer.delay($bind(this,this.tryReady),100)},__class__:com.wiris.js.JsPluginTools};var haxe=haxe||{};haxe.Log=function(){},haxe.Log.__name__=!0,haxe.Log.trace=function(e,t){js.Boot.__trace(e,t)},haxe.Log.clear=function(){js.Boot.__clear_trace()},haxe.Md5=function(){},haxe.Md5.__name__=!0,haxe.Md5.encode=function(e){return(new haxe.Md5).doEncode(e)},haxe.Md5.prototype={doEncode:function(e){for(var t=this.str2blks(e),n=1732584193,i=-271733879,o=-1732584194,r=271733878,s=0;s<t.length;){var a=n,l=i,c=o,d=r;0,n=this.ff(n,i,o,r,t[s],7,-680876936),r=this.ff(r,n,i,o,t[s+1],12,-389564586),o=this.ff(o,r,n,i,t[s+2],17,606105819),i=this.ff(i,o,r,n,t[s+3],22,-1044525330),n=this.ff(n,i,o,r,t[s+4],7,-176418897),r=this.ff(r,n,i,o,t[s+5],12,1200080426),o=this.ff(o,r,n,i,t[s+6],17,-1473231341),i=this.ff(i,o,r,n,t[s+7],22,-45705983),n=this.ff(n,i,o,r,t[s+8],7,1770035416),r=this.ff(r,n,i,o,t[s+9],12,-1958414417),o=this.ff(o,r,n,i,t[s+10],17,-42063),i=this.ff(i,o,r,n,t[s+11],22,-1990404162),n=this.ff(n,i,o,r,t[s+12],7,1804603682),r=this.ff(r,n,i,o,t[s+13],12,-40341101),o=this.ff(o,r,n,i,t[s+14],17,-1502002290),i=this.ff(i,o,r,n,t[s+15],22,1236535329),n=this.gg(n,i,o,r,t[s+1],5,-165796510),r=this.gg(r,n,i,o,t[s+6],9,-1069501632),o=this.gg(o,r,n,i,t[s+11],14,643717713),i=this.gg(i,o,r,n,t[s],20,-373897302),n=this.gg(n,i,o,r,t[s+5],5,-701558691),r=this.gg(r,n,i,o,t[s+10],9,38016083),o=this.gg(o,r,n,i,t[s+15],14,-660478335),i=this.gg(i,o,r,n,t[s+4],20,-405537848),n=this.gg(n,i,o,r,t[s+9],5,568446438),r=this.gg(r,n,i,o,t[s+14],9,-1019803690),o=this.gg(o,r,n,i,t[s+3],14,-187363961),i=this.gg(i,o,r,n,t[s+8],20,1163531501),n=this.gg(n,i,o,r,t[s+13],5,-1444681467),r=this.gg(r,n,i,o,t[s+2],9,-51403784),o=this.gg(o,r,n,i,t[s+7],14,1735328473),i=this.gg(i,o,r,n,t[s+12],20,-1926607734),n=this.hh(n,i,o,r,t[s+5],4,-378558),r=this.hh(r,n,i,o,t[s+8],11,-2022574463),o=this.hh(o,r,n,i,t[s+11],16,1839030562),i=this.hh(i,o,r,n,t[s+14],23,-35309556),n=this.hh(n,i,o,r,t[s+1],4,-1530992060),r=this.hh(r,n,i,o,t[s+4],11,1272893353),o=this.hh(o,r,n,i,t[s+7],16,-155497632),i=this.hh(i,o,r,n,t[s+10],23,-1094730640),n=this.hh(n,i,o,r,t[s+13],4,681279174),r=this.hh(r,n,i,o,t[s],11,-358537222),o=this.hh(o,r,n,i,t[s+3],16,-722521979),i=this.hh(i,o,r,n,t[s+6],23,76029189),n=this.hh(n,i,o,r,t[s+9],4,-640364487),r=this.hh(r,n,i,o,t[s+12],11,-421815835),o=this.hh(o,r,n,i,t[s+15],16,530742520),i=this.hh(i,o,r,n,t[s+2],23,-995338651),n=this.ii(n,i,o,r,t[s],6,-198630844),r=this.ii(r,n,i,o,t[s+7],10,1126891415),o=this.ii(o,r,n,i,t[s+14],15,-1416354905),i=this.ii(i,o,r,n,t[s+5],21,-57434055),n=this.ii(n,i,o,r,t[s+12],6,1700485571),r=this.ii(r,n,i,o,t[s+3],10,-1894986606),o=this.ii(o,r,n,i,t[s+10],15,-1051523),i=this.ii(i,o,r,n,t[s+1],21,-2054922799),n=this.ii(n,i,o,r,t[s+8],6,1873313359),r=this.ii(r,n,i,o,t[s+15],10,-30611744),o=this.ii(o,r,n,i,t[s+6],15,-1560198380),i=this.ii(i,o,r,n,t[s+13],21,1309151649),n=this.ii(n,i,o,r,t[s+4],6,-145523070),r=this.ii(r,n,i,o,t[s+11],10,-1120210379),o=this.ii(o,r,n,i,t[s+2],15,718787259),i=this.ii(i,o,r,n,t[s+9],21,-343485551),n=this.addme(n,a),i=this.addme(i,l),o=this.addme(o,c),r=this.addme(r,d),s+=16}return this.rhex(n)+this.rhex(i)+this.rhex(o)+this.rhex(r)},ii:function(e,t,n,i,o,r,s){return this.cmn(this.bitXOR(n,this.bitOR(t,~i)),e,t,o,r,s)},hh:function(e,t,n,i,o,r,s){return this.cmn(this.bitXOR(this.bitXOR(t,n),i),e,t,o,r,s)},gg:function(e,t,n,i,o,r,s){return this.cmn(this.bitOR(this.bitAND(t,i),this.bitAND(n,~i)),e,t,o,r,s)},ff:function(e,t,n,i,o,r,s){return this.cmn(this.bitOR(this.bitAND(t,n),this.bitAND(~t,i)),e,t,o,r,s)},cmn:function(e,t,n,i,o,r){return this.addme(this.rol(this.addme(this.addme(t,e),this.addme(i,r)),o),n)},rol:function(e,t){return e<<t|e>>>32-t},str2blks:function(e){for(var t=1+(e.length+8>>6),n=new Array,i=0,o=16*t;i<o;){n[r=i++]=0}for(var r=0;r<e.length;)n[r>>2]|=HxOverrides.cca(e,r)<<(8*e.length+r)%4*8,r++;n[r>>2]|=128<<(8*e.length+r)%4*8;var s=8*e.length,a=16*t-2;return n[a]=255&s,n[a]|=(s>>>8&255)<<8,n[a]|=(s>>>16&255)<<16,n[a]|=(s>>>24&255)<<24,n},rhex:function(e){for(var t="",n=0;n<4;){var i=n++;t+="0123456789abcdef".charAt(e>>8*i+4&15)+"0123456789abcdef".charAt(e>>8*i&15)}return t},addme:function(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n},bitAND:function(e,t){return(e>>>1&t>>>1)<<1|1&e&t},bitXOR:function(e,t){return(e>>>1^t>>>1)<<1|1&e^1&t},bitOR:function(e,t){return(e>>>1|t>>>1)<<1|(1&e|1&t)},__class__:haxe.Md5},haxe.Timer=function(e){var t=this;this.id=window.setInterval((function(){t.run()}),e)},haxe.Timer.__name__=!0,haxe.Timer.delay=function(e,t){var n=new haxe.Timer(t);return n.run=function(){n.stop(),e()},n},haxe.Timer.measure=function(e,t){var n=haxe.Timer.stamp(),i=e();return haxe.Log.trace(haxe.Timer.stamp()-n+"s",t),i},haxe.Timer.stamp=function(){return(new Date).getTime()/1e3},haxe.Timer.prototype={run:function(){},stop:function(){null!=this.id&&(window.clearInterval(this.id),this.id=null)},__class__:haxe.Timer};var js=js||{},$_;function $bind(e,t){var n=function(){return n.method.apply(n.scope,arguments)};return n.scope=e,n.method=t,n}js.Boot=function(){},js.Boot.__name__=!0,js.Boot.__unhtml=function(e){return e.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;")},js.Boot.__trace=function(e,t){var n,i=null!=t?t.fileName+":"+t.lineNumber+": ":"";i+=js.Boot.__string_rec(e,""),"undefined"!=typeof document&&null!=(n=document.getElementById("haxe:trace"))?n.innerHTML+=js.Boot.__unhtml(i)+"<br/>":"undefined"!=typeof console&&null!=console.log&&console.log(i)},js.Boot.__clear_trace=function(){var e=document.getElementById("haxe:trace");null!=e&&(e.innerHTML="")},js.Boot.isClass=function(e){return e.__name__},js.Boot.isEnum=function(e){return e.__ename__},js.Boot.getClass=function(e){return e.__class__},js.Boot.__string_rec=function(e,t){if(null==e)return"null";if(t.length>=5)return"<...>";var n=typeof e;switch("function"==n&&(e.__name__||e.__ename__)&&(n="object"),n){case"object":if(e instanceof Array){if(e.__enum__){if(2==e.length)return e[0];var i=e[0]+"(";t+="\t";for(var o=2,r=e.length;o<r;){i+=2!=(s=o++)?","+js.Boot.__string_rec(e[s],t):js.Boot.__string_rec(e[s],t)}return i+")"}var s,a=e.length;i="[";t+="\t";for(r=0;r<a;){var l=r++;i+=(l>0?",":"")+js.Boot.__string_rec(e[l],t)}return i+="]"}var c;try{c=e.toString}catch(e){return"???"}if(null!=c&&c!=Object.toString){var d=e.toString();if("[object Object]"!=d)return d}var u=null;i="{\n";t+="\t";var h=null!=e.hasOwnProperty;for(var u in e)h&&!e.hasOwnProperty(u)||"prototype"!=u&&"__class__"!=u&&"__super__"!=u&&"__interfaces__"!=u&&"__properties__"!=u&&(2!=i.length&&(i+=", \n"),i+=t+u+" : "+js.Boot.__string_rec(e[u],t));return i+="\n"+(t=t.substring(1))+"}";case"function":return"<function>";case"string":return e;default:return String(e)}},js.Boot.__interfLoop=function(e,t){if(null==e)return!1;if(e==t)return!0;var n=e.__interfaces__;if(null!=n)for(var i=0,o=n.length;i<o;){var r=n[i++];if(r==t||js.Boot.__interfLoop(r,t))return!0}return js.Boot.__interfLoop(e.__super__,t)},js.Boot.__instanceof=function(e,t){try{if(e instanceof t)return t!=Array||null==e.__enum__;if(js.Boot.__interfLoop(e.__class__,t))return!0}catch(e){if(null==t)return!1}switch(t){case Int:return Math.ceil(e%2147483648)===e;case Float:return"number"==typeof e;case Bool:return!0===e||!1===e;case String:return"string"==typeof e;case Dynamic:return!0;default:return null!=e&&(t==Class&&null!=e.__name__||(t==Enum&&null!=e.__ename__||e.__enum__==t))}},js.Boot.__cast=function(e,t){if(js.Boot.__instanceof(e,t))return e;throw"Cannot cast "+Std.string(e)+" to "+Std.string(t)},js.Lib=function(){},js.Lib.__name__=!0,js.Lib.debug=function(){},js.Lib.alert=function(e){alert(js.Boot.__string_rec(e,""))},js.Lib.eval=function(code){return eval(code)},js.Lib.setErrorHandler=function(e){js.Lib.onerror=e},Array.prototype.indexOf&&(HxOverrides.remove=function(e,t){var n=e.indexOf(t);return-1!=n&&(e.splice(n,1),!0)}),Math.__name__=["Math"],Math.NaN=Number.NaN,Math.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,Math.POSITIVE_INFINITY=Number.POSITIVE_INFINITY,Math.isFinite=function(e){return isFinite(e)},Math.isNaN=function(e){return isNaN(e)},String.prototype.__class__=String,String.__name__=!0,Array.prototype.__class__=Array,Array.__name__=!0,Date.prototype.__class__=Date,Date.__name__=["Date"];var Int={__name__:["Int"]},Dynamic={__name__:["Dynamic"]},Float=Number;Float.__name__=["Float"];var Bool=Boolean;Bool.__ename__=["Bool"];var Class={__name__:["Class"]},Enum={},Void={__ename__:["Void"]};"undefined"!=typeof document&&(js.Lib.document=document),"undefined"!=typeof window&&(js.Lib.window=window,js.Lib.window.onerror=function(e,t,n){var i=js.Lib.onerror;return null!=i&&i(e,[t+":"+n])}),com.wiris.js.JsPluginTools.main()}(),delete Array.prototype.__class__},function(e,t,n){var i=n(1),o=n(104);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".wrs_modal_overlay{position:fixed;font-family:arial,sans-serif;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,.8);z-index:999998;opacity:.65;pointer-events:auto}.wrs_modal_overlay.wrs_modal_android,.wrs_modal_overlay.wrs_modal_ios{visibility:hidden;display:none}.wrs_modal_overlay.wrs_modal_ios.moodle{position:fixed}.wrs_modal_overlay.wrs_modal_desktop.wrs_stack{background:transparent;display:none}.wrs_modal_overlay.wrs_modal_desktop.wrs_maximized{background:rgba(0,0,0,.8)}.wrs_modal_overlay.wrs_modal_desktop.wrs_closed,.wrs_modal_overlay.wrs_modal_desktop.wrs_minimized{background:transparent;display:none}.wrs_modal_title{color:#fff;padding:5px 0 5px 10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;text-align:left}.wrs_modal_close_button{background-repeat:no-repeat}.wrs_modal_close_button,.wrs_modal_minimize_button{float:right;cursor:pointer;color:#fff;padding:5px 10px 5px 0;margin:10px 7px 0 0}.wrs_modal_minimize_button{top:inherit}.wrs_modal_stack_button{float:right;cursor:pointer;color:#fff;margin:10px 7px 0 0;padding:5px 10px 5px 0;top:inherit}.wrs_modal_stack_button.wrs_minimized,.wrs_modal_stack_button.wrs_stack{visibility:hidden;margin:0;padding:0}.wrs_modal_maximize_button{float:right;cursor:pointer;color:#fff;margin:10px 7px 0 0;padding:5px 10px 5px 0;top:inherit}.wrs_modal_maximize_button.wrs_maximized{visibility:hidden;margin:0;padding:0}.wrs_modal_wrapper{display:block}.wrs_modal_title_bar{display:block;background-color:#778e9a}.wrs_modal_dialogContainer{border:none;background:#fafafa;z-index:999999}.wrs_modal_dialogContainer.wrs_modal_desktop{font-size:14px}.wrs_modal_dialogContainer.wrs_modal_desktop.wrs_maximized{position:fixed}.wrs_modal_dialogContainer.wrs_modal_desktop.wrs_minimized{position:fixed;top:inherit;margin:0 10px 0 0}.wrs_modal_dialogContainer.wrs_closed{visibility:hidden;display:none;opacity:0}.wrs_modal_dialogContainer.wrs_modal_desktop.wrs_stack{position:fixed;bottom:0;right:0;box-shadow:0 2px 8px rgba(0,0,0,.5)}.wrs_modal_dialogContainer.wrs_drag,.wrs_modal_dialogContainer.wrs_modal_desktop.wrs_drag{box-shadow:0 2px 8px rgba(0,0,0,.5)}.wrs_modal_dialogContainer.wrs_modal_android{width:99%;height:99%}.wrs_modal_dialogContainer.wrs_modal_android,.wrs_modal_dialogContainer.wrs_modal_ios{margin:auto;overflow:hidden;transform:translate(50%,-50%);top:50%;right:50%!important;position:fixed}.wrs_modal_dialogContainer.wrs_modal_ios{width:100%;height:100%}.wrs_content_container.wrs_minimized{display:none}.wrs_content_container.wrs_modal_android{width:100%;flex-grow:1;display:flex;flex-direction:column}.wrs_content_container.wrs_modal_android>div:first-child,.wrs_content_container.wrs_modal_desktop>div:first-child,.wrs_content_container.wrs_modal_ios>div:first-child{flex-grow:1}.wrs_modal_wrapper.wrs_modal_android{margin:auto;display:flex;flex-direction:column;height:100%;width:100%}.wrs_content_container.wrs_modal_desktop,.wrs_content_container.wrs_modal_ios{width:100%;flex-grow:1;display:flex;flex-direction:column}.wrs_modal_wrapper.wrs_modal_ios{margin:auto;display:flex;flex-direction:column;height:100%;width:100%}.wrs_virtual_keyboard{height:100%;width:100%;top:0;left:50%;transform:translate(-50%)}@media (orientation:portrait){.wrs_modal_dialogContainer.wrs_modal_mobile{width:100vmin;height:100vmin;margin:auto;border-width:0}.wrs_modal_wrapper.wrs_modal_mobile{width:100vmin;height:100vmin;margin:auto}}@media (orientation:landscape){.wrs_modal_dialogContainer.wrs_modal_mobile{width:100vmin;height:100vmin;margin:auto;border-width:0}.wrs_modal_wrapper.wrs_modal_mobile{width:100vmin;height:100vmin;margin:auto}}.wrs_modal_dialogContainer.wrs_modal_badStock,.wrs_modal_wrapper.wrs_modal_badStock{width:100%;height:280px;margin:0 auto;border-width:0}.wrs_noselect{-khtml-user-select:none}.wrs_bottom_right_resizer,.wrs_noselect{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.wrs_bottom_right_resizer{width:10px;height:10px;color:#778e9a;position:absolute;right:4px;bottom:8px;cursor:se-resize}.wrs_bottom_left_resizer{width:15px;height:15px;color:#778e9a;position:absolute;left:0;top:0;cursor:se-resize}.wrs_modal_controls{height:42px;margin:3px 0;overflow:hidden;line-height:normal}.wrs_modal_links{margin:10px auto 0;font-family:arial,sans-serif;padding:6px;display:inline;float:right;text-align:right}.wrs_modal_links>a{text-decoration:none;color:#778e9a;font-size:16px}.wrs_modal_button_cancel,.wrs_modal_button_cancel:active,.wrs_modal_button_cancel:focus,.wrs_modal_button_cancel:hover,.wrs_modal_button_cancel:visited{min-width:80px;font-size:14px;border-radius:3px;border:1px solid #778e9a;padding:6px 8px;margin:10px auto 0 5px;cursor:pointer;font-family:arial,sans-serif;background-color:#ddd;height:32px}.wrs_modal_button_accept,.wrs_modal_button_accept:active,.wrs_modal_button_accept:focus,.wrs_modal_button_accept:hover,.wrs_modal_button_accept:visited{min-width:80px;font-size:14px;border-radius:3px;border:1px solid #778e9a;padding:6px 8px;margin:10px 5px 0 auto;color:#fff;background:#778e9a;cursor:pointer;font-family:arial,sans-serif;height:32px}.wrs_editor_vertical_bar{height:20px;float:right;background:none;width:20px;cursor:pointer}.wrs_modal_buttons_container{display:inline;float:left}.wrs_modal_buttons_container.wrs_modalAndroid{padding-left:6px}.wrs_modal_buttons_container.wrs_modalDesktop{padding-left:0}.wrs_modal_buttons_container>button{line-height:normal;background-image:none}.wrs_modal_wrapper{margin:6px;display:flex;flex-direction:column}.wrs_modal_wrapper.wrs_modal_desktop.wrs_minimized{display:none}@media only screen and (max-device-width:480px) and (orientation:portrait){#wrs_modal_wrapper{width:140%}}.wrs_popupmessage_overlay_envolture{display:none;width:100%}.wrs_popupmessage_overlay{position:absolute;width:100%;height:100%;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.5);z-index:4;cursor:pointer}.wrs_popupmessage_panel{top:50%;left:50%;transform:translate(-50%,-50%);position:absolute;background:#fff;max-width:500px;width:75%;border-radius:2px;padding:20px;font-family:sans-serif;font-size:15px;text-align:left;color:#2e2e2e;z-index:5;max-height:75%;overflow:auto}.wrs_popupmessage_button_area{margin:10px 0 0}.wrs_panelContainer *{border:0}.wrs_button_cancel,.wrs_button_cancel:active,.wrs_button_cancel:focus,.wrs_button_cancel:hover,.wrs_button_cancel:visited{min-width:80px;font-size:14px;border-radius:3px;border:1px solid #778e9a;padding:6px 8px;margin:10px auto 0 5px;cursor:pointer;font-family:arial,sans-serif;background-color:#ddd;background-image:none;height:32px}.wrs_button_accept,.wrs_button_accept:active,.wrs_button_accept:focus,.wrs_button_accept:hover,.wrs_button_accept:visited{min-width:80px;font-size:14px;border-radius:3px;border:1px solid #778e9a;padding:6px 8px;margin:10px 5px 0 auto;color:#fff;background:#778e9a;cursor:pointer;font-family:arial,sans-serif;height:32px}.wrs_editor button{box-shadow:none}.wrs_editor .wrs_header button{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.wrs_modal_overlay.wrs_modal_desktop.wrs_stack.wrs_overlay_active{display:block}.wrs_toolbar tr:focus,.wrs_toolbar tr:hover{background:none}.wrs_modal_rtl .wrs_modal_button_cancel{margin-right:5px;margin-left:0}.wrs_modal_rtl .wrs_modal_button_accept{margin-right:0;margin-left:5px}.wrs_modal_rtl .wrs_button_cancel{margin-right:5px;margin-left:0}.wrs_modal_rtl .wrs_button_accept{margin-right:0;margin-left:5px}"},function(e,t,n){var i=n(1),o=n(106);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};i(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".fill{background:#ff0;padding:4px 2px;outline-offset:-2px;line-height:1em;margin:0 1px;border:1px solid #d3d3d3}.fill::selection{display:none}"},function(e,t,n){"use strict";n.r(t);var i=function(){return function e(){e.called=!0}};class o{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=i(),this.off=i()}}const r=new Array(256).fill().map((e,t)=>("0"+t.toString(16)).slice(-2));function s(){const e=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0;return"e"+r[e>>0&255]+r[e>>8&255]+r[e>>16&255]+r[e>>24&255]+r[t>>0&255]+r[t>>8&255]+r[t>>16&255]+r[t>>24&255]+r[n>>0&255]+r[n>>8&255]+r[n>>16&255]+r[n>>24&255]+r[i>>0&255]+r[i>>8&255]+r[i>>16&255]+r[i>>24&255]}var a={get(e){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5},l=(n(6),n(0));const c=Symbol("listeningTo"),d=Symbol("emitterId");var u={on(e,t,n={}){this.listenTo(this,e,t,n)},once(e,t,n){let i=!1;this.listenTo(this,e,(function(e,...n){i||(i=!0,e.off(),t.call(this,e,...n))}),n)},off(e,t){this.stopListening(this,e,t)},listenTo(e,t,n,i={}){let o,r;this[c]||(this[c]={});const s=this[c];m(e)||h(e);const l=m(e);(o=s[l])||(o=s[l]={emitter:e,callbacks:{}}),(r=o.callbacks[t])||(r=o.callbacks[t]=[]),r.push(n),function(e,t){const n=g(e);if(n[t])return;let i=t,o=null;const r=[];for(;""!==i&&!n[i];)n[i]={callbacks:[],childEvents:[]},r.push(n[i]),o&&n[i].childEvents.push(o),o=i,i=i.substr(0,i.lastIndexOf(":"));if(""!==i){for(const e of r)e.callbacks=n[i].callbacks.slice();n[i].childEvents.push(o)}}(e,t);const d=p(e,t),u=a.get(i.priority),f={callback:n,priority:u};for(const e of d){let t=!1;for(let n=0;n<e.length;n++)if(e[n].priority<u){e.splice(n,0,f),t=!0;break}t||e.push(f)}},stopListening(e,t,n){const i=this[c];let o=e&&m(e);const r=i&&o&&i[o],s=r&&t&&r.callbacks[t];if(!(!i||e&&!r||t&&!s))if(n)w(e,t,n);else if(s){for(;n=s.pop();)w(e,t,n);delete r.callbacks[t]}else if(r){for(t in r.callbacks)this.stopListening(e,t);delete i[o]}else{for(o in i)this.stopListening(i[o].emitter);delete this[c]}},fire(e,...t){try{const n=e instanceof o?e:new o(this,e),i=n.name;let r=function e(t,n){let i;if(!t._events||!(i=t._events[n])||!i.callbacks.length)return n.indexOf(":")>-1?e(t,n.substr(0,n.lastIndexOf(":"))):null;return i.callbacks}(this,i);if(n.path.push(this),r){const e=[n,...t];r=Array.from(r);for(let t=0;t<r.length&&(r[t].callback.apply(this,e),n.off.called&&(delete n.off.called,w(this,i,r[t].callback)),!n.stop.called);t++);}if(this._delegations){const e=this._delegations.get(i),o=this._delegations.get("*");e&&f(e,n,t),o&&f(o,n,t)}return n.return}catch(e){l.b.rethrowUnexpectedError(e,this)}},delegate(...e){return{to:(t,n)=>{this._delegations||(this._delegations=new Map),e.forEach(e=>{const i=this._delegations.get(e);i?i.set(t,n):this._delegations.set(e,new Map([[t,n]]))})}}},stopDelegating(e,t){if(this._delegations)if(e)if(t){const n=this._delegations.get(e);n&&n.delete(t)}else this._delegations.delete(e);else this._delegations.clear()}};function h(e,t){e[d]||(e[d]=t||s())}function m(e){return e[d]}function g(e){return e._events||Object.defineProperty(e,"_events",{value:{}}),e._events}function p(e,t){const n=g(e)[t];if(!n)return[];let i=[n.callbacks];for(let t=0;t<n.childEvents.length;t++){const o=p(e,n.childEvents[t]);i=i.concat(o)}return i}function f(e,t,n){for(let[i,r]of e){r?"function"==typeof r&&(r=r(t.name)):r=t.name;const e=new o(t.source,r);e.path=[...t.path],i.fire(e,...n)}}function w(e,t,n){const i=p(e,t);for(const e of i)for(let t=0;t<e.length;t++)e[t].callback==n&&(e.splice(t,1),t--)}var b=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},_=n(3),k=_.a.Symbol,v=Object.prototype,y=v.hasOwnProperty,x=v.toString,A=k?k.toStringTag:void 0;var C=function(e){var t=y.call(e,A),n=e[A];try{e[A]=void 0;var i=!0}catch(e){}var o=x.call(e);return i&&(t?e[A]=n:delete e[A]),o},T=Object.prototype.toString;var E=function(e){return T.call(e)},M=k?k.toStringTag:void 0;var P=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":M&&M in Object(e)?C(e):E(e)};var S,I=function(e){if(!b(e))return!1;var t=P(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},O=_.a["__core-js_shared__"],N=(S=/[^.]+$/.exec(O&&O.keys&&O.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"";var z=function(e){return!!N&&N in e},R=Function.prototype.toString;var L=function(e){if(null!=e){try{return R.call(e)}catch(e){}try{return e+""}catch(e){}}return""},j=/^\[object .+?Constructor\]$/,D=Function.prototype,B=Object.prototype,V=D.toString,F=B.hasOwnProperty,H=RegExp("^"+V.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var U=function(e){return!(!b(e)||z(e))&&(I(e)?H:j).test(L(e))};var W=function(e,t){return null==e?void 0:e[t]};var $=function(e,t){var n=W(e,t);return U(n)?n:void 0},q=function(){try{var e=$(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Y=function(e,t,n){"__proto__"==t&&q?q(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var J=function(e,t){return e===t||e!=e&&t!=t},K=Object.prototype.hasOwnProperty;var X=function(e,t,n){var i=e[t];K.call(e,t)&&J(i,n)&&(void 0!==n||t in e)||Y(e,t,n)};var G=function(e,t,n,i){var o=!n;n||(n={});for(var r=-1,s=t.length;++r<s;){var a=t[r],l=i?i(n[a],e[a],a,n,e):void 0;void 0===l&&(l=e[a]),o?Y(n,a,l):X(n,a,l)}return n};var Q=function(e){return e};var Z=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},ee=Math.max;var te=function(e,t,n){return t=ee(void 0===t?e.length-1:t,0),function(){for(var i=arguments,o=-1,r=ee(i.length-t,0),s=Array(r);++o<r;)s[o]=i[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=i[o];return a[t]=n(s),Z(e,this,a)}};var ne=function(e){return function(){return e}},ie=q?function(e,t){return q(e,"toString",{configurable:!0,enumerable:!1,value:ne(t),writable:!0})}:Q,oe=Date.now;var re=function(e){var t=0,n=0;return function(){var i=oe(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ie);var se=function(e,t){return re(te(e,t,Q),e+"")};var ae=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var le=function(e){return null!=e&&ae(e.length)&&!I(e)},ce=/^(?:0|[1-9]\d*)$/;var de=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ce.test(e))&&e>-1&&e%1==0&&e<t};var ue=function(e,t,n){if(!b(n))return!1;var i=typeof t;return!!("number"==i?le(n)&&de(t,n.length):"string"==i&&t in n)&&J(n[t],e)};var he=function(e){return se((function(t,n){var i=-1,o=n.length,r=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(r=e.length>3&&"function"==typeof r?(o--,r):void 0,s&&ue(n[0],n[1],s)&&(r=o<3?void 0:r,o=1),t=Object(t);++i<o;){var a=n[i];a&&e(t,a,i,r)}return t}))};var me=function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i};var ge=function(e){return null!=e&&"object"==typeof e};var pe=function(e){return ge(e)&&"[object Arguments]"==P(e)},fe=Object.prototype,we=fe.hasOwnProperty,be=fe.propertyIsEnumerable,_e=pe(function(){return arguments}())?pe:function(e){return ge(e)&&we.call(e,"callee")&&!be.call(e,"callee")},ke=Array.isArray,ve=n(4),ye={};ye["[object Float32Array]"]=ye["[object Float64Array]"]=ye["[object Int8Array]"]=ye["[object Int16Array]"]=ye["[object Int32Array]"]=ye["[object Uint8Array]"]=ye["[object Uint8ClampedArray]"]=ye["[object Uint16Array]"]=ye["[object Uint32Array]"]=!0,ye["[object Arguments]"]=ye["[object Array]"]=ye["[object ArrayBuffer]"]=ye["[object Boolean]"]=ye["[object DataView]"]=ye["[object Date]"]=ye["[object Error]"]=ye["[object Function]"]=ye["[object Map]"]=ye["[object Number]"]=ye["[object Object]"]=ye["[object RegExp]"]=ye["[object Set]"]=ye["[object String]"]=ye["[object WeakMap]"]=!1;var xe=function(e){return ge(e)&&ae(e.length)&&!!ye[P(e)]};var Ae=function(e){return function(t){return e(t)}},Ce=n(5),Te=Ce.a&&Ce.a.isTypedArray,Ee=Te?Ae(Te):xe,Me=Object.prototype.hasOwnProperty;var Pe=function(e,t){var n=ke(e),i=!n&&_e(e),o=!n&&!i&&Object(ve.a)(e),r=!n&&!i&&!o&&Ee(e),s=n||i||o||r,a=s?me(e.length,String):[],l=a.length;for(var c in e)!t&&!Me.call(e,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||de(c,l))||a.push(c);return a},Se=Object.prototype;var Ie=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Se)};var Oe=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},Ne=Object.prototype.hasOwnProperty;var ze=function(e){if(!b(e))return Oe(e);var t=Ie(e),n=[];for(var i in e)("constructor"!=i||!t&&Ne.call(e,i))&&n.push(i);return n};var Re=function(e){return le(e)?Pe(e,!0):ze(e)},Le=he((function(e,t){G(t,Re(t),e)}));const je=Symbol("observableProperties"),De=Symbol("boundObservables"),Be=Symbol("boundProperties"),Ve={set(e,t){if(b(e))return void Object.keys(e).forEach(t=>{this.set(t,e[t])},this);He(this);const n=this[je];if(e in this&&!n.has(e))throw new l.b("observable-set-cannot-override",this);Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>n.get(e),set(t){const i=n.get(e);let o=this.fire("set:"+e,e,t,i);void 0===o&&(o=t),i===o&&n.has(e)||(n.set(e,o),this.fire("change:"+e,e,o,i))}}),this[e]=t},bind(...e){if(!e.length||!$e(e))throw new l.b("observable-bind-wrong-properties",this);if(new Set(e).size!==e.length)throw new l.b("observable-bind-duplicate-properties",this);He(this);const t=this[Be];e.forEach(e=>{if(t.has(e))throw new l.b("observable-bind-rebind",this)});const n=new Map;return e.forEach(e=>{const i={property:e,to:[]};t.set(e,i),n.set(e,i)}),{to:Ue,toMany:We,_observable:this,_bindProperties:e,_to:[],_bindings:n}},unbind(...e){if(!this[je])return;const t=this[Be],n=this[De];if(e.length){if(!$e(e))throw new l.b("observable-unbind-wrong-properties",this);e.forEach(e=>{const i=t.get(e);if(!i)return;let o,r,s,a;i.to.forEach(e=>{o=e[0],r=e[1],s=n.get(o),a=s[r],a.delete(i),a.size||delete s[r],Object.keys(s).length||(n.delete(o),this.stopListening(o,"change"))}),t.delete(e)})}else n.forEach((e,t)=>{this.stopListening(t,"change")}),n.clear(),t.clear()},decorate(e){const t=this[e];if(!t)throw new l.b("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:e});this.on(e,(e,n)=>{e.return=t.apply(this,n)}),this[e]=function(...t){return this.fire(e,t)}}};Le(Ve,u);var Fe=Ve;function He(e){e[je]||(Object.defineProperty(e,je,{value:new Map}),Object.defineProperty(e,De,{value:new Map}),Object.defineProperty(e,Be,{value:new Map}))}function Ue(...e){const t=function(...e){if(!e.length)throw new l.b("observable-bind-to-parse-error",null);const t={to:[]};let n;"function"==typeof e[e.length-1]&&(t.callback=e.pop());return e.forEach(e=>{if("string"==typeof e)n.properties.push(e);else{if("object"!=typeof e)throw new l.b("observable-bind-to-parse-error",null);n={observable:e,properties:[]},t.to.push(n)}}),t}(...e),n=Array.from(this._bindings.keys()),i=n.length;if(!t.callback&&t.to.length>1)throw new l.b("observable-bind-to-no-callback",this);if(i>1&&t.callback)throw new l.b("observable-bind-to-extra-callback",this);var o;t.to.forEach(e=>{if(e.properties.length&&e.properties.length!==i)throw new l.b("observable-bind-to-properties-length",this);e.properties.length||(e.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(n[0]).callback=t.callback),o=this._observable,this._to.forEach(e=>{const t=o[De];let n;t.get(e.observable)||o.listenTo(e.observable,"change",(i,r)=>{n=t.get(e.observable)[r],n&&n.forEach(e=>{qe(o,e.property)})})}),function(e){let t;e._bindings.forEach((n,i)=>{e._to.forEach(o=>{t=o.properties[n.callback?0:e._bindProperties.indexOf(i)],n.to.push([o.observable,t]),function(e,t,n,i){const o=e[De],r=o.get(n),s=r||{};s[i]||(s[i]=new Set);s[i].add(t),r||o.set(n,s)}(e._observable,n,o.observable,t)})})}(this),this._bindProperties.forEach(e=>{qe(this._observable,e)})}function We(e,t,n){if(this._bindings.size>1)throw new l.b("observable-bind-to-many-not-one-binding",this);this.to(...function(e,t){const n=e.map(e=>[e,t]);return Array.prototype.concat.apply([],n)}(e,t),n)}function $e(e){return e.every(e=>"string"==typeof e)}function qe(e,t){const n=e[Be].get(t);let i;n.callback?i=n.callback.apply(e,n.to.map(e=>e[0][e[1]])):(i=n.to[0],i=i[0][i[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=i:e.set(t,i)}function Ye(e,...t){t.forEach(t=>{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach(n=>{if(n in e.prototype)return;const i=Object.getOwnPropertyDescriptor(t,n);i.enumerable=!1,Object.defineProperty(e.prototype,n,i)})})}class Je{constructor(e){this.editor=e,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",Ke,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",Ke),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function Ke(e){e.return=!1,e.stop()}Ye(Je,Fe);class Xe{constructor(e){this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}function Ge(e){return!(!e||!e[Symbol.iterator])}Ye(Xe,Fe);class Qe{constructor(e={},t={}){const n=Ge(e);if(n||(t=e),this._items=[],this._itemMap=new Map,this._idProperty=t.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],n)for(const t of e)this._items.push(t),this._itemMap.set(this._getItemIdBeforeAdding(t),t)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){return this.addMany([e],t)}addMany(e,t){if(void 0===t)t=this._items.length;else if(t>this._items.length||t<0)throw new l.b("collection-add-item-invalid-index",this);for(let n=0;n<e.length;n++){const i=e[n],o=this._getItemIdBeforeAdding(i),r=t+n;this._items.splice(r,0,i),this._itemMap.set(o,i),this.fire("add",i,r)}return this.fire("change",{added:e,removed:[],index:t}),this}get(e){let t;if("string"==typeof e)t=this._itemMap.get(e);else{if("number"!=typeof e)throw new l.b("collection-get-invalid-arg",this);t=this._items[e]}return t||null}has(e){if("string"==typeof e)return this._itemMap.has(e);{const t=e[this._idProperty];return this._itemMap.has(t)}}getIndex(e){let t;return t="string"==typeof e?this._itemMap.get(e):e,this._items.indexOf(t)}remove(e){const[t,n]=this._remove(e);return this.fire("change",{added:[],removed:[t],index:n}),t}map(e,t){return this._items.map(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const e=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new l.b("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:e=>{this._setUpBindToBinding(t=>new e(t))},using:e=>{"function"==typeof e?this._setUpBindToBinding(t=>e(t)):this._setUpBindToBinding(t=>t[e])}}}_setUpBindToBinding(e){const t=this._bindToCollection,n=(n,i,o)=>{const r=t._bindToCollection==this,s=t._bindToInternalToExternalMap.get(i);if(r&&s)this._bindToExternalToInternalMap.set(i,s),this._bindToInternalToExternalMap.set(s,i);else{const n=e(i);if(!n)return void this._skippedIndexesFromExternal.push(o);let r=o;for(const e of this._skippedIndexesFromExternal)o>e&&r--;for(const e of t._skippedIndexesFromExternal)r>=e&&r++;this._bindToExternalToInternalMap.set(i,n),this._bindToInternalToExternalMap.set(n,i),this.add(n,r);for(let e=0;e<t._skippedIndexesFromExternal.length;e++)r<=t._skippedIndexesFromExternal[e]&&t._skippedIndexesFromExternal[e]++}};for(const e of t)n(0,e,t.getIndex(e));this.listenTo(t,"add",n),this.listenTo(t,"remove",(e,t,n)=>{const i=this._bindToExternalToInternalMap.get(t);i&&this.remove(i),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((e,t)=>(n<t&&e.push(t-1),n>t&&e.push(t),e),[])})}_getItemIdBeforeAdding(e){const t=this._idProperty;let n;if(t in e){if(n=e[t],"string"!=typeof n)throw new l.b("collection-add-invalid-id",this);if(this.get(n))throw new l.b("collection-add-item-already-exists",this)}else e[t]=n=s();return n}_remove(e){let t,n,i,o=!1;const r=this._idProperty;if("string"==typeof e?(n=e,i=this._itemMap.get(n),o=!i,i&&(t=this._items.indexOf(i))):"number"==typeof e?(t=e,i=this._items[t],o=!i,i&&(n=i[r])):(i=e,n=i[r],t=this._items.indexOf(i),o=-1==t||!this._itemMap.get(n)),o)throw new l.b("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(n);const s=this._bindToInternalToExternalMap.get(i);return this._bindToInternalToExternalMap.delete(i),this._bindToExternalToInternalMap.delete(s),this.fire("remove",i,t),[i,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}Ye(Qe,u);class Ze extends Xe{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new Qe({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if("string"!=typeof e)throw new l.b("pendingactions-add-invalid-message",this);const t=Object.create(Fe);return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}class et{constructor(){const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((n,i)=>{t.onload=()=>{const e=t.result;this._data=e,n(e)},t.onerror=()=>{i("error")},t.onabort=()=>{i("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}Ye(et,Fe);class tt extends Je{static get pluginName(){return"FileRepository"}static get requires(){return[Ze]}init(){this.loaders=new Qe,this.loaders.on("add",()=>this._updatePendingAction()),this.loaders.on("remove",()=>this._updatePendingAction()),this._loadersMap=new Map,this._pendingAction=null,this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return console.warn(Object(l.a)("filerepository-no-upload-adapter")),null;const t=new nt(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(e=>{this._loadersMap.set(e,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let e=0;for(const t of this.loaders)e+=t.uploaded;this.uploaded=e}),t.on("change:uploadTotal",()=>{let e=0;for(const t of this.loaders)t.uploadTotal&&(e+=t.uploadTotal);this.uploadTotal=e}),t}destroyLoader(e){const t=e instanceof nt?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((e,n)=>{e===t&&this._loadersMap.delete(n)})}_updatePendingAction(){const e=this.editor.plugins.get(Ze);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,n=e=>`${t("Upload in progress")} ${parseInt(e)}%.`;this._pendingAction=e.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else e.remove(this._pendingAction),this._pendingAction=null}}Ye(tt,Fe);class nt{constructor(e,t){this.id=s(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new et,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new l.b("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if("reading"!==this.status)throw this.status;return this.status="idle",e}).catch(e=>{if("aborted"===e)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:e})}upload(){if("idle"!=this.status)throw new l.b("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{if("aborted"===this.status)throw"aborted";throw this.status="error",e})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==e?this._reader.abort():"uploading"==e&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise((n,i)=>{t.rejecter=i,t.isFulfilled=!1,e.then(e=>{t.isFulfilled=!0,n(e)}).catch(e=>{t.isFulfilled=!0,i(e)})}),t}}Ye(nt,Fe);function it(){let e=function(e){e=e.toLowerCase();const t=document.cookie.split(";");for(const n of t){const t=n.split("=");if(decodeURIComponent(t[0].trim().toLowerCase())===e)return decodeURIComponent(t[1])}return null}("ckCsrfToken");var t,n;return e&&40==e.length||(e=function(e){let t="";const n=new Uint8Array(e);window.crypto.getRandomValues(n);for(let e=0;e<n.length;e++){const i="abcdefghijklmnopqrstuvwxyz0123456789".charAt(n[e]%"abcdefghijklmnopqrstuvwxyz0123456789".length);t+=Math.random()>.5?i.toUpperCase():i}return t}(40),t="ckCsrfToken",n=e,document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(n)+";path=/"),e}class ot extends Je{static get requires(){return[tt]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const e=this.editor.config.get("ckfinder.uploadUrl");e&&(this.editor.plugins.get(tt).createUploadAdapter=t=>new rt(t,e,this.editor.t))}}class rt{constructor(e,t,n){this.loader=e,this.url=t,this.t=n}upload(){return this.loader.file.then(e=>new Promise((t,n)=>{this._initRequest(),this._initListeners(t,n,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,n){const i=this.xhr,o=this.loader,r=(0,this.t)("Cannot upload file:")+` ${n.name}.`;i.addEventListener("error",()=>t(r)),i.addEventListener("abort",()=>t()),i.addEventListener("load",()=>{const n=i.response;if(!n||!n.uploaded)return t(n&&n.error&&n.error.message?n.error.message:r);e({default:n.url})}),i.upload&&i.upload.addEventListener("progress",e=>{e.lengthComputable&&(o.uploadTotal=e.total,o.uploaded=e.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",it()),this.xhr.send(t)}}class st{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",at,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",at),this.refresh())}execute(){}destroy(){this.stopListening()}}function at(e){e.return=!1,e.stop()}function lt(e){const t=e.next();return t.done?null:t.value}Ye(st,Fe);const ct=["left","right","center","justify"];function dt(e){return ct.includes(e)}function ut(e,t){return"rtl"==t.contentLanguageDirection?"right"===e:"left"===e}class ht extends st{refresh(){const e=this.editor.locale,t=lt(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!t&&this._canBeAligned(t),this.isEnabled&&t.hasAttribute("alignment")?this.value=t.getAttribute("alignment"):this.value="rtl"===e.contentLanguageDirection?"right":"left"}execute(e={}){const t=this.editor,n=t.locale,i=t.model,o=i.document,r=e.value;i.change(e=>{const t=Array.from(o.selection.getSelectedBlocks()).filter(e=>this._canBeAligned(e)),i=t[0].getAttribute("alignment");ut(r,n)||i===r||!r?function(e,t){for(const n of e)t.removeAttribute("alignment",n)}(t,e):function(e,t,n){for(const i of e)t.setAttribute("alignment",n,i)}(t,e,r)})}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,"alignment")}}class mt extends Je{static get pluginName(){return"AlignmentEditing"}constructor(e){super(e),e.config.define("alignment",{options:[...ct]})}init(){const e=this.editor,t=e.locale,n=e.model.schema,i=e.config.get("alignment.options").filter(dt);n.extend("$block",{allowAttributes:"alignment"}),e.model.schema.setAttributeProperties("alignment",{isFormatting:!0});const o=function(e){const t={model:{key:"alignment",values:e.slice()},view:{}};for(const n of e)t.view[n]={key:"style",value:{"text-align":n}};return t}(i.filter(e=>!ut(e,t)));e.conversion.attributeToAttribute(o),e.commands.add("alignment",new ht(e))}}class gt extends Qe{constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(e,t,n)=>{this._renderViewIntoCollectionParent(t,n)}),this.on("remove",(e,t)=>{t.element&&this._parentElement&&t.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const e of this)this._renderViewIntoCollectionParent(e)}delegate(...e){if(!e.length||!e.every(e=>"string"==typeof e))throw new l.b("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const n of this)for(const i of e)n.delegate(i).to(t);this.on("add",(n,i)=>{for(const n of e)i.delegate(n).to(t)}),this.on("remove",(n,i)=>{for(const n of e)i.stopDelegating(n,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}}function pt(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}var ft=function(){this.__data__=[],this.size=0};var wt=function(e,t){for(var n=e.length;n--;)if(J(e[n][0],t))return n;return-1},bt=Array.prototype.splice;var _t=function(e){var t=this.__data__,n=wt(t,e);return!(n<0)&&(n==t.length-1?t.pop():bt.call(t,n,1),--this.size,!0)};var kt=function(e){var t=this.__data__,n=wt(t,e);return n<0?void 0:t[n][1]};var vt=function(e){return wt(this.__data__,e)>-1};var yt=function(e,t){var n=this.__data__,i=wt(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};function xt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}xt.prototype.clear=ft,xt.prototype.delete=_t,xt.prototype.get=kt,xt.prototype.has=vt,xt.prototype.set=yt;var At=xt;var Ct=function(){this.__data__=new At,this.size=0};var Tt=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var Et=function(e){return this.__data__.get(e)};var Mt=function(e){return this.__data__.has(e)},Pt=$(_.a,"Map"),St=$(Object,"create");var It=function(){this.__data__=St?St(null):{},this.size=0};var Ot=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Nt=Object.prototype.hasOwnProperty;var zt=function(e){var t=this.__data__;if(St){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Nt.call(t,e)?t[e]:void 0},Rt=Object.prototype.hasOwnProperty;var Lt=function(e){var t=this.__data__;return St?void 0!==t[e]:Rt.call(t,e)};var jt=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=St&&void 0===t?"__lodash_hash_undefined__":t,this};function Dt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Dt.prototype.clear=It,Dt.prototype.delete=Ot,Dt.prototype.get=zt,Dt.prototype.has=Lt,Dt.prototype.set=jt;var Bt=Dt;var Vt=function(){this.size=0,this.__data__={hash:new Bt,map:new(Pt||At),string:new Bt}};var Ft=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Ht=function(e,t){var n=e.__data__;return Ft(t)?n["string"==typeof t?"string":"hash"]:n.map};var Ut=function(e){var t=Ht(this,e).delete(e);return this.size-=t?1:0,t};var Wt=function(e){return Ht(this,e).get(e)};var $t=function(e){return Ht(this,e).has(e)};var qt=function(e,t){var n=Ht(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function Yt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Yt.prototype.clear=Vt,Yt.prototype.delete=Ut,Yt.prototype.get=Wt,Yt.prototype.has=$t,Yt.prototype.set=qt;var Jt=Yt;var Kt=function(e,t){var n=this.__data__;if(n instanceof At){var i=n.__data__;if(!Pt||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Jt(i)}return n.set(e,t),this.size=n.size,this};function Xt(e){var t=this.__data__=new At(e);this.size=t.size}Xt.prototype.clear=Ct,Xt.prototype.delete=Tt,Xt.prototype.get=Et,Xt.prototype.has=Mt,Xt.prototype.set=Kt;var Gt=Xt;var Qt=function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););return e};var Zt=function(e,t){return function(n){return e(t(n))}},en=Zt(Object.keys,Object),tn=Object.prototype.hasOwnProperty;var nn=function(e){if(!Ie(e))return en(e);var t=[];for(var n in Object(e))tn.call(e,n)&&"constructor"!=n&&t.push(n);return t};var on=function(e){return le(e)?Pe(e):nn(e)};var rn=function(e,t){return e&&G(t,on(t),e)};var sn=function(e,t){return e&&G(t,Re(t),e)},an=n(8);var ln=function(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t};var cn=function(e,t){for(var n=-1,i=null==e?0:e.length,o=0,r=[];++n<i;){var s=e[n];t(s,n,e)&&(r[o++]=s)}return r};var dn=function(){return[]},un=Object.prototype.propertyIsEnumerable,hn=Object.getOwnPropertySymbols,mn=hn?function(e){return null==e?[]:(e=Object(e),cn(hn(e),(function(t){return un.call(e,t)})))}:dn;var gn=function(e,t){return G(e,mn(e),t)};var pn=function(e,t){for(var n=-1,i=t.length,o=e.length;++n<i;)e[o+n]=t[n];return e},fn=Zt(Object.getPrototypeOf,Object),wn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)pn(t,mn(e)),e=fn(e);return t}:dn;var bn=function(e,t){return G(e,wn(e),t)};var _n=function(e,t,n){var i=t(e);return ke(e)?i:pn(i,n(e))};var kn=function(e){return _n(e,on,mn)};var vn=function(e){return _n(e,Re,wn)},yn=$(_.a,"DataView"),xn=$(_.a,"Promise"),An=$(_.a,"Set"),Cn=$(_.a,"WeakMap"),Tn=L(yn),En=L(Pt),Mn=L(xn),Pn=L(An),Sn=L(Cn),In=P;(yn&&"[object DataView]"!=In(new yn(new ArrayBuffer(1)))||Pt&&"[object Map]"!=In(new Pt)||xn&&"[object Promise]"!=In(xn.resolve())||An&&"[object Set]"!=In(new An)||Cn&&"[object WeakMap]"!=In(new Cn))&&(In=function(e){var t=P(e),n="[object Object]"==t?e.constructor:void 0,i=n?L(n):"";if(i)switch(i){case Tn:return"[object DataView]";case En:return"[object Map]";case Mn:return"[object Promise]";case Pn:return"[object Set]";case Sn:return"[object WeakMap]"}return t});var On=In,Nn=Object.prototype.hasOwnProperty;var zn=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Nn.call(e,"index")&&(n.index=e.index,n.input=e.input),n},Rn=_.a.Uint8Array;var Ln=function(e){var t=new e.constructor(e.byteLength);return new Rn(t).set(new Rn(e)),t};var jn=function(e,t){var n=t?Ln(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},Dn=/\w*$/;var Bn=function(e){var t=new e.constructor(e.source,Dn.exec(e));return t.lastIndex=e.lastIndex,t},Vn=k?k.prototype:void 0,Fn=Vn?Vn.valueOf:void 0;var Hn=function(e){return Fn?Object(Fn.call(e)):{}};var Un=function(e,t){var n=t?Ln(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var Wn=function(e,t,n){var i=e.constructor;switch(t){case"[object ArrayBuffer]":return Ln(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return jn(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Un(e,n);case"[object Map]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return Bn(e);case"[object Set]":return new i;case"[object Symbol]":return Hn(e)}},$n=Object.create,qn=function(){function e(){}return function(t){if(!b(t))return{};if($n)return $n(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var Yn=function(e){return"function"!=typeof e.constructor||Ie(e)?{}:qn(fn(e))};var Jn=function(e){return ge(e)&&"[object Map]"==On(e)},Kn=Ce.a&&Ce.a.isMap,Xn=Kn?Ae(Kn):Jn;var Gn=function(e){return ge(e)&&"[object Set]"==On(e)},Qn=Ce.a&&Ce.a.isSet,Zn=Qn?Ae(Qn):Gn,ei={};ei["[object Arguments]"]=ei["[object Array]"]=ei["[object ArrayBuffer]"]=ei["[object DataView]"]=ei["[object Boolean]"]=ei["[object Date]"]=ei["[object Float32Array]"]=ei["[object Float64Array]"]=ei["[object Int8Array]"]=ei["[object Int16Array]"]=ei["[object Int32Array]"]=ei["[object Map]"]=ei["[object Number]"]=ei["[object Object]"]=ei["[object RegExp]"]=ei["[object Set]"]=ei["[object String]"]=ei["[object Symbol]"]=ei["[object Uint8Array]"]=ei["[object Uint8ClampedArray]"]=ei["[object Uint16Array]"]=ei["[object Uint32Array]"]=!0,ei["[object Error]"]=ei["[object Function]"]=ei["[object WeakMap]"]=!1;var ti=function e(t,n,i,o,r,s){var a,l=1&n,c=2&n,d=4&n;if(i&&(a=r?i(t,o,r,s):i(t)),void 0!==a)return a;if(!b(t))return t;var u=ke(t);if(u){if(a=zn(t),!l)return ln(t,a)}else{var h=On(t),m="[object Function]"==h||"[object GeneratorFunction]"==h;if(Object(ve.a)(t))return Object(an.a)(t,l);if("[object Object]"==h||"[object Arguments]"==h||m&&!r){if(a=c||m?{}:Yn(t),!l)return c?bn(t,sn(a,t)):gn(t,rn(a,t))}else{if(!ei[h])return r?t:{};a=Wn(t,h,l)}}s||(s=new Gt);var g=s.get(t);if(g)return g;s.set(t,a),Zn(t)?t.forEach((function(o){a.add(e(o,n,i,o,t,s))})):Xn(t)&&t.forEach((function(o,r){a.set(r,e(o,n,i,r,t,s))}));var p=d?c?vn:kn:c?keysIn:on,f=u?void 0:p(t);return Qt(f||t,(function(o,r){f&&(o=t[r=o]),X(a,r,e(o,n,i,r,t,s))})),a};var ni=function(e,t){return ti(e,5,t="function"==typeof t?t:void 0)};class ii{constructor(e){Object.assign(this,mi(hi(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:e,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new l.b("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const n of t.children)bi(n)?yield n:_i(n)&&(yield*e(n))}(this)}static bind(e,t){return{to:(n,i)=>new ri({eventNameOrFunction:n,attribute:n,observable:e,emitter:t,callback:i}),if:(n,i,o)=>new si({observable:e,emitter:t,attribute:n,valueIfTrue:i,callback:o})}}static extend(e,t){if(e._isRendered)throw new l.b("template-extend-render",[this,e]);!function e(t,n){n.attributes&&(t.attributes||(t.attributes={}),fi(t.attributes,n.attributes));n.eventListeners&&(t.eventListeners||(t.eventListeners={}),fi(t.eventListeners,n.eventListeners));n.text&&t.text.push(...n.text);if(n.children&&n.children.length){if(t.children.length!=n.children.length)throw new l.b("ui-template-extend-children-mismatch",t);let i=0;for(const o of n.children)e(t.children[i++],o)}}(e,mi(hi(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new l.b("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),ai(this.text)?this._bindToObservable({schema:this.text,updater:ci(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){let t,n,i,o;if(!this.attributes)return;const r=e.node,s=e.revertData;for(t in this.attributes)if(i=r.getAttribute(t),n=this.attributes[t],s&&(s.attributes[t]=i),o=b(n[0])&&n[0].ns?n[0].ns:null,ai(n)){const a=o?n[0].value:n;s&&vi(t)&&a.unshift(i),this._bindToObservable({schema:a,updater:di(r,t,o),data:e})}else"style"==t&&"string"!=typeof n[0]?this._renderStyleAttribute(n[0],e):(s&&i&&vi(t)&&n.unshift(i),n=n.map(e=>e&&e.value||e).reduce((e,t)=>e.concat(t),[]).reduce(pi,""),wi(n)||r.setAttributeNS(o,t,n))}_renderStyleAttribute(e,t){const n=t.node;for(const i in e){const o=e[i];ai(o)?this._bindToObservable({schema:[o],updater:ui(n,i),data:t}):n.style[i]=o}}_renderElementChildren(e){const t=e.node,n=e.intoFragment?document.createDocumentFragment():t,i=e.isApplying;let o=0;for(const r of this.children)if(ki(r)){if(!i){r.setParent(t);for(const e of r)n.appendChild(e.element)}}else if(bi(r))i||(r.isRendered||r.render(),n.appendChild(r.element));else if(pt(r))n.appendChild(r);else if(i){const t={children:[],bindings:[],attributes:{}};e.revertData.children.push(t),r._renderNode({node:n.childNodes[o++],isApplying:!0,revertData:t})}else n.appendChild(r.render());e.intoFragment&&t.appendChild(n)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const n=this.eventListeners[t].map(n=>{const[i,o]=t.split("@");return n.activateDomEventListener(i,o,e)});e.revertData&&e.revertData.bindings.push(n)}}_bindToObservable({schema:e,updater:t,data:n}){const i=n.revertData;li(e,t,n);const o=e.filter(e=>!wi(e)).filter(e=>e.observable).map(i=>i.activateAttributeListener(e,t,n));i&&i.bindings.push(o)}_revertTemplateFromNode(e,t){for(const e of t.bindings)for(const t of e)t();if(t.text)e.textContent=t.text;else{for(const n in t.attributes){const i=t.attributes[n];null===i?e.removeAttribute(n):e.setAttribute(n,i)}for(let n=0;n<t.children.length;++n)this._revertTemplateFromNode(e.childNodes[n],t.children[n])}}}Ye(ii,u);class oi{constructor(e){Object.assign(this,e)}getValue(e){const t=this.observable[this.attribute];return this.callback?this.callback(t,e):t}activateAttributeListener(e,t,n){const i=()=>li(e,t,n);return this.emitter.listenTo(this.observable,"change:"+this.attribute,i),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,i)}}}class ri extends oi{activateDomEventListener(e,t,n){const i=(e,n)=>{t&&!n.target.matches(t)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(n):this.observable.fire(this.eventNameOrFunction,n))};return this.emitter.listenTo(n.node,e,i),()=>{this.emitter.stopListening(n.node,e,i)}}}class si extends oi{getValue(e){return!wi(super.getValue(e))&&(this.valueIfTrue||!0)}}function ai(e){return!!e&&(e.value&&(e=e.value),Array.isArray(e)?e.some(ai):e instanceof oi)}function li(e,t,{node:n}){let i=function(e,t){return e.map(e=>e instanceof oi?e.getValue(t):e)}(e,n);i=1==e.length&&e[0]instanceof si?i[0]:i.reduce(pi,""),wi(i)?t.remove():t.set(i)}function ci(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}function di(e,t,n){return{set(i){e.setAttributeNS(n,t,i)},remove(){e.removeAttributeNS(n,t)}}}function ui(e,t){return{set(n){e.style[t]=n},remove(){e.style[t]=null}}}function hi(e){return ni(e,e=>{if(e&&(e instanceof oi||_i(e)||bi(e)||ki(e)))return e})}function mi(e){if("string"==typeof e?e=function(e){return{text:[e]}}(e):e.text&&function(e){Array.isArray(e.text)||(e.text=[e.text])}(e),e.on&&(e.eventListeners=function(e){for(const t in e)gi(e,t);return e}(e.on),delete e.on),!e.text){e.attributes&&function(e){for(const t in e)e[t].value&&(e[t].value=[].concat(e[t].value)),gi(e,t)}(e.attributes);const t=[];if(e.children)if(ki(e.children))t.push(e.children);else for(const n of e.children)_i(n)||bi(n)||pt(n)?t.push(n):t.push(new ii(n));e.children=t}return e}function gi(e,t){Array.isArray(e[t])||(e[t]=[e[t]])}function pi(e,t){return wi(t)?e:wi(e)?t:`${e} ${t}`}function fi(e,t){for(const n in t)e[n]?e[n].push(...t[n]):e[n]=t[n]}function wi(e){return!e&&0!==e}function bi(e){return e instanceof Ti}function _i(e){return e instanceof ii}function ki(e){return e instanceof gt}function vi(e){return"class"==e||"style"==e}function yi(e){const t=Object.prototype.toString.apply(e);return"[object Window]"==t||"[object global]"==t}var xi=Le({},u,{listenTo(e,...t){if(pt(e)||yi(e)){const n=this._getProxyEmitter(e)||new Ai(e);n.attach(...t),e=n}u.listenTo.call(this,e,...t)},stopListening(e,t,n){if(pt(e)||yi(e)){const t=this._getProxyEmitter(e);if(!t)return;e=t}u.stopListening.call(this,e,t,n),e instanceof Ai&&e.detach(t)},_getProxyEmitter(e){return t=this,n=Ci(e),t[c]&&t[c][n]?t[c][n].emitter:null;var t,n}});class Ai{constructor(e){h(this,Ci(e)),this._domNode=e}}function Ci(e){return e["data-ck-expando"]||(e["data-ck-expando"]=s())}Le(Ai.prototype,u,{attach(e,t,n={}){if(this._domListeners&&this._domListeners[e])return;const i={capture:!!n.useCapture,passive:!!n.usePassive},o=this._createDomListener(e,i);this._domNode.addEventListener(e,o,i),this._domListeners||(this._domListeners={}),this._domListeners[e]=o},detach(e){let t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()},_createDomListener(e,t){const n=t=>{this.fire(e,t)};return n.removeListener=()=>{this._domNode.removeEventListener(e,n,t),delete this._domListeners[e]},n}});n(15);class Ti{constructor(e){this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new Qe,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,n)=>{n.locale=e}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=ii.bind(this,this)}createCollection(e){const t=new gt(e);return this._viewCollections.add(t),t}registerChild(e){Ge(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){Ge(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new ii(e)}extendTemplate(e){ii.extend(this.template,e)}render(){if(this.isRendered)throw new l.b("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(e=>e.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}Ye(Ti,xi),Ye(Ti,Fe);n(17);class Ei extends Ti{constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:e.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const e=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),t=e.getAttribute("viewBox");for(t&&(this.viewBox=t),this.element.innerHTML="";e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(e=>{e.style.fill=this.fillColor})}}n(19);class Mi extends Ti{constructor(e){super(e),this.set("text",""),this.set("position","s");const t=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",t.to("position",e=>"ck-tooltip_"+e),t.if("text","ck-hidden",e=>!e.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:t.to("text")}]}]})}}const Pi=navigator.userAgent.toLowerCase();var Si={isMac:function(e){return e.indexOf("macintosh")>-1}(Pi),isGecko:function(e){return!!e.match(/gecko\/\d+/)}(Pi),isSafari:function(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}(Pi),isAndroid:function(e){return e.indexOf("android")>-1}(Pi),isBlink:function(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}(Pi),features:{isRegExpUnicodePropertySupported:function(){let e=!1;try{e=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(e){}return e}()}};const Ii={"⌘":"ctrl","⇧":"shift","⌥":"alt"},Oi={ctrl:"⌘",shift:"⇧",alt:"⌥"},Ni=function(){const e={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,cmd:1114112,shift:2228224,alt:4456448};for(let t=65;t<=90;t++){const n=String.fromCharCode(t);e[n.toLowerCase()]=t}for(let t=48;t<=57;t++)e[t-48]=t;for(let t=112;t<=123;t++)e["f"+(t-111)]=t;return e}();function zi(e){let t;if("string"==typeof e){if(t=Ni[e.toLowerCase()],!t)throw new l.b("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?Ni.alt:0)+(e.ctrlKey?Ni.ctrl:0)+(e.shiftKey?Ni.shift:0);return t}function Ri(e){return"string"==typeof e&&(e=Vi(e)),e.map(e=>"string"==typeof e?zi(e):e).reduce((e,t)=>t+e,0)}function Li(e){return Si.isMac?Vi(e).map(e=>Oi[e.toLowerCase()]||e).reduce((e,t)=>e.slice(-1)in Ii?e+t:e+"+"+t):e}function ji(e){return e==Ni.arrowright||e==Ni.arrowleft||e==Ni.arrowup||e==Ni.arrowdown}function Di(e,t){const n="ltr"===t;switch(e){case Ni.arrowleft:return n?"left":"right";case Ni.arrowright:return n?"right":"left";case Ni.arrowup:return"up";case Ni.arrowdown:return"down"}}function Bi(e,t){const n=Di(e,t);return"down"===n||"right"===n}function Vi(e){return e.split(/\s*\+\s*/)}n(21);class Fi extends Ti{constructor(e){super(e);const t=this.bindTemplate,n=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(n),this.iconView=new Ei,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",t.to("class"),t.if("isEnabled","ck-disabled",e=>!e),t.if("isVisible","ck-hidden",e=>!e),t.to("isOn",e=>e?"ck-on":"ck-off"),t.if("withText","ck-button_with-text"),t.if("withKeystroke","ck-button_with-keystroke")],type:t.to("type",e=>e||"button"),tabindex:t.to("tabindex"),"aria-labelledby":"ck-editor__aria-label_"+n,"aria-disabled":t.if("isEnabled",!0,e=>!e),"aria-pressed":t.to("isOn",e=>!!this.isToggleable&&String(e))},children:this.children,on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(e=>{this.isEnabled?this.fire("execute"):e.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView),this.withKeystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createTooltipView(){const e=new Mi;return e.bind("text").to(this,"_tooltipString"),e.bind("position").to(this,"tooltipPosition"),e}_createLabelView(e){const t=new Ti,n=this.bindTemplate;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:n.to("labelStyle"),id:"ck-editor__aria-label_"+e},children:[{text:this.bindTemplate.to("label")}]}),t}_createKeystrokeView(){const e=new Ti;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",e=>Li(e))}]}),e}_getTooltipString(e,t,n){return e?"string"==typeof e?e:(n&&(n=Li(n)),e instanceof Function?e(t,n):`${t}${n?` (${n})`:""}`):""}}class Hi extends Ti{constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",t.to("position",e=>"ck-dropdown__panel_"+e),t.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:t.to(e=>e.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const e=this.children.last;"function"==typeof e.focusLast?e.focusLast():e.focus()}}}class Ui{constructor(){this._listener=Object.create(xi)}listenTo(e){this._listener.listenTo(e,"keydown",(e,t)=>{this._listener.fire("_keydown:"+zi(t),t)})}set(e,t,n={}){const i=Ri(e),o=n.priority;this._listener.listenTo(this._listener,"_keydown:"+i,(e,n)=>{t(n,()=>{n.preventDefault(),n.stopPropagation(),e.stop()}),e.return=!0},{priority:o})}press(e){return!!this._listener.fire("_keydown:"+zi(e),e)}destroy(){this._listener.stopListening()}}n(23);var Wi={window:window,document:document};function $i(e){return"[object Range]"==Object.prototype.toString.apply(e)}function qi(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}function Yi(e){return"[object Text]"==Object.prototype.toString.call(e)}var Ji=Function.prototype,Ki=Object.prototype,Xi=Ji.toString,Gi=Ki.hasOwnProperty,Qi=Xi.call(Object);var Zi=function(e){if(!ge(e)||"[object Object]"!=P(e))return!1;var t=fn(e);if(null===t)return!0;var n=Gi.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Xi.call(n)==Qi};var eo=function(e){return ge(e)&&1===e.nodeType&&!Zi(e)};const to=["top","right","bottom","left","width","height"];class no{constructor(e){const t=$i(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),eo(e)||t)if(t){const t=no.getDomRangeRects(e);io(this,no.getBoundingRect(t))}else io(this,e.getBoundingClientRect());else if(yi(e)){const{innerWidth:t,innerHeight:n}=e;io(this,{top:0,right:t,bottom:n,left:0,width:t,height:n})}else io(this,e)}clone(){return new no(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left)};return t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0?null:new no(t)}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!oo(e)){let n=e.parentNode||e.commonAncestorContainer;for(;n&&!oo(n);){const e=new no(n),i=t.getIntersection(e);if(!i)return null;i.getArea()<t.getArea()&&(t=i),n=n.parentNode}}return t}isEqual(e){for(const t of to)if(this[t]!==e[t])return!1;return!0}contains(e){const t=this.getIntersection(e);return!(!t||!t.isEqual(e))}excludeScrollbarsAndBorders(){const e=this._source;let t,n,i;if(yi(e))t=e.innerWidth-e.document.documentElement.clientWidth,n=e.innerHeight-e.document.documentElement.clientHeight,i=e.getComputedStyle(e.document.documentElement).direction;else{const o=qi(this._source);t=e.offsetWidth-e.clientWidth-o.left-o.right,n=e.offsetHeight-e.clientHeight-o.top-o.bottom,i=e.ownerDocument.defaultView.getComputedStyle(e).direction,this.left+=o.left,this.top+=o.top,this.right-=o.right,this.bottom-=o.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top}return this.width-=t,"ltr"===i?this.right-=t:this.left+=t,this.height-=n,this.bottom-=n,this}static getDomRangeRects(e){const t=[],n=Array.from(e.getClientRects());if(n.length)for(const e of n)t.push(new no(e));else{let n=e.startContainer;Yi(n)&&(n=n.parentNode);const i=new no(n.getBoundingClientRect());i.right=i.left,i.width=0,t.push(i)}return t}static getBoundingRect(e){const t={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY};let n=0;for(const i of e)n++,t.left=Math.min(t.left,i.left),t.top=Math.min(t.top,i.top),t.right=Math.max(t.right,i.right),t.bottom=Math.max(t.bottom,i.bottom);return 0==n?null:(t.width=t.right-t.left,t.height=t.bottom-t.top,new no(t))}}function io(e,t){for(const n of to)e[n]=t[n]}function oo(e){return!!eo(e)&&e===e.ownerDocument.body}function ro({element:e,target:t,positions:n,limiter:i,fitInViewport:o}){I(t)&&(t=t()),I(i)&&(i=i());const r=function(e){return e&&e.parentNode?e.offsetParent===Wi.document.body?null:e.offsetParent:null}(e),s=new no(e),a=new no(t);let l,c;if(i||o){const e=function(e,t){const{elementRect:n,viewportRect:i}=t,o=n.getArea(),r=function(e,{targetRect:t,elementRect:n,limiterRect:i,viewportRect:o}){const r=[],s=n.getArea();for(const a of e){const e=so(a,t,n);if(!e)continue;const[l,c]=e;let d=0,u=0;if(i)if(o){const e=i.getIntersection(o);e&&(d=e.getIntersectionArea(c))}else d=i.getIntersectionArea(c);o&&(u=o.getIntersectionArea(c));const h={positionName:l,positionRect:c,limiterIntersectArea:d,viewportIntersectArea:u};if(d===s)return[h];r.push(h)}return r}(e,t);if(i){const e=ao(r.filter(({viewportIntersectArea:e})=>e===o),o);if(e)return e}return ao(r,o)}(n,{targetRect:a,elementRect:s,limiterRect:i&&new no(i).getVisible(),viewportRect:o&&new no(Wi.window)});[c,l]=e||so(n[0],a,s)}else[c,l]=so(n[0],a,s);let d=lo(l);return r&&(d=function({left:e,top:t},n){const i=lo(new no(n)),o=qi(n);return e-=i.left,t-=i.top,e+=n.scrollLeft,t+=n.scrollTop,e-=o.left,t-=o.top,{left:e,top:t}}(d,r)),{left:d.left,top:d.top,name:c}}function so(e,t,n){const i=e(t,n);if(!i)return null;const{left:o,top:r,name:s}=i;return[s,n.clone().moveTo(o,r)]}function ao(e,t){let n,i,o=0;for(const{positionName:r,positionRect:s,limiterIntersectArea:a,viewportIntersectArea:l}of e){if(a===t)return[r,s];const e=l**2+a**2;e>o&&(o=e,n=s,i=r)}return n?[i,n]:null}function lo({left:e,top:t}){const{scrollX:n,scrollY:i}=Wi.window;return{left:e+n,top:t+i}}class co extends Ti{constructor(e,t,n){super(e);const i=this.bindTemplate;this.buttonView=t,this.panelView=n,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("id"),this.set("panelPosition","auto"),this.keystrokes=new Ui,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",i.to("class"),i.if("isEnabled","ck-disabled",e=>!e)],id:i.to("id"),"aria-describedby":i.to("ariaDescribedById")},children:[t,n]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",()=>{this.isOpen&&("auto"===this.panelPosition?this.panelView.position=co._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 e=(e,t)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,t())};this.keystrokes.set("arrowdown",(e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())}),this.keystrokes.set("arrowright",(e,t)=>{this.isOpen&&t()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:e,southWest:t,northEast:n,northWest:i}=co.defaultPanelPositions;return"ltr"===this.locale.uiLanguageDirection?[e,t,n,i]:[t,e,i,n]}}co.defaultPanelPositions={southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.bottom-t.height,left:e.left-t.width+e.width,name:"nw"})},co._getOptimalPosition=ro;var uo='<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z"/></svg>';class ho extends Fi{constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new Ei;return e.content=uo,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}class mo{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(e){if(this._elements.has(e))throw new l.b("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",()=>this._focus(e),{useCapture:!0}),this.listenTo(e,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(e)}remove(e){e===this.focusedElement&&this._blur(e),this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e))}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=e,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}Ye(mo,xi),Ye(mo,Fe);class go{constructor(e){if(Object.assign(this,e),e.actions&&e.keystrokeHandler)for(const t in e.actions){let n=e.actions[t];"string"==typeof n&&(n=[n]);for(const i of n)e.keystrokeHandler.set(i,(e,n)=>{this[t](),n()})}}get first(){return this.focusables.find(po)||null}get last(){return this.focusables.filter(po).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((t,n)=>{const i=t.element===this.focusTracker.focusedElement;return i&&(e=n),i}),e)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){e&&e.focus()}_getFocusableItem(e){const t=this.current,n=this.focusables.length;if(!n)return null;if(null===t)return this[1===e?"first":"last"];let i=(t+n+e)%n;do{const t=this.focusables.get(i);if(po(t))return t;i=(i+n+e)%n}while(i!==t);return null}}function po(e){return!(!e.focus||"none"==Wi.window.getComputedStyle(e.element).display)}class fo extends Ti{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class wo{constructor(e,t){wo._observerInstance||wo._createObserver(),this._element=e,this._callback=t,wo._addElementCallback(e,t),wo._observerInstance.observe(e)}destroy(){wo._deleteElementCallback(this._element,this._callback)}static _addElementCallback(e,t){wo._elementCallbacks||(wo._elementCallbacks=new Map);let n=wo._elementCallbacks.get(e);n||(n=new Set,wo._elementCallbacks.set(e,n)),n.add(t)}static _deleteElementCallback(e,t){const n=wo._getElementCallbacks(e);n&&(n.delete(t),n.size||(wo._elementCallbacks.delete(e),wo._observerInstance.unobserve(e))),wo._elementCallbacks&&!wo._elementCallbacks.size&&(wo._observerInstance=null,wo._elementCallbacks=null)}static _getElementCallbacks(e){return wo._elementCallbacks?wo._elementCallbacks.get(e):null}static _createObserver(){let e;e="function"==typeof Wi.window.ResizeObserver?Wi.window.ResizeObserver:bo,wo._observerInstance=new e(e=>{for(const t of e){const e=wo._getElementCallbacks(t.target);if(e)for(const n of e)n(t)}})}}wo._observerInstance=null,wo._elementCallbacks=null;class bo{constructor(e){this._callback=e,this._elements=new Set,this._previousRects=new Map,this._periodicCheckTimeout=null}observe(e){this._elements.add(e),this._checkElementRectsAndExecuteCallback(),1===this._elements.size&&this._startPeriodicCheck()}unobserve(e){this._elements.delete(e),this._previousRects.delete(e),this._elements.size||this._stopPeriodicCheck()}_startPeriodicCheck(){const e=()=>{this._checkElementRectsAndExecuteCallback(),this._periodicCheckTimeout=setTimeout(e,100)};this.listenTo(Wi.window,"resize",()=>{this._checkElementRectsAndExecuteCallback()}),this._periodicCheckTimeout=setTimeout(e,100)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout),this.stopListening(),this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const e=[];for(const t of this._elements)this._hasRectChanged(t)&&e.push({target:t,contentRect:this._previousRects.get(t)});e.length&&this._callback(e)}_hasRectChanged(e){if(!e.ownerDocument.body.contains(e))return!1;const t=new no(e),n=this._previousRects.get(e),i=!n||!n.isEqual(t);return this._previousRects.set(e,t),i}}Ye(bo,xi);n(25);class _o extends Ti{constructor(e,t){super(e);const n=this.bindTemplate,i=this.t;var o;this.options=t||{},this.set("ariaLabel",i("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new mo,this.keystrokes=new Ui,this.set("class"),this.set("isCompact",!1),this.itemsView=new ko(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection(),this._focusCycler=new go({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:["arrowleft","arrowup"],focusNext:["arrowright","arrowdown"]}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar",n.to("class"),n.if("isCompact","ck-toolbar_compact")],role:"toolbar","aria-label":n.to("ariaLabel"),style:{maxWidth:n.to("maxWidth")}},children:this.children,on:{mousedown:(o=this,o.bindTemplate.to(e=>{e.target===o.element&&e.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new yo(this):new vo(this)}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t){this.items.addMany(e.map(e=>"|"==e?new fo:t.has(e)?t.create(e):void console.warn(Object(l.a)("toolbarview-item-unavailable"),{name:e})).filter(e=>void 0!==e))}}class ko extends Ti{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class vo{constructor(e){const t=e.bindTemplate;e.set("isVertical",!1),e.itemsView.children.bindTo(e.items).using(e=>e),e.focusables.bindTo(e.items).using(e=>e),e.extendTemplate({attributes:{class:[t.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class yo{constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,e.itemsView.children.bindTo(this.ungroupedItems).using(e=>e),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),e.children.on("add",this._updateFocusCycleableItems.bind(this)),e.children.on("remove",this._updateFocusCycleableItems.bind(this)),e.items.on("change",(e,t)=>{const n=t.index;for(const e of t.removed)n>=this.ungroupedItems.length?this.groupedItems.remove(e):this.ungroupedItems.remove(e);for(let e=n;e<n+t.added.length;e++){const i=t.added[e-n];e>this.ungroupedItems.length?this.groupedItems.add(i,e-this.ungroupedItems.length):this.ungroupedItems.add(i,e)}this._updateGrouping()}),e.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}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 e=this.groupedItems.length;let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==e&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const e=this.viewElement,t=this.viewLocale.uiLanguageDirection,n=new no(e.lastChild),i=new no(e);if(!this.cachedPadding){const n=Wi.window.getComputedStyle(e),i="ltr"===t?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(n[i])}return"ltr"===t?n.right>i.right-this.cachedPadding:n.left<i.left+this.cachedPadding}_enableGroupingOnResize(){let e;this.resizeObserver=new wo(this.viewElement,t=>{e&&e===t.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new fo),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 e=this.viewLocale,t=e.t,n=Mo(e);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",Po(n,[]),n.buttonView.set({label:t("Show more items"),tooltip:!0,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="9.5" cy="4.5" r="1.5"/><circle cx="9.5" cy="10.5" r="1.5"/><circle cx="9.5" cy="16.5" r="1.5"/></svg>'}),n.toolbarView.items.bindTo(this.groupedItems).using(e=>e),n}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}n(27);class xo extends Ti{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new mo,this.keystrokes=new Ui,this._focusCycler=new go({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"]},children:this.items})}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class Ao extends Ti{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class Co extends Ti{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}n(29);class To extends Fi{constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new Ti;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}function Eo({emitter:e,activator:t,callback:n,contextElements:i}){e.listenTo(document,"mousedown",(e,o)=>{if(!t())return;const r="function"==typeof o.composedPath?o.composedPath():[];for(const e of i)if(e.contains(o.target)||r.includes(e))return;n()})}n(31),n(33);function Mo(e,t=ho){const n=new t(e),i=new Hi(e),o=new co(e,n,i);return n.bind("isEnabled").to(o),n instanceof ho?n.bind("isOn").to(o,"isOpen"):n.arrowView.bind("isOn").to(o,"isOpen"),function(e){(function(e){e.on("render",()=>{Eo({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=!1},contextElements:[e.element]})})})(e),function(e){e.on("execute",t=>{t.source instanceof To||(e.isOpen=!1)})}(e),function(e){e.keystrokes.set("arrowdown",(t,n)=>{e.isOpen&&(e.panelView.focus(),n())}),e.keystrokes.set("arrowup",(t,n)=>{e.isOpen&&(e.panelView.focusLast(),n())})}(e)}(o),o}function Po(e,t){const n=e.locale,i=n.t,o=e.toolbarView=new _o(n);o.set("ariaLabel",i("Dropdown toolbar")),e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),t.map(e=>o.items.add(e)),e.panelView.children.add(o),o.items.delegate("execute").to(e)}function So(e,t){const n=e.locale,i=e.listView=new xo(n);i.items.bindTo(t).using(({type:e,model:t})=>{if("separator"===e)return new Co(n);if("button"===e||"switchbutton"===e){const i=new Ao(n);let o;return o="button"===e?new Fi(n):new To(n),o.bind(...Object.keys(t)).to(t),o.delegate("execute").to(i),i.children.add(o),i}}),e.panelView.children.add(i),i.items.delegate("execute").to(e)}var Io='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>',Oo='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M18 3.75a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 8a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 4a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75zm0-8a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75z"/></svg>';const No=new Map([["left",Io],["right",Oo],["center",'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm2.286 4c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75z"/></svg>'],["justify",'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>']]);class zo extends Je{get localizedOptionTitles(){const e=this.editor.t;return{left:e("Align left"),right:e("Align right"),center:e("Align center"),justify:e("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const e=this.editor,t=e.ui.componentFactory,n=e.t,i=e.config.get("alignment.options");i.filter(dt).forEach(e=>this._addButton(e)),t.add("alignment",e=>{const o=Mo(e),r=i.map(e=>t.create("alignment:"+e));Po(o,r),o.buttonView.set({label:n("Text alignment"),tooltip:!0}),o.toolbarView.isVertical=!0,o.toolbarView.ariaLabel=n("Text alignment toolbar"),o.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const s="rtl"===e.contentLanguageDirection?Oo:Io;return o.buttonView.bind("icon").toMany(r,"isOn",(...e)=>{const t=e.findIndex(e=>e);return t<0?s:r[t].icon}),o.bind("isEnabled").toMany(r,"isEnabled",(...e)=>e.some(e=>e)),o})}_addButton(e){const t=this.editor;t.ui.componentFactory.add("alignment:"+e,n=>{const i=t.commands.get("alignment"),o=new Fi(n);return o.set({label:this.localizedOptionTitles[e],icon:No.get(e),tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(i),o.bind("isOn").to(i,"value",t=>t===e),this.listenTo(o,"execute",()=>{t.execute("alignment",{value:e}),t.editing.view.focus()}),o})}}function Ro(e){return Ge(e)?new Map(e):function(e){const t=new Map;for(const n in e)t.set(n,e[n]);return t}(e)}function Lo(e,t){const n=Math.min(e.length,t.length);for(let i=0;i<n;i++)if(e[i]!=t[i])return i;return e.length==t.length?"same":e.length<t.length?"prefix":"extension"}class jo{constructor(e){this.parent=null,this._attrs=Ro(e)}get index(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildIndex(this)))throw new l.b("model-node-not-found-in-parent",this);return e}get startOffset(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildStartOffset(this)))throw new l.b("model-node-not-found-in-parent",this);return e}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),i=e.getAncestors(t);let o=0;for(;n[o]==i[o]&&n[o];)o++;return 0===o?null:n[o-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),i=Lo(t,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return t[i]<n[i]}}isAfter(e){return this!=e&&(this.root===e.root&&!this.isBefore(e))}hasAttribute(e){return this._attrs.has(e)}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}toJSON(){const e={};return this._attrs.size&&(e.attributes=Array.from(this._attrs).reduce((e,t)=>(e[t[0]]=t[1],e),{})),e}is(e){return"node"===e||"model:node"===e}_clone(){return new jo(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=Ro(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}class Do extends jo{constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}is(e){return"$text"===e||"model:$text"===e||"text"===e||"model:text"===e||"node"===e||"model:node"===e}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new Do(this.data,this.getAttributes())}static fromJSON(e){return new Do(e.data,e.attributes)}}class Bo{constructor(e,t,n){if(this.textNode=e,t<0||t>e.offsetSize)throw new l.b("model-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.offsetSize)throw new l.b("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+n),this.offsetInText=t}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}is(e){return"$textProxy"===e||"model:$textProxy"===e||"textProxy"===e||"model:textProxy"===e}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class Vo{constructor(e){this._nodes=[],e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((e,t)=>e+t.offsetSize,0)}getNode(e){return this._nodes[e]||null}getNodeIndex(e){const t=this._nodes.indexOf(e);return-1==t?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return null===t?null:this._nodes.slice(0,t).reduce((e,t)=>e+t.offsetSize,0)}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new l.b("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const n of this._nodes){if(e>=t&&e<t+n.offsetSize)return this.getNodeIndex(n);t+=n.offsetSize}if(t!=e)throw new l.b("model-nodelist-offset-out-of-bounds",this,{offset:e,nodeList:this});return this.length}_insertNodes(e,t){for(const e of t)if(!(e instanceof jo))throw new l.b("model-nodelist-insertnodes-not-node",this);this._nodes.splice(e,0,...t)}_removeNodes(e,t=1){return this._nodes.splice(e,t)}toJSON(){return this._nodes.map(e=>e.toJSON())}}class Fo extends jo{constructor(e,t,n){super(t),this.name=e,this._children=new Vo,n&&this._insertChild(0,n)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(e,t=null){return t?t===this.name&&("element"===e||"model:element"===e):"element"===e||"model:element"===e||"node"===e||"model:node"===e}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}findAncestor(e,t={includeSelf:!1}){let n=t.includeSelf?this:this.parent;for(;n;){if(n.name===e)return n;n=n.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=e?Array.from(this._children).map(e=>e._clone(!0)):null;return new Fo(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(e){if("string"==typeof e)return[new Do(e)];Ge(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new Do(e):e instanceof Bo?new Do(e.data,e.getAttributes()):e)}(t);for(const e of n)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const e of n)e.parent=null;return n}static fromJSON(e){let t=null;if(e.children){t=[];for(const n of e.children)n.name?t.push(Fo.fromJSON(n)):t.push(Do.fromJSON(n))}return new Fo(e.name,e.attributes,t)}}class Ho{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new l.b("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if("forward"!=t&&"backward"!=t)throw new l.b("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this.position=e.startPosition.clone():this.position=Wo._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(e){let t,n,i,o;do{i=this.position,o=this._visitedParent,({done:t,value:n}=this.next())}while(!t&&e(n));t||(this.position=i,this._visitedParent=o)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),n=this._visitedParent;if(null===n.parent&&t.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};const i=t.parent,o=$o(t,i),r=o||qo(t,i,o);if(r instanceof Fo)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=r),this.position=t,Uo("elementStart",r,e,t,1);if(r instanceof Do){let i;if(this.singleCharacters)i=1;else{let e=r.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offset<e&&(e=this.boundaries.end.offset),i=e-t.offset}const o=t.offset-r.startOffset,s=new Bo(r,o,i);return t.offset+=i,this.position=t,Uo("text",s,e,t,i)}return t.path.pop(),t.offset++,this.position=t,this._visitedParent=n.parent,this.ignoreElementEnd?this._next():Uo("elementEnd",n,e,t)}_previous(){const e=this.position,t=this.position.clone(),n=this._visitedParent;if(null===n.parent&&0===t.offset)return{done:!0};if(n==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};const i=t.parent,o=$o(t,i),r=o||Yo(t,i,o);if(r instanceof Fo)return t.offset--,this.shallow?(this.position=t,Uo("elementStart",r,e,t,1)):(t.path.push(r.maxOffset),this.position=t,this._visitedParent=r,this.ignoreElementEnd?this._previous():Uo("elementEnd",r,e,t));if(r instanceof Do){let i;if(this.singleCharacters)i=1;else{let e=r.startOffset;this._boundaryStartParent==n&&this.boundaries.start.offset>e&&(e=this.boundaries.start.offset),i=t.offset-e}const o=t.offset-r.startOffset,s=new Bo(r,o-i,i);return t.offset-=i,this.position=t,Uo("text",s,e,t,i)}return t.path.pop(),this.position=t,this._visitedParent=n.parent,Uo("elementStart",n,e,t,1)}}function Uo(e,t,n,i,o){return{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:i,length:o}}}class Wo{constructor(e,t,n="toNone"){if(!e.is("element")&&!e.is("documentFragment"))throw new l.b("model-position-root-invalid",e);if(!(t instanceof Array)||0===t.length)throw new l.b("model-position-path-incorrect-format",e,{path:t});e.is("rootElement")?t=t.slice():(t=[...e.getPath(),...t],e=e.root),this.root=e,this.path=t,this.stickiness=n}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;t<this.path.length-1;t++)if(e=e.getChild(e.offsetToIndex(this.path[t])),!e)throw new l.b("model-position-path-incorrect",this,{position:this});if(e.is("$text"))throw new l.b("model-position-path-incorrect",this,{position:this});return e}get index(){return this.parent.offsetToIndex(this.offset)}get textNode(){return $o(this,this.parent)}get nodeAfter(){const e=this.parent;return qo(this,e,$o(this,e))}get nodeBefore(){const e=this.parent;return Yo(this,e,$o(this,e))}get isAtStart(){return 0===this.offset}get isAtEnd(){return this.offset==this.parent.maxOffset}compareWith(e){if(this.root!=e.root)return"different";const t=Lo(this.path,e.path);switch(t){case"same":return"same";case"prefix":return"before";case"extension":return"after";default:return this.path[t]<e.path[t]?"before":"after"}}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new Ho(t);return n.skip(e),n.position}getParentPath(){return this.path.slice(0,-1)}getAncestors(){const e=this.parent;return e.is("documentFragment")?[e]:e.getAncestors({includeSelf:!0})}findAncestor(e){const t=this.parent;return t.is("element")?t.findAncestor(e,{includeSelf:!0}):null}getCommonPath(e){if(this.root!=e.root)return[];const t=Lo(this.path,e.path),n="string"==typeof t?Math.min(this.path.length,e.path.length):t;return this.path.slice(0,n)}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let i=0;for(;t[i]==n[i]&&t[i];)i++;return 0===i?null:t[i-1]}getShiftedBy(e){const t=this.clone(),n=t.offset+e;return t.offset=n<0?0:n,t}isAfter(e){return"after"==this.compareWith(e)}isBefore(e){return"before"==this.compareWith(e)}isEqual(e){return"same"==this.compareWith(e)}isTouching(e){let t=null,n=null;switch(this.compareWith(e)){case"same":return!0;case"before":t=Wo._createAt(this),n=Wo._createAt(e);break;case"after":t=Wo._createAt(e),n=Wo._createAt(this);break;default:return!1}let i=t.parent;for(;t.path.length+n.path.length;){if(t.isEqual(n))return!0;if(t.path.length>n.path.length){if(t.offset!==i.maxOffset)return!1;t.path=t.path.slice(0,-1),i=i.parent,t.offset++}else{if(0!==n.offset)return!1;n.path=n.path.slice(0,-1)}}}is(e){return"position"===e||"model:position"===e}hasSameParentAs(e){if(this.root!==e.root)return!1;return"same"==Lo(this.getParentPath(),e.getParentPath())}getTransformedByOperation(e){let t;switch(e.type){case"insert":t=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":t=this._getTransformedByMoveOperation(e);break;case"split":t=this._getTransformedBySplitOperation(e);break;case"merge":t=this._getTransformedByMergeOperation(e);break;default:t=Wo._createAt(this)}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let n;return t.containsPosition(this)||t.start.isEqual(this)?(n=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(n=n._getTransformedByDeletion(e.deletionPosition,1))):n=this.isEqual(e.deletionPosition)?Wo._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),n}_getTransformedByDeletion(e,t){const n=Wo._createAt(this);if(this.root!=e.root)return n;if("same"==Lo(e.getParentPath(),this.getParentPath())){if(e.offset<this.offset){if(e.offset+t>this.offset)return null;n.offset-=t}}else if("prefix"==Lo(e.getParentPath(),this.getParentPath())){const i=e.path.length-1;if(e.offset<=this.path[i]){if(e.offset+t>this.path[i])return null;n.path[i]-=t}}return n}_getTransformedByInsertion(e,t){const n=Wo._createAt(this);if(this.root!=e.root)return n;if("same"==Lo(e.getParentPath(),this.getParentPath()))(e.offset<this.offset||e.offset==this.offset&&"toPrevious"!=this.stickiness)&&(n.offset+=t);else if("prefix"==Lo(e.getParentPath(),this.getParentPath())){const i=e.path.length-1;e.offset<=this.path[i]&&(n.path[i]+=t)}return n}_getTransformedByMove(e,t,n){if(t=t._getTransformedByDeletion(e,n),e.isEqual(t))return Wo._createAt(this);const i=this._getTransformedByDeletion(e,n);return null===i||e.isEqual(this)&&"toNext"==this.stickiness||e.getShiftedBy(n).isEqual(this)&&"toPrevious"==this.stickiness?this._getCombined(e,t):i._getTransformedByInsertion(t,n)}_getCombined(e,t){const n=e.path.length-1,i=Wo._createAt(t);return i.stickiness=this.stickiness,i.offset=i.offset+this.path[n]-e.offset,i.path=[...i.path,...this.path.slice(n+1)],i}toJSON(){return{root:this.root.toJSON(),path:Array.from(this.path),stickiness:this.stickiness}}clone(){return new this.constructor(this.root,this.path,this.stickiness)}static _createAt(e,t,n="toNone"){if(e instanceof Wo)return new Wo(e.root,e.path,e.stickiness);{const i=e;if("end"==t)t=i.maxOffset;else{if("before"==t)return this._createBefore(i,n);if("after"==t)return this._createAfter(i,n);if(0!==t&&!t)throw new l.b("model-createpositionat-offset-required",[this,e])}if(!i.is("element")&&!i.is("documentFragment"))throw new l.b("model-position-parent-incorrect",[this,e]);const o=i.getPath();return o.push(t),new this(i.root,o,n)}}static _createAfter(e,t){if(!e.parent)throw new l.b("model-position-after-root",[this,e],{root:e});return this._createAt(e.parent,e.endOffset,t)}static _createBefore(e,t){if(!e.parent)throw new l.b("model-position-before-root",e,{root:e});return this._createAt(e.parent,e.startOffset,t)}static fromJSON(e,t){if("$graveyard"===e.root){const n=new Wo(t.graveyard,e.path);return n.stickiness=e.stickiness,n}if(!t.getRoot(e.root))throw new l.b("model-position-fromjson-no-root",t,{rootName:e.root});return new Wo(t.getRoot(e.root),e.path,e.stickiness)}}function $o(e,t){const n=t.getChild(t.offsetToIndex(e.offset));return n&&n.is("$text")&&n.startOffset<e.offset?n:null}function qo(e,t,n){return null!==n?null:t.getChild(t.offsetToIndex(e.offset))}function Yo(e,t,n){return null!==n?null:t.getChild(t.offsetToIndex(e.offset)-1)}class Jo{constructor(e,t=null){this.start=Wo._createAt(e),this.end=t?Wo._createAt(t):Wo._createAt(e),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}*[Symbol.iterator](){yield*new Ho({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return"same"==Lo(this.start.getParentPath(),this.end.getParentPath())}get root(){return this.start.root}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,t=!1){e.isCollapsed&&(t=!1);const n=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),i=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&i}containsItem(e){const t=Wo._createBefore(e);return this.containsPosition(t)||this.start.isEqual(t)}is(e){return"range"===e||"model:range"===e}isEqual(e){return this.start.isEqual(e.start)&&this.end.isEqual(e.end)}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}getDifference(e){const t=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&t.push(new Jo(this.start,e.start)),this.containsPosition(e.end)&&t.push(new Jo(e.end,this.end))):t.push(new Jo(this.start,this.end)),t}getIntersection(e){if(this.isIntersecting(e)){let t=this.start,n=this.end;return this.containsPosition(e.start)&&(t=e.start),this.containsPosition(e.end)&&(n=e.end),new Jo(t,n)}return null}getJoined(e,t=!1){let n=this.isIntersecting(e);if(n||(n=this.start.isBefore(e.start)?t?this.end.isTouching(e.start):this.end.isEqual(e.start):t?e.end.isTouching(this.start):e.end.isEqual(this.start)),!n)return null;let i=this.start,o=this.end;return e.start.isBefore(i)&&(i=e.start),e.end.isAfter(o)&&(o=e.end),new Jo(i,o)}getMinimalFlatRanges(){const e=[],t=this.start.getCommonPath(this.end).length,n=Wo._createAt(this.start);let i=n.parent;for(;n.path.length>t+1;){const t=i.maxOffset-n.offset;0!==t&&e.push(new Jo(n,n.getShiftedBy(t))),n.path=n.path.slice(0,-1),n.offset++,i=i.parent}for(;n.path.length<=this.end.path.length;){const t=this.end.path[n.path.length-1],i=t-n.offset;0!==i&&e.push(new Jo(n,n.getShiftedBy(i))),n.offset=t,n.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new Ho(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new Ho(e);for(const e of t)yield e.item}*getPositions(e={}){e.boundaries=this;const t=new Ho(e);yield t.position;for(const e of t)yield e.nextPosition}getTransformedByOperation(e){switch(e.type){case"insert":return this._getTransformedByInsertOperation(e);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(e);case"split":return[this._getTransformedBySplitOperation(e)];case"merge":return[this._getTransformedByMergeOperation(e)]}return[new Jo(this.start,this.end)]}getTransformedByOperations(e){const t=[new Jo(this.start,this.end)];for(const n of e)for(let e=0;e<t.length;e++){const i=t[e].getTransformedByOperation(n);t.splice(e,1,...i),e+=i.length-1}for(let e=0;e<t.length;e++){const n=t[e];for(let i=e+1;i<t.length;i++){const e=t[i];(n.containsRange(e)||e.containsRange(n)||n.isEqual(e))&&t.splice(i,1)}}return t}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;const e=this.start.nodeAfter,t=this.end.nodeBefore;return e&&e.is("element")&&e===t?e:null}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}clone(){return new this.constructor(this.start,this.end)}_getTransformedByInsertOperation(e,t=!1){return this._getTransformedByInsertion(e.position,e.howMany,t)}_getTransformedByMoveOperation(e,t=!1){const n=e.sourcePosition,i=e.howMany,o=e.targetPosition;return this._getTransformedByMove(n,o,i,t)}_getTransformedBySplitOperation(e){const t=this.start._getTransformedBySplitOperation(e);let n=this.end._getTransformedBySplitOperation(e);return this.end.isEqual(e.insertionPosition)&&(n=this.end.getShiftedBy(1)),t.root!=n.root&&(n=this.end.getShiftedBy(-1)),new Jo(t,n)}_getTransformedByMergeOperation(e){if(this.start.isEqual(e.targetPosition)&&this.end.isEqual(e.deletionPosition))return new Jo(this.start);let t=this.start._getTransformedByMergeOperation(e),n=this.end._getTransformedByMergeOperation(e);return t.root!=n.root&&(n=this.end.getShiftedBy(-1)),t.isAfter(n)?(e.sourcePosition.isBefore(e.targetPosition)?(t=Wo._createAt(n),t.offset=0):(e.deletionPosition.isEqual(t)||(n=e.deletionPosition),t=e.targetPosition),new Jo(t,n)):new Jo(t,n)}_getTransformedByInsertion(e,t,n=!1){if(n&&this.containsPosition(e))return[new Jo(this.start,e),new Jo(e.getShiftedBy(t),this.end._getTransformedByInsertion(e,t))];{const n=new Jo(this.start,this.end);return n.start=n.start._getTransformedByInsertion(e,t),n.end=n.end._getTransformedByInsertion(e,t),[n]}}_getTransformedByMove(e,t,n,i=!1){if(this.isCollapsed){const i=this.start._getTransformedByMove(e,t,n);return[new Jo(i)]}const o=Jo._createFromPositionAndShift(e,n),r=t._getTransformedByDeletion(e,n);if(this.containsPosition(t)&&!i&&(o.containsPosition(this.start)||o.containsPosition(this.end))){const i=this.start._getTransformedByMove(e,t,n),o=this.end._getTransformedByMove(e,t,n);return[new Jo(i,o)]}let s;const a=this.getDifference(o);let l=null;const c=this.getIntersection(o);if(1==a.length?l=new Jo(a[0].start._getTransformedByDeletion(e,n),a[0].end._getTransformedByDeletion(e,n)):2==a.length&&(l=new Jo(this.start,this.end._getTransformedByDeletion(e,n))),s=l?l._getTransformedByInsertion(r,n,null!==c||i):[],c){const e=new Jo(c.start._getCombined(o.start,r),c.end._getCombined(o.start,r));2==s.length?s.splice(1,0,e):s.push(e)}return s}_getTransformedByDeletion(e,t){let n=this.start._getTransformedByDeletion(e,t),i=this.end._getTransformedByDeletion(e,t);return null==n&&null==i?null:(null==n&&(n=e),null==i&&(i=e),new Jo(n,i))}static _createFromPositionAndShift(e,t){const n=e,i=e.getShiftedBy(t);return t>0?new this(n,i):new this(i,n)}static _createIn(e){return new this(Wo._createAt(e,0),Wo._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(Wo._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(0===e.length)throw new l.b("range-create-from-ranges-empty-array",null);if(1==e.length)return e[0].clone();const t=e[0];e.sort((e,t)=>e.start.isAfter(t.start)?1:-1);const n=e.indexOf(t),i=new this(t.start,t.end);if(n>0)for(let t=n-1;e[t].end.isEqual(i.start);t++)i.start=Wo._createAt(e[t].start);for(let t=n+1;t<e.length&&e[t].start.isEqual(i.end);t++)i.end=Wo._createAt(e[t].end);return i}static fromJSON(e,t){return new this(Wo.fromJSON(e.start,t),Wo.fromJSON(e.end,t))}}class Ko extends Jo{constructor(e,t){super(e,t),Xo.call(this)}detach(){this.stopListening()}is(e){return"liveRange"===e||"model:liveRange"===e||"range"==e||"model:range"===e}toRange(){return new Jo(this.start,this.end)}static fromRange(e){return new Ko(e.start,e.end)}}function Xo(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&Go.call(this,n)},{priority:"low"})}function Go(e){const t=this.getTransformedByOperation(e),n=Jo._createFromRanges(t),i=!n.isEqual(this),o=function(e,t){switch(t.type){case"insert":return e.containsPosition(t.position);case"move":case"remove":case"reinsert":case"merge":return e.containsPosition(t.sourcePosition)||e.start.isEqual(t.sourcePosition)||e.containsPosition(t.targetPosition);case"split":return e.containsPosition(t.splitPosition)||e.containsPosition(t.insertionPosition)}return!1}(this,e);let r=null;if(i){"$graveyard"==n.root.rootName&&(r="remove"==e.type?e.sourcePosition:e.deletionPosition);const t=this.toRange();this.start=n.start,this.end=n.end,this.fire("change:range",t,{deletionPosition:r})}else o&&this.fire("change:content",this.toRange(),{deletionPosition:r})}function Qo(e,t,n,i){let o,r=null;"function"==typeof i?o=i:(r=e.commands.get(i),o=()=>{e.execute(i)}),e.model.document.on("change:data",(i,s)=>{if(r&&!r.isEnabled||!t.isEnabled)return;const a=lt(e.model.document.selection.getRanges());if(!a.isCollapsed)return;if("transparent"==s.type)return;const l=Array.from(e.model.document.differ.getChanges()),c=l[0];if(1!=l.length||"insert"!==c.type||"$text"!=c.name||1!=c.length)return;const d=c.position.parent;if(d.is("element","codeBlock"))return;if(r&&!0===r.value)return;const u=d.getChild(0),h=e.model.createRangeOn(u);if(!h.containsRange(a)&&!a.end.isEqual(h.end))return;const m=n.exec(u.data.substr(0,a.end.offset));m&&e.model.enqueueChange(e=>{const t=e.createPositionAt(d,0),n=e.createPositionAt(d,m[0].length),i=new Ko(t,n);!1!==o({match:m})&&e.remove(i),i.detach()})})}function Zo(e,t,n,i){let o,r;n instanceof RegExp?o=n:r=n,r=r||(e=>{let t;const n=[],i=[];for(;null!==(t=o.exec(e))&&!(t&&t.length<4);){let{index:e,1:o,2:r,3:s}=t;const a=o+r+s;e+=t[0].length-a.length;const l=[e,e+o.length],c=[e+o.length+r.length,e+o.length+r.length+s.length];n.push(l),n.push(c),i.push([e+o.length,e+o.length+r.length])}return{remove:n,format:i}}),e.model.document.on("change:data",(n,o)=>{if("transparent"==o.type||!t.isEnabled)return;const s=e.model,a=s.document.selection;if(!a.isCollapsed)return;const l=Array.from(s.document.differ.getChanges()),c=l[0];if(1!=l.length||"insert"!==c.type||"$text"!=c.name||1!=c.length)return;const d=a.focus,u=d.parent,{text:h,range:m}=function(e,t){let n=e.start;return{text:Array.from(e.getItems()).reduce((e,i)=>!i.is("$text")&&!i.is("$textProxy")||i.getAttribute("code")?(n=t.createPositionAfter(i),""):e+i.data,""),range:t.createRange(n,e.end)}}(s.createRange(s.createPositionAt(u,0),d),s),g=r(h),p=er(m.start,g.format,s),f=er(m.start,g.remove,s);p.length&&f.length&&s.enqueueChange(e=>{if(!1!==i(e,p))for(const t of f.reverse())e.remove(t)})})}function er(e,t,n){return t.filter(e=>void 0!==e[0]&&void 0!==e[1]).map(t=>n.createRange(e.getShiftedBy(t[0]),e.getShiftedBy(t[1])))}Ye(Ko,u);function tr(e,t){return(n,i)=>{if(!e.commands.get(t).isEnabled)return!1;const o=e.model.schema.getValidRanges(i,t);for(const e of o)n.setAttribute(t,!0,e);n.removeSelectionAttribute(t)}}class nr extends st{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,i=void 0===e.forceValue?!this.value:e.forceValue;t.change(e=>{if(n.isCollapsed)i?e.setSelectionAttribute(this.attributeKey,!0):e.removeSelectionAttribute(this.attributeKey);else{const o=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of o)i?e.setAttribute(this.attributeKey,i,t):e.removeAttribute(this.attributeKey,t)}})}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const e of n.getRanges())for(const n of e.getItems())if(t.checkAttribute(n,this.attributeKey))return n.hasAttribute(this.attributeKey);return!1}}class ir extends Je{static get pluginName(){return"BoldEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"bold"}),e.model.schema.setAttributeProperties("bold",{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:"bold",view:"strong",upcastAlso:["b",e=>{const t=e.getStyle("font-weight");return t?"bold"==t||Number(t)>=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),e.commands.add("bold",new nr(e,"bold")),e.keystrokes.set("CTRL+B","bold")}}class or extends Je{init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("bold",n=>{const i=e.commands.get("bold"),o=new Fi(n);return o.set({label:t("Bold"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.6 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z"/></svg>',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute("bold"),e.editing.view.focus()}),o})}}class rr extends Je{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"italic"}),e.model.schema.setAttributeProperties("italic",{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:"italic",view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add("italic",new nr(e,"italic")),e.keystrokes.set("CTRL+I","italic")}}class sr extends Je{init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("italic",n=>{const i=e.commands.get("italic"),o=new Fi(n);return o.set({label:t("Italic"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.586 14.633l.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z"/></svg>',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute("italic"),e.editing.view.focus()}),o})}}class ar extends Je{static get pluginName(){return"StrikethroughEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"strikethrough"}),e.model.schema.setAttributeProperties("strikethrough",{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:"strikethrough",view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),e.commands.add("strikethrough",new nr(e,"strikethrough")),e.keystrokes.set("CTRL+SHIFT+X","strikethrough")}}class lr extends Je{init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("strikethrough",n=>{const i=e.commands.get("strikethrough"),o=new Fi(n);return o.set({label:t("Strikethrough"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 16.4c-.8-.4-1.5-.9-2.2-1.5a.6.6 0 0 1-.2-.5l.3-.6h1c1 1.2 2.1 1.7 3.7 1.7 1 0 1.8-.3 2.3-.6.6-.4.6-1.2.6-1.3.2-1.2-.9-2.1-.9-2.1h2.1c.3.7.4 1.2.4 1.7v.8l-.6 1.2c-.6.8-1.1 1-1.6 1.2a6 6 0 0 1-2.4.6c-1 0-1.8-.3-2.5-.6zM6.8 9L6 8.3c-.4-.5-.5-.8-.5-1.6 0-.7.1-1.3.5-1.8.4-.6 1-1 1.6-1.3a6.3 6.3 0 0 1 4.7 0 4 4 0 0 1 1.7 1l.3.7c0 .1.2.4-.2.7-.4.2-.9.1-1 0a3 3 0 0 0-1.2-1c-.4-.2-1-.3-2-.4-.7 0-1.4.2-2 .6-.8.6-1 .8-1 1.5 0 .8.5 1 1.2 1.5.6.4 1.1.7 1.9 1H6.8z"/><path d="M3 10.5V9h14v1.5z"/></svg>',keystroke:"CTRL+SHIFT+X",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute("strikethrough"),e.editing.view.focus()}),o})}}class cr extends Je{static get pluginName(){return"CKFinderUI"}init(){const e=this.editor,t=e.ui.componentFactory,n=e.t;t.add("ckfinder",t=>{const i=e.commands.get("ckfinder"),o=new Fi(t);return o.set({label:n("Insert image or file"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.627 16.5zm5.873-.196zm0-7.001V8h-13v8.5h4.341c.191.54.457 1.044.785 1.5H2a1.5 1.5 0 0 1-1.5-1.5v-13A1.5 1.5 0 0 1 2 2h4.5a1.5 1.5 0 0 1 1.06.44L9.122 4H16a1.5 1.5 0 0 1 1.5 1.5v1A1.5 1.5 0 0 1 19 8v2.531a6.027 6.027 0 0 0-1.5-1.228zM16 6.5v-1H8.5l-2-2H2v13h1V8a1.5 1.5 0 0 1 1.5-1.5H16z"/><path d="M14.5 19.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10zM15 14v-2h-1v2h-2v1h2v2h1v-2h2v-1h-2z"/></svg>',tooltip:!0}),o.bind("isEnabled").to(i),o.on("execute",()=>{e.execute("ckfinder"),e.editing.view.focus()}),o})}}class dr{constructor(e){this.view=e,this.document=e.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}}Ye(dr,xi);class ur extends dr{observe(e){this.listenTo(e,"load",(e,t)=>{"IMG"==t.target.tagName&&this._fireEvents(t)},{useCapture:!0})}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class hr{constructor(){this._stack=[]}add(e,t){const n=this._stack,i=n[0];this._insertDescriptor(e);const o=n[0];i===o||mr(i,o)||this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:t})}remove(e,t){const n=this._stack,i=n[0];this._removeDescriptor(e);const o=n[0];i===o||mr(i,o)||this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex(t=>t.id===e.id);if(mr(e,t[n]))return;n>-1&&t.splice(n,1);let i=0;for(;t[i]&&gr(t[i],e);)i++;t.splice(i,0,e)}_removeDescriptor(e){const t=this._stack,n=t.findIndex(t=>t.id===e);n>-1&&t.splice(n,1)}}function mr(e,t){return e&&t&&e.priority==t.priority&&pr(e.classes)==pr(t.classes)}function gr(e,t){return e.priority>t.priority||!(e.priority<t.priority)&&pr(e.classes)>pr(t.classes)}function pr(e){return Array.isArray(e)?e.sort().join(","):e}function fr(e){return t=>t+e}Ye(hr,u);n(35);const wr=fr("px"),br=Wi.document.body;class _r extends Ti{constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",e=>"ck-balloon-panel_"+e),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",wr),left:t.to("left",wr)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){this.show();const t=_r.defaultPositions,n=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthMiddleWest,t.southArrowNorthMiddleEast,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthMiddleWest,t.northArrowSouthMiddleEast,t.northArrowSouthWest,t.northArrowSouthEast],limiter:br,fitInViewport:!0},e),i=_r._getOptimalPosition(n),o=parseInt(i.left),r=parseInt(i.top),s=i.name;Object.assign(this,{top:r,left:o,position:s})}pin(e){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this._startPinning(e),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){this.attachTo(e);const t=kr(e.target),n=e.limiter?kr(e.limiter):br;this.listenTo(Wi.document,"scroll",(i,o)=>{const r=o.target,s=t&&r.contains(t),a=n&&r.contains(n);!s&&!a&&t&&n||this.attachTo(e)},{useCapture:!0}),this.listenTo(Wi.window,"resize",()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(Wi.document,"scroll"),this.stopListening(Wi.window,"resize")}}function kr(e){return eo(e)?e:$i(e)?e.commonAncestorContainer:"function"==typeof e?kr(e()):null}function vr(e,t){return e.top-t.height-_r.arrowVerticalOffset}function yr(e){return e.bottom+_r.arrowVerticalOffset}_r.arrowHorizontalOffset=25,_r.arrowVerticalOffset=10,_r._getOptimalPosition=ro,_r.defaultPositions={northWestArrowSouthWest:(e,t)=>({top:vr(e,t),left:e.left-_r.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(e,t)=>({top:vr(e,t),left:e.left-.25*t.width-_r.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(e,t)=>({top:vr(e,t),left:e.left-t.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(e,t)=>({top:vr(e,t),left:e.left-.75*t.width+_r.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(e,t)=>({top:vr(e,t),left:e.left-t.width+_r.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(e,t)=>({top:vr(e,t),left:e.left+e.width/2-_r.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(e,t)=>({top:vr(e,t),left:e.left+e.width/2-.25*t.width-_r.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(e,t)=>({top:vr(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(e,t)=>({top:vr(e,t),left:e.left+e.width/2-.75*t.width+_r.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(e,t)=>({top:vr(e,t),left:e.left+e.width/2-t.width+_r.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(e,t)=>({top:vr(e,t),left:e.right-_r.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(e,t)=>({top:vr(e,t),left:e.right-.25*t.width-_r.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(e,t)=>({top:vr(e,t),left:e.right-t.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(e,t)=>({top:vr(e,t),left:e.right-.75*t.width+_r.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(e,t)=>({top:vr(e,t),left:e.right-t.width+_r.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(e,t)=>({top:yr(e),left:e.left-_r.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(e,t)=>({top:yr(e),left:e.left-.25*t.width-_r.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(e,t)=>({top:yr(e),left:e.left-t.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(e,t)=>({top:yr(e),left:e.left-.75*t.width+_r.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(e,t)=>({top:yr(e),left:e.left-t.width+_r.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(e,t)=>({top:yr(e),left:e.left+e.width/2-_r.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(e,t)=>({top:yr(e),left:e.left+e.width/2-.25*t.width-_r.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(e,t)=>({top:yr(e),left:e.left+e.width/2-t.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(e,t)=>({top:yr(e),left:e.left+e.width/2-.75*t.width+_r.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(e,t)=>({top:yr(e),left:e.left+e.width/2-t.width+_r.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(e,t)=>({top:yr(e),left:e.right-_r.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(e,t)=>({top:yr(e),left:e.right-.25*t.width-_r.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(e,t)=>({top:yr(e),left:e.right-t.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(e,t)=>({top:yr(e),left:e.right-.75*t.width+_r.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(e,t)=>({top:yr(e),left:e.right-t.width+_r.arrowHorizontalOffset,name:"arrow_ne"})};function xr(e,t,n){return e&&Cr(e)&&!n.isInline(t)}function Ar(e){return e.getAttribute("widget-type-around")}function Cr(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function Tr(e,t,n={}){if(!e.is("containerElement"))throw new l.b("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass("ck-widget",e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=Nr,n.label&&function(e,t,n){n.setCustomProperty("widgetLabel",t,e)}(e,n.label,t),n.hasSelectionHandle&&function(e,t){const n=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(e){const t=this.toDomElement(e),n=new Ei;return n.set("content",'<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0H4zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3V0zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3v1zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5H12z"/><path fill-opacity=".256" d="M1 1h14v14H1z"/><g class="ck-icon__selected-indicator"><path d="M7 0h2v1H7V0zM0 7h1v2H0V7zm15 0h1v2h-1V7zm-8 8h2v1H7v-1z"/><path fill-opacity=".254" d="M1 1h14v14H1z"/></g></svg>'),n.render(),t.appendChild(n.element),t}));t.insert(t.createPositionAt(e,0),n),t.addClass(["ck-widget_with-selection-handle"],e)}(e,t),Er(e,t,(e,t,n)=>n.addClass(i(t.classes),e),(e,t,n)=>n.removeClass(i(t.classes),e)),e;function i(e){return Array.isArray(e)?e:[e]}}function Er(e,t,n,i){const o=new hr;o.on("change:top",(t,o)=>{o.oldDescriptor&&i(e,o.oldDescriptor,o.writer),o.newDescriptor&&n(e,o.newDescriptor,o.writer)}),t.setCustomProperty("addHighlight",(e,t,n)=>o.add(t,n),e),t.setCustomProperty("removeHighlight",(e,t,n)=>o.remove(t,n),e)}function Mr(e){const t=e.getCustomProperty("widgetLabel");return t?"function"==typeof t?t():t:""}function Pr(e,t){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],e),t.setAttribute("contenteditable",e.isReadOnly?"false":"true",e),e.on("change:isReadOnly",(n,i,o)=>{t.setAttribute("contenteditable",o?"false":"true",e)}),e.on("change:isFocused",(n,i,o)=>{o?t.addClass("ck-editor__nested-editable_focused",e):t.removeClass("ck-editor__nested-editable_focused",e)}),e}function Sr(e,t){const n=e.getSelectedElement();if(n){const i=Ar(e);if(i)return t.createPositionAt(n,i);if(t.schema.isBlock(n))return t.createPositionAfter(n)}const i=e.getSelectedBlocks().next().value;if(i){if(i.isEmpty)return t.createPositionAt(i,0);const n=t.createPositionAfter(i);return e.focus.isTouching(n)?n:t.createPositionBefore(i)}return e.focus}function Ir(e,t){return(n,i)=>{const{mapper:o,viewPosition:r}=i,s=o.findMappedViewAncestor(r);if(!t(s))return;const a=o.toModelElement(s);i.modelPosition=e.createPositionAt(a,r.isAtStart?"before":"after")}}function Or(e,t){const n=new no(Wi.window),i=n.getIntersection(e),o=t.height+_r.arrowVerticalOffset;if(e.top-o>n.top||e.bottom+o<n.bottom)return null;const r=i||e,s=r.left+r.width/2-t.width/2;return{top:Math.max(e.top,0)+_r.arrowVerticalOffset,left:s,name:"arrow_n"}}function Nr(){return null}function zr(e){const t=e.getSelectedElement();return t&&function(e){return!!e.getCustomProperty("image")&&Cr(e)}(t)?t:null}function Rr(e){return!!e&&e.is("element","image")}function Lr(e,t,n={}){const i=e.createElement("image",n),o=Sr(t.document.selection,t);t.insertContent(i,o),i.parent&&e.setSelection(i,"on")}function jr(e){const t=e.schema,n=e.document.selection;return function(e,t,n){const i=function(e,t){const n=Sr(e,t).parent;if(n.isEmpty&&!n.is("element","$root"))return n.parent;return n}(e,n);return t.checkChild(i,"image")}(n,t,e)&&!function(e,t){const n=e.getSelectedElement();return n&&t.isObject(n)}(n,t)&&function(e){return[...e.focus.getAncestors()].every(e=>!e.is("element","image"))}(n)}function Dr(e){const t=[];for(const n of e.getChildren())t.push(n),n.is("element")&&t.push(...n.getChildren());return t.find(e=>e.is("element","img"))}function Br(e){return n=>{n.on(`attribute:${e}:image`,t)};function t(e,t,n){if(!n.consumable.consume(t.item,e.name))return;const i=n.writer,o=Dr(n.mapper.toViewElement(t.item));i.setAttribute(t.attributeKey,t.attributeNewValue||"",o)}}class Vr extends st{refresh(){this.isEnabled=jr(this.editor.model)}execute(e){const t=this.editor.model;t.change(n=>{const i=Array.isArray(e.source)?e.source:[e.source];for(const e of i)Lr(n,t,{src:e})})}}class Fr extends Je{static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.model.schema,n=e.t,i=e.conversion;e.editing.view.addObserver(ur),t.register("image",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),i.for("dataDowncast").elementToElement({model:"image",view:(e,{writer:t})=>Hr(t)}),i.for("editingDowncast").elementToElement({model:"image",view:(e,{writer:t})=>function(e,t,n){return t.setCustomProperty("image",!0,e),Tr(e,t,{label:function(){const t=Dr(e).getAttribute("alt");return t?`${t} ${n}`:n}})}(Hr(t),t,n("image widget"))}),i.for("downcast").add(Br("src")).add(Br("alt")).add(function(){return t=>{t.on("attribute:srcset:image",e)};function e(e,t,n){if(!n.consumable.consume(t.item,e.name))return;const i=n.writer,o=Dr(n.mapper.toViewElement(t.item));if(null===t.attributeNewValue){const e=t.attributeOldValue;e.data&&(i.removeAttribute("srcset",o),i.removeAttribute("sizes",o),e.width&&i.removeAttribute("width",o))}else{const e=t.attributeNewValue;e.data&&(i.setAttribute("srcset",e.data,o),i.setAttribute("sizes","100vw",o),e.width&&i.setAttribute("width",e.width,o))}}}()),i.for("upcast").elementToElement({view:{name:"img",attributes:{src:!0}},model:(e,{writer:t})=>t.createElement("image",{src:e.getAttribute("src")})}).attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:e=>{const t={data:e.getAttribute("srcset")};return e.hasAttribute("width")&&(t.width=e.getAttribute("width")),t}}}).add(function(){return t=>{t.on("element:figure",e)};function e(e,t,n){if(!n.consumable.test(t.viewItem,{name:!0,classes:"image"}))return;const i=Dr(t.viewItem);if(!i||!i.hasAttribute("src")||!n.consumable.test(i,{name:!0}))return;const o=lt(n.convertItem(i,t.modelCursor).modelRange.getItems());o&&(n.convertChildren(t.viewItem,o),n.updateConversionResult(o,t))}}()),e.commands.add("imageInsert",new Vr(e))}}function Hr(e){const t=e.createEmptyElement("img"),n=e.createContainerElement("figure",{class:"image"});return e.insert(e.createPositionAt(n,0),t),n}class Ur{constructor(e,t,n){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,Le(this,n)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class Wr extends dr{constructor(e){super(e),this.useCapture=!1}observe(e){("string"==typeof this.domEventType?[this.domEventType]:this.domEventType).forEach(t=>{this.listenTo(e,t,(e,t)=>{this.isEnabled&&this.onDomEvent(t)},{useCapture:this.useCapture})})}fire(e,t,n){this.isEnabled&&this.document.fire(e,new Ur(this.view,t,n))}}class $r extends Wr{constructor(e){super(e),this.domEventType="mousedown"}onDomEvent(e){this.fire(e.type,e)}}class qr extends Je{static get pluginName(){return"TwoStepCaretMovement"}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){const e=this.editor,t=e.model,n=e.editing.view,i=e.locale,o=t.document.selection;this.listenTo(n.document,"keydown",(e,t)=>{if(!o.isCollapsed)return;if(t.shiftKey||t.altKey||t.ctrlKey)return;const n=t.keyCode==Ni.arrowright,r=t.keyCode==Ni.arrowleft;if(!n&&!r)return;const s=i.contentLanguageDirection;let a=!1;a="ltr"===s&&n||"rtl"===s&&r?this._handleForwardMovement(t):this._handleBackwardMovement(t),!0===a&&e.stop()},{priority:a.get("high")+1}),this._isNextGravityRestorationSkipped=!1,this.listenTo(o,"change:range",(e,t)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!t.directChange&&Xr(o.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,n=this.editor.model.document.selection,i=n.getFirstPosition();return!this._isGravityOverridden&&((!i.isAtStart||!Yr(n,t))&&(Xr(i,t)?(Kr(e),this._overrideGravity(),!0):void 0))}_handleBackwardMovement(e){const t=this.attributes,n=this.editor.model,i=n.document.selection,o=i.getFirstPosition();return this._isGravityOverridden?(Kr(e),this._restoreGravity(),Jr(n,t,o),!0):o.isAtStart?!!Yr(i,t)&&(Kr(e),Jr(n,t,o),!0):function(e,t){return Xr(e.getShiftedBy(-1),t)}(o,t)?o.isAtEnd&&!Yr(i,t)&&Xr(o,t)?(Kr(e),Jr(n,t,o),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):void 0}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function Yr(e,t){for(const n of t)if(e.hasAttribute(n))return!0;return!1}function Jr(e,t,n){const i=n.nodeBefore;e.change(e=>{i?e.setSelectionAttribute(i.getAttributes()):e.removeSelectionAttribute(t)})}function Kr(e){e.preventDefault()}function Xr(e,t){const{nodeBefore:n,nodeAfter:i}=e;for(const e of t){const t=n?n.getAttribute(e):void 0;if((i?i.getAttribute(e):void 0)!==t)return!0}return!1}function Gr(e,t,n,i){return i.createRange(Qr(e,t,n,!0,i),Qr(e,t,n,!1,i))}function Qr(e,t,n,i,o){let r=e.textNode||(i?e.nodeBefore:e.nodeAfter),s=null;for(;r&&r.getAttribute(t)==n;)s=r,r=i?r.previousSibling:r.nextSibling;return s?o.createPositionAt(s,i?"before":"after"):e}class Zr{constructor(e,t=20){this.model=e,this.size=0,this.limit=t,this.isLocked=!1,this._changeCallback=(e,t)=>{"transparent"!=t.type&&t!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch()),this._batch}input(e){this.size+=e,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e){this.isLocked&&!e||(this._batch=null,this.size=0)}}class es extends st{constructor(e,t){super(e),this._buffer=new Zr(e.model,t),this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,n=t.document,i=e.text||"",o=i.length,r=e.range?t.createSelection(e.range):n.selection,s=e.resultRange;t.enqueueChange(this._buffer.batch,e=>{this._buffer.lock(),this._batches.add(this._buffer.batch),t.deleteContent(r),i&&t.insertContent(e.createText(i,n.selection.getAttributes()),r),s?e.setSelection(s):r.is("documentSelection")||e.setSelection(r),this._buffer.unlock(),this._buffer.input(o)})}}const ts=[zi("arrowUp"),zi("arrowRight"),zi("arrowDown"),zi("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let e=112;e<=135;e++)ts.push(e);function ns(e){return!!e.ctrlKey||ts.includes(e.keyCode)}function is(e,t,n,i=!1){n=n||function(e,t){return e===t},Array.isArray(e)||(e=Array.prototype.slice.call(e)),Array.isArray(t)||(t=Array.prototype.slice.call(t));const o=function(e,t,n){const i=os(e,t,n);if(-1===i)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const o=rs(e,i),r=rs(t,i),s=os(o,r,n),a=e.length-s,l=t.length-s;return{firstIndex:i,lastIndexOld:a,lastIndexNew:l}}(e,t,n);return i?function(e,t){const{firstIndex:n,lastIndexOld:i,lastIndexNew:o}=e;if(-1===n)return Array(t).fill("equal");let r=[];n>0&&(r=r.concat(Array(n).fill("equal")));o-n>0&&(r=r.concat(Array(o-n).fill("insert")));i-n>0&&(r=r.concat(Array(i-n).fill("delete")));o<t&&(r=r.concat(Array(t-o).fill("equal")));return r}(o,t.length):function(e,t){const n=[],{firstIndex:i,lastIndexOld:o,lastIndexNew:r}=t;r-i>0&&n.push({index:i,type:"insert",values:e.slice(i,r)});o-i>0&&n.push({index:i+(r-i),type:"delete",howMany:o-i});return n}(t,o)}function os(e,t,n){for(let i=0;i<Math.max(e.length,t.length);i++)if(void 0===e[i]||void 0===t[i]||!n(e[i],t[i]))return i;return-1}function rs(e,t){return e.slice(t).reverse()}function ss(e,t,n){n=n||function(e,t){return e===t};const i=e.length,o=t.length;if(i>200||o>200||i+o>300)return ss.fastDiff(e,t,n,!0);let r,s;if(o<i){const n=e;e=t,t=n,r="delete",s="insert"}else r="insert",s="delete";const a=e.length,l=t.length,c=l-a,d={},u={};function h(i){const o=(void 0!==u[i-1]?u[i-1]:-1)+1,c=void 0!==u[i+1]?u[i+1]:-1,h=o>c?-1:1;d[i+h]&&(d[i]=d[i+h].slice(0)),d[i]||(d[i]=[]),d[i].push(o>c?r:s);let m=Math.max(o,c),g=m-i;for(;g<a&&m<l&&n(e[g],t[m]);)g++,m++,d[i].push("equal");return m}let m,g=0;do{for(m=-g;m<c;m++)u[m]=h(m);for(m=c+g;m>c;m--)u[m]=h(m);u[c]=h(c),g++}while(u[c]!==l);return d[c].slice(1)}ss.fastDiff=is;var as=function(e){return ti(e,4)};class ls{constructor(e){this.document=e,this.parent=null}get index(){let e;if(!this.parent)return null;if(-1==(e=this.parent.getChildIndex(this)))throw new l.b("view-node-not-found-in-parent",this);return e}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),i=e.getAncestors(t);let o=0;for(;n[o]==i[o]&&n[o];)o++;return 0===o?null:n[o-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),i=Lo(t,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return t[i]<n[i]}}isAfter(e){return this!=e&&(this.root===e.root&&!this.isBefore(e))}_remove(){this.parent._removeChildren(this.index)}_fireChange(e,t){this.fire("change:"+e,t),this.parent&&this.parent._fireChange(e,t)}toJSON(){const e=as(this);return delete e.parent,e}is(e){return"node"===e||"view:node"===e}}Ye(ls,u);class cs extends ls{constructor(e,t){super(e),this._textData=t}is(e){return"$text"===e||"view:$text"===e||"text"===e||"view:text"===e||"node"===e||"view:node"===e}get data(){return this._textData}get _data(){return this.data}set _data(e){this._fireChange("text",this),this._textData=e}isSimilar(e){return e instanceof cs&&(this===e||this.data===e.data)}_clone(){return new cs(this.document,this.data)}}class ds{constructor(e,t,n){if(this.textNode=e,t<0||t>e.data.length)throw new l.b("view-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.data.length)throw new l.b("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+n),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(e){return"$textProxy"===e||"view:$textProxy"===e||"textProxy"===e||"view:textProxy"===e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this.textNode:this.parent;for(;null!==n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}}class us{constructor(...e){this._patterns=[],this.add(...e)}add(...e){for(let t of e)("string"==typeof t||t instanceof RegExp)&&(t={name:t}),t.classes&&("string"==typeof t.classes||t.classes instanceof RegExp)&&(t.classes=[t.classes]),this._patterns.push(t)}match(...e){for(const t of e)for(const e of this._patterns){const n=hs(t,e);if(n)return{element:t,pattern:e,match:n}}return null}matchAll(...e){const t=[];for(const n of e)for(const e of this._patterns){const i=hs(n,e);i&&t.push({element:n,pattern:e,match:i})}return t.length>0?t:null}getElementName(){if(1!==this._patterns.length)return null;const e=this._patterns[0],t=e.name;return"function"==typeof e||!t||t instanceof RegExp?null:t}}function hs(e,t){if("function"==typeof t)return t(e);const n={};return t.name&&(n.name=function(e,t){if(e instanceof RegExp)return e.test(t);return e===t}(t.name,e.name),!n.name)||t.attributes&&(n.attributes=function(e,t){const n=[];for(const i in e){const o=e[i];if(!t.hasAttribute(i))return null;{const e=t.getAttribute(i);if(!0===o)n.push(i);else if(o instanceof RegExp){if(!o.test(e))return null;n.push(i)}else{if(e!==o)return null;n.push(i)}}}return n}(t.attributes,e),!n.attributes)?null:!(t.classes&&(n.classes=function(e,t){const n=[];for(const i of e)if(i instanceof RegExp){const e=t.getClassNames();for(const t of e)i.test(t)&&n.push(t);if(0===n.length)return null}else{if(!t.hasClass(i))return null;n.push(i)}return n}(t.classes,e),!n.classes))&&(!(t.styles&&(n.styles=function(e,t){const n=[];for(const i in e){const o=e[i];if(!t.hasStyle(i))return null;{const e=t.getStyle(i);if(o instanceof RegExp){if(!o.test(e))return null;n.push(i)}else{if(e!==o)return null;n.push(i)}}}return n}(t.styles,e),!n.styles))&&n)}var ms=function(e){return"symbol"==typeof e||ge(e)&&"[object Symbol]"==P(e)},gs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ps=/^\w*$/;var fs=function(e,t){if(ke(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ms(e))||(ps.test(e)||!gs.test(e)||null!=t&&e in Object(t))};function ws(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],r=n.cache;if(r.has(o))return r.get(o);var s=e.apply(this,i);return n.cache=r.set(o,s)||r,s};return n.cache=new(ws.Cache||Jt),n}ws.Cache=Jt;var bs=ws;var _s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ks=/\\(\\)?/g,vs=function(e){var t=bs(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(_s,(function(e,n,i,o){t.push(i?o.replace(ks,"$1"):n||e)})),t}));var ys=function(e,t){for(var n=-1,i=null==e?0:e.length,o=Array(i);++n<i;)o[n]=t(e[n],n,e);return o},xs=k?k.prototype:void 0,As=xs?xs.toString:void 0;var Cs=function e(t){if("string"==typeof t)return t;if(ke(t))return ys(t,e)+"";if(ms(t))return As?As.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var Ts=function(e){return null==e?"":Cs(e)};var Es=function(e,t){return ke(e)?e:fs(e,t)?[e]:vs(Ts(e))};var Ms=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var Ps=function(e){if("string"==typeof e||ms(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};var Ss=function(e,t){for(var n=0,i=(t=Es(t,e)).length;null!=e&&n<i;)e=e[Ps(t[n++])];return n&&n==i?e:void 0};var Is=function(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(o);++i<o;)r[i]=e[i+t];return r};var Os=function(e,t){return t.length<2?e:Ss(e,Is(t,0,-1))};var Ns=function(e,t){return t=Es(t,e),null==(e=Os(e,t))||delete e[Ps(Ms(t))]};var zs=function(e,t){return null==e||Ns(e,t)};var Rs=function(e,t,n){var i=null==e?void 0:Ss(e,t);return void 0===i?n:i};var Ls=function(e,t,n){(void 0!==n&&!J(e[t],n)||void 0===n&&!(t in e))&&Y(e,t,n)};var js=function(e){return function(t,n,i){for(var o=-1,r=Object(t),s=i(t),a=s.length;a--;){var l=s[e?a:++o];if(!1===n(r[l],l,r))break}return t}}();var Ds=function(e){return ge(e)&&le(e)};var Bs=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var Vs=function(e){return G(e,Re(e))};var Fs=function(e,t,n,i,o,r,s){var a=Bs(e,n),l=Bs(t,n),c=s.get(l);if(c)Ls(e,n,c);else{var d=r?r(a,l,n+"",e,t,s):void 0,u=void 0===d;if(u){var h=ke(l),m=!h&&Object(ve.a)(l),g=!h&&!m&&Ee(l);d=l,h||m||g?ke(a)?d=a:Ds(a)?d=ln(a):m?(u=!1,d=Object(an.a)(l,!0)):g?(u=!1,d=Un(l,!0)):d=[]:Zi(l)||_e(l)?(d=a,_e(a)?d=Vs(a):b(a)&&!I(a)||(d=Yn(l))):u=!1}u&&(s.set(l,d),o(d,l,i,r,s),s.delete(l)),Ls(e,n,d)}};var Hs=function e(t,n,i,o,r){t!==n&&js(n,(function(s,a){if(r||(r=new Gt),b(s))Fs(t,n,a,i,e,o,r);else{var l=o?o(Bs(t,a),s,a+"",t,n,r):void 0;void 0===l&&(l=s),Ls(t,a,l)}}),Re)},Us=he((function(e,t,n){Hs(e,t,n)}));var Ws=function(e,t,n,i){if(!b(e))return e;for(var o=-1,r=(t=Es(t,e)).length,s=r-1,a=e;null!=a&&++o<r;){var l=Ps(t[o]),c=n;if(o!=s){var d=a[l];void 0===(c=i?i(d,l,a):void 0)&&(c=b(d)?d:de(t[o+1])?[]:{})}X(a,l,c),a=a[l]}return e};var $s=function(e,t,n){return null==e?e:Ws(e,t,n)};class qs{constructor(e){this._styles={},this._styleProcessor=e}get isEmpty(){const e=Object.entries(this._styles);return!Array.from(e).length}get size(){return this.isEmpty?0:this.getStyleNames().length}setTo(e){this.clear();const t=Array.from(function(e){let t=null,n=0,i=0,o=null;const r=new Map;if(""===e)return r;";"!=e.charAt(e.length-1)&&(e+=";");for(let s=0;s<e.length;s++){const a=e.charAt(s);if(null===t)switch(a){case":":o||(o=e.substr(n,s-n),i=s+1);break;case'"':case"'":t=a;break;case";":{const t=e.substr(i,s-i);o&&r.set(o.trim(),t.trim()),o=null,n=s+1;break}}else a===t&&(t=null)}return r}(e).entries());for(const[e,n]of t)this._styleProcessor.toNormalizedForm(e,n,this._styles)}has(e){if(this.isEmpty)return!1;const t=this._styleProcessor.getReducedForm(e,this._styles).find(([t])=>t===e);return Array.isArray(t)}set(e,t){if(b(e))for(const[t,n]of Object.entries(e))this._styleProcessor.toNormalizedForm(t,n,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t=Js(e);zs(this._styles,t),delete this._styles[e],this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map(e=>e.join(":")).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!b(this._styles[e]))return this._styles[e];const t=this._styleProcessor.getReducedForm(e,this._styles).find(([t])=>t===e);return Array.isArray(t)?t[1]:void 0}getStyleNames(){if(this.isEmpty)return[];return this._getStylesEntries().map(([e])=>e)}clear(){this._styles={}}_getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const n of t)e.push(...this._styleProcessor.getReducedForm(n,this._styles));return e}_cleanEmptyObjectsOnPath(e){const t=e.split(".");if(!(t.length>1))return;const n=t.splice(0,t.length-1).join("."),i=Rs(this._styles,n);if(!i)return;!Array.from(Object.keys(i)).length&&this.remove(n)}}class Ys{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,n){if(b(t))Ks(n,Js(e),t);else if(this._normalizers.has(e)){const i=this._normalizers.get(e),{path:o,value:r}=i(t);Ks(n,o,r)}else Ks(n,e,t)}getNormalized(e,t){if(!e)return Us({},t);if(void 0!==t[e])return t[e];if(this._extractors.has(e)){const n=this._extractors.get(e);if("string"==typeof n)return Rs(t,n);const i=n(e,t);if(i)return i}return Rs(t,Js(e))}getReducedForm(e,t){const n=this.getNormalized(e,t);if(void 0===n)return[];if(this._reducers.has(e)){return this._reducers.get(e)(n)}return[[e,n]]}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const n of t)this._mapStyleNames(n,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function Js(e){return e.replace("-",".")}function Ks(e,t,n){let i=n;b(n)&&(i=Us({},Rs(e,t),n)),$s(e,t,i)}class Xs extends ls{constructor(e,t,n,i){if(super(e),this.name=t,this._attrs=function(e){e=Ro(e);for(const[t,n]of e)null===n?e.delete(t):"string"!=typeof n&&e.set(t,String(n));return e}(n),this._children=[],i&&this._insertChild(0,i),this._classes=new Set,this._attrs.has("class")){const e=this._attrs.get("class");Gs(this._classes,e),this._attrs.delete("class")}this._styles=new qs(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style")),this._customProperties=new Map}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}is(e,t=null){return t?t===this.name&&("element"===e||"view:element"===e):"element"===e||"view:element"===e||"node"===e||"view:node"===e}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.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(e){if("class"==e)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==e){const e=this._styles.toString();return""==e?void 0:e}return this._attrs.get(e)}hasAttribute(e){return"class"==e?this._classes.size>0:"style"==e?!this._styles.isEmpty:this._attrs.has(e)}isSimilar(e){if(!(e instanceof Xs))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;for(const[t,n]of this._attrs)if(!e._attrs.has(t)||e._attrs.get(t)!==n)return!1;for(const t of this._classes)if(!e._classes.has(t))return!1;for(const t of this._styles.getStyleNames())if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t))return!1;return!0}hasClass(...e){for(const t of e)if(!this._classes.has(t))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(){return this._styles.getStyleNames()}hasStyle(...e){for(const t of e)if(!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new us(...e);let n=this.parent;for(;n;){if(t.match(n))return n;n=n.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(","),t=this._styles.toString(),n=Array.from(this._attrs).map(e=>`${e[0]}="${e[1]}"`).sort().join(" ");return this.name+(""==e?"":` class="${e}"`)+(t?` style="${t}"`:"")+(""==n?"":" "+n)}_clone(e=!1){const t=[];if(e)for(const n of this.getChildren())t.push(n._clone(e));const n=new this.constructor(this.document,this.name,this._attrs,t);return n._classes=new Set(this._classes),n._styles.set(this._styles.getNormalized()),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let n=0;const i=function(e,t){if("string"==typeof t)return[new cs(e,t)];Ge(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new cs(e,t):t instanceof ds?new cs(e,t.data):t)}(this.document,t);for(const t of i)null!==t.parent&&t._remove(),t.parent=this,t.document=this.document,this._children.splice(e,0,t),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n<e+t;n++)this._children[n].parent=null;return this._children.splice(e,t)}_setAttribute(e,t){t=String(t),this._fireChange("attributes",this),"class"==e?Gs(this._classes,t):"style"==e?this._styles.setTo(t):this._attrs.set(e,t)}_removeAttribute(e){return this._fireChange("attributes",this),"class"==e?this._classes.size>0&&(this._classes.clear(),!0):"style"==e?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(e)}_addClass(e){this._fireChange("attributes",this),(e=Array.isArray(e)?e:[e]).forEach(e=>this._classes.add(e))}_removeClass(e){this._fireChange("attributes",this),(e=Array.isArray(e)?e:[e]).forEach(e=>this._classes.delete(e))}_setStyle(e,t){this._fireChange("attributes",this),this._styles.set(e,t)}_removeStyle(e){this._fireChange("attributes",this),(e=Array.isArray(e)?e:[e]).forEach(e=>this._styles.remove(e))}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function Gs(e,t){const n=t.split(/\s+/);e.clear(),n.forEach(t=>e.add(t))}class Qs{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new l.b("view-tree-walker-no-start-position",null);if(e.direction&&"forward"!=e.direction&&"backward"!=e.direction)throw new l.b("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this.position=na._createAt(e.startPosition):this.position=na._createAt(e.boundaries["backward"==e.direction?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(e){let t,n,i;do{i=this.position,({done:t,value:n}=this.next())}while(!t&&e(n));t||(this.position=i)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,n=e.parent;if(null===n.parent&&e.offset===n.childCount)return{done:!0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};let i;if(n instanceof cs){if(e.isAtEnd)return this.position=na._createAfter(n),this._next();i=n.data[e.offset]}else i=n.getChild(e.offset);if(i instanceof Xs)return this.shallow?e.offset++:e=new na(i,0),this.position=e,this._formatReturnValue("elementStart",i,t,e,1);if(i instanceof cs){if(this.singleCharacters)return e=new na(i,0),this.position=e,this._next();{let n,o=i.data.length;return i==this._boundaryEndParent?(o=this.boundaries.end.offset,n=new ds(i,0,o),e=na._createAfter(n)):(n=new ds(i,0,i.data.length),e.offset++),this.position=e,this._formatReturnValue("text",n,t,e,o)}}if("string"==typeof i){let i;if(this.singleCharacters)i=1;else{i=(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-e.offset}const o=new ds(n,e.offset,i);return e.offset+=i,this.position=e,this._formatReturnValue("text",o,t,e,i)}return e=na._createAfter(n),this.position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,t,e)}_previous(){let e=this.position.clone();const t=this.position,n=e.parent;if(null===n.parent&&0===e.offset)return{done:!0};if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0};let i;if(n instanceof cs){if(e.isAtStart)return this.position=na._createBefore(n),this._previous();i=n.data[e.offset-1]}else i=n.getChild(e.offset-1);if(i instanceof Xs)return this.shallow?(e.offset--,this.position=e,this._formatReturnValue("elementStart",i,t,e,1)):(e=new na(i,i.childCount),this.position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",i,t,e));if(i instanceof cs){if(this.singleCharacters)return e=new na(i,i.data.length),this.position=e,this._previous();{let n,o=i.data.length;if(i==this._boundaryStartParent){const t=this.boundaries.start.offset;n=new ds(i,t,i.data.length-t),o=n.data.length,e=na._createBefore(n)}else n=new ds(i,0,i.data.length),e.offset--;return this.position=e,this._formatReturnValue("text",n,t,e,o)}}if("string"==typeof i){let i;if(this.singleCharacters)i=1;else{const t=n===this._boundaryStartParent?this.boundaries.start.offset:0;i=e.offset-t}e.offset-=i;const o=new ds(n,e.offset,i);return this.position=e,this._formatReturnValue("text",o,t,e,i)}return e=na._createBefore(n),this.position=e,this._formatReturnValue("elementStart",n,t,e,1)}_formatReturnValue(e,t,n,i,o){return t instanceof ds&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=na._createAfter(t.textNode):(i=na._createAfter(t.textNode),this.position=i)),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=na._createBefore(t.textNode):(i=na._createBefore(t.textNode),this.position=i))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:i,length:o}}}}class Zs extends Xs{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=ea}is(e,t=null){return t?t===this.name&&("containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}}function ea(){const e=[...this.getChildren()],t=e[this.childCount-1];if(t&&t.is("element","br"))return this.childCount;for(const t of e)if(!t.is("uiElement"))return null;return this.childCount}class ta extends Zs{constructor(e,t,n,i){super(e,t,n,i),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",t=>t&&e.selection.editableElement==this),this.listenTo(e.selection,"change",()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}is(e,t=null){return t?t===this.name&&("editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}destroy(){this.stopListening()}}Ye(ta,Fe);class na{constructor(e,t){this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof ta);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=na._createAt(this),n=t.offset+e;return t.offset=n<0?0:n,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new Qs(t);return n.skip(e),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let i=0;for(;t[i]==n[i]&&t[i];)i++;return 0===i?null:t[i-1]}is(e){return"position"===e||"view:position"===e}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return"before"==this.compareWith(e)}isAfter(e){return"after"==this.compareWith(e)}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],n=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),n.push(e.offset);const i=Lo(t,n);switch(i){case"prefix":return"before";case"extension":return"after";default:return t[i]<n[i]?"before":"after"}}getWalker(e={}){return e.startPosition=this,new Qs(e)}clone(){return new na(this.parent,this.offset)}static _createAt(e,t){if(e instanceof na)return new this(e.parent,e.offset);{const n=e;if("end"==t)t=n.is("$text")?n.data.length:n.childCount;else{if("before"==t)return this._createBefore(n);if("after"==t)return this._createAfter(n);if(0!==t&&!t)throw new l.b("view-createpositionat-offset-required",n)}return new na(n,t)}}static _createAfter(e){if(e.is("$textProxy"))return new na(e.textNode,e.offsetInText+e.data.length);if(!e.parent)throw new l.b("view-position-after-root",e,{root:e});return new na(e.parent,e.index+1)}static _createBefore(e){if(e.is("$textProxy"))return new na(e.textNode,e.offsetInText);if(!e.parent)throw new l.b("view-position-before-root",e,{root:e});return new na(e.parent,e.index)}}class ia{constructor(e,t=null){this.start=e.clone(),this.end=t?t.clone():e.clone()}*[Symbol.iterator](){yield*new Qs({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return this.start.parent===this.end.parent}get root(){return this.start.root}getEnlarged(){let e=this.start.getLastMatchingPosition(oa,{direction:"backward"}),t=this.end.getLastMatchingPosition(oa);return e.parent.is("$text")&&e.isAtStart&&(e=na._createBefore(e.parent)),t.parent.is("$text")&&t.isAtEnd&&(t=na._createAfter(t.parent)),new ia(e,t)}getTrimmed(){let e=this.start.getLastMatchingPosition(oa);if(e.isAfter(this.end)||e.isEqual(this.end))return new ia(e,e);let t=this.end.getLastMatchingPosition(oa,{direction:"backward"});const n=e.nodeAfter,i=t.nodeBefore;return n&&n.is("$text")&&(e=new na(n,0)),i&&i.is("$text")&&(t=new na(i,i.data.length)),new ia(e,t)}isEqual(e){return this==e||this.start.isEqual(e.start)&&this.end.isEqual(e.end)}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,t=!1){e.isCollapsed&&(t=!1);const n=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),i=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&i}getDifference(e){const t=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&t.push(new ia(this.start,e.start)),this.containsPosition(e.end)&&t.push(new ia(e.end,this.end))):t.push(this.clone()),t}getIntersection(e){if(this.isIntersecting(e)){let t=this.start,n=this.end;return this.containsPosition(e.start)&&(t=e.start),this.containsPosition(e.end)&&(n=e.end),new ia(t,n)}return null}getWalker(e={}){return e.boundaries=this,new Qs(e)}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;let e=this.start.nodeAfter,t=this.end.nodeBefore;return this.start.parent.is("$text")&&this.start.isAtEnd&&this.start.parent.nextSibling&&(e=this.start.parent.nextSibling),this.end.parent.is("$text")&&this.end.isAtStart&&this.end.parent.previousSibling&&(t=this.end.parent.previousSibling),e&&e.is("element")&&e===t?e:null}clone(){return new ia(this.start,this.end)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new Qs(e);for(const e of t)yield e.item}*getPositions(e={}){e.boundaries=this;const t=new Qs(e);yield t.position;for(const e of t)yield e.nextPosition}is(e){return"range"===e||"view:range"===e}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}static _createFromParentsAndOffsets(e,t,n,i){return new this(new na(e,t),new na(n,i))}static _createFromPositionAndShift(e,t){const n=e,i=e.getShiftedBy(t);return t>0?new this(n,i):new this(i,n)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(na._createBefore(e),t)}}function oa(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}function ra(e){let t=0;for(const n of e)t++;return t}class sa{constructor(e=null,t,n){this._selection=new aa,this._selection.delegate("change").to(this),this._selection.setTo(e,t,n)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}is(e){return"selection"===e||"documentSelection"==e||"view:selection"==e||"view:documentSelection"==e}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setFocus(e,t){this._selection.setFocus(e,t)}}Ye(sa,u);class aa{constructor(e=null,t,n){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(e,t,n)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel)return!1;if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const i of e._ranges)if(t.isEqual(i)){n=!0;break}if(!n)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=ra(this.getRanges());if(t!=ra(e.getRanges()))return!1;if(0==t)return!0;for(let t of this.getRanges()){t=t.getTrimmed();let n=!1;for(let i of e.getRanges())if(i=i.getTrimmed(),t.start.isEqual(i.start)&&t.end.isEqual(i.end)){n=!0;break}if(!n)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(e,t,n){if(null===e)this._setRanges([]),this._setFakeOptions(t);else if(e instanceof aa||e instanceof sa)this._setRanges(e.getRanges(),e.isBackward),this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel});else if(e instanceof ia)this._setRanges([e],t&&t.backward),this._setFakeOptions(t);else if(e instanceof na)this._setRanges([new ia(e)]),this._setFakeOptions(t);else if(e instanceof ls){const i=!!n&&!!n.backward;let o;if(void 0===t)throw new l.b("view-selection-setto-required-second-parameter",this);o="in"==t?ia._createIn(e):"on"==t?ia._createOn(e):new ia(na._createAt(e,t)),this._setRanges([o],i),this._setFakeOptions(n)}else{if(!Ge(e))throw new l.b("view-selection-setto-not-selectable",this);this._setRanges(e,t&&t.backward),this._setFakeOptions(t)}this.fire("change")}setFocus(e,t){if(null===this.anchor)throw new l.b("view-selection-setfocus-no-ranges",this);const n=na._createAt(e,t);if("same"==n.compareWith(this.focus))return;const i=this.anchor;this._ranges.pop(),"before"==n.compareWith(i)?this._addRange(new ia(n,i),!0):this._addRange(new ia(i,n)),this.fire("change")}is(e){return"selection"===e||"view:selection"===e}_setRanges(e,t=!1){e=Array.from(e),this._ranges=[];for(const t of e)this._addRange(t);this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,t=!1){if(!(e instanceof ia))throw new l.b("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new l.b("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new ia(e.start,e.end))}}Ye(aa,u);class la{constructor(e,t){this.document=e,this._children=[],t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(e){return"documentFragment"===e||"view:documentFragment"===e}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this);let n=0;const i=function(e,t){if("string"==typeof t)return[new cs(e,t)];Ge(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new cs(e,t):t instanceof ds?new cs(e,t.data):t)}(this.document,t);for(const t of i)null!==t.parent&&t._remove(),t.parent=this,this._children.splice(e,0,t),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n<e+t;n++)this._children[n].parent=null;return this._children.splice(e,t)}_fireChange(e,t){this.fire("change:"+e,t)}}Ye(la,u);const ca=e=>e.createTextNode(" "),da=e=>{const t=e.createElement("br");return t.dataset.ckeFiller=!0,t},ua=(()=>{let e="";for(let t=0;t<7;t++)e+="​";return e})();function ha(e){return Yi(e)&&e.data.substr(0,7)===ua}function ma(e){return 7==e.data.length&&ha(e)}function ga(e){return ha(e)?e.data.slice(7):e.data}function pa(e,t){if(t.keyCode==Ni.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(1==e.rangeCount&&e.getRangeAt(0).collapsed){const t=e.getRangeAt(0).startContainer,n=e.getRangeAt(0).startOffset;ha(t)&&n<=7&&e.collapse(t,0)}}}function fa(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function wa(e){const t=[];for(;e&&e.nodeType!=Node.DOCUMENT_NODE;)t.unshift(e),e=e.parentNode;return t}const ba=da(document);class _a{constructor(e,t={}){this.document=e,this.blockFillerMode=t.blockFillerMode||"br",this.preElements=["pre"],this.blockElements=["p","div","h1","h2","h3","h4","h5","h6","li","dd","dt","figcaption","td","th"],this._blockFiller="br"==this.blockFillerMode?da:ca,this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new aa(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const t of e.childNodes)this.unbindDomElement(t)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}viewToDom(e,t,n={}){if(e.is("$text")){const n=this._processDataFromViewText(e);return t.createTextNode(n)}{if(this.mapViewToDom(e))return this.mapViewToDom(e);let i;if(e.is("documentFragment"))i=t.createDocumentFragment(),n.bind&&this.bindDocumentFragments(i,e);else{if(e.is("uiElement"))return i=e.render(t),n.bind&&this.bindElements(i,e),i;i=e.hasAttribute("xmlns")?t.createElementNS(e.getAttribute("xmlns"),e.name):t.createElement(e.name),e.is("rawElement")&&e.render(i),n.bind&&this.bindElements(i,e);for(const t of e.getAttributeKeys())i.setAttribute(t,e.getAttribute(t))}if(n.withChildren||void 0===n.withChildren)for(const o of this.viewChildrenToDom(e,t,n))i.appendChild(o);return i}}*viewChildrenToDom(e,t,n={}){const i=e.getFillerOffset&&e.getFillerOffset();let o=0;for(const r of e.getChildren())i===o&&(yield this._blockFiller(t)),yield this.viewToDom(r,t,n),o++;i===o&&(yield this._blockFiller(t))}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),n=this.viewPositionToDom(e.end),i=document.createRange();return i.setStart(t.parent,t.offset),i.setEnd(n.parent,n.offset),i}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const n=this.findCorrespondingDomText(t);if(!n)return null;let i=e.offset;return ha(n)&&(i+=7),{parent:n,offset:i}}{let n,i,o;if(0===e.offset){if(n=this.mapViewToDom(t),!n)return null;o=n.childNodes[0]}else{const t=e.nodeBefore;if(i=t.is("$text")?this.findCorrespondingDomText(t):this.mapViewToDom(e.nodeBefore),!i)return null;n=i.parentNode,o=i.nextSibling}if(Yi(o)&&ha(o))return{parent:o,offset:7};return{parent:n,offset:i?fa(i)+1:0}}}domToView(e,t={}){if(this.isBlockFiller(e,this.blockFillerMode))return null;const n=this.getHostViewElement(e,this._domToViewMapping);if(n)return n;if(Yi(e)){if(ma(e))return null;{const t=this._processDataFromDomText(e);return""===t?null:new cs(this.document,t)}}if(this.isComment(e))return null;{if(this.mapDomToView(e))return this.mapDomToView(e);let n;if(this.isDocumentFragment(e))n=new la(this.document),t.bind&&this.bindDocumentFragments(e,n);else{const i=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();n=new Xs(this.document,i),t.bind&&this.bindElements(e,n);const o=e.attributes;for(let e=o.length-1;e>=0;e--)n._setAttribute(o[e].name,o[e].value)}if(t.withChildren||void 0===t.withChildren)for(const i of this.domChildrenToView(e,t))n._appendChild(i);return n}}*domChildrenToView(e,t={}){for(let n=0;n<e.childNodes.length;n++){const i=e.childNodes[n],o=this.domToView(i,t);null!==o&&(yield o)}}domSelectionToView(e){if(1===e.rangeCount){let t=e.getRangeAt(0).startContainer;Yi(t)&&(t=t.parentNode);const n=this.fakeSelectionToView(t);if(n)return n}const t=this.isDomSelectionBackward(e),n=[];for(let t=0;t<e.rangeCount;t++){const i=e.getRangeAt(t),o=this.domRangeToView(i);o&&n.push(o)}return new aa(n,{backward:t})}domRangeToView(e){const t=this.domPositionToView(e.startContainer,e.startOffset),n=this.domPositionToView(e.endContainer,e.endOffset);return t&&n?new ia(t,n):null}domPositionToView(e,t){if(this.isBlockFiller(e,this.blockFillerMode))return this.domPositionToView(e.parentNode,fa(e));const n=this.mapDomToView(e);if(n&&(n.is("uiElement")||n.is("rawElement")))return na._createBefore(n);if(Yi(e)){if(ma(e))return this.domPositionToView(e.parentNode,fa(e));const n=this.findCorrespondingViewText(e);let i=t;return n?(ha(e)&&(i-=7,i=i<0?0:i),new na(n,i)):null}if(0===t){const t=this.mapDomToView(e);if(t)return new na(t,0)}else{const n=e.childNodes[t-1],i=Yi(n)?this.findCorrespondingViewText(n):this.mapDomToView(n);if(i&&i.parent)return new na(i.parent,i.index+1)}return null}mapDomToView(e){return this.getHostViewElement(e)||this._domToViewMapping.get(e)}findCorrespondingViewText(e){if(ma(e))return null;const t=this.getHostViewElement(e);if(t)return t;const n=e.previousSibling;if(n){if(!this.isElement(n))return null;const e=this.mapDomToView(n);if(e){return e.nextSibling instanceof cs?e.nextSibling:null}}else{const t=this.mapDomToView(e.parentNode);if(t){const e=t.getChild(0);return e instanceof cs?e:null}}return null}mapViewToDom(e){return this._viewToDomMapping.get(e)}findCorrespondingDomText(e){const t=e.previousSibling;return t&&this.mapViewToDom(t)?this.mapViewToDom(t).nextSibling:!t&&e.parent&&this.mapViewToDom(e.parent)?this.mapViewToDom(e.parent).childNodes[0]:null}focus(e){const t=this.mapViewToDom(e);if(t&&t.ownerDocument.activeElement!==t){const{scrollX:e,scrollY:n}=Wi.window,i=[];va(t,e=>{const{scrollLeft:t,scrollTop:n}=e;i.push([t,n])}),t.focus(),va(t,e=>{const[t,n]=i.shift();e.scrollLeft=t,e.scrollTop=n}),Wi.window.scrollTo(e,n)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(e){return e&&e.nodeType==Node.COMMENT_NODE}isBlockFiller(e){return"br"==this.blockFillerMode?e.isEqualNode(ba):!("BR"!==e.tagName||!ya(e,this.blockElements)||1!==e.parentNode.childNodes.length)||function(e,t){return Yi(e)&&" "==e.data&&ya(e,t)&&1===e.parentNode.childNodes.length}(e,this.blockElements)}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset);const n=t.collapsed;return t.detach(),n}getHostViewElement(e){const t=wa(e);for(t.pop();t.length;){const e=t.pop(),n=this._domToViewMapping.get(e);if(n&&(n.is("uiElement")||n.is("rawElement")))return n}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}_isDomSelectionPositionCorrect(e,t){if(Yi(e)&&ha(e)&&t<7)return!1;if(this.isElement(e)&&ha(e.childNodes[t]))return!1;const n=this.mapDomToView(e);return!n||!n.is("uiElement")&&!n.is("rawElement")}_processDataFromViewText(e){let t=e.data;if(e.getAncestors().some(e=>this.preElements.includes(e.name)))return t;if(" "==t.charAt(0)){const n=this._getTouchingViewTextNode(e,!1);!(n&&this._nodeEndsWithSpace(n))&&n||(t=" "+t.substr(1))}if(" "==t.charAt(t.length-1)){const n=this._getTouchingViewTextNode(e,!0);" "!=t.charAt(t.length-2)&&n&&" "!=n.data.charAt(0)||(t=t.substr(0,t.length-1)+" ")}return t.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(e){if(e.getAncestors().some(e=>this.preElements.includes(e.name)))return!1;const t=this._processDataFromViewText(e);return" "==t.charAt(t.length-1)}_processDataFromDomText(e){let t=e.data;if(ka(e,this.preElements))return ga(e);t=t.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(e,!1),i=this._getTouchingInlineDomNode(e,!0),o=this._checkShouldLeftTrimDomText(n),r=this._checkShouldRightTrimDomText(e,i);return o&&(t=t.replace(/^ /,"")),r&&(t=t.replace(/ $/,"")),t=ga(new Text(t)),t=t.replace(/ \u00A0/g,"  "),(/( |\u00A0)\u00A0$/.test(t)||!i||i.data&&" "==i.data.charAt(0))&&(t=t.replace(/\u00A0$/," ")),o&&(t=t.replace(/^\u00A0/," ")),t}_checkShouldLeftTrimDomText(e){return!e||(!!eo(e)||/[^\S\u00A0]/.test(e.data.charAt(e.data.length-1)))}_checkShouldRightTrimDomText(e,t){return!t&&!ha(e)}_getTouchingViewTextNode(e,t){const n=new Qs({startPosition:t?na._createAfter(e):na._createBefore(e),direction:t?"forward":"backward"});for(const e of n){if(e.item.is("containerElement"))return null;if(e.item.is("element","br"))return null;if(e.item.is("$textProxy"))return e.item}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode)return null;const n=t?"nextNode":"previousNode",i=e.ownerDocument,o=wa(e)[0],r=i.createTreeWalker(o,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode:e=>Yi(e)||"BR"==e.tagName?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});r.currentNode=e;const s=r[n]();if(null!==s){const t=function(e,t){const n=wa(e),i=wa(t);let o=0;for(;n[o]==i[o]&&n[o];)o++;return 0===o?null:n[o-1]}(e,s);if(t&&!ka(e,this.blockElements,t)&&!ka(s,this.blockElements,t))return s}return null}}function ka(e,t,n){let i=wa(e);return n&&(i=i.slice(i.indexOf(n)+1)),i.some(e=>e.tagName&&t.includes(e.tagName.toLowerCase()))}function va(e,t){for(;e&&e!=Wi.document;)t(e),e=e.parentNode}function ya(e,t){const n=e.parentNode;return n&&n.tagName&&t.includes(n.tagName.toLowerCase())}function xa(e){if(e.newChildren.length-e.oldChildren.length!=1)return;const t=function(e,t){const n=[];let i,o=0;return e.forEach(e=>{"equal"==e?(r(),o++):"insert"==e?(s("insert")?i.values.push(t[o]):(r(),i={type:"insert",index:o,values:[t[o]]}),o++):s("delete")?i.howMany++:(r(),i={type:"delete",index:o,howMany:1})}),r(),n;function r(){i&&(n.push(i),i=null)}function s(e){return i&&i.type==e}}(ss(e.oldChildren,e.newChildren,Aa),e.newChildren);if(t.length>1)return;const n=t[0];return n.values[0]&&n.values[0].is("$text")?n:void 0}function Aa(e,t){return e&&e.is("$text")&&t&&t.is("$text")?e.data===t.data:e===t}class Ca{constructor(e){this.editor=e,this.editing=this.editor.editing}handle(e,t){if(function(e){if(0==e.length)return!1;for(const t of e)if("children"===t.type&&!xa(t))return!0;return!1}(e))this._handleContainerChildrenMutations(e,t);else for(const n of e)this._handleTextMutation(n,t),this._handleTextNodeInsertion(n)}_handleContainerChildrenMutations(e,t){const n=function(e){const t=e.map(e=>e.node).reduce((e,t)=>e.getCommonAncestor(t,{includeSelf:!0}));if(!t)return;return t.getAncestors({includeSelf:!0,parentFirst:!0}).find(e=>e.is("containerElement")||e.is("rootElement"))}(e);if(!n)return;const i=this.editor.editing.view.domConverter.mapViewToDom(n),o=new _a(this.editor.editing.view.document),r=this.editor.data.toModel(o.domToView(i)).getChild(0),s=this.editor.editing.mapper.toModelElement(n);if(!s)return;const a=Array.from(r.getChildren()),l=Array.from(s.getChildren()),c=a[a.length-1],d=l[l.length-1],u=c&&c.is("element","softBreak"),h=d&&!d.is("element","softBreak");u&&h&&a.pop();const m=this.editor.model.schema;if(!Ta(a,m)||!Ta(l,m))return;const g=a.map(e=>e.is("$text")?e.data:"@").join("").replace(/\u00A0/g," "),p=l.map(e=>e.is("$text")?e.data:"@").join("").replace(/\u00A0/g," ");if(p===g)return;const f=ss(p,g),{firstChangeAt:w,insertions:b,deletions:_}=Ea(f);let k=null;t&&(k=this.editing.mapper.toModelRange(t.getFirstRange()));const v=g.substr(w,b),y=this.editor.model.createRange(this.editor.model.createPositionAt(s,w),this.editor.model.createPositionAt(s,w+_));this.editor.execute("input",{text:v,range:y,resultRange:k})}_handleTextMutation(e,t){if("text"!=e.type)return;const n=e.newText.replace(/\u00A0/g," "),i=e.oldText.replace(/\u00A0/g," ");if(i===n)return;const o=ss(i,n),{firstChangeAt:r,insertions:s,deletions:a}=Ea(o);let l=null;t&&(l=this.editing.mapper.toModelRange(t.getFirstRange()));const c=this.editing.view.createPositionAt(e.node,r),d=this.editing.mapper.toModelPosition(c),u=this.editor.model.createRange(d,d.getShiftedBy(a)),h=n.substr(r,s);this.editor.execute("input",{text:h,range:u,resultRange:l})}_handleTextNodeInsertion(e){if("children"!=e.type)return;const t=xa(e),n=this.editing.view.createPositionAt(e.node,t.index),i=this.editing.mapper.toModelPosition(n),o=t.values[0].data;this.editor.execute("input",{text:o.replace(/\u00A0/g," "),range:this.editor.model.createRange(i)})}}function Ta(e,t){return e.every(e=>t.isInline(e))}function Ea(e){let t=null,n=null;for(let i=0;i<e.length;i++){"equal"!=e[i]&&(t=null===t?i:t,n=i)}let i=0,o=0;for(let r=t;r<=n;r++)"insert"!=e[r]&&i++,"delete"!=e[r]&&o++;return{insertions:o,deletions:i,firstChangeAt:t}}class Ma extends Je{static get pluginName(){return"Input"}init(){const e=this.editor,t=new es(e,e.config.get("typing.undoStep")||20);e.commands.add("input",t),function(e){let t=null;const n=e.model,i=e.editing.view,o=e.commands.get("input");function r(e){const r=n.document,a=i.document.isComposing,l=t&&t.isEqual(r.selection);t=null,o.isEnabled&&(ns(e)||r.selection.isCollapsed||a&&229===e.keyCode||!a&&229===e.keyCode&&l||s())}function s(){const e=o.buffer;e.lock();const t=e.batch;o._batches.add(t),n.enqueueChange(t,()=>{n.deleteContent(n.document.selection)}),e.unlock()}Si.isAndroid?i.document.on("beforeinput",(e,t)=>r(t),{priority:"lowest"}):i.document.on("keydown",(e,t)=>r(t),{priority:"lowest"}),i.document.on("compositionstart",(function(){const e=n.document,t=1!==e.selection.rangeCount||e.selection.getFirstRange().isFlat;if(e.selection.isCollapsed||t)return;s()}),{priority:"lowest"}),i.document.on("compositionend",()=>{t=n.createSelection(n.document.selection)},{priority:"lowest"})}(e),function(e){e.editing.view.document.on("mutations",(t,n,i)=>{new Ca(e).handle(n,i)})}(e)}isInput(e){return this.editor.commands.get("input")._batches.has(e)}}class Pa{constructor(e){this.files=function(e){const t=e.files?Array.from(e.files):[],n=e.items?Array.from(e.items):[];if(t.length)return t;return n.filter(e=>"file"===e.kind).map(e=>e.getAsFile())}(e),this._native=e}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}}class Sa extends Wr{constructor(e){super(e);const t=this.document;function n(e,n){n.preventDefault();const i=n.dropRange?[n.dropRange]:Array.from(t.selection.getRanges()),r=new o(t,"clipboardInput");t.fire(r,{dataTransfer:n.dataTransfer,targetRanges:i}),r.stop.called&&n.stopPropagation()}this.domEventType=["paste","copy","cut","drop","dragover"],this.listenTo(t,"paste",n,{priority:"low"}),this.listenTo(t,"drop",n,{priority:"low"})}onDomEvent(e){const t={dataTransfer:new Pa(e.clipboardData?e.clipboardData:e.dataTransfer)};"drop"==e.type&&(t.dropRange=function(e,t){const n=t.target.ownerDocument,i=t.clientX,o=t.clientY;let r;n.caretRangeFromPoint&&n.caretRangeFromPoint(i,o)?r=n.caretRangeFromPoint(i,o):t.rangeParent&&(r=n.createRange(),r.setStart(t.rangeParent,t.rangeOffset),r.collapse(!0));return r?e.domConverter.domRangeToView(r):e.document.selection.getFirstRange()}(this.view,e)),this.fire(e.type,e,t)}}class Ia extends Je{static get pluginName(){return"PastePlainText"}init(){const e=this.editor.editing.view,t=e.document;let n=!1;e.addObserver(Sa),this.listenTo(t,"keydown",(e,t)=>{n=t.shiftKey}),this.listenTo(t,"clipboardInput",(e,t)=>{n&&(t.asPlainText=!0)},{priority:"high"})}}const Oa=["figcaption","li"];class Na{getHtml(e){const t=document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}class za{constructor(e){this._domParser=new DOMParser,this._domConverter=new _a(e,{blockFillerMode:"nbsp"}),this._htmlWriter=new Na}toData(e){const t=this._domConverter.viewToDom(e,document);return this._htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this._domConverter.domToView(t)}_toDom(e){const t=this._domParser.parseFromString(e,"text/html"),n=t.createDocumentFragment(),i=t.body.childNodes;for(;i.length>0;)n.appendChild(i[0]);return n}}class Ra extends Je{static get pluginName(){return"Clipboard"}static get requires(){return[Ia]}init(){const e=this.editor,t=e.model.document,n=e.editing.view,i=n.document;function r(n,o){const r=o.dataTransfer;o.preventDefault();const s=e.data.toView(e.model.getSelectedContent(t.selection));i.fire("clipboardOutput",{dataTransfer:r,content:s,method:n.name})}this._htmlDataProcessor=new za(i),n.addObserver(Sa),this.listenTo(i,"clipboardInput",t=>{e.isReadOnly&&t.stop()},{priority:"highest"}),this.listenTo(i,"clipboardInput",(e,t)=>{const i=t.dataTransfer;let r="";var s;i.getData("text/html")?r=function(e){return e.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(e,t)=>1==t.length?" ":t)}(i.getData("text/html")):i.getData("text/plain")&&(((s=(s=i.getData("text/plain")).replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br>").replace(/^\s/,"&nbsp;").replace(/\s$/,"&nbsp;").replace(/\s\s/g," &nbsp;")).includes("</p><p>")||s.includes("<br>"))&&(s=`<p>${s}</p>`),r=s),r=this._htmlDataProcessor.toView(r);const a=new o(this,"inputTransformation");this.fire(a,{content:r,dataTransfer:i,asPlainText:t.asPlainText}),a.stop.called&&e.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(n,i)=>{if(!i.content.isEmpty){const o=this.editor.data,r=this.editor.model,s=o.toModel(i.content,"$clipboardHolder");if(0==s.childCount)return;if(i.asPlainText||function(e){if(e.childCount>1)return!1;return 0==[...e.getChild(0).getAttributeKeys()].length}(s)){const n=new Map(Array.from(t.selection.getAttributes()).filter(t=>e.model.schema.getAttributeProperties(t[0]).isFormatting));r.change(e=>{const t=e.createRangeIn(s);for(const i of t.getItems())(i.is("$text")||i.is("$textProxy"))&&e.setAttributes(n,i)})}r.insertContent(s),n.stop()}},{priority:"low"}),this.listenTo(i,"copy",r,{priority:"low"}),this.listenTo(i,"cut",(t,n)=>{e.isReadOnly?n.preventDefault():r(t,n)},{priority:"low"}),this.listenTo(i,"clipboardOutput",(n,i)=>{i.content.isEmpty||(i.dataTransfer.setData("text/html",this._htmlDataProcessor.toData(i.content)),i.dataTransfer.setData("text/plain",function e(t){let n="";if(t.is("$text")||t.is("$textProxy"))n=t.data;else if(t.is("element","img")&&t.hasAttribute("alt"))n=t.getAttribute("alt");else if(t.is("element","br"))n="\n";else{let i=null;for(const o of t.getChildren()){const t=e(o);i&&(i.is("containerElement")||o.is("containerElement"))&&(Oa.includes(i.name)||Oa.includes(o.name)?n+="\n":n+="\n\n"),n+=t,i=o}}return n}(i.content))),"cut"==i.method&&e.model.deleteContent(t.selection)},{priority:"low"})}}class La{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach(e=>this._definitions.add(e)):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",(e,t,n)=>{if(!n.consumable.test(t.item,"attribute:linkHref"))return;const i=n.writer,o=i.document.selection;for(const e of this._definitions){const r=i.createAttributeElement("a",e.attributes,{priority:5});i.setCustomProperty("link",!0,r),e.callback(t.attributeNewValue)?t.item.is("selection")?i.wrap(o.getFirstRange(),r):i.wrap(n.mapper.toViewRange(t.range),r):i.unwrap(n.mapper.toViewRange(t.range),r)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:image",(e,t,n)=>{const i=n.mapper.toViewElement(t.item),o=Array.from(i.getChildren()).find(e=>"a"===e.name);for(const e of this._definitions){const i=Ro(e.attributes);if(e.callback(t.attributeNewValue))for(const[e,t]of i)"class"===e?n.writer.addClass(t,o):n.writer.setAttribute(e,t,o);else for(const[e,t]of i)"class"===e?n.writer.removeClass(t,o):n.writer.removeAttribute(e,o)}})}}}var ja=function(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:Is(e,t,n)},Da=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var Ba=function(e){return Da.test(e)};var Va=function(e){return e.split("")},Fa="[\\ud800-\\udfff]",Ha="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ua="\\ud83c[\\udffb-\\udfff]",Wa="[^\\ud800-\\udfff]",$a="(?:\\ud83c[\\udde6-\\uddff]){2}",qa="[\\ud800-\\udbff][\\udc00-\\udfff]",Ya="(?:"+Ha+"|"+Ua+")"+"?",Ja="[\\ufe0e\\ufe0f]?"+Ya+("(?:\\u200d(?:"+[Wa,$a,qa].join("|")+")[\\ufe0e\\ufe0f]?"+Ya+")*"),Ka="(?:"+[Wa+Ha+"?",Ha,$a,qa,Fa].join("|")+")",Xa=RegExp(Ua+"(?="+Ua+")|"+Ka+Ja,"g");var Ga=function(e){return e.match(Xa)||[]};var Qa=function(e){return Ba(e)?Ga(e):Va(e)};var Za=function(e){return function(t){t=Ts(t);var n=Ba(t)?Qa(t):void 0,i=n?n[0]:t.charAt(0),o=n?ja(n,1).join(""):t.slice(1);return i[e]()+o}}("toUpperCase");const el=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,tl=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;function nl(e,{writer:t}){const n=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,n),n}function il(e){return function(e){return e.replace(el,"").match(tl)}(e=String(e))?e:"#"}function ol(e,t){return!!e&&(e.is("element","image")&&t.checkAttribute("image","linkHref"))}class rl extends st{constructor(e){super(e),this.manualDecorators=new Qe,this.automaticDecorators=new La}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document,n=lt(t.selection.getSelectedBlocks());ol(n,e.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(n,"linkHref")):(this.value=t.selection.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"linkHref"));for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}execute(e,t={}){const n=this.editor.model,i=n.document.selection,o=[],r=[];for(const e in t)t[e]?o.push(e):r.push(e);n.change(t=>{if(i.isCollapsed){const s=i.getFirstPosition();if(i.hasAttribute("linkHref")){const a=Gr(s,"linkHref",i.getAttribute("linkHref"),n);t.setAttribute("linkHref",e,a),o.forEach(e=>{t.setAttribute(e,!0,a)}),r.forEach(e=>{t.removeAttribute(e,a)}),t.setSelection(t.createPositionAfter(a.end.nodeBefore))}else if(""!==e){const r=Ro(i.getAttributes());r.set("linkHref",e),o.forEach(e=>{r.set(e,!0)});const a=t.createText(e,r);n.insertContent(a,s),t.setSelection(t.createPositionAfter(a))}["linkHref",...o,...r].forEach(e=>{t.removeSelectionAttribute(e)})}else{const s=n.schema.getValidRanges(i.getRanges(),"linkHref"),a=[];for(const e of i.getSelectedBlocks())n.schema.checkAttribute(e,"linkHref")&&a.push(t.createRangeOn(e));const l=a.slice();for(const e of s)this._isRangeToUpdate(e,a)&&l.push(e);for(const n of l)t.setAttribute("linkHref",e,n),o.forEach(e=>{t.setAttribute(e,!0,n)}),r.forEach(e=>{t.removeAttribute(e,n)})}})}_getDecoratorStateFromModel(e){const t=this.editor.model,n=t.document,i=lt(n.selection.getSelectedBlocks());return ol(i,t.schema)?i.getAttribute(e):n.selection.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t)if(n.containsRange(e))return!1;return!0}}class sl extends st{refresh(){const e=this.editor.model,t=e.document,n=lt(t.selection.getSelectedBlocks());ol(n,e.schema)?this.isEnabled=e.schema.checkAttribute(n,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"linkHref")}execute(){const e=this.editor,t=this.editor.model,n=t.document.selection,i=e.commands.get("link");t.change(e=>{const o=n.isCollapsed?[Gr(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),t)]:n.getRanges();for(const t of o)if(e.removeAttribute("linkHref",t),i)for(const n of i.manualDecorators)e.removeAttribute(n.id,t)})}}class al{constructor({id:e,label:t,attributes:n,defaultValue:i}){this.id=e,this.set("value"),this.defaultValue=i,this.label=t,this.attributes=n}}Ye(al,Fe);n(37);const ll=/^(https?:)?\/\//;class cl extends Je{static get pluginName(){return"LinkEditing"}static get requires(){return[qr,Ma,Ra]}constructor(e){super(e),e.config.define("link",{addTargetToExternalLinks:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:nl}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,t)=>nl(il(e),t)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new rl(e)),e.commands.add("unlink",new sl(e));const t=function(e,t){const n={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach(e=>(e.label&&n[e.label]&&(e.label=n[e.label]),e)),t}(e.t,function(e){const t=[];if(e)for(const[n,i]of Object.entries(e)){const e=Object.assign({},i,{id:"link"+Za(n)});t.push(e)}return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(e=>"automatic"===e.mode)),this._enableManualDecorators(t.filter(e=>"manual"===e.mode));e.plugins.get(qr).registerAttribute("linkHref"),function(e,t,n,i){const o=e.editing.view,r=new Set;o.document.registerPostFixer(o=>{const s=e.model.document.selection;let a=!1;if(s.hasAttribute(t)){const l=Gr(s.getFirstPosition(),t,s.getAttribute(t),e.model),c=e.editing.mapper.toViewRange(l);for(const e of c.getItems())e.is("element",n)&&!e.hasClass(i)&&(o.addClass(i,e),r.add(e),a=!0)}return a}),e.conversion.for("editingDowncast").add(e=>{function t(){o.change(e=>{for(const t of r.values())e.removeClass(i,t),r.delete(t)})}e.on("insert",t,{priority:"highest"}),e.on("remove",t,{priority:"highest"}),e.on("attribute",t,{priority:"highest"}),e.on("selection",t,{priority:"highest"})})}(e,"linkHref","a","ck-link_selected"),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(e){const t=this.editor,n=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:"automatic",callback:e=>ll.test(e),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(e),n.length&&t.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,n=t.commands.get("link").manualDecorators;e.forEach(e=>{t.model.schema.extend("$text",{allowAttributes:e.id}),n.add(new al(e)),t.conversion.for("downcast").attributeToElement({model:e.id,view:(t,{writer:i})=>{if(t){const t=n.get(e.id).attributes,o=i.createAttributeElement("a",t,{priority:5});return i.setCustomProperty("link",!0,o),o}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:n.get(e.id).attributes},model:{key:e.id}})})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor,t=e.model,n=t.document.selection,i=e.commands.get("link");this.listenTo(t,"insertContent",()=>{const e=n.anchor.nodeBefore,o=n.anchor.nodeAfter;n.hasAttribute("linkHref")&&e&&e.hasAttribute("linkHref")&&(o&&o.hasAttribute("linkHref")||t.change(e=>{dl(e,i.manualDecorators)}))},{priority:"low"})}_enableClickingAfterLink(){const e=this.editor,t=e.commands.get("link");e.editing.view.addObserver($r);let n=!1;this.listenTo(e.editing.view.document,"mousedown",()=>{n=!0}),this.listenTo(e.editing.view.document,"selectionChange",()=>{if(!n)return;n=!1;const i=e.model.document.selection;if(!i.isCollapsed)return;if(!i.hasAttribute("linkHref"))return;const o=i.getFirstPosition(),r=Gr(o,"linkHref",i.getAttribute("linkHref"),e.model);(o.isTouching(r.start)||o.isTouching(r.end))&&e.model.change(e=>{dl(e,t.manualDecorators)})})}_enableTypingOverLink(){const e=this.editor,t=e.editing.view;let n,i;this.listenTo(t.document,"delete",()=>{i=!0},{priority:"high"}),this.listenTo(e.model,"deleteContent",()=>{const t=e.model.document.selection;t.isCollapsed||(i?i=!1:ul(e)&&function(e){const t=e.document.selection,n=t.getFirstPosition(),i=t.getLastPosition(),o=n.nodeAfter;if(!o)return!1;if(!o.is("$text"))return!1;if(!o.hasAttribute("linkHref"))return!1;const r=i.textNode||i.nodeBefore;if(o===r)return!0;return Gr(n,"linkHref",o.getAttribute("linkHref"),e).containsRange(e.createRange(n,i),!0)}(e.model)&&(n=t.getAttributes()))},{priority:"high"}),this.listenTo(e.model,"insertContent",(t,[o])=>{i=!1,ul(e)&&n&&(e.model.change(e=>{for(const[t,i]of n)e.setAttribute(t,i,o)}),n=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor,t=e.model,n=t.document.selection,i=e.editing.view,o=e.commands.get("link");let r=!1,s=!1;this.listenTo(i.document,"delete",(e,t)=>{s=t.domEvent.keyCode===Ni.backspace},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{r=!1;const e=n.getFirstPosition(),i=n.getAttribute("linkHref");if(!i)return;const o=Gr(e,"linkHref",i,t);r=o.containsPosition(e)||o.end.isEqual(e)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{s&&(s=!1,r||e.model.enqueueChange(e=>{dl(e,o.manualDecorators)}))},{priority:"low"})}}function dl(e,t){e.removeSelectionAttribute("linkHref");for(const n of t)e.removeSelectionAttribute(n.id)}function ul(e){return e.plugins.get("Input").isInput(e.model.change(e=>e.batch))}class hl extends Xe{static get pluginName(){return"Notification"}init(){this.on("show:warning",(e,t)=>{window.alert(t.message)},{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){const t="show:"+e.type+(e.namespace?":"+e.namespace:"");this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class ml extends st{constructor(e){super(e),this.stopListening(this.editor.model.document,"change"),this.listenTo(this.editor.model.document,"change",()=>this.refresh(),{priority:"low"})}refresh(){const e=this.editor.commands.get("imageInsert"),t=this.editor.commands.get("link");this.isEnabled=e.isEnabled||t.isEnabled}execute(){const e=this.editor,t=this.editor.config.get("ckfinder.openerMethod")||"modal";if("popup"!=t&&"modal"!=t)throw new l.b("ckfinder-unknown-openermethod",e);const n=this.editor.config.get("ckfinder.options")||{};n.chooseFiles=!0;const i=n.onInit;n.language||(n.language=e.locale.uiLanguage),n.onInit=t=>{i&&i(t),t.on("files:choose",n=>{const i=n.data.files.toArray(),o=i.filter(e=>!e.isImage()),r=i.filter(e=>e.isImage());for(const t of o)e.execute("link",t.getUrl());const s=[];for(const e of r){const n=e.getUrl();s.push(n||t.request("file:getProxyUrl",{file:e}))}s.length&&gl(e,s)}),t.on("file:choose:resizedImage",t=>{const n=t.data.resizedUrl;if(n)gl(e,[n]);else{const t=e.plugins.get("Notification"),n=e.locale.t;t.showWarning(n("Could not obtain resized image URL."),{title:n("Selecting resized image failed"),namespace:"ckfinder"})}})},window.CKFinder[t](n)}}function gl(e,t){if(e.commands.get("imageInsert").isEnabled)e.execute("imageInsert",{source:t});else{const t=e.plugins.get("Notification"),n=e.locale.t;t.showWarning(n("Could not insert image at the current position."),{title:n("Inserting image failed"),namespace:"ckfinder"})}}class pl extends Je{static get pluginName(){return"CKFinderEditing"}static get requires(){return[hl,Fr,cl]}init(){const e=this.editor;e.commands.add("ckfinder",new ml(e))}}class fl{constructor(e,t){this._config={},t&&this.define(wl(t)),e&&this._setObjectToTarget(this._config,e)}set(e,t){this._setToTarget(this._config,e,t)}define(e,t){this._setToTarget(this._config,e,t,!0)}get(e){return this._getFromSource(this._config,e)}*names(){for(const e of Object.keys(this._config))yield e}_setToTarget(e,t,n,i=!1){if(Zi(t))return void this._setObjectToTarget(e,t,i);const o=t.split(".");t=o.pop();for(const t of o)Zi(e[t])||(e[t]={}),e=e[t];if(Zi(n))return Zi(e[t])||(e[t]={}),e=e[t],void this._setObjectToTarget(e,n,i);i&&void 0!==e[t]||(e[t]=n)}_getFromSource(e,t){const n=t.split(".");t=n.pop();for(const t of n){if(!Zi(e[t])){e=null;break}e=e[t]}return e?wl(e[t]):void 0}_setObjectToTarget(e,t,n){Object.keys(t).forEach(i=>{this._setToTarget(e,i,t[i],n)})}}function wl(e){return ni(e,bl)}function bl(e){return eo(e)?e:void 0}class _l{constructor(e,t=[],n=[]){this._context=e,this._plugins=new Map,this._availablePlugins=new Map;for(const e of t)e.pluginName&&this._availablePlugins.set(e.pluginName,e);this._contextPlugins=new Map;for(const[e,t]of n)this._contextPlugins.set(e,t),this._contextPlugins.set(t,e),e.pluginName&&this._availablePlugins.set(e.pluginName,e)}*[Symbol.iterator](){for(const e of this._plugins)"function"==typeof e[0]&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let t=e;throw"function"==typeof e&&(t=e.pluginName||e.name),new l.b("plugincollection-plugin-not-loaded",this._context,{plugin:t})}return t}has(e){return this._plugins.has(e)}init(e,t=[]){const n=this,i=this._context,o=new Set,r=[],s=m(e),a=m(t),c=function(e){const t=[];for(const n of e)h(n)||t.push(n);return t.length?t:null}(e);if(c){const e="plugincollection-plugin-not-found";return console.error(Object(l.a)(e),{plugins:c}),Promise.reject(new l.b(e,i,{plugins:c}))}return Promise.all(s.map(d)).then(()=>u(r,"init")).then(()=>u(r,"afterInit")).then(()=>r);function d(e){if(!a.includes(e)&&!n._plugins.has(e)&&!o.has(e))return function(e){return new Promise(s=>{o.add(e),e.requires&&e.requires.forEach(n=>{const o=h(n);if(e.isContextPlugin&&!o.isContextPlugin)throw new l.b("plugincollection-context-required",null,{plugin:o.name,requiredBy:e.name});if(t.includes(o))throw new l.b("plugincollection-required",i,{plugin:o.name,requiredBy:e.name});d(o)});const a=n._contextPlugins.get(e)||new e(i);n._add(e,a),r.push(a),s()})}(e).catch(t=>{throw console.error(Object(l.a)("plugincollection-load"),{plugin:e}),t})}function u(e,t){return e.reduce((e,i)=>i[t]?n._contextPlugins.has(i)?e:e.then(i[t].bind(i)):e,Promise.resolve())}function h(e){return"function"==typeof e?e:n._availablePlugins.get(e)}function m(e){return e.map(e=>h(e)).filter(e=>!!e)}}destroy(){const e=[];for(const[,t]of this)"function"!=typeof t.destroy||this._contextPlugins.has(t)||e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const n=e.pluginName;if(n){if(this._plugins.has(n))throw new l.b("plugincollection-plugin-name-conflict",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:e});this._plugins.set(n,t)}}}function kl(e,t,n=1){if("number"!=typeof n)throw new l.b("translation-service-quantity-not-a-number",null,{quantity:n});const i=Object.keys(window.CKEDITOR_TRANSLATIONS).length;1===i&&(e=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]);const o=t.id||t.string;if(0===i||!function(e,t){return!!window.CKEDITOR_TRANSLATIONS[e]&&!!window.CKEDITOR_TRANSLATIONS[e].dictionary[t]}(e,o))return 1!==n?t.plural:t.string;const r=window.CKEDITOR_TRANSLATIONS[e].dictionary,s=window.CKEDITOR_TRANSLATIONS[e].getPluralForm||(e=>1===e?0:1);if("string"==typeof r[o])return r[o];const a=Number(s(n));return r[o][a]}Ye(_l,u),window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const vl=["ar","fa","he","ku","ug"];class yl{constructor(e={}){this.uiLanguage=e.uiLanguage||"en",this.contentLanguage=e.contentLanguage||this.uiLanguage,this.uiLanguageDirection=xl(this.uiLanguage),this.contentLanguageDirection=xl(this.contentLanguage),this.t=(e,t)=>this._t(e,t)}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(e,t=[]){Array.isArray(t)||(t=[t]),"string"==typeof e&&(e={string:e});const n=!!e.plural?t[0]:1;return function(e,t){return e.replace(/%(\d+)/g,(e,n)=>n<t.length?t[n]:e)}(kl(this.uiLanguage,e,n),t)}}function xl(e){return vl.includes(e)?"rtl":"ltr"}class Al{constructor(e){this.config=new fl(e,this.constructor.defaultConfig);const t=this.constructor.builtinPlugins;this.config.define("plugins",t),this.plugins=new _l(this,t);const n=this.config.get("language")||{};this.locale=new yl({uiLanguage:"string"==typeof n?n:n.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new Qe,this._contextOwner=null}initPlugins(){const e=this.config.get("plugins")||[];for(const t of e){if("function"!=typeof t)throw new l.b("context-initplugins-constructor-only",null,{Plugin:t});if(!0!==t.isContextPlugin)throw new l.b("context-initplugins-invalid-plugin",null,{Plugin:t})}return this.plugins.init(e)}destroy(){return Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner)throw new l.b("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise(t=>{const n=new this(e);t(n.initPlugins().then(()=>n))})}}const Cl=Symbol("rootName");class Tl extends ta{constructor(e,t){super(e,t),this.rootName="main"}is(e,t=null){return t?t===this.name&&("rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}get rootName(){return this.getCustomProperty(Cl)}set rootName(e){this._setCustomProperty(Cl,e)}set _name(e){this.name=e}}class El{constructor(e){this.selection=new sa,this.roots=new Qe({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.map(e=>e.destroy()),this.stopListening()}_callPostFixers(e){let t=!1;do{for(const n of this._postFixers)if(t=n(e),t)break}while(t)}}Ye(El,Fe);class Ml extends Xs{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=Pl,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 l.b("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}is(e,t=null){return t?t===this.name&&("attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e):"attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}isSimilar(e){return null!==this.id||null!==e.id?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}_clone(e){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}}function Pl(){if(Sl(this))return null;let e=this.parent;for(;e&&e.is("attributeElement");){if(Sl(e)>1)return null;e=e.parent}return!e||Sl(e)>1?null:this.childCount}function Sl(e){return Array.from(e.getChildren()).filter(e=>!e.is("uiElement")).length}Ml.DEFAULT_PRIORITY=10;class Il extends Xs{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=Ol}is(e,t=null){return t?t===this.name&&("emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e):"emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}_insertChild(e,t){if(t&&(t instanceof ls||Array.from(t).length>0))throw new l.b("view-emptyelement-cannot-add",[this,t])}}function Ol(){return null}class Nl extends Xs{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=Rl}is(e,t=null){return t?t===this.name&&("uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e):"uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}_insertChild(e,t){if(t&&(t instanceof ls||Array.from(t).length>0))throw new l.b("view-uielement-cannot-add",this)}render(e){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const e of this.getAttributeKeys())t.setAttribute(e,this.getAttribute(e));return t}}function zl(e){e.document.on("keydown",(t,n)=>function(e,t,n){if(t.keyCode==Ni.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection(),i=1==e.rangeCount&&e.getRangeAt(0).collapsed;if(i||t.shiftKey){const t=e.focusNode,o=e.focusOffset,r=n.domPositionToView(t,o);if(null===r)return;let s=!1;const a=r.getLastMatchingPosition(e=>(e.item.is("uiElement")&&(s=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement"))));if(s){const t=n.viewPositionToDom(a);i?e.collapse(t.parent,t.offset):e.extend(t.parent,t.offset)}}}}(0,n,e.domConverter))}function Rl(){return null}class Ll extends Xs{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=jl}is(e,t=null){return t?t===this.name&&("rawElement"===e||"view:rawElement"===e||"element"===e||"view:element"===e):"rawElement"===e||"view:rawElement"===e||e===this.name||e==="view:"+this.name||"element"===e||"view:element"===e||"node"===e||"view:node"===e}_insertChild(e,t){if(t&&(t instanceof ls||Array.from(t).length>0))throw new l.b("view-rawelement-cannot-add",[this,t])}}function jl(){return null}class Dl{constructor(e){this.document=e,this._cloneGroups=new Map}setSelection(e,t,n){this.document.selection._setTo(e,t,n)}setSelectionFocus(e,t){this.document.selection._setFocus(e,t)}createText(e){return new cs(this.document,e)}createAttributeElement(e,t,n={}){const i=new Ml(this.document,e,t);return n.priority&&(i._priority=n.priority),n.id&&(i._id=n.id),i}createContainerElement(e,t){return new Zs(this.document,e,t)}createEditableElement(e,t){const n=new ta(this.document,e,t);return n._document=this.document,n}createEmptyElement(e,t){return new Il(this.document,e,t)}createUIElement(e,t,n){const i=new Nl(this.document,e,t);return n&&(i.render=n),i}createRawElement(e,t,n){const i=new Ll(this.document,e,t);return i.render=n||(()=>{}),i}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){Zi(e)&&void 0===n&&(n=t),n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){return e instanceof na?this._breakAttributes(e):this._breakAttributesRange(e)}breakContainer(e){const t=e.parent;if(!t.is("containerElement"))throw new l.b("view-writer-break-non-container-element",this.document);if(!t.parent)throw new l.b("view-writer-break-root",this.document);if(e.isAtStart)return na._createBefore(t);if(!e.isAtEnd){const n=t._clone(!1);this.insert(na._createAfter(t),n);const i=new ia(e,na._createAt(t,"end")),o=new na(n,0);this.move(i,o)}return na._createAfter(t)}mergeAttributes(e){const t=e.offset,n=e.parent;if(n.is("$text"))return e;if(n.is("attributeElement")&&0===n.childCount){const e=n.parent,t=n.index;return n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new na(e,t))}const i=n.getChild(t-1),o=n.getChild(t);if(!i||!o)return e;if(i.is("$text")&&o.is("$text"))return Ul(i,o);if(i.is("attributeElement")&&o.is("attributeElement")&&i.isSimilar(o)){const e=i.childCount;return i._appendChild(o.getChildren()),o._remove(),this._removeFromClonedElementsGroup(o),this.mergeAttributes(new na(i,e))}return e}mergeContainers(e){const t=e.nodeBefore,n=e.nodeAfter;if(!(t&&n&&t.is("containerElement")&&n.is("containerElement")))throw new l.b("view-writer-merge-containers-invalid-position",this.document);const i=t.getChild(t.childCount-1),o=i instanceof cs?na._createAt(i,"end"):na._createAt(t,"end");return this.move(ia._createIn(n),na._createAt(t,"end")),this.remove(ia._createOn(n)),o}insert(e,t){(function e(t,n){for(const i of t){if(!Wl.some(e=>i instanceof e))throw new l.b("view-writer-insert-invalid-node-type",n);i.is("$text")||e(i.getChildren(),n)}})(t=Ge(t)?[...t]:[t],this.document);const n=Bl(e);if(!n)throw new l.b("view-writer-invalid-position-container",this.document);const i=this._breakAttributes(e,!0),o=n._insertChild(i.offset,t);for(const e of t)this._addToClonedElementsGroup(e);const r=i.getShiftedBy(o),s=this.mergeAttributes(i);if(0===o)return new ia(s,s);{s.isEqual(i)||r.offset--;const e=this.mergeAttributes(r);return new ia(s,e)}}remove(e){const t=e instanceof ia?e:ia._createOn(e);if(ql(t,this.document),t.isCollapsed)return new la(this.document);const{start:n,end:i}=this._breakAttributesRange(t,!0),o=n.parent,r=i.offset-n.offset,s=o._removeChildren(n.offset,r);for(const e of s)this._removeFromClonedElementsGroup(e);const a=this.mergeAttributes(n);return t.start=a,t.end=a.clone(),new la(this.document,s)}clear(e,t){ql(e,this.document);const n=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const i of n){const n=i.item;let o;if(n.is("element")&&t.isSimilar(n))o=ia._createOn(n);else if(!i.nextPosition.isAfter(e.start)&&n.is("$textProxy")){const e=n.getAncestors().find(e=>e.is("element")&&t.isSimilar(e));e&&(o=ia._createIn(e))}o&&(o.end.isAfter(e.end)&&(o.end=e.end),o.start.isBefore(e.start)&&(o.start=e.start),this.remove(o))}}move(e,t){let n;if(t.isAfter(e.end)){const i=(t=this._breakAttributes(t,!0)).parent,o=i.childCount;e=this._breakAttributesRange(e,!0),n=this.remove(e),t.offset+=i.childCount-o}else n=this.remove(e);return this.insert(t,n)}wrap(e,t){if(!(t instanceof Ml))throw new l.b("view-writer-wrap-invalid-attribute",this.document);if(ql(e,this.document),e.isCollapsed){let i=e.start;i.parent.is("element")&&(n=i.parent,!Array.from(n.getChildren()).some(e=>!e.is("uiElement")))&&(i=i.getLastMatchingPosition(e=>e.item.is("uiElement"))),i=this._wrapPosition(i,t);const o=this.document.selection;return o.isCollapsed&&o.getFirstPosition().isEqual(e.start)&&this.setSelection(i),new ia(i)}return this._wrapRange(e,t);var n}unwrap(e,t){if(!(t instanceof Ml))throw new l.b("view-writer-unwrap-invalid-attribute",this.document);if(ql(e,this.document),e.isCollapsed)return e;const{start:n,end:i}=this._breakAttributesRange(e,!0),o=n.parent,r=this._unwrapChildren(o,n.offset,i.offset,t),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new ia(s,a)}rename(e,t){const n=new Zs(this.document,e,t.getAttributes());return this.insert(na._createAfter(t),n),this.move(ia._createIn(t),na._createAt(n,0)),this.remove(ia._createOn(t)),n}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return na._createAt(e,t)}createPositionAfter(e){return na._createAfter(e)}createPositionBefore(e){return na._createBefore(e)}createRange(e,t){return new ia(e,t)}createRangeOn(e){return ia._createOn(e)}createRangeIn(e){return ia._createIn(e)}createSelection(e,t,n){return new aa(e,t,n)}_wrapChildren(e,t,n,i){let o=t;const r=[];for(;o<n;){const t=e.getChild(o),n=t.is("$text"),s=t.is("attributeElement"),a=t.is("emptyElement"),l=t.is("uiElement"),c=t.is("rawElement");if(s&&this._wrapAttributeElement(i,t))r.push(new na(e,o));else if(n||a||l||c||s&&Vl(i,t)){const n=i._clone();t._remove(),n._appendChild(t),e._insertChild(o,n),this._addToClonedElementsGroup(n),r.push(new na(e,o))}else s&&this._wrapChildren(t,0,t.childCount,i);o++}let s=0;for(const e of r){if(e.offset-=s,e.offset==t)continue;this.mergeAttributes(e).isEqual(e)||(s++,n--)}return ia._createFromParentsAndOffsets(e,t,e,n)}_unwrapChildren(e,t,n,i){let o=t;const r=[];for(;o<n;){const t=e.getChild(o);if(t.is("attributeElement"))if(t.isSimilar(i)){const i=t.getChildren(),s=t.childCount;t._remove(),e._insertChild(o,i),this._removeFromClonedElementsGroup(t),r.push(new na(e,o),new na(e,o+s)),o+=s,n+=s-1}else this._unwrapAttributeElement(i,t)?(r.push(new na(e,o),new na(e,o+1)),o++):(this._unwrapChildren(t,0,t.childCount,i),o++);else o++}let s=0;for(const e of r){if(e.offset-=s,e.offset==t||e.offset==n)continue;this.mergeAttributes(e).isEqual(e)||(s++,n--)}return ia._createFromParentsAndOffsets(e,t,e,n)}_wrapRange(e,t){const{start:n,end:i}=this._breakAttributesRange(e,!0),o=n.parent,r=this._wrapChildren(o,n.offset,i.offset,t),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new ia(s,a)}_wrapPosition(e,t){if(t.isSimilar(e.parent))return Fl(e.clone());e.parent.is("$text")&&(e=Hl(e));const n=this.createAttributeElement();n._priority=Number.POSITIVE_INFINITY,n.isSimilar=()=>!1,e.parent._insertChild(e.offset,n);const i=new ia(e,e.getShiftedBy(1));this.wrap(i,t);const o=new na(n.parent,n.index);n._remove();const r=o.nodeBefore,s=o.nodeAfter;return r instanceof cs&&s instanceof cs?Ul(r,s):Fl(o)}_wrapAttributeElement(e,t){if(!Yl(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if("class"!==n&&"style"!==n&&t.hasAttribute(n)&&t.getAttribute(n)!==e.getAttribute(n))return!1;for(const n of e.getStyleNames())if(t.hasStyle(n)&&t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())"class"!==n&&"style"!==n&&(t.hasAttribute(n)||this.setAttribute(n,e.getAttribute(n),t));for(const n of e.getStyleNames())t.hasStyle(n)||this.setStyle(n,e.getStyle(n),t);for(const n of e.getClassNames())t.hasClass(n)||this.addClass(n,t);return!0}_unwrapAttributeElement(e,t){if(!Yl(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if("class"!==n&&"style"!==n&&(!t.hasAttribute(n)||t.getAttribute(n)!==e.getAttribute(n)))return!1;if(!t.hasClass(...e.getClassNames()))return!1;for(const n of e.getStyleNames())if(!t.hasStyle(n)||t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())"class"!==n&&"style"!==n&&this.removeAttribute(n,t);return this.removeClass(Array.from(e.getClassNames()),t),this.removeStyle(Array.from(e.getStyleNames()),t),!0}_breakAttributesRange(e,t=!1){const n=e.start,i=e.end;if(ql(e,this.document),e.isCollapsed){const n=this._breakAttributes(e.start,t);return new ia(n,n)}const o=this._breakAttributes(i,t),r=o.parent.childCount,s=this._breakAttributes(n,t);return o.offset+=o.parent.childCount-r,new ia(s,o)}_breakAttributes(e,t=!1){const n=e.offset,i=e.parent;if(e.parent.is("emptyElement"))throw new l.b("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new l.b("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new l.b("view-writer-cannot-break-raw-element",this.document);if(!t&&i.is("$text")&&$l(i.parent))return e.clone();if($l(i))return e.clone();if(i.is("$text"))return this._breakAttributes(Hl(e),t);if(n==i.childCount){const e=new na(i.parent,i.index+1);return this._breakAttributes(e,t)}if(0===n){const e=new na(i.parent,i.index);return this._breakAttributes(e,t)}{const e=i.index+1,o=i._clone();i.parent._insertChild(e,o),this._addToClonedElementsGroup(o);const r=i.childCount-n,s=i._removeChildren(n,r);o._appendChild(s);const a=new na(i.parent,e);return this._breakAttributes(a,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const t of e.getChildren())this._addToClonedElementsGroup(t);const t=e.id;if(!t)return;let n=this._cloneGroups.get(t);n||(n=new Set,this._cloneGroups.set(t,n)),n.add(e),e._clonesGroup=n}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const t of e.getChildren())this._removeFromClonedElementsGroup(t);const t=e.id;if(!t)return;const n=this._cloneGroups.get(t);n&&n.delete(e)}}function Bl(e){let t=e.parent;for(;!$l(t);){if(!t)return;t=t.parent}return t}function Vl(e,t){return e.priority<t.priority||!(e.priority>t.priority)&&e.getIdentity()<t.getIdentity()}function Fl(e){const t=e.nodeBefore;if(t&&t.is("$text"))return new na(t,t.data.length);const n=e.nodeAfter;return n&&n.is("$text")?new na(n,0):e}function Hl(e){if(e.offset==e.parent.data.length)return new na(e.parent.parent,e.parent.index+1);if(0===e.offset)return new na(e.parent.parent,e.parent.index);const t=e.parent.data.slice(e.offset);return e.parent._data=e.parent.data.slice(0,e.offset),e.parent.parent._insertChild(e.parent.index+1,new cs(e.root.document,t)),new na(e.parent.parent,e.parent.index+1)}function Ul(e,t){const n=e.data.length;return e._data+=t.data,t._remove(),new na(e,n)}const Wl=[cs,Ml,Zs,Il,Ll,Nl];function $l(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function ql(e,t){const n=Bl(e.start),i=Bl(e.end);if(!n||!i||n!==i)throw new l.b("view-writer-invalid-range-container",t)}function Yl(e,t){return null===e.id&&null===t.id}function Jl(e,t,n){e.insertBefore(n,e.childNodes[t]||null)}function Kl(e){const t=e.parentNode;t&&t.removeChild(e)}class Xl{constructor(e,t){this.domDocuments=new Set,this.domConverter=e,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=t,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(e,t){if("text"===e)this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if("attributes"===e)this.markedAttributes.add(t);else{if("children"!==e)throw new l.b("view-renderer-unknown-type",this);this.markedChildren.add(t)}}}render(){let e;for(const e of this.markedChildren)this._updateChildrenMappings(e);this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent));for(const e of this.markedAttributes)this._updateAttrs(e);for(const t of this.markedChildren)this._updateChildren(t,{inlineFillerPosition:e});for(const t of this.markedTexts)!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)&&this._updateText(t,{inlineFillerPosition:e});if(e){const t=this.domConverter.viewPositionToDom(e),n=t.parent.ownerDocument;ha(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=Gl(n,t.parent,t.offset)}else this._inlineFiller=null;this._updateSelection(),this._updateFocus(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=this.domConverter.mapViewToDom(e).childNodes,i=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:!1})),o=this._diffNodeLists(n,i),r=this._findReplaceActions(o,n,i);if(-1!==r.indexOf("replace")){const t={equal:0,insert:0,delete:0};for(const o of r)if("replace"===o){const o=t.equal+t.insert,r=t.equal+t.delete,s=e.getChild(o);!s||s.is("uiElement")||s.is("rawElement")||this._updateElementMappings(s,n[r]),Kl(i[o]),t.equal++}else t[o]++}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("$text")?na._createBefore(this.selection.getFirstPosition().parent):e}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&Yi(t.parent)&&ha(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!ha(e))throw new l.b("view-renderer-filler-was-lost",this);ma(e)?e.parentNode.removeChild(e):e.data=e.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=e.parent,n=e.offset;if(!this.domConverter.mapViewToDom(t.root))return!1;if(!t.is("element"))return!1;if(!function(e){if("false"==e.getAttribute("contenteditable"))return!1;const t=e.findAncestor(e=>e.hasAttribute("contenteditable"));return!t||"true"==t.getAttribute("contenteditable")}(t))return!1;if(n===t.getFillerOffset())return!1;const i=e.nodeBefore,o=e.nodeAfter;return!(i instanceof cs||o instanceof cs)}_updateText(e,t){const n=this.domConverter.findCorrespondingDomText(e),i=this.domConverter.viewToDom(e,n.ownerDocument),o=n.data;let r=i.data;const s=t.inlineFillerPosition;if(s&&s.parent==e.parent&&s.offset==e.index&&(r=ua+r),o!=r){const e=is(o,r);for(const t of e)"insert"===t.type?n.insertData(t.index,t.values.join("")):n.deleteData(t.index,t.howMany)}}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=Array.from(t.attributes).map(e=>e.name),i=e.getAttributeKeys();for(const n of i)t.setAttribute(n,e.getAttribute(n));for(const i of n)e.hasAttribute(i)||t.removeAttribute(i)}_updateChildren(e,t){const n=this.domConverter.mapViewToDom(e);if(!n)return;const i=t.inlineFillerPosition,o=this.domConverter.mapViewToDom(e).childNodes,r=Array.from(this.domConverter.viewChildrenToDom(e,n.ownerDocument,{bind:!0,inlineFillerPosition:i}));i&&i.parent===e&&Gl(n.ownerDocument,r,i.offset);const s=this._diffNodeLists(o,r);let a=0;const l=new Set;for(const e of s)"delete"===e?(l.add(o[a]),Kl(o[a])):"equal"===e&&a++;a=0;for(const e of s)"insert"===e?(Jl(n,a,r[a]),a++):"equal"===e&&(this._markDescendantTextToSync(this.domConverter.domToView(r[a])),a++);for(const e of l)e.parentNode||this.domConverter.unbindDomElement(e)}_diffNodeLists(e,t){return ss(e=function(e,t){const n=Array.from(e);if(0==n.length||!t)return n;n[n.length-1]==t&&n.pop();return n}(e,this._fakeSelectionContainer),t,Zl.bind(null,this.domConverter))}_findReplaceActions(e,t,n){if(-1===e.indexOf("insert")||-1===e.indexOf("delete"))return e;let i=[],o=[],r=[];const s={equal:0,insert:0,delete:0};for(const a of e)"insert"===a?r.push(n[s.equal+s.insert]):"delete"===a?o.push(t[s.equal+s.delete]):(i=i.concat(ss(o,r,Ql).map(e=>"equal"===e?"replace":e)),i.push("equal"),o=[],r=[]),s[a]++;return i.concat(ss(o,r,Ql).map(e=>"equal"===e?"replace":e))}_markDescendantTextToSync(e){if(e)if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e&&(this.selection.isFake?this._updateFakeSelection(e):(this._removeFakeSelection(),this._updateDomSelection(e)))}_updateFakeSelection(e){const t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(e){const t=e.createElement("div");return Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),t.textContent=" ",t}(t));const n=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(n,this.selection),!this._fakeSelectionNeedsUpdate(e))return;n.parentElement&&n.parentElement==e||e.appendChild(n),n.textContent=this.selection.fakeSelectionLabel||" ";const i=t.getSelection(),o=t.createRange();i.removeAllRanges(),o.selectNodeContents(n),i.addRange(o)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),i=this.domConverter.viewPositionToDom(this.selection.focus);e.focus(),t.collapse(n.parent,n.offset),t.extend(i.parent,i.offset),Si.isGecko&&function(e,t){const n=e.parent;if(n.nodeType!=Node.ELEMENT_NODE||e.offset!=n.childNodes.length-1)return;const i=n.childNodes[e.offset];i&&"BR"==i.tagName&&t.addRange(t.getRangeAt(0))}(i,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return(!t||!this.selection.isEqual(t))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer,n=e.ownerDocument.getSelection();return!t||t.parentElement!==e||(n.anchorNode!==t&&!t.contains(n.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel)}_removeDomSelection(){for(const e of this.domDocuments){if(e.getSelection().rangeCount){const t=e.activeElement,n=this.domConverter.mapDomToView(t);t&&n&&e.getSelection().removeAllRanges()}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function Gl(e,t,n){const i=t instanceof Array?t:t.childNodes,o=i[n];if(Yi(o))return o.data=ua+o.data,o;{const o=e.createTextNode(ua);return Array.isArray(t)?i.splice(n,0,o):Jl(t,n,o),o}}function Ql(e,t){return pt(e)&&pt(t)&&!Yi(e)&&!Yi(t)&&e.nodeType!==Node.COMMENT_NODE&&t.nodeType!==Node.COMMENT_NODE&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function Zl(e,t,n){return t===n||(Yi(t)&&Yi(n)?t.data===n.data:!(!e.isBlockFiller(t)||!e.isBlockFiller(n)))}Ye(Xl,Fe);var ec=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var tc=function(e){return this.__data__.has(e)};function nc(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Jt;++t<n;)this.add(e[t])}nc.prototype.add=nc.prototype.push=ec,nc.prototype.has=tc;var ic=nc;var oc=function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1};var rc=function(e,t){return e.has(t)};var sc=function(e,t,n,i,o,r){var s=1&n,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=r.get(e);if(c&&r.get(t))return c==t;var d=-1,u=!0,h=2&n?new ic:void 0;for(r.set(e,t),r.set(t,e);++d<a;){var m=e[d],g=t[d];if(i)var p=s?i(g,m,d,t,e,r):i(m,g,d,e,t,r);if(void 0!==p){if(p)continue;u=!1;break}if(h){if(!oc(t,(function(e,t){if(!rc(h,t)&&(m===e||o(m,e,n,i,r)))return h.push(t)}))){u=!1;break}}else if(m!==g&&!o(m,g,n,i,r)){u=!1;break}}return r.delete(e),r.delete(t),u};var ac=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n};var lc=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},cc=k?k.prototype:void 0,dc=cc?cc.valueOf:void 0;var uc=function(e,t,n,i,o,r,s){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!r(new Rn(e),new Rn(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return J(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=ac;case"[object Set]":var l=1&i;if(a||(a=lc),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;i|=2,s.set(e,t);var d=sc(a(e),a(t),i,o,r,s);return s.delete(e),d;case"[object Symbol]":if(dc)return dc.call(e)==dc.call(t)}return!1},hc=Object.prototype.hasOwnProperty;var mc=function(e,t,n,i,o,r){var s=1&n,a=kn(e),l=a.length;if(l!=kn(t).length&&!s)return!1;for(var c=l;c--;){var d=a[c];if(!(s?d in t:hc.call(t,d)))return!1}var u=r.get(e);if(u&&r.get(t))return u==t;var h=!0;r.set(e,t),r.set(t,e);for(var m=s;++c<l;){var g=e[d=a[c]],p=t[d];if(i)var f=s?i(p,g,d,t,e,r):i(g,p,d,e,t,r);if(!(void 0===f?g===p||o(g,p,n,i,r):f)){h=!1;break}m||(m="constructor"==d)}if(h&&!m){var w=e.constructor,b=t.constructor;w==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof b&&b instanceof b||(h=!1)}return r.delete(e),r.delete(t),h},gc=Object.prototype.hasOwnProperty;var pc=function(e,t,n,i,o,r){var s=ke(e),a=ke(t),l=s?"[object Array]":On(e),c=a?"[object Array]":On(t),d="[object Object]"==(l="[object Arguments]"==l?"[object Object]":l),u="[object Object]"==(c="[object Arguments]"==c?"[object Object]":c),h=l==c;if(h&&Object(ve.a)(e)){if(!Object(ve.a)(t))return!1;s=!0,d=!1}if(h&&!d)return r||(r=new Gt),s||Ee(e)?sc(e,t,n,i,o,r):uc(e,t,l,n,i,o,r);if(!(1&n)){var m=d&&gc.call(e,"__wrapped__"),g=u&&gc.call(t,"__wrapped__");if(m||g){var p=m?e.value():e,f=g?t.value():t;return r||(r=new Gt),o(p,f,n,i,r)}}return!!h&&(r||(r=new Gt),mc(e,t,n,i,o,r))};var fc=function e(t,n,i,o,r){return t===n||(null==t||null==n||!ge(t)&&!ge(n)?t!=t&&n!=n:pc(t,n,i,o,e,r))};var wc=function(e,t,n){var i=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===i?fc(e,t,void 0,n):!!i};class bc extends dr{constructor(e){super(e),this._config={childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},this.domConverter=e.domConverter,this.renderer=e._renderer,this._domElements=[],this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(e){this._domElements.push(e),this.isEnabled&&this._mutationObserver.observe(e,this._config)}enable(){super.enable();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(e){if(0===e.length)return;const t=this.domConverter,n=new Map,i=new Set;for(const n of e)if("childList"===n.type){const e=t.mapDomToView(n.target);if(e&&(e.is("uiElement")||e.is("rawElement")))continue;e&&!this._isBogusBrMutation(n)&&i.add(e)}for(const o of e){const e=t.mapDomToView(o.target);if((!e||!e.is("uiElement")&&!e.is("rawElement"))&&"characterData"===o.type){const e=t.findCorrespondingViewText(o.target);e&&!i.has(e.parent)?n.set(e,{type:"text",oldText:e.data,newText:ga(o.target),node:e}):!e&&ha(o.target)&&i.add(t.mapDomToView(o.target.parentNode))}}const o=[];for(const e of n.values())this.renderer.markToSync("text",e.node),o.push(e);for(const e of i){const n=t.mapViewToDom(e),i=Array.from(e.getChildren()),r=Array.from(t.domChildrenToView(n,{withChildren:!1}));wc(i,r,a)||(this.renderer.markToSync("children",e),o.push({type:"children",oldChildren:i,newChildren:r,node:e}))}const r=e[0].target.ownerDocument.getSelection();let s=null;if(r&&r.anchorNode){const e=t.domPositionToView(r.anchorNode,r.anchorOffset),n=t.domPositionToView(r.focusNode,r.focusOffset);e&&n&&(s=new aa(e),s.setFocus(n))}function a(e,t){if(!Array.isArray(e))return e===t||!(!e.is("$text")||!t.is("$text"))&&e.data===t.data}o.length&&(this.document.fire("mutations",o,s),this.view.forceRender())}_isBogusBrMutation(e){let t=null;return null===e.nextSibling&&0===e.removedNodes.length&&1==e.addedNodes.length&&(t=this.domConverter.domToView(e.addedNodes[0],{withChildren:!1})),t&&t.is("element","br")}}class _c extends Wr{constructor(e){super(e),this.domEventType=["keydown","keyup"]}onDomEvent(e){this.fire(e.type,e,{keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey||e.metaKey,shiftKey:e.shiftKey,get keystroke(){return zi(this)}})}}var kc=function(){return _.a.Date.now()},vc=/^\s+|\s+$/g,yc=/^[-+]0x[0-9a-f]+$/i,xc=/^0b[01]+$/i,Ac=/^0o[0-7]+$/i,Cc=parseInt;var Tc=function(e){if("number"==typeof e)return e;if(ms(e))return NaN;if(b(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=b(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(vc,"");var n=xc.test(e);return n||Ac.test(e)?Cc(e.slice(2),n?2:8):yc.test(e)?NaN:+e},Ec=Math.max,Mc=Math.min;var Pc=function(e,t,n){var i,o,r,s,a,l,c=0,d=!1,u=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=i,r=o;return i=o=void 0,c=t,s=e.apply(r,n)}function g(e){return c=e,a=setTimeout(f,t),d?m(e):s}function p(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-c>=r}function f(){var e=kc();if(p(e))return w(e);a=setTimeout(f,function(e){var n=t-(e-l);return u?Mc(n,r-(e-c)):n}(e))}function w(e){return a=void 0,h&&i?m(e):(i=o=void 0,s)}function _(){var e=kc(),n=p(e);if(i=arguments,o=this,l=e,n){if(void 0===a)return g(l);if(u)return clearTimeout(a),a=setTimeout(f,t),m(l)}return void 0===a&&(a=setTimeout(f,t)),s}return t=Tc(t)||0,b(n)&&(d=!!n.leading,r=(u="maxWait"in n)?Ec(Tc(n.maxWait)||0,t):r,h="trailing"in n?!!n.trailing:h),_.cancel=function(){void 0!==a&&clearTimeout(a),c=0,i=l=o=a=void 0},_.flush=function(){return void 0===a?s:w(kc())},_};class Sc extends dr{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=Pc(e=>this.document.fire("selectionChangeDone",e),200)}observe(){const e=this.document;e.on("keydown",(t,n)=>{var i;e.selection.isFake&&((i=n.keyCode)==Ni.arrowright||i==Ni.arrowleft||i==Ni.arrowup||i==Ni.arrowdown)&&this.isEnabled&&(n.preventDefault(),this._handleSelectionMove(n.keyCode))},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,n=new aa(t.getRanges(),{backward:t.isBackward,fake:!1});e!=Ni.arrowleft&&e!=Ni.arrowup||n.setTo(n.getFirstPosition()),e!=Ni.arrowright&&e!=Ni.arrowdown||n.setTo(n.getLastPosition());const i={oldSelection:t,newSelection:n,domSelection:null};this.document.fire("selectionChange",i),this._fireSelectionChangeDoneDebounced(i)}}class Ic extends dr{constructor(e){super(e),this.mutationObserver=e.getObserver(bc),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Pc(e=>this.document.fire("selectionChangeDone",e),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(e){const t=e.ownerDocument;this._documents.has(t)||(this.listenTo(t,"selectionchange",()=>{this._handleSelectionChange(t)}),this._documents.add(t))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(e){if(!this.isEnabled)return;this.mutationObserver.flush();const t=e.defaultView.getSelection(),n=this.domConverter.domSelectionToView(t);if(0!=n.rangeCount){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(n)&&this.domConverter.isDomSelectionCorrect(t)||++this._loopbackCounter>60))if(this.selection.isSimilar(n))this.view.forceRender();else{const e={oldSelection:this.selection,newSelection:n,domSelection:t};this.document.fire("selectionChange",e),this._fireSelectionChangeDoneDebounced(e)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class Oc extends Wr{constructor(e){super(e),this.domEventType=["focus","blur"],this.useCapture=!0;const t=this.document;t.on("focus",()=>{t.isFocused=!0,this._renderTimeoutId=setTimeout(()=>e.forceRender(),50)}),t.on("blur",(n,i)=>{const o=t.selection.editableElement;null!==o&&o!==i.target||(t.isFocused=!1,e.forceRender())})}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class Nc extends Wr{constructor(e){super(e),this.domEventType=["compositionstart","compositionupdate","compositionend"];const t=this.document;t.on("compositionstart",()=>{t.isComposing=!0}),t.on("compositionend",()=>{t.isComposing=!1})}onDomEvent(e){this.fire(e.type,e)}}class zc extends Wr{constructor(e){super(e),this.domEventType=["beforeinput"]}onDomEvent(e){this.fire(e.type,e)}}function Rc({target:e,viewportOffset:t=0}){const n=Hc(e);let i=n,o=null;for(;i;){let r;r=Uc(i==n?e:o),jc(r,()=>Wc(e,i));const s=Wc(e,i);if(Lc(i,s,t),i.parent!=i){if(o=i.frameElement,i=i.parent,!o)return}else i=null}}function Lc(e,t,n){const i=t.clone().moveBy(0,n),o=t.clone().moveBy(0,-n),r=new no(e).excludeScrollbarsAndBorders();if(![o,i].every(e=>r.contains(e))){let{scrollX:s,scrollY:a}=e;Bc(o,r)?a-=r.top-t.top+n:Dc(i,r)&&(a+=t.bottom-r.bottom+n),Vc(t,r)?s-=r.left-t.left+n:Fc(t,r)&&(s+=t.right-r.right+n),e.scrollTo(s,a)}}function jc(e,t){const n=Hc(e);let i,o;for(;e!=n.document.body;)o=t(),i=new no(e).excludeScrollbarsAndBorders(),i.contains(o)||(Bc(o,i)?e.scrollTop-=i.top-o.top:Dc(o,i)&&(e.scrollTop+=o.bottom-i.bottom),Vc(o,i)?e.scrollLeft-=i.left-o.left:Fc(o,i)&&(e.scrollLeft+=o.right-i.right)),e=e.parentNode}function Dc(e,t){return e.bottom>t.bottom}function Bc(e,t){return e.top<t.top}function Vc(e,t){return e.left<t.left}function Fc(e,t){return e.right>t.right}function Hc(e){return $i(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function Uc(e){if($i(e)){let t=e.commonAncestorContainer;return Yi(t)&&(t=t.parentNode),t}return e.parentNode}function Wc(e,t){const n=Hc(e),i=new no(e);if(n===t)return i;{let e=n;for(;e!=t;){const t=e.frameElement,n=new no(t).excludeScrollbarsAndBorders();i.moveBy(n.left,n.top),e=e.parent}}return i}Object.assign({},{scrollViewportToShowTarget:Rc,scrollAncestorsToShowTarget:function(e){jc(Uc(e),()=>new no(e))}});class $c{constructor(e){this.document=new El(e),this.domConverter=new _a(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Xl(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new Dl(this.document),this.addObserver(bc),this.addObserver(Ic),this.addObserver(Oc),this.addObserver(_c),this.addObserver(Sc),this.addObserver(Nc),Si.isAndroid&&this.addObserver(zc),this.document.on("keydown",pa),zl(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(e,t="main"){const n=this.document.getRoot(t);n._name=e.tagName.toLowerCase();const i={};for(const{name:t,value:o}of Array.from(e.attributes))i[t]=o,"class"===t?this._writer.addClass(o.split(" "),n):this._writer.setAttribute(t,o,n);this._initialDomRootAttributes.set(e,i);const o=()=>{this._writer.setAttribute("contenteditable",!n.isReadOnly,n),n.isReadOnly?this._writer.addClass("ck-read-only",n):this._writer.removeClass("ck-read-only",n)};o(),this.domRoots.set(t,e),this.domConverter.bindElements(e,n),this._renderer.markToSync("children",n),this._renderer.markToSync("attributes",n),this._renderer.domDocuments.add(e.ownerDocument),n.on("change:children",(e,t)=>this._renderer.markToSync("children",t)),n.on("change:attributes",(e,t)=>this._renderer.markToSync("attributes",t)),n.on("change:text",(e,t)=>this._renderer.markToSync("text",t)),n.on("change:isReadOnly",()=>this.change(o)),n.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const n of this._observers.values())n.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:e})=>t.removeAttribute(e));const n=this._initialDomRootAttributes.get(t);for(const e in n)t.setAttribute(e,n[e]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(const[e,n]of this.domRoots)t.observe(n,e);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection(){const e=this.document.selection.getFirstRange();e&&Rc({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new l.b("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(e){l.b.rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(()=>{})}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return na._createAt(e,t)}createPositionAfter(e){return na._createAfter(e)}createPositionBefore(e){return na._createBefore(e)}createRange(e,t){return new ia(e,t)}createRangeOn(e){return ia._createOn(e)}createRangeIn(e){return ia._createIn(e)}createSelection(e,t,n){return new aa(e,t,n)}_disableRendering(e){this._renderingDisabled=e,0==e&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}Ye($c,Fe);class qc{constructor(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._viewToModelLengthCallbacks=new Map,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this.on("modelToViewPosition",(e,t)=>{if(t.viewPosition)return;const n=this._modelToViewMapping.get(t.modelPosition.parent);t.viewPosition=this.findPositionIn(n,t.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(e,t)=>{if(t.modelPosition)return;const n=this.findMappedViewAncestor(t.viewPosition),i=this._viewToModelMapping.get(n),o=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,n);t.modelPosition=Wo._createAt(i,o)},{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e){const t=this.toModelElement(e);if(this._viewToModelMapping.delete(e),this._elementToMarkerNames.has(e))for(const t of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(t);this._modelToViewMapping.get(t)==e&&this._modelToViewMapping.delete(t)}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)}bindElementToMarker(e,t){const n=this._markerNameToElements.get(t)||new Set;n.add(e);const i=this._elementToMarkerNames.get(e)||new Set;i.add(t),this._markerNameToElements.set(t,n),this._elementToMarkerNames.set(e,i)}unbindElementFromMarkerName(e,t){const n=this._markerNameToElements.get(t);n&&(n.delete(e),0==n.size&&this._markerNameToElements.delete(t));const i=this._elementToMarkerNames.get(e);i&&(i.delete(t),0==i.size&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new Jo(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new ia(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={isPhantom:!1}){const n={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const n=new Set;for(const e of t)if(e.is("attributeElement"))for(const t of e.getElementsWithSameId())n.add(t);else n.add(e);return n}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,n){if(n!=e){return this._toModelOffset(e.parent,e.index,n)+this._toModelOffset(e,t,e)}if(e.is("$text"))return t;let i=0;for(let n=0;n<t;n++)i+=this.getModelLength(e.getChild(n));return i}getModelLength(e){if(this._viewToModelLengthCallbacks.get(e.name)){return this._viewToModelLengthCallbacks.get(e.name)(e)}if(this._viewToModelMapping.has(e))return 1;if(e.is("$text"))return e.data.length;if(e.is("uiElement"))return 0;{let t=0;for(const n of e.getChildren())t+=this.getModelLength(n);return t}}findPositionIn(e,t){let n,i=0,o=0,r=0;if(e.is("$text"))return new na(e,t);for(;o<t;)n=e.getChild(r),i=this.getModelLength(n),o+=i,r++;return o==t?this._moveViewPositionToTextNode(new na(e,r)):this.findPositionIn(n,t-(o-i))}_moveViewPositionToTextNode(e){const t=e.nodeBefore,n=e.nodeAfter;return t instanceof cs?new na(t,t.data.length):n instanceof cs?new na(n,0):e}}Ye(qc,u);class Yc{constructor(){this._consumable=new Map,this._textProxyRegistry=new Map}add(e,t){t=Jc(t),e instanceof Bo&&(e=this._getSymbolForTextProxy(e)),this._consumable.has(e)||this._consumable.set(e,new Map),this._consumable.get(e).set(t,!0)}consume(e,t){return t=Jc(t),e instanceof Bo&&(e=this._getSymbolForTextProxy(e)),!!this.test(e,t)&&(this._consumable.get(e).set(t,!1),!0)}test(e,t){t=Jc(t),e instanceof Bo&&(e=this._getSymbolForTextProxy(e));const n=this._consumable.get(e);if(void 0===n)return null;const i=n.get(t);return void 0===i?null:i}revert(e,t){t=Jc(t),e instanceof Bo&&(e=this._getSymbolForTextProxy(e));const n=this.test(e,t);return!1===n?(this._consumable.get(e).set(t,!0),!0):!0!==n&&null}_getSymbolForTextProxy(e){let t=null;const n=this._textProxyRegistry.get(e.startOffset);if(n){const i=n.get(e.endOffset);i&&(t=i.get(e.parent))}return t||(t=this._addSymbolForTextProxy(e.startOffset,e.endOffset,e.parent)),t}_addSymbolForTextProxy(e,t,n){const i=Symbol("textProxySymbol");let o,r;return o=this._textProxyRegistry.get(e),o||(o=new Map,this._textProxyRegistry.set(e,o)),r=o.get(t),r||(r=new Map,o.set(t,r)),r.set(n,i),i}}function Jc(e){const t=e.split(":");return t.length>1?t[0]+":"+t[1]:t[0]}class Kc{constructor(e){this.conversionApi=Object.assign({dispatcher:this},e)}convertChanges(e,t,n){for(const t of e.getMarkersToRemove())this.convertMarkerRemove(t.name,t.range,n);for(const t of e.getChanges())"insert"==t.type?this.convertInsert(Jo._createFromPositionAndShift(t.position,t.length),n):"remove"==t.type?this.convertRemove(t.position,t.length,t.name,n):this.convertAttribute(t.range,t.attributeKey,t.attributeOldValue,t.attributeNewValue,n);for(const e of this.conversionApi.mapper.flushUnboundMarkerNames()){const i=t.get(e).getRange();this.convertMarkerRemove(e,i,n),this.convertMarkerAdd(e,i,n)}for(const t of e.getMarkersToAdd())this.convertMarkerAdd(t.name,t.range,n)}convertInsert(e,t){this.conversionApi.writer=t,this.conversionApi.consumable=this._createInsertConsumable(e);for(const t of e){const e=t.item,n={item:e,range:Jo._createFromPositionAndShift(t.previousPosition,t.length)};this._testAndFire("insert",n);for(const t of e.getAttributeKeys())n.attributeKey=t,n.attributeOldValue=null,n.attributeNewValue=e.getAttribute(t),this._testAndFire("attribute:"+t,n)}this._clearConversionApi()}convertRemove(e,t,n,i){this.conversionApi.writer=i,this.fire("remove:"+n,{position:e,length:t},this.conversionApi),this._clearConversionApi()}convertAttribute(e,t,n,i,o){this.conversionApi.writer=o,this.conversionApi.consumable=this._createConsumableForRange(e,"attribute:"+t);for(const o of e){const e={item:o.item,range:Jo._createFromPositionAndShift(o.previousPosition,o.length),attributeKey:t,attributeOldValue:n,attributeNewValue:i};this._testAndFire("attribute:"+t,e)}this._clearConversionApi()}convertSelection(e,t,n){const i=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this.conversionApi.writer=n,this.conversionApi.consumable=this._createSelectionConsumable(e,i),this.fire("selection",{selection:e},this.conversionApi),e.isCollapsed){for(const t of i){const n=t.getRange();if(!Xc(e.getFirstPosition(),t,this.conversionApi.mapper))continue;const i={item:e,markerName:t.name,markerRange:n};this.conversionApi.consumable.test(e,"addMarker:"+t.name)&&this.fire("addMarker:"+t.name,i,this.conversionApi)}for(const t of e.getAttributeKeys()){const n={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};this.conversionApi.consumable.test(e,"attribute:"+n.attributeKey)&&this.fire("attribute:"+n.attributeKey+":$text",n,this.conversionApi)}this._clearConversionApi()}}convertMarkerAdd(e,t,n){if(!t.root.document||"$graveyard"==t.root.rootName)return;this.conversionApi.writer=n;const i="addMarker:"+e,o=new Yc;if(o.add(t,i),this.conversionApi.consumable=o,this.fire(i,{markerName:e,markerRange:t},this.conversionApi),o.test(t,i)){this.conversionApi.consumable=this._createConsumableForRange(t,i);for(const n of t.getItems()){if(!this.conversionApi.consumable.test(n,i))continue;const o={item:n,range:Jo._createOn(n),markerName:e,markerRange:t};this.fire(i,o,this.conversionApi)}this._clearConversionApi()}}convertMarkerRemove(e,t,n){t.root.document&&"$graveyard"!=t.root.rootName&&(this.conversionApi.writer=n,this.fire("removeMarker:"+e,{markerName:e,markerRange:t},this.conversionApi),this._clearConversionApi())}_createInsertConsumable(e){const t=new Yc;for(const n of e){const e=n.item;t.add(e,"insert");for(const n of e.getAttributeKeys())t.add(e,"attribute:"+n)}return t}_createConsumableForRange(e,t){const n=new Yc;for(const i of e.getItems())n.add(i,t);return n}_createSelectionConsumable(e,t){const n=new Yc;n.add(e,"selection");for(const i of t)n.add(e,"addMarker:"+i.name);for(const t of e.getAttributeKeys())n.add(e,"attribute:"+t);return n}_testAndFire(e,t){if(!this.conversionApi.consumable.test(t.item,e))return;const n=t.item.name||"$text";this.fire(e+":"+n,t,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}}function Xc(e,t,n){const i=t.getRange(),o=Array.from(e.getAncestors());o.shift(),o.reverse();return!o.some(e=>{if(i.containsItem(e)){return!!n.toViewElement(e).getCustomProperty("addHighlight")}})}Ye(Kc,u);class Gc{constructor(e,t,n){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,e&&this.setTo(e,t,n)}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const i of e._ranges)if(t.isEqual(i)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new Jo(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new Jo(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new Jo(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(e,t,n){if(null===e)this._setRanges([]);else if(e instanceof Gc)this._setRanges(e.getRanges(),e.isBackward);else if(e&&"function"==typeof e.getRanges)this._setRanges(e.getRanges(),e.isBackward);else if(e instanceof Jo)this._setRanges([e],!!t&&!!t.backward);else if(e instanceof Wo)this._setRanges([new Jo(e)]);else if(e instanceof jo){const i=!!n&&!!n.backward;let o;if("in"==t)o=Jo._createIn(e);else if("on"==t)o=Jo._createOn(e);else{if(void 0===t)throw new l.b("model-selection-setto-required-second-parameter",[this,e]);o=new Jo(Wo._createAt(e,t))}this._setRanges([o],i)}else{if(!Ge(e))throw new l.b("model-selection-setto-not-selectable",[this,e]);this._setRanges(e,t&&!!t.backward)}}_setRanges(e,t=!1){const n=(e=Array.from(e)).some(t=>{if(!(t instanceof Jo))throw new l.b("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every(e=>!e.isEqual(t))});if(e.length!==this._ranges.length||n){this._removeAllRanges();for(const t of e)this._pushRange(t);this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0})}}setFocus(e,t){if(null===this.anchor)throw new l.b("model-selection-setfocus-no-ranges",[this,e]);const n=Wo._createAt(e,t);if("same"==n.compareWith(this.focus))return;const i=this.anchor;this._ranges.length&&this._popRange(),"before"==n.compareWith(i)?(this._pushRange(new Jo(n,i)),this._lastRangeBackward=!0):(this._pushRange(new Jo(i,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}is(e){return"selection"===e||"model:selection"===e}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const n=ed(t.start,e);n&&td(n,t)&&(yield n);for(const n of t.getWalker()){const i=n.item;"elementEnd"==n.type&&Zc(i,e,t)&&(yield i)}const i=ed(t.end,e);i&&!t.end.isTouching(Wo._createAt(i,0))&&td(i,t)&&(yield i)}}containsEntireContent(e=this.anchor.root){const t=Wo._createAt(e,0),n=Wo._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(new Jo(e.start,e.end))}_checkRange(e){for(let t=0;t<this._ranges.length;t++)if(e.isIntersecting(this._ranges[t]))throw new l.b("model-selection-range-intersects",[this,e],{addedRange:e,intersectingRange:this._ranges[t]})}_removeAllRanges(){for(;this._ranges.length>0;)this._popRange()}_popRange(){this._ranges.pop()}}function Qc(e,t){return!t.has(e)&&(t.add(e),e.root.document.model.schema.isBlock(e)&&e.parent)}function Zc(e,t,n){return Qc(e,t)&&td(e,n)}function ed(e,t){const n=e.parent.root.document.model.schema,i=e.parent.getAncestors({parentFirst:!0,includeSelf:!0});let o=!1;const r=i.find(e=>!o&&(o=n.isLimit(e),!o&&Qc(e,t)));return i.forEach(e=>t.add(e)),r}function td(e,t){const n=function(e){const t=e.root.document.model.schema;let n=e.parent;for(;n;){if(t.isBlock(n))return n;n=n.parent}}(e);if(!n)return!0;return!t.containsRange(Jo._createOn(n),!0)}Ye(Gc,u);class nd{constructor(e){this._selection=new id(e),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(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}is(e){return"selection"===e||"model:selection"==e||"documentSelection"==e||"model:documentSelection"==e}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return"selection:"+e}static _isStoreAttributeKey(e){return e.startsWith("selection:")}}Ye(nd,u);class id extends Gc{constructor(e){super(),this.markers=new Qe({idProperty:"name"}),this._model=e.model,this._document=e,this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this.listenTo(this._model,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&"marker"!=n.type&&"rename"!=n.type&&"noop"!=n.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 e of this.getRanges())if(!this._document._validateSelectionRange(e))throw new l.b("document-selection-wrong-position",this,{range:e})}),this.listenTo(this._model.markers,"update",()=>this._updateMarkers()),this.listenTo(this._document,"change",(e,t)=>{!function(e,t){const n=e.document.differ;for(const i of n.getChanges()){if("insert"!=i.type)continue;const n=i.position.parent;i.length===n.maxOffset&&e.enqueueChange(t,e=>{const t=Array.from(n.getAttributeKeys()).filter(e=>e.startsWith("selection:"));for(const i of t)e.removeAttribute(i,n)})}}(this._model,t)})}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;e<this._ranges.length;e++)this._ranges[e].detach();this.stopListening()}*getRanges(){this._ranges.length?yield*super.getRanges():yield this._document._getDefaultRange()}getFirstRange(){return super.getFirstRange()||this._document._getDefaultRange()}getLastRange(){return super.getLastRange()||this._document._getDefaultRange()}setTo(e,t,n){super.setTo(e,t,n),this._updateAttributes(!0),this._updateMarkers()}setFocus(e,t){super.setFocus(e,t),this._updateAttributes(!0),this._updateMarkers()}setAttribute(e,t){if(this._setAttribute(e,t)){const t=[e];this.fire("change:attribute",{attributeKeys:t,directChange:!0})}}removeAttribute(e){if(this._removeAttribute(e)){const t=[e];this.fire("change:attribute",{attributeKeys:t,directChange:!0})}}overrideGravity(){const e=s();return this._overriddenGravityRegister.add(e),1===this._overriddenGravityRegister.size&&this._updateAttributes(!0),e}restoreGravity(e){if(!this._overriddenGravityRegister.has(e))throw new l.b("document-selection-gravity-wrong-restore",this,{uid:e});this._overriddenGravityRegister.delete(e),this.isGravityOverridden||this._updateAttributes(!0)}_popRange(){this._ranges.pop().detach()}_pushRange(e){const t=this._prepareRange(e);t&&this._ranges.push(t)}_prepareRange(e){if(this._checkRange(e),e.root==this._document.graveyard)return;const t=Ko.fromRange(e);return t.on("change:range",(e,n,i)=>{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=i.deletionPosition;const e=this._ranges.indexOf(t);this._ranges.splice(e,1),t.detach()}}),t}_updateMarkers(){const e=[];let t=!1;for(const t of this._model.markers){const n=t.getRange();for(const i of this.getRanges())n.containsRange(i,!i.isCollapsed)&&e.push(t)}const n=Array.from(this.markers);for(const n of e)this.markers.has(n)||(this.markers.add(n),t=!0);for(const n of Array.from(this.markers))e.includes(n)||(this.markers.remove(n),t=!0);t&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateAttributes(e){const t=Ro(this._getSurroundingAttributes()),n=Ro(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[e,t]of this._attributePriority)"low"==t&&(this._attrs.delete(e),this._attributePriority.delete(e));this._setAttributesTo(t);const i=[];for(const[e,t]of this.getAttributes())n.has(e)&&n.get(e)===t||i.push(e);for(const[e]of n)this.hasAttribute(e)||i.push(e);i.length>0&&this.fire("change:attribute",{attributeKeys:i,directChange:!1})}_setAttribute(e,t,n=!0){const i=n?"normal":"low";if("low"==i&&"normal"==this._attributePriority.get(e))return!1;return super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,i),!0)}_removeAttribute(e,t=!0){const n=t?"normal":"low";return("low"!=n||"normal"!=this._attributePriority.get(e))&&(this._attributePriority.set(e,n),!!super.hasAttribute(e)&&(this._attrs.delete(e),!0))}_setAttributesTo(e){const t=new Set;for(const[t,n]of this.getAttributes())e.get(t)!==n&&this._removeAttribute(t,!1);for(const[n,i]of e){this._setAttribute(n,i,!1)&&t.add(n)}return t}*_getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())if(t.startsWith("selection:")){const n=t.substr("selection:".length);yield[n,e.getAttribute(t)]}}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;let n=null;if(this.isCollapsed){const i=e.textNode?e.textNode:e.nodeBefore,o=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(n=od(i)),n||(n=od(o)),!this.isGravityOverridden&&!n){let e=i;for(;e&&!t.isInline(e)&&!n;)e=e.previousSibling,n=od(e)}if(!n){let e=o;for(;e&&!t.isInline(e)&&!n;)e=e.nextSibling,n=od(e)}n||(n=this._getStoredAttributes())}else{const e=this.getFirstRange();for(const i of e){if(i.item.is("element")&&t.isObject(i.item))break;if("text"==i.type){n=i.item.getAttributes();break}}}return n}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function od(e){return e instanceof Bo||e instanceof Do?e.getAttributes():null}class rd{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}var sd=function(e){return ti(e,5)};class ad extends rd{elementToElement(e){return this.add(function(e){return(e=sd(e)).view=dd(e.view,"container"),t=>{var n;t.on("insert:"+e.model,(n=e.view,(e,t,i)=>{const o=n(t.item,i);if(!o)return;if(!i.consumable.consume(t.item,"insert"))return;const r=i.mapper.toViewPosition(t.range.start);i.mapper.bindElements(t.item,o),i.writer.insert(r,o)}),{priority:e.converterPriority||"normal"})}}(e))}attributeToElement(e){return this.add(function(e){e=sd(e);let t="attribute:"+(e.model.key?e.model.key:e.model);e.model.name&&(t+=":"+e.model.name);if(e.model.values)for(const t of e.model.values)e.view[t]=dd(e.view[t],"attribute");else e.view=dd(e.view,"attribute");const n=ud(e);return i=>{i.on(t,function(e){return(t,n,i)=>{const o=e(n.attributeOldValue,i),r=e(n.attributeNewValue,i);if(!o&&!r)return;if(!i.consumable.consume(n.item,t.name))return;const s=i.writer,a=s.document.selection;if(n.item instanceof Gc||n.item instanceof nd)s.wrap(a.getFirstRange(),r);else{let e=i.mapper.toViewRange(n.range);null!==n.attributeOldValue&&o&&(e=s.unwrap(e,o)),null!==n.attributeNewValue&&r&&s.wrap(e,r)}}}(n),{priority:e.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(e){e=sd(e);let t="attribute:"+(e.model.key?e.model.key:e.model);e.model.name&&(t+=":"+e.model.name);if(e.model.values)for(const t of e.model.values)e.view[t]=hd(e.view[t]);else e.view=hd(e.view);const n=ud(e);return i=>{var o;i.on(t,(o=n,(e,t,n)=>{const i=o(t.attributeOldValue,n),r=o(t.attributeNewValue,n);if(!i&&!r)return;if(!n.consumable.consume(t.item,e.name))return;const s=n.mapper.toViewElement(t.item),a=n.writer;if(!s)throw new l.b("conversion-attribute-to-attribute-on-text",[t,n]);if(null!==t.attributeOldValue&&i)if("class"==i.key){const e=Array.isArray(i.value)?i.value:[i.value];for(const t of e)a.removeClass(t,s)}else if("style"==i.key){const e=Object.keys(i.value);for(const t of e)a.removeStyle(t,s)}else a.removeAttribute(i.key,s);if(null!==t.attributeNewValue&&r)if("class"==r.key){const e=Array.isArray(r.value)?r.value:[r.value];for(const t of e)a.addClass(t,s)}else if("style"==r.key){const e=Object.keys(r.value);for(const t of e)a.setStyle(t,r.value[t],s)}else a.setAttribute(r.key,r.value,s)}),{priority:e.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(e){return(e=sd(e)).view=dd(e.view,"ui"),t=>{var n;t.on("addMarker:"+e.model,(n=e.view,(e,t,i)=>{t.isOpening=!0;const o=n(t,i);t.isOpening=!1;const r=n(t,i);if(!o||!r)return;const s=t.markerRange;if(s.isCollapsed&&!i.consumable.consume(s,e.name))return;for(const t of s)if(!i.consumable.consume(t.item,e.name))return;const a=i.mapper,l=i.writer;l.insert(a.toViewPosition(s.start),o),i.mapper.bindElementToMarker(o,t.markerName),s.isCollapsed||(l.insert(a.toViewPosition(s.end),r),i.mapper.bindElementToMarker(r,t.markerName)),e.stop()}),{priority:e.converterPriority||"normal"}),t.on("removeMarker:"+e.model,(e.view,(e,t,n)=>{const i=n.mapper.markerNameToElements(t.markerName);if(i){for(const e of i)n.mapper.unbindElementFromMarkerName(e,t.markerName),n.writer.clear(n.writer.createRangeOn(e),e);n.writer.clearClonedElementsGroup(t.markerName),e.stop()}}),{priority:e.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(e){return t=>{var n;t.on("addMarker:"+e.model,(n=e.view,(e,t,i)=>{if(!t.item)return;if(!(t.item instanceof Gc||t.item instanceof nd||t.item.is("$textProxy")))return;const o=md(n,t,i);if(!o)return;if(!i.consumable.consume(t.item,e.name))return;const r=i.writer,s=ld(r,o),a=r.document.selection;if(t.item instanceof Gc||t.item instanceof nd)r.wrap(a.getFirstRange(),s,a);else{const e=i.mapper.toViewRange(t.range),n=r.wrap(e,s);for(const e of n.getItems())if(e.is("attributeElement")&&e.isSimilar(s)){i.mapper.bindElementToMarker(e,t.markerName);break}}}),{priority:e.converterPriority||"normal"}),t.on("addMarker:"+e.model,function(e){return(t,n,i)=>{if(!n.item)return;if(!(n.item instanceof Fo))return;const o=md(e,n,i);if(!o)return;if(!i.consumable.test(n.item,t.name))return;const r=i.mapper.toViewElement(n.item);if(r&&r.getCustomProperty("addHighlight")){i.consumable.consume(n.item,t.name);for(const e of Jo._createIn(n.item))i.consumable.consume(e.item,t.name);r.getCustomProperty("addHighlight")(r,o,i.writer),i.mapper.bindElementToMarker(r,n.markerName)}}}(e.view),{priority:e.converterPriority||"normal"}),t.on("removeMarker:"+e.model,function(e){return(t,n,i)=>{if(n.markerRange.isCollapsed)return;const o=md(e,n,i);if(!o)return;const r=ld(i.writer,o),s=i.mapper.markerNameToElements(n.markerName);if(s){for(const e of s)i.mapper.unbindElementFromMarkerName(e,n.markerName),e.is("attributeElement")?i.writer.unwrap(i.writer.createRangeOn(e),r):e.getCustomProperty("removeHighlight")(e,o.id,i.writer);i.writer.clearClonedElementsGroup(n.markerName),t.stop()}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(e){const t=(e=sd(e)).model;e.view||(e.view=n=>({group:t,name:n.substr(e.model.length+1)}));return n=>{var i;n.on("addMarker:"+t,(i=e.view,(e,t,n)=>{const o=i(t.markerName,n);if(!o)return;const r=t.markerRange;n.consumable.consume(r,e.name)&&(cd(r,!1,n,t,o),cd(r,!0,n,t,o),e.stop())}),{priority:e.converterPriority||"normal"}),n.on("removeMarker:"+t,function(e){return(t,n,i)=>{const o=e(n.markerName,i);if(!o)return;const r=i.mapper.markerNameToElements(n.markerName);if(r){for(const e of r)i.mapper.unbindElementFromMarkerName(e,n.markerName),e.is("containerElement")?(s(`data-${o.group}-start-before`,e),s(`data-${o.group}-start-after`,e),s(`data-${o.group}-end-before`,e),s(`data-${o.group}-end-after`,e)):i.writer.clear(i.writer.createRangeOn(e),e);i.writer.clearClonedElementsGroup(n.markerName),t.stop()}function s(e,t){if(t.hasAttribute(e)){const n=new Set(t.getAttribute(e).split(","));n.delete(o.name),0==n.size?i.writer.removeAttribute(e,t):i.writer.setAttribute(e,Array.from(n).join(","),t)}}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}}function ld(e,t){const n=e.createAttributeElement("span",t.attributes);return t.classes&&n._addClass(t.classes),t.priority&&(n._priority=t.priority),n._id=t.id,n}function cd(e,t,n,i,o){const r=t?e.start:e.end;if(n.schema.checkChild(r,"$text")){!function(e,t,n,i,o){const r=`${o.group}-${t?"start":"end"}`,s=o.name?{name:o.name}:null,a=n.writer.createUIElement(r,s);n.writer.insert(e,a),n.mapper.bindElementToMarker(a,i.markerName)}(n.mapper.toViewPosition(r),t,n,i,o)}else{let e,s;t&&r.nodeAfter||!t&&!r.nodeBefore?(e=r.nodeAfter,s=!0):(e=r.nodeBefore,s=!1);!function(e,t,n,i,o,r){const s=`data-${r.group}-${t?"start":"end"}-${n?"before":"after"}`,a=e.hasAttribute(s)?e.getAttribute(s).split(","):[];a.unshift(r.name),i.writer.setAttribute(s,a.join(","),e),i.mapper.bindElementToMarker(e,o.markerName)}(n.mapper.toViewElement(e),t,s,n,i,o)}}function dd(e,t){return"function"==typeof e?e:(n,i)=>function(e,t,n){"string"==typeof e&&(e={name:e});let i;const o=t.writer,r=Object.assign({},e.attributes);if("container"==n)i=o.createContainerElement(e.name,r);else if("attribute"==n){const t={priority:e.priority||Ml.DEFAULT_PRIORITY};i=o.createAttributeElement(e.name,r,t)}else i=o.createUIElement(e.name,r);if(e.styles){const t=Object.keys(e.styles);for(const n of t)o.setStyle(n,e.styles[n],i)}if(e.classes){const t=e.classes;if("string"==typeof t)o.addClass(t,i);else for(const e of t)o.addClass(e,i)}return i}(e,i,t)}function ud(e){return e.model.values?(t,n)=>{const i=e.view[t];return i?i(t,n):null}:e.view}function hd(e){return"string"==typeof e?t=>({key:e,value:t}):"object"==typeof e?e.value?()=>e:t=>({key:e.key,value:t}):e}function md(e,t,n){const i="function"==typeof e?e(t,n):e;return i?(i.priority||(i.priority=10),i.id||(i.id=t.markerName),i):null}function gd(e){const{schema:t,document:n}=e.model;for(const i of n.getRootNames()){const o=n.getRoot(i);if(o.isEmpty&&!t.checkChild(o,"$text")&&t.checkChild(o,"paragraph"))return e.insertElement("paragraph",o),!0}return!1}function pd(e,t,n){const i=n.createContext(e);return!!n.checkChild(i,"paragraph")&&!!n.checkChild(i.push("paragraph"),t)}function fd(e,t){const n=t.createElement("paragraph");return t.insert(n,e),t.createPositionAt(n,0)}class wd extends rd{elementToElement(e){return this.add(bd(e))}elementToAttribute(e){return this.add(function(e){vd(e=sd(e));const t=yd(e,!1),n=_d(e.view),i=n?"element:"+n:"element";return n=>{n.on(i,t,{priority:e.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(e){e=sd(e);let t=null;("string"==typeof e.view||e.view.key)&&(t=function(e){"string"==typeof e.view&&(e.view={key:e.view});const t=e.view.key;let n;if("class"==t||"style"==t){n={["class"==t?"classes":"styles"]:e.view.value}}else{const i=void 0===e.view.value?/[\s\S]*/:e.view.value;n={attributes:{[t]:i}}}e.view.name&&(n.name=e.view.name);return e.view=n,t}(e));vd(e,t);const n=yd(e,!0);return t=>{t.on("element",n,{priority:e.converterPriority||"low"})}}(e))}elementToMarker(e){return console.warn(Object(l.a)("upcast-helpers-element-to-marker-deprecated")),this.add(function(e){return function(e){const t=e.model;e.model=(e,n)=>{const i="string"==typeof t?t:t(e,n);return n.writer.createElement("$marker",{"data-name":i})}}(e=sd(e)),bd(e)}(e))}dataToMarker(e){return this.add(function(e){(e=sd(e)).model||(e.model=t=>t?e.view+":"+t:e.view);const t=kd(xd(e,"start")),n=kd(xd(e,"end"));return i=>{i.on("element:"+e.view+"-start",t,{priority:e.converterPriority||"normal"}),i.on("element:"+e.view+"-end",n,{priority:e.converterPriority||"normal"});const o=a.get("low"),r=a.get("highest"),s=a.get(e.converterPriority)/r;i.on("element",function(e){return(t,n,i)=>{const o="data-"+e.view;function r(t,o){for(const r of o){const o=e.model(r,i),s=i.writer.createElement("$marker",{"data-name":o});i.writer.insert(s,t),n.modelCursor.isEqual(t)?n.modelCursor=n.modelCursor.getShiftedBy(1):n.modelCursor=n.modelCursor._getTransformedByInsertion(t,1),n.modelRange=n.modelRange._getTransformedByInsertion(t,1)[0]}}n.modelRange||(n=Object.assign(n,i.convertChildren(n.viewItem,n.modelCursor))),i.consumable.consume(n.viewItem,{attributes:o+"-end-after"})&&r(n.modelRange.end,n.viewItem.getAttribute(o+"-end-after").split(",")),i.consumable.consume(n.viewItem,{attributes:o+"-start-after"})&&r(n.modelRange.end,n.viewItem.getAttribute(o+"-start-after").split(",")),i.consumable.consume(n.viewItem,{attributes:o+"-end-before"})&&r(n.modelRange.start,n.viewItem.getAttribute(o+"-end-before").split(",")),i.consumable.consume(n.viewItem,{attributes:o+"-start-before"})&&r(n.modelRange.start,n.viewItem.getAttribute(o+"-start-before").split(","))}}(e),{priority:o+s})}}(e))}}function bd(e){const t=kd(e=sd(e)),n=_d(e.view),i=n?"element:"+n:"element";return n=>{n.on(i,t,{priority:e.converterPriority||"normal"})}}function _d(e){return"string"==typeof e?e:"object"==typeof e&&"string"==typeof e.name?e.name:null}function kd(e){const t=new us(e.view);return(n,i,o)=>{const r=t.match(i.viewItem);if(!r)return;const s=r.match;if(s.name=!0,!o.consumable.test(i.viewItem,s))return;const a=function(e,t,n){return e instanceof Function?e(t,n):n.writer.createElement(e)}(e.model,i.viewItem,o);a&&o.safeInsert(a,i.modelCursor)&&(o.consumable.consume(i.viewItem,s),o.convertChildren(i.viewItem,a),o.updateConversionResult(a,i))}}function vd(e,t=null){const n=null===t||(e=>e.getAttribute(t)),i="object"!=typeof e.model?e.model:e.model.key,o="object"!=typeof e.model||void 0===e.model.value?n:e.model.value;e.model={key:i,value:o}}function yd(e,t){const n=new us(e.view);return(i,o,r)=>{const s=n.match(o.viewItem);if(!s)return;const a=e.model.key,l="function"==typeof e.model.value?e.model.value(o.viewItem,r):e.model.value;if(null===l)return;if(!function(e,t){const n="function"==typeof e?e(t):e;if("object"==typeof n&&!_d(n))return!1;return!n.classes&&!n.attributes&&!n.styles}(e.view,o.viewItem)?delete s.match.name:s.match.name=!0,!r.consumable.test(o.viewItem,s.match))return;o.modelRange||(o=Object.assign(o,r.convertChildren(o.viewItem,o.modelCursor)));(function(e,t,n,i){let o=!1;for(const r of Array.from(e.getItems({shallow:n})))i.schema.checkAttribute(r,t.key)&&(i.writer.setAttribute(t.key,t.value,r),o=!0);return o})(o.modelRange,{key:a,value:l},t,r)&&r.consumable.consume(o.viewItem,s.match)}}function xd(e,t){const n={};return n.view=e.view+"-"+t,n.model=(t,n)=>{const i=t.getAttribute("name"),o=e.model(i,n);return n.writer.createElement("$marker",{"data-name":o})},n}class Ad{constructor(e,t){this.model=e,this.view=new $c(t),this.mapper=new qc,this.downcastDispatcher=new Kc({mapper:this.mapper,schema:e.schema});const n=this.model.document,i=n.selection,o=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(n,"change",()=>{this.view.change(e=>{this.downcastDispatcher.convertChanges(n.differ,o,e),this.downcastDispatcher.convertSelection(i,o,e)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(e,t){return(n,i)=>{const o=i.newSelection,r=[];for(const e of o.getRanges())r.push(t.toModelRange(e));const s=e.createSelection(r,{backward:o.isBackward});s.isEqual(e.document.selection)||e.change(e=>{e.setSelection(s)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(e,t,n)=>{if(!n.consumable.consume(t.item,"insert"))return;const i=n.writer,o=n.mapper.toViewPosition(t.range.start),r=i.createText(t.item.data);i.insert(o,r)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(e,t,n)=>{const i=n.mapper.toViewPosition(t.position),o=t.position.getShiftedBy(t.length),r=n.mapper.toViewPosition(o,{isPhantom:!0}),s=n.writer.createRange(i,r),a=n.writer.remove(s.getTrimmed());for(const e of n.writer.createRangeIn(a).getItems())n.mapper.unbindViewElement(e)},{priority:"low"}),this.downcastDispatcher.on("selection",(e,t,n)=>{const i=n.writer,o=i.document.selection;for(const e of o.getRanges())e.isCollapsed&&e.end.parent.isAttached()&&n.writer.mergeAttributes(e.start);i.setSelection(null)},{priority:"low"}),this.downcastDispatcher.on("selection",(e,t,n)=>{const i=t.selection;if(i.isCollapsed)return;if(!n.consumable.consume(i,"selection"))return;const o=[];for(const e of i.getRanges()){const t=n.mapper.toViewRange(e);o.push(t)}n.writer.setSelection(o,{backward:i.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(e,t,n)=>{const i=t.selection;if(!i.isCollapsed)return;if(!n.consumable.consume(i,"selection"))return;const o=n.writer,r=i.getFirstPosition(),s=n.mapper.toViewPosition(r),a=o.breakAttributes(s);o.setSelection(a)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(e=>{if("$graveyard"==e.rootName)return null;const t=new Tl(this.view.document,e.name);return t.rootName=e.rootName,this.mapper.bindElements(e,t),t})}destroy(){this.view.destroy(),this.stopListening()}}Ye(Ad,Fe);class Cd{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const n=this.get(e);if(!n)throw new l.b("commandcollection-command-not-found",this,{commandName:e});return n.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}class Td{constructor(){this._consumables=new Map}add(e,t){let n;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?n=this._consumables.get(e):(n=new Ed(e),this._consumables.set(e,n)),n.add(t))}test(e,t){const n=this._consumables.get(e);return void 0===n?null:e.is("$text")||e.is("documentFragment")?n:n.test(t)}consume(e,t){return!!this.test(e,t)&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!1):this._consumables.get(e).consume(t),!0)}revert(e,t){const n=this._consumables.get(e);void 0!==n&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):n.revert(t))}static consumablesFromElement(e){const t={element:e,name:!0,attributes:[],classes:[],styles:[]},n=e.getAttributeKeys();for(const e of n)"style"!=e&&"class"!=e&&t.attributes.push(e);const i=e.getClassNames();for(const e of i)t.classes.push(e);const o=e.getStyleNames();for(const e of o)t.styles.push(e);return t}static createFrom(e,t){if(t||(t=new Td(e)),e.is("$text"))return t.add(e),t;e.is("element")&&t.add(e,Td.consumablesFromElement(e)),e.is("documentFragment")&&t.add(e);for(const n of e.getChildren())t=Td.createFrom(n,t);return t}}class Ed{constructor(e){this.element=e,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){e.name&&(this._canConsumeName=!0);for(const t in this._consumables)t in e&&this._add(t,e[t])}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const t in this._consumables)if(t in e){const n=this._test(t,e[t]);if(!0!==n)return n}return!0}consume(e){e.name&&(this._canConsumeName=!1);for(const t in this._consumables)t in e&&this._consume(t,e[t])}revert(e){e.name&&(this._canConsumeName=!0);for(const t in this._consumables)t in e&&this._revert(t,e[t])}_add(e,t){const n=ke(t)?t:[t],i=this._consumables[e];for(const t of n){if("attributes"===e&&("class"===t||"style"===t))throw new l.b("viewconsumable-invalid-attribute",this);if(i.set(t,!0),"styles"===e)for(const e of this.element.document.stylesProcessor.getRelatedStyles(t))i.set(e,!0)}}_test(e,t){const n=ke(t)?t:[t],i=this._consumables[e];for(const t of n)if("attributes"!==e||"class"!==t&&"style"!==t){const e=i.get(t);if(void 0===e)return null;if(!e)return!1}else{const e="class"==t?"classes":"styles",n=this._test(e,[...this._consumables[e].keys()]);if(!0!==n)return n}return!0}_consume(e,t){const n=ke(t)?t:[t],i=this._consumables[e];for(const t of n)if("attributes"!==e||"class"!==t&&"style"!==t){if(i.set(t,!1),"styles"==e)for(const e of this.element.document.stylesProcessor.getRelatedStyles(t))i.set(e,!1)}else{const e="class"==t?"classes":"styles";this._consume(e,[...this._consumables[e].keys()])}}_revert(e,t){const n=ke(t)?t:[t],i=this._consumables[e];for(const t of n)if("attributes"!==e||"class"!==t&&"style"!==t){!1===i.get(t)&&i.set(t,!0)}else{const e="class"==t?"classes":"styles";this._revert(e,[...this._consumables[e].keys()])}}}class Md{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,t)=>{t[0]=new Pd(t[0])},{priority:"highest"}),this.on("checkChild",(e,t)=>{t[0]=new Pd(t[0]),t[1]=this.getDefinition(t[1])},{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new l.b("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new l.b("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t="string"==typeof e?e:e.is&&(e.is("$text")||e.is("$textProxy"))?"$text":e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!(!t||!t.isBlock)}isLimit(e){const t=this.getDefinition(e);return!!t&&!(!t.isLimit&&!t.isObject)}isObject(e){const t=this.getDefinition(e);return!!t&&!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent)}isInline(e){const t=this.getDefinition(e);return!(!t||!t.isInline)}isSelectable(e){const t=this.getDefinition(e);return!!t&&!(!t.isSelectable&&!t.isObject)}isContent(e){const t=this.getDefinition(e);return!!t&&!(!t.isContent&&!t.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(t,e)}checkAttribute(e,t){const n=this.getDefinition(e.last);return!!n&&n.allowAttributes.includes(t)}checkMerge(e,t=null){if(e instanceof Wo){const t=e.nodeBefore,n=e.nodeAfter;if(!(t instanceof Fo))throw new l.b("schema-check-merge-no-element-before",this);if(!(n instanceof Fo))throw new l.b("schema-check-merge-no-element-after",this);return this.checkMerge(t,n)}for(const n of t.getChildren())if(!this.checkChild(e,n))return!1;return!0}addChildCheck(e){this.on("checkChild",(t,[n,i])=>{if(!i)return;const o=e(n,i);"boolean"==typeof o&&(t.stop(),t.return=o)},{priority:"high"})}addAttributeCheck(e){this.on("checkAttribute",(t,[n,i])=>{const o=e(n,i);"boolean"==typeof o&&(t.stop(),t.return=o)},{priority:"high"})}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||{}}getLimitElement(e){let t;if(e instanceof Wo)t=e.parent;else{t=(e instanceof Jo?[e]:Array.from(e.getRanges())).reduce((e,t)=>{const n=t.getCommonAncestor();return e?e.getCommonAncestor(n,{includeSelf:!0}):n},null)}for(;!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const n=[...e.getFirstPosition().getAncestors(),new Do("",e.getAttributes())];return this.checkAttribute(n,t)}{const n=e.getRanges();for(const e of n)for(const n of e)if(this.checkAttribute(n.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(e){for(const t of e)yield*t.getMinimalFlatRanges()}(e);for(const n of e)yield*this._getValidRangesForRange(n,t)}getNearestSelectionRange(e,t="both"){if(this.checkChild(e,"$text"))return new Jo(e);let n,i;const o=e.getAncestors().reverse().find(e=>this.isLimit(e))||e.root;"both"!=t&&"backward"!=t||(n=new Ho({boundaries:Jo._createIn(o),startPosition:e,direction:"backward"})),"both"!=t&&"forward"!=t||(i=new Ho({boundaries:Jo._createIn(o),startPosition:e}));for(const e of function*(e,t){let n=!1;for(;!n;){if(n=!0,e){const t=e.next();t.done||(n=!1,yield{walker:e,value:t.value})}if(t){const e=t.next();e.done||(n=!1,yield{walker:t,value:e.value})}}}(n,i)){const t=e.walker==n?"elementEnd":"elementStart",i=e.value;if(i.type==t&&this.isObject(i.item))return Jo._createOn(i.item);if(this.checkChild(i.nextPosition,"$text"))return new Jo(i.nextPosition)}return null}findAllowedParent(e,t){let n=e.parent;for(;n;){if(this.checkChild(n,t))return n;if(this.isLimit(n))return null;n=n.parent}return null}removeDisallowedAttributes(e,t){for(const n of e)if(n.is("$text"))Vd(this,n,t);else{const e=Jo._createIn(n).getPositions();for(const n of e){Vd(this,n.nodeBefore||n.parent,t)}}}createContext(e){return new Pd(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,n=Object.keys(t);for(const i of n)e[i]=Sd(t[i],i);for(const t of n)Id(e,t);for(const t of n)Od(e,t);for(const t of n)Nd(e,t),zd(e,t);for(const t of n)Rd(e,t),Ld(e,t);this._compiledDefinitions=e}_checkContextMatch(e,t,n=t.length-1){const i=t.getItem(n);if(e.allowIn.includes(i.name)){if(0==n)return!0;{const e=this.getDefinition(i);return this._checkContextMatch(e,t,n-1)}}return!1}*_getValidRangesForRange(e,t){let n=e.start,i=e.start;for(const o of e.getItems({shallow:!0}))o.is("element")&&(yield*this._getValidRangesForRange(Jo._createIn(o),t)),this.checkAttribute(o,t)||(n.isEqual(i)||(yield new Jo(n,i)),n=Wo._createAfter(o)),i=Wo._createAfter(o);n.isEqual(i)||(yield new Jo(n,i))}}Ye(Md,Fe);class Pd{constructor(e){if(e instanceof Pd)return e;"string"==typeof e?e=[e]:Array.isArray(e)||(e=e.getAncestors({includeSelf:!0})),e[0]&&"string"!=typeof e[0]&&e[0].is("documentFragment")&&e.shift(),this._items=e.map(Bd)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new Pd([e]);return t._items=[...this._items,...t._items],t}getItem(e){return this._items[e]}*getNames(){yield*this._items.map(e=>e.name)}endsWith(e){return Array.from(this.getNames()).join(" ").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(" ").startsWith(e)}}function Sd(e,t){const n={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return function(e,t){for(const n of e){const e=Object.keys(n).filter(e=>e.startsWith("is"));for(const i of e)t[i]=n[i]}}(e,n),jd(e,n,"allowIn"),jd(e,n,"allowContentOf"),jd(e,n,"allowWhere"),jd(e,n,"allowAttributes"),jd(e,n,"allowAttributesOf"),jd(e,n,"inheritTypesFrom"),function(e,t){for(const n of e){const e=n.inheritAllFrom;e&&(t.allowContentOf.push(e),t.allowWhere.push(e),t.allowAttributesOf.push(e),t.inheritTypesFrom.push(e))}}(e,n),n}function Id(e,t){for(const n of e[t].allowContentOf)if(e[n]){Dd(e,n).forEach(e=>{e.allowIn.push(t)})}delete e[t].allowContentOf}function Od(e,t){for(const n of e[t].allowWhere){const i=e[n];if(i){const n=i.allowIn;e[t].allowIn.push(...n)}}delete e[t].allowWhere}function Nd(e,t){for(const n of e[t].allowAttributesOf){const i=e[n];if(i){const n=i.allowAttributes;e[t].allowAttributes.push(...n)}}delete e[t].allowAttributesOf}function zd(e,t){const n=e[t];for(const t of n.inheritTypesFrom){const i=e[t];if(i){const e=Object.keys(i).filter(e=>e.startsWith("is"));for(const t of e)t in n||(n[t]=i[t])}}delete n.inheritTypesFrom}function Rd(e,t){const n=e[t],i=n.allowIn.filter(t=>e[t]);n.allowIn=Array.from(new Set(i))}function Ld(e,t){const n=e[t];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function jd(e,t,n){for(const i of e)"string"==typeof i[n]?t[n].push(i[n]):Array.isArray(i[n])&&t[n].push(...i[n])}function Dd(e,t){const n=e[t];return(i=e,Object.keys(i).map(e=>i[e])).filter(e=>e.allowIn.includes(n.name));var i}function Bd(e){return"string"==typeof e?{name:e,*getAttributeKeys(){},getAttribute(){}}:{name:e.is("element")?e.name:"$text",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute:t=>e.getAttribute(t)}}function Vd(e,t,n){for(const i of t.getAttributeKeys())e.checkAttribute(t,i)||n.removeAttribute(i,t)}class Fd{constructor(e={}){this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},e),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.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(e,t,n=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(e,t){let n;for(const i of new Pd(e)){const e={};for(const t of i.getAttributeKeys())e[t]=i.getAttribute(t);const o=t.createElement(i.name,e);n&&t.append(o,n),n=Wo._createAt(o,0)}return n}(n,t),this.conversionApi.writer=t,this.conversionApi.consumable=Td.createFrom(e),this.conversionApi.store={};const{modelRange:i}=this._convertItem(e,this._modelCursor),o=t.createDocumentFragment();if(i){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren()))t.append(e,o);o.markers=function(e,t){const n=new Set,i=new Map,o=Jo._createIn(e).getItems();for(const e of o)"$marker"==e.name&&n.add(e);for(const e of n){const n=e.getAttribute("data-name"),o=t.createPositionBefore(e);i.has(n)?i.get(n).end=o.clone():i.set(n,new Jo(o.clone())),t.remove(e)}return i}(o,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,o}_convertItem(e,t){const n=Object.assign({viewItem:e,modelCursor:t,modelRange:null});if(e.is("element")?this.fire("element:"+e.name,n,this.conversionApi):e.is("$text")?this.fire("text",n,this.conversionApi):this.fire("documentFragment",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof Jo))throw new l.b("view-conversion-dispatcher-incorrect-result",this);return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(e,t){let n=t.is("position")?t:Wo._createAt(t,0);const i=new Jo(n);for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,n);e.modelRange instanceof Jo&&(i.end=e.modelRange.end,n=e.modelCursor)}return{modelRange:i,modelCursor:n}}_safeInsert(e,t){const n=this._splitToAllowedParent(e,t);return!!n&&(this.conversionApi.writer.insert(e,n.position),!0)}_updateConversionResult(e,t){const n=this._getSplitParts(e),i=this.conversionApi.writer;t.modelRange||(t.modelRange=i.createRange(i.createPositionBefore(e),i.createPositionAfter(n[n.length-1])));const o=this._cursorParents.get(e);t.modelCursor=o?i.createPositionAt(o,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:n,writer:i}=this.conversionApi;let o=n.findAllowedParent(t,e);if(o){if(o===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(o)&&(o=null)}if(!o)return pd(t,e,n)?{position:fd(t,i)}:null;const r=this.conversionApi.writer.split(t,o),s=[];for(const e of r.range.getWalker())if("elementEnd"==e.type)s.push(e.item);else{const t=s.pop(),n=e.item;this._registerSplitPair(t,n)}const a=r.range.end.parent;return this._cursorParents.set(e,a),{position:r.position,cursorParent:a}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const n=this._splitParts.get(e);this._splitParts.set(t,n),n.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e],t}_removeEmptyElements(){let e=!1;for(const t of this._splitParts.keys())t.isEmpty&&(this.conversionApi.writer.remove(t),this._splitParts.delete(t),e=!0);e&&this._removeEmptyElements()}}Ye(Fd,u);class Hd{constructor(e,t){this.model=e,this.stylesProcessor=t,this.processor=void 0,this.mapper=new qc,this.downcastDispatcher=new Kc({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",(e,t,n)=>{if(!n.consumable.consume(t.item,"insert"))return;const i=n.writer,o=n.mapper.toViewPosition(t.range.start),r=i.createText(t.item.data);i.insert(o,r)},{priority:"lowest"}),this.upcastDispatcher=new Fd({schema:e.schema}),this.viewDocument=new El(t),this._viewWriter=new Dl(this.viewDocument),this.upcastDispatcher.on("text",(e,t,{schema:n,consumable:i,writer:o})=>{let r=t.modelCursor;if(!i.test(t.viewItem))return;if(!n.checkChild(r,"$text")){if(!pd(r,"$text",n))return;r=fd(r,o)}i.consume(t.viewItem);const s=o.createText(t.viewItem.data);o.insert(s,r),t.modelRange=o.createRange(r,r.getShiftedBy(s.offsetSize)),t.modelCursor=t.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(e,t,n)=>{if(!t.modelRange&&n.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:i}=n.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=i}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(e,t,n)=>{if(!t.modelRange&&n.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:i}=n.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=i}},{priority:"lowest"}),this.decorate("init"),this.decorate("set"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange("transparent",gd)},{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:n="empty"}=e;if(!this._checkIfRootsExists([t]))throw new l.b("datacontroller-get-non-existent-root",this);const i=this.model.document.getRoot(t);return"empty"!==n||this.model.hasContent(i,{ignoreWhitespaces:!0})?this.stringify(i,e):""}stringify(e,t){const n=this.toView(e,t);return this.processor.toData(n)}toView(e,t){const n=this.viewDocument,i=this._viewWriter;this.mapper.clearBindings();const o=Jo._createIn(e),r=new la(n);if(this.mapper.bindElements(e,r),this.downcastDispatcher.conversionApi.options=t,this.downcastDispatcher.convertInsert(o,i),!e.is("documentFragment")){const t=function(e){const t=[],n=e.root.document;if(!n)return[];const i=Jo._createIn(e);for(const e of n.model.markers){const n=i.getIntersection(e.getRange());n&&t.push([e.name,n])}return t}(e);for(const[e,n]of t)this.downcastDispatcher.convertMarkerAdd(e,n,i)}return delete this.downcastDispatcher.conversionApi.options,r}init(e){if(this.model.document.version)throw new l.b("datacontroller-init-document-not-empty",this);let t={};if("string"==typeof e?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new l.b("datacontroller-init-non-existent-root",this);return this.model.enqueueChange("transparent",e=>{for(const n of Object.keys(t)){const i=this.model.document.getRoot(n);e.insert(this.parse(t[n],i),i,0)}}),Promise.resolve()}set(e){let t={};if("string"==typeof e?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new l.b("datacontroller-set-non-existent-root",this);this.model.enqueueChange("transparent",e=>{e.setSelection(null),e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const n of Object.keys(t)){const i=this.model.document.getRoot(n);e.remove(e.createRangeIn(i)),e.insert(this.parse(t[n],i),i,0)}})}parse(e,t="$root"){const n=this.processor.toView(e);return this.toModel(n,t)}toModel(e,t="$root"){return this.model.change(n=>this.upcastDispatcher.convert(e,n,t))}addStyleProcessorRules(e){e(this.stylesProcessor)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRootNames().includes(t))return!1;return!0}}Ye(Hd,Fe);class Ud{constructor(e,t){this._helpers=new Map,this._downcast=Array.isArray(e)?e:[e],this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Array.isArray(t)?t:[t],this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const n=this._downcast.includes(t);if(!this._upcast.includes(t)&&!n)throw new l.b("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:n})}for(e){if(!this._helpers.has(e))throw new l.b("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:n}of Wd(e))this.for("upcast").elementToElement({model:t,view:n,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:n}of Wd(e))this.for("upcast").elementToAttribute({view:n,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:n}of Wd(e))this.for("upcast").attributeToAttribute({view:n,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:n}){if(this._helpers.has(e))throw new l.b("conversion-group-exists",this);const i=n?new ad(t):new wd(t);this._helpers.set(e,i)}}function*Wd(e){if(e.model.values)for(const t of e.model.values){const n={key:e.model.key,value:t},i=e.view[t],o=e.upcastAlso?e.upcastAlso[t]:void 0;yield*$d(n,i,o)}else yield*$d(e.model,e.view,e.upcastAlso)}function*$d(e,t,n){if(yield{model:e,view:t},n){n=Array.isArray(n)?n:[n];for(const t of n)yield{model:e,view:t}}}class qd{constructor(e="default"){this.operations=[],this.type=e}get baseVersion(){for(const e of this.operations)if(null!==e.baseVersion)return e.baseVersion;return null}addOperation(e){return e.batch=this,this.operations.push(e),e}}class Yd{constructor(e){this.baseVersion=e,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e){return new this(e.baseVersion)}}class Jd{constructor(e){this.markers=new Map,this._children=new Vo,e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(e){return"documentFragment"===e||"model:documentFragment"===e}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}static fromJSON(e){const t=[];for(const n of e)n.name?t.push(Fo.fromJSON(n)):t.push(Do.fromJSON(n));return new Jd(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(e){if("string"==typeof e)return[new Do(e)];Ge(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new Do(e):e instanceof Bo?new Do(e.data,e.getAttributes()):e)}(t);for(const e of n)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const e of n)e.parent=null;return n}}function Kd(e,t){const n=(t=Qd(t)).reduce((e,t)=>e+t.offsetSize,0),i=e.parent;eu(e);const o=e.index;return i._insertChild(o,t),Zd(i,o+t.length),Zd(i,o),new Jo(e,e.getShiftedBy(n))}function Xd(e){if(!e.isFlat)throw new l.b("operation-utils-remove-range-not-flat",this);const t=e.start.parent;eu(e.start),eu(e.end);const n=t._removeChildren(e.start.index,e.end.index-e.start.index);return Zd(t,e.start.index),n}function Gd(e,t){if(!e.isFlat)throw new l.b("operation-utils-move-range-not-flat",this);const n=Xd(e);return Kd(t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),n)}function Qd(e){const t=[];e instanceof Array||(e=[e]);for(let n=0;n<e.length;n++)if("string"==typeof e[n])t.push(new Do(e[n]));else if(e[n]instanceof Bo)t.push(new Do(e[n].data,e[n].getAttributes()));else if(e[n]instanceof Jd||e[n]instanceof Vo)for(const i of e[n])t.push(i);else e[n]instanceof jo&&t.push(e[n]);for(let e=1;e<t.length;e++){const n=t[e],i=t[e-1];n instanceof Do&&i instanceof Do&&tu(n,i)&&(t.splice(e-1,2,new Do(i.data+n.data,i.getAttributes())),e--)}return t}function Zd(e,t){const n=e.getChild(t-1),i=e.getChild(t);if(n&&i&&n.is("$text")&&i.is("$text")&&tu(n,i)){const o=new Do(n.data+i.data,n.getAttributes());e._removeChildren(t-1,2),e._insertChild(t-1,o)}}function eu(e){const t=e.textNode,n=e.parent;if(t){const i=e.offset-t.startOffset,o=t.index;n._removeChildren(o,1);const r=new Do(t.data.substr(0,i),t.getAttributes()),s=new Do(t.data.substr(i),t.getAttributes());n._insertChild(o,[r,s])}}function tu(e,t){const n=e.getAttributes(),i=t.getAttributes();for(const e of n){if(e[1]!==t.getAttribute(e[0]))return!1;i.next()}return i.next().done}var nu=function(e,t){return fc(e,t)};class iu extends Yd{constructor(e,t,n,i,o){super(o),this.range=e.clone(),this.key=t,this.oldValue=void 0===n?null:n,this.newValue=void 0===i?null:i}get type(){return null===this.oldValue?"addAttribute":null===this.newValue?"removeAttribute":"changeAttribute"}clone(){return new iu(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new iu(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}toJSON(){const e=super.toJSON();return e.range=this.range.toJSON(),e}_validate(){if(!this.range.isFlat)throw new l.b("attribute-operation-range-not-flat",this);for(const e of this.range.getItems({shallow:!0})){if(null!==this.oldValue&&!nu(e.getAttribute(this.key),this.oldValue))throw new l.b("attribute-operation-wrong-old-value",this,{item:e,key:this.key,value:this.oldValue});if(null===this.oldValue&&null!==this.newValue&&e.hasAttribute(this.key))throw new l.b("attribute-operation-attribute-exists",this,{node:e,key:this.key})}}_execute(){nu(this.oldValue,this.newValue)||function(e,t,n){eu(e.start),eu(e.end);for(const i of e.getItems({shallow:!0})){const e=i.is("$textProxy")?i.textNode:i;null!==n?e._setAttribute(t,n):e._removeAttribute(t),Zd(e.parent,e.index)}Zd(e.end.parent,e.end.index)}(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(e,t){return new iu(Jo.fromJSON(e.range,t),e.key,e.oldValue,e.newValue,e.baseVersion)}}class ou extends Yd{constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new l.b("detach-operation-on-document-node",this)}_execute(){Xd(Jo._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class ru extends Yd{constructor(e,t,n,i){super(i),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toNext",this.howMany=t,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNone"}get type(){return"$graveyard"==this.targetPosition.root.rootName?"remove":"$graveyard"==this.sourcePosition.root.rootName?"reinsert":"move"}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.baseVersion)}getMovedRangeStart(){return this.targetPosition._getTransformedByDeletion(this.sourcePosition,this.howMany)}getReversed(){const e=this.sourcePosition._getTransformedByInsertion(this.targetPosition,this.howMany);return new this.constructor(this.getMovedRangeStart(),this.howMany,e,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent,n=this.sourcePosition.offset,i=this.targetPosition.offset;if(n+this.howMany>e.maxOffset)throw new l.b("move-operation-nodes-do-not-exist",this);if(e===t&&n<i&&i<n+this.howMany)throw new l.b("move-operation-range-into-itself",this);if(this.sourcePosition.root==this.targetPosition.root&&"prefix"==Lo(this.sourcePosition.getParentPath(),this.targetPosition.getParentPath())){const e=this.sourcePosition.path.length-1;if(this.targetPosition.path[e]>=n&&this.targetPosition.path[e]<n+this.howMany)throw new l.b("move-operation-node-into-itself",this)}}_execute(){Gd(Jo._createFromPositionAndShift(this.sourcePosition,this.howMany),this.targetPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e.targetPosition=this.targetPosition.toJSON(),e}static get className(){return"MoveOperation"}static fromJSON(e,t){const n=Wo.fromJSON(e.sourcePosition,t),i=Wo.fromJSON(e.targetPosition,t);return new this(n,e.howMany,i,e.baseVersion)}}class su extends Yd{constructor(e,t,n){super(n),this.position=e.clone(),this.position.stickiness="toNone",this.nodes=new Vo(Qd(t)),this.shouldReceiveAttributes=!1}get type(){return"insert"}get howMany(){return this.nodes.maxOffset}clone(){const e=new Vo([...this.nodes].map(e=>e._clone(!0))),t=new su(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new Wo(e,[0]);return new ru(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffset<this.position.offset)throw new l.b("insert-operation-position-invalid",this)}_execute(){const e=this.nodes;this.nodes=new Vo([...e].map(e=>e._clone(!0))),Kd(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const n=[];for(const t of e.nodes)t.name?n.push(Fo.fromJSON(t)):n.push(Do.fromJSON(t));const i=new su(Wo.fromJSON(e.position,t),n,e.baseVersion);return i.shouldReceiveAttributes=e.shouldReceiveAttributes,i}}class au extends Yd{constructor(e,t,n,i,o,r){super(r),this.name=e,this.oldRange=t?t.clone():null,this.newRange=n?n.clone():null,this.affectsData=o,this._markers=i}get type(){return"marker"}clone(){return new au(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new au(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const e=this.newRange?"_set":"_remove";this._markers[e](this.name,this.newRange,!0,this.affectsData)}toJSON(){const e=super.toJSON();return this.oldRange&&(e.oldRange=this.oldRange.toJSON()),this.newRange&&(e.newRange=this.newRange.toJSON()),delete e._markers,e}static get className(){return"MarkerOperation"}static fromJSON(e,t){return new au(e.name,e.oldRange?Jo.fromJSON(e.oldRange,t):null,e.newRange?Jo.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}class lu extends Yd{constructor(e,t,n,i){super(i),this.position=e,this.position.stickiness="toNext",this.oldName=t,this.newName=n}get type(){return"rename"}clone(){return new lu(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new lu(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof Fo))throw new l.b("rename-operation-wrong-position",this);if(e.name!==this.oldName)throw new l.b("rename-operation-wrong-name",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e}static get className(){return"RenameOperation"}static fromJSON(e,t){return new lu(Wo.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class cu extends Yd{constructor(e,t,n,i,o){super(o),this.root=e,this.key=t,this.oldValue=n,this.newValue=i}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new cu(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new cu(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new l.b("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 l.b("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 l.b("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 e=super.toJSON();return e.root=this.root.toJSON(),e}static get className(){return"RootAttributeOperation"}static fromJSON(e,t){if(!t.getRoot(e.root))throw new l.b("rootattribute-operation-fromjson-no-root",this,{rootName:e.root});return new cu(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class du extends Yd{constructor(e,t,n,i,o){super(o),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=t,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=i.clone()}get type(){return"merge"}get deletionPosition(){return new Wo(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Jo(this.sourcePosition,e)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.targetPosition._getTransformedByMergeOperation(this),t=this.sourcePosition.path.slice(0,-1),n=new Wo(this.sourcePosition.root,t)._getTransformedByMergeOperation(this),i=new uu(e,this.howMany,this.graveyardPosition,this.baseVersion+1);return i.insertionPosition=n,i}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent;if(!e.parent)throw new l.b("merge-operation-source-position-invalid",this);if(!t.parent)throw new l.b("merge-operation-target-position-invalid",this);if(this.howMany!=e.maxOffset)throw new l.b("merge-operation-how-many-invalid",this)}_execute(){const e=this.sourcePosition.parent;Gd(Jo._createIn(e),this.targetPosition),Gd(Jo._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=e.sourcePosition.toJSON(),e.targetPosition=e.targetPosition.toJSON(),e.graveyardPosition=e.graveyardPosition.toJSON(),e}static get className(){return"MergeOperation"}static fromJSON(e,t){const n=Wo.fromJSON(e.sourcePosition,t),i=Wo.fromJSON(e.targetPosition,t),o=Wo.fromJSON(e.graveyardPosition,t);return new this(n,e.howMany,i,o,e.baseVersion)}}class uu extends Yd{constructor(e,t,n,i){super(i),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=uu.getInsertionPosition(e),this.insertionPosition.stickiness="toNone",this.graveyardPosition=n?n.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new Wo(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Jo(this.splitPosition,e)}clone(){const e=new this.constructor(this.splitPosition,this.howMany,this.graveyardPosition,this.baseVersion);return e.insertionPosition=this.insertionPosition,e}getReversed(){const e=this.splitPosition.root.document.graveyard,t=new Wo(e,[0]);return new du(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset<t)throw new l.b("split-operation-position-invalid",this);if(!e.parent)throw new l.b("split-operation-split-in-root",this);if(this.howMany!=e.maxOffset-this.splitPosition.offset)throw new l.b("split-operation-how-many-invalid",this);if(this.graveyardPosition&&!this.graveyardPosition.nodeAfter)throw new l.b("split-operation-graveyard-position-invalid",this)}_execute(){const e=this.splitPosition.parent;if(this.graveyardPosition)Gd(Jo._createFromPositionAndShift(this.graveyardPosition,1),this.insertionPosition);else{const t=e._clone();Kd(this.insertionPosition,t)}Gd(new Jo(Wo._createAt(e,this.splitPosition.offset),Wo._createAt(e,e.maxOffset)),this.moveTargetPosition)}toJSON(){const e=super.toJSON();return e.splitPosition=this.splitPosition.toJSON(),e.insertionPosition=this.insertionPosition.toJSON(),this.graveyardPosition&&(e.graveyardPosition=this.graveyardPosition.toJSON()),e}static get className(){return"SplitOperation"}static getInsertionPosition(e){const t=e.path.slice(0,-1);return t[t.length-1]++,new Wo(e.root,t)}static fromJSON(e,t){const n=Wo.fromJSON(e.splitPosition,t),i=Wo.fromJSON(e.insertionPosition,t),o=e.graveyardPosition?Wo.fromJSON(e.graveyardPosition,t):null,r=new this(n,e.howMany,o,e.baseVersion);return r.insertionPosition=i,r}}class hu extends Fo{constructor(e,t,n="main"){super(t),this._document=e,this.rootName=n}get document(){return this._document}is(e,t){return t?t===this.name&&("rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e):"rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e||"node"===e||"model:node"===e}toJSON(){return this.rootName}}class mu{constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new Do(e,t)}createElement(e,t){return new Fo(e,t)}createDocumentFragment(){return new Jd}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,n=0){if(this._assertWriterUsedCorrectly(),e instanceof Do&&""==e.data)return;const i=Wo._createAt(t,n);if(e.parent){if(bu(e.root,i.root))return void this.move(Jo._createOn(e),i);if(e.root.document)throw new l.b("model-writer-insert-forbidden-move",this);this.remove(e)}const o=i.root.document?i.root.document.version:null,r=new su(i,e,o);if(e instanceof Do&&(r.shouldReceiveAttributes=!0),this.batch.addOperation(r),this.model.applyOperation(r),e instanceof Jd)for(const[t,n]of e.markers){const e=Wo._createAt(n.root,0),o={range:new Jo(n.start._getCombined(e,i),n.end._getCombined(e,i)),usingOperation:!0,affectsData:!0};this.model.markers.has(t)?this.updateMarker(t,o):this.addMarker(t,o)}}insertText(e,t,n,i){t instanceof Jd||t instanceof Fo||t instanceof Wo?this.insert(this.createText(e),t,n):this.insert(this.createText(e,t),n,i)}insertElement(e,t,n,i){t instanceof Jd||t instanceof Fo||t instanceof Wo?this.insert(this.createElement(e),t,n):this.insert(this.createElement(e,t),n,i)}append(e,t){this.insert(e,t,"end")}appendText(e,t,n){t instanceof Jd||t instanceof Fo?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),n,"end")}appendElement(e,t,n){t instanceof Jd||t instanceof Fo?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),n,"end")}setAttribute(e,t,n){if(this._assertWriterUsedCorrectly(),n instanceof Jo){const i=n.getMinimalFlatRanges();for(const n of i)gu(this,e,t,n)}else pu(this,e,t,n)}setAttributes(e,t){for(const[n,i]of Ro(e))this.setAttribute(n,i,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof Jo){const n=t.getMinimalFlatRanges();for(const t of n)gu(this,e,null,t)}else pu(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=e=>{for(const t of e.getAttributeKeys())this.removeAttribute(t,e)};if(e instanceof Jo)for(const n of e.getItems())t(n);else t(e)}move(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof Jo))throw new l.b("writer-move-invalid-range",this);if(!e.isFlat)throw new l.b("writer-move-range-not-flat",this);const i=Wo._createAt(t,n);if(i.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!bu(e.root,i.root))throw new l.b("writer-move-different-document",this);const o=e.root.document?e.root.document.version:null,r=new ru(e.start,e.end.offset-e.start.offset,i,o);this.batch.addOperation(r),this.model.applyOperation(r)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof Jo?e:Jo._createOn(e)).getMinimalFlatRanges().reverse();for(const e of t)this._addOperationForAffectedMarkers("move",e),wu(e.start,e.end.offset-e.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,n=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof Fo))throw new l.b("writer-merge-no-element-before",this);if(!(n instanceof Fo))throw new l.b("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,n){return this.model.createPositionFromPath(e,t,n)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(e,t,n){return this.model.createSelection(e,t,n)}_mergeDetached(e){const t=e.nodeBefore,n=e.nodeAfter;this.move(Jo._createIn(n),Wo._createAt(t,"end")),this.remove(n)}_merge(e){const t=Wo._createAt(e.nodeBefore,"end"),n=Wo._createAt(e.nodeAfter,0),i=e.root.document.graveyard,o=new Wo(i,[0]),r=e.root.document.version,s=new du(n,e.nodeAfter.maxOffset,t,o,r);this.batch.addOperation(s),this.model.applyOperation(s)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof Fo))throw new l.b("writer-rename-not-element-instance",this);const n=e.root.document?e.root.document.version:null,i=new lu(Wo._createBefore(e),e.name,t,n);this.batch.addOperation(i),this.model.applyOperation(i)}split(e,t){this._assertWriterUsedCorrectly();let n,i,o=e.parent;if(!o.parent)throw new l.b("writer-split-element-no-parent",this);if(t||(t=o.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new l.b("writer-split-invalid-limit-element",this);do{const t=o.root.document?o.root.document.version:null,r=o.maxOffset-e.offset,s=new uu(e,r,null,t);this.batch.addOperation(s),this.model.applyOperation(s),n||i||(n=o,i=e.parent.nextSibling),o=(e=this.createPositionAfter(e.parent)).parent}while(o!==t);return{position:e,range:new Jo(Wo._createAt(n,"end"),Wo._createAt(i,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new l.b("writer-wrap-range-not-flat",this);const n=t instanceof Fo?t:new Fo(t);if(n.childCount>0)throw new l.b("writer-wrap-element-not-empty",this);if(null!==n.parent)throw new l.b("writer-wrap-element-attached",this);this.insert(n,e.start);const i=new Jo(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(i,Wo._createAt(n,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new l.b("writer-unwrap-element-no-parent",this);this.move(Jo._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new l.b("writer-addmarker-no-usingoperation",this);const n=t.usingOperation,i=t.range,o=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new l.b("writer-addmarker-marker-exists",this);if(!i)throw new l.b("writer-addmarker-no-range",this);return n?(fu(this,e,null,i,o),this.model.markers.get(e)):this.model.markers._set(e,i,n,o)}updateMarker(e,t){this._assertWriterUsedCorrectly();const n="string"==typeof e?e:e.name,i=this.model.markers.get(n);if(!i)throw new l.b("writer-updatemarker-marker-not-exists",this);if(!t)return void this.model.markers._refresh(i);const o="boolean"==typeof t.usingOperation,r="boolean"==typeof t.affectsData,s=r?t.affectsData:i.affectsData;if(!o&&!t.range&&!r)throw new l.b("writer-updatemarker-wrong-options",this);const a=i.getRange(),c=t.range?t.range:a;o&&t.usingOperation!==i.managedUsingOperations?t.usingOperation?fu(this,n,null,c,s):(fu(this,n,a,null,s),this.model.markers._set(n,c,void 0,s)):i.managedUsingOperations?fu(this,n,a,c,s):this.model.markers._set(n,c,void 0,s)}removeMarker(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?e:e.name;if(!this.model.markers.has(t))throw new l.b("writer-removemarker-no-marker",this);const n=this.model.markers.get(t);if(!n.managedUsingOperations)return void this.model.markers._remove(t);fu(this,t,n.getRange(),null,n.affectsData)}setSelection(e,t,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(e,t,n)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._setSelectionAttribute(e,t);else for(const[t,n]of Ro(e))this._setSelectionAttribute(t,n)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._removeSelectionAttribute(e);else for(const t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const i=nd._getStoreAttributeKey(e);this.setAttribute(i,t,n.anchor.parent)}n._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const n=nd._getStoreAttributeKey(e);this.removeAttribute(n,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new l.b("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const n of this.model.markers){if(!n.managedUsingOperations)continue;const i=n.getRange();let o=!1;if("move"===e)o=t.containsPosition(i.start)||t.start.isEqual(i.start)||t.containsPosition(i.end)||t.end.isEqual(i.end);else{const e=t.nodeBefore,n=t.nodeAfter,r=i.start.parent==e&&i.start.isAtEnd,s=i.end.parent==n&&0==i.end.offset,a=i.end.nodeAfter==n,l=i.start.nodeAfter==n;o=r||s||a||l}o&&this.updateMarker(n.name,{range:i})}}}function gu(e,t,n,i){const o=e.model,r=o.document;let s,a,l,c=i.start;for(const e of i.getWalker({shallow:!0}))l=e.item.getAttribute(t),s&&a!=l&&(a!=n&&d(),c=s),s=e.nextPosition,a=l;function d(){const i=new Jo(c,s),l=i.root.document?r.version:null,d=new iu(i,t,a,n,l);e.batch.addOperation(d),o.applyOperation(d)}s instanceof Wo&&s!=c&&a!=n&&d()}function pu(e,t,n,i){const o=e.model,r=o.document,s=i.getAttribute(t);let a,l;if(s!=n){if(i.root===i){const e=i.document?r.version:null;l=new cu(i,t,s,n,e)}else{a=new Jo(Wo._createBefore(i),e.createPositionAfter(i));const o=a.root.document?r.version:null;l=new iu(a,t,s,n,o)}e.batch.addOperation(l),o.applyOperation(l)}}function fu(e,t,n,i,o){const r=e.model,s=r.document,a=new au(t,n,i,r.markers,o,s.version);e.batch.addOperation(a),r.applyOperation(a)}function wu(e,t,n,i){let o;if(e.root.document){const n=i.document,r=new Wo(n.graveyard,[0]);o=new ru(e,t,r,n.version)}else o=new ou(e,t);n.addOperation(o),i.applyOperation(o)}function bu(e,t){return e===t||e instanceof hu&&t instanceof hu}class _u{constructor(e){this._markerCollection=e,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}refreshItem(e){if(this._isInInsertedElement(e.parent))return;this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize);const t=Jo._createOn(e);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getRange();this.bufferMarkerChange(e.name,t,t,e.affectsData)}this._cachedChanges=null}bufferOperation(e){switch(e.type){case"insert":if(this._isInInsertedElement(e.position.parent))return;this._markInsert(e.position.parent,e.position.offset,e.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const t of e.range.getItems({shallow:!0}))this._isInInsertedElement(t.parent)||this._markAttribute(t);break;case"remove":case"move":case"reinsert":{if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition))return;const t=this._isInInsertedElement(e.sourcePosition.parent),n=this._isInInsertedElement(e.targetPosition.parent);t||this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany),n||this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany);break}case"rename":{if(this._isInInsertedElement(e.position.parent))return;this._markRemove(e.position.parent,e.position.offset,1),this._markInsert(e.position.parent,e.position.offset,1);const t=Jo._createFromPositionAndShift(e.position,1);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getRange();this.bufferMarkerChange(e.name,t,t,e.affectsData)}break}case"split":{const t=e.splitPosition.parent;this._isInInsertedElement(t)||this._markRemove(t,e.splitPosition.offset,e.howMany),this._isInInsertedElement(e.insertionPosition.parent)||this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1),e.graveyardPosition&&this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1);break}case"merge":{const t=e.sourcePosition.parent;this._isInInsertedElement(t.parent)||this._markRemove(t.parent,t.startOffset,1);const n=e.graveyardPosition.parent;this._markInsert(n,e.graveyardPosition.offset,1);const i=e.targetPosition.parent;this._isInInsertedElement(i)||this._markInsert(i,e.targetPosition.offset,t.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(e,t,n,i){const o=this._changedMarkers.get(e);o?(o.newRange=n,o.affectsData=i,null==o.oldRange&&null==o.newRange&&this._changedMarkers.delete(e)):this._changedMarkers.set(e,{oldRange:t,newRange:n,affectsData:i})}getMarkersToRemove(){const e=[];for(const[t,n]of this._changedMarkers)null!=n.oldRange&&e.push({name:t,range:n.oldRange});return e}getMarkersToAdd(){const e=[];for(const[t,n]of this._changedMarkers)null!=n.newRange&&e.push({name:t,range:n.newRange});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map(e=>({name:e[0],data:{oldRange:e[1].oldRange,newRange:e[1].newRange}}))}hasDataChanges(){for(const[,e]of this._changedMarkers)if(e.affectsData)return!0;return this._changesInElement.size>0}getChanges(e={includeChangesInGraveyard:!1}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();const t=[];for(const e of this._changesInElement.keys()){const n=this._changesInElement.get(e).sort((e,t)=>e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offset<t.offset?-1:1),i=this._elementSnapshots.get(e),o=ku(e.getChildren()),r=vu(i.length,n);let s=0,a=0;for(const n of r)if("i"===n)t.push(this._getInsertDiff(e,s,o[s].name)),s++;else if("r"===n)t.push(this._getRemoveDiff(e,s,i[a].name)),a++;else if("a"===n){const n=o[s].attributes,r=i[a].attributes;let l;if("$text"==o[s].name)l=new Jo(Wo._createAt(e,s),Wo._createAt(e,s+1));else{const t=e.offsetToIndex(s);l=new Jo(Wo._createAt(e,s),Wo._createAt(e.getChild(t),0))}t.push(...this._getAttributesDiff(l,r,n)),s++,a++}else s++,a++}t.sort((e,t)=>e.position.root!=t.position.root?e.position.root.rootName<t.position.root.rootName?-1:1:e.position.isEqual(t.position)?e.changeCount-t.changeCount:e.position.isBefore(t.position)?-1:1);for(let e=1;e<t.length;e++){const n=t[e-1],i=t[e],o="remove"==n.type&&"remove"==i.type&&"$text"==n.name&&"$text"==i.name&&n.position.isEqual(i.position),r="insert"==n.type&&"insert"==i.type&&"$text"==n.name&&"$text"==i.name&&n.position.parent==i.position.parent&&n.position.offset+n.length==i.position.offset,s="attribute"==n.type&&"attribute"==i.type&&n.position.parent==i.position.parent&&n.range.isFlat&&i.range.isFlat&&n.position.offset+n.length==i.position.offset&&n.attributeKey==i.attributeKey&&n.attributeOldValue==i.attributeOldValue&&n.attributeNewValue==i.attributeNewValue;(o||r||s)&&(t[e-1].length++,s&&(t[e-1].range.end=t[e-1].range.end.getShiftedBy(1)),t.splice(e,1),e--)}for(const e of t)delete e.changeCount,"attribute"==e.type&&(delete e.position,delete e.length);return this._changeCount=0,this._cachedChangesWithGraveyard=t.slice(),this._cachedChanges=t.slice().filter(yu),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard:this._cachedChanges}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._cachedChanges=null}_markInsert(e,t,n){const i={type:"insert",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,i)}_markRemove(e,t,n){const i={type:"remove",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,i),this._removeAllNestedChanges(e,t,n)}_markAttribute(e){const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshot(e);const n=this._getChangesForElement(e);this._handleChange(t,n),n.push(t);for(let e=0;e<n.length;e++)n[e].howMany<1&&(n.splice(e,1),e--)}_getChangesForElement(e){let t;return this._changesInElement.has(e)?t=this._changesInElement.get(e):(t=[],this._changesInElement.set(e,t)),t}_makeSnapshot(e){this._elementSnapshots.has(e)||this._elementSnapshots.set(e,ku(e.getChildren()))}_handleChange(e,t){e.nodesToHandle=e.howMany;for(const n of t){const i=e.offset+e.howMany,o=n.offset+n.howMany;if("insert"==e.type&&("insert"==n.type&&(e.offset<=n.offset?n.offset+=e.howMany:e.offset<o&&(n.howMany+=e.nodesToHandle,e.nodesToHandle=0)),"remove"==n.type&&e.offset<n.offset&&(n.offset+=e.howMany),"attribute"==n.type))if(e.offset<=n.offset)n.offset+=e.howMany;else if(e.offset<o){const o=n.howMany;n.howMany=e.offset-n.offset,t.unshift({type:"attribute",offset:i,howMany:o-n.howMany,count:this._changeCount++})}if("remove"==e.type){if("insert"==n.type)if(i<=n.offset)n.offset-=e.howMany;else if(i<=o)if(e.offset<n.offset){const t=i-n.offset;n.offset=e.offset,n.howMany-=t,e.nodesToHandle-=t}else n.howMany-=e.nodesToHandle,e.nodesToHandle=0;else if(e.offset<=n.offset)e.nodesToHandle-=n.howMany,n.howMany=0;else if(e.offset<o){const t=o-e.offset;n.howMany-=t,e.nodesToHandle-=t}if("remove"==n.type&&(i<=n.offset?n.offset-=e.howMany:e.offset<n.offset&&(e.nodesToHandle+=n.howMany,n.howMany=0)),"attribute"==n.type)if(i<=n.offset)n.offset-=e.howMany;else if(e.offset<n.offset){const t=i-n.offset;n.offset=e.offset,n.howMany-=t}else if(e.offset<o)if(i<=o){const i=n.howMany;n.howMany=e.offset-n.offset;const o=i-n.howMany-e.nodesToHandle;t.unshift({type:"attribute",offset:e.offset,howMany:o,count:this._changeCount++})}else n.howMany-=o-e.offset}if("attribute"==e.type){if("insert"==n.type)if(e.offset<n.offset&&i>n.offset){if(i>o){const e={type:"attribute",offset:o,howMany:i-o,count:this._changeCount++};this._handleChange(e,t),t.push(e)}e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=n.offset&&e.offset<o&&(i>o?(e.nodesToHandle=i-o,e.offset=o):e.nodesToHandle=0);if("remove"==n.type&&e.offset<n.offset&&i>n.offset){const o={type:"attribute",offset:n.offset,howMany:i-n.offset,count:this._changeCount++};this._handleChange(o,t),t.push(o),e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}"attribute"==n.type&&(e.offset>=n.offset&&i<=o?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=n.offset&&i>=o&&(n.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,n){return{type:"insert",position:Wo._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,n){return{type:"remove",position:Wo._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,n){const i=[];n=new Map(n);for(const[o,r]of t){const t=n.has(o)?n.get(o):null;t!==r&&i.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:o,attributeOldValue:r,attributeNewValue:t,changeCount:this._changeCount++}),n.delete(o)}for(const[t,o]of n)i.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:o,changeCount:this._changeCount++});return i}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const n=this._changesInElement.get(t),i=e.startOffset;if(n)for(const e of n)if("insert"==e.type&&i>=e.offset&&i<e.offset+e.howMany)return!0;return this._isInInsertedElement(t)}_removeAllNestedChanges(e,t,n){const i=new Jo(Wo._createAt(e,t),Wo._createAt(e,t+n));for(const e of i.getItems({shallow:!0}))e.is("element")&&(this._elementSnapshots.delete(e),this._changesInElement.delete(e),this._removeAllNestedChanges(e,0,e.maxOffset))}}function ku(e){const t=[];for(const n of e)if(n.is("$text"))for(let e=0;e<n.data.length;e++)t.push({name:"$text",attributes:new Map(n.getAttributes())});else t.push({name:n.name,attributes:new Map(n.getAttributes())});return t}function vu(e,t){const n=[];let i=0,o=0;for(const e of t){if(e.offset>i){for(let t=0;t<e.offset-i;t++)n.push("e");o+=e.offset-i}if("insert"==e.type){for(let t=0;t<e.howMany;t++)n.push("i");i=e.offset+e.howMany}else if("remove"==e.type){for(let t=0;t<e.howMany;t++)n.push("r");i=e.offset,o+=e.howMany}else n.push(..."a".repeat(e.howMany).split("")),i=e.offset+e.howMany,o+=e.howMany}if(o<e)for(let t=0;t<e-o-i;t++)n.push("e");return n}function yu(e){const t=e.position&&"$graveyard"==e.position.root.rootName,n=e.range&&"$graveyard"==e.range.root.rootName;return!t&&!n}class xu{constructor(){this._operations=[],this._undoPairs=new Map,this._undoneOperations=new Set}addOperation(e){this._operations.includes(e)||this._operations.push(e)}getOperations(e=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY){const n=[];for(const i of this._operations)i.baseVersion>=e&&i.baseVersion<t&&n.push(i);return n}getOperation(e){for(const t of this._operations)if(t.baseVersion==e)return t}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}}function Au(e,t){return!!(n=e.charAt(t-1))&&1==n.length&&/[\ud800-\udbff]/.test(n)&&function(e){return!!e&&1==e.length&&/[\udc00-\udfff]/.test(e)}(e.charAt(t));var n}function Cu(e,t){return!!(n=e.charAt(t))&&1==n.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(n);var n}class Tu{constructor(e){this.model=e,this.version=0,this.history=new xu(this),this.selection=new nd(this),this.roots=new Qe({idProperty:"rootName"}),this.differ=new _u(e.markers),this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root","$graveyard"),this.listenTo(e,"applyOperation",(e,t)=>{const n=t[0];if(n.isDocumentOperation&&n.baseVersion!==this.version)throw new l.b("model-document-applyoperation-wrong-version",this,{operation:n})},{priority:"highest"}),this.listenTo(e,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&this.differ.bufferOperation(n)},{priority:"high"}),this.listenTo(e,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&(this.version++,this.history.addOperation(n))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(e,t,n,i)=>{this.differ.bufferMarkerChange(t.name,n,i,t.affectsData),null===n&&t.on("change",(e,n)=>{this.differ.bufferMarkerChange(t.name,n,t.getRange(),t.affectsData)})})}get graveyard(){return this.getRoot("$graveyard")}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new l.b("model-document-createroot-name-exists",this,{name:t});const n=new hu(this,e,t);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(){return Array.from(this.roots,e=>e.rootName).filter(e=>"$graveyard"!=e)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=as(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const e of this.roots)if(e!==this.graveyard)return e;return this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model,n=t.schema,i=t.createPositionFromPath(e,[0]);return n.getNearestSelectionRange(i)||t.createRange(i)}_validateSelectionRange(e){return Eu(e.start)&&Eu(e.end)}_callPostFixers(e){let t=!1;do{for(const n of this._postFixers)if(this.selection.refresh(),t=n(e),t)break}while(t)}}function Eu(e){const t=e.textNode;if(t){const n=t.data,i=e.offset-t.startOffset;return!Au(n,i)&&!Cu(n,i)}return!0}Ye(Tu,u);class Mu{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){return this._markers.has(e)}get(e){return this._markers.get(e)||null}_set(e,t,n=!1,i=!1){const o=e instanceof Pu?e.name:e;if(o.includes(","))throw new l.b("markercollection-incorrect-marker-name",this);const r=this._markers.get(o);if(r){const e=r.getRange();let s=!1;return e.isEqual(t)||(r._attachLiveRange(Ko.fromRange(t)),s=!0),n!=r.managedUsingOperations&&(r._managedUsingOperations=n,s=!0),"boolean"==typeof i&&i!=r.affectsData&&(r._affectsData=i,s=!0),s&&this.fire("update:"+o,r,e,t),r}const s=Ko.fromRange(t),a=new Pu(o,s,n,i);return this._markers.set(o,a),this.fire("update:"+o,a,null,t),a}_remove(e){const t=e instanceof Pu?e.name:e,n=this._markers.get(t);return!!n&&(this._markers.delete(t),this.fire("update:"+t,n,n.getRange(),null),this._destroyMarker(n),!0)}_refresh(e){const t=e instanceof Pu?e.name:e,n=this._markers.get(t);if(!n)throw new l.b("markercollection-refresh-marker-not-exists",this);const i=n.getRange();this.fire("update:"+t,n,i,i,n.managedUsingOperations,n.affectsData)}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)null!==t.getRange().getIntersection(e)&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}Ye(Mu,u);class Pu{constructor(e,t,n,i){this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=n,this._affectsData=i}get managedUsingOperations(){if(!this._liveRange)throw new l.b("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new l.b("marker-destroyed",this);return this._affectsData}getStart(){if(!this._liveRange)throw new l.b("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new l.b("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new l.b("marker-destroyed",this);return this._liveRange.toRange()}is(e){return"marker"===e||"model:marker"===e}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}Ye(Pu,u);class Su extends Yd{get type(){return"noop"}clone(){return new Su(this.baseVersion)}getReversed(){return new Su(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const Iu={};Iu[iu.className]=iu,Iu[su.className]=su,Iu[au.className]=au,Iu[ru.className]=ru,Iu[Su.className]=Su,Iu[Yd.className]=Yd,Iu[lu.className]=lu,Iu[cu.className]=cu,Iu[uu.className]=uu,Iu[du.className]=du;class Ou extends Wo{constructor(e,t,n="toNone"){if(super(e,t,n),!this.root.is("rootElement"))throw new l.b("model-liveposition-root-not-rootelement",e);Nu.call(this)}detach(){this.stopListening()}is(e){return"livePosition"===e||"model:livePosition"===e||"position"==e||"model:position"===e}toPosition(){return new Wo(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t||e.stickiness)}}function Nu(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&zu.call(this,n)},{priority:"low"})}function zu(e){const t=this.getTransformedByOperation(e);if(!this.isEqual(t)){const e=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",e)}}Ye(Ou,u);class Ru{constructor(e,t,n){this.model=e,this.writer=t,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(e,t){e=Array.from(e);for(let n=0;n<e.length;n++){const i=e[n];this._handleNode(i,{isFirst:0===n&&t.isFirst,isLast:n===e.length-1&&t.isLast})}this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}getSelectionRange(){return this.nodeToSelect?Jo._createOn(this.nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new Jo(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e,t){if(this.schema.isObject(e))return void this._handleObject(e,t);this._checkAndSplitToAllowedPosition(e,t)?(this._insert(e),this._mergeSiblingsOf(e,t)):this._handleDisallowedNode(e,t)}_handleObject(e,t){this._checkAndSplitToAllowedPosition(e)?this._insert(e):this._tryAutoparagraphing(e,t)}_handleDisallowedNode(e,t){e.is("element")?this.handleNodes(e.getChildren(),t):this._tryAutoparagraphing(e,t)}_insert(e){if(!this.schema.checkChild(this.position,e))throw new l.b("insertcontent-wrong-position",this,{node:e,position:this.position});const t=Ou.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this.writer.insert(e,this.position),this.position=t.toPosition(),t.detach(),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this.nodeToSelect=e:this.nodeToSelect=null,this._filterAttributesOf.push(e)}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=Ou.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=Ou.fromPosition(e,"toNext"))}_mergeSiblingsOf(e,t){if(!(e instanceof Fo))return;const n=this._canMergeLeft(e,t),i=this._canMergeRight(e,t),o=Ou._createBefore(e);o.stickiness="toNext";const r=Ou._createAfter(e);if(r.stickiness="toNext",n){const e=Ou.fromPosition(this.position);e.stickiness="toNext",this._affectedStart.isEqual(o)&&(this._affectedStart.detach(),this._affectedStart=Ou._createAt(o.nodeBefore,"end","toPrevious")),this.writer.merge(o),o.isEqual(this._affectedEnd)&&t.isLast&&(this._affectedEnd.detach(),this._affectedEnd=Ou._createAt(o.nodeBefore,"end","toNext")),this.position=e.toPosition(),e.detach()}if(i){if(!this.position.isEqual(r))throw new l.b("insertcontent-invalid-insertion-position",this);this.position=Wo._createAt(r.nodeBefore,"end");const e=Ou.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(r)&&(this._affectedEnd.detach(),this._affectedEnd=Ou._createAt(r.nodeBefore,"end","toNext")),this.writer.merge(r),r.getShiftedBy(-1).isEqual(this._affectedStart)&&t.isFirst&&(this._affectedStart.detach(),this._affectedStart=Ou._createAt(r.nodeBefore,0,"toPrevious")),this.position=e.toPosition(),e.detach()}(n||i)&&this._filterAttributesOf.push(this.position.parent),o.detach(),r.detach()}_canMergeLeft(e,t){const n=e.previousSibling;return t.isFirst&&n instanceof Fo&&this.canMergeWith.has(n)&&this.model.schema.checkMerge(n,e)}_canMergeRight(e,t){const n=e.nextSibling;return t.isLast&&n instanceof Fo&&this.canMergeWith.has(n)&&this.model.schema.checkMerge(e,n)}_tryAutoparagraphing(e,t){const n=this.writer.createElement("paragraph");this._getAllowedIn(n,this.position.parent)&&this.schema.checkChild(n,e)&&(n._appendChild(e),this._handleNode(n,t))}_checkAndSplitToAllowedPosition(e){const t=this._getAllowedIn(e,this.position.parent);if(!t)return!1;for(;t!=this.position.parent;){if(this.schema.isLimit(this.position.parent))return!1;if(this.position.isAtStart){const e=this.position.parent;this.position=this.writer.createPositionBefore(e),e.isEmpty&&e.parent===t&&this.writer.remove(e)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const e=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=e,this.canMergeWith.add(this.position.nodeAfter)}}return!0}_getAllowedIn(e,t){return this.schema.checkChild(t,e)?t:t.parent?this._getAllowedIn(e,t.parent):null}}function Lu(e,t,n={}){if(t.isCollapsed)return;const i=t.getFirstRange();if("$graveyard"==i.root.rootName)return;const o=e.schema;e.change(e=>{if(!n.doNotResetEntireContent&&function(e,t){const n=e.getLimitElement(t);if(!t.containsEntireContent(n))return!1;const i=t.getFirstRange();if(i.start.parent==i.end.parent)return!1;return e.checkChild(n,"paragraph")}(o,t))return void function(e,t){const n=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(n)),Du(e,e.createPositionAt(n,0),t)}(e,t);const[r,s]=function(e){const t=e.root.document.model,n=e.start;let i=e.end;if(t.hasContent(e,{ignoreMarkers:!0})){const n=function(e){const t=e.parent,n=t.root.document.model.schema,i=t.getAncestors({parentFirst:!0,includeSelf:!0});for(const e of i){if(n.isLimit(e))return null;if(n.isBlock(e))return e}}(i);if(n&&i.isTouching(t.createPositionAt(n,0))){const n=t.createSelection(e);t.modifySelection(n,{direction:"backward"}),i=n.getLastPosition()}}return[Ou.fromPosition(n,"toPrevious"),Ou.fromPosition(i,"toNext")]}(i);i.start.isTouching(i.end)||e.remove(i),n.leaveUnmerged||(!function(e,t,n){const i=e.model;if(!ju(e.model.schema,t,n))return;const[o,r]=function(e,t){const n=e.getAncestors(),i=t.getAncestors();let o=0;for(;n[o]&&n[o]==i[o];)o++;return[n[o],i[o]]}(t,n);!i.hasContent(o,{ignoreMarkers:!0})&&i.hasContent(r,{ignoreMarkers:!0})?function e(t,n,i,o){const r=n.parent,s=i.parent;if(r==o||s==o)return;n=t.createPositionAfter(r),(i=t.createPositionBefore(s)).isEqual(n)||t.insert(r,i);for(;n.parent.isEmpty;){const e=n.parent;n=t.createPositionBefore(e),t.remove(e)}if(i=t.createPositionBefore(s),function(e,t){const n=t.nodeBefore,i=t.nodeAfter;n.name!=i.name&&e.rename(n,i.name);e.clearAttributes(n),e.setAttributes(Object.fromEntries(i.getAttributes()),n),e.merge(t)}(t,i),!ju(t.model.schema,n,i))return;e(t,n,i,o)}(e,t,n,o.parent):function e(t,n,i,o){const r=n.parent,s=i.parent;if(r==o||s==o)return;n=t.createPositionAfter(r),(i=t.createPositionBefore(s)).isEqual(n)||t.insert(s,n);t.merge(n);for(;i.parent.isEmpty;){const e=i.parent;i=t.createPositionBefore(e),t.remove(e)}if(!ju(t.model.schema,n,i))return;e(t,n,i,o)}(e,t,n,o.parent)}(e,r,s),o.removeDisallowedAttributes(r.parent.getChildren(),e)),Bu(e,t,r),!n.doNotAutoparagraph&&function(e,t){const n=e.checkChild(t,"$text"),i=e.checkChild(t,"paragraph");return!n&&i}(o,r)&&Du(e,r,t),r.detach(),s.detach()})}function ju(e,t,n){const i=t.parent,o=n.parent;return i!=o&&(!e.isLimit(i)&&!e.isLimit(o)&&function(e,t,n){const i=new Jo(e,t);for(const e of i.getWalker())if(n.isLimit(e.item))return!1;return!0}(t,n,e))}function Du(e,t,n){const i=e.createElement("paragraph");e.insert(i,t),Bu(e,n,e.createPositionAt(i,0))}function Bu(e,t,n){t instanceof nd?e.setSelection(n):t.setTo(n)}function Vu(e,t){const{isForward:n,walker:i,unit:o,schema:r}=e,{type:s,item:a,nextPosition:l}=t;if("text"==s)return"word"===e.unit?function(e,t){let n=e.position.textNode;if(n){let i=e.position.offset-n.startOffset;for(;!Hu(n.data,i,t)&&!Uu(n,i,t);){e.next();const o=t?e.position.nodeAfter:e.position.nodeBefore;if(o&&o.is("$text")){const i=o.data.charAt(t?0:o.data.length-1);' ,.?!:;"-()'.includes(i)||(e.next(),n=e.position.textNode)}i=e.position.offset-n.startOffset}}return e.position}(i,n):function(e,t){const n=e.position.textNode;if(n){const i=n.data;let o=e.position.offset-n.startOffset;for(;Au(i,o)||"character"==t&&Cu(i,o);)e.next(),o=e.position.offset-n.startOffset}return e.position}(i,o);if(s==(n?"elementStart":"elementEnd")){if(r.isSelectable(a))return Wo._createAt(a,n?"after":"before");if(r.checkChild(l,"$text"))return l}else{if(r.isLimit(a))return void i.skip(()=>!0);if(r.checkChild(l,"$text"))return l}}function Fu(e,t){const n=e.root,i=Wo._createAt(n,t?"end":0);return t?new Jo(e,i):new Jo(i,e)}function Hu(e,t,n){const i=t+(n?0:-1);return' ,.?!:;"-()'.includes(e.charAt(i))}function Uu(e,t,n){return t===(n?e.endOffset:0)}function Wu(e,t){const n=[];Array.from(e.getItems({direction:"backward"})).map(e=>t.createRangeOn(e)).filter(t=>(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end))).forEach(e=>{n.push(e.start.parent),t.remove(e)}),n.forEach(e=>{let n=e;for(;n.parent&&n.isEmpty;){const e=t.createRangeOn(n);n=n.parent,t.remove(e)}})}function $u(e){e.document.registerPostFixer(t=>function(e,t){const n=t.document.selection,i=t.schema,o=[];let r=!1;for(const e of n.getRanges()){const t=qu(e,i);t&&!t.isEqual(e)?(o.push(t),r=!0):o.push(e)}r&&e.setSelection(function(e){const t=[];t.push(e.shift());for(const n of e){const e=t.pop();if(n.isIntersecting(e)){const i=e.start.isAfter(n.start)?n.start:e.start,o=e.end.isAfter(n.end)?e.end:n.end,r=new Jo(i,o);t.push(r)}else t.push(e),t.push(n)}return t}(o),{backward:n.isBackward})}(t,e))}function qu(e,t){return e.isCollapsed?function(e,t){const n=e.start,i=t.getNearestSelectionRange(n);if(!i)return null;if(!i.isCollapsed)return i;const o=i.start;if(n.isEqual(o))return null;return new Jo(o)}(e,t):function(e,t){const{start:n,end:i}=e,o=t.checkChild(n,"$text"),r=t.checkChild(i,"$text"),s=t.getLimitElement(n),a=t.getLimitElement(i);if(s===a){if(o&&r)return null;if(function(e,t,n){const i=e.nodeAfter&&!n.isLimit(e.nodeAfter)||n.checkChild(e,"$text"),o=t.nodeBefore&&!n.isLimit(t.nodeBefore)||n.checkChild(t,"$text");return i||o}(n,i,t)){const e=n.nodeAfter&&t.isSelectable(n.nodeAfter)?null:t.getNearestSelectionRange(n,"forward"),o=i.nodeBefore&&t.isSelectable(i.nodeBefore)?null:t.getNearestSelectionRange(i,"backward"),r=e?e.start:n,s=o?o.start:i;return new Jo(r,s)}}const l=s&&!s.is("rootElement"),c=a&&!a.is("rootElement");if(l||c){const e=n.nodeAfter&&i.nodeBefore&&n.nodeAfter.parent===i.nodeBefore.parent,o=l&&(!e||!Ju(n.nodeAfter,t)),r=c&&(!e||!Ju(i.nodeBefore,t));let d=n,u=i;return o&&(d=Wo._createBefore(Yu(s,t))),r&&(u=Wo._createAfter(Yu(a,t))),new Jo(d,u)}return null}(e,t)}function Yu(e,t){let n=e,i=n;for(;t.isLimit(i)&&i.parent;)n=i,i=i.parent;return n}function Ju(e,t){return e&&t.isSelectable(e)}class Ku{constructor(){this.markers=new Mu,this.document=new Tu(this),this.schema=new Md,this._pendingChanges=[],this._currentWriter=null,["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(e=>this.decorate(e)),this.on("applyOperation",(e,t)=>{t[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$block",{allowIn:"$root",isBlock:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",isLimit:!0}),this.schema.extend("$text",{allowIn:"$clipboardHolder"}),this.schema.register("$marker"),this.schema.addChildCheck((e,t)=>{if("$marker"===t.name)return!0}),$u(this),this.document.registerPostFixer(gd)}change(e){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new qd,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(e){l.b.rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{"string"==typeof e?e=new qd(e):"function"==typeof e&&(t=e,e=new qd),this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(e){l.b.rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,n){return function(e,t,n,i){return e.change(o=>{let r;r=n?n instanceof Gc||n instanceof nd?n:o.createSelection(n,i):e.document.selection,r.isCollapsed||e.deleteContent(r,{doNotAutoparagraph:!0});const s=new Ru(e,o,r.anchor);let a;a=t.is("documentFragment")?t.getChildren():[t],s.handleNodes(a,{isFirst:!0,isLast:!0});const l=s.getSelectionRange();l&&(r instanceof nd?o.setSelection(l):r.setTo(l));const c=s.getAffectedRange()||e.createRange(r.anchor);return s.destroy(),c})}(this,e,t,n)}deleteContent(e,t){Lu(this,e,t)}modifySelection(e,t){!function(e,t,n={}){const i=e.schema,o="backward"!=n.direction,r=n.unit?n.unit:"character",s=t.focus,a=new Ho({boundaries:Fu(s,o),singleCharacters:!0,direction:o?"forward":"backward"}),l={walker:a,schema:i,isForward:o,unit:r};let c;for(;c=a.next();){if(c.done)return;const n=Vu(l,c.value);if(n)return void(t instanceof nd?e.change(e=>{e.setSelectionFocus(n)}):t.setFocus(n))}}(this,e,t)}getSelectedContent(e){return function(e,t){return e.change(e=>{const n=e.createDocumentFragment(),i=t.getFirstRange();if(!i||i.isCollapsed)return n;const o=i.start.root,r=i.start.getCommonPath(i.end),s=o.getNodeByPath(r);let a;a=i.start.parent==i.end.parent?i:e.createRange(e.createPositionAt(s,i.start.path[r.length]),e.createPositionAt(s,i.end.path[r.length]+1));const l=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:!0}))t.is("$textProxy")?e.appendText(t.data,t.getAttributes(),n):e.append(e.cloneElement(t,!0),n);if(a!=i){const t=i._getTransformedByMove(a.start,e.createPositionAt(n,0),l)[0],o=e.createRange(e.createPositionAt(n,0),t.start);Wu(e.createRange(t.end,e.createPositionAt(n,"end")),e),Wu(o,e)}return n})}(this,e)}hasContent(e,t={}){const n=e instanceof Fo?Jo._createIn(e):e;if(n.isCollapsed)return!1;const{ignoreWhitespaces:i=!1,ignoreMarkers:o=!1}=t;if(!o)for(const e of this.markers.getMarkersIntersectingRange(n))if(e.affectsData)return!0;for(const e of n.getItems())if(this.schema.isContent(e)){if(!e.is("$textProxy"))return!0;if(!i)return!0;if(-1!==e.data.search(/\S/))return!0}return!1}createPositionFromPath(e,t,n){return new Wo(e,t,n)}createPositionAt(e,t){return Wo._createAt(e,t)}createPositionAfter(e){return Wo._createAfter(e)}createPositionBefore(e){return Wo._createBefore(e)}createRange(e,t){return new Jo(e,t)}createRangeIn(e){return Jo._createIn(e)}createRangeOn(e){return Jo._createOn(e)}createSelection(e,t,n){return new Gc(e,t,n)}createBatch(e){return new qd(e)}createOperationFromJSON(e){return class{static fromJSON(e,t){return Iu[e.__className].fromJSON(e,t)}}.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){const t=this._pendingChanges[0].batch;this._currentWriter=new mu(this,t);const n=this._pendingChanges[0].callback(this._currentWriter);e.push(n),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),e}}Ye(Ku,Fe);class Xu extends Ui{constructor(e){super(),this.editor=e}set(e,t,n={}){if("string"==typeof t){const e=t;t=(t,n)=>{this.editor.execute(e),n()}}super.set(e,t,n)}}class Gu{constructor(e={}){this._context=e.context||new Al({language:e.language}),this._context._addEditor(this,!e.context);const t=Array.from(this.constructor.builtinPlugins||[]);this.config=new fl(e,this.constructor.defaultConfig),this.config.define("plugins",t),this.config.define(this._context._getEditorConfig()),this.plugins=new _l(this,t,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new Cd,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 Ku;const n=new Ys;this.data=new Hd(this.model,n),this.editing=new Ad(this.model,n),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new Ud([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 Xu(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const e=this.config,t=e.get("plugins"),n=e.get("removePlugins")||[],i=e.get("extraPlugins")||[];return this.plugins.init(t.concat(i),n)}destroy(){let e=Promise.resolve();return"initializing"==this.state&&(e=new Promise(e=>this.once("ready",e))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(...e){try{return this.commands.execute(...e)}catch(e){l.b.rethrowUnexpectedError(e,this)}}}Ye(Gu,Fe);var Qu={setData(e){this.data.set(e)},getData(e){return this.data.get(e)}};var Zu={updateSourceElement(){if(!this.sourceElement)throw new l.b("editor-missing-sourceelement",this);var e,t;e=this.sourceElement,t=this.data.get(),e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}};class eh{constructor(e){this.editor=e,this._components=new Map}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(th(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new l.b("componentfactory-item-missing",this,{name:e});return this._components.get(th(e)).callback(this.editor.locale)}has(e){return this._components.has(th(e))}}function th(e){return String(e).toLowerCase()}class nh{constructor(e){this.editor=e,this.componentFactory=new eh(e),this.focusTracker=new mo,this._editableElementsMap=new Map,this.listenTo(e.editing.view.document,"layoutChanged",()=>this.update())}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null;this._editableElementsMap=new Map}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}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}}Ye(nh,u);n(39);const ih=new WeakMap;function oh(e){const{view:t,element:n,text:i,isDirectHost:o=!0}=e,r=t.document;ih.has(r)||(ih.set(r,new Map),r.registerPostFixer(e=>sh(r,e))),ih.get(r).set(n,{text:i,isDirectHost:o}),t.change(e=>sh(r,e))}function rh(e,t){return!!t.hasClass("ck-placeholder")&&(e.removeClass("ck-placeholder",t),!0)}function sh(e,t){const n=ih.get(e);let i=!1;for(const[e,o]of n)ah(t,e,o)&&(i=!0);return i}function ah(e,t,n){const{text:i,isDirectHost:o}=n,r=o?t:function(e){if(1===e.childCount){const t=e.getChild(0);if(t.is("element")&&!t.is("uiElement"))return t}return null}(t);let s=!1;return!!r&&(n.hostElement=r,r.getAttribute("data-placeholder")!==i&&(e.setAttribute("data-placeholder",i,r),s=!0),!function(e){if(!e.isAttached())return!1;const t=!Array.from(e.getChildren()).some(e=>!e.is("uiElement")),n=e.document;if(!n.isFocused&&t)return!0;const i=n.selection.anchor;return!(!t||!i||i.parent===e)}(r)?rh(e,r)&&(s=!0):function(e,t){return!t.hasClass("ck-placeholder")&&(e.addClass("ck-placeholder",t),!0)}(e,r)&&(s=!0),s)}class lh{constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t}),e.style.display="none",t&&e.parentNode.insertBefore(t,e.nextSibling)}restore(){this._replacedElements.forEach(({element:e,newElement:t})=>{e.style.display="",t&&t.remove()}),this._replacedElements=[]}}class ch extends nh{constructor(e,t){var n;super(e),this.view=t,this._toolbarConfig=(n=e.config.get("toolbar"),Array.isArray(n)?{items:n}:n?Object.assign({items:[]},n):{items:[]}),this._elementReplacer=new lh}get element(){return this.view.element}init(e){const t=this.editor,n=this.view,i=t.editing.view,o=n.editable,r=i.document.getRoot();o.name=r.rootName,n.render();const s=o.element;this.setEditableElement(o.name,s),this.focusTracker.add(s),n.editable.bind("isFocused").to(this.focusTracker),i.attachDomRoot(s),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const e=this.view,t=this.editor.editing.view;this._elementReplacer.restore(),t.detachDomRoot(e.editable.name),e.destroy(),super.destroy()}_initToolbar(){const e=this.editor,t=this.view,n=e.editing.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,this._toolbarConfig.viewportTopOffset&&(t.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset),t.toolbar.fillFromConfig(this._toolbarConfig.items,this.componentFactory),function({origin:e,originKeystrokeHandler:t,originFocusTracker:n,toolbar:i,beforeFocus:o,afterBlur:r}){n.add(i.element),t.set("Alt+F10",(e,t)=>{n.isFocused&&!i.focusTracker.isFocused&&(o&&o(),i.focus(),t())}),i.keystrokes.set("Esc",(t,n)=>{i.focusTracker.isFocused&&(e.focus(),r&&r(),n())})}({origin:n,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:t.toolbar})}_initPlaceholder(){const e=this.editor,t=e.editing.view,n=t.document.getRoot(),i=e.sourceElement,o=e.config.get("placeholder")||i&&"textarea"===i.tagName.toLowerCase()&&i.getAttribute("placeholder");o&&oh({view:t,element:n,text:o,isDirectHost:!1})}}var dh=function(e){return"string"==typeof e||!ke(e)&&ge(e)&&"[object String]"==P(e)};class uh extends gt{constructor(e,t=[]){super(t),this.locale=e}attachToDom(){this._bodyCollectionContainer=new ii({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let e=document.querySelector(".ck-body-wrapper");e||(e=function(e,t,n={},i=[]){const o=n&&n.xmlns,r=o?e.createElementNS(o,t):e.createElement(t);for(const e in n)r.setAttribute(e,n[e]);!dh(i)&&Ge(i)||(i=[i]);for(let t of i)dh(t)&&(t=e.createTextNode(t)),r.appendChild(t);return r}(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(e)),e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const e=document.querySelector(".ck-body-wrapper");e&&0==e.childElementCount&&e.remove()}}n(41);class hh extends Ti{constructor(e){super(e),this.body=new uh(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}n(43);class mh extends Ti{constructor(e){super(e),this.set("text"),this.set("for"),this.id="ck-editor__label_"+s();const t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}}class gh extends hh{constructor(e){super(e),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:e.uiLanguageDirection,lang:e.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 e=this.t,t=new mh;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class ph extends Ti{constructor(e,t,n){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=n,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const e=this._editingView;function t(t){e.change(n=>{const i=e.document.getRoot(t.name);n.addClass(t.isFocused?"ck-focused":"ck-blurred",i),n.removeClass(t.isFocused?"ck-blurred":"ck-focused",i)})}e.isRenderingInProgress?function n(i){e.once("change:isRenderingInProgress",(e,o,r)=>{r?n(i):t(i)})}(this):t(this)}}class fh extends ph{constructor(e,t,n){super(e,t,n),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView,t=this.t;e.change(n=>{const i=e.document.getRoot(this.name);n.setAttribute("aria-label",t("Rich Text Editor, %0",[this.name]),i)})}}n(45);const wh=fr("px");class bh extends Ti{constructor(e){super(e);const t=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new ii({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",e=>e?"block":"none"),height:t.to("isSticky",e=>e?wh(this._panelRect.height):null)}}}).render(),this._contentPanel=new ii({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",e=>e?wh(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_hasViewportTopOffset",e=>e?wh(this.viewportTopOffset):null),bottom:t.to("_isStickyToTheLimiter",e=>e?wh(this.limiterBottomOffset):null),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render(),this._checkIfShouldBeSticky(),this.listenTo(Wi.window,"scroll",()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const e=this._panelRect=this._contentPanel.getBoundingClientRect();let t;this.limiterElement?(t=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&t.top<this.viewportTopOffset&&this._panelRect.height+this.limiterBottomOffset<t.height):this.isSticky=!1,this.isSticky?(this._isStickyToTheLimiter=t.bottom<e.height+this.limiterBottomOffset+this.viewportTopOffset,this._hasViewportTopOffset=!this._isStickyToTheLimiter&&!!this.viewportTopOffset,this._marginLeft=this._isStickyToTheLimiter?null:wh(-Wi.window.scrollX)):(this._isStickyToTheLimiter=!1,this._hasViewportTopOffset=!1,this._marginLeft=null)}}n(47);class _h extends gh{constructor(e,t,n={}){super(e),this.stickyPanel=new bh(e),this.toolbar=new _o(e,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull}),this.editable=new fh(e,t)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class kh extends Gu{constructor(e,t){super(t),eo(e)&&(this.sourceElement=e),this.data.processor=new za(this.data.viewDocument),this.model.document.createRoot();const n=!this.config.get("toolbar.shouldNotGroupWhenFull"),i=new _h(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:n});this.ui=new ch(this,i),function(e){if(!I(e.updateSourceElement))throw new l.b("attachtoform-missing-elementapi-interface",e);const t=e.sourceElement;if(t&&"textarea"===t.tagName.toLowerCase()&&t.form){let n;const i=t.form,o=()=>e.updateSourceElement();I(i.submit)&&(n=i.submit,i.submit=()=>{o(),n.apply(i)}),i.addEventListener("submit",o),e.on("destroy",()=>{i.removeEventListener("submit",o),n&&(i.submit=n)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,t={}){return new Promise(n=>{const i=new this(e,t);n(i.initPlugins().then(()=>i.ui.init(eo(e)?e:null)).then(()=>{if(!eo(e)&&t.initialData)throw new l.b("editor-create-initial-data",null);const n=t.initialData||function(e){return eo(e)?(t=e,t instanceof HTMLTextAreaElement?t.value:t.innerHTML):e;var t}(e);return i.data.init(n)}).then(()=>i.fire("ready")).then(()=>i))})}}function*vh(e,t){for(const n of t)n&&e.getAttributeProperties(n[0]).copyOnEnter&&(yield n)}Ye(kh,Qu),Ye(kh,Zu);class yh extends st{execute(){const e=this.editor.model,t=e.document;e.change(n=>{!function(e,t,n,i){const o=n.isCollapsed,r=n.getFirstRange(),s=r.start.parent,a=r.end.parent;if(i.isLimit(s)||i.isLimit(a))return void(o||s!=a||e.deleteContent(n));if(o){const e=vh(t.model.schema,n.getAttributes());xh(t,r.start),t.setSelectionAttribute(e)}else{const i=!(r.start.isAtStart&&r.end.isAtEnd),o=s==a;e.deleteContent(n,{leaveUnmerged:i}),i&&(o?xh(t,n.focus):t.setSelection(a,0))}}(this.editor.model,n,t.selection,e.schema),this.fire("afterExecute",{writer:n})})}}function xh(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}class Ah extends dr{constructor(e){super(e);const t=this.document;t.on("keydown",(e,n)=>{if(this.isEnabled&&n.keyCode==Ni.enter){let i;t.once("enter",e=>i=e,{priority:"highest"}),t.fire("enter",new Ur(t,n.domEvent,{isSoft:n.shiftKey})),i&&i.stop.called&&e.stop()}})}observe(){}}class Ch extends Je{static get pluginName(){return"Enter"}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(Ah),e.commands.add("enter",new yh(e)),this.listenTo(n,"enter",(n,i)=>{i.preventDefault(),i.isSoft||(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"})}}class Th extends st{execute(){const e=this.editor.model,t=e.document;e.change(n=>{!function(e,t,n){const i=n.isCollapsed,o=n.getFirstRange(),r=o.start.parent,s=o.end.parent,a=r==s;if(i){const i=vh(e.schema,n.getAttributes());Eh(e,t,o.end),t.removeSelectionAttribute(n.getAttributeKeys()),t.setSelectionAttribute(i)}else{const i=!(o.start.isAtStart&&o.end.isAtEnd);e.deleteContent(n,{leaveUnmerged:i}),a?Eh(e,t,n.focus):i&&t.setSelection(s,0)}}(e,n,t.selection),this.fire("afterExecute",{writer:n})})}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(e,t){if(t.rangeCount>1)return!1;const n=t.anchor;if(!n||!e.checkChild(n,"softBreak"))return!1;const i=t.getFirstRange(),o=i.start.parent,r=i.end.parent;if((Mh(o,e)||Mh(r,e))&&o!==r)return!1;return!0}(e.schema,t.selection)}}function Eh(e,t,n){const i=t.createElement("softBreak");e.insertContent(i,n),t.setSelection(i,"after")}function Mh(e,t){return!e.is("rootElement")&&(t.isLimit(e)||Mh(e.parent,t))}class Ph extends Je{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor,t=e.model.schema,n=e.conversion,i=e.editing.view,o=i.document;t.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(e,{writer:t})=>t.createEmptyElement("br")}),i.addObserver(Ah),e.commands.add("shiftEnter",new Th(e)),this.listenTo(o,"enter",(t,n)=>{n.preventDefault(),n.isSoft&&(e.execute("shiftEnter"),i.scrollToTheSelection())},{priority:"low"})}}class Sh extends st{execute(){const e=this.editor.model,t=e.document.selection;let n=e.schema.getLimitElement(t);if(t.containsEntireContent(n)||!Ih(e.schema,n))do{if(n=n.parent,!n)return}while(!Ih(e.schema,n));e.change(e=>{e.setSelection(n,"in")})}}function Ih(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const Oh=Ri("Ctrl+A");class Nh extends Je{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,t=e.editing.view.document;e.commands.add("selectAll",new Sh(e)),this.listenTo(t,"keydown",(t,n)=>{zi(n)===Oh&&(e.execute("selectAll"),n.preventDefault())})}}class zh extends Je{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",t=>{const n=e.commands.get("selectAll"),i=new Fi(t),o=t.t;return i.set({label:o("Select all"),icon:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M.75 15.5a.75.75 0 0 1 .75.75V18l.008.09A.5.5 0 0 0 2 18.5h1.75a.75.75 0 1 1 0 1.5H1.5l-.144-.007a1.5 1.5 0 0 1-1.35-1.349L0 18.5v-2.25a.75.75 0 0 1 .75-.75zm18.5 0a.75.75 0 0 1 .75.75v2.25l-.007.144a1.5 1.5 0 0 1-1.349 1.35L18.5 20h-2.25a.75.75 0 1 1 0-1.5H18a.5.5 0 0 0 .492-.41L18.5 18v-1.75a.75.75 0 0 1 .75-.75zm-10.45 3c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm.45-5.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5h8.5zM1.3 11c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM1.3 7c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5h-2.5a.75.75 0 1 1 0-1.5h2.5zm-5 0a.75.75 0 1 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5h5.5zm-6.5-5a.75.75 0 0 1 0 1.5H2a.5.5 0 0 0-.492.41L1.5 2v1.75a.75.75 0 0 1-1.5 0V1.5l.007-.144A1.5 1.5 0 0 1 1.356.006L1.5 0h2.25zM18.5 0l.144.007a1.5 1.5 0 0 1 1.35 1.349L20 1.5v2.25a.75.75 0 1 1-1.5 0V2l-.008-.09A.5.5 0 0 0 18 1.5h-1.75a.75.75 0 1 1 0-1.5h2.25zM8.8 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6z"/></svg>',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(i,"execute",()=>{e.execute("selectAll"),e.editing.view.focus()}),i})}}class Rh extends Je{static get requires(){return[Nh,zh]}static get pluginName(){return"SelectAll"}}class Lh extends st{constructor(e,t){super(e),this.direction=t,this._buffer=new Zr(e.model,e.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,n=t.document;t.enqueueChange(this._buffer.batch,i=>{this._buffer.lock();const o=i.createSelection(e.selection||n.selection),r=o.isCollapsed;if(o.isCollapsed&&t.modifySelection(o,{direction:this.direction,unit:e.unit}),this._shouldEntireContentBeReplacedWithParagraph(e.sequence||1))return void this._replaceEntireContentWithParagraph(i);if(o.isCollapsed)return;let s=0;o.getFirstRange().getMinimalFlatRanges().forEach(e=>{s+=ra(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(o,{doNotResetEntireContent:r,direction:this.direction}),this._buffer.input(s),i.setSelection(o),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,n=t.document.selection,i=t.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(i)))return!1;if(!t.schema.checkChild(i,"paragraph"))return!1;const o=i.getChild(0);return!o||"paragraph"!==o.name}_replaceEntireContentWithParagraph(e){const t=this.editor.model,n=t.document.selection,i=t.schema.getLimitElement(n),o=e.createElement("paragraph");e.remove(e.createRangeIn(i)),e.insert(o,i),e.setSelection(o,0)}}class jh extends dr{constructor(e){super(e);const t=e.document;let n=0;function i(e,n,i){let o;t.once("delete",e=>o=e,{priority:Number.POSITIVE_INFINITY}),t.fire("delete",new Ur(t,n,i)),o&&o.stop.called&&e.stop()}t.on("keyup",(e,t)=>{t.keyCode!=Ni.delete&&t.keyCode!=Ni.backspace||(n=0)}),t.on("keydown",(e,t)=>{const o={};if(t.keyCode==Ni.delete)o.direction="forward",o.unit="character";else{if(t.keyCode!=Ni.backspace)return;o.direction="backward",o.unit="codePoint"}const r=Si.isMac?t.altKey:t.ctrlKey;o.unit=r?"word":o.unit,o.sequence=++n,i(e,t.domEvent,o)}),Si.isAndroid&&t.on("beforeinput",(t,n)=>{if("deleteContentBackward"!=n.domEvent.inputType)return;const o={unit:"codepoint",direction:"backward",sequence:1},r=n.domTarget.ownerDocument.defaultView.getSelection();r.anchorNode==r.focusNode&&r.anchorOffset+1!=r.focusOffset&&(o.selectionToRemove=e.domConverter.domSelectionToView(r)),i(t,n.domEvent,o)})}observe(){}}class Dh extends Je{static get pluginName(){return"Delete"}init(){const e=this.editor,t=e.editing.view,n=t.document;if(t.addObserver(jh),e.commands.add("forwardDelete",new Lh(e,"forward")),e.commands.add("delete",new Lh(e,"backward")),this.listenTo(n,"delete",(n,i)=>{const o={unit:i.unit,sequence:i.sequence};if(i.selectionToRemove){const t=e.model.createSelection(),n=[];for(const t of i.selectionToRemove.getRanges())n.push(e.editing.mapper.toModelRange(t));t.setTo(n),o.selection=t}e.execute("forward"==i.direction?"forwardDelete":"delete",o),i.preventDefault(),t.scrollToTheSelection()}),Si.isAndroid){let e=null;this.listenTo(n,"delete",(t,n)=>{const i=n.domTarget.ownerDocument.defaultView.getSelection();e={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}},{priority:"lowest"}),this.listenTo(n,"keyup",(t,n)=>{if(e){const t=n.domTarget.ownerDocument.defaultView.getSelection();t.collapse(e.anchorNode,e.anchorOffset),t.extend(e.focusNode,e.focusOffset),e=null}})}}}class Bh extends Je{static get requires(){return[Ma,Dh]}static get pluginName(){return"Typing"}}const Vh=new Map;function Fh(e,t,n){let i=Vh.get(e);i||(i=new Map,Vh.set(e,i)),i.set(t,n)}function Hh(e){return[e]}function Uh(e,t,n={}){const i=function(e,t){const n=Vh.get(e);return n&&n.has(t)?n.get(t):Hh}(e.constructor,t.constructor);try{return i(e=e.clone(),t,n)}catch(e){throw e}}function Wh(e,t,n){e=e.slice(),t=t.slice();const i=new $h(n.document,n.useRelations,n.forceWeakRemove);i.setOriginalOperations(e),i.setOriginalOperations(t);const o=i.originalOperations;if(0==e.length||0==t.length)return{operationsA:e,operationsB:t,originalOperations:o};const r=new WeakMap;for(const t of e)r.set(t,0);const s={nextBaseVersionA:e[e.length-1].baseVersion+1,nextBaseVersionB:t[t.length-1].baseVersion+1,originalOperationsACount:e.length,originalOperationsBCount:t.length};let a=0;for(;a<e.length;){const n=e[a],o=r.get(n);if(o==t.length){a++;continue}const s=t[o],l=Uh(n,s,i.getContext(n,s,!0)),c=Uh(s,n,i.getContext(s,n,!1));i.updateRelation(n,s),i.setOriginalOperations(l,n),i.setOriginalOperations(c,s);for(const e of l)r.set(e,o+c.length);e.splice(a,1,...l),t.splice(o,1,...c)}if(n.padWithNoOps){const n=e.length-s.originalOperationsACount,i=t.length-s.originalOperationsBCount;Yh(e,i-n),Yh(t,n-i)}return qh(e,s.nextBaseVersionB),qh(t,s.nextBaseVersionA),{operationsA:e,operationsB:t,originalOperations:o}}class $h{constructor(e,t,n=!1){this.originalOperations=new Map,this._history=e.history,this._useRelations=t,this._forceWeakRemove=!!n,this._relations=new Map}setOriginalOperations(e,t=null){const n=t?this.originalOperations.get(t):null;for(const t of e)this.originalOperations.set(t,n||t)}updateRelation(e,t){switch(e.constructor){case ru:switch(t.constructor){case du:e.targetPosition.isEqual(t.sourcePosition)||t.movedRange.containsPosition(e.targetPosition)?this._setRelation(e,t,"insertAtSource"):e.targetPosition.isEqual(t.deletionPosition)?this._setRelation(e,t,"insertBetween"):e.targetPosition.isAfter(t.sourcePosition)&&this._setRelation(e,t,"moveTargetAfter");break;case ru:e.targetPosition.isEqual(t.sourcePosition)||e.targetPosition.isBefore(t.sourcePosition)?this._setRelation(e,t,"insertBefore"):this._setRelation(e,t,"insertAfter")}break;case uu:switch(t.constructor){case du:e.splitPosition.isBefore(t.sourcePosition)&&this._setRelation(e,t,"splitBefore");break;case ru:(e.splitPosition.isEqual(t.sourcePosition)||e.splitPosition.isBefore(t.sourcePosition))&&this._setRelation(e,t,"splitBefore")}break;case du:switch(t.constructor){case du:e.targetPosition.isEqual(t.sourcePosition)||this._setRelation(e,t,"mergeTargetNotMoved"),e.sourcePosition.isEqual(t.targetPosition)&&this._setRelation(e,t,"mergeSourceNotMoved"),e.sourcePosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeSameElement");break;case uu:e.sourcePosition.isEqual(t.splitPosition)&&this._setRelation(e,t,"splitAtSource")}break;case au:{const n=e.newRange;if(!n)return;switch(t.constructor){case ru:{const i=Jo._createFromPositionAndShift(t.sourcePosition,t.howMany),o=i.containsPosition(n.start)||i.start.isEqual(n.start),r=i.containsPosition(n.end)||i.end.isEqual(n.end);!o&&!r||i.containsRange(n)||this._setRelation(e,t,{side:o?"left":"right",path:o?n.start.path.slice():n.end.path.slice()});break}case du:{const i=n.start.isEqual(t.targetPosition),o=n.start.isEqual(t.deletionPosition),r=n.end.isEqual(t.deletionPosition),s=n.end.isEqual(t.sourcePosition);(i||o||r||s)&&this._setRelation(e,t,{wasInLeftElement:i,wasStartBeforeMergedElement:o,wasEndBeforeMergedElement:r,wasInRightElement:s});break}}break}}}getContext(e,t,n){return{aIsStrong:n,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(e){const t=this.originalOperations.get(e);return t.wasUndone||this._history.isUndoneOperation(t)}_getRelation(e,t){const n=this.originalOperations.get(t),i=this._history.getUndoneOperation(n);if(!i)return null;const o=this.originalOperations.get(e),r=this._relations.get(o);return r&&r.get(i)||null}_setRelation(e,t,n){const i=this.originalOperations.get(e),o=this.originalOperations.get(t);let r=this._relations.get(i);r||(r=new Map,this._relations.set(i,r)),r.set(o,n)}}function qh(e,t){for(const n of e)n.baseVersion=t++}function Yh(e,t){for(let n=0;n<t;n++)e.push(new Su(0))}function Jh(e,t,n){const i=e.nodes.getNode(0).getAttribute(t);if(i==n)return null;const o=new Jo(e.position,e.position.getShiftedBy(e.howMany));return new iu(o,t,i,n,0)}function Kh(e,t){return null===e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany)}function Xh(e,t){const n=[];for(let i=0;i<e.length;i++){const o=e[i],r=new ru(o.start,o.end.offset-o.start.offset,t,0);n.push(r);for(let t=i+1;t<e.length;t++)e[t]=e[t]._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)[0];t=t._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)}return n}Fh(iu,iu,(e,t,n)=>{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){const i=e.range.getDifference(t.range).map(t=>new iu(t,e.key,e.oldValue,e.newValue,0)),o=e.range.getIntersection(t.range);return o&&n.aIsStrong&&i.push(new iu(o,t.key,t.newValue,e.newValue,0)),0==i.length?[new Su(0)]:i}return[e]}),Fh(iu,su,(e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const n=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map(t=>new iu(t,e.key,e.oldValue,e.newValue,e.baseVersion));if(t.shouldReceiveAttributes){const i=Jh(t,e.key,e.oldValue);i&&n.unshift(i)}return n}return e.range=e.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[e]}),Fh(iu,du,(e,t)=>{const n=[];e.range.start.hasSameParentAs(t.deletionPosition)&&(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition))&&n.push(Jo._createFromPositionAndShift(t.graveyardPosition,1));const i=e.range._getTransformedByMergeOperation(t);return i.isCollapsed||n.push(i),n.map(t=>new iu(t,e.key,e.oldValue,e.newValue,e.baseVersion))}),Fh(iu,ru,(e,t)=>function(e,t){const n=Jo._createFromPositionAndShift(t.sourcePosition,t.howMany);let i=null,o=[];n.containsRange(e,!0)?i=e:e.start.hasSameParentAs(n.start)?(o=e.getDifference(n),i=e.getIntersection(n)):o=[e];const r=[];for(let e of o){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const n=t.getMovedRangeStart(),i=e.start.hasSameParentAs(n);e=e._getTransformedByInsertion(n,t.howMany,i),r.push(...e)}i&&r.push(i._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]);return r}(e.range,t).map(t=>new iu(t,e.key,e.oldValue,e.newValue,e.baseVersion))),Fh(iu,uu,(e,t)=>{if(e.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.range.end.offset++,[e];if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const n=e.clone();return n.range=new Jo(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),e.range.end=t.splitPosition.clone(),e.range.end.stickiness="toPrevious",[e,n]}return e.range=e.range._getTransformedBySplitOperation(t),[e]}),Fh(su,iu,(e,t)=>{const n=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const i=Jh(e,t.key,t.newValue);i&&n.push(i)}return n}),Fh(su,su,(e,t,n)=>(e.position.isEqual(t.position)&&n.aIsStrong||(e.position=e.position._getTransformedByInsertOperation(t)),[e])),Fh(su,ru,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e])),Fh(su,uu,(e,t)=>(e.position=e.position._getTransformedBySplitOperation(t),[e])),Fh(su,du,(e,t)=>(e.position=e.position._getTransformedByMergeOperation(t),[e])),Fh(au,su,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]),e.newRange&&(e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]),[e])),Fh(au,au,(e,t,n)=>{if(e.name==t.name){if(!n.aIsStrong)return[new Su(0)];e.oldRange=t.newRange?t.newRange.clone():null}return[e]}),Fh(au,du,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByMergeOperation(t)),e.newRange&&(e.newRange=e.newRange._getTransformedByMergeOperation(t)),[e])),Fh(au,ru,(e,t,n)=>{if(e.oldRange&&(e.oldRange=Jo._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))),e.newRange){if(n.abRelation){const i=Jo._createFromRanges(e.newRange._getTransformedByMoveOperation(t));if("left"==n.abRelation.side&&t.targetPosition.isEqual(e.newRange.start))return e.newRange.start.path=n.abRelation.path,e.newRange.end=i.end,[e];if("right"==n.abRelation.side&&t.targetPosition.isEqual(e.newRange.end))return e.newRange.start=i.start,e.newRange.end.path=n.abRelation.path,[e]}e.newRange=Jo._createFromRanges(e.newRange._getTransformedByMoveOperation(t))}return[e]}),Fh(au,uu,(e,t,n)=>{if(e.oldRange&&(e.oldRange=e.oldRange._getTransformedBySplitOperation(t)),e.newRange){if(n.abRelation){const i=e.newRange._getTransformedBySplitOperation(t);return e.newRange.start.isEqual(t.splitPosition)&&n.abRelation.wasStartBeforeMergedElement?e.newRange.start=Wo._createAt(t.insertionPosition):e.newRange.start.isEqual(t.splitPosition)&&!n.abRelation.wasInLeftElement&&(e.newRange.start=Wo._createAt(t.moveTargetPosition)),e.newRange.end.isEqual(t.splitPosition)&&n.abRelation.wasInRightElement?e.newRange.end=Wo._createAt(t.moveTargetPosition):e.newRange.end.isEqual(t.splitPosition)&&n.abRelation.wasEndBeforeMergedElement?e.newRange.end=Wo._createAt(t.insertionPosition):e.newRange.end=i.end,[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]}),Fh(du,su,(e,t)=>(e.sourcePosition.hasSameParentAs(t.position)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t),e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t),[e])),Fh(du,du,(e,t,n)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(n.bWasUndone){const n=t.graveyardPosition.path.slice();return n.push(0),e.sourcePosition=new Wo(t.graveyardPosition.root,n),e.howMany=0,[e]}return[new Su(0)]}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!n.bWasUndone&&"splitAtSource"!=n.abRelation){const i="$graveyard"==e.targetPosition.root.rootName,o="$graveyard"==t.targetPosition.root.rootName,r=i&&!o;if(o&&!i||!r&&n.aIsStrong){const n=t.targetPosition._getTransformedByMergeOperation(t),i=e.targetPosition._getTransformedByMergeOperation(t);return[new ru(n,e.howMany,i,0)]}return[new Su(0)]}return e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),e.graveyardPosition.isEqual(t.graveyardPosition)&&n.aIsStrong||(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]}),Fh(du,ru,(e,t,n)=>{const i=Jo._createFromPositionAndShift(t.sourcePosition,t.howMany);return"remove"==t.type&&!n.bWasUndone&&!n.forceWeakRemove&&e.deletionPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.sourcePosition)?[new Su(0)]:(e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition.hasSameParentAs(t.sourcePosition)&&(e.howMany-=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t),e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t),e.graveyardPosition.isEqual(t.targetPosition)||(e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)),[e])}),Fh(du,uu,(e,t,n)=>{if(t.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),e.deletionPosition.isEqual(t.graveyardPosition)&&(e.howMany=t.howMany)),e.targetPosition.isEqual(t.splitPosition)){const i=0!=t.howMany,o=t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition);if(i||o||"mergeTargetNotMoved"==n.abRelation)return e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),[e]}if(e.sourcePosition.isEqual(t.splitPosition)){if("mergeSourceNotMoved"==n.abRelation)return e.howMany=0,e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e];if("mergeSameElement"==n.abRelation||e.sourcePosition.offset>0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}),Fh(ru,su,(e,t)=>{const n=Jo._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=n.start,e.howMany=n.end.offset-n.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]}),Fh(ru,ru,(e,t,n)=>{const i=Jo._createFromPositionAndShift(e.sourcePosition,e.howMany),o=Jo._createFromPositionAndShift(t.sourcePosition,t.howMany);let r,s=n.aIsStrong,a=!n.aIsStrong;if("insertBefore"==n.abRelation||"insertAfter"==n.baRelation?a=!0:"insertAfter"!=n.abRelation&&"insertBefore"!=n.baRelation||(a=!1),r=e.targetPosition.isEqual(t.targetPosition)&&a?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Kh(e,t)&&Kh(t,e))return[t.getReversed()];if(i.containsPosition(t.targetPosition)&&i.containsRange(o,!0))return i.start=i.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),i.end=i.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Xh([i],r);if(o.containsPosition(e.targetPosition)&&o.containsRange(i,!0))return i.start=i.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),i.end=i.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),Xh([i],r);const l=Lo(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return i.start=i.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),i.end=i.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Xh([i],r);"remove"!=e.type||"remove"==t.type||n.aWasUndone||n.forceWeakRemove?"remove"==e.type||"remove"!=t.type||n.bWasUndone||n.forceWeakRemove||(s=!1):s=!0;const c=[],d=i.getDifference(o);for(const e of d){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany),e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const n="same"==Lo(e.start.getParentPath(),t.getMovedRangeStart().getParentPath()),i=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,n);c.push(...i)}const u=i.getIntersection(o);return null!==u&&s&&(u.start=u.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),u.end=u.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===c.length?c.push(u):1==c.length?o.start.isBefore(i.start)||o.start.isEqual(i.start)?c.unshift(u):c.push(u):c.splice(1,0,u)),0===c.length?[new Su(e.baseVersion)]:Xh(c,r)}),Fh(ru,uu,(e,t,n)=>{let i=e.targetPosition.clone();e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=n.abRelation||(i=e.targetPosition._getTransformedBySplitOperation(t));const o=Jo._createFromPositionAndShift(e.sourcePosition,e.howMany);if(o.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.howMany++,e.targetPosition=i,[e];if(o.start.hasSameParentAs(t.splitPosition)&&o.containsPosition(t.splitPosition)){let e=new Jo(t.splitPosition,o.end);e=e._getTransformedBySplitOperation(t);return Xh([new Jo(o.start,t.splitPosition),e],i)}e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==n.abRelation&&(i=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==n.abRelation&&(i=e.targetPosition);const r=[o._getTransformedBySplitOperation(t)];if(t.graveyardPosition){const i=o.start.isEqual(t.graveyardPosition)||o.containsPosition(t.graveyardPosition);e.howMany>1&&i&&!n.aWasUndone&&r.push(Jo._createFromPositionAndShift(t.insertionPosition,1))}return Xh(r,i)}),Fh(ru,du,(e,t,n)=>{const i=Jo._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&i.containsPosition(t.sourcePosition))if("remove"!=e.type||n.forceWeakRemove){if(1==e.howMany)return n.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new Su(0)]}else if(!n.aWasUndone){const n=[];let i=t.graveyardPosition.clone(),o=t.targetPosition._getTransformedByMergeOperation(t);e.howMany>1&&(n.push(new ru(e.sourcePosition,e.howMany-1,e.targetPosition,0)),i=i._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1),o=o._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1));const r=t.deletionPosition._getCombined(e.sourcePosition,e.targetPosition),s=new ru(i,1,r,0),a=s.getMovedRangeStart().path.slice();a.push(0);const l=new Wo(s.targetPosition.root,a);o=o._getTransformedByMove(i,r,1);const c=new ru(o,t.howMany,l,0);return n.push(s),n.push(c),n}const o=Jo._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=o.start,e.howMany=o.end.offset-o.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]}),Fh(lu,su,(e,t)=>(e.position=e.position._getTransformedByInsertOperation(t),[e])),Fh(lu,du,(e,t)=>e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e])),Fh(lu,ru,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e])),Fh(lu,lu,(e,t,n)=>{if(e.position.isEqual(t.position)){if(!n.aIsStrong)return[new Su(0)];e.oldName=t.newName}return[e]}),Fh(lu,uu,(e,t)=>{if("same"==Lo(e.position.path,t.splitPosition.getParentPath())&&!t.graveyardPosition){const t=new lu(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}return e.position=e.position._getTransformedBySplitOperation(t),[e]}),Fh(cu,cu,(e,t,n)=>{if(e.root===t.root&&e.key===t.key){if(!n.aIsStrong||e.newValue===t.newValue)return[new Su(0)];e.oldValue=t.newValue}return[e]}),Fh(uu,su,(e,t)=>(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset<t.position.offset&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByInsertOperation(t),e.insertionPosition=uu.getInsertionPosition(e.splitPosition),[e])),Fh(uu,du,(e,t,n)=>{if(!e.graveyardPosition&&!n.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const n=t.graveyardPosition.path.slice();n.push(0);const i=new Wo(t.graveyardPosition.root,n),o=uu.getInsertionPosition(new Wo(t.graveyardPosition.root,n)),r=new uu(i,0,null,0);return r.insertionPosition=o,e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=uu.getInsertionPosition(e.splitPosition),e.graveyardPosition=r.insertionPosition.clone(),e.graveyardPosition.stickiness="toNext",[r,e]}return e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)&&e.howMany--,e.splitPosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=uu.getInsertionPosition(e.splitPosition),e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]}),Fh(uu,ru,(e,t,n)=>{const i=Jo._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const o=i.start.isEqual(e.graveyardPosition)||i.containsPosition(e.graveyardPosition);if(!n.bWasUndone&&o){const n=e.splitPosition._getTransformedByMoveOperation(t),i=e.graveyardPosition._getTransformedByMoveOperation(t),o=i.path.slice();o.push(0);const r=new Wo(i.root,o);return[new ru(n,e.howMany,r,0)]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.splitPosition)){const n=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);return e.howMany-=n,e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset<t.targetPosition.offset&&(e.howMany+=t.howMany),e.splitPosition=t.sourcePosition.clone(),e.insertionPosition=uu.getInsertionPosition(e.splitPosition),[e]}return!e.splitPosition.isEqual(t.targetPosition)||"insertAtSource"!=n.baRelation&&"splitBefore"!=n.abRelation?(t.sourcePosition.isEqual(t.targetPosition)||(e.splitPosition.hasSameParentAs(t.sourcePosition)&&e.splitPosition.offset<=t.sourcePosition.offset&&(e.howMany-=t.howMany),e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset<t.targetPosition.offset&&(e.howMany+=t.howMany)),e.splitPosition.stickiness="toNone",e.splitPosition=e.splitPosition._getTransformedByMoveOperation(t),e.splitPosition.stickiness="toNext",e.graveyardPosition?e.insertionPosition=e.insertionPosition._getTransformedByMoveOperation(t):e.insertionPosition=uu.getInsertionPosition(e.splitPosition),[e]):(e.howMany+=t.howMany,e.splitPosition=e.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),e.insertionPosition=uu.getInsertionPosition(e.splitPosition),[e])}),Fh(uu,uu,(e,t,n)=>{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition)return[new Su(0)];if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition))return[new Su(0)];if("splitBefore"==n.abRelation)return e.howMany=0,e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t),[e]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const i="$graveyard"==e.splitPosition.root.rootName,o="$graveyard"==t.splitPosition.root.rootName,r=i&&!o;if(o&&!i||!r&&n.aIsStrong){const n=[];return t.howMany&&n.push(new ru(t.moveTargetPosition,t.howMany,t.splitPosition,0)),e.howMany&&n.push(new ru(e.splitPosition,e.howMany,e.moveTargetPosition,0)),n}return[new Su(0)]}if(e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)),e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==n.abRelation)return e.howMany++,[e];if(t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==n.baRelation){const n=t.insertionPosition.path.slice();n.push(0);const i=new Wo(t.insertionPosition.root,n);return[e,new ru(e.insertionPosition,1,i,0)]}return e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset<t.splitPosition.offset&&(e.howMany-=t.howMany),e.splitPosition=e.splitPosition._getTransformedBySplitOperation(t),e.insertionPosition=uu.getInsertionPosition(e.splitPosition),[e]});class Gh extends st{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this.listenTo(e.data,"set",()=>this.clearStack())}refresh(){this.isEnabled=this._stack.length>0}addBatch(e){const t=this.editor.model.document.selection,n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,n){const i=this.editor.model,o=i.document,r=[],s=e.map(e=>e.getTransformedByOperations(n)),a=s.flat();for(const e of s){const t=e.filter(e=>!Zh(e,a));Qh(t);const n=t.find(e=>e.root!=o.graveyard);n&&r.push(n)}r.length&&i.change(e=>{e.setSelection(r,{backward:t})})}_undo(e,t){const n=this.editor.model,i=n.document;this._createdBatches.add(t);const o=e.operations.slice().filter(e=>e.isDocumentOperation);o.reverse();for(const e of o){const o=e.baseVersion+1,r=Array.from(i.history.getOperations(o)),s=Wh([e.getReversed()],r,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const o of s)t.addOperation(o),n.applyOperation(o),i.history.setOperationAsUndone(e,o)}}}function Qh(e){e.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let t=1;t<e.length;t++){const n=e[t-1].getJoined(e[t],!0);n&&(t--,e.splice(t,2,n))}}function Zh(e,t){return t.some(t=>t!==e&&t.containsRange(e,!0))}class em extends Gh{execute(e=null){const t=e?this._stack.findIndex(t=>t.batch==e):this._stack.length-1,n=this._stack.splice(t,1)[0],i=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(i,()=>{this._undo(n.batch,i);const e=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,e),this.fire("revert",n.batch,i)}),this.refresh()}}class tm extends Gh{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(t,()=>{const n=e.batch.operations[e.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,i),this._undo(e.batch,t)}),this.refresh()}}class nm extends Je{static get pluginName(){return"UndoEditing"}constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new em(e),this._redoCommand=new tm(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(e,t)=>{const n=t[0];if(!n.isDocumentOperation)return;const i=n.batch,o=this._redoCommand._createdBatches.has(i),r=this._undoCommand._createdBatches.has(i);this._batchRegistry.has(i)||"transparent"==i.type&&!o&&!r||(o?this._undoCommand.addBatch(i):r||(this._undoCommand.addBatch(i),this._redoCommand.clearStack()),this._batchRegistry.add(i))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(e,t,n)=>{this._redoCommand.addBatch(n)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo")}}var im='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.042 9.367l2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.747.747 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.75.75 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032H5.042z"/></svg>',om='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M14.958 9.367l-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.747.747 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.75.75 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032h8.927z"/></svg>';class rm extends Je{init(){const e=this.editor,t=e.locale,n=e.t,i="ltr"==t.uiLanguageDirection?im:om,o="ltr"==t.uiLanguageDirection?om:im;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",o)}_addButton(e,t,n,i){const o=this.editor;o.ui.componentFactory.add(e,r=>{const s=o.commands.get(e),a=new Fi(r);return a.set({label:t,icon:i,keystroke:n,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{o.execute(e),o.editing.view.focus()}),a})}}class sm extends Je{static get requires(){return[nm,rm]}static get pluginName(){return"Undo"}}class am extends st{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,i=e.value;t.change(e=>{if(n.isCollapsed)i?e.setSelectionAttribute(this.attributeKey,i):e.removeSelectionAttribute(this.attributeKey);else{const o=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of o)i?e.setAttribute(this.attributeKey,i,t):e.removeAttribute(this.attributeKey,t)}})}}class lm extends Fi{constructor(e){super(e);const t=this.bindTemplate;this.set("color"),this.set("hasBorder"),this.icon='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path class="ck-icon__fill" d="M16.935 5.328a2 2 0 0 1 0 2.829l-7.778 7.778a2 2 0 0 1-2.829 0L3.5 13.107a1.999 1.999 0 1 1 2.828-2.829l.707.707a1 1 0 0 0 1.414 0l5.658-5.657a2 2 0 0 1 2.828 0z"/><path d="M14.814 6.035L8.448 12.4a1 1 0 0 1-1.414 0l-1.413-1.415A1 1 0 1 0 4.207 12.4l2.829 2.829a1 1 0 0 0 1.414 0l7.778-7.778a1 1 0 1 0-1.414-1.415z"/></svg>',this.extendTemplate({attributes:{style:{backgroundColor:t.to("color")},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-table__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}n(49);class cm extends Ti{constructor(e,t){super(e);const n=t&&t.colorDefinitions||[],i={};t&&t.columns&&(i.gridTemplateColumns=`repeat( ${t.columns}, 1fr)`),this.set("selectedColor"),this.items=this.createCollection(),this.focusTracker=new mo,this.keystrokes=new Ui,this._focusCycler=new go({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowleft",focusNext:"arrowright"}}),this.items.on("add",(e,t)=>{t.isOn=t.color===this.selectedColor}),n.forEach(e=>{const t=new lm;t.set({color:e.color,label:e.label,tooltip:!0,hasBorder:e.options.hasBorder}),t.on("execute",()=>{this.fire("execute",{value:e.color,hasBorder:e.options.hasBorder,label:e.label})}),this.items.add(t)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:i}}),this.on("change:selectedColor",(e,t,n)=>{for(const e of this.items)e.isOn=e.color===n})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element)}}class dm extends Qe{constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",0===this.length)})}add(e,t){this.find(t=>t.color===e.color)||super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}}Ye(dm,Fe);n(51);class um extends Ti{constructor(e,{colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r}){super(e),this.items=this.createCollection(),this.colorDefinitions=t,this.focusTracker=new mo,this.keystrokes=new Ui,this.set("selectedColor"),this.removeButtonLabel=i,this.columns=n,this.documentColors=new dm,this.documentColorsCount=r,this._focusCycler=new go({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this._documentColorsLabel=o,this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-table"]},children:this.items}),this.items.add(this._removeColorButton())}updateDocumentColors(e,t){const n=e.document,i=this.documentColorsCount;this.documentColors.clear();for(const o of n.getRootNames()){const r=n.getRoot(o),s=e.createRangeIn(r);for(const e of s.getItems())if(e.is("$textProxy")&&e.hasAttribute(t)&&(this._addColorToDocumentColors(e.getAttribute(t)),this.documentColors.length>=i))return}}updateSelectedColors(){const e=this.documentColorsGrid,t=this.staticColorsGrid,n=this.selectedColor;t.selectedColor=n,e&&(e.selectedColor=n)}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}appendGrids(){if(!this.staticColorsGrid&&(this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount)){const e=ii.bind(this.documentColors,this.documentColors),t=new mh(this.locale);t.text=this._documentColorsLabel,t.extendTemplate({attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]}}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_removeColorButton(){const e=new Fi;return e.set({withText:!0,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.636 9.531l-2.758 3.94a.5.5 0 0 0 .122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 0 1-.491-2.786l6.673-9.53a2 2 0 0 1 2.785-.49l3.742 2.62a2 2 0 0 1 .491 2.785l-7.269 10.053-2.147-.066z"/><path d="M4 18h5.523v-1H4zm-2 0h1v-1H2z"/></svg>',tooltip:!0,label:this.removeButtonLabel}),e.class="ck-color-table__remove-color",e.on("execute",()=>{this.fire("execute",{value:null})}),e}_createStaticColorsGrid(){const e=new cm(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.delegate("execute").to(this),e}_createDocumentColorsGrid(){const e=ii.bind(this.documentColors,this.documentColors),t=new cm(this.locale,{columns:this.columns});return t.delegate("execute").to(this),t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using(e=>{const t=new lm;return t.set({color:e.color,hasBorder:e.options&&e.options.hasBorder}),e.label&&t.set({label:e.label,tooltip:!0}),t.on("execute",()=>{this.fire("execute",{value:e.color})}),t}),this.documentColors.on("change:isEmpty",(e,n,i)=>{i&&(t.selectedColor=null)}),t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find(t=>t.color===e);t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}}function hm(e,t){const n={model:{key:e,values:[]},view:{},upcastAlso:{}};for(const e of t)n.model.values.push(e.model),n.view[e.model]=e.view,e.upcastAlso&&(n.upcastAlso[e.model]=e.upcastAlso);return n}function mm(e){return t=>t.getStyle(e).replace(/\s/g,"")}function gm(e){return(t,{writer:n})=>n.createAttributeElement("span",{style:`${e}:${t}`},{priority:7})}class pm extends am{constructor(e){super(e,"fontBackgroundColor")}}const fm=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,wm=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,bm=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,_m=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,km=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,vm=new Set(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua","orange","aliceblue","antiquewhite","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","gainsboro","ghostwhite","gold","goldenrod","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","limegreen","linen","magenta","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","oldlace","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen","rebeccapurple","currentcolor","transparent"]);function ym(e){return e.startsWith("#")?fm.test(e):e.startsWith("rgb")?wm.test(e)||bm.test(e):e.startsWith("hsl")?_m.test(e)||km.test(e):vm.has(e.toLowerCase())}const xm=["repeat-x","repeat-y","repeat","space","round","no-repeat"];const Am=["center","top","bottom","left","right"];function Cm(e){return Am.includes(e)}const Tm=["fixed","scroll","local"];function Em(e){return Tm.includes(e)}const Mm=/^url\(/;function Pm(e){return Mm.test(e)}function Sm(e){return e.replace(/, /g,",").split(" ").map(e=>e.replace(/,/g,", "))}function Im(e){e.setNormalizer("background",Om),e.setNormalizer("background-color",e=>({path:"background.color",value:e})),e.setReducer("background",e=>{const t=[];return t.push(["background-color",e.color]),t})}function Om(e){const t={},n=Sm(e);for(const e of n)i=e,xm.includes(i)?(t.repeat=t.repeat||[],t.repeat.push(e)):Cm(e)?(t.position=t.position||[],t.position.push(e)):Em(e)?t.attachment=e:ym(e)?t.color=e:Pm(e)&&(t.image=e);var i;return{path:"background",value:t}}class Nm extends Je{static get pluginName(){return"FontBackgroundColorEditing"}constructor(e){super(e),e.config.define("fontBackgroundColor",{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(Im),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:"fontBackgroundColor",value:mm("background-color")}}),e.conversion.for("downcast").attributeToElement({model:"fontBackgroundColor",view:gm("background-color")}),e.commands.add("fontBackgroundColor",new pm(e)),e.model.schema.extend("$text",{allowAttributes:"fontBackgroundColor"}),e.model.schema.setAttributeProperties("fontBackgroundColor",{isFormatting:!0,copyOnEnter:!0})}}function zm(e){return"string"==typeof e?{model:e,label:e,hasBorder:!1,view:{name:"span",styles:{color:e}}}:{model:e.color,label:e.label||e.color,hasBorder:void 0!==e.hasBorder&&e.hasBorder,view:{name:"span",styles:{color:""+e.color}}}}class Rm extends Je{constructor(e,{commandName:t,icon:n,componentName:i,dropdownLabel:o}){super(e),this.commandName=t,this.componentName=i,this.icon=n,this.dropdownLabel=o,this.columns=e.config.get(this.componentName+".columns"),this.colorTableView=void 0}init(){const e=this.editor,t=e.locale,n=t.t,i=e.commands.get(this.commandName);const o=function(e,t){const n=e.t,i={Black:n("Black"),"Dim grey":n("Dim grey"),Grey:n("Grey"),"Light grey":n("Light grey"),White:n("White"),Red:n("Red"),Orange:n("Orange"),Yellow:n("Yellow"),"Light green":n("Light green"),Green:n("Green"),Aquamarine:n("Aquamarine"),Turquoise:n("Turquoise"),"Light blue":n("Light blue"),Blue:n("Blue"),Purple:n("Purple")};return t.map(e=>{const t=i[e.label];return t&&t!=e.label&&(e.label=t),e})}(t,e.config.get(this.componentName).colors.map(zm).filter(e=>!!e)),r=e.config.get(this.componentName+".documentColors");e.ui.componentFactory.add(this.componentName,t=>{const s=Mo(t);return this.colorTableView=function({dropdownView:e,colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r}){const s=e.locale,a=new um(s,{colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r});return e.colorTableView=a,e.panelView.children.add(a),a.delegate("execute").to(e,"execute"),a}({dropdownView:s,colors:o.map(e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}})),columns:this.columns,removeButtonLabel:n("Remove color"),documentColorsLabel:0!==r?n("Document colors"):void 0,documentColorsCount:void 0===r?this.columns:r}),this.colorTableView.bind("selectedColor").to(i,"value"),s.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),s.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),s.bind("isEnabled").to(i),s.on("execute",(t,n)=>{e.execute(this.commandName,n),e.editing.view.focus()}),s.on("change:isOpen",(t,n,i)=>{s.colorTableView.appendGrids(),i&&(0!==r&&this.colorTableView.updateDocumentColors(e.model,this.componentName),this.colorTableView.updateSelectedColors())}),s})}}class Lm extends Rm{constructor(e){super(e,{commandName:"fontBackgroundColor",componentName:"fontBackgroundColor",icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8.38 9.262H7.62L10 5.506l2.38 5.756zm.532 1.285L14.34 16h1.426L10.804 4H9.196L4.234 16H5.66l1.428-3.453h5.824z"/></svg>',dropdownLabel:(0,e.locale.t)("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class jm extends am{constructor(e){super(e,"fontColor")}}class Dm extends Je{static get pluginName(){return"FontColorEditing"}constructor(e){super(e),e.config.define("fontColor",{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:"fontColor",value:mm("color")}}),e.conversion.for("downcast").attributeToElement({model:"fontColor",view:gm("color")}),e.commands.add("fontColor",new jm(e)),e.model.schema.extend("$text",{allowAttributes:"fontColor"}),e.model.schema.setAttributeProperties("fontColor",{isFormatting:!0,copyOnEnter:!0})}}class Bm extends Rm{constructor(e){super(e,{commandName:"fontColor",componentName:"fontColor",icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.4 10.3L10 4.5l-2.4 5.8h4.8zm.5 1.2H7.1L5.7 15H4.2l5-12h1.6l5 12h-1.5L13 11.5zm3.1 7H4a1 1 0 0 1 0-2h12a1 1 0 0 1 0 2z"/></svg>',dropdownLabel:(0,e.locale.t)("Font Color")})}static get pluginName(){return"FontColorUI"}}class Vm extends am{constructor(e){super(e,"fontFamily")}}function Fm(e){return e.map(Hm).filter(e=>!!e)}function Hm(e){return"object"==typeof e?e:"default"===e?{title:"Default",model:void 0}:"string"==typeof e?function(e){const t=e.replace(/"|'/g,"").split(","),n=t[0],i=t.map(Um).join(", ");return{title:n,model:i,view:{name:"span",styles:{"font-family":i},priority:7}}}(e):void 0}function Um(e){return(e=e.trim()).indexOf(" ")>0&&(e=`'${e}'`),e}class Wm extends Je{static get pluginName(){return"FontFamilyEditing"}constructor(e){super(e),e.config.define("fontFamily",{options:["default","Arial, Helvetica, sans-serif","Courier New, Courier, monospace","Georgia, serif","Lucida Sans Unicode, Lucida Grande, sans-serif","Tahoma, Geneva, sans-serif","Times New Roman, Times, serif","Trebuchet MS, Helvetica, sans-serif","Verdana, Geneva, sans-serif"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"fontFamily"}),e.model.schema.setAttributeProperties("fontFamily",{isFormatting:!0,copyOnEnter:!0});const t=hm("fontFamily",Fm(e.config.get("fontFamily.options")).filter(e=>e.model));e.config.get("fontFamily.supportAllValues")?this._prepareAnyValueConverters():e.conversion.attributeToElement(t),e.commands.add("fontFamily",new Vm(e))}_prepareAnyValueConverters(){const e=this.editor;e.conversion.for("downcast").attributeToElement({model:"fontFamily",view:(e,{writer:t})=>t.createAttributeElement("span",{style:"font-family:"+e},{priority:7})}),e.conversion.for("upcast").attributeToAttribute({model:{key:"fontFamily",value:e=>e.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}}class $m{constructor(e,t){t&&Le(this,t),e&&this.set(e)}}Ye($m,Fe);class qm extends Je{init(){const e=this.editor,t=e.t,n=this._getLocalizedOptions(),i=e.commands.get("fontFamily");e.ui.componentFactory.add("fontFamily",o=>{const r=Mo(o);return So(r,function(e,t){const n=new Qe;for(const i of e){const e={type:"button",model:new $m({commandName:"fontFamily",commandParam:i.model,label:i.title,withText:!0})};e.model.bind("isOn").to(t,"value",e=>e===i.model||!(!e||!i.model)&&e.split(",")[0].replace(/'/g,"").toLowerCase()===i.model.toLowerCase()),i.view&&i.view.styles&&e.model.set("labelStyle","font-family: "+i.view.styles["font-family"]),n.add(e)}return n}(n,i)),r.buttonView.set({label:t("Font Family"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.03 3h6.149a.75.75 0 1 1 0 1.5h-5.514L11.03 3zm1.27 3h4.879a.75.75 0 1 1 0 1.5h-4.244L12.3 6zm1.27 3h3.609a.75.75 0 1 1 0 1.5h-2.973L13.57 9zm-2.754 2.5L8.038 4.785 5.261 11.5h5.555zm.62 1.5H4.641l-1.666 4.028H1.312l5.789-14h1.875l5.789 14h-1.663L11.436 13z"/></svg>',tooltip:!0}),r.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),r.bind("isEnabled").to(i),this.listenTo(r,"execute",t=>{e.execute(t.source.commandName,{value:t.source.commandParam}),e.editing.view.focus()}),r})}_getLocalizedOptions(){const e=this.editor,t=e.t;return Fm(e.config.get("fontFamily").options).map(e=>("Default"===e.title&&(e.title=t("Default")),e))}}class Ym extends am{constructor(e){super(e,"fontSize")}}function Jm(e){return e.map(e=>function(e){if(t=e,"object"==typeof t&&t.title&&t.model&&t.view)return Xm(e);var t;const n=function(e){return Km[e]||Km[e.model]}(e);if(n)return Xm(n);if("default"===e)return{model:void 0,title:"Default"};if(function(e){let t;if("object"==typeof e){if(!e.model)throw new l.b("font-size-invalid-definition",null,e);t=parseFloat(e.model)}else t=parseFloat(e);return isNaN(t)}(e))return;return function(e){"number"!=typeof e&&"string"!=typeof e||(e={title:String(e),model:parseFloat(e)+"px"});return e.view={name:"span",styles:{"font-size":e.model}},Xm(e)}(e)}(e)).filter(e=>!!e)}const Km={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function Xm(e){return e.view.priority||(e.view.priority=7),e}class Gm extends Je{static get pluginName(){return"FontSizeEditing"}constructor(e){super(e),e.config.define("fontSize",{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"fontSize"}),e.model.schema.setAttributeProperties("fontSize",{isFormatting:!0,copyOnEnter:!0});const t=e.config.get("fontSize.supportAllValues"),n=hm("fontSize",Jm(this.editor.config.get("fontSize.options")).filter(e=>e.model));t?this._prepareAnyValueConverters(n):e.conversion.attributeToElement(n),e.commands.add("fontSize",new Ym(e))}_prepareAnyValueConverters(e){const t=this.editor,n=e.model.values.filter(e=>!String(e).match(/[\d.]+[\w%]+/));if(n.length)throw new l.b("font-size-invalid-use-of-named-presets",null,{presets:n});t.conversion.for("downcast").attributeToElement({model:"fontSize",view:(e,{writer:t})=>{if(e)return t.createAttributeElement("span",{style:"font-size:"+e},{priority:7})}}),t.conversion.for("upcast").attributeToAttribute({model:{key:"fontSize",value:e=>e.getStyle("font-size")},view:{name:"span"}})}}n(53);class Qm extends Je{init(){const e=this.editor,t=e.t,n=this._getLocalizedOptions(),i=e.commands.get("fontSize");e.ui.componentFactory.add("fontSize",o=>{const r=Mo(o);return So(r,function(e,t){const n=new Qe;for(const i of e){const e={type:"button",model:new $m({commandName:"fontSize",commandParam:i.model,label:i.title,class:"ck-fontsize-option",withText:!0})};i.view&&i.view.styles&&e.model.set("labelStyle","font-size:"+i.view.styles["font-size"]),i.view&&i.view.classes&&e.model.set("class",`${e.model.class} ${i.view.classes}`),e.model.bind("isOn").to(t,"value",e=>e===i.model),n.add(e)}return n}(n,i)),r.buttonView.set({label:t("Font Size"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.816 11.5L7.038 4.785 4.261 11.5h5.555zm.62 1.5H3.641l-1.666 4.028H.312l5.789-14h1.875l5.789 14h-1.663L10.436 13zm7.55 2.279l.779-.779.707.707-2.265 2.265-2.193-2.265.707-.707.765.765V4.825c0-.042 0-.083.002-.123l-.77.77-.707-.707L17.207 2.5l2.265 2.265-.707.707-.782-.782c.002.043.003.089.003.135v10.454z"/></svg>',tooltip:!0}),r.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),r.bind("isEnabled").to(i),this.listenTo(r,"execute",t=>{e.execute(t.source.commandName,{value:t.source.commandParam}),e.editing.view.focus()}),r})}_getLocalizedOptions(){const e=this.editor,t=e.t,n={Default:t("Default"),Tiny:t("Tiny"),Small:t("Small"),Big:t("Big"),Huge:t("Huge")};return Jm(e.config.get("fontSize").options).map(e=>{const t=n[e.title];return t&&t!=e.title&&(e=Object.assign({},e,{title:t})),e})}}class Zm extends st{refresh(){const e=this.editor.model,t=lt(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&eg(t,e.schema)}execute(e={}){const t=this.editor.model,n=t.document;t.change(i=>{const o=(e.selection||n.selection).getSelectedBlocks();for(const e of o)!e.is("element","paragraph")&&eg(e,t.schema)&&i.rename(e,"paragraph")})}}function eg(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class tg extends st{execute(e){const t=this.editor.model;let n=e.position;t.change(e=>{const i=e.createElement("paragraph");if(!t.schema.checkChild(n.parent,i)){const o=t.schema.findAllowedParent(n,i);if(!o)return;n=e.split(n,o).position}t.insertContent(i,n),e.setSelection(i,"in")})}}class ng extends Je{static get pluginName(){return"Paragraph"}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new Zm(e)),e.commands.add("insertParagraph",new tg(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>ng.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}ng.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class ig extends st{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=lt(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>og(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,i=e.value;t.change(e=>{const o=Array.from(n.selection.getSelectedBlocks()).filter(e=>og(e,i,t.schema));for(const t of o)t.is("element",i)||e.rename(t,i)})}}function og(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}class rg extends Je{static get pluginName(){return"HeadingEditing"}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[ng]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const i of t)"paragraph"!==i.model&&(e.model.schema.register(i.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new ig(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(t,i)=>{const o=e.model.document.selection.getFirstPosition().parent;n.some(e=>o.is("element",e.model))&&!o.is("element","paragraph")&&0===o.childCount&&i.writer.rename(o,"paragraph")})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:a.get("low")+1})}}n(11);class sg extends Je{init(){const e=this.editor,t=e.t,n=function(e){const t=e.t,n={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return e.config.get("heading.options").map(e=>{const t=n[e.title];return t&&t!=e.title&&(e.title=t),e})}(e),i=t("Choose heading"),o=t("Heading");e.ui.componentFactory.add("heading",t=>{const r={},s=new Qe,a=e.commands.get("heading"),l=e.commands.get("paragraph"),c=[a];for(const e of n){const t={type:"button",model:new $m({label:e.title,class:e.class,withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(l,"value"),t.model.set("commandName","paragraph"),c.push(l)):(t.model.bind("isOn").to(a,"value",t=>t===e.model),t.model.set({commandName:"heading",commandValue:e.model})),s.add(t),r[e.model]=e.title}const d=Mo(t);return So(d,s),d.buttonView.set({isOn:!1,withText:!0,tooltip:o}),d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),d.bind("isEnabled").toMany(c,"isEnabled",(...e)=>e.some(e=>e)),d.buttonView.bind("label").to(a,"value",l,"value",(e,t)=>{const n=e||t&&"paragraph";return r[n]?r[n]:i}),this.listenTo(d,"execute",t=>{e.execute(t.source.commandName,t.source.commandValue?{value:t.source.commandValue}:void 0),e.editing.view.focus()}),d})}}n(56);const ag=["before","after"],lg=(new DOMParser).parseFromString('<svg viewBox="0 0 10 8" xmlns="http://www.w3.org/2000/svg"><polyline points="8.05541992 0.263427734 8.05541992 4.23461914 1.28417969 4.23461914" transform="translate(1,0)"></polyline><line x1="0" y1="4.21581031" x2="2" y2="2.17810059" transform="translate(1, 0)"></line><line x1="0" y1="6.21581031" x2="2" y2="4.17810059" transform="translate(2, 5.196955) scale(1, -1) translate(-1, -5.196955)"></line></svg>\n',"image/svg+xml").firstChild;class cg extends Je{static get pluginName(){return"WidgetTypeAround"}constructor(e){super(e),this._currentFakeCaretModelElement=null}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(n,i,o)=>{t.change(e=>{for(const n of t.document.roots)o?e.removeClass("ck-widget__type-around_disabled",n):e.addClass("ck-widget__type-around_disabled",n)}),o||e.model.change(e=>{e.removeSelectionAttribute("widget-type-around")})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const n=this.editor,i=n.editing.view;n.execute("insertParagraph",{position:n.model.createPositionAt(e,t)}),i.focus(),i.scrollToTheSelection()}_listenToIfEnabled(e,t,n,i){this.listenTo(e,t,(...e)=>{this.isEnabled&&n(...e)},i)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=Ar(e);if(!t)return!1;const n=e.getSelectedElement();return this._insertParagraph(n,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,n=e.locale.t,i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(e,n,o)=>{const r=o.mapper.toViewElement(n.item);xr(r,n.item,t)&&function(e,t,n){const i=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(e){const n=this.toDomElement(e);return function(e,t){for(const n of ag){const i=new ii({tag:"div",attributes:{class:["ck","ck-widget__type-around__button","ck-widget__type-around__button_"+n],title:t[n]},children:[e.ownerDocument.importNode(lg,!0)]});e.appendChild(i.render())}}(n,t),function(e){const t=new ii({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(n),n}));e.insert(e.createPositionAt(n,"end"),i)}(o.writer,i,r)},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,n=t.document.selection,i=t.schema,o=e.editing.view;function r(e){return"ck-widget_type-around_show-fake-caret_"+e}this._listenToIfEnabled(o.document,"keydown",(e,t)=>{ji(t.keyCode)&&this._handleArrowKeyPress(e,t)},{priority:a.get("high")+10}),this._listenToIfEnabled(n,"change:range",(t,n)=>{n.directChange&&e.model.change(e=>{e.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(t.document,"change:data",()=>{const t=n.getSelectedElement();if(t){if(xr(e.editing.mapper.toViewElement(t),t,i))return}e.model.change(e=>{e.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(e,t,n)=>{const o=n.writer;if(this._currentFakeCaretModelElement){const e=n.mapper.toViewElement(this._currentFakeCaretModelElement);e&&(o.removeClass(ag.map(r),e),this._currentFakeCaretModelElement=null)}const s=t.selection.getSelectedElement();if(!s)return;const a=n.mapper.toViewElement(s);if(!xr(a,s,i))return;const l=Ar(t.selection);l&&(o.addClass(r(l),a),this._currentFakeCaretModelElement=s)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(t,n,i)=>{i||e.model.change(e=>{e.removeSelectionAttribute("widget-type-around")})})}_handleArrowKeyPress(e,t){const n=this.editor,i=n.model,o=i.document.selection,r=i.schema,s=n.editing.view,a=Bi(t.keyCode,n.locale.contentLanguageDirection),l=s.document.selection.getSelectedElement();let c;xr(l,n.editing.mapper.toModelElement(l),r)?c=this._handleArrowKeyPressOnSelectedWidget(a):o.isCollapsed&&(c=this._handleArrowKeyPressWhenSelectionNextToAWidget(a)),c&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,n=Ar(t.document.selection);return t.change(t=>{if(!n)return t.setSelectionAttribute("widget-type-around",e?"after":"before"),!0;if(!(n===(e?"after":"before")))return t.removeSelectionAttribute("widget-type-around"),!0;return!1})}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,n=t.model,i=n.schema,o=t.plugins.get("Widget"),r=o._getObjectElementNextToSelection(e);return!!xr(t.editing.mapper.toViewElement(r),r,i)&&(n.change(t=>{o._setSelectionOverElement(r),t.setSelectionAttribute("widget-type-around",e?"before":"after")}),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(n,i)=>{const o=i.domTarget.closest(".ck-widget__type-around__button");if(!o)return;const r=function(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(o),s=function(e,t){const n=e.closest(".ck-widget");return t.mapDomToView(n)}(o,t.domConverter),a=e.editing.mapper.toModelElement(s);this._insertParagraph(a,r),i.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"enter",(n,i)=>{const o=t.document.selection.getSelectedElement(),r=e.editing.mapper.toModelElement(o),s=e.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:xr(o,r,s)&&(this._insertParagraph(r,i.isSoft?"before":"after"),a=!0),a&&(i.preventDefault(),n.stop())})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view,t=[Ni.enter,Ni.delete,Ni.backspace];this._listenToIfEnabled(e.document,"keydown",(e,n)=>{t.includes(n.keyCode)||ns(n)||this._insertParagraphAccordingToFakeCaretPosition()},{priority:a.get("high")+1})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,n=e.model,i=n.schema;this._listenToIfEnabled(t.document,"delete",(t,o)=>{const r=Ar(n.document.selection);if(!r)return;const s=o.direction,a=n.document.selection.getSelectedElement(),l="forward"==s;if("before"===r===l)e.execute("delete",{selection:n.createSelection(a,"on")});else{const t=i.getNearestSelectionRange(n.createPositionAt(a,r),s);if(t)if(t.isCollapsed){const o=n.createSelection(t.start);if(n.modifySelection(o,{direction:s}),o.focus.isEqual(t.start)){const e=function(e,t){let n=t;for(const i of t.getAncestors({parentFirst:!0})){if(i.childCount>1||e.isLimit(i))break;n=i}return n}(i,t.start.parent);n.deleteContent(n.createSelection(e,"on"),{doNotAutoparagraph:!0})}else n.change(n=>{n.setSelection(t),e.execute(l?"forwardDelete":"delete")})}else n.change(n=>{n.setSelection(t),e.execute(l?"forwardDelete":"delete")})}o.preventDefault(),t.stop()},{priority:a.get("high")+1})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,n=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(e,[i,o])=>{if(o&&!o.is("documentSelection"))return;const r=Ar(n);return r?(e.stop(),t.change(e=>{const o=n.getSelectedElement(),s=t.createPositionAt(o,r),a=e.createSelection(s),l=t.insertContent(i,a);return e.setSelection(a),l})):void 0},{priority:"high"})}}n(58);function dg(e){const t=e.model;return(n,i)=>{const o=i.keyCode==Ni.arrowup,r=i.keyCode==Ni.arrowdown,s=i.shiftKey,a=t.document.selection;if(!o&&!r)return;const l=r;if(s&&function(e,t){return!e.isCollapsed&&e.isBackward==t}(a,l))return;const c=function(e,t,n){const i=e.model;if(n){const e=t.isCollapsed?t.focus:t.getLastPosition(),n=ug(i,e,"forward");if(!n)return null;const o=i.createRange(e,n),r=hg(i.schema,o,"backward");return r&&e.isBefore(r)?i.createRange(e,r):null}{const e=t.isCollapsed?t.focus:t.getFirstPosition(),n=ug(i,e,"backward");if(!n)return null;const o=i.createRange(n,e),r=hg(i.schema,o,"forward");return r&&e.isAfter(r)?i.createRange(r,e):null}}(e,a,l);c&&!c.isCollapsed&&function(e,t,n){const i=e.model,o=e.view.domConverter;if(n){const e=i.createSelection(t.start);i.modifySelection(e),e.focus.isAtEnd||t.start.isEqual(e.focus)||(t=i.createRange(e.focus,t.end))}const r=e.mapper.toViewRange(t),s=o.viewRangeToDom(r),a=no.getDomRangeRects(s);let l;for(const e of a)if(void 0!==l){if(Math.round(e.top)>=l)return!1;l=Math.max(l,Math.round(e.bottom))}else l=Math.round(e.bottom);return!0}(e,c,l)&&(t.change(e=>{const n=l?c.end:c.start;if(s){const i=t.createSelection(a.anchor);i.setFocus(n),e.setSelection(i)}else e.setSelection(n)}),n.stop(),i.preventDefault(),i.stopPropagation())}}function ug(e,t,n){const i=e.schema,o=e.createRangeIn(t.root),r="forward"==n?"elementStart":"elementEnd";for(const{previousPosition:e,item:s,type:a}of o.getWalker({startPosition:t,direction:n})){if(i.isLimit(s)&&!i.isInline(s))return e;if(a==r&&i.isBlock(s))return null}return null}function hg(e,t,n){const i="backward"==n?t.end:t.start;if(e.checkChild(i,"$text"))return i;for(const{nextPosition:i}of t.getWalker({direction:n}))if(e.checkChild(i,"$text"))return i}class mg extends Je{static get pluginName(){return"Widget"}static get requires(){return[cg]}init(){const e=this.editor.editing.view,t=e.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(e,t,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const i=n.writer,o=i.document.selection,r=o.getSelectedElement();let s=null;for(const e of o.getRanges())for(const t of e){const e=t.item;Cr(e)&&!gg(e,s)&&(i.addClass("ck-widget_selected",e),this._previouslySelected.add(e),s=e,e==r&&i.setSelection(o.getRanges(),{fake:!0,label:Mr(r)}))}},{priority:"low"}),e.addObserver($r),this.listenTo(t,"mousedown",(...e)=>this._onMousedown(...e)),this.listenTo(t,"keydown",(...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)},{priority:"high"}),this.listenTo(t,"keydown",(...e)=>{this._preventDefaultOnArrowKeyPress(...e)},{priority:a.get("high")-20}),this.listenTo(t,"keydown",dg(this.editor.editing)),this.listenTo(t,"delete",(e,t)=>{this._handleDelete("forward"==t.direction)&&(t.preventDefault(),e.stop())},{priority:"high"})}_onMousedown(e,t){const n=this.editor,i=n.editing.view,o=i.document;let r=t.target;if(function(e){for(;e;){if(e.is("editableElement")&&!e.is("rootElement"))return!0;if(Cr(e))return!1;e=e.parent}return!1}(r)){if((Si.isSafari||Si.isGecko)&&t.domEvent.detail>=3){const e=n.editing.mapper,i=r.is("attributeElement")?r.findAncestor(e=>!e.is("attributeElement")):r,o=e.toModelElement(i);t.preventDefault(),this.editor.model.change(e=>{e.setSelection(o,"in")})}return}if(!Cr(r)&&(r=r.findAncestor(Cr),!r))return;t.preventDefault(),o.isFocused||i.focus();const s=n.editing.mapper.toModelElement(r);this._setSelectionOverElement(s)}_handleSelectionChangeOnArrowKeyPress(e,t){const n=t.keyCode;if(!ji(n))return;const i=this.editor.model,o=i.schema,r=i.document.selection,s=r.getSelectedElement(),a=Bi(n,this.editor.locale.contentLanguageDirection);if(s&&o.isObject(s)){const n=a?r.getLastPosition():r.getFirstPosition(),s=o.getNearestSelectionRange(n,a?"forward":"backward");return void(s&&(i.change(e=>{e.setSelection(s)}),t.preventDefault(),e.stop()))}if(!r.isCollapsed)return;const l=this._getObjectElementNextToSelection(a);l&&o.isObject(l)&&(this._setSelectionOverElement(l),t.preventDefault(),e.stop())}_preventDefaultOnArrowKeyPress(e,t){if(!ji(t.keyCode))return;const n=this.editor.model,i=n.schema,o=n.document.selection.getSelectedElement();o&&i.isObject(o)&&(t.preventDefault(),e.stop())}_handleDelete(e){if(this.editor.isReadOnly)return;const t=this.editor.model.document.selection;if(!t.isCollapsed)return;const n=this._getObjectElementNextToSelection(e);return n?(this.editor.model.change(e=>{let i=t.anchor.parent;for(;i.isEmpty;){const t=i;i=t.parent,e.remove(t)}this._setSelectionOverElement(n)}),!0):void 0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,n=t.schema,i=t.document.selection,o=t.createSelection(i);t.modifySelection(o,{direction:e?"forward":"backward"});const r=e?o.focus.nodeBefore:o.focus.nodeAfter;return r&&n.isObject(r)?r:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass("ck-widget_selected",t);this._previouslySelected.clear()}}function gg(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}class pg extends st{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=Rr(e),Rr(e)&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor.model,n=t.document.selection.getSelectedElement();t.change(t=>{t.setAttribute("alt",e.newValue,n)})}}class fg extends Je{static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new pg(this.editor))}}n(60);class wg extends Ti{constructor(e,t){super(e);const n="ck-labeled-field-view-"+s(),i="ck-labeled-field-view-status-"+s();this.fieldView=t(this,n,i),this.set("label"),this.set("isEnabled",!0),this.set("errorText",null),this.set("infoText",null),this.set("class"),this.labelView=this._createLabelView(n),this.statusView=this._createStatusView(i),this.bind("_statusText").to(this,"errorText",this,"infoText",(e,t)=>e||t);const o=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",o.to("class"),o.if("isEnabled","ck-disabled",e=>!e)]},children:[this.labelView,this.fieldView,this.statusView]})}_createLabelView(e){const t=new mh(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new Ti(this.locale),n=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",n.if("errorText","ck-labeled-field-view__status_error"),n.if("_statusText","ck-hidden",e=>!e)],id:e,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]}),t}focus(){this.fieldView.focus()}}n(62);class bg extends Ti{constructor(e){super(e),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById");const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text",t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById")},on:{input:t.to("input")}})}render(){super.render();const e=e=>{this.element.value=e||0===e?e:""};e(this.value),this.on("change:value",(t,n,i)=>{e(i)})}select(){this.element.select()}focus(){this.element.focus()}}function _g(e,t,n){const i=new bg(e.locale);return i.set({id:t,ariaDescribedById:n}),i.bind("isReadOnly").to(e,"isEnabled",e=>!e),i.bind("hasError").to(e,"errorText",e=>!!e),i.on("input",()=>{e.errorText=null}),i}function kg({view:e}){e.listenTo(e.element,"submit",(t,n)=>{n.preventDefault(),e.fire("submit")},{useCapture:!0})}var vg='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z"/></svg>',yg='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.591 10.177l4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z"/></svg>';n(64);class xg extends Ti{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new mo,this.keystrokes=new Ui,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),vg,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),yg,"ck-button-cancel","cancel"),this._focusables=new gt,this._focusCycler=new go({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),kg({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}_createButton(e,t,n,i){const o=new Fi(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),i&&o.delegate("execute").to(this,i),o}_createLabeledInputView(){const e=this.locale.t,t=new wg(this.locale,_g);return t.label=e("Text alternative"),t.fieldView.placeholder=e("Text alternative"),t}}n(66),n(68);const Ag=fr("px");class Cg extends Je{static get pluginName(){return"ContextualBalloon"}constructor(e){super(e),this.positionLimiter=()=>{const e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},this.set("visibleView",null),this.view=new _r(e.locale),e.ui.view.body.add(this.view),e.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(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this.hasView(e.view))throw new l.b("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));const n=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),n.set(e.view,e),this._viewToStack.set(e.view,n),n===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new l.b("contextualballoon-remove-view-not-exist",[this,e]);const t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(1===t.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new l.b("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(t=>t[1]===e)[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new Tg(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>!t&&e>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(e,n)=>{if(n<2)return"";const i=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[i,n])}),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){const e=new Eg(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>!t&&e>=2?Math.min(e-1,2):0),e.listenTo(this.view,"change:top",()=>e.updatePosition()),e.listenTo(this.view,"change:left",()=>e.updatePosition()),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:n=!0,singleViewMode:i=!1}){this.view.class=t,this.view.withArrow=n,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),i&&(this._singleViewMode=!0)}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&!e.limiter&&(e=Object.assign({},e,{limiter:this.positionLimiter})),e}}class Tg extends Ti{constructor(e){super(e);const t=e.t,n=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new mo,this.buttonPrevView=this._createButtonView(t("Previous"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z"/></svg>'),this.buttonNextView=this._createButtonView(t("Next"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382l-4.043 4.042z"/></svg>'),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",n.to("isNavigationVisible",e=>e?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:n.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const n=new Fi(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n}}class Eg extends Ti{constructor(e,t){super(e);const n=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=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",n.to("numberOfPanels",e=>e?"":"ck-hidden")],style:{top:n.to("top",Ag),left:n.to("left",Ag),width:n.to("width",Ag),height:n.to("height",Ag)}},children:this.content}),this.on("change:numberOfPanels",(e,t,n,i)=>{n>i?this._addPanels(n-i):this._removePanels(i-n),this.updatePosition()})}_addPanels(e){for(;e--;){const e=new Ti;e.setTemplate({tag:"div"}),this.content.add(e),this.registerChild(e)}}_removePanels(e){for(;e--;){const e=this.content.last;this.content.remove(e),this.deregisterChild(e),e.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView,{width:n,height:i}=new no(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:n,height:i})}}}function Mg(e){const t=e.editing.view,n=_r.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}class Pg extends Je{static get requires(){return[Cg]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",n=>{const i=e.commands.get("imageTextAlternative"),o=new Fi(n);return o.set({label:t("Change image text alternative"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.085 6.22L2.943 4.078a.75.75 0 1 1 1.06-1.06l2.592 2.59A11.094 11.094 0 0 1 10 5.068c4.738 0 8.578 3.101 8.578 5.083 0 1.197-1.401 2.803-3.555 3.887l1.714 1.713a.75.75 0 0 1-.09 1.138.488.488 0 0 1-.15.084.75.75 0 0 1-.821-.16L6.17 7.304c-.258.11-.51.233-.757.365l6.239 6.24-.006.005.78.78c-.388.094-.78.166-1.174.215l-1.11-1.11h.011L4.55 8.197a7.2 7.2 0 0 0-.665.514l-.112.098 4.897 4.897-.005.006 1.276 1.276a10.164 10.164 0 0 1-1.477-.117l-.479-.479-.009.009-4.863-4.863-.022.031a2.563 2.563 0 0 0-.124.2c-.043.077-.08.158-.108.241a.534.534 0 0 0-.028.133.29.29 0 0 0 .008.072.927.927 0 0 0 .082.226c.067.133.145.26.234.379l3.242 3.365.025.01.59.623c-3.265-.918-5.59-3.155-5.59-4.668 0-1.194 1.448-2.838 3.663-3.93zm7.07.531a4.632 4.632 0 0 1 1.108 5.992l.345.344.046-.018a9.313 9.313 0 0 0 2-1.112c.256-.187.5-.392.727-.613.137-.134.27-.277.392-.431.072-.091.141-.185.203-.286.057-.093.107-.19.148-.292a.72.72 0 0 0 .036-.12.29.29 0 0 0 .008-.072.492.492 0 0 0-.028-.133.999.999 0 0 0-.036-.096 2.165 2.165 0 0 0-.071-.145 2.917 2.917 0 0 0-.125-.2 3.592 3.592 0 0 0-.263-.335 5.444 5.444 0 0 0-.53-.523 7.955 7.955 0 0 0-1.054-.768 9.766 9.766 0 0 0-1.879-.891c-.337-.118-.68-.219-1.027-.301zm-2.85.21l-.069.002a.508.508 0 0 0-.254.097.496.496 0 0 0-.104.679.498.498 0 0 0 .326.199l.045.005c.091.003.181.003.272.012a2.45 2.45 0 0 1 2.017 1.513c.024.061.043.125.069.185a.494.494 0 0 0 .45.287h.008a.496.496 0 0 0 .35-.158.482.482 0 0 0 .13-.335.638.638 0 0 0-.048-.219 3.379 3.379 0 0 0-.36-.723 3.438 3.438 0 0 0-2.791-1.543l-.028-.001h-.013z"/></svg>',tooltip:!0}),o.bind("isEnabled").to(i,"isEnabled"),this.listenTo(o,"execute",()=>{this._showForm()}),o})}_createForm(){const e=this.editor,t=e.editing.view.document;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new xg(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.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",(e,t)=>{this._hideForm(!0),t()}),this.listenTo(e.ui,"update",()=>{zr(t.selection)?this._isVisible&&function(e){const t=e.plugins.get("ContextualBalloon");if(zr(e.editing.view.document.selection)){const n=Mg(e);t.updatePosition(n)}}(e):this._hideForm(!0)}),Eo({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const e=this.editor,t=e.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._isInBalloon||this._balloon.add({view:this._form,position:Mg(e)}),n.fieldView.value=n.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select()}_hideForm(e){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class Sg extends Je{static get requires(){return[fg,Pg]}static get pluginName(){return"ImageTextAlternative"}}n(70);function Ig(e){for(const t of e.getChildren())if(t&&t.is("element","caption"))return t;return null}function Og(e){const t=e.parent;return"figcaption"==e.name&&t&&"figure"==t.name&&t.hasClass("image")?{name:!0}:null}class Ng extends Je{static get pluginName(){return"ImageCaptionEditing"}init(){const e=this.editor,t=e.editing.view,n=e.model.schema,i=e.data,o=e.editing,r=e.t;n.register("caption",{allowIn:"image",allowContentOf:"$block",isLimit:!0}),e.model.document.registerPostFixer(e=>this._insertMissingModelCaptionElement(e)),e.conversion.for("upcast").elementToElement({view:Og,model:"caption"});i.downcastDispatcher.on("insert:caption",zg(e=>e.createContainerElement("figcaption"),!1));const s=function(e,t){return n=>{const i=n.createEditableElement("figcaption");return n.setCustomProperty("imageCaption",!0,i),oh({view:e,element:i,text:t}),Pr(i,n)}}(t,r("Enter image caption"));o.downcastDispatcher.on("insert:caption",zg(s)),o.downcastDispatcher.on("insert",this._fixCaptionVisibility(e=>e.item),{priority:"high"}),o.downcastDispatcher.on("remove",this._fixCaptionVisibility(e=>e.position.parent),{priority:"high"}),t.document.registerPostFixer(e=>this._updateCaptionVisibility(e))}_updateCaptionVisibility(e){const t=this.editor.editing.mapper,n=this._lastSelectedCaption;let i;const o=this.editor.model.document.selection,r=o.getSelectedElement();if(r&&r.is("element","image")){const e=Ig(r);i=t.toViewElement(e)}const s=Rg(o.getFirstPosition().parent);if(s&&(i=t.toViewElement(s)),i)return n?(n===i||(Lg(n,e),this._lastSelectedCaption=i),jg(i,e)):(this._lastSelectedCaption=i,jg(i,e));if(n){const t=Lg(n,e);return this._lastSelectedCaption=null,t}return!1}_fixCaptionVisibility(e){return(t,n,i)=>{const o=Rg(e(n)),r=this.editor.editing.mapper,s=i.writer;if(o){const e=r.toViewElement(o);e&&(o.childCount?s.removeClass("ck-hidden",e):s.addClass("ck-hidden",e))}}}_insertMissingModelCaptionElement(e){const t=this.editor.model,n=t.document.differ.getChanges(),i=[];for(const e of n)if("insert"==e.type&&"$text"!=e.name){const n=e.position.nodeAfter;if(n.is("element","image")&&!Ig(n)&&i.push(n),!n.is("element","image")&&n.childCount)for(const e of t.createRangeIn(n).getItems())e.is("element","image")&&!Ig(e)&&i.push(e)}for(const t of i)e.appendElement("caption",t);return!!i.length}}function zg(e,t=!0){return(n,i,o)=>{const r=i.item;if((r.childCount||t)&&Rr(r.parent)){if(!o.consumable.consume(i.item,"insert"))return;const t=o.mapper.toViewElement(i.range.start.parent),n=e(o.writer),s=o.writer;r.childCount||s.addClass("ck-hidden",n),function(e,t,n,i){const o=i.writer.createPositionAt(n,"end");i.writer.insert(o,e),i.mapper.bindElements(t,e)}(n,i.item,t,o)}}}function Rg(e){const t=e.getAncestors({includeSelf:!0}).find(e=>"caption"==e.name);return t&&t.parent&&"image"==t.parent.name?t:null}function Lg(e,t){return!e.childCount&&!e.hasClass("ck-hidden")&&(t.addClass("ck-hidden",e),!0)}function jg(e,t){return!!e.hasClass("ck-hidden")&&(t.removeClass("ck-hidden",e),!0)}n(72);class Dg extends st{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=Rr(e),e&&e.hasAttribute("width")?this.value={width:e.getAttribute("width"),height:null}:this.value=null}execute(e){const t=this.editor.model,n=t.document.selection.getSelectedElement();this.value={width:e.width,height:null},n&&t.change(t=>{t.setAttribute("width",e.width,n)})}}class Bg extends Je{static get pluginName(){return"ImageResizeEditing"}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"imageResize:original",value:null,icon:"original"},{name:"imageResize:25",value:"25",icon:"small"},{name:"imageResize:50",value:"50",icon:"medium"},{name:"imageResize:75",value:"75",icon:"large"}]})}init(){const e=this.editor,t=new Dg(e);this._registerSchema(),this._registerConverters(),e.commands.add("imageResize",t)}_registerSchema(){this.editor.model.schema.extend("image",{allowAttributes:"width"}),this.editor.model.schema.setAttributeProperties("width",{isFormatting:!0})}_registerConverters(){const e=this.editor;e.conversion.for("downcast").add(e=>e.on("attribute:width:image",(e,t,n)=>{if(!n.consumable.consume(t.item,e.name))return;const i=n.writer,o=n.mapper.toViewElement(t.item);null!==t.attributeNewValue?(i.setStyle("width",t.attributeNewValue,o),i.addClass("image_resized",o)):(i.removeStyle("width",o),i.removeClass("image_resized",o))})),e.conversion.for("upcast").attributeToAttribute({view:{name:"figure",styles:{width:/.+/}},model:{key:"width",value:e=>e.getStyle("width")}})}}var Vg='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M10 8H2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-6a.5.5 0 0 1 .5-.5h8z"/></svg>';const Fg={small:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M7 10H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5h5z"/></svg>',medium:Vg,large:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M13 6H2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5h11z"/></svg>',original:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M18.095 2H1.905C.853 2 0 2.895 0 4v12c0 1.105.853 2 1.905 2h16.19C19.147 18 20 17.105 20 16V4c0-1.105-.853-2-1.905-2zm0 1.5c.263 0 .476.224.476.5v12c0 .276-.213.5-.476.5H1.905a.489.489 0 0 1-.476-.5V4c0-.276.213-.5.476-.5h16.19z"/></svg>'};class Hg extends Je{static get requires(){return[Bg]}static get pluginName(){return"ImageResizeButtons"}constructor(e){super(e),this._resizeUnit=e.config.get("image.resizeUnit")}init(){const e=this.editor,t=e.config.get("image.resizeOptions"),n=e.commands.get("imageResize");this.bind("isEnabled").to(n);for(const e of t)this._registerImageResizeButton(e);this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor,{name:n,value:i,icon:o}=e,r=i?i+this._resizeUnit:null;t.ui.componentFactory.add(n,n=>{const i=new Fi(n),s=t.commands.get("imageResize"),a=this._getOptionLabelValue(e,!0);if(!Fg[o])throw new l.b("imageresizebuttons-missing-icon",t,e);return i.set({label:a,icon:Fg[o],tooltip:a,isToggleable:!0}),i.bind("isEnabled").to(this),i.bind("isOn").to(s,"value",Ug(r)),this.listenTo(i,"execute",()=>{t.execute("imageResize",{width:r})}),i})}_registerImageResizeDropdown(e){const t=this.editor,n=t.t,i=e.find(e=>!e.value);t.ui.componentFactory.add("imageResize",o=>{const r=t.commands.get("imageResize"),s=Mo(o,ho),a=s.buttonView;return a.set({tooltip:n("Resize image"),commandValue:i.value,icon:Vg,isToggleable:!0,label:this._getOptionLabelValue(i),withText:!0,class:"ck-resize-image-button"}),a.bind("label").to(r,"value",e=>e&&e.width?e.width:this._getOptionLabelValue(i)),s.bind("isOn").to(r),s.bind("isEnabled").to(this),So(s,this._getResizeDropdownListItemDefinitions(e,r)),s.listView.ariaLabel=n("Image resize list"),this.listenTo(s,"execute",e=>{t.execute(e.source.commandName,{width:e.source.commandValue}),t.editing.view.focus()}),s})}_getOptionLabelValue(e,t){const n=this.editor.t;return e.label?e.label:t?e.value?n("Resize image to %0",e.value+this._resizeUnit):n("Resize image to the original size"):e.value?e.value+this._resizeUnit:n("Original")}_getResizeDropdownListItemDefinitions(e,t){const n=new Qe;return e.map(e=>{const i=e.value?e.value+this._resizeUnit:null,o={type:"button",model:new $m({commandName:"imageResize",commandValue:i,label:this._getOptionLabelValue(e),withText:!0,icon:null})};o.model.bind("isOn").to(t,"value",Ug(i)),n.add(o)}),n}}function Ug(e){return t=>null===e&&t===e||t&&t.width===e}class Wg{constructor(e){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=e,this._referenceCoordinates=null}begin(e,t,n){const i=new no(t);this.activeHandlePosition=function(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const n of t)if(e.classList.contains("ck-widget__resizer__handle-"+n))return n}(e),this._referenceCoordinates=function(e,t){const n=new no(e),i=t.split("-"),o={x:"right"==i[1]?n.right:n.left,y:"bottom"==i[0]?n.bottom:n.top};return o.x+=e.ownerDocument.defaultView.scrollX,o.y+=e.ownerDocument.defaultView.scrollY,o}(t,function(e){const t=e.split("-"),n={top:"bottom",bottom:"top",left:"right",right:"left"};return`${n[t[0]]}-${n[t[1]]}`}(this.activeHandlePosition)),this.originalWidth=i.width,this.originalHeight=i.height,this.aspectRatio=i.width/i.height;const o=n.style.width;o&&o.match(/^\d+\.?\d*%$/)?this.originalWidthPercents=parseFloat(o):this.originalWidthPercents=function(e,t){const n=e.parentElement,i=parseFloat(n.ownerDocument.defaultView.getComputedStyle(n).width);return t.width/i*100}(n,i)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}Ye(Wg,Fe);class $g{constructor(e){this._options=e,this._domResizerWrapper=null,this._viewResizerWrapper=null,this.set("isEnabled",!0),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",e=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),e.stop())},{priority:"high"}),this.on("change:isEnabled",()=>{this.isEnabled&&this.redraw()})}attach(){const e=this,t=this._options.viewElement;this._options.editor.editing.view.change(n=>{const i=n.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(t){const n=this.toDomElement(t);return e._appendHandles(n),e._appendSizeUI(n),e._domResizerWrapper=n,e.on("change:isEnabled",(e,t,i)=>{n.style.display=i?"":"none"}),n.style.display=e.isEnabled?"":"none",n}));n.insert(n.createPositionAt(t,"end"),i),n.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=i})}begin(e){this.state=new Wg(this._options),this._sizeUI.bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const t=this._proposeNewSize(e);this._options.editor.editing.view.change(e=>{const n=this._options.unit||"%",i=("%"===n?t.widthPercents:t.width)+n;e.setStyle("width",i,this._options.viewElement)});const n=this._getHandleHost(),i=new no(n);t.handleHostWidth=Math.round(i.width),t.handleHostHeight=Math.round(i.height);const o=new no(n);t.width=Math.round(o.width),t.height=Math.round(o.height),this.redraw(i),this.state.update(t)}commit(){const e=this._options.unit||"%",t=("%"===e?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(t)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const t=this._domResizerWrapper;if(!((n=t)&&n.ownerDocument&&n.ownerDocument.contains(n)))return;var n;const i=t.parentElement,o=this._getHandleHost(),r=this._viewResizerWrapper,s=[r.getStyle("width"),r.getStyle("height"),r.getStyle("left"),r.getStyle("top")];let a;if(i.isSameNode(o)){const t=e||new no(o);a=[t.width+"px",t.height+"px",void 0,void 0]}else a=[o.offsetWidth+"px",o.offsetHeight+"px",o.offsetLeft+"px",o.offsetTop+"px"];"same"!==Lo(s,a)&&this._options.editor.editing.view.change(e=>{e.setStyle({width:a[0],height:a[1],left:a[2],top:a[3]},r)})}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeUI.dismiss(),this._sizeUI.isVisible=!1;this._options.editor.editing.view.change(e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const t=this.state,n={x:(i=e).pageX,y:i.pageY};var i;const o=!this._options.isCentered||this._options.isCentered(this),r={x:t._referenceCoordinates.x-(n.x+t.originalWidth),y:n.y-t.originalHeight-t._referenceCoordinates.y};o&&t.activeHandlePosition.endsWith("-right")&&(r.x=n.x-(t._referenceCoordinates.x+t.originalWidth)),o&&(r.x*=2);const s={width:Math.abs(t.originalWidth+r.x),height:Math.abs(t.originalHeight+r.y)};s.dominant=s.width/t.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/t.aspectRatio:a.width=a.height*t.aspectRatio,{width:Math.round(a.width),height:Math.round(a.height),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*a.width*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}_appendHandles(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const i of t)e.appendChild(new ii({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(n=i,"ck-widget__resizer__handle-"+n)}}).render());var n}_appendSizeUI(e){const t=new qg;t.render(),this._sizeUI=t,e.appendChild(t.element)}}Ye($g,Fe);class qg extends Ti{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("activeHandlePosition",e=>e?"ck-orientation-"+e:"")],style:{display:e.if("isVisible","none",e=>!e)}},children:[{text:e.to("label")}]})}bindToState(e,t){this.bind("isVisible").to(t,"proposedWidth",t,"proposedHeight",(e,t)=>null!==e&&null!==t),this.bind("label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",(t,n,i)=>"px"===e.unit?`${t}×${n}`:i+"%"),this.bind("activeHandlePosition").to(t)}dismiss(){this.unbind(),this.isVisible=!1}}var Yg=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return b(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Pc(e,t,{leading:i,maxWait:t,trailing:o})};n(74);class Jg extends Je{static get pluginName(){return"WidgetResize"}init(){this.set("_visibleResizer",null),this.set("_activeResizer",null),this._resizers=new Map;const e=Wi.window.document;this.editor.model.schema.setAttributeProperties("width",{isFormatting:!0}),this.editor.editing.view.addObserver($r),this._observer=Object.create(xi),this.listenTo(this.editor.editing.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 t=()=>{this._visibleResizer&&this._visibleResizer.redraw()},n=Yg(t,200);this.on("change:_visibleResizer",t),this.editor.ui.on("update",n),this._observer.listenTo(Wi.window,"resize",n);const i=this.editor.editing.view.document.selection;i.on("change",()=>{const e=i.getSelectedElement();this._visibleResizer=this._getResizerByViewElement(e)||null})}destroy(){this._observer.stopListening();for(const e of this._resizers.values())e.destroy()}attachTo(e){const t=new $g(e),n=this.editor.plugins;if(t.attach(),n.has("WidgetToolbarRepository")){const e=n.get("WidgetToolbarRepository");t.on("begin",()=>{e.forceDisabled("resize")},{priority:"lowest"}),t.on("cancel",()=>{e.clearForceDisabled("resize")},{priority:"highest"}),t.on("commit",()=>{e.clearForceDisabled("resize")},{priority:"highest"})}return this._resizers.set(e.viewElement,t),t}_getResizerByHandle(e){for(const t of this._resizers.values())if(t.containsHandle(e))return t}_getResizerByViewElement(e){return this._resizers.get(e)}_mouseDownListener(e,t){const n=t.domTarget;$g.isResizeHandle(n)&&(this._activeResizer=this._getResizerByHandle(n),this._activeResizer&&(this._activeResizer.begin(n),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}Ye(Jg,Fe);class Kg extends Je{static get requires(){return[Jg]}static get pluginName(){return"ImageResizeHandles"}init(){const e=this.editor,t=e.commands.get("imageResize");this.bind("isEnabled").to(t),e.editing.downcastDispatcher.on("insert:image",(t,n,i)=>{const o=i.mapper.toViewElement(n.item),r=e.plugins.get(Jg).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:n.item,viewElement:o,editor:e,getHandleHost:e=>e.querySelector("img"),getResizeHost:e=>e,isCentered(){const e=n.item.getAttribute("imageStyle");return!e||"full"==e||"alignCenter"==e},onCommit(t){e.execute("imageResize",{width:t})}});r.on("updateSize",()=>{o.hasClass("image_resized")||e.editing.view.change(e=>{e.addClass("image_resized",o)})}),r.bind("isEnabled").to(this)},{priority:"low"})}}n(76);class Xg extends st{constructor(e,t){super(e),this.defaultStyle=!1,this.styles=t.reduce((e,t)=>(e[t.name]=t,t.isDefault&&(this.defaultStyle=t.name),e),{})}refresh(){const e=this.editor.model.document.selection.getSelectedElement();if(this.isEnabled=Rr(e),e)if(e.hasAttribute("imageStyle")){const t=e.getAttribute("imageStyle");this.value=!!this.styles[t]&&t}else this.value=this.defaultStyle;else this.value=!1}execute(e){const t=e.value,n=this.editor.model,i=n.document.selection.getSelectedElement();n.change(e=>{this.styles[t].isDefault?e.removeAttribute("imageStyle",i):e.setAttribute("imageStyle",t,i)})}}function Gg(e,t){for(const n of t)if(n.name===e)return n}var Qg='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5V3h16v1.5zm2.5 3V12h11V7.5h-11zM4.061 6H15.94c.586 0 1.061.407 1.061.91v5.68c0 .503-.475.91-1.061.91H4.06c-.585 0-1.06-.407-1.06-.91V6.91C3 6.406 3.475 6 4.061 6zM2 16.5V15h16v1.5z"/></svg>',Zg='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M18 4.5V3H2v1.5h16zm0 3V6h-5.674v1.5H18zm0 3V9h-5.674v1.5H18zm0 3V12h-5.674v1.5H18zm-8.5-6V12h-6V7.5h6zm.818-1.5H2.682C2.305 6 2 6.407 2 6.91v5.68c0 .503.305.91.682.91h7.636c.377 0 .682-.407.682-.91V6.91c0-.503-.305-.91-.682-.91zM18 16.5V15H2v1.5h16z"/></svg>',ep='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5V3h16v1.5zm4.5 3V12h7V7.5h-7zM5.758 6h8.484c.419 0 .758.407.758.91v5.681c0 .502-.34.909-.758.909H5.758c-.419 0-.758-.407-.758-.91V6.91c0-.503.34-.91.758-.91zM2 16.5V15h16v1.5z"/></svg>',tp='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5V3h16v1.5zm0 3V6h5.674v1.5zm0 3V9h5.674v1.5zm0 3V12h5.674v1.5zm8.5-6V12h6V7.5h-6zM9.682 6h7.636c.377 0 .682.407.682.91v5.68c0 .503-.305.91-.682.91H9.682c-.377 0-.682-.407-.682-.91V6.91c0-.503.305-.91.682-.91zM2 16.5V15h16v1.5z"/></svg>';const np={full:{name:"full",title:"Full size image",icon:Qg,isDefault:!0},side:{name:"side",title:"Side image",icon:tp,className:"image-style-side"},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:Zg,className:"image-style-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:ep,className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:tp,className:"image-style-align-right"}},ip={full:Qg,left:Zg,right:tp,center:ep};function op(e=[]){return e.map(rp)}function rp(e){if("string"==typeof e){const t=e;np[t]?e=Object.assign({},np[t]):(console.warn(Object(l.a)("image-style-not-found"),{name:t}),e={name:t})}else if(np[e.name]){const t=np[e.name],n=Object.assign({},e);for(const i in t)Object.prototype.hasOwnProperty.call(e,i)||(n[i]=t[i]);e=n}return"string"==typeof e.icon&&ip[e.icon]&&(e.icon=ip[e.icon]),e}class sp extends Je{static get pluginName(){return"ImageStyleEditing"}init(){const e=this.editor,t=e.model.schema,n=e.data,i=e.editing;e.config.define("image.styles",["full","side"]);const o=op(e.config.get("image.styles"));t.extend("image",{allowAttributes:"imageStyle"});const r=function(e){return(t,n,i)=>{if(!i.consumable.consume(n.item,t.name))return;const o=Gg(n.attributeNewValue,e),r=Gg(n.attributeOldValue,e),s=i.mapper.toViewElement(n.item),a=i.writer;r&&a.removeClass(r.className,s),o&&a.addClass(o.className,s)}}(o);i.downcastDispatcher.on("attribute:imageStyle:image",r),n.downcastDispatcher.on("attribute:imageStyle:image",r),n.upcastDispatcher.on("element:figure",function(e){const t=e.filter(e=>!e.isDefault);return(e,n,i)=>{if(!n.modelRange)return;const o=n.viewItem,r=lt(n.modelRange.getItems());if(i.schema.checkAttribute(r,"imageStyle"))for(const e of t)i.consumable.consume(o,{classes:e.className})&&i.writer.setAttribute("imageStyle",e.name,r)}}(o),{priority:"low"}),e.commands.add("imageStyle",new Xg(e,o))}}n(78);class ap extends Je{static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){const e=function(e,t){for(const n of e)t[n.title]&&(n.title=t[n.title]);return e}(op(this.editor.config.get("image.styles")),this.localizedDefaultStylesTitles);for(const t of e)this._createButton(t)}_createButton(e){const t=this.editor,n="imageStyle:"+e.name;t.ui.componentFactory.add(n,n=>{const i=t.commands.get("imageStyle"),o=new Fi(n);return o.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(i,"isEnabled"),o.bind("isOn").to(i,"value",t=>t===e.name),this.listenTo(o,"execute",()=>{t.execute("imageStyle",{value:e.name}),t.editing.view.focus()}),o})}}class lp extends Je{static get requires(){return[Cg]}static get pluginName(){return"WidgetToolbarRepository"}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",t=>{(function(e){const t=e.getSelectedElement();return!(!t||!Cr(t))})(e.editing.view.document.selection)&&t.stop()},{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:n,getRelatedElement:i,balloonClassName:o="ck-toolbar-container"}){if(!n.length)return void console.warn(Object(l.a)("widget-toolbar-no-items"),{toolbarId:e});const r=this.editor,s=r.t,a=new _o(r.locale);if(a.ariaLabel=t||s("Widget toolbar"),this._toolbarDefinitions.has(e))throw new l.b("widget-toolbar-duplicated",this,{toolbarId:e});a.fillFromConfig(n,r.ui.componentFactory),this._toolbarDefinitions.set(e,{view:a,getRelatedElement:i,balloonClassName:o})}_updateToolbarsVisibility(){let e=0,t=null,n=null;for(const i of this._toolbarDefinitions.values()){const o=i.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&o)if(this.editor.ui.focusTracker.isFocused){const r=o.getAncestors().length;r>e&&(e=r,t=o,n=i)}else this._isToolbarVisible(i)&&this._hideToolbar(i);else this._isToolbarInBalloon(i)&&this._hideToolbar(i)}n&&this._showToolbar(n,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?cp(this.editor,t):this._isToolbarInBalloon(e)||(this._balloon.add({view:e.view,position:dp(this.editor,t),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const e of this._toolbarDefinitions.values())if(this._isToolbarVisible(e)){const t=e.getRelatedElement(this.editor.editing.view.document.selection);cp(this.editor,t)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function cp(e,t){const n=e.plugins.get("ContextualBalloon"),i=dp(e,t);n.updatePosition(i)}function dp(e,t){const n=e.editing.view,i=_r.defaultPositions;return{target:n.domConverter.mapViewToDom(t),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,Or]}}class up extends Ti{constructor(e){super(e),this.buttonView=new Fi(e),this._fileInputView=new hp(e),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class hp extends Ti{constructor(e){super(e),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}function mp(e){const t=e.map(e=>e.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}class gp extends Je{static get pluginName(){return"ImageUploadUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageUpload",n=>{const i=new up(n),o=e.commands.get("imageUpload"),r=e.config.get("image.upload.types"),s=mp(r);return i.set({acceptedType:r.map(e=>"image/"+e).join(","),allowMultipleFiles:!0}),i.buttonView.set({label:t("Insert image"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.91 10.54c.26-.23.64-.21.88.03l3.36 3.14 2.23-2.06a.64.64 0 0 1 .87 0l2.52 2.97V4.5H3.2v10.12l3.71-4.08zm10.27-7.51c.6 0 1.09.47 1.09 1.05v11.84c0 .59-.49 1.06-1.09 1.06H2.79c-.6 0-1.09-.47-1.09-1.06V4.08c0-.58.49-1.05 1.1-1.05h14.38zm-5.22 5.56a1.96 1.96 0 1 1 3.4-1.96 1.96 1.96 0 0 1-3.4 1.96z"/></svg>',tooltip:!0}),i.buttonView.bind("isEnabled").to(o),i.on("done",(t,n)=>{const i=Array.from(n).filter(e=>s.test(e.type));i.length&&e.execute("imageUpload",{file:i})}),i})}}n(80),n(82),n(84);class pp extends Je{constructor(e){super(e),this.placeholder="data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 250"><rect rx="4"/></svg>')}init(){this.editor.editing.downcastDispatcher.on("attribute:uploadStatus:image",(...e)=>this.uploadStatusChange(...e))}uploadStatusChange(e,t,n){const i=this.editor,o=t.item,r=o.getAttribute("uploadId");if(!n.consumable.consume(t.item,e.name))return;const s=i.plugins.get(tt),a=r?t.attributeNewValue:null,l=this.placeholder,c=i.editing.mapper.toViewElement(o),d=n.writer;if("reading"==a)return fp(c,d),void wp(l,c,d);if("uploading"==a){const e=s.loaders.get(r);return fp(c,d),void(e?(bp(c,d),function(e,t,n,i){const o=function(e){const t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}(t);t.insert(t.createPositionAt(e,"end"),o),n.on("change:uploadedPercent",(e,t,n)=>{i.change(e=>{e.setStyle("width",n+"%",o)})})}(c,d,e,i.editing.view),function(e,t,n){if(n.data){const i=Dr(e);t.setAttribute("src",n.data,i)}}(c,d,e)):wp(l,c,d))}"complete"==a&&s.loaders.get(r)&&function(e,t,n){const i=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),i),setTimeout(()=>{n.change(e=>e.remove(e.createRangeOn(i)))},3e3)}(c,d,i.editing.view),function(e,t){kp(e,t,"progressBar")}(c,d),bp(c,d),function(e,t){t.removeClass("ck-appear",e)}(c,d)}}function fp(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function wp(e,t,n){t.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",t);const i=Dr(t);i.getAttribute("src")!==e&&n.setAttribute("src",e,i),_p(t,"placeholder")||n.insert(n.createPositionAfter(i),function(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(n))}function bp(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),kp(e,t,"placeholder")}function _p(e,t){for(const n of e.getChildren())if(n.getCustomProperty(t))return n}function kp(e,t,n){const i=_p(e,n);i&&t.remove(t.createRangeOn(i))}class vp{constructor(e){this.document=e}createDocumentFragment(e){return new la(this.document,e)}createElement(e,t,n){return new Xs(this.document,e,t,n)}createText(e){return new cs(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,n){return n._insertChild(e,t)}removeChildren(e,t,n){return n._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const n=e.parent;if(n){const i=n.getChildIndex(e);return this.removeChildren(i,1,n),this.insertChild(i,t,n),!0}return!1}unwrapElement(e){const t=e.parent;if(t){const n=t.getChildIndex(e);this.remove(e),this.insertChild(n,e.getChildren(),t)}}rename(e,t){const n=new Xs(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,n)?n:null}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){Zi(e)&&void 0===n&&(n=t),n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return na._createAt(e,t)}createPositionAfter(e){return na._createAfter(e)}createPositionBefore(e){return na._createBefore(e)}createRange(e,t){return new ia(e,t)}createRangeOn(e){return ia._createOn(e)}createRangeIn(e){return ia._createIn(e)}createSelection(e,t,n){return new aa(e,t,n)}}class yp extends st{refresh(){const e=this.editor.model.document.selection.getSelectedElement(),t=e&&"image"===e.name||!1;this.isEnabled=jr(this.editor.model)||t}execute(e){const t=this.editor,n=t.model,i=t.plugins.get(tt);n.change(t=>{const o=Array.isArray(e.file)?e.file:[e.file];for(const e of o)xp(t,n,i,e)})}}function xp(e,t,n,i){const o=n.createLoader(i);o&&Lr(e,t,{uploadId:o.id})}class Ap extends Je{static get requires(){return[tt,hl,Ra]}static get pluginName(){return"ImageUploadEditing"}constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}})}init(){const e=this.editor,t=e.model.document,n=e.model.schema,i=e.conversion,o=e.plugins.get(tt),r=mp(e.config.get("image.upload.types"));n.extend("image",{allowAttributes:["uploadId","uploadStatus"]}),e.commands.add("imageUpload",new yp(e)),i.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",(t,n)=>{if(i=n.dataTransfer,Array.from(i.types).includes("text/html")&&""!==i.getData("text/html"))return;var i;const o=Array.from(n.dataTransfer.files).filter(e=>!!e&&r.test(e.type)),s=n.targetRanges.map(t=>e.editing.mapper.toModelRange(t));e.model.change(n=>{n.setSelection(s),o.length&&(t.stop(),e.model.enqueueChange("default",()=>{e.execute("imageUpload",{file:o})}))})}),this.listenTo(e.plugins.get(Ra),"inputTransformation",(t,n)=>{const i=Array.from(e.editing.view.createRangeIn(n.content)).filter(e=>{return!(!(t=e.item).is("element","img")||!t.getAttribute("src"))&&(t.getAttribute("src").match(/^data:image\/\w+;base64,/g)||t.getAttribute("src").match(/^blob:/g))&&!e.item.getAttribute("uploadProcessed");var t}).map(e=>{return{promise:(t=e.item,new Promise((e,n)=>{const i=t.getAttribute("src");fetch(i).then(e=>e.blob()).then(t=>{const n=function(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}(t,i),o=n.replace("image/",""),r=new File([t],"image."+o,{type:n});e(r)}).catch(n)})),imageElement:e.item};var t});if(!i.length)return;const r=new vp(e.editing.view.document);for(const e of i){r.setAttribute("uploadProcessed",!0,e.imageElement);const t=o.createLoader(e.promise);t&&(r.setAttribute("src","",e.imageElement),r.setAttribute("uploadId",t.id,e.imageElement))}}),e.editing.view.document.on("dragover",(e,t)=>{t.preventDefault()}),t.on("change",()=>{const n=t.differ.getChanges({includeChangesInGraveyard:!0});for(const t of n)if("insert"==t.type&&"$text"!=t.name){const n=t.position.nodeAfter,i="$graveyard"==t.position.root.rootName;for(const t of Cp(e,n)){const e=t.getAttribute("uploadId");if(!e)continue;const n=o.loaders.get(e);n&&(i?n.abort():"idle"==n.status&&this._readAndUpload(n,t))}}})}_readAndUpload(e,t){const n=this.editor,i=n.model,o=n.locale.t,r=n.plugins.get(tt),s=n.plugins.get(hl);return i.enqueueChange("transparent",e=>{e.setAttribute("uploadStatus","reading",t)}),e.read().then(()=>{const o=e.upload();if(Si.isSafari){const e=Dr(n.editing.mapper.toViewElement(t));n.editing.view.once("render",()=>{if(!e.parent)return;const t=n.editing.view.domConverter.mapViewToDom(e.parent);if(!t)return;const i=t.style.display;t.style.display="none",t._ckHack=t.offsetHeight,t.style.display=i})}return i.enqueueChange("transparent",e=>{e.setAttribute("uploadStatus","uploading",t)}),o}).then(e=>{i.enqueueChange("transparent",n=>{n.setAttributes({uploadStatus:"complete",src:e.default},t),this._parseAndSetSrcsetAttributeOnImage(e,t,n)}),a()}).catch(n=>{if("error"!==e.status&&"aborted"!==e.status)throw n;"error"==e.status&&n&&s.showWarning(n,{title:o("Upload failed"),namespace:"upload"}),a(),i.enqueueChange("transparent",e=>{e.remove(t)})});function a(){i.enqueueChange("transparent",e=>{e.removeAttribute("uploadId",t),e.removeAttribute("uploadStatus",t)}),r.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let i=0;const o=Object.keys(e).filter(e=>{const t=parseInt(e,10);if(!isNaN(t))return i=Math.max(i,t),!0}).map(t=>`${e[t]} ${t}w`).join(", ");""!=o&&n.setAttribute("srcset",{data:o,width:i},t)}}function Cp(e,t){return Array.from(e.model.createRangeOn(t)).filter(e=>e.item.is("element","image")).map(e=>e.item)}class Tp extends st{constructor(e){super(e),this._childCommands=[]}refresh(){}execute(...e){return this._getFirstEnabledCommand().execute(e)}registerChildCommand(e){this._childCommands.push(e),e.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){return this._childCommands.find(e=>e.isEnabled)}}class Ep extends Je{static get pluginName(){return"IndentEditing"}init(){const e=this.editor;e.commands.add("indent",new Tp(e)),e.commands.add("outdent",new Tp(e))}}var Mp='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zM1.632 6.95L5.02 9.358a.4.4 0 0 1-.013.661l-3.39 2.207A.4.4 0 0 1 1 11.892V7.275a.4.4 0 0 1 .632-.326z"/></svg>',Pp='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zm1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z"/></svg>';class Sp extends Je{static get pluginName(){return"IndentUI"}init(){const e=this.editor,t=e.locale,n=e.t,i="ltr"==t.uiLanguageDirection?Mp:Pp,o="ltr"==t.uiLanguageDirection?Pp:Mp;this._defineButton("indent",n("Increase indent"),i),this._defineButton("outdent",n("Decrease indent"),o)}_defineButton(e,t,n){const i=this.editor;i.ui.componentFactory.add(e,o=>{const r=i.commands.get(e),s=new Fi(o);return s.set({label:t,icon:n,tooltip:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(s,"execute",()=>{i.execute(e),i.editing.view.focus()}),s})}}class Ip extends st{constructor(e,t){super(e),this.type=t}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=e.document,n=Array.from(t.selection.getSelectedBlocks()).filter(t=>Np(t,e.schema)),i=!0===this.value;e.change(e=>{if(i){let t=n[n.length-1].nextSibling,i=Number.POSITIVE_INFINITY,o=[];for(;t&&"listItem"==t.name&&0!==t.getAttribute("listIndent");){const e=t.getAttribute("listIndent");e<i&&(i=e);const n=e-i;o.push({element:t,listIndent:n}),t=t.nextSibling}o=o.reverse();for(const t of o)e.setAttribute("listIndent",t.listIndent,t.element)}if(!i){let e=Number.POSITIVE_INFINITY;for(const t of n)t.is("element","listItem")&&t.getAttribute("listIndent")<e&&(e=t.getAttribute("listIndent"));e=0===e?1:e,Op(n,!0,e),Op(n,!1,e)}for(const t of n.reverse())i&&"listItem"==t.name?e.rename(t,"paragraph"):i||"listItem"==t.name?i||"listItem"!=t.name||t.getAttribute("listType")==this.type||e.setAttribute("listType",this.type,t):(e.setAttributes({listType:this.type,listIndent:0},t),e.rename(t,"listItem"));this.fire("_executeCleanup",n)})}_getValue(){const e=lt(this.editor.model.document.selection.getSelectedBlocks());return!!e&&e.is("element","listItem")&&e.getAttribute("listType")==this.type}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=lt(e.getSelectedBlocks());return!!n&&Np(n,t)}}function Op(e,t,n){const i=t?e[0]:e[e.length-1];if(i.is("element","listItem")){let o=i[t?"previousSibling":"nextSibling"],r=i.getAttribute("listIndent");for(;o&&o.is("element","listItem")&&o.getAttribute("listIndent")>=n;)r>o.getAttribute("listIndent")&&(r=o.getAttribute("listIndent")),o.getAttribute("listIndent")==r&&e[t?"unshift":"push"](o),o=o[t?"previousSibling":"nextSibling"]}}function Np(e,t){return t.checkChild(e.parent,"listItem")&&!t.isObject(e)}class zp extends st{constructor(e,t){super(e),this._indentBy="forward"==t?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=e.document;let n=Array.from(t.selection.getSelectedBlocks());e.change(e=>{const t=n[n.length-1];let i=t.nextSibling;for(;i&&"listItem"==i.name&&i.getAttribute("listIndent")>t.getAttribute("listIndent");)n.push(i),i=i.nextSibling;this._indentBy<0&&(n=n.reverse());for(const t of n){const n=t.getAttribute("listIndent")+this._indentBy;n<0?e.rename(t,"paragraph"):e.setAttribute("listIndent",n,t)}this.fire("_executeCleanup",n)})}_checkEnabled(){const e=lt(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("element","listItem"))return!1;if(this._indentBy>0){const t=e.getAttribute("listIndent"),n=e.getAttribute("listType");let i=e.previousSibling;for(;i&&i.is("element","listItem")&&i.getAttribute("listIndent")>=t;){if(i.getAttribute("listIndent")==t)return i.getAttribute("listType")==n;i=i.previousSibling}return!1}return!0}}function Rp(e,t){const n=t.mapper,i=t.writer,o="numbered"==e.getAttribute("listType")?"ol":"ul",r=function(e){const t=e.createContainerElement("li");return t.getFillerOffset=Fp,t}(i),s=i.createContainerElement(o,null);return i.insert(i.createPositionAt(s,0),r),n.bindElements(e,r),r}function Lp(e,t,n,i){const o=t.parent,r=n.mapper,s=n.writer;let a=r.toViewPosition(i.createPositionBefore(e));const l=Bp(e.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:e.getAttribute("listIndent")}),c=e.previousSibling;if(l&&l.getAttribute("listIndent")==e.getAttribute("listIndent")){const e=r.toViewElement(l);a=s.breakContainer(s.createPositionAfter(e))}else if(c&&"listItem"==c.name){a=r.toViewPosition(i.createPositionAt(c,"end"));const e=r.findMappedViewAncestor(a),t=function(e){for(const t of e.getChildren())if("ul"==t.name||"ol"==t.name)return t;return null}(e);a=t?s.createPositionBefore(t):s.createPositionAt(e,"end")}else a=r.toViewPosition(i.createPositionBefore(e));if(a=Dp(a),s.insert(a,o),c&&"listItem"==c.name){const e=r.toViewElement(c),n=s.createRange(s.createPositionAt(e,0),a).getWalker({ignoreElementEnd:!0});for(const e of n)if(e.item.is("element","li")){const i=s.breakContainer(s.createPositionBefore(e.item)),o=e.item.parent,r=s.createPositionAt(t,"end");jp(s,r.nodeBefore,r.nodeAfter),s.move(s.createRangeOn(o),r),n.position=i}}else{const n=o.nextSibling;if(n&&(n.is("element","ul")||n.is("element","ol"))){let i=null;for(const t of n.getChildren()){const n=r.toModelElement(t);if(!(n&&n.getAttribute("listIndent")>e.getAttribute("listIndent")))break;i=t}i&&(s.breakContainer(s.createPositionAfter(i)),s.move(s.createRangeOn(i.parent),s.createPositionAt(t,"end")))}}jp(s,o,o.nextSibling),jp(s,o.previousSibling,o)}function jp(e,t,n){return!t||!n||"ul"!=t.name&&"ol"!=t.name||t.name!=n.name||t.getAttribute("class")!==n.getAttribute("class")?null:e.mergeContainers(e.createPositionAfter(t))}function Dp(e){return e.getLastMatchingPosition(e=>e.item.is("uiElement"))}function Bp(e,t){const n=!!t.sameIndent,i=!!t.smallerIndent,o=t.listIndent;let r=e;for(;r&&"listItem"==r.name;){const e=r.getAttribute("listIndent");if(n&&o==e||i&&o>e)return r;r="forward"===t.direction?r.nextSibling:r.previousSibling}return null}function Vp(e,t,n,i){e.ui.componentFactory.add(t,o=>{const r=e.commands.get(t),s=new Fi(o);return s.set({label:n,icon:i,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>{e.execute(t),e.editing.view.focus()}),s})}function Fp(){const e=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||e?0:ea.call(this)}function Hp(e){return(t,n,i)=>{const o=i.consumable;if(!o.test(n.item,"insert")||!o.test(n.item,"attribute:listType")||!o.test(n.item,"attribute:listIndent"))return;o.consume(n.item,"insert"),o.consume(n.item,"attribute:listType"),o.consume(n.item,"attribute:listIndent");const r=n.item;Lp(r,Rp(r,i),i,e)}}function Up(e,t,n){if(!n.consumable.consume(t.item,"attribute:listType"))return;const i=n.mapper.toViewElement(t.item),o=n.writer;o.breakContainer(o.createPositionBefore(i)),o.breakContainer(o.createPositionAfter(i));const r=i.parent,s="numbered"==t.attributeNewValue?"ol":"ul";o.rename(s,r)}function Wp(e,t,n){const i=n.mapper.toViewElement(t.item).parent,o=n.writer;jp(o,i,i.nextSibling),jp(o,i.previousSibling,i);for(const e of t.item.getChildren())n.consumable.consume(e,"insert")}function $p(e,t,n){if("listItem"!=t.item.name){let e=n.mapper.toViewPosition(t.range.start);const i=n.writer,o=[];for(;("ul"==e.parent.name||"ol"==e.parent.name)&&(e=i.breakContainer(e),"li"==e.parent.name);){const t=e,n=i.createPositionAt(e.parent,"end");if(!t.isEqual(n)){const e=i.remove(i.createRange(t,n));o.push(e)}e=i.createPositionAfter(e.parent)}if(o.length>0){for(let t=0;t<o.length;t++){const n=e.nodeBefore;if(e=i.insert(e,o[t]).end,t>0){const t=jp(i,n,n.nextSibling);t&&t.parent==n&&e.offset--}}jp(i,e.nodeBefore,e.nodeAfter)}}}function qp(e,t,n){const i=n.mapper.toViewPosition(t.position),o=i.nodeBefore,r=i.nodeAfter;jp(n.writer,o,r)}function Yp(e,t,n){if(n.consumable.consume(t.viewItem,{name:!0})){const e=n.writer,i=e.createElement("listItem"),o=function(e){let t=0,n=e.parent;for(;n;){if(n.is("element","li"))t++;else{const e=n.previousSibling;e&&e.is("element","li")&&t++}n=n.parent}return t}(t.viewItem);e.setAttribute("listIndent",o,i);const r=t.viewItem.parent&&"ol"==t.viewItem.parent.name?"numbered":"bulleted";if(e.setAttribute("listType",r,i),!n.safeInsert(i,t.modelCursor))return;const s=function(e,t,n){const{writer:i,schema:o}=n;let r=i.createPositionAfter(e);for(const s of t)if("ul"==s.name||"ol"==s.name)r=n.convertItem(s,r).modelCursor;else{const t=n.convertItem(s,i.createPositionAt(e,"end")),a=t.modelRange.start.nodeAfter;a&&a.is("element")&&!o.checkChild(e,a.name)&&(e=t.modelCursor.parent.is("element","listItem")?t.modelCursor.parent:Qp(t.modelCursor),r=i.createPositionAfter(e))}return r}(i,t.viewItem.getChildren(),n);t.modelRange=e.createRange(t.modelCursor,s),n.updateConversionResult(i,t)}}function Jp(e,t,n){if(n.consumable.test(t.viewItem,{name:!0})){const e=Array.from(t.viewItem.getChildren());for(const t of e){!(t.is("element","li")||ef(t))&&t._remove()}}}function Kp(e,t,n){if(n.consumable.test(t.viewItem,{name:!0})){if(0===t.viewItem.childCount)return;const e=[...t.viewItem.getChildren()];let n=!1,i=!0;for(const t of e)n&&!ef(t)&&t._remove(),t.is("$text")?(i&&(t._data=t.data.replace(/^\s+/,"")),t.nextSibling&&!ef(t.nextSibling)||(t._data=t.data.replace(/\s+$/,""))):ef(t)&&(n=!0),i=!1}}function Xp(e){return(t,n)=>{if(n.isPhantom)return;const i=n.modelPosition.nodeBefore;if(i&&i.is("element","listItem")){const t=n.mapper.toViewElement(i),o=t.getAncestors().find(ef),r=e.createPositionAt(t,0).getWalker();for(const e of r){if("elementStart"==e.type&&e.item.is("element","li")){n.viewPosition=e.previousPosition;break}if("elementEnd"==e.type&&e.item==o){n.viewPosition=e.nextPosition;break}}}}}function Gp(e,[t,n]){let i,o=t.is("documentFragment")?t.getChild(0):t;if(i=n?this.createSelection(n):this.document.selection,o&&o.is("element","listItem")){const e=i.getFirstPosition();let t=null;if(e.parent.is("element","listItem")?t=e.parent:e.nodeBefore&&e.nodeBefore.is("element","listItem")&&(t=e.nodeBefore),t){const e=t.getAttribute("listIndent");if(e>0)for(;o&&o.is("element","listItem");)o._setAttribute("listIndent",o.getAttribute("listIndent")+e),o=o.nextSibling}}}function Qp(e){const t=new Ho({startPosition:e});let n;do{n=t.next()}while(!n.value.item.is("element","listItem"));return n.value.item}function Zp(e,t,n,i,o,r){const s=Bp(t.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:e,foo:"b"}),a=o.mapper,l=o.writer,c=s?s.getAttribute("listIndent"):null;let d;if(s)if(c==e){const e=a.toViewElement(s).parent;d=l.createPositionAfter(e)}else{const e=r.createPositionAt(s,"end");d=a.toViewPosition(e)}else d=n;d=Dp(d);for(const e of[...i.getChildren()])ef(e)&&(d=l.move(l.createRangeOn(e),d).end,jp(l,e,e.nextSibling),jp(l,e.previousSibling,e))}function ef(e){return e.is("element","ol")||e.is("element","ul")}class tf extends Je{static get pluginName(){return"ListEditing"}static get requires(){return[ng]}init(){const e=this.editor;e.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const t=e.data,n=e.editing;var i;e.model.document.registerPostFixer(t=>function(e,t){const n=e.document.differ.getChanges(),i=new Map;let o=!1;for(const i of n)if("insert"==i.type&&"listItem"==i.name)r(i.position);else if("insert"==i.type&&"listItem"!=i.name){if("$text"!=i.name){const n=i.position.nodeAfter;n.hasAttribute("listIndent")&&(t.removeAttribute("listIndent",n),o=!0),n.hasAttribute("listType")&&(t.removeAttribute("listType",n),o=!0),n.hasAttribute("listStyle")&&(t.removeAttribute("listStyle",n),o=!0);for(const t of Array.from(e.createRangeIn(n)).filter(e=>e.item.is("element","listItem")))r(t.previousPosition)}r(i.position.getShiftedBy(i.length))}else"remove"==i.type&&"listItem"==i.name?r(i.position):("attribute"==i.type&&"listIndent"==i.attributeKey||"attribute"==i.type&&"listType"==i.attributeKey)&&r(i.range.start);for(const e of i.values())s(e),a(e);return o;function r(e){const t=e.nodeBefore;if(t&&t.is("element","listItem")){let e=t;if(i.has(e))return;for(let t=e.previousSibling;t&&t.is("element","listItem");t=e.previousSibling)if(e=t,i.has(e))return;i.set(t,e)}else{const t=e.nodeAfter;t&&t.is("element","listItem")&&i.set(t,t)}}function s(e){let n=0,i=null;for(;e&&e.is("element","listItem");){const r=e.getAttribute("listIndent");if(r>n){let s;null===i?(i=r-n,s=n):(i>r&&(i=r),s=r-i),t.setAttribute("listIndent",s,e),o=!0}else i=null,n=e.getAttribute("listIndent")+1;e=e.nextSibling}}function a(e){let n=[],i=null;for(;e&&e.is("element","listItem");){const r=e.getAttribute("listIndent");if(i&&i.getAttribute("listIndent")>r&&(n=n.slice(0,r+1)),0!=r)if(n[r]){const i=n[r];e.getAttribute("listType")!=i&&(t.setAttribute("listType",i,e),o=!0)}else n[r]=e.getAttribute("listType");i=e,e=e.nextSibling}}}(e.model,t)),n.mapper.registerViewToModelLength("li",nf),t.mapper.registerViewToModelLength("li",nf),n.mapper.on("modelToViewPosition",Xp(n.view)),n.mapper.on("viewToModelPosition",(i=e.model,(e,t)=>{const n=t.viewPosition,o=n.parent,r=t.mapper;if("ul"==o.name||"ol"==o.name){if(n.isAtEnd){const e=r.toModelElement(n.nodeBefore),o=r.getModelLength(n.nodeBefore);t.modelPosition=i.createPositionBefore(e).getShiftedBy(o)}else{const e=r.toModelElement(n.nodeAfter);t.modelPosition=i.createPositionBefore(e)}e.stop()}else if("li"==o.name&&n.nodeBefore&&("ul"==n.nodeBefore.name||"ol"==n.nodeBefore.name)){const s=r.toModelElement(o);let a=1,l=n.nodeBefore;for(;l&&ef(l);)a+=r.getModelLength(l),l=l.previousSibling;t.modelPosition=i.createPositionBefore(s).getShiftedBy(a),e.stop()}})),t.mapper.on("modelToViewPosition",Xp(n.view)),e.conversion.for("editingDowncast").add(t=>{t.on("insert",$p,{priority:"high"}),t.on("insert:listItem",Hp(e.model)),t.on("attribute:listType:listItem",Up,{priority:"high"}),t.on("attribute:listType:listItem",Wp,{priority:"low"}),t.on("attribute:listIndent:listItem",function(e){return(t,n,i)=>{if(!i.consumable.consume(n.item,"attribute:listIndent"))return;const o=i.mapper.toViewElement(n.item),r=i.writer;r.breakContainer(r.createPositionBefore(o)),r.breakContainer(r.createPositionAfter(o));const s=o.parent,a=s.previousSibling,l=r.createRangeOn(s);r.remove(l),a&&a.nextSibling&&jp(r,a,a.nextSibling),Zp(n.attributeOldValue+1,n.range.start,l.start,o,i,e),Lp(n.item,o,i,e);for(const e of n.item.getChildren())i.consumable.consume(e,"insert")}}(e.model)),t.on("remove:listItem",function(e){return(t,n,i)=>{const o=i.mapper.toViewPosition(n.position).getLastMatchingPosition(e=>!e.item.is("element","li")).nodeAfter,r=i.writer;r.breakContainer(r.createPositionBefore(o)),r.breakContainer(r.createPositionAfter(o));const s=o.parent,a=s.previousSibling,l=r.createRangeOn(s),c=r.remove(l);a&&a.nextSibling&&jp(r,a,a.nextSibling);Zp(i.mapper.toModelElement(o).getAttribute("listIndent")+1,n.position,l.start,o,i,e);for(const e of r.createRangeIn(c).getItems())i.mapper.unbindViewElement(e);t.stop()}}(e.model)),t.on("remove",qp,{priority:"low"})}),e.conversion.for("dataDowncast").add(t=>{t.on("insert",$p,{priority:"high"}),t.on("insert:listItem",Hp(e.model))}),e.conversion.for("upcast").add(e=>{e.on("element:ul",Jp,{priority:"high"}),e.on("element:ol",Jp,{priority:"high"}),e.on("element:li",Kp,{priority:"high"}),e.on("element:li",Yp)}),e.model.on("insertContent",Gp,{priority:"high"}),e.commands.add("numberedList",new Ip(e,"numbered")),e.commands.add("bulletedList",new Ip(e,"bulleted")),e.commands.add("indentList",new zp(e,"forward")),e.commands.add("outdentList",new zp(e,"backward"));const o=n.view.document;this.listenTo(o,"enter",(e,t)=>{const n=this.editor.model.document,i=n.selection.getLastPosition().parent;n.selection.isCollapsed&&"listItem"==i.name&&i.isEmpty&&(this.editor.execute("outdentList"),t.preventDefault(),e.stop())}),this.listenTo(o,"delete",(e,t)=>{if("backward"!==t.direction)return;const n=this.editor.model.document.selection;if(!n.isCollapsed)return;const i=n.getFirstPosition();if(!i.isAtStart)return;const o=i.parent;if("listItem"!==o.name)return;o.previousSibling&&"listItem"===o.previousSibling.name||(this.editor.execute("outdentList"),t.preventDefault(),e.stop())},{priority:"high"});const r=e=>(t,n)=>{this.editor.commands.get(e).isEnabled&&(this.editor.execute(e),n())};e.keystrokes.set("Tab",r("indentList")),e.keystrokes.set("Shift+Tab",r("outdentList"))}afterInit(){const e=this.editor.commands,t=e.get("indent"),n=e.get("outdent");t&&t.registerChildCommand(e.get("indentList")),n&&n.registerChildCommand(e.get("outdentList"))}}function nf(e){let t=1;for(const n of e.getChildren())if("ul"==n.name||"ol"==n.name)for(const e of n.getChildren())t+=nf(e);return t}class of extends Je{init(){const e=this.editor.t;Vp(this.editor,"numberedList",e("Numbered List"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM3.5 3v5H2V3.7H1v-1h2.5V3zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001c-.048.405-.16.734-.333.988-.175.254-.59.692-1.244 1.312H4.3v1h-4l.043-.043zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z"/></svg>'),Vp(this.editor,"bulletedList",e("Bulleted List"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0C1 4.784 1.777 4 2.75 4c.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75zm6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75z"/></svg>')}}function rf(e,t){return e=>{e.on("attribute:url:media",n)};function n(n,i,o){if(!o.consumable.consume(i.item,n.name))return;const r=i.attributeNewValue,s=o.writer,a=o.mapper.toViewElement(i.item),l=[...a.getChildren()].find(e=>e.getCustomProperty("media-content"));s.remove(l);const c=e.getMediaViewElement(s,r,t);s.insert(s.createPositionAt(a,0),c)}}function sf(e,t,n,i){const o=e.createContainerElement("figure",{class:"media"});return e.insert(e.createPositionAt(o,0),t.getMediaViewElement(e,n,i)),o}function af(e){const t=e.getSelectedElement();return t&&t.is("element","media")?t:null}function lf(e,t,n){e.change(i=>{const o=i.createElement("media",{url:t});e.insertContent(o,n),i.setSelection(o,"on")})}class cf extends st{refresh(){const e=this.editor.model,t=e.document.selection,n=e.schema,i=t.getFirstPosition(),o=af(t);let r=i.parent;r!=r.root&&(r=r.parent),this.value=o?o.getAttribute("url"):null,this.isEnabled=n.checkChild(r,"media")}execute(e){const t=this.editor.model,n=t.document.selection,i=af(n);if(i)t.change(t=>{t.setAttribute("url",e,i)});else{const i=Sr(n,t);lf(t,e,i)}}}class df{constructor(e,t){const n=t.providers,i=t.extraProviders||[],o=new Set(t.removeProviders),r=n.concat(i).filter(e=>{const t=e.name;return t?!o.has(t):(console.warn(Object(l.a)("media-embed-no-provider-name"),{provider:e}),!1)});this.locale=e,this.providerDefinitions=r}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,n){return this._getMedia(t).getViewElement(e,n)}_getMedia(e){if(!e)return new uf(this.locale);e=e.trim();for(const t of this.providerDefinitions){const n=t.html;let i=t.url;Array.isArray(i)||(i=[i]);for(const t of i){const i=this._getUrlMatches(e,t);if(i)return new uf(this.locale,e,i,n)}}return null}_getUrlMatches(e,t){let n=e.match(t);if(n)return n;let i=e.replace(/^https?:\/\//,"");return n=i.match(t),n||(i=i.replace(/^www\./,""),n=i.match(t),n||null)}}class uf{constructor(e,t,n,i){this.url=this._getValidUrl(t),this._t=e.t,this._match=n,this._previewRenderer=i}getViewElement(e,t){const n={};let i;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(n["data-oembed-url"]=this.url),t.renderForEditingView&&(n.class="ck-media__wrapper");const o=this._getPreviewHtml(t);i=e.createRawElement("div",n,(function(e){e.innerHTML=o}))}else this.url&&(n.url=this.url),i=e.createEmptyElement("oembed",n);return e.setCustomProperty("media-content",!0,i),i}_getPreviewHtml(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const e=new Mi,t=new Ei;e.text=this._t("Open media in new tab"),t.content='<svg viewBox="0 0 64 42" xmlns="http://www.w3.org/2000/svg"><path d="M47.426 17V3.713L63.102 0v19.389h-.001l.001.272c0 1.595-2.032 3.43-4.538 4.098-2.506.668-4.538-.083-4.538-1.678 0-1.594 2.032-3.43 4.538-4.098.914-.244 2.032-.565 2.888-.603V4.516L49.076 7.447v9.556A1.014 1.014 0 0 0 49 17h-1.574zM29.5 17h-8.343a7.073 7.073 0 1 0-4.657 4.06v3.781H3.3a2.803 2.803 0 0 1-2.8-2.804V8.63a2.803 2.803 0 0 1 2.8-2.805h4.082L8.58 2.768A1.994 1.994 0 0 1 10.435 1.5h8.985c.773 0 1.477.448 1.805 1.149l1.488 3.177H26.7c1.546 0 2.8 1.256 2.8 2.805V17zm-11.637 0H17.5a1 1 0 0 0-1 1v.05A4.244 4.244 0 1 1 17.863 17zm29.684 2c.97 0 .953-.048.953.889v20.743c0 .953.016.905-.953.905H19.453c-.97 0-.953.048-.953-.905V19.89c0-.937-.016-.889.97-.889h28.077zm-4.701 19.338V22.183H24.154v16.155h18.692zM20.6 21.375v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616V37.53H20.6zm24.233-16.155v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615V37.53h-1.615zM29.485 25.283a.4.4 0 0 1 .593-.35l9.05 4.977a.4.4 0 0 1 0 .701l-9.05 4.978a.4.4 0 0 1-.593-.35v-9.956z"/></svg>',t.viewBox="0 0 64 42";return new ii({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[t]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]},e]}]}).render().outerHTML}_getValidUrl(e){return e?e.match(/^https?/)?e:"https://"+e:null}}n(86);class hf extends Je{static get pluginName(){return"MediaEmbedEditing"}constructor(e){super(e),e.config.define("mediaEmbed",{providers:[{name:"dailymotion",url:/^dailymotion\.com\/video\/(\w+)/,html:e=>`<div style="position: relative; padding-bottom: 100%; height: 0; "><iframe src="https://www.dailymotion.com/embed/video/${e[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" width="480" height="270" allowfullscreen allow="autoplay"></iframe></div>`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:e=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 126%;"><iframe src="https://open.spotify.com/embed/${e[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe></div>`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)/,/^youtube\.com\/embed\/([\w-]+)/,/^youtu\.be\/([\w-]+)/],html:e=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://www.youtube.com/embed/${e[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>`},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:e=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://player.vimeo.com/video/${e[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>`},{name:"instagram",url:/^instagram\.com\/p\/(\w+)/},{name:"twitter",url:/^twitter\.com/},{name:"googleMaps",url:/^google\.com\/maps/},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new df(e.locale,e.config.get("mediaEmbed"))}init(){const e=this.editor,t=e.model.schema,n=e.t,i=e.conversion,o=e.config.get("mediaEmbed.previewsInData"),r=this.registry;e.commands.add("mediaEmbed",new cf(e)),t.register("media",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["url"]}),i.for("dataDowncast").elementToElement({model:"media",view:(e,{writer:t})=>{const n=e.getAttribute("url");return sf(t,r,n,{renderMediaPreview:n&&o})}}),i.for("dataDowncast").add(rf(r,{renderMediaPreview:o})),i.for("editingDowncast").elementToElement({model:"media",view:(e,{writer:t})=>{const i=e.getAttribute("url");return function(e,t,n){return t.setCustomProperty("media",!0,e),Tr(e,t,{label:n})}(sf(t,r,i,{renderForEditingView:!0}),t,n("media widget"))}}),i.for("editingDowncast").add(rf(r,{renderForEditingView:!0})),i.for("upcast").elementToElement({view:{name:"oembed",attributes:{url:!0}},model:(e,{writer:t})=>{const n=e.getAttribute("url");if(r.hasMedia(n))return t.createElement("media",{url:n})}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(e,{writer:t})=>{const n=e.getAttribute("data-oembed-url");if(r.hasMedia(n))return t.createElement("media",{url:n})}})}}const mf=/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=]+$/;class gf extends Je{static get requires(){return[Ra,sm]}static get pluginName(){return"AutoMediaEmbed"}constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const e=this.editor,t=e.model.document;this.listenTo(e.plugins.get(Ra),"inputTransformation",()=>{const e=t.selection.getFirstRange(),n=Ou.fromPosition(e.start);n.stickiness="toPrevious";const i=Ou.fromPosition(e.end);i.stickiness="toNext",t.once("change:data",()=>{this._embedMediaBetweenPositions(n,i),n.detach(),i.detach()},{priority:"high"})}),e.commands.get("undo").on("execute",()=>{this._timeoutId&&(Wi.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(e,t){const n=this.editor,i=n.plugins.get(hf).registry,o=new Ko(e,t),r=o.getWalker({ignoreElementEnd:!0});let s="";for(const e of r)e.item.is("$textProxy")&&(s+=e.item.data);if(s=s.trim(),!s.match(mf))return void o.detach();if(!i.hasMedia(s))return void o.detach();n.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=Ou.fromPosition(e),this._timeoutId=Wi.window.setTimeout(()=>{n.model.change(e=>{let t;this._timeoutId=null,e.remove(o),o.detach(),"$graveyard"!==this._positionToInsert.root.rootName&&(t=this._positionToInsert),lf(n.model,s,t),this._positionToInsert.detach(),this._positionToInsert=null})},100)):o.detach()}}n(88);class pf extends Ti{constructor(e,t){super(t);const n=t.t;this.focusTracker=new mo,this.keystrokes=new Ui,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),vg,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),yg,"ck-button-cancel","cancel"),this._focusables=new gt,this._focusCycler=new go({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=e,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),kg({view:this});[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element);const e=e=>e.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e),this.listenTo(this.urlInputView.element,"selectstart",(e,t)=>{t.stopPropagation()},{priority:"high"})}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(e){this.urlInputView.fieldView.element.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t,t=new wg(this.locale,_g),n=t.fieldView;return this._urlInputViewInfoDefault=e("Paste the media URL in the input."),this._urlInputViewInfoTip=e("Tip: Paste the URL into the content to embed faster."),t.label=e("Media URL"),t.infoText=this._urlInputViewInfoDefault,n.placeholder="https://example.com",n.on("input",()=>{t.infoText=n.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault}),t}_createButton(e,t,n,i){const o=new Fi(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),i&&o.delegate("execute").to(this,i),o}}class ff extends Je{static get requires(){return[hf]}static get pluginName(){return"MediaEmbedUI"}init(){const e=this.editor,t=e.commands.get("mediaEmbed"),n=e.plugins.get(hf).registry;e.ui.componentFactory.add("mediaEmbed",i=>{const o=Mo(i),r=new pf(function(e,t){return[t=>{if(!t.url.length)return e("The URL must not be empty.")},n=>{if(!t.hasMedia(n.url))return e("This media URL is not supported.")}]}(e.t,n),e.locale);return this._setUpDropdown(o,r,t,e),this._setUpForm(o,r,t),o})}_setUpDropdown(e,t,n){const i=this.editor,o=i.t,r=e.buttonView;function s(){i.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),r.set({label:o("Insert media"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M18.68 3.03c.6 0 .59-.03.59.55v12.84c0 .59.01.56-.59.56H1.29c-.6 0-.59.03-.59-.56V3.58c0-.58-.01-.55.6-.55h17.38zM15.77 15V5H4.2v10h11.57zM2 4v1h1V4H2zm0 2v1h1V6H2zm0 2v1h1V8H2zm0 2v1h1v-1H2zm0 2v1h1v-1H2zm0 2v1h1v-1H2zM17 4v1h1V4h-1zm0 2v1h1V6h-1zm0 2v1h1V8h-1zm0 2v1h1v-1h-1zm0 2v1h1v-1h-1zm0 2v1h1v-1h-1zM7.5 7.177a.4.4 0 0 1 .593-.351l5.133 2.824a.4.4 0 0 1 0 .7l-5.133 2.824a.4.4 0 0 1-.593-.35V7.176v.001z"/></svg>',tooltip:!0}),r.on("open",()=>{t.url=n.value||"",t.urlInputView.fieldView.select(),t.focus()},{priority:"low"}),e.on("submit",()=>{t.isValid()&&(i.execute("mediaEmbed",t.url),s())}),e.on("change:isOpen",()=>t.resetFormStatus()),e.on("cancel",()=>s())}_setUpForm(e,t,n){t.delegate("submit","cancel").to(e),t.urlInputView.bind("value").to(n,"value"),t.urlInputView.bind("isReadOnly").to(n,"isEnabled",e=>!e),t.saveButtonView.bind("isEnabled").to(n)}}n(90);function wf(e,t){if(!e.childCount)return;const n=new vp(e.document),i=function(e,t){const n=t.createRangeIn(e),i=new us({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),o=[];for(const e of n)if("elementStart"===e.type&&i.match(e.item)){const t=_f(e.item);o.push({element:e.item,id:t.id,order:t.order,indent:t.indent})}return o}(e,n);if(!i.length)return;let o=null,r=1;i.forEach((e,s)=>{const a=function(e,t){if(!e)return!0;if(e.id!==t.id)return!0;const n=t.element.previousSibling;if(!n)return!0;return i=n,!(i.is("element","ol")||i.is("element","ul"));var i}(i[s-1],e),l=a?null:i[s-1],c=(u=e,(d=l)?u.indent-d.indent:u.indent-1);var d,u;if(a&&(o=null,r=1),!o||0!==c){const i=function(e,t){const n=new RegExp(`@list l${e.id}:level${e.indent}\\s*({[^}]*)`,"gi"),i=/mso-level-number-format:([^;]*);/gi,o=n.exec(t);let r="decimal";if(o&&o[1]){const e=i.exec(o[1]);e&&e[1]&&(r=e[1].trim())}return{type:"bullet"!==r&&"image"!==r?"ol":"ul",style:r}}(e,t);if(o){if(e.indent>r){const e=o.getChild(o.childCount-1),t=e.getChild(e.childCount-1);o=bf(i,t,n),r+=1}else if(e.indent<r){const t=r-e.indent;o=function(e,t){const n=e.getAncestors({parentFirst:!0});let i=null,o=0;for(const e of n)if("ul"!==e.name&&"ol"!==e.name||o++,o===t){i=e;break}return i}(o,t),r=parseInt(e.indent)}}else o=bf(i,e.element,n);e.indent<=r&&(o.is("element",i.type)||(o=n.rename(i.type,o)))}const h=function(e,t){return function(e,t){const n=new us({name:"span",styles:{"mso-list":"Ignore"}}),i=t.createRangeIn(e);for(const e of i)"elementStart"===e.type&&n.match(e.item)&&t.remove(e.item)}(e,t),t.rename("li",e)}(e.element,n);n.appendChild(h,o)})}function bf(e,t,n){const i=t.parent,o=n.createElement(e.type),r=i.getChildIndex(t)+1;return n.insertChild(r,o,i),o}function _f(e){const t={},n=e.getStyle("mso-list");if(n){const e=n.match(/(^|\s+)l(\d+)/i),i=n.match(/\s*lfo(\d+)/i),o=n.match(/\s*level(\d+)/i);e&&i&&o&&(t.id=e[2],t.order=i[1],t.indent=o[1])}return t}const kf=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class vf{constructor(e){this.document=e}isActive(e){return kf.test(e)}execute(e){const t=new vp(this.document);!function(e,t){for(const n of e.getChildren())if(n.is("element","b")&&"normal"===n.getStyle("font-weight")){const i=e.getChildIndex(n);t.remove(n),t.insertChild(i,n.getChildren(),e)}}(e.content,t),function(e,t){for(const n of t.createRangeIn(e)){const e=n.item;if(e.is("element","li")){const n=e.getChild(0);n&&n.is("element","p")&&t.unwrapElement(n)}}}(e.content,t)}}function yf(e){return e.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(e,t)=>1===t.length?" ":Array(t.length+1).join("  ").substr(0,t.length))}function xf(e,t){const n=new DOMParser,i=function(e){return yf(yf(e)).replace(/(<span\s+style=['"]mso-spacerun:yes['"]>[\s]*?)[\r\n]+(\s*<\/span>)/g,"$1$2").replace(/<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g,"").replace(/ <\//g," </").replace(/ <o:p><\/o:p>/g," <o:p></o:p>").replace(/<o:p>(&nbsp;|\u00A0)<\/o:p>/g,"").replace(/>(\s*[\r\n]\s*)</g,"><")}(function(e){const t=e.match(/<\/body>(.*?)(<\/html>|$)/);t&&t[1]&&(e=e.slice(0,t.index)+e.slice(t.index).replace(t[1],""));return e}(e=e.replace(/<!--\[if gte vml 1]>/g,""))),o=n.parseFromString(i,"text/html");!function(e){e.querySelectorAll("span[style*=spacerun]").forEach(e=>{const t=e.innerText.length||0;e.innerHTML=Array(t+1).join("  ").substr(0,t)})}(o);const r=o.body.innerHTML,s=function(e,t){const n=new El(t),i=new _a(n,{blockFillerMode:"nbsp"}),o=e.createDocumentFragment(),r=e.body.childNodes;for(;r.length>0;)o.appendChild(r[0]);return i.domToView(o)}(o,t),a=function(e){const t=[],n=[],i=Array.from(e.getElementsByTagName("style"));for(const e of i)e.sheet&&e.sheet.cssRules&&e.sheet.cssRules.length&&(t.push(e.sheet),n.push(e.innerHTML));return{styles:t,stylesString:n.join(" ")}}(o);return{body:s,bodyString:r,styles:a.styles,stylesString:a.stylesString}}function Af(e,t){if(!e.childCount)return;const n=new vp;!function(e,t,n){const i=n.createRangeIn(t),o=new us({name:"img"}),r=[];for(const t of i)if(o.match(t.item)){const n=t.item,i=n.getAttribute("v:shapes")?n.getAttribute("v:shapes").split(" "):[];i.length&&i.every(t=>e.indexOf(t)>-1)?r.push(n):n.getAttribute("src")||r.push(n)}for(const e of r)n.remove(e)}(function(e,t){const n=t.createRangeIn(e),i=new us({name:/v:(.+)/}),o=[];for(const e of n){const t=e.item,n=t.previousSibling&&t.previousSibling.name||null;i.match(t)&&t.getAttribute("o:gfxdata")&&"v:shapetype"!==n&&o.push(e.item.getAttribute("id"))}return o}(e,n),e,n),function(e,t){const n=t.createRangeIn(e),i=new us({name:/v:(.+)/}),o=[];for(const e of n)i.match(e.item)&&o.push(e.item);for(const e of o)t.remove(e)}(e,n);const i=function(e,t){const n=t.createRangeIn(e),i=new us({name:"img"}),o=[];for(const e of n)i.match(e.item)&&e.item.getAttribute("src").startsWith("file://")&&o.push(e.item);return o}(e,n);i.length&&function(e,t,n){if(e.length===t.length)for(let o=0;o<e.length;o++){const r=`data:${t[o].type};base64,${i=t[o].hex,btoa(i.match(/\w{2}/g).map(e=>String.fromCharCode(parseInt(e,16))).join(""))}`;n.setAttribute("src",r,e[o])}var i}(i,function(e){if(!e)return[];const t=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,n=new RegExp("(?:("+t.source+"))([\\da-fA-F\\s]+)\\}","g"),i=e.match(n),o=[];if(i)for(const e of i){let n=!1;e.includes("\\pngblip")?n="image/png":e.includes("\\jpegblip")&&(n="image/jpeg"),n&&o.push({hex:e.replace(t,"").replace(/[^\da-fA-F]/g,""),type:n})}return o}(t),n)}const Cf=/<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i,Tf=/xmlns:o="urn:schemas-microsoft-com/i;class Ef{constructor(e){this.document=e}isActive(e){return Cf.test(e)||Tf.test(e)}execute(e){const{body:t,stylesString:n}=xf(e.dataTransfer.getData("text/html"),this.document.stylesProcessor);wf(t,n),Af(t,e.dataTransfer.getData("text/rtf")),e.content=t}}function Mf(e,t,n,i,o=1){t>o?i.setAttribute(e,t,n):i.removeAttribute(e,n)}function Pf(e,t,n={}){const i=e.createElement("tableCell",n);return e.insertElement("paragraph",i),e.insert(i,t),i}function Sf(e,t){const n=t.parent.parent,i=parseInt(n.getAttribute("headingColumns")||0),{column:o}=e.getCellLocation(t);return!!i&&o<i}function If(){return e=>{e.on("element:table",(e,t,n)=>{const i=t.viewItem;if(!n.consumable.test(i,{name:!0}))return;const{rows:o,headingRows:r,headingColumns:s}=function(e){const t={headingRows:0,headingColumns:0},n=[],i=[];let o;for(const r of Array.from(e.getChildren()))if("tbody"===r.name||"thead"===r.name||"tfoot"===r.name){"thead"!==r.name||o||(o=r);const e=Array.from(r.getChildren()).filter(e=>e.is("element","tr"));for(const r of e)if("thead"===r.parent.name&&r.parent===o)t.headingRows++,n.push(r);else{i.push(r);const e=Nf(r);e>t.headingColumns&&(t.headingColumns=e)}}return t.rows=[...n,...i],t}(i),a={};s&&(a.headingColumns=s),r&&(a.headingRows=r);const l=n.writer.createElement("table",a);if(n.safeInsert(l,t.modelCursor)){if(n.consumable.consume(i,{name:!0}),o.forEach(e=>n.convertItem(e,n.writer.createPositionAt(l,"end"))),l.isEmpty){const e=n.writer.createElement("tableRow");n.writer.insert(e,n.writer.createPositionAt(l,"end")),Pf(n.writer,n.writer.createPositionAt(e,"end"))}n.updateConversionResult(l,t)}})}}function Of(e){return t=>{t.on("element:"+e,(e,t,n)=>{if(!t.modelRange)return;const i=t.modelRange.start.nodeAfter;if(!i.childCount){const e=n.writer.createPositionAt(i,0);n.writer.insertElement("paragraph",e)}},{priority:"low"})}}function Nf(e){let t=0,n=0;const i=Array.from(e.getChildren()).filter(e=>"th"===e.name||"td"===e.name);for(;n<i.length&&"th"===i[n].name;){const e=i[n];t+=parseInt(e.getAttribute("colspan")||1),n++}return t}class zf{constructor(e,t={}){this._table=e,this._startRow=void 0!==t.row?t.row:t.startRow||0,this._endRow=void 0!==t.row?t.row:t.endRow,this._startColumn=void 0!==t.column?t.column:t.startColumn||0,this._endColumn=void 0!==t.column?t.column:t.endColumn,this._includeAllSlots=!!t.includeAllSlots,this._skipRows=new Set,this._row=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){const e=this._table.getChild(this._row);if(!e||this._isOverEndRow())return{done:!0};if(this._isOverEndColumn())return this._advanceToNextRow();let t=null;const n=this._getSpanned();if(n)this._includeAllSlots&&!this._shouldSkipSlot()&&(t=this._formatOutValue(n.cell,n.row,n.column));else{const n=e.getChild(this._cellIndex);if(!n)return this._advanceToNextRow();const i=parseInt(n.getAttribute("colspan")||1),o=parseInt(n.getAttribute("rowspan")||1);(i>1||o>1)&&this._recordSpans(n,o,i),this._shouldSkipSlot()||(t=this._formatOutValue(n)),this._nextCellAtColumn=this._column+i}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return void 0!==this._endRow&&this._row>this._endRow}_isOverEndColumn(){return void 0!==this._endColumn&&this._column>this._endColumn}_formatOutValue(e,t=this._row,n=this._column){return{done:!1,value:new Rf(this,e,t,n)}}_shouldSkipSlot(){const e=this._skipRows.has(this._row),t=this._row<this._startRow,n=this._column<this._startColumn,i=void 0!==this._endColumn&&this._column>this._endColumn;return e||t||n||i}_getSpanned(){const e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,n){const i={cell:e,row:this._row,column:this._column};for(let e=this._row;e<this._row+t;e++)for(let t=this._column;t<this._column+n;t++)e==this._row&&t==this._column||this._markSpannedCell(e,t,i)}_markSpannedCell(e,t,n){this._spannedCells.has(e)||this._spannedCells.set(e,new Map);this._spannedCells.get(e).set(t,n)}}class Rf{constructor(e,t,n,i){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=n,this.cellAnchorColumn=i,this._cellIndex=e._cellIndex,this._table=e._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||1)}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||1)}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}function Lf(e={}){return t=>t.on("insert:table",(t,n,i)=>{const o=n.item;if(!i.consumable.consume(o,"insert"))return;i.consumable.consume(o,"attribute:headingRows:table"),i.consumable.consume(o,"attribute:headingColumns:table");const r=e&&e.asWidget,s=i.writer.createContainerElement("figure",{class:"table"}),a=i.writer.createContainerElement("table");let l;var c,d;i.writer.insert(i.writer.createPositionAt(s,0),a),r&&(c=s,(d=i.writer).setCustomProperty("table",!0,c),l=Tr(c,d,{hasSelectionHandle:!0}));const u=new zf(o),h={headingRows:o.getAttribute("headingRows")||0,headingColumns:o.getAttribute("headingColumns")||0},m=new Map;for(const t of u){const{row:n,cell:r}=t,s=o.getChild(n),l=m.get(n)||Bf(a,s,n,h,i);m.set(n,l),i.consumable.consume(r,"insert");Df(t,h,i.writer.createPositionAt(l,"end"),i,e)}for(const e of o.getChildren()){const t=e.index;m.has(t)||m.set(t,Bf(a,e,t,h,i))}const g=i.mapper.toViewPosition(n.range.start);i.mapper.bindElements(o,r?l:s),i.writer.insert(g,r?l:s)})}function jf(e,t,n){const{cell:i}=e,o=Vf(e,t),r=n.mapper.toViewElement(i);r&&r.name!==o&&function(e,t,n){const i=n.writer,o=n.mapper.toViewElement(e),r=Pr(i.createEditableElement(t,o.getAttributes()),i);Er(r,i,(e,t,n)=>n.addClass(Uf(t.classes),e),(e,t,n)=>n.removeClass(Uf(t.classes),e)),i.insert(i.createPositionAfter(o),r),i.move(i.createRangeIn(o),i.createPositionAt(r,0)),i.remove(i.createRangeOn(o)),n.mapper.unbindViewElement(o),n.mapper.bindElements(e,r)}(i,o,n)}function Df(e,t,n,i,o){const r=o&&o.asWidget,s=Vf(e,t),a=r?Pr(i.writer.createEditableElement(s),i.writer):i.writer.createContainerElement(s);r&&Er(a,i.writer,(e,t,n)=>n.addClass(Uf(t.classes),e),(e,t,n)=>n.removeClass(Uf(t.classes),e));const l=e.cell,c=l.getChild(0),d=1===l.childCount&&"paragraph"===c.name;if(i.writer.insert(n,a),d&&![...c.getAttributeKeys()].length){const e=l.getChild(0),t=i.writer.createPositionAt(a,"end");if(i.consumable.consume(e,"insert"),r){const n=i.writer.createContainerElement("span",{style:"display:inline-block"});i.mapper.bindElements(e,n),i.writer.insert(t,n),i.mapper.bindElements(l,a)}else i.mapper.bindElements(l,a),i.mapper.bindElements(e,a)}else i.mapper.bindElements(l,a)}function Bf(e,t,n,i,o){o.consumable.consume(t,"insert");const r=t.isEmpty?o.writer.createEmptyElement("tr"):o.writer.createContainerElement("tr");o.mapper.bindElements(t,r);const s=i.headingRows,a=function(e,t,n){const i=Ff(e,t);return i||function(e,t,n){const i=n.writer.createContainerElement(e),o=n.writer.createPositionAt(t,"tbody"==e?"end":0);return n.writer.insert(o,i),i}(e,t,n)}(function(e,t){return e<t.headingRows?"thead":"tbody"}(n,i),e,o),l=s>0&&n>=s?n-s:n,c=o.writer.createPositionAt(a,l);return o.writer.insert(c,r),r}function Vf(e,t){const{row:n,column:i}=e,{headingColumns:o,headingRows:r}=t;if(r&&r>n)return"th";return o&&o>i?"th":"td"}function Ff(e,t){for(const n of t.getChildren())if(n.name==e)return n}function Hf(e,t,n){const i=Ff(e,t);i&&0===i.childCount&&n.writer.remove(n.writer.createRangeOn(i))}function Uf(e){return Array.isArray(e)?e:[e]}class Wf extends st{refresh(){const e=this.editor.model,t=e.document.selection,n=e.schema,i=function(e){const t=e.parent;return t===t.root?t:t.parent}(t.getFirstPosition());this.isEnabled=n.checkChild(i,"table")}execute(e={}){const t=this.editor.model,n=t.document.selection,i=this.editor.plugins.get("TableUtils"),o=Sr(n,t);t.change(n=>{const r=i.createTable(n,e);t.insertContent(r,o),n.setSelection(n.createPositionAt(r.getNodeByPath([0,0,0]),0))})}}function $f(e){const t=[];for(const n of Gf(e.getRanges())){const e=n.getContainedElement();e&&e.is("element","tableCell")&&t.push(e)}return t}function qf(e){const t=[];for(const n of e.getRanges()){const e=n.start.findAncestor("tableCell");e&&t.push(e)}return t}function Yf(e){const t=$f(e);return t.length?t:qf(e)}function Jf(e){return Qf(e.map(e=>e.parent.index))}function Kf(e){const t=e[0].findAncestor("table");return Qf([...new zf(t)].filter(t=>e.includes(t.cell)).map(e=>e.column))}function Xf(e,t){if(e.length<2||!function(e){const t=e[0].findAncestor("table"),n=Jf(e),i=parseInt(t.getAttribute("headingRows")||0);if(!ew(n,i))return!1;const o=parseInt(t.getAttribute("headingColumns")||0);return ew(Kf(e),o)}(e))return!1;const n=new Set,i=new Set;let o=0;for(const r of e){const{row:e,column:s}=t.getCellLocation(r),a=parseInt(r.getAttribute("rowspan")||1),l=parseInt(r.getAttribute("colspan")||1);n.add(e),i.add(s),a>1&&n.add(e+a-1),l>1&&i.add(s+l-1),o+=a*l}return function(e,t){const n=Array.from(e.values()),i=Array.from(t.values()),o=Math.max(...n),r=Math.min(...n),s=Math.max(...i),a=Math.min(...i);return(o-r+1)*(s-a+1)}(n,i)==o}function Gf(e){return Array.from(e).sort(Zf)}function Qf(e){const t=e.sort((e,t)=>e-t);return{first:t[0],last:t[t.length-1]}}function Zf(e,t){const n=e.start,i=t.start;return n.isBefore(i)?-1:1}function ew({first:e,last:t},n){return e<n===t<n}class tw extends st{constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){const e=this.editor.model.document.selection.getFirstPosition().findAncestor("table");this.isEnabled=!!e}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),i="above"===this.order,o=Yf(t),r=Jf(o),s=i?r.first:r.last,a=o[0].findAncestor("table");n.insertRows(a,{at:i?s:s+1,copyStructureFromAbove:!i})}}class nw extends st{constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){const e=this.editor.model.document.selection.getFirstPosition().findAncestor("table");this.isEnabled=!!e}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),i="left"===this.order,o=Yf(t),r=Kf(o),s=i?r.first:r.last,a=o[0].findAncestor("table");n.insertColumns(a,{columns:1,at:i?s:s+1})}}class iw extends st{constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){const e=Yf(this.editor.model.document.selection);this.isEnabled=1===e.length}execute(){const e=Yf(this.editor.model.document.selection)[0],t="horizontally"===this.direction,n=this.editor.plugins.get("TableUtils");t?n.splitCellHorizontally(e,2):n.splitCellVertically(e,2)}}function ow(e,t,n){const{startRow:i,startColumn:o,endRow:r,endColumn:s}=t,a=n.createElement("table"),l=r-i+1;for(let e=0;e<l;e++)n.insertElement("tableRow",a,"end");const c=[...new zf(e,{startRow:i,endRow:r,startColumn:o,endColumn:s,includeAllSlots:!0})];for(const{row:e,column:t,cell:l,isAnchor:d,cellAnchorRow:u,cellAnchorColumn:h}of c){const c=e-i,m=a.getChild(c);if(d){const i=n.cloneElement(l);n.append(i,m),cw(i,e,t,r,s,n)}else(u<i||h<o)&&Pf(n,n.createPositionAt(m,"end"))}return function(e,t,n,i,o){const r=parseInt(t.getAttribute("headingRows")||0);if(r>0){Mf("headingRows",r-n,e,o,0)}const s=parseInt(t.getAttribute("headingColumns")||0);if(s>0){Mf("headingColumns",s-i,e,o,0)}}(a,e,i,o,n),a}function rw(e,t,n=0){const i=[],o=new zf(e,{startRow:n,endRow:t-1});for(const e of o){const{row:n,cellHeight:o}=e,r=n+o-1;n<t&&t<=r&&i.push(e)}return i}function sw(e,t,n){const i=e.parent,o=i.parent,r=i.index,s=t-r,a={},l=parseInt(e.getAttribute("rowspan"))-s;l>1&&(a.rowspan=l);const c=parseInt(e.getAttribute("colspan")||1);c>1&&(a.colspan=c);const d=r+s,u=[...new zf(o,{startRow:r,endRow:d,includeAllSlots:!0})];let h,m=null;for(const t of u){const{row:i,column:o,cell:r}=t;r===e&&void 0===h&&(h=o),void 0!==h&&h===o&&i===d&&(m=Pf(n,t.getPositionBefore(),a))}return Mf("rowspan",s,e,n),m}function aw(e,t){const n=[],i=new zf(e);for(const e of i){const{column:i,cellWidth:o}=e,r=i+o-1;i<t&&t<=r&&n.push(e)}return n}function lw(e,t,n,i){const o=n-t,r={},s=parseInt(e.getAttribute("colspan"))-o;s>1&&(r.colspan=s);const a=parseInt(e.getAttribute("rowspan")||1);a>1&&(r.rowspan=a);const l=Pf(i,i.createPositionAfter(e),r);return Mf("colspan",o,e,i),l}function cw(e,t,n,i,o,r){const s=parseInt(e.getAttribute("colspan")||1),a=parseInt(e.getAttribute("rowspan")||1);if(n+s-1>o){Mf("colspan",o-n+1,e,r,1)}if(t+a-1>i){Mf("rowspan",i-t+1,e,r,1)}}function dw(e,t){const n=t.getColumns(e),i=new Array(n).fill(0);for(const{column:t}of new zf(e))i[t]++;const o=i.reduce((e,t,n)=>t?e:[...e,n],[]);if(o.length>0){const n=o[o.length-1];return t.removeColumns(e,{at:n}),!0}return!1}function uw(e,t){const n=[];for(let t=0;t<e.childCount;t++){e.getChild(t).isEmpty&&n.push(t)}if(n.length>0){const i=n[n.length-1];return t.removeRows(e,{at:i}),!0}return!1}function hw(e,t){dw(e,t)||uw(e,t)}function mw(e,t){const n=Array.from(new zf(e,{startColumn:t.firstColumn,endColumn:t.lastColumn,row:t.lastRow}));if(n.every(({cellHeight:e})=>1===e))return t.lastRow;const i=n[0].cellHeight-1;return t.lastRow+i}function gw(e,t){const n=Array.from(new zf(e,{startRow:t.firstRow,endRow:t.lastRow,column:t.lastColumn}));if(n.every(({cellWidth:e})=>1===e))return t.lastColumn;const i=n[0].cellWidth-1;return t.lastColumn+i}class pw extends st{constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){const e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){const e=this.editor.model,t=qf(e.document.selection)[0],n=this.value,i=this.direction;e.change(e=>{const o="right"==i||"down"==i,r=o?t:n,s=o?n:t,a=s.parent;!function(e,t,n){fw(e)||(fw(t)&&n.remove(n.createRangeIn(t)),n.move(n.createRangeIn(e),n.createPositionAt(t,"end")));n.remove(e)}(s,r,e);const l=this.isHorizontal?"colspan":"rowspan",c=parseInt(t.getAttribute(l)||1),d=parseInt(n.getAttribute(l)||1);e.setAttribute(l,c+d,r),e.setSelection(e.createRangeIn(r));const u=this.editor.plugins.get("TableUtils");hw(a.findAncestor("table"),u)})}_getMergeableCell(){const e=qf(this.editor.model.document.selection)[0];if(!e)return;const t=this.editor.plugins.get("TableUtils"),n=this.isHorizontal?function(e,t,n){const i=e.parent.parent,o="right"==t?e.nextSibling:e.previousSibling,r=(i.getAttribute("headingColumns")||0)>0;if(!o)return;const s="right"==t?e:o,a="right"==t?o:e,{column:l}=n.getCellLocation(s),{column:c}=n.getCellLocation(a),d=parseInt(s.getAttribute("colspan")||1),u=Sf(n,s),h=Sf(n,a);if(r&&u!=h)return;return l+d===c?o:void 0}(e,this.direction,t):function(e,t){const n=e.parent,i=n.parent,o=i.getChildIndex(n);if("down"==t&&o===i.childCount-1||"up"==t&&0===o)return;const r=parseInt(e.getAttribute("rowspan")||1),s=i.getAttribute("headingRows")||0,a="down"==t&&o+r===s,l="up"==t&&o===s;if(s&&(a||l))return;const c=parseInt(e.getAttribute("rowspan")||1),d="down"==t?o+c:o,u=[...new zf(i,{endRow:d})],h=u.find(t=>t.cell===e).column,m=u.find(({row:e,cellHeight:n,column:i})=>i===h&&("down"==t?e===d:d===e+n));return m&&m.cell}(e,this.direction);if(!n)return;const i=this.isHorizontal?"rowspan":"colspan",o=parseInt(e.getAttribute(i)||1);return parseInt(n.getAttribute(i)||1)===o?n:void 0}}function fw(e){return 1==e.childCount&&e.getChild(0).is("element","paragraph")&&e.getChild(0).isEmpty}class ww extends st{refresh(){const e=Yf(this.editor.model.document.selection),t=e[0];if(t){const n=t.findAncestor("table"),i=this.editor.plugins.get("TableUtils").getRows(n)-1,o=Jf(e),r=0===o.first&&o.last===i;this.isEnabled=!r}else this.isEnabled=!1}execute(){const e=this.editor.model,t=Yf(e.document.selection),n=Jf(t),i=t[0],o=i.findAncestor("table"),r=this.editor.plugins.get("TableUtils").getCellLocation(i).column;e.change(e=>{const t=n.last-n.first+1;this.editor.plugins.get("TableUtils").removeRows(o,{at:n.first,rows:t});const i=function(e,t,n){const i=e.getChild(t)||e.getChild(e.childCount-1);let o=i.getChild(0),r=0;for(const e of i.getChildren()){if(r>n)return o;o=e,r+=parseInt(e.getAttribute("colspan")||1)}return o}(o,n.first,r);e.setSelection(e.createPositionAt(i,0))})}}class bw extends st{refresh(){const e=Yf(this.editor.model.document.selection),t=e[0];if(t){const n=t.findAncestor("table"),i=this.editor.plugins.get("TableUtils").getColumns(n),{first:o,last:r}=Kf(e);this.isEnabled=r-o<i-1}else this.isEnabled=!1}execute(){const[e,t]=function(e){const t=Yf(e),n=t[0],i=t.pop(),o=[n,i];return n.isBefore(i)?o:o.reverse()}(this.editor.model.document.selection),n=e.parent.parent,i=[...new zf(n)],o={first:i.find(t=>t.cell===e).column,last:i.find(e=>e.cell===t).column},r=function(e,t,n,i){return parseInt(n.getAttribute("colspan")||1)>1?n:t.previousSibling||n.nextSibling?n.nextSibling||t.previousSibling:i.first?e.reverse().find(({column:e})=>e<i.first).cell:e.reverse().find(({column:e})=>e>i.last).cell}(i,e,t,o);this.editor.model.change(e=>{const t=o.last-o.first+1;this.editor.plugins.get("TableUtils").removeColumns(n,{at:o.first,columns:t}),e.setSelection(e.createPositionAt(r,0))})}}class _w extends st{refresh(){const e=Yf(this.editor.model.document.selection),t=e.length>0;this.isEnabled=t,this.value=t&&e.every(e=>this._isInHeading(e,e.parent.parent))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.model,n=Yf(t.document.selection),i=n[0].findAncestor("table"),{first:o,last:r}=Jf(n),s=this.value?o:r+1,a=i.getAttribute("headingRows")||0;t.change(e=>{if(s){const t=rw(i,s,s>a?a:0);for(const{cell:n}of t)sw(n,s,e)}Mf("headingRows",s,i,e,0)})}_isInHeading(e,t){const n=parseInt(t.getAttribute("headingRows")||0);return!!n&&e.parent.index<n}}class kw extends st{refresh(){const e=Yf(this.editor.model.document.selection),t=this.editor.plugins.get("TableUtils"),n=e.length>0;this.isEnabled=n,this.value=n&&e.every(e=>Sf(t,e))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.model,n=Yf(t.document.selection),i=n[0].findAncestor("table"),{first:o,last:r}=Kf(n),s=this.value?o:r+1;t.change(e=>{if(s){const t=aw(i,s);for(const{cell:n,column:i}of t)lw(n,i,s,e)}Mf("headingColumns",s,i,e,0)})}}class vw extends Je{static get pluginName(){return"TableUtils"}getCellLocation(e){const t=e.parent,n=t.parent,i=n.getChildIndex(t),o=new zf(n,{row:i});for(const{cell:t,row:n,column:i}of o)if(t===e)return{row:n,column:i}}createTable(e,t){const n=e.createElement("table");return yw(e,n,0,parseInt(t.rows)||2,parseInt(t.columns)||2),t.headingRows&&Mf("headingRows",t.headingRows,n,e,0),t.headingColumns&&Mf("headingColumns",t.headingColumns,n,e,0),n}insertRows(e,t={}){const n=this.editor.model,i=t.at||0,o=t.rows||1,r=void 0!==t.copyStructureFromAbove,s=t.copyStructureFromAbove?i-1:i,a=this.getRows(e),l=this.getColumns(e);n.change(t=>{const n=e.getAttribute("headingRows")||0;if(n>i&&Mf("headingRows",n+o,e,t,0),!r&&(0===i||i===a))return void yw(t,e,i,o,l);const c=r?Math.max(i,s):i,d=new zf(e,{endRow:c}),u=new Array(l).fill(1);for(const{row:e,column:n,cellHeight:a,cellWidth:l,cell:c}of d){const d=e+a-1,h=e<=s&&s<=d;e<i&&i<=d?(t.setAttribute("rowspan",a+o,c),u[n]=-l):r&&h&&(u[n]=l)}for(let n=0;n<o;n++){const n=t.createElement("tableRow");t.insert(n,e,i);for(let e=0;e<u.length;e++){const i=u[e],o=t.createPositionAt(n,"end");i>0&&Pf(t,o,i>1?{colspan:i}:null),e+=Math.abs(i)-1}}})}insertColumns(e,t={}){const n=this.editor.model,i=t.at||0,o=t.columns||1;n.change(t=>{const n=e.getAttribute("headingColumns");i<n&&t.setAttribute("headingColumns",n+o,e);const r=this.getColumns(e);if(0===i||r===i){for(const n of e.getChildren())xw(o,t,t.createPositionAt(n,i?"end":0));return}const s=new zf(e,{column:i,includeAllSlots:!0});for(const e of s){const{row:n,cell:r,cellAnchorColumn:a,cellAnchorRow:l,cellWidth:c,cellHeight:d}=e;if(a<i){t.setAttribute("colspan",c+o,r);const e=l+d-1;for(let t=n;t<=e;t++)s.skipRow(t)}else xw(o,t,e.getPositionBefore())}})}removeRows(e,t){const n=this.editor.model,i=t.rows||1,o=t.at,r=o+i-1;n.change(t=>{const{cellsToMove:n,cellsToTrim:i}=function(e,t,n){const i=new Map,o=[];for(const{row:r,column:s,cellHeight:a,cell:l}of new zf(e,{endRow:n})){const e=r+a-1;if(r>=t&&r<=n&&e>n){const e=a-(n-r+1);i.set(s,{cell:l,rowspan:e})}if(r<t&&e>=t){let i;i=e>=n?n-t+1:e-t+1,o.push({cell:l,rowspan:a-i})}}return{cellsToMove:i,cellsToTrim:o}}(e,o,r);if(n.size){!function(e,t,n,i){const o=[...new zf(e,{includeAllSlots:!0,row:t})],r=e.getChild(t);let s;for(const{column:e,cell:t,isAnchor:a}of o)if(n.has(e)){const{cell:t,rowspan:o}=n.get(e),a=s?i.createPositionAfter(s):i.createPositionAt(r,0);i.move(i.createRangeOn(t),a),Mf("rowspan",o,t,i),s=t}else a&&(s=t)}(e,r+1,n,t)}for(let n=r;n>=o;n--)t.remove(e.getChild(n));for(const{rowspan:e,cell:n}of i)Mf("rowspan",e,n,t);!function(e,t,n,i){const o=e.getAttribute("headingRows")||0;if(t<o){Mf("headingRows",n<o?o-(n-t+1):t,e,i,0)}}(e,o,r,t),dw(e,this)||uw(e,this)})}removeColumns(e,t){const n=this.editor.model,i=t.at,o=t.columns||1,r=t.at+o-1;n.change(t=>{!function(e,t,n){const i=e.getAttribute("headingColumns")||0;if(i&&t.first<i){const o=Math.min(i-1,t.last)-t.first+1;n.setAttribute("headingColumns",i-o,e)}}(e,{first:i,last:r},t);for(let n=r;n>=i;n--)for(const{cell:i,column:o,cellWidth:r}of[...new zf(e)])o<=n&&r>1&&o+r>n?Mf("colspan",r-1,i,t):o===n&&t.remove(i);uw(e,this)||dw(e,this)})}splitCellVertically(e,t=2){const n=this.editor.model,i=e.parent.parent,o=parseInt(e.getAttribute("rowspan")||1),r=parseInt(e.getAttribute("colspan")||1);n.change(n=>{if(r>1){const{newCellsSpan:i,updatedSpan:s}=Aw(r,t);Mf("colspan",s,e,n);const a={};i>1&&(a.colspan=i),o>1&&(a.rowspan=o);xw(r>t?t-1:r-1,n,n.createPositionAfter(e),a)}if(r<t){const s=t-r,a=[...new zf(i)],{column:l}=a.find(({cell:t})=>t===e),c=a.filter(({cell:t,cellWidth:n,column:i})=>t!==e&&i===l||i<l&&i+n>l);for(const{cell:e,cellWidth:t}of c)n.setAttribute("colspan",t+s,e);const d={};o>1&&(d.rowspan=o),xw(s,n,n.createPositionAfter(e),d);const u=i.getAttribute("headingColumns")||0;u>l&&Mf("headingColumns",u+s,i,n)}})}splitCellHorizontally(e,t=2){const n=this.editor.model,i=e.parent,o=i.parent,r=o.getChildIndex(i),s=parseInt(e.getAttribute("rowspan")||1),a=parseInt(e.getAttribute("colspan")||1);n.change(n=>{if(s>1){const i=[...new zf(o,{startRow:r,endRow:r+s-1,includeAllSlots:!0})],{newCellsSpan:l,updatedSpan:c}=Aw(s,t);Mf("rowspan",c,e,n);const{column:d}=i.find(({cell:t})=>t===e),u={};l>1&&(u.rowspan=l),a>1&&(u.colspan=a);for(const e of i){const{column:t,row:i}=e,o=t===d,s=(i+r+c)%l==0;i>=r+c&&o&&s&&xw(1,n,e.getPositionBefore(),u)}}if(s<t){const i=t-s,l=[...new zf(o,{startRow:0,endRow:r})];for(const{cell:t,cellHeight:o,row:s}of l)if(t!==e&&s+o>r){const e=o+i;n.setAttribute("rowspan",e,t)}const c={};a>1&&(c.colspan=a),yw(n,o,r+1,i,1,c);const d=o.getAttribute("headingRows")||0;d>r&&Mf("headingRows",d+i,o,n)}})}getColumns(e){return[...e.getChild(0).getChildren()].reduce((e,t)=>e+parseInt(t.getAttribute("colspan")||1),0)}getRows(e){return e.childCount}}function yw(e,t,n,i,o,r={}){for(let s=0;s<i;s++){const i=e.createElement("tableRow");e.insert(i,t,n),xw(o,e,e.createPositionAt(i,"end"),r)}}function xw(e,t,n,i={}){for(let o=0;o<e;o++)Pf(t,n,i)}function Aw(e,t){if(e<t)return{newCellsSpan:1,updatedSpan:1};const n=Math.floor(e/t);return{newCellsSpan:n,updatedSpan:e-n*t+n}}class Cw extends st{refresh(){const e=$f(this.editor.model.document.selection);this.isEnabled=Xf(e,this.editor.plugins.get(vw))}execute(){const e=this.editor.model,t=this.editor.plugins.get(vw);e.change(n=>{const i=$f(e.document.selection),o=i.shift(),{mergeWidth:r,mergeHeight:s}=function(e,t,n){let i=0,o=0;for(const e of t){const{row:t,column:r}=n.getCellLocation(e);i=Mw(e,r,i,"colspan"),o=Mw(e,t,o,"rowspan")}const{row:r,column:s}=n.getCellLocation(e);return{mergeWidth:i-s,mergeHeight:o-r}}(o,i,t);Mf("colspan",r,o,n),Mf("rowspan",s,o,n);for(const e of i)Tw(e,o,n);hw(o.findAncestor("table"),t),n.setSelection(o,"in")})}}function Tw(e,t,n){Ew(e)||(Ew(t)&&n.remove(n.createRangeIn(t)),n.move(n.createRangeIn(e),n.createPositionAt(t,"end"))),n.remove(e)}function Ew(e){return 1==e.childCount&&e.getChild(0).is("element","paragraph")&&e.getChild(0).isEmpty}function Mw(e,t,n,i){const o=parseInt(e.getAttribute(i)||1);return Math.max(n,t+o)}class Pw extends st{refresh(){const e=Yf(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=Yf(e.document.selection),n=Jf(t),i=t[0].findAncestor("table"),o=[];for(let t=n.first;t<=n.last;t++)for(const n of i.getChild(t).getChildren())o.push(e.createRangeOn(n));e.change(e=>{e.setSelection(o)})}}class Sw extends st{refresh(){const e=Yf(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=Yf(e.document.selection),n=t[0],i=t.pop(),o=n.findAncestor("table"),r=this.editor.plugins.get("TableUtils"),s=r.getCellLocation(n),a=r.getCellLocation(i),l=Math.min(s.column,a.column),c=Math.max(s.column,a.column),d=[];for(const t of new zf(o,{startColumn:l,endColumn:c}))d.push(e.createRangeOn(t.cell));e.change(e=>{e.setSelection(d)})}}function Iw(e){e.document.registerPostFixer(t=>function(e,t){const n=t.document.differ.getChanges();let i=!1;const o=new Set;for(const t of n){let n;"table"==t.name&&"insert"==t.type&&(n=t.position.nodeAfter),"tableRow"!=t.name&&"tableCell"!=t.name||(n=t.position.findAncestor("table")),zw(t)&&(n=t.range.start.findAncestor("table")),n&&!o.has(n)&&(i=Ow(n,e)||i,i=Nw(n,e)||i,o.add(n))}return i}(t,e))}function Ow(e,t){let n=!1;const i=function(e){const t=parseInt(e.getAttribute("headingRows")||0),n=e.childCount,i=[];for(const{row:o,cell:r,cellHeight:s}of new zf(e)){if(s<2)continue;const e=o<t?t:n;if(o+s>e){const t=e-o;i.push({cell:r,rowspan:t})}}return i}(e);if(i.length){n=!0;for(const e of i)Mf("rowspan",e.rowspan,e.cell,t,1)}return n}function Nw(e,t){let n=!1;const i=function(e){const t=new Array(e.childCount).fill(0);for(const{row:n}of new zf(e,{includeAllSlots:!0}))t[n]++;return t}(e),o=[];for(const[e,t]of i.entries())t||o.push(e);if(o.length){n=!0;for(const n of o.reverse())t.remove(e.getChild(n)),i.splice(n,1)}const r=i[0];if(!i.every(e=>e===r)){const o=i.reduce((e,t)=>t>e?t:e,0);for(const[r,s]of i.entries()){const i=o-s;if(i){for(let n=0;n<i;n++)Pf(t,t.createPositionAt(e.getChild(r),"end"));n=!0}}}return n}function zw(e){const t="attribute"===e.type,n=e.attributeKey;return t&&("headingRows"===n||"colspan"===n||"rowspan"===n)}function Rw(e){e.document.registerPostFixer(t=>function(e,t){const n=t.document.differ.getChanges();let i=!1;for(const t of n)"insert"==t.type&&"table"==t.name&&(i=Lw(t.position.nodeAfter,e)||i),"insert"==t.type&&"tableRow"==t.name&&(i=jw(t.position.nodeAfter,e)||i),"insert"==t.type&&"tableCell"==t.name&&(i=Dw(t.position.nodeAfter,e)||i),Bw(t)&&(i=Dw(t.position.parent,e)||i);return i}(t,e))}function Lw(e,t){let n=!1;for(const i of e.getChildren())n=jw(i,t)||n;return n}function jw(e,t){let n=!1;for(const i of e.getChildren())n=Dw(i,t)||n;return n}function Dw(e,t){if(0==e.childCount)return t.insertElement("paragraph",e),!0;const n=Array.from(e.getChildren()).filter(e=>e.is("$text"));for(const e of n)t.wrap(t.createRangeOn(e),"paragraph");return!!n.length}function Bw(e){return!(!e.position||!e.position.parent.is("element","tableCell"))&&("insert"==e.type&&"$text"==e.name||"remove"==e.type)}function Vw(e){e.document.registerPostFixer(()=>function(e){const t=e.document.differ,n=new Set;let i=0;for(const e of t.getChanges()){const t="insert"==e.type||"remove"==e.type?e.position.parent:e.range.start.parent;t.is("element","tableCell")&&("insert"==e.type&&i++,Fw(t,e.type,i)&&n.add(t))}if(n.size){for(const e of n.values())t.refreshItem(e);return!0}return!1}(e))}function Fw(e,t,n){if(!Array.from(e.getChildren()).some(e=>e.is("element","paragraph")))return!1;if("attribute"==t){const t=Array.from(e.getChild(0).getAttributeKeys()).length;return 1===e.childCount&&t<2}return e.childCount<=("insert"==t?n+1:1)}function Hw(e){e.document.registerPostFixer(()=>function(e){const t=e.document.differ,n=new Set;for(const e of t.getChanges()){if("attribute"!=e.type)continue;const t=e.range.start.nodeAfter;t&&t.is("element","table")&&"headingRows"==e.attributeKey&&n.add(t)}if(n.size){for(const e of n.values())t.refreshItem(e);return!0}return!1}(e))}n(92);class Uw extends Je{static get pluginName(){return"TableEditing"}init(){const e=this.editor,t=e.model,n=t.schema,i=e.conversion;n.register("table",{allowWhere:"$block",allowAttributes:["headingRows","headingColumns"],isObject:!0,isBlock:!0}),n.register("tableRow",{allowIn:"table",isLimit:!0}),n.register("tableCell",{allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),n.extend("$block",{allowIn:"tableCell"}),n.addChildCheck((e,t)=>{if("table"==t.name&&Array.from(e.getNames()).includes("table"))return!1}),i.for("upcast").add(If()),i.for("editingDowncast").add(Lf({asWidget:!0})),i.for("dataDowncast").add(Lf()),i.for("upcast").elementToElement({model:"tableRow",view:"tr"}),i.for("upcast").add(e=>{e.on("element:tr",(e,t)=>{t.viewItem.isEmpty&&0==t.modelCursor.index&&e.stop()},{priority:"high"})}),i.for("editingDowncast").add(e=>e.on("insert:tableRow",(e,t,n)=>{const i=t.item;if(!n.consumable.consume(i,"insert"))return;const o=i.parent,r=function(e){for(const t of e.getChildren())if("table"===t.name)return t}(n.mapper.toViewElement(o)),s=o.getChildIndex(i),a=new zf(o,{row:s}),l={headingRows:o.getAttribute("headingRows")||0,headingColumns:o.getAttribute("headingColumns")||0},c=new Map;for(const e of a){const t=c.get(s)||Bf(r,i,s,l,n);c.set(s,t),n.consumable.consume(e.cell,"insert"),Df(e,l,n.writer.createPositionAt(t,"end"),n,{asWidget:!0})}})),i.for("editingDowncast").add(e=>e.on("remove:tableRow",(e,t,n)=>{e.stop();const i=n.writer,o=n.mapper,r=o.toViewPosition(t.position).getLastMatchingPosition(e=>!e.item.is("element","tr")).nodeAfter,s=r.parent.parent,a=i.createRangeOn(r),l=i.remove(a);for(const e of i.createRangeIn(l).getItems())o.unbindViewElement(e);Hf("thead",s,n),Hf("tbody",s,n)},{priority:"higher"})),i.for("upcast").elementToElement({model:"tableCell",view:"td"}),i.for("upcast").elementToElement({model:"tableCell",view:"th"}),i.for("upcast").add(Of("td")),i.for("upcast").add(Of("th")),i.for("editingDowncast").add(e=>e.on("insert:tableCell",(e,t,n)=>{const i=t.item;if(!n.consumable.consume(i,"insert"))return;const o=i.parent,r=o.parent,s=r.getChildIndex(o),a=new zf(r,{row:s}),l={headingRows:r.getAttribute("headingRows")||0,headingColumns:r.getAttribute("headingColumns")||0};for(const e of a)if(e.cell===i){const t=n.mapper.toViewElement(o);return void Df(e,l,n.writer.createPositionAt(t,o.getChildIndex(i)),n,{asWidget:!0})}})),i.attributeToAttribute({model:"colspan",view:"colspan"}),i.attributeToAttribute({model:"rowspan",view:"rowspan"}),i.for("editingDowncast").add(e=>e.on("attribute:headingColumns:table",(e,t,n)=>{const i=t.item;if(!n.consumable.consume(t.item,e.name))return;const o={headingRows:i.getAttribute("headingRows")||0,headingColumns:i.getAttribute("headingColumns")||0},r=t.attributeOldValue,s=t.attributeNewValue,a=(r>s?r:s)-1;for(const e of new zf(i,{endColumn:a}))jf(e,o,n)})),e.commands.add("insertTable",new Wf(e)),e.commands.add("insertTableRowAbove",new tw(e,{order:"above"})),e.commands.add("insertTableRowBelow",new tw(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new nw(e,{order:"left"})),e.commands.add("insertTableColumnRight",new nw(e,{order:"right"})),e.commands.add("removeTableRow",new ww(e)),e.commands.add("removeTableColumn",new bw(e)),e.commands.add("splitTableCellVertically",new iw(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new iw(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new Cw(e)),e.commands.add("mergeTableCellRight",new pw(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new pw(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new pw(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new pw(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new kw(e)),e.commands.add("setTableRowHeader",new _w(e)),e.commands.add("selectTableRow",new Pw(e)),e.commands.add("selectTableColumn",new Sw(e)),Hw(t),Iw(t),Vw(t),Rw(t)}static get requires(){return[vw]}}n(94);class Ww extends Ti{constructor(e){super(e);const t=this.bindTemplate;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 Ui,this.focusTracker=new mo,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",t.if("isVisible","ck-hidden",e=>!e),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",(e,t)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())}),this.keystrokes.set("arrowleft",(e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())})}focus(){this.actionView.focus()}_createActionView(){const e=new Fi;return e.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),e.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),e.delegate("execute").to(this),e}_createArrowView(){const e=new Fi,t=e.bindTemplate;return e.icon=uo,e.extendTemplate({attributes:{class:"ck-splitbutton__arrow","aria-haspopup":!0,"aria-expanded":t.to("isOn",e=>String(e))}}),e.bind("isEnabled").to(this),e.delegate("execute").to(this,"open"),e}}n(96);class $w extends Ti{constructor(e){super(e);const t=this.bindTemplate;this.items=this._createGridCollection(),this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",(e,t)=>`${t} × ${e}`),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":t.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck-insert-table-dropdown__label"]},children:[{text:t.to("label")}]}],on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(()=>{this.fire("execute")})}}),this.on("boxover",(e,t)=>{const{row:n,column:i}=t.target.dataset;this.set({rows:parseInt(n),columns:parseInt(i)})}),this.on("change:columns",()=>{this._highlightGridBoxes()}),this.on("change:rows",()=>{this._highlightGridBoxes()})}focus(){}focusLast(){}_highlightGridBoxes(){const e=this.rows,t=this.columns;this.items.map((n,i)=>{const o=Math.floor(i/10)<e&&i%10<t;n.set("isOn",o)})}_createGridCollection(){const e=[];for(let t=0;t<100;t++){const n=Math.floor(t/10),i=t%10;e.push(new qw(this.locale,n+1,i+1))}return this.createCollection(e)}}class qw extends Ti{constructor(e,t,n){super(e);const i=this.bindTemplate;this.set("isOn",!1),this.setTemplate({tag:"div",attributes:{class:["ck-insert-table-dropdown-grid-box",i.if("isOn","ck-on")],"data-row":t,"data-column":n}})}}class Yw extends Je{init(){const e=this.editor,t=this.editor.t,n="ltr"===e.locale.contentLanguageDirection;e.ui.componentFactory.add("insertTable",n=>{const i=e.commands.get("insertTable"),o=Mo(n);let r;return o.bind("isEnabled").to(i),o.buttonView.set({icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 6v3h4V6H3zm0 4v3h4v-3H3zm0 4v3h4v-3H3zm5 3h4v-3H8v3zm5 0h4v-3h-4v3zm4-4v-3h-4v3h4zm0-4V6h-4v3h4zm1.5 8a1.5 1.5 0 0 1-1.5 1.5H3A1.5 1.5 0 0 1 1.5 17V4c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5v13zM12 13v-3H8v3h4zm0-4V6H8v3h4z"/></svg>',label:t("Insert table"),tooltip:!0}),o.on("change:isOpen",()=>{r||(r=new $w(n),o.panelView.children.add(r),r.delegate("execute").to(o),o.buttonView.on("open",()=>{r.rows=0,r.columns=0}),o.on("execute",()=>{e.execute("insertTable",{rows:r.rows,columns:r.columns}),e.editing.view.focus()}))}),o}),e.ui.componentFactory.add("tableColumn",e=>{const i=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:t("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:n?"insertTableColumnLeft":"insertTableColumnRight",label:t("Insert column left")}},{type:"button",model:{commandName:n?"insertTableColumnRight":"insertTableColumnLeft",label:t("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:t("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:t("Select column")}}];return this._prepareDropdown(t("Column"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M18 7v1H2V7h16zm0 5v1H2v-1h16z" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z"/></svg>',i,e)}),e.ui.componentFactory.add("tableRow",e=>{const n=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:t("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:t("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:t("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:t("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:t("Select row")}}];return this._prepareDropdown(t("Row"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v16h-1V2z" opacity=".6"/><path d="M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z"/></svg>',n,e)}),e.ui.componentFactory.add("mergeTableCells",e=>{const i=[{type:"button",model:{commandName:"mergeTableCellUp",label:t("Merge cell up")}},{type:"button",model:{commandName:n?"mergeTableCellRight":"mergeTableCellLeft",label:t("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:t("Merge cell down")}},{type:"button",model:{commandName:n?"mergeTableCellLeft":"mergeTableCellRight",label:t("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:t("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:t("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(t("Merge cells"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z"/></svg>',i,e)})}_prepareDropdown(e,t,n,i){const o=this.editor,r=Mo(i),s=this._fillDropdownWithListOptions(r,n);return r.buttonView.set({label:e,icon:t,tooltip:!0}),r.bind("isEnabled").toMany(s,"isEnabled",(...e)=>e.some(e=>e)),this.listenTo(r,"execute",e=>{o.execute(e.source.commandName),o.editing.view.focus()}),r}_prepareMergeSplitButtonDropdown(e,t,n,i){const o=this.editor,r=Mo(i,Ww);return this._fillDropdownWithListOptions(r,n),r.buttonView.set({label:e,icon:t,tooltip:!0,isEnabled:!0}),this.listenTo(r.buttonView,"execute",()=>{o.execute("mergeTableCells"),o.editing.view.focus()}),this.listenTo(r,"execute",e=>{o.execute(e.source.commandName),o.editing.view.focus()}),r}_fillDropdownWithListOptions(e,t){const n=this.editor,i=[],o=new Qe;for(const e of t)Jw(e,n,i,o);return So(e,o,n.ui.componentFactory),i}}function Jw(e,t,n,i){const o=e.model=new $m(e.model),{commandName:r,bindIsOn:s}=e.model;if("button"===e.type||"switchbutton"===e.type){const e=t.commands.get(r);n.push(e),o.set({commandName:r}),o.bind("isEnabled").to(e),s&&o.bind("isOn").to(e,"value")}o.set({withText:!0}),i.add(e)}n(98);class Kw extends Je{static get pluginName(){return"TableSelection"}static get requires(){return[vw]}init(){const e=this.editor.model;this.listenTo(e,"deleteContent",(e,t)=>this._handleDeleteContent(e,t),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){const e=$f(this.editor.model.document.selection);return 0==e.length?null:e}getSelectionAsFragment(){const e=this.getSelectedTableCells();return e?this.editor.model.change(t=>{const n=t.createDocumentFragment(),i=this.editor.plugins.get("TableUtils"),{first:o,last:r}=Kf(e),{first:s,last:a}=Jf(e),l=e[0].findAncestor("table");let c=a,d=r;if(Xf(e,i)){const e={firstColumn:o,lastColumn:r,firstRow:s,lastRow:a};c=mw(l,e),d=gw(l,e)}const u=ow(l,{startRow:s,startColumn:o,endRow:c,endColumn:d},t);return t.insert(u,n,0),n}):null}setCellSelection(e,t){const n=this._getCellsToSelect(e,t);this.editor.model.change(e=>{e.setSelection(n.cells.map(t=>e.createRangeOn(t)),{backward:n.backward})})}getFocusCell(){const e=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return e&&e.is("element","tableCell")?e:null}getAnchorCell(){const e=lt(this.editor.model.document.selection.getRanges()).getContainedElement();return e&&e.is("element","tableCell")?e:null}_defineSelectionConverter(){const e=this.editor,t=new Set;e.conversion.for("editingDowncast").add(e=>e.on("selection",(e,n,i)=>{const o=i.writer;!function(e){for(const n of t)e.removeClass("ck-editor__editable_selected",n);t.clear()}(o);const r=this.getSelectedTableCells();if(!r)return;for(const e of r){const n=i.mapper.toViewElement(e);o.addClass("ck-editor__editable_selected",n),t.add(n)}const s=i.mapper.toViewElement(r[r.length-1]);o.setSelection(s,0)},{priority:"lowest"}))}_enablePluginDisabling(){const e=this.editor;this.on("change:isEnabled",()=>{if(!this.isEnabled){const t=this.getSelectedTableCells();if(!t)return;e.model.change(n=>{const i=n.createPositionAt(t[0],0),o=e.model.schema.getNearestSelectionRange(i);n.setSelection(o)})}})}_handleDeleteContent(e,t){const[n,i]=t,o=this.editor.model,r=!i||"backward"==i.direction,s=$f(n);s.length&&(e.stop(),o.change(e=>{const t=s[r?s.length-1:0];o.change(e=>{for(const t of s)o.deleteContent(e.createSelection(t,"in"))});const i=o.schema.getNearestSelectionRange(e.createPositionAt(t,0));n.is("documentSelection")?e.setSelection(i):n.setTo(i)}))}_getCellsToSelect(e,t){const n=this.editor.plugins.get("TableUtils"),i=n.getCellLocation(e),o=n.getCellLocation(t),r=Math.min(i.row,o.row),s=Math.max(i.row,o.row),a=Math.min(i.column,o.column),l=Math.max(i.column,o.column),c=new Array(s-r+1).fill(null).map(()=>[]),d={startRow:r,endRow:s,startColumn:a,endColumn:l};for(const{row:t,cell:n}of new zf(e.findAncestor("table"),d))c[t-r].push(n);const u=o.row<i.row,h=o.column<i.column;return u&&c.reverse(),h&&c.forEach(e=>e.reverse()),{cells:c.flat(),backward:u||h}}}class Xw extends Je{static get pluginName(){return"TableClipboard"}static get requires(){return[Kw,vw]}init(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"copy",(e,t)=>this._onCopyCut(e,t)),this.listenTo(t,"cut",(e,t)=>this._onCopyCut(e,t)),this.listenTo(e.model,"insertContent",(e,t)=>this._onInsertContent(e,...t),{priority:"high"})}_onCopyCut(e,t){const n=this.editor.plugins.get(Kw);if(!n.getSelectedTableCells())return;if("cut"==e.name&&this.editor.isReadOnly)return;t.preventDefault(),e.stop();const i=this.editor.data,o=this.editor.editing.view.document,r=i.toView(n.getSelectionAsFragment());o.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:r,method:e.name})}_onInsertContent(e,t,n){if(n&&!n.is("documentSelection"))return;const i=this.editor.model,o=this.editor.plugins.get(vw);let r=function(e,t){if(!e.is("documentFragment")&&!e.is("element"))return null;if(e.is("element","table"))return e;if(1==e.childCount&&e.getChild(0).is("element","table"))return e.getChild(0);const n=t.createRangeIn(e);for(const e of n.getItems())if(e.is("element","table")){const i=t.createRange(n.start,t.createPositionBefore(e));if(t.hasContent(i,{ignoreWhitespaces:!0}))return null;const o=t.createRange(t.createPositionAfter(e),n.end);return t.hasContent(o,{ignoreWhitespaces:!0})?null:e}return null}(t,i);if(!r)return;const s=Yf(i.document.selection);s.length?(e.stop(),i.change(e=>{const t={width:o.getColumns(r),height:o.getRows(r)},n=function(e,t,n,i){const o=e[0].findAncestor("table"),r=Kf(e),s=Jf(e),a={firstColumn:r.first,lastColumn:r.last,firstRow:s.first,lastRow:s.last},l=1===e.length;l&&(a.lastRow+=t.height-1,a.lastColumn+=t.width-1,function(e,t,n,i){const o=i.getColumns(e),r=i.getRows(e);n>o&&i.insertColumns(e,{at:o,columns:n-o});t>r&&i.insertRows(e,{at:r,rows:t-r})}(o,a.lastRow+1,a.lastColumn+1,i));l||!Xf(e,i)?function(e,t,n){const{firstRow:i,lastRow:o,firstColumn:r,lastColumn:s}=t,a={first:i,last:o},l={first:r,last:s};Qw(e,r,a,n),Qw(e,s+1,a,n),Gw(e,i,l,n),Gw(e,o+1,l,n,i)}(o,a,n):(a.lastRow=mw(o,a),a.lastColumn=gw(o,a));return a}(s,t,e,o),i=n.lastRow-n.firstRow+1,a=n.lastColumn-n.firstColumn+1,l={startRow:0,startColumn:0,endRow:Math.min(i,t.height)-1,endColumn:Math.min(a,t.width)-1};r=ow(r,l,e);const c=s[0].findAncestor("table"),d=function(e,t,n,i,o){const{width:r,height:s}=t,a=function(e,t,n){const i=new Array(n).fill(null).map(()=>new Array(t).fill(null));for(const{column:t,row:n,cell:o}of new zf(e))i[n][t]=o;return i}(e,r,s),l=[...new zf(n,{startRow:i.firstRow,endRow:i.lastRow,startColumn:i.firstColumn,endColumn:i.lastColumn,includeAllSlots:!0})],c=[];let d;for(const e of l){const{row:t,column:n,cell:l,isAnchor:u}=e;n===i.firstColumn&&(d=e.getPositionBefore()),u&&o.remove(l);const h=t-i.firstRow,m=n-i.firstColumn,g=a[h%s][m%r];if(!g)continue;const p=o.cloneElement(g);cw(p,t,n,i.lastRow,i.lastColumn,o),o.insert(p,d),c.push(p),d=o.createPositionAfter(p)}const u=parseInt(n.getAttribute("headingRows")||0),h=parseInt(n.getAttribute("headingColumns")||0),m=i.firstRow<u&&u<=i.lastRow,g=i.firstColumn<h&&h<=i.lastColumn;if(m){const e={first:i.firstColumn,last:i.lastColumn},t=Gw(n,u,e,o,i.firstRow);c.push(...t)}if(g){const e={first:i.firstRow,last:i.lastRow},t=Qw(n,h,e,o);c.push(...t)}return c}(r,t,c,n,e);if(this.editor.plugins.get("TableSelection").isEnabled){const t=Gf(d.map(t=>e.createRangeOn(t)));e.setSelection(t)}else e.setSelection(d[0],0)})):hw(r,o)}}function Gw(e,t,n,i,o=0){if(t<1)return;return rw(e,t,o).filter(({column:e,cellWidth:t})=>Zw(e,t,n)).map(({cell:e})=>sw(e,t,i))}function Qw(e,t,n,i){if(t<1)return;return aw(e,t).filter(({row:e,cellHeight:t})=>Zw(e,t,n)).map(({cell:e,column:n})=>lw(e,n,t,i))}function Zw(e,t,n){const i=e+t-1,{first:o,last:r}=n;return e>=o&&e<=r||e<o&&i>=o}class eb extends Je{static get pluginName(){return"TableKeyboard"}static get requires(){return[Kw]}init(){const e=this.editor.editing.view.document;this.editor.keystrokes.set("Tab",(...e)=>this._handleTabOnSelectedTable(...e),{priority:"low"}),this.editor.keystrokes.set("Tab",this._getTabHandler(!0),{priority:"low"}),this.editor.keystrokes.set("Shift+Tab",this._getTabHandler(!1),{priority:"low"}),this.listenTo(e,"keydown",(...e)=>this._onKeydown(...e),{priority:a.get("high")-10})}_handleTabOnSelectedTable(e,t){const n=this.editor,i=n.model.document.selection.getSelectedElement();i&&i.is("element","table")&&(t(),n.model.change(e=>{e.setSelection(e.createRangeIn(i.getChild(0).getChild(0)))}))}_getTabHandler(e){const t=this.editor;return(n,i)=>{let o=qf(t.model.document.selection)[0];if(o||(o=this.editor.plugins.get("TableSelection").getFocusCell()),!o)return;i();const r=o.parent,s=r.parent,a=s.getChildIndex(r),l=r.getChildIndex(o),c=0===l;if(!e&&c&&0===a)return void t.model.change(e=>{e.setSelection(e.createRangeOn(s))});const d=l===r.childCount-1,u=a===s.childCount-1;if(e&&u&&d&&(t.execute("insertTableRowBelow"),a===s.childCount-1))return void t.model.change(e=>{e.setSelection(e.createRangeOn(s))});let h;if(e&&d){const e=s.getChild(a+1);h=e.getChild(0)}else if(!e&&c){const e=s.getChild(a-1);h=e.getChild(e.childCount-1)}else h=r.getChild(l+(e?1:-1));t.model.change(e=>{e.setSelection(e.createRangeIn(h))})}}_onKeydown(e,t){const n=this.editor,i=t.keyCode;if(!ji(i))return;const o=Di(i,n.locale.contentLanguageDirection);this._handleArrowKeys(o,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(e,t){const n=this.editor.model.document.selection,i=["right","down"].includes(e),o=$f(n);if(o.length){let n;return n=t?this.editor.plugins.get("TableSelection").getFocusCell():i?o[o.length-1]:o[0],this._navigateFromCellInDirection(n,e,t),!0}const r=n.focus.findAncestor("tableCell");return!!r&&(!(t&&!n.isCollapsed&&n.isBackward==i)&&(!!this._isSelectionAtCellEdge(n,r,i)&&(this._navigateFromCellInDirection(r,e,t),!0)))}_isSelectionAtCellEdge(e,t,n){const i=this.editor.model,o=this.editor.model.schema,r=n?e.getLastPosition():e.getFirstPosition();if(!o.getLimitElement(r).is("element","tableCell")){return i.createPositionAt(t,n?"end":0).isTouching(r)}const s=i.createSelection(r);return i.modifySelection(s,{direction:n?"forward":"backward"}),r.isEqual(s.focus)}_navigateFromCellInDirection(e,t,n=!1){const i=this.editor.model,o=e.findAncestor("table"),r=[...new zf(o,{includeAllSlots:!0})],{row:s,column:a}=r[r.length-1],l=r.find(({cell:t})=>t==e);let{row:c,column:d}=l;switch(t){case"left":d--;break;case"up":c--;break;case"right":d+=l.cellWidth;break;case"down":c+=l.cellHeight}if(c<0||c>s||d<0&&c<=0||d>a&&c>=s)return void i.change(e=>{e.setSelection(e.createRangeOn(o))});d<0?(d=n?0:a,c--):d>a&&(d=n?a:0,c++);const u=r.find(e=>e.row==c&&e.column==d).cell,h=["right","down"].includes(t),m=this.editor.plugins.get("TableSelection");if(n&&m.isEnabled){const t=m.getAnchorCell()||e;m.setCellSelection(t,u)}else{const e=i.createPositionAt(u,h?0:"end");i.change(t=>{t.setSelection(e)})}}}class tb extends Wr{constructor(e){super(e),this.domEventType=["mousemove","mouseup","mouseleave"]}onDomEvent(e){this.fire(e.type,e)}}class nb extends Je{static get pluginName(){return"TableMouse"}static get requires(){return[Kw]}init(){this.editor.editing.view.addObserver(tb),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const e=this.editor;let t=!1;const n=e.plugins.get(Kw);this.listenTo(e.editing.view.document,"mousedown",(i,o)=>{if(!this.isEnabled||!n.isEnabled)return;if(!o.domEvent.shiftKey)return;const r=n.getAnchorCell()||qf(e.model.document.selection)[0];if(!r)return;const s=this._getModelTableCellFromDomEvent(o);s&&ib(r,s)&&(t=!0,n.setCellSelection(r,s),o.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{t=!1}),this.listenTo(e.editing.view.document,"selectionChange",e=>{t&&e.stop()},{priority:"highest"})}_enableMouseDragSelection(){const e=this.editor;let t,n,i=!1,o=!1;const r=e.plugins.get(Kw);this.listenTo(e.editing.view.document,"mousedown",(e,n)=>{this.isEnabled&&r.isEnabled&&(n.domEvent.shiftKey||n.domEvent.ctrlKey||n.domEvent.altKey||(t=this._getModelTableCellFromDomEvent(n)))}),this.listenTo(e.editing.view.document,"mousemove",(e,s)=>{if(!s.domEvent.buttons)return;if(!t)return;const a=this._getModelTableCellFromDomEvent(s);a&&ib(t,a)&&(n=a,i||n==t||(i=!0)),i&&(o=!0,r.setCellSelection(t,n),s.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{i=!1,o=!1,t=null,n=null}),this.listenTo(e.editing.view.document,"selectionChange",e=>{o&&e.stop()},{priority:"highest"})}_getModelTableCellFromDomEvent(e){const t=e.target,n=this.editor.editing.view.createPositionAt(t,0);return this.editor.editing.mapper.toModelPosition(n).parent.findAncestor("tableCell",{includeSelf:!0})}}function ib(e,t){return e.parent.parent==t.parent.parent}n(100);function ob(e){const t=e.getSelectedElement();return t&&sb(t)?t:null}function rb(e){const t=function(e,t){let n=t.parent;for(;n;){if(n.name===e)return n;n=n.parent}}("table",e.getFirstPosition());return t&&sb(t.parent)?t.parent:null}function sb(e){return!!e.getCustomProperty("table")&&Cr(e)}class ab{constructor(e,t){this.model=e,this.testCallback=t,this.hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",(t,{directChange:n})=>{n&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this.hasMatch=!1))}),this.listenTo(e,"change:data",(e,t)=>{"transparent"!=t.type&&this._evaluateTextBeforeSelection("data",{batch:t})})}_evaluateTextBeforeSelection(e,t={}){const n=this.model,i=n.document.selection,o=n.createRange(n.createPositionAt(i.focus.parent,0),i.focus),{text:r,range:s}=function(e,t){let n=e.start;return{text:Array.from(e.getItems()).reduce((e,i)=>i.is("$text")||i.is("$textProxy")?e+i.data:(n=t.createPositionAfter(i),""),""),range:t.createRange(n,e.end)}}(o,n),a=this.testCallback(r);if(!a&&this.hasMatch&&this.fire("unmatched"),this.hasMatch=!!a,a){const n=Object.assign(t,{text:r,range:s});"object"==typeof a&&Object.assign(n,a),this.fire("matched:"+e,n)}}}Ye(ab,Fe);var lb=/[\\^$.*+?()[\]{}|]/g,cb=RegExp(lb.source);var db=function(e){return(e=Ts(e))&&cb.test(e)?e.replace(lb,"\\$&"):e};const ub={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:"1/2",to:"½"},oneThird:{from:"1/3",to:"⅓"},twoThirds:{from:"2/3",to:"⅔"},oneForth:{from:"1/4",to:"¼"},threeQuarters:{from:"3/4",to:"¾"},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:wb('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:wb("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:wb("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:wb('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:wb('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:wb("'"),to:[null,"‚",null,"’"]}},hb={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},mb=["symbols","mathematical","typography","quotes"];function gb(e){return"string"==typeof e?new RegExp(`(${db(e)})$`):e}function pb(e){return"string"==typeof e?()=>[e]:e instanceof Array?()=>e:e}function fb(e){return(e.textNode?e.textNode:e.nodeAfter).getAttributes()}function wb(e){return new RegExp(`(^|\\s)(${e})([^${e}]*)(${e})$`)}class bb{constructor(e){this.loader=e}upload(){return new Promise((e,t)=>{const n=this.reader=new window.FileReader;n.addEventListener("load",()=>{e({default:n.result})}),n.addEventListener("error",e=>{t(e)}),n.addEventListener("abort",()=>{t()}),this.loader.file.then(e=>{n.readAsDataURL(e)})})}abort(){this.reader.abort()}}class _b extends Wr{constructor(e){super(e),this.domEventType="click"}onDomEvent(e){this.fire(e.type,e)}}class kb{constructor(e,t={}){this.namespaces=t.namespaces||[],this._domParser=new DOMParser,this._domConverter=new _a(e,{blockFillerMode:"nbsp"}),this._htmlWriter=new Na}toData(e){const t=this._domConverter.viewToDom(e,document);return this._htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this._domConverter.domToView(t,{keepOriginalCase:!0})}_toDom(e){e=`<xml ${this.namespaces.map(e=>`xmlns:${e}="nsp"`).join(" ")}>${e}</xml>`;const t=this._domParser.parseFromString(e,"text/xml"),n=t.querySelector("parsererror");if(n)throw new Error("Parse error - "+n.textContent);const i=t.createDocumentFragment(),o=t.documentElement.childNodes;for(;o.length>0;)i.appendChild(o[0]);return i}}class vb{static get safeXmlCharactersEntities(){return{tagOpener:"&laquo;",tagCloser:"&raquo;",doubleQuote:"&uml;",realDoubleQuote:"&quot;"}}static get safeBadBlackboardCharacters(){return{ltElement:"«mo»<«/mo»",gtElement:"«mo»>«/mo»",ampElement:"«mo»&«/mo»"}}static get safeGoodBlackboardCharacters(){return{ltElement:"«mo»§lt;«/mo»",gtElement:"«mo»§gt;«/mo»",ampElement:"«mo»§amp;«/mo»"}}static get xmlCharacters(){return{id:"xmlCharacters",tagOpener:"<",tagCloser:">",doubleQuote:'"',ampersand:"&",quote:"'"}}static get safeXmlCharacters(){return{id:"safeXmlCharacters",tagOpener:"«",tagCloser:"»",doubleQuote:"¨",ampersand:"§",quote:"`",realDoubleQuote:"¨"}}}class yb{static isMathmlInAttribute(e,t){const n=new RegExp("^['\"][\\s]*=[\\s]*[\\w-]+('[\\s]*(\"[^\"]*\"|'[^']*')[\\s]*=[\\s]*[\\w-]+[\\s]*')*[\\s]+gmi<"),i=e.substring(0,t).split("").reverse().join("");return n.test(i)}static safeXmlDecode(e){let{tagOpener:t}=vb.safeXmlCharactersEntities,{tagCloser:n}=vb.safeXmlCharactersEntities,{doubleQuote:i}=vb.safeXmlCharactersEntities,{realDoubleQuote:o}=vb.safeXmlCharactersEntities;e=(e=(e=(e=e.split(t).join(vb.safeXmlCharacters.tagOpener)).split(n).join(vb.safeXmlCharacters.tagCloser)).split(i).join(vb.safeXmlCharacters.doubleQuote)).split(o).join(vb.safeXmlCharacters.realDoubleQuote);const{ltElement:r}=vb.safeBadBlackboardCharacters,{gtElement:s}=vb.safeBadBlackboardCharacters,{ampElement:a}=vb.safeBadBlackboardCharacters;"_wrs_blackboard"in window&&window._wrs_blackboard&&(e=(e=(e=e.split(r).join(vb.safeGoodBlackboardCharacters.ltElement)).split(s).join(vb.safeGoodBlackboardCharacters.gtElement)).split(a).join(vb.safeGoodBlackboardCharacters.ampElement)),({tagOpener:t}=vb.safeXmlCharacters),({tagCloser:n}=vb.safeXmlCharacters),({doubleQuote:i}=vb.safeXmlCharacters),({realDoubleQuote:o}=vb.safeXmlCharacters);const{ampersand:l}=vb.safeXmlCharacters,{quote:c}=vb.safeXmlCharacters;e=(e=(e=(e=(e=e.split(t).join(vb.xmlCharacters.tagOpener)).split(n).join(vb.xmlCharacters.tagCloser)).split(i).join(vb.xmlCharacters.doubleQuote)).split(l).join(vb.xmlCharacters.ampersand)).split(c).join(vb.xmlCharacters.quote);let d="",u=null;for(let t=0;t<e.length;t+=1){const n=e.charAt(t);null==u?"$"===n?u="":d+=n:";"===n?(d+="&"+u,u=null):n.match(/([a-zA-Z0-9#._-] | '-')/)?u+=n:(d+="$"+u,u=null,t-=1)}return d}static safeXmlEncode(e){const{tagOpener:t}=vb.xmlCharacters,{tagCloser:n}=vb.xmlCharacters,{doubleQuote:i}=vb.xmlCharacters,{ampersand:o}=vb.xmlCharacters,{quote:r}=vb.xmlCharacters;return e=(e=(e=(e=(e=e.split(t).join(vb.safeXmlCharacters.tagOpener)).split(n).join(vb.safeXmlCharacters.tagCloser)).split(i).join(vb.safeXmlCharacters.doubleQuote)).split(o).join(vb.safeXmlCharacters.ampersand)).split(r).join(vb.safeXmlCharacters.quote)}static mathMLEntities(e){let t="";for(let n=0;n<e.length;n+=1){const i=e.charAt(n);if(e.codePointAt(n)>128)t+=`&#${e.codePointAt(n)};`,e.codePointAt(n)>65535&&(n+=1);else if("&"===i){const o=e.indexOf(";",n+1);if(o>=0){const i=document.createElement("span");i.innerHTML=e.substring(n,o+1),t+=`&#${Sb.fixedCharCodeAt(i.textContent||i.innerText,0)};`,n=o}else t+=i}else t+=i}return t}static addCustomEditorClassAttribute(e,t){let n="";const i=e.indexOf("<math");if(0===i){const o=e.indexOf(">");if(-1===e.indexOf("class"))return n=`${e.substr(i,o)} class="wrs_${t}">`,n+=e.substr(o+1,e.length),n}return e}static removeCustomEditorClassAttribute(e,t){return-1===e.indexOf("class")||-1===e.indexOf("wrs_"+t)?e:-1!==e.indexOf(`class="wrs_${t}"`)?e.replace(`class="wrs_${t}"`,""):e.replace("wrs_"+t,"")}static addAnnotation(e,t,n){let i="";if(-1!==e.indexOf("<annotation")){const o=e.indexOf("</semantics>");i=`${e.substring(0,o)}<annotation encoding="${n}">${t}</annotation>${e.substring(o)}`}else if(yb.isEmpty(e)){const o=e.indexOf("/>"),r=e.indexOf(">"),s=r===o?o:r;i=`${e.substring(0,s)}><semantics><annotation encoding="${n}">${t}</annotation></semantics></math>`}else{const o=e.indexOf(">")+1,r=e.lastIndexOf("</math>"),s=e.substring(o,r);i=`${e.substring(0,o)}<semantics>${s}<annotation encoding="${n}">${t}</annotation></semantics></math>`}return i}static removeAnnotation(e,t){let n=e;const i=`<annotation encoding="${t}">`,o=e.indexOf(i);if(-1!==o){let t=!1,i=e.indexOf("<annotation");for(;-1!==i;)i!==o&&(t=!0),i=e.indexOf("<annotation",i+1);if(t){const t=e.indexOf("</annotation>",o)+"</annotation>".length;n=e.substring(0,o)+e.substring(t)}else n=yb.removeSemantics(e)}return n}static removeSemantics(e){let t=e;const n=e.indexOf("<semantics>");if(-1!==n){const i=e.indexOf("<annotation",n+"<semantics>".length);-1!==i&&(t=e.substring(0,n)+e.substring(n+"<semantics>".length,i)+"</math>")}return t}static removeSemanticsOcurrences(e,t=vb.xmlCharacters){const n=t.tagOpener+"math",i=`${t.tagOpener}/math${t.tagCloser}`,o="/"+t.tagCloser,{tagCloser:r}=t,s=`${t.tagOpener}semantics${t.tagCloser}`,a=t.tagOpener+"annotation encoding=";let l="",c=e.indexOf(n),d=0;for(;-1!==c;){l+=e.substring(d,c);const t=e.indexOf(i,c),u=e.indexOf(o,c),h=e.indexOf(r,c);-1!==t?d=t:u===h-1&&(d=u);const m=e.indexOf(s,c);if(-1!==m){const t=e.substring(c,m),o=e.indexOf(a,c);if(-1!==o){const r=m+s.length;l+=t+e.substring(r,o)+i,c=e.indexOf(n,c+n.length),d+=i.length}else d=c,c=e.indexOf(n,c+n.length)}else d=c,c=e.indexOf(n,c+n.length)}return l+=e.substring(d,e.length),l}static containClass(e,t){const n=e.indexOf("class");if(-1===n)return!1;const i=e.indexOf(">",n);return-1!==e.substring(n,i).indexOf(t)}static isEmpty(e){const t=e.indexOf(">"),n=e.indexOf("/>");let i=!1;if(-1!==n&&n===t-1&&(i=!0),!i){const n=new RegExp("</(.+:)?math>").exec(e);n&&(i=t+1===n.index)}return i}static encodeProperties(e){return e.replace(/\w+=".*?"/g,e=>{const t=e.indexOf('"'),n=e.substring(t+1,e.length-1),i=Sb.htmlEntities(n);return`${e.substring(0,t+1)}${i}"`})}}class xb{static addConfiguration(e){Object.assign(xb.properties,e)}static get properties(){return xb._properties}static set properties(e){xb._properties=e}static get(e){return Object.prototype.hasOwnProperty.call(xb.properties,e)?xb.properties[e]:!!Object.prototype.hasOwnProperty.call(xb.properties,"_wrs_conf_")&&xb.properties["_wrs_conf_"+e]}static set(e,t){xb.properties[e]=t}static update(e,t){if(xb.get(e)){const n=Object.assign(xb.get(e),t);xb.set(e,n)}else xb.set(e,t)}}xb._properties={};class Ab{constructor(){this.cache=[]}populate(e,t){this.cache[e]=t}get(e){return!!Object.prototype.hasOwnProperty.call(this.cache,e)&&this.cache[e]}}class Cb{constructor(){this.listeners=[]}add(e){this.listeners.push(e)}fire(e,t){for(let n=0;n<this.listeners.length&&!t.cancelled;n+=1)this.listeners[n].eventName===e&&this.listeners[n].callback(t);return t.defaultPrevented}static newListener(e,t){const n={};return n.eventName=e,n.callback=t,n}}class Tb{static get listeners(){return Tb._listeners}static addListener(e){Tb.listeners.add(e)}static fireEvent(e,t){Tb.listeners.fire(e,t)}static get parameters(){return Tb._parameters}static set parameters(e){Tb._parameters=e}static get servicePaths(){return Tb._servicePaths}static set servicePaths(e){Tb._servicePaths=e}static setServicePath(e,t){Tb.servicePaths[e]=t}static getServicePath(e){return Tb.servicePaths[e]}static get integrationPath(){return Tb._integrationPath}static set integrationPath(e){Tb._integrationPath=e}static getServerURL(){const e=window.location.href.split("/");return`${e[0]}//${e[2]}`}static init(e){Tb.parameters=e;let t=Tb.createServiceURI("configurationjs"),n=Tb.createServiceURI("createimage"),i=Tb.createServiceURI("showimage"),o=Tb.createServiceURI("getmathml"),r=Tb.createServiceURI("service");if(0===Tb.parameters.URI.indexOf("/")){const e=Tb.getServerURL();t=e+t,i=e+i,n=e+n,o=e+o,r=e+r}Tb.setServicePath("configurationjs",t),Tb.setServicePath("showimage",i),Tb.setServicePath("createimage",n),Tb.setServicePath("service",r),Tb.setServicePath("getmathml",o),Tb.setServicePath("configurationjs",t),Tb.listeners.fire("onInit",{})}static getUrl(e,t){const n=window.location.toString().substr(0,window.location.toString().lastIndexOf("/")+1),i=Sb.createHttpRequest();return i?(void 0===t||void 0===t?i.open("GET",e,!1):"/"===e.substr(0,1)||"http://"===e.substr(0,7)||"https://"===e.substr(0,8)?i.open("POST",e,!1):i.open("POST",n+e,!1),void 0!==t&&t?(i.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8"),i.send(Sb.httpBuildQuery(t))):i.send(null),i.responseText):""}static getService(e,t,n){let i;if(!0===n){let n=t?"?"+t:"";const o=`${Tb.getServicePath(e)}${n}`;i=Tb.getUrl(o)}else{const n=Tb.getServicePath(e);i=Tb.getUrl(n,t)}return i}static getServerLanguageFromService(e){return-1!==e.indexOf(".php")?"php":-1!==e.indexOf(".aspx")?"aspx":-1!==e.indexOf("wirispluginengine")?"ruby":"java"}static createServiceURI(e){const t=Tb.serverExtension();return Sb.concatenateUrl(Tb.parameters.URI,e)+t}static serverExtension(){return-1!==Tb.parameters.server.indexOf("php")?".php":-1!==Tb.parameters.server.indexOf("aspx")?".aspx":""}}Tb._servicePaths={},Tb._integrationPath="",Tb._listeners=new Cb,Tb._parameters={};class Eb{static get cache(){return Eb._cache}static set cache(e){Eb._cache=e}static getLatexFromMathML(e){const t=yb.removeSemantics(e),{cache:n}=Eb,i={service:"mathml2latex",mml:t},o=JSON.parse(Tb.getService("service",i));let r="";if("ok"===o.status){r=o.result.text;const t=Sb.htmlEntities(r),i=yb.addAnnotation(e,t,"LaTeX");n.populate(r,i)}return r}static getMathMLFromLatex(e,t){const n=Eb.cache;if(Eb.cache.get(e))return Eb.cache.get(e);const i={service:"latex2mathml",latex:e};t&&(i.saveLatex="");const o=JSON.parse(Tb.getService("service",i));let r;if("ok"===o.status){let t=o.result.text;t=t.split("\r").join("").split("\n").join(" "),-1===t.indexOf("semantics")&&-1===t.indexOf("annotation")?(t=yb.addAnnotation(t,e,"LaTeX"),r=t):r=t,n.get(e)||n.populate(e,t)}else r=`$$${e}$$`;return r}static parseMathmlToLatex(e,t){let n="";const i=t.tagOpener+"math",o=`${t.tagOpener}/math${t.tagCloser}`,r=`${t.tagOpener}annotation encoding=${t.doubleQuote}LaTeX${t.doubleQuote}${t.tagCloser}`,s=`${t.tagOpener}/annotation${t.tagCloser}`;let a,l,c,d=e.indexOf(i),u=0;for(;-1!==d;){if(n+=e.substring(u,d),u=e.indexOf(o,d),-1===u?u=e.length-1:u+=o.length,a=e.substring(d,u),l=a.indexOf(r),-1!==l){l+=r.length,c=a.indexOf(s);let e=a.substring(l,c);t===vb.safeXmlCharacters&&(e=yb.safeXmlDecode(e)),n+=`$$${e}$$`,Eb.cache.populate(e,a)}else n+=a;d=e.indexOf(i,u)}return n+=e.substring(u,e.length),n}static getLatexFromTextNode(e,t,n){void 0!==n&&null!=n||(n={open:"$$",close:"$$"});let i,o=e;for(;o.previousSibling&&3===o.previousSibling.nodeType;)o=o.previousSibling;function r(e,t,i){let o=e.nodeValue.indexOf(i,t);for(;-1===o;){if(!(e=e.nextSibling))return null;o=e.nodeValue?e.nodeValue.indexOf(n.close):-1}return{node:e,position:o}}function s(e,t,n,i){if(e===n)return t<=i;for(;e&&e!==n;)e=e.nextSibling;return e===n}let a={node:o,position:0};const l=n.open.length;do{if(i=r(a.node,a.position,n.open),null==i||s(e,t,i.node,i.position))return null;if(a=r(i.node,i.position+l,n.close),null==a)return null;a.position+=l}while(s(a.node,a.position,e,t));let c;if(i.node===a.node)c=i.node.nodeValue.substring(i.position+l,a.position-l);else{const e=i.position+l;c=i.node.nodeValue.substring(e,i.node.nodeValue.length);let t=i.node;do{t=t.nextSibling,t===a.node?c+=a.node.nodeValue.substring(0,a.position-l):c+=t.nodeValue?t.nodeValue:""}while(t!==a.node)}return{latex:c,startNode:i.node,startPosition:i.position,endNode:a.node,endPosition:a.position}}}Eb._cache=new Ab;var Mb=n(13);class Pb{constructor(){throw new Error("Static class StringManager can not be instantiated.")}static get(e){let{language:t}=this;return t&&t.length>2&&(t=t.slice(0,2)),this.strings.hasOwnProperty(t)||(console.warn(`Unknown language ${t} set in StringManager.`),t="en"),this.strings[t].hasOwnProperty(e)?this.strings[t][e]:(console.warn(`Unknown key ${e} for language ${t} in StringManager.`),e)}}Pb.strings=Mb,Pb.language="en";class Sb{static fireEvent(e,t){if(document.createEvent){const n=document.createEvent("HTMLEvents");return n.initEvent(t,!0,!0),!e.dispatchEvent(n)}const n=document.createEventObject();return e.fireEvent("on"+t,n)}static addEvent(e,t,n){e.addEventListener?e.addEventListener(t,n,!0):e.attachEvent&&e.attachEvent("on"+t,n)}static removeEvent(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!0):e.detachEvent&&e.detachEvent("on"+t,n)}static addElementEvents(e,t,n,i){t&&Sb.addEvent(e,"dblclick",e=>{const n=e||window.event,i=n.srcElement?n.srcElement:n.target;t(i,n)}),n&&Sb.addEvent(e,"mousedown",e=>{const t=e||window.event,i=t.srcElement?t.srcElement:t.target;n(i,t)}),i&&Sb.addEvent(document,"mouseup",e=>{const t=e||window.event,n=t.srcElement?t.srcElement:t.target;i(n,t)})}static addClass(e,t){Sb.containsClass(e,t)||(e.className+=" "+t)}static containsClass(e,t){if(null==e||!("className"in e))return!1;const n=e.className.split(" ");for(let e=n.length-1;e>=0;e-=1)if(n[e]===t)return!0;return!1}static removeClass(e,t){let n="";const i=e.className.split(" ");for(let e=0;e<i.length;e+=1)i[e]!==t&&(n+=i[e]+" ");e.className=n.trim()}static convertOldXmlinitialtextAttribute(e){const t="value=",n=e.indexOf("xmlinitialtext"),i=e.indexOf(t,n),o=e.charAt(i+t.length),r=i+t.length+1,s=e.indexOf(o,r),a=e.substring(r,s);let l=a.split("«").join("§lt;");return l=l.split("»").join("§gt;"),l=l.split("&").join("§"),l=l.split("¨").join("§quot;"),e=e.split(a).join(l)}static createElement(e,t,n){let i;void 0===t&&(t={}),void 0===n&&(n=document);try{let o="<"+e;Object.keys(t).forEach(e=>{o+=` ${e}="${Sb.htmlEntities(t[e])}"`}),o+=">",i=n.createElement(o)}catch(o){i=n.createElement(e),Object.keys(t).forEach(e=>{i.setAttribute(e,t[e])})}return i}static createObject(e,t){void 0===t&&(t=document),e=(e=(e=(e=e.split("<applet ").join('<span wirisObject="WirisApplet" ').split("<APPLET ").join('<span wirisObject="WirisApplet" ')).split("</applet>").join("</span>").split("</APPLET>").join("</span>")).split("<param ").join('<br wirisObject="WirisParam" ').split("<PARAM ").join('<br wirisObject="WirisParam" ')).split("</param>").join("</br>").split("</PARAM>").join("</br>");const n=Sb.createElement("div",{},t);return n.innerHTML=e,function e(n){if(n.getAttribute&&"WirisParam"===n.getAttribute("wirisObject")){const e={};for(let t=0;t<n.attributes.length;t+=1)null!==n.attributes[t].nodeValue&&(e[n.attributes[t].nodeName]=n.attributes[t].nodeValue);const i=Sb.createElement("param",e,t);i.NAME&&(i.name=i.NAME,i.value=i.VALUE),i.removeAttribute("wirisObject"),n.parentNode.replaceChild(i,n)}else if(n.getAttribute&&"WirisApplet"===n.getAttribute("wirisObject")){const i={};for(let e=0;e<n.attributes.length;e+=1)null!==n.attributes[e].nodeValue&&(i[n.attributes[e].nodeName]=n.attributes[e].nodeValue);const o=Sb.createElement("applet",i,t);o.removeAttribute("wirisObject");for(let t=0;t<n.childNodes.length;t+=1)e(n.childNodes[t]),"param"===n.childNodes[t].nodeName.toLowerCase()&&(o.appendChild(n.childNodes[t]),t-=1);n.parentNode.replaceChild(o,n)}else for(let t=0;t<n.childNodes.length;t+=1)e(n.childNodes[t])}(n),n.firstChild}static createObjectCode(e){if(null==e)return null;if(1===e.nodeType){let t="<"+e.tagName;for(let n=0;n<e.attributes.length;n+=1)e.attributes[n].specified&&(t+=` ${e.attributes[n].name}="${Sb.htmlEntities(e.attributes[n].value)}"`);if(e.childNodes.length>0){t+=">";for(let n=0;n<e.childNodes.length;n+=1)t+=Sb.createObject(e.childNodes[n]);t+=`</${e.tagName}>`}else"DIV"===e.nodeName||"SCRIPT"===e.nodeName?t+=`></${e.tagName}>`:t+="/>";return t}return 3===e.nodeType?Sb.htmlEntities(e.nodeValue):""}static concatenateUrl(e,t){let n="";return e.indexOf("/")!==e.length&&0!==t.indexOf("/")&&(n="/"),(e+n+t).replace(/([^:]\/)\/+/g,"$1")}static htmlEntities(e){return e.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split('"').join("&quot;")}static htmlEntitiesDecode(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}static createHttpRequest(){if("file://"===window.location.toString().substr(0,window.location.toString().lastIndexOf("/")+1).substr(0,7))throw Pb.get("exception_cross_site");if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){return null}}}static httpBuildQuery(e){let t="";return Object.keys(e).forEach(n=>{null!=e[n]&&(t+=`${Sb.urlEncode(n)}=${Sb.urlEncode(e[n])}&`)}),"&"===t.substring(t.length-1)&&(t=t.substring(0,t.length-1)),t}static propertiesToString(e){const t=[];Object.keys(e).forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&t.push(n)});const n=t.length;for(let e=0;e<n;e+=1)for(let i=e+1;i<n;i+=1){const n=t[e],o=t[i];Sb.compareStrings(n,o)>0&&(t[e]=o,t[i]=n)}let i="";for(let o=0;o<n;o+=1){const n=t[o];i+=n,i+="=";let r=e[n];r=r.replace("\\","\\\\"),r=r.replace("\n","\\n"),r=r.replace("\r","\\r"),r=r.replace("\t","\\t"),i+=r,i+="\n"}return i}static compareStrings(e,t){let n;const i=e.length,o=t.length,r=i>o?o:i;for(n=0;n<r;n+=1){const i=Sb.fixedCharCodeAt(e,n)-Sb.fixedCharCodeAt(t,n);if(0!==i)return i}return e.length-t.length}static fixedCharCodeAt(e,t){t=t||0;const n=e.charCodeAt(t);let i,o;if(n>=55296&&n<=56319){if(i=n,o=e.charCodeAt(t+1),Number.isNaN(o))throw Pb.get("exception_high_surrogate");return 1024*(i-55296)+(o-56320)+65536}return!(n>=56320&&n<=57343)&&n}static urlToAssArray(e){let t;if(t=e.indexOf("?"),t>0){const n=e.substring(t+1).split("&"),i={};for(t=0;t<n.length;t+=1){const e=n[t].split("=");e.length>1&&(i[e[0]]=decodeURIComponent(e[1].replace(/\+/g," ")))}return i}return{}}static urlEncode(e){let t="";return t=encodeURIComponent(e),t}static getWIRISImageOutput(e,t,n){const i=Sb.createObject(e);if(i&&(i.className===xb.get("imageClassName")||i.getAttribute(xb.get("imageMathmlAttribute")))){if(!t)return e;const o=i.getAttribute(xb.get("imageMathmlAttribute"));let r=yb.safeXmlDecode(o);if(xb.get("saveHandTraces")||(r=yb.removeAnnotation(r,"application/json")),null==r&&(r=i.getAttribute("alt")),n){return yb.safeXmlEncode(r)}return r}return e}static getNodeLength(e){const t={IMG:1,BR:1};if(3===e.nodeType)return e.nodeValue.length;if(1===e.nodeType){let n=t[e.nodeName.toUpperCase()];void 0===n&&(n=0);for(let t=0;t<e.childNodes.length;t+=1)n+=Sb.getNodeLength(e.childNodes[t]);return n}return 0}static getSelectedItem(e,t,n){let i;if(t?(i=e.contentWindow,i.focus()):(i=window,e.focus()),document.selection&&!n){const n=i.document.selection.createRange();if(n.parentElement){if(n.htmlText.length>0)return 0===n.text.length?Sb.getSelectedItem(e,t,!0):null;i.document.execCommand("InsertImage",!1,"#");let o,r,s=n.parentElement();return"IMG"!==s.nodeName.toUpperCase()&&(n.pasteHTML('<span id="wrs_openEditorWindow_temporalObject"></span>'),s=i.document.getElementById("wrs_openEditorWindow_temporalObject")),s.nextSibling&&3===s.nextSibling.nodeType?(o=s.nextSibling,r=0):s.previousSibling&&3===s.previousSibling.nodeType?(o=s.previousSibling,r=o.nodeValue.length):(o=i.document.createTextNode(""),s.parentNode.insertBefore(o,s),r=0),s.parentNode.removeChild(s),{node:o,caretPosition:r}}return n.length>1?null:{node:n.item(0)}}if(i.getSelection){let e;const t=i.getSelection();try{e=t.getRangeAt(0)}catch(t){e=i.document.createRange()}const n=e.startContainer;if(3===n.nodeType)return{node:n,caretPosition:e.startOffset};if(n!==e.endContainer)return null;if(1===n.nodeType){const t=e.startOffset;if(n.childNodes[t])return{node:n.childNodes[t]}}}return null}static getSelectedItemOnTextarea(e){const t=document.createTextNode(e.value),n=Eb.getLatexFromTextNode(t,e.selectionStart);return null===n?null:{node:t,caretPosition:e.selectionStart,startPosition:n.startPosition,endPosition:n.endPosition}}static getElementsByNameFromString(e,t,n){const i=[];e=e.toLowerCase(),t=t.toLowerCase();let o=e.indexOf(`<${t} `);for(;-1!==o;){let r;r=n?">":`</${t}>`;let s=e.indexOf(r,o);-1!==s?(s+=r.length,i.push({start:o,end:s})):s=o+1,o=e.indexOf(`<${t} `,s)}return i}static decode64(e){const t="+".charCodeAt(0),n="/".charCodeAt(0),i="0".charCodeAt(0),o="a".charCodeAt(0),r="A".charCodeAt(0),s="-".charCodeAt(0),a="_".charCodeAt(0),l=e.charCodeAt(0);return l===t||l===s?62:l===n||l===a?63:l<i?-1:l<i+10?l-i+26+26:l<r+26?l-r:l<o+26?l-o+26:null}static b64ToByteArray(e,t){let n;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");const i=[];let o,r,s;for(t?o=t:(r="="===e.charAt(e.length-2)?2:"="===e.charAt(e.length-1)?1:0,o=r>0?e.length-4:e.length),s=0;s<o;s+=4)n=Sb.decode64(e.charAt(s))<<18|Sb.decode64(e.charAt(s+1))<<12|Sb.decode64(e.charAt(s+2))<<6|Sb.decode64(e.charAt(s+3)),i.push(n>>16&255),i.push(n>>8&255),i.push(255&n);return r&&(2===r?(n=Sb.decode64(e.charAt(s))<<2|Sb.decode64(e.charAt(s+1))>>4,i.push(255&n)):1===r&&(n=Sb.decode64(e.charAt(s))<<10|Sb.decode64(e.charAt(s+1))<<4|Sb.decode64(e.charAt(s+2))>>2,i.push(n>>8&255),i.push(255&n))),i}static readInt32(e){if(e.length<4)return!1;const t=e.splice(0,4);return t[0]<<24|t[1]<<16|t[2]<<8|t[3]<<0}static readByte(e){return e.shift()<<0}static readBytes(e,t,n){return e.splice(t,n)}static updateTextArea(e,t){if(e&&t)if(e.focus(),null!=e.selectionStart){const{selectionEnd:n}=e,i=e.value.substring(0,e.selectionStart),o=e.value.substring(n,e.value.length);e.value=i+t+o,e.selectionEnd=n+t.length}else{document.selection.createRange().text=t}}static updateExistingTextOnTextarea(e,t,n,i){e.focus();const o=e.value.substring(0,n);e.value=o+t+e.value.substring(i,e.value.length),e.selectionEnd=n+t.length}static addArgument(e,t,n){let i;return i=e.indexOf("?")>0?"&":"?",`${e+i+t}=${n}`}}class Ib{static removeImgDataAttributes(e){const t=[],{attributes:n}=e;Object.keys(n).forEach(e=>{const i=n[e];0===i.name.indexOf("data-")&&t.push(i.name)}),t.forEach(t=>{e.removeAttribute(t)})}static clone(e,t){const n=xb.get("imageCustomEditorName");e.hasAttribute(n)||t.removeAttribute(n);[xb.get("imageMathmlAttribute"),n,"alt","height","width","style","src","role"].forEach(n=>{const i=e.getAttribute(n);i&&t.setAttribute(n,i)})}static setImgSize(e,t,n){let i,o,r,s;if(n)if("svg"===xb.get("imageFormat"))if("base64"!==xb.get("saveMode"))i=Ib.getMetricsFromSvgString(t);else{o=e.src.substr(e.src.indexOf("base64,")+7,e.src.length),s="",r=Sb.b64ToByteArray(o,o.length);for(let e=0;e<r.length;e+=1)s+=String.fromCharCode(r[e]);i=Ib.getMetricsFromSvgString(s)}else o=e.src.substr(e.src.indexOf("base64,")+7,e.src.length),r=Sb.b64ToByteArray(o,88),i=Ib.getMetricsFromBytes(r);else i=Sb.urlToAssArray(t);let a=i.cw;if(!a)return;let l=i.ch,c=i.cb;const{dpi:d}=i;d&&(a=96*a/d,l=96*l/d,c=96*c/d),e.width=a,e.height=l,e.style.verticalAlign=`-${l-c}px`}static fixAfterResize(e){if(e.removeAttribute("style"),e.removeAttribute("width"),e.removeAttribute("height"),e.style.maxWidth="none",-1!==e.src.indexOf("data:image"))if("svg"===xb.get("imageFormat")){const t=decodeURIComponent(e.src.substring(32,e.src.length));Ib.setImgSize(e,t,!0)}else{const t=e.src.substring(22,e.src.length);Ib.setImgSize(e,t,!0)}else Ib.setImgSize(e,e.src)}static getMetricsFromSvgString(e){let t=e.indexOf('height="'),n=e.indexOf('"',t+8,e.length);const i=e.substring(t+8,n);t=e.indexOf('width="'),n=e.indexOf('"',t+7,e.length);const o=e.substring(t+7,n);t=e.indexOf('wrs:baseline="'),n=e.indexOf('"',t+14,e.length);const r=e.substring(t+14,n);if(void 0!==o){const e=[];return e.cw=o,e.ch=i,void 0!==r&&(e.cb=r),e}return[]}static getMetricsFromBytes(e){let t,n,i,o,r;for(Sb.readBytes(e,0,8);e.length>=4;)i=Sb.readInt32(e),1229472850===i?(t=Sb.readInt32(e),n=Sb.readInt32(e),Sb.readInt32(e),Sb.readByte(e)):1650545477===i?o=Sb.readInt32(e):1883789683===i&&(r=Sb.readInt32(e),r=Math.round(r/39.37),Sb.readInt32(e),Sb.readByte(e)),Sb.readInt32(e);if(void 0!==t){const e=[];return e.cw=t,e.ch=n,e.dpi=r,o&&(e.cb=o),e}return[]}}class Ob{static get cache(){return Ob._cache}static set cache(e){Ob._cache=e}static mathMLToAccessible(e,t,n){void 0===t&&(t="en"),yb.containClass(e,"wrs_chemistry")&&(n.mode="chemistry");let i="";if(Ob.cache.get(e))i=Ob.cache.get(e);else{n.service="mathml2accessible",n.lang=t;const o=JSON.parse(Tb.getService("service",n));"error"!==o.status?(i=o.result.text,Ob.cache.populate(e,i)):i=Pb.get("error_convert_accessibility")}return i}}Ob._cache=new Ab;n(102);class Nb{static mathmlToImgObject(e,t,n,i){const o=e.createElement("img");o.align="middle",o.style.maxWidth="none";const r=n||{};if(r.mml=t,r.lang=i,r.metrics="true",r.centerbaseline="false","base64"===xb.get("saveMode")&&"default"===xb.get("base64savemode")&&(r.base64=!0),o.className=xb.get("imageClassName"),-1!==t.indexOf('class="')){let e=t.substring(t.indexOf('class="')+'class="'.length,t.length);e=e.substring(0,e.indexOf('"')),e=e.substring(4,e.length),o.setAttribute(xb.get("imageCustomEditorName"),e)}if(!xb.get("wirisPluginPerformance")||"xml"!==xb.get("saveMode")&&"safeXml"!==xb.get("saveMode")){const e=Nb.createImageSrc(t,r);o.setAttribute(xb.get("imageMathmlAttribute"),yb.safeXmlEncode(t)),o.src=e,Ib.setImgSize(o,e,"base64"===xb.get("saveMode")&&"default"===xb.get("base64savemode")),xb.get("enableAccessibility")&&(o.alt=Ob.mathMLToAccessible(t,i,r))}else{let e=JSON.parse(Nb.createShowImageSrc(r,i));if("warning"===e.status)try{e=JSON.parse(Tb.getService("showimage",r))}catch(e){return null}({result:e}=e),"png"===e.format?o.src="data:image/png;base64,"+e.content:o.src="data:image/svg+xml;charset=utf8,"+Sb.urlEncode(e.content),o.setAttribute(xb.get("imageMathmlAttribute"),yb.safeXmlEncode(t)),Ib.setImgSize(o,e.content,!0),xb.get("enableAccessibility")&&(void 0===e.alt?o.alt=Ob.mathMLToAccessible(t,i,r):o.alt=e.alt)}return void 0!==Nb.observer&&Nb.observer.observe(o),o.setAttribute("role","math"),o}static createImageSrc(e,t){"base64"===xb.get("saveMode")&&"default"===xb.get("base64savemode")&&(t.base64=!0);let n=Tb.getService("createimage",t);if(-1!==n.indexOf("@BASE@")){const e=Tb.getServicePath("createimage").split("/");e.pop(),n=n.split("@BASE@").join(e.join("/"))}return n}static initParse(e,t){return e=Nb.initParseSaveMode(e,t),Nb.initParseEditMode(e)}static initParseSaveMode(e,t){return xb.get("saveMode")&&(e=Eb.parseMathmlToLatex(e,vb.safeXmlCharacters),e=Eb.parseMathmlToLatex(e,vb.xmlCharacters),e=Nb.parseMathmlToImg(e,vb.safeXmlCharacters,t),e=Nb.parseMathmlToImg(e,vb.xmlCharacters,t),"base64"===xb.get("saveMode")&&"image"===xb.get("base64savemode")&&(e=Nb.codeImgTransform(e,"base642showimage"))),e}static initParseEditMode(e){if(-1!==xb.get("parseModes").indexOf("latex")){const t=Sb.getElementsByNameFromString(e,"img",!0),n='encoding="LaTeX">';let i=0;for(let o=0;o<t.length;o+=1){const r=e.substring(t[o].start+i,t[o].end+i);if(-1!==r.indexOf(` class="${xb.get("imageClassName")}"`)){let s=` ${xb.get("imageMathmlAttribute")}="`,a=r.indexOf(s);if(-1===a&&(s=' alt="',a=r.indexOf(s)),-1!==a){a+=s.length;const l=r.indexOf('"',a),c=yb.safeXmlDecode(r.substring(a,l));let d=c.indexOf(n);if(-1!==d){d+=n.length;const r=c.indexOf("</annotation>",d),s=c.substring(d,r),a=`$$${Sb.htmlEntitiesDecode(s)}$$`,l=e.substring(0,t[o].start+i),u=e.substring(t[o].end+i);e=l+a+u,i+=a.length-(t[o].end-t[o].start)}}}}}return e}static endParse(e){const t=Nb.endParseEditMode(e);return Nb.endParseSaveMode(t)}static endParseEditMode(e){if(-1!==xb.get("parseModes").indexOf("latex")){let t="",n=0,i=e.indexOf("$$");for(;-1!==i;){if(t+=e.substring(n,i),n=e.indexOf("$$",i+2),-1!==n){const o=e.substring(i+2,n),r=Sb.htmlEntitiesDecode(o);let s=Eb.getMathMLFromLatex(r,!0);xb.get("saveHandTraces")||(s=yb.removeAnnotation(s,"application/json")),t+=s,n+=2}else t+="$$",n=i+2;i=e.indexOf("$$",n)}t+=e.substring(n,e.length),e=t}return e}static endParseSaveMode(e){return xb.get("saveMode")&&("safeXml"===xb.get("saveMode")||"xml"===xb.get("saveMode")?e=Nb.codeImgTransform(e,"img2mathml"):"base64"===xb.get("saveMode")&&"image"===xb.get("base64savemode")&&(e=Nb.codeImgTransform(e,"img264"))),e}static createShowImageSrc(e,t){let n={};["mml","color","centerbaseline","zoom","dpi","fontSize","fontFamily","defaultStretchy","backgroundColor","format"].forEach(t=>{void 0!==e[t]&&(n[t]=e[t])});const i={};Object.keys(e).forEach(t=>{"mml"!==t&&(i[t]=e[t])}),i.formula=com.wiris.js.JsPluginTools.md5encode(Sb.propertiesToString(n)),i.lang=void 0===t?"en":t,i.version=xb.get("version");return Tb.getService("showimage",Sb.httpBuildQuery(i),!0)}static codeImgTransform(e,t){let n="",i=0;const o=/<img/gi,r=o.source.length;for(;o.test(e);){const s=o.lastIndex-r;n+=e.substring(i,s);let a=s+1;for(;a<e.length&&i<=s;){const t=e.charAt(a);if('"'===t||"'"===t){const n=e.indexOf(t,a+1);a=-1===n?e.length:n}else">"===t&&(i=a+1);a+=1}if(i<s)return n+=e.substring(s,e.length),n;let l=e.substring(s,i);const c=Sb.createObject(l);let d,u,h=c.getAttribute(xb.get("imageMathmlAttribute"));if("base642showimage"===t)null==h&&(h=c.getAttribute("alt")),h=yb.safeXmlDecode(h),l=Nb.mathmlToImgObject(document,h,null,null),n+=Sb.createObjectCode(l);else if("img2mathml"===t)xb.get("saveMode")&&("safeXml"===xb.get("saveMode")?(d=!0,u=!0):"xml"===xb.get("saveMode")&&(d=!0,u=!1)),n+=Sb.getWIRISImageOutput(l,d,u);else if("img264"===t){null===h&&(h=c.getAttribute("alt")),h=yb.safeXmlDecode(h);const e={base64:"true"};l=Nb.mathmlToImgObject(document,h,e,null),Ib.setImgSize(l,l.src,!0),n+=Sb.createObjectCode(l)}}return n+=e.substring(i,e.length),n}static parseMathmlToImg(e,t,n){let i="";const o=t.tagOpener+"math",r=`${t.tagOpener}/math${t.tagCloser}`;let s=e.indexOf(o),a=0;for(;-1!==s;){i+=e.substring(a,s);const l=e.indexOf(xb.get("imageMathmlAttribute"));if(a=e.indexOf(r,s),-1===a?a=e.length-1:a+=-1!==l?e.indexOf("/>",s):r.length,yb.isMathmlInAttribute(e,s)||-1!==l)i+=e.substring(s,a);else{let o=e.substring(s,a);o=t.id===vb.safeXmlCharacters.id?yb.safeXmlDecode(o):yb.mathMLEntities(o),i+=Sb.createObjectCode(Nb.mathmlToImgObject(document,o,null,n))}s=e.indexOf(o,a)}return i+=e.substring(a,e.length),i}}if("undefined"!=typeof MutationObserver){const e=new MutationObserver(e=>{e.forEach(e=>{e.oldValue===xb.get("imageClassName")&&"class"===e.attributeName&&-1===e.target.className.indexOf(xb.get("imageClassName"))&&(e.target.className=xb.get("imageClassName"))})});Nb.observer=Object.create(e),Nb.observer.Config={attributes:!0,attributeOldValue:!0},Nb.observer.observe=function(e){Object.getPrototypeOf(this).observe(e,this.Config)}}class zb{constructor(){this.isContentChanged=!1,this.waitingForChanges=!1}setIsContentChanged(e){this.isContentChanged=e}getIsContentChanged(){return this.isContentChanged}setWaitingForChanges(e){this.waitingForChanges=e}caretPositionChanged(e){}clipboardChanged(e){}contentChanged(e){!0===this.waitingForChanges&&!1===this.isContentChanged&&(this.isContentChanged=!0)}styleChanged(e){}transformationReceived(e){}}class Rb{constructor(e){if(this.editorAttributes={},!("editorAttributes"in e))throw new Error("ContentManager constructor error: editorAttributes property missed.");if(this.editorAttributes=e.editorAttributes,this.customEditors=null,"customEditors"in e&&(this.customEditors=e.customEditors),this.environment={},!("environment"in e))throw new Error("ContentManager constructor error: environment property missed");if(this.environment=e.environment,this.language="",!("language"in e))throw new Error("ContentManager constructor error: language property missed");this.language=e.language,this.editorListener=new zb,this.editor=null,this.ua=navigator.userAgent.toLowerCase(),this.deviceProperties={},this.deviceProperties.isAndroid=this.ua.indexOf("android")>-1,this.deviceProperties.isIOS=Rb.isIOS(),this.toolbar=null,this.modalDialogInstance=null,this.listeners=new Cb,this.mathML=null,this.isNewElement=!0,this.integrationModel=null}addListener(e){this.listeners.add(e)}setIntegrationModel(e){this.integrationModel=e}setModalDialogInstance(e){this.modalDialogInstance=e}insert(){this.updateTitle(this.modalDialogInstance),this.insertEditor(this.modalDialogInstance)}insertEditor(){if(Rb.isEditorLoaded()){if(this.editor=window.com.wiris.jsEditor.JsEditor.newInstance(this.editorAttributes),this.editor.insertInto(this.modalDialogInstance.contentContainer),this.editor.focus(),this.modalDialogInstance.rtl&&this.editor.action("rtl"),this.editor.getEditorModel().isRTL()&&(this.editor.element.style.direction="rtl"),this.editor.getEditorModel().addEditorListener(this.editorListener),this.modalDialogInstance.deviceProperties.isIOS){setTimeout((function(){this.hasOwnProperty("modalDialogInstance")&&this.modalDialogInstance.hideKeyboard()}),400);const e=document.getElementsByClassName("wrs_formulaDisplay")[0];Sb.addEvent(e,"focus",this.modalDialogInstance.handleOpenedIosSoftkeyboard),Sb.addEvent(e,"blur",this.modalDialogInstance.handleClosedIosSoftkeyboard)}this.listeners.fire("onLoad",{})}else setTimeout(Rb.prototype.insertEditor.bind(this),100)}init(){Rb.isEditorLoaded()||this.addEditorAsExternalDependency()}addEditorAsExternalDependency(){const e=document.createElement("script");e.type="text/javascript";let t=xb.get("editorUrl");const n=document.createElement("a");Rb.setHrefToAnchorElement(n,t),Rb.setProtocolToAnchorElement(n),t=Rb.getURLFromAnchorElement(n);const i=this.getEditorStats();e.src=`${t}?lang=${this.language}&stats-editor=${i.editor}&stats-mode=${i.mode}&stats-version=${i.version}`,document.getElementsByTagName("head")[0].appendChild(e)}static setHrefToAnchorElement(e,t){e.href=t}static setProtocolToAnchorElement(e){0===window.location.href.indexOf("https://")&&"http:"===e.protocol&&(e.protocol="https:")}static getURLFromAnchorElement(e){const t="80"===e.port||"443"===e.port||""===e.port;return`${e.protocol}//${e.hostname}${t?"":":"+e.port}${e.pathname.startsWith("/")?e.pathname:"/"+e.pathname}`}getEditorStats(){const e={};return"editor"in this.environment?e.editor=this.environment.editor:e.editor="unknown","mode"in this.environment?e.mode=this.environment.mode:e.mode=xb.get("saveMode"),"version"in this.environment?e.version=this.environment.version:e.version=xb.get("version"),e}static isIOS(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}static isEditorLoaded(){return window.com&&window.com.wiris&&window.com.wiris.jsEditor&&window.com.wiris.jsEditor.JsEditor&&window.com.wiris.jsEditor.JsEditor.newInstance}setInitialContent(){this.isNewElement||this.setMathML(this.mathML)}setMathML(e,t){void 0===t&&(t=!1),this.editor.setMathMLWithCallback(e,()=>{this.editorListener.setWaitingForChanges(!0)}),setTimeout(()=>{this.editorListener.setIsContentChanged(!1)},500),t||this.onFocus()}onFocus(){void 0!==this.editor&&null!=this.editor&&this.editor.focus()}submitAction(){if(this.editor.isFormulaEmpty())this.integrationModel.updateFormula(null);else{let e=this.editor.getMathMLWithSemantics();if(null!==this.customEditors.getActiveEditor()){const{toolbar:t}=this.customEditors.getActiveEditor();e=yb.addCustomEditorClassAttribute(e,t)}else Object.keys(this.customEditors.editors).forEach(t=>{e=yb.removeCustomEditorClassAttribute(e,t)});const t=yb.mathMLEntities(e);this.integrationModel.updateFormula(t)}this.customEditors.disable(),this.integrationModel.notifyWindowClosed(),this.setEmptyMathML(),this.customEditors.disable()}setEmptyMathML(){this.deviceProperties.isAndroid||this.deviceProperties.isIOS?this.editor.getEditorModel().isRTL()?this.setMathML('<math dir="rtl"><semantics><annotation encoding="application/json">[]</annotation></semantics></math>',!0):this.setMathML('<math><semantics><annotation encoding="application/json">[]</annotation></semantics></math>',!0):this.editor.getEditorModel().isRTL()?this.setMathML('<math dir="rtl"/>',!0):this.setMathML("<math/>",!0)}onOpen(){this.isNewElement?this.setEmptyMathML():this.setMathML(this.mathML),this.updateToolbar(),this.onFocus()}updateToolbar(){this.updateTitle(this.modalDialogInstance);const e=this.customEditors.getActiveEditor();if(e){const t=e.toolbar?e.toolbar:_wrs_int_wirisProperties.toolbar;null!=this.toolbar&&this.toolbar===t||this.setToolbar(t)}else{const e=this.getToolbar();null!=this.toolbar&&this.toolbar===e||(this.setToolbar(e),this.customEditors.disable())}}updateTitle(){const e=this.customEditors.getActiveEditor();e?this.modalDialogInstance.setTitle(e.title):this.modalDialogInstance.setTitle("MathType")}getToolbar(){let e="general";return"toolbar"in this.editorAttributes&&({toolbar:e}=this.editorAttributes),"general"===e&&(e="undefined"==typeof _wrs_int_wirisProperties||void 0===_wrs_int_wirisProperties.toolbar?"general":_wrs_int_wirisProperties.toolbar),e}setToolbar(e){this.toolbar=e,this.editor.setParams({toolbar:this.toolbar})}hasChanges(){return!this.editor.isFormulaEmpty()&&this.editorListener.getIsContentChanged()}onKeyDown(e){if(void 0!==e.key&&!1===e.repeat)if("Escape"===e.key||"Esc"===e.key){let t=document.getElementsByClassName("wrs_expandButton wrs_expandButtonFor3RowsLayout wrs_pressed");0===t.length&&(t=document.getElementsByClassName("wrs_expandButton wrs_expandButtonFor2RowsLayout wrs_pressed"),0===t.length&&(t=document.getElementsByClassName("wrs_select wrs_pressed"),0===t.length&&(this.modalDialogInstance.cancelAction(),e.stopPropagation(),e.preventDefault())))}else if(e.shiftKey&&"Tab"===e.key)if(document.activeElement===this.modalDialogInstance.submitButton)this.editor.focus(),e.stopPropagation(),e.preventDefault();else{const t=document.querySelector('[title="Manual"]');document.activeElement===t&&(this.modalDialogInstance.cancelButton.focus(),e.stopPropagation(),e.preventDefault())}else if("Tab"===e.key)if(document.activeElement===this.modalDialogInstance.cancelButton){document.querySelector('[title="Manual"]').focus(),e.stopPropagation(),e.preventDefault()}else{"wrs_formulaDisplay wrs_focused"===document.getElementsByClassName("wrs_formulaDisplay")[0].getAttribute("class")&&(this.modalDialogInstance.submitButton.focus(),e.stopPropagation(),e.preventDefault())}}}class Lb{constructor(){this.editors=[],this.activeEditor="default"}addEditor(e,t){const n={};n.name=t.name,n.toolbar=t.toolbar,n.icon=t.icon,n.confVariable=t.confVariable,n.title=t.title,n.tooltip=t.tooltip,this.editors[e]=n}enable(e){this.activeEditor=e}disable(){this.activeEditor="default"}getActiveEditor(){return"default"!==this.activeEditor?this.editors[this.activeEditor]:null}}var jb,Db={imageCustomEditorName:"data-custom-editor",imageClassName:"Wirisformula",CASClassName:"Wiriscas"};class Bb{constructor(){this.cancelled=!1,this.defaultPrevented=!1}cancel(){this.cancelled=!0}preventDefault(){this.defaultPrevented=!0}}class Vb{constructor(e){this.overlayElement=e.overlayElement,this.callbacks=e.callbacks,this.overlayWrapper=this.overlayElement.appendChild(document.createElement("div")),this.overlayWrapper.setAttribute("class","wrs_popupmessage_overlay_envolture"),this.message=this.overlayWrapper.appendChild(document.createElement("div")),this.message.id="wrs_popupmessage",this.message.setAttribute("class","wrs_popupmessage_panel"),this.message.setAttribute("role","dialog"),this.message.setAttribute("aria-describedby","description_txt");const t=document.createElement("p"),n=document.createTextNode(e.strings.message);t.appendChild(n),t.id="description_txt",this.message.appendChild(t);const i=this.overlayWrapper.appendChild(document.createElement("div"));i.setAttribute("class","wrs_popupmessage_overlay"),i.addEventListener("click",this.cancelAction.bind(this)),this.buttonArea=this.message.appendChild(document.createElement("div")),this.buttonArea.setAttribute("class","wrs_popupmessage_button_area"),this.buttonArea.id="wrs_popup_button_area";const o={class:"wrs_button_accept",innerHTML:e.strings.submitString,id:"wrs_popup_accept_button"};this.closeButton=this.createButton(o,this.closeAction.bind(this)),this.buttonArea.appendChild(this.closeButton);const r={class:"wrs_button_cancel",innerHTML:e.strings.cancelString,id:"wrs_popup_cancel_button"};this.cancelButton=this.createButton(r,this.cancelAction.bind(this)),this.buttonArea.appendChild(this.cancelButton)}createButton(e,t){let n={};return n=document.createElement("button"),n.setAttribute("id",e.id),n.setAttribute("class",e.class),n.innerHTML=e.innerHTML,n.addEventListener("click",t),n}show(){"block"!==this.overlayWrapper.style.display?(document.activeElement.blur(),this.overlayWrapper.style.display="block",this.closeButton.focus()):this.overlayWrapper.style.display="none"}cancelAction(){this.overlayWrapper.style.display="none",void 0!==this.callbacks.cancelCallback&&this.callbacks.cancelCallback()}closeAction(){this.cancelAction(),void 0!==this.callbacks.closeCallback&&this.callbacks.closeCallback()}onKeyDown(e){void 0!==e.key&&("Escape"===e.key||"Esc"===e.key?(this.cancelAction(),e.stopPropagation(),e.preventDefault()):"Tab"===e.key&&(document.activeElement===this.closeButton?this.cancelButton.focus():this.closeButton.focus(),e.stopPropagation(),e.preventDefault()))}}var Fb=new Uint8Array(16);function Hb(){if(!jb&&!(jb="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return jb(Fb)}var Ub=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var Wb=function(e){return"string"==typeof e&&Ub.test(e)},$b=[],qb=0;qb<256;++qb)$b.push((qb+256).toString(16).substr(1));var Yb=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=($b[e[t+0]]+$b[e[t+1]]+$b[e[t+2]]+$b[e[t+3]]+"-"+$b[e[t+4]]+$b[e[t+5]]+"-"+$b[e[t+6]]+$b[e[t+7]]+"-"+$b[e[t+8]]+$b[e[t+9]]+"-"+$b[e[t+10]]+$b[e[t+11]]+$b[e[t+12]]+$b[e[t+13]]+$b[e[t+14]]+$b[e[t+15]]).toLowerCase();if(!Wb(n))throw TypeError("Stringified UUID is invalid");return n};var Jb=function(e,t,n){var i=(e=e||{}).random||(e.rng||Hb)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=i[o];return t}return Yb(i)};class Kb{constructor(){throw new Error("Static class StringManager can not be instantiated.")}static get senderId(){if(!this._senderId){const e=document.cookie.split(";").map(e=>e.trim().split("="));for(const[t,n]of e)if(t===Xb){this._senderId=n;break}this._senderId||(this._senderId=Kb.composeUUID(),document.cookie=this.composeCookie(Xb,this._senderId,Gb))}return this._senderId}static get sessionId(){return this._sessionId||(this._sessionId=Kb.composeUUID()),this._sessionId}static send(e){const t={method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json","X-Api-Key":"CK20op1pOx2LAUjPFP7kB2UPveHZRidG51UJE26m","Accept-Version":"1"},body:JSON.stringify(Kb.composeBody(e))};return fetch(Kb.endpoint,t).then(e=>e).catch(e=>{})}static get session(){return{id:Kb.sessionId,page:0}}static get sender(){return{id:Kb.senderId,os:navigator.oscpu,user_agent:window.navigator.userAgent,domain:window.location.hostname,deployment:Kb.deployment,editor_version:WirisPlugin.currentInstance.environment.editorVersion?WirisPlugin.currentInstance.environment.editorVersion:"",language:WirisPlugin.currentInstance.language,product_version:WirisPlugin.currentInstance.version,backend:WirisPlugin.currentInstance.serviceProviderProperties.server?WirisPlugin.currentInstance.serviceProviderProperties.server:""}}static get deployment(){const{editor:e}=WirisPlugin.currentInstance.environment;let t="";return/Generic/.test(e)?t="generic":/Froala/.test(e)?t="froala":/CKEditor/.test(e)?t="ckeditor":/TinyMCE/.test(e)&&(t="tinymce"),"mathtype-web-plugin-"+t}static composeBody(e){return{messages:e,sender:Kb.sender,session:Kb.session}}static composeUUID(){return Jb()}static composeSenderUUID(){return this.composeUUID()}static composeCookie(e,t,n){return`${e}=${t}${null==n?"":"; max-age="+n}`}}const Xb="wiris_telemetry_mathtype_web_senderid",Gb=31536e4;Kb.endpoint="https://telemetry.wiris.net",Kb._senderId="",Kb._sessionId="";var Qb='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n   xmlns:dc="http://purl.org/dc/elements/1.1/"\n   xmlns:cc="http://creativecommons.org/ns#"\n   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n   xmlns:svg="http://www.w3.org/2000/svg"\n   xmlns="http://www.w3.org/2000/svg"\n   xmlns:xlink="http://www.w3.org/1999/xlink"\n   viewBox="0 0 13.76 13.76"\n   height="13.76"\n   width="13.76"\n   id="svg3813"\n   version="1.1">\n  <metadata\n     id="metadata3819">\n    <rdf:RDF>\n      <cc:Work\n         rdf:about="">\n        <dc:format>image/svg+xml</dc:format>\n        <dc:type\n           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n        <dc:title></dc:title>\n      </cc:Work>\n    </rdf:RDF>\n  </metadata>\n  <defs\n     id="defs3817" />\n  <image\n     y="0"\n     x="0"\n     id="image3821"\n     xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAYAAADhXXHAAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA\nnUlEQVRYw+3Z0QnCMBSF4T/FATqCG1g3cISO0NE6iiPoCE5gneD40ohPvgkJ/AcC9/EjHELgliT0\nkoGOIlasWLFixYoVK1asWLFixYoVK1bsjxy+5hlYgLEx47ofSEKSJW1nTUJJMgLPDlpwHoCpk8rO\nvgZixf4Zu3Vi3cq+WroBp4ahL+BYa3AB7o1CH7vvc7M1U4N/g2sdSk8bxjfDaMNdr+hmAQAAAABJ\nRU5ErkJggg==\n"\n     style="image-rendering:optimizeQuality"\n     preserveAspectRatio="none"\n     height="13.76"\n     width="13.76" />\n</svg>\n',Zb='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n   xmlns:dc="http://purl.org/dc/elements/1.1/"\n   xmlns:cc="http://creativecommons.org/ns#"\n   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n   xmlns:svg="http://www.w3.org/2000/svg"\n   xmlns="http://www.w3.org/2000/svg"\n   xmlns:xlink="http://www.w3.org/1999/xlink"\n   viewBox="0 0 13.76 13.76"\n   height="13.76"\n   width="13.76"\n   id="svg32"\n   version="1.1">\n  <metadata\n     id="metadata38">\n    <rdf:RDF>\n      <cc:Work\n         rdf:about="">\n        <dc:format>image/svg+xml</dc:format>\n        <dc:type\n           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n        <dc:title></dc:title>\n      </cc:Work>\n    </rdf:RDF>\n  </metadata>\n  <defs\n     id="defs36" />\n  <image\n     y="0"\n     x="0"\n     id="image40"\n     xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAYAAADhXXHAAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA\npklEQVRYw+3ZLQ4CMRCG4bcbFOvXg99T7FG4BafAw1VALx7dWyy2mIoGgSOZJu/n6p70ZybppFIK\nvWSgo4gVK1asWLFixYoVK1asWLFixYoV+yO7r/UMHIAxiO8FZGBrsUfgDEwBN/QNXIA11S/PW1Bo\nCz4N9ein4Nd1Dyw9PbDR0iVW7J+xudax6HkOtZVdg0MfQE7N0G4GlmANYgNW4A6QepowfgDMXB26\nb1V6LAAAAABJRU5ErkJggg==\n"\n     style="image-rendering:optimizeQuality"\n     preserveAspectRatio="none"\n     height="13.76"\n     width="13.76" />\n</svg>\n';class e_{constructor(e){this.attributes=e;const t=navigator.userAgent.toLowerCase(),n=t.indexOf("android")>-1,i=Rb.isIOS();this.iosSoftkeyboardOpened=!1,this.iosMeasureUnit=-1===t.indexOf("crios")?"%":"vh",this.iosDivHeight="100%"+this.iosMeasureUnit;const o=window.outerWidth,r=window.outerHeight,s=o>r,a=o<r,l=s&&this.attributes.height>r,c=a&&this.attributes.width>o,d=l||c;this.instanceId=document.getElementsByClassName("wrs_modal_dialogContainer").length,this.deviceProperties={orientation:s?"landscape":"portait",isAndroid:n,isIOS:i,isMobile:d,isDesktop:!d&&!i&&!n},this.properties={created:!1,state:"",previousState:"",position:{bottom:0,right:10},size:{height:338,width:580}},this.websiteBeforeLockParameters=null;let u={class:"wrs_modal_overlay"};u.id=this.getElementId(u.class),this.overlay=Sb.createElement("div",u),u={},u.class="wrs_modal_title_bar",u.id=this.getElementId(u.class),this.titleBar=Sb.createElement("div",u),u={},u.class="wrs_modal_title",u.id=this.getElementId(u.class),this.title=Sb.createElement("div",u),this.title.innerHTML="",u={},u.class="wrs_modal_close_button",u.id=this.getElementId(u.class),u.title=Pb.get("close"),u.style={},this.closeDiv=Sb.createElement("a",u),this.closeDiv.setAttribute("role","button");let h=`background-size: 10px; background-image: url(data:image/svg+xml;base64,${window.btoa('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n   xmlns:dc="http://purl.org/dc/elements/1.1/"\n   xmlns:cc="http://creativecommons.org/ns#"\n   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n   xmlns:svg="http://www.w3.org/2000/svg"\n   xmlns="http://www.w3.org/2000/svg"\n   xmlns:xlink="http://www.w3.org/1999/xlink"\n   viewBox="0 0 13.76 13.76"\n   height="13.76"\n   width="13.76"\n   id="svg3783"\n   version="1.1">\n  <metadata\n     id="metadata3789">\n    <rdf:RDF>\n      <cc:Work\n         rdf:about="">\n        <dc:format>image/svg+xml</dc:format>\n        <dc:type\n           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n        <dc:title></dc:title>\n      </cc:Work>\n    </rdf:RDF>\n  </metadata>\n  <defs\n     id="defs3787" />\n  <image\n     y="0"\n     x="0"\n     id="image3791"\n     xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAYAAADhXXHAAAAACXBIWXMAAC4jAAAuIwF4pT92AAAB\nvklEQVRYw83Z23GDMBAF0AsNhBIowSVQgjuISnAJKSEdZNOBS6CDOBUkqSC4gs2PyGhAQg92se4M\n4w8bccYW2hVumBmRdAB6ADfopQcw2SOYNoIkAL8APgB8AzgLI0/2S/iy1xkt3B9m9h0dM9/YHxM4\nJ/c4MfPkGX+y763OyYVKgUPQTXAJdC84Bg2CS6Gl4FSoF7wHmgvOhbrgzsW+8L4YJegccrEj749R\ngs7ZXGdz8wbAeNbREcDTzrHvblEgBbAUFACuy6JALJeL0E/P9sbvmBnNojcgAM+oJ58AhrlnWM5Z\nA+C9RmiokakBvIJuNTLSc7hojqY0Mo8EB6Ep2CPBm9BU7BHgKDQHqwlOguZiNcDJ0JLe4FV4iaLY\nJjF16dLqnoob+EdDs8A1QJPBtUCTwDVBo+DaoJvgNvBIR6rDl9wirbA1QIPgVgl6VwHb+dAr7Jkk\nS/Pg3mCkVOslxxV9yBFqSqTA/3N2Utkzye3pftw5OxzQ5tHeddcdzGj3o4VgClUwowgtAVOs3BpF\naA6YUnsDowhNAVNu12UUoVtgCn2+ifxp1wO42Ner4KPR5dJ2tsse2ZLvTQxbVf4AmC2z7WnSvpIA\nAAAASUVORK5CYII=\n"\n     style="image-rendering:optimizeQuality"\n     preserveAspectRatio="none"\n     height="13.76"\n     width="13.76" />\n</svg>\n')})`,m=`background-size: 10px; background-image: url(data:image/svg+xml;base64,${window.btoa('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n   xmlns:dc="http://purl.org/dc/elements/1.1/"\n   xmlns:cc="http://creativecommons.org/ns#"\n   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n   xmlns:svg="http://www.w3.org/2000/svg"\n   xmlns="http://www.w3.org/2000/svg"\n   xmlns:xlink="http://www.w3.org/1999/xlink"\n   viewBox="0 0 13.76 13.76"\n   height="13.76"\n   width="13.76"\n   id="svg2"\n   version="1.1">\n  <metadata\n     id="metadata8">\n    <rdf:RDF>\n      <cc:Work\n         rdf:about="">\n        <dc:format>image/svg+xml</dc:format>\n        <dc:type\n           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n        <dc:title></dc:title>\n      </cc:Work>\n    </rdf:RDF>\n  </metadata>\n  <defs\n     id="defs6" />\n  <image\n     y="0"\n     x="0"\n     id="image10"\n     xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAYAAADhXXHAAAAACXBIWXMAAC4jAAAuIwF4pT92AAAB\n2ElEQVRYw9XZoXPCMBTH8S+5KfDzQ29606CH3/SmQTO96aGHHn/F0Himh8eDZSblQknSJH2F0DtE\nQw8+12vyfulr7XY7LuW4qvj+DugD18AC+AE2woa+/mz07y9cF7Y8d7YPDEtjK2AsCB4BvdLYHPi0\nXawioAA3wAfQaQiKHhuFYl1QSbAL6gWrSKgEuArqBKsEaB1wKNQKVsasHybcpRhwLNQED0zsoMbz\nFwJOhWL6Cmzd2e0D14Wi1/k9di2wFNnAEtBifd9jv4GtIPgaeBOCAkzLFayr/6idWSSY6DJ8sHT9\n6VK6zRFqKwo5gQ+grnKbA/gI6gsy5wRboT7sucBOaBX21GAvNAR7KnAlNBTbNDgIGoMtwO/C0Gko\nNBZbN525tk+dJrAj4F4YGxXgVQS019DkCgarM0OjwCoDaDBYZQINAquMoJVglRnUC1YZQp1g1RB0\nJryn65jYJ0HoRGPHguDX8hsZ6VAiGX4eUrJBbHqSArdN7LLBmCcBnpvYWfHWo6E8Wge8Ar7Kj8E4\nARwcnBPBB20BE7uJBMdAU8BH/YvyBAsFp0BjwNZGi201qALXgYaAnR0hX2upAzwDj/p8raFL5I4u\n8ALc6vNfvc+ztq5al9Rh/AfwZZ/LmlMllAAAAABJRU5ErkJggg==\n"\n     style="image-rendering:optimizeQuality"\n     preserveAspectRatio="none"\n     height="13.76"\n     width="13.76" />\n</svg>\n')})`;this.closeDiv.setAttribute("style",h),this.closeDiv.setAttribute("onmouseover",`this.style = "${m}";`),this.closeDiv.setAttribute("onmouseout",`this.style = "${h}";`),u={},u.class="wrs_modal_stack_button",u.id=this.getElementId(u.class),u.title=Pb.get("exit_fullscreen"),this.stackDiv=Sb.createElement("a",u),this.stackDiv.setAttribute("role","button"),h=`background-size: 10px; background-image: url(data:image/svg+xml;base64,${window.btoa('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n   xmlns:dc="http://purl.org/dc/elements/1.1/"\n   xmlns:cc="http://creativecommons.org/ns#"\n   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n   xmlns:svg="http://www.w3.org/2000/svg"\n   xmlns="http://www.w3.org/2000/svg"\n   xmlns:xlink="http://www.w3.org/1999/xlink"\n   viewBox="0 0 13.76 13.76"\n   height="13.76"\n   width="13.76"\n   id="svg3823"\n   version="1.1">\n  <metadata\n     id="metadata3829">\n    <rdf:RDF>\n      <cc:Work\n         rdf:about="">\n        <dc:format>image/svg+xml</dc:format>\n        <dc:type\n           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n        <dc:title></dc:title>\n      </cc:Work>\n    </rdf:RDF>\n  </metadata>\n  <defs\n     id="defs3827" />\n  <image\n     y="0"\n     x="0"\n     id="image3831"\n     xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAYAAADhXXHAAAAAAXNSR0IArs4c6QAAAARnQU1BAACx\njwv8YQUAAAAJcEhZcwAALiMAAC4jAXilP3YAAAHOSURBVFhH1ZiLUcMwEEQNDcQl0AEuISVABZhO\nUkroICVAB6ECoINQgdmVfR5FlmQrkZzjzezEzsc8NPqcdNd1XfVfuB9ec3NAmv4yiRo5ImzBlm+c\nwZYtEHJCGsT3eSgHxKZFxs/tL+aMkCK8R3yMwu4PcsVmiXBIVDDCvh/miEtMeE5UaEsNMJcN8o64\ng26PvPSXs9S+/zRHQtgtvLRFCb9blZpnYw/9Rb6RR3M3zxtiprFbyKYwipK1+uwlnIkSrbITUaJR\n1itKtMkGRYk2WRZAQbTNBpzWtggrrwnaWja00hk0DrCgsEZZ4hXWKksmwjLAHobkgOv+V3+ZhXHQ\niWxKqXYLKNyILDdqbPKlldASPhA+Mxc7uwatkSOSix1iP//q2APshLBvfJo7hbizgQj/mDtl+KYu\nCj8h7NSqCM2zXJvZwqqEY4uCOuGYLKEwJ3kVzMlyscg5915FTFbdqhaSVbn8+mTV1gmurOqCxpZN\nEeUu9BlZd1obioTkQ7IhPGTjYZuPIoUMK/GUFrX39asuHJTlH3w1d3FCBxCrCUufZX+NCUdPSsAq\nwu4A8wnPiQrFhW1Z4govFRWKCoeOjzjoZF92CdwpZy6AquoPvJRHJxB8bJ8AAAAASUVORK5CYII=\n"\n     style="image-rendering:optimizeQuality"\n     preserveAspectRatio="none"\n     height="13.76"\n     width="13.76" />\n</svg>\n')})`,m=`background-size: 10px; background-image: url(data:image/svg+xml;base64,${window.btoa('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n   xmlns:dc="http://purl.org/dc/elements/1.1/"\n   xmlns:cc="http://creativecommons.org/ns#"\n   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n   xmlns:svg="http://www.w3.org/2000/svg"\n   xmlns="http://www.w3.org/2000/svg"\n   xmlns:xlink="http://www.w3.org/1999/xlink"\n   viewBox="0 0 13.76 13.76"\n   height="13.76"\n   width="13.76"\n   id="svg42"\n   version="1.1">\n  <metadata\n     id="metadata48">\n    <rdf:RDF>\n      <cc:Work\n         rdf:about="">\n        <dc:format>image/svg+xml</dc:format>\n        <dc:type\n           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n        <dc:title></dc:title>\n      </cc:Work>\n    </rdf:RDF>\n  </metadata>\n  <defs\n     id="defs46" />\n  <image\n     y="0"\n     x="0"\n     id="image50"\n     xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAYAAADhXXHAAAAAAXNSR0IArs4c6QAAAARnQU1BAACx\njwv8YQUAAAAJcEhZcwAALiMAAC4jAXilP3YAAAG/SURBVFhH1ZgxUsMwEEUNJRyAGmp6qKGn5xRQ\nQ08NNfRQQw11DpAaanIAWrMv8WaELSlexhLLm/mRnImiF48jr7zVtm3zX9ju2ik5llxLdpdHNg4k\nT5I7yWB8Cdl9yZHkRmIRRpQxOxK+YzC+hKwSnTBBKKoMxpeUBSbkksgRE1V+CJeWhUPJ5ao7ICeq\nrIVryMKJpC88RlTZk1SThVDYIvoluZIsSqyz511SfEg4UxbRdw5qnlmFa9AsCn8hO4aBKHiUjYqC\nN9mkKHiSzYqCJ9lPSVIUPMmySqTudEu8XbOxO90ab7KQFPYoC1Fhr7IwENbagMLCUtXnoCTM1QZW\n3iS3dFT2mRfHvEjuVfZUckFnQh67dgqo1GYqC1MLn3XtZIR/sFcJW2C39FcD18KxpcutcGqddSmc\nuykg/LDq+iAnC/OudUFOVrfLbkjJWvb11YjJuhSFvqxbUQhlXYuCylpE2YXy2SkLlVEgaxVluzyT\nIEutWQ1kKZYtouF2maK4mjCyFN6bJsw9gKgmrNdsbsKNT0qEKsIqC7EJx4gqxYVDWQgntIgqRYXD\nbY3CLpcVgmdPC974BYy3/MgRNM03hR9ubFTHT48AAAAASUVORK5CYII=\n"\n     style="image-rendering:optimizeQuality"\n     preserveAspectRatio="none"\n     height="13.76"\n     width="13.76" />\n</svg>\n')})`,this.stackDiv.setAttribute("style",h),this.stackDiv.setAttribute("onmouseover",`this.style = "${m}";`),this.stackDiv.setAttribute("onmouseout",`this.style = "${h}";`),u={},u.class="wrs_modal_maximize_button",u.id=this.getElementId(u.class),u.title=Pb.get("fullscreen"),this.maximizeDiv=Sb.createElement("a",u),this.maximizeDiv.setAttribute("role","button"),h=`background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n   xmlns:dc="http://purl.org/dc/elements/1.1/"\n   xmlns:cc="http://creativecommons.org/ns#"\n   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n   xmlns:svg="http://www.w3.org/2000/svg"\n   xmlns="http://www.w3.org/2000/svg"\n   xmlns:xlink="http://www.w3.org/1999/xlink"\n   viewBox="0 0 13.76 13.76"\n   height="13.76"\n   width="13.76"\n   id="svg3793"\n   version="1.1">\n  <metadata\n     id="metadata3799">\n    <rdf:RDF>\n      <cc:Work\n         rdf:about="">\n        <dc:format>image/svg+xml</dc:format>\n        <dc:type\n           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n        <dc:title></dc:title>\n      </cc:Work>\n    </rdf:RDF>\n  </metadata>\n  <defs\n     id="defs3797" />\n  <image\n     y="0"\n     x="0"\n     id="image3801"\n     xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAYAAADhXXHAAAAAAXNSR0IArs4c6QAAAARnQU1BAACx\njwv8YQUAAAAJcEhZcwAALiMAAC4jAXilP3YAAAG4SURBVFhHvZnhUYNAEEbRBkwH2oGUkA40FWgJ\nKSEdaAmxA0vQDmIHKSFWgPuAHZkEAnd8y5v5kuNHMm+WY1mSm6qqCiGlZdUspXzxopY9Wu6bpZQf\nSxlRWapwVx9p2dy2CxUHy9ryWx9pKdWyECYcIQshwlGyIBeOlAWpcLQsyISXkAWEX5tlPkvJwnP7\nns1SsnvLS7PMZwlZiShEy8pEIVJWKgpRsnJRiJBNFf2wbCzjfZgRUZi9JYWDxT9bWk6WIXbKym4t\nKRVloObO5oze6ZClWX9a5jyOcOrfmuUkXPRUH/1zVRhZpvsnCxN+jnDqHh0SdQaFu9vg0ZIqrBZ1\neoXP92yKcJSocyHcd4FNEY4WdbrCR1rGrukMF9BWVhZvLZ7U9rS2nH9HVvoq63iFu+RUlOpIuCYL\nCCPIqVjq1A9j5R3aBnMY2kKzMlbZHPQVbVHLhomCUjZUFFSy35ZQUVDIMo+Gi4JCltFwERSy75Y5\n4+VkFLLcKHLHyyRUF1jOeJmMShbChZWy0Df8yFDLgg8/cpCN6I9cdHJhZHmy7X2anAnCtDUZ/j/Y\ng2X2j709MHhTDAFF8QdK9SRpUl2yFgAAAABJRU5ErkJggg==\n"\n     style="image-rendering:optimizeQuality"\n     preserveAspectRatio="none"\n     height="13.76"\n     width="13.76" />\n</svg>\n')})`,m=`background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n   xmlns:dc="http://purl.org/dc/elements/1.1/"\n   xmlns:cc="http://creativecommons.org/ns#"\n   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n   xmlns:svg="http://www.w3.org/2000/svg"\n   xmlns="http://www.w3.org/2000/svg"\n   xmlns:xlink="http://www.w3.org/1999/xlink"\n   viewBox="0 0 13.76 13.76"\n   height="13.76"\n   width="13.76"\n   id="svg12"\n   version="1.1">\n  <metadata\n     id="metadata18">\n    <rdf:RDF>\n      <cc:Work\n         rdf:about="">\n        <dc:format>image/svg+xml</dc:format>\n        <dc:type\n           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n        <dc:title></dc:title>\n      </cc:Work>\n    </rdf:RDF>\n  </metadata>\n  <defs\n     id="defs16" />\n  <image\n     y="0"\n     x="0"\n     id="image20"\n     xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAYAAADhXXHAAAAAAXNSR0IArs4c6QAAAARnQU1BAACx\njwv8YQUAAAAJcEhZcwAALiMAAC4jAXilP3YAAAGMSURBVFhHvdk7TsNAFIVhQ0l6elLDJqCGngXQ\nU7MA6rALahZATQ81C6APrXP/jEaKHD/i8TnzS1eaICF/2I4f4qxt20bYOmaVlrK2Mb8s1Nj3mIu0\nlPYZszlPa1kvMf9pKe02Zq3Gcrhc4JUaSzawA0sWsAtLcrATS1KwG0sycA0sAd6kZXm1sNzVHtOy\nvBpYoK8xV/tPC3JjZVByYqVQcmHlUHJgLVBSY0ugPP7xO5PXYSW2FMr19ytm8sahxD7ElEBzk3c6\nsFysn/afymKPvsXMueh3oblRMNibmPuYZ34wsyWHfqhB8OFpwKvDHLADmusFd8/ZU8FOaO4I3PcF\nmwLXgOYOwVtexdnwdUy3vg2UQPnD2eji+vZsrruHS/eoBEpjWMpgrhi1Dv1gY6fBkuRQmtqzJVmg\npMbaoKTEWqGkwtqhpMBWgZICWwVKCuwpzxKSFNi5T2vFqb5gVcAqLNnBSixZwWos2cBg/9JSmgUM\n9iMt5QFe8tZ8VP6n3WXMHQtxPzHfabm0ptkBwWhpthzMp7YAAAAASUVORK5CYII=\n"\n     style="image-rendering:optimizeQuality"\n     preserveAspectRatio="none"\n     height="13.76"\n     width="13.76" />\n</svg>\n')})`,this.maximizeDiv.setAttribute("style",h),this.maximizeDiv.setAttribute("onmouseover",`this.style = "${m}";`),this.maximizeDiv.setAttribute("onmouseout",`this.style = "${h}";`),u={},u.class="wrs_modal_minimize_button",u.id=this.getElementId(u.class),u.title=Pb.get("minimize"),this.minimizeDiv=Sb.createElement("a",u),this.minimizeDiv.setAttribute("role","button"),h=`background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa(Qb)})`,m=`background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa(Zb)})`,this.minimizeDiv.setAttribute("style",h),this.minimizeDiv.setAttribute("onmouseover",`this.style = "${m}";`),this.minimizeDiv.setAttribute("onmouseout",`this.style = "${h}";`),u={},u.class="wrs_modal_dialogContainer",u.id=this.getElementId(u.class),u.role="dialog",this.container=Sb.createElement("div",u),this.container.setAttribute("aria-labeledby","wrs_modal_title[0]"),u={},u.class="wrs_modal_wrapper",u.id=this.getElementId(u.class),this.wrapper=Sb.createElement("div",u),u={},u.class="wrs_content_container",u.id=this.getElementId(u.class),this.contentContainer=Sb.createElement("div",u),u={},u.class="wrs_modal_controls",u.id=this.getElementId(u.class),this.controls=Sb.createElement("div",u),u={},u.class="wrs_modal_buttons_container",u.id=this.getElementId(u.class),this.buttonContainer=Sb.createElement("div",u),this.submitButton=this.createSubmitButton({id:this.getElementId("wrs_modal_button_accept"),class:"wrs_modal_button_accept",innerHTML:Pb.get("accept")},this.submitAction.bind(this)),this.cancelButton=this.createSubmitButton({id:this.getElementId("wrs_modal_button_cancel"),class:"wrs_modal_button_cancel",innerHTML:Pb.get("cancel")},this.cancelAction.bind(this)),this.contentManager=null;const g={cancelString:Pb.get("cancel"),submitString:Pb.get("close"),message:Pb.get("close_modal_warning")},p={closeCallback:()=>{this.close()},cancelCallback:()=>{this.focus()}},f={overlayElement:this.container,callbacks:p,strings:g};this.popup=new Vb(f),this.rtl=!1,"rtl"in this.attributes&&(this.rtl=this.attributes.rtl),this.handleOpenedIosSoftkeyboard=this.handleOpenedIosSoftkeyboard.bind(this),this.handleClosedIosSoftkeyboard=this.handleClosedIosSoftkeyboard.bind(this)}setContentManager(e){this.contentManager=e}getContentManager(){return this.contentManager}submitAction(){void 0!==this.contentManager.submitAction&&this.contentManager.submitAction(),this.close()}cancelAction(){void 0===this.contentManager.hasChanges?this.close():this.contentManager.hasChanges()?this.showPopUpMessage():this.close()}createSubmitButton(e,t){return new class{constructor(){this.element=document.createElement("button"),this.element.id=e.id,this.element.className=e.class,this.element.innerHTML=e.innerHTML,Sb.addEvent(this.element,"click",t)}getElement(){return this.element}}(e,t).getElement()}create(){this.titleBar.appendChild(this.closeDiv),this.titleBar.appendChild(this.stackDiv),this.titleBar.appendChild(this.maximizeDiv),this.titleBar.appendChild(this.minimizeDiv),this.titleBar.appendChild(this.title),this.deviceProperties.isDesktop&&this.container.appendChild(this.titleBar),this.wrapper.appendChild(this.contentContainer),this.wrapper.appendChild(this.controls),this.controls.appendChild(this.buttonContainer),this.buttonContainer.appendChild(this.submitButton),this.buttonContainer.appendChild(this.cancelButton),this.container.appendChild(this.wrapper),this.recalculateScrollBar(),document.body.appendChild(this.container),document.body.appendChild(this.overlay),this.deviceProperties.isDesktop?(this.createModalWindowDesktop(),this.createResizeButtons(),this.addListeners(),xb.get("modalWindowFullScreen")&&this.maximize()):this.deviceProperties.isAndroid?this.createModalWindowAndroid():this.deviceProperties.isIOS&&this.createModalWindowIos(),null!=this.contentManager&&this.contentManager.insert(this),this.properties.open=!0,this.properties.created=!0,this.isRTL()&&(this.container.style.right=window.innerWidth-this.scrollbarWidth-this.container.offsetWidth+"px",this.container.className+=" wrs_modal_rtl")}createResizeButtons(){this.resizerBR=document.createElement("div"),this.resizerBR.className="wrs_bottom_right_resizer",this.resizerBR.innerHTML="◢",this.resizerTL=document.createElement("div"),this.resizerTL.className="wrs_bottom_left_resizer",this.container.appendChild(this.resizerBR),this.titleBar.appendChild(this.resizerTL),Sb.addEvent(this.resizerBR,"mousedown",this.activateResizeStateBR.bind(this)),Sb.addEvent(this.resizerTL,"mousedown",this.activateResizeStateTL.bind(this))}activateResizeStateBR(e){this.initializeResizeProperties(e,!1)}activateResizeStateTL(e){this.initializeResizeProperties(e,!0)}initializeResizeProperties(e,t){Sb.addClass(document.body,"wrs_noselect"),Sb.addClass(this.overlay,"wrs_overlay_active"),this.resizeDataObject={x:this.eventClient(e).X,y:this.eventClient(e).Y},this.initialWidth=parseInt(this.container.style.width,10),this.initialHeight=parseInt(this.container.style.height,10),t?this.leftScale=!0:(this.initialRight=parseInt(this.container.style.right,10),this.initialBottom=parseInt(this.container.style.bottom,10)),this.initialRight||(this.initialRight=0),this.initialBottom||(this.initialBottom=0),document.body.style["user-select"]="none"}open(){try{Kb.send([{timestamp:(new Date).toJSON(),topic:"0",level:"info",message:"HELO telemetry.wiris.net"}]).then(e=>{})}catch(e){}this.removeClass("wrs_closed");const{isIOS:e}=this.deviceProperties,{isAndroid:t}=this.deviceProperties,{isMobile:n}=this.deviceProperties;if((e||t||n)&&(this.restoreWebsiteScale(),this.lockWebsiteScroll(),setTimeout(()=>{this.hideKeyboard()},400)),this.properties.created?(this.properties.open||(this.properties.open=!0,this.deviceProperties.isAndroid||this.deviceProperties.isIOS||this.restoreState()),this.deviceProperties.isDesktop&&xb.get("modalWindowFullScreen")&&this.maximize(),this.deviceProperties.isIOS&&(this.iosSoftkeyboardOpened=!1,this.setContainerHeight(""+(100+this.iosMeasureUnit)))):this.create(),Rb.isEditorLoaded())this.contentManager.onOpen(this);else{const e=Cb.newListener("onLoad",()=>{this.contentManager.onOpen(this)});this.contentManager.addListener(e)}}close(){i_.setTemporalImageToNull(),this.removeClass("wrs_maximized"),this.removeClass("wrs_minimized"),this.removeClass("wrs_stack"),this.addClass("wrs_closed"),this.saveModalProperties(),this.unlockWebsiteScroll(),this.properties.open=!1}restoreWebsiteScale(){let e=document.querySelector("meta[name=viewport]");const t=["initial-scale=","minimum-scale=","maximum-scale="],n=["1.0","1.0","1.0"],i=(e,t)=>{const i=e.getAttribute("content");if(i){const o=i.split(",");let r="";const s=[];for(let e=0;e<o.length;e+=1){let n=!1,i=0;for(;!n&&i<t.length;)o[e].indexOf(t[i])&&(n=!0),i+=1;n||s.push(o[e])}for(let e=0;e<t.length;e+=1){const i=t[e]+n[e];r+=0===e?i:","+i}for(let e=0;e<s.length;e+=1)r+=","+s[e];e.setAttribute("content",r),e.setAttribute("content",""),e.setAttribute("content",i)}else e.setAttribute("content","initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"),e.removeAttribute("content")};e?i(e,t):(e=document.createElement("meta"),document.getElementsByTagName("head")[0].appendChild(e),i(e,t),e.remove())}lockWebsiteScroll(){this.websiteBeforeLockParameters={bodyStylePosition:document.body.style.position?document.body.style.position:"",bodyStyleOverflow:document.body.style.overflow?document.body.style.overflow:"",htmlStyleOverflow:document.documentElement.style.overflow?document.documentElement.style.overflow:"",windowScrollX:window.scrollX,windowScrollY:window.scrollY}}unlockWebsiteScroll(){if(this.websiteBeforeLockParameters){document.body.style.position=this.websiteBeforeLockParameters.bodyStylePosition,document.body.style.overflow=this.websiteBeforeLockParameters.bodyStyleOverflow,document.documentElement.style.overflow=this.websiteBeforeLockParameters.htmlStyleOverflow;const{windowScrollX:e}=this.websiteBeforeLockParameters,{windowScrollY:t}=this.websiteBeforeLockParameters;window.scrollTo(e,t),this.websiteBeforeLockParameters=null}}isIE11(){return navigator.userAgent.search("Msie/")>=0||navigator.userAgent.search("Trident/")>=0||navigator.userAgent.search("Edge/")>=0}isRTL(){return"ar"===this.attributes.language||"he"===this.attributes.language||this.rtl}addClass(e){Sb.addClass(this.overlay,e),Sb.addClass(this.titleBar,e),Sb.addClass(this.overlay,e),Sb.addClass(this.container,e),Sb.addClass(this.contentContainer,e),Sb.addClass(this.stackDiv,e),Sb.addClass(this.minimizeDiv,e),Sb.addClass(this.maximizeDiv,e),Sb.addClass(this.wrapper,e)}removeClass(e){Sb.removeClass(this.overlay,e),Sb.removeClass(this.titleBar,e),Sb.removeClass(this.overlay,e),Sb.removeClass(this.container,e),Sb.removeClass(this.contentContainer,e),Sb.removeClass(this.stackDiv,e),Sb.removeClass(this.minimizeDiv,e),Sb.removeClass(this.maximizeDiv,e),Sb.removeClass(this.wrapper,e)}createModalWindowDesktop(){this.addClass("wrs_modal_desktop"),this.stack()}createModalWindowAndroid(){this.addClass("wrs_modal_android"),window.addEventListener("resize",this.orientationChangeAndroidSoftkeyboard.bind(this))}createModalWindowIos(){this.addClass("wrs_modal_ios"),window.addEventListener("resize",this.orientationChangeIosSoftkeyboard.bind(this))}restoreState(){"maximized"===this.properties.state?this.maximize():"minimized"===this.properties.state?(this.properties.state=this.properties.previousState,this.properties.previousState="",this.minimize()):this.stack()}stack(){this.properties.previousState=this.properties.state,this.properties.state="stack",this.removeClass("wrs_maximized"),this.minimizeDiv.title=Pb.get("minimize"),this.removeClass("wrs_minimized"),this.addClass("wrs_stack");const e=`background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa(Qb)})`,t=`background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa(Zb)})`;this.minimizeDiv.setAttribute("style",e),this.minimizeDiv.setAttribute("onmouseover",`this.style = "${t}";`),this.minimizeDiv.setAttribute("onmouseout",`this.style = "${e}";`),this.restoreModalProperties(),void 0!==this.resizerBR&&void 0!==this.resizerTL&&this.setResizeButtonsVisibility(),this.recalculateScrollBar(),this.recalculatePosition(),this.recalculateScale(),this.focus()}minimize(){if(this.saveModalProperties(),this.title.style.cursor="pointer","minimized"===this.properties.state&&"stack"===this.properties.previousState)this.stack();else if("minimized"===this.properties.state&&"maximized"===this.properties.previousState)this.maximize();else{this.container.style.height="30px",this.container.style.width="250px",this.container.style.bottom="0px",this.container.style.right="10px",this.removeListeners(),this.properties.previousState=this.properties.state,this.properties.state="minimized",this.setResizeButtonsVisibility(),this.minimizeDiv.title=Pb.get("maximize"),Sb.containsClass(this.overlay,"wrs_stack")?this.removeClass("wrs_stack"):this.removeClass("wrs_maximized"),this.addClass("wrs_minimized");const e=`background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n   xmlns:dc="http://purl.org/dc/elements/1.1/"\n   xmlns:cc="http://creativecommons.org/ns#"\n   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n   xmlns:svg="http://www.w3.org/2000/svg"\n   xmlns="http://www.w3.org/2000/svg"\n   xmlns:xlink="http://www.w3.org/1999/xlink"\n   viewBox="0 0 13.44 13.76"\n   height="13.76"\n   width="13.44"\n   id="svg3803"\n   version="1.1">\n  <metadata\n     id="metadata3809">\n    <rdf:RDF>\n      <cc:Work\n         rdf:about="">\n        <dc:format>image/svg+xml</dc:format>\n        <dc:type\n           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n        <dc:title></dc:title>\n      </cc:Work>\n    </rdf:RDF>\n  </metadata>\n  <defs\n     id="defs3807" />\n  <image\n     y="0"\n     x="0"\n     id="image3811"\n     xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAArCAYAAAAOnxr+AAAACXBIWXMAAC4jAAAuIwF4pT92AAAA\nvElEQVRYw+3ZSw0CMRSF4b8T9iAFB4wDkDAWcICEkTA4GAeAA3AADurgsCkbAgsSMrmFczZNd1/a\n3vSVJFFDGipJNdBZaRdAB2wC2TIwAgNAkrQEjsA86GBegDZJGoF18JnfJtVR9idXvaGGGmrod/b6\nV9kD14k9LbD6FDqUM8CU2b2Deo0aaqihhhpqqKGGGhr1hH/wiP469FaBMzflEhc9PZKQ1CtmsqRO\nEunpHbeNNN3A+dFJ/mf6V+gduGPIoUgKLbAAAAAASUVORK5CYII=\n"\n     style="image-rendering:optimizeQuality"\n     preserveAspectRatio="none"\n     height="13.76"\n     width="13.44" />\n</svg>\n')})`,t=`background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n   xmlns:dc="http://purl.org/dc/elements/1.1/"\n   xmlns:cc="http://creativecommons.org/ns#"\n   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n   xmlns:svg="http://www.w3.org/2000/svg"\n   xmlns="http://www.w3.org/2000/svg"\n   xmlns:xlink="http://www.w3.org/1999/xlink"\n   viewBox="0 0 13.44 13.76"\n   height="13.76"\n   width="13.44"\n   id="svg22"\n   version="1.1">\n  <metadata\n     id="metadata28">\n    <rdf:RDF>\n      <cc:Work\n         rdf:about="">\n        <dc:format>image/svg+xml</dc:format>\n        <dc:type\n           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n        <dc:title></dc:title>\n      </cc:Work>\n    </rdf:RDF>\n  </metadata>\n  <defs\n     id="defs26" />\n  <image\n     y="0"\n     x="0"\n     id="image30"\n     xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAArCAYAAAAOnxr+AAAACXBIWXMAAC4jAAAuIwF4pT92AAAA\nvUlEQVRYw+3ZsQ3CMBCF4d8WFekZgBqWIDUDZACmYBQWYIn0pGYAegZIexROERHRIBTdhXeVy08+\nyT4/JzMjQmWCVBjoarSugK0z3/0degKODjeyBy5Am8ysARrnnT8nM7sCa+fQLgdAAlQ6ngQVVFBB\nfzeUTK6t8VAwU328ztV6QQUVVFBBBRVUUEG9Ds41sJvZs/8GelDrlw7tAjhvmZLo9o6RD4bEGUp+\nX1My/I0T4HN4rrcASf9M/wp9ASNzIKYYz2hAAAAAAElFTkSuQmCC\n"\n     style="image-rendering:optimizeQuality"\n     preserveAspectRatio="none"\n     height="13.76"\n     width="13.44" />\n</svg>\n')})`;this.minimizeDiv.setAttribute("style",e),this.minimizeDiv.setAttribute("onmouseover",`this.style = "${t}";`),this.minimizeDiv.setAttribute("onmouseout",`this.style = "${e}";`)}}maximize(){this.saveModalProperties(),"maximized"!==this.properties.state&&(this.properties.previousState=this.properties.state,this.properties.state="maximized"),this.setResizeButtonsVisibility(),Sb.containsClass(this.overlay,"wrs_minimized")?(this.minimizeDiv.title=Pb.get("minimize"),this.removeClass("wrs_minimized")):Sb.containsClass(this.overlay,"wrs_stack")&&(this.container.style.left=null,this.container.style.top=null,this.removeClass("wrs_stack")),this.addClass("wrs_maximized");const e=`background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa(Qb)})`,t=`background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa(Zb)})`;this.minimizeDiv.setAttribute("style",e),this.minimizeDiv.setAttribute("onmouseover",`this.style = "${t}";`),this.minimizeDiv.setAttribute("onmouseout",`this.style = "${e}";`),this.setSize(parseInt(.8*window.innerHeight,10),parseInt(.8*window.innerWidth,10)),this.container.clientHeight>700&&(this.container.style.height="700px"),this.container.clientWidth>1200&&(this.container.style.width="1200px");const{innerHeight:n}=window,{innerWidth:i}=window,{offsetHeight:o}=this.container,{offsetWidth:r}=this.container,s=n/2-o/2,a=i/2-r/2;this.setPosition(s,a),this.recalculateScale(),this.recalculatePosition(),this.recalculateSize(),this.focus()}reExpand(){"minimized"===this.properties.state&&("maximized"===this.properties.previousState?this.maximize():this.stack(),this.title.style.cursor="")}setSize(e,t){this.container.style.height=e+"px",this.container.style.width=t+"px",this.recalculateSize()}setPosition(e,t){this.container.style.bottom=e+"px",this.container.style.right=t+"px"}saveModalProperties(){"stack"===this.properties.state&&(this.properties.position.bottom=parseInt(this.container.style.bottom,10),this.properties.position.right=parseInt(this.container.style.right,10),this.properties.size.width=parseInt(this.container.style.width,10),this.properties.size.height=parseInt(this.container.style.height,10))}restoreModalProperties(){"stack"===this.properties.state&&(this.setPosition(this.properties.position.bottom,this.properties.position.right),this.setSize(this.properties.size.height,this.properties.size.width))}recalculateSize(){this.wrapper.style.width=this.container.clientWidth-12+"px",this.wrapper.style.height=this.container.clientHeight-38+"px",this.contentContainer.style.height=parseInt(this.wrapper.offsetHeight-50,10)+"px"}setResizeButtonsVisibility(){"stack"===this.properties.state?(this.resizerTL.style.visibility="visible",this.resizerBR.style.visibility="visible"):(this.resizerTL.style.visibility="hidden",this.resizerBR.style.visibility="hidden")}addListeners(){this.maximizeDiv.addEventListener("click",this.maximize.bind(this),!0),this.stackDiv.addEventListener("click",this.stack.bind(this),!0),this.minimizeDiv.addEventListener("click",this.minimize.bind(this),!0),this.closeDiv.addEventListener("click",this.cancelAction.bind(this)),this.title.addEventListener("click",this.reExpand.bind(this)),this.overlay.addEventListener("click",this.cancelAction.bind(this)),Sb.addEvent(window,"mousedown",this.startDrag.bind(this)),Sb.addEvent(window,"mouseup",this.stopDrag.bind(this)),Sb.addEvent(window,"mousemove",this.drag.bind(this)),Sb.addEvent(window,"resize",this.onWindowResize.bind(this)),Sb.addEvent(this.container,"keydown",this.onKeyDown.bind(this))}removeListeners(){Sb.removeEvent(window,"mousedown",this.startDrag),Sb.removeEvent(window,"mouseup",this.stopDrag),Sb.removeEvent(window,"mousemove",this.drag),Sb.removeEvent(window,"resize",this.onWindowResize),Sb.removeEvent(this.container,"keydown",this.onKeyDown)}eventClient(e){if(void 0===e.clientX&&e.changedTouches){return{X:e.changedTouches[0].clientX,Y:e.changedTouches[0].clientY}}return{X:e.clientX,Y:e.clientY}}startDrag(e){"minimized"!==this.properties.state&&e.target===this.title&&(void 0!==this.dragDataObject&&null!==this.dragDataObject||(this.dragDataObject={x:this.eventClient(e).X,y:this.eventClient(e).Y},this.lastDrag={x:"0px",y:"0px"},""===this.container.style.right&&(this.container.style.right="0px"),""===this.container.style.bottom&&(this.container.style.bottom="0px"),this.isIE11(),Sb.addClass(document.body,"wrs_noselect"),Sb.addClass(this.overlay,"wrs_overlay_active"),this.limitWindow=this.getLimitWindow()))}drag(e){if(this.dragDataObject){e.preventDefault();let t=Math.min(this.eventClient(e).Y,this.limitWindow.minPointer.y);t=Math.max(this.limitWindow.maxPointer.y,t);let n=Math.min(this.eventClient(e).X,this.limitWindow.minPointer.x);n=Math.max(this.limitWindow.maxPointer.x,n);const i=n-this.dragDataObject.x+"px",o=t-this.dragDataObject.y+"px";this.lastDrag={x:i,y:o},this.container.style.transform=`translate3d(${i},${o},0)`}if(this.resizeDataObject){const{innerWidth:t}=window,{innerHeight:n}=window;let i,o=Math.min(this.eventClient(e).X,t-this.scrollbarWidth-7),r=Math.min(this.eventClient(e).Y,n-7);o<0&&(o=0),r<0&&(r=0),i=this.leftScale?-1:1,this.container.style.width=this.initialWidth+i*(o-this.resizeDataObject.x)+"px",this.container.style.height=this.initialHeight+i*(r-this.resizeDataObject.y)+"px",this.leftScale||(this.resizeDataObject.x-o-this.initialWidth<-580?this.container.style.right=this.initialRight-(o-this.resizeDataObject.x)+"px":(this.container.style.right=this.initialRight+this.initialWidth-580+"px",this.container.style.width="580px"),this.resizeDataObject.y-r<this.initialHeight-338?this.container.style.bottom=this.initialBottom-(r-this.resizeDataObject.y)+"px":(this.container.style.bottom=this.initialBottom+this.initialHeight-338+"px",this.container.style.height="338px")),this.recalculateScale(),this.recalculatePosition()}}getLimitWindow(){const e=window.innerWidth,t=window.innerHeight,{offsetHeight:n}=this.container,i=parseInt(this.container.style.bottom,10),o=parseInt(this.container.style.right,10),{pageXOffset:r}=window,s=this.dragDataObject.y,a=this.dragDataObject.x,l=n+i-(t-(s-r)),c=e-this.scrollbarWidth-(a-r)-o,d=t-this.container.offsetHeight+l,u=this.title.offsetHeight-(this.title.offsetHeight-l);return{minPointer:{x:e-c-this.scrollbarWidth,y:d},maxPointer:{x:this.container.offsetWidth-c,y:u}}}getScrollBarWidth(){const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),document.body.appendChild(t);const n=e.offsetWidth;t.style.overflow="scroll";let i=e.offsetWidth;return n===i&&(i=t.clientWidth),document.body.removeChild(t),n-i}stopDrag(){(this.dragDataObject||this.resizeDataObject)&&(this.container.style.transform="",this.dragDataObject&&(this.container.style.right=parseInt(this.container.style.right,10)-parseInt(this.lastDrag.x,10)+"px",this.container.style.bottom=parseInt(this.container.style.bottom,10)-parseInt(this.lastDrag.y,10)+"px"),this.focus(),document.body.style["user-select"]="",this.isIE11(),Sb.removeClass(document.body,"wrs_noselect"),Sb.removeClass(this.overlay,"wrs_overlay_active")),this.dragDataObject=null,this.resizeDataObject=null,this.initialWidth=null,this.leftScale=null}onWindowResize(){this.recalculateScrollBar(),this.recalculatePosition(),this.recalculateScale()}onKeyDown(e){void 0!==e.key&&("block"!==this.popup.overlayWrapper.style.display?"Escape"===e.key||"Esc"===e.key?this.properties.open&&this.contentManager.onKeyDown(e):e.shiftKey&&"Tab"===e.key?document.activeElement===this.cancelButton?(this.submitButton.focus(),e.stopPropagation(),e.preventDefault()):this.contentManager.onKeyDown(e):"Tab"===e.key&&(document.activeElement===this.submitButton?(this.cancelButton.focus(),e.stopPropagation(),e.preventDefault()):this.contentManager.onKeyDown(e)):this.popup.onKeyDown(e))}recalculatePosition(){this.container.style.right=Math.min(parseInt(this.container.style.right,10),window.innerWidth-this.scrollbarWidth-this.container.offsetWidth)+"px",parseInt(this.container.style.right,10)<0&&(this.container.style.right="0px"),this.container.style.bottom=Math.min(parseInt(this.container.style.bottom,10),window.innerHeight-this.container.offsetHeight)+"px",parseInt(this.container.style.bottom,10)<0&&(this.container.style.bottom="0px")}recalculateScale(){let e=!1;parseInt(this.container.style.width,10)>580?(this.container.style.width=Math.min(parseInt(this.container.style.width,10),window.innerWidth-this.scrollbarWidth)+"px",e=!0):(this.container.style.width="580px",e=!0),parseInt(this.container.style.height,10)>338?(this.container.style.height=Math.min(parseInt(this.container.style.height,10),window.innerHeight)+"px",e=!0):(this.container.style.height="338px",e=!0),e&&this.recalculateSize()}recalculateScrollBar(){this.hasScrollBar=window.innerWidth>document.documentElement.clientWidth,this.hasScrollBar?this.scrollbarWidth=this.getScrollBarWidth():this.scrollbarWidth=0}hideKeyboard(){const e=document.createElement("input");this.container.appendChild(e),e.focus(),e.blur(),e.remove()}focus(){null!=this.contentManager&&void 0!==this.contentManager.onFocus&&this.contentManager.onFocus()}portraitMode(){return window.innerHeight>window.innerWidth}handleOpenedIosSoftkeyboard(){this.iosSoftkeyboardOpened||null==this.iosDivHeight||this.iosDivHeight!=="100"+this.iosMeasureUnit||(this.portraitMode()?this.setContainerHeight("63"+this.iosMeasureUnit):this.setContainerHeight("40"+this.iosMeasureUnit)),this.iosSoftkeyboardOpened=!0}handleClosedIosSoftkeyboard(){this.iosSoftkeyboardOpened=!1,this.setContainerHeight("100"+this.iosMeasureUnit)}orientationChangeIosSoftkeyboard(){this.iosSoftkeyboardOpened?this.portraitMode()?this.setContainerHeight("63"+this.iosMeasureUnit):this.setContainerHeight("40"+this.iosMeasureUnit):this.setContainerHeight("100"+this.iosMeasureUnit)}orientationChangeAndroidSoftkeyboard(){this.setContainerHeight("100%")}setContainerHeight(e){this.iosDivHeight=e,this.wrapper.style.height=e}showPopUpMessage(){"minimized"===this.properties.state&&this.stack(),this.popup.show()}setTitle(e){this.title.innerHTML=e}getElementId(e){return`${e}[${this.instanceId}]`}}var t_;
  /*! http://mths.be/codepointat v0.1.0 by @mathias */String.prototype.codePointAt||(t_=function(e){if(null==this)throw TypeError();var t=String(this),n=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||i>=n)){var o,r=t.charCodeAt(i);return r>=55296&&r<=56319&&n>i+1&&(o=t.charCodeAt(i+1))>=56320&&o<=57343?1024*(r-55296)+o-56320+65536:r}},Object.defineProperty?Object.defineProperty(String.prototype,"codePointAt",{value:t_,configurable:!0,writable:!0}):String.prototype.codePointAt=t_),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),i=1;i<arguments.length;i++){var o=arguments[i];if(null!=o)for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])}return n},writable:!0,configurable:!0});n(103);class n_{constructor(e){this.language="en",this.editMode="images",this.modalDialog=null,this.customEditors=new Lb;if(this.customEditors.addEditor("chemistry",{name:"Chemistry",toolbar:"chemistry",icon:"chem.png",confVariable:"chemEnabled",title:"ChemType",tooltip:"Insert a chemistry formula - ChemType"}),this.environment={},this.editionProperties={},this.editionProperties.isNewElement=!0,this.editionProperties.temporalImage=null,this.editionProperties.latexRange=null,this.editionProperties.range=null,this.integrationModel=null,this.contentManager=null,this.browser=(()=>{const e=navigator.userAgent;let t="none";return e.search("Edge/")>=0?t="EDGE":e.search("Chrome/")>=0?t="CHROME":e.search("Trident/")>=0?t="IE":e.search("Firefox/")>=0?t="FIREFOX":e.search("Safari/")>=0&&(t="SAFARI"),t})(),this.listeners=new Cb,this.serviceProviderProperties={},!("serviceProviderProperties"in e))throw new Error("serviceProviderProperties property missing.");this.serviceProviderProperties=e.serviceProviderProperties}static get globalListeners(){return n_._globalListeners}static set globalListeners(e){n_._globalListeners=e}static get initialized(){return n_._initialized}static set initialized(e){n_._initialized=e}setIntegrationModel(e){this.integrationModel=e}setEnvironment(e){"editor"in e&&(this.environment.editor=e.editor),"mode"in e&&(this.environment.mode=e.mode),"version"in e&&(this.environment.version=e.version)}getModalDialog(){return this.modalDialog}init(){if(n_.initialized)this.listeners.fire("onLoad",{});else{const e=Cb.newListener("onInit",()=>{const e=Tb.getService("configurationjs","","get"),t=JSON.parse(e);xb.addConfiguration(t),xb.addConfiguration(Db),Pb.language=this.language,this.listeners.fire("onLoad",{})});Tb.addListener(e),Tb.init(this.serviceProviderProperties),n_.initialized=!0}}addListener(e){this.listeners.add(e)}static addGlobalListener(e){n_.globalListeners.add(e)}beforeUpdateFormula(e,t){const n=new Bb;return n.mathml=e,n.wirisProperties={},null!=t&&Object.keys(t).forEach(e=>{n.wirisProperties[e]=t[e]}),n.language=this.language,n.editMode=this.editMode,this.listeners.fire("onBeforeFormulaInsertion",n)||n_.globalListeners.fire("onBeforeFormulaInsertion",n)?{}:{mathml:n.mathml,wirisProperties:n.wirisProperties}}insertFormula(e,t,n,i){const o={};if(n)if("latex"===this.editMode){if(o.latex=Eb.getLatexFromMathML(n),this.integrationModel.fillNonLatexNode&&!o.latex){const i=new Bb;i.editMode=this.editMode,i.windowTarget=t,i.focusElement=e,i.latex=o.latex,this.integrationModel.fillNonLatexNode(i,t,n)}else o.node=t.document.createTextNode(`$$${o.latex}$$`);this.insertElementOnSelection(o.node,e,t)}else o.node=Nb.mathmlToImgObject(t.document,n,i,this.language),this.insertElementOnSelection(o.node,e,t);else this.insertElementOnSelection(null,e,t);return o}afterUpdateFormula(e,t,n,i){const o=new Bb;return o.editMode=this.editMode,o.windowTarget=t,o.focusElement=e,o.node=n,o.latex=i,this.listeners.fire("onAfterFormulaInsertion",o)||n_.globalListeners.fire("onAfterFormulaInsertion",o),{}}placeCaretAfterNode(e){this.integrationModel.getSelection();const t=e.ownerDocument;if(void 0!==t.getSelection&&e.parentElement){const n=t.createRange();n.setStartAfter(e),n.collapse(!0);const i=t.getSelection();i.removeAllRanges(),i.addRange(n),t.body.focus()}}insertElementOnSelection(e,t,n){if(this.editionProperties.isNewElement)if(e)if("textarea"===t.type)Sb.updateTextArea(t,e.textContent);else if(document.selection&&0===document.getSelection){let t=n.document.selection.createRange();if(n.document.execCommand("InsertImage",!1,e.src),"parentElement"in t||(n.document.execCommand("delete",!1),t=n.document.selection.createRange(),n.document.execCommand("InsertImage",!1,e.src)),"parentElement"in t){const n=t.parentElement();"IMG"===n.nodeName.toUpperCase()?n.parentNode.replaceChild(e,n):t.pasteHTML(Sb.createObjectCode(e))}}else{const t=this.integrationModel.getSelection();let n=null;this.editionProperties.range?(({range:n}=this.editionProperties),this.editionProperties.range=null):n=t.getRangeAt(0),n.deleteContents();let i=n.startContainer;const o=n.startOffset;3===i.nodeType?(i=i.splitText(o),i.parentNode.insertBefore(e,i)):1===i.nodeType&&i.insertBefore(e,i.childNodes[o]),this.placeCaretAfterNode(e)}else if("textarea"===t.type)t.focus();else{const e=this.integrationModel.getSelection();if(e.removeAllRanges(),this.editionProperties.range){const{range:t}=this.editionProperties;this.editionProperties.range=null,e.addRange(t)}}else if(this.editionProperties.latexRange)document.selection&&0===document.getSelection?(this.editionProperties.isNewElement=!0,this.editionProperties.latexRange.select(),this.insertElementOnSelection(e,t,n)):(this.editionProperties.latexRange.deleteContents(),this.editionProperties.latexRange.insertNode(e),this.placeCaretAfterNode(e));else if("textarea"===t.type){let n;n=void 0!==this.integrationModel.getSelectedItem?this.integrationModel.getSelectedItem(t,!1):Sb.getSelectedItemOnTextarea(t),Sb.updateExistingTextOnTextarea(t,e.textContent,n.startPosition,n.endPosition)}else e&&"img"===e.nodeName.toLowerCase()?(Ib.removeImgDataAttributes(this.editionProperties.temporalImage),Ib.clone(e,this.editionProperties.temporalImage)):this.editionProperties.temporalImage.remove(),this.placeCaretAfterNode(this.editionProperties.temporalImage)}openModalDialog(e,t){this.editMode="images";try{if(t){e.contentWindow.focus();const t=e.contentWindow.getSelection();this.editionProperties.range=t.getRangeAt(0)}else{e.focus();const t=getSelection();this.editionProperties.range=t.getRangeAt(0)}}catch(e){this.editionProperties.range=null}if(void 0===t&&(t=!0),this.editionProperties.latexRange=null,e){let n;if(n=void 0!==this.integrationModel.getSelectedItem?this.integrationModel.getSelectedItem(e,t):Sb.getSelectedItem(e,t),n){if(!n.caretPosition&&Sb.containsClass(n.node,xb.get("imageClassName")))this.editionProperties.temporalImage=n.node,this.editionProperties.isNewElement=!1;else if(3===n.node.nodeType)if(this.integrationModel.getMathmlFromTextNode){const e=this.integrationModel.getMathmlFromTextNode(n.node,n.caretPosition);e&&(this.editMode="latex",this.editionProperties.isNewElement=!1,this.editionProperties.temporalImage=document.createElement("img"),this.editionProperties.temporalImage.setAttribute(xb.get("imageMathmlAttribute"),yb.safeXmlEncode(e)))}else{const i=Eb.getLatexFromTextNode(n.node,n.caretPosition);if(i){const n=Eb.getMathMLFromLatex(i.latex);this.editMode="latex",this.editionProperties.isNewElement=!1,this.editionProperties.temporalImage=document.createElement("img"),this.editionProperties.temporalImage.setAttribute(xb.get("imageMathmlAttribute"),yb.safeXmlEncode(n));const o=t?e.contentWindow:window;if("textarea"!==e.tagName.toLowerCase())if(document.selection){let e=0,t=i.startNode.previousSibling;for(;t;)e+=Sb.getNodeLength(t),t=t.previousSibling;this.editionProperties.latexRange=o.document.selection.createRange(),this.editionProperties.latexRange.moveToElementText(i.startNode.parentNode),this.editionProperties.latexRange.move("character",e+i.startPosition),this.editionProperties.latexRange.moveEnd("character",i.latex.length+4)}else this.editionProperties.latexRange=o.document.createRange(),this.editionProperties.latexRange.setStart(i.startNode,i.startPosition),this.editionProperties.latexRange.setEnd(i.endNode,i.endPosition)}}}else"textarea"===e.tagName.toLowerCase()&&(this.editMode="latex")}const n=xb.get("editorAttributes").split(", "),i={};for(let e=0,t=n.length;e<t;e+=1){const t=n[e].split("="),o=t[0],r=t[1];i[o]=r}const o={},r=xb.get("editorParameters"),s=this.integrationModel.editorParameters;Object.assign(o,i,r),Object.assign(o,i,s),o.language=this.language,o.rtl=this.integrationModel.rtl;const a={};if(a.editorAttributes=o,a.language=this.language,a.customEditors=this.customEditors,a.environment=this.environment,null==this.modalDialog){this.modalDialog=new e_(o),this.contentManager=new Rb(a);const e=Cb.newListener("onLoad",()=>{if(this.contentManager.isNewElement=this.editionProperties.isNewElement,null!=this.editionProperties.temporalImage){const e=yb.safeXmlDecode(this.editionProperties.temporalImage.getAttribute(xb.get("imageMathmlAttribute")));this.contentManager.mathML=e}});this.contentManager.addListener(e),this.contentManager.init(),this.modalDialog.setContentManager(this.contentManager),this.contentManager.setModalDialogInstance(this.modalDialog)}else if(this.contentManager.isNewElement=this.editionProperties.isNewElement,null!=this.editionProperties.temporalImage){const e=yb.safeXmlDecode(this.editionProperties.temporalImage.getAttribute(xb.get("imageMathmlAttribute")));this.contentManager.mathML=e}this.contentManager.setIntegrationModel(this.integrationModel),this.modalDialog.open()}getCustomEditors(){return this.customEditors}}n_._globalListeners=new Cb,n_._initialized=!1;class i_{constructor(e){if(this.language="en",this.serviceProviderProperties={},"serviceProviderProperties"in e&&(this.serviceProviderProperties=e.serviceProviderProperties),this.configurationService="","configurationService"in e&&(this.serviceProviderProperties.URI=e.configurationService,console.warn("Deprecated property configurationService. Use serviceParameters on instead.",[e.configurationService])),this.version="version"in e?e.version:"",this.target=null,!("target"in e))throw new Error("IntegrationModel constructor error: target property missed.");this.target=e.target,"scriptName"in e&&(this.scriptName=e.scriptName),this.callbackMethodArguments={},"callbackMethodArguments"in e&&(this.callbackMethodArguments=e.callbackMethodArguments),this.environment={},"environment"in e&&(this.environment=e.environment),this.isIframe=!1,null!=this.target&&(this.isIframe="IFRAME"===this.target.tagName.toUpperCase()),this.editorObject=null,"editorObject"in e&&(this.editorObject=e.editorObject),this.rtl=!1,"rtl"in e&&(this.rtl=e.rtl),this.managesLanguage=!1,"managesLanguage"in e&&(this.managesLanguage=e.managesLanguage),this.temporalImageResizing=!1,this.core=null,this.listeners=new Cb,"integrationParameters"in e&&i_.integrationParameters.forEach(t=>{if(t in e.integrationParameters){const n=e.integrationParameters[t];0!==Object.keys(n).length&&(this[t]=n)}})}init(){this.language=this.getLanguage();const e=Cb.newListener("onLoad",()=>{this.callbackFunction(this.callbackMethodArguments)});if(-1!==this.serviceProviderProperties.URI.indexOf("configuration")){const e=this.serviceProviderProperties.URI,t=Tb.getServerLanguageFromService(e);this.serviceProviderProperties.server=t;const n=this.serviceProviderProperties.URI.indexOf("configuration"),i=this.serviceProviderProperties.URI.substring(0,n);this.serviceProviderProperties.URI=i}let t=this.serviceProviderProperties.URI;t=0===t.indexOf("/")||0===t.indexOf("http")?t:Sb.concatenateUrl(this.getPath(),t),this.serviceProviderProperties.URI=t;const n={};n.serviceProviderProperties=this.serviceProviderProperties,this.setCore(new n_(n)),this.core.addListener(e),this.core.language=this.language,this.core.init(),this.core.setEnvironment(this.environment)}getPath(){if(void 0===this.scriptName)throw new Error("scriptName property needed for getPath.");const e=document.getElementsByTagName("script");let t="";for(let n=0;n<e.length;n+=1){const i=e[n].src.lastIndexOf(this.scriptName);i>=0&&(t=e[n].src.substr(0,i-1))}return t}getVersion(){return this.version}setLanguage(e){this.language=e}setCore(e){this.core=e,e.setIntegrationModel(this)}getCore(){return this.core}setTarget(e){this.target=e,this.isIframe="IFRAME"===this.target.tagName.toUpperCase()}setEditorObject(e){this.editorObject=e}openNewFormulaEditor(){this.core.editionProperties.isNewElement=!0,this.core.openModalDialog(this.target,this.isIframe)}openExistingFormulaEditor(){this.core.editionProperties.isNewElement=!1,this.core.openModalDialog(this.target,this.isIframe)}updateFormula(e){let t,n;this.editorParameters&&(e=com.wiris.editor.util.EditorUtils.addAnnotation(e,"application/vnd.wiris.mtweb-params+json",JSON.stringify(this.editorParameters)));this.isIframe?(t=this.target.contentWindow,n=this.target.contentWindow):(t=this.target,n=window);let i=this.core.beforeUpdateFormula(e,null);return i?(i=this.insertFormula(t,n,i.mathml,i.wirisProperties),i?this.core.afterUpdateFormula(i.focusElement,i.windowTarget,i.node,i.latex):""):""}insertFormula(e,t,n,i){return this.core.insertFormula(e,t,n,i)}getSelection(){return this.isIframe?(this.target.contentWindow.focus(),this.target.contentWindow.getSelection()):(this.target.focus(),window.getSelection())}addEvents(){const e=this.isIframe?this.target.contentWindow.document:this.target;Sb.addElementEvents(e,(e,t)=>{this.doubleClickHandler(e,t)},(e,t)=>{this.mousedownHandler(e,t)},(e,t)=>{this.mouseupHandler(e,t)})}doubleClickHandler(e){if("img"===e.nodeName.toLowerCase()){this.core.getCustomEditors().disable();const t=xb.get("imageCustomEditorName");if(e.hasAttribute(t)){const n=e.getAttribute(t);this.core.getCustomEditors().enable(n)}Sb.containsClass(e,xb.get("imageClassName"))&&(this.core.editionProperties.temporalImage=e,this.core.editionProperties.isNewElement=!0,this.openExistingFormulaEditor())}}mouseupHandler(){this.temporalImageResizing&&setTimeout(()=>{Ib.fixAfterResize(this.temporalImageResizing)},10)}mousedownHandler(e){"img"===e.nodeName.toLowerCase()&&Sb.containsClass(e,xb.get("imageClassName"))&&(this.temporalImageResizing=e)}getLanguage(){return this.getBrowserLanguage()}getBrowserLanguage(){let e="en";return e=navigator.userLanguage?navigator.userLanguage.substring(0,2):navigator.language?navigator.language.substring(0,2):"en",e}callbackFunction(){const e=Cb.newListener("onTargetReady",()=>{this.addEvents(this.target)});this.listeners.add(e)}notifyWindowClosed(){}getMathmlFromTextNode(e,t){}fillNonLatexNode(e,t,n){}getSelectedItem(e,t){}static setTemporalImageToNull(){WirisPlugin.currentInstance&&(WirisPlugin.currentInstance.core.editionProperties.temporalImage=null)}}i_.prototype.getMathmlFromTextNode=void 0,i_.prototype.fillNonLatexNode=void 0,i_.prototype.getSelectedItem=void 0,i_.integrationParameters=["serviceProviderProperties","editorParameters"];class o_ extends i_{constructor(e){const t=e.editorObject;void 0!==t.config&&void 0!==t.config.get("mathTypeParameters")&&(e.integrationParameters=t.config.get("mathTypeParameters")),super(e),this.integrationFolderName="ckeditor_wiris"}getLanguage(){try{return this.editorParameters.language}catch(e){}const e=this.editorObject.config.get("language");return null!=e?"object"==typeof e?e.hasOwnProperty("ui")?e.ui:super.getLanguage():e:super.getLanguage()}addEditorListeners(){const e=this.editorObject;void 0!==e.config.wirislistenersdisabled&&e.config.wirislistenersdisabled||this.checkElement()}checkElement(){const e=this.editorObject.sourceElement;e.wirisActive||(this.setTarget(e),this.addEvents(),e.wirisActive=!0)}doubleClickHandler(e,t){if("img"==e.nodeName.toLowerCase()&&Sb.containsClass(e,xb.get("imageClassName"))){void 0!==t.stopPropagation?t.stopPropagation():t.returnValue=!1,this.core.getCustomEditors().disable();const n=e.getAttribute(xb.get("imageCustomEditorName"));n&&this.core.getCustomEditors().enable(n),this.core.editionProperties.temporalImage=e,this.openExistingFormulaEditor()}}getCorePath(){return null}callbackFunction(){super.callbackFunction(),this.addEditorListeners()}openNewFormulaEditor(){return this.core.editionProperties.selection=this.editorObject.editing.view.document.selection,super.openNewFormulaEditor()}insertMathml(e){return this.editorObject.model.change(t=>{const n=this.getCore(),i=t.createElement("mathml",{formula:e});if(i.data=e,n.editionProperties.isNewElement){if(!e)return;let n=this.core.editionProperties.selection||this.editorObject.editing.view.document.selection,o=this.editorObject.editing.mapper.toModelPosition(n.getLastPosition());if(t.insert(i,o),!n.isCollapsed)for(const e of n.getRanges())t.remove(this.editorObject.editing.mapper.toModelRange(e))}else{const o=n.editionProperties.temporalImage,r=this.editorObject.editing.view.domConverter.domToView(o).parent,s=this.editorObject.editing.mapper.toModelElement(r),a=this.editorObject.model.createPositionBefore(s);e&&t.insert(i,a),t.remove(s)}return i})}findText(e){let t,n=e;for(;!t;)t=this.editorObject.editing.mapper.toModelElement(this.editorObject.editing.view.domConverter.domToView(n)),n=n.parentElement;const i=this.editorObject.model.createRangeIn(t),o=Array.from(i.getItems());for(const t of o)if(t.is("textProxy")&&t.data==e.data.replace(String.fromCharCode(160)," "))return t.textNode}insertFormula(e,t,n,i){let o={};if(n)if("latex"==this.core.editMode)o.latex=Eb.getLatexFromMathML(n),o.node=t.document.createTextNode("$$"+o.latex+"$$"),this.editorObject.model.change(e=>{const t=this.core.editionProperties.latexRange,n=this.findText(t.startContainer),i=this.findText(t.endContainer),r=e.createPositionAt(n.parent,n.startOffset+t.startOffset),s=e.createPositionAt(i.parent,i.startOffset+t.endOffset),a=e.createRange(r,s);e.remove(a),e.insertText("$$"+o.latex+"$$",n.getAttributes(),r)});else try{o.node=this.editorObject.editing.view.domConverter.viewToDom(this.editorObject.editing.mapper.toViewElement(this.insertMathml(n)),t.document)}catch(e){e.toString().includes("CKEditorError: Cannot read property 'parent' of undefined")&&this.core.modalDialog.cancelAction()}else this.insertMathml("");return o}notifyWindowClosed(){this.editorObject.editing.view.focus()}}class r_ extends st{constructor(e){super(e)}execute(e={}){if(!(e.hasOwnProperty("integration")&&e.integration instanceof o_))throw'Must pass a valid CKEditor5Integration instance as attribute "integration" of options';this.integration=e.integration,this.setEditor(),this.openEditor()}setEditor(){this.integration.core.getCustomEditors().disable()}openEditor(){const e=this._getSelectedImage();null!=e&&e.classList.contains(WirisPlugin.Configuration.get("imageClassName"))?(this.integration.core.editionProperties.temporalImage=e,this.integration.openExistingFormulaEditor()):this.integration.openNewFormulaEditor()}_getSelectedImage(){const e=this.editor.editing.view.document.selection;if(e.isCollapsed||1!==e.rangeCount)return;const t=e.getFirstRange();let n;for(const e of t){if("span"!==e.item.name)return;n=e.item.getChild(0);break}return n?this.editor.editing.view.domConverter.mapViewToDom(n):void 0}}class s_ extends r_{setEditor(){this.integration.core.getCustomEditors().enable("chemistry")}}var a_=null;var l_=n(14),c_=n.n(l_);n(105);class d_ extends Je{static get requires(){return[mg]}init(){console.log("FillTheBlankEditing#init() got called"),this._defineSchema(),this._defineConverters(),this.editor.commands.add("fill",new u_(this.editor)),this.editor.editing.mapper.on("viewToModelPosition",Ir(this.editor.model,e=>e.hasClass("fill")))}_defineSchema(){this.editor.model.schema.register("fill",{allowWhere:"$text",isInline:!0,isObject:!0,allowAttributes:["name"]})}_defineConverters(){const e=this.editor.conversion,t=this.editor.config._config;function n(e,n){const i=e.getAttribute("name"),o=n.createContainerElement("span",{class:"fill",name:t.fillConfig}),r=n.createText(" "+i+" ");return n.insert(n.createPositionAt(o,0),r),o}e.for("upcast").elementToElement({view:{name:"span",classes:"fill"},model:(e,{writer:t})=>{const n=e.getChild(0).data.slice(1,-1);return t.createElement("fill",{name:n})}}),e.for("dataDowncast").elementToElement({model:"fill",view:(e,{writer:t})=>n(e,t)}),e.for("editingDowncast").elementToElement({model:"fill",view:(e,{writer:t})=>Tr(n(e,t),t)})}}class u_ extends st{execute(){const e=this.editor;c_.a.fire({title:"Fill the answer",input:"text",showCancelButton:!0,inputValidator:e=>{if(e)t(e);else if(!e)return"You need to write something!"}});const t=t=>{e.model.change(n=>{const i=n.createElement("fill",{name:t});e.model.insertContent(i),n.setSelection(i,"on")})}}refresh(){const e=this.editor.model,t=e.document.selection,n=e.schema.checkChild(t.focus.parent,"fill");this.isEnabled=n}}class h_ extends Je{init(){const e=this.editor,t=e.t,n=e.config._config;e.ui.componentFactory.add("fill",i=>{const o=new Fi(i);o.set({label:t("Fill"),withText:!0,tooltip:!0,isVisible:!n.isFIllDisable});const r=e.commands.get("fill");return o.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(o,"execute",t=>{e.execute("fill")}),o})}}class m_ extends kh{}m_.builtinPlugins=[class extends Je{static get requires(){return[Ra,Ch,Rh,Ph,Bh,sm]}static get pluginName(){return"Essentials"}},ot,class extends Je{static get pluginName(){return"Autoformat"}afterInit(){this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats()}_addListAutoformats(){const e=this.editor.commands;e.get("bulletedList")&&Qo(this.editor,this,/^[*-]\s$/,"bulletedList"),e.get("numberedList")&&Qo(this.editor,this,/^1[.|)]\s$/,"numberedList")}_addBasicStylesAutoformats(){const e=this.editor.commands;if(e.get("bold")){const e=tr(this.editor,"bold");Zo(this.editor,this,/(\*\*)([^*]+)(\*\*)$/g,e),Zo(this.editor,this,/(__)([^_]+)(__)$/g,e)}if(e.get("italic")){const e=tr(this.editor,"italic");Zo(this.editor,this,/(?:^|[^*])(\*)([^*_]+)(\*)$/g,e),Zo(this.editor,this,/(?:^|[^_])(_)([^_]+)(_)$/g,e)}if(e.get("code")){const e=tr(this.editor,"code");Zo(this.editor,this,/(`)([^`]+)(`)$/g,e)}if(e.get("strikethrough")){const e=tr(this.editor,"strikethrough");Zo(this.editor,this,/(~~)([^~]+)(~~)$/g,e)}}_addHeadingAutoformats(){const e=this.editor.commands.get("heading");e&&e.modelElements.filter(e=>e.match(/^heading[1-6]$/)).forEach(t=>{const n=t[7],i=new RegExp(`^(#{${n}})\\s$`);Qo(this.editor,this,i,()=>{if(!e.isEnabled||e.value===t)return!1;this.editor.execute("heading",{value:t})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&Qo(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){this.editor.commands.get("codeBlock")&&Qo(this.editor,this,/^```$/,"codeBlock")}},class extends Je{static get requires(){return[ir,or]}static get pluginName(){return"Bold"}},class extends Je{static get requires(){return[ar,lr]}static get pluginName(){return"Strikethrough"}},class extends Je{static get requires(){return[rr,sr]}static get pluginName(){return"Italic"}},class extends Je{static get pluginName(){return"CKFinder"}static get requires(){return[pl,cr,ot]}},class extends Je{static get requires(){return[rg,sg]}static get pluginName(){return"Heading"}},class extends Je{static get requires(){return[Fr,mg,Sg]}static get pluginName(){return"Image"}},class extends Je{static get requires(){return[Ng]}static get pluginName(){return"ImageCaption"}},class extends Je{static get requires(){return[Bg,Kg,Hg]}static get pluginName(){return"ImageResize"}},class extends Je{static get requires(){return[sp,ap]}static get pluginName(){return"ImageStyle"}},class extends Je{static get requires(){return[lp]}static get pluginName(){return"ImageToolbar"}afterInit(){const e=this.editor,t=e.t;e.plugins.get(lp).register("image",{ariaLabel:t("Image toolbar"),items:e.config.get("image.toolbar")||[],getRelatedElement:zr})}},class extends Je{static get pluginName(){return"ImageUpload"}static get requires(){return[Ap,gp,pp]}},class extends Je{static get pluginName(){return"Indent"}static get requires(){return[Ep,Sp]}},class extends Je{static get requires(){return[tf,of]}static get pluginName(){return"List"}},class extends Je{static get requires(){return[hf,ff,gf,mg]}static get pluginName(){return"MediaEmbed"}},ng,class extends Je{static get pluginName(){return"PasteFromOffice"}static get requires(){return[Ra]}init(){const e=this.editor,t=e.editing.view.document,n=[];n.push(new Ef(t)),n.push(new vf(t)),e.plugins.get("Clipboard").on("inputTransformation",(e,t)=>{if(t.isTransformedWithPasteFromOffice)return;const i=t.dataTransfer.getData("text/html"),o=n.find(e=>e.isActive(i));o&&(o.execute(t),t.isTransformedWithPasteFromOffice=!0)},{priority:"high"})}},class extends Je{static get requires(){return[Uw,Yw,Kw,nb,eb,Xw,mg]}static get pluginName(){return"Table"}},class extends Je{static get requires(){return[lp]}static get pluginName(){return"TableToolbar"}afterInit(){const e=this.editor,t=e.t,n=e.plugins.get(lp),i=e.config.get("table.contentToolbar"),o=e.config.get("table.tableToolbar");i&&n.register("tableContent",{ariaLabel:t("Table toolbar"),items:i,getRelatedElement:rb}),o&&n.register("table",{ariaLabel:t("Table toolbar"),items:o,getRelatedElement:ob})}},class extends Je{static get pluginName(){return"TextTransformation"}constructor(e){super(e),e.config.define("typing",{transformations:{include:mb}})}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTransformationWatchers()}_enableTransformationWatchers(){const e=this.editor,t=e.model,n=e.plugins.get("Input"),i=function(e){const t=e.extra||[],n=e.remove||[],i=e=>!n.includes(e);return function(e){const t=new Set;for(const n of e)if(hb[n])for(const e of hb[n])t.add(e);else t.add(n);return Array.from(t)}(e.include.concat(t).filter(i)).filter(i).map(e=>ub[e]||e).map(e=>({from:gb(e.from),to:pb(e.to)}))}(e.config.get("typing.transformations")),o=new ab(e.model,e=>{for(const t of i){if(t.from.test(e))return{normalizedTransformation:t}}});o.on("matched:data",(e,i)=>{if(!n.isInput(i.batch))return;const{from:o,to:r}=i.normalizedTransformation,s=o.exec(i.text),a=r(s.slice(1)),l=i.range;let c=s.index;t.enqueueChange(e=>{for(let n=1;n<s.length;n++){const i=s[n],o=a[n-1];if(null==o){c+=i.length;continue}const r=l.start.getShiftedBy(c),d=t.createRange(r,r.getShiftedBy(i.length)),u=fb(r);t.insertContent(e.createText(o,u),d),c+=o.length}})}),o.bind("isEnabled").to(this)}},class extends Je{static get requires(){return[mg]}static get pluginName(){return"MathType"}init(){const e=this._addIntegration();a_=e,this._addCommands(),this._addViews(e),this._addSchema(),this._addConverters(),this._exposeWiris()}_addIntegration(){const e=this.editor,t={};let n;return t.environment={},t.environment.editor="CKEditor5",t.environment.editorVersion="5.x",t.editorObject=e,t.serviceProviderProperties={},t.serviceProviderProperties.URI="https://www.wiris.net/demo/plugins/app",t.serviceProviderProperties.server="java",t.target=e.sourceElement,t.scriptName="bundle.js",t.managesLanguage=!0,t.target&&(n=new o_(t),n.init(),n.listeners.fire("onTargetReady",{}),n.checkElement(),this.listenTo(e.editing.view.document,"click",(e,t)=>{2==t.domEvent.detail&&(n.doubleClickHandler(t.domTarget,t.domEvent),e.stop())},{priority:"highest"})),n}_addCommands(){const e=this.editor;e.commands.add("MathType",new r_(e)),e.commands.add("ChemType",new s_(e))}_addViews(e){const t=this.editor;t.ui.componentFactory.add("MathType",n=>{const i=new Fi(n);return i.bind("isEnabled").to(t.commands.get("MathType"),"isEnabled"),i.set({label:"Insert a math equation - MathType",icon:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 300 261.7" style="enable-background:new 0 0 300 261.7;" xml:space="preserve">\n<style type="text/css">\n\t.st0{fill:#FFFFFF;}\n\t.st1{fill:#EF4A5F;}\n\t.st2{fill:#C8202F;}\n</style>\n<path class="st0" d="M300,32.8c0-16.4-13.4-29.7-29.9-29.7c-2.9,0-7.2,0.8-7.2,0.8c-37.9,9.1-71.3,14-112,14c-0.3,0-0.6,0-1,0\n\tc-16.5,0-29.9,13.3-29.9,29.7c0,16.4,13.4,29.7,29.9,29.7l0,0c45.3,0,83.1-5.3,125.3-15.3h0C289.3,59.5,300,47.4,300,32.8"/>\n<path class="st0" d="M90.2,257.7c-11.4,0-21.9-6.4-27-16.7l-60-119.9c-7.5-14.9-1.4-33.1,13.5-40.5c14.9-7.5,33.1-1.4,40.5,13.5\n\tl27.3,54.7L121.1,39c5.3-15.8,22.4-24.4,38.2-19.1c15.8,5.3,24.4,22.4,19.1,38.2l-59.6,179c-3.9,11.6-14.3,19.7-26.5,20.6\n\tC91.6,257.7,90.9,257.7,90.2,257.7"/>\n<g>\n\t<g>\n\t\t<path class="st1" d="M90.2,257.7c-11.4,0-21.9-6.4-27-16.7l-60-119.9c-7.5-14.9-1.4-33.1,13.5-40.5c14.9-7.5,33.1-1.4,40.5,13.5\n\t\t\tl27.3,54.7L121.1,39c5.3-15.8,22.4-24.4,38.2-19.1c15.8,5.3,24.4,22.4,19.1,38.2l-59.6,179c-3.9,11.6-14.3,19.7-26.5,20.6\n\t\t\tC91.6,257.7,90.9,257.7,90.2,257.7"/>\n\t</g>\n</g>\n<g>\n\t<g>\n\t\t<path class="st2" d="M300,32.8c0-16.4-13.4-29.7-29.9-29.7c-2.9,0-7.2,0.8-7.2,0.8c-37.9,9.1-71.3,14-112,14c-0.3,0-0.6,0-1,0\n\t\t\tc-16.5,0-29.9,13.3-29.9,29.7c0,16.4,13.4,29.7,29.9,29.7l0,0c45.3,0,83.1-5.3,125.3-15.3h0C289.3,59.5,300,47.4,300,32.8"/>\n\t</g>\n</g>\n</svg>\n',tooltip:!0}),i.on("execute",()=>{t.execute("MathType",{integration:e})}),i}),t.ui.componentFactory.add("ChemType",n=>{const i=new Fi(n);return i.bind("isEnabled").to(t.commands.get("ChemType"),"isEnabled"),i.set({label:"Insert a chemistry formula - ChemType",icon:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 40.3 49.5" style="enable-background:new 0 0 40.3 49.5;" xml:space="preserve">\n<style type="text/css">\n\t.st0{fill:#A4CF61;}\n</style>\n<path class="st0" d="M39.2,12.1c0-1.9-1.1-3.6-2.7-4.4L24.5,0.9l0,0c-0.7-0.4-1.5-0.6-2.4-0.6c-0.9,0-1.7,0.2-2.4,0.6l0,0L2.3,10.8\n\tl0,0C0.9,11.7,0,13.2,0,14.9h0v19.6h0c0,1.7,0.9,3.3,2.3,4.1l0,0l17.4,9.9l0,0c0.7,0.4,1.5,0.6,2.4,0.6c0.9,0,1.7-0.2,2.4-0.6l0,0\n\tl12.2-6.9h0c1.5-0.8,2.6-2.5,2.6-4.3c0-2.7-2.2-4.9-4.9-4.9c-0.9,0-1.8,0.3-2.5,0.7l0,0l-9.7,5.6l-12.3-7V17.8l12.3-7l9.9,5.7l0,0\n\tc0.7,0.4,1.5,0.6,2.4,0.6C37,17,39.2,14.8,39.2,12.1"/>\n</svg>\n',tooltip:!0}),i.on("execute",()=>{t.execute("ChemType",{integration:e})}),i}),t.editing.view.addObserver(_b)}_addSchema(){this.editor.model.schema.register("mathml",{allowWhere:"$text",isObject:!0,isInline:!0,allowAttributes:["formula"]})}_addConverters(){const e=this.editor;e.conversion.for("upcast").elementToElement({view:{name:"span",classes:"ck-math-widget"},model:(e,{writer:t})=>{const n=yb.safeXmlDecode(e.getChild(0).getAttribute("data-mathml"));return t.createElement("mathml",{formula:n})}}),e.data.upcastDispatcher.on("element:math",(t,n,i)=>{const{consumable:o,writer:r}=i,s=n.viewItem;if(!o.test(s,{name:!0}))return;let a=function(e){const t=e.getChild(0);if(!t||"semantics"!==t.name)return!1;for(const e of t.getChildren())if("annotation"===e.name&&"LaTeX"===e.getAttribute("encoding"))return!0;return!1}(s);const l=new kb(e.editing.view.document),c=new vp(e.editing.view.document).createDocumentFragment(s.getChildren()),d=[...s.getAttributes()].map(([e,t])=>` ${e}="${t}"`).join("");let u=l.toData(c)||"";u=`<math${d}>${u}</math>`;const h=a?r.createText(Nb.initParse(u,e.config.get("language"))):r.createElement("mathml",{formula:u});h.data=u;const m=i.splitToAllowedParent(h,n.modelCursor);if(!m)return;i.writer.insert(h,m.position),o.consume(s,{name:!0});const g=i.getSplitParts(h);n.modelRange=r.createRange(i.writer.createPositionBefore(h),i.writer.createPositionAfter(g[g.length-1])),m.cursorParent?n.modelCursor=i.writer.createPositionAt(m.cursorParent,0):n.modelCursor=n.modelRange.end}),e.conversion.for("editingDowncast").elementToElement({model:"mathml",view:function(t,{writer:n}){const i=n.createContainerElement("span",{class:"ck-math-widget"}),o=function(t,{writer:n}){const i=new za(n.document),o=t.getAttribute("formula"),r=Nb.initParse(o,e.config.get("language")),s=i.toView(r).getChild(0);return n.createEmptyElement("img",s.getAttributes())}(t,{writer:n});return n.insert(n.createPositionAt(i,0),o),Tr(i,n)}}),e.conversion.for("dataDowncast").elementToElement({model:"mathml",view:function(e,{writer:t}){const n=new za(t.document);let i=Nb.endParseSaveMode(e.getAttribute("formula"));xb.get("saveHandTraces")||(i=yb.removeAnnotation(i,"application/json"));const o=n.toView(i).getChild(0);return function e(t,n){if(n.is("text"))return t.createText(n.data);if(n.is("element")){if(n.is("emptyElement"))return t.createEmptyElement(n.name,n.getAttributes());{const i=t.createContainerElement(n.name,n.getAttributes());for(const o of n.getChildren())t.insert(t.createPositionAt(i,"end"),e(t,o));return i}}throw new Exception("Given node has unsupported type.")}(t,o)}}),e.editing.mapper.on("viewToModelPosition",Ir(e.model,e=>e.hasClass("ck-math-widget")));const t=e.data.get;e.data.get=n=>{const i=t.bind(e.data)(n);return Nb.endParse(i)}}_exposeWiris(){window.WirisPlugin={Core:n_,Parser:Nb,Image:Ib,MathML:yb,Util:Sb,Configuration:xb,Listeners:Cb,IntegrationModel:i_,currentInstance:a_,Latex:Eb}}},class extends Je{static get requires(){return[Nm,Lm]}static get pluginName(){return"FontBackgroundColor"}},class extends Je{static get requires(){return[Dm,Bm]}static get pluginName(){return"FontColor"}},class extends Je{static get requires(){return[Wm,qm]}static get pluginName(){return"FontFamily"}},class extends Je{static get requires(){return[Gm,Qm]}static get pluginName(){return"FontSize"}},class extends Je{static get requires(){return[mt,zo]}static get pluginName(){return"Alignment"}},class extends Je{static get requires(){return[d_,h_]}},class extends Je{static get requires(){return[tt]}static get pluginName(){return"Base64UploadAdapter"}init(){this.editor.plugins.get(tt).createUploadAdapter=e=>new bb(e)}}],m_.defaultConfig={toolbar:{items:["heading","|","bold","strikethrough","italic","bulletedList","numberedList","|","fontFamily","fontSize","fontColor","fontBackgroundColor","alignment","|","imageUpload","insertTable","mediaEmbed","|","MathType","ChemType","fill"]},image:{styles:["alignLeft","alignCenter","alignRight"],resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}],toolbar:["imageStyle:alignLeft","imageStyle:alignCenter","imageStyle:alignRight","|","resizeImage:50","resizeImage:75","resizeImage:original","|","imageTextAlternative"]},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells"]},fontFamily:{options:["default","عثمان طه","Ubuntu, Arial, sans-serif","Ubuntu Mono, Courier New, Courier, monospace","Open Sans"]},fontSize:{options:["tiny","default","big"]},fillConfig:"",isFIllDisable:!1,alertConfig:{errorMessage:"You need to write the Answer!",alertTitle:"Fill the Answer",sweetStyle:{width:"500px",padding:"1.25em",confirmButtonText:"Save",cancelButtonText:"Close",confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",reverseButtons:!1},customClass:{},fillBg:{class:".fill"}}};t.default=m_}]).default}));
  //# sourceMappingURL=ckeditor.js.map