diff --git a/admin/action.php b/admin/action.php index 580a6804..b5e67fb1 100644 --- a/admin/action.php +++ b/admin/action.php @@ -8,6 +8,9 @@ { switch ($_GET['action']) // on utilise ici un switch pour inclure telle ou telle page selon l'action. { + case 'supprUpload': + require('admin/actions/supprUpload.php'); + exit(); case 'editUploadImage': if($_Permission_->verifPerm('PermsPanel', 'general', 'actions', 'editUploadImg')) { $_Serveur_['uploadImage']['maxFileSize'] = intval($_POST['maxFileSize']); @@ -416,10 +419,7 @@ case 'changeSlider': require_once('admin/actions/changeSlider.php'); break; - - case 'postSlider': - require_once('admin/actions/postSlider.php'); - break; + case 'supprSlider': require_once('admin/actions/supprSlider.php'); diff --git a/admin/actions/.htpasswd b/admin/actions/.htpasswd new file mode 100644 index 00000000..f1f89810 --- /dev/null +++ b/admin/actions/.htpasswd @@ -0,0 +1 @@ +cms:58d3eec4522c2da0726905295171549e \ No newline at end of file diff --git a/admin/actions/addRapNav.php b/admin/actions/addRapNav.php index ef6b8157..94e2dd05 100644 --- a/admin/actions/addRapNav.php +++ b/admin/actions/addRapNav.php @@ -9,7 +9,10 @@ { break; } else { - $lectureAccueil['Infos'][$i+1] = $lectureAccueil['Infos'][$i]; + $lectureAccueil['Infos'][$i+1]['message'] = $lectureAccueil['Infos'][$i]['message']; + $lectureAccueil['Infos'][$i+1]['image'] = $lectureAccueil['Infos'][$i]['image']; + $lectureAccueil['Infos'][$i+1]['type'] = $lectureAccueil['Infos'][$i]['type']; + $lectureAccueil['Infos'][$i+1]['lien'] = $lectureAccueil['Infos'][$i]['lien']; } } } diff --git a/admin/actions/addSocial.php b/admin/actions/addSocial.php index 73a7c884..783d078e 100644 --- a/admin/actions/addSocial.php +++ b/admin/actions/addSocial.php @@ -1,8 +1,7 @@ verifPerm('PermsPanel', 'reseaux', 'showPage')) +if($_Permission_->verifPerm('PermsPanel', 'social', 'actions', 'addSocial')) { $nom = htmlspecialchars($_POST['nom']); - $req = $bddConnection->prepare('ALTER TABLE cmw_reseaux ADD :nom VARCHAR(30)'); - $req->execute(array('nom' => $nom)); + $req = $bddConnection->exec('ALTER TABLE cmw_reseaux ADD COLUMN '.$nom.' VARCHAR(30)'); } ?> \ No newline at end of file diff --git a/admin/actions/editBoutique.php b/admin/actions/editBoutique.php index daa75c12..ab38989a 100644 --- a/admin/actions/editBoutique.php +++ b/admin/actions/editBoutique.php @@ -1,10 +1,11 @@ verifPerm('PermsPanel', 'shop', 'actions', 'editCategorieOffre')) { + require('modele/app/ckeditor.class.php'); + $_POST['categorieNom'] = htmlspecialchars($_POST['categorieNom']); $_POST['number'] = intval($_POST['number']); - require('modele/app/ckeditor.class.php'); $_POST['categorieInfo'] = ckeditor::verif($_POST['categorieInfo']); $req = $bddConnection->prepare('UPDATE cmw_boutique_categories SET titre = :titre, message = :message, showNumber = :show WHERE id = :id'); $req->execute(Array ( @@ -58,8 +59,7 @@ } else { $_POST['offresNom'.$offres[$j]['id']] = htmlspecialchars($_POST['offresNom'.$offres[$j]['id']]); - $_POST['offresDescription'.$offres[$j]['id']] = htmlspecialchars($_POST['offresDescription'.$offres[$j]['id']]); - require('modele/app/ckeditor.class.php'); + $_POST['offresDescription'.$offres[$j]['id']] = htmlspecialchars($_POST['offresDescription'.$offres[$j]['id']]); $_POST['offresDescription'.$offres[$j]['id']] = ckeditor::verif($_POST['offresDescription'.$offres[$j]['id']]); $req = $bddConnection->prepare('UPDATE `cmw_boutique_offres` SET `nom`=:nom,`description`=:description,`prix`=:prix,`nbre_vente`=:nbre_vente,`categorie_id`=:categorie_id,`ordre`=:ordre,`evo`=:evo,`max_vente`=:max_vente WHERE id=:id'); $req->execute(Array ( diff --git a/admin/actions/editRapNav.php b/admin/actions/editRapNav.php index 18b14e84..7e200a77 100644 --- a/admin/actions/editRapNav.php +++ b/admin/actions/editRapNav.php @@ -6,6 +6,7 @@ { $lectureAccueil['Infos'][$_POST["ordre". $i]]['message'] = $_POST['message' . $i]; $lectureAccueil['Infos'][$_POST["ordre". $i]]['image'] = $_POST['image' . $i]; + $lectureAccueil['Infos'][$_POST["ordre". $i]]['type'] = $_POST['typeLien'. $i]; if($_POST['typeLien'. $i] == 'page') $lectureAccueil['Infos'][$_POST["ordre". $i]]['lien'] = '?page='. urlencode($_POST['page' . $i]); else diff --git a/admin/actions/editResetVote.php b/admin/actions/editResetVote.php index be2e0272..e0db614f 100644 --- a/admin/actions/editResetVote.php +++ b/admin/actions/editResetVote.php @@ -14,11 +14,26 @@ } $temp['etat'] = RecompenseAuto::configureNextDate($temp, $type); $action = json_encode($temp); + + $req = $bddConnection->query('SELECT * FROM cmw_votes_recompense_auto_config WHERE type=3'); + $req = $req->fetch(PDO::FETCH_ASSOC); + if(isset($req) && !empty($req)) { + $req = $bddConnection->prepare('UPDATE cmw_votes_recompense_auto_config SET `valueType`=:type, `action`=:action WHERE type=3 '); + $req->execute(array( + 'type' => $type, + 'action' => $action + )); + } else { + $req = $bddConnection->prepare('INSERT INTO cmw_votes_recompense_auto_config ( `type`, `valueType`, `action`) VALUES (3,:type,:action)'); + $req->execute(array( + 'type' => $type, + 'action' => $action + )); + } } - $req = $bddConnection->prepare('UPDATE cmw_votes_recompense_auto_config SET `valueType`=:type, `action`=:action WHERE type=3 '); - $req->execute(array( - 'type' => $type, - 'action' => $action - )); + else { + $bddConnection->exec('DELETE FROM cmw_votes_recompense_auto_config WHERE type=3 '); + } + } ?> \ No newline at end of file diff --git a/admin/actions/getJsonVoteHistory.php b/admin/actions/getJsonVoteHistory.php index 42ab04a4..ce5e8216 100644 --- a/admin/actions/getJsonVoteHistory.php +++ b/admin/actions/getJsonVoteHistory.php @@ -13,7 +13,6 @@ $lienData[$TemplienData['id']] = $TemplienData; } - echo var_dump($lienData); $i = 0; while($VoteHistoryData = $VoteHistoryReq->fetch(PDO::FETCH_ASSOC)) diff --git a/admin/actions/getRecompenseList.php b/admin/actions/getRecompenseList.php index c5dc5b4c..91b1c71c 100644 --- a/admin/actions/getRecompenseList.php +++ b/admin/actions/getRecompenseList.php @@ -1,7 +1,7 @@ -verifPerm('PermsPanel', 'vote', 'recompenseAuto', 'actions', 'resetRecompense')) { +verifPerm('PermsPanel', 'vote', 'recompenseAuto', 'actions', 'editRecompense')) { require_once('./admin/donnees/configVoter.php'); ?>
- +
@@ -20,7 +20,7 @@ echo $donnees[$o]['valueType'].' votes'; else { - echo $donnees[$o]['valueType']; + echo $donnees[$o]['valueType']; if(((int)$donnees[$o]['valueType'])==1) { echo 'ier'; } else { @@ -49,7 +49,7 @@ echo substr($f, 0, -5); } ?> - + Copie(); + } + header('Location: admin.php?page=theme&upload='.$verif); + exit(); } } -header('Location: ?page=theme'); +header('Location: admin.php?page=theme&upload=5'); +exit(); + ?> \ No newline at end of file diff --git a/admin/actions/postNavRap.php b/admin/actions/postNavRap.php index f8098d23..0a8c199c 100644 --- a/admin/actions/postNavRap.php +++ b/admin/actions/postNavRap.php @@ -9,9 +9,15 @@ $copie = new Copie('theme/upload/navRap/', $_FILES['img'], 10000000, $types, 2000, 2000); $verif = $copie->Verification(); - if($verif == 4) + { $copie->Copie(); + } + + header('Location: admin.php?page=slidemini&upload='.$verif); + exit(); } } +header('Location: admin.php?page=slidemini&upload=5'); +exit(); ?> \ No newline at end of file diff --git a/admin/actions/postSlider.php b/admin/actions/postSlider.php deleted file mode 100644 index 1484d573..00000000 --- a/admin/actions/postSlider.php +++ /dev/null @@ -1,17 +0,0 @@ -verifPerm('PermsPanel', 'home', 'actions', 'uploadSlider')) { - if(isset($_FILES['img']) and !empty($_FILES['img'])) - { - include_once('controleur/upload.class.php'); - - $types = Array('png', 'jpg', 'gif'); - - $copie = new Copie('theme/upload/slider/', $_FILES['img'], 10000000, $types, 2000, 2000); - $verif = $copie->Verification(); - - - if($verif == 4) - $copie->Copie(); - } -} -?> \ No newline at end of file diff --git a/admin/actions/supprMini.php b/admin/actions/supprMini.php index 1a723c24..a631a095 100644 --- a/admin/actions/supprMini.php +++ b/admin/actions/supprMini.php @@ -2,22 +2,36 @@ if(isset($_GET['id']) && $_Permission_->verifPerm('PermsPanel', 'home', 'actions','editMiniature')) { - $id = intval(htmlentities($_GET['id'])); - $tmp = array( - 'Infos' => array(), - 'Slider' => $lectureAccueil['Slider'], - 'SliderTitre' => $lectureAccueil['SliderTitre'] - ); - $i = 1; + $lectureAccueil = new Lire('modele/config/accueil.yml'); + $lectureAccueil = $lectureAccueil->GetTableau(); + + $id = intval($_GET['id']); + + $flag = 0; + $last = -1; + foreach($lectureAccueil['Infos'] as $key => $value) { - if($key != $id) + + if(intval($key) == $id) { - $tmp['Infos'][strval($i)]['message'] = $value['message']; - $tmp['Infos'][strval($i)]['image'] = $value['image']; - $tmp['Infos'][strval($i)]['lien'] = $value['lien']; - $i++; + $flag = 1; + continue; } + if($flag == 1 | $flag == 2) { + $flag = 2; + $lectureAccueil['Infos'][intval($key) - 1]['message'] = $lectureAccueil['Infos'][$key]['message']; + $lectureAccueil['Infos'][intval($key) - 1]['image'] = $lectureAccueil['Infos'][$key]['image']; + $lectureAccueil['Infos'][intval($key) - 1]['lien'] = $lectureAccueil['Infos'][$key]['lien']; + $lectureAccueil['Infos'][intval($key) - 1]['type'] = $lectureAccueil['Infos'][$key]['type']; + $last = intval($key); + } + } + + if($flag == 1) { + unset($lectureAccueil['Infos'][$id]); + } else if($flag == 2) { + unset($lectureAccueil['Infos'][$last]); } - $ecriture = new Ecrire('modele/config/accueil.yml', $tmp); + $ecriture = new Ecrire('modele/config/accueil.yml', $lectureAccueil); } \ No newline at end of file diff --git a/admin/actions/supprRecAuto.php b/admin/actions/supprRecAuto.php index 9c785380..e34f0117 100644 --- a/admin/actions/supprRecAuto.php +++ b/admin/actions/supprRecAuto.php @@ -1,6 +1,6 @@ verifPerm('PermsPanel', 'vote', 'recompenseAuto', 'actions', 'resetRecompense')) +if($_Permission_->verifPerm('PermsPanel', 'vote', 'recompenseAuto', 'actions', 'editRecompense')) { if(isset($_GET['id'])) { diff --git a/admin/actions/supprUpload.php b/admin/actions/supprUpload.php new file mode 100644 index 00000000..9b013c4b --- /dev/null +++ b/admin/actions/supprUpload.php @@ -0,0 +1,6 @@ +verifPerm('PermsPanel', 'upload', 'manage')) { + +unlink('./theme/upload/panel/'.$_GET['file']); + +}?> \ No newline at end of file diff --git a/admin/assets/js/ckeditor.js b/admin/assets/js/ckeditor.js index 4160e5de..6ae5daf1 100644 --- a/admin/assets/js/ckeditor.js +++ b/admin/assets/js/ckeditor.js @@ -2,5 +2,5 @@ * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */ -(function(e){const t=e["fr"]=e["fr"]||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 sur %1","Align center":"Centrer","Align left":"Aligner à gauche","Align right":"Aligner à droite",Aquamarine:"Bleu vert",Big:"Grand",Black:"Noir","Block quote":"Citation",Blue:"Bleu","Blue marker":"Marqueur bleu",Bold:"Gras","Bulleted List":"Liste à puces",Cancel:"Annuler","Centered image":"Image centrée","Change image text alternative":"Changer le texte alternatif à l’image","Characters: %0":"Caractères : %0","Choose heading":"Choisir l'en-tête",Default:"Par défaut","Dim grey":"Gris pâle","Document colors":"Couleurs du document",Downloadable:"Fichier téléchargeable","Dropdown toolbar":"Barre d'outils dans un menu déroulant","Edit link":"Modifier le lien","Editor toolbar":"Barre d'outils de l'éditeur","Enter image caption":"Saisir la légende de l’image","Font Background Color":"Couleur d'arrière-plan","Font Color":"Couleur de police","Font Family":"Police","Font Size":"Taille de police","Full size image":"Image taille réelle",Green:"Vert","Green marker":"Marqueur vert","Green pen":"Crayon vert",Grey:"Gris",Heading:"En-tête","Heading 1":"Titre 1","Heading 2":"Titre 2","Heading 3":"Titre 3","Heading 4":"Titre 4","Heading 5":"Titre 5","Heading 6":"Titre 6",Highlight:"Surlignage","Horizontal line":"Ligne horizontale",Huge:"Enorme","Image resize list":"","Image toolbar":"Barre d'outils des images","image widget":"Objet image","Insert image":"Insérer une image","Insert media":"Insérer un média","Insert paragraph after block":"","Insert paragraph before block":"",Italic:"Italique",Justify:"Justifier","Left aligned image":"Image alignée à gauche","Light blue":"Bleu clair","Light green":"Vert clair","Light grey":"Gris clair",Link:"Lien","Link URL":"URL du lien","Media URL":"URL de média","media widget":"widget média",Next:"Suivant","Numbered List":"Liste numérotée","Open in a new tab":"Ouvrir dans un nouvel onglet","Open link in new tab":"Ouvrir le lien dans un nouvel onglet",Orange:"Orange",Original:"",Paragraph:"Paragraphe","Paste the media URL in the input.":"Coller l'URL du média","Pink marker":"Marqueur rose",Previous:"Précedent",Purple:"Violet",Red:"Rouge","Red pen":"Crayon rouge",Redo:"Restaurer","Remove color":"Enlever la couleur","Remove highlight":"Enlever le surlignage","Resize image":"","Resize image to %0":"","Resize image to the original size":"","Rich Text Editor":"Éditeur de texte enrichi","Rich Text Editor, %0":"Éditeur de texte enrichi, %0","Right aligned image":"Image alignée à droite",Save:"Enregistrer","Show more items":"Montrer plus d'éléments","Side image":"Image latérale",Small:"Petit","Text alignment":"Alignement du texte","Text alignment toolbar":"Barre d'outils d'alignement du texte","Text alternative":"Texte alternatif","Text highlight toolbar":"Barre d'outils du surlignage","The URL must not be empty.":"L'URL ne doit pas être vide.","This link has no URL":"Ce lien n'a pas d'URL","This media URL is not supported.":"Cette URL de média n'est pas supportée.",Tiny:"Minuscule","Tip: Paste the URL into the content to embed faster.":"Astuce : Copier l'URL du média dans le contenu pour l'insérer plus rapidement","To-do List":"Liste de tâches",Turquoise:"Turquoise",Underline:"Souligné",Undo:"Annuler",Unlink:"Supprimer le lien","Upload failed":"Échec de l'envoi","Upload in progress":"Téléchargement en cours",White:"Blanc","Widget toolbar":"Barre d'outils du widget","Words: %0":"Mots : %0",Yellow:"Jaune","Yellow marker":"Marqueur jaune"});t.getPluralForm=function(e){return e>1}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));(function e(t,i){if(typeof exports==="object"&&typeof module==="object")module.exports=i();else if(typeof define==="function"&&define.amd)define([],i);else if(typeof exports==="object")exports["ClassicEditor"]=i();else t["ClassicEditor"]=i()})(window,(function(){return function(e){var t={};function i(n){if(t[n]){return t[n].exports}var o=t[n]={i:n,l:false,exports:{}};e[n].call(o.exports,o,o.exports,i);o.l=true;return o.exports}i.m=e;i.c=t;i.d=function(e,t,n){if(!i.o(e,t)){Object.defineProperty(e,t,{enumerable:true,get:n})}};i.r=function(e){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})};i.t=function(e,t){if(t&1)e=i(e);if(t&8)return e;if(t&4&&typeof e==="object"&&e&&e.__esModule)return e;var n=Object.create(null);i.r(n);Object.defineProperty(n,"default",{enumerable:true,value:e});if(t&2&&typeof e!="string")for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n};i.n=function(e){var t=e&&e.__esModule?function t(){return e["default"]}:function t(){return e};i.d(t,"a",t);return t};i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};i.p="";return i(i.s=104)}([function(e,t,i){"use strict";i.d(t,"b",(function(){return o}));i.d(t,"a",(function(){return r}));const n="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html";class o extends Error{constructor(e,t,i){e=r(e);if(i){e+=" "+JSON.stringify(i)}super(e);this.name="CKEditorError";this.context=t;this.data=i}is(e){return e==="CKEditorError"}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError")){throw e}const i=new o(e.message,t);i.stack=e.stack;throw i}}function r(e){const t=e.match(/^([^:]+):/);if(!t){return e}return e+` Read more: ${n}#error-${t[1]}\n`}},function(e,t,i){"use strict";var n=function e(){var t;return function e(){if(typeof t==="undefined"){t=Boolean(window&&document&&document.all&&!window.atob)}return t}}();var o=function e(){var t={};return function e(i){if(typeof t[i]==="undefined"){var n=document.querySelector(i);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement){try{n=n.contentDocument.head}catch(e){n=null}}t[i]=n}return t[i]}}();var r=[];function s(e){var t=-1;for(var i=0;i: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,i){var n=i(1);var o=i(20);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(22);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(24);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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}:root{--ck-dropdown-arrow-size:calc(0.5*var(--ck-icon-size))}.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,i){var n=i(1);var o=i(26);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(28);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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(-1*var(--ck-tooltip-arrow-size));transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after{top:calc(-1*var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_n{top:calc(-1*var(--ck-tooltip-arrow-size));transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(-1*var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}'},function(e,t,i){var n=i(1);var o=i(30);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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(-1*var(--ck-spacing-small));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(-1*var(--ck-spacing-small));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,i){var n=i(1);var o=i(32);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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(0.2*var(--ck-line-height-base)*var(--ck-font-size-base)) calc(0.4*var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(1.2*var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on: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,i){var n=i(1);var o=i(34);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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) - 2*var(--ck-switch-button-toggle-spacing))}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(2*var(--ck-spacing-large))}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(2*var(--ck-spacing-large))}.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(0.5*var(--ck-border-radius))}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition: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(-1*var(--ck-switch-button-translation)))}"},function(e,t,i){var n=i(1);var o=i(36);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(38);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(40);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(42);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(44);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}"},function(e,t,i){var n=i(1);var o=i(46);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(48);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(50);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(53);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(55);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(o,r);e.exports=o.locals||{}},function(e,t){e.exports=":root{--ck-highlight-marker-yellow:#fdfd77;--ck-highlight-marker-green:#62f962;--ck-highlight-marker-pink:#fc7899;--ck-highlight-marker-blue:#72ccfd;--ck-highlight-pen-red:#e71313;--ck-highlight-pen-green:#128a00}.ck-content .marker-yellow{background-color:var(--ck-highlight-marker-yellow)}.ck-content .marker-green{background-color:var(--ck-highlight-marker-green)}.ck-content .marker-pink{background-color:var(--ck-highlight-marker-pink)}.ck-content .marker-blue{background-color:var(--ck-highlight-marker-blue)}.ck-content .pen-red{color:var(--ck-highlight-pen-red);background-color:transparent}.ck-content .pen-green{color:var(--ck-highlight-pen-green);background-color:transparent}"},function(e,t,i){var n=i(1);var o=i(57);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(-1*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(-1*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.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(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.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(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.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(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.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(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}'},function(e,t,i){var n=i(1);var o=i(59);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck-editor__editable .ck-horizontal-line{display:flow-root}.ck-content hr{margin:15px 0;height:4px;background:#dedede;border:0}"},function(e,t,i){var n=i(1);var o=i(61);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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(-0.5*var(--ck-widget-outline-thickness));left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(-0.5*var(--ck-widget-outline-thickness));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(-1*var(--ck-widget-outline-thickness));right:calc(-1*var(--ck-widget-outline-thickness))}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(-1*var(--ck-widget-outline-thickness) - 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(-1*var(--ck-widget-outline-thickness) - 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,i){var n=i(1);var o=i(63);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(65);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(67);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(69);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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(0.8*var(--ck-input-text-width))}.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,i){var n=i(1);var o=i(71);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(73);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(75);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(77);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(79);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(81);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(83);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(85);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(87);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(89);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(91);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(93);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form{padding:var(--ck-spacing-standard)}.ck.ck-link-form:focus{outline:none}[dir=ltr] .ck.ck-link-form>:not(:first-child),[dir=rtl] .ck.ck-link-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-link-form .ck-labeled-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-link-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin-left:0}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"},function(e,t,i){var n=i(1);var o=i(95);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions{padding:var(--ck-spacing-standard)}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}.ck.ck-link-actions:focus{outline:none}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview):first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview):last-of-type{border-right:1px solid var(--ck-color-base-border)}}"},function(e,t,i){var n=i(1);var o=i(97);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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(3*var(--ck-spacing-standard));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,i){var n=i(1);var o=i(99);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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(0.8*var(--ck-input-text-width))}.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,i){var n=i(1);var o=i(101);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(103);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(o,r);e.exports=o.locals||{}},function(e,t){e.exports=':root{--ck-todo-list-checkmark-size:16px}.ck-content .todo-list{list-style:none}.ck-content .todo-list li{margin-bottom:5px}.ck-content .todo-list li .todo-list{margin-top:5px}.ck-content .todo-list .todo-list__label>input{-webkit-appearance:none;display:inline-block;position:relative;width:var(--ck-todo-list-checkmark-size);height:var(--ck-todo-list-checkmark-size);vertical-align:middle;border:0;left:-25px;margin-right:-15px;right:0;margin-left:0}.ck-content .todo-list .todo-list__label>input:before{display:block;position:absolute;box-sizing:border-box;content:"";width:100%;height:100%;border:1px solid #333;border-radius:2px;transition:box-shadow .25s ease-in-out,background .25s ease-in-out,border .25s ease-in-out}.ck-content .todo-list .todo-list__label>input:after{display:block;position:absolute;box-sizing:content-box;pointer-events:none;content:"";left:calc(var(--ck-todo-list-checkmark-size)/3);top:calc(var(--ck-todo-list-checkmark-size)/5.3);width:calc(var(--ck-todo-list-checkmark-size)/5.3);height:calc(var(--ck-todo-list-checkmark-size)/2.6);border-left:0 solid transparent;border-bottom:calc(var(--ck-todo-list-checkmark-size)/8) solid transparent;border-right:calc(var(--ck-todo-list-checkmark-size)/8) solid transparent;border-top:0 solid transparent;transform:rotate(45deg)}.ck-content .todo-list .todo-list__label>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-content .todo-list .todo-list__label>input[checked]:after{border-color:#fff}.ck-content .todo-list .todo-list__label .todo-list__label__description{vertical-align:middle}[dir=rtl] .todo-list .todo-list__label>input{left:0;margin-right:0;right:-25px;margin-left:-15px}.ck-editor__editable .todo-list .todo-list__label>input{cursor:pointer}.ck-editor__editable .todo-list .todo-list__label>input:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}'},function(e,t,i){"use strict";i.r(t);var n=i(3);var o=n["a"].Symbol;var r=o;var s=Object.prototype;var a=s.hasOwnProperty;var c=s.toString;var l=r?r.toStringTag:undefined;function d(e){var t=a.call(e,l),i=e[l];try{e[l]=undefined;var n=true}catch(e){}var o=c.call(e);if(n){if(t){e[l]=i}else{delete e[l]}}return o}var u=d;var h=Object.prototype;var f=h.toString;function m(e){return f.call(e)}var g=m;var p="[object Null]",b="[object Undefined]";var w=r?r.toStringTag:undefined;function k(e){if(e==null){return e===undefined?b:p}return w&&w in Object(e)?u(e):g(e)}var _=k;function v(e,t){return function(i){return e(t(i))}}var y=v;var x=y(Object.getPrototypeOf,Object);var A=x;function T(e){return e!=null&&typeof e=="object"}var C=T;var P="[object Object]";var E=Function.prototype,S=Object.prototype;var M=E.toString;var I=S.hasOwnProperty;var N=M.call(Object);function O(e){if(!C(e)||_(e)!=P){return false}var t=A(e);if(t===null){return true}var i=I.call(t,"constructor")&&t.constructor;return typeof i=="function"&&i instanceof i&&M.call(i)==N}var z=O;function R(){this.__data__=[];this.size=0}var L=R;function D(e,t){return e===t||e!==e&&t!==t}var V=D;function j(e,t){var i=e.length;while(i--){if(V(e[i][0],t)){return i}}return-1}var B=j;var F=Array.prototype;var H=F.splice;function U(e){var t=this.__data__,i=B(t,e);if(i<0){return false}var n=t.length-1;if(i==n){t.pop()}else{H.call(t,i,1)}--this.size;return true}var W=U;function q(e){var t=this.__data__,i=B(t,e);return i<0?undefined:t[i][1]}var $=q;function Y(e){return B(this.__data__,e)>-1}var G=Y;function K(e,t){var i=this.__data__,n=B(i,e);if(n<0){++this.size;i.push([e,t])}else{i[n][1]=t}return this}var Q=K;function J(e){var t=-1,i=e==null?0:e.length;this.clear();while(++t-1&&e%1==0&&e-1&&e%1==0&&e<=ti}var ni=ii;var oi="[object Arguments]",ri="[object Array]",si="[object Boolean]",ai="[object Date]",ci="[object Error]",li="[object Function]",di="[object Map]",ui="[object Number]",hi="[object Object]",fi="[object RegExp]",mi="[object Set]",gi="[object String]",pi="[object WeakMap]";var bi="[object ArrayBuffer]",wi="[object DataView]",ki="[object Float32Array]",_i="[object Float64Array]",vi="[object Int8Array]",yi="[object Int16Array]",xi="[object Int32Array]",Ai="[object Uint8Array]",Ti="[object Uint8ClampedArray]",Ci="[object Uint16Array]",Pi="[object Uint32Array]";var Ei={};Ei[ki]=Ei[_i]=Ei[vi]=Ei[yi]=Ei[xi]=Ei[Ai]=Ei[Ti]=Ei[Ci]=Ei[Pi]=true;Ei[oi]=Ei[ri]=Ei[bi]=Ei[si]=Ei[wi]=Ei[ai]=Ei[ci]=Ei[li]=Ei[di]=Ei[ui]=Ei[hi]=Ei[fi]=Ei[mi]=Ei[gi]=Ei[pi]=false;function Si(e){return C(e)&&ni(e.length)&&!!Ei[_(e)]}var Mi=Si;function Ii(e){return function(t){return e(t)}}var Ni=Ii;var Oi=i(5);var zi=Oi["a"]&&Oi["a"].isTypedArray;var Ri=zi?Ni(zi):Mi;var Li=Ri;var Di=Object.prototype;var Vi=Di.hasOwnProperty;function ji(e,t){var i=Kt(e),n=!i&&Yt(e),o=!i&&!n&&Object(Qt["a"])(e),r=!i&&!n&&!o&&Li(e),s=i||n||o||r,a=s?jt(e.length,String):[],c=a.length;for(var l in e){if((t||Vi.call(e,l))&&!(s&&(l=="length"||o&&(l=="offset"||l=="parent")||r&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||ei(l,c)))){a.push(l)}}return a}var Bi=ji;var Fi=Object.prototype;function Hi(e){var t=e&&e.constructor,i=typeof t=="function"&&t.prototype||Fi;return e===i}var Ui=Hi;var Wi=y(Object.keys,Object);var qi=Wi;var $i=Object.prototype;var Yi=$i.hasOwnProperty;function Gi(e){if(!Ui(e)){return qi(e)}var t=[];for(var i in Object(e)){if(Yi.call(e,i)&&i!="constructor"){t.push(i)}}return t}var Ki=Gi;function Qi(e){return e!=null&&ni(e.length)&&!me(e)}var Ji=Qi;function Zi(e){return Ji(e)?Bi(e):Ki(e)}var Xi=Zi;function en(e,t){return e&&Dt(t,Xi(t),e)}var tn=en;function nn(e){var t=[];if(e!=null){for(var i in Object(e)){t.push(i)}}return t}var on=nn;var rn=Object.prototype;var sn=rn.hasOwnProperty;function an(e){if(!ce(e)){return on(e)}var t=Ui(e),i=[];for(var n in e){if(!(n=="constructor"&&(t||!sn.call(e,n)))){i.push(n)}}return i}var cn=an;function ln(e){return Ji(e)?Bi(e,true):cn(e)}var dn=ln;function un(e,t){return e&&Dt(t,dn(t),e)}var hn=un;var fn=i(8);function mn(e,t){var i=-1,n=e.length;t||(t=Array(n));while(++i{this._setToTarget(e,n,t[n],i)})}}function Qr(e){return $r(e,Jr)}function Jr(e){return Gr(e)?e:undefined}function Zr(){return function e(){e.called=true}}var Xr=Zr;class es{constructor(e,t){this.source=e;this.name=t;this.path=[];this.stop=Xr();this.off=Xr()}}const ts=new Array(256).fill().map((e,t)=>("0"+t.toString(16)).slice(-2));function is(){const e=Math.random()*4294967296>>>0;const t=Math.random()*4294967296>>>0;const i=Math.random()*4294967296>>>0;const n=Math.random()*4294967296>>>0;return"e"+ts[e>>0&255]+ts[e>>8&255]+ts[e>>16&255]+ts[e>>24&255]+ts[t>>0&255]+ts[t>>8&255]+ts[t>>16&255]+ts[t>>24&255]+ts[i>>0&255]+ts[i>>8&255]+ts[i>>16&255]+ts[i>>24&255]+ts[n>>0&255]+ts[n>>8&255]+ts[n>>16&255]+ts[n>>24&255]}const ns={get(e){if(typeof e!="number"){return this[e]||this.normal}else{return e}},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};var os=ns;var rs=i(6);var ss=i(0);const as=Symbol("listeningTo");const cs=Symbol("emitterId");const ls={on(e,t,i={}){this.listenTo(this,e,t,i)},once(e,t,i){let n=false;const o=function(e,...i){if(!n){n=true;e.off();t.call(this,e,...i)}};this.listenTo(this,e,o,i)},off(e,t){this.stopListening(this,e,t)},listenTo(e,t,i,n={}){let o,r;if(!this[as]){this[as]={}}const s=this[as];if(!fs(e)){hs(e)}const a=fs(e);if(!(o=s[a])){o=s[a]={emitter:e,callbacks:{}}}if(!(r=o.callbacks[t])){r=o.callbacks[t]=[]}r.push(i);ps(e,t);const c=bs(e,t);const l=os.get(n.priority);const d={callback:i,priority:l};for(const e of c){let t=false;for(let i=0;i{if(!this._delegations){this._delegations=new Map}e.forEach(e=>{const n=this._delegations.get(e);if(!n){this._delegations.set(e,new Map([[t,i]]))}else{n.set(t,i)}})}}},stopDelegating(e,t){if(!this._delegations){return}if(!e){this._delegations.clear()}else if(!t){this._delegations.delete(e)}else{const i=this._delegations.get(e);if(i){i.delete(t)}}}};var ds=ls;function us(e,t){if(e[as]&&e[as][t]){return e[as][t].emitter}return null}function hs(e,t){if(!e[cs]){e[cs]=t||is()}}function fs(e){return e[cs]}function ms(e){if(!e._events){Object.defineProperty(e,"_events",{value:{}})}return e._events}function gs(){return{callbacks:[],childEvents:[]}}function ps(e,t){const i=ms(e);if(i[t]){return}let n=t;let o=null;const r=[];while(n!==""){if(i[n]){break}i[n]=gs();r.push(i[n]);if(o){i[n].childEvents.push(o)}o=n;n=n.substr(0,n.lastIndexOf(":"))}if(n!==""){for(const e of r){e.callbacks=i[n].callbacks.slice()}i[n].childEvents.push(o)}}function bs(e,t){const i=ms(e)[t];if(!i){return[]}let n=[i.callbacks];for(let t=0;t-1){return ws(e,t.substr(0,t.lastIndexOf(":")))}else{return null}}return i.callbacks}function ks(e,t,i){for(let[n,o]of e){if(!o){o=t.name}else if(typeof o=="function"){o=o(t.name)}const e=new es(t.source,o);e.path=[...t.path];n.fire(e,...i)}}function _s(e,t,i){const n=bs(e,t);for(const e of n){for(let t=0;t{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach(i=>{if(i in e.prototype){return}const n=Object.getOwnPropertyDescriptor(t,i);n.enumerable=false;Object.defineProperty(e.prototype,i,n)})})}class xs{constructor(e={},t={}){const i=vs(e);if(!i){t=e}this._items=[];this._itemMap=new Map;this._idProperty=t.idProperty||"id";this._bindToExternalToInternalMap=new WeakMap;this._bindToInternalToExternalMap=new WeakMap;this._skippedIndexesFromExternal=[];if(i){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(t===undefined){t=this._items.length}else if(t>this._items.length||t<0){throw new ss["b"]("collection-add-item-invalid-index",this)}for(let i=0;i{this._setUpBindToBinding(t=>new e(t))},using:e=>{if(typeof e=="function"){this._setUpBindToBinding(t=>e(t))}else{this._setUpBindToBinding(t=>t[e])}}}}_setUpBindToBinding(e){const t=this._bindToCollection;const i=(i,n,o)=>{const r=t._bindToCollection==this;const s=t._bindToInternalToExternalMap.get(n);if(r&&s){this._bindToExternalToInternalMap.set(n,s);this._bindToInternalToExternalMap.set(s,n)}else{const i=e(n);if(!i){this._skippedIndexesFromExternal.push(o);return}let r=o;for(const e of this._skippedIndexesFromExternal){if(o>e){r--}}for(const e of t._skippedIndexesFromExternal){if(r>=e){r++}}this._bindToExternalToInternalMap.set(n,i);this._bindToInternalToExternalMap.set(i,n);this.add(i,r);for(let e=0;e{const n=this._bindToExternalToInternalMap.get(t);if(n){this.remove(n)}this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((e,t)=>{if(it){e.push(t)}return e},[])})}_getItemIdBeforeAdding(e){const t=this._idProperty;let i;if(t in e){i=e[t];if(typeof i!="string"){throw new ss["b"]("collection-add-invalid-id",this)}if(this.get(i)){throw new ss["b"]("collection-add-item-already-exists",this)}}else{e[t]=i=is()}return i}_remove(e){let t,i,n;let o=false;const r=this._idProperty;if(typeof e=="string"){i=e;n=this._itemMap.get(i);o=!n;if(n){t=this._items.indexOf(n)}}else if(typeof e=="number"){t=e;n=this._items[t];o=!n;if(n){i=n[r]}}else{n=e;i=n[r];t=this._items.indexOf(n);o=t==-1||!this._itemMap.get(i)}if(o){throw new ss["b"]("collection-remove-404: Item not found.",this)}this._items.splice(t,1);this._itemMap.delete(i);const s=this._bindToInternalToExternalMap.get(n);this._bindToInternalToExternalMap.delete(n);this._bindToExternalToInternalMap.delete(s);this.fire("remove",n,t);return[n,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}ys(xs,ds);class As{constructor(e,t=[],i=[]){this._context=e;this._plugins=new Map;this._availablePlugins=new Map;for(const e of t){if(e.pluginName){this._availablePlugins.set(e.pluginName,e)}}this._contextPlugins=new Map;for(const[e,t]of i){this._contextPlugins.set(e,t);this._contextPlugins.set(t,e);if(e.pluginName){this._availablePlugins.set(e.pluginName,e)}}}*[Symbol.iterator](){for(const e of this._plugins){if(typeof e[0]=="function"){yield e}}}get(e){const t=this._plugins.get(e);if(!t){const t="plugincollection-plugin-not-loaded: The requested plugin is not loaded.";let i=e;if(typeof e=="function"){i=e.pluginName||e.name}throw new ss["b"](t,this._context,{plugin:i})}return t}has(e){return this._plugins.has(e)}init(e,t=[]){const i=this;const n=this._context;const o=new Set;const r=[];const s=m(e);const a=m(t);const c=f(e);if(c){const e="plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.";console.error(Object(ss["a"])(e),{plugins:c});return Promise.reject(new ss["b"](e,n,{plugins:c}))}return Promise.all(s.map(l)).then(()=>d(r,"init")).then(()=>d(r,"afterInit")).then(()=>r);function l(e){if(a.includes(e)){return}if(i._plugins.has(e)||o.has(e)){return}return u(e).catch(t=>{console.error(Object(ss["a"])("plugincollection-load: It was not possible to load the plugin."),{plugin:e});throw t})}function d(e,t){return e.reduce((e,n)=>{if(!n[t]){return e}if(i._contextPlugins.has(n)){return e}return e.then(n[t].bind(n))},Promise.resolve())}function u(e){return new Promise(s=>{o.add(e);if(e.requires){e.requires.forEach(i=>{const o=h(i);if(e.isContextPlugin&&!o.isContextPlugin){throw new ss["b"]("plugincollection-context-required: Context plugin can not require plugin which is not a context plugin",null,{plugin:o.name,requiredBy:e.name})}if(t.includes(o)){throw new ss["b"]("plugincollection-required: Cannot load a plugin because one of its dependencies is listed in"+"the `removePlugins` option.",n,{plugin:o.name,requiredBy:e.name})}l(o)})}const a=i._contextPlugins.get(e)||new e(n);i._add(e,a);r.push(a);s()})}function h(e){if(typeof e=="function"){return e}return i._availablePlugins.get(e)}function f(e){const t=[];for(const i of e){if(!h(i)){t.push(i)}}return t.length?t:null}function m(e){return e.map(e=>h(e)).filter(e=>!!e)}}destroy(){const e=[];for(const[,t]of this){if(typeof t.destroy=="function"&&!this._contextPlugins.has(t)){e.push(t.destroy())}}return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const i=e.pluginName;if(!i){return}if(this._plugins.has(i)){throw new ss["b"]("plugincollection-plugin-name-conflict: Two plugins with the same name were loaded.",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e})}this._plugins.set(i,t)}}ys(As,ds);if(!window.CKEDITOR_TRANSLATIONS){window.CKEDITOR_TRANSLATIONS={}}function Ts(e,t,i){if(!window.CKEDITOR_TRANSLATIONS[e]){window.CKEDITOR_TRANSLATIONS[e]={}}const n=window.CKEDITOR_TRANSLATIONS[e];n.dictionary=n.dictionary||{};n.getPluralForm=i||n.getPluralForm;Object.assign(n.dictionary,t)}function Cs(e,t,i=1){if(typeof i!=="number"){throw new ss["b"]("translation-service-quantity-not-a-number: Expecting `quantity` to be a number.",null,{quantity:i})}const n=Ss();if(n===1){e=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]}const o=t.id||t.string;if(n===0||!Es(e,o)){if(i!==1){return t.plural}return t.string}const r=window.CKEDITOR_TRANSLATIONS[e].dictionary;const s=window.CKEDITOR_TRANSLATIONS[e].getPluralForm||(e=>e===1?0:1);if(typeof r[o]==="string"){return r[o]}const a=Number(s(i));return r[o][a]}function Ps(){window.CKEDITOR_TRANSLATIONS={}}function Es(e,t){return!!window.CKEDITOR_TRANSLATIONS[e]&&!!window.CKEDITOR_TRANSLATIONS[e].dictionary[t]}function Ss(){return Object.keys(window.CKEDITOR_TRANSLATIONS).length}const Ms=["ar","fa","he","ku","ug"];class Is{constructor(e={}){this.uiLanguage=e.uiLanguage||"en";this.contentLanguage=e.contentLanguage||this.uiLanguage;this.uiLanguageDirection=Os(this.uiLanguage);this.contentLanguageDirection=Os(this.contentLanguage);this.t=(e,t)=>this._t(e,t)}get language(){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.");return this.uiLanguage}_t(e,t=[]){if(!Array.isArray(t)){t=[t]}if(typeof e==="string"){e={string:e}}const i=!!e.plural;const n=i?t[0]:1;const o=Cs(this.uiLanguage,e,n);return Ns(o,t)}}function Ns(e,t){return e.replace(/%(\d+)/g,(e,i)=>ie.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner){throw new ss["b"]("context-addEditor-private-context: Cannot add multiple editors to the context which is created by the editor.")}this.editors.add(e);if(t){this._contextOwner=e}}_removeEditor(e){if(this.editors.has(e)){this.editors.remove(e)}if(this._contextOwner===e){return this.destroy()}return Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names()){if(!["plugins","removePlugins","extraPlugins"].includes(t)){e[t]=this.config.get(t)}}return e}static create(e){return new Promise(t=>{const i=new this(e);t(i.initPlugins().then(()=>i))})}}function Rs(e,t){const i=Math.min(e.length,t.length);for(let n=0;ne.data.length){throw new ss["b"]("view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.",this)}if(i<0||t+i>e.data.length){throw new ss["b"]("view-textproxy-wrong-length: Given length value is incorrect.",this)}this.data=e.data.substring(t,t+i);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 e==="$textProxy"||e==="view:$textProxy"||e==="textProxy"||e==="view:textProxy"}getAncestors(e={includeSelf:false,parentFirst:false}){const t=[];let i=e.includeSelf?this.textNode:this.parent;while(i!==null){t[e.parentFirst?"push":"unshift"](i);i=i.parent}return t}}function Hs(e){const t=new Map;for(const i in e){t.set(i,e[i])}return t}function Us(e){if(vs(e)){return new Map(e)}else{return Hs(e)}}class Ws{constructor(...e){this._patterns=[];this.add(...e)}add(...e){for(let t of e){if(typeof t=="string"||t instanceof RegExp){t={name:t}}if(t.classes&&(typeof t.classes=="string"||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 i=qs(t,e);if(i){return{element:t,pattern:e,match:i}}}}return null}matchAll(...e){const t=[];for(const i of e){for(const e of this._patterns){const n=qs(i,e);if(n){t.push({element:i,pattern:e,match:n})}}}return t.length>0?t:null}getElementName(){if(this._patterns.length!==1){return null}const e=this._patterns[0];const t=e.name;return typeof e!="function"&&t&&!(t instanceof RegExp)?t:null}}function qs(e,t){if(typeof t=="function"){return t(e)}const i={};if(t.name){i.name=$s(t.name,e.name);if(!i.name){return null}}if(t.attributes){i.attributes=Ys(t.attributes,e);if(!i.attributes){return null}}if(t.classes){i.classes=Gs(t.classes,e);if(!i.classes){return false}}if(t.styles){i.styles=Ks(t.styles,e);if(!i.styles){return false}}return i}function $s(e,t){if(e instanceof RegExp){return e.test(t)}return e===t}function Ys(e,t){const i=[];for(const n in e){const o=e[n];if(t.hasAttribute(n)){const e=t.getAttribute(n);if(o===true){i.push(n)}else if(o instanceof RegExp){if(o.test(e)){i.push(n)}else{return null}}else if(e===o){i.push(n)}else{return null}}else{return null}}return i}function Gs(e,t){const i=[];for(const n of e){if(n instanceof RegExp){const e=t.getClassNames();for(const t of e){if(n.test(t)){i.push(t)}}if(i.length===0){return null}}else if(t.hasClass(n)){i.push(n)}else{return null}}return i}function Ks(e,t){const i=[];for(const n in e){const o=e[n];if(t.hasStyle(n)){const e=t.getStyle(n);if(o instanceof RegExp){if(o.test(e)){i.push(n)}else{return null}}else if(e===o){i.push(n)}else{return null}}else{return null}}return i}var Qs="[object Symbol]";function Js(e){return typeof e=="symbol"||C(e)&&_(e)==Qs}var Zs=Js;var Xs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ea=/^\w*$/;function ta(e,t){if(Kt(e)){return false}var i=typeof e;if(i=="number"||i=="symbol"||i=="boolean"||e==null||Zs(e)){return true}return ea.test(e)||!Xs.test(e)||t!=null&&e in Object(t)}var ia=ta;var na="Expected a function";function oa(e,t){if(typeof e!="function"||t!=null&&typeof t!="function"){throw new TypeError(na)}var i=function(){var n=arguments,o=t?t.apply(this,n):n[0],r=i.cache;if(r.has(o)){return r.get(o)}var s=e.apply(this,n);i.cache=r.set(o,s)||r;return s};i.cache=new(oa.Cache||_t);return i}oa.Cache=_t;var ra=oa;var sa=500;function aa(e){var t=ra(e,(function(e){if(i.size===sa){i.clear()}return e}));var i=t.cache;return t}var ca=aa;var la=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var da=/\\(\\)?/g;var ua=ca((function(e){var t=[];if(e.charCodeAt(0)===46){t.push("")}e.replace(la,(function(e,i,n,o){t.push(n?o.replace(da,"$1"):i||e)}));return t}));var ha=ua;function fa(e,t){var i=-1,n=e==null?0:e.length,o=Array(n);while(++io?0:o+t}i=i>o?o:i;if(i<0){i+=o}o=t>i?0:i-t>>>0;t>>>=0;var r=Array(o);while(++n0){if(++t>=mc){return arguments[0]}}else{t=0}return e.apply(undefined,arguments)}}var wc=bc;var kc=wc(fc);var _c=kc;function vc(e,t){return _c(lc(e,t,oc),e+"")}var yc=vc;function xc(e,t,i){if(!ce(i)){return false}var n=typeof t;if(n=="number"?Ji(i)&&ei(t,i.length):n=="string"&&t in i){return V(i[t],e)}return false}var Ac=xc;function Tc(e){return yc((function(t,i){var n=-1,o=i.length,r=o>1?i[o-1]:undefined,s=o>2?i[2]:undefined;r=e.length>3&&typeof r=="function"?(o--,r):undefined;if(s&&Ac(i[0],i[1],s)){r=o<3?undefined:r;o=1}t=Object(t);while(++nt===e);return Array.isArray(i)}set(e,t){if(ce(e)){for(const[t,i]of Object.entries(e)){this._styleProcessor.toNormalizedForm(t,i,this._styles)}}else{this._styleProcessor.toNormalizedForm(e,t,this._styles)}}remove(e){const t=Lc(e);Va(this._styles,t);delete this._styles[e];this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){if(this.isEmpty){return""}return this._getStylesEntries().map(e=>e.join(":")).sort().join(";")+";"}getAsString(e){if(this.isEmpty){return}if(this._styles[e]&&!ce(this._styles[e])){return this._styles[e]}const t=this._styleProcessor.getReducedForm(e,this._styles);const i=t.find(([t])=>t===e);if(Array.isArray(i)){return i[1]}}getStyleNames(){if(this.isEmpty){return[]}const e=this._getStylesEntries();return e.map(([e])=>e)}clear(){this._styles={}}_getStylesEntries(){const e=[];const t=Object.keys(this._styles);for(const i of t){e.push(...this._styleProcessor.getReducedForm(i,this._styles))}return e}_cleanEmptyObjectsOnPath(e){const t=e.split(".");const i=t.length>1;if(!i){return}const n=t.splice(0,t.length-1).join(".");const o=Ba(this._styles,n);if(!o){return}const r=!Array.from(Object.keys(o)).length;if(r){this.remove(n)}}}class zc{constructor(){this._normalizers=new Map;this._extractors=new Map;this._reducers=new Map;this._consumables=new Map}toNormalizedForm(e,t,i){if(ce(t)){Dc(i,Lc(e),t);return}if(this._normalizers.has(e)){const n=this._normalizers.get(e);const{path:o,value:r}=n(t);Dc(i,o,r)}else{Dc(i,e,t)}}getNormalized(e,t){if(!e){return Ec({},t)}if(t[e]!==undefined){return t[e]}if(this._extractors.has(e)){const i=this._extractors.get(e);if(typeof i==="string"){return Ba(t,i)}const n=i(e,t);if(n){return n}}return Ba(t,Lc(e))}getReducedForm(e,t){const i=this.getNormalized(e,t);if(i===undefined){return[]}if(this._reducers.has(e)){const t=this._reducers.get(e);return t(i)}return[[e,i]]}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 i of t){this._mapStyleNames(i,[e])}}_mapStyleNames(e,t){if(!this._consumables.has(e)){this._consumables.set(e,[])}this._consumables.get(e).push(...t)}}function Rc(e){let t=null;let i=0;let n=0;let o=null;const r=new Map;if(e===""){return r}if(e.charAt(e.length-1)!=";"){e=e+";"}for(let s=0;s0){yield"class"}if(!this._styles.isEmpty){yield"style"}yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries();if(this._classes.size>0){yield["class",this.getAttribute("class")]}if(!this._styles.isEmpty){yield["style",this.getAttribute("style")]}}getAttribute(e){if(e=="class"){if(this._classes.size>0){return[...this._classes].join(" ")}return undefined}if(e=="style"){const e=this._styles.toString();return e==""?undefined:e}return this._attrs.get(e)}hasAttribute(e){if(e=="class"){return this._classes.size>0}if(e=="style"){return!this._styles.isEmpty}return this._attrs.has(e)}isSimilar(e){if(!(e instanceof Vc)){return false}if(this===e){return true}if(this.name!=e.name){return false}if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size){return false}for(const[t,i]of this._attrs){if(!e._attrs.has(t)||e._attrs.get(t)!==i){return false}}for(const t of this._classes){if(!e._classes.has(t)){return false}}for(const t of this._styles.getStyleNames()){if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t)){return false}}return true}hasClass(...e){for(const t of e){if(!this._classes.has(t)){return false}}return true}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 false}}return true}findAncestor(...e){const t=new Ws(...e);let i=this.parent;while(i){if(t.match(i)){return i}i=i.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(",");const t=this._styles.toString();const i=Array.from(this._attrs).map(e=>`${e[0]}="${e[1]}"`).sort().join(" ");return this.name+(e==""?"":` class="${e}"`)+(!t?"":` style="${t}"`)+(i==""?"":` ${i}`)}_clone(e=false){const t=[];if(e){for(const i of this.getChildren()){t.push(i._clone(e))}}const i=new this.constructor(this.document,this.name,this._attrs,t);i._classes=new Set(this._classes);i._styles.set(this._styles.getNormalized());i._customProperties=new Map(this._customProperties);i.getFillerOffset=this.getFillerOffset;return i}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let i=0;const n=Fc(this.document,t);for(const t of n){if(t.parent!==null){t._remove()}t.parent=this;t.document=this.document;this._children.splice(e,0,t);e++;i++}return i}_removeChildren(e,t=1){this._fireChange("children",this);for(let i=e;i0){this._classes.clear();return true}return false}if(e=="style"){if(!this._styles.isEmpty){this._styles.clear();return true}return false}return this._attrs.delete(e)}_addClass(e){this._fireChange("attributes",this);e=Array.isArray(e)?e:[e];e.forEach(e=>this._classes.add(e))}_removeClass(e){this._fireChange("attributes",this);e=Array.isArray(e)?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];e.forEach(e=>this._styles.remove(e))}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function jc(e){e=Us(e);for(const[t,i]of e){if(i===null){e.delete(t)}else if(typeof i!="string"){e.set(t,String(i))}}return e}function Bc(e,t){const i=t.split(/\s+/);e.clear();i.forEach(t=>e.add(t))}function Fc(e,t){if(typeof t=="string"){return[new Bs(e,t)]}if(!vs(t)){t=[t]}return Array.from(t).map(t=>{if(typeof t=="string"){return new Bs(e,t)}if(t instanceof Fs){return new Bs(e,t.data)}return t})}class Hc extends Vc{constructor(e,t,i,n){super(e,t,i,n);this.getFillerOffset=Uc}is(e,t=null){if(!t){return e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}else{return t===this.name&&(e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element")}}}function Uc(){const e=[...this.getChildren()];const t=e[this.childCount-1];if(t&&t.is("element","br")){return this.childCount}for(const t of e){if(!t.is("uiElement")){return null}}return this.childCount}var Wc=Cc((function(e,t){Dt(t,dn(t),e)}));var qc=Wc;const $c=Symbol("observableProperties");const Yc=Symbol("boundObservables");const Gc=Symbol("boundProperties");const Kc={set(e,t){if(ce(e)){Object.keys(e).forEach(t=>{this.set(t,e[t])},this);return}Jc(this);const i=this[$c];if(e in this&&!i.has(e)){throw new ss["b"]("observable-set-cannot-override: Cannot override an existing property.",this)}Object.defineProperty(this,e,{enumerable:true,configurable:true,get(){return i.get(e)},set(t){const n=i.get(e);let o=this.fire("set:"+e,e,t,n);if(o===undefined){o=t}if(n!==o||!i.has(e)){i.set(e,o);this.fire("change:"+e,e,o,n)}}});this[e]=t},bind(...e){if(!e.length||!tl(e)){throw new ss["b"]("observable-bind-wrong-properties: All properties must be strings.",this)}if(new Set(e).size!==e.length){throw new ss["b"]("observable-bind-duplicate-properties: Properties must be unique.",this)}Jc(this);const t=this[Gc];e.forEach(e=>{if(t.has(e)){throw new ss["b"]("observable-bind-rebind: Cannot bind the same property more than once.",this)}});const i=new Map;e.forEach(e=>{const n={property:e,to:[]};t.set(e,n);i.set(e,n)});return{to:Zc,toMany:Xc,_observable:this,_bindProperties:e,_to:[],_bindings:i}},unbind(...e){if(!this[$c]){return}const t=this[Gc];const i=this[Yc];if(e.length){if(!tl(e)){throw new ss["b"]("observable-unbind-wrong-properties: Properties must be strings.",this)}e.forEach(e=>{const n=t.get(e);if(!n){return}let o,r,s,a;n.to.forEach(e=>{o=e[0];r=e[1];s=i.get(o);a=s[r];a.delete(n);if(!a.size){delete s[r]}if(!Object.keys(s).length){i.delete(o);this.stopListening(o,"change")}});t.delete(e)})}else{i.forEach((e,t)=>{this.stopListening(t,"change")});i.clear();t.clear()}},decorate(e){const t=this[e];if(!t){throw new ss["b"]("observablemixin-cannot-decorate-undefined: Cannot decorate an undefined method.",this,{object:this,methodName:e})}this.on(e,(e,i)=>{e.return=t.apply(this,i)});this[e]=function(...t){return this.fire(e,t)}}};qc(Kc,ds);var Qc=Kc;function Jc(e){if(e[$c]){return}Object.defineProperty(e,$c,{value:new Map});Object.defineProperty(e,Yc,{value:new Map});Object.defineProperty(e,Gc,{value:new Map})}function Zc(...e){const t=il(...e);const i=Array.from(this._bindings.keys());const n=i.length;if(!t.callback&&t.to.length>1){throw new ss["b"]("observable-bind-to-no-callback: Binding multiple observables only possible with callback.",this)}if(n>1&&t.callback){throw new ss["b"]("observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.",this)}t.to.forEach(e=>{if(e.properties.length&&e.properties.length!==n){throw new ss["b"]("observable-bind-to-properties-length: The number of properties must match.",this)}if(!e.properties.length){e.properties=this._bindProperties}});this._to=t.to;if(t.callback){this._bindings.get(i[0]).callback=t.callback}sl(this._observable,this._to);ol(this);this._bindProperties.forEach(e=>{rl(this._observable,e)})}function Xc(e,t,i){if(this._bindings.size>1){throw new ss["b"]("observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().",this)}this.to(...el(e,t),i)}function el(e,t){const i=e.map(e=>[e,t]);return Array.prototype.concat.apply([],i)}function tl(e){return e.every(e=>typeof e=="string")}function il(...e){if(!e.length){throw new ss["b"]("observable-bind-to-parse-error: Invalid argument syntax in `to()`.",null)}const t={to:[]};let i;if(typeof e[e.length-1]=="function"){t.callback=e.pop()}e.forEach(e=>{if(typeof e=="string"){i.properties.push(e)}else if(typeof e=="object"){i={observable:e,properties:[]};t.to.push(i)}else{throw new ss["b"]("observable-bind-to-parse-error: Invalid argument syntax in `to()`.",null)}});return t}function nl(e,t,i,n){const o=e[Yc];const r=o.get(i);const s=r||{};if(!s[n]){s[n]=new Set}s[n].add(t);if(!r){o.set(i,s)}}function ol(e){let t;e._bindings.forEach((i,n)=>{e._to.forEach(o=>{t=o.properties[i.callback?0:e._bindProperties.indexOf(n)];i.to.push([o.observable,t]);nl(e._observable,i,o.observable,t)})})}function rl(e,t){const i=e[Gc];const n=i.get(t);let o;if(n.callback){o=n.callback.apply(e,n.to.map(e=>e[0][e[1]]))}else{o=n.to[0];o=o[0][o[1]]}if(Object.prototype.hasOwnProperty.call(e,t)){e[t]=o}else{e.set(t,o)}}function sl(e,t){t.forEach(t=>{const i=e[Yc];let n;if(!i.get(t.observable)){e.listenTo(t.observable,"change",(o,r)=>{n=i.get(t.observable)[r];if(n){n.forEach(t=>{rl(e,t.property)})}})}})}class al extends Hc{constructor(e,t,i,n){super(e,t,i,n);this.set("isReadOnly",false);this.set("isFocused",false);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){if(!t){return e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}else{return t===this.name&&(e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element")}}destroy(){this.stopListening()}}ys(al,Qc);const cl=Symbol("rootName");class ll extends al{constructor(e,t){super(e,t);this.rootName="main"}is(e,t=null){if(!t){return 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"}else{return t===this.name&&(e==="rootElement"||e==="view:rootElement"||e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element")}}get rootName(){return this.getCustomProperty(cl)}set rootName(e){this._setCustomProperty(cl,e)}set _name(e){this.name=e}}class dl{constructor(e={}){if(!e.boundaries&&!e.startPosition){throw new ss["b"]("view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.",null)}if(e.direction&&e.direction!="forward"&&e.direction!="backward"){throw new ss["b"]("view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",e.startPosition,{direction:e.direction})}this.boundaries=e.boundaries||null;if(e.startPosition){this.position=ul._createAt(e.startPosition)}else{this.position=ul._createAt(e.boundaries[e.direction=="backward"?"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,i,n;do{n=this.position;({done:t,value:i}=this.next())}while(!t&&e(i));if(!t){this.position=n}}next(){if(this.direction=="forward"){return this._next()}else{return this._previous()}}_next(){let e=this.position.clone();const t=this.position;const i=e.parent;if(i.parent===null&&e.offset===i.childCount){return{done:true}}if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset){return{done:true}}let n;if(i instanceof Bs){if(e.isAtEnd){this.position=ul._createAfter(i);return this._next()}n=i.data[e.offset]}else{n=i.getChild(e.offset)}if(n instanceof Vc){if(!this.shallow){e=new ul(n,0)}else{e.offset++}this.position=e;return this._formatReturnValue("elementStart",n,t,e,1)}else if(n instanceof Bs){if(this.singleCharacters){e=new ul(n,0);this.position=e;return this._next()}else{let i=n.data.length;let o;if(n==this._boundaryEndParent){i=this.boundaries.end.offset;o=new Fs(n,0,i);e=ul._createAfter(o)}else{o=new Fs(n,0,n.data.length);e.offset++}this.position=e;return this._formatReturnValue("text",o,t,e,i)}}else if(typeof n=="string"){let n;if(this.singleCharacters){n=1}else{const t=i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length;n=t-e.offset}const o=new Fs(i,e.offset,n);e.offset+=n;this.position=e;return this._formatReturnValue("text",o,t,e,n)}else{e=ul._createAfter(i);this.position=e;if(this.ignoreElementEnd){return this._next()}else{return this._formatReturnValue("elementEnd",i,t,e)}}}_previous(){let e=this.position.clone();const t=this.position;const i=e.parent;if(i.parent===null&&e.offset===0){return{done:true}}if(i==this._boundaryStartParent&&e.offset==this.boundaries.start.offset){return{done:true}}let n;if(i instanceof Bs){if(e.isAtStart){this.position=ul._createBefore(i);return this._previous()}n=i.data[e.offset-1]}else{n=i.getChild(e.offset-1)}if(n instanceof Vc){if(!this.shallow){e=new ul(n,n.childCount);this.position=e;if(this.ignoreElementEnd){return this._previous()}else{return this._formatReturnValue("elementEnd",n,t,e)}}else{e.offset--;this.position=e;return this._formatReturnValue("elementStart",n,t,e,1)}}else if(n instanceof Bs){if(this.singleCharacters){e=new ul(n,n.data.length);this.position=e;return this._previous()}else{let i=n.data.length;let o;if(n==this._boundaryStartParent){const t=this.boundaries.start.offset;o=new Fs(n,t,n.data.length-t);i=o.data.length;e=ul._createBefore(o)}else{o=new Fs(n,0,n.data.length);e.offset--}this.position=e;return this._formatReturnValue("text",o,t,e,i)}}else if(typeof n=="string"){let n;if(!this.singleCharacters){const t=i===this._boundaryStartParent?this.boundaries.start.offset:0;n=e.offset-t}else{n=1}e.offset-=n;const o=new Fs(i,e.offset,n);this.position=e;return this._formatReturnValue("text",o,t,e,n)}else{e=ul._createBefore(i);this.position=e;return this._formatReturnValue("elementStart",i,t,e,1)}}_formatReturnValue(e,t,i,n,o){if(t instanceof Fs){if(t.offsetInText+t.data.length==t.textNode.data.length){if(this.direction=="forward"&&!(this.boundaries&&this.boundaries.end.isEqual(this.position))){n=ul._createAfter(t.textNode);this.position=n}else{i=ul._createAfter(t.textNode)}}if(t.offsetInText===0){if(this.direction=="backward"&&!(this.boundaries&&this.boundaries.start.isEqual(this.position))){n=ul._createBefore(t.textNode);this.position=n}else{i=ul._createBefore(t.textNode)}}}return{done:false,value:{type:e,item:t,previousPosition:i,nextPosition:n,length:o}}}}class ul{constructor(e,t){this.parent=e;this.offset=t}get nodeAfter(){if(this.parent.is("$text")){return null}return this.parent.getChild(this.offset)||null}get nodeBefore(){if(this.parent.is("$text")){return null}return this.parent.getChild(this.offset-1)||null}get isAtStart(){return this.offset===0}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;while(!(e instanceof al)){if(e.parent){e=e.parent}else{return null}}return e}getShiftedBy(e){const t=ul._createAt(this);const i=t.offset+e;t.offset=i<0?0:i;return t}getLastMatchingPosition(e,t={}){t.startPosition=this;const i=new dl(t);i.skip(e);return i.position}getAncestors(){if(this.parent.is("documentFragment")){return[this.parent]}else{return this.parent.getAncestors({includeSelf:true})}}getCommonAncestor(e){const t=this.getAncestors();const i=e.getAncestors();let n=0;while(t[n]==i[n]&&t[n]){n++}return n===0?null:t[n-1]}is(e){return e==="position"||e==="view:position"}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return this.compareWith(e)=="before"}isAfter(e){return this.compareWith(e)=="after"}compareWith(e){if(this.root!==e.root){return"different"}if(this.isEqual(e)){return"same"}const t=this.parent.is("node")?this.parent.getPath():[];const i=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset);i.push(e.offset);const n=Rs(t,i);switch(n){case"prefix":return"before";case"extension":return"after";default:return t[n]0?new this(i,n):new this(n,i)}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(ul._createBefore(e),t)}}function fl(e){if(e.item.is("attributeElement")||e.item.is("uiElement")){return true}return false}function ml(e){let t=0;for(const i of e){t++}return t}class gl{constructor(e=null,t,i){this._ranges=[];this._lastRangeBackward=false;this._isFake=false;this._fakeSelectionLabel="";this.setTo(e,t,i)}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];const t=this._lastRangeBackward?e.end:e.start;return t.clone()}get focus(){if(!this._ranges.length){return null}const e=this._ranges[this._ranges.length-1];const t=this._lastRangeBackward?e.start:e.end;return t.clone()}get isCollapsed(){return this.rangeCount===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){if(this.anchor){return this.anchor.editableElement}return null}*getRanges(){for(const e of this._ranges){yield e.clone()}}getFirstRange(){let e=null;for(const t of this._ranges){if(!e||t.start.isBefore(e.start)){e=t}}return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges){if(!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 false}if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel){return false}if(this.rangeCount!=e.rangeCount){return false}else if(this.rangeCount===0){return true}if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus)){return false}for(const t of this._ranges){let i=false;for(const n of e._ranges){if(t.isEqual(n)){i=true;break}}if(!i){return false}}return true}isSimilar(e){if(this.isBackward!=e.isBackward){return false}const t=ml(this.getRanges());const i=ml(e.getRanges());if(t!=i){return false}if(t==0){return true}for(let t of this.getRanges()){t=t.getTrimmed();let i=false;for(let n of e.getRanges()){n=n.getTrimmed();if(t.start.isEqual(n.start)&&t.end.isEqual(n.end)){i=true;break}}if(!i){return false}}return true}getSelectedElement(){if(this.rangeCount!==1){return null}return this.getFirstRange().getContainedElement()}setTo(e,t,i){if(e===null){this._setRanges([]);this._setFakeOptions(t)}else if(e instanceof gl||e instanceof pl){this._setRanges(e.getRanges(),e.isBackward);this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel})}else if(e instanceof hl){this._setRanges([e],t&&t.backward);this._setFakeOptions(t)}else if(e instanceof ul){this._setRanges([new hl(e)]);this._setFakeOptions(t)}else if(e instanceof js){const n=!!i&&!!i.backward;let o;if(t===undefined){throw new ss["b"]("view-selection-setTo-required-second-parameter: "+"selection.setTo requires the second parameter when the first parameter is a node.",this)}else if(t=="in"){o=hl._createIn(e)}else if(t=="on"){o=hl._createOn(e)}else{o=new hl(ul._createAt(e,t))}this._setRanges([o],n);this._setFakeOptions(i)}else if(vs(e)){this._setRanges(e,t&&t.backward);this._setFakeOptions(t)}else{throw new ss["b"]("view-selection-setTo-not-selectable: Cannot set selection to given place.",this)}this.fire("change")}setFocus(e,t){if(this.anchor===null){throw new ss["b"]("view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.",this)}const i=ul._createAt(e,t);if(i.compareWith(this.focus)=="same"){return}const n=this.anchor;this._ranges.pop();if(i.compareWith(n)=="before"){this._addRange(new hl(i,n),true)}else{this._addRange(new hl(n,i))}this.fire("change")}is(e){return e==="selection"||e==="view:selection"}_setRanges(e,t=false){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=false){if(!(e instanceof hl)){throw new ss["b"]("view-selection-add-range-not-range: "+"Selection range set to an object that is not an instance of view.Range",this)}this._pushRange(e);this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges){if(e.isIntersecting(t)){throw new ss["b"]("view-selection-range-intersects: Trying to add a range that intersects with another range from selection.",this,{addedRange:e,intersectingRange:t})}}this._ranges.push(new hl(e.start,e.end))}}ys(gl,ds);class pl{constructor(e=null,t,i){this._selection=new gl;this._selection.delegate("change").to(this);this._selection.setTo(e,t,i)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}is(e){return e==="selection"||e=="documentSelection"||e=="view:selection"||e=="view:documentSelection"}_setTo(e,t,i){this._selection.setTo(e,t,i)}_setFocus(e,t){this._selection.setFocus(e,t)}}ys(pl,ds);class bl{constructor(e){this.selection=new pl;this.roots=new xs({idProperty:"rootName"});this.stylesProcessor=e;this.set("isReadOnly",false);this.set("isFocused",false);this.set("isComposing",false);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=false;do{for(const i of this._postFixers){t=i(e);if(t){break}}}while(t)}}ys(bl,Qc);const wl=10;class kl extends Vc{constructor(e,t,i,n){super(e,t,i,n);this.getFillerOffset=_l;this._priority=wl;this._id=null;this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null){throw new ss["b"]("attribute-element-get-elements-with-same-id-no-id: "+"Cannot get elements with the same id for an attribute element without id.",this)}return new Set(this._clonesGroup)}is(e,t=null){if(!t){return e==="attributeElement"||e==="view:attributeElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}else{return t===this.name&&(e==="attributeElement"||e==="view:attributeElement"||e==="element"||e==="view:element")}}isSimilar(e){if(this.id!==null||e.id!==null){return this.id===e.id}return super.isSimilar(e)&&this.priority==e.priority}_clone(e){const t=super._clone(e);t._priority=this._priority;t._id=this._id;return t}}kl.DEFAULT_PRIORITY=wl;function _l(){if(vl(this)){return null}let e=this.parent;while(e&&e.is("attributeElement")){if(vl(e)>1){return null}e=e.parent}if(!e||vl(e)>1){return null}return this.childCount}function vl(e){return Array.from(e.getChildren()).filter(e=>!e.is("uiElement")).length}class yl extends Vc{constructor(e,t,i,n){super(e,t,i,n);this.getFillerOffset=xl}is(e,t=null){if(!t){return e==="emptyElement"||e==="view:emptyElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}else{return t===this.name&&(e==="emptyElement"||e==="view:emptyElement"||e==="element"||e==="view:element")}}_insertChild(e,t){if(t&&(t instanceof js||Array.from(t).length>0)){throw new ss["b"]("view-emptyelement-cannot-add: Cannot add child nodes to EmptyElement instance.",[this,t])}}}function xl(){return null}const Al=navigator.userAgent.toLowerCase();const Tl={isMac:Pl(Al),isGecko:El(Al),isSafari:Sl(Al),isAndroid:Ml(Al),features:{isRegExpUnicodePropertySupported:Il()}};var Cl=Tl;function Pl(e){return e.indexOf("macintosh")>-1}function El(e){return!!e.match(/gecko\/\d+/)}function Sl(e){return e.indexOf(" applewebkit/")>-1&&e.indexOf("chrome")===-1}function Ml(e){return e.indexOf("android")>-1}function Il(){let e=false;try{e="ć".search(new RegExp("[\\p{L}]","u"))===0}catch(e){}return e}const Nl={"⌘":"ctrl","⇧":"shift","⌥":"alt"};const Ol={ctrl:"⌘",shift:"⇧",alt:"⌥"};const zl=Fl();function Rl(e){let t;if(typeof e=="string"){t=zl[e.toLowerCase()];if(!t){throw new ss["b"]("keyboard-unknown-key: Unknown key name.",null,{key:e})}}else{t=e.keyCode+(e.altKey?zl.alt:0)+(e.ctrlKey?zl.ctrl:0)+(e.shiftKey?zl.shift:0)}return t}function Ll(e){if(typeof e=="string"){e=Hl(e)}return e.map(e=>typeof e=="string"?Rl(e):e).reduce((e,t)=>t+e,0)}function Dl(e){if(!Cl.isMac){return e}return Hl(e).map(e=>Ol[e.toLowerCase()]||e).reduce((e,t)=>{if(e.slice(-1)in Nl){return e+t}else{return e+"+"+t}})}function Vl(e){return e==zl.arrowright||e==zl.arrowleft||e==zl.arrowup||e==zl.arrowdown}function jl(e,t){const i=t==="ltr";switch(e){case zl.arrowleft:return i?"left":"right";case zl.arrowright:return i?"right":"left";case zl.arrowup:return"up";case zl.arrowdown:return"down"}}function Bl(e,t){const i=jl(e,t);return i==="down"||i==="right"}function Fl(){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 i=String.fromCharCode(t);e[i.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 Hl(e){return e.split(/\s*\+\s*/)}class Ul extends Vc{constructor(e,t,i,n){super(e,t,i,n);this.getFillerOffset=ql}is(e,t=null){if(!t){return e==="uiElement"||e==="view:uiElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}else{return t===this.name&&(e==="uiElement"||e==="view:uiElement"||e==="element"||e==="view:element")}}_insertChild(e,t){if(t&&(t instanceof js||Array.from(t).length>0)){throw new ss["b"]("view-uielement-cannot-add: Cannot add child nodes to UIElement instance.",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 Wl(e){e.document.on("keydown",(t,i)=>$l(t,i,e.domConverter))}function ql(){return null}function $l(e,t,i){if(t.keyCode==zl.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection();const n=e.rangeCount==1&&e.getRangeAt(0).collapsed;if(n||t.shiftKey){const t=e.focusNode;const o=e.focusOffset;const r=i.domPositionToView(t,o);if(r===null){return}let s=false;const a=r.getLastMatchingPosition(e=>{if(e.item.is("uiElement")){s=true}if(e.item.is("uiElement")||e.item.is("attributeElement")){return true}return false});if(s){const t=i.viewPositionToDom(a);if(n){e.collapse(t.parent,t.offset)}else{e.extend(t.parent,t.offset)}}}}}class Yl extends Vc{constructor(e,t,i,n){super(e,t,i,n);this.getFillerOffset=Gl}is(e,t=null){if(!t){return e==="rawElement"||e==="view:rawElement"||e===this.name||e==="view:"+this.name||e==="element"||e==="view:element"||e==="node"||e==="view:node"}else{return t===this.name&&(e==="rawElement"||e==="view:rawElement"||e==="element"||e==="view:element")}}_insertChild(e,t){if(t&&(t instanceof js||Array.from(t).length>0)){throw new ss["b"]("view-rawelement-cannot-add: Cannot add child nodes to a RawElement instance.",[this,t])}}}function Gl(){return null}class Kl{constructor(e,t){this.document=e;this._children=[];if(t){this._insertChild(0,t)}}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}is(e){return e==="documentFragment"||e==="view:documentFragment"}_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 i=0;const n=Ql(this.document,t);for(const t of n){if(t.parent!==null){t._remove()}t.parent=this;this._children.splice(e,0,t);e++;i++}return i}_removeChildren(e,t=1){this._fireChange("children",this);for(let i=e;i{if(typeof t=="string"){return new Bs(e,t)}if(t instanceof Fs){return new Bs(e,t.data)}return t})}class Jl{constructor(e){this.document=e;this._cloneGroups=new Map}setSelection(e,t,i){this.document.selection._setTo(e,t,i)}setSelectionFocus(e,t){this.document.selection._setFocus(e,t)}createText(e){return new Bs(this.document,e)}createAttributeElement(e,t,i={}){const n=new kl(this.document,e,t);if(i.priority){n._priority=i.priority}if(i.id){n._id=i.id}return n}createContainerElement(e,t){return new Hc(this.document,e,t)}createEditableElement(e,t){const i=new al(this.document,e,t);i._document=this.document;return i}createEmptyElement(e,t){return new yl(this.document,e,t)}createUIElement(e,t,i){const n=new Ul(this.document,e,t);if(i){n.render=i}return n}createRawElement(e,t,i){const n=new Yl(this.document,e,t);n.render=i||(()=>{});return n}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){if(z(e)&&i===undefined){i=t}i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){if(e instanceof ul){return this._breakAttributes(e)}else{return this._breakAttributesRange(e)}}breakContainer(e){const t=e.parent;if(!t.is("containerElement")){throw new ss["b"]("view-writer-break-non-container-element: Trying to break an element which is not a container element.",this.document)}if(!t.parent){throw new ss["b"]("view-writer-break-root: Trying to break root element.",this.document)}if(e.isAtStart){return ul._createBefore(t)}else if(!e.isAtEnd){const i=t._clone(false);this.insert(ul._createAfter(t),i);const n=new hl(e,ul._createAt(t,"end"));const o=new ul(i,0);this.move(n,o)}return ul._createAfter(t)}mergeAttributes(e){const t=e.offset;const i=e.parent;if(i.is("$text")){return e}if(i.is("attributeElement")&&i.childCount===0){const e=i.parent;const t=i.index;i._remove();this._removeFromClonedElementsGroup(i);return this.mergeAttributes(new ul(e,t))}const n=i.getChild(t-1);const o=i.getChild(t);if(!n||!o){return e}if(n.is("$text")&&o.is("$text")){return nd(n,o)}else if(n.is("attributeElement")&&o.is("attributeElement")&&n.isSimilar(o)){const e=n.childCount;n._appendChild(o.getChildren());o._remove();this._removeFromClonedElementsGroup(o);return this.mergeAttributes(new ul(n,e))}return e}mergeContainers(e){const t=e.nodeBefore;const i=e.nodeAfter;if(!t||!i||!t.is("containerElement")||!i.is("containerElement")){throw new ss["b"]("view-writer-merge-containers-invalid-position: "+"Element before and after given position cannot be merged.",this.document)}const n=t.getChild(t.childCount-1);const o=n instanceof Bs?ul._createAt(n,"end"):ul._createAt(t,"end");this.move(hl._createIn(i),ul._createAt(t,"end"));this.remove(hl._createOn(i));return o}insert(e,t){t=vs(t)?[...t]:[t];od(t,this.document);const i=Xl(e);if(!i){throw new ss["b"]("view-writer-invalid-position-container",this.document)}const n=this._breakAttributes(e,true);const o=i._insertChild(n.offset,t);for(const e of t){this._addToClonedElementsGroup(e)}const r=n.getShiftedBy(o);const s=this.mergeAttributes(n);if(o===0){return new hl(s,s)}else{if(!s.isEqual(n)){r.offset--}const e=this.mergeAttributes(r);return new hl(s,e)}}remove(e){const t=e instanceof hl?e:hl._createOn(e);ad(t,this.document);if(t.isCollapsed){return new Kl(this.document)}const{start:i,end:n}=this._breakAttributesRange(t,true);const o=i.parent;const r=n.offset-i.offset;const s=o._removeChildren(i.offset,r);for(const e of s){this._removeFromClonedElementsGroup(e)}const a=this.mergeAttributes(i);t.start=a;t.end=a.clone();return new Kl(this.document,s)}clear(e,t){ad(e,this.document);const i=e.getWalker({direction:"backward",ignoreElementEnd:true});for(const n of i){const i=n.item;let o;if(i.is("element")&&t.isSimilar(i)){o=hl._createOn(i)}else if(!n.nextPosition.isAfter(e.start)&&i.is("$textProxy")){const e=i.getAncestors().find(e=>e.is("element")&&t.isSimilar(e));if(e){o=hl._createIn(e)}}if(o){if(o.end.isAfter(e.end)){o.end=e.end}if(o.start.isBefore(e.start)){o.start=e.start}this.remove(o)}}}move(e,t){let i;if(t.isAfter(e.end)){t=this._breakAttributes(t,true);const n=t.parent;const o=n.childCount;e=this._breakAttributesRange(e,true);i=this.remove(e);t.offset+=n.childCount-o}else{i=this.remove(e)}return this.insert(t,i)}wrap(e,t){if(!(t instanceof kl)){throw new ss["b"]("view-writer-wrap-invalid-attribute",this.document)}ad(e,this.document);if(!e.isCollapsed){return this._wrapRange(e,t)}else{let i=e.start;if(i.parent.is("element")&&!Zl(i.parent)){i=i.getLastMatchingPosition(e=>e.item.is("uiElement"))}i=this._wrapPosition(i,t);const n=this.document.selection;if(n.isCollapsed&&n.getFirstPosition().isEqual(e.start)){this.setSelection(i)}return new hl(i)}}unwrap(e,t){if(!(t instanceof kl)){throw new ss["b"]("view-writer-unwrap-invalid-attribute",this.document)}ad(e,this.document);if(e.isCollapsed){return e}const{start:i,end:n}=this._breakAttributesRange(e,true);const o=i.parent;const r=this._unwrapChildren(o,i.offset,n.offset,t);const s=this.mergeAttributes(r.start);if(!s.isEqual(r.start)){r.end.offset--}const a=this.mergeAttributes(r.end);return new hl(s,a)}rename(e,t){const i=new Hc(this.document,e,t.getAttributes());this.insert(ul._createAfter(t),i);this.move(hl._createIn(t),ul._createAt(i,0));this.remove(hl._createOn(t));return i}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return ul._createAt(e,t)}createPositionAfter(e){return ul._createAfter(e)}createPositionBefore(e){return ul._createBefore(e)}createRange(e,t){return new hl(e,t)}createRangeOn(e){return hl._createOn(e)}createRangeIn(e){return hl._createIn(e)}createSelection(e,t,i){return new gl(e,t,i)}_wrapChildren(e,t,i,n){let o=t;const r=[];while(ofalse;e.parent._insertChild(e.offset,i);const n=new hl(e,e.getShiftedBy(1));this.wrap(n,t);const o=new ul(i.parent,i.index);i._remove();const r=o.nodeBefore;const s=o.nodeAfter;if(r instanceof Bs&&s instanceof Bs){return nd(r,s)}return td(o)}_wrapAttributeElement(e,t){if(!cd(e,t)){return false}if(e.name!==t.name||e.priority!==t.priority){return false}for(const i of e.getAttributeKeys()){if(i==="class"||i==="style"){continue}if(t.hasAttribute(i)&&t.getAttribute(i)!==e.getAttribute(i)){return false}}for(const i of e.getStyleNames()){if(t.hasStyle(i)&&t.getStyle(i)!==e.getStyle(i)){return false}}for(const i of e.getAttributeKeys()){if(i==="class"||i==="style"){continue}if(!t.hasAttribute(i)){this.setAttribute(i,e.getAttribute(i),t)}}for(const i of e.getStyleNames()){if(!t.hasStyle(i)){this.setStyle(i,e.getStyle(i),t)}}for(const i of e.getClassNames()){if(!t.hasClass(i)){this.addClass(i,t)}}return true}_unwrapAttributeElement(e,t){if(!cd(e,t)){return false}if(e.name!==t.name||e.priority!==t.priority){return false}for(const i of e.getAttributeKeys()){if(i==="class"||i==="style"){continue}if(!t.hasAttribute(i)||t.getAttribute(i)!==e.getAttribute(i)){return false}}if(!t.hasClass(...e.getClassNames())){return false}for(const i of e.getStyleNames()){if(!t.hasStyle(i)||t.getStyle(i)!==e.getStyle(i)){return false}}for(const i of e.getAttributeKeys()){if(i==="class"||i==="style"){continue}this.removeAttribute(i,t)}this.removeClass(Array.from(e.getClassNames()),t);this.removeStyle(Array.from(e.getStyleNames()),t);return true}_breakAttributesRange(e,t=false){const i=e.start;const n=e.end;ad(e,this.document);if(e.isCollapsed){const i=this._breakAttributes(e.start,t);return new hl(i,i)}const o=this._breakAttributes(n,t);const r=o.parent.childCount;const s=this._breakAttributes(i,t);o.offset+=o.parent.childCount-r;return new hl(s,o)}_breakAttributes(e,t=false){const i=e.offset;const n=e.parent;if(e.parent.is("emptyElement")){throw new ss["b"]("view-writer-cannot-break-empty-element",this.document)}if(e.parent.is("uiElement")){throw new ss["b"]("view-writer-cannot-break-ui-element",this.document)}if(e.parent.is("rawElement")){throw new ss["b"]("view-writer-cannot-break-raw-element: Cannot break inside a RawElement instance.",this.document)}if(!t&&n.is("$text")&&sd(n.parent)){return e.clone()}if(sd(n)){return e.clone()}if(n.is("$text")){return this._breakAttributes(id(e),t)}const o=n.childCount;if(i==o){const e=new ul(n.parent,n.index+1);return this._breakAttributes(e,t)}else{if(i===0){const e=new ul(n.parent,n.index);return this._breakAttributes(e,t)}else{const e=n.index+1;const o=n._clone();n.parent._insertChild(e,o);this._addToClonedElementsGroup(o);const r=n.childCount-i;const s=n._removeChildren(i,r);o._appendChild(s);const a=new ul(n.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 i=this._cloneGroups.get(t);if(!i){i=new Set;this._cloneGroups.set(t,i)}i.add(e);e._clonesGroup=i}_removeFromClonedElementsGroup(e){if(e.is("element")){for(const t of e.getChildren()){this._removeFromClonedElementsGroup(t)}}const t=e.id;if(!t){return}const i=this._cloneGroups.get(t);if(!i){return}i.delete(e)}}function Zl(e){return Array.from(e.getChildren()).some(e=>!e.is("uiElement"))}function Xl(e){let t=e.parent;while(!sd(t)){if(!t){return undefined}t=t.parent}return t}function ed(e,t){if(e.priorityt.priority){return false}return e.getIdentity()i instanceof e)){throw new ss["b"]("view-writer-insert-invalid-node",t)}if(!i.is("$text")){od(i.getChildren(),t)}}}const rd=[Bs,kl,Hc,yl,Yl,Ul];function sd(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function ad(e,t){const i=Xl(e.start);const n=Xl(e.end);if(!i||!n||i!==n){throw new ss["b"]("view-writer-invalid-range-container",t)}}function cd(e,t){return e.id===null&&t.id===null}function ld(e){return Object.prototype.toString.call(e)=="[object Text]"}const dd=e=>e.createTextNode(" ");const ud=e=>{const t=e.createElement("br");t.dataset.ckeFiller=true;return t};const hd=7;const fd=(()=>{let e="";for(let t=0;t0){i.push({index:n,type:"insert",values:e.slice(n,r)})}if(o-n>0){i.push({index:n+(r-n),type:"delete",howMany:o-n})}return i}function Ad(e,t){const{firstIndex:i,lastIndexOld:n,lastIndexNew:o}=e;if(i===-1){return Array(t).fill("equal")}let r=[];if(i>0){r=r.concat(Array(i).fill("equal"))}if(o-i>0){r=r.concat(Array(o-i).fill("insert"))}if(n-i>0){r=r.concat(Array(n-i).fill("delete"))}if(o200||o>200||n+o>300){return Td.fastDiff(e,t,i,true)}let r,s;if(ol?-1:1;if(d[n+h]){d[n]=d[n+h].slice(0)}if(!d[n]){d[n]=[]}d[n].push(o>l?r:s);let f=Math.max(o,l);let m=f-n;while(ml;m--){u[m]=h(m)}u[l]=h(l);f++}while(u[l]!==c);return d[l].slice(1)}Td.fastDiff=kd;function Cd(e,t,i){e.insertBefore(i,e.childNodes[t]||null)}function Pd(e){const t=e.parentNode;if(t){t.removeChild(e)}}function Ed(e){if(e){if(e.defaultView){return e instanceof e.defaultView.Document}else if(e.ownerDocument&&e.ownerDocument.defaultView){return e instanceof e.ownerDocument.defaultView.Node}}return false}class Sd{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=false;this._inlineFiller=null;this._fakeSelectionContainer=null}markToSync(e,t){if(e==="text"){if(this.domConverter.mapViewToDom(t.parent)){this.markedTexts.add(t)}}else{if(!this.domConverter.mapViewToDom(t)){return}if(e==="attributes"){this.markedAttributes.add(t)}else if(e==="children"){this.markedChildren.add(t)}else{throw new ss["b"]("view-renderer-unknown-type: Unknown type passed to Renderer.markToSync.",this)}}}render(){let e;for(const e of this.markedChildren){this._updateChildrenMappings(e)}if(this._inlineFiller&&!this._isSelectionInInlineFiller()){this._removeInlineFiller()}if(this._inlineFiller){e=this._getInlineFillerPosition()}else if(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){if(!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)){this._updateText(t,{inlineFillerPosition:e})}}if(e){const t=this.domConverter.viewPositionToDom(e);const i=t.parent.ownerDocument;if(!md(t.parent)){this._inlineFiller=Id(i,t.parent,t.offset)}else{this._inlineFiller=t.parent}}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 i=this.domConverter.mapViewToDom(e).childNodes;const n=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:false}));const o=this._diffNodeLists(i,n);const r=this._findReplaceActions(o,i,n);if(r.indexOf("replace")!==-1){const t={equal:0,insert:0,delete:0};for(const o of r){if(o==="replace"){const o=t.equal+t.insert;const r=t.equal+t.delete;const s=e.getChild(o);if(s&&!(s.is("uiElement")||s.is("rawElement"))){this._updateElementMappings(s,i[r])}Pd(n[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();if(e.parent.is("$text")){return ul._createBefore(this.selection.getFirstPosition().parent)}else{return e}}_isSelectionInInlineFiller(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed){return false}const e=this.selection.getFirstPosition();const t=this.domConverter.viewPositionToDom(e);if(t&&ld(t.parent)&&md(t.parent)){return true}return false}_removeInlineFiller(){const e=this._inlineFiller;if(!md(e)){throw new ss["b"]("view-renderer-filler-was-lost: The inline filler node was lost.",this)}if(gd(e)){e.parentNode.removeChild(e)}else{e.data=e.data.substr(hd)}this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed){return false}const e=this.selection.getFirstPosition();const t=e.parent;const i=e.offset;if(!this.domConverter.mapViewToDom(t.root)){return false}if(!t.is("element")){return false}if(!Md(t)){return false}if(i===t.getFillerOffset()){return false}const n=e.nodeBefore;const o=e.nodeAfter;if(n instanceof Bs||o instanceof Bs){return false}return true}_updateText(e,t){const i=this.domConverter.findCorrespondingDomText(e);const n=this.domConverter.viewToDom(e,i.ownerDocument);const o=i.data;let r=n.data;const s=t.inlineFillerPosition;if(s&&s.parent==e.parent&&s.offset==e.index){r=fd+r}if(o!=r){const e=kd(o,r);for(const t of e){if(t.type==="insert"){i.insertData(t.index,t.values.join(""))}else{i.deleteData(t.index,t.howMany)}}}}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t){return}const i=Array.from(t.attributes).map(e=>e.name);const n=e.getAttributeKeys();for(const i of n){t.setAttribute(i,e.getAttribute(i))}for(const n of i){if(!e.hasAttribute(n)){t.removeAttribute(n)}}}_updateChildren(e,t){const i=this.domConverter.mapViewToDom(e);if(!i){return}const n=t.inlineFillerPosition;const o=this.domConverter.mapViewToDom(e).childNodes;const r=Array.from(this.domConverter.viewChildrenToDom(e,i.ownerDocument,{bind:true,inlineFillerPosition:n}));if(n&&n.parent===e){Id(i.ownerDocument,r,n.offset)}const s=this._diffNodeLists(o,r);let a=0;const c=new Set;for(const e of s){if(e==="delete"){c.add(o[a]);Pd(o[a])}else if(e==="equal"){a++}}a=0;for(const e of s){if(e==="insert"){Cd(i,a,r[a]);a++}else if(e==="equal"){this._markDescendantTextToSync(this.domConverter.domToView(r[a]));a++}}for(const e of c){if(!e.parentNode){this.domConverter.unbindDomElement(e)}}}_diffNodeLists(e,t){e=Rd(e,this._fakeSelectionContainer);return Td(e,t,Od.bind(null,this.domConverter))}_findReplaceActions(e,t,i){if(e.indexOf("insert")===-1||e.indexOf("delete")===-1){return e}let n=[];let o=[];let r=[];const s={equal:0,insert:0,delete:0};for(const a of e){if(a==="insert"){r.push(i[s.equal+s.insert])}else if(a==="delete"){o.push(t[s.equal+s.delete])}else{n=n.concat(Td(o,r,Nd).map(e=>e==="equal"?"replace":e));n.push("equal");o=[];r=[]}s[a]++}return n.concat(Td(o,r,Nd).map(e=>e==="equal"?"replace":e))}_markDescendantTextToSync(e){if(!e){return}if(e.is("$text")){this.markedTexts.add(e)}else if(e.is("element")){for(const t of e.getChildren()){this._markDescendantTextToSync(t)}}}_updateSelection(){if(this.selection.rangeCount===0){this._removeDomSelection();this._removeFakeSelection();return}const e=this.domConverter.mapViewToDom(this.selection.editableElement);if(!this.isFocused||!e){return}if(this.selection.isFake){this._updateFakeSelection(e)}else{this._removeFakeSelection();this._updateDomSelection(e)}}_updateFakeSelection(e){const t=e.ownerDocument;if(!this._fakeSelectionContainer){this._fakeSelectionContainer=Ld(t)}const i=this._fakeSelectionContainer;this.domConverter.bindFakeSelection(i,this.selection);if(!this._fakeSelectionNeedsUpdate(e)){return}if(!i.parentElement||i.parentElement!=e){e.appendChild(i)}i.textContent=this.selection.fakeSelectionLabel||" ";const n=t.getSelection();const o=t.createRange();n.removeAllRanges();o.selectNodeContents(i);n.addRange(o)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t)){return}const i=this.domConverter.viewPositionToDom(this.selection.anchor);const n=this.domConverter.viewPositionToDom(this.selection.focus);e.focus();t.collapse(i.parent,i.offset);t.extend(n.parent,n.offset);if(Cl.isGecko){zd(n,t)}}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e)){return true}const t=e&&this.domConverter.domSelectionToView(e);if(t&&this.selection.isEqual(t)){return false}if(!this.selection.isCollapsed&&this.selection.isSimilar(t)){return false}return true}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer;const i=e.ownerDocument.getSelection();if(!t||t.parentElement!==e){return true}if(i.anchorNode!==t&&!t.contains(i.anchorNode)){return true}return t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments){const t=e.getSelection();if(t.rangeCount){const t=e.activeElement;const i=this.domConverter.mapDomToView(t);if(t&&i){e.getSelection().removeAllRanges()}}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;if(e){e.remove()}}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;if(e){this.domConverter.focus(e)}}}}ys(Sd,Qc);function Md(e){if(e.getAttribute("contenteditable")=="false"){return false}const t=e.findAncestor(e=>e.hasAttribute("contenteditable"));return!t||t.getAttribute("contenteditable")=="true"}function Id(e,t,i){const n=t instanceof Array?t:t.childNodes;const o=n[i];if(ld(o)){o.data=fd+o.data;return o}else{const o=e.createTextNode(fd);if(Array.isArray(t)){n.splice(i,0,o)}else{Cd(t,i,o)}return o}}function Nd(e,t){return Ed(e)&&Ed(t)&&!ld(e)&&!ld(t)&&e.nodeType!==Node.COMMENT_NODE&&t.nodeType!==Node.COMMENT_NODE&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function Od(e,t,i){if(t===i){return true}else if(ld(t)&&ld(i)){return t.data===i.data}else if(e.isBlockFiller(t)&&e.isBlockFiller(i)){return true}return false}function zd(e,t){const i=e.parent;if(i.nodeType!=Node.ELEMENT_NODE||e.offset!=i.childNodes.length-1){return}const n=i.childNodes[e.offset];if(n&&n.tagName=="BR"){t.addRange(t.getRangeAt(0))}}function Rd(e,t){const i=Array.from(e);if(i.length==0||!t){return i}const n=i[i.length-1];if(n==t){i.pop()}return i}function Ld(e){const t=e.createElement("div");Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"});t.textContent=" ";return t}var Dd={window:window,document:document};function Vd(e){let t=0;while(e.previousSibling){e=e.previousSibling;t++}return t}function jd(e){const t=[];while(e&&e.nodeType!=Node.DOCUMENT_NODE){t.unshift(e);e=e.parentNode}return t}function Bd(e,t){const i=jd(e);const n=jd(t);let o=0;while(i[o]==n[o]&&i[o]){o++}return o===0?null:i[o-1]}const Fd=ud(document);class Hd{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=this.blockFillerMode=="br"?ud:dd;this._domToViewMapping=new WeakMap;this._viewToDomMapping=new WeakMap;this._fakeSelectionMapping=new WeakMap}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new gl(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,i={}){if(e.is("$text")){const i=this._processDataFromViewText(e);return t.createTextNode(i)}else{if(this.mapViewToDom(e)){return this.mapViewToDom(e)}let n;if(e.is("documentFragment")){n=t.createDocumentFragment();if(i.bind){this.bindDocumentFragments(n,e)}}else if(e.is("uiElement")){n=e.render(t);if(i.bind){this.bindElements(n,e)}return n}else{if(e.hasAttribute("xmlns")){n=t.createElementNS(e.getAttribute("xmlns"),e.name)}else{n=t.createElement(e.name)}if(e.is("rawElement")){e.render(n)}if(i.bind){this.bindElements(n,e)}for(const t of e.getAttributeKeys()){n.setAttribute(t,e.getAttribute(t))}}if(i.withChildren||i.withChildren===undefined){for(const o of this.viewChildrenToDom(e,t,i)){n.appendChild(o)}}return n}}*viewChildrenToDom(e,t,i={}){const n=e.getFillerOffset&&e.getFillerOffset();let o=0;for(const r of e.getChildren()){if(n===o){yield this._blockFiller(t)}yield this.viewToDom(r,t,i);o++}if(n===o){yield this._blockFiller(t)}}viewRangeToDom(e){const t=this.viewPositionToDom(e.start);const i=this.viewPositionToDom(e.end);const n=document.createRange();n.setStart(t.parent,t.offset);n.setEnd(i.parent,i.offset);return n}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const i=this.findCorrespondingDomText(t);if(!i){return null}let n=e.offset;if(md(i)){n+=hd}return{parent:i,offset:n}}else{let i,n,o;if(e.offset===0){i=this.mapViewToDom(t);if(!i){return null}o=i.childNodes[0]}else{const t=e.nodeBefore;n=t.is("$text")?this.findCorrespondingDomText(t):this.mapViewToDom(e.nodeBefore);if(!n){return null}i=n.parentNode;o=n.nextSibling}if(ld(o)&&md(o)){return{parent:o,offset:hd}}const r=n?Vd(n)+1:0;return{parent:i,offset:r}}}domToView(e,t={}){if(this.isBlockFiller(e,this.blockFillerMode)){return null}const i=this.getHostViewElement(e,this._domToViewMapping);if(i){return i}if(ld(e)){if(gd(e)){return null}else{const t=this._processDataFromDomText(e);return t===""?null:new Bs(this.document,t)}}else if(this.isComment(e)){return null}else{if(this.mapDomToView(e)){return this.mapDomToView(e)}let i;if(this.isDocumentFragment(e)){i=new Kl(this.document);if(t.bind){this.bindDocumentFragments(e,i)}}else{const n=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();i=new Vc(this.document,n);if(t.bind){this.bindElements(e,i)}const o=e.attributes;for(let e=o.length-1;e>=0;e--){i._setAttribute(o[e].name,o[e].value)}}if(t.withChildren||t.withChildren===undefined){for(const n of this.domChildrenToView(e,t)){i._appendChild(n)}}return i}}*domChildrenToView(e,t={}){for(let i=0;i{const{scrollLeft:t,scrollTop:i}=e;n.push([t,i])});t.focus();Wd(t,e=>{const[t,i]=n.shift();e.scrollLeft=t;e.scrollTop=i});Dd.window.scrollTo(e,i)}}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){if(this.blockFillerMode=="br"){return e.isEqualNode(Fd)}if(e.tagName==="BR"&&$d(e,this.blockElements)&&e.parentNode.childNodes.length===1){return true}return qd(e,this.blockElements)}isDomSelectionBackward(e){if(e.isCollapsed){return false}const t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset);t.setEnd(e.focusNode,e.focusOffset);const i=t.collapsed;t.detach();return i}getHostViewElement(e){const t=jd(e);t.pop();while(t.length){const e=t.pop();const i=this._domToViewMapping.get(e);if(i&&(i.is("uiElement")||i.is("rawElement"))){return i}}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}_isDomSelectionPositionCorrect(e,t){if(ld(e)&&md(e)&&tthis.preElements.includes(e.name))){return t}if(t.charAt(0)==" "){const i=this._getTouchingViewTextNode(e,false);const n=i&&this._nodeEndsWithSpace(i);if(n||!i){t=" "+t.substr(1)}}if(t.charAt(t.length-1)==" "){const i=this._getTouchingViewTextNode(e,true);if(t.charAt(t.length-2)==" "||!i||i.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 false}const t=this._processDataFromViewText(e);return t.charAt(t.length-1)==" "}_processDataFromDomText(e){let t=e.data;if(Ud(e,this.preElements)){return pd(e)}t=t.replace(/[ \n\t\r]{1,}/g," ");const i=this._getTouchingInlineDomNode(e,false);const n=this._getTouchingInlineDomNode(e,true);const o=this._checkShouldLeftTrimDomText(i);const r=this._checkShouldRightTrimDomText(e,n);if(o){t=t.replace(/^ /,"")}if(r){t=t.replace(/ $/,"")}t=pd(new Text(t));t=t.replace(/ \u00A0/g," ");if(/( |\u00A0)\u00A0$/.test(t)||!n||n.data&&n.data.charAt(0)==" "){t=t.replace(/\u00A0$/," ")}if(o){t=t.replace(/^\u00A0/," ")}return t}_checkShouldLeftTrimDomText(e){if(!e){return true}if(Gr(e)){return true}return/[^\S\u00A0]/.test(e.data.charAt(e.data.length-1))}_checkShouldRightTrimDomText(e,t){if(t){return false}return!md(e)}_getTouchingViewTextNode(e,t){const i=new dl({startPosition:t?ul._createAfter(e):ul._createBefore(e),direction:t?"forward":"backward"});for(const e of i){if(e.item.is("containerElement")){return null}else if(e.item.is("element","br")){return null}else if(e.item.is("$textProxy")){return e.item}}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode){return null}const i=t?"nextNode":"previousNode";const n=e.ownerDocument;const o=jd(e)[0];const r=n.createTreeWalker(o,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode(e){if(ld(e)){return NodeFilter.FILTER_ACCEPT}if(e.tagName=="BR"){return NodeFilter.FILTER_ACCEPT}return NodeFilter.FILTER_SKIP}});r.currentNode=e;const s=r[i]();if(s!==null){const t=Bd(e,s);if(t&&!Ud(e,this.blockElements,t)&&!Ud(s,this.blockElements,t)){return s}}return null}}function Ud(e,t,i){let n=jd(e);if(i){n=n.slice(n.indexOf(i)+1)}return n.some(e=>e.tagName&&t.includes(e.tagName.toLowerCase()))}function Wd(e,t){while(e&&e!=Dd.document){t(e);e=e.parentNode}}function qd(e,t){const i=ld(e)&&e.data==" ";return i&&$d(e,t)&&e.parentNode.childNodes.length===1}function $d(e,t){const i=e.parentNode;return i&&i.tagName&&t.includes(i.tagName.toLowerCase())}function Yd(e){const t=Object.prototype.toString.apply(e);if(t=="[object Window]"){return true}if(t=="[object global]"){return true}return false}const Gd=qc({},ds,{listenTo(e,...t){if(Ed(e)||Yd(e)){const i=this._getProxyEmitter(e)||new Qd(e);i.attach(...t);e=i}ds.listenTo.call(this,e,...t)},stopListening(e,t,i){if(Ed(e)||Yd(e)){const t=this._getProxyEmitter(e);if(!t){return}e=t}ds.stopListening.call(this,e,t,i);if(e instanceof Qd){e.detach(t)}},_getProxyEmitter(e){return us(this,Jd(e))}});var Kd=Gd;class Qd{constructor(e){hs(this,Jd(e));this._domNode=e}}qc(Qd.prototype,ds,{attach(e,t,i={}){if(this._domListeners&&this._domListeners[e]){return}const n=this._createDomListener(e,!!i.useCapture);this._domNode.addEventListener(e,n,!!i.useCapture);if(!this._domListeners){this._domListeners={}}this._domListeners[e]=n},detach(e){let t;if(this._domListeners[e]&&(!(t=this._events[e])||!t.callbacks.length)){this._domListeners[e].removeListener()}},_createDomListener(e,t){const i=t=>{this.fire(e,t)};i.removeListener=()=>{this._domNode.removeEventListener(e,i,t);delete this._domListeners[e]};return i}});function Jd(e){return e["data-ck-expando"]||(e["data-ck-expando"]=is())}class Zd{constructor(e){this.view=e;this.document=e.document;this.isEnabled=false}enable(){this.isEnabled=true}disable(){this.isEnabled=false}destroy(){this.disable();this.stopListening()}}ys(Zd,Kd);var Xd="__lodash_hash_undefined__";function eu(e){this.__data__.set(e,Xd);return this}var tu=eu;function iu(e){return this.__data__.has(e)}var nu=iu;function ou(e){var t=-1,i=e==null?0:e.length;this.__data__=new _t;while(++ta)){return false}var l=r.get(e);if(l&&r.get(t)){return l==t}var d=-1,u=true,h=i&uu?new ru:undefined;r.set(e,t);r.set(t,e);while(++d{this.listenTo(e,t,(e,t)=>{if(this.isEnabled){this.onDomEvent(t)}},{useCapture:this.useCapture})})}fire(e,t,i){if(this.isEnabled){this.document.fire(e,new Xu(this.view,t,i))}}}class th extends eh{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 Rl(this)}})}}var ih=function(){return n["a"].Date.now()};var nh=ih;var oh=0/0;var rh=/^\s+|\s+$/g;var sh=/^[-+]0x[0-9a-f]+$/i;var ah=/^0b[01]+$/i;var ch=/^0o[0-7]+$/i;var lh=parseInt;function dh(e){if(typeof e=="number"){return e}if(Zs(e)){return oh}if(ce(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ce(t)?t+"":t}if(typeof e!="string"){return e===0?e:+e}e=e.replace(rh,"");var i=ah.test(e);return i||ch.test(e)?lh(e.slice(2),i?2:8):sh.test(e)?oh:+e}var uh=dh;var hh="Expected a function";var fh=Math.max,mh=Math.min;function gh(e,t,i){var n,o,r,s,a,c,l=0,d=false,u=false,h=true;if(typeof e!="function"){throw new TypeError(hh)}t=uh(t)||0;if(ce(i)){d=!!i.leading;u="maxWait"in i;r=u?fh(uh(i.maxWait)||0,t):r;h="trailing"in i?!!i.trailing:h}function f(t){var i=n,r=o;n=o=undefined;l=t;s=e.apply(r,i);return s}function m(e){l=e;a=setTimeout(b,t);return d?f(e):s}function g(e){var i=e-c,n=e-l,o=t-i;return u?mh(o,r-n):o}function p(e){var i=e-c,n=e-l;return c===undefined||i>=t||i<0||u&&n>=r}function b(){var e=nh();if(p(e)){return w(e)}a=setTimeout(b,g(e))}function w(e){a=undefined;if(h&&n){return f(e)}n=o=undefined;return s}function k(){if(a!==undefined){clearTimeout(a)}l=0;n=c=o=a=undefined}function _(){return a===undefined?s:w(nh())}function v(){var e=nh(),i=p(e);n=arguments;o=this;c=e;if(i){if(a===undefined){return m(c)}if(u){clearTimeout(a);a=setTimeout(b,t);return f(c)}}if(a===undefined){a=setTimeout(b,t)}return s}v.cancel=k;v.flush=_;return v}var ph=gh;class bh extends Zd{constructor(e){super(e);this._fireSelectionChangeDoneDebounced=ph(e=>this.document.fire("selectionChangeDone",e),200)}observe(){const e=this.document;e.on("keydown",(t,i)=>{const n=e.selection;if(n.isFake&&wh(i.keyCode)&&this.isEnabled){i.preventDefault();this._handleSelectionMove(i.keyCode)}},{priority:"lowest"})}destroy(){super.destroy();this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection;const i=new gl(t.getRanges(),{backward:t.isBackward,fake:false});if(e==zl.arrowleft||e==zl.arrowup){i.setTo(i.getFirstPosition())}if(e==zl.arrowright||e==zl.arrowdown){i.setTo(i.getLastPosition())}const n={oldSelection:t,newSelection:i,domSelection:null};this.document.fire("selectionChange",n);this._fireSelectionChangeDoneDebounced(n)}}function wh(e){return e==zl.arrowright||e==zl.arrowleft||e==zl.arrowup||e==zl.arrowdown}class kh extends Zd{constructor(e){super(e);this.mutationObserver=e.getObserver(Zu);this.selection=this.document.selection;this.domConverter=e.domConverter;this._documents=new WeakSet;this._fireSelectionChangeDoneDebounced=ph(e=>this.document.fire("selectionChangeDone",e),200);this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3);this._loopbackCounter=0}observe(e){const t=e.ownerDocument;if(this._documents.has(t)){return}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();const i=this.domConverter.domSelectionToView(t);if(i.rangeCount==0){this.view.hasDomSelection=false;return}this.view.hasDomSelection=true;if(this.selection.isEqual(i)&&this.domConverter.isDomSelectionCorrect(t)){return}if(++this._loopbackCounter>60){return}if(this.selection.isSimilar(i)){this.view.forceRender()}else{const e={oldSelection:this.selection,newSelection:i,domSelection:t};this.document.fire("selectionChange",e);this._fireSelectionChangeDoneDebounced(e)}}_clearInfiniteLoop(){this._loopbackCounter=0}}class _h extends eh{constructor(e){super(e);this.domEventType=["focus","blur"];this.useCapture=true;const t=this.document;t.on("focus",()=>{t.isFocused=true;this._renderTimeoutId=setTimeout(()=>e.forceRender(),50)});t.on("blur",(i,n)=>{const o=t.selection.editableElement;if(o===null||o===n.target){t.isFocused=false;e.forceRender()}})}onDomEvent(e){this.fire(e.type,e)}destroy(){if(this._renderTimeoutId){clearTimeout(this._renderTimeoutId)}super.destroy()}}class vh extends eh{constructor(e){super(e);this.domEventType=["compositionstart","compositionupdate","compositionend"];const t=this.document;t.on("compositionstart",()=>{t.isComposing=true});t.on("compositionend",()=>{t.isComposing=false})}onDomEvent(e){this.fire(e.type,e)}}class yh extends eh{constructor(e){super(e);this.domEventType=["beforeinput"]}onDomEvent(e){this.fire(e.type,e)}}function xh(e){return Object.prototype.toString.apply(e)=="[object Range]"}function Ah(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}const Th=["top","right","bottom","left","width","height"];class Ch{constructor(e){const t=xh(e);Object.defineProperty(this,"_source",{value:e._source||e,writable:true,enumerable:false});if(Gr(e)||t){if(t){Ph(this,Ch.getDomRangeRects(e)[0])}else{Ph(this,e.getBoundingClientRect())}}else if(Yd(e)){const{innerWidth:t,innerHeight:i}=e;Ph(this,{top:0,right:t,bottom:i,left:0,width:t,height:i})}else{Ph(this,e)}}clone(){return new Ch(this)}moveTo(e,t){this.top=t;this.right=e+this.width;this.bottom=t+this.height;this.left=e;return this}moveBy(e,t){this.top+=t;this.right+=e;this.left+=e;this.bottom+=t;return 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)};t.width=t.right-t.left;t.height=t.bottom-t.top;if(t.width<0||t.height<0){return null}else{return new Ch(t)}}getIntersectionArea(e){const t=this.getIntersection(e);if(t){return t.getArea()}else{return 0}}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!Eh(e)){let i=e.parentNode||e.commonAncestorContainer;while(i&&!Eh(i)){const e=new Ch(i);const n=t.getIntersection(e);if(n){if(n.getArea()Bh(e,n));const s=Bh(e,n);Nh(n,s,t);if(n.parent!=n){o=n.frameElement;n=n.parent;if(!o){return}}else{n=null}}}function Ih(e){const t=jh(e);Oh(t,()=>new Ch(e))}Object.assign(Sh,{scrollViewportToShowTarget:Mh,scrollAncestorsToShowTarget:Ih});function Nh(e,t,i){const n=t.clone().moveBy(0,i);const o=t.clone().moveBy(0,-i);const r=new Ch(e).excludeScrollbarsAndBorders();const s=[o,n];if(!s.every(e=>r.contains(e))){let{scrollX:s,scrollY:a}=e;if(Rh(o,r)){a-=r.top-t.top+i}else if(zh(n,r)){a+=t.bottom-r.bottom+i}if(Lh(t,r)){s-=r.left-t.left+i}else if(Dh(t,r)){s+=t.right-r.right+i}e.scrollTo(s,a)}}function Oh(e,t){const i=Vh(e);let n,o;while(e!=i.document.body){o=t();n=new Ch(e).excludeScrollbarsAndBorders();if(!n.contains(o)){if(Rh(o,n)){e.scrollTop-=n.top-o.top}else if(zh(o,n)){e.scrollTop+=o.bottom-n.bottom}if(Lh(o,n)){e.scrollLeft-=n.left-o.left}else if(Dh(o,n)){e.scrollLeft+=o.right-n.right}}e=e.parentNode}}function zh(e,t){return e.bottom>t.bottom}function Rh(e,t){return e.topt.right}function Vh(e){if(xh(e)){return e.startContainer.ownerDocument.defaultView}else{return e.ownerDocument.defaultView}}function jh(e){if(xh(e)){let t=e.commonAncestorContainer;if(ld(t)){t=t.parentNode}return t}else{return e.parentNode}}function Bh(e,t){const i=Vh(e);const n=new Ch(e);if(i===t){return n}else{let e=i;while(e!=t){const t=e.frameElement;const i=new Ch(t).excludeScrollbarsAndBorders();n.moveBy(i.left,i.top);e=e.parent}}return n}class Fh{constructor(e){this.document=new bl(e);this.domConverter=new Hd(this.document);this.domRoots=new Map;this.set("isRenderingInProgress",false);this.set("hasDomSelection",false);this._renderer=new Sd(this.domConverter,this.document.selection);this._renderer.bind("isFocused").to(this.document);this._initialDomRootAttributes=new WeakMap;this._observers=new Map;this._ongoingChange=false;this._postFixersInProgress=false;this._renderingDisabled=false;this._hasChangedSinceTheLastRendering=false;this._writer=new Jl(this.document);this.addObserver(Zu);this.addObserver(kh);this.addObserver(_h);this.addObserver(th);this.addObserver(bh);this.addObserver(vh);if(Cl.isAndroid){this.addObserver(yh)}bd(this);Wl(this);this.on("render",()=>{this._render();this.document.fire("layoutChanged");this._hasChangedSinceTheLastRendering=false});this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=true})}attachDomRoot(e,t="main"){const i=this.document.getRoot(t);i._name=e.tagName.toLowerCase();const n={};for(const{name:t,value:o}of Array.from(e.attributes)){n[t]=o;if(t==="class"){this._writer.addClass(o.split(" "),i)}else{this._writer.setAttribute(t,o,i)}}this._initialDomRootAttributes.set(e,n);const o=()=>{this._writer.setAttribute("contenteditable",!i.isReadOnly,i);if(i.isReadOnly){this._writer.addClass("ck-read-only",i)}else{this._writer.removeClass("ck-read-only",i)}};o();this.domRoots.set(t,e);this.domConverter.bindElements(e,i);this._renderer.markToSync("children",i);this._renderer.markToSync("attributes",i);this._renderer.domDocuments.add(e.ownerDocument);i.on("change:children",(e,t)=>this._renderer.markToSync("children",t));i.on("change:attributes",(e,t)=>this._renderer.markToSync("attributes",t));i.on("change:text",(e,t)=>this._renderer.markToSync("text",t));i.on("change:isReadOnly",()=>this.change(o));i.on("change",()=>{this._hasChangedSinceTheLastRendering=true});for(const i of this._observers.values()){i.observe(e,t)}}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:e})=>t.removeAttribute(e));const i=this._initialDomRootAttributes.get(t);for(const e in i){t.setAttribute(e,i[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,i]of this.domRoots){t.observe(i,e)}t.enable();return 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();if(e){Mh({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;if(e){this.domConverter.focus(e);this.forceRender()}else{}}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress){throw new ss["b"]("cannot-change-view-tree: "+"Attempting to make changes to the view when it is in an incorrect state: rendering or post-fixers are in progress. "+"This may cause some unexpected behavior and inconsistency between the DOM and the view.",this)}try{if(this._ongoingChange){return e(this._writer)}this._ongoingChange=true;const t=e(this._writer);this._ongoingChange=false;if(!this._renderingDisabled&&this._hasChangedSinceTheLastRendering){this._postFixersInProgress=true;this.document._callPostFixers(this._writer);this._postFixersInProgress=false;this.fire("render")}return t}catch(e){ss["b"].rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=true;this.change(()=>{})}destroy(){for(const e of this._observers.values()){e.destroy()}this.document.destroy();this.stopListening()}createPositionAt(e,t){return ul._createAt(e,t)}createPositionAfter(e){return ul._createAfter(e)}createPositionBefore(e){return ul._createBefore(e)}createRange(e,t){return new hl(e,t)}createRangeOn(e){return hl._createOn(e)}createRangeIn(e){return hl._createIn(e)}createSelection(e,t,i){return new gl(e,t,i)}_disableRendering(e){this._renderingDisabled=e;if(e==false){this.change(()=>{})}}_render(){this.isRenderingInProgress=true;this.disableObservers();this._renderer.render();this.enableObservers();this.isRenderingInProgress=false}}ys(Fh,Qc);class Hh{constructor(e){this.parent=null;this._attrs=Us(e)}get index(){let e;if(!this.parent){return null}if((e=this.parent.getChildIndex(this))===null){throw new ss["b"]("model-node-not-found-in-parent: The node's parent does not contain this node.",this)}return e}get startOffset(){let e;if(!this.parent){return null}if((e=this.parent.getChildStartOffset(this))===null){throw new ss["b"]("model-node-not-found-in-parent: The node's parent does not contain this node.",this)}return e}get offsetSize(){return 1}get endOffset(){if(!this.parent){return null}return this.startOffset+this.offsetSize}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;while(e.parent){e=e.parent}return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;while(t.parent){e.unshift(t.startOffset);t=t.parent}return e}getAncestors(e={includeSelf:false,parentFirst:false}){const t=[];let i=e.includeSelf?this:this.parent;while(i){t[e.parentFirst?"push":"unshift"](i);i=i.parent}return t}getCommonAncestor(e,t={}){const i=this.getAncestors(t);const n=e.getAncestors(t);let o=0;while(i[o]==n[o]&&i[o]){o++}return o===0?null:i[o-1]}isBefore(e){if(this==e){return false}if(this.root!==e.root){return false}const t=this.getPath();const i=e.getPath();const n=Rs(t,i);switch(n){case"prefix":return true;case"extension":return false;default:return t[n]{e[t[0]]=t[1];return e},{})}return e}is(e){return e==="node"||e==="model:node"}_clone(){return new Hh(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=Us(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}class Uh extends Hh{constructor(e,t){super(t);this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}is(e){return e==="$text"||e==="model:$text"||e==="text"||e==="model:text"||e==="node"||e==="model:node"}toJSON(){const e=super.toJSON();e.data=this.data;return e}_clone(){return new Uh(this.data,this.getAttributes())}static fromJSON(e){return new Uh(e.data,e.attributes)}}class Wh{constructor(e,t,i){this.textNode=e;if(t<0||t>e.offsetSize){throw new ss["b"]("model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.",this)}if(i<0||t+i>e.offsetSize){throw new ss["b"]("model-textproxy-wrong-length: Given length value is incorrect.",this)}this.data=e.data.substring(t,t+i);this.offsetInText=t}get startOffset(){return this.textNode.startOffset!==null?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return this.startOffset!==null?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 e==="$textProxy"||e==="model:$textProxy"||e==="textProxy"||e==="model:textProxy"}getPath(){const e=this.textNode.getPath();if(e.length>0){e[e.length-1]+=this.offsetInText}return e}getAncestors(e={includeSelf:false,parentFirst:false}){const t=[];let i=e.includeSelf?this:this.parent;while(i){t[e.parentFirst?"push":"unshift"](i);i=i.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 qh{constructor(e){this._nodes=[];if(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 t==-1?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return t===null?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 ss["b"]("model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.",this)}return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const i of this._nodes){if(e>=t&&ee.toJSON())}}class $h extends Hh{constructor(e,t,i){super(t);this.name=e;this._children=new qh;if(i){this._insertChild(0,i)}}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}is(e,t=null){if(!t){return e==="element"||e==="model:element"||e==="node"||e==="model:node"}return t===this.name&&(e==="element"||e==="model:element")}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 i of e){t=t.getChild(t.offsetToIndex(i))}return t}findAncestor(e,t={includeSelf:false}){let i=t.includeSelf?this:this.parent;while(i){if(i.name===e){return i}i=i.parent}return null}toJSON(){const e=super.toJSON();e.name=this.name;if(this._children.length>0){e.children=[];for(const t of this._children){e.children.push(t.toJSON())}}return e}_clone(e=false){const t=e?Array.from(this._children).map(e=>e._clone(true)):null;return new $h(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=Yh(t);for(const e of i){if(e.parent!==null){e._remove()}e.parent=this}this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i){e.parent=null}return i}static fromJSON(e){let t=null;if(e.children){t=[];for(const i of e.children){if(i.name){t.push($h.fromJSON(i))}else{t.push(Uh.fromJSON(i))}}}return new $h(e.name,e.attributes,t)}}function Yh(e){if(typeof e=="string"){return[new Uh(e)]}if(!vs(e)){e=[e]}return Array.from(e).map(e=>{if(typeof e=="string"){return new Uh(e)}if(e instanceof Wh){return new Uh(e.data,e.getAttributes())}return e})}class Gh{constructor(e={}){if(!e.boundaries&&!e.startPosition){throw new ss["b"]("model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.",null)}const t=e.direction||"forward";if(t!="forward"&&t!="backward"){throw new ss["b"]("model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",e,{direction:t})}this.direction=t;this.boundaries=e.boundaries||null;if(e.startPosition){this.position=e.startPosition.clone()}else{this.position=Qh._createAt(this.boundaries[this.direction=="backward"?"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,i,n,o;do{n=this.position;o=this._visitedParent;({done:t,value:i}=this.next())}while(!t&&e(i));if(!t){this.position=n;this._visitedParent=o}}next(){if(this.direction=="forward"){return this._next()}else{return this._previous()}}_next(){const e=this.position;const t=this.position.clone();const i=this._visitedParent;if(i.parent===null&&t.offset===i.maxOffset){return{done:true}}if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset){return{done:true}}const n=t.parent;const o=Jh(t,n);const r=o?o:Zh(t,n,o);if(r instanceof $h){if(!this.shallow){t.path.push(0);this._visitedParent=r}else{t.offset++}this.position=t;return Kh("elementStart",r,e,t,1)}else if(r instanceof Uh){let n;if(this.singleCharacters){n=1}else{let e=r.endOffset;if(this._boundaryEndParent==i&&this.boundaries.end.offsete){e=this.boundaries.start.offset}n=t.offset-e}const o=t.offset-r.startOffset;const s=new Wh(r,o-n,n);t.offset-=n;this.position=t;return Kh("text",s,e,t,n)}else{t.path.pop();this.position=t;this._visitedParent=i.parent;return Kh("elementStart",i,e,t,1)}}}function Kh(e,t,i,n,o){return{done:false,value:{type:e,item:t,previousPosition:i,nextPosition:n,length:o}}}class Qh{constructor(e,t,i="toNone"){if(!e.is("element")&&!e.is("documentFragment")){throw new ss["b"]("model-position-root-invalid: Position root invalid.",e)}if(!(t instanceof Array)||t.length===0){throw new ss["b"]("model-position-path-incorrect-format: Position path must be an array with at least one item.",e,{path:t})}if(e.is("rootElement")){t=t.slice()}else{t=[...e.getPath(),...t];e=e.root}this.root=e;this.path=t;this.stickiness=i}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;ti.path.length){if(t.offset!==o.maxOffset){return false}t.path=t.path.slice(0,-1);o=o.parent;t.offset++}else{if(i.offset!==0){return false}i.path=i.path.slice(0,-1)}}}is(e){return e==="position"||e==="model:position"}hasSameParentAs(e){if(this.root!==e.root){return false}const t=this.getParentPath();const i=e.getParentPath();return Rs(t,i)=="same"}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=Qh._createAt(this);break}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;const i=t.containsPosition(this)||t.start.isEqual(this)&&this.stickiness=="toNext";if(i){return this._getCombined(e.splitPosition,e.moveTargetPosition)}else{if(e.graveyardPosition){return this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1)}else{return this._getTransformedByInsertion(e.insertionPosition,1)}}}_getTransformedByMergeOperation(e){const t=e.movedRange;const i=t.containsPosition(this)||t.start.isEqual(this);let n;if(i){n=this._getCombined(e.sourcePosition,e.targetPosition);if(e.sourcePosition.isBefore(e.targetPosition)){n=n._getTransformedByDeletion(e.deletionPosition,1)}}else if(this.isEqual(e.deletionPosition)){n=Qh._createAt(e.deletionPosition)}else{n=this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1)}return n}_getTransformedByDeletion(e,t){const i=Qh._createAt(this);if(this.root!=e.root){return i}if(Rs(e.getParentPath(),this.getParentPath())=="same"){if(e.offsetthis.offset){return null}else{i.offset-=t}}}else if(Rs(e.getParentPath(),this.getParentPath())=="prefix"){const n=e.path.length-1;if(e.offset<=this.path[n]){if(e.offset+t>this.path[n]){return null}else{i.path[n]-=t}}}return i}_getTransformedByInsertion(e,t){const i=Qh._createAt(this);if(this.root!=e.root){return i}if(Rs(e.getParentPath(),this.getParentPath())=="same"){if(e.offsett+1){const t=n.maxOffset-i.offset;if(t!==0){e.push(new ef(i,i.getShiftedBy(t)))}i.path=i.path.slice(0,-1);i.offset++;n=n.parent}while(i.path.length<=this.end.path.length){const t=this.end.path[i.path.length-1];const n=t-i.offset;if(n!==0){e.push(new ef(i,i.getShiftedBy(n)))}i.offset=t;i.path.push(0)}return e}getWalker(e={}){e.boundaries=this;return new Gh(e)}*getItems(e={}){e.boundaries=this;e.ignoreElementEnd=true;const t=new Gh(e);for(const e of t){yield e.item}}*getPositions(e={}){e.boundaries=this;const t=new Gh(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 ef(this.start,this.end)]}getTransformedByOperations(e){const t=[new ef(this.start,this.end)];for(const i of e){for(let e=0;e0?new this(i,n):new this(n,i)}static _createIn(e){return new this(Qh._createAt(e,0),Qh._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(Qh._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(e.length===0){throw new ss["b"]("range-create-from-ranges-empty-array: At least one range has to be passed.",null)}else if(e.length==1){return e[0].clone()}const t=e[0];e.sort((e,t)=>e.start.isAfter(t.start)?1:-1);const i=e.indexOf(t);const n=new this(t.start,t.end);if(i>0){for(let t=i-1;true;t++){if(e[t].end.isEqual(n.start)){n.start=Qh._createAt(e[t].start)}else{break}}}for(let t=i+1;t{if(t.viewPosition){return}const i=this._modelToViewMapping.get(t.modelPosition.parent);t.viewPosition=this.findPositionIn(i,t.modelPosition.offset)},{priority:"low"});this.on("viewToModelPosition",(e,t)=>{if(t.modelPosition){return}const i=this.findMappedViewAncestor(t.viewPosition);const n=this._viewToModelMapping.get(i);const o=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,i);t.modelPosition=Qh._createAt(n,o)},{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t);this._viewToModelMapping.set(t,e)}unbindViewElement(e){const t=this.toModelElement(e);this._viewToModelMapping.delete(e);if(this._elementToMarkerNames.has(e)){for(const t of this._elementToMarkerNames.get(e)){this._unboundMarkerNames.add(t)}}if(this._modelToViewMapping.get(t)==e){this._modelToViewMapping.delete(t)}}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e);if(this._viewToModelMapping.get(t)==e){this._viewToModelMapping.delete(t)}}bindElementToMarker(e,t){const i=this._markerNameToElements.get(t)||new Set;i.add(e);const n=this._elementToMarkerNames.get(e)||new Set;n.add(t);this._markerNameToElements.set(t,i);this._elementToMarkerNames.set(e,n)}unbindElementFromMarkerName(e,t){const i=this._markerNameToElements.get(t);if(i){i.delete(e);if(i.size==0){this._markerNameToElements.delete(t)}}const n=this._elementToMarkerNames.get(e);if(n){n.delete(t);if(n.size==0){this._elementToMarkerNames.delete(e)}}}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);this._unboundMarkerNames.clear();return 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 ef(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new hl(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};this.fire("viewToModelPosition",t);return t.modelPosition}toViewPosition(e,t={isPhantom:false}){const i={modelPosition:e,mapper:this,isPhantom:t.isPhantom};this.fire("modelToViewPosition",i);return i.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t){return null}const i=new Set;for(const e of t){if(e.is("attributeElement")){for(const t of e.getElementsWithSameId()){i.add(t)}}else{i.add(e)}}return i}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;while(!this._viewToModelMapping.has(t)){t=t.parent}return t}_toModelOffset(e,t,i){if(i!=e){const n=this._toModelOffset(e.parent,e.index,i);const o=this._toModelOffset(e,t,e);return n+o}if(e.is("$text")){return t}let n=0;for(let i=0;i1?t[0]+":"+t[1]:t[0]}class rf{constructor(e){this.conversionApi=qc({dispatcher:this},e)}convertChanges(e,t,i){for(const t of e.getMarkersToRemove()){this.convertMarkerRemove(t.name,t.range,i)}for(const t of e.getChanges()){if(t.type=="insert"){this.convertInsert(ef._createFromPositionAndShift(t.position,t.length),i)}else if(t.type=="remove"){this.convertRemove(t.position,t.length,t.name,i)}else{this.convertAttribute(t.range,t.attributeKey,t.attributeOldValue,t.attributeNewValue,i)}}for(const e of this.conversionApi.mapper.flushUnboundMarkerNames()){const n=t.get(e).getRange();this.convertMarkerRemove(e,n,i);this.convertMarkerAdd(e,n,i)}for(const t of e.getMarkersToAdd()){this.convertMarkerAdd(t.name,t.range,i)}}convertInsert(e,t){this.conversionApi.writer=t;this.conversionApi.consumable=this._createInsertConsumable(e);for(const t of e){const e=t.item;const i=ef._createFromPositionAndShift(t.previousPosition,t.length);const n={item:e,range:i};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,i,n){this.conversionApi.writer=n;this.fire("remove:"+i,{position:e,length:t},this.conversionApi);this._clearConversionApi()}convertAttribute(e,t,i,n,o){this.conversionApi.writer=o;this.conversionApi.consumable=this._createConsumableForRange(e,`attribute:${t}`);for(const o of e){const e=o.item;const r=ef._createFromPositionAndShift(o.previousPosition,o.length);const s={item:e,range:r,attributeKey:t,attributeOldValue:i,attributeNewValue:n};this._testAndFire(`attribute:${t}`,s)}this._clearConversionApi()}convertSelection(e,t,i){const n=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));this.conversionApi.writer=i;this.conversionApi.consumable=this._createSelectionConsumable(e,n);this.fire("selection",{selection:e},this.conversionApi);if(!e.isCollapsed){return}for(const t of n){const i=t.getRange();if(!sf(e.getFirstPosition(),t,this.conversionApi.mapper)){continue}const n={item:e,markerName:t.name,markerRange:i};if(this.conversionApi.consumable.test(e,"addMarker:"+t.name)){this.fire("addMarker:"+t.name,n,this.conversionApi)}}for(const t of e.getAttributeKeys()){const i={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};if(this.conversionApi.consumable.test(e,"attribute:"+i.attributeKey)){this.fire("attribute:"+i.attributeKey+":$text",i,this.conversionApi)}}this._clearConversionApi()}convertMarkerAdd(e,t,i){if(!t.root.document||t.root.rootName=="$graveyard"){return}this.conversionApi.writer=i;const n="addMarker:"+e;const o=new nf;o.add(t,n);this.conversionApi.consumable=o;this.fire(n,{markerName:e,markerRange:t},this.conversionApi);if(!o.test(t,n)){return}this.conversionApi.consumable=this._createConsumableForRange(t,n);for(const i of t.getItems()){if(!this.conversionApi.consumable.test(i,n)){continue}const o={item:i,range:ef._createOn(i),markerName:e,markerRange:t};this.fire(n,o,this.conversionApi)}this._clearConversionApi()}convertMarkerRemove(e,t,i){if(!t.root.document||t.root.rootName=="$graveyard"){return}this.conversionApi.writer=i;this.fire("removeMarker:"+e,{markerName:e,markerRange:t},this.conversionApi);this._clearConversionApi()}_createInsertConsumable(e){const t=new nf;for(const i of e){const e=i.item;t.add(e,"insert");for(const i of e.getAttributeKeys()){t.add(e,"attribute:"+i)}}return t}_createConsumableForRange(e,t){const i=new nf;for(const n of e.getItems()){i.add(n,t)}return i}_createSelectionConsumable(e,t){const i=new nf;i.add(e,"selection");for(const n of t){i.add(e,"addMarker:"+n.name)}for(const t of e.getAttributeKeys()){i.add(e,"attribute:"+t)}return i}_testAndFire(e,t){if(!this.conversionApi.consumable.test(t.item,e)){return}const i=t.item.name||"$text";this.fire(e+":"+i,t,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer;delete this.conversionApi.consumable}}ys(rf,ds);function sf(e,t,i){const n=t.getRange();const o=Array.from(e.getAncestors());o.shift();o.reverse();const r=o.some(e=>{if(n.containsItem(e)){const t=i.toViewElement(e);return!!t.getCustomProperty("addHighlight")}});return!r}class af{constructor(e,t,i){this._lastRangeBackward=false;this._ranges=[];this._attrs=new Map;if(e){this.setTo(e,t,i)}}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(){const e=this._ranges.length;if(e===1){return this._ranges[0].isCollapsed}else{return false}}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount){return false}else if(this.rangeCount===0){return true}if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus)){return false}for(const t of this._ranges){let i=false;for(const n of e._ranges){if(t.isEqual(n)){i=true;break}}if(!i){return false}}return true}*getRanges(){for(const e of this._ranges){yield new ef(e.start,e.end)}}getFirstRange(){let e=null;for(const t of this._ranges){if(!e||t.start.isBefore(e.start)){e=t}}return e?new ef(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges){if(!e||t.end.isAfter(e.end)){e=t}}return e?new ef(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,i){if(e===null){this._setRanges([])}else if(e instanceof af){this._setRanges(e.getRanges(),e.isBackward)}else if(e&&typeof e.getRanges=="function"){this._setRanges(e.getRanges(),e.isBackward)}else if(e instanceof ef){this._setRanges([e],!!t&&!!t.backward)}else if(e instanceof Qh){this._setRanges([new ef(e)])}else if(e instanceof Hh){const n=!!i&&!!i.backward;let o;if(t=="in"){o=ef._createIn(e)}else if(t=="on"){o=ef._createOn(e)}else if(t!==undefined){o=new ef(Qh._createAt(e,t))}else{throw new ss["b"]("model-selection-setTo-required-second-parameter: "+"selection.setTo requires the second parameter when the first parameter is a node.",[this,e])}this._setRanges([o],n)}else if(vs(e)){this._setRanges(e,t&&!!t.backward)}else{throw new ss["b"]("model-selection-setTo-not-selectable: Cannot set the selection to the given place.",[this,e])}}_setRanges(e,t=false){e=Array.from(e);const i=e.some(t=>{if(!(t instanceof ef)){throw new ss["b"]("model-selection-set-ranges-not-range: "+"Selection range set to an object that is not an instance of model.Range.",[this,e])}return this._ranges.every(e=>!e.isEqual(t))});if(e.length===this._ranges.length&&!i){return}this._removeAllRanges();for(const t of e){this._pushRange(t)}this._lastRangeBackward=!!t;this.fire("change:range",{directChange:true})}setFocus(e,t){if(this.anchor===null){throw new ss["b"]("model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.",[this,e])}const i=Qh._createAt(e,t);if(i.compareWith(this.focus)=="same"){return}const n=this.anchor;if(this._ranges.length){this._popRange()}if(i.compareWith(n)=="before"){this._pushRange(new ef(i,n));this._lastRangeBackward=true}else{this._pushRange(new ef(n,i));this._lastRangeBackward=false}this.fire("change:range",{directChange:true})}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){if(this.hasAttribute(e)){this._attrs.delete(e);this.fire("change:attribute",{attributeKeys:[e],directChange:true})}}setAttribute(e,t){if(this.getAttribute(e)!==t){this._attrs.set(e,t);this.fire("change:attribute",{attributeKeys:[e],directChange:true})}}getSelectedElement(){if(this.rangeCount!==1){return null}return this.getFirstRange().getContainedElement()}is(e){return e==="selection"||e==="model:selection"}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const i=df(t.start,e);if(i&&uf(i,t)){yield i}for(const i of t.getWalker()){const n=i.item;if(i.type=="elementEnd"&&lf(n,e,t)){yield n}}const n=df(t.end,e);if(n&&!t.end.isTouching(Qh._createAt(n,0))&&uf(n,t)){yield n}}}containsEntireContent(e=this.anchor.root){const t=Qh._createAt(e,0);const i=Qh._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e);this._ranges.push(new ef(e.start,e.end))}_checkRange(e){for(let t=0;t0){this._popRange()}}_popRange(){this._ranges.pop()}}ys(af,ds);function cf(e,t){if(t.has(e)){return false}t.add(e);return e.root.document.model.schema.isBlock(e)&&e.parent}function lf(e,t,i){return cf(e,t)&&uf(e,i)}function df(e,t){const i=e.parent;const n=i.root.document.model.schema;const o=e.parent.getAncestors({parentFirst:true,includeSelf:true});let r=false;const s=o.find(e=>{if(r){return false}r=n.isLimit(e);return!r&&cf(e,t)});o.forEach(e=>t.add(e));return s}function uf(e,t){const i=hf(e);if(!i){return true}const n=t.containsRange(ef._createOn(i),true);return!n}function hf(e){const t=e.root.document.model.schema;let i=e.parent;while(i){if(t.isBlock(i)){return i}i=i.parent}}class ff extends ef{constructor(e,t){super(e,t);mf.call(this)}detach(){this.stopListening()}is(e){return e==="liveRange"||e==="model:liveRange"||e=="range"||e==="model:range"}toRange(){return new ef(this.start,this.end)}static fromRange(e){return new ff(e.start,e.end)}}function mf(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{const i=t[0];if(!i.isDocumentOperation){return}gf.call(this,i)},{priority:"low"})}function gf(e){const t=this.getTransformedByOperation(e);const i=ef._createFromRanges(t);const n=!i.isEqual(this);const o=pf(this,e);let r=null;if(n){if(i.root.rootName=="$graveyard"){if(e.type=="remove"){r=e.sourcePosition}else{r=e.deletionPosition}}const t=this.toRange();this.start=i.start;this.end=i.end;this.fire("change:range",t,{deletionPosition:r})}else if(o){this.fire("change:content",this.toRange(),{deletionPosition:r})}}function pf(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 false}ys(ff,ds);const bf="selection:";class wf{constructor(e){this._selection=new kf(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(false)}is(e){return e==="selection"||e=="model:selection"||e=="documentSelection"||e=="model:documentSelection"}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(e,t,i){this._selection.setTo(e,t,i)}_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 bf+e}static _isStoreAttributeKey(e){return e.startsWith(bf)}}ys(wf,ds);class kf extends af{constructor(e){super();this.markers=new xs({idProperty:"name"});this._model=e.model;this._document=e;this._attributePriority=new Map;this._selectionRestorePosition=null;this._hasChangedRange=false;this._overriddenGravityRegister=new Set;this.listenTo(this._model,"applyOperation",(e,t)=>{const i=t[0];if(!i.isDocumentOperation||i.type=="marker"||i.type=="rename"||i.type=="noop"){return}if(this._ranges.length==0&&this._selectionRestorePosition){this._fixGraveyardSelection(this._selectionRestorePosition)}this._selectionRestorePosition=null;if(this._hasChangedRange){this._hasChangedRange=false;this.fire("change:range",{directChange:false})}},{priority:"lowest"});this.on("change:range",()=>{for(const e of this.getRanges()){if(!this._document._validateSelectionRange(e)){throw new ss["b"]("document-selection-wrong-position: Range from document selection starts or ends at incorrect position.",this,{range:e})}}});this.listenTo(this._model.markers,"update",()=>this._updateMarkers());this.listenTo(this._document,"change",(e,t)=>{vf(this._model,t)})}get isCollapsed(){const e=this._ranges.length;return e===0?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._hasChangedRange=true;if(t.root==this._document.graveyard){this._selectionRestorePosition=n.deletionPosition;const e=this._ranges.indexOf(t);this._ranges.splice(e,1);t.detach()}});return t}_updateMarkers(){const e=[];let t=false;for(const t of this._model.markers){const i=t.getRange();for(const n of this.getRanges()){if(i.containsRange(n,!n.isCollapsed)){e.push(t)}}}const i=Array.from(this.markers);for(const i of e){if(!this.markers.has(i)){this.markers.add(i);t=true}}for(const i of Array.from(this.markers)){if(!e.includes(i)){this.markers.remove(i);t=true}}if(t){this.fire("change:marker",{oldMarkers:i,directChange:false})}}_updateAttributes(e){const t=Us(this._getSurroundingAttributes());const i=Us(this.getAttributes());if(e){this._attributePriority=new Map;this._attrs=new Map}else{for(const[e,t]of this._attributePriority){if(t=="low"){this._attrs.delete(e);this._attributePriority.delete(e)}}}this._setAttributesTo(t);const n=[];for(const[e,t]of this.getAttributes()){if(!i.has(e)||i.get(e)!==t){n.push(e)}}for(const[e]of i){if(!this.hasAttribute(e)){n.push(e)}}if(n.length>0){this.fire("change:attribute",{attributeKeys:n,directChange:false})}}_setAttribute(e,t,i=true){const n=i?"normal":"low";if(n=="low"&&this._attributePriority.get(e)=="normal"){return false}const o=super.getAttribute(e);if(o===t){return false}this._attrs.set(e,t);this._attributePriority.set(e,n);return true}_removeAttribute(e,t=true){const i=t?"normal":"low";if(i=="low"&&this._attributePriority.get(e)=="normal"){return false}this._attributePriority.set(e,i);if(!super.hasAttribute(e)){return false}this._attrs.delete(e);return true}_setAttributesTo(e){const t=new Set;for(const[t,i]of this.getAttributes()){if(e.get(t)===i){continue}this._removeAttribute(t,false)}for(const[i,n]of e){const e=this._setAttribute(i,n,false);if(e){t.add(i)}}return t}*_getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty){for(const t of e.getAttributeKeys()){if(t.startsWith(bf)){const i=t.substr(bf.length);yield[i,e.getAttribute(t)]}}}}_getSurroundingAttributes(){const e=this.getFirstPosition();const t=this._model.schema;let i=null;if(!this.isCollapsed){const e=this.getFirstRange();for(const n of e){if(n.item.is("element")&&t.isObject(n.item)){break}if(n.type=="text"){i=n.item.getAttributes();break}}}else{const t=e.textNode?e.textNode:e.nodeBefore;const n=e.textNode?e.textNode:e.nodeAfter;if(!this.isGravityOverridden){i=_f(t)}if(!i){i=_f(n)}if(!this.isGravityOverridden&&!i){let e=t;while(e&&!i){e=e.previousSibling;i=_f(e)}}if(!i){let e=n;while(e&&!i){e=e.nextSibling;i=_f(e)}}if(!i){i=this._getStoredAttributes()}}return i}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);if(t){this._pushRange(t)}}}function _f(e){if(e instanceof Wh||e instanceof Uh){return e.getAttributes()}return null}function vf(e,t){const i=e.document.differ;for(const n of i.getChanges()){if(n.type!="insert"){continue}const i=n.position.parent;const o=n.length===i.maxOffset;if(o){e.enqueueChange(t,e=>{const t=Array.from(i.getAttributeKeys()).filter(e=>e.startsWith(bf));for(const n of t){e.removeAttribute(n,i)}})}}}class yf{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers){e(t)}return this}}var xf=1,Af=4;function Tf(e){return Hr(e,xf|Af)}var Cf=Tf;class Pf extends yf{elementToElement(e){return this.add(Yf(e))}attributeToElement(e){return this.add(Gf(e))}attributeToAttribute(e){return this.add(Kf(e))}markerToElement(e){return this.add(Qf(e))}markerToHighlight(e){return this.add(Zf(e))}markerToData(e){return this.add(Jf(e))}}function Ef(){return(e,t,i)=>{if(!i.consumable.consume(t.item,"insert")){return}const n=i.writer;const o=i.mapper.toViewPosition(t.range.start);const r=n.createText(t.item.data);n.insert(o,r)}}function Sf(){return(e,t,i)=>{const n=i.mapper.toViewPosition(t.position);const o=t.position.getShiftedBy(t.length);const r=i.mapper.toViewPosition(o,{isPhantom:true});const s=i.writer.createRange(n,r);const a=i.writer.remove(s.getTrimmed());for(const e of i.writer.createRangeIn(a).getItems()){i.mapper.unbindViewElement(e)}}}function Mf(e,t){const i=e.createAttributeElement("span",t.attributes);if(t.classes){i._addClass(t.classes)}if(t.priority){i._priority=t.priority}i._id=t.id;return i}function If(){return(e,t,i)=>{const n=t.selection;if(n.isCollapsed){return}if(!i.consumable.consume(n,"selection")){return}const o=[];for(const e of n.getRanges()){const t=i.mapper.toViewRange(e);o.push(t)}i.writer.setSelection(o,{backward:n.isBackward})}}function Nf(){return(e,t,i)=>{const n=t.selection;if(!n.isCollapsed){return}if(!i.consumable.consume(n,"selection")){return}const o=i.writer;const r=n.getFirstPosition();const s=i.mapper.toViewPosition(r);const a=o.breakAttributes(s);o.setSelection(a)}}function Of(){return(e,t,i)=>{const n=i.writer;const o=n.document.selection;for(const e of o.getRanges()){if(e.isCollapsed){if(e.end.parent.isAttached()){i.writer.mergeAttributes(e.start)}}}n.setSelection(null)}}function zf(e){return(t,i,n)=>{const o=e(i.attributeOldValue,n.writer);const r=e(i.attributeNewValue,n.writer);if(!o&&!r){return}if(!n.consumable.consume(i.item,t.name)){return}const s=n.writer;const a=s.document.selection;if(i.item instanceof af||i.item instanceof wf){s.wrap(a.getFirstRange(),r)}else{let e=n.mapper.toViewRange(i.range);if(i.attributeOldValue!==null&&o){e=s.unwrap(e,o)}if(i.attributeNewValue!==null&&r){s.wrap(e,r)}}}}function Rf(e){return(t,i,n)=>{const o=e(i.item,n.writer);if(!o){return}if(!n.consumable.consume(i.item,"insert")){return}const r=n.mapper.toViewPosition(i.range.start);n.mapper.bindElements(i.item,o);n.writer.insert(r,o)}}function Lf(e){return(t,i,n)=>{i.isOpening=true;const o=e(i,n.writer);i.isOpening=false;const r=e(i,n.writer);if(!o||!r){return}const s=i.markerRange;if(s.isCollapsed&&!n.consumable.consume(s,t.name)){return}for(const e of s){if(!n.consumable.consume(e.item,t.name)){return}}const a=n.mapper;const c=n.writer;c.insert(a.toViewPosition(s.start),o);n.mapper.bindElementToMarker(o,i.markerName);if(!s.isCollapsed){c.insert(a.toViewPosition(s.end),r);n.mapper.bindElementToMarker(r,i.markerName)}t.stop()}}function Df(){return(e,t,i)=>{const n=i.mapper.markerNameToElements(t.markerName);if(!n){return}for(const e of n){i.mapper.unbindElementFromMarkerName(e,t.markerName);i.writer.clear(i.writer.createRangeOn(e),e)}i.writer.clearClonedElementsGroup(t.markerName);e.stop()}}function Vf(e){return(t,i,n)=>{const o=e(i.markerName);if(!o){return}const r=i.markerRange;if(!n.consumable.consume(r,t.name)){return}jf(r,false,n,i,o);jf(r,true,n,i,o);t.stop()}}function jf(e,t,i,n,o){const r=t?e.start:e.end;const s=i.schema.checkChild(r,"$text");if(s){const e=i.mapper.toViewPosition(r);Ff(e,t,i,n,o)}else{let e;let s;if(t&&r.nodeAfter||!t&&!r.nodeBefore){e=r.nodeAfter;s=true}else{e=r.nodeBefore;s=false}const a=i.mapper.toViewElement(e);Bf(a,t,s,i,n,o)}}function Bf(e,t,i,n,o,r){const s=`data-${r.group}-${t?"start":"end"}-${i?"before":"after"}`;const a=e.hasAttribute(s)?e.getAttribute(s).split(","):[];a.unshift(r.name);n.writer.setAttribute(s,a.join(","),e);n.mapper.bindElementToMarker(e,o.markerName)}function Ff(e,t,i,n,o){const r=`${o.group}-${t?"start":"end"}`;const s=o.name?{name:o.name}:null;const a=i.writer.createUIElement(r,s);i.writer.insert(e,a);i.mapper.bindElementToMarker(a,n.markerName)}function Hf(e){return(t,i,n)=>{const o=e(i.markerName);if(!o){return}const r=n.mapper.markerNameToElements(i.markerName);if(!r){return}for(const e of r){n.mapper.unbindElementFromMarkerName(e,i.markerName);if(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)}else{n.writer.clear(n.writer.createRangeOn(e),e)}}n.writer.clearClonedElementsGroup(i.markerName);t.stop();function s(e,t){if(t.hasAttribute(e)){const i=new Set(t.getAttribute(e).split(","));i.delete(o.name);if(i.size==0){n.writer.removeAttribute(e,t)}else{n.writer.setAttribute(e,Array.from(i).join(","),t)}}}}}function Uf(e){return(t,i,n)=>{const o=e(i.attributeOldValue,i);const r=e(i.attributeNewValue,i);if(!o&&!r){return}if(!n.consumable.consume(i.item,t.name)){return}const s=n.mapper.toViewElement(i.item);const a=n.writer;if(!s){throw new ss["b"]("conversion-attribute-to-attribute-on-text: "+"Trying to convert text node's attribute with attribute-to-attribute converter.",[i,n])}if(i.attributeOldValue!==null&&o){if(o.key=="class"){const e=Array.isArray(o.value)?o.value:[o.value];for(const t of e){a.removeClass(t,s)}}else if(o.key=="style"){const e=Object.keys(o.value);for(const t of e){a.removeStyle(t,s)}}else{a.removeAttribute(o.key,s)}}if(i.attributeNewValue!==null&&r){if(r.key=="class"){const e=Array.isArray(r.value)?r.value:[r.value];for(const t of e){a.addClass(t,s)}}else if(r.key=="style"){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)}}}}function Wf(e){return(t,i,n)=>{if(!i.item){return}if(!(i.item instanceof af||i.item instanceof wf)&&!i.item.is("$textProxy")){return}const o=nm(e,i,n);if(!o){return}if(!n.consumable.consume(i.item,t.name)){return}const r=n.writer;const s=Mf(r,o);const a=r.document.selection;if(i.item instanceof af||i.item instanceof wf){r.wrap(a.getFirstRange(),s,a)}else{const e=n.mapper.toViewRange(i.range);const t=r.wrap(e,s);for(const e of t.getItems()){if(e.is("attributeElement")&&e.isSimilar(s)){n.mapper.bindElementToMarker(e,i.markerName);break}}}}}function qf(e){return(t,i,n)=>{if(!i.item){return}if(!(i.item instanceof $h)){return}const o=nm(e,i,n);if(!o){return}if(!n.consumable.test(i.item,t.name)){return}const r=n.mapper.toViewElement(i.item);if(r&&r.getCustomProperty("addHighlight")){n.consumable.consume(i.item,t.name);for(const e of ef._createIn(i.item)){n.consumable.consume(e.item,t.name)}r.getCustomProperty("addHighlight")(r,o,n.writer);n.mapper.bindElementToMarker(r,i.markerName)}}}function $f(e){return(t,i,n)=>{if(i.markerRange.isCollapsed){return}const o=nm(e,i,n);if(!o){return}const r=Mf(n.writer,o);const s=n.mapper.markerNameToElements(i.markerName);if(!s){return}for(const e of s){n.mapper.unbindElementFromMarkerName(e,i.markerName);if(e.is("attributeElement")){n.writer.unwrap(n.writer.createRangeOn(e),r)}else{e.getCustomProperty("removeHighlight")(e,o.id,n.writer)}}n.writer.clearClonedElementsGroup(i.markerName);t.stop()}}function Yf(e){e=Cf(e);e.view=Xf(e.view,"container");return t=>{t.on("insert:"+e.model,Rf(e.view),{priority:e.converterPriority||"normal"})}}function Gf(e){e=Cf(e);const t=e.model.key?e.model.key:e.model;let i="attribute:"+t;if(e.model.name){i+=":"+e.model.name}if(e.model.values){for(const t of e.model.values){e.view[t]=Xf(e.view[t],"attribute")}}else{e.view=Xf(e.view,"attribute")}const n=tm(e);return t=>{t.on(i,zf(n),{priority:e.converterPriority||"normal"})}}function Kf(e){e=Cf(e);const t=e.model.key?e.model.key:e.model;let i="attribute:"+t;if(e.model.name){i+=":"+e.model.name}if(e.model.values){for(const t of e.model.values){e.view[t]=im(e.view[t])}}else{e.view=im(e.view)}const n=tm(e);return t=>{t.on(i,Uf(n),{priority:e.converterPriority||"normal"})}}function Qf(e){e=Cf(e);e.view=Xf(e.view,"ui");return t=>{t.on("addMarker:"+e.model,Lf(e.view),{priority:e.converterPriority||"normal"});t.on("removeMarker:"+e.model,Df(e.view),{priority:e.converterPriority||"normal"})}}function Jf(e){e=Cf(e);const t=e.model;if(!e.view){e.view=i=>({group:t,name:i.substr(e.model.length+1)})}return i=>{i.on("addMarker:"+t,Vf(e.view),{priority:e.converterPriority||"normal"});i.on("removeMarker:"+t,Hf(e.view),{priority:e.converterPriority||"normal"})}}function Zf(e){return t=>{t.on("addMarker:"+e.model,Wf(e.view),{priority:e.converterPriority||"normal"});t.on("addMarker:"+e.model,qf(e.view),{priority:e.converterPriority||"normal"});t.on("removeMarker:"+e.model,$f(e.view),{priority:e.converterPriority||"normal"})}}function Xf(e,t){if(typeof e=="function"){return e}return(i,n)=>em(e,n,t)}function em(e,t,i){if(typeof e=="string"){e={name:e}}let n;const o=Object.assign({},e.attributes);if(i=="container"){n=t.createContainerElement(e.name,o)}else if(i=="attribute"){const i={priority:e.priority||kl.DEFAULT_PRIORITY};n=t.createAttributeElement(e.name,o,i)}else{n=t.createUIElement(e.name,o)}if(e.styles){const i=Object.keys(e.styles);for(const o of i){t.setStyle(o,e.styles[o],n)}}if(e.classes){const i=e.classes;if(typeof i=="string"){t.addClass(i,n)}else{for(const e of i){t.addClass(e,n)}}}return n}function tm(e){if(e.model.values){return(t,i)=>{const n=e.view[t];if(n){return n(t,i)}return null}}else{return e.view}}function im(e){if(typeof e=="string"){return t=>({key:e,value:t})}else if(typeof e=="object"){if(e.value){return()=>e}else{return t=>({key:e.key,value:t})}}else{return e}}function nm(e,t,i){const n=typeof e=="function"?e(t,i):e;if(!n){return null}if(!n.priority){n.priority=10}if(!n.id){n.id=t.markerName}return n}class om extends yf{elementToElement(e){return this.add(cm(e))}elementToAttribute(e){return this.add(lm(e))}attributeToAttribute(e){return this.add(dm(e))}elementToMarker(e){console.warn(Object(ss["a"])("upcast-helpers-element-to-marker-deprecated: "+"The UpcastHelpers#elementToMarker() method has been deprecated and will be removed in the near future. "+"Please use UpcastHelpers#dataToMarker() instead."));return this.add(um(e))}dataToMarker(e){return this.add(hm(e))}}function rm(){return(e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:true})){const{modelRange:e,modelCursor:n}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e;t.modelCursor=n}}}function sm(){return(e,t,i)=>{if(i.schema.checkChild(t.modelCursor,"$text")){if(i.consumable.consume(t.viewItem)){const e=i.writer.createText(t.viewItem.data);i.writer.insert(e,t.modelCursor);t.modelRange=ef._createFromPositionAndShift(t.modelCursor,e.offsetSize);t.modelCursor=t.modelRange.end}}}}function am(e,t){return(i,n)=>{const o=n.newSelection;const r=new af;const s=[];for(const e of o.getRanges()){s.push(t.toModelRange(e))}r.setTo(s,{backward:o.isBackward});if(!r.isEqual(e.document.selection)){e.change(e=>{e.setSelection(r)})}}}function cm(e){e=Cf(e);const t=gm(e);const i=mm(e.view);const n=i?"element:"+i:"element";return i=>{i.on(n,t,{priority:e.converterPriority||"normal"})}}function lm(e){e=Cf(e);wm(e);const t=km(e,false);const i=mm(e.view);const n=i?"element:"+i:"element";return i=>{i.on(n,t,{priority:e.converterPriority||"low"})}}function dm(e){e=Cf(e);let t=null;if(typeof e.view=="string"||e.view.key){t=bm(e)}wm(e,t);const i=km(e,true);return t=>{t.on("element",i,{priority:e.converterPriority||"low"})}}function um(e){e=Cf(e);ym(e);return cm(e)}function hm(e){e=Cf(e);if(!e.model){e.model=t=>t?e.view+":"+t:e.view}const t=gm(xm(e,"start"));const i=gm(xm(e,"end"));return n=>{n.on("element:"+e.view+"-start",t,{priority:e.converterPriority||"normal"});n.on("element:"+e.view+"-end",i,{priority:e.converterPriority||"normal"});const o=os.get("low");const r=os.get("highest");const s=os.get(e.converterPriority)/r;n.on("element",fm(e),{priority:o+s})}}function fm(e){return(t,i,n)=>{const o=`data-${e.view}`;if(!i.modelRange){i=Object.assign(i,n.convertChildren(i.viewItem,i.modelCursor))}if(n.consumable.consume(i.viewItem,{attributes:o+"-end-after"})){r(i.modelRange.end,i.viewItem.getAttribute(o+"-end-after").split(","))}if(n.consumable.consume(i.viewItem,{attributes:o+"-start-after"})){r(i.modelRange.end,i.viewItem.getAttribute(o+"-start-after").split(","))}if(n.consumable.consume(i.viewItem,{attributes:o+"-end-before"})){r(i.modelRange.start,i.viewItem.getAttribute(o+"-end-before").split(","))}if(n.consumable.consume(i.viewItem,{attributes:o+"-start-before"})){r(i.modelRange.start,i.viewItem.getAttribute(o+"-start-before").split(","))}function r(t,o){for(const r of o){const o=e.model(r);const s=n.writer.createElement("$marker",{"data-name":o});n.writer.insert(s,t);if(i.modelCursor.isEqual(t)){i.modelCursor=i.modelCursor.getShiftedBy(1)}else{i.modelCursor=i.modelCursor._getTransformedByInsertion(t,1)}i.modelRange=i.modelRange._getTransformedByInsertion(t,1)[0]}}}}function mm(e){if(typeof e=="string"){return e}if(typeof e=="object"&&typeof e.name=="string"){return e.name}return null}function gm(e){const t=e.view?new Ws(e.view):null;return(i,n,o)=>{let r={};if(t){const e=t.match(n.viewItem);if(!e){return}r=e.match}r.name=true;const s=pm(e.model,n.viewItem,o.writer);if(!s){return}if(!o.consumable.test(n.viewItem,r)){return}const a=o.splitToAllowedParent(s,n.modelCursor);if(!a){return}o.writer.insert(s,a.position);o.convertChildren(n.viewItem,o.writer.createPositionAt(s,0));o.consumable.consume(n.viewItem,r);const c=o.getSplitParts(s);n.modelRange=new ef(o.writer.createPositionBefore(s),o.writer.createPositionAfter(c[c.length-1]));if(a.cursorParent){n.modelCursor=o.writer.createPositionAt(a.cursorParent,0)}else{n.modelCursor=n.modelRange.end}}}function pm(e,t,i){if(e instanceof Function){return e(t,i)}else{return i.createElement(e)}}function bm(e){if(typeof e.view=="string"){e.view={key:e.view}}const t=e.view.key;let i;if(t=="class"||t=="style"){const n=t=="class"?"classes":"styles";i={[n]:e.view.value}}else{const n=typeof e.view.value=="undefined"?/[\s\S]*/:e.view.value;i={attributes:{[t]:n}}}if(e.view.name){i.name=e.view.name}e.view=i;return t}function wm(e,t=null){const i=t===null?true:e=>e.getAttribute(t);const n=typeof e.model!="object"?e.model:e.model.key;const o=typeof e.model!="object"||typeof e.model.value=="undefined"?i:e.model.value;e.model={key:n,value:o}}function km(e,t){const i=new Ws(e.view);return(n,o,r)=>{const s=i.match(o.viewItem);if(!s){return}const a=e.model.key;const c=typeof e.model.value=="function"?e.model.value(o.viewItem):e.model.value;if(c===null){return}if(_m(e.view,o.viewItem)){s.match.name=true}else{delete s.match.name}if(!r.consumable.test(o.viewItem,s.match)){return}if(!o.modelRange){o=Object.assign(o,r.convertChildren(o.viewItem,o.modelCursor))}const l=vm(o.modelRange,{key:a,value:c},t,r);if(l){r.consumable.consume(o.viewItem,s.match)}}}function _m(e,t){const i=typeof e=="function"?e(t):e;if(typeof i=="object"&&!mm(i)){return false}return!i.classes&&!i.attributes&&!i.styles}function vm(e,t,i,n){let o=false;for(const r of Array.from(e.getItems({shallow:i}))){if(n.schema.checkAttribute(r,t.key)){n.writer.setAttribute(t.key,t.value,r);o=true}}return o}function ym(e){const t=e.model;e.model=(e,i)=>{const n=typeof t=="string"?t:t(e);return i.createElement("$marker",{"data-name":n})}}function xm(e,t){const i={};i.view=e.view+"-"+t;i.model=(t,i)=>{const n=t.getAttribute("name");const o=e.model(n);return i.createElement("$marker",{"data-name":o})};return i}class Am{constructor(e,t){this.model=e;this.view=new Fh(t);this.mapper=new tf;this.downcastDispatcher=new rf({mapper:this.mapper,schema:e.schema});const i=this.model.document;const n=i.selection;const o=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(true)},{priority:"highest"});this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(false)},{priority:"lowest"});this.listenTo(i,"change",()=>{this.view.change(e=>{this.downcastDispatcher.convertChanges(i.differ,o,e);this.downcastDispatcher.convertSelection(n,o,e)})},{priority:"low"});this.listenTo(this.view.document,"selectionChange",am(this.model,this.mapper));this.downcastDispatcher.on("insert:$text",Ef(),{priority:"lowest"});this.downcastDispatcher.on("remove",Sf(),{priority:"low"});this.downcastDispatcher.on("selection",Of(),{priority:"low"});this.downcastDispatcher.on("selection",If(),{priority:"low"});this.downcastDispatcher.on("selection",Nf(),{priority:"low"});this.view.document.roots.bindTo(this.model.document.roots).using(e=>{if(e.rootName=="$graveyard"){return null}const t=new ll(this.view.document,e.name);t.rootName=e.rootName;this.mapper.bindElements(e,t);return t})}destroy(){this.view.destroy();this.stopListening()}}ys(Am,Qc);class Tm{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const i=this.get(e);if(!i){throw new ss["b"]("commandcollection-command-not-found: Command does not exist.",this,{commandName:e})}return i.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 Cm{constructor(){this._consumables=new Map}add(e,t){let i;if(e.is("$text")||e.is("documentFragment")){this._consumables.set(e,true);return}if(!this._consumables.has(e)){i=new Pm(e);this._consumables.set(e,i)}else{i=this._consumables.get(e)}i.add(t)}test(e,t){const i=this._consumables.get(e);if(i===undefined){return null}if(e.is("$text")||e.is("documentFragment")){return i}return i.test(t)}consume(e,t){if(this.test(e,t)){if(e.is("$text")||e.is("documentFragment")){this._consumables.set(e,false)}else{this._consumables.get(e).consume(t)}return true}return false}revert(e,t){const i=this._consumables.get(e);if(i!==undefined){if(e.is("$text")||e.is("documentFragment")){this._consumables.set(e,true)}else{i.revert(t)}}}static consumablesFromElement(e){const t={element:e,name:true,attributes:[],classes:[],styles:[]};const i=e.getAttributeKeys();for(const e of i){if(e=="style"||e=="class"){continue}t.attributes.push(e)}const n=e.getClassNames();for(const e of n){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 Cm(e)}if(e.is("$text")){t.add(e);return t}if(e.is("element")){t.add(e,Cm.consumablesFromElement(e))}if(e.is("documentFragment")){t.add(e)}for(const i of e.getChildren()){t=Cm.createFrom(i,t)}return t}}class Pm{constructor(e){this.element=e;this._canConsumeName=null;this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){if(e.name){this._canConsumeName=true}for(const t in this._consumables){if(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 i=this._test(t,e[t]);if(i!==true){return i}}}return true}consume(e){if(e.name){this._canConsumeName=false}for(const t in this._consumables){if(t in e){this._consume(t,e[t])}}}revert(e){if(e.name){this._canConsumeName=true}for(const t in this._consumables){if(t in e){this._revert(t,e[t])}}}_add(e,t){const i=Kt(t)?t:[t];const n=this._consumables[e];for(const t of i){if(e==="attributes"&&(t==="class"||t==="style")){throw new ss["b"]("viewconsumable-invalid-attribute: Classes and styles should be handled separately.",this)}n.set(t,true);if(e==="styles"){for(const e of this.element.document.stylesProcessor.getRelatedStyles(t)){n.set(e,true)}}}}_test(e,t){const i=Kt(t)?t:[t];const n=this._consumables[e];for(const t of i){if(e==="attributes"&&(t==="class"||t==="style")){const e=t=="class"?"classes":"styles";const i=this._test(e,[...this._consumables[e].keys()]);if(i!==true){return i}}else{const e=n.get(t);if(e===undefined){return null}if(!e){return false}}}return true}_consume(e,t){const i=Kt(t)?t:[t];const n=this._consumables[e];for(const t of i){if(e==="attributes"&&(t==="class"||t==="style")){const e=t=="class"?"classes":"styles";this._consume(e,[...this._consumables[e].keys()])}else{n.set(t,false);if(e=="styles"){for(const e of this.element.document.stylesProcessor.getRelatedStyles(t)){n.set(e,false)}}}}}_revert(e,t){const i=Kt(t)?t:[t];const n=this._consumables[e];for(const t of i){if(e==="attributes"&&(t==="class"||t==="style")){const e=t=="class"?"classes":"styles";this._revert(e,[...this._consumables[e].keys()])}else{const e=n.get(t);if(e===false){n.set(t,true)}}}}}class Em{constructor(){this._sourceDefinitions={};this._attributeProperties={};this.decorate("checkChild");this.decorate("checkAttribute");this.on("checkAttribute",(e,t)=>{t[0]=new Sm(t[0])},{priority:"highest"});this.on("checkChild",(e,t)=>{t[0]=new Sm(t[0]);t[1]=this.getDefinition(t[1])},{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e]){throw new ss["b"]("schema-cannot-register-item-twice: A single item cannot be registered twice in the schema.",this,{itemName:e})}this._sourceDefinitions[e]=[Object.assign({},t)];this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e]){throw new ss["b"]("schema-cannot-extend-missing-item: Cannot extend an item which was not registered yet.",this,{itemName:e})}this._sourceDefinitions[e].push(Object.assign({},t));this._clearCache()}getDefinitions(){if(!this._compiledDefinitions){this._compile()}return this._compiledDefinitions}getDefinition(e){let t;if(typeof e=="string"){t=e}else if(e.is&&(e.is("$text")||e.is("$textProxy"))){t="$text"}else{t=e.name}return 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);if(!t){return false}return!!(t.isLimit||t.isObject)}isObject(e){const t=this.getDefinition(e);return!!(t&&t.isObject)}isInline(e){const t=this.getDefinition(e);return!!(t&&t.isInline)}checkChild(e,t){if(!t){return false}return this._checkContextMatch(t,e)}checkAttribute(e,t){const i=this.getDefinition(e.last);if(!i){return false}return i.allowAttributes.includes(t)}checkMerge(e,t=null){if(e instanceof Qh){const t=e.nodeBefore;const i=e.nodeAfter;if(!(t instanceof $h)){throw new ss["b"]("schema-check-merge-no-element-before: The node before the merge position must be an element.",this)}if(!(i instanceof $h)){throw new ss["b"]("schema-check-merge-no-element-after: The node after the merge position must be an element.",this)}return this.checkMerge(t,i)}for(const i of t.getChildren()){if(!this.checkChild(e,i)){return false}}return true}addChildCheck(e){this.on("checkChild",(t,[i,n])=>{if(!n){return}const o=e(i,n);if(typeof o=="boolean"){t.stop();t.return=o}},{priority:"high"})}addAttributeCheck(e){this.on("checkAttribute",(t,[i,n])=>{const o=e(i,n);if(typeof o=="boolean"){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 Qh){t=e.parent}else{const i=e instanceof ef?[e]:Array.from(e.getRanges());t=i.reduce((e,t)=>{const i=t.getCommonAncestor();if(!e){return i}return e.getCommonAncestor(i,{includeSelf:true})},null)}while(!this.isLimit(t)){if(t.parent){t=t.parent}else{break}}return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const i=e.getFirstPosition();const n=[...i.getAncestors(),new Uh("",e.getAttributes())];return this.checkAttribute(n,t)}else{const i=e.getRanges();for(const e of i){for(const i of e){if(this.checkAttribute(i.item,t)){return true}}}}return false}*getValidRanges(e,t){e=Wm(e);for(const i of e){yield*this._getValidRangesForRange(i,t)}}getNearestSelectionRange(e,t="both"){if(this.checkChild(e,"$text")){return new ef(e)}let i,n;const o=e.getAncestors().reverse().find(e=>this.isLimit(e))||e.root;if(t=="both"||t=="backward"){i=new Gh({boundaries:ef._createIn(o),startPosition:e,direction:"backward"})}if(t=="both"||t=="forward"){n=new Gh({boundaries:ef._createIn(o),startPosition:e})}for(const e of Um(i,n)){const t=e.walker==i?"elementEnd":"elementStart";const n=e.value;if(n.type==t&&this.isObject(n.item)){return ef._createOn(n.item)}if(this.checkChild(n.nextPosition,"$text")){return new ef(n.nextPosition)}}return null}findAllowedParent(e,t){let i=e.parent;while(i){if(this.checkChild(i,t)){return i}if(this.isLimit(i)){return null}i=i.parent}return null}removeDisallowedAttributes(e,t){for(const i of e){if(i.is("$text")){qm(this,i,t)}else{const e=ef._createIn(i);const n=e.getPositions();for(const e of n){const i=e.nodeBefore||e.parent;qm(this,i,t)}}}}createContext(e){return new Sm(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={};const t=this._sourceDefinitions;const i=Object.keys(t);for(const n of i){e[n]=Mm(t[n],n)}for(const t of i){Im(e,t)}for(const t of i){Nm(e,t)}for(const t of i){Om(e,t);zm(e,t)}for(const t of i){Rm(e,t);Lm(e,t)}this._compiledDefinitions=e}_checkContextMatch(e,t,i=t.length-1){const n=t.getItem(i);if(e.allowIn.includes(n.name)){if(i==0){return true}else{const e=this.getDefinition(n);return this._checkContextMatch(e,t,i-1)}}else{return false}}*_getValidRangesForRange(e,t){let i=e.start;let n=e.start;for(const o of e.getItems({shallow:true})){if(o.is("element")){yield*this._getValidRangesForRange(ef._createIn(o),t)}if(!this.checkAttribute(o,t)){if(!i.isEqual(n)){yield new ef(i,n)}i=Qh._createAfter(o)}n=Qh._createAfter(o)}if(!i.isEqual(n)){yield new ef(i,n)}}}ys(Em,Qc);class Sm{constructor(e){if(e instanceof Sm){return e}if(typeof e=="string"){e=[e]}else if(!Array.isArray(e)){e=e.getAncestors({includeSelf:true})}if(e[0]&&typeof e[0]!="string"&&e[0].is("documentFragment")){e.shift()}this._items=e.map(Hm)}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 Sm([e]);t._items=[...this._items,...t._items];return 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 Mm(e,t){const i={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};Dm(e,i);Vm(e,i,"allowIn");Vm(e,i,"allowContentOf");Vm(e,i,"allowWhere");Vm(e,i,"allowAttributes");Vm(e,i,"allowAttributesOf");Vm(e,i,"inheritTypesFrom");jm(e,i);return i}function Im(e,t){for(const i of e[t].allowContentOf){if(e[i]){const n=Bm(e,i);n.forEach(e=>{e.allowIn.push(t)})}}delete e[t].allowContentOf}function Nm(e,t){for(const i of e[t].allowWhere){const n=e[i];if(n){const i=n.allowIn;e[t].allowIn.push(...i)}}delete e[t].allowWhere}function Om(e,t){for(const i of e[t].allowAttributesOf){const n=e[i];if(n){const i=n.allowAttributes;e[t].allowAttributes.push(...i)}}delete e[t].allowAttributesOf}function zm(e,t){const i=e[t];for(const t of i.inheritTypesFrom){const n=e[t];if(n){const e=Object.keys(n).filter(e=>e.startsWith("is"));for(const t of e){if(!(t in i)){i[t]=n[t]}}}}delete i.inheritTypesFrom}function Rm(e,t){const i=e[t];const n=i.allowIn.filter(t=>e[t]);i.allowIn=Array.from(new Set(n))}function Lm(e,t){const i=e[t];i.allowAttributes=Array.from(new Set(i.allowAttributes))}function Dm(e,t){for(const i of e){const e=Object.keys(i).filter(e=>e.startsWith("is"));for(const n of e){t[n]=i[n]}}}function Vm(e,t,i){for(const n of e){if(typeof n[i]=="string"){t[i].push(n[i])}else if(Array.isArray(n[i])){t[i].push(...n[i])}}}function jm(e,t){for(const i of e){const e=i.inheritAllFrom;if(e){t.allowContentOf.push(e);t.allowWhere.push(e);t.allowAttributesOf.push(e);t.inheritTypesFrom.push(e)}}}function Bm(e,t){const i=e[t];return Fm(e).filter(e=>e.allowIn.includes(i.name))}function Fm(e){return Object.keys(e).map(t=>e[t])}function Hm(e){if(typeof e=="string"){return{name:e,*getAttributeKeys(){},getAttribute(){}}}else{return{name:e.is("element")?e.name:"$text",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute(t){return e.getAttribute(t)}}}}function*Um(e,t){let i=false;while(!i){i=true;if(e){const t=e.next();if(!t.done){i=false;yield{walker:e,value:t.value}}}if(t){const e=t.next();if(!e.done){i=false;yield{walker:t,value:e.value}}}}}function*Wm(e){for(const t of e){yield*t.getMinimalFlatRanges()}}function qm(e,t,i){for(const n of t.getAttributeKeys()){if(!e.checkAttribute(t,n)){i.removeAttribute(n,t)}}}class $m{constructor(e={}){this._splitParts=new Map;this._modelCursor=null;this.conversionApi=Object.assign({},e);this.conversionApi.convertItem=this._convertItem.bind(this);this.conversionApi.convertChildren=this._convertChildren.bind(this);this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this);this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}convert(e,t,i=["$root"]){this.fire("viewCleanup",e);this._modelCursor=Gm(i,t);this.conversionApi.writer=t;this.conversionApi.consumable=Cm.createFrom(e);this.conversionApi.store={};const{modelRange:n}=this._convertItem(e,this._modelCursor);const o=t.createDocumentFragment();if(n){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren())){t.append(e,o)}o.markers=Ym(o,t)}this._modelCursor=null;this._splitParts.clear();this.conversionApi.writer=null;this.conversionApi.store=null;return o}_convertItem(e,t){const i=Object.assign({viewItem:e,modelCursor:t,modelRange:null});if(e.is("element")){this.fire("element:"+e.name,i,this.conversionApi)}else if(e.is("$text")){this.fire("text",i,this.conversionApi)}else{this.fire("documentFragment",i,this.conversionApi)}if(i.modelRange&&!(i.modelRange instanceof ef)){throw new ss["b"]("view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.",this)}return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(e,t){const i=new ef(t);let n=t;for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,n);if(e.modelRange instanceof ef){i.end=e.modelRange.end;n=e.modelCursor}}return{modelRange:i,modelCursor:n}}_splitToAllowedParent(e,t){const i=this.conversionApi.schema.findAllowedParent(t,e);if(!i){return null}if(i===t.parent){return{position:t}}if(this._modelCursor.parent.getAncestors().includes(i)){return null}const n=this.conversionApi.writer.split(t,i);const o=[];for(const e of n.range.getWalker()){if(e.type=="elementEnd"){o.push(e.item)}else{const t=o.pop();const i=e.item;this._registerSplitPair(t,i)}}return{position:n.position,cursorParent:n.range.end.parent}}_registerSplitPair(e,t){if(!this._splitParts.has(e)){this._splitParts.set(e,[e])}const i=this._splitParts.get(e);this._splitParts.set(t,i);i.push(t)}_getSplitParts(e){let t;if(!this._splitParts.has(e)){t=[e]}else{t=this._splitParts.get(e)}return t}_removeEmptyElements(){let e=false;for(const t of this._splitParts.keys()){if(t.isEmpty){this.conversionApi.writer.remove(t);this._splitParts.delete(t);e=true}}if(e){this._removeEmptyElements()}}}ys($m,ds);function Ym(e,t){const i=new Set;const n=new Map;const o=ef._createIn(e).getItems();for(const e of o){if(e.name=="$marker"){i.add(e)}}for(const e of i){const i=e.getAttribute("data-name");const o=t.createPositionBefore(e);if(!n.has(i)){n.set(i,new ef(o.clone()))}else{n.get(i).end=o.clone()}t.remove(e)}return n}function Gm(e,t){let i;for(const n of new Sm(e)){const e={};for(const t of n.getAttributeKeys()){e[t]=n.getAttribute(t)}const o=t.createElement(n.name,e);if(i){t.append(o,i)}i=Qh._createAt(o,0)}return i}class Km{constructor(e,t){this.model=e;this.stylesProcessor=t;this.processor;this.mapper=new tf;this.downcastDispatcher=new rf({mapper:this.mapper,schema:e.schema});this.downcastDispatcher.on("insert:$text",Ef(),{priority:"lowest"});this.upcastDispatcher=new $m({schema:e.schema});this.viewDocument=new bl(t);this._viewWriter=new Jl(this.viewDocument);this.upcastDispatcher.on("text",sm(),{priority:"lowest"});this.upcastDispatcher.on("element",rm(),{priority:"lowest"});this.upcastDispatcher.on("documentFragment",rm(),{priority:"lowest"});this.decorate("init");this.decorate("set");this.on("init",()=>{this.fire("ready")},{priority:"lowest"})}get(e){const{rootName:t="main",trim:i="empty"}=e||{};if(!this._checkIfRootsExists([t])){throw new ss["b"]("datacontroller-get-non-existent-root: Attempting to get data from a non-existing root.",this)}const n=this.model.document.getRoot(t);if(i==="empty"&&!this.model.hasContent(n,{ignoreWhitespaces:true})){return""}return this.stringify(n)}stringify(e){const t=this.toView(e);return this.processor.toData(t)}toView(e){const t=this.viewDocument;const i=this._viewWriter;this.mapper.clearBindings();const n=ef._createIn(e);const o=new Kl(t);this.mapper.bindElements(e,o);this.downcastDispatcher.convertInsert(n,i);if(!e.is("documentFragment")){const t=Qm(e);for(const[e,n]of t){this.downcastDispatcher.convertMarkerAdd(e,n,i)}}return o}init(e){if(this.model.document.version){throw new ss["b"]("datacontroller-init-document-not-empty: Trying to set initial data to not empty document.",this)}let t={};if(typeof e==="string"){t.main=e}else{t=e}if(!this._checkIfRootsExists(Object.keys(t))){throw new ss["b"]("datacontroller-init-non-existent-root: Attempting to init data on a non-existing root.",this)}this.model.enqueueChange("transparent",e=>{for(const i of Object.keys(t)){const n=this.model.document.getRoot(i);e.insert(this.parse(t[i],n),n,0)}});return Promise.resolve()}set(e){let t={};if(typeof e==="string"){t.main=e}else{t=e}if(!this._checkIfRootsExists(Object.keys(t))){throw new ss["b"]("datacontroller-set-non-existent-root: Attempting to set data on a non-existing root.",this)}this.model.enqueueChange("transparent",e=>{e.setSelection(null);e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const i of Object.keys(t)){const n=this.model.document.getRoot(i);e.remove(e.createRangeIn(n));e.insert(this.parse(t[i],n),n,0)}})}parse(e,t="$root"){const i=this.processor.toView(e);return this.toModel(i,t)}toModel(e,t="$root"){return this.model.change(i=>this.upcastDispatcher.convert(e,i,t))}addStyleProcessorRules(e){e(this.stylesProcessor)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e){if(!this.model.document.getRootNames().includes(t)){return false}}return true}}ys(Km,Qc);function Qm(e){const t=[];const i=e.root.document;if(!i){return[]}const n=ef._createIn(e);for(const e of i.model.markers){const i=n.getIntersection(e.getRange());if(i){t.push([e.name,i])}}return t}class Jm{constructor(e,t){this._helpers=new Map;this._downcast=Array.isArray(e)?e:[e];this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:true});this._upcast=Array.isArray(t)?t:[t];this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:false})}addAlias(e,t){const i=this._downcast.includes(t);const n=this._upcast.includes(t);if(!n&&!i){throw new ss["b"]("conversion-add-alias-dispatcher-not-registered: "+"Trying to register and alias for a dispatcher that nas not been registered.",this)}this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:i})}for(e){if(!this._helpers.has(e)){throw new ss["b"]("conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.",this)}return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:i}of Zm(e)){this.for("upcast").elementToElement({model:t,view:i,converterPriority:e.converterPriority})}}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:i}of Zm(e)){this.for("upcast").elementToAttribute({view:i,model:t,converterPriority:e.converterPriority})}}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:i}of Zm(e)){this.for("upcast").attributeToAttribute({view:i,model:t})}}_createConversionHelpers({name:e,dispatchers:t,isDowncast:i}){if(this._helpers.has(e)){throw new ss["b"]("conversion-group-exists: Trying to register a group name that has already been registered.",this)}const n=i?new Pf(t):new om(t);this._helpers.set(e,n)}}function*Zm(e){if(e.model.values){for(const t of e.model.values){const i={key:e.model.key,value:t};const n=e.view[t];const o=e.upcastAlso?e.upcastAlso[t]:undefined;yield*Xm(i,n,o)}}else{yield*Xm(e.model,e.view,e.upcastAlso)}}function*Xm(e,t,i){yield{model:e,view:t};if(i){i=Array.isArray(i)?i:[i];for(const t of i){yield{model:e,view:t}}}}class eg{constructor(e="default"){this.operations=[];this.type=e}get baseVersion(){for(const e of this.operations){if(e.baseVersion!==null){return e.baseVersion}}return null}addOperation(e){e.batch=this;this.operations.push(e);return e}}class tg{constructor(e){this.baseVersion=e;this.isDocumentOperation=this.baseVersion!==null;this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);e.__className=this.constructor.className;delete e.batch;delete e.isDocumentOperation;return e}static get className(){return"Operation"}static fromJSON(e){return new this(e.baseVersion)}}class ig{constructor(e){this.markers=new Map;this._children=new qh;if(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 this.childCount===0}get root(){return this}get parent(){return null}is(e){return e==="documentFragment"||e==="model:documentFragment"}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 i of e){t=t.getChild(t.offsetToIndex(i))}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 i of e){if(i.name){t.push($h.fromJSON(i))}else{t.push(Uh.fromJSON(i))}}return new ig(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=ng(t);for(const e of i){if(e.parent!==null){e._remove()}e.parent=this}this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i){e.parent=null}return i}}function ng(e){if(typeof e=="string"){return[new Uh(e)]}if(!vs(e)){e=[e]}return Array.from(e).map(e=>{if(typeof e=="string"){return new Uh(e)}if(e instanceof Wh){return new Uh(e.data,e.getAttributes())}return e})}function og(e,t){t=cg(t);const i=t.reduce((e,t)=>e+t.offsetSize,0);const n=e.parent;dg(e);const o=e.index;n._insertChild(o,t);lg(n,o+t.length);lg(n,o);return new ef(e,e.getShiftedBy(i))}function rg(e){if(!e.isFlat){throw new ss["b"]("operation-utils-remove-range-not-flat: "+"Trying to remove a range which starts and ends in different element.",this)}const t=e.start.parent;dg(e.start);dg(e.end);const i=t._removeChildren(e.start.index,e.end.index-e.start.index);lg(t,e.start.index);return i}function sg(e,t){if(!e.isFlat){throw new ss["b"]("operation-utils-move-range-not-flat: "+"Trying to move a range which starts and ends in different element.",this)}const i=rg(e);t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset);return og(t,i)}function ag(e,t,i){dg(e.start);dg(e.end);for(const n of e.getItems({shallow:true})){const e=n.is("$textProxy")?n.textNode:n;if(i!==null){e._setAttribute(t,i)}else{e._removeAttribute(t)}lg(e.parent,e.index)}lg(e.end.parent,e.end.index)}function cg(e){const t=[];if(!(e instanceof Array)){e=[e]}for(let i=0;ie.maxOffset){throw new ss["b"]("move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.",this)}else if(e===t&&i=i&&this.targetPosition.path[e]e._clone(true)));const t=new bg(this.position,e,this.baseVersion);t.shouldReceiveAttributes=this.shouldReceiveAttributes;return t}getReversed(){const e=this.position.root.document.graveyard;const t=new Qh(e,[0]);return new pg(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(true)));og(this.position,e)}toJSON(){const e=super.toJSON();e.position=this.position.toJSON();e.nodes=this.nodes.toJSON();return e}static get className(){return"InsertOperation"}static fromJSON(e,t){const i=[];for(const t of e.nodes){if(t.name){i.push($h.fromJSON(t))}else{i.push(Uh.fromJSON(t))}}const n=new bg(Qh.fromJSON(e.position,t),i,e.baseVersion);n.shouldReceiveAttributes=e.shouldReceiveAttributes;return n}}class wg extends tg{constructor(e,t,i,n,o,r){super(r);this.name=e;this.oldRange=t?t.clone():null;this.newRange=i?i.clone():null;this.affectsData=o;this._markers=n}get type(){return"marker"}clone(){return new wg(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new wg(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,true,this.affectsData)}toJSON(){const e=super.toJSON();if(this.oldRange){e.oldRange=this.oldRange.toJSON()}if(this.newRange){e.newRange=this.newRange.toJSON()}delete e._markers;return e}static get className(){return"MarkerOperation"}static fromJSON(e,t){return new wg(e.name,e.oldRange?ef.fromJSON(e.oldRange,t):null,e.newRange?ef.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}class kg extends tg{constructor(e,t,i,n){super(n);this.position=e;this.position.stickiness="toNext";this.oldName=t;this.newName=i}get type(){return"rename"}clone(){return new kg(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new kg(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof $h)){throw new ss["b"]("rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.",this)}else if(e.name!==this.oldName){throw new ss["b"]("rename-operation-wrong-name: Element to change has different name than operation's old name.",this)}}_execute(){const e=this.position.nodeAfter;e.name=this.newName}toJSON(){const e=super.toJSON();e.position=this.position.toJSON();return e}static get className(){return"RenameOperation"}static fromJSON(e,t){return new kg(Qh.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class _g extends tg{constructor(e,t,i,n,o){super(o);this.root=e;this.key=t;this.oldValue=i;this.newValue=n}get type(){if(this.oldValue===null){return"addRootAttribute"}else if(this.newValue===null){return"removeRootAttribute"}else{return"changeRootAttribute"}}clone(){return new _g(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new _g(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment")){throw new ss["b"]("rootattribute-operation-not-a-root: The element to change is not a root element.",this,{root:this.root,key:this.key})}if(this.oldValue!==null&&this.root.getAttribute(this.key)!==this.oldValue){throw new ss["b"]("rootattribute-operation-wrong-old-value: Changed node has different attribute value than operation's "+"old attribute value.",this,{root:this.root,key:this.key})}if(this.oldValue===null&&this.newValue!==null&&this.root.hasAttribute(this.key)){throw new ss["b"]("rootattribute-operation-attribute-exists: The attribute with given key already exists.",this,{root:this.root,key:this.key})}}_execute(){if(this.newValue!==null){this.root._setAttribute(this.key,this.newValue)}else{this.root._removeAttribute(this.key)}}toJSON(){const e=super.toJSON();e.root=this.root.toJSON();return e}static get className(){return"RootAttributeOperation"}static fromJSON(e,t){if(!t.getRoot(e.root)){throw new ss["b"]("rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.",this,{rootName:e.root})}return new _g(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class vg extends tg{constructor(e,t,i,n,o){super(o);this.sourcePosition=e.clone();this.sourcePosition.stickiness="toPrevious";this.howMany=t;this.targetPosition=i.clone();this.targetPosition.stickiness="toNext";this.graveyardPosition=n.clone()}get type(){return"merge"}get deletionPosition(){return new Qh(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new ef(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);const t=this.sourcePosition.path.slice(0,-1);const i=new Qh(this.sourcePosition.root,t)._getTransformedByMergeOperation(this);const n=new yg(e,this.howMany,this.graveyardPosition,this.baseVersion+1);n.insertionPosition=i;return n}_validate(){const e=this.sourcePosition.parent;const t=this.targetPosition.parent;if(!e.parent){throw new ss["b"]("merge-operation-source-position-invalid: Merge source position is invalid.",this)}else if(!t.parent){throw new ss["b"]("merge-operation-target-position-invalid: Merge target position is invalid.",this)}else if(this.howMany!=e.maxOffset){throw new ss["b"]("merge-operation-how-many-invalid: Merge operation specifies wrong number of nodes to move.",this)}}_execute(){const e=this.sourcePosition.parent;const t=ef._createIn(e);sg(t,this.targetPosition);sg(ef._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();e.sourcePosition=e.sourcePosition.toJSON();e.targetPosition=e.targetPosition.toJSON();e.graveyardPosition=e.graveyardPosition.toJSON();return e}static get className(){return"MergeOperation"}static fromJSON(e,t){const i=Qh.fromJSON(e.sourcePosition,t);const n=Qh.fromJSON(e.targetPosition,t);const o=Qh.fromJSON(e.graveyardPosition,t);return new this(i,e.howMany,n,o,e.baseVersion)}}class yg extends tg{constructor(e,t,i,n){super(n);this.splitPosition=e.clone();this.splitPosition.stickiness="toNext";this.howMany=t;this.insertionPosition=yg.getInsertionPosition(e);this.insertionPosition.stickiness="toNone";this.graveyardPosition=i?i.clone():null;if(this.graveyardPosition){this.graveyardPosition.stickiness="toNext"}}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();e.push(0);return new Qh(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new ef(this.splitPosition,e)}clone(){const e=new this.constructor(this.splitPosition,this.howMany,this.graveyardPosition,this.baseVersion);e.insertionPosition=this.insertionPosition;return e}getReversed(){const e=this.splitPosition.root.document.graveyard;const t=new Qh(e,[0]);return new vg(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent;const t=this.splitPosition.offset;if(!e||e.maxOffset{for(const t of e.getAttributeKeys()){this.removeAttribute(t,e)}};if(!(e instanceof ef)){t(e)}else{for(const i of e.getItems()){t(i)}}}move(e,t,i){this._assertWriterUsedCorrectly();if(!(e instanceof ef)){throw new ss["b"]("writer-move-invalid-range: Invalid range to move.",this)}if(!e.isFlat){throw new ss["b"]("writer-move-range-not-flat: Range to move is not flat.",this)}const n=Qh._createAt(t,i);if(n.isEqual(e.start)){return}this._addOperationForAffectedMarkers("move",e);if(!Sg(e.root,n.root)){throw new ss["b"]("writer-move-different-document: Range is going to be moved between different documents.",this)}const o=e.root.document?e.root.document.version:null;const r=new pg(e.start,e.end.offset-e.start.offset,n,o);this.batch.addOperation(r);this.model.applyOperation(r)}remove(e){this._assertWriterUsedCorrectly();const t=e instanceof ef?e:ef._createOn(e);const i=t.getMinimalFlatRanges().reverse();for(const e of i){this._addOperationForAffectedMarkers("move",e);Eg(e.start,e.end.offset-e.start.offset,this.batch,this.model)}}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore;const i=e.nodeAfter;this._addOperationForAffectedMarkers("merge",e);if(!(t instanceof $h)){throw new ss["b"]("writer-merge-no-element-before: Node before merge position must be an element.",this)}if(!(i instanceof $h)){throw new ss["b"]("writer-merge-no-element-after: Node after merge position must be an element.",this)}if(!e.root.document){this._mergeDetached(e)}else{this._merge(e)}}createPositionFromPath(e,t,i){return this.model.createPositionFromPath(e,t,i)}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,i){return this.model.createSelection(e,t,i)}_mergeDetached(e){const t=e.nodeBefore;const i=e.nodeAfter;this.move(ef._createIn(i),Qh._createAt(t,"end"));this.remove(i)}_merge(e){const t=Qh._createAt(e.nodeBefore,"end");const i=Qh._createAt(e.nodeAfter,0);const n=e.root.document.graveyard;const o=new Qh(n,[0]);const r=e.root.document.version;const s=new vg(i,e.nodeAfter.maxOffset,t,o,r);this.batch.addOperation(s);this.model.applyOperation(s)}rename(e,t){this._assertWriterUsedCorrectly();if(!(e instanceof $h)){throw new ss["b"]("writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.",this)}const i=e.root.document?e.root.document.version:null;const n=new kg(Qh._createBefore(e),e.name,t,i);this.batch.addOperation(n);this.model.applyOperation(n)}split(e,t){this._assertWriterUsedCorrectly();let i=e.parent;if(!i.parent){throw new ss["b"]("writer-split-element-no-parent: Element with no parent can not be split.",this)}if(!t){t=i.parent}if(!e.parent.getAncestors({includeSelf:true}).includes(t)){throw new ss["b"]("writer-split-invalid-limit-element: Limit element is not a position ancestor.",this)}let n,o;do{const t=i.root.document?i.root.document.version:null;const r=i.maxOffset-e.offset;const s=new yg(e,r,null,t);this.batch.addOperation(s);this.model.applyOperation(s);if(!n&&!o){n=i;o=e.parent.nextSibling}e=this.createPositionAfter(e.parent);i=e.parent}while(i!==t);return{position:e,range:new ef(Qh._createAt(n,"end"),Qh._createAt(o,0))}}wrap(e,t){this._assertWriterUsedCorrectly();if(!e.isFlat){throw new ss["b"]("writer-wrap-range-not-flat: Range to wrap is not flat.",this)}const i=t instanceof $h?t:new $h(t);if(i.childCount>0){throw new ss["b"]("writer-wrap-element-not-empty: Element to wrap with is not empty.",this)}if(i.parent!==null){throw new ss["b"]("writer-wrap-element-attached: Element to wrap with is already attached to tree model.",this)}this.insert(i,e.start);const n=new ef(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(n,Qh._createAt(i,0))}unwrap(e){this._assertWriterUsedCorrectly();if(e.parent===null){throw new ss["b"]("writer-unwrap-element-no-parent: Trying to unwrap an element which has no parent.",this)}this.move(ef._createIn(e),this.createPositionAfter(e));this.remove(e)}addMarker(e,t){this._assertWriterUsedCorrectly();if(!t||typeof t.usingOperation!="boolean"){throw new ss["b"]("writer-addMarker-no-usingOperation: The options.usingOperation parameter is required when adding a new marker.",this)}const i=t.usingOperation;const n=t.range;const o=t.affectsData===undefined?false:t.affectsData;if(this.model.markers.has(e)){throw new ss["b"]("writer-addMarker-marker-exists: Marker with provided name already exists.",this)}if(!n){throw new ss["b"]("writer-addMarker-no-range: Range parameter is required when adding a new marker.",this)}if(!i){return this.model.markers._set(e,n,i,o)}Pg(this,e,null,n,o);return this.model.markers.get(e)}updateMarker(e,t){this._assertWriterUsedCorrectly();const i=typeof e=="string"?e:e.name;const n=this.model.markers.get(i);if(!n){throw new ss["b"]("writer-updateMarker-marker-not-exists: Marker with provided name does not exists.",this)}if(!t){this.model.markers._refresh(n);return}const o=typeof t.usingOperation=="boolean";const r=typeof t.affectsData=="boolean";const s=r?t.affectsData:n.affectsData;if(!o&&!t.range&&!r){throw new ss["b"]("writer-updateMarker-wrong-options: One of the options is required - provide range, usingOperations or affectsData.",this)}const a=n.getRange();const c=t.range?t.range:a;if(o&&t.usingOperation!==n.managedUsingOperations){if(t.usingOperation){Pg(this,i,null,c,s)}else{Pg(this,i,a,null,s);this.model.markers._set(i,c,undefined,s)}return}if(n.managedUsingOperations){Pg(this,i,a,c,s)}else{this.model.markers._set(i,c,undefined,s)}}removeMarker(e){this._assertWriterUsedCorrectly();const t=typeof e=="string"?e:e.name;if(!this.model.markers.has(t)){throw new ss["b"]("writer-removeMarker-no-marker: Trying to remove marker which does not exist.",this)}const i=this.model.markers.get(t);if(!i.managedUsingOperations){this.model.markers._remove(t);return}const n=i.getRange();Pg(this,t,n,null,i.affectsData)}setSelection(e,t,i){this._assertWriterUsedCorrectly();this.model.document.selection._setTo(e,t,i)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly();this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){this._assertWriterUsedCorrectly();if(typeof e==="string"){this._setSelectionAttribute(e,t)}else{for(const[t,i]of Us(e)){this._setSelectionAttribute(t,i)}}}removeSelectionAttribute(e){this._assertWriterUsedCorrectly();if(typeof e==="string"){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 i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const n=wf._getStoreAttributeKey(e);this.setAttribute(n,t,i.anchor.parent)}i._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const i=wf._getStoreAttributeKey(e);this.removeAttribute(i,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this){throw new ss["b"]("writer-incorrect-use: Trying to use a writer outside the change() block.",this)}}_addOperationForAffectedMarkers(e,t){for(const i of this.model.markers){if(!i.managedUsingOperations){continue}const n=i.getRange();let o=false;if(e==="move"){o=t.containsPosition(n.start)||t.start.isEqual(n.start)||t.containsPosition(n.end)||t.end.isEqual(n.end)}else{const e=t.nodeBefore;const i=t.nodeAfter;const r=n.start.parent==e&&n.start.isAtEnd;const s=n.end.parent==i&&n.end.offset==0;const a=n.end.nodeAfter==i;const c=n.start.nodeAfter==i;o=r||s||a||c}if(o){this.updateMarker(i.name,{range:n})}}}}function Tg(e,t,i,n){const o=e.model;const r=o.document;let s=n.start;let a;let c;let l;for(const e of n.getWalker({shallow:true})){l=e.item.getAttribute(t);if(a&&c!=l){if(c!=i){d()}s=a}a=e.nextPosition;c=l}if(a instanceof Qh&&a!=s&&c!=i){d()}function d(){const n=new ef(s,a);const l=n.root.document?r.version:null;const d=new mg(n,t,c,i,l);e.batch.addOperation(d);o.applyOperation(d)}}function Cg(e,t,i,n){const o=e.model;const r=o.document;const s=n.getAttribute(t);let a,c;if(s!=i){const l=n.root===n;if(l){const e=n.document?r.version:null;c=new _g(n,t,s,i,e)}else{a=new ef(Qh._createBefore(n),e.createPositionAfter(n));const o=a.root.document?r.version:null;c=new mg(a,t,s,i,o)}e.batch.addOperation(c);o.applyOperation(c)}}function Pg(e,t,i,n,o){const r=e.model;const s=r.document;const a=new wg(t,i,n,r.markers,o,s.version);e.batch.addOperation(a);r.applyOperation(a)}function Eg(e,t,i,n){let o;if(e.root.document){const i=n.document;const r=new Qh(i.graveyard,[0]);o=new pg(e,t,r,i.version)}else{o=new gg(e,t)}i.addOperation(o);n.applyOperation(o)}function Sg(e,t){if(e===t){return true}if(e instanceof xg&&t instanceof xg){return true}return false}class Mg{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 this._changesInElement.size==0&&this._changedMarkers.size==0}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=ef._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:true})){if(this._isInInsertedElement(t.parent)){continue}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);const i=this._isInInsertedElement(e.targetPosition.parent);if(!t){this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany)}if(!i){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=ef._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;if(!this._isInInsertedElement(t)){this._markRemove(t,e.splitPosition.offset,e.howMany)}if(!this._isInInsertedElement(e.insertionPosition.parent)){this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1)}if(e.graveyardPosition){this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1)}break}case"merge":{const t=e.sourcePosition.parent;if(!this._isInInsertedElement(t.parent)){this._markRemove(t.parent,t.startOffset,1)}const i=e.graveyardPosition.parent;this._markInsert(i,e.graveyardPosition.offset,1);const n=e.targetPosition.parent;if(!this._isInInsertedElement(n)){this._markInsert(n,e.targetPosition.offset,t.maxOffset)}break}}this._cachedChanges=null}bufferMarkerChange(e,t,i,n){const o=this._changedMarkers.get(e);if(!o){this._changedMarkers.set(e,{oldRange:t,newRange:i,affectsData:n})}else{o.newRange=i;o.affectsData=n;if(o.oldRange==null&&o.newRange==null){this._changedMarkers.delete(e)}}}getMarkersToRemove(){const e=[];for(const[t,i]of this._changedMarkers){if(i.oldRange!=null){e.push({name:t,range:i.oldRange})}}return e}getMarkersToAdd(){const e=[];for(const[t,i]of this._changedMarkers){if(i.newRange!=null){e.push({name:t,range:i.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 true}}return this._changesInElement.size>0}getChanges(e={includeChangesInGraveyard:false}){if(this._cachedChanges){if(e.includeChangesInGraveyard){return this._cachedChangesWithGraveyard.slice()}else{return this._cachedChanges.slice()}}const t=[];for(const e of this._changesInElement.keys()){const i=this._changesInElement.get(e).sort((e,t)=>{if(e.offset===t.offset){if(e.type!=t.type){return e.type=="remove"?-1:1}return 0}return e.offset{if(e.position.root!=t.position.root){return e.position.root.rootNamei.offset){if(n>o){const e={type:"attribute",offset:o,howMany:n-o,count:this._changeCount++};this._handleChange(e,t);t.push(e)}e.nodesToHandle=i.offset-e.offset;e.howMany=e.nodesToHandle}else if(e.offset>=i.offset&&e.offseto){e.nodesToHandle=n-o;e.offset=o}else{e.nodesToHandle=0}}}if(i.type=="remove"){if(e.offseti.offset){const o={type:"attribute",offset:i.offset,howMany:n-i.offset,count:this._changeCount++};this._handleChange(o,t);t.push(o);e.nodesToHandle=i.offset-e.offset;e.howMany=e.nodesToHandle}}if(i.type=="attribute"){if(e.offset>=i.offset&&n<=o){e.nodesToHandle=0;e.howMany=0;e.offset=0}else if(e.offset<=i.offset&&n>=o){i.howMany=0}}}}e.howMany=e.nodesToHandle;delete e.nodesToHandle}_getInsertDiff(e,t,i){return{type:"insert",position:Qh._createAt(e,t),name:i,length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,i){return{type:"remove",position:Qh._createAt(e,t),name:i,length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,i){const n=[];i=new Map(i);for(const[o,r]of t){const t=i.has(o)?i.get(o):null;if(t!==r){n.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:o,attributeOldValue:r,attributeNewValue:t,changeCount:this._changeCount++})}i.delete(o)}for(const[t,o]of i){n.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:o,changeCount:this._changeCount++})}return n}_isInInsertedElement(e){const t=e.parent;if(!t){return false}const i=this._changesInElement.get(t);const n=e.startOffset;if(i){for(const e of i){if(e.type=="insert"&&n>=e.offset&&nn){for(let t=0;t{const i=t[0];if(i.isDocumentOperation&&i.baseVersion!==this.version){throw new ss["b"]("model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.",this,{operation:i})}},{priority:"highest"});this.listenTo(e,"applyOperation",(e,t)=>{const i=t[0];if(i.isDocumentOperation){this.differ.bufferOperation(i)}},{priority:"high"});this.listenTo(e,"applyOperation",(e,t)=>{const i=t[0];if(i.isDocumentOperation){this.version++;this.history.addOperation(i)}},{priority:"low"});this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=true});this.listenTo(e.markers,"update",(e,t,i,n)=>{this.differ.bufferMarkerChange(t.name,i,n,t.affectsData);if(i===null){t.on("change",(e,i)=>{this.differ.bufferMarkerChange(t.name,i,t.getRange(),t.affectsData)})}})}get graveyard(){return this.getRoot(Bg)}createRoot(e="$root",t="main"){if(this.roots.get(t)){throw new ss["b"]("model-document-createRoot-name-exists: Root with specified name already exists.",this,{name:t})}const i=new xg(this,e,t);this.roots.add(i);return i}destroy(){this.selection.destroy();this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(){return Array.from(this.roots,e=>e.rootName).filter(e=>e!=Bg)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=Vs(this);e.selection="[engine.model.DocumentSelection]";e.model="[engine.model.Model]";return e}_handleChangeBlock(e){if(this._hasDocumentChangedFromTheLastChangeBlock()){this._callPostFixers(e);this.selection.refresh();if(this.differ.hasDataChanges()){this.fire("change:data",e.batch)}else{this.fire("change",e.batch)}this.selection.refresh();this.differ.reset()}this._hasSelectionChangedFromTheLastChangeBlock=false}_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();const t=this.model;const i=t.schema;const n=t.createPositionFromPath(e,[0]);const o=i.getNearestSelectionRange(n);return o||t.createRange(n)}_validateSelectionRange(e){return Hg(e.start)&&Hg(e.end)}_callPostFixers(e){let t=false;do{for(const i of this._postFixers){this.selection.refresh();t=i(e);if(t){break}}}while(t)}}ys(Fg,ds);function Hg(e){const t=e.textNode;if(t){const i=t.data;const n=e.offset-t.startOffset;return!Vg(i,n)&&!jg(i,n)}return true}class Ug{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,i=false,n=false){const o=e instanceof Wg?e.name:e;if(o.includes(",")){throw new ss["b"]('markercollection-incorrect-marker-name: Marker name cannot contain "," character.',this)}const r=this._markers.get(o);if(r){const e=r.getRange();let s=false;if(!e.isEqual(t)){r._attachLiveRange(ff.fromRange(t));s=true}if(i!=r.managedUsingOperations){r._managedUsingOperations=i;s=true}if(typeof n==="boolean"&&n!=r.affectsData){r._affectsData=n;s=true}if(s){this.fire("update:"+o,r,e,t)}return r}const s=ff.fromRange(t);const a=new Wg(o,s,i,n);this._markers.set(o,a);this.fire("update:"+o,a,null,t);return a}_remove(e){const t=e instanceof Wg?e.name:e;const i=this._markers.get(t);if(i){this._markers.delete(t);this.fire("update:"+t,i,i.getRange(),null);this._destroyMarker(i);return true}return false}_refresh(e){const t=e instanceof Wg?e.name:e;const i=this._markers.get(t);if(!i){throw new ss["b"]("markercollection-refresh-marker-not-exists: Marker with provided name does not exists.",this)}const n=i.getRange();this.fire("update:"+t,i,n,n,i.managedUsingOperations,i.affectsData)}*getMarkersAtPosition(e){for(const t of this){if(t.getRange().containsPosition(e)){yield t}}}*getMarkersIntersectingRange(e){for(const t of this){if(t.getRange().getIntersection(e)!==null){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()){if(t.name.startsWith(e+":")){yield t}}}_destroyMarker(e){e.stopListening();e._detachLiveRange()}}ys(Ug,ds);class Wg{constructor(e,t,i,n){this.name=e;this._liveRange=this._attachLiveRange(t);this._managedUsingOperations=i;this._affectsData=n}get managedUsingOperations(){if(!this._liveRange){throw new ss["b"]("marker-destroyed: Cannot use a destroyed marker instance.",this)}return this._managedUsingOperations}get affectsData(){if(!this._liveRange){throw new ss["b"]("marker-destroyed: Cannot use a destroyed marker instance.",this)}return this._affectsData}getStart(){if(!this._liveRange){throw new ss["b"]("marker-destroyed: Cannot use a destroyed marker instance.",this)}return this._liveRange.start.clone()}getEnd(){if(!this._liveRange){throw new ss["b"]("marker-destroyed: Cannot use a destroyed marker instance.",this)}return this._liveRange.end.clone()}getRange(){if(!this._liveRange){throw new ss["b"]("marker-destroyed: Cannot use a destroyed marker instance.",this)}return this._liveRange.toRange()}is(e){return e==="marker"||e==="model:marker"}_attachLiveRange(e){if(this._liveRange){this._detachLiveRange()}e.delegate("change:range").to(this);e.delegate("change:content").to(this);this._liveRange=e;return e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this);this._liveRange.stopDelegating("change:content",this);this._liveRange.detach();this._liveRange=null}}ys(Wg,ds);class qg extends tg{get type(){return"noop"}clone(){return new qg(this.baseVersion)}getReversed(){return new qg(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const $g={};$g[mg.className]=mg;$g[bg.className]=bg;$g[wg.className]=wg;$g[pg.className]=pg;$g[qg.className]=qg;$g[tg.className]=tg;$g[kg.className]=kg;$g[_g.className]=_g;$g[yg.className]=yg;$g[vg.className]=vg;class Yg{static fromJSON(e,t){return $g[e.__className].fromJSON(e,t)}}class Gg extends Qh{constructor(e,t,i="toNone"){super(e,t,i);if(!this.root.is("rootElement")){throw new ss["b"]("model-liveposition-root-not-rootelement: LivePosition's root has to be an instance of RootElement.",e)}Kg.call(this)}detach(){this.stopListening()}is(e){return e==="livePosition"||e==="model:livePosition"||e=="position"||e==="model:position"}toPosition(){return new Qh(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t?t:e.stickiness)}}function Kg(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{const i=t[0];if(!i.isDocumentOperation){return}Qg.call(this,i)},{priority:"low"})}function Qg(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)}}ys(Gg,ds);function Jg(e,t,i,n){return e.change(o=>{let r;if(!i){r=e.document.selection}else if(i instanceof af||i instanceof wf){r=i}else{r=o.createSelection(i,n)}if(!r.isCollapsed){e.deleteContent(r,{doNotAutoparagraph:true})}const s=new Zg(e,o,r.anchor);let a;if(t.is("documentFragment")){a=t.getChildren()}else{a=[t]}s.handleNodes(a,{isFirst:true,isLast:true});const c=s.getSelectionRange();if(c){if(r instanceof wf){o.setSelection(c)}else{r.setTo(c)}}else{}const l=s.getAffectedRange()||e.createRange(r.anchor);s.destroy();return l})}class Zg{constructor(e,t,i){this.model=e;this.writer=t;this.position=i;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 i=0;i{if(!i.doNotResetEntireContent&&hp(o,t)){up(e,t,o);return}const[r,s]=ep(n);if(!n.start.isTouching(n.end)){e.remove(n)}if(!i.leaveUnmerged){ip(e,r,s);o.removeDisallowedAttributes(r.parent.getChildren(),e)}fp(e,t,r);if(!i.doNotAutoparagraph&&cp(o,r)){dp(e,r,t)}r.detach();s.detach()})}function ep(e){const t=e.root.document.model;const i=e.start;let n=e.end;if(t.hasContent(e,{ignoreMarkers:true})){const i=tp(n);if(i&&n.isTouching(t.createPositionAt(i,0))){const i=t.createSelection(e);t.modifySelection(i,{direction:"backward"});n=i.getLastPosition()}}return[Gg.fromPosition(i,"toPrevious"),Gg.fromPosition(n,"toNext")]}function tp(e){const t=e.parent;const i=t.root.document.model.schema;const n=t.getAncestors({parentFirst:true,includeSelf:true});for(const e of n){if(i.isLimit(e)){return null}if(i.isBlock(e)){return e}}}function ip(e,t,i){const n=e.model;if(!sp(e.model.schema,t,i)){return}const[o,r]=ap(t,i);if(!n.hasContent(o,{ignoreMarkers:true})&&n.hasContent(r,{ignoreMarkers:true})){op(e,t,i,o.parent)}else{np(e,t,i,o.parent)}}function np(e,t,i,n){const o=t.parent;const r=i.parent;if(o==n||r==n){return}t=e.createPositionAfter(o);i=e.createPositionBefore(r);if(!i.isEqual(t)){e.insert(r,t)}e.merge(t);while(i.parent.isEmpty){const t=i.parent;i=e.createPositionBefore(t);e.remove(t)}if(!sp(e.model.schema,t,i)){return}np(e,t,i,n)}function op(e,t,i,n){const o=t.parent;const r=i.parent;if(o==n||r==n){return}t=e.createPositionAfter(o);i=e.createPositionBefore(r);if(!i.isEqual(t)){e.insert(o,i)}while(t.parent.isEmpty){const i=t.parent;t=e.createPositionBefore(i);e.remove(i)}i=e.createPositionBefore(r);rp(e,i);if(!sp(e.model.schema,t,i)){return}op(e,t,i,n)}function rp(e,t){const i=t.nodeBefore;const n=t.nodeAfter;if(i.name!=n.name){e.rename(i,n.name)}e.clearAttributes(i);e.setAttributes(Object.fromEntries(n.getAttributes()),i);e.merge(t)}function sp(e,t,i){const n=t.parent;const o=i.parent;if(n==o){return false}if(e.isLimit(n)||e.isLimit(o)){return false}return lp(t,i,e)}function ap(e,t){const i=e.getAncestors();const n=t.getAncestors();let o=0;while(i[o]&&i[o]==n[o]){o++}return[i[o],n[o]]}function cp(e,t){const i=e.checkChild(t,"$text");const n=e.checkChild(t,"paragraph");return!i&&n}function lp(e,t,i){const n=new ef(e,t);for(const e of n.getWalker()){if(i.isLimit(e.item)){return false}}return true}function dp(e,t,i){const n=e.createElement("paragraph");e.insert(n,t);fp(e,i,e.createPositionAt(n,0))}function up(e,t){const i=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(i));dp(e,e.createPositionAt(i,0),t)}function hp(e,t){const i=e.getLimitElement(t);if(!t.containsEntireContent(i)){return false}const n=t.getFirstRange();if(n.start.parent==n.end.parent){return false}return e.checkChild(i,"paragraph")}function fp(e,t,i){if(t instanceof wf){e.setSelection(i)}else{t.setTo(i)}}const mp=' ,.?!:;"-()';function gp(e,t,i={}){const n=e.schema;const o=i.direction!="backward";const r=i.unit?i.unit:"character";const s=t.focus;const a=new Gh({boundaries:kp(s,o),singleCharacters:true,direction:o?"forward":"backward"});const c={walker:a,schema:n,isForward:o,unit:r};let l;while(l=a.next()){if(l.done){return}const i=pp(c,l.value);if(i){if(t instanceof wf){e.change(e=>{e.setSelectionFocus(i)})}else{t.setFocus(i)}return}}}function pp(e,t){if(t.type=="text"){if(e.unit==="word"){return wp(e.walker,e.isForward)}return bp(e.walker,e.unit,e.isForward)}if(t.type==(e.isForward?"elementStart":"elementEnd")){if(e.schema.isObject(t.item)){return Qh._createAt(t.item,e.isForward?"after":"before")}if(e.schema.checkChild(t.nextPosition,"$text")){return t.nextPosition}}else{if(e.schema.isLimit(t.item)){e.walker.skip(()=>true);return}if(e.schema.checkChild(t.nextPosition,"$text")){return t.nextPosition}}}function bp(e,t){const i=e.position.textNode;if(i){const n=i.data;let o=e.position.offset-i.startOffset;while(Vg(n,o)||t=="character"&&jg(n,o)){e.next();o=e.position.offset-i.startOffset}}return e.position}function wp(e,t){let i=e.position.textNode;if(i){let n=e.position.offset-i.startOffset;while(!_p(i.data,n,t)&&!vp(i,n,t)){e.next();const o=t?e.position.nodeAfter:e.position.nodeBefore;if(o&&o.is("$text")){const n=o.data.charAt(t?0:o.data.length-1);if(!mp.includes(n)){e.next();i=e.position.textNode}}n=e.position.offset-i.startOffset}}return e.position}function kp(e,t){const i=e.root;const n=Qh._createAt(i,t?"end":0);if(t){return new ef(e,n)}else{return new ef(n,e)}}function _p(e,t,i){const n=t+(i?0:-1);return mp.includes(e.charAt(n))}function vp(e,t,i){return t===(i?e.endOffset:0)}function yp(e,t){return e.change(e=>{const i=e.createDocumentFragment();const n=t.getFirstRange();if(!n||n.isCollapsed){return i}const o=n.start.root;const r=n.start.getCommonPath(n.end);const s=o.getNodeByPath(r);let a;if(n.start.parent==n.end.parent){a=n}else{a=e.createRange(e.createPositionAt(s,n.start.path[r.length]),e.createPositionAt(s,n.end.path[r.length]+1))}const c=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:true})){if(t.is("$textProxy")){e.appendText(t.data,t.getAttributes(),i)}else{e.append(e.cloneElement(t,true),i)}}if(a!=n){const t=n._getTransformedByMove(a.start,e.createPositionAt(i,0),c)[0];const o=e.createRange(e.createPositionAt(i,0),t.start);const r=e.createRange(t.end,e.createPositionAt(i,"end"));xp(r,e);xp(o,e)}return i})}function xp(e,t){const i=[];Array.from(e.getItems({direction:"backward"})).map(e=>t.createRangeOn(e)).filter(t=>{const i=(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end));return i}).forEach(e=>{i.push(e.start.parent);t.remove(e)});i.forEach(e=>{let i=e;while(i.parent&&i.isEmpty){const e=t.createRangeOn(i);i=i.parent;t.remove(e)}})}function Ap(e){e.document.registerPostFixer(t=>Tp(t,e))}function Tp(e,t){const i=t.document.selection;const n=t.schema;const o=[];let r=false;for(const e of i.getRanges()){const t=Cp(e,n);if(t&&!t.isEqual(e)){o.push(t);r=true}else{o.push(e)}}if(r){e.setSelection(Ip(o),{backward:i.isBackward})}}function Cp(e,t){if(e.isCollapsed){return Pp(e,t)}return Ep(e,t)}function Pp(e,t){const i=e.start;const n=t.getNearestSelectionRange(i);if(!n){return null}if(!n.isCollapsed){return n}const o=n.start;if(i.isEqual(o)){return null}return new ef(o)}function Ep(e,t){const i=e.start;const n=e.end;const o=t.checkChild(i,"$text");const r=t.checkChild(n,"$text");const s=t.getLimitElement(i);const a=t.getLimitElement(n);if(s===a){if(o&&r){return null}if(Mp(i,n,t)){const e=i.nodeAfter&&t.isObject(i.nodeAfter);const o=e?null:t.getNearestSelectionRange(i,"forward");const r=n.nodeBefore&&t.isObject(n.nodeBefore);const s=r?null:t.getNearestSelectionRange(n,"backward");const a=o?o.start:i;const c=s?s.start:n;return new ef(a,c)}}const c=s&&!s.is("rootElement");const l=a&&!a.is("rootElement");if(c||l){const e=i.nodeAfter&&n.nodeBefore&&i.nodeAfter.parent===n.nodeBefore.parent;const o=c&&(!e||!Np(i.nodeAfter,t));const r=l&&(!e||!Np(n.nodeBefore,t));let d=i;let u=n;if(o){d=Qh._createBefore(Sp(s,t))}if(r){u=Qh._createAfter(Sp(a,t))}return new ef(d,u)}return null}function Sp(e,t){let i=e;let n=i;while(t.isLimit(n)&&n.parent){i=n;n=n.parent}return i}function Mp(e,t,i){const n=e.nodeAfter&&!i.isLimit(e.nodeAfter)||i.checkChild(e,"$text");const o=t.nodeBefore&&!i.isLimit(t.nodeBefore)||i.checkChild(t,"$text");return n||o}function Ip(e){const t=[];t.push(e.shift());for(const i of e){const e=t.pop();if(i.isIntersecting(e)){const n=e.start.isAfter(i.start)?i.start:e.start;const o=e.end.isAfter(i.end)?e.end:i.end;const r=new ef(n,o);t.push(r)}else{t.push(e);t.push(i)}}return t}function Np(e,t){return e&&t.isObject(e)}class Op{constructor(){this.markers=new Ug;this.document=new Fg(this);this.schema=new Em;this._pendingChanges=[];this._currentWriter=null;["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(e=>this.decorate(e));this.on("applyOperation",(e,t)=>{const i=t[0];i._validate()},{priority:"highest"});this.schema.register("$root",{isLimit:true});this.schema.register("$block",{allowIn:"$root",isBlock:true});this.schema.register("$text",{allowIn:"$block",isInline:true});this.schema.register("$clipboardHolder",{allowContentOf:"$root",isLimit:true});this.schema.extend("$text",{allowIn:"$clipboardHolder"});this.schema.register("$marker");this.schema.addChildCheck((e,t)=>{if(t.name==="$marker"){return true}});Ap(this)}change(e){try{if(this._pendingChanges.length===0){this._pendingChanges.push({batch:new eg,callback:e});return this._runPendingChanges()[0]}else{return e(this._currentWriter)}}catch(e){ss["b"].rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{if(typeof e==="string"){e=new eg(e)}else if(typeof e=="function"){t=e;e=new eg}this._pendingChanges.push({batch:e,callback:t});if(this._pendingChanges.length==1){this._runPendingChanges()}}catch(e){ss["b"].rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,i){return Jg(this,e,t,i)}deleteContent(e,t){Xg(this,e,t)}modifySelection(e,t){gp(this,e,t)}getSelectedContent(e){return yp(this,e)}hasContent(e,t={}){const i=e instanceof $h?ef._createIn(e):e;if(i.isCollapsed){return false}const{ignoreWhitespaces:n=false,ignoreMarkers:o=false}=t;if(!o){for(const e of this.markers.getMarkersIntersectingRange(i)){if(e.affectsData){return true}}}for(const e of i.getItems()){if(e.is("$textProxy")){if(!n){return true}else if(e.data.search(/\S/)!==-1){return true}}else if(this.schema.isObject(e)){return true}}return false}createPositionFromPath(e,t,i){return new Qh(e,t,i)}createPositionAt(e,t){return Qh._createAt(e,t)}createPositionAfter(e){return Qh._createAfter(e)}createPositionBefore(e){return Qh._createBefore(e)}createRange(e,t){return new ef(e,t)}createRangeIn(e){return ef._createIn(e)}createRangeOn(e){return ef._createOn(e)}createSelection(e,t,i){return new af(e,t,i)}createBatch(e){return new eg(e)}createOperationFromJSON(e){return Yg.fromJSON(e,this.document)}destroy(){this.document.destroy();this.stopListening()}_runPendingChanges(){const e=[];this.fire("_beforeChanges");while(this._pendingChanges.length){const t=this._pendingChanges[0].batch;this._currentWriter=new Ag(this,t);const i=this._pendingChanges[0].callback(this._currentWriter);e.push(i);this.document._handleChangeBlock(this._currentWriter);this._pendingChanges.shift();this._currentWriter=null}this.fire("_afterChanges");return e}}ys(Op,Qc);class zp{constructor(){this._listener=Object.create(Kd)}listenTo(e){this._listener.listenTo(e,"keydown",(e,t)=>{this._listener.fire("_keydown:"+Rl(t),t)})}set(e,t,i={}){const n=Ll(e);const o=i.priority;this._listener.listenTo(this._listener,"_keydown:"+n,(e,i)=>{t(i,()=>{i.preventDefault();i.stopPropagation();e.stop()});e.return=true},{priority:o})}press(e){return!!this._listener.fire("_keydown:"+Rl(e),e)}destroy(){this._listener.stopListening()}}class Rp extends zp{constructor(e){super();this.editor=e}set(e,t,i={}){if(typeof t=="string"){const e=t;t=(t,i)=>{this.editor.execute(e);i()}}super.set(e,t,i)}}class Lp{constructor(e={}){this._context=e.context||new zs({language:e.language});this._context._addEditor(this,!e.context);const t=Array.from(this.constructor.builtinPlugins||[]);this.config=new Kr(e,this.constructor.defaultConfig);this.config.define("plugins",t);this.config.define(this._context._getEditorConfig());this.plugins=new As(this,t,this._context.plugins);this.locale=this._context.locale;this.t=this.locale.t;this.commands=new Tm;this.set("state","initializing");this.once("ready",()=>this.state="ready",{priority:"high"});this.once("destroy",()=>this.state="destroyed",{priority:"high"});this.set("isReadOnly",false);this.model=new Op;const i=new zc;this.data=new Km(this.model,i);this.editing=new Am(this.model,i);this.editing.view.document.bind("isReadOnly").to(this);this.conversion=new Jm([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 Rp(this);this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const e=this.config;const t=e.get("plugins");const i=e.get("removePlugins")||[];const n=e.get("extraPlugins")||[];return this.plugins.init(t.concat(n),i)}destroy(){let e=Promise.resolve();if(this.state=="initializing"){e=new Promise(e=>this.once("ready",e))}return 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){ss["b"].rethrowUnexpectedError(e,this)}}}ys(Lp,Qc);const Dp={setData(e){this.data.set(e)},getData(e){return this.data.get(e)}};var Vp=Dp;function jp(e,t){if(e instanceof HTMLTextAreaElement){e.value=t}e.innerHTML=t}const Bp={updateSourceElement(){if(!this.sourceElement){throw new ss["b"]("editor-missing-sourceelement: Cannot update the source element of a detached editor.",this)}jp(this.sourceElement,this.data.get())}};var Fp=Bp;function Hp(e){if(!me(e.updateSourceElement)){throw new ss["b"]("attachtoform-missing-elementapi-interface: Editor passed to attachToForm() must implement ElementApi.",e)}const t=e.sourceElement;if(t&&t.tagName.toLowerCase()==="textarea"&&t.form){let i;const n=t.form;const o=()=>e.updateSourceElement();if(me(n.submit)){i=n.submit;n.submit=()=>{o();i.apply(n)}}n.addEventListener("submit",o);e.on("destroy",()=>{n.removeEventListener("submit",o);if(i){n.submit=i}})}}class Up{getHtml(e){const t=document.implementation.createHTMLDocument("");const i=t.createElement("div");i.appendChild(e);return i.innerHTML}}class Wp{constructor(e){this._domParser=new DOMParser;this._domConverter=new Hd(e,{blockFillerMode:"nbsp"});this._htmlWriter=new Up}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");const i=t.createDocumentFragment();const n=t.body.childNodes;while(n.length>0){i.appendChild(n[0])}return i}}class qp{constructor(e){this.editor=e;this._components=new Map}*names(){for(const e of this._components.values()){yield e.originalName}}add(e,t){if(this.has(e)){throw new ss["b"]("componentfactory-item-exists: The item already exists in the component factory.",this,{name:e})}this._components.set($p(e),{callback:t,originalName:e})}create(e){if(!this.has(e)){throw new ss["b"]("componentfactory-item-missing: The required component is not registered in the factory.",this,{name:e})}return this._components.get($p(e)).callback(this.editor.locale)}has(e){return this._components.has($p(e))}}function $p(e){return String(e).toLowerCase()}class Yp{constructor(){this.set("isFocused",false);this.set("focusedElement",null);this._elements=new Set;this._nextEventLoopTimeout=null}add(e){if(this._elements.has(e)){throw new ss["b"]("focusTracker-add-element-already-exist",this)}this.listenTo(e,"focus",()=>this._focus(e),{useCapture:true});this.listenTo(e,"blur",()=>this._blur(),{useCapture:true});this._elements.add(e)}remove(e){if(e===this.focusedElement){this._blur(e)}if(this._elements.has(e)){this.stopListening(e);this._elements.delete(e)}}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout);this.focusedElement=e;this.isFocused=true}_blur(){clearTimeout(this._nextEventLoopTimeout);this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null;this.isFocused=false},0)}}ys(Yp,Kd);ys(Yp,Qc);class Gp{constructor(e){this.editor=e;this.componentFactory=new qp(e);this.focusTracker=new Yp;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);if(!t.ckeditorInstance){t.ckeditorInstance=this.editor}}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){console.warn("editor-ui-deprecated-editable-elements: "+"The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this});return this._editableElementsMap}}ys(Gp,ds);function Kp({origin:e,originKeystrokeHandler:t,originFocusTracker:i,toolbar:n,beforeFocus:o,afterBlur:r}){i.add(n.element);t.set("Alt+F10",(e,t)=>{if(i.isFocused&&!n.focusTracker.isFocused){if(o){o()}n.focus();t()}});n.keystrokes.set("Esc",(t,i)=>{if(n.focusTracker.isFocused){e.focus();if(r){r()}i()}})}function Qp(e){if(Array.isArray(e)){return{items:e}}if(!e){return{items:[]}}return Object.assign({items:[]},e)}var Jp=i(13);const Zp=new WeakMap;function Xp(e){const{view:t,element:i,text:n,isDirectHost:o=true}=e;const r=t.document;if(!Zp.has(r)){Zp.set(r,new Map);r.registerPostFixer(e=>ob(r,e))}Zp.get(r).set(i,{text:n,isDirectHost:o});t.change(e=>ob(r,e))}function eb(e,t){const i=t.document;e.change(e=>{if(!Zp.has(i)){return}const n=Zp.get(i);const o=n.get(t);e.removeAttribute("data-placeholder",o.hostElement);ib(e,o.hostElement);n.delete(t)})}function tb(e,t){if(!t.hasClass("ck-placeholder")){e.addClass("ck-placeholder",t);return true}return false}function ib(e,t){if(t.hasClass("ck-placeholder")){e.removeClass("ck-placeholder",t);return true}return false}function nb(e){if(!e.isAttached()){return false}const t=!Array.from(e.getChildren()).some(e=>!e.is("uiElement"));const i=e.document;if(!i.isFocused&&t){return true}const n=i.selection;const o=n.anchor;if(t&&o&&o.parent!==e){return true}return false}function ob(e,t){const i=Zp.get(e);let n=false;for(const[e,o]of i){if(rb(t,e,o)){n=true}}return n}function rb(e,t,i){const{text:n,isDirectHost:o}=i;const r=o?t:sb(t);let s=false;if(!r){return false}i.hostElement=r;if(r.getAttribute("data-placeholder")!==n){e.setAttribute("data-placeholder",n,r);s=true}if(nb(r)){if(tb(e,r)){s=true}}else if(ib(e,r)){s=true}return s}function sb(e){if(e.childCount===1){const t=e.getChild(0);if(t.is("element")&&!t.is("uiElement")){return t}}return null}class ab{constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t});e.style.display="none";if(t){e.parentNode.insertBefore(t,e.nextSibling)}}restore(){this._replacedElements.forEach(({element:e,newElement:t})=>{e.style.display="";if(t){t.remove()}});this._replacedElements=[]}}class cb extends Gp{constructor(e,t){super(e);this.view=t;this._toolbarConfig=Qp(e.config.get("toolbar"));this._elementReplacer=new ab}get element(){return this.view.element}init(e){const t=this.editor;const i=this.view;const n=t.editing.view;const o=i.editable;const r=n.document.getRoot();o.name=r.rootName;i.render();const s=o.element;this.setEditableElement(o.name,s);this.focusTracker.add(s);i.editable.bind("isFocused").to(this.focusTracker);n.attachDomRoot(s);if(e){this._elementReplacer.replace(e,this.element)}this._initPlaceholder();this._initToolbar();this.fire("ready")}destroy(){const e=this.view;const t=this.editor.editing.view;this._elementReplacer.restore();t.detachDomRoot(e.editable.name);e.destroy();super.destroy()}_initToolbar(){const e=this.editor;const t=this.view;const i=e.editing.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused");t.stickyPanel.limiterElement=t.element;if(this._toolbarConfig.viewportTopOffset){t.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset}t.toolbar.fillFromConfig(this._toolbarConfig.items,this.componentFactory);Kp({origin:i,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:t.toolbar})}_initPlaceholder(){const e=this.editor;const t=e.editing.view;const i=t.document.getRoot();const n=e.sourceElement;const o=e.config.get("placeholder")||n&&n.tagName.toLowerCase()==="textarea"&&n.getAttribute("placeholder");if(o){Xp({view:t,element:i,text:o,isDirectHost:false})}}}class lb extends xs{constructor(e=[]){super(e,{idProperty:"viewUid"});this.on("add",(e,t,i)=>{this._renderViewIntoCollectionParent(t,i)});this.on("remove",(e,t)=>{if(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||!db(e)){throw new ss["b"]("ui-viewcollection-delegate-wrong-events: All event names must be strings.",this)}return{to:t=>{for(const i of this){for(const n of e){i.delegate(n).to(t)}}this.on("add",(i,n)=>{for(const i of e){n.delegate(i).to(t)}});this.on("remove",(i,n)=>{for(const i of e){n.stopDelegating(i,t)}})}}}_renderViewIntoCollectionParent(e,t){if(!e.isRendered){e.render()}if(e.element&&this._parentElement){this._parentElement.insertBefore(e.element,this._parentElement.children[t])}}}function db(e){return e.every(e=>typeof e=="string")}const ub="http://www.w3.org/1999/xhtml";class hb{constructor(e){Object.assign(this,xb(yb(e)));this._isRendered=false;this._revertData=null}render(){const e=this._renderNode({intoFragment:true});this._isRendered=true;return e}apply(e){this._revertData=Lb();this._renderNode({node:e,isApplying:true,revertData:this._revertData});return e}revert(e){if(!this._revertData){throw new ss["b"]("ui-template-revert-not-applied: Attempting to revert a template which has not been applied yet.",[this,e])}this._revertTemplateFromNode(e,this._revertData)}*getViews(){function*e(t){if(t.children){for(const i of t.children){if(Ob(i)){yield i}else if(zb(i)){yield*e(i)}}}}yield*e(this)}static bind(e,t){return{to(i,n){return new mb({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:n})},if(i,n,o){return new gb({observable:e,emitter:t,attribute:i,valueIfTrue:n,callback:o})}}}static extend(e,t){if(e._isRendered){throw new ss["b"]("template-extend-render: Attempting to extend a template which has already been rendered.",[this,e])}Ib(e,xb(yb(t)))}_renderNode(e){let t;if(e.node){t=this.tag&&this.text}else{t=this.tag?this.text:!this.text}if(t){throw new ss["b"]('ui-template-wrong-syntax: Node definition must have either "tag" or "text" when rendering a new Node.',this)}if(this.text){return this._renderText(e)}else{return this._renderElement(e)}}_renderElement(e){let t=e.node;if(!t){t=e.node=document.createElementNS(this.ns||ub,this.tag)}this._renderAttributes(e);this._renderElementChildren(e);this._setUpListeners(e);return t}_renderText(e){let t=e.node;if(t){e.revertData.text=t.textContent}else{t=e.node=document.createTextNode("")}if(pb(this.text)){this._bindToObservable({schema:this.text,updater:kb(t),data:e})}else{t.textContent=this.text.join("")}return t}_renderAttributes(e){let t,i,n,o;if(!this.attributes){return}const r=e.node;const s=e.revertData;for(t in this.attributes){n=r.getAttribute(t);i=this.attributes[t];if(s){s.attributes[t]=n}o=ce(i[0])&&i[0].ns?i[0].ns:null;if(pb(i)){const a=o?i[0].value:i;if(s&&Db(t)){a.unshift(n)}this._bindToObservable({schema:a,updater:_b(r,t,o),data:e})}else if(t=="style"&&typeof i[0]!=="string"){this._renderStyleAttribute(i[0],e)}else{if(s&&n&&Db(t)){i.unshift(n)}i=i.map(e=>e?e.value||e:e).reduce((e,t)=>e.concat(t),[]).reduce(Sb,"");if(!Nb(i)){r.setAttributeNS(o,t,i)}}}}_renderStyleAttribute(e,t){const i=t.node;for(const n in e){const o=e[n];if(pb(o)){this._bindToObservable({schema:[o],updater:vb(i,n),data:t})}else{i.style[n]=o}}}_renderElementChildren(e){const t=e.node;const i=e.intoFragment?document.createDocumentFragment():t;const n=e.isApplying;let o=0;for(const r of this.children){if(Rb(r)){if(!n){r.setParent(t);for(const e of r){i.appendChild(e.element)}}}else if(Ob(r)){if(!n){if(!r.isRendered){r.render()}i.appendChild(r.element)}}else if(Ed(r)){i.appendChild(r)}else{if(n){const t=e.revertData;const n=Lb();t.children.push(n);r._renderNode({node:i.childNodes[o++],isApplying:true,revertData:n})}else{i.appendChild(r.render())}}}if(e.intoFragment){t.appendChild(i)}}_setUpListeners(e){if(!this.eventListeners){return}for(const t in this.eventListeners){const i=this.eventListeners[t].map(i=>{const[n,o]=t.split("@");return i.activateDomEventListener(n,o,e)});if(e.revertData){e.revertData.bindings.push(i)}}}_bindToObservable({schema:e,updater:t,data:i}){const n=i.revertData;wb(e,t,i);const o=e.filter(e=>!Nb(e)).filter(e=>e.observable).map(n=>n.activateAttributeListener(e,t,i));if(n){n.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;return}for(const i in t.attributes){const n=t.attributes[i];if(n===null){e.removeAttribute(i)}else{e.setAttribute(i,n)}}for(let i=0;iwb(e,t,i);this.emitter.listenTo(this.observable,"change:"+this.attribute,n);return()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,n)}}}class mb extends fb{activateDomEventListener(e,t,i){const n=(e,i)=>{if(!t||i.target.matches(t)){if(typeof this.eventNameOrFunction=="function"){this.eventNameOrFunction(i)}else{this.observable.fire(this.eventNameOrFunction,i)}}};this.emitter.listenTo(i.node,e,n);return()=>{this.emitter.stopListening(i.node,e,n)}}}class gb extends fb{getValue(e){const t=super.getValue(e);return Nb(t)?false:this.valueIfTrue||true}}function pb(e){if(!e){return false}if(e.value){e=e.value}if(Array.isArray(e)){return e.some(pb)}else if(e instanceof fb){return true}return false}function bb(e,t){return e.map(e=>{if(e instanceof fb){return e.getValue(t)}return e})}function wb(e,t,{node:i}){let n=bb(e,i);if(e.length==1&&e[0]instanceof gb){n=n[0]}else{n=n.reduce(Sb,"")}if(Nb(n)){t.remove()}else{t.set(n)}}function kb(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}function _b(e,t,i){return{set(n){e.setAttributeNS(i,t,n)},remove(){e.removeAttributeNS(i,t)}}}function vb(e,t){return{set(i){e.style[t]=i},remove(){e.style[t]=null}}}function yb(e){const t=$r(e,e=>{if(e&&(e instanceof fb||zb(e)||Ob(e)||Rb(e))){return e}});return t}function xb(e){if(typeof e=="string"){e=Cb(e)}else if(e.text){Pb(e)}if(e.on){e.eventListeners=Tb(e.on);delete e.on}if(!e.text){if(e.attributes){Ab(e.attributes)}const t=[];if(e.children){if(Rb(e.children)){t.push(e.children)}else{for(const i of e.children){if(zb(i)||Ob(i)||Ed(i)){t.push(i)}else{t.push(new hb(i))}}}}e.children=t}return e}function Ab(e){for(const t in e){if(e[t].value){e[t].value=[].concat(e[t].value)}Eb(e,t)}}function Tb(e){for(const t in e){Eb(e,t)}return e}function Cb(e){return{text:[e]}}function Pb(e){if(!Array.isArray(e.text)){e.text=[e.text]}}function Eb(e,t){if(!Array.isArray(e[t])){e[t]=[e[t]]}}function Sb(e,t){if(Nb(t)){return e}else if(Nb(e)){return t}else{return`${e} ${t}`}}function Mb(e,t){for(const i in t){if(e[i]){e[i].push(...t[i])}else{e[i]=t[i]}}}function Ib(e,t){if(t.attributes){if(!e.attributes){e.attributes={}}Mb(e.attributes,t.attributes)}if(t.eventListeners){if(!e.eventListeners){e.eventListeners={}}Mb(e.eventListeners,t.eventListeners)}if(t.text){e.text.push(...t.text)}if(t.children&&t.children.length){if(e.children.length!=t.children.length){throw new ss["b"]("ui-template-extend-children-mismatch: The number of children in extended definition does not match.",e)}let i=0;for(const n of t.children){Ib(e.children[i++],n)}}}function Nb(e){return!e&&e!==0}function Ob(e){return e instanceof jb}function zb(e){return e instanceof hb}function Rb(e){return e instanceof lb}function Lb(){return{children:[],bindings:[],attributes:{}}}function Db(e){return e=="class"||e=="style"}var Vb=i(15);class jb{constructor(e){this.element=null;this.isRendered=false;this.locale=e;this.t=e&&e.t;this._viewCollections=new xs;this._unboundChildren=this.createCollection();this._viewCollections.on("add",(t,i)=>{i.locale=e});this.decorate("render")}get bindTemplate(){if(this._bindTemplate){return this._bindTemplate}return this._bindTemplate=hb.bind(this,this)}createCollection(e){const t=new lb(e);this._viewCollections.add(t);return t}registerChild(e){if(!vs(e)){e=[e]}for(const t of e){this._unboundChildren.add(t)}}deregisterChild(e){if(!vs(e)){e=[e]}for(const t of e){this._unboundChildren.remove(t)}}setTemplate(e){this.template=new hb(e)}extendTemplate(e){hb.extend(this.template,e)}render(){if(this.isRendered){throw new ss["b"]("ui-view-render-already-rendered: This View has already been rendered.",this)}if(this.template){this.element=this.template.render();this.registerChild(this.template.getViews())}this.isRendered=true}destroy(){this.stopListening();this._viewCollections.map(e=>e.destroy());if(this.template&&this.template._revertData){this.template.revert(this.element)}}}ys(jb,Kd);ys(jb,Qc);var Bb="[object String]";function Fb(e){return typeof e=="string"||!Kt(e)&&C(e)&&_(e)==Bb}var Hb=Fb;function Ub(e,t,i={},n=[]){const o=i&&i.xmlns;const r=o?e.createElementNS(o,t):e.createElement(t);for(const e in i){r.setAttribute(e,i[e])}if(Hb(n)||!vs(n)){n=[n]}for(let t of n){if(Hb(t)){t=e.createTextNode(t)}r.appendChild(t)}return r}class Wb extends lb{constructor(e,t=[]){super(t);this.locale=e}attachToDom(){this._bodyCollectionContainer=new hb({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");if(!e){e=Ub(document,"div",{class:"ck-body-wrapper"});document.body.appendChild(e)}e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy();if(this._bodyCollectionContainer){this._bodyCollectionContainer.remove()}const e=document.querySelector(".ck-body-wrapper");if(e&&e.childElementCount==0){e.remove()}}}var qb=i(17);class $b extends jb{constructor(e){super(e);this.body=new Wb(e)}render(){super.render();this.body.attachToDom()}destroy(){this.body.detachFromDom();return super.destroy()}}var Yb=i(19);class Gb extends jb{constructor(e){super(e);this.set("text");this.set("for");this.id=`ck-editor__label_${is()}`;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 Kb extends $b{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;const t=new Gb;t.text=e("Rich Text Editor");t.extendTemplate({attributes:{class:"ck-voice-label"}});return t}}class Qb extends jb{constructor(e,t,i){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",false);this._editableElement=i;this._hasExternalElement=!!this._editableElement;this._editingView=t}render(){super.render();if(this._hasExternalElement){this.template.apply(this.element=this._editableElement)}else{this._editableElement=this.element}this.on("change:isFocused",()=>this._updateIsFocusedClasses());this._updateIsFocusedClasses()}destroy(){if(this._hasExternalElement){this.template.revert(this._editableElement)}super.destroy()}_updateIsFocusedClasses(){const e=this._editingView;if(e.isRenderingInProgress){i(this)}else{t(this)}function t(t){e.change(i=>{const n=e.document.getRoot(t.name);i.addClass(t.isFocused?"ck-focused":"ck-blurred",n);i.removeClass(t.isFocused?"ck-blurred":"ck-focused",n)})}function i(n){e.once("change:isRenderingInProgress",(e,o,r)=>{if(!r){t(n)}else{i(n)}})}}}class Jb extends Qb{constructor(e,t,i){super(e,t,i);this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView;const t=this.t;e.change(i=>{const n=e.document.getRoot(this.name);i.setAttribute("aria-label",t("Rich Text Editor, %0",[this.name]),n)})}}function Zb(e){return t=>t+e}var Xb=i(21);const ew=Zb("px");class tw extends jb{constructor(e){super(e);const t=this.bindTemplate;this.set("isActive",false);this.set("isSticky",false);this.set("limiterElement",null);this.set("limiterBottomOffset",50);this.set("viewportTopOffset",0);this.set("_marginLeft",null);this.set("_isStickyToTheLimiter",false);this.set("_hasViewportTopOffset",false);this.content=this.createCollection();this._contentPanelPlaceholder=new hb({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",e=>e?"block":"none"),height:t.to("isSticky",e=>e?ew(this._panelRect.height):null)}}}).render();this._contentPanel=new hb({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?ew(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_hasViewportTopOffset",e=>e?ew(this.viewportTopOffset):null),bottom:t.to("_isStickyToTheLimiter",e=>e?ew(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(Dd.window,"scroll",()=>{this._checkIfShouldBeSticky()});this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const e=this._panelRect=this._contentPanel.getBoundingClientRect();let t;if(!this.limiterElement){this.isSticky=false}else{t=this._limiterRect=this.limiterElement.getBoundingClientRect();this.isSticky=this.isActive&&t.top{this[t]();i()})}}}}get first(){return this.focusables.find(nw)||null}get last(){return this.focusables.filter(nw).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;if(this.focusTracker.focusedElement===null){return null}this.focusables.find((t,i)=>{const n=t.element===this.focusTracker.focusedElement;if(n){e=i}return n});return e}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){if(e){e.focus()}}_getFocusableItem(e){const t=this.current;const i=this.focusables.length;if(!i){return null}if(t===null){return this[e===1?"first":"last"]}let n=(t+i+e)%i;do{const t=this.focusables.get(n);if(nw(t)){return t}n=(n+i+e)%i}while(n!==t);return null}}function nw(e){return!!(e.focus&&Dd.window.getComputedStyle(e.element).display!="none")}class ow extends jb{constructor(e){super(e);this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}const rw=100;class sw{constructor(e,t){if(!sw._observerInstance){sw._createObserver()}this._element=e;this._callback=t;sw._addElementCallback(e,t);sw._observerInstance.observe(e)}destroy(){sw._deleteElementCallback(this._element,this._callback)}static _addElementCallback(e,t){if(!sw._elementCallbacks){sw._elementCallbacks=new Map}let i=sw._elementCallbacks.get(e);if(!i){i=new Set;sw._elementCallbacks.set(e,i)}i.add(t)}static _deleteElementCallback(e,t){const i=sw._getElementCallbacks(e);if(i){i.delete(t);if(!i.size){sw._elementCallbacks.delete(e);sw._observerInstance.unobserve(e)}}if(sw._elementCallbacks&&!sw._elementCallbacks.size){sw._observerInstance=null;sw._elementCallbacks=null}}static _getElementCallbacks(e){if(!sw._elementCallbacks){return null}return sw._elementCallbacks.get(e)}static _createObserver(){let e;if(typeof Dd.window.ResizeObserver==="function"){e=Dd.window.ResizeObserver}else{e=aw}sw._observerInstance=new e(e=>{for(const t of e){if(!t.target.offsetParent){continue}const e=sw._getElementCallbacks(t.target);if(e){for(const i of e){i(t)}}}})}}sw._observerInstance=null;sw._elementCallbacks=null;class aw{constructor(e){this._callback=e;this._elements=new Set;this._previousRects=new Map;this._periodicCheckTimeout=null}observe(e){this._elements.add(e);this._checkElementRectsAndExecuteCallback();if(this._elements.size===1){this._startPeriodicCheck()}}unobserve(e){this._elements.delete(e);this._previousRects.delete(e);if(!this._elements.size){this._stopPeriodicCheck()}}_startPeriodicCheck(){const e=()=>{this._checkElementRectsAndExecuteCallback();this._periodicCheckTimeout=setTimeout(e,rw)};this.listenTo(Dd.window,"resize",()=>{this._checkElementRectsAndExecuteCallback()});this._periodicCheckTimeout=setTimeout(e,rw)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout);this.stopListening();this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const e=[];for(const t of this._elements){if(this._hasRectChanged(t)){e.push({target:t,contentRect:this._previousRects.get(t)})}}if(e.length){this._callback(e)}}_hasRectChanged(e){if(!e.ownerDocument.body.contains(e)){return false}const t=new Ch(e);const i=this._previousRects.get(e);const n=!i||!i.isEqual(t);this._previousRects.set(e,t);return n}}ys(aw,Kd);function cw(e){return e.bindTemplate.to(t=>{if(t.target===e.element){t.preventDefault()}})}class lw extends jb{constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",false);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(){if(this.children.length){this.children.first.focus()}}focusLast(){if(this.children.length){const e=this.children.last;if(typeof e.focusLast==="function"){e.focusLast()}else{e.focus()}}}}var dw=i(23);function uw(e){if(!e||!e.parentNode){return null}if(e.offsetParent===Dd.document.body){return null}return e.offsetParent}function hw({element:e,target:t,positions:i,limiter:n,fitInViewport:o}){if(me(t)){t=t()}if(me(n)){n=n()}const r=uw(e);const s=new Ch(e);const a=new Ch(t);let c;let l;if(!n&&!o){[l,c]=fw(i[0],a,s)}else{const e=n&&new Ch(n).getVisible();const t=o&&new Ch(Dd.window);const r=mw(i,{targetRect:a,elementRect:s,limiterRect:e,viewportRect:t});[l,c]=r||fw(i[0],a,s)}let d=ww(c);if(r){d=bw(d,r)}return{left:d.left,top:d.top,name:l}}function fw(e,t,i){const n=e(t,i);if(!n){return null}const{left:o,top:r,name:s}=n;return[s,i.clone().moveTo(o,r)]}function mw(e,t){const{elementRect:i,viewportRect:n}=t;const o=i.getArea();const r=gw(e,t);if(n){const e=r.filter(({viewportIntersectArea:e})=>e===o);const t=pw(e,o);if(t){return t}}return pw(r,o)}function gw(e,{targetRect:t,elementRect:i,limiterRect:n,viewportRect:o}){const r=[];const s=i.getArea();for(const a of e){const e=fw(a,t,i);if(!e){continue}const[c,l]=e;let d=0;let u=0;if(n){if(o){const e=n.getIntersection(o);if(e){d=e.getIntersectionArea(l)}}else{d=n.getIntersectionArea(l)}}if(o){u=o.getIntersectionArea(l)}const h={positionName:c,positionRect:l,limiterIntersectArea:d,viewportIntersectArea:u};if(d===s){return[h]}r.push(h)}return r}function pw(e,t){let i=0;let n;let o;for(const{positionName:r,positionRect:s,limiterIntersectArea:a,viewportIntersectArea:c}of e){if(a===t){return[r,s]}const e=c**2+a**2;if(e>i){i=e;n=s;o=r}}return n?[o,n]:null}function bw({left:e,top:t},i){const n=ww(new Ch(i));const o=Ah(i);e-=n.left;t-=n.top;e+=i.scrollLeft;t+=i.scrollTop;e-=o.left;t-=o.top;return{left:e,top:t}}function ww({left:e,top:t}){const{scrollX:i,scrollY:n}=Dd.window;return{left:e+i,top:t+n}}class kw extends jb{constructor(e,t,i){super(e);const n=this.bindTemplate;this.buttonView=t;this.panelView=i;this.set("isOpen",false);this.set("isEnabled",true);this.set("class");this.set("id");this.set("panelPosition","auto");this.keystrokes=new zp;this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",n.to("class"),n.if("isEnabled","ck-disabled",e=>!e)],id:n.to("id"),"aria-describedby":n.to("ariaDescribedById")},children:[t,i]});t.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render();this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen});this.panelView.bind("isVisible").to(this,"isOpen");this.on("change:isOpen",()=>{if(!this.isOpen){return}if(this.panelPosition==="auto"){this.panelView.position=kw._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:true,positions:this._panelPositions}).name}else{this.panelView.position=this.panelPosition}});this.keystrokes.listenTo(this.element);const e=(e,t)=>{if(this.isOpen){this.buttonView.focus();this.isOpen=false;t()}};this.keystrokes.set("arrowdown",(e,t)=>{if(this.buttonView.isEnabled&&!this.isOpen){this.isOpen=true;t()}});this.keystrokes.set("arrowright",(e,t)=>{if(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:i,northWest:n}=kw.defaultPanelPositions;if(this.locale.uiLanguageDirection==="ltr"){return[e,t,i,n]}else{return[t,e,n,i]}}}kw.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"})};kw._getOptimalPosition=hw;var _w=i(25);class vw extends jb{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");const t=e.querySelector("svg");const i=t.getAttribute("viewBox");if(i){this.viewBox=i}this.element.innerHTML="";while(t.childNodes.length>0){this.element.appendChild(t.childNodes[0])}}}_colorFillPaths(){if(this.fillColor){this.element.querySelectorAll(".ck-icon__fill").forEach(e=>{e.style.fill=this.fillColor})}}}var yw=i(27);class xw extends jb{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")}]}]})}}var Aw=i(29);class Tw extends jb{constructor(e){super(e);const t=this.bindTemplate;const i=is();this.set("class");this.set("labelStyle");this.set("icon");this.set("isEnabled",true);this.set("isOn",false);this.set("isVisible",true);this.set("isToggleable",false);this.set("keystroke");this.set("label");this.set("tabindex",-1);this.set("tooltip");this.set("tooltipPosition","s");this.set("type","button");this.set("withText",false);this.set("withKeystroke",false);this.children=this.createCollection();this.tooltipView=this._createTooltipView();this.labelView=this._createLabelView(i);this.iconView=new vw;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?e:"button"),tabindex:t.to("tabindex"),"aria-labelledby":`ck-editor__aria-label_${i}`,"aria-disabled":t.if("isEnabled",true,e=>!e),"aria-pressed":t.to("isOn",e=>this.isToggleable?String(e):false)},children:this.children,on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(e=>{if(this.isEnabled){this.fire("execute")}else{e.preventDefault()}})}})}render(){super.render();if(this.icon){this.iconView.bind("content").to(this,"icon");this.children.add(this.iconView)}this.children.add(this.tooltipView);this.children.add(this.labelView);if(this.withKeystroke){this.children.add(this.keystrokeView)}}focus(){this.element.focus()}_createTooltipView(){const e=new xw;e.bind("text").to(this,"_tooltipString");e.bind("position").to(this,"tooltipPosition");return e}_createLabelView(e){const t=new jb;const i=this.bindTemplate;t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:i.to("labelStyle"),id:`ck-editor__aria-label_${e}`},children:[{text:this.bindTemplate.to("label")}]});return t}_createKeystrokeView(){const e=new jb;e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",e=>Dl(e))}]});return e}_getTooltipString(e,t,i){if(e){if(typeof e=="string"){return e}else{if(i){i=Dl(i)}if(e instanceof Function){return e(t,i)}else{return`${t}${i?` (${i})`:""}`}}}return""}}var Cw='';class Pw extends Tw{constructor(e){super(e);this.arrowView=this._createArrowView();this.extendTemplate({attributes:{"aria-haspopup":true}});this.delegate("execute").to(this,"open")}render(){super.render();this.children.add(this.arrowView)}_createArrowView(){const e=new vw;e.content=Cw;e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}});return e}}var Ew=i(31);class Sw extends jb{constructor(){super();this.items=this.createCollection();this.focusTracker=new Yp;this.keystrokes=new zp;this._focusCycler=new iw({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 Mw extends jb{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 Iw extends jb{constructor(e){super(e);this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}var Nw=i(33);class Ow extends Tw{constructor(e){super(e);this.isToggleable=true;this.toggleSwitchView=this._createToggleView();this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render();this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new jb;e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]});return e}}function zw({emitter:e,activator:t,callback:i,contextElements:n}){e.listenTo(document,"mousedown",(e,{target:o})=>{if(!t()){return}for(const e of n){if(e.contains(o)){return}}i()})}var Rw=i(35);var Lw=i(37);function Dw(e,t=Pw){const i=new t(e);const n=new lw(e);const o=new kw(e,i,n);i.bind("isEnabled").to(o);if(i instanceof Pw){i.bind("isOn").to(o,"isOpen")}else{i.arrowView.bind("isOn").to(o,"isOpen")}Bw(o);return o}function Vw(e,t){const i=e.locale;const n=i.t;const o=e.toolbarView=new $w(i);o.set("ariaLabel",n("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 jw(e,t){const i=e.locale;const n=e.listView=new Sw(i);n.items.bindTo(t).using(({type:e,model:t})=>{if(e==="separator"){return new Iw(i)}else if(e==="button"||e==="switchbutton"){const n=new Mw(i);let o;if(e==="button"){o=new Tw(i)}else{o=new Ow(i)}o.bind(...Object.keys(t)).to(t);o.delegate("execute").to(n);n.children.add(o);return n}});e.panelView.children.add(n);n.items.delegate("execute").to(e)}function Bw(e){Fw(e);Hw(e);Uw(e)}function Fw(e){e.on("render",()=>{zw({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=false},contextElements:[e.element]})})}function Hw(e){e.on("execute",t=>{if(t.source instanceof Ow){return}e.isOpen=false})}function Uw(e){e.keystrokes.set("arrowdown",(t,i)=>{if(e.isOpen){e.panelView.focus();i()}});e.keystrokes.set("arrowup",(t,i)=>{if(e.isOpen){e.panelView.focusLast();i()}})}var Ww='';var qw=i(39);class $w extends jb{constructor(e,t){super(e);const i=this.bindTemplate;const n=this.t;this.options=t||{};this.set("ariaLabel",n("Editor toolbar"));this.set("maxWidth","auto");this.items=this.createCollection();this.focusTracker=new Yp;this.keystrokes=new zp;this.set("class");this.set("isCompact",false);this.itemsView=new Yw(e);this.children=this.createCollection();this.children.add(this.itemsView);this.focusables=this.createCollection();this._focusCycler=new iw({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",i.to("class"),i.if("isCompact","ck-toolbar_compact")],role:"toolbar","aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")}},children:this.children,on:{mousedown:cw(this)}});this._behavior=this.options.shouldGroupWhenFull?new Kw(this):new Gw(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(){this._behavior.destroy();return super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t){this.items.addMany(e.map(e=>{if(e=="|"){return new ow}else if(t.has(e)){return t.create(e)}else{console.warn(Object(ss["a"])("toolbarview-item-unavailable: The requested toolbar item is unavailable."),{name:e})}}).filter(e=>e!==undefined))}}class Yw extends jb{constructor(e){super(e);this.children=this.createCollection();this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Gw{constructor(e){const t=e.bindTemplate;e.set("isVertical",false);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 Kw{constructor(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=false;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 i=t.index;for(const e of t.removed){if(i>=this.ungroupedItems.length){this.groupedItems.remove(e)}else{this.ungroupedItems.remove(e)}}for(let e=i;ethis.ungroupedItems.length){this.groupedItems.add(n,e-this.ungroupedItems.length)}else{this.ungroupedItems.add(n,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){this.shouldUpdateGroupingOnNextResize=true;return}let e;while(this._areItemsOverflowing){this._groupLastItem();e=true}if(!e&&this.groupedItems.length){while(this.groupedItems.length&&!this._areItemsOverflowing){this._ungroupFirstItem()}if(this._areItemsOverflowing){this._groupLastItem()}}}get _areItemsOverflowing(){if(!this.ungroupedItems.length){return false}const e=this.viewElement;const t=this.viewLocale.uiLanguageDirection;const i=new Ch(e.lastChild);const n=new Ch(e);if(!this.cachedPadding){const i=Dd.window.getComputedStyle(e);const n=t==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(i[n])}if(t==="ltr"){return i.right>n.right-this.cachedPadding}else{return i.left{if(!e||e!==t.contentRect.width||this.shouldUpdateGroupingOnNextResize){this.shouldUpdateGroupingOnNextResize=false;this._updateGrouping();e=t.contentRect.width}});this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){if(!this.groupedItems.length){this.viewChildren.add(new ow);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));if(!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;const t=e.t;const i=Dw(e);i.class="ck-toolbar__grouped-dropdown";i.panelPosition=e.uiLanguageDirection==="ltr"?"sw":"se";Vw(i,[]);i.buttonView.set({label:t("Show more items"),tooltip:true,icon:Ww});i.toolbarView.items.bindTo(this.groupedItems).using(e=>e);return i}_updateFocusCycleableItems(){this.viewFocusables.clear();this.ungroupedItems.map(e=>{this.viewFocusables.add(e)});if(this.groupedItems.length){this.viewFocusables.add(this.groupedItemsDropdown)}}}var Qw=i(41);class Jw extends Kb{constructor(e,t,i={}){super(e);this.stickyPanel=new tw(e);this.toolbar=new $w(e,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull});this.editable=new Jb(e,t)}render(){super.render();this.stickyPanel.content.add(this.toolbar);this.top.add(this.stickyPanel);this.main.add(this.editable)}}function Zw(e){if(e instanceof HTMLTextAreaElement){return e.value}return e.innerHTML}class Xw extends Lp{constructor(e,t){super(t);if(Gr(e)){this.sourceElement=e}this.data.processor=new Wp(this.data.viewDocument);this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull");const n=new Jw(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i});this.ui=new cb(this,n);Hp(this)}destroy(){if(this.sourceElement){this.updateSourceElement()}this.ui.destroy();return super.destroy()}static create(e,t={}){return new Promise(i=>{const n=new this(e,t);i(n.initPlugins().then(()=>n.ui.init(Gr(e)?e:null)).then(()=>{if(!Gr(e)&&t.initialData){throw new ss["b"]("editor-create-initial-data: "+"The config.initialData option cannot be used together with initial data passed in Editor.create().",null)}const i=t.initialData||ek(e);return n.data.init(i)}).then(()=>n.fire("ready")).then(()=>n))})}}ys(Xw,Vp);ys(Xw,Fp);function ek(e){return Gr(e)?Zw(e):e}class tk{constructor(e){this.editor=e;this.set("isEnabled",true);this._disableStack=new Set}forceDisabled(e){this._disableStack.add(e);if(this._disableStack.size==1){this.on("set:isEnabled",ik,{priority:"highest"});this.isEnabled=false}}clearForceDisabled(e){this._disableStack.delete(e);if(this._disableStack.size==0){this.off("set:isEnabled",ik);this.isEnabled=true}}destroy(){this.stopListening()}static get isContextPlugin(){return false}}ys(tk,Qc);function ik(e){e.return=false;e.stop()}class nk{constructor(e){this.editor=e;this.set("value",undefined);this.set("isEnabled",false);this._disableStack=new Set;this.decorate("execute");this.listenTo(this.editor.model.document,"change",()=>{this.refresh()});this.on("execute",e=>{if(!this.isEnabled){e.stop()}},{priority:"high"});this.listenTo(e,"change:isReadOnly",(e,t,i)=>{if(i){this.forceDisabled("readOnlyMode")}else{this.clearForceDisabled("readOnlyMode")}})}refresh(){this.isEnabled=true}forceDisabled(e){this._disableStack.add(e);if(this._disableStack.size==1){this.on("set:isEnabled",ok,{priority:"highest"});this.isEnabled=false}}clearForceDisabled(e){this._disableStack.delete(e);if(this._disableStack.size==0){this.off("set:isEnabled",ok);this.refresh()}}execute(){}destroy(){this.stopListening()}}ys(nk,Qc);function ok(e){e.return=false;e.stop()}function rk(e){const t=e.next();if(t.done){return null}return t.value}const sk=["left","right","center","justify"];function ak(e){return sk.includes(e)}function ck(e,t){if(t.contentLanguageDirection=="rtl"){return e==="right"}else{return e==="left"}}const lk="alignment";class dk extends nk{refresh(){const e=this.editor;const t=e.locale;const i=rk(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!i&&this._canBeAligned(i);if(this.isEnabled&&i.hasAttribute("alignment")){this.value=i.getAttribute("alignment")}else{this.value=t.contentLanguageDirection==="rtl"?"right":"left"}}execute(e={}){const t=this.editor;const i=t.locale;const n=t.model;const o=n.document;const r=e.value;n.change(e=>{const t=Array.from(o.selection.getSelectedBlocks()).filter(e=>this._canBeAligned(e));const n=t[0].getAttribute("alignment");const s=ck(r,i)||n===r||!r;if(s){uk(t,e)}else{hk(t,e,r)}})}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,lk)}}function uk(e,t){for(const i of e){t.removeAttribute(lk,i)}}function hk(e,t,i){for(const n of e){t.setAttribute(lk,i,n)}}class fk extends tk{static get pluginName(){return"AlignmentEditing"}constructor(e){super(e);e.config.define("alignment",{options:[...sk]})}init(){const e=this.editor;const t=e.locale;const i=e.model.schema;const n=e.config.get("alignment.options").filter(ak);i.extend("$block",{allowAttributes:"alignment"});e.model.schema.setAttributeProperties("alignment",{isFormatting:true});const o=mk(n.filter(e=>!ck(e,t)));e.conversion.attributeToAttribute(o);e.commands.add("alignment",new dk(e))}}function mk(e){const t={model:{key:"alignment",values:e.slice()},view:{}};for(const i of e){t.view[i]={key:"style",value:{"text-align":i}}}return t}var gk='';var pk='';var bk='';var wk='';const kk=new Map([["left",gk],["right",pk],["center",bk],["justify",wk]]);class _k extends tk{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;const t=e.ui.componentFactory;const i=e.t;const n=e.config.get("alignment.options");n.filter(ak).forEach(e=>this._addButton(e));t.add("alignment",e=>{const o=Dw(e);const r=n.map(e=>t.create(`alignment:${e}`));Vw(o,r);o.buttonView.set({label:i("Text alignment"),tooltip:true});o.toolbarView.isVertical=true;o.toolbarView.ariaLabel=i("Text alignment toolbar");o.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const s=e.contentLanguageDirection==="rtl"?pk:gk;o.buttonView.bind("icon").toMany(r,"isOn",(...e)=>{const t=e.findIndex(e=>e);if(t<0){return s}return r[t].icon});o.bind("isEnabled").toMany(r,"isEnabled",(...e)=>e.some(e=>e));return o})}_addButton(e){const t=this.editor;t.ui.componentFactory.add(`alignment:${e}`,i=>{const n=t.commands.get("alignment");const o=new Tw(i);o.set({label:this.localizedOptionTitles[e],icon:kk.get(e),tooltip:true,isToggleable:true});o.bind("isEnabled").to(n);o.bind("isOn").to(n,"value",t=>t===e);this.listenTo(o,"execute",()=>{t.execute("alignment",{value:e});t.editing.view.focus()});return o})}}class vk extends tk{static get requires(){return[fk,_k]}static get pluginName(){return"Alignment"}}function yk(e,t){let i=e.start;const n=Array.from(e.getItems()).reduce((e,n)=>{if(!(n.is("$text")||n.is("$textProxy"))){i=t.createPositionAfter(n);return""}return e+n.data},"");return{text:n,range:t.createRange(i,e.end)}}class xk{constructor(e,t){this.model=e;this.testCallback=t;this.hasMatch=false;this.set("isEnabled",true);this.on("change:isEnabled",()=>{if(this.isEnabled){this._startListening()}else{this.stopListening(e.document.selection);this.stopListening(e.document)}});this._startListening()}_startListening(){const e=this.model;const t=e.document;this.listenTo(t.selection,"change:range",(e,{directChange:i})=>{if(!i){return}if(!t.selection.isCollapsed){if(this.hasMatch){this.fire("unmatched");this.hasMatch=false}return}this._evaluateTextBeforeSelection("selection")});this.listenTo(t,"change:data",(e,t)=>{if(t.type=="transparent"){return}this._evaluateTextBeforeSelection("data",{batch:t})})}_evaluateTextBeforeSelection(e,t={}){const i=this.model;const n=i.document;const o=n.selection;const r=i.createRange(i.createPositionAt(o.focus.parent,0),o.focus);const{text:s,range:a}=yk(r,i);const c=this.testCallback(s);if(!c&&this.hasMatch){this.fire("unmatched")}this.hasMatch=!!c;if(c){const i=Object.assign(t,{text:s,range:a});if(typeof c=="object"){Object.assign(i,c)}this.fire(`matched:${e}`,i)}}}ys(xk,Qc);const Ak=4;const Tk=new RegExp("(^|\\s)"+"("+"("+"(?:(?:(?:https?|ftp):)?\\/\\/)"+"(?:\\S+(?::\\S*)?@)?"+"(?:"+"(?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.)+"+"(?:[a-z\\u00a1-\\uffff]{2,})"+")"+"(?::\\d{2,5})?"+"(?:[/?#]\\S*)?"+")"+"|"+"("+"(www.|(\\S+@))"+"((?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.))+"+"(?:[a-z\\u00a1-\\uffff]{2,})"+")"+")$","i");const Ck=2;const Pk=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i;class Ek extends tk{static get pluginName(){return"AutoLink"}init(){const e=this.editor;const t=e.model.document.selection;t.on("change:range",()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")});this._enableTypingHandling()}afterInit(){this._enableEnterHandling();this._enableShiftEnterHandling()}_enableTypingHandling(){const e=this.editor;const t=new xk(e.model,e=>{if(!Sk(e)){return}const t=Mk(e.substr(0,e.length-1));if(t){return{url:t}}});const i=e.plugins.get("Input");t.on("matched:data",(t,n)=>{const{batch:o,range:r,url:s}=n;if(!i.isInput(o)){return}const a=r.end.getShiftedBy(-1);const c=a.getShiftedBy(-s.length);const l=e.model.createRange(c,a);this._applyAutoLink(s,l)});t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor;const t=e.model;const i=e.commands.get("enter");if(!i){return}i.on("execute",()=>{const e=t.document.selection.getFirstPosition();const i=t.createRange(t.createPositionAt(e.parent.previousSibling,0),t.createPositionAt(e.parent.previousSibling,"end"));this._checkAndApplyAutoLinkOnRange(i)})}_enableShiftEnterHandling(){const e=this.editor;const t=e.model;const i=e.commands.get("shiftEnter");if(!i){return}i.on("execute",()=>{const e=t.document.selection.getFirstPosition();const i=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(i)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model;const{text:i,range:n}=yk(e,t);const o=Mk(i);if(o){const e=t.createRange(n.end.getShiftedBy(-o.length),n.end);this._applyAutoLink(o,e)}}_applyAutoLink(e,t){const i=this.editor.model;if(!this.isEnabled||!Nk(t,i)){return}i.enqueueChange(i=>{const n=Ik(e)?`mailto:${e}`:e;i.setAttribute("linkHref",n,t)})}}function Sk(e){return e.length>Ak&&e[e.length-1]===" "&&e[e.length-2]!==" "}function Mk(e){const t=Tk.exec(e);return t?t[Ck]:null}function Ik(e){return Pk.exec(e)}function Nk(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}class Ok extends nk{refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model;const i=t.schema;const n=t.document.selection;const o=Array.from(n.getSelectedBlocks());const r=e.forceValue===undefined?!this.value:e.forceValue;t.change(e=>{if(!r){this._removeQuote(e,o.filter(zk))}else{const t=o.filter(e=>zk(e)||Lk(i,e));this._applyQuote(e,t)}})}_getValue(){const e=this.editor.model.document.selection;const t=rk(e.getSelectedBlocks());return!!(t&&zk(t))}_checkEnabled(){if(this.value){return true}const e=this.editor.model.document.selection;const t=this.editor.model.schema;const i=rk(e.getSelectedBlocks());if(!i){return false}return Lk(t,i)}_removeQuote(e,t){Rk(e,t).reverse().forEach(t=>{if(t.start.isAtStart&&t.end.isAtEnd){e.unwrap(t.start.parent);return}if(t.start.isAtStart){const i=e.createPositionBefore(t.start.parent);e.move(t,i);return}if(!t.end.isAtEnd){e.split(t.end)}const i=e.createPositionAfter(t.end.parent);e.move(t,i)})}_applyQuote(e,t){const i=[];Rk(e,t).reverse().forEach(t=>{let n=zk(t.start);if(!n){n=e.createElement("blockQuote");e.wrap(t,n)}i.push(n)});i.reverse().reduce((t,i)=>{if(t.nextSibling==i){e.merge(e.createPositionAfter(t));return t}return i})}}function zk(e){return e.parent.name=="blockQuote"?e.parent:null}function Rk(e,t){let i;let n=0;const o=[];while(n{if(e.endsWith("blockQuote")&&t.name=="blockQuote"){return false}});e.conversion.elementToElement({model:"blockQuote",view:"blockquote"});e.model.document.registerPostFixer(i=>{const n=e.model.document.differ.getChanges();for(const e of n){if(e.type=="insert"){const n=e.position.nodeAfter;if(!n){continue}if(n.is("element","blockQuote")&&n.isEmpty){i.remove(n);return true}else if(n.is("element","blockQuote")&&!t.checkChild(e.position,n)){i.unwrap(n);return true}else if(n.is("element")){const e=i.createRangeIn(n);for(const n of e.getItems()){if(n.is("element","blockQuote")&&!t.checkChild(i.createPositionBefore(n),n)){i.unwrap(n);return true}}}}else if(e.type=="remove"){const t=e.position.parent;if(t.is("element","blockQuote")&&t.isEmpty){i.remove(t);return true}}}return false})}afterInit(){const e=this.editor;const t=e.commands.get("blockQuote");this.listenTo(this.editor.editing.view.document,"enter",(e,i)=>{const n=this.editor.model.document;const o=n.selection.getLastPosition().parent;if(n.selection.isCollapsed&&o.isEmpty&&t.value){this.editor.execute("blockQuote");this.editor.editing.view.scrollToTheSelection();i.preventDefault();e.stop()}})}}var Vk='';var jk=i(43);class Bk extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add("blockQuote",i=>{const n=e.commands.get("blockQuote");const o=new Tw(i);o.set({label:t("Block quote"),icon:Vk,tooltip:true,isToggleable:true});o.bind("isOn","isEnabled").to(n,"value","isEnabled");this.listenTo(o,"execute",()=>{e.execute("blockQuote");e.editing.view.focus()});return o})}}class Fk extends tk{static get requires(){return[Dk,Bk]}static get pluginName(){return"BlockQuote"}}class Hk extends nk{constructor(e,t){super(e);this.attributeKey=t}refresh(){const e=this.editor.model;const t=e.document;this.value=this._getValueFromFirstAllowedNode();this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model;const i=t.document;const n=i.selection;const o=e.forceValue===undefined?!this.value:e.forceValue;t.change(e=>{if(n.isCollapsed){if(o){e.setSelectionAttribute(this.attributeKey,true)}else{e.removeSelectionAttribute(this.attributeKey)}}else{const i=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of i){if(o){e.setAttribute(this.attributeKey,o,t)}else{e.removeAttribute(this.attributeKey,t)}}}})}_getValueFromFirstAllowedNode(){const e=this.editor.model;const t=e.schema;const i=e.document.selection;if(i.isCollapsed){return i.hasAttribute(this.attributeKey)}for(const e of i.getRanges()){for(const i of e.getItems()){if(t.checkAttribute(i,this.attributeKey)){return i.hasAttribute(this.attributeKey)}}}return false}}const Uk="bold";class Wk extends tk{static get pluginName(){return"BoldEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Uk});e.model.schema.setAttributeProperties(Uk,{isFormatting:true,copyOnEnter:true});e.conversion.attributeToElement({model:Uk,view:"strong",upcastAlso:["b",e=>{const t=e.getStyle("font-weight");if(!t){return null}if(t=="bold"||Number(t)>=600){return{name:true,styles:["font-weight"]}}}]});e.commands.add(Uk,new Hk(e,Uk));e.keystrokes.set("CTRL+B",Uk)}}var qk='';const $k="bold";class Yk extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add($k,i=>{const n=e.commands.get($k);const o=new Tw(i);o.set({label:t("Bold"),icon:qk,keystroke:"CTRL+B",tooltip:true,isToggleable:true});o.bind("isOn","isEnabled").to(n,"value","isEnabled");this.listenTo(o,"execute",()=>{e.execute($k);e.editing.view.focus()});return o})}}class Gk extends tk{static get requires(){return[Wk,Yk]}static get pluginName(){return"Bold"}}class Kk{constructor(e){this.files=Qk(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)}}function Qk(e){const t=e.files?Array.from(e.files):[];const i=e.items?Array.from(e.items):[];if(t.length){return t}return i.filter(e=>e.kind==="file").map(e=>e.getAsFile())}class Jk extends eh{constructor(e){super(e);const t=this.document;this.domEventType=["paste","copy","cut","drop","dragover"];this.listenTo(t,"paste",i,{priority:"low"});this.listenTo(t,"drop",i,{priority:"low"});function i(e,i){i.preventDefault();const n=i.dropRange?[i.dropRange]:Array.from(t.selection.getRanges());const o=new es(t,"clipboardInput");t.fire(o,{dataTransfer:i.dataTransfer,targetRanges:n});if(o.stop.called){i.stopPropagation()}}}onDomEvent(e){const t={dataTransfer:new Kk(e.clipboardData?e.clipboardData:e.dataTransfer)};if(e.type=="drop"){t.dropRange=Zk(this.view,e)}this.fire(e.type,e,t)}}function Zk(e,t){const i=t.target.ownerDocument;const n=t.clientX;const o=t.clientY;let r;if(i.caretRangeFromPoint&&i.caretRangeFromPoint(n,o)){r=i.caretRangeFromPoint(n,o)}else if(t.rangeParent){r=i.createRange();r.setStart(t.rangeParent,t.rangeOffset);r.collapse(true)}if(r){return e.domConverter.domRangeToView(r)}else{return e.document.selection.getFirstRange()}}function Xk(e){e=e.replace(//g,">").replace(/\n/g,"

").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ");if(e.indexOf("

")>-1){e=`

${e}

`}return e}function e_(e){return e.replace(/(\s+)<\/span>/g,(e,t)=>{if(t.length==1){return" "}return t})}const t_=["figcaption","li"];function i_(e){let t="";if(e.is("$text")||e.is("$textProxy")){t=e.data}else if(e.is("element","img")&&e.hasAttribute("alt")){t=e.getAttribute("alt")}else{let i=null;for(const n of e.getChildren()){const e=i_(n);if(i&&(i.is("containerElement")||n.is("containerElement"))){if(t_.includes(i.name)||t_.includes(n.name)){t+="\n"}else{t+="\n\n"}}t+=e;i=n}}return t}class n_ extends tk{static get pluginName(){return"Clipboard"}init(){const e=this.editor;const t=e.model.document;const i=e.editing.view;const n=i.document;this._htmlDataProcessor=new Wp(n);i.addObserver(Jk);this.listenTo(n,"clipboardInput",t=>{if(e.isReadOnly){t.stop()}},{priority:"highest"});this.listenTo(n,"clipboardInput",(e,t)=>{const n=t.dataTransfer;let o="";if(n.getData("text/html")){o=e_(n.getData("text/html"))}else if(n.getData("text/plain")){o=Xk(n.getData("text/plain"))}o=this._htmlDataProcessor.toView(o);const r=new es(this,"inputTransformation");this.fire(r,{content:o,dataTransfer:n});if(r.stop.called){e.stop()}i.scrollToTheSelection()},{priority:"low"});this.listenTo(this,"inputTransformation",(e,t)=>{if(!t.content.isEmpty){const i=this.editor.data;const n=this.editor.model;const o=i.toModel(t.content,"$clipboardHolder");if(o.childCount==0){return}n.insertContent(o);e.stop()}},{priority:"low"});function o(i,o){const r=o.dataTransfer;o.preventDefault();const s=e.data.toView(e.model.getSelectedContent(t.selection));n.fire("clipboardOutput",{dataTransfer:r,content:s,method:i.name})}this.listenTo(n,"copy",o,{priority:"low"});this.listenTo(n,"cut",(t,i)=>{if(e.isReadOnly){i.preventDefault()}else{o(t,i)}},{priority:"low"});this.listenTo(n,"clipboardOutput",(i,n)=>{if(!n.content.isEmpty){n.dataTransfer.setData("text/html",this._htmlDataProcessor.toData(n.content));n.dataTransfer.setData("text/plain",i_(n.content))}if(n.method=="cut"){e.model.deleteContent(t.selection)}},{priority:"low"})}}function*o_(e,t){for(const i of t){if(i&&e.getAttributeProperties(i[0]).copyOnEnter){yield i}}}class r_ extends nk{execute(){const e=this.editor.model;const t=e.document;e.change(i=>{s_(this.editor.model,i,t.selection,e.schema);this.fire("afterExecute",{writer:i})})}}function s_(e,t,i,n){const o=i.isCollapsed;const r=i.getFirstRange();const s=r.start.parent;const a=r.end.parent;if(n.isLimit(s)||n.isLimit(a)){if(!o&&s==a){e.deleteContent(i)}return}if(o){const e=o_(t.model.schema,i.getAttributes());a_(t,r.start);t.setSelectionAttribute(e)}else{const n=!(r.start.isAtStart&&r.end.isAtEnd);const o=s==a;e.deleteContent(i,{leaveUnmerged:n});if(n){if(o){a_(t,i.focus)}else{t.setSelection(a,0)}}}}function a_(e,t){e.split(t);e.setSelection(t.parent.nextSibling,0)}class c_ extends Zd{constructor(e){super(e);const t=this.document;t.on("keydown",(e,i)=>{if(this.isEnabled&&i.keyCode==zl.enter){let n;t.once("enter",e=>n=e,{priority:"highest"});t.fire("enter",new Xu(t,i.domEvent,{isSoft:i.shiftKey}));if(n&&n.stop.called){e.stop()}}})}observe(){}}class l_ extends tk{static get pluginName(){return"Enter"}init(){const e=this.editor;const t=e.editing.view;const i=t.document;t.addObserver(c_);e.commands.add("enter",new r_(e));this.listenTo(i,"enter",(i,n)=>{n.preventDefault();if(n.isSoft){return}e.execute("enter");t.scrollToTheSelection()},{priority:"low"})}}class d_ extends nk{execute(){const e=this.editor.model;const t=e.document;e.change(i=>{h_(e,i,t.selection);this.fire("afterExecute",{writer:i})})}refresh(){const e=this.editor.model;const t=e.document;this.isEnabled=u_(e.schema,t.selection)}}function u_(e,t){if(t.rangeCount>1){return false}const i=t.anchor;if(!i||!e.checkChild(i,"softBreak")){return false}const n=t.getFirstRange();const o=n.start.parent;const r=n.end.parent;if((m_(o,e)||m_(r,e))&&o!==r){return false}return true}function h_(e,t,i){const n=i.isCollapsed;const o=i.getFirstRange();const r=o.start.parent;const s=o.end.parent;const a=r==s;if(n){const n=o_(e.schema,i.getAttributes());f_(e,t,o.end);t.removeSelectionAttribute(i.getAttributeKeys());t.setSelectionAttribute(n)}else{const n=!(o.start.isAtStart&&o.end.isAtEnd);e.deleteContent(i,{leaveUnmerged:n});if(a){f_(e,t,i.focus)}else{if(n){t.setSelection(s,0)}}}}function f_(e,t,i){const n=t.createElement("softBreak");e.insertContent(n,i);t.setSelection(n,"after")}function m_(e,t){if(e.is("rootElement")){return false}return t.isLimit(e)||m_(e.parent,t)}class g_ extends tk{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor;const t=e.model.schema;const i=e.conversion;const n=e.editing.view;const o=n.document;t.register("softBreak",{allowWhere:"$text",isInline:true});i.for("upcast").elementToElement({model:"softBreak",view:"br"});i.for("downcast").elementToElement({model:"softBreak",view:(e,t)=>t.createEmptyElement("br")});n.addObserver(c_);e.commands.add("shiftEnter",new d_(e));this.listenTo(o,"enter",(t,i)=>{i.preventDefault();if(!i.isSoft){return}e.execute("shiftEnter");n.scrollToTheSelection()},{priority:"low"})}}class p_ extends nk{execute(){const e=this.editor.model;const t=e.document.selection;let i=e.schema.getLimitElement(t);if(t.containsEntireContent(i)||!b_(e.schema,i)){do{i=i.parent;if(!i){return}}while(!b_(e.schema,i))}e.change(e=>{e.setSelection(i,"in")})}}function b_(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const w_=Ll("Ctrl+A");class k_ extends tk{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor;const t=e.editing.view;const i=t.document;e.commands.add("selectAll",new p_(e));this.listenTo(i,"keydown",(t,i)=>{if(Rl(i)===w_){e.execute("selectAll");i.preventDefault()}})}}var __='';class v_ extends tk{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",t=>{const i=e.commands.get("selectAll");const n=new Tw(t);const o=t.t;n.set({label:o("Select all"),icon:__,keystroke:"Ctrl+A",tooltip:true});n.bind("isOn","isEnabled").to(i,"value","isEnabled");this.listenTo(n,"execute",()=>{e.execute("selectAll");e.editing.view.focus()});return n})}}class y_ extends tk{static get requires(){return[k_,v_]}static get pluginName(){return"SelectAll"}}class x_{constructor(e,t=20){this.model=e;this.size=0;this.limit=t;this.isLocked=false;this._changeCallback=(e,t)=>{if(t.type!="transparent"&&t!==this._batch){this._reset(true)}};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(){if(!this._batch){this._batch=this.model.createBatch()}return this._batch}input(e){this.size+=e;if(this.size>=this.limit){this._reset(true)}}lock(){this.isLocked=true}unlock(){this.isLocked=false}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){if(!this.isLocked||e){this._batch=null;this.size=0}}}class A_ extends nk{constructor(e,t){super(e);this._buffer=new x_(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;const i=t.document;const n=e.text||"";const o=n.length;const r=e.range?t.createSelection(e.range):i.selection;const s=e.resultRange;t.enqueueChange(this._buffer.batch,e=>{this._buffer.lock();this._batches.add(this._buffer.batch);t.deleteContent(r);if(n){t.insertContent(e.createText(n,i.selection.getAttributes()),r)}if(s){e.setSelection(s)}else if(!r.is("documentSelection")){e.setSelection(r)}this._buffer.unlock();this._buffer.input(o)})}}function T_(e){let t=null;const i=e.model;const n=e.editing.view;const o=e.commands.get("input");if(Cl.isAndroid){n.document.on("beforeinput",(e,t)=>r(t),{priority:"lowest"})}else{n.document.on("keydown",(e,t)=>r(t),{priority:"lowest"})}n.document.on("compositionstart",s,{priority:"lowest"});n.document.on("compositionend",()=>{t=i.createSelection(i.document.selection)},{priority:"lowest"});function r(e){const r=i.document;const s=n.document.isComposing;const c=t&&t.isEqual(r.selection);t=null;if(!o.isEnabled){return}if(P_(e)||r.selection.isCollapsed){return}if(s&&e.keyCode===229){return}if(!s&&e.keyCode===229&&c){return}a()}function s(){const e=i.document;const t=e.selection.rangeCount===1?e.selection.getFirstRange().isFlat:true;if(e.selection.isCollapsed||t){return}a()}function a(){const e=o.buffer;e.lock();const t=e.batch;o._batches.add(t);i.enqueueChange(t,()=>{i.deleteContent(i.document.selection)});e.unlock()}}const C_=[Rl("arrowUp"),Rl("arrowRight"),Rl("arrowDown"),Rl("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++){C_.push(e)}function P_(e){if(e.ctrlKey){return true}return C_.includes(e.keyCode)}function E_(e,t){const i=[];let n=0;let o;e.forEach(e=>{if(e=="equal"){r();n++}else if(e=="insert"){if(s("insert")){o.values.push(t[n])}else{r();o={type:"insert",index:n,values:[t[n]]}}n++}else{if(s("delete")){o.howMany++}else{r();o={type:"delete",index:n,howMany:1}}}});r();return i;function r(){if(o){i.push(o);o=null}}function s(e){return o&&o.type==e}}function S_(e){if(e.length==0){return false}for(const t of e){if(t.type==="children"&&!M_(t)){return true}}return false}function M_(e){if(e.newChildren.length-e.oldChildren.length!=1){return}const t=Td(e.oldChildren,e.newChildren,I_);const i=E_(t,e.newChildren);if(i.length>1){return}const n=i[0];if(!(!!n.values[0]&&n.values[0].is("$text"))){return}return n}function I_(e,t){if(!!e&&e.is("$text")&&!!t&&t.is("$text")){return e.data===t.data}else{return e===t}}function N_(e){e.editing.view.document.on("mutations",(t,i,n)=>{new O_(e).handle(i,n)})}class O_{constructor(e){this.editor=e;this.editing=this.editor.editing}handle(e,t){if(S_(e)){this._handleContainerChildrenMutations(e,t)}else{for(const i of e){this._handleTextMutation(i,t);this._handleTextNodeInsertion(i)}}}_handleContainerChildrenMutations(e,t){const i=z_(e);if(!i){return}const n=this.editor.editing.view.domConverter;const o=n.mapViewToDom(i);const r=new Hd(this.editor.editing.view.document);const s=this.editor.data.toModel(r.domToView(o)).getChild(0);const a=this.editor.editing.mapper.toModelElement(i);if(!a){return}const c=Array.from(s.getChildren());const l=Array.from(a.getChildren());const d=c[c.length-1];const u=l[l.length-1];const h=d&&d.is("element","softBreak");const f=u&&!u.is("element","softBreak");if(h&&f){c.pop()}const m=this.editor.model.schema;if(!R_(c,m)||!R_(l,m)){return}const g=c.map(e=>e.is("$text")?e.data:"@").join("").replace(/\u00A0/g," ");const p=l.map(e=>e.is("$text")?e.data:"@").join("").replace(/\u00A0/g," ");if(p===g){return}const b=Td(p,g);const{firstChangeAt:w,insertions:k,deletions:_}=L_(b);let v=null;if(t){v=this.editing.mapper.toModelRange(t.getFirstRange())}const y=g.substr(w,k);const x=this.editor.model.createRange(this.editor.model.createPositionAt(a,w),this.editor.model.createPositionAt(a,w+_));this.editor.execute("input",{text:y,range:x,resultRange:v})}_handleTextMutation(e,t){if(e.type!="text"){return}const i=e.newText.replace(/\u00A0/g," ");const n=e.oldText.replace(/\u00A0/g," ");if(n===i){return}const o=Td(n,i);const{firstChangeAt:r,insertions:s,deletions:a}=L_(o);let c=null;if(t){c=this.editing.mapper.toModelRange(t.getFirstRange())}const l=this.editing.view.createPositionAt(e.node,r);const d=this.editing.mapper.toModelPosition(l);const u=this.editor.model.createRange(d,d.getShiftedBy(a));const h=i.substr(r,s);this.editor.execute("input",{text:h,range:u,resultRange:c})}_handleTextNodeInsertion(e){if(e.type!="children"){return}const t=M_(e);const i=this.editing.view.createPositionAt(e.node,t.index);const n=this.editing.mapper.toModelPosition(i);const o=t.values[0].data;this.editor.execute("input",{text:o.replace(/\u00A0/g," "),range:this.editor.model.createRange(n)})}}function z_(e){const t=e.map(e=>e.node).reduce((e,t)=>e.getCommonAncestor(t,{includeSelf:true}));if(!t){return}return t.getAncestors({includeSelf:true,parentFirst:true}).find(e=>e.is("containerElement")||e.is("rootElement"))}function R_(e,t){return e.every(e=>t.isInline(e))}function L_(e){let t=null;let i=null;for(let n=0;n{this._buffer.lock();const o=n.createSelection(e.selection||i.selection);const r=o.isCollapsed;if(o.isCollapsed){t.modifySelection(o,{direction:this.direction,unit:e.unit})}if(this._shouldEntireContentBeReplacedWithParagraph(e.sequence||1)){this._replaceEntireContentWithParagraph(n);return}if(o.isCollapsed){return}let s=0;o.getFirstRange().getMinimalFlatRanges().forEach(e=>{s+=ml(e.getWalker({singleCharacters:true,ignoreElementEnd:true,shallow:true}))});t.deleteContent(o,{doNotResetEntireContent:r,direction:this.direction});this._buffer.input(s);n.setSelection(o);this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1){return false}const t=this.editor.model;const i=t.document;const n=i.selection;const o=t.schema.getLimitElement(n);const r=n.isCollapsed&&n.containsEntireContent(o);if(!r){return false}if(!t.schema.checkChild(o,"paragraph")){return false}const s=o.getChild(0);if(s&&s.name==="paragraph"){return false}return true}_replaceEntireContentWithParagraph(e){const t=this.editor.model;const i=t.document;const n=i.selection;const o=t.schema.getLimitElement(n);const r=e.createElement("paragraph");e.remove(e.createRangeIn(o));e.insert(r,o);e.setSelection(r,0)}}class j_ extends Zd{constructor(e){super(e);const t=e.document;let i=0;t.on("keyup",(e,t)=>{if(t.keyCode==zl.delete||t.keyCode==zl.backspace){i=0}});t.on("keydown",(e,t)=>{const o={};if(t.keyCode==zl.delete){o.direction="forward";o.unit="character"}else if(t.keyCode==zl.backspace){o.direction="backward";o.unit="codePoint"}else{return}const r=Cl.isMac?t.altKey:t.ctrlKey;o.unit=r?"word":o.unit;o.sequence=++i;n(e,t.domEvent,o)});if(Cl.isAndroid){t.on("beforeinput",(t,i)=>{if(i.domEvent.inputType!="deleteContentBackward"){return}const o={unit:"codepoint",direction:"backward",sequence:1};const r=i.domTarget.ownerDocument.defaultView.getSelection();if(r.anchorNode==r.focusNode&&r.anchorOffset+1!=r.focusOffset){o.selectionToRemove=e.domConverter.domSelectionToView(r)}n(t,i.domEvent,o)})}function n(e,i,n){let o;t.once("delete",e=>o=e,{priority:Number.POSITIVE_INFINITY});t.fire("delete",new Xu(t,i,n));if(o&&o.stop.called){e.stop()}}}observe(){}}class B_ extends tk{static get pluginName(){return"Delete"}init(){const e=this.editor;const t=e.editing.view;const i=t.document;t.addObserver(j_);e.commands.add("forwardDelete",new V_(e,"forward"));e.commands.add("delete",new V_(e,"backward"));this.listenTo(i,"delete",(i,n)=>{const o={unit:n.unit,sequence:n.sequence};if(n.selectionToRemove){const t=e.model.createSelection();const i=[];for(const t of n.selectionToRemove.getRanges()){i.push(e.editing.mapper.toModelRange(t))}t.setTo(i);o.selection=t}e.execute(n.direction=="forward"?"forwardDelete":"delete",o);n.preventDefault();t.scrollToTheSelection()});if(Cl.isAndroid){let e=null;this.listenTo(i,"delete",(t,i)=>{const n=i.domTarget.ownerDocument.defaultView.getSelection();e={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}},{priority:"lowest"});this.listenTo(i,"keyup",(t,i)=>{if(e){const t=i.domTarget.ownerDocument.defaultView.getSelection();t.collapse(e.anchorNode,e.anchorOffset);t.extend(e.focusNode,e.focusOffset);e=null}})}}}class F_ extends tk{static get requires(){return[D_,B_]}static get pluginName(){return"Typing"}}const H_=new Map;function U_(e,t,i){let n=H_.get(e);if(!n){n=new Map;H_.set(e,n)}n.set(t,i)}function W_(e,t){const i=H_.get(e);if(i&&i.has(t)){return i.get(t)}return q_}function q_(e){return[e]}function $_(e,t,i={}){const n=W_(e.constructor,t.constructor);try{e=e.clone();return n(e,t,i)}catch(e){throw e}}function Y_(e,t,i){e=e.slice();t=t.slice();const n=new G_(i.document,i.useRelations,i.forceWeakRemove);n.setOriginalOperations(e);n.setOriginalOperations(t);const o=n.originalOperations;if(e.length==0||t.length==0){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;while(a{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){const n=e.range.getDifference(t.range).map(t=>new mg(t,e.key,e.oldValue,e.newValue,0));const o=e.range.getIntersection(t.range);if(o){if(i.aIsStrong){n.push(new mg(o,t.key,t.newValue,e.newValue,0))}}if(n.length==0){return[new qg(0)]}return n}else{return[e]}});U_(mg,bg,(e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const i=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes);const n=i.map(t=>new mg(t,e.key,e.oldValue,e.newValue,e.baseVersion));if(t.shouldReceiveAttributes){const i=J_(t,e.key,e.oldValue);if(i){n.unshift(i)}}return n}e.range=e.range._getTransformedByInsertion(t.position,t.howMany,false)[0];return[e]});function J_(e,t,i){const n=e.nodes;const o=n.getNode(0).getAttribute(t);if(o==i){return null}const r=new ef(e.position,e.position.getShiftedBy(e.howMany));return new mg(r,t,o,i,0)}U_(mg,vg,(e,t)=>{const i=[];if(e.range.start.hasSameParentAs(t.deletionPosition)){if(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition)){i.push(ef._createFromPositionAndShift(t.graveyardPosition,1))}}const n=e.range._getTransformedByMergeOperation(t);if(!n.isCollapsed){i.push(n)}return i.map(t=>new mg(t,e.key,e.oldValue,e.newValue,e.baseVersion))});U_(mg,pg,(e,t)=>{const i=Z_(e.range,t);return i.map(t=>new mg(t,e.key,e.oldValue,e.newValue,e.baseVersion))});function Z_(e,t){const i=ef._createFromPositionAndShift(t.sourcePosition,t.howMany);let n=null;let o=[];if(i.containsRange(e,true)){n=e}else if(e.start.hasSameParentAs(i.start)){o=e.getDifference(i);n=e.getIntersection(i)}else{o=[e]}const r=[];for(let e of o){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const i=t.getMovedRangeStart();const n=e.start.hasSameParentAs(i);e=e._getTransformedByInsertion(i,t.howMany,n);r.push(...e)}if(n){r.push(n._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,false)[0])}return r}U_(mg,yg,(e,t)=>{if(e.range.end.isEqual(t.insertionPosition)){if(!t.graveyardPosition){e.range.end.offset++}return[e]}if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const i=e.clone();i.range=new ef(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition));e.range.end=t.splitPosition.clone();e.range.end.stickiness="toPrevious";return[e,i]}e.range=e.range._getTransformedBySplitOperation(t);return[e]});U_(bg,mg,(e,t)=>{const i=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const n=J_(e,t.key,t.newValue);if(n){i.push(n)}}return i});U_(bg,bg,(e,t,i)=>{if(e.position.isEqual(t.position)&&i.aIsStrong){return[e]}e.position=e.position._getTransformedByInsertOperation(t);return[e]});U_(bg,pg,(e,t)=>{e.position=e.position._getTransformedByMoveOperation(t);return[e]});U_(bg,yg,(e,t)=>{e.position=e.position._getTransformedBySplitOperation(t);return[e]});U_(bg,vg,(e,t)=>{e.position=e.position._getTransformedByMergeOperation(t);return[e]});U_(wg,bg,(e,t)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]}if(e.newRange){e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]}return[e]});U_(wg,wg,(e,t,i)=>{if(e.name==t.name){if(i.aIsStrong){e.oldRange=t.newRange?t.newRange.clone():null}else{return[new qg(0)]}}return[e]});U_(wg,vg,(e,t)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedByMergeOperation(t)}if(e.newRange){e.newRange=e.newRange._getTransformedByMergeOperation(t)}return[e]});U_(wg,pg,(e,t,i)=>{if(e.oldRange){e.oldRange=ef._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))}if(e.newRange){if(i.abRelation){const n=ef._createFromRanges(e.newRange._getTransformedByMoveOperation(t));if(i.abRelation.side=="left"&&t.targetPosition.isEqual(e.newRange.start)){e.newRange.start.path=i.abRelation.path;e.newRange.end=n.end;return[e]}else if(i.abRelation.side=="right"&&t.targetPosition.isEqual(e.newRange.end)){e.newRange.start=n.start;e.newRange.end.path=i.abRelation.path;return[e]}}e.newRange=ef._createFromRanges(e.newRange._getTransformedByMoveOperation(t))}return[e]});U_(wg,yg,(e,t,i)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedBySplitOperation(t)}if(e.newRange){if(i.abRelation){const n=e.newRange._getTransformedBySplitOperation(t);if(e.newRange.start.isEqual(t.splitPosition)&&i.abRelation.wasStartBeforeMergedElement){e.newRange.start=Qh._createAt(t.insertionPosition)}else if(e.newRange.start.isEqual(t.splitPosition)&&!i.abRelation.wasInLeftElement){e.newRange.start=Qh._createAt(t.moveTargetPosition)}if(e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasInRightElement){e.newRange.end=Qh._createAt(t.moveTargetPosition)}else if(e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasEndBeforeMergedElement){e.newRange.end=Qh._createAt(t.insertionPosition)}else{e.newRange.end=n.end}return[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]});U_(vg,bg,(e,t)=>{if(e.sourcePosition.hasSameParentAs(t.position)){e.howMany+=t.howMany}e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t);e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t);return[e]});U_(vg,vg,(e,t,i)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(!i.bWasUndone){return[new qg(0)]}else{const i=t.graveyardPosition.path.slice();i.push(0);e.sourcePosition=new Qh(t.graveyardPosition.root,i);e.howMany=0;return[e]}}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!i.bWasUndone&&i.abRelation!="splitAtSource"){const n=e.targetPosition.root.rootName=="$graveyard";const o=t.targetPosition.root.rootName=="$graveyard";const r=n&&!o;const s=o&&!n;const a=s||!r&&i.aIsStrong;if(a){const i=t.targetPosition._getTransformedByMergeOperation(t);const n=e.targetPosition._getTransformedByMergeOperation(t);return[new pg(i,e.howMany,n,0)]}else{return[new qg(0)]}}if(e.sourcePosition.hasSameParentAs(t.targetPosition)){e.howMany+=t.howMany}e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t);e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);if(!e.graveyardPosition.isEqual(t.graveyardPosition)||!i.aIsStrong){e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)}return[e]});U_(vg,pg,(e,t,i)=>{const n=ef._createFromPositionAndShift(t.sourcePosition,t.howMany);if(t.type=="remove"&&!i.bWasUndone&&!i.forceWeakRemove){if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.sourcePosition)){return[new qg(0)]}}if(e.sourcePosition.hasSameParentAs(t.targetPosition)){e.howMany+=t.howMany}if(e.sourcePosition.hasSameParentAs(t.sourcePosition)){e.howMany-=t.howMany}e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t);e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t);if(!e.graveyardPosition.isEqual(t.targetPosition)){e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}return[e]});U_(vg,yg,(e,t,i)=>{if(t.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1);if(e.deletionPosition.isEqual(t.graveyardPosition)){e.howMany=t.howMany}}if(e.targetPosition.isEqual(t.splitPosition)){const n=t.howMany!=0;const o=t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition);if(n||o||i.abRelation=="mergeTargetNotMoved"){e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t);return[e]}}if(e.sourcePosition.isEqual(t.splitPosition)){if(i.abRelation=="mergeSourceNotMoved"){e.howMany=0;e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t);return[e]}if(i.abRelation=="mergeSameElement"||e.sourcePosition.offset>0){e.sourcePosition=t.moveTargetPosition.clone();e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t);return[e]}}if(e.sourcePosition.hasSameParentAs(t.splitPosition)){e.howMany=t.splitPosition.offset}e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t);e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t);return[e]});U_(pg,bg,(e,t)=>{const i=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);const n=i._getTransformedByInsertOperation(t,false)[0];e.sourcePosition=n.start;e.howMany=n.end.offset-n.start.offset;if(!e.targetPosition.isEqual(t.position)){e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)}return[e]});U_(pg,pg,(e,t,i)=>{const n=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);const o=ef._createFromPositionAndShift(t.sourcePosition,t.howMany);let r=i.aIsStrong;let s=!i.aIsStrong;if(i.abRelation=="insertBefore"||i.baRelation=="insertAfter"){s=true}else if(i.abRelation=="insertAfter"||i.baRelation=="insertBefore"){s=false}let a;if(e.targetPosition.isEqual(t.targetPosition)&&s){a=e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany)}else{a=e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}if(X_(e,t)&&X_(t,e)){return[t.getReversed()]}const c=n.containsPosition(t.targetPosition);if(c&&n.containsRange(o,true)){n.start=n.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);n.end=n.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);return ev([n],a)}const l=o.containsPosition(e.targetPosition);if(l&&o.containsRange(n,true)){n.start=n.start._getCombined(t.sourcePosition,t.getMovedRangeStart());n.end=n.end._getCombined(t.sourcePosition,t.getMovedRangeStart());return ev([n],a)}const d=Rs(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if(d=="prefix"||d=="extension"){n.start=n.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);n.end=n.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);return ev([n],a)}if(e.type=="remove"&&t.type!="remove"&&!i.aWasUndone&&!i.forceWeakRemove){r=true}else if(e.type!="remove"&&t.type=="remove"&&!i.bWasUndone&&!i.forceWeakRemove){r=false}const u=[];const h=n.getDifference(o);for(const e of h){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany);e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const i=Rs(e.start.getParentPath(),t.getMovedRangeStart().getParentPath())=="same";const n=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,i);u.push(...n)}const f=n.getIntersection(o);if(f!==null&&r){f.start=f.start._getCombined(t.sourcePosition,t.getMovedRangeStart());f.end=f.end._getCombined(t.sourcePosition,t.getMovedRangeStart());if(u.length===0){u.push(f)}else if(u.length==1){if(o.start.isBefore(n.start)||o.start.isEqual(n.start)){u.unshift(f)}else{u.push(f)}}else{u.splice(1,0,f)}}if(u.length===0){return[new qg(e.baseVersion)]}return ev(u,a)});U_(pg,yg,(e,t,i)=>{let n=e.targetPosition.clone();if(!e.targetPosition.isEqual(t.insertionPosition)||!t.graveyardPosition||i.abRelation=="moveTargetAfter"){n=e.targetPosition._getTransformedBySplitOperation(t)}const o=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);if(o.end.isEqual(t.insertionPosition)){if(!t.graveyardPosition){e.howMany++}e.targetPosition=n;return[e]}if(o.start.hasSameParentAs(t.splitPosition)&&o.containsPosition(t.splitPosition)){let e=new ef(t.splitPosition,o.end);e=e._getTransformedBySplitOperation(t);const i=[new ef(o.start,t.splitPosition),e];return ev(i,n)}if(e.targetPosition.isEqual(t.splitPosition)&&i.abRelation=="insertAtSource"){n=t.moveTargetPosition}if(e.targetPosition.isEqual(t.insertionPosition)&&i.abRelation=="insertBetween"){n=e.targetPosition}const r=o._getTransformedBySplitOperation(t);const s=[r];if(t.graveyardPosition){const n=o.start.isEqual(t.graveyardPosition)||o.containsPosition(t.graveyardPosition);if(e.howMany>1&&n&&!i.aWasUndone){s.push(ef._createFromPositionAndShift(t.insertionPosition,1))}}return ev(s,n)});U_(pg,vg,(e,t,i)=>{const n=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(t.sourcePosition)){if(e.type=="remove"&&!i.forceWeakRemove){if(!i.aWasUndone){const i=[];let n=t.graveyardPosition.clone();let o=t.targetPosition._getTransformedByMergeOperation(t);if(e.howMany>1){i.push(new pg(e.sourcePosition,e.howMany-1,e.targetPosition,0));n=n._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);const s=new pg(n,1,r,0);const a=s.getMovedRangeStart().path.slice();a.push(0);const c=new Qh(s.targetPosition.root,a);o=o._getTransformedByMove(n,r,1);const l=new pg(o,t.howMany,c,0);i.push(s);i.push(l);return i}}else{if(e.howMany==1){if(!i.bWasUndone){return[new qg(0)]}else{e.sourcePosition=t.graveyardPosition.clone();e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);return[e]}}}}const o=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);const r=o._getTransformedByMergeOperation(t);e.sourcePosition=r.start;e.howMany=r.end.offset-r.start.offset;e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);return[e]});U_(kg,bg,(e,t)=>{e.position=e.position._getTransformedByInsertOperation(t);return[e]});U_(kg,vg,(e,t)=>{if(e.position.isEqual(t.deletionPosition)){e.position=t.graveyardPosition.clone();e.position.stickiness="toNext";return[e]}e.position=e.position._getTransformedByMergeOperation(t);return[e]});U_(kg,pg,(e,t)=>{e.position=e.position._getTransformedByMoveOperation(t);return[e]});U_(kg,kg,(e,t,i)=>{if(e.position.isEqual(t.position)){if(i.aIsStrong){e.oldName=t.newName}else{return[new qg(0)]}}return[e]});U_(kg,yg,(e,t)=>{const i=e.position.path;const n=t.splitPosition.getParentPath();if(Rs(i,n)=="same"&&!t.graveyardPosition){const t=new kg(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}e.position=e.position._getTransformedBySplitOperation(t);return[e]});U_(_g,_g,(e,t,i)=>{if(e.root===t.root&&e.key===t.key){if(!i.aIsStrong||e.newValue===t.newValue){return[new qg(0)]}else{e.oldValue=t.newValue}}return[e]});U_(yg,bg,(e,t)=>{if(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!i.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const i=t.graveyardPosition.path.slice();i.push(0);const n=new Qh(t.graveyardPosition.root,i);const o=yg.getInsertionPosition(new Qh(t.graveyardPosition.root,i));const r=new yg(n,0,null,0);r.insertionPosition=o;e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t);e.insertionPosition=yg.getInsertionPosition(e.splitPosition);e.graveyardPosition=r.insertionPosition.clone();e.graveyardPosition.stickiness="toNext";return[r,e]}if(e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)){e.howMany--}if(e.splitPosition.hasSameParentAs(t.targetPosition)){e.howMany+=t.howMany}e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t);e.insertionPosition=yg.getInsertionPosition(e.splitPosition);if(e.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)}return[e]});U_(yg,pg,(e,t,i)=>{const n=ef._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const o=n.start.isEqual(e.graveyardPosition)||n.containsPosition(e.graveyardPosition);if(!i.bWasUndone&&o){const i=e.splitPosition._getTransformedByMoveOperation(t);const n=e.graveyardPosition._getTransformedByMoveOperation(t);const o=n.path.slice();o.push(0);const r=new Qh(n.root,o);const s=new pg(i,e.howMany,r,0);return[s]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.splitPosition)){const i=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);e.howMany-=i;if(e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition){return[new qg(0)]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){return[new qg(0)]}if(i.abRelation=="splitBefore"){e.howMany=0;e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t);return[e]}}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const n=e.splitPosition.root.rootName=="$graveyard";const o=t.splitPosition.root.rootName=="$graveyard";const r=n&&!o;const s=o&&!n;const a=s||!r&&i.aIsStrong;if(a){const i=[];if(t.howMany){i.push(new pg(t.moveTargetPosition,t.howMany,t.splitPosition,0))}if(e.howMany){i.push(new pg(e.splitPosition,e.howMany,e.moveTargetPosition,0))}return i}else{return[new qg(0)]}}if(e.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)}if(e.splitPosition.isEqual(t.insertionPosition)&&i.abRelation=="splitBefore"){e.howMany++;return[e]}if(t.splitPosition.isEqual(e.insertionPosition)&&i.baRelation=="splitBefore"){const i=t.insertionPosition.path.slice();i.push(0);const n=new Qh(t.insertionPosition.root,i);const o=new pg(e.insertionPosition,1,n,0);return[e,o]}if(e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offsetthis.clearStack())}refresh(){this.isEnabled=this._stack.length>0}addBatch(e){const t=this.editor.model.document.selection;const i={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:i});this.refresh()}clearStack(){this._stack=[];this.refresh()}_restoreSelection(e,t,i){const n=this.editor.model;const o=n.document;const r=[];const s=e.map(e=>e.getTransformedByOperations(i));const a=s.flat();for(const e of s){const t=e.filter(e=>!nv(e,a));iv(t);const i=t.find(e=>e.root!=o.graveyard);if(i){r.push(i)}}if(r.length){n.change(e=>{e.setSelection(r,{backward:t})})}}_undo(e,t){const i=this.editor.model;const n=i.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;const r=Array.from(n.history.getOperations(o));const s=Y_([e.getReversed()],r,{useRelations:true,document:this.editor.model.document,padWithNoOps:false,forceWeakRemove:true});const a=s.operationsA;for(const o of a){t.addOperation(o);i.applyOperation(o);n.history.setOperationAsUndone(e,o)}}}}function iv(e){e.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let t=1;tt!==e&&t.containsRange(e,true))}class ov extends tv{execute(e=null){const t=e?this._stack.findIndex(t=>t.batch==e):this._stack.length-1;const i=this._stack.splice(t,1)[0];const n=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(n,()=>{this._undo(i.batch,n);const e=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,e);this.fire("revert",i.batch,n)});this.refresh()}}class rv extends tv{execute(){const e=this._stack.pop();const t=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(t,()=>{const i=e.batch.operations[e.batch.operations.length-1];const n=i.baseVersion+1;const o=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,o);this._undo(e.batch,t)});this.refresh()}}class sv extends tk{static get pluginName(){return"UndoEditing"}constructor(e){super(e);this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new ov(e);this._redoCommand=new rv(e);e.commands.add("undo",this._undoCommand);e.commands.add("redo",this._redoCommand);this.listenTo(e.model,"applyOperation",(e,t)=>{const i=t[0];if(!i.isDocumentOperation){return}const n=i.batch;const o=this._redoCommand._createdBatches.has(n);const r=this._undoCommand._createdBatches.has(n);const s=this._batchRegistry.has(n);if(s||n.type=="transparent"&&!o&&!r){return}else{if(o){this._undoCommand.addBatch(n)}else if(!r){this._undoCommand.addBatch(n);this._redoCommand.clearStack()}}this._batchRegistry.add(n)},{priority:"highest"});this.listenTo(this._undoCommand,"revert",(e,t,i)=>{this._redoCommand.addBatch(i)});e.keystrokes.set("CTRL+Z","undo");e.keystrokes.set("CTRL+Y","redo");e.keystrokes.set("CTRL+SHIFT+Z","redo")}}var av='';var cv='';class lv extends tk{init(){const e=this.editor;const t=e.locale;const i=e.t;const n=t.uiLanguageDirection=="ltr"?av:cv;const o=t.uiLanguageDirection=="ltr"?cv:av;this._addButton("undo",i("Undo"),"CTRL+Z",n);this._addButton("redo",i("Redo"),"CTRL+Y",o)}_addButton(e,t,i,n){const o=this.editor;o.ui.componentFactory.add(e,r=>{const s=o.commands.get(e);const a=new Tw(r);a.set({label:t,icon:n,keystroke:i,tooltip:true});a.bind("isEnabled").to(s,"isEnabled");this.listenTo(a,"execute",()=>{o.execute(e);o.editing.view.focus()});return a})}}class dv extends tk{static get requires(){return[sv,lv]}static get pluginName(){return"Undo"}}class uv extends tk{static get requires(){return[n_,l_,y_,g_,F_,dv]}static get pluginName(){return"Essentials"}}class hv extends nk{constructor(e,t){super(e);this.attributeKey=t}refresh(){const e=this.editor.model;const 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;const i=t.document;const n=i.selection;const o=e.value;t.change(e=>{if(n.isCollapsed){if(o){e.setSelectionAttribute(this.attributeKey,o)}else{e.removeSelectionAttribute(this.attributeKey)}}else{const i=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of i){if(o){e.setAttribute(this.attributeKey,o,t)}else{e.removeAttribute(this.attributeKey,t)}}}})}}var fv='';class mv extends Tw{constructor(e){super(e);const t=this.bindTemplate;this.set("color");this.set("hasBorder");this.icon=fv;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%)"}}var gv=i(45);class pv extends jb{constructor(e,t){super(e);const i=t&&t.colorDefinitions||[];const n={};if(t&&t.columns){n.gridTemplateColumns=`repeat( ${t.columns}, 1fr)`}this.set("selectedColor");this.items=this.createCollection();this.focusTracker=new Yp;this.keystrokes=new zp;this._focusCycler=new iw({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});i.forEach(e=>{const t=new mv;t.set({color:e.color,label:e.label,tooltip:true,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:n}});this.on("change:selectedColor",(e,t,i)=>{for(const e of this.items){e.isOn=e.color===i}})}focus(){if(this.items.length){this.items.first.focus()}}focusLast(){if(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 bv extends xs{constructor(e){super(e);this.set("isEmpty",true);this.on("change",()=>{this.set("isEmpty",this.length===0)})}add(e,t){if(this.find(t=>t.color===e.color)){return}super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}}ys(bv,Qc);var wv='';var kv=i(47);class _v extends jb{constructor(e,{colors:t,columns:i,removeButtonLabel:n,documentColorsLabel:o,documentColorsCount:r}){super(e);this.items=this.createCollection();this.colorDefinitions=t;this.focusTracker=new Yp;this.keystrokes=new zp;this.set("selectedColor");this.removeButtonLabel=n;this.columns=i;this.documentColors=new bv;this.documentColorsCount=r;this._focusCycler=new iw({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 i=e.document;const n=this.documentColorsCount;this.documentColors.clear();for(const o of i.getRootNames()){const r=i.getRoot(o);const s=e.createRangeIn(r);for(const e of s.getItems()){if(e.is("$textProxy")&&e.hasAttribute(t)){this._addColorToDocumentColors(e.getAttribute(t));if(this.documentColors.length>=n){return}}}}}updateSelectedColors(){const e=this.documentColorsGrid;const t=this.staticColorsGrid;const i=this.selectedColor;t.selectedColor=i;if(e){e.selectedColor=i}}render(){super.render();for(const e of this.items){this.focusTracker.add(e.element)}this.keystrokes.listenTo(this.element)}appendGrids(){if(this.staticColorsGrid){return}this.staticColorsGrid=this._createStaticColorsGrid();this.items.add(this.staticColorsGrid);if(this.documentColorsCount){const e=hb.bind(this.documentColors,this.documentColors);const t=new Gb(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 Tw;e.set({withText:true,icon:wv,tooltip:true,label:this.removeButtonLabel});e.class="ck-color-table__remove-color";e.on("execute",()=>{this.fire("execute",{value:null})});return e}_createStaticColorsGrid(){const e=new pv(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});e.delegate("execute").to(this);return e}_createDocumentColorsGrid(){const e=hb.bind(this.documentColors,this.documentColors);const t=new pv(this.locale,{columns:this.columns});t.delegate("execute").to(this);t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}});t.items.bindTo(this.documentColors).using(e=>{const t=new mv;t.set({color:e.color,hasBorder:e.options&&e.options.hasBorder});if(e.label){t.set({label:e.label,tooltip:true})}t.on("execute",()=>{this.fire("execute",{value:e.color})});return t});this.documentColors.on("change:isEmpty",(e,i,n)=>{if(n){t.selectedColor=null}});return t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find(t=>t.color===e);if(!t){this.documentColors.add({color:e,label:e,options:{hasBorder:false}})}else{this.documentColors.add(Object.assign({},t))}}}const vv="fontSize";const yv="fontFamily";const xv="fontColor";const Av="fontBackgroundColor";function Tv(e,t){const i={model:{key:e,values:[]},view:{},upcastAlso:{}};for(const e of t){i.model.values.push(e.model);i.view[e.model]=e.view;if(e.upcastAlso){i.upcastAlso[e.model]=e.upcastAlso}}return i}function Cv(e){return t=>Sv(t.getStyle(e))}function Pv(e){return(t,i)=>i.createAttributeElement("span",{style:`${e}:${t}`},{priority:7})}function Ev({dropdownView:e,colors:t,columns:i,removeButtonLabel:n,documentColorsLabel:o,documentColorsCount:r}){const s=e.locale;const a=new _v(s,{colors:t,columns:i,removeButtonLabel:n,documentColorsLabel:o,documentColorsCount:r});e.colorTableView=a;e.panelView.children.add(a);a.delegate("execute").to(e,"execute");return a}function Sv(e){return e.replace(/\s/g,"")}class Mv extends hv{constructor(e){super(e,Av)}}const Iv=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;const Nv=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i;const Ov=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i;const zv=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i;const Rv=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i;const Lv=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 Dv(e){if(e.startsWith("#")){return Iv.test(e)}if(e.startsWith("rgb")){return Nv.test(e)||Ov.test(e)}if(e.startsWith("hsl")){return zv.test(e)||Rv.test(e)}return Lv.has(e.toLowerCase())}const Vv=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"];function jv(e){return Vv.includes(e)}const Bv=/^([+-]?[0-9]*[.]?[0-9]+(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;function Fv(e){return Bv.test(e)}const Hv=/^[+-]?[0-9]*[.]?[0-9]+%$/;function Uv(e){return Hv.test(e)}const Wv=["repeat-x","repeat-y","repeat","space","round","no-repeat"];function qv(e){return Wv.includes(e)}const $v=["center","top","bottom","left","right"];function Yv(e){return $v.includes(e)}const Gv=["fixed","scroll","local"];function Kv(e){return Gv.includes(e)}const Qv=/^url\(/;function Jv(e){return Qv.test(e)}function Zv(e=""){if(e===""){return{top:undefined,right:undefined,bottom:undefined,left:undefined}}const t=iy(e);const i=t[0];const n=t[2]||i;const o=t[1]||i;const r=t[3]||o;return{top:i,bottom:n,right:o,left:r}}function Xv(e){return t=>{const{top:i,right:n,bottom:o,left:r}=t;const s=[];if(![i,n,r,o].every(e=>!!e)){if(i){s.push([e+"-top",i])}if(n){s.push([e+"-right",n])}if(o){s.push([e+"-bottom",o])}if(r){s.push([e+"-left",r])}}else{s.push([e,ey(t)])}return s}}function ey({top:e,right:t,bottom:i,left:n}){const o=[];if(n!==t){o.push(e,t,i,n)}else if(i!==e){o.push(e,t,i)}else if(t!==e){o.push(e,t)}else{o.push(e)}return o.join(" ")}function ty(e){return t=>({path:e,value:Zv(t)})}function iy(e){return e.replace(/, /g,",").split(" ").map(e=>e.replace(/,/g,", "))}function ny(e){e.setNormalizer("background",oy);e.setNormalizer("background-color",e=>({path:"background.color",value:e}));e.setReducer("background",e=>{const t=[];t.push(["background-color",e.color]);return t})}function oy(e){const t={};const i=iy(e);for(const e of i){if(qv(e)){t.repeat=t.repeat||[];t.repeat.push(e)}else if(Yv(e)){t.position=t.position||[];t.position.push(e)}else if(Kv(e)){t.attachment=e}else if(Dv(e)){t.color=e}else if(Jv(e)){t.image=e}}return{path:"background",value:t}}class ry extends tk{static get pluginName(){return"FontBackgroundColorEditing"}constructor(e){super(e);e.config.define(Av,{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:true},{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(ny);e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:Av,value:Cv("background-color")}});e.conversion.for("downcast").attributeToElement({model:Av,view:Pv("background-color")});e.commands.add(Av,new Mv(e));e.model.schema.extend("$text",{allowAttributes:Av});e.model.schema.setAttributeProperties(Av,{isFormatting:true,copyOnEnter:true})}}function sy(e,t){const i=e.t;const n={Black:i("Black"),"Dim grey":i("Dim grey"),Grey:i("Grey"),"Light grey":i("Light grey"),White:i("White"),Red:i("Red"),Orange:i("Orange"),Yellow:i("Yellow"),"Light green":i("Light green"),Green:i("Green"),Aquamarine:i("Aquamarine"),Turquoise:i("Turquoise"),"Light blue":i("Light blue"),Blue:i("Blue"),Purple:i("Purple")};return t.map(e=>{const t=n[e.label];if(t&&t!=e.label){e.label=t}return e})}function ay(e){return e.map(cy).filter(e=>!!e)}function cy(e){if(typeof e==="string"){return{model:e,label:e,hasBorder:false,view:{name:"span",styles:{color:e}}}}else{return{model:e.color,label:e.label||e.color,hasBorder:e.hasBorder===undefined?false:e.hasBorder,view:{name:"span",styles:{color:`${e.color}`}}}}}class ly extends tk{constructor(e,{commandName:t,icon:i,componentName:n,dropdownLabel:o}){super(e);this.commandName=t;this.componentName=n;this.icon=i;this.dropdownLabel=o;this.columns=e.config.get(`${this.componentName}.columns`);this.colorTableView}init(){const e=this.editor;const t=e.locale;const i=t.t;const n=e.commands.get(this.commandName);const o=ay(e.config.get(this.componentName).colors);const r=sy(t,o);const s=e.config.get(`${this.componentName}.documentColors`);e.ui.componentFactory.add(this.componentName,t=>{const o=Dw(t);this.colorTableView=Ev({dropdownView:o,colors:r.map(e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}})),columns:this.columns,removeButtonLabel:i("Remove color"),documentColorsLabel:s!==0?i("Document colors"):undefined,documentColorsCount:s===undefined?this.columns:s});this.colorTableView.bind("selectedColor").to(n,"value");o.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:true});o.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}});o.bind("isEnabled").to(n);o.on("execute",(t,i)=>{e.execute(this.commandName,i);e.editing.view.focus()});o.on("change:isOpen",(t,i,n)=>{o.colorTableView.appendGrids();if(n){if(s!==0){this.colorTableView.updateDocumentColors(e.model,this.componentName)}this.colorTableView.updateSelectedColors()}});return o})}}var dy='';class uy extends ly{constructor(e){const t=e.locale.t;super(e,{commandName:Av,componentName:Av,icon:dy,dropdownLabel:t("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class hy extends tk{static get requires(){return[ry,uy]}static get pluginName(){return"FontBackgroundColor"}}class fy extends hv{constructor(e){super(e,xv)}}class my extends tk{static get pluginName(){return"FontColorEditing"}constructor(e){super(e);e.config.define(xv,{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:true},{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:xv,value:Cv("color")}});e.conversion.for("downcast").attributeToElement({model:xv,view:Pv("color")});e.commands.add(xv,new fy(e));e.model.schema.extend("$text",{allowAttributes:xv});e.model.schema.setAttributeProperties(xv,{isFormatting:true,copyOnEnter:true})}}var gy='';class py extends ly{constructor(e){const t=e.locale.t;super(e,{commandName:xv,componentName:xv,icon:gy,dropdownLabel:t("Font Color")})}static get pluginName(){return"FontColorUI"}}class by extends tk{static get requires(){return[my,py]}static get pluginName(){return"FontColor"}}class wy extends hv{constructor(e){super(e,yv)}}function ky(e){return e.map(_y).filter(e=>!!e)}function _y(e){if(typeof e==="object"){return e}if(e==="default"){return{title:"Default",model:undefined}}if(typeof e!=="string"){return}return vy(e)}function vy(e){const t=e.replace(/"|'/g,"").split(",");const i=t[0];const n=t.map(yy).join(", ");return{title:i,model:n,view:{name:"span",styles:{"font-family":n},priority:7}}}function yy(e){e=e.trim();if(e.indexOf(" ")>0){e=`'${e}'`}return e}class xy extends tk{static get pluginName(){return"FontFamilyEditing"}constructor(e){super(e);e.config.define(yv,{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:false})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:yv});e.model.schema.setAttributeProperties(yv,{isFormatting:true,copyOnEnter:true});const t=ky(e.config.get("fontFamily.options")).filter(e=>e.model);const i=Tv(yv,t);if(e.config.get("fontFamily.supportAllValues")){this._prepareAnyValueConverters()}else{e.conversion.attributeToElement(i)}e.commands.add(yv,new wy(e))}_prepareAnyValueConverters(){const e=this.editor;e.conversion.for("downcast").attributeToElement({model:yv,view:(e,t)=>t.createAttributeElement("span",{style:"font-family:"+e},{priority:7})});e.conversion.for("upcast").attributeToAttribute({model:{key:yv,value:e=>e.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}}class Ay{constructor(e,t){if(t){qc(this,t)}if(e){this.set(e)}}}ys(Ay,Qc);var Ty='';class Cy extends tk{init(){const e=this.editor;const t=e.t;const i=this._getLocalizedOptions();const n=e.commands.get(yv);e.ui.componentFactory.add(yv,o=>{const r=Dw(o);jw(r,Py(i,n));r.buttonView.set({label:t("Font Family"),icon:Ty,tooltip:true});r.extendTemplate({attributes:{class:"ck-font-family-dropdown"}});r.bind("isEnabled").to(n);this.listenTo(r,"execute",t=>{e.execute(t.source.commandName,{value:t.source.commandParam});e.editing.view.focus()});return r})}_getLocalizedOptions(){const e=this.editor;const t=e.t;const i=ky(e.config.get(yv).options);return i.map(e=>{if(e.title==="Default"){e.title=t("Default")}return e})}}function Py(e,t){const i=new xs;for(const n of e){const e={type:"button",model:new Ay({commandName:yv,commandParam:n.model,label:n.title,withText:true})};e.model.bind("isOn").to(t,"value",e=>{if(e===n.model){return true}if(!e||!n.model){return false}return e.split(",")[0].replace(/'/g,"").toLowerCase()===n.model.toLowerCase()});if(n.view&&n.view.styles){e.model.set("labelStyle",`font-family: ${n.view.styles["font-family"]}`)}i.add(e)}return i}class Ey extends tk{static get requires(){return[xy,Cy]}static get pluginName(){return"FontFamily"}}class Sy extends hv{constructor(e){super(e,vv)}}function My(e){return e.map(e=>Ny(e)).filter(e=>!!e)}const Iy={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 Ny(e){if(Ly(e)){return zy(e)}const t=Ry(e);if(t){return zy(t)}if(e==="default"){return{model:undefined,title:"Default"}}if(Dy(e)){return}return Oy(e)}function Oy(e){if(typeof e==="number"||typeof e==="string"){e={title:String(e),model:`${parseFloat(e)}px`}}e.view={name:"span",styles:{"font-size":e.model}};return zy(e)}function zy(e){if(!e.view.priority){e.view.priority=7}return e}function Ry(e){return Iy[e]||Iy[e.model]}function Ly(e){return typeof e==="object"&&e.title&&e.model&&e.view}function Dy(e){let t;if(typeof e==="object"){if(!e.model){throw new ss["b"]("font-size-invalid-definition: Provided font size definition is invalid.",null,e)}else{t=parseFloat(e.model)}}else{t=parseFloat(e)}return isNaN(t)}class Vy extends tk{static get pluginName(){return"FontSizeEditing"}constructor(e){super(e);e.config.define(vv,{options:["tiny","small","default","big","huge"],supportAllValues:false})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:vv});e.model.schema.setAttributeProperties(vv,{isFormatting:true,copyOnEnter:true});const t=e.config.get("fontSize.supportAllValues");const i=My(this.editor.config.get("fontSize.options")).filter(e=>e.model);const n=Tv(vv,i);if(t){this._prepareAnyValueConverters(n)}else{e.conversion.attributeToElement(n)}e.commands.add(vv,new Sy(e))}_prepareAnyValueConverters(e){const t=this.editor;const i=e.model.values.filter(e=>!String(e).match(/[\d.]+[\w%]+/));if(i.length){throw new ss["b"]("font-size-invalid-use-of-named-presets: "+"If config.fontSize.supportAllValues is set to true, you need to use numerical values as font size options.",null,{presets:i})}t.conversion.for("downcast").attributeToElement({model:vv,view:(e,t)=>{if(!e){return}return t.createAttributeElement("span",{style:"font-size:"+e},{priority:7})}});t.conversion.for("upcast").attributeToAttribute({model:{key:vv,value:e=>e.getStyle("font-size")},view:{name:"span"}})}}var jy='';var By=i(49);class Fy extends tk{init(){const e=this.editor;const t=e.t;const i=this._getLocalizedOptions();const n=e.commands.get(vv);e.ui.componentFactory.add(vv,o=>{const r=Dw(o);jw(r,Hy(i,n));r.buttonView.set({label:t("Font Size"),icon:jy,tooltip:true});r.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}});r.bind("isEnabled").to(n);this.listenTo(r,"execute",t=>{e.execute(t.source.commandName,{value:t.source.commandParam});e.editing.view.focus()});return r})}_getLocalizedOptions(){const e=this.editor;const t=e.t;const i={Default:t("Default"),Tiny:t("Tiny"),Small:t("Small"),Big:t("Big"),Huge:t("Huge")};const n=My(e.config.get(vv).options);return n.map(e=>{const t=i[e.title];if(t&&t!=e.title){e=Object.assign({},e,{title:t})}return e})}}function Hy(e,t){const i=new xs;for(const n of e){const e={type:"button",model:new Ay({commandName:vv,commandParam:n.model,label:n.title,class:"ck-fontsize-option",withText:true})};if(n.view&&n.view.styles){e.model.set("labelStyle",`font-size:${n.view.styles["font-size"]}`)}if(n.view&&n.view.classes){e.model.set("class",`${e.model.class} ${n.view.classes}`)}e.model.bind("isOn").to(t,"value",e=>e===n.model);i.add(e)}return i}class Uy extends tk{static get requires(){return[Vy,Fy]}static get pluginName(){return"FontSize"}}class Wy extends nk{refresh(){const e=this.editor.model;const t=e.document;const i=rk(t.selection.getSelectedBlocks());this.value=!!i&&i.is("element","paragraph");this.isEnabled=!!i&&qy(i,e.schema)}execute(e={}){const t=this.editor.model;const i=t.document;t.change(n=>{const o=(e.selection||i.selection).getSelectedBlocks();for(const e of o){if(!e.is("element","paragraph")&&qy(e,t.schema)){n.rename(e,"paragraph")}}})}}function qy(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class $y extends nk{execute(e){const t=this.editor.model;let i=e.position;t.change(e=>{const n=e.createElement("paragraph");if(!t.schema.checkChild(i.parent,n)){const o=t.schema.findAllowedParent(i,n);if(!o){return}i=e.split(i,o).position}t.insertContent(n,i);e.setSelection(n,"in")})}}class Yy extends tk{static get pluginName(){return"Paragraph"}init(){const e=this.editor;const t=e.model;const i=e.data;e.commands.add("paragraph",new Wy(e));e.commands.add("insertParagraph",new $y(e));t.schema.register("paragraph",{inheritAllFrom:"$block"});e.conversion.elementToElement({model:"paragraph",view:"p"});e.conversion.for("upcast").elementToElement({model:(e,t)=>{if(!Yy.paragraphLikeElements.has(e.name)){return null}if(e.isEmpty){return null}return t.createElement("paragraph")},converterPriority:"low"});i.upcastDispatcher.on("element",(e,t,i)=>{if(!i.consumable.test(t.viewItem,{name:t.viewItem.name})){return}if(Ky(t.viewItem,t.modelCursor,i.schema)){Object.assign(t,Gy(t.viewItem,t.modelCursor,i))}},{priority:"low"});i.upcastDispatcher.on("text",(e,t,i)=>{if(t.modelRange){return}if(Ky(t.viewItem,t.modelCursor,i.schema)){Object.assign(t,Gy(t.viewItem,t.modelCursor,i))}},{priority:"lowest"});t.document.registerPostFixer(e=>this._autoparagraphEmptyRoots(e));e.data.on("ready",()=>{t.enqueueChange("transparent",e=>this._autoparagraphEmptyRoots(e))},{priority:"lowest"})}_autoparagraphEmptyRoots(e){const t=this.editor.model;for(const i of t.document.getRootNames()){const n=t.document.getRoot(i);if(n.isEmpty&&n.rootName!="$graveyard"){if(t.schema.checkChild(n,"paragraph")){e.insertElement("paragraph",n);return true}}}}}Yy.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td"]);function Gy(e,t,i){const n=i.writer.createElement("paragraph");i.writer.insert(n,t);return i.convertItem(e,i.writer.createPositionAt(n,0))}function Ky(e,t,i){const n=i.createContext(t);if(!i.checkChild(n,"paragraph")){return false}if(!i.checkChild(n.push("paragraph"),e)){return false}return true}class Qy extends nk{constructor(e,t){super(e);this.modelElements=t}refresh(){const e=rk(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name;this.isEnabled=!!e&&this.modelElements.some(t=>Jy(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model;const i=t.document;const n=e.value;t.change(e=>{const o=Array.from(i.selection.getSelectedBlocks()).filter(e=>Jy(e,n,t.schema));for(const t of o){if(!t.is("element",n)){e.rename(t,n)}}})}}function Jy(e,t,i){return i.checkChild(e.parent,t)&&!i.isObject(e)}const Zy="paragraph";class Xy extends tk{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[Yy]}init(){const e=this.editor;const t=e.config.get("heading.options");const i=[];for(const n of t){if(n.model!==Zy){e.model.schema.register(n.model,{inheritAllFrom:"$block"});e.conversion.elementToElement(n);i.push(n.model)}}this._addDefaultH1Conversion(e);e.commands.add("heading",new Qy(e,i))}afterInit(){const e=this.editor;const t=e.commands.get("enter");const i=e.config.get("heading.options");if(t){this.listenTo(t,"afterExecute",(t,n)=>{const o=e.model.document.selection.getFirstPosition().parent;const r=i.some(e=>o.is("element",e.model));if(r&&!o.is("element",Zy)&&o.childCount===0){n.writer.rename(o,Zy)}})}}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:os.get("low")+1})}}function ex(e){const t=e.t;const i={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=i[e.title];if(t&&t!=e.title){e.title=t}return e})}var tx=i(11);class ix extends tk{init(){const e=this.editor;const t=e.t;const i=ex(e);const n=t("Choose heading");const o=t("Heading");e.ui.componentFactory.add("heading",t=>{const r={};const s=new xs;const a=e.commands.get("heading");const c=e.commands.get("paragraph");const l=[a];for(const e of i){const t={type:"button",model:new Ay({label:e.title,class:e.class,withText:true})};if(e.model==="paragraph"){t.model.bind("isOn").to(c,"value");t.model.set("commandName","paragraph");l.push(c)}else{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=Dw(t);jw(d,s);d.buttonView.set({isOn:false,withText:true,tooltip:o});d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}});d.bind("isEnabled").toMany(l,"isEnabled",(...e)=>e.some(e=>e));d.buttonView.bind("label").to(a,"value",c,"value",(e,t)=>{const i=e||t&&"paragraph";return r[i]?r[i]:n});this.listenTo(d,"execute",t=>{e.execute(t.source.commandName,t.source.commandValue?{value:t.source.commandValue}:undefined);e.editing.view.focus()});return d})}}class nx extends tk{static get requires(){return[Xy,ix]}static get pluginName(){return"Heading"}}class ox extends nk{refresh(){const e=this.editor.model;const t=e.document;this.value=t.selection.getAttribute("highlight");this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"highlight")}execute(e={}){const t=this.editor.model;const i=t.document;const n=i.selection;const o=e.value;t.change(e=>{const i=t.schema.getValidRanges(n.getRanges(),"highlight");if(n.isCollapsed){const t=n.getFirstPosition();if(n.hasAttribute("highlight")){const i=e=>e.item.hasAttribute("highlight")&&e.item.getAttribute("highlight")===this.value;const n=t.getLastMatchingPosition(i,{direction:"backward"});const r=t.getLastMatchingPosition(i);const s=e.createRange(n,r);if(!o||this.value===o){e.removeAttribute("highlight",s);e.removeSelectionAttribute("highlight")}else{e.setAttribute("highlight",o,s);e.setSelectionAttribute("highlight",o)}}else if(o){e.setSelectionAttribute("highlight",o)}}else{for(const t of i){if(o){e.setAttribute("highlight",o,t)}else{e.removeAttribute("highlight",t)}}}})}}class rx extends tk{static get pluginName(){return"HighlightEditing"}constructor(e){super(e);e.config.define("highlight",{options:[{model:"yellowMarker",class:"marker-yellow",title:"Yellow marker",color:"var(--ck-highlight-marker-yellow)",type:"marker"},{model:"greenMarker",class:"marker-green",title:"Green marker",color:"var(--ck-highlight-marker-green)",type:"marker"},{model:"pinkMarker",class:"marker-pink",title:"Pink marker",color:"var(--ck-highlight-marker-pink)",type:"marker"},{model:"blueMarker",class:"marker-blue",title:"Blue marker",color:"var(--ck-highlight-marker-blue)",type:"marker"},{model:"redPen",class:"pen-red",title:"Red pen",color:"var(--ck-highlight-pen-red)",type:"pen"},{model:"greenPen",class:"pen-green",title:"Green pen",color:"var(--ck-highlight-pen-green)",type:"pen"}]})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"highlight"});const t=e.config.get("highlight.options");e.conversion.attributeToElement(sx(t));e.commands.add("highlight",new ox(e))}}function sx(e){const t={model:{key:"highlight",values:[]},view:{}};for(const i of e){t.model.values.push(i.model);t.view[i.model]={name:"mark",classes:i.class}}return t}var ax='';var cx='';var lx=i(52);class dx extends jb{constructor(e){super(e);const t=this.bindTemplate;this.set("icon");this.set("isEnabled",true);this.set("isOn",false);this.set("isToggleable",false);this.set("isVisible",true);this.set("keystroke");this.set("label");this.set("tabindex",-1);this.set("tooltip");this.set("tooltipPosition","s");this.set("type","button");this.set("withText",false);this.children=this.createCollection();this.actionView=this._createActionView();this.arrowView=this._createArrowView();this.keystrokes=new zp;this.focusTracker=new Yp;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)=>{if(this.focusTracker.focusedElement===this.actionView.element){this.arrowView.focus();t()}});this.keystrokes.set("arrowleft",(e,t)=>{if(this.focusTracker.focusedElement===this.arrowView.element){this.actionView.focus();t()}})}focus(){this.actionView.focus()}_createActionView(){const e=new Tw;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);return e}_createArrowView(){const e=new Tw;const t=e.bindTemplate;e.icon=Cw;e.extendTemplate({attributes:{class:"ck-splitbutton__arrow","aria-haspopup":true,"aria-expanded":t.to("isOn",e=>String(e))}});e.bind("isEnabled").to(this);e.delegate("execute").to(this,"open");return e}}var ux=i(54);class hx extends tk{get localizedOptionTitles(){const e=this.editor.t;return{"Yellow marker":e("Yellow marker"),"Green marker":e("Green marker"),"Pink marker":e("Pink marker"),"Blue marker":e("Blue marker"),"Red pen":e("Red pen"),"Green pen":e("Green pen")}}static get pluginName(){return"HighlightUI"}init(){const e=this.editor.config.get("highlight.options");for(const t of e){this._addHighlighterButton(t)}this._addRemoveHighlightButton();this._addDropdown(e)}_addRemoveHighlightButton(){const e=this.editor.t;this._addButton("removeHighlight",e("Remove highlight"),wv)}_addHighlighterButton(e){const t=this.editor.commands.get("highlight");this._addButton("highlight:"+e.model,e.title,mx(e.type),e.model,i);function i(i){i.bind("isEnabled").to(t,"isEnabled");i.bind("isOn").to(t,"value",t=>t===e.model);i.iconView.fillColor=e.color;i.isToggleable=true}}_addButton(e,t,i,n,o=(()=>{})){const r=this.editor;r.ui.componentFactory.add(e,e=>{const s=new Tw(e);const a=this.localizedOptionTitles[t]?this.localizedOptionTitles[t]:t;s.set({label:a,icon:i,tooltip:true});s.on("execute",()=>{r.execute("highlight",{value:n});r.editing.view.focus()});o(s);return s})}_addDropdown(e){const t=this.editor;const i=t.t;const n=t.ui.componentFactory;const o=e[0];const r=e.reduce((e,t)=>{e[t.model]=t;return e},{});n.add("highlight",s=>{const a=t.commands.get("highlight");const c=Dw(s,dx);const l=c.buttonView;l.set({tooltip:i("Highlight"),lastExecuted:o.model,commandValue:o.model,isToggleable:true});l.bind("icon").to(a,"value",e=>mx(u(e,"type")));l.bind("color").to(a,"value",e=>u(e,"color"));l.bind("commandValue").to(a,"value",e=>u(e,"model"));l.bind("isOn").to(a,"value",e=>!!e);l.delegate("execute").to(c);const d=e.map(e=>{const t=n.create("highlight:"+e.model);this.listenTo(t,"execute",()=>c.buttonView.set({lastExecuted:e.model}));return t});c.bind("isEnabled").toMany(d,"isEnabled",(...e)=>e.some(e=>e));d.push(new ow);d.push(n.create("removeHighlight"));Vw(c,d);fx(c);c.toolbarView.ariaLabel=i("Text highlight toolbar");l.on("execute",()=>{t.execute("highlight",{value:l.commandValue});t.editing.view.focus()});function u(e,t){const i=!e||e===l.lastExecuted?l.lastExecuted:e;return r[i][t]}return c})}}function fx(e){const t=e.buttonView.actionView;t.iconView.bind("fillColor").to(e.buttonView,"color")}function mx(e){return e==="marker"?ax:cx}class gx extends tk{static get requires(){return[rx,hx]}static get pluginName(){return"Highlight"}}class px{constructor(){this._stack=[]}add(e,t){const i=this._stack;const n=i[0];this._insertDescriptor(e);const o=i[0];if(n!==o&&!bx(n,o)){this.fire("change:top",{oldDescriptor:n,newDescriptor:o,writer:t})}}remove(e,t){const i=this._stack;const n=i[0];this._removeDescriptor(e);const o=i[0];if(n!==o&&!bx(n,o)){this.fire("change:top",{oldDescriptor:n,newDescriptor:o,writer:t})}}_insertDescriptor(e){const t=this._stack;const i=t.findIndex(t=>t.id===e.id);if(bx(e,t[i])){return}if(i>-1){t.splice(i,1)}let n=0;while(t[n]&&wx(t[n],e)){n++}t.splice(n,0,e)}_removeDescriptor(e){const t=this._stack;const i=t.findIndex(t=>t.id===e);if(i>-1){t.splice(i,1)}}}ys(px,ds);function bx(e,t){return e&&t&&e.priority==t.priority&&kx(e.classes)==kx(t.classes)}function wx(e,t){if(e.priority>t.priority){return true}else if(e.prioritykx(t.classes)}function kx(e){return Array.isArray(e)?e.sort().join(","):e}var _x=i(56);const vx=Zb("px");const yx=Dd.document.body;class xx extends jb{constructor(e){super(e);const t=this.bindTemplate;this.set("top",0);this.set("left",0);this.set("position","arrow_nw");this.set("isVisible",false);this.set("withArrow",true);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",vx),left:t.to("left",vx)}},children:this.content})}show(){this.isVisible=true}hide(){this.isVisible=false}attachTo(e){this.show();const t=xx.defaultPositions;const i=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:yx,fitInViewport:true},e);const n=xx._getOptimalPosition(i);const o=parseInt(n.left);const r=parseInt(n.top);const s=n.name;Object.assign(this,{top:r,left:o,position:s})}pin(e){this.unpin();this._pinWhenIsVisibleCallback=()=>{if(this.isVisible){this._startPinning(e)}else{this._stopPinning()}};this._startPinning(e);this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){if(this._pinWhenIsVisibleCallback){this._stopPinning();this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback);this._pinWhenIsVisibleCallback=null;this.hide()}}_startPinning(e){this.attachTo(e);const t=Ax(e.target);const i=e.limiter?Ax(e.limiter):yx;this.listenTo(Dd.document,"scroll",(n,o)=>{const r=o.target;const s=t&&r.contains(t);const a=i&&r.contains(i);if(s||a||!t||!i){this.attachTo(e)}},{useCapture:true});this.listenTo(Dd.window,"resize",()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(Dd.document,"scroll");this.stopListening(Dd.window,"resize")}}function Ax(e){if(Gr(e)){return e}if(xh(e)){return e.commonAncestorContainer}if(typeof e=="function"){return Ax(e())}return null}xx.arrowHorizontalOffset=25;xx.arrowVerticalOffset=10;xx._getOptimalPosition=hw;xx.defaultPositions={northWestArrowSouthWest:(e,t)=>({top:Tx(e,t),left:e.left-xx.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(e,t)=>({top:Tx(e,t),left:e.left-t.width*.25-xx.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(e,t)=>({top:Tx(e,t),left:e.left-t.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(e,t)=>({top:Tx(e,t),left:e.left-t.width*.75+xx.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(e,t)=>({top:Tx(e,t),left:e.left-t.width+xx.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(e,t)=>({top:Tx(e,t),left:e.left+e.width/2-xx.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(e,t)=>({top:Tx(e,t),left:e.left+e.width/2-t.width*.25-xx.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(e,t)=>({top:Tx(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(e,t)=>({top:Tx(e,t),left:e.left+e.width/2-t.width*.75+xx.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(e,t)=>({top:Tx(e,t),left:e.left+e.width/2-t.width+xx.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(e,t)=>({top:Tx(e,t),left:e.right-xx.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(e,t)=>({top:Tx(e,t),left:e.right-t.width*.25-xx.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(e,t)=>({top:Tx(e,t),left:e.right-t.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(e,t)=>({top:Tx(e,t),left:e.right-t.width*.75+xx.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(e,t)=>({top:Tx(e,t),left:e.right-t.width+xx.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(e,t)=>({top:Cx(e,t),left:e.left-xx.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(e,t)=>({top:Cx(e,t),left:e.left-t.width*.25-xx.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(e,t)=>({top:Cx(e,t),left:e.left-t.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(e,t)=>({top:Cx(e,t),left:e.left-t.width*.75+xx.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(e,t)=>({top:Cx(e,t),left:e.left-t.width+xx.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(e,t)=>({top:Cx(e,t),left:e.left+e.width/2-xx.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(e,t)=>({top:Cx(e,t),left:e.left+e.width/2-t.width*.25-xx.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(e,t)=>({top:Cx(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(e,t)=>({top:Cx(e,t),left:e.left+e.width/2-t.width*.75+xx.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(e,t)=>({top:Cx(e,t),left:e.left+e.width/2-t.width+xx.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(e,t)=>({top:Cx(e,t),left:e.right-xx.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(e,t)=>({top:Cx(e,t),left:e.right-t.width*.25-xx.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(e,t)=>({top:Cx(e,t),left:e.right-t.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(e,t)=>({top:Cx(e,t),left:e.right-t.width*.75+xx.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(e,t)=>({top:Cx(e,t),left:e.right-t.width+xx.arrowHorizontalOffset,name:"arrow_ne"})};function Tx(e,t){return e.top-t.height-xx.arrowVerticalOffset}function Cx(e){return e.bottom+xx.arrowVerticalOffset}var Px='';const Ex="widget-type-around";function Sx(e,t,i){return e&&Lx(e)&&!i.isInline(t)}function Mx(e){return e.closest(".ck-widget__type-around__button")}function Ix(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}function Nx(e,t){const i=e.closest(".ck-widget");return t.mapDomToView(i)}function Ox(e){return e.getAttribute(Ex)}const zx="ck-widget";const Rx="ck-widget_selected";function Lx(e){if(!e.is("element")){return false}return!!e.getCustomProperty("widget")}function Dx(e,t,i={}){if(!e.is("containerElement")){throw new ss["b"]("widget-to-widget-wrong-element-type: The element passed to toWidget() must be a container element instance.",null,{element:e})}t.setAttribute("contenteditable","false",e);t.addClass(zx,e);t.setCustomProperty("widget",true,e);e.getFillerOffset=qx;if(i.label){jx(e,i.label,t)}if(i.hasSelectionHandle){$x(e,t)}Vx(e,t,(e,t,i)=>i.addClass(n(t.classes),e),(e,t,i)=>i.removeClass(n(t.classes),e));return e;function n(e){return Array.isArray(e)?e:[e]}}function Vx(e,t,i,n){const o=new px;o.on("change:top",(t,o)=>{if(o.oldDescriptor){n(e,o.oldDescriptor,o.writer)}if(o.newDescriptor){i(e,o.newDescriptor,o.writer)}});t.setCustomProperty("addHighlight",(e,t,i)=>o.add(t,i),e);t.setCustomProperty("removeHighlight",(e,t,i)=>o.remove(t,i),e)}function jx(e,t,i){i.setCustomProperty("widgetLabel",t,e)}function Bx(e){const t=e.getCustomProperty("widgetLabel");if(!t){return""}return typeof t=="function"?t():t}function Fx(e,t){t.addClass(["ck-editor__editable","ck-editor__nested-editable"],e);t.setAttribute("contenteditable",e.isReadOnly?"false":"true",e);e.on("change:isReadOnly",(i,n,o)=>{t.setAttribute("contenteditable",o?"false":"true",e)});e.on("change:isFocused",(i,n,o)=>{if(o){t.addClass("ck-editor__nested-editable_focused",e)}else{t.removeClass("ck-editor__nested-editable_focused",e)}});return e}function Hx(e,t){const i=e.getSelectedElement();if(i){const n=Ox(e);if(n){return t.createPositionAt(i,n)}if(t.schema.isBlock(i)){return t.createPositionAfter(i)}}const n=e.getSelectedBlocks().next().value;if(n){if(n.isEmpty){return t.createPositionAt(n,0)}const i=t.createPositionAfter(n);if(e.focus.isTouching(i)){return i}return t.createPositionBefore(n)}return e.focus}function Ux(e,t){return(i,n)=>{const{mapper:o,viewPosition:r}=n;const s=o.findMappedViewAncestor(r);if(!t(s)){return}const a=o.toModelElement(s);n.modelPosition=e.createPositionAt(a,r.isAtStart?"before":"after")}}function Wx(e,t){const i=new Ch(Dd.window);const n=i.getIntersection(e);const o=t.height+xx.arrowVerticalOffset;if(e.top-o>i.top||e.bottom+o{const i=t.createElement("horizontalLine");e.insertContent(i);let n=i.nextSibling;const o=n&&e.schema.checkChild(n,"$text");if(!o&&e.schema.checkChild(i.parent,"paragraph")){n=t.createElement("paragraph");e.insertContent(n,t.createPositionAfter(i))}if(n){t.setSelection(n,0)}})}}function Gx(e){const t=e.schema;const i=e.document.selection;return Kx(i,t,e)&&!Qx(i,t)}function Kx(e,t,i){const n=Jx(e,i);return t.checkChild(n,"horizontalLine")}function Qx(e,t){const i=e.getSelectedElement();return i&&t.isObject(i)}function Jx(e,t){const i=Hx(e,t);const n=i.parent;if(n.isEmpty&&!n.is("element","$root")){return n.parent}return n}var Zx=i(58);class Xx extends tk{static get pluginName(){return"HorizontalLineEditing"}init(){const e=this.editor;const t=e.model.schema;const i=e.t;const n=e.conversion;t.register("horizontalLine",{isObject:true,allowWhere:"$block"});n.for("dataDowncast").elementToElement({model:"horizontalLine",view:(e,t)=>t.createEmptyElement("hr")});n.for("editingDowncast").elementToElement({model:"horizontalLine",view:(e,t)=>{const n=i("Horizontal line");const o=t.createContainerElement("div");const r=t.createEmptyElement("hr");t.addClass("ck-horizontal-line",o);t.setCustomProperty("hr",true,o);t.insert(t.createPositionAt(o,0),r);return eA(o,t,n)}});n.for("upcast").elementToElement({view:"hr",model:"horizontalLine"});e.commands.add("horizontalLine",new Yx(e))}}function eA(e,t,i){t.setCustomProperty("horizontalLine",true,e);return Dx(e,t,{label:i})}var tA='';class iA extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add("horizontalLine",i=>{const n=e.commands.get("horizontalLine");const o=new Tw(i);o.set({label:t("Horizontal line"),icon:tA,tooltip:true});o.bind("isEnabled").to(n,"isEnabled");this.listenTo(o,"execute",()=>{e.execute("horizontalLine");e.editing.view.focus()});return o})}}class nA extends tk{static get requires(){return[Xx,iA]}static get pluginName(){return"HorizontalLine"}}class oA extends Zd{observe(e){this.listenTo(e,"load",(e,t)=>{const i=t.target;if(i.tagName=="IMG"){this._fireEvents(t)}},{useCapture:true})}_fireEvents(e){if(this.isEnabled){this.document.fire("layoutChanged");this.document.fire("imageLoaded",e)}}}function rA(e,t,i){t.setCustomProperty("image",true,e);return Dx(e,t,{label:n});function n(){const t=uA(e);const n=t.getAttribute("alt");return n?`${n} ${i}`:i}}function sA(e){return!!e.getCustomProperty("image")&&Lx(e)}function aA(e){const t=e.getSelectedElement();if(t&&sA(t)){return t}return null}function cA(e){return!!e&&e.is("element","image")}function lA(e,t,i={}){const n=e.createElement("image",i);const o=Hx(t.document.selection,t);t.insertContent(n,o);if(n.parent){e.setSelection(n,"on")}}function dA(e){const t=e.schema;const i=e.document.selection;return hA(i,t,e)&&!fA(i,t)&&mA(i)}function uA(e){const t=[];for(const i of e.getChildren()){t.push(i);if(i.is("element")){t.push(...i.getChildren())}}return t.find(e=>e.is("element","img"))}function hA(e,t,i){const n=gA(e,i);return t.checkChild(n,"image")}function fA(e,t){const i=e.getSelectedElement();return i&&t.isObject(i)}function mA(e){return[...e.focus.getAncestors()].every(e=>!e.is("element","image"))}function gA(e,t){const i=Hx(e,t);const n=i.parent;if(n.isEmpty&&!n.is("element","$root")){return n.parent}return n}function pA(){return t=>{t.on("element:figure",e)};function e(e,t,i){if(!i.consumable.test(t.viewItem,{name:true,classes:"image"})){return}const n=uA(t.viewItem);if(!n||!n.hasAttribute("src")||!i.consumable.test(n,{name:true})){return}const o=i.convertItem(n,t.modelCursor);const r=rk(o.modelRange.getItems());if(!r){return}i.convertChildren(t.viewItem,i.writer.createPositionAt(r,0));t.modelRange=o.modelRange;t.modelCursor=o.modelCursor}}function bA(){return t=>{t.on("attribute:srcset:image",e)};function e(e,t,i){if(!i.consumable.consume(t.item,e.name)){return}const n=i.writer;const o=i.mapper.toViewElement(t.item);const r=uA(o);if(t.attributeNewValue===null){const e=t.attributeOldValue;if(e.data){n.removeAttribute("srcset",r);n.removeAttribute("sizes",r);if(e.width){n.removeAttribute("width",r)}}}else{const e=t.attributeNewValue;if(e.data){n.setAttribute("srcset",e.data,r);n.setAttribute("sizes","100vw",r);if(e.width){n.setAttribute("width",e.width,r)}}}}}function wA(e){return i=>{i.on(`attribute:${e}:image`,t)};function t(e,t,i){if(!i.consumable.consume(t.item,e.name)){return}const n=i.writer;const o=i.mapper.toViewElement(t.item);const r=uA(o);n.setAttribute(t.attributeKey,t.attributeNewValue||"",r)}}class kA extends nk{refresh(){this.isEnabled=dA(this.editor.model)}execute(e){const t=this.editor.model;t.change(i=>{const n=Array.isArray(e.source)?e.source:[e.source];for(const e of n){lA(i,t,{src:e})}})}}class _A extends tk{static get pluginName(){return"ImageEditing"}init(){const e=this.editor;const t=e.model.schema;const i=e.t;const n=e.conversion;e.editing.view.addObserver(oA);t.register("image",{isObject:true,isBlock:true,allowWhere:"$block",allowAttributes:["alt","src","srcset"]});n.for("dataDowncast").elementToElement({model:"image",view:(e,t)=>vA(t)});n.for("editingDowncast").elementToElement({model:"image",view:(e,t)=>rA(vA(t),t,i("image widget"))});n.for("downcast").add(wA("src")).add(wA("alt")).add(bA());n.for("upcast").elementToElement({view:{name:"img",attributes:{src:true}},model:(e,t)=>t.createElement("image",{src:e.getAttribute("src")})}).attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:e=>{const t={data:e.getAttribute("srcset")};if(e.hasAttribute("width")){t.width=e.getAttribute("width")}return t}}}).add(pA());e.commands.add("imageInsert",new kA(e))}}function vA(e){const t=e.createEmptyElement("img");const i=e.createContainerElement("figure",{class:"image"});e.insert(e.createPositionAt(i,0),t);return i}class yA extends eh{constructor(e){super(e);this.domEventType="mousedown"}onDomEvent(e){this.fire(e.type,e)}}var xA='\n';var AA=i(60);const TA=["before","after"];const CA=(new DOMParser).parseFromString(xA,"image/svg+xml").firstChild;const PA="ck-widget__type-around_disabled";class EA extends tk{static get pluginName(){return"WidgetTypeAround"}constructor(e){super(e);this._currentFakeCaretModelElement=null}init(){const e=this.editor;const t=e.editing.view;this.on("change:isEnabled",(i,n,o)=>{t.change(e=>{for(const i of t.document.roots){if(o){e.removeClass(PA,i)}else{e.addClass(PA,i)}}});if(!o){e.model.change(e=>{e.removeSelectionAttribute(Ex)})}});this._enableTypeAroundUIInjection();this._enableInsertingParagraphsOnButtonClick();this._enableInsertingParagraphsOnEnterKeypress();this._enableInsertingParagraphsOnTypingKeystroke();this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows();this._enableDeleteIntegration();this._enableInsertContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const i=this.editor;const n=i.editing.view;i.execute("insertParagraph",{position:i.model.createPositionAt(e,t)});n.focus();n.scrollToTheSelection()}_listenToIfEnabled(e,t,i,n){this.listenTo(e,t,(...e)=>{if(this.isEnabled){i(...e)}},n)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor;const t=e.model;const i=t.document.selection;const n=Ox(i);if(!n){return false}const o=i.getSelectedElement();this._insertParagraph(o,n);return true}_enableTypeAroundUIInjection(){const e=this.editor;const t=e.model.schema;const i=e.locale.t;const n={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(e,i,o)=>{const r=o.mapper.toViewElement(i.item);if(Sx(r,i.item,t)){SA(o.writer,n,r)}},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor;const t=e.model;const i=t.document.selection;const n=t.schema;const o=e.editing.view;this._listenToIfEnabled(o.document,"keydown",(e,t)=>{if(Vl(t.keyCode)){this._handleArrowKeyPress(e,t)}},{priority:os.get("high")+10});this._listenToIfEnabled(i,"change:range",(t,i)=>{if(!i.directChange){return}e.model.change(e=>{e.removeSelectionAttribute(Ex)})});this._listenToIfEnabled(t.document,"change:data",()=>{const t=i.getSelectedElement();if(t){const i=e.editing.mapper.toViewElement(t);if(Sx(i,t,n)){return}}e.model.change(e=>{e.removeSelectionAttribute(Ex)})});this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(e,t,i)=>{const o=i.writer;if(this._currentFakeCaretModelElement){const e=i.mapper.toViewElement(this._currentFakeCaretModelElement);if(e){o.removeClass(TA.map(r),e);this._currentFakeCaretModelElement=null}}const s=t.selection.getSelectedElement();if(!s){return}const a=i.mapper.toViewElement(s);if(!Sx(a,s,n)){return}const c=Ox(t.selection);if(!c){return}o.addClass(r(c),a);this._currentFakeCaretModelElement=s});this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(t,i,n)=>{if(!n){e.model.change(e=>{e.removeSelectionAttribute(Ex)})}});function r(e){return`ck-widget_type-around_show-fake-caret_${e}`}}_handleArrowKeyPress(e,t){const i=this.editor;const n=i.model;const o=n.document.selection;const r=n.schema;const s=i.editing.view;const a=t.keyCode;const c=Bl(a,i.locale.contentLanguageDirection);const l=s.document.selection.getSelectedElement();const d=i.editing.mapper.toModelElement(l);let u;if(Sx(l,d,r)){u=this._handleArrowKeyPressOnSelectedWidget(c)}else if(o.isCollapsed){u=this._handleArrowKeyPressWhenSelectionNextToAWidget(c)}if(u){t.preventDefault();e.stop()}}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor;const i=t.model;const n=i.document.selection;const o=Ox(n);return i.change(t=>{if(o){const i=o===(e?"after":"before");if(!i){t.removeSelectionAttribute(Ex);return true}}else{t.setSelectionAttribute(Ex,e?"after":"before");return true}return false})}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor;const i=t.model;const n=i.schema;const o=t.plugins.get("Widget");const r=o._getObjectElementNextToSelection(e);const s=t.editing.mapper.toViewElement(r);if(Sx(s,r,n)){i.change(t=>{o._setSelectionOverElement(r);t.setSelectionAttribute(Ex,e?"before":"after")});return true}return false}_enableInsertingParagraphsOnButtonClick(){const e=this.editor;const t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(i,n)=>{const o=Mx(n.domTarget);if(!o){return}const r=Ix(o);const s=Nx(o,t.domConverter);const a=e.editing.mapper.toModelElement(s);this._insertParagraph(a,r);n.preventDefault();i.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor;const t=e.editing.view;this._listenToIfEnabled(t.document,"enter",(i,n)=>{const o=t.document.selection.getSelectedElement();const r=e.editing.mapper.toModelElement(o);const s=e.model.schema;let a;if(this._insertParagraphAccordingToFakeCaretPosition()){a=true}else if(Sx(o,r,s)){this._insertParagraph(r,n.isSoft?"before":"after");a=true}if(a){n.preventDefault();i.stop()}})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor;const t=e.editing.view;const i=[zl.enter,zl.delete,zl.backspace];this._listenToIfEnabled(t.document,"keydown",(e,t)=>{if(!i.includes(t.keyCode)&&!P_(t)){this._insertParagraphAccordingToFakeCaretPosition()}},{priority:os.get("high")+1})}_enableDeleteIntegration(){const e=this.editor;const t=e.editing.view;const i=e.model;const n=i.schema;this._listenToIfEnabled(t.document,"delete",(t,o)=>{const r=Ox(i.document.selection);if(!r){return}const s=o.direction;const a=i.document.selection.getSelectedElement();const c=r==="before";const l=s=="forward";const d=c===l;if(d){e.execute("delete",{selection:i.createSelection(a,"on")})}else{const t=n.getNearestSelectionRange(i.createPositionAt(a,r),s);if(t){if(!t.isCollapsed){i.change(i=>{i.setSelection(t);e.execute(l?"forwardDelete":"delete")})}else{const o=i.createSelection(t.start);i.modifySelection(o,{direction:s});if(!o.focus.isEqual(t.start)){i.change(i=>{i.setSelection(t);e.execute(l?"forwardDelete":"delete")})}else{const e=NA(n,t.start.parent);i.deleteContent(i.createSelection(e,"on"),{doNotAutoparagraph:true})}}}}o.preventDefault();t.stop()},{priority:os.get("high")+1})}_enableInsertContentIntegration(){const e=this.editor;const t=this.editor.model;const i=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(e,[n,o])=>{if(o&&!o.is("documentSelection")){return}const r=Ox(i);if(!r){return}e.stop();return t.change(e=>{const o=i.getSelectedElement();const s=t.createPositionAt(o,r);const a=e.createSelection(s);const c=t.insertContent(n,a);e.setSelection(a);return c})},{priority:"high"})}}function SA(e,t,i){const n=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(e){const i=this.toDomElement(e);MA(i,t);IA(i);return i}));e.insert(e.createPositionAt(i,"end"),n)}function MA(e,t){for(const i of TA){const n=new hb({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${i}`],title:t[i]},children:[e.ownerDocument.importNode(CA,true)]});e.appendChild(n.render())}}function IA(e){const t=new hb({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}function NA(e,t){let i=t;for(const n of t.getAncestors({parentFirst:true})){if(n.childCount>1||e.isLimit(n)){break}i=n}return i}var OA=i(62);class zA extends tk{static get pluginName(){return"Widget"}static get requires(){return[EA]}init(){const e=this.editor.editing.view;const t=e.document;this._previouslySelected=new Set;this.editor.editing.downcastDispatcher.on("selection",(e,t,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const n=i.writer;const o=n.document.selection;const r=o.getSelectedElement();let s=null;for(const e of o.getRanges()){for(const t of e){const e=t.item;if(Lx(e)&&!LA(e,s)){n.addClass(Rx,e);this._previouslySelected.add(e);s=e;if(e==r){n.setSelection(o.getRanges(),{fake:true,label:Bx(r)})}}}}},{priority:"low"});e.addObserver(yA);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:os.get("high")-20});this.listenTo(t,"delete",(e,t)=>{if(this._handleDelete(t.direction=="forward")){t.preventDefault();e.stop()}},{priority:"high"})}_onMousedown(e,t){const i=this.editor;const n=i.editing.view;const o=n.document;let r=t.target;if(RA(r)){if((Cl.isSafari||Cl.isGecko)&&t.domEvent.detail>=3){const e=i.editing.mapper;const n=r.is("attributeElement")?r.findAncestor(e=>!e.is("attributeElement")):r;const o=e.toModelElement(n);t.preventDefault();this.editor.model.change(e=>{e.setSelection(o,"in")})}return}if(!Lx(r)){r=r.findAncestor(Lx);if(!r){return}}t.preventDefault();if(!o.isFocused){n.focus()}const s=i.editing.mapper.toModelElement(r);this._setSelectionOverElement(s)}_handleSelectionChangeOnArrowKeyPress(e,t){const i=t.keyCode;if(!Vl(i)){return}const n=this.editor.model;const o=n.schema;const r=n.document.selection;const s=r.getSelectedElement();const a=Bl(i,this.editor.locale.contentLanguageDirection);if(s&&o.isObject(s)){const i=a?r.getLastPosition():r.getFirstPosition();const s=o.getNearestSelectionRange(i,a?"forward":"backward");if(s){n.change(e=>{e.setSelection(s)});t.preventDefault();e.stop()}return}if(!r.isCollapsed){return}const c=this._getObjectElementNextToSelection(a);if(c&&o.isObject(c)){this._setSelectionOverElement(c);t.preventDefault();e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const i=t.keyCode;if(!Vl(i)){return}const n=this.editor.model;const o=n.schema;const r=n.document.selection.getSelectedElement();if(r&&o.isObject(r)){t.preventDefault();e.stop()}}_handleDelete(e){if(this.editor.isReadOnly){return}const t=this.editor.model.document;const i=t.selection;if(!i.isCollapsed){return}const n=this._getObjectElementNextToSelection(e);if(n){this.editor.model.change(e=>{let t=i.anchor.parent;while(t.isEmpty){const i=t;t=i.parent;e.remove(i)}this._setSelectionOverElement(n)});return true}}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model;const i=t.schema;const n=t.document.selection;const o=t.createSelection(n);t.modifySelection(o,{direction:e?"forward":"backward"});const r=e?o.focus.nodeBefore:o.focus.nodeAfter;if(!!r&&i.isObject(r)){return r}return null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected){e.removeClass(Rx,t)}this._previouslySelected.clear()}}function RA(e){while(e){if(e.is("editableElement")&&!e.is("rootElement")){return true}if(Lx(e)){return false}e=e.parent}return false}function LA(e,t){if(!t){return false}return Array.from(e.getAncestors()).includes(t)}class DA extends nk{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=cA(e);if(cA(e)&&e.hasAttribute("alt")){this.value=e.getAttribute("alt")}else{this.value=false}}execute(e){const t=this.editor.model;const i=t.document.selection.getSelectedElement();t.change(t=>{t.setAttribute("alt",e.newValue,i)})}}class VA extends tk{static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new DA(this.editor))}}var jA=i(64);class BA extends jb{constructor(e,t){super(e);const i=`ck-labeled-field-view-${is()}`;const n=`ck-labeled-field-view-status-${is()}`;this.fieldView=t(this,i,n);this.set("label");this.set("isEnabled",true);this.set("errorText",null);this.set("infoText",null);this.set("class");this.labelView=this._createLabelView(i);this.statusView=this._createStatusView(n);this.bind("_statusText").to(this,"errorText",this,"infoText",(e,t)=>e||t);const o=this.bindTemplate;this.setTemplate({tag:"div",attributes:{tabindex: o.to( 'tabindex' ),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 Gb(this.locale);t.for=e;t.bind("text").to(this,"label");return t}_createStatusView(e){const t=new jb(this.locale);const i=this.bindTemplate;t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",e=>!e)],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]});return t}focus(){this.fieldView.focus()}}var FA=i(66);class HA extends jb{constructor(e){super(e);this.set("value");this.set("id");this.set("placeholder");this.set("isReadOnly",false);this.set("hasError",false);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",true),"aria-describedby":t.to("ariaDescribedById")},on:{input:t.to("input")}})}render(){super.render();const e=e=>{this.element.value=!e&&e!==0?"":e};e(this.value);this.on("change:value",(t,i,n)=>{e(n)})}select(){this.element.select()}focus(){this.element.focus()}}function UA(e,t,i){const n=new HA(e.locale);n.set({id:t,ariaDescribedById:i});n.bind("isReadOnly").to(e,"isEnabled",e=>!e);n.bind("hasError").to(e,"errorText",e=>!!e);n.on("input",()=>{e.errorText=null});return n}function WA(e,t,i){const n=Dw(e.locale);n.set({id:t,ariaDescribedById:i});n.bind("isEnabled").to(e);return n}function qA({view:e}){e.listenTo(e.element,"submit",(t,i)=>{i.preventDefault();e.fire("submit")},{useCapture:true})}var $A='';var YA='';var GA=i(68);class KA extends jb{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new Yp;this.keystrokes=new zp;this.labeledInput=this._createLabeledInputView();this.saveButtonView=this._createButton(t("Save"),$A,"ck-button-save");this.saveButtonView.type="submit";this.cancelButtonView=this._createButton(t("Cancel"),YA,"ck-button-cancel","cancel");this._focusables=new lb;this._focusCycler=new iw({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);qA({view:this});[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)})}_createButton(e,t,i,n){const o=new Tw(this.locale);o.set({label:e,icon:t,tooltip:true});o.extendTemplate({attributes:{class:i}});if(n){o.delegate("execute").to(this,n)}return o}_createLabeledInputView(){const e=this.locale.t;const t=new BA(this.locale,UA);t.label=e("Text alternative");t.fieldView.placeholder=e("Text alternative");return t}}var QA='';var JA='';var ZA=i(70);var XA=i(72);const eT=Zb("px");class tT extends tk{static get pluginName(){return"ContextualBalloon"}constructor(e){super(e);this.positionLimiter=()=>{const e=this.editor.editing.view;const t=e.document;const i=t.selection.editableElement;if(i){return e.domConverter.mapViewToDom(i.root)}return null};this.set("visibleView",null);this.view=new xx(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",false);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 ss["b"]("contextualballoon-add-view-exist: Cannot add configuration of the same view twice.",[this,e])}const t=e.stackId||"main";if(!this._idToStack.has(t)){this._idToStack.set(t,new Map([[e.view,e]]));this._viewToStack.set(e.view,this._idToStack.get(t));this._numberOfStacks=this._idToStack.size;if(!this._visibleStack||e.singleViewMode){this.showStack(t)}return}const i=this._idToStack.get(t);if(e.singleViewMode){this.showStack(t)}i.set(e.view,e);this._viewToStack.set(e.view,i);if(i===this._visibleStack){this._showView(e)}}remove(e){if(!this.hasView(e)){throw new ss["b"]("contextualballoon-remove-view-not-exist: Cannot remove the configuration of a non-existent view.",[this,e])}const t=this._viewToStack.get(e);if(this._singleViewMode&&this.visibleView===e){this._singleViewMode=false}if(this.visibleView===e){if(t.size===1){if(this._idToStack.size>1){this._showNextStack()}else{this.view.hide();this.visibleView=null;this._rotatorView.hideView()}}else{this._showView(Array.from(t.values())[t.size-2])}}if(t.size===1){this._idToStack.delete(this._getStackId(t));this._numberOfStacks=this._idToStack.size}else{t.delete(e)}this._viewToStack.delete(e)}updatePosition(e){if(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 ss["b"]("contextualballoon-showstack-stack-not-exist: Cannot show a stack that does not exist.",this)}if(this._visibleStack===t){return}this._showView(Array.from(t.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){const t=Array.from(this._idToStack.entries()).find(t=>t[1]===e);return t[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;if(!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;if(!e[t]){t=e.length-1}this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new iT(this.editor.locale);const t=this.editor.locale.t;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,i)=>{if(i<2){return""}const n=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[n,i])});e.buttonNextView.on("execute",()=>{if(e.focusTracker.isFocused){this.editor.editing.view.focus()}this._showNextStack()});e.buttonPrevView.on("execute",()=>{if(e.focusTracker.isFocused){this.editor.editing.view.focus()}this._showPrevStack()});return e}_createFakePanelsView(){const e=new nT(this.editor.locale,this.view);e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>{const i=!t&&e>=2;return i?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);return e}_showView({view:e,balloonClassName:t="",withArrow:i=true,singleViewMode:n=false}){this.view.class=t;this.view.withArrow=i;this._rotatorView.showView(e);this.visibleView=e;this.view.pin(this._getBalloonPosition());this._fakePanelsView.updatePosition();if(n){this._singleViewMode=true}}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;if(e&&!e.limiter){e=Object.assign({},e,{limiter:this.positionLimiter})}return e}}class iT extends jb{constructor(e){super(e);const t=e.t;const i=this.bindTemplate;this.set("isNavigationVisible",true);this.focusTracker=new Yp;this.buttonPrevView=this._createButtonView(t("Previous"),QA);this.buttonNextView=this._createButtonView(t("Next"),JA);this.content=this.createCollection();this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",e=>e?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render();this.focusTracker.add(this.element)}showView(e){this.hideView();this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const i=new Tw(this.locale);i.set({label:e,icon:t,tooltip:true});return i}}class nT extends jb{constructor(e,t){super(e);const i=this.bindTemplate;this.set("top",0);this.set("left",0);this.set("height",0);this.set("width",0);this.set("numberOfPanels",0);this.content=this.createCollection();this._balloonPanelView=t;this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",e=>e?"":"ck-hidden")],style:{top:i.to("top",eT),left:i.to("left",eT),width:i.to("width",eT),height:i.to("height",eT)}},children:this.content});this.on("change:numberOfPanels",(e,t,i,n)=>{if(i>n){this._addPanels(i-n)}else{this._removePanels(n-i)}this.updatePosition()})}_addPanels(e){while(e--){const e=new jb;e.setTemplate({tag:"div"});this.content.add(e);this.registerChild(e)}}_removePanels(e){while(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;const{width:i,height:n}=new Ch(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:n})}}}var oT='';function rT(e){const t=e.plugins.get("ContextualBalloon");if(aA(e.editing.view.document.selection)){const i=sT(e);t.updatePosition(i)}}function sT(e){const t=e.editing.view;const i=xx.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast]}}class aT extends tk{static get requires(){return[tT]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton();this._createForm()}destroy(){super.destroy();this._form.destroy()}_createButton(){const e=this.editor;const t=e.t;e.ui.componentFactory.add("imageTextAlternative",i=>{const n=e.commands.get("imageTextAlternative");const o=new Tw(i);o.set({label:t("Change image text alternative"),icon:oT,tooltip:true});o.bind("isEnabled").to(n,"isEnabled");this.listenTo(o,"execute",()=>{this._showForm()});return o})}_createForm(){const e=this.editor;const t=e.editing.view;const i=t.document;this._balloon=this.editor.plugins.get("ContextualBalloon");this._form=new KA(e.locale);this._form.render();this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value});this._hideForm(true)});this.listenTo(this._form,"cancel",()=>{this._hideForm(true)});this._form.keystrokes.set("Esc",(e,t)=>{this._hideForm(true);t()});this.listenTo(e.ui,"update",()=>{if(!aA(i.selection)){this._hideForm(true)}else if(this._isVisible){rT(e)}});zw({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible){return}const e=this.editor;const t=e.commands.get("imageTextAlternative");const i=this._form.labeledInput;if(!this._isInBalloon){this._balloon.add({view:this._form,position:sT(e)})}i.fieldView.value=i.fieldView.element.value=t.value||"";this._form.labeledInput.fieldView.select()}_hideForm(e){if(!this._isInBalloon){return}if(this._form.focusTracker.isFocused){this._form.saveButtonView.focus()}this._balloon.remove(this._form);if(e){this.editor.editing.view.focus()}}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class cT extends tk{static get requires(){return[VA,aT]}static get pluginName(){return"ImageTextAlternative"}}var lT=i(74);class dT extends tk{static get requires(){return[_A,zA,cT]}static get pluginName(){return"Image"}}function uT(e,t){return i=>{const n=i.createEditableElement("figcaption");i.setCustomProperty("imageCaption",true,n);Xp({view:e,element:n,text:t});return Fx(n,i)}}function hT(e){return!!e.getCustomProperty("imageCaption")}function fT(e){for(const t of e.getChildren()){if(!!t&&t.is("element","caption")){return t}}return null}function mT(e){const t=e.parent;if(e.name=="figcaption"&&t&&t.name=="figure"&&t.hasClass("image")){return{name:true}}return null}class gT extends tk{static get pluginName(){return"ImageCaptionEditing"}init(){const e=this.editor;const t=e.editing.view;const i=e.model.schema;const n=e.data;const o=e.editing;const r=e.t;i.register("caption",{allowIn:"image",allowContentOf:"$block",isLimit:true});e.model.document.registerPostFixer(e=>this._insertMissingModelCaptionElement(e));e.conversion.for("upcast").elementToElement({view:mT,model:"caption"});const s=e=>e.createContainerElement("figcaption");n.downcastDispatcher.on("insert:caption",pT(s,false));const a=uT(t,r("Enter image caption"));o.downcastDispatcher.on("insert:caption",pT(a));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;const i=this._lastSelectedCaption;let n;const o=this.editor.model.document.selection;const r=o.getSelectedElement();if(r&&r.is("element","image")){const e=fT(r);n=t.toViewElement(e)}const s=o.getFirstPosition();const a=wT(s.parent);if(a){n=t.toViewElement(a)}if(n){if(i){if(i===n){return _T(n,e)}else{kT(i,e);this._lastSelectedCaption=n;return _T(n,e)}}else{this._lastSelectedCaption=n;return _T(n,e)}}else{if(i){const t=kT(i,e);this._lastSelectedCaption=null;return t}else{return false}}}_fixCaptionVisibility(e){return(t,i,n)=>{const o=e(i);const r=wT(o);const s=this.editor.editing.mapper;const a=n.writer;if(r){const e=s.toViewElement(r);if(e){if(r.childCount){a.removeClass("ck-hidden",e)}else{a.addClass("ck-hidden",e)}}}}}_insertMissingModelCaptionElement(e){const t=this.editor.model;const i=t.document.differ.getChanges();const n=[];for(const e of i){if(e.type=="insert"&&e.name!="$text"){const i=e.position.nodeAfter;if(i.is("element","image")&&!fT(i)){n.push(i)}if(!i.is("element","image")&&i.childCount){for(const e of t.createRangeIn(i).getItems()){if(e.is("element","image")&&!fT(e)){n.push(e)}}}}}for(const t of n){e.appendElement("caption",t)}return!!n.length}}function pT(e,t=true){return(i,n,o)=>{const r=n.item;if(!r.childCount&&!t){return}if(cA(r.parent)){if(!o.consumable.consume(n.item,"insert")){return}const t=o.mapper.toViewElement(n.range.start.parent);const i=e(o.writer);const s=o.writer;if(!r.childCount){s.addClass("ck-hidden",i)}bT(i,n.item,t,o)}}}function bT(e,t,i,n){const o=n.writer.createPositionAt(i,"end");n.writer.insert(o,e);n.mapper.bindElements(t,e)}function wT(e){const t=e.getAncestors({includeSelf:true});const i=t.find(e=>e.name=="caption");if(i&&i.parent&&i.parent.name=="image"){return i}return null}function kT(e,t){if(!e.childCount&&!e.hasClass("ck-hidden")){t.addClass("ck-hidden",e);return true}return false}function _T(e,t){if(e.hasClass("ck-hidden")){t.removeClass("ck-hidden",e);return true}return false}var vT=i(76);class yT extends tk{static get requires(){return[gT]}static get pluginName(){return"ImageCaption"}}class xT extends nk{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=cA(e);if(!e||!e.hasAttribute("width")){this.value=null}else{this.value={width:e.getAttribute("width"),height:null}}}execute(e){const t=this.editor.model;const i=t.document.selection.getSelectedElement();this.value={width:e.width,height:null};if(i){t.change(t=>{t.setAttribute("width",e.width,i)})}}}class AT extends tk{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;const t=new xT(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:true})}_registerConverters(){const e=this.editor;e.conversion.for("downcast").add(e=>e.on("attribute:width:image",(e,t,i)=>{if(!i.consumable.consume(t.item,e.name)){return}const n=i.writer;const o=i.mapper.toViewElement(t.item);if(t.attributeNewValue!==null){n.setStyle("width",t.attributeNewValue,o);n.addClass("image_resized",o)}else{n.removeStyle("width",o);n.removeClass("image_resized",o)}}));e.conversion.for("upcast").attributeToAttribute({view:{name:"figure",styles:{width:/.+/}},model:{key:"width",value:e=>e.getStyle("width")}})}}var TT='';var CT='';var PT='';var ET='';const ST={small:TT,medium:CT,large:PT,original:ET};class MT extends tk{static get requires(){return[AT]}static get pluginName(){return"ImageResizeButtons"}constructor(e){super(e);this._resizeUnit=e.config.get("image.resizeUnit")}init(){const e=this.editor;const t=e.config.get("image.resizeOptions");const i=e.commands.get("imageResize");this.bind("isEnabled").to(i);for(const e of t){this._registerImageResizeButton(e)}this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor;const{name:i,value:n,icon:o}=e;const r=n?n+this._resizeUnit:null;t.ui.componentFactory.add(i,n=>{const s=new Tw(n);const a=t.commands.get("imageResize");const c=this._getOptionLabelValue(e,true);if(!ST[o]){throw new ss["b"]("imageresizebuttons-missing-icon: "+'The resize option "'+i+'" misses the "icon" property '+"or the property value doesn't match any of available icons.",t,e)}s.set({label:c,icon:ST[o],tooltip:c,isToggleable:true});s.bind("isEnabled").to(this);s.bind("isOn").to(a,"value",IT(r));this.listenTo(s,"execute",()=>{t.execute("imageResize",{width:r})});return s})}_registerImageResizeDropdown(e){const t=this.editor;const i=t.t;const n=e.find(e=>!e.value);t.ui.componentFactory.add("imageResize",o=>{const r=t.commands.get("imageResize");const s=Dw(o,Pw);const a=s.buttonView;a.set({tooltip:i("Resize image"),commandValue:n.value,icon:CT,isToggleable:true,label:this._getOptionLabelValue(n),withText:true,class:"ck-resize-image-button"});a.bind("label").to(r,"value",e=>{if(e&&e.width){return e.width}else{return this._getOptionLabelValue(n)}});s.bind("isOn").to(r);s.bind("isEnabled").to(this);jw(s,this._getResizeDropdownListItemDefinitions(e,r));s.listView.ariaLabel=i("Image resize list");this.listenTo(s,"execute",e=>{t.execute(e.source.commandName,{width:e.source.commandValue});t.editing.view.focus()});return s})}_getOptionLabelValue(e,t){const i=this.editor.t;if(e.label){return e.label}else if(t){if(e.value){return i("Resize image to %0",e.value+this._resizeUnit)}else{return i("Resize image to the original size")}}else{if(e.value){return e.value+this._resizeUnit}else{return i("Original")}}}_getResizeDropdownListItemDefinitions(e,t){const i=new xs;e.map(e=>{const n=e.value?e.value+this._resizeUnit:null;const o={type:"button",model:new Ay({commandName:"imageResize",commandValue:n,label:this._getOptionLabelValue(e),withText:true,icon:null})};o.model.bind("isOn").to(t,"value",IT(n));i.add(o)});return i}}function IT(e){return t=>{if(e===null&&t===e){return true}return t&&t.width===e}}class NT{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,i){const n=new Ch(t);this.activeHandlePosition=LT(e);this._referenceCoordinates=zT(t,DT(this.activeHandlePosition));this.originalWidth=n.width;this.originalHeight=n.height;this.aspectRatio=n.width/n.height;const o=i.style.width;if(o&&o.match(/^\d+\.?\d*%$/)){this.originalWidthPercents=parseFloat(o)}else{this.originalWidthPercents=OT(i,n)}}update(e){this.proposedWidth=e.width;this.proposedHeight=e.height;this.proposedWidthPercents=e.widthPercents;this.proposedHandleHostWidth=e.handleHostWidth;this.proposedHandleHostHeight=e.handleHostHeight}}ys(NT,Qc);function OT(e,t){const i=e.parentElement;const n=parseFloat(i.ownerDocument.defaultView.getComputedStyle(i).width);return t.width/n*100}function zT(e,t){const i=new Ch(e);const n=t.split("-");const o={x:n[1]=="right"?i.right:i.left,y:n[0]=="bottom"?i.bottom:i.top};o.x+=e.ownerDocument.defaultView.scrollX;o.y+=e.ownerDocument.defaultView.scrollY;return o}function RT(e){return`ck-widget__resizer__handle-${e}`}function LT(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const i of t){if(e.classList.contains(RT(i))){return i}}}function DT(e){const t=e.split("-");const i={top:"bottom",bottom:"top",left:"right",right:"left"};return`${i[t[0]]}-${i[t[1]]}`}class VT{constructor(e){this._options=e;this._domResizerWrapper=null;this._viewResizerWrapper=null;this.set("isEnabled",true);this.decorate("begin");this.decorate("cancel");this.decorate("commit");this.decorate("updateSize");this.on("commit",e=>{if(!this.state.proposedWidth&&!this.state.proposedWidthPercents){this._cleanup();e.stop()}},{priority:"high"});this.on("change:isEnabled",()=>{if(this.isEnabled){this.redraw()}})}attach(){const e=this;const t=this._options.viewElement;const i=this._options.editor.editing.view;i.change(i=>{const n=i.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(t){const i=this.toDomElement(t);e._appendHandles(i);e._appendSizeUI(i);e._domResizerWrapper=i;e.on("change:isEnabled",(e,t,n)=>{i.style.display=n?"":"none"});i.style.display=e.isEnabled?"":"none";return i}));i.insert(i.createPositionAt(t,"end"),n);i.addClass("ck-widget_with-resizer",t);this._viewResizerWrapper=n})}begin(e){this.state=new NT(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);const i=this._options.editor.editing.view;i.change(e=>{const i=this._options.unit||"%";const n=(i==="%"?t.widthPercents:t.width)+i;e.setStyle("width",n,this._options.viewElement)});const n=this._getHandleHost();const o=new Ch(n);t.handleHostWidth=Math.round(o.width);t.handleHostHeight=Math.round(o.height);const r=new Ch(n);t.width=Math.round(r.width);t.height=Math.round(r.height);this.redraw(o);this.state.update(t)}commit(){const e=this._options.unit||"%";const 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(!HT(t)){return}const i=t.parentElement;const n=this._getHandleHost();const o=this._viewResizerWrapper;const r=[o.getStyle("width"),o.getStyle("height"),o.getStyle("left"),o.getStyle("top")];let s;if(i.isSameNode(n)){const t=e||new Ch(n);s=[t.width+"px",t.height+"px",undefined,undefined]}else{s=[n.offsetWidth+"px",n.offsetHeight+"px",n.offsetLeft+"px",n.offsetTop+"px"]}if(Rs(r,s)!=="same"){this._options.editor.editing.view.change(e=>{e.setStyle({width:s[0],height:s[1],left:s[2],top:s[3]},o)})}}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=false;const e=this._options.editor.editing.view;e.change(e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const t=this.state;const i=FT(e);const n=this._options.isCentered?this._options.isCentered(this):true;const o={x:t._referenceCoordinates.x-(i.x+t.originalWidth),y:i.y-t.originalHeight-t._referenceCoordinates.y};if(n&&t.activeHandlePosition.endsWith("-right")){o.x=i.x-(t._referenceCoordinates.x+t.originalWidth)}if(n){o.x*=2}const r={width:Math.abs(t.originalWidth+o.x),height:Math.abs(t.originalHeight+o.y)};r.dominant=r.width/t.aspectRatio>r.height?"width":"height";r.max=r[r.dominant];const s={width:r.width,height:r.height};if(r.dominant=="width"){s.height=s.width/t.aspectRatio}else{s.width=s.height*t.aspectRatio}return{width:Math.round(s.width),height:Math.round(s.height),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*s.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 hb({tag:"div",attributes:{class:`ck-widget__resizer__handle ${BT(i)}`}}).render())}}_appendSizeUI(e){const t=new jT;t.render();this._sizeUI=t;e.appendChild(t.element)}}ys(VT,Qc);class jT extends jb{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)=>e!==null&&t!==null);this.bind("label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",(t,i,n)=>{if(e.unit==="px"){return`${t}×${i}`}else{return`${n}%`}});this.bind("activeHandlePosition").to(t)}dismiss(){this.unbind();this.isVisible=false}}function BT(e){return`ck-widget__resizer__handle-${e}`}function FT(e){return{x:e.pageX,y:e.pageY}}function HT(e){return e&&e.ownerDocument&&e.ownerDocument.contains(e)}var UT="Expected a function";function WT(e,t,i){var n=true,o=true;if(typeof e!="function"){throw new TypeError(UT)}if(ce(i)){n="leading"in i?!!i.leading:n;o="trailing"in i?!!i.trailing:o}return ph(e,t,{leading:n,maxWait:t,trailing:o})}var qT=WT;var $T=i(78);class YT extends tk{static get pluginName(){return"WidgetResize"}init(){this.set("_visibleResizer",null);this.set("_activeResizer",null);this._resizers=new Map;const e=Dd.window.document;this.editor.model.schema.setAttributeProperties("width",{isFormatting:true});this.editor.editing.view.addObserver(yA);this._observer=Object.create(Kd);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=()=>{if(this._visibleResizer){this._visibleResizer.redraw()}};const i=qT(t,200);this.on("change:_visibleResizer",t);this.editor.ui.on("update",i);this._observer.listenTo(Dd.window,"resize",i);const n=this.editor.editing.view.document.selection;n.on("change",()=>{const e=n.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 VT(e);const i=this.editor.plugins;t.attach();if(i.has("WidgetToolbarRepository")){const e=i.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"})}this._resizers.set(e.viewElement,t);return 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 i=t.domTarget;if(!VT.isResizeHandle(i)){return}this._activeResizer=this._getResizerByHandle(i);if(this._activeResizer){this._activeResizer.begin(i);e.stop();t.preventDefault()}}_mouseMoveListener(e,t){if(this._activeResizer){this._activeResizer.updateSize(t)}}_mouseUpListener(){if(this._activeResizer){this._activeResizer.commit();this._activeResizer=null}}}ys(YT,Qc);class GT extends tk{static get requires(){return[YT]}static get pluginName(){return"ImageResizeHandles"}init(){const e=this.editor;const t=e.commands.get("imageResize");this.bind("isEnabled").to(t);e.editing.downcastDispatcher.on("insert:image",(t,i,n)=>{const o=n.mapper.toViewElement(i.item);const r=e.plugins.get(YT).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:i.item,viewElement:o,editor:e,getHandleHost(e){return e.querySelector("img")},getResizeHost(e){return e},isCentered(){const e=i.item.getAttribute("imageStyle");return!e||e=="full"||e=="alignCenter"},onCommit(t){e.execute("imageResize",{width:t})}});r.on("updateSize",()=>{if(!o.hasClass("image_resized")){e.editing.view.change(e=>{e.addClass("image_resized",o)})}});r.bind("isEnabled").to(this)},{priority:"low"})}}var KT=i(80);class QT extends tk{static get requires(){return[AT,GT,MT]}static get pluginName(){return"ImageResize"}}class JT extends nk{constructor(e,t){super(e);this.defaultStyle=false;this.styles=t.reduce((e,t)=>{e[t.name]=t;if(t.isDefault){this.defaultStyle=t.name}return e},{})}refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=cA(e);if(!e){this.value=false}else if(e.hasAttribute("imageStyle")){const t=e.getAttribute("imageStyle");this.value=this.styles[t]?t:false}else{this.value=this.defaultStyle}}execute(e){const t=e.value;const i=this.editor.model;const n=i.document.selection.getSelectedElement();i.change(e=>{if(this.styles[t].isDefault){e.removeAttribute("imageStyle",n)}else{e.setAttribute("imageStyle",t,n)}})}}function ZT(e){return(t,i,n)=>{if(!n.consumable.consume(i.item,t.name)){return}const o=eC(i.attributeNewValue,e);const r=eC(i.attributeOldValue,e);const s=n.mapper.toViewElement(i.item);const a=n.writer;if(r){a.removeClass(r.className,s)}if(o){a.addClass(o.className,s)}}}function XT(e){const t=e.filter(e=>!e.isDefault);return(e,i,n)=>{if(!i.modelRange){return}const o=i.viewItem;const r=rk(i.modelRange.getItems());if(!n.schema.checkAttribute(r,"imageStyle")){return}for(const e of t){if(n.consumable.consume(o,{classes:e.className})){n.writer.setAttribute("imageStyle",e.name,r)}}}}function eC(e,t){for(const i of t){if(i.name===e){return i}}}var tC='';var iC='';var nC='';var oC='';const rC={full:{name:"full",title:"Full size image",icon:tC,isDefault:true},side:{name:"side",title:"Side image",icon:oC,className:"image-style-side"},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:iC,className:"image-style-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:nC,className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:oC,className:"image-style-align-right"}};const sC={full:tC,left:iC,right:oC,center:nC};function aC(e=[]){return e.map(cC)}function cC(e){if(typeof e=="string"){const t=e;if(rC[t]){e=Object.assign({},rC[t])}else{console.warn(Object(ss["a"])("image-style-not-found: There is no such image style of given name."),{name:t});e={name:t}}}else if(rC[e.name]){const t=rC[e.name];const i=Object.assign({},e);for(const n in t){if(!Object.prototype.hasOwnProperty.call(e,n)){i[n]=t[n]}}e=i}if(typeof e.icon=="string"&&sC[e.icon]){e.icon=sC[e.icon]}return e}class lC extends tk{static get pluginName(){return"ImageStyleEditing"}init(){const e=this.editor;const t=e.model.schema;const i=e.data;const n=e.editing;e.config.define("image.styles",["full","side"]);const o=aC(e.config.get("image.styles"));t.extend("image",{allowAttributes:"imageStyle"});const r=ZT(o);n.downcastDispatcher.on("attribute:imageStyle:image",r);i.downcastDispatcher.on("attribute:imageStyle:image",r);i.upcastDispatcher.on("element:figure",XT(o),{priority:"low"});e.commands.add("imageStyle",new JT(e,o))}}var dC=i(82);class uC extends tk{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=this.editor;const t=e.config.get("image.styles");const i=hC(aC(t),this.localizedDefaultStylesTitles);for(const e of i){this._createButton(e)}}_createButton(e){const t=this.editor;const i=`imageStyle:${e.name}`;t.ui.componentFactory.add(i,i=>{const n=t.commands.get("imageStyle");const o=new Tw(i);o.set({label:e.title,icon:e.icon,tooltip:true,isToggleable:true});o.bind("isEnabled").to(n,"isEnabled");o.bind("isOn").to(n,"value",t=>t===e.name);this.listenTo(o,"execute",()=>{t.execute("imageStyle",{value:e.name});t.editing.view.focus()});return o})}}function hC(e,t){for(const i of e){if(t[i.title]){i.title=t[i.title]}}return e}class fC extends tk{static get requires(){return[lC,uC]}static get pluginName(){return"ImageStyle"}}class mC extends tk{static get requires(){return[tT]}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=>{if(bC(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:i,getRelatedElement:n,balloonClassName:o="ck-toolbar-container"}){if(!i.length){console.warn(Object(ss["a"])("widget-toolbar-no-items: Trying to register a toolbar without items."),{toolbarId:e});return}const r=this.editor;const s=r.t;const a=new $w(r.locale);a.ariaLabel=t||s("Widget toolbar");if(this._toolbarDefinitions.has(e)){throw new ss["b"]("widget-toolbar-duplicated: Toolbar with the given id was already added.",this,{toolbarId:e})}a.fillFromConfig(i,r.ui.componentFactory);this._toolbarDefinitions.set(e,{view:a,getRelatedElement:n,balloonClassName:o})}_updateToolbarsVisibility(){let e=0;let t=null;let i=null;for(const n of this._toolbarDefinitions.values()){const o=n.getRelatedElement(this.editor.editing.view.document.selection);if(!this.isEnabled||!o){if(this._isToolbarInBalloon(n)){this._hideToolbar(n)}}else if(!this.editor.ui.focusTracker.isFocused){if(this._isToolbarVisible(n)){this._hideToolbar(n)}}else{const r=o.getAncestors().length;if(r>e){e=r;t=o;i=n}}}if(i){this._showToolbar(i,t)}}_hideToolbar(e){this._balloon.remove(e.view);this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){if(this._isToolbarVisible(e)){gC(this.editor,t)}else if(!this._isToolbarInBalloon(e)){this._balloon.add({view:e.view,position:pC(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);gC(this.editor,t)}}})}}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function gC(e,t){const i=e.plugins.get("ContextualBalloon");const n=pC(e,t);i.updatePosition(n)}function pC(e,t){const i=e.editing.view;const n=xx.defaultPositions;return{target:i.domConverter.mapViewToDom(t),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,Wx]}}function bC(e){const t=e.getSelectedElement();return!!(t&&Lx(t))}class wC extends tk{static get requires(){return[mC]}static get pluginName(){return"ImageToolbar"}afterInit(){const e=this.editor;const t=e.t;const i=e.plugins.get(mC);i.register("image",{ariaLabel:t("Image toolbar"),items:e.config.get("image.toolbar")||[],getRelatedElement:aA})}}class kC extends jb{constructor(e){super(e);this.buttonView=new Tw(e);this._fileInputView=new _C(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 _C extends jb{constructor(e){super(e);this.set("acceptedType");this.set("allowMultipleFiles",false);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(()=>{if(this.element&&this.element.files&&this.element.files.length){this.fire("done",this.element.files)}this.element.value=""})}})}open(){this.element.click()}}var vC='';function yC(e){const t=e.map(e=>e.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}function xC(e){return new Promise((t,i)=>{const n=e.getAttribute("src");fetch(n).then(e=>e.blob()).then(e=>{const i=TC(e,n);const o=i.replace("image/","");const r=`image.${o}`;const s=new File([e],r,{type:i});t(s)}).catch(i)})}function AC(e){if(!e.is("element","img")||!e.getAttribute("src")){return false}return e.getAttribute("src").match(/^data:image\/\w+;base64,/g)||e.getAttribute("src").match(/^blob:/g)}function TC(e,t){if(e.type){return e.type}else if(t.match(/data:(image\/\w+);base64/)){return t.match(/data:(image\/\w+);base64/)[1].toLowerCase()}else{return"image/jpeg"}}class CC extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add("imageUpload",i=>{const n=new kC(i);const o=e.commands.get("imageUpload");const r=e.config.get("image.upload.types");const s=yC(r);n.set({acceptedType:r.map(e=>`image/${e}`).join(","),allowMultipleFiles:true});n.buttonView.set({label:t("Insert image"),icon:vC,tooltip:true});n.buttonView.bind("isEnabled").to(o);n.on("done",(t,i)=>{const n=Array.from(i).filter(e=>s.test(e.type));if(n.length){e.execute("imageUpload",{file:n})}});return n})}}class PC{constructor(e){this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return true}}ys(PC,Qc);class EC extends PC{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",false);this._actions=new xs({idProperty:"_id"});this._actions.delegate("add","remove").to(this)}add(e){if(typeof e!=="string"){throw new ss["b"]("pendingactions-add-invalid-message: The message must be a string.",this)}const t=Object.create(Qc);t.set("message",e);this._actions.add(t);this.hasAny=true;return 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 SC{constructor(){const e=new window.FileReader;this._reader=e;this._data=undefined;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;this.total=e.size;return new Promise((i,n)=>{t.onload=()=>{const e=t.result;this._data=e;i(e)};t.onerror=()=>{n("error")};t.onabort=()=>{n("aborted")};this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}ys(SC,Qc);class MC extends tk{static get pluginName(){return"FileRepository"}static get requires(){return[EC]}init(){this.loaders=new xs;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){console.warn(Object(ss["a"])("filerepository-no-upload-adapter: Upload adapter is not defined."));return null}const t=new IC(Promise.resolve(e),this.createUploadAdapter);this.loaders.add(t);this._loadersMap.set(e,t);if(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){if(t.uploadTotal){e+=t.uploadTotal}}this.uploadTotal=e});return t}destroyLoader(e){const t=e instanceof IC?e:this.getLoader(e);t._destroy();this.loaders.remove(t);this._loadersMap.forEach((e,i)=>{if(e===t){this._loadersMap.delete(i)}})}_updatePendingAction(){const e=this.editor.plugins.get(EC);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t;const i=e=>`${t("Upload in progress")} ${parseInt(e)}%.`;this._pendingAction=e.add(i(this.uploadedPercent));this._pendingAction.bind("message").to(this,"uploadedPercent",i)}}else{e.remove(this._pendingAction);this._pendingAction=null}}}ys(MC,Qc);class IC{constructor(e,t){this.id=is();this._filePromiseWrapper=this._createFilePromiseWrapper(e);this._adapter=t(this);this._reader=new SC;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(){if(!this._filePromiseWrapper){return Promise.resolve(null)}else{return this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null)}}get data(){return this._reader.data}read(){if(this.status!="idle"){throw new ss["b"]("filerepository-read-wrong-status: You cannot call read if the status is different than idle.",this)}this.status="reading";return this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!=="reading"){throw this.status}this.status="idle";return e}).catch(e=>{if(e==="aborted"){this.status="aborted";throw"aborted"}this.status="error";throw this._reader.error?this._reader.error:e})}upload(){if(this.status!="idle"){throw new ss["b"]("filerepository-upload-wrong-status: You cannot call upload if the status is different than idle.",this)}this.status="uploading";return this.file.then(()=>this._adapter.upload()).then(e=>{this.uploadResponse=e;this.status="idle";return e}).catch(e=>{if(this.status==="aborted"){throw"aborted"}this.status="error";throw e})}abort(){const e=this.status;this.status="aborted";if(!this._filePromiseWrapper.isFulfilled){this._filePromiseWrapper.promise.catch(()=>{});this._filePromiseWrapper.rejecter("aborted")}else if(e=="reading"){this._reader.abort()}else if(e=="uploading"&&this._adapter.abort){this._adapter.abort()}this._destroy()}_destroy(){this._filePromiseWrapper=undefined;this._reader=undefined;this._adapter=undefined;this.uploadResponse=undefined}_createFilePromiseWrapper(e){const t={};t.promise=new Promise((i,n)=>{t.rejecter=n;t.isFulfilled=false;e.then(e=>{t.isFulfilled=true;i(e)}).catch(e=>{t.isFulfilled=true;n(e)})});return t}}ys(IC,Qc);var NC='';var OC=i(84);var zC=i(86);var RC=i(88);class LC extends tk{constructor(e){super(e);this.placeholder="data:image/svg+xml;utf8,"+encodeURIComponent(NC)}init(){const e=this.editor;e.editing.downcastDispatcher.on("attribute:uploadStatus:image",(...e)=>this.uploadStatusChange(...e))}uploadStatusChange(e,t,i){const n=this.editor;const o=t.item;const r=o.getAttribute("uploadId");if(!i.consumable.consume(t.item,e.name)){return}const s=n.plugins.get(MC);const a=r?t.attributeNewValue:null;const c=this.placeholder;const l=n.editing.mapper.toViewElement(o);const d=i.writer;if(a=="reading"){DC(l,d);jC(c,l,d);return}if(a=="uploading"){const e=s.loaders.get(r);DC(l,d);if(!e){jC(c,l,d)}else{BC(l,d);FC(l,d,e,n.editing.view);GC(l,d,e)}return}if(a=="complete"&&s.loaders.get(r)){UC(l,d,n.editing.view)}HC(l,d);BC(l,d);VC(l,d)}}function DC(e,t){if(!e.hasClass("ck-appear")){t.addClass("ck-appear",e)}}function VC(e,t){t.removeClass("ck-appear",e)}function jC(e,t,i){if(!t.hasClass("ck-image-upload-placeholder")){i.addClass("ck-image-upload-placeholder",t)}const n=uA(t);if(n.getAttribute("src")!==e){i.setAttribute("src",e,n)}if(!$C(t,"placeholder")){i.insert(i.createPositionAfter(n),qC(i))}}function BC(e,t){if(e.hasClass("ck-image-upload-placeholder")){t.removeClass("ck-image-upload-placeholder",e)}YC(e,t,"placeholder")}function FC(e,t,i,n){const o=WC(t);t.insert(t.createPositionAt(e,"end"),o);i.on("change:uploadedPercent",(e,t,i)=>{n.change(e=>{e.setStyle("width",i+"%",o)})})}function HC(e,t){YC(e,t,"progressBar")}function UC(e,t,i){const n=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),n);setTimeout(()=>{i.change(e=>e.remove(e.createRangeOn(n)))},3e3)}function WC(e){const t=e.createUIElement("div",{class:"ck-progress-bar"});e.setCustomProperty("progressBar",true,t);return t}function qC(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});e.setCustomProperty("placeholder",true,t);return t}function $C(e,t){for(const i of e.getChildren()){if(i.getCustomProperty(t)){return i}}}function YC(e,t,i){const n=$C(e,i);if(n){t.remove(t.createRangeOn(n))}}function GC(e,t,i){if(i.data){const n=uA(e);t.setAttribute("src",i.data,n)}}class KC extends PC{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 QC{constructor(e){this.document=e}createDocumentFragment(e){return new Kl(this.document,e)}createElement(e,t,i){return new Vc(this.document,e,t,i)}createText(e){return new Bs(this.document,e)}clone(e,t=false){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,i){return i._insertChild(e,t)}removeChildren(e,t,i){return i._removeChildren(e,t)}remove(e){const t=e.parent;if(t){return this.removeChildren(t.getChildIndex(e),1,t)}return[]}replace(e,t){const i=e.parent;if(i){const n=i.getChildIndex(e);this.removeChildren(n,1,i);this.insertChild(n,t,i);return true}return false}unwrapElement(e){const t=e.parent;if(t){const i=t.getChildIndex(e);this.remove(e);this.insertChild(i,e.getChildren(),t)}}rename(e,t){const i=new Vc(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,i)?i:null}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){if(z(e)&&i===undefined){i=t}i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return ul._createAt(e,t)}createPositionAfter(e){return ul._createAfter(e)}createPositionBefore(e){return ul._createBefore(e)}createRange(e,t){return new hl(e,t)}createRangeOn(e){return hl._createOn(e)}createRangeIn(e){return hl._createIn(e)}createSelection(e,t,i){return new gl(e,t,i)}}class JC extends nk{refresh(){this.isEnabled=dA(this.editor.model)}execute(e){const t=this.editor;const i=t.model;const n=t.plugins.get(MC);i.change(t=>{const o=Array.isArray(e.file)?e.file:[e.file];for(const e of o){ZC(t,i,n,e)}})}}function ZC(e,t,i,n){const o=i.createLoader(n);if(!o){return}lA(e,t,{uploadId:o.id})}class XC extends tk{static get requires(){return[MC,KC,n_]}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;const t=e.model.document;const i=e.model.schema;const n=e.conversion;const o=e.plugins.get(MC);const r=yC(e.config.get("image.upload.types"));i.extend("image",{allowAttributes:["uploadId","uploadStatus"]});e.commands.add("imageUpload",new JC(e));n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"});this.listenTo(e.editing.view.document,"clipboardInput",(t,i)=>{if(eP(i.dataTransfer)){return}const n=Array.from(i.dataTransfer.files).filter(e=>{if(!e){return false}return r.test(e.type)});const o=i.targetRanges.map(t=>e.editing.mapper.toModelRange(t));e.model.change(i=>{i.setSelection(o);if(n.length){t.stop();e.model.enqueueChange("default",()=>{e.execute("imageUpload",{file:n})})}})});this.listenTo(e.plugins.get(n_),"inputTransformation",(t,i)=>{const n=Array.from(e.editing.view.createRangeIn(i.content)).filter(e=>AC(e.item)&&!e.item.getAttribute("uploadProcessed")).map(e=>({promise:xC(e.item),imageElement:e.item}));if(!n.length){return}const r=new QC(e.editing.view.document);for(const e of n){r.setAttribute("uploadProcessed",true,e.imageElement);const t=o.createLoader(e.promise);if(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 i=t.differ.getChanges({includeChangesInGraveyard:true});for(const t of i){if(t.type=="insert"&&t.name!="$text"){const i=t.position.nodeAfter;const n=t.position.root.rootName=="$graveyard";for(const t of tP(e,i)){const e=t.getAttribute("uploadId");if(!e){continue}const i=o.loaders.get(e);if(!i){continue}if(n){i.abort()}else if(i.status=="idle"){this._readAndUpload(i,t)}}}}})}_readAndUpload(e,t){const i=this.editor;const n=i.model;const o=i.locale.t;const r=i.plugins.get(MC);const s=i.plugins.get(KC);n.enqueueChange("transparent",e=>{e.setAttribute("uploadStatus","reading",t)});return e.read().then(()=>{const o=e.upload();if(Cl.isSafari){const e=i.editing.mapper.toViewElement(t);const n=uA(e);i.editing.view.once("render",()=>{if(!n.parent){return}const e=i.editing.view.domConverter.mapViewToDom(n.parent);if(!e){return}const t=e.style.display;e.style.display="none";e._ckHack=e.offsetHeight;e.style.display=t})}n.enqueueChange("transparent",e=>{e.setAttribute("uploadStatus","uploading",t)});return o}).then(e=>{n.enqueueChange("transparent",i=>{i.setAttributes({uploadStatus:"complete",src:e.default},t);this._parseAndSetSrcsetAttributeOnImage(e,t,i)});a()}).catch(i=>{if(e.status!=="error"&&e.status!=="aborted"){throw i}if(e.status=="error"&&i){s.showWarning(i,{title:o("Upload failed"),namespace:"upload"})}a();n.enqueueChange("transparent",e=>{e.remove(t)})});function a(){n.enqueueChange("transparent",e=>{e.removeAttribute("uploadId",t);e.removeAttribute("uploadStatus",t)});r.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,i){let n=0;const o=Object.keys(e).filter(e=>{const t=parseInt(e,10);if(!isNaN(t)){n=Math.max(n,t);return true}}).map(t=>`${e[t]} ${t}w`).join(", ");if(o!=""){i.setAttribute("srcset",{data:o,width:n},t)}}}function eP(e){return Array.from(e.types).includes("text/html")&&e.getData("text/html")!==""}function tP(e,t){return Array.from(e.model.createRangeOn(t)).filter(e=>e.item.is("element","image")).map(e=>e.item)}class iP extends tk{static get pluginName(){return"ImageUpload"}static get requires(){return[XC,CC,LC]}}const nP="italic";class oP extends tk{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:nP});e.model.schema.setAttributeProperties(nP,{isFormatting:true,copyOnEnter:true});e.conversion.attributeToElement({model:nP,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]});e.commands.add(nP,new Hk(e,nP));e.keystrokes.set("CTRL+I",nP)}}var rP='';const sP="italic";class aP extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(sP,i=>{const n=e.commands.get(sP);const o=new Tw(i);o.set({label:t("Italic"),icon:rP,keystroke:"CTRL+I",tooltip:true,isToggleable:true});o.bind("isOn","isEnabled").to(n,"value","isEnabled");this.listenTo(o,"execute",()=>{e.execute(sP);e.editing.view.focus()});return o})}}class cP extends tk{static get requires(){return[oP,aP]}static get pluginName(){return"Italic"}}class lP extends tk{static get pluginName(){return"TwoStepCaretMovement"}constructor(e){super(e);this.attributes=new Set;this._overrideUid=null}init(){const e=this.editor;const t=e.model;const i=e.editing.view;const n=e.locale;const o=t.document.selection;this.listenTo(i.document,"keydown",(e,t)=>{if(!o.isCollapsed){return}if(t.shiftKey||t.altKey||t.ctrlKey){return}const i=t.keyCode==zl.arrowright;const r=t.keyCode==zl.arrowleft;if(!i&&!r){return}const s=n.contentLanguageDirection;let a=false;if(s==="ltr"&&i||s==="rtl"&&r){a=this._handleForwardMovement(t)}else{a=this._handleBackwardMovement(t)}if(a===true){e.stop()}},{priority:os.get("high")+1});this._isNextGravityRestorationSkipped=false;this.listenTo(o,"change:range",(e,t)=>{if(this._isNextGravityRestorationSkipped){this._isNextGravityRestorationSkipped=false;return}if(!this._isGravityOverridden){return}if(!t.directChange&&mP(o.getFirstPosition(),this.attributes)){return}this._restoreGravity()})}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes;const i=this.editor.model;const n=i.document.selection;const o=n.getFirstPosition();if(this._isGravityOverridden){return false}if(o.isAtStart&&dP(n,t)){return false}if(mP(o,t)){hP(e);this._overrideGravity();return true}}_handleBackwardMovement(e){const t=this.attributes;const i=this.editor.model;const n=i.document.selection;const o=n.getFirstPosition();if(this._isGravityOverridden){hP(e);this._restoreGravity();uP(i,t,o);return true}else{if(o.isAtStart){if(dP(n,t)){hP(e);uP(i,t,o);return true}return false}if(fP(o,t)){if(o.isAtEnd&&!dP(n,t)&&mP(o,t)){hP(e);uP(i,t,o);return true}this._isNextGravityRestorationSkipped=true;this._overrideGravity();return false}}}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 dP(e,t){for(const i of t){if(e.hasAttribute(i)){return true}}return false}function uP(e,t,i){const n=i.nodeBefore;e.change(e=>{if(n){e.setSelectionAttribute(n.getAttributes())}else{e.removeSelectionAttribute(t)}})}function hP(e){e.preventDefault()}function fP(e,t){const i=e.getShiftedBy(-1);return mP(i,t)}function mP(e,t){const{nodeBefore:i,nodeAfter:n}=e;for(const e of t){const t=i?i.getAttribute(e):undefined;const o=n?n.getAttribute(e):undefined;if(o!==t){return true}}return false}function gP(e,t,i,n){return n.createRange(pP(e,t,i,true,n),pP(e,t,i,false,n))}function pP(e,t,i,n,o){let r=e.textNode||(n?e.nodeBefore:e.nodeAfter);let s=null;while(r&&r.getAttribute(t)==i){s=r;r=n?r.previousSibling:r.nextSibling}return s?o.createPositionAt(s,n?"before":"after"):e}function bP(e,t,i,n){const o=e.editing.view;const r=new Set;o.document.registerPostFixer(o=>{const s=e.model.document.selection;let a=false;if(s.hasAttribute(t)){const c=gP(s.getFirstPosition(),t,s.getAttribute(t),e.model);const l=e.editing.mapper.toViewRange(c);for(const e of l.getItems()){if(e.is("element",i)&&!e.hasClass(n)){o.addClass(n,e);r.add(e);a=true}}}return a});e.conversion.for("editingDowncast").add(e=>{e.on("insert",t,{priority:"highest"});e.on("remove",t,{priority:"highest"});e.on("attribute",t,{priority:"highest"});e.on("selection",t,{priority:"highest"});function t(){o.change(e=>{for(const t of r.values()){e.removeClass(n,t);r.delete(t)}})}})}class wP{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){if(Array.isArray(e)){e.forEach(e=>this._definitions.add(e))}else{this._definitions.add(e)}}getDispatcher(){return e=>{e.on("attribute:linkHref",(e,t,i)=>{if(!i.consumable.test(t.item,"attribute:linkHref")){return}const n=i.writer;const o=n.document.selection;for(const e of this._definitions){const r=n.createAttributeElement("a",e.attributes,{priority:5});n.setCustomProperty("link",true,r);if(e.callback(t.attributeNewValue)){if(t.item.is("selection")){n.wrap(o.getFirstRange(),r)}else{n.wrap(i.mapper.toViewRange(t.range),r)}}else{n.unwrap(i.mapper.toViewRange(t.range),r)}}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:image",(e,t,i)=>{const n=i.mapper.toViewElement(t.item);const o=Array.from(n.getChildren()).find(e=>e.name==="a");for(const e of this._definitions){const n=Us(e.attributes);if(e.callback(t.attributeNewValue)){for(const[e,t]of n){if(e==="class"){i.writer.addClass(t,o)}else{i.writer.setAttribute(e,t,o)}}}else{for(const[e,t]of n){if(e==="class"){i.writer.removeClass(t,o)}else{i.writer.removeAttribute(e,o)}}}}})}}}function kP(e,t,i){var n=e.length;i=i===undefined?n:i;return!t&&i>=n?e:Na(e,t,i)}var _P=kP;var vP="\\ud800-\\udfff",yP="\\u0300-\\u036f",xP="\\ufe20-\\ufe2f",AP="\\u20d0-\\u20ff",TP=yP+xP+AP,CP="\\ufe0e\\ufe0f";var PP="\\u200d";var EP=RegExp("["+PP+vP+TP+CP+"]");function SP(e){return EP.test(e)}var MP=SP;function IP(e){return e.split("")}var NP=IP;var OP="\\ud800-\\udfff",zP="\\u0300-\\u036f",RP="\\ufe20-\\ufe2f",LP="\\u20d0-\\u20ff",DP=zP+RP+LP,VP="\\ufe0e\\ufe0f";var jP="["+OP+"]",BP="["+DP+"]",FP="\\ud83c[\\udffb-\\udfff]",HP="(?:"+BP+"|"+FP+")",UP="[^"+OP+"]",WP="(?:\\ud83c[\\udde6-\\uddff]){2}",qP="[\\ud800-\\udbff][\\udc00-\\udfff]",$P="\\u200d";var YP=HP+"?",GP="["+VP+"]?",KP="(?:"+$P+"(?:"+[UP,WP,qP].join("|")+")"+GP+YP+")*",QP=GP+YP+KP,JP="(?:"+[UP+BP+"?",BP,WP,qP,jP].join("|")+")";var ZP=RegExp(FP+"(?="+FP+")|"+JP+QP,"g");function XP(e){return e.match(ZP)||[]}var eE=XP;function tE(e){return MP(e)?eE(e):NP(e)}var iE=tE;function nE(e){return function(t){t=va(t);var i=MP(t)?iE(t):undefined;var n=i?i[0]:t.charAt(0);var o=i?_P(i,1).join(""):t.slice(1);return n[e]()+o}}var oE=nE;var rE=oE("toUpperCase");var sE=rE;const aE=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;const cE=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;const lE="Ctrl+K";function dE(e){return e.is("attributeElement")&&!!e.getCustomProperty("link")}function uE(e,t){const i=t.createAttributeElement("a",{href:e},{priority:5});t.setCustomProperty("link",true,i);return i}function hE(e){e=String(e);return fE(e)?e:"#"}function fE(e){const t=e.replace(aE,"");return t.match(cE)}function mE(e,t){const i={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};t.forEach(e=>{if(e.label&&i[e.label]){e.label=i[e.label]}return e});return t}function gE(e){const t=[];if(e){for(const[i,n]of Object.entries(e)){const e=Object.assign({},n,{id:`link${sE(i)}`});t.push(e)}}return t}function pE(e,t){if(!e){return false}return e.is("element","image")&&t.checkAttribute("image","linkHref")}class bE extends nk{constructor(e){super(e);this.manualDecorators=new xs;this.automaticDecorators=new wP}restoreManualDecoratorStates(){for(const e of this.manualDecorators){e.value=this._getDecoratorStateFromModel(e.id)}}refresh(){const e=this.editor.model;const t=e.document;const i=rk(t.selection.getSelectedBlocks());if(pE(i,e.schema)){this.value=i.getAttribute("linkHref");this.isEnabled=e.schema.checkAttribute(i,"linkHref")}else{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 i=this.editor.model;const n=i.document.selection;const o=[];const r=[];for(const e in t){if(t[e]){o.push(e)}else{r.push(e)}}i.change(t=>{if(n.isCollapsed){const s=n.getFirstPosition();if(n.hasAttribute("linkHref")){const a=gP(s,"linkHref",n.getAttribute("linkHref"),i);t.setAttribute("linkHref",e,a);o.forEach(e=>{t.setAttribute(e,true,a)});r.forEach(e=>{t.removeAttribute(e,a)});t.setSelection(t.createPositionAfter(a.end.nodeBefore))}else if(e!==""){const r=Us(n.getAttributes());r.set("linkHref",e);o.forEach(e=>{r.set(e,true)});const a=t.createText(e,r);i.insertContent(a,s);t.setSelection(t.createPositionAfter(a))}["linkHref",...o,...r].forEach(e=>{t.removeSelectionAttribute(e)})}else{const s=i.schema.getValidRanges(n.getRanges(),"linkHref");const a=[];for(const e of n.getSelectedBlocks()){if(i.schema.checkAttribute(e,"linkHref")){a.push(t.createRangeOn(e))}}const c=a.slice();for(const e of s){if(this._isRangeToUpdate(e,a)){c.push(e)}}for(const i of c){t.setAttribute("linkHref",e,i);o.forEach(e=>{t.setAttribute(e,true,i)});r.forEach(e=>{t.removeAttribute(e,i)})}}})}_getDecoratorStateFromModel(e){const t=this.editor.model;const i=t.document;const n=rk(i.selection.getSelectedBlocks());if(pE(n,t.schema)){return n.getAttribute(e)}return i.selection.getAttribute(e)}_isRangeToUpdate(e,t){for(const i of t){if(i.containsRange(e)){return false}}return true}}class wE extends nk{refresh(){const e=this.editor.model;const t=e.document;const i=rk(t.selection.getSelectedBlocks());if(pE(i,e.schema)){this.isEnabled=e.schema.checkAttribute(i,"linkHref")}else{this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"linkHref")}}execute(){const e=this.editor;const t=this.editor.model;const i=t.document.selection;const n=e.commands.get("link");t.change(e=>{const o=i.isCollapsed?[gP(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),t)]:i.getRanges();for(const t of o){e.removeAttribute("linkHref",t);if(n){for(const i of n.manualDecorators){e.removeAttribute(i.id,t)}}}})}}class kE{constructor({id:e,label:t,attributes:i,defaultValue:n}){this.id=e;this.set("value");this.defaultValue=n;this.label=t;this.attributes=i}}ys(kE,Qc);var _E=i(90);const vE="ck-link_selected";const yE="automatic";const xE="manual";const AE=/^(https?:)?\/\//;class TE extends tk{static get pluginName(){return"LinkEditing"}static get requires(){return[lP,D_,n_]}constructor(e){super(e);e.config.define("link",{addTargetToExternalLinks:false})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"linkHref"});e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:uE});e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,t)=>uE(hE(e),t)});e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:true}},model:{key:"linkHref",value:e=>e.getAttribute("href")}});e.commands.add("link",new bE(e));e.commands.add("unlink",new wE(e));const t=mE(e.t,gE(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(e=>e.mode===yE));this._enableManualDecorators(t.filter(e=>e.mode===xE));const i=e.plugins.get(lP);i.registerAttribute("linkHref");bP(e,"linkHref","a",vE);this._enableInsertContentSelectionAttributesFixer();this._enableClickingAfterLink();this._enableTypingOverLink();this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(e){const t=this.editor;const i=t.commands.get("link");const n=i.automaticDecorators;if(t.config.get("link.addTargetToExternalLinks")){n.add({id:"linkIsExternal",mode:yE,callback:e=>AE.test(e),attributes:{target:"_blank",rel:"noopener noreferrer"}})}n.add(e);if(n.length){t.conversion.for("downcast").add(n.getDispatcher())}}_enableManualDecorators(e){if(!e.length){return}const t=this.editor;const i=t.commands.get("link");const n=i.manualDecorators;e.forEach(e=>{t.model.schema.extend("$text",{allowAttributes:e.id});n.add(new kE(e));t.conversion.for("downcast").attributeToElement({model:e.id,view:(t,i)=>{if(t){const t=n.get(e.id).attributes;const o=i.createAttributeElement("a",t,{priority:5});i.setCustomProperty("link",true,o);return o}}});t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:n.get(e.id).attributes},model:{key:e.id}})})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor;const t=e.model;const i=t.document.selection;const n=e.commands.get("link");this.listenTo(t,"insertContent",()=>{const e=i.anchor.nodeBefore;const o=i.anchor.nodeAfter;if(!i.hasAttribute("linkHref")){return}if(!e){return}if(!e.hasAttribute("linkHref")){return}if(o&&o.hasAttribute("linkHref")){return}t.change(e=>{CE(e,n.manualDecorators)})},{priority:"low"})}_enableClickingAfterLink(){const e=this.editor;const t=e.commands.get("link");e.editing.view.addObserver(yA);let i=false;this.listenTo(e.editing.view.document,"mousedown",()=>{i=true});this.listenTo(e.editing.view.document,"selectionChange",()=>{if(!i){return}i=false;const n=e.model.document.selection;if(!n.isCollapsed){return}if(!n.hasAttribute("linkHref")){return}const o=n.getFirstPosition();const r=gP(o,"linkHref",n.getAttribute("linkHref"),e.model);if(o.isTouching(r.start)||o.isTouching(r.end)){e.model.change(e=>{CE(e,t.manualDecorators)})}})}_enableTypingOverLink(){const e=this.editor;const t=e.editing.view;let i;let n;this.listenTo(t.document,"delete",()=>{n=true},{priority:"high"});this.listenTo(e.model,"deleteContent",()=>{const t=e.model.document.selection;if(t.isCollapsed){return}if(n){n=false;return}if(!EE(e)){return}if(PE(e.model)){i=t.getAttributes()}},{priority:"high"});this.listenTo(e.model,"insertContent",(t,[o])=>{n=false;if(!EE(e)){return}if(!i){return}e.model.change(e=>{for(const[t,n]of i){e.setAttribute(t,n,o)}});i=null},{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor;const t=e.model;const i=t.document.selection;const n=e.editing.view;const o=e.commands.get("link");let r=false;let s=false;this.listenTo(n.document,"delete",(e,t)=>{s=t.domEvent.keyCode===zl.backspace},{priority:"high"});this.listenTo(t,"deleteContent",()=>{r=false;const e=i.getFirstPosition();const n=i.getAttribute("linkHref");if(!n){return}const o=gP(e,"linkHref",n,t);r=o.containsPosition(e)||o.end.isEqual(e)},{priority:"high"});this.listenTo(t,"deleteContent",()=>{if(!s){return}s=false;if(r){return}e.model.enqueueChange(e=>{CE(e,o.manualDecorators)})},{priority:"low"})}}function CE(e,t){e.removeSelectionAttribute("linkHref");for(const i of t){e.removeSelectionAttribute(i.id)}}function PE(e){const t=e.document.selection;const i=t.getFirstPosition();const n=t.getLastPosition();const o=i.nodeAfter;if(!o){return false}if(!o.is("$text")){return false}if(!o.hasAttribute("linkHref")){return false}const r=n.textNode||n.nodeBefore;if(o===r){return true}const s=gP(i,"linkHref",o.getAttribute("linkHref"),e);return s.containsRange(e.createRange(i,n),true)}function EE(e){const t=e.plugins.get("Input");return t.isInput(e.model.change(e=>e.batch))}class SE extends eh{constructor(e){super(e);this.domEventType="click"}onDomEvent(e){this.fire(e.type,e)}}var ME=i(92);class IE extends jb{constructor(e,t,i){super(e);const n=e.t;this.focusTracker=new Yp;this.keystrokes=new zp;this.urlInputView=this._createUrlInput(i);this.saveButtonView=this._createButton(n("Save"),$A,"ck-button-save");this.saveButtonView.type="submit";this.cancelButtonView=this._createButton(n("Cancel"),YA,"ck-button-cancel","cancel");this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t);this.children=this._createFormChildren(t.manualDecorators);this._focusables=new lb;this._focusCycler=new iw({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const o=["ck","ck-link-form"];if(t.manualDecorators.length){o.push("ck-link-form_layout-vertical")}this.setTemplate({tag:"form",attributes:{class:o,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>{e[t.name]=t.isOn;return e},{})}render(){super.render();qA({view:this});const e=[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView];e.forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)});this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(e="https://"){const t=this.locale.t;const i=new BA(this.locale,UA);i.label=t("Link URL");i.fieldView.placeholder=e+"example.com";return i}_createButton(e,t,i,n){const o=new Tw(this.locale);o.set({label:e,icon:t,tooltip:true});o.extendTemplate({attributes:{class:i}});if(n){o.delegate("execute").to(this,n)}return o}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const i of e.manualDecorators){const n=new Ow(this.locale);n.set({name:i.id,label:i.label,withText:true});n.bind("isOn").toMany([i,e],"value",(e,t)=>t===undefined&&e===undefined?i.defaultValue:e);n.on("execute",()=>{i.set("value",!n.isOn)});t.add(n)}return t}_createFormChildren(e){const t=this.createCollection();t.add(this.urlInputView);if(e.length){const e=new jb;e.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(e=>({tag:"li",children:[e],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}});t.add(e)}t.add(this.saveButtonView);t.add(this.cancelButtonView);return t}}var NE='';var OE='';var zE=i(94);class RE extends jb{constructor(e){super(e);const t=e.t;this.focusTracker=new Yp;this.keystrokes=new zp;this.previewButtonView=this._createPreviewButton();this.unlinkButtonView=this._createButton(t("Unlink"),NE,"unlink");this.editButtonView=this._createButton(t("Edit link"),OE,"edit");this.set("href");this._focusables=new lb;this._focusCycler=new iw({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render();const e=[this.previewButtonView,this.editButtonView,this.unlinkButtonView];e.forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)});this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(e,t,i){const n=new Tw(this.locale);n.set({label:e,icon:t,tooltip:true});n.delegate("execute").to(this,i);return n}_createPreviewButton(){const e=new Tw(this.locale);const t=this.bindTemplate;const i=this.t;e.set({withText:true,tooltip:i("Open link in new tab")});e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",e=>e&&hE(e)),target:"_blank",rel:"noopener noreferrer"}});e.bind("label").to(this,"href",e=>e||i("This link has no URL"));e.bind("isEnabled").to(this,"href",e=>!!e);e.template.tag="a";e.template.eventListeners={};return e}}var LE='';const DE=/^((\w+:(\/{2,})?)|(\W))/i;const VE=/[\w-]+@[\w-]+\.+[\w-]+/i;const jE="link-ui";class BE extends tk{static get requires(){return[tT]}static get pluginName(){return"LinkUI"}init(){const e=this.editor;e.editing.view.addObserver(SE);this.actionsView=this._createActionsView();this.formView=this._createFormView();this._balloon=e.plugins.get(tT);this._createToolbarLinkButton();this._enableUserBalloonInteractions();e.conversion.for("editingDowncast").markerToHighlight({model:jE,view:{classes:["ck-fake-link-selection"]}});e.conversion.for("editingDowncast").markerToElement({model:jE,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy();this.formView.destroy()}_createActionsView(){const e=this.editor;const t=new RE(e.locale);const i=e.commands.get("link");const n=e.commands.get("unlink");t.bind("href").to(i,"value");t.editButtonView.bind("isEnabled").to(i);t.unlinkButtonView.bind("isEnabled").to(n);this.listenTo(t,"edit",()=>{this._addFormView()});this.listenTo(t,"unlink",()=>{e.execute("unlink");this._hideUI()});t.keystrokes.set("Esc",(e,t)=>{this._hideUI();t()});t.keystrokes.set(lE,(e,t)=>{this._addFormView();t()});return t}_createFormView(){const e=this.editor;const t=e.commands.get("link");const i=e.config.get("link.defaultProtocol");const n=new IE(e.locale,t,i);n.urlInputView.fieldView.bind("value").to(t,"value");n.urlInputView.bind("isReadOnly").to(t,"isEnabled",e=>!e);n.saveButtonView.bind("isEnabled").to(t);this.listenTo(n,"submit",()=>{const{value:t}=n.urlInputView.fieldView.element;const o=!!i&&!DE.test(t);const r=VE.test(t);const s=r?"mailto:":i;const a=t&&o?s+t:t;e.execute("link",a,n.getDecoratorSwitchesState());this._closeFormView()});this.listenTo(n,"cancel",()=>{this._closeFormView()});n.keystrokes.set("Esc",(e,t)=>{this._closeFormView();t()});return n}_createToolbarLinkButton(){const e=this.editor;const t=e.commands.get("link");const i=e.t;e.keystrokes.set(lE,(e,t)=>{t();this._showUI(true)});e.ui.componentFactory.add("link",e=>{const n=new Tw(e);n.isEnabled=true;n.label=i("Link");n.icon=LE;n.keystroke=lE;n.tooltip=true;n.isToggleable=true;n.bind("isEnabled").to(t,"isEnabled");n.bind("isOn").to(t,"value",e=>!!e);this.listenTo(n,"execute",()=>this._showUI(true));return n})}_enableUserBalloonInteractions(){const e=this.editor.editing.view.document;this.listenTo(e,"click",()=>{const e=this._getSelectedLinkElement();if(e){this._showUI()}});this.editor.keystrokes.set("Tab",(e,t)=>{if(this._areActionsVisible&&!this.actionsView.focusTracker.isFocused){this.actionsView.focus();t()}},{priority:"high"});this.editor.keystrokes.set("Esc",(e,t)=>{if(this._isUIVisible){this._hideUI();t()}});zw({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){if(this._areActionsInPanel){return}this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel){return}const e=this.editor;const t=e.commands.get("link");this._balloon.add({view:this.formView,position:this._getBalloonPositionData()});if(this._balloon.visibleView===this.formView){this.formView.urlInputView.fieldView.select()}this.formView.urlInputView.fieldView.element.value=t.value||""}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates();if(e.value!==undefined){this._removeFormView()}else{this._hideUI()}}_removeFormView(){if(this._isFormInPanel){this.formView.saveButtonView.focus();this._balloon.remove(this.formView);this.editor.editing.view.focus();this._hideFakeVisualSelection()}}_showUI(e=false){if(!this._getSelectedLinkElement()){this._addActionsView();if(e){this._balloon.showStack("main")}this._addFormView();this._showFakeVisualSelection()}else{if(this._areActionsVisible){this._addFormView()}else{this._addActionsView()}if(e){this._balloon.showStack("main")}}this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel){return}const e=this.editor;this.stopListening(e.ui,"update");this.stopListening(this._balloon,"change:visibleView");e.editing.view.focus();this._removeFormView();this._balloon.remove(this.actionsView);this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor;const t=e.editing.view.document;let i=this._getSelectedLinkElement();let n=r();const o=()=>{const e=this._getSelectedLinkElement();const t=r();if(i&&!e||!i&&t!==n){this._hideUI()}else if(this._isUIVisible){this._balloon.updatePosition(this._getBalloonPositionData())}i=e;n=t};function r(){return t.selection.focus.getAncestors().reverse().find(e=>e.is("element"))}this.listenTo(e.ui,"update",o);this.listenTo(this._balloon,"change:visibleView",o)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const e=this._balloon.visibleView;return e==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view;const t=e.document;const i=this._getSelectedLinkElement();const n=i?e.domConverter.mapViewToDom(i):e.domConverter.viewRangeToDom(t.selection.getFirstRange());return{target:n}}_getSelectedLinkElement(){const e=this.editor.editing.view;const t=e.document.selection;if(t.isCollapsed){return FE(t.getFirstPosition())}else{const i=t.getFirstRange().getTrimmed();const n=FE(i.start);const o=FE(i.end);if(!n||n!=o){return null}if(e.createRangeIn(n).getTrimmed().isEqual(i)){return n}else{return null}}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{if(e.markers.has(jE)){t.updateMarker(jE,{range:e.document.selection.getFirstRange()})}else{t.addMarker(jE,{usingOperation:false,affectsData:false,range:e.document.selection.getFirstRange()})}})}_hideFakeVisualSelection(){const e=this.editor.model;if(e.markers.has(jE)){e.change(e=>{e.removeMarker(jE)})}}}function FE(e){return e.getAncestors().find(e=>dE(e))}class HE extends tk{static get requires(){return[TE,BE]}static get pluginName(){return"Link"}}class UE extends nk{constructor(e,t){super(e);this.type=t}refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;const t=e.document;const i=Array.from(t.selection.getSelectedBlocks()).filter(t=>qE(t,e.schema));const n=this.value===true;e.change(e=>{if(n){let t=i[i.length-1].nextSibling;let n=Number.POSITIVE_INFINITY;let o=[];while(t&&t.name=="listItem"&&t.getAttribute("listIndent")!==0){const e=t.getAttribute("listIndent");if(e=i){if(r>o.getAttribute("listIndent")){r=o.getAttribute("listIndent")}if(o.getAttribute("listIndent")==r){e[t?"unshift":"push"](o)}o=o[t?"previousSibling":"nextSibling"]}}}function qE(e,t){return t.checkChild(e.parent,"listItem")&&!t.isObject(e)}class $E extends nk{constructor(e,t){super(e);this._indentBy=t=="forward"?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;const t=e.document;let i=Array.from(t.selection.getSelectedBlocks());e.change(e=>{const t=i[i.length-1];let n=t.nextSibling;while(n&&n.name=="listItem"&&n.getAttribute("listIndent")>t.getAttribute("listIndent")){i.push(n);n=n.nextSibling}if(this._indentBy<0){i=i.reverse()}for(const t of i){const i=t.getAttribute("listIndent")+this._indentBy;if(i<0){e.rename(t,"paragraph")}else{e.setAttribute("listIndent",i,t)}}})}_checkEnabled(){const e=rk(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("element","listItem")){return false}if(this._indentBy>0){const t=e.getAttribute("listIndent");const i=e.getAttribute("listType");let n=e.previousSibling;while(n&&n.is("element","listItem")&&n.getAttribute("listIndent")>=t){if(n.getAttribute("listIndent")==t){return n.getAttribute("listType")==i}n=n.previousSibling}return false}return true}}function YE(e){const t=e.createContainerElement("li");t.getFillerOffset=tS;return t}function GE(e,t){const i=t.mapper;const n=t.writer;const o=e.getAttribute("listType")=="numbered"?"ol":"ul";const r=YE(n);const s=n.createContainerElement(o,null);n.insert(n.createPositionAt(s,0),r);i.bindElements(e,r);return r}function KE(e,t,i,n){const o=t.parent;const r=i.mapper;const s=i.writer;let a=r.toViewPosition(n.createPositionBefore(e));const c=ZE(e.previousSibling,{sameIndent:true,smallerIndent:true,listIndent:e.getAttribute("listIndent")});const l=e.previousSibling;if(c&&c.getAttribute("listIndent")==e.getAttribute("listIndent")){const e=r.toViewElement(c);a=s.breakContainer(s.createPositionAfter(e))}else{if(l&&l.name=="listItem"){a=r.toViewPosition(n.createPositionAt(l,"end"));const e=r.findMappedViewAncestor(a);const t=eS(e);if(t){a=s.createPositionBefore(t)}else{a=s.createPositionAt(e,"end")}}else{a=r.toViewPosition(n.createPositionBefore(e))}}a=JE(a);s.insert(a,o);if(l&&l.name=="listItem"){const e=r.toViewElement(l);const i=s.createRange(s.createPositionAt(e,0),a);const n=i.getWalker({ignoreElementEnd:true});for(const e of n){if(e.item.is("element","li")){const i=s.breakContainer(s.createPositionBefore(e.item));const o=e.item.parent;const r=s.createPositionAt(t,"end");QE(s,r.nodeBefore,r.nodeAfter);s.move(s.createRangeOn(o),r);n.position=i}}}else{const i=o.nextSibling;if(i&&(i.is("element","ul")||i.is("element","ol"))){let n=null;for(const t of i.getChildren()){const i=r.toModelElement(t);if(i&&i.getAttribute("listIndent")>e.getAttribute("listIndent")){n=t}else{break}}if(n){s.breakContainer(s.createPositionAfter(n));s.move(s.createRangeOn(n.parent),s.createPositionAt(t,"end"))}}}QE(s,o,o.nextSibling);QE(s,o.previousSibling,o)}function QE(e,t,i){if(!t||!i||t.name!="ul"&&t.name!="ol"){return null}if(t.name!=i.name||t.getAttribute("class")!==i.getAttribute("class")){return null}return e.mergeContainers(e.createPositionAfter(t))}function JE(e){return e.getLastMatchingPosition(e=>e.item.is("uiElement"))}function ZE(e,t){const i=!!t.sameIndent;const n=!!t.smallerIndent;const o=t.listIndent;let r=e;while(r&&r.name=="listItem"){const e=r.getAttribute("listIndent");if(i&&o==e||n&&o>e){return r}r=r.previousSibling}return null}function XE(e,t,i,n){e.ui.componentFactory.add(t,o=>{const r=e.commands.get(t);const s=new Tw(o);s.set({label:i,icon:n,tooltip:true,isToggleable:true});s.bind("isOn","isEnabled").to(r,"value","isEnabled");s.on("execute",()=>{e.execute(t);e.editing.view.focus()});return s})}function eS(e){for(const t of e.getChildren()){if(t.name=="ul"||t.name=="ol"){return t}}return null}function tS(){const e=!this.isEmpty&&(this.getChild(0).name=="ul"||this.getChild(0).name=="ol");if(this.isEmpty||e){return 0}return Uc.call(this)}function iS(e){return(t,i,n)=>{const o=n.consumable;if(!o.test(i.item,"insert")||!o.test(i.item,"attribute:listType")||!o.test(i.item,"attribute:listIndent")){return}o.consume(i.item,"insert");o.consume(i.item,"attribute:listType");o.consume(i.item,"attribute:listIndent");const r=i.item;const s=GE(r,n);KE(r,s,n,e)}}function nS(e){return(t,i,n)=>{const o=n.mapper.toViewPosition(i.position);const r=o.getLastMatchingPosition(e=>!e.item.is("element","li"));const s=r.nodeAfter;const a=n.writer;a.breakContainer(a.createPositionBefore(s));a.breakContainer(a.createPositionAfter(s));const c=s.parent;const l=c.previousSibling;const d=a.createRangeOn(c);const u=a.remove(d);if(l&&l.nextSibling){QE(a,l,l.nextSibling)}const h=n.mapper.toModelElement(s);wS(h.getAttribute("listIndent")+1,i.position,d.start,s,n,e);for(const e of a.createRangeIn(u).getItems()){n.mapper.unbindViewElement(e)}t.stop()}}function oS(e,t,i){if(!i.consumable.consume(t.item,"attribute:listType")){return}const n=i.mapper.toViewElement(t.item);const o=i.writer;o.breakContainer(o.createPositionBefore(n));o.breakContainer(o.createPositionAfter(n));const r=n.parent;const s=t.attributeNewValue=="numbered"?"ol":"ul";o.rename(s,r)}function rS(e,t,i){const n=i.mapper.toViewElement(t.item);const o=n.parent;const r=i.writer;QE(r,o,o.nextSibling);QE(r,o.previousSibling,o);for(const e of t.item.getChildren()){i.consumable.consume(e,"insert")}}function sS(e){return(t,i,n)=>{if(!n.consumable.consume(i.item,"attribute:listIndent")){return}const o=n.mapper.toViewElement(i.item);const r=n.writer;r.breakContainer(r.createPositionBefore(o));r.breakContainer(r.createPositionAfter(o));const s=o.parent;const a=s.previousSibling;const c=r.createRangeOn(s);r.remove(c);if(a&&a.nextSibling){QE(r,a,a.nextSibling)}wS(i.attributeOldValue+1,i.range.start,c.start,o,n,e);KE(i.item,o,n,e);for(const e of i.item.getChildren()){n.consumable.consume(e,"insert")}}}function aS(e,t,i){if(t.item.name!="listItem"){let e=i.mapper.toViewPosition(t.range.start);const n=i.writer;const o=[];while(e.parent.name=="ul"||e.parent.name=="ol"){e=n.breakContainer(e);if(e.parent.name!="li"){break}const t=e;const i=n.createPositionAt(e.parent,"end");if(!t.isEqual(i)){const e=n.remove(n.createRange(t,i));o.push(e)}e=n.createPositionAfter(e.parent)}if(o.length>0){for(let t=0;t0){const t=QE(n,i,i.nextSibling);if(t&&t.parent==i){e.offset--}}}QE(n,e.nodeBefore,e.nodeAfter)}}}function cS(e,t,i){const n=i.mapper.toViewPosition(t.position);const o=n.nodeBefore;const r=n.nodeAfter;QE(i.writer,o,r)}function lS(e,t,i){if(i.consumable.consume(t.viewItem,{name:true})){const e=i.writer;const n=e.createElement("listItem");const o=_S(t.viewItem);e.setAttribute("listIndent",o,n);const r=t.viewItem.parent&&t.viewItem.parent.name=="ol"?"numbered":"bulleted";e.setAttribute("listType",r,n);const s=i.splitToAllowedParent(n,t.modelCursor);if(!s){return}e.insert(n,s.position);const a=pS(n,t.viewItem.getChildren(),i);t.modelRange=e.createRange(t.modelCursor,a);if(s.cursorParent){t.modelCursor=e.createPositionAt(s.cursorParent,0)}else{t.modelCursor=t.modelRange.end}}}function dS(e,t,i){if(i.consumable.test(t.viewItem,{name:true})){const e=Array.from(t.viewItem.getChildren());for(const t of e){const e=!(t.is("element","li")||kS(t));if(e){t._remove()}}}}function uS(e,t,i){if(i.consumable.test(t.viewItem,{name:true})){if(t.viewItem.childCount===0){return}const e=[...t.viewItem.getChildren()];let i=false;let n=true;for(const t of e){if(i&&!kS(t)){t._remove()}if(t.is("$text")){if(n){t._data=t.data.replace(/^\s+/,"")}if(!t.nextSibling||kS(t.nextSibling)){t._data=t.data.replace(/\s+$/,"")}}else if(kS(t)){i=true}n=false}}}function hS(e){return(t,i)=>{if(i.isPhantom){return}const n=i.modelPosition.nodeBefore;if(n&&n.is("element","listItem")){const t=i.mapper.toViewElement(n);const o=t.getAncestors().find(kS);const r=e.createPositionAt(t,0).getWalker();for(const e of r){if(e.type=="elementStart"&&e.item.is("element","li")){i.viewPosition=e.previousPosition;break}else if(e.type=="elementEnd"&&e.item==o){i.viewPosition=e.nextPosition;break}}}}}function fS(e){return(t,i)=>{const n=i.viewPosition;const o=n.parent;const r=i.mapper;if(o.name=="ul"||o.name=="ol"){if(!n.isAtEnd){const t=r.toModelElement(n.nodeAfter);i.modelPosition=e.createPositionBefore(t)}else{const t=r.toModelElement(n.nodeBefore);const o=r.getModelLength(n.nodeBefore);i.modelPosition=e.createPositionBefore(t).getShiftedBy(o)}t.stop()}else if(o.name=="li"&&n.nodeBefore&&(n.nodeBefore.name=="ul"||n.nodeBefore.name=="ol")){const s=r.toModelElement(o);let a=1;let c=n.nodeBefore;while(c&&kS(c)){a+=r.getModelLength(c);c=c.previousSibling}i.modelPosition=e.createPositionBefore(s).getShiftedBy(a);t.stop()}}}function mS(e,t){const i=e.document.differ.getChanges();const n=new Map;let o=false;for(const n of i){if(n.type=="insert"&&n.name=="listItem"){r(n.position)}else if(n.type=="insert"&&n.name!="listItem"){if(n.name!="$text"){const i=n.position.nodeAfter;if(i.hasAttribute("listIndent")){t.removeAttribute("listIndent",i);o=true}if(i.hasAttribute("listType")){t.removeAttribute("listType",i);o=true}for(const t of Array.from(e.createRangeIn(i)).filter(e=>e.item.is("element","listItem"))){r(t.previousPosition)}}const i=n.position.getShiftedBy(n.length);r(i)}else if(n.type=="remove"&&n.name=="listItem"){r(n.position)}else if(n.type=="attribute"&&n.attributeKey=="listIndent"){r(n.range.start)}else if(n.type=="attribute"&&n.attributeKey=="listType"){r(n.range.start)}}for(const e of n.values()){s(e);a(e)}return o;function r(e){const t=e.nodeBefore;if(!t||!t.is("element","listItem")){const t=e.nodeAfter;if(t&&t.is("element","listItem")){n.set(t,t)}}else{let e=t;if(n.has(e)){return}for(let t=e.previousSibling;t&&t.is("element","listItem");t=e.previousSibling){e=t;if(n.has(e)){return}}n.set(t,e)}}function s(e){let i=0;let n=null;while(e&&e.is("element","listItem")){const r=e.getAttribute("listIndent");if(r>i){let s;if(n===null){n=r-i;s=i}else{if(n>r){n=r}s=r-n}t.setAttribute("listIndent",s,e);o=true}else{n=null;i=e.getAttribute("listIndent")+1}e=e.nextSibling}}function a(e){let i=[];let n=null;while(e&&e.is("element","listItem")){const r=e.getAttribute("listIndent");if(n&&n.getAttribute("listIndent")>r){i=i.slice(0,r+1)}if(r!=0){if(i[r]){const n=i[r];if(e.getAttribute("listType")!=n){t.setAttribute("listType",n,e);o=true}}else{i[r]=e.getAttribute("listType")}}n=e;e=e.nextSibling}}}function gS(e,[t,i]){let n=t.is("documentFragment")?t.getChild(0):t;let o;if(!i){o=this.document.selection}else{o=this.createSelection(i)}if(n&&n.is("element","listItem")){const e=o.getFirstPosition();let t=null;if(e.parent.is("element","listItem")){t=e.parent}else if(e.nodeBefore&&e.nodeBefore.is("element","listItem")){t=e.nodeBefore}if(t){const e=t.getAttribute("listIndent");if(e>0){while(n&&n.is("element","listItem")){n._setAttribute("listIndent",n.getAttribute("listIndent")+e);n=n.nextSibling}}}}}function pS(e,t,i){const{writer:n,schema:o}=i;let r=n.createPositionAfter(e);for(const s of t){if(s.name=="ul"||s.name=="ol"){r=i.convertItem(s,r).modelCursor}else{const t=i.convertItem(s,n.createPositionAt(e,"end"));const a=t.modelRange.start.nodeAfter;const c=a&&a.is("element")&&!o.checkChild(e,a.name);if(c){if(t.modelCursor.parent.is("element","listItem")){e=t.modelCursor.parent}else{e=bS(t.modelCursor)}r=n.createPositionAfter(e)}}}return r}function bS(e){const t=new Gh({startPosition:e});let i;do{i=t.next()}while(!i.value.item.is("element","listItem"));return i.value.item}function wS(e,t,i,n,o,r){const s=ZE(t.nodeBefore,{sameIndent:true,smallerIndent:true,listIndent:e,foo:"b"});const a=o.mapper;const c=o.writer;const l=s?s.getAttribute("listIndent"):null;let d;if(!s){d=i}else if(l==e){const e=a.toViewElement(s).parent;d=c.createPositionAfter(e)}else{const e=r.createPositionAt(s,"end");d=a.toViewPosition(e)}d=JE(d);for(const e of[...n.getChildren()]){if(kS(e)){d=c.move(c.createRangeOn(e),d).end;QE(c,e,e.nextSibling);QE(c,e.previousSibling,e)}}}function kS(e){return e.is("element","ol")||e.is("element","ul")}function _S(e){let t=0;let i=e.parent;while(i){if(i.is("element","li")){t++}else{const e=i.previousSibling;if(e&&e.is("element","li")){t++}}i=i.parent}return t}class vS extends tk{static get pluginName(){return"ListEditing"}static get requires(){return[Yy]}init(){const e=this.editor;e.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const t=e.data;const i=e.editing;e.model.document.registerPostFixer(t=>mS(e.model,t));i.mapper.registerViewToModelLength("li",yS);t.mapper.registerViewToModelLength("li",yS);i.mapper.on("modelToViewPosition",hS(i.view));i.mapper.on("viewToModelPosition",fS(e.model));t.mapper.on("modelToViewPosition",hS(i.view));e.conversion.for("editingDowncast").add(t=>{t.on("insert",aS,{priority:"high"});t.on("insert:listItem",iS(e.model));t.on("attribute:listType:listItem",oS,{priority:"high"});t.on("attribute:listType:listItem",rS,{priority:"low"});t.on("attribute:listIndent:listItem",sS(e.model));t.on("remove:listItem",nS(e.model));t.on("remove",cS,{priority:"low"})});e.conversion.for("dataDowncast").add(t=>{t.on("insert",aS,{priority:"high"});t.on("insert:listItem",iS(e.model))});e.conversion.for("upcast").add(e=>{e.on("element:ul",dS,{priority:"high"});e.on("element:ol",dS,{priority:"high"});e.on("element:li",uS,{priority:"high"});e.on("element:li",lS)});e.model.on("insertContent",gS,{priority:"high"});e.commands.add("numberedList",new UE(e,"numbered"));e.commands.add("bulletedList",new UE(e,"bulleted"));e.commands.add("indentList",new $E(e,"forward"));e.commands.add("outdentList",new $E(e,"backward"));const n=i.view.document;this.listenTo(n,"enter",(e,t)=>{const i=this.editor.model.document;const n=i.selection.getLastPosition().parent;if(i.selection.isCollapsed&&n.name=="listItem"&&n.isEmpty){this.editor.execute("outdentList");t.preventDefault();e.stop()}});this.listenTo(n,"delete",(e,t)=>{if(t.direction!=="backward"){return}const i=this.editor.model.document.selection;if(!i.isCollapsed){return}const n=i.getFirstPosition();if(!n.isAtStart){return}const o=n.parent;if(o.name!=="listItem"){return}const r=o.previousSibling&&o.previousSibling.name==="listItem";if(r){return}this.editor.execute("outdentList");t.preventDefault();e.stop()},{priority:"high"});const o=e=>(t,i)=>{const n=this.editor.commands.get(e);if(n.isEnabled){this.editor.execute(e);i()}};e.keystrokes.set("Tab",o("indentList"));e.keystrokes.set("Shift+Tab",o("outdentList"))}afterInit(){const e=this.editor.commands;const t=e.get("indent");const i=e.get("outdent");if(t){t.registerChildCommand(e.get("indentList"))}if(i){i.registerChildCommand(e.get("outdentList"))}}}function yS(e){let t=1;for(const i of e.getChildren()){if(i.name=="ul"||i.name=="ol"){for(const e of i.getChildren()){t+=yS(e)}}}return t}var xS='';var AS='';class TS extends tk{init(){const e=this.editor.t;XE(this.editor,"numberedList",e("Numbered List"),xS);XE(this.editor,"bulletedList",e("Bulleted List"),AS)}}class CS extends tk{static get requires(){return[vS,TS]}static get pluginName(){return"List"}}function PS(e,t){return e=>{e.on("attribute:url:media",i)};function i(i,n,o){if(!o.consumable.consume(n.item,i.name)){return}const r=n.attributeNewValue;const s=o.writer;const a=o.mapper.toViewElement(n.item);const c=[...a.getChildren()].find(e=>e.getCustomProperty("media-content"));s.remove(c);const l=e.getMediaViewElement(s,r,t);s.insert(s.createPositionAt(a,0),l)}}function ES(e,t,i){t.setCustomProperty("media",true,e);return Dx(e,t,{label:i})}function SS(e){const t=e.getSelectedElement();if(t&&MS(t)){return t}return null}function MS(e){return!!e.getCustomProperty("media")&&Lx(e)}function IS(e,t,i,n){const o=e.createContainerElement("figure",{class:"media"});e.insert(e.createPositionAt(o,0),t.getMediaViewElement(e,i,n));return o}function NS(e){const t=e.getSelectedElement();if(t&&t.is("element","media")){return t}return null}function OS(e,t,i){e.change(n=>{const o=n.createElement("media",{url:t});e.insertContent(o,i);n.setSelection(o,"on")})}class zS extends nk{refresh(){const e=this.editor.model;const t=e.document.selection;const i=e.schema;const n=t.getFirstPosition();const o=NS(t);let r=n.parent;if(r!=r.root){r=r.parent}this.value=o?o.getAttribute("url"):null;this.isEnabled=i.checkChild(r,"media")}execute(e){const t=this.editor.model;const i=t.document.selection;const n=NS(i);if(n){t.change(t=>{t.setAttribute("url",e,n)})}else{const n=Hx(i,t);OS(t,e,n)}}}var RS='';const LS="0 0 64 42";class DS{constructor(e,t){const i=t.providers;const n=t.extraProviders||[];const o=new Set(t.removeProviders);const r=i.concat(n).filter(e=>{const t=e.name;if(!t){console.warn(Object(ss["a"])("media-embed-no-provider-name: The configured media provider has no name and cannot be used."),{provider:e});return false}return!o.has(t)});this.locale=e;this.providerDefinitions=r}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,i){return this._getMedia(t).getViewElement(e,i)}_getMedia(e){if(!e){return new VS(this.locale)}e=e.trim();for(const t of this.providerDefinitions){const i=t.html;let n=t.url;if(!Array.isArray(n)){n=[n]}for(const t of n){const n=this._getUrlMatches(e,t);if(n){return new VS(this.locale,e,n,i)}}}return null}_getUrlMatches(e,t){let i=e.match(t);if(i){return i}let n=e.replace(/^https?:\/\//,"");i=n.match(t);if(i){return i}n=n.replace(/^www\./,"");i=n.match(t);if(i){return i}return null}}class VS{constructor(e,t,i,n){this.url=this._getValidUrl(t);this._t=e.t;this._match=i;this._previewRenderer=n}getViewElement(e,t){const i={};let n;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){if(this.url){i["data-oembed-url"]=this.url}if(t.renderForEditingView){i.class="ck-media__wrapper"}const o=this._getPreviewHtml(t);n=e.createRawElement("div",i,(function(e){e.innerHTML=o}))}else{if(this.url){i.url=this.url}n=e.createEmptyElement("oembed",i)}e.setCustomProperty("media-content",true,n);return n}_getPreviewHtml(e){if(this._previewRenderer){return this._previewRenderer(this._match)}else{if(this.url&&e.renderForEditingView){return this._getPlaceholderHtml()}return""}}_getPlaceholderHtml(){const e=new xw;const t=new vw;e.text=this._t("Open media in new tab");t.content=RS;t.viewBox=LS;const i=new hb({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();return i.outerHTML}_getValidUrl(e){if(!e){return null}if(e.match(/^https?/)){return e}return"https://"+e}}var jS=i(96);class BS extends tk{static get pluginName(){return"MediaEmbedEditing"}constructor(e){super(e);e.config.define("mediaEmbed",{providers:[{name:"dailymotion",url:/^dailymotion\.com\/video\/(\w+)/,html:e=>{const t=e[1];return'
'+`"+"
"}},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:e=>{const t=e[1];return'
'+`"+"
"}},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)/,/^youtube\.com\/embed\/([\w-]+)/,/^youtu\.be\/([\w-]+)/],html:e=>{const t=e[1];return'
'+`"+"
"}},{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=>{const t=e[1];return'
'+`"+"
"}},{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 DS(e.locale,e.config.get("mediaEmbed"))}init(){const e=this.editor;const t=e.model.schema;const i=e.t;const n=e.conversion;const o=e.config.get("mediaEmbed.previewsInData");const r=this.registry;e.commands.add("mediaEmbed",new zS(e));t.register("media",{isObject:true,isBlock:true,allowWhere:"$block",allowAttributes:["url"]});n.for("dataDowncast").elementToElement({model:"media",view:(e,t)=>{const i=e.getAttribute("url");return IS(t,r,i,{renderMediaPreview:i&&o})}});n.for("dataDowncast").add(PS(r,{renderMediaPreview:o}));n.for("editingDowncast").elementToElement({model:"media",view:(e,t)=>{const n=e.getAttribute("url");const o=IS(t,r,n,{renderForEditingView:true});return ES(o,t,i("media widget"))}});n.for("editingDowncast").add(PS(r,{renderForEditingView:true}));n.for("upcast").elementToElement({view:{name:"oembed",attributes:{url:true}},model:(e,t)=>{const i=e.getAttribute("url");if(r.hasMedia(i)){return t.createElement("media",{url:i})}}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":true}},model:(e,t)=>{const i=e.getAttribute("data-oembed-url");if(r.hasMedia(i)){return t.createElement("media",{url:i})}}})}}const FS=/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=]+$/;class HS extends tk{static get requires(){return[n_,dv]}static get pluginName(){return"AutoMediaEmbed"}constructor(e){super(e);this._timeoutId=null;this._positionToInsert=null}init(){const e=this.editor;const t=e.model.document;this.listenTo(e.plugins.get(n_),"inputTransformation",()=>{const e=t.selection.getFirstRange();const i=Gg.fromPosition(e.start);i.stickiness="toPrevious";const n=Gg.fromPosition(e.end);n.stickiness="toNext";t.once("change:data",()=>{this._embedMediaBetweenPositions(i,n);i.detach();n.detach()},{priority:"high"})});e.commands.get("undo").on("execute",()=>{if(this._timeoutId){Dd.window.clearTimeout(this._timeoutId);this._positionToInsert.detach();this._timeoutId=null;this._positionToInsert=null}},{priority:"high"})}_embedMediaBetweenPositions(e,t){const i=this.editor;const n=i.plugins.get(BS).registry;const o=new ff(e,t);const r=o.getWalker({ignoreElementEnd:true});let s="";for(const e of r){if(e.item.is("$textProxy")){s+=e.item.data}}s=s.trim();if(!s.match(FS)){o.detach();return}if(!n.hasMedia(s)){o.detach();return}const a=i.commands.get("mediaEmbed");if(!a.isEnabled){o.detach();return}this._positionToInsert=Gg.fromPosition(e);this._timeoutId=Dd.window.setTimeout(()=>{i.model.change(e=>{this._timeoutId=null;e.remove(o);o.detach();let t;if(this._positionToInsert.root.rootName!=="$graveyard"){t=this._positionToInsert}OS(i.model,s,t);this._positionToInsert.detach();this._positionToInsert=null})},100)}}var US=i(98);class WS extends jb{constructor(e,t){super(t);const i=t.t;this.focusTracker=new Yp;this.keystrokes=new zp;this.urlInputView=this._createUrlInput();this.saveButtonView=this._createButton(i("Save"),$A,"ck-button-save");this.saveButtonView.type="submit";this.cancelButtonView=this._createButton(i("Cancel"),YA,"ck-button-cancel","cancel");this._focusables=new lb;this._focusCycler=new iw({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();qA({view:this});const e=[this.urlInputView,this.saveButtonView,this.cancelButtonView];e.forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)});this.keystrokes.listenTo(this.element);const t=e=>e.stopPropagation();this.keystrokes.set("arrowright",t);this.keystrokes.set("arrowleft",t);this.keystrokes.set("arrowup",t);this.keystrokes.set("arrowdown",t);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){this.urlInputView.errorText=t;return false}}return true}resetFormStatus(){this.urlInputView.errorText=null;this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t;const t=new BA(this.locale,UA);const i=t.fieldView;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;i.placeholder="https://example.com";i.on("input",()=>{t.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault});return t}_createButton(e,t,i,n){const o=new Tw(this.locale);o.set({label:e,icon:t,tooltip:true});o.extendTemplate({attributes:{class:i}});if(n){o.delegate("execute").to(this,n)}return o}}var qS='';class $S extends tk{static get requires(){return[BS]}static get pluginName(){return"MediaEmbedUI"}init(){const e=this.editor;const t=e.commands.get("mediaEmbed");const i=e.plugins.get(BS).registry;e.ui.componentFactory.add("mediaEmbed",n=>{const o=Dw(n);const r=new WS(YS(e.t,i),e.locale);this._setUpDropdown(o,r,t,e);this._setUpForm(o,r,t);return o})}_setUpDropdown(e,t,i){const n=this.editor;const o=n.t;const r=e.buttonView;e.bind("isEnabled").to(i);e.panelView.children.add(t);r.set({label:o("Insert media"),icon:qS,tooltip:true});r.on("open",()=>{t.url=i.value||"";t.urlInputView.fieldView.select();t.focus()},{priority:"low"});e.on("submit",()=>{if(t.isValid()){n.execute("mediaEmbed",t.url);s()}});e.on("change:isOpen",()=>t.resetFormStatus());e.on("cancel",()=>s());function s(){n.editing.view.focus();e.isOpen=false}}_setUpForm(e,t,i){t.delegate("submit","cancel").to(e);t.urlInputView.bind("value").to(i,"value");t.urlInputView.bind("isReadOnly").to(i,"isEnabled",e=>!e);t.saveButtonView.bind("isEnabled").to(i)}}function YS(e,t){return[t=>{if(!t.url.length){return e("The URL must not be empty.")}},i=>{if(!t.hasMedia(i.url)){return e("This media URL is not supported.")}}]}var GS=i(100);class KS extends tk{static get requires(){return[BS,$S,HS,zA]}static get pluginName(){return"MediaEmbed"}}class QS extends tk{static get requires(){return[MC]}static get pluginName(){return"SimpleUploadAdapter"}init(){const e=this.editor.config.get("simpleUpload");if(!e){return}if(!e.uploadUrl){console.warn(Object(ss["a"])('simple-upload-adapter-missing-uploadUrl: Missing the "uploadUrl" property in the "simpleUpload" editor configuration.'));return}this.editor.plugins.get(MC).createUploadAdapter=t=>new JS(t,e)}}class JS{constructor(e,t){this.loader=e;this.options=t}upload(){return this.loader.file.then(e=>new Promise((t,i)=>{this._initRequest();this._initListeners(t,i,e);this._sendRequest(e)}))}abort(){if(this.xhr){this.xhr.abort()}}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.options.uploadUrl,true);e.responseType=""}_initListeners(e,t,i){const n=this.xhr;const o=this.loader;n.addEventListener("error",(e)=>notif("error",n.statusText, "Impossible d'exporter l'image" ));n.addEventListener("abort",()=>t());n.addEventListener("load",()=>{console.log(n.responseText);const i=n.responseText.substring(n.responseText.indexOf('[DIV]')+5).replace(" ","%20");if(i.includes('error')){notif("error",i.substring(6), "Impossible d'exporter l'image" ); return null;}console.log(i);e({default:i})});if(n.upload){n.upload.addEventListener("progress",e=>{if(e.lengthComputable){o.uploadTotal=e.total;o.uploaded=e.loaded}})}}_sendRequest(e){const t=this.options.headers||{};const i=this.options.withCredentials||false;for(const e of Object.keys(t)){this.xhr.setRequestHeader(e,t[e])}this.xhr.withCredentials=i;const n=new FormData;n.append("upload",e);this.xhr.send(n)}}const ZS="todoListChecked";class XS extends nk{constructor(e){super(e);this._selectedElements=[];this.on("execute",()=>{this.refresh()},{priority:"highest"})}refresh(){this._selectedElements=this._getSelectedItems();this.value=this._selectedElements.every(e=>!!e.getAttribute("todoListChecked"));this.isEnabled=!!this._selectedElements.length}_getSelectedItems(){const e=this.editor.model;const t=e.schema;const i=e.document.selection.getFirstRange();const n=i.start.parent;const o=[];if(t.checkAttribute(n,ZS)){o.push(n)}for(const e of i.getItems()){if(t.checkAttribute(e,ZS)&&!o.includes(e)){o.push(e)}}return o}execute(e={}){this.editor.model.change(t=>{for(const i of this._selectedElements){const n=e.forceValue===undefined?!this.value:e.forceValue;if(n){t.setAttribute(ZS,true,i)}else{t.removeAttribute(ZS,i)}}})}}function eM(e,t){return(i,n,o)=>{const r=o.consumable;if(!r.test(n.item,"insert")||!r.test(n.item,"attribute:listType")||!r.test(n.item,"attribute:listIndent")){return}if(n.item.getAttribute("listType")!="todo"){return}const s=n.item;r.consume(s,"insert");r.consume(s,"attribute:listType");r.consume(s,"attribute:listIndent");r.consume(s,"attribute:todoListChecked");const a=o.writer;const c=GE(s,o);const l=!!s.getAttribute("todoListChecked");const d=sM(s,a,l,t);const u=a.createContainerElement("span",{class:"todo-list__label__description"});a.addClass("todo-list",c.parent);a.insert(a.createPositionAt(c,0),d);a.insert(a.createPositionAfter(d),u);KE(s,c,o,e)}}function tM(e){return(t,i,n)=>{const o=n.consumable;if(!o.test(i.item,"insert")||!o.test(i.item,"attribute:listType")||!o.test(i.item,"attribute:listIndent")){return}if(i.item.getAttribute("listType")!="todo"){return}const r=i.item;o.consume(r,"insert");o.consume(r,"attribute:listType");o.consume(r,"attribute:listIndent");o.consume(r,"attribute:todoListChecked");const s=n.writer;const a=GE(r,n);s.addClass("todo-list",a.parent);const c=s.createContainerElement("label",{class:"todo-list__label"});const l=s.createEmptyElement("input",{type:"checkbox",disabled:"disabled"});const d=s.createContainerElement("span",{class:"todo-list__label__description"});if(r.getAttribute("todoListChecked")){s.setAttribute("checked","checked",l)}s.insert(s.createPositionAt(a,0),c);s.insert(s.createPositionAt(c,0),l);s.insert(s.createPositionAfter(l),d);KE(r,a,n,e)}}function iM(e,t,i){const n=t.modelCursor;const o=n.parent;const r=t.viewItem;if(r.getAttribute("type")!="checkbox"||o.name!="listItem"||!n.isAtStart){return}if(!i.consumable.consume(r,{name:true})){return}const s=i.writer;s.setAttribute("listType","todo",o);if(t.viewItem.hasAttribute("checked")){s.setAttribute("todoListChecked",true,o)}t.modelRange=s.createRange(n)}function nM(e,t){return(i,n,o)=>{const r=o.mapper.toViewElement(n.item);const s=o.writer;const a=aM(r,t);if(n.attributeNewValue=="todo"){const t=!!n.item.getAttribute("todoListChecked");const i=sM(n.item,s,t,e);const o=s.createContainerElement("span",{class:"todo-list__label__description"});const a=s.createRangeIn(r);const c=eS(r);const l=JE(a.start);const d=c?s.createPositionBefore(c):a.end;const u=s.createRange(l,d);s.addClass("todo-list",r.parent);s.move(u,s.createPositionAt(o,0));s.insert(s.createPositionAt(r,0),i);s.insert(s.createPositionAfter(i),o)}else if(n.attributeOldValue=="todo"){const e=cM(r,t);s.removeClass("todo-list",r.parent);s.remove(a);s.move(s.createRangeIn(e),s.createPositionBefore(e));s.remove(e)}}}function oM(e){return(t,i,n)=>{if(i.item.getAttribute("listType")!="todo"){return}if(!n.consumable.consume(i.item,"attribute:todoListChecked")){return}const{mapper:o,writer:r}=n;const s=!!i.item.getAttribute("todoListChecked");const a=o.toViewElement(i.item);const c=a.getChild(0);const l=sM(i.item,r,s,e);r.insert(r.createPositionAfter(c),l);r.remove(c)}}function rM(e){return(t,i)=>{const n=i.modelPosition;const o=n.parent;if(!o.is("element","listItem")||o.getAttribute("listType")!="todo"){return}const r=i.mapper.toViewElement(o);const s=cM(r,e);if(s){i.viewPosition=i.mapper.findPositionIn(s,n.offset)}}}function sM(e,t,i,n){const o=t.createUIElement("label",{class:"todo-list__label",contenteditable:false},(function(t){const o=Ub(document,"input",{type:"checkbox"});if(i){o.setAttribute("checked","checked")}o.addEventListener("change",()=>n(e));const r=this.toDomElement(t);r.appendChild(o);return r}));return o}function aM(e,t){const i=t.createRangeIn(e);for(const e of i){if(e.item.is("uiElement","label")){return e.item}}}function cM(e,t){const i=t.createRangeIn(e);for(const e of i){if(e.item.is("containerElement","span")&&e.item.hasClass("todo-list__label__description")){return e.item}}}class lM extends tk{static get pluginName(){return"TodoListEditing"}static get requires(){return[vS]}init(){const e=this.editor;const{editing:t,data:i,model:n}=e;n.schema.extend("listItem",{allowAttributes:["todoListChecked"]});n.schema.addAttributeCheck((e,t)=>{const i=e.last;if(t=="todoListChecked"&&i.name=="listItem"&&i.getAttribute("listType")!="todo"){return false}});e.commands.add("todoList",new UE(e,"todo"));e.commands.add("todoListCheck",new XS(e));i.downcastDispatcher.on("insert:listItem",tM(n),{priority:"high"});i.upcastDispatcher.on("element:input",iM,{priority:"high"});t.downcastDispatcher.on("insert:listItem",eM(n,e=>this._handleCheckmarkChange(e)),{priority:"high"});t.downcastDispatcher.on("attribute:listType:listItem",nM(e=>this._handleCheckmarkChange(e),t.view));t.downcastDispatcher.on("attribute:todoListChecked:listItem",oM(e=>this._handleCheckmarkChange(e)));t.mapper.on("modelToViewPosition",rM(t.view));i.mapper.on("modelToViewPosition",rM(t.view));this.listenTo(t.view.document,"keydown",dM(n,e.locale));e.keystrokes.set("Ctrl+space",()=>e.execute("todoListCheck"));const o=new Set;this.listenTo(n,"applyOperation",(e,t)=>{const i=t[0];if(i.type=="rename"&&i.oldName=="listItem"){const e=i.position.nodeAfter;if(e.hasAttribute("todoListChecked")){o.add(e)}}else if(i.type=="changeAttribute"&&i.key=="listType"&&i.oldValue==="todo"){for(const e of i.range.getItems()){if(e.hasAttribute("todoListChecked")&&e.getAttribute("listType")!=="todo"){o.add(e)}}}});n.document.registerPostFixer(e=>{let t=false;for(const i of o){e.removeAttribute("todoListChecked",i);t=true}o.clear();return t})}_handleCheckmarkChange(e){const t=this.editor;const i=t.model;const n=Array.from(i.document.selection.getRanges());i.change(i=>{i.setSelection(e,"end");t.execute("todoListCheck");i.setSelection(n)})}}function dM(e,t){return(i,n)=>{const o=jl(n.keyCode,t.contentLanguageDirection);if(o!="left"){return}const r=e.schema;const s=e.document.selection;if(!s.isCollapsed){return}const a=s.getFirstPosition();const c=a.parent;if(c.name==="listItem"&&c.getAttribute("listType")=="todo"&&a.isAtStart){const t=r.getNearestSelectionRange(e.createPositionBefore(c),"backward");if(t){e.change(e=>e.setSelection(t))}n.preventDefault();n.stopPropagation();i.stop()}}}var uM='';class hM extends tk{init(){const e=this.editor.t;XE(this.editor,"todoList",e("To-do List"),uM)}}var fM=i(102);class mM extends tk{static get requires(){return[lM,hM]}static get pluginName(){return"TodoList"}}const gM="underline";class pM extends tk{static get pluginName(){return"UnderlineEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:gM});e.model.schema.setAttributeProperties(gM,{isFormatting:true,copyOnEnter:true});e.conversion.attributeToElement({model:gM,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}});e.commands.add(gM,new Hk(e,gM));e.keystrokes.set("CTRL+U","underline")}}var bM='';const wM="underline";class kM extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(wM,i=>{const n=e.commands.get(wM);const o=new Tw(i);o.set({label:t("Underline"),icon:bM,keystroke:"CTRL+U",tooltip:true,isToggleable:true});o.bind("isOn","isEnabled").to(n,"value","isEnabled");this.listenTo(o,"execute",()=>{e.execute(wM);e.editing.view.focus()});return o})}}class _M extends tk{static get requires(){return[pM,kM]}static get pluginName(){return"Underline"}}function vM(e){if(e.is("$text")||e.is("$textProxy")){return e.data}let t="";let i=null;for(const n of e.getChildren()){const e=vM(n);if(i&&i.is("element")){t+="\n"}t+=e;i=n}return t}class yM extends tk{constructor(e){super(e);this.set("characters",0);this.set("words",0);Object.defineProperties(this,{characters:{get(){return this.characters=this._getCharacters()}},words:{get(){return this.words=this._getWords()}}});this.set("_wordsLabel");this.set("_charactersLabel");this._config=e.config.get("wordCount")||{};this._outputView;this._wordsMatchRegExp=Cl.features.isRegExpUnicodePropertySupported?new RegExp("[\\p{L}\\p{N}\\p{M}\\p{Pd}\\p{Pc}]+","gu"):/[_\-a-zA-Z0-9À-ž]+/gu}static get pluginName(){return"WordCount"}init(){const e=this.editor;e.model.document.on("change:data",qT(this._refreshStats.bind(this),250));if(typeof this._config.onUpdate=="function"){this.on("update",(e,t)=>{this._config.onUpdate(t)})}if(Gr(this._config.container)){this._config.container.appendChild(this.wordCountContainer)}}destroy(){if(this._outputView){this._outputView.element.remove();this._outputView.destroy()}super.destroy()}get wordCountContainer(){const e=this.editor;const t=e.t;const i=e.config.get("wordCount.displayWords");const n=e.config.get("wordCount.displayCharacters");const o=hb.bind(this,this);const r=[];if(!this._outputView){this._outputView=new jb;if(i||i===undefined){this.bind("_wordsLabel").to(this,"words",e=>t("Words: %0",[e]));r.push({tag:"div",children:[{text:[o.to("_wordsLabel")]}],attributes:{class:"ck-word-count__words"}})}if(n||n===undefined){this.bind("_charactersLabel").to(this,"characters",e=>t("Characters: %0",[e]));r.push({tag:"div",children:[{text:[o.to("_charactersLabel")]}],attributes:{class:"ck-word-count__characters"}})}this._outputView.setTemplate({tag:"div",attributes:{class:["ck","ck-word-count"]},children:r});this._outputView.render()}return this._outputView.element}_getCharacters(){const e=vM(this.editor.model.document.getRoot());return e.replace(/\n/g,"").length}_getWords(){const e=vM(this.editor.model.document.getRoot());const t=e.match(this._wordsMatchRegExp)||[];return t.length}_refreshStats(){const e=this.words=this._getWords();const t=this.characters=this._getCharacters();this.fire("update",{words:e,characters:t})}}class xM extends Xw{}xM.builtinPlugins=[vk,Ek,Fk,Gk,uv,hy,by,Ey,Uy,nx,gx,nA,dT,yT,QT,fC,wC,iP,cP,HE,CS,KS,Yy,QS,mM,_M,yM];var AM=t["default"]=xM}])["default"]})); -//# sourceMappingURL=ckeditor.js.map +!function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"%0 of %1","Align center":"Align center","Align left":"Align left","Align right":"Align right","Almost equal to":"Almost equal to",Angle:"Angle","Approximately equal to":"Approximately equal to",Aquamarine:"Aquamarine","Asterisk operator":"Asterisk operator","Austral sign":"Austral sign","back with leftwards arrow above":"back with leftwards arrow above",Big:"Big","Bitcoin sign":"Bitcoin sign",Black:"Black","Block quote":"Block quote",Blue:"Blue","Blue marker":"Blue marker",Bold:"Bold","Bulleted List":"Bulleted List","Bulleted list styles toolbar":"Bulleted list styles toolbar",Cancel:"Cancel","Cedi sign":"Cedi sign","Cent sign":"Cent sign","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Character categories":"Character categories","Choose heading":"Choose heading",Circle:"Circle","Colon sign":"Colon sign","Contains as member":"Contains as member","Copyright sign":"Copyright sign","Cruzeiro sign":"Cruzeiro sign","Currency sign":"Currency sign",Decimal:"Decimal","Decimal with leading zero":"Decimal with leading zero",Default:"Default","Degree sign":"Degree sign","Dim grey":"Dim grey",Disc:"Disc","Division sign":"Division sign","Document colors":"Document colors","Dollar sign":"Dollar sign","Dong sign":"Dong sign","Double dagger":"Double dagger","Double exclamation mark":"Double exclamation mark","Double low-9 quotation mark":"Double low-9 quotation mark","Double question mark":"Double question mark",Downloadable:"Downloadable","downwards arrow to bar":"downwards arrow to bar","downwards dashed arrow":"downwards dashed arrow","downwards double arrow":"downwards double arrow","Drachma sign":"Drachma sign","Dropdown toolbar":"Dropdown toolbar","Edit link":"Edit link","Editor toolbar":"Editor toolbar","Element of":"Element of","Em dash":"Em dash","Empty set":"Empty set","En dash":"En dash","end with leftwards arrow above":"end with leftwards arrow above","Enter image caption":"Enter image caption","Euro sign":"Euro sign","Euro-currency sign":"Euro-currency sign","Exclamation question mark":"Exclamation question mark","Font Background Color":"Font Background Color","Font Color":"Font Color","Font Family":"Font Family","Font Size":"Font Size","For all":"For all","Fraction slash":"Fraction slash","French franc sign":"French franc sign","Full size image":"Full size image","German penny sign":"German penny sign","Greater-than or equal to":"Greater-than or equal to","Greater-than sign":"Greater-than sign",Green:"Green","Green marker":"Green marker","Green pen":"Green pen",Grey:"Grey","Guarani sign":"Guarani sign",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",Highlight:"Highlight","Horizontal ellipsis":"Horizontal ellipsis","Horizontal line":"Horizontal line","Hryvnia sign":"Hryvnia sign",Huge:"Huge","Identical to":"Identical to","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","Indian rupee sign":"Indian rupee sign",Infinity:"Infinity","Insert image":"Insert image","Insert media":"Insert media","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block",Integral:"Integral",Intersection:"Intersection","Inverted exclamation mark":"Inverted exclamation mark","Inverted question mark":"Inverted question mark",Italic:"Italic",Justify:"Justify","Kip sign":"Kip sign","Latin capital letter a with breve":"Latin capital letter a with breve","Latin capital letter a with macron":"Latin capital letter a with macron","Latin capital letter a with ogonek":"Latin capital letter a with ogonek","Latin capital letter c with acute":"Latin capital letter c with acute","Latin capital letter c with caron":"Latin capital letter c with caron","Latin capital letter c with circumflex":"Latin capital letter c with circumflex","Latin capital letter c with dot above":"Latin capital letter c with dot above","Latin capital letter d with caron":"Latin capital letter d with caron","Latin capital letter d with stroke":"Latin capital letter d with stroke","Latin capital letter e with breve":"Latin capital letter e with breve","Latin capital letter e with caron":"Latin capital letter e with caron","Latin capital letter e with dot above":"Latin capital letter e with dot above","Latin capital letter e with macron":"Latin capital letter e with macron","Latin capital letter e with ogonek":"Latin capital letter e with ogonek","Latin capital letter eng":"Latin capital letter eng","Latin capital letter g with breve":"Latin capital letter g with breve","Latin capital letter g with cedilla":"Latin capital letter g with cedilla","Latin capital letter g with circumflex":"Latin capital letter g with circumflex","Latin capital letter g with dot above":"Latin capital letter g with dot above","Latin capital letter h with circumflex":"Latin capital letter h with circumflex","Latin capital letter h with stroke":"Latin capital letter h with stroke","Latin capital letter i with breve":"Latin capital letter i with breve","Latin capital letter i with dot above":"Latin capital letter i with dot above","Latin capital letter i with macron":"Latin capital letter i with macron","Latin capital letter i with ogonek":"Latin capital letter i with ogonek","Latin capital letter i with tilde":"Latin capital letter i with tilde","Latin capital letter j with circumflex":"Latin capital letter j with circumflex","Latin capital letter k with cedilla":"Latin capital letter k with cedilla","Latin capital letter l with acute":"Latin capital letter l with acute","Latin capital letter l with caron":"Latin capital letter l with caron","Latin capital letter l with cedilla":"Latin capital letter l with cedilla","Latin capital letter l with middle dot":"Latin capital letter l with middle dot","Latin capital letter l with stroke":"Latin capital letter l with stroke","Latin capital letter n with acute":"Latin capital letter n with acute","Latin capital letter n with caron":"Latin capital letter n with caron","Latin capital letter n with cedilla":"Latin capital letter n with cedilla","Latin capital letter o with breve":"Latin capital letter o with breve","Latin capital letter o with double acute":"Latin capital letter o with double acute","Latin capital letter o with macron":"Latin capital letter o with macron","Latin capital letter r with acute":"Latin capital letter r with acute","Latin capital letter r with caron":"Latin capital letter r with caron","Latin capital letter r with cedilla":"Latin capital letter r with cedilla","Latin capital letter s with acute":"Latin capital letter s with acute","Latin capital letter s with caron":"Latin capital letter s with caron","Latin capital letter s with cedilla":"Latin capital letter s with cedilla","Latin capital letter s with circumflex":"Latin capital letter s with circumflex","Latin capital letter t with caron":"Latin capital letter t with caron","Latin capital letter t with cedilla":"Latin capital letter t with cedilla","Latin capital letter t with stroke":"Latin capital letter t with stroke","Latin capital letter u with breve":"Latin capital letter u with breve","Latin capital letter u with double acute":"Latin capital letter u with double acute","Latin capital letter u with macron":"Latin capital letter u with macron","Latin capital letter u with ogonek":"Latin capital letter u with ogonek","Latin capital letter u with ring above":"Latin capital letter u with ring above","Latin capital letter u with tilde":"Latin capital letter u with tilde","Latin capital letter w with circumflex":"Latin capital letter w with circumflex","Latin capital letter y with circumflex":"Latin capital letter y with circumflex","Latin capital letter y with diaeresis":"Latin capital letter y with diaeresis","Latin capital letter z with acute":"Latin capital letter z with acute","Latin capital letter z with caron":"Latin capital letter z with caron","Latin capital letter z with dot above":"Latin capital letter z with dot above","Latin capital ligature ij":"Latin capital ligature ij","Latin capital ligature oe":"Latin capital ligature oe","Latin small letter a with breve":"Latin small letter a with breve","Latin small letter a with macron":"Latin small letter a with macron","Latin small letter a with ogonek":"Latin small letter a with ogonek","Latin small letter c with acute":"Latin small letter c with acute","Latin small letter c with caron":"Latin small letter c with caron","Latin small letter c with circumflex":"Latin small letter c with circumflex","Latin small letter c with dot above":"Latin small letter c with dot above","Latin small letter d with caron":"Latin small letter d with caron","Latin small letter d with stroke":"Latin small letter d with stroke","Latin small letter dotless i":"Latin small letter dotless i","Latin small letter e with breve":"Latin small letter e with breve","Latin small letter e with caron":"Latin small letter e with caron","Latin small letter e with dot above":"Latin small letter e with dot above","Latin small letter e with macron":"Latin small letter e with macron","Latin small letter e with ogonek":"Latin small letter e with ogonek","Latin small letter eng":"Latin small letter eng","Latin small letter f with hook":"Latin small letter f with hook","Latin small letter g with breve":"Latin small letter g with breve","Latin small letter g with cedilla":"Latin small letter g with cedilla","Latin small letter g with circumflex":"Latin small letter g with circumflex","Latin small letter g with dot above":"Latin small letter g with dot above","Latin small letter h with circumflex":"Latin small letter h with circumflex","Latin small letter h with stroke":"Latin small letter h with stroke","Latin small letter i with breve":"Latin small letter i with breve","Latin small letter i with macron":"Latin small letter i with macron","Latin small letter i with ogonek":"Latin small letter i with ogonek","Latin small letter i with tilde":"Latin small letter i with tilde","Latin small letter j with circumflex":"Latin small letter j with circumflex","Latin small letter k with cedilla":"Latin small letter k with cedilla","Latin small letter kra":"Latin small letter kra","Latin small letter l with acute":"Latin small letter l with acute","Latin small letter l with caron":"Latin small letter l with caron","Latin small letter l with cedilla":"Latin small letter l with cedilla","Latin small letter l with middle dot":"Latin small letter l with middle dot","Latin small letter l with stroke":"Latin small letter l with stroke","Latin small letter long s":"Latin small letter long s","Latin small letter n preceded by apostrophe":"Latin small letter n preceded by apostrophe","Latin small letter n with acute":"Latin small letter n with acute","Latin small letter n with caron":"Latin small letter n with caron","Latin small letter n with cedilla":"Latin small letter n with cedilla","Latin small letter o with breve":"Latin small letter o with breve","Latin small letter o with double acute":"Latin small letter o with double acute","Latin small letter o with macron":"Latin small letter o with macron","Latin small letter r with acute":"Latin small letter r with acute","Latin small letter r with caron":"Latin small letter r with caron","Latin small letter r with cedilla":"Latin small letter r with cedilla","Latin small letter s with acute":"Latin small letter s with acute","Latin small letter s with caron":"Latin small letter s with caron","Latin small letter s with cedilla":"Latin small letter s with cedilla","Latin small letter s with circumflex":"Latin small letter s with circumflex","Latin small letter t with caron":"Latin small letter t with caron","Latin small letter t with cedilla":"Latin small letter t with cedilla","Latin small letter t with stroke":"Latin small letter t with stroke","Latin small letter u with breve":"Latin small letter u with breve","Latin small letter u with double acute":"Latin small letter u with double acute","Latin small letter u with macron":"Latin small letter u with macron","Latin small letter u with ogonek":"Latin small letter u with ogonek","Latin small letter u with ring above":"Latin small letter u with ring above","Latin small letter u with tilde":"Latin small letter u with tilde","Latin small letter w with circumflex":"Latin small letter w with circumflex","Latin small letter y with circumflex":"Latin small letter y with circumflex","Latin small letter z with acute":"Latin small letter z with acute","Latin small letter z with caron":"Latin small letter z with caron","Latin small letter z with dot above":"Latin small letter z with dot above","Latin small ligature ij":"Latin small ligature ij","Latin small ligature oe":"Latin small ligature oe","Left aligned image":"Left aligned image","Left double quotation mark":"Left double quotation mark","Left single quotation mark":"Left single quotation mark","Left-pointing double angle quotation mark":"Left-pointing double angle quotation mark","leftwards arrow to bar":"leftwards arrow to bar","leftwards dashed arrow":"leftwards dashed arrow","leftwards double arrow":"leftwards double arrow","Less-than or equal to":"Less-than or equal to","Less-than sign":"Less-than sign","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link URL":"Link URL","Lira sign":"Lira sign","Livre tournois sign":"Livre tournois sign","Logical and":"Logical and","Logical or":"Logical or","Lower-latin":"Lower-latin","Lower–roman":"Lower–roman",Macron:"Macron","Manat sign":"Manat sign","Media toolbar":"Media toolbar","Media URL":"Media URL","media widget":"media widget","Mill sign":"Mill sign","Minus sign":"Minus sign","Multiplication sign":"Multiplication sign","N-ary product":"N-ary product","N-ary summation":"N-ary summation",Nabla:"Nabla","Naira sign":"Naira sign","New sheqel sign":"New sheqel sign",Next:"Next","Nordic mark sign":"Nordic mark sign","Not an element of":"Not an element of","Not equal to":"Not equal to","Not sign":"Not sign","Numbered List":"Numbered List","Numbered list styles toolbar":"Numbered list styles toolbar","on with exclamation mark with left right arrow above":"on with exclamation mark with left right arrow above","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Orange:"Orange",Original:"Original",Overline:"Overline",Paragraph:"Paragraph","Paragraph sign":"Paragraph sign","Partial differential":"Partial differential","Paste the media URL in the input.":"Paste the media URL in the input.","Per mille sign":"Per mille sign","Per ten thousand sign":"Per ten thousand sign","Peseta sign":"Peseta sign","Peso sign":"Peso sign","Pink marker":"Pink marker","Plus-minus sign":"Plus-minus sign","Pound sign":"Pound sign",Previous:"Previous","Proportional to":"Proportional to",Purple:"Purple","Question exclamation mark":"Question exclamation mark",Red:"Red","Red pen":"Red pen",Redo:"Redo","Registered sign":"Registered sign","Remove color":"Remove color","Remove highlight":"Remove highlight","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Reversed paragraph sign":"Reversed paragraph sign","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image","Right double quotation mark":"Right double quotation mark","Right single quotation mark":"Right single quotation mark","Right-pointing double angle quotation mark":"Right-pointing double angle quotation mark","rightwards arrow to bar":"rightwards arrow to bar","rightwards dashed arrow":"rightwards dashed arrow","rightwards double arrow":"rightwards double arrow","Ruble sign":"Ruble sign","Rupee sign":"Rupee sign",Save:"Save","Saving changes":"Saving changes","Section sign":"Section sign","Select all":"Select all","Show more items":"Show more items","Side image":"Side image","Single left-pointing angle quotation mark":"Single left-pointing angle quotation mark","Single low-9 quotation mark":"Single low-9 quotation mark","Single right-pointing angle quotation mark":"Single right-pointing angle quotation mark",Small:"Small","soon with rightwards arrow above":"soon with rightwards arrow above","Special characters":"Special characters","Spesmilo sign":"Spesmilo sign",Square:"Square","Square root":"Square root","Tenge sign":"Tenge sign","Text alignment":"Text alignment","Text alignment toolbar":"Text alignment toolbar","Text alternative":"Text alternative","Text highlight toolbar":"Text highlight toolbar","The URL must not be empty.":"The URL must not be empty.","There exists":"There exists","This link has no URL":"This link has no URL","This media URL is not supported.":"This media URL is not supported.","Tilde operator":"Tilde operator",Tiny:"Tiny","Tip: Paste the URL into the content to embed faster.":"Tip: Paste the URL into the content to embed faster.","To-do List":"To-do List","Toggle the circle list style":"Toggle the circle list style","Toggle the decimal list style":"Toggle the decimal list style","Toggle the decimal with leading zero list style":"Toggle the decimal with leading zero list style","Toggle the disc list style":"Toggle the disc list style","Toggle the lower–latin list style":"Toggle the lower–latin list style","Toggle the lower–roman list style":"Toggle the lower–roman list style","Toggle the square list style":"Toggle the square list style","Toggle the upper–latin list style":"Toggle the upper–latin list style","Toggle the upper–roman list style":"Toggle the upper–roman list style","top with upwards arrow above":"top with upwards arrow above","Trade mark sign":"Trade mark sign","Tugrik sign":"Tugrik sign","Turkish lira sign":"Turkish lira sign",Turquoise:"Turquoise","Two dot leader":"Two dot leader",Underline:"Underline",Undo:"Undo",Union:"Union",Unlink:"Unlink","up down arrow with base":"up down arrow with base","Upload failed":"Upload failed","Upload in progress":"Upload in progress","Upper-latin":"Upper-latin","Upper-roman":"Upper-roman","upwards arrow to bar":"upwards arrow to bar","upwards dashed arrow":"upwards dashed arrow","upwards double arrow":"upwards double arrow","Vulgar fraction one half":"Vulgar fraction one half","Vulgar fraction one quarter":"Vulgar fraction one quarter","Vulgar fraction three quarters":"Vulgar fraction three quarters",White:"White","Widget toolbar":"Widget toolbar","Won sign":"Won sign",Yellow:"Yellow","Yellow marker":"Yellow marker","Yen sign":"Yen sign"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClassicEditor=e():t.ClassicEditor=e()}(window,(function(){return function(t){var e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(o,n,function(e){return t[e]}.bind(null,n));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=116)}([function(t,e,i){"use strict";i.d(e,"a",(function(){return o})),i.d(e,"c",(function(){return n})),i.d(e,"b",(function(){return r}));class o extends Error{constructor(t,e,i){super(`${t}${i?" "+JSON.stringify(i):""}${s(t)}`),this.name="CKEditorError",this.context=e,this.data=i}is(t){return"CKEditorError"===t}static rethrowUnexpectedError(t,e){if(t.is&&t.is("CKEditorError"))throw t;const i=new o(t.message,e);throw i.stack=t.stack,i}}function n(t,e){console.warn(...a(t,e))}function r(t,e){console.error(...a(t,e))}function s(t){return"\nRead more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-"+t}function a(t,e){const i=s(t);return e?[t,e,i]:[t,i]}},function(t,e,i){"use strict";var o,n=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},r=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),s=[];function a(t){for(var e=-1,i=0;i: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(t,e,i){var o=i(1),n=i(21);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(t,e,i){var o=i(1),n=i(23);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}"},function(t,e,i){var o=i(1),n=i(25);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);position:absolute}.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(t,e,i){var o=i(1),n=i(27);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}"},function(t,e,i){var o=i(1),n=i(29);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s;border-style:solid;left:50%}.ck.ck-tooltip.ck-tooltip_s,.ck.ck-tooltip.ck-tooltip_se,.ck.ck-tooltip.ck-tooltip_sw{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{top:calc(var(--ck-tooltip-arrow-size)*-1 + 1px);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_sw{right:50%;left:auto}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text{left:auto;right:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{left:auto;right:0}.ck.ck-tooltip.ck-tooltip_se{left:50%;right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text{right:auto;left:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after{right:auto;left:0;transform:translateX(50%)}.ck.ck-tooltip.ck-tooltip_n{top:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_e{left:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text:after{left:calc(var(--ck-tooltip-arrow-size)*-1);top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:transparent;border-bottom-color:transparent;border-right-color:var(--ck-color-tooltip-background);border-top-color:transparent;border-left-width:0;border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_w{right:calc(100% + var(--ck-tooltip-arrow-size));left:auto;top:50%}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text:after{left:100%;top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:var(--ck-color-tooltip-background);border-bottom-color:transparent;border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:0;border-top-width:var(--ck-tooltip-arrow-size)}'},function(t,e,i){var o=i(1),n=i(31);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button .ck-button__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(t,e,i){var o=i(1),n=i(33);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;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(t,e,i){var o=i(1),n=i(35);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-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(t,e,i){var o=i(1),n=i(37);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown .ck-dropdown__panel{width:max-content;max-width:var(--ck-toolbar-dropdown-max-width)}.ck.ck-toolbar-dropdown .ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}"},function(t,e,i){var o=i(1),n=i(39);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}"},function(t,e,i){var o=i(1),n=i(41);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row nowrap;align-items:center}.ck.ck-toolbar>.ck-toolbar__items{display:flex;flex-flow:row wrap;align-items:center;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;width:1px;min-width:1px;background:var(--ck-color-toolbar-border);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-right:var(--ck-spacing-small)}"},function(t,e,i){var o=i(1),n=i(43);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}"},function(t,e,i){var o=i(1),n=i(45);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}"},function(t,e,i){var o=i(1),n=i(47);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#000}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{width:var(--ck-color-grid-tile-size);height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{display:none;color:var(--ck-color-color-grid-check-icon)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}"},function(t,e,i){var o=i(1),n=i(49);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(51);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e){t.exports=".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}"},function(t,e,i){var o=i(1),n=i(54);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button .ck-tooltip{display:none}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__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(t,e,i){var o=i(1),n=i(56);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=":root{--ck-highlight-marker-yellow:#fdfd77;--ck-highlight-marker-green:#62f962;--ck-highlight-marker-pink:#fc7899;--ck-highlight-marker-blue:#72ccfd;--ck-highlight-pen-red:#e71313;--ck-highlight-pen-green:#128a00}.ck-content .marker-yellow{background-color:var(--ck-highlight-marker-yellow)}.ck-content .marker-green{background-color:var(--ck-highlight-marker-green)}.ck-content .marker-pink{background-color:var(--ck-highlight-marker-pink)}.ck-content .marker-blue{background-color:var(--ck-highlight-marker-blue)}.ck-content .pen-red{color:var(--ck-highlight-pen-red);background-color:transparent}.ck-content .pen-green{color:var(--ck-highlight-pen-green);background-color:transparent}"},function(t,e,i){var o=i(1),n=i(58);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-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(t,e,i){var o=i(1),n=i(60);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck-editor__editable .ck-horizontal-line{display:flow-root}.ck-content hr{margin:15px 0;height:4px;background:#dedede;border:0}"},function(t,e,i){var o=i(1),n=i(62);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports='.ck .ck-widget .ck-widget__type-around__button{display:block;position:absolute;overflow:hidden;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{position:absolute;top:50%;left:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{top:calc(var(--ck-widget-outline-thickness)*-0.5);left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-0.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:"";display:block;position:absolute;top:1px;left:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;position:absolute;left:0;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{width:var(--ck-widget-type-around-button-size);height:var(--ck-widget-type-around-button-size);background:var(--ck-color-widget-type-around-button);border-radius:100px;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);opacity:0;pointer-events:none}.ck .ck-widget .ck-widget__type-around__button svg{width:10px;height:8px;transform:translate(-50%,-50%);transition:transform .5s ease;margin-top:1px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{width:calc(var(--ck-widget-type-around-button-size) - 2px);height:calc(var(--ck-widget-type-around-button-size) - 2px);border-radius:100px;background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3))}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{pointer-events:none;height:1px;animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;outline:1px solid hsla(0,0%,100%,.5);background:var(--ck-color-base-text)}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}'},function(t,e,i){var o=i(1),n=i(64);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(66);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{pointer-events:none;transform-origin:0 0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);background:var(--ck-color-labeled-field-label-background);padding:0 calc(var(--ck-font-size-tiny)*0.5);line-height:normal;font-weight:400;text-overflow:ellipsis;overflow:hidden;max-width:100%;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-spacing-medium),calc(var(--ck-font-size-base)*0.6)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-spacing-medium)*-1),calc(var(--ck-font-size-base)*0.6)) scale(1)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));background:transparent;padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}"},function(t,e,i){var o=i(1),n=i(68);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"},function(t,e,i){var o=i(1),n=i(70);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}"},function(t,e){t.exports='.ck-vertical-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-text-width)*0.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-large);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after,[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}'},function(t,e,i){var o=i(1),n=i(73);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck .ck-balloon-rotator__navigation{display:flex;align-items:center;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}"},function(t,e,i){var o=i(1),n=i(75);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);width:100%;height:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}"},function(t,e,i){var o=i(1),n=i(77);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(79);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(81);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(83);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(85);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(87);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(89);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports='.ck-image-upload-complete-icon{display:block;position:absolute;top:10px;right:10px;border-radius:50%}.ck-image-upload-complete-icon:after{content:"";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20px;--ck-image-upload-icon-width:2px}.ck-image-upload-complete-icon{width:var(--ck-image-upload-icon-size);height:var(--ck-image-upload-icon-size);opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:var(--ck-image-upload-icon-size);animation-delay:0ms,3s}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}'},function(t,e,i){var o=i(1),n=i(91);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports='.ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}'},function(t,e,i){var o=i(1),n=i(93);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(95);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"},function(t,e,i){var o=i(1),n=i(97);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}"},function(t,e,i){var o=i(1),n=i(99);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-list-styles-dropdown>.ck-dropdown__panel>.ck-toolbar>.ck-toolbar__items{display:grid}:root{--ck-list-style-button-size:44px}.ck.ck-list-styles-dropdown>.ck-dropdown__panel>.ck-toolbar{background:none;padding:0}.ck.ck-list-styles-dropdown>.ck-dropdown__panel>.ck-toolbar>.ck-toolbar__items{grid-template-columns:repeat(3,auto);row-gap:var(--ck-spacing-medium);column-gap:var(--ck-spacing-medium);padding:var(--ck-spacing-medium)}.ck.ck-list-styles-dropdown>.ck-dropdown__panel>.ck-toolbar>.ck-toolbar__items .ck-button{width:var(--ck-list-style-button-size);height:var(--ck-list-style-button-size);padding:0;margin:0;box-sizing:content-box}.ck.ck-list-styles-dropdown>.ck-dropdown__panel>.ck-toolbar>.ck-toolbar__items .ck-button .ck-icon{width:var(--ck-list-style-button-size);height:var(--ck-list-style-button-size)}"},function(t,e,i){var o=i(1),n=i(101);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(103);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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%}}"},function(t,e,i){var o=i(1),n=i(105);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck-content .media{clear:both;margin:1em 0;display:block;min-width:15em}"},function(t,e,i){var o=i(1),n=i(107);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-form__header{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{padding:var(--ck-spacing-small) var(--ck-spacing-large);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-form__header .ck-form__header__label{font-weight:700}"},function(t,e,i){var o=i(1),n=i(109);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-character-grid .ck-character-grid__tiles{display:grid;grid-template-columns:repeat(10,1fr)}:root{--ck-character-grid-tile-size:24px}.ck.ck-character-grid{overflow-y:auto;overflow-x:hidden;width:350px;max-height:200px}.ck.ck-character-grid .ck-character-grid__tiles{margin:var(--ck-spacing-standard) var(--ck-spacing-large);grid-gap:var(--ck-spacing-standard)}.ck.ck-character-grid .ck-character-grid__tile{width:var(--ck-character-grid-tile-size);height:var(--ck-character-grid-tile-size);min-width:var(--ck-character-grid-tile-size);min-height:var(--ck-character-grid-tile-size);font-size:1.2em;padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-character-grid .ck-character-grid__tile:focus:not(.ck-disabled),.ck.ck-character-grid .ck-character-grid__tile:hover:not(.ck-disabled){border:0;box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-character-grid .ck-character-grid__tile .ck-button__label{line-height:var(--ck-character-grid-tile-size);width:100%;text-align:center}"},function(t,e,i){var o=i(1),n=i(111);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-character-info{display:flex;justify-content:space-between;padding:var(--ck-spacing-small) var(--ck-spacing-large);border-top:1px solid var(--ck-color-base-border)}.ck.ck-character-info>*{text-transform:uppercase;font-size:var(--ck-font-size-small)}.ck.ck-character-info .ck-character-info__name{max-width:280px;text-overflow:ellipsis;overflow:hidden}.ck.ck-character-info .ck-character-info__code{opacity:.6}"},function(t,e,i){var o=i(1),n=i(113);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-special-characters-navigation>.ck-label{max-width:160px;text-overflow:ellipsis;overflow:hidden}.ck.ck-special-characters-navigation>.ck-dropdown .ck-dropdown__panel{max-height:250px;overflow-y:auto;overflow-x:hidden}"},function(t,e,i){var o=i(1),n=i(115);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=':root{--ck-todo-list-checkmark-size:16px}.ck-content .todo-list{list-style:none}.ck-content .todo-list li{margin-bottom:5px}.ck-content .todo-list li .todo-list{margin-top:5px}.ck-content .todo-list .todo-list__label>input{-webkit-appearance:none;display:inline-block;position:relative;width:var(--ck-todo-list-checkmark-size);height:var(--ck-todo-list-checkmark-size);vertical-align:middle;border:0;left:-25px;margin-right:-15px;right:0;margin-left:0}.ck-content .todo-list .todo-list__label>input:before{display:block;position:absolute;box-sizing:border-box;content:"";width:100%;height:100%;border:1px solid #333;border-radius:2px;transition:box-shadow .25s ease-in-out,background .25s ease-in-out,border .25s ease-in-out}.ck-content .todo-list .todo-list__label>input:after{display:block;position:absolute;box-sizing:content-box;pointer-events:none;content:"";left:calc(var(--ck-todo-list-checkmark-size)/3);top:calc(var(--ck-todo-list-checkmark-size)/5.3);width:calc(var(--ck-todo-list-checkmark-size)/5.3);height:calc(var(--ck-todo-list-checkmark-size)/2.6);border-left:0 solid transparent;border-bottom:calc(var(--ck-todo-list-checkmark-size)/8) solid transparent;border-right:calc(var(--ck-todo-list-checkmark-size)/8) solid transparent;border-top:0 solid transparent;transform:rotate(45deg)}.ck-content .todo-list .todo-list__label>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-content .todo-list .todo-list__label>input[checked]:after{border-color:#fff}.ck-content .todo-list .todo-list__label .todo-list__label__description{vertical-align:middle}[dir=rtl] .todo-list .todo-list__label>input{left:0;margin-right:0;right:-25px;margin-left:-15px}.ck-editor__editable .todo-list .todo-list__label>input{cursor:pointer}.ck-editor__editable .todo-list .todo-list__label>input:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}'},function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return hb}));var o=i(3),n=o.a.Symbol,r=Object.prototype,s=r.hasOwnProperty,a=r.toString,l=n?n.toStringTag:void 0;var c=function(t){var e=s.call(t,l),i=t[l];try{t[l]=void 0;var o=!0}catch(t){}var n=a.call(t);return o&&(e?t[l]=i:delete t[l]),n},d=Object.prototype.toString;var h=function(t){return d.call(t)},u=n?n.toStringTag:void 0;var g=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":u&&u in Object(t)?c(t):h(t)};var m=function(t,e){return function(i){return t(e(i))}},f=m(Object.getPrototypeOf,Object);var p=function(t){return null!=t&&"object"==typeof t},b=Function.prototype,w=Object.prototype,k=b.toString,_=w.hasOwnProperty,v=k.call(Object);var y=function(t){if(!p(t)||"[object Object]"!=g(t))return!1;var e=f(t);if(null===e)return!0;var i=_.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&k.call(i)==v};var x=function(){this.__data__=[],this.size=0};var A=function(t,e){return t===e||t!=t&&e!=e};var T=function(t,e){for(var i=t.length;i--;)if(A(t[i][0],e))return i;return-1},C=Array.prototype.splice;var S=function(t){var e=this.__data__,i=T(e,t);return!(i<0)&&(i==e.length-1?e.pop():C.call(e,i,1),--this.size,!0)};var P=function(t){var e=this.__data__,i=T(e,t);return i<0?void 0:e[i][1]};var E=function(t){return T(this.__data__,t)>-1};var M=function(t,e){var i=this.__data__,o=T(i,t);return o<0?(++this.size,i.push([t,e])):i[o][1]=e,this};function L(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991},Bt={};Bt["[object Float32Array]"]=Bt["[object Float64Array]"]=Bt["[object Int8Array]"]=Bt["[object Int16Array]"]=Bt["[object Int32Array]"]=Bt["[object Uint8Array]"]=Bt["[object Uint8ClampedArray]"]=Bt["[object Uint16Array]"]=Bt["[object Uint32Array]"]=!0,Bt["[object Arguments]"]=Bt["[object Array]"]=Bt["[object ArrayBuffer]"]=Bt["[object Boolean]"]=Bt["[object DataView]"]=Bt["[object Date]"]=Bt["[object Error]"]=Bt["[object Function]"]=Bt["[object Map]"]=Bt["[object Number]"]=Bt["[object Object]"]=Bt["[object RegExp]"]=Bt["[object Set]"]=Bt["[object String]"]=Bt["[object WeakMap]"]=!1;var Ft=function(t){return p(t)&&jt(t.length)&&!!Bt[g(t)]};var Ht=function(t){return function(e){return t(e)}},Ut=i(5),qt=Ut.a&&Ut.a.isTypedArray,Wt=qt?Ht(qt):Ft,$t=Object.prototype.hasOwnProperty;var Gt=function(t,e){var i=Ot(t),o=!i&&zt(t),n=!i&&!o&&Object(Rt.a)(t),r=!i&&!o&&!n&&Wt(t),s=i||o||n||r,a=s?Et(t.length,String):[],l=a.length;for(var c in t)!e&&!$t.call(t,c)||s&&("length"==c||n&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Vt(c,l))||a.push(c);return a},Yt=Object.prototype;var Kt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Yt)},Qt=m(Object.keys,Object),Jt=Object.prototype.hasOwnProperty;var Zt=function(t){if(!Kt(t))return Qt(t);var e=[];for(var i in Object(t))Jt.call(t,i)&&"constructor"!=i&&e.push(i);return e};var Xt=function(t){return null!=t&&jt(t.length)&&!j(t)};var te=function(t){return Xt(t)?Gt(t):Zt(t)};var ee=function(t,e){return t&&Pt(e,te(e),t)};var ie=function(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e},oe=Object.prototype.hasOwnProperty;var ne=function(t){if(!D(t))return ie(t);var e=Kt(t),i=[];for(var o in t)("constructor"!=o||!e&&oe.call(t,o))&&i.push(o);return i};var re=function(t){return Xt(t)?Gt(t,!0):ne(t)};var se=function(t,e){return t&&Pt(e,re(e),t)},ae=i(9);var le=function(t,e){var i=-1,o=t.length;for(e||(e=Array(o));++i{this._setToTarget(t,o,e[o],i)})}}function ni(t){return ei(t,ri)}function ri(t){return ii(t)?t:void 0}var si=function(){return function t(){t.called=!0}};class ai{constructor(t,e){this.source=t,this.name=e,this.path=[],this.stop=si(),this.off=si()}}const li=new Array(256).fill().map((t,e)=>("0"+e.toString(16)).slice(-2));function ci(){const t=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0,o=4294967296*Math.random()>>>0;return"e"+li[t>>0&255]+li[t>>8&255]+li[t>>16&255]+li[t>>24&255]+li[e>>0&255]+li[e>>8&255]+li[e>>16&255]+li[e>>24&255]+li[i>>0&255]+li[i>>8&255]+li[i>>16&255]+li[i>>24&255]+li[o>>0&255]+li[o>>8&255]+li[o>>16&255]+li[o>>24&255]}var di={get(t){return"number"!=typeof t?this[t]||this.normal:t},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5},hi=(i(6),i(0));const ui=Symbol("listeningTo"),gi=Symbol("emitterId");var mi={on(t,e,i={}){this.listenTo(this,t,e,i)},once(t,e,i){let o=!1;this.listenTo(this,t,(function(t,...i){o||(o=!0,t.off(),e.call(this,t,...i))}),i)},off(t,e){this.stopListening(this,t,e)},listenTo(t,e,i,o={}){let n,r;this[ui]||(this[ui]={});const s=this[ui];pi(t)||fi(t);const a=pi(t);(n=s[a])||(n=s[a]={emitter:t,callbacks:{}}),(r=n.callbacks[e])||(r=n.callbacks[e]=[]),r.push(i),function(t,e){const i=bi(t);if(i[e])return;let o=e,n=null;const r=[];for(;""!==o&&!i[o];)i[o]={callbacks:[],childEvents:[]},r.push(i[o]),n&&i[o].childEvents.push(n),n=o,o=o.substr(0,o.lastIndexOf(":"));if(""!==o){for(const t of r)t.callbacks=i[o].callbacks.slice();i[o].childEvents.push(n)}}(t,e);const l=wi(t,e),c=di.get(o.priority),d={callback:i,priority:c};for(const t of l){let e=!1;for(let i=0;i-1?t(e,i.substr(0,i.lastIndexOf(":"))):null;return o.callbacks}(this,o);if(i.path.push(this),n){const t=[i,...e];n=Array.from(n);for(let e=0;e{this._delegations||(this._delegations=new Map),t.forEach(t=>{const o=this._delegations.get(t);o?o.set(e,i):this._delegations.set(t,new Map([[e,i]]))})}}},stopDelegating(t,e){if(this._delegations)if(t)if(e){const i=this._delegations.get(t);i&&i.delete(e)}else this._delegations.delete(t);else this._delegations.clear()}};function fi(t,e){t[gi]||(t[gi]=e||ci())}function pi(t){return t[gi]}function bi(t){return t._events||Object.defineProperty(t,"_events",{value:{}}),t._events}function wi(t,e){const i=bi(t)[e];if(!i)return[];let o=[i.callbacks];for(let e=0;e{Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e)).forEach(i=>{if(i in t.prototype)return;const o=Object.getOwnPropertyDescriptor(e,i);o.enumerable=!1,Object.defineProperty(t.prototype,i,o)})})}class xi{constructor(t={},e={}){const i=vi(t);if(i||(e=t),this._items=[],this._itemMap=new Map,this._idProperty=e.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],i)for(const e of t)this._items.push(e),this._itemMap.set(this._getItemIdBeforeAdding(e),e)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(t,e){return this.addMany([t],e)}addMany(t,e){if(void 0===e)e=this._items.length;else if(e>this._items.length||e<0)throw new hi.a("collection-add-item-invalid-index",this);for(let i=0;i{this._setUpBindToBinding(e=>new t(e))},using:t=>{"function"==typeof t?this._setUpBindToBinding(e=>t(e)):this._setUpBindToBinding(e=>e[t])}}}_setUpBindToBinding(t){const e=this._bindToCollection,i=(i,o,n)=>{const r=e._bindToCollection==this,s=e._bindToInternalToExternalMap.get(o);if(r&&s)this._bindToExternalToInternalMap.set(o,s),this._bindToInternalToExternalMap.set(s,o);else{const i=t(o);if(!i)return void this._skippedIndexesFromExternal.push(n);let r=n;for(const t of this._skippedIndexesFromExternal)n>t&&r--;for(const t of e._skippedIndexesFromExternal)r>=t&&r++;this._bindToExternalToInternalMap.set(o,i),this._bindToInternalToExternalMap.set(i,o),this.add(i,r);for(let t=0;t{const o=this._bindToExternalToInternalMap.get(e);o&&this.remove(o),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((t,e)=>(ie&&t.push(e),t),[])})}_getItemIdBeforeAdding(t){const e=this._idProperty;let i;if(e in t){if(i=t[e],"string"!=typeof i)throw new hi.a("collection-add-invalid-id",this);if(this.get(i))throw new hi.a("collection-add-item-already-exists",this)}else t[e]=i=ci();return i}_remove(t){let e,i,o,n=!1;const r=this._idProperty;if("string"==typeof t?(i=t,o=this._itemMap.get(i),n=!o,o&&(e=this._items.indexOf(o))):"number"==typeof t?(e=t,o=this._items[e],n=!o,o&&(i=o[r])):(o=t,i=o[r],e=this._items.indexOf(o),n=-1==e||!this._itemMap.get(i)),n)throw new hi.a("collection-remove-404",this);this._items.splice(e,1),this._itemMap.delete(i);const s=this._bindToInternalToExternalMap.get(o);return this._bindToInternalToExternalMap.delete(o),this._bindToExternalToInternalMap.delete(s),this.fire("remove",o,e),[o,e]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}yi(xi,mi);class Ai{constructor(t,e=[],i=[]){this._context=t,this._plugins=new Map,this._availablePlugins=new Map;for(const t of e)t.pluginName&&this._availablePlugins.set(t.pluginName,t);this._contextPlugins=new Map;for(const[t,e]of i)this._contextPlugins.set(t,e),this._contextPlugins.set(e,t),t.pluginName&&this._availablePlugins.set(t.pluginName,t)}*[Symbol.iterator](){for(const t of this._plugins)"function"==typeof t[0]&&(yield t)}get(t){const e=this._plugins.get(t);if(!e){let e=t;throw"function"==typeof t&&(e=t.pluginName||t.name),new hi.a("plugincollection-plugin-not-loaded",this._context,{plugin:e})}return e}has(t){return this._plugins.has(t)}init(t,e=[]){const i=this,o=this._context,n=new Set,r=[],s=u(t),a=u(e),l=function(t){const e=[];for(const i of t)h(i)||e.push(i);return e.length?e:null}(t);if(l){const t="plugincollection-plugin-not-found";return Object(hi.b)(t,{plugins:l}),Promise.reject(new hi.a(t,o,{plugins:l}))}return Promise.all(s.map(c)).then(()=>d(r,"init")).then(()=>d(r,"afterInit")).then(()=>r);function c(t){if(!a.includes(t)&&!i._plugins.has(t)&&!n.has(t))return function(t){return new Promise(s=>{n.add(t),t.requires&&t.requires.forEach(i=>{const n=h(i);if(t.isContextPlugin&&!n.isContextPlugin)throw new hi.a("plugincollection-context-required",null,{plugin:n.name,requiredBy:t.name});if(e.includes(n))throw new hi.a("plugincollection-required",o,{plugin:n.name,requiredBy:t.name});c(n)});const a=i._contextPlugins.get(t)||new t(o);i._add(t,a),r.push(a),s()})}(t).catch(e=>{throw Object(hi.b)("plugincollection-load",{plugin:t}),e})}function d(t,e){return t.reduce((t,o)=>o[e]?i._contextPlugins.has(o)?t:t.then(o[e].bind(o)):t,Promise.resolve())}function h(t){return"function"==typeof t?t:i._availablePlugins.get(t)}function u(t){return t.map(t=>h(t)).filter(t=>!!t)}}destroy(){const t=[];for(const[,e]of this)"function"!=typeof e.destroy||this._contextPlugins.has(e)||t.push(e.destroy());return Promise.all(t)}_add(t,e){this._plugins.set(t,e);const i=t.pluginName;if(i){if(this._plugins.has(i))throw new hi.a("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:t});this._plugins.set(i,e)}}}function Ti(t){return Array.isArray(t)?t:[t]}function Ci(t,e,i=1){if("number"!=typeof i)throw new hi.a("translation-service-quantity-not-a-number",null,{quantity:i});const o=Object.keys(window.CKEDITOR_TRANSLATIONS).length;1===o&&(t=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]);const n=e.id||e.string;if(0===o||!function(t,e){return!!window.CKEDITOR_TRANSLATIONS[t]&&!!window.CKEDITOR_TRANSLATIONS[t].dictionary[e]}(t,n))return 1!==i?e.plural:e.string;const r=window.CKEDITOR_TRANSLATIONS[t].dictionary,s=window.CKEDITOR_TRANSLATIONS[t].getPluralForm||(t=>1===t?0:1);if("string"==typeof r[n])return r[n];const a=Number(s(i));return r[n][a]}yi(Ai,mi),window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const Si=["ar","fa","he","ku","ug"];class Pi{constructor(t={}){this.uiLanguage=t.uiLanguage||"en",this.contentLanguage=t.contentLanguage||this.uiLanguage,this.uiLanguageDirection=Ei(this.uiLanguage),this.contentLanguageDirection=Ei(this.contentLanguage),this.t=(t,e)=>this._t(t,e)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(t,e=[]){e=Ti(e),"string"==typeof t&&(t={string:t});const i=!!t.plural?e[0]:1;return function(t,e){return t.replace(/%(\d+)/g,(t,i)=>it.destroy())).then(()=>this.plugins.destroy())}_addEditor(t,e){if(this._contextOwner)throw new hi.a("context-addeditor-private-context");this.editors.add(t),e&&(this._contextOwner=t)}_removeEditor(t){return this.editors.has(t)&&this.editors.remove(t),this._contextOwner===t?this.destroy():Promise.resolve()}_getEditorConfig(){const t={};for(const e of this.config.names())["plugins","removePlugins","extraPlugins"].includes(e)||(t[e]=this.config.get(e));return t}static create(t){return new Promise(e=>{const i=new this(t);e(i.initPlugins().then(()=>i))})}}function Li(t,e){const i=Math.min(t.length,e.length);for(let o=0;ot.data.length)throw new hi.a("view-textproxy-wrong-offsetintext",this);if(i<0||e+i>t.data.length)throw new hi.a("view-textproxy-wrong-length",this);this.data=t.data.substring(e,e+i),this.offsetInText=e}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(t){return"$textProxy"===t||"view:$textProxy"===t||"textProxy"===t||"view:textProxy"===t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this.textNode:this.parent;for(;null!==i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}}function Ri(t){return vi(t)?new Map(t):function(t){const e=new Map;for(const i in t)e.set(i,t[i]);return e}(t)}class Di{constructor(...t){this._patterns=[],this.add(...t)}add(...t){for(let e of t)("string"==typeof e||e instanceof RegExp)&&(e={name:e}),e.classes&&("string"==typeof e.classes||e.classes instanceof RegExp)&&(e.classes=[e.classes]),this._patterns.push(e)}match(...t){for(const e of t)for(const t of this._patterns){const i=Vi(e,t);if(i)return{element:e,pattern:t,match:i}}return null}matchAll(...t){const e=[];for(const i of t)for(const t of this._patterns){const o=Vi(i,t);o&&e.push({element:i,pattern:t,match:o})}return e.length>0?e:null}getElementName(){if(1!==this._patterns.length)return null;const t=this._patterns[0],e=t.name;return"function"==typeof t||!e||e instanceof RegExp?null:e}}function Vi(t,e){if("function"==typeof e)return e(t);const i={};return e.name&&(i.name=function(t,e){if(t instanceof RegExp)return t.test(e);return t===e}(e.name,t.name),!i.name)||e.attributes&&(i.attributes=function(t,e){const i=[];for(const o in t){const n=t[o];if(!e.hasAttribute(o))return null;{const t=e.getAttribute(o);if(!0===n)i.push(o);else if(n instanceof RegExp){if(!n.test(t))return null;i.push(o)}else{if(t!==n)return null;i.push(o)}}}return i}(e.attributes,t),!i.attributes)?null:!(e.classes&&(i.classes=function(t,e){const i=[];for(const o of t)if(o instanceof RegExp){const t=e.getClassNames();for(const e of t)o.test(e)&&i.push(e);if(0===i.length)return null}else{if(!e.hasClass(o))return null;i.push(o)}return i}(e.classes,t),!i.classes))&&(!(e.styles&&(i.styles=function(t,e){const i=[];for(const o in t){const n=t[o];if(!e.hasStyle(o))return null;{const t=e.getStyle(o);if(n instanceof RegExp){if(!n.test(t))return null;i.push(o)}else{if(t!==n)return null;i.push(o)}}}return i}(e.styles,t),!i.styles))&&i)}var ji=function(t){return"symbol"==typeof t||p(t)&&"[object Symbol]"==g(t)},Bi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fi=/^\w*$/;var Hi=function(t,e){if(Ot(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!ji(t))||(Fi.test(t)||!Bi.test(t)||null!=e&&t in Object(e))};function Ui(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var i=function(){var o=arguments,n=e?e.apply(this,o):o[0],r=i.cache;if(r.has(n))return r.get(n);var s=t.apply(this,o);return i.cache=r.set(n,s)||r,s};return i.cache=new(Ui.Cache||kt),i}Ui.Cache=kt;var qi=Ui;var Wi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$i=/\\(\\)?/g,Gi=function(t){var e=qi(t,(function(t){return 500===i.size&&i.clear(),t})),i=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Wi,(function(t,i,o,n){e.push(o?n.replace($i,"$1"):i||t)})),e}));var Yi=function(t,e){for(var i=-1,o=null==t?0:t.length,n=Array(o);++in?0:n+e),(i=i>n?n:i)<0&&(i+=n),n=e>i?0:i-e>>>0,e>>>=0;for(var r=Array(n);++o0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(vo);var Ao=function(t,e){return xo(ko(t,e,po),t+"")};var To=function(t,e,i){if(!D(i))return!1;var o=typeof e;return!!("number"==o?Xt(i)&&Vt(e,i.length):"string"==o&&e in i)&&A(i[e],t)};var Co=function(t){return Ao((function(e,i){var o=-1,n=i.length,r=n>1?i[n-1]:void 0,s=n>2?i[2]:void 0;for(r=t.length>3&&"function"==typeof r?(n--,r):void 0,s&&To(i[0],i[1],s)&&(r=n<3?void 0:r,n=1),e=Object(e);++oe===t);return Array.isArray(e)}set(t,e){if(D(t))for(const[e,i]of Object.entries(t))this._styleProcessor.toNormalizedForm(e,i,this._styles);else this._styleProcessor.toNormalizedForm(t,e,this._styles)}remove(t){const e=Io(t);so(this._styles,e),delete this._styles[t],this._cleanEmptyObjectsOnPath(e)}getNormalized(t){return this._styleProcessor.getNormalized(t,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map(t=>t.join(":")).sort().join(";")+";"}getAsString(t){if(this.isEmpty)return;if(this._styles[t]&&!D(this._styles[t]))return this._styles[t];const e=this._styleProcessor.getReducedForm(t,this._styles).find(([e])=>e===t);return Array.isArray(e)?e[1]:void 0}getStyleNames(){if(this.isEmpty)return[];return this._getStylesEntries().map(([t])=>t)}clear(){this._styles={}}_getStylesEntries(){const t=[],e=Object.keys(this._styles);for(const i of e)t.push(...this._styleProcessor.getReducedForm(i,this._styles));return t}_cleanEmptyObjectsOnPath(t){const e=t.split(".");if(!(e.length>1))return;const i=e.splice(0,e.length-1).join("."),o=ao(this._styles,i);if(!o)return;!Array.from(Object.keys(o)).length&&this.remove(i)}}class Lo{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(t,e,i){if(D(e))No(i,Io(t),e);else if(this._normalizers.has(t)){const o=this._normalizers.get(t),{path:n,value:r}=o(e);No(i,n,r)}else No(i,t,e)}getNormalized(t,e){if(!t)return So({},e);if(void 0!==e[t])return e[t];if(this._extractors.has(t)){const i=this._extractors.get(t);if("string"==typeof i)return ao(e,i);const o=i(t,e);if(o)return o}return ao(e,Io(t))}getReducedForm(t,e){const i=this.getNormalized(t,e);if(void 0===i)return[];if(this._reducers.has(t)){return this._reducers.get(t)(i)}return[[t,i]]}getRelatedStyles(t){return this._consumables.get(t)||[]}setNormalizer(t,e){this._normalizers.set(t,e)}setExtractor(t,e){this._extractors.set(t,e)}setReducer(t,e){this._reducers.set(t,e)}setStyleRelation(t,e){this._mapStyleNames(t,e);for(const i of e)this._mapStyleNames(i,[t])}_mapStyleNames(t,e){this._consumables.has(t)||this._consumables.set(t,[]),this._consumables.get(t).push(...e)}}function Io(t){return t.replace("-",".")}function No(t,e,i){let o=i;D(i)&&(o=So({},ao(t,e),i)),Eo(t,e,o)}class zo extends Ni{constructor(t,e,i,o){if(super(t),this.name=e,this._attrs=function(t){t=Ri(t);for(const[e,i]of t)null===i?t.delete(e):"string"!=typeof i&&t.set(e,String(i));return t}(i),this._children=[],o&&this._insertChild(0,o),this._classes=new Set,this._attrs.has("class")){const t=this._attrs.get("class");Oo(this._classes,t),this._attrs.delete("class")}this._styles=new Mo(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(t,e=null){return e?e===this.name&&("element"===t||"view:element"===t):"element"===t||"view:element"===t||"node"===t||"view:node"===t}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(t){if("class"==t)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==t){const t=this._styles.toString();return""==t?void 0:t}return this._attrs.get(t)}hasAttribute(t){return"class"==t?this._classes.size>0:"style"==t?!this._styles.isEmpty:this._attrs.has(t)}isSimilar(t){if(!(t instanceof zo))return!1;if(this===t)return!0;if(this.name!=t.name)return!1;if(this._attrs.size!==t._attrs.size||this._classes.size!==t._classes.size||this._styles.size!==t._styles.size)return!1;for(const[e,i]of this._attrs)if(!t._attrs.has(e)||t._attrs.get(e)!==i)return!1;for(const e of this._classes)if(!t._classes.has(e))return!1;for(const e of this._styles.getStyleNames())if(!t._styles.has(e)||t._styles.getAsString(e)!==this._styles.getAsString(e))return!1;return!0}hasClass(...t){for(const e of t)if(!this._classes.has(e))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(t){return this._styles.getAsString(t)}getNormalizedStyle(t){return this._styles.getNormalized(t)}getStyleNames(){return this._styles.getStyleNames()}hasStyle(...t){for(const e of t)if(!this._styles.has(e))return!1;return!0}findAncestor(...t){const e=new Di(...t);let i=this.parent;for(;i;){if(e.match(i))return i;i=i.parent}return null}getCustomProperty(t){return this._customProperties.get(t)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const t=Array.from(this._classes).sort().join(","),e=this._styles.toString(),i=Array.from(this._attrs).map(t=>`${t[0]}="${t[1]}"`).sort().join(" ");return this.name+(""==t?"":` class="${t}"`)+(e?` style="${e}"`:"")+(""==i?"":" "+i)}_clone(t=!1){const e=[];if(t)for(const i of this.getChildren())e.push(i._clone(t));const i=new this.constructor(this.document,this.name,this._attrs,e);return i._classes=new Set(this._classes),i._styles.set(this._styles.getNormalized()),i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i}_appendChild(t){return this._insertChild(this.childCount,t)}_insertChild(t,e){this._fireChange("children",this);let i=0;const o=function(t,e){if("string"==typeof e)return[new zi(t,e)];vi(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new zi(t,e):e instanceof Oi?new zi(t,e.data):e)}(this.document,e);for(const e of o)null!==e.parent&&e._remove(),e.parent=this,e.document=this.document,this._children.splice(t,0,e),t++,i++;return i}_removeChildren(t,e=1){this._fireChange("children",this);for(let i=t;i0&&(this._classes.clear(),!0):"style"==t?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(t)}_addClass(t){this._fireChange("attributes",this);for(const e of Ti(t))this._classes.add(e)}_removeClass(t){this._fireChange("attributes",this);for(const e of Ti(t))this._classes.delete(e)}_setStyle(t,e){this._fireChange("attributes",this),this._styles.set(t,e)}_removeStyle(t){this._fireChange("attributes",this);for(const e of Ti(t))this._styles.remove(e)}_setCustomProperty(t,e){this._customProperties.set(t,e)}_removeCustomProperty(t){return this._customProperties.delete(t)}}function Oo(t,e){const i=e.split(/\s+/);t.clear(),i.forEach(e=>t.add(e))}class Ro extends zo{constructor(t,e,i,o){super(t,e,i,o),this.getFillerOffset=Do}is(t,e=null){return e?e===this.name&&("containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}}function Do(){const t=[...this.getChildren()],e=t[this.childCount-1];if(e&&e.is("element","br"))return this.childCount;for(const e of t)if(!e.is("uiElement"))return null;return this.childCount}var Vo=Co((function(t,e){Pt(e,re(e),t)}));const jo=Symbol("observableProperties"),Bo=Symbol("boundObservables"),Fo=Symbol("boundProperties"),Ho={set(t,e){if(D(t))return void Object.keys(t).forEach(e=>{this.set(e,t[e])},this);qo(this);const i=this[jo];if(t in this&&!i.has(t))throw new hi.a("observable-set-cannot-override",this);Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>i.get(t),set(e){const o=i.get(t);let n=this.fire("set:"+t,t,e,o);void 0===n&&(n=e),o===n&&i.has(t)||(i.set(t,n),this.fire("change:"+t,t,n,o))}}),this[t]=e},bind(...t){if(!t.length||!Go(t))throw new hi.a("observable-bind-wrong-properties",this);if(new Set(t).size!==t.length)throw new hi.a("observable-bind-duplicate-properties",this);qo(this);const e=this[Fo];t.forEach(t=>{if(e.has(t))throw new hi.a("observable-bind-rebind",this)});const i=new Map;return t.forEach(t=>{const o={property:t,to:[]};e.set(t,o),i.set(t,o)}),{to:Wo,toMany:$o,_observable:this,_bindProperties:t,_to:[],_bindings:i}},unbind(...t){if(!this[jo])return;const e=this[Fo],i=this[Bo];if(t.length){if(!Go(t))throw new hi.a("observable-unbind-wrong-properties",this);t.forEach(t=>{const o=e.get(t);if(!o)return;let n,r,s,a;o.to.forEach(t=>{n=t[0],r=t[1],s=i.get(n),a=s[r],a.delete(o),a.size||delete s[r],Object.keys(s).length||(i.delete(n),this.stopListening(n,"change"))}),e.delete(t)})}else i.forEach((t,e)=>{this.stopListening(e,"change")}),i.clear(),e.clear()},decorate(t){const e=this[t];if(!e)throw new hi.a("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:t});this.on(t,(t,i)=>{t.return=e.apply(this,i)}),this[t]=function(...e){return this.fire(t,e)}}};Vo(Ho,mi);var Uo=Ho;function qo(t){t[jo]||(Object.defineProperty(t,jo,{value:new Map}),Object.defineProperty(t,Bo,{value:new Map}),Object.defineProperty(t,Fo,{value:new Map}))}function Wo(...t){const e=function(...t){if(!t.length)throw new hi.a("observable-bind-to-parse-error",null);const e={to:[]};let i;"function"==typeof t[t.length-1]&&(e.callback=t.pop());return t.forEach(t=>{if("string"==typeof t)i.properties.push(t);else{if("object"!=typeof t)throw new hi.a("observable-bind-to-parse-error",null);i={observable:t,properties:[]},e.to.push(i)}}),e}(...t),i=Array.from(this._bindings.keys()),o=i.length;if(!e.callback&&e.to.length>1)throw new hi.a("observable-bind-to-no-callback",this);if(o>1&&e.callback)throw new hi.a("observable-bind-to-extra-callback",this);var n;e.to.forEach(t=>{if(t.properties.length&&t.properties.length!==o)throw new hi.a("observable-bind-to-properties-length",this);t.properties.length||(t.properties=this._bindProperties)}),this._to=e.to,e.callback&&(this._bindings.get(i[0]).callback=e.callback),n=this._observable,this._to.forEach(t=>{const e=n[Bo];let i;e.get(t.observable)||n.listenTo(t.observable,"change",(o,r)=>{i=e.get(t.observable)[r],i&&i.forEach(t=>{Yo(n,t.property)})})}),function(t){let e;t._bindings.forEach((i,o)=>{t._to.forEach(n=>{e=n.properties[i.callback?0:t._bindProperties.indexOf(o)],i.to.push([n.observable,e]),function(t,e,i,o){const n=t[Bo],r=n.get(i),s=r||{};s[o]||(s[o]=new Set);s[o].add(e),r||n.set(i,s)}(t._observable,i,n.observable,e)})})}(this),this._bindProperties.forEach(t=>{Yo(this._observable,t)})}function $o(t,e,i){if(this._bindings.size>1)throw new hi.a("observable-bind-to-many-not-one-binding",this);this.to(...function(t,e){const i=t.map(t=>[t,e]);return Array.prototype.concat.apply([],i)}(t,e),i)}function Go(t){return t.every(t=>"string"==typeof t)}function Yo(t,e){const i=t[Fo].get(e);let o;i.callback?o=i.callback.apply(t,i.to.map(t=>t[0][t[1]])):(o=i.to[0],o=o[0][o[1]]),Object.prototype.hasOwnProperty.call(t,e)?t[e]=o:t.set(e,o)}class Ko extends Ro{constructor(t,e,i,o){super(t,e,i,o),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(t),this.bind("isFocused").to(t,"isFocused",e=>e&&t.selection.editableElement==this),this.listenTo(t.selection,"change",()=>{this.isFocused=t.isFocused&&t.selection.editableElement==this})}is(t,e=null){return e?e===this.name&&("editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}destroy(){this.stopListening()}}yi(Ko,Uo);const Qo=Symbol("rootName");class Jo extends Ko{constructor(t,e){super(t,e),this.rootName="main"}is(t,e=null){return e?e===this.name&&("rootElement"===t||"view:rootElement"===t||"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"rootElement"===t||"view:rootElement"===t||"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}get rootName(){return this.getCustomProperty(Qo)}set rootName(t){this._setCustomProperty(Qo,t)}set _name(t){this.name=t}}class Zo{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new hi.a("view-tree-walker-no-start-position",null);if(t.direction&&"forward"!=t.direction&&"backward"!=t.direction)throw new hi.a("view-tree-walker-unknown-direction",t.startPosition,{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this.position=Xo._createAt(t.startPosition):this.position=Xo._createAt(t.boundaries["backward"==t.direction?"end":"start"]),this.direction=t.direction||"forward",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(t){let e,i,o;do{o=this.position,({done:e,value:i}=this.next())}while(!e&&t(i));e||(this.position=o)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let t=this.position.clone();const e=this.position,i=t.parent;if(null===i.parent&&t.offset===i.childCount)return{done:!0};if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};let o;if(i instanceof zi){if(t.isAtEnd)return this.position=Xo._createAfter(i),this._next();o=i.data[t.offset]}else o=i.getChild(t.offset);if(o instanceof zo)return this.shallow?t.offset++:t=new Xo(o,0),this.position=t,this._formatReturnValue("elementStart",o,e,t,1);if(o instanceof zi){if(this.singleCharacters)return t=new Xo(o,0),this.position=t,this._next();{let i,n=o.data.length;return o==this._boundaryEndParent?(n=this.boundaries.end.offset,i=new Oi(o,0,n),t=Xo._createAfter(i)):(i=new Oi(o,0,o.data.length),t.offset++),this.position=t,this._formatReturnValue("text",i,e,t,n)}}if("string"==typeof o){let o;if(this.singleCharacters)o=1;else{o=(i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length)-t.offset}const n=new Oi(i,t.offset,o);return t.offset+=o,this.position=t,this._formatReturnValue("text",n,e,t,o)}return t=Xo._createAfter(i),this.position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",i,e,t)}_previous(){let t=this.position.clone();const e=this.position,i=t.parent;if(null===i.parent&&0===t.offset)return{done:!0};if(i==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};let o;if(i instanceof zi){if(t.isAtStart)return this.position=Xo._createBefore(i),this._previous();o=i.data[t.offset-1]}else o=i.getChild(t.offset-1);if(o instanceof zo)return this.shallow?(t.offset--,this.position=t,this._formatReturnValue("elementStart",o,e,t,1)):(t=new Xo(o,o.childCount),this.position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",o,e,t));if(o instanceof zi){if(this.singleCharacters)return t=new Xo(o,o.data.length),this.position=t,this._previous();{let i,n=o.data.length;if(o==this._boundaryStartParent){const e=this.boundaries.start.offset;i=new Oi(o,e,o.data.length-e),n=i.data.length,t=Xo._createBefore(i)}else i=new Oi(o,0,o.data.length),t.offset--;return this.position=t,this._formatReturnValue("text",i,e,t,n)}}if("string"==typeof o){let o;if(this.singleCharacters)o=1;else{const e=i===this._boundaryStartParent?this.boundaries.start.offset:0;o=t.offset-e}t.offset-=o;const n=new Oi(i,t.offset,o);return this.position=t,this._formatReturnValue("text",n,e,t,o)}return t=Xo._createBefore(i),this.position=t,this._formatReturnValue("elementStart",i,e,t,1)}_formatReturnValue(t,e,i,o,n){return e instanceof Oi&&(e.offsetInText+e.data.length==e.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?i=Xo._createAfter(e.textNode):(o=Xo._createAfter(e.textNode),this.position=o)),0===e.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?i=Xo._createBefore(e.textNode):(o=Xo._createBefore(e.textNode),this.position=o))),{done:!1,value:{type:t,item:e,previousPosition:i,nextPosition:o,length:n}}}}class Xo{constructor(t,e){this.parent=t,this.offset=e}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const t=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===t}get root(){return this.parent.root}get editableElement(){let t=this.parent;for(;!(t instanceof Ko);){if(!t.parent)return null;t=t.parent}return t}getShiftedBy(t){const e=Xo._createAt(this),i=e.offset+t;return e.offset=i<0?0:i,e}getLastMatchingPosition(t,e={}){e.startPosition=this;const i=new Zo(e);return i.skip(t),i.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(t){const e=this.getAncestors(),i=t.getAncestors();let o=0;for(;e[o]==i[o]&&e[o];)o++;return 0===o?null:e[o-1]}is(t){return"position"===t||"view:position"===t}isEqual(t){return this.parent==t.parent&&this.offset==t.offset}isBefore(t){return"before"==this.compareWith(t)}isAfter(t){return"after"==this.compareWith(t)}compareWith(t){if(this.root!==t.root)return"different";if(this.isEqual(t))return"same";const e=this.parent.is("node")?this.parent.getPath():[],i=t.parent.is("node")?t.parent.getPath():[];e.push(this.offset),i.push(t.offset);const o=Li(e,i);switch(o){case"prefix":return"before";case"extension":return"after";default:return e[o]0?new this(i,o):new this(o,i)}static _createIn(t){return this._createFromParentsAndOffsets(t,0,t,t.childCount)}static _createOn(t){const e=t.is("$textProxy")?t.offsetSize:1;return this._createFromPositionAndShift(Xo._createBefore(t),e)}}function en(t){return!(!t.item.is("attributeElement")&&!t.item.is("uiElement"))}function on(t){let e=0;for(const i of t)e++;return e}class nn{constructor(t=null,e,i){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(t,e,i)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.end:t.start).clone()}get focus(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.start:t.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const t of this._ranges)yield t.clone()}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?t.clone():null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?t.clone():null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}isEqual(t){if(this.isFake!=t.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel)return!1;if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let i=!1;for(const o of t._ranges)if(e.isEqual(o)){i=!0;break}if(!i)return!1}return!0}isSimilar(t){if(this.isBackward!=t.isBackward)return!1;const e=on(this.getRanges());if(e!=on(t.getRanges()))return!1;if(0==e)return!0;for(let e of this.getRanges()){e=e.getTrimmed();let i=!1;for(let o of t.getRanges())if(o=o.getTrimmed(),e.start.isEqual(o.start)&&e.end.isEqual(o.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(t,e,i){if(null===t)this._setRanges([]),this._setFakeOptions(e);else if(t instanceof nn||t instanceof rn)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof tn)this._setRanges([t],e&&e.backward),this._setFakeOptions(e);else if(t instanceof Xo)this._setRanges([new tn(t)]),this._setFakeOptions(e);else if(t instanceof Ni){const o=!!i&&!!i.backward;let n;if(void 0===e)throw new hi.a("view-selection-setto-required-second-parameter",this);n="in"==e?tn._createIn(t):"on"==e?tn._createOn(t):new tn(Xo._createAt(t,e)),this._setRanges([n],o),this._setFakeOptions(i)}else{if(!vi(t))throw new hi.a("view-selection-setto-not-selectable",this);this._setRanges(t,e&&e.backward),this._setFakeOptions(e)}this.fire("change")}setFocus(t,e){if(null===this.anchor)throw new hi.a("view-selection-setfocus-no-ranges",this);const i=Xo._createAt(t,e);if("same"==i.compareWith(this.focus))return;const o=this.anchor;this._ranges.pop(),"before"==i.compareWith(o)?this._addRange(new tn(i,o),!0):this._addRange(new tn(o,i)),this.fire("change")}is(t){return"selection"===t||"view:selection"===t}_setRanges(t,e=!1){t=Array.from(t),this._ranges=[];for(const e of t)this._addRange(e);this._lastRangeBackward=!!e}_setFakeOptions(t={}){this._isFake=!!t.fake,this._fakeSelectionLabel=t.fake&&t.label||""}_addRange(t,e=!1){if(!(t instanceof tn))throw new hi.a("view-selection-add-range-not-range",this);this._pushRange(t),this._lastRangeBackward=!!e}_pushRange(t){for(const e of this._ranges)if(t.isIntersecting(e))throw new hi.a("view-selection-range-intersects",this,{addedRange:t,intersectingRange:e});this._ranges.push(new tn(t.start,t.end))}}yi(nn,mi);class rn{constructor(t=null,e,i){this._selection=new nn,this._selection.delegate("change").to(this),this._selection.setTo(t,e,i)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(t){return this._selection.isEqual(t)}isSimilar(t){return this._selection.isSimilar(t)}is(t){return"selection"===t||"documentSelection"==t||"view:selection"==t||"view:documentSelection"==t}_setTo(t,e,i){this._selection.setTo(t,e,i)}_setFocus(t,e){this._selection.setFocus(t,e)}}yi(rn,mi);class sn{constructor(t){this.selection=new rn,this.roots=new xi({idProperty:"rootName"}),this.stylesProcessor=t,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(t="main"){return this.roots.get(t)}registerPostFixer(t){this._postFixers.add(t)}destroy(){this.roots.map(t=>t.destroy()),this.stopListening()}_callPostFixers(t){let e=!1;do{for(const i of this._postFixers)if(e=i(t),e)break}while(e)}}yi(sn,Uo);class an extends zo{constructor(t,e,i,o){super(t,e,i,o),this.getFillerOffset=ln,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 hi.a("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}is(t,e=null){return e?e===this.name&&("attributeElement"===t||"view:attributeElement"===t||"element"===t||"view:element"===t):"attributeElement"===t||"view:attributeElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}isSimilar(t){return null!==this.id||null!==t.id?this.id===t.id:super.isSimilar(t)&&this.priority==t.priority}_clone(t){const e=super._clone(t);return e._priority=this._priority,e._id=this._id,e}}function ln(){if(cn(this))return null;let t=this.parent;for(;t&&t.is("attributeElement");){if(cn(t)>1)return null;t=t.parent}return!t||cn(t)>1?null:this.childCount}function cn(t){return Array.from(t.getChildren()).filter(t=>!t.is("uiElement")).length}an.DEFAULT_PRIORITY=10;class dn extends zo{constructor(t,e,i,o){super(t,e,i,o),this.getFillerOffset=hn}is(t,e=null){return e?e===this.name&&("emptyElement"===t||"view:emptyElement"===t||"element"===t||"view:element"===t):"emptyElement"===t||"view:emptyElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof Ni||Array.from(e).length>0))throw new hi.a("view-emptyelement-cannot-add",[this,e])}}function hn(){return null}const un=navigator.userAgent.toLowerCase();var gn={isMac:function(t){return t.indexOf("macintosh")>-1}(un),isGecko:function(t){return!!t.match(/gecko\/\d+/)}(un),isSafari:function(t){return t.indexOf(" applewebkit/")>-1&&-1===t.indexOf("chrome")}(un),isAndroid:function(t){return t.indexOf("android")>-1}(un),isBlink:function(t){return t.indexOf("chrome/")>-1&&t.indexOf("edge/")<0}(un),features:{isRegExpUnicodePropertySupported:function(){let t=!1;try{t=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(t){}return t}()}};const mn={"⌘":"ctrl","⇧":"shift","⌥":"alt"},fn={ctrl:"⌘",shift:"⇧",alt:"⌥"},pn=function(){const t={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,cmd:1114112,shift:2228224,alt:4456448};for(let e=65;e<=90;e++){const i=String.fromCharCode(e);t[i.toLowerCase()]=e}for(let e=48;e<=57;e++)t[e-48]=e;for(let e=112;e<=123;e++)t["f"+(e-111)]=e;return t}();function bn(t){let e;if("string"==typeof t){if(e=pn[t.toLowerCase()],!e)throw new hi.a("keyboard-unknown-key",null,{key:t})}else e=t.keyCode+(t.altKey?pn.alt:0)+(t.ctrlKey?pn.ctrl:0)+(t.shiftKey?pn.shift:0);return e}function wn(t){return"string"==typeof t&&(t=xn(t)),t.map(t=>"string"==typeof t?bn(t):t).reduce((t,e)=>e+t,0)}function kn(t){return gn.isMac?xn(t).map(t=>fn[t.toLowerCase()]||t).reduce((t,e)=>t.slice(-1)in mn?t+e:t+"+"+e):t}function _n(t){return t==pn.arrowright||t==pn.arrowleft||t==pn.arrowup||t==pn.arrowdown}function vn(t,e){const i="ltr"===e;switch(t){case pn.arrowleft:return i?"left":"right";case pn.arrowright:return i?"right":"left";case pn.arrowup:return"up";case pn.arrowdown:return"down"}}function yn(t,e){const i=vn(t,e);return"down"===i||"right"===i}function xn(t){return t.split(/\s*\+\s*/)}class An extends zo{constructor(t,e,i,o){super(t,e,i,o),this.getFillerOffset=Cn}is(t,e=null){return e?e===this.name&&("uiElement"===t||"view:uiElement"===t||"element"===t||"view:element"===t):"uiElement"===t||"view:uiElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof Ni||Array.from(e).length>0))throw new hi.a("view-uielement-cannot-add",this)}render(t){return this.toDomElement(t)}toDomElement(t){const e=t.createElement(this.name);for(const t of this.getAttributeKeys())e.setAttribute(t,this.getAttribute(t));return e}}function Tn(t){t.document.on("keydown",(e,i)=>function(t,e,i){if(e.keyCode==pn.arrowright){const t=e.domTarget.ownerDocument.defaultView.getSelection(),o=1==t.rangeCount&&t.getRangeAt(0).collapsed;if(o||e.shiftKey){const e=t.focusNode,n=t.focusOffset,r=i.domPositionToView(e,n);if(null===r)return;let s=!1;const a=r.getLastMatchingPosition(t=>(t.item.is("uiElement")&&(s=!0),!(!t.item.is("uiElement")&&!t.item.is("attributeElement"))));if(s){const e=i.viewPositionToDom(a);o?t.collapse(e.parent,e.offset):t.extend(e.parent,e.offset)}}}}(0,i,t.domConverter))}function Cn(){return null}class Sn extends zo{constructor(t,e,i,o){super(t,e,i,o),this.getFillerOffset=Pn}is(t,e=null){return e?e===this.name&&("rawElement"===t||"view:rawElement"===t||"element"===t||"view:element"===t):"rawElement"===t||"view:rawElement"===t||t===this.name||t==="view:"+this.name||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof Ni||Array.from(e).length>0))throw new hi.a("view-rawelement-cannot-add",[this,e])}}function Pn(){return null}class En{constructor(t,e){this.document=t,this._children=[],e&&this._insertChild(0,e)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"===t||"view:documentFragment"===t}_appendChild(t){return this._insertChild(this.childCount,t)}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(t,e){this._fireChange("children",this);let i=0;const o=function(t,e){if("string"==typeof e)return[new zi(t,e)];vi(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new zi(t,e):e instanceof Oi?new zi(t,e.data):e)}(this.document,e);for(const e of o)null!==e.parent&&e._remove(),e.parent=this,this._children.splice(t,0,e),t++,i++;return i}_removeChildren(t,e=1){this._fireChange("children",this);for(let i=t;i{}),o}setAttribute(t,e,i){i._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,i){y(t)&&void 0===i&&(i=e),i._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,i){i._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}breakAttributes(t){return t instanceof Xo?this._breakAttributes(t):this._breakAttributesRange(t)}breakContainer(t){const e=t.parent;if(!e.is("containerElement"))throw new hi.a("view-writer-break-non-container-element",this.document);if(!e.parent)throw new hi.a("view-writer-break-root",this.document);if(t.isAtStart)return Xo._createBefore(e);if(!t.isAtEnd){const i=e._clone(!1);this.insert(Xo._createAfter(e),i);const o=new tn(t,Xo._createAt(e,"end")),n=new Xo(i,0);this.move(o,n)}return Xo._createAfter(e)}mergeAttributes(t){const e=t.offset,i=t.parent;if(i.is("$text"))return t;if(i.is("attributeElement")&&0===i.childCount){const t=i.parent,e=i.index;return i._remove(),this._removeFromClonedElementsGroup(i),this.mergeAttributes(new Xo(t,e))}const o=i.getChild(e-1),n=i.getChild(e);if(!o||!n)return t;if(o.is("$text")&&n.is("$text"))return On(o,n);if(o.is("attributeElement")&&n.is("attributeElement")&&o.isSimilar(n)){const t=o.childCount;return o._appendChild(n.getChildren()),n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new Xo(o,t))}return t}mergeContainers(t){const e=t.nodeBefore,i=t.nodeAfter;if(!(e&&i&&e.is("containerElement")&&i.is("containerElement")))throw new hi.a("view-writer-merge-containers-invalid-position",this.document);const o=e.getChild(e.childCount-1),n=o instanceof zi?Xo._createAt(o,"end"):Xo._createAt(e,"end");return this.move(tn._createIn(i),Xo._createAt(e,"end")),this.remove(tn._createOn(i)),n}insert(t,e){(function t(e,i){for(const o of e){if(!Rn.some(t=>o instanceof t))throw new hi.a("view-writer-insert-invalid-node-type",i);o.is("$text")||t(o.getChildren(),i)}})(e=vi(e)?[...e]:[e],this.document);const i=Ln(t);if(!i)throw new hi.a("view-writer-invalid-position-container",this.document);const o=this._breakAttributes(t,!0),n=i._insertChild(o.offset,e);for(const t of e)this._addToClonedElementsGroup(t);const r=o.getShiftedBy(n),s=this.mergeAttributes(o);if(0===n)return new tn(s,s);{s.isEqual(o)||r.offset--;const t=this.mergeAttributes(r);return new tn(s,t)}}remove(t){const e=t instanceof tn?t:tn._createOn(t);if(Vn(e,this.document),e.isCollapsed)return new En(this.document);const{start:i,end:o}=this._breakAttributesRange(e,!0),n=i.parent,r=o.offset-i.offset,s=n._removeChildren(i.offset,r);for(const t of s)this._removeFromClonedElementsGroup(t);const a=this.mergeAttributes(i);return e.start=a,e.end=a.clone(),new En(this.document,s)}clear(t,e){Vn(t,this.document);const i=t.getWalker({direction:"backward",ignoreElementEnd:!0});for(const o of i){const i=o.item;let n;if(i.is("element")&&e.isSimilar(i))n=tn._createOn(i);else if(!o.nextPosition.isAfter(t.start)&&i.is("$textProxy")){const t=i.getAncestors().find(t=>t.is("element")&&e.isSimilar(t));t&&(n=tn._createIn(t))}n&&(n.end.isAfter(t.end)&&(n.end=t.end),n.start.isBefore(t.start)&&(n.start=t.start),this.remove(n))}}move(t,e){let i;if(e.isAfter(t.end)){const o=(e=this._breakAttributes(e,!0)).parent,n=o.childCount;t=this._breakAttributesRange(t,!0),i=this.remove(t),e.offset+=o.childCount-n}else i=this.remove(t);return this.insert(e,i)}wrap(t,e){if(!(e instanceof an))throw new hi.a("view-writer-wrap-invalid-attribute",this.document);if(Vn(t,this.document),t.isCollapsed){let o=t.start;o.parent.is("element")&&(i=o.parent,!Array.from(i.getChildren()).some(t=>!t.is("uiElement")))&&(o=o.getLastMatchingPosition(t=>t.item.is("uiElement"))),o=this._wrapPosition(o,e);const n=this.document.selection;return n.isCollapsed&&n.getFirstPosition().isEqual(t.start)&&this.setSelection(o),new tn(o)}return this._wrapRange(t,e);var i}unwrap(t,e){if(!(e instanceof an))throw new hi.a("view-writer-unwrap-invalid-attribute",this.document);if(Vn(t,this.document),t.isCollapsed)return t;const{start:i,end:o}=this._breakAttributesRange(t,!0),n=i.parent,r=this._unwrapChildren(n,i.offset,o.offset,e),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new tn(s,a)}rename(t,e){const i=new Ro(this.document,t,e.getAttributes());return this.insert(Xo._createAfter(e),i),this.move(tn._createIn(e),Xo._createAt(i,0)),this.remove(tn._createOn(e)),i}clearClonedElementsGroup(t){this._cloneGroups.delete(t)}createPositionAt(t,e){return Xo._createAt(t,e)}createPositionAfter(t){return Xo._createAfter(t)}createPositionBefore(t){return Xo._createBefore(t)}createRange(t,e){return new tn(t,e)}createRangeOn(t){return tn._createOn(t)}createRangeIn(t){return tn._createIn(t)}createSelection(t,e,i){return new nn(t,e,i)}_wrapChildren(t,e,i,o){let n=e;const r=[];for(;n!1,t.parent._insertChild(t.offset,i);const o=new tn(t,t.getShiftedBy(1));this.wrap(o,e);const n=new Xo(i.parent,i.index);i._remove();const r=n.nodeBefore,s=n.nodeAfter;return r instanceof zi&&s instanceof zi?On(r,s):Nn(n)}_wrapAttributeElement(t,e){if(!jn(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const i of t.getAttributeKeys())if("class"!==i&&"style"!==i&&e.hasAttribute(i)&&e.getAttribute(i)!==t.getAttribute(i))return!1;for(const i of t.getStyleNames())if(e.hasStyle(i)&&e.getStyle(i)!==t.getStyle(i))return!1;for(const i of t.getAttributeKeys())"class"!==i&&"style"!==i&&(e.hasAttribute(i)||this.setAttribute(i,t.getAttribute(i),e));for(const i of t.getStyleNames())e.hasStyle(i)||this.setStyle(i,t.getStyle(i),e);for(const i of t.getClassNames())e.hasClass(i)||this.addClass(i,e);return!0}_unwrapAttributeElement(t,e){if(!jn(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const i of t.getAttributeKeys())if("class"!==i&&"style"!==i&&(!e.hasAttribute(i)||e.getAttribute(i)!==t.getAttribute(i)))return!1;if(!e.hasClass(...t.getClassNames()))return!1;for(const i of t.getStyleNames())if(!e.hasStyle(i)||e.getStyle(i)!==t.getStyle(i))return!1;for(const i of t.getAttributeKeys())"class"!==i&&"style"!==i&&this.removeAttribute(i,e);return this.removeClass(Array.from(t.getClassNames()),e),this.removeStyle(Array.from(t.getStyleNames()),e),!0}_breakAttributesRange(t,e=!1){const i=t.start,o=t.end;if(Vn(t,this.document),t.isCollapsed){const i=this._breakAttributes(t.start,e);return new tn(i,i)}const n=this._breakAttributes(o,e),r=n.parent.childCount,s=this._breakAttributes(i,e);return n.offset+=n.parent.childCount-r,new tn(s,n)}_breakAttributes(t,e=!1){const i=t.offset,o=t.parent;if(t.parent.is("emptyElement"))throw new hi.a("view-writer-cannot-break-empty-element",this.document);if(t.parent.is("uiElement"))throw new hi.a("view-writer-cannot-break-ui-element",this.document);if(t.parent.is("rawElement"))throw new hi.a("view-writer-cannot-break-raw-element",this.document);if(!e&&o.is("$text")&&Dn(o.parent))return t.clone();if(Dn(o))return t.clone();if(o.is("$text"))return this._breakAttributes(zn(t),e);if(i==o.childCount){const t=new Xo(o.parent,o.index+1);return this._breakAttributes(t,e)}if(0===i){const t=new Xo(o.parent,o.index);return this._breakAttributes(t,e)}{const t=o.index+1,n=o._clone();o.parent._insertChild(t,n),this._addToClonedElementsGroup(n);const r=o.childCount-i,s=o._removeChildren(i,r);n._appendChild(s);const a=new Xo(o.parent,t);return this._breakAttributes(a,e)}}_addToClonedElementsGroup(t){if(!t.root.is("rootElement"))return;if(t.is("element"))for(const e of t.getChildren())this._addToClonedElementsGroup(e);const e=t.id;if(!e)return;let i=this._cloneGroups.get(e);i||(i=new Set,this._cloneGroups.set(e,i)),i.add(t),t._clonesGroup=i}_removeFromClonedElementsGroup(t){if(t.is("element"))for(const e of t.getChildren())this._removeFromClonedElementsGroup(e);const e=t.id;if(!e)return;const i=this._cloneGroups.get(e);i&&i.delete(t)}}function Ln(t){let e=t.parent;for(;!Dn(e);){if(!e)return;e=e.parent}return e}function In(t,e){return t.prioritye.priority)&&t.getIdentity()t.createTextNode(" "),Hn=t=>{const e=t.createElement("br");return e.dataset.ckeFiller=!0,e},Un=(()=>{let t="";for(let e=0;e<7;e++)t+="​";return t})();function qn(t){return Bn(t)&&t.data.substr(0,7)===Un}function Wn(t){return 7==t.data.length&&qn(t)}function $n(t){return qn(t)?t.data.slice(7):t.data}function Gn(t,e){if(e.keyCode==pn.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(1==t.rangeCount&&t.getRangeAt(0).collapsed){const e=t.getRangeAt(0).startContainer,i=t.getRangeAt(0).startOffset;qn(e)&&i<=7&&t.collapse(e,0)}}}function Yn(t,e,i,o=!1){i=i||function(t,e){return t===e},Array.isArray(t)||(t=Array.prototype.slice.call(t)),Array.isArray(e)||(e=Array.prototype.slice.call(e));const n=function(t,e,i){const o=Kn(t,e,i);if(-1===o)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const n=Qn(t,o),r=Qn(e,o),s=Kn(n,r,i),a=t.length-s,l=e.length-s;return{firstIndex:o,lastIndexOld:a,lastIndexNew:l}}(t,e,i);return o?function(t,e){const{firstIndex:i,lastIndexOld:o,lastIndexNew:n}=t;if(-1===i)return Array(e).fill("equal");let r=[];i>0&&(r=r.concat(Array(i).fill("equal")));n-i>0&&(r=r.concat(Array(n-i).fill("insert")));o-i>0&&(r=r.concat(Array(o-i).fill("delete")));n0&&i.push({index:o,type:"insert",values:t.slice(o,r)});n-o>0&&i.push({index:o+(r-o),type:"delete",howMany:n-o});return i}(e,n)}function Kn(t,e,i){for(let o=0;o200||n>200||o+n>300)return Jn.fastDiff(t,e,i,!0);let r,s;if(nc?-1:1;d[o+u]&&(d[o]=d[o+u].slice(0)),d[o]||(d[o]=[]),d[o].push(n>c?r:s);let g=Math.max(n,c),m=g-o;for(;mc;g--)h[g]=u(g);h[c]=u(c),m++}while(h[c]!==l);return d[c].slice(1)}function Zn(t,e,i){t.insertBefore(i,t.childNodes[e]||null)}function Xn(t){const e=t.parentNode;e&&e.removeChild(t)}function tr(t){if(t){if(t.defaultView)return t instanceof t.defaultView.Document;if(t.ownerDocument&&t.ownerDocument.defaultView)return t instanceof t.ownerDocument.defaultView.Node}return!1}Jn.fastDiff=Yn;class er{constructor(t,e){this.domDocuments=new Set,this.domConverter=t,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=e,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(t,e){if("text"===t)this.domConverter.mapViewToDom(e.parent)&&this.markedTexts.add(e);else{if(!this.domConverter.mapViewToDom(e))return;if("attributes"===t)this.markedAttributes.add(e);else{if("children"!==t)throw new hi.a("view-renderer-unknown-type",this);this.markedChildren.add(e)}}}render(){let t;for(const t of this.markedChildren)this._updateChildrenMappings(t);this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?t=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(t=this.selection.getFirstPosition(),this.markedChildren.add(t.parent));for(const t of this.markedAttributes)this._updateAttrs(t);for(const e of this.markedChildren)this._updateChildren(e,{inlineFillerPosition:t});for(const e of this.markedTexts)!this.markedChildren.has(e.parent)&&this.domConverter.mapViewToDom(e.parent)&&this._updateText(e,{inlineFillerPosition:t});if(t){const e=this.domConverter.viewPositionToDom(t),i=e.parent.ownerDocument;qn(e.parent)?this._inlineFiller=e.parent:this._inlineFiller=ir(i,e.parent,e.offset)}else this._inlineFiller=null;this._updateSelection(),this._updateFocus(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const i=this.domConverter.mapViewToDom(t).childNodes,o=Array.from(this.domConverter.viewChildrenToDom(t,e.ownerDocument,{withChildren:!1})),n=this._diffNodeLists(i,o),r=this._findReplaceActions(n,i,o);if(-1!==r.indexOf("replace")){const e={equal:0,insert:0,delete:0};for(const n of r)if("replace"===n){const n=e.equal+e.insert,r=e.equal+e.delete,s=t.getChild(n);!s||s.is("uiElement")||s.is("rawElement")||this._updateElementMappings(s,i[r]),Xn(o[n]),e.equal++}else e[n]++}}_updateElementMappings(t,e){this.domConverter.unbindDomElement(e),this.domConverter.bindElements(e,t),this.markedChildren.add(t),this.markedAttributes.add(t)}_getInlineFillerPosition(){const t=this.selection.getFirstPosition();return t.parent.is("$text")?Xo._createBefore(this.selection.getFirstPosition().parent):t}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=this.domConverter.viewPositionToDom(t);return!!(e&&Bn(e.parent)&&qn(e.parent))}_removeInlineFiller(){const t=this._inlineFiller;if(!qn(t))throw new hi.a("view-renderer-filler-was-lost",this);Wn(t)?t.parentNode.removeChild(t):t.data=t.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=t.parent,i=t.offset;if(!this.domConverter.mapViewToDom(e.root))return!1;if(!e.is("element"))return!1;if(!function(t){if("false"==t.getAttribute("contenteditable"))return!1;const e=t.findAncestor(t=>t.hasAttribute("contenteditable"));return!e||"true"==e.getAttribute("contenteditable")}(e))return!1;if(i===e.getFillerOffset())return!1;const o=t.nodeBefore,n=t.nodeAfter;return!(o instanceof zi||n instanceof zi)}_updateText(t,e){const i=this.domConverter.findCorrespondingDomText(t),o=this.domConverter.viewToDom(t,i.ownerDocument),n=i.data;let r=o.data;const s=e.inlineFillerPosition;if(s&&s.parent==t.parent&&s.offset==t.index&&(r=Un+r),n!=r){const t=Yn(n,r);for(const e of t)"insert"===e.type?i.insertData(e.index,e.values.join("")):i.deleteData(e.index,e.howMany)}}_updateAttrs(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const i=Array.from(e.attributes).map(t=>t.name),o=t.getAttributeKeys();for(const i of o)e.setAttribute(i,t.getAttribute(i));for(const o of i)t.hasAttribute(o)||e.removeAttribute(o)}_updateChildren(t,e){const i=this.domConverter.mapViewToDom(t);if(!i)return;const o=e.inlineFillerPosition,n=this.domConverter.mapViewToDom(t).childNodes,r=Array.from(this.domConverter.viewChildrenToDom(t,i.ownerDocument,{bind:!0,inlineFillerPosition:o}));o&&o.parent===t&&ir(i.ownerDocument,r,o.offset);const s=this._diffNodeLists(n,r);let a=0;const l=new Set;for(const t of s)"delete"===t?(l.add(n[a]),Xn(n[a])):"equal"===t&&a++;a=0;for(const t of s)"insert"===t?(Zn(i,a,r[a]),a++):"equal"===t&&(this._markDescendantTextToSync(this.domConverter.domToView(r[a])),a++);for(const t of l)t.parentNode||this.domConverter.unbindDomElement(t)}_diffNodeLists(t,e){return Jn(t=function(t,e){const i=Array.from(t);if(0==i.length||!e)return i;i[i.length-1]==e&&i.pop();return i}(t,this._fakeSelectionContainer),e,nr.bind(null,this.domConverter))}_findReplaceActions(t,e,i){if(-1===t.indexOf("insert")||-1===t.indexOf("delete"))return t;let o=[],n=[],r=[];const s={equal:0,insert:0,delete:0};for(const a of t)"insert"===a?r.push(i[s.equal+s.insert]):"delete"===a?n.push(e[s.equal+s.delete]):(o=o.concat(Jn(n,r,or).map(t=>"equal"===t?"replace":t)),o.push("equal"),n=[],r=[]),s[a]++;return o.concat(Jn(n,r,or).map(t=>"equal"===t?"replace":t))}_markDescendantTextToSync(t){if(t)if(t.is("$text"))this.markedTexts.add(t);else if(t.is("element"))for(const e of t.getChildren())this._markDescendantTextToSync(e)}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const t=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&t&&(this.selection.isFake?this._updateFakeSelection(t):(this._removeFakeSelection(),this._updateDomSelection(t)))}_updateFakeSelection(t){const e=t.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(t){const e=t.createElement("div");return e.className="ck-fake-selection-container",Object.assign(e.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),e.textContent=" ",e}(e));const i=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(i,this.selection),!this._fakeSelectionNeedsUpdate(t))return;i.parentElement&&i.parentElement==t||t.appendChild(i),i.textContent=this.selection.fakeSelectionLabel||" ";const o=e.getSelection(),n=e.createRange();o.removeAllRanges(),n.selectNodeContents(i),o.addRange(n)}_updateDomSelection(t){const e=t.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(e))return;const i=this.domConverter.viewPositionToDom(this.selection.anchor),o=this.domConverter.viewPositionToDom(this.selection.focus);t.focus(),e.collapse(i.parent,i.offset),e.extend(o.parent,o.offset),gn.isGecko&&function(t,e){const i=t.parent;if(i.nodeType!=Node.ELEMENT_NODE||t.offset!=i.childNodes.length-1)return;const o=i.childNodes[t.offset];o&&"BR"==o.tagName&&e.addRange(e.getRangeAt(0))}(o,e)}_domSelectionNeedsUpdate(t){if(!this.domConverter.isDomSelectionCorrect(t))return!0;const e=t&&this.domConverter.domSelectionToView(t);return(!e||!this.selection.isEqual(e))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(e))}_fakeSelectionNeedsUpdate(t){const e=this._fakeSelectionContainer,i=t.ownerDocument.getSelection();return!e||e.parentElement!==t||(i.anchorNode!==e&&!e.contains(i.anchorNode)||e.textContent!==this.selection.fakeSelectionLabel)}_removeDomSelection(){for(const t of this.domDocuments){if(t.getSelection().rangeCount){const e=t.activeElement,i=this.domConverter.mapDomToView(e);e&&i&&t.getSelection().removeAllRanges()}}}_removeFakeSelection(){const t=this._fakeSelectionContainer;t&&t.remove()}_updateFocus(){if(this.isFocused){const t=this.selection.editableElement;t&&this.domConverter.focus(t)}}}function ir(t,e,i){const o=e instanceof Array?e:e.childNodes,n=o[i];if(Bn(n))return n.data=Un+n.data,n;{const n=t.createTextNode(Un);return Array.isArray(e)?o.splice(i,0,n):Zn(e,i,n),n}}function or(t,e){return tr(t)&&tr(e)&&!Bn(t)&&!Bn(e)&&t.nodeType!==Node.COMMENT_NODE&&e.nodeType!==Node.COMMENT_NODE&&t.tagName.toLowerCase()===e.tagName.toLowerCase()}function nr(t,e,i){return e===i||(Bn(e)&&Bn(i)?e.data===i.data:!(!t.isBlockFiller(e)||!t.isBlockFiller(i)))}yi(er,Uo);var rr={window:window,document:document};function sr(t){let e=0;for(;t.previousSibling;)t=t.previousSibling,e++;return e}function ar(t){const e=[];for(;t&&t.nodeType!=Node.DOCUMENT_NODE;)e.unshift(t),t=t.parentNode;return e}const lr=Hn(document);class cr{constructor(t,e={}){this.document=t,this.blockFillerMode=e.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?Hn:Fn,this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new Di,this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(t,e){this._fakeSelectionMapping.set(t,new nn(e))}fakeSelectionToView(t){return this._fakeSelectionMapping.get(t)}bindElements(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}unbindDomElement(t){const e=this._domToViewMapping.get(t);if(e){this._domToViewMapping.delete(t),this._viewToDomMapping.delete(e);for(const e of t.childNodes)this.unbindDomElement(e)}}bindDocumentFragments(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}viewToDom(t,e,i={}){if(t.is("$text")){const i=this._processDataFromViewText(t);return e.createTextNode(i)}{if(this.mapViewToDom(t))return this.mapViewToDom(t);let o;if(t.is("documentFragment"))o=e.createDocumentFragment(),i.bind&&this.bindDocumentFragments(o,t);else{if(t.is("uiElement"))return o=t.render(e),i.bind&&this.bindElements(o,t),o;o=t.hasAttribute("xmlns")?e.createElementNS(t.getAttribute("xmlns"),t.name):e.createElement(t.name),t.is("rawElement")&&t.render(o),i.bind&&this.bindElements(o,t);for(const e of t.getAttributeKeys())o.setAttribute(e,t.getAttribute(e))}if(!1!==i.withChildren)for(const n of this.viewChildrenToDom(t,e,i))o.appendChild(n);return o}}*viewChildrenToDom(t,e,i={}){const o=t.getFillerOffset&&t.getFillerOffset();let n=0;for(const r of t.getChildren())o===n&&(yield this._blockFiller(e)),yield this.viewToDom(r,e,i),n++;o===n&&(yield this._blockFiller(e))}viewRangeToDom(t){const e=this.viewPositionToDom(t.start),i=this.viewPositionToDom(t.end),o=document.createRange();return o.setStart(e.parent,e.offset),o.setEnd(i.parent,i.offset),o}viewPositionToDom(t){const e=t.parent;if(e.is("$text")){const i=this.findCorrespondingDomText(e);if(!i)return null;let o=t.offset;return qn(i)&&(o+=7),{parent:i,offset:o}}{let i,o,n;if(0===t.offset){if(i=this.mapViewToDom(e),!i)return null;n=i.childNodes[0]}else{const e=t.nodeBefore;if(o=e.is("$text")?this.findCorrespondingDomText(e):this.mapViewToDom(t.nodeBefore),!o)return null;i=o.parentNode,n=o.nextSibling}if(Bn(n)&&qn(n))return{parent:n,offset:7};return{parent:i,offset:o?sr(o)+1:0}}}domToView(t,e={}){if(this.isBlockFiller(t,this.blockFillerMode))return null;const i=this.getHostViewElement(t);if(i)return i;if(Bn(t)){if(Wn(t))return null;{const e=this._processDataFromDomText(t);return""===e?null:new zi(this.document,e)}}if(this.isComment(t))return null;{if(this.mapDomToView(t))return this.mapDomToView(t);let i;if(this.isDocumentFragment(t))i=new En(this.document),e.bind&&this.bindDocumentFragments(t,i);else{const o=e.keepOriginalCase?t.tagName:t.tagName.toLowerCase();i=new zo(this.document,o),e.bind&&this.bindElements(t,i);const n=t.attributes;for(let t=n.length-1;t>=0;t--)i._setAttribute(n[t].name,n[t].value);if(!1!==e.withChildren&&this._rawContentElementMatcher.match(i))return i._setCustomProperty("$rawContent",t.innerHTML),this._encounteredRawContentDomNodes.add(t),i}if(!1!==e.withChildren)for(const o of this.domChildrenToView(t,e))i._appendChild(o);return i}}*domChildrenToView(t,e={}){for(let i=0;i{const{scrollLeft:e,scrollTop:i}=t;o.push([e,i])}),e.focus(),hr(e,t=>{const[e,i]=o.shift();t.scrollLeft=e,t.scrollTop=i}),rr.window.scrollTo(t,i)}}isElement(t){return t&&t.nodeType==Node.ELEMENT_NODE}isDocumentFragment(t){return t&&t.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(t){return t&&t.nodeType==Node.COMMENT_NODE}isBlockFiller(t){return"br"==this.blockFillerMode?t.isEqualNode(lr):!("BR"!==t.tagName||!ur(t,this.blockElements)||1!==t.parentNode.childNodes.length)||function(t,e){return Bn(t)&&" "==t.data&&ur(t,e)&&1===t.parentNode.childNodes.length}(t,this.blockElements)}isDomSelectionBackward(t){if(t.isCollapsed)return!1;const e=document.createRange();e.setStart(t.anchorNode,t.anchorOffset),e.setEnd(t.focusNode,t.focusOffset);const i=e.collapsed;return e.detach(),i}getHostViewElement(t){const e=ar(t);for(e.pop();e.length;){const t=e.pop(),i=this._domToViewMapping.get(t);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(t){return this._isDomSelectionPositionCorrect(t.anchorNode,t.anchorOffset)&&this._isDomSelectionPositionCorrect(t.focusNode,t.focusOffset)}registerRawContentMatcher(t){this._rawContentElementMatcher.add(t)}_isDomSelectionPositionCorrect(t,e){if(Bn(t)&&qn(t)&&e<7)return!1;if(this.isElement(t)&&qn(t.childNodes[e]))return!1;const i=this.mapDomToView(t);return!i||!i.is("uiElement")&&!i.is("rawElement")}_processDataFromViewText(t){let e=t.data;if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return e;if(" "==e.charAt(0)){const i=this._getTouchingViewTextNode(t,!1);!(i&&this._nodeEndsWithSpace(i))&&i||(e=" "+e.substr(1))}if(" "==e.charAt(e.length-1)){const i=this._getTouchingViewTextNode(t,!0);" "!=e.charAt(e.length-2)&&i&&" "!=i.data.charAt(0)||(e=e.substr(0,e.length-1)+" ")}return e.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(t){if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return!1;const e=this._processDataFromViewText(t);return" "==e.charAt(e.length-1)}_processDataFromDomText(t){let e=t.data;if(dr(t,this.preElements))return $n(t);e=e.replace(/[ \n\t\r]{1,}/g," ");const i=this._getTouchingInlineDomNode(t,!1),o=this._getTouchingInlineDomNode(t,!0),n=this._checkShouldLeftTrimDomText(t,i),r=this._checkShouldRightTrimDomText(t,o);return n&&(e=e.replace(/^ /,"")),r&&(e=e.replace(/ $/,"")),e=$n(new Text(e)),e=e.replace(/ \u00A0/g," "),(/( |\u00A0)\u00A0$/.test(e)||!o||o.data&&" "==o.data.charAt(0))&&(e=e.replace(/\u00A0$/," ")),n&&(e=e.replace(/^\u00A0/," ")),e}_checkShouldLeftTrimDomText(t,e){return!e||(!!ii(e)||!this._encounteredRawContentDomNodes.has(t.previousSibling)&&/[^\S\u00A0]/.test(e.data.charAt(e.data.length-1)))}_checkShouldRightTrimDomText(t,e){return!e&&!qn(t)}_getTouchingViewTextNode(t,e){const i=new Zo({startPosition:e?Xo._createAfter(t):Xo._createBefore(t),direction:e?"forward":"backward"});for(const t of i){if(t.item.is("containerElement"))return null;if(t.item.is("element","br"))return null;if(t.item.is("$textProxy"))return t.item}return null}_getTouchingInlineDomNode(t,e){if(!t.parentNode)return null;const i=e?"nextNode":"previousNode",o=t.ownerDocument,n=ar(t)[0],r=o.createTreeWalker(n,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode:t=>Bn(t)||"BR"==t.tagName?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});r.currentNode=t;const s=r[i]();if(null!==s){const e=function(t,e){const i=ar(t),o=ar(e);let n=0;for(;i[n]==o[n]&&i[n];)n++;return 0===n?null:i[n-1]}(t,s);if(e&&!dr(t,this.blockElements,e)&&!dr(s,this.blockElements,e))return s}return null}}function dr(t,e,i){let o=ar(t);return i&&(o=o.slice(o.indexOf(i)+1)),o.some(t=>t.tagName&&e.includes(t.tagName.toLowerCase()))}function hr(t,e){for(;t&&t!=rr.document;)e(t),t=t.parentNode}function ur(t,e){const i=t.parentNode;return i&&i.tagName&&e.includes(i.tagName.toLowerCase())}function gr(t){const e=Object.prototype.toString.apply(t);return"[object Window]"==e||"[object global]"==e}var mr=Vo({},mi,{listenTo(t,...e){if(tr(t)||gr(t)){const i=this._getProxyEmitter(t)||new fr(t);i.attach(...e),t=i}mi.listenTo.call(this,t,...e)},stopListening(t,e,i){if(tr(t)||gr(t)){const e=this._getProxyEmitter(t);if(!e)return;t=e}mi.stopListening.call(this,t,e,i),t instanceof fr&&t.detach(e)},_getProxyEmitter(t){return e=this,i=pr(t),e[ui]&&e[ui][i]?e[ui][i].emitter:null;var e,i}});class fr{constructor(t){fi(this,pr(t)),this._domNode=t}}function pr(t){return t["data-ck-expando"]||(t["data-ck-expando"]=ci())}Vo(fr.prototype,mi,{attach(t,e,i={}){if(this._domListeners&&this._domListeners[t])return;const o={capture:!!i.useCapture,passive:!!i.usePassive},n=this._createDomListener(t,o);this._domNode.addEventListener(t,n,o),this._domListeners||(this._domListeners={}),this._domListeners[t]=n},detach(t){let e;!this._domListeners[t]||(e=this._events[t])&&e.callbacks.length||this._domListeners[t].removeListener()},_createDomListener(t,e){const i=e=>{this.fire(t,e)};return i.removeListener=()=>{this._domNode.removeEventListener(t,i,e),delete this._domListeners[t]},i}});class br{constructor(t){this.view=t,this.document=t.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(t){return t&&3===t.nodeType&&(t=t.parentNode),!(!t||1!==t.nodeType)&&t.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}yi(br,mr);var wr=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var kr=function(t){return this.__data__.has(t)};function _r(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new kt;++ea))return!1;var c=r.get(t);if(c&&r.get(e))return c==e;var d=-1,h=!0,u=2&i?new vr:void 0;for(r.set(t,e),r.set(e,t);++d{this.listenTo(t,e,(t,e)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(e.target)&&this.onDomEvent(e)},{useCapture:this.useCapture})})}fire(t,e,i){this.isEnabled&&this.document.fire(t,new Dr(this.view,e,i))}}class jr extends Vr{constructor(t){super(t),this.domEventType=["keydown","keyup"]}onDomEvent(t){this.fire(t.type,t,{keyCode:t.keyCode,altKey:t.altKey,ctrlKey:t.ctrlKey||t.metaKey,shiftKey:t.shiftKey,get keystroke(){return bn(this)}})}}var Br=function(){return o.a.Date.now()},Fr=/^\s+|\s+$/g,Hr=/^[-+]0x[0-9a-f]+$/i,Ur=/^0b[01]+$/i,qr=/^0o[0-7]+$/i,Wr=parseInt;var $r=function(t){if("number"==typeof t)return t;if(ji(t))return NaN;if(D(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=D(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Fr,"");var i=Ur.test(t);return i||qr.test(t)?Wr(t.slice(2),i?2:8):Hr.test(t)?NaN:+t},Gr=Math.max,Yr=Math.min;var Kr=function(t,e,i){var o,n,r,s,a,l,c=0,d=!1,h=!1,u=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var i=o,r=n;return o=n=void 0,c=e,s=t.apply(r,i)}function m(t){return c=t,a=setTimeout(p,e),d?g(t):s}function f(t){var i=t-l;return void 0===l||i>=e||i<0||h&&t-c>=r}function p(){var t=Br();if(f(t))return b(t);a=setTimeout(p,function(t){var i=e-(t-l);return h?Yr(i,r-(t-c)):i}(t))}function b(t){return a=void 0,u&&o?g(t):(o=n=void 0,s)}function w(){var t=Br(),i=f(t);if(o=arguments,n=this,l=t,i){if(void 0===a)return m(l);if(h)return clearTimeout(a),a=setTimeout(p,e),g(l)}return void 0===a&&(a=setTimeout(p,e)),s}return e=$r(e)||0,D(i)&&(d=!!i.leading,r=(h="maxWait"in i)?Gr($r(i.maxWait)||0,e):r,u="trailing"in i?!!i.trailing:u),w.cancel=function(){void 0!==a&&clearTimeout(a),c=0,o=l=n=a=void 0},w.flush=function(){return void 0===a?s:b(Br())},w};class Qr extends br{constructor(t){super(t),this._fireSelectionChangeDoneDebounced=Kr(t=>this.document.fire("selectionChangeDone",t),200)}observe(){const t=this.document;t.on("keydown",(e,i)=>{t.selection.isFake&&_n(i.keyCode)&&this.isEnabled&&(i.preventDefault(),this._handleSelectionMove(i.keyCode))},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(t){const e=this.document.selection,i=new nn(e.getRanges(),{backward:e.isBackward,fake:!1});t!=pn.arrowleft&&t!=pn.arrowup||i.setTo(i.getFirstPosition()),t!=pn.arrowright&&t!=pn.arrowdown||i.setTo(i.getLastPosition());const o={oldSelection:e,newSelection:i,domSelection:null};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}}class Jr extends br{constructor(t){super(t),this.mutationObserver=t.getObserver(Rr),this.selection=this.document.selection,this.domConverter=t.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Kr(t=>this.document.fire("selectionChangeDone",t),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(t){const e=t.ownerDocument;this._documents.has(e)||(this.listenTo(e,"selectionchange",(t,i)=>{this._handleSelectionChange(i,e)}),this._documents.add(e))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(t,e){if(!this.isEnabled)return;const i=e.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(i.anchorNode))return;this.mutationObserver.flush();const o=this.domConverter.domSelectionToView(i);if(0!=o.rangeCount){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(o)&&this.domConverter.isDomSelectionCorrect(i)||++this._loopbackCounter>60))if(this.selection.isSimilar(o))this.view.forceRender();else{const t={oldSelection:this.selection,newSelection:o,domSelection:i};this.document.fire("selectionChange",t),this._fireSelectionChangeDoneDebounced(t)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class Zr extends Vr{constructor(t){super(t),this.domEventType=["focus","blur"],this.useCapture=!0;const e=this.document;e.on("focus",()=>{e.isFocused=!0,this._renderTimeoutId=setTimeout(()=>t.forceRender(),50)}),e.on("blur",(i,o)=>{const n=e.selection.editableElement;null!==n&&n!==o.target||(e.isFocused=!1,t.forceRender())})}onDomEvent(t){this.fire(t.type,t)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class Xr extends Vr{constructor(t){super(t),this.domEventType=["compositionstart","compositionupdate","compositionend"];const e=this.document;e.on("compositionstart",()=>{e.isComposing=!0}),e.on("compositionend",()=>{e.isComposing=!1})}onDomEvent(t){this.fire(t.type,t)}}class ts extends Vr{constructor(t){super(t),this.domEventType=["beforeinput"]}onDomEvent(t){this.fire(t.type,t)}}function es(t){return"[object Range]"==Object.prototype.toString.apply(t)}function is(t){const e=t.ownerDocument.defaultView.getComputedStyle(t);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}const os=["top","right","bottom","left","width","height"];class ns{constructor(t){const e=es(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),ii(t)||e)if(e){const e=ns.getDomRangeRects(t);rs(this,ns.getBoundingRect(e))}else rs(this,t.getBoundingClientRect());else if(gr(t)){const{innerWidth:e,innerHeight:i}=t;rs(this,{top:0,right:e,bottom:i,left:0,width:e,height:i})}else rs(this,t)}clone(){return new ns(this)}moveTo(t,e){return this.top=e,this.right=t+this.width,this.bottom=e+this.height,this.left=t,this}moveBy(t,e){return this.top+=e,this.right+=t,this.left+=t,this.bottom+=e,this}getIntersection(t){const e={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left)};return e.width=e.right-e.left,e.height=e.bottom-e.top,e.width<0||e.height<0?null:new ns(e)}getIntersectionArea(t){const e=this.getIntersection(t);return e?e.getArea():0}getArea(){return this.width*this.height}getVisible(){const t=this._source;let e=this.clone();if(!ss(t)){let i=t.parentNode||t.commonAncestorContainer;for(;i&&!ss(i);){const t=new ns(i),o=e.getIntersection(t);if(!o)return null;o.getArea()ps(t,o));const s=ps(t,o);if(ls(o,s,e),o.parent!=o){if(n=o.frameElement,o=o.parent,!n)return}else o=null}}function ls(t,e,i){const o=e.clone().moveBy(0,i),n=e.clone().moveBy(0,-i),r=new ns(t).excludeScrollbarsAndBorders();if(![n,o].every(t=>r.contains(t))){let{scrollX:s,scrollY:a}=t;hs(n,r)?a-=r.top-e.top+i:ds(o,r)&&(a+=e.bottom-r.bottom+i),us(e,r)?s-=r.left-e.left+i:gs(e,r)&&(s+=e.right-r.right+i),t.scrollTo(s,a)}}function cs(t,e){const i=ms(t);let o,n;for(;t!=i.document.body;)n=e(),o=new ns(t).excludeScrollbarsAndBorders(),o.contains(n)||(hs(n,o)?t.scrollTop-=o.top-n.top:ds(n,o)&&(t.scrollTop+=n.bottom-o.bottom),us(n,o)?t.scrollLeft-=o.left-n.left:gs(n,o)&&(t.scrollLeft+=n.right-o.right)),t=t.parentNode}function ds(t,e){return t.bottom>e.bottom}function hs(t,e){return t.tope.right}function ms(t){return es(t)?t.startContainer.ownerDocument.defaultView:t.ownerDocument.defaultView}function fs(t){if(es(t)){let e=t.commonAncestorContainer;return Bn(e)&&(e=e.parentNode),e}return t.parentNode}function ps(t,e){const i=ms(t),o=new ns(t);if(i===e)return o;{let t=i;for(;t!=e;){const e=t.frameElement,i=new ns(e).excludeScrollbarsAndBorders();o.moveBy(i.left,i.top),t=t.parent}}return o}Object.assign({},{scrollViewportToShowTarget:as,scrollAncestorsToShowTarget:function(t){cs(fs(t),()=>new ns(t))}});class bs{constructor(t){this.document=new sn(t),this.domConverter=new cr(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new er(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new Mn(this.document),this.addObserver(Rr),this.addObserver(Jr),this.addObserver(Zr),this.addObserver(jr),this.addObserver(Qr),this.addObserver(Xr),gn.isAndroid&&this.addObserver(ts),this.document.on("keydown",Gn),Tn(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(t,e="main"){const i=this.document.getRoot(e);i._name=t.tagName.toLowerCase();const o={};for(const{name:e,value:n}of Array.from(t.attributes))o[e]=n,"class"===e?this._writer.addClass(n.split(" "),i):this._writer.setAttribute(e,n,i);this._initialDomRootAttributes.set(t,o);const n=()=>{this._writer.setAttribute("contenteditable",!i.isReadOnly,i),i.isReadOnly?this._writer.addClass("ck-read-only",i):this._writer.removeClass("ck-read-only",i)};n(),this.domRoots.set(e,t),this.domConverter.bindElements(t,i),this._renderer.markToSync("children",i),this._renderer.markToSync("attributes",i),this._renderer.domDocuments.add(t.ownerDocument),i.on("change:children",(t,e)=>this._renderer.markToSync("children",e)),i.on("change:attributes",(t,e)=>this._renderer.markToSync("attributes",e)),i.on("change:text",(t,e)=>this._renderer.markToSync("text",e)),i.on("change:isReadOnly",()=>this.change(n)),i.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const i of this._observers.values())i.observe(t,e)}detachDomRoot(t){const e=this.domRoots.get(t);Array.from(e.attributes).forEach(({name:t})=>e.removeAttribute(t));const i=this._initialDomRootAttributes.get(e);for(const t in i)e.setAttribute(t,i[t]);this.domRoots.delete(t),this.domConverter.unbindDomElement(e)}getDomRoot(t="main"){return this.domRoots.get(t)}addObserver(t){let e=this._observers.get(t);if(e)return e;e=new t(this),this._observers.set(t,e);for(const[t,i]of this.domRoots)e.observe(i,t);return e.enable(),e}getObserver(t){return this._observers.get(t)}disableObservers(){for(const t of this._observers.values())t.disable()}enableObservers(){for(const t of this._observers.values())t.enable()}scrollToTheSelection(){const t=this.document.selection.getFirstRange();t&&as({target:this.domConverter.viewRangeToDom(t),viewportOffset:20})}focus(){if(!this.document.isFocused){const t=this.document.selection.editableElement;t&&(this.domConverter.focus(t),this.forceRender())}}change(t){if(this.isRenderingInProgress||this._postFixersInProgress)throw new hi.a("cannot-change-view-tree",this);try{if(this._ongoingChange)return t(this._writer);this._ongoingChange=!0;const e=t(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),e}catch(t){hi.a.rethrowUnexpectedError(t,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(()=>{})}destroy(){for(const t of this._observers.values())t.destroy();this.document.destroy(),this.stopListening()}createPositionAt(t,e){return Xo._createAt(t,e)}createPositionAfter(t){return Xo._createAfter(t)}createPositionBefore(t){return Xo._createBefore(t)}createRange(t,e){return new tn(t,e)}createRangeOn(t){return tn._createOn(t)}createRangeIn(t){return tn._createIn(t)}createSelection(t,e,i){return new nn(t,e,i)}_disableRendering(t){this._renderingDisabled=t,0==t&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}yi(bs,Uo);class ws{constructor(t){this.parent=null,this._attrs=Ri(t)}get index(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildIndex(this)))throw new hi.a("model-node-not-found-in-parent",this);return t}get startOffset(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildStartOffset(this)))throw new hi.a("model-node-not-found-in-parent",this);return t}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const t=this.index;return null!==t&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return null!==t&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}isAttached(){return this.root.is("rootElement")}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.startOffset),e=e.parent;return t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this:this.parent;for(;i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}getCommonAncestor(t,e={}){const i=this.getAncestors(e),o=t.getAncestors(e);let n=0;for(;i[n]==o[n]&&i[n];)n++;return 0===n?null:i[n-1]}isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;const e=this.getPath(),i=t.getPath(),o=Li(e,i);switch(o){case"prefix":return!0;case"extension":return!1;default:return e[o](t[e[0]]=e[1],t),{})),t}is(t){return"node"===t||"model:node"===t}_clone(){return new ws(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(t,e){this._attrs.set(t,e)}_setAttributesTo(t){this._attrs=Ri(t)}_removeAttribute(t){return this._attrs.delete(t)}_clearAttributes(){this._attrs.clear()}}class ks extends ws{constructor(t,e){super(e),this._data=t||""}get offsetSize(){return this.data.length}get data(){return this._data}is(t){return"$text"===t||"model:$text"===t||"text"===t||"model:text"===t||"node"===t||"model:node"===t}toJSON(){const t=super.toJSON();return t.data=this.data,t}_clone(){return new ks(this.data,this.getAttributes())}static fromJSON(t){return new ks(t.data,t.attributes)}}class _s{constructor(t,e,i){if(this.textNode=t,e<0||e>t.offsetSize)throw new hi.a("model-textproxy-wrong-offsetintext",this);if(i<0||e+i>t.offsetSize)throw new hi.a("model-textproxy-wrong-length",this);this.data=t.data.substring(e,e+i),this.offsetInText=e}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}is(t){return"$textProxy"===t||"model:$textProxy"===t||"textProxy"===t||"model:textProxy"===t}getPath(){const t=this.textNode.getPath();return t.length>0&&(t[t.length-1]+=this.offsetInText),t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this:this.parent;for(;i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}hasAttribute(t){return this.textNode.hasAttribute(t)}getAttribute(t){return this.textNode.getAttribute(t)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class vs{constructor(t){this._nodes=[],t&&this._insertNodes(0,t)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((t,e)=>t+e.offsetSize,0)}getNode(t){return this._nodes[t]||null}getNodeIndex(t){const e=this._nodes.indexOf(t);return-1==e?null:e}getNodeStartOffset(t){const e=this.getNodeIndex(t);return null===e?null:this._nodes.slice(0,e).reduce((t,e)=>t+e.offsetSize,0)}indexToOffset(t){if(t==this._nodes.length)return this.maxOffset;const e=this._nodes[t];if(!e)throw new hi.a("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(e)}offsetToIndex(t){let e=0;for(const i of this._nodes){if(t>=e&&tt.toJSON())}}class ys extends ws{constructor(t,e,i){super(e),this.name=t,this._children=new vs,i&&this._insertChild(0,i)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(t,e=null){return e?e===this.name&&("element"===t||"model:element"===t):"element"===t||"model:element"===t||"node"===t||"model:node"===t}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}offsetToIndex(t){return this._children.offsetToIndex(t)}getNodeByPath(t){let e=this;for(const i of t)e=e.getChild(e.offsetToIndex(i));return e}findAncestor(t,e={includeSelf:!1}){let i=e.includeSelf?this:this.parent;for(;i;){if(i.name===t)return i;i=i.parent}return null}toJSON(){const t=super.toJSON();if(t.name=this.name,this._children.length>0){t.children=[];for(const e of this._children)t.children.push(e.toJSON())}return t}_clone(t=!1){const e=t?Array.from(this._children).map(t=>t._clone(!0)):null;return new ys(this.name,this.getAttributes(),e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const i=function(t){if("string"==typeof t)return[new ks(t)];vi(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new ks(t):t instanceof _s?new ks(t.data,t.getAttributes()):t)}(e);for(const t of i)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,i)}_removeChildren(t,e=1){const i=this._children._removeNodes(t,e);for(const t of i)t.parent=null;return i}static fromJSON(t){let e=null;if(t.children){e=[];for(const i of t.children)i.name?e.push(ys.fromJSON(i)):e.push(ks.fromJSON(i))}return new ys(t.name,t.attributes,e)}}class xs{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new hi.a("model-tree-walker-no-start-position",null);const e=t.direction||"forward";if("forward"!=e&&"backward"!=e)throw new hi.a("model-tree-walker-unknown-direction",t,{direction:e});this.direction=e,this.boundaries=t.boundaries||null,t.startPosition?this.position=t.startPosition.clone():this.position=Ts._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(t){let e,i,o,n;do{o=this.position,n=this._visitedParent,({done:e,value:i}=this.next())}while(!e&&t(i));e||(this.position=o,this._visitedParent=n)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const t=this.position,e=this.position.clone(),i=this._visitedParent;if(null===i.parent&&e.offset===i.maxOffset)return{done:!0};if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};const o=e.parent,n=Cs(e,o),r=n||Ss(e,o,n);if(r instanceof ys)return this.shallow?e.offset++:(e.path.push(0),this._visitedParent=r),this.position=e,As("elementStart",r,t,e,1);if(r instanceof ks){let o;if(this.singleCharacters)o=1;else{let t=r.endOffset;this._boundaryEndParent==i&&this.boundaries.end.offsett&&(t=this.boundaries.start.offset),o=e.offset-t}const n=e.offset-r.startOffset,s=new _s(r,n-o,o);return e.offset-=o,this.position=e,As("text",s,t,e,o)}return e.path.pop(),this.position=e,this._visitedParent=i.parent,As("elementStart",i,t,e,1)}}function As(t,e,i,o,n){return{done:!1,value:{type:t,item:e,previousPosition:i,nextPosition:o,length:n}}}class Ts{constructor(t,e,i="toNone"){if(!t.is("element")&&!t.is("documentFragment"))throw new hi.a("model-position-root-invalid",t);if(!(e instanceof Array)||0===e.length)throw new hi.a("model-position-path-incorrect-format",t,{path:e});t.is("rootElement")?e=e.slice():(e=[...t.getPath(),...e],t=t.root),this.root=t,this.path=e,this.stickiness=i}get offset(){return this.path[this.path.length-1]}set offset(t){this.path[this.path.length-1]=t}get parent(){let t=this.root;for(let e=0;ei.path.length){if(e.offset!==o.maxOffset)return!1;e.path=e.path.slice(0,-1),o=o.parent,e.offset++}else{if(0!==i.offset)return!1;i.path=i.path.slice(0,-1)}}}is(t){return"position"===t||"model:position"===t}hasSameParentAs(t){if(this.root!==t.root)return!1;return"same"==Li(this.getParentPath(),t.getParentPath())}getTransformedByOperation(t){let e;switch(t.type){case"insert":e=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":e=this._getTransformedByMoveOperation(t);break;case"split":e=this._getTransformedBySplitOperation(t);break;case"merge":e=this._getTransformedByMergeOperation(t);break;default:e=Ts._createAt(this)}return e}_getTransformedByInsertOperation(t){return this._getTransformedByInsertion(t.position,t.howMany)}_getTransformedByMoveOperation(t){return this._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}_getTransformedBySplitOperation(t){const e=t.movedRange;return e.containsPosition(this)||e.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(t.splitPosition,t.moveTargetPosition):t.graveyardPosition?this._getTransformedByMove(t.graveyardPosition,t.insertionPosition,1):this._getTransformedByInsertion(t.insertionPosition,1)}_getTransformedByMergeOperation(t){const e=t.movedRange;let i;return e.containsPosition(this)||e.start.isEqual(this)?(i=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(i=i._getTransformedByDeletion(t.deletionPosition,1))):i=this.isEqual(t.deletionPosition)?Ts._createAt(t.deletionPosition):this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),i}_getTransformedByDeletion(t,e){const i=Ts._createAt(this);if(this.root!=t.root)return i;if("same"==Li(t.getParentPath(),this.getParentPath())){if(t.offsetthis.offset)return null;i.offset-=e}}else if("prefix"==Li(t.getParentPath(),this.getParentPath())){const o=t.path.length-1;if(t.offset<=this.path[o]){if(t.offset+e>this.path[o])return null;i.path[o]-=e}}return i}_getTransformedByInsertion(t,e){const i=Ts._createAt(this);if(this.root!=t.root)return i;if("same"==Li(t.getParentPath(),this.getParentPath()))(t.offsete+1;){const e=o.maxOffset-i.offset;0!==e&&t.push(new Es(i,i.getShiftedBy(e))),i.path=i.path.slice(0,-1),i.offset++,o=o.parent}for(;i.path.length<=this.end.path.length;){const e=this.end.path[i.path.length-1],o=e-i.offset;0!==o&&t.push(new Es(i,i.getShiftedBy(o))),i.offset=e,i.path.push(0)}return t}getWalker(t={}){return t.boundaries=this,new xs(t)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new xs(t);for(const t of e)yield t.item}*getPositions(t={}){t.boundaries=this;const e=new xs(t);yield e.position;for(const t of e)yield t.nextPosition}getTransformedByOperation(t){switch(t.type){case"insert":return this._getTransformedByInsertOperation(t);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(t);case"split":return[this._getTransformedBySplitOperation(t)];case"merge":return[this._getTransformedByMergeOperation(t)]}return[new Es(this.start,this.end)]}getTransformedByOperations(t){const e=[new Es(this.start,this.end)];for(const i of t)for(let t=0;t0?new this(i,o):new this(o,i)}static _createIn(t){return new this(Ts._createAt(t,0),Ts._createAt(t,t.maxOffset))}static _createOn(t){return this._createFromPositionAndShift(Ts._createBefore(t),t.offsetSize)}static _createFromRanges(t){if(0===t.length)throw new hi.a("range-create-from-ranges-empty-array",null);if(1==t.length)return t[0].clone();const e=t[0];t.sort((t,e)=>t.start.isAfter(e.start)?1:-1);const i=t.indexOf(e),o=new this(e.start,e.end);if(i>0)for(let e=i-1;t[e].end.isEqual(o.start);e++)o.start=Ts._createAt(t[e].start);for(let e=i+1;e{if(e.viewPosition)return;const i=this._modelToViewMapping.get(e.modelPosition.parent);e.viewPosition=this.findPositionIn(i,e.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(t,e)=>{if(e.modelPosition)return;const i=this.findMappedViewAncestor(e.viewPosition),o=this._viewToModelMapping.get(i),n=this._toModelOffset(e.viewPosition.parent,e.viewPosition.offset,i);e.modelPosition=Ts._createAt(o,n)},{priority:"low"})}bindElements(t,e){this._modelToViewMapping.set(t,e),this._viewToModelMapping.set(e,t)}unbindViewElement(t){const e=this.toModelElement(t);if(this._viewToModelMapping.delete(t),this._elementToMarkerNames.has(t))for(const e of this._elementToMarkerNames.get(t))this._unboundMarkerNames.add(e);this._modelToViewMapping.get(e)==t&&this._modelToViewMapping.delete(e)}unbindModelElement(t){const e=this.toViewElement(t);this._modelToViewMapping.delete(t),this._viewToModelMapping.get(e)==t&&this._viewToModelMapping.delete(e)}bindElementToMarker(t,e){const i=this._markerNameToElements.get(e)||new Set;i.add(t);const o=this._elementToMarkerNames.get(t)||new Set;o.add(e),this._markerNameToElements.set(e,i),this._elementToMarkerNames.set(t,o)}unbindElementFromMarkerName(t,e){const i=this._markerNameToElements.get(e);i&&(i.delete(t),0==i.size&&this._markerNameToElements.delete(e));const o=this._elementToMarkerNames.get(t);o&&(o.delete(e),0==o.size&&this._elementToMarkerNames.delete(t))}flushUnboundMarkerNames(){const t=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),t}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set}toModelElement(t){return this._viewToModelMapping.get(t)}toViewElement(t){return this._modelToViewMapping.get(t)}toModelRange(t){return new Es(this.toModelPosition(t.start),this.toModelPosition(t.end))}toViewRange(t){return new tn(this.toViewPosition(t.start),this.toViewPosition(t.end))}toModelPosition(t){const e={viewPosition:t,mapper:this};return this.fire("viewToModelPosition",e),e.modelPosition}toViewPosition(t,e={isPhantom:!1}){const i={modelPosition:t,mapper:this,isPhantom:e.isPhantom};return this.fire("modelToViewPosition",i),i.viewPosition}markerNameToElements(t){const e=this._markerNameToElements.get(t);if(!e)return null;const i=new Set;for(const t of e)if(t.is("attributeElement"))for(const e of t.getElementsWithSameId())i.add(e);else i.add(t);return i}registerViewToModelLength(t,e){this._viewToModelLengthCallbacks.set(t,e)}findMappedViewAncestor(t){let e=t.parent;for(;!this._viewToModelMapping.has(e);)e=e.parent;return e}_toModelOffset(t,e,i){if(i!=t){return this._toModelOffset(t.parent,t.index,i)+this._toModelOffset(t,e,t)}if(t.is("$text"))return e;let o=0;for(let i=0;i1?e[0]+":"+e[1]:e[0]}class Ns{constructor(t){this.conversionApi=Object.assign({dispatcher:this},t),this._reconversionEventsMapping=new Map}convertChanges(t,e,i){for(const e of t.getMarkersToRemove())this.convertMarkerRemove(e.name,e.range,i);const o=this._mapChangesWithAutomaticReconversion(t);for(const t of o)"insert"===t.type?this.convertInsert(Es._createFromPositionAndShift(t.position,t.length),i):"remove"===t.type?this.convertRemove(t.position,t.length,t.name,i):"reconvert"===t.type?this.reconvertElement(t.element,i):this.convertAttribute(t.range,t.attributeKey,t.attributeOldValue,t.attributeNewValue,i);for(const t of this.conversionApi.mapper.flushUnboundMarkerNames()){const o=e.get(t).getRange();this.convertMarkerRemove(t,o,i),this.convertMarkerAdd(t,o,i)}for(const e of t.getMarkersToAdd())this.convertMarkerAdd(e.name,e.range,i)}convertInsert(t,e){this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(t);for(const e of Array.from(t).map(Os))this._convertInsertWithAttributes(e);this._clearConversionApi()}convertRemove(t,e,i,o){this.conversionApi.writer=o,this.fire("remove:"+i,{position:t,length:e},this.conversionApi),this._clearConversionApi()}convertAttribute(t,e,i,o,n){this.conversionApi.writer=n,this.conversionApi.consumable=this._createConsumableForRange(t,"attribute:"+e);for(const n of t){const t={item:n.item,range:Es._createFromPositionAndShift(n.previousPosition,n.length),attributeKey:e,attributeOldValue:i,attributeNewValue:o};this._testAndFire("attribute:"+e,t)}this._clearConversionApi()}reconvertElement(t,e){const i=Es._createOn(t);this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(i);const o=this.conversionApi.mapper,n=o.toViewElement(t);e.remove(n),this._convertInsertWithAttributes({item:t,range:i});const r=o.toViewElement(t);for(const i of Es._createIn(t)){const{item:t}=i,n=Rs(t,o);n?n.root!==r.root&&e.move(e.createRangeOn(n),o.toViewPosition(Ts._createBefore(t))):this._convertInsertWithAttributes(Os(i))}o.unbindViewElement(n),this._clearConversionApi()}convertSelection(t,e,i){const o=Array.from(e.getMarkersAtPosition(t.getFirstPosition()));if(this.conversionApi.writer=i,this.conversionApi.consumable=this._createSelectionConsumable(t,o),this.fire("selection",{selection:t},this.conversionApi),t.isCollapsed){for(const e of o){const i=e.getRange();if(!zs(t.getFirstPosition(),e,this.conversionApi.mapper))continue;const o={item:t,markerName:e.name,markerRange:i};this.conversionApi.consumable.test(t,"addMarker:"+e.name)&&this.fire("addMarker:"+e.name,o,this.conversionApi)}for(const e of t.getAttributeKeys()){const i={item:t,range:t.getFirstRange(),attributeKey:e,attributeOldValue:null,attributeNewValue:t.getAttribute(e)};this.conversionApi.consumable.test(t,"attribute:"+i.attributeKey)&&this.fire("attribute:"+i.attributeKey+":$text",i,this.conversionApi)}this._clearConversionApi()}}convertMarkerAdd(t,e,i){if(!e.root.document||"$graveyard"==e.root.rootName)return;this.conversionApi.writer=i;const o="addMarker:"+t,n=new Ls;if(n.add(e,o),this.conversionApi.consumable=n,this.fire(o,{markerName:t,markerRange:e},this.conversionApi),n.test(e,o)){this.conversionApi.consumable=this._createConsumableForRange(e,o);for(const i of e.getItems()){if(!this.conversionApi.consumable.test(i,o))continue;const n={item:i,range:Es._createOn(i),markerName:t,markerRange:e};this.fire(o,n,this.conversionApi)}this._clearConversionApi()}}convertMarkerRemove(t,e,i){e.root.document&&"$graveyard"!=e.root.rootName&&(this.conversionApi.writer=i,this.fire("removeMarker:"+t,{markerName:t,markerRange:e},this.conversionApi),this._clearConversionApi())}_mapReconversionTriggerEvent(t,e){this._reconversionEventsMapping.set(e,t)}_createInsertConsumable(t){const e=new Ls;for(const i of t){const t=i.item;e.add(t,"insert");for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i)}return e}_createConsumableForRange(t,e){const i=new Ls;for(const o of t.getItems())i.add(o,e);return i}_createSelectionConsumable(t,e){const i=new Ls;i.add(t,"selection");for(const o of e)i.add(t,"addMarker:"+o.name);for(const e of t.getAttributeKeys())i.add(t,"attribute:"+e);return i}_testAndFire(t,e){this.conversionApi.consumable.test(e.item,t)&&this.fire(function(t,e){const i=e.item.name||"$text";return`${t}:${i}`}(t,e),e,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}_convertInsertWithAttributes(t){this._testAndFire("insert",t);for(const e of t.item.getAttributeKeys())t.attributeKey=e,t.attributeOldValue=null,t.attributeNewValue=t.item.getAttribute(e),this._testAndFire("attribute:"+e,t)}_mapChangesWithAutomaticReconversion(t){const e=new Set,i=[];for(const o of t.getChanges()){const t=o.position||o.range.start,n=t.parent;if(Cs(t,n)){i.push(o);continue}const r="attribute"===o.type?Ss(t,n,null):n;if(r.is("$text")){i.push(o);continue}let s;if(s="attribute"===o.type?`attribute:${o.attributeKey}:${r.name}`:`${o.type}:${o.name}`,this._isReconvertTriggerEvent(s,r.name)){if(e.has(r))continue;e.add(r),i.push({type:"reconvert",element:r})}else i.push(o)}return i}_isReconvertTriggerEvent(t,e){return this._reconversionEventsMapping.get(t)===e}}function zs(t,e,i){const o=e.getRange(),n=Array.from(t.getAncestors());n.shift(),n.reverse();return!n.some(t=>{if(o.containsItem(t)){return!!i.toViewElement(t).getCustomProperty("addHighlight")}})}function Os(t){return{item:t.item,range:Es._createFromPositionAndShift(t.previousPosition,t.length)}}function Rs(t,e){if(t.is("textProxy")){const i=e.toViewPosition(Ts._createBefore(t)).parent;return i.is("$text")?i:null}return e.toViewElement(t)}yi(Ns,mi);class Ds{constructor(t,e,i){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,t&&this.setTo(t,e,i)}get anchor(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.end:t.start}return null}get focus(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.start:t.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(t){if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let i=!1;for(const o of t._ranges)if(e.isEqual(o)){i=!0;break}if(!i)return!1}return!0}*getRanges(){for(const t of this._ranges)yield new Es(t.start,t.end)}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?new Es(t.start,t.end):null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?new Es(t.start,t.end):null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}setTo(t,e,i){if(null===t)this._setRanges([]);else if(t instanceof Ds)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof Es)this._setRanges([t],!!e&&!!e.backward);else if(t instanceof Ts)this._setRanges([new Es(t)]);else if(t instanceof ws){const o=!!i&&!!i.backward;let n;if("in"==e)n=Es._createIn(t);else if("on"==e)n=Es._createOn(t);else{if(void 0===e)throw new hi.a("model-selection-setto-required-second-parameter",[this,t]);n=new Es(Ts._createAt(t,e))}this._setRanges([n],o)}else{if(!vi(t))throw new hi.a("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,e&&!!e.backward)}}_setRanges(t,e=!1){const i=(t=Array.from(t)).some(e=>{if(!(e instanceof Es))throw new hi.a("model-selection-set-ranges-not-range",[this,t]);return this._ranges.every(t=>!t.isEqual(e))});if(t.length!==this._ranges.length||i){this._removeAllRanges();for(const e of t)this._pushRange(e);this._lastRangeBackward=!!e,this.fire("change:range",{directChange:!0})}}setFocus(t,e){if(null===this.anchor)throw new hi.a("model-selection-setfocus-no-ranges",[this,t]);const i=Ts._createAt(t,e);if("same"==i.compareWith(this.focus))return;const o=this.anchor;this._ranges.length&&this._popRange(),"before"==i.compareWith(o)?(this._pushRange(new Es(i,o)),this._lastRangeBackward=!0):(this._pushRange(new Es(o,i)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(t){return this._attrs.has(t)}removeAttribute(t){this.hasAttribute(t)&&(this._attrs.delete(t),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}setAttribute(t,e){this.getAttribute(t)!==e&&(this._attrs.set(t,e),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}is(t){return"selection"===t||"model:selection"===t}*getSelectedBlocks(){const t=new WeakSet;for(const e of this.getRanges()){const i=Bs(e.start,t);i&&Fs(i,e)&&(yield i);for(const i of e.getWalker()){const o=i.item;"elementEnd"==i.type&&js(o,t,e)&&(yield o)}const o=Bs(e.end,t);o&&!e.end.isTouching(Ts._createAt(o,0))&&Fs(o,e)&&(yield o)}}containsEntireContent(t=this.anchor.root){const e=Ts._createAt(t,0),i=Ts._createAt(t,"end");return e.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}_pushRange(t){this._checkRange(t),this._ranges.push(new Es(t.start,t.end))}_checkRange(t){for(let e=0;e0;)this._popRange()}_popRange(){this._ranges.pop()}}function Vs(t,e){return!e.has(t)&&(e.add(t),t.root.document.model.schema.isBlock(t)&&t.parent)}function js(t,e,i){return Vs(t,e)&&Fs(t,i)}function Bs(t,e){const i=t.parent.root.document.model.schema,o=t.parent.getAncestors({parentFirst:!0,includeSelf:!0});let n=!1;const r=o.find(t=>!n&&(n=i.isLimit(t),!n&&Vs(t,e)));return o.forEach(t=>e.add(t)),r}function Fs(t,e){const i=function(t){const e=t.root.document.model.schema;let i=t.parent;for(;i;){if(e.isBlock(i))return i;i=i.parent}}(t);if(!i)return!0;return!e.containsRange(Es._createOn(i),!0)}yi(Ds,mi);class Hs extends Es{constructor(t,e){super(t,e),Us.call(this)}detach(){this.stopListening()}is(t){return"liveRange"===t||"model:liveRange"===t||"range"==t||"model:range"===t}toRange(){return new Es(this.start,this.end)}static fromRange(t){return new Hs(t.start,t.end)}}function Us(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&qs.call(this,i)},{priority:"low"})}function qs(t){const e=this.getTransformedByOperation(t),i=Es._createFromRanges(e),o=!i.isEqual(this),n=function(t,e){switch(e.type){case"insert":return t.containsPosition(e.position);case"move":case"remove":case"reinsert":case"merge":return t.containsPosition(e.sourcePosition)||t.start.isEqual(e.sourcePosition)||t.containsPosition(e.targetPosition);case"split":return t.containsPosition(e.splitPosition)||t.containsPosition(e.insertionPosition)}return!1}(this,t);let r=null;if(o){"$graveyard"==i.root.rootName&&(r="remove"==t.type?t.sourcePosition:t.deletionPosition);const e=this.toRange();this.start=i.start,this.end=i.end,this.fire("change:range",e,{deletionPosition:r})}else n&&this.fire("change:content",this.toRange(),{deletionPosition:r})}yi(Hs,mi);class Ws{constructor(t){this._selection=new $s(t),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(t){return this._selection.containsEntireContent(t)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(t){return this._selection.getAttribute(t)}hasAttribute(t){return this._selection.hasAttribute(t)}refresh(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(t){this._selection.observeMarkers(t)}is(t){return"selection"===t||"model:selection"==t||"documentSelection"==t||"model:documentSelection"==t}_setFocus(t,e){this._selection.setFocus(t,e)}_setTo(t,e,i){this._selection.setTo(t,e,i)}_setAttribute(t,e){this._selection.setAttribute(t,e)}_removeAttribute(t){this._selection.removeAttribute(t)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(t){this._selection.restoreGravity(t)}static _getStoreAttributeKey(t){return"selection:"+t}static _isStoreAttributeKey(t){return t.startsWith("selection:")}}yi(Ws,mi);class $s extends Ds{constructor(t){super(),this.markers=new xi({idProperty:"name"}),this._model=t.model,this._document=t,this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this.listenTo(this._model,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&"marker"!=i.type&&"rename"!=i.type&&"noop"!=i.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{for(const t of this.getRanges())if(!this._document._validateSelectionRange(t))throw new hi.a("document-selection-wrong-position",this,{range:t})}),this.listenTo(this._model.markers,"update",(t,e,i,o)=>{this._updateMarker(e,o)}),this.listenTo(this._document,"change",(t,e)=>{!function(t,e){const i=t.document.differ;for(const o of i.getChanges()){if("insert"!=o.type)continue;const i=o.position.parent;o.length===i.maxOffset&&t.enqueueChange(e,t=>{const e=Array.from(i.getAttributeKeys()).filter(t=>t.startsWith("selection:"));for(const o of e)t.removeAttribute(o,i)})}}(this._model,e)})}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let t=0;t{if(this._hasChangedRange=!0,e.root==this._document.graveyard){this._selectionRestorePosition=o.deletionPosition;const t=this._ranges.indexOf(e);this._ranges.splice(t,1),e.detach()}}),e}_updateMarkers(){if(!this._observedMarkers.size)return;const t=[];let e=!1;for(const e of this._model.markers){const i=e.name.split(":",1)[0];if(!this._observedMarkers.has(i))continue;const o=e.getRange();for(const i of this.getRanges())o.containsRange(i,!i.isCollapsed)&&t.push(e)}const i=Array.from(this.markers);for(const i of t)this.markers.has(i)||(this.markers.add(i),e=!0);for(const i of Array.from(this.markers))t.includes(i)||(this.markers.remove(i),e=!0);e&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateMarker(t,e){const i=t.name.split(":",1)[0];if(!this._observedMarkers.has(i))return;let o=!1;const n=Array.from(this.markers),r=this.markers.has(t);if(e){let i=!1;for(const t of this.getRanges())if(e.containsRange(t,!t.isCollapsed)){i=!0;break}i&&!r?(this.markers.add(t),o=!0):!i&&r&&(this.markers.remove(t),o=!0)}else r&&(this.markers.remove(t),o=!0);o&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateAttributes(t){const e=Ri(this._getSurroundingAttributes()),i=Ri(this.getAttributes());if(t)this._attributePriority=new Map,this._attrs=new Map;else for(const[t,e]of this._attributePriority)"low"==e&&(this._attrs.delete(t),this._attributePriority.delete(t));this._setAttributesTo(e);const o=[];for(const[t,e]of this.getAttributes())i.has(t)&&i.get(t)===e||o.push(t);for(const[t]of i)this.hasAttribute(t)||o.push(t);o.length>0&&this.fire("change:attribute",{attributeKeys:o,directChange:!1})}_setAttribute(t,e,i=!0){const o=i?"normal":"low";if("low"==o&&"normal"==this._attributePriority.get(t))return!1;return super.getAttribute(t)!==e&&(this._attrs.set(t,e),this._attributePriority.set(t,o),!0)}_removeAttribute(t,e=!0){const i=e?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(t))&&(this._attributePriority.set(t,i),!!super.hasAttribute(t)&&(this._attrs.delete(t),!0))}_setAttributesTo(t){const e=new Set;for(const[e,i]of this.getAttributes())t.get(e)!==i&&this._removeAttribute(e,!1);for(const[i,o]of t){this._setAttribute(i,o,!1)&&e.add(i)}return e}*_getStoredAttributes(){const t=this.getFirstPosition().parent;if(this.isCollapsed&&t.isEmpty)for(const e of t.getAttributeKeys())if(e.startsWith("selection:")){const i=e.substr("selection:".length);yield[i,t.getAttribute(e)]}}_getSurroundingAttributes(){const t=this.getFirstPosition(),e=this._model.schema;let i=null;if(this.isCollapsed){const o=t.textNode?t.textNode:t.nodeBefore,n=t.textNode?t.textNode:t.nodeAfter;if(this.isGravityOverridden||(i=Gs(o)),i||(i=Gs(n)),!this.isGravityOverridden&&!i){let t=o;for(;t&&!e.isInline(t)&&!i;)t=t.previousSibling,i=Gs(t)}if(!i){let t=n;for(;t&&!e.isInline(t)&&!i;)t=t.nextSibling,i=Gs(t)}i||(i=this._getStoredAttributes())}else{const t=this.getFirstRange();for(const o of t){if(o.item.is("element")&&e.isObject(o.item))break;if("text"==o.type){i=o.item.getAttributes();break}}}return i}_fixGraveyardSelection(t){const e=this._model.schema.getNearestSelectionRange(t);e&&this._pushRange(e)}}function Gs(t){return t instanceof _s||t instanceof ks?t.getAttributes():null}class Ys{constructor(t){this._dispatchers=t}add(t){for(const e of this._dispatchers)t(e);return this}}var Ks=function(t){return ti(t,5)};class Qs extends Ys{elementToElement(t){return this.add(function(t){return(t=Ks(t)).view=Xs(t.view,"container"),e=>{var i;if(e.on("insert:"+t.model,(i=t.view,(t,e,o)=>{const n=i(e.item,o);if(!n)return;if(!o.consumable.consume(e.item,"insert"))return;const r=o.mapper.toViewPosition(e.range.start);o.mapper.bindElements(e.item,n),o.writer.insert(r,n)}),{priority:t.converterPriority||"normal"}),t.triggerBy){if(t.triggerBy.attributes)for(const i of t.triggerBy.attributes)e._mapReconversionTriggerEvent(t.model,`attribute:${i}:${t.model}`);if(t.triggerBy.children)for(const i of t.triggerBy.children)e._mapReconversionTriggerEvent(t.model,"insert:"+i),e._mapReconversionTriggerEvent(t.model,"remove:"+i)}}}(t))}attributeToElement(t){return this.add(function(t){t=Ks(t);let e="attribute:"+(t.model.key?t.model.key:t.model);t.model.name&&(e+=":"+t.model.name);if(t.model.values)for(const e of t.model.values)t.view[e]=Xs(t.view[e],"attribute");else t.view=Xs(t.view,"attribute");const i=ta(t);return o=>{o.on(e,function(t){return(e,i,o)=>{const n=t(i.attributeOldValue,o),r=t(i.attributeNewValue,o);if(!n&&!r)return;if(!o.consumable.consume(i.item,e.name))return;const s=o.writer,a=s.document.selection;if(i.item instanceof Ds||i.item instanceof Ws)s.wrap(a.getFirstRange(),r);else{let t=o.mapper.toViewRange(i.range);null!==i.attributeOldValue&&n&&(t=s.unwrap(t,n)),null!==i.attributeNewValue&&r&&s.wrap(t,r)}}}(i),{priority:t.converterPriority||"normal"})}}(t))}attributeToAttribute(t){return this.add(function(t){t=Ks(t);let e="attribute:"+(t.model.key?t.model.key:t.model);t.model.name&&(e+=":"+t.model.name);if(t.model.values)for(const e of t.model.values)t.view[e]=ea(t.view[e]);else t.view=ea(t.view);const i=ta(t);return o=>{var n;o.on(e,(n=i,(t,e,i)=>{const o=n(e.attributeOldValue,i),r=n(e.attributeNewValue,i);if(!o&&!r)return;if(!i.consumable.consume(e.item,t.name))return;const s=i.mapper.toViewElement(e.item),a=i.writer;if(!s)throw new hi.a("conversion-attribute-to-attribute-on-text",[e,i]);if(null!==e.attributeOldValue&&o)if("class"==o.key){const t=Ti(o.value);for(const e of t)a.removeClass(e,s)}else if("style"==o.key){const t=Object.keys(o.value);for(const e of t)a.removeStyle(e,s)}else a.removeAttribute(o.key,s);if(null!==e.attributeNewValue&&r)if("class"==r.key){const t=Ti(r.value);for(const e of t)a.addClass(e,s)}else if("style"==r.key){const t=Object.keys(r.value);for(const e of t)a.setStyle(e,r.value[e],s)}else a.setAttribute(r.key,r.value,s)}),{priority:t.converterPriority||"normal"})}}(t))}markerToElement(t){return this.add(function(t){return(t=Ks(t)).view=Xs(t.view,"ui"),e=>{var i;e.on("addMarker:"+t.model,(i=t.view,(t,e,o)=>{e.isOpening=!0;const n=i(e,o);e.isOpening=!1;const r=i(e,o);if(!n||!r)return;const s=e.markerRange;if(s.isCollapsed&&!o.consumable.consume(s,t.name))return;for(const e of s)if(!o.consumable.consume(e.item,t.name))return;const a=o.mapper,l=o.writer;l.insert(a.toViewPosition(s.start),n),o.mapper.bindElementToMarker(n,e.markerName),s.isCollapsed||(l.insert(a.toViewPosition(s.end),r),o.mapper.bindElementToMarker(r,e.markerName)),t.stop()}),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,(t.view,(t,e,i)=>{const o=i.mapper.markerNameToElements(e.markerName);if(o){for(const t of o)i.mapper.unbindElementFromMarkerName(t,e.markerName),i.writer.clear(i.writer.createRangeOn(t),t);i.writer.clearClonedElementsGroup(e.markerName),t.stop()}}),{priority:t.converterPriority||"normal"})}}(t))}markerToHighlight(t){return this.add(function(t){return e=>{var i;e.on("addMarker:"+t.model,(i=t.view,(t,e,o)=>{if(!e.item)return;if(!(e.item instanceof Ds||e.item instanceof Ws||e.item.is("$textProxy")))return;const n=ia(i,e,o);if(!n)return;if(!o.consumable.consume(e.item,t.name))return;const r=o.writer,s=Js(r,n),a=r.document.selection;if(e.item instanceof Ds||e.item instanceof Ws)r.wrap(a.getFirstRange(),s,a);else{const t=o.mapper.toViewRange(e.range),i=r.wrap(t,s);for(const t of i.getItems())if(t.is("attributeElement")&&t.isSimilar(s)){o.mapper.bindElementToMarker(t,e.markerName);break}}}),{priority:t.converterPriority||"normal"}),e.on("addMarker:"+t.model,function(t){return(e,i,o)=>{if(!i.item)return;if(!(i.item instanceof ys))return;const n=ia(t,i,o);if(!n)return;if(!o.consumable.test(i.item,e.name))return;const r=o.mapper.toViewElement(i.item);if(r&&r.getCustomProperty("addHighlight")){o.consumable.consume(i.item,e.name);for(const t of Es._createIn(i.item))o.consumable.consume(t.item,e.name);r.getCustomProperty("addHighlight")(r,n,o.writer),o.mapper.bindElementToMarker(r,i.markerName)}}}(t.view),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,function(t){return(e,i,o)=>{if(i.markerRange.isCollapsed)return;const n=ia(t,i,o);if(!n)return;const r=Js(o.writer,n),s=o.mapper.markerNameToElements(i.markerName);if(s){for(const t of s)o.mapper.unbindElementFromMarkerName(t,i.markerName),t.is("attributeElement")?o.writer.unwrap(o.writer.createRangeOn(t),r):t.getCustomProperty("removeHighlight")(t,n.id,o.writer);o.writer.clearClonedElementsGroup(i.markerName),e.stop()}}}(t.view),{priority:t.converterPriority||"normal"})}}(t))}markerToData(t){return this.add(function(t){const e=(t=Ks(t)).model;t.view||(t.view=i=>({group:e,name:i.substr(t.model.length+1)}));return i=>{var o;i.on("addMarker:"+e,(o=t.view,(t,e,i)=>{const n=o(e.markerName,i);if(!n)return;const r=e.markerRange;i.consumable.consume(r,t.name)&&(Zs(r,!1,i,e,n),Zs(r,!0,i,e,n),t.stop())}),{priority:t.converterPriority||"normal"}),i.on("removeMarker:"+e,function(t){return(e,i,o)=>{const n=t(i.markerName,o);if(!n)return;const r=o.mapper.markerNameToElements(i.markerName);if(r){for(const t of r)o.mapper.unbindElementFromMarkerName(t,i.markerName),t.is("containerElement")?(s(`data-${n.group}-start-before`,t),s(`data-${n.group}-start-after`,t),s(`data-${n.group}-end-before`,t),s(`data-${n.group}-end-after`,t)):o.writer.clear(o.writer.createRangeOn(t),t);o.writer.clearClonedElementsGroup(i.markerName),e.stop()}function s(t,e){if(e.hasAttribute(t)){const i=new Set(e.getAttribute(t).split(","));i.delete(n.name),0==i.size?o.writer.removeAttribute(t,e):o.writer.setAttribute(t,Array.from(i).join(","),e)}}}}(t.view),{priority:t.converterPriority||"normal"})}}(t))}}function Js(t,e){const i=t.createAttributeElement("span",e.attributes);return e.classes&&i._addClass(e.classes),e.priority&&(i._priority=e.priority),i._id=e.id,i}function Zs(t,e,i,o,n){const r=e?t.start:t.end;if(i.schema.checkChild(r,"$text")){!function(t,e,i,o,n){const r=`${n.group}-${e?"start":"end"}`,s=n.name?{name:n.name}:null,a=i.writer.createUIElement(r,s);i.writer.insert(t,a),i.mapper.bindElementToMarker(a,o.markerName)}(i.mapper.toViewPosition(r),e,i,o,n)}else{let t,s;e&&r.nodeAfter||!e&&!r.nodeBefore?(t=r.nodeAfter,s=!0):(t=r.nodeBefore,s=!1);!function(t,e,i,o,n,r){const s=`data-${r.group}-${e?"start":"end"}-${i?"before":"after"}`,a=t.hasAttribute(s)?t.getAttribute(s).split(","):[];a.unshift(r.name),o.writer.setAttribute(s,a.join(","),t),o.mapper.bindElementToMarker(t,n.markerName)}(i.mapper.toViewElement(t),e,s,i,o,n)}}function Xs(t,e){return"function"==typeof t?t:(i,o)=>function(t,e,i){"string"==typeof t&&(t={name:t});let o;const n=e.writer,r=Object.assign({},t.attributes);if("container"==i)o=n.createContainerElement(t.name,r);else if("attribute"==i){const e={priority:t.priority||an.DEFAULT_PRIORITY};o=n.createAttributeElement(t.name,r,e)}else o=n.createUIElement(t.name,r);if(t.styles){const e=Object.keys(t.styles);for(const i of e)n.setStyle(i,t.styles[i],o)}if(t.classes){const e=t.classes;if("string"==typeof e)n.addClass(e,o);else for(const t of e)n.addClass(t,o)}return o}(t,o,e)}function ta(t){return t.model.values?(e,i)=>{const o=t.view[e];return o?o(e,i):null}:t.view}function ea(t){return"string"==typeof t?e=>({key:t,value:e}):"object"==typeof t?t.value?()=>t:e=>({key:t.key,value:e}):t}function ia(t,e,i){const o="function"==typeof t?t(e,i):t;return o?(o.priority||(o.priority=10),o.id||(o.id=e.markerName),o):null}function oa(t){const{schema:e,document:i}=t.model;for(const o of i.getRootNames()){const n=i.getRoot(o);if(n.isEmpty&&!e.checkChild(n,"$text")&&e.checkChild(n,"paragraph"))return t.insertElement("paragraph",n),!0}return!1}function na(t,e,i){const o=i.createContext(t);return!!i.checkChild(o,"paragraph")&&!!i.checkChild(o.push("paragraph"),e)}function ra(t,e){const i=e.createElement("paragraph");return e.insert(i,t),e.createPositionAt(i,0)}class sa extends Ys{elementToElement(t){return this.add(aa(t))}elementToAttribute(t){return this.add(function(t){da(t=Ks(t));const e=ha(t,!1),i=la(t.view),o=i?"element:"+i:"element";return i=>{i.on(o,e,{priority:t.converterPriority||"low"})}}(t))}attributeToAttribute(t){return this.add(function(t){t=Ks(t);let e=null;("string"==typeof t.view||t.view.key)&&(e=function(t){"string"==typeof t.view&&(t.view={key:t.view});const e=t.view.key;let i;if("class"==e||"style"==e){i={["class"==e?"classes":"styles"]:t.view.value}}else{const o=void 0===t.view.value?/[\s\S]*/:t.view.value;i={attributes:{[e]:o}}}t.view.name&&(i.name=t.view.name);return t.view=i,e}(t));da(t,e);const i=ha(t,!0);return e=>{e.on("element",i,{priority:t.converterPriority||"low"})}}(t))}elementToMarker(t){return Object(hi.c)("upcast-helpers-element-to-marker-deprecated"),this.add(function(t){return function(t){const e=t.model;t.model=(t,i)=>{const o="string"==typeof e?e:e(t,i);return i.writer.createElement("$marker",{"data-name":o})}}(t=Ks(t)),aa(t)}(t))}dataToMarker(t){return this.add(function(t){(t=Ks(t)).model||(t.model=e=>e?t.view+":"+e:t.view);const e=ca(ua(t,"start")),i=ca(ua(t,"end"));return o=>{o.on("element:"+t.view+"-start",e,{priority:t.converterPriority||"normal"}),o.on("element:"+t.view+"-end",i,{priority:t.converterPriority||"normal"});const n=di.get("low"),r=di.get("highest"),s=di.get(t.converterPriority)/r;o.on("element",function(t){return(e,i,o)=>{const n="data-"+t.view;function r(e,n){for(const r of n){const n=t.model(r,o),s=o.writer.createElement("$marker",{"data-name":n});o.writer.insert(s,e),i.modelCursor.isEqual(e)?i.modelCursor=i.modelCursor.getShiftedBy(1):i.modelCursor=i.modelCursor._getTransformedByInsertion(e,1),i.modelRange=i.modelRange._getTransformedByInsertion(e,1)[0]}}i.modelRange||(i=Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor))),o.consumable.consume(i.viewItem,{attributes:n+"-end-after"})&&r(i.modelRange.end,i.viewItem.getAttribute(n+"-end-after").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-start-after"})&&r(i.modelRange.end,i.viewItem.getAttribute(n+"-start-after").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-end-before"})&&r(i.modelRange.start,i.viewItem.getAttribute(n+"-end-before").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-start-before"})&&r(i.modelRange.start,i.viewItem.getAttribute(n+"-start-before").split(","))}}(t),{priority:n+s})}}(t))}}function aa(t){const e=ca(t=Ks(t)),i=la(t.view),o=i?"element:"+i:"element";return i=>{i.on(o,e,{priority:t.converterPriority||"normal"})}}function la(t){return"string"==typeof t?t:"object"==typeof t&&"string"==typeof t.name?t.name:null}function ca(t){const e=new Di(t.view);return(i,o,n)=>{const r=e.match(o.viewItem);if(!r)return;const s=r.match;if(s.name=!0,!n.consumable.test(o.viewItem,s))return;const a=function(t,e,i){return t instanceof Function?t(e,i):i.writer.createElement(t)}(t.model,o.viewItem,n);a&&n.safeInsert(a,o.modelCursor)&&(n.consumable.consume(o.viewItem,s),n.convertChildren(o.viewItem,a),n.updateConversionResult(a,o))}}function da(t,e=null){const i=null===e||(t=>t.getAttribute(e)),o="object"!=typeof t.model?t.model:t.model.key,n="object"!=typeof t.model||void 0===t.model.value?i:t.model.value;t.model={key:o,value:n}}function ha(t,e){const i=new Di(t.view);return(o,n,r)=>{const s=i.match(n.viewItem);if(!s)return;const a=t.model.key,l="function"==typeof t.model.value?t.model.value(n.viewItem,r):t.model.value;if(null===l)return;if(!function(t,e){const i="function"==typeof t?t(e):t;if("object"==typeof i&&!la(i))return!1;return!i.classes&&!i.attributes&&!i.styles}(t.view,n.viewItem)?delete s.match.name:s.match.name=!0,!r.consumable.test(n.viewItem,s.match))return;n.modelRange||(n=Object.assign(n,r.convertChildren(n.viewItem,n.modelCursor)));(function(t,e,i,o){let n=!1;for(const r of Array.from(t.getItems({shallow:i})))o.schema.checkAttribute(r,e.key)&&(o.writer.setAttribute(e.key,e.value,r),n=!0);return n})(n.modelRange,{key:a,value:l},e,r)&&r.consumable.consume(n.viewItem,s.match)}}function ua(t,e){const i={};return i.view=t.view+"-"+e,i.model=(e,i)=>{const o=e.getAttribute("name"),n=t.model(o,i);return i.writer.createElement("$marker",{"data-name":n})},i}class ga{constructor(t,e){this.model=t,this.view=new bs(e),this.mapper=new Ms,this.downcastDispatcher=new Ns({mapper:this.mapper,schema:t.schema});const i=this.model.document,o=i.selection,n=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(i,"change",()=>{this.view.change(t=>{this.downcastDispatcher.convertChanges(i.differ,n,t),this.downcastDispatcher.convertSelection(o,n,t)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(t,e){return(i,o)=>{const n=o.newSelection,r=[];for(const t of n.getRanges())r.push(e.toModelRange(t));const s=t.createSelection(r,{backward:n.isBackward});s.isEqual(t.document.selection)||t.change(t=>{t.setSelection(s)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(t,e,i)=>{if(!i.consumable.consume(e.item,"insert"))return;const o=i.writer,n=i.mapper.toViewPosition(e.range.start),r=o.createText(e.item.data);o.insert(n,r)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(t,e,i)=>{const o=i.mapper.toViewPosition(e.position),n=e.position.getShiftedBy(e.length),r=i.mapper.toViewPosition(n,{isPhantom:!0}),s=i.writer.createRange(o,r),a=i.writer.remove(s.getTrimmed());for(const t of i.writer.createRangeIn(a).getItems())i.mapper.unbindViewElement(t)},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,i)=>{const o=i.writer,n=o.document.selection;for(const t of n.getRanges())t.isCollapsed&&t.end.parent.isAttached()&&i.writer.mergeAttributes(t.start);o.setSelection(null)},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,i)=>{const o=e.selection;if(o.isCollapsed)return;if(!i.consumable.consume(o,"selection"))return;const n=[];for(const t of o.getRanges()){const e=i.mapper.toViewRange(t);n.push(e)}i.writer.setSelection(n,{backward:o.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,i)=>{const o=e.selection;if(!o.isCollapsed)return;if(!i.consumable.consume(o,"selection"))return;const n=i.writer,r=o.getFirstPosition(),s=i.mapper.toViewPosition(r),a=n.breakAttributes(s);n.setSelection(a)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(t=>{if("$graveyard"==t.rootName)return null;const e=new Jo(this.view.document,t.name);return e.rootName=t.rootName,this.mapper.bindElements(t,e),e})}destroy(){this.view.destroy(),this.stopListening()}}yi(ga,Uo);class ma{constructor(){this._commands=new Map}add(t,e){this._commands.set(t,e)}get(t){return this._commands.get(t)}execute(t,...e){const i=this.get(t);if(!i)throw new hi.a("commandcollection-command-not-found",this,{commandName:t});return i.execute(...e)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const t of this.commands())t.destroy()}}class fa{constructor(){this._consumables=new Map}add(t,e){let i;t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):(this._consumables.has(t)?i=this._consumables.get(t):(i=new pa(t),this._consumables.set(t,i)),i.add(e))}test(t,e){const i=this._consumables.get(t);return void 0===i?null:t.is("$text")||t.is("documentFragment")?i:i.test(e)}consume(t,e){return!!this.test(t,e)&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!1):this._consumables.get(t).consume(e),!0)}revert(t,e){const i=this._consumables.get(t);void 0!==i&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):i.revert(e))}static consumablesFromElement(t){const e={element:t,name:!0,attributes:[],classes:[],styles:[]},i=t.getAttributeKeys();for(const t of i)"style"!=t&&"class"!=t&&e.attributes.push(t);const o=t.getClassNames();for(const t of o)e.classes.push(t);const n=t.getStyleNames();for(const t of n)e.styles.push(t);return e}static createFrom(t,e){if(e||(e=new fa(t)),t.is("$text"))return e.add(t),e;t.is("element")&&e.add(t,fa.consumablesFromElement(t)),t.is("documentFragment")&&e.add(t);for(const i of t.getChildren())e=fa.createFrom(i,e);return e}}class pa{constructor(t){this.element=t,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._add(e,t[e])}test(t){if(t.name&&!this._canConsumeName)return this._canConsumeName;for(const e in this._consumables)if(e in t){const i=this._test(e,t[e]);if(!0!==i)return i}return!0}consume(t){t.name&&(this._canConsumeName=!1);for(const e in this._consumables)e in t&&this._consume(e,t[e])}revert(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._revert(e,t[e])}_add(t,e){const i=Ot(e)?e:[e],o=this._consumables[t];for(const e of i){if("attributes"===t&&("class"===e||"style"===e))throw new hi.a("viewconsumable-invalid-attribute",this);if(o.set(e,!0),"styles"===t)for(const t of this.element.document.stylesProcessor.getRelatedStyles(e))o.set(t,!0)}}_test(t,e){const i=Ot(e)?e:[e],o=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){const t=o.get(e);if(void 0===t)return null;if(!t)return!1}else{const t="class"==e?"classes":"styles",i=this._test(t,[...this._consumables[t].keys()]);if(!0!==i)return i}return!0}_consume(t,e){const i=Ot(e)?e:[e],o=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){if(o.set(e,!1),"styles"==t)for(const t of this.element.document.stylesProcessor.getRelatedStyles(e))o.set(t,!1)}else{const t="class"==e?"classes":"styles";this._consume(t,[...this._consumables[t].keys()])}}_revert(t,e){const i=Ot(e)?e:[e],o=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){!1===o.get(e)&&o.set(e,!0)}else{const t="class"==e?"classes":"styles";this._revert(t,[...this._consumables[t].keys()])}}}class ba{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(t,e)=>{e[0]=new wa(e[0])},{priority:"highest"}),this.on("checkChild",(t,e)=>{e[0]=new wa(e[0]),e[1]=this.getDefinition(e[1])},{priority:"highest"})}register(t,e){if(this._sourceDefinitions[t])throw new hi.a("schema-cannot-register-item-twice",this,{itemName:t});this._sourceDefinitions[t]=[Object.assign({},e)],this._clearCache()}extend(t,e){if(!this._sourceDefinitions[t])throw new hi.a("schema-cannot-extend-missing-item",this,{itemName:t});this._sourceDefinitions[t].push(Object.assign({},e)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(t){let e;return e="string"==typeof t?t:t.is&&(t.is("$text")||t.is("$textProxy"))?"$text":t.name,this.getDefinitions()[e]}isRegistered(t){return!!this.getDefinition(t)}isBlock(t){const e=this.getDefinition(t);return!(!e||!e.isBlock)}isLimit(t){const e=this.getDefinition(t);return!!e&&!(!e.isLimit&&!e.isObject)}isObject(t){const e=this.getDefinition(t);return!!e&&!!(e.isObject||e.isLimit&&e.isSelectable&&e.isContent)}isInline(t){const e=this.getDefinition(t);return!(!e||!e.isInline)}isSelectable(t){const e=this.getDefinition(t);return!!e&&!(!e.isSelectable&&!e.isObject)}isContent(t){const e=this.getDefinition(t);return!!e&&!(!e.isContent&&!e.isObject)}checkChild(t,e){return!!e&&this._checkContextMatch(e,t)}checkAttribute(t,e){const i=this.getDefinition(t.last);return!!i&&i.allowAttributes.includes(e)}checkMerge(t,e=null){if(t instanceof Ts){const e=t.nodeBefore,i=t.nodeAfter;if(!(e instanceof ys))throw new hi.a("schema-check-merge-no-element-before",this);if(!(i instanceof ys))throw new hi.a("schema-check-merge-no-element-after",this);return this.checkMerge(e,i)}for(const i of e.getChildren())if(!this.checkChild(t,i))return!1;return!0}addChildCheck(t){this.on("checkChild",(e,[i,o])=>{if(!o)return;const n=t(i,o);"boolean"==typeof n&&(e.stop(),e.return=n)},{priority:"high"})}addAttributeCheck(t){this.on("checkAttribute",(e,[i,o])=>{const n=t(i,o);"boolean"==typeof n&&(e.stop(),e.return=n)},{priority:"high"})}setAttributeProperties(t,e){this._attributeProperties[t]=Object.assign(this.getAttributeProperties(t),e)}getAttributeProperties(t){return this._attributeProperties[t]||{}}getLimitElement(t){let e;if(t instanceof Ts)e=t.parent;else{e=(t instanceof Es?[t]:Array.from(t.getRanges())).reduce((t,e)=>{const i=e.getCommonAncestor();return t?t.getCommonAncestor(i,{includeSelf:!0}):i},null)}for(;!this.isLimit(e)&&e.parent;)e=e.parent;return e}checkAttributeInSelection(t,e){if(t.isCollapsed){const i=[...t.getFirstPosition().getAncestors(),new ks("",t.getAttributes())];return this.checkAttribute(i,e)}{const i=t.getRanges();for(const t of i)for(const i of t)if(this.checkAttribute(i.item,e))return!0}return!1}*getValidRanges(t,e){t=function*(t){for(const e of t)yield*e.getMinimalFlatRanges()}(t);for(const i of t)yield*this._getValidRangesForRange(i,e)}getNearestSelectionRange(t,e="both"){if(this.checkChild(t,"$text"))return new Es(t);let i,o;const n=t.getAncestors().reverse().find(t=>this.isLimit(t))||t.root;"both"!=e&&"backward"!=e||(i=new xs({boundaries:Es._createIn(n),startPosition:t,direction:"backward"})),"both"!=e&&"forward"!=e||(o=new xs({boundaries:Es._createIn(n),startPosition:t}));for(const t of function*(t,e){let i=!1;for(;!i;){if(i=!0,t){const e=t.next();e.done||(i=!1,yield{walker:t,value:e.value})}if(e){const t=e.next();t.done||(i=!1,yield{walker:e,value:t.value})}}}(i,o)){const e=t.walker==i?"elementEnd":"elementStart",o=t.value;if(o.type==e&&this.isObject(o.item))return Es._createOn(o.item);if(this.checkChild(o.nextPosition,"$text"))return new Es(o.nextPosition)}return null}findAllowedParent(t,e){let i=t.parent;for(;i;){if(this.checkChild(i,e))return i;if(this.isLimit(i))return null;i=i.parent}return null}removeDisallowedAttributes(t,e){for(const i of t)if(i.is("$text"))Ea(this,i,e);else{const t=Es._createIn(i).getPositions();for(const i of t){Ea(this,i.nodeBefore||i.parent,e)}}}createContext(t){return new wa(t)}_clearCache(){this._compiledDefinitions=null}_compile(){const t={},e=this._sourceDefinitions,i=Object.keys(e);for(const o of i)t[o]=ka(e[o],o);for(const e of i)_a(t,e);for(const e of i)va(t,e);for(const e of i)ya(t,e),xa(t,e);for(const e of i)Aa(t,e),Ta(t,e);this._compiledDefinitions=t}_checkContextMatch(t,e,i=e.length-1){const o=e.getItem(i);if(t.allowIn.includes(o.name)){if(0==i)return!0;{const t=this.getDefinition(o);return this._checkContextMatch(t,e,i-1)}}return!1}*_getValidRangesForRange(t,e){let i=t.start,o=t.start;for(const n of t.getItems({shallow:!0}))n.is("element")&&(yield*this._getValidRangesForRange(Es._createIn(n),e)),this.checkAttribute(n,e)||(i.isEqual(o)||(yield new Es(i,o)),i=Ts._createAfter(n)),o=Ts._createAfter(n);i.isEqual(o)||(yield new Es(i,o))}}yi(ba,Uo);class wa{constructor(t){if(t instanceof wa)return t;"string"==typeof t?t=[t]:Array.isArray(t)||(t=t.getAncestors({includeSelf:!0})),t[0]&&"string"!=typeof t[0]&&t[0].is("documentFragment")&&t.shift(),this._items=t.map(Pa)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(t){const e=new wa([t]);return e._items=[...this._items,...e._items],e}getItem(t){return this._items[t]}*getNames(){yield*this._items.map(t=>t.name)}endsWith(t){return Array.from(this.getNames()).join(" ").endsWith(t)}startsWith(t){return Array.from(this.getNames()).join(" ").startsWith(t)}}function ka(t,e){const i={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return function(t,e){for(const i of t){const t=Object.keys(i).filter(t=>t.startsWith("is"));for(const o of t)e[o]=i[o]}}(t,i),Ca(t,i,"allowIn"),Ca(t,i,"allowContentOf"),Ca(t,i,"allowWhere"),Ca(t,i,"allowAttributes"),Ca(t,i,"allowAttributesOf"),Ca(t,i,"inheritTypesFrom"),function(t,e){for(const i of t){const t=i.inheritAllFrom;t&&(e.allowContentOf.push(t),e.allowWhere.push(t),e.allowAttributesOf.push(t),e.inheritTypesFrom.push(t))}}(t,i),i}function _a(t,e){for(const i of t[e].allowContentOf)if(t[i]){Sa(t,i).forEach(t=>{t.allowIn.push(e)})}delete t[e].allowContentOf}function va(t,e){for(const i of t[e].allowWhere){const o=t[i];if(o){const i=o.allowIn;t[e].allowIn.push(...i)}}delete t[e].allowWhere}function ya(t,e){for(const i of t[e].allowAttributesOf){const o=t[i];if(o){const i=o.allowAttributes;t[e].allowAttributes.push(...i)}}delete t[e].allowAttributesOf}function xa(t,e){const i=t[e];for(const e of i.inheritTypesFrom){const o=t[e];if(o){const t=Object.keys(o).filter(t=>t.startsWith("is"));for(const e of t)e in i||(i[e]=o[e])}}delete i.inheritTypesFrom}function Aa(t,e){const i=t[e],o=i.allowIn.filter(e=>t[e]);i.allowIn=Array.from(new Set(o))}function Ta(t,e){const i=t[e];i.allowAttributes=Array.from(new Set(i.allowAttributes))}function Ca(t,e,i){for(const o of t)"string"==typeof o[i]?e[i].push(o[i]):Array.isArray(o[i])&&e[i].push(...o[i])}function Sa(t,e){const i=t[e];return(o=t,Object.keys(o).map(t=>o[t])).filter(t=>t.allowIn.includes(i.name));var o}function Pa(t){return"string"==typeof t?{name:t,*getAttributeKeys(){},getAttribute(){}}:{name:t.is("element")?t.name:"$text",*getAttributeKeys(){yield*t.getAttributeKeys()},getAttribute:e=>t.getAttribute(e)}}function Ea(t,e,i){for(const o of e.getAttributeKeys())t.checkAttribute(e,o)||i.removeAttribute(o,e)}class Ma{constructor(t={}){this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},t),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.safeInsert=this._safeInsert.bind(this),this.conversionApi.updateConversionResult=this._updateConversionResult.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}convert(t,e,i=["$root"]){this.fire("viewCleanup",t),this._modelCursor=function(t,e){let i;for(const o of new wa(t)){const t={};for(const e of o.getAttributeKeys())t[e]=o.getAttribute(e);const n=e.createElement(o.name,t);i&&e.append(n,i),i=Ts._createAt(n,0)}return i}(i,e),this.conversionApi.writer=e,this.conversionApi.consumable=fa.createFrom(t),this.conversionApi.store={};const{modelRange:o}=this._convertItem(t,this._modelCursor),n=e.createDocumentFragment();if(o){this._removeEmptyElements();for(const t of Array.from(this._modelCursor.parent.getChildren()))e.append(t,n);n.markers=function(t,e){const i=new Set,o=new Map,n=Es._createIn(t).getItems();for(const t of n)"$marker"==t.name&&i.add(t);for(const t of i){const i=t.getAttribute("data-name"),n=e.createPositionBefore(t);o.has(i)?o.get(i).end=n.clone():o.set(i,new Es(n.clone())),e.remove(t)}return o}(n,e)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,n}_convertItem(t,e){const i=Object.assign({viewItem:t,modelCursor:e,modelRange:null});if(t.is("element")?this.fire("element:"+t.name,i,this.conversionApi):t.is("$text")?this.fire("text",i,this.conversionApi):this.fire("documentFragment",i,this.conversionApi),i.modelRange&&!(i.modelRange instanceof Es))throw new hi.a("view-conversion-dispatcher-incorrect-result",this);return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(t,e){let i=e.is("position")?e:Ts._createAt(e,0);const o=new Es(i);for(const e of Array.from(t.getChildren())){const t=this._convertItem(e,i);t.modelRange instanceof Es&&(o.end=t.modelRange.end,i=t.modelCursor)}return{modelRange:o,modelCursor:i}}_safeInsert(t,e){const i=this._splitToAllowedParent(t,e);return!!i&&(this.conversionApi.writer.insert(t,i.position),!0)}_updateConversionResult(t,e){const i=this._getSplitParts(t),o=this.conversionApi.writer;e.modelRange||(e.modelRange=o.createRange(o.createPositionBefore(t),o.createPositionAfter(i[i.length-1])));const n=this._cursorParents.get(t);e.modelCursor=n?o.createPositionAt(n,0):e.modelRange.end}_splitToAllowedParent(t,e){const{schema:i,writer:o}=this.conversionApi;let n=i.findAllowedParent(e,t);if(n){if(n===e.parent)return{position:e};this._modelCursor.parent.getAncestors().includes(n)&&(n=null)}if(!n)return na(e,t,i)?{position:ra(e,o)}:null;const r=this.conversionApi.writer.split(e,n),s=[];for(const t of r.range.getWalker())if("elementEnd"==t.type)s.push(t.item);else{const e=s.pop(),i=t.item;this._registerSplitPair(e,i)}const a=r.range.end.parent;return this._cursorParents.set(t,a),{position:r.position,cursorParent:a}}_registerSplitPair(t,e){this._splitParts.has(t)||this._splitParts.set(t,[t]);const i=this._splitParts.get(t);this._splitParts.set(e,i),i.push(e)}_getSplitParts(t){let e;return e=this._splitParts.has(t)?this._splitParts.get(t):[t],e}_removeEmptyElements(){let t=!1;for(const e of this._splitParts.keys())e.isEmpty&&(this.conversionApi.writer.remove(e),this._splitParts.delete(e),t=!0);t&&this._removeEmptyElements()}}yi(Ma,mi);class La{constructor(t,e){this.model=t,this.stylesProcessor=e,this.processor=void 0,this.mapper=new Ms,this.downcastDispatcher=new Ns({mapper:this.mapper,schema:t.schema}),this.downcastDispatcher.on("insert:$text",(t,e,i)=>{if(!i.consumable.consume(e.item,"insert"))return;const o=i.writer,n=i.mapper.toViewPosition(e.range.start),r=o.createText(e.item.data);o.insert(n,r)},{priority:"lowest"}),this.upcastDispatcher=new Ma({schema:t.schema}),this.viewDocument=new sn(e),this._viewWriter=new Mn(this.viewDocument),this.upcastDispatcher.on("text",(t,e,{schema:i,consumable:o,writer:n})=>{let r=e.modelCursor;if(!o.test(e.viewItem))return;if(!i.checkChild(r,"$text")){if(!na(r,"$text",i))return;r=ra(r,n)}o.consume(e.viewItem);const s=n.createText(e.viewItem.data);n.insert(s,r),e.modelRange=n.createRange(r,r.getShiftedBy(s.offsetSize)),e.modelCursor=e.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(t,e,i)=>{if(!e.modelRange&&i.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:o}=i.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=o}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(t,e,i)=>{if(!e.modelRange&&i.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:o}=i.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=o}},{priority:"lowest"}),this.decorate("init"),this.decorate("set"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange("transparent",oa)},{priority:"lowest"})}get(t={}){const{rootName:e="main",trim:i="empty"}=t;if(!this._checkIfRootsExists([e]))throw new hi.a("datacontroller-get-non-existent-root",this);const o=this.model.document.getRoot(e);return"empty"!==i||this.model.hasContent(o,{ignoreWhitespaces:!0})?this.stringify(o,t):""}stringify(t,e){const i=this.toView(t,e);return this.processor.toData(i)}toView(t,e){const i=this.viewDocument,o=this._viewWriter;this.mapper.clearBindings();const n=Es._createIn(t),r=new En(i);if(this.mapper.bindElements(t,r),this.downcastDispatcher.conversionApi.options=e,this.downcastDispatcher.convertInsert(n,o),!t.is("documentFragment")){const e=function(t){const e=[],i=t.root.document;if(!i)return[];const o=Es._createIn(t);for(const t of i.model.markers){const i=o.getIntersection(t.getRange());i&&e.push([t.name,i])}return e}(t);for(const[t,i]of e)this.downcastDispatcher.convertMarkerAdd(t,i,o)}return delete this.downcastDispatcher.conversionApi.options,r}init(t){if(this.model.document.version)throw new hi.a("datacontroller-init-document-not-empty",this);let e={};if("string"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new hi.a("datacontroller-init-non-existent-root",this);return this.model.enqueueChange("transparent",t=>{for(const i of Object.keys(e)){const o=this.model.document.getRoot(i);t.insert(this.parse(e[i],o),o,0)}}),Promise.resolve()}set(t){let e={};if("string"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new hi.a("datacontroller-set-non-existent-root",this);this.model.enqueueChange("transparent",t=>{t.setSelection(null),t.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const i of Object.keys(e)){const o=this.model.document.getRoot(i);t.remove(t.createRangeIn(o)),t.insert(this.parse(e[i],o),o,0)}})}parse(t,e="$root"){const i=this.processor.toView(t);return this.toModel(i,e)}toModel(t,e="$root"){return this.model.change(i=>this.upcastDispatcher.convert(t,i,e))}addStyleProcessorRules(t){t(this.stylesProcessor)}destroy(){this.stopListening()}_checkIfRootsExists(t){for(const e of t)if(!this.model.document.getRootNames().includes(e))return!1;return!0}}yi(La,Uo);class Ia{constructor(t,e){this._helpers=new Map,this._downcast=Ti(t),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Ti(e),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(t,e){const i=this._downcast.includes(e);if(!this._upcast.includes(e)&&!i)throw new hi.a("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:t,dispatchers:[e],isDowncast:i})}for(t){if(!this._helpers.has(t))throw new hi.a("conversion-for-unknown-group",this);return this._helpers.get(t)}elementToElement(t){this.for("downcast").elementToElement(t);for(const{model:e,view:i}of Na(t))this.for("upcast").elementToElement({model:e,view:i,converterPriority:t.converterPriority})}attributeToElement(t){this.for("downcast").attributeToElement(t);for(const{model:e,view:i}of Na(t))this.for("upcast").elementToAttribute({view:i,model:e,converterPriority:t.converterPriority})}attributeToAttribute(t){this.for("downcast").attributeToAttribute(t);for(const{model:e,view:i}of Na(t))this.for("upcast").attributeToAttribute({view:i,model:e})}_createConversionHelpers({name:t,dispatchers:e,isDowncast:i}){if(this._helpers.has(t))throw new hi.a("conversion-group-exists",this);const o=i?new Qs(e):new sa(e);this._helpers.set(t,o)}}function*Na(t){if(t.model.values)for(const e of t.model.values){const i={key:t.model.key,value:e},o=t.view[e],n=t.upcastAlso?t.upcastAlso[e]:void 0;yield*za(i,o,n)}else yield*za(t.model,t.view,t.upcastAlso)}function*za(t,e,i){if(yield{model:t,view:e},i)for(const e of Ti(i))yield{model:t,view:e}}class Oa{constructor(t="default"){this.operations=[],this.type=t}get baseVersion(){for(const t of this.operations)if(null!==t.baseVersion)return t.baseVersion;return null}addOperation(t){return t.batch=this,this.operations.push(t),t}}class Ra{constructor(t){this.baseVersion=t,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const t=Object.assign({},this);return t.__className=this.constructor.className,delete t.batch,delete t.isDocumentOperation,t}static get className(){return"Operation"}static fromJSON(t){return new this(t.baseVersion)}}class Da{constructor(t){this.markers=new Map,this._children=new vs,t&&this._insertChild(0,t)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"===t||"model:documentFragment"===t}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}getPath(){return[]}getNodeByPath(t){let e=this;for(const i of t)e=e.getChild(e.offsetToIndex(i));return e}offsetToIndex(t){return this._children.offsetToIndex(t)}toJSON(){const t=[];for(const e of this._children)t.push(e.toJSON());return t}static fromJSON(t){const e=[];for(const i of t)i.name?e.push(ys.fromJSON(i)):e.push(ks.fromJSON(i));return new Da(e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const i=function(t){if("string"==typeof t)return[new ks(t)];vi(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new ks(t):t instanceof _s?new ks(t.data,t.getAttributes()):t)}(e);for(const t of i)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,i)}_removeChildren(t,e=1){const i=this._children._removeNodes(t,e);for(const t of i)t.parent=null;return i}}function Va(t,e){const i=(e=Fa(e)).reduce((t,e)=>t+e.offsetSize,0),o=t.parent;Ua(t);const n=t.index;return o._insertChild(n,e),Ha(o,n+e.length),Ha(o,n),new Es(t,t.getShiftedBy(i))}function ja(t){if(!t.isFlat)throw new hi.a("operation-utils-remove-range-not-flat",this);const e=t.start.parent;Ua(t.start),Ua(t.end);const i=e._removeChildren(t.start.index,t.end.index-t.start.index);return Ha(e,t.start.index),i}function Ba(t,e){if(!t.isFlat)throw new hi.a("operation-utils-move-range-not-flat",this);const i=ja(t);return Va(e=e._getTransformedByDeletion(t.start,t.end.offset-t.start.offset),i)}function Fa(t){const e=[];t instanceof Array||(t=[t]);for(let i=0;it.maxOffset)throw new hi.a("move-operation-nodes-do-not-exist",this);if(t===e&&i=i&&this.targetPosition.path[t]t._clone(!0))),e=new Ka(this.position,t,this.baseVersion);return e.shouldReceiveAttributes=this.shouldReceiveAttributes,e}getReversed(){const t=this.position.root.document.graveyard,e=new Ts(t,[0]);return new Ya(this.position,this.nodes.maxOffset,e,this.baseVersion+1)}_validate(){const t=this.position.parent;if(!t||t.maxOffsett._clone(!0))),Va(this.position,t)}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t.nodes=this.nodes.toJSON(),t}static get className(){return"InsertOperation"}static fromJSON(t,e){const i=[];for(const e of t.nodes)e.name?i.push(ys.fromJSON(e)):i.push(ks.fromJSON(e));const o=new Ka(Ts.fromJSON(t.position,e),i,t.baseVersion);return o.shouldReceiveAttributes=t.shouldReceiveAttributes,o}}class Qa extends Ra{constructor(t,e,i,o,n,r){super(r),this.name=t,this.oldRange=e?e.clone():null,this.newRange=i?i.clone():null,this.affectsData=n,this._markers=o}get type(){return"marker"}clone(){return new Qa(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new Qa(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const t=this.newRange?"_set":"_remove";this._markers[t](this.name,this.newRange,!0,this.affectsData)}toJSON(){const t=super.toJSON();return this.oldRange&&(t.oldRange=this.oldRange.toJSON()),this.newRange&&(t.newRange=this.newRange.toJSON()),delete t._markers,t}static get className(){return"MarkerOperation"}static fromJSON(t,e){return new Qa(t.name,t.oldRange?Es.fromJSON(t.oldRange,e):null,t.newRange?Es.fromJSON(t.newRange,e):null,e.model.markers,t.affectsData,t.baseVersion)}}class Ja extends Ra{constructor(t,e,i,o){super(o),this.position=t,this.position.stickiness="toNext",this.oldName=e,this.newName=i}get type(){return"rename"}clone(){return new Ja(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new Ja(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const t=this.position.nodeAfter;if(!(t instanceof ys))throw new hi.a("rename-operation-wrong-position",this);if(t.name!==this.oldName)throw new hi.a("rename-operation-wrong-name",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t}static get className(){return"RenameOperation"}static fromJSON(t,e){return new Ja(Ts.fromJSON(t.position,e),t.oldName,t.newName,t.baseVersion)}}class Za extends Ra{constructor(t,e,i,o,n){super(n),this.root=t,this.key=e,this.oldValue=i,this.newValue=o}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new Za(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Za(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new hi.a("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 hi.a("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 hi.a("rootattribute-operation-attribute-exists",this,{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const t=super.toJSON();return t.root=this.root.toJSON(),t}static get className(){return"RootAttributeOperation"}static fromJSON(t,e){if(!e.getRoot(t.root))throw new hi.a("rootattribute-operation-fromjson-no-root",this,{rootName:t.root});return new Za(e.getRoot(t.root),t.key,t.oldValue,t.newValue,t.baseVersion)}}class Xa extends Ra{constructor(t,e,i,o,n){super(n),this.sourcePosition=t.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=e,this.targetPosition=i.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=o.clone()}get type(){return"merge"}get deletionPosition(){return new Ts(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const t=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Es(this.sourcePosition,t)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.targetPosition._getTransformedByMergeOperation(this),e=this.sourcePosition.path.slice(0,-1),i=new Ts(this.sourcePosition.root,e)._getTransformedByMergeOperation(this),o=new tl(t,this.howMany,this.graveyardPosition,this.baseVersion+1);return o.insertionPosition=i,o}_validate(){const t=this.sourcePosition.parent,e=this.targetPosition.parent;if(!t.parent)throw new hi.a("merge-operation-source-position-invalid",this);if(!e.parent)throw new hi.a("merge-operation-target-position-invalid",this);if(this.howMany!=t.maxOffset)throw new hi.a("merge-operation-how-many-invalid",this)}_execute(){const t=this.sourcePosition.parent;Ba(Es._createIn(t),this.targetPosition),Ba(Es._createOn(t),this.graveyardPosition)}toJSON(){const t=super.toJSON();return t.sourcePosition=t.sourcePosition.toJSON(),t.targetPosition=t.targetPosition.toJSON(),t.graveyardPosition=t.graveyardPosition.toJSON(),t}static get className(){return"MergeOperation"}static fromJSON(t,e){const i=Ts.fromJSON(t.sourcePosition,e),o=Ts.fromJSON(t.targetPosition,e),n=Ts.fromJSON(t.graveyardPosition,e);return new this(i,t.howMany,o,n,t.baseVersion)}}class tl extends Ra{constructor(t,e,i,o){super(o),this.splitPosition=t.clone(),this.splitPosition.stickiness="toNext",this.howMany=e,this.insertionPosition=tl.getInsertionPosition(t),this.insertionPosition.stickiness="toNone",this.graveyardPosition=i?i.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const t=this.insertionPosition.path.slice();return t.push(0),new Ts(this.insertionPosition.root,t)}get movedRange(){const t=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Es(this.splitPosition,t)}clone(){const t=new this.constructor(this.splitPosition,this.howMany,this.graveyardPosition,this.baseVersion);return t.insertionPosition=this.insertionPosition,t}getReversed(){const t=this.splitPosition.root.document.graveyard,e=new Ts(t,[0]);return new Xa(this.moveTargetPosition,this.howMany,this.splitPosition,e,this.baseVersion+1)}_validate(){const t=this.splitPosition.parent,e=this.splitPosition.offset;if(!t||t.maxOffset{for(const e of t.getAttributeKeys())this.removeAttribute(e,t)};if(t instanceof Es)for(const i of t.getItems())e(i);else e(t)}move(t,e,i){if(this._assertWriterUsedCorrectly(),!(t instanceof Es))throw new hi.a("writer-move-invalid-range",this);if(!t.isFlat)throw new hi.a("writer-move-range-not-flat",this);const o=Ts._createAt(e,i);if(o.isEqual(t.start))return;if(this._addOperationForAffectedMarkers("move",t),!al(t.root,o.root))throw new hi.a("writer-move-different-document",this);const n=t.root.document?t.root.document.version:null,r=new Ya(t.start,t.end.offset-t.start.offset,o,n);this.batch.addOperation(r),this.model.applyOperation(r)}remove(t){this._assertWriterUsedCorrectly();const e=(t instanceof Es?t:Es._createOn(t)).getMinimalFlatRanges().reverse();for(const t of e)this._addOperationForAffectedMarkers("move",t),sl(t.start,t.end.offset-t.start.offset,this.batch,this.model)}merge(t){this._assertWriterUsedCorrectly();const e=t.nodeBefore,i=t.nodeAfter;if(this._addOperationForAffectedMarkers("merge",t),!(e instanceof ys))throw new hi.a("writer-merge-no-element-before",this);if(!(i instanceof ys))throw new hi.a("writer-merge-no-element-after",this);t.root.document?this._merge(t):this._mergeDetached(t)}createPositionFromPath(t,e,i){return this.model.createPositionFromPath(t,e,i)}createPositionAt(t,e){return this.model.createPositionAt(t,e)}createPositionAfter(t){return this.model.createPositionAfter(t)}createPositionBefore(t){return this.model.createPositionBefore(t)}createRange(t,e){return this.model.createRange(t,e)}createRangeIn(t){return this.model.createRangeIn(t)}createRangeOn(t){return this.model.createRangeOn(t)}createSelection(t,e,i){return this.model.createSelection(t,e,i)}_mergeDetached(t){const e=t.nodeBefore,i=t.nodeAfter;this.move(Es._createIn(i),Ts._createAt(e,"end")),this.remove(i)}_merge(t){const e=Ts._createAt(t.nodeBefore,"end"),i=Ts._createAt(t.nodeAfter,0),o=t.root.document.graveyard,n=new Ts(o,[0]),r=t.root.document.version,s=new Xa(i,t.nodeAfter.maxOffset,e,n,r);this.batch.addOperation(s),this.model.applyOperation(s)}rename(t,e){if(this._assertWriterUsedCorrectly(),!(t instanceof ys))throw new hi.a("writer-rename-not-element-instance",this);const i=t.root.document?t.root.document.version:null,o=new Ja(Ts._createBefore(t),t.name,e,i);this.batch.addOperation(o),this.model.applyOperation(o)}split(t,e){this._assertWriterUsedCorrectly();let i,o,n=t.parent;if(!n.parent)throw new hi.a("writer-split-element-no-parent",this);if(e||(e=n.parent),!t.parent.getAncestors({includeSelf:!0}).includes(e))throw new hi.a("writer-split-invalid-limit-element",this);do{const e=n.root.document?n.root.document.version:null,r=n.maxOffset-t.offset,s=new tl(t,r,null,e);this.batch.addOperation(s),this.model.applyOperation(s),i||o||(i=n,o=t.parent.nextSibling),n=(t=this.createPositionAfter(t.parent)).parent}while(n!==e);return{position:t,range:new Es(Ts._createAt(i,"end"),Ts._createAt(o,0))}}wrap(t,e){if(this._assertWriterUsedCorrectly(),!t.isFlat)throw new hi.a("writer-wrap-range-not-flat",this);const i=e instanceof ys?e:new ys(e);if(i.childCount>0)throw new hi.a("writer-wrap-element-not-empty",this);if(null!==i.parent)throw new hi.a("writer-wrap-element-attached",this);this.insert(i,t.start);const o=new Es(t.start.getShiftedBy(1),t.end.getShiftedBy(1));this.move(o,Ts._createAt(i,0))}unwrap(t){if(this._assertWriterUsedCorrectly(),null===t.parent)throw new hi.a("writer-unwrap-element-no-parent",this);this.move(Es._createIn(t),this.createPositionAfter(t)),this.remove(t)}addMarker(t,e){if(this._assertWriterUsedCorrectly(),!e||"boolean"!=typeof e.usingOperation)throw new hi.a("writer-addmarker-no-usingoperation",this);const i=e.usingOperation,o=e.range,n=void 0!==e.affectsData&&e.affectsData;if(this.model.markers.has(t))throw new hi.a("writer-addmarker-marker-exists",this);if(!o)throw new hi.a("writer-addmarker-no-range",this);return i?(rl(this,t,null,o,n),this.model.markers.get(t)):this.model.markers._set(t,o,i,n)}updateMarker(t,e){this._assertWriterUsedCorrectly();const i="string"==typeof t?t:t.name,o=this.model.markers.get(i);if(!o)throw new hi.a("writer-updatemarker-marker-not-exists",this);if(!e)return void this.model.markers._refresh(o);const n="boolean"==typeof e.usingOperation,r="boolean"==typeof e.affectsData,s=r?e.affectsData:o.affectsData;if(!n&&!e.range&&!r)throw new hi.a("writer-updatemarker-wrong-options",this);const a=o.getRange(),l=e.range?e.range:a;n&&e.usingOperation!==o.managedUsingOperations?e.usingOperation?rl(this,i,null,l,s):(rl(this,i,a,null,s),this.model.markers._set(i,l,void 0,s)):o.managedUsingOperations?rl(this,i,a,l,s):this.model.markers._set(i,l,void 0,s)}removeMarker(t){this._assertWriterUsedCorrectly();const e="string"==typeof t?t:t.name;if(!this.model.markers.has(e))throw new hi.a("writer-removemarker-no-marker",this);const i=this.model.markers.get(e);if(!i.managedUsingOperations)return void this.model.markers._remove(e);rl(this,e,i.getRange(),null,i.affectsData)}setSelection(t,e,i){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(t,e,i)}setSelectionFocus(t,e){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(t,e)}setSelectionAttribute(t,e){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._setSelectionAttribute(t,e);else for(const[e,i]of Ri(t))this._setSelectionAttribute(e,i)}removeSelectionAttribute(t){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._removeSelectionAttribute(t);else for(const e of t)this._removeSelectionAttribute(e)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(t){this.model.document.selection._restoreGravity(t)}_setSelectionAttribute(t,e){const i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const o=Ws._getStoreAttributeKey(t);this.setAttribute(o,e,i.anchor.parent)}i._setAttribute(t,e)}_removeSelectionAttribute(t){const e=this.model.document.selection;if(e.isCollapsed&&e.anchor.parent.isEmpty){const i=Ws._getStoreAttributeKey(t);this.removeAttribute(i,e.anchor.parent)}e._removeAttribute(t)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new hi.a("writer-incorrect-use",this)}_addOperationForAffectedMarkers(t,e){for(const i of this.model.markers){if(!i.managedUsingOperations)continue;const o=i.getRange();let n=!1;if("move"===t)n=e.containsPosition(o.start)||e.start.isEqual(o.start)||e.containsPosition(o.end)||e.end.isEqual(o.end);else{const t=e.nodeBefore,i=e.nodeAfter,r=o.start.parent==t&&o.start.isAtEnd,s=o.end.parent==i&&0==o.end.offset,a=o.end.nodeAfter==i,l=o.start.nodeAfter==i;n=r||s||a||l}n&&this.updateMarker(i.name,{range:o})}}}function ol(t,e,i,o){const n=t.model,r=n.document;let s,a,l,c=o.start;for(const t of o.getWalker({shallow:!0}))l=t.item.getAttribute(e),s&&a!=l&&(a!=i&&d(),c=s),s=t.nextPosition,a=l;function d(){const o=new Es(c,s),l=o.root.document?r.version:null,d=new $a(o,e,a,i,l);t.batch.addOperation(d),n.applyOperation(d)}s instanceof Ts&&s!=c&&a!=i&&d()}function nl(t,e,i,o){const n=t.model,r=n.document,s=o.getAttribute(e);let a,l;if(s!=i){if(o.root===o){const t=o.document?r.version:null;l=new Za(o,e,s,i,t)}else{a=new Es(Ts._createBefore(o),t.createPositionAfter(o));const n=a.root.document?r.version:null;l=new $a(a,e,s,i,n)}t.batch.addOperation(l),n.applyOperation(l)}}function rl(t,e,i,o,n){const r=t.model,s=r.document,a=new Qa(e,i,o,r.markers,n,s.version);t.batch.addOperation(a),r.applyOperation(a)}function sl(t,e,i,o){let n;if(t.root.document){const i=o.document,r=new Ts(i.graveyard,[0]);n=new Ya(t,e,r,i.version)}else n=new Ga(t,e);i.addOperation(n),o.applyOperation(n)}function al(t,e){return t===e||t instanceof el&&e instanceof el}class ll{constructor(t){this._markerCollection=t,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}refreshItem(t){if(this._isInInsertedElement(t.parent))return;this._markRemove(t.parent,t.startOffset,t.offsetSize),this._markInsert(t.parent,t.startOffset,t.offsetSize);const e=Es._createOn(t);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getRange();this.bufferMarkerChange(t.name,e,e,t.affectsData)}this._cachedChanges=null}bufferOperation(t){switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const e of t.range.getItems({shallow:!0}))this._isInInsertedElement(e.parent)||this._markAttribute(e);break;case"remove":case"move":case"reinsert":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;const e=this._isInInsertedElement(t.sourcePosition.parent),i=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),i||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const e=Es._createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getRange();this.bufferMarkerChange(t.name,e,e,t.affectsData)}break}case"split":{const e=t.splitPosition.parent;this._isInInsertedElement(e)||this._markRemove(e,t.splitPosition.offset,t.howMany),this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1);break}case"merge":{const e=t.sourcePosition.parent;this._isInInsertedElement(e.parent)||this._markRemove(e.parent,e.startOffset,1);const i=t.graveyardPosition.parent;this._markInsert(i,t.graveyardPosition.offset,1);const o=t.targetPosition.parent;this._isInInsertedElement(o)||this._markInsert(o,t.targetPosition.offset,e.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(t,e,i,o){const n=this._changedMarkers.get(t);n?(n.newRange=i,n.affectsData=o,null==n.oldRange&&null==n.newRange&&this._changedMarkers.delete(t)):this._changedMarkers.set(t,{oldRange:e,newRange:i,affectsData:o})}getMarkersToRemove(){const t=[];for(const[e,i]of this._changedMarkers)null!=i.oldRange&&t.push({name:e,range:i.oldRange});return t}getMarkersToAdd(){const t=[];for(const[e,i]of this._changedMarkers)null!=i.newRange&&t.push({name:e,range:i.newRange});return t}getChangedMarkers(){return Array.from(this._changedMarkers).map(t=>({name:t[0],data:{oldRange:t[1].oldRange,newRange:t[1].newRange}}))}hasDataChanges(){for(const[,t]of this._changedMarkers)if(t.affectsData)return!0;return this._changesInElement.size>0}getChanges(t={includeChangesInGraveyard:!1}){if(this._cachedChanges)return t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();const e=[];for(const t of this._changesInElement.keys()){const i=this._changesInElement.get(t).sort((t,e)=>t.offset===e.offset?t.type!=e.type?"remove"==t.type?-1:1:0:t.offsett.position.root!=e.position.root?t.position.root.rootNamei.offset){if(o>n){const t={type:"attribute",offset:n,howMany:o-n,count:this._changeCount++};this._handleChange(t,e),e.push(t)}t.nodesToHandle=i.offset-t.offset,t.howMany=t.nodesToHandle}else t.offset>=i.offset&&t.offsetn?(t.nodesToHandle=o-n,t.offset=n):t.nodesToHandle=0);if("remove"==i.type&&t.offseti.offset){const n={type:"attribute",offset:i.offset,howMany:o-i.offset,count:this._changeCount++};this._handleChange(n,e),e.push(n),t.nodesToHandle=i.offset-t.offset,t.howMany=t.nodesToHandle}"attribute"==i.type&&(t.offset>=i.offset&&o<=n?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=i.offset&&o>=n&&(i.howMany=0))}}t.howMany=t.nodesToHandle,delete t.nodesToHandle}_getInsertDiff(t,e,i){return{type:"insert",position:Ts._createAt(t,e),name:i,length:1,changeCount:this._changeCount++}}_getRemoveDiff(t,e,i){return{type:"remove",position:Ts._createAt(t,e),name:i,length:1,changeCount:this._changeCount++}}_getAttributesDiff(t,e,i){const o=[];i=new Map(i);for(const[n,r]of e){const e=i.has(n)?i.get(n):null;e!==r&&o.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:n,attributeOldValue:r,attributeNewValue:e,changeCount:this._changeCount++}),i.delete(n)}for(const[e,n]of i)o.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:e,attributeOldValue:null,attributeNewValue:n,changeCount:this._changeCount++});return o}_isInInsertedElement(t){const e=t.parent;if(!e)return!1;const i=this._changesInElement.get(e),o=t.startOffset;if(i)for(const t of i)if("insert"==t.type&&o>=t.offset&&oo){for(let e=0;e=t&&o.baseVersion{const i=e[0];if(i.isDocumentOperation&&i.baseVersion!==this.version)throw new hi.a("model-document-applyoperation-wrong-version",this,{operation:i})},{priority:"highest"}),this.listenTo(t,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&this.differ.bufferOperation(i)},{priority:"high"}),this.listenTo(t,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&(this.version++,this.history.addOperation(i))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(t.markers,"update",(t,e,i,o)=>{this.differ.bufferMarkerChange(e.name,i,o,e.affectsData),null===i&&e.on("change",(t,i)=>{this.differ.bufferMarkerChange(e.name,i,e.getRange(),e.affectsData)})})}get graveyard(){return this.getRoot("$graveyard")}createRoot(t="$root",e="main"){if(this.roots.get(e))throw new hi.a("model-document-createroot-name-exists",this,{name:e});const i=new el(this,t,e);return this.roots.add(i),i}destroy(){this.selection.destroy(),this.stopListening()}getRoot(t="main"){return this.roots.get(t)}getRootNames(){return Array.from(this.roots,t=>t.rootName).filter(t=>"$graveyard"!=t)}registerPostFixer(t){this._postFixers.add(t)}toJSON(){const t=Ii(this);return t.selection="[engine.model.DocumentSelection]",t.model="[engine.model.Model]",t}_handleChangeBlock(t){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(t),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",t.batch):this.fire("change",t.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const t of this.roots)if(t!==this.graveyard)return t;return this.graveyard}_getDefaultRange(){const t=this._getDefaultRoot(),e=this.model,i=e.schema,o=e.createPositionFromPath(t,[0]);return i.getNearestSelectionRange(o)||e.createRange(o)}_validateSelectionRange(t){return pl(t.start)&&pl(t.end)}_callPostFixers(t){let e=!1;do{for(const i of this._postFixers)if(this.selection.refresh(),e=i(t),e)break}while(e)}}function pl(t){const e=t.textNode;if(e){const i=e.data,o=t.offset-e.startOffset;return!gl(i,o)&&!ml(i,o)}return!0}yi(fl,mi);class bl{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(t){return this._markers.has(t)}get(t){return this._markers.get(t)||null}_set(t,e,i=!1,o=!1){const n=t instanceof wl?t.name:t;if(n.includes(","))throw new hi.a("markercollection-incorrect-marker-name",this);const r=this._markers.get(n);if(r){const t=r.getRange();let s=!1;return t.isEqual(e)||(r._attachLiveRange(Hs.fromRange(e)),s=!0),i!=r.managedUsingOperations&&(r._managedUsingOperations=i,s=!0),"boolean"==typeof o&&o!=r.affectsData&&(r._affectsData=o,s=!0),s&&this.fire("update:"+n,r,t,e),r}const s=Hs.fromRange(e),a=new wl(n,s,i,o);return this._markers.set(n,a),this.fire("update:"+n,a,null,e),a}_remove(t){const e=t instanceof wl?t.name:t,i=this._markers.get(e);return!!i&&(this._markers.delete(e),this.fire("update:"+e,i,i.getRange(),null),this._destroyMarker(i),!0)}_refresh(t){const e=t instanceof wl?t.name:t,i=this._markers.get(e);if(!i)throw new hi.a("markercollection-refresh-marker-not-exists",this);const o=i.getRange();this.fire("update:"+e,i,o,o,i.managedUsingOperations,i.affectsData)}*getMarkersAtPosition(t){for(const e of this)e.getRange().containsPosition(t)&&(yield e)}*getMarkersIntersectingRange(t){for(const e of this)null!==e.getRange().getIntersection(t)&&(yield e)}destroy(){for(const t of this._markers.values())this._destroyMarker(t);this._markers=null,this.stopListening()}*getMarkersGroup(t){for(const e of this._markers.values())e.name.startsWith(t+":")&&(yield e)}_destroyMarker(t){t.stopListening(),t._detachLiveRange()}}yi(bl,mi);class wl{constructor(t,e,i,o){this.name=t,this._liveRange=this._attachLiveRange(e),this._managedUsingOperations=i,this._affectsData=o}get managedUsingOperations(){if(!this._liveRange)throw new hi.a("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new hi.a("marker-destroyed",this);return this._affectsData}getStart(){if(!this._liveRange)throw new hi.a("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new hi.a("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new hi.a("marker-destroyed",this);return this._liveRange.toRange()}is(t){return"marker"===t||"model:marker"===t}_attachLiveRange(t){return this._liveRange&&this._detachLiveRange(),t.delegate("change:range").to(this),t.delegate("change:content").to(this),this._liveRange=t,t}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}yi(wl,mi);class kl extends Ra{get type(){return"noop"}clone(){return new kl(this.baseVersion)}getReversed(){return new kl(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const _l={};_l[$a.className]=$a,_l[Ka.className]=Ka,_l[Qa.className]=Qa,_l[Ya.className]=Ya,_l[kl.className]=kl,_l[Ra.className]=Ra,_l[Ja.className]=Ja,_l[Za.className]=Za,_l[tl.className]=tl,_l[Xa.className]=Xa;class vl extends Ts{constructor(t,e,i="toNone"){if(super(t,e,i),!this.root.is("rootElement"))throw new hi.a("model-liveposition-root-not-rootelement",t);yl.call(this)}detach(){this.stopListening()}is(t){return"livePosition"===t||"model:livePosition"===t||"position"==t||"model:position"===t}toPosition(){return new Ts(this.root,this.path.slice(),this.stickiness)}static fromPosition(t,e){return new this(t.root,t.path.slice(),e||t.stickiness)}}function yl(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&xl.call(this,i)},{priority:"low"})}function xl(t){const e=this.getTransformedByOperation(t);if(!this.isEqual(e)){const t=this.toPosition();this.path=e.path,this.root=e.root,this.fire("change",t)}}yi(vl,mi);class Al{constructor(t,e,i){this.model=t,this.writer=e,this.position=i,this.canMergeWith=new Set([this.position.parent]),this.schema=t.schema,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(t,e){t=Array.from(t);for(let i=0;i{if(!i.doNotResetEntireContent&&function(t,e){const i=t.getLimitElement(e);if(!e.containsEntireContent(i))return!1;const o=e.getFirstRange();if(o.start.parent==o.end.parent)return!1;return t.checkChild(i,"paragraph")}(n,e))return void function(t,e){const i=t.model.schema.getLimitElement(e);t.remove(t.createRangeIn(i)),Sl(t,t.createPositionAt(i,0),e)}(t,e);const[r,s]=function(t){const e=t.root.document.model,i=t.start;let o=t.end;if(e.hasContent(t,{ignoreMarkers:!0})){const i=function(t){const e=t.parent,i=e.root.document.model.schema,o=e.getAncestors({parentFirst:!0,includeSelf:!0});for(const t of o){if(i.isLimit(t))return null;if(i.isBlock(t))return t}}(o);if(i&&o.isTouching(e.createPositionAt(i,0))){const i=e.createSelection(t);e.modifySelection(i,{direction:"backward"}),o=i.getLastPosition()}}return[vl.fromPosition(i,"toPrevious"),vl.fromPosition(o,"toNext")]}(o);r.isTouching(s)||t.remove(t.createRange(r,s)),i.leaveUnmerged||(!function(t,e,i){const o=t.model;if(!Cl(t.model.schema,e,i))return;const[n,r]=function(t,e){const i=t.getAncestors(),o=e.getAncestors();let n=0;for(;i[n]&&i[n]==o[n];)n++;return[i[n],o[n]]}(e,i);if(!n||!r)return;!o.hasContent(n,{ignoreMarkers:!0})&&o.hasContent(r,{ignoreMarkers:!0})?function t(e,i,o,n){const r=i.parent,s=o.parent;if(r==n||s==n)return;i=e.createPositionAfter(r),(o=e.createPositionBefore(s)).isEqual(i)||e.insert(r,o);for(;i.parent.isEmpty;){const t=i.parent;i=e.createPositionBefore(t),e.remove(t)}if(o=e.createPositionBefore(s),function(t,e){const i=e.nodeBefore,o=e.nodeAfter;i.name!=o.name&&t.rename(i,o.name);t.clearAttributes(i),t.setAttributes(Object.fromEntries(o.getAttributes()),i),t.merge(e)}(e,o),!Cl(e.model.schema,i,o))return;t(e,i,o,n)}(t,e,i,n.parent):function t(e,i,o,n){const r=i.parent,s=o.parent;if(r==n||s==n)return;i=e.createPositionAfter(r),(o=e.createPositionBefore(s)).isEqual(i)||e.insert(s,i);e.merge(i);for(;o.parent.isEmpty;){const t=o.parent;o=e.createPositionBefore(t),e.remove(t)}if(!Cl(e.model.schema,i,o))return;t(e,i,o,n)}(t,e,i,n.parent)}(t,r,s),n.removeDisallowedAttributes(r.parent.getChildren(),t)),Pl(t,e,r),!i.doNotAutoparagraph&&function(t,e){const i=t.checkChild(e,"$text"),o=t.checkChild(e,"paragraph");return!i&&o}(n,r)&&Sl(t,r,e),r.detach(),s.detach()})}function Cl(t,e,i){const o=e.parent,n=i.parent;return o!=n&&(!t.isLimit(o)&&!t.isLimit(n)&&function(t,e,i){const o=new Es(t,e);for(const t of o.getWalker())if(i.isLimit(t.item))return!1;return!0}(e,i,t))}function Sl(t,e,i){const o=t.createElement("paragraph");t.insert(o,e),Pl(t,i,t.createPositionAt(o,0))}function Pl(t,e,i){e instanceof Ws?t.setSelection(i):e.setTo(i)}function El(t,e){const{isForward:i,walker:o,unit:n,schema:r}=t,{type:s,item:a,nextPosition:l}=e;if("text"==s)return"word"===t.unit?function(t,e){let i=t.position.textNode;if(i){let o=t.position.offset-i.startOffset;for(;!Ll(i.data,o,e)&&!Il(i,o,e);){t.next();const n=e?t.position.nodeAfter:t.position.nodeBefore;if(n&&n.is("$text")){const o=n.data.charAt(e?0:n.data.length-1);' ,.?!:;"-()'.includes(o)||(t.next(),i=t.position.textNode)}o=t.position.offset-i.startOffset}}return t.position}(o,i):function(t,e){const i=t.position.textNode;if(i){const o=i.data;let n=t.position.offset-i.startOffset;for(;gl(o,n)||"character"==e&&ml(o,n);)t.next(),n=t.position.offset-i.startOffset}return t.position}(o,n);if(s==(i?"elementStart":"elementEnd")){if(r.isSelectable(a))return Ts._createAt(a,i?"after":"before");if(r.checkChild(l,"$text"))return l}else{if(r.isLimit(a))return void o.skip(()=>!0);if(r.checkChild(l,"$text"))return l}}function Ml(t,e){const i=t.root,o=Ts._createAt(i,e?"end":0);return e?new Es(t,o):new Es(o,t)}function Ll(t,e,i){const o=e+(i?0:-1);return' ,.?!:;"-()'.includes(t.charAt(o))}function Il(t,e,i){return e===(i?t.endOffset:0)}function Nl(t,e){const i=[];Array.from(t.getItems({direction:"backward"})).map(t=>e.createRangeOn(t)).filter(e=>(e.start.isAfter(t.start)||e.start.isEqual(t.start))&&(e.end.isBefore(t.end)||e.end.isEqual(t.end))).forEach(t=>{i.push(t.start.parent),e.remove(t)}),i.forEach(t=>{let i=t;for(;i.parent&&i.isEmpty;){const t=e.createRangeOn(i);i=i.parent,e.remove(t)}})}function zl(t){t.document.registerPostFixer(e=>function(t,e){const i=e.document.selection,o=e.schema,n=[];let r=!1;for(const t of i.getRanges()){const e=Ol(t,o);e&&!e.isEqual(t)?(n.push(e),r=!0):n.push(t)}r&&t.setSelection(function(t){const e=[];e.push(t.shift());for(const i of t){const t=e.pop();if(i.isEqual(t))e.push(t);else if(i.isIntersecting(t)){const o=t.start.isAfter(i.start)?i.start:t.start,n=t.end.isAfter(i.end)?t.end:i.end,r=new Es(o,n);e.push(r)}else e.push(t),e.push(i)}return e}(n),{backward:i.isBackward})}(e,t))}function Ol(t,e){return t.isCollapsed?function(t,e){const i=t.start,o=e.getNearestSelectionRange(i);if(!o)return null;if(!o.isCollapsed)return o;const n=o.start;if(i.isEqual(n))return null;return new Es(n)}(t,e):function(t,e){const{start:i,end:o}=t,n=e.checkChild(i,"$text"),r=e.checkChild(o,"$text"),s=e.getLimitElement(i),a=e.getLimitElement(o);if(s===a){if(n&&r)return null;if(function(t,e,i){const o=t.nodeAfter&&!i.isLimit(t.nodeAfter)||i.checkChild(t,"$text"),n=e.nodeBefore&&!i.isLimit(e.nodeBefore)||i.checkChild(e,"$text");return o||n}(i,o,e)){const t=i.nodeAfter&&e.isSelectable(i.nodeAfter)?null:e.getNearestSelectionRange(i,"forward"),n=o.nodeBefore&&e.isSelectable(o.nodeBefore)?null:e.getNearestSelectionRange(o,"backward"),r=t?t.start:i,s=n?n.end:o;return new Es(r,s)}}const l=s&&!s.is("rootElement"),c=a&&!a.is("rootElement");if(l||c){const t=i.nodeAfter&&o.nodeBefore&&i.nodeAfter.parent===o.nodeBefore.parent,n=l&&(!t||!Dl(i.nodeAfter,e)),r=c&&(!t||!Dl(o.nodeBefore,e));let d=i,h=o;return n&&(d=Ts._createBefore(Rl(s,e))),r&&(h=Ts._createAfter(Rl(a,e))),new Es(d,h)}return null}(t,e)}function Rl(t,e){let i=t,o=i;for(;e.isLimit(o)&&o.parent;)i=o,o=o.parent;return i}function Dl(t,e){return t&&e.isSelectable(t)}class Vl{constructor(){this.markers=new bl,this.document=new fl(this),this.schema=new ba,this._pendingChanges=[],this._currentWriter=null,["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(t=>this.decorate(t)),this.on("applyOperation",(t,e)=>{e[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$block",{allowIn:"$root",isBlock:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",isLimit:!0}),this.schema.extend("$text",{allowIn:"$clipboardHolder"}),this.schema.register("$marker"),this.schema.addChildCheck((t,e)=>{if("$marker"===e.name)return!0}),zl(this),this.document.registerPostFixer(oa)}change(t){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new Oa,callback:t}),this._runPendingChanges()[0]):t(this._currentWriter)}catch(t){hi.a.rethrowUnexpectedError(t,this)}}enqueueChange(t,e){try{"string"==typeof t?t=new Oa(t):"function"==typeof t&&(e=t,t=new Oa),this._pendingChanges.push({batch:t,callback:e}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(t){hi.a.rethrowUnexpectedError(t,this)}}applyOperation(t){t._execute()}insertContent(t,e,i){return function(t,e,i,o){return t.change(n=>{let r;r=i?i instanceof Ds||i instanceof Ws?i:n.createSelection(i,o):t.document.selection,r.isCollapsed||t.deleteContent(r,{doNotAutoparagraph:!0});const s=new Al(t,n,r.anchor);let a;a=e.is("documentFragment")?e.getChildren():[e],s.handleNodes(a,{isFirst:!0,isLast:!0});const l=s.getSelectionRange();l&&(r instanceof Ws?n.setSelection(l):r.setTo(l));const c=s.getAffectedRange()||t.createRange(r.anchor);return s.destroy(),c})}(this,t,e,i)}deleteContent(t,e){Tl(this,t,e)}modifySelection(t,e){!function(t,e,i={}){const o=t.schema,n="backward"!=i.direction,r=i.unit?i.unit:"character",s=e.focus,a=new xs({boundaries:Ml(s,n),singleCharacters:!0,direction:n?"forward":"backward"}),l={walker:a,schema:o,isForward:n,unit:r};let c;for(;c=a.next();){if(c.done)return;const i=El(l,c.value);if(i)return void(e instanceof Ws?t.change(t=>{t.setSelectionFocus(i)}):e.setFocus(i))}}(this,t,e)}getSelectedContent(t){return function(t,e){return t.change(t=>{const i=t.createDocumentFragment(),o=e.getFirstRange();if(!o||o.isCollapsed)return i;const n=o.start.root,r=o.start.getCommonPath(o.end),s=n.getNodeByPath(r);let a;a=o.start.parent==o.end.parent?o:t.createRange(t.createPositionAt(s,o.start.path[r.length]),t.createPositionAt(s,o.end.path[r.length]+1));const l=a.end.offset-a.start.offset;for(const e of a.getItems({shallow:!0}))e.is("$textProxy")?t.appendText(e.data,e.getAttributes(),i):t.append(t.cloneElement(e,!0),i);if(a!=o){const e=o._getTransformedByMove(a.start,t.createPositionAt(i,0),l)[0],n=t.createRange(t.createPositionAt(i,0),e.start);Nl(t.createRange(e.end,t.createPositionAt(i,"end")),t),Nl(n,t)}return i})}(this,t)}hasContent(t,e={}){const i=t instanceof ys?Es._createIn(t):t;if(i.isCollapsed)return!1;const{ignoreWhitespaces:o=!1,ignoreMarkers:n=!1}=e;if(!n)for(const t of this.markers.getMarkersIntersectingRange(i))if(t.affectsData)return!0;for(const t of i.getItems())if(this.schema.isContent(t)){if(!t.is("$textProxy"))return!0;if(!o)return!0;if(-1!==t.data.search(/\S/))return!0}return!1}createPositionFromPath(t,e,i){return new Ts(t,e,i)}createPositionAt(t,e){return Ts._createAt(t,e)}createPositionAfter(t){return Ts._createAfter(t)}createPositionBefore(t){return Ts._createBefore(t)}createRange(t,e){return new Es(t,e)}createRangeIn(t){return Es._createIn(t)}createRangeOn(t){return Es._createOn(t)}createSelection(t,e,i){return new Ds(t,e,i)}createBatch(t){return new Oa(t)}createOperationFromJSON(t){return class{static fromJSON(t,e){return _l[t.__className].fromJSON(t,e)}}.fromJSON(t,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const t=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){const e=this._pendingChanges[0].batch;this._currentWriter=new il(this,e);const i=this._pendingChanges[0].callback(this._currentWriter);t.push(i),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),t}}yi(Vl,Uo);class jl{constructor(){this._listener=Object.create(mr)}listenTo(t){this._listener.listenTo(t,"keydown",(t,e)=>{this._listener.fire("_keydown:"+bn(e),e)})}set(t,e,i={}){const o=wn(t),n=i.priority;this._listener.listenTo(this._listener,"_keydown:"+o,(t,i)=>{e(i,()=>{i.preventDefault(),i.stopPropagation(),t.stop()}),t.return=!0},{priority:n})}press(t){return!!this._listener.fire("_keydown:"+bn(t),t)}destroy(){this._listener.stopListening()}}class Bl extends jl{constructor(t){super(),this.editor=t}set(t,e,i={}){if("string"==typeof e){const t=e;e=(e,i)=>{this.editor.execute(t),i()}}super.set(t,e,i)}}class Fl{constructor(t={}){this._context=t.context||new Mi({language:t.language}),this._context._addEditor(this,!t.context);const e=Array.from(this.constructor.builtinPlugins||[]);this.config=new oi(t,this.constructor.defaultConfig),this.config.define("plugins",e),this.config.define(this._context._getEditorConfig()),this.plugins=new Ai(this,e,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new ma,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 Vl;const i=new Lo;this.data=new La(this.model,i),this.editing=new ga(this.model,i),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new Ia([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 Bl(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const t=this.config,e=t.get("plugins"),i=t.get("removePlugins")||[],o=t.get("extraPlugins")||[];return this.plugins.init(e.concat(o),i)}destroy(){let t=Promise.resolve();return"initializing"==this.state&&(t=new Promise(t=>this.once("ready",t))),t.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(...t){try{return this.commands.execute(...t)}catch(t){hi.a.rethrowUnexpectedError(t,this)}}focus(){this.editing.view.focus()}}yi(Fl,Uo);var Hl={setData(t){this.data.set(t)},getData(t){return this.data.get(t)}};var Ul={updateSourceElement(){if(!this.sourceElement)throw new hi.a("editor-missing-sourceelement",this);var t,e;t=this.sourceElement,e=this.data.get(),t instanceof HTMLTextAreaElement&&(t.value=e),t.innerHTML=e}};class ql{getHtml(t){const e=document.implementation.createHTMLDocument("").createElement("div");return e.appendChild(t),e.innerHTML}}class Wl{constructor(t){this._domParser=new DOMParser,this._domConverter=new cr(t,{blockFillerMode:"nbsp"}),this._htmlWriter=new ql}toData(t){const e=this._domConverter.viewToDom(t,document);return this._htmlWriter.getHtml(e)}toView(t){const e=this._toDom(t);return this._domConverter.domToView(e)}registerRawContentMatcher(t){this._domConverter.registerRawContentMatcher(t)}_toDom(t){const e=this._domParser.parseFromString(t,"text/html"),i=e.createDocumentFragment(),o=e.body.childNodes;for(;o.length>0;)i.appendChild(o[0]);return i}}class $l{constructor(t){this.editor=t,this._components=new Map}*names(){for(const t of this._components.values())yield t.originalName}add(t,e){this._components.set(Gl(t),{callback:e,originalName:t})}create(t){if(!this.has(t))throw new hi.a("componentfactory-item-missing",this,{name:t});return this._components.get(Gl(t)).callback(this.editor.locale)}has(t){return this._components.has(Gl(t))}}function Gl(t){return String(t).toLowerCase()}class Yl{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(t){if(this._elements.has(t))throw new hi.a("focustracker-add-element-already-exist",this);this.listenTo(t,"focus",()=>this._focus(t),{useCapture:!0}),this.listenTo(t,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(t)}remove(t){t===this.focusedElement&&this._blur(t),this._elements.has(t)&&(this.stopListening(t),this._elements.delete(t))}destroy(){this.stopListening()}_focus(t){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=t,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}yi(Yl,mr),yi(Yl,Uo);class Kl{constructor(t){this.editor=t,this.componentFactory=new $l(t),this.focusTracker=new Yl,this._editableElementsMap=new Map,this.listenTo(t.editing.view.document,"layoutChanged",()=>this.update())}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy();for(const t of this._editableElementsMap.values())t.ckeditorInstance=null;this._editableElementsMap=new Map}setEditableElement(t,e){this._editableElementsMap.set(t,e),e.ckeditorInstance||(e.ckeditorInstance=this.editor)}getEditableElement(t="main"){return this._editableElementsMap.get(t)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}}yi(Kl,mi);i(14);const Ql=new WeakMap;function Jl(t){const{view:e,element:i,text:o,isDirectHost:n=!0}=t,r=e.document;Ql.has(r)||(Ql.set(r,new Map),r.registerPostFixer(t=>Xl(r,t))),Ql.get(r).set(i,{text:o,isDirectHost:n}),e.change(t=>Xl(r,t))}function Zl(t,e){return!!e.hasClass("ck-placeholder")&&(t.removeClass("ck-placeholder",e),!0)}function Xl(t,e){const i=Ql.get(t);let o=!1;for(const[t,n]of i)tc(e,t,n)&&(o=!0);return o}function tc(t,e,i){const{text:o,isDirectHost:n}=i,r=n?e:function(t){if(1===t.childCount){const e=t.getChild(0);if(e.is("element")&&!e.is("uiElement"))return e}return null}(e);let s=!1;return!!r&&(i.hostElement=r,r.getAttribute("data-placeholder")!==o&&(t.setAttribute("data-placeholder",o,r),s=!0),!function(t){if(!t.isAttached())return!1;const e=!Array.from(t.getChildren()).some(t=>!t.is("uiElement")),i=t.document;if(!i.isFocused&&e)return!0;const o=i.selection.anchor;return!(!e||!o||o.parent===t)}(r)?Zl(t,r)&&(s=!0):function(t,e){return!e.hasClass("ck-placeholder")&&(t.addClass("ck-placeholder",e),!0)}(t,r)&&(s=!0),s)}class ec{constructor(){this._replacedElements=[]}replace(t,e){this._replacedElements.push({element:t,newElement:e}),t.style.display="none",e&&t.parentNode.insertBefore(e,t.nextSibling)}restore(){this._replacedElements.forEach(({element:t,newElement:e})=>{t.style.display="",e&&e.remove()}),this._replacedElements=[]}}class ic extends Kl{constructor(t,e){var i;super(t),this.view=e,this._toolbarConfig=(i=t.config.get("toolbar"),Array.isArray(i)?{items:i}:i?Object.assign({items:[]},i):{items:[]}),this._elementReplacer=new ec}get element(){return this.view.element}init(t){const e=this.editor,i=this.view,o=e.editing.view,n=i.editable,r=o.document.getRoot();n.name=r.rootName,i.render();const s=n.element;this.setEditableElement(n.name,s),this.focusTracker.add(s),i.editable.bind("isFocused").to(this.focusTracker),o.attachDomRoot(s),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.detachDomRoot(t.editable.name),t.destroy(),super.destroy()}_initToolbar(){const t=this.editor,e=this.view,i=t.editing.view;e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),e.stickyPanel.limiterElement=e.element,this._toolbarConfig.viewportTopOffset&&(e.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset),e.toolbar.fillFromConfig(this._toolbarConfig.items,this.componentFactory),function({origin:t,originKeystrokeHandler:e,originFocusTracker:i,toolbar:o,beforeFocus:n,afterBlur:r}){i.add(o.element),e.set("Alt+F10",(t,e)=>{i.isFocused&&!o.focusTracker.isFocused&&(n&&n(),o.focus(),e())}),o.keystrokes.set("Esc",(e,i)=>{o.focusTracker.isFocused&&(t.focus(),r&&r(),i())})}({origin:i,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:e.toolbar})}_initPlaceholder(){const t=this.editor,e=t.editing.view,i=e.document.getRoot(),o=t.sourceElement,n=t.config.get("placeholder")||o&&"textarea"===o.tagName.toLowerCase()&&o.getAttribute("placeholder");n&&Jl({view:e,element:i,text:n,isDirectHost:!1})}}class oc extends xi{constructor(t=[]){super(t,{idProperty:"viewUid"}),this.on("add",(t,e,i)=>{this._renderViewIntoCollectionParent(e,i)}),this.on("remove",(t,e)=>{e.element&&this._parentElement&&e.element.remove()}),this._parentElement=null}destroy(){this.map(t=>t.destroy())}setParent(t){this._parentElement=t;for(const t of this)this._renderViewIntoCollectionParent(t)}delegate(...t){if(!t.length||!t.every(t=>"string"==typeof t))throw new hi.a("ui-viewcollection-delegate-wrong-events",this);return{to:e=>{for(const i of this)for(const o of t)i.delegate(o).to(e);this.on("add",(i,o)=>{for(const i of t)o.delegate(i).to(e)}),this.on("remove",(i,o)=>{for(const i of t)o.stopDelegating(i,e)})}}}_renderViewIntoCollectionParent(t,e){t.isRendered||t.render(),t.element&&this._parentElement&&this._parentElement.insertBefore(t.element,this._parentElement.children[e])}}class nc{constructor(t){Object.assign(this,mc(gc(t))),this._isRendered=!1,this._revertData=null}render(){const t=this._renderNode({intoFragment:!0});return this._isRendered=!0,t}apply(t){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:t,isApplying:!0,revertData:this._revertData}),t}revert(t){if(!this._revertData)throw new hi.a("ui-template-revert-not-applied",[this,t]);this._revertTemplateFromNode(t,this._revertData)}*getViews(){yield*function*t(e){if(e.children)for(const i of e.children)kc(i)?yield i:_c(i)&&(yield*t(i))}(this)}static bind(t,e){return{to:(i,o)=>new sc({eventNameOrFunction:i,attribute:i,observable:t,emitter:e,callback:o}),if:(i,o,n)=>new ac({observable:t,emitter:e,attribute:i,valueIfTrue:o,callback:n})}}static extend(t,e){if(t._isRendered)throw new hi.a("template-extend-render",[this,t]);!function t(e,i){i.attributes&&(e.attributes||(e.attributes={}),bc(e.attributes,i.attributes));i.eventListeners&&(e.eventListeners||(e.eventListeners={}),bc(e.eventListeners,i.eventListeners));i.text&&e.text.push(...i.text);if(i.children&&i.children.length){if(e.children.length!=i.children.length)throw new hi.a("ui-template-extend-children-mismatch",e);let o=0;for(const n of i.children)t(e.children[o++],n)}}(t,mc(gc(e)))}_renderNode(t){let e;if(e=t.node?this.tag&&this.text:this.tag?this.text:!this.text,e)throw new hi.a("ui-template-wrong-syntax",this);return this.text?this._renderText(t):this._renderElement(t)}_renderElement(t){let e=t.node;return e||(e=t.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(t),this._renderElementChildren(t),this._setUpListeners(t),e}_renderText(t){let e=t.node;return e?t.revertData.text=e.textContent:e=t.node=document.createTextNode(""),lc(this.text)?this._bindToObservable({schema:this.text,updater:dc(e),data:t}):e.textContent=this.text.join(""),e}_renderAttributes(t){let e,i,o,n;if(!this.attributes)return;const r=t.node,s=t.revertData;for(e in this.attributes)if(o=r.getAttribute(e),i=this.attributes[e],s&&(s.attributes[e]=o),n=D(i[0])&&i[0].ns?i[0].ns:null,lc(i)){const a=n?i[0].value:i;s&&yc(e)&&a.unshift(o),this._bindToObservable({schema:a,updater:hc(r,e,n),data:t})}else"style"==e&&"string"!=typeof i[0]?this._renderStyleAttribute(i[0],t):(s&&o&&yc(e)&&i.unshift(o),i=i.map(t=>t&&t.value||t).reduce((t,e)=>t.concat(e),[]).reduce(pc,""),wc(i)||r.setAttributeNS(n,e,i))}_renderStyleAttribute(t,e){const i=e.node;for(const o in t){const n=t[o];lc(n)?this._bindToObservable({schema:[n],updater:uc(i,o),data:e}):i.style[o]=n}}_renderElementChildren(t){const e=t.node,i=t.intoFragment?document.createDocumentFragment():e,o=t.isApplying;let n=0;for(const r of this.children)if(vc(r)){if(!o){r.setParent(e);for(const t of r)i.appendChild(t.element)}}else if(kc(r))o||(r.isRendered||r.render(),i.appendChild(r.element));else if(tr(r))i.appendChild(r);else if(o){const e={children:[],bindings:[],attributes:{}};t.revertData.children.push(e),r._renderNode({node:i.childNodes[n++],isApplying:!0,revertData:e})}else i.appendChild(r.render());t.intoFragment&&e.appendChild(i)}_setUpListeners(t){if(this.eventListeners)for(const e in this.eventListeners){const i=this.eventListeners[e].map(i=>{const[o,n]=e.split("@");return i.activateDomEventListener(o,n,t)});t.revertData&&t.revertData.bindings.push(i)}}_bindToObservable({schema:t,updater:e,data:i}){const o=i.revertData;cc(t,e,i);const n=t.filter(t=>!wc(t)).filter(t=>t.observable).map(o=>o.activateAttributeListener(t,e,i));o&&o.bindings.push(n)}_revertTemplateFromNode(t,e){for(const t of e.bindings)for(const e of t)e();if(e.text)t.textContent=e.text;else{for(const i in e.attributes){const o=e.attributes[i];null===o?t.removeAttribute(i):t.setAttribute(i,o)}for(let i=0;icc(t,e,i);return this.emitter.listenTo(this.observable,"change:"+this.attribute,o),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,o)}}}class sc extends rc{activateDomEventListener(t,e,i){const o=(t,i)=>{e&&!i.target.matches(e)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(i):this.observable.fire(this.eventNameOrFunction,i))};return this.emitter.listenTo(i.node,t,o),()=>{this.emitter.stopListening(i.node,t,o)}}}class ac extends rc{getValue(t){return!wc(super.getValue(t))&&(this.valueIfTrue||!0)}}function lc(t){return!!t&&(t.value&&(t=t.value),Array.isArray(t)?t.some(lc):t instanceof rc)}function cc(t,e,{node:i}){let o=function(t,e){return t.map(t=>t instanceof rc?t.getValue(e):t)}(t,i);o=1==t.length&&t[0]instanceof ac?o[0]:o.reduce(pc,""),wc(o)?e.remove():e.set(o)}function dc(t){return{set(e){t.textContent=e},remove(){t.textContent=""}}}function hc(t,e,i){return{set(o){t.setAttributeNS(i,e,o)},remove(){t.removeAttributeNS(i,e)}}}function uc(t,e){return{set(i){t.style[e]=i},remove(){t.style[e]=null}}}function gc(t){return ei(t,t=>{if(t&&(t instanceof rc||_c(t)||kc(t)||vc(t)))return t})}function mc(t){if("string"==typeof t?t=function(t){return{text:[t]}}(t):t.text&&function(t){t.text=Ti(t.text)}(t),t.on&&(t.eventListeners=function(t){for(const e in t)fc(t,e);return t}(t.on),delete t.on),!t.text){t.attributes&&function(t){for(const e in t)t[e].value&&(t[e].value=Ti(t[e].value)),fc(t,e)}(t.attributes);const e=[];if(t.children)if(vc(t.children))e.push(t.children);else for(const i of t.children)_c(i)||kc(i)||tr(i)?e.push(i):e.push(new nc(i));t.children=e}return t}function fc(t,e){t[e]=Ti(t[e])}function pc(t,e){return wc(e)?t:wc(t)?e:`${t} ${e}`}function bc(t,e){for(const i in e)t[i]?t[i].push(...e[i]):t[i]=e[i]}function wc(t){return!t&&0!==t}function kc(t){return t instanceof xc}function _c(t){return t instanceof nc}function vc(t){return t instanceof oc}function yc(t){return"class"==t||"style"==t}i(16);class xc{constructor(t){this.element=null,this.isRendered=!1,this.locale=t,this.t=t&&t.t,this._viewCollections=new xi,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(e,i)=>{i.locale=t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=nc.bind(this,this)}createCollection(t){const e=new oc(t);return this._viewCollections.add(e),e}registerChild(t){vi(t)||(t=[t]);for(const e of t)this._unboundChildren.add(e)}deregisterChild(t){vi(t)||(t=[t]);for(const e of t)this._unboundChildren.remove(e)}setTemplate(t){this.template=new nc(t)}extendTemplate(t){nc.extend(this.template,t)}render(){if(this.isRendered)throw new hi.a("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(t=>t.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}yi(xc,mr),yi(xc,Uo);var Ac=function(t){return"string"==typeof t||!Ot(t)&&p(t)&&"[object String]"==g(t)};function Tc(t,e,i={},o=[]){const n=i&&i.xmlns,r=n?t.createElementNS(n,e):t.createElement(e);for(const t in i)r.setAttribute(t,i[t]);!Ac(o)&&vi(o)||(o=[o]);for(let e of o)Ac(e)&&(e=t.createTextNode(e)),r.appendChild(e);return r}class Cc extends oc{constructor(t,e=[]){super(e),this.locale=t}attachToDom(){this._bodyCollectionContainer=new nc({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let t=document.querySelector(".ck-body-wrapper");t||(t=Tc(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(t)),t.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const t=document.querySelector(".ck-body-wrapper");t&&0==t.childElementCount&&t.remove()}}i(18);class Sc extends xc{constructor(t){super(t),this.body=new Cc(t)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}i(20);class Pc extends xc{constructor(t){super(t),this.set("text"),this.set("for"),this.id="ck-editor__label_"+ci();const e=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:e.to("for")},children:[{text:e.to("text")}]})}}class Ec extends Sc{constructor(t){super(t),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:t.uiLanguageDirection,lang:t.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){const t=this.t,e=new Pc;return e.text=t("Rich Text Editor"),e.extendTemplate({attributes:{class:"ck-voice-label"}}),e}}class Mc extends xc{constructor(t,e,i){super(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:t.contentLanguage,dir:t.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=e}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const t=this._editingView;function e(e){t.change(i=>{const o=t.document.getRoot(e.name);i.addClass(e.isFocused?"ck-focused":"ck-blurred",o),i.removeClass(e.isFocused?"ck-blurred":"ck-focused",o)})}t.isRenderingInProgress?function i(o){t.once("change:isRenderingInProgress",(t,n,r)=>{r?i(o):e(o)})}(this):e(this)}}class Lc extends Mc{constructor(t,e,i){super(t,e,i),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const t=this._editingView,e=this.t;t.change(i=>{const o=t.document.getRoot(this.name);i.setAttribute("aria-label",e("Rich Text Editor, %0",this.name),o)})}}function Ic(t){return e=>e+t}i(22);const Nc=Ic("px");class zc extends xc{constructor(t){super(t);const e=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new nc({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:e.to("isSticky",t=>t?"block":"none"),height:e.to("isSticky",t=>t?Nc(this._panelRect.height):null)}}}).render(),this._contentPanel=new nc({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",e.if("isSticky","ck-sticky-panel__content_sticky"),e.if("_isStickyToTheLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:e.to("isSticky",t=>t?Nc(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:e.to("_hasViewportTopOffset",t=>t?Nc(this.viewportTopOffset):null),bottom:e.to("_isStickyToTheLimiter",t=>t?Nc(this.limiterBottomOffset):null),marginLeft:e.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render(),this._checkIfShouldBeSticky(),this.listenTo(rr.window,"scroll",()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const t=this._panelRect=this._contentPanel.getBoundingClientRect();let e;this.limiterElement?(e=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&e.top{this[e](),i()})}}get first(){return this.focusables.find(Rc)||null}get last(){return this.focusables.filter(Rc).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let t=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((e,i)=>{const o=e.element===this.focusTracker.focusedElement;return o&&(t=i),o}),t)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(t){t&&t.focus()}_getFocusableItem(t){const e=this.current,i=this.focusables.length;if(!i)return null;if(null===e)return this[1===t?"first":"last"];let o=(e+i+t)%i;do{const e=this.focusables.get(o);if(Rc(e))return e;o=(o+i+t)%i}while(o!==e);return null}}function Rc(t){return!(!t.focus||"none"==rr.window.getComputedStyle(t.element).display)}class Dc extends xc{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class Vc extends xc{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}class jc{constructor(t,e){jc._observerInstance||jc._createObserver(),this._element=t,this._callback=e,jc._addElementCallback(t,e),jc._observerInstance.observe(t)}destroy(){jc._deleteElementCallback(this._element,this._callback)}static _addElementCallback(t,e){jc._elementCallbacks||(jc._elementCallbacks=new Map);let i=jc._elementCallbacks.get(t);i||(i=new Set,jc._elementCallbacks.set(t,i)),i.add(e)}static _deleteElementCallback(t,e){const i=jc._getElementCallbacks(t);i&&(i.delete(e),i.size||(jc._elementCallbacks.delete(t),jc._observerInstance.unobserve(t))),jc._elementCallbacks&&!jc._elementCallbacks.size&&(jc._observerInstance=null,jc._elementCallbacks=null)}static _getElementCallbacks(t){return jc._elementCallbacks?jc._elementCallbacks.get(t):null}static _createObserver(){let t;t="function"==typeof rr.window.ResizeObserver?rr.window.ResizeObserver:Bc,jc._observerInstance=new t(t=>{for(const e of t){const t=jc._getElementCallbacks(e.target);if(t)for(const i of t)i(e)}})}}jc._observerInstance=null,jc._elementCallbacks=null;class Bc{constructor(t){this._callback=t,this._elements=new Set,this._previousRects=new Map,this._periodicCheckTimeout=null}observe(t){this._elements.add(t),this._checkElementRectsAndExecuteCallback(),1===this._elements.size&&this._startPeriodicCheck()}unobserve(t){this._elements.delete(t),this._previousRects.delete(t),this._elements.size||this._stopPeriodicCheck()}_startPeriodicCheck(){const t=()=>{this._checkElementRectsAndExecuteCallback(),this._periodicCheckTimeout=setTimeout(t,100)};this.listenTo(rr.window,"resize",()=>{this._checkElementRectsAndExecuteCallback()}),this._periodicCheckTimeout=setTimeout(t,100)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout),this.stopListening(),this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const t=[];for(const e of this._elements)this._hasRectChanged(e)&&t.push({target:e,contentRect:this._previousRects.get(e)});t.length&&this._callback(t)}_hasRectChanged(t){if(!t.ownerDocument.body.contains(t))return!1;const e=new ns(t),i=this._previousRects.get(t),o=!i||!i.isEqual(e);return this._previousRects.set(t,e),o}}yi(Bc,mr);class Fc extends xc{constructor(t){super(t);const e=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",e.to("position",t=>"ck-dropdown__panel_"+t),e.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:e.to(t=>t.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const t=this.children.last;"function"==typeof t.focusLast?t.focusLast():t.focus()}}}i(24);function Hc({element:t,target:e,positions:i,limiter:o,fitInViewport:n}){j(e)&&(e=e()),j(o)&&(o=o());const r=function(t){return t&&t.parentNode?t.offsetParent===rr.document.body?null:t.offsetParent:null}(t),s=new ns(t),a=new ns(e);let l,c;if(o||n){const t=function(t,e){const{elementRect:i,viewportRect:o}=e,n=i.getArea(),r=function(t,{targetRect:e,elementRect:i,limiterRect:o,viewportRect:n}){const r=[],s=i.getArea();for(const a of t){const t=Uc(a,e,i);if(!t)continue;const[l,c]=t;let d=0,h=0;if(o)if(n){const t=o.getIntersection(n);t&&(d=t.getIntersectionArea(c))}else d=o.getIntersectionArea(c);n&&(h=n.getIntersectionArea(c));const u={positionName:l,positionRect:c,limiterIntersectArea:d,viewportIntersectArea:h};if(d===s)return[u];r.push(u)}return r}(t,e);if(o){const t=qc(r.filter(({viewportIntersectArea:t})=>t===n),n);if(t)return t}return qc(r,n)}(i,{targetRect:a,elementRect:s,limiterRect:o&&new ns(o).getVisible(),viewportRect:n&&new ns(rr.window)});[c,l]=t||Uc(i[0],a,s)}else[c,l]=Uc(i[0],a,s);let d=Wc(l);return r&&(d=function({left:t,top:e},i){const o=Wc(new ns(i)),n=is(i);return t-=o.left,e-=o.top,t+=i.scrollLeft,e+=i.scrollTop,t-=n.left,e-=n.top,{left:t,top:e}}(d,r)),{left:d.left,top:d.top,name:c}}function Uc(t,e,i){const o=t(e,i);if(!o)return null;const{left:n,top:r,name:s}=o;return[s,i.clone().moveTo(n,r)]}function qc(t,e){let i,o,n=0;for(const{positionName:r,positionRect:s,limiterIntersectArea:a,viewportIntersectArea:l}of t){if(a===e)return[r,s];const t=l**2+a**2;t>n&&(n=t,i=s,o=r)}return i?[o,i]:null}function Wc({left:t,top:e}){const{scrollX:i,scrollY:o}=rr.window;return{left:t+i,top:e+o}}class $c extends xc{constructor(t,e,i){super(t);const o=this.bindTemplate;this.buttonView=e,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("id"),this.set("panelPosition","auto"),this.keystrokes=new jl,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.to("class"),o.if("isEnabled","ck-disabled",t=>!t)],id:o.to("id"),"aria-describedby":o.to("ariaDescribedById")},children:[e,i]}),e.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",()=>{this.isOpen&&("auto"===this.panelPosition?this.panelView.position=$c._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)}),this.keystrokes.listenTo(this.element);const t=(t,e)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,e())};this.keystrokes.set("arrowdown",(t,e)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,e())}),this.keystrokes.set("arrowright",(t,e)=>{this.isOpen&&e()}),this.keystrokes.set("arrowleft",t),this.keystrokes.set("esc",t)}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:t,southWest:e,northEast:i,northWest:o}=$c.defaultPanelPositions;return"ltr"===this.locale.uiLanguageDirection?[t,e,i,o]:[e,t,o,i]}}$c.defaultPanelPositions={southEast:t=>({top:t.bottom,left:t.left,name:"se"}),southWest:(t,e)=>({top:t.bottom,left:t.left-e.width+t.width,name:"sw"}),northEast:(t,e)=>({top:t.top-e.height,left:t.left,name:"ne"}),northWest:(t,e)=>({top:t.bottom-e.height,left:t.left-e.width+t.width,name:"nw"})},$c._getOptimalPosition=Hc;i(26);class Gc extends xc{constructor(){super();const t=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:t.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const t=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),e=t.getAttribute("viewBox");for(e&&(this.viewBox=e),this.element.innerHTML="";t.childNodes.length>0;)this.element.appendChild(t.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(t=>{t.style.fill=this.fillColor})}}i(28);class Yc extends xc{constructor(t){super(t),this.set("text",""),this.set("position","s");const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",e.to("position",t=>"ck-tooltip_"+t),e.if("text","ck-hidden",t=>!t.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:e.to("text")}]}]})}}i(30);class Kc extends xc{constructor(t){super(t);const e=this.bindTemplate,i=ci();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(i),this.iconView=new Gc,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this)),this.setTemplate({tag:"button",attributes:{class:["ck","ck-button",e.to("class"),e.if("isEnabled","ck-disabled",t=>!t),e.if("isVisible","ck-hidden",t=>!t),e.to("isOn",t=>t?"ck-on":"ck-off"),e.if("withText","ck-button_with-text"),e.if("withKeystroke","ck-button_with-keystroke")],type:e.to("type",t=>t||"button"),tabindex:e.to("tabindex"),"aria-labelledby":"ck-editor__aria-label_"+i,"aria-disabled":e.if("isEnabled",!0,t=>!t),"aria-pressed":e.to("isOn",t=>!!this.isToggleable&&String(t))},children:this.children,on:{mousedown:e.to(t=>{t.preventDefault()}),click:e.to(t=>{this.isEnabled?this.fire("execute"):t.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView),this.withKeystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createTooltipView(){const t=new Yc;return t.bind("text").to(this,"_tooltipString"),t.bind("position").to(this,"tooltipPosition"),t}_createLabelView(t){const e=new xc,i=this.bindTemplate;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:i.to("labelStyle"),id:"ck-editor__aria-label_"+t},children:[{text:this.bindTemplate.to("label")}]}),e}_createKeystrokeView(){const t=new xc;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>kn(t))}]}),t}_getTooltipString(t,e,i){return t?"string"==typeof t?t:(i&&(i=kn(i)),t instanceof Function?t(e,i):`${e}${i?` (${i})`:""}`):""}}var Qc='';class Jc extends Kc{constructor(t){super(t),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const t=new Gc;return t.content=Qc,t.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),t}}i(32);class Zc extends xc{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new Yl,this.keystrokes=new jl,this._focusCycler=new Oc({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"]},children:this.items})}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class Xc extends xc{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class td extends xc{constructor(t){super(t),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}i(34);class ed extends Kc{constructor(t){super(t),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const t=new xc;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),t}}function id({emitter:t,activator:e,callback:i,contextElements:o}){t.listenTo(document,"mousedown",(t,n)=>{if(!e())return;const r="function"==typeof n.composedPath?n.composedPath():[];for(const t of o)if(t.contains(n.target)||r.includes(t))return;i()})}i(36),i(38);function od(t,e=Jc){const i=new e(t),o=new Fc(t),n=new $c(t,i,o);return i.bind("isEnabled").to(n),i instanceof Jc?i.bind("isOn").to(n,"isOpen"):i.arrowView.bind("isOn").to(n,"isOpen"),function(t){(function(t){t.on("render",()=>{id({emitter:t,activator:()=>t.isOpen,callback:()=>{t.isOpen=!1},contextElements:[t.element]})})})(t),function(t){t.on("execute",e=>{e.source instanceof ed||(t.isOpen=!1)})}(t),function(t){t.keystrokes.set("arrowdown",(e,i)=>{t.isOpen&&(t.panelView.focus(),i())}),t.keystrokes.set("arrowup",(e,i)=>{t.isOpen&&(t.panelView.focusLast(),i())})}(t)}(n),n}function nd(t,e){const i=t.locale,o=i.t,n=t.toolbarView=new sd(i);n.set("ariaLabel",o("Dropdown toolbar")),t.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.map(t=>n.items.add(t)),t.panelView.children.add(n),n.items.delegate("execute").to(t)}function rd(t,e){const i=t.locale,o=t.listView=new Zc(i);o.items.bindTo(e).using(({type:t,model:e})=>{if("separator"===t)return new td(i);if("button"===t||"switchbutton"===t){const o=new Xc(i);let n;return n="button"===t?new Kc(i):new ed(i),n.bind(...Object.keys(e)).to(e),n.delegate("execute").to(o),o.children.add(n),o}}),t.panelView.children.add(o),o.items.delegate("execute").to(t)}i(40);class sd extends xc{constructor(t,e){super(t);const i=this.bindTemplate,o=this.t;this.options=e||{},this.set("ariaLabel",o("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new Yl,this.keystrokes=new jl,this.set("class"),this.set("isCompact",!1),this.itemsView=new ad(t),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection(),this._focusCycler=new Oc({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:["arrowleft","arrowup"],focusNext:["arrowright","arrowdown"]}});const n=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact")];var r;this.options.shouldGroupWhenFull&&this.options.isFloating&&n.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:n,role:"toolbar","aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")}},children:this.children,on:{mousedown:(r=this,r.bindTemplate.to(t=>{t.target===r.element&&t.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new cd(this):new ld(this)}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(t,e){this.items.addMany(t.map(i=>"|"==i?new Dc:"-"==i?(this.options.shouldGroupWhenFull&&Object(hi.c)("toolbarview-line-break-ignored-when-grouping-items",t),new Vc):e.has(i)?e.create(i):void Object(hi.c)("toolbarview-item-unavailable",{name:i})).filter(t=>void 0!==t))}}class ad extends xc{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class ld{constructor(t){const e=t.bindTemplate;t.set("isVertical",!1),t.itemsView.children.bindTo(t.items).using(t=>t),t.focusables.bindTo(t.items).using(t=>t),t.extendTemplate({attributes:{class:[e.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class cd{constructor(t){this.view=t,this.viewChildren=t.children,this.viewFocusables=t.focusables,this.viewItemsView=t.itemsView,this.viewFocusTracker=t.focusTracker,this.viewLocale=t.locale,this.ungroupedItems=t.createCollection(),this.groupedItems=t.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,t.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),t.children.on("add",this._updateFocusCycleableItems.bind(this)),t.children.on("remove",this._updateFocusCycleableItems.bind(this)),t.items.on("change",(t,e)=>{const i=e.index;for(const t of e.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(t):this.ungroupedItems.remove(t);for(let t=i;tthis.ungroupedItems.length?this.groupedItems.add(o,t-this.ungroupedItems.length):this.ungroupedItems.add(o,t)}this._updateGrouping()}),t.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(t){this.viewElement=t.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(t)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!this.viewElement.offsetParent)return void(this.shouldUpdateGroupingOnNextResize=!0);const t=this.groupedItems.length;let e;for(;this._areItemsOverflowing;)this._groupLastItem(),e=!0;if(!e&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==t&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const t=this.viewElement,e=this.viewLocale.uiLanguageDirection,i=new ns(t.lastChild),o=new ns(t);if(!this.cachedPadding){const i=rr.window.getComputedStyle(t),o="ltr"===e?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(i[o])}return"ltr"===e?i.right>o.right-this.cachedPadding:i.left{t&&t===e.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),t=e.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(t){t.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new Dc),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const t=this.viewLocale,e=t.t,i=od(t);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition="ltr"===t.uiLanguageDirection?"sw":"se",nd(i,[]),i.buttonView.set({label:e("Show more items"),tooltip:!0,icon:''}),i.toolbarView.items.bindTo(this.groupedItems).using(t=>t),i}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(t=>{this.viewFocusables.add(t)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}i(42);class dd extends Ec{constructor(t,e,i={}){super(t),this.stickyPanel=new zc(t),this.toolbar=new sd(t,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),this.editable=new Lc(t,e)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class hd extends Fl{constructor(t,e){super(e),ii(t)&&(this.sourceElement=t),this.data.processor=new Wl(this.data.viewDocument),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),o=new dd(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i});this.ui=new ic(this,o),function(t){if(!j(t.updateSourceElement))throw new hi.a("attachtoform-missing-elementapi-interface",t);const e=t.sourceElement;if(e&&"textarea"===e.tagName.toLowerCase()&&e.form){let i;const o=e.form,n=()=>t.updateSourceElement();j(o.submit)&&(i=o.submit,o.submit=()=>{n(),i.apply(o)}),o.addEventListener("submit",n),t.on("destroy",()=>{o.removeEventListener("submit",n),i&&(o.submit=i)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,e={}){return new Promise(i=>{const o=new this(t,e);i(o.initPlugins().then(()=>o.ui.init(ii(t)?t:null)).then(()=>{if(!ii(t)&&e.initialData)throw new hi.a("editor-create-initial-data",null);const i=e.initialData||function(t){return ii(t)?(e=t,e instanceof HTMLTextAreaElement?e.value:e.innerHTML):t;var e}(t);return o.data.init(i)}).then(()=>o.fire("ready")).then(()=>o))})}}yi(hd,Hl),yi(hd,Ul);class ud{constructor(t){this.editor=t,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",gd,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",gd),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function gd(t){t.return=!1,t.stop()}yi(ud,Uo);class md{constructor(t){this.editor=t,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",t=>{this.isEnabled||t.stop()},{priority:"high"}),this.listenTo(t,"change:isReadOnly",(t,e,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",fd,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",fd),this.refresh())}execute(){}destroy(){this.stopListening()}}function fd(t){t.return=!1,t.stop()}function pd(t){const e=t.next();return e.done?null:e.value}yi(md,Uo);const bd=["left","right","center","justify"];function wd(t){return bd.includes(t)}function kd(t,e){return"rtl"==e.contentLanguageDirection?"right"===t:"left"===t}class _d extends md{refresh(){const t=this.editor.locale,e=pd(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!e&&this._canBeAligned(e),this.isEnabled&&e.hasAttribute("alignment")?this.value=e.getAttribute("alignment"):this.value="rtl"===t.contentLanguageDirection?"right":"left"}execute(t={}){const e=this.editor,i=e.locale,o=e.model,n=o.document,r=t.value;o.change(t=>{const e=Array.from(n.selection.getSelectedBlocks()).filter(t=>this._canBeAligned(t)),o=e[0].getAttribute("alignment");kd(r,i)||o===r||!r?function(t,e){for(const i of t)e.removeAttribute("alignment",i)}(e,t):function(t,e,i){for(const o of t)e.setAttribute("alignment",i,o)}(e,t,r)})}_canBeAligned(t){return this.editor.model.schema.checkAttribute(t,"alignment")}}class vd extends ud{static get pluginName(){return"AlignmentEditing"}constructor(t){super(t),t.config.define("alignment",{options:[...bd]})}init(){const t=this.editor,e=t.locale,i=t.model.schema,o=t.config.get("alignment.options").filter(wd);i.extend("$block",{allowAttributes:"alignment"}),t.model.schema.setAttributeProperties("alignment",{isFormatting:!0});const n=function(t){const e={model:{key:"alignment",values:t.slice()},view:{}};for(const i of t)e.view[i]={key:"style",value:{"text-align":i}};return e}(o.filter(t=>!kd(t,e)));t.conversion.attributeToAttribute(n),t.commands.add("alignment",new _d(t))}}var yd='',xd='';const Ad=new Map([["left",yd],["right",xd],["center",''],["justify",'']]);class Td extends ud{get localizedOptionTitles(){const t=this.editor.t;return{left:t("Align left"),right:t("Align right"),center:t("Align center"),justify:t("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const t=this.editor,e=t.ui.componentFactory,i=t.t,o=t.config.get("alignment.options");o.filter(wd).forEach(t=>this._addButton(t)),e.add("alignment",t=>{const n=od(t),r=o.map(t=>e.create("alignment:"+t));nd(n,r),n.buttonView.set({label:i("Text alignment"),tooltip:!0}),n.toolbarView.isVertical=!0,n.toolbarView.ariaLabel=i("Text alignment toolbar"),n.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const s="rtl"===t.contentLanguageDirection?xd:yd;return n.buttonView.bind("icon").toMany(r,"isOn",(...t)=>{const e=t.findIndex(t=>t);return e<0?s:r[e].icon}),n.bind("isEnabled").toMany(r,"isEnabled",(...t)=>t.some(t=>t)),n})}_addButton(t){const e=this.editor;e.ui.componentFactory.add("alignment:"+t,i=>{const o=e.commands.get("alignment"),n=new Kc(i);return n.set({label:this.localizedOptionTitles[t],icon:Ad.get(t),tooltip:!0,isToggleable:!0}),n.bind("isEnabled").to(o),n.bind("isOn").to(o,"value",e=>e===t),this.listenTo(n,"execute",()=>{e.execute("alignment",{value:t}),e.editing.view.focus()}),n})}}class Cd extends md{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.schema,o=e.document.selection,n=Array.from(o.getSelectedBlocks()),r=void 0===t.forceValue?!this.value:t.forceValue;e.change(t=>{if(r){const e=n.filter(t=>Sd(t)||Ed(i,t));this._applyQuote(t,e)}else this._removeQuote(t,n.filter(Sd))})}_getValue(){const t=pd(this.editor.model.document.selection.getSelectedBlocks());return!(!t||!Sd(t))}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,i=pd(t.getSelectedBlocks());return!!i&&Ed(e,i)}_removeQuote(t,e){Pd(t,e).reverse().forEach(e=>{if(e.start.isAtStart&&e.end.isAtEnd)return void t.unwrap(e.start.parent);if(e.start.isAtStart){const i=t.createPositionBefore(e.start.parent);return void t.move(e,i)}e.end.isAtEnd||t.split(e.end);const i=t.createPositionAfter(e.end.parent);t.move(e,i)})}_applyQuote(t,e){const i=[];Pd(t,e).reverse().forEach(e=>{let o=Sd(e.start);o||(o=t.createElement("blockQuote"),t.wrap(e,o)),i.push(o)}),i.reverse().reduce((e,i)=>e.nextSibling==i?(t.merge(t.createPositionAfter(e)),e):i)}}function Sd(t){return"blockQuote"==t.parent.name?t.parent:null}function Pd(t,e){let i,o=0;const n=[];for(;o{if(t.endsWith("blockQuote")&&"blockQuote"==e.name)return!1}),t.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),t.model.document.registerPostFixer(i=>{const o=t.model.document.differ.getChanges();for(const t of o)if("insert"==t.type){const o=t.position.nodeAfter;if(!o)continue;if(o.is("element","blockQuote")&&o.isEmpty)return i.remove(o),!0;if(o.is("element","blockQuote")&&!e.checkChild(t.position,o))return i.unwrap(o),!0;if(o.is("element")){const t=i.createRangeIn(o);for(const o of t.getItems())if(o.is("element","blockQuote")&&!e.checkChild(i.createPositionBefore(o),o))return i.unwrap(o),!0}}else if("remove"==t.type){const e=t.position.parent;if(e.is("element","blockQuote")&&e.isEmpty)return i.remove(e),!0}return!1})}afterInit(){const t=this.editor.commands.get("blockQuote");this.listenTo(this.editor.editing.view.document,"enter",(e,i)=>{const o=this.editor.model.document,n=o.selection.getLastPosition().parent;o.selection.isCollapsed&&n.isEmpty&&t.value&&(this.editor.execute("blockQuote"),this.editor.editing.view.scrollToTheSelection(),i.preventDefault(),e.stop())})}}i(44);class Ld extends ud{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("blockQuote",i=>{const o=t.commands.get("blockQuote"),n=new Kc(i);return n.set({label:e("Block quote"),icon:'',tooltip:!0,isToggleable:!0}),n.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(n,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),n})}}class Id extends md{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,i=e.document.selection,o=void 0===t.forceValue?!this.value:t.forceValue;e.change(t=>{if(i.isCollapsed)o?t.setSelectionAttribute(this.attributeKey,!0):t.removeSelectionAttribute(this.attributeKey);else{const n=e.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const e of n)o?t.setAttribute(this.attributeKey,o,e):t.removeAttribute(this.attributeKey,e)}})}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,i=t.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const t of i.getRanges())for(const i of t.getItems())if(e.checkAttribute(i,this.attributeKey))return i.hasAttribute(this.attributeKey);return!1}}class Nd extends ud{static get pluginName(){return"BoldEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"bold"}),t.model.schema.setAttributeProperties("bold",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"bold",view:"strong",upcastAlso:["b",t=>{const e=t.getStyle("font-weight");return e?"bold"==e||Number(e)>=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),t.commands.add("bold",new Id(t,"bold")),t.keystrokes.set("CTRL+B","bold")}}class zd extends ud{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("bold",i=>{const o=t.commands.get("bold"),n=new Kc(i);return n.set({label:e("Bold"),icon:'',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),n.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(n,"execute",()=>{t.execute("bold"),t.editing.view.focus()}),n})}}class Od{constructor(t){this.files=function(t){const e=t.files?Array.from(t.files):[],i=t.items?Array.from(t.items):[];if(e.length)return e;return i.filter(t=>"file"===t.kind).map(t=>t.getAsFile())}(t),this._native=t}get types(){return this._native.types}getData(t){return this._native.getData(t)}setData(t,e){this._native.setData(t,e)}}class Rd extends Vr{constructor(t){super(t);const e=this.document;function i(t,i){i.preventDefault();const o=i.dropRange?[i.dropRange]:Array.from(e.selection.getRanges()),n=new ai(e,"clipboardInput");e.fire(n,{dataTransfer:i.dataTransfer,targetRanges:o}),n.stop.called&&i.stopPropagation()}this.domEventType=["paste","copy","cut","drop","dragover"],this.listenTo(e,"paste",i,{priority:"low"}),this.listenTo(e,"drop",i,{priority:"low"})}onDomEvent(t){const e={dataTransfer:new Od(t.clipboardData?t.clipboardData:t.dataTransfer)};"drop"==t.type&&(e.dropRange=function(t,e){const i=e.target.ownerDocument,o=e.clientX,n=e.clientY;let r;i.caretRangeFromPoint&&i.caretRangeFromPoint(o,n)?r=i.caretRangeFromPoint(o,n):e.rangeParent&&(r=i.createRange(),r.setStart(e.rangeParent,e.rangeOffset),r.collapse(!0));return r?t.domConverter.domRangeToView(r):t.document.selection.getFirstRange()}(this.view,t)),this.fire(t.type,t,e)}}class Dd extends ud{static get pluginName(){return"PastePlainText"}init(){const t=this.editor.editing.view,e=t.document;let i=!1;t.addObserver(Rd),this.listenTo(e,"keydown",(t,e)=>{i=e.shiftKey}),this.listenTo(e,"clipboardInput",(t,e)=>{i&&(e.asPlainText=!0)},{priority:"high"})}}const Vd=["figcaption","li"];class jd extends ud{static get pluginName(){return"Clipboard"}static get requires(){return[Dd]}init(){const t=this.editor,e=t.model.document,i=t.editing.view,o=i.document;function n(i,n){const r=n.dataTransfer;n.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));o.fire("clipboardOutput",{dataTransfer:r,content:s,method:i.name})}this._htmlDataProcessor=new Wl(o),i.addObserver(Rd),this.listenTo(o,"clipboardInput",e=>{t.isReadOnly&&e.stop()},{priority:"highest"}),this.listenTo(o,"clipboardInput",(t,e)=>{const o=e.dataTransfer;let n="";var r;o.getData("text/html")?n=function(t){return t.replace(/(\s+)<\/span>/g,(t,e)=>1==e.length?" ":e)}(o.getData("text/html")):o.getData("text/plain")&&(((r=(r=o.getData("text/plain")).replace(//g,">").replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("

")||r.includes("
"))&&(r=`

${r}

`),n=r),n=this._htmlDataProcessor.toView(n);const s=new ai(this,"inputTransformation");this.fire(s,{content:n,dataTransfer:o,asPlainText:e.asPlainText}),s.stop.called&&t.stop(),i.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(t,e)=>{if(!e.content.isEmpty){const i=this.editor.data,o=this.editor.model,n=i.toModel(e.content,"$clipboardHolder");if(0==n.childCount)return;o.change(t=>{const i=o.document.selection;if(e.asPlainText||function(t,e){if(t.childCount>1)return!1;const i=t.getChild(0);if(e.isObject(i))return!1;return 0==[...i.getAttributeKeys()].length}(n,o.schema)){const e=Array.from(i.getAttributes()).filter(([t])=>o.schema.getAttributeProperties(t).isFormatting);i.isCollapsed||o.deleteContent(i,{doNotAutoparagraph:!0}),e.push(...i.getAttributes());const r=t.createRangeIn(n);for(const i of r.getItems())(i.is("$text")||i.is("$textProxy"))&&t.setAttributes(e,i)}o.insertContent(n)}),t.stop()}},{priority:"low"}),this.listenTo(o,"copy",n,{priority:"low"}),this.listenTo(o,"cut",(e,i)=>{t.isReadOnly?i.preventDefault():n(e,i)},{priority:"low"}),this.listenTo(o,"clipboardOutput",(i,o)=>{o.content.isEmpty||(o.dataTransfer.setData("text/html",this._htmlDataProcessor.toData(o.content)),o.dataTransfer.setData("text/plain",function t(e){let i="";if(e.is("$text")||e.is("$textProxy"))i=e.data;else if(e.is("element","img")&&e.hasAttribute("alt"))i=e.getAttribute("alt");else if(e.is("element","br"))i="\n";else{let o=null;for(const n of e.getChildren()){const e=t(n);o&&(o.is("containerElement")||n.is("containerElement"))&&(Vd.includes(o.name)||Vd.includes(n.name)?i+="\n":i+="\n\n"),i+=e,o=n}}return i}(o.content))),"cut"==o.method&&t.model.deleteContent(e.selection)},{priority:"low"})}}function*Bd(t,e){for(const i of e)i&&t.getAttributeProperties(i[0]).copyOnEnter&&(yield i)}class Fd extends md{execute(){const t=this.editor.model,e=t.document;t.change(i=>{!function(t,e,i,o){const n=i.isCollapsed,r=i.getFirstRange(),s=r.start.parent,a=r.end.parent;if(o.isLimit(s)||o.isLimit(a))return void(n||s!=a||t.deleteContent(i));if(n){const t=Bd(e.model.schema,i.getAttributes());Hd(e,r.start),e.setSelectionAttribute(t)}else{const o=!(r.start.isAtStart&&r.end.isAtEnd),n=s==a;t.deleteContent(i,{leaveUnmerged:o}),o&&(n?Hd(e,i.focus):e.setSelection(a,0))}}(this.editor.model,i,e.selection,t.schema),this.fire("afterExecute",{writer:i})})}}function Hd(t,e){t.split(e),t.setSelection(e.parent.nextSibling,0)}class Ud extends br{constructor(t){super(t);const e=this.document;e.on("keydown",(t,i)=>{if(this.isEnabled&&i.keyCode==pn.enter){let o;e.once("enter",t=>o=t,{priority:"highest"}),e.fire("enter",new Dr(e,i.domEvent,{isSoft:i.shiftKey})),o&&o.stop.called&&t.stop()}})}observe(){}}class qd extends ud{static get pluginName(){return"Enter"}init(){const t=this.editor,e=t.editing.view,i=e.document;e.addObserver(Ud),t.commands.add("enter",new Fd(t)),this.listenTo(i,"enter",(i,o)=>{o.preventDefault(),o.isSoft||(t.execute("enter"),e.scrollToTheSelection())},{priority:"low"})}}class Wd extends md{execute(){const t=this.editor.model,e=t.document;t.change(i=>{!function(t,e,i){const o=i.isCollapsed,n=i.getFirstRange(),r=n.start.parent,s=n.end.parent,a=r==s;if(o){const o=Bd(t.schema,i.getAttributes());$d(t,e,n.end),e.removeSelectionAttribute(i.getAttributeKeys()),e.setSelectionAttribute(o)}else{const o=!(n.start.isAtStart&&n.end.isAtEnd);t.deleteContent(i,{leaveUnmerged:o}),a?$d(t,e,i.focus):o&&e.setSelection(s,0)}}(t,i,e.selection),this.fire("afterExecute",{writer:i})})}refresh(){const t=this.editor.model,e=t.document;this.isEnabled=function(t,e){if(e.rangeCount>1)return!1;const i=e.anchor;if(!i||!t.checkChild(i,"softBreak"))return!1;const o=e.getFirstRange(),n=o.start.parent,r=o.end.parent;if((Gd(n,t)||Gd(r,t))&&n!==r)return!1;return!0}(t.schema,e.selection)}}function $d(t,e,i){const o=e.createElement("softBreak");t.insertContent(o,i),e.setSelection(o,"after")}function Gd(t,e){return!t.is("rootElement")&&(e.isLimit(t)||Gd(t.parent,e))}class Yd extends ud{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor,e=t.model.schema,i=t.conversion,o=t.editing.view,n=o.document;e.register("softBreak",{allowWhere:"$text",isInline:!0}),i.for("upcast").elementToElement({model:"softBreak",view:"br"}),i.for("downcast").elementToElement({model:"softBreak",view:(t,{writer:e})=>e.createEmptyElement("br")}),o.addObserver(Ud),t.commands.add("shiftEnter",new Wd(t)),this.listenTo(n,"enter",(e,i)=>{i.preventDefault(),i.isSoft&&(t.execute("shiftEnter"),o.scrollToTheSelection())},{priority:"low"})}}class Kd extends md{execute(){const t=this.editor.model,e=t.document.selection;let i=t.schema.getLimitElement(e);if(e.containsEntireContent(i)||!Qd(t.schema,i))do{if(i=i.parent,!i)return}while(!Qd(t.schema,i));t.change(t=>{t.setSelection(i,"in")})}}function Qd(t,e){return t.isLimit(e)&&(t.checkChild(e,"$text")||t.checkChild(e,"paragraph"))}const Jd=wn("Ctrl+A");class Zd extends ud{static get pluginName(){return"SelectAllEditing"}init(){const t=this.editor,e=t.editing.view.document;t.commands.add("selectAll",new Kd(t)),this.listenTo(e,"keydown",(e,i)=>{bn(i)===Jd&&(t.execute("selectAll"),i.preventDefault())})}}class Xd extends ud{static get pluginName(){return"SelectAllUI"}init(){const t=this.editor;t.ui.componentFactory.add("selectAll",e=>{const i=t.commands.get("selectAll"),o=new Kc(e),n=e.t;return o.set({label:n("Select all"),icon:'',keystroke:"Ctrl+A",tooltip:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),o})}}class th extends ud{static get requires(){return[Zd,Xd]}static get pluginName(){return"SelectAll"}}class eh{constructor(t,e=20){this.model=t,this.size=0,this.limit=e,this.isLocked=!1,this._changeCallback=(t,e)=>{"transparent"!=e.type&&e!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch()),this._batch}input(t){this.size+=t,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(t){this.isLocked&&!t||(this._batch=null,this.size=0)}}class ih extends md{constructor(t,e){super(t),this._buffer=new eh(t.model,e),this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(t={}){const e=this.editor.model,i=e.document,o=t.text||"",n=o.length,r=t.range?e.createSelection(t.range):i.selection,s=t.resultRange;e.enqueueChange(this._buffer.batch,t=>{this._buffer.lock(),this._batches.add(this._buffer.batch),e.deleteContent(r),o&&e.insertContent(t.createText(o,i.selection.getAttributes()),r),s?t.setSelection(s):r.is("documentSelection")||t.setSelection(r),this._buffer.unlock(),this._buffer.input(n)})}}const oh=[bn("arrowUp"),bn("arrowRight"),bn("arrowDown"),bn("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let t=112;t<=135;t++)oh.push(t);function nh(t){return!!t.ctrlKey||oh.includes(t.keyCode)}function rh(t){if(t.newChildren.length-t.oldChildren.length!=1)return;const e=function(t,e){const i=[];let o,n=0;return t.forEach(t=>{"equal"==t?(r(),n++):"insert"==t?(s("insert")?o.values.push(e[n]):(r(),o={type:"insert",index:n,values:[e[n]]}),n++):s("delete")?o.howMany++:(r(),o={type:"delete",index:n,howMany:1})}),r(),i;function r(){o&&(i.push(o),o=null)}function s(t){return o&&o.type==t}}(Jn(t.oldChildren,t.newChildren,sh),t.newChildren);if(e.length>1)return;const i=e[0];return i.values[0]&&i.values[0].is("$text")?i:void 0}function sh(t,e){return t&&t.is("$text")&&e&&e.is("$text")?t.data===e.data:t===e}class ah{constructor(t){this.editor=t,this.editing=this.editor.editing}handle(t,e){if(function(t){if(0==t.length)return!1;for(const e of t)if("children"===e.type&&!rh(e))return!0;return!1}(t))this._handleContainerChildrenMutations(t,e);else for(const i of t)this._handleTextMutation(i,e),this._handleTextNodeInsertion(i)}_handleContainerChildrenMutations(t,e){const i=function(t){const e=t.map(t=>t.node).reduce((t,e)=>t.getCommonAncestor(e,{includeSelf:!0}));if(!e)return;return e.getAncestors({includeSelf:!0,parentFirst:!0}).find(t=>t.is("containerElement")||t.is("rootElement"))}(t);if(!i)return;const o=this.editor.editing.view.domConverter.mapViewToDom(i),n=new cr(this.editor.editing.view.document),r=this.editor.data.toModel(n.domToView(o)).getChild(0),s=this.editor.editing.mapper.toModelElement(i);if(!s)return;const a=Array.from(r.getChildren()),l=Array.from(s.getChildren()),c=a[a.length-1],d=l[l.length-1],h=c&&c.is("element","softBreak"),u=d&&!d.is("element","softBreak");h&&u&&a.pop();const g=this.editor.model.schema;if(!lh(a,g)||!lh(l,g))return;const m=a.map(t=>t.is("$text")?t.data:"@").join("").replace(/\u00A0/g," "),f=l.map(t=>t.is("$text")?t.data:"@").join("").replace(/\u00A0/g," ");if(f===m)return;const p=Jn(f,m),{firstChangeAt:b,insertions:w,deletions:k}=ch(p);let _=null;e&&(_=this.editing.mapper.toModelRange(e.getFirstRange()));const v=m.substr(b,w),y=this.editor.model.createRange(this.editor.model.createPositionAt(s,b),this.editor.model.createPositionAt(s,b+k));this.editor.execute("input",{text:v,range:y,resultRange:_})}_handleTextMutation(t,e){if("text"!=t.type)return;const i=t.newText.replace(/\u00A0/g," "),o=t.oldText.replace(/\u00A0/g," ");if(o===i)return;const n=Jn(o,i),{firstChangeAt:r,insertions:s,deletions:a}=ch(n);let l=null;e&&(l=this.editing.mapper.toModelRange(e.getFirstRange()));const c=this.editing.view.createPositionAt(t.node,r),d=this.editing.mapper.toModelPosition(c),h=this.editor.model.createRange(d,d.getShiftedBy(a)),u=i.substr(r,s);this.editor.execute("input",{text:u,range:h,resultRange:l})}_handleTextNodeInsertion(t){if("children"!=t.type)return;const e=rh(t),i=this.editing.view.createPositionAt(t.node,e.index),o=this.editing.mapper.toModelPosition(i),n=e.values[0].data;this.editor.execute("input",{text:n.replace(/\u00A0/g," "),range:this.editor.model.createRange(o)})}}function lh(t,e){return t.every(t=>e.isInline(t))}function ch(t){let e=null,i=null;for(let o=0;o{i.deleteContent(i.document.selection)}),t.unlock()}gn.isAndroid?o.document.on("beforeinput",(t,e)=>r(e),{priority:"lowest"}):o.document.on("keydown",(t,e)=>r(e),{priority:"lowest"}),o.document.on("compositionstart",(function(){const t=i.document,e=1!==t.selection.rangeCount||t.selection.getFirstRange().isFlat;if(t.selection.isCollapsed||e)return;s()}),{priority:"lowest"}),o.document.on("compositionend",()=>{e=i.createSelection(i.document.selection)},{priority:"lowest"})}(t),function(t){t.editing.view.document.on("mutations",(e,i,o)=>{new ah(t).handle(i,o)})}(t)}isInput(t){return this.editor.commands.get("input")._batches.has(t)}}class hh extends md{constructor(t,e){super(t),this.direction=e,this._buffer=new eh(t.model,t.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(t={}){const e=this.editor.model,i=e.document;e.enqueueChange(this._buffer.batch,o=>{this._buffer.lock();const n=o.createSelection(t.selection||i.selection),r=n.isCollapsed;if(n.isCollapsed&&e.modifySelection(n,{direction:this.direction,unit:t.unit}),this._shouldEntireContentBeReplacedWithParagraph(t.sequence||1))return void this._replaceEntireContentWithParagraph(o);if(n.isCollapsed)return;let s=0;n.getFirstRange().getMinimalFlatRanges().forEach(t=>{s+=on(t.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),e.deleteContent(n,{doNotResetEntireContent:r,direction:this.direction}),this._buffer.input(s),o.setSelection(n),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;const e=this.editor.model,i=e.document.selection,o=e.schema.getLimitElement(i);if(!(i.isCollapsed&&i.containsEntireContent(o)))return!1;if(!e.schema.checkChild(o,"paragraph"))return!1;const n=o.getChild(0);return!n||"paragraph"!==n.name}_replaceEntireContentWithParagraph(t){const e=this.editor.model,i=e.document.selection,o=e.schema.getLimitElement(i),n=t.createElement("paragraph");t.remove(t.createRangeIn(o)),t.insert(n,o),t.setSelection(n,0)}}class uh extends br{constructor(t){super(t);const e=t.document;let i=0;function o(t,i,o){let n;e.once("delete",t=>n=t,{priority:Number.POSITIVE_INFINITY}),e.fire("delete",new Dr(e,i,o)),n&&n.stop.called&&t.stop()}e.on("keyup",(t,e)=>{e.keyCode!=pn.delete&&e.keyCode!=pn.backspace||(i=0)}),e.on("keydown",(t,e)=>{const n={};if(e.keyCode==pn.delete)n.direction="forward",n.unit="character";else{if(e.keyCode!=pn.backspace)return;n.direction="backward",n.unit="codePoint"}const r=gn.isMac?e.altKey:e.ctrlKey;n.unit=r?"word":n.unit,n.sequence=++i,o(t,e.domEvent,n)}),gn.isAndroid&&e.on("beforeinput",(e,i)=>{if("deleteContentBackward"!=i.domEvent.inputType)return;const n={unit:"codepoint",direction:"backward",sequence:1},r=i.domTarget.ownerDocument.defaultView.getSelection();r.anchorNode==r.focusNode&&r.anchorOffset+1!=r.focusOffset&&(n.selectionToRemove=t.domConverter.domSelectionToView(r)),o(e,i.domEvent,n)})}observe(){}}class gh extends ud{static get pluginName(){return"Delete"}init(){const t=this.editor,e=t.editing.view,i=e.document;if(e.addObserver(uh),t.commands.add("forwardDelete",new hh(t,"forward")),t.commands.add("delete",new hh(t,"backward")),this.listenTo(i,"delete",(i,o)=>{const n={unit:o.unit,sequence:o.sequence};if(o.selectionToRemove){const e=t.model.createSelection(),i=[];for(const e of o.selectionToRemove.getRanges())i.push(t.editing.mapper.toModelRange(e));e.setTo(i),n.selection=e}t.execute("forward"==o.direction?"forwardDelete":"delete",n),o.preventDefault(),e.scrollToTheSelection()}),gn.isAndroid){let t=null;this.listenTo(i,"delete",(e,i)=>{const o=i.domTarget.ownerDocument.defaultView.getSelection();t={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}},{priority:"lowest"}),this.listenTo(i,"keyup",(e,i)=>{if(t){const e=i.domTarget.ownerDocument.defaultView.getSelection();e.collapse(t.anchorNode,t.anchorOffset),e.extend(t.focusNode,t.focusOffset),t=null}})}}}class mh extends ud{static get requires(){return[dh,gh]}static get pluginName(){return"Typing"}}const fh=new Map;function ph(t,e,i){let o=fh.get(t);o||(o=new Map,fh.set(t,o)),o.set(e,i)}function bh(t){return[t]}function wh(t,e,i={}){const o=function(t,e){const i=fh.get(t);return i&&i.has(e)?i.get(e):bh}(t.constructor,e.constructor);try{return o(t=t.clone(),e,i)}catch(t){throw t}}function kh(t,e,i){t=t.slice(),e=e.slice();const o=new _h(i.document,i.useRelations,i.forceWeakRemove);o.setOriginalOperations(t),o.setOriginalOperations(e);const n=o.originalOperations;if(0==t.length||0==e.length)return{operationsA:t,operationsB:e,originalOperations:n};const r=new WeakMap;for(const e of t)r.set(e,0);const s={nextBaseVersionA:t[t.length-1].baseVersion+1,nextBaseVersionB:e[e.length-1].baseVersion+1,originalOperationsACount:t.length,originalOperationsBCount:e.length};let a=0;for(;a{if(t.key===e.key&&t.range.start.hasSameParentAs(e.range.start)){const o=t.range.getDifference(e.range).map(e=>new $a(e,t.key,t.oldValue,t.newValue,0)),n=t.range.getIntersection(e.range);return n&&i.aIsStrong&&o.push(new $a(n,e.key,e.newValue,t.newValue,0)),0==o.length?[new kl(0)]:o}return[t]}),ph($a,Ka,(t,e)=>{if(t.range.start.hasSameParentAs(e.position)&&t.range.containsPosition(e.position)){const i=t.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map(e=>new $a(e,t.key,t.oldValue,t.newValue,t.baseVersion));if(e.shouldReceiveAttributes){const o=xh(e,t.key,t.oldValue);o&&i.unshift(o)}return i}return t.range=t.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[t]}),ph($a,Xa,(t,e)=>{const i=[];t.range.start.hasSameParentAs(e.deletionPosition)&&(t.range.containsPosition(e.deletionPosition)||t.range.start.isEqual(e.deletionPosition))&&i.push(Es._createFromPositionAndShift(e.graveyardPosition,1));const o=t.range._getTransformedByMergeOperation(e);return o.isCollapsed||i.push(o),i.map(e=>new $a(e,t.key,t.oldValue,t.newValue,t.baseVersion))}),ph($a,Ya,(t,e)=>function(t,e){const i=Es._createFromPositionAndShift(e.sourcePosition,e.howMany);let o=null,n=[];i.containsRange(t,!0)?o=t:t.start.hasSameParentAs(i.start)?(n=t.getDifference(i),o=t.getIntersection(i)):n=[t];const r=[];for(let t of n){t=t._getTransformedByDeletion(e.sourcePosition,e.howMany);const i=e.getMovedRangeStart(),o=t.start.hasSameParentAs(i);t=t._getTransformedByInsertion(i,e.howMany,o),r.push(...t)}o&&r.push(o._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,!1)[0]);return r}(t.range,e).map(e=>new $a(e,t.key,t.oldValue,t.newValue,t.baseVersion))),ph($a,tl,(t,e)=>{if(t.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.range.end.offset++,[t];if(t.range.start.hasSameParentAs(e.splitPosition)&&t.range.containsPosition(e.splitPosition)){const i=t.clone();return i.range=new Es(e.moveTargetPosition.clone(),t.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),t.range.end=e.splitPosition.clone(),t.range.end.stickiness="toPrevious",[t,i]}return t.range=t.range._getTransformedBySplitOperation(e),[t]}),ph(Ka,$a,(t,e)=>{const i=[t];if(t.shouldReceiveAttributes&&t.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(t.position)){const o=xh(t,e.key,e.newValue);o&&i.push(o)}return i}),ph(Ka,Ka,(t,e,i)=>(t.position.isEqual(e.position)&&i.aIsStrong||(t.position=t.position._getTransformedByInsertOperation(e)),[t])),ph(Ka,Ya,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t])),ph(Ka,tl,(t,e)=>(t.position=t.position._getTransformedBySplitOperation(e),[t])),ph(Ka,Xa,(t,e)=>(t.position=t.position._getTransformedByMergeOperation(e),[t])),ph(Qa,Ka,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByInsertOperation(e)[0]),t.newRange&&(t.newRange=t.newRange._getTransformedByInsertOperation(e)[0]),[t])),ph(Qa,Qa,(t,e,i)=>{if(t.name==e.name){if(!i.aIsStrong)return[new kl(0)];t.oldRange=e.newRange?e.newRange.clone():null}return[t]}),ph(Qa,Xa,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByMergeOperation(e)),t.newRange&&(t.newRange=t.newRange._getTransformedByMergeOperation(e)),[t])),ph(Qa,Ya,(t,e,i)=>{if(t.oldRange&&(t.oldRange=Es._createFromRanges(t.oldRange._getTransformedByMoveOperation(e))),t.newRange){if(i.abRelation){const o=Es._createFromRanges(t.newRange._getTransformedByMoveOperation(e));if("left"==i.abRelation.side&&e.targetPosition.isEqual(t.newRange.start))return t.newRange.start.path=i.abRelation.path,t.newRange.end=o.end,[t];if("right"==i.abRelation.side&&e.targetPosition.isEqual(t.newRange.end))return t.newRange.start=o.start,t.newRange.end.path=i.abRelation.path,[t]}t.newRange=Es._createFromRanges(t.newRange._getTransformedByMoveOperation(e))}return[t]}),ph(Qa,tl,(t,e,i)=>{if(t.oldRange&&(t.oldRange=t.oldRange._getTransformedBySplitOperation(e)),t.newRange){if(i.abRelation){const o=t.newRange._getTransformedBySplitOperation(e);return t.newRange.start.isEqual(e.splitPosition)&&i.abRelation.wasStartBeforeMergedElement?t.newRange.start=Ts._createAt(e.insertionPosition):t.newRange.start.isEqual(e.splitPosition)&&!i.abRelation.wasInLeftElement&&(t.newRange.start=Ts._createAt(e.moveTargetPosition)),t.newRange.end.isEqual(e.splitPosition)&&i.abRelation.wasInRightElement?t.newRange.end=Ts._createAt(e.moveTargetPosition):t.newRange.end.isEqual(e.splitPosition)&&i.abRelation.wasEndBeforeMergedElement?t.newRange.end=Ts._createAt(e.insertionPosition):t.newRange.end=o.end,[t]}t.newRange=t.newRange._getTransformedBySplitOperation(e)}return[t]}),ph(Xa,Ka,(t,e)=>(t.sourcePosition.hasSameParentAs(e.position)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByInsertOperation(e),t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e),[t])),ph(Xa,Xa,(t,e,i)=>{if(t.sourcePosition.isEqual(e.sourcePosition)&&t.targetPosition.isEqual(e.targetPosition)){if(i.bWasUndone){const i=e.graveyardPosition.path.slice();return i.push(0),t.sourcePosition=new Ts(e.graveyardPosition.root,i),t.howMany=0,[t]}return[new kl(0)]}if(t.sourcePosition.isEqual(e.sourcePosition)&&!t.targetPosition.isEqual(e.targetPosition)&&!i.bWasUndone&&"splitAtSource"!=i.abRelation){const o="$graveyard"==t.targetPosition.root.rootName,n="$graveyard"==e.targetPosition.root.rootName,r=o&&!n;if(n&&!o||!r&&i.aIsStrong){const i=e.targetPosition._getTransformedByMergeOperation(e),o=t.targetPosition._getTransformedByMergeOperation(e);return[new Ya(i,t.howMany,o,0)]}return[new kl(0)]}return t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMergeOperation(e),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),t.graveyardPosition.isEqual(e.graveyardPosition)&&i.aIsStrong||(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]}),ph(Xa,Ya,(t,e,i)=>{const o=Es._createFromPositionAndShift(e.sourcePosition,e.howMany);return"remove"==e.type&&!i.bWasUndone&&!i.forceWeakRemove&&t.deletionPosition.hasSameParentAs(e.sourcePosition)&&o.containsPosition(t.sourcePosition)?[new kl(0)]:(t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition.hasSameParentAs(e.sourcePosition)&&(t.howMany-=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMoveOperation(e),t.targetPosition=t.targetPosition._getTransformedByMoveOperation(e),t.graveyardPosition.isEqual(e.targetPosition)||(t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)),[t])}),ph(Xa,tl,(t,e,i)=>{if(e.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),t.deletionPosition.isEqual(e.graveyardPosition)&&(t.howMany=e.howMany)),t.targetPosition.isEqual(e.splitPosition)){const o=0!=e.howMany,n=e.graveyardPosition&&t.deletionPosition.isEqual(e.graveyardPosition);if(o||n||"mergeTargetNotMoved"==i.abRelation)return t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),[t]}if(t.sourcePosition.isEqual(e.splitPosition)){if("mergeSourceNotMoved"==i.abRelation)return t.howMany=0,t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t];if("mergeSameElement"==i.abRelation||t.sourcePosition.offset>0)return t.sourcePosition=e.moveTargetPosition.clone(),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}return t.sourcePosition.hasSameParentAs(e.splitPosition)&&(t.howMany=e.splitPosition.offset),t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}),ph(Ya,Ka,(t,e)=>{const i=Es._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByInsertOperation(e,!1)[0];return t.sourcePosition=i.start,t.howMany=i.end.offset-i.start.offset,t.targetPosition.isEqual(e.position)||(t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e)),[t]}),ph(Ya,Ya,(t,e,i)=>{const o=Es._createFromPositionAndShift(t.sourcePosition,t.howMany),n=Es._createFromPositionAndShift(e.sourcePosition,e.howMany);let r,s=i.aIsStrong,a=!i.aIsStrong;if("insertBefore"==i.abRelation||"insertAfter"==i.baRelation?a=!0:"insertAfter"!=i.abRelation&&"insertBefore"!=i.baRelation||(a=!1),r=t.targetPosition.isEqual(e.targetPosition)&&a?t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):t.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Ah(t,e)&&Ah(e,t))return[e.getReversed()];if(o.containsPosition(e.targetPosition)&&o.containsRange(n,!0))return o.start=o.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),o.end=o.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Th([o],r);if(n.containsPosition(t.targetPosition)&&n.containsRange(o,!0))return o.start=o.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),o.end=o.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),Th([o],r);const l=Li(t.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return o.start=o.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),o.end=o.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Th([o],r);"remove"!=t.type||"remove"==e.type||i.aWasUndone||i.forceWeakRemove?"remove"==t.type||"remove"!=e.type||i.bWasUndone||i.forceWeakRemove||(s=!1):s=!0;const c=[],d=o.getDifference(n);for(const t of d){t.start=t.start._getTransformedByDeletion(e.sourcePosition,e.howMany),t.end=t.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const i="same"==Li(t.start.getParentPath(),e.getMovedRangeStart().getParentPath()),o=t._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,i);c.push(...o)}const h=o.getIntersection(n);return null!==h&&s&&(h.start=h.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),h.end=h.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),0===c.length?c.push(h):1==c.length?n.start.isBefore(o.start)||n.start.isEqual(o.start)?c.unshift(h):c.push(h):c.splice(1,0,h)),0===c.length?[new kl(t.baseVersion)]:Th(c,r)}),ph(Ya,tl,(t,e,i)=>{let o=t.targetPosition.clone();t.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition&&"moveTargetAfter"!=i.abRelation||(o=t.targetPosition._getTransformedBySplitOperation(e));const n=Es._createFromPositionAndShift(t.sourcePosition,t.howMany);if(n.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.howMany++,t.targetPosition=o,[t];if(n.start.hasSameParentAs(e.splitPosition)&&n.containsPosition(e.splitPosition)){let t=new Es(e.splitPosition,n.end);t=t._getTransformedBySplitOperation(e);return Th([new Es(n.start,e.splitPosition),t],o)}t.targetPosition.isEqual(e.splitPosition)&&"insertAtSource"==i.abRelation&&(o=e.moveTargetPosition),t.targetPosition.isEqual(e.insertionPosition)&&"insertBetween"==i.abRelation&&(o=t.targetPosition);const r=[n._getTransformedBySplitOperation(e)];if(e.graveyardPosition){const o=n.start.isEqual(e.graveyardPosition)||n.containsPosition(e.graveyardPosition);t.howMany>1&&o&&!i.aWasUndone&&r.push(Es._createFromPositionAndShift(e.insertionPosition,1))}return Th(r,o)}),ph(Ya,Xa,(t,e,i)=>{const o=Es._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.sourcePosition))if("remove"!=t.type||i.forceWeakRemove){if(1==t.howMany)return i.bWasUndone?(t.sourcePosition=e.graveyardPosition.clone(),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]):[new kl(0)]}else if(!i.aWasUndone){const i=[];let o=e.graveyardPosition.clone(),n=e.targetPosition._getTransformedByMergeOperation(e);t.howMany>1&&(i.push(new Ya(t.sourcePosition,t.howMany-1,t.targetPosition,0)),o=o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1),n=n._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1));const r=e.deletionPosition._getCombined(t.sourcePosition,t.targetPosition),s=new Ya(o,1,r,0),a=s.getMovedRangeStart().path.slice();a.push(0);const l=new Ts(s.targetPosition.root,a);n=n._getTransformedByMove(o,r,1);const c=new Ya(n,e.howMany,l,0);return i.push(s),i.push(c),i}const n=Es._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByMergeOperation(e);return t.sourcePosition=n.start,t.howMany=n.end.offset-n.start.offset,t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]}),ph(Ja,Ka,(t,e)=>(t.position=t.position._getTransformedByInsertOperation(e),[t])),ph(Ja,Xa,(t,e)=>t.position.isEqual(e.deletionPosition)?(t.position=e.graveyardPosition.clone(),t.position.stickiness="toNext",[t]):(t.position=t.position._getTransformedByMergeOperation(e),[t])),ph(Ja,Ya,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t])),ph(Ja,Ja,(t,e,i)=>{if(t.position.isEqual(e.position)){if(!i.aIsStrong)return[new kl(0)];t.oldName=e.newName}return[t]}),ph(Ja,tl,(t,e)=>{if("same"==Li(t.position.path,e.splitPosition.getParentPath())&&!e.graveyardPosition){const e=new Ja(t.position.getShiftedBy(1),t.oldName,t.newName,0);return[t,e]}return t.position=t.position._getTransformedBySplitOperation(e),[t]}),ph(Za,Za,(t,e,i)=>{if(t.root===e.root&&t.key===e.key){if(!i.aIsStrong||t.newValue===e.newValue)return[new kl(0)];t.oldValue=e.newValue}return[t]}),ph(tl,Ka,(t,e)=>(t.splitPosition.hasSameParentAs(e.position)&&t.splitPosition.offset{if(!t.graveyardPosition&&!i.bWasUndone&&t.splitPosition.hasSameParentAs(e.sourcePosition)){const i=e.graveyardPosition.path.slice();i.push(0);const o=new Ts(e.graveyardPosition.root,i),n=tl.getInsertionPosition(new Ts(e.graveyardPosition.root,i)),r=new tl(o,0,null,0);return r.insertionPosition=n,t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=tl.getInsertionPosition(t.splitPosition),t.graveyardPosition=r.insertionPosition.clone(),t.graveyardPosition.stickiness="toNext",[r,t]}return t.splitPosition.hasSameParentAs(e.deletionPosition)&&!t.splitPosition.isAfter(e.deletionPosition)&&t.howMany--,t.splitPosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=tl.getInsertionPosition(t.splitPosition),t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]}),ph(tl,Ya,(t,e,i)=>{const o=Es._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.graveyardPosition){const n=o.start.isEqual(t.graveyardPosition)||o.containsPosition(t.graveyardPosition);if(!i.bWasUndone&&n){const i=t.splitPosition._getTransformedByMoveOperation(e),o=t.graveyardPosition._getTransformedByMoveOperation(e),n=o.path.slice();n.push(0);const r=new Ts(o.root,n);return[new Ya(i,t.howMany,r,0)]}t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)}if(t.splitPosition.hasSameParentAs(e.sourcePosition)&&o.containsPosition(t.splitPosition)){const i=e.howMany-(t.splitPosition.offset-e.sourcePosition.offset);return t.howMany-=i,t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset{if(t.splitPosition.isEqual(e.splitPosition)){if(!t.graveyardPosition&&!e.graveyardPosition)return[new kl(0)];if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition))return[new kl(0)];if("splitBefore"==i.abRelation)return t.howMany=0,t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e),[t]}if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition)){const o="$graveyard"==t.splitPosition.root.rootName,n="$graveyard"==e.splitPosition.root.rootName,r=o&&!n;if(n&&!o||!r&&i.aIsStrong){const i=[];return e.howMany&&i.push(new Ya(e.moveTargetPosition,e.howMany,e.splitPosition,0)),t.howMany&&i.push(new Ya(t.splitPosition,t.howMany,t.moveTargetPosition,0)),i}return[new kl(0)]}if(t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e)),t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==i.abRelation)return t.howMany++,[t];if(e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==i.baRelation){const i=e.insertionPosition.path.slice();i.push(0);const o=new Ts(e.insertionPosition.root,i);return[t,new Ya(t.insertionPosition,1,o,0)]}return t.splitPosition.hasSameParentAs(e.splitPosition)&&t.splitPosition.offsetthis.clearStack())}refresh(){this.isEnabled=this._stack.length>0}addBatch(t){const e=this.editor.model.document.selection,i={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,i){const o=this.editor.model,n=o.document,r=[],s=t.map(t=>t.getTransformedByOperations(i)),a=s.flat();for(const t of s){const e=t.filter(t=>t.root!=n.graveyard).filter(t=>!Ph(t,a));e.length&&(Sh(e),r.push(e[0]))}r.length&&o.change(t=>{t.setSelection(r,{backward:e})})}_undo(t,e){const i=this.editor.model,o=i.document;this._createdBatches.add(e);const n=t.operations.slice().filter(t=>t.isDocumentOperation);n.reverse();for(const t of n){const n=t.baseVersion+1,r=Array.from(o.history.getOperations(n)),s=kh([t.getReversed()],r,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const n of s)e.addOperation(n),i.applyOperation(n),o.history.setOperationAsUndone(t,n)}}}function Sh(t){t.sort((t,e)=>t.start.isBefore(e.start)?-1:1);for(let e=1;ee!==t&&e.containsRange(t,!0))}class Eh extends Ch{execute(t=null){const e=t?this._stack.findIndex(e=>e.batch==t):this._stack.length-1,i=this._stack.splice(e,1)[0],o=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(o,()=>{this._undo(i.batch,o);const t=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,t),this.fire("revert",i.batch,o)}),this.refresh()}}class Mh extends Ch{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(e,()=>{const i=t.batch.operations[t.batch.operations.length-1].baseVersion+1,o=this.editor.model.document.history.getOperations(i);this._restoreSelection(t.selection.ranges,t.selection.isBackward,o),this._undo(t.batch,e)}),this.refresh()}}class Lh extends ud{static get pluginName(){return"UndoEditing"}constructor(t){super(t),this._batchRegistry=new WeakSet}init(){const t=this.editor;this._undoCommand=new Eh(t),this._redoCommand=new Mh(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(t,e)=>{const i=e[0];if(!i.isDocumentOperation)return;const o=i.batch,n=this._redoCommand._createdBatches.has(o),r=this._undoCommand._createdBatches.has(o);this._batchRegistry.has(o)||"transparent"==o.type&&!n&&!r||(n?this._undoCommand.addBatch(o):r||(this._undoCommand.addBatch(o),this._redoCommand.clearStack()),this._batchRegistry.add(o))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(t,e,i)=>{this._redoCommand.addBatch(i)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo")}}var Ih='',Nh='';class zh extends ud{init(){const t=this.editor,e=t.locale,i=t.t,o="ltr"==e.uiLanguageDirection?Ih:Nh,n="ltr"==e.uiLanguageDirection?Nh:Ih;this._addButton("undo",i("Undo"),"CTRL+Z",o),this._addButton("redo",i("Redo"),"CTRL+Y",n)}_addButton(t,e,i,o){const n=this.editor;n.ui.componentFactory.add(t,r=>{const s=n.commands.get(t),a=new Kc(r);return a.set({label:e,icon:o,keystroke:i,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{n.execute(t),n.editing.view.focus()}),a})}}class Oh extends ud{static get requires(){return[Lh,zh]}static get pluginName(){return"Undo"}}class Rh extends md{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=e.selection.getAttribute(this.attributeKey),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,i=e.document.selection,o=t.value;e.change(t=>{if(i.isCollapsed)o?t.setSelectionAttribute(this.attributeKey,o):t.removeSelectionAttribute(this.attributeKey);else{const n=e.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const e of n)o?t.setAttribute(this.attributeKey,o,e):t.removeAttribute(this.attributeKey,e)}})}}class Dh extends Kc{constructor(t){super(t);const e=this.bindTemplate;this.set("color"),this.set("hasBorder"),this.icon='',this.extendTemplate({attributes:{style:{backgroundColor:e.to("color")},class:["ck","ck-color-grid__tile",e.if("hasBorder","ck-color-table__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}i(46);class Vh extends xc{constructor(t,e){super(t);const i=e&&e.colorDefinitions||[],o={};e&&e.columns&&(o.gridTemplateColumns=`repeat( ${e.columns}, 1fr)`),this.set("selectedColor"),this.items=this.createCollection(),this.focusTracker=new Yl,this.keystrokes=new jl,this._focusCycler=new Oc({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowleft",focusNext:"arrowright"}}),this.items.on("add",(t,e)=>{e.isOn=e.color===this.selectedColor}),i.forEach(t=>{const e=new Dh;e.set({color:t.color,label:t.label,tooltip:!0,hasBorder:t.options.hasBorder}),e.on("execute",()=>{this.fire("execute",{value:t.color,hasBorder:t.options.hasBorder,label:t.label})}),this.items.add(e)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:o}}),this.on("change:selectedColor",(t,e,i)=>{for(const t of this.items)t.isOn=t.color===i})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}}class jh extends xi{constructor(t){super(t),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",0===this.length)})}add(t,e){this.find(e=>e.color===t.color)||super.add(t,e)}hasColor(t){return!!this.find(e=>e.color===t)}}yi(jh,Uo);var Bh='';i(48);class Fh extends xc{constructor(t,{colors:e,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r}){super(t),this.items=this.createCollection(),this.colorDefinitions=e,this.focusTracker=new Yl,this.keystrokes=new jl,this.set("selectedColor"),this.removeButtonLabel=o,this.columns=i,this.documentColors=new jh,this.documentColorsCount=r,this._focusCycler=new Oc({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this._documentColorsLabel=n,this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-table"]},children:this.items}),this.items.add(this._removeColorButton())}updateDocumentColors(t,e){const i=t.document,o=this.documentColorsCount;this.documentColors.clear();for(const n of i.getRootNames()){const r=i.getRoot(n),s=t.createRangeIn(r);for(const t of s.getItems())if(t.is("$textProxy")&&t.hasAttribute(e)&&(this._addColorToDocumentColors(t.getAttribute(e)),this.documentColors.length>=o))return}}updateSelectedColors(){const t=this.documentColorsGrid,e=this.staticColorsGrid,i=this.selectedColor;e.selectedColor=i,t&&(t.selectedColor=i)}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.keystrokes.listenTo(this.element)}appendGrids(){if(!this.staticColorsGrid&&(this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount)){const t=nc.bind(this.documentColors,this.documentColors),e=new Pc(this.locale);e.text=this._documentColorsLabel,e.extendTemplate({attributes:{class:["ck","ck-color-grid__label",t.if("isEmpty","ck-hidden")]}}),this.items.add(e),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_removeColorButton(){const t=new Kc;return t.set({withText:!0,icon:Bh,tooltip:!0,label:this.removeButtonLabel}),t.class="ck-color-table__remove-color",t.on("execute",()=>{this.fire("execute",{value:null})}),t}_createStaticColorsGrid(){const t=new Vh(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return t.delegate("execute").to(this),t}_createDocumentColorsGrid(){const t=nc.bind(this.documentColors,this.documentColors),e=new Vh(this.locale,{columns:this.columns});return e.delegate("execute").to(this),e.extendTemplate({attributes:{class:t.if("isEmpty","ck-hidden")}}),e.items.bindTo(this.documentColors).using(t=>{const e=new Dh;return e.set({color:t.color,hasBorder:t.options&&t.options.hasBorder}),t.label&&e.set({label:t.label,tooltip:!0}),e.on("execute",()=>{this.fire("execute",{value:t.color})}),e}),this.documentColors.on("change:isEmpty",(t,i,o)=>{o&&(e.selectedColor=null)}),e}_addColorToDocumentColors(t){const e=this.colorDefinitions.find(e=>e.color===t);e?this.documentColors.add(Object.assign({},e)):this.documentColors.add({color:t,label:t,options:{hasBorder:!1}})}}function Hh(t,e){const i={model:{key:t,values:[]},view:{},upcastAlso:{}};for(const t of e)i.model.values.push(t.model),i.view[t.model]=t.view,t.upcastAlso&&(i.upcastAlso[t.model]=t.upcastAlso);return i}function Uh(t){return e=>e.getStyle(t).replace(/\s/g,"")}function qh(t){return(e,{writer:i})=>i.createAttributeElement("span",{style:`${t}:${e}`},{priority:7})}class Wh extends Rh{constructor(t){super(t,"fontBackgroundColor")}}const $h=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,Gh=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,Yh=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,Kh=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,Qh=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,Jh=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 Zh(t){return t.startsWith("#")?$h.test(t):t.startsWith("rgb")?Gh.test(t)||Yh.test(t):t.startsWith("hsl")?Kh.test(t)||Qh.test(t):Jh.has(t.toLowerCase())}const Xh=["repeat-x","repeat-y","repeat","space","round","no-repeat"];const tu=["center","top","bottom","left","right"];function eu(t){return tu.includes(t)}const iu=["fixed","scroll","local"];function ou(t){return iu.includes(t)}const nu=/^url\(/;function ru(t){return nu.test(t)}function su(t){return t.replace(/, /g,",").split(" ").map(t=>t.replace(/,/g,", "))}function au(t){t.setNormalizer("background",lu),t.setNormalizer("background-color",t=>({path:"background.color",value:t})),t.setReducer("background",t=>{const e=[];return e.push(["background-color",t.color]),e})}function lu(t){const e={},i=su(t);for(const t of i)o=t,Xh.includes(o)?(e.repeat=e.repeat||[],e.repeat.push(t)):eu(t)?(e.position=e.position||[],e.position.push(t)):ou(t)?e.attachment=t:Zh(t)?e.color=t:ru(t)&&(e.image=t);var o;return{path:"background",value:e}}class cu extends ud{static get pluginName(){return"FontBackgroundColorEditing"}constructor(t){super(t),t.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}),t.data.addStyleProcessorRules(au),t.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:"fontBackgroundColor",value:Uh("background-color")}}),t.conversion.for("downcast").attributeToElement({model:"fontBackgroundColor",view:qh("background-color")}),t.commands.add("fontBackgroundColor",new Wh(t)),t.model.schema.extend("$text",{allowAttributes:"fontBackgroundColor"}),t.model.schema.setAttributeProperties("fontBackgroundColor",{isFormatting:!0,copyOnEnter:!0})}}function du(t){return"string"==typeof t?{model:t,label:t,hasBorder:!1,view:{name:"span",styles:{color:t}}}:{model:t.color,label:t.label||t.color,hasBorder:void 0!==t.hasBorder&&t.hasBorder,view:{name:"span",styles:{color:""+t.color}}}}class hu extends ud{constructor(t,{commandName:e,icon:i,componentName:o,dropdownLabel:n}){super(t),this.commandName=e,this.componentName=o,this.icon=i,this.dropdownLabel=n,this.columns=t.config.get(this.componentName+".columns"),this.colorTableView=void 0}init(){const t=this.editor,e=t.locale,i=e.t,o=t.commands.get(this.commandName);const n=function(t,e){const i=t.t,o={Black:i("Black"),"Dim grey":i("Dim grey"),Grey:i("Grey"),"Light grey":i("Light grey"),White:i("White"),Red:i("Red"),Orange:i("Orange"),Yellow:i("Yellow"),"Light green":i("Light green"),Green:i("Green"),Aquamarine:i("Aquamarine"),Turquoise:i("Turquoise"),"Light blue":i("Light blue"),Blue:i("Blue"),Purple:i("Purple")};return e.map(t=>{const e=o[t.label];return e&&e!=t.label&&(t.label=e),t})}(e,t.config.get(this.componentName).colors.map(du).filter(t=>!!t)),r=t.config.get(this.componentName+".documentColors");t.ui.componentFactory.add(this.componentName,e=>{const s=od(e);return this.colorTableView=function({dropdownView:t,colors:e,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r}){const s=t.locale,a=new Fh(s,{colors:e,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r});return t.colorTableView=a,t.panelView.children.add(a),a.delegate("execute").to(t,"execute"),a}({dropdownView:s,colors:n.map(t=>({label:t.label,color:t.model,options:{hasBorder:t.hasBorder}})),columns:this.columns,removeButtonLabel:i("Remove color"),documentColorsLabel:0!==r?i("Document colors"):void 0,documentColorsCount:void 0===r?this.columns:r}),this.colorTableView.bind("selectedColor").to(o,"value"),s.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),s.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),s.bind("isEnabled").to(o),s.on("execute",(e,i)=>{t.execute(this.commandName,i),t.editing.view.focus()}),s.on("change:isOpen",(e,i,o)=>{s.colorTableView.appendGrids(),o&&(0!==r&&this.colorTableView.updateDocumentColors(t.model,this.componentName),this.colorTableView.updateSelectedColors())}),s})}}class uu extends hu{constructor(t){super(t,{commandName:"fontBackgroundColor",componentName:"fontBackgroundColor",icon:'',dropdownLabel:(0,t.locale.t)("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class gu extends Rh{constructor(t){super(t,"fontColor")}}class mu extends ud{static get pluginName(){return"FontColorEditing"}constructor(t){super(t),t.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}),t.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:"fontColor",value:Uh("color")}}),t.conversion.for("downcast").attributeToElement({model:"fontColor",view:qh("color")}),t.commands.add("fontColor",new gu(t)),t.model.schema.extend("$text",{allowAttributes:"fontColor"}),t.model.schema.setAttributeProperties("fontColor",{isFormatting:!0,copyOnEnter:!0})}}class fu extends hu{constructor(t){super(t,{commandName:"fontColor",componentName:"fontColor",icon:'',dropdownLabel:(0,t.locale.t)("Font Color")})}static get pluginName(){return"FontColorUI"}}class pu extends Rh{constructor(t){super(t,"fontFamily")}}function bu(t){return t.map(wu).filter(t=>!!t)}function wu(t){return"object"==typeof t?t:"default"===t?{title:"Default",model:void 0}:"string"==typeof t?function(t){const e=t.replace(/"|'/g,"").split(","),i=e[0],o=e.map(ku).join(", ");return{title:i,model:o,view:{name:"span",styles:{"font-family":o},priority:7}}}(t):void 0}function ku(t){return(t=t.trim()).indexOf(" ")>0&&(t=`'${t}'`),t}class _u extends ud{static get pluginName(){return"FontFamilyEditing"}constructor(t){super(t),t.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 t=this.editor;t.model.schema.extend("$text",{allowAttributes:"fontFamily"}),t.model.schema.setAttributeProperties("fontFamily",{isFormatting:!0,copyOnEnter:!0});const e=Hh("fontFamily",bu(t.config.get("fontFamily.options")).filter(t=>t.model));t.config.get("fontFamily.supportAllValues")?this._prepareAnyValueConverters():t.conversion.attributeToElement(e),t.commands.add("fontFamily",new pu(t))}_prepareAnyValueConverters(){const t=this.editor;t.conversion.for("downcast").attributeToElement({model:"fontFamily",view:(t,{writer:e})=>e.createAttributeElement("span",{style:"font-family:"+t},{priority:7})}),t.conversion.for("upcast").attributeToAttribute({model:{key:"fontFamily",value:t=>t.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}}class vu{constructor(t,e){e&&Vo(this,e),t&&this.set(t)}}yi(vu,Uo);class yu extends ud{init(){const t=this.editor,e=t.t,i=this._getLocalizedOptions(),o=t.commands.get("fontFamily");t.ui.componentFactory.add("fontFamily",n=>{const r=od(n);return rd(r,function(t,e){const i=new xi;for(const o of t){const t={type:"button",model:new vu({commandName:"fontFamily",commandParam:o.model,label:o.title,withText:!0})};t.model.bind("isOn").to(e,"value",t=>t===o.model||!(!t||!o.model)&&t.split(",")[0].replace(/'/g,"").toLowerCase()===o.model.toLowerCase()),o.view&&o.view.styles&&t.model.set("labelStyle","font-family: "+o.view.styles["font-family"]),i.add(t)}return i}(i,o)),r.buttonView.set({label:e("Font Family"),icon:'',tooltip:!0}),r.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),r.bind("isEnabled").to(o),this.listenTo(r,"execute",e=>{t.execute(e.source.commandName,{value:e.source.commandParam}),t.editing.view.focus()}),r})}_getLocalizedOptions(){const t=this.editor,e=t.t;return bu(t.config.get("fontFamily").options).map(t=>("Default"===t.title&&(t.title=e("Default")),t))}}class xu extends Rh{constructor(t){super(t,"fontSize")}}function Au(t){return t.map(t=>function(t){if(e=t,"object"==typeof e&&e.title&&e.model&&e.view)return Cu(t);var e;const i=function(t){return Tu[t]||Tu[t.model]}(t);if(i)return Cu(i);if("default"===t)return{model:void 0,title:"Default"};if(function(t){let e;if("object"==typeof t){if(!t.model)throw new hi.a("font-size-invalid-definition",null,t);e=parseFloat(t.model)}else e=parseFloat(t);return isNaN(e)}(t))return;return function(t){"number"!=typeof t&&"string"!=typeof t||(t={title:String(t),model:parseFloat(t)+"px"});return t.view={name:"span",styles:{"font-size":t.model}},Cu(t)}(t)}(t)).filter(t=>!!t)}const Tu={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 Cu(t){return t.view.priority||(t.view.priority=7),t}class Su extends ud{static get pluginName(){return"FontSizeEditing"}constructor(t){super(t),t.config.define("fontSize",{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"fontSize"}),t.model.schema.setAttributeProperties("fontSize",{isFormatting:!0,copyOnEnter:!0});const e=t.config.get("fontSize.supportAllValues"),i=Hh("fontSize",Au(this.editor.config.get("fontSize.options")).filter(t=>t.model));e?this._prepareAnyValueConverters(i):t.conversion.attributeToElement(i),t.commands.add("fontSize",new xu(t))}_prepareAnyValueConverters(t){const e=this.editor,i=t.model.values.filter(t=>!String(t).match(/[\d.]+[\w%]+/));if(i.length)throw new hi.a("font-size-invalid-use-of-named-presets",null,{presets:i});e.conversion.for("downcast").attributeToElement({model:"fontSize",view:(t,{writer:e})=>{if(t)return e.createAttributeElement("span",{style:"font-size:"+t},{priority:7})}}),e.conversion.for("upcast").attributeToAttribute({model:{key:"fontSize",value:t=>t.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}}i(50);class Pu extends ud{init(){const t=this.editor,e=t.t,i=this._getLocalizedOptions(),o=t.commands.get("fontSize");t.ui.componentFactory.add("fontSize",n=>{const r=od(n);return rd(r,function(t,e){const i=new xi;for(const o of t){const t={type:"button",model:new vu({commandName:"fontSize",commandParam:o.model,label:o.title,class:"ck-fontsize-option",withText:!0})};o.view&&o.view.styles&&t.model.set("labelStyle","font-size:"+o.view.styles["font-size"]),o.view&&o.view.classes&&t.model.set("class",`${t.model.class} ${o.view.classes}`),t.model.bind("isOn").to(e,"value",t=>t===o.model),i.add(t)}return i}(i,o)),r.buttonView.set({label:e("Font Size"),icon:'',tooltip:!0}),r.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),r.bind("isEnabled").to(o),this.listenTo(r,"execute",e=>{t.execute(e.source.commandName,{value:e.source.commandParam}),t.editing.view.focus()}),r})}_getLocalizedOptions(){const t=this.editor,e=t.t,i={Default:e("Default"),Tiny:e("Tiny"),Small:e("Small"),Big:e("Big"),Huge:e("Huge")};return Au(t.config.get("fontSize").options).map(t=>{const e=i[t.title];return e&&e!=t.title&&(t=Object.assign({},t,{title:e})),t})}}class Eu extends md{refresh(){const t=this.editor.model,e=pd(t.document.selection.getSelectedBlocks());this.value=!!e&&e.is("element","paragraph"),this.isEnabled=!!e&&Mu(e,t.schema)}execute(t={}){const e=this.editor.model,i=e.document;e.change(o=>{const n=(t.selection||i.selection).getSelectedBlocks();for(const t of n)!t.is("element","paragraph")&&Mu(t,e.schema)&&o.rename(t,"paragraph")})}}function Mu(t,e){return e.checkChild(t.parent,"paragraph")&&!e.isObject(t)}class Lu extends md{execute(t){const e=this.editor.model;let i=t.position;e.change(t=>{const o=t.createElement("paragraph");if(!e.schema.checkChild(i.parent,o)){const n=e.schema.findAllowedParent(i,o);if(!n)return;i=t.split(i,n).position}e.insertContent(o,i),t.setSelection(o,"in")})}}class Iu extends ud{static get pluginName(){return"Paragraph"}init(){const t=this.editor,e=t.model;t.commands.add("paragraph",new Eu(t)),t.commands.add("insertParagraph",new Lu(t)),e.schema.register("paragraph",{inheritAllFrom:"$block"}),t.conversion.elementToElement({model:"paragraph",view:"p"}),t.conversion.for("upcast").elementToElement({model:(t,{writer:e})=>Iu.paragraphLikeElements.has(t.name)?t.isEmpty?null:e.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}Iu.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class Nu extends md{constructor(t,e){super(t),this.modelElements=e}refresh(){const t=pd(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some(e=>zu(t,e,this.editor.model.schema))}execute(t){const e=this.editor.model,i=e.document,o=t.value;e.change(t=>{const n=Array.from(i.selection.getSelectedBlocks()).filter(t=>zu(t,o,e.schema));for(const e of n)e.is("element",o)||t.rename(e,o)})}}function zu(t,e,i){return i.checkChild(t.parent,e)&&!i.isObject(t)}class Ou extends ud{static get pluginName(){return"HeadingEditing"}constructor(t){super(t),t.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[Iu]}init(){const t=this.editor,e=t.config.get("heading.options"),i=[];for(const o of e)"paragraph"!==o.model&&(t.model.schema.register(o.model,{inheritAllFrom:"$block"}),t.conversion.elementToElement(o),i.push(o.model));this._addDefaultH1Conversion(t),t.commands.add("heading",new Nu(t,i))}afterInit(){const t=this.editor,e=t.commands.get("enter"),i=t.config.get("heading.options");e&&this.listenTo(e,"afterExecute",(e,o)=>{const n=t.model.document.selection.getFirstPosition().parent;i.some(t=>n.is("element",t.model))&&!n.is("element","paragraph")&&0===n.childCount&&o.writer.rename(n,"paragraph")})}_addDefaultH1Conversion(t){t.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:di.get("low")+1})}}i(12);class Ru extends ud{init(){const t=this.editor,e=t.t,i=function(t){const e=t.t,i={Paragraph:e("Paragraph"),"Heading 1":e("Heading 1"),"Heading 2":e("Heading 2"),"Heading 3":e("Heading 3"),"Heading 4":e("Heading 4"),"Heading 5":e("Heading 5"),"Heading 6":e("Heading 6")};return t.config.get("heading.options").map(t=>{const e=i[t.title];return e&&e!=t.title&&(t.title=e),t})}(t),o=e("Choose heading"),n=e("Heading");t.ui.componentFactory.add("heading",e=>{const r={},s=new xi,a=t.commands.get("heading"),l=t.commands.get("paragraph"),c=[a];for(const t of i){const e={type:"button",model:new vu({label:t.title,class:t.class,withText:!0})};"paragraph"===t.model?(e.model.bind("isOn").to(l,"value"),e.model.set("commandName","paragraph"),c.push(l)):(e.model.bind("isOn").to(a,"value",e=>e===t.model),e.model.set({commandName:"heading",commandValue:t.model})),s.add(e),r[t.model]=t.title}const d=od(e);return rd(d,s),d.buttonView.set({isOn:!1,withText:!0,tooltip:n}),d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),d.bind("isEnabled").toMany(c,"isEnabled",(...t)=>t.some(t=>t)),d.buttonView.bind("label").to(a,"value",l,"value",(t,e)=>{const i=t||e&&"paragraph";return r[i]?r[i]:o}),this.listenTo(d,"execute",e=>{t.execute(e.source.commandName,e.source.commandValue?{value:e.source.commandValue}:void 0),t.editing.view.focus()}),d})}}class Du extends md{refresh(){const t=this.editor.model,e=t.document;this.value=e.selection.getAttribute("highlight"),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"highlight")}execute(t={}){const e=this.editor.model,i=e.document.selection,o=t.value;e.change(t=>{const n=e.schema.getValidRanges(i.getRanges(),"highlight");if(i.isCollapsed){const e=i.getFirstPosition();if(i.hasAttribute("highlight")){const i=t=>t.item.hasAttribute("highlight")&&t.item.getAttribute("highlight")===this.value,n=e.getLastMatchingPosition(i,{direction:"backward"}),r=e.getLastMatchingPosition(i),s=t.createRange(n,r);o&&this.value!==o?(t.setAttribute("highlight",o,s),t.setSelectionAttribute("highlight",o)):(t.removeAttribute("highlight",s),t.removeSelectionAttribute("highlight"))}else o&&t.setSelectionAttribute("highlight",o)}else for(const e of n)o?t.setAttribute("highlight",o,e):t.removeAttribute("highlight",e)})}}class Vu extends ud{static get pluginName(){return"HighlightEditing"}constructor(t){super(t),t.config.define("highlight",{options:[{model:"yellowMarker",class:"marker-yellow",title:"Yellow marker",color:"var(--ck-highlight-marker-yellow)",type:"marker"},{model:"greenMarker",class:"marker-green",title:"Green marker",color:"var(--ck-highlight-marker-green)",type:"marker"},{model:"pinkMarker",class:"marker-pink",title:"Pink marker",color:"var(--ck-highlight-marker-pink)",type:"marker"},{model:"blueMarker",class:"marker-blue",title:"Blue marker",color:"var(--ck-highlight-marker-blue)",type:"marker"},{model:"redPen",class:"pen-red",title:"Red pen",color:"var(--ck-highlight-pen-red)",type:"pen"},{model:"greenPen",class:"pen-green",title:"Green pen",color:"var(--ck-highlight-pen-green)",type:"pen"}]})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"highlight"});const e=t.config.get("highlight.options");t.conversion.attributeToElement(function(t){const e={model:{key:"highlight",values:[]},view:{}};for(const i of t)e.model.values.push(i.model),e.view[i.model]={name:"mark",classes:i.class};return e}(e)),t.commands.add("highlight",new Du(t))}}i(53);class ju extends xc{constructor(t){super(t);const e=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 jl,this.focusTracker=new Yl,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",e.if("isVisible","ck-hidden",t=>!t),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",(t,e)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),e())}),this.keystrokes.set("arrowleft",(t,e)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),e())})}focus(){this.actionView.focus()}_createActionView(){const t=new Kc;return t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){const t=new Kc,e=t.bindTemplate;return t.icon=Qc,t.extendTemplate({attributes:{class:"ck-splitbutton__arrow","aria-haspopup":!0,"aria-expanded":e.to("isOn",t=>String(t))}}),t.bind("isEnabled").to(this),t.delegate("execute").to(this,"open"),t}}i(55);class Bu extends ud{get localizedOptionTitles(){const t=this.editor.t;return{"Yellow marker":t("Yellow marker"),"Green marker":t("Green marker"),"Pink marker":t("Pink marker"),"Blue marker":t("Blue marker"),"Red pen":t("Red pen"),"Green pen":t("Green pen")}}static get pluginName(){return"HighlightUI"}init(){const t=this.editor.config.get("highlight.options");for(const e of t)this._addHighlighterButton(e);this._addRemoveHighlightButton(),this._addDropdown(t)}_addRemoveHighlightButton(){const t=this.editor.t;this._addButton("removeHighlight",t("Remove highlight"),Bh)}_addHighlighterButton(t){const e=this.editor.commands.get("highlight");this._addButton("highlight:"+t.model,t.title,Fu(t.type),t.model,(function(i){i.bind("isEnabled").to(e,"isEnabled"),i.bind("isOn").to(e,"value",e=>e===t.model),i.iconView.fillColor=t.color,i.isToggleable=!0}))}_addButton(t,e,i,o,n=(()=>{})){const r=this.editor;r.ui.componentFactory.add(t,t=>{const s=new Kc(t),a=this.localizedOptionTitles[e]?this.localizedOptionTitles[e]:e;return s.set({label:a,icon:i,tooltip:!0}),s.on("execute",()=>{r.execute("highlight",{value:o}),r.editing.view.focus()}),n(s),s})}_addDropdown(t){const e=this.editor,i=e.t,o=e.ui.componentFactory,n=t[0],r=t.reduce((t,e)=>(t[e.model]=e,t),{});o.add("highlight",s=>{const a=e.commands.get("highlight"),l=od(s,ju),c=l.buttonView;c.set({tooltip:i("Highlight"),lastExecuted:n.model,commandValue:n.model,isToggleable:!0}),c.bind("icon").to(a,"value",t=>Fu(h(t,"type"))),c.bind("color").to(a,"value",t=>h(t,"color")),c.bind("commandValue").to(a,"value",t=>h(t,"model")),c.bind("isOn").to(a,"value",t=>!!t),c.delegate("execute").to(l);const d=t.map(t=>{const e=o.create("highlight:"+t.model);return this.listenTo(e,"execute",()=>l.buttonView.set({lastExecuted:t.model})),e});function h(t,e){const i=t&&t!==c.lastExecuted?t:c.lastExecuted;return r[i][e]}return l.bind("isEnabled").toMany(d,"isEnabled",(...t)=>t.some(t=>t)),d.push(new Dc),d.push(o.create("removeHighlight")),nd(l,d),function(t){t.buttonView.actionView.iconView.bind("fillColor").to(t.buttonView,"color")}(l),l.toolbarView.ariaLabel=i("Text highlight toolbar"),c.on("execute",()=>{e.execute("highlight",{value:c.commandValue}),e.editing.view.focus()}),l})}}function Fu(t){return"marker"===t?'':''}class Hu{constructor(){this._stack=[]}add(t,e){const i=this._stack,o=i[0];this._insertDescriptor(t);const n=i[0];o===n||Uu(o,n)||this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:e})}remove(t,e){const i=this._stack,o=i[0];this._removeDescriptor(t);const n=i[0];o===n||Uu(o,n)||this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:e})}_insertDescriptor(t){const e=this._stack,i=e.findIndex(e=>e.id===t.id);if(Uu(t,e[i]))return;i>-1&&e.splice(i,1);let o=0;for(;e[o]&&qu(e[o],t);)o++;e.splice(o,0,t)}_removeDescriptor(t){const e=this._stack,i=e.findIndex(e=>e.id===t);i>-1&&e.splice(i,1)}}function Uu(t,e){return t&&e&&t.priority==e.priority&&Wu(t.classes)==Wu(e.classes)}function qu(t,e){return t.priority>e.priority||!(t.priorityWu(e.classes)}function Wu(t){return Array.isArray(t)?t.sort().join(","):t}yi(Hu,mi);i(57);const $u=Ic("px"),Gu=rr.document.body;class Yu extends xc{constructor(t){super(t);const e=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",e.to("position",t=>"ck-balloon-panel_"+t),e.if("isVisible","ck-balloon-panel_visible"),e.if("withArrow","ck-balloon-panel_with-arrow"),e.to("class")],style:{top:e.to("top",$u),left:e.to("left",$u)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(t){this.show();const e=Yu.defaultPositions,i=Object.assign({},{element:this.element,positions:[e.southArrowNorth,e.southArrowNorthMiddleWest,e.southArrowNorthMiddleEast,e.southArrowNorthWest,e.southArrowNorthEast,e.northArrowSouth,e.northArrowSouthMiddleWest,e.northArrowSouthMiddleEast,e.northArrowSouthWest,e.northArrowSouthEast],limiter:Gu,fitInViewport:!0},t),o=Yu._getOptimalPosition(i),n=parseInt(o.left),r=parseInt(o.top),s=o.name;Object.assign(this,{top:r,left:n,position:s})}pin(t){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(t):this._stopPinning()},this._startPinning(t),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(t){this.attachTo(t);const e=Ku(t.target),i=t.limiter?Ku(t.limiter):Gu;this.listenTo(rr.document,"scroll",(o,n)=>{const r=n.target,s=e&&r.contains(e),a=i&&r.contains(i);!s&&!a&&e&&i||this.attachTo(t)},{useCapture:!0}),this.listenTo(rr.window,"resize",()=>{this.attachTo(t)})}_stopPinning(){this.stopListening(rr.document,"scroll"),this.stopListening(rr.window,"resize")}}function Ku(t){return ii(t)?t:es(t)?t.commonAncestorContainer:"function"==typeof t?Ku(t()):null}function Qu(t,e){return t.top-e.height-Yu.arrowVerticalOffset}function Ju(t){return t.bottom+Yu.arrowVerticalOffset}Yu.arrowHorizontalOffset=25,Yu.arrowVerticalOffset=10,Yu._getOptimalPosition=Hc,Yu.defaultPositions={northWestArrowSouthWest:(t,e)=>({top:Qu(t,e),left:t.left-Yu.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(t,e)=>({top:Qu(t,e),left:t.left-.25*e.width-Yu.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(t,e)=>({top:Qu(t,e),left:t.left-e.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(t,e)=>({top:Qu(t,e),left:t.left-.75*e.width+Yu.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(t,e)=>({top:Qu(t,e),left:t.left-e.width+Yu.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(t,e)=>({top:Qu(t,e),left:t.left+t.width/2-Yu.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(t,e)=>({top:Qu(t,e),left:t.left+t.width/2-.25*e.width-Yu.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(t,e)=>({top:Qu(t,e),left:t.left+t.width/2-e.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(t,e)=>({top:Qu(t,e),left:t.left+t.width/2-.75*e.width+Yu.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(t,e)=>({top:Qu(t,e),left:t.left+t.width/2-e.width+Yu.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(t,e)=>({top:Qu(t,e),left:t.right-Yu.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(t,e)=>({top:Qu(t,e),left:t.right-.25*e.width-Yu.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(t,e)=>({top:Qu(t,e),left:t.right-e.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(t,e)=>({top:Qu(t,e),left:t.right-.75*e.width+Yu.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(t,e)=>({top:Qu(t,e),left:t.right-e.width+Yu.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(t,e)=>({top:Ju(t),left:t.left-Yu.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(t,e)=>({top:Ju(t),left:t.left-.25*e.width-Yu.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(t,e)=>({top:Ju(t),left:t.left-e.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(t,e)=>({top:Ju(t),left:t.left-.75*e.width+Yu.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(t,e)=>({top:Ju(t),left:t.left-e.width+Yu.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(t,e)=>({top:Ju(t),left:t.left+t.width/2-Yu.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(t,e)=>({top:Ju(t),left:t.left+t.width/2-.25*e.width-Yu.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(t,e)=>({top:Ju(t),left:t.left+t.width/2-e.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(t,e)=>({top:Ju(t),left:t.left+t.width/2-.75*e.width+Yu.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(t,e)=>({top:Ju(t),left:t.left+t.width/2-e.width+Yu.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(t,e)=>({top:Ju(t),left:t.right-Yu.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(t,e)=>({top:Ju(t),left:t.right-.25*e.width-Yu.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(t,e)=>({top:Ju(t),left:t.right-e.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(t,e)=>({top:Ju(t),left:t.right-.75*e.width+Yu.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(t,e)=>({top:Ju(t),left:t.right-e.width+Yu.arrowHorizontalOffset,name:"arrow_ne"})};function Zu(t,e,i){return t&&tg(t)&&!i.isInline(e)}function Xu(t){return t.getAttribute("widget-type-around")}function tg(t){return!!t.is("element")&&!!t.getCustomProperty("widget")}function eg(t,e,i={}){if(!t.is("containerElement"))throw new hi.a("widget-to-widget-wrong-element-type",null,{element:t});return e.setAttribute("contenteditable","false",t),e.addClass("ck-widget",t),e.setCustomProperty("widget",!0,t),t.getFillerOffset=rg,i.label&&function(t,e,i){i.setCustomProperty("widgetLabel",e,t)}(t,i.label,e),i.hasSelectionHandle&&function(t,e){const i=e.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(t){const e=this.toDomElement(t),i=new Gc;return i.set("content",''),i.render(),e.appendChild(i.element),e}));e.insert(e.createPositionAt(t,0),i),e.addClass(["ck-widget_with-selection-handle"],t)}(t,e),function(t,e,i,o){const n=new Hu;n.on("change:top",(e,n)=>{n.oldDescriptor&&o(t,n.oldDescriptor,n.writer),n.newDescriptor&&i(t,n.newDescriptor,n.writer)}),e.setCustomProperty("addHighlight",(t,e,i)=>n.add(e,i),t),e.setCustomProperty("removeHighlight",(t,e,i)=>n.remove(e,i),t)}(t,e,(t,e,i)=>i.addClass(Ti(e.classes),t),(t,e,i)=>i.removeClass(Ti(e.classes),t)),t}function ig(t){const e=t.getCustomProperty("widgetLabel");return e?"function"==typeof e?e():e:""}function og(t,e){const i=t.getSelectedElement();if(i){const o=Xu(t);if(o)return e.createPositionAt(i,o);if(e.schema.isBlock(i))return e.createPositionAfter(i)}const o=t.getSelectedBlocks().next().value;if(o){if(o.isEmpty)return e.createPositionAt(o,0);const i=e.createPositionAfter(o);return t.focus.isTouching(i)?i:e.createPositionBefore(o)}return t.focus}function ng(t,e){const i=new ns(rr.window),o=i.getIntersection(t),n=e.height+Yu.arrowVerticalOffset;if(t.top-n>i.top||t.bottom+n{const i=e.createElement("horizontalLine");t.insertContent(i);let o=i.nextSibling;!(o&&t.schema.checkChild(o,"$text"))&&t.schema.checkChild(i.parent,"paragraph")&&(o=e.createElement("paragraph"),t.insertContent(o,e.createPositionAfter(i))),o&&e.setSelection(o,0)})}}i(59);class ag extends ud{static get pluginName(){return"HorizontalLineEditing"}init(){const t=this.editor,e=t.model.schema,i=t.t,o=t.conversion;e.register("horizontalLine",{isObject:!0,allowWhere:"$block"}),o.for("dataDowncast").elementToElement({model:"horizontalLine",view:(t,{writer:e})=>e.createEmptyElement("hr")}),o.for("editingDowncast").elementToElement({model:"horizontalLine",view:(t,{writer:e})=>{const o=i("Horizontal line"),n=e.createContainerElement("div"),r=e.createEmptyElement("hr");return e.addClass("ck-horizontal-line",n),e.setCustomProperty("hr",!0,n),e.insert(e.createPositionAt(n,0),r),function(t,e,i){return e.setCustomProperty("horizontalLine",!0,t),eg(t,e,{label:i})}(n,e,o)}}),o.for("upcast").elementToElement({view:"hr",model:"horizontalLine"}),t.commands.add("horizontalLine",new sg(t))}}class lg extends ud{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("horizontalLine",i=>{const o=t.commands.get("horizontalLine"),n=new Kc(i);return n.set({label:e("Horizontal line"),icon:'',tooltip:!0}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",()=>{t.execute("horizontalLine"),t.editing.view.focus()}),n})}}class cg extends br{observe(t){this.listenTo(t,"load",(t,e)=>{const i=e.target;this.checkShouldIgnoreEventFromTarget(i)||"IMG"==i.tagName&&this._fireEvents(e)},{useCapture:!0})}_fireEvents(t){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",t))}}function dg(t){const e=t.getSelectedElement();return e&&function(t){return!!t.getCustomProperty("image")&&tg(t)}(e)?e:null}function hg(t){return!!t&&t.is("element","image")}function ug(t,e={},i=null){t.change(o=>{const n=o.createElement("image",e),r=i||og(t.document.selection,t);t.insertContent(n,r),n.parent&&o.setSelection(n,"on")})}function gg(t){const e=t.schema,i=t.document.selection;return function(t,e,i){const o=function(t,e){const i=og(t,e).parent;if(i.isEmpty&&!i.is("element","$root"))return i.parent;return i}(t,i);return e.checkChild(o,"image")}(i,e,t)&&!function(t,e){const i=t.getSelectedElement();return i&&e.isObject(i)}(i,e)&&function(t){return[...t.focus.getAncestors()].every(t=>!t.is("element","image"))}(i)}function mg(t){const e=[];for(const i of t.getChildren())e.push(i),i.is("element")&&e.push(...i.getChildren());return e.find(t=>t.is("element","img"))}function fg(t){return i=>{i.on(`attribute:${t}:image`,e)};function e(t,e,i){if(!i.consumable.consume(e.item,t.name))return;const o=i.writer,n=mg(i.mapper.toViewElement(e.item));o.setAttribute(e.attributeKey,e.attributeNewValue||"",n)}}class pg extends md{refresh(){this.isEnabled=gg(this.editor.model)}execute(t){const e=this.editor.model;for(const i of Ti(t.source))ug(e,{src:i})}}class bg extends ud{static get pluginName(){return"ImageEditing"}init(){const t=this.editor,e=t.model.schema,i=t.t,o=t.conversion;t.editing.view.addObserver(cg),e.register("image",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),o.for("dataDowncast").elementToElement({model:"image",view:(t,{writer:e})=>wg(e)}),o.for("editingDowncast").elementToElement({model:"image",view:(t,{writer:e})=>function(t,e,i){return e.setCustomProperty("image",!0,t),eg(t,e,{label:function(){const e=mg(t).getAttribute("alt");return e?`${e} ${i}`:i}})}(wg(e),e,i("image widget"))}),o.for("downcast").add(fg("src")).add(fg("alt")).add(function(){return e=>{e.on("attribute:srcset:image",t)};function t(t,e,i){if(!i.consumable.consume(e.item,t.name))return;const o=i.writer,n=mg(i.mapper.toViewElement(e.item));if(null===e.attributeNewValue){const t=e.attributeOldValue;t.data&&(o.removeAttribute("srcset",n),o.removeAttribute("sizes",n),t.width&&o.removeAttribute("width",n))}else{const t=e.attributeNewValue;t.data&&(o.setAttribute("srcset",t.data,n),o.setAttribute("sizes","100vw",n),t.width&&o.setAttribute("width",t.width,n))}}}()),o.for("upcast").elementToElement({view:{name:"img",attributes:{src:!0}},model:(t,{writer:e})=>e.createElement("image",{src:t.getAttribute("src")})}).attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:t=>{const e={data:t.getAttribute("srcset")};return t.hasAttribute("width")&&(e.width=t.getAttribute("width")),e}}}).add(function(){return e=>{e.on("element:figure",t)};function t(t,e,i){if(!i.consumable.test(e.viewItem,{name:!0,classes:"image"}))return;const o=mg(e.viewItem);if(!o||!o.hasAttribute("src")||!i.consumable.test(o,{name:!0}))return;const n=pd(i.convertItem(o,e.modelCursor).modelRange.getItems());n&&(i.convertChildren(e.viewItem,n),i.updateConversionResult(n,e))}}()),t.commands.add("imageInsert",new pg(t))}}function wg(t){const e=t.createEmptyElement("img"),i=t.createContainerElement("figure",{class:"image"});return t.insert(t.createPositionAt(i,0),e),i}class kg extends Vr{constructor(t){super(t),this.domEventType="mousedown"}onDomEvent(t){this.fire(t.type,t)}}i(61);const _g=["before","after"],vg=(new DOMParser).parseFromString('',"image/svg+xml").firstChild;class yg extends ud{static get pluginName(){return"WidgetTypeAround"}constructor(t){super(t),this._currentFakeCaretModelElement=null}init(){const t=this.editor,e=t.editing.view;this.on("change:isEnabled",(i,o,n)=>{e.change(t=>{for(const i of e.document.roots)n?t.removeClass("ck-widget__type-around_disabled",i):t.addClass("ck-widget__type-around_disabled",i)}),n||t.model.change(t=>{t.removeSelectionAttribute("widget-type-around")})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(t,e){const i=this.editor,o=i.editing.view;i.execute("insertParagraph",{position:i.model.createPositionAt(t,e)}),o.focus(),o.scrollToTheSelection()}_listenToIfEnabled(t,e,i,o){this.listenTo(t,e,(...t)=>{this.isEnabled&&i(...t)},o)}_insertParagraphAccordingToFakeCaretPosition(){const t=this.editor.model.document.selection,e=Xu(t);if(!e)return!1;const i=t.getSelectedElement();return this._insertParagraph(i,e),!0}_enableTypeAroundUIInjection(){const t=this.editor,e=t.model.schema,i=t.locale.t,o={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};t.editing.downcastDispatcher.on("insert",(t,i,n)=>{const r=n.mapper.toViewElement(i.item);Zu(r,i.item,e)&&function(t,e,i){const o=t.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(t){const i=this.toDomElement(t);return function(t,e){for(const i of _g){const o=new nc({tag:"div",attributes:{class:["ck","ck-widget__type-around__button","ck-widget__type-around__button_"+i],title:e[i]},children:[t.ownerDocument.importNode(vg,!0)]});t.appendChild(o.render())}}(i,e),function(t){const e=new nc({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});t.appendChild(e.render())}(i),i}));t.insert(t.createPositionAt(i,"end"),o)}(n.writer,o,r)},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const t=this.editor,e=t.model,i=e.document.selection,o=e.schema,n=t.editing.view;function r(t){return"ck-widget_type-around_show-fake-caret_"+t}this._listenToIfEnabled(n.document,"keydown",(t,e)=>{_n(e.keyCode)&&this._handleArrowKeyPress(t,e)},{priority:di.get("high")+10}),this._listenToIfEnabled(i,"change:range",(e,i)=>{i.directChange&&t.model.change(t=>{t.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(e.document,"change:data",()=>{const e=i.getSelectedElement();if(e){if(Zu(t.editing.mapper.toViewElement(e),e,o))return}t.model.change(t=>{t.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(t.editing.downcastDispatcher,"selection",(t,e,i)=>{const n=i.writer;if(this._currentFakeCaretModelElement){const t=i.mapper.toViewElement(this._currentFakeCaretModelElement);t&&(n.removeClass(_g.map(r),t),this._currentFakeCaretModelElement=null)}const s=e.selection.getSelectedElement();if(!s)return;const a=i.mapper.toViewElement(s);if(!Zu(a,s,o))return;const l=Xu(e.selection);l&&(n.addClass(r(l),a),this._currentFakeCaretModelElement=s)}),this._listenToIfEnabled(t.ui.focusTracker,"change:isFocused",(e,i,o)=>{o||t.model.change(t=>{t.removeSelectionAttribute("widget-type-around")})})}_handleArrowKeyPress(t,e){const i=this.editor,o=i.model,n=o.document.selection,r=o.schema,s=i.editing.view,a=yn(e.keyCode,i.locale.contentLanguageDirection),l=s.document.selection.getSelectedElement();let c;Zu(l,i.editing.mapper.toModelElement(l),r)?c=this._handleArrowKeyPressOnSelectedWidget(a):n.isCollapsed&&(c=this._handleArrowKeyPressWhenSelectionNextToAWidget(a)),c&&(e.preventDefault(),t.stop())}_handleArrowKeyPressOnSelectedWidget(t){const e=this.editor.model,i=Xu(e.document.selection);return e.change(e=>{if(!i)return e.setSelectionAttribute("widget-type-around",t?"after":"before"),!0;if(!(i===(t?"after":"before")))return e.removeSelectionAttribute("widget-type-around"),!0;return!1})}_handleArrowKeyPressWhenSelectionNextToAWidget(t){const e=this.editor,i=e.model,o=i.schema,n=e.plugins.get("Widget"),r=n._getObjectElementNextToSelection(t);return!!Zu(e.editing.mapper.toViewElement(r),r,o)&&(i.change(e=>{n._setSelectionOverElement(r),e.setSelectionAttribute("widget-type-around",t?"before":"after")}),!0)}_enableInsertingParagraphsOnButtonClick(){const t=this.editor,e=t.editing.view;this._listenToIfEnabled(e.document,"mousedown",(i,o)=>{const n=o.domTarget.closest(".ck-widget__type-around__button");if(!n)return;const r=function(t){return t.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(n),s=function(t,e){const i=t.closest(".ck-widget");return e.mapDomToView(i)}(n,e.domConverter),a=t.editing.mapper.toModelElement(s);this._insertParagraph(a,r),o.preventDefault(),i.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const t=this.editor,e=t.editing.view;this._listenToIfEnabled(e.document,"enter",(i,o)=>{const n=e.document.selection.getSelectedElement(),r=t.editing.mapper.toModelElement(n),s=t.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:Zu(n,r,s)&&(this._insertParagraph(r,o.isSoft?"before":"after"),a=!0),a&&(o.preventDefault(),i.stop())})}_enableInsertingParagraphsOnTypingKeystroke(){const t=this.editor.editing.view,e=[pn.enter,pn.delete,pn.backspace];this._listenToIfEnabled(t.document,"keydown",(t,i)=>{e.includes(i.keyCode)||nh(i)||this._insertParagraphAccordingToFakeCaretPosition()},{priority:di.get("high")+1})}_enableDeleteIntegration(){const t=this.editor,e=t.editing.view,i=t.model,o=i.schema;this._listenToIfEnabled(e.document,"delete",(e,n)=>{const r=Xu(i.document.selection);if(!r)return;const s=n.direction,a=i.document.selection.getSelectedElement(),l="forward"==s;if("before"===r===l)t.execute("delete",{selection:i.createSelection(a,"on")});else{const e=o.getNearestSelectionRange(i.createPositionAt(a,r),s);if(e)if(e.isCollapsed){const n=i.createSelection(e.start);if(i.modifySelection(n,{direction:s}),n.focus.isEqual(e.start)){const t=function(t,e){let i=e;for(const o of e.getAncestors({parentFirst:!0})){if(o.childCount>1||t.isLimit(o))break;i=o}return i}(o,e.start.parent);i.deleteContent(i.createSelection(t,"on"),{doNotAutoparagraph:!0})}else i.change(i=>{i.setSelection(e),t.execute(l?"forwardDelete":"delete")})}else i.change(i=>{i.setSelection(e),t.execute(l?"forwardDelete":"delete")})}n.preventDefault(),e.stop()},{priority:di.get("high")+1})}_enableInsertContentIntegration(){const t=this.editor,e=this.editor.model,i=e.document.selection;this._listenToIfEnabled(t.model,"insertContent",(t,[o,n])=>{if(n&&!n.is("documentSelection"))return;const r=Xu(i);return r?(t.stop(),e.change(t=>{const n=i.getSelectedElement(),s=e.createPositionAt(n,r),a=t.createSelection(s),l=e.insertContent(o,a);return t.setSelection(a),l})):void 0},{priority:"high"})}}i(63);function xg(t){const e=t.model;return(i,o)=>{const n=o.keyCode==pn.arrowup,r=o.keyCode==pn.arrowdown,s=o.shiftKey,a=e.document.selection;if(!n&&!r)return;const l=r;if(s&&function(t,e){return!t.isCollapsed&&t.isBackward==e}(a,l))return;const c=function(t,e,i){const o=t.model;if(i){const t=e.isCollapsed?e.focus:e.getLastPosition(),i=Ag(o,t,"forward");if(!i)return null;const n=o.createRange(t,i),r=Tg(o.schema,n,"backward");return r&&t.isBefore(r)?o.createRange(t,r):null}{const t=e.isCollapsed?e.focus:e.getFirstPosition(),i=Ag(o,t,"backward");if(!i)return null;const n=o.createRange(i,t),r=Tg(o.schema,n,"forward");return r&&t.isAfter(r)?o.createRange(r,t):null}}(t,a,l);c&&!c.isCollapsed&&function(t,e,i){const o=t.model,n=t.view.domConverter;if(i){const t=o.createSelection(e.start);o.modifySelection(t),t.focus.isAtEnd||e.start.isEqual(t.focus)||(e=o.createRange(t.focus,e.end))}const r=t.mapper.toViewRange(e),s=n.viewRangeToDom(r),a=ns.getDomRangeRects(s);let l;for(const t of a)if(void 0!==l){if(Math.round(t.top)>=l)return!1;l=Math.max(l,Math.round(t.bottom))}else l=Math.round(t.bottom);return!0}(t,c,l)&&(e.change(t=>{const i=l?c.end:c.start;if(s){const o=e.createSelection(a.anchor);o.setFocus(i),t.setSelection(o)}else t.setSelection(i)}),i.stop(),o.preventDefault(),o.stopPropagation())}}function Ag(t,e,i){const o=t.schema,n=t.createRangeIn(e.root),r="forward"==i?"elementStart":"elementEnd";for(const{previousPosition:t,item:s,type:a}of n.getWalker({startPosition:e,direction:i})){if(o.isLimit(s)&&!o.isInline(s))return t;if(a==r&&o.isBlock(s))return null}return null}function Tg(t,e,i){const o="backward"==i?e.end:e.start;if(t.checkChild(o,"$text"))return o;for(const{nextPosition:o}of e.getWalker({direction:i}))if(t.checkChild(o,"$text"))return o}class Cg extends ud{static get pluginName(){return"Widget"}static get requires(){return[yg]}init(){const t=this.editor.editing.view,e=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(t,e,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const o=i.writer,n=o.document.selection,r=n.getSelectedElement();let s=null;for(const t of n.getRanges())for(const e of t){const t=e.item;tg(t)&&!Sg(t,s)&&(o.addClass("ck-widget_selected",t),this._previouslySelected.add(t),s=t,t==r&&o.setSelection(n.getRanges(),{fake:!0,label:ig(r)}))}},{priority:"low"}),t.addObserver(kg),this.listenTo(e,"mousedown",(...t)=>this._onMousedown(...t)),this.listenTo(e,"keydown",(...t)=>{this._handleSelectionChangeOnArrowKeyPress(...t)},{priority:"high"}),this.listenTo(e,"keydown",(...t)=>{this._preventDefaultOnArrowKeyPress(...t)},{priority:di.get("high")-20}),this.listenTo(e,"keydown",xg(this.editor.editing)),this.listenTo(e,"delete",(t,e)=>{this._handleDelete("forward"==e.direction)&&(e.preventDefault(),t.stop())},{priority:"high"})}_onMousedown(t,e){const i=this.editor,o=i.editing.view,n=o.document;let r=e.target;if(function(t){for(;t;){if(t.is("editableElement")&&!t.is("rootElement"))return!0;if(tg(t))return!1;t=t.parent}return!1}(r)){if((gn.isSafari||gn.isGecko)&&e.domEvent.detail>=3){const t=i.editing.mapper,o=r.is("attributeElement")?r.findAncestor(t=>!t.is("attributeElement")):r,n=t.toModelElement(o);e.preventDefault(),this.editor.model.change(t=>{t.setSelection(n,"in")})}return}if(!tg(r)&&(r=r.findAncestor(tg),!r))return;e.preventDefault(),n.isFocused||o.focus();const s=i.editing.mapper.toModelElement(r);this._setSelectionOverElement(s)}_handleSelectionChangeOnArrowKeyPress(t,e){const i=e.keyCode;if(!_n(i))return;const o=this.editor.model,n=o.schema,r=o.document.selection,s=r.getSelectedElement(),a=yn(i,this.editor.locale.contentLanguageDirection);if(s&&n.isObject(s)){const i=a?r.getLastPosition():r.getFirstPosition(),s=n.getNearestSelectionRange(i,a?"forward":"backward");return void(s&&(o.change(t=>{t.setSelection(s)}),e.preventDefault(),t.stop()))}if(!r.isCollapsed)return;const l=this._getObjectElementNextToSelection(a);l&&n.isObject(l)&&(this._setSelectionOverElement(l),e.preventDefault(),t.stop())}_preventDefaultOnArrowKeyPress(t,e){if(!_n(e.keyCode))return;const i=this.editor.model,o=i.schema,n=i.document.selection.getSelectedElement();n&&o.isObject(n)&&(e.preventDefault(),t.stop())}_handleDelete(t){if(this.editor.isReadOnly)return;const e=this.editor.model.document.selection;if(!e.isCollapsed)return;const i=this._getObjectElementNextToSelection(t);return i?(this.editor.model.change(t=>{let o=e.anchor.parent;for(;o.isEmpty;){const e=o;o=e.parent,t.remove(e)}this._setSelectionOverElement(i)}),!0):void 0}_setSelectionOverElement(t){this.editor.model.change(e=>{e.setSelection(e.createRangeOn(t))})}_getObjectElementNextToSelection(t){const e=this.editor.model,i=e.schema,o=e.document.selection,n=e.createSelection(o);e.modifySelection(n,{direction:t?"forward":"backward"});const r=t?n.focus.nodeBefore:n.focus.nodeAfter;return r&&i.isObject(r)?r:null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected)t.removeClass("ck-widget_selected",e);this._previouslySelected.clear()}}function Sg(t,e){return!!e&&Array.from(t.getAncestors()).includes(e)}class Pg extends md{refresh(){const t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=hg(t),hg(t)&&t.hasAttribute("alt")?this.value=t.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor.model,i=e.document.selection.getSelectedElement();e.change(e=>{e.setAttribute("alt",t.newValue,i)})}}class Eg extends ud{static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new Pg(this.editor))}}i(65);class Mg extends xc{constructor(t,e){super(t);const i="ck-labeled-field-view-"+ci(),o="ck-labeled-field-view-status-"+ci();this.fieldView=e(this,i,o),this.set("label"),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class"),this.set("placeholder"),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(o),this.bind("_statusText").to(this,"errorText",this,"infoText",(t,e)=>t||e);const n=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",n.to("class"),n.if("isEnabled","ck-disabled",t=>!t),n.if("isEmpty","ck-labeled-field-view_empty"),n.if("isFocused","ck-labeled-field-view_focused"),n.if("placeholder","ck-labeled-field-view_placeholder"),n.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:[this.fieldView,this.labelView]},this.statusView]})}_createLabelView(t){const e=new Pc(this.locale);return e.for=t,e.bind("text").to(this,"label"),e}_createStatusView(t){const e=new xc(this.locale),i=this.bindTemplate;return e.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",t=>!t)],id:t,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),e}focus(){this.fieldView.focus()}}i(67);class Lg extends xc{constructor(t){super(t),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById"),this.focusTracker=new Yl,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text",e.if("isFocused","ck-input_focused"),e.if("isEmpty","ck-input-text_empty"),e.if("hasError","ck-error")],id:e.to("id"),placeholder:e.to("placeholder"),readonly:e.to("isReadOnly"),"aria-invalid":e.if("hasError",!0),"aria-describedby":e.to("ariaDescribedById")},on:{input:e.to("input"),change:e.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(t,e,i)=>{this._setDomElementValue(i),this._updateIsEmpty()})}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(t){this.element.value=t||0===t?t:""}}function Ig(t,e,i){const o=new Lg(t.locale);return o.set({id:e,ariaDescribedById:i}),o.bind("isReadOnly").to(t,"isEnabled",t=>!t),o.bind("hasError").to(t,"errorText",t=>!!t),o.on("input",()=>{t.errorText=null}),t.bind("isEmpty","isFocused","placeholder").to(o),o}function Ng(t){t.set("_isCssTransitionsDisabled",!1),t.disableCssTransitions=()=>{t._isCssTransitionsDisabled=!0},t.enableCssTransitions=()=>{t._isCssTransitionsDisabled=!1},t.extendTemplate({attributes:{class:[t.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function zg({view:t}){t.listenTo(t.element,"submit",(e,i)=>{i.preventDefault(),t.fire("submit")},{useCapture:!0})}var Og='',Rg='';i(69),i(7);class Dg extends xc{constructor(t){super(t);const e=this.locale.t;this.focusTracker=new Yl,this.keystrokes=new jl,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(e("Save"),Og,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("Cancel"),Rg,"ck-button-cancel","cancel"),this._focusables=new oc,this._focusCycler=new Oc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),Ng(this)}render(){super.render(),this.keystrokes.listenTo(this.element),zg({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)})}_createButton(t,e,i,o){const n=new Kc(this.locale);return n.set({label:t,icon:e,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),o&&n.delegate("execute").to(this,o),n}_createLabeledInputView(){const t=this.locale.t,e=new Mg(this.locale,Ig);return e.label=t("Text alternative"),e}}i(72),i(74);const Vg=Ic("px");class jg extends ud{static get pluginName(){return"ContextualBalloon"}constructor(t){super(t),this.positionLimiter=()=>{const t=this.editor.editing.view,e=t.document.selection.editableElement;return e?t.domConverter.mapViewToDom(e.root):null},this.set("visibleView",null),this.view=new Yu(t.locale),t.ui.view.body.add(this.view),t.ui.focusTracker.add(this.view.element),this._viewToStack=new Map,this._idToStack=new Map,this.set("_numberOfStacks",0),this.set("_singleViewMode",!1),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}hasView(t){return Array.from(this._viewToStack.keys()).includes(t)}add(t){if(this.hasView(t.view))throw new hi.a("contextualballoon-add-view-exist",[this,t]);const e=t.stackId||"main";if(!this._idToStack.has(e))return this._idToStack.set(e,new Map([[t.view,t]])),this._viewToStack.set(t.view,this._idToStack.get(e)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!t.singleViewMode||this.showStack(e));const i=this._idToStack.get(e);t.singleViewMode&&this.showStack(e),i.set(t.view,t),this._viewToStack.set(t.view,i),i===this._visibleStack&&this._showView(t)}remove(t){if(!this.hasView(t))throw new hi.a("contextualballoon-remove-view-not-exist",[this,t]);const e=this._viewToStack.get(t);this._singleViewMode&&this.visibleView===t&&(this._singleViewMode=!1),this.visibleView===t&&(1===e.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(e.values())[e.size-2])),1===e.size?(this._idToStack.delete(this._getStackId(e)),this._numberOfStacks=this._idToStack.size):e.delete(t),this._viewToStack.delete(t)}updatePosition(t){t&&(this._visibleStack.get(this.visibleView).position=t),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(t){this.visibleStack=t;const e=this._idToStack.get(t);if(!e)throw new hi.a("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==e&&this._showView(Array.from(e.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(t){return Array.from(this._idToStack.entries()).find(e=>e[1]===t)[0]}_showNextStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)+1;t[e]||(e=0),this.showStack(this._getStackId(t[e]))}_showPrevStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)-1;t[e]||(e=t.length-1),this.showStack(this._getStackId(t[e]))}_createRotatorView(){const t=new Bg(this.editor.locale),e=this.editor.locale.t;return this.view.content.add(t),t.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(t,e)=>!e&&t>1),t.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),t.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(t,i)=>{if(i<2)return"";const o=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return e("%0 of %1",[o,i])}),t.buttonNextView.on("execute",()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),t.buttonPrevView.on("execute",()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),t}_createFakePanelsView(){const t=new Fg(this.editor.locale,this.view);return t.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,e)=>!e&&t>=2?Math.min(t-1,2):0),t.listenTo(this.view,"change:top",()=>t.updatePosition()),t.listenTo(this.view,"change:left",()=>t.updatePosition()),this.editor.ui.view.body.add(t),t}_showView({view:t,balloonClassName:e="",withArrow:i=!0,singleViewMode:o=!1}){this.view.class=e,this.view.withArrow=i,this._rotatorView.showView(t),this.visibleView=t,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),o&&(this._singleViewMode=!0)}_getBalloonPosition(){let t=Array.from(this._visibleStack.values()).pop().position;return t&&!t.limiter&&(t=Object.assign({},t,{limiter:this.positionLimiter})),t}}class Bg extends xc{constructor(t){super(t);const e=t.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new Yl,this.buttonPrevView=this._createButtonView(e("Previous"),''),this.buttonNextView=this._createButtonView(e("Next"),''),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",t=>t?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}showView(t){this.hideView(),this.content.add(t)}hideView(){this.content.clear()}_createButtonView(t,e){const i=new Kc(this.locale);return i.set({label:t,icon:e,tooltip:!0}),i}}class Fg extends xc{constructor(t,e){super(t);const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=e,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",t=>t?"":"ck-hidden")],style:{top:i.to("top",Vg),left:i.to("left",Vg),width:i.to("width",Vg),height:i.to("height",Vg)}},children:this.content}),this.on("change:numberOfPanels",(t,e,i,o)=>{i>o?this._addPanels(i-o):this._removePanels(o-i),this.updatePosition()})}_addPanels(t){for(;t--;){const t=new xc;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(t){for(;t--;){const t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:t,left:e}=this._balloonPanelView,{width:i,height:o}=new ns(this._balloonPanelView.element);Object.assign(this,{top:t,left:e,width:i,height:o})}}}function Hg(t){const e=t.editing.view,i=Yu.defaultPositions;return{target:e.domConverter.viewToDom(e.document.selection.getSelectedElement()),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast]}}class Ug extends ud{static get requires(){return[jg]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageTextAlternative",i=>{const o=t.commands.get("imageTextAlternative"),n=new Kc(i);return n.set({label:e("Change image text alternative"),icon:'',tooltip:!0}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",()=>{this._showForm()}),n})}_createForm(){const t=this.editor,e=t.editing.view.document;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new Dg(t.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{t.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(t,e)=>{this._hideForm(!0),e()}),this.listenTo(t.ui,"update",()=>{dg(e.selection)?this._isVisible&&function(t){const e=t.plugins.get("ContextualBalloon");if(dg(t.editing.view.document.selection)){const i=Hg(t);e.updatePosition(i)}}(t):this._hideForm(!0)}),id({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const t=this.editor,e=t.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:Hg(t)}),i.fieldView.value=i.fieldView.element.value=e.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(t){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),t&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class qg extends ud{static get requires(){return[Eg,Ug]}static get pluginName(){return"ImageTextAlternative"}}i(76);function Wg(t){for(const e of t.getChildren())if(e&&e.is("element","caption"))return e;return null}function $g(t){const e=t.parent;return"figcaption"==t.name&&e&&"figure"==e.name&&e.hasClass("image")?{name:!0}:null}class Gg extends ud{static get pluginName(){return"ImageCaptionEditing"}init(){const t=this.editor,e=t.editing.view,i=t.model.schema,o=t.data,n=t.editing,r=t.t;i.register("caption",{allowIn:"image",allowContentOf:"$block",isLimit:!0}),t.model.document.registerPostFixer(t=>this._insertMissingModelCaptionElement(t)),t.conversion.for("upcast").elementToElement({view:$g,model:"caption"});o.downcastDispatcher.on("insert:caption",Yg(t=>t.createContainerElement("figcaption"),!1));const s=function(t,e){return i=>{const o=i.createEditableElement("figcaption");return i.setCustomProperty("imageCaption",!0,o),Jl({view:t,element:o,text:e}),function(t,e){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],t),e.setAttribute("contenteditable",t.isReadOnly?"false":"true",t),t.on("change:isReadOnly",(i,o,n)=>{e.setAttribute("contenteditable",n?"false":"true",t)}),t.on("change:isFocused",(i,o,n)=>{n?e.addClass("ck-editor__nested-editable_focused",t):e.removeClass("ck-editor__nested-editable_focused",t)}),t}(o,i)}}(e,r("Enter image caption"));n.downcastDispatcher.on("insert:caption",Yg(s)),n.downcastDispatcher.on("insert",this._fixCaptionVisibility(t=>t.item),{priority:"high"}),n.downcastDispatcher.on("remove",this._fixCaptionVisibility(t=>t.position.parent),{priority:"high"}),e.document.registerPostFixer(t=>this._updateCaptionVisibility(t))}_updateCaptionVisibility(t){const e=this.editor.editing.mapper,i=this._lastSelectedCaption;let o;const n=this.editor.model.document.selection,r=n.getSelectedElement();if(r&&r.is("element","image")){const t=Wg(r);o=e.toViewElement(t)}const s=Kg(n.getFirstPosition().parent);if(s&&(o=e.toViewElement(s)),o)return i?(i===o||(Qg(i,t),this._lastSelectedCaption=o),Jg(o,t)):(this._lastSelectedCaption=o,Jg(o,t));if(i){const e=Qg(i,t);return this._lastSelectedCaption=null,e}return!1}_fixCaptionVisibility(t){return(e,i,o)=>{const n=Kg(t(i)),r=this.editor.editing.mapper,s=o.writer;if(n){const t=r.toViewElement(n);t&&(n.childCount?s.removeClass("ck-hidden",t):s.addClass("ck-hidden",t))}}}_insertMissingModelCaptionElement(t){const e=this.editor.model,i=e.document.differ.getChanges(),o=[];for(const t of i)if("insert"==t.type&&"$text"!=t.name){const i=t.position.nodeAfter;if(i.is("element","image")&&!Wg(i)&&o.push(i),!i.is("element","image")&&i.childCount)for(const t of e.createRangeIn(i).getItems())t.is("element","image")&&!Wg(t)&&o.push(t)}for(const e of o)t.appendElement("caption",e);return!!o.length}}function Yg(t,e=!0){return(i,o,n)=>{const r=o.item;if((r.childCount||e)&&hg(r.parent)){if(!n.consumable.consume(o.item,"insert"))return;const e=n.mapper.toViewElement(o.range.start.parent),i=t(n.writer),s=n.writer;r.childCount||s.addClass("ck-hidden",i),function(t,e,i,o){const n=o.writer.createPositionAt(i,"end");o.writer.insert(n,t),o.mapper.bindElements(e,t)}(i,o.item,e,n)}}}function Kg(t){const e=t.getAncestors({includeSelf:!0}).find(t=>"caption"==t.name);return e&&e.parent&&"image"==e.parent.name?e:null}function Qg(t,e){return!t.childCount&&!t.hasClass("ck-hidden")&&(e.addClass("ck-hidden",t),!0)}function Jg(t,e){return!!t.hasClass("ck-hidden")&&(e.removeClass("ck-hidden",t),!0)}i(78);class Zg extends md{refresh(){const t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=hg(t),t&&t.hasAttribute("width")?this.value={width:t.getAttribute("width"),height:null}:this.value=null}execute(t){const e=this.editor.model,i=e.document.selection.getSelectedElement();this.value={width:t.width,height:null},i&&e.change(e=>{e.setAttribute("width",t.width,i)})}}class Xg extends ud{static get pluginName(){return"ImageResizeEditing"}constructor(t){super(t),t.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 t=this.editor,e=new Zg(t);this._registerSchema(),this._registerConverters(),t.commands.add("imageResize",e)}_registerSchema(){this.editor.model.schema.extend("image",{allowAttributes:"width"}),this.editor.model.schema.setAttributeProperties("width",{isFormatting:!0})}_registerConverters(){const t=this.editor;t.conversion.for("downcast").add(t=>t.on("attribute:width:image",(t,e,i)=>{if(!i.consumable.consume(e.item,t.name))return;const o=i.writer,n=i.mapper.toViewElement(e.item);null!==e.attributeNewValue?(o.setStyle("width",e.attributeNewValue,n),o.addClass("image_resized",n)):(o.removeStyle("width",n),o.removeClass("image_resized",n))})),t.conversion.for("upcast").attributeToAttribute({view:{name:"figure",styles:{width:/.+/}},model:{key:"width",value:t=>t.getStyle("width")}})}}var tm='';const em={small:'',medium:tm,large:'',original:''};class im extends ud{static get requires(){return[Xg]}static get pluginName(){return"ImageResizeButtons"}constructor(t){super(t),this._resizeUnit=t.config.get("image.resizeUnit")}init(){const t=this.editor,e=t.config.get("image.resizeOptions"),i=t.commands.get("imageResize");this.bind("isEnabled").to(i);for(const t of e)this._registerImageResizeButton(t);this._registerImageResizeDropdown(e)}_registerImageResizeButton(t){const e=this.editor,{name:i,value:o,icon:n}=t,r=o?o+this._resizeUnit:null;e.ui.componentFactory.add(i,i=>{const o=new Kc(i),s=e.commands.get("imageResize"),a=this._getOptionLabelValue(t,!0);if(!em[n])throw new hi.a("imageresizebuttons-missing-icon",e,t);return o.set({label:a,icon:em[n],tooltip:a,isToggleable:!0}),o.bind("isEnabled").to(this),o.bind("isOn").to(s,"value",om(r)),this.listenTo(o,"execute",()=>{e.execute("imageResize",{width:r})}),o})}_registerImageResizeDropdown(t){const e=this.editor,i=e.t,o=t.find(t=>!t.value);e.ui.componentFactory.add("imageResize",n=>{const r=e.commands.get("imageResize"),s=od(n,Jc),a=s.buttonView;return a.set({tooltip:i("Resize image"),commandValue:o.value,icon:tm,isToggleable:!0,label:this._getOptionLabelValue(o),withText:!0,class:"ck-resize-image-button"}),a.bind("label").to(r,"value",t=>t&&t.width?t.width:this._getOptionLabelValue(o)),s.bind("isOn").to(r),s.bind("isEnabled").to(this),rd(s,this._getResizeDropdownListItemDefinitions(t,r)),s.listView.ariaLabel=i("Image resize list"),this.listenTo(s,"execute",t=>{e.execute(t.source.commandName,{width:t.source.commandValue}),e.editing.view.focus()}),s})}_getOptionLabelValue(t,e){const i=this.editor.t;return t.label?t.label:e?t.value?i("Resize image to %0",t.value+this._resizeUnit):i("Resize image to the original size"):t.value?t.value+this._resizeUnit:i("Original")}_getResizeDropdownListItemDefinitions(t,e){const i=new xi;return t.map(t=>{const o=t.value?t.value+this._resizeUnit:null,n={type:"button",model:new vu({commandName:"imageResize",commandValue:o,label:this._getOptionLabelValue(t),withText:!0,icon:null})};n.model.bind("isOn").to(e,"value",om(o)),i.add(n)}),i}}function om(t){return e=>null===t&&e===t||e&&e.width===t}class nm{constructor(t){this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=t,this._referenceCoordinates=null}begin(t,e,i){const o=new ns(e);this.activeHandlePosition=function(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const i of e)if(t.classList.contains("ck-widget__resizer__handle-"+i))return i}(t),this._referenceCoordinates=function(t,e){const i=new ns(t),o=e.split("-"),n={x:"right"==o[1]?i.right:i.left,y:"bottom"==o[0]?i.bottom:i.top};return n.x+=t.ownerDocument.defaultView.scrollX,n.y+=t.ownerDocument.defaultView.scrollY,n}(e,function(t){const e=t.split("-"),i={top:"bottom",bottom:"top",left:"right",right:"left"};return`${i[e[0]]}-${i[e[1]]}`}(this.activeHandlePosition)),this.originalWidth=o.width,this.originalHeight=o.height,this.aspectRatio=o.width/o.height;const n=i.style.width;n&&n.match(/^\d+\.?\d*%$/)?this.originalWidthPercents=parseFloat(n):this.originalWidthPercents=function(t,e){const i=t.parentElement,o=parseFloat(i.ownerDocument.defaultView.getComputedStyle(i).width);return e.width/o*100}(i,o)}update(t){this.proposedWidth=t.width,this.proposedHeight=t.height,this.proposedWidthPercents=t.widthPercents,this.proposedHandleHostWidth=t.handleHostWidth,this.proposedHandleHostHeight=t.handleHostHeight}}yi(nm,Uo);class rm{constructor(t){this._options=t,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",t=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),t.stop())},{priority:"high"}),this.on("change:isEnabled",()=>{this.isEnabled&&this.redraw()})}attach(){const t=this,e=this._options.viewElement;this._options.editor.editing.view.change(i=>{const o=i.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(e){const i=this.toDomElement(e);return t._appendHandles(i),t._appendSizeUI(i),t._domResizerWrapper=i,t.on("change:isEnabled",(t,e,o)=>{i.style.display=o?"":"none"}),i.style.display=t.isEnabled?"":"none",i}));i.insert(i.createPositionAt(e,"end"),o),i.addClass("ck-widget_with-resizer",e),this._viewResizerWrapper=o})}begin(t){this.state=new nm(this._options),this._sizeUI.bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(t,this._getHandleHost(),this._getResizeHost())}updateSize(t){const e=this._proposeNewSize(t);this._options.editor.editing.view.change(t=>{const i=this._options.unit||"%",o=("%"===i?e.widthPercents:e.width)+i;t.setStyle("width",o,this._options.viewElement)});const i=this._getHandleHost(),o=new ns(i);e.handleHostWidth=Math.round(o.width),e.handleHostHeight=Math.round(o.height);const n=new ns(i);e.width=Math.round(n.width),e.height=Math.round(n.height),this.redraw(o),this.state.update(e)}commit(){const t=this._options.unit||"%",e=("%"===t?this.state.proposedWidthPercents:this.state.proposedWidth)+t;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(e)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(t){const e=this._domResizerWrapper;if(!((i=e)&&i.ownerDocument&&i.ownerDocument.contains(i)))return;var i;const o=e.parentElement,n=this._getHandleHost(),r=this._viewResizerWrapper,s=[r.getStyle("width"),r.getStyle("height"),r.getStyle("left"),r.getStyle("top")];let a;if(o.isSameNode(n)){const e=t||new ns(n);a=[e.width+"px",e.height+"px",void 0,void 0]}else a=[n.offsetWidth+"px",n.offsetHeight+"px",n.offsetLeft+"px",n.offsetTop+"px"];"same"!==Li(s,a)&&this._options.editor.editing.view.change(t=>{t.setStyle({width:a[0],height:a[1],left:a[2],top:a[3]},r)})}containsHandle(t){return this._domResizerWrapper.contains(t)}static isResizeHandle(t){return t.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeUI.dismiss(),this._sizeUI.isVisible=!1;this._options.editor.editing.view.change(t=>{t.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(t){const e=this.state,i={x:(o=t).pageX,y:o.pageY};var o;const n=!this._options.isCentered||this._options.isCentered(this),r={x:e._referenceCoordinates.x-(i.x+e.originalWidth),y:i.y-e.originalHeight-e._referenceCoordinates.y};n&&e.activeHandlePosition.endsWith("-right")&&(r.x=i.x-(e._referenceCoordinates.x+e.originalWidth)),n&&(r.x*=2);const s={width:Math.abs(e.originalWidth+r.x),height:Math.abs(e.originalHeight+r.y)};s.dominant=s.width/e.aspectRatio>s.height?"width":"height",s.max=s[s.dominant];const a={width:s.width,height:s.height};return"width"==s.dominant?a.height=a.width/e.aspectRatio:a.width=a.height*e.aspectRatio,{width:Math.round(a.width),height:Math.round(a.height),widthPercents:Math.min(Math.round(e.originalWidthPercents/e.originalWidth*a.width*100)/100,100)}}_getResizeHost(){const t=this._domResizerWrapper.parentElement;return this._options.getResizeHost(t)}_getHandleHost(){const t=this._domResizerWrapper.parentElement;return this._options.getHandleHost(t)}_appendHandles(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const o of e)t.appendChild(new nc({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(i=o,"ck-widget__resizer__handle-"+i)}}).render());var i}_appendSizeUI(t){const e=new sm;e.render(),this._sizeUI=e,t.appendChild(e.element)}}yi(rm,Uo);class sm extends xc{constructor(){super();const t=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",t.to("activeHandlePosition",t=>t?"ck-orientation-"+t:"")],style:{display:t.if("isVisible","none",t=>!t)}},children:[{text:t.to("label")}]})}bindToState(t,e){this.bind("isVisible").to(e,"proposedWidth",e,"proposedHeight",(t,e)=>null!==t&&null!==e),this.bind("label").to(e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",e,"proposedWidthPercents",(e,i,o)=>"px"===t.unit?`${e}×${i}`:o+"%"),this.bind("activeHandlePosition").to(e)}dismiss(){this.unbind(),this.isVisible=!1}}var am=function(t,e,i){var o=!0,n=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return D(i)&&(o="leading"in i?!!i.leading:o,n="trailing"in i?!!i.trailing:n),Kr(t,e,{leading:o,maxWait:e,trailing:n})};i(80);class lm extends ud{static get pluginName(){return"WidgetResize"}init(){this.set("visibleResizer",null),this.set("_activeResizer",null),this._resizers=new Map;const t=rr.window.document;this.editor.model.schema.setAttributeProperties("width",{isFormatting:!0}),this.editor.editing.view.addObserver(kg),this._observer=Object.create(mr),this.listenTo(this.editor.editing.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this));const e=()=>{this.visibleResizer&&this.visibleResizer.redraw()},i=am(e,200);this.on("change:visibleResizer",e),this.editor.ui.on("update",i),this._observer.listenTo(rr.window,"resize",i);const o=this.editor.editing.view.document.selection;o.on("change",()=>{const t=o.getSelectedElement();this.visibleResizer=this.getResizerByViewElement(t)||null})}destroy(){this._observer.stopListening();for(const t of this._resizers.values())t.destroy()}attachTo(t){const e=new rm(t),i=this.editor.plugins;if(e.attach(),i.has("WidgetToolbarRepository")){const t=i.get("WidgetToolbarRepository");e.on("begin",()=>{t.forceDisabled("resize")},{priority:"lowest"}),e.on("cancel",()=>{t.clearForceDisabled("resize")},{priority:"highest"}),e.on("commit",()=>{t.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(t.viewElement,e);const o=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(o)==e&&(this.visibleResizer=e),e}getResizerByViewElement(t){return this._resizers.get(t)}_getResizerByHandle(t){for(const e of this._resizers.values())if(e.containsHandle(t))return e}_mouseDownListener(t,e){const i=e.domTarget;rm.isResizeHandle(i)&&(this._activeResizer=this._getResizerByHandle(i),this._activeResizer&&(this._activeResizer.begin(i),t.stop(),e.preventDefault()))}_mouseMoveListener(t,e){this._activeResizer&&this._activeResizer.updateSize(e)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}yi(lm,Uo);class cm extends ud{static get requires(){return[lm]}static get pluginName(){return"ImageResizeHandles"}init(){const t=this.editor.commands.get("imageResize");this.bind("isEnabled").to(t),this._setupResizerCreator()}_setupResizerCreator(){const t=this.editor,e=t.editing.view;e.addObserver(cg),this.listenTo(e.document,"imageLoaded",(i,o)=>{if(!o.target.matches("figure.image.ck-widget > img"))return;const n=t.editing.view.domConverter.domToView(o.target).findAncestor("figure");let r=this.editor.plugins.get(lm).getResizerByViewElement(n);if(r)return void r.redraw();const s=t.editing.mapper.toModelElement(n);r=t.plugins.get(lm).attachTo({unit:t.config.get("image.resizeUnit"),modelElement:s,viewElement:n,editor:t,getHandleHost:t=>t.querySelector("img"),getResizeHost:t=>t,isCentered(){const t=s.getAttribute("imageStyle");return!t||"full"==t||"alignCenter"==t},onCommit(e){t.execute("imageResize",{width:e})}}),r.on("updateSize",()=>{n.hasClass("image_resized")||e.change(t=>{t.addClass("image_resized",n)})}),r.bind("isEnabled").to(this)})}}i(82);class dm extends md{constructor(t,e){super(t),this.defaultStyle=!1,this.styles=e.reduce((t,e)=>(t[e.name]=e,e.isDefault&&(this.defaultStyle=e.name),t),{})}refresh(){const t=this.editor.model.document.selection.getSelectedElement();if(this.isEnabled=hg(t),t)if(t.hasAttribute("imageStyle")){const e=t.getAttribute("imageStyle");this.value=!!this.styles[e]&&e}else this.value=this.defaultStyle;else this.value=!1}execute(t){const e=t.value,i=this.editor.model,o=i.document.selection.getSelectedElement();i.change(t=>{this.styles[e].isDefault?t.removeAttribute("imageStyle",o):t.setAttribute("imageStyle",e,o)})}}function hm(t,e){for(const i of e)if(i.name===t)return i}var um='',gm='',mm='',fm='';const pm={full:{name:"full",title:"Full size image",icon:um,isDefault:!0},side:{name:"side",title:"Side image",icon:fm,className:"image-style-side"},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:gm,className:"image-style-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:mm,className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:fm,className:"image-style-align-right"}},bm={full:um,left:gm,right:fm,center:mm};function wm(t=[]){return t.map(km)}function km(t){if("string"==typeof t){const e=t;pm[e]?t=Object.assign({},pm[e]):(Object(hi.c)("image-style-not-found",{name:e}),t={name:e})}else if(pm[t.name]){const e=pm[t.name],i=Object.assign({},t);for(const o in e)Object.prototype.hasOwnProperty.call(t,o)||(i[o]=e[o]);t=i}return"string"==typeof t.icon&&bm[t.icon]&&(t.icon=bm[t.icon]),t}class _m extends ud{static get pluginName(){return"ImageStyleEditing"}init(){const t=this.editor,e=t.model.schema,i=t.data,o=t.editing;t.config.define("image.styles",["full","side"]);const n=wm(t.config.get("image.styles"));e.extend("image",{allowAttributes:"imageStyle"});const r=function(t){return(e,i,o)=>{if(!o.consumable.consume(i.item,e.name))return;const n=hm(i.attributeNewValue,t),r=hm(i.attributeOldValue,t),s=o.mapper.toViewElement(i.item),a=o.writer;r&&a.removeClass(r.className,s),n&&a.addClass(n.className,s)}}(n);o.downcastDispatcher.on("attribute:imageStyle:image",r),i.downcastDispatcher.on("attribute:imageStyle:image",r),i.upcastDispatcher.on("element:figure",function(t){const e=t.filter(t=>!t.isDefault);return(t,i,o)=>{if(!i.modelRange)return;const n=i.viewItem,r=pd(i.modelRange.getItems());if(o.schema.checkAttribute(r,"imageStyle"))for(const t of e)o.consumable.consume(n,{classes:t.className})&&o.writer.setAttribute("imageStyle",t.name,r)}}(n),{priority:"low"}),t.commands.add("imageStyle",new dm(t,n))}}i(84);class vm extends ud{static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Full size image":t("Full size image"),"Side image":t("Side image"),"Left aligned image":t("Left aligned image"),"Centered image":t("Centered image"),"Right aligned image":t("Right aligned image")}}init(){const t=function(t,e){for(const i of t)e[i.title]&&(i.title=e[i.title]);return t}(wm(this.editor.config.get("image.styles")),this.localizedDefaultStylesTitles);for(const e of t)this._createButton(e)}_createButton(t){const e=this.editor,i="imageStyle:"+t.name;e.ui.componentFactory.add(i,i=>{const o=e.commands.get("imageStyle"),n=new Kc(i);return n.set({label:t.title,icon:t.icon,tooltip:!0,isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",e=>e===t.name),this.listenTo(n,"execute",()=>{e.execute("imageStyle",{value:t.name}),e.editing.view.focus()}),n})}}class ym extends ud{static get requires(){return[jg]}static get pluginName(){return"WidgetToolbarRepository"}init(){const t=this.editor;if(t.plugins.has("BalloonToolbar")){const e=t.plugins.get("BalloonToolbar");this.listenTo(e,"show",e=>{(function(t){const e=t.getSelectedElement();return!(!e||!tg(e))})(t.editing.view.document.selection)&&e.stop()},{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const t of this._toolbarDefinitions.values())t.view.destroy()}register(t,{ariaLabel:e,items:i,getRelatedElement:o,balloonClassName:n="ck-toolbar-container"}){if(!i.length)return void Object(hi.c)("widget-toolbar-no-items",{toolbarId:t});const r=this.editor,s=r.t,a=new sd(r.locale);if(a.ariaLabel=e||s("Widget toolbar"),this._toolbarDefinitions.has(t))throw new hi.a("widget-toolbar-duplicated",this,{toolbarId:t});a.fillFromConfig(i,r.ui.componentFactory),this._toolbarDefinitions.set(t,{view:a,getRelatedElement:o,balloonClassName:n})}_updateToolbarsVisibility(){let t=0,e=null,i=null;for(const o of this._toolbarDefinitions.values()){const n=o.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&n)if(this.editor.ui.focusTracker.isFocused){const r=n.getAncestors().length;r>t&&(t=r,e=n,i=o)}else this._isToolbarVisible(o)&&this._hideToolbar(o);else this._isToolbarInBalloon(o)&&this._hideToolbar(o)}i&&this._showToolbar(i,e)}_hideToolbar(t){this._balloon.remove(t.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(t,e){this._isToolbarVisible(t)?xm(this.editor,e):this._isToolbarInBalloon(t)||(this._balloon.add({view:t.view,position:Am(this.editor,e),balloonClassName:t.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const t of this._toolbarDefinitions.values())if(this._isToolbarVisible(t)){const e=t.getRelatedElement(this.editor.editing.view.document.selection);xm(this.editor,e)}}))}_isToolbarVisible(t){return this._balloon.visibleView===t.view}_isToolbarInBalloon(t){return this._balloon.hasView(t.view)}}function xm(t,e){const i=t.plugins.get("ContextualBalloon"),o=Am(t,e);i.updatePosition(o)}function Am(t,e){const i=t.editing.view,o=Yu.defaultPositions;return{target:i.domConverter.mapViewToDom(e),positions:[o.northArrowSouth,o.northArrowSouthWest,o.northArrowSouthEast,o.southArrowNorth,o.southArrowNorthWest,o.southArrowNorthEast,ng]}}class Tm extends xc{constructor(t){super(t),this.buttonView=new Kc(t),this._fileInputView=new Cm(t),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class Cm extends xc{constructor(t){super(t),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:e.to("acceptedType"),multiple:e.to("allowMultipleFiles")},on:{change:e.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}function Sm(t){const e=t.map(t=>t.replace("+","\\+"));return new RegExp(`^image\\/(${e.join("|")})$`)}class Pm extends ud{static get pluginName(){return"ImageUploadUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageUpload",i=>{const o=new Tm(i),n=t.commands.get("imageUpload"),r=t.config.get("image.upload.types"),s=Sm(r);return o.set({acceptedType:r.map(t=>"image/"+t).join(","),allowMultipleFiles:!0}),o.buttonView.set({label:e("Insert image"),icon:'',tooltip:!0}),o.buttonView.bind("isEnabled").to(n),o.on("done",(e,i)=>{const o=Array.from(i).filter(t=>s.test(t.type));o.length&&t.execute("imageUpload",{file:o})}),o})}}class Em{constructor(t){this.context=t}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}yi(Em,Uo);class Mm extends Em{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new xi({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(t){if("string"!=typeof t)throw new hi.a("pendingactions-add-invalid-message",this);const e=Object.create(Uo);return e.set("message",t),this._actions.add(e),this.hasAny=!0,e}remove(t){this._actions.remove(t),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}class Lm{constructor(){const t=new window.FileReader;this._reader=t,this._data=void 0,this.set("loaded",0),t.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(t){const e=this._reader;return this.total=t.size,new Promise((i,o)=>{e.onload=()=>{const t=e.result;this._data=t,i(t)},e.onerror=()=>{o("error")},e.onabort=()=>{o("aborted")},this._reader.readAsDataURL(t)})}abort(){this._reader.abort()}}yi(Lm,Uo);class Im extends ud{static get pluginName(){return"FileRepository"}static get requires(){return[Mm]}init(){this.loaders=new xi,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",(t,e)=>e?t/e*100:0)}getLoader(t){return this._loadersMap.get(t)||null}createLoader(t){if(!this.createUploadAdapter)return Object(hi.c)("filerepository-no-upload-adapter"),null;const e=new Nm(Promise.resolve(t),this.createUploadAdapter);return this.loaders.add(e),this._loadersMap.set(t,e),t instanceof Promise&&e.file.then(t=>{this._loadersMap.set(t,e)}).catch(()=>{}),e.on("change:uploaded",()=>{let t=0;for(const e of this.loaders)t+=e.uploaded;this.uploaded=t}),e.on("change:uploadTotal",()=>{let t=0;for(const e of this.loaders)e.uploadTotal&&(t+=e.uploadTotal);this.uploadTotal=t}),e}destroyLoader(t){const e=t instanceof Nm?t:this.getLoader(t);e._destroy(),this.loaders.remove(e),this._loadersMap.forEach((t,i)=>{t===e&&this._loadersMap.delete(i)})}_updatePendingAction(){const t=this.editor.plugins.get(Mm);if(this.loaders.length){if(!this._pendingAction){const e=this.editor.t,i=t=>`${e("Upload in progress")} ${parseInt(t)}%.`;this._pendingAction=t.add(i(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",i)}}else t.remove(this._pendingAction),this._pendingAction=null}}yi(Im,Uo);class Nm{constructor(t,e){this.id=ci(),this._filePromiseWrapper=this._createFilePromiseWrapper(t),this._adapter=e(this),this._reader=new Lm,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(t=>this._filePromiseWrapper?t:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new hi.a("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(t=>this._reader.read(t)).then(t=>{if("reading"!==this.status)throw this.status;return this.status="idle",t}).catch(t=>{if("aborted"===t)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:t})}upload(){if("idle"!=this.status)throw new hi.a("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(t=>(this.uploadResponse=t,this.status="idle",t)).catch(t=>{if("aborted"===this.status)throw"aborted";throw this.status="error",t})}abort(){const t=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==t?this._reader.abort():"uploading"==t&&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(t){const e={};return e.promise=new Promise((i,o)=>{e.rejecter=o,e.isFulfilled=!1,t.then(t=>{e.isFulfilled=!0,i(t)}).catch(t=>{e.isFulfilled=!0,o(t)})}),e}}yi(Nm,Uo);i(86),i(88),i(90);class zm extends ud{constructor(t){super(t),this.placeholder="data:image/svg+xml;utf8,"+encodeURIComponent('')}init(){this.editor.editing.downcastDispatcher.on("attribute:uploadStatus:image",(...t)=>this.uploadStatusChange(...t))}uploadStatusChange(t,e,i){const o=this.editor,n=e.item,r=n.getAttribute("uploadId");if(!i.consumable.consume(e.item,t.name))return;const s=o.plugins.get(Im),a=r?e.attributeNewValue:null,l=this.placeholder,c=o.editing.mapper.toViewElement(n),d=i.writer;if("reading"==a)return Om(c,d),void Rm(l,c,d);if("uploading"==a){const t=s.loaders.get(r);return Om(c,d),void(t?(Dm(c,d),function(t,e,i,o){const n=function(t){const e=t.createUIElement("div",{class:"ck-progress-bar"});return t.setCustomProperty("progressBar",!0,e),e}(e);e.insert(e.createPositionAt(t,"end"),n),i.on("change:uploadedPercent",(t,e,i)=>{o.change(t=>{t.setStyle("width",i+"%",n)})})}(c,d,t,o.editing.view),function(t,e,i){if(i.data){const o=mg(t);e.setAttribute("src",i.data,o)}}(c,d,t)):Rm(l,c,d))}"complete"==a&&s.loaders.get(r)&&function(t,e,i){const o=e.createUIElement("div",{class:"ck-image-upload-complete-icon"});e.insert(e.createPositionAt(t,"end"),o),setTimeout(()=>{i.change(t=>t.remove(t.createRangeOn(o)))},3e3)}(c,d,o.editing.view),function(t,e){jm(t,e,"progressBar")}(c,d),Dm(c,d),function(t,e){e.removeClass("ck-appear",t)}(c,d)}}function Om(t,e){t.hasClass("ck-appear")||e.addClass("ck-appear",t)}function Rm(t,e,i){e.hasClass("ck-image-upload-placeholder")||i.addClass("ck-image-upload-placeholder",e);const o=mg(e);o.getAttribute("src")!==t&&i.setAttribute("src",t,o),Vm(e,"placeholder")||i.insert(i.createPositionAfter(o),function(t){const e=t.createUIElement("div",{class:"ck-upload-placeholder-loader"});return t.setCustomProperty("placeholder",!0,e),e}(i))}function Dm(t,e){t.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",t),jm(t,e,"placeholder")}function Vm(t,e){for(const i of t.getChildren())if(i.getCustomProperty(e))return i}function jm(t,e,i){const o=Vm(t,i);o&&e.remove(e.createRangeOn(o))}class Bm extends Em{static get pluginName(){return"Notification"}init(){this.on("show:warning",(t,e)=>{window.alert(e.message)},{priority:"lowest"})}showSuccess(t,e={}){this._showNotification({message:t,type:"success",namespace:e.namespace,title:e.title})}showInfo(t,e={}){this._showNotification({message:t,type:"info",namespace:e.namespace,title:e.title})}showWarning(t,e={}){this._showNotification({message:t,type:"warning",namespace:e.namespace,title:e.title})}_showNotification(t){const e="show:"+t.type+(t.namespace?":"+t.namespace:"");this.fire(e,{message:t.message,type:t.type,title:t.title||""})}}class Fm{constructor(t){this.document=t}createDocumentFragment(t){return new En(this.document,t)}createElement(t,e,i){return new zo(this.document,t,e,i)}createText(t){return new zi(this.document,t)}clone(t,e=!1){return t._clone(e)}appendChild(t,e){return e._appendChild(t)}insertChild(t,e,i){return i._insertChild(t,e)}removeChildren(t,e,i){return i._removeChildren(t,e)}remove(t){const e=t.parent;return e?this.removeChildren(e.getChildIndex(t),1,e):[]}replace(t,e){const i=t.parent;if(i){const o=i.getChildIndex(t);return this.removeChildren(o,1,i),this.insertChild(o,e,i),!0}return!1}unwrapElement(t){const e=t.parent;if(e){const i=e.getChildIndex(t);this.remove(t),this.insertChild(i,t.getChildren(),e)}}rename(t,e){const i=new zo(this.document,t,e.getAttributes(),e.getChildren());return this.replace(e,i)?i:null}setAttribute(t,e,i){i._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,i){y(t)&&void 0===i&&(i=e),i._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,i){i._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}createPositionAt(t,e){return Xo._createAt(t,e)}createPositionAfter(t){return Xo._createAfter(t)}createPositionBefore(t){return Xo._createBefore(t)}createRange(t,e){return new tn(t,e)}createRangeOn(t){return tn._createOn(t)}createRangeIn(t){return tn._createIn(t)}createSelection(t,e,i){return new nn(t,e,i)}}class Hm extends md{refresh(){const t=this.editor.model.document.selection.getSelectedElement(),e=t&&"image"===t.name||!1;this.isEnabled=gg(this.editor.model)||e}execute(t){const e=this.editor,i=e.model,o=e.plugins.get(Im);for(const e of Ti(t.file))Um(i,o,e)}}function Um(t,e,i){const o=e.createLoader(i);o&&ug(t,{uploadId:o.id})}class qm extends ud{static get requires(){return[Im,Bm,jd]}static get pluginName(){return"ImageUploadEditing"}constructor(t){super(t),t.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}})}init(){const t=this.editor,e=t.model.document,i=t.model.schema,o=t.conversion,n=t.plugins.get(Im),r=Sm(t.config.get("image.upload.types"));i.extend("image",{allowAttributes:["uploadId","uploadStatus"]}),t.commands.add("imageUpload",new Hm(t)),o.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(t.editing.view.document,"clipboardInput",(e,i)=>{if(o=i.dataTransfer,Array.from(o.types).includes("text/html")&&""!==o.getData("text/html"))return;var o;const n=Array.from(i.dataTransfer.files).filter(t=>!!t&&r.test(t.type)),s=i.targetRanges.map(e=>t.editing.mapper.toModelRange(e));t.model.change(i=>{i.setSelection(s),n.length&&(e.stop(),t.model.enqueueChange("default",()=>{t.execute("imageUpload",{file:n})}))})}),this.listenTo(t.plugins.get(jd),"inputTransformation",(e,i)=>{const o=Array.from(t.editing.view.createRangeIn(i.content)).filter(t=>{return!(!(e=t.item).is("element","img")||!e.getAttribute("src"))&&(e.getAttribute("src").match(/^data:image\/\w+;base64,/g)||e.getAttribute("src").match(/^blob:/g))&&!t.item.getAttribute("uploadProcessed");var e}).map(t=>{return{promise:(e=t.item,new Promise((t,i)=>{const o=e.getAttribute("src");fetch(o).then(t=>t.blob()).then(e=>{const i=function(t,e){return t.type?t.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}(e,o),n=i.replace("image/",""),r=new File([e],"image."+n,{type:i});t(r)}).catch(i)})),imageElement:t.item};var e});if(!o.length)return;const r=new Fm(t.editing.view.document);for(const t of o){r.setAttribute("uploadProcessed",!0,t.imageElement);const e=n.createLoader(t.promise);e&&(r.setAttribute("src","",t.imageElement),r.setAttribute("uploadId",e.id,t.imageElement))}}),t.editing.view.document.on("dragover",(t,e)=>{e.preventDefault()}),e.on("change",()=>{const i=e.differ.getChanges({includeChangesInGraveyard:!0});for(const e of i)if("insert"==e.type&&"$text"!=e.name){const i=e.position.nodeAfter,o="$graveyard"==e.position.root.rootName;for(const e of Wm(t,i)){const t=e.getAttribute("uploadId");if(!t)continue;const i=n.loaders.get(t);i&&(o?i.abort():"idle"==i.status&&this._readAndUpload(i,e))}}})}_readAndUpload(t,e){const i=this.editor,o=i.model,n=i.locale.t,r=i.plugins.get(Im),s=i.plugins.get(Bm);return o.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","reading",e)}),t.read().then(()=>{const n=t.upload();if(gn.isSafari){const t=mg(i.editing.mapper.toViewElement(e));i.editing.view.once("render",()=>{if(!t.parent)return;const e=i.editing.view.domConverter.mapViewToDom(t.parent);if(!e)return;const o=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=o})}return o.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","uploading",e)}),n}).then(t=>{o.enqueueChange("transparent",i=>{i.setAttributes({uploadStatus:"complete",src:t.default},e),this._parseAndSetSrcsetAttributeOnImage(t,e,i)}),a()}).catch(i=>{if("error"!==t.status&&"aborted"!==t.status)throw i;"error"==t.status&&i&&s.showWarning(i,{title:n("Upload failed"),namespace:"upload"}),a(),o.enqueueChange("transparent",t=>{t.remove(e)})});function a(){o.enqueueChange("transparent",t=>{t.removeAttribute("uploadId",e),t.removeAttribute("uploadStatus",e)}),r.destroyLoader(t)}}_parseAndSetSrcsetAttributeOnImage(t,e,i){let o=0;const n=Object.keys(t).filter(t=>{const e=parseInt(t,10);if(!isNaN(e))return o=Math.max(o,e),!0}).map(e=>`${t[e]} ${e}w`).join(", ");""!=n&&i.setAttribute("srcset",{data:n,width:o},e)}}function Wm(t,e){return Array.from(t.model.createRangeOn(e)).filter(t=>t.item.is("element","image")).map(t=>t.item)}class $m extends ud{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"italic"}),t.model.schema.setAttributeProperties("italic",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"italic",view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add("italic",new Id(t,"italic")),t.keystrokes.set("CTRL+I","italic")}}class Gm extends ud{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("italic",i=>{const o=t.commands.get("italic"),n=new Kc(i);return n.set({label:e("Italic"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),n.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(n,"execute",()=>{t.execute("italic"),t.editing.view.focus()}),n})}}class Ym extends ud{static get pluginName(){return"TwoStepCaretMovement"}constructor(t){super(t),this.attributes=new Set,this._overrideUid=null}init(){const t=this.editor,e=t.model,i=t.editing.view,o=t.locale,n=e.document.selection;this.listenTo(i.document,"keydown",(t,e)=>{if(!n.isCollapsed)return;if(e.shiftKey||e.altKey||e.ctrlKey)return;const i=e.keyCode==pn.arrowright,r=e.keyCode==pn.arrowleft;if(!i&&!r)return;const s=o.contentLanguageDirection;let a=!1;a="ltr"===s&&i||"rtl"===s&&r?this._handleForwardMovement(e):this._handleBackwardMovement(e),!0===a&&t.stop()},{priority:di.get("high")+1}),this._isNextGravityRestorationSkipped=!1,this.listenTo(n,"change:range",(t,e)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!e.directChange&&Zm(n.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(t){this.attributes.add(t)}_handleForwardMovement(t){const e=this.attributes,i=this.editor.model.document.selection,o=i.getFirstPosition();return!this._isGravityOverridden&&((!o.isAtStart||!Km(i,e))&&(Zm(o,e)?(Jm(t),this._overrideGravity(),!0):void 0))}_handleBackwardMovement(t){const e=this.attributes,i=this.editor.model,o=i.document.selection,n=o.getFirstPosition();return this._isGravityOverridden?(Jm(t),this._restoreGravity(),Qm(i,e,n),!0):n.isAtStart?!!Km(o,e)&&(Jm(t),Qm(i,e,n),!0):function(t,e){return Zm(t.getShiftedBy(-1),e)}(n,e)?n.isAtEnd&&!Km(o,e)&&Zm(n,e)?(Jm(t),Qm(i,e,n),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):void 0}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(t=>t.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(t=>{t.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function Km(t,e){for(const i of e)if(t.hasAttribute(i))return!0;return!1}function Qm(t,e,i){const o=i.nodeBefore;t.change(t=>{o?t.setSelectionAttribute(o.getAttributes()):t.removeSelectionAttribute(e)})}function Jm(t){t.preventDefault()}function Zm(t,e){const{nodeBefore:i,nodeAfter:o}=t;for(const t of e){const e=i?i.getAttribute(t):void 0;if((o?o.getAttribute(t):void 0)!==e)return!0}return!1}function Xm(t,e,i,o){return o.createRange(tf(t,e,i,!0,o),tf(t,e,i,!1,o))}function tf(t,e,i,o,n){let r=t.textNode||(o?t.nodeBefore:t.nodeAfter),s=null;for(;r&&r.getAttribute(e)==i;)s=r,r=o?r.previousSibling:r.nextSibling;return s?n.createPositionAt(s,o?"before":"after"):t}class ef{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){Array.isArray(t)?t.forEach(t=>this._definitions.add(t)):this._definitions.add(t)}getDispatcher(){return t=>{t.on("attribute:linkHref",(t,e,i)=>{if(!i.consumable.test(e.item,"attribute:linkHref"))return;const o=i.writer,n=o.document.selection;for(const t of this._definitions){const r=o.createAttributeElement("a",t.attributes,{priority:5});o.setCustomProperty("link",!0,r),t.callback(e.attributeNewValue)?e.item.is("selection")?o.wrap(n.getFirstRange(),r):o.wrap(i.mapper.toViewRange(e.range),r):o.unwrap(i.mapper.toViewRange(e.range),r)}},{priority:"high"})}}getDispatcherForLinkedImage(){return t=>{t.on("attribute:linkHref:image",(t,e,i)=>{const o=i.mapper.toViewElement(e.item),n=Array.from(o.getChildren()).find(t=>"a"===t.name);for(const t of this._definitions){const o=Ri(t.attributes);if(t.callback(e.attributeNewValue))for(const[t,e]of o)"class"===t?i.writer.addClass(e,n):i.writer.setAttribute(t,e,n);else for(const[t,e]of o)"class"===t?i.writer.removeClass(e,n):i.writer.removeAttribute(t,n)}})}}}var of=function(t,e,i){var o=t.length;return i=void 0===i?o:i,!e&&i>=o?t:oo(t,e,i)},nf=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var rf=function(t){return nf.test(t)};var sf=function(t){return t.split("")},af="[\\ud800-\\udfff]",lf="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",cf="\\ud83c[\\udffb-\\udfff]",df="[^\\ud800-\\udfff]",hf="(?:\\ud83c[\\udde6-\\uddff]){2}",uf="[\\ud800-\\udbff][\\udc00-\\udfff]",gf="(?:"+lf+"|"+cf+")"+"?",mf="[\\ufe0e\\ufe0f]?"+gf+("(?:\\u200d(?:"+[df,hf,uf].join("|")+")[\\ufe0e\\ufe0f]?"+gf+")*"),ff="(?:"+[df+lf+"?",lf,hf,uf,af].join("|")+")",pf=RegExp(cf+"(?="+cf+")|"+ff+mf,"g");var bf=function(t){return t.match(pf)||[]};var wf=function(t){return rf(t)?bf(t):sf(t)};var kf=function(t){return function(e){e=Zi(e);var i=rf(e)?wf(e):void 0,o=i?i[0]:e.charAt(0),n=i?of(i,1).join(""):e.slice(1);return o[t]()+n}}("toUpperCase");const _f=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,vf=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,yf=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,xf=/^((\w+:(\/{2,})?)|(\W))/i;function Af(t,{writer:e}){const i=e.createAttributeElement("a",{href:t},{priority:5});return e.setCustomProperty("link",!0,i),i}function Tf(t){return function(t){return t.replace(_f,"").match(vf)}(t=String(t))?t:"#"}function Cf(t,e){return!!t&&(t.is("element","image")&&e.checkAttribute("image","linkHref"))}function Sf(t,e){const i=(o=t,yf.test(o)?"mailto:":e);var o;const n=!!i&&!xf.test(t);return t&&n?i+t:t}class Pf extends md{constructor(t){super(t),this.manualDecorators=new xi,this.automaticDecorators=new ef}restoreManualDecoratorStates(){for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}refresh(){const t=this.editor.model,e=t.document,i=pd(e.selection.getSelectedBlocks());Cf(i,t.schema)?(this.value=i.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttribute(i,"linkHref")):(this.value=e.selection.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"linkHref"));for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}execute(t,e={}){const i=this.editor.model,o=i.document.selection,n=[],r=[];for(const t in e)e[t]?n.push(t):r.push(t);i.change(e=>{if(o.isCollapsed){const s=o.getFirstPosition();if(o.hasAttribute("linkHref")){const a=Xm(s,"linkHref",o.getAttribute("linkHref"),i);e.setAttribute("linkHref",t,a),n.forEach(t=>{e.setAttribute(t,!0,a)}),r.forEach(t=>{e.removeAttribute(t,a)}),e.setSelection(e.createPositionAfter(a.end.nodeBefore))}else if(""!==t){const r=Ri(o.getAttributes());r.set("linkHref",t),n.forEach(t=>{r.set(t,!0)});const{end:a}=i.insertContent(e.createText(t,r),s);e.setSelection(a)}["linkHref",...n,...r].forEach(t=>{e.removeSelectionAttribute(t)})}else{const s=i.schema.getValidRanges(o.getRanges(),"linkHref"),a=[];for(const t of o.getSelectedBlocks())i.schema.checkAttribute(t,"linkHref")&&a.push(e.createRangeOn(t));const l=a.slice();for(const t of s)this._isRangeToUpdate(t,a)&&l.push(t);for(const i of l)e.setAttribute("linkHref",t,i),n.forEach(t=>{e.setAttribute(t,!0,i)}),r.forEach(t=>{e.removeAttribute(t,i)})}})}_getDecoratorStateFromModel(t){const e=this.editor.model,i=e.document,o=pd(i.selection.getSelectedBlocks());return Cf(o,e.schema)?o.getAttribute(t):i.selection.getAttribute(t)}_isRangeToUpdate(t,e){for(const i of e)if(i.containsRange(t))return!1;return!0}}class Ef extends md{refresh(){const t=this.editor.model,e=t.document,i=pd(e.selection.getSelectedBlocks());Cf(i,t.schema)?this.isEnabled=t.schema.checkAttribute(i,"linkHref"):this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"linkHref")}execute(){const t=this.editor,e=this.editor.model,i=e.document.selection,o=t.commands.get("link");e.change(t=>{const n=i.isCollapsed?[Xm(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),e)]:e.schema.getValidRanges(i.getRanges(),"linkHref");for(const e of n)if(t.removeAttribute("linkHref",e),o)for(const i of o.manualDecorators)t.removeAttribute(i.id,e)})}}class Mf{constructor({id:t,label:e,attributes:i,defaultValue:o}){this.id=t,this.set("value"),this.defaultValue=o,this.label=e,this.attributes=i}}yi(Mf,Uo);i(92);const Lf=/^(https?:)?\/\//;class If extends ud{static get pluginName(){return"LinkEditing"}static get requires(){return[Ym,dh,jd]}constructor(t){super(t),t.config.define("link",{addTargetToExternalLinks:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Af}),t.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(t,e)=>Af(Tf(t),e)}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:t=>t.getAttribute("href")}}),t.commands.add("link",new Pf(t)),t.commands.add("unlink",new Ef(t));const e=function(t,e){const i={"Open in a new tab":t("Open in a new tab"),Downloadable:t("Downloadable")};return e.forEach(t=>(t.label&&i[t.label]&&(t.label=i[t.label]),t)),e}(t.t,function(t){const e=[];if(t)for(const[i,o]of Object.entries(t)){const t=Object.assign({},o,{id:"link"+kf(i)});e.push(t)}return e}(t.config.get("link.decorators")));this._enableAutomaticDecorators(e.filter(t=>"automatic"===t.mode)),this._enableManualDecorators(e.filter(t=>"manual"===t.mode));t.plugins.get(Ym).registerAttribute("linkHref"),function(t,e,i,o){const n=t.editing.view,r=new Set;n.document.registerPostFixer(n=>{const s=t.model.document.selection;let a=!1;if(s.hasAttribute(e)){const l=Xm(s.getFirstPosition(),e,s.getAttribute(e),t.model),c=t.editing.mapper.toViewRange(l);for(const t of c.getItems())t.is("element",i)&&!t.hasClass(o)&&(n.addClass(o,t),r.add(t),a=!0)}return a}),t.conversion.for("editingDowncast").add(t=>{function e(){n.change(t=>{for(const e of r.values())t.removeClass(o,e),r.delete(e)})}t.on("insert",e,{priority:"highest"}),t.on("remove",e,{priority:"highest"}),t.on("attribute",e,{priority:"highest"}),t.on("selection",e,{priority:"highest"})})}(t,"linkHref","a","ck-link_selected"),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(t){const e=this.editor,i=e.commands.get("link").automaticDecorators;e.config.get("link.addTargetToExternalLinks")&&i.add({id:"linkIsExternal",mode:"automatic",callback:t=>Lf.test(t),attributes:{target:"_blank",rel:"noopener noreferrer"}}),i.add(t),i.length&&e.conversion.for("downcast").add(i.getDispatcher())}_enableManualDecorators(t){if(!t.length)return;const e=this.editor,i=e.commands.get("link").manualDecorators;t.forEach(t=>{e.model.schema.extend("$text",{allowAttributes:t.id}),i.add(new Mf(t)),e.conversion.for("downcast").attributeToElement({model:t.id,view:(e,{writer:o})=>{if(e){const e=i.get(t.id).attributes,n=o.createAttributeElement("a",e,{priority:5});return o.setCustomProperty("link",!0,n),n}}}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:i.get(t.id).attributes},model:{key:t.id}})})}_enableInsertContentSelectionAttributesFixer(){const t=this.editor,e=t.model,i=e.document.selection,o=t.commands.get("link");this.listenTo(e,"insertContent",()=>{const t=i.anchor.nodeBefore,n=i.anchor.nodeAfter;i.hasAttribute("linkHref")&&t&&t.hasAttribute("linkHref")&&(n&&n.hasAttribute("linkHref")||e.change(t=>{Nf(t,o.manualDecorators)}))},{priority:"low"})}_enableClickingAfterLink(){const t=this.editor,e=t.commands.get("link");t.editing.view.addObserver(kg);let i=!1;this.listenTo(t.editing.view.document,"mousedown",()=>{i=!0}),this.listenTo(t.editing.view.document,"selectionChange",()=>{if(!i)return;i=!1;const o=t.model.document.selection;if(!o.isCollapsed)return;if(!o.hasAttribute("linkHref"))return;const n=o.getFirstPosition(),r=Xm(n,"linkHref",o.getAttribute("linkHref"),t.model);(n.isTouching(r.start)||n.isTouching(r.end))&&t.model.change(t=>{Nf(t,e.manualDecorators)})})}_enableTypingOverLink(){const t=this.editor,e=t.editing.view;let i,o;this.listenTo(e.document,"delete",()=>{o=!0},{priority:"high"}),this.listenTo(t.model,"deleteContent",()=>{const e=t.model.document.selection;e.isCollapsed||(o?o=!1:zf(t)&&function(t){const e=t.document.selection,i=e.getFirstPosition(),o=e.getLastPosition(),n=i.nodeAfter;if(!n)return!1;if(!n.is("$text"))return!1;if(!n.hasAttribute("linkHref"))return!1;const r=o.textNode||o.nodeBefore;if(n===r)return!0;return Xm(i,"linkHref",n.getAttribute("linkHref"),t).containsRange(t.createRange(i,o),!0)}(t.model)&&(i=e.getAttributes()))},{priority:"high"}),this.listenTo(t.model,"insertContent",(e,[n])=>{o=!1,zf(t)&&i&&(t.model.change(t=>{for(const[e,o]of i)t.setAttribute(e,o,n)}),i=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const t=this.editor,e=t.model,i=e.document.selection,o=t.editing.view,n=t.commands.get("link");let r=!1,s=!1;this.listenTo(o.document,"delete",(t,e)=>{s=e.domEvent.keyCode===pn.backspace},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{r=!1;const t=i.getFirstPosition(),o=i.getAttribute("linkHref");if(!o)return;const n=Xm(t,"linkHref",o,e);r=n.containsPosition(t)||n.end.isEqual(t)},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{s&&(s=!1,r||t.model.enqueueChange(t=>{Nf(t,n.manualDecorators)}))},{priority:"low"})}}function Nf(t,e){t.removeSelectionAttribute("linkHref");for(const i of e)t.removeSelectionAttribute(i.id)}function zf(t){return t.plugins.get("Input").isInput(t.model.change(t=>t.batch))}class Of extends Vr{constructor(t){super(t),this.domEventType="click"}onDomEvent(t){this.fire(t.type,t)}}i(94);class Rf extends xc{constructor(t,e){super(t);const i=t.t;this.focusTracker=new Yl,this.keystrokes=new jl,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(i("Save"),Og,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(i("Cancel"),Rg,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e),this.children=this._createFormChildren(e.manualDecorators),this._focusables=new oc,this._focusCycler=new Oc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const o=["ck","ck-link-form","ck-responsive-form"];e.manualDecorators.length&&o.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:o,tabindex:"-1"},children:this.children}),Ng(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((t,e)=>(t[e.name]=e.isOn,t),{})}render(){super.render(),zg({view:this});[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t,e=new Mg(this.locale,Ig);return e.label=t("Link URL"),e}_createButton(t,e,i,o){const n=new Kc(this.locale);return n.set({label:t,icon:e,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),o&&n.delegate("execute").to(this,o),n}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const i of t.manualDecorators){const o=new ed(this.locale);o.set({name:i.id,label:i.label,withText:!0}),o.bind("isOn").toMany([i,t],"value",(t,e)=>void 0===e&&void 0===t?i.defaultValue:t),o.on("execute",()=>{i.set("value",!o.isOn)}),e.add(o)}return e}_createFormChildren(t){const e=this.createCollection();if(e.add(this.urlInputView),t.length){const t=new xc;t.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(t=>({tag:"li",children:[t],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),e.add(t)}return e.add(this.saveButtonView),e.add(this.cancelButtonView),e}}i(96);class Df extends xc{constructor(t){super(t);const e=t.t;this.focusTracker=new Yl,this.keystrokes=new jl,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(e("Unlink"),'',"unlink"),this.editButtonView=this._createButton(e("Edit link"),'',"edit"),this.set("href"),this._focusables=new oc,this._focusCycler=new Oc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render();[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(t,e,i){const o=new Kc(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.delegate("execute").to(this,i),o}_createPreviewButton(){const t=new Kc(this.locale),e=this.bindTemplate,i=this.t;return t.set({withText:!0,tooltip:i("Open link in new tab")}),t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",t=>t&&Tf(t)),target:"_blank",rel:"noopener noreferrer"}}),t.bind("label").to(this,"href",t=>t||i("This link has no URL")),t.bind("isEnabled").to(this,"href",t=>!!t),t.template.tag="a",t.template.eventListeners={},t}}class Vf extends ud{static get requires(){return[jg]}static get pluginName(){return"LinkUI"}init(){const t=this.editor;t.editing.view.addObserver(Of),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=t.plugins.get(jg),this._createToolbarLinkButton(),this._enableUserBalloonInteractions(),t.conversion.for("editingDowncast").markerToHighlight({model:"link-ui",view:{classes:["ck-fake-link-selection"]}}),t.conversion.for("editingDowncast").markerToElement({model:"link-ui",view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const t=this.editor,e=new Df(t.locale),i=t.commands.get("link"),o=t.commands.get("unlink");return e.bind("href").to(i,"value"),e.editButtonView.bind("isEnabled").to(i),e.unlinkButtonView.bind("isEnabled").to(o),this.listenTo(e,"edit",()=>{this._addFormView()}),this.listenTo(e,"unlink",()=>{t.execute("unlink"),this._hideUI()}),e.keystrokes.set("Esc",(t,e)=>{this._hideUI(),e()}),e.keystrokes.set("Ctrl+K",(t,e)=>{this._addFormView(),e()}),e}_createFormView(){const t=this.editor,e=t.commands.get("link"),i=t.config.get("link.defaultProtocol"),o=new Rf(t.locale,e);return o.urlInputView.fieldView.bind("value").to(e,"value"),o.urlInputView.bind("isReadOnly").to(e,"isEnabled",t=>!t),o.saveButtonView.bind("isEnabled").to(e),this.listenTo(o,"submit",()=>{const{value:e}=o.urlInputView.fieldView.element,n=Sf(e,i);t.execute("link",n,o.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(o,"cancel",()=>{this._closeFormView()}),o.keystrokes.set("Esc",(t,e)=>{this._closeFormView(),e()}),o}_createToolbarLinkButton(){const t=this.editor,e=t.commands.get("link"),i=t.t;t.keystrokes.set("Ctrl+K",(t,i)=>{i(),e.isEnabled&&this._showUI(!0)}),t.ui.componentFactory.add("link",t=>{const o=new Kc(t);return o.isEnabled=!0,o.label=i("Link"),o.icon='',o.keystroke="Ctrl+K",o.tooltip=!0,o.isToggleable=!0,o.bind("isEnabled").to(e,"isEnabled"),o.bind("isOn").to(e,"value",t=>!!t),this.listenTo(o,"execute",()=>this._showUI(!0)),o})}_enableUserBalloonInteractions(){const t=this.editor.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(t,e)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),e())},{priority:"high"}),this.editor.keystrokes.set("Esc",(t,e)=>{this._isUIVisible&&(this._hideUI(),e())}),id({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const t=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=t.value||""}_closeFormView(){const t=this.editor.commands.get("link");t.restoreManualDecoratorStates(),void 0!==t.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(t=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),t&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),t&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const t=this.editor;this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),t.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const t=this.editor,e=t.editing.view.document;let i=this._getSelectedLinkElement(),o=r();const n=()=>{const t=this._getSelectedLinkElement(),e=r();i&&!t||!i&&e!==o?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=t,o=e};function r(){return e.selection.focus.getAncestors().reverse().find(t=>t.is("element"))}this.listenTo(t.ui,"update",n),this.listenTo(this._balloon,"change:visibleView",n)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view,e=this.editor.model,i=t.document;let o=null;if(e.markers.has("link-ui")){const e=Array.from(this.editor.editing.mapper.markerNameToElements("link-ui")),i=t.createRange(t.createPositionBefore(e[0]),t.createPositionAfter(e[e.length-1]));o=t.domConverter.viewRangeToDom(i)}else{const e=this._getSelectedLinkElement(),n=i.selection.getFirstRange();o=e?t.domConverter.mapViewToDom(e):t.domConverter.viewRangeToDom(n)}return{target:o}}_getSelectedLinkElement(){const t=this.editor.editing.view,e=t.document.selection;if(e.isCollapsed)return jf(e.getFirstPosition());{const i=e.getFirstRange().getTrimmed(),o=jf(i.start),n=jf(i.end);return o&&o==n&&t.createRangeIn(o).getTrimmed().isEqual(i)?o:null}}_showFakeVisualSelection(){const t=this.editor.model;t.change(e=>{const i=t.document.selection.getFirstRange();if(t.markers.has("link-ui"))e.updateMarker("link-ui",{range:i});else if(i.start.isAtEnd){const o=function t(e,i,o){const n=[e.start.path[0]+1,0],r=o.createPositionFromPath(e.start.root,n,"toNext"),s=o.createRange(r,e.end);if(s.start.path[0]>e.end.path[0])return o.createRange(i);if(r.isAtStart&&r.isAtEnd)return t(s,i,o);return s}(i,t.document.selection.focus,e);e.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:o})}else e.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:i})})}_hideFakeVisualSelection(){const t=this.editor.model;t.markers.has("link-ui")&&t.change(t=>{t.removeMarker("link-ui")})}}function jf(t){return t.getAncestors().find(t=>{return(e=t).is("attributeElement")&&!!e.getCustomProperty("link");var e})}function Bf(t,e){let i=t.start;return{text:Array.from(t.getItems()).reduce((t,o)=>o.is("$text")||o.is("$textProxy")?t+o.data:(i=e.createPositionAfter(o),""),""),range:e.createRange(i,t.end)}}class Ff{constructor(t,e){this.model=t,this.testCallback=e,this.hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(t.document.selection),this.stopListening(t.document))}),this._startListening()}_startListening(){const t=this.model.document;this.listenTo(t.selection,"change:range",(e,{directChange:i})=>{i&&(t.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this.hasMatch=!1))}),this.listenTo(t,"change:data",(t,e)=>{"transparent"!=e.type&&this._evaluateTextBeforeSelection("data",{batch:e})})}_evaluateTextBeforeSelection(t,e={}){const i=this.model,o=i.document.selection,n=i.createRange(i.createPositionAt(o.focus.parent,0),o.focus),{text:r,range:s}=Bf(n,i),a=this.testCallback(r);if(!a&&this.hasMatch&&this.fire("unmatched"),this.hasMatch=!!a,a){const i=Object.assign(e,{text:r,range:s});"object"==typeof a&&Object.assign(i,a),this.fire("matched:"+t,i)}}}yi(Ff,Uo);const Hf=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.))+(?:[a-z\\u00a1-\\uffff]{2,})))$","i");class Uf extends ud{static get pluginName(){return"AutoLink"}init(){const t=this.editor.model.document.selection;t.on("change:range",()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const t=this.editor,e=new Ff(t.model,t=>{if(!function(t){return t.length>4&&" "===t[t.length-1]&&" "!==t[t.length-2]}(t))return;const e=qf(t.substr(0,t.length-1));return e?{url:e}:void 0}),i=t.plugins.get("Input");e.on("matched:data",(e,o)=>{const{batch:n,range:r,url:s}=o;if(!i.isInput(n))return;const a=r.end.getShiftedBy(-1),l=a.getShiftedBy(-s.length),c=t.model.createRange(l,a);this._applyAutoLink(s,c)}),e.bind("isEnabled").to(this)}_enableEnterHandling(){const t=this.editor,e=t.model,i=t.commands.get("enter");i&&i.on("execute",()=>{const t=e.document.selection.getFirstPosition();if(!t.parent.previousSibling)return;const i=e.createRangeIn(t.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(i)})}_enableShiftEnterHandling(){const t=this.editor,e=t.model,i=t.commands.get("shiftEnter");i&&i.on("execute",()=>{const t=e.document.selection.getFirstPosition(),i=e.createRange(e.createPositionAt(t.parent,0),t.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(i)})}_checkAndApplyAutoLinkOnRange(t){const e=this.editor.model,{text:i,range:o}=Bf(t,e),n=qf(i);if(n){const t=e.createRange(o.end.getShiftedBy(-n.length),o.end);this._applyAutoLink(n,t)}}_applyAutoLink(t,e){const i=this.editor.model;this.isEnabled&&function(t,e){return e.schema.checkAttributeInSelection(e.createSelection(t),"linkHref")}(e,i)&&i.enqueueChange(i=>{const o=this.editor.config.get("link.defaultProtocol"),n=Sf(t,o);i.setAttribute("linkHref",n,e)})}}function qf(t){const e=Hf.exec(t);return e?e[2]:null}class Wf extends md{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document,i=Array.from(e.selection.getSelectedBlocks()).filter(e=>Gf(e,t.schema)),o=!0===this.value;t.change(t=>{if(o){let e=i[i.length-1].nextSibling,o=Number.POSITIVE_INFINITY,n=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){const t=e.getAttribute("listIndent");t=i;)r>n.getAttribute("listIndent")&&(r=n.getAttribute("listIndent")),n.getAttribute("listIndent")==r&&t[e?"unshift":"push"](n),n=n[e?"previousSibling":"nextSibling"]}}function Gf(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class Yf extends md{constructor(t,e){super(t),this._indentBy="forward"==e?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document;let i=Array.from(e.selection.getSelectedBlocks());t.change(t=>{const e=i[i.length-1];let o=e.nextSibling;for(;o&&"listItem"==o.name&&o.getAttribute("listIndent")>e.getAttribute("listIndent");)i.push(o),o=o.nextSibling;this._indentBy<0&&(i=i.reverse());for(const e of i){const i=e.getAttribute("listIndent")+this._indentBy;i<0?t.rename(e,"paragraph"):t.setAttribute("listIndent",i,e)}this.fire("_executeCleanup",i)})}_checkEnabled(){const t=pd(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem"))return!1;if(this._indentBy>0){const e=t.getAttribute("listIndent"),i=t.getAttribute("listType");let o=t.previousSibling;for(;o&&o.is("element","listItem")&&o.getAttribute("listIndent")>=e;){if(o.getAttribute("listIndent")==e)return o.getAttribute("listType")==i;o=o.previousSibling}return!1}return!0}}function Kf(t,e){const i=e.mapper,o=e.writer,n="numbered"==t.getAttribute("listType")?"ol":"ul",r=function(t){const e=t.createContainerElement("li");return e.getFillerOffset=op,e}(o),s=o.createContainerElement(n,null);return o.insert(o.createPositionAt(s,0),r),i.bindElements(t,r),r}function Qf(t,e,i,o){const n=e.parent,r=i.mapper,s=i.writer;let a=r.toViewPosition(o.createPositionBefore(t));const l=Xf(t.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:t.getAttribute("listIndent")}),c=t.previousSibling;if(l&&l.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=r.toViewElement(l);a=s.breakContainer(s.createPositionAfter(t))}else if(c&&"listItem"==c.name){a=r.toViewPosition(o.createPositionAt(c,"end"));const t=r.findMappedViewAncestor(a),e=ep(t);a=e?s.createPositionBefore(e):s.createPositionAt(t,"end")}else a=r.toViewPosition(o.createPositionBefore(t));if(a=Zf(a),s.insert(a,n),c&&"listItem"==c.name){const t=r.toViewElement(c),i=s.createRange(s.createPositionAt(t,0),a).getWalker({ignoreElementEnd:!0});for(const t of i)if(t.item.is("element","li")){const o=s.breakContainer(s.createPositionBefore(t.item)),n=t.item.parent,r=s.createPositionAt(e,"end");Jf(s,r.nodeBefore,r.nodeAfter),s.move(s.createRangeOn(n),r),i.position=o}}else{const i=n.nextSibling;if(i&&(i.is("element","ul")||i.is("element","ol"))){let o=null;for(const e of i.getChildren()){const i=r.toModelElement(e);if(!(i&&i.getAttribute("listIndent")>t.getAttribute("listIndent")))break;o=e}o&&(s.breakContainer(s.createPositionAfter(o)),s.move(s.createRangeOn(o.parent),s.createPositionAt(e,"end")))}}Jf(s,n,n.nextSibling),Jf(s,n.previousSibling,n)}function Jf(t,e,i){return!e||!i||"ul"!=e.name&&"ol"!=e.name||e.name!=i.name||e.getAttribute("class")!==i.getAttribute("class")?null:t.mergeContainers(t.createPositionAfter(e))}function Zf(t){return t.getLastMatchingPosition(t=>t.item.is("uiElement"))}function Xf(t,e){const i=!!e.sameIndent,o=!!e.smallerIndent,n=e.listIndent;let r=t;for(;r&&"listItem"==r.name;){const t=r.getAttribute("listIndent");if(i&&n==t||o&&n>t)return r;r="forward"===e.direction?r.nextSibling:r.previousSibling}return null}function tp(t,e,i,o){t.ui.componentFactory.add(e,n=>{const r=t.commands.get(e),s=new Kc(n);return s.set({label:i,icon:o,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>{t.execute(e),t.editing.view.focus()}),s})}function ep(t){for(const e of t.getChildren())if("ul"==e.name||"ol"==e.name)return e;return null}function ip(t,e){const i=[],o=t.parent,n={ignoreElementEnd:!0,startPosition:t,shallow:!0,direction:e},r=o.getAttribute("listIndent"),s=[...new xs(n)].filter(t=>t.item.is("element")).map(t=>t.item);for(const t of s){if(!t.is("element","listItem"))break;if(t.getAttribute("listIndent")r)){if(t.getAttribute("listType")!==o.getAttribute("listType"))break;if(t.getAttribute("listStyle")!==o.getAttribute("listStyle"))break;"backward"===e?i.unshift(t):i.push(t)}}return i}function op(){const t=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||t?0:Do.call(this)}function np(t){return(e,i,o)=>{const n=o.consumable;if(!n.test(i.item,"insert")||!n.test(i.item,"attribute:listType")||!n.test(i.item,"attribute:listIndent"))return;n.consume(i.item,"insert"),n.consume(i.item,"attribute:listType"),n.consume(i.item,"attribute:listIndent");const r=i.item;Qf(r,Kf(r,o),o,t)}}function rp(t,e,i){if(!i.consumable.consume(e.item,"attribute:listType"))return;const o=i.mapper.toViewElement(e.item),n=i.writer;n.breakContainer(n.createPositionBefore(o)),n.breakContainer(n.createPositionAfter(o));const r=o.parent,s="numbered"==e.attributeNewValue?"ol":"ul";n.rename(s,r)}function sp(t,e,i){const o=i.mapper.toViewElement(e.item).parent,n=i.writer;Jf(n,o,o.nextSibling),Jf(n,o.previousSibling,o);for(const t of e.item.getChildren())i.consumable.consume(t,"insert")}function ap(t,e,i){if("listItem"!=e.item.name){let t=i.mapper.toViewPosition(e.range.start);const o=i.writer,n=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&(t=o.breakContainer(t),"li"==t.parent.name);){const e=t,i=o.createPositionAt(t.parent,"end");if(!e.isEqual(i)){const t=o.remove(o.createRange(e,i));n.push(t)}t=o.createPositionAfter(t.parent)}if(n.length>0){for(let e=0;e0){const e=Jf(o,i,i.nextSibling);e&&e.parent==i&&t.offset--}}Jf(o,t.nodeBefore,t.nodeAfter)}}}function lp(t,e,i){const o=i.mapper.toViewPosition(e.position),n=o.nodeBefore,r=o.nodeAfter;Jf(i.writer,n,r)}function cp(t,e,i){if(i.consumable.consume(e.viewItem,{name:!0})){const t=i.writer,o=t.createElement("listItem"),n=function(t){let e=0,i=t.parent;for(;i;){if(i.is("element","li"))e++;else{const t=i.previousSibling;t&&t.is("element","li")&&e++}i=i.parent}return e}(e.viewItem);t.setAttribute("listIndent",n,o);const r=e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted";if(t.setAttribute("listType",r,o),!i.safeInsert(o,e.modelCursor))return;const s=function(t,e,i){const{writer:o,schema:n}=i;let r=o.createPositionAfter(t);for(const s of e)if("ul"==s.name||"ol"==s.name)r=i.convertItem(s,r).modelCursor;else{const e=i.convertItem(s,o.createPositionAt(t,"end")),a=e.modelRange.start.nodeAfter;a&&a.is("element")&&!n.checkChild(t,a.name)&&(t=e.modelCursor.parent.is("element","listItem")?e.modelCursor.parent:mp(e.modelCursor),r=o.createPositionAfter(t))}return r}(o,e.viewItem.getChildren(),i);e.modelRange=t.createRange(e.modelCursor,s),i.updateConversionResult(o,e)}}function dp(t,e,i){if(i.consumable.test(e.viewItem,{name:!0})){const t=Array.from(e.viewItem.getChildren());for(const e of t){!(e.is("element","li")||pp(e))&&e._remove()}}}function hp(t,e,i){if(i.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;const t=[...e.viewItem.getChildren()];let i=!1,o=!0;for(const e of t)i&&!pp(e)&&e._remove(),e.is("$text")?(o&&(e._data=e.data.replace(/^\s+/,"")),e.nextSibling&&!pp(e.nextSibling)||(e._data=e.data.replace(/\s+$/,""))):pp(e)&&(i=!0),o=!1}}function up(t){return(e,i)=>{if(i.isPhantom)return;const o=i.modelPosition.nodeBefore;if(o&&o.is("element","listItem")){const e=i.mapper.toViewElement(o),n=e.getAncestors().find(pp),r=t.createPositionAt(e,0).getWalker();for(const t of r){if("elementStart"==t.type&&t.item.is("element","li")){i.viewPosition=t.previousPosition;break}if("elementEnd"==t.type&&t.item==n){i.viewPosition=t.nextPosition;break}}}}}function gp(t,[e,i]){let o,n=e.is("documentFragment")?e.getChild(0):e;if(o=i?this.createSelection(i):this.document.selection,n&&n.is("element","listItem")){const t=o.getFirstPosition();let e=null;if(t.parent.is("element","listItem")?e=t.parent:t.nodeBefore&&t.nodeBefore.is("element","listItem")&&(e=t.nodeBefore),e){const t=e.getAttribute("listIndent");if(t>0)for(;n&&n.is("element","listItem");)n._setAttribute("listIndent",n.getAttribute("listIndent")+t),n=n.nextSibling}}}function mp(t){const e=new xs({startPosition:t});let i;do{i=e.next()}while(!i.value.item.is("element","listItem"));return i.value.item}function fp(t,e,i,o,n,r){const s=Xf(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:t,foo:"b"}),a=n.mapper,l=n.writer,c=s?s.getAttribute("listIndent"):null;let d;if(s)if(c==t){const t=a.toViewElement(s).parent;d=l.createPositionAfter(t)}else{const t=r.createPositionAt(s,"end");d=a.toViewPosition(t)}else d=i;d=Zf(d);for(const t of[...o.getChildren()])pp(t)&&(d=l.move(l.createRangeOn(t),d).end,Jf(l,t,t.nextSibling),Jf(l,t.previousSibling,t))}function pp(t){return t.is("element","ol")||t.is("element","ul")}class bp extends ud{static get pluginName(){return"ListEditing"}static get requires(){return[Iu]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,i=t.editing;var o;t.model.document.registerPostFixer(e=>function(t,e){const i=t.document.differ.getChanges(),o=new Map;let n=!1;for(const o of i)if("insert"==o.type&&"listItem"==o.name)r(o.position);else if("insert"==o.type&&"listItem"!=o.name){if("$text"!=o.name){const i=o.position.nodeAfter;i.hasAttribute("listIndent")&&(e.removeAttribute("listIndent",i),n=!0),i.hasAttribute("listType")&&(e.removeAttribute("listType",i),n=!0),i.hasAttribute("listStyle")&&(e.removeAttribute("listStyle",i),n=!0);for(const e of Array.from(t.createRangeIn(i)).filter(t=>t.item.is("element","listItem")))r(e.previousPosition)}r(o.position.getShiftedBy(o.length))}else"remove"==o.type&&"listItem"==o.name?r(o.position):("attribute"==o.type&&"listIndent"==o.attributeKey||"attribute"==o.type&&"listType"==o.attributeKey)&&r(o.range.start);for(const t of o.values())s(t),a(t);return n;function r(t){const e=t.nodeBefore;if(e&&e.is("element","listItem")){let t=e;if(o.has(t))return;for(let e=t.previousSibling;e&&e.is("element","listItem");e=t.previousSibling)if(t=e,o.has(t))return;o.set(e,t)}else{const e=t.nodeAfter;e&&e.is("element","listItem")&&o.set(e,e)}}function s(t){let i=0,o=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(r>i){let s;null===o?(o=r-i,s=i):(o>r&&(o=r),s=r-o),e.setAttribute("listIndent",s,t),n=!0}else o=null,i=t.getAttribute("listIndent")+1;t=t.nextSibling}}function a(t){let i=[],o=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(o&&o.getAttribute("listIndent")>r&&(i=i.slice(0,r+1)),0!=r)if(i[r]){const o=i[r];t.getAttribute("listType")!=o&&(e.setAttribute("listType",o,t),n=!0)}else i[r]=t.getAttribute("listType");o=t,t=t.nextSibling}}}(t.model,e)),i.mapper.registerViewToModelLength("li",wp),e.mapper.registerViewToModelLength("li",wp),i.mapper.on("modelToViewPosition",up(i.view)),i.mapper.on("viewToModelPosition",(o=t.model,(t,e)=>{const i=e.viewPosition,n=i.parent,r=e.mapper;if("ul"==n.name||"ol"==n.name){if(i.isAtEnd){const t=r.toModelElement(i.nodeBefore),n=r.getModelLength(i.nodeBefore);e.modelPosition=o.createPositionBefore(t).getShiftedBy(n)}else{const t=r.toModelElement(i.nodeAfter);e.modelPosition=o.createPositionBefore(t)}t.stop()}else if("li"==n.name&&i.nodeBefore&&("ul"==i.nodeBefore.name||"ol"==i.nodeBefore.name)){const s=r.toModelElement(n);let a=1,l=i.nodeBefore;for(;l&&pp(l);)a+=r.getModelLength(l),l=l.previousSibling;e.modelPosition=o.createPositionBefore(s).getShiftedBy(a),t.stop()}})),e.mapper.on("modelToViewPosition",up(i.view)),t.conversion.for("editingDowncast").add(e=>{e.on("insert",ap,{priority:"high"}),e.on("insert:listItem",np(t.model)),e.on("attribute:listType:listItem",rp,{priority:"high"}),e.on("attribute:listType:listItem",sp,{priority:"low"}),e.on("attribute:listIndent:listItem",function(t){return(e,i,o)=>{if(!o.consumable.consume(i.item,"attribute:listIndent"))return;const n=o.mapper.toViewElement(i.item),r=o.writer;r.breakContainer(r.createPositionBefore(n)),r.breakContainer(r.createPositionAfter(n));const s=n.parent,a=s.previousSibling,l=r.createRangeOn(s);r.remove(l),a&&a.nextSibling&&Jf(r,a,a.nextSibling),fp(i.attributeOldValue+1,i.range.start,l.start,n,o,t),Qf(i.item,n,o,t);for(const t of i.item.getChildren())o.consumable.consume(t,"insert")}}(t.model)),e.on("remove:listItem",function(t){return(e,i,o)=>{const n=o.mapper.toViewPosition(i.position).getLastMatchingPosition(t=>!t.item.is("element","li")).nodeAfter,r=o.writer;r.breakContainer(r.createPositionBefore(n)),r.breakContainer(r.createPositionAfter(n));const s=n.parent,a=s.previousSibling,l=r.createRangeOn(s),c=r.remove(l);a&&a.nextSibling&&Jf(r,a,a.nextSibling);fp(o.mapper.toModelElement(n).getAttribute("listIndent")+1,i.position,l.start,n,o,t);for(const t of r.createRangeIn(c).getItems())o.mapper.unbindViewElement(t);e.stop()}}(t.model)),e.on("remove",lp,{priority:"low"})}),t.conversion.for("dataDowncast").add(e=>{e.on("insert",ap,{priority:"high"}),e.on("insert:listItem",np(t.model))}),t.conversion.for("upcast").add(t=>{t.on("element:ul",dp,{priority:"high"}),t.on("element:ol",dp,{priority:"high"}),t.on("element:li",hp,{priority:"high"}),t.on("element:li",cp)}),t.model.on("insertContent",gp,{priority:"high"}),t.commands.add("numberedList",new Wf(t,"numbered")),t.commands.add("bulletedList",new Wf(t,"bulleted")),t.commands.add("indentList",new Yf(t,"forward")),t.commands.add("outdentList",new Yf(t,"backward"));const n=i.view.document;this.listenTo(n,"enter",(t,e)=>{const i=this.editor.model.document,o=i.selection.getLastPosition().parent;i.selection.isCollapsed&&"listItem"==o.name&&o.isEmpty&&(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),this.listenTo(n,"delete",(t,e)=>{if("backward"!==e.direction)return;const i=this.editor.model.document.selection;if(!i.isCollapsed)return;const o=i.getFirstPosition();if(!o.isAtStart)return;const n=o.parent;if("listItem"!==n.name)return;n.previousSibling&&"listItem"===n.previousSibling.name||(this.editor.execute("outdentList"),e.preventDefault(),t.stop())},{priority:"high"});const r=t=>(e,i)=>{this.editor.commands.get(t).isEnabled&&(this.editor.execute(t),i())};t.keystrokes.set("Tab",r("indentList")),t.keystrokes.set("Shift+Tab",r("outdentList"))}afterInit(){const t=this.editor.commands,e=t.get("indent"),i=t.get("outdent");e&&e.registerChildCommand(t.get("indentList")),i&&i.registerChildCommand(t.get("outdentList"))}}function wp(t){let e=1;for(const i of t.getChildren())if("ul"==i.name||"ol"==i.name)for(const t of i.getChildren())e+=wp(t);return e}var kp='',_p='';class vp extends ud{init(){const t=this.editor.t;tp(this.editor,"numberedList",t("Numbered List"),kp),tp(this.editor,"bulletedList",t("Bulleted List"),_p)}}class yp extends md{constructor(t,e){super(t),this._defaultType=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model;let i=[...e.document.selection.getSelectedBlocks()].filter(t=>t.is("element","listItem")).map(t=>{const i=e.change(e=>e.createPositionAt(t,0));return[...ip(i,"backward"),...ip(i,"forward")]}).flat();i=[...new Set(i)],i.length&&e.change(e=>{for(const o of i)e.setAttribute("listStyle",t.type||this._defaultType,o)})}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")?t.getAttribute("listStyle"):null}_checkEnabled(){const t=this.editor,e=t.commands.get("numberedList"),i=t.commands.get("bulletedList");return e.isEnabled||i.isEnabled}}class xp extends ud{static get requires(){return[bp]}static get pluginName(){return"ListStyleEditing"}init(){const t=this.editor,e=t.model;e.schema.extend("listItem",{allowAttributes:["listStyle"]}),t.commands.add("listStyle",new yp(t,"default")),this.listenTo(t.commands.get("indentList"),"_executeCleanup",function(t){return(e,i)=>{let o;const n=i[0],r=n.getAttribute("listIndent"),s=i.filter(t=>t.getAttribute("listIndent")===r);if(n.previousSibling.getAttribute("listIndent")+1===r)o="default";else{const t=Xf(n.previousSibling,{sameIndent:!0,direction:"backward",listIndent:r});o=t.getAttribute("listStyle")}t.model.change(t=>{for(const e of s)t.setAttribute("listStyle",o,e)})}}(t)),this.listenTo(t.commands.get("outdentList"),"_executeCleanup",function(t){return(e,i)=>{if(!(i=i.reverse().filter(t=>t.is("element","listItem"))).length)return;const o=i[0].getAttribute("listIndent"),n=i[0].getAttribute("listType");let r=i[0].previousSibling;if(r.is("element","listItem"))for(;r.getAttribute("listIndent")!==o;)r=r.previousSibling;else r=null;r||(r=i[i.length-1].nextSibling),r&&r.is("element","listItem")&&r.getAttribute("listType")===n&&t.model.change(t=>{const e=i.filter(t=>t.getAttribute("listIndent")===o);for(const i of e)t.setAttribute("listStyle",r.getAttribute("listStyle"),i)})}}(t)),this.listenTo(t.commands.get("bulletedList"),"_executeCleanup",Cp(t)),this.listenTo(t.commands.get("numberedList"),"_executeCleanup",Cp(t)),e.document.registerPostFixer(function(t){return e=>{let i=!1;const o=Sp(t.model.document.differ.getChanges()).filter(t=>"todo"!==t.getAttribute("listType"));if(!o.length)return i;let n=o[o.length-1].nextSibling;if((!n||!n.is("element","listItem"))&&(n=o[o.length-1].previousSibling,n)){const t=o[0].getAttribute("listIndent");for(;n.is("element","listItem")&&n.getAttribute("listIndent")!==t&&(n=n.previousSibling,n););}for(const t of o)if(t.hasAttribute("listStyle")){const o=t.previousSibling;Tp(o,t)&&(e.setAttribute("listStyle",o.getAttribute("listStyle"),t),i=!0)}else Ap(n,t)?e.setAttribute("listStyle",n.getAttribute("listStyle"),t):e.setAttribute("listStyle","default",t),i=!0;return i}}(t)),t.conversion.for("upcast").add(t=>{t.on("element:li",(t,e,i)=>{const o=e.viewItem.parent.getStyle("list-style-type")||"default",n=e.modelRange.start.nodeAfter||e.modelRange.end.nodeBefore;i.writer.setAttribute("listStyle",o,n)},{priority:"low"})}),t.conversion.for("downcast").add(t=>{t.on("attribute:listStyle:listItem",(t,e,i)=>{const o=i.writer,n=e.item,r=Xf(n.previousSibling,{sameIndent:!0,listIndent:n.getAttribute("listIndent"),direction:"backward"}),s=i.mapper.toViewElement(n);var a,l,c,d,h;a=n,(l=r)&&a.getAttribute("listType")===l.getAttribute("listType")&&a.getAttribute("listIndent")===l.getAttribute("listIndent")&&a.getAttribute("listStyle")===l.getAttribute("listStyle")||o.breakContainer(o.createPositionBefore(s)),c=o,d=e.attributeNewValue,h=s.parent,d&&"default"!==d?c.setStyle("list-style-type",d,h):c.removeStyle("list-style-type",h)},{priority:"low"})}),this._mergeListStyleAttributeWhileMergingLists()}afterInit(){const t=this.editor;t.commands.get("todoList")&&t.model.document.registerPostFixer(function(t){return e=>{const i=Sp(t.model.document.differ.getChanges()).filter(t=>"todo"===t.getAttribute("listType")&&t.hasAttribute("listStyle"));if(!i.length)return!1;for(const t of i)e.removeAttribute("listStyle",t);return!0}}(t))}_mergeListStyleAttributeWhileMergingLists(){const t=this.editor.model;let e;this.listenTo(t,"deleteContent",(t,[i])=>{const o=i.getFirstPosition(),n=i.getLastPosition();if(o.parent===n.parent)return;if(!o.parent.is("element","listItem"))return;const r=n.parent.nextSibling;if(!r||!r.is("element","listItem"))return;const s=Xf(o.parent,{sameIndent:!0,listIndent:r.getAttribute("listIndent")});s&&s.getAttribute("listType")===r.getAttribute("listType")&&(e=s)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{e&&(t.change(t=>{const i=Xf(e.nextSibling,{sameIndent:!0,listIndent:e.getAttribute("listIndent"),direction:"forward"}),o=[i,...ip(t.createPositionAt(i,0),"forward")];for(const i of o)t.setAttribute("listStyle",e.getAttribute("listStyle"),i)}),e=null)},{priority:"low"})}}function Ap(t,e){if(!t)return!1;const i=t.getAttribute("listStyle");return!!i&&("default"!==i&&t.getAttribute("listType")===e.getAttribute("listType"))}function Tp(t,e){if(!t||!t.is("element","listItem"))return!1;if(e.getAttribute("listType")!==t.getAttribute("listType"))return!1;const i=t.getAttribute("listIndent");if(i<1||i!==e.getAttribute("listIndent"))return!1;const o=t.getAttribute("listStyle");return!(!o||o===e.getAttribute("listStyle"))}function Cp(t){return(e,i)=>{i=i.filter(t=>t.is("element","listItem")),t.model.change(t=>{for(const e of i)t.removeAttribute("listStyle",e)})}}function Sp(t){const e=[];for(const i of t){const t=Pp(i);t&&t.is("element","listItem")&&e.push(t)}return e}function Pp(t){return"attribute"===t.type?t.range.start.nodeAfter:"insert"===t.type?t.position.nodeAfter:null}i(98);class Ep extends ud{static get pluginName(){return"ListStyleUI"}init(){const t=this.editor,e=t.locale.t;t.ui.componentFactory.add("bulletedList",Mp({editor:t,parentCommandName:"bulletedList",buttonLabel:e("Bulleted List"),buttonIcon:_p,toolbarAriaLabel:e("Bulleted list styles toolbar"),styleDefinitions:[{label:e("Toggle the disc list style"),tooltip:e("Disc"),type:"disc",icon:''},{label:e("Toggle the circle list style"),tooltip:e("Circle"),type:"circle",icon:''},{label:e("Toggle the square list style"),tooltip:e("Square"),type:"square",icon:''}]})),t.ui.componentFactory.add("numberedList",Mp({editor:t,parentCommandName:"numberedList",buttonLabel:e("Numbered List"),buttonIcon:kp,toolbarAriaLabel:e("Numbered list styles toolbar"),styleDefinitions:[{label:e("Toggle the decimal list style"),tooltip:e("Decimal"),type:"decimal",icon:''},{label:e("Toggle the decimal with leading zero list style"),tooltip:e("Decimal with leading zero"),type:"decimal-leading-zero",icon:''},{label:e("Toggle the lower–roman list style"),tooltip:e("Lower–roman"),type:"lower-roman",icon:''},{label:e("Toggle the upper–roman list style"),tooltip:e("Upper-roman"),type:"upper-roman",icon:''},{label:e("Toggle the lower–latin list style"),tooltip:e("Lower-latin"),type:"lower-latin",icon:''},{label:e("Toggle the upper–latin list style"),tooltip:e("Upper-latin"),type:"upper-latin",icon:''}]}))}}function Mp({editor:t,parentCommandName:e,buttonLabel:i,buttonIcon:o,toolbarAriaLabel:n,styleDefinitions:r}){const s=t.commands.get(e),a=t.commands.get("listStyle");return l=>{const c=od(l,ju),d=c.buttonView,h=function({editor:t,listStyleCommand:e,parentCommandName:i}){const o=t.locale,n=t.commands.get(i);return({label:r,type:s,icon:a,tooltip:l})=>{const c=new Kc(o);return c.set({label:r,icon:a,tooltip:l}),e.on("change:value",()=>{c.isOn=e.value===s}),c.on("execute",()=>{n.value?e.value!==s?t.execute("listStyle",{type:s}):t.execute("listStyle",{type:e._defaultType}):t.model.change(()=>{t.execute(i),t.execute("listStyle",{type:s})}),t.editing.view.focus()}),c}}({editor:t,parentCommandName:e,listStyleCommand:a});return nd(c,r.map(h)),c.bind("isEnabled").to(s),c.toolbarView.ariaLabel=n,c.class="ck-list-styles-dropdown",d.on("execute",()=>{t.execute(e),t.editing.view.focus()}),d.set({label:i,icon:o,tooltip:!0,isToggleable:!0}),d.bind("isOn").to(s,"value",t=>!!t),c}}function Lp(t,e){return t=>{t.on("attribute:url:media",i)};function i(i,o,n){if(!n.consumable.consume(o.item,i.name))return;const r=o.attributeNewValue,s=n.writer,a=n.mapper.toViewElement(o.item),l=[...a.getChildren()].find(t=>t.getCustomProperty("media-content"));s.remove(l);const c=t.getMediaViewElement(s,r,e);s.insert(s.createPositionAt(a,0),c)}}function Ip(t){const e=t.getSelectedElement();return e&&function(t){return!!t.getCustomProperty("media")&&tg(t)}(e)?e:null}function Np(t,e,i,o){const n=t.createContainerElement("figure",{class:"media"});return t.insert(t.createPositionAt(n,0),e.getMediaViewElement(t,i,o)),n}function zp(t){const e=t.getSelectedElement();return e&&e.is("element","media")?e:null}function Op(t,e,i){t.change(o=>{const n=o.createElement("media",{url:e});t.insertContent(n,i),o.setSelection(n,"on")})}class Rp extends md{refresh(){const t=this.editor.model,e=t.document.selection,i=t.schema,o=og(e,t),n=zp(e);let r=o.parent;r.isEmpty&&!t.schema.isLimit(r)&&(r=r.parent),this.value=n?n.getAttribute("url"):null,this.isEnabled=i.checkChild(r,"media")}execute(t){const e=this.editor.model,i=e.document.selection,o=zp(i);if(o)e.change(e=>{e.setAttribute("url",t,o)});else{const o=og(i,e);Op(e,t,o)}}}class Dp{constructor(t,e){const i=e.providers,o=e.extraProviders||[],n=new Set(e.removeProviders),r=i.concat(o).filter(t=>{const e=t.name;return e?!n.has(e):(Object(hi.c)("media-embed-no-provider-name",{provider:t}),!1)});this.locale=t,this.providerDefinitions=r}hasMedia(t){return!!this._getMedia(t)}getMediaViewElement(t,e,i){return this._getMedia(e).getViewElement(t,i)}_getMedia(t){if(!t)return new Vp(this.locale);t=t.trim();for(const e of this.providerDefinitions){const i=e.html,o=Ti(e.url);for(const e of o){const o=this._getUrlMatches(t,e);if(o)return new Vp(this.locale,t,o,i)}}return null}_getUrlMatches(t,e){let i=t.match(e);if(i)return i;let o=t.replace(/^https?:\/\//,"");return i=o.match(e),i||(o=o.replace(/^www\./,""),i=o.match(e),i||null)}}class Vp{constructor(t,e,i,o){this.url=this._getValidUrl(e),this._t=t.t,this._match=i,this._previewRenderer=o}getViewElement(t,e){const i={};let o;if(e.renderForEditingView||e.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(i["data-oembed-url"]=this.url),e.renderForEditingView&&(i.class="ck-media__wrapper");const n=this._getPreviewHtml(e);o=t.createRawElement("div",i,(function(t){t.innerHTML=n}))}else this.url&&(i.url=this.url),o=t.createEmptyElement("oembed",i);return t.setCustomProperty("media-content",!0,o),o}_getPreviewHtml(t){return this._previewRenderer?this._previewRenderer(this._match):this.url&&t.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const t=new Yc,e=new Gc;t.text=this._t("Open media in new tab"),e.content='',e.viewBox="0 0 64 42";return new nc({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[e]},{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]},t]}]}).render().outerHTML}_getValidUrl(t){return t?t.match(/^https?/)?t:"https://"+t:null}}i(100);class jp extends ud{static get pluginName(){return"MediaEmbedEditing"}constructor(t){super(t),t.config.define("mediaEmbed",{providers:[{name:"dailymotion",url:/^dailymotion\.com\/video\/(\w+)/,html:t=>`
`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:t=>`
`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)/,/^youtube\.com\/embed\/([\w-]+)/,/^youtu\.be\/([\w-]+)/],html:t=>`
`},{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:t=>`
`},{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 Dp(t.locale,t.config.get("mediaEmbed"))}init(){const t=this.editor,e=t.model.schema,i=t.t,o=t.conversion,n=t.config.get("mediaEmbed.previewsInData"),r=this.registry;t.commands.add("mediaEmbed",new Rp(t)),e.register("media",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["url"]}),o.for("dataDowncast").elementToElement({model:"media",view:(t,{writer:e})=>{const i=t.getAttribute("url");return Np(e,r,i,{renderMediaPreview:i&&n})}}),o.for("dataDowncast").add(Lp(r,{renderMediaPreview:n})),o.for("editingDowncast").elementToElement({model:"media",view:(t,{writer:e})=>{const o=t.getAttribute("url");return function(t,e,i){return e.setCustomProperty("media",!0,t),eg(t,e,{label:i})}(Np(e,r,o,{renderForEditingView:!0}),e,i("media widget"))}}),o.for("editingDowncast").add(Lp(r,{renderForEditingView:!0})),o.for("upcast").elementToElement({view:{name:"oembed",attributes:{url:!0}},model:(t,{writer:e})=>{const i=t.getAttribute("url");if(r.hasMedia(i))return e.createElement("media",{url:i})}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(t,{writer:e})=>{const i=t.getAttribute("data-oembed-url");if(r.hasMedia(i))return e.createElement("media",{url:i})}})}}const Bp=/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=%]+$/;class Fp extends ud{static get requires(){return[jd,Oh]}static get pluginName(){return"AutoMediaEmbed"}constructor(t){super(t),this._timeoutId=null,this._positionToInsert=null}init(){const t=this.editor,e=t.model.document;this.listenTo(t.plugins.get(jd),"inputTransformation",()=>{const t=e.selection.getFirstRange(),i=vl.fromPosition(t.start);i.stickiness="toPrevious";const o=vl.fromPosition(t.end);o.stickiness="toNext",e.once("change:data",()=>{this._embedMediaBetweenPositions(i,o),i.detach(),o.detach()},{priority:"high"})}),t.commands.get("undo").on("execute",()=>{this._timeoutId&&(rr.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(t,e){const i=this.editor,o=i.plugins.get(jp).registry,n=new Hs(t,e),r=n.getWalker({ignoreElementEnd:!0});let s="";for(const t of r)t.item.is("$textProxy")&&(s+=t.item.data);if(s=s.trim(),!s.match(Bp))return void n.detach();if(!o.hasMedia(s))return void n.detach();i.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=vl.fromPosition(t),this._timeoutId=rr.window.setTimeout(()=>{i.model.change(t=>{let e;this._timeoutId=null,t.remove(n),n.detach(),"$graveyard"!==this._positionToInsert.root.rootName&&(e=this._positionToInsert),Op(i.model,s,e),this._positionToInsert.detach(),this._positionToInsert=null})},100)):n.detach()}}i(102);class Hp extends xc{constructor(t,e){super(e);const i=e.t;this.focusTracker=new Yl,this.keystrokes=new jl,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(i("Save"),Og,"ck-button-save"),this.saveButtonView.type="submit",this.saveButtonView.bind("isEnabled").to(this,"mediaURLInputValue",t=>!!t),this.cancelButtonView=this._createButton(i("Cancel"),Rg,"ck-button-cancel","cancel"),this._focusables=new oc,this._focusCycler=new Oc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]}),Ng(this)}render(){super.render(),zg({view:this});[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element);const t=t=>t.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t),this.listenTo(this.urlInputView.element,"selectstart",(t,e)=>{e.stopPropagation()},{priority:"high"})}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(t){this.urlInputView.fieldView.element.value=t.trim()}isValid(){this.resetFormStatus();for(const t of this._validators){const e=t(this);if(e)return this.urlInputView.errorText=e,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const t=this.locale.t,e=new Mg(this.locale,Ig),i=e.fieldView;return this._urlInputViewInfoDefault=t("Paste the media URL in the input."),this._urlInputViewInfoTip=t("Tip: Paste the URL into the content to embed faster."),e.label=t("Media URL"),e.infoText=this._urlInputViewInfoDefault,i.on("input",()=>{e.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=i.element.value.trim()}),e}_createButton(t,e,i,o){const n=new Kc(this.locale);return n.set({label:t,icon:e,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),o&&n.delegate("execute").to(this,o),n}}class Up extends ud{static get requires(){return[jp]}static get pluginName(){return"MediaEmbedUI"}init(){const t=this.editor,e=t.commands.get("mediaEmbed"),i=t.plugins.get(jp).registry;t.ui.componentFactory.add("mediaEmbed",o=>{const n=od(o),r=new Hp(function(t,e){return[e=>{if(!e.url.length)return t("The URL must not be empty.")},i=>{if(!e.hasMedia(i.url))return t("This media URL is not supported.")}]}(t.t,i),t.locale);return this._setUpDropdown(n,r,e,t),this._setUpForm(n,r,e),n})}_setUpDropdown(t,e,i){const o=this.editor,n=o.t,r=t.buttonView;function s(){o.editing.view.focus(),t.isOpen=!1}t.bind("isEnabled").to(i),t.panelView.children.add(e),r.set({label:n("Insert media"),icon:'',tooltip:!0}),r.on("open",()=>{e.disableCssTransitions(),e.url=i.value||"",e.urlInputView.fieldView.select(),e.focus(),e.enableCssTransitions()},{priority:"low"}),t.on("submit",()=>{e.isValid()&&(o.execute("mediaEmbed",e.url),s())}),t.on("change:isOpen",()=>e.resetFormStatus()),t.on("cancel",()=>s())}_setUpForm(t,e,i){e.delegate("submit","cancel").to(t),e.urlInputView.bind("value").to(i,"value"),e.urlInputView.bind("isReadOnly").to(i,"isEnabled",t=>!t)}}i(104);class qp{constructor(t,e){this.loader=t,this.options=e}upload(){return this.loader.file.then(t=>new Promise((e,i)=>{this._initRequest(),this._initListeners(e,i,t),this._sendRequest(t)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.options.uploadUrl,!0),t.responseType="text"}_initListeners(t,e,i){const o=this.xhr,n=this.loader;o.addEventListener("error",()=>notif("error",o.statusText,"Impossible d'exporter l'image")),o.addEventListener("abort",()=>e()),o.addEventListener("load",()=>{const e=o.responseText.substring(o.responseText.indexOf("[DIV]")+5).replace(" ","%20");e.includes("error")?notif("error",e.substring(6),"Impossible d'exporter l'image"):t({default:e})}),o.upload&&o.upload.addEventListener("progress",t=>{t.lengthComputable&&(n.uploadTotal=t.total,n.uploaded=t.loaded)})}_sendRequest(t){const e=this.options.headers||{},i=this.options.withCredentials||!1;for(const t of Object.keys(e))this.xhr.setRequestHeader(t,e[t]);this.xhr.withCredentials=i;const o=new FormData;o.append("upload",t),this.xhr.send(o)}}i(106);class Wp extends xc{constructor(t,e={}){super(t);const i=this.bindTemplate;this.set("label",e.label||""),this.set("class",e.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children});const o=new xc(t);o.setTemplate({tag:"span",attributes:{class:["ck","ck-form__header__label"]},children:[{text:i.to("label")}]}),this.children.add(o)}}class $p extends Wp{constructor(t,e){super(t);const i=t.t;this.set("class","ck-special-characters-navigation"),this.groupDropdownView=this._createGroupDropdown(e),this.groupDropdownView.panelPosition="rtl"===t.uiLanguageDirection?"se":"sw",this.label=i("Special characters"),this.children.add(this.groupDropdownView)}get currentGroupName(){return this.groupDropdownView.value}_createGroupDropdown(t){const e=this.locale,i=e.t,o=od(e),n=this._getCharacterGroupListItemDefinitions(o,t);return o.set("value",n.first.model.label),o.buttonView.bind("label").to(o,"value"),o.buttonView.set({isOn:!1,withText:!0,tooltip:i("Character categories"),class:["ck-dropdown__button_label-width_auto"]}),o.on("execute",t=>{o.value=t.source.label}),o.delegate("execute").to(this),rd(o,n),o}_getCharacterGroupListItemDefinitions(t,e){const i=new xi;for(const o of e){const e={type:"button",model:new vu({label:o,withText:!0})};e.model.bind("isOn").to(t,"value",t=>t===e.model.label),i.add(e)}return i}}i(108);class Gp extends xc{constructor(t){super(t),this.tiles=this.createCollection(),this.setTemplate({tag:"div",children:[{tag:"div",attributes:{class:["ck","ck-character-grid__tiles"]},children:this.tiles}],attributes:{class:["ck","ck-character-grid"]}})}createTile(t,e){const i=new Kc(this.locale);return i.set({label:t,withText:!0,class:"ck-character-grid__tile"}),i.extendTemplate({attributes:{title:e},on:{mouseover:i.bindTemplate.to("mouseover")}}),i.on("mouseover",()=>{this.fire("tileHover",{name:e,character:t})}),i.on("execute",()=>{this.fire("execute",{name:e,character:t})}),i}}i(110);class Yp extends xc{constructor(t){super(t);const e=this.bindTemplate;this.set("character",null),this.set("name",null),this.bind("code").to(this,"character",Kp),this.setTemplate({tag:"div",children:[{tag:"span",attributes:{class:["ck-character-info__name"]},children:[{text:e.to("name",t=>t||"​")}]},{tag:"span",attributes:{class:["ck-character-info__code"]},children:[{text:e.to("code")}]}],attributes:{class:["ck","ck-character-info"]}})}}function Kp(t){if(null===t)return"";return"U+"+("0000"+t.codePointAt(0).toString(16)).slice(-4)}i(112);class Qp extends ud{init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Arrows",[{title:e("leftwards double arrow"),character:"⇐"},{title:e("rightwards double arrow"),character:"⇒"},{title:e("upwards double arrow"),character:"⇑"},{title:e("downwards double arrow"),character:"⇓"},{title:e("leftwards dashed arrow"),character:"⇠"},{title:e("rightwards dashed arrow"),character:"⇢"},{title:e("upwards dashed arrow"),character:"⇡"},{title:e("downwards dashed arrow"),character:"⇣"},{title:e("leftwards arrow to bar"),character:"⇤"},{title:e("rightwards arrow to bar"),character:"⇥"},{title:e("upwards arrow to bar"),character:"⤒"},{title:e("downwards arrow to bar"),character:"⤓"},{title:e("up down arrow with base"),character:"↨"},{title:e("back with leftwards arrow above"),character:"🔙"},{title:e("end with leftwards arrow above"),character:"🔚"},{title:e("on with exclamation mark with left right arrow above"),character:"🔛"},{title:e("soon with rightwards arrow above"),character:"🔜"},{title:e("top with upwards arrow above"),character:"🔝"}])}}class Jp extends ud{init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Currency",[{character:"$",title:e("Dollar sign")},{character:"€",title:e("Euro sign")},{character:"¥",title:e("Yen sign")},{character:"£",title:e("Pound sign")},{character:"¢",title:e("Cent sign")},{character:"₠",title:e("Euro-currency sign")},{character:"₡",title:e("Colon sign")},{character:"₢",title:e("Cruzeiro sign")},{character:"₣",title:e("French franc sign")},{character:"₤",title:e("Lira sign")},{character:"¤",title:e("Currency sign")},{character:"₿",title:e("Bitcoin sign")},{character:"₥",title:e("Mill sign")},{character:"₦",title:e("Naira sign")},{character:"₧",title:e("Peseta sign")},{character:"₨",title:e("Rupee sign")},{character:"₩",title:e("Won sign")},{character:"₪",title:e("New sheqel sign")},{character:"₫",title:e("Dong sign")},{character:"₭",title:e("Kip sign")},{character:"₮",title:e("Tugrik sign")},{character:"₯",title:e("Drachma sign")},{character:"₰",title:e("German penny sign")},{character:"₱",title:e("Peso sign")},{character:"₲",title:e("Guarani sign")},{character:"₳",title:e("Austral sign")},{character:"₴",title:e("Hryvnia sign")},{character:"₵",title:e("Cedi sign")},{character:"₶",title:e("Livre tournois sign")},{character:"₷",title:e("Spesmilo sign")},{character:"₸",title:e("Tenge sign")},{character:"₹",title:e("Indian rupee sign")},{character:"₺",title:e("Turkish lira sign")},{character:"₻",title:e("Nordic mark sign")},{character:"₼",title:e("Manat sign")},{character:"₽",title:e("Ruble sign")}])}}class Zp extends ud{init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Mathematical",[{character:"<",title:e("Less-than sign")},{character:">",title:e("Greater-than sign")},{character:"≤",title:e("Less-than or equal to")},{character:"≥",title:e("Greater-than or equal to")},{character:"–",title:e("En dash")},{character:"—",title:e("Em dash")},{character:"¯",title:e("Macron")},{character:"‾",title:e("Overline")},{character:"°",title:e("Degree sign")},{character:"−",title:e("Minus sign")},{character:"±",title:e("Plus-minus sign")},{character:"÷",title:e("Division sign")},{character:"⁄",title:e("Fraction slash")},{character:"×",title:e("Multiplication sign")},{character:"ƒ",title:e("Latin small letter f with hook")},{character:"∫",title:e("Integral")},{character:"∑",title:e("N-ary summation")},{character:"∞",title:e("Infinity")},{character:"√",title:e("Square root")},{character:"∼",title:e("Tilde operator")},{character:"≅",title:e("Approximately equal to")},{character:"≈",title:e("Almost equal to")},{character:"≠",title:e("Not equal to")},{character:"≡",title:e("Identical to")},{character:"∈",title:e("Element of")},{character:"∉",title:e("Not an element of")},{character:"∋",title:e("Contains as member")},{character:"∏",title:e("N-ary product")},{character:"∧",title:e("Logical and")},{character:"∨",title:e("Logical or")},{character:"¬",title:e("Not sign")},{character:"∩",title:e("Intersection")},{character:"∪",title:e("Union")},{character:"∂",title:e("Partial differential")},{character:"∀",title:e("For all")},{character:"∃",title:e("There exists")},{character:"∅",title:e("Empty set")},{character:"∇",title:e("Nabla")},{character:"∗",title:e("Asterisk operator")},{character:"∝",title:e("Proportional to")},{character:"∠",title:e("Angle")},{character:"¼",title:e("Vulgar fraction one quarter")},{character:"½",title:e("Vulgar fraction one half")},{character:"¾",title:e("Vulgar fraction three quarters")}])}}class Xp extends ud{init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Latin",[{character:"Ā",title:e("Latin capital letter a with macron")},{character:"ā",title:e("Latin small letter a with macron")},{character:"Ă",title:e("Latin capital letter a with breve")},{character:"ă",title:e("Latin small letter a with breve")},{character:"Ą",title:e("Latin capital letter a with ogonek")},{character:"ą",title:e("Latin small letter a with ogonek")},{character:"Ć",title:e("Latin capital letter c with acute")},{character:"ć",title:e("Latin small letter c with acute")},{character:"Ĉ",title:e("Latin capital letter c with circumflex")},{character:"ĉ",title:e("Latin small letter c with circumflex")},{character:"Ċ",title:e("Latin capital letter c with dot above")},{character:"ċ",title:e("Latin small letter c with dot above")},{character:"Č",title:e("Latin capital letter c with caron")},{character:"č",title:e("Latin small letter c with caron")},{character:"Ď",title:e("Latin capital letter d with caron")},{character:"ď",title:e("Latin small letter d with caron")},{character:"Đ",title:e("Latin capital letter d with stroke")},{character:"đ",title:e("Latin small letter d with stroke")},{character:"Ē",title:e("Latin capital letter e with macron")},{character:"ē",title:e("Latin small letter e with macron")},{character:"Ĕ",title:e("Latin capital letter e with breve")},{character:"ĕ",title:e("Latin small letter e with breve")},{character:"Ė",title:e("Latin capital letter e with dot above")},{character:"ė",title:e("Latin small letter e with dot above")},{character:"Ę",title:e("Latin capital letter e with ogonek")},{character:"ę",title:e("Latin small letter e with ogonek")},{character:"Ě",title:e("Latin capital letter e with caron")},{character:"ě",title:e("Latin small letter e with caron")},{character:"Ĝ",title:e("Latin capital letter g with circumflex")},{character:"ĝ",title:e("Latin small letter g with circumflex")},{character:"Ğ",title:e("Latin capital letter g with breve")},{character:"ğ",title:e("Latin small letter g with breve")},{character:"Ġ",title:e("Latin capital letter g with dot above")},{character:"ġ",title:e("Latin small letter g with dot above")},{character:"Ģ",title:e("Latin capital letter g with cedilla")},{character:"ģ",title:e("Latin small letter g with cedilla")},{character:"Ĥ",title:e("Latin capital letter h with circumflex")},{character:"ĥ",title:e("Latin small letter h with circumflex")},{character:"Ħ",title:e("Latin capital letter h with stroke")},{character:"ħ",title:e("Latin small letter h with stroke")},{character:"Ĩ",title:e("Latin capital letter i with tilde")},{character:"ĩ",title:e("Latin small letter i with tilde")},{character:"Ī",title:e("Latin capital letter i with macron")},{character:"ī",title:e("Latin small letter i with macron")},{character:"Ĭ",title:e("Latin capital letter i with breve")},{character:"ĭ",title:e("Latin small letter i with breve")},{character:"Į",title:e("Latin capital letter i with ogonek")},{character:"į",title:e("Latin small letter i with ogonek")},{character:"İ",title:e("Latin capital letter i with dot above")},{character:"ı",title:e("Latin small letter dotless i")},{character:"IJ",title:e("Latin capital ligature ij")},{character:"ij",title:e("Latin small ligature ij")},{character:"Ĵ",title:e("Latin capital letter j with circumflex")},{character:"ĵ",title:e("Latin small letter j with circumflex")},{character:"Ķ",title:e("Latin capital letter k with cedilla")},{character:"ķ",title:e("Latin small letter k with cedilla")},{character:"ĸ",title:e("Latin small letter kra")},{character:"Ĺ",title:e("Latin capital letter l with acute")},{character:"ĺ",title:e("Latin small letter l with acute")},{character:"Ļ",title:e("Latin capital letter l with cedilla")},{character:"ļ",title:e("Latin small letter l with cedilla")},{character:"Ľ",title:e("Latin capital letter l with caron")},{character:"ľ",title:e("Latin small letter l with caron")},{character:"Ŀ",title:e("Latin capital letter l with middle dot")},{character:"ŀ",title:e("Latin small letter l with middle dot")},{character:"Ł",title:e("Latin capital letter l with stroke")},{character:"ł",title:e("Latin small letter l with stroke")},{character:"Ń",title:e("Latin capital letter n with acute")},{character:"ń",title:e("Latin small letter n with acute")},{character:"Ņ",title:e("Latin capital letter n with cedilla")},{character:"ņ",title:e("Latin small letter n with cedilla")},{character:"Ň",title:e("Latin capital letter n with caron")},{character:"ň",title:e("Latin small letter n with caron")},{character:"ʼn",title:e("Latin small letter n preceded by apostrophe")},{character:"Ŋ",title:e("Latin capital letter eng")},{character:"ŋ",title:e("Latin small letter eng")},{character:"Ō",title:e("Latin capital letter o with macron")},{character:"ō",title:e("Latin small letter o with macron")},{character:"Ŏ",title:e("Latin capital letter o with breve")},{character:"ŏ",title:e("Latin small letter o with breve")},{character:"Ő",title:e("Latin capital letter o with double acute")},{character:"ő",title:e("Latin small letter o with double acute")},{character:"Œ",title:e("Latin capital ligature oe")},{character:"œ",title:e("Latin small ligature oe")},{character:"Ŕ",title:e("Latin capital letter r with acute")},{character:"ŕ",title:e("Latin small letter r with acute")},{character:"Ŗ",title:e("Latin capital letter r with cedilla")},{character:"ŗ",title:e("Latin small letter r with cedilla")},{character:"Ř",title:e("Latin capital letter r with caron")},{character:"ř",title:e("Latin small letter r with caron")},{character:"Ś",title:e("Latin capital letter s with acute")},{character:"ś",title:e("Latin small letter s with acute")},{character:"Ŝ",title:e("Latin capital letter s with circumflex")},{character:"ŝ",title:e("Latin small letter s with circumflex")},{character:"Ş",title:e("Latin capital letter s with cedilla")},{character:"ş",title:e("Latin small letter s with cedilla")},{character:"Š",title:e("Latin capital letter s with caron")},{character:"š",title:e("Latin small letter s with caron")},{character:"Ţ",title:e("Latin capital letter t with cedilla")},{character:"ţ",title:e("Latin small letter t with cedilla")},{character:"Ť",title:e("Latin capital letter t with caron")},{character:"ť",title:e("Latin small letter t with caron")},{character:"Ŧ",title:e("Latin capital letter t with stroke")},{character:"ŧ",title:e("Latin small letter t with stroke")},{character:"Ũ",title:e("Latin capital letter u with tilde")},{character:"ũ",title:e("Latin small letter u with tilde")},{character:"Ū",title:e("Latin capital letter u with macron")},{character:"ū",title:e("Latin small letter u with macron")},{character:"Ŭ",title:e("Latin capital letter u with breve")},{character:"ŭ",title:e("Latin small letter u with breve")},{character:"Ů",title:e("Latin capital letter u with ring above")},{character:"ů",title:e("Latin small letter u with ring above")},{character:"Ű",title:e("Latin capital letter u with double acute")},{character:"ű",title:e("Latin small letter u with double acute")},{character:"Ų",title:e("Latin capital letter u with ogonek")},{character:"ų",title:e("Latin small letter u with ogonek")},{character:"Ŵ",title:e("Latin capital letter w with circumflex")},{character:"ŵ",title:e("Latin small letter w with circumflex")},{character:"Ŷ",title:e("Latin capital letter y with circumflex")},{character:"ŷ",title:e("Latin small letter y with circumflex")},{character:"Ÿ",title:e("Latin capital letter y with diaeresis")},{character:"Ź",title:e("Latin capital letter z with acute")},{character:"ź",title:e("Latin small letter z with acute")},{character:"Ż",title:e("Latin capital letter z with dot above")},{character:"ż",title:e("Latin small letter z with dot above")},{character:"Ž",title:e("Latin capital letter z with caron")},{character:"ž",title:e("Latin small letter z with caron")},{character:"ſ",title:e("Latin small letter long s")}])}}class tb extends ud{init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Text",[{character:"‹",title:e("Single left-pointing angle quotation mark")},{character:"›",title:e("Single right-pointing angle quotation mark")},{character:"«",title:e("Left-pointing double angle quotation mark")},{character:"»",title:e("Right-pointing double angle quotation mark")},{character:"‘",title:e("Left single quotation mark")},{character:"’",title:e("Right single quotation mark")},{character:"“",title:e("Left double quotation mark")},{character:"”",title:e("Right double quotation mark")},{character:"‚",title:e("Single low-9 quotation mark")},{character:"„",title:e("Double low-9 quotation mark")},{character:"¡",title:e("Inverted exclamation mark")},{character:"¿",title:e("Inverted question mark")},{character:"‥",title:e("Two dot leader")},{character:"…",title:e("Horizontal ellipsis")},{character:"‡",title:e("Double dagger")},{character:"‰",title:e("Per mille sign")},{character:"‱",title:e("Per ten thousand sign")},{character:"‼",title:e("Double exclamation mark")},{character:"⁈",title:e("Question exclamation mark")},{character:"⁉",title:e("Exclamation question mark")},{character:"⁇",title:e("Double question mark")},{character:"©",title:e("Copyright sign")},{character:"®",title:e("Registered sign")},{character:"™",title:e("Trade mark sign")},{character:"§",title:e("Section sign")},{character:"¶",title:e("Paragraph sign")},{character:"⁋",title:e("Reversed paragraph sign")}])}}class eb extends md{constructor(t){super(t),this._selectedElements=[],this.on("execute",()=>{this.refresh()},{priority:"highest"})}refresh(){this._selectedElements=this._getSelectedItems(),this.value=this._selectedElements.every(t=>!!t.getAttribute("todoListChecked")),this.isEnabled=!!this._selectedElements.length}_getSelectedItems(){const t=this.editor.model,e=t.schema,i=t.document.selection.getFirstRange(),o=i.start.parent,n=[];e.checkAttribute(o,"todoListChecked")&&n.push(o);for(const t of i.getItems())e.checkAttribute(t,"todoListChecked")&&!n.includes(t)&&n.push(t);return n}execute(t={}){this.editor.model.change(e=>{for(const i of this._selectedElements){(void 0===t.forceValue?!this.value:t.forceValue)?e.setAttribute("todoListChecked",!0,i):e.removeAttribute("todoListChecked",i)}})}}function ib(t,e,i){const o=e.modelCursor,n=o.parent,r=e.viewItem;if("checkbox"!=r.getAttribute("type")||"listItem"!=n.name||!o.isAtStart)return;if(!i.consumable.consume(r,{name:!0}))return;const s=i.writer;s.setAttribute("listType","todo",n),e.viewItem.hasAttribute("checked")&&s.setAttribute("todoListChecked",!0,n),e.modelRange=s.createRange(o)}function ob(t){return(e,i)=>{const o=i.modelPosition,n=o.parent;if(!n.is("element","listItem")||"todo"!=n.getAttribute("listType"))return;const r=rb(i.mapper.toViewElement(n),t);r&&(i.viewPosition=i.mapper.findPositionIn(r,o.offset))}}function nb(t,e,i,o){return e.createUIElement("label",{class:"todo-list__label",contenteditable:!1},(function(e){const n=Tc(document,"input",{type:"checkbox"});i&&n.setAttribute("checked","checked"),n.addEventListener("change",()=>o(t));const r=this.toDomElement(e);return r.appendChild(n),r}))}function rb(t,e){const i=e.createRangeIn(t);for(const t of i)if(t.item.is("containerElement","span")&&t.item.hasClass("todo-list__label__description"))return t.item}class sb extends ud{static get pluginName(){return"TodoListEditing"}static get requires(){return[bp]}init(){const t=this.editor,{editing:e,data:i,model:o}=t;var n,r;o.schema.extend("listItem",{allowAttributes:["todoListChecked"]}),o.schema.addAttributeCheck((t,e)=>{const i=t.last;if("todoListChecked"==e&&"listItem"==i.name&&"todo"!=i.getAttribute("listType"))return!1}),t.commands.add("todoList",new Wf(t,"todo")),t.commands.add("todoListCheck",new eb(t)),i.downcastDispatcher.on("insert:listItem",function(t){return(e,i,o)=>{const n=o.consumable;if(!n.test(i.item,"insert")||!n.test(i.item,"attribute:listType")||!n.test(i.item,"attribute:listIndent"))return;if("todo"!=i.item.getAttribute("listType"))return;const r=i.item;n.consume(r,"insert"),n.consume(r,"attribute:listType"),n.consume(r,"attribute:listIndent"),n.consume(r,"attribute:todoListChecked");const s=o.writer,a=Kf(r,o);s.addClass("todo-list",a.parent);const l=s.createContainerElement("label",{class:"todo-list__label"}),c=s.createEmptyElement("input",{type:"checkbox",disabled:"disabled"}),d=s.createContainerElement("span",{class:"todo-list__label__description"});r.getAttribute("todoListChecked")&&s.setAttribute("checked","checked",c),s.insert(s.createPositionAt(a,0),l),s.insert(s.createPositionAt(l,0),c),s.insert(s.createPositionAfter(c),d),Qf(r,a,o,t)}}(o),{priority:"high"}),i.upcastDispatcher.on("element:input",ib,{priority:"high"}),e.downcastDispatcher.on("insert:listItem",function(t,e){return(i,o,n)=>{const r=n.consumable;if(!r.test(o.item,"insert")||!r.test(o.item,"attribute:listType")||!r.test(o.item,"attribute:listIndent"))return;if("todo"!=o.item.getAttribute("listType"))return;const s=o.item;r.consume(s,"insert"),r.consume(s,"attribute:listType"),r.consume(s,"attribute:listIndent"),r.consume(s,"attribute:todoListChecked");const a=n.writer,l=Kf(s,n),c=!!s.getAttribute("todoListChecked"),d=nb(s,a,c,e),h=a.createContainerElement("span",{class:"todo-list__label__description"});a.addClass("todo-list",l.parent),a.insert(a.createPositionAt(l,0),d),a.insert(a.createPositionAfter(d),h),Qf(s,l,n,t)}}(o,t=>this._handleCheckmarkChange(t)),{priority:"high"}),e.downcastDispatcher.on("attribute:listType:listItem",(n=t=>this._handleCheckmarkChange(t),r=e.view,(t,e,i)=>{const o=i.mapper.toViewElement(e.item),s=i.writer,a=function(t,e){const i=e.createRangeIn(t);for(const t of i)if(t.item.is("uiElement","label"))return t.item}(o,r);if("todo"==e.attributeNewValue){const t=!!e.item.getAttribute("todoListChecked"),i=nb(e.item,s,t,n),r=s.createContainerElement("span",{class:"todo-list__label__description"}),a=s.createRangeIn(o),l=ep(o),c=Zf(a.start),d=l?s.createPositionBefore(l):a.end,h=s.createRange(c,d);s.addClass("todo-list",o.parent),s.move(h,s.createPositionAt(r,0)),s.insert(s.createPositionAt(o,0),i),s.insert(s.createPositionAfter(i),r)}else if("todo"==e.attributeOldValue){const t=rb(o,r);s.removeClass("todo-list",o.parent),s.remove(a),s.move(s.createRangeIn(t),s.createPositionBefore(t)),s.remove(t)}})),e.downcastDispatcher.on("attribute:todoListChecked:listItem",function(t){return(e,i,o)=>{if("todo"!=i.item.getAttribute("listType"))return;if(!o.consumable.consume(i.item,"attribute:todoListChecked"))return;const{mapper:n,writer:r}=o,s=!!i.item.getAttribute("todoListChecked"),a=n.toViewElement(i.item).getChild(0),l=nb(i.item,r,s,t);r.insert(r.createPositionAfter(a),l),r.remove(a)}}(t=>this._handleCheckmarkChange(t))),e.mapper.on("modelToViewPosition",ob(e.view)),i.mapper.on("modelToViewPosition",ob(e.view)),this.listenTo(e.view.document,"keydown",function(t,e){return(i,o)=>{if("left"!=vn(o.keyCode,e.contentLanguageDirection))return;const n=t.schema,r=t.document.selection;if(!r.isCollapsed)return;const s=r.getFirstPosition(),a=s.parent;if("listItem"===a.name&&"todo"==a.getAttribute("listType")&&s.isAtStart){const e=n.getNearestSelectionRange(t.createPositionBefore(a),"backward");e&&t.change(t=>t.setSelection(e)),o.preventDefault(),o.stopPropagation(),i.stop()}}}(o,t.locale)),t.keystrokes.set("Ctrl+space",()=>t.execute("todoListCheck"));const s=new Set;this.listenTo(o,"applyOperation",(t,e)=>{const i=e[0];if("rename"==i.type&&"listItem"==i.oldName){const t=i.position.nodeAfter;t.hasAttribute("todoListChecked")&&s.add(t)}else if("changeAttribute"==i.type&&"listType"==i.key&&"todo"===i.oldValue)for(const t of i.range.getItems())t.hasAttribute("todoListChecked")&&"todo"!==t.getAttribute("listType")&&s.add(t)}),o.document.registerPostFixer(t=>{let e=!1;for(const i of s)t.removeAttribute("todoListChecked",i),e=!0;return s.clear(),e})}_handleCheckmarkChange(t){const e=this.editor,i=e.model,o=Array.from(i.document.selection.getRanges());i.change(i=>{i.setSelection(t,"end"),e.execute("todoListCheck"),i.setSelection(o)})}}class ab extends ud{init(){const t=this.editor.t;tp(this.editor,"todoList",t("To-do List"),'')}}i(114);class lb extends ud{static get pluginName(){return"UnderlineEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"underline"}),t.model.schema.setAttributeProperties("underline",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"underline",view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),t.commands.add("underline",new Id(t,"underline")),t.keystrokes.set("CTRL+U","underline")}}class cb extends ud{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("underline",i=>{const o=t.commands.get("underline"),n=new Kc(i);return n.set({label:e("Underline"),icon:'',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),n.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(n,"execute",()=>{t.execute("underline"),t.editing.view.focus()}),n})}}class db extends ud{static get pluginName(){return"Autosave"}static get requires(){return[Mm]}constructor(t){super(t);const e=t.config.get("autosave")||{},i=e.waitingTime||1e3;this.set("state","synchronized"),this._debouncedSave=Kr(this._save.bind(this),i),this._lastDocumentVersion=t.model.document.version,this._domEmitter=Object.create(mr),this._config=e}init(){const t=this.editor,e=t.model.document,i=t.t;this._pendingActions=t.plugins.get(Mm),this.listenTo(e,"change:data",()=>{this._saveCallbacks.length&&("synchronized"==this.state?(this._action=this._pendingActions.add(i("Saving changes")),this.state="waiting",this._debouncedSave()):"waiting"==this.state&&this._debouncedSave())}),this.listenTo(t,"destroy",()=>this._flush(),{priority:"highest"}),this._domEmitter.listenTo(window,"beforeunload",(t,e)=>{this._pendingActions.hasAny&&(e.returnValue=this._pendingActions.first.message)})}destroy(){this._domEmitter.stopListening(),super.destroy()}_flush(){this._debouncedSave.flush()}_save(){const t=this.editor.model.document.version;tPromise.all(this._saveCallbacks.map(t=>t(this.editor)))).catch(t=>{throw this.state="error",this.state="saving",this._debouncedSave(),t}).then(()=>{this.editor.model.document.version>this._lastDocumentVersion?(this.state="waiting",this._debouncedSave()):(this.state="synchronized",this._pendingActions.remove(this._action),this._action=null)}))}get _saveCallbacks(){const t=[];return this.adapter&&this.adapter.save&&t.push(this.adapter.save),this._config.save&&t.push(this._config.save),t}}yi(db,Uo);class hb extends hd{}hb.builtinPlugins=[class extends ud{static get requires(){return[vd,Td]}static get pluginName(){return"Alignment"}},class extends ud{static get requires(){return[Md,Ld]}static get pluginName(){return"BlockQuote"}},class extends ud{static get requires(){return[Nd,zd]}static get pluginName(){return"Bold"}},class extends ud{static get requires(){return[jd,qd,th,Yd,mh,Oh]}static get pluginName(){return"Essentials"}},class extends ud{static get requires(){return[cu,uu]}static get pluginName(){return"FontBackgroundColor"}},class extends ud{static get requires(){return[mu,fu]}static get pluginName(){return"FontColor"}},class extends ud{static get requires(){return[_u,yu]}static get pluginName(){return"FontFamily"}},class extends ud{static get requires(){return[Su,Pu]}static get pluginName(){return"FontSize"}},class extends ud{static get requires(){return[Ou,Ru]}static get pluginName(){return"Heading"}},class extends ud{static get requires(){return[Vu,Bu]}static get pluginName(){return"Highlight"}},class extends ud{static get requires(){return[ag,lg]}static get pluginName(){return"HorizontalLine"}},class extends ud{static get requires(){return[bg,Cg,qg]}static get pluginName(){return"Image"}},class extends ud{static get requires(){return[Gg]}static get pluginName(){return"ImageCaption"}},class extends ud{static get requires(){return[Xg,cm,im]}static get pluginName(){return"ImageResize"}},class extends ud{static get requires(){return[_m,vm]}static get pluginName(){return"ImageStyle"}},class extends ud{static get requires(){return[ym]}static get pluginName(){return"ImageToolbar"}afterInit(){const t=this.editor,e=t.t;t.plugins.get(ym).register("image",{ariaLabel:e("Image toolbar"),items:t.config.get("image.toolbar")||[],getRelatedElement:dg})}},class extends ud{static get pluginName(){return"ImageUpload"}static get requires(){return[qm,Pm,zm]}},class extends ud{static get requires(){return[$m,Gm]}static get pluginName(){return"Italic"}},class extends ud{static get requires(){return[If,Vf,Uf]}static get pluginName(){return"Link"}},class extends ud{static get requires(){return[bp,vp]}static get pluginName(){return"List"}},class extends ud{static get requires(){return[xp,Ep]}static get pluginName(){return"ListStyle"}},class extends ud{static get requires(){return[jp,Up,Fp,Cg]}static get pluginName(){return"MediaEmbed"}},class extends ud{static get requires(){return[ym]}static get pluginName(){return"MediaEmbedToolbar"}afterInit(){const t=this.editor,e=t.t;t.plugins.get(ym).register("mediaEmbed",{ariaLabel:e("Media toolbar"),items:t.config.get("mediaEmbed.toolbar")||[],getRelatedElement:Ip})}},Iu,class extends ud{static get requires(){return[Im]}static get pluginName(){return"SimpleUploadAdapter"}init(){const t=this.editor.config.get("simpleUpload");t&&(t.uploadUrl?this.editor.plugins.get(Im).createUploadAdapter=e=>new qp(e,t):Object(hi.c)("simple-upload-adapter-missing-uploadurl"))}},class extends ud{static get requires(){return[mh]}static get pluginName(){return"SpecialCharacters"}constructor(t){super(t),this._characters=new Map,this._groups=new Map}init(){const t=this.editor,e=t.t,i=t.commands.get("input");t.ui.componentFactory.add("specialCharacters",o=>{const n=od(o);let r;return n.buttonView.set({label:e("Special characters"),icon:'',tooltip:!0}),n.bind("isEnabled").to(i),n.on("execute",(e,i)=>{t.execute("input",{text:i.character}),t.editing.view.focus()}),n.on("change:isOpen",()=>{r||(r=this._createDropdownPanelContent(o,n),n.panelView.children.add(r.navigationView),n.panelView.children.add(r.gridView),n.panelView.children.add(r.infoView)),r.infoView.set({character:null,name:null})}),n})}addItems(t,e){if("All"===t)throw new hi.a('special-character-invalid-group-name: The name "All" is reserved and cannot be used.');const i=this._getGroup(t);for(const t of e)i.add(t.title),this._characters.set(t.title,t.character)}getGroups(){return this._groups.keys()}getCharactersForGroup(t){return"All"===t?new Set(this._characters.keys()):this._groups.get(t)}getCharacter(t){return this._characters.get(t)}_getGroup(t){return this._groups.has(t)||this._groups.set(t,new Set),this._groups.get(t)}_updateGrid(t,e){e.tiles.clear();const i=this.getCharactersForGroup(t);for(const t of i){const i=this.getCharacter(t);e.tiles.add(e.createTile(i,t))}}_createDropdownPanelContent(t,e){const i=[...this.getGroups()];i.unshift("All");const o=new $p(t,i),n=new Gp(t),r=new Yp(t);return n.delegate("execute").to(e),n.on("tileHover",(t,e)=>{r.set(e)}),o.on("execute",()=>{this._updateGrid(o.currentGroupName,n)}),this._updateGrid(o.currentGroupName,n),{navigationView:o,gridView:n,infoView:r}}},Qp,Jp,class extends ud{static get requires(){return[Jp,tb,Zp,Qp,Xp]}},Xp,class extends ud{static get requires(){return[sb,ab]}static get pluginName(){return"TodoList"}},class extends ud{static get requires(){return[lb,cb]}static get pluginName(){return"Underline"}},class extends ud{constructor(t){super(t),this.isview=!1,this.codeview=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}static get pluginName(){return"ViewSource"}init(){this.editor.ui.componentFactory.add("viewSource",t=>{const e=new Kc(t);return e.set({label:"Voir/Masquer sources",icon:'\n',tooltip:!0}),e.on("execute",()=>{var t;this.isview?(t=(t=(t=(t=this.editor.getData()).replaceAll("<","<")).replaceAll(">",">")).replaceAll("

 

",""),this.editor.setData(t),this.isview=!1):(t=(t=(t=(t=this.editor.getData()).replaceAll("

 

","")).replaceAll("<","<")).replaceAll(">",">"),this.isview=!0,this.editor.setData(t))}),e})}},db],hb.defaultConfig={toolbar:{items:["viewSource","heading","|","fontBackgroundColor","fontFamily","fontSize","fontColor","highlight","|","bold","underline","italic","horizontalLine","|","link","bulletedList","todoList","numberedList","|","blockQuote","mediaEmbed","undo","redo"]},language:"fr",image:{toolbar:["imageTextAlternative","imageStyle:full","imageStyle:side"]},licenseKey:"",simpleUpload:{uploadUrl:"index.php?action=uploadCKImg",withCredentials:!1,headers:{"X-CSRF-TOKEN":"CSFR-Token",Authorization:""}}}}]).default})); +//# sourceMappingURL=ckeditor.js.map \ No newline at end of file diff --git a/admin/assets/js/ckeditorManager.php b/admin/assets/js/ckeditorManager.php index fe4e4179..f909056c 100644 --- a/admin/assets/js/ckeditorManager.php +++ b/admin/assets/js/ckeditorManager.php @@ -1,58 +1,57 @@ \ No newline at end of file diff --git a/admin/assets/js/main.js b/admin/assets/js/main.js index 34ea76e5..484f96d2 100644 --- a/admin/assets/js/main.js +++ b/admin/assets/js/main.js @@ -46,6 +46,7 @@ $(document).ready(function() { }); + function boutiqueUpdate() { destroyCK(); updateCont("admin.php?action=getOffreBoutique", get("allcategorie"), function(data) { if(data) { diff --git a/admin/assets/js/membres.php b/admin/assets/js/membres.php index fe76b887..95cfef3b 100644 --- a/admin/assets/js/membres.php +++ b/admin/assets/js/membres.php @@ -253,4 +253,4 @@ function setMaxShow(id) { updateIndex(); } } - \ No newline at end of file + diff --git a/admin/donnees/accueil.php b/admin/donnees/accueil.php index a4d75a7b..d6dd8a02 100644 --- a/admin/donnees/accueil.php +++ b/admin/donnees/accueil.php @@ -2,6 +2,12 @@ $lectureAccueil = new Lire('modele/config/accueil.yml'); $lectureAccueil = $lectureAccueil->GetTableau(); + for($i = 1;$i < count($lectureAccueil['Infos']) + 1;$i++) { + if($lectureAccueil['Infos'][$i]['type'] == "page") { + $pageActive[$i] = $lectureAccueil['Infos'][$i]['lien']; + } + } + $images = scandir('theme/upload/navRap/'); // $imagesSlider = scandir('theme/upload/slider'); diff --git a/admin/donnees/grades.php b/admin/donnees/grades.php index 7fdb77f7..f60e52bd 100644 --- a/admin/donnees/grades.php +++ b/admin/donnees/grades.php @@ -41,6 +41,8 @@ $PermissionFormat["PermsPanel-menus-actions"]="Actions"; $PermissionFormat["PermsPanel-vote"]="Page Vote"; $PermissionFormat["PermsPanel-vote-actions"]="Actions"; + $PermissionFormat['PermsPanel-vote-voteHistory']="Page historique des votes"; + $PermissionFormat['PermsPanel-vote-voteHistory-actions']="Actions"; $PermissionFormat['PermsPanel-vote-recompenseAuto']="Page récompense Automatique"; $PermissionFormat['PermsPanel-vote-recompenseAuto-actions']="Actions"; $PermissionFormat["PermsPanel-members"]="Page Membres"; @@ -253,4 +255,4 @@ function writePerm($perm, $nb, $id, $other, $idGrade, $PermissionFormat) { } } -?> \ No newline at end of file +?> diff --git a/admin/include/side.php b/admin/include/side.php index 39744962..22bb9649 100644 --- a/admin/include/side.php +++ b/admin/include/side.php @@ -13,7 +13,7 @@

- + gradeJoueur($_Joueur_['pseudo']); ?>

@@ -86,7 +86,7 @@ @@ -148,7 +148,7 @@ class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt verifPerm('PermsPanel', 'vote', 'recompenseAuto', 'showPage')) { ?> - Récompences automatique + Récompenses automatique verifPerm('PermsPanel', 'vote', 'voteHistory', 'showPage')) { ?> @@ -246,4 +246,4 @@ class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt - \ No newline at end of file + diff --git a/admin/index.php b/admin/index.php index f3b043a5..631b2b11 100644 --- a/admin/index.php +++ b/admin/index.php @@ -21,7 +21,7 @@ '; } ?> - +
+ initPost("changeInfo", "admin.php?action=general",null);
@@ -169,7 +169,7 @@ function testMail() { if(data == "1") { alert("Le mail a bien été envoyé !"); } else { - alert("Le mail n'a pas été envoyé, avez vous mis à jour les informations ? ou avez vous bien rentré les informations ?"); + alert("Le mail n'a pas été envoyé, avez vous mis à jour les informations ? Avez-vous bien entré les informations ?"); } get('btn-mail').disabled = false; }); @@ -213,7 +213,7 @@ function testMail() {
@@ -243,7 +243,7 @@ function testMail() {
- CraftMyWebSite a d'intégré un système d'upload d'image dans son éditeur de texte, vous pouvez éditer ces paramètre ici. Sachez que lorsque la taille total des fichiers dépasses la taille maximal de l'espace de stockage les plus anciennes images sont supprimé à jamais jusqu'a rétablir l'équilibre. + CraftMyWebSite a d'intégré un système d'upload d'image dans son éditeur de texte, vous pouvez éditer ces paramètres ici. Sachez que lorsque la taille total des fichiers dépasse la taille maximale de l'espace de stockage, les plus anciennes images sont supprimées à jamais jusqu'à rétablir l'équilibre.
  • Nombre total de fichier:
  • @@ -251,15 +251,15 @@ function testMail() {
+ ">Supprimer tous les fichiers (irréversible)
- + - + @@ -269,7 +269,7 @@ function(data) { if(data) { get('allf').innerText = '0';get('alls').innerText = registerEvent(get('rangeInput2'), ["change", "keyup", "input"], function(evt) { let nb = parseInt(evt.target.value);if(nb>=1000) { if(nb>=1000000){get('rangValue2').innerText = (nb / 1000000)+"GB";} else {get('rangValue2').innerText = (nb / 1000)+"MB";}} else {get('rangValue2').innerText = nb+"KB";}}); initPost("panel-upload", "admin.php?action=editUploadImage"); diff --git a/admin/pages/informations.php b/admin/pages/informations.php index 9b70b000..b27226d1 100644 --- a/admin/pages/informations.php +++ b/admin/pages/informations.php @@ -212,7 +212,7 @@ function (data) { if(data) { - verifPerm('PermsPanel', 'info', 'details', 'player') OR $_Permission_->verifPerm('PermsPanel', 'info', 'details', 'console') OR $_Permission_->verifPerm('PermsPanel', 'info', 'details', 'command') OR $_Permission_->verifPerm('PermsPanel', 'info', 'details', 'plugins') OR $_Permission_('PermsPanel', 'info', 'details', 'server')) { + verifPerm('PermsPanel', 'info', 'details', 'player') OR $_Permission_->verifPerm('PermsPanel', 'info', 'details', 'console') OR $_Permission_->verifPerm('PermsPanel', 'info', 'details', 'command') OR $_Permission_->verifPerm('PermsPanel', 'info', 'details', 'plugins') OR $_Permission_->verifPerm('PermsPanel', 'info', 'details', 'server')) { ?> + ?> - + diff --git a/admin/pages/update.php b/admin/pages/update.php index 893c8b1a..7b693707 100644 --- a/admin/pages/update.php +++ b/admin/pages/update.php @@ -1,34 +1,203 @@ +

- Mise à jour CraftMyWebsite + Mise à jour CraftMyWebsite

verifPerm('PermsPanel', 'update', 'showPage')) { ?> - -
-
-
- Vous avez aucune permission pour accéder à cette page. -
+ +
+
+
+ Vous avez aucune permission pour accéder à cette page.
+
-
+
-
- + -
- Votre CMS CraftMyWebsite est bien a jours en version ! -
+
+ Votre CMS CraftMyWebsite est bien a jours en version ! +
-
- Votre CMS CraftMyWebsite n'est PAS à jour ! Vous êtes en et la dernière version est la ! Attention, les mises à jour ne se font pas automatiquement !Cliquez ici pour télécharger la mise à jour de la dernière version : CraftMyWebsite V - -
+
+ Votre CMS CraftMyWebsite n'est PAS à jour ! Vous êtes en et la dernière + version est la ! Attention, les mises à jour ne se font pas + automatiquement !Cliquez ici pour télécharger la mise à jour de la dernière version : + CraftMyWebsite V + +
-
+
+ +
+ + +
+

+ Contributeurs au CMS +

+
+ +
+
+
+ + + +
+
+
+ +
+
- \ No newline at end of file +
+ + \ No newline at end of file diff --git a/admin/pages/upload.php b/admin/pages/upload.php index fb685340..596b492f 100644 --- a/admin/pages/upload.php +++ b/admin/pages/upload.php @@ -19,21 +19,21 @@ Vous devez uploader un fichier de type png, gif, jpg ou jpeg...
"; + echo ""; break; case 1: - echo "
Le fichier est trop volumineux...
"; + echo ""; break; case 2: - echo "
L'image existe déjà. Changez le nom de l'image pour pouvoir continuer
"; + echo ""; break; case 3: - echo "
Echec de l'upload !
"; - break; - default: - echo "
Erreur inconnue!
"; + echo ""; break; + } +} else if(isset($_GET['success'])) { + echo ""; }?>
verifPerm('PermsPanel', "upload","manager")) { ?> @@ -55,15 +55,22 @@ while(false !== ($fichier = readdir($dossier))) { if(!is_dir($fichier) && $fichier != '.' && $fichier != '..' && $fichier != 'index.php' && $fichier != '.htaccess') {?> -
+
-
-
- Fichier: -
+
+
+
+
+ Fichier: +
+
+
+ +
+
-
+
- - - - - + + + + + + + + \ No newline at end of file +?> diff --git a/controleur/boutique/achat.php b/controleur/boutique/achat.php index 457a0c82..8934dfad 100644 --- a/controleur/boutique/achat.php +++ b/controleur/boutique/achat.php @@ -68,8 +68,10 @@ { $enligne[$key] = false; $serveurStats[$key] = $serveur->GetServeurInfos(); - if(isset($_Joueur_['pseudo']) AND isset($serveurStats[$key]['joueurs']) AND in_array($_Joueur_['pseudo'], $serveurStats[$key]['joueurs'])) + if(isset($_Joueur_['pseudo']) AND isset($serveurStats[$key]['joueurs']) AND !empty($serveurStats[$key]['joueurs']) AND in_array($_Joueur_['pseudo'], $serveurStats[$key]['joueurs'])) + { $enligne[$key] = true; + } } $infosOffre = $offres->GetInfosOffre($offre, $_Joueur_); $infosCategories = $categoriesObj->GetInfosCategorie($infosOffre['offre']['categorie'], $lectureJSON); diff --git a/controleur/config.php b/controleur/config.php index 8a32eaff..ad1b65d7 100644 --- a/controleur/config.php +++ b/controleur/config.php @@ -1,11 +1,7 @@ GetTableau(); + + if(!isset($_Serveur_['lastCMWCheck']) || (isset($_Serveur_['lastCMWCheck']) && $_Serveur_['lastCMWCheck'] < time())) { + $_Serveur_['lastCMWCheck'] = time() + 3600; + $ecriture = new Ecrire('modele/config/config.yml', $_Serveur_); + $URLWEBSITE = "http://".$_SERVER['HTTP_HOST']; + $SYSTEMINFO = ""; + if (function_exists('curl_init') and extension_loaded('curl')) { + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL,'https://craftmywebsite.fr/information/website.php?href='. $URLWEBSITE); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); + curl_setopt($ch, CURLOPT_TIMEOUT, 5); + + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); + + $output = curl_exec($ch); + curl_close($ch); + + $SYSTEMINFO = $output; + } else { + $SYSTEMINFO = @file_get_contents('https://craftmywebsite.fr/information/website.php?href='. $URLWEBSITE); + } + + if($SYSTEMINFO != ""){ + echo $SYSTEMINFO; + } + } + + // On effectue la même opération mais pour le fichier YML du menu. $configLecture = new Lire('./modele/config/configMenu.yml'); $_Menu_ = $configLecture->GetTableau(); @@ -59,25 +86,5 @@ setcookie('servOnline', $servEnLigne, time() + 120, null, null, false, true); } - function gradeJoueur($pseudo, $bdd) - { - global $_Serveur_; - $req = $bdd->prepare('SELECT rang FROM cmw_users WHERE pseudo = :pseudo'); - $req->execute(array('pseudo' => $pseudo )); - $joueurDonnees = $req->fetch(PDO::FETCH_ASSOC); - if($joueurDonnees['rang'] == 0) { - $gradeSite = $_Serveur_['General']['joueur']; - } elseif($joueurDonnees['rang'] == 1) { - $gradeSite = "".$_Serveur_['General']['createur']['nom'].""; - } elseif(fopen('./modele/grades/'.$joueurDonnees['rang'].'.yml', 'r')) { - $openGradeSite = new Lire('./modele/grades/'.$joueurDonnees['rang'].'.yml'); - $readGradeSite = $openGradeSite->GetTableau(); - $gradeSite = "".$readGradeSite['Grade'].""; - if(empty($readGradeSite['Grade'])) - $gradeSite = $_Serveur_['General']['joueur']; - } else { - $gradeSite = $_Serveur_['General']['joueur']; - } - return $gradeSite; - } + ?> diff --git a/controleur/forum/follow.php b/controleur/forum/follow.php index 63769d28..964c5511 100644 --- a/controleur/forum/follow.php +++ b/controleur/forum/follow.php @@ -17,7 +17,7 @@ 'id_topic' => $id, 'last_answer' => $reqd['id'] )); - header('Location: ?&page=post&id=' . $id . ''); + header('Location: ?&page=post&id=' . $id); } else header('Location: ?page=erreur&erreur=0'); diff --git a/controleur/forum/forum_signalement.php b/controleur/forum/forum_signalement.php index 8200ef1e..8deb4c6f 100644 --- a/controleur/forum/forum_signalement.php +++ b/controleur/forum/forum_signalement.php @@ -4,7 +4,7 @@ $id = htmlspecialchars($_POST['id_answer']); if(!isset($_GET['confirmation'])) { - header("Location: ?&page=confirmation&choix=4&id={$id}"); + header("Location: ?&page=confirmation&choix=4&id=".$_POST['id_answer']); } else { @@ -15,7 +15,7 @@ 'reason' => $reason, 'reporteur' => $_Joueur_['pseudo'] )); - header('Location: ?&page=forum'); + header('Location: ?&page=forum&postSignalement'); } } else diff --git a/controleur/forum/forum_signalement_topic.php b/controleur/forum/forum_signalement_topic.php index 93075548..89460518 100644 --- a/controleur/forum/forum_signalement_topic.php +++ b/controleur/forum/forum_signalement_topic.php @@ -3,7 +3,7 @@ { if(!isset($_GET['confirmation'])) { - header('Location: ?&page=confirmation&choix=5&id_topic=' . $_POST['id_topic2'] . ''); + header('Location: ?&page=confirmation&choix=5&id_topic2=' . $_POST['id_topic2'] . ''); } else { @@ -14,7 +14,7 @@ 'reason' => $reason, 'reporteur' => $_Joueur_['pseudo'] )); - header('Location: ?&page=forum'); + header('Location: ?&page=forum&postSignalement'); } } diff --git a/controleur/forum/post_answer.php b/controleur/forum/post_answer.php index b8b07483..5b00996d 100644 --- a/controleur/forum/post_answer.php +++ b/controleur/forum/post_answer.php @@ -11,7 +11,7 @@ $d = $req->fetch(PDO::FETCH_ASSOC); if($d["pseudo"] == $_Joueur_["pseudo"] AND !(strtotime($d['date_post'])+24*3600 <= time())) { - $contenu = $d["contenue"] ."[hr]Contenu fusionné[hr]". $contenue; + $contenu = $d["contenue"] ."
Contenu fusionné
". $contenue; $req = $bddConnection->prepare("UPDATE cmw_forum_answer SET contenue = :contenu, date_post = NOW() WHERE id = :id"); $req->execute(array("contenu" => $contenu, "id" => $d["id"])); } else { diff --git a/controleur/forum/r_t_vu.php b/controleur/forum/r_t_vu.php index b9f87f0f..2a07c0f6 100644 --- a/controleur/forum/r_t_vu.php +++ b/controleur/forum/r_t_vu.php @@ -5,11 +5,16 @@ $id = htmlspecialchars($_GET['id']); $update = $bddConnection->prepare('UPDATE cmw_forum_report SET vu = 1 WHERE id_topic_answer = :id AND type = 0'); $update->execute(array( - 'id' => $id, + 'id' => $id )); - header('Location: index.php?page=post&id=' .$id. ''); + header('Location: index.php?page=post&id=' .$id); + exit(); } else +{ header('Location: ?page=erreur&erreur=0'); + exit(); +} + ?> \ No newline at end of file diff --git a/controleur/forum/remove_answer.php b/controleur/forum/remove_answer.php index 3318008d..2ac19941 100644 --- a/controleur/forum/remove_answer.php +++ b/controleur/forum/remove_answer.php @@ -13,7 +13,7 @@ { $reason = "Aucune/Non renseigné"; } - $select = $bddConnection->prepare('SELECT * FROM cmw_forum_answer WHERE id = :id'); + $select = $bddConnection->prepare('SELECT * FROM cmw_forum_answer WHERE id_topic = :id'); $select->execute(array( 'id' => $id )); @@ -29,7 +29,7 @@ 'raison' => $reason, 'auteur_suppression' => $pseudo )); - $remove = $bddConnection->prepare('DELETE FROM cmw_forum_answer WHERE id = :id'); + $remove = $bddConnection->prepare('DELETE FROM cmw_forum_answer WHERE id_topic = :id'); $remove->execute(array( 'id' => $id, )); diff --git a/controleur/forum/unfollow.php b/controleur/forum/unfollow.php index 9e35b7f6..8d79e439 100644 --- a/controleur/forum/unfollow.php +++ b/controleur/forum/unfollow.php @@ -7,7 +7,7 @@ 'id_topic' => $id, 'pseudo' => $_Joueur_['pseudo'] )); - header('Location: ?&page=forum'); + header('Location: ?&page=post&id=' . $id); } else header('Location: ?page=erreur&erreur=0'); diff --git a/controleur/profil/index.php b/controleur/profil/index.php index 5a64a867..46186003 100644 --- a/controleur/profil/index.php +++ b/controleur/profil/index.php @@ -18,19 +18,8 @@ -if($joueurDonnees['rang'] == 0) { - $gradeSite = $_Serveur_['General']['joueur']; -} elseif($joueurDonnees['rang'] == 1) { - $gradeSite = "".$_Serveur_['General']['createur']['nom'].""; -} elseif(fopen('./modele/grades/'.$joueurDonnees['rang'].'.yml', 'r')) { - $openGradeSite = new Lire('./modele/grades/'.$joueurDonnees['rang'].'.yml'); - $readGradeSite = $openGradeSite->GetTableau(); - $gradeSite = "".$readGradeSite['Grade'].""; - if(empty($readGradeSite['Grade'])) - $gradeSite = $_Serveur_['General']['joueur']; -} else { - $gradeSite = $_Serveur_['General']['joueur']; -} + +$gradeSite = Permission::getInstance()->gradeJoueur($joueurDonnees['pseudo']); include('theme/' .$_Serveur_['General']['theme']. '/pages/profil.php'); ?> \ No newline at end of file diff --git a/controleur/recompenseAuto.php b/controleur/recompenseAuto.php index 7e0d2d5d..be72b51d 100644 --- a/controleur/recompenseAuto.php +++ b/controleur/recompenseAuto.php @@ -6,7 +6,7 @@ $RecompenseAuto = new RecompenseAuto($bddConnection); $topRecompense = $RecompenseAuto->getTopRecompenses(); $dateRec = $RecompenseAuto->getDate(); -if(isset($dateRec) && $dateRec['valueType'] != 0 && $dateRec['etat'] != 0) +if(isset($dateRec) && !empty($dateRec) && $dateRec['valueType'] != 0 && $dateRec['etat'] != 0) { if($dateRec['etat'] <= time()) { diff --git a/controleur/recompenseList.php b/controleur/recompenseList.php index bf1bf9f8..4a706d62 100644 --- a/controleur/recompenseList.php +++ b/controleur/recompenseList.php @@ -16,6 +16,6 @@ } echo json_encode(array_values($tojs)); } else { - echo "{}"; + echo json_encode(array_values(array())); } }?> diff --git a/controleur/recupVotesTemp.php b/controleur/recupVotesTemp.php index b34abdf6..abae505d 100644 --- a/controleur/recupVotesTemp.php +++ b/controleur/recupVotesTemp.php @@ -2,6 +2,7 @@ if(Permission::getInstance()->verifPerm("connect")) { + echo '[DIV]'; require_once('modele/joueur/maj.class.php'); $joueurMaj = new Maj($_Joueur_['pseudo'], $bddConnection); $playerData = $joueurMaj->getReponseConnection(); @@ -16,9 +17,14 @@ )); $datas = $req_recup->fetchAll(PDO::FETCH_ASSOC); + $flag = 0; + foreach ($datas as $data) { - $vote->giveRecompense($bddConnection, $data,$jsonCon, true); + if($vote->giveRecompense($bddConnection, $data,$jsonCon, true)) { + $flag++; + } } + echo $flag; /* $req_suppr = $bddConnection->prepare('DELETE FROM cmw_votes_temp WHERE pseudo = :pseudo'); $req_suppr->execute(array( diff --git a/controleur/voter.php b/controleur/voter.php index e062111d..9cf84a1b 100644 --- a/controleur/voter.php +++ b/controleur/voter.php @@ -21,17 +21,19 @@ if(isset($_Joueur_) && $_Joueur_['pseudo'] == $pseudo) { $vote->stockVote($bddConnection, null, null); - if(!empty($voteurs['pseudo']) && is_array($voteurs['pseudo'])) { - $key = array_search($pseudo, $voteurs['pseudo']); - if(isset($key)) { - $verif = $RecompenseAuto->verifRecVotes($voteurs['nbre_votes'][$key]+1); + if(!empty($topVoteurs) && isset($topVoteurs)) { - if(!empty($verif)) - { - foreach($verif as $action) + foreach($topVoteurs as $value) { + if($value['pseudo'] == $pseudo) { + $verif = $RecompenseAuto->verifRecVotes($value['nbre_votes']+1); + if(!empty($verif)) { - $vote->stockVote($bddConnection, $action, null); + foreach($verif as $action) + { + $vote->stockVote($bddConnection, $action, null); + } } + break; } } } diff --git a/include/contributeurs.json b/include/contributeurs.json new file mode 100644 index 00000000..2586cbb4 --- /dev/null +++ b/include/contributeurs.json @@ -0,0 +1,82 @@ +{ + "1.8.1": { + "Développeur": [ + "Florentlife", + "guedesite", + "BadiiiX", + "deadfire", + "PinglsDzn" + ], + "Support": [ + "Emilien52" + ], + "Autres":[ + "MrSheepSheep", + "Humanist" + ] + }, + "1.8": { + "Développeur": [ + "Florentlife", + "guedesite", + "BadiiiX", + "Amjido", + "PinglsDzn" + ], + "Support": [ + "Emilien52" + ], + "Autres":[ + "PandaxCSGO", + "X3RO", + "RedBoard", + "AnackKel" + ] + }, + "1.7.3": { + "Développeur": [ + "Florentlife", + "Guedesite", + "BadiiiiX" + ], + "Support": [ + "Emilien52" + ] + }, + "1.7.2": { + "Développeur": [ + "Florentlife", + "Guedesite", + "PinglsDzn", + "Ethanox", + "Mario359" + ], + "Support": [ + "Emilien52" + ] + }, + "1.7.1": { + "Développeur": [ + "Florentlife" + ], + "Support": [ + "Emilien52" + ] + }, + "1.7.0": { + "Développeur": [ + "Florentlife", + "Ethanox", + "Oxykis" + ] + }, + "1.6": { + "Développeur": [ + "TheTueurCity", + "Cersus", + "SawnFx", + "DogeMVP", + "Lucerno" + ] + } +} diff --git a/include/version.php b/include/version.php index a0f72f96..77394074 100644 --- a/include/version.php +++ b/include/version.php @@ -1,3 +1,3 @@ diff --git a/installation/app/controller/action.php b/installation/app/controller/action.php index b8dd15c1..6bc92b80 100644 --- a/installation/app/controller/action.php +++ b/installation/app/controller/action.php @@ -1,11 +1,11 @@ - + diff --git a/modele/.htpasswd b/modele/.htpasswd new file mode 100644 index 00000000..1c25d545 --- /dev/null +++ b/modele/.htpasswd @@ -0,0 +1 @@ +cms:58d3eec4522c2da0726905295171549ebf3d763d \ No newline at end of file diff --git a/modele/app/chat.class.php b/modele/app/chat.class.php index e85ad8aa..99211cbe 100644 --- a/modele/app/chat.class.php +++ b/modele/app/chat.class.php @@ -45,7 +45,7 @@ public function formattage($message) $count = substr_count($message, '§'); if($count == 1) { - return str_replace('§0', '', str_replace('§1', '', str_replace('§3', '', str_replace('§5', '', str_replace('§7', '', str_replace('§8', '', str_replace('§a', '', str_replace('§b', '', str_replace('§c', '', str_replace('§e', '', str_replace('§f', '', $message)))))))))))))))).''; + return str_replace('§0', '', str_replace('§1', '', str_replace('§2', '', str_replace('§3', '', str_replace('§4', '', str_replace('§5', '', str_replace('§6', '', str_replace('§7', '', str_replace('§8', '', str_replace('§9', '', str_replace('§a', '', str_replace('§b', '', str_replace('§c', '', str_replace('§d', '', str_replace('§e', '', str_replace('§f', '', $message)))))))))))))))).''; } elseif($count > 1) { diff --git a/modele/app/ckeditor.class.php b/modele/app/ckeditor.class.php index 6822bcc1..375503d0 100644 --- a/modele/app/ckeditor.class.php +++ b/modele/app/ckeditor.class.php @@ -2,40 +2,72 @@ class ckeditor { + + public static function verif($content2) { if(isset($content2) && !empty($content2)) { + + $content2 = str_replace(">",">", str_replace("<","<",$content2)); + $dom = new DOMDocument('1.0', 'utf-8'); $dom->loadHTML(str_replace("[hr]Contenu fusionné[hr]", "",''.$content2)); $dom->removeChild($dom->doctype); - $script = $dom->getElementsByTagName('script'); - foreach($script as $item) - { - $item->parentNode->removeChild($item); - } - - $script = $dom->getElementsByTagName('form'); - foreach($script as $item) - { - $item->parentNode->removeChild($item); - } - - $img = $dom->getElementsByTagName('img'); - foreach($img as $item) - { - $item->setAttribute("style", "max-width: 100%;height: auto;cursor:pointer;"); - $item->setAttribute("onclick", "imageModal(this);"); - $str = str_replace(" ", "",$item->getAttribute("src")); - if(isset($str) && !empty($str)) { - if(strpos($str, "?action=") | strpos($str, "&action=")) - { - $item->parentNode->removeChild($item); - } - } - } + foreach ($dom->childNodes as $item) + { + self::checkChild($item); + } return $dom->saveHTML($dom->documentElement); } return ""; } + private static function checkChild($item) { + if(isset($item->tagName)) { + $tag = strtolower($item->tagName); + if(($tag == "script" || $tag == "form") ) { + $item->parentNode->removeChild($item); + } else { + if($item->attributes != null) { + $length = $item->attributes->length; + for ($i = 0; $i < $length; ++$i) { + if($item->attributes->item($i) != null) { + $n = strtolower($item->attributes->item($i)->name); + if(strlen($n) > 1) { + if(substr( $n, 0, 2 ) == "on") + { + $item->removeAttribute($item->attributes->item($i)->name); + } + } + } + } + } + if($tag == "img") { + $item->setAttribute("style", "max-width: 100%;height: auto;cursor:pointer;"); + $item->setAttribute("onclick", "imageModal(this);"); + $str = str_replace(" ", "",$item->getAttribute("src")); + if(isset($str) && !empty($str)) { + if(strpos($str, "?action=") | strpos($str, "&action=")) + { + $item->parentNode->removeChild($item); + } + } + } + foreach ($item->childNodes as $item2) + { + if($item2 != null) { + self::checkChild($item2); + } + } + } + } else { + foreach ($item->childNodes as $item2) + { + if($item2 != null) { + self::checkChild($item2); + } + } + } + } + } ?> \ No newline at end of file diff --git a/modele/app/membres.class.php b/modele/app/membres.class.php index 3c90dbfd..7f17b774 100644 --- a/modele/app/membres.class.php +++ b/modele/app/membres.class.php @@ -29,7 +29,7 @@ private function countMembres() return $fetch['max']; } - public function gradeJoueur($pseudo) + /*public function gradeJoueur($pseudo) { global $_Serveur_; @@ -58,7 +58,7 @@ public function gradeJoueur($pseudo) } return $gradeSite; - } + }*/ public function rechercheMembre($recherche) { diff --git a/modele/forum/forum.class.php b/modele/forum/forum.class.php index c55b0016..0be9eae0 100644 --- a/modele/forum/forum.class.php +++ b/modele/forum/forum.class.php @@ -96,18 +96,17 @@ public function infosSousForum($id, $fetch) //Compte les topics public function compteTopics($id) { - $count_topic2 = $this->bdd->prepare('SELECT * FROM cmw_forum_post WHERE id_categorie = :id_categorie AND sous_forum IS NULL'); - $count_topic2->bindParam(':id_categorie', htmlspecialchars($id)); - $count_topic2->execute(); - return $count_topic2->rowCount(); + $count_topic2 = $this->bdd->prepare('SELECT count(id) as count FROM cmw_forum_post WHERE id_categorie = :id_categorie AND sous_forum IS NULL'); + $count_topic2->execute(array('id_categorie' => $id )); + $count_topic2 = $count_topic2->fetch(PDO::FETCH_ASSOC); + return $count_topic2['count']; } //Récupération des topics public function infosTopics($id, $count) { $topic = $this->bdd->prepare('SELECT * FROM cmw_forum_post WHERE id_categorie = :id_categorie AND sous_forum IS NULL ORDER BY epingle DESC, last_answer_temps DESC LIMIT '.$count.', 20'); - $topic->bindParam(':id_categorie', htmlspecialchars($id)); - $topic->execute(); + $topic->execute(array('id_categorie' => $id )); return $topic->fetchAll(PDO::FETCH_ASSOC); } @@ -240,7 +239,7 @@ public function exist($id) } //Renvoie le grade du joueur - public function gradeJoueur($pseudo) + /*public function gradeJoueur($pseudo) { global $_Serveur_; $req = $this->bdd->prepare('SELECT rang FROM cmw_users WHERE pseudo = :pseudo'); @@ -260,7 +259,7 @@ public function gradeJoueur($pseudo) $gradeSite = $_Serveur_['General']['joueur']; } return $gradeSite; - } + } */ //Renvoie le préfix de la discussion public function getPrefix($prefix) diff --git a/modele/grades/perms.class.php b/modele/grades/perms.class.php index cb57f63d..74971e0b 100644 --- a/modele/grades/perms.class.php +++ b/modele/grades/perms.class.php @@ -3,19 +3,18 @@ class Permission { - private $joueur; + private $id; private $bdd; private $_PermDefault_; private $_PermPanel_; private $_PermForum_; private $grade; - private $options; private static $instance = null; //Instance de la classe singleton //Constructeur - private function __construct($joueur, $bdd) { - $this->joueur = $joueur; + private function __construct($id, $bdd) { + $this->id = $id; $this->bdd = $bdd; } @@ -25,7 +24,7 @@ public static function getInstance() { global $_Joueur_; if(is_null(self::$instance)) { - self::$instance = new Permission($_Joueur_, $bddConnection); + self::$instance = new Permission($_Joueur_['id'], $bddConnection); } return self::$instance; } @@ -33,30 +32,34 @@ public static function getInstance() { public function verifPerm(...$perm) { if(isset($this->grade)) + { $grade = $this->grade; + } else { $grade = $this->getGrade(); $this->grade = $grade; } - if($grade == 0) + if($grade == -1) { - if($perm[0] == "connect") - return true; return false; } - if($grade == -1) - return false; if($grade == 1) + { return true; + } else { if($perm[0] == "connect") + { return true; + } switch($perm[0]) { case 'PermsDefault': if(isset($this->_PermDefault_)) + { $TableauPerm = $this->_PermDefault_; + } else { $TableauPerm = $this->readPerm($grade, 0); @@ -66,7 +69,9 @@ public function verifPerm(...$perm) case 'PermsPanel': if(isset($this->_PermPanel_)) + { $TableauPerm = $this->_PermPanel_; + } else { $TableauPerm = $this->readPerm($grade, 1); @@ -76,7 +81,9 @@ public function verifPerm(...$perm) case 'PermsForum': if(isset($this->_PermForum_)) + { $TableauPerm = $this->_PermForum_; + } else { $TableauPerm = $this->readPerm($grade, 2); @@ -84,21 +91,29 @@ public function verifPerm(...$perm) } break; } - $perm = array_shift($perm); + array_shift($perm); $retour = false; foreach($perm as $value) { if(!array_key_exists($value, $TableauPerm)) + { return false; + } if(!is_array($TableauPerm[$value])) { if($TableauPerm[$value] == 'on' || $TableauPerm[$value] === true) + { $retour = true; + } elseif(is_numeric($TableauPerm[$value])) + { return $TableauPerm[$value]; + } } else + { $TableauPerm = $TableauPerm[$value]; + } } return $retour; } @@ -111,15 +126,21 @@ public function getNom($grade = -1) if(isset($this->grade) && $grade == -1) { if(!isset($this->_Perm_)) + { $this->_Perm_ = $this->readPerm($this->grade); + } return "_Perm_['effets']."'>".$this->_Perm_['Grade'].""; } elseif($grade != -1) { if($grade == 0) + { return $_Serveur_['General']['joueur']; + } if($grade == 1) + { return "".$_Serveur_['General']['createur']['nom']."

"; + } $recup = $this->readPerm($grade); return "".$recup['Grade'].""; } @@ -128,13 +149,20 @@ public function getNom($grade = -1) public function readPerm($grade, $ordre = 3) //0 : default, 1: panel, 2: forum, 3: tout { if($ordre == 0) + { $req = $this->bdd->prepare('SELECT permDefault AS result FROM cmw_grades WHERE id = :id'); - elseif($ordre == 1) + } + else if($ordre == 1) + { $req = $this->bdd->prepare('SELECT permPanel AS result FROM cmw_grades WHERE id = :id'); - elseif($ordre == 2) + } + else if($ordre == 2) + { $req = $this->bdd->prepare('SELECT permForum AS result FROM cmw_grades WHERE id = :id'); - else + } + else { $req = $this->bdd->prepare('SELECT permDefault AS result, permForum AS result1, permPanel AS result2 FROM cmw_grades WHERE id = :id'); + } $req->execute(array('id' => $grade)); $data = $req->fetch(PDO::FETCH_ASSOC); if(isset($data['result1'])) @@ -144,18 +172,20 @@ public function readPerm($grade, $ordre = 3) //0 : default, 1: panel, 2: forum, $lecture['PermsForum'] = unserialize($data['result1']); } else + { $lecture = unserialize($data['result']); + } return $lecture; } //Récupère le grade du joueur private function getGrade() { - if($this->exist($this->joueur)) + if($this->exist($this->id)) { - $req = $this->bdd->prepare('SELECT rang FROM cmw_users WHERE pseudo = :pseudo'); + $req = $this->bdd->prepare('SELECT rang FROM cmw_users WHERE id = :id'); $req->execute(array( - 'pseudo' => $this->joueur['pseudo'] + 'id' => $this->id )); $data = $req->fetch(PDO::FETCH_ASSOC); return $data['rang']; @@ -163,13 +193,50 @@ private function getGrade() { return -1; } - private function exist($pseudo) + private function exist($id) { - if(!is_null($this->joueur)) + if(!is_null($this->id)) + { return true; + } return false; } + public function gradeJoueur($pseudo) + { + global $_Serveur_; + + $req = $this->bdd->prepare('SELECT rang FROM cmw_users WHERE pseudo = :pseudo'); + $req->execute(array('pseudo' => $pseudo)); + $joueur = $req->fetch(PDO::FETCH_ASSOC); + + if (!empty($joueur) && isset($joueur['rang'])) { + if ($joueur['rang'] == 0) { + $gradeSite = $_Serveur_['General']['joueur']; + } elseif ($joueur['rang'] == 1) { + + $gradeSite = "" . $_Serveur_['General']['createur']['nom'] . ""; + + } else { + $req = $this->bdd->prepare('SELECT prefix, effets, nom FROM cmw_grades WHERE id = :id'); + $req->execute(array('id' => $joueur['rang'])); + $grade = $req->fetch(PDO::FETCH_ASSOC); + + if (!empty($grade)) { + + + $gradeSite = "" . $grade['nom'] . ""; + } else { + $gradeSite = $_Serveur_['General']['joueur']; + } + } + } else { + $gradeSite = $_Serveur_['General']['joueur']; + } + + return $gradeSite; + } + } ?> \ No newline at end of file diff --git a/modele/json/json.class.php b/modele/json/json.class.php index 57020927..5b6497aa 100644 --- a/modele/json/json.class.php +++ b/modele/json/json.class.php @@ -71,6 +71,7 @@ public function connect($mode) { $api = new JSONAPI($this->api['adresse'], $this->api['port'], $this->api['user'], $this->api['mdp']); $this->api = $api; + $this->connected = true; } else { @@ -78,6 +79,7 @@ public function connect($mode) $this->api['query']->Connect($this->api['data']['adresse'], $this->api['data']['portQ']); $this->api['rcon']->Connect($this->api['data']['adresse'], $this->api['data']['portR'], 1, SourceQuery::SOURCE); $this->api['rcon']->SetRconPassword($this->api['data']['mdp']); + $this->connected = true; } catch(MinecraftQueryException $e) { @@ -94,7 +96,6 @@ public function connect($mode) unset($this->api['data']); } - $this->connected = true; } } @@ -125,311 +126,376 @@ public function SetPlayerName($pseudo) public function SendBroadcast($message) { - $message = str_replace('{PLAYER}', $this->pseudo, $message); - $message = str_replace('&', '§', $message); - if($this->TryMode()) - { - $this->api->call("chat.broadcast", array($message)); - } - else - { - if($this->api != null && $this->api['rcon']->isConnected()) - $this->api['rcon']->Rcon("say ".$message); + if($this->isConnected()) { + $message = str_replace('{PLAYER}', $this->pseudo, $message); + $message = str_replace('&', '§', $message); + if($this->TryMode()) + { + $this->api->call("chat.broadcast", array($message)); + } + else + { + if($this->api != null && $this->api['rcon']->isConnected()) + $this->api['rcon']->Rcon("say ".$message); + } } } public function GetChat($donnees) { - if($this->TryMode()) - return $this->api->call("streams.chat.latest", $donnees); - else - return null; + if($this->isConnected()) { + if($this->TryMode()) + { + return $this->api->call("streams.chat.latest", $donnees); + } + else + { + return null; + } + } } public function getPlugins() { - $key = $this->verifyReq("getPlugins"); - if($key !== false) - { - return $key; - } - if($this->TryMode()) - { - $plugins['Test'] = $this->api->call("getPlugins"); - $plugins['Test'] = $plugins['Test'][0]["success"]; - } - else - { - if($this->api != null) + if($this->isConnected()) { + $key = $this->verifyReq("getPlugins"); + if($key !== false) + { + return $key; + } + if($this->TryMode()) { - $data = $this->api['query']->GetInfo(); - $plugins['Test'] = $data['Plugins']; + $plugins['Test'] = $this->api->call("getPlugins"); + $plugins['Test'] = $plugins['Test'][0]["success"]; } + else + { + if($this->api != null) + { + $data = $this->api['query']->GetInfo(); + $plugins['Test'] = $data['Plugins']; + } + } + $this->updateReq("getPlugins", $plugins); + return $plugins; + } else { + return false; } - $this->updateReq("getPlugins", $plugins); - return $plugins; } public function GetConsole() { - $key = $this->verifyReq("getLatestConsoleLogsWithLimit"); - if($key !== false) - return $key; - $msg = 12; - if($this->TryMode()) - { - $console['Test'] = $this->api->call("getLatestConsoleLogsWithLimit", array($msg)); - $console['Test'] = $console['Test'][0]["success"]; + if($this->isConnected()) { + $key = $this->verifyReq("getLatestConsoleLogsWithLimit"); + if($key !== false) + return $key; + $msg = 12; + if($this->TryMode()) + { + $console['Test'] = $this->api->call("getLatestConsoleLogsWithLimit", array($msg)); + $console['Test'] = $console['Test'][0]["success"]; + } + else + $console['Test'] = "Impossible de récupérer les données de la console en RCON/QUERY"; + $this->updateReq("getLatestConsoleLogsWithLimit", $console); + return $console; + } else { + return false; } - else - $console['Test'] = "Impossible de récupérer les données de la console en RCON/QUERY"; - $this->updateReq("getLatestConsoleLogsWithLimit", $console); - return $console; } public function reloadServer() { - if($this->TryMode()) - return $this->api->call("reloadServer"); - else - return false; + if($this->isConnected()) { + if($this->TryMode()) + { + return $this->api->call("reloadServer"); + } + else + { + return false; + } + } } public function restartServer() { - if($this->TryMode()) - return $this->api->call("server.power.restart"); - else - return false; + if($this->isConnected()) { + if($this->TryMode()) + { + return $this->api->call("server.power.restart"); + } + else + { + return false; + } + } } public function getPermissionsGroups($pseudo) { - $key = $this->verifyReq("permissions.getGroups.".$pseudo); - if($key !== false) - return $key; - if($this->TryMode()) - { - $return = $this->api->call("permissions.getGroups", Array($pseudo)); - $this->updateReq("permissions.getGroups.".$pseudo, $return); - return $return; - } - else + if($this->isConnected()) { + $key = $this->verifyReq("permissions.getGroups.".$pseudo); + if($key !== false) + { + return $key; + } + if($this->TryMode()) + { + $return = $this->api->call("permissions.getGroups", Array($pseudo)); + $this->updateReq("permissions.getGroups.".$pseudo, $return); + return $return; + } + else + { + return ''; + } + } else { return ''; + } } public function SendMessage($donnees) { - if($this->TryMode()) - { - $this->api->call("players.name.send_message", $donnees); - } - else { - if($this->api != null && $this->api['rcon']->isConnected()) - $data = $this->api['rcon']->Rcon('msg '.$donnees[0].' '.$donnees[1]); + if($this->isConnected()) { + if($this->TryMode()) + { + $this->api->call("players.name.send_message", $donnees); + } + else { + if($this->api != null && $this->api['rcon']->isConnected()) + $data = $this->api['rcon']->Rcon('msg '.$donnees[0].' '.$donnees[1]); + } } } public function getMonnaie() { - $key = $this->verifyReq("economy.currency.name_plural"); - if($key !==false) - return $key; - if($this->TryMode()) - { - $return = $this->api->call("economy.currency.name_plural"); - $this->updateReq("economy.currency.name_plural", $return); - return $return; + if($this->isConnected()) { + $key = $this->verifyReq("economy.currency.name_plural"); + if($key !==false) + return $key; + if($this->TryMode()) + { + $return = $this->api->call("economy.currency.name_plural"); + $this->updateReq("economy.currency.name_plural", $return); + return $return; + } } return false; } public function runConsoleCommand($message) { - $message = str_replace('{PLAYER}', $this->pseudo, $message); - $message = str_replace('&', '§', $message); - if($this->TryMode()) - { - $this->api->call("runConsoleCommand", array($message)); + if($this->isConnected()) { + $message = str_replace('{PLAYER}', $this->pseudo, $message); + $message = str_replace('&', '§', $message); + if($this->TryMode()) + { + $this->api->call("runConsoleCommand", array($message)); + } + else + { + if($this->api != null && $this->api['rcon']->isConnected()) + $this->api['rcon']->Rcon($message); + } } - else - { - if($this->api != null && $this->api['rcon']->isConnected()) - $this->api['rcon']->Rcon($message); - } } //Cette fonction à la propriété de gérer les "Grades temporaires" ! public function AddPlayerToGroup($message, $duree) { - if($this->TryMode()) - { - $this->api->call("runConsoleCommand", array('manudel '.$this->pseudo)); - $this->api->call("permissions.addPlayerToGroup", array($this->pseudo, $message)); - require_once('modele/boutique/tempgrades.class.php'); - $tempGrade = new TempGrades($this->bdd, $this->pseudo, $duree, $message); - if($tempGrade->ExistPlayer()) - { - if($duree == 0) - $tempGrade->MajJoueurVie(); - else - $tempGrade->MajJoueur(); - } - else + if($this->isConnected()) { + if($this->TryMode()) { - if($duree == 0) - $tempGrade->CreerJoueurVie(); + $this->api->call("runConsoleCommand", array('manudel '.$this->pseudo)); + $this->api->call("permissions.addPlayerToGroup", array($this->pseudo, $message)); + require_once('modele/boutique/tempgrades.class.php'); + $tempGrade = new TempGrades($this->bdd, $this->pseudo, $duree, $message); + if($tempGrade->ExistPlayer()) + { + if($duree == 0) + $tempGrade->MajJoueurVie(); + else + $tempGrade->MajJoueur(); + } else - $tempGrade->CreerJoueur(); + { + if($duree == 0) + $tempGrade->CreerJoueurVie(); + else + $tempGrade->CreerJoueur(); + } } } } public function ResetPlayer($pseudo, $grade) { - if($this->TryMode()) - { - $this->api->call("runConsoleCommand", array('manudel '.$pseudo)); - if(!empty($grade)) - $this->api->call("permissions.addPlayerToGroup", array($pseudo, $grade)); + if($this->isConnected()) { + if($this->TryMode()) + { + $this->api->call("runConsoleCommand", array('manudel '.$pseudo)); + if(!empty($grade)) + $this->api->call("permissions.addPlayerToGroup", array($pseudo, $grade)); + } } } public function GivePlayerItem($commande) { - if($this->TryMode()) - { - $this->api->call("runConsoleCommand", array('give '.$this->pseudo . ' '. $commande)); - } - else - { - if($this->api != null && $this->api['rcon']->isConnected()) - $this->api['rcon']->Rcon('give '.$this->pseudo.' '.$commande); + if($this->isConnected()) { + if($this->TryMode()) + { + $this->api->call("runConsoleCommand", array('give '.$this->pseudo . ' '. $commande)); + } + else + { + if($this->api != null && $this->api['rcon']->isConnected()) + $this->api['rcon']->Rcon('give '.$this->pseudo.' '.$commande); + } } } public function GivePlayerXp($message) { - if($this->TryMode()) - $this->api->call("givePlayerXp", array($message)); + if($this->isConnected()) { + if($this->TryMode()) { + $this->api->call("givePlayerXp", array($message)); + } + } } public function GivePlayerMoney($message) { - if($this->TryMode()) - $this->api->call("econ.depositPlayer", array($this->pseudo, $message)); + if($this->isConnected()) { + if($this->TryMode()) + { + $this->api->call("econ.depositPlayer", array($this->pseudo, $message)); + } + } } public function GetBanList() { - $key = $this->verifyReq("files.read.banlist"); - if($key !== false) - return $key; - if($this->TryMode()) - { - $return = $this->api->call("files.read", array("banned-players.json")); - $this->updateReq("files.read.banlist", $return); - return $return; + if($this->isConnected()) { + $key = $this->verifyReq("files.read.banlist"); + if($key !== false) + return $key; + if($this->TryMode()) + { + $return = $this->api->call("files.read", array("banned-players.json")); + $this->updateReq("files.read.banlist", $return); + return $return; + } } return false; } public function GetPlayers() { - if($this->TryMode()) - { - $key = $this->verifyReq("getPlayerNames"); - if($key !== false) - return $key; - $req = $this->api->call("getPlayerNames"); - $return = $req[0]['success']; - $this->updateReq("getPlayerNames", $return); - return $return; - } - else - { - $key = $this->verifyReq("query.getPlayers"); - if($key !== false) + if($this->isConnected()) { + if($this->TryMode()) { - return $key; + $key = $this->verifyReq("getPlayerNames"); + if($key !== false) + return $key; + $req = $this->api->call("getPlayerNames"); + $return = $req[0]['success']; + $this->updateReq("getPlayerNames", $return); + return $return; } - $req = $this->api['query']->GetPlayers(); - $this->updateReq("query.getPlayers", $req); - return $req; + else + { + $key = $this->verifyReq("query.getPlayers"); + if($key !== false) + { + return $key; + } + $req = $this->api['query']->GetPlayers(); + $this->updateReq("query.getPlayers", $req); + return $req; + } + } else { + return false; } } // Récupère les pseudo des joueurs et le nombre de joueurs en ligne... public function GetServeurInfos() { - if($this->TryMode()) - { - $serveurStats = array( - 'enLignes' => 0, - 'maxJoueurs' => 1, - 'joueurs' => 2, - 'version' => 3, - 'usedMemoryServer' => 4, - 'totalMemoryServer' => 5, - 'usedDiskSizeServer' => 6, - 'totalDiskSizeServer' => 7, - 'freeDiskSizeServer' => 8 - ); - $reqs = array( - 'getPlayerCount', - 'getPlayerLimit', - 'getPlayerNames', - 'getBukkitVersion', - 'server.performance.memory.used', - 'server.performance.memory.total', - 'server.performance.disk.used', - 'server.performance.disk.size', - 'server.performance.disk.free' - ); - foreach($serveurStats as $clee => $value) + if($this->isConnected()) { + if($this->TryMode()) { - $key = $this->verifyReq($reqs[$value]); - if($key !== false) - $serveurStats[$clee] = $key; - else + $serveurStats = array( + 'enLignes' => 0, + 'maxJoueurs' => 1, + 'joueurs' => 2, + 'version' => 3, + 'usedMemoryServer' => 4, + 'totalMemoryServer' => 5, + 'usedDiskSizeServer' => 6, + 'totalDiskSizeServer' => 7, + 'freeDiskSizeServer' => 8 + ); + $reqs = array( + 'getPlayerCount', + 'getPlayerLimit', + 'getPlayerNames', + 'getBukkitVersion', + 'server.performance.memory.used', + 'server.performance.memory.total', + 'server.performance.disk.used', + 'server.performance.disk.size', + 'server.performance.disk.free' + ); + foreach($serveurStats as $clee => $value) { - $req = $reqs[$value]; - $serveurStats[$clee] = $this->api->call($req); - $serveurStats[$clee] = $serveurStats[$clee][0]['success']; - $this->updateReq($req, $serveurStats[$clee]); + $key = $this->verifyReq($reqs[$value]); + if($key !== false) + $serveurStats[$clee] = $key; + else + { + $req = $reqs[$value]; + $serveurStats[$clee] = $this->api->call($req); + $serveurStats[$clee] = $serveurStats[$clee][0]['success']; + $this->updateReq($req, $serveurStats[$clee]); + } + if(is_numeric($serveurStats[$clee])) + $serveurStats[$clee] = round($serveurStats[$clee]); } - if(is_numeric($serveurStats[$clee])) - $serveurStats[$clee] = round($serveurStats[$clee]); } - } - else - { - if($this->api != null && $this->api['query'] != null) + else { - $key = $this->verifyReq("query.getInfo"); - if($key !== false) - { - $data = $key; - $serveurStats['enLignes'] = $data['Players']; - $serveurStats['maxJoueurs'] = $data['MaxPlayers']; - $serveurStats['version'] = $data['Version']; - } - else - { - $data = $this->api['query']->GetInfo(); - $serveurStats['enLignes'] = $data['Players']; - $serveurStats['maxJoueurs'] = $data['MaxPlayers']; - $serveurStats['version'] = $data['Version']; - $this->updateReq("query.getInfo", $data); - } - $key = $this->verifyReq("query.getPlayers"); - if($key !== false) - $serveurStats['joueurs'] = $key; - else + if($this->api != null && $this->api['query'] != null) { - $serveurStats['joueurs'] = $this->api['query']->GetPlayers(); - $this->updateReq("query.getPlayers", $serveurStats['joueurs']); + $key = $this->verifyReq("query.getInfo"); + if($key !== false) + { + $data = $key; + $serveurStats['enLignes'] = $data['Players']; + $serveurStats['maxJoueurs'] = $data['MaxPlayers']; + $serveurStats['version'] = $data['Version']; + } + else + { + $data = $this->api['query']->GetInfo(); + $serveurStats['enLignes'] = $data['Players']; + $serveurStats['maxJoueurs'] = $data['MaxPlayers']; + $serveurStats['version'] = $data['Version']; + $this->updateReq("query.getInfo", $data); + } + $key = $this->verifyReq("query.getPlayers"); + if($key !== false) + $serveurStats['joueurs'] = $key; + else + { + $serveurStats['joueurs'] = $this->api['query']->GetPlayers(); + $this->updateReq("query.getPlayers", $serveurStats['joueurs']); + } } } + return $serveurStats; + } else { + return false; } - return $serveurStats; } public function close() @@ -484,6 +550,26 @@ private function updateReq($req, $value) )); } } + + private function isConnected() { + $this->TryMode(); + if($this->connected) { + return true; + } else { + $stack = debug_backtrace(); + $error_msg = "Action annulé, la connection (".($this->mode == 1 ? "JSONAPI" : "RCON/QUERY") .") au serveur ".($this->mode == 1 ? $this->api['adresse'] : $this->api['data']['adresse'])." n'a pas été établie."; + for ($i = 0; $i < 5; $i++) + { + if (false === ($frame = next($stack))) + { + break; + } + $error_msg .= "
" . $frame['function'] . ':' . $frame['file'] . ' line ' . $frame['line']; + } + trigger_error($error_msg, E_USER_NOTICE); + return false; + } + } } ?> \ No newline at end of file diff --git a/modele/recompenseAuto.class.php b/modele/recompenseAuto.class.php index 43b4026f..4dedf80c 100644 --- a/modele/recompenseAuto.class.php +++ b/modele/recompenseAuto.class.php @@ -37,7 +37,7 @@ public function verifRecVotes($nbVotes) $retour = array(); foreach($this->data as $data) { - if($data['type'] == 1 && $data['valueType'] <= $nbVotes) + if($data['type'] == 1 && $data['valueType'] == $nbVotes) { array_push($retour, $data['action']); } @@ -85,8 +85,12 @@ public static function configureNextDate($data, $type) { if($month > cal_days_in_month(CAL_GREGORIAN,intval(date("j")),intval(date("Y")))) { $month = cal_days_in_month(CAL_GREGORIAN,intval(date("j")),intval(date("Y"))); } - $next = strtotime($month." ".date("F", strtotime("next month"))); - $next += $data['heur'] * 3600 + $data['min'] * 60 - 12 * 3600; + $years = intval(date("Y")); + if(intval(date("n")) == 12 && intval(date("n", strtotime("next month"))) == 1) { + $years = intval(date("Y")) + 1; + } + $next = strtotime($month." ".date("F", strtotime("next month"))." ".$years ); + $next += $data['heur'] * 3600 + $data['min'] * 60 + 3600; } return $next; } diff --git a/modele/vote.class.php b/modele/vote.class.php index 91799295..5a114bcc 100644 --- a/modele/vote.class.php +++ b/modele/vote.class.php @@ -79,11 +79,11 @@ public function stockVote($bdd, $action, $serveur) { $serveur = $this->lienData['serveur']; } - $json = json_decode($action, true); + $json = $json2 = json_decode($action, true); foreach($json as $key => $value) { if(isset($value['pourcentage']) && ((int)$value['pourcentage']) != 100) { if(rand(0, 100) > ((int)$value['pourcentage'])) { - unset($json[$key]); + unset($json2[$key]); continue; } } @@ -93,7 +93,7 @@ public function stockVote($bdd, $action, $serveur) { unset($value['value2']); } } - $action = json_encode(array_values($json)); + $action = json_encode(array_values($json2)); $req = $bdd->prepare('INSERT INTO cmw_votes_temp (pseudo, action, serveur) VALUES (:pseudo, :action, :serveur)'); @@ -221,17 +221,19 @@ public function giveRecompense($bdd, $data, $jsonCon, $save = false) { )); } if($save) { - if(empty($json) | !isset($json)) { - $req_suppr = $bddConnection->prepare('DELETE FROM cmw_votes_temp WHERE id = :id'); + if(empty($json2) || !isset($json2)) { + $req_suppr = $bdd->prepare('DELETE FROM cmw_votes_temp WHERE id = :id'); $req_suppr->execute(array( 'id' => $data['id'] )); + return false; } else { $reqMaj = $bdd->prepare('UPDATE cmw_votes_temp SET action = :action WHERE id = :id'); $reqMaj->execute(array( 'id' => $data['id'], 'action' => json_encode(array_values($json2)) )); + return true; } } } @@ -265,7 +267,12 @@ public function hasVote() { if(isset($id) AND !empty($id) and $id != "") { $url = $this->lienData['lien']; - if(strpos($url, 'serveur-prive.net')) + if(strpos($url, 'serveurs-mc.net')) + { + $API_call = $this->fetch("https://serveurs-mc.net/api/hasVote/".$id."/".$this->get_client_ip()."/10"); + $json = json_decode($API_call,true); + return $json["hasVote"] == "true"; + }else if(strpos($url, 'serveur-prive.net')) { $API_call = $this->fetch("https://serveur-prive.net/api/vote/".$id."/". $this->get_client_ip()); return $API_call == 1; diff --git a/theme/default/assets/css/custom.css b/theme/default/assets/css/custom.css index f1c3bbef..2510bcd2 100644 --- a/theme/default/assets/css/custom.css +++ b/theme/default/assets/css/custom.css @@ -106,8 +106,10 @@ a { transition: .5s; } -strong { - color: var(--active-color) !important; +strong.important--text { + + color: var(--active-color) !important; + } a:hover:not(.no-hover) { @@ -534,6 +536,19 @@ li.nav-item { border-color: var(--main-color) !important; } +@keyframes loading { + from{ + transform: rotate(0deg); + } + to{ + transform: rotate(360deg); + } +} + +.loading { + animation: loading 2s linear infinite; +} + /* ==> Support */ #Support .btn.btn-main { @@ -570,7 +585,8 @@ li.nav-item { } .media-body { - word-break: break-all; + text-align: justify; + word-break: break; } /* ==> Profil */ diff --git a/theme/default/assets/js/ckeditor.js b/theme/default/assets/js/ckeditor.js index 4160e5de..6ae5daf1 100644 --- a/theme/default/assets/js/ckeditor.js +++ b/theme/default/assets/js/ckeditor.js @@ -2,5 +2,5 @@ * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */ -(function(e){const t=e["fr"]=e["fr"]||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 sur %1","Align center":"Centrer","Align left":"Aligner à gauche","Align right":"Aligner à droite",Aquamarine:"Bleu vert",Big:"Grand",Black:"Noir","Block quote":"Citation",Blue:"Bleu","Blue marker":"Marqueur bleu",Bold:"Gras","Bulleted List":"Liste à puces",Cancel:"Annuler","Centered image":"Image centrée","Change image text alternative":"Changer le texte alternatif à l’image","Characters: %0":"Caractères : %0","Choose heading":"Choisir l'en-tête",Default:"Par défaut","Dim grey":"Gris pâle","Document colors":"Couleurs du document",Downloadable:"Fichier téléchargeable","Dropdown toolbar":"Barre d'outils dans un menu déroulant","Edit link":"Modifier le lien","Editor toolbar":"Barre d'outils de l'éditeur","Enter image caption":"Saisir la légende de l’image","Font Background Color":"Couleur d'arrière-plan","Font Color":"Couleur de police","Font Family":"Police","Font Size":"Taille de police","Full size image":"Image taille réelle",Green:"Vert","Green marker":"Marqueur vert","Green pen":"Crayon vert",Grey:"Gris",Heading:"En-tête","Heading 1":"Titre 1","Heading 2":"Titre 2","Heading 3":"Titre 3","Heading 4":"Titre 4","Heading 5":"Titre 5","Heading 6":"Titre 6",Highlight:"Surlignage","Horizontal line":"Ligne horizontale",Huge:"Enorme","Image resize list":"","Image toolbar":"Barre d'outils des images","image widget":"Objet image","Insert image":"Insérer une image","Insert media":"Insérer un média","Insert paragraph after block":"","Insert paragraph before block":"",Italic:"Italique",Justify:"Justifier","Left aligned image":"Image alignée à gauche","Light blue":"Bleu clair","Light green":"Vert clair","Light grey":"Gris clair",Link:"Lien","Link URL":"URL du lien","Media URL":"URL de média","media widget":"widget média",Next:"Suivant","Numbered List":"Liste numérotée","Open in a new tab":"Ouvrir dans un nouvel onglet","Open link in new tab":"Ouvrir le lien dans un nouvel onglet",Orange:"Orange",Original:"",Paragraph:"Paragraphe","Paste the media URL in the input.":"Coller l'URL du média","Pink marker":"Marqueur rose",Previous:"Précedent",Purple:"Violet",Red:"Rouge","Red pen":"Crayon rouge",Redo:"Restaurer","Remove color":"Enlever la couleur","Remove highlight":"Enlever le surlignage","Resize image":"","Resize image to %0":"","Resize image to the original size":"","Rich Text Editor":"Éditeur de texte enrichi","Rich Text Editor, %0":"Éditeur de texte enrichi, %0","Right aligned image":"Image alignée à droite",Save:"Enregistrer","Show more items":"Montrer plus d'éléments","Side image":"Image latérale",Small:"Petit","Text alignment":"Alignement du texte","Text alignment toolbar":"Barre d'outils d'alignement du texte","Text alternative":"Texte alternatif","Text highlight toolbar":"Barre d'outils du surlignage","The URL must not be empty.":"L'URL ne doit pas être vide.","This link has no URL":"Ce lien n'a pas d'URL","This media URL is not supported.":"Cette URL de média n'est pas supportée.",Tiny:"Minuscule","Tip: Paste the URL into the content to embed faster.":"Astuce : Copier l'URL du média dans le contenu pour l'insérer plus rapidement","To-do List":"Liste de tâches",Turquoise:"Turquoise",Underline:"Souligné",Undo:"Annuler",Unlink:"Supprimer le lien","Upload failed":"Échec de l'envoi","Upload in progress":"Téléchargement en cours",White:"Blanc","Widget toolbar":"Barre d'outils du widget","Words: %0":"Mots : %0",Yellow:"Jaune","Yellow marker":"Marqueur jaune"});t.getPluralForm=function(e){return e>1}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));(function e(t,i){if(typeof exports==="object"&&typeof module==="object")module.exports=i();else if(typeof define==="function"&&define.amd)define([],i);else if(typeof exports==="object")exports["ClassicEditor"]=i();else t["ClassicEditor"]=i()})(window,(function(){return function(e){var t={};function i(n){if(t[n]){return t[n].exports}var o=t[n]={i:n,l:false,exports:{}};e[n].call(o.exports,o,o.exports,i);o.l=true;return o.exports}i.m=e;i.c=t;i.d=function(e,t,n){if(!i.o(e,t)){Object.defineProperty(e,t,{enumerable:true,get:n})}};i.r=function(e){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})};i.t=function(e,t){if(t&1)e=i(e);if(t&8)return e;if(t&4&&typeof e==="object"&&e&&e.__esModule)return e;var n=Object.create(null);i.r(n);Object.defineProperty(n,"default",{enumerable:true,value:e});if(t&2&&typeof e!="string")for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n};i.n=function(e){var t=e&&e.__esModule?function t(){return e["default"]}:function t(){return e};i.d(t,"a",t);return t};i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};i.p="";return i(i.s=104)}([function(e,t,i){"use strict";i.d(t,"b",(function(){return o}));i.d(t,"a",(function(){return r}));const n="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html";class o extends Error{constructor(e,t,i){e=r(e);if(i){e+=" "+JSON.stringify(i)}super(e);this.name="CKEditorError";this.context=t;this.data=i}is(e){return e==="CKEditorError"}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError")){throw e}const i=new o(e.message,t);i.stack=e.stack;throw i}}function r(e){const t=e.match(/^([^:]+):/);if(!t){return e}return e+` Read more: ${n}#error-${t[1]}\n`}},function(e,t,i){"use strict";var n=function e(){var t;return function e(){if(typeof t==="undefined"){t=Boolean(window&&document&&document.all&&!window.atob)}return t}}();var o=function e(){var t={};return function e(i){if(typeof t[i]==="undefined"){var n=document.querySelector(i);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement){try{n=n.contentDocument.head}catch(e){n=null}}t[i]=n}return t[i]}}();var r=[];function s(e){var t=-1;for(var i=0;i: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,i){var n=i(1);var o=i(20);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(22);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(24);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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}:root{--ck-dropdown-arrow-size:calc(0.5*var(--ck-icon-size))}.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,i){var n=i(1);var o=i(26);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(28);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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(-1*var(--ck-tooltip-arrow-size));transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after{top:calc(-1*var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_n{top:calc(-1*var(--ck-tooltip-arrow-size));transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(-1*var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}'},function(e,t,i){var n=i(1);var o=i(30);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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(-1*var(--ck-spacing-small));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(-1*var(--ck-spacing-small));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,i){var n=i(1);var o=i(32);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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(0.2*var(--ck-line-height-base)*var(--ck-font-size-base)) calc(0.4*var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(1.2*var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on: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,i){var n=i(1);var o=i(34);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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) - 2*var(--ck-switch-button-toggle-spacing))}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(2*var(--ck-spacing-large))}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(2*var(--ck-spacing-large))}.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(0.5*var(--ck-border-radius))}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition: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(-1*var(--ck-switch-button-translation)))}"},function(e,t,i){var n=i(1);var o=i(36);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(38);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(40);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(42);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(44);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}"},function(e,t,i){var n=i(1);var o=i(46);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(48);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(50);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(53);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(55);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(o,r);e.exports=o.locals||{}},function(e,t){e.exports=":root{--ck-highlight-marker-yellow:#fdfd77;--ck-highlight-marker-green:#62f962;--ck-highlight-marker-pink:#fc7899;--ck-highlight-marker-blue:#72ccfd;--ck-highlight-pen-red:#e71313;--ck-highlight-pen-green:#128a00}.ck-content .marker-yellow{background-color:var(--ck-highlight-marker-yellow)}.ck-content .marker-green{background-color:var(--ck-highlight-marker-green)}.ck-content .marker-pink{background-color:var(--ck-highlight-marker-pink)}.ck-content .marker-blue{background-color:var(--ck-highlight-marker-blue)}.ck-content .pen-red{color:var(--ck-highlight-pen-red);background-color:transparent}.ck-content .pen-green{color:var(--ck-highlight-pen-green);background-color:transparent}"},function(e,t,i){var n=i(1);var o=i(57);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(-1*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(-1*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.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(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.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(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.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(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.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(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}'},function(e,t,i){var n=i(1);var o=i(59);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck-editor__editable .ck-horizontal-line{display:flow-root}.ck-content hr{margin:15px 0;height:4px;background:#dedede;border:0}"},function(e,t,i){var n=i(1);var o=i(61);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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(-0.5*var(--ck-widget-outline-thickness));left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(-0.5*var(--ck-widget-outline-thickness));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(-1*var(--ck-widget-outline-thickness));right:calc(-1*var(--ck-widget-outline-thickness))}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(-1*var(--ck-widget-outline-thickness) - 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(-1*var(--ck-widget-outline-thickness) - 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,i){var n=i(1);var o=i(63);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(65);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(67);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(69);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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(0.8*var(--ck-input-text-width))}.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,i){var n=i(1);var o=i(71);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(73);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(75);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(77);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(79);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(81);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(83);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(85);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(87);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(89);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(91);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(93);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form{padding:var(--ck-spacing-standard)}.ck.ck-link-form:focus{outline:none}[dir=ltr] .ck.ck-link-form>:not(:first-child),[dir=rtl] .ck.ck-link-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-link-form .ck-labeled-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-link-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin-left:0}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"},function(e,t,i){var n=i(1);var o=i(95);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(o,r);e.exports=o.locals||{}},function(e,t){e.exports=".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions{padding:var(--ck-spacing-standard)}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}.ck.ck-link-actions:focus{outline:none}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview):first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview):last-of-type{border-right:1px solid var(--ck-color-base-border)}}"},function(e,t,i){var n=i(1);var o=i(97);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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(3*var(--ck-spacing-standard));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,i){var n=i(1);var o=i(99);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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(0.8*var(--ck-input-text-width))}.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,i){var n=i(1);var o=i(101);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(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,i){var n=i(1);var o=i(103);o=o.__esModule?o.default:o;if(typeof o==="string"){o=[[e.i,o,""]]}var r={injectType:"singletonStyleTag",attributes:{"data-cke":true}};r.insert="head";r.singleton=true;var s=n(o,r);e.exports=o.locals||{}},function(e,t){e.exports=':root{--ck-todo-list-checkmark-size:16px}.ck-content .todo-list{list-style:none}.ck-content .todo-list li{margin-bottom:5px}.ck-content .todo-list li .todo-list{margin-top:5px}.ck-content .todo-list .todo-list__label>input{-webkit-appearance:none;display:inline-block;position:relative;width:var(--ck-todo-list-checkmark-size);height:var(--ck-todo-list-checkmark-size);vertical-align:middle;border:0;left:-25px;margin-right:-15px;right:0;margin-left:0}.ck-content .todo-list .todo-list__label>input:before{display:block;position:absolute;box-sizing:border-box;content:"";width:100%;height:100%;border:1px solid #333;border-radius:2px;transition:box-shadow .25s ease-in-out,background .25s ease-in-out,border .25s ease-in-out}.ck-content .todo-list .todo-list__label>input:after{display:block;position:absolute;box-sizing:content-box;pointer-events:none;content:"";left:calc(var(--ck-todo-list-checkmark-size)/3);top:calc(var(--ck-todo-list-checkmark-size)/5.3);width:calc(var(--ck-todo-list-checkmark-size)/5.3);height:calc(var(--ck-todo-list-checkmark-size)/2.6);border-left:0 solid transparent;border-bottom:calc(var(--ck-todo-list-checkmark-size)/8) solid transparent;border-right:calc(var(--ck-todo-list-checkmark-size)/8) solid transparent;border-top:0 solid transparent;transform:rotate(45deg)}.ck-content .todo-list .todo-list__label>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-content .todo-list .todo-list__label>input[checked]:after{border-color:#fff}.ck-content .todo-list .todo-list__label .todo-list__label__description{vertical-align:middle}[dir=rtl] .todo-list .todo-list__label>input{left:0;margin-right:0;right:-25px;margin-left:-15px}.ck-editor__editable .todo-list .todo-list__label>input{cursor:pointer}.ck-editor__editable .todo-list .todo-list__label>input:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}'},function(e,t,i){"use strict";i.r(t);var n=i(3);var o=n["a"].Symbol;var r=o;var s=Object.prototype;var a=s.hasOwnProperty;var c=s.toString;var l=r?r.toStringTag:undefined;function d(e){var t=a.call(e,l),i=e[l];try{e[l]=undefined;var n=true}catch(e){}var o=c.call(e);if(n){if(t){e[l]=i}else{delete e[l]}}return o}var u=d;var h=Object.prototype;var f=h.toString;function m(e){return f.call(e)}var g=m;var p="[object Null]",b="[object Undefined]";var w=r?r.toStringTag:undefined;function k(e){if(e==null){return e===undefined?b:p}return w&&w in Object(e)?u(e):g(e)}var _=k;function v(e,t){return function(i){return e(t(i))}}var y=v;var x=y(Object.getPrototypeOf,Object);var A=x;function T(e){return e!=null&&typeof e=="object"}var C=T;var P="[object Object]";var E=Function.prototype,S=Object.prototype;var M=E.toString;var I=S.hasOwnProperty;var N=M.call(Object);function O(e){if(!C(e)||_(e)!=P){return false}var t=A(e);if(t===null){return true}var i=I.call(t,"constructor")&&t.constructor;return typeof i=="function"&&i instanceof i&&M.call(i)==N}var z=O;function R(){this.__data__=[];this.size=0}var L=R;function D(e,t){return e===t||e!==e&&t!==t}var V=D;function j(e,t){var i=e.length;while(i--){if(V(e[i][0],t)){return i}}return-1}var B=j;var F=Array.prototype;var H=F.splice;function U(e){var t=this.__data__,i=B(t,e);if(i<0){return false}var n=t.length-1;if(i==n){t.pop()}else{H.call(t,i,1)}--this.size;return true}var W=U;function q(e){var t=this.__data__,i=B(t,e);return i<0?undefined:t[i][1]}var $=q;function Y(e){return B(this.__data__,e)>-1}var G=Y;function K(e,t){var i=this.__data__,n=B(i,e);if(n<0){++this.size;i.push([e,t])}else{i[n][1]=t}return this}var Q=K;function J(e){var t=-1,i=e==null?0:e.length;this.clear();while(++t-1&&e%1==0&&e-1&&e%1==0&&e<=ti}var ni=ii;var oi="[object Arguments]",ri="[object Array]",si="[object Boolean]",ai="[object Date]",ci="[object Error]",li="[object Function]",di="[object Map]",ui="[object Number]",hi="[object Object]",fi="[object RegExp]",mi="[object Set]",gi="[object String]",pi="[object WeakMap]";var bi="[object ArrayBuffer]",wi="[object DataView]",ki="[object Float32Array]",_i="[object Float64Array]",vi="[object Int8Array]",yi="[object Int16Array]",xi="[object Int32Array]",Ai="[object Uint8Array]",Ti="[object Uint8ClampedArray]",Ci="[object Uint16Array]",Pi="[object Uint32Array]";var Ei={};Ei[ki]=Ei[_i]=Ei[vi]=Ei[yi]=Ei[xi]=Ei[Ai]=Ei[Ti]=Ei[Ci]=Ei[Pi]=true;Ei[oi]=Ei[ri]=Ei[bi]=Ei[si]=Ei[wi]=Ei[ai]=Ei[ci]=Ei[li]=Ei[di]=Ei[ui]=Ei[hi]=Ei[fi]=Ei[mi]=Ei[gi]=Ei[pi]=false;function Si(e){return C(e)&&ni(e.length)&&!!Ei[_(e)]}var Mi=Si;function Ii(e){return function(t){return e(t)}}var Ni=Ii;var Oi=i(5);var zi=Oi["a"]&&Oi["a"].isTypedArray;var Ri=zi?Ni(zi):Mi;var Li=Ri;var Di=Object.prototype;var Vi=Di.hasOwnProperty;function ji(e,t){var i=Kt(e),n=!i&&Yt(e),o=!i&&!n&&Object(Qt["a"])(e),r=!i&&!n&&!o&&Li(e),s=i||n||o||r,a=s?jt(e.length,String):[],c=a.length;for(var l in e){if((t||Vi.call(e,l))&&!(s&&(l=="length"||o&&(l=="offset"||l=="parent")||r&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||ei(l,c)))){a.push(l)}}return a}var Bi=ji;var Fi=Object.prototype;function Hi(e){var t=e&&e.constructor,i=typeof t=="function"&&t.prototype||Fi;return e===i}var Ui=Hi;var Wi=y(Object.keys,Object);var qi=Wi;var $i=Object.prototype;var Yi=$i.hasOwnProperty;function Gi(e){if(!Ui(e)){return qi(e)}var t=[];for(var i in Object(e)){if(Yi.call(e,i)&&i!="constructor"){t.push(i)}}return t}var Ki=Gi;function Qi(e){return e!=null&&ni(e.length)&&!me(e)}var Ji=Qi;function Zi(e){return Ji(e)?Bi(e):Ki(e)}var Xi=Zi;function en(e,t){return e&&Dt(t,Xi(t),e)}var tn=en;function nn(e){var t=[];if(e!=null){for(var i in Object(e)){t.push(i)}}return t}var on=nn;var rn=Object.prototype;var sn=rn.hasOwnProperty;function an(e){if(!ce(e)){return on(e)}var t=Ui(e),i=[];for(var n in e){if(!(n=="constructor"&&(t||!sn.call(e,n)))){i.push(n)}}return i}var cn=an;function ln(e){return Ji(e)?Bi(e,true):cn(e)}var dn=ln;function un(e,t){return e&&Dt(t,dn(t),e)}var hn=un;var fn=i(8);function mn(e,t){var i=-1,n=e.length;t||(t=Array(n));while(++i{this._setToTarget(e,n,t[n],i)})}}function Qr(e){return $r(e,Jr)}function Jr(e){return Gr(e)?e:undefined}function Zr(){return function e(){e.called=true}}var Xr=Zr;class es{constructor(e,t){this.source=e;this.name=t;this.path=[];this.stop=Xr();this.off=Xr()}}const ts=new Array(256).fill().map((e,t)=>("0"+t.toString(16)).slice(-2));function is(){const e=Math.random()*4294967296>>>0;const t=Math.random()*4294967296>>>0;const i=Math.random()*4294967296>>>0;const n=Math.random()*4294967296>>>0;return"e"+ts[e>>0&255]+ts[e>>8&255]+ts[e>>16&255]+ts[e>>24&255]+ts[t>>0&255]+ts[t>>8&255]+ts[t>>16&255]+ts[t>>24&255]+ts[i>>0&255]+ts[i>>8&255]+ts[i>>16&255]+ts[i>>24&255]+ts[n>>0&255]+ts[n>>8&255]+ts[n>>16&255]+ts[n>>24&255]}const ns={get(e){if(typeof e!="number"){return this[e]||this.normal}else{return e}},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};var os=ns;var rs=i(6);var ss=i(0);const as=Symbol("listeningTo");const cs=Symbol("emitterId");const ls={on(e,t,i={}){this.listenTo(this,e,t,i)},once(e,t,i){let n=false;const o=function(e,...i){if(!n){n=true;e.off();t.call(this,e,...i)}};this.listenTo(this,e,o,i)},off(e,t){this.stopListening(this,e,t)},listenTo(e,t,i,n={}){let o,r;if(!this[as]){this[as]={}}const s=this[as];if(!fs(e)){hs(e)}const a=fs(e);if(!(o=s[a])){o=s[a]={emitter:e,callbacks:{}}}if(!(r=o.callbacks[t])){r=o.callbacks[t]=[]}r.push(i);ps(e,t);const c=bs(e,t);const l=os.get(n.priority);const d={callback:i,priority:l};for(const e of c){let t=false;for(let i=0;i{if(!this._delegations){this._delegations=new Map}e.forEach(e=>{const n=this._delegations.get(e);if(!n){this._delegations.set(e,new Map([[t,i]]))}else{n.set(t,i)}})}}},stopDelegating(e,t){if(!this._delegations){return}if(!e){this._delegations.clear()}else if(!t){this._delegations.delete(e)}else{const i=this._delegations.get(e);if(i){i.delete(t)}}}};var ds=ls;function us(e,t){if(e[as]&&e[as][t]){return e[as][t].emitter}return null}function hs(e,t){if(!e[cs]){e[cs]=t||is()}}function fs(e){return e[cs]}function ms(e){if(!e._events){Object.defineProperty(e,"_events",{value:{}})}return e._events}function gs(){return{callbacks:[],childEvents:[]}}function ps(e,t){const i=ms(e);if(i[t]){return}let n=t;let o=null;const r=[];while(n!==""){if(i[n]){break}i[n]=gs();r.push(i[n]);if(o){i[n].childEvents.push(o)}o=n;n=n.substr(0,n.lastIndexOf(":"))}if(n!==""){for(const e of r){e.callbacks=i[n].callbacks.slice()}i[n].childEvents.push(o)}}function bs(e,t){const i=ms(e)[t];if(!i){return[]}let n=[i.callbacks];for(let t=0;t-1){return ws(e,t.substr(0,t.lastIndexOf(":")))}else{return null}}return i.callbacks}function ks(e,t,i){for(let[n,o]of e){if(!o){o=t.name}else if(typeof o=="function"){o=o(t.name)}const e=new es(t.source,o);e.path=[...t.path];n.fire(e,...i)}}function _s(e,t,i){const n=bs(e,t);for(const e of n){for(let t=0;t{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach(i=>{if(i in e.prototype){return}const n=Object.getOwnPropertyDescriptor(t,i);n.enumerable=false;Object.defineProperty(e.prototype,i,n)})})}class xs{constructor(e={},t={}){const i=vs(e);if(!i){t=e}this._items=[];this._itemMap=new Map;this._idProperty=t.idProperty||"id";this._bindToExternalToInternalMap=new WeakMap;this._bindToInternalToExternalMap=new WeakMap;this._skippedIndexesFromExternal=[];if(i){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(t===undefined){t=this._items.length}else if(t>this._items.length||t<0){throw new ss["b"]("collection-add-item-invalid-index",this)}for(let i=0;i{this._setUpBindToBinding(t=>new e(t))},using:e=>{if(typeof e=="function"){this._setUpBindToBinding(t=>e(t))}else{this._setUpBindToBinding(t=>t[e])}}}}_setUpBindToBinding(e){const t=this._bindToCollection;const i=(i,n,o)=>{const r=t._bindToCollection==this;const s=t._bindToInternalToExternalMap.get(n);if(r&&s){this._bindToExternalToInternalMap.set(n,s);this._bindToInternalToExternalMap.set(s,n)}else{const i=e(n);if(!i){this._skippedIndexesFromExternal.push(o);return}let r=o;for(const e of this._skippedIndexesFromExternal){if(o>e){r--}}for(const e of t._skippedIndexesFromExternal){if(r>=e){r++}}this._bindToExternalToInternalMap.set(n,i);this._bindToInternalToExternalMap.set(i,n);this.add(i,r);for(let e=0;e{const n=this._bindToExternalToInternalMap.get(t);if(n){this.remove(n)}this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((e,t)=>{if(it){e.push(t)}return e},[])})}_getItemIdBeforeAdding(e){const t=this._idProperty;let i;if(t in e){i=e[t];if(typeof i!="string"){throw new ss["b"]("collection-add-invalid-id",this)}if(this.get(i)){throw new ss["b"]("collection-add-item-already-exists",this)}}else{e[t]=i=is()}return i}_remove(e){let t,i,n;let o=false;const r=this._idProperty;if(typeof e=="string"){i=e;n=this._itemMap.get(i);o=!n;if(n){t=this._items.indexOf(n)}}else if(typeof e=="number"){t=e;n=this._items[t];o=!n;if(n){i=n[r]}}else{n=e;i=n[r];t=this._items.indexOf(n);o=t==-1||!this._itemMap.get(i)}if(o){throw new ss["b"]("collection-remove-404: Item not found.",this)}this._items.splice(t,1);this._itemMap.delete(i);const s=this._bindToInternalToExternalMap.get(n);this._bindToInternalToExternalMap.delete(n);this._bindToExternalToInternalMap.delete(s);this.fire("remove",n,t);return[n,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}ys(xs,ds);class As{constructor(e,t=[],i=[]){this._context=e;this._plugins=new Map;this._availablePlugins=new Map;for(const e of t){if(e.pluginName){this._availablePlugins.set(e.pluginName,e)}}this._contextPlugins=new Map;for(const[e,t]of i){this._contextPlugins.set(e,t);this._contextPlugins.set(t,e);if(e.pluginName){this._availablePlugins.set(e.pluginName,e)}}}*[Symbol.iterator](){for(const e of this._plugins){if(typeof e[0]=="function"){yield e}}}get(e){const t=this._plugins.get(e);if(!t){const t="plugincollection-plugin-not-loaded: The requested plugin is not loaded.";let i=e;if(typeof e=="function"){i=e.pluginName||e.name}throw new ss["b"](t,this._context,{plugin:i})}return t}has(e){return this._plugins.has(e)}init(e,t=[]){const i=this;const n=this._context;const o=new Set;const r=[];const s=m(e);const a=m(t);const c=f(e);if(c){const e="plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.";console.error(Object(ss["a"])(e),{plugins:c});return Promise.reject(new ss["b"](e,n,{plugins:c}))}return Promise.all(s.map(l)).then(()=>d(r,"init")).then(()=>d(r,"afterInit")).then(()=>r);function l(e){if(a.includes(e)){return}if(i._plugins.has(e)||o.has(e)){return}return u(e).catch(t=>{console.error(Object(ss["a"])("plugincollection-load: It was not possible to load the plugin."),{plugin:e});throw t})}function d(e,t){return e.reduce((e,n)=>{if(!n[t]){return e}if(i._contextPlugins.has(n)){return e}return e.then(n[t].bind(n))},Promise.resolve())}function u(e){return new Promise(s=>{o.add(e);if(e.requires){e.requires.forEach(i=>{const o=h(i);if(e.isContextPlugin&&!o.isContextPlugin){throw new ss["b"]("plugincollection-context-required: Context plugin can not require plugin which is not a context plugin",null,{plugin:o.name,requiredBy:e.name})}if(t.includes(o)){throw new ss["b"]("plugincollection-required: Cannot load a plugin because one of its dependencies is listed in"+"the `removePlugins` option.",n,{plugin:o.name,requiredBy:e.name})}l(o)})}const a=i._contextPlugins.get(e)||new e(n);i._add(e,a);r.push(a);s()})}function h(e){if(typeof e=="function"){return e}return i._availablePlugins.get(e)}function f(e){const t=[];for(const i of e){if(!h(i)){t.push(i)}}return t.length?t:null}function m(e){return e.map(e=>h(e)).filter(e=>!!e)}}destroy(){const e=[];for(const[,t]of this){if(typeof t.destroy=="function"&&!this._contextPlugins.has(t)){e.push(t.destroy())}}return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const i=e.pluginName;if(!i){return}if(this._plugins.has(i)){throw new ss["b"]("plugincollection-plugin-name-conflict: Two plugins with the same name were loaded.",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e})}this._plugins.set(i,t)}}ys(As,ds);if(!window.CKEDITOR_TRANSLATIONS){window.CKEDITOR_TRANSLATIONS={}}function Ts(e,t,i){if(!window.CKEDITOR_TRANSLATIONS[e]){window.CKEDITOR_TRANSLATIONS[e]={}}const n=window.CKEDITOR_TRANSLATIONS[e];n.dictionary=n.dictionary||{};n.getPluralForm=i||n.getPluralForm;Object.assign(n.dictionary,t)}function Cs(e,t,i=1){if(typeof i!=="number"){throw new ss["b"]("translation-service-quantity-not-a-number: Expecting `quantity` to be a number.",null,{quantity:i})}const n=Ss();if(n===1){e=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]}const o=t.id||t.string;if(n===0||!Es(e,o)){if(i!==1){return t.plural}return t.string}const r=window.CKEDITOR_TRANSLATIONS[e].dictionary;const s=window.CKEDITOR_TRANSLATIONS[e].getPluralForm||(e=>e===1?0:1);if(typeof r[o]==="string"){return r[o]}const a=Number(s(i));return r[o][a]}function Ps(){window.CKEDITOR_TRANSLATIONS={}}function Es(e,t){return!!window.CKEDITOR_TRANSLATIONS[e]&&!!window.CKEDITOR_TRANSLATIONS[e].dictionary[t]}function Ss(){return Object.keys(window.CKEDITOR_TRANSLATIONS).length}const Ms=["ar","fa","he","ku","ug"];class Is{constructor(e={}){this.uiLanguage=e.uiLanguage||"en";this.contentLanguage=e.contentLanguage||this.uiLanguage;this.uiLanguageDirection=Os(this.uiLanguage);this.contentLanguageDirection=Os(this.contentLanguage);this.t=(e,t)=>this._t(e,t)}get language(){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.");return this.uiLanguage}_t(e,t=[]){if(!Array.isArray(t)){t=[t]}if(typeof e==="string"){e={string:e}}const i=!!e.plural;const n=i?t[0]:1;const o=Cs(this.uiLanguage,e,n);return Ns(o,t)}}function Ns(e,t){return e.replace(/%(\d+)/g,(e,i)=>ie.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner){throw new ss["b"]("context-addEditor-private-context: Cannot add multiple editors to the context which is created by the editor.")}this.editors.add(e);if(t){this._contextOwner=e}}_removeEditor(e){if(this.editors.has(e)){this.editors.remove(e)}if(this._contextOwner===e){return this.destroy()}return Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names()){if(!["plugins","removePlugins","extraPlugins"].includes(t)){e[t]=this.config.get(t)}}return e}static create(e){return new Promise(t=>{const i=new this(e);t(i.initPlugins().then(()=>i))})}}function Rs(e,t){const i=Math.min(e.length,t.length);for(let n=0;ne.data.length){throw new ss["b"]("view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.",this)}if(i<0||t+i>e.data.length){throw new ss["b"]("view-textproxy-wrong-length: Given length value is incorrect.",this)}this.data=e.data.substring(t,t+i);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 e==="$textProxy"||e==="view:$textProxy"||e==="textProxy"||e==="view:textProxy"}getAncestors(e={includeSelf:false,parentFirst:false}){const t=[];let i=e.includeSelf?this.textNode:this.parent;while(i!==null){t[e.parentFirst?"push":"unshift"](i);i=i.parent}return t}}function Hs(e){const t=new Map;for(const i in e){t.set(i,e[i])}return t}function Us(e){if(vs(e)){return new Map(e)}else{return Hs(e)}}class Ws{constructor(...e){this._patterns=[];this.add(...e)}add(...e){for(let t of e){if(typeof t=="string"||t instanceof RegExp){t={name:t}}if(t.classes&&(typeof t.classes=="string"||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 i=qs(t,e);if(i){return{element:t,pattern:e,match:i}}}}return null}matchAll(...e){const t=[];for(const i of e){for(const e of this._patterns){const n=qs(i,e);if(n){t.push({element:i,pattern:e,match:n})}}}return t.length>0?t:null}getElementName(){if(this._patterns.length!==1){return null}const e=this._patterns[0];const t=e.name;return typeof e!="function"&&t&&!(t instanceof RegExp)?t:null}}function qs(e,t){if(typeof t=="function"){return t(e)}const i={};if(t.name){i.name=$s(t.name,e.name);if(!i.name){return null}}if(t.attributes){i.attributes=Ys(t.attributes,e);if(!i.attributes){return null}}if(t.classes){i.classes=Gs(t.classes,e);if(!i.classes){return false}}if(t.styles){i.styles=Ks(t.styles,e);if(!i.styles){return false}}return i}function $s(e,t){if(e instanceof RegExp){return e.test(t)}return e===t}function Ys(e,t){const i=[];for(const n in e){const o=e[n];if(t.hasAttribute(n)){const e=t.getAttribute(n);if(o===true){i.push(n)}else if(o instanceof RegExp){if(o.test(e)){i.push(n)}else{return null}}else if(e===o){i.push(n)}else{return null}}else{return null}}return i}function Gs(e,t){const i=[];for(const n of e){if(n instanceof RegExp){const e=t.getClassNames();for(const t of e){if(n.test(t)){i.push(t)}}if(i.length===0){return null}}else if(t.hasClass(n)){i.push(n)}else{return null}}return i}function Ks(e,t){const i=[];for(const n in e){const o=e[n];if(t.hasStyle(n)){const e=t.getStyle(n);if(o instanceof RegExp){if(o.test(e)){i.push(n)}else{return null}}else if(e===o){i.push(n)}else{return null}}else{return null}}return i}var Qs="[object Symbol]";function Js(e){return typeof e=="symbol"||C(e)&&_(e)==Qs}var Zs=Js;var Xs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ea=/^\w*$/;function ta(e,t){if(Kt(e)){return false}var i=typeof e;if(i=="number"||i=="symbol"||i=="boolean"||e==null||Zs(e)){return true}return ea.test(e)||!Xs.test(e)||t!=null&&e in Object(t)}var ia=ta;var na="Expected a function";function oa(e,t){if(typeof e!="function"||t!=null&&typeof t!="function"){throw new TypeError(na)}var i=function(){var n=arguments,o=t?t.apply(this,n):n[0],r=i.cache;if(r.has(o)){return r.get(o)}var s=e.apply(this,n);i.cache=r.set(o,s)||r;return s};i.cache=new(oa.Cache||_t);return i}oa.Cache=_t;var ra=oa;var sa=500;function aa(e){var t=ra(e,(function(e){if(i.size===sa){i.clear()}return e}));var i=t.cache;return t}var ca=aa;var la=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var da=/\\(\\)?/g;var ua=ca((function(e){var t=[];if(e.charCodeAt(0)===46){t.push("")}e.replace(la,(function(e,i,n,o){t.push(n?o.replace(da,"$1"):i||e)}));return t}));var ha=ua;function fa(e,t){var i=-1,n=e==null?0:e.length,o=Array(n);while(++io?0:o+t}i=i>o?o:i;if(i<0){i+=o}o=t>i?0:i-t>>>0;t>>>=0;var r=Array(o);while(++n0){if(++t>=mc){return arguments[0]}}else{t=0}return e.apply(undefined,arguments)}}var wc=bc;var kc=wc(fc);var _c=kc;function vc(e,t){return _c(lc(e,t,oc),e+"")}var yc=vc;function xc(e,t,i){if(!ce(i)){return false}var n=typeof t;if(n=="number"?Ji(i)&&ei(t,i.length):n=="string"&&t in i){return V(i[t],e)}return false}var Ac=xc;function Tc(e){return yc((function(t,i){var n=-1,o=i.length,r=o>1?i[o-1]:undefined,s=o>2?i[2]:undefined;r=e.length>3&&typeof r=="function"?(o--,r):undefined;if(s&&Ac(i[0],i[1],s)){r=o<3?undefined:r;o=1}t=Object(t);while(++nt===e);return Array.isArray(i)}set(e,t){if(ce(e)){for(const[t,i]of Object.entries(e)){this._styleProcessor.toNormalizedForm(t,i,this._styles)}}else{this._styleProcessor.toNormalizedForm(e,t,this._styles)}}remove(e){const t=Lc(e);Va(this._styles,t);delete this._styles[e];this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){if(this.isEmpty){return""}return this._getStylesEntries().map(e=>e.join(":")).sort().join(";")+";"}getAsString(e){if(this.isEmpty){return}if(this._styles[e]&&!ce(this._styles[e])){return this._styles[e]}const t=this._styleProcessor.getReducedForm(e,this._styles);const i=t.find(([t])=>t===e);if(Array.isArray(i)){return i[1]}}getStyleNames(){if(this.isEmpty){return[]}const e=this._getStylesEntries();return e.map(([e])=>e)}clear(){this._styles={}}_getStylesEntries(){const e=[];const t=Object.keys(this._styles);for(const i of t){e.push(...this._styleProcessor.getReducedForm(i,this._styles))}return e}_cleanEmptyObjectsOnPath(e){const t=e.split(".");const i=t.length>1;if(!i){return}const n=t.splice(0,t.length-1).join(".");const o=Ba(this._styles,n);if(!o){return}const r=!Array.from(Object.keys(o)).length;if(r){this.remove(n)}}}class zc{constructor(){this._normalizers=new Map;this._extractors=new Map;this._reducers=new Map;this._consumables=new Map}toNormalizedForm(e,t,i){if(ce(t)){Dc(i,Lc(e),t);return}if(this._normalizers.has(e)){const n=this._normalizers.get(e);const{path:o,value:r}=n(t);Dc(i,o,r)}else{Dc(i,e,t)}}getNormalized(e,t){if(!e){return Ec({},t)}if(t[e]!==undefined){return t[e]}if(this._extractors.has(e)){const i=this._extractors.get(e);if(typeof i==="string"){return Ba(t,i)}const n=i(e,t);if(n){return n}}return Ba(t,Lc(e))}getReducedForm(e,t){const i=this.getNormalized(e,t);if(i===undefined){return[]}if(this._reducers.has(e)){const t=this._reducers.get(e);return t(i)}return[[e,i]]}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 i of t){this._mapStyleNames(i,[e])}}_mapStyleNames(e,t){if(!this._consumables.has(e)){this._consumables.set(e,[])}this._consumables.get(e).push(...t)}}function Rc(e){let t=null;let i=0;let n=0;let o=null;const r=new Map;if(e===""){return r}if(e.charAt(e.length-1)!=";"){e=e+";"}for(let s=0;s0){yield"class"}if(!this._styles.isEmpty){yield"style"}yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries();if(this._classes.size>0){yield["class",this.getAttribute("class")]}if(!this._styles.isEmpty){yield["style",this.getAttribute("style")]}}getAttribute(e){if(e=="class"){if(this._classes.size>0){return[...this._classes].join(" ")}return undefined}if(e=="style"){const e=this._styles.toString();return e==""?undefined:e}return this._attrs.get(e)}hasAttribute(e){if(e=="class"){return this._classes.size>0}if(e=="style"){return!this._styles.isEmpty}return this._attrs.has(e)}isSimilar(e){if(!(e instanceof Vc)){return false}if(this===e){return true}if(this.name!=e.name){return false}if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size){return false}for(const[t,i]of this._attrs){if(!e._attrs.has(t)||e._attrs.get(t)!==i){return false}}for(const t of this._classes){if(!e._classes.has(t)){return false}}for(const t of this._styles.getStyleNames()){if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t)){return false}}return true}hasClass(...e){for(const t of e){if(!this._classes.has(t)){return false}}return true}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 false}}return true}findAncestor(...e){const t=new Ws(...e);let i=this.parent;while(i){if(t.match(i)){return i}i=i.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(",");const t=this._styles.toString();const i=Array.from(this._attrs).map(e=>`${e[0]}="${e[1]}"`).sort().join(" ");return this.name+(e==""?"":` class="${e}"`)+(!t?"":` style="${t}"`)+(i==""?"":` ${i}`)}_clone(e=false){const t=[];if(e){for(const i of this.getChildren()){t.push(i._clone(e))}}const i=new this.constructor(this.document,this.name,this._attrs,t);i._classes=new Set(this._classes);i._styles.set(this._styles.getNormalized());i._customProperties=new Map(this._customProperties);i.getFillerOffset=this.getFillerOffset;return i}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let i=0;const n=Fc(this.document,t);for(const t of n){if(t.parent!==null){t._remove()}t.parent=this;t.document=this.document;this._children.splice(e,0,t);e++;i++}return i}_removeChildren(e,t=1){this._fireChange("children",this);for(let i=e;i0){this._classes.clear();return true}return false}if(e=="style"){if(!this._styles.isEmpty){this._styles.clear();return true}return false}return this._attrs.delete(e)}_addClass(e){this._fireChange("attributes",this);e=Array.isArray(e)?e:[e];e.forEach(e=>this._classes.add(e))}_removeClass(e){this._fireChange("attributes",this);e=Array.isArray(e)?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];e.forEach(e=>this._styles.remove(e))}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function jc(e){e=Us(e);for(const[t,i]of e){if(i===null){e.delete(t)}else if(typeof i!="string"){e.set(t,String(i))}}return e}function Bc(e,t){const i=t.split(/\s+/);e.clear();i.forEach(t=>e.add(t))}function Fc(e,t){if(typeof t=="string"){return[new Bs(e,t)]}if(!vs(t)){t=[t]}return Array.from(t).map(t=>{if(typeof t=="string"){return new Bs(e,t)}if(t instanceof Fs){return new Bs(e,t.data)}return t})}class Hc extends Vc{constructor(e,t,i,n){super(e,t,i,n);this.getFillerOffset=Uc}is(e,t=null){if(!t){return e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}else{return t===this.name&&(e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element")}}}function Uc(){const e=[...this.getChildren()];const t=e[this.childCount-1];if(t&&t.is("element","br")){return this.childCount}for(const t of e){if(!t.is("uiElement")){return null}}return this.childCount}var Wc=Cc((function(e,t){Dt(t,dn(t),e)}));var qc=Wc;const $c=Symbol("observableProperties");const Yc=Symbol("boundObservables");const Gc=Symbol("boundProperties");const Kc={set(e,t){if(ce(e)){Object.keys(e).forEach(t=>{this.set(t,e[t])},this);return}Jc(this);const i=this[$c];if(e in this&&!i.has(e)){throw new ss["b"]("observable-set-cannot-override: Cannot override an existing property.",this)}Object.defineProperty(this,e,{enumerable:true,configurable:true,get(){return i.get(e)},set(t){const n=i.get(e);let o=this.fire("set:"+e,e,t,n);if(o===undefined){o=t}if(n!==o||!i.has(e)){i.set(e,o);this.fire("change:"+e,e,o,n)}}});this[e]=t},bind(...e){if(!e.length||!tl(e)){throw new ss["b"]("observable-bind-wrong-properties: All properties must be strings.",this)}if(new Set(e).size!==e.length){throw new ss["b"]("observable-bind-duplicate-properties: Properties must be unique.",this)}Jc(this);const t=this[Gc];e.forEach(e=>{if(t.has(e)){throw new ss["b"]("observable-bind-rebind: Cannot bind the same property more than once.",this)}});const i=new Map;e.forEach(e=>{const n={property:e,to:[]};t.set(e,n);i.set(e,n)});return{to:Zc,toMany:Xc,_observable:this,_bindProperties:e,_to:[],_bindings:i}},unbind(...e){if(!this[$c]){return}const t=this[Gc];const i=this[Yc];if(e.length){if(!tl(e)){throw new ss["b"]("observable-unbind-wrong-properties: Properties must be strings.",this)}e.forEach(e=>{const n=t.get(e);if(!n){return}let o,r,s,a;n.to.forEach(e=>{o=e[0];r=e[1];s=i.get(o);a=s[r];a.delete(n);if(!a.size){delete s[r]}if(!Object.keys(s).length){i.delete(o);this.stopListening(o,"change")}});t.delete(e)})}else{i.forEach((e,t)=>{this.stopListening(t,"change")});i.clear();t.clear()}},decorate(e){const t=this[e];if(!t){throw new ss["b"]("observablemixin-cannot-decorate-undefined: Cannot decorate an undefined method.",this,{object:this,methodName:e})}this.on(e,(e,i)=>{e.return=t.apply(this,i)});this[e]=function(...t){return this.fire(e,t)}}};qc(Kc,ds);var Qc=Kc;function Jc(e){if(e[$c]){return}Object.defineProperty(e,$c,{value:new Map});Object.defineProperty(e,Yc,{value:new Map});Object.defineProperty(e,Gc,{value:new Map})}function Zc(...e){const t=il(...e);const i=Array.from(this._bindings.keys());const n=i.length;if(!t.callback&&t.to.length>1){throw new ss["b"]("observable-bind-to-no-callback: Binding multiple observables only possible with callback.",this)}if(n>1&&t.callback){throw new ss["b"]("observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.",this)}t.to.forEach(e=>{if(e.properties.length&&e.properties.length!==n){throw new ss["b"]("observable-bind-to-properties-length: The number of properties must match.",this)}if(!e.properties.length){e.properties=this._bindProperties}});this._to=t.to;if(t.callback){this._bindings.get(i[0]).callback=t.callback}sl(this._observable,this._to);ol(this);this._bindProperties.forEach(e=>{rl(this._observable,e)})}function Xc(e,t,i){if(this._bindings.size>1){throw new ss["b"]("observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().",this)}this.to(...el(e,t),i)}function el(e,t){const i=e.map(e=>[e,t]);return Array.prototype.concat.apply([],i)}function tl(e){return e.every(e=>typeof e=="string")}function il(...e){if(!e.length){throw new ss["b"]("observable-bind-to-parse-error: Invalid argument syntax in `to()`.",null)}const t={to:[]};let i;if(typeof e[e.length-1]=="function"){t.callback=e.pop()}e.forEach(e=>{if(typeof e=="string"){i.properties.push(e)}else if(typeof e=="object"){i={observable:e,properties:[]};t.to.push(i)}else{throw new ss["b"]("observable-bind-to-parse-error: Invalid argument syntax in `to()`.",null)}});return t}function nl(e,t,i,n){const o=e[Yc];const r=o.get(i);const s=r||{};if(!s[n]){s[n]=new Set}s[n].add(t);if(!r){o.set(i,s)}}function ol(e){let t;e._bindings.forEach((i,n)=>{e._to.forEach(o=>{t=o.properties[i.callback?0:e._bindProperties.indexOf(n)];i.to.push([o.observable,t]);nl(e._observable,i,o.observable,t)})})}function rl(e,t){const i=e[Gc];const n=i.get(t);let o;if(n.callback){o=n.callback.apply(e,n.to.map(e=>e[0][e[1]]))}else{o=n.to[0];o=o[0][o[1]]}if(Object.prototype.hasOwnProperty.call(e,t)){e[t]=o}else{e.set(t,o)}}function sl(e,t){t.forEach(t=>{const i=e[Yc];let n;if(!i.get(t.observable)){e.listenTo(t.observable,"change",(o,r)=>{n=i.get(t.observable)[r];if(n){n.forEach(t=>{rl(e,t.property)})}})}})}class al extends Hc{constructor(e,t,i,n){super(e,t,i,n);this.set("isReadOnly",false);this.set("isFocused",false);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){if(!t){return e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}else{return t===this.name&&(e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element")}}destroy(){this.stopListening()}}ys(al,Qc);const cl=Symbol("rootName");class ll extends al{constructor(e,t){super(e,t);this.rootName="main"}is(e,t=null){if(!t){return 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"}else{return t===this.name&&(e==="rootElement"||e==="view:rootElement"||e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element")}}get rootName(){return this.getCustomProperty(cl)}set rootName(e){this._setCustomProperty(cl,e)}set _name(e){this.name=e}}class dl{constructor(e={}){if(!e.boundaries&&!e.startPosition){throw new ss["b"]("view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.",null)}if(e.direction&&e.direction!="forward"&&e.direction!="backward"){throw new ss["b"]("view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",e.startPosition,{direction:e.direction})}this.boundaries=e.boundaries||null;if(e.startPosition){this.position=ul._createAt(e.startPosition)}else{this.position=ul._createAt(e.boundaries[e.direction=="backward"?"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,i,n;do{n=this.position;({done:t,value:i}=this.next())}while(!t&&e(i));if(!t){this.position=n}}next(){if(this.direction=="forward"){return this._next()}else{return this._previous()}}_next(){let e=this.position.clone();const t=this.position;const i=e.parent;if(i.parent===null&&e.offset===i.childCount){return{done:true}}if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset){return{done:true}}let n;if(i instanceof Bs){if(e.isAtEnd){this.position=ul._createAfter(i);return this._next()}n=i.data[e.offset]}else{n=i.getChild(e.offset)}if(n instanceof Vc){if(!this.shallow){e=new ul(n,0)}else{e.offset++}this.position=e;return this._formatReturnValue("elementStart",n,t,e,1)}else if(n instanceof Bs){if(this.singleCharacters){e=new ul(n,0);this.position=e;return this._next()}else{let i=n.data.length;let o;if(n==this._boundaryEndParent){i=this.boundaries.end.offset;o=new Fs(n,0,i);e=ul._createAfter(o)}else{o=new Fs(n,0,n.data.length);e.offset++}this.position=e;return this._formatReturnValue("text",o,t,e,i)}}else if(typeof n=="string"){let n;if(this.singleCharacters){n=1}else{const t=i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length;n=t-e.offset}const o=new Fs(i,e.offset,n);e.offset+=n;this.position=e;return this._formatReturnValue("text",o,t,e,n)}else{e=ul._createAfter(i);this.position=e;if(this.ignoreElementEnd){return this._next()}else{return this._formatReturnValue("elementEnd",i,t,e)}}}_previous(){let e=this.position.clone();const t=this.position;const i=e.parent;if(i.parent===null&&e.offset===0){return{done:true}}if(i==this._boundaryStartParent&&e.offset==this.boundaries.start.offset){return{done:true}}let n;if(i instanceof Bs){if(e.isAtStart){this.position=ul._createBefore(i);return this._previous()}n=i.data[e.offset-1]}else{n=i.getChild(e.offset-1)}if(n instanceof Vc){if(!this.shallow){e=new ul(n,n.childCount);this.position=e;if(this.ignoreElementEnd){return this._previous()}else{return this._formatReturnValue("elementEnd",n,t,e)}}else{e.offset--;this.position=e;return this._formatReturnValue("elementStart",n,t,e,1)}}else if(n instanceof Bs){if(this.singleCharacters){e=new ul(n,n.data.length);this.position=e;return this._previous()}else{let i=n.data.length;let o;if(n==this._boundaryStartParent){const t=this.boundaries.start.offset;o=new Fs(n,t,n.data.length-t);i=o.data.length;e=ul._createBefore(o)}else{o=new Fs(n,0,n.data.length);e.offset--}this.position=e;return this._formatReturnValue("text",o,t,e,i)}}else if(typeof n=="string"){let n;if(!this.singleCharacters){const t=i===this._boundaryStartParent?this.boundaries.start.offset:0;n=e.offset-t}else{n=1}e.offset-=n;const o=new Fs(i,e.offset,n);this.position=e;return this._formatReturnValue("text",o,t,e,n)}else{e=ul._createBefore(i);this.position=e;return this._formatReturnValue("elementStart",i,t,e,1)}}_formatReturnValue(e,t,i,n,o){if(t instanceof Fs){if(t.offsetInText+t.data.length==t.textNode.data.length){if(this.direction=="forward"&&!(this.boundaries&&this.boundaries.end.isEqual(this.position))){n=ul._createAfter(t.textNode);this.position=n}else{i=ul._createAfter(t.textNode)}}if(t.offsetInText===0){if(this.direction=="backward"&&!(this.boundaries&&this.boundaries.start.isEqual(this.position))){n=ul._createBefore(t.textNode);this.position=n}else{i=ul._createBefore(t.textNode)}}}return{done:false,value:{type:e,item:t,previousPosition:i,nextPosition:n,length:o}}}}class ul{constructor(e,t){this.parent=e;this.offset=t}get nodeAfter(){if(this.parent.is("$text")){return null}return this.parent.getChild(this.offset)||null}get nodeBefore(){if(this.parent.is("$text")){return null}return this.parent.getChild(this.offset-1)||null}get isAtStart(){return this.offset===0}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;while(!(e instanceof al)){if(e.parent){e=e.parent}else{return null}}return e}getShiftedBy(e){const t=ul._createAt(this);const i=t.offset+e;t.offset=i<0?0:i;return t}getLastMatchingPosition(e,t={}){t.startPosition=this;const i=new dl(t);i.skip(e);return i.position}getAncestors(){if(this.parent.is("documentFragment")){return[this.parent]}else{return this.parent.getAncestors({includeSelf:true})}}getCommonAncestor(e){const t=this.getAncestors();const i=e.getAncestors();let n=0;while(t[n]==i[n]&&t[n]){n++}return n===0?null:t[n-1]}is(e){return e==="position"||e==="view:position"}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return this.compareWith(e)=="before"}isAfter(e){return this.compareWith(e)=="after"}compareWith(e){if(this.root!==e.root){return"different"}if(this.isEqual(e)){return"same"}const t=this.parent.is("node")?this.parent.getPath():[];const i=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset);i.push(e.offset);const n=Rs(t,i);switch(n){case"prefix":return"before";case"extension":return"after";default:return t[n]0?new this(i,n):new this(n,i)}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(ul._createBefore(e),t)}}function fl(e){if(e.item.is("attributeElement")||e.item.is("uiElement")){return true}return false}function ml(e){let t=0;for(const i of e){t++}return t}class gl{constructor(e=null,t,i){this._ranges=[];this._lastRangeBackward=false;this._isFake=false;this._fakeSelectionLabel="";this.setTo(e,t,i)}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];const t=this._lastRangeBackward?e.end:e.start;return t.clone()}get focus(){if(!this._ranges.length){return null}const e=this._ranges[this._ranges.length-1];const t=this._lastRangeBackward?e.start:e.end;return t.clone()}get isCollapsed(){return this.rangeCount===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){if(this.anchor){return this.anchor.editableElement}return null}*getRanges(){for(const e of this._ranges){yield e.clone()}}getFirstRange(){let e=null;for(const t of this._ranges){if(!e||t.start.isBefore(e.start)){e=t}}return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges){if(!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 false}if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel){return false}if(this.rangeCount!=e.rangeCount){return false}else if(this.rangeCount===0){return true}if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus)){return false}for(const t of this._ranges){let i=false;for(const n of e._ranges){if(t.isEqual(n)){i=true;break}}if(!i){return false}}return true}isSimilar(e){if(this.isBackward!=e.isBackward){return false}const t=ml(this.getRanges());const i=ml(e.getRanges());if(t!=i){return false}if(t==0){return true}for(let t of this.getRanges()){t=t.getTrimmed();let i=false;for(let n of e.getRanges()){n=n.getTrimmed();if(t.start.isEqual(n.start)&&t.end.isEqual(n.end)){i=true;break}}if(!i){return false}}return true}getSelectedElement(){if(this.rangeCount!==1){return null}return this.getFirstRange().getContainedElement()}setTo(e,t,i){if(e===null){this._setRanges([]);this._setFakeOptions(t)}else if(e instanceof gl||e instanceof pl){this._setRanges(e.getRanges(),e.isBackward);this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel})}else if(e instanceof hl){this._setRanges([e],t&&t.backward);this._setFakeOptions(t)}else if(e instanceof ul){this._setRanges([new hl(e)]);this._setFakeOptions(t)}else if(e instanceof js){const n=!!i&&!!i.backward;let o;if(t===undefined){throw new ss["b"]("view-selection-setTo-required-second-parameter: "+"selection.setTo requires the second parameter when the first parameter is a node.",this)}else if(t=="in"){o=hl._createIn(e)}else if(t=="on"){o=hl._createOn(e)}else{o=new hl(ul._createAt(e,t))}this._setRanges([o],n);this._setFakeOptions(i)}else if(vs(e)){this._setRanges(e,t&&t.backward);this._setFakeOptions(t)}else{throw new ss["b"]("view-selection-setTo-not-selectable: Cannot set selection to given place.",this)}this.fire("change")}setFocus(e,t){if(this.anchor===null){throw new ss["b"]("view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.",this)}const i=ul._createAt(e,t);if(i.compareWith(this.focus)=="same"){return}const n=this.anchor;this._ranges.pop();if(i.compareWith(n)=="before"){this._addRange(new hl(i,n),true)}else{this._addRange(new hl(n,i))}this.fire("change")}is(e){return e==="selection"||e==="view:selection"}_setRanges(e,t=false){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=false){if(!(e instanceof hl)){throw new ss["b"]("view-selection-add-range-not-range: "+"Selection range set to an object that is not an instance of view.Range",this)}this._pushRange(e);this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges){if(e.isIntersecting(t)){throw new ss["b"]("view-selection-range-intersects: Trying to add a range that intersects with another range from selection.",this,{addedRange:e,intersectingRange:t})}}this._ranges.push(new hl(e.start,e.end))}}ys(gl,ds);class pl{constructor(e=null,t,i){this._selection=new gl;this._selection.delegate("change").to(this);this._selection.setTo(e,t,i)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}is(e){return e==="selection"||e=="documentSelection"||e=="view:selection"||e=="view:documentSelection"}_setTo(e,t,i){this._selection.setTo(e,t,i)}_setFocus(e,t){this._selection.setFocus(e,t)}}ys(pl,ds);class bl{constructor(e){this.selection=new pl;this.roots=new xs({idProperty:"rootName"});this.stylesProcessor=e;this.set("isReadOnly",false);this.set("isFocused",false);this.set("isComposing",false);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=false;do{for(const i of this._postFixers){t=i(e);if(t){break}}}while(t)}}ys(bl,Qc);const wl=10;class kl extends Vc{constructor(e,t,i,n){super(e,t,i,n);this.getFillerOffset=_l;this._priority=wl;this._id=null;this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null){throw new ss["b"]("attribute-element-get-elements-with-same-id-no-id: "+"Cannot get elements with the same id for an attribute element without id.",this)}return new Set(this._clonesGroup)}is(e,t=null){if(!t){return e==="attributeElement"||e==="view:attributeElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}else{return t===this.name&&(e==="attributeElement"||e==="view:attributeElement"||e==="element"||e==="view:element")}}isSimilar(e){if(this.id!==null||e.id!==null){return this.id===e.id}return super.isSimilar(e)&&this.priority==e.priority}_clone(e){const t=super._clone(e);t._priority=this._priority;t._id=this._id;return t}}kl.DEFAULT_PRIORITY=wl;function _l(){if(vl(this)){return null}let e=this.parent;while(e&&e.is("attributeElement")){if(vl(e)>1){return null}e=e.parent}if(!e||vl(e)>1){return null}return this.childCount}function vl(e){return Array.from(e.getChildren()).filter(e=>!e.is("uiElement")).length}class yl extends Vc{constructor(e,t,i,n){super(e,t,i,n);this.getFillerOffset=xl}is(e,t=null){if(!t){return e==="emptyElement"||e==="view:emptyElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}else{return t===this.name&&(e==="emptyElement"||e==="view:emptyElement"||e==="element"||e==="view:element")}}_insertChild(e,t){if(t&&(t instanceof js||Array.from(t).length>0)){throw new ss["b"]("view-emptyelement-cannot-add: Cannot add child nodes to EmptyElement instance.",[this,t])}}}function xl(){return null}const Al=navigator.userAgent.toLowerCase();const Tl={isMac:Pl(Al),isGecko:El(Al),isSafari:Sl(Al),isAndroid:Ml(Al),features:{isRegExpUnicodePropertySupported:Il()}};var Cl=Tl;function Pl(e){return e.indexOf("macintosh")>-1}function El(e){return!!e.match(/gecko\/\d+/)}function Sl(e){return e.indexOf(" applewebkit/")>-1&&e.indexOf("chrome")===-1}function Ml(e){return e.indexOf("android")>-1}function Il(){let e=false;try{e="ć".search(new RegExp("[\\p{L}]","u"))===0}catch(e){}return e}const Nl={"⌘":"ctrl","⇧":"shift","⌥":"alt"};const Ol={ctrl:"⌘",shift:"⇧",alt:"⌥"};const zl=Fl();function Rl(e){let t;if(typeof e=="string"){t=zl[e.toLowerCase()];if(!t){throw new ss["b"]("keyboard-unknown-key: Unknown key name.",null,{key:e})}}else{t=e.keyCode+(e.altKey?zl.alt:0)+(e.ctrlKey?zl.ctrl:0)+(e.shiftKey?zl.shift:0)}return t}function Ll(e){if(typeof e=="string"){e=Hl(e)}return e.map(e=>typeof e=="string"?Rl(e):e).reduce((e,t)=>t+e,0)}function Dl(e){if(!Cl.isMac){return e}return Hl(e).map(e=>Ol[e.toLowerCase()]||e).reduce((e,t)=>{if(e.slice(-1)in Nl){return e+t}else{return e+"+"+t}})}function Vl(e){return e==zl.arrowright||e==zl.arrowleft||e==zl.arrowup||e==zl.arrowdown}function jl(e,t){const i=t==="ltr";switch(e){case zl.arrowleft:return i?"left":"right";case zl.arrowright:return i?"right":"left";case zl.arrowup:return"up";case zl.arrowdown:return"down"}}function Bl(e,t){const i=jl(e,t);return i==="down"||i==="right"}function Fl(){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 i=String.fromCharCode(t);e[i.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 Hl(e){return e.split(/\s*\+\s*/)}class Ul extends Vc{constructor(e,t,i,n){super(e,t,i,n);this.getFillerOffset=ql}is(e,t=null){if(!t){return e==="uiElement"||e==="view:uiElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}else{return t===this.name&&(e==="uiElement"||e==="view:uiElement"||e==="element"||e==="view:element")}}_insertChild(e,t){if(t&&(t instanceof js||Array.from(t).length>0)){throw new ss["b"]("view-uielement-cannot-add: Cannot add child nodes to UIElement instance.",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 Wl(e){e.document.on("keydown",(t,i)=>$l(t,i,e.domConverter))}function ql(){return null}function $l(e,t,i){if(t.keyCode==zl.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection();const n=e.rangeCount==1&&e.getRangeAt(0).collapsed;if(n||t.shiftKey){const t=e.focusNode;const o=e.focusOffset;const r=i.domPositionToView(t,o);if(r===null){return}let s=false;const a=r.getLastMatchingPosition(e=>{if(e.item.is("uiElement")){s=true}if(e.item.is("uiElement")||e.item.is("attributeElement")){return true}return false});if(s){const t=i.viewPositionToDom(a);if(n){e.collapse(t.parent,t.offset)}else{e.extend(t.parent,t.offset)}}}}}class Yl extends Vc{constructor(e,t,i,n){super(e,t,i,n);this.getFillerOffset=Gl}is(e,t=null){if(!t){return e==="rawElement"||e==="view:rawElement"||e===this.name||e==="view:"+this.name||e==="element"||e==="view:element"||e==="node"||e==="view:node"}else{return t===this.name&&(e==="rawElement"||e==="view:rawElement"||e==="element"||e==="view:element")}}_insertChild(e,t){if(t&&(t instanceof js||Array.from(t).length>0)){throw new ss["b"]("view-rawelement-cannot-add: Cannot add child nodes to a RawElement instance.",[this,t])}}}function Gl(){return null}class Kl{constructor(e,t){this.document=e;this._children=[];if(t){this._insertChild(0,t)}}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}is(e){return e==="documentFragment"||e==="view:documentFragment"}_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 i=0;const n=Ql(this.document,t);for(const t of n){if(t.parent!==null){t._remove()}t.parent=this;this._children.splice(e,0,t);e++;i++}return i}_removeChildren(e,t=1){this._fireChange("children",this);for(let i=e;i{if(typeof t=="string"){return new Bs(e,t)}if(t instanceof Fs){return new Bs(e,t.data)}return t})}class Jl{constructor(e){this.document=e;this._cloneGroups=new Map}setSelection(e,t,i){this.document.selection._setTo(e,t,i)}setSelectionFocus(e,t){this.document.selection._setFocus(e,t)}createText(e){return new Bs(this.document,e)}createAttributeElement(e,t,i={}){const n=new kl(this.document,e,t);if(i.priority){n._priority=i.priority}if(i.id){n._id=i.id}return n}createContainerElement(e,t){return new Hc(this.document,e,t)}createEditableElement(e,t){const i=new al(this.document,e,t);i._document=this.document;return i}createEmptyElement(e,t){return new yl(this.document,e,t)}createUIElement(e,t,i){const n=new Ul(this.document,e,t);if(i){n.render=i}return n}createRawElement(e,t,i){const n=new Yl(this.document,e,t);n.render=i||(()=>{});return n}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){if(z(e)&&i===undefined){i=t}i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){if(e instanceof ul){return this._breakAttributes(e)}else{return this._breakAttributesRange(e)}}breakContainer(e){const t=e.parent;if(!t.is("containerElement")){throw new ss["b"]("view-writer-break-non-container-element: Trying to break an element which is not a container element.",this.document)}if(!t.parent){throw new ss["b"]("view-writer-break-root: Trying to break root element.",this.document)}if(e.isAtStart){return ul._createBefore(t)}else if(!e.isAtEnd){const i=t._clone(false);this.insert(ul._createAfter(t),i);const n=new hl(e,ul._createAt(t,"end"));const o=new ul(i,0);this.move(n,o)}return ul._createAfter(t)}mergeAttributes(e){const t=e.offset;const i=e.parent;if(i.is("$text")){return e}if(i.is("attributeElement")&&i.childCount===0){const e=i.parent;const t=i.index;i._remove();this._removeFromClonedElementsGroup(i);return this.mergeAttributes(new ul(e,t))}const n=i.getChild(t-1);const o=i.getChild(t);if(!n||!o){return e}if(n.is("$text")&&o.is("$text")){return nd(n,o)}else if(n.is("attributeElement")&&o.is("attributeElement")&&n.isSimilar(o)){const e=n.childCount;n._appendChild(o.getChildren());o._remove();this._removeFromClonedElementsGroup(o);return this.mergeAttributes(new ul(n,e))}return e}mergeContainers(e){const t=e.nodeBefore;const i=e.nodeAfter;if(!t||!i||!t.is("containerElement")||!i.is("containerElement")){throw new ss["b"]("view-writer-merge-containers-invalid-position: "+"Element before and after given position cannot be merged.",this.document)}const n=t.getChild(t.childCount-1);const o=n instanceof Bs?ul._createAt(n,"end"):ul._createAt(t,"end");this.move(hl._createIn(i),ul._createAt(t,"end"));this.remove(hl._createOn(i));return o}insert(e,t){t=vs(t)?[...t]:[t];od(t,this.document);const i=Xl(e);if(!i){throw new ss["b"]("view-writer-invalid-position-container",this.document)}const n=this._breakAttributes(e,true);const o=i._insertChild(n.offset,t);for(const e of t){this._addToClonedElementsGroup(e)}const r=n.getShiftedBy(o);const s=this.mergeAttributes(n);if(o===0){return new hl(s,s)}else{if(!s.isEqual(n)){r.offset--}const e=this.mergeAttributes(r);return new hl(s,e)}}remove(e){const t=e instanceof hl?e:hl._createOn(e);ad(t,this.document);if(t.isCollapsed){return new Kl(this.document)}const{start:i,end:n}=this._breakAttributesRange(t,true);const o=i.parent;const r=n.offset-i.offset;const s=o._removeChildren(i.offset,r);for(const e of s){this._removeFromClonedElementsGroup(e)}const a=this.mergeAttributes(i);t.start=a;t.end=a.clone();return new Kl(this.document,s)}clear(e,t){ad(e,this.document);const i=e.getWalker({direction:"backward",ignoreElementEnd:true});for(const n of i){const i=n.item;let o;if(i.is("element")&&t.isSimilar(i)){o=hl._createOn(i)}else if(!n.nextPosition.isAfter(e.start)&&i.is("$textProxy")){const e=i.getAncestors().find(e=>e.is("element")&&t.isSimilar(e));if(e){o=hl._createIn(e)}}if(o){if(o.end.isAfter(e.end)){o.end=e.end}if(o.start.isBefore(e.start)){o.start=e.start}this.remove(o)}}}move(e,t){let i;if(t.isAfter(e.end)){t=this._breakAttributes(t,true);const n=t.parent;const o=n.childCount;e=this._breakAttributesRange(e,true);i=this.remove(e);t.offset+=n.childCount-o}else{i=this.remove(e)}return this.insert(t,i)}wrap(e,t){if(!(t instanceof kl)){throw new ss["b"]("view-writer-wrap-invalid-attribute",this.document)}ad(e,this.document);if(!e.isCollapsed){return this._wrapRange(e,t)}else{let i=e.start;if(i.parent.is("element")&&!Zl(i.parent)){i=i.getLastMatchingPosition(e=>e.item.is("uiElement"))}i=this._wrapPosition(i,t);const n=this.document.selection;if(n.isCollapsed&&n.getFirstPosition().isEqual(e.start)){this.setSelection(i)}return new hl(i)}}unwrap(e,t){if(!(t instanceof kl)){throw new ss["b"]("view-writer-unwrap-invalid-attribute",this.document)}ad(e,this.document);if(e.isCollapsed){return e}const{start:i,end:n}=this._breakAttributesRange(e,true);const o=i.parent;const r=this._unwrapChildren(o,i.offset,n.offset,t);const s=this.mergeAttributes(r.start);if(!s.isEqual(r.start)){r.end.offset--}const a=this.mergeAttributes(r.end);return new hl(s,a)}rename(e,t){const i=new Hc(this.document,e,t.getAttributes());this.insert(ul._createAfter(t),i);this.move(hl._createIn(t),ul._createAt(i,0));this.remove(hl._createOn(t));return i}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return ul._createAt(e,t)}createPositionAfter(e){return ul._createAfter(e)}createPositionBefore(e){return ul._createBefore(e)}createRange(e,t){return new hl(e,t)}createRangeOn(e){return hl._createOn(e)}createRangeIn(e){return hl._createIn(e)}createSelection(e,t,i){return new gl(e,t,i)}_wrapChildren(e,t,i,n){let o=t;const r=[];while(ofalse;e.parent._insertChild(e.offset,i);const n=new hl(e,e.getShiftedBy(1));this.wrap(n,t);const o=new ul(i.parent,i.index);i._remove();const r=o.nodeBefore;const s=o.nodeAfter;if(r instanceof Bs&&s instanceof Bs){return nd(r,s)}return td(o)}_wrapAttributeElement(e,t){if(!cd(e,t)){return false}if(e.name!==t.name||e.priority!==t.priority){return false}for(const i of e.getAttributeKeys()){if(i==="class"||i==="style"){continue}if(t.hasAttribute(i)&&t.getAttribute(i)!==e.getAttribute(i)){return false}}for(const i of e.getStyleNames()){if(t.hasStyle(i)&&t.getStyle(i)!==e.getStyle(i)){return false}}for(const i of e.getAttributeKeys()){if(i==="class"||i==="style"){continue}if(!t.hasAttribute(i)){this.setAttribute(i,e.getAttribute(i),t)}}for(const i of e.getStyleNames()){if(!t.hasStyle(i)){this.setStyle(i,e.getStyle(i),t)}}for(const i of e.getClassNames()){if(!t.hasClass(i)){this.addClass(i,t)}}return true}_unwrapAttributeElement(e,t){if(!cd(e,t)){return false}if(e.name!==t.name||e.priority!==t.priority){return false}for(const i of e.getAttributeKeys()){if(i==="class"||i==="style"){continue}if(!t.hasAttribute(i)||t.getAttribute(i)!==e.getAttribute(i)){return false}}if(!t.hasClass(...e.getClassNames())){return false}for(const i of e.getStyleNames()){if(!t.hasStyle(i)||t.getStyle(i)!==e.getStyle(i)){return false}}for(const i of e.getAttributeKeys()){if(i==="class"||i==="style"){continue}this.removeAttribute(i,t)}this.removeClass(Array.from(e.getClassNames()),t);this.removeStyle(Array.from(e.getStyleNames()),t);return true}_breakAttributesRange(e,t=false){const i=e.start;const n=e.end;ad(e,this.document);if(e.isCollapsed){const i=this._breakAttributes(e.start,t);return new hl(i,i)}const o=this._breakAttributes(n,t);const r=o.parent.childCount;const s=this._breakAttributes(i,t);o.offset+=o.parent.childCount-r;return new hl(s,o)}_breakAttributes(e,t=false){const i=e.offset;const n=e.parent;if(e.parent.is("emptyElement")){throw new ss["b"]("view-writer-cannot-break-empty-element",this.document)}if(e.parent.is("uiElement")){throw new ss["b"]("view-writer-cannot-break-ui-element",this.document)}if(e.parent.is("rawElement")){throw new ss["b"]("view-writer-cannot-break-raw-element: Cannot break inside a RawElement instance.",this.document)}if(!t&&n.is("$text")&&sd(n.parent)){return e.clone()}if(sd(n)){return e.clone()}if(n.is("$text")){return this._breakAttributes(id(e),t)}const o=n.childCount;if(i==o){const e=new ul(n.parent,n.index+1);return this._breakAttributes(e,t)}else{if(i===0){const e=new ul(n.parent,n.index);return this._breakAttributes(e,t)}else{const e=n.index+1;const o=n._clone();n.parent._insertChild(e,o);this._addToClonedElementsGroup(o);const r=n.childCount-i;const s=n._removeChildren(i,r);o._appendChild(s);const a=new ul(n.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 i=this._cloneGroups.get(t);if(!i){i=new Set;this._cloneGroups.set(t,i)}i.add(e);e._clonesGroup=i}_removeFromClonedElementsGroup(e){if(e.is("element")){for(const t of e.getChildren()){this._removeFromClonedElementsGroup(t)}}const t=e.id;if(!t){return}const i=this._cloneGroups.get(t);if(!i){return}i.delete(e)}}function Zl(e){return Array.from(e.getChildren()).some(e=>!e.is("uiElement"))}function Xl(e){let t=e.parent;while(!sd(t)){if(!t){return undefined}t=t.parent}return t}function ed(e,t){if(e.priorityt.priority){return false}return e.getIdentity()i instanceof e)){throw new ss["b"]("view-writer-insert-invalid-node",t)}if(!i.is("$text")){od(i.getChildren(),t)}}}const rd=[Bs,kl,Hc,yl,Yl,Ul];function sd(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function ad(e,t){const i=Xl(e.start);const n=Xl(e.end);if(!i||!n||i!==n){throw new ss["b"]("view-writer-invalid-range-container",t)}}function cd(e,t){return e.id===null&&t.id===null}function ld(e){return Object.prototype.toString.call(e)=="[object Text]"}const dd=e=>e.createTextNode(" ");const ud=e=>{const t=e.createElement("br");t.dataset.ckeFiller=true;return t};const hd=7;const fd=(()=>{let e="";for(let t=0;t0){i.push({index:n,type:"insert",values:e.slice(n,r)})}if(o-n>0){i.push({index:n+(r-n),type:"delete",howMany:o-n})}return i}function Ad(e,t){const{firstIndex:i,lastIndexOld:n,lastIndexNew:o}=e;if(i===-1){return Array(t).fill("equal")}let r=[];if(i>0){r=r.concat(Array(i).fill("equal"))}if(o-i>0){r=r.concat(Array(o-i).fill("insert"))}if(n-i>0){r=r.concat(Array(n-i).fill("delete"))}if(o200||o>200||n+o>300){return Td.fastDiff(e,t,i,true)}let r,s;if(ol?-1:1;if(d[n+h]){d[n]=d[n+h].slice(0)}if(!d[n]){d[n]=[]}d[n].push(o>l?r:s);let f=Math.max(o,l);let m=f-n;while(ml;m--){u[m]=h(m)}u[l]=h(l);f++}while(u[l]!==c);return d[l].slice(1)}Td.fastDiff=kd;function Cd(e,t,i){e.insertBefore(i,e.childNodes[t]||null)}function Pd(e){const t=e.parentNode;if(t){t.removeChild(e)}}function Ed(e){if(e){if(e.defaultView){return e instanceof e.defaultView.Document}else if(e.ownerDocument&&e.ownerDocument.defaultView){return e instanceof e.ownerDocument.defaultView.Node}}return false}class Sd{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=false;this._inlineFiller=null;this._fakeSelectionContainer=null}markToSync(e,t){if(e==="text"){if(this.domConverter.mapViewToDom(t.parent)){this.markedTexts.add(t)}}else{if(!this.domConverter.mapViewToDom(t)){return}if(e==="attributes"){this.markedAttributes.add(t)}else if(e==="children"){this.markedChildren.add(t)}else{throw new ss["b"]("view-renderer-unknown-type: Unknown type passed to Renderer.markToSync.",this)}}}render(){let e;for(const e of this.markedChildren){this._updateChildrenMappings(e)}if(this._inlineFiller&&!this._isSelectionInInlineFiller()){this._removeInlineFiller()}if(this._inlineFiller){e=this._getInlineFillerPosition()}else if(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){if(!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)){this._updateText(t,{inlineFillerPosition:e})}}if(e){const t=this.domConverter.viewPositionToDom(e);const i=t.parent.ownerDocument;if(!md(t.parent)){this._inlineFiller=Id(i,t.parent,t.offset)}else{this._inlineFiller=t.parent}}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 i=this.domConverter.mapViewToDom(e).childNodes;const n=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:false}));const o=this._diffNodeLists(i,n);const r=this._findReplaceActions(o,i,n);if(r.indexOf("replace")!==-1){const t={equal:0,insert:0,delete:0};for(const o of r){if(o==="replace"){const o=t.equal+t.insert;const r=t.equal+t.delete;const s=e.getChild(o);if(s&&!(s.is("uiElement")||s.is("rawElement"))){this._updateElementMappings(s,i[r])}Pd(n[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();if(e.parent.is("$text")){return ul._createBefore(this.selection.getFirstPosition().parent)}else{return e}}_isSelectionInInlineFiller(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed){return false}const e=this.selection.getFirstPosition();const t=this.domConverter.viewPositionToDom(e);if(t&&ld(t.parent)&&md(t.parent)){return true}return false}_removeInlineFiller(){const e=this._inlineFiller;if(!md(e)){throw new ss["b"]("view-renderer-filler-was-lost: The inline filler node was lost.",this)}if(gd(e)){e.parentNode.removeChild(e)}else{e.data=e.data.substr(hd)}this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed){return false}const e=this.selection.getFirstPosition();const t=e.parent;const i=e.offset;if(!this.domConverter.mapViewToDom(t.root)){return false}if(!t.is("element")){return false}if(!Md(t)){return false}if(i===t.getFillerOffset()){return false}const n=e.nodeBefore;const o=e.nodeAfter;if(n instanceof Bs||o instanceof Bs){return false}return true}_updateText(e,t){const i=this.domConverter.findCorrespondingDomText(e);const n=this.domConverter.viewToDom(e,i.ownerDocument);const o=i.data;let r=n.data;const s=t.inlineFillerPosition;if(s&&s.parent==e.parent&&s.offset==e.index){r=fd+r}if(o!=r){const e=kd(o,r);for(const t of e){if(t.type==="insert"){i.insertData(t.index,t.values.join(""))}else{i.deleteData(t.index,t.howMany)}}}}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t){return}const i=Array.from(t.attributes).map(e=>e.name);const n=e.getAttributeKeys();for(const i of n){t.setAttribute(i,e.getAttribute(i))}for(const n of i){if(!e.hasAttribute(n)){t.removeAttribute(n)}}}_updateChildren(e,t){const i=this.domConverter.mapViewToDom(e);if(!i){return}const n=t.inlineFillerPosition;const o=this.domConverter.mapViewToDom(e).childNodes;const r=Array.from(this.domConverter.viewChildrenToDom(e,i.ownerDocument,{bind:true,inlineFillerPosition:n}));if(n&&n.parent===e){Id(i.ownerDocument,r,n.offset)}const s=this._diffNodeLists(o,r);let a=0;const c=new Set;for(const e of s){if(e==="delete"){c.add(o[a]);Pd(o[a])}else if(e==="equal"){a++}}a=0;for(const e of s){if(e==="insert"){Cd(i,a,r[a]);a++}else if(e==="equal"){this._markDescendantTextToSync(this.domConverter.domToView(r[a]));a++}}for(const e of c){if(!e.parentNode){this.domConverter.unbindDomElement(e)}}}_diffNodeLists(e,t){e=Rd(e,this._fakeSelectionContainer);return Td(e,t,Od.bind(null,this.domConverter))}_findReplaceActions(e,t,i){if(e.indexOf("insert")===-1||e.indexOf("delete")===-1){return e}let n=[];let o=[];let r=[];const s={equal:0,insert:0,delete:0};for(const a of e){if(a==="insert"){r.push(i[s.equal+s.insert])}else if(a==="delete"){o.push(t[s.equal+s.delete])}else{n=n.concat(Td(o,r,Nd).map(e=>e==="equal"?"replace":e));n.push("equal");o=[];r=[]}s[a]++}return n.concat(Td(o,r,Nd).map(e=>e==="equal"?"replace":e))}_markDescendantTextToSync(e){if(!e){return}if(e.is("$text")){this.markedTexts.add(e)}else if(e.is("element")){for(const t of e.getChildren()){this._markDescendantTextToSync(t)}}}_updateSelection(){if(this.selection.rangeCount===0){this._removeDomSelection();this._removeFakeSelection();return}const e=this.domConverter.mapViewToDom(this.selection.editableElement);if(!this.isFocused||!e){return}if(this.selection.isFake){this._updateFakeSelection(e)}else{this._removeFakeSelection();this._updateDomSelection(e)}}_updateFakeSelection(e){const t=e.ownerDocument;if(!this._fakeSelectionContainer){this._fakeSelectionContainer=Ld(t)}const i=this._fakeSelectionContainer;this.domConverter.bindFakeSelection(i,this.selection);if(!this._fakeSelectionNeedsUpdate(e)){return}if(!i.parentElement||i.parentElement!=e){e.appendChild(i)}i.textContent=this.selection.fakeSelectionLabel||" ";const n=t.getSelection();const o=t.createRange();n.removeAllRanges();o.selectNodeContents(i);n.addRange(o)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t)){return}const i=this.domConverter.viewPositionToDom(this.selection.anchor);const n=this.domConverter.viewPositionToDom(this.selection.focus);e.focus();t.collapse(i.parent,i.offset);t.extend(n.parent,n.offset);if(Cl.isGecko){zd(n,t)}}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e)){return true}const t=e&&this.domConverter.domSelectionToView(e);if(t&&this.selection.isEqual(t)){return false}if(!this.selection.isCollapsed&&this.selection.isSimilar(t)){return false}return true}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer;const i=e.ownerDocument.getSelection();if(!t||t.parentElement!==e){return true}if(i.anchorNode!==t&&!t.contains(i.anchorNode)){return true}return t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments){const t=e.getSelection();if(t.rangeCount){const t=e.activeElement;const i=this.domConverter.mapDomToView(t);if(t&&i){e.getSelection().removeAllRanges()}}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;if(e){e.remove()}}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;if(e){this.domConverter.focus(e)}}}}ys(Sd,Qc);function Md(e){if(e.getAttribute("contenteditable")=="false"){return false}const t=e.findAncestor(e=>e.hasAttribute("contenteditable"));return!t||t.getAttribute("contenteditable")=="true"}function Id(e,t,i){const n=t instanceof Array?t:t.childNodes;const o=n[i];if(ld(o)){o.data=fd+o.data;return o}else{const o=e.createTextNode(fd);if(Array.isArray(t)){n.splice(i,0,o)}else{Cd(t,i,o)}return o}}function Nd(e,t){return Ed(e)&&Ed(t)&&!ld(e)&&!ld(t)&&e.nodeType!==Node.COMMENT_NODE&&t.nodeType!==Node.COMMENT_NODE&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function Od(e,t,i){if(t===i){return true}else if(ld(t)&&ld(i)){return t.data===i.data}else if(e.isBlockFiller(t)&&e.isBlockFiller(i)){return true}return false}function zd(e,t){const i=e.parent;if(i.nodeType!=Node.ELEMENT_NODE||e.offset!=i.childNodes.length-1){return}const n=i.childNodes[e.offset];if(n&&n.tagName=="BR"){t.addRange(t.getRangeAt(0))}}function Rd(e,t){const i=Array.from(e);if(i.length==0||!t){return i}const n=i[i.length-1];if(n==t){i.pop()}return i}function Ld(e){const t=e.createElement("div");Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"});t.textContent=" ";return t}var Dd={window:window,document:document};function Vd(e){let t=0;while(e.previousSibling){e=e.previousSibling;t++}return t}function jd(e){const t=[];while(e&&e.nodeType!=Node.DOCUMENT_NODE){t.unshift(e);e=e.parentNode}return t}function Bd(e,t){const i=jd(e);const n=jd(t);let o=0;while(i[o]==n[o]&&i[o]){o++}return o===0?null:i[o-1]}const Fd=ud(document);class Hd{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=this.blockFillerMode=="br"?ud:dd;this._domToViewMapping=new WeakMap;this._viewToDomMapping=new WeakMap;this._fakeSelectionMapping=new WeakMap}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new gl(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,i={}){if(e.is("$text")){const i=this._processDataFromViewText(e);return t.createTextNode(i)}else{if(this.mapViewToDom(e)){return this.mapViewToDom(e)}let n;if(e.is("documentFragment")){n=t.createDocumentFragment();if(i.bind){this.bindDocumentFragments(n,e)}}else if(e.is("uiElement")){n=e.render(t);if(i.bind){this.bindElements(n,e)}return n}else{if(e.hasAttribute("xmlns")){n=t.createElementNS(e.getAttribute("xmlns"),e.name)}else{n=t.createElement(e.name)}if(e.is("rawElement")){e.render(n)}if(i.bind){this.bindElements(n,e)}for(const t of e.getAttributeKeys()){n.setAttribute(t,e.getAttribute(t))}}if(i.withChildren||i.withChildren===undefined){for(const o of this.viewChildrenToDom(e,t,i)){n.appendChild(o)}}return n}}*viewChildrenToDom(e,t,i={}){const n=e.getFillerOffset&&e.getFillerOffset();let o=0;for(const r of e.getChildren()){if(n===o){yield this._blockFiller(t)}yield this.viewToDom(r,t,i);o++}if(n===o){yield this._blockFiller(t)}}viewRangeToDom(e){const t=this.viewPositionToDom(e.start);const i=this.viewPositionToDom(e.end);const n=document.createRange();n.setStart(t.parent,t.offset);n.setEnd(i.parent,i.offset);return n}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const i=this.findCorrespondingDomText(t);if(!i){return null}let n=e.offset;if(md(i)){n+=hd}return{parent:i,offset:n}}else{let i,n,o;if(e.offset===0){i=this.mapViewToDom(t);if(!i){return null}o=i.childNodes[0]}else{const t=e.nodeBefore;n=t.is("$text")?this.findCorrespondingDomText(t):this.mapViewToDom(e.nodeBefore);if(!n){return null}i=n.parentNode;o=n.nextSibling}if(ld(o)&&md(o)){return{parent:o,offset:hd}}const r=n?Vd(n)+1:0;return{parent:i,offset:r}}}domToView(e,t={}){if(this.isBlockFiller(e,this.blockFillerMode)){return null}const i=this.getHostViewElement(e,this._domToViewMapping);if(i){return i}if(ld(e)){if(gd(e)){return null}else{const t=this._processDataFromDomText(e);return t===""?null:new Bs(this.document,t)}}else if(this.isComment(e)){return null}else{if(this.mapDomToView(e)){return this.mapDomToView(e)}let i;if(this.isDocumentFragment(e)){i=new Kl(this.document);if(t.bind){this.bindDocumentFragments(e,i)}}else{const n=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();i=new Vc(this.document,n);if(t.bind){this.bindElements(e,i)}const o=e.attributes;for(let e=o.length-1;e>=0;e--){i._setAttribute(o[e].name,o[e].value)}}if(t.withChildren||t.withChildren===undefined){for(const n of this.domChildrenToView(e,t)){i._appendChild(n)}}return i}}*domChildrenToView(e,t={}){for(let i=0;i{const{scrollLeft:t,scrollTop:i}=e;n.push([t,i])});t.focus();Wd(t,e=>{const[t,i]=n.shift();e.scrollLeft=t;e.scrollTop=i});Dd.window.scrollTo(e,i)}}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){if(this.blockFillerMode=="br"){return e.isEqualNode(Fd)}if(e.tagName==="BR"&&$d(e,this.blockElements)&&e.parentNode.childNodes.length===1){return true}return qd(e,this.blockElements)}isDomSelectionBackward(e){if(e.isCollapsed){return false}const t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset);t.setEnd(e.focusNode,e.focusOffset);const i=t.collapsed;t.detach();return i}getHostViewElement(e){const t=jd(e);t.pop();while(t.length){const e=t.pop();const i=this._domToViewMapping.get(e);if(i&&(i.is("uiElement")||i.is("rawElement"))){return i}}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}_isDomSelectionPositionCorrect(e,t){if(ld(e)&&md(e)&&tthis.preElements.includes(e.name))){return t}if(t.charAt(0)==" "){const i=this._getTouchingViewTextNode(e,false);const n=i&&this._nodeEndsWithSpace(i);if(n||!i){t=" "+t.substr(1)}}if(t.charAt(t.length-1)==" "){const i=this._getTouchingViewTextNode(e,true);if(t.charAt(t.length-2)==" "||!i||i.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 false}const t=this._processDataFromViewText(e);return t.charAt(t.length-1)==" "}_processDataFromDomText(e){let t=e.data;if(Ud(e,this.preElements)){return pd(e)}t=t.replace(/[ \n\t\r]{1,}/g," ");const i=this._getTouchingInlineDomNode(e,false);const n=this._getTouchingInlineDomNode(e,true);const o=this._checkShouldLeftTrimDomText(i);const r=this._checkShouldRightTrimDomText(e,n);if(o){t=t.replace(/^ /,"")}if(r){t=t.replace(/ $/,"")}t=pd(new Text(t));t=t.replace(/ \u00A0/g," ");if(/( |\u00A0)\u00A0$/.test(t)||!n||n.data&&n.data.charAt(0)==" "){t=t.replace(/\u00A0$/," ")}if(o){t=t.replace(/^\u00A0/," ")}return t}_checkShouldLeftTrimDomText(e){if(!e){return true}if(Gr(e)){return true}return/[^\S\u00A0]/.test(e.data.charAt(e.data.length-1))}_checkShouldRightTrimDomText(e,t){if(t){return false}return!md(e)}_getTouchingViewTextNode(e,t){const i=new dl({startPosition:t?ul._createAfter(e):ul._createBefore(e),direction:t?"forward":"backward"});for(const e of i){if(e.item.is("containerElement")){return null}else if(e.item.is("element","br")){return null}else if(e.item.is("$textProxy")){return e.item}}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode){return null}const i=t?"nextNode":"previousNode";const n=e.ownerDocument;const o=jd(e)[0];const r=n.createTreeWalker(o,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode(e){if(ld(e)){return NodeFilter.FILTER_ACCEPT}if(e.tagName=="BR"){return NodeFilter.FILTER_ACCEPT}return NodeFilter.FILTER_SKIP}});r.currentNode=e;const s=r[i]();if(s!==null){const t=Bd(e,s);if(t&&!Ud(e,this.blockElements,t)&&!Ud(s,this.blockElements,t)){return s}}return null}}function Ud(e,t,i){let n=jd(e);if(i){n=n.slice(n.indexOf(i)+1)}return n.some(e=>e.tagName&&t.includes(e.tagName.toLowerCase()))}function Wd(e,t){while(e&&e!=Dd.document){t(e);e=e.parentNode}}function qd(e,t){const i=ld(e)&&e.data==" ";return i&&$d(e,t)&&e.parentNode.childNodes.length===1}function $d(e,t){const i=e.parentNode;return i&&i.tagName&&t.includes(i.tagName.toLowerCase())}function Yd(e){const t=Object.prototype.toString.apply(e);if(t=="[object Window]"){return true}if(t=="[object global]"){return true}return false}const Gd=qc({},ds,{listenTo(e,...t){if(Ed(e)||Yd(e)){const i=this._getProxyEmitter(e)||new Qd(e);i.attach(...t);e=i}ds.listenTo.call(this,e,...t)},stopListening(e,t,i){if(Ed(e)||Yd(e)){const t=this._getProxyEmitter(e);if(!t){return}e=t}ds.stopListening.call(this,e,t,i);if(e instanceof Qd){e.detach(t)}},_getProxyEmitter(e){return us(this,Jd(e))}});var Kd=Gd;class Qd{constructor(e){hs(this,Jd(e));this._domNode=e}}qc(Qd.prototype,ds,{attach(e,t,i={}){if(this._domListeners&&this._domListeners[e]){return}const n=this._createDomListener(e,!!i.useCapture);this._domNode.addEventListener(e,n,!!i.useCapture);if(!this._domListeners){this._domListeners={}}this._domListeners[e]=n},detach(e){let t;if(this._domListeners[e]&&(!(t=this._events[e])||!t.callbacks.length)){this._domListeners[e].removeListener()}},_createDomListener(e,t){const i=t=>{this.fire(e,t)};i.removeListener=()=>{this._domNode.removeEventListener(e,i,t);delete this._domListeners[e]};return i}});function Jd(e){return e["data-ck-expando"]||(e["data-ck-expando"]=is())}class Zd{constructor(e){this.view=e;this.document=e.document;this.isEnabled=false}enable(){this.isEnabled=true}disable(){this.isEnabled=false}destroy(){this.disable();this.stopListening()}}ys(Zd,Kd);var Xd="__lodash_hash_undefined__";function eu(e){this.__data__.set(e,Xd);return this}var tu=eu;function iu(e){return this.__data__.has(e)}var nu=iu;function ou(e){var t=-1,i=e==null?0:e.length;this.__data__=new _t;while(++ta)){return false}var l=r.get(e);if(l&&r.get(t)){return l==t}var d=-1,u=true,h=i&uu?new ru:undefined;r.set(e,t);r.set(t,e);while(++d{this.listenTo(e,t,(e,t)=>{if(this.isEnabled){this.onDomEvent(t)}},{useCapture:this.useCapture})})}fire(e,t,i){if(this.isEnabled){this.document.fire(e,new Xu(this.view,t,i))}}}class th extends eh{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 Rl(this)}})}}var ih=function(){return n["a"].Date.now()};var nh=ih;var oh=0/0;var rh=/^\s+|\s+$/g;var sh=/^[-+]0x[0-9a-f]+$/i;var ah=/^0b[01]+$/i;var ch=/^0o[0-7]+$/i;var lh=parseInt;function dh(e){if(typeof e=="number"){return e}if(Zs(e)){return oh}if(ce(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ce(t)?t+"":t}if(typeof e!="string"){return e===0?e:+e}e=e.replace(rh,"");var i=ah.test(e);return i||ch.test(e)?lh(e.slice(2),i?2:8):sh.test(e)?oh:+e}var uh=dh;var hh="Expected a function";var fh=Math.max,mh=Math.min;function gh(e,t,i){var n,o,r,s,a,c,l=0,d=false,u=false,h=true;if(typeof e!="function"){throw new TypeError(hh)}t=uh(t)||0;if(ce(i)){d=!!i.leading;u="maxWait"in i;r=u?fh(uh(i.maxWait)||0,t):r;h="trailing"in i?!!i.trailing:h}function f(t){var i=n,r=o;n=o=undefined;l=t;s=e.apply(r,i);return s}function m(e){l=e;a=setTimeout(b,t);return d?f(e):s}function g(e){var i=e-c,n=e-l,o=t-i;return u?mh(o,r-n):o}function p(e){var i=e-c,n=e-l;return c===undefined||i>=t||i<0||u&&n>=r}function b(){var e=nh();if(p(e)){return w(e)}a=setTimeout(b,g(e))}function w(e){a=undefined;if(h&&n){return f(e)}n=o=undefined;return s}function k(){if(a!==undefined){clearTimeout(a)}l=0;n=c=o=a=undefined}function _(){return a===undefined?s:w(nh())}function v(){var e=nh(),i=p(e);n=arguments;o=this;c=e;if(i){if(a===undefined){return m(c)}if(u){clearTimeout(a);a=setTimeout(b,t);return f(c)}}if(a===undefined){a=setTimeout(b,t)}return s}v.cancel=k;v.flush=_;return v}var ph=gh;class bh extends Zd{constructor(e){super(e);this._fireSelectionChangeDoneDebounced=ph(e=>this.document.fire("selectionChangeDone",e),200)}observe(){const e=this.document;e.on("keydown",(t,i)=>{const n=e.selection;if(n.isFake&&wh(i.keyCode)&&this.isEnabled){i.preventDefault();this._handleSelectionMove(i.keyCode)}},{priority:"lowest"})}destroy(){super.destroy();this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection;const i=new gl(t.getRanges(),{backward:t.isBackward,fake:false});if(e==zl.arrowleft||e==zl.arrowup){i.setTo(i.getFirstPosition())}if(e==zl.arrowright||e==zl.arrowdown){i.setTo(i.getLastPosition())}const n={oldSelection:t,newSelection:i,domSelection:null};this.document.fire("selectionChange",n);this._fireSelectionChangeDoneDebounced(n)}}function wh(e){return e==zl.arrowright||e==zl.arrowleft||e==zl.arrowup||e==zl.arrowdown}class kh extends Zd{constructor(e){super(e);this.mutationObserver=e.getObserver(Zu);this.selection=this.document.selection;this.domConverter=e.domConverter;this._documents=new WeakSet;this._fireSelectionChangeDoneDebounced=ph(e=>this.document.fire("selectionChangeDone",e),200);this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3);this._loopbackCounter=0}observe(e){const t=e.ownerDocument;if(this._documents.has(t)){return}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();const i=this.domConverter.domSelectionToView(t);if(i.rangeCount==0){this.view.hasDomSelection=false;return}this.view.hasDomSelection=true;if(this.selection.isEqual(i)&&this.domConverter.isDomSelectionCorrect(t)){return}if(++this._loopbackCounter>60){return}if(this.selection.isSimilar(i)){this.view.forceRender()}else{const e={oldSelection:this.selection,newSelection:i,domSelection:t};this.document.fire("selectionChange",e);this._fireSelectionChangeDoneDebounced(e)}}_clearInfiniteLoop(){this._loopbackCounter=0}}class _h extends eh{constructor(e){super(e);this.domEventType=["focus","blur"];this.useCapture=true;const t=this.document;t.on("focus",()=>{t.isFocused=true;this._renderTimeoutId=setTimeout(()=>e.forceRender(),50)});t.on("blur",(i,n)=>{const o=t.selection.editableElement;if(o===null||o===n.target){t.isFocused=false;e.forceRender()}})}onDomEvent(e){this.fire(e.type,e)}destroy(){if(this._renderTimeoutId){clearTimeout(this._renderTimeoutId)}super.destroy()}}class vh extends eh{constructor(e){super(e);this.domEventType=["compositionstart","compositionupdate","compositionend"];const t=this.document;t.on("compositionstart",()=>{t.isComposing=true});t.on("compositionend",()=>{t.isComposing=false})}onDomEvent(e){this.fire(e.type,e)}}class yh extends eh{constructor(e){super(e);this.domEventType=["beforeinput"]}onDomEvent(e){this.fire(e.type,e)}}function xh(e){return Object.prototype.toString.apply(e)=="[object Range]"}function Ah(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}const Th=["top","right","bottom","left","width","height"];class Ch{constructor(e){const t=xh(e);Object.defineProperty(this,"_source",{value:e._source||e,writable:true,enumerable:false});if(Gr(e)||t){if(t){Ph(this,Ch.getDomRangeRects(e)[0])}else{Ph(this,e.getBoundingClientRect())}}else if(Yd(e)){const{innerWidth:t,innerHeight:i}=e;Ph(this,{top:0,right:t,bottom:i,left:0,width:t,height:i})}else{Ph(this,e)}}clone(){return new Ch(this)}moveTo(e,t){this.top=t;this.right=e+this.width;this.bottom=t+this.height;this.left=e;return this}moveBy(e,t){this.top+=t;this.right+=e;this.left+=e;this.bottom+=t;return 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)};t.width=t.right-t.left;t.height=t.bottom-t.top;if(t.width<0||t.height<0){return null}else{return new Ch(t)}}getIntersectionArea(e){const t=this.getIntersection(e);if(t){return t.getArea()}else{return 0}}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!Eh(e)){let i=e.parentNode||e.commonAncestorContainer;while(i&&!Eh(i)){const e=new Ch(i);const n=t.getIntersection(e);if(n){if(n.getArea()Bh(e,n));const s=Bh(e,n);Nh(n,s,t);if(n.parent!=n){o=n.frameElement;n=n.parent;if(!o){return}}else{n=null}}}function Ih(e){const t=jh(e);Oh(t,()=>new Ch(e))}Object.assign(Sh,{scrollViewportToShowTarget:Mh,scrollAncestorsToShowTarget:Ih});function Nh(e,t,i){const n=t.clone().moveBy(0,i);const o=t.clone().moveBy(0,-i);const r=new Ch(e).excludeScrollbarsAndBorders();const s=[o,n];if(!s.every(e=>r.contains(e))){let{scrollX:s,scrollY:a}=e;if(Rh(o,r)){a-=r.top-t.top+i}else if(zh(n,r)){a+=t.bottom-r.bottom+i}if(Lh(t,r)){s-=r.left-t.left+i}else if(Dh(t,r)){s+=t.right-r.right+i}e.scrollTo(s,a)}}function Oh(e,t){const i=Vh(e);let n,o;while(e!=i.document.body){o=t();n=new Ch(e).excludeScrollbarsAndBorders();if(!n.contains(o)){if(Rh(o,n)){e.scrollTop-=n.top-o.top}else if(zh(o,n)){e.scrollTop+=o.bottom-n.bottom}if(Lh(o,n)){e.scrollLeft-=n.left-o.left}else if(Dh(o,n)){e.scrollLeft+=o.right-n.right}}e=e.parentNode}}function zh(e,t){return e.bottom>t.bottom}function Rh(e,t){return e.topt.right}function Vh(e){if(xh(e)){return e.startContainer.ownerDocument.defaultView}else{return e.ownerDocument.defaultView}}function jh(e){if(xh(e)){let t=e.commonAncestorContainer;if(ld(t)){t=t.parentNode}return t}else{return e.parentNode}}function Bh(e,t){const i=Vh(e);const n=new Ch(e);if(i===t){return n}else{let e=i;while(e!=t){const t=e.frameElement;const i=new Ch(t).excludeScrollbarsAndBorders();n.moveBy(i.left,i.top);e=e.parent}}return n}class Fh{constructor(e){this.document=new bl(e);this.domConverter=new Hd(this.document);this.domRoots=new Map;this.set("isRenderingInProgress",false);this.set("hasDomSelection",false);this._renderer=new Sd(this.domConverter,this.document.selection);this._renderer.bind("isFocused").to(this.document);this._initialDomRootAttributes=new WeakMap;this._observers=new Map;this._ongoingChange=false;this._postFixersInProgress=false;this._renderingDisabled=false;this._hasChangedSinceTheLastRendering=false;this._writer=new Jl(this.document);this.addObserver(Zu);this.addObserver(kh);this.addObserver(_h);this.addObserver(th);this.addObserver(bh);this.addObserver(vh);if(Cl.isAndroid){this.addObserver(yh)}bd(this);Wl(this);this.on("render",()=>{this._render();this.document.fire("layoutChanged");this._hasChangedSinceTheLastRendering=false});this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=true})}attachDomRoot(e,t="main"){const i=this.document.getRoot(t);i._name=e.tagName.toLowerCase();const n={};for(const{name:t,value:o}of Array.from(e.attributes)){n[t]=o;if(t==="class"){this._writer.addClass(o.split(" "),i)}else{this._writer.setAttribute(t,o,i)}}this._initialDomRootAttributes.set(e,n);const o=()=>{this._writer.setAttribute("contenteditable",!i.isReadOnly,i);if(i.isReadOnly){this._writer.addClass("ck-read-only",i)}else{this._writer.removeClass("ck-read-only",i)}};o();this.domRoots.set(t,e);this.domConverter.bindElements(e,i);this._renderer.markToSync("children",i);this._renderer.markToSync("attributes",i);this._renderer.domDocuments.add(e.ownerDocument);i.on("change:children",(e,t)=>this._renderer.markToSync("children",t));i.on("change:attributes",(e,t)=>this._renderer.markToSync("attributes",t));i.on("change:text",(e,t)=>this._renderer.markToSync("text",t));i.on("change:isReadOnly",()=>this.change(o));i.on("change",()=>{this._hasChangedSinceTheLastRendering=true});for(const i of this._observers.values()){i.observe(e,t)}}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:e})=>t.removeAttribute(e));const i=this._initialDomRootAttributes.get(t);for(const e in i){t.setAttribute(e,i[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,i]of this.domRoots){t.observe(i,e)}t.enable();return 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();if(e){Mh({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;if(e){this.domConverter.focus(e);this.forceRender()}else{}}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress){throw new ss["b"]("cannot-change-view-tree: "+"Attempting to make changes to the view when it is in an incorrect state: rendering or post-fixers are in progress. "+"This may cause some unexpected behavior and inconsistency between the DOM and the view.",this)}try{if(this._ongoingChange){return e(this._writer)}this._ongoingChange=true;const t=e(this._writer);this._ongoingChange=false;if(!this._renderingDisabled&&this._hasChangedSinceTheLastRendering){this._postFixersInProgress=true;this.document._callPostFixers(this._writer);this._postFixersInProgress=false;this.fire("render")}return t}catch(e){ss["b"].rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=true;this.change(()=>{})}destroy(){for(const e of this._observers.values()){e.destroy()}this.document.destroy();this.stopListening()}createPositionAt(e,t){return ul._createAt(e,t)}createPositionAfter(e){return ul._createAfter(e)}createPositionBefore(e){return ul._createBefore(e)}createRange(e,t){return new hl(e,t)}createRangeOn(e){return hl._createOn(e)}createRangeIn(e){return hl._createIn(e)}createSelection(e,t,i){return new gl(e,t,i)}_disableRendering(e){this._renderingDisabled=e;if(e==false){this.change(()=>{})}}_render(){this.isRenderingInProgress=true;this.disableObservers();this._renderer.render();this.enableObservers();this.isRenderingInProgress=false}}ys(Fh,Qc);class Hh{constructor(e){this.parent=null;this._attrs=Us(e)}get index(){let e;if(!this.parent){return null}if((e=this.parent.getChildIndex(this))===null){throw new ss["b"]("model-node-not-found-in-parent: The node's parent does not contain this node.",this)}return e}get startOffset(){let e;if(!this.parent){return null}if((e=this.parent.getChildStartOffset(this))===null){throw new ss["b"]("model-node-not-found-in-parent: The node's parent does not contain this node.",this)}return e}get offsetSize(){return 1}get endOffset(){if(!this.parent){return null}return this.startOffset+this.offsetSize}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;while(e.parent){e=e.parent}return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;while(t.parent){e.unshift(t.startOffset);t=t.parent}return e}getAncestors(e={includeSelf:false,parentFirst:false}){const t=[];let i=e.includeSelf?this:this.parent;while(i){t[e.parentFirst?"push":"unshift"](i);i=i.parent}return t}getCommonAncestor(e,t={}){const i=this.getAncestors(t);const n=e.getAncestors(t);let o=0;while(i[o]==n[o]&&i[o]){o++}return o===0?null:i[o-1]}isBefore(e){if(this==e){return false}if(this.root!==e.root){return false}const t=this.getPath();const i=e.getPath();const n=Rs(t,i);switch(n){case"prefix":return true;case"extension":return false;default:return t[n]{e[t[0]]=t[1];return e},{})}return e}is(e){return e==="node"||e==="model:node"}_clone(){return new Hh(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=Us(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}class Uh extends Hh{constructor(e,t){super(t);this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}is(e){return e==="$text"||e==="model:$text"||e==="text"||e==="model:text"||e==="node"||e==="model:node"}toJSON(){const e=super.toJSON();e.data=this.data;return e}_clone(){return new Uh(this.data,this.getAttributes())}static fromJSON(e){return new Uh(e.data,e.attributes)}}class Wh{constructor(e,t,i){this.textNode=e;if(t<0||t>e.offsetSize){throw new ss["b"]("model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.",this)}if(i<0||t+i>e.offsetSize){throw new ss["b"]("model-textproxy-wrong-length: Given length value is incorrect.",this)}this.data=e.data.substring(t,t+i);this.offsetInText=t}get startOffset(){return this.textNode.startOffset!==null?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return this.startOffset!==null?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 e==="$textProxy"||e==="model:$textProxy"||e==="textProxy"||e==="model:textProxy"}getPath(){const e=this.textNode.getPath();if(e.length>0){e[e.length-1]+=this.offsetInText}return e}getAncestors(e={includeSelf:false,parentFirst:false}){const t=[];let i=e.includeSelf?this:this.parent;while(i){t[e.parentFirst?"push":"unshift"](i);i=i.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 qh{constructor(e){this._nodes=[];if(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 t==-1?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return t===null?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 ss["b"]("model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.",this)}return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const i of this._nodes){if(e>=t&&ee.toJSON())}}class $h extends Hh{constructor(e,t,i){super(t);this.name=e;this._children=new qh;if(i){this._insertChild(0,i)}}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}is(e,t=null){if(!t){return e==="element"||e==="model:element"||e==="node"||e==="model:node"}return t===this.name&&(e==="element"||e==="model:element")}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 i of e){t=t.getChild(t.offsetToIndex(i))}return t}findAncestor(e,t={includeSelf:false}){let i=t.includeSelf?this:this.parent;while(i){if(i.name===e){return i}i=i.parent}return null}toJSON(){const e=super.toJSON();e.name=this.name;if(this._children.length>0){e.children=[];for(const t of this._children){e.children.push(t.toJSON())}}return e}_clone(e=false){const t=e?Array.from(this._children).map(e=>e._clone(true)):null;return new $h(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=Yh(t);for(const e of i){if(e.parent!==null){e._remove()}e.parent=this}this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i){e.parent=null}return i}static fromJSON(e){let t=null;if(e.children){t=[];for(const i of e.children){if(i.name){t.push($h.fromJSON(i))}else{t.push(Uh.fromJSON(i))}}}return new $h(e.name,e.attributes,t)}}function Yh(e){if(typeof e=="string"){return[new Uh(e)]}if(!vs(e)){e=[e]}return Array.from(e).map(e=>{if(typeof e=="string"){return new Uh(e)}if(e instanceof Wh){return new Uh(e.data,e.getAttributes())}return e})}class Gh{constructor(e={}){if(!e.boundaries&&!e.startPosition){throw new ss["b"]("model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.",null)}const t=e.direction||"forward";if(t!="forward"&&t!="backward"){throw new ss["b"]("model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",e,{direction:t})}this.direction=t;this.boundaries=e.boundaries||null;if(e.startPosition){this.position=e.startPosition.clone()}else{this.position=Qh._createAt(this.boundaries[this.direction=="backward"?"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,i,n,o;do{n=this.position;o=this._visitedParent;({done:t,value:i}=this.next())}while(!t&&e(i));if(!t){this.position=n;this._visitedParent=o}}next(){if(this.direction=="forward"){return this._next()}else{return this._previous()}}_next(){const e=this.position;const t=this.position.clone();const i=this._visitedParent;if(i.parent===null&&t.offset===i.maxOffset){return{done:true}}if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset){return{done:true}}const n=t.parent;const o=Jh(t,n);const r=o?o:Zh(t,n,o);if(r instanceof $h){if(!this.shallow){t.path.push(0);this._visitedParent=r}else{t.offset++}this.position=t;return Kh("elementStart",r,e,t,1)}else if(r instanceof Uh){let n;if(this.singleCharacters){n=1}else{let e=r.endOffset;if(this._boundaryEndParent==i&&this.boundaries.end.offsete){e=this.boundaries.start.offset}n=t.offset-e}const o=t.offset-r.startOffset;const s=new Wh(r,o-n,n);t.offset-=n;this.position=t;return Kh("text",s,e,t,n)}else{t.path.pop();this.position=t;this._visitedParent=i.parent;return Kh("elementStart",i,e,t,1)}}}function Kh(e,t,i,n,o){return{done:false,value:{type:e,item:t,previousPosition:i,nextPosition:n,length:o}}}class Qh{constructor(e,t,i="toNone"){if(!e.is("element")&&!e.is("documentFragment")){throw new ss["b"]("model-position-root-invalid: Position root invalid.",e)}if(!(t instanceof Array)||t.length===0){throw new ss["b"]("model-position-path-incorrect-format: Position path must be an array with at least one item.",e,{path:t})}if(e.is("rootElement")){t=t.slice()}else{t=[...e.getPath(),...t];e=e.root}this.root=e;this.path=t;this.stickiness=i}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;ti.path.length){if(t.offset!==o.maxOffset){return false}t.path=t.path.slice(0,-1);o=o.parent;t.offset++}else{if(i.offset!==0){return false}i.path=i.path.slice(0,-1)}}}is(e){return e==="position"||e==="model:position"}hasSameParentAs(e){if(this.root!==e.root){return false}const t=this.getParentPath();const i=e.getParentPath();return Rs(t,i)=="same"}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=Qh._createAt(this);break}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;const i=t.containsPosition(this)||t.start.isEqual(this)&&this.stickiness=="toNext";if(i){return this._getCombined(e.splitPosition,e.moveTargetPosition)}else{if(e.graveyardPosition){return this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1)}else{return this._getTransformedByInsertion(e.insertionPosition,1)}}}_getTransformedByMergeOperation(e){const t=e.movedRange;const i=t.containsPosition(this)||t.start.isEqual(this);let n;if(i){n=this._getCombined(e.sourcePosition,e.targetPosition);if(e.sourcePosition.isBefore(e.targetPosition)){n=n._getTransformedByDeletion(e.deletionPosition,1)}}else if(this.isEqual(e.deletionPosition)){n=Qh._createAt(e.deletionPosition)}else{n=this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1)}return n}_getTransformedByDeletion(e,t){const i=Qh._createAt(this);if(this.root!=e.root){return i}if(Rs(e.getParentPath(),this.getParentPath())=="same"){if(e.offsetthis.offset){return null}else{i.offset-=t}}}else if(Rs(e.getParentPath(),this.getParentPath())=="prefix"){const n=e.path.length-1;if(e.offset<=this.path[n]){if(e.offset+t>this.path[n]){return null}else{i.path[n]-=t}}}return i}_getTransformedByInsertion(e,t){const i=Qh._createAt(this);if(this.root!=e.root){return i}if(Rs(e.getParentPath(),this.getParentPath())=="same"){if(e.offsett+1){const t=n.maxOffset-i.offset;if(t!==0){e.push(new ef(i,i.getShiftedBy(t)))}i.path=i.path.slice(0,-1);i.offset++;n=n.parent}while(i.path.length<=this.end.path.length){const t=this.end.path[i.path.length-1];const n=t-i.offset;if(n!==0){e.push(new ef(i,i.getShiftedBy(n)))}i.offset=t;i.path.push(0)}return e}getWalker(e={}){e.boundaries=this;return new Gh(e)}*getItems(e={}){e.boundaries=this;e.ignoreElementEnd=true;const t=new Gh(e);for(const e of t){yield e.item}}*getPositions(e={}){e.boundaries=this;const t=new Gh(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 ef(this.start,this.end)]}getTransformedByOperations(e){const t=[new ef(this.start,this.end)];for(const i of e){for(let e=0;e0?new this(i,n):new this(n,i)}static _createIn(e){return new this(Qh._createAt(e,0),Qh._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(Qh._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(e.length===0){throw new ss["b"]("range-create-from-ranges-empty-array: At least one range has to be passed.",null)}else if(e.length==1){return e[0].clone()}const t=e[0];e.sort((e,t)=>e.start.isAfter(t.start)?1:-1);const i=e.indexOf(t);const n=new this(t.start,t.end);if(i>0){for(let t=i-1;true;t++){if(e[t].end.isEqual(n.start)){n.start=Qh._createAt(e[t].start)}else{break}}}for(let t=i+1;t{if(t.viewPosition){return}const i=this._modelToViewMapping.get(t.modelPosition.parent);t.viewPosition=this.findPositionIn(i,t.modelPosition.offset)},{priority:"low"});this.on("viewToModelPosition",(e,t)=>{if(t.modelPosition){return}const i=this.findMappedViewAncestor(t.viewPosition);const n=this._viewToModelMapping.get(i);const o=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,i);t.modelPosition=Qh._createAt(n,o)},{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t);this._viewToModelMapping.set(t,e)}unbindViewElement(e){const t=this.toModelElement(e);this._viewToModelMapping.delete(e);if(this._elementToMarkerNames.has(e)){for(const t of this._elementToMarkerNames.get(e)){this._unboundMarkerNames.add(t)}}if(this._modelToViewMapping.get(t)==e){this._modelToViewMapping.delete(t)}}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e);if(this._viewToModelMapping.get(t)==e){this._viewToModelMapping.delete(t)}}bindElementToMarker(e,t){const i=this._markerNameToElements.get(t)||new Set;i.add(e);const n=this._elementToMarkerNames.get(e)||new Set;n.add(t);this._markerNameToElements.set(t,i);this._elementToMarkerNames.set(e,n)}unbindElementFromMarkerName(e,t){const i=this._markerNameToElements.get(t);if(i){i.delete(e);if(i.size==0){this._markerNameToElements.delete(t)}}const n=this._elementToMarkerNames.get(e);if(n){n.delete(t);if(n.size==0){this._elementToMarkerNames.delete(e)}}}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);this._unboundMarkerNames.clear();return 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 ef(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new hl(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};this.fire("viewToModelPosition",t);return t.modelPosition}toViewPosition(e,t={isPhantom:false}){const i={modelPosition:e,mapper:this,isPhantom:t.isPhantom};this.fire("modelToViewPosition",i);return i.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t){return null}const i=new Set;for(const e of t){if(e.is("attributeElement")){for(const t of e.getElementsWithSameId()){i.add(t)}}else{i.add(e)}}return i}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;while(!this._viewToModelMapping.has(t)){t=t.parent}return t}_toModelOffset(e,t,i){if(i!=e){const n=this._toModelOffset(e.parent,e.index,i);const o=this._toModelOffset(e,t,e);return n+o}if(e.is("$text")){return t}let n=0;for(let i=0;i1?t[0]+":"+t[1]:t[0]}class rf{constructor(e){this.conversionApi=qc({dispatcher:this},e)}convertChanges(e,t,i){for(const t of e.getMarkersToRemove()){this.convertMarkerRemove(t.name,t.range,i)}for(const t of e.getChanges()){if(t.type=="insert"){this.convertInsert(ef._createFromPositionAndShift(t.position,t.length),i)}else if(t.type=="remove"){this.convertRemove(t.position,t.length,t.name,i)}else{this.convertAttribute(t.range,t.attributeKey,t.attributeOldValue,t.attributeNewValue,i)}}for(const e of this.conversionApi.mapper.flushUnboundMarkerNames()){const n=t.get(e).getRange();this.convertMarkerRemove(e,n,i);this.convertMarkerAdd(e,n,i)}for(const t of e.getMarkersToAdd()){this.convertMarkerAdd(t.name,t.range,i)}}convertInsert(e,t){this.conversionApi.writer=t;this.conversionApi.consumable=this._createInsertConsumable(e);for(const t of e){const e=t.item;const i=ef._createFromPositionAndShift(t.previousPosition,t.length);const n={item:e,range:i};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,i,n){this.conversionApi.writer=n;this.fire("remove:"+i,{position:e,length:t},this.conversionApi);this._clearConversionApi()}convertAttribute(e,t,i,n,o){this.conversionApi.writer=o;this.conversionApi.consumable=this._createConsumableForRange(e,`attribute:${t}`);for(const o of e){const e=o.item;const r=ef._createFromPositionAndShift(o.previousPosition,o.length);const s={item:e,range:r,attributeKey:t,attributeOldValue:i,attributeNewValue:n};this._testAndFire(`attribute:${t}`,s)}this._clearConversionApi()}convertSelection(e,t,i){const n=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));this.conversionApi.writer=i;this.conversionApi.consumable=this._createSelectionConsumable(e,n);this.fire("selection",{selection:e},this.conversionApi);if(!e.isCollapsed){return}for(const t of n){const i=t.getRange();if(!sf(e.getFirstPosition(),t,this.conversionApi.mapper)){continue}const n={item:e,markerName:t.name,markerRange:i};if(this.conversionApi.consumable.test(e,"addMarker:"+t.name)){this.fire("addMarker:"+t.name,n,this.conversionApi)}}for(const t of e.getAttributeKeys()){const i={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};if(this.conversionApi.consumable.test(e,"attribute:"+i.attributeKey)){this.fire("attribute:"+i.attributeKey+":$text",i,this.conversionApi)}}this._clearConversionApi()}convertMarkerAdd(e,t,i){if(!t.root.document||t.root.rootName=="$graveyard"){return}this.conversionApi.writer=i;const n="addMarker:"+e;const o=new nf;o.add(t,n);this.conversionApi.consumable=o;this.fire(n,{markerName:e,markerRange:t},this.conversionApi);if(!o.test(t,n)){return}this.conversionApi.consumable=this._createConsumableForRange(t,n);for(const i of t.getItems()){if(!this.conversionApi.consumable.test(i,n)){continue}const o={item:i,range:ef._createOn(i),markerName:e,markerRange:t};this.fire(n,o,this.conversionApi)}this._clearConversionApi()}convertMarkerRemove(e,t,i){if(!t.root.document||t.root.rootName=="$graveyard"){return}this.conversionApi.writer=i;this.fire("removeMarker:"+e,{markerName:e,markerRange:t},this.conversionApi);this._clearConversionApi()}_createInsertConsumable(e){const t=new nf;for(const i of e){const e=i.item;t.add(e,"insert");for(const i of e.getAttributeKeys()){t.add(e,"attribute:"+i)}}return t}_createConsumableForRange(e,t){const i=new nf;for(const n of e.getItems()){i.add(n,t)}return i}_createSelectionConsumable(e,t){const i=new nf;i.add(e,"selection");for(const n of t){i.add(e,"addMarker:"+n.name)}for(const t of e.getAttributeKeys()){i.add(e,"attribute:"+t)}return i}_testAndFire(e,t){if(!this.conversionApi.consumable.test(t.item,e)){return}const i=t.item.name||"$text";this.fire(e+":"+i,t,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer;delete this.conversionApi.consumable}}ys(rf,ds);function sf(e,t,i){const n=t.getRange();const o=Array.from(e.getAncestors());o.shift();o.reverse();const r=o.some(e=>{if(n.containsItem(e)){const t=i.toViewElement(e);return!!t.getCustomProperty("addHighlight")}});return!r}class af{constructor(e,t,i){this._lastRangeBackward=false;this._ranges=[];this._attrs=new Map;if(e){this.setTo(e,t,i)}}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(){const e=this._ranges.length;if(e===1){return this._ranges[0].isCollapsed}else{return false}}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount){return false}else if(this.rangeCount===0){return true}if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus)){return false}for(const t of this._ranges){let i=false;for(const n of e._ranges){if(t.isEqual(n)){i=true;break}}if(!i){return false}}return true}*getRanges(){for(const e of this._ranges){yield new ef(e.start,e.end)}}getFirstRange(){let e=null;for(const t of this._ranges){if(!e||t.start.isBefore(e.start)){e=t}}return e?new ef(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges){if(!e||t.end.isAfter(e.end)){e=t}}return e?new ef(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,i){if(e===null){this._setRanges([])}else if(e instanceof af){this._setRanges(e.getRanges(),e.isBackward)}else if(e&&typeof e.getRanges=="function"){this._setRanges(e.getRanges(),e.isBackward)}else if(e instanceof ef){this._setRanges([e],!!t&&!!t.backward)}else if(e instanceof Qh){this._setRanges([new ef(e)])}else if(e instanceof Hh){const n=!!i&&!!i.backward;let o;if(t=="in"){o=ef._createIn(e)}else if(t=="on"){o=ef._createOn(e)}else if(t!==undefined){o=new ef(Qh._createAt(e,t))}else{throw new ss["b"]("model-selection-setTo-required-second-parameter: "+"selection.setTo requires the second parameter when the first parameter is a node.",[this,e])}this._setRanges([o],n)}else if(vs(e)){this._setRanges(e,t&&!!t.backward)}else{throw new ss["b"]("model-selection-setTo-not-selectable: Cannot set the selection to the given place.",[this,e])}}_setRanges(e,t=false){e=Array.from(e);const i=e.some(t=>{if(!(t instanceof ef)){throw new ss["b"]("model-selection-set-ranges-not-range: "+"Selection range set to an object that is not an instance of model.Range.",[this,e])}return this._ranges.every(e=>!e.isEqual(t))});if(e.length===this._ranges.length&&!i){return}this._removeAllRanges();for(const t of e){this._pushRange(t)}this._lastRangeBackward=!!t;this.fire("change:range",{directChange:true})}setFocus(e,t){if(this.anchor===null){throw new ss["b"]("model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.",[this,e])}const i=Qh._createAt(e,t);if(i.compareWith(this.focus)=="same"){return}const n=this.anchor;if(this._ranges.length){this._popRange()}if(i.compareWith(n)=="before"){this._pushRange(new ef(i,n));this._lastRangeBackward=true}else{this._pushRange(new ef(n,i));this._lastRangeBackward=false}this.fire("change:range",{directChange:true})}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){if(this.hasAttribute(e)){this._attrs.delete(e);this.fire("change:attribute",{attributeKeys:[e],directChange:true})}}setAttribute(e,t){if(this.getAttribute(e)!==t){this._attrs.set(e,t);this.fire("change:attribute",{attributeKeys:[e],directChange:true})}}getSelectedElement(){if(this.rangeCount!==1){return null}return this.getFirstRange().getContainedElement()}is(e){return e==="selection"||e==="model:selection"}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const i=df(t.start,e);if(i&&uf(i,t)){yield i}for(const i of t.getWalker()){const n=i.item;if(i.type=="elementEnd"&&lf(n,e,t)){yield n}}const n=df(t.end,e);if(n&&!t.end.isTouching(Qh._createAt(n,0))&&uf(n,t)){yield n}}}containsEntireContent(e=this.anchor.root){const t=Qh._createAt(e,0);const i=Qh._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e);this._ranges.push(new ef(e.start,e.end))}_checkRange(e){for(let t=0;t0){this._popRange()}}_popRange(){this._ranges.pop()}}ys(af,ds);function cf(e,t){if(t.has(e)){return false}t.add(e);return e.root.document.model.schema.isBlock(e)&&e.parent}function lf(e,t,i){return cf(e,t)&&uf(e,i)}function df(e,t){const i=e.parent;const n=i.root.document.model.schema;const o=e.parent.getAncestors({parentFirst:true,includeSelf:true});let r=false;const s=o.find(e=>{if(r){return false}r=n.isLimit(e);return!r&&cf(e,t)});o.forEach(e=>t.add(e));return s}function uf(e,t){const i=hf(e);if(!i){return true}const n=t.containsRange(ef._createOn(i),true);return!n}function hf(e){const t=e.root.document.model.schema;let i=e.parent;while(i){if(t.isBlock(i)){return i}i=i.parent}}class ff extends ef{constructor(e,t){super(e,t);mf.call(this)}detach(){this.stopListening()}is(e){return e==="liveRange"||e==="model:liveRange"||e=="range"||e==="model:range"}toRange(){return new ef(this.start,this.end)}static fromRange(e){return new ff(e.start,e.end)}}function mf(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{const i=t[0];if(!i.isDocumentOperation){return}gf.call(this,i)},{priority:"low"})}function gf(e){const t=this.getTransformedByOperation(e);const i=ef._createFromRanges(t);const n=!i.isEqual(this);const o=pf(this,e);let r=null;if(n){if(i.root.rootName=="$graveyard"){if(e.type=="remove"){r=e.sourcePosition}else{r=e.deletionPosition}}const t=this.toRange();this.start=i.start;this.end=i.end;this.fire("change:range",t,{deletionPosition:r})}else if(o){this.fire("change:content",this.toRange(),{deletionPosition:r})}}function pf(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 false}ys(ff,ds);const bf="selection:";class wf{constructor(e){this._selection=new kf(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(false)}is(e){return e==="selection"||e=="model:selection"||e=="documentSelection"||e=="model:documentSelection"}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(e,t,i){this._selection.setTo(e,t,i)}_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 bf+e}static _isStoreAttributeKey(e){return e.startsWith(bf)}}ys(wf,ds);class kf extends af{constructor(e){super();this.markers=new xs({idProperty:"name"});this._model=e.model;this._document=e;this._attributePriority=new Map;this._selectionRestorePosition=null;this._hasChangedRange=false;this._overriddenGravityRegister=new Set;this.listenTo(this._model,"applyOperation",(e,t)=>{const i=t[0];if(!i.isDocumentOperation||i.type=="marker"||i.type=="rename"||i.type=="noop"){return}if(this._ranges.length==0&&this._selectionRestorePosition){this._fixGraveyardSelection(this._selectionRestorePosition)}this._selectionRestorePosition=null;if(this._hasChangedRange){this._hasChangedRange=false;this.fire("change:range",{directChange:false})}},{priority:"lowest"});this.on("change:range",()=>{for(const e of this.getRanges()){if(!this._document._validateSelectionRange(e)){throw new ss["b"]("document-selection-wrong-position: Range from document selection starts or ends at incorrect position.",this,{range:e})}}});this.listenTo(this._model.markers,"update",()=>this._updateMarkers());this.listenTo(this._document,"change",(e,t)=>{vf(this._model,t)})}get isCollapsed(){const e=this._ranges.length;return e===0?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._hasChangedRange=true;if(t.root==this._document.graveyard){this._selectionRestorePosition=n.deletionPosition;const e=this._ranges.indexOf(t);this._ranges.splice(e,1);t.detach()}});return t}_updateMarkers(){const e=[];let t=false;for(const t of this._model.markers){const i=t.getRange();for(const n of this.getRanges()){if(i.containsRange(n,!n.isCollapsed)){e.push(t)}}}const i=Array.from(this.markers);for(const i of e){if(!this.markers.has(i)){this.markers.add(i);t=true}}for(const i of Array.from(this.markers)){if(!e.includes(i)){this.markers.remove(i);t=true}}if(t){this.fire("change:marker",{oldMarkers:i,directChange:false})}}_updateAttributes(e){const t=Us(this._getSurroundingAttributes());const i=Us(this.getAttributes());if(e){this._attributePriority=new Map;this._attrs=new Map}else{for(const[e,t]of this._attributePriority){if(t=="low"){this._attrs.delete(e);this._attributePriority.delete(e)}}}this._setAttributesTo(t);const n=[];for(const[e,t]of this.getAttributes()){if(!i.has(e)||i.get(e)!==t){n.push(e)}}for(const[e]of i){if(!this.hasAttribute(e)){n.push(e)}}if(n.length>0){this.fire("change:attribute",{attributeKeys:n,directChange:false})}}_setAttribute(e,t,i=true){const n=i?"normal":"low";if(n=="low"&&this._attributePriority.get(e)=="normal"){return false}const o=super.getAttribute(e);if(o===t){return false}this._attrs.set(e,t);this._attributePriority.set(e,n);return true}_removeAttribute(e,t=true){const i=t?"normal":"low";if(i=="low"&&this._attributePriority.get(e)=="normal"){return false}this._attributePriority.set(e,i);if(!super.hasAttribute(e)){return false}this._attrs.delete(e);return true}_setAttributesTo(e){const t=new Set;for(const[t,i]of this.getAttributes()){if(e.get(t)===i){continue}this._removeAttribute(t,false)}for(const[i,n]of e){const e=this._setAttribute(i,n,false);if(e){t.add(i)}}return t}*_getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty){for(const t of e.getAttributeKeys()){if(t.startsWith(bf)){const i=t.substr(bf.length);yield[i,e.getAttribute(t)]}}}}_getSurroundingAttributes(){const e=this.getFirstPosition();const t=this._model.schema;let i=null;if(!this.isCollapsed){const e=this.getFirstRange();for(const n of e){if(n.item.is("element")&&t.isObject(n.item)){break}if(n.type=="text"){i=n.item.getAttributes();break}}}else{const t=e.textNode?e.textNode:e.nodeBefore;const n=e.textNode?e.textNode:e.nodeAfter;if(!this.isGravityOverridden){i=_f(t)}if(!i){i=_f(n)}if(!this.isGravityOverridden&&!i){let e=t;while(e&&!i){e=e.previousSibling;i=_f(e)}}if(!i){let e=n;while(e&&!i){e=e.nextSibling;i=_f(e)}}if(!i){i=this._getStoredAttributes()}}return i}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);if(t){this._pushRange(t)}}}function _f(e){if(e instanceof Wh||e instanceof Uh){return e.getAttributes()}return null}function vf(e,t){const i=e.document.differ;for(const n of i.getChanges()){if(n.type!="insert"){continue}const i=n.position.parent;const o=n.length===i.maxOffset;if(o){e.enqueueChange(t,e=>{const t=Array.from(i.getAttributeKeys()).filter(e=>e.startsWith(bf));for(const n of t){e.removeAttribute(n,i)}})}}}class yf{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers){e(t)}return this}}var xf=1,Af=4;function Tf(e){return Hr(e,xf|Af)}var Cf=Tf;class Pf extends yf{elementToElement(e){return this.add(Yf(e))}attributeToElement(e){return this.add(Gf(e))}attributeToAttribute(e){return this.add(Kf(e))}markerToElement(e){return this.add(Qf(e))}markerToHighlight(e){return this.add(Zf(e))}markerToData(e){return this.add(Jf(e))}}function Ef(){return(e,t,i)=>{if(!i.consumable.consume(t.item,"insert")){return}const n=i.writer;const o=i.mapper.toViewPosition(t.range.start);const r=n.createText(t.item.data);n.insert(o,r)}}function Sf(){return(e,t,i)=>{const n=i.mapper.toViewPosition(t.position);const o=t.position.getShiftedBy(t.length);const r=i.mapper.toViewPosition(o,{isPhantom:true});const s=i.writer.createRange(n,r);const a=i.writer.remove(s.getTrimmed());for(const e of i.writer.createRangeIn(a).getItems()){i.mapper.unbindViewElement(e)}}}function Mf(e,t){const i=e.createAttributeElement("span",t.attributes);if(t.classes){i._addClass(t.classes)}if(t.priority){i._priority=t.priority}i._id=t.id;return i}function If(){return(e,t,i)=>{const n=t.selection;if(n.isCollapsed){return}if(!i.consumable.consume(n,"selection")){return}const o=[];for(const e of n.getRanges()){const t=i.mapper.toViewRange(e);o.push(t)}i.writer.setSelection(o,{backward:n.isBackward})}}function Nf(){return(e,t,i)=>{const n=t.selection;if(!n.isCollapsed){return}if(!i.consumable.consume(n,"selection")){return}const o=i.writer;const r=n.getFirstPosition();const s=i.mapper.toViewPosition(r);const a=o.breakAttributes(s);o.setSelection(a)}}function Of(){return(e,t,i)=>{const n=i.writer;const o=n.document.selection;for(const e of o.getRanges()){if(e.isCollapsed){if(e.end.parent.isAttached()){i.writer.mergeAttributes(e.start)}}}n.setSelection(null)}}function zf(e){return(t,i,n)=>{const o=e(i.attributeOldValue,n.writer);const r=e(i.attributeNewValue,n.writer);if(!o&&!r){return}if(!n.consumable.consume(i.item,t.name)){return}const s=n.writer;const a=s.document.selection;if(i.item instanceof af||i.item instanceof wf){s.wrap(a.getFirstRange(),r)}else{let e=n.mapper.toViewRange(i.range);if(i.attributeOldValue!==null&&o){e=s.unwrap(e,o)}if(i.attributeNewValue!==null&&r){s.wrap(e,r)}}}}function Rf(e){return(t,i,n)=>{const o=e(i.item,n.writer);if(!o){return}if(!n.consumable.consume(i.item,"insert")){return}const r=n.mapper.toViewPosition(i.range.start);n.mapper.bindElements(i.item,o);n.writer.insert(r,o)}}function Lf(e){return(t,i,n)=>{i.isOpening=true;const o=e(i,n.writer);i.isOpening=false;const r=e(i,n.writer);if(!o||!r){return}const s=i.markerRange;if(s.isCollapsed&&!n.consumable.consume(s,t.name)){return}for(const e of s){if(!n.consumable.consume(e.item,t.name)){return}}const a=n.mapper;const c=n.writer;c.insert(a.toViewPosition(s.start),o);n.mapper.bindElementToMarker(o,i.markerName);if(!s.isCollapsed){c.insert(a.toViewPosition(s.end),r);n.mapper.bindElementToMarker(r,i.markerName)}t.stop()}}function Df(){return(e,t,i)=>{const n=i.mapper.markerNameToElements(t.markerName);if(!n){return}for(const e of n){i.mapper.unbindElementFromMarkerName(e,t.markerName);i.writer.clear(i.writer.createRangeOn(e),e)}i.writer.clearClonedElementsGroup(t.markerName);e.stop()}}function Vf(e){return(t,i,n)=>{const o=e(i.markerName);if(!o){return}const r=i.markerRange;if(!n.consumable.consume(r,t.name)){return}jf(r,false,n,i,o);jf(r,true,n,i,o);t.stop()}}function jf(e,t,i,n,o){const r=t?e.start:e.end;const s=i.schema.checkChild(r,"$text");if(s){const e=i.mapper.toViewPosition(r);Ff(e,t,i,n,o)}else{let e;let s;if(t&&r.nodeAfter||!t&&!r.nodeBefore){e=r.nodeAfter;s=true}else{e=r.nodeBefore;s=false}const a=i.mapper.toViewElement(e);Bf(a,t,s,i,n,o)}}function Bf(e,t,i,n,o,r){const s=`data-${r.group}-${t?"start":"end"}-${i?"before":"after"}`;const a=e.hasAttribute(s)?e.getAttribute(s).split(","):[];a.unshift(r.name);n.writer.setAttribute(s,a.join(","),e);n.mapper.bindElementToMarker(e,o.markerName)}function Ff(e,t,i,n,o){const r=`${o.group}-${t?"start":"end"}`;const s=o.name?{name:o.name}:null;const a=i.writer.createUIElement(r,s);i.writer.insert(e,a);i.mapper.bindElementToMarker(a,n.markerName)}function Hf(e){return(t,i,n)=>{const o=e(i.markerName);if(!o){return}const r=n.mapper.markerNameToElements(i.markerName);if(!r){return}for(const e of r){n.mapper.unbindElementFromMarkerName(e,i.markerName);if(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)}else{n.writer.clear(n.writer.createRangeOn(e),e)}}n.writer.clearClonedElementsGroup(i.markerName);t.stop();function s(e,t){if(t.hasAttribute(e)){const i=new Set(t.getAttribute(e).split(","));i.delete(o.name);if(i.size==0){n.writer.removeAttribute(e,t)}else{n.writer.setAttribute(e,Array.from(i).join(","),t)}}}}}function Uf(e){return(t,i,n)=>{const o=e(i.attributeOldValue,i);const r=e(i.attributeNewValue,i);if(!o&&!r){return}if(!n.consumable.consume(i.item,t.name)){return}const s=n.mapper.toViewElement(i.item);const a=n.writer;if(!s){throw new ss["b"]("conversion-attribute-to-attribute-on-text: "+"Trying to convert text node's attribute with attribute-to-attribute converter.",[i,n])}if(i.attributeOldValue!==null&&o){if(o.key=="class"){const e=Array.isArray(o.value)?o.value:[o.value];for(const t of e){a.removeClass(t,s)}}else if(o.key=="style"){const e=Object.keys(o.value);for(const t of e){a.removeStyle(t,s)}}else{a.removeAttribute(o.key,s)}}if(i.attributeNewValue!==null&&r){if(r.key=="class"){const e=Array.isArray(r.value)?r.value:[r.value];for(const t of e){a.addClass(t,s)}}else if(r.key=="style"){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)}}}}function Wf(e){return(t,i,n)=>{if(!i.item){return}if(!(i.item instanceof af||i.item instanceof wf)&&!i.item.is("$textProxy")){return}const o=nm(e,i,n);if(!o){return}if(!n.consumable.consume(i.item,t.name)){return}const r=n.writer;const s=Mf(r,o);const a=r.document.selection;if(i.item instanceof af||i.item instanceof wf){r.wrap(a.getFirstRange(),s,a)}else{const e=n.mapper.toViewRange(i.range);const t=r.wrap(e,s);for(const e of t.getItems()){if(e.is("attributeElement")&&e.isSimilar(s)){n.mapper.bindElementToMarker(e,i.markerName);break}}}}}function qf(e){return(t,i,n)=>{if(!i.item){return}if(!(i.item instanceof $h)){return}const o=nm(e,i,n);if(!o){return}if(!n.consumable.test(i.item,t.name)){return}const r=n.mapper.toViewElement(i.item);if(r&&r.getCustomProperty("addHighlight")){n.consumable.consume(i.item,t.name);for(const e of ef._createIn(i.item)){n.consumable.consume(e.item,t.name)}r.getCustomProperty("addHighlight")(r,o,n.writer);n.mapper.bindElementToMarker(r,i.markerName)}}}function $f(e){return(t,i,n)=>{if(i.markerRange.isCollapsed){return}const o=nm(e,i,n);if(!o){return}const r=Mf(n.writer,o);const s=n.mapper.markerNameToElements(i.markerName);if(!s){return}for(const e of s){n.mapper.unbindElementFromMarkerName(e,i.markerName);if(e.is("attributeElement")){n.writer.unwrap(n.writer.createRangeOn(e),r)}else{e.getCustomProperty("removeHighlight")(e,o.id,n.writer)}}n.writer.clearClonedElementsGroup(i.markerName);t.stop()}}function Yf(e){e=Cf(e);e.view=Xf(e.view,"container");return t=>{t.on("insert:"+e.model,Rf(e.view),{priority:e.converterPriority||"normal"})}}function Gf(e){e=Cf(e);const t=e.model.key?e.model.key:e.model;let i="attribute:"+t;if(e.model.name){i+=":"+e.model.name}if(e.model.values){for(const t of e.model.values){e.view[t]=Xf(e.view[t],"attribute")}}else{e.view=Xf(e.view,"attribute")}const n=tm(e);return t=>{t.on(i,zf(n),{priority:e.converterPriority||"normal"})}}function Kf(e){e=Cf(e);const t=e.model.key?e.model.key:e.model;let i="attribute:"+t;if(e.model.name){i+=":"+e.model.name}if(e.model.values){for(const t of e.model.values){e.view[t]=im(e.view[t])}}else{e.view=im(e.view)}const n=tm(e);return t=>{t.on(i,Uf(n),{priority:e.converterPriority||"normal"})}}function Qf(e){e=Cf(e);e.view=Xf(e.view,"ui");return t=>{t.on("addMarker:"+e.model,Lf(e.view),{priority:e.converterPriority||"normal"});t.on("removeMarker:"+e.model,Df(e.view),{priority:e.converterPriority||"normal"})}}function Jf(e){e=Cf(e);const t=e.model;if(!e.view){e.view=i=>({group:t,name:i.substr(e.model.length+1)})}return i=>{i.on("addMarker:"+t,Vf(e.view),{priority:e.converterPriority||"normal"});i.on("removeMarker:"+t,Hf(e.view),{priority:e.converterPriority||"normal"})}}function Zf(e){return t=>{t.on("addMarker:"+e.model,Wf(e.view),{priority:e.converterPriority||"normal"});t.on("addMarker:"+e.model,qf(e.view),{priority:e.converterPriority||"normal"});t.on("removeMarker:"+e.model,$f(e.view),{priority:e.converterPriority||"normal"})}}function Xf(e,t){if(typeof e=="function"){return e}return(i,n)=>em(e,n,t)}function em(e,t,i){if(typeof e=="string"){e={name:e}}let n;const o=Object.assign({},e.attributes);if(i=="container"){n=t.createContainerElement(e.name,o)}else if(i=="attribute"){const i={priority:e.priority||kl.DEFAULT_PRIORITY};n=t.createAttributeElement(e.name,o,i)}else{n=t.createUIElement(e.name,o)}if(e.styles){const i=Object.keys(e.styles);for(const o of i){t.setStyle(o,e.styles[o],n)}}if(e.classes){const i=e.classes;if(typeof i=="string"){t.addClass(i,n)}else{for(const e of i){t.addClass(e,n)}}}return n}function tm(e){if(e.model.values){return(t,i)=>{const n=e.view[t];if(n){return n(t,i)}return null}}else{return e.view}}function im(e){if(typeof e=="string"){return t=>({key:e,value:t})}else if(typeof e=="object"){if(e.value){return()=>e}else{return t=>({key:e.key,value:t})}}else{return e}}function nm(e,t,i){const n=typeof e=="function"?e(t,i):e;if(!n){return null}if(!n.priority){n.priority=10}if(!n.id){n.id=t.markerName}return n}class om extends yf{elementToElement(e){return this.add(cm(e))}elementToAttribute(e){return this.add(lm(e))}attributeToAttribute(e){return this.add(dm(e))}elementToMarker(e){console.warn(Object(ss["a"])("upcast-helpers-element-to-marker-deprecated: "+"The UpcastHelpers#elementToMarker() method has been deprecated and will be removed in the near future. "+"Please use UpcastHelpers#dataToMarker() instead."));return this.add(um(e))}dataToMarker(e){return this.add(hm(e))}}function rm(){return(e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:true})){const{modelRange:e,modelCursor:n}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e;t.modelCursor=n}}}function sm(){return(e,t,i)=>{if(i.schema.checkChild(t.modelCursor,"$text")){if(i.consumable.consume(t.viewItem)){const e=i.writer.createText(t.viewItem.data);i.writer.insert(e,t.modelCursor);t.modelRange=ef._createFromPositionAndShift(t.modelCursor,e.offsetSize);t.modelCursor=t.modelRange.end}}}}function am(e,t){return(i,n)=>{const o=n.newSelection;const r=new af;const s=[];for(const e of o.getRanges()){s.push(t.toModelRange(e))}r.setTo(s,{backward:o.isBackward});if(!r.isEqual(e.document.selection)){e.change(e=>{e.setSelection(r)})}}}function cm(e){e=Cf(e);const t=gm(e);const i=mm(e.view);const n=i?"element:"+i:"element";return i=>{i.on(n,t,{priority:e.converterPriority||"normal"})}}function lm(e){e=Cf(e);wm(e);const t=km(e,false);const i=mm(e.view);const n=i?"element:"+i:"element";return i=>{i.on(n,t,{priority:e.converterPriority||"low"})}}function dm(e){e=Cf(e);let t=null;if(typeof e.view=="string"||e.view.key){t=bm(e)}wm(e,t);const i=km(e,true);return t=>{t.on("element",i,{priority:e.converterPriority||"low"})}}function um(e){e=Cf(e);ym(e);return cm(e)}function hm(e){e=Cf(e);if(!e.model){e.model=t=>t?e.view+":"+t:e.view}const t=gm(xm(e,"start"));const i=gm(xm(e,"end"));return n=>{n.on("element:"+e.view+"-start",t,{priority:e.converterPriority||"normal"});n.on("element:"+e.view+"-end",i,{priority:e.converterPriority||"normal"});const o=os.get("low");const r=os.get("highest");const s=os.get(e.converterPriority)/r;n.on("element",fm(e),{priority:o+s})}}function fm(e){return(t,i,n)=>{const o=`data-${e.view}`;if(!i.modelRange){i=Object.assign(i,n.convertChildren(i.viewItem,i.modelCursor))}if(n.consumable.consume(i.viewItem,{attributes:o+"-end-after"})){r(i.modelRange.end,i.viewItem.getAttribute(o+"-end-after").split(","))}if(n.consumable.consume(i.viewItem,{attributes:o+"-start-after"})){r(i.modelRange.end,i.viewItem.getAttribute(o+"-start-after").split(","))}if(n.consumable.consume(i.viewItem,{attributes:o+"-end-before"})){r(i.modelRange.start,i.viewItem.getAttribute(o+"-end-before").split(","))}if(n.consumable.consume(i.viewItem,{attributes:o+"-start-before"})){r(i.modelRange.start,i.viewItem.getAttribute(o+"-start-before").split(","))}function r(t,o){for(const r of o){const o=e.model(r);const s=n.writer.createElement("$marker",{"data-name":o});n.writer.insert(s,t);if(i.modelCursor.isEqual(t)){i.modelCursor=i.modelCursor.getShiftedBy(1)}else{i.modelCursor=i.modelCursor._getTransformedByInsertion(t,1)}i.modelRange=i.modelRange._getTransformedByInsertion(t,1)[0]}}}}function mm(e){if(typeof e=="string"){return e}if(typeof e=="object"&&typeof e.name=="string"){return e.name}return null}function gm(e){const t=e.view?new Ws(e.view):null;return(i,n,o)=>{let r={};if(t){const e=t.match(n.viewItem);if(!e){return}r=e.match}r.name=true;const s=pm(e.model,n.viewItem,o.writer);if(!s){return}if(!o.consumable.test(n.viewItem,r)){return}const a=o.splitToAllowedParent(s,n.modelCursor);if(!a){return}o.writer.insert(s,a.position);o.convertChildren(n.viewItem,o.writer.createPositionAt(s,0));o.consumable.consume(n.viewItem,r);const c=o.getSplitParts(s);n.modelRange=new ef(o.writer.createPositionBefore(s),o.writer.createPositionAfter(c[c.length-1]));if(a.cursorParent){n.modelCursor=o.writer.createPositionAt(a.cursorParent,0)}else{n.modelCursor=n.modelRange.end}}}function pm(e,t,i){if(e instanceof Function){return e(t,i)}else{return i.createElement(e)}}function bm(e){if(typeof e.view=="string"){e.view={key:e.view}}const t=e.view.key;let i;if(t=="class"||t=="style"){const n=t=="class"?"classes":"styles";i={[n]:e.view.value}}else{const n=typeof e.view.value=="undefined"?/[\s\S]*/:e.view.value;i={attributes:{[t]:n}}}if(e.view.name){i.name=e.view.name}e.view=i;return t}function wm(e,t=null){const i=t===null?true:e=>e.getAttribute(t);const n=typeof e.model!="object"?e.model:e.model.key;const o=typeof e.model!="object"||typeof e.model.value=="undefined"?i:e.model.value;e.model={key:n,value:o}}function km(e,t){const i=new Ws(e.view);return(n,o,r)=>{const s=i.match(o.viewItem);if(!s){return}const a=e.model.key;const c=typeof e.model.value=="function"?e.model.value(o.viewItem):e.model.value;if(c===null){return}if(_m(e.view,o.viewItem)){s.match.name=true}else{delete s.match.name}if(!r.consumable.test(o.viewItem,s.match)){return}if(!o.modelRange){o=Object.assign(o,r.convertChildren(o.viewItem,o.modelCursor))}const l=vm(o.modelRange,{key:a,value:c},t,r);if(l){r.consumable.consume(o.viewItem,s.match)}}}function _m(e,t){const i=typeof e=="function"?e(t):e;if(typeof i=="object"&&!mm(i)){return false}return!i.classes&&!i.attributes&&!i.styles}function vm(e,t,i,n){let o=false;for(const r of Array.from(e.getItems({shallow:i}))){if(n.schema.checkAttribute(r,t.key)){n.writer.setAttribute(t.key,t.value,r);o=true}}return o}function ym(e){const t=e.model;e.model=(e,i)=>{const n=typeof t=="string"?t:t(e);return i.createElement("$marker",{"data-name":n})}}function xm(e,t){const i={};i.view=e.view+"-"+t;i.model=(t,i)=>{const n=t.getAttribute("name");const o=e.model(n);return i.createElement("$marker",{"data-name":o})};return i}class Am{constructor(e,t){this.model=e;this.view=new Fh(t);this.mapper=new tf;this.downcastDispatcher=new rf({mapper:this.mapper,schema:e.schema});const i=this.model.document;const n=i.selection;const o=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(true)},{priority:"highest"});this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(false)},{priority:"lowest"});this.listenTo(i,"change",()=>{this.view.change(e=>{this.downcastDispatcher.convertChanges(i.differ,o,e);this.downcastDispatcher.convertSelection(n,o,e)})},{priority:"low"});this.listenTo(this.view.document,"selectionChange",am(this.model,this.mapper));this.downcastDispatcher.on("insert:$text",Ef(),{priority:"lowest"});this.downcastDispatcher.on("remove",Sf(),{priority:"low"});this.downcastDispatcher.on("selection",Of(),{priority:"low"});this.downcastDispatcher.on("selection",If(),{priority:"low"});this.downcastDispatcher.on("selection",Nf(),{priority:"low"});this.view.document.roots.bindTo(this.model.document.roots).using(e=>{if(e.rootName=="$graveyard"){return null}const t=new ll(this.view.document,e.name);t.rootName=e.rootName;this.mapper.bindElements(e,t);return t})}destroy(){this.view.destroy();this.stopListening()}}ys(Am,Qc);class Tm{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const i=this.get(e);if(!i){throw new ss["b"]("commandcollection-command-not-found: Command does not exist.",this,{commandName:e})}return i.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 Cm{constructor(){this._consumables=new Map}add(e,t){let i;if(e.is("$text")||e.is("documentFragment")){this._consumables.set(e,true);return}if(!this._consumables.has(e)){i=new Pm(e);this._consumables.set(e,i)}else{i=this._consumables.get(e)}i.add(t)}test(e,t){const i=this._consumables.get(e);if(i===undefined){return null}if(e.is("$text")||e.is("documentFragment")){return i}return i.test(t)}consume(e,t){if(this.test(e,t)){if(e.is("$text")||e.is("documentFragment")){this._consumables.set(e,false)}else{this._consumables.get(e).consume(t)}return true}return false}revert(e,t){const i=this._consumables.get(e);if(i!==undefined){if(e.is("$text")||e.is("documentFragment")){this._consumables.set(e,true)}else{i.revert(t)}}}static consumablesFromElement(e){const t={element:e,name:true,attributes:[],classes:[],styles:[]};const i=e.getAttributeKeys();for(const e of i){if(e=="style"||e=="class"){continue}t.attributes.push(e)}const n=e.getClassNames();for(const e of n){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 Cm(e)}if(e.is("$text")){t.add(e);return t}if(e.is("element")){t.add(e,Cm.consumablesFromElement(e))}if(e.is("documentFragment")){t.add(e)}for(const i of e.getChildren()){t=Cm.createFrom(i,t)}return t}}class Pm{constructor(e){this.element=e;this._canConsumeName=null;this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){if(e.name){this._canConsumeName=true}for(const t in this._consumables){if(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 i=this._test(t,e[t]);if(i!==true){return i}}}return true}consume(e){if(e.name){this._canConsumeName=false}for(const t in this._consumables){if(t in e){this._consume(t,e[t])}}}revert(e){if(e.name){this._canConsumeName=true}for(const t in this._consumables){if(t in e){this._revert(t,e[t])}}}_add(e,t){const i=Kt(t)?t:[t];const n=this._consumables[e];for(const t of i){if(e==="attributes"&&(t==="class"||t==="style")){throw new ss["b"]("viewconsumable-invalid-attribute: Classes and styles should be handled separately.",this)}n.set(t,true);if(e==="styles"){for(const e of this.element.document.stylesProcessor.getRelatedStyles(t)){n.set(e,true)}}}}_test(e,t){const i=Kt(t)?t:[t];const n=this._consumables[e];for(const t of i){if(e==="attributes"&&(t==="class"||t==="style")){const e=t=="class"?"classes":"styles";const i=this._test(e,[...this._consumables[e].keys()]);if(i!==true){return i}}else{const e=n.get(t);if(e===undefined){return null}if(!e){return false}}}return true}_consume(e,t){const i=Kt(t)?t:[t];const n=this._consumables[e];for(const t of i){if(e==="attributes"&&(t==="class"||t==="style")){const e=t=="class"?"classes":"styles";this._consume(e,[...this._consumables[e].keys()])}else{n.set(t,false);if(e=="styles"){for(const e of this.element.document.stylesProcessor.getRelatedStyles(t)){n.set(e,false)}}}}}_revert(e,t){const i=Kt(t)?t:[t];const n=this._consumables[e];for(const t of i){if(e==="attributes"&&(t==="class"||t==="style")){const e=t=="class"?"classes":"styles";this._revert(e,[...this._consumables[e].keys()])}else{const e=n.get(t);if(e===false){n.set(t,true)}}}}}class Em{constructor(){this._sourceDefinitions={};this._attributeProperties={};this.decorate("checkChild");this.decorate("checkAttribute");this.on("checkAttribute",(e,t)=>{t[0]=new Sm(t[0])},{priority:"highest"});this.on("checkChild",(e,t)=>{t[0]=new Sm(t[0]);t[1]=this.getDefinition(t[1])},{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e]){throw new ss["b"]("schema-cannot-register-item-twice: A single item cannot be registered twice in the schema.",this,{itemName:e})}this._sourceDefinitions[e]=[Object.assign({},t)];this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e]){throw new ss["b"]("schema-cannot-extend-missing-item: Cannot extend an item which was not registered yet.",this,{itemName:e})}this._sourceDefinitions[e].push(Object.assign({},t));this._clearCache()}getDefinitions(){if(!this._compiledDefinitions){this._compile()}return this._compiledDefinitions}getDefinition(e){let t;if(typeof e=="string"){t=e}else if(e.is&&(e.is("$text")||e.is("$textProxy"))){t="$text"}else{t=e.name}return 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);if(!t){return false}return!!(t.isLimit||t.isObject)}isObject(e){const t=this.getDefinition(e);return!!(t&&t.isObject)}isInline(e){const t=this.getDefinition(e);return!!(t&&t.isInline)}checkChild(e,t){if(!t){return false}return this._checkContextMatch(t,e)}checkAttribute(e,t){const i=this.getDefinition(e.last);if(!i){return false}return i.allowAttributes.includes(t)}checkMerge(e,t=null){if(e instanceof Qh){const t=e.nodeBefore;const i=e.nodeAfter;if(!(t instanceof $h)){throw new ss["b"]("schema-check-merge-no-element-before: The node before the merge position must be an element.",this)}if(!(i instanceof $h)){throw new ss["b"]("schema-check-merge-no-element-after: The node after the merge position must be an element.",this)}return this.checkMerge(t,i)}for(const i of t.getChildren()){if(!this.checkChild(e,i)){return false}}return true}addChildCheck(e){this.on("checkChild",(t,[i,n])=>{if(!n){return}const o=e(i,n);if(typeof o=="boolean"){t.stop();t.return=o}},{priority:"high"})}addAttributeCheck(e){this.on("checkAttribute",(t,[i,n])=>{const o=e(i,n);if(typeof o=="boolean"){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 Qh){t=e.parent}else{const i=e instanceof ef?[e]:Array.from(e.getRanges());t=i.reduce((e,t)=>{const i=t.getCommonAncestor();if(!e){return i}return e.getCommonAncestor(i,{includeSelf:true})},null)}while(!this.isLimit(t)){if(t.parent){t=t.parent}else{break}}return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const i=e.getFirstPosition();const n=[...i.getAncestors(),new Uh("",e.getAttributes())];return this.checkAttribute(n,t)}else{const i=e.getRanges();for(const e of i){for(const i of e){if(this.checkAttribute(i.item,t)){return true}}}}return false}*getValidRanges(e,t){e=Wm(e);for(const i of e){yield*this._getValidRangesForRange(i,t)}}getNearestSelectionRange(e,t="both"){if(this.checkChild(e,"$text")){return new ef(e)}let i,n;const o=e.getAncestors().reverse().find(e=>this.isLimit(e))||e.root;if(t=="both"||t=="backward"){i=new Gh({boundaries:ef._createIn(o),startPosition:e,direction:"backward"})}if(t=="both"||t=="forward"){n=new Gh({boundaries:ef._createIn(o),startPosition:e})}for(const e of Um(i,n)){const t=e.walker==i?"elementEnd":"elementStart";const n=e.value;if(n.type==t&&this.isObject(n.item)){return ef._createOn(n.item)}if(this.checkChild(n.nextPosition,"$text")){return new ef(n.nextPosition)}}return null}findAllowedParent(e,t){let i=e.parent;while(i){if(this.checkChild(i,t)){return i}if(this.isLimit(i)){return null}i=i.parent}return null}removeDisallowedAttributes(e,t){for(const i of e){if(i.is("$text")){qm(this,i,t)}else{const e=ef._createIn(i);const n=e.getPositions();for(const e of n){const i=e.nodeBefore||e.parent;qm(this,i,t)}}}}createContext(e){return new Sm(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={};const t=this._sourceDefinitions;const i=Object.keys(t);for(const n of i){e[n]=Mm(t[n],n)}for(const t of i){Im(e,t)}for(const t of i){Nm(e,t)}for(const t of i){Om(e,t);zm(e,t)}for(const t of i){Rm(e,t);Lm(e,t)}this._compiledDefinitions=e}_checkContextMatch(e,t,i=t.length-1){const n=t.getItem(i);if(e.allowIn.includes(n.name)){if(i==0){return true}else{const e=this.getDefinition(n);return this._checkContextMatch(e,t,i-1)}}else{return false}}*_getValidRangesForRange(e,t){let i=e.start;let n=e.start;for(const o of e.getItems({shallow:true})){if(o.is("element")){yield*this._getValidRangesForRange(ef._createIn(o),t)}if(!this.checkAttribute(o,t)){if(!i.isEqual(n)){yield new ef(i,n)}i=Qh._createAfter(o)}n=Qh._createAfter(o)}if(!i.isEqual(n)){yield new ef(i,n)}}}ys(Em,Qc);class Sm{constructor(e){if(e instanceof Sm){return e}if(typeof e=="string"){e=[e]}else if(!Array.isArray(e)){e=e.getAncestors({includeSelf:true})}if(e[0]&&typeof e[0]!="string"&&e[0].is("documentFragment")){e.shift()}this._items=e.map(Hm)}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 Sm([e]);t._items=[...this._items,...t._items];return 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 Mm(e,t){const i={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};Dm(e,i);Vm(e,i,"allowIn");Vm(e,i,"allowContentOf");Vm(e,i,"allowWhere");Vm(e,i,"allowAttributes");Vm(e,i,"allowAttributesOf");Vm(e,i,"inheritTypesFrom");jm(e,i);return i}function Im(e,t){for(const i of e[t].allowContentOf){if(e[i]){const n=Bm(e,i);n.forEach(e=>{e.allowIn.push(t)})}}delete e[t].allowContentOf}function Nm(e,t){for(const i of e[t].allowWhere){const n=e[i];if(n){const i=n.allowIn;e[t].allowIn.push(...i)}}delete e[t].allowWhere}function Om(e,t){for(const i of e[t].allowAttributesOf){const n=e[i];if(n){const i=n.allowAttributes;e[t].allowAttributes.push(...i)}}delete e[t].allowAttributesOf}function zm(e,t){const i=e[t];for(const t of i.inheritTypesFrom){const n=e[t];if(n){const e=Object.keys(n).filter(e=>e.startsWith("is"));for(const t of e){if(!(t in i)){i[t]=n[t]}}}}delete i.inheritTypesFrom}function Rm(e,t){const i=e[t];const n=i.allowIn.filter(t=>e[t]);i.allowIn=Array.from(new Set(n))}function Lm(e,t){const i=e[t];i.allowAttributes=Array.from(new Set(i.allowAttributes))}function Dm(e,t){for(const i of e){const e=Object.keys(i).filter(e=>e.startsWith("is"));for(const n of e){t[n]=i[n]}}}function Vm(e,t,i){for(const n of e){if(typeof n[i]=="string"){t[i].push(n[i])}else if(Array.isArray(n[i])){t[i].push(...n[i])}}}function jm(e,t){for(const i of e){const e=i.inheritAllFrom;if(e){t.allowContentOf.push(e);t.allowWhere.push(e);t.allowAttributesOf.push(e);t.inheritTypesFrom.push(e)}}}function Bm(e,t){const i=e[t];return Fm(e).filter(e=>e.allowIn.includes(i.name))}function Fm(e){return Object.keys(e).map(t=>e[t])}function Hm(e){if(typeof e=="string"){return{name:e,*getAttributeKeys(){},getAttribute(){}}}else{return{name:e.is("element")?e.name:"$text",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute(t){return e.getAttribute(t)}}}}function*Um(e,t){let i=false;while(!i){i=true;if(e){const t=e.next();if(!t.done){i=false;yield{walker:e,value:t.value}}}if(t){const e=t.next();if(!e.done){i=false;yield{walker:t,value:e.value}}}}}function*Wm(e){for(const t of e){yield*t.getMinimalFlatRanges()}}function qm(e,t,i){for(const n of t.getAttributeKeys()){if(!e.checkAttribute(t,n)){i.removeAttribute(n,t)}}}class $m{constructor(e={}){this._splitParts=new Map;this._modelCursor=null;this.conversionApi=Object.assign({},e);this.conversionApi.convertItem=this._convertItem.bind(this);this.conversionApi.convertChildren=this._convertChildren.bind(this);this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this);this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}convert(e,t,i=["$root"]){this.fire("viewCleanup",e);this._modelCursor=Gm(i,t);this.conversionApi.writer=t;this.conversionApi.consumable=Cm.createFrom(e);this.conversionApi.store={};const{modelRange:n}=this._convertItem(e,this._modelCursor);const o=t.createDocumentFragment();if(n){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren())){t.append(e,o)}o.markers=Ym(o,t)}this._modelCursor=null;this._splitParts.clear();this.conversionApi.writer=null;this.conversionApi.store=null;return o}_convertItem(e,t){const i=Object.assign({viewItem:e,modelCursor:t,modelRange:null});if(e.is("element")){this.fire("element:"+e.name,i,this.conversionApi)}else if(e.is("$text")){this.fire("text",i,this.conversionApi)}else{this.fire("documentFragment",i,this.conversionApi)}if(i.modelRange&&!(i.modelRange instanceof ef)){throw new ss["b"]("view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.",this)}return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(e,t){const i=new ef(t);let n=t;for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,n);if(e.modelRange instanceof ef){i.end=e.modelRange.end;n=e.modelCursor}}return{modelRange:i,modelCursor:n}}_splitToAllowedParent(e,t){const i=this.conversionApi.schema.findAllowedParent(t,e);if(!i){return null}if(i===t.parent){return{position:t}}if(this._modelCursor.parent.getAncestors().includes(i)){return null}const n=this.conversionApi.writer.split(t,i);const o=[];for(const e of n.range.getWalker()){if(e.type=="elementEnd"){o.push(e.item)}else{const t=o.pop();const i=e.item;this._registerSplitPair(t,i)}}return{position:n.position,cursorParent:n.range.end.parent}}_registerSplitPair(e,t){if(!this._splitParts.has(e)){this._splitParts.set(e,[e])}const i=this._splitParts.get(e);this._splitParts.set(t,i);i.push(t)}_getSplitParts(e){let t;if(!this._splitParts.has(e)){t=[e]}else{t=this._splitParts.get(e)}return t}_removeEmptyElements(){let e=false;for(const t of this._splitParts.keys()){if(t.isEmpty){this.conversionApi.writer.remove(t);this._splitParts.delete(t);e=true}}if(e){this._removeEmptyElements()}}}ys($m,ds);function Ym(e,t){const i=new Set;const n=new Map;const o=ef._createIn(e).getItems();for(const e of o){if(e.name=="$marker"){i.add(e)}}for(const e of i){const i=e.getAttribute("data-name");const o=t.createPositionBefore(e);if(!n.has(i)){n.set(i,new ef(o.clone()))}else{n.get(i).end=o.clone()}t.remove(e)}return n}function Gm(e,t){let i;for(const n of new Sm(e)){const e={};for(const t of n.getAttributeKeys()){e[t]=n.getAttribute(t)}const o=t.createElement(n.name,e);if(i){t.append(o,i)}i=Qh._createAt(o,0)}return i}class Km{constructor(e,t){this.model=e;this.stylesProcessor=t;this.processor;this.mapper=new tf;this.downcastDispatcher=new rf({mapper:this.mapper,schema:e.schema});this.downcastDispatcher.on("insert:$text",Ef(),{priority:"lowest"});this.upcastDispatcher=new $m({schema:e.schema});this.viewDocument=new bl(t);this._viewWriter=new Jl(this.viewDocument);this.upcastDispatcher.on("text",sm(),{priority:"lowest"});this.upcastDispatcher.on("element",rm(),{priority:"lowest"});this.upcastDispatcher.on("documentFragment",rm(),{priority:"lowest"});this.decorate("init");this.decorate("set");this.on("init",()=>{this.fire("ready")},{priority:"lowest"})}get(e){const{rootName:t="main",trim:i="empty"}=e||{};if(!this._checkIfRootsExists([t])){throw new ss["b"]("datacontroller-get-non-existent-root: Attempting to get data from a non-existing root.",this)}const n=this.model.document.getRoot(t);if(i==="empty"&&!this.model.hasContent(n,{ignoreWhitespaces:true})){return""}return this.stringify(n)}stringify(e){const t=this.toView(e);return this.processor.toData(t)}toView(e){const t=this.viewDocument;const i=this._viewWriter;this.mapper.clearBindings();const n=ef._createIn(e);const o=new Kl(t);this.mapper.bindElements(e,o);this.downcastDispatcher.convertInsert(n,i);if(!e.is("documentFragment")){const t=Qm(e);for(const[e,n]of t){this.downcastDispatcher.convertMarkerAdd(e,n,i)}}return o}init(e){if(this.model.document.version){throw new ss["b"]("datacontroller-init-document-not-empty: Trying to set initial data to not empty document.",this)}let t={};if(typeof e==="string"){t.main=e}else{t=e}if(!this._checkIfRootsExists(Object.keys(t))){throw new ss["b"]("datacontroller-init-non-existent-root: Attempting to init data on a non-existing root.",this)}this.model.enqueueChange("transparent",e=>{for(const i of Object.keys(t)){const n=this.model.document.getRoot(i);e.insert(this.parse(t[i],n),n,0)}});return Promise.resolve()}set(e){let t={};if(typeof e==="string"){t.main=e}else{t=e}if(!this._checkIfRootsExists(Object.keys(t))){throw new ss["b"]("datacontroller-set-non-existent-root: Attempting to set data on a non-existing root.",this)}this.model.enqueueChange("transparent",e=>{e.setSelection(null);e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const i of Object.keys(t)){const n=this.model.document.getRoot(i);e.remove(e.createRangeIn(n));e.insert(this.parse(t[i],n),n,0)}})}parse(e,t="$root"){const i=this.processor.toView(e);return this.toModel(i,t)}toModel(e,t="$root"){return this.model.change(i=>this.upcastDispatcher.convert(e,i,t))}addStyleProcessorRules(e){e(this.stylesProcessor)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e){if(!this.model.document.getRootNames().includes(t)){return false}}return true}}ys(Km,Qc);function Qm(e){const t=[];const i=e.root.document;if(!i){return[]}const n=ef._createIn(e);for(const e of i.model.markers){const i=n.getIntersection(e.getRange());if(i){t.push([e.name,i])}}return t}class Jm{constructor(e,t){this._helpers=new Map;this._downcast=Array.isArray(e)?e:[e];this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:true});this._upcast=Array.isArray(t)?t:[t];this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:false})}addAlias(e,t){const i=this._downcast.includes(t);const n=this._upcast.includes(t);if(!n&&!i){throw new ss["b"]("conversion-add-alias-dispatcher-not-registered: "+"Trying to register and alias for a dispatcher that nas not been registered.",this)}this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:i})}for(e){if(!this._helpers.has(e)){throw new ss["b"]("conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.",this)}return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:i}of Zm(e)){this.for("upcast").elementToElement({model:t,view:i,converterPriority:e.converterPriority})}}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:i}of Zm(e)){this.for("upcast").elementToAttribute({view:i,model:t,converterPriority:e.converterPriority})}}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:i}of Zm(e)){this.for("upcast").attributeToAttribute({view:i,model:t})}}_createConversionHelpers({name:e,dispatchers:t,isDowncast:i}){if(this._helpers.has(e)){throw new ss["b"]("conversion-group-exists: Trying to register a group name that has already been registered.",this)}const n=i?new Pf(t):new om(t);this._helpers.set(e,n)}}function*Zm(e){if(e.model.values){for(const t of e.model.values){const i={key:e.model.key,value:t};const n=e.view[t];const o=e.upcastAlso?e.upcastAlso[t]:undefined;yield*Xm(i,n,o)}}else{yield*Xm(e.model,e.view,e.upcastAlso)}}function*Xm(e,t,i){yield{model:e,view:t};if(i){i=Array.isArray(i)?i:[i];for(const t of i){yield{model:e,view:t}}}}class eg{constructor(e="default"){this.operations=[];this.type=e}get baseVersion(){for(const e of this.operations){if(e.baseVersion!==null){return e.baseVersion}}return null}addOperation(e){e.batch=this;this.operations.push(e);return e}}class tg{constructor(e){this.baseVersion=e;this.isDocumentOperation=this.baseVersion!==null;this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);e.__className=this.constructor.className;delete e.batch;delete e.isDocumentOperation;return e}static get className(){return"Operation"}static fromJSON(e){return new this(e.baseVersion)}}class ig{constructor(e){this.markers=new Map;this._children=new qh;if(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 this.childCount===0}get root(){return this}get parent(){return null}is(e){return e==="documentFragment"||e==="model:documentFragment"}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 i of e){t=t.getChild(t.offsetToIndex(i))}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 i of e){if(i.name){t.push($h.fromJSON(i))}else{t.push(Uh.fromJSON(i))}}return new ig(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=ng(t);for(const e of i){if(e.parent!==null){e._remove()}e.parent=this}this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i){e.parent=null}return i}}function ng(e){if(typeof e=="string"){return[new Uh(e)]}if(!vs(e)){e=[e]}return Array.from(e).map(e=>{if(typeof e=="string"){return new Uh(e)}if(e instanceof Wh){return new Uh(e.data,e.getAttributes())}return e})}function og(e,t){t=cg(t);const i=t.reduce((e,t)=>e+t.offsetSize,0);const n=e.parent;dg(e);const o=e.index;n._insertChild(o,t);lg(n,o+t.length);lg(n,o);return new ef(e,e.getShiftedBy(i))}function rg(e){if(!e.isFlat){throw new ss["b"]("operation-utils-remove-range-not-flat: "+"Trying to remove a range which starts and ends in different element.",this)}const t=e.start.parent;dg(e.start);dg(e.end);const i=t._removeChildren(e.start.index,e.end.index-e.start.index);lg(t,e.start.index);return i}function sg(e,t){if(!e.isFlat){throw new ss["b"]("operation-utils-move-range-not-flat: "+"Trying to move a range which starts and ends in different element.",this)}const i=rg(e);t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset);return og(t,i)}function ag(e,t,i){dg(e.start);dg(e.end);for(const n of e.getItems({shallow:true})){const e=n.is("$textProxy")?n.textNode:n;if(i!==null){e._setAttribute(t,i)}else{e._removeAttribute(t)}lg(e.parent,e.index)}lg(e.end.parent,e.end.index)}function cg(e){const t=[];if(!(e instanceof Array)){e=[e]}for(let i=0;ie.maxOffset){throw new ss["b"]("move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.",this)}else if(e===t&&i=i&&this.targetPosition.path[e]e._clone(true)));const t=new bg(this.position,e,this.baseVersion);t.shouldReceiveAttributes=this.shouldReceiveAttributes;return t}getReversed(){const e=this.position.root.document.graveyard;const t=new Qh(e,[0]);return new pg(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(true)));og(this.position,e)}toJSON(){const e=super.toJSON();e.position=this.position.toJSON();e.nodes=this.nodes.toJSON();return e}static get className(){return"InsertOperation"}static fromJSON(e,t){const i=[];for(const t of e.nodes){if(t.name){i.push($h.fromJSON(t))}else{i.push(Uh.fromJSON(t))}}const n=new bg(Qh.fromJSON(e.position,t),i,e.baseVersion);n.shouldReceiveAttributes=e.shouldReceiveAttributes;return n}}class wg extends tg{constructor(e,t,i,n,o,r){super(r);this.name=e;this.oldRange=t?t.clone():null;this.newRange=i?i.clone():null;this.affectsData=o;this._markers=n}get type(){return"marker"}clone(){return new wg(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new wg(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,true,this.affectsData)}toJSON(){const e=super.toJSON();if(this.oldRange){e.oldRange=this.oldRange.toJSON()}if(this.newRange){e.newRange=this.newRange.toJSON()}delete e._markers;return e}static get className(){return"MarkerOperation"}static fromJSON(e,t){return new wg(e.name,e.oldRange?ef.fromJSON(e.oldRange,t):null,e.newRange?ef.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}class kg extends tg{constructor(e,t,i,n){super(n);this.position=e;this.position.stickiness="toNext";this.oldName=t;this.newName=i}get type(){return"rename"}clone(){return new kg(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new kg(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof $h)){throw new ss["b"]("rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.",this)}else if(e.name!==this.oldName){throw new ss["b"]("rename-operation-wrong-name: Element to change has different name than operation's old name.",this)}}_execute(){const e=this.position.nodeAfter;e.name=this.newName}toJSON(){const e=super.toJSON();e.position=this.position.toJSON();return e}static get className(){return"RenameOperation"}static fromJSON(e,t){return new kg(Qh.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class _g extends tg{constructor(e,t,i,n,o){super(o);this.root=e;this.key=t;this.oldValue=i;this.newValue=n}get type(){if(this.oldValue===null){return"addRootAttribute"}else if(this.newValue===null){return"removeRootAttribute"}else{return"changeRootAttribute"}}clone(){return new _g(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new _g(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment")){throw new ss["b"]("rootattribute-operation-not-a-root: The element to change is not a root element.",this,{root:this.root,key:this.key})}if(this.oldValue!==null&&this.root.getAttribute(this.key)!==this.oldValue){throw new ss["b"]("rootattribute-operation-wrong-old-value: Changed node has different attribute value than operation's "+"old attribute value.",this,{root:this.root,key:this.key})}if(this.oldValue===null&&this.newValue!==null&&this.root.hasAttribute(this.key)){throw new ss["b"]("rootattribute-operation-attribute-exists: The attribute with given key already exists.",this,{root:this.root,key:this.key})}}_execute(){if(this.newValue!==null){this.root._setAttribute(this.key,this.newValue)}else{this.root._removeAttribute(this.key)}}toJSON(){const e=super.toJSON();e.root=this.root.toJSON();return e}static get className(){return"RootAttributeOperation"}static fromJSON(e,t){if(!t.getRoot(e.root)){throw new ss["b"]("rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.",this,{rootName:e.root})}return new _g(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class vg extends tg{constructor(e,t,i,n,o){super(o);this.sourcePosition=e.clone();this.sourcePosition.stickiness="toPrevious";this.howMany=t;this.targetPosition=i.clone();this.targetPosition.stickiness="toNext";this.graveyardPosition=n.clone()}get type(){return"merge"}get deletionPosition(){return new Qh(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new ef(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);const t=this.sourcePosition.path.slice(0,-1);const i=new Qh(this.sourcePosition.root,t)._getTransformedByMergeOperation(this);const n=new yg(e,this.howMany,this.graveyardPosition,this.baseVersion+1);n.insertionPosition=i;return n}_validate(){const e=this.sourcePosition.parent;const t=this.targetPosition.parent;if(!e.parent){throw new ss["b"]("merge-operation-source-position-invalid: Merge source position is invalid.",this)}else if(!t.parent){throw new ss["b"]("merge-operation-target-position-invalid: Merge target position is invalid.",this)}else if(this.howMany!=e.maxOffset){throw new ss["b"]("merge-operation-how-many-invalid: Merge operation specifies wrong number of nodes to move.",this)}}_execute(){const e=this.sourcePosition.parent;const t=ef._createIn(e);sg(t,this.targetPosition);sg(ef._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();e.sourcePosition=e.sourcePosition.toJSON();e.targetPosition=e.targetPosition.toJSON();e.graveyardPosition=e.graveyardPosition.toJSON();return e}static get className(){return"MergeOperation"}static fromJSON(e,t){const i=Qh.fromJSON(e.sourcePosition,t);const n=Qh.fromJSON(e.targetPosition,t);const o=Qh.fromJSON(e.graveyardPosition,t);return new this(i,e.howMany,n,o,e.baseVersion)}}class yg extends tg{constructor(e,t,i,n){super(n);this.splitPosition=e.clone();this.splitPosition.stickiness="toNext";this.howMany=t;this.insertionPosition=yg.getInsertionPosition(e);this.insertionPosition.stickiness="toNone";this.graveyardPosition=i?i.clone():null;if(this.graveyardPosition){this.graveyardPosition.stickiness="toNext"}}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();e.push(0);return new Qh(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new ef(this.splitPosition,e)}clone(){const e=new this.constructor(this.splitPosition,this.howMany,this.graveyardPosition,this.baseVersion);e.insertionPosition=this.insertionPosition;return e}getReversed(){const e=this.splitPosition.root.document.graveyard;const t=new Qh(e,[0]);return new vg(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent;const t=this.splitPosition.offset;if(!e||e.maxOffset{for(const t of e.getAttributeKeys()){this.removeAttribute(t,e)}};if(!(e instanceof ef)){t(e)}else{for(const i of e.getItems()){t(i)}}}move(e,t,i){this._assertWriterUsedCorrectly();if(!(e instanceof ef)){throw new ss["b"]("writer-move-invalid-range: Invalid range to move.",this)}if(!e.isFlat){throw new ss["b"]("writer-move-range-not-flat: Range to move is not flat.",this)}const n=Qh._createAt(t,i);if(n.isEqual(e.start)){return}this._addOperationForAffectedMarkers("move",e);if(!Sg(e.root,n.root)){throw new ss["b"]("writer-move-different-document: Range is going to be moved between different documents.",this)}const o=e.root.document?e.root.document.version:null;const r=new pg(e.start,e.end.offset-e.start.offset,n,o);this.batch.addOperation(r);this.model.applyOperation(r)}remove(e){this._assertWriterUsedCorrectly();const t=e instanceof ef?e:ef._createOn(e);const i=t.getMinimalFlatRanges().reverse();for(const e of i){this._addOperationForAffectedMarkers("move",e);Eg(e.start,e.end.offset-e.start.offset,this.batch,this.model)}}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore;const i=e.nodeAfter;this._addOperationForAffectedMarkers("merge",e);if(!(t instanceof $h)){throw new ss["b"]("writer-merge-no-element-before: Node before merge position must be an element.",this)}if(!(i instanceof $h)){throw new ss["b"]("writer-merge-no-element-after: Node after merge position must be an element.",this)}if(!e.root.document){this._mergeDetached(e)}else{this._merge(e)}}createPositionFromPath(e,t,i){return this.model.createPositionFromPath(e,t,i)}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,i){return this.model.createSelection(e,t,i)}_mergeDetached(e){const t=e.nodeBefore;const i=e.nodeAfter;this.move(ef._createIn(i),Qh._createAt(t,"end"));this.remove(i)}_merge(e){const t=Qh._createAt(e.nodeBefore,"end");const i=Qh._createAt(e.nodeAfter,0);const n=e.root.document.graveyard;const o=new Qh(n,[0]);const r=e.root.document.version;const s=new vg(i,e.nodeAfter.maxOffset,t,o,r);this.batch.addOperation(s);this.model.applyOperation(s)}rename(e,t){this._assertWriterUsedCorrectly();if(!(e instanceof $h)){throw new ss["b"]("writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.",this)}const i=e.root.document?e.root.document.version:null;const n=new kg(Qh._createBefore(e),e.name,t,i);this.batch.addOperation(n);this.model.applyOperation(n)}split(e,t){this._assertWriterUsedCorrectly();let i=e.parent;if(!i.parent){throw new ss["b"]("writer-split-element-no-parent: Element with no parent can not be split.",this)}if(!t){t=i.parent}if(!e.parent.getAncestors({includeSelf:true}).includes(t)){throw new ss["b"]("writer-split-invalid-limit-element: Limit element is not a position ancestor.",this)}let n,o;do{const t=i.root.document?i.root.document.version:null;const r=i.maxOffset-e.offset;const s=new yg(e,r,null,t);this.batch.addOperation(s);this.model.applyOperation(s);if(!n&&!o){n=i;o=e.parent.nextSibling}e=this.createPositionAfter(e.parent);i=e.parent}while(i!==t);return{position:e,range:new ef(Qh._createAt(n,"end"),Qh._createAt(o,0))}}wrap(e,t){this._assertWriterUsedCorrectly();if(!e.isFlat){throw new ss["b"]("writer-wrap-range-not-flat: Range to wrap is not flat.",this)}const i=t instanceof $h?t:new $h(t);if(i.childCount>0){throw new ss["b"]("writer-wrap-element-not-empty: Element to wrap with is not empty.",this)}if(i.parent!==null){throw new ss["b"]("writer-wrap-element-attached: Element to wrap with is already attached to tree model.",this)}this.insert(i,e.start);const n=new ef(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(n,Qh._createAt(i,0))}unwrap(e){this._assertWriterUsedCorrectly();if(e.parent===null){throw new ss["b"]("writer-unwrap-element-no-parent: Trying to unwrap an element which has no parent.",this)}this.move(ef._createIn(e),this.createPositionAfter(e));this.remove(e)}addMarker(e,t){this._assertWriterUsedCorrectly();if(!t||typeof t.usingOperation!="boolean"){throw new ss["b"]("writer-addMarker-no-usingOperation: The options.usingOperation parameter is required when adding a new marker.",this)}const i=t.usingOperation;const n=t.range;const o=t.affectsData===undefined?false:t.affectsData;if(this.model.markers.has(e)){throw new ss["b"]("writer-addMarker-marker-exists: Marker with provided name already exists.",this)}if(!n){throw new ss["b"]("writer-addMarker-no-range: Range parameter is required when adding a new marker.",this)}if(!i){return this.model.markers._set(e,n,i,o)}Pg(this,e,null,n,o);return this.model.markers.get(e)}updateMarker(e,t){this._assertWriterUsedCorrectly();const i=typeof e=="string"?e:e.name;const n=this.model.markers.get(i);if(!n){throw new ss["b"]("writer-updateMarker-marker-not-exists: Marker with provided name does not exists.",this)}if(!t){this.model.markers._refresh(n);return}const o=typeof t.usingOperation=="boolean";const r=typeof t.affectsData=="boolean";const s=r?t.affectsData:n.affectsData;if(!o&&!t.range&&!r){throw new ss["b"]("writer-updateMarker-wrong-options: One of the options is required - provide range, usingOperations or affectsData.",this)}const a=n.getRange();const c=t.range?t.range:a;if(o&&t.usingOperation!==n.managedUsingOperations){if(t.usingOperation){Pg(this,i,null,c,s)}else{Pg(this,i,a,null,s);this.model.markers._set(i,c,undefined,s)}return}if(n.managedUsingOperations){Pg(this,i,a,c,s)}else{this.model.markers._set(i,c,undefined,s)}}removeMarker(e){this._assertWriterUsedCorrectly();const t=typeof e=="string"?e:e.name;if(!this.model.markers.has(t)){throw new ss["b"]("writer-removeMarker-no-marker: Trying to remove marker which does not exist.",this)}const i=this.model.markers.get(t);if(!i.managedUsingOperations){this.model.markers._remove(t);return}const n=i.getRange();Pg(this,t,n,null,i.affectsData)}setSelection(e,t,i){this._assertWriterUsedCorrectly();this.model.document.selection._setTo(e,t,i)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly();this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){this._assertWriterUsedCorrectly();if(typeof e==="string"){this._setSelectionAttribute(e,t)}else{for(const[t,i]of Us(e)){this._setSelectionAttribute(t,i)}}}removeSelectionAttribute(e){this._assertWriterUsedCorrectly();if(typeof e==="string"){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 i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const n=wf._getStoreAttributeKey(e);this.setAttribute(n,t,i.anchor.parent)}i._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const i=wf._getStoreAttributeKey(e);this.removeAttribute(i,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this){throw new ss["b"]("writer-incorrect-use: Trying to use a writer outside the change() block.",this)}}_addOperationForAffectedMarkers(e,t){for(const i of this.model.markers){if(!i.managedUsingOperations){continue}const n=i.getRange();let o=false;if(e==="move"){o=t.containsPosition(n.start)||t.start.isEqual(n.start)||t.containsPosition(n.end)||t.end.isEqual(n.end)}else{const e=t.nodeBefore;const i=t.nodeAfter;const r=n.start.parent==e&&n.start.isAtEnd;const s=n.end.parent==i&&n.end.offset==0;const a=n.end.nodeAfter==i;const c=n.start.nodeAfter==i;o=r||s||a||c}if(o){this.updateMarker(i.name,{range:n})}}}}function Tg(e,t,i,n){const o=e.model;const r=o.document;let s=n.start;let a;let c;let l;for(const e of n.getWalker({shallow:true})){l=e.item.getAttribute(t);if(a&&c!=l){if(c!=i){d()}s=a}a=e.nextPosition;c=l}if(a instanceof Qh&&a!=s&&c!=i){d()}function d(){const n=new ef(s,a);const l=n.root.document?r.version:null;const d=new mg(n,t,c,i,l);e.batch.addOperation(d);o.applyOperation(d)}}function Cg(e,t,i,n){const o=e.model;const r=o.document;const s=n.getAttribute(t);let a,c;if(s!=i){const l=n.root===n;if(l){const e=n.document?r.version:null;c=new _g(n,t,s,i,e)}else{a=new ef(Qh._createBefore(n),e.createPositionAfter(n));const o=a.root.document?r.version:null;c=new mg(a,t,s,i,o)}e.batch.addOperation(c);o.applyOperation(c)}}function Pg(e,t,i,n,o){const r=e.model;const s=r.document;const a=new wg(t,i,n,r.markers,o,s.version);e.batch.addOperation(a);r.applyOperation(a)}function Eg(e,t,i,n){let o;if(e.root.document){const i=n.document;const r=new Qh(i.graveyard,[0]);o=new pg(e,t,r,i.version)}else{o=new gg(e,t)}i.addOperation(o);n.applyOperation(o)}function Sg(e,t){if(e===t){return true}if(e instanceof xg&&t instanceof xg){return true}return false}class Mg{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 this._changesInElement.size==0&&this._changedMarkers.size==0}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=ef._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:true})){if(this._isInInsertedElement(t.parent)){continue}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);const i=this._isInInsertedElement(e.targetPosition.parent);if(!t){this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany)}if(!i){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=ef._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;if(!this._isInInsertedElement(t)){this._markRemove(t,e.splitPosition.offset,e.howMany)}if(!this._isInInsertedElement(e.insertionPosition.parent)){this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1)}if(e.graveyardPosition){this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1)}break}case"merge":{const t=e.sourcePosition.parent;if(!this._isInInsertedElement(t.parent)){this._markRemove(t.parent,t.startOffset,1)}const i=e.graveyardPosition.parent;this._markInsert(i,e.graveyardPosition.offset,1);const n=e.targetPosition.parent;if(!this._isInInsertedElement(n)){this._markInsert(n,e.targetPosition.offset,t.maxOffset)}break}}this._cachedChanges=null}bufferMarkerChange(e,t,i,n){const o=this._changedMarkers.get(e);if(!o){this._changedMarkers.set(e,{oldRange:t,newRange:i,affectsData:n})}else{o.newRange=i;o.affectsData=n;if(o.oldRange==null&&o.newRange==null){this._changedMarkers.delete(e)}}}getMarkersToRemove(){const e=[];for(const[t,i]of this._changedMarkers){if(i.oldRange!=null){e.push({name:t,range:i.oldRange})}}return e}getMarkersToAdd(){const e=[];for(const[t,i]of this._changedMarkers){if(i.newRange!=null){e.push({name:t,range:i.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 true}}return this._changesInElement.size>0}getChanges(e={includeChangesInGraveyard:false}){if(this._cachedChanges){if(e.includeChangesInGraveyard){return this._cachedChangesWithGraveyard.slice()}else{return this._cachedChanges.slice()}}const t=[];for(const e of this._changesInElement.keys()){const i=this._changesInElement.get(e).sort((e,t)=>{if(e.offset===t.offset){if(e.type!=t.type){return e.type=="remove"?-1:1}return 0}return e.offset{if(e.position.root!=t.position.root){return e.position.root.rootNamei.offset){if(n>o){const e={type:"attribute",offset:o,howMany:n-o,count:this._changeCount++};this._handleChange(e,t);t.push(e)}e.nodesToHandle=i.offset-e.offset;e.howMany=e.nodesToHandle}else if(e.offset>=i.offset&&e.offseto){e.nodesToHandle=n-o;e.offset=o}else{e.nodesToHandle=0}}}if(i.type=="remove"){if(e.offseti.offset){const o={type:"attribute",offset:i.offset,howMany:n-i.offset,count:this._changeCount++};this._handleChange(o,t);t.push(o);e.nodesToHandle=i.offset-e.offset;e.howMany=e.nodesToHandle}}if(i.type=="attribute"){if(e.offset>=i.offset&&n<=o){e.nodesToHandle=0;e.howMany=0;e.offset=0}else if(e.offset<=i.offset&&n>=o){i.howMany=0}}}}e.howMany=e.nodesToHandle;delete e.nodesToHandle}_getInsertDiff(e,t,i){return{type:"insert",position:Qh._createAt(e,t),name:i,length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,i){return{type:"remove",position:Qh._createAt(e,t),name:i,length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,i){const n=[];i=new Map(i);for(const[o,r]of t){const t=i.has(o)?i.get(o):null;if(t!==r){n.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:o,attributeOldValue:r,attributeNewValue:t,changeCount:this._changeCount++})}i.delete(o)}for(const[t,o]of i){n.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:o,changeCount:this._changeCount++})}return n}_isInInsertedElement(e){const t=e.parent;if(!t){return false}const i=this._changesInElement.get(t);const n=e.startOffset;if(i){for(const e of i){if(e.type=="insert"&&n>=e.offset&&nn){for(let t=0;t{const i=t[0];if(i.isDocumentOperation&&i.baseVersion!==this.version){throw new ss["b"]("model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.",this,{operation:i})}},{priority:"highest"});this.listenTo(e,"applyOperation",(e,t)=>{const i=t[0];if(i.isDocumentOperation){this.differ.bufferOperation(i)}},{priority:"high"});this.listenTo(e,"applyOperation",(e,t)=>{const i=t[0];if(i.isDocumentOperation){this.version++;this.history.addOperation(i)}},{priority:"low"});this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=true});this.listenTo(e.markers,"update",(e,t,i,n)=>{this.differ.bufferMarkerChange(t.name,i,n,t.affectsData);if(i===null){t.on("change",(e,i)=>{this.differ.bufferMarkerChange(t.name,i,t.getRange(),t.affectsData)})}})}get graveyard(){return this.getRoot(Bg)}createRoot(e="$root",t="main"){if(this.roots.get(t)){throw new ss["b"]("model-document-createRoot-name-exists: Root with specified name already exists.",this,{name:t})}const i=new xg(this,e,t);this.roots.add(i);return i}destroy(){this.selection.destroy();this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(){return Array.from(this.roots,e=>e.rootName).filter(e=>e!=Bg)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=Vs(this);e.selection="[engine.model.DocumentSelection]";e.model="[engine.model.Model]";return e}_handleChangeBlock(e){if(this._hasDocumentChangedFromTheLastChangeBlock()){this._callPostFixers(e);this.selection.refresh();if(this.differ.hasDataChanges()){this.fire("change:data",e.batch)}else{this.fire("change",e.batch)}this.selection.refresh();this.differ.reset()}this._hasSelectionChangedFromTheLastChangeBlock=false}_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();const t=this.model;const i=t.schema;const n=t.createPositionFromPath(e,[0]);const o=i.getNearestSelectionRange(n);return o||t.createRange(n)}_validateSelectionRange(e){return Hg(e.start)&&Hg(e.end)}_callPostFixers(e){let t=false;do{for(const i of this._postFixers){this.selection.refresh();t=i(e);if(t){break}}}while(t)}}ys(Fg,ds);function Hg(e){const t=e.textNode;if(t){const i=t.data;const n=e.offset-t.startOffset;return!Vg(i,n)&&!jg(i,n)}return true}class Ug{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,i=false,n=false){const o=e instanceof Wg?e.name:e;if(o.includes(",")){throw new ss["b"]('markercollection-incorrect-marker-name: Marker name cannot contain "," character.',this)}const r=this._markers.get(o);if(r){const e=r.getRange();let s=false;if(!e.isEqual(t)){r._attachLiveRange(ff.fromRange(t));s=true}if(i!=r.managedUsingOperations){r._managedUsingOperations=i;s=true}if(typeof n==="boolean"&&n!=r.affectsData){r._affectsData=n;s=true}if(s){this.fire("update:"+o,r,e,t)}return r}const s=ff.fromRange(t);const a=new Wg(o,s,i,n);this._markers.set(o,a);this.fire("update:"+o,a,null,t);return a}_remove(e){const t=e instanceof Wg?e.name:e;const i=this._markers.get(t);if(i){this._markers.delete(t);this.fire("update:"+t,i,i.getRange(),null);this._destroyMarker(i);return true}return false}_refresh(e){const t=e instanceof Wg?e.name:e;const i=this._markers.get(t);if(!i){throw new ss["b"]("markercollection-refresh-marker-not-exists: Marker with provided name does not exists.",this)}const n=i.getRange();this.fire("update:"+t,i,n,n,i.managedUsingOperations,i.affectsData)}*getMarkersAtPosition(e){for(const t of this){if(t.getRange().containsPosition(e)){yield t}}}*getMarkersIntersectingRange(e){for(const t of this){if(t.getRange().getIntersection(e)!==null){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()){if(t.name.startsWith(e+":")){yield t}}}_destroyMarker(e){e.stopListening();e._detachLiveRange()}}ys(Ug,ds);class Wg{constructor(e,t,i,n){this.name=e;this._liveRange=this._attachLiveRange(t);this._managedUsingOperations=i;this._affectsData=n}get managedUsingOperations(){if(!this._liveRange){throw new ss["b"]("marker-destroyed: Cannot use a destroyed marker instance.",this)}return this._managedUsingOperations}get affectsData(){if(!this._liveRange){throw new ss["b"]("marker-destroyed: Cannot use a destroyed marker instance.",this)}return this._affectsData}getStart(){if(!this._liveRange){throw new ss["b"]("marker-destroyed: Cannot use a destroyed marker instance.",this)}return this._liveRange.start.clone()}getEnd(){if(!this._liveRange){throw new ss["b"]("marker-destroyed: Cannot use a destroyed marker instance.",this)}return this._liveRange.end.clone()}getRange(){if(!this._liveRange){throw new ss["b"]("marker-destroyed: Cannot use a destroyed marker instance.",this)}return this._liveRange.toRange()}is(e){return e==="marker"||e==="model:marker"}_attachLiveRange(e){if(this._liveRange){this._detachLiveRange()}e.delegate("change:range").to(this);e.delegate("change:content").to(this);this._liveRange=e;return e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this);this._liveRange.stopDelegating("change:content",this);this._liveRange.detach();this._liveRange=null}}ys(Wg,ds);class qg extends tg{get type(){return"noop"}clone(){return new qg(this.baseVersion)}getReversed(){return new qg(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const $g={};$g[mg.className]=mg;$g[bg.className]=bg;$g[wg.className]=wg;$g[pg.className]=pg;$g[qg.className]=qg;$g[tg.className]=tg;$g[kg.className]=kg;$g[_g.className]=_g;$g[yg.className]=yg;$g[vg.className]=vg;class Yg{static fromJSON(e,t){return $g[e.__className].fromJSON(e,t)}}class Gg extends Qh{constructor(e,t,i="toNone"){super(e,t,i);if(!this.root.is("rootElement")){throw new ss["b"]("model-liveposition-root-not-rootelement: LivePosition's root has to be an instance of RootElement.",e)}Kg.call(this)}detach(){this.stopListening()}is(e){return e==="livePosition"||e==="model:livePosition"||e=="position"||e==="model:position"}toPosition(){return new Qh(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t?t:e.stickiness)}}function Kg(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{const i=t[0];if(!i.isDocumentOperation){return}Qg.call(this,i)},{priority:"low"})}function Qg(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)}}ys(Gg,ds);function Jg(e,t,i,n){return e.change(o=>{let r;if(!i){r=e.document.selection}else if(i instanceof af||i instanceof wf){r=i}else{r=o.createSelection(i,n)}if(!r.isCollapsed){e.deleteContent(r,{doNotAutoparagraph:true})}const s=new Zg(e,o,r.anchor);let a;if(t.is("documentFragment")){a=t.getChildren()}else{a=[t]}s.handleNodes(a,{isFirst:true,isLast:true});const c=s.getSelectionRange();if(c){if(r instanceof wf){o.setSelection(c)}else{r.setTo(c)}}else{}const l=s.getAffectedRange()||e.createRange(r.anchor);s.destroy();return l})}class Zg{constructor(e,t,i){this.model=e;this.writer=t;this.position=i;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 i=0;i{if(!i.doNotResetEntireContent&&hp(o,t)){up(e,t,o);return}const[r,s]=ep(n);if(!n.start.isTouching(n.end)){e.remove(n)}if(!i.leaveUnmerged){ip(e,r,s);o.removeDisallowedAttributes(r.parent.getChildren(),e)}fp(e,t,r);if(!i.doNotAutoparagraph&&cp(o,r)){dp(e,r,t)}r.detach();s.detach()})}function ep(e){const t=e.root.document.model;const i=e.start;let n=e.end;if(t.hasContent(e,{ignoreMarkers:true})){const i=tp(n);if(i&&n.isTouching(t.createPositionAt(i,0))){const i=t.createSelection(e);t.modifySelection(i,{direction:"backward"});n=i.getLastPosition()}}return[Gg.fromPosition(i,"toPrevious"),Gg.fromPosition(n,"toNext")]}function tp(e){const t=e.parent;const i=t.root.document.model.schema;const n=t.getAncestors({parentFirst:true,includeSelf:true});for(const e of n){if(i.isLimit(e)){return null}if(i.isBlock(e)){return e}}}function ip(e,t,i){const n=e.model;if(!sp(e.model.schema,t,i)){return}const[o,r]=ap(t,i);if(!n.hasContent(o,{ignoreMarkers:true})&&n.hasContent(r,{ignoreMarkers:true})){op(e,t,i,o.parent)}else{np(e,t,i,o.parent)}}function np(e,t,i,n){const o=t.parent;const r=i.parent;if(o==n||r==n){return}t=e.createPositionAfter(o);i=e.createPositionBefore(r);if(!i.isEqual(t)){e.insert(r,t)}e.merge(t);while(i.parent.isEmpty){const t=i.parent;i=e.createPositionBefore(t);e.remove(t)}if(!sp(e.model.schema,t,i)){return}np(e,t,i,n)}function op(e,t,i,n){const o=t.parent;const r=i.parent;if(o==n||r==n){return}t=e.createPositionAfter(o);i=e.createPositionBefore(r);if(!i.isEqual(t)){e.insert(o,i)}while(t.parent.isEmpty){const i=t.parent;t=e.createPositionBefore(i);e.remove(i)}i=e.createPositionBefore(r);rp(e,i);if(!sp(e.model.schema,t,i)){return}op(e,t,i,n)}function rp(e,t){const i=t.nodeBefore;const n=t.nodeAfter;if(i.name!=n.name){e.rename(i,n.name)}e.clearAttributes(i);e.setAttributes(Object.fromEntries(n.getAttributes()),i);e.merge(t)}function sp(e,t,i){const n=t.parent;const o=i.parent;if(n==o){return false}if(e.isLimit(n)||e.isLimit(o)){return false}return lp(t,i,e)}function ap(e,t){const i=e.getAncestors();const n=t.getAncestors();let o=0;while(i[o]&&i[o]==n[o]){o++}return[i[o],n[o]]}function cp(e,t){const i=e.checkChild(t,"$text");const n=e.checkChild(t,"paragraph");return!i&&n}function lp(e,t,i){const n=new ef(e,t);for(const e of n.getWalker()){if(i.isLimit(e.item)){return false}}return true}function dp(e,t,i){const n=e.createElement("paragraph");e.insert(n,t);fp(e,i,e.createPositionAt(n,0))}function up(e,t){const i=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(i));dp(e,e.createPositionAt(i,0),t)}function hp(e,t){const i=e.getLimitElement(t);if(!t.containsEntireContent(i)){return false}const n=t.getFirstRange();if(n.start.parent==n.end.parent){return false}return e.checkChild(i,"paragraph")}function fp(e,t,i){if(t instanceof wf){e.setSelection(i)}else{t.setTo(i)}}const mp=' ,.?!:;"-()';function gp(e,t,i={}){const n=e.schema;const o=i.direction!="backward";const r=i.unit?i.unit:"character";const s=t.focus;const a=new Gh({boundaries:kp(s,o),singleCharacters:true,direction:o?"forward":"backward"});const c={walker:a,schema:n,isForward:o,unit:r};let l;while(l=a.next()){if(l.done){return}const i=pp(c,l.value);if(i){if(t instanceof wf){e.change(e=>{e.setSelectionFocus(i)})}else{t.setFocus(i)}return}}}function pp(e,t){if(t.type=="text"){if(e.unit==="word"){return wp(e.walker,e.isForward)}return bp(e.walker,e.unit,e.isForward)}if(t.type==(e.isForward?"elementStart":"elementEnd")){if(e.schema.isObject(t.item)){return Qh._createAt(t.item,e.isForward?"after":"before")}if(e.schema.checkChild(t.nextPosition,"$text")){return t.nextPosition}}else{if(e.schema.isLimit(t.item)){e.walker.skip(()=>true);return}if(e.schema.checkChild(t.nextPosition,"$text")){return t.nextPosition}}}function bp(e,t){const i=e.position.textNode;if(i){const n=i.data;let o=e.position.offset-i.startOffset;while(Vg(n,o)||t=="character"&&jg(n,o)){e.next();o=e.position.offset-i.startOffset}}return e.position}function wp(e,t){let i=e.position.textNode;if(i){let n=e.position.offset-i.startOffset;while(!_p(i.data,n,t)&&!vp(i,n,t)){e.next();const o=t?e.position.nodeAfter:e.position.nodeBefore;if(o&&o.is("$text")){const n=o.data.charAt(t?0:o.data.length-1);if(!mp.includes(n)){e.next();i=e.position.textNode}}n=e.position.offset-i.startOffset}}return e.position}function kp(e,t){const i=e.root;const n=Qh._createAt(i,t?"end":0);if(t){return new ef(e,n)}else{return new ef(n,e)}}function _p(e,t,i){const n=t+(i?0:-1);return mp.includes(e.charAt(n))}function vp(e,t,i){return t===(i?e.endOffset:0)}function yp(e,t){return e.change(e=>{const i=e.createDocumentFragment();const n=t.getFirstRange();if(!n||n.isCollapsed){return i}const o=n.start.root;const r=n.start.getCommonPath(n.end);const s=o.getNodeByPath(r);let a;if(n.start.parent==n.end.parent){a=n}else{a=e.createRange(e.createPositionAt(s,n.start.path[r.length]),e.createPositionAt(s,n.end.path[r.length]+1))}const c=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:true})){if(t.is("$textProxy")){e.appendText(t.data,t.getAttributes(),i)}else{e.append(e.cloneElement(t,true),i)}}if(a!=n){const t=n._getTransformedByMove(a.start,e.createPositionAt(i,0),c)[0];const o=e.createRange(e.createPositionAt(i,0),t.start);const r=e.createRange(t.end,e.createPositionAt(i,"end"));xp(r,e);xp(o,e)}return i})}function xp(e,t){const i=[];Array.from(e.getItems({direction:"backward"})).map(e=>t.createRangeOn(e)).filter(t=>{const i=(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end));return i}).forEach(e=>{i.push(e.start.parent);t.remove(e)});i.forEach(e=>{let i=e;while(i.parent&&i.isEmpty){const e=t.createRangeOn(i);i=i.parent;t.remove(e)}})}function Ap(e){e.document.registerPostFixer(t=>Tp(t,e))}function Tp(e,t){const i=t.document.selection;const n=t.schema;const o=[];let r=false;for(const e of i.getRanges()){const t=Cp(e,n);if(t&&!t.isEqual(e)){o.push(t);r=true}else{o.push(e)}}if(r){e.setSelection(Ip(o),{backward:i.isBackward})}}function Cp(e,t){if(e.isCollapsed){return Pp(e,t)}return Ep(e,t)}function Pp(e,t){const i=e.start;const n=t.getNearestSelectionRange(i);if(!n){return null}if(!n.isCollapsed){return n}const o=n.start;if(i.isEqual(o)){return null}return new ef(o)}function Ep(e,t){const i=e.start;const n=e.end;const o=t.checkChild(i,"$text");const r=t.checkChild(n,"$text");const s=t.getLimitElement(i);const a=t.getLimitElement(n);if(s===a){if(o&&r){return null}if(Mp(i,n,t)){const e=i.nodeAfter&&t.isObject(i.nodeAfter);const o=e?null:t.getNearestSelectionRange(i,"forward");const r=n.nodeBefore&&t.isObject(n.nodeBefore);const s=r?null:t.getNearestSelectionRange(n,"backward");const a=o?o.start:i;const c=s?s.start:n;return new ef(a,c)}}const c=s&&!s.is("rootElement");const l=a&&!a.is("rootElement");if(c||l){const e=i.nodeAfter&&n.nodeBefore&&i.nodeAfter.parent===n.nodeBefore.parent;const o=c&&(!e||!Np(i.nodeAfter,t));const r=l&&(!e||!Np(n.nodeBefore,t));let d=i;let u=n;if(o){d=Qh._createBefore(Sp(s,t))}if(r){u=Qh._createAfter(Sp(a,t))}return new ef(d,u)}return null}function Sp(e,t){let i=e;let n=i;while(t.isLimit(n)&&n.parent){i=n;n=n.parent}return i}function Mp(e,t,i){const n=e.nodeAfter&&!i.isLimit(e.nodeAfter)||i.checkChild(e,"$text");const o=t.nodeBefore&&!i.isLimit(t.nodeBefore)||i.checkChild(t,"$text");return n||o}function Ip(e){const t=[];t.push(e.shift());for(const i of e){const e=t.pop();if(i.isIntersecting(e)){const n=e.start.isAfter(i.start)?i.start:e.start;const o=e.end.isAfter(i.end)?e.end:i.end;const r=new ef(n,o);t.push(r)}else{t.push(e);t.push(i)}}return t}function Np(e,t){return e&&t.isObject(e)}class Op{constructor(){this.markers=new Ug;this.document=new Fg(this);this.schema=new Em;this._pendingChanges=[];this._currentWriter=null;["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(e=>this.decorate(e));this.on("applyOperation",(e,t)=>{const i=t[0];i._validate()},{priority:"highest"});this.schema.register("$root",{isLimit:true});this.schema.register("$block",{allowIn:"$root",isBlock:true});this.schema.register("$text",{allowIn:"$block",isInline:true});this.schema.register("$clipboardHolder",{allowContentOf:"$root",isLimit:true});this.schema.extend("$text",{allowIn:"$clipboardHolder"});this.schema.register("$marker");this.schema.addChildCheck((e,t)=>{if(t.name==="$marker"){return true}});Ap(this)}change(e){try{if(this._pendingChanges.length===0){this._pendingChanges.push({batch:new eg,callback:e});return this._runPendingChanges()[0]}else{return e(this._currentWriter)}}catch(e){ss["b"].rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{if(typeof e==="string"){e=new eg(e)}else if(typeof e=="function"){t=e;e=new eg}this._pendingChanges.push({batch:e,callback:t});if(this._pendingChanges.length==1){this._runPendingChanges()}}catch(e){ss["b"].rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,i){return Jg(this,e,t,i)}deleteContent(e,t){Xg(this,e,t)}modifySelection(e,t){gp(this,e,t)}getSelectedContent(e){return yp(this,e)}hasContent(e,t={}){const i=e instanceof $h?ef._createIn(e):e;if(i.isCollapsed){return false}const{ignoreWhitespaces:n=false,ignoreMarkers:o=false}=t;if(!o){for(const e of this.markers.getMarkersIntersectingRange(i)){if(e.affectsData){return true}}}for(const e of i.getItems()){if(e.is("$textProxy")){if(!n){return true}else if(e.data.search(/\S/)!==-1){return true}}else if(this.schema.isObject(e)){return true}}return false}createPositionFromPath(e,t,i){return new Qh(e,t,i)}createPositionAt(e,t){return Qh._createAt(e,t)}createPositionAfter(e){return Qh._createAfter(e)}createPositionBefore(e){return Qh._createBefore(e)}createRange(e,t){return new ef(e,t)}createRangeIn(e){return ef._createIn(e)}createRangeOn(e){return ef._createOn(e)}createSelection(e,t,i){return new af(e,t,i)}createBatch(e){return new eg(e)}createOperationFromJSON(e){return Yg.fromJSON(e,this.document)}destroy(){this.document.destroy();this.stopListening()}_runPendingChanges(){const e=[];this.fire("_beforeChanges");while(this._pendingChanges.length){const t=this._pendingChanges[0].batch;this._currentWriter=new Ag(this,t);const i=this._pendingChanges[0].callback(this._currentWriter);e.push(i);this.document._handleChangeBlock(this._currentWriter);this._pendingChanges.shift();this._currentWriter=null}this.fire("_afterChanges");return e}}ys(Op,Qc);class zp{constructor(){this._listener=Object.create(Kd)}listenTo(e){this._listener.listenTo(e,"keydown",(e,t)=>{this._listener.fire("_keydown:"+Rl(t),t)})}set(e,t,i={}){const n=Ll(e);const o=i.priority;this._listener.listenTo(this._listener,"_keydown:"+n,(e,i)=>{t(i,()=>{i.preventDefault();i.stopPropagation();e.stop()});e.return=true},{priority:o})}press(e){return!!this._listener.fire("_keydown:"+Rl(e),e)}destroy(){this._listener.stopListening()}}class Rp extends zp{constructor(e){super();this.editor=e}set(e,t,i={}){if(typeof t=="string"){const e=t;t=(t,i)=>{this.editor.execute(e);i()}}super.set(e,t,i)}}class Lp{constructor(e={}){this._context=e.context||new zs({language:e.language});this._context._addEditor(this,!e.context);const t=Array.from(this.constructor.builtinPlugins||[]);this.config=new Kr(e,this.constructor.defaultConfig);this.config.define("plugins",t);this.config.define(this._context._getEditorConfig());this.plugins=new As(this,t,this._context.plugins);this.locale=this._context.locale;this.t=this.locale.t;this.commands=new Tm;this.set("state","initializing");this.once("ready",()=>this.state="ready",{priority:"high"});this.once("destroy",()=>this.state="destroyed",{priority:"high"});this.set("isReadOnly",false);this.model=new Op;const i=new zc;this.data=new Km(this.model,i);this.editing=new Am(this.model,i);this.editing.view.document.bind("isReadOnly").to(this);this.conversion=new Jm([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 Rp(this);this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const e=this.config;const t=e.get("plugins");const i=e.get("removePlugins")||[];const n=e.get("extraPlugins")||[];return this.plugins.init(t.concat(n),i)}destroy(){let e=Promise.resolve();if(this.state=="initializing"){e=new Promise(e=>this.once("ready",e))}return 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){ss["b"].rethrowUnexpectedError(e,this)}}}ys(Lp,Qc);const Dp={setData(e){this.data.set(e)},getData(e){return this.data.get(e)}};var Vp=Dp;function jp(e,t){if(e instanceof HTMLTextAreaElement){e.value=t}e.innerHTML=t}const Bp={updateSourceElement(){if(!this.sourceElement){throw new ss["b"]("editor-missing-sourceelement: Cannot update the source element of a detached editor.",this)}jp(this.sourceElement,this.data.get())}};var Fp=Bp;function Hp(e){if(!me(e.updateSourceElement)){throw new ss["b"]("attachtoform-missing-elementapi-interface: Editor passed to attachToForm() must implement ElementApi.",e)}const t=e.sourceElement;if(t&&t.tagName.toLowerCase()==="textarea"&&t.form){let i;const n=t.form;const o=()=>e.updateSourceElement();if(me(n.submit)){i=n.submit;n.submit=()=>{o();i.apply(n)}}n.addEventListener("submit",o);e.on("destroy",()=>{n.removeEventListener("submit",o);if(i){n.submit=i}})}}class Up{getHtml(e){const t=document.implementation.createHTMLDocument("");const i=t.createElement("div");i.appendChild(e);return i.innerHTML}}class Wp{constructor(e){this._domParser=new DOMParser;this._domConverter=new Hd(e,{blockFillerMode:"nbsp"});this._htmlWriter=new Up}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");const i=t.createDocumentFragment();const n=t.body.childNodes;while(n.length>0){i.appendChild(n[0])}return i}}class qp{constructor(e){this.editor=e;this._components=new Map}*names(){for(const e of this._components.values()){yield e.originalName}}add(e,t){if(this.has(e)){throw new ss["b"]("componentfactory-item-exists: The item already exists in the component factory.",this,{name:e})}this._components.set($p(e),{callback:t,originalName:e})}create(e){if(!this.has(e)){throw new ss["b"]("componentfactory-item-missing: The required component is not registered in the factory.",this,{name:e})}return this._components.get($p(e)).callback(this.editor.locale)}has(e){return this._components.has($p(e))}}function $p(e){return String(e).toLowerCase()}class Yp{constructor(){this.set("isFocused",false);this.set("focusedElement",null);this._elements=new Set;this._nextEventLoopTimeout=null}add(e){if(this._elements.has(e)){throw new ss["b"]("focusTracker-add-element-already-exist",this)}this.listenTo(e,"focus",()=>this._focus(e),{useCapture:true});this.listenTo(e,"blur",()=>this._blur(),{useCapture:true});this._elements.add(e)}remove(e){if(e===this.focusedElement){this._blur(e)}if(this._elements.has(e)){this.stopListening(e);this._elements.delete(e)}}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout);this.focusedElement=e;this.isFocused=true}_blur(){clearTimeout(this._nextEventLoopTimeout);this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null;this.isFocused=false},0)}}ys(Yp,Kd);ys(Yp,Qc);class Gp{constructor(e){this.editor=e;this.componentFactory=new qp(e);this.focusTracker=new Yp;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);if(!t.ckeditorInstance){t.ckeditorInstance=this.editor}}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){console.warn("editor-ui-deprecated-editable-elements: "+"The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this});return this._editableElementsMap}}ys(Gp,ds);function Kp({origin:e,originKeystrokeHandler:t,originFocusTracker:i,toolbar:n,beforeFocus:o,afterBlur:r}){i.add(n.element);t.set("Alt+F10",(e,t)=>{if(i.isFocused&&!n.focusTracker.isFocused){if(o){o()}n.focus();t()}});n.keystrokes.set("Esc",(t,i)=>{if(n.focusTracker.isFocused){e.focus();if(r){r()}i()}})}function Qp(e){if(Array.isArray(e)){return{items:e}}if(!e){return{items:[]}}return Object.assign({items:[]},e)}var Jp=i(13);const Zp=new WeakMap;function Xp(e){const{view:t,element:i,text:n,isDirectHost:o=true}=e;const r=t.document;if(!Zp.has(r)){Zp.set(r,new Map);r.registerPostFixer(e=>ob(r,e))}Zp.get(r).set(i,{text:n,isDirectHost:o});t.change(e=>ob(r,e))}function eb(e,t){const i=t.document;e.change(e=>{if(!Zp.has(i)){return}const n=Zp.get(i);const o=n.get(t);e.removeAttribute("data-placeholder",o.hostElement);ib(e,o.hostElement);n.delete(t)})}function tb(e,t){if(!t.hasClass("ck-placeholder")){e.addClass("ck-placeholder",t);return true}return false}function ib(e,t){if(t.hasClass("ck-placeholder")){e.removeClass("ck-placeholder",t);return true}return false}function nb(e){if(!e.isAttached()){return false}const t=!Array.from(e.getChildren()).some(e=>!e.is("uiElement"));const i=e.document;if(!i.isFocused&&t){return true}const n=i.selection;const o=n.anchor;if(t&&o&&o.parent!==e){return true}return false}function ob(e,t){const i=Zp.get(e);let n=false;for(const[e,o]of i){if(rb(t,e,o)){n=true}}return n}function rb(e,t,i){const{text:n,isDirectHost:o}=i;const r=o?t:sb(t);let s=false;if(!r){return false}i.hostElement=r;if(r.getAttribute("data-placeholder")!==n){e.setAttribute("data-placeholder",n,r);s=true}if(nb(r)){if(tb(e,r)){s=true}}else if(ib(e,r)){s=true}return s}function sb(e){if(e.childCount===1){const t=e.getChild(0);if(t.is("element")&&!t.is("uiElement")){return t}}return null}class ab{constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t});e.style.display="none";if(t){e.parentNode.insertBefore(t,e.nextSibling)}}restore(){this._replacedElements.forEach(({element:e,newElement:t})=>{e.style.display="";if(t){t.remove()}});this._replacedElements=[]}}class cb extends Gp{constructor(e,t){super(e);this.view=t;this._toolbarConfig=Qp(e.config.get("toolbar"));this._elementReplacer=new ab}get element(){return this.view.element}init(e){const t=this.editor;const i=this.view;const n=t.editing.view;const o=i.editable;const r=n.document.getRoot();o.name=r.rootName;i.render();const s=o.element;this.setEditableElement(o.name,s);this.focusTracker.add(s);i.editable.bind("isFocused").to(this.focusTracker);n.attachDomRoot(s);if(e){this._elementReplacer.replace(e,this.element)}this._initPlaceholder();this._initToolbar();this.fire("ready")}destroy(){const e=this.view;const t=this.editor.editing.view;this._elementReplacer.restore();t.detachDomRoot(e.editable.name);e.destroy();super.destroy()}_initToolbar(){const e=this.editor;const t=this.view;const i=e.editing.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused");t.stickyPanel.limiterElement=t.element;if(this._toolbarConfig.viewportTopOffset){t.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset}t.toolbar.fillFromConfig(this._toolbarConfig.items,this.componentFactory);Kp({origin:i,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:t.toolbar})}_initPlaceholder(){const e=this.editor;const t=e.editing.view;const i=t.document.getRoot();const n=e.sourceElement;const o=e.config.get("placeholder")||n&&n.tagName.toLowerCase()==="textarea"&&n.getAttribute("placeholder");if(o){Xp({view:t,element:i,text:o,isDirectHost:false})}}}class lb extends xs{constructor(e=[]){super(e,{idProperty:"viewUid"});this.on("add",(e,t,i)=>{this._renderViewIntoCollectionParent(t,i)});this.on("remove",(e,t)=>{if(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||!db(e)){throw new ss["b"]("ui-viewcollection-delegate-wrong-events: All event names must be strings.",this)}return{to:t=>{for(const i of this){for(const n of e){i.delegate(n).to(t)}}this.on("add",(i,n)=>{for(const i of e){n.delegate(i).to(t)}});this.on("remove",(i,n)=>{for(const i of e){n.stopDelegating(i,t)}})}}}_renderViewIntoCollectionParent(e,t){if(!e.isRendered){e.render()}if(e.element&&this._parentElement){this._parentElement.insertBefore(e.element,this._parentElement.children[t])}}}function db(e){return e.every(e=>typeof e=="string")}const ub="http://www.w3.org/1999/xhtml";class hb{constructor(e){Object.assign(this,xb(yb(e)));this._isRendered=false;this._revertData=null}render(){const e=this._renderNode({intoFragment:true});this._isRendered=true;return e}apply(e){this._revertData=Lb();this._renderNode({node:e,isApplying:true,revertData:this._revertData});return e}revert(e){if(!this._revertData){throw new ss["b"]("ui-template-revert-not-applied: Attempting to revert a template which has not been applied yet.",[this,e])}this._revertTemplateFromNode(e,this._revertData)}*getViews(){function*e(t){if(t.children){for(const i of t.children){if(Ob(i)){yield i}else if(zb(i)){yield*e(i)}}}}yield*e(this)}static bind(e,t){return{to(i,n){return new mb({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:n})},if(i,n,o){return new gb({observable:e,emitter:t,attribute:i,valueIfTrue:n,callback:o})}}}static extend(e,t){if(e._isRendered){throw new ss["b"]("template-extend-render: Attempting to extend a template which has already been rendered.",[this,e])}Ib(e,xb(yb(t)))}_renderNode(e){let t;if(e.node){t=this.tag&&this.text}else{t=this.tag?this.text:!this.text}if(t){throw new ss["b"]('ui-template-wrong-syntax: Node definition must have either "tag" or "text" when rendering a new Node.',this)}if(this.text){return this._renderText(e)}else{return this._renderElement(e)}}_renderElement(e){let t=e.node;if(!t){t=e.node=document.createElementNS(this.ns||ub,this.tag)}this._renderAttributes(e);this._renderElementChildren(e);this._setUpListeners(e);return t}_renderText(e){let t=e.node;if(t){e.revertData.text=t.textContent}else{t=e.node=document.createTextNode("")}if(pb(this.text)){this._bindToObservable({schema:this.text,updater:kb(t),data:e})}else{t.textContent=this.text.join("")}return t}_renderAttributes(e){let t,i,n,o;if(!this.attributes){return}const r=e.node;const s=e.revertData;for(t in this.attributes){n=r.getAttribute(t);i=this.attributes[t];if(s){s.attributes[t]=n}o=ce(i[0])&&i[0].ns?i[0].ns:null;if(pb(i)){const a=o?i[0].value:i;if(s&&Db(t)){a.unshift(n)}this._bindToObservable({schema:a,updater:_b(r,t,o),data:e})}else if(t=="style"&&typeof i[0]!=="string"){this._renderStyleAttribute(i[0],e)}else{if(s&&n&&Db(t)){i.unshift(n)}i=i.map(e=>e?e.value||e:e).reduce((e,t)=>e.concat(t),[]).reduce(Sb,"");if(!Nb(i)){r.setAttributeNS(o,t,i)}}}}_renderStyleAttribute(e,t){const i=t.node;for(const n in e){const o=e[n];if(pb(o)){this._bindToObservable({schema:[o],updater:vb(i,n),data:t})}else{i.style[n]=o}}}_renderElementChildren(e){const t=e.node;const i=e.intoFragment?document.createDocumentFragment():t;const n=e.isApplying;let o=0;for(const r of this.children){if(Rb(r)){if(!n){r.setParent(t);for(const e of r){i.appendChild(e.element)}}}else if(Ob(r)){if(!n){if(!r.isRendered){r.render()}i.appendChild(r.element)}}else if(Ed(r)){i.appendChild(r)}else{if(n){const t=e.revertData;const n=Lb();t.children.push(n);r._renderNode({node:i.childNodes[o++],isApplying:true,revertData:n})}else{i.appendChild(r.render())}}}if(e.intoFragment){t.appendChild(i)}}_setUpListeners(e){if(!this.eventListeners){return}for(const t in this.eventListeners){const i=this.eventListeners[t].map(i=>{const[n,o]=t.split("@");return i.activateDomEventListener(n,o,e)});if(e.revertData){e.revertData.bindings.push(i)}}}_bindToObservable({schema:e,updater:t,data:i}){const n=i.revertData;wb(e,t,i);const o=e.filter(e=>!Nb(e)).filter(e=>e.observable).map(n=>n.activateAttributeListener(e,t,i));if(n){n.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;return}for(const i in t.attributes){const n=t.attributes[i];if(n===null){e.removeAttribute(i)}else{e.setAttribute(i,n)}}for(let i=0;iwb(e,t,i);this.emitter.listenTo(this.observable,"change:"+this.attribute,n);return()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,n)}}}class mb extends fb{activateDomEventListener(e,t,i){const n=(e,i)=>{if(!t||i.target.matches(t)){if(typeof this.eventNameOrFunction=="function"){this.eventNameOrFunction(i)}else{this.observable.fire(this.eventNameOrFunction,i)}}};this.emitter.listenTo(i.node,e,n);return()=>{this.emitter.stopListening(i.node,e,n)}}}class gb extends fb{getValue(e){const t=super.getValue(e);return Nb(t)?false:this.valueIfTrue||true}}function pb(e){if(!e){return false}if(e.value){e=e.value}if(Array.isArray(e)){return e.some(pb)}else if(e instanceof fb){return true}return false}function bb(e,t){return e.map(e=>{if(e instanceof fb){return e.getValue(t)}return e})}function wb(e,t,{node:i}){let n=bb(e,i);if(e.length==1&&e[0]instanceof gb){n=n[0]}else{n=n.reduce(Sb,"")}if(Nb(n)){t.remove()}else{t.set(n)}}function kb(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}function _b(e,t,i){return{set(n){e.setAttributeNS(i,t,n)},remove(){e.removeAttributeNS(i,t)}}}function vb(e,t){return{set(i){e.style[t]=i},remove(){e.style[t]=null}}}function yb(e){const t=$r(e,e=>{if(e&&(e instanceof fb||zb(e)||Ob(e)||Rb(e))){return e}});return t}function xb(e){if(typeof e=="string"){e=Cb(e)}else if(e.text){Pb(e)}if(e.on){e.eventListeners=Tb(e.on);delete e.on}if(!e.text){if(e.attributes){Ab(e.attributes)}const t=[];if(e.children){if(Rb(e.children)){t.push(e.children)}else{for(const i of e.children){if(zb(i)||Ob(i)||Ed(i)){t.push(i)}else{t.push(new hb(i))}}}}e.children=t}return e}function Ab(e){for(const t in e){if(e[t].value){e[t].value=[].concat(e[t].value)}Eb(e,t)}}function Tb(e){for(const t in e){Eb(e,t)}return e}function Cb(e){return{text:[e]}}function Pb(e){if(!Array.isArray(e.text)){e.text=[e.text]}}function Eb(e,t){if(!Array.isArray(e[t])){e[t]=[e[t]]}}function Sb(e,t){if(Nb(t)){return e}else if(Nb(e)){return t}else{return`${e} ${t}`}}function Mb(e,t){for(const i in t){if(e[i]){e[i].push(...t[i])}else{e[i]=t[i]}}}function Ib(e,t){if(t.attributes){if(!e.attributes){e.attributes={}}Mb(e.attributes,t.attributes)}if(t.eventListeners){if(!e.eventListeners){e.eventListeners={}}Mb(e.eventListeners,t.eventListeners)}if(t.text){e.text.push(...t.text)}if(t.children&&t.children.length){if(e.children.length!=t.children.length){throw new ss["b"]("ui-template-extend-children-mismatch: The number of children in extended definition does not match.",e)}let i=0;for(const n of t.children){Ib(e.children[i++],n)}}}function Nb(e){return!e&&e!==0}function Ob(e){return e instanceof jb}function zb(e){return e instanceof hb}function Rb(e){return e instanceof lb}function Lb(){return{children:[],bindings:[],attributes:{}}}function Db(e){return e=="class"||e=="style"}var Vb=i(15);class jb{constructor(e){this.element=null;this.isRendered=false;this.locale=e;this.t=e&&e.t;this._viewCollections=new xs;this._unboundChildren=this.createCollection();this._viewCollections.on("add",(t,i)=>{i.locale=e});this.decorate("render")}get bindTemplate(){if(this._bindTemplate){return this._bindTemplate}return this._bindTemplate=hb.bind(this,this)}createCollection(e){const t=new lb(e);this._viewCollections.add(t);return t}registerChild(e){if(!vs(e)){e=[e]}for(const t of e){this._unboundChildren.add(t)}}deregisterChild(e){if(!vs(e)){e=[e]}for(const t of e){this._unboundChildren.remove(t)}}setTemplate(e){this.template=new hb(e)}extendTemplate(e){hb.extend(this.template,e)}render(){if(this.isRendered){throw new ss["b"]("ui-view-render-already-rendered: This View has already been rendered.",this)}if(this.template){this.element=this.template.render();this.registerChild(this.template.getViews())}this.isRendered=true}destroy(){this.stopListening();this._viewCollections.map(e=>e.destroy());if(this.template&&this.template._revertData){this.template.revert(this.element)}}}ys(jb,Kd);ys(jb,Qc);var Bb="[object String]";function Fb(e){return typeof e=="string"||!Kt(e)&&C(e)&&_(e)==Bb}var Hb=Fb;function Ub(e,t,i={},n=[]){const o=i&&i.xmlns;const r=o?e.createElementNS(o,t):e.createElement(t);for(const e in i){r.setAttribute(e,i[e])}if(Hb(n)||!vs(n)){n=[n]}for(let t of n){if(Hb(t)){t=e.createTextNode(t)}r.appendChild(t)}return r}class Wb extends lb{constructor(e,t=[]){super(t);this.locale=e}attachToDom(){this._bodyCollectionContainer=new hb({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");if(!e){e=Ub(document,"div",{class:"ck-body-wrapper"});document.body.appendChild(e)}e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy();if(this._bodyCollectionContainer){this._bodyCollectionContainer.remove()}const e=document.querySelector(".ck-body-wrapper");if(e&&e.childElementCount==0){e.remove()}}}var qb=i(17);class $b extends jb{constructor(e){super(e);this.body=new Wb(e)}render(){super.render();this.body.attachToDom()}destroy(){this.body.detachFromDom();return super.destroy()}}var Yb=i(19);class Gb extends jb{constructor(e){super(e);this.set("text");this.set("for");this.id=`ck-editor__label_${is()}`;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 Kb extends $b{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;const t=new Gb;t.text=e("Rich Text Editor");t.extendTemplate({attributes:{class:"ck-voice-label"}});return t}}class Qb extends jb{constructor(e,t,i){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",false);this._editableElement=i;this._hasExternalElement=!!this._editableElement;this._editingView=t}render(){super.render();if(this._hasExternalElement){this.template.apply(this.element=this._editableElement)}else{this._editableElement=this.element}this.on("change:isFocused",()=>this._updateIsFocusedClasses());this._updateIsFocusedClasses()}destroy(){if(this._hasExternalElement){this.template.revert(this._editableElement)}super.destroy()}_updateIsFocusedClasses(){const e=this._editingView;if(e.isRenderingInProgress){i(this)}else{t(this)}function t(t){e.change(i=>{const n=e.document.getRoot(t.name);i.addClass(t.isFocused?"ck-focused":"ck-blurred",n);i.removeClass(t.isFocused?"ck-blurred":"ck-focused",n)})}function i(n){e.once("change:isRenderingInProgress",(e,o,r)=>{if(!r){t(n)}else{i(n)}})}}}class Jb extends Qb{constructor(e,t,i){super(e,t,i);this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView;const t=this.t;e.change(i=>{const n=e.document.getRoot(this.name);i.setAttribute("aria-label",t("Rich Text Editor, %0",[this.name]),n)})}}function Zb(e){return t=>t+e}var Xb=i(21);const ew=Zb("px");class tw extends jb{constructor(e){super(e);const t=this.bindTemplate;this.set("isActive",false);this.set("isSticky",false);this.set("limiterElement",null);this.set("limiterBottomOffset",50);this.set("viewportTopOffset",0);this.set("_marginLeft",null);this.set("_isStickyToTheLimiter",false);this.set("_hasViewportTopOffset",false);this.content=this.createCollection();this._contentPanelPlaceholder=new hb({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",e=>e?"block":"none"),height:t.to("isSticky",e=>e?ew(this._panelRect.height):null)}}}).render();this._contentPanel=new hb({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?ew(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_hasViewportTopOffset",e=>e?ew(this.viewportTopOffset):null),bottom:t.to("_isStickyToTheLimiter",e=>e?ew(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(Dd.window,"scroll",()=>{this._checkIfShouldBeSticky()});this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const e=this._panelRect=this._contentPanel.getBoundingClientRect();let t;if(!this.limiterElement){this.isSticky=false}else{t=this._limiterRect=this.limiterElement.getBoundingClientRect();this.isSticky=this.isActive&&t.top{this[t]();i()})}}}}get first(){return this.focusables.find(nw)||null}get last(){return this.focusables.filter(nw).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;if(this.focusTracker.focusedElement===null){return null}this.focusables.find((t,i)=>{const n=t.element===this.focusTracker.focusedElement;if(n){e=i}return n});return e}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){if(e){e.focus()}}_getFocusableItem(e){const t=this.current;const i=this.focusables.length;if(!i){return null}if(t===null){return this[e===1?"first":"last"]}let n=(t+i+e)%i;do{const t=this.focusables.get(n);if(nw(t)){return t}n=(n+i+e)%i}while(n!==t);return null}}function nw(e){return!!(e.focus&&Dd.window.getComputedStyle(e.element).display!="none")}class ow extends jb{constructor(e){super(e);this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}const rw=100;class sw{constructor(e,t){if(!sw._observerInstance){sw._createObserver()}this._element=e;this._callback=t;sw._addElementCallback(e,t);sw._observerInstance.observe(e)}destroy(){sw._deleteElementCallback(this._element,this._callback)}static _addElementCallback(e,t){if(!sw._elementCallbacks){sw._elementCallbacks=new Map}let i=sw._elementCallbacks.get(e);if(!i){i=new Set;sw._elementCallbacks.set(e,i)}i.add(t)}static _deleteElementCallback(e,t){const i=sw._getElementCallbacks(e);if(i){i.delete(t);if(!i.size){sw._elementCallbacks.delete(e);sw._observerInstance.unobserve(e)}}if(sw._elementCallbacks&&!sw._elementCallbacks.size){sw._observerInstance=null;sw._elementCallbacks=null}}static _getElementCallbacks(e){if(!sw._elementCallbacks){return null}return sw._elementCallbacks.get(e)}static _createObserver(){let e;if(typeof Dd.window.ResizeObserver==="function"){e=Dd.window.ResizeObserver}else{e=aw}sw._observerInstance=new e(e=>{for(const t of e){if(!t.target.offsetParent){continue}const e=sw._getElementCallbacks(t.target);if(e){for(const i of e){i(t)}}}})}}sw._observerInstance=null;sw._elementCallbacks=null;class aw{constructor(e){this._callback=e;this._elements=new Set;this._previousRects=new Map;this._periodicCheckTimeout=null}observe(e){this._elements.add(e);this._checkElementRectsAndExecuteCallback();if(this._elements.size===1){this._startPeriodicCheck()}}unobserve(e){this._elements.delete(e);this._previousRects.delete(e);if(!this._elements.size){this._stopPeriodicCheck()}}_startPeriodicCheck(){const e=()=>{this._checkElementRectsAndExecuteCallback();this._periodicCheckTimeout=setTimeout(e,rw)};this.listenTo(Dd.window,"resize",()=>{this._checkElementRectsAndExecuteCallback()});this._periodicCheckTimeout=setTimeout(e,rw)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout);this.stopListening();this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const e=[];for(const t of this._elements){if(this._hasRectChanged(t)){e.push({target:t,contentRect:this._previousRects.get(t)})}}if(e.length){this._callback(e)}}_hasRectChanged(e){if(!e.ownerDocument.body.contains(e)){return false}const t=new Ch(e);const i=this._previousRects.get(e);const n=!i||!i.isEqual(t);this._previousRects.set(e,t);return n}}ys(aw,Kd);function cw(e){return e.bindTemplate.to(t=>{if(t.target===e.element){t.preventDefault()}})}class lw extends jb{constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",false);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(){if(this.children.length){this.children.first.focus()}}focusLast(){if(this.children.length){const e=this.children.last;if(typeof e.focusLast==="function"){e.focusLast()}else{e.focus()}}}}var dw=i(23);function uw(e){if(!e||!e.parentNode){return null}if(e.offsetParent===Dd.document.body){return null}return e.offsetParent}function hw({element:e,target:t,positions:i,limiter:n,fitInViewport:o}){if(me(t)){t=t()}if(me(n)){n=n()}const r=uw(e);const s=new Ch(e);const a=new Ch(t);let c;let l;if(!n&&!o){[l,c]=fw(i[0],a,s)}else{const e=n&&new Ch(n).getVisible();const t=o&&new Ch(Dd.window);const r=mw(i,{targetRect:a,elementRect:s,limiterRect:e,viewportRect:t});[l,c]=r||fw(i[0],a,s)}let d=ww(c);if(r){d=bw(d,r)}return{left:d.left,top:d.top,name:l}}function fw(e,t,i){const n=e(t,i);if(!n){return null}const{left:o,top:r,name:s}=n;return[s,i.clone().moveTo(o,r)]}function mw(e,t){const{elementRect:i,viewportRect:n}=t;const o=i.getArea();const r=gw(e,t);if(n){const e=r.filter(({viewportIntersectArea:e})=>e===o);const t=pw(e,o);if(t){return t}}return pw(r,o)}function gw(e,{targetRect:t,elementRect:i,limiterRect:n,viewportRect:o}){const r=[];const s=i.getArea();for(const a of e){const e=fw(a,t,i);if(!e){continue}const[c,l]=e;let d=0;let u=0;if(n){if(o){const e=n.getIntersection(o);if(e){d=e.getIntersectionArea(l)}}else{d=n.getIntersectionArea(l)}}if(o){u=o.getIntersectionArea(l)}const h={positionName:c,positionRect:l,limiterIntersectArea:d,viewportIntersectArea:u};if(d===s){return[h]}r.push(h)}return r}function pw(e,t){let i=0;let n;let o;for(const{positionName:r,positionRect:s,limiterIntersectArea:a,viewportIntersectArea:c}of e){if(a===t){return[r,s]}const e=c**2+a**2;if(e>i){i=e;n=s;o=r}}return n?[o,n]:null}function bw({left:e,top:t},i){const n=ww(new Ch(i));const o=Ah(i);e-=n.left;t-=n.top;e+=i.scrollLeft;t+=i.scrollTop;e-=o.left;t-=o.top;return{left:e,top:t}}function ww({left:e,top:t}){const{scrollX:i,scrollY:n}=Dd.window;return{left:e+i,top:t+n}}class kw extends jb{constructor(e,t,i){super(e);const n=this.bindTemplate;this.buttonView=t;this.panelView=i;this.set("isOpen",false);this.set("isEnabled",true);this.set("class");this.set("id");this.set("panelPosition","auto");this.keystrokes=new zp;this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",n.to("class"),n.if("isEnabled","ck-disabled",e=>!e)],id:n.to("id"),"aria-describedby":n.to("ariaDescribedById")},children:[t,i]});t.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render();this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen});this.panelView.bind("isVisible").to(this,"isOpen");this.on("change:isOpen",()=>{if(!this.isOpen){return}if(this.panelPosition==="auto"){this.panelView.position=kw._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:true,positions:this._panelPositions}).name}else{this.panelView.position=this.panelPosition}});this.keystrokes.listenTo(this.element);const e=(e,t)=>{if(this.isOpen){this.buttonView.focus();this.isOpen=false;t()}};this.keystrokes.set("arrowdown",(e,t)=>{if(this.buttonView.isEnabled&&!this.isOpen){this.isOpen=true;t()}});this.keystrokes.set("arrowright",(e,t)=>{if(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:i,northWest:n}=kw.defaultPanelPositions;if(this.locale.uiLanguageDirection==="ltr"){return[e,t,i,n]}else{return[t,e,n,i]}}}kw.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"})};kw._getOptimalPosition=hw;var _w=i(25);class vw extends jb{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");const t=e.querySelector("svg");const i=t.getAttribute("viewBox");if(i){this.viewBox=i}this.element.innerHTML="";while(t.childNodes.length>0){this.element.appendChild(t.childNodes[0])}}}_colorFillPaths(){if(this.fillColor){this.element.querySelectorAll(".ck-icon__fill").forEach(e=>{e.style.fill=this.fillColor})}}}var yw=i(27);class xw extends jb{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")}]}]})}}var Aw=i(29);class Tw extends jb{constructor(e){super(e);const t=this.bindTemplate;const i=is();this.set("class");this.set("labelStyle");this.set("icon");this.set("isEnabled",true);this.set("isOn",false);this.set("isVisible",true);this.set("isToggleable",false);this.set("keystroke");this.set("label");this.set("tabindex",-1);this.set("tooltip");this.set("tooltipPosition","s");this.set("type","button");this.set("withText",false);this.set("withKeystroke",false);this.children=this.createCollection();this.tooltipView=this._createTooltipView();this.labelView=this._createLabelView(i);this.iconView=new vw;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?e:"button"),tabindex:t.to("tabindex"),"aria-labelledby":`ck-editor__aria-label_${i}`,"aria-disabled":t.if("isEnabled",true,e=>!e),"aria-pressed":t.to("isOn",e=>this.isToggleable?String(e):false)},children:this.children,on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(e=>{if(this.isEnabled){this.fire("execute")}else{e.preventDefault()}})}})}render(){super.render();if(this.icon){this.iconView.bind("content").to(this,"icon");this.children.add(this.iconView)}this.children.add(this.tooltipView);this.children.add(this.labelView);if(this.withKeystroke){this.children.add(this.keystrokeView)}}focus(){this.element.focus()}_createTooltipView(){const e=new xw;e.bind("text").to(this,"_tooltipString");e.bind("position").to(this,"tooltipPosition");return e}_createLabelView(e){const t=new jb;const i=this.bindTemplate;t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:i.to("labelStyle"),id:`ck-editor__aria-label_${e}`},children:[{text:this.bindTemplate.to("label")}]});return t}_createKeystrokeView(){const e=new jb;e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",e=>Dl(e))}]});return e}_getTooltipString(e,t,i){if(e){if(typeof e=="string"){return e}else{if(i){i=Dl(i)}if(e instanceof Function){return e(t,i)}else{return`${t}${i?` (${i})`:""}`}}}return""}}var Cw='';class Pw extends Tw{constructor(e){super(e);this.arrowView=this._createArrowView();this.extendTemplate({attributes:{"aria-haspopup":true}});this.delegate("execute").to(this,"open")}render(){super.render();this.children.add(this.arrowView)}_createArrowView(){const e=new vw;e.content=Cw;e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}});return e}}var Ew=i(31);class Sw extends jb{constructor(){super();this.items=this.createCollection();this.focusTracker=new Yp;this.keystrokes=new zp;this._focusCycler=new iw({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 Mw extends jb{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 Iw extends jb{constructor(e){super(e);this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}var Nw=i(33);class Ow extends Tw{constructor(e){super(e);this.isToggleable=true;this.toggleSwitchView=this._createToggleView();this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render();this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new jb;e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]});return e}}function zw({emitter:e,activator:t,callback:i,contextElements:n}){e.listenTo(document,"mousedown",(e,{target:o})=>{if(!t()){return}for(const e of n){if(e.contains(o)){return}}i()})}var Rw=i(35);var Lw=i(37);function Dw(e,t=Pw){const i=new t(e);const n=new lw(e);const o=new kw(e,i,n);i.bind("isEnabled").to(o);if(i instanceof Pw){i.bind("isOn").to(o,"isOpen")}else{i.arrowView.bind("isOn").to(o,"isOpen")}Bw(o);return o}function Vw(e,t){const i=e.locale;const n=i.t;const o=e.toolbarView=new $w(i);o.set("ariaLabel",n("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 jw(e,t){const i=e.locale;const n=e.listView=new Sw(i);n.items.bindTo(t).using(({type:e,model:t})=>{if(e==="separator"){return new Iw(i)}else if(e==="button"||e==="switchbutton"){const n=new Mw(i);let o;if(e==="button"){o=new Tw(i)}else{o=new Ow(i)}o.bind(...Object.keys(t)).to(t);o.delegate("execute").to(n);n.children.add(o);return n}});e.panelView.children.add(n);n.items.delegate("execute").to(e)}function Bw(e){Fw(e);Hw(e);Uw(e)}function Fw(e){e.on("render",()=>{zw({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=false},contextElements:[e.element]})})}function Hw(e){e.on("execute",t=>{if(t.source instanceof Ow){return}e.isOpen=false})}function Uw(e){e.keystrokes.set("arrowdown",(t,i)=>{if(e.isOpen){e.panelView.focus();i()}});e.keystrokes.set("arrowup",(t,i)=>{if(e.isOpen){e.panelView.focusLast();i()}})}var Ww='';var qw=i(39);class $w extends jb{constructor(e,t){super(e);const i=this.bindTemplate;const n=this.t;this.options=t||{};this.set("ariaLabel",n("Editor toolbar"));this.set("maxWidth","auto");this.items=this.createCollection();this.focusTracker=new Yp;this.keystrokes=new zp;this.set("class");this.set("isCompact",false);this.itemsView=new Yw(e);this.children=this.createCollection();this.children.add(this.itemsView);this.focusables=this.createCollection();this._focusCycler=new iw({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",i.to("class"),i.if("isCompact","ck-toolbar_compact")],role:"toolbar","aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")}},children:this.children,on:{mousedown:cw(this)}});this._behavior=this.options.shouldGroupWhenFull?new Kw(this):new Gw(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(){this._behavior.destroy();return super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t){this.items.addMany(e.map(e=>{if(e=="|"){return new ow}else if(t.has(e)){return t.create(e)}else{console.warn(Object(ss["a"])("toolbarview-item-unavailable: The requested toolbar item is unavailable."),{name:e})}}).filter(e=>e!==undefined))}}class Yw extends jb{constructor(e){super(e);this.children=this.createCollection();this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Gw{constructor(e){const t=e.bindTemplate;e.set("isVertical",false);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 Kw{constructor(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=false;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 i=t.index;for(const e of t.removed){if(i>=this.ungroupedItems.length){this.groupedItems.remove(e)}else{this.ungroupedItems.remove(e)}}for(let e=i;ethis.ungroupedItems.length){this.groupedItems.add(n,e-this.ungroupedItems.length)}else{this.ungroupedItems.add(n,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){this.shouldUpdateGroupingOnNextResize=true;return}let e;while(this._areItemsOverflowing){this._groupLastItem();e=true}if(!e&&this.groupedItems.length){while(this.groupedItems.length&&!this._areItemsOverflowing){this._ungroupFirstItem()}if(this._areItemsOverflowing){this._groupLastItem()}}}get _areItemsOverflowing(){if(!this.ungroupedItems.length){return false}const e=this.viewElement;const t=this.viewLocale.uiLanguageDirection;const i=new Ch(e.lastChild);const n=new Ch(e);if(!this.cachedPadding){const i=Dd.window.getComputedStyle(e);const n=t==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(i[n])}if(t==="ltr"){return i.right>n.right-this.cachedPadding}else{return i.left{if(!e||e!==t.contentRect.width||this.shouldUpdateGroupingOnNextResize){this.shouldUpdateGroupingOnNextResize=false;this._updateGrouping();e=t.contentRect.width}});this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){if(!this.groupedItems.length){this.viewChildren.add(new ow);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));if(!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;const t=e.t;const i=Dw(e);i.class="ck-toolbar__grouped-dropdown";i.panelPosition=e.uiLanguageDirection==="ltr"?"sw":"se";Vw(i,[]);i.buttonView.set({label:t("Show more items"),tooltip:true,icon:Ww});i.toolbarView.items.bindTo(this.groupedItems).using(e=>e);return i}_updateFocusCycleableItems(){this.viewFocusables.clear();this.ungroupedItems.map(e=>{this.viewFocusables.add(e)});if(this.groupedItems.length){this.viewFocusables.add(this.groupedItemsDropdown)}}}var Qw=i(41);class Jw extends Kb{constructor(e,t,i={}){super(e);this.stickyPanel=new tw(e);this.toolbar=new $w(e,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull});this.editable=new Jb(e,t)}render(){super.render();this.stickyPanel.content.add(this.toolbar);this.top.add(this.stickyPanel);this.main.add(this.editable)}}function Zw(e){if(e instanceof HTMLTextAreaElement){return e.value}return e.innerHTML}class Xw extends Lp{constructor(e,t){super(t);if(Gr(e)){this.sourceElement=e}this.data.processor=new Wp(this.data.viewDocument);this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull");const n=new Jw(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i});this.ui=new cb(this,n);Hp(this)}destroy(){if(this.sourceElement){this.updateSourceElement()}this.ui.destroy();return super.destroy()}static create(e,t={}){return new Promise(i=>{const n=new this(e,t);i(n.initPlugins().then(()=>n.ui.init(Gr(e)?e:null)).then(()=>{if(!Gr(e)&&t.initialData){throw new ss["b"]("editor-create-initial-data: "+"The config.initialData option cannot be used together with initial data passed in Editor.create().",null)}const i=t.initialData||ek(e);return n.data.init(i)}).then(()=>n.fire("ready")).then(()=>n))})}}ys(Xw,Vp);ys(Xw,Fp);function ek(e){return Gr(e)?Zw(e):e}class tk{constructor(e){this.editor=e;this.set("isEnabled",true);this._disableStack=new Set}forceDisabled(e){this._disableStack.add(e);if(this._disableStack.size==1){this.on("set:isEnabled",ik,{priority:"highest"});this.isEnabled=false}}clearForceDisabled(e){this._disableStack.delete(e);if(this._disableStack.size==0){this.off("set:isEnabled",ik);this.isEnabled=true}}destroy(){this.stopListening()}static get isContextPlugin(){return false}}ys(tk,Qc);function ik(e){e.return=false;e.stop()}class nk{constructor(e){this.editor=e;this.set("value",undefined);this.set("isEnabled",false);this._disableStack=new Set;this.decorate("execute");this.listenTo(this.editor.model.document,"change",()=>{this.refresh()});this.on("execute",e=>{if(!this.isEnabled){e.stop()}},{priority:"high"});this.listenTo(e,"change:isReadOnly",(e,t,i)=>{if(i){this.forceDisabled("readOnlyMode")}else{this.clearForceDisabled("readOnlyMode")}})}refresh(){this.isEnabled=true}forceDisabled(e){this._disableStack.add(e);if(this._disableStack.size==1){this.on("set:isEnabled",ok,{priority:"highest"});this.isEnabled=false}}clearForceDisabled(e){this._disableStack.delete(e);if(this._disableStack.size==0){this.off("set:isEnabled",ok);this.refresh()}}execute(){}destroy(){this.stopListening()}}ys(nk,Qc);function ok(e){e.return=false;e.stop()}function rk(e){const t=e.next();if(t.done){return null}return t.value}const sk=["left","right","center","justify"];function ak(e){return sk.includes(e)}function ck(e,t){if(t.contentLanguageDirection=="rtl"){return e==="right"}else{return e==="left"}}const lk="alignment";class dk extends nk{refresh(){const e=this.editor;const t=e.locale;const i=rk(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!i&&this._canBeAligned(i);if(this.isEnabled&&i.hasAttribute("alignment")){this.value=i.getAttribute("alignment")}else{this.value=t.contentLanguageDirection==="rtl"?"right":"left"}}execute(e={}){const t=this.editor;const i=t.locale;const n=t.model;const o=n.document;const r=e.value;n.change(e=>{const t=Array.from(o.selection.getSelectedBlocks()).filter(e=>this._canBeAligned(e));const n=t[0].getAttribute("alignment");const s=ck(r,i)||n===r||!r;if(s){uk(t,e)}else{hk(t,e,r)}})}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,lk)}}function uk(e,t){for(const i of e){t.removeAttribute(lk,i)}}function hk(e,t,i){for(const n of e){t.setAttribute(lk,i,n)}}class fk extends tk{static get pluginName(){return"AlignmentEditing"}constructor(e){super(e);e.config.define("alignment",{options:[...sk]})}init(){const e=this.editor;const t=e.locale;const i=e.model.schema;const n=e.config.get("alignment.options").filter(ak);i.extend("$block",{allowAttributes:"alignment"});e.model.schema.setAttributeProperties("alignment",{isFormatting:true});const o=mk(n.filter(e=>!ck(e,t)));e.conversion.attributeToAttribute(o);e.commands.add("alignment",new dk(e))}}function mk(e){const t={model:{key:"alignment",values:e.slice()},view:{}};for(const i of e){t.view[i]={key:"style",value:{"text-align":i}}}return t}var gk='';var pk='';var bk='';var wk='';const kk=new Map([["left",gk],["right",pk],["center",bk],["justify",wk]]);class _k extends tk{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;const t=e.ui.componentFactory;const i=e.t;const n=e.config.get("alignment.options");n.filter(ak).forEach(e=>this._addButton(e));t.add("alignment",e=>{const o=Dw(e);const r=n.map(e=>t.create(`alignment:${e}`));Vw(o,r);o.buttonView.set({label:i("Text alignment"),tooltip:true});o.toolbarView.isVertical=true;o.toolbarView.ariaLabel=i("Text alignment toolbar");o.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const s=e.contentLanguageDirection==="rtl"?pk:gk;o.buttonView.bind("icon").toMany(r,"isOn",(...e)=>{const t=e.findIndex(e=>e);if(t<0){return s}return r[t].icon});o.bind("isEnabled").toMany(r,"isEnabled",(...e)=>e.some(e=>e));return o})}_addButton(e){const t=this.editor;t.ui.componentFactory.add(`alignment:${e}`,i=>{const n=t.commands.get("alignment");const o=new Tw(i);o.set({label:this.localizedOptionTitles[e],icon:kk.get(e),tooltip:true,isToggleable:true});o.bind("isEnabled").to(n);o.bind("isOn").to(n,"value",t=>t===e);this.listenTo(o,"execute",()=>{t.execute("alignment",{value:e});t.editing.view.focus()});return o})}}class vk extends tk{static get requires(){return[fk,_k]}static get pluginName(){return"Alignment"}}function yk(e,t){let i=e.start;const n=Array.from(e.getItems()).reduce((e,n)=>{if(!(n.is("$text")||n.is("$textProxy"))){i=t.createPositionAfter(n);return""}return e+n.data},"");return{text:n,range:t.createRange(i,e.end)}}class xk{constructor(e,t){this.model=e;this.testCallback=t;this.hasMatch=false;this.set("isEnabled",true);this.on("change:isEnabled",()=>{if(this.isEnabled){this._startListening()}else{this.stopListening(e.document.selection);this.stopListening(e.document)}});this._startListening()}_startListening(){const e=this.model;const t=e.document;this.listenTo(t.selection,"change:range",(e,{directChange:i})=>{if(!i){return}if(!t.selection.isCollapsed){if(this.hasMatch){this.fire("unmatched");this.hasMatch=false}return}this._evaluateTextBeforeSelection("selection")});this.listenTo(t,"change:data",(e,t)=>{if(t.type=="transparent"){return}this._evaluateTextBeforeSelection("data",{batch:t})})}_evaluateTextBeforeSelection(e,t={}){const i=this.model;const n=i.document;const o=n.selection;const r=i.createRange(i.createPositionAt(o.focus.parent,0),o.focus);const{text:s,range:a}=yk(r,i);const c=this.testCallback(s);if(!c&&this.hasMatch){this.fire("unmatched")}this.hasMatch=!!c;if(c){const i=Object.assign(t,{text:s,range:a});if(typeof c=="object"){Object.assign(i,c)}this.fire(`matched:${e}`,i)}}}ys(xk,Qc);const Ak=4;const Tk=new RegExp("(^|\\s)"+"("+"("+"(?:(?:(?:https?|ftp):)?\\/\\/)"+"(?:\\S+(?::\\S*)?@)?"+"(?:"+"(?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.)+"+"(?:[a-z\\u00a1-\\uffff]{2,})"+")"+"(?::\\d{2,5})?"+"(?:[/?#]\\S*)?"+")"+"|"+"("+"(www.|(\\S+@))"+"((?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.))+"+"(?:[a-z\\u00a1-\\uffff]{2,})"+")"+")$","i");const Ck=2;const Pk=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i;class Ek extends tk{static get pluginName(){return"AutoLink"}init(){const e=this.editor;const t=e.model.document.selection;t.on("change:range",()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")});this._enableTypingHandling()}afterInit(){this._enableEnterHandling();this._enableShiftEnterHandling()}_enableTypingHandling(){const e=this.editor;const t=new xk(e.model,e=>{if(!Sk(e)){return}const t=Mk(e.substr(0,e.length-1));if(t){return{url:t}}});const i=e.plugins.get("Input");t.on("matched:data",(t,n)=>{const{batch:o,range:r,url:s}=n;if(!i.isInput(o)){return}const a=r.end.getShiftedBy(-1);const c=a.getShiftedBy(-s.length);const l=e.model.createRange(c,a);this._applyAutoLink(s,l)});t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor;const t=e.model;const i=e.commands.get("enter");if(!i){return}i.on("execute",()=>{const e=t.document.selection.getFirstPosition();const i=t.createRange(t.createPositionAt(e.parent.previousSibling,0),t.createPositionAt(e.parent.previousSibling,"end"));this._checkAndApplyAutoLinkOnRange(i)})}_enableShiftEnterHandling(){const e=this.editor;const t=e.model;const i=e.commands.get("shiftEnter");if(!i){return}i.on("execute",()=>{const e=t.document.selection.getFirstPosition();const i=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(i)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model;const{text:i,range:n}=yk(e,t);const o=Mk(i);if(o){const e=t.createRange(n.end.getShiftedBy(-o.length),n.end);this._applyAutoLink(o,e)}}_applyAutoLink(e,t){const i=this.editor.model;if(!this.isEnabled||!Nk(t,i)){return}i.enqueueChange(i=>{const n=Ik(e)?`mailto:${e}`:e;i.setAttribute("linkHref",n,t)})}}function Sk(e){return e.length>Ak&&e[e.length-1]===" "&&e[e.length-2]!==" "}function Mk(e){const t=Tk.exec(e);return t?t[Ck]:null}function Ik(e){return Pk.exec(e)}function Nk(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}class Ok extends nk{refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model;const i=t.schema;const n=t.document.selection;const o=Array.from(n.getSelectedBlocks());const r=e.forceValue===undefined?!this.value:e.forceValue;t.change(e=>{if(!r){this._removeQuote(e,o.filter(zk))}else{const t=o.filter(e=>zk(e)||Lk(i,e));this._applyQuote(e,t)}})}_getValue(){const e=this.editor.model.document.selection;const t=rk(e.getSelectedBlocks());return!!(t&&zk(t))}_checkEnabled(){if(this.value){return true}const e=this.editor.model.document.selection;const t=this.editor.model.schema;const i=rk(e.getSelectedBlocks());if(!i){return false}return Lk(t,i)}_removeQuote(e,t){Rk(e,t).reverse().forEach(t=>{if(t.start.isAtStart&&t.end.isAtEnd){e.unwrap(t.start.parent);return}if(t.start.isAtStart){const i=e.createPositionBefore(t.start.parent);e.move(t,i);return}if(!t.end.isAtEnd){e.split(t.end)}const i=e.createPositionAfter(t.end.parent);e.move(t,i)})}_applyQuote(e,t){const i=[];Rk(e,t).reverse().forEach(t=>{let n=zk(t.start);if(!n){n=e.createElement("blockQuote");e.wrap(t,n)}i.push(n)});i.reverse().reduce((t,i)=>{if(t.nextSibling==i){e.merge(e.createPositionAfter(t));return t}return i})}}function zk(e){return e.parent.name=="blockQuote"?e.parent:null}function Rk(e,t){let i;let n=0;const o=[];while(n{if(e.endsWith("blockQuote")&&t.name=="blockQuote"){return false}});e.conversion.elementToElement({model:"blockQuote",view:"blockquote"});e.model.document.registerPostFixer(i=>{const n=e.model.document.differ.getChanges();for(const e of n){if(e.type=="insert"){const n=e.position.nodeAfter;if(!n){continue}if(n.is("element","blockQuote")&&n.isEmpty){i.remove(n);return true}else if(n.is("element","blockQuote")&&!t.checkChild(e.position,n)){i.unwrap(n);return true}else if(n.is("element")){const e=i.createRangeIn(n);for(const n of e.getItems()){if(n.is("element","blockQuote")&&!t.checkChild(i.createPositionBefore(n),n)){i.unwrap(n);return true}}}}else if(e.type=="remove"){const t=e.position.parent;if(t.is("element","blockQuote")&&t.isEmpty){i.remove(t);return true}}}return false})}afterInit(){const e=this.editor;const t=e.commands.get("blockQuote");this.listenTo(this.editor.editing.view.document,"enter",(e,i)=>{const n=this.editor.model.document;const o=n.selection.getLastPosition().parent;if(n.selection.isCollapsed&&o.isEmpty&&t.value){this.editor.execute("blockQuote");this.editor.editing.view.scrollToTheSelection();i.preventDefault();e.stop()}})}}var Vk='';var jk=i(43);class Bk extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add("blockQuote",i=>{const n=e.commands.get("blockQuote");const o=new Tw(i);o.set({label:t("Block quote"),icon:Vk,tooltip:true,isToggleable:true});o.bind("isOn","isEnabled").to(n,"value","isEnabled");this.listenTo(o,"execute",()=>{e.execute("blockQuote");e.editing.view.focus()});return o})}}class Fk extends tk{static get requires(){return[Dk,Bk]}static get pluginName(){return"BlockQuote"}}class Hk extends nk{constructor(e,t){super(e);this.attributeKey=t}refresh(){const e=this.editor.model;const t=e.document;this.value=this._getValueFromFirstAllowedNode();this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model;const i=t.document;const n=i.selection;const o=e.forceValue===undefined?!this.value:e.forceValue;t.change(e=>{if(n.isCollapsed){if(o){e.setSelectionAttribute(this.attributeKey,true)}else{e.removeSelectionAttribute(this.attributeKey)}}else{const i=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of i){if(o){e.setAttribute(this.attributeKey,o,t)}else{e.removeAttribute(this.attributeKey,t)}}}})}_getValueFromFirstAllowedNode(){const e=this.editor.model;const t=e.schema;const i=e.document.selection;if(i.isCollapsed){return i.hasAttribute(this.attributeKey)}for(const e of i.getRanges()){for(const i of e.getItems()){if(t.checkAttribute(i,this.attributeKey)){return i.hasAttribute(this.attributeKey)}}}return false}}const Uk="bold";class Wk extends tk{static get pluginName(){return"BoldEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Uk});e.model.schema.setAttributeProperties(Uk,{isFormatting:true,copyOnEnter:true});e.conversion.attributeToElement({model:Uk,view:"strong",upcastAlso:["b",e=>{const t=e.getStyle("font-weight");if(!t){return null}if(t=="bold"||Number(t)>=600){return{name:true,styles:["font-weight"]}}}]});e.commands.add(Uk,new Hk(e,Uk));e.keystrokes.set("CTRL+B",Uk)}}var qk='';const $k="bold";class Yk extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add($k,i=>{const n=e.commands.get($k);const o=new Tw(i);o.set({label:t("Bold"),icon:qk,keystroke:"CTRL+B",tooltip:true,isToggleable:true});o.bind("isOn","isEnabled").to(n,"value","isEnabled");this.listenTo(o,"execute",()=>{e.execute($k);e.editing.view.focus()});return o})}}class Gk extends tk{static get requires(){return[Wk,Yk]}static get pluginName(){return"Bold"}}class Kk{constructor(e){this.files=Qk(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)}}function Qk(e){const t=e.files?Array.from(e.files):[];const i=e.items?Array.from(e.items):[];if(t.length){return t}return i.filter(e=>e.kind==="file").map(e=>e.getAsFile())}class Jk extends eh{constructor(e){super(e);const t=this.document;this.domEventType=["paste","copy","cut","drop","dragover"];this.listenTo(t,"paste",i,{priority:"low"});this.listenTo(t,"drop",i,{priority:"low"});function i(e,i){i.preventDefault();const n=i.dropRange?[i.dropRange]:Array.from(t.selection.getRanges());const o=new es(t,"clipboardInput");t.fire(o,{dataTransfer:i.dataTransfer,targetRanges:n});if(o.stop.called){i.stopPropagation()}}}onDomEvent(e){const t={dataTransfer:new Kk(e.clipboardData?e.clipboardData:e.dataTransfer)};if(e.type=="drop"){t.dropRange=Zk(this.view,e)}this.fire(e.type,e,t)}}function Zk(e,t){const i=t.target.ownerDocument;const n=t.clientX;const o=t.clientY;let r;if(i.caretRangeFromPoint&&i.caretRangeFromPoint(n,o)){r=i.caretRangeFromPoint(n,o)}else if(t.rangeParent){r=i.createRange();r.setStart(t.rangeParent,t.rangeOffset);r.collapse(true)}if(r){return e.domConverter.domRangeToView(r)}else{return e.document.selection.getFirstRange()}}function Xk(e){e=e.replace(//g,">").replace(/\n/g,"

").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ");if(e.indexOf("

")>-1){e=`

${e}

`}return e}function e_(e){return e.replace(/(\s+)<\/span>/g,(e,t)=>{if(t.length==1){return" "}return t})}const t_=["figcaption","li"];function i_(e){let t="";if(e.is("$text")||e.is("$textProxy")){t=e.data}else if(e.is("element","img")&&e.hasAttribute("alt")){t=e.getAttribute("alt")}else{let i=null;for(const n of e.getChildren()){const e=i_(n);if(i&&(i.is("containerElement")||n.is("containerElement"))){if(t_.includes(i.name)||t_.includes(n.name)){t+="\n"}else{t+="\n\n"}}t+=e;i=n}}return t}class n_ extends tk{static get pluginName(){return"Clipboard"}init(){const e=this.editor;const t=e.model.document;const i=e.editing.view;const n=i.document;this._htmlDataProcessor=new Wp(n);i.addObserver(Jk);this.listenTo(n,"clipboardInput",t=>{if(e.isReadOnly){t.stop()}},{priority:"highest"});this.listenTo(n,"clipboardInput",(e,t)=>{const n=t.dataTransfer;let o="";if(n.getData("text/html")){o=e_(n.getData("text/html"))}else if(n.getData("text/plain")){o=Xk(n.getData("text/plain"))}o=this._htmlDataProcessor.toView(o);const r=new es(this,"inputTransformation");this.fire(r,{content:o,dataTransfer:n});if(r.stop.called){e.stop()}i.scrollToTheSelection()},{priority:"low"});this.listenTo(this,"inputTransformation",(e,t)=>{if(!t.content.isEmpty){const i=this.editor.data;const n=this.editor.model;const o=i.toModel(t.content,"$clipboardHolder");if(o.childCount==0){return}n.insertContent(o);e.stop()}},{priority:"low"});function o(i,o){const r=o.dataTransfer;o.preventDefault();const s=e.data.toView(e.model.getSelectedContent(t.selection));n.fire("clipboardOutput",{dataTransfer:r,content:s,method:i.name})}this.listenTo(n,"copy",o,{priority:"low"});this.listenTo(n,"cut",(t,i)=>{if(e.isReadOnly){i.preventDefault()}else{o(t,i)}},{priority:"low"});this.listenTo(n,"clipboardOutput",(i,n)=>{if(!n.content.isEmpty){n.dataTransfer.setData("text/html",this._htmlDataProcessor.toData(n.content));n.dataTransfer.setData("text/plain",i_(n.content))}if(n.method=="cut"){e.model.deleteContent(t.selection)}},{priority:"low"})}}function*o_(e,t){for(const i of t){if(i&&e.getAttributeProperties(i[0]).copyOnEnter){yield i}}}class r_ extends nk{execute(){const e=this.editor.model;const t=e.document;e.change(i=>{s_(this.editor.model,i,t.selection,e.schema);this.fire("afterExecute",{writer:i})})}}function s_(e,t,i,n){const o=i.isCollapsed;const r=i.getFirstRange();const s=r.start.parent;const a=r.end.parent;if(n.isLimit(s)||n.isLimit(a)){if(!o&&s==a){e.deleteContent(i)}return}if(o){const e=o_(t.model.schema,i.getAttributes());a_(t,r.start);t.setSelectionAttribute(e)}else{const n=!(r.start.isAtStart&&r.end.isAtEnd);const o=s==a;e.deleteContent(i,{leaveUnmerged:n});if(n){if(o){a_(t,i.focus)}else{t.setSelection(a,0)}}}}function a_(e,t){e.split(t);e.setSelection(t.parent.nextSibling,0)}class c_ extends Zd{constructor(e){super(e);const t=this.document;t.on("keydown",(e,i)=>{if(this.isEnabled&&i.keyCode==zl.enter){let n;t.once("enter",e=>n=e,{priority:"highest"});t.fire("enter",new Xu(t,i.domEvent,{isSoft:i.shiftKey}));if(n&&n.stop.called){e.stop()}}})}observe(){}}class l_ extends tk{static get pluginName(){return"Enter"}init(){const e=this.editor;const t=e.editing.view;const i=t.document;t.addObserver(c_);e.commands.add("enter",new r_(e));this.listenTo(i,"enter",(i,n)=>{n.preventDefault();if(n.isSoft){return}e.execute("enter");t.scrollToTheSelection()},{priority:"low"})}}class d_ extends nk{execute(){const e=this.editor.model;const t=e.document;e.change(i=>{h_(e,i,t.selection);this.fire("afterExecute",{writer:i})})}refresh(){const e=this.editor.model;const t=e.document;this.isEnabled=u_(e.schema,t.selection)}}function u_(e,t){if(t.rangeCount>1){return false}const i=t.anchor;if(!i||!e.checkChild(i,"softBreak")){return false}const n=t.getFirstRange();const o=n.start.parent;const r=n.end.parent;if((m_(o,e)||m_(r,e))&&o!==r){return false}return true}function h_(e,t,i){const n=i.isCollapsed;const o=i.getFirstRange();const r=o.start.parent;const s=o.end.parent;const a=r==s;if(n){const n=o_(e.schema,i.getAttributes());f_(e,t,o.end);t.removeSelectionAttribute(i.getAttributeKeys());t.setSelectionAttribute(n)}else{const n=!(o.start.isAtStart&&o.end.isAtEnd);e.deleteContent(i,{leaveUnmerged:n});if(a){f_(e,t,i.focus)}else{if(n){t.setSelection(s,0)}}}}function f_(e,t,i){const n=t.createElement("softBreak");e.insertContent(n,i);t.setSelection(n,"after")}function m_(e,t){if(e.is("rootElement")){return false}return t.isLimit(e)||m_(e.parent,t)}class g_ extends tk{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor;const t=e.model.schema;const i=e.conversion;const n=e.editing.view;const o=n.document;t.register("softBreak",{allowWhere:"$text",isInline:true});i.for("upcast").elementToElement({model:"softBreak",view:"br"});i.for("downcast").elementToElement({model:"softBreak",view:(e,t)=>t.createEmptyElement("br")});n.addObserver(c_);e.commands.add("shiftEnter",new d_(e));this.listenTo(o,"enter",(t,i)=>{i.preventDefault();if(!i.isSoft){return}e.execute("shiftEnter");n.scrollToTheSelection()},{priority:"low"})}}class p_ extends nk{execute(){const e=this.editor.model;const t=e.document.selection;let i=e.schema.getLimitElement(t);if(t.containsEntireContent(i)||!b_(e.schema,i)){do{i=i.parent;if(!i){return}}while(!b_(e.schema,i))}e.change(e=>{e.setSelection(i,"in")})}}function b_(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const w_=Ll("Ctrl+A");class k_ extends tk{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor;const t=e.editing.view;const i=t.document;e.commands.add("selectAll",new p_(e));this.listenTo(i,"keydown",(t,i)=>{if(Rl(i)===w_){e.execute("selectAll");i.preventDefault()}})}}var __='';class v_ extends tk{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",t=>{const i=e.commands.get("selectAll");const n=new Tw(t);const o=t.t;n.set({label:o("Select all"),icon:__,keystroke:"Ctrl+A",tooltip:true});n.bind("isOn","isEnabled").to(i,"value","isEnabled");this.listenTo(n,"execute",()=>{e.execute("selectAll");e.editing.view.focus()});return n})}}class y_ extends tk{static get requires(){return[k_,v_]}static get pluginName(){return"SelectAll"}}class x_{constructor(e,t=20){this.model=e;this.size=0;this.limit=t;this.isLocked=false;this._changeCallback=(e,t)=>{if(t.type!="transparent"&&t!==this._batch){this._reset(true)}};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(){if(!this._batch){this._batch=this.model.createBatch()}return this._batch}input(e){this.size+=e;if(this.size>=this.limit){this._reset(true)}}lock(){this.isLocked=true}unlock(){this.isLocked=false}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){if(!this.isLocked||e){this._batch=null;this.size=0}}}class A_ extends nk{constructor(e,t){super(e);this._buffer=new x_(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;const i=t.document;const n=e.text||"";const o=n.length;const r=e.range?t.createSelection(e.range):i.selection;const s=e.resultRange;t.enqueueChange(this._buffer.batch,e=>{this._buffer.lock();this._batches.add(this._buffer.batch);t.deleteContent(r);if(n){t.insertContent(e.createText(n,i.selection.getAttributes()),r)}if(s){e.setSelection(s)}else if(!r.is("documentSelection")){e.setSelection(r)}this._buffer.unlock();this._buffer.input(o)})}}function T_(e){let t=null;const i=e.model;const n=e.editing.view;const o=e.commands.get("input");if(Cl.isAndroid){n.document.on("beforeinput",(e,t)=>r(t),{priority:"lowest"})}else{n.document.on("keydown",(e,t)=>r(t),{priority:"lowest"})}n.document.on("compositionstart",s,{priority:"lowest"});n.document.on("compositionend",()=>{t=i.createSelection(i.document.selection)},{priority:"lowest"});function r(e){const r=i.document;const s=n.document.isComposing;const c=t&&t.isEqual(r.selection);t=null;if(!o.isEnabled){return}if(P_(e)||r.selection.isCollapsed){return}if(s&&e.keyCode===229){return}if(!s&&e.keyCode===229&&c){return}a()}function s(){const e=i.document;const t=e.selection.rangeCount===1?e.selection.getFirstRange().isFlat:true;if(e.selection.isCollapsed||t){return}a()}function a(){const e=o.buffer;e.lock();const t=e.batch;o._batches.add(t);i.enqueueChange(t,()=>{i.deleteContent(i.document.selection)});e.unlock()}}const C_=[Rl("arrowUp"),Rl("arrowRight"),Rl("arrowDown"),Rl("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++){C_.push(e)}function P_(e){if(e.ctrlKey){return true}return C_.includes(e.keyCode)}function E_(e,t){const i=[];let n=0;let o;e.forEach(e=>{if(e=="equal"){r();n++}else if(e=="insert"){if(s("insert")){o.values.push(t[n])}else{r();o={type:"insert",index:n,values:[t[n]]}}n++}else{if(s("delete")){o.howMany++}else{r();o={type:"delete",index:n,howMany:1}}}});r();return i;function r(){if(o){i.push(o);o=null}}function s(e){return o&&o.type==e}}function S_(e){if(e.length==0){return false}for(const t of e){if(t.type==="children"&&!M_(t)){return true}}return false}function M_(e){if(e.newChildren.length-e.oldChildren.length!=1){return}const t=Td(e.oldChildren,e.newChildren,I_);const i=E_(t,e.newChildren);if(i.length>1){return}const n=i[0];if(!(!!n.values[0]&&n.values[0].is("$text"))){return}return n}function I_(e,t){if(!!e&&e.is("$text")&&!!t&&t.is("$text")){return e.data===t.data}else{return e===t}}function N_(e){e.editing.view.document.on("mutations",(t,i,n)=>{new O_(e).handle(i,n)})}class O_{constructor(e){this.editor=e;this.editing=this.editor.editing}handle(e,t){if(S_(e)){this._handleContainerChildrenMutations(e,t)}else{for(const i of e){this._handleTextMutation(i,t);this._handleTextNodeInsertion(i)}}}_handleContainerChildrenMutations(e,t){const i=z_(e);if(!i){return}const n=this.editor.editing.view.domConverter;const o=n.mapViewToDom(i);const r=new Hd(this.editor.editing.view.document);const s=this.editor.data.toModel(r.domToView(o)).getChild(0);const a=this.editor.editing.mapper.toModelElement(i);if(!a){return}const c=Array.from(s.getChildren());const l=Array.from(a.getChildren());const d=c[c.length-1];const u=l[l.length-1];const h=d&&d.is("element","softBreak");const f=u&&!u.is("element","softBreak");if(h&&f){c.pop()}const m=this.editor.model.schema;if(!R_(c,m)||!R_(l,m)){return}const g=c.map(e=>e.is("$text")?e.data:"@").join("").replace(/\u00A0/g," ");const p=l.map(e=>e.is("$text")?e.data:"@").join("").replace(/\u00A0/g," ");if(p===g){return}const b=Td(p,g);const{firstChangeAt:w,insertions:k,deletions:_}=L_(b);let v=null;if(t){v=this.editing.mapper.toModelRange(t.getFirstRange())}const y=g.substr(w,k);const x=this.editor.model.createRange(this.editor.model.createPositionAt(a,w),this.editor.model.createPositionAt(a,w+_));this.editor.execute("input",{text:y,range:x,resultRange:v})}_handleTextMutation(e,t){if(e.type!="text"){return}const i=e.newText.replace(/\u00A0/g," ");const n=e.oldText.replace(/\u00A0/g," ");if(n===i){return}const o=Td(n,i);const{firstChangeAt:r,insertions:s,deletions:a}=L_(o);let c=null;if(t){c=this.editing.mapper.toModelRange(t.getFirstRange())}const l=this.editing.view.createPositionAt(e.node,r);const d=this.editing.mapper.toModelPosition(l);const u=this.editor.model.createRange(d,d.getShiftedBy(a));const h=i.substr(r,s);this.editor.execute("input",{text:h,range:u,resultRange:c})}_handleTextNodeInsertion(e){if(e.type!="children"){return}const t=M_(e);const i=this.editing.view.createPositionAt(e.node,t.index);const n=this.editing.mapper.toModelPosition(i);const o=t.values[0].data;this.editor.execute("input",{text:o.replace(/\u00A0/g," "),range:this.editor.model.createRange(n)})}}function z_(e){const t=e.map(e=>e.node).reduce((e,t)=>e.getCommonAncestor(t,{includeSelf:true}));if(!t){return}return t.getAncestors({includeSelf:true,parentFirst:true}).find(e=>e.is("containerElement")||e.is("rootElement"))}function R_(e,t){return e.every(e=>t.isInline(e))}function L_(e){let t=null;let i=null;for(let n=0;n{this._buffer.lock();const o=n.createSelection(e.selection||i.selection);const r=o.isCollapsed;if(o.isCollapsed){t.modifySelection(o,{direction:this.direction,unit:e.unit})}if(this._shouldEntireContentBeReplacedWithParagraph(e.sequence||1)){this._replaceEntireContentWithParagraph(n);return}if(o.isCollapsed){return}let s=0;o.getFirstRange().getMinimalFlatRanges().forEach(e=>{s+=ml(e.getWalker({singleCharacters:true,ignoreElementEnd:true,shallow:true}))});t.deleteContent(o,{doNotResetEntireContent:r,direction:this.direction});this._buffer.input(s);n.setSelection(o);this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1){return false}const t=this.editor.model;const i=t.document;const n=i.selection;const o=t.schema.getLimitElement(n);const r=n.isCollapsed&&n.containsEntireContent(o);if(!r){return false}if(!t.schema.checkChild(o,"paragraph")){return false}const s=o.getChild(0);if(s&&s.name==="paragraph"){return false}return true}_replaceEntireContentWithParagraph(e){const t=this.editor.model;const i=t.document;const n=i.selection;const o=t.schema.getLimitElement(n);const r=e.createElement("paragraph");e.remove(e.createRangeIn(o));e.insert(r,o);e.setSelection(r,0)}}class j_ extends Zd{constructor(e){super(e);const t=e.document;let i=0;t.on("keyup",(e,t)=>{if(t.keyCode==zl.delete||t.keyCode==zl.backspace){i=0}});t.on("keydown",(e,t)=>{const o={};if(t.keyCode==zl.delete){o.direction="forward";o.unit="character"}else if(t.keyCode==zl.backspace){o.direction="backward";o.unit="codePoint"}else{return}const r=Cl.isMac?t.altKey:t.ctrlKey;o.unit=r?"word":o.unit;o.sequence=++i;n(e,t.domEvent,o)});if(Cl.isAndroid){t.on("beforeinput",(t,i)=>{if(i.domEvent.inputType!="deleteContentBackward"){return}const o={unit:"codepoint",direction:"backward",sequence:1};const r=i.domTarget.ownerDocument.defaultView.getSelection();if(r.anchorNode==r.focusNode&&r.anchorOffset+1!=r.focusOffset){o.selectionToRemove=e.domConverter.domSelectionToView(r)}n(t,i.domEvent,o)})}function n(e,i,n){let o;t.once("delete",e=>o=e,{priority:Number.POSITIVE_INFINITY});t.fire("delete",new Xu(t,i,n));if(o&&o.stop.called){e.stop()}}}observe(){}}class B_ extends tk{static get pluginName(){return"Delete"}init(){const e=this.editor;const t=e.editing.view;const i=t.document;t.addObserver(j_);e.commands.add("forwardDelete",new V_(e,"forward"));e.commands.add("delete",new V_(e,"backward"));this.listenTo(i,"delete",(i,n)=>{const o={unit:n.unit,sequence:n.sequence};if(n.selectionToRemove){const t=e.model.createSelection();const i=[];for(const t of n.selectionToRemove.getRanges()){i.push(e.editing.mapper.toModelRange(t))}t.setTo(i);o.selection=t}e.execute(n.direction=="forward"?"forwardDelete":"delete",o);n.preventDefault();t.scrollToTheSelection()});if(Cl.isAndroid){let e=null;this.listenTo(i,"delete",(t,i)=>{const n=i.domTarget.ownerDocument.defaultView.getSelection();e={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}},{priority:"lowest"});this.listenTo(i,"keyup",(t,i)=>{if(e){const t=i.domTarget.ownerDocument.defaultView.getSelection();t.collapse(e.anchorNode,e.anchorOffset);t.extend(e.focusNode,e.focusOffset);e=null}})}}}class F_ extends tk{static get requires(){return[D_,B_]}static get pluginName(){return"Typing"}}const H_=new Map;function U_(e,t,i){let n=H_.get(e);if(!n){n=new Map;H_.set(e,n)}n.set(t,i)}function W_(e,t){const i=H_.get(e);if(i&&i.has(t)){return i.get(t)}return q_}function q_(e){return[e]}function $_(e,t,i={}){const n=W_(e.constructor,t.constructor);try{e=e.clone();return n(e,t,i)}catch(e){throw e}}function Y_(e,t,i){e=e.slice();t=t.slice();const n=new G_(i.document,i.useRelations,i.forceWeakRemove);n.setOriginalOperations(e);n.setOriginalOperations(t);const o=n.originalOperations;if(e.length==0||t.length==0){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;while(a{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){const n=e.range.getDifference(t.range).map(t=>new mg(t,e.key,e.oldValue,e.newValue,0));const o=e.range.getIntersection(t.range);if(o){if(i.aIsStrong){n.push(new mg(o,t.key,t.newValue,e.newValue,0))}}if(n.length==0){return[new qg(0)]}return n}else{return[e]}});U_(mg,bg,(e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const i=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes);const n=i.map(t=>new mg(t,e.key,e.oldValue,e.newValue,e.baseVersion));if(t.shouldReceiveAttributes){const i=J_(t,e.key,e.oldValue);if(i){n.unshift(i)}}return n}e.range=e.range._getTransformedByInsertion(t.position,t.howMany,false)[0];return[e]});function J_(e,t,i){const n=e.nodes;const o=n.getNode(0).getAttribute(t);if(o==i){return null}const r=new ef(e.position,e.position.getShiftedBy(e.howMany));return new mg(r,t,o,i,0)}U_(mg,vg,(e,t)=>{const i=[];if(e.range.start.hasSameParentAs(t.deletionPosition)){if(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition)){i.push(ef._createFromPositionAndShift(t.graveyardPosition,1))}}const n=e.range._getTransformedByMergeOperation(t);if(!n.isCollapsed){i.push(n)}return i.map(t=>new mg(t,e.key,e.oldValue,e.newValue,e.baseVersion))});U_(mg,pg,(e,t)=>{const i=Z_(e.range,t);return i.map(t=>new mg(t,e.key,e.oldValue,e.newValue,e.baseVersion))});function Z_(e,t){const i=ef._createFromPositionAndShift(t.sourcePosition,t.howMany);let n=null;let o=[];if(i.containsRange(e,true)){n=e}else if(e.start.hasSameParentAs(i.start)){o=e.getDifference(i);n=e.getIntersection(i)}else{o=[e]}const r=[];for(let e of o){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const i=t.getMovedRangeStart();const n=e.start.hasSameParentAs(i);e=e._getTransformedByInsertion(i,t.howMany,n);r.push(...e)}if(n){r.push(n._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,false)[0])}return r}U_(mg,yg,(e,t)=>{if(e.range.end.isEqual(t.insertionPosition)){if(!t.graveyardPosition){e.range.end.offset++}return[e]}if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const i=e.clone();i.range=new ef(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition));e.range.end=t.splitPosition.clone();e.range.end.stickiness="toPrevious";return[e,i]}e.range=e.range._getTransformedBySplitOperation(t);return[e]});U_(bg,mg,(e,t)=>{const i=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const n=J_(e,t.key,t.newValue);if(n){i.push(n)}}return i});U_(bg,bg,(e,t,i)=>{if(e.position.isEqual(t.position)&&i.aIsStrong){return[e]}e.position=e.position._getTransformedByInsertOperation(t);return[e]});U_(bg,pg,(e,t)=>{e.position=e.position._getTransformedByMoveOperation(t);return[e]});U_(bg,yg,(e,t)=>{e.position=e.position._getTransformedBySplitOperation(t);return[e]});U_(bg,vg,(e,t)=>{e.position=e.position._getTransformedByMergeOperation(t);return[e]});U_(wg,bg,(e,t)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]}if(e.newRange){e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]}return[e]});U_(wg,wg,(e,t,i)=>{if(e.name==t.name){if(i.aIsStrong){e.oldRange=t.newRange?t.newRange.clone():null}else{return[new qg(0)]}}return[e]});U_(wg,vg,(e,t)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedByMergeOperation(t)}if(e.newRange){e.newRange=e.newRange._getTransformedByMergeOperation(t)}return[e]});U_(wg,pg,(e,t,i)=>{if(e.oldRange){e.oldRange=ef._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))}if(e.newRange){if(i.abRelation){const n=ef._createFromRanges(e.newRange._getTransformedByMoveOperation(t));if(i.abRelation.side=="left"&&t.targetPosition.isEqual(e.newRange.start)){e.newRange.start.path=i.abRelation.path;e.newRange.end=n.end;return[e]}else if(i.abRelation.side=="right"&&t.targetPosition.isEqual(e.newRange.end)){e.newRange.start=n.start;e.newRange.end.path=i.abRelation.path;return[e]}}e.newRange=ef._createFromRanges(e.newRange._getTransformedByMoveOperation(t))}return[e]});U_(wg,yg,(e,t,i)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedBySplitOperation(t)}if(e.newRange){if(i.abRelation){const n=e.newRange._getTransformedBySplitOperation(t);if(e.newRange.start.isEqual(t.splitPosition)&&i.abRelation.wasStartBeforeMergedElement){e.newRange.start=Qh._createAt(t.insertionPosition)}else if(e.newRange.start.isEqual(t.splitPosition)&&!i.abRelation.wasInLeftElement){e.newRange.start=Qh._createAt(t.moveTargetPosition)}if(e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasInRightElement){e.newRange.end=Qh._createAt(t.moveTargetPosition)}else if(e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasEndBeforeMergedElement){e.newRange.end=Qh._createAt(t.insertionPosition)}else{e.newRange.end=n.end}return[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]});U_(vg,bg,(e,t)=>{if(e.sourcePosition.hasSameParentAs(t.position)){e.howMany+=t.howMany}e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t);e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t);return[e]});U_(vg,vg,(e,t,i)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(!i.bWasUndone){return[new qg(0)]}else{const i=t.graveyardPosition.path.slice();i.push(0);e.sourcePosition=new Qh(t.graveyardPosition.root,i);e.howMany=0;return[e]}}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!i.bWasUndone&&i.abRelation!="splitAtSource"){const n=e.targetPosition.root.rootName=="$graveyard";const o=t.targetPosition.root.rootName=="$graveyard";const r=n&&!o;const s=o&&!n;const a=s||!r&&i.aIsStrong;if(a){const i=t.targetPosition._getTransformedByMergeOperation(t);const n=e.targetPosition._getTransformedByMergeOperation(t);return[new pg(i,e.howMany,n,0)]}else{return[new qg(0)]}}if(e.sourcePosition.hasSameParentAs(t.targetPosition)){e.howMany+=t.howMany}e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t);e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);if(!e.graveyardPosition.isEqual(t.graveyardPosition)||!i.aIsStrong){e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)}return[e]});U_(vg,pg,(e,t,i)=>{const n=ef._createFromPositionAndShift(t.sourcePosition,t.howMany);if(t.type=="remove"&&!i.bWasUndone&&!i.forceWeakRemove){if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.sourcePosition)){return[new qg(0)]}}if(e.sourcePosition.hasSameParentAs(t.targetPosition)){e.howMany+=t.howMany}if(e.sourcePosition.hasSameParentAs(t.sourcePosition)){e.howMany-=t.howMany}e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t);e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t);if(!e.graveyardPosition.isEqual(t.targetPosition)){e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}return[e]});U_(vg,yg,(e,t,i)=>{if(t.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1);if(e.deletionPosition.isEqual(t.graveyardPosition)){e.howMany=t.howMany}}if(e.targetPosition.isEqual(t.splitPosition)){const n=t.howMany!=0;const o=t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition);if(n||o||i.abRelation=="mergeTargetNotMoved"){e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t);return[e]}}if(e.sourcePosition.isEqual(t.splitPosition)){if(i.abRelation=="mergeSourceNotMoved"){e.howMany=0;e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t);return[e]}if(i.abRelation=="mergeSameElement"||e.sourcePosition.offset>0){e.sourcePosition=t.moveTargetPosition.clone();e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t);return[e]}}if(e.sourcePosition.hasSameParentAs(t.splitPosition)){e.howMany=t.splitPosition.offset}e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t);e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t);return[e]});U_(pg,bg,(e,t)=>{const i=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);const n=i._getTransformedByInsertOperation(t,false)[0];e.sourcePosition=n.start;e.howMany=n.end.offset-n.start.offset;if(!e.targetPosition.isEqual(t.position)){e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)}return[e]});U_(pg,pg,(e,t,i)=>{const n=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);const o=ef._createFromPositionAndShift(t.sourcePosition,t.howMany);let r=i.aIsStrong;let s=!i.aIsStrong;if(i.abRelation=="insertBefore"||i.baRelation=="insertAfter"){s=true}else if(i.abRelation=="insertAfter"||i.baRelation=="insertBefore"){s=false}let a;if(e.targetPosition.isEqual(t.targetPosition)&&s){a=e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany)}else{a=e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}if(X_(e,t)&&X_(t,e)){return[t.getReversed()]}const c=n.containsPosition(t.targetPosition);if(c&&n.containsRange(o,true)){n.start=n.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);n.end=n.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);return ev([n],a)}const l=o.containsPosition(e.targetPosition);if(l&&o.containsRange(n,true)){n.start=n.start._getCombined(t.sourcePosition,t.getMovedRangeStart());n.end=n.end._getCombined(t.sourcePosition,t.getMovedRangeStart());return ev([n],a)}const d=Rs(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if(d=="prefix"||d=="extension"){n.start=n.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);n.end=n.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);return ev([n],a)}if(e.type=="remove"&&t.type!="remove"&&!i.aWasUndone&&!i.forceWeakRemove){r=true}else if(e.type!="remove"&&t.type=="remove"&&!i.bWasUndone&&!i.forceWeakRemove){r=false}const u=[];const h=n.getDifference(o);for(const e of h){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany);e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const i=Rs(e.start.getParentPath(),t.getMovedRangeStart().getParentPath())=="same";const n=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,i);u.push(...n)}const f=n.getIntersection(o);if(f!==null&&r){f.start=f.start._getCombined(t.sourcePosition,t.getMovedRangeStart());f.end=f.end._getCombined(t.sourcePosition,t.getMovedRangeStart());if(u.length===0){u.push(f)}else if(u.length==1){if(o.start.isBefore(n.start)||o.start.isEqual(n.start)){u.unshift(f)}else{u.push(f)}}else{u.splice(1,0,f)}}if(u.length===0){return[new qg(e.baseVersion)]}return ev(u,a)});U_(pg,yg,(e,t,i)=>{let n=e.targetPosition.clone();if(!e.targetPosition.isEqual(t.insertionPosition)||!t.graveyardPosition||i.abRelation=="moveTargetAfter"){n=e.targetPosition._getTransformedBySplitOperation(t)}const o=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);if(o.end.isEqual(t.insertionPosition)){if(!t.graveyardPosition){e.howMany++}e.targetPosition=n;return[e]}if(o.start.hasSameParentAs(t.splitPosition)&&o.containsPosition(t.splitPosition)){let e=new ef(t.splitPosition,o.end);e=e._getTransformedBySplitOperation(t);const i=[new ef(o.start,t.splitPosition),e];return ev(i,n)}if(e.targetPosition.isEqual(t.splitPosition)&&i.abRelation=="insertAtSource"){n=t.moveTargetPosition}if(e.targetPosition.isEqual(t.insertionPosition)&&i.abRelation=="insertBetween"){n=e.targetPosition}const r=o._getTransformedBySplitOperation(t);const s=[r];if(t.graveyardPosition){const n=o.start.isEqual(t.graveyardPosition)||o.containsPosition(t.graveyardPosition);if(e.howMany>1&&n&&!i.aWasUndone){s.push(ef._createFromPositionAndShift(t.insertionPosition,1))}}return ev(s,n)});U_(pg,vg,(e,t,i)=>{const n=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(t.sourcePosition)){if(e.type=="remove"&&!i.forceWeakRemove){if(!i.aWasUndone){const i=[];let n=t.graveyardPosition.clone();let o=t.targetPosition._getTransformedByMergeOperation(t);if(e.howMany>1){i.push(new pg(e.sourcePosition,e.howMany-1,e.targetPosition,0));n=n._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);const s=new pg(n,1,r,0);const a=s.getMovedRangeStart().path.slice();a.push(0);const c=new Qh(s.targetPosition.root,a);o=o._getTransformedByMove(n,r,1);const l=new pg(o,t.howMany,c,0);i.push(s);i.push(l);return i}}else{if(e.howMany==1){if(!i.bWasUndone){return[new qg(0)]}else{e.sourcePosition=t.graveyardPosition.clone();e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);return[e]}}}}const o=ef._createFromPositionAndShift(e.sourcePosition,e.howMany);const r=o._getTransformedByMergeOperation(t);e.sourcePosition=r.start;e.howMany=r.end.offset-r.start.offset;e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);return[e]});U_(kg,bg,(e,t)=>{e.position=e.position._getTransformedByInsertOperation(t);return[e]});U_(kg,vg,(e,t)=>{if(e.position.isEqual(t.deletionPosition)){e.position=t.graveyardPosition.clone();e.position.stickiness="toNext";return[e]}e.position=e.position._getTransformedByMergeOperation(t);return[e]});U_(kg,pg,(e,t)=>{e.position=e.position._getTransformedByMoveOperation(t);return[e]});U_(kg,kg,(e,t,i)=>{if(e.position.isEqual(t.position)){if(i.aIsStrong){e.oldName=t.newName}else{return[new qg(0)]}}return[e]});U_(kg,yg,(e,t)=>{const i=e.position.path;const n=t.splitPosition.getParentPath();if(Rs(i,n)=="same"&&!t.graveyardPosition){const t=new kg(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}e.position=e.position._getTransformedBySplitOperation(t);return[e]});U_(_g,_g,(e,t,i)=>{if(e.root===t.root&&e.key===t.key){if(!i.aIsStrong||e.newValue===t.newValue){return[new qg(0)]}else{e.oldValue=t.newValue}}return[e]});U_(yg,bg,(e,t)=>{if(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!i.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const i=t.graveyardPosition.path.slice();i.push(0);const n=new Qh(t.graveyardPosition.root,i);const o=yg.getInsertionPosition(new Qh(t.graveyardPosition.root,i));const r=new yg(n,0,null,0);r.insertionPosition=o;e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t);e.insertionPosition=yg.getInsertionPosition(e.splitPosition);e.graveyardPosition=r.insertionPosition.clone();e.graveyardPosition.stickiness="toNext";return[r,e]}if(e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)){e.howMany--}if(e.splitPosition.hasSameParentAs(t.targetPosition)){e.howMany+=t.howMany}e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t);e.insertionPosition=yg.getInsertionPosition(e.splitPosition);if(e.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)}return[e]});U_(yg,pg,(e,t,i)=>{const n=ef._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const o=n.start.isEqual(e.graveyardPosition)||n.containsPosition(e.graveyardPosition);if(!i.bWasUndone&&o){const i=e.splitPosition._getTransformedByMoveOperation(t);const n=e.graveyardPosition._getTransformedByMoveOperation(t);const o=n.path.slice();o.push(0);const r=new Qh(n.root,o);const s=new pg(i,e.howMany,r,0);return[s]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.splitPosition)){const i=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);e.howMany-=i;if(e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition){return[new qg(0)]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){return[new qg(0)]}if(i.abRelation=="splitBefore"){e.howMany=0;e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t);return[e]}}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const n=e.splitPosition.root.rootName=="$graveyard";const o=t.splitPosition.root.rootName=="$graveyard";const r=n&&!o;const s=o&&!n;const a=s||!r&&i.aIsStrong;if(a){const i=[];if(t.howMany){i.push(new pg(t.moveTargetPosition,t.howMany,t.splitPosition,0))}if(e.howMany){i.push(new pg(e.splitPosition,e.howMany,e.moveTargetPosition,0))}return i}else{return[new qg(0)]}}if(e.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)}if(e.splitPosition.isEqual(t.insertionPosition)&&i.abRelation=="splitBefore"){e.howMany++;return[e]}if(t.splitPosition.isEqual(e.insertionPosition)&&i.baRelation=="splitBefore"){const i=t.insertionPosition.path.slice();i.push(0);const n=new Qh(t.insertionPosition.root,i);const o=new pg(e.insertionPosition,1,n,0);return[e,o]}if(e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offsetthis.clearStack())}refresh(){this.isEnabled=this._stack.length>0}addBatch(e){const t=this.editor.model.document.selection;const i={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:i});this.refresh()}clearStack(){this._stack=[];this.refresh()}_restoreSelection(e,t,i){const n=this.editor.model;const o=n.document;const r=[];const s=e.map(e=>e.getTransformedByOperations(i));const a=s.flat();for(const e of s){const t=e.filter(e=>!nv(e,a));iv(t);const i=t.find(e=>e.root!=o.graveyard);if(i){r.push(i)}}if(r.length){n.change(e=>{e.setSelection(r,{backward:t})})}}_undo(e,t){const i=this.editor.model;const n=i.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;const r=Array.from(n.history.getOperations(o));const s=Y_([e.getReversed()],r,{useRelations:true,document:this.editor.model.document,padWithNoOps:false,forceWeakRemove:true});const a=s.operationsA;for(const o of a){t.addOperation(o);i.applyOperation(o);n.history.setOperationAsUndone(e,o)}}}}function iv(e){e.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let t=1;tt!==e&&t.containsRange(e,true))}class ov extends tv{execute(e=null){const t=e?this._stack.findIndex(t=>t.batch==e):this._stack.length-1;const i=this._stack.splice(t,1)[0];const n=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(n,()=>{this._undo(i.batch,n);const e=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,e);this.fire("revert",i.batch,n)});this.refresh()}}class rv extends tv{execute(){const e=this._stack.pop();const t=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(t,()=>{const i=e.batch.operations[e.batch.operations.length-1];const n=i.baseVersion+1;const o=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,o);this._undo(e.batch,t)});this.refresh()}}class sv extends tk{static get pluginName(){return"UndoEditing"}constructor(e){super(e);this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new ov(e);this._redoCommand=new rv(e);e.commands.add("undo",this._undoCommand);e.commands.add("redo",this._redoCommand);this.listenTo(e.model,"applyOperation",(e,t)=>{const i=t[0];if(!i.isDocumentOperation){return}const n=i.batch;const o=this._redoCommand._createdBatches.has(n);const r=this._undoCommand._createdBatches.has(n);const s=this._batchRegistry.has(n);if(s||n.type=="transparent"&&!o&&!r){return}else{if(o){this._undoCommand.addBatch(n)}else if(!r){this._undoCommand.addBatch(n);this._redoCommand.clearStack()}}this._batchRegistry.add(n)},{priority:"highest"});this.listenTo(this._undoCommand,"revert",(e,t,i)=>{this._redoCommand.addBatch(i)});e.keystrokes.set("CTRL+Z","undo");e.keystrokes.set("CTRL+Y","redo");e.keystrokes.set("CTRL+SHIFT+Z","redo")}}var av='';var cv='';class lv extends tk{init(){const e=this.editor;const t=e.locale;const i=e.t;const n=t.uiLanguageDirection=="ltr"?av:cv;const o=t.uiLanguageDirection=="ltr"?cv:av;this._addButton("undo",i("Undo"),"CTRL+Z",n);this._addButton("redo",i("Redo"),"CTRL+Y",o)}_addButton(e,t,i,n){const o=this.editor;o.ui.componentFactory.add(e,r=>{const s=o.commands.get(e);const a=new Tw(r);a.set({label:t,icon:n,keystroke:i,tooltip:true});a.bind("isEnabled").to(s,"isEnabled");this.listenTo(a,"execute",()=>{o.execute(e);o.editing.view.focus()});return a})}}class dv extends tk{static get requires(){return[sv,lv]}static get pluginName(){return"Undo"}}class uv extends tk{static get requires(){return[n_,l_,y_,g_,F_,dv]}static get pluginName(){return"Essentials"}}class hv extends nk{constructor(e,t){super(e);this.attributeKey=t}refresh(){const e=this.editor.model;const 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;const i=t.document;const n=i.selection;const o=e.value;t.change(e=>{if(n.isCollapsed){if(o){e.setSelectionAttribute(this.attributeKey,o)}else{e.removeSelectionAttribute(this.attributeKey)}}else{const i=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of i){if(o){e.setAttribute(this.attributeKey,o,t)}else{e.removeAttribute(this.attributeKey,t)}}}})}}var fv='';class mv extends Tw{constructor(e){super(e);const t=this.bindTemplate;this.set("color");this.set("hasBorder");this.icon=fv;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%)"}}var gv=i(45);class pv extends jb{constructor(e,t){super(e);const i=t&&t.colorDefinitions||[];const n={};if(t&&t.columns){n.gridTemplateColumns=`repeat( ${t.columns}, 1fr)`}this.set("selectedColor");this.items=this.createCollection();this.focusTracker=new Yp;this.keystrokes=new zp;this._focusCycler=new iw({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});i.forEach(e=>{const t=new mv;t.set({color:e.color,label:e.label,tooltip:true,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:n}});this.on("change:selectedColor",(e,t,i)=>{for(const e of this.items){e.isOn=e.color===i}})}focus(){if(this.items.length){this.items.first.focus()}}focusLast(){if(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 bv extends xs{constructor(e){super(e);this.set("isEmpty",true);this.on("change",()=>{this.set("isEmpty",this.length===0)})}add(e,t){if(this.find(t=>t.color===e.color)){return}super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}}ys(bv,Qc);var wv='';var kv=i(47);class _v extends jb{constructor(e,{colors:t,columns:i,removeButtonLabel:n,documentColorsLabel:o,documentColorsCount:r}){super(e);this.items=this.createCollection();this.colorDefinitions=t;this.focusTracker=new Yp;this.keystrokes=new zp;this.set("selectedColor");this.removeButtonLabel=n;this.columns=i;this.documentColors=new bv;this.documentColorsCount=r;this._focusCycler=new iw({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 i=e.document;const n=this.documentColorsCount;this.documentColors.clear();for(const o of i.getRootNames()){const r=i.getRoot(o);const s=e.createRangeIn(r);for(const e of s.getItems()){if(e.is("$textProxy")&&e.hasAttribute(t)){this._addColorToDocumentColors(e.getAttribute(t));if(this.documentColors.length>=n){return}}}}}updateSelectedColors(){const e=this.documentColorsGrid;const t=this.staticColorsGrid;const i=this.selectedColor;t.selectedColor=i;if(e){e.selectedColor=i}}render(){super.render();for(const e of this.items){this.focusTracker.add(e.element)}this.keystrokes.listenTo(this.element)}appendGrids(){if(this.staticColorsGrid){return}this.staticColorsGrid=this._createStaticColorsGrid();this.items.add(this.staticColorsGrid);if(this.documentColorsCount){const e=hb.bind(this.documentColors,this.documentColors);const t=new Gb(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 Tw;e.set({withText:true,icon:wv,tooltip:true,label:this.removeButtonLabel});e.class="ck-color-table__remove-color";e.on("execute",()=>{this.fire("execute",{value:null})});return e}_createStaticColorsGrid(){const e=new pv(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});e.delegate("execute").to(this);return e}_createDocumentColorsGrid(){const e=hb.bind(this.documentColors,this.documentColors);const t=new pv(this.locale,{columns:this.columns});t.delegate("execute").to(this);t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}});t.items.bindTo(this.documentColors).using(e=>{const t=new mv;t.set({color:e.color,hasBorder:e.options&&e.options.hasBorder});if(e.label){t.set({label:e.label,tooltip:true})}t.on("execute",()=>{this.fire("execute",{value:e.color})});return t});this.documentColors.on("change:isEmpty",(e,i,n)=>{if(n){t.selectedColor=null}});return t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find(t=>t.color===e);if(!t){this.documentColors.add({color:e,label:e,options:{hasBorder:false}})}else{this.documentColors.add(Object.assign({},t))}}}const vv="fontSize";const yv="fontFamily";const xv="fontColor";const Av="fontBackgroundColor";function Tv(e,t){const i={model:{key:e,values:[]},view:{},upcastAlso:{}};for(const e of t){i.model.values.push(e.model);i.view[e.model]=e.view;if(e.upcastAlso){i.upcastAlso[e.model]=e.upcastAlso}}return i}function Cv(e){return t=>Sv(t.getStyle(e))}function Pv(e){return(t,i)=>i.createAttributeElement("span",{style:`${e}:${t}`},{priority:7})}function Ev({dropdownView:e,colors:t,columns:i,removeButtonLabel:n,documentColorsLabel:o,documentColorsCount:r}){const s=e.locale;const a=new _v(s,{colors:t,columns:i,removeButtonLabel:n,documentColorsLabel:o,documentColorsCount:r});e.colorTableView=a;e.panelView.children.add(a);a.delegate("execute").to(e,"execute");return a}function Sv(e){return e.replace(/\s/g,"")}class Mv extends hv{constructor(e){super(e,Av)}}const Iv=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;const Nv=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i;const Ov=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i;const zv=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i;const Rv=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i;const Lv=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 Dv(e){if(e.startsWith("#")){return Iv.test(e)}if(e.startsWith("rgb")){return Nv.test(e)||Ov.test(e)}if(e.startsWith("hsl")){return zv.test(e)||Rv.test(e)}return Lv.has(e.toLowerCase())}const Vv=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"];function jv(e){return Vv.includes(e)}const Bv=/^([+-]?[0-9]*[.]?[0-9]+(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;function Fv(e){return Bv.test(e)}const Hv=/^[+-]?[0-9]*[.]?[0-9]+%$/;function Uv(e){return Hv.test(e)}const Wv=["repeat-x","repeat-y","repeat","space","round","no-repeat"];function qv(e){return Wv.includes(e)}const $v=["center","top","bottom","left","right"];function Yv(e){return $v.includes(e)}const Gv=["fixed","scroll","local"];function Kv(e){return Gv.includes(e)}const Qv=/^url\(/;function Jv(e){return Qv.test(e)}function Zv(e=""){if(e===""){return{top:undefined,right:undefined,bottom:undefined,left:undefined}}const t=iy(e);const i=t[0];const n=t[2]||i;const o=t[1]||i;const r=t[3]||o;return{top:i,bottom:n,right:o,left:r}}function Xv(e){return t=>{const{top:i,right:n,bottom:o,left:r}=t;const s=[];if(![i,n,r,o].every(e=>!!e)){if(i){s.push([e+"-top",i])}if(n){s.push([e+"-right",n])}if(o){s.push([e+"-bottom",o])}if(r){s.push([e+"-left",r])}}else{s.push([e,ey(t)])}return s}}function ey({top:e,right:t,bottom:i,left:n}){const o=[];if(n!==t){o.push(e,t,i,n)}else if(i!==e){o.push(e,t,i)}else if(t!==e){o.push(e,t)}else{o.push(e)}return o.join(" ")}function ty(e){return t=>({path:e,value:Zv(t)})}function iy(e){return e.replace(/, /g,",").split(" ").map(e=>e.replace(/,/g,", "))}function ny(e){e.setNormalizer("background",oy);e.setNormalizer("background-color",e=>({path:"background.color",value:e}));e.setReducer("background",e=>{const t=[];t.push(["background-color",e.color]);return t})}function oy(e){const t={};const i=iy(e);for(const e of i){if(qv(e)){t.repeat=t.repeat||[];t.repeat.push(e)}else if(Yv(e)){t.position=t.position||[];t.position.push(e)}else if(Kv(e)){t.attachment=e}else if(Dv(e)){t.color=e}else if(Jv(e)){t.image=e}}return{path:"background",value:t}}class ry extends tk{static get pluginName(){return"FontBackgroundColorEditing"}constructor(e){super(e);e.config.define(Av,{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:true},{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(ny);e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:Av,value:Cv("background-color")}});e.conversion.for("downcast").attributeToElement({model:Av,view:Pv("background-color")});e.commands.add(Av,new Mv(e));e.model.schema.extend("$text",{allowAttributes:Av});e.model.schema.setAttributeProperties(Av,{isFormatting:true,copyOnEnter:true})}}function sy(e,t){const i=e.t;const n={Black:i("Black"),"Dim grey":i("Dim grey"),Grey:i("Grey"),"Light grey":i("Light grey"),White:i("White"),Red:i("Red"),Orange:i("Orange"),Yellow:i("Yellow"),"Light green":i("Light green"),Green:i("Green"),Aquamarine:i("Aquamarine"),Turquoise:i("Turquoise"),"Light blue":i("Light blue"),Blue:i("Blue"),Purple:i("Purple")};return t.map(e=>{const t=n[e.label];if(t&&t!=e.label){e.label=t}return e})}function ay(e){return e.map(cy).filter(e=>!!e)}function cy(e){if(typeof e==="string"){return{model:e,label:e,hasBorder:false,view:{name:"span",styles:{color:e}}}}else{return{model:e.color,label:e.label||e.color,hasBorder:e.hasBorder===undefined?false:e.hasBorder,view:{name:"span",styles:{color:`${e.color}`}}}}}class ly extends tk{constructor(e,{commandName:t,icon:i,componentName:n,dropdownLabel:o}){super(e);this.commandName=t;this.componentName=n;this.icon=i;this.dropdownLabel=o;this.columns=e.config.get(`${this.componentName}.columns`);this.colorTableView}init(){const e=this.editor;const t=e.locale;const i=t.t;const n=e.commands.get(this.commandName);const o=ay(e.config.get(this.componentName).colors);const r=sy(t,o);const s=e.config.get(`${this.componentName}.documentColors`);e.ui.componentFactory.add(this.componentName,t=>{const o=Dw(t);this.colorTableView=Ev({dropdownView:o,colors:r.map(e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}})),columns:this.columns,removeButtonLabel:i("Remove color"),documentColorsLabel:s!==0?i("Document colors"):undefined,documentColorsCount:s===undefined?this.columns:s});this.colorTableView.bind("selectedColor").to(n,"value");o.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:true});o.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}});o.bind("isEnabled").to(n);o.on("execute",(t,i)=>{e.execute(this.commandName,i);e.editing.view.focus()});o.on("change:isOpen",(t,i,n)=>{o.colorTableView.appendGrids();if(n){if(s!==0){this.colorTableView.updateDocumentColors(e.model,this.componentName)}this.colorTableView.updateSelectedColors()}});return o})}}var dy='';class uy extends ly{constructor(e){const t=e.locale.t;super(e,{commandName:Av,componentName:Av,icon:dy,dropdownLabel:t("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class hy extends tk{static get requires(){return[ry,uy]}static get pluginName(){return"FontBackgroundColor"}}class fy extends hv{constructor(e){super(e,xv)}}class my extends tk{static get pluginName(){return"FontColorEditing"}constructor(e){super(e);e.config.define(xv,{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:true},{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:xv,value:Cv("color")}});e.conversion.for("downcast").attributeToElement({model:xv,view:Pv("color")});e.commands.add(xv,new fy(e));e.model.schema.extend("$text",{allowAttributes:xv});e.model.schema.setAttributeProperties(xv,{isFormatting:true,copyOnEnter:true})}}var gy='';class py extends ly{constructor(e){const t=e.locale.t;super(e,{commandName:xv,componentName:xv,icon:gy,dropdownLabel:t("Font Color")})}static get pluginName(){return"FontColorUI"}}class by extends tk{static get requires(){return[my,py]}static get pluginName(){return"FontColor"}}class wy extends hv{constructor(e){super(e,yv)}}function ky(e){return e.map(_y).filter(e=>!!e)}function _y(e){if(typeof e==="object"){return e}if(e==="default"){return{title:"Default",model:undefined}}if(typeof e!=="string"){return}return vy(e)}function vy(e){const t=e.replace(/"|'/g,"").split(",");const i=t[0];const n=t.map(yy).join(", ");return{title:i,model:n,view:{name:"span",styles:{"font-family":n},priority:7}}}function yy(e){e=e.trim();if(e.indexOf(" ")>0){e=`'${e}'`}return e}class xy extends tk{static get pluginName(){return"FontFamilyEditing"}constructor(e){super(e);e.config.define(yv,{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:false})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:yv});e.model.schema.setAttributeProperties(yv,{isFormatting:true,copyOnEnter:true});const t=ky(e.config.get("fontFamily.options")).filter(e=>e.model);const i=Tv(yv,t);if(e.config.get("fontFamily.supportAllValues")){this._prepareAnyValueConverters()}else{e.conversion.attributeToElement(i)}e.commands.add(yv,new wy(e))}_prepareAnyValueConverters(){const e=this.editor;e.conversion.for("downcast").attributeToElement({model:yv,view:(e,t)=>t.createAttributeElement("span",{style:"font-family:"+e},{priority:7})});e.conversion.for("upcast").attributeToAttribute({model:{key:yv,value:e=>e.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}}class Ay{constructor(e,t){if(t){qc(this,t)}if(e){this.set(e)}}}ys(Ay,Qc);var Ty='';class Cy extends tk{init(){const e=this.editor;const t=e.t;const i=this._getLocalizedOptions();const n=e.commands.get(yv);e.ui.componentFactory.add(yv,o=>{const r=Dw(o);jw(r,Py(i,n));r.buttonView.set({label:t("Font Family"),icon:Ty,tooltip:true});r.extendTemplate({attributes:{class:"ck-font-family-dropdown"}});r.bind("isEnabled").to(n);this.listenTo(r,"execute",t=>{e.execute(t.source.commandName,{value:t.source.commandParam});e.editing.view.focus()});return r})}_getLocalizedOptions(){const e=this.editor;const t=e.t;const i=ky(e.config.get(yv).options);return i.map(e=>{if(e.title==="Default"){e.title=t("Default")}return e})}}function Py(e,t){const i=new xs;for(const n of e){const e={type:"button",model:new Ay({commandName:yv,commandParam:n.model,label:n.title,withText:true})};e.model.bind("isOn").to(t,"value",e=>{if(e===n.model){return true}if(!e||!n.model){return false}return e.split(",")[0].replace(/'/g,"").toLowerCase()===n.model.toLowerCase()});if(n.view&&n.view.styles){e.model.set("labelStyle",`font-family: ${n.view.styles["font-family"]}`)}i.add(e)}return i}class Ey extends tk{static get requires(){return[xy,Cy]}static get pluginName(){return"FontFamily"}}class Sy extends hv{constructor(e){super(e,vv)}}function My(e){return e.map(e=>Ny(e)).filter(e=>!!e)}const Iy={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 Ny(e){if(Ly(e)){return zy(e)}const t=Ry(e);if(t){return zy(t)}if(e==="default"){return{model:undefined,title:"Default"}}if(Dy(e)){return}return Oy(e)}function Oy(e){if(typeof e==="number"||typeof e==="string"){e={title:String(e),model:`${parseFloat(e)}px`}}e.view={name:"span",styles:{"font-size":e.model}};return zy(e)}function zy(e){if(!e.view.priority){e.view.priority=7}return e}function Ry(e){return Iy[e]||Iy[e.model]}function Ly(e){return typeof e==="object"&&e.title&&e.model&&e.view}function Dy(e){let t;if(typeof e==="object"){if(!e.model){throw new ss["b"]("font-size-invalid-definition: Provided font size definition is invalid.",null,e)}else{t=parseFloat(e.model)}}else{t=parseFloat(e)}return isNaN(t)}class Vy extends tk{static get pluginName(){return"FontSizeEditing"}constructor(e){super(e);e.config.define(vv,{options:["tiny","small","default","big","huge"],supportAllValues:false})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:vv});e.model.schema.setAttributeProperties(vv,{isFormatting:true,copyOnEnter:true});const t=e.config.get("fontSize.supportAllValues");const i=My(this.editor.config.get("fontSize.options")).filter(e=>e.model);const n=Tv(vv,i);if(t){this._prepareAnyValueConverters(n)}else{e.conversion.attributeToElement(n)}e.commands.add(vv,new Sy(e))}_prepareAnyValueConverters(e){const t=this.editor;const i=e.model.values.filter(e=>!String(e).match(/[\d.]+[\w%]+/));if(i.length){throw new ss["b"]("font-size-invalid-use-of-named-presets: "+"If config.fontSize.supportAllValues is set to true, you need to use numerical values as font size options.",null,{presets:i})}t.conversion.for("downcast").attributeToElement({model:vv,view:(e,t)=>{if(!e){return}return t.createAttributeElement("span",{style:"font-size:"+e},{priority:7})}});t.conversion.for("upcast").attributeToAttribute({model:{key:vv,value:e=>e.getStyle("font-size")},view:{name:"span"}})}}var jy='';var By=i(49);class Fy extends tk{init(){const e=this.editor;const t=e.t;const i=this._getLocalizedOptions();const n=e.commands.get(vv);e.ui.componentFactory.add(vv,o=>{const r=Dw(o);jw(r,Hy(i,n));r.buttonView.set({label:t("Font Size"),icon:jy,tooltip:true});r.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}});r.bind("isEnabled").to(n);this.listenTo(r,"execute",t=>{e.execute(t.source.commandName,{value:t.source.commandParam});e.editing.view.focus()});return r})}_getLocalizedOptions(){const e=this.editor;const t=e.t;const i={Default:t("Default"),Tiny:t("Tiny"),Small:t("Small"),Big:t("Big"),Huge:t("Huge")};const n=My(e.config.get(vv).options);return n.map(e=>{const t=i[e.title];if(t&&t!=e.title){e=Object.assign({},e,{title:t})}return e})}}function Hy(e,t){const i=new xs;for(const n of e){const e={type:"button",model:new Ay({commandName:vv,commandParam:n.model,label:n.title,class:"ck-fontsize-option",withText:true})};if(n.view&&n.view.styles){e.model.set("labelStyle",`font-size:${n.view.styles["font-size"]}`)}if(n.view&&n.view.classes){e.model.set("class",`${e.model.class} ${n.view.classes}`)}e.model.bind("isOn").to(t,"value",e=>e===n.model);i.add(e)}return i}class Uy extends tk{static get requires(){return[Vy,Fy]}static get pluginName(){return"FontSize"}}class Wy extends nk{refresh(){const e=this.editor.model;const t=e.document;const i=rk(t.selection.getSelectedBlocks());this.value=!!i&&i.is("element","paragraph");this.isEnabled=!!i&&qy(i,e.schema)}execute(e={}){const t=this.editor.model;const i=t.document;t.change(n=>{const o=(e.selection||i.selection).getSelectedBlocks();for(const e of o){if(!e.is("element","paragraph")&&qy(e,t.schema)){n.rename(e,"paragraph")}}})}}function qy(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class $y extends nk{execute(e){const t=this.editor.model;let i=e.position;t.change(e=>{const n=e.createElement("paragraph");if(!t.schema.checkChild(i.parent,n)){const o=t.schema.findAllowedParent(i,n);if(!o){return}i=e.split(i,o).position}t.insertContent(n,i);e.setSelection(n,"in")})}}class Yy extends tk{static get pluginName(){return"Paragraph"}init(){const e=this.editor;const t=e.model;const i=e.data;e.commands.add("paragraph",new Wy(e));e.commands.add("insertParagraph",new $y(e));t.schema.register("paragraph",{inheritAllFrom:"$block"});e.conversion.elementToElement({model:"paragraph",view:"p"});e.conversion.for("upcast").elementToElement({model:(e,t)=>{if(!Yy.paragraphLikeElements.has(e.name)){return null}if(e.isEmpty){return null}return t.createElement("paragraph")},converterPriority:"low"});i.upcastDispatcher.on("element",(e,t,i)=>{if(!i.consumable.test(t.viewItem,{name:t.viewItem.name})){return}if(Ky(t.viewItem,t.modelCursor,i.schema)){Object.assign(t,Gy(t.viewItem,t.modelCursor,i))}},{priority:"low"});i.upcastDispatcher.on("text",(e,t,i)=>{if(t.modelRange){return}if(Ky(t.viewItem,t.modelCursor,i.schema)){Object.assign(t,Gy(t.viewItem,t.modelCursor,i))}},{priority:"lowest"});t.document.registerPostFixer(e=>this._autoparagraphEmptyRoots(e));e.data.on("ready",()=>{t.enqueueChange("transparent",e=>this._autoparagraphEmptyRoots(e))},{priority:"lowest"})}_autoparagraphEmptyRoots(e){const t=this.editor.model;for(const i of t.document.getRootNames()){const n=t.document.getRoot(i);if(n.isEmpty&&n.rootName!="$graveyard"){if(t.schema.checkChild(n,"paragraph")){e.insertElement("paragraph",n);return true}}}}}Yy.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td"]);function Gy(e,t,i){const n=i.writer.createElement("paragraph");i.writer.insert(n,t);return i.convertItem(e,i.writer.createPositionAt(n,0))}function Ky(e,t,i){const n=i.createContext(t);if(!i.checkChild(n,"paragraph")){return false}if(!i.checkChild(n.push("paragraph"),e)){return false}return true}class Qy extends nk{constructor(e,t){super(e);this.modelElements=t}refresh(){const e=rk(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name;this.isEnabled=!!e&&this.modelElements.some(t=>Jy(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model;const i=t.document;const n=e.value;t.change(e=>{const o=Array.from(i.selection.getSelectedBlocks()).filter(e=>Jy(e,n,t.schema));for(const t of o){if(!t.is("element",n)){e.rename(t,n)}}})}}function Jy(e,t,i){return i.checkChild(e.parent,t)&&!i.isObject(e)}const Zy="paragraph";class Xy extends tk{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[Yy]}init(){const e=this.editor;const t=e.config.get("heading.options");const i=[];for(const n of t){if(n.model!==Zy){e.model.schema.register(n.model,{inheritAllFrom:"$block"});e.conversion.elementToElement(n);i.push(n.model)}}this._addDefaultH1Conversion(e);e.commands.add("heading",new Qy(e,i))}afterInit(){const e=this.editor;const t=e.commands.get("enter");const i=e.config.get("heading.options");if(t){this.listenTo(t,"afterExecute",(t,n)=>{const o=e.model.document.selection.getFirstPosition().parent;const r=i.some(e=>o.is("element",e.model));if(r&&!o.is("element",Zy)&&o.childCount===0){n.writer.rename(o,Zy)}})}}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:os.get("low")+1})}}function ex(e){const t=e.t;const i={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=i[e.title];if(t&&t!=e.title){e.title=t}return e})}var tx=i(11);class ix extends tk{init(){const e=this.editor;const t=e.t;const i=ex(e);const n=t("Choose heading");const o=t("Heading");e.ui.componentFactory.add("heading",t=>{const r={};const s=new xs;const a=e.commands.get("heading");const c=e.commands.get("paragraph");const l=[a];for(const e of i){const t={type:"button",model:new Ay({label:e.title,class:e.class,withText:true})};if(e.model==="paragraph"){t.model.bind("isOn").to(c,"value");t.model.set("commandName","paragraph");l.push(c)}else{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=Dw(t);jw(d,s);d.buttonView.set({isOn:false,withText:true,tooltip:o});d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}});d.bind("isEnabled").toMany(l,"isEnabled",(...e)=>e.some(e=>e));d.buttonView.bind("label").to(a,"value",c,"value",(e,t)=>{const i=e||t&&"paragraph";return r[i]?r[i]:n});this.listenTo(d,"execute",t=>{e.execute(t.source.commandName,t.source.commandValue?{value:t.source.commandValue}:undefined);e.editing.view.focus()});return d})}}class nx extends tk{static get requires(){return[Xy,ix]}static get pluginName(){return"Heading"}}class ox extends nk{refresh(){const e=this.editor.model;const t=e.document;this.value=t.selection.getAttribute("highlight");this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"highlight")}execute(e={}){const t=this.editor.model;const i=t.document;const n=i.selection;const o=e.value;t.change(e=>{const i=t.schema.getValidRanges(n.getRanges(),"highlight");if(n.isCollapsed){const t=n.getFirstPosition();if(n.hasAttribute("highlight")){const i=e=>e.item.hasAttribute("highlight")&&e.item.getAttribute("highlight")===this.value;const n=t.getLastMatchingPosition(i,{direction:"backward"});const r=t.getLastMatchingPosition(i);const s=e.createRange(n,r);if(!o||this.value===o){e.removeAttribute("highlight",s);e.removeSelectionAttribute("highlight")}else{e.setAttribute("highlight",o,s);e.setSelectionAttribute("highlight",o)}}else if(o){e.setSelectionAttribute("highlight",o)}}else{for(const t of i){if(o){e.setAttribute("highlight",o,t)}else{e.removeAttribute("highlight",t)}}}})}}class rx extends tk{static get pluginName(){return"HighlightEditing"}constructor(e){super(e);e.config.define("highlight",{options:[{model:"yellowMarker",class:"marker-yellow",title:"Yellow marker",color:"var(--ck-highlight-marker-yellow)",type:"marker"},{model:"greenMarker",class:"marker-green",title:"Green marker",color:"var(--ck-highlight-marker-green)",type:"marker"},{model:"pinkMarker",class:"marker-pink",title:"Pink marker",color:"var(--ck-highlight-marker-pink)",type:"marker"},{model:"blueMarker",class:"marker-blue",title:"Blue marker",color:"var(--ck-highlight-marker-blue)",type:"marker"},{model:"redPen",class:"pen-red",title:"Red pen",color:"var(--ck-highlight-pen-red)",type:"pen"},{model:"greenPen",class:"pen-green",title:"Green pen",color:"var(--ck-highlight-pen-green)",type:"pen"}]})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"highlight"});const t=e.config.get("highlight.options");e.conversion.attributeToElement(sx(t));e.commands.add("highlight",new ox(e))}}function sx(e){const t={model:{key:"highlight",values:[]},view:{}};for(const i of e){t.model.values.push(i.model);t.view[i.model]={name:"mark",classes:i.class}}return t}var ax='';var cx='';var lx=i(52);class dx extends jb{constructor(e){super(e);const t=this.bindTemplate;this.set("icon");this.set("isEnabled",true);this.set("isOn",false);this.set("isToggleable",false);this.set("isVisible",true);this.set("keystroke");this.set("label");this.set("tabindex",-1);this.set("tooltip");this.set("tooltipPosition","s");this.set("type","button");this.set("withText",false);this.children=this.createCollection();this.actionView=this._createActionView();this.arrowView=this._createArrowView();this.keystrokes=new zp;this.focusTracker=new Yp;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)=>{if(this.focusTracker.focusedElement===this.actionView.element){this.arrowView.focus();t()}});this.keystrokes.set("arrowleft",(e,t)=>{if(this.focusTracker.focusedElement===this.arrowView.element){this.actionView.focus();t()}})}focus(){this.actionView.focus()}_createActionView(){const e=new Tw;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);return e}_createArrowView(){const e=new Tw;const t=e.bindTemplate;e.icon=Cw;e.extendTemplate({attributes:{class:"ck-splitbutton__arrow","aria-haspopup":true,"aria-expanded":t.to("isOn",e=>String(e))}});e.bind("isEnabled").to(this);e.delegate("execute").to(this,"open");return e}}var ux=i(54);class hx extends tk{get localizedOptionTitles(){const e=this.editor.t;return{"Yellow marker":e("Yellow marker"),"Green marker":e("Green marker"),"Pink marker":e("Pink marker"),"Blue marker":e("Blue marker"),"Red pen":e("Red pen"),"Green pen":e("Green pen")}}static get pluginName(){return"HighlightUI"}init(){const e=this.editor.config.get("highlight.options");for(const t of e){this._addHighlighterButton(t)}this._addRemoveHighlightButton();this._addDropdown(e)}_addRemoveHighlightButton(){const e=this.editor.t;this._addButton("removeHighlight",e("Remove highlight"),wv)}_addHighlighterButton(e){const t=this.editor.commands.get("highlight");this._addButton("highlight:"+e.model,e.title,mx(e.type),e.model,i);function i(i){i.bind("isEnabled").to(t,"isEnabled");i.bind("isOn").to(t,"value",t=>t===e.model);i.iconView.fillColor=e.color;i.isToggleable=true}}_addButton(e,t,i,n,o=(()=>{})){const r=this.editor;r.ui.componentFactory.add(e,e=>{const s=new Tw(e);const a=this.localizedOptionTitles[t]?this.localizedOptionTitles[t]:t;s.set({label:a,icon:i,tooltip:true});s.on("execute",()=>{r.execute("highlight",{value:n});r.editing.view.focus()});o(s);return s})}_addDropdown(e){const t=this.editor;const i=t.t;const n=t.ui.componentFactory;const o=e[0];const r=e.reduce((e,t)=>{e[t.model]=t;return e},{});n.add("highlight",s=>{const a=t.commands.get("highlight");const c=Dw(s,dx);const l=c.buttonView;l.set({tooltip:i("Highlight"),lastExecuted:o.model,commandValue:o.model,isToggleable:true});l.bind("icon").to(a,"value",e=>mx(u(e,"type")));l.bind("color").to(a,"value",e=>u(e,"color"));l.bind("commandValue").to(a,"value",e=>u(e,"model"));l.bind("isOn").to(a,"value",e=>!!e);l.delegate("execute").to(c);const d=e.map(e=>{const t=n.create("highlight:"+e.model);this.listenTo(t,"execute",()=>c.buttonView.set({lastExecuted:e.model}));return t});c.bind("isEnabled").toMany(d,"isEnabled",(...e)=>e.some(e=>e));d.push(new ow);d.push(n.create("removeHighlight"));Vw(c,d);fx(c);c.toolbarView.ariaLabel=i("Text highlight toolbar");l.on("execute",()=>{t.execute("highlight",{value:l.commandValue});t.editing.view.focus()});function u(e,t){const i=!e||e===l.lastExecuted?l.lastExecuted:e;return r[i][t]}return c})}}function fx(e){const t=e.buttonView.actionView;t.iconView.bind("fillColor").to(e.buttonView,"color")}function mx(e){return e==="marker"?ax:cx}class gx extends tk{static get requires(){return[rx,hx]}static get pluginName(){return"Highlight"}}class px{constructor(){this._stack=[]}add(e,t){const i=this._stack;const n=i[0];this._insertDescriptor(e);const o=i[0];if(n!==o&&!bx(n,o)){this.fire("change:top",{oldDescriptor:n,newDescriptor:o,writer:t})}}remove(e,t){const i=this._stack;const n=i[0];this._removeDescriptor(e);const o=i[0];if(n!==o&&!bx(n,o)){this.fire("change:top",{oldDescriptor:n,newDescriptor:o,writer:t})}}_insertDescriptor(e){const t=this._stack;const i=t.findIndex(t=>t.id===e.id);if(bx(e,t[i])){return}if(i>-1){t.splice(i,1)}let n=0;while(t[n]&&wx(t[n],e)){n++}t.splice(n,0,e)}_removeDescriptor(e){const t=this._stack;const i=t.findIndex(t=>t.id===e);if(i>-1){t.splice(i,1)}}}ys(px,ds);function bx(e,t){return e&&t&&e.priority==t.priority&&kx(e.classes)==kx(t.classes)}function wx(e,t){if(e.priority>t.priority){return true}else if(e.prioritykx(t.classes)}function kx(e){return Array.isArray(e)?e.sort().join(","):e}var _x=i(56);const vx=Zb("px");const yx=Dd.document.body;class xx extends jb{constructor(e){super(e);const t=this.bindTemplate;this.set("top",0);this.set("left",0);this.set("position","arrow_nw");this.set("isVisible",false);this.set("withArrow",true);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",vx),left:t.to("left",vx)}},children:this.content})}show(){this.isVisible=true}hide(){this.isVisible=false}attachTo(e){this.show();const t=xx.defaultPositions;const i=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:yx,fitInViewport:true},e);const n=xx._getOptimalPosition(i);const o=parseInt(n.left);const r=parseInt(n.top);const s=n.name;Object.assign(this,{top:r,left:o,position:s})}pin(e){this.unpin();this._pinWhenIsVisibleCallback=()=>{if(this.isVisible){this._startPinning(e)}else{this._stopPinning()}};this._startPinning(e);this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){if(this._pinWhenIsVisibleCallback){this._stopPinning();this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback);this._pinWhenIsVisibleCallback=null;this.hide()}}_startPinning(e){this.attachTo(e);const t=Ax(e.target);const i=e.limiter?Ax(e.limiter):yx;this.listenTo(Dd.document,"scroll",(n,o)=>{const r=o.target;const s=t&&r.contains(t);const a=i&&r.contains(i);if(s||a||!t||!i){this.attachTo(e)}},{useCapture:true});this.listenTo(Dd.window,"resize",()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(Dd.document,"scroll");this.stopListening(Dd.window,"resize")}}function Ax(e){if(Gr(e)){return e}if(xh(e)){return e.commonAncestorContainer}if(typeof e=="function"){return Ax(e())}return null}xx.arrowHorizontalOffset=25;xx.arrowVerticalOffset=10;xx._getOptimalPosition=hw;xx.defaultPositions={northWestArrowSouthWest:(e,t)=>({top:Tx(e,t),left:e.left-xx.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(e,t)=>({top:Tx(e,t),left:e.left-t.width*.25-xx.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(e,t)=>({top:Tx(e,t),left:e.left-t.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(e,t)=>({top:Tx(e,t),left:e.left-t.width*.75+xx.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(e,t)=>({top:Tx(e,t),left:e.left-t.width+xx.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(e,t)=>({top:Tx(e,t),left:e.left+e.width/2-xx.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(e,t)=>({top:Tx(e,t),left:e.left+e.width/2-t.width*.25-xx.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(e,t)=>({top:Tx(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(e,t)=>({top:Tx(e,t),left:e.left+e.width/2-t.width*.75+xx.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(e,t)=>({top:Tx(e,t),left:e.left+e.width/2-t.width+xx.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(e,t)=>({top:Tx(e,t),left:e.right-xx.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(e,t)=>({top:Tx(e,t),left:e.right-t.width*.25-xx.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(e,t)=>({top:Tx(e,t),left:e.right-t.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(e,t)=>({top:Tx(e,t),left:e.right-t.width*.75+xx.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(e,t)=>({top:Tx(e,t),left:e.right-t.width+xx.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(e,t)=>({top:Cx(e,t),left:e.left-xx.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(e,t)=>({top:Cx(e,t),left:e.left-t.width*.25-xx.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(e,t)=>({top:Cx(e,t),left:e.left-t.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(e,t)=>({top:Cx(e,t),left:e.left-t.width*.75+xx.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(e,t)=>({top:Cx(e,t),left:e.left-t.width+xx.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(e,t)=>({top:Cx(e,t),left:e.left+e.width/2-xx.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(e,t)=>({top:Cx(e,t),left:e.left+e.width/2-t.width*.25-xx.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(e,t)=>({top:Cx(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(e,t)=>({top:Cx(e,t),left:e.left+e.width/2-t.width*.75+xx.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(e,t)=>({top:Cx(e,t),left:e.left+e.width/2-t.width+xx.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(e,t)=>({top:Cx(e,t),left:e.right-xx.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(e,t)=>({top:Cx(e,t),left:e.right-t.width*.25-xx.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(e,t)=>({top:Cx(e,t),left:e.right-t.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(e,t)=>({top:Cx(e,t),left:e.right-t.width*.75+xx.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(e,t)=>({top:Cx(e,t),left:e.right-t.width+xx.arrowHorizontalOffset,name:"arrow_ne"})};function Tx(e,t){return e.top-t.height-xx.arrowVerticalOffset}function Cx(e){return e.bottom+xx.arrowVerticalOffset}var Px='';const Ex="widget-type-around";function Sx(e,t,i){return e&&Lx(e)&&!i.isInline(t)}function Mx(e){return e.closest(".ck-widget__type-around__button")}function Ix(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}function Nx(e,t){const i=e.closest(".ck-widget");return t.mapDomToView(i)}function Ox(e){return e.getAttribute(Ex)}const zx="ck-widget";const Rx="ck-widget_selected";function Lx(e){if(!e.is("element")){return false}return!!e.getCustomProperty("widget")}function Dx(e,t,i={}){if(!e.is("containerElement")){throw new ss["b"]("widget-to-widget-wrong-element-type: The element passed to toWidget() must be a container element instance.",null,{element:e})}t.setAttribute("contenteditable","false",e);t.addClass(zx,e);t.setCustomProperty("widget",true,e);e.getFillerOffset=qx;if(i.label){jx(e,i.label,t)}if(i.hasSelectionHandle){$x(e,t)}Vx(e,t,(e,t,i)=>i.addClass(n(t.classes),e),(e,t,i)=>i.removeClass(n(t.classes),e));return e;function n(e){return Array.isArray(e)?e:[e]}}function Vx(e,t,i,n){const o=new px;o.on("change:top",(t,o)=>{if(o.oldDescriptor){n(e,o.oldDescriptor,o.writer)}if(o.newDescriptor){i(e,o.newDescriptor,o.writer)}});t.setCustomProperty("addHighlight",(e,t,i)=>o.add(t,i),e);t.setCustomProperty("removeHighlight",(e,t,i)=>o.remove(t,i),e)}function jx(e,t,i){i.setCustomProperty("widgetLabel",t,e)}function Bx(e){const t=e.getCustomProperty("widgetLabel");if(!t){return""}return typeof t=="function"?t():t}function Fx(e,t){t.addClass(["ck-editor__editable","ck-editor__nested-editable"],e);t.setAttribute("contenteditable",e.isReadOnly?"false":"true",e);e.on("change:isReadOnly",(i,n,o)=>{t.setAttribute("contenteditable",o?"false":"true",e)});e.on("change:isFocused",(i,n,o)=>{if(o){t.addClass("ck-editor__nested-editable_focused",e)}else{t.removeClass("ck-editor__nested-editable_focused",e)}});return e}function Hx(e,t){const i=e.getSelectedElement();if(i){const n=Ox(e);if(n){return t.createPositionAt(i,n)}if(t.schema.isBlock(i)){return t.createPositionAfter(i)}}const n=e.getSelectedBlocks().next().value;if(n){if(n.isEmpty){return t.createPositionAt(n,0)}const i=t.createPositionAfter(n);if(e.focus.isTouching(i)){return i}return t.createPositionBefore(n)}return e.focus}function Ux(e,t){return(i,n)=>{const{mapper:o,viewPosition:r}=n;const s=o.findMappedViewAncestor(r);if(!t(s)){return}const a=o.toModelElement(s);n.modelPosition=e.createPositionAt(a,r.isAtStart?"before":"after")}}function Wx(e,t){const i=new Ch(Dd.window);const n=i.getIntersection(e);const o=t.height+xx.arrowVerticalOffset;if(e.top-o>i.top||e.bottom+o{const i=t.createElement("horizontalLine");e.insertContent(i);let n=i.nextSibling;const o=n&&e.schema.checkChild(n,"$text");if(!o&&e.schema.checkChild(i.parent,"paragraph")){n=t.createElement("paragraph");e.insertContent(n,t.createPositionAfter(i))}if(n){t.setSelection(n,0)}})}}function Gx(e){const t=e.schema;const i=e.document.selection;return Kx(i,t,e)&&!Qx(i,t)}function Kx(e,t,i){const n=Jx(e,i);return t.checkChild(n,"horizontalLine")}function Qx(e,t){const i=e.getSelectedElement();return i&&t.isObject(i)}function Jx(e,t){const i=Hx(e,t);const n=i.parent;if(n.isEmpty&&!n.is("element","$root")){return n.parent}return n}var Zx=i(58);class Xx extends tk{static get pluginName(){return"HorizontalLineEditing"}init(){const e=this.editor;const t=e.model.schema;const i=e.t;const n=e.conversion;t.register("horizontalLine",{isObject:true,allowWhere:"$block"});n.for("dataDowncast").elementToElement({model:"horizontalLine",view:(e,t)=>t.createEmptyElement("hr")});n.for("editingDowncast").elementToElement({model:"horizontalLine",view:(e,t)=>{const n=i("Horizontal line");const o=t.createContainerElement("div");const r=t.createEmptyElement("hr");t.addClass("ck-horizontal-line",o);t.setCustomProperty("hr",true,o);t.insert(t.createPositionAt(o,0),r);return eA(o,t,n)}});n.for("upcast").elementToElement({view:"hr",model:"horizontalLine"});e.commands.add("horizontalLine",new Yx(e))}}function eA(e,t,i){t.setCustomProperty("horizontalLine",true,e);return Dx(e,t,{label:i})}var tA='';class iA extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add("horizontalLine",i=>{const n=e.commands.get("horizontalLine");const o=new Tw(i);o.set({label:t("Horizontal line"),icon:tA,tooltip:true});o.bind("isEnabled").to(n,"isEnabled");this.listenTo(o,"execute",()=>{e.execute("horizontalLine");e.editing.view.focus()});return o})}}class nA extends tk{static get requires(){return[Xx,iA]}static get pluginName(){return"HorizontalLine"}}class oA extends Zd{observe(e){this.listenTo(e,"load",(e,t)=>{const i=t.target;if(i.tagName=="IMG"){this._fireEvents(t)}},{useCapture:true})}_fireEvents(e){if(this.isEnabled){this.document.fire("layoutChanged");this.document.fire("imageLoaded",e)}}}function rA(e,t,i){t.setCustomProperty("image",true,e);return Dx(e,t,{label:n});function n(){const t=uA(e);const n=t.getAttribute("alt");return n?`${n} ${i}`:i}}function sA(e){return!!e.getCustomProperty("image")&&Lx(e)}function aA(e){const t=e.getSelectedElement();if(t&&sA(t)){return t}return null}function cA(e){return!!e&&e.is("element","image")}function lA(e,t,i={}){const n=e.createElement("image",i);const o=Hx(t.document.selection,t);t.insertContent(n,o);if(n.parent){e.setSelection(n,"on")}}function dA(e){const t=e.schema;const i=e.document.selection;return hA(i,t,e)&&!fA(i,t)&&mA(i)}function uA(e){const t=[];for(const i of e.getChildren()){t.push(i);if(i.is("element")){t.push(...i.getChildren())}}return t.find(e=>e.is("element","img"))}function hA(e,t,i){const n=gA(e,i);return t.checkChild(n,"image")}function fA(e,t){const i=e.getSelectedElement();return i&&t.isObject(i)}function mA(e){return[...e.focus.getAncestors()].every(e=>!e.is("element","image"))}function gA(e,t){const i=Hx(e,t);const n=i.parent;if(n.isEmpty&&!n.is("element","$root")){return n.parent}return n}function pA(){return t=>{t.on("element:figure",e)};function e(e,t,i){if(!i.consumable.test(t.viewItem,{name:true,classes:"image"})){return}const n=uA(t.viewItem);if(!n||!n.hasAttribute("src")||!i.consumable.test(n,{name:true})){return}const o=i.convertItem(n,t.modelCursor);const r=rk(o.modelRange.getItems());if(!r){return}i.convertChildren(t.viewItem,i.writer.createPositionAt(r,0));t.modelRange=o.modelRange;t.modelCursor=o.modelCursor}}function bA(){return t=>{t.on("attribute:srcset:image",e)};function e(e,t,i){if(!i.consumable.consume(t.item,e.name)){return}const n=i.writer;const o=i.mapper.toViewElement(t.item);const r=uA(o);if(t.attributeNewValue===null){const e=t.attributeOldValue;if(e.data){n.removeAttribute("srcset",r);n.removeAttribute("sizes",r);if(e.width){n.removeAttribute("width",r)}}}else{const e=t.attributeNewValue;if(e.data){n.setAttribute("srcset",e.data,r);n.setAttribute("sizes","100vw",r);if(e.width){n.setAttribute("width",e.width,r)}}}}}function wA(e){return i=>{i.on(`attribute:${e}:image`,t)};function t(e,t,i){if(!i.consumable.consume(t.item,e.name)){return}const n=i.writer;const o=i.mapper.toViewElement(t.item);const r=uA(o);n.setAttribute(t.attributeKey,t.attributeNewValue||"",r)}}class kA extends nk{refresh(){this.isEnabled=dA(this.editor.model)}execute(e){const t=this.editor.model;t.change(i=>{const n=Array.isArray(e.source)?e.source:[e.source];for(const e of n){lA(i,t,{src:e})}})}}class _A extends tk{static get pluginName(){return"ImageEditing"}init(){const e=this.editor;const t=e.model.schema;const i=e.t;const n=e.conversion;e.editing.view.addObserver(oA);t.register("image",{isObject:true,isBlock:true,allowWhere:"$block",allowAttributes:["alt","src","srcset"]});n.for("dataDowncast").elementToElement({model:"image",view:(e,t)=>vA(t)});n.for("editingDowncast").elementToElement({model:"image",view:(e,t)=>rA(vA(t),t,i("image widget"))});n.for("downcast").add(wA("src")).add(wA("alt")).add(bA());n.for("upcast").elementToElement({view:{name:"img",attributes:{src:true}},model:(e,t)=>t.createElement("image",{src:e.getAttribute("src")})}).attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:e=>{const t={data:e.getAttribute("srcset")};if(e.hasAttribute("width")){t.width=e.getAttribute("width")}return t}}}).add(pA());e.commands.add("imageInsert",new kA(e))}}function vA(e){const t=e.createEmptyElement("img");const i=e.createContainerElement("figure",{class:"image"});e.insert(e.createPositionAt(i,0),t);return i}class yA extends eh{constructor(e){super(e);this.domEventType="mousedown"}onDomEvent(e){this.fire(e.type,e)}}var xA='\n';var AA=i(60);const TA=["before","after"];const CA=(new DOMParser).parseFromString(xA,"image/svg+xml").firstChild;const PA="ck-widget__type-around_disabled";class EA extends tk{static get pluginName(){return"WidgetTypeAround"}constructor(e){super(e);this._currentFakeCaretModelElement=null}init(){const e=this.editor;const t=e.editing.view;this.on("change:isEnabled",(i,n,o)=>{t.change(e=>{for(const i of t.document.roots){if(o){e.removeClass(PA,i)}else{e.addClass(PA,i)}}});if(!o){e.model.change(e=>{e.removeSelectionAttribute(Ex)})}});this._enableTypeAroundUIInjection();this._enableInsertingParagraphsOnButtonClick();this._enableInsertingParagraphsOnEnterKeypress();this._enableInsertingParagraphsOnTypingKeystroke();this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows();this._enableDeleteIntegration();this._enableInsertContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const i=this.editor;const n=i.editing.view;i.execute("insertParagraph",{position:i.model.createPositionAt(e,t)});n.focus();n.scrollToTheSelection()}_listenToIfEnabled(e,t,i,n){this.listenTo(e,t,(...e)=>{if(this.isEnabled){i(...e)}},n)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor;const t=e.model;const i=t.document.selection;const n=Ox(i);if(!n){return false}const o=i.getSelectedElement();this._insertParagraph(o,n);return true}_enableTypeAroundUIInjection(){const e=this.editor;const t=e.model.schema;const i=e.locale.t;const n={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(e,i,o)=>{const r=o.mapper.toViewElement(i.item);if(Sx(r,i.item,t)){SA(o.writer,n,r)}},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor;const t=e.model;const i=t.document.selection;const n=t.schema;const o=e.editing.view;this._listenToIfEnabled(o.document,"keydown",(e,t)=>{if(Vl(t.keyCode)){this._handleArrowKeyPress(e,t)}},{priority:os.get("high")+10});this._listenToIfEnabled(i,"change:range",(t,i)=>{if(!i.directChange){return}e.model.change(e=>{e.removeSelectionAttribute(Ex)})});this._listenToIfEnabled(t.document,"change:data",()=>{const t=i.getSelectedElement();if(t){const i=e.editing.mapper.toViewElement(t);if(Sx(i,t,n)){return}}e.model.change(e=>{e.removeSelectionAttribute(Ex)})});this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(e,t,i)=>{const o=i.writer;if(this._currentFakeCaretModelElement){const e=i.mapper.toViewElement(this._currentFakeCaretModelElement);if(e){o.removeClass(TA.map(r),e);this._currentFakeCaretModelElement=null}}const s=t.selection.getSelectedElement();if(!s){return}const a=i.mapper.toViewElement(s);if(!Sx(a,s,n)){return}const c=Ox(t.selection);if(!c){return}o.addClass(r(c),a);this._currentFakeCaretModelElement=s});this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(t,i,n)=>{if(!n){e.model.change(e=>{e.removeSelectionAttribute(Ex)})}});function r(e){return`ck-widget_type-around_show-fake-caret_${e}`}}_handleArrowKeyPress(e,t){const i=this.editor;const n=i.model;const o=n.document.selection;const r=n.schema;const s=i.editing.view;const a=t.keyCode;const c=Bl(a,i.locale.contentLanguageDirection);const l=s.document.selection.getSelectedElement();const d=i.editing.mapper.toModelElement(l);let u;if(Sx(l,d,r)){u=this._handleArrowKeyPressOnSelectedWidget(c)}else if(o.isCollapsed){u=this._handleArrowKeyPressWhenSelectionNextToAWidget(c)}if(u){t.preventDefault();e.stop()}}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor;const i=t.model;const n=i.document.selection;const o=Ox(n);return i.change(t=>{if(o){const i=o===(e?"after":"before");if(!i){t.removeSelectionAttribute(Ex);return true}}else{t.setSelectionAttribute(Ex,e?"after":"before");return true}return false})}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor;const i=t.model;const n=i.schema;const o=t.plugins.get("Widget");const r=o._getObjectElementNextToSelection(e);const s=t.editing.mapper.toViewElement(r);if(Sx(s,r,n)){i.change(t=>{o._setSelectionOverElement(r);t.setSelectionAttribute(Ex,e?"before":"after")});return true}return false}_enableInsertingParagraphsOnButtonClick(){const e=this.editor;const t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(i,n)=>{const o=Mx(n.domTarget);if(!o){return}const r=Ix(o);const s=Nx(o,t.domConverter);const a=e.editing.mapper.toModelElement(s);this._insertParagraph(a,r);n.preventDefault();i.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor;const t=e.editing.view;this._listenToIfEnabled(t.document,"enter",(i,n)=>{const o=t.document.selection.getSelectedElement();const r=e.editing.mapper.toModelElement(o);const s=e.model.schema;let a;if(this._insertParagraphAccordingToFakeCaretPosition()){a=true}else if(Sx(o,r,s)){this._insertParagraph(r,n.isSoft?"before":"after");a=true}if(a){n.preventDefault();i.stop()}})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor;const t=e.editing.view;const i=[zl.enter,zl.delete,zl.backspace];this._listenToIfEnabled(t.document,"keydown",(e,t)=>{if(!i.includes(t.keyCode)&&!P_(t)){this._insertParagraphAccordingToFakeCaretPosition()}},{priority:os.get("high")+1})}_enableDeleteIntegration(){const e=this.editor;const t=e.editing.view;const i=e.model;const n=i.schema;this._listenToIfEnabled(t.document,"delete",(t,o)=>{const r=Ox(i.document.selection);if(!r){return}const s=o.direction;const a=i.document.selection.getSelectedElement();const c=r==="before";const l=s=="forward";const d=c===l;if(d){e.execute("delete",{selection:i.createSelection(a,"on")})}else{const t=n.getNearestSelectionRange(i.createPositionAt(a,r),s);if(t){if(!t.isCollapsed){i.change(i=>{i.setSelection(t);e.execute(l?"forwardDelete":"delete")})}else{const o=i.createSelection(t.start);i.modifySelection(o,{direction:s});if(!o.focus.isEqual(t.start)){i.change(i=>{i.setSelection(t);e.execute(l?"forwardDelete":"delete")})}else{const e=NA(n,t.start.parent);i.deleteContent(i.createSelection(e,"on"),{doNotAutoparagraph:true})}}}}o.preventDefault();t.stop()},{priority:os.get("high")+1})}_enableInsertContentIntegration(){const e=this.editor;const t=this.editor.model;const i=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(e,[n,o])=>{if(o&&!o.is("documentSelection")){return}const r=Ox(i);if(!r){return}e.stop();return t.change(e=>{const o=i.getSelectedElement();const s=t.createPositionAt(o,r);const a=e.createSelection(s);const c=t.insertContent(n,a);e.setSelection(a);return c})},{priority:"high"})}}function SA(e,t,i){const n=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(e){const i=this.toDomElement(e);MA(i,t);IA(i);return i}));e.insert(e.createPositionAt(i,"end"),n)}function MA(e,t){for(const i of TA){const n=new hb({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${i}`],title:t[i]},children:[e.ownerDocument.importNode(CA,true)]});e.appendChild(n.render())}}function IA(e){const t=new hb({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}function NA(e,t){let i=t;for(const n of t.getAncestors({parentFirst:true})){if(n.childCount>1||e.isLimit(n)){break}i=n}return i}var OA=i(62);class zA extends tk{static get pluginName(){return"Widget"}static get requires(){return[EA]}init(){const e=this.editor.editing.view;const t=e.document;this._previouslySelected=new Set;this.editor.editing.downcastDispatcher.on("selection",(e,t,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const n=i.writer;const o=n.document.selection;const r=o.getSelectedElement();let s=null;for(const e of o.getRanges()){for(const t of e){const e=t.item;if(Lx(e)&&!LA(e,s)){n.addClass(Rx,e);this._previouslySelected.add(e);s=e;if(e==r){n.setSelection(o.getRanges(),{fake:true,label:Bx(r)})}}}}},{priority:"low"});e.addObserver(yA);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:os.get("high")-20});this.listenTo(t,"delete",(e,t)=>{if(this._handleDelete(t.direction=="forward")){t.preventDefault();e.stop()}},{priority:"high"})}_onMousedown(e,t){const i=this.editor;const n=i.editing.view;const o=n.document;let r=t.target;if(RA(r)){if((Cl.isSafari||Cl.isGecko)&&t.domEvent.detail>=3){const e=i.editing.mapper;const n=r.is("attributeElement")?r.findAncestor(e=>!e.is("attributeElement")):r;const o=e.toModelElement(n);t.preventDefault();this.editor.model.change(e=>{e.setSelection(o,"in")})}return}if(!Lx(r)){r=r.findAncestor(Lx);if(!r){return}}t.preventDefault();if(!o.isFocused){n.focus()}const s=i.editing.mapper.toModelElement(r);this._setSelectionOverElement(s)}_handleSelectionChangeOnArrowKeyPress(e,t){const i=t.keyCode;if(!Vl(i)){return}const n=this.editor.model;const o=n.schema;const r=n.document.selection;const s=r.getSelectedElement();const a=Bl(i,this.editor.locale.contentLanguageDirection);if(s&&o.isObject(s)){const i=a?r.getLastPosition():r.getFirstPosition();const s=o.getNearestSelectionRange(i,a?"forward":"backward");if(s){n.change(e=>{e.setSelection(s)});t.preventDefault();e.stop()}return}if(!r.isCollapsed){return}const c=this._getObjectElementNextToSelection(a);if(c&&o.isObject(c)){this._setSelectionOverElement(c);t.preventDefault();e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const i=t.keyCode;if(!Vl(i)){return}const n=this.editor.model;const o=n.schema;const r=n.document.selection.getSelectedElement();if(r&&o.isObject(r)){t.preventDefault();e.stop()}}_handleDelete(e){if(this.editor.isReadOnly){return}const t=this.editor.model.document;const i=t.selection;if(!i.isCollapsed){return}const n=this._getObjectElementNextToSelection(e);if(n){this.editor.model.change(e=>{let t=i.anchor.parent;while(t.isEmpty){const i=t;t=i.parent;e.remove(i)}this._setSelectionOverElement(n)});return true}}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model;const i=t.schema;const n=t.document.selection;const o=t.createSelection(n);t.modifySelection(o,{direction:e?"forward":"backward"});const r=e?o.focus.nodeBefore:o.focus.nodeAfter;if(!!r&&i.isObject(r)){return r}return null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected){e.removeClass(Rx,t)}this._previouslySelected.clear()}}function RA(e){while(e){if(e.is("editableElement")&&!e.is("rootElement")){return true}if(Lx(e)){return false}e=e.parent}return false}function LA(e,t){if(!t){return false}return Array.from(e.getAncestors()).includes(t)}class DA extends nk{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=cA(e);if(cA(e)&&e.hasAttribute("alt")){this.value=e.getAttribute("alt")}else{this.value=false}}execute(e){const t=this.editor.model;const i=t.document.selection.getSelectedElement();t.change(t=>{t.setAttribute("alt",e.newValue,i)})}}class VA extends tk{static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new DA(this.editor))}}var jA=i(64);class BA extends jb{constructor(e,t){super(e);const i=`ck-labeled-field-view-${is()}`;const n=`ck-labeled-field-view-status-${is()}`;this.fieldView=t(this,i,n);this.set("label");this.set("isEnabled",true);this.set("errorText",null);this.set("infoText",null);this.set("class");this.labelView=this._createLabelView(i);this.statusView=this._createStatusView(n);this.bind("_statusText").to(this,"errorText",this,"infoText",(e,t)=>e||t);const o=this.bindTemplate;this.setTemplate({tag:"div",attributes:{tabindex: o.to( 'tabindex' ),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 Gb(this.locale);t.for=e;t.bind("text").to(this,"label");return t}_createStatusView(e){const t=new jb(this.locale);const i=this.bindTemplate;t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",e=>!e)],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]});return t}focus(){this.fieldView.focus()}}var FA=i(66);class HA extends jb{constructor(e){super(e);this.set("value");this.set("id");this.set("placeholder");this.set("isReadOnly",false);this.set("hasError",false);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",true),"aria-describedby":t.to("ariaDescribedById")},on:{input:t.to("input")}})}render(){super.render();const e=e=>{this.element.value=!e&&e!==0?"":e};e(this.value);this.on("change:value",(t,i,n)=>{e(n)})}select(){this.element.select()}focus(){this.element.focus()}}function UA(e,t,i){const n=new HA(e.locale);n.set({id:t,ariaDescribedById:i});n.bind("isReadOnly").to(e,"isEnabled",e=>!e);n.bind("hasError").to(e,"errorText",e=>!!e);n.on("input",()=>{e.errorText=null});return n}function WA(e,t,i){const n=Dw(e.locale);n.set({id:t,ariaDescribedById:i});n.bind("isEnabled").to(e);return n}function qA({view:e}){e.listenTo(e.element,"submit",(t,i)=>{i.preventDefault();e.fire("submit")},{useCapture:true})}var $A='';var YA='';var GA=i(68);class KA extends jb{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new Yp;this.keystrokes=new zp;this.labeledInput=this._createLabeledInputView();this.saveButtonView=this._createButton(t("Save"),$A,"ck-button-save");this.saveButtonView.type="submit";this.cancelButtonView=this._createButton(t("Cancel"),YA,"ck-button-cancel","cancel");this._focusables=new lb;this._focusCycler=new iw({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);qA({view:this});[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)})}_createButton(e,t,i,n){const o=new Tw(this.locale);o.set({label:e,icon:t,tooltip:true});o.extendTemplate({attributes:{class:i}});if(n){o.delegate("execute").to(this,n)}return o}_createLabeledInputView(){const e=this.locale.t;const t=new BA(this.locale,UA);t.label=e("Text alternative");t.fieldView.placeholder=e("Text alternative");return t}}var QA='';var JA='';var ZA=i(70);var XA=i(72);const eT=Zb("px");class tT extends tk{static get pluginName(){return"ContextualBalloon"}constructor(e){super(e);this.positionLimiter=()=>{const e=this.editor.editing.view;const t=e.document;const i=t.selection.editableElement;if(i){return e.domConverter.mapViewToDom(i.root)}return null};this.set("visibleView",null);this.view=new xx(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",false);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 ss["b"]("contextualballoon-add-view-exist: Cannot add configuration of the same view twice.",[this,e])}const t=e.stackId||"main";if(!this._idToStack.has(t)){this._idToStack.set(t,new Map([[e.view,e]]));this._viewToStack.set(e.view,this._idToStack.get(t));this._numberOfStacks=this._idToStack.size;if(!this._visibleStack||e.singleViewMode){this.showStack(t)}return}const i=this._idToStack.get(t);if(e.singleViewMode){this.showStack(t)}i.set(e.view,e);this._viewToStack.set(e.view,i);if(i===this._visibleStack){this._showView(e)}}remove(e){if(!this.hasView(e)){throw new ss["b"]("contextualballoon-remove-view-not-exist: Cannot remove the configuration of a non-existent view.",[this,e])}const t=this._viewToStack.get(e);if(this._singleViewMode&&this.visibleView===e){this._singleViewMode=false}if(this.visibleView===e){if(t.size===1){if(this._idToStack.size>1){this._showNextStack()}else{this.view.hide();this.visibleView=null;this._rotatorView.hideView()}}else{this._showView(Array.from(t.values())[t.size-2])}}if(t.size===1){this._idToStack.delete(this._getStackId(t));this._numberOfStacks=this._idToStack.size}else{t.delete(e)}this._viewToStack.delete(e)}updatePosition(e){if(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 ss["b"]("contextualballoon-showstack-stack-not-exist: Cannot show a stack that does not exist.",this)}if(this._visibleStack===t){return}this._showView(Array.from(t.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){const t=Array.from(this._idToStack.entries()).find(t=>t[1]===e);return t[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;if(!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;if(!e[t]){t=e.length-1}this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new iT(this.editor.locale);const t=this.editor.locale.t;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,i)=>{if(i<2){return""}const n=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[n,i])});e.buttonNextView.on("execute",()=>{if(e.focusTracker.isFocused){this.editor.editing.view.focus()}this._showNextStack()});e.buttonPrevView.on("execute",()=>{if(e.focusTracker.isFocused){this.editor.editing.view.focus()}this._showPrevStack()});return e}_createFakePanelsView(){const e=new nT(this.editor.locale,this.view);e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>{const i=!t&&e>=2;return i?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);return e}_showView({view:e,balloonClassName:t="",withArrow:i=true,singleViewMode:n=false}){this.view.class=t;this.view.withArrow=i;this._rotatorView.showView(e);this.visibleView=e;this.view.pin(this._getBalloonPosition());this._fakePanelsView.updatePosition();if(n){this._singleViewMode=true}}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;if(e&&!e.limiter){e=Object.assign({},e,{limiter:this.positionLimiter})}return e}}class iT extends jb{constructor(e){super(e);const t=e.t;const i=this.bindTemplate;this.set("isNavigationVisible",true);this.focusTracker=new Yp;this.buttonPrevView=this._createButtonView(t("Previous"),QA);this.buttonNextView=this._createButtonView(t("Next"),JA);this.content=this.createCollection();this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",e=>e?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render();this.focusTracker.add(this.element)}showView(e){this.hideView();this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const i=new Tw(this.locale);i.set({label:e,icon:t,tooltip:true});return i}}class nT extends jb{constructor(e,t){super(e);const i=this.bindTemplate;this.set("top",0);this.set("left",0);this.set("height",0);this.set("width",0);this.set("numberOfPanels",0);this.content=this.createCollection();this._balloonPanelView=t;this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",e=>e?"":"ck-hidden")],style:{top:i.to("top",eT),left:i.to("left",eT),width:i.to("width",eT),height:i.to("height",eT)}},children:this.content});this.on("change:numberOfPanels",(e,t,i,n)=>{if(i>n){this._addPanels(i-n)}else{this._removePanels(n-i)}this.updatePosition()})}_addPanels(e){while(e--){const e=new jb;e.setTemplate({tag:"div"});this.content.add(e);this.registerChild(e)}}_removePanels(e){while(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;const{width:i,height:n}=new Ch(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:n})}}}var oT='';function rT(e){const t=e.plugins.get("ContextualBalloon");if(aA(e.editing.view.document.selection)){const i=sT(e);t.updatePosition(i)}}function sT(e){const t=e.editing.view;const i=xx.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast]}}class aT extends tk{static get requires(){return[tT]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton();this._createForm()}destroy(){super.destroy();this._form.destroy()}_createButton(){const e=this.editor;const t=e.t;e.ui.componentFactory.add("imageTextAlternative",i=>{const n=e.commands.get("imageTextAlternative");const o=new Tw(i);o.set({label:t("Change image text alternative"),icon:oT,tooltip:true});o.bind("isEnabled").to(n,"isEnabled");this.listenTo(o,"execute",()=>{this._showForm()});return o})}_createForm(){const e=this.editor;const t=e.editing.view;const i=t.document;this._balloon=this.editor.plugins.get("ContextualBalloon");this._form=new KA(e.locale);this._form.render();this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value});this._hideForm(true)});this.listenTo(this._form,"cancel",()=>{this._hideForm(true)});this._form.keystrokes.set("Esc",(e,t)=>{this._hideForm(true);t()});this.listenTo(e.ui,"update",()=>{if(!aA(i.selection)){this._hideForm(true)}else if(this._isVisible){rT(e)}});zw({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible){return}const e=this.editor;const t=e.commands.get("imageTextAlternative");const i=this._form.labeledInput;if(!this._isInBalloon){this._balloon.add({view:this._form,position:sT(e)})}i.fieldView.value=i.fieldView.element.value=t.value||"";this._form.labeledInput.fieldView.select()}_hideForm(e){if(!this._isInBalloon){return}if(this._form.focusTracker.isFocused){this._form.saveButtonView.focus()}this._balloon.remove(this._form);if(e){this.editor.editing.view.focus()}}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class cT extends tk{static get requires(){return[VA,aT]}static get pluginName(){return"ImageTextAlternative"}}var lT=i(74);class dT extends tk{static get requires(){return[_A,zA,cT]}static get pluginName(){return"Image"}}function uT(e,t){return i=>{const n=i.createEditableElement("figcaption");i.setCustomProperty("imageCaption",true,n);Xp({view:e,element:n,text:t});return Fx(n,i)}}function hT(e){return!!e.getCustomProperty("imageCaption")}function fT(e){for(const t of e.getChildren()){if(!!t&&t.is("element","caption")){return t}}return null}function mT(e){const t=e.parent;if(e.name=="figcaption"&&t&&t.name=="figure"&&t.hasClass("image")){return{name:true}}return null}class gT extends tk{static get pluginName(){return"ImageCaptionEditing"}init(){const e=this.editor;const t=e.editing.view;const i=e.model.schema;const n=e.data;const o=e.editing;const r=e.t;i.register("caption",{allowIn:"image",allowContentOf:"$block",isLimit:true});e.model.document.registerPostFixer(e=>this._insertMissingModelCaptionElement(e));e.conversion.for("upcast").elementToElement({view:mT,model:"caption"});const s=e=>e.createContainerElement("figcaption");n.downcastDispatcher.on("insert:caption",pT(s,false));const a=uT(t,r("Enter image caption"));o.downcastDispatcher.on("insert:caption",pT(a));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;const i=this._lastSelectedCaption;let n;const o=this.editor.model.document.selection;const r=o.getSelectedElement();if(r&&r.is("element","image")){const e=fT(r);n=t.toViewElement(e)}const s=o.getFirstPosition();const a=wT(s.parent);if(a){n=t.toViewElement(a)}if(n){if(i){if(i===n){return _T(n,e)}else{kT(i,e);this._lastSelectedCaption=n;return _T(n,e)}}else{this._lastSelectedCaption=n;return _T(n,e)}}else{if(i){const t=kT(i,e);this._lastSelectedCaption=null;return t}else{return false}}}_fixCaptionVisibility(e){return(t,i,n)=>{const o=e(i);const r=wT(o);const s=this.editor.editing.mapper;const a=n.writer;if(r){const e=s.toViewElement(r);if(e){if(r.childCount){a.removeClass("ck-hidden",e)}else{a.addClass("ck-hidden",e)}}}}}_insertMissingModelCaptionElement(e){const t=this.editor.model;const i=t.document.differ.getChanges();const n=[];for(const e of i){if(e.type=="insert"&&e.name!="$text"){const i=e.position.nodeAfter;if(i.is("element","image")&&!fT(i)){n.push(i)}if(!i.is("element","image")&&i.childCount){for(const e of t.createRangeIn(i).getItems()){if(e.is("element","image")&&!fT(e)){n.push(e)}}}}}for(const t of n){e.appendElement("caption",t)}return!!n.length}}function pT(e,t=true){return(i,n,o)=>{const r=n.item;if(!r.childCount&&!t){return}if(cA(r.parent)){if(!o.consumable.consume(n.item,"insert")){return}const t=o.mapper.toViewElement(n.range.start.parent);const i=e(o.writer);const s=o.writer;if(!r.childCount){s.addClass("ck-hidden",i)}bT(i,n.item,t,o)}}}function bT(e,t,i,n){const o=n.writer.createPositionAt(i,"end");n.writer.insert(o,e);n.mapper.bindElements(t,e)}function wT(e){const t=e.getAncestors({includeSelf:true});const i=t.find(e=>e.name=="caption");if(i&&i.parent&&i.parent.name=="image"){return i}return null}function kT(e,t){if(!e.childCount&&!e.hasClass("ck-hidden")){t.addClass("ck-hidden",e);return true}return false}function _T(e,t){if(e.hasClass("ck-hidden")){t.removeClass("ck-hidden",e);return true}return false}var vT=i(76);class yT extends tk{static get requires(){return[gT]}static get pluginName(){return"ImageCaption"}}class xT extends nk{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=cA(e);if(!e||!e.hasAttribute("width")){this.value=null}else{this.value={width:e.getAttribute("width"),height:null}}}execute(e){const t=this.editor.model;const i=t.document.selection.getSelectedElement();this.value={width:e.width,height:null};if(i){t.change(t=>{t.setAttribute("width",e.width,i)})}}}class AT extends tk{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;const t=new xT(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:true})}_registerConverters(){const e=this.editor;e.conversion.for("downcast").add(e=>e.on("attribute:width:image",(e,t,i)=>{if(!i.consumable.consume(t.item,e.name)){return}const n=i.writer;const o=i.mapper.toViewElement(t.item);if(t.attributeNewValue!==null){n.setStyle("width",t.attributeNewValue,o);n.addClass("image_resized",o)}else{n.removeStyle("width",o);n.removeClass("image_resized",o)}}));e.conversion.for("upcast").attributeToAttribute({view:{name:"figure",styles:{width:/.+/}},model:{key:"width",value:e=>e.getStyle("width")}})}}var TT='';var CT='';var PT='';var ET='';const ST={small:TT,medium:CT,large:PT,original:ET};class MT extends tk{static get requires(){return[AT]}static get pluginName(){return"ImageResizeButtons"}constructor(e){super(e);this._resizeUnit=e.config.get("image.resizeUnit")}init(){const e=this.editor;const t=e.config.get("image.resizeOptions");const i=e.commands.get("imageResize");this.bind("isEnabled").to(i);for(const e of t){this._registerImageResizeButton(e)}this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor;const{name:i,value:n,icon:o}=e;const r=n?n+this._resizeUnit:null;t.ui.componentFactory.add(i,n=>{const s=new Tw(n);const a=t.commands.get("imageResize");const c=this._getOptionLabelValue(e,true);if(!ST[o]){throw new ss["b"]("imageresizebuttons-missing-icon: "+'The resize option "'+i+'" misses the "icon" property '+"or the property value doesn't match any of available icons.",t,e)}s.set({label:c,icon:ST[o],tooltip:c,isToggleable:true});s.bind("isEnabled").to(this);s.bind("isOn").to(a,"value",IT(r));this.listenTo(s,"execute",()=>{t.execute("imageResize",{width:r})});return s})}_registerImageResizeDropdown(e){const t=this.editor;const i=t.t;const n=e.find(e=>!e.value);t.ui.componentFactory.add("imageResize",o=>{const r=t.commands.get("imageResize");const s=Dw(o,Pw);const a=s.buttonView;a.set({tooltip:i("Resize image"),commandValue:n.value,icon:CT,isToggleable:true,label:this._getOptionLabelValue(n),withText:true,class:"ck-resize-image-button"});a.bind("label").to(r,"value",e=>{if(e&&e.width){return e.width}else{return this._getOptionLabelValue(n)}});s.bind("isOn").to(r);s.bind("isEnabled").to(this);jw(s,this._getResizeDropdownListItemDefinitions(e,r));s.listView.ariaLabel=i("Image resize list");this.listenTo(s,"execute",e=>{t.execute(e.source.commandName,{width:e.source.commandValue});t.editing.view.focus()});return s})}_getOptionLabelValue(e,t){const i=this.editor.t;if(e.label){return e.label}else if(t){if(e.value){return i("Resize image to %0",e.value+this._resizeUnit)}else{return i("Resize image to the original size")}}else{if(e.value){return e.value+this._resizeUnit}else{return i("Original")}}}_getResizeDropdownListItemDefinitions(e,t){const i=new xs;e.map(e=>{const n=e.value?e.value+this._resizeUnit:null;const o={type:"button",model:new Ay({commandName:"imageResize",commandValue:n,label:this._getOptionLabelValue(e),withText:true,icon:null})};o.model.bind("isOn").to(t,"value",IT(n));i.add(o)});return i}}function IT(e){return t=>{if(e===null&&t===e){return true}return t&&t.width===e}}class NT{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,i){const n=new Ch(t);this.activeHandlePosition=LT(e);this._referenceCoordinates=zT(t,DT(this.activeHandlePosition));this.originalWidth=n.width;this.originalHeight=n.height;this.aspectRatio=n.width/n.height;const o=i.style.width;if(o&&o.match(/^\d+\.?\d*%$/)){this.originalWidthPercents=parseFloat(o)}else{this.originalWidthPercents=OT(i,n)}}update(e){this.proposedWidth=e.width;this.proposedHeight=e.height;this.proposedWidthPercents=e.widthPercents;this.proposedHandleHostWidth=e.handleHostWidth;this.proposedHandleHostHeight=e.handleHostHeight}}ys(NT,Qc);function OT(e,t){const i=e.parentElement;const n=parseFloat(i.ownerDocument.defaultView.getComputedStyle(i).width);return t.width/n*100}function zT(e,t){const i=new Ch(e);const n=t.split("-");const o={x:n[1]=="right"?i.right:i.left,y:n[0]=="bottom"?i.bottom:i.top};o.x+=e.ownerDocument.defaultView.scrollX;o.y+=e.ownerDocument.defaultView.scrollY;return o}function RT(e){return`ck-widget__resizer__handle-${e}`}function LT(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const i of t){if(e.classList.contains(RT(i))){return i}}}function DT(e){const t=e.split("-");const i={top:"bottom",bottom:"top",left:"right",right:"left"};return`${i[t[0]]}-${i[t[1]]}`}class VT{constructor(e){this._options=e;this._domResizerWrapper=null;this._viewResizerWrapper=null;this.set("isEnabled",true);this.decorate("begin");this.decorate("cancel");this.decorate("commit");this.decorate("updateSize");this.on("commit",e=>{if(!this.state.proposedWidth&&!this.state.proposedWidthPercents){this._cleanup();e.stop()}},{priority:"high"});this.on("change:isEnabled",()=>{if(this.isEnabled){this.redraw()}})}attach(){const e=this;const t=this._options.viewElement;const i=this._options.editor.editing.view;i.change(i=>{const n=i.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(t){const i=this.toDomElement(t);e._appendHandles(i);e._appendSizeUI(i);e._domResizerWrapper=i;e.on("change:isEnabled",(e,t,n)=>{i.style.display=n?"":"none"});i.style.display=e.isEnabled?"":"none";return i}));i.insert(i.createPositionAt(t,"end"),n);i.addClass("ck-widget_with-resizer",t);this._viewResizerWrapper=n})}begin(e){this.state=new NT(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);const i=this._options.editor.editing.view;i.change(e=>{const i=this._options.unit||"%";const n=(i==="%"?t.widthPercents:t.width)+i;e.setStyle("width",n,this._options.viewElement)});const n=this._getHandleHost();const o=new Ch(n);t.handleHostWidth=Math.round(o.width);t.handleHostHeight=Math.round(o.height);const r=new Ch(n);t.width=Math.round(r.width);t.height=Math.round(r.height);this.redraw(o);this.state.update(t)}commit(){const e=this._options.unit||"%";const 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(!HT(t)){return}const i=t.parentElement;const n=this._getHandleHost();const o=this._viewResizerWrapper;const r=[o.getStyle("width"),o.getStyle("height"),o.getStyle("left"),o.getStyle("top")];let s;if(i.isSameNode(n)){const t=e||new Ch(n);s=[t.width+"px",t.height+"px",undefined,undefined]}else{s=[n.offsetWidth+"px",n.offsetHeight+"px",n.offsetLeft+"px",n.offsetTop+"px"]}if(Rs(r,s)!=="same"){this._options.editor.editing.view.change(e=>{e.setStyle({width:s[0],height:s[1],left:s[2],top:s[3]},o)})}}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=false;const e=this._options.editor.editing.view;e.change(e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const t=this.state;const i=FT(e);const n=this._options.isCentered?this._options.isCentered(this):true;const o={x:t._referenceCoordinates.x-(i.x+t.originalWidth),y:i.y-t.originalHeight-t._referenceCoordinates.y};if(n&&t.activeHandlePosition.endsWith("-right")){o.x=i.x-(t._referenceCoordinates.x+t.originalWidth)}if(n){o.x*=2}const r={width:Math.abs(t.originalWidth+o.x),height:Math.abs(t.originalHeight+o.y)};r.dominant=r.width/t.aspectRatio>r.height?"width":"height";r.max=r[r.dominant];const s={width:r.width,height:r.height};if(r.dominant=="width"){s.height=s.width/t.aspectRatio}else{s.width=s.height*t.aspectRatio}return{width:Math.round(s.width),height:Math.round(s.height),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*s.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 hb({tag:"div",attributes:{class:`ck-widget__resizer__handle ${BT(i)}`}}).render())}}_appendSizeUI(e){const t=new jT;t.render();this._sizeUI=t;e.appendChild(t.element)}}ys(VT,Qc);class jT extends jb{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)=>e!==null&&t!==null);this.bind("label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",(t,i,n)=>{if(e.unit==="px"){return`${t}×${i}`}else{return`${n}%`}});this.bind("activeHandlePosition").to(t)}dismiss(){this.unbind();this.isVisible=false}}function BT(e){return`ck-widget__resizer__handle-${e}`}function FT(e){return{x:e.pageX,y:e.pageY}}function HT(e){return e&&e.ownerDocument&&e.ownerDocument.contains(e)}var UT="Expected a function";function WT(e,t,i){var n=true,o=true;if(typeof e!="function"){throw new TypeError(UT)}if(ce(i)){n="leading"in i?!!i.leading:n;o="trailing"in i?!!i.trailing:o}return ph(e,t,{leading:n,maxWait:t,trailing:o})}var qT=WT;var $T=i(78);class YT extends tk{static get pluginName(){return"WidgetResize"}init(){this.set("_visibleResizer",null);this.set("_activeResizer",null);this._resizers=new Map;const e=Dd.window.document;this.editor.model.schema.setAttributeProperties("width",{isFormatting:true});this.editor.editing.view.addObserver(yA);this._observer=Object.create(Kd);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=()=>{if(this._visibleResizer){this._visibleResizer.redraw()}};const i=qT(t,200);this.on("change:_visibleResizer",t);this.editor.ui.on("update",i);this._observer.listenTo(Dd.window,"resize",i);const n=this.editor.editing.view.document.selection;n.on("change",()=>{const e=n.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 VT(e);const i=this.editor.plugins;t.attach();if(i.has("WidgetToolbarRepository")){const e=i.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"})}this._resizers.set(e.viewElement,t);return 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 i=t.domTarget;if(!VT.isResizeHandle(i)){return}this._activeResizer=this._getResizerByHandle(i);if(this._activeResizer){this._activeResizer.begin(i);e.stop();t.preventDefault()}}_mouseMoveListener(e,t){if(this._activeResizer){this._activeResizer.updateSize(t)}}_mouseUpListener(){if(this._activeResizer){this._activeResizer.commit();this._activeResizer=null}}}ys(YT,Qc);class GT extends tk{static get requires(){return[YT]}static get pluginName(){return"ImageResizeHandles"}init(){const e=this.editor;const t=e.commands.get("imageResize");this.bind("isEnabled").to(t);e.editing.downcastDispatcher.on("insert:image",(t,i,n)=>{const o=n.mapper.toViewElement(i.item);const r=e.plugins.get(YT).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:i.item,viewElement:o,editor:e,getHandleHost(e){return e.querySelector("img")},getResizeHost(e){return e},isCentered(){const e=i.item.getAttribute("imageStyle");return!e||e=="full"||e=="alignCenter"},onCommit(t){e.execute("imageResize",{width:t})}});r.on("updateSize",()=>{if(!o.hasClass("image_resized")){e.editing.view.change(e=>{e.addClass("image_resized",o)})}});r.bind("isEnabled").to(this)},{priority:"low"})}}var KT=i(80);class QT extends tk{static get requires(){return[AT,GT,MT]}static get pluginName(){return"ImageResize"}}class JT extends nk{constructor(e,t){super(e);this.defaultStyle=false;this.styles=t.reduce((e,t)=>{e[t.name]=t;if(t.isDefault){this.defaultStyle=t.name}return e},{})}refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=cA(e);if(!e){this.value=false}else if(e.hasAttribute("imageStyle")){const t=e.getAttribute("imageStyle");this.value=this.styles[t]?t:false}else{this.value=this.defaultStyle}}execute(e){const t=e.value;const i=this.editor.model;const n=i.document.selection.getSelectedElement();i.change(e=>{if(this.styles[t].isDefault){e.removeAttribute("imageStyle",n)}else{e.setAttribute("imageStyle",t,n)}})}}function ZT(e){return(t,i,n)=>{if(!n.consumable.consume(i.item,t.name)){return}const o=eC(i.attributeNewValue,e);const r=eC(i.attributeOldValue,e);const s=n.mapper.toViewElement(i.item);const a=n.writer;if(r){a.removeClass(r.className,s)}if(o){a.addClass(o.className,s)}}}function XT(e){const t=e.filter(e=>!e.isDefault);return(e,i,n)=>{if(!i.modelRange){return}const o=i.viewItem;const r=rk(i.modelRange.getItems());if(!n.schema.checkAttribute(r,"imageStyle")){return}for(const e of t){if(n.consumable.consume(o,{classes:e.className})){n.writer.setAttribute("imageStyle",e.name,r)}}}}function eC(e,t){for(const i of t){if(i.name===e){return i}}}var tC='';var iC='';var nC='';var oC='';const rC={full:{name:"full",title:"Full size image",icon:tC,isDefault:true},side:{name:"side",title:"Side image",icon:oC,className:"image-style-side"},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:iC,className:"image-style-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:nC,className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:oC,className:"image-style-align-right"}};const sC={full:tC,left:iC,right:oC,center:nC};function aC(e=[]){return e.map(cC)}function cC(e){if(typeof e=="string"){const t=e;if(rC[t]){e=Object.assign({},rC[t])}else{console.warn(Object(ss["a"])("image-style-not-found: There is no such image style of given name."),{name:t});e={name:t}}}else if(rC[e.name]){const t=rC[e.name];const i=Object.assign({},e);for(const n in t){if(!Object.prototype.hasOwnProperty.call(e,n)){i[n]=t[n]}}e=i}if(typeof e.icon=="string"&&sC[e.icon]){e.icon=sC[e.icon]}return e}class lC extends tk{static get pluginName(){return"ImageStyleEditing"}init(){const e=this.editor;const t=e.model.schema;const i=e.data;const n=e.editing;e.config.define("image.styles",["full","side"]);const o=aC(e.config.get("image.styles"));t.extend("image",{allowAttributes:"imageStyle"});const r=ZT(o);n.downcastDispatcher.on("attribute:imageStyle:image",r);i.downcastDispatcher.on("attribute:imageStyle:image",r);i.upcastDispatcher.on("element:figure",XT(o),{priority:"low"});e.commands.add("imageStyle",new JT(e,o))}}var dC=i(82);class uC extends tk{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=this.editor;const t=e.config.get("image.styles");const i=hC(aC(t),this.localizedDefaultStylesTitles);for(const e of i){this._createButton(e)}}_createButton(e){const t=this.editor;const i=`imageStyle:${e.name}`;t.ui.componentFactory.add(i,i=>{const n=t.commands.get("imageStyle");const o=new Tw(i);o.set({label:e.title,icon:e.icon,tooltip:true,isToggleable:true});o.bind("isEnabled").to(n,"isEnabled");o.bind("isOn").to(n,"value",t=>t===e.name);this.listenTo(o,"execute",()=>{t.execute("imageStyle",{value:e.name});t.editing.view.focus()});return o})}}function hC(e,t){for(const i of e){if(t[i.title]){i.title=t[i.title]}}return e}class fC extends tk{static get requires(){return[lC,uC]}static get pluginName(){return"ImageStyle"}}class mC extends tk{static get requires(){return[tT]}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=>{if(bC(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:i,getRelatedElement:n,balloonClassName:o="ck-toolbar-container"}){if(!i.length){console.warn(Object(ss["a"])("widget-toolbar-no-items: Trying to register a toolbar without items."),{toolbarId:e});return}const r=this.editor;const s=r.t;const a=new $w(r.locale);a.ariaLabel=t||s("Widget toolbar");if(this._toolbarDefinitions.has(e)){throw new ss["b"]("widget-toolbar-duplicated: Toolbar with the given id was already added.",this,{toolbarId:e})}a.fillFromConfig(i,r.ui.componentFactory);this._toolbarDefinitions.set(e,{view:a,getRelatedElement:n,balloonClassName:o})}_updateToolbarsVisibility(){let e=0;let t=null;let i=null;for(const n of this._toolbarDefinitions.values()){const o=n.getRelatedElement(this.editor.editing.view.document.selection);if(!this.isEnabled||!o){if(this._isToolbarInBalloon(n)){this._hideToolbar(n)}}else if(!this.editor.ui.focusTracker.isFocused){if(this._isToolbarVisible(n)){this._hideToolbar(n)}}else{const r=o.getAncestors().length;if(r>e){e=r;t=o;i=n}}}if(i){this._showToolbar(i,t)}}_hideToolbar(e){this._balloon.remove(e.view);this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){if(this._isToolbarVisible(e)){gC(this.editor,t)}else if(!this._isToolbarInBalloon(e)){this._balloon.add({view:e.view,position:pC(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);gC(this.editor,t)}}})}}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function gC(e,t){const i=e.plugins.get("ContextualBalloon");const n=pC(e,t);i.updatePosition(n)}function pC(e,t){const i=e.editing.view;const n=xx.defaultPositions;return{target:i.domConverter.mapViewToDom(t),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,Wx]}}function bC(e){const t=e.getSelectedElement();return!!(t&&Lx(t))}class wC extends tk{static get requires(){return[mC]}static get pluginName(){return"ImageToolbar"}afterInit(){const e=this.editor;const t=e.t;const i=e.plugins.get(mC);i.register("image",{ariaLabel:t("Image toolbar"),items:e.config.get("image.toolbar")||[],getRelatedElement:aA})}}class kC extends jb{constructor(e){super(e);this.buttonView=new Tw(e);this._fileInputView=new _C(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 _C extends jb{constructor(e){super(e);this.set("acceptedType");this.set("allowMultipleFiles",false);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(()=>{if(this.element&&this.element.files&&this.element.files.length){this.fire("done",this.element.files)}this.element.value=""})}})}open(){this.element.click()}}var vC='';function yC(e){const t=e.map(e=>e.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}function xC(e){return new Promise((t,i)=>{const n=e.getAttribute("src");fetch(n).then(e=>e.blob()).then(e=>{const i=TC(e,n);const o=i.replace("image/","");const r=`image.${o}`;const s=new File([e],r,{type:i});t(s)}).catch(i)})}function AC(e){if(!e.is("element","img")||!e.getAttribute("src")){return false}return e.getAttribute("src").match(/^data:image\/\w+;base64,/g)||e.getAttribute("src").match(/^blob:/g)}function TC(e,t){if(e.type){return e.type}else if(t.match(/data:(image\/\w+);base64/)){return t.match(/data:(image\/\w+);base64/)[1].toLowerCase()}else{return"image/jpeg"}}class CC extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add("imageUpload",i=>{const n=new kC(i);const o=e.commands.get("imageUpload");const r=e.config.get("image.upload.types");const s=yC(r);n.set({acceptedType:r.map(e=>`image/${e}`).join(","),allowMultipleFiles:true});n.buttonView.set({label:t("Insert image"),icon:vC,tooltip:true});n.buttonView.bind("isEnabled").to(o);n.on("done",(t,i)=>{const n=Array.from(i).filter(e=>s.test(e.type));if(n.length){e.execute("imageUpload",{file:n})}});return n})}}class PC{constructor(e){this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return true}}ys(PC,Qc);class EC extends PC{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",false);this._actions=new xs({idProperty:"_id"});this._actions.delegate("add","remove").to(this)}add(e){if(typeof e!=="string"){throw new ss["b"]("pendingactions-add-invalid-message: The message must be a string.",this)}const t=Object.create(Qc);t.set("message",e);this._actions.add(t);this.hasAny=true;return 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 SC{constructor(){const e=new window.FileReader;this._reader=e;this._data=undefined;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;this.total=e.size;return new Promise((i,n)=>{t.onload=()=>{const e=t.result;this._data=e;i(e)};t.onerror=()=>{n("error")};t.onabort=()=>{n("aborted")};this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}ys(SC,Qc);class MC extends tk{static get pluginName(){return"FileRepository"}static get requires(){return[EC]}init(){this.loaders=new xs;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){console.warn(Object(ss["a"])("filerepository-no-upload-adapter: Upload adapter is not defined."));return null}const t=new IC(Promise.resolve(e),this.createUploadAdapter);this.loaders.add(t);this._loadersMap.set(e,t);if(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){if(t.uploadTotal){e+=t.uploadTotal}}this.uploadTotal=e});return t}destroyLoader(e){const t=e instanceof IC?e:this.getLoader(e);t._destroy();this.loaders.remove(t);this._loadersMap.forEach((e,i)=>{if(e===t){this._loadersMap.delete(i)}})}_updatePendingAction(){const e=this.editor.plugins.get(EC);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t;const i=e=>`${t("Upload in progress")} ${parseInt(e)}%.`;this._pendingAction=e.add(i(this.uploadedPercent));this._pendingAction.bind("message").to(this,"uploadedPercent",i)}}else{e.remove(this._pendingAction);this._pendingAction=null}}}ys(MC,Qc);class IC{constructor(e,t){this.id=is();this._filePromiseWrapper=this._createFilePromiseWrapper(e);this._adapter=t(this);this._reader=new SC;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(){if(!this._filePromiseWrapper){return Promise.resolve(null)}else{return this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null)}}get data(){return this._reader.data}read(){if(this.status!="idle"){throw new ss["b"]("filerepository-read-wrong-status: You cannot call read if the status is different than idle.",this)}this.status="reading";return this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!=="reading"){throw this.status}this.status="idle";return e}).catch(e=>{if(e==="aborted"){this.status="aborted";throw"aborted"}this.status="error";throw this._reader.error?this._reader.error:e})}upload(){if(this.status!="idle"){throw new ss["b"]("filerepository-upload-wrong-status: You cannot call upload if the status is different than idle.",this)}this.status="uploading";return this.file.then(()=>this._adapter.upload()).then(e=>{this.uploadResponse=e;this.status="idle";return e}).catch(e=>{if(this.status==="aborted"){throw"aborted"}this.status="error";throw e})}abort(){const e=this.status;this.status="aborted";if(!this._filePromiseWrapper.isFulfilled){this._filePromiseWrapper.promise.catch(()=>{});this._filePromiseWrapper.rejecter("aborted")}else if(e=="reading"){this._reader.abort()}else if(e=="uploading"&&this._adapter.abort){this._adapter.abort()}this._destroy()}_destroy(){this._filePromiseWrapper=undefined;this._reader=undefined;this._adapter=undefined;this.uploadResponse=undefined}_createFilePromiseWrapper(e){const t={};t.promise=new Promise((i,n)=>{t.rejecter=n;t.isFulfilled=false;e.then(e=>{t.isFulfilled=true;i(e)}).catch(e=>{t.isFulfilled=true;n(e)})});return t}}ys(IC,Qc);var NC='';var OC=i(84);var zC=i(86);var RC=i(88);class LC extends tk{constructor(e){super(e);this.placeholder="data:image/svg+xml;utf8,"+encodeURIComponent(NC)}init(){const e=this.editor;e.editing.downcastDispatcher.on("attribute:uploadStatus:image",(...e)=>this.uploadStatusChange(...e))}uploadStatusChange(e,t,i){const n=this.editor;const o=t.item;const r=o.getAttribute("uploadId");if(!i.consumable.consume(t.item,e.name)){return}const s=n.plugins.get(MC);const a=r?t.attributeNewValue:null;const c=this.placeholder;const l=n.editing.mapper.toViewElement(o);const d=i.writer;if(a=="reading"){DC(l,d);jC(c,l,d);return}if(a=="uploading"){const e=s.loaders.get(r);DC(l,d);if(!e){jC(c,l,d)}else{BC(l,d);FC(l,d,e,n.editing.view);GC(l,d,e)}return}if(a=="complete"&&s.loaders.get(r)){UC(l,d,n.editing.view)}HC(l,d);BC(l,d);VC(l,d)}}function DC(e,t){if(!e.hasClass("ck-appear")){t.addClass("ck-appear",e)}}function VC(e,t){t.removeClass("ck-appear",e)}function jC(e,t,i){if(!t.hasClass("ck-image-upload-placeholder")){i.addClass("ck-image-upload-placeholder",t)}const n=uA(t);if(n.getAttribute("src")!==e){i.setAttribute("src",e,n)}if(!$C(t,"placeholder")){i.insert(i.createPositionAfter(n),qC(i))}}function BC(e,t){if(e.hasClass("ck-image-upload-placeholder")){t.removeClass("ck-image-upload-placeholder",e)}YC(e,t,"placeholder")}function FC(e,t,i,n){const o=WC(t);t.insert(t.createPositionAt(e,"end"),o);i.on("change:uploadedPercent",(e,t,i)=>{n.change(e=>{e.setStyle("width",i+"%",o)})})}function HC(e,t){YC(e,t,"progressBar")}function UC(e,t,i){const n=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),n);setTimeout(()=>{i.change(e=>e.remove(e.createRangeOn(n)))},3e3)}function WC(e){const t=e.createUIElement("div",{class:"ck-progress-bar"});e.setCustomProperty("progressBar",true,t);return t}function qC(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});e.setCustomProperty("placeholder",true,t);return t}function $C(e,t){for(const i of e.getChildren()){if(i.getCustomProperty(t)){return i}}}function YC(e,t,i){const n=$C(e,i);if(n){t.remove(t.createRangeOn(n))}}function GC(e,t,i){if(i.data){const n=uA(e);t.setAttribute("src",i.data,n)}}class KC extends PC{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 QC{constructor(e){this.document=e}createDocumentFragment(e){return new Kl(this.document,e)}createElement(e,t,i){return new Vc(this.document,e,t,i)}createText(e){return new Bs(this.document,e)}clone(e,t=false){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,i){return i._insertChild(e,t)}removeChildren(e,t,i){return i._removeChildren(e,t)}remove(e){const t=e.parent;if(t){return this.removeChildren(t.getChildIndex(e),1,t)}return[]}replace(e,t){const i=e.parent;if(i){const n=i.getChildIndex(e);this.removeChildren(n,1,i);this.insertChild(n,t,i);return true}return false}unwrapElement(e){const t=e.parent;if(t){const i=t.getChildIndex(e);this.remove(e);this.insertChild(i,e.getChildren(),t)}}rename(e,t){const i=new Vc(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,i)?i:null}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){if(z(e)&&i===undefined){i=t}i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return ul._createAt(e,t)}createPositionAfter(e){return ul._createAfter(e)}createPositionBefore(e){return ul._createBefore(e)}createRange(e,t){return new hl(e,t)}createRangeOn(e){return hl._createOn(e)}createRangeIn(e){return hl._createIn(e)}createSelection(e,t,i){return new gl(e,t,i)}}class JC extends nk{refresh(){this.isEnabled=dA(this.editor.model)}execute(e){const t=this.editor;const i=t.model;const n=t.plugins.get(MC);i.change(t=>{const o=Array.isArray(e.file)?e.file:[e.file];for(const e of o){ZC(t,i,n,e)}})}}function ZC(e,t,i,n){const o=i.createLoader(n);if(!o){return}lA(e,t,{uploadId:o.id})}class XC extends tk{static get requires(){return[MC,KC,n_]}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;const t=e.model.document;const i=e.model.schema;const n=e.conversion;const o=e.plugins.get(MC);const r=yC(e.config.get("image.upload.types"));i.extend("image",{allowAttributes:["uploadId","uploadStatus"]});e.commands.add("imageUpload",new JC(e));n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"});this.listenTo(e.editing.view.document,"clipboardInput",(t,i)=>{if(eP(i.dataTransfer)){return}const n=Array.from(i.dataTransfer.files).filter(e=>{if(!e){return false}return r.test(e.type)});const o=i.targetRanges.map(t=>e.editing.mapper.toModelRange(t));e.model.change(i=>{i.setSelection(o);if(n.length){t.stop();e.model.enqueueChange("default",()=>{e.execute("imageUpload",{file:n})})}})});this.listenTo(e.plugins.get(n_),"inputTransformation",(t,i)=>{const n=Array.from(e.editing.view.createRangeIn(i.content)).filter(e=>AC(e.item)&&!e.item.getAttribute("uploadProcessed")).map(e=>({promise:xC(e.item),imageElement:e.item}));if(!n.length){return}const r=new QC(e.editing.view.document);for(const e of n){r.setAttribute("uploadProcessed",true,e.imageElement);const t=o.createLoader(e.promise);if(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 i=t.differ.getChanges({includeChangesInGraveyard:true});for(const t of i){if(t.type=="insert"&&t.name!="$text"){const i=t.position.nodeAfter;const n=t.position.root.rootName=="$graveyard";for(const t of tP(e,i)){const e=t.getAttribute("uploadId");if(!e){continue}const i=o.loaders.get(e);if(!i){continue}if(n){i.abort()}else if(i.status=="idle"){this._readAndUpload(i,t)}}}}})}_readAndUpload(e,t){const i=this.editor;const n=i.model;const o=i.locale.t;const r=i.plugins.get(MC);const s=i.plugins.get(KC);n.enqueueChange("transparent",e=>{e.setAttribute("uploadStatus","reading",t)});return e.read().then(()=>{const o=e.upload();if(Cl.isSafari){const e=i.editing.mapper.toViewElement(t);const n=uA(e);i.editing.view.once("render",()=>{if(!n.parent){return}const e=i.editing.view.domConverter.mapViewToDom(n.parent);if(!e){return}const t=e.style.display;e.style.display="none";e._ckHack=e.offsetHeight;e.style.display=t})}n.enqueueChange("transparent",e=>{e.setAttribute("uploadStatus","uploading",t)});return o}).then(e=>{n.enqueueChange("transparent",i=>{i.setAttributes({uploadStatus:"complete",src:e.default},t);this._parseAndSetSrcsetAttributeOnImage(e,t,i)});a()}).catch(i=>{if(e.status!=="error"&&e.status!=="aborted"){throw i}if(e.status=="error"&&i){s.showWarning(i,{title:o("Upload failed"),namespace:"upload"})}a();n.enqueueChange("transparent",e=>{e.remove(t)})});function a(){n.enqueueChange("transparent",e=>{e.removeAttribute("uploadId",t);e.removeAttribute("uploadStatus",t)});r.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,i){let n=0;const o=Object.keys(e).filter(e=>{const t=parseInt(e,10);if(!isNaN(t)){n=Math.max(n,t);return true}}).map(t=>`${e[t]} ${t}w`).join(", ");if(o!=""){i.setAttribute("srcset",{data:o,width:n},t)}}}function eP(e){return Array.from(e.types).includes("text/html")&&e.getData("text/html")!==""}function tP(e,t){return Array.from(e.model.createRangeOn(t)).filter(e=>e.item.is("element","image")).map(e=>e.item)}class iP extends tk{static get pluginName(){return"ImageUpload"}static get requires(){return[XC,CC,LC]}}const nP="italic";class oP extends tk{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:nP});e.model.schema.setAttributeProperties(nP,{isFormatting:true,copyOnEnter:true});e.conversion.attributeToElement({model:nP,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]});e.commands.add(nP,new Hk(e,nP));e.keystrokes.set("CTRL+I",nP)}}var rP='';const sP="italic";class aP extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(sP,i=>{const n=e.commands.get(sP);const o=new Tw(i);o.set({label:t("Italic"),icon:rP,keystroke:"CTRL+I",tooltip:true,isToggleable:true});o.bind("isOn","isEnabled").to(n,"value","isEnabled");this.listenTo(o,"execute",()=>{e.execute(sP);e.editing.view.focus()});return o})}}class cP extends tk{static get requires(){return[oP,aP]}static get pluginName(){return"Italic"}}class lP extends tk{static get pluginName(){return"TwoStepCaretMovement"}constructor(e){super(e);this.attributes=new Set;this._overrideUid=null}init(){const e=this.editor;const t=e.model;const i=e.editing.view;const n=e.locale;const o=t.document.selection;this.listenTo(i.document,"keydown",(e,t)=>{if(!o.isCollapsed){return}if(t.shiftKey||t.altKey||t.ctrlKey){return}const i=t.keyCode==zl.arrowright;const r=t.keyCode==zl.arrowleft;if(!i&&!r){return}const s=n.contentLanguageDirection;let a=false;if(s==="ltr"&&i||s==="rtl"&&r){a=this._handleForwardMovement(t)}else{a=this._handleBackwardMovement(t)}if(a===true){e.stop()}},{priority:os.get("high")+1});this._isNextGravityRestorationSkipped=false;this.listenTo(o,"change:range",(e,t)=>{if(this._isNextGravityRestorationSkipped){this._isNextGravityRestorationSkipped=false;return}if(!this._isGravityOverridden){return}if(!t.directChange&&mP(o.getFirstPosition(),this.attributes)){return}this._restoreGravity()})}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes;const i=this.editor.model;const n=i.document.selection;const o=n.getFirstPosition();if(this._isGravityOverridden){return false}if(o.isAtStart&&dP(n,t)){return false}if(mP(o,t)){hP(e);this._overrideGravity();return true}}_handleBackwardMovement(e){const t=this.attributes;const i=this.editor.model;const n=i.document.selection;const o=n.getFirstPosition();if(this._isGravityOverridden){hP(e);this._restoreGravity();uP(i,t,o);return true}else{if(o.isAtStart){if(dP(n,t)){hP(e);uP(i,t,o);return true}return false}if(fP(o,t)){if(o.isAtEnd&&!dP(n,t)&&mP(o,t)){hP(e);uP(i,t,o);return true}this._isNextGravityRestorationSkipped=true;this._overrideGravity();return false}}}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 dP(e,t){for(const i of t){if(e.hasAttribute(i)){return true}}return false}function uP(e,t,i){const n=i.nodeBefore;e.change(e=>{if(n){e.setSelectionAttribute(n.getAttributes())}else{e.removeSelectionAttribute(t)}})}function hP(e){e.preventDefault()}function fP(e,t){const i=e.getShiftedBy(-1);return mP(i,t)}function mP(e,t){const{nodeBefore:i,nodeAfter:n}=e;for(const e of t){const t=i?i.getAttribute(e):undefined;const o=n?n.getAttribute(e):undefined;if(o!==t){return true}}return false}function gP(e,t,i,n){return n.createRange(pP(e,t,i,true,n),pP(e,t,i,false,n))}function pP(e,t,i,n,o){let r=e.textNode||(n?e.nodeBefore:e.nodeAfter);let s=null;while(r&&r.getAttribute(t)==i){s=r;r=n?r.previousSibling:r.nextSibling}return s?o.createPositionAt(s,n?"before":"after"):e}function bP(e,t,i,n){const o=e.editing.view;const r=new Set;o.document.registerPostFixer(o=>{const s=e.model.document.selection;let a=false;if(s.hasAttribute(t)){const c=gP(s.getFirstPosition(),t,s.getAttribute(t),e.model);const l=e.editing.mapper.toViewRange(c);for(const e of l.getItems()){if(e.is("element",i)&&!e.hasClass(n)){o.addClass(n,e);r.add(e);a=true}}}return a});e.conversion.for("editingDowncast").add(e=>{e.on("insert",t,{priority:"highest"});e.on("remove",t,{priority:"highest"});e.on("attribute",t,{priority:"highest"});e.on("selection",t,{priority:"highest"});function t(){o.change(e=>{for(const t of r.values()){e.removeClass(n,t);r.delete(t)}})}})}class wP{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){if(Array.isArray(e)){e.forEach(e=>this._definitions.add(e))}else{this._definitions.add(e)}}getDispatcher(){return e=>{e.on("attribute:linkHref",(e,t,i)=>{if(!i.consumable.test(t.item,"attribute:linkHref")){return}const n=i.writer;const o=n.document.selection;for(const e of this._definitions){const r=n.createAttributeElement("a",e.attributes,{priority:5});n.setCustomProperty("link",true,r);if(e.callback(t.attributeNewValue)){if(t.item.is("selection")){n.wrap(o.getFirstRange(),r)}else{n.wrap(i.mapper.toViewRange(t.range),r)}}else{n.unwrap(i.mapper.toViewRange(t.range),r)}}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:image",(e,t,i)=>{const n=i.mapper.toViewElement(t.item);const o=Array.from(n.getChildren()).find(e=>e.name==="a");for(const e of this._definitions){const n=Us(e.attributes);if(e.callback(t.attributeNewValue)){for(const[e,t]of n){if(e==="class"){i.writer.addClass(t,o)}else{i.writer.setAttribute(e,t,o)}}}else{for(const[e,t]of n){if(e==="class"){i.writer.removeClass(t,o)}else{i.writer.removeAttribute(e,o)}}}}})}}}function kP(e,t,i){var n=e.length;i=i===undefined?n:i;return!t&&i>=n?e:Na(e,t,i)}var _P=kP;var vP="\\ud800-\\udfff",yP="\\u0300-\\u036f",xP="\\ufe20-\\ufe2f",AP="\\u20d0-\\u20ff",TP=yP+xP+AP,CP="\\ufe0e\\ufe0f";var PP="\\u200d";var EP=RegExp("["+PP+vP+TP+CP+"]");function SP(e){return EP.test(e)}var MP=SP;function IP(e){return e.split("")}var NP=IP;var OP="\\ud800-\\udfff",zP="\\u0300-\\u036f",RP="\\ufe20-\\ufe2f",LP="\\u20d0-\\u20ff",DP=zP+RP+LP,VP="\\ufe0e\\ufe0f";var jP="["+OP+"]",BP="["+DP+"]",FP="\\ud83c[\\udffb-\\udfff]",HP="(?:"+BP+"|"+FP+")",UP="[^"+OP+"]",WP="(?:\\ud83c[\\udde6-\\uddff]){2}",qP="[\\ud800-\\udbff][\\udc00-\\udfff]",$P="\\u200d";var YP=HP+"?",GP="["+VP+"]?",KP="(?:"+$P+"(?:"+[UP,WP,qP].join("|")+")"+GP+YP+")*",QP=GP+YP+KP,JP="(?:"+[UP+BP+"?",BP,WP,qP,jP].join("|")+")";var ZP=RegExp(FP+"(?="+FP+")|"+JP+QP,"g");function XP(e){return e.match(ZP)||[]}var eE=XP;function tE(e){return MP(e)?eE(e):NP(e)}var iE=tE;function nE(e){return function(t){t=va(t);var i=MP(t)?iE(t):undefined;var n=i?i[0]:t.charAt(0);var o=i?_P(i,1).join(""):t.slice(1);return n[e]()+o}}var oE=nE;var rE=oE("toUpperCase");var sE=rE;const aE=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;const cE=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;const lE="Ctrl+K";function dE(e){return e.is("attributeElement")&&!!e.getCustomProperty("link")}function uE(e,t){const i=t.createAttributeElement("a",{href:e},{priority:5});t.setCustomProperty("link",true,i);return i}function hE(e){e=String(e);return fE(e)?e:"#"}function fE(e){const t=e.replace(aE,"");return t.match(cE)}function mE(e,t){const i={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};t.forEach(e=>{if(e.label&&i[e.label]){e.label=i[e.label]}return e});return t}function gE(e){const t=[];if(e){for(const[i,n]of Object.entries(e)){const e=Object.assign({},n,{id:`link${sE(i)}`});t.push(e)}}return t}function pE(e,t){if(!e){return false}return e.is("element","image")&&t.checkAttribute("image","linkHref")}class bE extends nk{constructor(e){super(e);this.manualDecorators=new xs;this.automaticDecorators=new wP}restoreManualDecoratorStates(){for(const e of this.manualDecorators){e.value=this._getDecoratorStateFromModel(e.id)}}refresh(){const e=this.editor.model;const t=e.document;const i=rk(t.selection.getSelectedBlocks());if(pE(i,e.schema)){this.value=i.getAttribute("linkHref");this.isEnabled=e.schema.checkAttribute(i,"linkHref")}else{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 i=this.editor.model;const n=i.document.selection;const o=[];const r=[];for(const e in t){if(t[e]){o.push(e)}else{r.push(e)}}i.change(t=>{if(n.isCollapsed){const s=n.getFirstPosition();if(n.hasAttribute("linkHref")){const a=gP(s,"linkHref",n.getAttribute("linkHref"),i);t.setAttribute("linkHref",e,a);o.forEach(e=>{t.setAttribute(e,true,a)});r.forEach(e=>{t.removeAttribute(e,a)});t.setSelection(t.createPositionAfter(a.end.nodeBefore))}else if(e!==""){const r=Us(n.getAttributes());r.set("linkHref",e);o.forEach(e=>{r.set(e,true)});const a=t.createText(e,r);i.insertContent(a,s);t.setSelection(t.createPositionAfter(a))}["linkHref",...o,...r].forEach(e=>{t.removeSelectionAttribute(e)})}else{const s=i.schema.getValidRanges(n.getRanges(),"linkHref");const a=[];for(const e of n.getSelectedBlocks()){if(i.schema.checkAttribute(e,"linkHref")){a.push(t.createRangeOn(e))}}const c=a.slice();for(const e of s){if(this._isRangeToUpdate(e,a)){c.push(e)}}for(const i of c){t.setAttribute("linkHref",e,i);o.forEach(e=>{t.setAttribute(e,true,i)});r.forEach(e=>{t.removeAttribute(e,i)})}}})}_getDecoratorStateFromModel(e){const t=this.editor.model;const i=t.document;const n=rk(i.selection.getSelectedBlocks());if(pE(n,t.schema)){return n.getAttribute(e)}return i.selection.getAttribute(e)}_isRangeToUpdate(e,t){for(const i of t){if(i.containsRange(e)){return false}}return true}}class wE extends nk{refresh(){const e=this.editor.model;const t=e.document;const i=rk(t.selection.getSelectedBlocks());if(pE(i,e.schema)){this.isEnabled=e.schema.checkAttribute(i,"linkHref")}else{this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"linkHref")}}execute(){const e=this.editor;const t=this.editor.model;const i=t.document.selection;const n=e.commands.get("link");t.change(e=>{const o=i.isCollapsed?[gP(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),t)]:i.getRanges();for(const t of o){e.removeAttribute("linkHref",t);if(n){for(const i of n.manualDecorators){e.removeAttribute(i.id,t)}}}})}}class kE{constructor({id:e,label:t,attributes:i,defaultValue:n}){this.id=e;this.set("value");this.defaultValue=n;this.label=t;this.attributes=i}}ys(kE,Qc);var _E=i(90);const vE="ck-link_selected";const yE="automatic";const xE="manual";const AE=/^(https?:)?\/\//;class TE extends tk{static get pluginName(){return"LinkEditing"}static get requires(){return[lP,D_,n_]}constructor(e){super(e);e.config.define("link",{addTargetToExternalLinks:false})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"linkHref"});e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:uE});e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,t)=>uE(hE(e),t)});e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:true}},model:{key:"linkHref",value:e=>e.getAttribute("href")}});e.commands.add("link",new bE(e));e.commands.add("unlink",new wE(e));const t=mE(e.t,gE(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(e=>e.mode===yE));this._enableManualDecorators(t.filter(e=>e.mode===xE));const i=e.plugins.get(lP);i.registerAttribute("linkHref");bP(e,"linkHref","a",vE);this._enableInsertContentSelectionAttributesFixer();this._enableClickingAfterLink();this._enableTypingOverLink();this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(e){const t=this.editor;const i=t.commands.get("link");const n=i.automaticDecorators;if(t.config.get("link.addTargetToExternalLinks")){n.add({id:"linkIsExternal",mode:yE,callback:e=>AE.test(e),attributes:{target:"_blank",rel:"noopener noreferrer"}})}n.add(e);if(n.length){t.conversion.for("downcast").add(n.getDispatcher())}}_enableManualDecorators(e){if(!e.length){return}const t=this.editor;const i=t.commands.get("link");const n=i.manualDecorators;e.forEach(e=>{t.model.schema.extend("$text",{allowAttributes:e.id});n.add(new kE(e));t.conversion.for("downcast").attributeToElement({model:e.id,view:(t,i)=>{if(t){const t=n.get(e.id).attributes;const o=i.createAttributeElement("a",t,{priority:5});i.setCustomProperty("link",true,o);return o}}});t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:n.get(e.id).attributes},model:{key:e.id}})})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor;const t=e.model;const i=t.document.selection;const n=e.commands.get("link");this.listenTo(t,"insertContent",()=>{const e=i.anchor.nodeBefore;const o=i.anchor.nodeAfter;if(!i.hasAttribute("linkHref")){return}if(!e){return}if(!e.hasAttribute("linkHref")){return}if(o&&o.hasAttribute("linkHref")){return}t.change(e=>{CE(e,n.manualDecorators)})},{priority:"low"})}_enableClickingAfterLink(){const e=this.editor;const t=e.commands.get("link");e.editing.view.addObserver(yA);let i=false;this.listenTo(e.editing.view.document,"mousedown",()=>{i=true});this.listenTo(e.editing.view.document,"selectionChange",()=>{if(!i){return}i=false;const n=e.model.document.selection;if(!n.isCollapsed){return}if(!n.hasAttribute("linkHref")){return}const o=n.getFirstPosition();const r=gP(o,"linkHref",n.getAttribute("linkHref"),e.model);if(o.isTouching(r.start)||o.isTouching(r.end)){e.model.change(e=>{CE(e,t.manualDecorators)})}})}_enableTypingOverLink(){const e=this.editor;const t=e.editing.view;let i;let n;this.listenTo(t.document,"delete",()=>{n=true},{priority:"high"});this.listenTo(e.model,"deleteContent",()=>{const t=e.model.document.selection;if(t.isCollapsed){return}if(n){n=false;return}if(!EE(e)){return}if(PE(e.model)){i=t.getAttributes()}},{priority:"high"});this.listenTo(e.model,"insertContent",(t,[o])=>{n=false;if(!EE(e)){return}if(!i){return}e.model.change(e=>{for(const[t,n]of i){e.setAttribute(t,n,o)}});i=null},{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor;const t=e.model;const i=t.document.selection;const n=e.editing.view;const o=e.commands.get("link");let r=false;let s=false;this.listenTo(n.document,"delete",(e,t)=>{s=t.domEvent.keyCode===zl.backspace},{priority:"high"});this.listenTo(t,"deleteContent",()=>{r=false;const e=i.getFirstPosition();const n=i.getAttribute("linkHref");if(!n){return}const o=gP(e,"linkHref",n,t);r=o.containsPosition(e)||o.end.isEqual(e)},{priority:"high"});this.listenTo(t,"deleteContent",()=>{if(!s){return}s=false;if(r){return}e.model.enqueueChange(e=>{CE(e,o.manualDecorators)})},{priority:"low"})}}function CE(e,t){e.removeSelectionAttribute("linkHref");for(const i of t){e.removeSelectionAttribute(i.id)}}function PE(e){const t=e.document.selection;const i=t.getFirstPosition();const n=t.getLastPosition();const o=i.nodeAfter;if(!o){return false}if(!o.is("$text")){return false}if(!o.hasAttribute("linkHref")){return false}const r=n.textNode||n.nodeBefore;if(o===r){return true}const s=gP(i,"linkHref",o.getAttribute("linkHref"),e);return s.containsRange(e.createRange(i,n),true)}function EE(e){const t=e.plugins.get("Input");return t.isInput(e.model.change(e=>e.batch))}class SE extends eh{constructor(e){super(e);this.domEventType="click"}onDomEvent(e){this.fire(e.type,e)}}var ME=i(92);class IE extends jb{constructor(e,t,i){super(e);const n=e.t;this.focusTracker=new Yp;this.keystrokes=new zp;this.urlInputView=this._createUrlInput(i);this.saveButtonView=this._createButton(n("Save"),$A,"ck-button-save");this.saveButtonView.type="submit";this.cancelButtonView=this._createButton(n("Cancel"),YA,"ck-button-cancel","cancel");this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t);this.children=this._createFormChildren(t.manualDecorators);this._focusables=new lb;this._focusCycler=new iw({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const o=["ck","ck-link-form"];if(t.manualDecorators.length){o.push("ck-link-form_layout-vertical")}this.setTemplate({tag:"form",attributes:{class:o,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>{e[t.name]=t.isOn;return e},{})}render(){super.render();qA({view:this});const e=[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView];e.forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)});this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(e="https://"){const t=this.locale.t;const i=new BA(this.locale,UA);i.label=t("Link URL");i.fieldView.placeholder=e+"example.com";return i}_createButton(e,t,i,n){const o=new Tw(this.locale);o.set({label:e,icon:t,tooltip:true});o.extendTemplate({attributes:{class:i}});if(n){o.delegate("execute").to(this,n)}return o}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const i of e.manualDecorators){const n=new Ow(this.locale);n.set({name:i.id,label:i.label,withText:true});n.bind("isOn").toMany([i,e],"value",(e,t)=>t===undefined&&e===undefined?i.defaultValue:e);n.on("execute",()=>{i.set("value",!n.isOn)});t.add(n)}return t}_createFormChildren(e){const t=this.createCollection();t.add(this.urlInputView);if(e.length){const e=new jb;e.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(e=>({tag:"li",children:[e],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}});t.add(e)}t.add(this.saveButtonView);t.add(this.cancelButtonView);return t}}var NE='';var OE='';var zE=i(94);class RE extends jb{constructor(e){super(e);const t=e.t;this.focusTracker=new Yp;this.keystrokes=new zp;this.previewButtonView=this._createPreviewButton();this.unlinkButtonView=this._createButton(t("Unlink"),NE,"unlink");this.editButtonView=this._createButton(t("Edit link"),OE,"edit");this.set("href");this._focusables=new lb;this._focusCycler=new iw({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render();const e=[this.previewButtonView,this.editButtonView,this.unlinkButtonView];e.forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)});this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(e,t,i){const n=new Tw(this.locale);n.set({label:e,icon:t,tooltip:true});n.delegate("execute").to(this,i);return n}_createPreviewButton(){const e=new Tw(this.locale);const t=this.bindTemplate;const i=this.t;e.set({withText:true,tooltip:i("Open link in new tab")});e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",e=>e&&hE(e)),target:"_blank",rel:"noopener noreferrer"}});e.bind("label").to(this,"href",e=>e||i("This link has no URL"));e.bind("isEnabled").to(this,"href",e=>!!e);e.template.tag="a";e.template.eventListeners={};return e}}var LE='';const DE=/^((\w+:(\/{2,})?)|(\W))/i;const VE=/[\w-]+@[\w-]+\.+[\w-]+/i;const jE="link-ui";class BE extends tk{static get requires(){return[tT]}static get pluginName(){return"LinkUI"}init(){const e=this.editor;e.editing.view.addObserver(SE);this.actionsView=this._createActionsView();this.formView=this._createFormView();this._balloon=e.plugins.get(tT);this._createToolbarLinkButton();this._enableUserBalloonInteractions();e.conversion.for("editingDowncast").markerToHighlight({model:jE,view:{classes:["ck-fake-link-selection"]}});e.conversion.for("editingDowncast").markerToElement({model:jE,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy();this.formView.destroy()}_createActionsView(){const e=this.editor;const t=new RE(e.locale);const i=e.commands.get("link");const n=e.commands.get("unlink");t.bind("href").to(i,"value");t.editButtonView.bind("isEnabled").to(i);t.unlinkButtonView.bind("isEnabled").to(n);this.listenTo(t,"edit",()=>{this._addFormView()});this.listenTo(t,"unlink",()=>{e.execute("unlink");this._hideUI()});t.keystrokes.set("Esc",(e,t)=>{this._hideUI();t()});t.keystrokes.set(lE,(e,t)=>{this._addFormView();t()});return t}_createFormView(){const e=this.editor;const t=e.commands.get("link");const i=e.config.get("link.defaultProtocol");const n=new IE(e.locale,t,i);n.urlInputView.fieldView.bind("value").to(t,"value");n.urlInputView.bind("isReadOnly").to(t,"isEnabled",e=>!e);n.saveButtonView.bind("isEnabled").to(t);this.listenTo(n,"submit",()=>{const{value:t}=n.urlInputView.fieldView.element;const o=!!i&&!DE.test(t);const r=VE.test(t);const s=r?"mailto:":i;const a=t&&o?s+t:t;e.execute("link",a,n.getDecoratorSwitchesState());this._closeFormView()});this.listenTo(n,"cancel",()=>{this._closeFormView()});n.keystrokes.set("Esc",(e,t)=>{this._closeFormView();t()});return n}_createToolbarLinkButton(){const e=this.editor;const t=e.commands.get("link");const i=e.t;e.keystrokes.set(lE,(e,t)=>{t();this._showUI(true)});e.ui.componentFactory.add("link",e=>{const n=new Tw(e);n.isEnabled=true;n.label=i("Link");n.icon=LE;n.keystroke=lE;n.tooltip=true;n.isToggleable=true;n.bind("isEnabled").to(t,"isEnabled");n.bind("isOn").to(t,"value",e=>!!e);this.listenTo(n,"execute",()=>this._showUI(true));return n})}_enableUserBalloonInteractions(){const e=this.editor.editing.view.document;this.listenTo(e,"click",()=>{const e=this._getSelectedLinkElement();if(e){this._showUI()}});this.editor.keystrokes.set("Tab",(e,t)=>{if(this._areActionsVisible&&!this.actionsView.focusTracker.isFocused){this.actionsView.focus();t()}},{priority:"high"});this.editor.keystrokes.set("Esc",(e,t)=>{if(this._isUIVisible){this._hideUI();t()}});zw({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){if(this._areActionsInPanel){return}this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel){return}const e=this.editor;const t=e.commands.get("link");this._balloon.add({view:this.formView,position:this._getBalloonPositionData()});if(this._balloon.visibleView===this.formView){this.formView.urlInputView.fieldView.select()}this.formView.urlInputView.fieldView.element.value=t.value||""}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates();if(e.value!==undefined){this._removeFormView()}else{this._hideUI()}}_removeFormView(){if(this._isFormInPanel){this.formView.saveButtonView.focus();this._balloon.remove(this.formView);this.editor.editing.view.focus();this._hideFakeVisualSelection()}}_showUI(e=false){if(!this._getSelectedLinkElement()){this._addActionsView();if(e){this._balloon.showStack("main")}this._addFormView();this._showFakeVisualSelection()}else{if(this._areActionsVisible){this._addFormView()}else{this._addActionsView()}if(e){this._balloon.showStack("main")}}this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel){return}const e=this.editor;this.stopListening(e.ui,"update");this.stopListening(this._balloon,"change:visibleView");e.editing.view.focus();this._removeFormView();this._balloon.remove(this.actionsView);this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor;const t=e.editing.view.document;let i=this._getSelectedLinkElement();let n=r();const o=()=>{const e=this._getSelectedLinkElement();const t=r();if(i&&!e||!i&&t!==n){this._hideUI()}else if(this._isUIVisible){this._balloon.updatePosition(this._getBalloonPositionData())}i=e;n=t};function r(){return t.selection.focus.getAncestors().reverse().find(e=>e.is("element"))}this.listenTo(e.ui,"update",o);this.listenTo(this._balloon,"change:visibleView",o)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const e=this._balloon.visibleView;return e==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view;const t=e.document;const i=this._getSelectedLinkElement();const n=i?e.domConverter.mapViewToDom(i):e.domConverter.viewRangeToDom(t.selection.getFirstRange());return{target:n}}_getSelectedLinkElement(){const e=this.editor.editing.view;const t=e.document.selection;if(t.isCollapsed){return FE(t.getFirstPosition())}else{const i=t.getFirstRange().getTrimmed();const n=FE(i.start);const o=FE(i.end);if(!n||n!=o){return null}if(e.createRangeIn(n).getTrimmed().isEqual(i)){return n}else{return null}}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{if(e.markers.has(jE)){t.updateMarker(jE,{range:e.document.selection.getFirstRange()})}else{t.addMarker(jE,{usingOperation:false,affectsData:false,range:e.document.selection.getFirstRange()})}})}_hideFakeVisualSelection(){const e=this.editor.model;if(e.markers.has(jE)){e.change(e=>{e.removeMarker(jE)})}}}function FE(e){return e.getAncestors().find(e=>dE(e))}class HE extends tk{static get requires(){return[TE,BE]}static get pluginName(){return"Link"}}class UE extends nk{constructor(e,t){super(e);this.type=t}refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;const t=e.document;const i=Array.from(t.selection.getSelectedBlocks()).filter(t=>qE(t,e.schema));const n=this.value===true;e.change(e=>{if(n){let t=i[i.length-1].nextSibling;let n=Number.POSITIVE_INFINITY;let o=[];while(t&&t.name=="listItem"&&t.getAttribute("listIndent")!==0){const e=t.getAttribute("listIndent");if(e=i){if(r>o.getAttribute("listIndent")){r=o.getAttribute("listIndent")}if(o.getAttribute("listIndent")==r){e[t?"unshift":"push"](o)}o=o[t?"previousSibling":"nextSibling"]}}}function qE(e,t){return t.checkChild(e.parent,"listItem")&&!t.isObject(e)}class $E extends nk{constructor(e,t){super(e);this._indentBy=t=="forward"?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;const t=e.document;let i=Array.from(t.selection.getSelectedBlocks());e.change(e=>{const t=i[i.length-1];let n=t.nextSibling;while(n&&n.name=="listItem"&&n.getAttribute("listIndent")>t.getAttribute("listIndent")){i.push(n);n=n.nextSibling}if(this._indentBy<0){i=i.reverse()}for(const t of i){const i=t.getAttribute("listIndent")+this._indentBy;if(i<0){e.rename(t,"paragraph")}else{e.setAttribute("listIndent",i,t)}}})}_checkEnabled(){const e=rk(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("element","listItem")){return false}if(this._indentBy>0){const t=e.getAttribute("listIndent");const i=e.getAttribute("listType");let n=e.previousSibling;while(n&&n.is("element","listItem")&&n.getAttribute("listIndent")>=t){if(n.getAttribute("listIndent")==t){return n.getAttribute("listType")==i}n=n.previousSibling}return false}return true}}function YE(e){const t=e.createContainerElement("li");t.getFillerOffset=tS;return t}function GE(e,t){const i=t.mapper;const n=t.writer;const o=e.getAttribute("listType")=="numbered"?"ol":"ul";const r=YE(n);const s=n.createContainerElement(o,null);n.insert(n.createPositionAt(s,0),r);i.bindElements(e,r);return r}function KE(e,t,i,n){const o=t.parent;const r=i.mapper;const s=i.writer;let a=r.toViewPosition(n.createPositionBefore(e));const c=ZE(e.previousSibling,{sameIndent:true,smallerIndent:true,listIndent:e.getAttribute("listIndent")});const l=e.previousSibling;if(c&&c.getAttribute("listIndent")==e.getAttribute("listIndent")){const e=r.toViewElement(c);a=s.breakContainer(s.createPositionAfter(e))}else{if(l&&l.name=="listItem"){a=r.toViewPosition(n.createPositionAt(l,"end"));const e=r.findMappedViewAncestor(a);const t=eS(e);if(t){a=s.createPositionBefore(t)}else{a=s.createPositionAt(e,"end")}}else{a=r.toViewPosition(n.createPositionBefore(e))}}a=JE(a);s.insert(a,o);if(l&&l.name=="listItem"){const e=r.toViewElement(l);const i=s.createRange(s.createPositionAt(e,0),a);const n=i.getWalker({ignoreElementEnd:true});for(const e of n){if(e.item.is("element","li")){const i=s.breakContainer(s.createPositionBefore(e.item));const o=e.item.parent;const r=s.createPositionAt(t,"end");QE(s,r.nodeBefore,r.nodeAfter);s.move(s.createRangeOn(o),r);n.position=i}}}else{const i=o.nextSibling;if(i&&(i.is("element","ul")||i.is("element","ol"))){let n=null;for(const t of i.getChildren()){const i=r.toModelElement(t);if(i&&i.getAttribute("listIndent")>e.getAttribute("listIndent")){n=t}else{break}}if(n){s.breakContainer(s.createPositionAfter(n));s.move(s.createRangeOn(n.parent),s.createPositionAt(t,"end"))}}}QE(s,o,o.nextSibling);QE(s,o.previousSibling,o)}function QE(e,t,i){if(!t||!i||t.name!="ul"&&t.name!="ol"){return null}if(t.name!=i.name||t.getAttribute("class")!==i.getAttribute("class")){return null}return e.mergeContainers(e.createPositionAfter(t))}function JE(e){return e.getLastMatchingPosition(e=>e.item.is("uiElement"))}function ZE(e,t){const i=!!t.sameIndent;const n=!!t.smallerIndent;const o=t.listIndent;let r=e;while(r&&r.name=="listItem"){const e=r.getAttribute("listIndent");if(i&&o==e||n&&o>e){return r}r=r.previousSibling}return null}function XE(e,t,i,n){e.ui.componentFactory.add(t,o=>{const r=e.commands.get(t);const s=new Tw(o);s.set({label:i,icon:n,tooltip:true,isToggleable:true});s.bind("isOn","isEnabled").to(r,"value","isEnabled");s.on("execute",()=>{e.execute(t);e.editing.view.focus()});return s})}function eS(e){for(const t of e.getChildren()){if(t.name=="ul"||t.name=="ol"){return t}}return null}function tS(){const e=!this.isEmpty&&(this.getChild(0).name=="ul"||this.getChild(0).name=="ol");if(this.isEmpty||e){return 0}return Uc.call(this)}function iS(e){return(t,i,n)=>{const o=n.consumable;if(!o.test(i.item,"insert")||!o.test(i.item,"attribute:listType")||!o.test(i.item,"attribute:listIndent")){return}o.consume(i.item,"insert");o.consume(i.item,"attribute:listType");o.consume(i.item,"attribute:listIndent");const r=i.item;const s=GE(r,n);KE(r,s,n,e)}}function nS(e){return(t,i,n)=>{const o=n.mapper.toViewPosition(i.position);const r=o.getLastMatchingPosition(e=>!e.item.is("element","li"));const s=r.nodeAfter;const a=n.writer;a.breakContainer(a.createPositionBefore(s));a.breakContainer(a.createPositionAfter(s));const c=s.parent;const l=c.previousSibling;const d=a.createRangeOn(c);const u=a.remove(d);if(l&&l.nextSibling){QE(a,l,l.nextSibling)}const h=n.mapper.toModelElement(s);wS(h.getAttribute("listIndent")+1,i.position,d.start,s,n,e);for(const e of a.createRangeIn(u).getItems()){n.mapper.unbindViewElement(e)}t.stop()}}function oS(e,t,i){if(!i.consumable.consume(t.item,"attribute:listType")){return}const n=i.mapper.toViewElement(t.item);const o=i.writer;o.breakContainer(o.createPositionBefore(n));o.breakContainer(o.createPositionAfter(n));const r=n.parent;const s=t.attributeNewValue=="numbered"?"ol":"ul";o.rename(s,r)}function rS(e,t,i){const n=i.mapper.toViewElement(t.item);const o=n.parent;const r=i.writer;QE(r,o,o.nextSibling);QE(r,o.previousSibling,o);for(const e of t.item.getChildren()){i.consumable.consume(e,"insert")}}function sS(e){return(t,i,n)=>{if(!n.consumable.consume(i.item,"attribute:listIndent")){return}const o=n.mapper.toViewElement(i.item);const r=n.writer;r.breakContainer(r.createPositionBefore(o));r.breakContainer(r.createPositionAfter(o));const s=o.parent;const a=s.previousSibling;const c=r.createRangeOn(s);r.remove(c);if(a&&a.nextSibling){QE(r,a,a.nextSibling)}wS(i.attributeOldValue+1,i.range.start,c.start,o,n,e);KE(i.item,o,n,e);for(const e of i.item.getChildren()){n.consumable.consume(e,"insert")}}}function aS(e,t,i){if(t.item.name!="listItem"){let e=i.mapper.toViewPosition(t.range.start);const n=i.writer;const o=[];while(e.parent.name=="ul"||e.parent.name=="ol"){e=n.breakContainer(e);if(e.parent.name!="li"){break}const t=e;const i=n.createPositionAt(e.parent,"end");if(!t.isEqual(i)){const e=n.remove(n.createRange(t,i));o.push(e)}e=n.createPositionAfter(e.parent)}if(o.length>0){for(let t=0;t0){const t=QE(n,i,i.nextSibling);if(t&&t.parent==i){e.offset--}}}QE(n,e.nodeBefore,e.nodeAfter)}}}function cS(e,t,i){const n=i.mapper.toViewPosition(t.position);const o=n.nodeBefore;const r=n.nodeAfter;QE(i.writer,o,r)}function lS(e,t,i){if(i.consumable.consume(t.viewItem,{name:true})){const e=i.writer;const n=e.createElement("listItem");const o=_S(t.viewItem);e.setAttribute("listIndent",o,n);const r=t.viewItem.parent&&t.viewItem.parent.name=="ol"?"numbered":"bulleted";e.setAttribute("listType",r,n);const s=i.splitToAllowedParent(n,t.modelCursor);if(!s){return}e.insert(n,s.position);const a=pS(n,t.viewItem.getChildren(),i);t.modelRange=e.createRange(t.modelCursor,a);if(s.cursorParent){t.modelCursor=e.createPositionAt(s.cursorParent,0)}else{t.modelCursor=t.modelRange.end}}}function dS(e,t,i){if(i.consumable.test(t.viewItem,{name:true})){const e=Array.from(t.viewItem.getChildren());for(const t of e){const e=!(t.is("element","li")||kS(t));if(e){t._remove()}}}}function uS(e,t,i){if(i.consumable.test(t.viewItem,{name:true})){if(t.viewItem.childCount===0){return}const e=[...t.viewItem.getChildren()];let i=false;let n=true;for(const t of e){if(i&&!kS(t)){t._remove()}if(t.is("$text")){if(n){t._data=t.data.replace(/^\s+/,"")}if(!t.nextSibling||kS(t.nextSibling)){t._data=t.data.replace(/\s+$/,"")}}else if(kS(t)){i=true}n=false}}}function hS(e){return(t,i)=>{if(i.isPhantom){return}const n=i.modelPosition.nodeBefore;if(n&&n.is("element","listItem")){const t=i.mapper.toViewElement(n);const o=t.getAncestors().find(kS);const r=e.createPositionAt(t,0).getWalker();for(const e of r){if(e.type=="elementStart"&&e.item.is("element","li")){i.viewPosition=e.previousPosition;break}else if(e.type=="elementEnd"&&e.item==o){i.viewPosition=e.nextPosition;break}}}}}function fS(e){return(t,i)=>{const n=i.viewPosition;const o=n.parent;const r=i.mapper;if(o.name=="ul"||o.name=="ol"){if(!n.isAtEnd){const t=r.toModelElement(n.nodeAfter);i.modelPosition=e.createPositionBefore(t)}else{const t=r.toModelElement(n.nodeBefore);const o=r.getModelLength(n.nodeBefore);i.modelPosition=e.createPositionBefore(t).getShiftedBy(o)}t.stop()}else if(o.name=="li"&&n.nodeBefore&&(n.nodeBefore.name=="ul"||n.nodeBefore.name=="ol")){const s=r.toModelElement(o);let a=1;let c=n.nodeBefore;while(c&&kS(c)){a+=r.getModelLength(c);c=c.previousSibling}i.modelPosition=e.createPositionBefore(s).getShiftedBy(a);t.stop()}}}function mS(e,t){const i=e.document.differ.getChanges();const n=new Map;let o=false;for(const n of i){if(n.type=="insert"&&n.name=="listItem"){r(n.position)}else if(n.type=="insert"&&n.name!="listItem"){if(n.name!="$text"){const i=n.position.nodeAfter;if(i.hasAttribute("listIndent")){t.removeAttribute("listIndent",i);o=true}if(i.hasAttribute("listType")){t.removeAttribute("listType",i);o=true}for(const t of Array.from(e.createRangeIn(i)).filter(e=>e.item.is("element","listItem"))){r(t.previousPosition)}}const i=n.position.getShiftedBy(n.length);r(i)}else if(n.type=="remove"&&n.name=="listItem"){r(n.position)}else if(n.type=="attribute"&&n.attributeKey=="listIndent"){r(n.range.start)}else if(n.type=="attribute"&&n.attributeKey=="listType"){r(n.range.start)}}for(const e of n.values()){s(e);a(e)}return o;function r(e){const t=e.nodeBefore;if(!t||!t.is("element","listItem")){const t=e.nodeAfter;if(t&&t.is("element","listItem")){n.set(t,t)}}else{let e=t;if(n.has(e)){return}for(let t=e.previousSibling;t&&t.is("element","listItem");t=e.previousSibling){e=t;if(n.has(e)){return}}n.set(t,e)}}function s(e){let i=0;let n=null;while(e&&e.is("element","listItem")){const r=e.getAttribute("listIndent");if(r>i){let s;if(n===null){n=r-i;s=i}else{if(n>r){n=r}s=r-n}t.setAttribute("listIndent",s,e);o=true}else{n=null;i=e.getAttribute("listIndent")+1}e=e.nextSibling}}function a(e){let i=[];let n=null;while(e&&e.is("element","listItem")){const r=e.getAttribute("listIndent");if(n&&n.getAttribute("listIndent")>r){i=i.slice(0,r+1)}if(r!=0){if(i[r]){const n=i[r];if(e.getAttribute("listType")!=n){t.setAttribute("listType",n,e);o=true}}else{i[r]=e.getAttribute("listType")}}n=e;e=e.nextSibling}}}function gS(e,[t,i]){let n=t.is("documentFragment")?t.getChild(0):t;let o;if(!i){o=this.document.selection}else{o=this.createSelection(i)}if(n&&n.is("element","listItem")){const e=o.getFirstPosition();let t=null;if(e.parent.is("element","listItem")){t=e.parent}else if(e.nodeBefore&&e.nodeBefore.is("element","listItem")){t=e.nodeBefore}if(t){const e=t.getAttribute("listIndent");if(e>0){while(n&&n.is("element","listItem")){n._setAttribute("listIndent",n.getAttribute("listIndent")+e);n=n.nextSibling}}}}}function pS(e,t,i){const{writer:n,schema:o}=i;let r=n.createPositionAfter(e);for(const s of t){if(s.name=="ul"||s.name=="ol"){r=i.convertItem(s,r).modelCursor}else{const t=i.convertItem(s,n.createPositionAt(e,"end"));const a=t.modelRange.start.nodeAfter;const c=a&&a.is("element")&&!o.checkChild(e,a.name);if(c){if(t.modelCursor.parent.is("element","listItem")){e=t.modelCursor.parent}else{e=bS(t.modelCursor)}r=n.createPositionAfter(e)}}}return r}function bS(e){const t=new Gh({startPosition:e});let i;do{i=t.next()}while(!i.value.item.is("element","listItem"));return i.value.item}function wS(e,t,i,n,o,r){const s=ZE(t.nodeBefore,{sameIndent:true,smallerIndent:true,listIndent:e,foo:"b"});const a=o.mapper;const c=o.writer;const l=s?s.getAttribute("listIndent"):null;let d;if(!s){d=i}else if(l==e){const e=a.toViewElement(s).parent;d=c.createPositionAfter(e)}else{const e=r.createPositionAt(s,"end");d=a.toViewPosition(e)}d=JE(d);for(const e of[...n.getChildren()]){if(kS(e)){d=c.move(c.createRangeOn(e),d).end;QE(c,e,e.nextSibling);QE(c,e.previousSibling,e)}}}function kS(e){return e.is("element","ol")||e.is("element","ul")}function _S(e){let t=0;let i=e.parent;while(i){if(i.is("element","li")){t++}else{const e=i.previousSibling;if(e&&e.is("element","li")){t++}}i=i.parent}return t}class vS extends tk{static get pluginName(){return"ListEditing"}static get requires(){return[Yy]}init(){const e=this.editor;e.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const t=e.data;const i=e.editing;e.model.document.registerPostFixer(t=>mS(e.model,t));i.mapper.registerViewToModelLength("li",yS);t.mapper.registerViewToModelLength("li",yS);i.mapper.on("modelToViewPosition",hS(i.view));i.mapper.on("viewToModelPosition",fS(e.model));t.mapper.on("modelToViewPosition",hS(i.view));e.conversion.for("editingDowncast").add(t=>{t.on("insert",aS,{priority:"high"});t.on("insert:listItem",iS(e.model));t.on("attribute:listType:listItem",oS,{priority:"high"});t.on("attribute:listType:listItem",rS,{priority:"low"});t.on("attribute:listIndent:listItem",sS(e.model));t.on("remove:listItem",nS(e.model));t.on("remove",cS,{priority:"low"})});e.conversion.for("dataDowncast").add(t=>{t.on("insert",aS,{priority:"high"});t.on("insert:listItem",iS(e.model))});e.conversion.for("upcast").add(e=>{e.on("element:ul",dS,{priority:"high"});e.on("element:ol",dS,{priority:"high"});e.on("element:li",uS,{priority:"high"});e.on("element:li",lS)});e.model.on("insertContent",gS,{priority:"high"});e.commands.add("numberedList",new UE(e,"numbered"));e.commands.add("bulletedList",new UE(e,"bulleted"));e.commands.add("indentList",new $E(e,"forward"));e.commands.add("outdentList",new $E(e,"backward"));const n=i.view.document;this.listenTo(n,"enter",(e,t)=>{const i=this.editor.model.document;const n=i.selection.getLastPosition().parent;if(i.selection.isCollapsed&&n.name=="listItem"&&n.isEmpty){this.editor.execute("outdentList");t.preventDefault();e.stop()}});this.listenTo(n,"delete",(e,t)=>{if(t.direction!=="backward"){return}const i=this.editor.model.document.selection;if(!i.isCollapsed){return}const n=i.getFirstPosition();if(!n.isAtStart){return}const o=n.parent;if(o.name!=="listItem"){return}const r=o.previousSibling&&o.previousSibling.name==="listItem";if(r){return}this.editor.execute("outdentList");t.preventDefault();e.stop()},{priority:"high"});const o=e=>(t,i)=>{const n=this.editor.commands.get(e);if(n.isEnabled){this.editor.execute(e);i()}};e.keystrokes.set("Tab",o("indentList"));e.keystrokes.set("Shift+Tab",o("outdentList"))}afterInit(){const e=this.editor.commands;const t=e.get("indent");const i=e.get("outdent");if(t){t.registerChildCommand(e.get("indentList"))}if(i){i.registerChildCommand(e.get("outdentList"))}}}function yS(e){let t=1;for(const i of e.getChildren()){if(i.name=="ul"||i.name=="ol"){for(const e of i.getChildren()){t+=yS(e)}}}return t}var xS='';var AS='';class TS extends tk{init(){const e=this.editor.t;XE(this.editor,"numberedList",e("Numbered List"),xS);XE(this.editor,"bulletedList",e("Bulleted List"),AS)}}class CS extends tk{static get requires(){return[vS,TS]}static get pluginName(){return"List"}}function PS(e,t){return e=>{e.on("attribute:url:media",i)};function i(i,n,o){if(!o.consumable.consume(n.item,i.name)){return}const r=n.attributeNewValue;const s=o.writer;const a=o.mapper.toViewElement(n.item);const c=[...a.getChildren()].find(e=>e.getCustomProperty("media-content"));s.remove(c);const l=e.getMediaViewElement(s,r,t);s.insert(s.createPositionAt(a,0),l)}}function ES(e,t,i){t.setCustomProperty("media",true,e);return Dx(e,t,{label:i})}function SS(e){const t=e.getSelectedElement();if(t&&MS(t)){return t}return null}function MS(e){return!!e.getCustomProperty("media")&&Lx(e)}function IS(e,t,i,n){const o=e.createContainerElement("figure",{class:"media"});e.insert(e.createPositionAt(o,0),t.getMediaViewElement(e,i,n));return o}function NS(e){const t=e.getSelectedElement();if(t&&t.is("element","media")){return t}return null}function OS(e,t,i){e.change(n=>{const o=n.createElement("media",{url:t});e.insertContent(o,i);n.setSelection(o,"on")})}class zS extends nk{refresh(){const e=this.editor.model;const t=e.document.selection;const i=e.schema;const n=t.getFirstPosition();const o=NS(t);let r=n.parent;if(r!=r.root){r=r.parent}this.value=o?o.getAttribute("url"):null;this.isEnabled=i.checkChild(r,"media")}execute(e){const t=this.editor.model;const i=t.document.selection;const n=NS(i);if(n){t.change(t=>{t.setAttribute("url",e,n)})}else{const n=Hx(i,t);OS(t,e,n)}}}var RS='';const LS="0 0 64 42";class DS{constructor(e,t){const i=t.providers;const n=t.extraProviders||[];const o=new Set(t.removeProviders);const r=i.concat(n).filter(e=>{const t=e.name;if(!t){console.warn(Object(ss["a"])("media-embed-no-provider-name: The configured media provider has no name and cannot be used."),{provider:e});return false}return!o.has(t)});this.locale=e;this.providerDefinitions=r}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,i){return this._getMedia(t).getViewElement(e,i)}_getMedia(e){if(!e){return new VS(this.locale)}e=e.trim();for(const t of this.providerDefinitions){const i=t.html;let n=t.url;if(!Array.isArray(n)){n=[n]}for(const t of n){const n=this._getUrlMatches(e,t);if(n){return new VS(this.locale,e,n,i)}}}return null}_getUrlMatches(e,t){let i=e.match(t);if(i){return i}let n=e.replace(/^https?:\/\//,"");i=n.match(t);if(i){return i}n=n.replace(/^www\./,"");i=n.match(t);if(i){return i}return null}}class VS{constructor(e,t,i,n){this.url=this._getValidUrl(t);this._t=e.t;this._match=i;this._previewRenderer=n}getViewElement(e,t){const i={};let n;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){if(this.url){i["data-oembed-url"]=this.url}if(t.renderForEditingView){i.class="ck-media__wrapper"}const o=this._getPreviewHtml(t);n=e.createRawElement("div",i,(function(e){e.innerHTML=o}))}else{if(this.url){i.url=this.url}n=e.createEmptyElement("oembed",i)}e.setCustomProperty("media-content",true,n);return n}_getPreviewHtml(e){if(this._previewRenderer){return this._previewRenderer(this._match)}else{if(this.url&&e.renderForEditingView){return this._getPlaceholderHtml()}return""}}_getPlaceholderHtml(){const e=new xw;const t=new vw;e.text=this._t("Open media in new tab");t.content=RS;t.viewBox=LS;const i=new hb({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();return i.outerHTML}_getValidUrl(e){if(!e){return null}if(e.match(/^https?/)){return e}return"https://"+e}}var jS=i(96);class BS extends tk{static get pluginName(){return"MediaEmbedEditing"}constructor(e){super(e);e.config.define("mediaEmbed",{providers:[{name:"dailymotion",url:/^dailymotion\.com\/video\/(\w+)/,html:e=>{const t=e[1];return'
'+`"+"
"}},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:e=>{const t=e[1];return'
'+`"+"
"}},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)/,/^youtube\.com\/embed\/([\w-]+)/,/^youtu\.be\/([\w-]+)/],html:e=>{const t=e[1];return'
'+`"+"
"}},{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=>{const t=e[1];return'
'+`"+"
"}},{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 DS(e.locale,e.config.get("mediaEmbed"))}init(){const e=this.editor;const t=e.model.schema;const i=e.t;const n=e.conversion;const o=e.config.get("mediaEmbed.previewsInData");const r=this.registry;e.commands.add("mediaEmbed",new zS(e));t.register("media",{isObject:true,isBlock:true,allowWhere:"$block",allowAttributes:["url"]});n.for("dataDowncast").elementToElement({model:"media",view:(e,t)=>{const i=e.getAttribute("url");return IS(t,r,i,{renderMediaPreview:i&&o})}});n.for("dataDowncast").add(PS(r,{renderMediaPreview:o}));n.for("editingDowncast").elementToElement({model:"media",view:(e,t)=>{const n=e.getAttribute("url");const o=IS(t,r,n,{renderForEditingView:true});return ES(o,t,i("media widget"))}});n.for("editingDowncast").add(PS(r,{renderForEditingView:true}));n.for("upcast").elementToElement({view:{name:"oembed",attributes:{url:true}},model:(e,t)=>{const i=e.getAttribute("url");if(r.hasMedia(i)){return t.createElement("media",{url:i})}}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":true}},model:(e,t)=>{const i=e.getAttribute("data-oembed-url");if(r.hasMedia(i)){return t.createElement("media",{url:i})}}})}}const FS=/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=]+$/;class HS extends tk{static get requires(){return[n_,dv]}static get pluginName(){return"AutoMediaEmbed"}constructor(e){super(e);this._timeoutId=null;this._positionToInsert=null}init(){const e=this.editor;const t=e.model.document;this.listenTo(e.plugins.get(n_),"inputTransformation",()=>{const e=t.selection.getFirstRange();const i=Gg.fromPosition(e.start);i.stickiness="toPrevious";const n=Gg.fromPosition(e.end);n.stickiness="toNext";t.once("change:data",()=>{this._embedMediaBetweenPositions(i,n);i.detach();n.detach()},{priority:"high"})});e.commands.get("undo").on("execute",()=>{if(this._timeoutId){Dd.window.clearTimeout(this._timeoutId);this._positionToInsert.detach();this._timeoutId=null;this._positionToInsert=null}},{priority:"high"})}_embedMediaBetweenPositions(e,t){const i=this.editor;const n=i.plugins.get(BS).registry;const o=new ff(e,t);const r=o.getWalker({ignoreElementEnd:true});let s="";for(const e of r){if(e.item.is("$textProxy")){s+=e.item.data}}s=s.trim();if(!s.match(FS)){o.detach();return}if(!n.hasMedia(s)){o.detach();return}const a=i.commands.get("mediaEmbed");if(!a.isEnabled){o.detach();return}this._positionToInsert=Gg.fromPosition(e);this._timeoutId=Dd.window.setTimeout(()=>{i.model.change(e=>{this._timeoutId=null;e.remove(o);o.detach();let t;if(this._positionToInsert.root.rootName!=="$graveyard"){t=this._positionToInsert}OS(i.model,s,t);this._positionToInsert.detach();this._positionToInsert=null})},100)}}var US=i(98);class WS extends jb{constructor(e,t){super(t);const i=t.t;this.focusTracker=new Yp;this.keystrokes=new zp;this.urlInputView=this._createUrlInput();this.saveButtonView=this._createButton(i("Save"),$A,"ck-button-save");this.saveButtonView.type="submit";this.cancelButtonView=this._createButton(i("Cancel"),YA,"ck-button-cancel","cancel");this._focusables=new lb;this._focusCycler=new iw({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();qA({view:this});const e=[this.urlInputView,this.saveButtonView,this.cancelButtonView];e.forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)});this.keystrokes.listenTo(this.element);const t=e=>e.stopPropagation();this.keystrokes.set("arrowright",t);this.keystrokes.set("arrowleft",t);this.keystrokes.set("arrowup",t);this.keystrokes.set("arrowdown",t);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){this.urlInputView.errorText=t;return false}}return true}resetFormStatus(){this.urlInputView.errorText=null;this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t;const t=new BA(this.locale,UA);const i=t.fieldView;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;i.placeholder="https://example.com";i.on("input",()=>{t.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault});return t}_createButton(e,t,i,n){const o=new Tw(this.locale);o.set({label:e,icon:t,tooltip:true});o.extendTemplate({attributes:{class:i}});if(n){o.delegate("execute").to(this,n)}return o}}var qS='';class $S extends tk{static get requires(){return[BS]}static get pluginName(){return"MediaEmbedUI"}init(){const e=this.editor;const t=e.commands.get("mediaEmbed");const i=e.plugins.get(BS).registry;e.ui.componentFactory.add("mediaEmbed",n=>{const o=Dw(n);const r=new WS(YS(e.t,i),e.locale);this._setUpDropdown(o,r,t,e);this._setUpForm(o,r,t);return o})}_setUpDropdown(e,t,i){const n=this.editor;const o=n.t;const r=e.buttonView;e.bind("isEnabled").to(i);e.panelView.children.add(t);r.set({label:o("Insert media"),icon:qS,tooltip:true});r.on("open",()=>{t.url=i.value||"";t.urlInputView.fieldView.select();t.focus()},{priority:"low"});e.on("submit",()=>{if(t.isValid()){n.execute("mediaEmbed",t.url);s()}});e.on("change:isOpen",()=>t.resetFormStatus());e.on("cancel",()=>s());function s(){n.editing.view.focus();e.isOpen=false}}_setUpForm(e,t,i){t.delegate("submit","cancel").to(e);t.urlInputView.bind("value").to(i,"value");t.urlInputView.bind("isReadOnly").to(i,"isEnabled",e=>!e);t.saveButtonView.bind("isEnabled").to(i)}}function YS(e,t){return[t=>{if(!t.url.length){return e("The URL must not be empty.")}},i=>{if(!t.hasMedia(i.url)){return e("This media URL is not supported.")}}]}var GS=i(100);class KS extends tk{static get requires(){return[BS,$S,HS,zA]}static get pluginName(){return"MediaEmbed"}}class QS extends tk{static get requires(){return[MC]}static get pluginName(){return"SimpleUploadAdapter"}init(){const e=this.editor.config.get("simpleUpload");if(!e){return}if(!e.uploadUrl){console.warn(Object(ss["a"])('simple-upload-adapter-missing-uploadUrl: Missing the "uploadUrl" property in the "simpleUpload" editor configuration.'));return}this.editor.plugins.get(MC).createUploadAdapter=t=>new JS(t,e)}}class JS{constructor(e,t){this.loader=e;this.options=t}upload(){return this.loader.file.then(e=>new Promise((t,i)=>{this._initRequest();this._initListeners(t,i,e);this._sendRequest(e)}))}abort(){if(this.xhr){this.xhr.abort()}}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.options.uploadUrl,true);e.responseType=""}_initListeners(e,t,i){const n=this.xhr;const o=this.loader;n.addEventListener("error",(e)=>notif("error",n.statusText, "Impossible d'exporter l'image" ));n.addEventListener("abort",()=>t());n.addEventListener("load",()=>{console.log(n.responseText);const i=n.responseText.substring(n.responseText.indexOf('[DIV]')+5).replace(" ","%20");if(i.includes('error')){notif("error",i.substring(6), "Impossible d'exporter l'image" ); return null;}console.log(i);e({default:i})});if(n.upload){n.upload.addEventListener("progress",e=>{if(e.lengthComputable){o.uploadTotal=e.total;o.uploaded=e.loaded}})}}_sendRequest(e){const t=this.options.headers||{};const i=this.options.withCredentials||false;for(const e of Object.keys(t)){this.xhr.setRequestHeader(e,t[e])}this.xhr.withCredentials=i;const n=new FormData;n.append("upload",e);this.xhr.send(n)}}const ZS="todoListChecked";class XS extends nk{constructor(e){super(e);this._selectedElements=[];this.on("execute",()=>{this.refresh()},{priority:"highest"})}refresh(){this._selectedElements=this._getSelectedItems();this.value=this._selectedElements.every(e=>!!e.getAttribute("todoListChecked"));this.isEnabled=!!this._selectedElements.length}_getSelectedItems(){const e=this.editor.model;const t=e.schema;const i=e.document.selection.getFirstRange();const n=i.start.parent;const o=[];if(t.checkAttribute(n,ZS)){o.push(n)}for(const e of i.getItems()){if(t.checkAttribute(e,ZS)&&!o.includes(e)){o.push(e)}}return o}execute(e={}){this.editor.model.change(t=>{for(const i of this._selectedElements){const n=e.forceValue===undefined?!this.value:e.forceValue;if(n){t.setAttribute(ZS,true,i)}else{t.removeAttribute(ZS,i)}}})}}function eM(e,t){return(i,n,o)=>{const r=o.consumable;if(!r.test(n.item,"insert")||!r.test(n.item,"attribute:listType")||!r.test(n.item,"attribute:listIndent")){return}if(n.item.getAttribute("listType")!="todo"){return}const s=n.item;r.consume(s,"insert");r.consume(s,"attribute:listType");r.consume(s,"attribute:listIndent");r.consume(s,"attribute:todoListChecked");const a=o.writer;const c=GE(s,o);const l=!!s.getAttribute("todoListChecked");const d=sM(s,a,l,t);const u=a.createContainerElement("span",{class:"todo-list__label__description"});a.addClass("todo-list",c.parent);a.insert(a.createPositionAt(c,0),d);a.insert(a.createPositionAfter(d),u);KE(s,c,o,e)}}function tM(e){return(t,i,n)=>{const o=n.consumable;if(!o.test(i.item,"insert")||!o.test(i.item,"attribute:listType")||!o.test(i.item,"attribute:listIndent")){return}if(i.item.getAttribute("listType")!="todo"){return}const r=i.item;o.consume(r,"insert");o.consume(r,"attribute:listType");o.consume(r,"attribute:listIndent");o.consume(r,"attribute:todoListChecked");const s=n.writer;const a=GE(r,n);s.addClass("todo-list",a.parent);const c=s.createContainerElement("label",{class:"todo-list__label"});const l=s.createEmptyElement("input",{type:"checkbox",disabled:"disabled"});const d=s.createContainerElement("span",{class:"todo-list__label__description"});if(r.getAttribute("todoListChecked")){s.setAttribute("checked","checked",l)}s.insert(s.createPositionAt(a,0),c);s.insert(s.createPositionAt(c,0),l);s.insert(s.createPositionAfter(l),d);KE(r,a,n,e)}}function iM(e,t,i){const n=t.modelCursor;const o=n.parent;const r=t.viewItem;if(r.getAttribute("type")!="checkbox"||o.name!="listItem"||!n.isAtStart){return}if(!i.consumable.consume(r,{name:true})){return}const s=i.writer;s.setAttribute("listType","todo",o);if(t.viewItem.hasAttribute("checked")){s.setAttribute("todoListChecked",true,o)}t.modelRange=s.createRange(n)}function nM(e,t){return(i,n,o)=>{const r=o.mapper.toViewElement(n.item);const s=o.writer;const a=aM(r,t);if(n.attributeNewValue=="todo"){const t=!!n.item.getAttribute("todoListChecked");const i=sM(n.item,s,t,e);const o=s.createContainerElement("span",{class:"todo-list__label__description"});const a=s.createRangeIn(r);const c=eS(r);const l=JE(a.start);const d=c?s.createPositionBefore(c):a.end;const u=s.createRange(l,d);s.addClass("todo-list",r.parent);s.move(u,s.createPositionAt(o,0));s.insert(s.createPositionAt(r,0),i);s.insert(s.createPositionAfter(i),o)}else if(n.attributeOldValue=="todo"){const e=cM(r,t);s.removeClass("todo-list",r.parent);s.remove(a);s.move(s.createRangeIn(e),s.createPositionBefore(e));s.remove(e)}}}function oM(e){return(t,i,n)=>{if(i.item.getAttribute("listType")!="todo"){return}if(!n.consumable.consume(i.item,"attribute:todoListChecked")){return}const{mapper:o,writer:r}=n;const s=!!i.item.getAttribute("todoListChecked");const a=o.toViewElement(i.item);const c=a.getChild(0);const l=sM(i.item,r,s,e);r.insert(r.createPositionAfter(c),l);r.remove(c)}}function rM(e){return(t,i)=>{const n=i.modelPosition;const o=n.parent;if(!o.is("element","listItem")||o.getAttribute("listType")!="todo"){return}const r=i.mapper.toViewElement(o);const s=cM(r,e);if(s){i.viewPosition=i.mapper.findPositionIn(s,n.offset)}}}function sM(e,t,i,n){const o=t.createUIElement("label",{class:"todo-list__label",contenteditable:false},(function(t){const o=Ub(document,"input",{type:"checkbox"});if(i){o.setAttribute("checked","checked")}o.addEventListener("change",()=>n(e));const r=this.toDomElement(t);r.appendChild(o);return r}));return o}function aM(e,t){const i=t.createRangeIn(e);for(const e of i){if(e.item.is("uiElement","label")){return e.item}}}function cM(e,t){const i=t.createRangeIn(e);for(const e of i){if(e.item.is("containerElement","span")&&e.item.hasClass("todo-list__label__description")){return e.item}}}class lM extends tk{static get pluginName(){return"TodoListEditing"}static get requires(){return[vS]}init(){const e=this.editor;const{editing:t,data:i,model:n}=e;n.schema.extend("listItem",{allowAttributes:["todoListChecked"]});n.schema.addAttributeCheck((e,t)=>{const i=e.last;if(t=="todoListChecked"&&i.name=="listItem"&&i.getAttribute("listType")!="todo"){return false}});e.commands.add("todoList",new UE(e,"todo"));e.commands.add("todoListCheck",new XS(e));i.downcastDispatcher.on("insert:listItem",tM(n),{priority:"high"});i.upcastDispatcher.on("element:input",iM,{priority:"high"});t.downcastDispatcher.on("insert:listItem",eM(n,e=>this._handleCheckmarkChange(e)),{priority:"high"});t.downcastDispatcher.on("attribute:listType:listItem",nM(e=>this._handleCheckmarkChange(e),t.view));t.downcastDispatcher.on("attribute:todoListChecked:listItem",oM(e=>this._handleCheckmarkChange(e)));t.mapper.on("modelToViewPosition",rM(t.view));i.mapper.on("modelToViewPosition",rM(t.view));this.listenTo(t.view.document,"keydown",dM(n,e.locale));e.keystrokes.set("Ctrl+space",()=>e.execute("todoListCheck"));const o=new Set;this.listenTo(n,"applyOperation",(e,t)=>{const i=t[0];if(i.type=="rename"&&i.oldName=="listItem"){const e=i.position.nodeAfter;if(e.hasAttribute("todoListChecked")){o.add(e)}}else if(i.type=="changeAttribute"&&i.key=="listType"&&i.oldValue==="todo"){for(const e of i.range.getItems()){if(e.hasAttribute("todoListChecked")&&e.getAttribute("listType")!=="todo"){o.add(e)}}}});n.document.registerPostFixer(e=>{let t=false;for(const i of o){e.removeAttribute("todoListChecked",i);t=true}o.clear();return t})}_handleCheckmarkChange(e){const t=this.editor;const i=t.model;const n=Array.from(i.document.selection.getRanges());i.change(i=>{i.setSelection(e,"end");t.execute("todoListCheck");i.setSelection(n)})}}function dM(e,t){return(i,n)=>{const o=jl(n.keyCode,t.contentLanguageDirection);if(o!="left"){return}const r=e.schema;const s=e.document.selection;if(!s.isCollapsed){return}const a=s.getFirstPosition();const c=a.parent;if(c.name==="listItem"&&c.getAttribute("listType")=="todo"&&a.isAtStart){const t=r.getNearestSelectionRange(e.createPositionBefore(c),"backward");if(t){e.change(e=>e.setSelection(t))}n.preventDefault();n.stopPropagation();i.stop()}}}var uM='';class hM extends tk{init(){const e=this.editor.t;XE(this.editor,"todoList",e("To-do List"),uM)}}var fM=i(102);class mM extends tk{static get requires(){return[lM,hM]}static get pluginName(){return"TodoList"}}const gM="underline";class pM extends tk{static get pluginName(){return"UnderlineEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:gM});e.model.schema.setAttributeProperties(gM,{isFormatting:true,copyOnEnter:true});e.conversion.attributeToElement({model:gM,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}});e.commands.add(gM,new Hk(e,gM));e.keystrokes.set("CTRL+U","underline")}}var bM='';const wM="underline";class kM extends tk{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(wM,i=>{const n=e.commands.get(wM);const o=new Tw(i);o.set({label:t("Underline"),icon:bM,keystroke:"CTRL+U",tooltip:true,isToggleable:true});o.bind("isOn","isEnabled").to(n,"value","isEnabled");this.listenTo(o,"execute",()=>{e.execute(wM);e.editing.view.focus()});return o})}}class _M extends tk{static get requires(){return[pM,kM]}static get pluginName(){return"Underline"}}function vM(e){if(e.is("$text")||e.is("$textProxy")){return e.data}let t="";let i=null;for(const n of e.getChildren()){const e=vM(n);if(i&&i.is("element")){t+="\n"}t+=e;i=n}return t}class yM extends tk{constructor(e){super(e);this.set("characters",0);this.set("words",0);Object.defineProperties(this,{characters:{get(){return this.characters=this._getCharacters()}},words:{get(){return this.words=this._getWords()}}});this.set("_wordsLabel");this.set("_charactersLabel");this._config=e.config.get("wordCount")||{};this._outputView;this._wordsMatchRegExp=Cl.features.isRegExpUnicodePropertySupported?new RegExp("[\\p{L}\\p{N}\\p{M}\\p{Pd}\\p{Pc}]+","gu"):/[_\-a-zA-Z0-9À-ž]+/gu}static get pluginName(){return"WordCount"}init(){const e=this.editor;e.model.document.on("change:data",qT(this._refreshStats.bind(this),250));if(typeof this._config.onUpdate=="function"){this.on("update",(e,t)=>{this._config.onUpdate(t)})}if(Gr(this._config.container)){this._config.container.appendChild(this.wordCountContainer)}}destroy(){if(this._outputView){this._outputView.element.remove();this._outputView.destroy()}super.destroy()}get wordCountContainer(){const e=this.editor;const t=e.t;const i=e.config.get("wordCount.displayWords");const n=e.config.get("wordCount.displayCharacters");const o=hb.bind(this,this);const r=[];if(!this._outputView){this._outputView=new jb;if(i||i===undefined){this.bind("_wordsLabel").to(this,"words",e=>t("Words: %0",[e]));r.push({tag:"div",children:[{text:[o.to("_wordsLabel")]}],attributes:{class:"ck-word-count__words"}})}if(n||n===undefined){this.bind("_charactersLabel").to(this,"characters",e=>t("Characters: %0",[e]));r.push({tag:"div",children:[{text:[o.to("_charactersLabel")]}],attributes:{class:"ck-word-count__characters"}})}this._outputView.setTemplate({tag:"div",attributes:{class:["ck","ck-word-count"]},children:r});this._outputView.render()}return this._outputView.element}_getCharacters(){const e=vM(this.editor.model.document.getRoot());return e.replace(/\n/g,"").length}_getWords(){const e=vM(this.editor.model.document.getRoot());const t=e.match(this._wordsMatchRegExp)||[];return t.length}_refreshStats(){const e=this.words=this._getWords();const t=this.characters=this._getCharacters();this.fire("update",{words:e,characters:t})}}class xM extends Xw{}xM.builtinPlugins=[vk,Ek,Fk,Gk,uv,hy,by,Ey,Uy,nx,gx,nA,dT,yT,QT,fC,wC,iP,cP,HE,CS,KS,Yy,QS,mM,_M,yM];var AM=t["default"]=xM}])["default"]})); -//# sourceMappingURL=ckeditor.js.map +!function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"%0 of %1","Align center":"Align center","Align left":"Align left","Align right":"Align right","Almost equal to":"Almost equal to",Angle:"Angle","Approximately equal to":"Approximately equal to",Aquamarine:"Aquamarine","Asterisk operator":"Asterisk operator","Austral sign":"Austral sign","back with leftwards arrow above":"back with leftwards arrow above",Big:"Big","Bitcoin sign":"Bitcoin sign",Black:"Black","Block quote":"Block quote",Blue:"Blue","Blue marker":"Blue marker",Bold:"Bold","Bulleted List":"Bulleted List","Bulleted list styles toolbar":"Bulleted list styles toolbar",Cancel:"Cancel","Cedi sign":"Cedi sign","Cent sign":"Cent sign","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Character categories":"Character categories","Choose heading":"Choose heading",Circle:"Circle","Colon sign":"Colon sign","Contains as member":"Contains as member","Copyright sign":"Copyright sign","Cruzeiro sign":"Cruzeiro sign","Currency sign":"Currency sign",Decimal:"Decimal","Decimal with leading zero":"Decimal with leading zero",Default:"Default","Degree sign":"Degree sign","Dim grey":"Dim grey",Disc:"Disc","Division sign":"Division sign","Document colors":"Document colors","Dollar sign":"Dollar sign","Dong sign":"Dong sign","Double dagger":"Double dagger","Double exclamation mark":"Double exclamation mark","Double low-9 quotation mark":"Double low-9 quotation mark","Double question mark":"Double question mark",Downloadable:"Downloadable","downwards arrow to bar":"downwards arrow to bar","downwards dashed arrow":"downwards dashed arrow","downwards double arrow":"downwards double arrow","Drachma sign":"Drachma sign","Dropdown toolbar":"Dropdown toolbar","Edit link":"Edit link","Editor toolbar":"Editor toolbar","Element of":"Element of","Em dash":"Em dash","Empty set":"Empty set","En dash":"En dash","end with leftwards arrow above":"end with leftwards arrow above","Enter image caption":"Enter image caption","Euro sign":"Euro sign","Euro-currency sign":"Euro-currency sign","Exclamation question mark":"Exclamation question mark","Font Background Color":"Font Background Color","Font Color":"Font Color","Font Family":"Font Family","Font Size":"Font Size","For all":"For all","Fraction slash":"Fraction slash","French franc sign":"French franc sign","Full size image":"Full size image","German penny sign":"German penny sign","Greater-than or equal to":"Greater-than or equal to","Greater-than sign":"Greater-than sign",Green:"Green","Green marker":"Green marker","Green pen":"Green pen",Grey:"Grey","Guarani sign":"Guarani sign",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",Highlight:"Highlight","Horizontal ellipsis":"Horizontal ellipsis","Horizontal line":"Horizontal line","Hryvnia sign":"Hryvnia sign",Huge:"Huge","Identical to":"Identical to","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","Indian rupee sign":"Indian rupee sign",Infinity:"Infinity","Insert image":"Insert image","Insert media":"Insert media","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block",Integral:"Integral",Intersection:"Intersection","Inverted exclamation mark":"Inverted exclamation mark","Inverted question mark":"Inverted question mark",Italic:"Italic",Justify:"Justify","Kip sign":"Kip sign","Latin capital letter a with breve":"Latin capital letter a with breve","Latin capital letter a with macron":"Latin capital letter a with macron","Latin capital letter a with ogonek":"Latin capital letter a with ogonek","Latin capital letter c with acute":"Latin capital letter c with acute","Latin capital letter c with caron":"Latin capital letter c with caron","Latin capital letter c with circumflex":"Latin capital letter c with circumflex","Latin capital letter c with dot above":"Latin capital letter c with dot above","Latin capital letter d with caron":"Latin capital letter d with caron","Latin capital letter d with stroke":"Latin capital letter d with stroke","Latin capital letter e with breve":"Latin capital letter e with breve","Latin capital letter e with caron":"Latin capital letter e with caron","Latin capital letter e with dot above":"Latin capital letter e with dot above","Latin capital letter e with macron":"Latin capital letter e with macron","Latin capital letter e with ogonek":"Latin capital letter e with ogonek","Latin capital letter eng":"Latin capital letter eng","Latin capital letter g with breve":"Latin capital letter g with breve","Latin capital letter g with cedilla":"Latin capital letter g with cedilla","Latin capital letter g with circumflex":"Latin capital letter g with circumflex","Latin capital letter g with dot above":"Latin capital letter g with dot above","Latin capital letter h with circumflex":"Latin capital letter h with circumflex","Latin capital letter h with stroke":"Latin capital letter h with stroke","Latin capital letter i with breve":"Latin capital letter i with breve","Latin capital letter i with dot above":"Latin capital letter i with dot above","Latin capital letter i with macron":"Latin capital letter i with macron","Latin capital letter i with ogonek":"Latin capital letter i with ogonek","Latin capital letter i with tilde":"Latin capital letter i with tilde","Latin capital letter j with circumflex":"Latin capital letter j with circumflex","Latin capital letter k with cedilla":"Latin capital letter k with cedilla","Latin capital letter l with acute":"Latin capital letter l with acute","Latin capital letter l with caron":"Latin capital letter l with caron","Latin capital letter l with cedilla":"Latin capital letter l with cedilla","Latin capital letter l with middle dot":"Latin capital letter l with middle dot","Latin capital letter l with stroke":"Latin capital letter l with stroke","Latin capital letter n with acute":"Latin capital letter n with acute","Latin capital letter n with caron":"Latin capital letter n with caron","Latin capital letter n with cedilla":"Latin capital letter n with cedilla","Latin capital letter o with breve":"Latin capital letter o with breve","Latin capital letter o with double acute":"Latin capital letter o with double acute","Latin capital letter o with macron":"Latin capital letter o with macron","Latin capital letter r with acute":"Latin capital letter r with acute","Latin capital letter r with caron":"Latin capital letter r with caron","Latin capital letter r with cedilla":"Latin capital letter r with cedilla","Latin capital letter s with acute":"Latin capital letter s with acute","Latin capital letter s with caron":"Latin capital letter s with caron","Latin capital letter s with cedilla":"Latin capital letter s with cedilla","Latin capital letter s with circumflex":"Latin capital letter s with circumflex","Latin capital letter t with caron":"Latin capital letter t with caron","Latin capital letter t with cedilla":"Latin capital letter t with cedilla","Latin capital letter t with stroke":"Latin capital letter t with stroke","Latin capital letter u with breve":"Latin capital letter u with breve","Latin capital letter u with double acute":"Latin capital letter u with double acute","Latin capital letter u with macron":"Latin capital letter u with macron","Latin capital letter u with ogonek":"Latin capital letter u with ogonek","Latin capital letter u with ring above":"Latin capital letter u with ring above","Latin capital letter u with tilde":"Latin capital letter u with tilde","Latin capital letter w with circumflex":"Latin capital letter w with circumflex","Latin capital letter y with circumflex":"Latin capital letter y with circumflex","Latin capital letter y with diaeresis":"Latin capital letter y with diaeresis","Latin capital letter z with acute":"Latin capital letter z with acute","Latin capital letter z with caron":"Latin capital letter z with caron","Latin capital letter z with dot above":"Latin capital letter z with dot above","Latin capital ligature ij":"Latin capital ligature ij","Latin capital ligature oe":"Latin capital ligature oe","Latin small letter a with breve":"Latin small letter a with breve","Latin small letter a with macron":"Latin small letter a with macron","Latin small letter a with ogonek":"Latin small letter a with ogonek","Latin small letter c with acute":"Latin small letter c with acute","Latin small letter c with caron":"Latin small letter c with caron","Latin small letter c with circumflex":"Latin small letter c with circumflex","Latin small letter c with dot above":"Latin small letter c with dot above","Latin small letter d with caron":"Latin small letter d with caron","Latin small letter d with stroke":"Latin small letter d with stroke","Latin small letter dotless i":"Latin small letter dotless i","Latin small letter e with breve":"Latin small letter e with breve","Latin small letter e with caron":"Latin small letter e with caron","Latin small letter e with dot above":"Latin small letter e with dot above","Latin small letter e with macron":"Latin small letter e with macron","Latin small letter e with ogonek":"Latin small letter e with ogonek","Latin small letter eng":"Latin small letter eng","Latin small letter f with hook":"Latin small letter f with hook","Latin small letter g with breve":"Latin small letter g with breve","Latin small letter g with cedilla":"Latin small letter g with cedilla","Latin small letter g with circumflex":"Latin small letter g with circumflex","Latin small letter g with dot above":"Latin small letter g with dot above","Latin small letter h with circumflex":"Latin small letter h with circumflex","Latin small letter h with stroke":"Latin small letter h with stroke","Latin small letter i with breve":"Latin small letter i with breve","Latin small letter i with macron":"Latin small letter i with macron","Latin small letter i with ogonek":"Latin small letter i with ogonek","Latin small letter i with tilde":"Latin small letter i with tilde","Latin small letter j with circumflex":"Latin small letter j with circumflex","Latin small letter k with cedilla":"Latin small letter k with cedilla","Latin small letter kra":"Latin small letter kra","Latin small letter l with acute":"Latin small letter l with acute","Latin small letter l with caron":"Latin small letter l with caron","Latin small letter l with cedilla":"Latin small letter l with cedilla","Latin small letter l with middle dot":"Latin small letter l with middle dot","Latin small letter l with stroke":"Latin small letter l with stroke","Latin small letter long s":"Latin small letter long s","Latin small letter n preceded by apostrophe":"Latin small letter n preceded by apostrophe","Latin small letter n with acute":"Latin small letter n with acute","Latin small letter n with caron":"Latin small letter n with caron","Latin small letter n with cedilla":"Latin small letter n with cedilla","Latin small letter o with breve":"Latin small letter o with breve","Latin small letter o with double acute":"Latin small letter o with double acute","Latin small letter o with macron":"Latin small letter o with macron","Latin small letter r with acute":"Latin small letter r with acute","Latin small letter r with caron":"Latin small letter r with caron","Latin small letter r with cedilla":"Latin small letter r with cedilla","Latin small letter s with acute":"Latin small letter s with acute","Latin small letter s with caron":"Latin small letter s with caron","Latin small letter s with cedilla":"Latin small letter s with cedilla","Latin small letter s with circumflex":"Latin small letter s with circumflex","Latin small letter t with caron":"Latin small letter t with caron","Latin small letter t with cedilla":"Latin small letter t with cedilla","Latin small letter t with stroke":"Latin small letter t with stroke","Latin small letter u with breve":"Latin small letter u with breve","Latin small letter u with double acute":"Latin small letter u with double acute","Latin small letter u with macron":"Latin small letter u with macron","Latin small letter u with ogonek":"Latin small letter u with ogonek","Latin small letter u with ring above":"Latin small letter u with ring above","Latin small letter u with tilde":"Latin small letter u with tilde","Latin small letter w with circumflex":"Latin small letter w with circumflex","Latin small letter y with circumflex":"Latin small letter y with circumflex","Latin small letter z with acute":"Latin small letter z with acute","Latin small letter z with caron":"Latin small letter z with caron","Latin small letter z with dot above":"Latin small letter z with dot above","Latin small ligature ij":"Latin small ligature ij","Latin small ligature oe":"Latin small ligature oe","Left aligned image":"Left aligned image","Left double quotation mark":"Left double quotation mark","Left single quotation mark":"Left single quotation mark","Left-pointing double angle quotation mark":"Left-pointing double angle quotation mark","leftwards arrow to bar":"leftwards arrow to bar","leftwards dashed arrow":"leftwards dashed arrow","leftwards double arrow":"leftwards double arrow","Less-than or equal to":"Less-than or equal to","Less-than sign":"Less-than sign","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link URL":"Link URL","Lira sign":"Lira sign","Livre tournois sign":"Livre tournois sign","Logical and":"Logical and","Logical or":"Logical or","Lower-latin":"Lower-latin","Lower–roman":"Lower–roman",Macron:"Macron","Manat sign":"Manat sign","Media toolbar":"Media toolbar","Media URL":"Media URL","media widget":"media widget","Mill sign":"Mill sign","Minus sign":"Minus sign","Multiplication sign":"Multiplication sign","N-ary product":"N-ary product","N-ary summation":"N-ary summation",Nabla:"Nabla","Naira sign":"Naira sign","New sheqel sign":"New sheqel sign",Next:"Next","Nordic mark sign":"Nordic mark sign","Not an element of":"Not an element of","Not equal to":"Not equal to","Not sign":"Not sign","Numbered List":"Numbered List","Numbered list styles toolbar":"Numbered list styles toolbar","on with exclamation mark with left right arrow above":"on with exclamation mark with left right arrow above","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Orange:"Orange",Original:"Original",Overline:"Overline",Paragraph:"Paragraph","Paragraph sign":"Paragraph sign","Partial differential":"Partial differential","Paste the media URL in the input.":"Paste the media URL in the input.","Per mille sign":"Per mille sign","Per ten thousand sign":"Per ten thousand sign","Peseta sign":"Peseta sign","Peso sign":"Peso sign","Pink marker":"Pink marker","Plus-minus sign":"Plus-minus sign","Pound sign":"Pound sign",Previous:"Previous","Proportional to":"Proportional to",Purple:"Purple","Question exclamation mark":"Question exclamation mark",Red:"Red","Red pen":"Red pen",Redo:"Redo","Registered sign":"Registered sign","Remove color":"Remove color","Remove highlight":"Remove highlight","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Reversed paragraph sign":"Reversed paragraph sign","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image","Right double quotation mark":"Right double quotation mark","Right single quotation mark":"Right single quotation mark","Right-pointing double angle quotation mark":"Right-pointing double angle quotation mark","rightwards arrow to bar":"rightwards arrow to bar","rightwards dashed arrow":"rightwards dashed arrow","rightwards double arrow":"rightwards double arrow","Ruble sign":"Ruble sign","Rupee sign":"Rupee sign",Save:"Save","Saving changes":"Saving changes","Section sign":"Section sign","Select all":"Select all","Show more items":"Show more items","Side image":"Side image","Single left-pointing angle quotation mark":"Single left-pointing angle quotation mark","Single low-9 quotation mark":"Single low-9 quotation mark","Single right-pointing angle quotation mark":"Single right-pointing angle quotation mark",Small:"Small","soon with rightwards arrow above":"soon with rightwards arrow above","Special characters":"Special characters","Spesmilo sign":"Spesmilo sign",Square:"Square","Square root":"Square root","Tenge sign":"Tenge sign","Text alignment":"Text alignment","Text alignment toolbar":"Text alignment toolbar","Text alternative":"Text alternative","Text highlight toolbar":"Text highlight toolbar","The URL must not be empty.":"The URL must not be empty.","There exists":"There exists","This link has no URL":"This link has no URL","This media URL is not supported.":"This media URL is not supported.","Tilde operator":"Tilde operator",Tiny:"Tiny","Tip: Paste the URL into the content to embed faster.":"Tip: Paste the URL into the content to embed faster.","To-do List":"To-do List","Toggle the circle list style":"Toggle the circle list style","Toggle the decimal list style":"Toggle the decimal list style","Toggle the decimal with leading zero list style":"Toggle the decimal with leading zero list style","Toggle the disc list style":"Toggle the disc list style","Toggle the lower–latin list style":"Toggle the lower–latin list style","Toggle the lower–roman list style":"Toggle the lower–roman list style","Toggle the square list style":"Toggle the square list style","Toggle the upper–latin list style":"Toggle the upper–latin list style","Toggle the upper–roman list style":"Toggle the upper–roman list style","top with upwards arrow above":"top with upwards arrow above","Trade mark sign":"Trade mark sign","Tugrik sign":"Tugrik sign","Turkish lira sign":"Turkish lira sign",Turquoise:"Turquoise","Two dot leader":"Two dot leader",Underline:"Underline",Undo:"Undo",Union:"Union",Unlink:"Unlink","up down arrow with base":"up down arrow with base","Upload failed":"Upload failed","Upload in progress":"Upload in progress","Upper-latin":"Upper-latin","Upper-roman":"Upper-roman","upwards arrow to bar":"upwards arrow to bar","upwards dashed arrow":"upwards dashed arrow","upwards double arrow":"upwards double arrow","Vulgar fraction one half":"Vulgar fraction one half","Vulgar fraction one quarter":"Vulgar fraction one quarter","Vulgar fraction three quarters":"Vulgar fraction three quarters",White:"White","Widget toolbar":"Widget toolbar","Won sign":"Won sign",Yellow:"Yellow","Yellow marker":"Yellow marker","Yen sign":"Yen sign"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClassicEditor=e():t.ClassicEditor=e()}(window,(function(){return function(t){var e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(o,n,function(e){return t[e]}.bind(null,n));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=116)}([function(t,e,i){"use strict";i.d(e,"a",(function(){return o})),i.d(e,"c",(function(){return n})),i.d(e,"b",(function(){return r}));class o extends Error{constructor(t,e,i){super(`${t}${i?" "+JSON.stringify(i):""}${s(t)}`),this.name="CKEditorError",this.context=e,this.data=i}is(t){return"CKEditorError"===t}static rethrowUnexpectedError(t,e){if(t.is&&t.is("CKEditorError"))throw t;const i=new o(t.message,e);throw i.stack=t.stack,i}}function n(t,e){console.warn(...a(t,e))}function r(t,e){console.error(...a(t,e))}function s(t){return"\nRead more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-"+t}function a(t,e){const i=s(t);return e?[t,e,i]:[t,i]}},function(t,e,i){"use strict";var o,n=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},r=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),s=[];function a(t){for(var e=-1,i=0;i: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(t,e,i){var o=i(1),n=i(21);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(t,e,i){var o=i(1),n=i(23);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}"},function(t,e,i){var o=i(1),n=i(25);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);position:absolute}.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(t,e,i){var o=i(1),n=i(27);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}"},function(t,e,i){var o=i(1),n=i(29);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s;border-style:solid;left:50%}.ck.ck-tooltip.ck-tooltip_s,.ck.ck-tooltip.ck-tooltip_se,.ck.ck-tooltip.ck-tooltip_sw{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{top:calc(var(--ck-tooltip-arrow-size)*-1 + 1px);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_sw{right:50%;left:auto}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text{left:auto;right:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{left:auto;right:0}.ck.ck-tooltip.ck-tooltip_se{left:50%;right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text{right:auto;left:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after{right:auto;left:0;transform:translateX(50%)}.ck.ck-tooltip.ck-tooltip_n{top:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_e{left:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text:after{left:calc(var(--ck-tooltip-arrow-size)*-1);top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:transparent;border-bottom-color:transparent;border-right-color:var(--ck-color-tooltip-background);border-top-color:transparent;border-left-width:0;border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_w{right:calc(100% + var(--ck-tooltip-arrow-size));left:auto;top:50%}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text:after{left:100%;top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:var(--ck-color-tooltip-background);border-bottom-color:transparent;border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:0;border-top-width:var(--ck-tooltip-arrow-size)}'},function(t,e,i){var o=i(1),n=i(31);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button .ck-button__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(t,e,i){var o=i(1),n=i(33);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;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(t,e,i){var o=i(1),n=i(35);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-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(t,e,i){var o=i(1),n=i(37);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown .ck-dropdown__panel{width:max-content;max-width:var(--ck-toolbar-dropdown-max-width)}.ck.ck-toolbar-dropdown .ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}"},function(t,e,i){var o=i(1),n=i(39);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}"},function(t,e,i){var o=i(1),n=i(41);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row nowrap;align-items:center}.ck.ck-toolbar>.ck-toolbar__items{display:flex;flex-flow:row wrap;align-items:center;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;width:1px;min-width:1px;background:var(--ck-color-toolbar-border);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-right:var(--ck-spacing-small)}"},function(t,e,i){var o=i(1),n=i(43);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}"},function(t,e,i){var o=i(1),n=i(45);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}"},function(t,e,i){var o=i(1),n=i(47);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#000}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{width:var(--ck-color-grid-tile-size);height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{display:none;color:var(--ck-color-color-grid-check-icon)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}"},function(t,e,i){var o=i(1),n=i(49);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(51);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e){t.exports=".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}"},function(t,e,i){var o=i(1),n=i(54);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button .ck-tooltip{display:none}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__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(t,e,i){var o=i(1),n=i(56);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=":root{--ck-highlight-marker-yellow:#fdfd77;--ck-highlight-marker-green:#62f962;--ck-highlight-marker-pink:#fc7899;--ck-highlight-marker-blue:#72ccfd;--ck-highlight-pen-red:#e71313;--ck-highlight-pen-green:#128a00}.ck-content .marker-yellow{background-color:var(--ck-highlight-marker-yellow)}.ck-content .marker-green{background-color:var(--ck-highlight-marker-green)}.ck-content .marker-pink{background-color:var(--ck-highlight-marker-pink)}.ck-content .marker-blue{background-color:var(--ck-highlight-marker-blue)}.ck-content .pen-red{color:var(--ck-highlight-pen-red);background-color:transparent}.ck-content .pen-green{color:var(--ck-highlight-pen-green);background-color:transparent}"},function(t,e,i){var o=i(1),n=i(58);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-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(t,e,i){var o=i(1),n=i(60);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck-editor__editable .ck-horizontal-line{display:flow-root}.ck-content hr{margin:15px 0;height:4px;background:#dedede;border:0}"},function(t,e,i){var o=i(1),n=i(62);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports='.ck .ck-widget .ck-widget__type-around__button{display:block;position:absolute;overflow:hidden;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{position:absolute;top:50%;left:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{top:calc(var(--ck-widget-outline-thickness)*-0.5);left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-0.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:"";display:block;position:absolute;top:1px;left:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;position:absolute;left:0;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{width:var(--ck-widget-type-around-button-size);height:var(--ck-widget-type-around-button-size);background:var(--ck-color-widget-type-around-button);border-radius:100px;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);opacity:0;pointer-events:none}.ck .ck-widget .ck-widget__type-around__button svg{width:10px;height:8px;transform:translate(-50%,-50%);transition:transform .5s ease;margin-top:1px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{width:calc(var(--ck-widget-type-around-button-size) - 2px);height:calc(var(--ck-widget-type-around-button-size) - 2px);border-radius:100px;background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3))}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{pointer-events:none;height:1px;animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;outline:1px solid hsla(0,0%,100%,.5);background:var(--ck-color-base-text)}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}'},function(t,e,i){var o=i(1),n=i(64);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(66);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{pointer-events:none;transform-origin:0 0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);background:var(--ck-color-labeled-field-label-background);padding:0 calc(var(--ck-font-size-tiny)*0.5);line-height:normal;font-weight:400;text-overflow:ellipsis;overflow:hidden;max-width:100%;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-spacing-medium),calc(var(--ck-font-size-base)*0.6)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-spacing-medium)*-1),calc(var(--ck-font-size-base)*0.6)) scale(1)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));background:transparent;padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}"},function(t,e,i){var o=i(1),n=i(68);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"},function(t,e,i){var o=i(1),n=i(70);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}"},function(t,e){t.exports='.ck-vertical-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-text-width)*0.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-large);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after,[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}'},function(t,e,i){var o=i(1),n=i(73);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck .ck-balloon-rotator__navigation{display:flex;align-items:center;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}"},function(t,e,i){var o=i(1),n=i(75);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);width:100%;height:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}"},function(t,e,i){var o=i(1),n=i(77);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(79);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(81);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(83);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(85);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(87);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(89);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports='.ck-image-upload-complete-icon{display:block;position:absolute;top:10px;right:10px;border-radius:50%}.ck-image-upload-complete-icon:after{content:"";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20px;--ck-image-upload-icon-width:2px}.ck-image-upload-complete-icon{width:var(--ck-image-upload-icon-size);height:var(--ck-image-upload-icon-size);opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:var(--ck-image-upload-icon-size);animation-delay:0ms,3s}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}'},function(t,e,i){var o=i(1),n=i(91);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports='.ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}'},function(t,e,i){var o=i(1),n=i(93);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(95);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"},function(t,e,i){var o=i(1),n=i(97);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}"},function(t,e,i){var o=i(1),n=i(99);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-list-styles-dropdown>.ck-dropdown__panel>.ck-toolbar>.ck-toolbar__items{display:grid}:root{--ck-list-style-button-size:44px}.ck.ck-list-styles-dropdown>.ck-dropdown__panel>.ck-toolbar{background:none;padding:0}.ck.ck-list-styles-dropdown>.ck-dropdown__panel>.ck-toolbar>.ck-toolbar__items{grid-template-columns:repeat(3,auto);row-gap:var(--ck-spacing-medium);column-gap:var(--ck-spacing-medium);padding:var(--ck-spacing-medium)}.ck.ck-list-styles-dropdown>.ck-dropdown__panel>.ck-toolbar>.ck-toolbar__items .ck-button{width:var(--ck-list-style-button-size);height:var(--ck-list-style-button-size);padding:0;margin:0;box-sizing:content-box}.ck.ck-list-styles-dropdown>.ck-dropdown__panel>.ck-toolbar>.ck-toolbar__items .ck-button .ck-icon{width:var(--ck-list-style-button-size);height:var(--ck-list-style-button-size)}"},function(t,e,i){var o=i(1),n=i(101);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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(t,e,i){var o=i(1),n=i(103);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.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%}}"},function(t,e,i){var o=i(1),n=i(105);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck-content .media{clear:both;margin:1em 0;display:block;min-width:15em}"},function(t,e,i){var o=i(1),n=i(107);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-form__header{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{padding:var(--ck-spacing-small) var(--ck-spacing-large);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-form__header .ck-form__header__label{font-weight:700}"},function(t,e,i){var o=i(1),n=i(109);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-character-grid .ck-character-grid__tiles{display:grid;grid-template-columns:repeat(10,1fr)}:root{--ck-character-grid-tile-size:24px}.ck.ck-character-grid{overflow-y:auto;overflow-x:hidden;width:350px;max-height:200px}.ck.ck-character-grid .ck-character-grid__tiles{margin:var(--ck-spacing-standard) var(--ck-spacing-large);grid-gap:var(--ck-spacing-standard)}.ck.ck-character-grid .ck-character-grid__tile{width:var(--ck-character-grid-tile-size);height:var(--ck-character-grid-tile-size);min-width:var(--ck-character-grid-tile-size);min-height:var(--ck-character-grid-tile-size);font-size:1.2em;padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-character-grid .ck-character-grid__tile:focus:not(.ck-disabled),.ck.ck-character-grid .ck-character-grid__tile:hover:not(.ck-disabled){border:0;box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-character-grid .ck-character-grid__tile .ck-button__label{line-height:var(--ck-character-grid-tile-size);width:100%;text-align:center}"},function(t,e,i){var o=i(1),n=i(111);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-character-info{display:flex;justify-content:space-between;padding:var(--ck-spacing-small) var(--ck-spacing-large);border-top:1px solid var(--ck-color-base-border)}.ck.ck-character-info>*{text-transform:uppercase;font-size:var(--ck-font-size-small)}.ck.ck-character-info .ck-character-info__name{max-width:280px;text-overflow:ellipsis;overflow:hidden}.ck.ck-character-info .ck-character-info__code{opacity:.6}"},function(t,e,i){var o=i(1),n=i(113);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=".ck.ck-special-characters-navigation>.ck-label{max-width:160px;text-overflow:ellipsis;overflow:hidden}.ck.ck-special-characters-navigation>.ck-dropdown .ck-dropdown__panel{max-height:250px;overflow-y:auto;overflow-x:hidden}"},function(t,e,i){var o=i(1),n=i(115);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[t.i,n,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};o(n,r);t.exports=n.locals||{}},function(t,e){t.exports=':root{--ck-todo-list-checkmark-size:16px}.ck-content .todo-list{list-style:none}.ck-content .todo-list li{margin-bottom:5px}.ck-content .todo-list li .todo-list{margin-top:5px}.ck-content .todo-list .todo-list__label>input{-webkit-appearance:none;display:inline-block;position:relative;width:var(--ck-todo-list-checkmark-size);height:var(--ck-todo-list-checkmark-size);vertical-align:middle;border:0;left:-25px;margin-right:-15px;right:0;margin-left:0}.ck-content .todo-list .todo-list__label>input:before{display:block;position:absolute;box-sizing:border-box;content:"";width:100%;height:100%;border:1px solid #333;border-radius:2px;transition:box-shadow .25s ease-in-out,background .25s ease-in-out,border .25s ease-in-out}.ck-content .todo-list .todo-list__label>input:after{display:block;position:absolute;box-sizing:content-box;pointer-events:none;content:"";left:calc(var(--ck-todo-list-checkmark-size)/3);top:calc(var(--ck-todo-list-checkmark-size)/5.3);width:calc(var(--ck-todo-list-checkmark-size)/5.3);height:calc(var(--ck-todo-list-checkmark-size)/2.6);border-left:0 solid transparent;border-bottom:calc(var(--ck-todo-list-checkmark-size)/8) solid transparent;border-right:calc(var(--ck-todo-list-checkmark-size)/8) solid transparent;border-top:0 solid transparent;transform:rotate(45deg)}.ck-content .todo-list .todo-list__label>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-content .todo-list .todo-list__label>input[checked]:after{border-color:#fff}.ck-content .todo-list .todo-list__label .todo-list__label__description{vertical-align:middle}[dir=rtl] .todo-list .todo-list__label>input{left:0;margin-right:0;right:-25px;margin-left:-15px}.ck-editor__editable .todo-list .todo-list__label>input{cursor:pointer}.ck-editor__editable .todo-list .todo-list__label>input:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}'},function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return hb}));var o=i(3),n=o.a.Symbol,r=Object.prototype,s=r.hasOwnProperty,a=r.toString,l=n?n.toStringTag:void 0;var c=function(t){var e=s.call(t,l),i=t[l];try{t[l]=void 0;var o=!0}catch(t){}var n=a.call(t);return o&&(e?t[l]=i:delete t[l]),n},d=Object.prototype.toString;var h=function(t){return d.call(t)},u=n?n.toStringTag:void 0;var g=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":u&&u in Object(t)?c(t):h(t)};var m=function(t,e){return function(i){return t(e(i))}},f=m(Object.getPrototypeOf,Object);var p=function(t){return null!=t&&"object"==typeof t},b=Function.prototype,w=Object.prototype,k=b.toString,_=w.hasOwnProperty,v=k.call(Object);var y=function(t){if(!p(t)||"[object Object]"!=g(t))return!1;var e=f(t);if(null===e)return!0;var i=_.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&k.call(i)==v};var x=function(){this.__data__=[],this.size=0};var A=function(t,e){return t===e||t!=t&&e!=e};var T=function(t,e){for(var i=t.length;i--;)if(A(t[i][0],e))return i;return-1},C=Array.prototype.splice;var S=function(t){var e=this.__data__,i=T(e,t);return!(i<0)&&(i==e.length-1?e.pop():C.call(e,i,1),--this.size,!0)};var P=function(t){var e=this.__data__,i=T(e,t);return i<0?void 0:e[i][1]};var E=function(t){return T(this.__data__,t)>-1};var M=function(t,e){var i=this.__data__,o=T(i,t);return o<0?(++this.size,i.push([t,e])):i[o][1]=e,this};function L(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991},Bt={};Bt["[object Float32Array]"]=Bt["[object Float64Array]"]=Bt["[object Int8Array]"]=Bt["[object Int16Array]"]=Bt["[object Int32Array]"]=Bt["[object Uint8Array]"]=Bt["[object Uint8ClampedArray]"]=Bt["[object Uint16Array]"]=Bt["[object Uint32Array]"]=!0,Bt["[object Arguments]"]=Bt["[object Array]"]=Bt["[object ArrayBuffer]"]=Bt["[object Boolean]"]=Bt["[object DataView]"]=Bt["[object Date]"]=Bt["[object Error]"]=Bt["[object Function]"]=Bt["[object Map]"]=Bt["[object Number]"]=Bt["[object Object]"]=Bt["[object RegExp]"]=Bt["[object Set]"]=Bt["[object String]"]=Bt["[object WeakMap]"]=!1;var Ft=function(t){return p(t)&&jt(t.length)&&!!Bt[g(t)]};var Ht=function(t){return function(e){return t(e)}},Ut=i(5),qt=Ut.a&&Ut.a.isTypedArray,Wt=qt?Ht(qt):Ft,$t=Object.prototype.hasOwnProperty;var Gt=function(t,e){var i=Ot(t),o=!i&&zt(t),n=!i&&!o&&Object(Rt.a)(t),r=!i&&!o&&!n&&Wt(t),s=i||o||n||r,a=s?Et(t.length,String):[],l=a.length;for(var c in t)!e&&!$t.call(t,c)||s&&("length"==c||n&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Vt(c,l))||a.push(c);return a},Yt=Object.prototype;var Kt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Yt)},Qt=m(Object.keys,Object),Jt=Object.prototype.hasOwnProperty;var Zt=function(t){if(!Kt(t))return Qt(t);var e=[];for(var i in Object(t))Jt.call(t,i)&&"constructor"!=i&&e.push(i);return e};var Xt=function(t){return null!=t&&jt(t.length)&&!j(t)};var te=function(t){return Xt(t)?Gt(t):Zt(t)};var ee=function(t,e){return t&&Pt(e,te(e),t)};var ie=function(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e},oe=Object.prototype.hasOwnProperty;var ne=function(t){if(!D(t))return ie(t);var e=Kt(t),i=[];for(var o in t)("constructor"!=o||!e&&oe.call(t,o))&&i.push(o);return i};var re=function(t){return Xt(t)?Gt(t,!0):ne(t)};var se=function(t,e){return t&&Pt(e,re(e),t)},ae=i(9);var le=function(t,e){var i=-1,o=t.length;for(e||(e=Array(o));++i{this._setToTarget(t,o,e[o],i)})}}function ni(t){return ei(t,ri)}function ri(t){return ii(t)?t:void 0}var si=function(){return function t(){t.called=!0}};class ai{constructor(t,e){this.source=t,this.name=e,this.path=[],this.stop=si(),this.off=si()}}const li=new Array(256).fill().map((t,e)=>("0"+e.toString(16)).slice(-2));function ci(){const t=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0,o=4294967296*Math.random()>>>0;return"e"+li[t>>0&255]+li[t>>8&255]+li[t>>16&255]+li[t>>24&255]+li[e>>0&255]+li[e>>8&255]+li[e>>16&255]+li[e>>24&255]+li[i>>0&255]+li[i>>8&255]+li[i>>16&255]+li[i>>24&255]+li[o>>0&255]+li[o>>8&255]+li[o>>16&255]+li[o>>24&255]}var di={get(t){return"number"!=typeof t?this[t]||this.normal:t},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5},hi=(i(6),i(0));const ui=Symbol("listeningTo"),gi=Symbol("emitterId");var mi={on(t,e,i={}){this.listenTo(this,t,e,i)},once(t,e,i){let o=!1;this.listenTo(this,t,(function(t,...i){o||(o=!0,t.off(),e.call(this,t,...i))}),i)},off(t,e){this.stopListening(this,t,e)},listenTo(t,e,i,o={}){let n,r;this[ui]||(this[ui]={});const s=this[ui];pi(t)||fi(t);const a=pi(t);(n=s[a])||(n=s[a]={emitter:t,callbacks:{}}),(r=n.callbacks[e])||(r=n.callbacks[e]=[]),r.push(i),function(t,e){const i=bi(t);if(i[e])return;let o=e,n=null;const r=[];for(;""!==o&&!i[o];)i[o]={callbacks:[],childEvents:[]},r.push(i[o]),n&&i[o].childEvents.push(n),n=o,o=o.substr(0,o.lastIndexOf(":"));if(""!==o){for(const t of r)t.callbacks=i[o].callbacks.slice();i[o].childEvents.push(n)}}(t,e);const l=wi(t,e),c=di.get(o.priority),d={callback:i,priority:c};for(const t of l){let e=!1;for(let i=0;i-1?t(e,i.substr(0,i.lastIndexOf(":"))):null;return o.callbacks}(this,o);if(i.path.push(this),n){const t=[i,...e];n=Array.from(n);for(let e=0;e{this._delegations||(this._delegations=new Map),t.forEach(t=>{const o=this._delegations.get(t);o?o.set(e,i):this._delegations.set(t,new Map([[e,i]]))})}}},stopDelegating(t,e){if(this._delegations)if(t)if(e){const i=this._delegations.get(t);i&&i.delete(e)}else this._delegations.delete(t);else this._delegations.clear()}};function fi(t,e){t[gi]||(t[gi]=e||ci())}function pi(t){return t[gi]}function bi(t){return t._events||Object.defineProperty(t,"_events",{value:{}}),t._events}function wi(t,e){const i=bi(t)[e];if(!i)return[];let o=[i.callbacks];for(let e=0;e{Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e)).forEach(i=>{if(i in t.prototype)return;const o=Object.getOwnPropertyDescriptor(e,i);o.enumerable=!1,Object.defineProperty(t.prototype,i,o)})})}class xi{constructor(t={},e={}){const i=vi(t);if(i||(e=t),this._items=[],this._itemMap=new Map,this._idProperty=e.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],i)for(const e of t)this._items.push(e),this._itemMap.set(this._getItemIdBeforeAdding(e),e)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(t,e){return this.addMany([t],e)}addMany(t,e){if(void 0===e)e=this._items.length;else if(e>this._items.length||e<0)throw new hi.a("collection-add-item-invalid-index",this);for(let i=0;i{this._setUpBindToBinding(e=>new t(e))},using:t=>{"function"==typeof t?this._setUpBindToBinding(e=>t(e)):this._setUpBindToBinding(e=>e[t])}}}_setUpBindToBinding(t){const e=this._bindToCollection,i=(i,o,n)=>{const r=e._bindToCollection==this,s=e._bindToInternalToExternalMap.get(o);if(r&&s)this._bindToExternalToInternalMap.set(o,s),this._bindToInternalToExternalMap.set(s,o);else{const i=t(o);if(!i)return void this._skippedIndexesFromExternal.push(n);let r=n;for(const t of this._skippedIndexesFromExternal)n>t&&r--;for(const t of e._skippedIndexesFromExternal)r>=t&&r++;this._bindToExternalToInternalMap.set(o,i),this._bindToInternalToExternalMap.set(i,o),this.add(i,r);for(let t=0;t{const o=this._bindToExternalToInternalMap.get(e);o&&this.remove(o),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((t,e)=>(ie&&t.push(e),t),[])})}_getItemIdBeforeAdding(t){const e=this._idProperty;let i;if(e in t){if(i=t[e],"string"!=typeof i)throw new hi.a("collection-add-invalid-id",this);if(this.get(i))throw new hi.a("collection-add-item-already-exists",this)}else t[e]=i=ci();return i}_remove(t){let e,i,o,n=!1;const r=this._idProperty;if("string"==typeof t?(i=t,o=this._itemMap.get(i),n=!o,o&&(e=this._items.indexOf(o))):"number"==typeof t?(e=t,o=this._items[e],n=!o,o&&(i=o[r])):(o=t,i=o[r],e=this._items.indexOf(o),n=-1==e||!this._itemMap.get(i)),n)throw new hi.a("collection-remove-404",this);this._items.splice(e,1),this._itemMap.delete(i);const s=this._bindToInternalToExternalMap.get(o);return this._bindToInternalToExternalMap.delete(o),this._bindToExternalToInternalMap.delete(s),this.fire("remove",o,e),[o,e]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}yi(xi,mi);class Ai{constructor(t,e=[],i=[]){this._context=t,this._plugins=new Map,this._availablePlugins=new Map;for(const t of e)t.pluginName&&this._availablePlugins.set(t.pluginName,t);this._contextPlugins=new Map;for(const[t,e]of i)this._contextPlugins.set(t,e),this._contextPlugins.set(e,t),t.pluginName&&this._availablePlugins.set(t.pluginName,t)}*[Symbol.iterator](){for(const t of this._plugins)"function"==typeof t[0]&&(yield t)}get(t){const e=this._plugins.get(t);if(!e){let e=t;throw"function"==typeof t&&(e=t.pluginName||t.name),new hi.a("plugincollection-plugin-not-loaded",this._context,{plugin:e})}return e}has(t){return this._plugins.has(t)}init(t,e=[]){const i=this,o=this._context,n=new Set,r=[],s=u(t),a=u(e),l=function(t){const e=[];for(const i of t)h(i)||e.push(i);return e.length?e:null}(t);if(l){const t="plugincollection-plugin-not-found";return Object(hi.b)(t,{plugins:l}),Promise.reject(new hi.a(t,o,{plugins:l}))}return Promise.all(s.map(c)).then(()=>d(r,"init")).then(()=>d(r,"afterInit")).then(()=>r);function c(t){if(!a.includes(t)&&!i._plugins.has(t)&&!n.has(t))return function(t){return new Promise(s=>{n.add(t),t.requires&&t.requires.forEach(i=>{const n=h(i);if(t.isContextPlugin&&!n.isContextPlugin)throw new hi.a("plugincollection-context-required",null,{plugin:n.name,requiredBy:t.name});if(e.includes(n))throw new hi.a("plugincollection-required",o,{plugin:n.name,requiredBy:t.name});c(n)});const a=i._contextPlugins.get(t)||new t(o);i._add(t,a),r.push(a),s()})}(t).catch(e=>{throw Object(hi.b)("plugincollection-load",{plugin:t}),e})}function d(t,e){return t.reduce((t,o)=>o[e]?i._contextPlugins.has(o)?t:t.then(o[e].bind(o)):t,Promise.resolve())}function h(t){return"function"==typeof t?t:i._availablePlugins.get(t)}function u(t){return t.map(t=>h(t)).filter(t=>!!t)}}destroy(){const t=[];for(const[,e]of this)"function"!=typeof e.destroy||this._contextPlugins.has(e)||t.push(e.destroy());return Promise.all(t)}_add(t,e){this._plugins.set(t,e);const i=t.pluginName;if(i){if(this._plugins.has(i))throw new hi.a("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:t});this._plugins.set(i,e)}}}function Ti(t){return Array.isArray(t)?t:[t]}function Ci(t,e,i=1){if("number"!=typeof i)throw new hi.a("translation-service-quantity-not-a-number",null,{quantity:i});const o=Object.keys(window.CKEDITOR_TRANSLATIONS).length;1===o&&(t=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]);const n=e.id||e.string;if(0===o||!function(t,e){return!!window.CKEDITOR_TRANSLATIONS[t]&&!!window.CKEDITOR_TRANSLATIONS[t].dictionary[e]}(t,n))return 1!==i?e.plural:e.string;const r=window.CKEDITOR_TRANSLATIONS[t].dictionary,s=window.CKEDITOR_TRANSLATIONS[t].getPluralForm||(t=>1===t?0:1);if("string"==typeof r[n])return r[n];const a=Number(s(i));return r[n][a]}yi(Ai,mi),window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const Si=["ar","fa","he","ku","ug"];class Pi{constructor(t={}){this.uiLanguage=t.uiLanguage||"en",this.contentLanguage=t.contentLanguage||this.uiLanguage,this.uiLanguageDirection=Ei(this.uiLanguage),this.contentLanguageDirection=Ei(this.contentLanguage),this.t=(t,e)=>this._t(t,e)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(t,e=[]){e=Ti(e),"string"==typeof t&&(t={string:t});const i=!!t.plural?e[0]:1;return function(t,e){return t.replace(/%(\d+)/g,(t,i)=>it.destroy())).then(()=>this.plugins.destroy())}_addEditor(t,e){if(this._contextOwner)throw new hi.a("context-addeditor-private-context");this.editors.add(t),e&&(this._contextOwner=t)}_removeEditor(t){return this.editors.has(t)&&this.editors.remove(t),this._contextOwner===t?this.destroy():Promise.resolve()}_getEditorConfig(){const t={};for(const e of this.config.names())["plugins","removePlugins","extraPlugins"].includes(e)||(t[e]=this.config.get(e));return t}static create(t){return new Promise(e=>{const i=new this(t);e(i.initPlugins().then(()=>i))})}}function Li(t,e){const i=Math.min(t.length,e.length);for(let o=0;ot.data.length)throw new hi.a("view-textproxy-wrong-offsetintext",this);if(i<0||e+i>t.data.length)throw new hi.a("view-textproxy-wrong-length",this);this.data=t.data.substring(e,e+i),this.offsetInText=e}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(t){return"$textProxy"===t||"view:$textProxy"===t||"textProxy"===t||"view:textProxy"===t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this.textNode:this.parent;for(;null!==i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}}function Ri(t){return vi(t)?new Map(t):function(t){const e=new Map;for(const i in t)e.set(i,t[i]);return e}(t)}class Di{constructor(...t){this._patterns=[],this.add(...t)}add(...t){for(let e of t)("string"==typeof e||e instanceof RegExp)&&(e={name:e}),e.classes&&("string"==typeof e.classes||e.classes instanceof RegExp)&&(e.classes=[e.classes]),this._patterns.push(e)}match(...t){for(const e of t)for(const t of this._patterns){const i=Vi(e,t);if(i)return{element:e,pattern:t,match:i}}return null}matchAll(...t){const e=[];for(const i of t)for(const t of this._patterns){const o=Vi(i,t);o&&e.push({element:i,pattern:t,match:o})}return e.length>0?e:null}getElementName(){if(1!==this._patterns.length)return null;const t=this._patterns[0],e=t.name;return"function"==typeof t||!e||e instanceof RegExp?null:e}}function Vi(t,e){if("function"==typeof e)return e(t);const i={};return e.name&&(i.name=function(t,e){if(t instanceof RegExp)return t.test(e);return t===e}(e.name,t.name),!i.name)||e.attributes&&(i.attributes=function(t,e){const i=[];for(const o in t){const n=t[o];if(!e.hasAttribute(o))return null;{const t=e.getAttribute(o);if(!0===n)i.push(o);else if(n instanceof RegExp){if(!n.test(t))return null;i.push(o)}else{if(t!==n)return null;i.push(o)}}}return i}(e.attributes,t),!i.attributes)?null:!(e.classes&&(i.classes=function(t,e){const i=[];for(const o of t)if(o instanceof RegExp){const t=e.getClassNames();for(const e of t)o.test(e)&&i.push(e);if(0===i.length)return null}else{if(!e.hasClass(o))return null;i.push(o)}return i}(e.classes,t),!i.classes))&&(!(e.styles&&(i.styles=function(t,e){const i=[];for(const o in t){const n=t[o];if(!e.hasStyle(o))return null;{const t=e.getStyle(o);if(n instanceof RegExp){if(!n.test(t))return null;i.push(o)}else{if(t!==n)return null;i.push(o)}}}return i}(e.styles,t),!i.styles))&&i)}var ji=function(t){return"symbol"==typeof t||p(t)&&"[object Symbol]"==g(t)},Bi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fi=/^\w*$/;var Hi=function(t,e){if(Ot(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!ji(t))||(Fi.test(t)||!Bi.test(t)||null!=e&&t in Object(e))};function Ui(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var i=function(){var o=arguments,n=e?e.apply(this,o):o[0],r=i.cache;if(r.has(n))return r.get(n);var s=t.apply(this,o);return i.cache=r.set(n,s)||r,s};return i.cache=new(Ui.Cache||kt),i}Ui.Cache=kt;var qi=Ui;var Wi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$i=/\\(\\)?/g,Gi=function(t){var e=qi(t,(function(t){return 500===i.size&&i.clear(),t})),i=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Wi,(function(t,i,o,n){e.push(o?n.replace($i,"$1"):i||t)})),e}));var Yi=function(t,e){for(var i=-1,o=null==t?0:t.length,n=Array(o);++in?0:n+e),(i=i>n?n:i)<0&&(i+=n),n=e>i?0:i-e>>>0,e>>>=0;for(var r=Array(n);++o0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(vo);var Ao=function(t,e){return xo(ko(t,e,po),t+"")};var To=function(t,e,i){if(!D(i))return!1;var o=typeof e;return!!("number"==o?Xt(i)&&Vt(e,i.length):"string"==o&&e in i)&&A(i[e],t)};var Co=function(t){return Ao((function(e,i){var o=-1,n=i.length,r=n>1?i[n-1]:void 0,s=n>2?i[2]:void 0;for(r=t.length>3&&"function"==typeof r?(n--,r):void 0,s&&To(i[0],i[1],s)&&(r=n<3?void 0:r,n=1),e=Object(e);++oe===t);return Array.isArray(e)}set(t,e){if(D(t))for(const[e,i]of Object.entries(t))this._styleProcessor.toNormalizedForm(e,i,this._styles);else this._styleProcessor.toNormalizedForm(t,e,this._styles)}remove(t){const e=Io(t);so(this._styles,e),delete this._styles[t],this._cleanEmptyObjectsOnPath(e)}getNormalized(t){return this._styleProcessor.getNormalized(t,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map(t=>t.join(":")).sort().join(";")+";"}getAsString(t){if(this.isEmpty)return;if(this._styles[t]&&!D(this._styles[t]))return this._styles[t];const e=this._styleProcessor.getReducedForm(t,this._styles).find(([e])=>e===t);return Array.isArray(e)?e[1]:void 0}getStyleNames(){if(this.isEmpty)return[];return this._getStylesEntries().map(([t])=>t)}clear(){this._styles={}}_getStylesEntries(){const t=[],e=Object.keys(this._styles);for(const i of e)t.push(...this._styleProcessor.getReducedForm(i,this._styles));return t}_cleanEmptyObjectsOnPath(t){const e=t.split(".");if(!(e.length>1))return;const i=e.splice(0,e.length-1).join("."),o=ao(this._styles,i);if(!o)return;!Array.from(Object.keys(o)).length&&this.remove(i)}}class Lo{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(t,e,i){if(D(e))No(i,Io(t),e);else if(this._normalizers.has(t)){const o=this._normalizers.get(t),{path:n,value:r}=o(e);No(i,n,r)}else No(i,t,e)}getNormalized(t,e){if(!t)return So({},e);if(void 0!==e[t])return e[t];if(this._extractors.has(t)){const i=this._extractors.get(t);if("string"==typeof i)return ao(e,i);const o=i(t,e);if(o)return o}return ao(e,Io(t))}getReducedForm(t,e){const i=this.getNormalized(t,e);if(void 0===i)return[];if(this._reducers.has(t)){return this._reducers.get(t)(i)}return[[t,i]]}getRelatedStyles(t){return this._consumables.get(t)||[]}setNormalizer(t,e){this._normalizers.set(t,e)}setExtractor(t,e){this._extractors.set(t,e)}setReducer(t,e){this._reducers.set(t,e)}setStyleRelation(t,e){this._mapStyleNames(t,e);for(const i of e)this._mapStyleNames(i,[t])}_mapStyleNames(t,e){this._consumables.has(t)||this._consumables.set(t,[]),this._consumables.get(t).push(...e)}}function Io(t){return t.replace("-",".")}function No(t,e,i){let o=i;D(i)&&(o=So({},ao(t,e),i)),Eo(t,e,o)}class zo extends Ni{constructor(t,e,i,o){if(super(t),this.name=e,this._attrs=function(t){t=Ri(t);for(const[e,i]of t)null===i?t.delete(e):"string"!=typeof i&&t.set(e,String(i));return t}(i),this._children=[],o&&this._insertChild(0,o),this._classes=new Set,this._attrs.has("class")){const t=this._attrs.get("class");Oo(this._classes,t),this._attrs.delete("class")}this._styles=new Mo(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(t,e=null){return e?e===this.name&&("element"===t||"view:element"===t):"element"===t||"view:element"===t||"node"===t||"view:node"===t}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(t){if("class"==t)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==t){const t=this._styles.toString();return""==t?void 0:t}return this._attrs.get(t)}hasAttribute(t){return"class"==t?this._classes.size>0:"style"==t?!this._styles.isEmpty:this._attrs.has(t)}isSimilar(t){if(!(t instanceof zo))return!1;if(this===t)return!0;if(this.name!=t.name)return!1;if(this._attrs.size!==t._attrs.size||this._classes.size!==t._classes.size||this._styles.size!==t._styles.size)return!1;for(const[e,i]of this._attrs)if(!t._attrs.has(e)||t._attrs.get(e)!==i)return!1;for(const e of this._classes)if(!t._classes.has(e))return!1;for(const e of this._styles.getStyleNames())if(!t._styles.has(e)||t._styles.getAsString(e)!==this._styles.getAsString(e))return!1;return!0}hasClass(...t){for(const e of t)if(!this._classes.has(e))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(t){return this._styles.getAsString(t)}getNormalizedStyle(t){return this._styles.getNormalized(t)}getStyleNames(){return this._styles.getStyleNames()}hasStyle(...t){for(const e of t)if(!this._styles.has(e))return!1;return!0}findAncestor(...t){const e=new Di(...t);let i=this.parent;for(;i;){if(e.match(i))return i;i=i.parent}return null}getCustomProperty(t){return this._customProperties.get(t)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const t=Array.from(this._classes).sort().join(","),e=this._styles.toString(),i=Array.from(this._attrs).map(t=>`${t[0]}="${t[1]}"`).sort().join(" ");return this.name+(""==t?"":` class="${t}"`)+(e?` style="${e}"`:"")+(""==i?"":" "+i)}_clone(t=!1){const e=[];if(t)for(const i of this.getChildren())e.push(i._clone(t));const i=new this.constructor(this.document,this.name,this._attrs,e);return i._classes=new Set(this._classes),i._styles.set(this._styles.getNormalized()),i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i}_appendChild(t){return this._insertChild(this.childCount,t)}_insertChild(t,e){this._fireChange("children",this);let i=0;const o=function(t,e){if("string"==typeof e)return[new zi(t,e)];vi(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new zi(t,e):e instanceof Oi?new zi(t,e.data):e)}(this.document,e);for(const e of o)null!==e.parent&&e._remove(),e.parent=this,e.document=this.document,this._children.splice(t,0,e),t++,i++;return i}_removeChildren(t,e=1){this._fireChange("children",this);for(let i=t;i0&&(this._classes.clear(),!0):"style"==t?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(t)}_addClass(t){this._fireChange("attributes",this);for(const e of Ti(t))this._classes.add(e)}_removeClass(t){this._fireChange("attributes",this);for(const e of Ti(t))this._classes.delete(e)}_setStyle(t,e){this._fireChange("attributes",this),this._styles.set(t,e)}_removeStyle(t){this._fireChange("attributes",this);for(const e of Ti(t))this._styles.remove(e)}_setCustomProperty(t,e){this._customProperties.set(t,e)}_removeCustomProperty(t){return this._customProperties.delete(t)}}function Oo(t,e){const i=e.split(/\s+/);t.clear(),i.forEach(e=>t.add(e))}class Ro extends zo{constructor(t,e,i,o){super(t,e,i,o),this.getFillerOffset=Do}is(t,e=null){return e?e===this.name&&("containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}}function Do(){const t=[...this.getChildren()],e=t[this.childCount-1];if(e&&e.is("element","br"))return this.childCount;for(const e of t)if(!e.is("uiElement"))return null;return this.childCount}var Vo=Co((function(t,e){Pt(e,re(e),t)}));const jo=Symbol("observableProperties"),Bo=Symbol("boundObservables"),Fo=Symbol("boundProperties"),Ho={set(t,e){if(D(t))return void Object.keys(t).forEach(e=>{this.set(e,t[e])},this);qo(this);const i=this[jo];if(t in this&&!i.has(t))throw new hi.a("observable-set-cannot-override",this);Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>i.get(t),set(e){const o=i.get(t);let n=this.fire("set:"+t,t,e,o);void 0===n&&(n=e),o===n&&i.has(t)||(i.set(t,n),this.fire("change:"+t,t,n,o))}}),this[t]=e},bind(...t){if(!t.length||!Go(t))throw new hi.a("observable-bind-wrong-properties",this);if(new Set(t).size!==t.length)throw new hi.a("observable-bind-duplicate-properties",this);qo(this);const e=this[Fo];t.forEach(t=>{if(e.has(t))throw new hi.a("observable-bind-rebind",this)});const i=new Map;return t.forEach(t=>{const o={property:t,to:[]};e.set(t,o),i.set(t,o)}),{to:Wo,toMany:$o,_observable:this,_bindProperties:t,_to:[],_bindings:i}},unbind(...t){if(!this[jo])return;const e=this[Fo],i=this[Bo];if(t.length){if(!Go(t))throw new hi.a("observable-unbind-wrong-properties",this);t.forEach(t=>{const o=e.get(t);if(!o)return;let n,r,s,a;o.to.forEach(t=>{n=t[0],r=t[1],s=i.get(n),a=s[r],a.delete(o),a.size||delete s[r],Object.keys(s).length||(i.delete(n),this.stopListening(n,"change"))}),e.delete(t)})}else i.forEach((t,e)=>{this.stopListening(e,"change")}),i.clear(),e.clear()},decorate(t){const e=this[t];if(!e)throw new hi.a("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:t});this.on(t,(t,i)=>{t.return=e.apply(this,i)}),this[t]=function(...e){return this.fire(t,e)}}};Vo(Ho,mi);var Uo=Ho;function qo(t){t[jo]||(Object.defineProperty(t,jo,{value:new Map}),Object.defineProperty(t,Bo,{value:new Map}),Object.defineProperty(t,Fo,{value:new Map}))}function Wo(...t){const e=function(...t){if(!t.length)throw new hi.a("observable-bind-to-parse-error",null);const e={to:[]};let i;"function"==typeof t[t.length-1]&&(e.callback=t.pop());return t.forEach(t=>{if("string"==typeof t)i.properties.push(t);else{if("object"!=typeof t)throw new hi.a("observable-bind-to-parse-error",null);i={observable:t,properties:[]},e.to.push(i)}}),e}(...t),i=Array.from(this._bindings.keys()),o=i.length;if(!e.callback&&e.to.length>1)throw new hi.a("observable-bind-to-no-callback",this);if(o>1&&e.callback)throw new hi.a("observable-bind-to-extra-callback",this);var n;e.to.forEach(t=>{if(t.properties.length&&t.properties.length!==o)throw new hi.a("observable-bind-to-properties-length",this);t.properties.length||(t.properties=this._bindProperties)}),this._to=e.to,e.callback&&(this._bindings.get(i[0]).callback=e.callback),n=this._observable,this._to.forEach(t=>{const e=n[Bo];let i;e.get(t.observable)||n.listenTo(t.observable,"change",(o,r)=>{i=e.get(t.observable)[r],i&&i.forEach(t=>{Yo(n,t.property)})})}),function(t){let e;t._bindings.forEach((i,o)=>{t._to.forEach(n=>{e=n.properties[i.callback?0:t._bindProperties.indexOf(o)],i.to.push([n.observable,e]),function(t,e,i,o){const n=t[Bo],r=n.get(i),s=r||{};s[o]||(s[o]=new Set);s[o].add(e),r||n.set(i,s)}(t._observable,i,n.observable,e)})})}(this),this._bindProperties.forEach(t=>{Yo(this._observable,t)})}function $o(t,e,i){if(this._bindings.size>1)throw new hi.a("observable-bind-to-many-not-one-binding",this);this.to(...function(t,e){const i=t.map(t=>[t,e]);return Array.prototype.concat.apply([],i)}(t,e),i)}function Go(t){return t.every(t=>"string"==typeof t)}function Yo(t,e){const i=t[Fo].get(e);let o;i.callback?o=i.callback.apply(t,i.to.map(t=>t[0][t[1]])):(o=i.to[0],o=o[0][o[1]]),Object.prototype.hasOwnProperty.call(t,e)?t[e]=o:t.set(e,o)}class Ko extends Ro{constructor(t,e,i,o){super(t,e,i,o),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(t),this.bind("isFocused").to(t,"isFocused",e=>e&&t.selection.editableElement==this),this.listenTo(t.selection,"change",()=>{this.isFocused=t.isFocused&&t.selection.editableElement==this})}is(t,e=null){return e?e===this.name&&("editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}destroy(){this.stopListening()}}yi(Ko,Uo);const Qo=Symbol("rootName");class Jo extends Ko{constructor(t,e){super(t,e),this.rootName="main"}is(t,e=null){return e?e===this.name&&("rootElement"===t||"view:rootElement"===t||"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"rootElement"===t||"view:rootElement"===t||"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}get rootName(){return this.getCustomProperty(Qo)}set rootName(t){this._setCustomProperty(Qo,t)}set _name(t){this.name=t}}class Zo{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new hi.a("view-tree-walker-no-start-position",null);if(t.direction&&"forward"!=t.direction&&"backward"!=t.direction)throw new hi.a("view-tree-walker-unknown-direction",t.startPosition,{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this.position=Xo._createAt(t.startPosition):this.position=Xo._createAt(t.boundaries["backward"==t.direction?"end":"start"]),this.direction=t.direction||"forward",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(t){let e,i,o;do{o=this.position,({done:e,value:i}=this.next())}while(!e&&t(i));e||(this.position=o)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let t=this.position.clone();const e=this.position,i=t.parent;if(null===i.parent&&t.offset===i.childCount)return{done:!0};if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};let o;if(i instanceof zi){if(t.isAtEnd)return this.position=Xo._createAfter(i),this._next();o=i.data[t.offset]}else o=i.getChild(t.offset);if(o instanceof zo)return this.shallow?t.offset++:t=new Xo(o,0),this.position=t,this._formatReturnValue("elementStart",o,e,t,1);if(o instanceof zi){if(this.singleCharacters)return t=new Xo(o,0),this.position=t,this._next();{let i,n=o.data.length;return o==this._boundaryEndParent?(n=this.boundaries.end.offset,i=new Oi(o,0,n),t=Xo._createAfter(i)):(i=new Oi(o,0,o.data.length),t.offset++),this.position=t,this._formatReturnValue("text",i,e,t,n)}}if("string"==typeof o){let o;if(this.singleCharacters)o=1;else{o=(i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length)-t.offset}const n=new Oi(i,t.offset,o);return t.offset+=o,this.position=t,this._formatReturnValue("text",n,e,t,o)}return t=Xo._createAfter(i),this.position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",i,e,t)}_previous(){let t=this.position.clone();const e=this.position,i=t.parent;if(null===i.parent&&0===t.offset)return{done:!0};if(i==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};let o;if(i instanceof zi){if(t.isAtStart)return this.position=Xo._createBefore(i),this._previous();o=i.data[t.offset-1]}else o=i.getChild(t.offset-1);if(o instanceof zo)return this.shallow?(t.offset--,this.position=t,this._formatReturnValue("elementStart",o,e,t,1)):(t=new Xo(o,o.childCount),this.position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",o,e,t));if(o instanceof zi){if(this.singleCharacters)return t=new Xo(o,o.data.length),this.position=t,this._previous();{let i,n=o.data.length;if(o==this._boundaryStartParent){const e=this.boundaries.start.offset;i=new Oi(o,e,o.data.length-e),n=i.data.length,t=Xo._createBefore(i)}else i=new Oi(o,0,o.data.length),t.offset--;return this.position=t,this._formatReturnValue("text",i,e,t,n)}}if("string"==typeof o){let o;if(this.singleCharacters)o=1;else{const e=i===this._boundaryStartParent?this.boundaries.start.offset:0;o=t.offset-e}t.offset-=o;const n=new Oi(i,t.offset,o);return this.position=t,this._formatReturnValue("text",n,e,t,o)}return t=Xo._createBefore(i),this.position=t,this._formatReturnValue("elementStart",i,e,t,1)}_formatReturnValue(t,e,i,o,n){return e instanceof Oi&&(e.offsetInText+e.data.length==e.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?i=Xo._createAfter(e.textNode):(o=Xo._createAfter(e.textNode),this.position=o)),0===e.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?i=Xo._createBefore(e.textNode):(o=Xo._createBefore(e.textNode),this.position=o))),{done:!1,value:{type:t,item:e,previousPosition:i,nextPosition:o,length:n}}}}class Xo{constructor(t,e){this.parent=t,this.offset=e}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const t=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===t}get root(){return this.parent.root}get editableElement(){let t=this.parent;for(;!(t instanceof Ko);){if(!t.parent)return null;t=t.parent}return t}getShiftedBy(t){const e=Xo._createAt(this),i=e.offset+t;return e.offset=i<0?0:i,e}getLastMatchingPosition(t,e={}){e.startPosition=this;const i=new Zo(e);return i.skip(t),i.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(t){const e=this.getAncestors(),i=t.getAncestors();let o=0;for(;e[o]==i[o]&&e[o];)o++;return 0===o?null:e[o-1]}is(t){return"position"===t||"view:position"===t}isEqual(t){return this.parent==t.parent&&this.offset==t.offset}isBefore(t){return"before"==this.compareWith(t)}isAfter(t){return"after"==this.compareWith(t)}compareWith(t){if(this.root!==t.root)return"different";if(this.isEqual(t))return"same";const e=this.parent.is("node")?this.parent.getPath():[],i=t.parent.is("node")?t.parent.getPath():[];e.push(this.offset),i.push(t.offset);const o=Li(e,i);switch(o){case"prefix":return"before";case"extension":return"after";default:return e[o]0?new this(i,o):new this(o,i)}static _createIn(t){return this._createFromParentsAndOffsets(t,0,t,t.childCount)}static _createOn(t){const e=t.is("$textProxy")?t.offsetSize:1;return this._createFromPositionAndShift(Xo._createBefore(t),e)}}function en(t){return!(!t.item.is("attributeElement")&&!t.item.is("uiElement"))}function on(t){let e=0;for(const i of t)e++;return e}class nn{constructor(t=null,e,i){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(t,e,i)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.end:t.start).clone()}get focus(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.start:t.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const t of this._ranges)yield t.clone()}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?t.clone():null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?t.clone():null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}isEqual(t){if(this.isFake!=t.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel)return!1;if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let i=!1;for(const o of t._ranges)if(e.isEqual(o)){i=!0;break}if(!i)return!1}return!0}isSimilar(t){if(this.isBackward!=t.isBackward)return!1;const e=on(this.getRanges());if(e!=on(t.getRanges()))return!1;if(0==e)return!0;for(let e of this.getRanges()){e=e.getTrimmed();let i=!1;for(let o of t.getRanges())if(o=o.getTrimmed(),e.start.isEqual(o.start)&&e.end.isEqual(o.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(t,e,i){if(null===t)this._setRanges([]),this._setFakeOptions(e);else if(t instanceof nn||t instanceof rn)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof tn)this._setRanges([t],e&&e.backward),this._setFakeOptions(e);else if(t instanceof Xo)this._setRanges([new tn(t)]),this._setFakeOptions(e);else if(t instanceof Ni){const o=!!i&&!!i.backward;let n;if(void 0===e)throw new hi.a("view-selection-setto-required-second-parameter",this);n="in"==e?tn._createIn(t):"on"==e?tn._createOn(t):new tn(Xo._createAt(t,e)),this._setRanges([n],o),this._setFakeOptions(i)}else{if(!vi(t))throw new hi.a("view-selection-setto-not-selectable",this);this._setRanges(t,e&&e.backward),this._setFakeOptions(e)}this.fire("change")}setFocus(t,e){if(null===this.anchor)throw new hi.a("view-selection-setfocus-no-ranges",this);const i=Xo._createAt(t,e);if("same"==i.compareWith(this.focus))return;const o=this.anchor;this._ranges.pop(),"before"==i.compareWith(o)?this._addRange(new tn(i,o),!0):this._addRange(new tn(o,i)),this.fire("change")}is(t){return"selection"===t||"view:selection"===t}_setRanges(t,e=!1){t=Array.from(t),this._ranges=[];for(const e of t)this._addRange(e);this._lastRangeBackward=!!e}_setFakeOptions(t={}){this._isFake=!!t.fake,this._fakeSelectionLabel=t.fake&&t.label||""}_addRange(t,e=!1){if(!(t instanceof tn))throw new hi.a("view-selection-add-range-not-range",this);this._pushRange(t),this._lastRangeBackward=!!e}_pushRange(t){for(const e of this._ranges)if(t.isIntersecting(e))throw new hi.a("view-selection-range-intersects",this,{addedRange:t,intersectingRange:e});this._ranges.push(new tn(t.start,t.end))}}yi(nn,mi);class rn{constructor(t=null,e,i){this._selection=new nn,this._selection.delegate("change").to(this),this._selection.setTo(t,e,i)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(t){return this._selection.isEqual(t)}isSimilar(t){return this._selection.isSimilar(t)}is(t){return"selection"===t||"documentSelection"==t||"view:selection"==t||"view:documentSelection"==t}_setTo(t,e,i){this._selection.setTo(t,e,i)}_setFocus(t,e){this._selection.setFocus(t,e)}}yi(rn,mi);class sn{constructor(t){this.selection=new rn,this.roots=new xi({idProperty:"rootName"}),this.stylesProcessor=t,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(t="main"){return this.roots.get(t)}registerPostFixer(t){this._postFixers.add(t)}destroy(){this.roots.map(t=>t.destroy()),this.stopListening()}_callPostFixers(t){let e=!1;do{for(const i of this._postFixers)if(e=i(t),e)break}while(e)}}yi(sn,Uo);class an extends zo{constructor(t,e,i,o){super(t,e,i,o),this.getFillerOffset=ln,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 hi.a("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}is(t,e=null){return e?e===this.name&&("attributeElement"===t||"view:attributeElement"===t||"element"===t||"view:element"===t):"attributeElement"===t||"view:attributeElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}isSimilar(t){return null!==this.id||null!==t.id?this.id===t.id:super.isSimilar(t)&&this.priority==t.priority}_clone(t){const e=super._clone(t);return e._priority=this._priority,e._id=this._id,e}}function ln(){if(cn(this))return null;let t=this.parent;for(;t&&t.is("attributeElement");){if(cn(t)>1)return null;t=t.parent}return!t||cn(t)>1?null:this.childCount}function cn(t){return Array.from(t.getChildren()).filter(t=>!t.is("uiElement")).length}an.DEFAULT_PRIORITY=10;class dn extends zo{constructor(t,e,i,o){super(t,e,i,o),this.getFillerOffset=hn}is(t,e=null){return e?e===this.name&&("emptyElement"===t||"view:emptyElement"===t||"element"===t||"view:element"===t):"emptyElement"===t||"view:emptyElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof Ni||Array.from(e).length>0))throw new hi.a("view-emptyelement-cannot-add",[this,e])}}function hn(){return null}const un=navigator.userAgent.toLowerCase();var gn={isMac:function(t){return t.indexOf("macintosh")>-1}(un),isGecko:function(t){return!!t.match(/gecko\/\d+/)}(un),isSafari:function(t){return t.indexOf(" applewebkit/")>-1&&-1===t.indexOf("chrome")}(un),isAndroid:function(t){return t.indexOf("android")>-1}(un),isBlink:function(t){return t.indexOf("chrome/")>-1&&t.indexOf("edge/")<0}(un),features:{isRegExpUnicodePropertySupported:function(){let t=!1;try{t=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(t){}return t}()}};const mn={"⌘":"ctrl","⇧":"shift","⌥":"alt"},fn={ctrl:"⌘",shift:"⇧",alt:"⌥"},pn=function(){const t={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,cmd:1114112,shift:2228224,alt:4456448};for(let e=65;e<=90;e++){const i=String.fromCharCode(e);t[i.toLowerCase()]=e}for(let e=48;e<=57;e++)t[e-48]=e;for(let e=112;e<=123;e++)t["f"+(e-111)]=e;return t}();function bn(t){let e;if("string"==typeof t){if(e=pn[t.toLowerCase()],!e)throw new hi.a("keyboard-unknown-key",null,{key:t})}else e=t.keyCode+(t.altKey?pn.alt:0)+(t.ctrlKey?pn.ctrl:0)+(t.shiftKey?pn.shift:0);return e}function wn(t){return"string"==typeof t&&(t=xn(t)),t.map(t=>"string"==typeof t?bn(t):t).reduce((t,e)=>e+t,0)}function kn(t){return gn.isMac?xn(t).map(t=>fn[t.toLowerCase()]||t).reduce((t,e)=>t.slice(-1)in mn?t+e:t+"+"+e):t}function _n(t){return t==pn.arrowright||t==pn.arrowleft||t==pn.arrowup||t==pn.arrowdown}function vn(t,e){const i="ltr"===e;switch(t){case pn.arrowleft:return i?"left":"right";case pn.arrowright:return i?"right":"left";case pn.arrowup:return"up";case pn.arrowdown:return"down"}}function yn(t,e){const i=vn(t,e);return"down"===i||"right"===i}function xn(t){return t.split(/\s*\+\s*/)}class An extends zo{constructor(t,e,i,o){super(t,e,i,o),this.getFillerOffset=Cn}is(t,e=null){return e?e===this.name&&("uiElement"===t||"view:uiElement"===t||"element"===t||"view:element"===t):"uiElement"===t||"view:uiElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof Ni||Array.from(e).length>0))throw new hi.a("view-uielement-cannot-add",this)}render(t){return this.toDomElement(t)}toDomElement(t){const e=t.createElement(this.name);for(const t of this.getAttributeKeys())e.setAttribute(t,this.getAttribute(t));return e}}function Tn(t){t.document.on("keydown",(e,i)=>function(t,e,i){if(e.keyCode==pn.arrowright){const t=e.domTarget.ownerDocument.defaultView.getSelection(),o=1==t.rangeCount&&t.getRangeAt(0).collapsed;if(o||e.shiftKey){const e=t.focusNode,n=t.focusOffset,r=i.domPositionToView(e,n);if(null===r)return;let s=!1;const a=r.getLastMatchingPosition(t=>(t.item.is("uiElement")&&(s=!0),!(!t.item.is("uiElement")&&!t.item.is("attributeElement"))));if(s){const e=i.viewPositionToDom(a);o?t.collapse(e.parent,e.offset):t.extend(e.parent,e.offset)}}}}(0,i,t.domConverter))}function Cn(){return null}class Sn extends zo{constructor(t,e,i,o){super(t,e,i,o),this.getFillerOffset=Pn}is(t,e=null){return e?e===this.name&&("rawElement"===t||"view:rawElement"===t||"element"===t||"view:element"===t):"rawElement"===t||"view:rawElement"===t||t===this.name||t==="view:"+this.name||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof Ni||Array.from(e).length>0))throw new hi.a("view-rawelement-cannot-add",[this,e])}}function Pn(){return null}class En{constructor(t,e){this.document=t,this._children=[],e&&this._insertChild(0,e)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"===t||"view:documentFragment"===t}_appendChild(t){return this._insertChild(this.childCount,t)}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(t,e){this._fireChange("children",this);let i=0;const o=function(t,e){if("string"==typeof e)return[new zi(t,e)];vi(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new zi(t,e):e instanceof Oi?new zi(t,e.data):e)}(this.document,e);for(const e of o)null!==e.parent&&e._remove(),e.parent=this,this._children.splice(t,0,e),t++,i++;return i}_removeChildren(t,e=1){this._fireChange("children",this);for(let i=t;i{}),o}setAttribute(t,e,i){i._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,i){y(t)&&void 0===i&&(i=e),i._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,i){i._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}breakAttributes(t){return t instanceof Xo?this._breakAttributes(t):this._breakAttributesRange(t)}breakContainer(t){const e=t.parent;if(!e.is("containerElement"))throw new hi.a("view-writer-break-non-container-element",this.document);if(!e.parent)throw new hi.a("view-writer-break-root",this.document);if(t.isAtStart)return Xo._createBefore(e);if(!t.isAtEnd){const i=e._clone(!1);this.insert(Xo._createAfter(e),i);const o=new tn(t,Xo._createAt(e,"end")),n=new Xo(i,0);this.move(o,n)}return Xo._createAfter(e)}mergeAttributes(t){const e=t.offset,i=t.parent;if(i.is("$text"))return t;if(i.is("attributeElement")&&0===i.childCount){const t=i.parent,e=i.index;return i._remove(),this._removeFromClonedElementsGroup(i),this.mergeAttributes(new Xo(t,e))}const o=i.getChild(e-1),n=i.getChild(e);if(!o||!n)return t;if(o.is("$text")&&n.is("$text"))return On(o,n);if(o.is("attributeElement")&&n.is("attributeElement")&&o.isSimilar(n)){const t=o.childCount;return o._appendChild(n.getChildren()),n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new Xo(o,t))}return t}mergeContainers(t){const e=t.nodeBefore,i=t.nodeAfter;if(!(e&&i&&e.is("containerElement")&&i.is("containerElement")))throw new hi.a("view-writer-merge-containers-invalid-position",this.document);const o=e.getChild(e.childCount-1),n=o instanceof zi?Xo._createAt(o,"end"):Xo._createAt(e,"end");return this.move(tn._createIn(i),Xo._createAt(e,"end")),this.remove(tn._createOn(i)),n}insert(t,e){(function t(e,i){for(const o of e){if(!Rn.some(t=>o instanceof t))throw new hi.a("view-writer-insert-invalid-node-type",i);o.is("$text")||t(o.getChildren(),i)}})(e=vi(e)?[...e]:[e],this.document);const i=Ln(t);if(!i)throw new hi.a("view-writer-invalid-position-container",this.document);const o=this._breakAttributes(t,!0),n=i._insertChild(o.offset,e);for(const t of e)this._addToClonedElementsGroup(t);const r=o.getShiftedBy(n),s=this.mergeAttributes(o);if(0===n)return new tn(s,s);{s.isEqual(o)||r.offset--;const t=this.mergeAttributes(r);return new tn(s,t)}}remove(t){const e=t instanceof tn?t:tn._createOn(t);if(Vn(e,this.document),e.isCollapsed)return new En(this.document);const{start:i,end:o}=this._breakAttributesRange(e,!0),n=i.parent,r=o.offset-i.offset,s=n._removeChildren(i.offset,r);for(const t of s)this._removeFromClonedElementsGroup(t);const a=this.mergeAttributes(i);return e.start=a,e.end=a.clone(),new En(this.document,s)}clear(t,e){Vn(t,this.document);const i=t.getWalker({direction:"backward",ignoreElementEnd:!0});for(const o of i){const i=o.item;let n;if(i.is("element")&&e.isSimilar(i))n=tn._createOn(i);else if(!o.nextPosition.isAfter(t.start)&&i.is("$textProxy")){const t=i.getAncestors().find(t=>t.is("element")&&e.isSimilar(t));t&&(n=tn._createIn(t))}n&&(n.end.isAfter(t.end)&&(n.end=t.end),n.start.isBefore(t.start)&&(n.start=t.start),this.remove(n))}}move(t,e){let i;if(e.isAfter(t.end)){const o=(e=this._breakAttributes(e,!0)).parent,n=o.childCount;t=this._breakAttributesRange(t,!0),i=this.remove(t),e.offset+=o.childCount-n}else i=this.remove(t);return this.insert(e,i)}wrap(t,e){if(!(e instanceof an))throw new hi.a("view-writer-wrap-invalid-attribute",this.document);if(Vn(t,this.document),t.isCollapsed){let o=t.start;o.parent.is("element")&&(i=o.parent,!Array.from(i.getChildren()).some(t=>!t.is("uiElement")))&&(o=o.getLastMatchingPosition(t=>t.item.is("uiElement"))),o=this._wrapPosition(o,e);const n=this.document.selection;return n.isCollapsed&&n.getFirstPosition().isEqual(t.start)&&this.setSelection(o),new tn(o)}return this._wrapRange(t,e);var i}unwrap(t,e){if(!(e instanceof an))throw new hi.a("view-writer-unwrap-invalid-attribute",this.document);if(Vn(t,this.document),t.isCollapsed)return t;const{start:i,end:o}=this._breakAttributesRange(t,!0),n=i.parent,r=this._unwrapChildren(n,i.offset,o.offset,e),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new tn(s,a)}rename(t,e){const i=new Ro(this.document,t,e.getAttributes());return this.insert(Xo._createAfter(e),i),this.move(tn._createIn(e),Xo._createAt(i,0)),this.remove(tn._createOn(e)),i}clearClonedElementsGroup(t){this._cloneGroups.delete(t)}createPositionAt(t,e){return Xo._createAt(t,e)}createPositionAfter(t){return Xo._createAfter(t)}createPositionBefore(t){return Xo._createBefore(t)}createRange(t,e){return new tn(t,e)}createRangeOn(t){return tn._createOn(t)}createRangeIn(t){return tn._createIn(t)}createSelection(t,e,i){return new nn(t,e,i)}_wrapChildren(t,e,i,o){let n=e;const r=[];for(;n!1,t.parent._insertChild(t.offset,i);const o=new tn(t,t.getShiftedBy(1));this.wrap(o,e);const n=new Xo(i.parent,i.index);i._remove();const r=n.nodeBefore,s=n.nodeAfter;return r instanceof zi&&s instanceof zi?On(r,s):Nn(n)}_wrapAttributeElement(t,e){if(!jn(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const i of t.getAttributeKeys())if("class"!==i&&"style"!==i&&e.hasAttribute(i)&&e.getAttribute(i)!==t.getAttribute(i))return!1;for(const i of t.getStyleNames())if(e.hasStyle(i)&&e.getStyle(i)!==t.getStyle(i))return!1;for(const i of t.getAttributeKeys())"class"!==i&&"style"!==i&&(e.hasAttribute(i)||this.setAttribute(i,t.getAttribute(i),e));for(const i of t.getStyleNames())e.hasStyle(i)||this.setStyle(i,t.getStyle(i),e);for(const i of t.getClassNames())e.hasClass(i)||this.addClass(i,e);return!0}_unwrapAttributeElement(t,e){if(!jn(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const i of t.getAttributeKeys())if("class"!==i&&"style"!==i&&(!e.hasAttribute(i)||e.getAttribute(i)!==t.getAttribute(i)))return!1;if(!e.hasClass(...t.getClassNames()))return!1;for(const i of t.getStyleNames())if(!e.hasStyle(i)||e.getStyle(i)!==t.getStyle(i))return!1;for(const i of t.getAttributeKeys())"class"!==i&&"style"!==i&&this.removeAttribute(i,e);return this.removeClass(Array.from(t.getClassNames()),e),this.removeStyle(Array.from(t.getStyleNames()),e),!0}_breakAttributesRange(t,e=!1){const i=t.start,o=t.end;if(Vn(t,this.document),t.isCollapsed){const i=this._breakAttributes(t.start,e);return new tn(i,i)}const n=this._breakAttributes(o,e),r=n.parent.childCount,s=this._breakAttributes(i,e);return n.offset+=n.parent.childCount-r,new tn(s,n)}_breakAttributes(t,e=!1){const i=t.offset,o=t.parent;if(t.parent.is("emptyElement"))throw new hi.a("view-writer-cannot-break-empty-element",this.document);if(t.parent.is("uiElement"))throw new hi.a("view-writer-cannot-break-ui-element",this.document);if(t.parent.is("rawElement"))throw new hi.a("view-writer-cannot-break-raw-element",this.document);if(!e&&o.is("$text")&&Dn(o.parent))return t.clone();if(Dn(o))return t.clone();if(o.is("$text"))return this._breakAttributes(zn(t),e);if(i==o.childCount){const t=new Xo(o.parent,o.index+1);return this._breakAttributes(t,e)}if(0===i){const t=new Xo(o.parent,o.index);return this._breakAttributes(t,e)}{const t=o.index+1,n=o._clone();o.parent._insertChild(t,n),this._addToClonedElementsGroup(n);const r=o.childCount-i,s=o._removeChildren(i,r);n._appendChild(s);const a=new Xo(o.parent,t);return this._breakAttributes(a,e)}}_addToClonedElementsGroup(t){if(!t.root.is("rootElement"))return;if(t.is("element"))for(const e of t.getChildren())this._addToClonedElementsGroup(e);const e=t.id;if(!e)return;let i=this._cloneGroups.get(e);i||(i=new Set,this._cloneGroups.set(e,i)),i.add(t),t._clonesGroup=i}_removeFromClonedElementsGroup(t){if(t.is("element"))for(const e of t.getChildren())this._removeFromClonedElementsGroup(e);const e=t.id;if(!e)return;const i=this._cloneGroups.get(e);i&&i.delete(t)}}function Ln(t){let e=t.parent;for(;!Dn(e);){if(!e)return;e=e.parent}return e}function In(t,e){return t.prioritye.priority)&&t.getIdentity()t.createTextNode(" "),Hn=t=>{const e=t.createElement("br");return e.dataset.ckeFiller=!0,e},Un=(()=>{let t="";for(let e=0;e<7;e++)t+="​";return t})();function qn(t){return Bn(t)&&t.data.substr(0,7)===Un}function Wn(t){return 7==t.data.length&&qn(t)}function $n(t){return qn(t)?t.data.slice(7):t.data}function Gn(t,e){if(e.keyCode==pn.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(1==t.rangeCount&&t.getRangeAt(0).collapsed){const e=t.getRangeAt(0).startContainer,i=t.getRangeAt(0).startOffset;qn(e)&&i<=7&&t.collapse(e,0)}}}function Yn(t,e,i,o=!1){i=i||function(t,e){return t===e},Array.isArray(t)||(t=Array.prototype.slice.call(t)),Array.isArray(e)||(e=Array.prototype.slice.call(e));const n=function(t,e,i){const o=Kn(t,e,i);if(-1===o)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const n=Qn(t,o),r=Qn(e,o),s=Kn(n,r,i),a=t.length-s,l=e.length-s;return{firstIndex:o,lastIndexOld:a,lastIndexNew:l}}(t,e,i);return o?function(t,e){const{firstIndex:i,lastIndexOld:o,lastIndexNew:n}=t;if(-1===i)return Array(e).fill("equal");let r=[];i>0&&(r=r.concat(Array(i).fill("equal")));n-i>0&&(r=r.concat(Array(n-i).fill("insert")));o-i>0&&(r=r.concat(Array(o-i).fill("delete")));n0&&i.push({index:o,type:"insert",values:t.slice(o,r)});n-o>0&&i.push({index:o+(r-o),type:"delete",howMany:n-o});return i}(e,n)}function Kn(t,e,i){for(let o=0;o200||n>200||o+n>300)return Jn.fastDiff(t,e,i,!0);let r,s;if(nc?-1:1;d[o+u]&&(d[o]=d[o+u].slice(0)),d[o]||(d[o]=[]),d[o].push(n>c?r:s);let g=Math.max(n,c),m=g-o;for(;mc;g--)h[g]=u(g);h[c]=u(c),m++}while(h[c]!==l);return d[c].slice(1)}function Zn(t,e,i){t.insertBefore(i,t.childNodes[e]||null)}function Xn(t){const e=t.parentNode;e&&e.removeChild(t)}function tr(t){if(t){if(t.defaultView)return t instanceof t.defaultView.Document;if(t.ownerDocument&&t.ownerDocument.defaultView)return t instanceof t.ownerDocument.defaultView.Node}return!1}Jn.fastDiff=Yn;class er{constructor(t,e){this.domDocuments=new Set,this.domConverter=t,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=e,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(t,e){if("text"===t)this.domConverter.mapViewToDom(e.parent)&&this.markedTexts.add(e);else{if(!this.domConverter.mapViewToDom(e))return;if("attributes"===t)this.markedAttributes.add(e);else{if("children"!==t)throw new hi.a("view-renderer-unknown-type",this);this.markedChildren.add(e)}}}render(){let t;for(const t of this.markedChildren)this._updateChildrenMappings(t);this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?t=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(t=this.selection.getFirstPosition(),this.markedChildren.add(t.parent));for(const t of this.markedAttributes)this._updateAttrs(t);for(const e of this.markedChildren)this._updateChildren(e,{inlineFillerPosition:t});for(const e of this.markedTexts)!this.markedChildren.has(e.parent)&&this.domConverter.mapViewToDom(e.parent)&&this._updateText(e,{inlineFillerPosition:t});if(t){const e=this.domConverter.viewPositionToDom(t),i=e.parent.ownerDocument;qn(e.parent)?this._inlineFiller=e.parent:this._inlineFiller=ir(i,e.parent,e.offset)}else this._inlineFiller=null;this._updateSelection(),this._updateFocus(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const i=this.domConverter.mapViewToDom(t).childNodes,o=Array.from(this.domConverter.viewChildrenToDom(t,e.ownerDocument,{withChildren:!1})),n=this._diffNodeLists(i,o),r=this._findReplaceActions(n,i,o);if(-1!==r.indexOf("replace")){const e={equal:0,insert:0,delete:0};for(const n of r)if("replace"===n){const n=e.equal+e.insert,r=e.equal+e.delete,s=t.getChild(n);!s||s.is("uiElement")||s.is("rawElement")||this._updateElementMappings(s,i[r]),Xn(o[n]),e.equal++}else e[n]++}}_updateElementMappings(t,e){this.domConverter.unbindDomElement(e),this.domConverter.bindElements(e,t),this.markedChildren.add(t),this.markedAttributes.add(t)}_getInlineFillerPosition(){const t=this.selection.getFirstPosition();return t.parent.is("$text")?Xo._createBefore(this.selection.getFirstPosition().parent):t}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=this.domConverter.viewPositionToDom(t);return!!(e&&Bn(e.parent)&&qn(e.parent))}_removeInlineFiller(){const t=this._inlineFiller;if(!qn(t))throw new hi.a("view-renderer-filler-was-lost",this);Wn(t)?t.parentNode.removeChild(t):t.data=t.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=t.parent,i=t.offset;if(!this.domConverter.mapViewToDom(e.root))return!1;if(!e.is("element"))return!1;if(!function(t){if("false"==t.getAttribute("contenteditable"))return!1;const e=t.findAncestor(t=>t.hasAttribute("contenteditable"));return!e||"true"==e.getAttribute("contenteditable")}(e))return!1;if(i===e.getFillerOffset())return!1;const o=t.nodeBefore,n=t.nodeAfter;return!(o instanceof zi||n instanceof zi)}_updateText(t,e){const i=this.domConverter.findCorrespondingDomText(t),o=this.domConverter.viewToDom(t,i.ownerDocument),n=i.data;let r=o.data;const s=e.inlineFillerPosition;if(s&&s.parent==t.parent&&s.offset==t.index&&(r=Un+r),n!=r){const t=Yn(n,r);for(const e of t)"insert"===e.type?i.insertData(e.index,e.values.join("")):i.deleteData(e.index,e.howMany)}}_updateAttrs(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const i=Array.from(e.attributes).map(t=>t.name),o=t.getAttributeKeys();for(const i of o)e.setAttribute(i,t.getAttribute(i));for(const o of i)t.hasAttribute(o)||e.removeAttribute(o)}_updateChildren(t,e){const i=this.domConverter.mapViewToDom(t);if(!i)return;const o=e.inlineFillerPosition,n=this.domConverter.mapViewToDom(t).childNodes,r=Array.from(this.domConverter.viewChildrenToDom(t,i.ownerDocument,{bind:!0,inlineFillerPosition:o}));o&&o.parent===t&&ir(i.ownerDocument,r,o.offset);const s=this._diffNodeLists(n,r);let a=0;const l=new Set;for(const t of s)"delete"===t?(l.add(n[a]),Xn(n[a])):"equal"===t&&a++;a=0;for(const t of s)"insert"===t?(Zn(i,a,r[a]),a++):"equal"===t&&(this._markDescendantTextToSync(this.domConverter.domToView(r[a])),a++);for(const t of l)t.parentNode||this.domConverter.unbindDomElement(t)}_diffNodeLists(t,e){return Jn(t=function(t,e){const i=Array.from(t);if(0==i.length||!e)return i;i[i.length-1]==e&&i.pop();return i}(t,this._fakeSelectionContainer),e,nr.bind(null,this.domConverter))}_findReplaceActions(t,e,i){if(-1===t.indexOf("insert")||-1===t.indexOf("delete"))return t;let o=[],n=[],r=[];const s={equal:0,insert:0,delete:0};for(const a of t)"insert"===a?r.push(i[s.equal+s.insert]):"delete"===a?n.push(e[s.equal+s.delete]):(o=o.concat(Jn(n,r,or).map(t=>"equal"===t?"replace":t)),o.push("equal"),n=[],r=[]),s[a]++;return o.concat(Jn(n,r,or).map(t=>"equal"===t?"replace":t))}_markDescendantTextToSync(t){if(t)if(t.is("$text"))this.markedTexts.add(t);else if(t.is("element"))for(const e of t.getChildren())this._markDescendantTextToSync(e)}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const t=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&t&&(this.selection.isFake?this._updateFakeSelection(t):(this._removeFakeSelection(),this._updateDomSelection(t)))}_updateFakeSelection(t){const e=t.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(t){const e=t.createElement("div");return e.className="ck-fake-selection-container",Object.assign(e.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),e.textContent=" ",e}(e));const i=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(i,this.selection),!this._fakeSelectionNeedsUpdate(t))return;i.parentElement&&i.parentElement==t||t.appendChild(i),i.textContent=this.selection.fakeSelectionLabel||" ";const o=e.getSelection(),n=e.createRange();o.removeAllRanges(),n.selectNodeContents(i),o.addRange(n)}_updateDomSelection(t){const e=t.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(e))return;const i=this.domConverter.viewPositionToDom(this.selection.anchor),o=this.domConverter.viewPositionToDom(this.selection.focus);t.focus(),e.collapse(i.parent,i.offset),e.extend(o.parent,o.offset),gn.isGecko&&function(t,e){const i=t.parent;if(i.nodeType!=Node.ELEMENT_NODE||t.offset!=i.childNodes.length-1)return;const o=i.childNodes[t.offset];o&&"BR"==o.tagName&&e.addRange(e.getRangeAt(0))}(o,e)}_domSelectionNeedsUpdate(t){if(!this.domConverter.isDomSelectionCorrect(t))return!0;const e=t&&this.domConverter.domSelectionToView(t);return(!e||!this.selection.isEqual(e))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(e))}_fakeSelectionNeedsUpdate(t){const e=this._fakeSelectionContainer,i=t.ownerDocument.getSelection();return!e||e.parentElement!==t||(i.anchorNode!==e&&!e.contains(i.anchorNode)||e.textContent!==this.selection.fakeSelectionLabel)}_removeDomSelection(){for(const t of this.domDocuments){if(t.getSelection().rangeCount){const e=t.activeElement,i=this.domConverter.mapDomToView(e);e&&i&&t.getSelection().removeAllRanges()}}}_removeFakeSelection(){const t=this._fakeSelectionContainer;t&&t.remove()}_updateFocus(){if(this.isFocused){const t=this.selection.editableElement;t&&this.domConverter.focus(t)}}}function ir(t,e,i){const o=e instanceof Array?e:e.childNodes,n=o[i];if(Bn(n))return n.data=Un+n.data,n;{const n=t.createTextNode(Un);return Array.isArray(e)?o.splice(i,0,n):Zn(e,i,n),n}}function or(t,e){return tr(t)&&tr(e)&&!Bn(t)&&!Bn(e)&&t.nodeType!==Node.COMMENT_NODE&&e.nodeType!==Node.COMMENT_NODE&&t.tagName.toLowerCase()===e.tagName.toLowerCase()}function nr(t,e,i){return e===i||(Bn(e)&&Bn(i)?e.data===i.data:!(!t.isBlockFiller(e)||!t.isBlockFiller(i)))}yi(er,Uo);var rr={window:window,document:document};function sr(t){let e=0;for(;t.previousSibling;)t=t.previousSibling,e++;return e}function ar(t){const e=[];for(;t&&t.nodeType!=Node.DOCUMENT_NODE;)e.unshift(t),t=t.parentNode;return e}const lr=Hn(document);class cr{constructor(t,e={}){this.document=t,this.blockFillerMode=e.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?Hn:Fn,this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new Di,this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(t,e){this._fakeSelectionMapping.set(t,new nn(e))}fakeSelectionToView(t){return this._fakeSelectionMapping.get(t)}bindElements(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}unbindDomElement(t){const e=this._domToViewMapping.get(t);if(e){this._domToViewMapping.delete(t),this._viewToDomMapping.delete(e);for(const e of t.childNodes)this.unbindDomElement(e)}}bindDocumentFragments(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}viewToDom(t,e,i={}){if(t.is("$text")){const i=this._processDataFromViewText(t);return e.createTextNode(i)}{if(this.mapViewToDom(t))return this.mapViewToDom(t);let o;if(t.is("documentFragment"))o=e.createDocumentFragment(),i.bind&&this.bindDocumentFragments(o,t);else{if(t.is("uiElement"))return o=t.render(e),i.bind&&this.bindElements(o,t),o;o=t.hasAttribute("xmlns")?e.createElementNS(t.getAttribute("xmlns"),t.name):e.createElement(t.name),t.is("rawElement")&&t.render(o),i.bind&&this.bindElements(o,t);for(const e of t.getAttributeKeys())o.setAttribute(e,t.getAttribute(e))}if(!1!==i.withChildren)for(const n of this.viewChildrenToDom(t,e,i))o.appendChild(n);return o}}*viewChildrenToDom(t,e,i={}){const o=t.getFillerOffset&&t.getFillerOffset();let n=0;for(const r of t.getChildren())o===n&&(yield this._blockFiller(e)),yield this.viewToDom(r,e,i),n++;o===n&&(yield this._blockFiller(e))}viewRangeToDom(t){const e=this.viewPositionToDom(t.start),i=this.viewPositionToDom(t.end),o=document.createRange();return o.setStart(e.parent,e.offset),o.setEnd(i.parent,i.offset),o}viewPositionToDom(t){const e=t.parent;if(e.is("$text")){const i=this.findCorrespondingDomText(e);if(!i)return null;let o=t.offset;return qn(i)&&(o+=7),{parent:i,offset:o}}{let i,o,n;if(0===t.offset){if(i=this.mapViewToDom(e),!i)return null;n=i.childNodes[0]}else{const e=t.nodeBefore;if(o=e.is("$text")?this.findCorrespondingDomText(e):this.mapViewToDom(t.nodeBefore),!o)return null;i=o.parentNode,n=o.nextSibling}if(Bn(n)&&qn(n))return{parent:n,offset:7};return{parent:i,offset:o?sr(o)+1:0}}}domToView(t,e={}){if(this.isBlockFiller(t,this.blockFillerMode))return null;const i=this.getHostViewElement(t);if(i)return i;if(Bn(t)){if(Wn(t))return null;{const e=this._processDataFromDomText(t);return""===e?null:new zi(this.document,e)}}if(this.isComment(t))return null;{if(this.mapDomToView(t))return this.mapDomToView(t);let i;if(this.isDocumentFragment(t))i=new En(this.document),e.bind&&this.bindDocumentFragments(t,i);else{const o=e.keepOriginalCase?t.tagName:t.tagName.toLowerCase();i=new zo(this.document,o),e.bind&&this.bindElements(t,i);const n=t.attributes;for(let t=n.length-1;t>=0;t--)i._setAttribute(n[t].name,n[t].value);if(!1!==e.withChildren&&this._rawContentElementMatcher.match(i))return i._setCustomProperty("$rawContent",t.innerHTML),this._encounteredRawContentDomNodes.add(t),i}if(!1!==e.withChildren)for(const o of this.domChildrenToView(t,e))i._appendChild(o);return i}}*domChildrenToView(t,e={}){for(let i=0;i{const{scrollLeft:e,scrollTop:i}=t;o.push([e,i])}),e.focus(),hr(e,t=>{const[e,i]=o.shift();t.scrollLeft=e,t.scrollTop=i}),rr.window.scrollTo(t,i)}}isElement(t){return t&&t.nodeType==Node.ELEMENT_NODE}isDocumentFragment(t){return t&&t.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(t){return t&&t.nodeType==Node.COMMENT_NODE}isBlockFiller(t){return"br"==this.blockFillerMode?t.isEqualNode(lr):!("BR"!==t.tagName||!ur(t,this.blockElements)||1!==t.parentNode.childNodes.length)||function(t,e){return Bn(t)&&" "==t.data&&ur(t,e)&&1===t.parentNode.childNodes.length}(t,this.blockElements)}isDomSelectionBackward(t){if(t.isCollapsed)return!1;const e=document.createRange();e.setStart(t.anchorNode,t.anchorOffset),e.setEnd(t.focusNode,t.focusOffset);const i=e.collapsed;return e.detach(),i}getHostViewElement(t){const e=ar(t);for(e.pop();e.length;){const t=e.pop(),i=this._domToViewMapping.get(t);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(t){return this._isDomSelectionPositionCorrect(t.anchorNode,t.anchorOffset)&&this._isDomSelectionPositionCorrect(t.focusNode,t.focusOffset)}registerRawContentMatcher(t){this._rawContentElementMatcher.add(t)}_isDomSelectionPositionCorrect(t,e){if(Bn(t)&&qn(t)&&e<7)return!1;if(this.isElement(t)&&qn(t.childNodes[e]))return!1;const i=this.mapDomToView(t);return!i||!i.is("uiElement")&&!i.is("rawElement")}_processDataFromViewText(t){let e=t.data;if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return e;if(" "==e.charAt(0)){const i=this._getTouchingViewTextNode(t,!1);!(i&&this._nodeEndsWithSpace(i))&&i||(e=" "+e.substr(1))}if(" "==e.charAt(e.length-1)){const i=this._getTouchingViewTextNode(t,!0);" "!=e.charAt(e.length-2)&&i&&" "!=i.data.charAt(0)||(e=e.substr(0,e.length-1)+" ")}return e.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(t){if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return!1;const e=this._processDataFromViewText(t);return" "==e.charAt(e.length-1)}_processDataFromDomText(t){let e=t.data;if(dr(t,this.preElements))return $n(t);e=e.replace(/[ \n\t\r]{1,}/g," ");const i=this._getTouchingInlineDomNode(t,!1),o=this._getTouchingInlineDomNode(t,!0),n=this._checkShouldLeftTrimDomText(t,i),r=this._checkShouldRightTrimDomText(t,o);return n&&(e=e.replace(/^ /,"")),r&&(e=e.replace(/ $/,"")),e=$n(new Text(e)),e=e.replace(/ \u00A0/g," "),(/( |\u00A0)\u00A0$/.test(e)||!o||o.data&&" "==o.data.charAt(0))&&(e=e.replace(/\u00A0$/," ")),n&&(e=e.replace(/^\u00A0/," ")),e}_checkShouldLeftTrimDomText(t,e){return!e||(!!ii(e)||!this._encounteredRawContentDomNodes.has(t.previousSibling)&&/[^\S\u00A0]/.test(e.data.charAt(e.data.length-1)))}_checkShouldRightTrimDomText(t,e){return!e&&!qn(t)}_getTouchingViewTextNode(t,e){const i=new Zo({startPosition:e?Xo._createAfter(t):Xo._createBefore(t),direction:e?"forward":"backward"});for(const t of i){if(t.item.is("containerElement"))return null;if(t.item.is("element","br"))return null;if(t.item.is("$textProxy"))return t.item}return null}_getTouchingInlineDomNode(t,e){if(!t.parentNode)return null;const i=e?"nextNode":"previousNode",o=t.ownerDocument,n=ar(t)[0],r=o.createTreeWalker(n,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode:t=>Bn(t)||"BR"==t.tagName?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});r.currentNode=t;const s=r[i]();if(null!==s){const e=function(t,e){const i=ar(t),o=ar(e);let n=0;for(;i[n]==o[n]&&i[n];)n++;return 0===n?null:i[n-1]}(t,s);if(e&&!dr(t,this.blockElements,e)&&!dr(s,this.blockElements,e))return s}return null}}function dr(t,e,i){let o=ar(t);return i&&(o=o.slice(o.indexOf(i)+1)),o.some(t=>t.tagName&&e.includes(t.tagName.toLowerCase()))}function hr(t,e){for(;t&&t!=rr.document;)e(t),t=t.parentNode}function ur(t,e){const i=t.parentNode;return i&&i.tagName&&e.includes(i.tagName.toLowerCase())}function gr(t){const e=Object.prototype.toString.apply(t);return"[object Window]"==e||"[object global]"==e}var mr=Vo({},mi,{listenTo(t,...e){if(tr(t)||gr(t)){const i=this._getProxyEmitter(t)||new fr(t);i.attach(...e),t=i}mi.listenTo.call(this,t,...e)},stopListening(t,e,i){if(tr(t)||gr(t)){const e=this._getProxyEmitter(t);if(!e)return;t=e}mi.stopListening.call(this,t,e,i),t instanceof fr&&t.detach(e)},_getProxyEmitter(t){return e=this,i=pr(t),e[ui]&&e[ui][i]?e[ui][i].emitter:null;var e,i}});class fr{constructor(t){fi(this,pr(t)),this._domNode=t}}function pr(t){return t["data-ck-expando"]||(t["data-ck-expando"]=ci())}Vo(fr.prototype,mi,{attach(t,e,i={}){if(this._domListeners&&this._domListeners[t])return;const o={capture:!!i.useCapture,passive:!!i.usePassive},n=this._createDomListener(t,o);this._domNode.addEventListener(t,n,o),this._domListeners||(this._domListeners={}),this._domListeners[t]=n},detach(t){let e;!this._domListeners[t]||(e=this._events[t])&&e.callbacks.length||this._domListeners[t].removeListener()},_createDomListener(t,e){const i=e=>{this.fire(t,e)};return i.removeListener=()=>{this._domNode.removeEventListener(t,i,e),delete this._domListeners[t]},i}});class br{constructor(t){this.view=t,this.document=t.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(t){return t&&3===t.nodeType&&(t=t.parentNode),!(!t||1!==t.nodeType)&&t.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}yi(br,mr);var wr=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var kr=function(t){return this.__data__.has(t)};function _r(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new kt;++ea))return!1;var c=r.get(t);if(c&&r.get(e))return c==e;var d=-1,h=!0,u=2&i?new vr:void 0;for(r.set(t,e),r.set(e,t);++d{this.listenTo(t,e,(t,e)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(e.target)&&this.onDomEvent(e)},{useCapture:this.useCapture})})}fire(t,e,i){this.isEnabled&&this.document.fire(t,new Dr(this.view,e,i))}}class jr extends Vr{constructor(t){super(t),this.domEventType=["keydown","keyup"]}onDomEvent(t){this.fire(t.type,t,{keyCode:t.keyCode,altKey:t.altKey,ctrlKey:t.ctrlKey||t.metaKey,shiftKey:t.shiftKey,get keystroke(){return bn(this)}})}}var Br=function(){return o.a.Date.now()},Fr=/^\s+|\s+$/g,Hr=/^[-+]0x[0-9a-f]+$/i,Ur=/^0b[01]+$/i,qr=/^0o[0-7]+$/i,Wr=parseInt;var $r=function(t){if("number"==typeof t)return t;if(ji(t))return NaN;if(D(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=D(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Fr,"");var i=Ur.test(t);return i||qr.test(t)?Wr(t.slice(2),i?2:8):Hr.test(t)?NaN:+t},Gr=Math.max,Yr=Math.min;var Kr=function(t,e,i){var o,n,r,s,a,l,c=0,d=!1,h=!1,u=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var i=o,r=n;return o=n=void 0,c=e,s=t.apply(r,i)}function m(t){return c=t,a=setTimeout(p,e),d?g(t):s}function f(t){var i=t-l;return void 0===l||i>=e||i<0||h&&t-c>=r}function p(){var t=Br();if(f(t))return b(t);a=setTimeout(p,function(t){var i=e-(t-l);return h?Yr(i,r-(t-c)):i}(t))}function b(t){return a=void 0,u&&o?g(t):(o=n=void 0,s)}function w(){var t=Br(),i=f(t);if(o=arguments,n=this,l=t,i){if(void 0===a)return m(l);if(h)return clearTimeout(a),a=setTimeout(p,e),g(l)}return void 0===a&&(a=setTimeout(p,e)),s}return e=$r(e)||0,D(i)&&(d=!!i.leading,r=(h="maxWait"in i)?Gr($r(i.maxWait)||0,e):r,u="trailing"in i?!!i.trailing:u),w.cancel=function(){void 0!==a&&clearTimeout(a),c=0,o=l=n=a=void 0},w.flush=function(){return void 0===a?s:b(Br())},w};class Qr extends br{constructor(t){super(t),this._fireSelectionChangeDoneDebounced=Kr(t=>this.document.fire("selectionChangeDone",t),200)}observe(){const t=this.document;t.on("keydown",(e,i)=>{t.selection.isFake&&_n(i.keyCode)&&this.isEnabled&&(i.preventDefault(),this._handleSelectionMove(i.keyCode))},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(t){const e=this.document.selection,i=new nn(e.getRanges(),{backward:e.isBackward,fake:!1});t!=pn.arrowleft&&t!=pn.arrowup||i.setTo(i.getFirstPosition()),t!=pn.arrowright&&t!=pn.arrowdown||i.setTo(i.getLastPosition());const o={oldSelection:e,newSelection:i,domSelection:null};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}}class Jr extends br{constructor(t){super(t),this.mutationObserver=t.getObserver(Rr),this.selection=this.document.selection,this.domConverter=t.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Kr(t=>this.document.fire("selectionChangeDone",t),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(t){const e=t.ownerDocument;this._documents.has(e)||(this.listenTo(e,"selectionchange",(t,i)=>{this._handleSelectionChange(i,e)}),this._documents.add(e))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(t,e){if(!this.isEnabled)return;const i=e.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(i.anchorNode))return;this.mutationObserver.flush();const o=this.domConverter.domSelectionToView(i);if(0!=o.rangeCount){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(o)&&this.domConverter.isDomSelectionCorrect(i)||++this._loopbackCounter>60))if(this.selection.isSimilar(o))this.view.forceRender();else{const t={oldSelection:this.selection,newSelection:o,domSelection:i};this.document.fire("selectionChange",t),this._fireSelectionChangeDoneDebounced(t)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class Zr extends Vr{constructor(t){super(t),this.domEventType=["focus","blur"],this.useCapture=!0;const e=this.document;e.on("focus",()=>{e.isFocused=!0,this._renderTimeoutId=setTimeout(()=>t.forceRender(),50)}),e.on("blur",(i,o)=>{const n=e.selection.editableElement;null!==n&&n!==o.target||(e.isFocused=!1,t.forceRender())})}onDomEvent(t){this.fire(t.type,t)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class Xr extends Vr{constructor(t){super(t),this.domEventType=["compositionstart","compositionupdate","compositionend"];const e=this.document;e.on("compositionstart",()=>{e.isComposing=!0}),e.on("compositionend",()=>{e.isComposing=!1})}onDomEvent(t){this.fire(t.type,t)}}class ts extends Vr{constructor(t){super(t),this.domEventType=["beforeinput"]}onDomEvent(t){this.fire(t.type,t)}}function es(t){return"[object Range]"==Object.prototype.toString.apply(t)}function is(t){const e=t.ownerDocument.defaultView.getComputedStyle(t);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}const os=["top","right","bottom","left","width","height"];class ns{constructor(t){const e=es(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),ii(t)||e)if(e){const e=ns.getDomRangeRects(t);rs(this,ns.getBoundingRect(e))}else rs(this,t.getBoundingClientRect());else if(gr(t)){const{innerWidth:e,innerHeight:i}=t;rs(this,{top:0,right:e,bottom:i,left:0,width:e,height:i})}else rs(this,t)}clone(){return new ns(this)}moveTo(t,e){return this.top=e,this.right=t+this.width,this.bottom=e+this.height,this.left=t,this}moveBy(t,e){return this.top+=e,this.right+=t,this.left+=t,this.bottom+=e,this}getIntersection(t){const e={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left)};return e.width=e.right-e.left,e.height=e.bottom-e.top,e.width<0||e.height<0?null:new ns(e)}getIntersectionArea(t){const e=this.getIntersection(t);return e?e.getArea():0}getArea(){return this.width*this.height}getVisible(){const t=this._source;let e=this.clone();if(!ss(t)){let i=t.parentNode||t.commonAncestorContainer;for(;i&&!ss(i);){const t=new ns(i),o=e.getIntersection(t);if(!o)return null;o.getArea()ps(t,o));const s=ps(t,o);if(ls(o,s,e),o.parent!=o){if(n=o.frameElement,o=o.parent,!n)return}else o=null}}function ls(t,e,i){const o=e.clone().moveBy(0,i),n=e.clone().moveBy(0,-i),r=new ns(t).excludeScrollbarsAndBorders();if(![n,o].every(t=>r.contains(t))){let{scrollX:s,scrollY:a}=t;hs(n,r)?a-=r.top-e.top+i:ds(o,r)&&(a+=e.bottom-r.bottom+i),us(e,r)?s-=r.left-e.left+i:gs(e,r)&&(s+=e.right-r.right+i),t.scrollTo(s,a)}}function cs(t,e){const i=ms(t);let o,n;for(;t!=i.document.body;)n=e(),o=new ns(t).excludeScrollbarsAndBorders(),o.contains(n)||(hs(n,o)?t.scrollTop-=o.top-n.top:ds(n,o)&&(t.scrollTop+=n.bottom-o.bottom),us(n,o)?t.scrollLeft-=o.left-n.left:gs(n,o)&&(t.scrollLeft+=n.right-o.right)),t=t.parentNode}function ds(t,e){return t.bottom>e.bottom}function hs(t,e){return t.tope.right}function ms(t){return es(t)?t.startContainer.ownerDocument.defaultView:t.ownerDocument.defaultView}function fs(t){if(es(t)){let e=t.commonAncestorContainer;return Bn(e)&&(e=e.parentNode),e}return t.parentNode}function ps(t,e){const i=ms(t),o=new ns(t);if(i===e)return o;{let t=i;for(;t!=e;){const e=t.frameElement,i=new ns(e).excludeScrollbarsAndBorders();o.moveBy(i.left,i.top),t=t.parent}}return o}Object.assign({},{scrollViewportToShowTarget:as,scrollAncestorsToShowTarget:function(t){cs(fs(t),()=>new ns(t))}});class bs{constructor(t){this.document=new sn(t),this.domConverter=new cr(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new er(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new Mn(this.document),this.addObserver(Rr),this.addObserver(Jr),this.addObserver(Zr),this.addObserver(jr),this.addObserver(Qr),this.addObserver(Xr),gn.isAndroid&&this.addObserver(ts),this.document.on("keydown",Gn),Tn(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(t,e="main"){const i=this.document.getRoot(e);i._name=t.tagName.toLowerCase();const o={};for(const{name:e,value:n}of Array.from(t.attributes))o[e]=n,"class"===e?this._writer.addClass(n.split(" "),i):this._writer.setAttribute(e,n,i);this._initialDomRootAttributes.set(t,o);const n=()=>{this._writer.setAttribute("contenteditable",!i.isReadOnly,i),i.isReadOnly?this._writer.addClass("ck-read-only",i):this._writer.removeClass("ck-read-only",i)};n(),this.domRoots.set(e,t),this.domConverter.bindElements(t,i),this._renderer.markToSync("children",i),this._renderer.markToSync("attributes",i),this._renderer.domDocuments.add(t.ownerDocument),i.on("change:children",(t,e)=>this._renderer.markToSync("children",e)),i.on("change:attributes",(t,e)=>this._renderer.markToSync("attributes",e)),i.on("change:text",(t,e)=>this._renderer.markToSync("text",e)),i.on("change:isReadOnly",()=>this.change(n)),i.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const i of this._observers.values())i.observe(t,e)}detachDomRoot(t){const e=this.domRoots.get(t);Array.from(e.attributes).forEach(({name:t})=>e.removeAttribute(t));const i=this._initialDomRootAttributes.get(e);for(const t in i)e.setAttribute(t,i[t]);this.domRoots.delete(t),this.domConverter.unbindDomElement(e)}getDomRoot(t="main"){return this.domRoots.get(t)}addObserver(t){let e=this._observers.get(t);if(e)return e;e=new t(this),this._observers.set(t,e);for(const[t,i]of this.domRoots)e.observe(i,t);return e.enable(),e}getObserver(t){return this._observers.get(t)}disableObservers(){for(const t of this._observers.values())t.disable()}enableObservers(){for(const t of this._observers.values())t.enable()}scrollToTheSelection(){const t=this.document.selection.getFirstRange();t&&as({target:this.domConverter.viewRangeToDom(t),viewportOffset:20})}focus(){if(!this.document.isFocused){const t=this.document.selection.editableElement;t&&(this.domConverter.focus(t),this.forceRender())}}change(t){if(this.isRenderingInProgress||this._postFixersInProgress)throw new hi.a("cannot-change-view-tree",this);try{if(this._ongoingChange)return t(this._writer);this._ongoingChange=!0;const e=t(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),e}catch(t){hi.a.rethrowUnexpectedError(t,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(()=>{})}destroy(){for(const t of this._observers.values())t.destroy();this.document.destroy(),this.stopListening()}createPositionAt(t,e){return Xo._createAt(t,e)}createPositionAfter(t){return Xo._createAfter(t)}createPositionBefore(t){return Xo._createBefore(t)}createRange(t,e){return new tn(t,e)}createRangeOn(t){return tn._createOn(t)}createRangeIn(t){return tn._createIn(t)}createSelection(t,e,i){return new nn(t,e,i)}_disableRendering(t){this._renderingDisabled=t,0==t&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}yi(bs,Uo);class ws{constructor(t){this.parent=null,this._attrs=Ri(t)}get index(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildIndex(this)))throw new hi.a("model-node-not-found-in-parent",this);return t}get startOffset(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildStartOffset(this)))throw new hi.a("model-node-not-found-in-parent",this);return t}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const t=this.index;return null!==t&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return null!==t&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}isAttached(){return this.root.is("rootElement")}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.startOffset),e=e.parent;return t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this:this.parent;for(;i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}getCommonAncestor(t,e={}){const i=this.getAncestors(e),o=t.getAncestors(e);let n=0;for(;i[n]==o[n]&&i[n];)n++;return 0===n?null:i[n-1]}isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;const e=this.getPath(),i=t.getPath(),o=Li(e,i);switch(o){case"prefix":return!0;case"extension":return!1;default:return e[o](t[e[0]]=e[1],t),{})),t}is(t){return"node"===t||"model:node"===t}_clone(){return new ws(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(t,e){this._attrs.set(t,e)}_setAttributesTo(t){this._attrs=Ri(t)}_removeAttribute(t){return this._attrs.delete(t)}_clearAttributes(){this._attrs.clear()}}class ks extends ws{constructor(t,e){super(e),this._data=t||""}get offsetSize(){return this.data.length}get data(){return this._data}is(t){return"$text"===t||"model:$text"===t||"text"===t||"model:text"===t||"node"===t||"model:node"===t}toJSON(){const t=super.toJSON();return t.data=this.data,t}_clone(){return new ks(this.data,this.getAttributes())}static fromJSON(t){return new ks(t.data,t.attributes)}}class _s{constructor(t,e,i){if(this.textNode=t,e<0||e>t.offsetSize)throw new hi.a("model-textproxy-wrong-offsetintext",this);if(i<0||e+i>t.offsetSize)throw new hi.a("model-textproxy-wrong-length",this);this.data=t.data.substring(e,e+i),this.offsetInText=e}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}is(t){return"$textProxy"===t||"model:$textProxy"===t||"textProxy"===t||"model:textProxy"===t}getPath(){const t=this.textNode.getPath();return t.length>0&&(t[t.length-1]+=this.offsetInText),t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this:this.parent;for(;i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}hasAttribute(t){return this.textNode.hasAttribute(t)}getAttribute(t){return this.textNode.getAttribute(t)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class vs{constructor(t){this._nodes=[],t&&this._insertNodes(0,t)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((t,e)=>t+e.offsetSize,0)}getNode(t){return this._nodes[t]||null}getNodeIndex(t){const e=this._nodes.indexOf(t);return-1==e?null:e}getNodeStartOffset(t){const e=this.getNodeIndex(t);return null===e?null:this._nodes.slice(0,e).reduce((t,e)=>t+e.offsetSize,0)}indexToOffset(t){if(t==this._nodes.length)return this.maxOffset;const e=this._nodes[t];if(!e)throw new hi.a("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(e)}offsetToIndex(t){let e=0;for(const i of this._nodes){if(t>=e&&tt.toJSON())}}class ys extends ws{constructor(t,e,i){super(e),this.name=t,this._children=new vs,i&&this._insertChild(0,i)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(t,e=null){return e?e===this.name&&("element"===t||"model:element"===t):"element"===t||"model:element"===t||"node"===t||"model:node"===t}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}offsetToIndex(t){return this._children.offsetToIndex(t)}getNodeByPath(t){let e=this;for(const i of t)e=e.getChild(e.offsetToIndex(i));return e}findAncestor(t,e={includeSelf:!1}){let i=e.includeSelf?this:this.parent;for(;i;){if(i.name===t)return i;i=i.parent}return null}toJSON(){const t=super.toJSON();if(t.name=this.name,this._children.length>0){t.children=[];for(const e of this._children)t.children.push(e.toJSON())}return t}_clone(t=!1){const e=t?Array.from(this._children).map(t=>t._clone(!0)):null;return new ys(this.name,this.getAttributes(),e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const i=function(t){if("string"==typeof t)return[new ks(t)];vi(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new ks(t):t instanceof _s?new ks(t.data,t.getAttributes()):t)}(e);for(const t of i)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,i)}_removeChildren(t,e=1){const i=this._children._removeNodes(t,e);for(const t of i)t.parent=null;return i}static fromJSON(t){let e=null;if(t.children){e=[];for(const i of t.children)i.name?e.push(ys.fromJSON(i)):e.push(ks.fromJSON(i))}return new ys(t.name,t.attributes,e)}}class xs{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new hi.a("model-tree-walker-no-start-position",null);const e=t.direction||"forward";if("forward"!=e&&"backward"!=e)throw new hi.a("model-tree-walker-unknown-direction",t,{direction:e});this.direction=e,this.boundaries=t.boundaries||null,t.startPosition?this.position=t.startPosition.clone():this.position=Ts._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(t){let e,i,o,n;do{o=this.position,n=this._visitedParent,({done:e,value:i}=this.next())}while(!e&&t(i));e||(this.position=o,this._visitedParent=n)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const t=this.position,e=this.position.clone(),i=this._visitedParent;if(null===i.parent&&e.offset===i.maxOffset)return{done:!0};if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};const o=e.parent,n=Cs(e,o),r=n||Ss(e,o,n);if(r instanceof ys)return this.shallow?e.offset++:(e.path.push(0),this._visitedParent=r),this.position=e,As("elementStart",r,t,e,1);if(r instanceof ks){let o;if(this.singleCharacters)o=1;else{let t=r.endOffset;this._boundaryEndParent==i&&this.boundaries.end.offsett&&(t=this.boundaries.start.offset),o=e.offset-t}const n=e.offset-r.startOffset,s=new _s(r,n-o,o);return e.offset-=o,this.position=e,As("text",s,t,e,o)}return e.path.pop(),this.position=e,this._visitedParent=i.parent,As("elementStart",i,t,e,1)}}function As(t,e,i,o,n){return{done:!1,value:{type:t,item:e,previousPosition:i,nextPosition:o,length:n}}}class Ts{constructor(t,e,i="toNone"){if(!t.is("element")&&!t.is("documentFragment"))throw new hi.a("model-position-root-invalid",t);if(!(e instanceof Array)||0===e.length)throw new hi.a("model-position-path-incorrect-format",t,{path:e});t.is("rootElement")?e=e.slice():(e=[...t.getPath(),...e],t=t.root),this.root=t,this.path=e,this.stickiness=i}get offset(){return this.path[this.path.length-1]}set offset(t){this.path[this.path.length-1]=t}get parent(){let t=this.root;for(let e=0;ei.path.length){if(e.offset!==o.maxOffset)return!1;e.path=e.path.slice(0,-1),o=o.parent,e.offset++}else{if(0!==i.offset)return!1;i.path=i.path.slice(0,-1)}}}is(t){return"position"===t||"model:position"===t}hasSameParentAs(t){if(this.root!==t.root)return!1;return"same"==Li(this.getParentPath(),t.getParentPath())}getTransformedByOperation(t){let e;switch(t.type){case"insert":e=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":e=this._getTransformedByMoveOperation(t);break;case"split":e=this._getTransformedBySplitOperation(t);break;case"merge":e=this._getTransformedByMergeOperation(t);break;default:e=Ts._createAt(this)}return e}_getTransformedByInsertOperation(t){return this._getTransformedByInsertion(t.position,t.howMany)}_getTransformedByMoveOperation(t){return this._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}_getTransformedBySplitOperation(t){const e=t.movedRange;return e.containsPosition(this)||e.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(t.splitPosition,t.moveTargetPosition):t.graveyardPosition?this._getTransformedByMove(t.graveyardPosition,t.insertionPosition,1):this._getTransformedByInsertion(t.insertionPosition,1)}_getTransformedByMergeOperation(t){const e=t.movedRange;let i;return e.containsPosition(this)||e.start.isEqual(this)?(i=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(i=i._getTransformedByDeletion(t.deletionPosition,1))):i=this.isEqual(t.deletionPosition)?Ts._createAt(t.deletionPosition):this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),i}_getTransformedByDeletion(t,e){const i=Ts._createAt(this);if(this.root!=t.root)return i;if("same"==Li(t.getParentPath(),this.getParentPath())){if(t.offsetthis.offset)return null;i.offset-=e}}else if("prefix"==Li(t.getParentPath(),this.getParentPath())){const o=t.path.length-1;if(t.offset<=this.path[o]){if(t.offset+e>this.path[o])return null;i.path[o]-=e}}return i}_getTransformedByInsertion(t,e){const i=Ts._createAt(this);if(this.root!=t.root)return i;if("same"==Li(t.getParentPath(),this.getParentPath()))(t.offsete+1;){const e=o.maxOffset-i.offset;0!==e&&t.push(new Es(i,i.getShiftedBy(e))),i.path=i.path.slice(0,-1),i.offset++,o=o.parent}for(;i.path.length<=this.end.path.length;){const e=this.end.path[i.path.length-1],o=e-i.offset;0!==o&&t.push(new Es(i,i.getShiftedBy(o))),i.offset=e,i.path.push(0)}return t}getWalker(t={}){return t.boundaries=this,new xs(t)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new xs(t);for(const t of e)yield t.item}*getPositions(t={}){t.boundaries=this;const e=new xs(t);yield e.position;for(const t of e)yield t.nextPosition}getTransformedByOperation(t){switch(t.type){case"insert":return this._getTransformedByInsertOperation(t);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(t);case"split":return[this._getTransformedBySplitOperation(t)];case"merge":return[this._getTransformedByMergeOperation(t)]}return[new Es(this.start,this.end)]}getTransformedByOperations(t){const e=[new Es(this.start,this.end)];for(const i of t)for(let t=0;t0?new this(i,o):new this(o,i)}static _createIn(t){return new this(Ts._createAt(t,0),Ts._createAt(t,t.maxOffset))}static _createOn(t){return this._createFromPositionAndShift(Ts._createBefore(t),t.offsetSize)}static _createFromRanges(t){if(0===t.length)throw new hi.a("range-create-from-ranges-empty-array",null);if(1==t.length)return t[0].clone();const e=t[0];t.sort((t,e)=>t.start.isAfter(e.start)?1:-1);const i=t.indexOf(e),o=new this(e.start,e.end);if(i>0)for(let e=i-1;t[e].end.isEqual(o.start);e++)o.start=Ts._createAt(t[e].start);for(let e=i+1;e{if(e.viewPosition)return;const i=this._modelToViewMapping.get(e.modelPosition.parent);e.viewPosition=this.findPositionIn(i,e.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(t,e)=>{if(e.modelPosition)return;const i=this.findMappedViewAncestor(e.viewPosition),o=this._viewToModelMapping.get(i),n=this._toModelOffset(e.viewPosition.parent,e.viewPosition.offset,i);e.modelPosition=Ts._createAt(o,n)},{priority:"low"})}bindElements(t,e){this._modelToViewMapping.set(t,e),this._viewToModelMapping.set(e,t)}unbindViewElement(t){const e=this.toModelElement(t);if(this._viewToModelMapping.delete(t),this._elementToMarkerNames.has(t))for(const e of this._elementToMarkerNames.get(t))this._unboundMarkerNames.add(e);this._modelToViewMapping.get(e)==t&&this._modelToViewMapping.delete(e)}unbindModelElement(t){const e=this.toViewElement(t);this._modelToViewMapping.delete(t),this._viewToModelMapping.get(e)==t&&this._viewToModelMapping.delete(e)}bindElementToMarker(t,e){const i=this._markerNameToElements.get(e)||new Set;i.add(t);const o=this._elementToMarkerNames.get(t)||new Set;o.add(e),this._markerNameToElements.set(e,i),this._elementToMarkerNames.set(t,o)}unbindElementFromMarkerName(t,e){const i=this._markerNameToElements.get(e);i&&(i.delete(t),0==i.size&&this._markerNameToElements.delete(e));const o=this._elementToMarkerNames.get(t);o&&(o.delete(e),0==o.size&&this._elementToMarkerNames.delete(t))}flushUnboundMarkerNames(){const t=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),t}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set}toModelElement(t){return this._viewToModelMapping.get(t)}toViewElement(t){return this._modelToViewMapping.get(t)}toModelRange(t){return new Es(this.toModelPosition(t.start),this.toModelPosition(t.end))}toViewRange(t){return new tn(this.toViewPosition(t.start),this.toViewPosition(t.end))}toModelPosition(t){const e={viewPosition:t,mapper:this};return this.fire("viewToModelPosition",e),e.modelPosition}toViewPosition(t,e={isPhantom:!1}){const i={modelPosition:t,mapper:this,isPhantom:e.isPhantom};return this.fire("modelToViewPosition",i),i.viewPosition}markerNameToElements(t){const e=this._markerNameToElements.get(t);if(!e)return null;const i=new Set;for(const t of e)if(t.is("attributeElement"))for(const e of t.getElementsWithSameId())i.add(e);else i.add(t);return i}registerViewToModelLength(t,e){this._viewToModelLengthCallbacks.set(t,e)}findMappedViewAncestor(t){let e=t.parent;for(;!this._viewToModelMapping.has(e);)e=e.parent;return e}_toModelOffset(t,e,i){if(i!=t){return this._toModelOffset(t.parent,t.index,i)+this._toModelOffset(t,e,t)}if(t.is("$text"))return e;let o=0;for(let i=0;i1?e[0]+":"+e[1]:e[0]}class Ns{constructor(t){this.conversionApi=Object.assign({dispatcher:this},t),this._reconversionEventsMapping=new Map}convertChanges(t,e,i){for(const e of t.getMarkersToRemove())this.convertMarkerRemove(e.name,e.range,i);const o=this._mapChangesWithAutomaticReconversion(t);for(const t of o)"insert"===t.type?this.convertInsert(Es._createFromPositionAndShift(t.position,t.length),i):"remove"===t.type?this.convertRemove(t.position,t.length,t.name,i):"reconvert"===t.type?this.reconvertElement(t.element,i):this.convertAttribute(t.range,t.attributeKey,t.attributeOldValue,t.attributeNewValue,i);for(const t of this.conversionApi.mapper.flushUnboundMarkerNames()){const o=e.get(t).getRange();this.convertMarkerRemove(t,o,i),this.convertMarkerAdd(t,o,i)}for(const e of t.getMarkersToAdd())this.convertMarkerAdd(e.name,e.range,i)}convertInsert(t,e){this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(t);for(const e of Array.from(t).map(Os))this._convertInsertWithAttributes(e);this._clearConversionApi()}convertRemove(t,e,i,o){this.conversionApi.writer=o,this.fire("remove:"+i,{position:t,length:e},this.conversionApi),this._clearConversionApi()}convertAttribute(t,e,i,o,n){this.conversionApi.writer=n,this.conversionApi.consumable=this._createConsumableForRange(t,"attribute:"+e);for(const n of t){const t={item:n.item,range:Es._createFromPositionAndShift(n.previousPosition,n.length),attributeKey:e,attributeOldValue:i,attributeNewValue:o};this._testAndFire("attribute:"+e,t)}this._clearConversionApi()}reconvertElement(t,e){const i=Es._createOn(t);this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(i);const o=this.conversionApi.mapper,n=o.toViewElement(t);e.remove(n),this._convertInsertWithAttributes({item:t,range:i});const r=o.toViewElement(t);for(const i of Es._createIn(t)){const{item:t}=i,n=Rs(t,o);n?n.root!==r.root&&e.move(e.createRangeOn(n),o.toViewPosition(Ts._createBefore(t))):this._convertInsertWithAttributes(Os(i))}o.unbindViewElement(n),this._clearConversionApi()}convertSelection(t,e,i){const o=Array.from(e.getMarkersAtPosition(t.getFirstPosition()));if(this.conversionApi.writer=i,this.conversionApi.consumable=this._createSelectionConsumable(t,o),this.fire("selection",{selection:t},this.conversionApi),t.isCollapsed){for(const e of o){const i=e.getRange();if(!zs(t.getFirstPosition(),e,this.conversionApi.mapper))continue;const o={item:t,markerName:e.name,markerRange:i};this.conversionApi.consumable.test(t,"addMarker:"+e.name)&&this.fire("addMarker:"+e.name,o,this.conversionApi)}for(const e of t.getAttributeKeys()){const i={item:t,range:t.getFirstRange(),attributeKey:e,attributeOldValue:null,attributeNewValue:t.getAttribute(e)};this.conversionApi.consumable.test(t,"attribute:"+i.attributeKey)&&this.fire("attribute:"+i.attributeKey+":$text",i,this.conversionApi)}this._clearConversionApi()}}convertMarkerAdd(t,e,i){if(!e.root.document||"$graveyard"==e.root.rootName)return;this.conversionApi.writer=i;const o="addMarker:"+t,n=new Ls;if(n.add(e,o),this.conversionApi.consumable=n,this.fire(o,{markerName:t,markerRange:e},this.conversionApi),n.test(e,o)){this.conversionApi.consumable=this._createConsumableForRange(e,o);for(const i of e.getItems()){if(!this.conversionApi.consumable.test(i,o))continue;const n={item:i,range:Es._createOn(i),markerName:t,markerRange:e};this.fire(o,n,this.conversionApi)}this._clearConversionApi()}}convertMarkerRemove(t,e,i){e.root.document&&"$graveyard"!=e.root.rootName&&(this.conversionApi.writer=i,this.fire("removeMarker:"+t,{markerName:t,markerRange:e},this.conversionApi),this._clearConversionApi())}_mapReconversionTriggerEvent(t,e){this._reconversionEventsMapping.set(e,t)}_createInsertConsumable(t){const e=new Ls;for(const i of t){const t=i.item;e.add(t,"insert");for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i)}return e}_createConsumableForRange(t,e){const i=new Ls;for(const o of t.getItems())i.add(o,e);return i}_createSelectionConsumable(t,e){const i=new Ls;i.add(t,"selection");for(const o of e)i.add(t,"addMarker:"+o.name);for(const e of t.getAttributeKeys())i.add(t,"attribute:"+e);return i}_testAndFire(t,e){this.conversionApi.consumable.test(e.item,t)&&this.fire(function(t,e){const i=e.item.name||"$text";return`${t}:${i}`}(t,e),e,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}_convertInsertWithAttributes(t){this._testAndFire("insert",t);for(const e of t.item.getAttributeKeys())t.attributeKey=e,t.attributeOldValue=null,t.attributeNewValue=t.item.getAttribute(e),this._testAndFire("attribute:"+e,t)}_mapChangesWithAutomaticReconversion(t){const e=new Set,i=[];for(const o of t.getChanges()){const t=o.position||o.range.start,n=t.parent;if(Cs(t,n)){i.push(o);continue}const r="attribute"===o.type?Ss(t,n,null):n;if(r.is("$text")){i.push(o);continue}let s;if(s="attribute"===o.type?`attribute:${o.attributeKey}:${r.name}`:`${o.type}:${o.name}`,this._isReconvertTriggerEvent(s,r.name)){if(e.has(r))continue;e.add(r),i.push({type:"reconvert",element:r})}else i.push(o)}return i}_isReconvertTriggerEvent(t,e){return this._reconversionEventsMapping.get(t)===e}}function zs(t,e,i){const o=e.getRange(),n=Array.from(t.getAncestors());n.shift(),n.reverse();return!n.some(t=>{if(o.containsItem(t)){return!!i.toViewElement(t).getCustomProperty("addHighlight")}})}function Os(t){return{item:t.item,range:Es._createFromPositionAndShift(t.previousPosition,t.length)}}function Rs(t,e){if(t.is("textProxy")){const i=e.toViewPosition(Ts._createBefore(t)).parent;return i.is("$text")?i:null}return e.toViewElement(t)}yi(Ns,mi);class Ds{constructor(t,e,i){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,t&&this.setTo(t,e,i)}get anchor(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.end:t.start}return null}get focus(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.start:t.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(t){if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let i=!1;for(const o of t._ranges)if(e.isEqual(o)){i=!0;break}if(!i)return!1}return!0}*getRanges(){for(const t of this._ranges)yield new Es(t.start,t.end)}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?new Es(t.start,t.end):null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?new Es(t.start,t.end):null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}setTo(t,e,i){if(null===t)this._setRanges([]);else if(t instanceof Ds)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof Es)this._setRanges([t],!!e&&!!e.backward);else if(t instanceof Ts)this._setRanges([new Es(t)]);else if(t instanceof ws){const o=!!i&&!!i.backward;let n;if("in"==e)n=Es._createIn(t);else if("on"==e)n=Es._createOn(t);else{if(void 0===e)throw new hi.a("model-selection-setto-required-second-parameter",[this,t]);n=new Es(Ts._createAt(t,e))}this._setRanges([n],o)}else{if(!vi(t))throw new hi.a("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,e&&!!e.backward)}}_setRanges(t,e=!1){const i=(t=Array.from(t)).some(e=>{if(!(e instanceof Es))throw new hi.a("model-selection-set-ranges-not-range",[this,t]);return this._ranges.every(t=>!t.isEqual(e))});if(t.length!==this._ranges.length||i){this._removeAllRanges();for(const e of t)this._pushRange(e);this._lastRangeBackward=!!e,this.fire("change:range",{directChange:!0})}}setFocus(t,e){if(null===this.anchor)throw new hi.a("model-selection-setfocus-no-ranges",[this,t]);const i=Ts._createAt(t,e);if("same"==i.compareWith(this.focus))return;const o=this.anchor;this._ranges.length&&this._popRange(),"before"==i.compareWith(o)?(this._pushRange(new Es(i,o)),this._lastRangeBackward=!0):(this._pushRange(new Es(o,i)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(t){return this._attrs.has(t)}removeAttribute(t){this.hasAttribute(t)&&(this._attrs.delete(t),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}setAttribute(t,e){this.getAttribute(t)!==e&&(this._attrs.set(t,e),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}is(t){return"selection"===t||"model:selection"===t}*getSelectedBlocks(){const t=new WeakSet;for(const e of this.getRanges()){const i=Bs(e.start,t);i&&Fs(i,e)&&(yield i);for(const i of e.getWalker()){const o=i.item;"elementEnd"==i.type&&js(o,t,e)&&(yield o)}const o=Bs(e.end,t);o&&!e.end.isTouching(Ts._createAt(o,0))&&Fs(o,e)&&(yield o)}}containsEntireContent(t=this.anchor.root){const e=Ts._createAt(t,0),i=Ts._createAt(t,"end");return e.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}_pushRange(t){this._checkRange(t),this._ranges.push(new Es(t.start,t.end))}_checkRange(t){for(let e=0;e0;)this._popRange()}_popRange(){this._ranges.pop()}}function Vs(t,e){return!e.has(t)&&(e.add(t),t.root.document.model.schema.isBlock(t)&&t.parent)}function js(t,e,i){return Vs(t,e)&&Fs(t,i)}function Bs(t,e){const i=t.parent.root.document.model.schema,o=t.parent.getAncestors({parentFirst:!0,includeSelf:!0});let n=!1;const r=o.find(t=>!n&&(n=i.isLimit(t),!n&&Vs(t,e)));return o.forEach(t=>e.add(t)),r}function Fs(t,e){const i=function(t){const e=t.root.document.model.schema;let i=t.parent;for(;i;){if(e.isBlock(i))return i;i=i.parent}}(t);if(!i)return!0;return!e.containsRange(Es._createOn(i),!0)}yi(Ds,mi);class Hs extends Es{constructor(t,e){super(t,e),Us.call(this)}detach(){this.stopListening()}is(t){return"liveRange"===t||"model:liveRange"===t||"range"==t||"model:range"===t}toRange(){return new Es(this.start,this.end)}static fromRange(t){return new Hs(t.start,t.end)}}function Us(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&qs.call(this,i)},{priority:"low"})}function qs(t){const e=this.getTransformedByOperation(t),i=Es._createFromRanges(e),o=!i.isEqual(this),n=function(t,e){switch(e.type){case"insert":return t.containsPosition(e.position);case"move":case"remove":case"reinsert":case"merge":return t.containsPosition(e.sourcePosition)||t.start.isEqual(e.sourcePosition)||t.containsPosition(e.targetPosition);case"split":return t.containsPosition(e.splitPosition)||t.containsPosition(e.insertionPosition)}return!1}(this,t);let r=null;if(o){"$graveyard"==i.root.rootName&&(r="remove"==t.type?t.sourcePosition:t.deletionPosition);const e=this.toRange();this.start=i.start,this.end=i.end,this.fire("change:range",e,{deletionPosition:r})}else n&&this.fire("change:content",this.toRange(),{deletionPosition:r})}yi(Hs,mi);class Ws{constructor(t){this._selection=new $s(t),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(t){return this._selection.containsEntireContent(t)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(t){return this._selection.getAttribute(t)}hasAttribute(t){return this._selection.hasAttribute(t)}refresh(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(t){this._selection.observeMarkers(t)}is(t){return"selection"===t||"model:selection"==t||"documentSelection"==t||"model:documentSelection"==t}_setFocus(t,e){this._selection.setFocus(t,e)}_setTo(t,e,i){this._selection.setTo(t,e,i)}_setAttribute(t,e){this._selection.setAttribute(t,e)}_removeAttribute(t){this._selection.removeAttribute(t)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(t){this._selection.restoreGravity(t)}static _getStoreAttributeKey(t){return"selection:"+t}static _isStoreAttributeKey(t){return t.startsWith("selection:")}}yi(Ws,mi);class $s extends Ds{constructor(t){super(),this.markers=new xi({idProperty:"name"}),this._model=t.model,this._document=t,this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this.listenTo(this._model,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&"marker"!=i.type&&"rename"!=i.type&&"noop"!=i.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{for(const t of this.getRanges())if(!this._document._validateSelectionRange(t))throw new hi.a("document-selection-wrong-position",this,{range:t})}),this.listenTo(this._model.markers,"update",(t,e,i,o)=>{this._updateMarker(e,o)}),this.listenTo(this._document,"change",(t,e)=>{!function(t,e){const i=t.document.differ;for(const o of i.getChanges()){if("insert"!=o.type)continue;const i=o.position.parent;o.length===i.maxOffset&&t.enqueueChange(e,t=>{const e=Array.from(i.getAttributeKeys()).filter(t=>t.startsWith("selection:"));for(const o of e)t.removeAttribute(o,i)})}}(this._model,e)})}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let t=0;t{if(this._hasChangedRange=!0,e.root==this._document.graveyard){this._selectionRestorePosition=o.deletionPosition;const t=this._ranges.indexOf(e);this._ranges.splice(t,1),e.detach()}}),e}_updateMarkers(){if(!this._observedMarkers.size)return;const t=[];let e=!1;for(const e of this._model.markers){const i=e.name.split(":",1)[0];if(!this._observedMarkers.has(i))continue;const o=e.getRange();for(const i of this.getRanges())o.containsRange(i,!i.isCollapsed)&&t.push(e)}const i=Array.from(this.markers);for(const i of t)this.markers.has(i)||(this.markers.add(i),e=!0);for(const i of Array.from(this.markers))t.includes(i)||(this.markers.remove(i),e=!0);e&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateMarker(t,e){const i=t.name.split(":",1)[0];if(!this._observedMarkers.has(i))return;let o=!1;const n=Array.from(this.markers),r=this.markers.has(t);if(e){let i=!1;for(const t of this.getRanges())if(e.containsRange(t,!t.isCollapsed)){i=!0;break}i&&!r?(this.markers.add(t),o=!0):!i&&r&&(this.markers.remove(t),o=!0)}else r&&(this.markers.remove(t),o=!0);o&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateAttributes(t){const e=Ri(this._getSurroundingAttributes()),i=Ri(this.getAttributes());if(t)this._attributePriority=new Map,this._attrs=new Map;else for(const[t,e]of this._attributePriority)"low"==e&&(this._attrs.delete(t),this._attributePriority.delete(t));this._setAttributesTo(e);const o=[];for(const[t,e]of this.getAttributes())i.has(t)&&i.get(t)===e||o.push(t);for(const[t]of i)this.hasAttribute(t)||o.push(t);o.length>0&&this.fire("change:attribute",{attributeKeys:o,directChange:!1})}_setAttribute(t,e,i=!0){const o=i?"normal":"low";if("low"==o&&"normal"==this._attributePriority.get(t))return!1;return super.getAttribute(t)!==e&&(this._attrs.set(t,e),this._attributePriority.set(t,o),!0)}_removeAttribute(t,e=!0){const i=e?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(t))&&(this._attributePriority.set(t,i),!!super.hasAttribute(t)&&(this._attrs.delete(t),!0))}_setAttributesTo(t){const e=new Set;for(const[e,i]of this.getAttributes())t.get(e)!==i&&this._removeAttribute(e,!1);for(const[i,o]of t){this._setAttribute(i,o,!1)&&e.add(i)}return e}*_getStoredAttributes(){const t=this.getFirstPosition().parent;if(this.isCollapsed&&t.isEmpty)for(const e of t.getAttributeKeys())if(e.startsWith("selection:")){const i=e.substr("selection:".length);yield[i,t.getAttribute(e)]}}_getSurroundingAttributes(){const t=this.getFirstPosition(),e=this._model.schema;let i=null;if(this.isCollapsed){const o=t.textNode?t.textNode:t.nodeBefore,n=t.textNode?t.textNode:t.nodeAfter;if(this.isGravityOverridden||(i=Gs(o)),i||(i=Gs(n)),!this.isGravityOverridden&&!i){let t=o;for(;t&&!e.isInline(t)&&!i;)t=t.previousSibling,i=Gs(t)}if(!i){let t=n;for(;t&&!e.isInline(t)&&!i;)t=t.nextSibling,i=Gs(t)}i||(i=this._getStoredAttributes())}else{const t=this.getFirstRange();for(const o of t){if(o.item.is("element")&&e.isObject(o.item))break;if("text"==o.type){i=o.item.getAttributes();break}}}return i}_fixGraveyardSelection(t){const e=this._model.schema.getNearestSelectionRange(t);e&&this._pushRange(e)}}function Gs(t){return t instanceof _s||t instanceof ks?t.getAttributes():null}class Ys{constructor(t){this._dispatchers=t}add(t){for(const e of this._dispatchers)t(e);return this}}var Ks=function(t){return ti(t,5)};class Qs extends Ys{elementToElement(t){return this.add(function(t){return(t=Ks(t)).view=Xs(t.view,"container"),e=>{var i;if(e.on("insert:"+t.model,(i=t.view,(t,e,o)=>{const n=i(e.item,o);if(!n)return;if(!o.consumable.consume(e.item,"insert"))return;const r=o.mapper.toViewPosition(e.range.start);o.mapper.bindElements(e.item,n),o.writer.insert(r,n)}),{priority:t.converterPriority||"normal"}),t.triggerBy){if(t.triggerBy.attributes)for(const i of t.triggerBy.attributes)e._mapReconversionTriggerEvent(t.model,`attribute:${i}:${t.model}`);if(t.triggerBy.children)for(const i of t.triggerBy.children)e._mapReconversionTriggerEvent(t.model,"insert:"+i),e._mapReconversionTriggerEvent(t.model,"remove:"+i)}}}(t))}attributeToElement(t){return this.add(function(t){t=Ks(t);let e="attribute:"+(t.model.key?t.model.key:t.model);t.model.name&&(e+=":"+t.model.name);if(t.model.values)for(const e of t.model.values)t.view[e]=Xs(t.view[e],"attribute");else t.view=Xs(t.view,"attribute");const i=ta(t);return o=>{o.on(e,function(t){return(e,i,o)=>{const n=t(i.attributeOldValue,o),r=t(i.attributeNewValue,o);if(!n&&!r)return;if(!o.consumable.consume(i.item,e.name))return;const s=o.writer,a=s.document.selection;if(i.item instanceof Ds||i.item instanceof Ws)s.wrap(a.getFirstRange(),r);else{let t=o.mapper.toViewRange(i.range);null!==i.attributeOldValue&&n&&(t=s.unwrap(t,n)),null!==i.attributeNewValue&&r&&s.wrap(t,r)}}}(i),{priority:t.converterPriority||"normal"})}}(t))}attributeToAttribute(t){return this.add(function(t){t=Ks(t);let e="attribute:"+(t.model.key?t.model.key:t.model);t.model.name&&(e+=":"+t.model.name);if(t.model.values)for(const e of t.model.values)t.view[e]=ea(t.view[e]);else t.view=ea(t.view);const i=ta(t);return o=>{var n;o.on(e,(n=i,(t,e,i)=>{const o=n(e.attributeOldValue,i),r=n(e.attributeNewValue,i);if(!o&&!r)return;if(!i.consumable.consume(e.item,t.name))return;const s=i.mapper.toViewElement(e.item),a=i.writer;if(!s)throw new hi.a("conversion-attribute-to-attribute-on-text",[e,i]);if(null!==e.attributeOldValue&&o)if("class"==o.key){const t=Ti(o.value);for(const e of t)a.removeClass(e,s)}else if("style"==o.key){const t=Object.keys(o.value);for(const e of t)a.removeStyle(e,s)}else a.removeAttribute(o.key,s);if(null!==e.attributeNewValue&&r)if("class"==r.key){const t=Ti(r.value);for(const e of t)a.addClass(e,s)}else if("style"==r.key){const t=Object.keys(r.value);for(const e of t)a.setStyle(e,r.value[e],s)}else a.setAttribute(r.key,r.value,s)}),{priority:t.converterPriority||"normal"})}}(t))}markerToElement(t){return this.add(function(t){return(t=Ks(t)).view=Xs(t.view,"ui"),e=>{var i;e.on("addMarker:"+t.model,(i=t.view,(t,e,o)=>{e.isOpening=!0;const n=i(e,o);e.isOpening=!1;const r=i(e,o);if(!n||!r)return;const s=e.markerRange;if(s.isCollapsed&&!o.consumable.consume(s,t.name))return;for(const e of s)if(!o.consumable.consume(e.item,t.name))return;const a=o.mapper,l=o.writer;l.insert(a.toViewPosition(s.start),n),o.mapper.bindElementToMarker(n,e.markerName),s.isCollapsed||(l.insert(a.toViewPosition(s.end),r),o.mapper.bindElementToMarker(r,e.markerName)),t.stop()}),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,(t.view,(t,e,i)=>{const o=i.mapper.markerNameToElements(e.markerName);if(o){for(const t of o)i.mapper.unbindElementFromMarkerName(t,e.markerName),i.writer.clear(i.writer.createRangeOn(t),t);i.writer.clearClonedElementsGroup(e.markerName),t.stop()}}),{priority:t.converterPriority||"normal"})}}(t))}markerToHighlight(t){return this.add(function(t){return e=>{var i;e.on("addMarker:"+t.model,(i=t.view,(t,e,o)=>{if(!e.item)return;if(!(e.item instanceof Ds||e.item instanceof Ws||e.item.is("$textProxy")))return;const n=ia(i,e,o);if(!n)return;if(!o.consumable.consume(e.item,t.name))return;const r=o.writer,s=Js(r,n),a=r.document.selection;if(e.item instanceof Ds||e.item instanceof Ws)r.wrap(a.getFirstRange(),s,a);else{const t=o.mapper.toViewRange(e.range),i=r.wrap(t,s);for(const t of i.getItems())if(t.is("attributeElement")&&t.isSimilar(s)){o.mapper.bindElementToMarker(t,e.markerName);break}}}),{priority:t.converterPriority||"normal"}),e.on("addMarker:"+t.model,function(t){return(e,i,o)=>{if(!i.item)return;if(!(i.item instanceof ys))return;const n=ia(t,i,o);if(!n)return;if(!o.consumable.test(i.item,e.name))return;const r=o.mapper.toViewElement(i.item);if(r&&r.getCustomProperty("addHighlight")){o.consumable.consume(i.item,e.name);for(const t of Es._createIn(i.item))o.consumable.consume(t.item,e.name);r.getCustomProperty("addHighlight")(r,n,o.writer),o.mapper.bindElementToMarker(r,i.markerName)}}}(t.view),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,function(t){return(e,i,o)=>{if(i.markerRange.isCollapsed)return;const n=ia(t,i,o);if(!n)return;const r=Js(o.writer,n),s=o.mapper.markerNameToElements(i.markerName);if(s){for(const t of s)o.mapper.unbindElementFromMarkerName(t,i.markerName),t.is("attributeElement")?o.writer.unwrap(o.writer.createRangeOn(t),r):t.getCustomProperty("removeHighlight")(t,n.id,o.writer);o.writer.clearClonedElementsGroup(i.markerName),e.stop()}}}(t.view),{priority:t.converterPriority||"normal"})}}(t))}markerToData(t){return this.add(function(t){const e=(t=Ks(t)).model;t.view||(t.view=i=>({group:e,name:i.substr(t.model.length+1)}));return i=>{var o;i.on("addMarker:"+e,(o=t.view,(t,e,i)=>{const n=o(e.markerName,i);if(!n)return;const r=e.markerRange;i.consumable.consume(r,t.name)&&(Zs(r,!1,i,e,n),Zs(r,!0,i,e,n),t.stop())}),{priority:t.converterPriority||"normal"}),i.on("removeMarker:"+e,function(t){return(e,i,o)=>{const n=t(i.markerName,o);if(!n)return;const r=o.mapper.markerNameToElements(i.markerName);if(r){for(const t of r)o.mapper.unbindElementFromMarkerName(t,i.markerName),t.is("containerElement")?(s(`data-${n.group}-start-before`,t),s(`data-${n.group}-start-after`,t),s(`data-${n.group}-end-before`,t),s(`data-${n.group}-end-after`,t)):o.writer.clear(o.writer.createRangeOn(t),t);o.writer.clearClonedElementsGroup(i.markerName),e.stop()}function s(t,e){if(e.hasAttribute(t)){const i=new Set(e.getAttribute(t).split(","));i.delete(n.name),0==i.size?o.writer.removeAttribute(t,e):o.writer.setAttribute(t,Array.from(i).join(","),e)}}}}(t.view),{priority:t.converterPriority||"normal"})}}(t))}}function Js(t,e){const i=t.createAttributeElement("span",e.attributes);return e.classes&&i._addClass(e.classes),e.priority&&(i._priority=e.priority),i._id=e.id,i}function Zs(t,e,i,o,n){const r=e?t.start:t.end;if(i.schema.checkChild(r,"$text")){!function(t,e,i,o,n){const r=`${n.group}-${e?"start":"end"}`,s=n.name?{name:n.name}:null,a=i.writer.createUIElement(r,s);i.writer.insert(t,a),i.mapper.bindElementToMarker(a,o.markerName)}(i.mapper.toViewPosition(r),e,i,o,n)}else{let t,s;e&&r.nodeAfter||!e&&!r.nodeBefore?(t=r.nodeAfter,s=!0):(t=r.nodeBefore,s=!1);!function(t,e,i,o,n,r){const s=`data-${r.group}-${e?"start":"end"}-${i?"before":"after"}`,a=t.hasAttribute(s)?t.getAttribute(s).split(","):[];a.unshift(r.name),o.writer.setAttribute(s,a.join(","),t),o.mapper.bindElementToMarker(t,n.markerName)}(i.mapper.toViewElement(t),e,s,i,o,n)}}function Xs(t,e){return"function"==typeof t?t:(i,o)=>function(t,e,i){"string"==typeof t&&(t={name:t});let o;const n=e.writer,r=Object.assign({},t.attributes);if("container"==i)o=n.createContainerElement(t.name,r);else if("attribute"==i){const e={priority:t.priority||an.DEFAULT_PRIORITY};o=n.createAttributeElement(t.name,r,e)}else o=n.createUIElement(t.name,r);if(t.styles){const e=Object.keys(t.styles);for(const i of e)n.setStyle(i,t.styles[i],o)}if(t.classes){const e=t.classes;if("string"==typeof e)n.addClass(e,o);else for(const t of e)n.addClass(t,o)}return o}(t,o,e)}function ta(t){return t.model.values?(e,i)=>{const o=t.view[e];return o?o(e,i):null}:t.view}function ea(t){return"string"==typeof t?e=>({key:t,value:e}):"object"==typeof t?t.value?()=>t:e=>({key:t.key,value:e}):t}function ia(t,e,i){const o="function"==typeof t?t(e,i):t;return o?(o.priority||(o.priority=10),o.id||(o.id=e.markerName),o):null}function oa(t){const{schema:e,document:i}=t.model;for(const o of i.getRootNames()){const n=i.getRoot(o);if(n.isEmpty&&!e.checkChild(n,"$text")&&e.checkChild(n,"paragraph"))return t.insertElement("paragraph",n),!0}return!1}function na(t,e,i){const o=i.createContext(t);return!!i.checkChild(o,"paragraph")&&!!i.checkChild(o.push("paragraph"),e)}function ra(t,e){const i=e.createElement("paragraph");return e.insert(i,t),e.createPositionAt(i,0)}class sa extends Ys{elementToElement(t){return this.add(aa(t))}elementToAttribute(t){return this.add(function(t){da(t=Ks(t));const e=ha(t,!1),i=la(t.view),o=i?"element:"+i:"element";return i=>{i.on(o,e,{priority:t.converterPriority||"low"})}}(t))}attributeToAttribute(t){return this.add(function(t){t=Ks(t);let e=null;("string"==typeof t.view||t.view.key)&&(e=function(t){"string"==typeof t.view&&(t.view={key:t.view});const e=t.view.key;let i;if("class"==e||"style"==e){i={["class"==e?"classes":"styles"]:t.view.value}}else{const o=void 0===t.view.value?/[\s\S]*/:t.view.value;i={attributes:{[e]:o}}}t.view.name&&(i.name=t.view.name);return t.view=i,e}(t));da(t,e);const i=ha(t,!0);return e=>{e.on("element",i,{priority:t.converterPriority||"low"})}}(t))}elementToMarker(t){return Object(hi.c)("upcast-helpers-element-to-marker-deprecated"),this.add(function(t){return function(t){const e=t.model;t.model=(t,i)=>{const o="string"==typeof e?e:e(t,i);return i.writer.createElement("$marker",{"data-name":o})}}(t=Ks(t)),aa(t)}(t))}dataToMarker(t){return this.add(function(t){(t=Ks(t)).model||(t.model=e=>e?t.view+":"+e:t.view);const e=ca(ua(t,"start")),i=ca(ua(t,"end"));return o=>{o.on("element:"+t.view+"-start",e,{priority:t.converterPriority||"normal"}),o.on("element:"+t.view+"-end",i,{priority:t.converterPriority||"normal"});const n=di.get("low"),r=di.get("highest"),s=di.get(t.converterPriority)/r;o.on("element",function(t){return(e,i,o)=>{const n="data-"+t.view;function r(e,n){for(const r of n){const n=t.model(r,o),s=o.writer.createElement("$marker",{"data-name":n});o.writer.insert(s,e),i.modelCursor.isEqual(e)?i.modelCursor=i.modelCursor.getShiftedBy(1):i.modelCursor=i.modelCursor._getTransformedByInsertion(e,1),i.modelRange=i.modelRange._getTransformedByInsertion(e,1)[0]}}i.modelRange||(i=Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor))),o.consumable.consume(i.viewItem,{attributes:n+"-end-after"})&&r(i.modelRange.end,i.viewItem.getAttribute(n+"-end-after").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-start-after"})&&r(i.modelRange.end,i.viewItem.getAttribute(n+"-start-after").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-end-before"})&&r(i.modelRange.start,i.viewItem.getAttribute(n+"-end-before").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-start-before"})&&r(i.modelRange.start,i.viewItem.getAttribute(n+"-start-before").split(","))}}(t),{priority:n+s})}}(t))}}function aa(t){const e=ca(t=Ks(t)),i=la(t.view),o=i?"element:"+i:"element";return i=>{i.on(o,e,{priority:t.converterPriority||"normal"})}}function la(t){return"string"==typeof t?t:"object"==typeof t&&"string"==typeof t.name?t.name:null}function ca(t){const e=new Di(t.view);return(i,o,n)=>{const r=e.match(o.viewItem);if(!r)return;const s=r.match;if(s.name=!0,!n.consumable.test(o.viewItem,s))return;const a=function(t,e,i){return t instanceof Function?t(e,i):i.writer.createElement(t)}(t.model,o.viewItem,n);a&&n.safeInsert(a,o.modelCursor)&&(n.consumable.consume(o.viewItem,s),n.convertChildren(o.viewItem,a),n.updateConversionResult(a,o))}}function da(t,e=null){const i=null===e||(t=>t.getAttribute(e)),o="object"!=typeof t.model?t.model:t.model.key,n="object"!=typeof t.model||void 0===t.model.value?i:t.model.value;t.model={key:o,value:n}}function ha(t,e){const i=new Di(t.view);return(o,n,r)=>{const s=i.match(n.viewItem);if(!s)return;const a=t.model.key,l="function"==typeof t.model.value?t.model.value(n.viewItem,r):t.model.value;if(null===l)return;if(!function(t,e){const i="function"==typeof t?t(e):t;if("object"==typeof i&&!la(i))return!1;return!i.classes&&!i.attributes&&!i.styles}(t.view,n.viewItem)?delete s.match.name:s.match.name=!0,!r.consumable.test(n.viewItem,s.match))return;n.modelRange||(n=Object.assign(n,r.convertChildren(n.viewItem,n.modelCursor)));(function(t,e,i,o){let n=!1;for(const r of Array.from(t.getItems({shallow:i})))o.schema.checkAttribute(r,e.key)&&(o.writer.setAttribute(e.key,e.value,r),n=!0);return n})(n.modelRange,{key:a,value:l},e,r)&&r.consumable.consume(n.viewItem,s.match)}}function ua(t,e){const i={};return i.view=t.view+"-"+e,i.model=(e,i)=>{const o=e.getAttribute("name"),n=t.model(o,i);return i.writer.createElement("$marker",{"data-name":n})},i}class ga{constructor(t,e){this.model=t,this.view=new bs(e),this.mapper=new Ms,this.downcastDispatcher=new Ns({mapper:this.mapper,schema:t.schema});const i=this.model.document,o=i.selection,n=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(i,"change",()=>{this.view.change(t=>{this.downcastDispatcher.convertChanges(i.differ,n,t),this.downcastDispatcher.convertSelection(o,n,t)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(t,e){return(i,o)=>{const n=o.newSelection,r=[];for(const t of n.getRanges())r.push(e.toModelRange(t));const s=t.createSelection(r,{backward:n.isBackward});s.isEqual(t.document.selection)||t.change(t=>{t.setSelection(s)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(t,e,i)=>{if(!i.consumable.consume(e.item,"insert"))return;const o=i.writer,n=i.mapper.toViewPosition(e.range.start),r=o.createText(e.item.data);o.insert(n,r)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(t,e,i)=>{const o=i.mapper.toViewPosition(e.position),n=e.position.getShiftedBy(e.length),r=i.mapper.toViewPosition(n,{isPhantom:!0}),s=i.writer.createRange(o,r),a=i.writer.remove(s.getTrimmed());for(const t of i.writer.createRangeIn(a).getItems())i.mapper.unbindViewElement(t)},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,i)=>{const o=i.writer,n=o.document.selection;for(const t of n.getRanges())t.isCollapsed&&t.end.parent.isAttached()&&i.writer.mergeAttributes(t.start);o.setSelection(null)},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,i)=>{const o=e.selection;if(o.isCollapsed)return;if(!i.consumable.consume(o,"selection"))return;const n=[];for(const t of o.getRanges()){const e=i.mapper.toViewRange(t);n.push(e)}i.writer.setSelection(n,{backward:o.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,i)=>{const o=e.selection;if(!o.isCollapsed)return;if(!i.consumable.consume(o,"selection"))return;const n=i.writer,r=o.getFirstPosition(),s=i.mapper.toViewPosition(r),a=n.breakAttributes(s);n.setSelection(a)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(t=>{if("$graveyard"==t.rootName)return null;const e=new Jo(this.view.document,t.name);return e.rootName=t.rootName,this.mapper.bindElements(t,e),e})}destroy(){this.view.destroy(),this.stopListening()}}yi(ga,Uo);class ma{constructor(){this._commands=new Map}add(t,e){this._commands.set(t,e)}get(t){return this._commands.get(t)}execute(t,...e){const i=this.get(t);if(!i)throw new hi.a("commandcollection-command-not-found",this,{commandName:t});return i.execute(...e)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const t of this.commands())t.destroy()}}class fa{constructor(){this._consumables=new Map}add(t,e){let i;t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):(this._consumables.has(t)?i=this._consumables.get(t):(i=new pa(t),this._consumables.set(t,i)),i.add(e))}test(t,e){const i=this._consumables.get(t);return void 0===i?null:t.is("$text")||t.is("documentFragment")?i:i.test(e)}consume(t,e){return!!this.test(t,e)&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!1):this._consumables.get(t).consume(e),!0)}revert(t,e){const i=this._consumables.get(t);void 0!==i&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):i.revert(e))}static consumablesFromElement(t){const e={element:t,name:!0,attributes:[],classes:[],styles:[]},i=t.getAttributeKeys();for(const t of i)"style"!=t&&"class"!=t&&e.attributes.push(t);const o=t.getClassNames();for(const t of o)e.classes.push(t);const n=t.getStyleNames();for(const t of n)e.styles.push(t);return e}static createFrom(t,e){if(e||(e=new fa(t)),t.is("$text"))return e.add(t),e;t.is("element")&&e.add(t,fa.consumablesFromElement(t)),t.is("documentFragment")&&e.add(t);for(const i of t.getChildren())e=fa.createFrom(i,e);return e}}class pa{constructor(t){this.element=t,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._add(e,t[e])}test(t){if(t.name&&!this._canConsumeName)return this._canConsumeName;for(const e in this._consumables)if(e in t){const i=this._test(e,t[e]);if(!0!==i)return i}return!0}consume(t){t.name&&(this._canConsumeName=!1);for(const e in this._consumables)e in t&&this._consume(e,t[e])}revert(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._revert(e,t[e])}_add(t,e){const i=Ot(e)?e:[e],o=this._consumables[t];for(const e of i){if("attributes"===t&&("class"===e||"style"===e))throw new hi.a("viewconsumable-invalid-attribute",this);if(o.set(e,!0),"styles"===t)for(const t of this.element.document.stylesProcessor.getRelatedStyles(e))o.set(t,!0)}}_test(t,e){const i=Ot(e)?e:[e],o=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){const t=o.get(e);if(void 0===t)return null;if(!t)return!1}else{const t="class"==e?"classes":"styles",i=this._test(t,[...this._consumables[t].keys()]);if(!0!==i)return i}return!0}_consume(t,e){const i=Ot(e)?e:[e],o=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){if(o.set(e,!1),"styles"==t)for(const t of this.element.document.stylesProcessor.getRelatedStyles(e))o.set(t,!1)}else{const t="class"==e?"classes":"styles";this._consume(t,[...this._consumables[t].keys()])}}_revert(t,e){const i=Ot(e)?e:[e],o=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){!1===o.get(e)&&o.set(e,!0)}else{const t="class"==e?"classes":"styles";this._revert(t,[...this._consumables[t].keys()])}}}class ba{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(t,e)=>{e[0]=new wa(e[0])},{priority:"highest"}),this.on("checkChild",(t,e)=>{e[0]=new wa(e[0]),e[1]=this.getDefinition(e[1])},{priority:"highest"})}register(t,e){if(this._sourceDefinitions[t])throw new hi.a("schema-cannot-register-item-twice",this,{itemName:t});this._sourceDefinitions[t]=[Object.assign({},e)],this._clearCache()}extend(t,e){if(!this._sourceDefinitions[t])throw new hi.a("schema-cannot-extend-missing-item",this,{itemName:t});this._sourceDefinitions[t].push(Object.assign({},e)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(t){let e;return e="string"==typeof t?t:t.is&&(t.is("$text")||t.is("$textProxy"))?"$text":t.name,this.getDefinitions()[e]}isRegistered(t){return!!this.getDefinition(t)}isBlock(t){const e=this.getDefinition(t);return!(!e||!e.isBlock)}isLimit(t){const e=this.getDefinition(t);return!!e&&!(!e.isLimit&&!e.isObject)}isObject(t){const e=this.getDefinition(t);return!!e&&!!(e.isObject||e.isLimit&&e.isSelectable&&e.isContent)}isInline(t){const e=this.getDefinition(t);return!(!e||!e.isInline)}isSelectable(t){const e=this.getDefinition(t);return!!e&&!(!e.isSelectable&&!e.isObject)}isContent(t){const e=this.getDefinition(t);return!!e&&!(!e.isContent&&!e.isObject)}checkChild(t,e){return!!e&&this._checkContextMatch(e,t)}checkAttribute(t,e){const i=this.getDefinition(t.last);return!!i&&i.allowAttributes.includes(e)}checkMerge(t,e=null){if(t instanceof Ts){const e=t.nodeBefore,i=t.nodeAfter;if(!(e instanceof ys))throw new hi.a("schema-check-merge-no-element-before",this);if(!(i instanceof ys))throw new hi.a("schema-check-merge-no-element-after",this);return this.checkMerge(e,i)}for(const i of e.getChildren())if(!this.checkChild(t,i))return!1;return!0}addChildCheck(t){this.on("checkChild",(e,[i,o])=>{if(!o)return;const n=t(i,o);"boolean"==typeof n&&(e.stop(),e.return=n)},{priority:"high"})}addAttributeCheck(t){this.on("checkAttribute",(e,[i,o])=>{const n=t(i,o);"boolean"==typeof n&&(e.stop(),e.return=n)},{priority:"high"})}setAttributeProperties(t,e){this._attributeProperties[t]=Object.assign(this.getAttributeProperties(t),e)}getAttributeProperties(t){return this._attributeProperties[t]||{}}getLimitElement(t){let e;if(t instanceof Ts)e=t.parent;else{e=(t instanceof Es?[t]:Array.from(t.getRanges())).reduce((t,e)=>{const i=e.getCommonAncestor();return t?t.getCommonAncestor(i,{includeSelf:!0}):i},null)}for(;!this.isLimit(e)&&e.parent;)e=e.parent;return e}checkAttributeInSelection(t,e){if(t.isCollapsed){const i=[...t.getFirstPosition().getAncestors(),new ks("",t.getAttributes())];return this.checkAttribute(i,e)}{const i=t.getRanges();for(const t of i)for(const i of t)if(this.checkAttribute(i.item,e))return!0}return!1}*getValidRanges(t,e){t=function*(t){for(const e of t)yield*e.getMinimalFlatRanges()}(t);for(const i of t)yield*this._getValidRangesForRange(i,e)}getNearestSelectionRange(t,e="both"){if(this.checkChild(t,"$text"))return new Es(t);let i,o;const n=t.getAncestors().reverse().find(t=>this.isLimit(t))||t.root;"both"!=e&&"backward"!=e||(i=new xs({boundaries:Es._createIn(n),startPosition:t,direction:"backward"})),"both"!=e&&"forward"!=e||(o=new xs({boundaries:Es._createIn(n),startPosition:t}));for(const t of function*(t,e){let i=!1;for(;!i;){if(i=!0,t){const e=t.next();e.done||(i=!1,yield{walker:t,value:e.value})}if(e){const t=e.next();t.done||(i=!1,yield{walker:e,value:t.value})}}}(i,o)){const e=t.walker==i?"elementEnd":"elementStart",o=t.value;if(o.type==e&&this.isObject(o.item))return Es._createOn(o.item);if(this.checkChild(o.nextPosition,"$text"))return new Es(o.nextPosition)}return null}findAllowedParent(t,e){let i=t.parent;for(;i;){if(this.checkChild(i,e))return i;if(this.isLimit(i))return null;i=i.parent}return null}removeDisallowedAttributes(t,e){for(const i of t)if(i.is("$text"))Ea(this,i,e);else{const t=Es._createIn(i).getPositions();for(const i of t){Ea(this,i.nodeBefore||i.parent,e)}}}createContext(t){return new wa(t)}_clearCache(){this._compiledDefinitions=null}_compile(){const t={},e=this._sourceDefinitions,i=Object.keys(e);for(const o of i)t[o]=ka(e[o],o);for(const e of i)_a(t,e);for(const e of i)va(t,e);for(const e of i)ya(t,e),xa(t,e);for(const e of i)Aa(t,e),Ta(t,e);this._compiledDefinitions=t}_checkContextMatch(t,e,i=e.length-1){const o=e.getItem(i);if(t.allowIn.includes(o.name)){if(0==i)return!0;{const t=this.getDefinition(o);return this._checkContextMatch(t,e,i-1)}}return!1}*_getValidRangesForRange(t,e){let i=t.start,o=t.start;for(const n of t.getItems({shallow:!0}))n.is("element")&&(yield*this._getValidRangesForRange(Es._createIn(n),e)),this.checkAttribute(n,e)||(i.isEqual(o)||(yield new Es(i,o)),i=Ts._createAfter(n)),o=Ts._createAfter(n);i.isEqual(o)||(yield new Es(i,o))}}yi(ba,Uo);class wa{constructor(t){if(t instanceof wa)return t;"string"==typeof t?t=[t]:Array.isArray(t)||(t=t.getAncestors({includeSelf:!0})),t[0]&&"string"!=typeof t[0]&&t[0].is("documentFragment")&&t.shift(),this._items=t.map(Pa)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(t){const e=new wa([t]);return e._items=[...this._items,...e._items],e}getItem(t){return this._items[t]}*getNames(){yield*this._items.map(t=>t.name)}endsWith(t){return Array.from(this.getNames()).join(" ").endsWith(t)}startsWith(t){return Array.from(this.getNames()).join(" ").startsWith(t)}}function ka(t,e){const i={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return function(t,e){for(const i of t){const t=Object.keys(i).filter(t=>t.startsWith("is"));for(const o of t)e[o]=i[o]}}(t,i),Ca(t,i,"allowIn"),Ca(t,i,"allowContentOf"),Ca(t,i,"allowWhere"),Ca(t,i,"allowAttributes"),Ca(t,i,"allowAttributesOf"),Ca(t,i,"inheritTypesFrom"),function(t,e){for(const i of t){const t=i.inheritAllFrom;t&&(e.allowContentOf.push(t),e.allowWhere.push(t),e.allowAttributesOf.push(t),e.inheritTypesFrom.push(t))}}(t,i),i}function _a(t,e){for(const i of t[e].allowContentOf)if(t[i]){Sa(t,i).forEach(t=>{t.allowIn.push(e)})}delete t[e].allowContentOf}function va(t,e){for(const i of t[e].allowWhere){const o=t[i];if(o){const i=o.allowIn;t[e].allowIn.push(...i)}}delete t[e].allowWhere}function ya(t,e){for(const i of t[e].allowAttributesOf){const o=t[i];if(o){const i=o.allowAttributes;t[e].allowAttributes.push(...i)}}delete t[e].allowAttributesOf}function xa(t,e){const i=t[e];for(const e of i.inheritTypesFrom){const o=t[e];if(o){const t=Object.keys(o).filter(t=>t.startsWith("is"));for(const e of t)e in i||(i[e]=o[e])}}delete i.inheritTypesFrom}function Aa(t,e){const i=t[e],o=i.allowIn.filter(e=>t[e]);i.allowIn=Array.from(new Set(o))}function Ta(t,e){const i=t[e];i.allowAttributes=Array.from(new Set(i.allowAttributes))}function Ca(t,e,i){for(const o of t)"string"==typeof o[i]?e[i].push(o[i]):Array.isArray(o[i])&&e[i].push(...o[i])}function Sa(t,e){const i=t[e];return(o=t,Object.keys(o).map(t=>o[t])).filter(t=>t.allowIn.includes(i.name));var o}function Pa(t){return"string"==typeof t?{name:t,*getAttributeKeys(){},getAttribute(){}}:{name:t.is("element")?t.name:"$text",*getAttributeKeys(){yield*t.getAttributeKeys()},getAttribute:e=>t.getAttribute(e)}}function Ea(t,e,i){for(const o of e.getAttributeKeys())t.checkAttribute(e,o)||i.removeAttribute(o,e)}class Ma{constructor(t={}){this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},t),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.safeInsert=this._safeInsert.bind(this),this.conversionApi.updateConversionResult=this._updateConversionResult.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}convert(t,e,i=["$root"]){this.fire("viewCleanup",t),this._modelCursor=function(t,e){let i;for(const o of new wa(t)){const t={};for(const e of o.getAttributeKeys())t[e]=o.getAttribute(e);const n=e.createElement(o.name,t);i&&e.append(n,i),i=Ts._createAt(n,0)}return i}(i,e),this.conversionApi.writer=e,this.conversionApi.consumable=fa.createFrom(t),this.conversionApi.store={};const{modelRange:o}=this._convertItem(t,this._modelCursor),n=e.createDocumentFragment();if(o){this._removeEmptyElements();for(const t of Array.from(this._modelCursor.parent.getChildren()))e.append(t,n);n.markers=function(t,e){const i=new Set,o=new Map,n=Es._createIn(t).getItems();for(const t of n)"$marker"==t.name&&i.add(t);for(const t of i){const i=t.getAttribute("data-name"),n=e.createPositionBefore(t);o.has(i)?o.get(i).end=n.clone():o.set(i,new Es(n.clone())),e.remove(t)}return o}(n,e)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,n}_convertItem(t,e){const i=Object.assign({viewItem:t,modelCursor:e,modelRange:null});if(t.is("element")?this.fire("element:"+t.name,i,this.conversionApi):t.is("$text")?this.fire("text",i,this.conversionApi):this.fire("documentFragment",i,this.conversionApi),i.modelRange&&!(i.modelRange instanceof Es))throw new hi.a("view-conversion-dispatcher-incorrect-result",this);return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(t,e){let i=e.is("position")?e:Ts._createAt(e,0);const o=new Es(i);for(const e of Array.from(t.getChildren())){const t=this._convertItem(e,i);t.modelRange instanceof Es&&(o.end=t.modelRange.end,i=t.modelCursor)}return{modelRange:o,modelCursor:i}}_safeInsert(t,e){const i=this._splitToAllowedParent(t,e);return!!i&&(this.conversionApi.writer.insert(t,i.position),!0)}_updateConversionResult(t,e){const i=this._getSplitParts(t),o=this.conversionApi.writer;e.modelRange||(e.modelRange=o.createRange(o.createPositionBefore(t),o.createPositionAfter(i[i.length-1])));const n=this._cursorParents.get(t);e.modelCursor=n?o.createPositionAt(n,0):e.modelRange.end}_splitToAllowedParent(t,e){const{schema:i,writer:o}=this.conversionApi;let n=i.findAllowedParent(e,t);if(n){if(n===e.parent)return{position:e};this._modelCursor.parent.getAncestors().includes(n)&&(n=null)}if(!n)return na(e,t,i)?{position:ra(e,o)}:null;const r=this.conversionApi.writer.split(e,n),s=[];for(const t of r.range.getWalker())if("elementEnd"==t.type)s.push(t.item);else{const e=s.pop(),i=t.item;this._registerSplitPair(e,i)}const a=r.range.end.parent;return this._cursorParents.set(t,a),{position:r.position,cursorParent:a}}_registerSplitPair(t,e){this._splitParts.has(t)||this._splitParts.set(t,[t]);const i=this._splitParts.get(t);this._splitParts.set(e,i),i.push(e)}_getSplitParts(t){let e;return e=this._splitParts.has(t)?this._splitParts.get(t):[t],e}_removeEmptyElements(){let t=!1;for(const e of this._splitParts.keys())e.isEmpty&&(this.conversionApi.writer.remove(e),this._splitParts.delete(e),t=!0);t&&this._removeEmptyElements()}}yi(Ma,mi);class La{constructor(t,e){this.model=t,this.stylesProcessor=e,this.processor=void 0,this.mapper=new Ms,this.downcastDispatcher=new Ns({mapper:this.mapper,schema:t.schema}),this.downcastDispatcher.on("insert:$text",(t,e,i)=>{if(!i.consumable.consume(e.item,"insert"))return;const o=i.writer,n=i.mapper.toViewPosition(e.range.start),r=o.createText(e.item.data);o.insert(n,r)},{priority:"lowest"}),this.upcastDispatcher=new Ma({schema:t.schema}),this.viewDocument=new sn(e),this._viewWriter=new Mn(this.viewDocument),this.upcastDispatcher.on("text",(t,e,{schema:i,consumable:o,writer:n})=>{let r=e.modelCursor;if(!o.test(e.viewItem))return;if(!i.checkChild(r,"$text")){if(!na(r,"$text",i))return;r=ra(r,n)}o.consume(e.viewItem);const s=n.createText(e.viewItem.data);n.insert(s,r),e.modelRange=n.createRange(r,r.getShiftedBy(s.offsetSize)),e.modelCursor=e.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(t,e,i)=>{if(!e.modelRange&&i.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:o}=i.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=o}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(t,e,i)=>{if(!e.modelRange&&i.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:o}=i.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=o}},{priority:"lowest"}),this.decorate("init"),this.decorate("set"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange("transparent",oa)},{priority:"lowest"})}get(t={}){const{rootName:e="main",trim:i="empty"}=t;if(!this._checkIfRootsExists([e]))throw new hi.a("datacontroller-get-non-existent-root",this);const o=this.model.document.getRoot(e);return"empty"!==i||this.model.hasContent(o,{ignoreWhitespaces:!0})?this.stringify(o,t):""}stringify(t,e){const i=this.toView(t,e);return this.processor.toData(i)}toView(t,e){const i=this.viewDocument,o=this._viewWriter;this.mapper.clearBindings();const n=Es._createIn(t),r=new En(i);if(this.mapper.bindElements(t,r),this.downcastDispatcher.conversionApi.options=e,this.downcastDispatcher.convertInsert(n,o),!t.is("documentFragment")){const e=function(t){const e=[],i=t.root.document;if(!i)return[];const o=Es._createIn(t);for(const t of i.model.markers){const i=o.getIntersection(t.getRange());i&&e.push([t.name,i])}return e}(t);for(const[t,i]of e)this.downcastDispatcher.convertMarkerAdd(t,i,o)}return delete this.downcastDispatcher.conversionApi.options,r}init(t){if(this.model.document.version)throw new hi.a("datacontroller-init-document-not-empty",this);let e={};if("string"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new hi.a("datacontroller-init-non-existent-root",this);return this.model.enqueueChange("transparent",t=>{for(const i of Object.keys(e)){const o=this.model.document.getRoot(i);t.insert(this.parse(e[i],o),o,0)}}),Promise.resolve()}set(t){let e={};if("string"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new hi.a("datacontroller-set-non-existent-root",this);this.model.enqueueChange("transparent",t=>{t.setSelection(null),t.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const i of Object.keys(e)){const o=this.model.document.getRoot(i);t.remove(t.createRangeIn(o)),t.insert(this.parse(e[i],o),o,0)}})}parse(t,e="$root"){const i=this.processor.toView(t);return this.toModel(i,e)}toModel(t,e="$root"){return this.model.change(i=>this.upcastDispatcher.convert(t,i,e))}addStyleProcessorRules(t){t(this.stylesProcessor)}destroy(){this.stopListening()}_checkIfRootsExists(t){for(const e of t)if(!this.model.document.getRootNames().includes(e))return!1;return!0}}yi(La,Uo);class Ia{constructor(t,e){this._helpers=new Map,this._downcast=Ti(t),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Ti(e),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(t,e){const i=this._downcast.includes(e);if(!this._upcast.includes(e)&&!i)throw new hi.a("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:t,dispatchers:[e],isDowncast:i})}for(t){if(!this._helpers.has(t))throw new hi.a("conversion-for-unknown-group",this);return this._helpers.get(t)}elementToElement(t){this.for("downcast").elementToElement(t);for(const{model:e,view:i}of Na(t))this.for("upcast").elementToElement({model:e,view:i,converterPriority:t.converterPriority})}attributeToElement(t){this.for("downcast").attributeToElement(t);for(const{model:e,view:i}of Na(t))this.for("upcast").elementToAttribute({view:i,model:e,converterPriority:t.converterPriority})}attributeToAttribute(t){this.for("downcast").attributeToAttribute(t);for(const{model:e,view:i}of Na(t))this.for("upcast").attributeToAttribute({view:i,model:e})}_createConversionHelpers({name:t,dispatchers:e,isDowncast:i}){if(this._helpers.has(t))throw new hi.a("conversion-group-exists",this);const o=i?new Qs(e):new sa(e);this._helpers.set(t,o)}}function*Na(t){if(t.model.values)for(const e of t.model.values){const i={key:t.model.key,value:e},o=t.view[e],n=t.upcastAlso?t.upcastAlso[e]:void 0;yield*za(i,o,n)}else yield*za(t.model,t.view,t.upcastAlso)}function*za(t,e,i){if(yield{model:t,view:e},i)for(const e of Ti(i))yield{model:t,view:e}}class Oa{constructor(t="default"){this.operations=[],this.type=t}get baseVersion(){for(const t of this.operations)if(null!==t.baseVersion)return t.baseVersion;return null}addOperation(t){return t.batch=this,this.operations.push(t),t}}class Ra{constructor(t){this.baseVersion=t,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const t=Object.assign({},this);return t.__className=this.constructor.className,delete t.batch,delete t.isDocumentOperation,t}static get className(){return"Operation"}static fromJSON(t){return new this(t.baseVersion)}}class Da{constructor(t){this.markers=new Map,this._children=new vs,t&&this._insertChild(0,t)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"===t||"model:documentFragment"===t}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}getPath(){return[]}getNodeByPath(t){let e=this;for(const i of t)e=e.getChild(e.offsetToIndex(i));return e}offsetToIndex(t){return this._children.offsetToIndex(t)}toJSON(){const t=[];for(const e of this._children)t.push(e.toJSON());return t}static fromJSON(t){const e=[];for(const i of t)i.name?e.push(ys.fromJSON(i)):e.push(ks.fromJSON(i));return new Da(e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const i=function(t){if("string"==typeof t)return[new ks(t)];vi(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new ks(t):t instanceof _s?new ks(t.data,t.getAttributes()):t)}(e);for(const t of i)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,i)}_removeChildren(t,e=1){const i=this._children._removeNodes(t,e);for(const t of i)t.parent=null;return i}}function Va(t,e){const i=(e=Fa(e)).reduce((t,e)=>t+e.offsetSize,0),o=t.parent;Ua(t);const n=t.index;return o._insertChild(n,e),Ha(o,n+e.length),Ha(o,n),new Es(t,t.getShiftedBy(i))}function ja(t){if(!t.isFlat)throw new hi.a("operation-utils-remove-range-not-flat",this);const e=t.start.parent;Ua(t.start),Ua(t.end);const i=e._removeChildren(t.start.index,t.end.index-t.start.index);return Ha(e,t.start.index),i}function Ba(t,e){if(!t.isFlat)throw new hi.a("operation-utils-move-range-not-flat",this);const i=ja(t);return Va(e=e._getTransformedByDeletion(t.start,t.end.offset-t.start.offset),i)}function Fa(t){const e=[];t instanceof Array||(t=[t]);for(let i=0;it.maxOffset)throw new hi.a("move-operation-nodes-do-not-exist",this);if(t===e&&i=i&&this.targetPosition.path[t]t._clone(!0))),e=new Ka(this.position,t,this.baseVersion);return e.shouldReceiveAttributes=this.shouldReceiveAttributes,e}getReversed(){const t=this.position.root.document.graveyard,e=new Ts(t,[0]);return new Ya(this.position,this.nodes.maxOffset,e,this.baseVersion+1)}_validate(){const t=this.position.parent;if(!t||t.maxOffsett._clone(!0))),Va(this.position,t)}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t.nodes=this.nodes.toJSON(),t}static get className(){return"InsertOperation"}static fromJSON(t,e){const i=[];for(const e of t.nodes)e.name?i.push(ys.fromJSON(e)):i.push(ks.fromJSON(e));const o=new Ka(Ts.fromJSON(t.position,e),i,t.baseVersion);return o.shouldReceiveAttributes=t.shouldReceiveAttributes,o}}class Qa extends Ra{constructor(t,e,i,o,n,r){super(r),this.name=t,this.oldRange=e?e.clone():null,this.newRange=i?i.clone():null,this.affectsData=n,this._markers=o}get type(){return"marker"}clone(){return new Qa(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new Qa(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const t=this.newRange?"_set":"_remove";this._markers[t](this.name,this.newRange,!0,this.affectsData)}toJSON(){const t=super.toJSON();return this.oldRange&&(t.oldRange=this.oldRange.toJSON()),this.newRange&&(t.newRange=this.newRange.toJSON()),delete t._markers,t}static get className(){return"MarkerOperation"}static fromJSON(t,e){return new Qa(t.name,t.oldRange?Es.fromJSON(t.oldRange,e):null,t.newRange?Es.fromJSON(t.newRange,e):null,e.model.markers,t.affectsData,t.baseVersion)}}class Ja extends Ra{constructor(t,e,i,o){super(o),this.position=t,this.position.stickiness="toNext",this.oldName=e,this.newName=i}get type(){return"rename"}clone(){return new Ja(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new Ja(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const t=this.position.nodeAfter;if(!(t instanceof ys))throw new hi.a("rename-operation-wrong-position",this);if(t.name!==this.oldName)throw new hi.a("rename-operation-wrong-name",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t}static get className(){return"RenameOperation"}static fromJSON(t,e){return new Ja(Ts.fromJSON(t.position,e),t.oldName,t.newName,t.baseVersion)}}class Za extends Ra{constructor(t,e,i,o,n){super(n),this.root=t,this.key=e,this.oldValue=i,this.newValue=o}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new Za(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Za(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new hi.a("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 hi.a("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 hi.a("rootattribute-operation-attribute-exists",this,{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const t=super.toJSON();return t.root=this.root.toJSON(),t}static get className(){return"RootAttributeOperation"}static fromJSON(t,e){if(!e.getRoot(t.root))throw new hi.a("rootattribute-operation-fromjson-no-root",this,{rootName:t.root});return new Za(e.getRoot(t.root),t.key,t.oldValue,t.newValue,t.baseVersion)}}class Xa extends Ra{constructor(t,e,i,o,n){super(n),this.sourcePosition=t.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=e,this.targetPosition=i.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=o.clone()}get type(){return"merge"}get deletionPosition(){return new Ts(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const t=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Es(this.sourcePosition,t)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.targetPosition._getTransformedByMergeOperation(this),e=this.sourcePosition.path.slice(0,-1),i=new Ts(this.sourcePosition.root,e)._getTransformedByMergeOperation(this),o=new tl(t,this.howMany,this.graveyardPosition,this.baseVersion+1);return o.insertionPosition=i,o}_validate(){const t=this.sourcePosition.parent,e=this.targetPosition.parent;if(!t.parent)throw new hi.a("merge-operation-source-position-invalid",this);if(!e.parent)throw new hi.a("merge-operation-target-position-invalid",this);if(this.howMany!=t.maxOffset)throw new hi.a("merge-operation-how-many-invalid",this)}_execute(){const t=this.sourcePosition.parent;Ba(Es._createIn(t),this.targetPosition),Ba(Es._createOn(t),this.graveyardPosition)}toJSON(){const t=super.toJSON();return t.sourcePosition=t.sourcePosition.toJSON(),t.targetPosition=t.targetPosition.toJSON(),t.graveyardPosition=t.graveyardPosition.toJSON(),t}static get className(){return"MergeOperation"}static fromJSON(t,e){const i=Ts.fromJSON(t.sourcePosition,e),o=Ts.fromJSON(t.targetPosition,e),n=Ts.fromJSON(t.graveyardPosition,e);return new this(i,t.howMany,o,n,t.baseVersion)}}class tl extends Ra{constructor(t,e,i,o){super(o),this.splitPosition=t.clone(),this.splitPosition.stickiness="toNext",this.howMany=e,this.insertionPosition=tl.getInsertionPosition(t),this.insertionPosition.stickiness="toNone",this.graveyardPosition=i?i.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const t=this.insertionPosition.path.slice();return t.push(0),new Ts(this.insertionPosition.root,t)}get movedRange(){const t=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Es(this.splitPosition,t)}clone(){const t=new this.constructor(this.splitPosition,this.howMany,this.graveyardPosition,this.baseVersion);return t.insertionPosition=this.insertionPosition,t}getReversed(){const t=this.splitPosition.root.document.graveyard,e=new Ts(t,[0]);return new Xa(this.moveTargetPosition,this.howMany,this.splitPosition,e,this.baseVersion+1)}_validate(){const t=this.splitPosition.parent,e=this.splitPosition.offset;if(!t||t.maxOffset{for(const e of t.getAttributeKeys())this.removeAttribute(e,t)};if(t instanceof Es)for(const i of t.getItems())e(i);else e(t)}move(t,e,i){if(this._assertWriterUsedCorrectly(),!(t instanceof Es))throw new hi.a("writer-move-invalid-range",this);if(!t.isFlat)throw new hi.a("writer-move-range-not-flat",this);const o=Ts._createAt(e,i);if(o.isEqual(t.start))return;if(this._addOperationForAffectedMarkers("move",t),!al(t.root,o.root))throw new hi.a("writer-move-different-document",this);const n=t.root.document?t.root.document.version:null,r=new Ya(t.start,t.end.offset-t.start.offset,o,n);this.batch.addOperation(r),this.model.applyOperation(r)}remove(t){this._assertWriterUsedCorrectly();const e=(t instanceof Es?t:Es._createOn(t)).getMinimalFlatRanges().reverse();for(const t of e)this._addOperationForAffectedMarkers("move",t),sl(t.start,t.end.offset-t.start.offset,this.batch,this.model)}merge(t){this._assertWriterUsedCorrectly();const e=t.nodeBefore,i=t.nodeAfter;if(this._addOperationForAffectedMarkers("merge",t),!(e instanceof ys))throw new hi.a("writer-merge-no-element-before",this);if(!(i instanceof ys))throw new hi.a("writer-merge-no-element-after",this);t.root.document?this._merge(t):this._mergeDetached(t)}createPositionFromPath(t,e,i){return this.model.createPositionFromPath(t,e,i)}createPositionAt(t,e){return this.model.createPositionAt(t,e)}createPositionAfter(t){return this.model.createPositionAfter(t)}createPositionBefore(t){return this.model.createPositionBefore(t)}createRange(t,e){return this.model.createRange(t,e)}createRangeIn(t){return this.model.createRangeIn(t)}createRangeOn(t){return this.model.createRangeOn(t)}createSelection(t,e,i){return this.model.createSelection(t,e,i)}_mergeDetached(t){const e=t.nodeBefore,i=t.nodeAfter;this.move(Es._createIn(i),Ts._createAt(e,"end")),this.remove(i)}_merge(t){const e=Ts._createAt(t.nodeBefore,"end"),i=Ts._createAt(t.nodeAfter,0),o=t.root.document.graveyard,n=new Ts(o,[0]),r=t.root.document.version,s=new Xa(i,t.nodeAfter.maxOffset,e,n,r);this.batch.addOperation(s),this.model.applyOperation(s)}rename(t,e){if(this._assertWriterUsedCorrectly(),!(t instanceof ys))throw new hi.a("writer-rename-not-element-instance",this);const i=t.root.document?t.root.document.version:null,o=new Ja(Ts._createBefore(t),t.name,e,i);this.batch.addOperation(o),this.model.applyOperation(o)}split(t,e){this._assertWriterUsedCorrectly();let i,o,n=t.parent;if(!n.parent)throw new hi.a("writer-split-element-no-parent",this);if(e||(e=n.parent),!t.parent.getAncestors({includeSelf:!0}).includes(e))throw new hi.a("writer-split-invalid-limit-element",this);do{const e=n.root.document?n.root.document.version:null,r=n.maxOffset-t.offset,s=new tl(t,r,null,e);this.batch.addOperation(s),this.model.applyOperation(s),i||o||(i=n,o=t.parent.nextSibling),n=(t=this.createPositionAfter(t.parent)).parent}while(n!==e);return{position:t,range:new Es(Ts._createAt(i,"end"),Ts._createAt(o,0))}}wrap(t,e){if(this._assertWriterUsedCorrectly(),!t.isFlat)throw new hi.a("writer-wrap-range-not-flat",this);const i=e instanceof ys?e:new ys(e);if(i.childCount>0)throw new hi.a("writer-wrap-element-not-empty",this);if(null!==i.parent)throw new hi.a("writer-wrap-element-attached",this);this.insert(i,t.start);const o=new Es(t.start.getShiftedBy(1),t.end.getShiftedBy(1));this.move(o,Ts._createAt(i,0))}unwrap(t){if(this._assertWriterUsedCorrectly(),null===t.parent)throw new hi.a("writer-unwrap-element-no-parent",this);this.move(Es._createIn(t),this.createPositionAfter(t)),this.remove(t)}addMarker(t,e){if(this._assertWriterUsedCorrectly(),!e||"boolean"!=typeof e.usingOperation)throw new hi.a("writer-addmarker-no-usingoperation",this);const i=e.usingOperation,o=e.range,n=void 0!==e.affectsData&&e.affectsData;if(this.model.markers.has(t))throw new hi.a("writer-addmarker-marker-exists",this);if(!o)throw new hi.a("writer-addmarker-no-range",this);return i?(rl(this,t,null,o,n),this.model.markers.get(t)):this.model.markers._set(t,o,i,n)}updateMarker(t,e){this._assertWriterUsedCorrectly();const i="string"==typeof t?t:t.name,o=this.model.markers.get(i);if(!o)throw new hi.a("writer-updatemarker-marker-not-exists",this);if(!e)return void this.model.markers._refresh(o);const n="boolean"==typeof e.usingOperation,r="boolean"==typeof e.affectsData,s=r?e.affectsData:o.affectsData;if(!n&&!e.range&&!r)throw new hi.a("writer-updatemarker-wrong-options",this);const a=o.getRange(),l=e.range?e.range:a;n&&e.usingOperation!==o.managedUsingOperations?e.usingOperation?rl(this,i,null,l,s):(rl(this,i,a,null,s),this.model.markers._set(i,l,void 0,s)):o.managedUsingOperations?rl(this,i,a,l,s):this.model.markers._set(i,l,void 0,s)}removeMarker(t){this._assertWriterUsedCorrectly();const e="string"==typeof t?t:t.name;if(!this.model.markers.has(e))throw new hi.a("writer-removemarker-no-marker",this);const i=this.model.markers.get(e);if(!i.managedUsingOperations)return void this.model.markers._remove(e);rl(this,e,i.getRange(),null,i.affectsData)}setSelection(t,e,i){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(t,e,i)}setSelectionFocus(t,e){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(t,e)}setSelectionAttribute(t,e){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._setSelectionAttribute(t,e);else for(const[e,i]of Ri(t))this._setSelectionAttribute(e,i)}removeSelectionAttribute(t){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._removeSelectionAttribute(t);else for(const e of t)this._removeSelectionAttribute(e)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(t){this.model.document.selection._restoreGravity(t)}_setSelectionAttribute(t,e){const i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const o=Ws._getStoreAttributeKey(t);this.setAttribute(o,e,i.anchor.parent)}i._setAttribute(t,e)}_removeSelectionAttribute(t){const e=this.model.document.selection;if(e.isCollapsed&&e.anchor.parent.isEmpty){const i=Ws._getStoreAttributeKey(t);this.removeAttribute(i,e.anchor.parent)}e._removeAttribute(t)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new hi.a("writer-incorrect-use",this)}_addOperationForAffectedMarkers(t,e){for(const i of this.model.markers){if(!i.managedUsingOperations)continue;const o=i.getRange();let n=!1;if("move"===t)n=e.containsPosition(o.start)||e.start.isEqual(o.start)||e.containsPosition(o.end)||e.end.isEqual(o.end);else{const t=e.nodeBefore,i=e.nodeAfter,r=o.start.parent==t&&o.start.isAtEnd,s=o.end.parent==i&&0==o.end.offset,a=o.end.nodeAfter==i,l=o.start.nodeAfter==i;n=r||s||a||l}n&&this.updateMarker(i.name,{range:o})}}}function ol(t,e,i,o){const n=t.model,r=n.document;let s,a,l,c=o.start;for(const t of o.getWalker({shallow:!0}))l=t.item.getAttribute(e),s&&a!=l&&(a!=i&&d(),c=s),s=t.nextPosition,a=l;function d(){const o=new Es(c,s),l=o.root.document?r.version:null,d=new $a(o,e,a,i,l);t.batch.addOperation(d),n.applyOperation(d)}s instanceof Ts&&s!=c&&a!=i&&d()}function nl(t,e,i,o){const n=t.model,r=n.document,s=o.getAttribute(e);let a,l;if(s!=i){if(o.root===o){const t=o.document?r.version:null;l=new Za(o,e,s,i,t)}else{a=new Es(Ts._createBefore(o),t.createPositionAfter(o));const n=a.root.document?r.version:null;l=new $a(a,e,s,i,n)}t.batch.addOperation(l),n.applyOperation(l)}}function rl(t,e,i,o,n){const r=t.model,s=r.document,a=new Qa(e,i,o,r.markers,n,s.version);t.batch.addOperation(a),r.applyOperation(a)}function sl(t,e,i,o){let n;if(t.root.document){const i=o.document,r=new Ts(i.graveyard,[0]);n=new Ya(t,e,r,i.version)}else n=new Ga(t,e);i.addOperation(n),o.applyOperation(n)}function al(t,e){return t===e||t instanceof el&&e instanceof el}class ll{constructor(t){this._markerCollection=t,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}refreshItem(t){if(this._isInInsertedElement(t.parent))return;this._markRemove(t.parent,t.startOffset,t.offsetSize),this._markInsert(t.parent,t.startOffset,t.offsetSize);const e=Es._createOn(t);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getRange();this.bufferMarkerChange(t.name,e,e,t.affectsData)}this._cachedChanges=null}bufferOperation(t){switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const e of t.range.getItems({shallow:!0}))this._isInInsertedElement(e.parent)||this._markAttribute(e);break;case"remove":case"move":case"reinsert":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;const e=this._isInInsertedElement(t.sourcePosition.parent),i=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),i||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const e=Es._createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getRange();this.bufferMarkerChange(t.name,e,e,t.affectsData)}break}case"split":{const e=t.splitPosition.parent;this._isInInsertedElement(e)||this._markRemove(e,t.splitPosition.offset,t.howMany),this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1);break}case"merge":{const e=t.sourcePosition.parent;this._isInInsertedElement(e.parent)||this._markRemove(e.parent,e.startOffset,1);const i=t.graveyardPosition.parent;this._markInsert(i,t.graveyardPosition.offset,1);const o=t.targetPosition.parent;this._isInInsertedElement(o)||this._markInsert(o,t.targetPosition.offset,e.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(t,e,i,o){const n=this._changedMarkers.get(t);n?(n.newRange=i,n.affectsData=o,null==n.oldRange&&null==n.newRange&&this._changedMarkers.delete(t)):this._changedMarkers.set(t,{oldRange:e,newRange:i,affectsData:o})}getMarkersToRemove(){const t=[];for(const[e,i]of this._changedMarkers)null!=i.oldRange&&t.push({name:e,range:i.oldRange});return t}getMarkersToAdd(){const t=[];for(const[e,i]of this._changedMarkers)null!=i.newRange&&t.push({name:e,range:i.newRange});return t}getChangedMarkers(){return Array.from(this._changedMarkers).map(t=>({name:t[0],data:{oldRange:t[1].oldRange,newRange:t[1].newRange}}))}hasDataChanges(){for(const[,t]of this._changedMarkers)if(t.affectsData)return!0;return this._changesInElement.size>0}getChanges(t={includeChangesInGraveyard:!1}){if(this._cachedChanges)return t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();const e=[];for(const t of this._changesInElement.keys()){const i=this._changesInElement.get(t).sort((t,e)=>t.offset===e.offset?t.type!=e.type?"remove"==t.type?-1:1:0:t.offsett.position.root!=e.position.root?t.position.root.rootNamei.offset){if(o>n){const t={type:"attribute",offset:n,howMany:o-n,count:this._changeCount++};this._handleChange(t,e),e.push(t)}t.nodesToHandle=i.offset-t.offset,t.howMany=t.nodesToHandle}else t.offset>=i.offset&&t.offsetn?(t.nodesToHandle=o-n,t.offset=n):t.nodesToHandle=0);if("remove"==i.type&&t.offseti.offset){const n={type:"attribute",offset:i.offset,howMany:o-i.offset,count:this._changeCount++};this._handleChange(n,e),e.push(n),t.nodesToHandle=i.offset-t.offset,t.howMany=t.nodesToHandle}"attribute"==i.type&&(t.offset>=i.offset&&o<=n?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=i.offset&&o>=n&&(i.howMany=0))}}t.howMany=t.nodesToHandle,delete t.nodesToHandle}_getInsertDiff(t,e,i){return{type:"insert",position:Ts._createAt(t,e),name:i,length:1,changeCount:this._changeCount++}}_getRemoveDiff(t,e,i){return{type:"remove",position:Ts._createAt(t,e),name:i,length:1,changeCount:this._changeCount++}}_getAttributesDiff(t,e,i){const o=[];i=new Map(i);for(const[n,r]of e){const e=i.has(n)?i.get(n):null;e!==r&&o.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:n,attributeOldValue:r,attributeNewValue:e,changeCount:this._changeCount++}),i.delete(n)}for(const[e,n]of i)o.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:e,attributeOldValue:null,attributeNewValue:n,changeCount:this._changeCount++});return o}_isInInsertedElement(t){const e=t.parent;if(!e)return!1;const i=this._changesInElement.get(e),o=t.startOffset;if(i)for(const t of i)if("insert"==t.type&&o>=t.offset&&oo){for(let e=0;e=t&&o.baseVersion{const i=e[0];if(i.isDocumentOperation&&i.baseVersion!==this.version)throw new hi.a("model-document-applyoperation-wrong-version",this,{operation:i})},{priority:"highest"}),this.listenTo(t,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&this.differ.bufferOperation(i)},{priority:"high"}),this.listenTo(t,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&(this.version++,this.history.addOperation(i))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(t.markers,"update",(t,e,i,o)=>{this.differ.bufferMarkerChange(e.name,i,o,e.affectsData),null===i&&e.on("change",(t,i)=>{this.differ.bufferMarkerChange(e.name,i,e.getRange(),e.affectsData)})})}get graveyard(){return this.getRoot("$graveyard")}createRoot(t="$root",e="main"){if(this.roots.get(e))throw new hi.a("model-document-createroot-name-exists",this,{name:e});const i=new el(this,t,e);return this.roots.add(i),i}destroy(){this.selection.destroy(),this.stopListening()}getRoot(t="main"){return this.roots.get(t)}getRootNames(){return Array.from(this.roots,t=>t.rootName).filter(t=>"$graveyard"!=t)}registerPostFixer(t){this._postFixers.add(t)}toJSON(){const t=Ii(this);return t.selection="[engine.model.DocumentSelection]",t.model="[engine.model.Model]",t}_handleChangeBlock(t){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(t),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",t.batch):this.fire("change",t.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const t of this.roots)if(t!==this.graveyard)return t;return this.graveyard}_getDefaultRange(){const t=this._getDefaultRoot(),e=this.model,i=e.schema,o=e.createPositionFromPath(t,[0]);return i.getNearestSelectionRange(o)||e.createRange(o)}_validateSelectionRange(t){return pl(t.start)&&pl(t.end)}_callPostFixers(t){let e=!1;do{for(const i of this._postFixers)if(this.selection.refresh(),e=i(t),e)break}while(e)}}function pl(t){const e=t.textNode;if(e){const i=e.data,o=t.offset-e.startOffset;return!gl(i,o)&&!ml(i,o)}return!0}yi(fl,mi);class bl{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(t){return this._markers.has(t)}get(t){return this._markers.get(t)||null}_set(t,e,i=!1,o=!1){const n=t instanceof wl?t.name:t;if(n.includes(","))throw new hi.a("markercollection-incorrect-marker-name",this);const r=this._markers.get(n);if(r){const t=r.getRange();let s=!1;return t.isEqual(e)||(r._attachLiveRange(Hs.fromRange(e)),s=!0),i!=r.managedUsingOperations&&(r._managedUsingOperations=i,s=!0),"boolean"==typeof o&&o!=r.affectsData&&(r._affectsData=o,s=!0),s&&this.fire("update:"+n,r,t,e),r}const s=Hs.fromRange(e),a=new wl(n,s,i,o);return this._markers.set(n,a),this.fire("update:"+n,a,null,e),a}_remove(t){const e=t instanceof wl?t.name:t,i=this._markers.get(e);return!!i&&(this._markers.delete(e),this.fire("update:"+e,i,i.getRange(),null),this._destroyMarker(i),!0)}_refresh(t){const e=t instanceof wl?t.name:t,i=this._markers.get(e);if(!i)throw new hi.a("markercollection-refresh-marker-not-exists",this);const o=i.getRange();this.fire("update:"+e,i,o,o,i.managedUsingOperations,i.affectsData)}*getMarkersAtPosition(t){for(const e of this)e.getRange().containsPosition(t)&&(yield e)}*getMarkersIntersectingRange(t){for(const e of this)null!==e.getRange().getIntersection(t)&&(yield e)}destroy(){for(const t of this._markers.values())this._destroyMarker(t);this._markers=null,this.stopListening()}*getMarkersGroup(t){for(const e of this._markers.values())e.name.startsWith(t+":")&&(yield e)}_destroyMarker(t){t.stopListening(),t._detachLiveRange()}}yi(bl,mi);class wl{constructor(t,e,i,o){this.name=t,this._liveRange=this._attachLiveRange(e),this._managedUsingOperations=i,this._affectsData=o}get managedUsingOperations(){if(!this._liveRange)throw new hi.a("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new hi.a("marker-destroyed",this);return this._affectsData}getStart(){if(!this._liveRange)throw new hi.a("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new hi.a("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new hi.a("marker-destroyed",this);return this._liveRange.toRange()}is(t){return"marker"===t||"model:marker"===t}_attachLiveRange(t){return this._liveRange&&this._detachLiveRange(),t.delegate("change:range").to(this),t.delegate("change:content").to(this),this._liveRange=t,t}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}yi(wl,mi);class kl extends Ra{get type(){return"noop"}clone(){return new kl(this.baseVersion)}getReversed(){return new kl(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const _l={};_l[$a.className]=$a,_l[Ka.className]=Ka,_l[Qa.className]=Qa,_l[Ya.className]=Ya,_l[kl.className]=kl,_l[Ra.className]=Ra,_l[Ja.className]=Ja,_l[Za.className]=Za,_l[tl.className]=tl,_l[Xa.className]=Xa;class vl extends Ts{constructor(t,e,i="toNone"){if(super(t,e,i),!this.root.is("rootElement"))throw new hi.a("model-liveposition-root-not-rootelement",t);yl.call(this)}detach(){this.stopListening()}is(t){return"livePosition"===t||"model:livePosition"===t||"position"==t||"model:position"===t}toPosition(){return new Ts(this.root,this.path.slice(),this.stickiness)}static fromPosition(t,e){return new this(t.root,t.path.slice(),e||t.stickiness)}}function yl(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&xl.call(this,i)},{priority:"low"})}function xl(t){const e=this.getTransformedByOperation(t);if(!this.isEqual(e)){const t=this.toPosition();this.path=e.path,this.root=e.root,this.fire("change",t)}}yi(vl,mi);class Al{constructor(t,e,i){this.model=t,this.writer=e,this.position=i,this.canMergeWith=new Set([this.position.parent]),this.schema=t.schema,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(t,e){t=Array.from(t);for(let i=0;i{if(!i.doNotResetEntireContent&&function(t,e){const i=t.getLimitElement(e);if(!e.containsEntireContent(i))return!1;const o=e.getFirstRange();if(o.start.parent==o.end.parent)return!1;return t.checkChild(i,"paragraph")}(n,e))return void function(t,e){const i=t.model.schema.getLimitElement(e);t.remove(t.createRangeIn(i)),Sl(t,t.createPositionAt(i,0),e)}(t,e);const[r,s]=function(t){const e=t.root.document.model,i=t.start;let o=t.end;if(e.hasContent(t,{ignoreMarkers:!0})){const i=function(t){const e=t.parent,i=e.root.document.model.schema,o=e.getAncestors({parentFirst:!0,includeSelf:!0});for(const t of o){if(i.isLimit(t))return null;if(i.isBlock(t))return t}}(o);if(i&&o.isTouching(e.createPositionAt(i,0))){const i=e.createSelection(t);e.modifySelection(i,{direction:"backward"}),o=i.getLastPosition()}}return[vl.fromPosition(i,"toPrevious"),vl.fromPosition(o,"toNext")]}(o);r.isTouching(s)||t.remove(t.createRange(r,s)),i.leaveUnmerged||(!function(t,e,i){const o=t.model;if(!Cl(t.model.schema,e,i))return;const[n,r]=function(t,e){const i=t.getAncestors(),o=e.getAncestors();let n=0;for(;i[n]&&i[n]==o[n];)n++;return[i[n],o[n]]}(e,i);if(!n||!r)return;!o.hasContent(n,{ignoreMarkers:!0})&&o.hasContent(r,{ignoreMarkers:!0})?function t(e,i,o,n){const r=i.parent,s=o.parent;if(r==n||s==n)return;i=e.createPositionAfter(r),(o=e.createPositionBefore(s)).isEqual(i)||e.insert(r,o);for(;i.parent.isEmpty;){const t=i.parent;i=e.createPositionBefore(t),e.remove(t)}if(o=e.createPositionBefore(s),function(t,e){const i=e.nodeBefore,o=e.nodeAfter;i.name!=o.name&&t.rename(i,o.name);t.clearAttributes(i),t.setAttributes(Object.fromEntries(o.getAttributes()),i),t.merge(e)}(e,o),!Cl(e.model.schema,i,o))return;t(e,i,o,n)}(t,e,i,n.parent):function t(e,i,o,n){const r=i.parent,s=o.parent;if(r==n||s==n)return;i=e.createPositionAfter(r),(o=e.createPositionBefore(s)).isEqual(i)||e.insert(s,i);e.merge(i);for(;o.parent.isEmpty;){const t=o.parent;o=e.createPositionBefore(t),e.remove(t)}if(!Cl(e.model.schema,i,o))return;t(e,i,o,n)}(t,e,i,n.parent)}(t,r,s),n.removeDisallowedAttributes(r.parent.getChildren(),t)),Pl(t,e,r),!i.doNotAutoparagraph&&function(t,e){const i=t.checkChild(e,"$text"),o=t.checkChild(e,"paragraph");return!i&&o}(n,r)&&Sl(t,r,e),r.detach(),s.detach()})}function Cl(t,e,i){const o=e.parent,n=i.parent;return o!=n&&(!t.isLimit(o)&&!t.isLimit(n)&&function(t,e,i){const o=new Es(t,e);for(const t of o.getWalker())if(i.isLimit(t.item))return!1;return!0}(e,i,t))}function Sl(t,e,i){const o=t.createElement("paragraph");t.insert(o,e),Pl(t,i,t.createPositionAt(o,0))}function Pl(t,e,i){e instanceof Ws?t.setSelection(i):e.setTo(i)}function El(t,e){const{isForward:i,walker:o,unit:n,schema:r}=t,{type:s,item:a,nextPosition:l}=e;if("text"==s)return"word"===t.unit?function(t,e){let i=t.position.textNode;if(i){let o=t.position.offset-i.startOffset;for(;!Ll(i.data,o,e)&&!Il(i,o,e);){t.next();const n=e?t.position.nodeAfter:t.position.nodeBefore;if(n&&n.is("$text")){const o=n.data.charAt(e?0:n.data.length-1);' ,.?!:;"-()'.includes(o)||(t.next(),i=t.position.textNode)}o=t.position.offset-i.startOffset}}return t.position}(o,i):function(t,e){const i=t.position.textNode;if(i){const o=i.data;let n=t.position.offset-i.startOffset;for(;gl(o,n)||"character"==e&&ml(o,n);)t.next(),n=t.position.offset-i.startOffset}return t.position}(o,n);if(s==(i?"elementStart":"elementEnd")){if(r.isSelectable(a))return Ts._createAt(a,i?"after":"before");if(r.checkChild(l,"$text"))return l}else{if(r.isLimit(a))return void o.skip(()=>!0);if(r.checkChild(l,"$text"))return l}}function Ml(t,e){const i=t.root,o=Ts._createAt(i,e?"end":0);return e?new Es(t,o):new Es(o,t)}function Ll(t,e,i){const o=e+(i?0:-1);return' ,.?!:;"-()'.includes(t.charAt(o))}function Il(t,e,i){return e===(i?t.endOffset:0)}function Nl(t,e){const i=[];Array.from(t.getItems({direction:"backward"})).map(t=>e.createRangeOn(t)).filter(e=>(e.start.isAfter(t.start)||e.start.isEqual(t.start))&&(e.end.isBefore(t.end)||e.end.isEqual(t.end))).forEach(t=>{i.push(t.start.parent),e.remove(t)}),i.forEach(t=>{let i=t;for(;i.parent&&i.isEmpty;){const t=e.createRangeOn(i);i=i.parent,e.remove(t)}})}function zl(t){t.document.registerPostFixer(e=>function(t,e){const i=e.document.selection,o=e.schema,n=[];let r=!1;for(const t of i.getRanges()){const e=Ol(t,o);e&&!e.isEqual(t)?(n.push(e),r=!0):n.push(t)}r&&t.setSelection(function(t){const e=[];e.push(t.shift());for(const i of t){const t=e.pop();if(i.isEqual(t))e.push(t);else if(i.isIntersecting(t)){const o=t.start.isAfter(i.start)?i.start:t.start,n=t.end.isAfter(i.end)?t.end:i.end,r=new Es(o,n);e.push(r)}else e.push(t),e.push(i)}return e}(n),{backward:i.isBackward})}(e,t))}function Ol(t,e){return t.isCollapsed?function(t,e){const i=t.start,o=e.getNearestSelectionRange(i);if(!o)return null;if(!o.isCollapsed)return o;const n=o.start;if(i.isEqual(n))return null;return new Es(n)}(t,e):function(t,e){const{start:i,end:o}=t,n=e.checkChild(i,"$text"),r=e.checkChild(o,"$text"),s=e.getLimitElement(i),a=e.getLimitElement(o);if(s===a){if(n&&r)return null;if(function(t,e,i){const o=t.nodeAfter&&!i.isLimit(t.nodeAfter)||i.checkChild(t,"$text"),n=e.nodeBefore&&!i.isLimit(e.nodeBefore)||i.checkChild(e,"$text");return o||n}(i,o,e)){const t=i.nodeAfter&&e.isSelectable(i.nodeAfter)?null:e.getNearestSelectionRange(i,"forward"),n=o.nodeBefore&&e.isSelectable(o.nodeBefore)?null:e.getNearestSelectionRange(o,"backward"),r=t?t.start:i,s=n?n.end:o;return new Es(r,s)}}const l=s&&!s.is("rootElement"),c=a&&!a.is("rootElement");if(l||c){const t=i.nodeAfter&&o.nodeBefore&&i.nodeAfter.parent===o.nodeBefore.parent,n=l&&(!t||!Dl(i.nodeAfter,e)),r=c&&(!t||!Dl(o.nodeBefore,e));let d=i,h=o;return n&&(d=Ts._createBefore(Rl(s,e))),r&&(h=Ts._createAfter(Rl(a,e))),new Es(d,h)}return null}(t,e)}function Rl(t,e){let i=t,o=i;for(;e.isLimit(o)&&o.parent;)i=o,o=o.parent;return i}function Dl(t,e){return t&&e.isSelectable(t)}class Vl{constructor(){this.markers=new bl,this.document=new fl(this),this.schema=new ba,this._pendingChanges=[],this._currentWriter=null,["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(t=>this.decorate(t)),this.on("applyOperation",(t,e)=>{e[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$block",{allowIn:"$root",isBlock:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",isLimit:!0}),this.schema.extend("$text",{allowIn:"$clipboardHolder"}),this.schema.register("$marker"),this.schema.addChildCheck((t,e)=>{if("$marker"===e.name)return!0}),zl(this),this.document.registerPostFixer(oa)}change(t){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new Oa,callback:t}),this._runPendingChanges()[0]):t(this._currentWriter)}catch(t){hi.a.rethrowUnexpectedError(t,this)}}enqueueChange(t,e){try{"string"==typeof t?t=new Oa(t):"function"==typeof t&&(e=t,t=new Oa),this._pendingChanges.push({batch:t,callback:e}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(t){hi.a.rethrowUnexpectedError(t,this)}}applyOperation(t){t._execute()}insertContent(t,e,i){return function(t,e,i,o){return t.change(n=>{let r;r=i?i instanceof Ds||i instanceof Ws?i:n.createSelection(i,o):t.document.selection,r.isCollapsed||t.deleteContent(r,{doNotAutoparagraph:!0});const s=new Al(t,n,r.anchor);let a;a=e.is("documentFragment")?e.getChildren():[e],s.handleNodes(a,{isFirst:!0,isLast:!0});const l=s.getSelectionRange();l&&(r instanceof Ws?n.setSelection(l):r.setTo(l));const c=s.getAffectedRange()||t.createRange(r.anchor);return s.destroy(),c})}(this,t,e,i)}deleteContent(t,e){Tl(this,t,e)}modifySelection(t,e){!function(t,e,i={}){const o=t.schema,n="backward"!=i.direction,r=i.unit?i.unit:"character",s=e.focus,a=new xs({boundaries:Ml(s,n),singleCharacters:!0,direction:n?"forward":"backward"}),l={walker:a,schema:o,isForward:n,unit:r};let c;for(;c=a.next();){if(c.done)return;const i=El(l,c.value);if(i)return void(e instanceof Ws?t.change(t=>{t.setSelectionFocus(i)}):e.setFocus(i))}}(this,t,e)}getSelectedContent(t){return function(t,e){return t.change(t=>{const i=t.createDocumentFragment(),o=e.getFirstRange();if(!o||o.isCollapsed)return i;const n=o.start.root,r=o.start.getCommonPath(o.end),s=n.getNodeByPath(r);let a;a=o.start.parent==o.end.parent?o:t.createRange(t.createPositionAt(s,o.start.path[r.length]),t.createPositionAt(s,o.end.path[r.length]+1));const l=a.end.offset-a.start.offset;for(const e of a.getItems({shallow:!0}))e.is("$textProxy")?t.appendText(e.data,e.getAttributes(),i):t.append(t.cloneElement(e,!0),i);if(a!=o){const e=o._getTransformedByMove(a.start,t.createPositionAt(i,0),l)[0],n=t.createRange(t.createPositionAt(i,0),e.start);Nl(t.createRange(e.end,t.createPositionAt(i,"end")),t),Nl(n,t)}return i})}(this,t)}hasContent(t,e={}){const i=t instanceof ys?Es._createIn(t):t;if(i.isCollapsed)return!1;const{ignoreWhitespaces:o=!1,ignoreMarkers:n=!1}=e;if(!n)for(const t of this.markers.getMarkersIntersectingRange(i))if(t.affectsData)return!0;for(const t of i.getItems())if(this.schema.isContent(t)){if(!t.is("$textProxy"))return!0;if(!o)return!0;if(-1!==t.data.search(/\S/))return!0}return!1}createPositionFromPath(t,e,i){return new Ts(t,e,i)}createPositionAt(t,e){return Ts._createAt(t,e)}createPositionAfter(t){return Ts._createAfter(t)}createPositionBefore(t){return Ts._createBefore(t)}createRange(t,e){return new Es(t,e)}createRangeIn(t){return Es._createIn(t)}createRangeOn(t){return Es._createOn(t)}createSelection(t,e,i){return new Ds(t,e,i)}createBatch(t){return new Oa(t)}createOperationFromJSON(t){return class{static fromJSON(t,e){return _l[t.__className].fromJSON(t,e)}}.fromJSON(t,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const t=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){const e=this._pendingChanges[0].batch;this._currentWriter=new il(this,e);const i=this._pendingChanges[0].callback(this._currentWriter);t.push(i),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),t}}yi(Vl,Uo);class jl{constructor(){this._listener=Object.create(mr)}listenTo(t){this._listener.listenTo(t,"keydown",(t,e)=>{this._listener.fire("_keydown:"+bn(e),e)})}set(t,e,i={}){const o=wn(t),n=i.priority;this._listener.listenTo(this._listener,"_keydown:"+o,(t,i)=>{e(i,()=>{i.preventDefault(),i.stopPropagation(),t.stop()}),t.return=!0},{priority:n})}press(t){return!!this._listener.fire("_keydown:"+bn(t),t)}destroy(){this._listener.stopListening()}}class Bl extends jl{constructor(t){super(),this.editor=t}set(t,e,i={}){if("string"==typeof e){const t=e;e=(e,i)=>{this.editor.execute(t),i()}}super.set(t,e,i)}}class Fl{constructor(t={}){this._context=t.context||new Mi({language:t.language}),this._context._addEditor(this,!t.context);const e=Array.from(this.constructor.builtinPlugins||[]);this.config=new oi(t,this.constructor.defaultConfig),this.config.define("plugins",e),this.config.define(this._context._getEditorConfig()),this.plugins=new Ai(this,e,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new ma,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 Vl;const i=new Lo;this.data=new La(this.model,i),this.editing=new ga(this.model,i),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new Ia([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 Bl(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const t=this.config,e=t.get("plugins"),i=t.get("removePlugins")||[],o=t.get("extraPlugins")||[];return this.plugins.init(e.concat(o),i)}destroy(){let t=Promise.resolve();return"initializing"==this.state&&(t=new Promise(t=>this.once("ready",t))),t.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(...t){try{return this.commands.execute(...t)}catch(t){hi.a.rethrowUnexpectedError(t,this)}}focus(){this.editing.view.focus()}}yi(Fl,Uo);var Hl={setData(t){this.data.set(t)},getData(t){return this.data.get(t)}};var Ul={updateSourceElement(){if(!this.sourceElement)throw new hi.a("editor-missing-sourceelement",this);var t,e;t=this.sourceElement,e=this.data.get(),t instanceof HTMLTextAreaElement&&(t.value=e),t.innerHTML=e}};class ql{getHtml(t){const e=document.implementation.createHTMLDocument("").createElement("div");return e.appendChild(t),e.innerHTML}}class Wl{constructor(t){this._domParser=new DOMParser,this._domConverter=new cr(t,{blockFillerMode:"nbsp"}),this._htmlWriter=new ql}toData(t){const e=this._domConverter.viewToDom(t,document);return this._htmlWriter.getHtml(e)}toView(t){const e=this._toDom(t);return this._domConverter.domToView(e)}registerRawContentMatcher(t){this._domConverter.registerRawContentMatcher(t)}_toDom(t){const e=this._domParser.parseFromString(t,"text/html"),i=e.createDocumentFragment(),o=e.body.childNodes;for(;o.length>0;)i.appendChild(o[0]);return i}}class $l{constructor(t){this.editor=t,this._components=new Map}*names(){for(const t of this._components.values())yield t.originalName}add(t,e){this._components.set(Gl(t),{callback:e,originalName:t})}create(t){if(!this.has(t))throw new hi.a("componentfactory-item-missing",this,{name:t});return this._components.get(Gl(t)).callback(this.editor.locale)}has(t){return this._components.has(Gl(t))}}function Gl(t){return String(t).toLowerCase()}class Yl{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(t){if(this._elements.has(t))throw new hi.a("focustracker-add-element-already-exist",this);this.listenTo(t,"focus",()=>this._focus(t),{useCapture:!0}),this.listenTo(t,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(t)}remove(t){t===this.focusedElement&&this._blur(t),this._elements.has(t)&&(this.stopListening(t),this._elements.delete(t))}destroy(){this.stopListening()}_focus(t){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=t,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}yi(Yl,mr),yi(Yl,Uo);class Kl{constructor(t){this.editor=t,this.componentFactory=new $l(t),this.focusTracker=new Yl,this._editableElementsMap=new Map,this.listenTo(t.editing.view.document,"layoutChanged",()=>this.update())}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy();for(const t of this._editableElementsMap.values())t.ckeditorInstance=null;this._editableElementsMap=new Map}setEditableElement(t,e){this._editableElementsMap.set(t,e),e.ckeditorInstance||(e.ckeditorInstance=this.editor)}getEditableElement(t="main"){return this._editableElementsMap.get(t)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}}yi(Kl,mi);i(14);const Ql=new WeakMap;function Jl(t){const{view:e,element:i,text:o,isDirectHost:n=!0}=t,r=e.document;Ql.has(r)||(Ql.set(r,new Map),r.registerPostFixer(t=>Xl(r,t))),Ql.get(r).set(i,{text:o,isDirectHost:n}),e.change(t=>Xl(r,t))}function Zl(t,e){return!!e.hasClass("ck-placeholder")&&(t.removeClass("ck-placeholder",e),!0)}function Xl(t,e){const i=Ql.get(t);let o=!1;for(const[t,n]of i)tc(e,t,n)&&(o=!0);return o}function tc(t,e,i){const{text:o,isDirectHost:n}=i,r=n?e:function(t){if(1===t.childCount){const e=t.getChild(0);if(e.is("element")&&!e.is("uiElement"))return e}return null}(e);let s=!1;return!!r&&(i.hostElement=r,r.getAttribute("data-placeholder")!==o&&(t.setAttribute("data-placeholder",o,r),s=!0),!function(t){if(!t.isAttached())return!1;const e=!Array.from(t.getChildren()).some(t=>!t.is("uiElement")),i=t.document;if(!i.isFocused&&e)return!0;const o=i.selection.anchor;return!(!e||!o||o.parent===t)}(r)?Zl(t,r)&&(s=!0):function(t,e){return!e.hasClass("ck-placeholder")&&(t.addClass("ck-placeholder",e),!0)}(t,r)&&(s=!0),s)}class ec{constructor(){this._replacedElements=[]}replace(t,e){this._replacedElements.push({element:t,newElement:e}),t.style.display="none",e&&t.parentNode.insertBefore(e,t.nextSibling)}restore(){this._replacedElements.forEach(({element:t,newElement:e})=>{t.style.display="",e&&e.remove()}),this._replacedElements=[]}}class ic extends Kl{constructor(t,e){var i;super(t),this.view=e,this._toolbarConfig=(i=t.config.get("toolbar"),Array.isArray(i)?{items:i}:i?Object.assign({items:[]},i):{items:[]}),this._elementReplacer=new ec}get element(){return this.view.element}init(t){const e=this.editor,i=this.view,o=e.editing.view,n=i.editable,r=o.document.getRoot();n.name=r.rootName,i.render();const s=n.element;this.setEditableElement(n.name,s),this.focusTracker.add(s),i.editable.bind("isFocused").to(this.focusTracker),o.attachDomRoot(s),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.detachDomRoot(t.editable.name),t.destroy(),super.destroy()}_initToolbar(){const t=this.editor,e=this.view,i=t.editing.view;e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),e.stickyPanel.limiterElement=e.element,this._toolbarConfig.viewportTopOffset&&(e.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset),e.toolbar.fillFromConfig(this._toolbarConfig.items,this.componentFactory),function({origin:t,originKeystrokeHandler:e,originFocusTracker:i,toolbar:o,beforeFocus:n,afterBlur:r}){i.add(o.element),e.set("Alt+F10",(t,e)=>{i.isFocused&&!o.focusTracker.isFocused&&(n&&n(),o.focus(),e())}),o.keystrokes.set("Esc",(e,i)=>{o.focusTracker.isFocused&&(t.focus(),r&&r(),i())})}({origin:i,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:e.toolbar})}_initPlaceholder(){const t=this.editor,e=t.editing.view,i=e.document.getRoot(),o=t.sourceElement,n=t.config.get("placeholder")||o&&"textarea"===o.tagName.toLowerCase()&&o.getAttribute("placeholder");n&&Jl({view:e,element:i,text:n,isDirectHost:!1})}}class oc extends xi{constructor(t=[]){super(t,{idProperty:"viewUid"}),this.on("add",(t,e,i)=>{this._renderViewIntoCollectionParent(e,i)}),this.on("remove",(t,e)=>{e.element&&this._parentElement&&e.element.remove()}),this._parentElement=null}destroy(){this.map(t=>t.destroy())}setParent(t){this._parentElement=t;for(const t of this)this._renderViewIntoCollectionParent(t)}delegate(...t){if(!t.length||!t.every(t=>"string"==typeof t))throw new hi.a("ui-viewcollection-delegate-wrong-events",this);return{to:e=>{for(const i of this)for(const o of t)i.delegate(o).to(e);this.on("add",(i,o)=>{for(const i of t)o.delegate(i).to(e)}),this.on("remove",(i,o)=>{for(const i of t)o.stopDelegating(i,e)})}}}_renderViewIntoCollectionParent(t,e){t.isRendered||t.render(),t.element&&this._parentElement&&this._parentElement.insertBefore(t.element,this._parentElement.children[e])}}class nc{constructor(t){Object.assign(this,mc(gc(t))),this._isRendered=!1,this._revertData=null}render(){const t=this._renderNode({intoFragment:!0});return this._isRendered=!0,t}apply(t){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:t,isApplying:!0,revertData:this._revertData}),t}revert(t){if(!this._revertData)throw new hi.a("ui-template-revert-not-applied",[this,t]);this._revertTemplateFromNode(t,this._revertData)}*getViews(){yield*function*t(e){if(e.children)for(const i of e.children)kc(i)?yield i:_c(i)&&(yield*t(i))}(this)}static bind(t,e){return{to:(i,o)=>new sc({eventNameOrFunction:i,attribute:i,observable:t,emitter:e,callback:o}),if:(i,o,n)=>new ac({observable:t,emitter:e,attribute:i,valueIfTrue:o,callback:n})}}static extend(t,e){if(t._isRendered)throw new hi.a("template-extend-render",[this,t]);!function t(e,i){i.attributes&&(e.attributes||(e.attributes={}),bc(e.attributes,i.attributes));i.eventListeners&&(e.eventListeners||(e.eventListeners={}),bc(e.eventListeners,i.eventListeners));i.text&&e.text.push(...i.text);if(i.children&&i.children.length){if(e.children.length!=i.children.length)throw new hi.a("ui-template-extend-children-mismatch",e);let o=0;for(const n of i.children)t(e.children[o++],n)}}(t,mc(gc(e)))}_renderNode(t){let e;if(e=t.node?this.tag&&this.text:this.tag?this.text:!this.text,e)throw new hi.a("ui-template-wrong-syntax",this);return this.text?this._renderText(t):this._renderElement(t)}_renderElement(t){let e=t.node;return e||(e=t.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(t),this._renderElementChildren(t),this._setUpListeners(t),e}_renderText(t){let e=t.node;return e?t.revertData.text=e.textContent:e=t.node=document.createTextNode(""),lc(this.text)?this._bindToObservable({schema:this.text,updater:dc(e),data:t}):e.textContent=this.text.join(""),e}_renderAttributes(t){let e,i,o,n;if(!this.attributes)return;const r=t.node,s=t.revertData;for(e in this.attributes)if(o=r.getAttribute(e),i=this.attributes[e],s&&(s.attributes[e]=o),n=D(i[0])&&i[0].ns?i[0].ns:null,lc(i)){const a=n?i[0].value:i;s&&yc(e)&&a.unshift(o),this._bindToObservable({schema:a,updater:hc(r,e,n),data:t})}else"style"==e&&"string"!=typeof i[0]?this._renderStyleAttribute(i[0],t):(s&&o&&yc(e)&&i.unshift(o),i=i.map(t=>t&&t.value||t).reduce((t,e)=>t.concat(e),[]).reduce(pc,""),wc(i)||r.setAttributeNS(n,e,i))}_renderStyleAttribute(t,e){const i=e.node;for(const o in t){const n=t[o];lc(n)?this._bindToObservable({schema:[n],updater:uc(i,o),data:e}):i.style[o]=n}}_renderElementChildren(t){const e=t.node,i=t.intoFragment?document.createDocumentFragment():e,o=t.isApplying;let n=0;for(const r of this.children)if(vc(r)){if(!o){r.setParent(e);for(const t of r)i.appendChild(t.element)}}else if(kc(r))o||(r.isRendered||r.render(),i.appendChild(r.element));else if(tr(r))i.appendChild(r);else if(o){const e={children:[],bindings:[],attributes:{}};t.revertData.children.push(e),r._renderNode({node:i.childNodes[n++],isApplying:!0,revertData:e})}else i.appendChild(r.render());t.intoFragment&&e.appendChild(i)}_setUpListeners(t){if(this.eventListeners)for(const e in this.eventListeners){const i=this.eventListeners[e].map(i=>{const[o,n]=e.split("@");return i.activateDomEventListener(o,n,t)});t.revertData&&t.revertData.bindings.push(i)}}_bindToObservable({schema:t,updater:e,data:i}){const o=i.revertData;cc(t,e,i);const n=t.filter(t=>!wc(t)).filter(t=>t.observable).map(o=>o.activateAttributeListener(t,e,i));o&&o.bindings.push(n)}_revertTemplateFromNode(t,e){for(const t of e.bindings)for(const e of t)e();if(e.text)t.textContent=e.text;else{for(const i in e.attributes){const o=e.attributes[i];null===o?t.removeAttribute(i):t.setAttribute(i,o)}for(let i=0;icc(t,e,i);return this.emitter.listenTo(this.observable,"change:"+this.attribute,o),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,o)}}}class sc extends rc{activateDomEventListener(t,e,i){const o=(t,i)=>{e&&!i.target.matches(e)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(i):this.observable.fire(this.eventNameOrFunction,i))};return this.emitter.listenTo(i.node,t,o),()=>{this.emitter.stopListening(i.node,t,o)}}}class ac extends rc{getValue(t){return!wc(super.getValue(t))&&(this.valueIfTrue||!0)}}function lc(t){return!!t&&(t.value&&(t=t.value),Array.isArray(t)?t.some(lc):t instanceof rc)}function cc(t,e,{node:i}){let o=function(t,e){return t.map(t=>t instanceof rc?t.getValue(e):t)}(t,i);o=1==t.length&&t[0]instanceof ac?o[0]:o.reduce(pc,""),wc(o)?e.remove():e.set(o)}function dc(t){return{set(e){t.textContent=e},remove(){t.textContent=""}}}function hc(t,e,i){return{set(o){t.setAttributeNS(i,e,o)},remove(){t.removeAttributeNS(i,e)}}}function uc(t,e){return{set(i){t.style[e]=i},remove(){t.style[e]=null}}}function gc(t){return ei(t,t=>{if(t&&(t instanceof rc||_c(t)||kc(t)||vc(t)))return t})}function mc(t){if("string"==typeof t?t=function(t){return{text:[t]}}(t):t.text&&function(t){t.text=Ti(t.text)}(t),t.on&&(t.eventListeners=function(t){for(const e in t)fc(t,e);return t}(t.on),delete t.on),!t.text){t.attributes&&function(t){for(const e in t)t[e].value&&(t[e].value=Ti(t[e].value)),fc(t,e)}(t.attributes);const e=[];if(t.children)if(vc(t.children))e.push(t.children);else for(const i of t.children)_c(i)||kc(i)||tr(i)?e.push(i):e.push(new nc(i));t.children=e}return t}function fc(t,e){t[e]=Ti(t[e])}function pc(t,e){return wc(e)?t:wc(t)?e:`${t} ${e}`}function bc(t,e){for(const i in e)t[i]?t[i].push(...e[i]):t[i]=e[i]}function wc(t){return!t&&0!==t}function kc(t){return t instanceof xc}function _c(t){return t instanceof nc}function vc(t){return t instanceof oc}function yc(t){return"class"==t||"style"==t}i(16);class xc{constructor(t){this.element=null,this.isRendered=!1,this.locale=t,this.t=t&&t.t,this._viewCollections=new xi,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(e,i)=>{i.locale=t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=nc.bind(this,this)}createCollection(t){const e=new oc(t);return this._viewCollections.add(e),e}registerChild(t){vi(t)||(t=[t]);for(const e of t)this._unboundChildren.add(e)}deregisterChild(t){vi(t)||(t=[t]);for(const e of t)this._unboundChildren.remove(e)}setTemplate(t){this.template=new nc(t)}extendTemplate(t){nc.extend(this.template,t)}render(){if(this.isRendered)throw new hi.a("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(t=>t.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}yi(xc,mr),yi(xc,Uo);var Ac=function(t){return"string"==typeof t||!Ot(t)&&p(t)&&"[object String]"==g(t)};function Tc(t,e,i={},o=[]){const n=i&&i.xmlns,r=n?t.createElementNS(n,e):t.createElement(e);for(const t in i)r.setAttribute(t,i[t]);!Ac(o)&&vi(o)||(o=[o]);for(let e of o)Ac(e)&&(e=t.createTextNode(e)),r.appendChild(e);return r}class Cc extends oc{constructor(t,e=[]){super(e),this.locale=t}attachToDom(){this._bodyCollectionContainer=new nc({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let t=document.querySelector(".ck-body-wrapper");t||(t=Tc(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(t)),t.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const t=document.querySelector(".ck-body-wrapper");t&&0==t.childElementCount&&t.remove()}}i(18);class Sc extends xc{constructor(t){super(t),this.body=new Cc(t)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}i(20);class Pc extends xc{constructor(t){super(t),this.set("text"),this.set("for"),this.id="ck-editor__label_"+ci();const e=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:e.to("for")},children:[{text:e.to("text")}]})}}class Ec extends Sc{constructor(t){super(t),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:t.uiLanguageDirection,lang:t.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){const t=this.t,e=new Pc;return e.text=t("Rich Text Editor"),e.extendTemplate({attributes:{class:"ck-voice-label"}}),e}}class Mc extends xc{constructor(t,e,i){super(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:t.contentLanguage,dir:t.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=e}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const t=this._editingView;function e(e){t.change(i=>{const o=t.document.getRoot(e.name);i.addClass(e.isFocused?"ck-focused":"ck-blurred",o),i.removeClass(e.isFocused?"ck-blurred":"ck-focused",o)})}t.isRenderingInProgress?function i(o){t.once("change:isRenderingInProgress",(t,n,r)=>{r?i(o):e(o)})}(this):e(this)}}class Lc extends Mc{constructor(t,e,i){super(t,e,i),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const t=this._editingView,e=this.t;t.change(i=>{const o=t.document.getRoot(this.name);i.setAttribute("aria-label",e("Rich Text Editor, %0",this.name),o)})}}function Ic(t){return e=>e+t}i(22);const Nc=Ic("px");class zc extends xc{constructor(t){super(t);const e=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new nc({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:e.to("isSticky",t=>t?"block":"none"),height:e.to("isSticky",t=>t?Nc(this._panelRect.height):null)}}}).render(),this._contentPanel=new nc({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",e.if("isSticky","ck-sticky-panel__content_sticky"),e.if("_isStickyToTheLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:e.to("isSticky",t=>t?Nc(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:e.to("_hasViewportTopOffset",t=>t?Nc(this.viewportTopOffset):null),bottom:e.to("_isStickyToTheLimiter",t=>t?Nc(this.limiterBottomOffset):null),marginLeft:e.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render(),this._checkIfShouldBeSticky(),this.listenTo(rr.window,"scroll",()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const t=this._panelRect=this._contentPanel.getBoundingClientRect();let e;this.limiterElement?(e=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&e.top{this[e](),i()})}}get first(){return this.focusables.find(Rc)||null}get last(){return this.focusables.filter(Rc).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let t=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((e,i)=>{const o=e.element===this.focusTracker.focusedElement;return o&&(t=i),o}),t)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(t){t&&t.focus()}_getFocusableItem(t){const e=this.current,i=this.focusables.length;if(!i)return null;if(null===e)return this[1===t?"first":"last"];let o=(e+i+t)%i;do{const e=this.focusables.get(o);if(Rc(e))return e;o=(o+i+t)%i}while(o!==e);return null}}function Rc(t){return!(!t.focus||"none"==rr.window.getComputedStyle(t.element).display)}class Dc extends xc{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class Vc extends xc{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}class jc{constructor(t,e){jc._observerInstance||jc._createObserver(),this._element=t,this._callback=e,jc._addElementCallback(t,e),jc._observerInstance.observe(t)}destroy(){jc._deleteElementCallback(this._element,this._callback)}static _addElementCallback(t,e){jc._elementCallbacks||(jc._elementCallbacks=new Map);let i=jc._elementCallbacks.get(t);i||(i=new Set,jc._elementCallbacks.set(t,i)),i.add(e)}static _deleteElementCallback(t,e){const i=jc._getElementCallbacks(t);i&&(i.delete(e),i.size||(jc._elementCallbacks.delete(t),jc._observerInstance.unobserve(t))),jc._elementCallbacks&&!jc._elementCallbacks.size&&(jc._observerInstance=null,jc._elementCallbacks=null)}static _getElementCallbacks(t){return jc._elementCallbacks?jc._elementCallbacks.get(t):null}static _createObserver(){let t;t="function"==typeof rr.window.ResizeObserver?rr.window.ResizeObserver:Bc,jc._observerInstance=new t(t=>{for(const e of t){const t=jc._getElementCallbacks(e.target);if(t)for(const i of t)i(e)}})}}jc._observerInstance=null,jc._elementCallbacks=null;class Bc{constructor(t){this._callback=t,this._elements=new Set,this._previousRects=new Map,this._periodicCheckTimeout=null}observe(t){this._elements.add(t),this._checkElementRectsAndExecuteCallback(),1===this._elements.size&&this._startPeriodicCheck()}unobserve(t){this._elements.delete(t),this._previousRects.delete(t),this._elements.size||this._stopPeriodicCheck()}_startPeriodicCheck(){const t=()=>{this._checkElementRectsAndExecuteCallback(),this._periodicCheckTimeout=setTimeout(t,100)};this.listenTo(rr.window,"resize",()=>{this._checkElementRectsAndExecuteCallback()}),this._periodicCheckTimeout=setTimeout(t,100)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout),this.stopListening(),this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const t=[];for(const e of this._elements)this._hasRectChanged(e)&&t.push({target:e,contentRect:this._previousRects.get(e)});t.length&&this._callback(t)}_hasRectChanged(t){if(!t.ownerDocument.body.contains(t))return!1;const e=new ns(t),i=this._previousRects.get(t),o=!i||!i.isEqual(e);return this._previousRects.set(t,e),o}}yi(Bc,mr);class Fc extends xc{constructor(t){super(t);const e=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",e.to("position",t=>"ck-dropdown__panel_"+t),e.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:e.to(t=>t.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const t=this.children.last;"function"==typeof t.focusLast?t.focusLast():t.focus()}}}i(24);function Hc({element:t,target:e,positions:i,limiter:o,fitInViewport:n}){j(e)&&(e=e()),j(o)&&(o=o());const r=function(t){return t&&t.parentNode?t.offsetParent===rr.document.body?null:t.offsetParent:null}(t),s=new ns(t),a=new ns(e);let l,c;if(o||n){const t=function(t,e){const{elementRect:i,viewportRect:o}=e,n=i.getArea(),r=function(t,{targetRect:e,elementRect:i,limiterRect:o,viewportRect:n}){const r=[],s=i.getArea();for(const a of t){const t=Uc(a,e,i);if(!t)continue;const[l,c]=t;let d=0,h=0;if(o)if(n){const t=o.getIntersection(n);t&&(d=t.getIntersectionArea(c))}else d=o.getIntersectionArea(c);n&&(h=n.getIntersectionArea(c));const u={positionName:l,positionRect:c,limiterIntersectArea:d,viewportIntersectArea:h};if(d===s)return[u];r.push(u)}return r}(t,e);if(o){const t=qc(r.filter(({viewportIntersectArea:t})=>t===n),n);if(t)return t}return qc(r,n)}(i,{targetRect:a,elementRect:s,limiterRect:o&&new ns(o).getVisible(),viewportRect:n&&new ns(rr.window)});[c,l]=t||Uc(i[0],a,s)}else[c,l]=Uc(i[0],a,s);let d=Wc(l);return r&&(d=function({left:t,top:e},i){const o=Wc(new ns(i)),n=is(i);return t-=o.left,e-=o.top,t+=i.scrollLeft,e+=i.scrollTop,t-=n.left,e-=n.top,{left:t,top:e}}(d,r)),{left:d.left,top:d.top,name:c}}function Uc(t,e,i){const o=t(e,i);if(!o)return null;const{left:n,top:r,name:s}=o;return[s,i.clone().moveTo(n,r)]}function qc(t,e){let i,o,n=0;for(const{positionName:r,positionRect:s,limiterIntersectArea:a,viewportIntersectArea:l}of t){if(a===e)return[r,s];const t=l**2+a**2;t>n&&(n=t,i=s,o=r)}return i?[o,i]:null}function Wc({left:t,top:e}){const{scrollX:i,scrollY:o}=rr.window;return{left:t+i,top:e+o}}class $c extends xc{constructor(t,e,i){super(t);const o=this.bindTemplate;this.buttonView=e,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("id"),this.set("panelPosition","auto"),this.keystrokes=new jl,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.to("class"),o.if("isEnabled","ck-disabled",t=>!t)],id:o.to("id"),"aria-describedby":o.to("ariaDescribedById")},children:[e,i]}),e.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",()=>{this.isOpen&&("auto"===this.panelPosition?this.panelView.position=$c._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)}),this.keystrokes.listenTo(this.element);const t=(t,e)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,e())};this.keystrokes.set("arrowdown",(t,e)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,e())}),this.keystrokes.set("arrowright",(t,e)=>{this.isOpen&&e()}),this.keystrokes.set("arrowleft",t),this.keystrokes.set("esc",t)}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:t,southWest:e,northEast:i,northWest:o}=$c.defaultPanelPositions;return"ltr"===this.locale.uiLanguageDirection?[t,e,i,o]:[e,t,o,i]}}$c.defaultPanelPositions={southEast:t=>({top:t.bottom,left:t.left,name:"se"}),southWest:(t,e)=>({top:t.bottom,left:t.left-e.width+t.width,name:"sw"}),northEast:(t,e)=>({top:t.top-e.height,left:t.left,name:"ne"}),northWest:(t,e)=>({top:t.bottom-e.height,left:t.left-e.width+t.width,name:"nw"})},$c._getOptimalPosition=Hc;i(26);class Gc extends xc{constructor(){super();const t=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:t.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const t=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),e=t.getAttribute("viewBox");for(e&&(this.viewBox=e),this.element.innerHTML="";t.childNodes.length>0;)this.element.appendChild(t.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(t=>{t.style.fill=this.fillColor})}}i(28);class Yc extends xc{constructor(t){super(t),this.set("text",""),this.set("position","s");const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",e.to("position",t=>"ck-tooltip_"+t),e.if("text","ck-hidden",t=>!t.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:e.to("text")}]}]})}}i(30);class Kc extends xc{constructor(t){super(t);const e=this.bindTemplate,i=ci();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(i),this.iconView=new Gc,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this)),this.setTemplate({tag:"button",attributes:{class:["ck","ck-button",e.to("class"),e.if("isEnabled","ck-disabled",t=>!t),e.if("isVisible","ck-hidden",t=>!t),e.to("isOn",t=>t?"ck-on":"ck-off"),e.if("withText","ck-button_with-text"),e.if("withKeystroke","ck-button_with-keystroke")],type:e.to("type",t=>t||"button"),tabindex:e.to("tabindex"),"aria-labelledby":"ck-editor__aria-label_"+i,"aria-disabled":e.if("isEnabled",!0,t=>!t),"aria-pressed":e.to("isOn",t=>!!this.isToggleable&&String(t))},children:this.children,on:{mousedown:e.to(t=>{t.preventDefault()}),click:e.to(t=>{this.isEnabled?this.fire("execute"):t.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView),this.withKeystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createTooltipView(){const t=new Yc;return t.bind("text").to(this,"_tooltipString"),t.bind("position").to(this,"tooltipPosition"),t}_createLabelView(t){const e=new xc,i=this.bindTemplate;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:i.to("labelStyle"),id:"ck-editor__aria-label_"+t},children:[{text:this.bindTemplate.to("label")}]}),e}_createKeystrokeView(){const t=new xc;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>kn(t))}]}),t}_getTooltipString(t,e,i){return t?"string"==typeof t?t:(i&&(i=kn(i)),t instanceof Function?t(e,i):`${e}${i?` (${i})`:""}`):""}}var Qc='';class Jc extends Kc{constructor(t){super(t),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const t=new Gc;return t.content=Qc,t.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),t}}i(32);class Zc extends xc{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new Yl,this.keystrokes=new jl,this._focusCycler=new Oc({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"]},children:this.items})}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class Xc extends xc{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class td extends xc{constructor(t){super(t),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}i(34);class ed extends Kc{constructor(t){super(t),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const t=new xc;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),t}}function id({emitter:t,activator:e,callback:i,contextElements:o}){t.listenTo(document,"mousedown",(t,n)=>{if(!e())return;const r="function"==typeof n.composedPath?n.composedPath():[];for(const t of o)if(t.contains(n.target)||r.includes(t))return;i()})}i(36),i(38);function od(t,e=Jc){const i=new e(t),o=new Fc(t),n=new $c(t,i,o);return i.bind("isEnabled").to(n),i instanceof Jc?i.bind("isOn").to(n,"isOpen"):i.arrowView.bind("isOn").to(n,"isOpen"),function(t){(function(t){t.on("render",()=>{id({emitter:t,activator:()=>t.isOpen,callback:()=>{t.isOpen=!1},contextElements:[t.element]})})})(t),function(t){t.on("execute",e=>{e.source instanceof ed||(t.isOpen=!1)})}(t),function(t){t.keystrokes.set("arrowdown",(e,i)=>{t.isOpen&&(t.panelView.focus(),i())}),t.keystrokes.set("arrowup",(e,i)=>{t.isOpen&&(t.panelView.focusLast(),i())})}(t)}(n),n}function nd(t,e){const i=t.locale,o=i.t,n=t.toolbarView=new sd(i);n.set("ariaLabel",o("Dropdown toolbar")),t.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.map(t=>n.items.add(t)),t.panelView.children.add(n),n.items.delegate("execute").to(t)}function rd(t,e){const i=t.locale,o=t.listView=new Zc(i);o.items.bindTo(e).using(({type:t,model:e})=>{if("separator"===t)return new td(i);if("button"===t||"switchbutton"===t){const o=new Xc(i);let n;return n="button"===t?new Kc(i):new ed(i),n.bind(...Object.keys(e)).to(e),n.delegate("execute").to(o),o.children.add(n),o}}),t.panelView.children.add(o),o.items.delegate("execute").to(t)}i(40);class sd extends xc{constructor(t,e){super(t);const i=this.bindTemplate,o=this.t;this.options=e||{},this.set("ariaLabel",o("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new Yl,this.keystrokes=new jl,this.set("class"),this.set("isCompact",!1),this.itemsView=new ad(t),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection(),this._focusCycler=new Oc({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:["arrowleft","arrowup"],focusNext:["arrowright","arrowdown"]}});const n=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact")];var r;this.options.shouldGroupWhenFull&&this.options.isFloating&&n.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:n,role:"toolbar","aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")}},children:this.children,on:{mousedown:(r=this,r.bindTemplate.to(t=>{t.target===r.element&&t.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new cd(this):new ld(this)}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(t,e){this.items.addMany(t.map(i=>"|"==i?new Dc:"-"==i?(this.options.shouldGroupWhenFull&&Object(hi.c)("toolbarview-line-break-ignored-when-grouping-items",t),new Vc):e.has(i)?e.create(i):void Object(hi.c)("toolbarview-item-unavailable",{name:i})).filter(t=>void 0!==t))}}class ad extends xc{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class ld{constructor(t){const e=t.bindTemplate;t.set("isVertical",!1),t.itemsView.children.bindTo(t.items).using(t=>t),t.focusables.bindTo(t.items).using(t=>t),t.extendTemplate({attributes:{class:[e.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class cd{constructor(t){this.view=t,this.viewChildren=t.children,this.viewFocusables=t.focusables,this.viewItemsView=t.itemsView,this.viewFocusTracker=t.focusTracker,this.viewLocale=t.locale,this.ungroupedItems=t.createCollection(),this.groupedItems=t.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,t.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),t.children.on("add",this._updateFocusCycleableItems.bind(this)),t.children.on("remove",this._updateFocusCycleableItems.bind(this)),t.items.on("change",(t,e)=>{const i=e.index;for(const t of e.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(t):this.ungroupedItems.remove(t);for(let t=i;tthis.ungroupedItems.length?this.groupedItems.add(o,t-this.ungroupedItems.length):this.ungroupedItems.add(o,t)}this._updateGrouping()}),t.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(t){this.viewElement=t.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(t)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!this.viewElement.offsetParent)return void(this.shouldUpdateGroupingOnNextResize=!0);const t=this.groupedItems.length;let e;for(;this._areItemsOverflowing;)this._groupLastItem(),e=!0;if(!e&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==t&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const t=this.viewElement,e=this.viewLocale.uiLanguageDirection,i=new ns(t.lastChild),o=new ns(t);if(!this.cachedPadding){const i=rr.window.getComputedStyle(t),o="ltr"===e?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(i[o])}return"ltr"===e?i.right>o.right-this.cachedPadding:i.left{t&&t===e.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),t=e.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(t){t.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new Dc),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const t=this.viewLocale,e=t.t,i=od(t);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition="ltr"===t.uiLanguageDirection?"sw":"se",nd(i,[]),i.buttonView.set({label:e("Show more items"),tooltip:!0,icon:''}),i.toolbarView.items.bindTo(this.groupedItems).using(t=>t),i}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(t=>{this.viewFocusables.add(t)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}i(42);class dd extends Ec{constructor(t,e,i={}){super(t),this.stickyPanel=new zc(t),this.toolbar=new sd(t,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),this.editable=new Lc(t,e)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class hd extends Fl{constructor(t,e){super(e),ii(t)&&(this.sourceElement=t),this.data.processor=new Wl(this.data.viewDocument),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),o=new dd(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i});this.ui=new ic(this,o),function(t){if(!j(t.updateSourceElement))throw new hi.a("attachtoform-missing-elementapi-interface",t);const e=t.sourceElement;if(e&&"textarea"===e.tagName.toLowerCase()&&e.form){let i;const o=e.form,n=()=>t.updateSourceElement();j(o.submit)&&(i=o.submit,o.submit=()=>{n(),i.apply(o)}),o.addEventListener("submit",n),t.on("destroy",()=>{o.removeEventListener("submit",n),i&&(o.submit=i)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,e={}){return new Promise(i=>{const o=new this(t,e);i(o.initPlugins().then(()=>o.ui.init(ii(t)?t:null)).then(()=>{if(!ii(t)&&e.initialData)throw new hi.a("editor-create-initial-data",null);const i=e.initialData||function(t){return ii(t)?(e=t,e instanceof HTMLTextAreaElement?e.value:e.innerHTML):t;var e}(t);return o.data.init(i)}).then(()=>o.fire("ready")).then(()=>o))})}}yi(hd,Hl),yi(hd,Ul);class ud{constructor(t){this.editor=t,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",gd,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",gd),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function gd(t){t.return=!1,t.stop()}yi(ud,Uo);class md{constructor(t){this.editor=t,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",t=>{this.isEnabled||t.stop()},{priority:"high"}),this.listenTo(t,"change:isReadOnly",(t,e,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",fd,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",fd),this.refresh())}execute(){}destroy(){this.stopListening()}}function fd(t){t.return=!1,t.stop()}function pd(t){const e=t.next();return e.done?null:e.value}yi(md,Uo);const bd=["left","right","center","justify"];function wd(t){return bd.includes(t)}function kd(t,e){return"rtl"==e.contentLanguageDirection?"right"===t:"left"===t}class _d extends md{refresh(){const t=this.editor.locale,e=pd(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!e&&this._canBeAligned(e),this.isEnabled&&e.hasAttribute("alignment")?this.value=e.getAttribute("alignment"):this.value="rtl"===t.contentLanguageDirection?"right":"left"}execute(t={}){const e=this.editor,i=e.locale,o=e.model,n=o.document,r=t.value;o.change(t=>{const e=Array.from(n.selection.getSelectedBlocks()).filter(t=>this._canBeAligned(t)),o=e[0].getAttribute("alignment");kd(r,i)||o===r||!r?function(t,e){for(const i of t)e.removeAttribute("alignment",i)}(e,t):function(t,e,i){for(const o of t)e.setAttribute("alignment",i,o)}(e,t,r)})}_canBeAligned(t){return this.editor.model.schema.checkAttribute(t,"alignment")}}class vd extends ud{static get pluginName(){return"AlignmentEditing"}constructor(t){super(t),t.config.define("alignment",{options:[...bd]})}init(){const t=this.editor,e=t.locale,i=t.model.schema,o=t.config.get("alignment.options").filter(wd);i.extend("$block",{allowAttributes:"alignment"}),t.model.schema.setAttributeProperties("alignment",{isFormatting:!0});const n=function(t){const e={model:{key:"alignment",values:t.slice()},view:{}};for(const i of t)e.view[i]={key:"style",value:{"text-align":i}};return e}(o.filter(t=>!kd(t,e)));t.conversion.attributeToAttribute(n),t.commands.add("alignment",new _d(t))}}var yd='',xd='';const Ad=new Map([["left",yd],["right",xd],["center",''],["justify",'']]);class Td extends ud{get localizedOptionTitles(){const t=this.editor.t;return{left:t("Align left"),right:t("Align right"),center:t("Align center"),justify:t("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const t=this.editor,e=t.ui.componentFactory,i=t.t,o=t.config.get("alignment.options");o.filter(wd).forEach(t=>this._addButton(t)),e.add("alignment",t=>{const n=od(t),r=o.map(t=>e.create("alignment:"+t));nd(n,r),n.buttonView.set({label:i("Text alignment"),tooltip:!0}),n.toolbarView.isVertical=!0,n.toolbarView.ariaLabel=i("Text alignment toolbar"),n.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const s="rtl"===t.contentLanguageDirection?xd:yd;return n.buttonView.bind("icon").toMany(r,"isOn",(...t)=>{const e=t.findIndex(t=>t);return e<0?s:r[e].icon}),n.bind("isEnabled").toMany(r,"isEnabled",(...t)=>t.some(t=>t)),n})}_addButton(t){const e=this.editor;e.ui.componentFactory.add("alignment:"+t,i=>{const o=e.commands.get("alignment"),n=new Kc(i);return n.set({label:this.localizedOptionTitles[t],icon:Ad.get(t),tooltip:!0,isToggleable:!0}),n.bind("isEnabled").to(o),n.bind("isOn").to(o,"value",e=>e===t),this.listenTo(n,"execute",()=>{e.execute("alignment",{value:t}),e.editing.view.focus()}),n})}}class Cd extends md{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.schema,o=e.document.selection,n=Array.from(o.getSelectedBlocks()),r=void 0===t.forceValue?!this.value:t.forceValue;e.change(t=>{if(r){const e=n.filter(t=>Sd(t)||Ed(i,t));this._applyQuote(t,e)}else this._removeQuote(t,n.filter(Sd))})}_getValue(){const t=pd(this.editor.model.document.selection.getSelectedBlocks());return!(!t||!Sd(t))}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,i=pd(t.getSelectedBlocks());return!!i&&Ed(e,i)}_removeQuote(t,e){Pd(t,e).reverse().forEach(e=>{if(e.start.isAtStart&&e.end.isAtEnd)return void t.unwrap(e.start.parent);if(e.start.isAtStart){const i=t.createPositionBefore(e.start.parent);return void t.move(e,i)}e.end.isAtEnd||t.split(e.end);const i=t.createPositionAfter(e.end.parent);t.move(e,i)})}_applyQuote(t,e){const i=[];Pd(t,e).reverse().forEach(e=>{let o=Sd(e.start);o||(o=t.createElement("blockQuote"),t.wrap(e,o)),i.push(o)}),i.reverse().reduce((e,i)=>e.nextSibling==i?(t.merge(t.createPositionAfter(e)),e):i)}}function Sd(t){return"blockQuote"==t.parent.name?t.parent:null}function Pd(t,e){let i,o=0;const n=[];for(;o{if(t.endsWith("blockQuote")&&"blockQuote"==e.name)return!1}),t.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),t.model.document.registerPostFixer(i=>{const o=t.model.document.differ.getChanges();for(const t of o)if("insert"==t.type){const o=t.position.nodeAfter;if(!o)continue;if(o.is("element","blockQuote")&&o.isEmpty)return i.remove(o),!0;if(o.is("element","blockQuote")&&!e.checkChild(t.position,o))return i.unwrap(o),!0;if(o.is("element")){const t=i.createRangeIn(o);for(const o of t.getItems())if(o.is("element","blockQuote")&&!e.checkChild(i.createPositionBefore(o),o))return i.unwrap(o),!0}}else if("remove"==t.type){const e=t.position.parent;if(e.is("element","blockQuote")&&e.isEmpty)return i.remove(e),!0}return!1})}afterInit(){const t=this.editor.commands.get("blockQuote");this.listenTo(this.editor.editing.view.document,"enter",(e,i)=>{const o=this.editor.model.document,n=o.selection.getLastPosition().parent;o.selection.isCollapsed&&n.isEmpty&&t.value&&(this.editor.execute("blockQuote"),this.editor.editing.view.scrollToTheSelection(),i.preventDefault(),e.stop())})}}i(44);class Ld extends ud{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("blockQuote",i=>{const o=t.commands.get("blockQuote"),n=new Kc(i);return n.set({label:e("Block quote"),icon:'',tooltip:!0,isToggleable:!0}),n.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(n,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),n})}}class Id extends md{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,i=e.document.selection,o=void 0===t.forceValue?!this.value:t.forceValue;e.change(t=>{if(i.isCollapsed)o?t.setSelectionAttribute(this.attributeKey,!0):t.removeSelectionAttribute(this.attributeKey);else{const n=e.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const e of n)o?t.setAttribute(this.attributeKey,o,e):t.removeAttribute(this.attributeKey,e)}})}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,i=t.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const t of i.getRanges())for(const i of t.getItems())if(e.checkAttribute(i,this.attributeKey))return i.hasAttribute(this.attributeKey);return!1}}class Nd extends ud{static get pluginName(){return"BoldEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"bold"}),t.model.schema.setAttributeProperties("bold",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"bold",view:"strong",upcastAlso:["b",t=>{const e=t.getStyle("font-weight");return e?"bold"==e||Number(e)>=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),t.commands.add("bold",new Id(t,"bold")),t.keystrokes.set("CTRL+B","bold")}}class zd extends ud{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("bold",i=>{const o=t.commands.get("bold"),n=new Kc(i);return n.set({label:e("Bold"),icon:'',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),n.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(n,"execute",()=>{t.execute("bold"),t.editing.view.focus()}),n})}}class Od{constructor(t){this.files=function(t){const e=t.files?Array.from(t.files):[],i=t.items?Array.from(t.items):[];if(e.length)return e;return i.filter(t=>"file"===t.kind).map(t=>t.getAsFile())}(t),this._native=t}get types(){return this._native.types}getData(t){return this._native.getData(t)}setData(t,e){this._native.setData(t,e)}}class Rd extends Vr{constructor(t){super(t);const e=this.document;function i(t,i){i.preventDefault();const o=i.dropRange?[i.dropRange]:Array.from(e.selection.getRanges()),n=new ai(e,"clipboardInput");e.fire(n,{dataTransfer:i.dataTransfer,targetRanges:o}),n.stop.called&&i.stopPropagation()}this.domEventType=["paste","copy","cut","drop","dragover"],this.listenTo(e,"paste",i,{priority:"low"}),this.listenTo(e,"drop",i,{priority:"low"})}onDomEvent(t){const e={dataTransfer:new Od(t.clipboardData?t.clipboardData:t.dataTransfer)};"drop"==t.type&&(e.dropRange=function(t,e){const i=e.target.ownerDocument,o=e.clientX,n=e.clientY;let r;i.caretRangeFromPoint&&i.caretRangeFromPoint(o,n)?r=i.caretRangeFromPoint(o,n):e.rangeParent&&(r=i.createRange(),r.setStart(e.rangeParent,e.rangeOffset),r.collapse(!0));return r?t.domConverter.domRangeToView(r):t.document.selection.getFirstRange()}(this.view,t)),this.fire(t.type,t,e)}}class Dd extends ud{static get pluginName(){return"PastePlainText"}init(){const t=this.editor.editing.view,e=t.document;let i=!1;t.addObserver(Rd),this.listenTo(e,"keydown",(t,e)=>{i=e.shiftKey}),this.listenTo(e,"clipboardInput",(t,e)=>{i&&(e.asPlainText=!0)},{priority:"high"})}}const Vd=["figcaption","li"];class jd extends ud{static get pluginName(){return"Clipboard"}static get requires(){return[Dd]}init(){const t=this.editor,e=t.model.document,i=t.editing.view,o=i.document;function n(i,n){const r=n.dataTransfer;n.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));o.fire("clipboardOutput",{dataTransfer:r,content:s,method:i.name})}this._htmlDataProcessor=new Wl(o),i.addObserver(Rd),this.listenTo(o,"clipboardInput",e=>{t.isReadOnly&&e.stop()},{priority:"highest"}),this.listenTo(o,"clipboardInput",(t,e)=>{const o=e.dataTransfer;let n="";var r;o.getData("text/html")?n=function(t){return t.replace(/(\s+)<\/span>/g,(t,e)=>1==e.length?" ":e)}(o.getData("text/html")):o.getData("text/plain")&&(((r=(r=o.getData("text/plain")).replace(//g,">").replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("

")||r.includes("
"))&&(r=`

${r}

`),n=r),n=this._htmlDataProcessor.toView(n);const s=new ai(this,"inputTransformation");this.fire(s,{content:n,dataTransfer:o,asPlainText:e.asPlainText}),s.stop.called&&t.stop(),i.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(t,e)=>{if(!e.content.isEmpty){const i=this.editor.data,o=this.editor.model,n=i.toModel(e.content,"$clipboardHolder");if(0==n.childCount)return;o.change(t=>{const i=o.document.selection;if(e.asPlainText||function(t,e){if(t.childCount>1)return!1;const i=t.getChild(0);if(e.isObject(i))return!1;return 0==[...i.getAttributeKeys()].length}(n,o.schema)){const e=Array.from(i.getAttributes()).filter(([t])=>o.schema.getAttributeProperties(t).isFormatting);i.isCollapsed||o.deleteContent(i,{doNotAutoparagraph:!0}),e.push(...i.getAttributes());const r=t.createRangeIn(n);for(const i of r.getItems())(i.is("$text")||i.is("$textProxy"))&&t.setAttributes(e,i)}o.insertContent(n)}),t.stop()}},{priority:"low"}),this.listenTo(o,"copy",n,{priority:"low"}),this.listenTo(o,"cut",(e,i)=>{t.isReadOnly?i.preventDefault():n(e,i)},{priority:"low"}),this.listenTo(o,"clipboardOutput",(i,o)=>{o.content.isEmpty||(o.dataTransfer.setData("text/html",this._htmlDataProcessor.toData(o.content)),o.dataTransfer.setData("text/plain",function t(e){let i="";if(e.is("$text")||e.is("$textProxy"))i=e.data;else if(e.is("element","img")&&e.hasAttribute("alt"))i=e.getAttribute("alt");else if(e.is("element","br"))i="\n";else{let o=null;for(const n of e.getChildren()){const e=t(n);o&&(o.is("containerElement")||n.is("containerElement"))&&(Vd.includes(o.name)||Vd.includes(n.name)?i+="\n":i+="\n\n"),i+=e,o=n}}return i}(o.content))),"cut"==o.method&&t.model.deleteContent(e.selection)},{priority:"low"})}}function*Bd(t,e){for(const i of e)i&&t.getAttributeProperties(i[0]).copyOnEnter&&(yield i)}class Fd extends md{execute(){const t=this.editor.model,e=t.document;t.change(i=>{!function(t,e,i,o){const n=i.isCollapsed,r=i.getFirstRange(),s=r.start.parent,a=r.end.parent;if(o.isLimit(s)||o.isLimit(a))return void(n||s!=a||t.deleteContent(i));if(n){const t=Bd(e.model.schema,i.getAttributes());Hd(e,r.start),e.setSelectionAttribute(t)}else{const o=!(r.start.isAtStart&&r.end.isAtEnd),n=s==a;t.deleteContent(i,{leaveUnmerged:o}),o&&(n?Hd(e,i.focus):e.setSelection(a,0))}}(this.editor.model,i,e.selection,t.schema),this.fire("afterExecute",{writer:i})})}}function Hd(t,e){t.split(e),t.setSelection(e.parent.nextSibling,0)}class Ud extends br{constructor(t){super(t);const e=this.document;e.on("keydown",(t,i)=>{if(this.isEnabled&&i.keyCode==pn.enter){let o;e.once("enter",t=>o=t,{priority:"highest"}),e.fire("enter",new Dr(e,i.domEvent,{isSoft:i.shiftKey})),o&&o.stop.called&&t.stop()}})}observe(){}}class qd extends ud{static get pluginName(){return"Enter"}init(){const t=this.editor,e=t.editing.view,i=e.document;e.addObserver(Ud),t.commands.add("enter",new Fd(t)),this.listenTo(i,"enter",(i,o)=>{o.preventDefault(),o.isSoft||(t.execute("enter"),e.scrollToTheSelection())},{priority:"low"})}}class Wd extends md{execute(){const t=this.editor.model,e=t.document;t.change(i=>{!function(t,e,i){const o=i.isCollapsed,n=i.getFirstRange(),r=n.start.parent,s=n.end.parent,a=r==s;if(o){const o=Bd(t.schema,i.getAttributes());$d(t,e,n.end),e.removeSelectionAttribute(i.getAttributeKeys()),e.setSelectionAttribute(o)}else{const o=!(n.start.isAtStart&&n.end.isAtEnd);t.deleteContent(i,{leaveUnmerged:o}),a?$d(t,e,i.focus):o&&e.setSelection(s,0)}}(t,i,e.selection),this.fire("afterExecute",{writer:i})})}refresh(){const t=this.editor.model,e=t.document;this.isEnabled=function(t,e){if(e.rangeCount>1)return!1;const i=e.anchor;if(!i||!t.checkChild(i,"softBreak"))return!1;const o=e.getFirstRange(),n=o.start.parent,r=o.end.parent;if((Gd(n,t)||Gd(r,t))&&n!==r)return!1;return!0}(t.schema,e.selection)}}function $d(t,e,i){const o=e.createElement("softBreak");t.insertContent(o,i),e.setSelection(o,"after")}function Gd(t,e){return!t.is("rootElement")&&(e.isLimit(t)||Gd(t.parent,e))}class Yd extends ud{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor,e=t.model.schema,i=t.conversion,o=t.editing.view,n=o.document;e.register("softBreak",{allowWhere:"$text",isInline:!0}),i.for("upcast").elementToElement({model:"softBreak",view:"br"}),i.for("downcast").elementToElement({model:"softBreak",view:(t,{writer:e})=>e.createEmptyElement("br")}),o.addObserver(Ud),t.commands.add("shiftEnter",new Wd(t)),this.listenTo(n,"enter",(e,i)=>{i.preventDefault(),i.isSoft&&(t.execute("shiftEnter"),o.scrollToTheSelection())},{priority:"low"})}}class Kd extends md{execute(){const t=this.editor.model,e=t.document.selection;let i=t.schema.getLimitElement(e);if(e.containsEntireContent(i)||!Qd(t.schema,i))do{if(i=i.parent,!i)return}while(!Qd(t.schema,i));t.change(t=>{t.setSelection(i,"in")})}}function Qd(t,e){return t.isLimit(e)&&(t.checkChild(e,"$text")||t.checkChild(e,"paragraph"))}const Jd=wn("Ctrl+A");class Zd extends ud{static get pluginName(){return"SelectAllEditing"}init(){const t=this.editor,e=t.editing.view.document;t.commands.add("selectAll",new Kd(t)),this.listenTo(e,"keydown",(e,i)=>{bn(i)===Jd&&(t.execute("selectAll"),i.preventDefault())})}}class Xd extends ud{static get pluginName(){return"SelectAllUI"}init(){const t=this.editor;t.ui.componentFactory.add("selectAll",e=>{const i=t.commands.get("selectAll"),o=new Kc(e),n=e.t;return o.set({label:n("Select all"),icon:'',keystroke:"Ctrl+A",tooltip:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),o})}}class th extends ud{static get requires(){return[Zd,Xd]}static get pluginName(){return"SelectAll"}}class eh{constructor(t,e=20){this.model=t,this.size=0,this.limit=e,this.isLocked=!1,this._changeCallback=(t,e)=>{"transparent"!=e.type&&e!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch()),this._batch}input(t){this.size+=t,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(t){this.isLocked&&!t||(this._batch=null,this.size=0)}}class ih extends md{constructor(t,e){super(t),this._buffer=new eh(t.model,e),this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(t={}){const e=this.editor.model,i=e.document,o=t.text||"",n=o.length,r=t.range?e.createSelection(t.range):i.selection,s=t.resultRange;e.enqueueChange(this._buffer.batch,t=>{this._buffer.lock(),this._batches.add(this._buffer.batch),e.deleteContent(r),o&&e.insertContent(t.createText(o,i.selection.getAttributes()),r),s?t.setSelection(s):r.is("documentSelection")||t.setSelection(r),this._buffer.unlock(),this._buffer.input(n)})}}const oh=[bn("arrowUp"),bn("arrowRight"),bn("arrowDown"),bn("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let t=112;t<=135;t++)oh.push(t);function nh(t){return!!t.ctrlKey||oh.includes(t.keyCode)}function rh(t){if(t.newChildren.length-t.oldChildren.length!=1)return;const e=function(t,e){const i=[];let o,n=0;return t.forEach(t=>{"equal"==t?(r(),n++):"insert"==t?(s("insert")?o.values.push(e[n]):(r(),o={type:"insert",index:n,values:[e[n]]}),n++):s("delete")?o.howMany++:(r(),o={type:"delete",index:n,howMany:1})}),r(),i;function r(){o&&(i.push(o),o=null)}function s(t){return o&&o.type==t}}(Jn(t.oldChildren,t.newChildren,sh),t.newChildren);if(e.length>1)return;const i=e[0];return i.values[0]&&i.values[0].is("$text")?i:void 0}function sh(t,e){return t&&t.is("$text")&&e&&e.is("$text")?t.data===e.data:t===e}class ah{constructor(t){this.editor=t,this.editing=this.editor.editing}handle(t,e){if(function(t){if(0==t.length)return!1;for(const e of t)if("children"===e.type&&!rh(e))return!0;return!1}(t))this._handleContainerChildrenMutations(t,e);else for(const i of t)this._handleTextMutation(i,e),this._handleTextNodeInsertion(i)}_handleContainerChildrenMutations(t,e){const i=function(t){const e=t.map(t=>t.node).reduce((t,e)=>t.getCommonAncestor(e,{includeSelf:!0}));if(!e)return;return e.getAncestors({includeSelf:!0,parentFirst:!0}).find(t=>t.is("containerElement")||t.is("rootElement"))}(t);if(!i)return;const o=this.editor.editing.view.domConverter.mapViewToDom(i),n=new cr(this.editor.editing.view.document),r=this.editor.data.toModel(n.domToView(o)).getChild(0),s=this.editor.editing.mapper.toModelElement(i);if(!s)return;const a=Array.from(r.getChildren()),l=Array.from(s.getChildren()),c=a[a.length-1],d=l[l.length-1],h=c&&c.is("element","softBreak"),u=d&&!d.is("element","softBreak");h&&u&&a.pop();const g=this.editor.model.schema;if(!lh(a,g)||!lh(l,g))return;const m=a.map(t=>t.is("$text")?t.data:"@").join("").replace(/\u00A0/g," "),f=l.map(t=>t.is("$text")?t.data:"@").join("").replace(/\u00A0/g," ");if(f===m)return;const p=Jn(f,m),{firstChangeAt:b,insertions:w,deletions:k}=ch(p);let _=null;e&&(_=this.editing.mapper.toModelRange(e.getFirstRange()));const v=m.substr(b,w),y=this.editor.model.createRange(this.editor.model.createPositionAt(s,b),this.editor.model.createPositionAt(s,b+k));this.editor.execute("input",{text:v,range:y,resultRange:_})}_handleTextMutation(t,e){if("text"!=t.type)return;const i=t.newText.replace(/\u00A0/g," "),o=t.oldText.replace(/\u00A0/g," ");if(o===i)return;const n=Jn(o,i),{firstChangeAt:r,insertions:s,deletions:a}=ch(n);let l=null;e&&(l=this.editing.mapper.toModelRange(e.getFirstRange()));const c=this.editing.view.createPositionAt(t.node,r),d=this.editing.mapper.toModelPosition(c),h=this.editor.model.createRange(d,d.getShiftedBy(a)),u=i.substr(r,s);this.editor.execute("input",{text:u,range:h,resultRange:l})}_handleTextNodeInsertion(t){if("children"!=t.type)return;const e=rh(t),i=this.editing.view.createPositionAt(t.node,e.index),o=this.editing.mapper.toModelPosition(i),n=e.values[0].data;this.editor.execute("input",{text:n.replace(/\u00A0/g," "),range:this.editor.model.createRange(o)})}}function lh(t,e){return t.every(t=>e.isInline(t))}function ch(t){let e=null,i=null;for(let o=0;o{i.deleteContent(i.document.selection)}),t.unlock()}gn.isAndroid?o.document.on("beforeinput",(t,e)=>r(e),{priority:"lowest"}):o.document.on("keydown",(t,e)=>r(e),{priority:"lowest"}),o.document.on("compositionstart",(function(){const t=i.document,e=1!==t.selection.rangeCount||t.selection.getFirstRange().isFlat;if(t.selection.isCollapsed||e)return;s()}),{priority:"lowest"}),o.document.on("compositionend",()=>{e=i.createSelection(i.document.selection)},{priority:"lowest"})}(t),function(t){t.editing.view.document.on("mutations",(e,i,o)=>{new ah(t).handle(i,o)})}(t)}isInput(t){return this.editor.commands.get("input")._batches.has(t)}}class hh extends md{constructor(t,e){super(t),this.direction=e,this._buffer=new eh(t.model,t.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(t={}){const e=this.editor.model,i=e.document;e.enqueueChange(this._buffer.batch,o=>{this._buffer.lock();const n=o.createSelection(t.selection||i.selection),r=n.isCollapsed;if(n.isCollapsed&&e.modifySelection(n,{direction:this.direction,unit:t.unit}),this._shouldEntireContentBeReplacedWithParagraph(t.sequence||1))return void this._replaceEntireContentWithParagraph(o);if(n.isCollapsed)return;let s=0;n.getFirstRange().getMinimalFlatRanges().forEach(t=>{s+=on(t.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),e.deleteContent(n,{doNotResetEntireContent:r,direction:this.direction}),this._buffer.input(s),o.setSelection(n),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;const e=this.editor.model,i=e.document.selection,o=e.schema.getLimitElement(i);if(!(i.isCollapsed&&i.containsEntireContent(o)))return!1;if(!e.schema.checkChild(o,"paragraph"))return!1;const n=o.getChild(0);return!n||"paragraph"!==n.name}_replaceEntireContentWithParagraph(t){const e=this.editor.model,i=e.document.selection,o=e.schema.getLimitElement(i),n=t.createElement("paragraph");t.remove(t.createRangeIn(o)),t.insert(n,o),t.setSelection(n,0)}}class uh extends br{constructor(t){super(t);const e=t.document;let i=0;function o(t,i,o){let n;e.once("delete",t=>n=t,{priority:Number.POSITIVE_INFINITY}),e.fire("delete",new Dr(e,i,o)),n&&n.stop.called&&t.stop()}e.on("keyup",(t,e)=>{e.keyCode!=pn.delete&&e.keyCode!=pn.backspace||(i=0)}),e.on("keydown",(t,e)=>{const n={};if(e.keyCode==pn.delete)n.direction="forward",n.unit="character";else{if(e.keyCode!=pn.backspace)return;n.direction="backward",n.unit="codePoint"}const r=gn.isMac?e.altKey:e.ctrlKey;n.unit=r?"word":n.unit,n.sequence=++i,o(t,e.domEvent,n)}),gn.isAndroid&&e.on("beforeinput",(e,i)=>{if("deleteContentBackward"!=i.domEvent.inputType)return;const n={unit:"codepoint",direction:"backward",sequence:1},r=i.domTarget.ownerDocument.defaultView.getSelection();r.anchorNode==r.focusNode&&r.anchorOffset+1!=r.focusOffset&&(n.selectionToRemove=t.domConverter.domSelectionToView(r)),o(e,i.domEvent,n)})}observe(){}}class gh extends ud{static get pluginName(){return"Delete"}init(){const t=this.editor,e=t.editing.view,i=e.document;if(e.addObserver(uh),t.commands.add("forwardDelete",new hh(t,"forward")),t.commands.add("delete",new hh(t,"backward")),this.listenTo(i,"delete",(i,o)=>{const n={unit:o.unit,sequence:o.sequence};if(o.selectionToRemove){const e=t.model.createSelection(),i=[];for(const e of o.selectionToRemove.getRanges())i.push(t.editing.mapper.toModelRange(e));e.setTo(i),n.selection=e}t.execute("forward"==o.direction?"forwardDelete":"delete",n),o.preventDefault(),e.scrollToTheSelection()}),gn.isAndroid){let t=null;this.listenTo(i,"delete",(e,i)=>{const o=i.domTarget.ownerDocument.defaultView.getSelection();t={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}},{priority:"lowest"}),this.listenTo(i,"keyup",(e,i)=>{if(t){const e=i.domTarget.ownerDocument.defaultView.getSelection();e.collapse(t.anchorNode,t.anchorOffset),e.extend(t.focusNode,t.focusOffset),t=null}})}}}class mh extends ud{static get requires(){return[dh,gh]}static get pluginName(){return"Typing"}}const fh=new Map;function ph(t,e,i){let o=fh.get(t);o||(o=new Map,fh.set(t,o)),o.set(e,i)}function bh(t){return[t]}function wh(t,e,i={}){const o=function(t,e){const i=fh.get(t);return i&&i.has(e)?i.get(e):bh}(t.constructor,e.constructor);try{return o(t=t.clone(),e,i)}catch(t){throw t}}function kh(t,e,i){t=t.slice(),e=e.slice();const o=new _h(i.document,i.useRelations,i.forceWeakRemove);o.setOriginalOperations(t),o.setOriginalOperations(e);const n=o.originalOperations;if(0==t.length||0==e.length)return{operationsA:t,operationsB:e,originalOperations:n};const r=new WeakMap;for(const e of t)r.set(e,0);const s={nextBaseVersionA:t[t.length-1].baseVersion+1,nextBaseVersionB:e[e.length-1].baseVersion+1,originalOperationsACount:t.length,originalOperationsBCount:e.length};let a=0;for(;a{if(t.key===e.key&&t.range.start.hasSameParentAs(e.range.start)){const o=t.range.getDifference(e.range).map(e=>new $a(e,t.key,t.oldValue,t.newValue,0)),n=t.range.getIntersection(e.range);return n&&i.aIsStrong&&o.push(new $a(n,e.key,e.newValue,t.newValue,0)),0==o.length?[new kl(0)]:o}return[t]}),ph($a,Ka,(t,e)=>{if(t.range.start.hasSameParentAs(e.position)&&t.range.containsPosition(e.position)){const i=t.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map(e=>new $a(e,t.key,t.oldValue,t.newValue,t.baseVersion));if(e.shouldReceiveAttributes){const o=xh(e,t.key,t.oldValue);o&&i.unshift(o)}return i}return t.range=t.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[t]}),ph($a,Xa,(t,e)=>{const i=[];t.range.start.hasSameParentAs(e.deletionPosition)&&(t.range.containsPosition(e.deletionPosition)||t.range.start.isEqual(e.deletionPosition))&&i.push(Es._createFromPositionAndShift(e.graveyardPosition,1));const o=t.range._getTransformedByMergeOperation(e);return o.isCollapsed||i.push(o),i.map(e=>new $a(e,t.key,t.oldValue,t.newValue,t.baseVersion))}),ph($a,Ya,(t,e)=>function(t,e){const i=Es._createFromPositionAndShift(e.sourcePosition,e.howMany);let o=null,n=[];i.containsRange(t,!0)?o=t:t.start.hasSameParentAs(i.start)?(n=t.getDifference(i),o=t.getIntersection(i)):n=[t];const r=[];for(let t of n){t=t._getTransformedByDeletion(e.sourcePosition,e.howMany);const i=e.getMovedRangeStart(),o=t.start.hasSameParentAs(i);t=t._getTransformedByInsertion(i,e.howMany,o),r.push(...t)}o&&r.push(o._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,!1)[0]);return r}(t.range,e).map(e=>new $a(e,t.key,t.oldValue,t.newValue,t.baseVersion))),ph($a,tl,(t,e)=>{if(t.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.range.end.offset++,[t];if(t.range.start.hasSameParentAs(e.splitPosition)&&t.range.containsPosition(e.splitPosition)){const i=t.clone();return i.range=new Es(e.moveTargetPosition.clone(),t.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),t.range.end=e.splitPosition.clone(),t.range.end.stickiness="toPrevious",[t,i]}return t.range=t.range._getTransformedBySplitOperation(e),[t]}),ph(Ka,$a,(t,e)=>{const i=[t];if(t.shouldReceiveAttributes&&t.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(t.position)){const o=xh(t,e.key,e.newValue);o&&i.push(o)}return i}),ph(Ka,Ka,(t,e,i)=>(t.position.isEqual(e.position)&&i.aIsStrong||(t.position=t.position._getTransformedByInsertOperation(e)),[t])),ph(Ka,Ya,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t])),ph(Ka,tl,(t,e)=>(t.position=t.position._getTransformedBySplitOperation(e),[t])),ph(Ka,Xa,(t,e)=>(t.position=t.position._getTransformedByMergeOperation(e),[t])),ph(Qa,Ka,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByInsertOperation(e)[0]),t.newRange&&(t.newRange=t.newRange._getTransformedByInsertOperation(e)[0]),[t])),ph(Qa,Qa,(t,e,i)=>{if(t.name==e.name){if(!i.aIsStrong)return[new kl(0)];t.oldRange=e.newRange?e.newRange.clone():null}return[t]}),ph(Qa,Xa,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByMergeOperation(e)),t.newRange&&(t.newRange=t.newRange._getTransformedByMergeOperation(e)),[t])),ph(Qa,Ya,(t,e,i)=>{if(t.oldRange&&(t.oldRange=Es._createFromRanges(t.oldRange._getTransformedByMoveOperation(e))),t.newRange){if(i.abRelation){const o=Es._createFromRanges(t.newRange._getTransformedByMoveOperation(e));if("left"==i.abRelation.side&&e.targetPosition.isEqual(t.newRange.start))return t.newRange.start.path=i.abRelation.path,t.newRange.end=o.end,[t];if("right"==i.abRelation.side&&e.targetPosition.isEqual(t.newRange.end))return t.newRange.start=o.start,t.newRange.end.path=i.abRelation.path,[t]}t.newRange=Es._createFromRanges(t.newRange._getTransformedByMoveOperation(e))}return[t]}),ph(Qa,tl,(t,e,i)=>{if(t.oldRange&&(t.oldRange=t.oldRange._getTransformedBySplitOperation(e)),t.newRange){if(i.abRelation){const o=t.newRange._getTransformedBySplitOperation(e);return t.newRange.start.isEqual(e.splitPosition)&&i.abRelation.wasStartBeforeMergedElement?t.newRange.start=Ts._createAt(e.insertionPosition):t.newRange.start.isEqual(e.splitPosition)&&!i.abRelation.wasInLeftElement&&(t.newRange.start=Ts._createAt(e.moveTargetPosition)),t.newRange.end.isEqual(e.splitPosition)&&i.abRelation.wasInRightElement?t.newRange.end=Ts._createAt(e.moveTargetPosition):t.newRange.end.isEqual(e.splitPosition)&&i.abRelation.wasEndBeforeMergedElement?t.newRange.end=Ts._createAt(e.insertionPosition):t.newRange.end=o.end,[t]}t.newRange=t.newRange._getTransformedBySplitOperation(e)}return[t]}),ph(Xa,Ka,(t,e)=>(t.sourcePosition.hasSameParentAs(e.position)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByInsertOperation(e),t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e),[t])),ph(Xa,Xa,(t,e,i)=>{if(t.sourcePosition.isEqual(e.sourcePosition)&&t.targetPosition.isEqual(e.targetPosition)){if(i.bWasUndone){const i=e.graveyardPosition.path.slice();return i.push(0),t.sourcePosition=new Ts(e.graveyardPosition.root,i),t.howMany=0,[t]}return[new kl(0)]}if(t.sourcePosition.isEqual(e.sourcePosition)&&!t.targetPosition.isEqual(e.targetPosition)&&!i.bWasUndone&&"splitAtSource"!=i.abRelation){const o="$graveyard"==t.targetPosition.root.rootName,n="$graveyard"==e.targetPosition.root.rootName,r=o&&!n;if(n&&!o||!r&&i.aIsStrong){const i=e.targetPosition._getTransformedByMergeOperation(e),o=t.targetPosition._getTransformedByMergeOperation(e);return[new Ya(i,t.howMany,o,0)]}return[new kl(0)]}return t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMergeOperation(e),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),t.graveyardPosition.isEqual(e.graveyardPosition)&&i.aIsStrong||(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]}),ph(Xa,Ya,(t,e,i)=>{const o=Es._createFromPositionAndShift(e.sourcePosition,e.howMany);return"remove"==e.type&&!i.bWasUndone&&!i.forceWeakRemove&&t.deletionPosition.hasSameParentAs(e.sourcePosition)&&o.containsPosition(t.sourcePosition)?[new kl(0)]:(t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition.hasSameParentAs(e.sourcePosition)&&(t.howMany-=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMoveOperation(e),t.targetPosition=t.targetPosition._getTransformedByMoveOperation(e),t.graveyardPosition.isEqual(e.targetPosition)||(t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)),[t])}),ph(Xa,tl,(t,e,i)=>{if(e.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),t.deletionPosition.isEqual(e.graveyardPosition)&&(t.howMany=e.howMany)),t.targetPosition.isEqual(e.splitPosition)){const o=0!=e.howMany,n=e.graveyardPosition&&t.deletionPosition.isEqual(e.graveyardPosition);if(o||n||"mergeTargetNotMoved"==i.abRelation)return t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),[t]}if(t.sourcePosition.isEqual(e.splitPosition)){if("mergeSourceNotMoved"==i.abRelation)return t.howMany=0,t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t];if("mergeSameElement"==i.abRelation||t.sourcePosition.offset>0)return t.sourcePosition=e.moveTargetPosition.clone(),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}return t.sourcePosition.hasSameParentAs(e.splitPosition)&&(t.howMany=e.splitPosition.offset),t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}),ph(Ya,Ka,(t,e)=>{const i=Es._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByInsertOperation(e,!1)[0];return t.sourcePosition=i.start,t.howMany=i.end.offset-i.start.offset,t.targetPosition.isEqual(e.position)||(t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e)),[t]}),ph(Ya,Ya,(t,e,i)=>{const o=Es._createFromPositionAndShift(t.sourcePosition,t.howMany),n=Es._createFromPositionAndShift(e.sourcePosition,e.howMany);let r,s=i.aIsStrong,a=!i.aIsStrong;if("insertBefore"==i.abRelation||"insertAfter"==i.baRelation?a=!0:"insertAfter"!=i.abRelation&&"insertBefore"!=i.baRelation||(a=!1),r=t.targetPosition.isEqual(e.targetPosition)&&a?t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):t.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Ah(t,e)&&Ah(e,t))return[e.getReversed()];if(o.containsPosition(e.targetPosition)&&o.containsRange(n,!0))return o.start=o.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),o.end=o.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Th([o],r);if(n.containsPosition(t.targetPosition)&&n.containsRange(o,!0))return o.start=o.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),o.end=o.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),Th([o],r);const l=Li(t.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return o.start=o.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),o.end=o.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Th([o],r);"remove"!=t.type||"remove"==e.type||i.aWasUndone||i.forceWeakRemove?"remove"==t.type||"remove"!=e.type||i.bWasUndone||i.forceWeakRemove||(s=!1):s=!0;const c=[],d=o.getDifference(n);for(const t of d){t.start=t.start._getTransformedByDeletion(e.sourcePosition,e.howMany),t.end=t.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const i="same"==Li(t.start.getParentPath(),e.getMovedRangeStart().getParentPath()),o=t._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,i);c.push(...o)}const h=o.getIntersection(n);return null!==h&&s&&(h.start=h.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),h.end=h.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),0===c.length?c.push(h):1==c.length?n.start.isBefore(o.start)||n.start.isEqual(o.start)?c.unshift(h):c.push(h):c.splice(1,0,h)),0===c.length?[new kl(t.baseVersion)]:Th(c,r)}),ph(Ya,tl,(t,e,i)=>{let o=t.targetPosition.clone();t.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition&&"moveTargetAfter"!=i.abRelation||(o=t.targetPosition._getTransformedBySplitOperation(e));const n=Es._createFromPositionAndShift(t.sourcePosition,t.howMany);if(n.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.howMany++,t.targetPosition=o,[t];if(n.start.hasSameParentAs(e.splitPosition)&&n.containsPosition(e.splitPosition)){let t=new Es(e.splitPosition,n.end);t=t._getTransformedBySplitOperation(e);return Th([new Es(n.start,e.splitPosition),t],o)}t.targetPosition.isEqual(e.splitPosition)&&"insertAtSource"==i.abRelation&&(o=e.moveTargetPosition),t.targetPosition.isEqual(e.insertionPosition)&&"insertBetween"==i.abRelation&&(o=t.targetPosition);const r=[n._getTransformedBySplitOperation(e)];if(e.graveyardPosition){const o=n.start.isEqual(e.graveyardPosition)||n.containsPosition(e.graveyardPosition);t.howMany>1&&o&&!i.aWasUndone&&r.push(Es._createFromPositionAndShift(e.insertionPosition,1))}return Th(r,o)}),ph(Ya,Xa,(t,e,i)=>{const o=Es._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.sourcePosition))if("remove"!=t.type||i.forceWeakRemove){if(1==t.howMany)return i.bWasUndone?(t.sourcePosition=e.graveyardPosition.clone(),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]):[new kl(0)]}else if(!i.aWasUndone){const i=[];let o=e.graveyardPosition.clone(),n=e.targetPosition._getTransformedByMergeOperation(e);t.howMany>1&&(i.push(new Ya(t.sourcePosition,t.howMany-1,t.targetPosition,0)),o=o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1),n=n._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1));const r=e.deletionPosition._getCombined(t.sourcePosition,t.targetPosition),s=new Ya(o,1,r,0),a=s.getMovedRangeStart().path.slice();a.push(0);const l=new Ts(s.targetPosition.root,a);n=n._getTransformedByMove(o,r,1);const c=new Ya(n,e.howMany,l,0);return i.push(s),i.push(c),i}const n=Es._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByMergeOperation(e);return t.sourcePosition=n.start,t.howMany=n.end.offset-n.start.offset,t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]}),ph(Ja,Ka,(t,e)=>(t.position=t.position._getTransformedByInsertOperation(e),[t])),ph(Ja,Xa,(t,e)=>t.position.isEqual(e.deletionPosition)?(t.position=e.graveyardPosition.clone(),t.position.stickiness="toNext",[t]):(t.position=t.position._getTransformedByMergeOperation(e),[t])),ph(Ja,Ya,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t])),ph(Ja,Ja,(t,e,i)=>{if(t.position.isEqual(e.position)){if(!i.aIsStrong)return[new kl(0)];t.oldName=e.newName}return[t]}),ph(Ja,tl,(t,e)=>{if("same"==Li(t.position.path,e.splitPosition.getParentPath())&&!e.graveyardPosition){const e=new Ja(t.position.getShiftedBy(1),t.oldName,t.newName,0);return[t,e]}return t.position=t.position._getTransformedBySplitOperation(e),[t]}),ph(Za,Za,(t,e,i)=>{if(t.root===e.root&&t.key===e.key){if(!i.aIsStrong||t.newValue===e.newValue)return[new kl(0)];t.oldValue=e.newValue}return[t]}),ph(tl,Ka,(t,e)=>(t.splitPosition.hasSameParentAs(e.position)&&t.splitPosition.offset{if(!t.graveyardPosition&&!i.bWasUndone&&t.splitPosition.hasSameParentAs(e.sourcePosition)){const i=e.graveyardPosition.path.slice();i.push(0);const o=new Ts(e.graveyardPosition.root,i),n=tl.getInsertionPosition(new Ts(e.graveyardPosition.root,i)),r=new tl(o,0,null,0);return r.insertionPosition=n,t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=tl.getInsertionPosition(t.splitPosition),t.graveyardPosition=r.insertionPosition.clone(),t.graveyardPosition.stickiness="toNext",[r,t]}return t.splitPosition.hasSameParentAs(e.deletionPosition)&&!t.splitPosition.isAfter(e.deletionPosition)&&t.howMany--,t.splitPosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=tl.getInsertionPosition(t.splitPosition),t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]}),ph(tl,Ya,(t,e,i)=>{const o=Es._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.graveyardPosition){const n=o.start.isEqual(t.graveyardPosition)||o.containsPosition(t.graveyardPosition);if(!i.bWasUndone&&n){const i=t.splitPosition._getTransformedByMoveOperation(e),o=t.graveyardPosition._getTransformedByMoveOperation(e),n=o.path.slice();n.push(0);const r=new Ts(o.root,n);return[new Ya(i,t.howMany,r,0)]}t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)}if(t.splitPosition.hasSameParentAs(e.sourcePosition)&&o.containsPosition(t.splitPosition)){const i=e.howMany-(t.splitPosition.offset-e.sourcePosition.offset);return t.howMany-=i,t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset{if(t.splitPosition.isEqual(e.splitPosition)){if(!t.graveyardPosition&&!e.graveyardPosition)return[new kl(0)];if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition))return[new kl(0)];if("splitBefore"==i.abRelation)return t.howMany=0,t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e),[t]}if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition)){const o="$graveyard"==t.splitPosition.root.rootName,n="$graveyard"==e.splitPosition.root.rootName,r=o&&!n;if(n&&!o||!r&&i.aIsStrong){const i=[];return e.howMany&&i.push(new Ya(e.moveTargetPosition,e.howMany,e.splitPosition,0)),t.howMany&&i.push(new Ya(t.splitPosition,t.howMany,t.moveTargetPosition,0)),i}return[new kl(0)]}if(t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e)),t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==i.abRelation)return t.howMany++,[t];if(e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==i.baRelation){const i=e.insertionPosition.path.slice();i.push(0);const o=new Ts(e.insertionPosition.root,i);return[t,new Ya(t.insertionPosition,1,o,0)]}return t.splitPosition.hasSameParentAs(e.splitPosition)&&t.splitPosition.offsetthis.clearStack())}refresh(){this.isEnabled=this._stack.length>0}addBatch(t){const e=this.editor.model.document.selection,i={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,i){const o=this.editor.model,n=o.document,r=[],s=t.map(t=>t.getTransformedByOperations(i)),a=s.flat();for(const t of s){const e=t.filter(t=>t.root!=n.graveyard).filter(t=>!Ph(t,a));e.length&&(Sh(e),r.push(e[0]))}r.length&&o.change(t=>{t.setSelection(r,{backward:e})})}_undo(t,e){const i=this.editor.model,o=i.document;this._createdBatches.add(e);const n=t.operations.slice().filter(t=>t.isDocumentOperation);n.reverse();for(const t of n){const n=t.baseVersion+1,r=Array.from(o.history.getOperations(n)),s=kh([t.getReversed()],r,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const n of s)e.addOperation(n),i.applyOperation(n),o.history.setOperationAsUndone(t,n)}}}function Sh(t){t.sort((t,e)=>t.start.isBefore(e.start)?-1:1);for(let e=1;ee!==t&&e.containsRange(t,!0))}class Eh extends Ch{execute(t=null){const e=t?this._stack.findIndex(e=>e.batch==t):this._stack.length-1,i=this._stack.splice(e,1)[0],o=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(o,()=>{this._undo(i.batch,o);const t=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,t),this.fire("revert",i.batch,o)}),this.refresh()}}class Mh extends Ch{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(e,()=>{const i=t.batch.operations[t.batch.operations.length-1].baseVersion+1,o=this.editor.model.document.history.getOperations(i);this._restoreSelection(t.selection.ranges,t.selection.isBackward,o),this._undo(t.batch,e)}),this.refresh()}}class Lh extends ud{static get pluginName(){return"UndoEditing"}constructor(t){super(t),this._batchRegistry=new WeakSet}init(){const t=this.editor;this._undoCommand=new Eh(t),this._redoCommand=new Mh(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(t,e)=>{const i=e[0];if(!i.isDocumentOperation)return;const o=i.batch,n=this._redoCommand._createdBatches.has(o),r=this._undoCommand._createdBatches.has(o);this._batchRegistry.has(o)||"transparent"==o.type&&!n&&!r||(n?this._undoCommand.addBatch(o):r||(this._undoCommand.addBatch(o),this._redoCommand.clearStack()),this._batchRegistry.add(o))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(t,e,i)=>{this._redoCommand.addBatch(i)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo")}}var Ih='',Nh='';class zh extends ud{init(){const t=this.editor,e=t.locale,i=t.t,o="ltr"==e.uiLanguageDirection?Ih:Nh,n="ltr"==e.uiLanguageDirection?Nh:Ih;this._addButton("undo",i("Undo"),"CTRL+Z",o),this._addButton("redo",i("Redo"),"CTRL+Y",n)}_addButton(t,e,i,o){const n=this.editor;n.ui.componentFactory.add(t,r=>{const s=n.commands.get(t),a=new Kc(r);return a.set({label:e,icon:o,keystroke:i,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{n.execute(t),n.editing.view.focus()}),a})}}class Oh extends ud{static get requires(){return[Lh,zh]}static get pluginName(){return"Undo"}}class Rh extends md{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=e.selection.getAttribute(this.attributeKey),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,i=e.document.selection,o=t.value;e.change(t=>{if(i.isCollapsed)o?t.setSelectionAttribute(this.attributeKey,o):t.removeSelectionAttribute(this.attributeKey);else{const n=e.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const e of n)o?t.setAttribute(this.attributeKey,o,e):t.removeAttribute(this.attributeKey,e)}})}}class Dh extends Kc{constructor(t){super(t);const e=this.bindTemplate;this.set("color"),this.set("hasBorder"),this.icon='',this.extendTemplate({attributes:{style:{backgroundColor:e.to("color")},class:["ck","ck-color-grid__tile",e.if("hasBorder","ck-color-table__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}i(46);class Vh extends xc{constructor(t,e){super(t);const i=e&&e.colorDefinitions||[],o={};e&&e.columns&&(o.gridTemplateColumns=`repeat( ${e.columns}, 1fr)`),this.set("selectedColor"),this.items=this.createCollection(),this.focusTracker=new Yl,this.keystrokes=new jl,this._focusCycler=new Oc({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowleft",focusNext:"arrowright"}}),this.items.on("add",(t,e)=>{e.isOn=e.color===this.selectedColor}),i.forEach(t=>{const e=new Dh;e.set({color:t.color,label:t.label,tooltip:!0,hasBorder:t.options.hasBorder}),e.on("execute",()=>{this.fire("execute",{value:t.color,hasBorder:t.options.hasBorder,label:t.label})}),this.items.add(e)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:o}}),this.on("change:selectedColor",(t,e,i)=>{for(const t of this.items)t.isOn=t.color===i})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}}class jh extends xi{constructor(t){super(t),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",0===this.length)})}add(t,e){this.find(e=>e.color===t.color)||super.add(t,e)}hasColor(t){return!!this.find(e=>e.color===t)}}yi(jh,Uo);var Bh='';i(48);class Fh extends xc{constructor(t,{colors:e,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r}){super(t),this.items=this.createCollection(),this.colorDefinitions=e,this.focusTracker=new Yl,this.keystrokes=new jl,this.set("selectedColor"),this.removeButtonLabel=o,this.columns=i,this.documentColors=new jh,this.documentColorsCount=r,this._focusCycler=new Oc({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this._documentColorsLabel=n,this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-table"]},children:this.items}),this.items.add(this._removeColorButton())}updateDocumentColors(t,e){const i=t.document,o=this.documentColorsCount;this.documentColors.clear();for(const n of i.getRootNames()){const r=i.getRoot(n),s=t.createRangeIn(r);for(const t of s.getItems())if(t.is("$textProxy")&&t.hasAttribute(e)&&(this._addColorToDocumentColors(t.getAttribute(e)),this.documentColors.length>=o))return}}updateSelectedColors(){const t=this.documentColorsGrid,e=this.staticColorsGrid,i=this.selectedColor;e.selectedColor=i,t&&(t.selectedColor=i)}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.keystrokes.listenTo(this.element)}appendGrids(){if(!this.staticColorsGrid&&(this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount)){const t=nc.bind(this.documentColors,this.documentColors),e=new Pc(this.locale);e.text=this._documentColorsLabel,e.extendTemplate({attributes:{class:["ck","ck-color-grid__label",t.if("isEmpty","ck-hidden")]}}),this.items.add(e),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_removeColorButton(){const t=new Kc;return t.set({withText:!0,icon:Bh,tooltip:!0,label:this.removeButtonLabel}),t.class="ck-color-table__remove-color",t.on("execute",()=>{this.fire("execute",{value:null})}),t}_createStaticColorsGrid(){const t=new Vh(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return t.delegate("execute").to(this),t}_createDocumentColorsGrid(){const t=nc.bind(this.documentColors,this.documentColors),e=new Vh(this.locale,{columns:this.columns});return e.delegate("execute").to(this),e.extendTemplate({attributes:{class:t.if("isEmpty","ck-hidden")}}),e.items.bindTo(this.documentColors).using(t=>{const e=new Dh;return e.set({color:t.color,hasBorder:t.options&&t.options.hasBorder}),t.label&&e.set({label:t.label,tooltip:!0}),e.on("execute",()=>{this.fire("execute",{value:t.color})}),e}),this.documentColors.on("change:isEmpty",(t,i,o)=>{o&&(e.selectedColor=null)}),e}_addColorToDocumentColors(t){const e=this.colorDefinitions.find(e=>e.color===t);e?this.documentColors.add(Object.assign({},e)):this.documentColors.add({color:t,label:t,options:{hasBorder:!1}})}}function Hh(t,e){const i={model:{key:t,values:[]},view:{},upcastAlso:{}};for(const t of e)i.model.values.push(t.model),i.view[t.model]=t.view,t.upcastAlso&&(i.upcastAlso[t.model]=t.upcastAlso);return i}function Uh(t){return e=>e.getStyle(t).replace(/\s/g,"")}function qh(t){return(e,{writer:i})=>i.createAttributeElement("span",{style:`${t}:${e}`},{priority:7})}class Wh extends Rh{constructor(t){super(t,"fontBackgroundColor")}}const $h=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,Gh=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,Yh=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,Kh=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,Qh=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,Jh=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 Zh(t){return t.startsWith("#")?$h.test(t):t.startsWith("rgb")?Gh.test(t)||Yh.test(t):t.startsWith("hsl")?Kh.test(t)||Qh.test(t):Jh.has(t.toLowerCase())}const Xh=["repeat-x","repeat-y","repeat","space","round","no-repeat"];const tu=["center","top","bottom","left","right"];function eu(t){return tu.includes(t)}const iu=["fixed","scroll","local"];function ou(t){return iu.includes(t)}const nu=/^url\(/;function ru(t){return nu.test(t)}function su(t){return t.replace(/, /g,",").split(" ").map(t=>t.replace(/,/g,", "))}function au(t){t.setNormalizer("background",lu),t.setNormalizer("background-color",t=>({path:"background.color",value:t})),t.setReducer("background",t=>{const e=[];return e.push(["background-color",t.color]),e})}function lu(t){const e={},i=su(t);for(const t of i)o=t,Xh.includes(o)?(e.repeat=e.repeat||[],e.repeat.push(t)):eu(t)?(e.position=e.position||[],e.position.push(t)):ou(t)?e.attachment=t:Zh(t)?e.color=t:ru(t)&&(e.image=t);var o;return{path:"background",value:e}}class cu extends ud{static get pluginName(){return"FontBackgroundColorEditing"}constructor(t){super(t),t.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}),t.data.addStyleProcessorRules(au),t.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:"fontBackgroundColor",value:Uh("background-color")}}),t.conversion.for("downcast").attributeToElement({model:"fontBackgroundColor",view:qh("background-color")}),t.commands.add("fontBackgroundColor",new Wh(t)),t.model.schema.extend("$text",{allowAttributes:"fontBackgroundColor"}),t.model.schema.setAttributeProperties("fontBackgroundColor",{isFormatting:!0,copyOnEnter:!0})}}function du(t){return"string"==typeof t?{model:t,label:t,hasBorder:!1,view:{name:"span",styles:{color:t}}}:{model:t.color,label:t.label||t.color,hasBorder:void 0!==t.hasBorder&&t.hasBorder,view:{name:"span",styles:{color:""+t.color}}}}class hu extends ud{constructor(t,{commandName:e,icon:i,componentName:o,dropdownLabel:n}){super(t),this.commandName=e,this.componentName=o,this.icon=i,this.dropdownLabel=n,this.columns=t.config.get(this.componentName+".columns"),this.colorTableView=void 0}init(){const t=this.editor,e=t.locale,i=e.t,o=t.commands.get(this.commandName);const n=function(t,e){const i=t.t,o={Black:i("Black"),"Dim grey":i("Dim grey"),Grey:i("Grey"),"Light grey":i("Light grey"),White:i("White"),Red:i("Red"),Orange:i("Orange"),Yellow:i("Yellow"),"Light green":i("Light green"),Green:i("Green"),Aquamarine:i("Aquamarine"),Turquoise:i("Turquoise"),"Light blue":i("Light blue"),Blue:i("Blue"),Purple:i("Purple")};return e.map(t=>{const e=o[t.label];return e&&e!=t.label&&(t.label=e),t})}(e,t.config.get(this.componentName).colors.map(du).filter(t=>!!t)),r=t.config.get(this.componentName+".documentColors");t.ui.componentFactory.add(this.componentName,e=>{const s=od(e);return this.colorTableView=function({dropdownView:t,colors:e,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r}){const s=t.locale,a=new Fh(s,{colors:e,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r});return t.colorTableView=a,t.panelView.children.add(a),a.delegate("execute").to(t,"execute"),a}({dropdownView:s,colors:n.map(t=>({label:t.label,color:t.model,options:{hasBorder:t.hasBorder}})),columns:this.columns,removeButtonLabel:i("Remove color"),documentColorsLabel:0!==r?i("Document colors"):void 0,documentColorsCount:void 0===r?this.columns:r}),this.colorTableView.bind("selectedColor").to(o,"value"),s.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),s.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),s.bind("isEnabled").to(o),s.on("execute",(e,i)=>{t.execute(this.commandName,i),t.editing.view.focus()}),s.on("change:isOpen",(e,i,o)=>{s.colorTableView.appendGrids(),o&&(0!==r&&this.colorTableView.updateDocumentColors(t.model,this.componentName),this.colorTableView.updateSelectedColors())}),s})}}class uu extends hu{constructor(t){super(t,{commandName:"fontBackgroundColor",componentName:"fontBackgroundColor",icon:'',dropdownLabel:(0,t.locale.t)("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class gu extends Rh{constructor(t){super(t,"fontColor")}}class mu extends ud{static get pluginName(){return"FontColorEditing"}constructor(t){super(t),t.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}),t.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:"fontColor",value:Uh("color")}}),t.conversion.for("downcast").attributeToElement({model:"fontColor",view:qh("color")}),t.commands.add("fontColor",new gu(t)),t.model.schema.extend("$text",{allowAttributes:"fontColor"}),t.model.schema.setAttributeProperties("fontColor",{isFormatting:!0,copyOnEnter:!0})}}class fu extends hu{constructor(t){super(t,{commandName:"fontColor",componentName:"fontColor",icon:'',dropdownLabel:(0,t.locale.t)("Font Color")})}static get pluginName(){return"FontColorUI"}}class pu extends Rh{constructor(t){super(t,"fontFamily")}}function bu(t){return t.map(wu).filter(t=>!!t)}function wu(t){return"object"==typeof t?t:"default"===t?{title:"Default",model:void 0}:"string"==typeof t?function(t){const e=t.replace(/"|'/g,"").split(","),i=e[0],o=e.map(ku).join(", ");return{title:i,model:o,view:{name:"span",styles:{"font-family":o},priority:7}}}(t):void 0}function ku(t){return(t=t.trim()).indexOf(" ")>0&&(t=`'${t}'`),t}class _u extends ud{static get pluginName(){return"FontFamilyEditing"}constructor(t){super(t),t.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 t=this.editor;t.model.schema.extend("$text",{allowAttributes:"fontFamily"}),t.model.schema.setAttributeProperties("fontFamily",{isFormatting:!0,copyOnEnter:!0});const e=Hh("fontFamily",bu(t.config.get("fontFamily.options")).filter(t=>t.model));t.config.get("fontFamily.supportAllValues")?this._prepareAnyValueConverters():t.conversion.attributeToElement(e),t.commands.add("fontFamily",new pu(t))}_prepareAnyValueConverters(){const t=this.editor;t.conversion.for("downcast").attributeToElement({model:"fontFamily",view:(t,{writer:e})=>e.createAttributeElement("span",{style:"font-family:"+t},{priority:7})}),t.conversion.for("upcast").attributeToAttribute({model:{key:"fontFamily",value:t=>t.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}}class vu{constructor(t,e){e&&Vo(this,e),t&&this.set(t)}}yi(vu,Uo);class yu extends ud{init(){const t=this.editor,e=t.t,i=this._getLocalizedOptions(),o=t.commands.get("fontFamily");t.ui.componentFactory.add("fontFamily",n=>{const r=od(n);return rd(r,function(t,e){const i=new xi;for(const o of t){const t={type:"button",model:new vu({commandName:"fontFamily",commandParam:o.model,label:o.title,withText:!0})};t.model.bind("isOn").to(e,"value",t=>t===o.model||!(!t||!o.model)&&t.split(",")[0].replace(/'/g,"").toLowerCase()===o.model.toLowerCase()),o.view&&o.view.styles&&t.model.set("labelStyle","font-family: "+o.view.styles["font-family"]),i.add(t)}return i}(i,o)),r.buttonView.set({label:e("Font Family"),icon:'',tooltip:!0}),r.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),r.bind("isEnabled").to(o),this.listenTo(r,"execute",e=>{t.execute(e.source.commandName,{value:e.source.commandParam}),t.editing.view.focus()}),r})}_getLocalizedOptions(){const t=this.editor,e=t.t;return bu(t.config.get("fontFamily").options).map(t=>("Default"===t.title&&(t.title=e("Default")),t))}}class xu extends Rh{constructor(t){super(t,"fontSize")}}function Au(t){return t.map(t=>function(t){if(e=t,"object"==typeof e&&e.title&&e.model&&e.view)return Cu(t);var e;const i=function(t){return Tu[t]||Tu[t.model]}(t);if(i)return Cu(i);if("default"===t)return{model:void 0,title:"Default"};if(function(t){let e;if("object"==typeof t){if(!t.model)throw new hi.a("font-size-invalid-definition",null,t);e=parseFloat(t.model)}else e=parseFloat(t);return isNaN(e)}(t))return;return function(t){"number"!=typeof t&&"string"!=typeof t||(t={title:String(t),model:parseFloat(t)+"px"});return t.view={name:"span",styles:{"font-size":t.model}},Cu(t)}(t)}(t)).filter(t=>!!t)}const Tu={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 Cu(t){return t.view.priority||(t.view.priority=7),t}class Su extends ud{static get pluginName(){return"FontSizeEditing"}constructor(t){super(t),t.config.define("fontSize",{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"fontSize"}),t.model.schema.setAttributeProperties("fontSize",{isFormatting:!0,copyOnEnter:!0});const e=t.config.get("fontSize.supportAllValues"),i=Hh("fontSize",Au(this.editor.config.get("fontSize.options")).filter(t=>t.model));e?this._prepareAnyValueConverters(i):t.conversion.attributeToElement(i),t.commands.add("fontSize",new xu(t))}_prepareAnyValueConverters(t){const e=this.editor,i=t.model.values.filter(t=>!String(t).match(/[\d.]+[\w%]+/));if(i.length)throw new hi.a("font-size-invalid-use-of-named-presets",null,{presets:i});e.conversion.for("downcast").attributeToElement({model:"fontSize",view:(t,{writer:e})=>{if(t)return e.createAttributeElement("span",{style:"font-size:"+t},{priority:7})}}),e.conversion.for("upcast").attributeToAttribute({model:{key:"fontSize",value:t=>t.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}}i(50);class Pu extends ud{init(){const t=this.editor,e=t.t,i=this._getLocalizedOptions(),o=t.commands.get("fontSize");t.ui.componentFactory.add("fontSize",n=>{const r=od(n);return rd(r,function(t,e){const i=new xi;for(const o of t){const t={type:"button",model:new vu({commandName:"fontSize",commandParam:o.model,label:o.title,class:"ck-fontsize-option",withText:!0})};o.view&&o.view.styles&&t.model.set("labelStyle","font-size:"+o.view.styles["font-size"]),o.view&&o.view.classes&&t.model.set("class",`${t.model.class} ${o.view.classes}`),t.model.bind("isOn").to(e,"value",t=>t===o.model),i.add(t)}return i}(i,o)),r.buttonView.set({label:e("Font Size"),icon:'',tooltip:!0}),r.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),r.bind("isEnabled").to(o),this.listenTo(r,"execute",e=>{t.execute(e.source.commandName,{value:e.source.commandParam}),t.editing.view.focus()}),r})}_getLocalizedOptions(){const t=this.editor,e=t.t,i={Default:e("Default"),Tiny:e("Tiny"),Small:e("Small"),Big:e("Big"),Huge:e("Huge")};return Au(t.config.get("fontSize").options).map(t=>{const e=i[t.title];return e&&e!=t.title&&(t=Object.assign({},t,{title:e})),t})}}class Eu extends md{refresh(){const t=this.editor.model,e=pd(t.document.selection.getSelectedBlocks());this.value=!!e&&e.is("element","paragraph"),this.isEnabled=!!e&&Mu(e,t.schema)}execute(t={}){const e=this.editor.model,i=e.document;e.change(o=>{const n=(t.selection||i.selection).getSelectedBlocks();for(const t of n)!t.is("element","paragraph")&&Mu(t,e.schema)&&o.rename(t,"paragraph")})}}function Mu(t,e){return e.checkChild(t.parent,"paragraph")&&!e.isObject(t)}class Lu extends md{execute(t){const e=this.editor.model;let i=t.position;e.change(t=>{const o=t.createElement("paragraph");if(!e.schema.checkChild(i.parent,o)){const n=e.schema.findAllowedParent(i,o);if(!n)return;i=t.split(i,n).position}e.insertContent(o,i),t.setSelection(o,"in")})}}class Iu extends ud{static get pluginName(){return"Paragraph"}init(){const t=this.editor,e=t.model;t.commands.add("paragraph",new Eu(t)),t.commands.add("insertParagraph",new Lu(t)),e.schema.register("paragraph",{inheritAllFrom:"$block"}),t.conversion.elementToElement({model:"paragraph",view:"p"}),t.conversion.for("upcast").elementToElement({model:(t,{writer:e})=>Iu.paragraphLikeElements.has(t.name)?t.isEmpty?null:e.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}Iu.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class Nu extends md{constructor(t,e){super(t),this.modelElements=e}refresh(){const t=pd(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some(e=>zu(t,e,this.editor.model.schema))}execute(t){const e=this.editor.model,i=e.document,o=t.value;e.change(t=>{const n=Array.from(i.selection.getSelectedBlocks()).filter(t=>zu(t,o,e.schema));for(const e of n)e.is("element",o)||t.rename(e,o)})}}function zu(t,e,i){return i.checkChild(t.parent,e)&&!i.isObject(t)}class Ou extends ud{static get pluginName(){return"HeadingEditing"}constructor(t){super(t),t.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[Iu]}init(){const t=this.editor,e=t.config.get("heading.options"),i=[];for(const o of e)"paragraph"!==o.model&&(t.model.schema.register(o.model,{inheritAllFrom:"$block"}),t.conversion.elementToElement(o),i.push(o.model));this._addDefaultH1Conversion(t),t.commands.add("heading",new Nu(t,i))}afterInit(){const t=this.editor,e=t.commands.get("enter"),i=t.config.get("heading.options");e&&this.listenTo(e,"afterExecute",(e,o)=>{const n=t.model.document.selection.getFirstPosition().parent;i.some(t=>n.is("element",t.model))&&!n.is("element","paragraph")&&0===n.childCount&&o.writer.rename(n,"paragraph")})}_addDefaultH1Conversion(t){t.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:di.get("low")+1})}}i(12);class Ru extends ud{init(){const t=this.editor,e=t.t,i=function(t){const e=t.t,i={Paragraph:e("Paragraph"),"Heading 1":e("Heading 1"),"Heading 2":e("Heading 2"),"Heading 3":e("Heading 3"),"Heading 4":e("Heading 4"),"Heading 5":e("Heading 5"),"Heading 6":e("Heading 6")};return t.config.get("heading.options").map(t=>{const e=i[t.title];return e&&e!=t.title&&(t.title=e),t})}(t),o=e("Choose heading"),n=e("Heading");t.ui.componentFactory.add("heading",e=>{const r={},s=new xi,a=t.commands.get("heading"),l=t.commands.get("paragraph"),c=[a];for(const t of i){const e={type:"button",model:new vu({label:t.title,class:t.class,withText:!0})};"paragraph"===t.model?(e.model.bind("isOn").to(l,"value"),e.model.set("commandName","paragraph"),c.push(l)):(e.model.bind("isOn").to(a,"value",e=>e===t.model),e.model.set({commandName:"heading",commandValue:t.model})),s.add(e),r[t.model]=t.title}const d=od(e);return rd(d,s),d.buttonView.set({isOn:!1,withText:!0,tooltip:n}),d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),d.bind("isEnabled").toMany(c,"isEnabled",(...t)=>t.some(t=>t)),d.buttonView.bind("label").to(a,"value",l,"value",(t,e)=>{const i=t||e&&"paragraph";return r[i]?r[i]:o}),this.listenTo(d,"execute",e=>{t.execute(e.source.commandName,e.source.commandValue?{value:e.source.commandValue}:void 0),t.editing.view.focus()}),d})}}class Du extends md{refresh(){const t=this.editor.model,e=t.document;this.value=e.selection.getAttribute("highlight"),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"highlight")}execute(t={}){const e=this.editor.model,i=e.document.selection,o=t.value;e.change(t=>{const n=e.schema.getValidRanges(i.getRanges(),"highlight");if(i.isCollapsed){const e=i.getFirstPosition();if(i.hasAttribute("highlight")){const i=t=>t.item.hasAttribute("highlight")&&t.item.getAttribute("highlight")===this.value,n=e.getLastMatchingPosition(i,{direction:"backward"}),r=e.getLastMatchingPosition(i),s=t.createRange(n,r);o&&this.value!==o?(t.setAttribute("highlight",o,s),t.setSelectionAttribute("highlight",o)):(t.removeAttribute("highlight",s),t.removeSelectionAttribute("highlight"))}else o&&t.setSelectionAttribute("highlight",o)}else for(const e of n)o?t.setAttribute("highlight",o,e):t.removeAttribute("highlight",e)})}}class Vu extends ud{static get pluginName(){return"HighlightEditing"}constructor(t){super(t),t.config.define("highlight",{options:[{model:"yellowMarker",class:"marker-yellow",title:"Yellow marker",color:"var(--ck-highlight-marker-yellow)",type:"marker"},{model:"greenMarker",class:"marker-green",title:"Green marker",color:"var(--ck-highlight-marker-green)",type:"marker"},{model:"pinkMarker",class:"marker-pink",title:"Pink marker",color:"var(--ck-highlight-marker-pink)",type:"marker"},{model:"blueMarker",class:"marker-blue",title:"Blue marker",color:"var(--ck-highlight-marker-blue)",type:"marker"},{model:"redPen",class:"pen-red",title:"Red pen",color:"var(--ck-highlight-pen-red)",type:"pen"},{model:"greenPen",class:"pen-green",title:"Green pen",color:"var(--ck-highlight-pen-green)",type:"pen"}]})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"highlight"});const e=t.config.get("highlight.options");t.conversion.attributeToElement(function(t){const e={model:{key:"highlight",values:[]},view:{}};for(const i of t)e.model.values.push(i.model),e.view[i.model]={name:"mark",classes:i.class};return e}(e)),t.commands.add("highlight",new Du(t))}}i(53);class ju extends xc{constructor(t){super(t);const e=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 jl,this.focusTracker=new Yl,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",e.if("isVisible","ck-hidden",t=>!t),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",(t,e)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),e())}),this.keystrokes.set("arrowleft",(t,e)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),e())})}focus(){this.actionView.focus()}_createActionView(){const t=new Kc;return t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){const t=new Kc,e=t.bindTemplate;return t.icon=Qc,t.extendTemplate({attributes:{class:"ck-splitbutton__arrow","aria-haspopup":!0,"aria-expanded":e.to("isOn",t=>String(t))}}),t.bind("isEnabled").to(this),t.delegate("execute").to(this,"open"),t}}i(55);class Bu extends ud{get localizedOptionTitles(){const t=this.editor.t;return{"Yellow marker":t("Yellow marker"),"Green marker":t("Green marker"),"Pink marker":t("Pink marker"),"Blue marker":t("Blue marker"),"Red pen":t("Red pen"),"Green pen":t("Green pen")}}static get pluginName(){return"HighlightUI"}init(){const t=this.editor.config.get("highlight.options");for(const e of t)this._addHighlighterButton(e);this._addRemoveHighlightButton(),this._addDropdown(t)}_addRemoveHighlightButton(){const t=this.editor.t;this._addButton("removeHighlight",t("Remove highlight"),Bh)}_addHighlighterButton(t){const e=this.editor.commands.get("highlight");this._addButton("highlight:"+t.model,t.title,Fu(t.type),t.model,(function(i){i.bind("isEnabled").to(e,"isEnabled"),i.bind("isOn").to(e,"value",e=>e===t.model),i.iconView.fillColor=t.color,i.isToggleable=!0}))}_addButton(t,e,i,o,n=(()=>{})){const r=this.editor;r.ui.componentFactory.add(t,t=>{const s=new Kc(t),a=this.localizedOptionTitles[e]?this.localizedOptionTitles[e]:e;return s.set({label:a,icon:i,tooltip:!0}),s.on("execute",()=>{r.execute("highlight",{value:o}),r.editing.view.focus()}),n(s),s})}_addDropdown(t){const e=this.editor,i=e.t,o=e.ui.componentFactory,n=t[0],r=t.reduce((t,e)=>(t[e.model]=e,t),{});o.add("highlight",s=>{const a=e.commands.get("highlight"),l=od(s,ju),c=l.buttonView;c.set({tooltip:i("Highlight"),lastExecuted:n.model,commandValue:n.model,isToggleable:!0}),c.bind("icon").to(a,"value",t=>Fu(h(t,"type"))),c.bind("color").to(a,"value",t=>h(t,"color")),c.bind("commandValue").to(a,"value",t=>h(t,"model")),c.bind("isOn").to(a,"value",t=>!!t),c.delegate("execute").to(l);const d=t.map(t=>{const e=o.create("highlight:"+t.model);return this.listenTo(e,"execute",()=>l.buttonView.set({lastExecuted:t.model})),e});function h(t,e){const i=t&&t!==c.lastExecuted?t:c.lastExecuted;return r[i][e]}return l.bind("isEnabled").toMany(d,"isEnabled",(...t)=>t.some(t=>t)),d.push(new Dc),d.push(o.create("removeHighlight")),nd(l,d),function(t){t.buttonView.actionView.iconView.bind("fillColor").to(t.buttonView,"color")}(l),l.toolbarView.ariaLabel=i("Text highlight toolbar"),c.on("execute",()=>{e.execute("highlight",{value:c.commandValue}),e.editing.view.focus()}),l})}}function Fu(t){return"marker"===t?'':''}class Hu{constructor(){this._stack=[]}add(t,e){const i=this._stack,o=i[0];this._insertDescriptor(t);const n=i[0];o===n||Uu(o,n)||this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:e})}remove(t,e){const i=this._stack,o=i[0];this._removeDescriptor(t);const n=i[0];o===n||Uu(o,n)||this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:e})}_insertDescriptor(t){const e=this._stack,i=e.findIndex(e=>e.id===t.id);if(Uu(t,e[i]))return;i>-1&&e.splice(i,1);let o=0;for(;e[o]&&qu(e[o],t);)o++;e.splice(o,0,t)}_removeDescriptor(t){const e=this._stack,i=e.findIndex(e=>e.id===t);i>-1&&e.splice(i,1)}}function Uu(t,e){return t&&e&&t.priority==e.priority&&Wu(t.classes)==Wu(e.classes)}function qu(t,e){return t.priority>e.priority||!(t.priorityWu(e.classes)}function Wu(t){return Array.isArray(t)?t.sort().join(","):t}yi(Hu,mi);i(57);const $u=Ic("px"),Gu=rr.document.body;class Yu extends xc{constructor(t){super(t);const e=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",e.to("position",t=>"ck-balloon-panel_"+t),e.if("isVisible","ck-balloon-panel_visible"),e.if("withArrow","ck-balloon-panel_with-arrow"),e.to("class")],style:{top:e.to("top",$u),left:e.to("left",$u)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(t){this.show();const e=Yu.defaultPositions,i=Object.assign({},{element:this.element,positions:[e.southArrowNorth,e.southArrowNorthMiddleWest,e.southArrowNorthMiddleEast,e.southArrowNorthWest,e.southArrowNorthEast,e.northArrowSouth,e.northArrowSouthMiddleWest,e.northArrowSouthMiddleEast,e.northArrowSouthWest,e.northArrowSouthEast],limiter:Gu,fitInViewport:!0},t),o=Yu._getOptimalPosition(i),n=parseInt(o.left),r=parseInt(o.top),s=o.name;Object.assign(this,{top:r,left:n,position:s})}pin(t){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(t):this._stopPinning()},this._startPinning(t),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(t){this.attachTo(t);const e=Ku(t.target),i=t.limiter?Ku(t.limiter):Gu;this.listenTo(rr.document,"scroll",(o,n)=>{const r=n.target,s=e&&r.contains(e),a=i&&r.contains(i);!s&&!a&&e&&i||this.attachTo(t)},{useCapture:!0}),this.listenTo(rr.window,"resize",()=>{this.attachTo(t)})}_stopPinning(){this.stopListening(rr.document,"scroll"),this.stopListening(rr.window,"resize")}}function Ku(t){return ii(t)?t:es(t)?t.commonAncestorContainer:"function"==typeof t?Ku(t()):null}function Qu(t,e){return t.top-e.height-Yu.arrowVerticalOffset}function Ju(t){return t.bottom+Yu.arrowVerticalOffset}Yu.arrowHorizontalOffset=25,Yu.arrowVerticalOffset=10,Yu._getOptimalPosition=Hc,Yu.defaultPositions={northWestArrowSouthWest:(t,e)=>({top:Qu(t,e),left:t.left-Yu.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(t,e)=>({top:Qu(t,e),left:t.left-.25*e.width-Yu.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(t,e)=>({top:Qu(t,e),left:t.left-e.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(t,e)=>({top:Qu(t,e),left:t.left-.75*e.width+Yu.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(t,e)=>({top:Qu(t,e),left:t.left-e.width+Yu.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(t,e)=>({top:Qu(t,e),left:t.left+t.width/2-Yu.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(t,e)=>({top:Qu(t,e),left:t.left+t.width/2-.25*e.width-Yu.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(t,e)=>({top:Qu(t,e),left:t.left+t.width/2-e.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(t,e)=>({top:Qu(t,e),left:t.left+t.width/2-.75*e.width+Yu.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(t,e)=>({top:Qu(t,e),left:t.left+t.width/2-e.width+Yu.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(t,e)=>({top:Qu(t,e),left:t.right-Yu.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(t,e)=>({top:Qu(t,e),left:t.right-.25*e.width-Yu.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(t,e)=>({top:Qu(t,e),left:t.right-e.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(t,e)=>({top:Qu(t,e),left:t.right-.75*e.width+Yu.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(t,e)=>({top:Qu(t,e),left:t.right-e.width+Yu.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(t,e)=>({top:Ju(t),left:t.left-Yu.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(t,e)=>({top:Ju(t),left:t.left-.25*e.width-Yu.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(t,e)=>({top:Ju(t),left:t.left-e.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(t,e)=>({top:Ju(t),left:t.left-.75*e.width+Yu.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(t,e)=>({top:Ju(t),left:t.left-e.width+Yu.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(t,e)=>({top:Ju(t),left:t.left+t.width/2-Yu.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(t,e)=>({top:Ju(t),left:t.left+t.width/2-.25*e.width-Yu.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(t,e)=>({top:Ju(t),left:t.left+t.width/2-e.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(t,e)=>({top:Ju(t),left:t.left+t.width/2-.75*e.width+Yu.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(t,e)=>({top:Ju(t),left:t.left+t.width/2-e.width+Yu.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(t,e)=>({top:Ju(t),left:t.right-Yu.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(t,e)=>({top:Ju(t),left:t.right-.25*e.width-Yu.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(t,e)=>({top:Ju(t),left:t.right-e.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(t,e)=>({top:Ju(t),left:t.right-.75*e.width+Yu.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(t,e)=>({top:Ju(t),left:t.right-e.width+Yu.arrowHorizontalOffset,name:"arrow_ne"})};function Zu(t,e,i){return t&&tg(t)&&!i.isInline(e)}function Xu(t){return t.getAttribute("widget-type-around")}function tg(t){return!!t.is("element")&&!!t.getCustomProperty("widget")}function eg(t,e,i={}){if(!t.is("containerElement"))throw new hi.a("widget-to-widget-wrong-element-type",null,{element:t});return e.setAttribute("contenteditable","false",t),e.addClass("ck-widget",t),e.setCustomProperty("widget",!0,t),t.getFillerOffset=rg,i.label&&function(t,e,i){i.setCustomProperty("widgetLabel",e,t)}(t,i.label,e),i.hasSelectionHandle&&function(t,e){const i=e.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(t){const e=this.toDomElement(t),i=new Gc;return i.set("content",''),i.render(),e.appendChild(i.element),e}));e.insert(e.createPositionAt(t,0),i),e.addClass(["ck-widget_with-selection-handle"],t)}(t,e),function(t,e,i,o){const n=new Hu;n.on("change:top",(e,n)=>{n.oldDescriptor&&o(t,n.oldDescriptor,n.writer),n.newDescriptor&&i(t,n.newDescriptor,n.writer)}),e.setCustomProperty("addHighlight",(t,e,i)=>n.add(e,i),t),e.setCustomProperty("removeHighlight",(t,e,i)=>n.remove(e,i),t)}(t,e,(t,e,i)=>i.addClass(Ti(e.classes),t),(t,e,i)=>i.removeClass(Ti(e.classes),t)),t}function ig(t){const e=t.getCustomProperty("widgetLabel");return e?"function"==typeof e?e():e:""}function og(t,e){const i=t.getSelectedElement();if(i){const o=Xu(t);if(o)return e.createPositionAt(i,o);if(e.schema.isBlock(i))return e.createPositionAfter(i)}const o=t.getSelectedBlocks().next().value;if(o){if(o.isEmpty)return e.createPositionAt(o,0);const i=e.createPositionAfter(o);return t.focus.isTouching(i)?i:e.createPositionBefore(o)}return t.focus}function ng(t,e){const i=new ns(rr.window),o=i.getIntersection(t),n=e.height+Yu.arrowVerticalOffset;if(t.top-n>i.top||t.bottom+n{const i=e.createElement("horizontalLine");t.insertContent(i);let o=i.nextSibling;!(o&&t.schema.checkChild(o,"$text"))&&t.schema.checkChild(i.parent,"paragraph")&&(o=e.createElement("paragraph"),t.insertContent(o,e.createPositionAfter(i))),o&&e.setSelection(o,0)})}}i(59);class ag extends ud{static get pluginName(){return"HorizontalLineEditing"}init(){const t=this.editor,e=t.model.schema,i=t.t,o=t.conversion;e.register("horizontalLine",{isObject:!0,allowWhere:"$block"}),o.for("dataDowncast").elementToElement({model:"horizontalLine",view:(t,{writer:e})=>e.createEmptyElement("hr")}),o.for("editingDowncast").elementToElement({model:"horizontalLine",view:(t,{writer:e})=>{const o=i("Horizontal line"),n=e.createContainerElement("div"),r=e.createEmptyElement("hr");return e.addClass("ck-horizontal-line",n),e.setCustomProperty("hr",!0,n),e.insert(e.createPositionAt(n,0),r),function(t,e,i){return e.setCustomProperty("horizontalLine",!0,t),eg(t,e,{label:i})}(n,e,o)}}),o.for("upcast").elementToElement({view:"hr",model:"horizontalLine"}),t.commands.add("horizontalLine",new sg(t))}}class lg extends ud{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("horizontalLine",i=>{const o=t.commands.get("horizontalLine"),n=new Kc(i);return n.set({label:e("Horizontal line"),icon:'',tooltip:!0}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",()=>{t.execute("horizontalLine"),t.editing.view.focus()}),n})}}class cg extends br{observe(t){this.listenTo(t,"load",(t,e)=>{const i=e.target;this.checkShouldIgnoreEventFromTarget(i)||"IMG"==i.tagName&&this._fireEvents(e)},{useCapture:!0})}_fireEvents(t){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",t))}}function dg(t){const e=t.getSelectedElement();return e&&function(t){return!!t.getCustomProperty("image")&&tg(t)}(e)?e:null}function hg(t){return!!t&&t.is("element","image")}function ug(t,e={},i=null){t.change(o=>{const n=o.createElement("image",e),r=i||og(t.document.selection,t);t.insertContent(n,r),n.parent&&o.setSelection(n,"on")})}function gg(t){const e=t.schema,i=t.document.selection;return function(t,e,i){const o=function(t,e){const i=og(t,e).parent;if(i.isEmpty&&!i.is("element","$root"))return i.parent;return i}(t,i);return e.checkChild(o,"image")}(i,e,t)&&!function(t,e){const i=t.getSelectedElement();return i&&e.isObject(i)}(i,e)&&function(t){return[...t.focus.getAncestors()].every(t=>!t.is("element","image"))}(i)}function mg(t){const e=[];for(const i of t.getChildren())e.push(i),i.is("element")&&e.push(...i.getChildren());return e.find(t=>t.is("element","img"))}function fg(t){return i=>{i.on(`attribute:${t}:image`,e)};function e(t,e,i){if(!i.consumable.consume(e.item,t.name))return;const o=i.writer,n=mg(i.mapper.toViewElement(e.item));o.setAttribute(e.attributeKey,e.attributeNewValue||"",n)}}class pg extends md{refresh(){this.isEnabled=gg(this.editor.model)}execute(t){const e=this.editor.model;for(const i of Ti(t.source))ug(e,{src:i})}}class bg extends ud{static get pluginName(){return"ImageEditing"}init(){const t=this.editor,e=t.model.schema,i=t.t,o=t.conversion;t.editing.view.addObserver(cg),e.register("image",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),o.for("dataDowncast").elementToElement({model:"image",view:(t,{writer:e})=>wg(e)}),o.for("editingDowncast").elementToElement({model:"image",view:(t,{writer:e})=>function(t,e,i){return e.setCustomProperty("image",!0,t),eg(t,e,{label:function(){const e=mg(t).getAttribute("alt");return e?`${e} ${i}`:i}})}(wg(e),e,i("image widget"))}),o.for("downcast").add(fg("src")).add(fg("alt")).add(function(){return e=>{e.on("attribute:srcset:image",t)};function t(t,e,i){if(!i.consumable.consume(e.item,t.name))return;const o=i.writer,n=mg(i.mapper.toViewElement(e.item));if(null===e.attributeNewValue){const t=e.attributeOldValue;t.data&&(o.removeAttribute("srcset",n),o.removeAttribute("sizes",n),t.width&&o.removeAttribute("width",n))}else{const t=e.attributeNewValue;t.data&&(o.setAttribute("srcset",t.data,n),o.setAttribute("sizes","100vw",n),t.width&&o.setAttribute("width",t.width,n))}}}()),o.for("upcast").elementToElement({view:{name:"img",attributes:{src:!0}},model:(t,{writer:e})=>e.createElement("image",{src:t.getAttribute("src")})}).attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:t=>{const e={data:t.getAttribute("srcset")};return t.hasAttribute("width")&&(e.width=t.getAttribute("width")),e}}}).add(function(){return e=>{e.on("element:figure",t)};function t(t,e,i){if(!i.consumable.test(e.viewItem,{name:!0,classes:"image"}))return;const o=mg(e.viewItem);if(!o||!o.hasAttribute("src")||!i.consumable.test(o,{name:!0}))return;const n=pd(i.convertItem(o,e.modelCursor).modelRange.getItems());n&&(i.convertChildren(e.viewItem,n),i.updateConversionResult(n,e))}}()),t.commands.add("imageInsert",new pg(t))}}function wg(t){const e=t.createEmptyElement("img"),i=t.createContainerElement("figure",{class:"image"});return t.insert(t.createPositionAt(i,0),e),i}class kg extends Vr{constructor(t){super(t),this.domEventType="mousedown"}onDomEvent(t){this.fire(t.type,t)}}i(61);const _g=["before","after"],vg=(new DOMParser).parseFromString('',"image/svg+xml").firstChild;class yg extends ud{static get pluginName(){return"WidgetTypeAround"}constructor(t){super(t),this._currentFakeCaretModelElement=null}init(){const t=this.editor,e=t.editing.view;this.on("change:isEnabled",(i,o,n)=>{e.change(t=>{for(const i of e.document.roots)n?t.removeClass("ck-widget__type-around_disabled",i):t.addClass("ck-widget__type-around_disabled",i)}),n||t.model.change(t=>{t.removeSelectionAttribute("widget-type-around")})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(t,e){const i=this.editor,o=i.editing.view;i.execute("insertParagraph",{position:i.model.createPositionAt(t,e)}),o.focus(),o.scrollToTheSelection()}_listenToIfEnabled(t,e,i,o){this.listenTo(t,e,(...t)=>{this.isEnabled&&i(...t)},o)}_insertParagraphAccordingToFakeCaretPosition(){const t=this.editor.model.document.selection,e=Xu(t);if(!e)return!1;const i=t.getSelectedElement();return this._insertParagraph(i,e),!0}_enableTypeAroundUIInjection(){const t=this.editor,e=t.model.schema,i=t.locale.t,o={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};t.editing.downcastDispatcher.on("insert",(t,i,n)=>{const r=n.mapper.toViewElement(i.item);Zu(r,i.item,e)&&function(t,e,i){const o=t.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(t){const i=this.toDomElement(t);return function(t,e){for(const i of _g){const o=new nc({tag:"div",attributes:{class:["ck","ck-widget__type-around__button","ck-widget__type-around__button_"+i],title:e[i]},children:[t.ownerDocument.importNode(vg,!0)]});t.appendChild(o.render())}}(i,e),function(t){const e=new nc({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});t.appendChild(e.render())}(i),i}));t.insert(t.createPositionAt(i,"end"),o)}(n.writer,o,r)},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const t=this.editor,e=t.model,i=e.document.selection,o=e.schema,n=t.editing.view;function r(t){return"ck-widget_type-around_show-fake-caret_"+t}this._listenToIfEnabled(n.document,"keydown",(t,e)=>{_n(e.keyCode)&&this._handleArrowKeyPress(t,e)},{priority:di.get("high")+10}),this._listenToIfEnabled(i,"change:range",(e,i)=>{i.directChange&&t.model.change(t=>{t.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(e.document,"change:data",()=>{const e=i.getSelectedElement();if(e){if(Zu(t.editing.mapper.toViewElement(e),e,o))return}t.model.change(t=>{t.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(t.editing.downcastDispatcher,"selection",(t,e,i)=>{const n=i.writer;if(this._currentFakeCaretModelElement){const t=i.mapper.toViewElement(this._currentFakeCaretModelElement);t&&(n.removeClass(_g.map(r),t),this._currentFakeCaretModelElement=null)}const s=e.selection.getSelectedElement();if(!s)return;const a=i.mapper.toViewElement(s);if(!Zu(a,s,o))return;const l=Xu(e.selection);l&&(n.addClass(r(l),a),this._currentFakeCaretModelElement=s)}),this._listenToIfEnabled(t.ui.focusTracker,"change:isFocused",(e,i,o)=>{o||t.model.change(t=>{t.removeSelectionAttribute("widget-type-around")})})}_handleArrowKeyPress(t,e){const i=this.editor,o=i.model,n=o.document.selection,r=o.schema,s=i.editing.view,a=yn(e.keyCode,i.locale.contentLanguageDirection),l=s.document.selection.getSelectedElement();let c;Zu(l,i.editing.mapper.toModelElement(l),r)?c=this._handleArrowKeyPressOnSelectedWidget(a):n.isCollapsed&&(c=this._handleArrowKeyPressWhenSelectionNextToAWidget(a)),c&&(e.preventDefault(),t.stop())}_handleArrowKeyPressOnSelectedWidget(t){const e=this.editor.model,i=Xu(e.document.selection);return e.change(e=>{if(!i)return e.setSelectionAttribute("widget-type-around",t?"after":"before"),!0;if(!(i===(t?"after":"before")))return e.removeSelectionAttribute("widget-type-around"),!0;return!1})}_handleArrowKeyPressWhenSelectionNextToAWidget(t){const e=this.editor,i=e.model,o=i.schema,n=e.plugins.get("Widget"),r=n._getObjectElementNextToSelection(t);return!!Zu(e.editing.mapper.toViewElement(r),r,o)&&(i.change(e=>{n._setSelectionOverElement(r),e.setSelectionAttribute("widget-type-around",t?"before":"after")}),!0)}_enableInsertingParagraphsOnButtonClick(){const t=this.editor,e=t.editing.view;this._listenToIfEnabled(e.document,"mousedown",(i,o)=>{const n=o.domTarget.closest(".ck-widget__type-around__button");if(!n)return;const r=function(t){return t.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(n),s=function(t,e){const i=t.closest(".ck-widget");return e.mapDomToView(i)}(n,e.domConverter),a=t.editing.mapper.toModelElement(s);this._insertParagraph(a,r),o.preventDefault(),i.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const t=this.editor,e=t.editing.view;this._listenToIfEnabled(e.document,"enter",(i,o)=>{const n=e.document.selection.getSelectedElement(),r=t.editing.mapper.toModelElement(n),s=t.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:Zu(n,r,s)&&(this._insertParagraph(r,o.isSoft?"before":"after"),a=!0),a&&(o.preventDefault(),i.stop())})}_enableInsertingParagraphsOnTypingKeystroke(){const t=this.editor.editing.view,e=[pn.enter,pn.delete,pn.backspace];this._listenToIfEnabled(t.document,"keydown",(t,i)=>{e.includes(i.keyCode)||nh(i)||this._insertParagraphAccordingToFakeCaretPosition()},{priority:di.get("high")+1})}_enableDeleteIntegration(){const t=this.editor,e=t.editing.view,i=t.model,o=i.schema;this._listenToIfEnabled(e.document,"delete",(e,n)=>{const r=Xu(i.document.selection);if(!r)return;const s=n.direction,a=i.document.selection.getSelectedElement(),l="forward"==s;if("before"===r===l)t.execute("delete",{selection:i.createSelection(a,"on")});else{const e=o.getNearestSelectionRange(i.createPositionAt(a,r),s);if(e)if(e.isCollapsed){const n=i.createSelection(e.start);if(i.modifySelection(n,{direction:s}),n.focus.isEqual(e.start)){const t=function(t,e){let i=e;for(const o of e.getAncestors({parentFirst:!0})){if(o.childCount>1||t.isLimit(o))break;i=o}return i}(o,e.start.parent);i.deleteContent(i.createSelection(t,"on"),{doNotAutoparagraph:!0})}else i.change(i=>{i.setSelection(e),t.execute(l?"forwardDelete":"delete")})}else i.change(i=>{i.setSelection(e),t.execute(l?"forwardDelete":"delete")})}n.preventDefault(),e.stop()},{priority:di.get("high")+1})}_enableInsertContentIntegration(){const t=this.editor,e=this.editor.model,i=e.document.selection;this._listenToIfEnabled(t.model,"insertContent",(t,[o,n])=>{if(n&&!n.is("documentSelection"))return;const r=Xu(i);return r?(t.stop(),e.change(t=>{const n=i.getSelectedElement(),s=e.createPositionAt(n,r),a=t.createSelection(s),l=e.insertContent(o,a);return t.setSelection(a),l})):void 0},{priority:"high"})}}i(63);function xg(t){const e=t.model;return(i,o)=>{const n=o.keyCode==pn.arrowup,r=o.keyCode==pn.arrowdown,s=o.shiftKey,a=e.document.selection;if(!n&&!r)return;const l=r;if(s&&function(t,e){return!t.isCollapsed&&t.isBackward==e}(a,l))return;const c=function(t,e,i){const o=t.model;if(i){const t=e.isCollapsed?e.focus:e.getLastPosition(),i=Ag(o,t,"forward");if(!i)return null;const n=o.createRange(t,i),r=Tg(o.schema,n,"backward");return r&&t.isBefore(r)?o.createRange(t,r):null}{const t=e.isCollapsed?e.focus:e.getFirstPosition(),i=Ag(o,t,"backward");if(!i)return null;const n=o.createRange(i,t),r=Tg(o.schema,n,"forward");return r&&t.isAfter(r)?o.createRange(r,t):null}}(t,a,l);c&&!c.isCollapsed&&function(t,e,i){const o=t.model,n=t.view.domConverter;if(i){const t=o.createSelection(e.start);o.modifySelection(t),t.focus.isAtEnd||e.start.isEqual(t.focus)||(e=o.createRange(t.focus,e.end))}const r=t.mapper.toViewRange(e),s=n.viewRangeToDom(r),a=ns.getDomRangeRects(s);let l;for(const t of a)if(void 0!==l){if(Math.round(t.top)>=l)return!1;l=Math.max(l,Math.round(t.bottom))}else l=Math.round(t.bottom);return!0}(t,c,l)&&(e.change(t=>{const i=l?c.end:c.start;if(s){const o=e.createSelection(a.anchor);o.setFocus(i),t.setSelection(o)}else t.setSelection(i)}),i.stop(),o.preventDefault(),o.stopPropagation())}}function Ag(t,e,i){const o=t.schema,n=t.createRangeIn(e.root),r="forward"==i?"elementStart":"elementEnd";for(const{previousPosition:t,item:s,type:a}of n.getWalker({startPosition:e,direction:i})){if(o.isLimit(s)&&!o.isInline(s))return t;if(a==r&&o.isBlock(s))return null}return null}function Tg(t,e,i){const o="backward"==i?e.end:e.start;if(t.checkChild(o,"$text"))return o;for(const{nextPosition:o}of e.getWalker({direction:i}))if(t.checkChild(o,"$text"))return o}class Cg extends ud{static get pluginName(){return"Widget"}static get requires(){return[yg]}init(){const t=this.editor.editing.view,e=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(t,e,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const o=i.writer,n=o.document.selection,r=n.getSelectedElement();let s=null;for(const t of n.getRanges())for(const e of t){const t=e.item;tg(t)&&!Sg(t,s)&&(o.addClass("ck-widget_selected",t),this._previouslySelected.add(t),s=t,t==r&&o.setSelection(n.getRanges(),{fake:!0,label:ig(r)}))}},{priority:"low"}),t.addObserver(kg),this.listenTo(e,"mousedown",(...t)=>this._onMousedown(...t)),this.listenTo(e,"keydown",(...t)=>{this._handleSelectionChangeOnArrowKeyPress(...t)},{priority:"high"}),this.listenTo(e,"keydown",(...t)=>{this._preventDefaultOnArrowKeyPress(...t)},{priority:di.get("high")-20}),this.listenTo(e,"keydown",xg(this.editor.editing)),this.listenTo(e,"delete",(t,e)=>{this._handleDelete("forward"==e.direction)&&(e.preventDefault(),t.stop())},{priority:"high"})}_onMousedown(t,e){const i=this.editor,o=i.editing.view,n=o.document;let r=e.target;if(function(t){for(;t;){if(t.is("editableElement")&&!t.is("rootElement"))return!0;if(tg(t))return!1;t=t.parent}return!1}(r)){if((gn.isSafari||gn.isGecko)&&e.domEvent.detail>=3){const t=i.editing.mapper,o=r.is("attributeElement")?r.findAncestor(t=>!t.is("attributeElement")):r,n=t.toModelElement(o);e.preventDefault(),this.editor.model.change(t=>{t.setSelection(n,"in")})}return}if(!tg(r)&&(r=r.findAncestor(tg),!r))return;e.preventDefault(),n.isFocused||o.focus();const s=i.editing.mapper.toModelElement(r);this._setSelectionOverElement(s)}_handleSelectionChangeOnArrowKeyPress(t,e){const i=e.keyCode;if(!_n(i))return;const o=this.editor.model,n=o.schema,r=o.document.selection,s=r.getSelectedElement(),a=yn(i,this.editor.locale.contentLanguageDirection);if(s&&n.isObject(s)){const i=a?r.getLastPosition():r.getFirstPosition(),s=n.getNearestSelectionRange(i,a?"forward":"backward");return void(s&&(o.change(t=>{t.setSelection(s)}),e.preventDefault(),t.stop()))}if(!r.isCollapsed)return;const l=this._getObjectElementNextToSelection(a);l&&n.isObject(l)&&(this._setSelectionOverElement(l),e.preventDefault(),t.stop())}_preventDefaultOnArrowKeyPress(t,e){if(!_n(e.keyCode))return;const i=this.editor.model,o=i.schema,n=i.document.selection.getSelectedElement();n&&o.isObject(n)&&(e.preventDefault(),t.stop())}_handleDelete(t){if(this.editor.isReadOnly)return;const e=this.editor.model.document.selection;if(!e.isCollapsed)return;const i=this._getObjectElementNextToSelection(t);return i?(this.editor.model.change(t=>{let o=e.anchor.parent;for(;o.isEmpty;){const e=o;o=e.parent,t.remove(e)}this._setSelectionOverElement(i)}),!0):void 0}_setSelectionOverElement(t){this.editor.model.change(e=>{e.setSelection(e.createRangeOn(t))})}_getObjectElementNextToSelection(t){const e=this.editor.model,i=e.schema,o=e.document.selection,n=e.createSelection(o);e.modifySelection(n,{direction:t?"forward":"backward"});const r=t?n.focus.nodeBefore:n.focus.nodeAfter;return r&&i.isObject(r)?r:null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected)t.removeClass("ck-widget_selected",e);this._previouslySelected.clear()}}function Sg(t,e){return!!e&&Array.from(t.getAncestors()).includes(e)}class Pg extends md{refresh(){const t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=hg(t),hg(t)&&t.hasAttribute("alt")?this.value=t.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor.model,i=e.document.selection.getSelectedElement();e.change(e=>{e.setAttribute("alt",t.newValue,i)})}}class Eg extends ud{static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new Pg(this.editor))}}i(65);class Mg extends xc{constructor(t,e){super(t);const i="ck-labeled-field-view-"+ci(),o="ck-labeled-field-view-status-"+ci();this.fieldView=e(this,i,o),this.set("label"),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class"),this.set("placeholder"),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(o),this.bind("_statusText").to(this,"errorText",this,"infoText",(t,e)=>t||e);const n=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",n.to("class"),n.if("isEnabled","ck-disabled",t=>!t),n.if("isEmpty","ck-labeled-field-view_empty"),n.if("isFocused","ck-labeled-field-view_focused"),n.if("placeholder","ck-labeled-field-view_placeholder"),n.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:[this.fieldView,this.labelView]},this.statusView]})}_createLabelView(t){const e=new Pc(this.locale);return e.for=t,e.bind("text").to(this,"label"),e}_createStatusView(t){const e=new xc(this.locale),i=this.bindTemplate;return e.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",t=>!t)],id:t,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),e}focus(){this.fieldView.focus()}}i(67);class Lg extends xc{constructor(t){super(t),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById"),this.focusTracker=new Yl,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text",e.if("isFocused","ck-input_focused"),e.if("isEmpty","ck-input-text_empty"),e.if("hasError","ck-error")],id:e.to("id"),placeholder:e.to("placeholder"),readonly:e.to("isReadOnly"),"aria-invalid":e.if("hasError",!0),"aria-describedby":e.to("ariaDescribedById")},on:{input:e.to("input"),change:e.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(t,e,i)=>{this._setDomElementValue(i),this._updateIsEmpty()})}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(t){this.element.value=t||0===t?t:""}}function Ig(t,e,i){const o=new Lg(t.locale);return o.set({id:e,ariaDescribedById:i}),o.bind("isReadOnly").to(t,"isEnabled",t=>!t),o.bind("hasError").to(t,"errorText",t=>!!t),o.on("input",()=>{t.errorText=null}),t.bind("isEmpty","isFocused","placeholder").to(o),o}function Ng(t){t.set("_isCssTransitionsDisabled",!1),t.disableCssTransitions=()=>{t._isCssTransitionsDisabled=!0},t.enableCssTransitions=()=>{t._isCssTransitionsDisabled=!1},t.extendTemplate({attributes:{class:[t.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function zg({view:t}){t.listenTo(t.element,"submit",(e,i)=>{i.preventDefault(),t.fire("submit")},{useCapture:!0})}var Og='',Rg='';i(69),i(7);class Dg extends xc{constructor(t){super(t);const e=this.locale.t;this.focusTracker=new Yl,this.keystrokes=new jl,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(e("Save"),Og,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("Cancel"),Rg,"ck-button-cancel","cancel"),this._focusables=new oc,this._focusCycler=new Oc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),Ng(this)}render(){super.render(),this.keystrokes.listenTo(this.element),zg({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)})}_createButton(t,e,i,o){const n=new Kc(this.locale);return n.set({label:t,icon:e,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),o&&n.delegate("execute").to(this,o),n}_createLabeledInputView(){const t=this.locale.t,e=new Mg(this.locale,Ig);return e.label=t("Text alternative"),e}}i(72),i(74);const Vg=Ic("px");class jg extends ud{static get pluginName(){return"ContextualBalloon"}constructor(t){super(t),this.positionLimiter=()=>{const t=this.editor.editing.view,e=t.document.selection.editableElement;return e?t.domConverter.mapViewToDom(e.root):null},this.set("visibleView",null),this.view=new Yu(t.locale),t.ui.view.body.add(this.view),t.ui.focusTracker.add(this.view.element),this._viewToStack=new Map,this._idToStack=new Map,this.set("_numberOfStacks",0),this.set("_singleViewMode",!1),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}hasView(t){return Array.from(this._viewToStack.keys()).includes(t)}add(t){if(this.hasView(t.view))throw new hi.a("contextualballoon-add-view-exist",[this,t]);const e=t.stackId||"main";if(!this._idToStack.has(e))return this._idToStack.set(e,new Map([[t.view,t]])),this._viewToStack.set(t.view,this._idToStack.get(e)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!t.singleViewMode||this.showStack(e));const i=this._idToStack.get(e);t.singleViewMode&&this.showStack(e),i.set(t.view,t),this._viewToStack.set(t.view,i),i===this._visibleStack&&this._showView(t)}remove(t){if(!this.hasView(t))throw new hi.a("contextualballoon-remove-view-not-exist",[this,t]);const e=this._viewToStack.get(t);this._singleViewMode&&this.visibleView===t&&(this._singleViewMode=!1),this.visibleView===t&&(1===e.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(e.values())[e.size-2])),1===e.size?(this._idToStack.delete(this._getStackId(e)),this._numberOfStacks=this._idToStack.size):e.delete(t),this._viewToStack.delete(t)}updatePosition(t){t&&(this._visibleStack.get(this.visibleView).position=t),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(t){this.visibleStack=t;const e=this._idToStack.get(t);if(!e)throw new hi.a("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==e&&this._showView(Array.from(e.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(t){return Array.from(this._idToStack.entries()).find(e=>e[1]===t)[0]}_showNextStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)+1;t[e]||(e=0),this.showStack(this._getStackId(t[e]))}_showPrevStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)-1;t[e]||(e=t.length-1),this.showStack(this._getStackId(t[e]))}_createRotatorView(){const t=new Bg(this.editor.locale),e=this.editor.locale.t;return this.view.content.add(t),t.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(t,e)=>!e&&t>1),t.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),t.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(t,i)=>{if(i<2)return"";const o=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return e("%0 of %1",[o,i])}),t.buttonNextView.on("execute",()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),t.buttonPrevView.on("execute",()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),t}_createFakePanelsView(){const t=new Fg(this.editor.locale,this.view);return t.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,e)=>!e&&t>=2?Math.min(t-1,2):0),t.listenTo(this.view,"change:top",()=>t.updatePosition()),t.listenTo(this.view,"change:left",()=>t.updatePosition()),this.editor.ui.view.body.add(t),t}_showView({view:t,balloonClassName:e="",withArrow:i=!0,singleViewMode:o=!1}){this.view.class=e,this.view.withArrow=i,this._rotatorView.showView(t),this.visibleView=t,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),o&&(this._singleViewMode=!0)}_getBalloonPosition(){let t=Array.from(this._visibleStack.values()).pop().position;return t&&!t.limiter&&(t=Object.assign({},t,{limiter:this.positionLimiter})),t}}class Bg extends xc{constructor(t){super(t);const e=t.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new Yl,this.buttonPrevView=this._createButtonView(e("Previous"),''),this.buttonNextView=this._createButtonView(e("Next"),''),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",t=>t?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}showView(t){this.hideView(),this.content.add(t)}hideView(){this.content.clear()}_createButtonView(t,e){const i=new Kc(this.locale);return i.set({label:t,icon:e,tooltip:!0}),i}}class Fg extends xc{constructor(t,e){super(t);const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=e,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",t=>t?"":"ck-hidden")],style:{top:i.to("top",Vg),left:i.to("left",Vg),width:i.to("width",Vg),height:i.to("height",Vg)}},children:this.content}),this.on("change:numberOfPanels",(t,e,i,o)=>{i>o?this._addPanels(i-o):this._removePanels(o-i),this.updatePosition()})}_addPanels(t){for(;t--;){const t=new xc;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(t){for(;t--;){const t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:t,left:e}=this._balloonPanelView,{width:i,height:o}=new ns(this._balloonPanelView.element);Object.assign(this,{top:t,left:e,width:i,height:o})}}}function Hg(t){const e=t.editing.view,i=Yu.defaultPositions;return{target:e.domConverter.viewToDom(e.document.selection.getSelectedElement()),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast]}}class Ug extends ud{static get requires(){return[jg]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageTextAlternative",i=>{const o=t.commands.get("imageTextAlternative"),n=new Kc(i);return n.set({label:e("Change image text alternative"),icon:'',tooltip:!0}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",()=>{this._showForm()}),n})}_createForm(){const t=this.editor,e=t.editing.view.document;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new Dg(t.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{t.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(t,e)=>{this._hideForm(!0),e()}),this.listenTo(t.ui,"update",()=>{dg(e.selection)?this._isVisible&&function(t){const e=t.plugins.get("ContextualBalloon");if(dg(t.editing.view.document.selection)){const i=Hg(t);e.updatePosition(i)}}(t):this._hideForm(!0)}),id({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const t=this.editor,e=t.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:Hg(t)}),i.fieldView.value=i.fieldView.element.value=e.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(t){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),t&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class qg extends ud{static get requires(){return[Eg,Ug]}static get pluginName(){return"ImageTextAlternative"}}i(76);function Wg(t){for(const e of t.getChildren())if(e&&e.is("element","caption"))return e;return null}function $g(t){const e=t.parent;return"figcaption"==t.name&&e&&"figure"==e.name&&e.hasClass("image")?{name:!0}:null}class Gg extends ud{static get pluginName(){return"ImageCaptionEditing"}init(){const t=this.editor,e=t.editing.view,i=t.model.schema,o=t.data,n=t.editing,r=t.t;i.register("caption",{allowIn:"image",allowContentOf:"$block",isLimit:!0}),t.model.document.registerPostFixer(t=>this._insertMissingModelCaptionElement(t)),t.conversion.for("upcast").elementToElement({view:$g,model:"caption"});o.downcastDispatcher.on("insert:caption",Yg(t=>t.createContainerElement("figcaption"),!1));const s=function(t,e){return i=>{const o=i.createEditableElement("figcaption");return i.setCustomProperty("imageCaption",!0,o),Jl({view:t,element:o,text:e}),function(t,e){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],t),e.setAttribute("contenteditable",t.isReadOnly?"false":"true",t),t.on("change:isReadOnly",(i,o,n)=>{e.setAttribute("contenteditable",n?"false":"true",t)}),t.on("change:isFocused",(i,o,n)=>{n?e.addClass("ck-editor__nested-editable_focused",t):e.removeClass("ck-editor__nested-editable_focused",t)}),t}(o,i)}}(e,r("Enter image caption"));n.downcastDispatcher.on("insert:caption",Yg(s)),n.downcastDispatcher.on("insert",this._fixCaptionVisibility(t=>t.item),{priority:"high"}),n.downcastDispatcher.on("remove",this._fixCaptionVisibility(t=>t.position.parent),{priority:"high"}),e.document.registerPostFixer(t=>this._updateCaptionVisibility(t))}_updateCaptionVisibility(t){const e=this.editor.editing.mapper,i=this._lastSelectedCaption;let o;const n=this.editor.model.document.selection,r=n.getSelectedElement();if(r&&r.is("element","image")){const t=Wg(r);o=e.toViewElement(t)}const s=Kg(n.getFirstPosition().parent);if(s&&(o=e.toViewElement(s)),o)return i?(i===o||(Qg(i,t),this._lastSelectedCaption=o),Jg(o,t)):(this._lastSelectedCaption=o,Jg(o,t));if(i){const e=Qg(i,t);return this._lastSelectedCaption=null,e}return!1}_fixCaptionVisibility(t){return(e,i,o)=>{const n=Kg(t(i)),r=this.editor.editing.mapper,s=o.writer;if(n){const t=r.toViewElement(n);t&&(n.childCount?s.removeClass("ck-hidden",t):s.addClass("ck-hidden",t))}}}_insertMissingModelCaptionElement(t){const e=this.editor.model,i=e.document.differ.getChanges(),o=[];for(const t of i)if("insert"==t.type&&"$text"!=t.name){const i=t.position.nodeAfter;if(i.is("element","image")&&!Wg(i)&&o.push(i),!i.is("element","image")&&i.childCount)for(const t of e.createRangeIn(i).getItems())t.is("element","image")&&!Wg(t)&&o.push(t)}for(const e of o)t.appendElement("caption",e);return!!o.length}}function Yg(t,e=!0){return(i,o,n)=>{const r=o.item;if((r.childCount||e)&&hg(r.parent)){if(!n.consumable.consume(o.item,"insert"))return;const e=n.mapper.toViewElement(o.range.start.parent),i=t(n.writer),s=n.writer;r.childCount||s.addClass("ck-hidden",i),function(t,e,i,o){const n=o.writer.createPositionAt(i,"end");o.writer.insert(n,t),o.mapper.bindElements(e,t)}(i,o.item,e,n)}}}function Kg(t){const e=t.getAncestors({includeSelf:!0}).find(t=>"caption"==t.name);return e&&e.parent&&"image"==e.parent.name?e:null}function Qg(t,e){return!t.childCount&&!t.hasClass("ck-hidden")&&(e.addClass("ck-hidden",t),!0)}function Jg(t,e){return!!t.hasClass("ck-hidden")&&(e.removeClass("ck-hidden",t),!0)}i(78);class Zg extends md{refresh(){const t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=hg(t),t&&t.hasAttribute("width")?this.value={width:t.getAttribute("width"),height:null}:this.value=null}execute(t){const e=this.editor.model,i=e.document.selection.getSelectedElement();this.value={width:t.width,height:null},i&&e.change(e=>{e.setAttribute("width",t.width,i)})}}class Xg extends ud{static get pluginName(){return"ImageResizeEditing"}constructor(t){super(t),t.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 t=this.editor,e=new Zg(t);this._registerSchema(),this._registerConverters(),t.commands.add("imageResize",e)}_registerSchema(){this.editor.model.schema.extend("image",{allowAttributes:"width"}),this.editor.model.schema.setAttributeProperties("width",{isFormatting:!0})}_registerConverters(){const t=this.editor;t.conversion.for("downcast").add(t=>t.on("attribute:width:image",(t,e,i)=>{if(!i.consumable.consume(e.item,t.name))return;const o=i.writer,n=i.mapper.toViewElement(e.item);null!==e.attributeNewValue?(o.setStyle("width",e.attributeNewValue,n),o.addClass("image_resized",n)):(o.removeStyle("width",n),o.removeClass("image_resized",n))})),t.conversion.for("upcast").attributeToAttribute({view:{name:"figure",styles:{width:/.+/}},model:{key:"width",value:t=>t.getStyle("width")}})}}var tm='';const em={small:'',medium:tm,large:'',original:''};class im extends ud{static get requires(){return[Xg]}static get pluginName(){return"ImageResizeButtons"}constructor(t){super(t),this._resizeUnit=t.config.get("image.resizeUnit")}init(){const t=this.editor,e=t.config.get("image.resizeOptions"),i=t.commands.get("imageResize");this.bind("isEnabled").to(i);for(const t of e)this._registerImageResizeButton(t);this._registerImageResizeDropdown(e)}_registerImageResizeButton(t){const e=this.editor,{name:i,value:o,icon:n}=t,r=o?o+this._resizeUnit:null;e.ui.componentFactory.add(i,i=>{const o=new Kc(i),s=e.commands.get("imageResize"),a=this._getOptionLabelValue(t,!0);if(!em[n])throw new hi.a("imageresizebuttons-missing-icon",e,t);return o.set({label:a,icon:em[n],tooltip:a,isToggleable:!0}),o.bind("isEnabled").to(this),o.bind("isOn").to(s,"value",om(r)),this.listenTo(o,"execute",()=>{e.execute("imageResize",{width:r})}),o})}_registerImageResizeDropdown(t){const e=this.editor,i=e.t,o=t.find(t=>!t.value);e.ui.componentFactory.add("imageResize",n=>{const r=e.commands.get("imageResize"),s=od(n,Jc),a=s.buttonView;return a.set({tooltip:i("Resize image"),commandValue:o.value,icon:tm,isToggleable:!0,label:this._getOptionLabelValue(o),withText:!0,class:"ck-resize-image-button"}),a.bind("label").to(r,"value",t=>t&&t.width?t.width:this._getOptionLabelValue(o)),s.bind("isOn").to(r),s.bind("isEnabled").to(this),rd(s,this._getResizeDropdownListItemDefinitions(t,r)),s.listView.ariaLabel=i("Image resize list"),this.listenTo(s,"execute",t=>{e.execute(t.source.commandName,{width:t.source.commandValue}),e.editing.view.focus()}),s})}_getOptionLabelValue(t,e){const i=this.editor.t;return t.label?t.label:e?t.value?i("Resize image to %0",t.value+this._resizeUnit):i("Resize image to the original size"):t.value?t.value+this._resizeUnit:i("Original")}_getResizeDropdownListItemDefinitions(t,e){const i=new xi;return t.map(t=>{const o=t.value?t.value+this._resizeUnit:null,n={type:"button",model:new vu({commandName:"imageResize",commandValue:o,label:this._getOptionLabelValue(t),withText:!0,icon:null})};n.model.bind("isOn").to(e,"value",om(o)),i.add(n)}),i}}function om(t){return e=>null===t&&e===t||e&&e.width===t}class nm{constructor(t){this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=t,this._referenceCoordinates=null}begin(t,e,i){const o=new ns(e);this.activeHandlePosition=function(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const i of e)if(t.classList.contains("ck-widget__resizer__handle-"+i))return i}(t),this._referenceCoordinates=function(t,e){const i=new ns(t),o=e.split("-"),n={x:"right"==o[1]?i.right:i.left,y:"bottom"==o[0]?i.bottom:i.top};return n.x+=t.ownerDocument.defaultView.scrollX,n.y+=t.ownerDocument.defaultView.scrollY,n}(e,function(t){const e=t.split("-"),i={top:"bottom",bottom:"top",left:"right",right:"left"};return`${i[e[0]]}-${i[e[1]]}`}(this.activeHandlePosition)),this.originalWidth=o.width,this.originalHeight=o.height,this.aspectRatio=o.width/o.height;const n=i.style.width;n&&n.match(/^\d+\.?\d*%$/)?this.originalWidthPercents=parseFloat(n):this.originalWidthPercents=function(t,e){const i=t.parentElement,o=parseFloat(i.ownerDocument.defaultView.getComputedStyle(i).width);return e.width/o*100}(i,o)}update(t){this.proposedWidth=t.width,this.proposedHeight=t.height,this.proposedWidthPercents=t.widthPercents,this.proposedHandleHostWidth=t.handleHostWidth,this.proposedHandleHostHeight=t.handleHostHeight}}yi(nm,Uo);class rm{constructor(t){this._options=t,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",t=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),t.stop())},{priority:"high"}),this.on("change:isEnabled",()=>{this.isEnabled&&this.redraw()})}attach(){const t=this,e=this._options.viewElement;this._options.editor.editing.view.change(i=>{const o=i.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(e){const i=this.toDomElement(e);return t._appendHandles(i),t._appendSizeUI(i),t._domResizerWrapper=i,t.on("change:isEnabled",(t,e,o)=>{i.style.display=o?"":"none"}),i.style.display=t.isEnabled?"":"none",i}));i.insert(i.createPositionAt(e,"end"),o),i.addClass("ck-widget_with-resizer",e),this._viewResizerWrapper=o})}begin(t){this.state=new nm(this._options),this._sizeUI.bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(t,this._getHandleHost(),this._getResizeHost())}updateSize(t){const e=this._proposeNewSize(t);this._options.editor.editing.view.change(t=>{const i=this._options.unit||"%",o=("%"===i?e.widthPercents:e.width)+i;t.setStyle("width",o,this._options.viewElement)});const i=this._getHandleHost(),o=new ns(i);e.handleHostWidth=Math.round(o.width),e.handleHostHeight=Math.round(o.height);const n=new ns(i);e.width=Math.round(n.width),e.height=Math.round(n.height),this.redraw(o),this.state.update(e)}commit(){const t=this._options.unit||"%",e=("%"===t?this.state.proposedWidthPercents:this.state.proposedWidth)+t;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(e)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(t){const e=this._domResizerWrapper;if(!((i=e)&&i.ownerDocument&&i.ownerDocument.contains(i)))return;var i;const o=e.parentElement,n=this._getHandleHost(),r=this._viewResizerWrapper,s=[r.getStyle("width"),r.getStyle("height"),r.getStyle("left"),r.getStyle("top")];let a;if(o.isSameNode(n)){const e=t||new ns(n);a=[e.width+"px",e.height+"px",void 0,void 0]}else a=[n.offsetWidth+"px",n.offsetHeight+"px",n.offsetLeft+"px",n.offsetTop+"px"];"same"!==Li(s,a)&&this._options.editor.editing.view.change(t=>{t.setStyle({width:a[0],height:a[1],left:a[2],top:a[3]},r)})}containsHandle(t){return this._domResizerWrapper.contains(t)}static isResizeHandle(t){return t.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeUI.dismiss(),this._sizeUI.isVisible=!1;this._options.editor.editing.view.change(t=>{t.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(t){const e=this.state,i={x:(o=t).pageX,y:o.pageY};var o;const n=!this._options.isCentered||this._options.isCentered(this),r={x:e._referenceCoordinates.x-(i.x+e.originalWidth),y:i.y-e.originalHeight-e._referenceCoordinates.y};n&&e.activeHandlePosition.endsWith("-right")&&(r.x=i.x-(e._referenceCoordinates.x+e.originalWidth)),n&&(r.x*=2);const s={width:Math.abs(e.originalWidth+r.x),height:Math.abs(e.originalHeight+r.y)};s.dominant=s.width/e.aspectRatio>s.height?"width":"height",s.max=s[s.dominant];const a={width:s.width,height:s.height};return"width"==s.dominant?a.height=a.width/e.aspectRatio:a.width=a.height*e.aspectRatio,{width:Math.round(a.width),height:Math.round(a.height),widthPercents:Math.min(Math.round(e.originalWidthPercents/e.originalWidth*a.width*100)/100,100)}}_getResizeHost(){const t=this._domResizerWrapper.parentElement;return this._options.getResizeHost(t)}_getHandleHost(){const t=this._domResizerWrapper.parentElement;return this._options.getHandleHost(t)}_appendHandles(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const o of e)t.appendChild(new nc({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(i=o,"ck-widget__resizer__handle-"+i)}}).render());var i}_appendSizeUI(t){const e=new sm;e.render(),this._sizeUI=e,t.appendChild(e.element)}}yi(rm,Uo);class sm extends xc{constructor(){super();const t=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",t.to("activeHandlePosition",t=>t?"ck-orientation-"+t:"")],style:{display:t.if("isVisible","none",t=>!t)}},children:[{text:t.to("label")}]})}bindToState(t,e){this.bind("isVisible").to(e,"proposedWidth",e,"proposedHeight",(t,e)=>null!==t&&null!==e),this.bind("label").to(e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",e,"proposedWidthPercents",(e,i,o)=>"px"===t.unit?`${e}×${i}`:o+"%"),this.bind("activeHandlePosition").to(e)}dismiss(){this.unbind(),this.isVisible=!1}}var am=function(t,e,i){var o=!0,n=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return D(i)&&(o="leading"in i?!!i.leading:o,n="trailing"in i?!!i.trailing:n),Kr(t,e,{leading:o,maxWait:e,trailing:n})};i(80);class lm extends ud{static get pluginName(){return"WidgetResize"}init(){this.set("visibleResizer",null),this.set("_activeResizer",null),this._resizers=new Map;const t=rr.window.document;this.editor.model.schema.setAttributeProperties("width",{isFormatting:!0}),this.editor.editing.view.addObserver(kg),this._observer=Object.create(mr),this.listenTo(this.editor.editing.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this));const e=()=>{this.visibleResizer&&this.visibleResizer.redraw()},i=am(e,200);this.on("change:visibleResizer",e),this.editor.ui.on("update",i),this._observer.listenTo(rr.window,"resize",i);const o=this.editor.editing.view.document.selection;o.on("change",()=>{const t=o.getSelectedElement();this.visibleResizer=this.getResizerByViewElement(t)||null})}destroy(){this._observer.stopListening();for(const t of this._resizers.values())t.destroy()}attachTo(t){const e=new rm(t),i=this.editor.plugins;if(e.attach(),i.has("WidgetToolbarRepository")){const t=i.get("WidgetToolbarRepository");e.on("begin",()=>{t.forceDisabled("resize")},{priority:"lowest"}),e.on("cancel",()=>{t.clearForceDisabled("resize")},{priority:"highest"}),e.on("commit",()=>{t.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(t.viewElement,e);const o=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(o)==e&&(this.visibleResizer=e),e}getResizerByViewElement(t){return this._resizers.get(t)}_getResizerByHandle(t){for(const e of this._resizers.values())if(e.containsHandle(t))return e}_mouseDownListener(t,e){const i=e.domTarget;rm.isResizeHandle(i)&&(this._activeResizer=this._getResizerByHandle(i),this._activeResizer&&(this._activeResizer.begin(i),t.stop(),e.preventDefault()))}_mouseMoveListener(t,e){this._activeResizer&&this._activeResizer.updateSize(e)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}yi(lm,Uo);class cm extends ud{static get requires(){return[lm]}static get pluginName(){return"ImageResizeHandles"}init(){const t=this.editor.commands.get("imageResize");this.bind("isEnabled").to(t),this._setupResizerCreator()}_setupResizerCreator(){const t=this.editor,e=t.editing.view;e.addObserver(cg),this.listenTo(e.document,"imageLoaded",(i,o)=>{if(!o.target.matches("figure.image.ck-widget > img"))return;const n=t.editing.view.domConverter.domToView(o.target).findAncestor("figure");let r=this.editor.plugins.get(lm).getResizerByViewElement(n);if(r)return void r.redraw();const s=t.editing.mapper.toModelElement(n);r=t.plugins.get(lm).attachTo({unit:t.config.get("image.resizeUnit"),modelElement:s,viewElement:n,editor:t,getHandleHost:t=>t.querySelector("img"),getResizeHost:t=>t,isCentered(){const t=s.getAttribute("imageStyle");return!t||"full"==t||"alignCenter"==t},onCommit(e){t.execute("imageResize",{width:e})}}),r.on("updateSize",()=>{n.hasClass("image_resized")||e.change(t=>{t.addClass("image_resized",n)})}),r.bind("isEnabled").to(this)})}}i(82);class dm extends md{constructor(t,e){super(t),this.defaultStyle=!1,this.styles=e.reduce((t,e)=>(t[e.name]=e,e.isDefault&&(this.defaultStyle=e.name),t),{})}refresh(){const t=this.editor.model.document.selection.getSelectedElement();if(this.isEnabled=hg(t),t)if(t.hasAttribute("imageStyle")){const e=t.getAttribute("imageStyle");this.value=!!this.styles[e]&&e}else this.value=this.defaultStyle;else this.value=!1}execute(t){const e=t.value,i=this.editor.model,o=i.document.selection.getSelectedElement();i.change(t=>{this.styles[e].isDefault?t.removeAttribute("imageStyle",o):t.setAttribute("imageStyle",e,o)})}}function hm(t,e){for(const i of e)if(i.name===t)return i}var um='',gm='',mm='',fm='';const pm={full:{name:"full",title:"Full size image",icon:um,isDefault:!0},side:{name:"side",title:"Side image",icon:fm,className:"image-style-side"},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:gm,className:"image-style-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:mm,className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:fm,className:"image-style-align-right"}},bm={full:um,left:gm,right:fm,center:mm};function wm(t=[]){return t.map(km)}function km(t){if("string"==typeof t){const e=t;pm[e]?t=Object.assign({},pm[e]):(Object(hi.c)("image-style-not-found",{name:e}),t={name:e})}else if(pm[t.name]){const e=pm[t.name],i=Object.assign({},t);for(const o in e)Object.prototype.hasOwnProperty.call(t,o)||(i[o]=e[o]);t=i}return"string"==typeof t.icon&&bm[t.icon]&&(t.icon=bm[t.icon]),t}class _m extends ud{static get pluginName(){return"ImageStyleEditing"}init(){const t=this.editor,e=t.model.schema,i=t.data,o=t.editing;t.config.define("image.styles",["full","side"]);const n=wm(t.config.get("image.styles"));e.extend("image",{allowAttributes:"imageStyle"});const r=function(t){return(e,i,o)=>{if(!o.consumable.consume(i.item,e.name))return;const n=hm(i.attributeNewValue,t),r=hm(i.attributeOldValue,t),s=o.mapper.toViewElement(i.item),a=o.writer;r&&a.removeClass(r.className,s),n&&a.addClass(n.className,s)}}(n);o.downcastDispatcher.on("attribute:imageStyle:image",r),i.downcastDispatcher.on("attribute:imageStyle:image",r),i.upcastDispatcher.on("element:figure",function(t){const e=t.filter(t=>!t.isDefault);return(t,i,o)=>{if(!i.modelRange)return;const n=i.viewItem,r=pd(i.modelRange.getItems());if(o.schema.checkAttribute(r,"imageStyle"))for(const t of e)o.consumable.consume(n,{classes:t.className})&&o.writer.setAttribute("imageStyle",t.name,r)}}(n),{priority:"low"}),t.commands.add("imageStyle",new dm(t,n))}}i(84);class vm extends ud{static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Full size image":t("Full size image"),"Side image":t("Side image"),"Left aligned image":t("Left aligned image"),"Centered image":t("Centered image"),"Right aligned image":t("Right aligned image")}}init(){const t=function(t,e){for(const i of t)e[i.title]&&(i.title=e[i.title]);return t}(wm(this.editor.config.get("image.styles")),this.localizedDefaultStylesTitles);for(const e of t)this._createButton(e)}_createButton(t){const e=this.editor,i="imageStyle:"+t.name;e.ui.componentFactory.add(i,i=>{const o=e.commands.get("imageStyle"),n=new Kc(i);return n.set({label:t.title,icon:t.icon,tooltip:!0,isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",e=>e===t.name),this.listenTo(n,"execute",()=>{e.execute("imageStyle",{value:t.name}),e.editing.view.focus()}),n})}}class ym extends ud{static get requires(){return[jg]}static get pluginName(){return"WidgetToolbarRepository"}init(){const t=this.editor;if(t.plugins.has("BalloonToolbar")){const e=t.plugins.get("BalloonToolbar");this.listenTo(e,"show",e=>{(function(t){const e=t.getSelectedElement();return!(!e||!tg(e))})(t.editing.view.document.selection)&&e.stop()},{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const t of this._toolbarDefinitions.values())t.view.destroy()}register(t,{ariaLabel:e,items:i,getRelatedElement:o,balloonClassName:n="ck-toolbar-container"}){if(!i.length)return void Object(hi.c)("widget-toolbar-no-items",{toolbarId:t});const r=this.editor,s=r.t,a=new sd(r.locale);if(a.ariaLabel=e||s("Widget toolbar"),this._toolbarDefinitions.has(t))throw new hi.a("widget-toolbar-duplicated",this,{toolbarId:t});a.fillFromConfig(i,r.ui.componentFactory),this._toolbarDefinitions.set(t,{view:a,getRelatedElement:o,balloonClassName:n})}_updateToolbarsVisibility(){let t=0,e=null,i=null;for(const o of this._toolbarDefinitions.values()){const n=o.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&n)if(this.editor.ui.focusTracker.isFocused){const r=n.getAncestors().length;r>t&&(t=r,e=n,i=o)}else this._isToolbarVisible(o)&&this._hideToolbar(o);else this._isToolbarInBalloon(o)&&this._hideToolbar(o)}i&&this._showToolbar(i,e)}_hideToolbar(t){this._balloon.remove(t.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(t,e){this._isToolbarVisible(t)?xm(this.editor,e):this._isToolbarInBalloon(t)||(this._balloon.add({view:t.view,position:Am(this.editor,e),balloonClassName:t.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const t of this._toolbarDefinitions.values())if(this._isToolbarVisible(t)){const e=t.getRelatedElement(this.editor.editing.view.document.selection);xm(this.editor,e)}}))}_isToolbarVisible(t){return this._balloon.visibleView===t.view}_isToolbarInBalloon(t){return this._balloon.hasView(t.view)}}function xm(t,e){const i=t.plugins.get("ContextualBalloon"),o=Am(t,e);i.updatePosition(o)}function Am(t,e){const i=t.editing.view,o=Yu.defaultPositions;return{target:i.domConverter.mapViewToDom(e),positions:[o.northArrowSouth,o.northArrowSouthWest,o.northArrowSouthEast,o.southArrowNorth,o.southArrowNorthWest,o.southArrowNorthEast,ng]}}class Tm extends xc{constructor(t){super(t),this.buttonView=new Kc(t),this._fileInputView=new Cm(t),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class Cm extends xc{constructor(t){super(t),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:e.to("acceptedType"),multiple:e.to("allowMultipleFiles")},on:{change:e.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}function Sm(t){const e=t.map(t=>t.replace("+","\\+"));return new RegExp(`^image\\/(${e.join("|")})$`)}class Pm extends ud{static get pluginName(){return"ImageUploadUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageUpload",i=>{const o=new Tm(i),n=t.commands.get("imageUpload"),r=t.config.get("image.upload.types"),s=Sm(r);return o.set({acceptedType:r.map(t=>"image/"+t).join(","),allowMultipleFiles:!0}),o.buttonView.set({label:e("Insert image"),icon:'',tooltip:!0}),o.buttonView.bind("isEnabled").to(n),o.on("done",(e,i)=>{const o=Array.from(i).filter(t=>s.test(t.type));o.length&&t.execute("imageUpload",{file:o})}),o})}}class Em{constructor(t){this.context=t}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}yi(Em,Uo);class Mm extends Em{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new xi({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(t){if("string"!=typeof t)throw new hi.a("pendingactions-add-invalid-message",this);const e=Object.create(Uo);return e.set("message",t),this._actions.add(e),this.hasAny=!0,e}remove(t){this._actions.remove(t),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}class Lm{constructor(){const t=new window.FileReader;this._reader=t,this._data=void 0,this.set("loaded",0),t.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(t){const e=this._reader;return this.total=t.size,new Promise((i,o)=>{e.onload=()=>{const t=e.result;this._data=t,i(t)},e.onerror=()=>{o("error")},e.onabort=()=>{o("aborted")},this._reader.readAsDataURL(t)})}abort(){this._reader.abort()}}yi(Lm,Uo);class Im extends ud{static get pluginName(){return"FileRepository"}static get requires(){return[Mm]}init(){this.loaders=new xi,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",(t,e)=>e?t/e*100:0)}getLoader(t){return this._loadersMap.get(t)||null}createLoader(t){if(!this.createUploadAdapter)return Object(hi.c)("filerepository-no-upload-adapter"),null;const e=new Nm(Promise.resolve(t),this.createUploadAdapter);return this.loaders.add(e),this._loadersMap.set(t,e),t instanceof Promise&&e.file.then(t=>{this._loadersMap.set(t,e)}).catch(()=>{}),e.on("change:uploaded",()=>{let t=0;for(const e of this.loaders)t+=e.uploaded;this.uploaded=t}),e.on("change:uploadTotal",()=>{let t=0;for(const e of this.loaders)e.uploadTotal&&(t+=e.uploadTotal);this.uploadTotal=t}),e}destroyLoader(t){const e=t instanceof Nm?t:this.getLoader(t);e._destroy(),this.loaders.remove(e),this._loadersMap.forEach((t,i)=>{t===e&&this._loadersMap.delete(i)})}_updatePendingAction(){const t=this.editor.plugins.get(Mm);if(this.loaders.length){if(!this._pendingAction){const e=this.editor.t,i=t=>`${e("Upload in progress")} ${parseInt(t)}%.`;this._pendingAction=t.add(i(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",i)}}else t.remove(this._pendingAction),this._pendingAction=null}}yi(Im,Uo);class Nm{constructor(t,e){this.id=ci(),this._filePromiseWrapper=this._createFilePromiseWrapper(t),this._adapter=e(this),this._reader=new Lm,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(t=>this._filePromiseWrapper?t:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new hi.a("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(t=>this._reader.read(t)).then(t=>{if("reading"!==this.status)throw this.status;return this.status="idle",t}).catch(t=>{if("aborted"===t)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:t})}upload(){if("idle"!=this.status)throw new hi.a("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(t=>(this.uploadResponse=t,this.status="idle",t)).catch(t=>{if("aborted"===this.status)throw"aborted";throw this.status="error",t})}abort(){const t=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==t?this._reader.abort():"uploading"==t&&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(t){const e={};return e.promise=new Promise((i,o)=>{e.rejecter=o,e.isFulfilled=!1,t.then(t=>{e.isFulfilled=!0,i(t)}).catch(t=>{e.isFulfilled=!0,o(t)})}),e}}yi(Nm,Uo);i(86),i(88),i(90);class zm extends ud{constructor(t){super(t),this.placeholder="data:image/svg+xml;utf8,"+encodeURIComponent('')}init(){this.editor.editing.downcastDispatcher.on("attribute:uploadStatus:image",(...t)=>this.uploadStatusChange(...t))}uploadStatusChange(t,e,i){const o=this.editor,n=e.item,r=n.getAttribute("uploadId");if(!i.consumable.consume(e.item,t.name))return;const s=o.plugins.get(Im),a=r?e.attributeNewValue:null,l=this.placeholder,c=o.editing.mapper.toViewElement(n),d=i.writer;if("reading"==a)return Om(c,d),void Rm(l,c,d);if("uploading"==a){const t=s.loaders.get(r);return Om(c,d),void(t?(Dm(c,d),function(t,e,i,o){const n=function(t){const e=t.createUIElement("div",{class:"ck-progress-bar"});return t.setCustomProperty("progressBar",!0,e),e}(e);e.insert(e.createPositionAt(t,"end"),n),i.on("change:uploadedPercent",(t,e,i)=>{o.change(t=>{t.setStyle("width",i+"%",n)})})}(c,d,t,o.editing.view),function(t,e,i){if(i.data){const o=mg(t);e.setAttribute("src",i.data,o)}}(c,d,t)):Rm(l,c,d))}"complete"==a&&s.loaders.get(r)&&function(t,e,i){const o=e.createUIElement("div",{class:"ck-image-upload-complete-icon"});e.insert(e.createPositionAt(t,"end"),o),setTimeout(()=>{i.change(t=>t.remove(t.createRangeOn(o)))},3e3)}(c,d,o.editing.view),function(t,e){jm(t,e,"progressBar")}(c,d),Dm(c,d),function(t,e){e.removeClass("ck-appear",t)}(c,d)}}function Om(t,e){t.hasClass("ck-appear")||e.addClass("ck-appear",t)}function Rm(t,e,i){e.hasClass("ck-image-upload-placeholder")||i.addClass("ck-image-upload-placeholder",e);const o=mg(e);o.getAttribute("src")!==t&&i.setAttribute("src",t,o),Vm(e,"placeholder")||i.insert(i.createPositionAfter(o),function(t){const e=t.createUIElement("div",{class:"ck-upload-placeholder-loader"});return t.setCustomProperty("placeholder",!0,e),e}(i))}function Dm(t,e){t.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",t),jm(t,e,"placeholder")}function Vm(t,e){for(const i of t.getChildren())if(i.getCustomProperty(e))return i}function jm(t,e,i){const o=Vm(t,i);o&&e.remove(e.createRangeOn(o))}class Bm extends Em{static get pluginName(){return"Notification"}init(){this.on("show:warning",(t,e)=>{window.alert(e.message)},{priority:"lowest"})}showSuccess(t,e={}){this._showNotification({message:t,type:"success",namespace:e.namespace,title:e.title})}showInfo(t,e={}){this._showNotification({message:t,type:"info",namespace:e.namespace,title:e.title})}showWarning(t,e={}){this._showNotification({message:t,type:"warning",namespace:e.namespace,title:e.title})}_showNotification(t){const e="show:"+t.type+(t.namespace?":"+t.namespace:"");this.fire(e,{message:t.message,type:t.type,title:t.title||""})}}class Fm{constructor(t){this.document=t}createDocumentFragment(t){return new En(this.document,t)}createElement(t,e,i){return new zo(this.document,t,e,i)}createText(t){return new zi(this.document,t)}clone(t,e=!1){return t._clone(e)}appendChild(t,e){return e._appendChild(t)}insertChild(t,e,i){return i._insertChild(t,e)}removeChildren(t,e,i){return i._removeChildren(t,e)}remove(t){const e=t.parent;return e?this.removeChildren(e.getChildIndex(t),1,e):[]}replace(t,e){const i=t.parent;if(i){const o=i.getChildIndex(t);return this.removeChildren(o,1,i),this.insertChild(o,e,i),!0}return!1}unwrapElement(t){const e=t.parent;if(e){const i=e.getChildIndex(t);this.remove(t),this.insertChild(i,t.getChildren(),e)}}rename(t,e){const i=new zo(this.document,t,e.getAttributes(),e.getChildren());return this.replace(e,i)?i:null}setAttribute(t,e,i){i._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,i){y(t)&&void 0===i&&(i=e),i._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,i){i._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}createPositionAt(t,e){return Xo._createAt(t,e)}createPositionAfter(t){return Xo._createAfter(t)}createPositionBefore(t){return Xo._createBefore(t)}createRange(t,e){return new tn(t,e)}createRangeOn(t){return tn._createOn(t)}createRangeIn(t){return tn._createIn(t)}createSelection(t,e,i){return new nn(t,e,i)}}class Hm extends md{refresh(){const t=this.editor.model.document.selection.getSelectedElement(),e=t&&"image"===t.name||!1;this.isEnabled=gg(this.editor.model)||e}execute(t){const e=this.editor,i=e.model,o=e.plugins.get(Im);for(const e of Ti(t.file))Um(i,o,e)}}function Um(t,e,i){const o=e.createLoader(i);o&&ug(t,{uploadId:o.id})}class qm extends ud{static get requires(){return[Im,Bm,jd]}static get pluginName(){return"ImageUploadEditing"}constructor(t){super(t),t.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}})}init(){const t=this.editor,e=t.model.document,i=t.model.schema,o=t.conversion,n=t.plugins.get(Im),r=Sm(t.config.get("image.upload.types"));i.extend("image",{allowAttributes:["uploadId","uploadStatus"]}),t.commands.add("imageUpload",new Hm(t)),o.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(t.editing.view.document,"clipboardInput",(e,i)=>{if(o=i.dataTransfer,Array.from(o.types).includes("text/html")&&""!==o.getData("text/html"))return;var o;const n=Array.from(i.dataTransfer.files).filter(t=>!!t&&r.test(t.type)),s=i.targetRanges.map(e=>t.editing.mapper.toModelRange(e));t.model.change(i=>{i.setSelection(s),n.length&&(e.stop(),t.model.enqueueChange("default",()=>{t.execute("imageUpload",{file:n})}))})}),this.listenTo(t.plugins.get(jd),"inputTransformation",(e,i)=>{const o=Array.from(t.editing.view.createRangeIn(i.content)).filter(t=>{return!(!(e=t.item).is("element","img")||!e.getAttribute("src"))&&(e.getAttribute("src").match(/^data:image\/\w+;base64,/g)||e.getAttribute("src").match(/^blob:/g))&&!t.item.getAttribute("uploadProcessed");var e}).map(t=>{return{promise:(e=t.item,new Promise((t,i)=>{const o=e.getAttribute("src");fetch(o).then(t=>t.blob()).then(e=>{const i=function(t,e){return t.type?t.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}(e,o),n=i.replace("image/",""),r=new File([e],"image."+n,{type:i});t(r)}).catch(i)})),imageElement:t.item};var e});if(!o.length)return;const r=new Fm(t.editing.view.document);for(const t of o){r.setAttribute("uploadProcessed",!0,t.imageElement);const e=n.createLoader(t.promise);e&&(r.setAttribute("src","",t.imageElement),r.setAttribute("uploadId",e.id,t.imageElement))}}),t.editing.view.document.on("dragover",(t,e)=>{e.preventDefault()}),e.on("change",()=>{const i=e.differ.getChanges({includeChangesInGraveyard:!0});for(const e of i)if("insert"==e.type&&"$text"!=e.name){const i=e.position.nodeAfter,o="$graveyard"==e.position.root.rootName;for(const e of Wm(t,i)){const t=e.getAttribute("uploadId");if(!t)continue;const i=n.loaders.get(t);i&&(o?i.abort():"idle"==i.status&&this._readAndUpload(i,e))}}})}_readAndUpload(t,e){const i=this.editor,o=i.model,n=i.locale.t,r=i.plugins.get(Im),s=i.plugins.get(Bm);return o.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","reading",e)}),t.read().then(()=>{const n=t.upload();if(gn.isSafari){const t=mg(i.editing.mapper.toViewElement(e));i.editing.view.once("render",()=>{if(!t.parent)return;const e=i.editing.view.domConverter.mapViewToDom(t.parent);if(!e)return;const o=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=o})}return o.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","uploading",e)}),n}).then(t=>{o.enqueueChange("transparent",i=>{i.setAttributes({uploadStatus:"complete",src:t.default},e),this._parseAndSetSrcsetAttributeOnImage(t,e,i)}),a()}).catch(i=>{if("error"!==t.status&&"aborted"!==t.status)throw i;"error"==t.status&&i&&s.showWarning(i,{title:n("Upload failed"),namespace:"upload"}),a(),o.enqueueChange("transparent",t=>{t.remove(e)})});function a(){o.enqueueChange("transparent",t=>{t.removeAttribute("uploadId",e),t.removeAttribute("uploadStatus",e)}),r.destroyLoader(t)}}_parseAndSetSrcsetAttributeOnImage(t,e,i){let o=0;const n=Object.keys(t).filter(t=>{const e=parseInt(t,10);if(!isNaN(e))return o=Math.max(o,e),!0}).map(e=>`${t[e]} ${e}w`).join(", ");""!=n&&i.setAttribute("srcset",{data:n,width:o},e)}}function Wm(t,e){return Array.from(t.model.createRangeOn(e)).filter(t=>t.item.is("element","image")).map(t=>t.item)}class $m extends ud{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"italic"}),t.model.schema.setAttributeProperties("italic",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"italic",view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add("italic",new Id(t,"italic")),t.keystrokes.set("CTRL+I","italic")}}class Gm extends ud{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("italic",i=>{const o=t.commands.get("italic"),n=new Kc(i);return n.set({label:e("Italic"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),n.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(n,"execute",()=>{t.execute("italic"),t.editing.view.focus()}),n})}}class Ym extends ud{static get pluginName(){return"TwoStepCaretMovement"}constructor(t){super(t),this.attributes=new Set,this._overrideUid=null}init(){const t=this.editor,e=t.model,i=t.editing.view,o=t.locale,n=e.document.selection;this.listenTo(i.document,"keydown",(t,e)=>{if(!n.isCollapsed)return;if(e.shiftKey||e.altKey||e.ctrlKey)return;const i=e.keyCode==pn.arrowright,r=e.keyCode==pn.arrowleft;if(!i&&!r)return;const s=o.contentLanguageDirection;let a=!1;a="ltr"===s&&i||"rtl"===s&&r?this._handleForwardMovement(e):this._handleBackwardMovement(e),!0===a&&t.stop()},{priority:di.get("high")+1}),this._isNextGravityRestorationSkipped=!1,this.listenTo(n,"change:range",(t,e)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!e.directChange&&Zm(n.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(t){this.attributes.add(t)}_handleForwardMovement(t){const e=this.attributes,i=this.editor.model.document.selection,o=i.getFirstPosition();return!this._isGravityOverridden&&((!o.isAtStart||!Km(i,e))&&(Zm(o,e)?(Jm(t),this._overrideGravity(),!0):void 0))}_handleBackwardMovement(t){const e=this.attributes,i=this.editor.model,o=i.document.selection,n=o.getFirstPosition();return this._isGravityOverridden?(Jm(t),this._restoreGravity(),Qm(i,e,n),!0):n.isAtStart?!!Km(o,e)&&(Jm(t),Qm(i,e,n),!0):function(t,e){return Zm(t.getShiftedBy(-1),e)}(n,e)?n.isAtEnd&&!Km(o,e)&&Zm(n,e)?(Jm(t),Qm(i,e,n),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):void 0}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(t=>t.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(t=>{t.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function Km(t,e){for(const i of e)if(t.hasAttribute(i))return!0;return!1}function Qm(t,e,i){const o=i.nodeBefore;t.change(t=>{o?t.setSelectionAttribute(o.getAttributes()):t.removeSelectionAttribute(e)})}function Jm(t){t.preventDefault()}function Zm(t,e){const{nodeBefore:i,nodeAfter:o}=t;for(const t of e){const e=i?i.getAttribute(t):void 0;if((o?o.getAttribute(t):void 0)!==e)return!0}return!1}function Xm(t,e,i,o){return o.createRange(tf(t,e,i,!0,o),tf(t,e,i,!1,o))}function tf(t,e,i,o,n){let r=t.textNode||(o?t.nodeBefore:t.nodeAfter),s=null;for(;r&&r.getAttribute(e)==i;)s=r,r=o?r.previousSibling:r.nextSibling;return s?n.createPositionAt(s,o?"before":"after"):t}class ef{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){Array.isArray(t)?t.forEach(t=>this._definitions.add(t)):this._definitions.add(t)}getDispatcher(){return t=>{t.on("attribute:linkHref",(t,e,i)=>{if(!i.consumable.test(e.item,"attribute:linkHref"))return;const o=i.writer,n=o.document.selection;for(const t of this._definitions){const r=o.createAttributeElement("a",t.attributes,{priority:5});o.setCustomProperty("link",!0,r),t.callback(e.attributeNewValue)?e.item.is("selection")?o.wrap(n.getFirstRange(),r):o.wrap(i.mapper.toViewRange(e.range),r):o.unwrap(i.mapper.toViewRange(e.range),r)}},{priority:"high"})}}getDispatcherForLinkedImage(){return t=>{t.on("attribute:linkHref:image",(t,e,i)=>{const o=i.mapper.toViewElement(e.item),n=Array.from(o.getChildren()).find(t=>"a"===t.name);for(const t of this._definitions){const o=Ri(t.attributes);if(t.callback(e.attributeNewValue))for(const[t,e]of o)"class"===t?i.writer.addClass(e,n):i.writer.setAttribute(t,e,n);else for(const[t,e]of o)"class"===t?i.writer.removeClass(e,n):i.writer.removeAttribute(t,n)}})}}}var of=function(t,e,i){var o=t.length;return i=void 0===i?o:i,!e&&i>=o?t:oo(t,e,i)},nf=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var rf=function(t){return nf.test(t)};var sf=function(t){return t.split("")},af="[\\ud800-\\udfff]",lf="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",cf="\\ud83c[\\udffb-\\udfff]",df="[^\\ud800-\\udfff]",hf="(?:\\ud83c[\\udde6-\\uddff]){2}",uf="[\\ud800-\\udbff][\\udc00-\\udfff]",gf="(?:"+lf+"|"+cf+")"+"?",mf="[\\ufe0e\\ufe0f]?"+gf+("(?:\\u200d(?:"+[df,hf,uf].join("|")+")[\\ufe0e\\ufe0f]?"+gf+")*"),ff="(?:"+[df+lf+"?",lf,hf,uf,af].join("|")+")",pf=RegExp(cf+"(?="+cf+")|"+ff+mf,"g");var bf=function(t){return t.match(pf)||[]};var wf=function(t){return rf(t)?bf(t):sf(t)};var kf=function(t){return function(e){e=Zi(e);var i=rf(e)?wf(e):void 0,o=i?i[0]:e.charAt(0),n=i?of(i,1).join(""):e.slice(1);return o[t]()+n}}("toUpperCase");const _f=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,vf=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,yf=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,xf=/^((\w+:(\/{2,})?)|(\W))/i;function Af(t,{writer:e}){const i=e.createAttributeElement("a",{href:t},{priority:5});return e.setCustomProperty("link",!0,i),i}function Tf(t){return function(t){return t.replace(_f,"").match(vf)}(t=String(t))?t:"#"}function Cf(t,e){return!!t&&(t.is("element","image")&&e.checkAttribute("image","linkHref"))}function Sf(t,e){const i=(o=t,yf.test(o)?"mailto:":e);var o;const n=!!i&&!xf.test(t);return t&&n?i+t:t}class Pf extends md{constructor(t){super(t),this.manualDecorators=new xi,this.automaticDecorators=new ef}restoreManualDecoratorStates(){for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}refresh(){const t=this.editor.model,e=t.document,i=pd(e.selection.getSelectedBlocks());Cf(i,t.schema)?(this.value=i.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttribute(i,"linkHref")):(this.value=e.selection.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"linkHref"));for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}execute(t,e={}){const i=this.editor.model,o=i.document.selection,n=[],r=[];for(const t in e)e[t]?n.push(t):r.push(t);i.change(e=>{if(o.isCollapsed){const s=o.getFirstPosition();if(o.hasAttribute("linkHref")){const a=Xm(s,"linkHref",o.getAttribute("linkHref"),i);e.setAttribute("linkHref",t,a),n.forEach(t=>{e.setAttribute(t,!0,a)}),r.forEach(t=>{e.removeAttribute(t,a)}),e.setSelection(e.createPositionAfter(a.end.nodeBefore))}else if(""!==t){const r=Ri(o.getAttributes());r.set("linkHref",t),n.forEach(t=>{r.set(t,!0)});const{end:a}=i.insertContent(e.createText(t,r),s);e.setSelection(a)}["linkHref",...n,...r].forEach(t=>{e.removeSelectionAttribute(t)})}else{const s=i.schema.getValidRanges(o.getRanges(),"linkHref"),a=[];for(const t of o.getSelectedBlocks())i.schema.checkAttribute(t,"linkHref")&&a.push(e.createRangeOn(t));const l=a.slice();for(const t of s)this._isRangeToUpdate(t,a)&&l.push(t);for(const i of l)e.setAttribute("linkHref",t,i),n.forEach(t=>{e.setAttribute(t,!0,i)}),r.forEach(t=>{e.removeAttribute(t,i)})}})}_getDecoratorStateFromModel(t){const e=this.editor.model,i=e.document,o=pd(i.selection.getSelectedBlocks());return Cf(o,e.schema)?o.getAttribute(t):i.selection.getAttribute(t)}_isRangeToUpdate(t,e){for(const i of e)if(i.containsRange(t))return!1;return!0}}class Ef extends md{refresh(){const t=this.editor.model,e=t.document,i=pd(e.selection.getSelectedBlocks());Cf(i,t.schema)?this.isEnabled=t.schema.checkAttribute(i,"linkHref"):this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"linkHref")}execute(){const t=this.editor,e=this.editor.model,i=e.document.selection,o=t.commands.get("link");e.change(t=>{const n=i.isCollapsed?[Xm(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),e)]:e.schema.getValidRanges(i.getRanges(),"linkHref");for(const e of n)if(t.removeAttribute("linkHref",e),o)for(const i of o.manualDecorators)t.removeAttribute(i.id,e)})}}class Mf{constructor({id:t,label:e,attributes:i,defaultValue:o}){this.id=t,this.set("value"),this.defaultValue=o,this.label=e,this.attributes=i}}yi(Mf,Uo);i(92);const Lf=/^(https?:)?\/\//;class If extends ud{static get pluginName(){return"LinkEditing"}static get requires(){return[Ym,dh,jd]}constructor(t){super(t),t.config.define("link",{addTargetToExternalLinks:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Af}),t.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(t,e)=>Af(Tf(t),e)}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:t=>t.getAttribute("href")}}),t.commands.add("link",new Pf(t)),t.commands.add("unlink",new Ef(t));const e=function(t,e){const i={"Open in a new tab":t("Open in a new tab"),Downloadable:t("Downloadable")};return e.forEach(t=>(t.label&&i[t.label]&&(t.label=i[t.label]),t)),e}(t.t,function(t){const e=[];if(t)for(const[i,o]of Object.entries(t)){const t=Object.assign({},o,{id:"link"+kf(i)});e.push(t)}return e}(t.config.get("link.decorators")));this._enableAutomaticDecorators(e.filter(t=>"automatic"===t.mode)),this._enableManualDecorators(e.filter(t=>"manual"===t.mode));t.plugins.get(Ym).registerAttribute("linkHref"),function(t,e,i,o){const n=t.editing.view,r=new Set;n.document.registerPostFixer(n=>{const s=t.model.document.selection;let a=!1;if(s.hasAttribute(e)){const l=Xm(s.getFirstPosition(),e,s.getAttribute(e),t.model),c=t.editing.mapper.toViewRange(l);for(const t of c.getItems())t.is("element",i)&&!t.hasClass(o)&&(n.addClass(o,t),r.add(t),a=!0)}return a}),t.conversion.for("editingDowncast").add(t=>{function e(){n.change(t=>{for(const e of r.values())t.removeClass(o,e),r.delete(e)})}t.on("insert",e,{priority:"highest"}),t.on("remove",e,{priority:"highest"}),t.on("attribute",e,{priority:"highest"}),t.on("selection",e,{priority:"highest"})})}(t,"linkHref","a","ck-link_selected"),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(t){const e=this.editor,i=e.commands.get("link").automaticDecorators;e.config.get("link.addTargetToExternalLinks")&&i.add({id:"linkIsExternal",mode:"automatic",callback:t=>Lf.test(t),attributes:{target:"_blank",rel:"noopener noreferrer"}}),i.add(t),i.length&&e.conversion.for("downcast").add(i.getDispatcher())}_enableManualDecorators(t){if(!t.length)return;const e=this.editor,i=e.commands.get("link").manualDecorators;t.forEach(t=>{e.model.schema.extend("$text",{allowAttributes:t.id}),i.add(new Mf(t)),e.conversion.for("downcast").attributeToElement({model:t.id,view:(e,{writer:o})=>{if(e){const e=i.get(t.id).attributes,n=o.createAttributeElement("a",e,{priority:5});return o.setCustomProperty("link",!0,n),n}}}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:i.get(t.id).attributes},model:{key:t.id}})})}_enableInsertContentSelectionAttributesFixer(){const t=this.editor,e=t.model,i=e.document.selection,o=t.commands.get("link");this.listenTo(e,"insertContent",()=>{const t=i.anchor.nodeBefore,n=i.anchor.nodeAfter;i.hasAttribute("linkHref")&&t&&t.hasAttribute("linkHref")&&(n&&n.hasAttribute("linkHref")||e.change(t=>{Nf(t,o.manualDecorators)}))},{priority:"low"})}_enableClickingAfterLink(){const t=this.editor,e=t.commands.get("link");t.editing.view.addObserver(kg);let i=!1;this.listenTo(t.editing.view.document,"mousedown",()=>{i=!0}),this.listenTo(t.editing.view.document,"selectionChange",()=>{if(!i)return;i=!1;const o=t.model.document.selection;if(!o.isCollapsed)return;if(!o.hasAttribute("linkHref"))return;const n=o.getFirstPosition(),r=Xm(n,"linkHref",o.getAttribute("linkHref"),t.model);(n.isTouching(r.start)||n.isTouching(r.end))&&t.model.change(t=>{Nf(t,e.manualDecorators)})})}_enableTypingOverLink(){const t=this.editor,e=t.editing.view;let i,o;this.listenTo(e.document,"delete",()=>{o=!0},{priority:"high"}),this.listenTo(t.model,"deleteContent",()=>{const e=t.model.document.selection;e.isCollapsed||(o?o=!1:zf(t)&&function(t){const e=t.document.selection,i=e.getFirstPosition(),o=e.getLastPosition(),n=i.nodeAfter;if(!n)return!1;if(!n.is("$text"))return!1;if(!n.hasAttribute("linkHref"))return!1;const r=o.textNode||o.nodeBefore;if(n===r)return!0;return Xm(i,"linkHref",n.getAttribute("linkHref"),t).containsRange(t.createRange(i,o),!0)}(t.model)&&(i=e.getAttributes()))},{priority:"high"}),this.listenTo(t.model,"insertContent",(e,[n])=>{o=!1,zf(t)&&i&&(t.model.change(t=>{for(const[e,o]of i)t.setAttribute(e,o,n)}),i=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const t=this.editor,e=t.model,i=e.document.selection,o=t.editing.view,n=t.commands.get("link");let r=!1,s=!1;this.listenTo(o.document,"delete",(t,e)=>{s=e.domEvent.keyCode===pn.backspace},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{r=!1;const t=i.getFirstPosition(),o=i.getAttribute("linkHref");if(!o)return;const n=Xm(t,"linkHref",o,e);r=n.containsPosition(t)||n.end.isEqual(t)},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{s&&(s=!1,r||t.model.enqueueChange(t=>{Nf(t,n.manualDecorators)}))},{priority:"low"})}}function Nf(t,e){t.removeSelectionAttribute("linkHref");for(const i of e)t.removeSelectionAttribute(i.id)}function zf(t){return t.plugins.get("Input").isInput(t.model.change(t=>t.batch))}class Of extends Vr{constructor(t){super(t),this.domEventType="click"}onDomEvent(t){this.fire(t.type,t)}}i(94);class Rf extends xc{constructor(t,e){super(t);const i=t.t;this.focusTracker=new Yl,this.keystrokes=new jl,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(i("Save"),Og,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(i("Cancel"),Rg,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e),this.children=this._createFormChildren(e.manualDecorators),this._focusables=new oc,this._focusCycler=new Oc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const o=["ck","ck-link-form","ck-responsive-form"];e.manualDecorators.length&&o.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:o,tabindex:"-1"},children:this.children}),Ng(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((t,e)=>(t[e.name]=e.isOn,t),{})}render(){super.render(),zg({view:this});[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t,e=new Mg(this.locale,Ig);return e.label=t("Link URL"),e}_createButton(t,e,i,o){const n=new Kc(this.locale);return n.set({label:t,icon:e,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),o&&n.delegate("execute").to(this,o),n}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const i of t.manualDecorators){const o=new ed(this.locale);o.set({name:i.id,label:i.label,withText:!0}),o.bind("isOn").toMany([i,t],"value",(t,e)=>void 0===e&&void 0===t?i.defaultValue:t),o.on("execute",()=>{i.set("value",!o.isOn)}),e.add(o)}return e}_createFormChildren(t){const e=this.createCollection();if(e.add(this.urlInputView),t.length){const t=new xc;t.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(t=>({tag:"li",children:[t],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),e.add(t)}return e.add(this.saveButtonView),e.add(this.cancelButtonView),e}}i(96);class Df extends xc{constructor(t){super(t);const e=t.t;this.focusTracker=new Yl,this.keystrokes=new jl,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(e("Unlink"),'',"unlink"),this.editButtonView=this._createButton(e("Edit link"),'',"edit"),this.set("href"),this._focusables=new oc,this._focusCycler=new Oc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render();[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(t,e,i){const o=new Kc(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.delegate("execute").to(this,i),o}_createPreviewButton(){const t=new Kc(this.locale),e=this.bindTemplate,i=this.t;return t.set({withText:!0,tooltip:i("Open link in new tab")}),t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",t=>t&&Tf(t)),target:"_blank",rel:"noopener noreferrer"}}),t.bind("label").to(this,"href",t=>t||i("This link has no URL")),t.bind("isEnabled").to(this,"href",t=>!!t),t.template.tag="a",t.template.eventListeners={},t}}class Vf extends ud{static get requires(){return[jg]}static get pluginName(){return"LinkUI"}init(){const t=this.editor;t.editing.view.addObserver(Of),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=t.plugins.get(jg),this._createToolbarLinkButton(),this._enableUserBalloonInteractions(),t.conversion.for("editingDowncast").markerToHighlight({model:"link-ui",view:{classes:["ck-fake-link-selection"]}}),t.conversion.for("editingDowncast").markerToElement({model:"link-ui",view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const t=this.editor,e=new Df(t.locale),i=t.commands.get("link"),o=t.commands.get("unlink");return e.bind("href").to(i,"value"),e.editButtonView.bind("isEnabled").to(i),e.unlinkButtonView.bind("isEnabled").to(o),this.listenTo(e,"edit",()=>{this._addFormView()}),this.listenTo(e,"unlink",()=>{t.execute("unlink"),this._hideUI()}),e.keystrokes.set("Esc",(t,e)=>{this._hideUI(),e()}),e.keystrokes.set("Ctrl+K",(t,e)=>{this._addFormView(),e()}),e}_createFormView(){const t=this.editor,e=t.commands.get("link"),i=t.config.get("link.defaultProtocol"),o=new Rf(t.locale,e);return o.urlInputView.fieldView.bind("value").to(e,"value"),o.urlInputView.bind("isReadOnly").to(e,"isEnabled",t=>!t),o.saveButtonView.bind("isEnabled").to(e),this.listenTo(o,"submit",()=>{const{value:e}=o.urlInputView.fieldView.element,n=Sf(e,i);t.execute("link",n,o.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(o,"cancel",()=>{this._closeFormView()}),o.keystrokes.set("Esc",(t,e)=>{this._closeFormView(),e()}),o}_createToolbarLinkButton(){const t=this.editor,e=t.commands.get("link"),i=t.t;t.keystrokes.set("Ctrl+K",(t,i)=>{i(),e.isEnabled&&this._showUI(!0)}),t.ui.componentFactory.add("link",t=>{const o=new Kc(t);return o.isEnabled=!0,o.label=i("Link"),o.icon='',o.keystroke="Ctrl+K",o.tooltip=!0,o.isToggleable=!0,o.bind("isEnabled").to(e,"isEnabled"),o.bind("isOn").to(e,"value",t=>!!t),this.listenTo(o,"execute",()=>this._showUI(!0)),o})}_enableUserBalloonInteractions(){const t=this.editor.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(t,e)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),e())},{priority:"high"}),this.editor.keystrokes.set("Esc",(t,e)=>{this._isUIVisible&&(this._hideUI(),e())}),id({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const t=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=t.value||""}_closeFormView(){const t=this.editor.commands.get("link");t.restoreManualDecoratorStates(),void 0!==t.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(t=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),t&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),t&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const t=this.editor;this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),t.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const t=this.editor,e=t.editing.view.document;let i=this._getSelectedLinkElement(),o=r();const n=()=>{const t=this._getSelectedLinkElement(),e=r();i&&!t||!i&&e!==o?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=t,o=e};function r(){return e.selection.focus.getAncestors().reverse().find(t=>t.is("element"))}this.listenTo(t.ui,"update",n),this.listenTo(this._balloon,"change:visibleView",n)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view,e=this.editor.model,i=t.document;let o=null;if(e.markers.has("link-ui")){const e=Array.from(this.editor.editing.mapper.markerNameToElements("link-ui")),i=t.createRange(t.createPositionBefore(e[0]),t.createPositionAfter(e[e.length-1]));o=t.domConverter.viewRangeToDom(i)}else{const e=this._getSelectedLinkElement(),n=i.selection.getFirstRange();o=e?t.domConverter.mapViewToDom(e):t.domConverter.viewRangeToDom(n)}return{target:o}}_getSelectedLinkElement(){const t=this.editor.editing.view,e=t.document.selection;if(e.isCollapsed)return jf(e.getFirstPosition());{const i=e.getFirstRange().getTrimmed(),o=jf(i.start),n=jf(i.end);return o&&o==n&&t.createRangeIn(o).getTrimmed().isEqual(i)?o:null}}_showFakeVisualSelection(){const t=this.editor.model;t.change(e=>{const i=t.document.selection.getFirstRange();if(t.markers.has("link-ui"))e.updateMarker("link-ui",{range:i});else if(i.start.isAtEnd){const o=function t(e,i,o){const n=[e.start.path[0]+1,0],r=o.createPositionFromPath(e.start.root,n,"toNext"),s=o.createRange(r,e.end);if(s.start.path[0]>e.end.path[0])return o.createRange(i);if(r.isAtStart&&r.isAtEnd)return t(s,i,o);return s}(i,t.document.selection.focus,e);e.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:o})}else e.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:i})})}_hideFakeVisualSelection(){const t=this.editor.model;t.markers.has("link-ui")&&t.change(t=>{t.removeMarker("link-ui")})}}function jf(t){return t.getAncestors().find(t=>{return(e=t).is("attributeElement")&&!!e.getCustomProperty("link");var e})}function Bf(t,e){let i=t.start;return{text:Array.from(t.getItems()).reduce((t,o)=>o.is("$text")||o.is("$textProxy")?t+o.data:(i=e.createPositionAfter(o),""),""),range:e.createRange(i,t.end)}}class Ff{constructor(t,e){this.model=t,this.testCallback=e,this.hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(t.document.selection),this.stopListening(t.document))}),this._startListening()}_startListening(){const t=this.model.document;this.listenTo(t.selection,"change:range",(e,{directChange:i})=>{i&&(t.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this.hasMatch=!1))}),this.listenTo(t,"change:data",(t,e)=>{"transparent"!=e.type&&this._evaluateTextBeforeSelection("data",{batch:e})})}_evaluateTextBeforeSelection(t,e={}){const i=this.model,o=i.document.selection,n=i.createRange(i.createPositionAt(o.focus.parent,0),o.focus),{text:r,range:s}=Bf(n,i),a=this.testCallback(r);if(!a&&this.hasMatch&&this.fire("unmatched"),this.hasMatch=!!a,a){const i=Object.assign(e,{text:r,range:s});"object"==typeof a&&Object.assign(i,a),this.fire("matched:"+t,i)}}}yi(Ff,Uo);const Hf=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.))+(?:[a-z\\u00a1-\\uffff]{2,})))$","i");class Uf extends ud{static get pluginName(){return"AutoLink"}init(){const t=this.editor.model.document.selection;t.on("change:range",()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const t=this.editor,e=new Ff(t.model,t=>{if(!function(t){return t.length>4&&" "===t[t.length-1]&&" "!==t[t.length-2]}(t))return;const e=qf(t.substr(0,t.length-1));return e?{url:e}:void 0}),i=t.plugins.get("Input");e.on("matched:data",(e,o)=>{const{batch:n,range:r,url:s}=o;if(!i.isInput(n))return;const a=r.end.getShiftedBy(-1),l=a.getShiftedBy(-s.length),c=t.model.createRange(l,a);this._applyAutoLink(s,c)}),e.bind("isEnabled").to(this)}_enableEnterHandling(){const t=this.editor,e=t.model,i=t.commands.get("enter");i&&i.on("execute",()=>{const t=e.document.selection.getFirstPosition();if(!t.parent.previousSibling)return;const i=e.createRangeIn(t.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(i)})}_enableShiftEnterHandling(){const t=this.editor,e=t.model,i=t.commands.get("shiftEnter");i&&i.on("execute",()=>{const t=e.document.selection.getFirstPosition(),i=e.createRange(e.createPositionAt(t.parent,0),t.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(i)})}_checkAndApplyAutoLinkOnRange(t){const e=this.editor.model,{text:i,range:o}=Bf(t,e),n=qf(i);if(n){const t=e.createRange(o.end.getShiftedBy(-n.length),o.end);this._applyAutoLink(n,t)}}_applyAutoLink(t,e){const i=this.editor.model;this.isEnabled&&function(t,e){return e.schema.checkAttributeInSelection(e.createSelection(t),"linkHref")}(e,i)&&i.enqueueChange(i=>{const o=this.editor.config.get("link.defaultProtocol"),n=Sf(t,o);i.setAttribute("linkHref",n,e)})}}function qf(t){const e=Hf.exec(t);return e?e[2]:null}class Wf extends md{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document,i=Array.from(e.selection.getSelectedBlocks()).filter(e=>Gf(e,t.schema)),o=!0===this.value;t.change(t=>{if(o){let e=i[i.length-1].nextSibling,o=Number.POSITIVE_INFINITY,n=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){const t=e.getAttribute("listIndent");t=i;)r>n.getAttribute("listIndent")&&(r=n.getAttribute("listIndent")),n.getAttribute("listIndent")==r&&t[e?"unshift":"push"](n),n=n[e?"previousSibling":"nextSibling"]}}function Gf(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class Yf extends md{constructor(t,e){super(t),this._indentBy="forward"==e?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document;let i=Array.from(e.selection.getSelectedBlocks());t.change(t=>{const e=i[i.length-1];let o=e.nextSibling;for(;o&&"listItem"==o.name&&o.getAttribute("listIndent")>e.getAttribute("listIndent");)i.push(o),o=o.nextSibling;this._indentBy<0&&(i=i.reverse());for(const e of i){const i=e.getAttribute("listIndent")+this._indentBy;i<0?t.rename(e,"paragraph"):t.setAttribute("listIndent",i,e)}this.fire("_executeCleanup",i)})}_checkEnabled(){const t=pd(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem"))return!1;if(this._indentBy>0){const e=t.getAttribute("listIndent"),i=t.getAttribute("listType");let o=t.previousSibling;for(;o&&o.is("element","listItem")&&o.getAttribute("listIndent")>=e;){if(o.getAttribute("listIndent")==e)return o.getAttribute("listType")==i;o=o.previousSibling}return!1}return!0}}function Kf(t,e){const i=e.mapper,o=e.writer,n="numbered"==t.getAttribute("listType")?"ol":"ul",r=function(t){const e=t.createContainerElement("li");return e.getFillerOffset=op,e}(o),s=o.createContainerElement(n,null);return o.insert(o.createPositionAt(s,0),r),i.bindElements(t,r),r}function Qf(t,e,i,o){const n=e.parent,r=i.mapper,s=i.writer;let a=r.toViewPosition(o.createPositionBefore(t));const l=Xf(t.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:t.getAttribute("listIndent")}),c=t.previousSibling;if(l&&l.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=r.toViewElement(l);a=s.breakContainer(s.createPositionAfter(t))}else if(c&&"listItem"==c.name){a=r.toViewPosition(o.createPositionAt(c,"end"));const t=r.findMappedViewAncestor(a),e=ep(t);a=e?s.createPositionBefore(e):s.createPositionAt(t,"end")}else a=r.toViewPosition(o.createPositionBefore(t));if(a=Zf(a),s.insert(a,n),c&&"listItem"==c.name){const t=r.toViewElement(c),i=s.createRange(s.createPositionAt(t,0),a).getWalker({ignoreElementEnd:!0});for(const t of i)if(t.item.is("element","li")){const o=s.breakContainer(s.createPositionBefore(t.item)),n=t.item.parent,r=s.createPositionAt(e,"end");Jf(s,r.nodeBefore,r.nodeAfter),s.move(s.createRangeOn(n),r),i.position=o}}else{const i=n.nextSibling;if(i&&(i.is("element","ul")||i.is("element","ol"))){let o=null;for(const e of i.getChildren()){const i=r.toModelElement(e);if(!(i&&i.getAttribute("listIndent")>t.getAttribute("listIndent")))break;o=e}o&&(s.breakContainer(s.createPositionAfter(o)),s.move(s.createRangeOn(o.parent),s.createPositionAt(e,"end")))}}Jf(s,n,n.nextSibling),Jf(s,n.previousSibling,n)}function Jf(t,e,i){return!e||!i||"ul"!=e.name&&"ol"!=e.name||e.name!=i.name||e.getAttribute("class")!==i.getAttribute("class")?null:t.mergeContainers(t.createPositionAfter(e))}function Zf(t){return t.getLastMatchingPosition(t=>t.item.is("uiElement"))}function Xf(t,e){const i=!!e.sameIndent,o=!!e.smallerIndent,n=e.listIndent;let r=t;for(;r&&"listItem"==r.name;){const t=r.getAttribute("listIndent");if(i&&n==t||o&&n>t)return r;r="forward"===e.direction?r.nextSibling:r.previousSibling}return null}function tp(t,e,i,o){t.ui.componentFactory.add(e,n=>{const r=t.commands.get(e),s=new Kc(n);return s.set({label:i,icon:o,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>{t.execute(e),t.editing.view.focus()}),s})}function ep(t){for(const e of t.getChildren())if("ul"==e.name||"ol"==e.name)return e;return null}function ip(t,e){const i=[],o=t.parent,n={ignoreElementEnd:!0,startPosition:t,shallow:!0,direction:e},r=o.getAttribute("listIndent"),s=[...new xs(n)].filter(t=>t.item.is("element")).map(t=>t.item);for(const t of s){if(!t.is("element","listItem"))break;if(t.getAttribute("listIndent")r)){if(t.getAttribute("listType")!==o.getAttribute("listType"))break;if(t.getAttribute("listStyle")!==o.getAttribute("listStyle"))break;"backward"===e?i.unshift(t):i.push(t)}}return i}function op(){const t=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||t?0:Do.call(this)}function np(t){return(e,i,o)=>{const n=o.consumable;if(!n.test(i.item,"insert")||!n.test(i.item,"attribute:listType")||!n.test(i.item,"attribute:listIndent"))return;n.consume(i.item,"insert"),n.consume(i.item,"attribute:listType"),n.consume(i.item,"attribute:listIndent");const r=i.item;Qf(r,Kf(r,o),o,t)}}function rp(t,e,i){if(!i.consumable.consume(e.item,"attribute:listType"))return;const o=i.mapper.toViewElement(e.item),n=i.writer;n.breakContainer(n.createPositionBefore(o)),n.breakContainer(n.createPositionAfter(o));const r=o.parent,s="numbered"==e.attributeNewValue?"ol":"ul";n.rename(s,r)}function sp(t,e,i){const o=i.mapper.toViewElement(e.item).parent,n=i.writer;Jf(n,o,o.nextSibling),Jf(n,o.previousSibling,o);for(const t of e.item.getChildren())i.consumable.consume(t,"insert")}function ap(t,e,i){if("listItem"!=e.item.name){let t=i.mapper.toViewPosition(e.range.start);const o=i.writer,n=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&(t=o.breakContainer(t),"li"==t.parent.name);){const e=t,i=o.createPositionAt(t.parent,"end");if(!e.isEqual(i)){const t=o.remove(o.createRange(e,i));n.push(t)}t=o.createPositionAfter(t.parent)}if(n.length>0){for(let e=0;e0){const e=Jf(o,i,i.nextSibling);e&&e.parent==i&&t.offset--}}Jf(o,t.nodeBefore,t.nodeAfter)}}}function lp(t,e,i){const o=i.mapper.toViewPosition(e.position),n=o.nodeBefore,r=o.nodeAfter;Jf(i.writer,n,r)}function cp(t,e,i){if(i.consumable.consume(e.viewItem,{name:!0})){const t=i.writer,o=t.createElement("listItem"),n=function(t){let e=0,i=t.parent;for(;i;){if(i.is("element","li"))e++;else{const t=i.previousSibling;t&&t.is("element","li")&&e++}i=i.parent}return e}(e.viewItem);t.setAttribute("listIndent",n,o);const r=e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted";if(t.setAttribute("listType",r,o),!i.safeInsert(o,e.modelCursor))return;const s=function(t,e,i){const{writer:o,schema:n}=i;let r=o.createPositionAfter(t);for(const s of e)if("ul"==s.name||"ol"==s.name)r=i.convertItem(s,r).modelCursor;else{const e=i.convertItem(s,o.createPositionAt(t,"end")),a=e.modelRange.start.nodeAfter;a&&a.is("element")&&!n.checkChild(t,a.name)&&(t=e.modelCursor.parent.is("element","listItem")?e.modelCursor.parent:mp(e.modelCursor),r=o.createPositionAfter(t))}return r}(o,e.viewItem.getChildren(),i);e.modelRange=t.createRange(e.modelCursor,s),i.updateConversionResult(o,e)}}function dp(t,e,i){if(i.consumable.test(e.viewItem,{name:!0})){const t=Array.from(e.viewItem.getChildren());for(const e of t){!(e.is("element","li")||pp(e))&&e._remove()}}}function hp(t,e,i){if(i.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;const t=[...e.viewItem.getChildren()];let i=!1,o=!0;for(const e of t)i&&!pp(e)&&e._remove(),e.is("$text")?(o&&(e._data=e.data.replace(/^\s+/,"")),e.nextSibling&&!pp(e.nextSibling)||(e._data=e.data.replace(/\s+$/,""))):pp(e)&&(i=!0),o=!1}}function up(t){return(e,i)=>{if(i.isPhantom)return;const o=i.modelPosition.nodeBefore;if(o&&o.is("element","listItem")){const e=i.mapper.toViewElement(o),n=e.getAncestors().find(pp),r=t.createPositionAt(e,0).getWalker();for(const t of r){if("elementStart"==t.type&&t.item.is("element","li")){i.viewPosition=t.previousPosition;break}if("elementEnd"==t.type&&t.item==n){i.viewPosition=t.nextPosition;break}}}}}function gp(t,[e,i]){let o,n=e.is("documentFragment")?e.getChild(0):e;if(o=i?this.createSelection(i):this.document.selection,n&&n.is("element","listItem")){const t=o.getFirstPosition();let e=null;if(t.parent.is("element","listItem")?e=t.parent:t.nodeBefore&&t.nodeBefore.is("element","listItem")&&(e=t.nodeBefore),e){const t=e.getAttribute("listIndent");if(t>0)for(;n&&n.is("element","listItem");)n._setAttribute("listIndent",n.getAttribute("listIndent")+t),n=n.nextSibling}}}function mp(t){const e=new xs({startPosition:t});let i;do{i=e.next()}while(!i.value.item.is("element","listItem"));return i.value.item}function fp(t,e,i,o,n,r){const s=Xf(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:t,foo:"b"}),a=n.mapper,l=n.writer,c=s?s.getAttribute("listIndent"):null;let d;if(s)if(c==t){const t=a.toViewElement(s).parent;d=l.createPositionAfter(t)}else{const t=r.createPositionAt(s,"end");d=a.toViewPosition(t)}else d=i;d=Zf(d);for(const t of[...o.getChildren()])pp(t)&&(d=l.move(l.createRangeOn(t),d).end,Jf(l,t,t.nextSibling),Jf(l,t.previousSibling,t))}function pp(t){return t.is("element","ol")||t.is("element","ul")}class bp extends ud{static get pluginName(){return"ListEditing"}static get requires(){return[Iu]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,i=t.editing;var o;t.model.document.registerPostFixer(e=>function(t,e){const i=t.document.differ.getChanges(),o=new Map;let n=!1;for(const o of i)if("insert"==o.type&&"listItem"==o.name)r(o.position);else if("insert"==o.type&&"listItem"!=o.name){if("$text"!=o.name){const i=o.position.nodeAfter;i.hasAttribute("listIndent")&&(e.removeAttribute("listIndent",i),n=!0),i.hasAttribute("listType")&&(e.removeAttribute("listType",i),n=!0),i.hasAttribute("listStyle")&&(e.removeAttribute("listStyle",i),n=!0);for(const e of Array.from(t.createRangeIn(i)).filter(t=>t.item.is("element","listItem")))r(e.previousPosition)}r(o.position.getShiftedBy(o.length))}else"remove"==o.type&&"listItem"==o.name?r(o.position):("attribute"==o.type&&"listIndent"==o.attributeKey||"attribute"==o.type&&"listType"==o.attributeKey)&&r(o.range.start);for(const t of o.values())s(t),a(t);return n;function r(t){const e=t.nodeBefore;if(e&&e.is("element","listItem")){let t=e;if(o.has(t))return;for(let e=t.previousSibling;e&&e.is("element","listItem");e=t.previousSibling)if(t=e,o.has(t))return;o.set(e,t)}else{const e=t.nodeAfter;e&&e.is("element","listItem")&&o.set(e,e)}}function s(t){let i=0,o=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(r>i){let s;null===o?(o=r-i,s=i):(o>r&&(o=r),s=r-o),e.setAttribute("listIndent",s,t),n=!0}else o=null,i=t.getAttribute("listIndent")+1;t=t.nextSibling}}function a(t){let i=[],o=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(o&&o.getAttribute("listIndent")>r&&(i=i.slice(0,r+1)),0!=r)if(i[r]){const o=i[r];t.getAttribute("listType")!=o&&(e.setAttribute("listType",o,t),n=!0)}else i[r]=t.getAttribute("listType");o=t,t=t.nextSibling}}}(t.model,e)),i.mapper.registerViewToModelLength("li",wp),e.mapper.registerViewToModelLength("li",wp),i.mapper.on("modelToViewPosition",up(i.view)),i.mapper.on("viewToModelPosition",(o=t.model,(t,e)=>{const i=e.viewPosition,n=i.parent,r=e.mapper;if("ul"==n.name||"ol"==n.name){if(i.isAtEnd){const t=r.toModelElement(i.nodeBefore),n=r.getModelLength(i.nodeBefore);e.modelPosition=o.createPositionBefore(t).getShiftedBy(n)}else{const t=r.toModelElement(i.nodeAfter);e.modelPosition=o.createPositionBefore(t)}t.stop()}else if("li"==n.name&&i.nodeBefore&&("ul"==i.nodeBefore.name||"ol"==i.nodeBefore.name)){const s=r.toModelElement(n);let a=1,l=i.nodeBefore;for(;l&&pp(l);)a+=r.getModelLength(l),l=l.previousSibling;e.modelPosition=o.createPositionBefore(s).getShiftedBy(a),t.stop()}})),e.mapper.on("modelToViewPosition",up(i.view)),t.conversion.for("editingDowncast").add(e=>{e.on("insert",ap,{priority:"high"}),e.on("insert:listItem",np(t.model)),e.on("attribute:listType:listItem",rp,{priority:"high"}),e.on("attribute:listType:listItem",sp,{priority:"low"}),e.on("attribute:listIndent:listItem",function(t){return(e,i,o)=>{if(!o.consumable.consume(i.item,"attribute:listIndent"))return;const n=o.mapper.toViewElement(i.item),r=o.writer;r.breakContainer(r.createPositionBefore(n)),r.breakContainer(r.createPositionAfter(n));const s=n.parent,a=s.previousSibling,l=r.createRangeOn(s);r.remove(l),a&&a.nextSibling&&Jf(r,a,a.nextSibling),fp(i.attributeOldValue+1,i.range.start,l.start,n,o,t),Qf(i.item,n,o,t);for(const t of i.item.getChildren())o.consumable.consume(t,"insert")}}(t.model)),e.on("remove:listItem",function(t){return(e,i,o)=>{const n=o.mapper.toViewPosition(i.position).getLastMatchingPosition(t=>!t.item.is("element","li")).nodeAfter,r=o.writer;r.breakContainer(r.createPositionBefore(n)),r.breakContainer(r.createPositionAfter(n));const s=n.parent,a=s.previousSibling,l=r.createRangeOn(s),c=r.remove(l);a&&a.nextSibling&&Jf(r,a,a.nextSibling);fp(o.mapper.toModelElement(n).getAttribute("listIndent")+1,i.position,l.start,n,o,t);for(const t of r.createRangeIn(c).getItems())o.mapper.unbindViewElement(t);e.stop()}}(t.model)),e.on("remove",lp,{priority:"low"})}),t.conversion.for("dataDowncast").add(e=>{e.on("insert",ap,{priority:"high"}),e.on("insert:listItem",np(t.model))}),t.conversion.for("upcast").add(t=>{t.on("element:ul",dp,{priority:"high"}),t.on("element:ol",dp,{priority:"high"}),t.on("element:li",hp,{priority:"high"}),t.on("element:li",cp)}),t.model.on("insertContent",gp,{priority:"high"}),t.commands.add("numberedList",new Wf(t,"numbered")),t.commands.add("bulletedList",new Wf(t,"bulleted")),t.commands.add("indentList",new Yf(t,"forward")),t.commands.add("outdentList",new Yf(t,"backward"));const n=i.view.document;this.listenTo(n,"enter",(t,e)=>{const i=this.editor.model.document,o=i.selection.getLastPosition().parent;i.selection.isCollapsed&&"listItem"==o.name&&o.isEmpty&&(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),this.listenTo(n,"delete",(t,e)=>{if("backward"!==e.direction)return;const i=this.editor.model.document.selection;if(!i.isCollapsed)return;const o=i.getFirstPosition();if(!o.isAtStart)return;const n=o.parent;if("listItem"!==n.name)return;n.previousSibling&&"listItem"===n.previousSibling.name||(this.editor.execute("outdentList"),e.preventDefault(),t.stop())},{priority:"high"});const r=t=>(e,i)=>{this.editor.commands.get(t).isEnabled&&(this.editor.execute(t),i())};t.keystrokes.set("Tab",r("indentList")),t.keystrokes.set("Shift+Tab",r("outdentList"))}afterInit(){const t=this.editor.commands,e=t.get("indent"),i=t.get("outdent");e&&e.registerChildCommand(t.get("indentList")),i&&i.registerChildCommand(t.get("outdentList"))}}function wp(t){let e=1;for(const i of t.getChildren())if("ul"==i.name||"ol"==i.name)for(const t of i.getChildren())e+=wp(t);return e}var kp='',_p='';class vp extends ud{init(){const t=this.editor.t;tp(this.editor,"numberedList",t("Numbered List"),kp),tp(this.editor,"bulletedList",t("Bulleted List"),_p)}}class yp extends md{constructor(t,e){super(t),this._defaultType=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model;let i=[...e.document.selection.getSelectedBlocks()].filter(t=>t.is("element","listItem")).map(t=>{const i=e.change(e=>e.createPositionAt(t,0));return[...ip(i,"backward"),...ip(i,"forward")]}).flat();i=[...new Set(i)],i.length&&e.change(e=>{for(const o of i)e.setAttribute("listStyle",t.type||this._defaultType,o)})}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")?t.getAttribute("listStyle"):null}_checkEnabled(){const t=this.editor,e=t.commands.get("numberedList"),i=t.commands.get("bulletedList");return e.isEnabled||i.isEnabled}}class xp extends ud{static get requires(){return[bp]}static get pluginName(){return"ListStyleEditing"}init(){const t=this.editor,e=t.model;e.schema.extend("listItem",{allowAttributes:["listStyle"]}),t.commands.add("listStyle",new yp(t,"default")),this.listenTo(t.commands.get("indentList"),"_executeCleanup",function(t){return(e,i)=>{let o;const n=i[0],r=n.getAttribute("listIndent"),s=i.filter(t=>t.getAttribute("listIndent")===r);if(n.previousSibling.getAttribute("listIndent")+1===r)o="default";else{const t=Xf(n.previousSibling,{sameIndent:!0,direction:"backward",listIndent:r});o=t.getAttribute("listStyle")}t.model.change(t=>{for(const e of s)t.setAttribute("listStyle",o,e)})}}(t)),this.listenTo(t.commands.get("outdentList"),"_executeCleanup",function(t){return(e,i)=>{if(!(i=i.reverse().filter(t=>t.is("element","listItem"))).length)return;const o=i[0].getAttribute("listIndent"),n=i[0].getAttribute("listType");let r=i[0].previousSibling;if(r.is("element","listItem"))for(;r.getAttribute("listIndent")!==o;)r=r.previousSibling;else r=null;r||(r=i[i.length-1].nextSibling),r&&r.is("element","listItem")&&r.getAttribute("listType")===n&&t.model.change(t=>{const e=i.filter(t=>t.getAttribute("listIndent")===o);for(const i of e)t.setAttribute("listStyle",r.getAttribute("listStyle"),i)})}}(t)),this.listenTo(t.commands.get("bulletedList"),"_executeCleanup",Cp(t)),this.listenTo(t.commands.get("numberedList"),"_executeCleanup",Cp(t)),e.document.registerPostFixer(function(t){return e=>{let i=!1;const o=Sp(t.model.document.differ.getChanges()).filter(t=>"todo"!==t.getAttribute("listType"));if(!o.length)return i;let n=o[o.length-1].nextSibling;if((!n||!n.is("element","listItem"))&&(n=o[o.length-1].previousSibling,n)){const t=o[0].getAttribute("listIndent");for(;n.is("element","listItem")&&n.getAttribute("listIndent")!==t&&(n=n.previousSibling,n););}for(const t of o)if(t.hasAttribute("listStyle")){const o=t.previousSibling;Tp(o,t)&&(e.setAttribute("listStyle",o.getAttribute("listStyle"),t),i=!0)}else Ap(n,t)?e.setAttribute("listStyle",n.getAttribute("listStyle"),t):e.setAttribute("listStyle","default",t),i=!0;return i}}(t)),t.conversion.for("upcast").add(t=>{t.on("element:li",(t,e,i)=>{const o=e.viewItem.parent.getStyle("list-style-type")||"default",n=e.modelRange.start.nodeAfter||e.modelRange.end.nodeBefore;i.writer.setAttribute("listStyle",o,n)},{priority:"low"})}),t.conversion.for("downcast").add(t=>{t.on("attribute:listStyle:listItem",(t,e,i)=>{const o=i.writer,n=e.item,r=Xf(n.previousSibling,{sameIndent:!0,listIndent:n.getAttribute("listIndent"),direction:"backward"}),s=i.mapper.toViewElement(n);var a,l,c,d,h;a=n,(l=r)&&a.getAttribute("listType")===l.getAttribute("listType")&&a.getAttribute("listIndent")===l.getAttribute("listIndent")&&a.getAttribute("listStyle")===l.getAttribute("listStyle")||o.breakContainer(o.createPositionBefore(s)),c=o,d=e.attributeNewValue,h=s.parent,d&&"default"!==d?c.setStyle("list-style-type",d,h):c.removeStyle("list-style-type",h)},{priority:"low"})}),this._mergeListStyleAttributeWhileMergingLists()}afterInit(){const t=this.editor;t.commands.get("todoList")&&t.model.document.registerPostFixer(function(t){return e=>{const i=Sp(t.model.document.differ.getChanges()).filter(t=>"todo"===t.getAttribute("listType")&&t.hasAttribute("listStyle"));if(!i.length)return!1;for(const t of i)e.removeAttribute("listStyle",t);return!0}}(t))}_mergeListStyleAttributeWhileMergingLists(){const t=this.editor.model;let e;this.listenTo(t,"deleteContent",(t,[i])=>{const o=i.getFirstPosition(),n=i.getLastPosition();if(o.parent===n.parent)return;if(!o.parent.is("element","listItem"))return;const r=n.parent.nextSibling;if(!r||!r.is("element","listItem"))return;const s=Xf(o.parent,{sameIndent:!0,listIndent:r.getAttribute("listIndent")});s&&s.getAttribute("listType")===r.getAttribute("listType")&&(e=s)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{e&&(t.change(t=>{const i=Xf(e.nextSibling,{sameIndent:!0,listIndent:e.getAttribute("listIndent"),direction:"forward"}),o=[i,...ip(t.createPositionAt(i,0),"forward")];for(const i of o)t.setAttribute("listStyle",e.getAttribute("listStyle"),i)}),e=null)},{priority:"low"})}}function Ap(t,e){if(!t)return!1;const i=t.getAttribute("listStyle");return!!i&&("default"!==i&&t.getAttribute("listType")===e.getAttribute("listType"))}function Tp(t,e){if(!t||!t.is("element","listItem"))return!1;if(e.getAttribute("listType")!==t.getAttribute("listType"))return!1;const i=t.getAttribute("listIndent");if(i<1||i!==e.getAttribute("listIndent"))return!1;const o=t.getAttribute("listStyle");return!(!o||o===e.getAttribute("listStyle"))}function Cp(t){return(e,i)=>{i=i.filter(t=>t.is("element","listItem")),t.model.change(t=>{for(const e of i)t.removeAttribute("listStyle",e)})}}function Sp(t){const e=[];for(const i of t){const t=Pp(i);t&&t.is("element","listItem")&&e.push(t)}return e}function Pp(t){return"attribute"===t.type?t.range.start.nodeAfter:"insert"===t.type?t.position.nodeAfter:null}i(98);class Ep extends ud{static get pluginName(){return"ListStyleUI"}init(){const t=this.editor,e=t.locale.t;t.ui.componentFactory.add("bulletedList",Mp({editor:t,parentCommandName:"bulletedList",buttonLabel:e("Bulleted List"),buttonIcon:_p,toolbarAriaLabel:e("Bulleted list styles toolbar"),styleDefinitions:[{label:e("Toggle the disc list style"),tooltip:e("Disc"),type:"disc",icon:''},{label:e("Toggle the circle list style"),tooltip:e("Circle"),type:"circle",icon:''},{label:e("Toggle the square list style"),tooltip:e("Square"),type:"square",icon:''}]})),t.ui.componentFactory.add("numberedList",Mp({editor:t,parentCommandName:"numberedList",buttonLabel:e("Numbered List"),buttonIcon:kp,toolbarAriaLabel:e("Numbered list styles toolbar"),styleDefinitions:[{label:e("Toggle the decimal list style"),tooltip:e("Decimal"),type:"decimal",icon:''},{label:e("Toggle the decimal with leading zero list style"),tooltip:e("Decimal with leading zero"),type:"decimal-leading-zero",icon:''},{label:e("Toggle the lower–roman list style"),tooltip:e("Lower–roman"),type:"lower-roman",icon:''},{label:e("Toggle the upper–roman list style"),tooltip:e("Upper-roman"),type:"upper-roman",icon:''},{label:e("Toggle the lower–latin list style"),tooltip:e("Lower-latin"),type:"lower-latin",icon:''},{label:e("Toggle the upper–latin list style"),tooltip:e("Upper-latin"),type:"upper-latin",icon:''}]}))}}function Mp({editor:t,parentCommandName:e,buttonLabel:i,buttonIcon:o,toolbarAriaLabel:n,styleDefinitions:r}){const s=t.commands.get(e),a=t.commands.get("listStyle");return l=>{const c=od(l,ju),d=c.buttonView,h=function({editor:t,listStyleCommand:e,parentCommandName:i}){const o=t.locale,n=t.commands.get(i);return({label:r,type:s,icon:a,tooltip:l})=>{const c=new Kc(o);return c.set({label:r,icon:a,tooltip:l}),e.on("change:value",()=>{c.isOn=e.value===s}),c.on("execute",()=>{n.value?e.value!==s?t.execute("listStyle",{type:s}):t.execute("listStyle",{type:e._defaultType}):t.model.change(()=>{t.execute(i),t.execute("listStyle",{type:s})}),t.editing.view.focus()}),c}}({editor:t,parentCommandName:e,listStyleCommand:a});return nd(c,r.map(h)),c.bind("isEnabled").to(s),c.toolbarView.ariaLabel=n,c.class="ck-list-styles-dropdown",d.on("execute",()=>{t.execute(e),t.editing.view.focus()}),d.set({label:i,icon:o,tooltip:!0,isToggleable:!0}),d.bind("isOn").to(s,"value",t=>!!t),c}}function Lp(t,e){return t=>{t.on("attribute:url:media",i)};function i(i,o,n){if(!n.consumable.consume(o.item,i.name))return;const r=o.attributeNewValue,s=n.writer,a=n.mapper.toViewElement(o.item),l=[...a.getChildren()].find(t=>t.getCustomProperty("media-content"));s.remove(l);const c=t.getMediaViewElement(s,r,e);s.insert(s.createPositionAt(a,0),c)}}function Ip(t){const e=t.getSelectedElement();return e&&function(t){return!!t.getCustomProperty("media")&&tg(t)}(e)?e:null}function Np(t,e,i,o){const n=t.createContainerElement("figure",{class:"media"});return t.insert(t.createPositionAt(n,0),e.getMediaViewElement(t,i,o)),n}function zp(t){const e=t.getSelectedElement();return e&&e.is("element","media")?e:null}function Op(t,e,i){t.change(o=>{const n=o.createElement("media",{url:e});t.insertContent(n,i),o.setSelection(n,"on")})}class Rp extends md{refresh(){const t=this.editor.model,e=t.document.selection,i=t.schema,o=og(e,t),n=zp(e);let r=o.parent;r.isEmpty&&!t.schema.isLimit(r)&&(r=r.parent),this.value=n?n.getAttribute("url"):null,this.isEnabled=i.checkChild(r,"media")}execute(t){const e=this.editor.model,i=e.document.selection,o=zp(i);if(o)e.change(e=>{e.setAttribute("url",t,o)});else{const o=og(i,e);Op(e,t,o)}}}class Dp{constructor(t,e){const i=e.providers,o=e.extraProviders||[],n=new Set(e.removeProviders),r=i.concat(o).filter(t=>{const e=t.name;return e?!n.has(e):(Object(hi.c)("media-embed-no-provider-name",{provider:t}),!1)});this.locale=t,this.providerDefinitions=r}hasMedia(t){return!!this._getMedia(t)}getMediaViewElement(t,e,i){return this._getMedia(e).getViewElement(t,i)}_getMedia(t){if(!t)return new Vp(this.locale);t=t.trim();for(const e of this.providerDefinitions){const i=e.html,o=Ti(e.url);for(const e of o){const o=this._getUrlMatches(t,e);if(o)return new Vp(this.locale,t,o,i)}}return null}_getUrlMatches(t,e){let i=t.match(e);if(i)return i;let o=t.replace(/^https?:\/\//,"");return i=o.match(e),i||(o=o.replace(/^www\./,""),i=o.match(e),i||null)}}class Vp{constructor(t,e,i,o){this.url=this._getValidUrl(e),this._t=t.t,this._match=i,this._previewRenderer=o}getViewElement(t,e){const i={};let o;if(e.renderForEditingView||e.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(i["data-oembed-url"]=this.url),e.renderForEditingView&&(i.class="ck-media__wrapper");const n=this._getPreviewHtml(e);o=t.createRawElement("div",i,(function(t){t.innerHTML=n}))}else this.url&&(i.url=this.url),o=t.createEmptyElement("oembed",i);return t.setCustomProperty("media-content",!0,o),o}_getPreviewHtml(t){return this._previewRenderer?this._previewRenderer(this._match):this.url&&t.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const t=new Yc,e=new Gc;t.text=this._t("Open media in new tab"),e.content='',e.viewBox="0 0 64 42";return new nc({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[e]},{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]},t]}]}).render().outerHTML}_getValidUrl(t){return t?t.match(/^https?/)?t:"https://"+t:null}}i(100);class jp extends ud{static get pluginName(){return"MediaEmbedEditing"}constructor(t){super(t),t.config.define("mediaEmbed",{providers:[{name:"dailymotion",url:/^dailymotion\.com\/video\/(\w+)/,html:t=>`
`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:t=>`
`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)/,/^youtube\.com\/embed\/([\w-]+)/,/^youtu\.be\/([\w-]+)/],html:t=>`
`},{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:t=>`
`},{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 Dp(t.locale,t.config.get("mediaEmbed"))}init(){const t=this.editor,e=t.model.schema,i=t.t,o=t.conversion,n=t.config.get("mediaEmbed.previewsInData"),r=this.registry;t.commands.add("mediaEmbed",new Rp(t)),e.register("media",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["url"]}),o.for("dataDowncast").elementToElement({model:"media",view:(t,{writer:e})=>{const i=t.getAttribute("url");return Np(e,r,i,{renderMediaPreview:i&&n})}}),o.for("dataDowncast").add(Lp(r,{renderMediaPreview:n})),o.for("editingDowncast").elementToElement({model:"media",view:(t,{writer:e})=>{const o=t.getAttribute("url");return function(t,e,i){return e.setCustomProperty("media",!0,t),eg(t,e,{label:i})}(Np(e,r,o,{renderForEditingView:!0}),e,i("media widget"))}}),o.for("editingDowncast").add(Lp(r,{renderForEditingView:!0})),o.for("upcast").elementToElement({view:{name:"oembed",attributes:{url:!0}},model:(t,{writer:e})=>{const i=t.getAttribute("url");if(r.hasMedia(i))return e.createElement("media",{url:i})}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(t,{writer:e})=>{const i=t.getAttribute("data-oembed-url");if(r.hasMedia(i))return e.createElement("media",{url:i})}})}}const Bp=/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=%]+$/;class Fp extends ud{static get requires(){return[jd,Oh]}static get pluginName(){return"AutoMediaEmbed"}constructor(t){super(t),this._timeoutId=null,this._positionToInsert=null}init(){const t=this.editor,e=t.model.document;this.listenTo(t.plugins.get(jd),"inputTransformation",()=>{const t=e.selection.getFirstRange(),i=vl.fromPosition(t.start);i.stickiness="toPrevious";const o=vl.fromPosition(t.end);o.stickiness="toNext",e.once("change:data",()=>{this._embedMediaBetweenPositions(i,o),i.detach(),o.detach()},{priority:"high"})}),t.commands.get("undo").on("execute",()=>{this._timeoutId&&(rr.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(t,e){const i=this.editor,o=i.plugins.get(jp).registry,n=new Hs(t,e),r=n.getWalker({ignoreElementEnd:!0});let s="";for(const t of r)t.item.is("$textProxy")&&(s+=t.item.data);if(s=s.trim(),!s.match(Bp))return void n.detach();if(!o.hasMedia(s))return void n.detach();i.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=vl.fromPosition(t),this._timeoutId=rr.window.setTimeout(()=>{i.model.change(t=>{let e;this._timeoutId=null,t.remove(n),n.detach(),"$graveyard"!==this._positionToInsert.root.rootName&&(e=this._positionToInsert),Op(i.model,s,e),this._positionToInsert.detach(),this._positionToInsert=null})},100)):n.detach()}}i(102);class Hp extends xc{constructor(t,e){super(e);const i=e.t;this.focusTracker=new Yl,this.keystrokes=new jl,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(i("Save"),Og,"ck-button-save"),this.saveButtonView.type="submit",this.saveButtonView.bind("isEnabled").to(this,"mediaURLInputValue",t=>!!t),this.cancelButtonView=this._createButton(i("Cancel"),Rg,"ck-button-cancel","cancel"),this._focusables=new oc,this._focusCycler=new Oc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]}),Ng(this)}render(){super.render(),zg({view:this});[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element);const t=t=>t.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t),this.listenTo(this.urlInputView.element,"selectstart",(t,e)=>{e.stopPropagation()},{priority:"high"})}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(t){this.urlInputView.fieldView.element.value=t.trim()}isValid(){this.resetFormStatus();for(const t of this._validators){const e=t(this);if(e)return this.urlInputView.errorText=e,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const t=this.locale.t,e=new Mg(this.locale,Ig),i=e.fieldView;return this._urlInputViewInfoDefault=t("Paste the media URL in the input."),this._urlInputViewInfoTip=t("Tip: Paste the URL into the content to embed faster."),e.label=t("Media URL"),e.infoText=this._urlInputViewInfoDefault,i.on("input",()=>{e.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=i.element.value.trim()}),e}_createButton(t,e,i,o){const n=new Kc(this.locale);return n.set({label:t,icon:e,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),o&&n.delegate("execute").to(this,o),n}}class Up extends ud{static get requires(){return[jp]}static get pluginName(){return"MediaEmbedUI"}init(){const t=this.editor,e=t.commands.get("mediaEmbed"),i=t.plugins.get(jp).registry;t.ui.componentFactory.add("mediaEmbed",o=>{const n=od(o),r=new Hp(function(t,e){return[e=>{if(!e.url.length)return t("The URL must not be empty.")},i=>{if(!e.hasMedia(i.url))return t("This media URL is not supported.")}]}(t.t,i),t.locale);return this._setUpDropdown(n,r,e,t),this._setUpForm(n,r,e),n})}_setUpDropdown(t,e,i){const o=this.editor,n=o.t,r=t.buttonView;function s(){o.editing.view.focus(),t.isOpen=!1}t.bind("isEnabled").to(i),t.panelView.children.add(e),r.set({label:n("Insert media"),icon:'',tooltip:!0}),r.on("open",()=>{e.disableCssTransitions(),e.url=i.value||"",e.urlInputView.fieldView.select(),e.focus(),e.enableCssTransitions()},{priority:"low"}),t.on("submit",()=>{e.isValid()&&(o.execute("mediaEmbed",e.url),s())}),t.on("change:isOpen",()=>e.resetFormStatus()),t.on("cancel",()=>s())}_setUpForm(t,e,i){e.delegate("submit","cancel").to(t),e.urlInputView.bind("value").to(i,"value"),e.urlInputView.bind("isReadOnly").to(i,"isEnabled",t=>!t)}}i(104);class qp{constructor(t,e){this.loader=t,this.options=e}upload(){return this.loader.file.then(t=>new Promise((e,i)=>{this._initRequest(),this._initListeners(e,i,t),this._sendRequest(t)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.options.uploadUrl,!0),t.responseType="text"}_initListeners(t,e,i){const o=this.xhr,n=this.loader;o.addEventListener("error",()=>notif("error",o.statusText,"Impossible d'exporter l'image")),o.addEventListener("abort",()=>e()),o.addEventListener("load",()=>{const e=o.responseText.substring(o.responseText.indexOf("[DIV]")+5).replace(" ","%20");e.includes("error")?notif("error",e.substring(6),"Impossible d'exporter l'image"):t({default:e})}),o.upload&&o.upload.addEventListener("progress",t=>{t.lengthComputable&&(n.uploadTotal=t.total,n.uploaded=t.loaded)})}_sendRequest(t){const e=this.options.headers||{},i=this.options.withCredentials||!1;for(const t of Object.keys(e))this.xhr.setRequestHeader(t,e[t]);this.xhr.withCredentials=i;const o=new FormData;o.append("upload",t),this.xhr.send(o)}}i(106);class Wp extends xc{constructor(t,e={}){super(t);const i=this.bindTemplate;this.set("label",e.label||""),this.set("class",e.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children});const o=new xc(t);o.setTemplate({tag:"span",attributes:{class:["ck","ck-form__header__label"]},children:[{text:i.to("label")}]}),this.children.add(o)}}class $p extends Wp{constructor(t,e){super(t);const i=t.t;this.set("class","ck-special-characters-navigation"),this.groupDropdownView=this._createGroupDropdown(e),this.groupDropdownView.panelPosition="rtl"===t.uiLanguageDirection?"se":"sw",this.label=i("Special characters"),this.children.add(this.groupDropdownView)}get currentGroupName(){return this.groupDropdownView.value}_createGroupDropdown(t){const e=this.locale,i=e.t,o=od(e),n=this._getCharacterGroupListItemDefinitions(o,t);return o.set("value",n.first.model.label),o.buttonView.bind("label").to(o,"value"),o.buttonView.set({isOn:!1,withText:!0,tooltip:i("Character categories"),class:["ck-dropdown__button_label-width_auto"]}),o.on("execute",t=>{o.value=t.source.label}),o.delegate("execute").to(this),rd(o,n),o}_getCharacterGroupListItemDefinitions(t,e){const i=new xi;for(const o of e){const e={type:"button",model:new vu({label:o,withText:!0})};e.model.bind("isOn").to(t,"value",t=>t===e.model.label),i.add(e)}return i}}i(108);class Gp extends xc{constructor(t){super(t),this.tiles=this.createCollection(),this.setTemplate({tag:"div",children:[{tag:"div",attributes:{class:["ck","ck-character-grid__tiles"]},children:this.tiles}],attributes:{class:["ck","ck-character-grid"]}})}createTile(t,e){const i=new Kc(this.locale);return i.set({label:t,withText:!0,class:"ck-character-grid__tile"}),i.extendTemplate({attributes:{title:e},on:{mouseover:i.bindTemplate.to("mouseover")}}),i.on("mouseover",()=>{this.fire("tileHover",{name:e,character:t})}),i.on("execute",()=>{this.fire("execute",{name:e,character:t})}),i}}i(110);class Yp extends xc{constructor(t){super(t);const e=this.bindTemplate;this.set("character",null),this.set("name",null),this.bind("code").to(this,"character",Kp),this.setTemplate({tag:"div",children:[{tag:"span",attributes:{class:["ck-character-info__name"]},children:[{text:e.to("name",t=>t||"​")}]},{tag:"span",attributes:{class:["ck-character-info__code"]},children:[{text:e.to("code")}]}],attributes:{class:["ck","ck-character-info"]}})}}function Kp(t){if(null===t)return"";return"U+"+("0000"+t.codePointAt(0).toString(16)).slice(-4)}i(112);class Qp extends ud{init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Arrows",[{title:e("leftwards double arrow"),character:"⇐"},{title:e("rightwards double arrow"),character:"⇒"},{title:e("upwards double arrow"),character:"⇑"},{title:e("downwards double arrow"),character:"⇓"},{title:e("leftwards dashed arrow"),character:"⇠"},{title:e("rightwards dashed arrow"),character:"⇢"},{title:e("upwards dashed arrow"),character:"⇡"},{title:e("downwards dashed arrow"),character:"⇣"},{title:e("leftwards arrow to bar"),character:"⇤"},{title:e("rightwards arrow to bar"),character:"⇥"},{title:e("upwards arrow to bar"),character:"⤒"},{title:e("downwards arrow to bar"),character:"⤓"},{title:e("up down arrow with base"),character:"↨"},{title:e("back with leftwards arrow above"),character:"🔙"},{title:e("end with leftwards arrow above"),character:"🔚"},{title:e("on with exclamation mark with left right arrow above"),character:"🔛"},{title:e("soon with rightwards arrow above"),character:"🔜"},{title:e("top with upwards arrow above"),character:"🔝"}])}}class Jp extends ud{init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Currency",[{character:"$",title:e("Dollar sign")},{character:"€",title:e("Euro sign")},{character:"¥",title:e("Yen sign")},{character:"£",title:e("Pound sign")},{character:"¢",title:e("Cent sign")},{character:"₠",title:e("Euro-currency sign")},{character:"₡",title:e("Colon sign")},{character:"₢",title:e("Cruzeiro sign")},{character:"₣",title:e("French franc sign")},{character:"₤",title:e("Lira sign")},{character:"¤",title:e("Currency sign")},{character:"₿",title:e("Bitcoin sign")},{character:"₥",title:e("Mill sign")},{character:"₦",title:e("Naira sign")},{character:"₧",title:e("Peseta sign")},{character:"₨",title:e("Rupee sign")},{character:"₩",title:e("Won sign")},{character:"₪",title:e("New sheqel sign")},{character:"₫",title:e("Dong sign")},{character:"₭",title:e("Kip sign")},{character:"₮",title:e("Tugrik sign")},{character:"₯",title:e("Drachma sign")},{character:"₰",title:e("German penny sign")},{character:"₱",title:e("Peso sign")},{character:"₲",title:e("Guarani sign")},{character:"₳",title:e("Austral sign")},{character:"₴",title:e("Hryvnia sign")},{character:"₵",title:e("Cedi sign")},{character:"₶",title:e("Livre tournois sign")},{character:"₷",title:e("Spesmilo sign")},{character:"₸",title:e("Tenge sign")},{character:"₹",title:e("Indian rupee sign")},{character:"₺",title:e("Turkish lira sign")},{character:"₻",title:e("Nordic mark sign")},{character:"₼",title:e("Manat sign")},{character:"₽",title:e("Ruble sign")}])}}class Zp extends ud{init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Mathematical",[{character:"<",title:e("Less-than sign")},{character:">",title:e("Greater-than sign")},{character:"≤",title:e("Less-than or equal to")},{character:"≥",title:e("Greater-than or equal to")},{character:"–",title:e("En dash")},{character:"—",title:e("Em dash")},{character:"¯",title:e("Macron")},{character:"‾",title:e("Overline")},{character:"°",title:e("Degree sign")},{character:"−",title:e("Minus sign")},{character:"±",title:e("Plus-minus sign")},{character:"÷",title:e("Division sign")},{character:"⁄",title:e("Fraction slash")},{character:"×",title:e("Multiplication sign")},{character:"ƒ",title:e("Latin small letter f with hook")},{character:"∫",title:e("Integral")},{character:"∑",title:e("N-ary summation")},{character:"∞",title:e("Infinity")},{character:"√",title:e("Square root")},{character:"∼",title:e("Tilde operator")},{character:"≅",title:e("Approximately equal to")},{character:"≈",title:e("Almost equal to")},{character:"≠",title:e("Not equal to")},{character:"≡",title:e("Identical to")},{character:"∈",title:e("Element of")},{character:"∉",title:e("Not an element of")},{character:"∋",title:e("Contains as member")},{character:"∏",title:e("N-ary product")},{character:"∧",title:e("Logical and")},{character:"∨",title:e("Logical or")},{character:"¬",title:e("Not sign")},{character:"∩",title:e("Intersection")},{character:"∪",title:e("Union")},{character:"∂",title:e("Partial differential")},{character:"∀",title:e("For all")},{character:"∃",title:e("There exists")},{character:"∅",title:e("Empty set")},{character:"∇",title:e("Nabla")},{character:"∗",title:e("Asterisk operator")},{character:"∝",title:e("Proportional to")},{character:"∠",title:e("Angle")},{character:"¼",title:e("Vulgar fraction one quarter")},{character:"½",title:e("Vulgar fraction one half")},{character:"¾",title:e("Vulgar fraction three quarters")}])}}class Xp extends ud{init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Latin",[{character:"Ā",title:e("Latin capital letter a with macron")},{character:"ā",title:e("Latin small letter a with macron")},{character:"Ă",title:e("Latin capital letter a with breve")},{character:"ă",title:e("Latin small letter a with breve")},{character:"Ą",title:e("Latin capital letter a with ogonek")},{character:"ą",title:e("Latin small letter a with ogonek")},{character:"Ć",title:e("Latin capital letter c with acute")},{character:"ć",title:e("Latin small letter c with acute")},{character:"Ĉ",title:e("Latin capital letter c with circumflex")},{character:"ĉ",title:e("Latin small letter c with circumflex")},{character:"Ċ",title:e("Latin capital letter c with dot above")},{character:"ċ",title:e("Latin small letter c with dot above")},{character:"Č",title:e("Latin capital letter c with caron")},{character:"č",title:e("Latin small letter c with caron")},{character:"Ď",title:e("Latin capital letter d with caron")},{character:"ď",title:e("Latin small letter d with caron")},{character:"Đ",title:e("Latin capital letter d with stroke")},{character:"đ",title:e("Latin small letter d with stroke")},{character:"Ē",title:e("Latin capital letter e with macron")},{character:"ē",title:e("Latin small letter e with macron")},{character:"Ĕ",title:e("Latin capital letter e with breve")},{character:"ĕ",title:e("Latin small letter e with breve")},{character:"Ė",title:e("Latin capital letter e with dot above")},{character:"ė",title:e("Latin small letter e with dot above")},{character:"Ę",title:e("Latin capital letter e with ogonek")},{character:"ę",title:e("Latin small letter e with ogonek")},{character:"Ě",title:e("Latin capital letter e with caron")},{character:"ě",title:e("Latin small letter e with caron")},{character:"Ĝ",title:e("Latin capital letter g with circumflex")},{character:"ĝ",title:e("Latin small letter g with circumflex")},{character:"Ğ",title:e("Latin capital letter g with breve")},{character:"ğ",title:e("Latin small letter g with breve")},{character:"Ġ",title:e("Latin capital letter g with dot above")},{character:"ġ",title:e("Latin small letter g with dot above")},{character:"Ģ",title:e("Latin capital letter g with cedilla")},{character:"ģ",title:e("Latin small letter g with cedilla")},{character:"Ĥ",title:e("Latin capital letter h with circumflex")},{character:"ĥ",title:e("Latin small letter h with circumflex")},{character:"Ħ",title:e("Latin capital letter h with stroke")},{character:"ħ",title:e("Latin small letter h with stroke")},{character:"Ĩ",title:e("Latin capital letter i with tilde")},{character:"ĩ",title:e("Latin small letter i with tilde")},{character:"Ī",title:e("Latin capital letter i with macron")},{character:"ī",title:e("Latin small letter i with macron")},{character:"Ĭ",title:e("Latin capital letter i with breve")},{character:"ĭ",title:e("Latin small letter i with breve")},{character:"Į",title:e("Latin capital letter i with ogonek")},{character:"į",title:e("Latin small letter i with ogonek")},{character:"İ",title:e("Latin capital letter i with dot above")},{character:"ı",title:e("Latin small letter dotless i")},{character:"IJ",title:e("Latin capital ligature ij")},{character:"ij",title:e("Latin small ligature ij")},{character:"Ĵ",title:e("Latin capital letter j with circumflex")},{character:"ĵ",title:e("Latin small letter j with circumflex")},{character:"Ķ",title:e("Latin capital letter k with cedilla")},{character:"ķ",title:e("Latin small letter k with cedilla")},{character:"ĸ",title:e("Latin small letter kra")},{character:"Ĺ",title:e("Latin capital letter l with acute")},{character:"ĺ",title:e("Latin small letter l with acute")},{character:"Ļ",title:e("Latin capital letter l with cedilla")},{character:"ļ",title:e("Latin small letter l with cedilla")},{character:"Ľ",title:e("Latin capital letter l with caron")},{character:"ľ",title:e("Latin small letter l with caron")},{character:"Ŀ",title:e("Latin capital letter l with middle dot")},{character:"ŀ",title:e("Latin small letter l with middle dot")},{character:"Ł",title:e("Latin capital letter l with stroke")},{character:"ł",title:e("Latin small letter l with stroke")},{character:"Ń",title:e("Latin capital letter n with acute")},{character:"ń",title:e("Latin small letter n with acute")},{character:"Ņ",title:e("Latin capital letter n with cedilla")},{character:"ņ",title:e("Latin small letter n with cedilla")},{character:"Ň",title:e("Latin capital letter n with caron")},{character:"ň",title:e("Latin small letter n with caron")},{character:"ʼn",title:e("Latin small letter n preceded by apostrophe")},{character:"Ŋ",title:e("Latin capital letter eng")},{character:"ŋ",title:e("Latin small letter eng")},{character:"Ō",title:e("Latin capital letter o with macron")},{character:"ō",title:e("Latin small letter o with macron")},{character:"Ŏ",title:e("Latin capital letter o with breve")},{character:"ŏ",title:e("Latin small letter o with breve")},{character:"Ő",title:e("Latin capital letter o with double acute")},{character:"ő",title:e("Latin small letter o with double acute")},{character:"Œ",title:e("Latin capital ligature oe")},{character:"œ",title:e("Latin small ligature oe")},{character:"Ŕ",title:e("Latin capital letter r with acute")},{character:"ŕ",title:e("Latin small letter r with acute")},{character:"Ŗ",title:e("Latin capital letter r with cedilla")},{character:"ŗ",title:e("Latin small letter r with cedilla")},{character:"Ř",title:e("Latin capital letter r with caron")},{character:"ř",title:e("Latin small letter r with caron")},{character:"Ś",title:e("Latin capital letter s with acute")},{character:"ś",title:e("Latin small letter s with acute")},{character:"Ŝ",title:e("Latin capital letter s with circumflex")},{character:"ŝ",title:e("Latin small letter s with circumflex")},{character:"Ş",title:e("Latin capital letter s with cedilla")},{character:"ş",title:e("Latin small letter s with cedilla")},{character:"Š",title:e("Latin capital letter s with caron")},{character:"š",title:e("Latin small letter s with caron")},{character:"Ţ",title:e("Latin capital letter t with cedilla")},{character:"ţ",title:e("Latin small letter t with cedilla")},{character:"Ť",title:e("Latin capital letter t with caron")},{character:"ť",title:e("Latin small letter t with caron")},{character:"Ŧ",title:e("Latin capital letter t with stroke")},{character:"ŧ",title:e("Latin small letter t with stroke")},{character:"Ũ",title:e("Latin capital letter u with tilde")},{character:"ũ",title:e("Latin small letter u with tilde")},{character:"Ū",title:e("Latin capital letter u with macron")},{character:"ū",title:e("Latin small letter u with macron")},{character:"Ŭ",title:e("Latin capital letter u with breve")},{character:"ŭ",title:e("Latin small letter u with breve")},{character:"Ů",title:e("Latin capital letter u with ring above")},{character:"ů",title:e("Latin small letter u with ring above")},{character:"Ű",title:e("Latin capital letter u with double acute")},{character:"ű",title:e("Latin small letter u with double acute")},{character:"Ų",title:e("Latin capital letter u with ogonek")},{character:"ų",title:e("Latin small letter u with ogonek")},{character:"Ŵ",title:e("Latin capital letter w with circumflex")},{character:"ŵ",title:e("Latin small letter w with circumflex")},{character:"Ŷ",title:e("Latin capital letter y with circumflex")},{character:"ŷ",title:e("Latin small letter y with circumflex")},{character:"Ÿ",title:e("Latin capital letter y with diaeresis")},{character:"Ź",title:e("Latin capital letter z with acute")},{character:"ź",title:e("Latin small letter z with acute")},{character:"Ż",title:e("Latin capital letter z with dot above")},{character:"ż",title:e("Latin small letter z with dot above")},{character:"Ž",title:e("Latin capital letter z with caron")},{character:"ž",title:e("Latin small letter z with caron")},{character:"ſ",title:e("Latin small letter long s")}])}}class tb extends ud{init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Text",[{character:"‹",title:e("Single left-pointing angle quotation mark")},{character:"›",title:e("Single right-pointing angle quotation mark")},{character:"«",title:e("Left-pointing double angle quotation mark")},{character:"»",title:e("Right-pointing double angle quotation mark")},{character:"‘",title:e("Left single quotation mark")},{character:"’",title:e("Right single quotation mark")},{character:"“",title:e("Left double quotation mark")},{character:"”",title:e("Right double quotation mark")},{character:"‚",title:e("Single low-9 quotation mark")},{character:"„",title:e("Double low-9 quotation mark")},{character:"¡",title:e("Inverted exclamation mark")},{character:"¿",title:e("Inverted question mark")},{character:"‥",title:e("Two dot leader")},{character:"…",title:e("Horizontal ellipsis")},{character:"‡",title:e("Double dagger")},{character:"‰",title:e("Per mille sign")},{character:"‱",title:e("Per ten thousand sign")},{character:"‼",title:e("Double exclamation mark")},{character:"⁈",title:e("Question exclamation mark")},{character:"⁉",title:e("Exclamation question mark")},{character:"⁇",title:e("Double question mark")},{character:"©",title:e("Copyright sign")},{character:"®",title:e("Registered sign")},{character:"™",title:e("Trade mark sign")},{character:"§",title:e("Section sign")},{character:"¶",title:e("Paragraph sign")},{character:"⁋",title:e("Reversed paragraph sign")}])}}class eb extends md{constructor(t){super(t),this._selectedElements=[],this.on("execute",()=>{this.refresh()},{priority:"highest"})}refresh(){this._selectedElements=this._getSelectedItems(),this.value=this._selectedElements.every(t=>!!t.getAttribute("todoListChecked")),this.isEnabled=!!this._selectedElements.length}_getSelectedItems(){const t=this.editor.model,e=t.schema,i=t.document.selection.getFirstRange(),o=i.start.parent,n=[];e.checkAttribute(o,"todoListChecked")&&n.push(o);for(const t of i.getItems())e.checkAttribute(t,"todoListChecked")&&!n.includes(t)&&n.push(t);return n}execute(t={}){this.editor.model.change(e=>{for(const i of this._selectedElements){(void 0===t.forceValue?!this.value:t.forceValue)?e.setAttribute("todoListChecked",!0,i):e.removeAttribute("todoListChecked",i)}})}}function ib(t,e,i){const o=e.modelCursor,n=o.parent,r=e.viewItem;if("checkbox"!=r.getAttribute("type")||"listItem"!=n.name||!o.isAtStart)return;if(!i.consumable.consume(r,{name:!0}))return;const s=i.writer;s.setAttribute("listType","todo",n),e.viewItem.hasAttribute("checked")&&s.setAttribute("todoListChecked",!0,n),e.modelRange=s.createRange(o)}function ob(t){return(e,i)=>{const o=i.modelPosition,n=o.parent;if(!n.is("element","listItem")||"todo"!=n.getAttribute("listType"))return;const r=rb(i.mapper.toViewElement(n),t);r&&(i.viewPosition=i.mapper.findPositionIn(r,o.offset))}}function nb(t,e,i,o){return e.createUIElement("label",{class:"todo-list__label",contenteditable:!1},(function(e){const n=Tc(document,"input",{type:"checkbox"});i&&n.setAttribute("checked","checked"),n.addEventListener("change",()=>o(t));const r=this.toDomElement(e);return r.appendChild(n),r}))}function rb(t,e){const i=e.createRangeIn(t);for(const t of i)if(t.item.is("containerElement","span")&&t.item.hasClass("todo-list__label__description"))return t.item}class sb extends ud{static get pluginName(){return"TodoListEditing"}static get requires(){return[bp]}init(){const t=this.editor,{editing:e,data:i,model:o}=t;var n,r;o.schema.extend("listItem",{allowAttributes:["todoListChecked"]}),o.schema.addAttributeCheck((t,e)=>{const i=t.last;if("todoListChecked"==e&&"listItem"==i.name&&"todo"!=i.getAttribute("listType"))return!1}),t.commands.add("todoList",new Wf(t,"todo")),t.commands.add("todoListCheck",new eb(t)),i.downcastDispatcher.on("insert:listItem",function(t){return(e,i,o)=>{const n=o.consumable;if(!n.test(i.item,"insert")||!n.test(i.item,"attribute:listType")||!n.test(i.item,"attribute:listIndent"))return;if("todo"!=i.item.getAttribute("listType"))return;const r=i.item;n.consume(r,"insert"),n.consume(r,"attribute:listType"),n.consume(r,"attribute:listIndent"),n.consume(r,"attribute:todoListChecked");const s=o.writer,a=Kf(r,o);s.addClass("todo-list",a.parent);const l=s.createContainerElement("label",{class:"todo-list__label"}),c=s.createEmptyElement("input",{type:"checkbox",disabled:"disabled"}),d=s.createContainerElement("span",{class:"todo-list__label__description"});r.getAttribute("todoListChecked")&&s.setAttribute("checked","checked",c),s.insert(s.createPositionAt(a,0),l),s.insert(s.createPositionAt(l,0),c),s.insert(s.createPositionAfter(c),d),Qf(r,a,o,t)}}(o),{priority:"high"}),i.upcastDispatcher.on("element:input",ib,{priority:"high"}),e.downcastDispatcher.on("insert:listItem",function(t,e){return(i,o,n)=>{const r=n.consumable;if(!r.test(o.item,"insert")||!r.test(o.item,"attribute:listType")||!r.test(o.item,"attribute:listIndent"))return;if("todo"!=o.item.getAttribute("listType"))return;const s=o.item;r.consume(s,"insert"),r.consume(s,"attribute:listType"),r.consume(s,"attribute:listIndent"),r.consume(s,"attribute:todoListChecked");const a=n.writer,l=Kf(s,n),c=!!s.getAttribute("todoListChecked"),d=nb(s,a,c,e),h=a.createContainerElement("span",{class:"todo-list__label__description"});a.addClass("todo-list",l.parent),a.insert(a.createPositionAt(l,0),d),a.insert(a.createPositionAfter(d),h),Qf(s,l,n,t)}}(o,t=>this._handleCheckmarkChange(t)),{priority:"high"}),e.downcastDispatcher.on("attribute:listType:listItem",(n=t=>this._handleCheckmarkChange(t),r=e.view,(t,e,i)=>{const o=i.mapper.toViewElement(e.item),s=i.writer,a=function(t,e){const i=e.createRangeIn(t);for(const t of i)if(t.item.is("uiElement","label"))return t.item}(o,r);if("todo"==e.attributeNewValue){const t=!!e.item.getAttribute("todoListChecked"),i=nb(e.item,s,t,n),r=s.createContainerElement("span",{class:"todo-list__label__description"}),a=s.createRangeIn(o),l=ep(o),c=Zf(a.start),d=l?s.createPositionBefore(l):a.end,h=s.createRange(c,d);s.addClass("todo-list",o.parent),s.move(h,s.createPositionAt(r,0)),s.insert(s.createPositionAt(o,0),i),s.insert(s.createPositionAfter(i),r)}else if("todo"==e.attributeOldValue){const t=rb(o,r);s.removeClass("todo-list",o.parent),s.remove(a),s.move(s.createRangeIn(t),s.createPositionBefore(t)),s.remove(t)}})),e.downcastDispatcher.on("attribute:todoListChecked:listItem",function(t){return(e,i,o)=>{if("todo"!=i.item.getAttribute("listType"))return;if(!o.consumable.consume(i.item,"attribute:todoListChecked"))return;const{mapper:n,writer:r}=o,s=!!i.item.getAttribute("todoListChecked"),a=n.toViewElement(i.item).getChild(0),l=nb(i.item,r,s,t);r.insert(r.createPositionAfter(a),l),r.remove(a)}}(t=>this._handleCheckmarkChange(t))),e.mapper.on("modelToViewPosition",ob(e.view)),i.mapper.on("modelToViewPosition",ob(e.view)),this.listenTo(e.view.document,"keydown",function(t,e){return(i,o)=>{if("left"!=vn(o.keyCode,e.contentLanguageDirection))return;const n=t.schema,r=t.document.selection;if(!r.isCollapsed)return;const s=r.getFirstPosition(),a=s.parent;if("listItem"===a.name&&"todo"==a.getAttribute("listType")&&s.isAtStart){const e=n.getNearestSelectionRange(t.createPositionBefore(a),"backward");e&&t.change(t=>t.setSelection(e)),o.preventDefault(),o.stopPropagation(),i.stop()}}}(o,t.locale)),t.keystrokes.set("Ctrl+space",()=>t.execute("todoListCheck"));const s=new Set;this.listenTo(o,"applyOperation",(t,e)=>{const i=e[0];if("rename"==i.type&&"listItem"==i.oldName){const t=i.position.nodeAfter;t.hasAttribute("todoListChecked")&&s.add(t)}else if("changeAttribute"==i.type&&"listType"==i.key&&"todo"===i.oldValue)for(const t of i.range.getItems())t.hasAttribute("todoListChecked")&&"todo"!==t.getAttribute("listType")&&s.add(t)}),o.document.registerPostFixer(t=>{let e=!1;for(const i of s)t.removeAttribute("todoListChecked",i),e=!0;return s.clear(),e})}_handleCheckmarkChange(t){const e=this.editor,i=e.model,o=Array.from(i.document.selection.getRanges());i.change(i=>{i.setSelection(t,"end"),e.execute("todoListCheck"),i.setSelection(o)})}}class ab extends ud{init(){const t=this.editor.t;tp(this.editor,"todoList",t("To-do List"),'')}}i(114);class lb extends ud{static get pluginName(){return"UnderlineEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"underline"}),t.model.schema.setAttributeProperties("underline",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"underline",view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),t.commands.add("underline",new Id(t,"underline")),t.keystrokes.set("CTRL+U","underline")}}class cb extends ud{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("underline",i=>{const o=t.commands.get("underline"),n=new Kc(i);return n.set({label:e("Underline"),icon:'',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),n.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(n,"execute",()=>{t.execute("underline"),t.editing.view.focus()}),n})}}class db extends ud{static get pluginName(){return"Autosave"}static get requires(){return[Mm]}constructor(t){super(t);const e=t.config.get("autosave")||{},i=e.waitingTime||1e3;this.set("state","synchronized"),this._debouncedSave=Kr(this._save.bind(this),i),this._lastDocumentVersion=t.model.document.version,this._domEmitter=Object.create(mr),this._config=e}init(){const t=this.editor,e=t.model.document,i=t.t;this._pendingActions=t.plugins.get(Mm),this.listenTo(e,"change:data",()=>{this._saveCallbacks.length&&("synchronized"==this.state?(this._action=this._pendingActions.add(i("Saving changes")),this.state="waiting",this._debouncedSave()):"waiting"==this.state&&this._debouncedSave())}),this.listenTo(t,"destroy",()=>this._flush(),{priority:"highest"}),this._domEmitter.listenTo(window,"beforeunload",(t,e)=>{this._pendingActions.hasAny&&(e.returnValue=this._pendingActions.first.message)})}destroy(){this._domEmitter.stopListening(),super.destroy()}_flush(){this._debouncedSave.flush()}_save(){const t=this.editor.model.document.version;tPromise.all(this._saveCallbacks.map(t=>t(this.editor)))).catch(t=>{throw this.state="error",this.state="saving",this._debouncedSave(),t}).then(()=>{this.editor.model.document.version>this._lastDocumentVersion?(this.state="waiting",this._debouncedSave()):(this.state="synchronized",this._pendingActions.remove(this._action),this._action=null)}))}get _saveCallbacks(){const t=[];return this.adapter&&this.adapter.save&&t.push(this.adapter.save),this._config.save&&t.push(this._config.save),t}}yi(db,Uo);class hb extends hd{}hb.builtinPlugins=[class extends ud{static get requires(){return[vd,Td]}static get pluginName(){return"Alignment"}},class extends ud{static get requires(){return[Md,Ld]}static get pluginName(){return"BlockQuote"}},class extends ud{static get requires(){return[Nd,zd]}static get pluginName(){return"Bold"}},class extends ud{static get requires(){return[jd,qd,th,Yd,mh,Oh]}static get pluginName(){return"Essentials"}},class extends ud{static get requires(){return[cu,uu]}static get pluginName(){return"FontBackgroundColor"}},class extends ud{static get requires(){return[mu,fu]}static get pluginName(){return"FontColor"}},class extends ud{static get requires(){return[_u,yu]}static get pluginName(){return"FontFamily"}},class extends ud{static get requires(){return[Su,Pu]}static get pluginName(){return"FontSize"}},class extends ud{static get requires(){return[Ou,Ru]}static get pluginName(){return"Heading"}},class extends ud{static get requires(){return[Vu,Bu]}static get pluginName(){return"Highlight"}},class extends ud{static get requires(){return[ag,lg]}static get pluginName(){return"HorizontalLine"}},class extends ud{static get requires(){return[bg,Cg,qg]}static get pluginName(){return"Image"}},class extends ud{static get requires(){return[Gg]}static get pluginName(){return"ImageCaption"}},class extends ud{static get requires(){return[Xg,cm,im]}static get pluginName(){return"ImageResize"}},class extends ud{static get requires(){return[_m,vm]}static get pluginName(){return"ImageStyle"}},class extends ud{static get requires(){return[ym]}static get pluginName(){return"ImageToolbar"}afterInit(){const t=this.editor,e=t.t;t.plugins.get(ym).register("image",{ariaLabel:e("Image toolbar"),items:t.config.get("image.toolbar")||[],getRelatedElement:dg})}},class extends ud{static get pluginName(){return"ImageUpload"}static get requires(){return[qm,Pm,zm]}},class extends ud{static get requires(){return[$m,Gm]}static get pluginName(){return"Italic"}},class extends ud{static get requires(){return[If,Vf,Uf]}static get pluginName(){return"Link"}},class extends ud{static get requires(){return[bp,vp]}static get pluginName(){return"List"}},class extends ud{static get requires(){return[xp,Ep]}static get pluginName(){return"ListStyle"}},class extends ud{static get requires(){return[jp,Up,Fp,Cg]}static get pluginName(){return"MediaEmbed"}},class extends ud{static get requires(){return[ym]}static get pluginName(){return"MediaEmbedToolbar"}afterInit(){const t=this.editor,e=t.t;t.plugins.get(ym).register("mediaEmbed",{ariaLabel:e("Media toolbar"),items:t.config.get("mediaEmbed.toolbar")||[],getRelatedElement:Ip})}},Iu,class extends ud{static get requires(){return[Im]}static get pluginName(){return"SimpleUploadAdapter"}init(){const t=this.editor.config.get("simpleUpload");t&&(t.uploadUrl?this.editor.plugins.get(Im).createUploadAdapter=e=>new qp(e,t):Object(hi.c)("simple-upload-adapter-missing-uploadurl"))}},class extends ud{static get requires(){return[mh]}static get pluginName(){return"SpecialCharacters"}constructor(t){super(t),this._characters=new Map,this._groups=new Map}init(){const t=this.editor,e=t.t,i=t.commands.get("input");t.ui.componentFactory.add("specialCharacters",o=>{const n=od(o);let r;return n.buttonView.set({label:e("Special characters"),icon:'',tooltip:!0}),n.bind("isEnabled").to(i),n.on("execute",(e,i)=>{t.execute("input",{text:i.character}),t.editing.view.focus()}),n.on("change:isOpen",()=>{r||(r=this._createDropdownPanelContent(o,n),n.panelView.children.add(r.navigationView),n.panelView.children.add(r.gridView),n.panelView.children.add(r.infoView)),r.infoView.set({character:null,name:null})}),n})}addItems(t,e){if("All"===t)throw new hi.a('special-character-invalid-group-name: The name "All" is reserved and cannot be used.');const i=this._getGroup(t);for(const t of e)i.add(t.title),this._characters.set(t.title,t.character)}getGroups(){return this._groups.keys()}getCharactersForGroup(t){return"All"===t?new Set(this._characters.keys()):this._groups.get(t)}getCharacter(t){return this._characters.get(t)}_getGroup(t){return this._groups.has(t)||this._groups.set(t,new Set),this._groups.get(t)}_updateGrid(t,e){e.tiles.clear();const i=this.getCharactersForGroup(t);for(const t of i){const i=this.getCharacter(t);e.tiles.add(e.createTile(i,t))}}_createDropdownPanelContent(t,e){const i=[...this.getGroups()];i.unshift("All");const o=new $p(t,i),n=new Gp(t),r=new Yp(t);return n.delegate("execute").to(e),n.on("tileHover",(t,e)=>{r.set(e)}),o.on("execute",()=>{this._updateGrid(o.currentGroupName,n)}),this._updateGrid(o.currentGroupName,n),{navigationView:o,gridView:n,infoView:r}}},Qp,Jp,class extends ud{static get requires(){return[Jp,tb,Zp,Qp,Xp]}},Xp,class extends ud{static get requires(){return[sb,ab]}static get pluginName(){return"TodoList"}},class extends ud{static get requires(){return[lb,cb]}static get pluginName(){return"Underline"}},class extends ud{constructor(t){super(t),this.isview=!1,this.codeview=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}static get pluginName(){return"ViewSource"}init(){this.editor.ui.componentFactory.add("viewSource",t=>{const e=new Kc(t);return e.set({label:"Voir/Masquer sources",icon:'\n',tooltip:!0}),e.on("execute",()=>{var t;this.isview?(t=(t=(t=(t=this.editor.getData()).replaceAll("<","<")).replaceAll(">",">")).replaceAll("

 

",""),this.editor.setData(t),this.isview=!1):(t=(t=(t=(t=this.editor.getData()).replaceAll("

 

","")).replaceAll("<","<")).replaceAll(">",">"),this.isview=!0,this.editor.setData(t))}),e})}},db],hb.defaultConfig={toolbar:{items:["viewSource","heading","|","fontBackgroundColor","fontFamily","fontSize","fontColor","highlight","|","bold","underline","italic","horizontalLine","|","link","bulletedList","todoList","numberedList","|","blockQuote","mediaEmbed","undo","redo"]},language:"fr",image:{toolbar:["imageTextAlternative","imageStyle:full","imageStyle:side"]},licenseKey:"",simpleUpload:{uploadUrl:"index.php?action=uploadCKImg",withCredentials:!1,headers:{"X-CSRF-TOKEN":"CSFR-Token",Authorization:""}}}}]).default})); +//# sourceMappingURL=ckeditor.js.map \ No newline at end of file diff --git a/theme/default/assets/js/custom.js b/theme/default/assets/js/custom.js index 94bb9331..45531747 100644 --- a/theme/default/assets/js/custom.js +++ b/theme/default/assets/js/custom.js @@ -302,7 +302,6 @@ function switchEnLigne() { { hide(el.getAttribute('id')); } - console.log("joueur"+id); show("joueur"+id); } diff --git a/theme/default/assets/js/voteControleur.js b/theme/default/assets/js/voteControleur.js index 8ba2da18..2e237fbf 100644 --- a/theme/default/assets/js/voteControleur.js +++ b/theme/default/assets/js/voteControleur.js @@ -157,7 +157,7 @@ function updateBaltop(loop = false) { f+='' +'
"); $.ajax({ url: 'index.php?action=rechercheMembre', type: 'POST', data: 'ajax=true&recherche=' + $('#recherche').val(), success: function(code, statut) { - $("#tableMembre").html(code); + if(code.length > 0) { + $("#tableMembre").html(code) + }else { + $("#tableMembre").html(``) + } } }); } @@ -166,30 +174,32 @@ function AJAXActuChat() { notif('warning', 'Un mail vient de vous être envoyé pour l\'activation de votre compte. Vérifiez dans les Courriers indésirables.'); - notif('erreur', 'Votre compte ne peut être activé.'); + notif('error', 'Votre compte ne peut être activé.'); notif('success','Votre commentaire vient d\'être envoyé.'); - notif('erreur', 'Votre commentaire est trop long.'); + notif('error', 'Votre commentaire est trop long.'); - notif('erreur','Votre commentaire est trop court.'); + notif('error','Votre commentaire est trop court.'); - notif('erreur','Vous n\'êtes pas connecté.'); + notif('error','Vous n\'êtes pas connecté.'); - notif('erreur', 'Cette nouveauté n\'existe pas.'); + notif('error', 'Cette nouveauté n\'existe pas.'); - notif('erreur','Ce ticket n\'existe pas.'); + notif('error','Ce ticket n\'existe pas.'); - notif('erreur','Ce commentaire n\'existe pas.'); + notif('error','Ce commentaire n\'existe pas.'); - notif('erreur','Votre mention j\'aime est déjà existante.'); + notif('error','Votre mention j\'aime est déjà existante.'); notif('success', 'Votre mention j\'aime vient d\'être envoyée.'); notif('success','Votre commentaire vient d\'être supprimé.'); - notif('erreur','Le commentaire ne peut être supprimé.'); - + notif('error','Le commentaire ne peut être supprimé.'); + + notif('success','Le signalement a bien été envoyé.'); + $(document).ready(function() { notif2("Paysafecard", "Votre paiement est en attente ! Il sera traité par un admin prochainement.", "success"); }); - $(document).ready(function() { notif2("Boutique", "Vos achats ont été validé.", "success"); diff --git a/theme/default/entete.php b/theme/default/entete.php index 843ddce9..8d583ed4 100644 --- a/theme/default/entete.php +++ b/theme/default/entete.php @@ -1,7 +1,7 @@
-
+
diff --git a/theme/default/formulaires.php b/theme/default/formulaires.php index 2ceaaa07..c1c56341 100644 --- a/theme/default/formulaires.php +++ b/theme/default/formulaires.php @@ -1,7 +1,7 @@
@@ -219,7 +221,8 @@
, Le + $hour = explode(' ', $date[2]); + echo $hour[0] . '-' . $date[1] . '-' . $date[0] . ' à ' . $hour[1]; ?>

Il n'y a pas de sujet dans ce forum

@@ -408,4 +411,4 @@ - \ No newline at end of file + diff --git a/theme/default/pages/membres.php b/theme/default/pages/membres.php index f758d6c1..ad6a26bc 100644 --- a/theme/default/pages/membres.php +++ b/theme/default/pages/membres.php @@ -54,7 +54,7 @@ @@ -114,7 +114,7 @@ $commentaires = 0; ?>
Type
' style='width: 32px; height: 32px;' alt='Profil' /> gradeJoueur($value["pseudo"]);?>
+ ' style='width: 32px; height: 32px;' alt='image de profile de ' /> + gradeJoueur($value["pseudo"]); ?> + Voir le compte +
777755
' - +' ' + +' ' +'' +ar.pseudo +'' @@ -259,20 +259,24 @@ function pickupRecompense() { if (r == true) { $.post("index.php?action=recupVotesTemp", {}, function (data, status) { - let el = document.getElementById("recompList"); - el.innerText = "Récompenses envoyé !"; - setTimeout(function () { - clearRecompense(); - }, 3000); + data = data.substring(data.indexOf('[DIV]')+5); + clearRecompense(); + if(parseInt(data) != 0) { + notif("warning", data+" récompense(s) n'ont pas pu être distribués"); + } else { + notif("success","Récompenses envoyé !"); + } }); } } else { $.post("index.php?action=recupVotesTemp", {}, function (data, status) { - let el = document.getElementById("recompList"); - el.innerText = "Récompenses envoyé !"; - setTimeout(function () { - clearRecompense(); - }, 3000); + data = data.substring(data.indexOf('[DIV]')+5); + clearRecompense(); + if(parseInt(data) != 0) { + notif("warning", data+" récompense(s) n'ont pas pu être distribués"); + } else { + notif("success","Récompenses envoyé !"); + } }); } } diff --git a/theme/default/assets/php/ckeditorManager.php b/theme/default/assets/php/ckeditorManager.php index 29108906..50ee79e9 100644 --- a/theme/default/assets/php/ckeditorManager.php +++ b/theme/default/assets/php/ckeditorManager.php @@ -8,6 +8,7 @@ function initCK() { toolbar: { items: [ + 'viewSource', 'heading', '|', 'fontBackgroundColor', @@ -43,13 +44,13 @@ function initCK() { }, licenseKey: '', simpleUpload: { - uploadUrl: 'index.php?action=uploadCKImg', - withCredentials: false, - headers: { - 'X-CSRF-TOKEN': 'CSFR-Token', - Authorization: 'Bearer ' - } - } + uploadUrl: 'index.php?action=uploadCKImg', + withCredentials: false, + headers: { + 'X-CSRF-TOKEN': 'CSFR-Token', + Authorization: '' + } + } } ) .catch( error => {console.log( error );} ) diff --git a/theme/default/assets/php/custom.php b/theme/default/assets/php/custom.php index cd2ff4e4..5ff8cdc5 100644 --- a/theme/default/assets/php/custom.php +++ b/theme/default/assets/php/custom.php @@ -59,13 +59,21 @@ function copierIP() { ?> function rechercheAjaxMembre() { - $("#tableMembre").html("/img/gif-search.gif'>Recherche en cours ..."); + $("#tableMembre").html(" Recherche en cours... +
+ Aucun joueur trouvé. +
+
- gradeJoueur($value["pseudo"]); ?> + gradeJoueur($value["pseudo"]); ?> diff --git a/theme/default/pages/post.php b/theme/default/pages/post.php index 88d5f8f8..2113ec57 100644 --- a/theme/default/pages/post.php +++ b/theme/default/pages/post.php @@ -71,7 +71,7 @@ @@ -196,11 +196,11 @@
- gradeJoueur($topicd['pseudo']); ?> + gradeJoueur($topicd['pseudo']); ?>
- verifPerm('PermsForum', 'general', 'editTopic') && !$_SESSION['mode'])) : ?> + verifPerm('PermsForum', 'moderation', 'editTopic') && !$_SESSION['mode'])) : ?> @@ -210,7 +210,7 @@ - verifPerm('PermsForum', 'general', 'deleteTopic') && !$_SESSION['mode'])) : ?> + verifPerm('PermsForum', 'moderation', 'deleteTopic') && !$_SESSION['mode'])) : ?>
diff --git a/theme/default/pages/profil.php b/theme/default/pages/profil.php index 85b914ee..be473819 100644 --- a/theme/default/pages/profil.php +++ b/theme/default/pages/profil.php @@ -414,8 +414,9 @@ class="btn btn-main validerChange bg-lightest w-100 form-control">
- - +
diff --git a/theme/default/pages/support.php b/theme/default/pages/support.php index 0621f70a..02ee281e 100644 --- a/theme/default/pages/support.php +++ b/theme/default/pages/support.php @@ -65,7 +65,7 @@
- + Voir