commit 224fd41407522ba7d4258d6866aeda4501539d07 Author: CaoJay_21653B112 <1227905473@qq.com> Date: Sun Jan 2 17:13:37 2022 +0800 'Blog' diff --git a/.idea/CaoJay_Code.iml b/.idea/CaoJay_Code.iml new file mode 100644 index 0000000..9710855 --- /dev/null +++ b/.idea/CaoJay_Code.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..3999087 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..341de13 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..164415b --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Blog/.idea/.gitignore b/Blog/.idea/.gitignore new file mode 100644 index 0000000..ed3f801 --- /dev/null +++ b/Blog/.idea/.gitignore @@ -0,0 +1,4 @@ +# Default ignored files +/workspace.xml +# Datasource local storage ignored files +/dataSources.local.xml \ No newline at end of file diff --git a/Blog/.idea/Blog.iml b/Blog/.idea/Blog.iml new file mode 100644 index 0000000..d920dc0 --- /dev/null +++ b/Blog/.idea/Blog.iml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Blog/.idea/codeStyles/codeStyleConfig.xml b/Blog/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..a55e7a1 --- /dev/null +++ b/Blog/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/Blog/.idea/dataSources.xml b/Blog/.idea/dataSources.xml new file mode 100644 index 0000000..c3b91c6 --- /dev/null +++ b/Blog/.idea/dataSources.xml @@ -0,0 +1,11 @@ + + + + + sqlite.xerial + true + org.sqlite.JDBC + jdbc:sqlite:C:\Users\admin\PycharmProjects\CaoJay_Code\Blog\db.sqlite3 + + + \ No newline at end of file diff --git a/Blog/.idea/inspectionProfiles/profiles_settings.xml b/Blog/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/Blog/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/Blog/.idea/misc.xml b/Blog/.idea/misc.xml new file mode 100644 index 0000000..3999087 --- /dev/null +++ b/Blog/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/Blog/.idea/modules.xml b/Blog/.idea/modules.xml new file mode 100644 index 0000000..ebd3bd0 --- /dev/null +++ b/Blog/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Blog/.idea/vcs.xml b/Blog/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/Blog/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Blog/Blog/__init__.py b/Blog/Blog/__init__.py new file mode 100644 index 0000000..063cd2c --- /dev/null +++ b/Blog/Blog/__init__.py @@ -0,0 +1,2 @@ +import pymysql +pymysql.install_as_MySQLdb() diff --git a/Blog/Blog/__pycache__/__init__.cpython-36.pyc b/Blog/Blog/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..c8317ed Binary files /dev/null and b/Blog/Blog/__pycache__/__init__.cpython-36.pyc differ diff --git a/Blog/Blog/__pycache__/settings.cpython-36.pyc b/Blog/Blog/__pycache__/settings.cpython-36.pyc new file mode 100644 index 0000000..3677049 Binary files /dev/null and b/Blog/Blog/__pycache__/settings.cpython-36.pyc differ diff --git a/Blog/Blog/__pycache__/urls.cpython-36.pyc b/Blog/Blog/__pycache__/urls.cpython-36.pyc new file mode 100644 index 0000000..8a7866f Binary files /dev/null and b/Blog/Blog/__pycache__/urls.cpython-36.pyc differ diff --git a/Blog/Blog/__pycache__/wsgi.cpython-36.pyc b/Blog/Blog/__pycache__/wsgi.cpython-36.pyc new file mode 100644 index 0000000..19c24a9 Binary files /dev/null and b/Blog/Blog/__pycache__/wsgi.cpython-36.pyc differ diff --git a/Blog/Blog/asgi.py b/Blog/Blog/asgi.py new file mode 100644 index 0000000..7cac603 --- /dev/null +++ b/Blog/Blog/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for Blog project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Blog.settings') + +application = get_asgi_application() diff --git a/Blog/Blog/settings.py b/Blog/Blog/settings.py new file mode 100644 index 0000000..3e1992e --- /dev/null +++ b/Blog/Blog/settings.py @@ -0,0 +1,154 @@ +""" +Django settings for Blog project. + +Generated by 'django-admin startproject' using Django 3.2.10. + +For more information on this file, see +https://docs.djangoproject.com/en/3.2/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/3.2/ref/settings/ +""" + +import os + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-&q_i5pwc8t*y(5knqu&hp44@58gpr(2l$1z4$l0l-#5rg_681-' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = ['*'] + + +AUTHENTICATION_BACKENDS = ( + 'user.views.OwnBackend', +) + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'user.apps.UserConfig', + 'passage.apps.PassageConfig', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'Blog.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [os.path.join(BASE_DIR, 'templates')], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + 'django.template.context_processors.media', # 处理用户上传文件 + ], + }, + }, +] + +WSGI_APPLICATION = 'Blog.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/3.2/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + + # 'ENGINE': 'django.db.backends.mysql', + # 'NAME': 'blog', + # 'USER': 'root', + # 'PASSWORD': '123456', + # 'HOST': '127.0.0.1', + # 'PORT': '3306' + } +} + + +# Password validation +# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/3.2/topics/i18n/ + +LANGUAGE_CODE = 'zh-hans' + +TIME_ZONE = 'Asia/Shanghai' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + +# 邮箱验证相关参数 +EMAIL_HOST = 'smtp.163.com' +EMAIL_HOST_USER = '1227905473@qq.com' +EMAIL_HOST_PASSWORD = 'alex155370324' +EMAIL_PORT = 465 +EMAIL_USE_SSL = True +EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # 终端发送 + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/3.2/howto/static-files/ + +STATIC_URL = '/static/' +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, 'static'), + # '/var/www/Blog/static/', +] + +MEDIA_URL = '/media/' +MEDIA_ROOT = os.path.join(BASE_DIR, 'media') + +# Default primary key field type +# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/Blog/Blog/urls.py b/Blog/Blog/urls.py new file mode 100644 index 0000000..5a56602 --- /dev/null +++ b/Blog/Blog/urls.py @@ -0,0 +1,34 @@ +#!/usr/bin/env Python +# coding=utf-8 + +"""Blog URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/3.2/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path, include +from django.conf import settings +from django.conf.urls.static import static + +urlpatterns = [ + path('admin/', admin.site.urls), + path('user/', include("user.urls")), + path('', include('passage.urls')) +] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + +urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + +admin.site.site_header = "CaoJay鐨勭鐞嗗悗鍙" +admin.site.index_title = "绠$悊鍛樺悗鍙" +admin.site.site_title = "鍗氬绠$悊鍛樼櫥闄嗕簡" diff --git a/Blog/Blog/wsgi.py b/Blog/Blog/wsgi.py new file mode 100644 index 0000000..85325d3 --- /dev/null +++ b/Blog/Blog/wsgi.py @@ -0,0 +1,20 @@ +""" +WSGI config for Blog project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/ +""" + +import os +# import sys + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Blog.settings') + +# sys.path.append('') +# sys.path.append('python的site-packages路径') + +application = get_wsgi_application() diff --git a/Blog/__init__.py b/Blog/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Blog/db.sqlite3 b/Blog/db.sqlite3 new file mode 100644 index 0000000..1b82329 Binary files /dev/null and b/Blog/db.sqlite3 differ diff --git a/Blog/manage.py b/Blog/manage.py new file mode 100644 index 0000000..f933f23 --- /dev/null +++ b/Blog/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Blog.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/Blog/media/images/2021/12/crop_photo2.jpg b/Blog/media/images/2021/12/crop_photo2.jpg new file mode 100644 index 0000000..8523ecc Binary files /dev/null and b/Blog/media/images/2021/12/crop_photo2.jpg differ diff --git a/Blog/media/images/2021/12/headportrait.jpg b/Blog/media/images/2021/12/headportrait.jpg new file mode 100644 index 0000000..8523ecc Binary files /dev/null and b/Blog/media/images/2021/12/headportrait.jpg differ diff --git a/Blog/media/images/2022/01/mine.jpg b/Blog/media/images/2022/01/mine.jpg new file mode 100644 index 0000000..0f5d026 Binary files /dev/null and b/Blog/media/images/2022/01/mine.jpg differ diff --git a/Blog/media/images/default.jpg b/Blog/media/images/default.jpg new file mode 100644 index 0000000..80011ab Binary files /dev/null and b/Blog/media/images/default.jpg differ diff --git a/Blog/passage/__init__.py b/Blog/passage/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Blog/passage/__pycache__/__init__.cpython-36.pyc b/Blog/passage/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..c37123d Binary files /dev/null and b/Blog/passage/__pycache__/__init__.cpython-36.pyc differ diff --git a/Blog/passage/__pycache__/admin.cpython-36.pyc b/Blog/passage/__pycache__/admin.cpython-36.pyc new file mode 100644 index 0000000..016eb95 Binary files /dev/null and b/Blog/passage/__pycache__/admin.cpython-36.pyc differ diff --git a/Blog/passage/__pycache__/apps.cpython-36.pyc b/Blog/passage/__pycache__/apps.cpython-36.pyc new file mode 100644 index 0000000..3bda3a7 Binary files /dev/null and b/Blog/passage/__pycache__/apps.cpython-36.pyc differ diff --git a/Blog/passage/__pycache__/models.cpython-36.pyc b/Blog/passage/__pycache__/models.cpython-36.pyc new file mode 100644 index 0000000..3b230a1 Binary files /dev/null and b/Blog/passage/__pycache__/models.cpython-36.pyc differ diff --git a/Blog/passage/__pycache__/urls.cpython-36.pyc b/Blog/passage/__pycache__/urls.cpython-36.pyc new file mode 100644 index 0000000..81dc393 Binary files /dev/null and b/Blog/passage/__pycache__/urls.cpython-36.pyc differ diff --git a/Blog/passage/__pycache__/views.cpython-36.pyc b/Blog/passage/__pycache__/views.cpython-36.pyc new file mode 100644 index 0000000..429b0b7 Binary files /dev/null and b/Blog/passage/__pycache__/views.cpython-36.pyc differ diff --git a/Blog/passage/admin.py b/Blog/passage/admin.py new file mode 100644 index 0000000..6d63b32 --- /dev/null +++ b/Blog/passage/admin.py @@ -0,0 +1,33 @@ +#!/usr/bin/env Python +# coding=utf-8 + +from django.contrib import admin +from .models import Category, Post, Tag, Sidebar + + +admin.site.register(Category) +admin.site.register(Tag) +admin.site.register(Sidebar) + + +class PostAdmin(admin.ModelAdmin): + list_display = ('id', 'title', 'category', 'tags', 'owner', 'is_hot', 'pv', 'pub_date', ) + list_filter = ('owner', ) + search_fields = ('title', 'desc', ) + list_editable = ('is_hot', ) + list_display_links = ('id', 'title', ) + + class Media: + css = { + 'all': ('CKEditor_5/ckeditor.css', ) + } + + js = ( + 'CKEditor_5/jquery.js', + 'CKEditor_5/translations/zh.js', + 'CKEditor_5/ckeditor.js', + 'CKEditor_5/config.js' + ) + + +admin.site.register(Post, PostAdmin) diff --git a/Blog/passage/apps.py b/Blog/passage/apps.py new file mode 100644 index 0000000..7a411db --- /dev/null +++ b/Blog/passage/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class PassageConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'passage' diff --git a/Blog/passage/forms.py b/Blog/passage/forms.py new file mode 100644 index 0000000..64bb96b --- /dev/null +++ b/Blog/passage/forms.py @@ -0,0 +1,6 @@ +#!/usr/bin/env Python +# coding=utf-8 + + + + diff --git a/Blog/passage/migrations/0001_initial.py b/Blog/passage/migrations/0001_initial.py new file mode 100644 index 0000000..986fe89 --- /dev/null +++ b/Blog/passage/migrations/0001_initial.py @@ -0,0 +1,80 @@ +# Generated by Django 3.2.10 on 2022-01-01 10:42 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Category', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=32, verbose_name='鍒嗙被鍚嶇О')), + ('desc', models.TextField(blank=True, default='', max_length=200, verbose_name='鍒嗙被鎻忚堪')), + ('add_date', models.DateTimeField(auto_now_add=True, verbose_name='娣诲姞鏃堕棿')), + ('pub_date', models.DateTimeField(auto_now=True, verbose_name='鍙戝竷鏃堕棿')), + ], + options={ + 'verbose_name': '鍗氬鍒嗙被', + 'verbose_name_plural': '鍗氬鍒嗙被', + }, + ), + migrations.CreateModel( + name='Sidebar', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=50, verbose_name='妯″潡鍚嶇О')), + ('display_type', models.PositiveIntegerField(choices=[(1, '鎼滅储'), (2, '鏈鏂版枃绔'), (3, '鏈鐑枃绔'), (4, '鏈杩戣瘎璁'), (5, '褰掓。'), (6, 'HTML')], default=1, verbose_name='灞曠ず绫诲瀷')), + ('content', models.CharField(blank=True, default='', help_text='闄TML绫诲瀷澶,鍧囧彲涓虹┖...', max_length=500, verbose_name='鍐呭')), + ('sort', models.PositiveIntegerField(default=1, help_text='搴忓垪瓒婂ぇ瓒婇潬鍓', verbose_name='鎺掑簭')), + ('status', models.PositiveIntegerField(choices=[(1, '闅愯棌'), (2, '鏄剧ず')], default=2, verbose_name='鐘舵')), + ('add_date', models.DateTimeField(auto_now_add=True, verbose_name='鍒涘缓鏃堕棿')), + ], + options={ + 'verbose_name': '渚ц竟鏍', + 'verbose_name_plural': '渚ц竟鏍', + }, + ), + migrations.CreateModel( + name='Tag', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=10, verbose_name='鏂囩珷鏍囩')), + ('add_date', models.DateTimeField(auto_now_add=True, verbose_name='娣诲姞鏃堕棿')), + ('pub_date', models.DateTimeField(auto_now=True, verbose_name='鍙戝竷鏃堕棿')), + ], + options={ + 'verbose_name': '鏂囩珷鏍囩', + 'verbose_name_plural': '鏂囩珷鏍囩', + }, + ), + migrations.CreateModel( + name='Post', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=50, verbose_name='鏂囩珷鏍囬')), + ('desc', models.TextField(blank=True, default='', max_length=200, verbose_name='鏂囩珷鎻忚堪')), + ('content', models.TextField(verbose_name='鏂囩珷璇︽儏')), + ('add_date', models.DateTimeField(auto_now_add=True, verbose_name='娣诲姞鏃堕棿')), + ('pub_date', models.DateTimeField(auto_now=True, verbose_name='鍙戝竷鏃堕棿')), + ('is_hot', models.BooleanField(default=False, verbose_name='鏄儹闂ㄨ瘽棰?')), + ('pv', models.IntegerField(default=0, verbose_name='娴忚娆℃暟')), + ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='passage.category', verbose_name='鏂囩珷鍒嗙被')), + ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='鏂囩珷浣滆')), + ('tags', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='passage.tag', verbose_name='鏂囩珷鏍囩')), + ], + options={ + 'verbose_name': '鏂囩珷', + 'verbose_name_plural': '鏂囩珷', + }, + ), + ] diff --git a/Blog/passage/migrations/__init__.py b/Blog/passage/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Blog/passage/migrations/__pycache__/0001_initial.cpython-36.pyc b/Blog/passage/migrations/__pycache__/0001_initial.cpython-36.pyc new file mode 100644 index 0000000..62becae Binary files /dev/null and b/Blog/passage/migrations/__pycache__/0001_initial.cpython-36.pyc differ diff --git a/Blog/passage/migrations/__pycache__/__init__.cpython-36.pyc b/Blog/passage/migrations/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..a6aa37f Binary files /dev/null and b/Blog/passage/migrations/__pycache__/__init__.cpython-36.pyc differ diff --git a/Blog/passage/models.py b/Blog/passage/models.py new file mode 100644 index 0000000..d7d6e2d --- /dev/null +++ b/Blog/passage/models.py @@ -0,0 +1,113 @@ +#!/usr/bin/env Python +# coding=utf-8 + +from django.db import models +from django.contrib.auth.models import User +from django.utils.functional import cached_property +from django.template.loader import render_to_string + + +# 鏂囩珷鐩綍 +class Category(models.Model): + name = models.CharField(max_length=32, verbose_name='鍒嗙被鍚嶇О') + desc = models.TextField(max_length=200, verbose_name='鍒嗙被鎻忚堪', blank=True, default='') + add_date = models.DateTimeField(auto_now_add=True, verbose_name='娣诲姞鏃堕棿') + pub_date = models.DateTimeField(auto_now=True, verbose_name='鍙戝竷鏃堕棿') + + class Meta: + verbose_name = '鍗氬鍒嗙被' + verbose_name_plural = verbose_name + + def __str__(self): + return self.name + + +# 鏍囩妯″瀷 +class Tag(models.Model): + name = models.CharField(max_length=10, verbose_name='鏂囩珷鏍囩') + add_date = models.DateTimeField(auto_now_add=True, verbose_name='娣诲姞鏃堕棿') + pub_date = models.DateTimeField(auto_now=True, verbose_name='鍙戝竷鏃堕棿') + + class Meta: + verbose_name = '鏂囩珷鏍囩' + verbose_name_plural = verbose_name + + def __str__(self): + return self.name + + +# 鏂囩珷妯″瀷 +class Post(models.Model): + owner = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name='鏂囩珷浣滆', null=False) + title = models.CharField(max_length=50, verbose_name='鏂囩珷鏍囬') + desc = models.TextField(max_length=200, blank=True, default='', verbose_name='鏂囩珷鎻忚堪') + content = models.TextField(verbose_name='鏂囩珷璇︽儏') + tags = models.ForeignKey(Tag, on_delete=models.CASCADE, verbose_name='鏂囩珷鏍囩', null=True) + add_date = models.DateTimeField(auto_now_add=True, verbose_name='娣诲姞鏃堕棿') + pub_date = models.DateTimeField(auto_now=True, verbose_name='鍙戝竷鏃堕棿') + is_hot = models.BooleanField(default=False, verbose_name='鏄儹闂ㄨ瘽棰?') + pv = models.IntegerField(default=0, verbose_name='娴忚娆℃暟') + category = models.ForeignKey(Category, on_delete=models.CASCADE, verbose_name='鏂囩珷鍒嗙被') + + class Meta: + verbose_name = '鏂囩珷' + verbose_name_plural = verbose_name + + def __str__(self): + return self.title + + +# 渚ц竟鏍忔ā鍨 +class Sidebar(models.Model): + STATUS = ( + (1, '闅愯棌'), + (2, '鏄剧ず') + ) + + DISPLAY_TYPE = ( + (1, '鎼滅储'), + (2, '鏈鏂版枃绔'), + (3, '鏈鐑枃绔'), + (4, '鏈杩戣瘎璁'), + (5, '褰掓。'), + (6, 'HTML') + ) + + title = models.CharField(max_length=50, verbose_name='妯″潡鍚嶇О') + display_type = models.PositiveIntegerField(default=1, choices=DISPLAY_TYPE, verbose_name='灞曠ず绫诲瀷') + content = models.CharField(max_length=500, blank=True, default='', verbose_name='鍐呭', + help_text='闄TML绫诲瀷澶,鍧囧彲涓虹┖...') + sort = models.PositiveIntegerField(default=1, verbose_name='鎺掑簭', help_text='搴忓垪瓒婂ぇ瓒婇潬鍓') + status = models.PositiveIntegerField(default=2, choices=STATUS, verbose_name='鐘舵') + add_date = models.DateTimeField(auto_now_add=True, verbose_name='鍒涘缓鏃堕棿') + + class Meta: + verbose_name = '渚ц竟鏍' + verbose_name_plural = verbose_name + + def __str__(self): + return self.title + + @classmethod + def get_sidebar(cla): + return cla.objects.filter(status=2) + + @property + def get_content(self): + if self.display_type == 1: + context = {} + return render_to_string('passage/sidebar/search.html', context=context) + elif self.display_type == 2: + context = {} + return render_to_string('passage/sidebar/new_post.html', context=context) + elif self.display_type == 3: + context = {} + return render_to_string('passage/sidebar/hot_post.html', context=context) + elif self.display_type == 4: + context = {} + return render_to_string('passage/sidebar/comment.html', context=context) + elif self.display_type == 5: + context = {} + return render_to_string('passage/sidebar/archives.html', context=context) + elif self.display_type == 6: + return self.content diff --git a/Blog/passage/static/CKEditor_5/ckeditor.css b/Blog/passage/static/CKEditor_5/ckeditor.css new file mode 100644 index 0000000..3cfaf06 --- /dev/null +++ b/Blog/passage/static/CKEditor_5/ckeditor.css @@ -0,0 +1,3 @@ +.ck-content{ + height: 100em; +} \ No newline at end of file diff --git a/Blog/passage/static/CKEditor_5/ckeditor.js b/Blog/passage/static/CKEditor_5/ckeditor.js new file mode 100644 index 0000000..c09930b --- /dev/null +++ b/Blog/passage/static/CKEditor_5/ckeditor.js @@ -0,0 +1,6 @@ +/*! + * @license Copyright (c) 2003-2022, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md. + */ +(function(t){const e=t["zh-cn"]=t["zh-cn"]||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"绗 %0 姝ワ紝鍏 %1 姝",Aquamarine:"娴疯摑鑹",Big:"澶",Black:"榛戣壊","Block quote":"鍧楀紩鐢",Blue:"钃濊壊","Blue marker":"钃濊壊鏍囪",Bold:"鍔犵矖","Break text":"","Bulleted List":"椤圭洰绗﹀彿鍒楄〃","Bulleted list styles toolbar":"椤圭洰绗﹀彿鍒楄〃鏍峰紡宸ュ叿鏉",Cancel:"鍙栨秷","Cannot upload file:":"鏃犳硶涓婁紶鐨勬枃浠讹細","Centered image":"鍥剧墖灞呬腑","Change image text alternative":"鏇存敼鍥剧墖鏇挎崲鏂囨湰","Characters: %0":"瀛楃鏁帮細%0","Choose heading":"鏍囬绫诲瀷",Circle:"绌哄績鍦嗙偣",Code:"浠g爜",Column:"鍒","Could not insert image at the current position.":"鏃犳硶鍦ㄥ綋鍓嶄綅缃彃鍏ュ浘鐗","Could not obtain resized image URL.":"鏃犳硶鑾峰彇閲嶈澶у皬鐨勫浘鐗嘦RL",Decimal:"闃挎媺浼暟瀛","Decimal with leading zero":"鍓嶅闆堕樋鎷変集鏁板瓧","Decrease indent":"鍑忓皯缂╄繘",Default:"榛樿","Delete column":"鍒犻櫎鏈垪","Delete row":"鍒犻櫎鏈","Dim grey":"鏆楃伆鑹",Disc:"瀹炲績鍦嗙偣","Document colors":"鏂囨。涓殑棰滆壊",Downloadable:"鍙笅杞","Dropdown toolbar":"涓嬫媺宸ュ叿鏍","Edit block":"缂栬緫妗","Edit link":"淇敼閾炬帴","Edit source":"缂栬緫婧愪唬鐮","Editor toolbar":"缂栬緫鍣ㄥ伐鍏锋爮","Empty snippet content":"绌虹墖娈靛唴瀹","Enter image caption":"杈撳叆鍥剧墖鏍囬",Find:"鏌ユ壘","Find and replace":"鏌ユ壘鍜屾浛鎹","Find in text鈥":"鏌ユ壘鐨勬枃鏈","Font Background Color":"瀛椾綋鑳屾櫙鑹","Font Color":"瀛椾綋棰滆壊","Font Family":"瀛椾綋","Font Size":"瀛椾綋澶у皬","Full size image":"鍥剧墖閫氭爮鏄剧ず",Green:"缁胯壊","Green marker":"缁胯壊鏍囪","Green pen":"缁胯壊绗",Grey:"鐏拌壊","Header column":"鏍囬鍒","Header row":"鏍囬琛",Heading:"鏍囬","Heading 1":"鏍囬 1","Heading 2":"鏍囬 2","Heading 3":"鏍囬 3","Heading 4":"鏍囬 4","Heading 5":"鏍囬 5","Heading 6":"鏍囬 6",Highlight:"楂樹寒","Horizontal line":"姘村钩绾","HTML snippet":"HTML 浠g爜鐗囨",Huge:"鏋佸ぇ","Image toolbar":"鍥剧墖宸ュ叿鏍","image widget":"鍥惧儚灏忛儴浠","In line":"","Increase indent":"澧炲姞缂╄繘","Insert code block":"鎻掑叆浠g爜鍧","Insert column left":"宸︿晶鎻掑叆鍒","Insert column right":"鍙充晶鎻掑叆鍒","Insert HTML":"鎻掑叆 HTML","Insert image":"鎻掑叆鍥惧儚","Insert image or file":"鎻掑叆鍥剧墖鎴栨枃浠","Insert media":"鎻掑叆濯掍綋","Insert paragraph after block":"鍦ㄥ悗闈㈡彃鍏ユ钀","Insert paragraph before block":"鍦ㄥ墠闈㈡彃鍏ユ钀","Insert row above":"鍦ㄤ笂闈㈡彃鍏ヤ竴琛","Insert row below":"鍦ㄤ笅闈㈡彃鍏ヤ竴琛","Insert table":"鎻掑叆琛ㄦ牸","Inserting image failed":"鎻掑叆鍥剧墖澶辫触",Italic:"鍊炬枩","Left aligned image":"鍥剧墖宸︿晶瀵归綈","Light blue":"娴呰摑鑹","Light green":"娴呯豢鑹","Light grey":"娴呯伆鑹",Link:"瓒呴摼鎺","Link image":"閾炬帴鍥剧墖","Link URL":"閾炬帴缃戝潃","Lower-latin":"灏忓啓鎷変竵瀛楁瘝","Lower鈥搑oman":"灏忓啓缃楅┈鏁板瓧","Match case":"鍖哄垎澶у皬鍐","Media URL":"濯掍綋URL","media widget":"濯掍綋灏忛儴浠","Merge cell down":"鍚戜笅鍚堝苟鍗曞厓鏍","Merge cell left":"鍚戝乏鍚堝苟鍗曞厓鏍","Merge cell right":"鍚戝彸鍚堝苟鍗曞厓鏍","Merge cell up":"鍚戜笂鍚堝苟鍗曞厓鏍","Merge cells":"鍚堝苟鍗曞厓鏍",Next:"涓嬩竴姝","Next result":"涓嬩竴涓尮閰嶉」","No preview available":"棰勮涓嶅彲鐢","Numbered List":"椤圭洰缂栧彿鍒楄〃","Numbered list styles toolbar":"椤圭洰缂栧彿鍒楄〃鏍峰紡宸ュ叿鏉","Open in a new tab":"鍦ㄦ柊鏍囩椤典腑鎵撳紑","Open link in new tab":"鍦ㄦ柊鏍囩椤典腑鎵撳紑閾炬帴",Orange:"姗欒壊",Paragraph:"娈佃惤","Paste raw HTML here...":"鍦ㄨ繖閲岀矘璐 HTML 婧愪唬鐮","Paste the media URL in the input.":"鍦ㄨ緭鍏ヤ腑绮樿创濯掍綋URL","Pink marker":"绮夎壊鏍囪","Plain text":"绾枃鏈",Previous:"涓婁竴姝","Previous result":"涓婁竴涓尮閰嶉」",Purple:"绱壊",Red:"绾㈣壊","Red pen":"绾㈣壊绗",Redo:"閲嶅仛","Remove color":"绉婚櫎棰滆壊","Remove highlight":"娓呴櫎楂樹寒",Replace:"鏇挎崲","Replace all":"鍏ㄩ儴鏇挎崲","Replace with鈥":"鏇挎崲鐨勬枃鏈","Rich Text Editor":"瀵屾枃鏈紪杈戝櫒","Rich Text Editor, %0":"瀵屾枃鏈紪杈戝櫒锛 %0","Right aligned image":"鍥剧墖鍙充晶瀵归綈",Row:"琛",Save:"淇濆瓨","Save changes":"淇濆瓨鏇存敼","Select all":"鍏ㄩ","Select column":"閫夋嫨鍒","Select row":"閫夋嫨琛","Selecting resized image failed":"閫夋嫨閲嶈澶у皬鐨勫浘鐗囧け璐","Show more items":"鏄剧ず鏇村","Show options":"鏄剧ず閰嶇疆","Side image":"鍥剧墖渚ц竟鏄剧ず",Small:"灏",Source:"婧愪唬鐮","Split cell horizontally":"妯悜鎷嗗垎鍗曞厓鏍","Split cell vertically":"绾靛悜鎷嗗垎鍗曞厓鏍",Square:"瀹炲績鏂瑰潡","Table toolbar":"琛ㄦ牸宸ュ叿鏍","Text alternative":"鏇挎崲鏂囨湰","Text highlight toolbar":"鏂囨湰楂樹寒宸ュ叿鏍","Text to find must not be empty.":"鏌ユ壘鐨勬枃鏈笉鍙负绌","The URL must not be empty.":"URL涓嶅彲浠ヤ负绌恒","This link has no URL":"姝ら摼鎺ユ病鏈夎缃綉鍧","This media URL is not supported.":"涓嶆敮鎸佹濯掍綋URL銆",Tiny:"鏋佸皬","Tip: Find some text first in order to replace it.":"鎻愮ず锛氬厛鏌ユ壘鏂囨湰鍐嶆浛鎹","Tip: Paste the URL into the content to embed faster.":"鎻愮ず锛氬皢URL绮樿创鍒板唴瀹逛腑鍙洿蹇湴宓屽叆","To-do List":"寰呭姙鍒楄〃","Toggle caption off":"","Toggle caption on":"","Toggle the circle list style":"鍒囨崲绌哄績鍘熺偣鍒楄〃鏍峰紡","Toggle the decimal list style":"鍒囨崲闃挎媺浼暟瀛楀垪琛ㄦ牱寮","Toggle the decimal with leading zero list style":"鍒囨崲鍓嶅闆堕樋鎷変集鏁板瓧鍒楄〃鏍峰紡","Toggle the disc list style":"鍒囨崲瀹炲績鍘熺偣鍒楄〃鏍峰紡","Toggle the lower鈥搇atin list style":"鍒囨崲灏忓啓鎷変竵瀛楁瘝鍒楄〃鏍峰紡","Toggle the lower鈥搑oman list style":"鍒囨崲灏忓啓缃楅┈鏁板瓧鍒楄〃鏍峰紡","Toggle the square list style":"鍒囨崲瀹炲績鏂瑰潡鍒楄〃鏍峰紡","Toggle the upper鈥搇atin list style":"鍒囨崲澶у啓鎷変竵瀛楁瘝鍒楄〃鏍峰紡","Toggle the upper鈥搑oman list style":"鍒囨崲澶у啓缃楅┈鏁板瓧鍒楄〃鏍峰紡",Turquoise:"闈掕壊","Type or paste your content here.":"鍦ㄨ繖閲岃緭鍏ユ垨绮樿创鍐呭","Type your title":"杈撳叆鏍囬",Underline:"涓嬪垝绾",Undo:"鎾ら攢",Unlink:"鍙栨秷瓒呴摼鎺","Upload failed":"涓婁紶澶辫触","Upload in progress":"姝e湪涓婁紶","Upper-latin":"澶у啓鎷変竵瀛楁瘝","Upper-roman":"澶у啓缃楅┈鏁板瓧",White:"鐧借壊","Whole words only":"鍗曡瘝","Widget toolbar":"灏忛儴浠跺伐鍏锋爮","Words: %0":"鍗曡瘝鏁帮細%0","Wrap text":"",Yellow:"榛勮壊","Yellow marker":"榛勮壊鏍囪"});e.getPluralForm=function(t){return 0}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));(function t(e,n){if(typeof exports==="object"&&typeof module==="object")module.exports=n();else if(typeof define==="function"&&define.amd)define([],n);else if(typeof exports==="object")exports["ClassicEditor"]=n();else e["ClassicEditor"]=n()})(window,(function(){return function(t){var e={};function n(i){if(e[i]){return e[i].exports}var o=e[i]={i:i,l:false,exports:{}};t[i].call(o.exports,o,o.exports,n);o.l=true;return o.exports}n.m=t;n.c=e;n.d=function(t,e,i){if(!n.o(t,e)){Object.defineProperty(t,e,{enumerable:true,get:i})}};n.r=function(t){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})};n.t=function(t,e){if(e&1)t=n(t);if(e&8)return t;if(e&4&&typeof t==="object"&&t&&t.__esModule)return t;var i=Object.create(null);n.r(i);Object.defineProperty(i,"default",{enumerable:true,value:t});if(e&2&&typeof t!="string")for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i};n.n=function(t){var e=t&&t.__esModule?function e(){return t["default"]}:function e(){return t};n.d(e,"a",e);return e};n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};n.p="";return n(n.s=78)}([function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));n.d(e,"b",(function(){return r}));const i="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html";class o extends Error{constructor(t,e,n){super(c(t,n));this.name="CKEditorError";this.context=e;this.data=n}is(t){return t==="CKEditorError"}static rethrowUnexpectedError(t,e){if(t.is&&t.is("CKEditorError")){throw t}const n=new o(t.message,e);n.stack=t.stack;throw n}}function r(t,e){console.warn(...l(t,e))}function s(t,e){console.error(...l(t,e))}function a(t){return`\nRead more: ${i}#error-${t}`}function c(t,e){const n=new WeakSet;const i=(t,e)=>{if(typeof e==="object"&&e!==null){if(n.has(e)){return`[object ${e.constructor.name}]`}n.add(e)}return e};const o=e?` ${JSON.stringify(e,i)}`:"";const r=a(t);return t+o+r}function l(t,e){const n=a(t);return e?[t,e,n]:[t,n]}},function(t,e,n){"use strict";var i=function t(){var e;return function t(){if(typeof e==="undefined"){e=Boolean(window&&document&&document.all&&!window.atob)}return e}}();var o=function t(){var e={};return function t(n){if(typeof e[n]==="undefined"){var i=document.querySelector(n);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement){try{i=i.contentDocument.head}catch(t){i=null}}e[n]=i}return e[n]}}();var r=[];function s(t){var e=-1;for(var n=0;nt.length)e=t.length;for(var n=0,i=new Array(e);nt.length)e=t.length;for(var n=0,i=new Array(e);n=t.length)return{done:true};return{done:false,value:t[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}i=t[Symbol.iterator]();return i.next.bind(i)}function r(t,e){return e={exports:{}},t(e,e.exports),e.exports}var s=r((function(t){function e(){return{baseUrl:null,breaks:false,gfm:true,headerIds:true,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:true,pedantic:false,renderer:null,sanitize:false,sanitizer:null,silent:false,smartLists:false,smartypants:false,tokenizer:null,walkTokens:null,xhtml:false}}function n(e){t.exports.defaults=e}t.exports={defaults:e(),getDefaults:e,changeDefaults:n}}));var a=s.defaults;var c=s.getDefaults;var l=s.changeDefaults;var d=/[&<>"']/;var u=/[&<>"']/g;var h=/[<>"']|&(?!#?\w+;)/;var f=/[<>"']|&(?!#?\w+;)/g;var g={"&":"&","<":"<",">":">",'"':""","'":"'"};var m=function t(e){return g[e]};function p(t,e){if(e){if(d.test(t)){return t.replace(u,m)}}else{if(h.test(t)){return t.replace(f,m)}}return t}var k=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function b(t){return t.replace(k,(function(t,e){e=e.toLowerCase();if(e==="colon")return":";if(e.charAt(0)==="#"){return e.charAt(1)==="x"?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1))}return""}))}var w=/(^|[^\[])\^/g;function A(t,e){t=t.source||t;e=e||"";var n={replace:function e(i,o){o=o.source||o;o=o.replace(w,"$1");t=t.replace(i,o);return n},getRegex:function n(){return new RegExp(t,e)}};return n}var C=/[^\w:]/g;var v=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function _(t,e,n){if(t){var i;try{i=decodeURIComponent(b(n)).replace(C,"").toLowerCase()}catch(t){return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0){return null}}if(e&&!v.test(n)){n=S(e,n)}try{n=encodeURI(n).replace(/%25/g,"%")}catch(t){return null}return n}var y={};var x=/^[^:]+:\/*[^/]*$/;var E=/^([^:]+:)[\s\S]*$/;var D=/^([^:]+:\/*[^/]*)[\s\S]*$/;function S(t,e){if(!y[" "+t]){if(x.test(t)){y[" "+t]=t+"/"}else{y[" "+t]=B(t,"/",true)}}t=y[" "+t];var n=t.indexOf(":")===-1;if(e.substring(0,2)==="//"){if(n){return e}return t.replace(E,"$1")+e}else if(e.charAt(0)==="/"){if(n){return e}return t.replace(D,"$1")+e}else{return t+e}}var T={exec:function t(){}};function I(t){var e=1,n,i;for(;e=0&&n[o]==="\\"){i=!i}if(i){return"|"}else{return" |"}})),i=n.split(/ \|/);var o=0;if(i.length>e){i.splice(e)}else{while(i.length=i.length){return t.slice(i.length)}return t})).join("\n")}var H=function(){function t(t){this.options=t||L}var e=t.prototype;e.space=function t(e){var n=this.rules.block.newline.exec(e);if(n){if(n[0].length>1){return{type:"space",raw:n[0]}}return{raw:"\n"}}};e.code=function t(e,n){var i=this.rules.block.code.exec(e);if(i){var o=n[n.length-1];if(o&&o.type==="paragraph"){return{raw:i[0],text:i[0].trimRight()}}var r=i[0].replace(/^ {4}/gm,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:!this.options.pedantic?R(r,"\n"):r}}};e.fences=function t(e){var n=this.rules.block.fences.exec(e);if(n){var i=n[0];var o=U(i,n[3]||"");return{type:"code",raw:i,lang:n[2]?n[2].trim():n[2],text:o}}};e.heading=function t(e){var n=this.rules.block.heading.exec(e);if(n){return{type:"heading",raw:n[0],depth:n[1].length,text:n[2]}}};e.nptable=function t(e){var n=this.rules.block.nptable.exec(e);if(n){var i={type:"table",header:O(n[1].replace(/^ *| *\| *$/g,"")),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:n[3]?n[3].replace(/\n$/,"").split("\n"):[],raw:n[0]};if(i.header.length===i.align.length){var o=i.align.length;var r;for(r=0;r ?/gm,"");return{type:"blockquote",raw:n[0],text:i}}};e.list=function t(e){var n=this.rules.block.list.exec(e);if(n){var i=n[0];var o=n[2];var r=o.length>1;var s=o[o.length-1]===")";var t={type:"list",raw:i,ordered:r,start:r?+o.slice(0,-1):"",loose:false,items:[]};var a=n[0].match(this.rules.block.item);var c=false,l,d,u,h,f,g,m;var p=a.length;for(var k=0;k1||this.options.smartLists&&u!==o){h=a.slice(k+1).join("\n");t.raw=t.raw.substring(0,t.raw.length-h.length);k=p-1}}f=c||/\n\n(?!\s*$)/.test(l);if(k!==p-1){c=l.charAt(l.length-1)==="\n";if(!f)f=c}if(f){t.loose=true}g=/^\[[ xX]\] /.test(l);m=undefined;if(g){m=l[1]!==" ";l=l.replace(/^\[[ xX]\] +/,"")}t.items.push({type:"list_item",raw:i,task:g,checked:m,loose:f,text:l})}return t}};e.html=function t(e){var n=this.rules.block.html.exec(e);if(n){return{type:this.options.sanitize?"paragraph":"html",raw:n[0],pre:!this.options.sanitizer&&(n[1]==="pre"||n[1]==="script"||n[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):j(n[0]):n[0]}}};e.def=function t(e){var n=this.rules.block.def.exec(e);if(n){if(n[3])n[3]=n[3].substring(1,n[3].length-1);var i=n[1].toLowerCase().replace(/\s+/g," ");return{tag:i,raw:n[0],href:n[2],title:n[3]}}};e.table=function t(e){var n=this.rules.block.table.exec(e);if(n){var i={type:"table",header:O(n[1].replace(/^ *| *\| *$/g,"")),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:n[3]?n[3].replace(/\n$/,"").split("\n"):[]};if(i.header.length===i.align.length){i.raw=n[0];var o=i.align.length;var r;for(r=0;r/i.test(o[0])){n=false}if(!i&&/^<(pre|code|kbd|script)(\s|>)/i.test(o[0])){i=true}else if(i&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(o[0])){i=false}return{type:this.options.sanitize?"text":"html",raw:o[0],inLink:n,inRawBlock:i,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(o[0]):j(o[0]):o[0]}}};e.link=function t(e){var n=this.rules.inline.link.exec(e);if(n){var i=F(n[2],"()");if(i>-1){var o=n[0].indexOf("!")===0?5:4;var r=o+n[1].length+i;n[2]=n[2].substring(0,i);n[0]=n[0].substring(0,r).trim();n[3]=""}var s=n[2];var a="";if(this.options.pedantic){var t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);if(t){s=t[1];a=t[3]}else{a=""}}else{a=n[3]?n[3].slice(1,-1):""}s=s.trim().replace(/^<([\s\S]*)>$/,"$1");var c=V(n,{href:s?s.replace(this.rules.inline._escapes,"$1"):s,title:a?a.replace(this.rules.inline._escapes,"$1"):a},n[0]);return c}};e.reflink=function t(e,n){var i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){var o=(i[2]||i[1]).replace(/\s+/g," ");o=n[o.toLowerCase()];if(!o||!o.href){var r=i[0].charAt(0);return{type:"text",raw:r,text:r}}var s=V(i,o,i[0]);return s}};e.strong=function t(e,n,i){if(i===void 0){i=""}var o=this.rules.inline.strong.start.exec(e);if(o&&(!o[1]||o[1]&&(i===""||this.rules.inline.punctuation.exec(i)))){n=n.slice(-1*e.length);var r=o[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;r.lastIndex=0;var s;while((o=r.exec(n))!=null){s=this.rules.inline.strong.middle.exec(n.slice(0,o.index+3));if(s){return{type:"strong",raw:e.slice(0,s[0].length),text:e.slice(2,s[0].length-2)}}}}};e.em=function t(e,n,i){if(i===void 0){i=""}var o=this.rules.inline.em.start.exec(e);if(o&&(!o[1]||o[1]&&(i===""||this.rules.inline.punctuation.exec(i)))){n=n.slice(-1*e.length);var r=o[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;r.lastIndex=0;var s;while((o=r.exec(n))!=null){s=this.rules.inline.em.middle.exec(n.slice(0,o.index+2));if(s){return{type:"em",raw:e.slice(0,s[0].length),text:e.slice(1,s[0].length-1)}}}}};e.codespan=function t(e){var n=this.rules.inline.code.exec(e);if(n){var i=n[2].replace(/\n/g," ");var o=/[^ ]/.test(i);var r=i.startsWith(" ")&&i.endsWith(" ");if(o&&r){i=i.substring(1,i.length-1)}i=j(i,true);return{type:"codespan",raw:n[0],text:i}}};e.br=function t(e){var n=this.rules.inline.br.exec(e);if(n){return{type:"br",raw:n[0]}}};e.del=function t(e){var n=this.rules.inline.del.exec(e);if(n){return{type:"del",raw:n[0],text:n[1]}}};e.autolink=function t(e,n){var i=this.rules.inline.autolink.exec(e);if(i){var o,r;if(i[2]==="@"){o=j(this.options.mangle?n(i[1]):i[1]);r="mailto:"+o}else{o=j(i[1]);r=o}return{type:"link",raw:i[0],text:o,href:r,tokens:[{type:"text",raw:o,text:o}]}}};e.url=function t(e,n){var i;if(i=this.rules.inline.url.exec(e)){var o,r;if(i[2]==="@"){o=j(this.options.mangle?n(i[0]):i[0]);r="mailto:"+o}else{var s;do{s=i[0];i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(s!==i[0]);o=j(i[0]);if(i[1]==="www."){r="http://"+o}else{r=o}}return{type:"link",raw:i[0],text:o,href:r,tokens:[{type:"text",raw:o,text:o}]}}};e.inlineText=function t(e,n,i){var o=this.rules.inline.text.exec(e);if(o){var r;if(n){r=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(o[0]):j(o[0]):o[0]}else{r=j(this.options.smartypants?i(o[0]):o[0])}return{type:"text",raw:o[0],text:r}}};return t}();var q=P.noopTest,W=P.edit,G=P.merge;var K={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:"+"<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)"+"|comment[^\\n]*(\\n+|$)"+"|<\\?[\\s\\S]*?\\?>\\n*"+"|\\n*"+"|\\n*"+"|)[\\s\\S]*?(?:\\n{2,}|$)"+"|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)"+"|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)"+")",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:q,table:q,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};K._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;K._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;K.def=W(K.def).replace("label",K._label).replace("title",K._title).getRegex();K.bullet=/(?:[*+-]|\d{1,9}[.)])/;K.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/;K.item=W(K.item,"gm").replace(/bull/g,K.bullet).getRegex();K.list=W(K.list).replace(/bull/g,K.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+K.def.source+")").getRegex();K._tag="address|article|aside|base|basefont|blockquote|body|caption"+"|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption"+"|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe"+"|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option"+"|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr"+"|track|ul";K._comment=//;K.html=W(K.html,"i").replace("comment",K._comment).replace("tag",K._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();K.paragraph=W(K._paragraph).replace("hr",K.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",K._tag).getRegex();K.blockquote=W(K.blockquote).replace("paragraph",K.paragraph).getRegex();K.normal=G({},K);K.gfm=G({},K.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n"+" *([-:]+ *\\|[-| :]*)"+"(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n"+" *\\|?( *[-:]+[-| :]*)"+"(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});K.gfm.nptable=W(K.gfm.nptable).replace("hr",K.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",K._tag).getRegex();K.gfm.table=W(K.gfm.table).replace("hr",K.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",K._tag).getRegex();K.pedantic=G({},K.normal,{html:W("^ *(?:comment *(?:\\n|\\s*$)"+"|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)"+"|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",K._comment).replace(/tag/g,"(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub"+"|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)"+"\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:q,paragraph:W(K.normal._paragraph).replace("hr",K.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",K.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var $={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:q,tag:"^comment"+"|^"+"|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>"+"|^<\\?[\\s\\S]*?\\?>"+"|^"+"|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:q,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";$.punctuation=W($.punctuation).replace(/punctuation/g,$._punctuation).getRegex();$._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>";$._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*";$.em.start=W($.em.start).replace(/punctuation/g,$._punctuation).getRegex();$.em.middle=W($.em.middle).replace(/punctuation/g,$._punctuation).replace(/overlapSkip/g,$._overlapSkip).getRegex();$.em.endAst=W($.em.endAst,"g").replace(/punctuation/g,$._punctuation).getRegex();$.em.endUnd=W($.em.endUnd,"g").replace(/punctuation/g,$._punctuation).getRegex();$.strong.start=W($.strong.start).replace(/punctuation/g,$._punctuation).getRegex();$.strong.middle=W($.strong.middle).replace(/punctuation/g,$._punctuation).replace(/blockSkip/g,$._blockSkip).getRegex();$.strong.endAst=W($.strong.endAst,"g").replace(/punctuation/g,$._punctuation).getRegex();$.strong.endUnd=W($.strong.endUnd,"g").replace(/punctuation/g,$._punctuation).getRegex();$.blockSkip=W($._blockSkip,"g").getRegex();$.overlapSkip=W($._overlapSkip,"g").getRegex();$._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;$._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;$._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;$.autolink=W($.autolink).replace("scheme",$._scheme).replace("email",$._email).getRegex();$._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;$.tag=W($.tag).replace("comment",K._comment).replace("attribute",$._attribute).getRegex();$._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;$._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/;$._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;$.link=W($.link).replace("label",$._label).replace("href",$._href).replace("title",$._title).getRegex();$.reflink=W($.reflink).replace("label",$._label).getRegex();$.reflinkSearch=W($.reflinkSearch,"g").replace("reflink",$.reflink).replace("nolink",$.nolink).getRegex();$.normal=G({},$);$.pedantic=G({},$.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:W(/^!?\[(label)\]\((.*?)\)/).replace("label",$._label).getRegex(),reflink:W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",$._label).getRegex()});$.gfm=G({},$.normal,{escape:W($.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5){i="x"+i.toString(16)}e+="&#"+i+";"}return e}var et=function(){function t(t){this.tokens=[];this.tokens.links=Object.create(null);this.options=t||Q;this.options.tokenizer=this.options.tokenizer||new H;this.tokenizer=this.options.tokenizer;this.tokenizer.options=this.options;var e={block:Z.normal,inline:J.normal};if(this.options.pedantic){e.block=Z.pedantic;e.inline=J.pedantic}else if(this.options.gfm){e.block=Z.gfm;if(this.options.breaks){e.inline=J.breaks}else{e.inline=J.gfm}}this.tokenizer.rules=e}t.lex=function e(n,i){var o=new t(i);return o.lex(n)};var n=t.prototype;n.lex=function t(e){e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ");this.blockTokens(e,this.tokens,true);this.inline(this.tokens);return this.tokens};n.blockTokens=function t(e,n,i){if(n===void 0){n=[]}if(i===void 0){i=true}e=e.replace(/^ +$/gm,"");var o,r,s,a;while(e){if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);if(o.type){n.push(o)}continue}if(o=this.tokenizer.code(e,n)){e=e.substring(o.raw.length);if(o.type){n.push(o)}else{a=n[n.length-1];a.raw+="\n"+o.raw;a.text+="\n"+o.text}continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length);n.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length);n.push(o);continue}if(o=this.tokenizer.nptable(e)){e=e.substring(o.raw.length);n.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length);n.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length);o.tokens=this.blockTokens(o.text,[],i);n.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length);s=o.items.length;for(r=0;r0){while((c=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null){if(l.includes(c[0].slice(c[0].lastIndexOf("[")+1,-1))){a=a.slice(0,c.index)+"["+"a".repeat(c[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex)}}}}while((c=this.tokenizer.rules.inline.blockSkip.exec(a))!=null){a=a.slice(0,c.index)+"["+"a".repeat(c[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex)}while(e){if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length);n.push(s);continue}if(s=this.tokenizer.tag(e,i,o)){e=e.substring(s.raw.length);i=s.inLink;o=s.inRawBlock;n.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length);if(s.type==="link"){s.tokens=this.inlineTokens(s.text,[],true,o)}n.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length);if(s.type==="link"){s.tokens=this.inlineTokens(s.text,[],true,o)}n.push(s);continue}if(s=this.tokenizer.strong(e,a,r)){e=e.substring(s.raw.length);s.tokens=this.inlineTokens(s.text,[],i,o);n.push(s);continue}if(s=this.tokenizer.em(e,a,r)){e=e.substring(s.raw.length);s.tokens=this.inlineTokens(s.text,[],i,o);n.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length);n.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length);n.push(s);continue}if(s=this.tokenizer.del(e)){e=e.substring(s.raw.length);s.tokens=this.inlineTokens(s.text,[],i,o);n.push(s);continue}if(s=this.tokenizer.autolink(e,tt)){e=e.substring(s.raw.length);n.push(s);continue}if(!i&&(s=this.tokenizer.url(e,tt))){e=e.substring(s.raw.length);n.push(s);continue}if(s=this.tokenizer.inlineText(e,o,X)){e=e.substring(s.raw.length);r=s.raw.slice(-1);n.push(s);continue}if(e){var d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else{throw new Error(d)}}}return n};e(t,null,[{key:"rules",get:function t(){return{block:Z,inline:J}}}]);return t}();var nt=s.defaults;var it=P.cleanUrl,ot=P.escape;var rt=function(){function t(t){this.options=t||nt}var e=t.prototype;e.code=function t(e,n,i){var o=(n||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(e,o);if(r!=null&&r!==e){i=true;e=r}}if(!o){return"
"+(i?e:ot(e,true))+"
\n"}return'
'+(i?e:ot(e,true))+"
\n"};e.blockquote=function t(e){return"
\n"+e+"
\n"};e.html=function t(e){return e};e.heading=function t(e,n,i,o){if(this.options.headerIds){return"'+e+"\n"}return""+e+"\n"};e.hr=function t(){return this.options.xhtml?"
\n":"
\n"};e.list=function t(e,n,i){var o=n?"ol":"ul",r=n&&i!==1?' start="'+i+'"':"";return"<"+o+r+">\n"+e+"\n"};e.listitem=function t(e){return"
  • "+e+"
  • \n"};e.checkbox=function t(e){return" "};e.paragraph=function t(e){return"

    "+e+"

    \n"};e.table=function t(e,n){if(n)n=""+n+"";return"\n"+"\n"+e+"\n"+n+"
    \n"};e.tablerow=function t(e){return"\n"+e+"\n"};e.tablecell=function t(e,n){var i=n.header?"th":"td";var o=n.align?"<"+i+' align="'+n.align+'">':"<"+i+">";return o+e+"\n"};e.strong=function t(e){return""+e+""};e.em=function t(e){return""+e+""};e.codespan=function t(e){return""+e+""};e.br=function t(){return this.options.xhtml?"
    ":"
    "};e.del=function t(e){return""+e+""};e.link=function t(e,n,i){e=it(this.options.sanitize,this.options.baseUrl,e);if(e===null){return i}var o='";return o};e.image=function t(e,n,i){e=it(this.options.sanitize,this.options.baseUrl,e);if(e===null){return i}var o=''+i+'":">";return o};e.text=function t(e){return e};return t}();var st=function(){function t(){}var e=t.prototype;e.strong=function t(e){return e};e.em=function t(e){return e};e.codespan=function t(e){return e};e.del=function t(e){return e};e.html=function t(e){return e};e.text=function t(e){return e};e.link=function t(e,n,i){return""+i};e.image=function t(e,n,i){return""+i};e.br=function t(){return""};return t}();var at=function(){function t(){this.seen={}}var e=t.prototype;e.slug=function t(e){var t=e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var n=t;do{this.seen[n]++;t=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(t))}this.seen[t]=0;return t};return t}();var ct=s.defaults;var lt=P.unescape;var dt=function(){function t(t){this.options=t||ct;this.options.renderer=this.options.renderer||new rt;this.renderer=this.options.renderer;this.renderer.options=this.options;this.textRenderer=new st;this.slugger=new at}t.parse=function e(n,i){var o=new t(i);return o.parse(n)};var e=t.prototype;e.parse=function t(e,n){if(n===void 0){n=true}var i="",o,r,s,a,c,l,d,u,h,f,g,m,p,k,b,w,A,C;var v=e.length;for(o=0;o0&&b.tokens[0].type==="text"){b.tokens[0].text=C+" "+b.tokens[0].text;if(b.tokens[0].tokens&&b.tokens[0].tokens.length>0&&b.tokens[0].tokens[0].type==="text"){b.tokens[0].tokens[0].text=C+" "+b.tokens[0].tokens[0].text}}else{b.tokens.unshift({type:"text",text:C})}}else{k+=C}}k+=this.parse(b.tokens,p);h+=this.renderer.listitem(k,A,w)}i+=this.renderer.list(h,g,m);continue}case"html":{i+=this.renderer.html(f.text);continue}case"paragraph":{i+=this.renderer.paragraph(this.parseInline(f.tokens));continue}case"text":{h=f.tokens?this.parseInline(f.tokens):f.text;while(o+1An error occurred:

    "+ft(t.message+"",true)+"
    "}throw t}}kt.options=kt.setOptions=function(t){ut(kt.defaults,t);mt(kt.defaults);return kt};kt.getDefaults=gt;kt.defaults=pt;kt.use=function(t){var e=ut({},t);if(t.renderer){(function(){var n=kt.defaults.renderer||new rt;var i=function e(i){var o=n[i];n[i]=function(){for(var e=arguments.length,r=new Array(e),s=0;s
    needs tabindex="-1" for proper Esc handling after being clicked\n\t * but the side effect is that this creates a nasty focus outline in some browsers.\n\t */\n\t&:focus {\n\t\toutline: none;\n\t}\n\n\t& fieldset {\n\t\tflex-direction: row;\n\t\tflex-wrap: nowrap;\n\t\talign-items: center;\n\t\talign-content: stretch;\n\n\t\tpadding: var(--ck-spacing-large);\n\t\tborder: 0;\n\t\tmargin: 0;\n\n\t\t& > .ck-button {\n\t\t\tflex: 0 0 auto;\n\t\t}\n\n\t\t@mixin ck-dir ltr {\n\t\t\t& > * + * {\n\t\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t\t}\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\t& > * + * {\n\t\t\t\tmargin-right: var(--ck-spacing-standard);\n\t\t\t}\n\t\t}\n\n\t\t& .ck-labeled-field-view {\n\t\t\tflex: 1 1 auto;\n\n\t\t\t& .ck-input {\n\t\t\t\twidth: 100%;\n\t\t\t\tmin-width: 50px;\n\t\t\t}\n\t\t}\n\n\t\t/* The find fieldset */\n\t\t&.ck-find-and-replace-form__find {\n\t\t\t/* To display all controls in line when there\'s an error under the input */\n\t\t\talign-items: flex-start;\n\n\t\t\t& > .ck-button-find {\n\t\t\t\tfont-weight: bold;\n\n\t\t\t\t/* Beef the find button up a little. It\'s the main action button in the form */\n\t\t\t\t& .ck-button__label {\n\t\t\t\t\tpadding-left: var(--ck-spacing-large);\n\t\t\t\t\tpadding-right: var(--ck-spacing-large);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t& > .ck-button-prev > .ck-icon {\n\t\t\t\ttransform: rotate(90deg);\n\t\t\t}\n\n\t\t\t& > .ck-button-next > .ck-icon {\n\t\t\t\ttransform: rotate(-90deg);\n\t\t\t}\n\n\t\t\t& .ck-results-counter {\n\t\t\t\ttop: 50%;\n\t\t\t\ttransform: translateY(-50%);\n\n\t\t\t\t@mixin ck-dir ltr {\n\t\t\t\t\tright: var(--ck-spacing-standard);\n\t\t\t\t}\n\n\t\t\t\t@mixin ck-dir rtl {\n\t\t\t\t\tleft: var(--ck-spacing-standard);\n\t\t\t\t}\n\n\t\t\t\tcolor: var(--ck-color-base-border);\n\t\t\t}\n\t\t}\n\n\t\t/* The replace fieldset */\n\t\t&.ck-find-and-replace-form__replace {\n\t\t\tflex-wrap: wrap;\n\t\t\tjustify-content: flex-end;\n\t\t\tmargin-top: calc( -1 * var(--ck-spacing-large) );\n\n\t\t\t& > .ck-labeled-field-view {\n\t\t\t\tmargin-bottom: var(--ck-spacing-large);\n\t\t\t}\n\n\t\t\t& > .ck-options-dropdown {\n\t\t\t\tmargin-right: auto;\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\n\t\t\t& > .ck-labeled-field-view,\n\t\t\t& > .ck-labeled-field-view .ck-input {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t}\n\t}\n}\n\n@mixin ck-media-phone {\n\t.ck.ck-find-and-replace-form {\n\t\twidth: 300px;\n\n\t\t& fieldset {\n\t\t\tflex-wrap: wrap;\n\n\t\t\t/* The find fieldset */\n\t\t\t&.ck-find-and-replace-form__find {\n\t\t\t\t& .ck-labeled-field-view {\n\t\t\t\t\tflex: 1 0 auto;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\tmargin-bottom: var(--ck-spacing-standard);\n\t\t\t\t}\n\n\t\t\t\t& > .ck-button {\n\t\t\t\t\ttext-align: center;\n\n\t\t\t\t\t&:first-of-type {\n\t\t\t\t\t\tflex: 1 1 auto;\n\n\t\t\t\t\t\t@mixin ck-dir ltr {\n\t\t\t\t\t\t\tmargin-left: 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t@mixin ck-dir rtl {\n\t\t\t\t\t\t\tmargin-right: 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t& .ck-button__label {\n\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\ttext-align: center;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* The replace fieldset */\n\t\t\t&.ck-find-and-replace-form__replace > :not(.ck-labeled-field-view) {\n\t\t\t\tflex: 1 1 auto;\n\n\t\t\t\t&.ck-dropdown {\n\t\t\t\t\tflex-grow: 0;\n\t\t\t\t}\n\n\t\t\t\t&.ck-button > .ck-button__label {\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\ttext-align: center;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".ck-find-result{background:#ff0;color:var(--ck-color-text)}.ck-find-result_selected{background:#ff9633}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-find-and-replace/theme/findandreplace.css"],names:[],mappings:"AAKA,gBACC,eAA8B,CAC9B,0BACD,CAEA,yBACC,kBACD",sourcesContent:["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-find-result {\n\tbackground: hsl(60, 100%, 50%);\n\tcolor: var(--ck-color-text);\n}\n\n.ck-find-result_selected {\n\tbackground: hsl(29, 100%, 60%);\n}\n"],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".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)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-font/fontcolor.css"],names:[],mappings:"AAKA,4CACC,YAAa,CACb,kBAAmB,CACnB,UACD,CAEA,8BACC,iBACD,CCNA,4CACC,qEAAyE,CACzE,2BAA4B,CAC5B,4BAeD,CAbC,wDACC,mDACD,CAEA,kEAEE,uCAMF,CARA,kEAME,sCAEF",sourcesContent:["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-button.ck-color-table__remove-color {\n\tdisplay: flex;\n\talign-items: center;\n\twidth: 100%;\n}\n\nlabel.ck.ck-color-grid__label {\n\tfont-weight: unset;\n}\n",'/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n.ck .ck-button.ck-color-table__remove-color {\n\tpadding: calc(var(--ck-spacing-standard) / 2 ) var(--ck-spacing-standard);\n\tborder-bottom-left-radius: 0;\n\tborder-bottom-right-radius: 0;\n\n\t&:not(:focus) {\n\t\tborder-bottom: 1px solid var(--ck-color-base-border);\n\t}\n\n\t& .ck.ck-icon {\n\t\t@mixin ck-dir ltr {\n\t\t\tmargin-right: var(--ck-spacing-standard);\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n}\n\n'],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".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}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-font/theme/fontsize.css"],names:[],mappings:"AAUC,uBACC,cACD,CAEA,wBACC,eACD,CAEA,sBACC,eACD,CAEA,uBACC,eACD",sourcesContent:['/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* The values should be synchronized with the "FONT_SIZE_PRESET_UNITS" object in the "/src/fontsize/utils.js" file. */\n\n/* Styles should be prefixed with the `.ck-content` class.\nSee https://github.com/ckeditor/ckeditor5/issues/6636 */\n.ck-content {\n\t& .text-tiny {\n\t\tfont-size: .7em;\n\t}\n\n\t& .text-small {\n\t\tfont-size: .85em;\n\t}\n\n\t& .text-big {\n\t\tfont-size: 1.4em;\n\t}\n\n\t& .text-huge {\n\t\tfont-size: 1.8em;\n\t}\n}\n'],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".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}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-heading/heading.css"],names:[],mappings:"AAKA,wBACC,cACD,CAEA,wBACC,cACD,CAEA,wBACC,cACD,CAEA,+BACC,eACD,CCZC,2EACC,SACD,CAEA,uEACC,cACD",sourcesContent:['/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-heading_heading1 {\n\tfont-size: 20px;\n}\n\n.ck.ck-heading_heading2 {\n\tfont-size: 17px;\n}\n\n.ck.ck-heading_heading3 {\n\tfont-size: 14px;\n}\n\n.ck[class*="ck-heading_heading"] {\n\tfont-weight: bold;\n}\n',"/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* Resize dropdown's button label. */\n.ck.ck-dropdown.ck-heading-dropdown {\n\t& .ck-dropdown__button .ck-button__label {\n\t\twidth: 8em;\n\t}\n\n\t& .ck-dropdown__panel .ck-list__item {\n\t\tmin-width: 18em;\n\t}\n}\n"],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,":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}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-highlight/theme/highlight.css"],names:[],mappings:"AAKA,MACC,oCAA+C,CAC/C,mCAA+C,CAC/C,kCAA8C,CAC9C,kCAA8C,CAC9C,8BAAwC,CACxC,gCACD,CAGC,2BACC,kDACD,CAFA,0BACC,iDACD,CAFA,yBACC,gDACD,CAFA,yBACC,gDACD,CAIA,qBACC,iCAAqC,CAGrC,4BACD,CALA,uBACC,mCAAqC,CAGrC,4BACD",sourcesContent:["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-highlight-marker-yellow: hsl(60, 97%, 73%);\n\t--ck-highlight-marker-green: hsl(120, 93%, 68%);\n\t--ck-highlight-marker-pink: hsl(345, 96%, 73%);\n\t--ck-highlight-marker-blue: hsl(201, 97%, 72%);\n\t--ck-highlight-pen-red: hsl(0, 85%, 49%);\n\t--ck-highlight-pen-green: hsl(112, 100%, 27%);\n}\n\n@define-mixin highlight-marker-color $color {\n\t.ck-content .marker-$color {\n\t\tbackground-color: var(--ck-highlight-marker-$color);\n\t}\n}\n\n@define-mixin highlight-pen-color $color {\n\t.ck-content .pen-$color {\n\t\tcolor: var(--ck-highlight-pen-$color);\n\n\t\t/* Override default yellow background of `` from user agent stylesheet */\n\t\tbackground-color: transparent;\n\t}\n}\n\n@mixin highlight-marker-color yellow;\n@mixin highlight-marker-color green;\n@mixin highlight-marker-color pink;\n@mixin highlight-marker-color blue;\n\n@mixin highlight-pen-color red;\n@mixin highlight-pen-color green;\n"],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;position:absolute;pointer-events:none;left:0;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{position:absolute;pointer-events:all}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{width:var(--ck-resizer-size);height:var(--ck-resizer-size);background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{top:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{top:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widgetresize.css"],names:[],mappings:"AAKA,4BAEC,iBACD,CAEA,wBACC,YAAa,CACb,iBAAkB,CAGlB,mBAAoB,CAEpB,MAAO,CACP,KACD,CAGC,2EACC,aACD,CAGD,gCACC,iBAAkB,CAGlB,kBAWD,CATC,4IAEC,kBACD,CAEA,4IAEC,kBACD,CCpCD,MACC,sBAAuB,CAGvB,yDAAiE,CACjE,6BACD,CAEA,wBACC,yCACD,CAEA,gCACC,4BAA6B,CAC7B,6BAA8B,CAC9B,uCAAwC,CACxC,gDAA6D,CAC7D,6CAqBD,CAnBC,oEACC,4BAA6B,CAC7B,6BACD,CAEA,qEACC,4BAA6B,CAC7B,8BACD,CAEA,wEACC,+BAAgC,CAChC,8BACD,CAEA,uEACC,+BAAgC,CAChC,6BACD",sourcesContent:["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-widget_with-resizer {\n\t/* Make the widget wrapper a relative positioning container for the drag handle. */\n\tposition: relative;\n}\n\n.ck .ck-widget__resizer {\n\tdisplay: none;\n\tposition: absolute;\n\n\t/* The wrapper itself should not interfere with the pointer device, only the handles should. */\n\tpointer-events: none;\n\n\tleft: 0;\n\ttop: 0;\n}\n\n.ck-focused .ck-widget_with-resizer.ck-widget_selected {\n\t& > .ck-widget__resizer {\n\t\tdisplay: block;\n\t}\n}\n\n.ck .ck-widget__resizer__handle {\n\tposition: absolute;\n\n\t/* Resizers are the only UI elements that should interfere with a pointer device. */\n\tpointer-events: all;\n\n\t&.ck-widget__resizer__handle-top-left,\n\t&.ck-widget__resizer__handle-bottom-right {\n\t\tcursor: nwse-resize;\n\t}\n\n\t&.ck-widget__resizer__handle-top-right,\n\t&.ck-widget__resizer__handle-bottom-left {\n\t\tcursor: nesw-resize;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-resizer-size: 10px;\n\n\t/* Set the resizer with a 50% offset. */\n\t--ck-resizer-offset: calc( ( var(--ck-resizer-size) / -2 ) - 2px);\n\t--ck-resizer-border-width: 1px;\n}\n\n.ck .ck-widget__resizer {\n\toutline: 1px solid var(--ck-color-resizer);\n}\n\n.ck .ck-widget__resizer__handle {\n\twidth: var(--ck-resizer-size);\n\theight: var(--ck-resizer-size);\n\tbackground: var(--ck-color-focus-border);\n\tborder: var(--ck-resizer-border-width) solid hsl(0, 0%, 100%);\n\tborder-radius: var(--ck-resizer-border-radius);\n\n\t&.ck-widget__resizer__handle-top-left {\n\t\ttop: var(--ck-resizer-offset);\n\t\tleft: var(--ck-resizer-offset);\n\t}\n\n\t&.ck-widget__resizer__handle-top-right {\n\t\ttop: var(--ck-resizer-offset);\n\t\tright: var(--ck-resizer-offset);\n\t}\n\n\t&.ck-widget__resizer__handle-bottom-right {\n\t\tbottom: var(--ck-resizer-offset);\n\t\tright: var(--ck-resizer-offset);\n\t}\n\n\t&.ck-widget__resizer__handle-bottom-left {\n\t\tbottom: var(--ck-resizer-offset);\n\t\tleft: var(--ck-resizer-offset);\n\t}\n}\n"],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".ck-editor__editable .ck-horizontal-line{display:flow-root}.ck-content hr{margin:15px 0;height:4px;background:#dedede;border:0}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-horizontal-line/theme/horizontalline.css"],names:[],mappings:"AAMA,yCAEC,iBACD,CAEA,eACC,aAAc,CACd,UAAW,CACX,kBAA2B,CAC3B,QACD",sourcesContent:["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n\n.ck-editor__editable .ck-horizontal-line {\n\t/* Necessary to render properly next to floated objects, e.g. side image case. */\n\tdisplay: flow-root;\n}\n\n.ck-content hr {\n\tmargin: 15px 0;\n\theight: 4px;\n\tbackground: hsl(0, 0%, 87%);\n\tborder: 0;\n}\n"],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".ck-widget.raw-html-embed{margin:.9em auto;position:relative;display:flow-root;min-width:15em;font-style:normal}.ck-widget.raw-html-embed:before{position:absolute;z-index:1}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{position:absolute;display:flex;flex-direction:column}.ck-widget.raw-html-embed .raw-html-embed__preview{position:relative;overflow:hidden;display:flex}.ck-widget.raw-html-embed .raw-html-embed__preview-content{width:100%;position:relative;margin:auto;display:table;border-collapse:separate;border-spacing:7px}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{position:absolute;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}:root{--ck-html-embed-content-width:calc(100% - var(--ck-icon-size)*1.5);--ck-html-embed-source-height:10em;--ck-html-embed-unfocused-outline-width:1px;--ck-html-embed-content-min-height:calc(var(--ck-icon-size) + var(--ck-spacing-standard));--ck-html-embed-source-disabled-background:var(--ck-color-base-foreground);--ck-html-embed-source-disabled-color:#737373}.ck-widget.raw-html-embed{font-size:var(--ck-font-size-base);background-color:var(--ck-color-base-foreground)}.ck-widget.raw-html-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.raw-html-embed[dir=ltr]{text-align:left}.ck-widget.raw-html-embed[dir=rtl]{text-align:right}.ck-widget.raw-html-embed:before{content:attr(data-html-embed-label);top:calc(var(--ck-html-embed-unfocused-outline-width)*-1);left:var(--ck-spacing-standard);background:#999;transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);font-size:var(--ck-font-size-tiny);font-family:var(--ck-font-face)}.ck-widget.raw-html-embed[dir=rtl]:before{left:auto;right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed[dir=ltr] .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck.ck-editor__editable.ck-blurred .ck-widget.raw-html-embed.ck-widget_selected:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small)}.ck.ck-editor__editable:not(.ck-blurred) .ck-widget.raw-html-embed.ck-widget_selected:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small);background:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck-widget.raw-html-embed:not(.ck-widget_selected):hover:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small)}.ck-widget.raw-html-embed .raw-html-embed__content-wrapper{padding:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{top:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__save-button{color:var(--ck-color-button-save)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__cancel-button{color:var(--ck-color-button-cancel)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button:not(:first-child){margin-top:var(--ck-spacing-small)}.ck-widget.raw-html-embed[dir=rtl] .raw-html-embed__buttons-wrapper{left:var(--ck-spacing-standard);right:auto}.ck-widget.raw-html-embed .raw-html-embed__source{box-sizing:border-box;height:var(--ck-html-embed-source-height);width:var(--ck-html-embed-content-width);resize:none;min-width:0;padding:var(--ck-spacing-standard);font-family:monospace;tab-size:4;white-space:pre-wrap;font-size:var(--ck-font-size-base);text-align:left;direction:ltr}.ck-widget.raw-html-embed .raw-html-embed__source[disabled]{background:var(--ck-html-embed-source-disabled-background);color:var(--ck-html-embed-source-disabled-color);-webkit-text-fill-color:var(--ck-html-embed-source-disabled-color);opacity:1}.ck-widget.raw-html-embed .raw-html-embed__preview{min-height:var(--ck-html-embed-content-min-height);width:var(--ck-html-embed-content-width)}.ck-editor__editable:not(.ck-read-only) .ck-widget.raw-html-embed .raw-html-embed__preview{pointer-events:none}.ck-widget.raw-html-embed .raw-html-embed__preview-content{box-sizing:border-box;background-color:var(--ck-color-base-foreground)}.ck-widget.raw-html-embed .raw-html-embed__preview-content>*{margin-left:auto;margin-right:auto}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{color:var(--ck-html-embed-source-disabled-color)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-html-embed/htmlembed.css"],names:[],mappings:"AAMA,0BAIC,gBAAkB,CAClB,iBAAkB,CAClB,iBAAkB,CAIlB,cAAe,CAGf,iBAgDD,CA5CC,iCACC,iBAAkB,CAGlB,SACD,CAKA,2DACC,iBAAkB,CAClB,YAAa,CACb,qBACD,CAEA,mDACC,iBAAkB,CAClB,eAAgB,CAChB,YACD,CAEA,2DACC,UAAW,CACX,iBAAkB,CAClB,WAAY,CAGZ,aAAc,CACd,wBAAyB,CACzB,kBACD,CAEA,+DACC,iBAAkB,CAClB,MAAO,CACP,KAAM,CACN,OAAQ,CACR,QAAS,CAET,YAAa,CACb,kBAAmB,CACnB,sBACD,CC7DD,MACC,kEAAqE,CACrE,kCAAmC,CACnC,2CAA4C,CAC5C,yFAA0F,CAE1F,0EAA2E,CAC3E,6CACD,CAGA,0BACC,kCAAmC,CACnC,gDAyID,CAvIC,+DACC,iGACD,CAGA,mCACC,eACD,CAEA,mCACC,gBACD,CAIA,iCACC,mCAAoC,CACpC,yDAA4D,CAC5D,+BAAgC,CAChC,eAA4B,CAC5B,0GAA2G,CAC3G,kIAAmI,CACnI,iEAAkE,CAClE,qCAAsC,CACtC,kCAAmC,CACnC,+BACD,CAEA,0CACC,SAAU,CACV,gCACD,CAGA,iIACC,gBACD,CAxCD,uFA2CE,KAAQ,CACR,sDA+FF,CA3IA,6FAgDE,KAAM,CACN,sDAAuD,CACvD,uCAyFF,CA3IA,wFAsDE,KAAQ,CACR,sDAoFF,CA/EC,2DACC,kCACD,CAGA,2DACC,8BAA+B,CAC/B,gCAaD,CAXC,kGACC,iCACD,CAEA,oGACC,mCACD,CAEA,wFACC,kCACD,CAGD,oEACC,+BAAgC,CAChC,UACD,CAGA,kDACC,qBAAsB,CACtB,yCAA0C,CAC1C,wCAAyC,CACzC,WAAY,CACZ,WAAY,CACZ,kCAAmC,CAEnC,qBAAsB,CACtB,UAAW,CACX,oBAAqB,CACrB,kCAAmC,CAGnC,eAAgB,CAChB,aAUD,CARC,4DACC,0DAA2D,CAC3D,gDAAiD,CAGjD,kEAAmE,CACnE,SACD,CAID,mDACC,kDAAmD,CACnD,wCAMD,CARA,2FAME,mBAEF,CAEA,2DACC,qBAAsB,CACtB,gDAMD,CAJC,6DACC,gBAAiB,CACjB,iBACD,CAGD,+DACC,gDACD",sourcesContent:['/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* The feature container. */\n.ck-widget.raw-html-embed {\n\t/* Give the embed some air. */\n\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\n\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\n\tmargin: 0.9em auto;\n\tposition: relative;\n\tdisplay: flow-root;\n\n\t/* Give the html embed some minimal width in the content to prevent them\n\tfrom being "squashed" in tight spaces, e.g. in table cells (https://github.com/ckeditor/ckeditor5/issues/8331) */\n\tmin-width: 15em;\n\n\t/* Don\'t inherit the style, e.g. when in a block quote. */\n\tfont-style: normal;\n\n\t/* ----- Emebed label in the upper left corner ----------------------------------------------- */\n\n\t&::before {\n\t\tposition: absolute;\n\n\t\t/* Make sure the content does not cover the label. */\n\t\tz-index: 1;\n\t}\n\n\t/* ----- Emebed internals --------------------------------------------------------------------- */\n\n\t/* The switch mode button wrapper. */\n\t& .raw-html-embed__buttons-wrapper {\n\t\tposition: absolute;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\n\t& .raw-html-embed__preview {\n\t\tposition: relative;\n\t\toverflow: hidden;\n\t\tdisplay: flex;\n\t}\n\n\t& .raw-html-embed__preview-content {\n\t\twidth: 100%;\n\t\tposition: relative;\n\t\tmargin: auto;\n\n\t\t/* Gives spacing to the small renderable elements, so they always cover the placeholder. */\n\t\tdisplay: table;\n\t\tborder-collapse: separate;\n\t\tborder-spacing: 7px;\n\t}\n\n\t& .raw-html-embed__preview-placeholder {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t}\n}\n','/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-html-embed-content-width: calc(100% - 1.5 * var(--ck-icon-size));\n\t--ck-html-embed-source-height: 10em;\n\t--ck-html-embed-unfocused-outline-width: 1px;\n\t--ck-html-embed-content-min-height: calc(var(--ck-icon-size) + var(--ck-spacing-standard));\n\n\t--ck-html-embed-source-disabled-background: var(--ck-color-base-foreground);\n\t--ck-html-embed-source-disabled-color: hsl(0deg 0% 45%);\n}\n\n/* The feature container. */\n.ck-widget.raw-html-embed {\n\tfont-size: var(--ck-font-size-base);\n\tbackground-color: var(--ck-color-base-foreground);\n\n\t&:not(.ck-widget_selected):not(:hover) {\n\t\toutline: var(--ck-html-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border);\n\t}\n\n\t/* HTML embed widget itself should respect UI language direction */\n\t&[dir="ltr"] {\n\t\ttext-align: left;\n\t}\n\n\t&[dir="rtl"] {\n\t\ttext-align: right;\n\t}\n\n\t/* ----- Embed label in the upper left corner ----------------------------------------------- */\n\n\t&::before {\n\t\tcontent: attr(data-html-embed-label);\n\t\ttop: calc(-1 * var(--ck-html-embed-unfocused-outline-width));\n\t\tleft: var(--ck-spacing-standard);\n\t\tbackground: hsl(0deg 0% 60%);\n\t\ttransition: background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\n\t\tpadding: calc(var(--ck-spacing-tiny) + var(--ck-html-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);\n\t\tborder-radius: 0 0 var(--ck-border-radius) var(--ck-border-radius);\n\t\tcolor: var(--ck-color-base-background);\n\t\tfont-size: var(--ck-font-size-tiny);\n\t\tfont-family: var(--ck-font-face);\n\t}\n\n\t&[dir="rtl"]::before {\n\t\tleft: auto;\n\t\tright: var(--ck-spacing-standard);\n\t}\n\n\t/* Make space for label but it only collides in LTR languages */\n\t&[dir="ltr"] .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before {\n\t\tmargin-left: 50px;\n\t}\n\n\t@nest .ck.ck-editor__editable.ck-blurred &.ck-widget_selected::before {\n\t\ttop: 0px;\n\t\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-small);\n\t}\n\n\t@nest .ck.ck-editor__editable:not(.ck-blurred) &.ck-widget_selected::before {\n\t\ttop: 0;\n\t\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-small);\n\t\tbackground: var(--ck-color-focus-border);\n\t}\n\n\t@nest .ck.ck-editor__editable &:not(.ck-widget_selected):hover::before {\n\t\ttop: 0px;\n\t\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-small);\n\t}\n\n\t/* ----- Emebed internals --------------------------------------------------------------------- */\n\n\t& .raw-html-embed__content-wrapper {\n\t\tpadding: var(--ck-spacing-standard);\n\t}\n\n\t/* The switch mode button wrapper. */\n\t& .raw-html-embed__buttons-wrapper {\n\t\ttop: var(--ck-spacing-standard);\n\t\tright: var(--ck-spacing-standard);\n\n\t\t& .ck-button.raw-html-embed__save-button {\n\t\t\tcolor: var(--ck-color-button-save);\n\t\t}\n\n\t\t& .ck-button.raw-html-embed__cancel-button {\n\t\t\tcolor: var(--ck-color-button-cancel);\n\t\t}\n\n\t\t& .ck-button:not(:first-child) {\n\t\t\tmargin-top: var(--ck-spacing-small);\n\t\t}\n\t}\n\n\t&[dir="rtl"] .raw-html-embed__buttons-wrapper {\n\t\tleft: var(--ck-spacing-standard);\n\t\tright: auto;\n\t}\n\n\t/* The edit source element. */\n\t& .raw-html-embed__source {\n\t\tbox-sizing: border-box;\n\t\theight: var(--ck-html-embed-source-height);\n\t\twidth: var(--ck-html-embed-content-width);\n\t\tresize: none;\n\t\tmin-width: 0;\n\t\tpadding: var(--ck-spacing-standard);\n\n\t\tfont-family: monospace;\n\t\ttab-size: 4;\n\t\twhite-space: pre-wrap;\n\t\tfont-size: var(--ck-font-size-base); /* Safari needs this. */\n\n\t\t/* HTML code is direction鈥揳gnostic. */\n\t\ttext-align: left;\n\t\tdirection: ltr;\n\n\t\t&[disabled] {\n\t\t\tbackground: var(--ck-html-embed-source-disabled-background);\n\t\t\tcolor: var(--ck-html-embed-source-disabled-color);\n\n\t\t\t/* Safari needs this for the proper text color in disabled input (https://github.com/ckeditor/ckeditor5/issues/8320). */\n\t\t\t-webkit-text-fill-color: var(--ck-html-embed-source-disabled-color);\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t/* The preview data container. */\n\t& .raw-html-embed__preview {\n\t\tmin-height: var(--ck-html-embed-content-min-height);\n\t\twidth: var(--ck-html-embed-content-width);\n\n\t\t/* Disable all mouse interaction as long as the editor is not read鈥搊nly. */\n\t\t@nest .ck-editor__editable:not(.ck-read-only) & {\n\t\t\tpointer-events: none;\n\t\t}\n\t}\n\n\t& .raw-html-embed__preview-content {\n\t\tbox-sizing: border-box;\n\t\tbackground-color: var(--ck-color-base-foreground);\n\n\t\t& > * {\n\t\t\tmargin-left: auto;\n\t\t\tmargin-right: auto;\n\t\t}\n\t}\n\n\t& .raw-html-embed__preview-placeholder {\n\t\tcolor: var(--ck-html-embed-source-disabled-color)\n\t}\n}\n'],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".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%}}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css"],names:[],mappings:"AAOA,6BACC,YAAa,CACb,kBAAmB,CACnB,gBAqBD,CAnBC,oDACC,oBACD,CAEA,uCACC,YACD,CCZA,oCDCD,6BAcE,cAUF,CARE,oDACC,eACD,CAEA,wCACC,cACD,CCrBD",sourcesContent:['/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n\n.ck.ck-text-alternative-form {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: nowrap;\n\n\t& .ck-labeled-field-view {\n\t\tdisplay: inline-block;\n\t}\n\n\t& .ck-label {\n\t\tdisplay: none;\n\t}\n\n\t@mixin ck-media-phone {\n\t\tflex-wrap: wrap;\n\n\t\t& .ck-labeled-field-view {\n\t\t\tflex-basis: 100%;\n\t\t}\n\n\t\t& .ck-button {\n\t\t\tflex-basis: 50%;\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".ck-content .image{display:table;clear:both;text-align:center;margin:.9em auto;min-width:50px}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{display:inline-flex;max-width:100%;align-items:flex-start}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{padding-left:inherit;padding-right:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ck.ck-editor__editable .image-inline.ck-widget_selected,.ck.ck-editor__editable .image.ck-widget_selected{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/image.css"],names:[],mappings:"AAMC,mBACC,aAAc,CACd,UAAW,CACX,iBAAkB,CAKlB,gBAAkB,CAGlB,cAeD,CAbC,uBAEC,aAAc,CAGd,aAAc,CAGd,cAAe,CAGf,cACD,CAGD,0BAMC,mBAAoB,CAGpB,cAAe,CAGf,sBAiBD,CAdC,kCACC,YACD,CAGA,gEAGC,WAAY,CACZ,aAAc,CAGd,cACD,CAUD,gEACC,oBAAqB,CACrB,qBAAsB,CAMtB,kBAAmB,CACnB,eAAgB,CAChB,sBACD,CAWA,2GACC,SAUD,CAHC,qEACC,YACD,CAOA,0FACC,cACD",sourcesContent:['/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content {\n\t& .image {\n\t\tdisplay: table;\n\t\tclear: both;\n\t\ttext-align: center;\n\n\t\t/* Make sure there is some space between the content and the image. Center image by default. */\n\t\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\n\t \tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\n\t\tmargin: 0.9em auto;\n\n\t\t/* Make sure the caption will be displayed properly (See: https://github.com/ckeditor/ckeditor5/issues/1870). */\n\t\tmin-width: 50px;\n\n\t\t& img {\n\t\t\t/* Prevent unnecessary margins caused by line-height (see #44). */\n\t\t\tdisplay: block;\n\n\t\t\t/* Center the image if its width is smaller than the content\'s width. */\n\t\t\tmargin: 0 auto;\n\n\t\t\t/* Make sure the image never exceeds the size of the parent container (ckeditor/ckeditor5-ui#67). */\n\t\t\tmax-width: 100%;\n\n\t\t\t/* Make sure the image is never smaller than the parent container (See: https://github.com/ckeditor/ckeditor5/issues/9300). */\n\t\t\tmin-width: 100%\n\t\t}\n\t}\n\n\t& .image-inline {\n\t\t/*\n\t\t * Normally, the .image-inline would have "display: inline-block" and "img { width: 100% }" (to follow the wrapper while resizing).\n\t\t * Unfortunately, together with "srcset", it gets automatically stretched up to the width of the editing root.\n\t\t * This strange behavior does not happen with inline-flex.\n\t\t */\n\t\tdisplay: inline-flex;\n\n\t\t/* While being resized, don\'t allow the image to exceed the width of the editing root. */\n\t\tmax-width: 100%;\n\n\t\t/* This is required by Safari to resize images in a sensible way. Without this, the browser breaks the ratio. */\n\t\talign-items: flex-start;\n\n\t\t/* When the picture is present it must act as a flex container to let the img resize properly */\n\t\t& picture {\n\t\t\tdisplay: flex;\n\t\t}\n\n\t\t/* When the picture is present, it must act like a resizable img. */\n\t\t& picture,\n\t\t& img {\n\t\t\t/* This is necessary for the img to span the entire .image-inline wrapper and to resize properly. */\n\t\t\tflex-grow: 1;\n\t\t\tflex-shrink: 1;\n\n\t\t\t/* Prevents overflowing the editing root boundaries when an inline image is very wide. */\n\t\t\tmax-width: 100%;\n\t\t}\n\t}\n}\n\n.ck.ck-editor__editable {\n\t/*\n\t * Inhertit the content styles padding of the
    in case the integration overrides `text-align: center`\n\t * of `.image` (e.g. to the left/right). This ensures the placeholder stays at the padding just like the native\n\t * caret does, and not at the edge of
    .\n\t */\n\t& .image > figcaption.ck-placeholder::before {\n\t\tpadding-left: inherit;\n\t\tpadding-right: inherit;\n\n\t\t/*\n\t\t * Make sure the image caption placeholder doesn\'t overflow the placeholder area.\n\t\t * See https://github.com/ckeditor/ckeditor5/issues/9162.\n\t\t */\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\n\t/*\n\t * Make sure the selected inline image always stays on top of its siblings.\n\t * See https://github.com/ckeditor/ckeditor5/issues/9108.\n\t */\n\t& .image.ck-widget_selected {\n\t\tz-index: 1;\n\t}\n\n\t& .image-inline.ck-widget_selected {\n\t\tz-index: 1;\n\n\t\t/*\n\t\t * Make sure the native browser selection style is not displayed.\n\t\t * Inline image widgets have their own styles for the selected state and\n\t\t * leaving this up to the browser is asking for a visual collision.\n\t\t */\n\t\t& ::selection {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t/* The inline image nested in the table should have its original size if not resized.\n\tSee https://github.com/ckeditor/ckeditor5/issues/9117. */\n\t& td,\n\t& th {\n\t\t& .image-inline img {\n\t\t\tmax-width: none;\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,":root{--ck-color-image-caption-background:#f7f7f7;--ck-color-image-caption-text:#333;--ck-color-image-caption-highligted-background:#fd0}.ck-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:var(--ck-color-image-caption-text);background-color:var(--ck-color-image-caption-background);padding:.6em;font-size:.75em;outline-offset:-1px}.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:ck-image-caption-highlight .6s ease-out}@keyframes ck-image-caption-highlight{0%{background-color:var(--ck-color-image-caption-highligted-background)}to{background-color:var(--ck-color-image-caption-background)}}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css"],names:[],mappings:"AAKA,MACC,2CAAoD,CACpD,kCAA8C,CAC9C,mDACD,CAGA,8BACC,qBAAsB,CACtB,mBAAoB,CACpB,qBAAsB,CACtB,wCAAyC,CACzC,yDAA0D,CAC1D,YAAa,CACb,eAAgB,CAChB,mBACD,CAGA,qEACC,iDACD,CAEA,sCACC,GACC,oEACD,CAEA,GACC,yDACD,CACD",sourcesContent:["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-image-caption-background: hsl(0, 0%, 97%);\n\t--ck-color-image-caption-text: hsl(0, 0%, 20%);\n\t--ck-color-image-caption-highligted-background: hsl(52deg 100% 50%);\n}\n\n/* Content styles */\n.ck-content .image > figcaption {\n\tdisplay: table-caption;\n\tcaption-side: bottom;\n\tword-break: break-word;\n\tcolor: var(--ck-color-image-caption-text);\n\tbackground-color: var(--ck-color-image-caption-background);\n\tpadding: .6em;\n\tfont-size: .75em;\n\toutline-offset: -1px;\n}\n\n/* Editing styles */\n.ck.ck-editor__editable .image > figcaption.image__caption_highlighted {\n\tanimation: ck-image-caption-highlight .6s ease-out;\n}\n\n@keyframes ck-image-caption-highlight {\n\t0% {\n\t\tbackground-color: var(--ck-color-image-caption-highligted-background);\n\t}\n\n\t100% {\n\t\tbackground-color: var(--ck-color-image-caption-background);\n\t}\n}\n"],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,":root{--ck-image-style-spacing:1.5em;--ck-inline-image-style-spacing:calc(var(--ck-image-style-spacing)/2)}.ck-content .image-style-block-align-left,.ck-content .image-style-block-align-right{max-width:calc(100% - var(--ck-image-style-spacing))}.ck-content .image-style-align-left,.ck-content .image-style-align-right{clear:none}.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)}.ck-content .image-style-block-align-right{margin-right:0;margin-left:auto}.ck-content .image-style-block-align-left{margin-left:0;margin-right:auto}.ck-content p+.image-style-align-left,.ck-content p+.image-style-align-right,.ck-content p+.image-style-side{margin-top:0}.ck-content .image-inline.image-style-align-left,.ck-content .image-inline.image-style-align-right{margin-top:var(--ck-inline-image-style-spacing);margin-bottom:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-left{margin-right:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-right{margin-left:var(--ck-inline-image-style-spacing)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-background)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after{display:none}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-hover-background)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css"],names:[],mappings:"AAKA,MACC,8BAA+B,CAC/B,qEACD,CAMC,qFAEC,oDACD,CAIA,yEAEC,UACD,CAEA,8BACC,WAAY,CACZ,yCAA0C,CAC1C,aACD,CAEA,oCACC,UAAW,CACX,0CACD,CAEA,sCACC,gBAAiB,CACjB,iBACD,CAEA,qCACC,WAAY,CACZ,yCACD,CAEA,2CACC,cAAe,CACf,gBACD,CAEA,0CACC,aAAc,CACd,iBACD,CAGA,6GAGC,YACD,CAGC,mGAEC,+CAAgD,CAChD,kDACD,CAEA,iDACC,iDACD,CAEA,kDACC,gDACD,CAUC,0lBAGC,qDAKD,CAHC,8nBACC,YACD,CAKD,oVAGC,2DACD",sourcesContent:["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-image-style-spacing: 1.5em;\n\t--ck-inline-image-style-spacing: calc(var(--ck-image-style-spacing) / 2);\n}\n\n.ck-content {\n\t/* Provides a minimal side margin for the left and right aligned images, so that the user has a visual feedback\n\tconfirming successful application of the style if image width exceeds the editor's size.\n\tSee https://github.com/ckeditor/ckeditor5/issues/9342 */\n\t& .image-style-block-align-left,\n\t& .image-style-block-align-right {\n\t\tmax-width: calc(100% - var(--ck-image-style-spacing));\n\t}\n\n\t/* Allows displaying multiple floating images in the same line.\n\tSee https://github.com/ckeditor/ckeditor5/issues/9183#issuecomment-804988132 */\n\t& .image-style-align-left,\n\t& .image-style-align-right {\n\t\tclear: none;\n\t}\n\n\t& .image-style-side {\n\t\tfloat: right;\n\t\tmargin-left: var(--ck-image-style-spacing);\n\t\tmax-width: 50%;\n\t}\n\n\t& .image-style-align-left {\n\t\tfloat: left;\n\t\tmargin-right: var(--ck-image-style-spacing);\n\t}\n\n\t& .image-style-align-center {\n\t\tmargin-left: auto;\n\t\tmargin-right: auto;\n\t}\n\n\t& .image-style-align-right {\n\t\tfloat: right;\n\t\tmargin-left: var(--ck-image-style-spacing);\n\t}\n\n\t& .image-style-block-align-right {\n\t\tmargin-right: 0;\n\t\tmargin-left: auto;\n\t}\n\n\t& .image-style-block-align-left {\n\t\tmargin-left: 0;\n\t\tmargin-right: auto;\n\t}\n\n\t/* Simulates margin collapsing with the preceding paragraph, which does not work for the floating elements. */\n\t& p + .image-style-align-left,\n\t& p + .image-style-align-right,\n\t& p + .image-style-side {\n\t\tmargin-top: 0;\n\t}\n\n\t& .image-inline {\n\t\t&.image-style-align-left,\n\t\t&.image-style-align-right {\n\t\t\tmargin-top: var(--ck-inline-image-style-spacing);\n\t\t\tmargin-bottom: var(--ck-inline-image-style-spacing);\n\t\t}\n\n\t\t&.image-style-align-left {\n\t\t\tmargin-right: var(--ck-inline-image-style-spacing);\n\t\t}\n\n\t\t&.image-style-align-right {\n\t\t\tmargin-left: var(--ck-inline-image-style-spacing);\n\t\t}\n\t}\n}\n\n.ck.ck-splitbutton {\n\t/* The button should display as a regular drop-down if the action button\n\tis forced to fire the same action as the arrow button. */\n\t&.ck-splitbutton_flatten {\n\t\t&:hover,\n\t\t&.ck-splitbutton_open {\n\t\t\t& > .ck-splitbutton__action:not(.ck-disabled),\n\t\t\t& > .ck-splitbutton__arrow:not(.ck-disabled),\n\t\t\t& > .ck-splitbutton__arrow:not(.ck-disabled):not(:hover) {\n\t\t\t\tbackground-color: var(--ck-color-button-on-background);\n\n\t\t\t\t&::after {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t&.ck-splitbutton_open:hover {\n\t\t\t& > .ck-splitbutton__action:not(.ck-disabled),\n\t\t\t& > .ck-splitbutton__arrow:not(.ck-disabled),\n\t\t\t& > .ck-splitbutton__arrow:not(.ck-disabled):not(:hover) {\n\t\t\t\tbackground-color: var(--ck-color-button-on-hover-background);\n\t\t\t}\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".ck.ck-editor__editable .image,.ck.ck-editor__editable .image-inline{position:relative}.ck.ck-editor__editable .image-inline .ck-progress-bar,.ck.ck-editor__editable .image .ck-progress-bar{position:absolute;top:0;left:0}.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image-inline .ck-progress-bar,.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}}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadprogress.css"],names:[],mappings:"AAMC,qEAEC,iBACD,CAGA,uGAEC,iBAAkB,CAClB,KAAM,CACN,MACD,CCRC,yFACC,oBACD,CAID,uGAEC,UAAW,CACX,OAAQ,CACR,gDAAiD,CACjD,oBACD,CAGD,kBACC,GAAO,SAAY,CACnB,GAAO,SAAY,CACpB",sourcesContent:["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor__editable {\n\t& .image,\n\t& .image-inline {\n\t\tposition: relative;\n\t}\n\n\t/* Upload progress bar. */\n\t& .image .ck-progress-bar,\n\t& .image-inline .ck-progress-bar {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor__editable {\n\t& .image,\n\t& .image-inline {\n\t\t/* Showing animation. */\n\t\t&.ck-appear {\n\t\t\tanimation: fadeIn 700ms;\n\t\t}\n\t}\n\n\t/* Upload progress bar. */\n\t& .image .ck-progress-bar,\n\t& .image-inline .ck-progress-bar {\n\t\theight: 2px;\n\t\twidth: 0;\n\t\tbackground: var(--ck-color-upload-bar-background);\n\t\ttransition: width 100ms;\n\t}\n}\n\n@keyframes fadeIn {\n\tfrom { opacity: 0; }\n\tto { opacity: 1; }\n}\n"],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,'.ck-image-upload-complete-icon{display:block;position:absolute;top:min(var(--ck-spacing-medium),6%);right:min(var(--ck-spacing-medium),6%);border-radius:50%;z-index:1}.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:20;--ck-image-upload-icon-width:2px;--ck-image-upload-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck-image-upload-complete-icon{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:calc(1px*var(--ck-image-upload-icon-size));animation-delay:0ms,3s;overflow:hidden;width:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size));height:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size))}.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}}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadicon.css"],names:[],mappings:"AAKA,+BACC,aAAc,CACd,iBAAkB,CAMlB,oCAAsC,CACtC,sCAAwC,CACxC,iBAAkB,CAClB,SAMD,CAJC,qCACC,UAAW,CACX,iBACD,CChBD,MACC,iCAA8C,CAC9C,+CAA4D,CAG5D,8BAA+B,CAC/B,gCAAiC,CACjC,4DACD,CAEA,+BACC,SAAU,CACV,uDAAwD,CACxD,wEAA0E,CAC1E,qCAAuC,CACvC,0BAAgC,CAGhC,oDAAuD,CAGvD,sBAA4B,CAM5B,eAAgB,CAChB,mFAAsF,CACtF,oFAyBD,CAtBC,qCAEC,QAAS,CAET,OAAQ,CACR,SAAU,CACV,QAAS,CACT,OAAQ,CAER,mCAAoC,CACpC,yBAA0B,CAC1B,oFAAqF,CACrF,sFAAuF,CAEvF,4CAA6C,CAC7C,sBAAyB,CACzB,mBAAsB,CACtB,4BAA6B,CAG7B,qBACD,CAGD,wCACC,GACC,SACD,CAEA,GACC,SACD,CACD,CAEA,wCACC,GACC,SACD,CAEA,GACC,SACD,CACD,CAEA,yCACC,GACC,SAAU,CACV,OAAQ,CACR,QACD,CACA,IACC,UAAY,CACZ,QACD,CACA,GACC,SAAU,CACV,UAAY,CACZ,YACD,CACD",sourcesContent:['/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-image-upload-complete-icon {\n\tdisplay: block;\n\tposition: absolute;\n\n\t/*\n\t * Smaller images should have the icon closer to the border.\n\t * Match the icon position with the linked image indicator brought by the link image feature.\n\t */\n\ttop: min(var(--ck-spacing-medium), 6%);\n\tright: min(var(--ck-spacing-medium), 6%);\n\tborder-radius: 50%;\n\tz-index: 1;\n\n\t&::after {\n\t\tcontent: "";\n\t\tposition: absolute;\n\t}\n}\n','/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-image-upload-icon: hsl(0, 0%, 100%);\n\t--ck-color-image-upload-icon-background: hsl(120, 100%, 27%);\n\n\t/* Match the icon size with the linked image indicator brought by the link image feature. */\n\t--ck-image-upload-icon-size: 20;\n\t--ck-image-upload-icon-width: 2px;\n\t--ck-image-upload-icon-is-visible: clamp(0px, 100% - 50px, 1px);\n}\n\n.ck-image-upload-complete-icon {\n\topacity: 0;\n\tbackground: var(--ck-color-image-upload-icon-background);\n\tanimation-name: ck-upload-complete-icon-show, ck-upload-complete-icon-hide;\n\tanimation-fill-mode: forwards, forwards;\n\tanimation-duration: 500ms, 500ms;\n\n\t/* To make animation scalable. */\n\tfont-size: calc(1px * var(--ck-image-upload-icon-size));\n\n\t/* Hide completed upload icon after 3 seconds. */\n\tanimation-delay: 0ms, 3000ms;\n\n\t/*\n\t * Use CSS math to simulate container queries.\n\t * https://css-tricks.com/the-raven-technique-one-step-closer-to-container-queries/#what-about-showing-and-hiding-things\n\t */\n\toverflow: hidden;\n\twidth: calc(var(--ck-image-upload-icon-is-visible) * var(--ck-image-upload-icon-size));\n\theight: calc(var(--ck-image-upload-icon-is-visible) * var(--ck-image-upload-icon-size));\n\n\t/* This is check icon element made from border-width mixed with animations. */\n\t&::after {\n\t\t/* Because of border transformation we need to "hard code" left position. */\n\t\tleft: 25%;\n\n\t\ttop: 50%;\n\t\topacity: 0;\n\t\theight: 0;\n\t\twidth: 0;\n\n\t\ttransform: scaleX(-1) rotate(135deg);\n\t\ttransform-origin: left top;\n\t\tborder-top: var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);\n\t\tborder-right: var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);\n\n\t\tanimation-name: ck-upload-complete-icon-check;\n\t\tanimation-duration: 500ms;\n\t\tanimation-delay: 500ms;\n\t\tanimation-fill-mode: forwards;\n\n\t\t/* #1095. While reset is not providing proper box-sizing for pseudoelements, we need to handle it. */\n\t\tbox-sizing: border-box;\n\t}\n}\n\n@keyframes ck-upload-complete-icon-show {\n\tfrom {\n\t\topacity: 0;\n\t}\n\n\tto {\n\t\topacity: 1;\n\t}\n}\n\n@keyframes ck-upload-complete-icon-hide {\n\tfrom {\n\t\topacity: 1;\n\t}\n\n\tto {\n\t\topacity: 0;\n\t}\n}\n\n@keyframes ck-upload-complete-icon-check {\n\t0% {\n\t\topacity: 1;\n\t\twidth: 0;\n\t\theight: 0;\n\t}\n\t33% {\n\t\twidth: 0.3em;\n\t\theight: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t\twidth: 0.3em;\n\t\theight: 0.45em;\n\t}\n}\n'],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,'.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-upload-placeholder-image-aspect-ratio:2.8}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-image-upload-placeholder.image-inline{width:calc(var(--ck-upload-placeholder-loader-size)*2*var(--ck-upload-placeholder-image-aspect-ratio))}.ck .ck-image-upload-placeholder img{aspect-ratio:var(--ck-upload-placeholder-image-aspect-ratio)}.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)}}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadloader.css"],names:[],mappings:"AAKA,kCACC,iBAAkB,CAClB,YAAa,CACb,kBAAmB,CACnB,sBAAuB,CACvB,KAAM,CACN,MAMD,CAJC,yCACC,UAAW,CACX,iBACD,CCXD,MACC,4CAAqD,CACrD,wCAAyC,CACzC,8CACD,CAEA,iCAEC,UAAW,CACX,QAeD,CAbC,8CACC,sGACD,CAEA,qCAOC,4DACD,CAGD,kCACC,UAAW,CACX,WAUD,CARC,yCACC,8CAA+C,CAC/C,+CAAgD,CAChD,iBAAkB,CAClB,8DAA+D,CAC/D,kCAAmC,CACnC,yDACD,CAGD,wCACC,GACC,uBACD,CACD",sourcesContent:["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-upload-placeholder-loader {\n\tposition: absolute;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\ttop: 0;\n\tleft: 0;\n\n\t&::before {\n\t\tcontent: '';\n\t\tposition: relative;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-upload-placeholder-loader: hsl(0, 0%, 70%);\n\t--ck-upload-placeholder-loader-size: 32px;\n\t--ck-upload-placeholder-image-aspect-ratio: 2.8;\n}\n\n.ck .ck-image-upload-placeholder {\n\t/* We need to control the full width of the SVG gray background. */\n\twidth: 100%;\n\tmargin: 0;\n\n\t&.image-inline {\n\t\twidth: calc( 2 * var(--ck-upload-placeholder-loader-size) * var(--ck-upload-placeholder-image-aspect-ratio) );\n\t}\n\n\t& img {\n\t\t/*\n\t\t * This is an arbitrary aspect for a 1x1 px GIF to display to the user. Not too tall, not too short.\n\t\t * There's nothing special about this number except that it should make the image placeholder look like\n\t\t * a real image during this short period after the upload started and before the image was read from the\n\t\t * file system (and a rich preview was loaded).\n\t\t */\n\t\taspect-ratio: var(--ck-upload-placeholder-image-aspect-ratio);\n\t}\n}\n\n.ck .ck-upload-placeholder-loader {\n\twidth: 100%;\n\theight: 100%;\n\n\t&::before {\n\t\twidth: var(--ck-upload-placeholder-loader-size);\n\t\theight: var(--ck-upload-placeholder-loader-size);\n\t\tborder-radius: 50%;\n\t\tborder-top: 3px solid var(--ck-color-upload-placeholder-loader);\n\t\tborder-right: 2px solid transparent;\n\t\tanimation: ck-upload-placeholder-loader 1s linear infinite;\n\t}\n}\n\n@keyframes ck-upload-placeholder-loader {\n\tto {\n\t\ttransform: rotate( 360deg );\n\t}\n}\n"],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{height:100%;border-right:1px solid var(--ck-color-base-text);margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/link.css"],names:[],mappings:"AAMA,sBACC,mDAMD,CAHC,wCACC,yFACD,CAOD,4BACC,8CACD,CAGA,sCACC,WAAY,CACZ,gDAAiD,CACjD,iBAAkB,CAClB,oCACD",sourcesContent:['/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* Class added to span element surrounding currently selected link. */\n.ck .ck-link_selected {\n\tbackground: var(--ck-color-link-selected-background);\n\n\t/* Give linked inline images some outline to let the user know they are also part of the link. */\n\t& span.image-inline {\n\t\toutline: var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background);\n\t}\n}\n\n/*\n * Classes used by the "fake visual selection" displayed in the content when an input\n * in the link UI has focus (the browser does not render the native selection in this state).\n */\n.ck .ck-fake-link-selection {\n\tbackground: var(--ck-color-link-fake-selection);\n}\n\n/* A collapsed fake visual selection. */\n.ck .ck-fake-link-selection_collapsed {\n\theight: 100%;\n\tborder-right: 1px solid var(--ck-color-base-text);\n\tmargin-right: -1px;\n\toutline: solid 1px hsla(0, 0%, 100%, .5);\n}\n'],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".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}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkform.css"],names:[],mappings:"AAOA,iBACC,YAiBD,CAfC,2BACC,YACD,CCNA,oCDCD,iBAQE,cAUF,CARE,wCACC,eACD,CAEA,4BACC,cACD,CCfD,CDuBD,iCACC,aAYD,CALE,wHAEC,mCACD,CE/BF,iCACC,SAAU,CACV,oCA8CD,CA5CC,wDACC,8EAMD,CAJC,uEACC,WAAY,CACZ,UACD,CAGD,4CACC,kCAAmC,CACnC,QAAS,CACT,eAAgB,CAChB,QAAS,CACT,gDAAiD,CACjD,SAaD,CAnBA,4GAaE,aAMF,CAJE,mEACC,kDACD,CAKF,6CACC,yDAWD,CATC,wEACC,QAAS,CACT,SAAU,CACV,UAKD,CAHC,8EACC,eACD",sourcesContent:['/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n\n.ck.ck-link-form {\n\tdisplay: flex;\n\n\t& .ck-label {\n\t\tdisplay: none;\n\t}\n\n\t@mixin ck-media-phone {\n\t\tflex-wrap: wrap;\n\n\t\t& .ck-labeled-field-view {\n\t\t\tflex-basis: 100%;\n\t\t}\n\n\t\t& .ck-button {\n\t\t\tflex-basis: 50%;\n\t\t}\n\t}\n}\n\n/*\n * Style link form differently when manual decorators are available.\n * See: https://github.com/ckeditor/ckeditor5-link/issues/186.\n */\n.ck.ck-link-form_layout-vertical {\n\tdisplay: block;\n\n\t/*\n\t * Whether the form is in the responsive mode or not, if there are decorator buttons\n\t * keep the top margin of action buttons medium.\n\t */\n\t& .ck-button {\n\t\t&.ck-button-save,\n\t\t&.ck-button-cancel {\n\t\t\tmargin-top: var(--ck-spacing-medium);\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n/*\n * Style link form differently when manual decorators are available.\n * See: https://github.com/ckeditor/ckeditor5-link/issues/186.\n */\n.ck.ck-link-form_layout-vertical {\n\tpadding: 0;\n\tmin-width: var(--ck-input-text-width);\n\n\t& .ck-labeled-field-view {\n\t\tmargin: var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small);\n\n\t\t& .ck-input-text {\n\t\t\tmin-width: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t}\n\n\t& .ck-button {\n\t\tpadding: var(--ck-spacing-standard);\n\t\tmargin: 0;\n\t\tborder-radius: 0;\n\t\tborder: 0;\n\t\tborder-top: 1px solid var(--ck-color-base-border);\n\t\twidth: 50%;\n\n\t\t@mixin ck-dir ltr {\n\t\t\tmargin-left: 0;\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\tmargin-left: 0;\n\n\t\t\t&:last-of-type {\n\t\t\t\tborder-right: 1px solid var(--ck-color-base-border);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Using additional `.ck` class for stronger CSS specificity than `.ck.ck-link-form > :not(:first-child)`. */\n\t& .ck.ck-list {\n\t\tmargin: var(--ck-spacing-standard) var(--ck-spacing-large);\n\n\t\t& .ck-button.ck-switchbutton {\n\t\t\tborder: 0;\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\n\t\t\t&:hover {\n\t\t\t\tbackground: none;\n\t\t\t}\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".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}}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkactions.css"],names:[],mappings:"AAOA,oBACC,YAAa,CACb,kBAAmB,CACnB,gBAqBD,CAnBC,8CACC,oBAKD,CAHC,gEACC,eACD,CCXD,oCDCD,oBAcE,cAUF,CARE,8CACC,eACD,CAEA,8DACC,cACD,CCrBD,CCKA,wDACC,cAAe,CACf,eAmCD,CAjCC,0EACC,kCAAmC,CACnC,kCAAmC,CACnC,sBAAuB,CACvB,cAAe,CAIf,oCAAqC,CACrC,aAAc,CACd,iBAKD,CAHC,gFACC,yBACD,CAGD,mPAIC,eACD,CAEA,+DACC,eACD,CAGC,gFACC,yBACD,CAWD,qHACC,sCACD,CDvDD,oCC2DC,wDACC,8DAMD,CAJC,0EACC,WAAY,CACZ,cACD,CAGD,gJAME,aAEF,CD1ED",sourcesContent:['/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n\n.ck.ck-link-actions {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: nowrap;\n\n\t& .ck-link-actions__preview {\n\t\tdisplay: inline-block;\n\n\t\t& .ck-button__label {\n\t\t\toverflow: hidden;\n\t\t}\n\t}\n\n\t@mixin ck-media-phone {\n\t\tflex-wrap: wrap;\n\n\t\t& .ck-link-actions__preview {\n\t\t\tflex-basis: 100%;\n\t\t}\n\n\t\t& .ck-button:not(.ck-link-actions__preview) {\n\t\t\tflex-basis: 50%;\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n@import "../mixins/_focus.css";\n@import "../mixins/_shadow.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n\n.ck.ck-link-actions {\n\t& .ck-button.ck-link-actions__preview {\n\t\tpadding-left: 0;\n\t\tpadding-right: 0;\n\n\t\t& .ck-button__label {\n\t\t\tpadding: 0 var(--ck-spacing-medium);\n\t\t\tcolor: var(--ck-color-link-default);\n\t\t\ttext-overflow: ellipsis;\n\t\t\tcursor: pointer;\n\n\t\t\t/* Match the box model of the link editor form\'s input so the balloon\n\t\t\tdoes not change width when moving between actions and the form. */\n\t\t\tmax-width: var(--ck-input-text-width);\n\t\t\tmin-width: 3em;\n\t\t\ttext-align: center;\n\n\t\t\t&:hover {\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\t\t}\n\n\t\t&,\n\t\t&:hover,\n\t\t&:focus,\n\t\t&:active {\n\t\t\tbackground: none;\n\t\t}\n\n\t\t&:active {\n\t\t\tbox-shadow: none;\n\t\t}\n\n\t\t&:focus {\n\t\t\t& .ck-button__label {\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\t\t}\n\t}\n\n\t@mixin ck-dir ltr {\n\t\t& .ck-button:not(:first-child) {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-dir rtl {\n\t\t& .ck-button:not(:last-child) {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-media-phone {\n\t\t& .ck-button.ck-link-actions__preview {\n\t\t\tmargin: var(--ck-spacing-standard) var(--ck-spacing-standard) 0;\n\n\t\t\t& .ck-button__label {\n\t\t\t\tmin-width: 0;\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\n\t\t& .ck-button:not(.ck-link-actions__preview) {\n\t\t\t@mixin ck-dir ltr {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\n\t\t\t@mixin ck-dir rtl {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,'.ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{display:block;position:absolute}:root{--ck-link-image-indicator-icon-size:20;--ck-link-image-indicator-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{content:"";top:min(var(--ck-spacing-medium),6%);right:min(var(--ck-spacing-medium),6%);background-color:rgba(0,0,0,.4);background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTExLjA3NyAxNWwuOTkxLTEuNDE2YS43NS43NSAwIDExMS4yMjkuODZsLTEuMTQ4IDEuNjRhLjc0OC43NDggMCAwMS0uMjE3LjIwNiA1LjI1MSA1LjI1MSAwIDAxLTguNTAzLTUuOTU1Ljc0MS43NDEgMCAwMS4xMi0uMjc0bDEuMTQ3LTEuNjM5YS43NS43NSAwIDExMS4yMjguODZMNC45MzMgMTAuN2wuMDA2LjAwM2EzLjc1IDMuNzUgMCAwMDYuMTMyIDQuMjk0bC4wMDYuMDA0em01LjQ5NC01LjMzNWEuNzQ4Ljc0OCAwIDAxLS4xMi4yNzRsLTEuMTQ3IDEuNjM5YS43NS43NSAwIDExLTEuMjI4LS44NmwuODYtMS4yM2EzLjc1IDMuNzUgMCAwMC02LjE0NC00LjMwMWwtLjg2IDEuMjI5YS43NS43NSAwIDAxLTEuMjI5LS44NmwxLjE0OC0xLjY0YS43NDguNzQ4IDAgMDEuMjE3LS4yMDYgNS4yNTEgNS4yNTEgMCAwMTguNTAzIDUuOTU1em0tNC41NjMtMi41MzJhLjc1Ljc1IDAgMDEuMTg0IDEuMDQ1bC0zLjE1NSA0LjUwNWEuNzUuNzUgMCAxMS0xLjIyOS0uODZsMy4xNTUtNC41MDZhLjc1Ljc1IDAgMDExLjA0NS0uMTg0eiIvPjwvc3ZnPg==");background-size:14px;background-repeat:no-repeat;background-position:50%;border-radius:100%;overflow:hidden;width:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size));height:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size))}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkimage.css"],names:[],mappings:"AASE,+FACC,aAAc,CACd,iBACD,CCPF,MAEC,sCAAuC,CACvC,oEACD,CAME,+FACC,UAAW,CAMX,oCAAsC,CACtC,sCAAwC,CAExC,+BAAqC,CACrC,k2BAA+3B,CAC/3B,oBAAqB,CACrB,2BAA4B,CAC5B,uBAA2B,CAC3B,kBAAmB,CAMnB,eAAgB,CAChB,mGAAsG,CACtG,oGACD",sourcesContent:["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor__editable {\n\t/* Linked image indicator */\n\t& figure.image > a,\n\t& a span.image-inline {\n\t\t&::after {\n\t\t\tdisplay: block;\n\t\t\tposition: absolute;\n\t\t}\n\t}\n}\n\n",'/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/* Match the icon size with the upload indicator brought by the image upload feature. */\n\t--ck-link-image-indicator-icon-size: 20;\n\t--ck-link-image-indicator-icon-is-visible: clamp(0px, 100% - 50px, 1px);\n}\n\n.ck.ck-editor__editable {\n\t/* Linked image indicator */\n\t& figure.image > a,\n\t& a span.image-inline {\n\t\t&::after {\n\t\t\tcontent: "";\n\n\t\t\t/*\n\t\t\t * Smaller images should have the icon closer to the border.\n\t\t\t * Match the icon position with the upload indicator brought by the image upload feature.\n\t\t\t */\n\t\t\ttop: min(var(--ck-spacing-medium), 6%);\n\t\t\tright: min(var(--ck-spacing-medium), 6%);\n\n\t\t\tbackground-color: hsla(0, 0%, 0%, .4);\n\t\t\tbackground-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2ZmZiIgZD0ibTExLjA3NyAxNSAuOTkxLTEuNDE2YS43NS43NSAwIDEgMSAxLjIyOS44NmwtMS4xNDggMS42NGEuNzQ4Ljc0OCAwIDAgMS0uMjE3LjIwNiA1LjI1MSA1LjI1MSAwIDAgMS04LjUwMy01Ljk1NS43NDEuNzQxIDAgMCAxIC4xMi0uMjc0bDEuMTQ3LTEuNjM5YS43NS43NSAwIDEgMSAxLjIyOC44Nkw0LjkzMyAxMC43bC4wMDYuMDAzYTMuNzUgMy43NSAwIDAgMCA2LjEzMiA0LjI5NGwuMDA2LjAwNHptNS40OTQtNS4zMzVhLjc0OC43NDggMCAwIDEtLjEyLjI3NGwtMS4xNDcgMS42MzlhLjc1Ljc1IDAgMSAxLTEuMjI4LS44NmwuODYtMS4yM2EzLjc1IDMuNzUgMCAwIDAtNi4xNDQtNC4zMDFsLS44NiAxLjIyOWEuNzUuNzUgMCAwIDEtMS4yMjktLjg2bDEuMTQ4LTEuNjRhLjc0OC43NDggMCAwIDEgLjIxNy0uMjA2IDUuMjUxIDUuMjUxIDAgMCAxIDguNTAzIDUuOTU1em0tNC41NjMtMi41MzJhLjc1Ljc1IDAgMCAxIC4xODQgMS4wNDVsLTMuMTU1IDQuNTA1YS43NS43NSAwIDEgMS0xLjIyOS0uODZsMy4xNTUtNC41MDZhLjc1Ljc1IDAgMCAxIDEuMDQ1LS4xODR6Ii8+PC9zdmc+");\n\t\t\tbackground-size: 14px;\n\t\t\tbackground-repeat: no-repeat;\n\t\t\tbackground-position: center;\n\t\t\tborder-radius: 100%;\n\n\t\t\t/*\n\t\t\t* Use CSS math to simulate container queries.\n\t\t\t* https://css-tricks.com/the-raven-technique-one-step-closer-to-container-queries/#what-about-showing-and-hiding-things\n\t\t\t*/\n\t\t\toverflow: hidden;\n\t\t\twidth: calc(var(--ck-link-image-indicator-icon-is-visible) * var(--ck-link-image-indicator-icon-size));\n\t\t\theight: calc(var(--ck-link-image-indicator-icon-is-visible) * var(--ck-link-image-indicator-icon-size));\n\t\t}\n\t}\n}\n\n'],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".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)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-list/theme/liststyles.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-list/liststyles.css"],names:[],mappings:"AAKA,+EAKC,YACD,CCNA,MACC,gCACD,CAEA,4DACC,eAAgB,CAChB,SAiCD,CA/BC,+EACC,oCAAwC,CACxC,gCAAiC,CACjC,mCAAoC,CACpC,gCA0BD,CAxBC,0FAEC,sCAAuC,CACvC,uCAAwC,CACxC,SAAU,CAMV,QAAS,CAOT,sBAMD,CAJC,mGACC,sCAAuC,CACvC,uCACD",sourcesContent:["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-list-styles-dropdown > .ck-dropdown__panel > .ck-toolbar > .ck-toolbar__items {\n\t/*\n\t * Use the benefits of the toolbar (e.g. out-of-the-box keyboard navigation) but make it look\n\t * like a panel with thumbnails (previews).\n\t */\n\tdisplay: grid;\n}\n",'/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-list-style-button-size: 44px;\n}\n\n.ck.ck-list-styles-dropdown > .ck-dropdown__panel > .ck-toolbar {\n\tbackground: none;\n\tpadding: 0;\n\n\t& > .ck-toolbar__items {\n\t\tgrid-template-columns: repeat( 3, auto );\n\t\trow-gap: var(--ck-spacing-medium);\n\t\tcolumn-gap: var(--ck-spacing-medium);\n\t\tpadding: var(--ck-spacing-medium);\n\n\t\t& .ck-button {\n\t\t\t/* Make the button look like a thumbnail (the icon "takes it all"). */\n\t\t\twidth: var(--ck-list-style-button-size);\n\t\t\theight: var(--ck-list-style-button-size);\n\t\t\tpadding: 0;\n\n\t\t\t/*\n\t\t\t * Buttons are aligned by the grid so disable default button margins to not collide with the\n\t\t\t * gaps in the grid.\n\t\t\t */\n\t\t\tmargin: 0;\n\n\t\t\t/*\n\t\t\t * Make sure the button border (which is displayed on focus, BTW) does not steal pixels\n\t\t\t * from the button dimensions and, as a result, decrease the size of the icon\n\t\t\t * (which becomes blurry as it scales down).\n\t\t\t */\n\t\t\tbox-sizing: content-box;\n\n\t\t\t& .ck-icon {\n\t\t\t\twidth: var(--ck-list-style-button-size);\n\t\t\t\theight: var(--ck-list-style-button-size);\n\t\t\t}\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,'.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*="goo.gl/maps"] .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*="maps.app.goo.gl"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.google.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*="goo.gl/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .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}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaembedediting.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-media-embed/mediaembedediting.css"],names:[],mappings:"AAQC,0CACC,YAAa,CACb,qBAAsB,CACtB,kBAmBD,CCpBA,kFACC,aAqBD,CAHC,oBAnBD,kFAoBE,YAEF,CADC,CDlBA,sEAIC,cAAe,CAEf,iBAUD,CCoBD,wFACC,kBAAmB,CACnB,SACD,CD3BE,wGACC,eAAgB,CAChB,aACD,CAWD,6kBACC,YACD,CAYF,2LACC,mBACD,CElDA,MACC,0CAA2C,CAE3C,mDAA4D,CAC5D,2EACD,CAEA,mBACC,aA+FD,CA7FC,0CACC,0CAA+C,CAC/C,0CA4BD,CA1BC,uEACC,qDAAsD,CACtD,kDAAmD,CACnD,qCAAsC,CACtC,uBAA2B,CAC3B,qBAMD,CAJC,gFACC,UAAW,CACX,WACD,CAGD,4EACC,sDAAuD,CACvD,kBAAmB,CACnB,iBAAkB,CAClB,iBAAkB,CAClB,sBAOD,CALC,kFACC,4DAA6D,CAC7D,cAAe,CACf,yBACD,CAIF,wDACC,eAAgB,CAChB,gBACD,CAEA,4UAIC,gvGACD,CAEA,2EACC,kBAaD,CAXC,wGACC,orBACD,CAEA,6GACC,UAKD,CAHC,mHACC,UACD,CAIF,4EACC,2DAcD,CAZC,yGACC,4jHACD,CAGA,8GACC,aAKD,CAHC,oHACC,UACD,CAIF,6EAEC,iDAaD,CAXC,0GACC,48BACD,CAEA,+GACC,aAKD,CAHC,qHACC,UACD",sourcesContent:['/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css";\n\n.ck-media__wrapper {\n\t& .ck-media__placeholder {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\n\t\t& .ck-media__placeholder__url {\n\t\t\t@mixin ck-tooltip_enabled;\n\n\t\t\t/* Otherwise the URL will overflow when the content is very narrow. */\n\t\t\tmax-width: 100%;\n\n\t\t\tposition: relative;\n\n\t\t\t&:hover {\n\t\t\t\t@mixin ck-tooltip_visible;\n\t\t\t}\n\n\t\t\t& .ck-media__placeholder__url__text {\n\t\t\t\toverflow: hidden;\n\t\t\t\tdisplay: block;\n\t\t\t}\n\t\t}\n\t}\n\n\t&[data-oembed-url*="twitter.com"],\n\t&[data-oembed-url*="google.com/maps"],\n\t&[data-oembed-url*="goo.gl/maps"],\n\t&[data-oembed-url*="maps.google.com"],\n\t&[data-oembed-url*="maps.app.goo.gl"],\n\t&[data-oembed-url*="facebook.com"],\n\t&[data-oembed-url*="instagram.com"] {\n\t\t& .ck-media__placeholder__icon * {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n\n/* Disable all mouse interaction as long as the editor is not read鈥搊nly.\n https://github.com/ckeditor/ckeditor5-media-embed/issues/58 */\n.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper > *:not(.ck-media__placeholder) {\n\tpointer-events: none;\n}\n\n/* Disable all mouse interaction when the widget is not selected (e.g. to avoid opening links by accident).\n https://github.com/ckeditor/ckeditor5-media-embed/issues/18 */\n.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder {\n\tpointer-events: none;\n}\n',"/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Enables the tooltip, which is the tooltip is in DOM but\n * not yet displayed.\n */\n@define-mixin ck-tooltip_enabled {\n\t& .ck-tooltip {\n\t\tdisplay: block;\n\n\t\t/*\n\t\t * Don't display tooltips in devices which don't support :hover.\n\t\t * In fact, it's all about iOS, which forces user to click UI elements twice to execute\n\t\t * the primary action, when tooltips are enabled.\n\t\t *\n\t\t * Q: OK, but why not the following query?\n\t\t *\n\t\t * @media (hover) {\n\t\t * display: block;\n\t\t * }\n\t\t *\n\t\t * A: Because FF does not support it and it would completely disable tooltips\n\t\t * in that browser.\n\t\t *\n\t\t * More in https://github.com/ckeditor/ckeditor5/issues/920.\n\t\t */\n\t\t@media (hover:none) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n\n/**\n * Disables the tooltip making it disappear from DOM.\n */\n@define-mixin ck-tooltip_disabled {\n\t& .ck-tooltip {\n\t\tdisplay: none;\n\t}\n}\n\n/**\n * Shows the tooltip, which is already in DOM.\n * Requires `ck-tooltip_enabled` first.\n */\n@define-mixin ck-tooltip_visible {\n\t& .ck-tooltip {\n\t\tvisibility: visible;\n\t\topacity: 1;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-media-embed-placeholder-icon-size: 3em;\n\n\t--ck-color-media-embed-placeholder-url-text: hsl(0, 0%, 46%);\n\t--ck-color-media-embed-placeholder-url-text-hover: var(--ck-color-base-text);\n}\n\n.ck-media__wrapper {\n\tmargin: 0 auto;\n\n\t& .ck-media__placeholder {\n\t\tpadding: calc( 3 * var(--ck-spacing-standard) );\n\t\tbackground: var(--ck-color-base-foreground);\n\n\t\t& .ck-media__placeholder__icon {\n\t\t\tmin-width: var(--ck-media-embed-placeholder-icon-size);\n\t\t\theight: var(--ck-media-embed-placeholder-icon-size);\n\t\t\tmargin-bottom: var(--ck-spacing-large);\n\t\t\tbackground-position: center;\n\t\t\tbackground-size: cover;\n\n\t\t\t& .ck-icon {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t}\n\t\t}\n\n\t\t& .ck-media__placeholder__url__text {\n\t\t\tcolor: var(--ck-color-media-embed-placeholder-url-text);\n\t\t\twhite-space: nowrap;\n\t\t\ttext-align: center;\n\t\t\tfont-style: italic;\n\t\t\ttext-overflow: ellipsis;\n\n\t\t\t&:hover {\n\t\t\t\tcolor: var(--ck-color-media-embed-placeholder-url-text-hover);\n\t\t\t\tcursor: pointer;\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\t\t}\n\t}\n\n\t&[data-oembed-url*="open.spotify.com"] {\n\t\tmax-width: 300px;\n\t\tmax-height: 380px;\n\t}\n\n\t&[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon,\n\t&[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon,\n\t&[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon,\n\t&[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon {\n\t\tbackground-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSkgc2NhbGUoLjk4MDEyKSI+PHJlY3Qgcnk9IjUuMjM4IiByeD0iNS4yMzgiIHk9IjIzMS4zOTkiIHg9IjE3Ni4wMzEiIGhlaWdodD0iNjAuMDk5IiB3aWR0aD0iNjAuMDk5IiBmaWxsPSIjMzRhNjY4IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0yMDYuNDc3IDI2MC45bC0yOC45ODcgMjguOTg3YTUuMjE4IDUuMjE4IDAgMCAwIDMuNzggMS42MWg0OS42MjFjMS42OTQgMCAzLjE5LS43OTggNC4xNDYtMi4wMzd6IiBmaWxsPSIjNWM4OGM1Ii8+PHBhdGggZD0iTTIyNi43NDIgMjIyLjk4OGMtOS4yNjYgMC0xNi43NzcgNy4xNy0xNi43NzcgMTYuMDE0LjAwNyAyLjc2Mi42NjMgNS40NzQgMi4wOTMgNy44NzUuNDMuNzAzLjgzIDEuNDA4IDEuMTkgMi4xMDcuMzMzLjUwMi42NSAxLjAwNS45NSAxLjUwOC4zNDMuNDc3LjY3My45NTcuOTg4IDEuNDQgMS4zMSAxLjc2OSAyLjUgMy41MDIgMy42MzcgNS4xNjguNzkzIDEuMjc1IDEuNjgzIDIuNjQgMi40NjYgMy45OSAyLjM2MyA0LjA5NCA0LjAwNyA4LjA5MiA0LjYgMTMuOTE0di4wMTJjLjE4Mi40MTIuNTE2LjY2Ni44NzkuNjY3LjQwMy0uMDAxLjc2OC0uMzE0LjkzLS43OTkuNjAzLTUuNzU2IDIuMjM4LTkuNzI5IDQuNTg1LTEzLjc5NC43ODItMS4zNSAxLjY3My0yLjcxNSAyLjQ2NS0zLjk5IDEuMTM3LTEuNjY2IDIuMzI4LTMuNCAzLjYzOC01LjE2OS4zMTUtLjQ4Mi42NDUtLjk2Mi45ODgtMS40MzkuMy0uNTAzLjYxNy0xLjAwNi45NS0xLjUwOC4zNTktLjcuNzYtMS40MDQgMS4xOS0yLjEwNyAxLjQyNi0yLjQwMiAyLTUuMTE0IDIuMDA0LTcuODc1IDAtOC44NDQtNy41MTEtMTYuMDE0LTE2Ljc3Ni0xNi4wMTR6IiBmaWxsPSIjZGQ0YjNlIiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxlbGxpcHNlIHJ5PSI1LjU2NCIgcng9IjUuODI4IiBjeT0iMjM5LjAwMiIgY3g9IjIyNi43NDIiIGZpbGw9IiM4MDJkMjciIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTE5MC4zMDEgMjM3LjI4M2MtNC42NyAwLTguNDU3IDMuODUzLTguNDU3IDguNjA2czMuNzg2IDguNjA3IDguNDU3IDguNjA3YzMuMDQzIDAgNC44MDYtLjk1OCA2LjMzNy0yLjUxNiAxLjUzLTEuNTU3IDIuMDg3LTMuOTEzIDIuMDg3LTYuMjkgMC0uMzYyLS4wMjMtLjcyMi0uMDY0LTEuMDc5aC04LjI1N3YzLjA0M2g0Ljg1Yy0uMTk3Ljc1OS0uNTMxIDEuNDUtMS4wNTggMS45ODYtLjk0Mi45NTgtMi4wMjggMS41NDgtMy45MDEgMS41NDgtMi44NzYgMC01LjIwOC0yLjM3Mi01LjIwOC01LjI5OSAwLTIuOTI2IDIuMzMyLTUuMjk5IDUuMjA4LTUuMjk5IDEuMzk5IDAgMi42MTguNDA3IDMuNTg0IDEuMjkzbDIuMzgxLTIuMzhjMC0uMDAyLS4wMDMtLjAwNC0uMDA0LS4wMDUtMS41ODgtMS41MjQtMy42Mi0yLjIxNS01Ljk1NS0yLjIxNXptNC40MyA1LjY2bC4wMDMuMDA2di0uMDAzeiIgZmlsbD0iI2ZmZiIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBkPSJNMjE1LjE4NCAyNTEuOTI5bC03Ljk4IDcuOTc5IDI4LjQ3NyAyOC40NzVjLjI4Ny0uNjQ5LjQ0OS0xLjM2Ni40NDktMi4xMjN2LTMxLjE2NWMtLjQ2OS42NzUtLjkzNCAxLjM0OS0xLjM4MiAyLjAwNS0uNzkyIDEuMjc1LTEuNjgyIDIuNjQtMi40NjUgMy45OS0yLjM0NyA0LjA2NS0zLjk4MiA4LjAzOC00LjU4NSAxMy43OTQtLjE2Mi40ODUtLjUyNy43OTgtLjkzLjc5OS0uMzYzLS4wMDEtLjY5Ny0uMjU1LS44NzktLjY2N3YtLjAxMmMtLjU5My01LjgyMi0yLjIzNy05LjgyLTQuNi0xMy45MTQtLjc4My0xLjM1LTEuNjczLTIuNzE1LTIuNDY2LTMuOTktMS4xMzctMS42NjYtMi4zMjctMy40LTMuNjM3LTUuMTY5bC0uMDAyLS4wMDN6IiBmaWxsPSIjYzNjM2MzIi8+PHBhdGggZD0iTTIxMi45ODMgMjQ4LjQ5NWwtMzYuOTUyIDM2Ljk1M3YuODEyYTUuMjI3IDUuMjI3IDAgMCAwIDUuMjM4IDUuMjM4aDEuMDE1bDM1LjY2Ni0zNS42NjZhMTM2LjI3NSAxMzYuMjc1IDAgMCAwLTIuNzY0LTMuOSAzNy41NzUgMzcuNTc1IDAgMCAwLS45ODktMS40NGMtLjI5OS0uNTAzLS42MTYtMS4wMDYtLjk1LTEuNTA4LS4wODMtLjE2Mi0uMTc2LS4zMjYtLjI2NC0uNDg5eiIgZmlsbD0iI2ZkZGM0ZiIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBkPSJNMjExLjk5OCAyNjEuMDgzbC02LjE1MiA2LjE1MSAyNC4yNjQgMjQuMjY0aC43ODFhNS4yMjcgNS4yMjcgMCAwIDAgNS4yMzktNS4yMzh2LTEuMDQ1eiIgZmlsbD0iI2ZmZiIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48L2c+PC9zdmc+);\n\t}\n\n\t&[data-oembed-url*="facebook.com"] .ck-media__placeholder {\n\t\tbackground: hsl(220, 46%, 48%);\n\n\t\t& .ck-media__placeholder__icon {\n\t\t\tbackground-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIxMDI0cHgiIGhlaWdodD0iMTAyNHB4IiB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPiAgICAgICAgPHRpdGxlPkZpbGwgMTwvdGl0bGU+ICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPiAgICA8ZGVmcz48L2RlZnM+ICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPiAgICAgICAgPGcgaWQ9ImZMb2dvX1doaXRlIiBmaWxsPSIjRkZGRkZFIj4gICAgICAgICAgICA8cGF0aCBkPSJNOTY3LjQ4NCwwIEw1Ni41MTcsMCBDMjUuMzA0LDAgMCwyNS4zMDQgMCw1Ni41MTcgTDAsOTY3LjQ4MyBDMCw5OTguNjk0IDI1LjI5NywxMDI0IDU2LjUyMiwxMDI0IEw1NDcsMTAyNCBMNTQ3LDYyOCBMNDE0LDYyOCBMNDE0LDQ3MyBMNTQ3LDQ3MyBMNTQ3LDM1OS4wMjkgQzU0NywyMjYuNzY3IDYyNy43NzMsMTU0Ljc0NyA3NDUuNzU2LDE1NC43NDcgQzgwMi4yNjksMTU0Ljc0NyA4NTAuODQyLDE1OC45NTUgODY1LDE2MC44MzYgTDg2NSwyOTkgTDc4My4zODQsMjk5LjAzNyBDNzE5LjM5MSwyOTkuMDM3IDcwNywzMjkuNTI5IDcwNywzNzQuMjczIEw3MDcsNDczIEw4NjAuNDg3LDQ3MyBMODQwLjUwMSw2MjggTDcwNyw2MjggTDcwNywxMDI0IEw5NjcuNDg0LDEwMjQgQzk5OC42OTcsMTAyNCAxMDI0LDk5OC42OTcgMTAyNCw5NjcuNDg0IEwxMDI0LDU2LjUxNSBDMTAyNCwyNS4zMDMgOTk4LjY5NywwIDk2Ny40ODQsMCIgaWQ9IkZpbGwtMSI+PC9wYXRoPiAgICAgICAgPC9nPiAgICA8L2c+PC9zdmc+);\n\t\t}\n\n\t\t& .ck-media__placeholder__url__text {\n\t\t\tcolor: hsl(220, 100%, 90%);\n\n\t\t\t&:hover {\n\t\t\t\tcolor: hsl(0, 0%, 100%);\n\t\t\t}\n\t\t}\n\t}\n\n\t&[data-oembed-url*="instagram.com"] .ck-media__placeholder {\n\t\tbackground: linear-gradient(-135deg,hsl(246, 100%, 39%),hsl(302, 100%, 36%),hsl(0, 100%, 48%));\n\n\t\t& .ck-media__placeholder__icon {\n\t\t\tbackground-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSI1MDRweCIgaGVpZ2h0PSI1MDRweCIgdmlld0JveD0iMCAwIDUwNCA1MDQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+ICAgICAgICA8dGl0bGU+Z2x5cGgtbG9nb19NYXkyMDE2PC90aXRsZT4gICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+ICAgIDxkZWZzPiAgICAgICAgPHBvbHlnb24gaWQ9InBhdGgtMSIgcG9pbnRzPSIwIDAuMTU5IDUwMy44NDEgMC4xNTkgNTAzLjg0MSA1MDMuOTQgMCA1MDMuOTQiPjwvcG9seWdvbj4gICAgPC9kZWZzPiAgICA8ZyBpZD0iZ2x5cGgtbG9nb19NYXkyMDE2IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4gICAgICAgIDxnIGlkPSJHcm91cC0zIj4gICAgICAgICAgICA8bWFzayBpZD0ibWFzay0yIiBmaWxsPSJ3aGl0ZSI+ICAgICAgICAgICAgICAgIDx1c2UgeGxpbms6aHJlZj0iI3BhdGgtMSI+PC91c2U+ICAgICAgICAgICAgPC9tYXNrPiAgICAgICAgICAgIDxnIGlkPSJDbGlwLTIiPjwvZz4gICAgICAgICAgICA8cGF0aCBkPSJNMjUxLjkyMSwwLjE1OSBDMTgzLjUwMywwLjE1OSAxNzQuOTI0LDAuNDQ5IDE0OC4wNTQsMS42NzUgQzEyMS4yNCwyLjg5OCAxMDIuOTI3LDcuMTU3IDg2LjkwMywxMy4zODUgQzcwLjMzNywxOS44MjIgNTYuMjg4LDI4LjQzNiA0Mi4yODIsNDIuNDQxIEMyOC4yNzcsNTYuNDQ3IDE5LjY2Myw3MC40OTYgMTMuMjI2LDg3LjA2MiBDNi45OTgsMTAzLjA4NiAyLjczOSwxMjEuMzk5IDEuNTE2LDE0OC4yMTMgQzAuMjksMTc1LjA4MyAwLDE4My42NjIgMCwyNTIuMDggQzAsMzIwLjQ5NyAwLjI5LDMyOS4wNzYgMS41MTYsMzU1Ljk0NiBDMi43MzksMzgyLjc2IDYuOTk4LDQwMS4wNzMgMTMuMjI2LDQxNy4wOTcgQzE5LjY2Myw0MzMuNjYzIDI4LjI3Nyw0NDcuNzEyIDQyLjI4Miw0NjEuNzE4IEM1Ni4yODgsNDc1LjcyMyA3MC4zMzcsNDg0LjMzNyA4Ni45MDMsNDkwLjc3NSBDMTAyLjkyNyw0OTcuMDAyIDEyMS4yNCw1MDEuMjYxIDE0OC4wNTQsNTAyLjQ4NCBDMTc0LjkyNCw1MDMuNzEgMTgzLjUwMyw1MDQgMjUxLjkyMSw1MDQgQzMyMC4zMzgsNTA0IDMyOC45MTcsNTAzLjcxIDM1NS43ODcsNTAyLjQ4NCBDMzgyLjYwMSw1MDEuMjYxIDQwMC45MTQsNDk3LjAwMiA0MTYuOTM4LDQ5MC43NzUgQzQzMy41MDQsNDg0LjMzNyA0NDcuNTUzLDQ3NS43MjMgNDYxLjU1OSw0NjEuNzE4IEM0NzUuNTY0LDQ0Ny43MTIgNDg0LjE3OCw0MzMuNjYzIDQ5MC42MTYsNDE3LjA5NyBDNDk2Ljg0Myw0MDEuMDczIDUwMS4xMDIsMzgyLjc2IDUwMi4zMjUsMzU1Ljk0NiBDNTAzLjU1MSwzMjkuMDc2IDUwMy44NDEsMzIwLjQ5NyA1MDMuODQxLDI1Mi4wOCBDNTAzLjg0MSwxODMuNjYyIDUwMy41NTEsMTc1LjA4MyA1MDIuMzI1LDE0OC4yMTMgQzUwMS4xMDIsMTIxLjM5OSA0OTYuODQzLDEwMy4wODYgNDkwLjYxNiw4Ny4wNjIgQzQ4NC4xNzgsNzAuNDk2IDQ3NS41NjQsNTYuNDQ3IDQ2MS41NTksNDIuNDQxIEM0NDcuNTUzLDI4LjQzNiA0MzMuNTA0LDE5LjgyMiA0MTYuOTM4LDEzLjM4NSBDNDAwLjkxNCw3LjE1NyAzODIuNjAxLDIuODk4IDM1NS43ODcsMS42NzUgQzMyOC45MTcsMC40NDkgMzIwLjMzOCwwLjE1OSAyNTEuOTIxLDAuMTU5IFogTTI1MS45MjEsNDUuNTUgQzMxOS4xODYsNDUuNTUgMzI3LjE1NCw0NS44MDcgMzUzLjcxOCw0Ny4wMTkgQzM3OC4yOCw0OC4xMzkgMzkxLjYxOSw1Mi4yNDMgNDAwLjQ5Niw1NS42OTMgQzQxMi4yNTUsNjAuMjYzIDQyMC42NDcsNjUuNzIyIDQyOS40NjIsNzQuNTM4IEM0MzguMjc4LDgzLjM1MyA0NDMuNzM3LDkxLjc0NSA0NDguMzA3LDEwMy41MDQgQzQ1MS43NTcsMTEyLjM4MSA0NTUuODYxLDEyNS43MiA0NTYuOTgxLDE1MC4yODIgQzQ1OC4xOTMsMTc2Ljg0NiA0NTguNDUsMTg0LjgxNCA0NTguNDUsMjUyLjA4IEM0NTguNDUsMzE5LjM0NSA0NTguMTkzLDMyNy4zMTMgNDU2Ljk4MSwzNTMuODc3IEM0NTUuODYxLDM3OC40MzkgNDUxLjc1NywzOTEuNzc4IDQ0OC4zMDcsNDAwLjY1NSBDNDQzLjczNyw0MTIuNDE0IDQzOC4yNzgsNDIwLjgwNiA0MjkuNDYyLDQyOS42MjEgQzQyMC42NDcsNDM4LjQzNyA0MTIuMjU1LDQ0My44OTYgNDAwLjQ5Niw0NDguNDY2IEMzOTEuNjE5LDQ1MS45MTYgMzc4LjI4LDQ1Ni4wMiAzNTMuNzE4LDQ1Ny4xNCBDMzI3LjE1OCw0NTguMzUyIDMxOS4xOTEsNDU4LjYwOSAyNTEuOTIxLDQ1OC42MDkgQzE4NC42NSw0NTguNjA5IDE3Ni42ODQsNDU4LjM1MiAxNTAuMTIzLDQ1Ny4xNCBDMTI1LjU2MSw0NTYuMDIgMTEyLjIyMiw0NTEuOTE2IDEwMy4zNDUsNDQ4LjQ2NiBDOTEuNTg2LDQ0My44OTYgODMuMTk0LDQzOC40MzcgNzQuMzc5LDQyOS42MjEgQzY1LjU2NCw0MjAuODA2IDYwLjEwNCw0MTIuNDE0IDU1LjUzNCw0MDAuNjU1IEM1Mi4wODQsMzkxLjc3OCA0Ny45OCwzNzguNDM5IDQ2Ljg2LDM1My44NzcgQzQ1LjY0OCwzMjcuMzEzIDQ1LjM5MSwzMTkuMzQ1IDQ1LjM5MSwyNTIuMDggQzQ1LjM5MSwxODQuODE0IDQ1LjY0OCwxNzYuODQ2IDQ2Ljg2LDE1MC4yODIgQzQ3Ljk4LDEyNS43MiA1Mi4wODQsMTEyLjM4MSA1NS41MzQsMTAzLjUwNCBDNjAuMTA0LDkxLjc0NSA2NS41NjMsODMuMzUzIDc0LjM3OSw3NC41MzggQzgzLjE5NCw2NS43MjIgOTEuNTg2LDYwLjI2MyAxMDMuMzQ1LDU1LjY5MyBDMTEyLjIyMiw1Mi4yNDMgMTI1LjU2MSw0OC4xMzkgMTUwLjEyMyw0Ny4wMTkgQzE3Ni42ODcsNDUuODA3IDE4NC42NTUsNDUuNTUgMjUxLjkyMSw0NS41NSBaIiBpZD0iRmlsbC0xIiBmaWxsPSIjRkZGRkZGIiBtYXNrPSJ1cmwoI21hc2stMikiPjwvcGF0aD4gICAgICAgIDwvZz4gICAgICAgIDxwYXRoIGQ9Ik0yNTEuOTIxLDMzNi4wNTMgQzIwNS41NDMsMzM2LjA1MyAxNjcuOTQ3LDI5OC40NTcgMTY3Ljk0NywyNTIuMDggQzE2Ny45NDcsMjA1LjcwMiAyMDUuNTQzLDE2OC4xMDYgMjUxLjkyMSwxNjguMTA2IEMyOTguMjk4LDE2OC4xMDYgMzM1Ljg5NCwyMDUuNzAyIDMzNS44OTQsMjUyLjA4IEMzMzUuODk0LDI5OC40NTcgMjk4LjI5OCwzMzYuMDUzIDI1MS45MjEsMzM2LjA1MyBaIE0yNTEuOTIxLDEyMi43MTUgQzE4MC40NzQsMTIyLjcxNSAxMjIuNTU2LDE4MC42MzMgMTIyLjU1NiwyNTIuMDggQzEyMi41NTYsMzIzLjUyNiAxODAuNDc0LDM4MS40NDQgMjUxLjkyMSwzODEuNDQ0IEMzMjMuMzY3LDM4MS40NDQgMzgxLjI4NSwzMjMuNTI2IDM4MS4yODUsMjUyLjA4IEMzODEuMjg1LDE4MC42MzMgMzIzLjM2NywxMjIuNzE1IDI1MS45MjEsMTIyLjcxNSBaIiBpZD0iRmlsbC00IiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+ICAgICAgICA8cGF0aCBkPSJNNDE2LjYyNywxMTcuNjA0IEM0MTYuNjI3LDEzNC4zIDQwMy4wOTIsMTQ3LjgzNCAzODYuMzk2LDE0Ny44MzQgQzM2OS43MDEsMTQ3LjgzNCAzNTYuMTY2LDEzNC4zIDM1Ni4xNjYsMTE3LjYwNCBDMzU2LjE2NiwxMDAuOTA4IDM2OS43MDEsODcuMzczIDM4Ni4zOTYsODcuMzczIEM0MDMuMDkyLDg3LjM3MyA0MTYuNjI3LDEwMC45MDggNDE2LjYyNywxMTcuNjA0IiBpZD0iRmlsbC01IiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+ICAgIDwvZz48L3N2Zz4=);\n\t\t}\n\n\t\t/* stylelint-disable-next-line no-descending-specificity */\n\t\t& .ck-media__placeholder__url__text {\n\t\t\tcolor: hsl(302, 100%, 94%);\n\n\t\t\t&:hover {\n\t\t\t\tcolor: hsl(0, 0%, 100%);\n\t\t\t}\n\t\t}\n\t}\n\n\t&[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder {\n\t\t/* Use gradient to contrast with focused widget (ckeditor/ckeditor5-media-embed#22). */\n\t\tbackground: linear-gradient( to right, hsl(201, 85%, 70%), hsl(201, 85%, 35%) );\n\n\t\t& .ck-media__placeholder__icon {\n\t\t\tbackground-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IldoaXRlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDQwMCA0MDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQwMCA0MDA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPi5zdDB7ZmlsbDojRkZGRkZGO308L3N0eWxlPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MDAsMjAwYzAsMTEwLjUtODkuNSwyMDAtMjAwLDIwMFMwLDMxMC41LDAsMjAwUzg5LjUsMCwyMDAsMFM0MDAsODkuNSw0MDAsMjAweiBNMTYzLjQsMzA1LjVjODguNywwLDEzNy4yLTczLjUsMTM3LjItMTM3LjJjMC0yLjEsMC00LjItMC4xLTYuMmM5LjQtNi44LDE3LjYtMTUuMywyNC4xLTI1Yy04LjYsMy44LTE3LjksNi40LTI3LjcsNy42YzEwLTYsMTcuNi0xNS40LDIxLjItMjYuN2MtOS4zLDUuNS0xOS42LDkuNS0zMC42LDExLjdjLTguOC05LjQtMjEuMy0xNS4yLTM1LjItMTUuMmMtMjYuNiwwLTQ4LjIsMjEuNi00OC4yLDQ4LjJjMCwzLjgsMC40LDcuNSwxLjMsMTFjLTQwLjEtMi03NS42LTIxLjItOTkuNC01MC40Yy00LjEsNy4xLTYuNSwxNS40LTYuNSwyNC4yYzAsMTYuNyw4LjUsMzEuNSwyMS41LDQwLjFjLTcuOS0wLjItMTUuMy0yLjQtMjEuOC02YzAsMC4yLDAsMC40LDAsMC42YzAsMjMuNCwxNi42LDQyLjgsMzguNyw0Ny4zYy00LDEuMS04LjMsMS43LTEyLjcsMS43Yy0zLjEsMC02LjEtMC4zLTkuMS0wLjljNi4xLDE5LjIsMjMuOSwzMy4xLDQ1LDMzLjVjLTE2LjUsMTIuOS0zNy4zLDIwLjYtNTkuOSwyMC42Yy0zLjksMC03LjctMC4yLTExLjUtMC43QzExMC44LDI5Ny41LDEzNi4yLDMwNS41LDE2My40LDMwNS41Ii8+PC9zdmc+);\n\t\t}\n\n\t\t& .ck-media__placeholder__url__text {\n\t\t\tcolor: hsl(201, 100%, 86%);\n\n\t\t\t&:hover {\n\t\t\t\tcolor: hsl(0, 0%, 100%);\n\t\t\t}\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".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%}}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaform.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css"],names:[],mappings:"AAOA,kBACC,YAAa,CACb,sBAAuB,CACvB,kBAAmB,CACnB,gBAqBD,CAnBC,yCACC,oBACD,CAEA,4BACC,YACD,CCbA,oCDCD,kBAeE,cAUF,CARE,yCACC,eACD,CAEA,6BACC,cACD,CCtBD",sourcesContent:['/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n\n.ck.ck-media-form {\n\tdisplay: flex;\n\talign-items: flex-start;\n\tflex-direction: row;\n\tflex-wrap: nowrap;\n\n\t& .ck-labeled-field-view {\n\t\tdisplay: inline-block;\n\t}\n\n\t& .ck-label {\n\t\tdisplay: none;\n\t}\n\n\t@mixin ck-media-phone {\n\t\tflex-wrap: wrap;\n\n\t\t& .ck-labeled-field-view {\n\t\t\tflex-basis: 100%;\n\t\t}\n\n\t\t& .ck-button {\n\t\t\tflex-basis: 50%;\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".ck-content .media{clear:both;margin:.9em 0;display:block;min-width:15em}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaembed.css"],names:[],mappings:"AAKA,mBAGC,UAAW,CAKX,aAAe,CAIf,aAAc,CAId,cACD",sourcesContent:['/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content .media {\n\t/* Don\'t allow floated content overlap the media.\n\thttps://github.com/ckeditor/ckeditor5-media-embed/issues/53 */\n\tclear: both;\n\n\t/* Make sure there is some space between the content and the media. */\n\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\n\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\n\tmargin: 0.9em 0;\n\n\t/* Make sure media is not overriden with Bootstrap default `flex` value.\n\tSee: https://github.com/ckeditor/ckeditor5/issues/1373. */\n\tdisplay: block;\n\n\t/* Give the media some minimal width in the content to prevent them\n\tfrom being "squashed" in tight spaces, e.g. in table cells (#44) */\n\tmin-width: 15em;\n}\n'],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,'.ck-source-editing-area{position:relative;overflow:hidden}.ck-source-editing-area:after,.ck-source-editing-area textarea{padding:var(--ck-spacing-large);margin:0;border:1px solid transparent;line-height:var(--ck-line-height-base);font-size:var(--ck-font-size-normal);font-family:monospace;white-space:pre-wrap}.ck-source-editing-area:after{content:attr(data-value) " ";visibility:hidden;display:block}.ck-source-editing-area textarea{position:absolute;width:100%;height:100%;resize:none;outline:none;overflow:hidden;box-sizing:border-box;border-color:var(--ck-color-base-border);border-radius:0}.ck-rounded-corners .ck-source-editing-area textarea,.ck-source-editing-area textarea.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck-source-editing-area textarea:not([readonly]):focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-source-editing/theme/sourceediting.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],names:[],mappings:"AASA,wBACC,iBAAkB,CAClB,eACD,CAEA,+DAEC,+BAAgC,CAChC,QAAS,CACT,4BAA6B,CAC7B,sCAAuC,CACvC,oCAAqC,CACrC,qBAAsB,CACtB,oBACD,CAEA,8BACC,4BAA6B,CAC7B,iBAAkB,CAClB,aACD,CAEA,iCACC,iBAAkB,CAClB,UAAW,CACX,WAAY,CACZ,WAAY,CACZ,YAAa,CACb,eAAgB,CAChB,qBAAsB,CAEtB,wCAAyC,CC7BzC,eDwCD,CApBA,yGChBE,qCAAsC,CD4BtC,wBAAyB,CACzB,yBAOF,CAJC,uDErCA,YAAa,CACb,2BAA2B,CCF3B,qCHyCA",sourcesContent:['/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css";\n@import "@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css";\n@import "@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css";\n\n.ck-source-editing-area {\n\tposition: relative;\n\toverflow: hidden;\n}\n\n.ck-source-editing-area::after,\n.ck-source-editing-area textarea {\n\tpadding: var(--ck-spacing-large);\n\tmargin: 0;\n\tborder: 1px solid transparent;\n\tline-height: var(--ck-line-height-base);\n\tfont-size: var(--ck-font-size-normal);\n\tfont-family: monospace;\n\twhite-space: pre-wrap;\n}\n\n.ck-source-editing-area::after {\n\tcontent: attr(data-value) " ";\n\tvisibility: hidden;\n\tdisplay: block;\n}\n\n.ck-source-editing-area textarea {\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\tresize: none;\n\toutline: none;\n\toverflow: hidden;\n\tbox-sizing: border-box;\n\n\tborder-color: var(--ck-color-base-border);\n\n\t@mixin ck-rounded-corners {\n\t\tborder-top-left-radius: 0;\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t&:not([readonly]):focus {\n\t\t@mixin ck-focus-ring;\n\t\t@mixin ck-box-shadow var(--ck-inner-shadow);\n\t}\n}\n',"/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A visual style of focused element's border.\n */\n@define-mixin ck-focus-ring {\n\t/* Disable native outline. */\n\toutline: none;\n\tborder: var(--ck-focus-ring)\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,":root{--ck-color-table-focused-cell-background:rgba(158,207,250,0.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tableediting.css"],names:[],mappings:"AAKA,MACC,8DACD,CAKE,8QAGC,wDAAyD,CAKzD,iBAAkB,CAClB,8CAA+C,CAC/C,mBACD",sourcesContent:["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-table-focused-cell-background: hsla(208, 90%, 80%, .3);\n}\n\n.ck-widget.table {\n\t& td,\n\t& th {\n\t\t&.ck-editor__nested-editable.ck-editor__nested-editable_focused,\n\t\t&.ck-editor__nested-editable:focus {\n\t\t\t/* A very slight background to highlight the focused cell */\n\t\t\tbackground: var(--ck-color-table-focused-cell-background);\n\n\t\t\t/* Fixes the problem where surrounding cells cover the focused cell's border.\n\t\t\tIt does not fix the problem in all places but the UX is improved.\n\t\t\tSee https://github.com/ckeditor/ckeditor5-table/issues/29. */\n\t\t\tborder-style: none;\n\t\t\toutline: 1px solid var(--ck-color-focus-border);\n\t\t\toutline-offset: -1px; /* progressive enhancement - no IE support */\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-color-base-border);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-color-focus-border);background:var(--ck-color-focus-outer-shadow)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/inserttable.css"],names:[],mappings:"AAKA,oCACC,YAAa,CACb,kBAAmB,CACnB,cACD,CCJA,MACC,uCAAwC,CACxC,0CAA2C,CAC3C,yCAA0C,CAC1C,yCACD,CAEA,oCAEC,oJAA2J,CAC3J,yFACD,CAEA,qCACC,iBACD,CAEA,uCACC,+CAAgD,CAChD,iDAAkD,CAClD,iDAAkD,CAClD,4CAA6C,CAC7C,iBAMD,CAJC,6CACC,yCAA0C,CAC1C,6CACD",sourcesContent:["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-insert-table-dropdown__grid {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: wrap;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-insert-table-dropdown-padding: 10px;\n\t--ck-insert-table-dropdown-box-height: 11px;\n\t--ck-insert-table-dropdown-box-width: 12px;\n\t--ck-insert-table-dropdown-box-margin: 1px;\n}\n\n.ck .ck-insert-table-dropdown__grid {\n\t/* The width of a container should match 10 items in a row so there will be a 10x10 grid. */\n\twidth: calc(var(--ck-insert-table-dropdown-box-width) * 10 + var(--ck-insert-table-dropdown-box-margin) * 20 + var(--ck-insert-table-dropdown-padding) * 2);\n\tpadding: var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0;\n}\n\n.ck .ck-insert-table-dropdown__label {\n\ttext-align: center;\n}\n\n.ck .ck-insert-table-dropdown-grid-box {\n\twidth: var(--ck-insert-table-dropdown-box-width);\n\theight: var(--ck-insert-table-dropdown-box-height);\n\tmargin: var(--ck-insert-table-dropdown-box-margin);\n\tborder: 1px solid var(--ck-color-base-border);\n\tborder-radius: 1px;\n\n\t&.ck-on {\n\t\tborder-color: var(--ck-color-focus-border);\n\t\tbackground: var(--ck-color-focus-outer-shadow);\n\t}\n}\n\n"],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,':root{--ck-table-selected-cell-background:rgba(158,207,250,0.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{position:relative;caret-color:transparent;outline:unset;box-shadow:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{content:"";pointer-events:none;background-color:var(--ck-table-selected-cell-background);position:absolute;top:0;left:0;right:0;bottom:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget{outline:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle{display:none}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tableselection.css"],names:[],mappings:"AAKA,MACC,yDACD,CAGC,0IAEC,iBAAkB,CAClB,uBAAwB,CACxB,aAAc,CACd,gBA8BD,CA3BC,sJACC,UAAW,CACX,mBAAoB,CACpB,yDAA0D,CAC1D,iBAAkB,CAClB,KAAM,CACN,MAAO,CACP,OAAQ,CACR,QACD,CAEA,wTAEC,4BACD,CAMA,gKACC,aAKD,CAHC,0NACC,YACD",sourcesContent:["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-table-selected-cell-background: hsla(208, 90%, 80%, .3);\n}\n\n.ck.ck-editor__editable .table table {\n\t& td.ck-editor__editable_selected,\n\t& th.ck-editor__editable_selected {\n\t\tposition: relative;\n\t\tcaret-color: transparent;\n\t\toutline: unset;\n\t\tbox-shadow: unset;\n\n\t\t/* https://github.com/ckeditor/ckeditor5/issues/6446 */\n\t\t&:after {\n\t\t\tcontent: '';\n\t\t\tpointer-events: none;\n\t\t\tbackground-color: var(--ck-table-selected-cell-background);\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t}\n\n\t\t& ::selection,\n\t\t&:focus {\n\t\t\tbackground-color: transparent;\n\t\t}\n\n\t\t/*\n\t\t * To reduce the amount of noise, all widgets in the table selection have no outline and no selection handle.\n\t\t * See https://github.com/ckeditor/ckeditor5/issues/9491.\n\t\t */\n\t\t& .ck-widget {\n\t\t\toutline: unset;\n\n\t\t\t& > .ck-widget__selection-handle {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,".ck-content .table{margin:.9em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;width:100%;height:100%;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border:1px solid #bfbfbf}.ck-content .table table th{font-weight:700;background:hsla(0,0%,0%,5%)}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}.ck-editor__editable .ck-table-bogus-paragraph{display:inline-block;width:100%}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-table/theme/table.css"],names:[],mappings:"AAKA,mBAIC,gBAAkB,CAClB,aAgCD,CA9BC,yBAEC,wBAAyB,CACzB,gBAAiB,CAIjB,UAAW,CACX,WAAY,CAIZ,yBAiBD,CAfC,wDAEC,aAAc,CACd,YAAa,CAKb,wBACD,CAEA,4BACC,eAAiB,CACjB,2BACD,CAMF,+BACC,gBACD,CAEA,+BACC,eACD,CAEA,+CAKC,oBAAqB,CAMrB,UACD",sourcesContent:['/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content .table {\n\t/* Give the table widget some air and center it horizontally */\n\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\n\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\n\tmargin: 0.9em auto;\n\tdisplay: table;\n\n\t& table {\n\t\t/* The table cells should have slight borders */\n\t\tborder-collapse: collapse;\n\t\tborder-spacing: 0;\n\n\t\t/* Table width and height are set on the parent
    . Make sure the table inside stretches\n\t\tto the full dimensions of the container (https://github.com/ckeditor/ckeditor5/issues/6186). */\n\t\twidth: 100%;\n\t\theight: 100%;\n\n\t\t/* The outer border of the table should be slightly darker than the inner lines.\n\t\tAlso see https://github.com/ckeditor/ckeditor5-table/issues/50. */\n\t\tborder: 1px double hsl(0, 0%, 70%);\n\n\t\t& td,\n\t\t& th {\n\t\t\tmin-width: 2em;\n\t\t\tpadding: .4em;\n\n\t\t\t/* The border is inherited from .ck-editor__nested-editable styles, so theoretically it\'s not necessary here.\n\t\t\tHowever, the border is a content style, so it should use .ck-content (so it works outside the editor).\n\t\t\tHence, the duplication. See https://github.com/ckeditor/ckeditor5/issues/6314 */\n\t\t\tborder: 1px solid hsl(0, 0%, 75%);\n\t\t}\n\n\t\t& th {\n\t\t\tfont-weight: bold;\n\t\t\tbackground: hsla(0, 0%, 0%, 5%);\n\t\t}\n\t}\n}\n\n/* Text alignment of the table header should match the editor settings and override the native browser styling,\nwhen content is available outside the ediitor. See https://github.com/ckeditor/ckeditor5/issues/6638 */\n.ck-content[dir="rtl"] .table th {\n\ttext-align: right;\n}\n\n.ck-content[dir="ltr"] .table th {\n\ttext-align: left;\n}\n\n.ck-editor__editable .ck-table-bogus-paragraph {\n\t/*\n\t * Use display:inline-block to force Chrome/Safari to limit text mutations to this element.\n\t * See https://github.com/ckeditor/ckeditor5/issues/6062.\n\t */\n\tdisplay: inline-block;\n\n\t/*\n\t * Inline HTML elements nested in the span should always be dimensioned in relation to the whole cell width.\n\t * See https://github.com/ckeditor/ckeditor5/issues/9117.\n\t */\n\twidth: 100%;\n}\n'],sourceRoot:""}]);e["a"]=a},function(t,e,n){"use strict";var i=n(2);var o=n.n(i);var r=n(3);var s=n.n(r);var a=s()(o.a);a.push([t.i,':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)}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-list/theme/todolist.css"],names:[],mappings:"AAKA,MACC,kCACD,CAEA,uBACC,eA0ED,CAxEC,0BACC,iBAKD,CAHC,qCACC,cACD,CAIA,+CACC,uBAAwB,CACxB,oBAAqB,CACrB,iBAAkB,CAClB,wCAAyC,CACzC,yCAA0C,CAC1C,qBAAsB,CAGtB,QAAS,CAGT,UAAW,CACX,kBAAmB,CACnB,OAAQ,CACR,aA0CD,CAxCC,sDACC,aAAc,CACd,iBAAkB,CAClB,qBAAsB,CACtB,UAAW,CACX,UAAW,CACX,WAAY,CACZ,qBAAiC,CACjC,iBAAkB,CAClB,0FACD,CAEA,qDACC,aAAc,CACd,iBAAkB,CAClB,sBAAuB,CACvB,mBAAoB,CACpB,UAAW,CAGX,+CAAoD,CACpD,gDAAqD,CACrD,kDAAuD,CACvD,mDAAwD,CAGxD,+BAA+G,CAA/G,0EAA+G,CAA/G,yEAA+G,CAA/G,8BAA+G,CAC/G,uBACD,CAGC,+DACC,kBAA8B,CAC9B,oBACD,CAEA,8DACC,iBACD,CAIF,wEACC,qBACD,CAKF,6CACC,MAAO,CACP,cAAe,CACf,WAAY,CACZ,iBACD,CAMA,wDACC,cAKD,CAHC,qEACC,mCACD",sourcesContent:["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-todo-list-checkmark-size: 16px;\n}\n\n.ck-content .todo-list {\n\tlist-style: none;\n\n\t& li {\n\t\tmargin-bottom: 5px;\n\n\t\t& .todo-list {\n\t\t\tmargin-top: 5px;\n\t\t}\n\t}\n\n\t& .todo-list__label {\n\t\t& > input {\n\t\t\t-webkit-appearance: none;\n\t\t\tdisplay: inline-block;\n\t\t\tposition: relative;\n\t\t\twidth: var(--ck-todo-list-checkmark-size);\n\t\t\theight: var(--ck-todo-list-checkmark-size);\n\t\t\tvertical-align: middle;\n\n\t\t\t/* Needed on iOS */\n\t\t\tborder: 0;\n\n\t\t\t/* LTR styles */\n\t\t\tleft: -25px;\n\t\t\tmargin-right: -15px;\n\t\t\tright: 0;\n\t\t\tmargin-left: 0;\n\n\t\t\t&::before {\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tcontent: '';\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tborder: 1px solid hsl(0, 0%, 20%);\n\t\t\t\tborder-radius: 2px;\n\t\t\t\ttransition: 250ms ease-in-out box-shadow, 250ms ease-in-out background, 250ms ease-in-out border;\n\t\t\t}\n\n\t\t\t&::after {\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\tbox-sizing: content-box;\n\t\t\t\tpointer-events: none;\n\t\t\t\tcontent: '';\n\n\t\t\t\t/* Calculate tick position, size and border-width proportional to the checkmark size. */\n\t\t\t\tleft: calc( var(--ck-todo-list-checkmark-size) / 3 );\n\t\t\t\ttop: calc( var(--ck-todo-list-checkmark-size) / 5.3 );\n\t\t\t\twidth: calc( var(--ck-todo-list-checkmark-size) / 5.3 );\n\t\t\t\theight: calc( var(--ck-todo-list-checkmark-size) / 2.6 );\n\t\t\t\tborder-style: solid;\n\t\t\t\tborder-color: transparent;\n\t\t\t\tborder-width: 0 calc( var(--ck-todo-list-checkmark-size) / 8 ) calc( var(--ck-todo-list-checkmark-size) / 8 ) 0;\n\t\t\t\ttransform: rotate(45deg);\n\t\t\t}\n\n\t\t\t&[checked] {\n\t\t\t\t&::before {\n\t\t\t\t\tbackground: hsl(126, 64%, 41%);\n\t\t\t\t\tborder-color: hsl(126, 64%, 41%);\n\t\t\t\t}\n\n\t\t\t\t&::after {\n\t\t\t\t\tborder-color: hsl(0, 0%, 100%);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t& .todo-list__label__description {\n\t\t\tvertical-align: middle;\n\t\t}\n\t}\n}\n\n/* RTL styles */\n[dir=\"rtl\"] .todo-list .todo-list__label > input {\n\tleft: 0;\n\tmargin-right: 0;\n\tright: -25px;\n\tmargin-left: -15px;\n}\n\n/*\n * To-do list should be interactive only during the editing\n * (https://github.com/ckeditor/ckeditor5/issues/2090).\n */\n.ck-editor__editable .todo-list .todo-list__label > input {\n\tcursor: pointer;\n\n\t&:hover::before {\n\t\tbox-shadow: 0 0 0 5px hsla(0, 0%, 0%, 0.1);\n\t}\n}\n"],sourceRoot:""}]);e["a"]=a},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){if(typeof window==="object")n=window}t.exports=n},function(t,e,n){"use strict";function i(){return false}e["a"]=i},function(t,e){},function(t,e,n){"use strict";n.r(e);function i(){return function t(){t.called=true}}var o=i;class r{constructor(t,e){this.source=t;this.name=e;this.path=[];this.stop=o();this.off=o()}}const s=new Array(256).fill().map(((t,e)=>("0"+e.toString(16)).slice(-2)));function a(){const t=Math.random()*4294967296>>>0;const e=Math.random()*4294967296>>>0;const n=Math.random()*4294967296>>>0;const i=Math.random()*4294967296>>>0;return"e"+s[t>>0&255]+s[t>>8&255]+s[t>>16&255]+s[t>>24&255]+s[e>>0&255]+s[e>>8&255]+s[e>>16&255]+s[e>>24&255]+s[n>>0&255]+s[n>>8&255]+s[n>>16&255]+s[n>>24&255]+s[i>>0&255]+s[i>>8&255]+s[i>>16&255]+s[i>>24&255]}const c={get(t){if(typeof t!="number"){return this[t]||this.normal}else{return t}},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};var l=c;var d=n(8);var u=n(0);const h=Symbol("listeningTo");const f=Symbol("emitterId");const g={on(t,e,n={}){this.listenTo(this,t,e,n)},once(t,e,n){let i=false;const o=function(t,...n){if(!i){i=true;t.off();e.call(this,t,...n)}};this.listenTo(this,t,o,n)},off(t,e){this.stopListening(this,t,e)},listenTo(t,e,n,i={}){let o,r;if(!this[h]){this[h]={}}const s=this[h];if(!b(t)){k(t)}const a=b(t);if(!(o=s[a])){o=s[a]={emitter:t,callbacks:{}}}if(!(r=o.callbacks[e])){r=o.callbacks[e]=[]}r.push(n);x(this,t,e,n,i)},stopListening(t,e,n){const i=this[h];let o=t&&b(t);const r=i&&o&&i[o];const s=r&&e&&r.callbacks[e];if(!i||t&&!r||e&&!s){return}if(n){E(this,t,e,n);const i=s.indexOf(n);if(i!==-1){if(s.length===1){delete r.callbacks[e]}else{E(this,t,e,n)}}}else if(s){while(n=s.pop()){E(this,t,e,n)}delete r.callbacks[e]}else if(r){for(e in r.callbacks){this.stopListening(t,e)}delete i[o]}else{for(o in i){this.stopListening(i[o].emitter)}delete this[h]}},fire(t,...e){try{const n=t instanceof r?t:new r(this,t);const i=n.name;let o=_(this,i);n.path.push(this);if(o){const t=[n,...e];o=Array.from(o);for(let e=0;e{if(!this._delegations){this._delegations=new Map}t.forEach((t=>{const i=this._delegations.get(t);if(!i){this._delegations.set(t,new Map([[e,n]]))}else{i.set(e,n)}}))}}},stopDelegating(t,e){if(!this._delegations){return}if(!t){this._delegations.clear()}else if(!e){this._delegations.delete(t)}else{const n=this._delegations.get(t);if(n){n.delete(e)}}},_addEventListener(t,e,n){C(this,t);const i=v(this,t);const o=l.get(n.priority);const r={callback:e,priority:o};for(const t of i){let e=false;for(let n=0;n-1){return _(t,e.substr(0,e.lastIndexOf(":")))}else{return null}}return n.callbacks}function y(t,e,n){for(let[i,o]of t){if(!o){o=e.name}else if(typeof o=="function"){o=o(e.name)}const t=new r(e.source,o);t.path=[...e.path];i.fire(t,...n)}}function x(t,e,n,i,o){if(e._addEventListener){e._addEventListener(n,i,o)}else{t._addEventListener.call(e,n,i,o)}}function E(t,e,n,i){if(e._removeEventListener){e._removeEventListener(n,i)}else{t._removeEventListener.call(e,n,i)}}function D(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var S=D;var T=n(5);var I=T["a"].Symbol;var M=I;var B=Object.prototype;var N=B.hasOwnProperty;var z=B.toString;var P=M?M.toStringTag:undefined;function L(t){var e=N.call(t,P),n=t[P];try{t[P]=undefined;var i=true}catch(t){}var o=z.call(t);if(i){if(e){t[P]=n}else{delete t[P]}}return o}var R=L;var O=Object.prototype;var j=O.toString;function F(t){return j.call(t)}var V=F;var U="[object Null]",H="[object Undefined]";var q=M?M.toStringTag:undefined;function W(t){if(t==null){return t===undefined?H:U}return q&&q in Object(t)?R(t):V(t)}var G=W;var K="[object AsyncFunction]",$="[object Function]",Y="[object GeneratorFunction]",Q="[object Proxy]";function Z(t){if(!S(t)){return false}var e=G(t);return e==$||e==Y||e==K||e==Q}var J=Z;var X=T["a"]["__core-js_shared__"];var tt=X;var et=function(){var t=/[^.]+$/.exec(tt&&tt.keys&&tt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function nt(t){return!!et&&et in t}var it=nt;var ot=Function.prototype;var rt=ot.toString;function st(t){if(t!=null){try{return rt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var at=st;var ct=/[\\^$.*+?()[\]{}|]/g;var lt=/^\[object .+?Constructor\]$/;var dt=Function.prototype,ut=Object.prototype;var ht=dt.toString;var ft=ut.hasOwnProperty;var gt=RegExp("^"+ht.call(ft).replace(ct,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mt(t){if(!S(t)||it(t)){return false}var e=J(t)?gt:lt;return e.test(at(t))}var pt=mt;function kt(t,e){return t==null?undefined:t[e]}var bt=kt;function wt(t,e){var n=bt(t,e);return pt(n)?n:undefined}var At=wt;var Ct=function(){try{var t=At(Object,"defineProperty");t({},"",{});return t}catch(t){}}();var vt=Ct;function _t(t,e,n){if(e=="__proto__"&&vt){vt(t,e,{configurable:true,enumerable:true,value:n,writable:true})}else{t[e]=n}}var yt=_t;function xt(t,e){return t===e||t!==t&&e!==e}var Et=xt;var Dt=Object.prototype;var St=Dt.hasOwnProperty;function Tt(t,e,n){var i=t[e];if(!(St.call(t,e)&&Et(i,n))||n===undefined&&!(e in t)){yt(t,e,n)}}var It=Tt;function Mt(t,e,n,i){var o=!n;n||(n={});var r=-1,s=e.length;while(++r0){if(++e>=qt){return arguments[0]}}else{e=0}return t.apply(undefined,arguments)}}var $t=Kt;var Yt=$t(Ht);var Qt=Yt;function Zt(t,e){return Qt(jt(t,e,zt),t+"")}var Jt=Zt;var Xt=9007199254740991;function te(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Xt}var ee=te;function ne(t){return t!=null&&ee(t.length)&&!J(t)}var ie=ne;var oe=9007199254740991;var re=/^(?:0|[1-9]\d*)$/;function se(t,e){var n=typeof t;e=e==null?oe:e;return!!e&&(n=="number"||n!="symbol"&&re.test(t))&&(t>-1&&t%1==0&&t1?n[o-1]:undefined,s=o>2?n[2]:undefined;r=t.length>3&&typeof r=="function"?(o--,r):undefined;if(s&&le(n[0],n[1],s)){r=o<3?undefined:r;o=1}e=Object(e);while(++i{this.set(e,t[e])}),this);return}Mn(this);const n=this[yn];if(t in this&&!n.has(t)){throw new u["a"]("observable-set-cannot-override",this)}Object.defineProperty(this,t,{enumerable:true,configurable:true,get(){return n.get(t)},set(e){const i=n.get(t);let o=this.fire("set:"+t,t,e,i);if(o===undefined){o=e}if(i!==o||!n.has(t)){n.set(t,o);this.fire("change:"+t,t,o,i)}}});this[t]=e},bind(...t){if(!t.length||!Pn(t)){throw new u["a"]("observable-bind-wrong-properties",this)}if(new Set(t).size!==t.length){throw new u["a"]("observable-bind-duplicate-properties",this)}Mn(this);const e=this[En];t.forEach((t=>{if(e.has(t)){throw new u["a"]("observable-bind-rebind",this)}}));const n=new Map;t.forEach((t=>{const i={property:t,to:[]};e.set(t,i);n.set(t,i)}));return{to:Bn,toMany:Nn,_observable:this,_bindProperties:t,_to:[],_bindings:n}},unbind(...t){if(!this[yn]){return}const e=this[En];const n=this[xn];if(t.length){if(!Pn(t)){throw new u["a"]("observable-unbind-wrong-properties",this)}t.forEach((t=>{const i=e.get(t);if(!i){return}let o,r,s,a;i.to.forEach((t=>{o=t[0];r=t[1];s=n.get(o);a=s[r];a.delete(i);if(!a.size){delete s[r]}if(!Object.keys(s).length){n.delete(o);this.stopListening(o,"change")}}));e.delete(t)}))}else{n.forEach(((t,e)=>{this.stopListening(e,"change")}));n.clear();e.clear()}},decorate(t){const e=this[t];if(!e){throw new u["a"]("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:t})}this.on(t,((t,n)=>{t.return=e.apply(this,n)}));this[t]=function(...e){return this.fire(t,e)};this[t][Sn]=e;if(!this[Dn]){this[Dn]=[]}this[Dn].push(t)}};_n(Tn,m);Tn.stopListening=function(t,e,n){if(!t&&this[Dn]){for(const t of this[Dn]){this[t]=this[t][Sn]}delete this[Dn]}m.stopListening.call(this,t,e,n)};var In=Tn;function Mn(t){if(t[yn]){return}Object.defineProperty(t,yn,{value:new Map});Object.defineProperty(t,xn,{value:new Map});Object.defineProperty(t,En,{value:new Map})}function Bn(...t){const e=Ln(...t);const n=Array.from(this._bindings.keys());const i=n.length;if(!e.callback&&e.to.length>1){throw new u["a"]("observable-bind-to-no-callback",this)}if(i>1&&e.callback){throw new u["a"]("observable-bind-to-extra-callback",this)}e.to.forEach((t=>{if(t.properties.length&&t.properties.length!==i){throw new u["a"]("observable-bind-to-properties-length",this)}if(!t.properties.length){t.properties=this._bindProperties}}));this._to=e.to;if(e.callback){this._bindings.get(n[0]).callback=e.callback}Fn(this._observable,this._to);On(this);this._bindProperties.forEach((t=>{jn(this._observable,t)}))}function Nn(t,e,n){if(this._bindings.size>1){throw new u["a"]("observable-bind-to-many-not-one-binding",this)}this.to(...zn(t,e),n)}function zn(t,e){const n=t.map((t=>[t,e]));return Array.prototype.concat.apply([],n)}function Pn(t){return t.every((t=>typeof t=="string"))}function Ln(...t){if(!t.length){throw new u["a"]("observable-bind-to-parse-error",null)}const e={to:[]};let n;if(typeof t[t.length-1]=="function"){e.callback=t.pop()}t.forEach((t=>{if(typeof t=="string"){n.properties.push(t)}else if(typeof t=="object"){n={observable:t,properties:[]};e.to.push(n)}else{throw new u["a"]("observable-bind-to-parse-error",null)}}));return e}function Rn(t,e,n,i){const o=t[xn];const r=o.get(n);const s=r||{};if(!s[i]){s[i]=new Set}s[i].add(e);if(!r){o.set(n,s)}}function On(t){let e;t._bindings.forEach(((n,i)=>{t._to.forEach((o=>{e=o.properties[n.callback?0:t._bindProperties.indexOf(i)];n.to.push([o.observable,e]);Rn(t._observable,n,o.observable,e)}))}))}function jn(t,e){const n=t[En];const i=n.get(e);let o;if(i.callback){o=i.callback.apply(t,i.to.map((t=>t[0][t[1]])))}else{o=i.to[0];o=o[0][o[1]]}if(Object.prototype.hasOwnProperty.call(t,e)){t[e]=o}else{t.set(e,o)}}function Fn(t,e){e.forEach((e=>{const n=t[xn];let i;if(!n.get(e.observable)){t.listenTo(e.observable,"change",((o,r)=>{i=n.get(e.observable)[r];if(i){i.forEach((e=>{jn(t,e.property)}))}}))}}))}function Vn(t,...e){e.forEach((e=>{Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e)).forEach((n=>{if(n in t.prototype){return}const i=Object.getOwnPropertyDescriptor(e,n);i.enumerable=false;Object.defineProperty(t.prototype,n,i)}))}))}class Un{constructor(t){this.editor=t;this.set("isEnabled",true);this._disableStack=new Set}forceDisabled(t){this._disableStack.add(t);if(this._disableStack.size==1){this.on("set:isEnabled",Hn,{priority:"highest"});this.isEnabled=false}}clearForceDisabled(t){this._disableStack.delete(t);if(this._disableStack.size==0){this.off("set:isEnabled",Hn);this.isEnabled=true}}destroy(){this.stopListening()}static get isContextPlugin(){return false}}Vn(Un,In);function Hn(t){t.return=false;t.stop()}class qn{constructor(t){this.editor=t;this.set("value",undefined);this.set("isEnabled",false);this.affectsData=true;this._disableStack=new Set;this.decorate("execute");this.listenTo(this.editor.model.document,"change",(()=>{this.refresh()}));this.on("execute",(t=>{if(!this.isEnabled){t.stop()}}),{priority:"high"});this.listenTo(t,"change:isReadOnly",((t,e,n)=>{if(n&&this.affectsData){this.forceDisabled("readOnlyMode")}else{this.clearForceDisabled("readOnlyMode")}}))}refresh(){this.isEnabled=true}forceDisabled(t){this._disableStack.add(t);if(this._disableStack.size==1){this.on("set:isEnabled",Wn,{priority:"highest"});this.isEnabled=false}}clearForceDisabled(t){this._disableStack.delete(t);if(this._disableStack.size==0){this.off("set:isEnabled",Wn);this.refresh()}}execute(){}destroy(){this.stopListening()}}Vn(qn,In);function Wn(t){t.return=false;t.stop()}class Gn extends qn{constructor(t){super(t);this._childCommands=[]}refresh(){}execute(...t){const e=this._getFirstEnabledCommand();return e!=null&&e.execute(t)}registerChildCommand(t){this._childCommands.push(t);t.on("change:isEnabled",(()=>this._checkEnabled()));this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){return this._childCommands.find((t=>t.isEnabled))}}function Kn(t,e){return function(n){return t(e(n))}}var $n=Kn;var Yn=$n(Object.getPrototypeOf,Object);var Qn=Yn;var Zn="[object Object]";var Jn=Function.prototype,Xn=Object.prototype;var ti=Jn.toString;var ei=Xn.hasOwnProperty;var ni=ti.call(Object);function ii(t){if(!me(t)||G(t)!=Zn){return false}var e=Qn(t);if(e===null){return true}var n=ei.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ti.call(n)==ni}var oi=ii;function ri(){this.__data__=[];this.size=0}var si=ri;function ai(t,e){var n=t.length;while(n--){if(Et(t[n][0],e)){return n}}return-1}var ci=ai;var li=Array.prototype;var di=li.splice;function ui(t){var e=this.__data__,n=ci(e,t);if(n<0){return false}var i=e.length-1;if(n==i){e.pop()}else{di.call(e,n,1)}--this.size;return true}var hi=ui;function fi(t){var e=this.__data__,n=ci(e,t);return n<0?undefined:e[n][1]}var gi=fi;function mi(t){return ci(this.__data__,t)>-1}var pi=mi;function ki(t,e){var n=this.__data__,i=ci(n,t);if(i<0){++this.size;n.push([t,e])}else{n[i][1]=e}return this}var bi=ki;function wi(t){var e=-1,n=t==null?0:t.length;this.clear();while(++e{this._setToTarget(t,i,e[i],n)}))}}function ma(t){return ua(t,pa)}function pa(t){return fa(t)?t:undefined}function ka(t){return!!(t&&t[Symbol.iterator])}class ba{constructor(t={},e={}){const n=ka(t);if(!n){e=t}this._items=[];this._itemMap=new Map;this._idProperty=e.idProperty||"id";this._bindToExternalToInternalMap=new WeakMap;this._bindToInternalToExternalMap=new WeakMap;this._skippedIndexesFromExternal=[];if(n){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(e===undefined){e=this._items.length}else if(e>this._items.length||e<0){throw new u["a"]("collection-add-item-invalid-index",this)}for(let n=0;n{this._setUpBindToBinding((e=>new t(e)))},using:t=>{if(typeof t=="function"){this._setUpBindToBinding((e=>t(e)))}else{this._setUpBindToBinding((e=>e[t]))}}}}_setUpBindToBinding(t){const e=this._bindToCollection;const n=(n,i,o)=>{const r=e._bindToCollection==this;const s=e._bindToInternalToExternalMap.get(i);if(r&&s){this._bindToExternalToInternalMap.set(i,s);this._bindToInternalToExternalMap.set(s,i)}else{const n=t(i);if(!n){this._skippedIndexesFromExternal.push(o);return}let r=o;for(const t of this._skippedIndexesFromExternal){if(o>t){r--}}for(const t of e._skippedIndexesFromExternal){if(r>=t){r++}}this._bindToExternalToInternalMap.set(i,n);this._bindToInternalToExternalMap.set(n,i);this.add(n,r);for(let t=0;t{const i=this._bindToExternalToInternalMap.get(e);if(i){this.remove(i)}this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce(((t,e)=>{if(ne){t.push(e)}return t}),[])}))}_getItemIdBeforeAdding(t){const e=this._idProperty;let n;if(e in t){n=t[e];if(typeof n!="string"){throw new u["a"]("collection-add-invalid-id",this)}if(this.get(n)){throw new u["a"]("collection-add-item-already-exists",this)}}else{t[e]=n=a()}return n}_remove(t){let e,n,i;let o=false;const r=this._idProperty;if(typeof t=="string"){n=t;i=this._itemMap.get(n);o=!i;if(i){e=this._items.indexOf(i)}}else if(typeof t=="number"){e=t;i=this._items[e];o=!i;if(i){n=i[r]}}else{i=t;n=i[r];e=this._items.indexOf(i);o=e==-1||!this._itemMap.get(n)}if(o){throw new u["a"]("collection-remove-404",this)}this._items.splice(e,1);this._itemMap.delete(n);const s=this._bindToInternalToExternalMap.get(i);this._bindToInternalToExternalMap.delete(i);this._bindToExternalToInternalMap.delete(s);this.fire("remove",i,e);return[i,e]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}Vn(ba,m);class wa{constructor(t,e=[],n=[]){this._context=t;this._plugins=new Map;this._availablePlugins=new Map;for(const t of e){if(t.pluginName){this._availablePlugins.set(t.pluginName,t)}}this._contextPlugins=new Map;for(const[t,e]of n){this._contextPlugins.set(t,e);this._contextPlugins.set(e,t);if(t.pluginName){this._availablePlugins.set(t.pluginName,t)}}}*[Symbol.iterator](){for(const t of this._plugins){if(typeof t[0]=="function"){yield t}}}get(t){const e=this._plugins.get(t);if(!e){let e=t;if(typeof t=="function"){e=t.pluginName||t.name}throw new u["a"]("plugincollection-plugin-not-loaded",this._context,{plugin:e})}return e}has(t){return this._plugins.has(t)}init(t,e=[],n=[]){const i=this;const o=this._context;f(t);m(t);const r=t.filter((t=>!d(t,e)));const s=[...g(r)];C(s,n);const a=w(s);return A(a,"init").then((()=>A(a,"afterInit"))).then((()=>a));function c(t){return typeof t==="function"}function l(t){return c(t)&&t.isContextPlugin}function d(t,e){return e.some((e=>{if(e===t){return true}if(h(t)===e){return true}if(h(e)===t){return true}return false}))}function h(t){return c(t)?t.pluginName||t.name:t}function f(t,e=new Set){t.forEach((t=>{if(!c(t)){return}if(e.has(t)){return}e.add(t);if(t.pluginName&&!i._availablePlugins.has(t.pluginName)){i._availablePlugins.set(t.pluginName,t)}if(t.requires){f(t.requires,e)}}))}function g(t,e=new Set){return t.map((t=>c(t)?t:i._availablePlugins.get(t))).reduce(((t,n)=>{if(e.has(n)){return t}e.add(n);if(n.requires){m(n.requires,n);g(n.requires,e).forEach((e=>t.add(e)))}return t.add(n)}),new Set)}function m(t,e=null){t.map((t=>c(t)?t:i._availablePlugins.get(t)||t)).forEach((t=>{p(t,e);k(t,e);b(t,e)}))}function p(t,e){if(c(t)){return}if(e){throw new u["a"]("plugincollection-soft-required",o,{missingPlugin:t,requiredBy:h(e)})}throw new u["a"]("plugincollection-plugin-not-found",o,{plugin:t})}function k(t,e){if(!l(e)){return}if(l(t)){return}throw new u["a"]("plugincollection-context-required",o,{plugin:h(t),requiredBy:h(e)})}function b(t,n){if(!n){return}if(!d(t,e)){return}throw new u["a"]("plugincollection-required",o,{plugin:h(t),requiredBy:h(n)})}function w(t){return t.map((t=>{const e=i._contextPlugins.get(t)||new t(o);i._add(t,e);return e}))}function A(t,e){return t.reduce(((t,n)=>{if(!n[e]){return t}if(i._contextPlugins.has(n)){return t}return t.then(n[e].bind(n))}),Promise.resolve())}function C(t,e){for(const n of e){if(typeof n!="function"){throw new u["a"]("plugincollection-replace-plugin-invalid-type",null,{pluginItem:n})}const e=n.pluginName;if(!e){throw new u["a"]("plugincollection-replace-plugin-missing-name",null,{pluginItem:n})}if(n.requires&&n.requires.length){throw new u["a"]("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:e})}const o=i._availablePlugins.get(e);if(!o){throw new u["a"]("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:e})}const r=t.indexOf(o);if(r===-1){if(i._contextPlugins.has(o)){return}throw new u["a"]("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:e})}if(o.requires&&o.requires.length){throw new u["a"]("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:e})}t.splice(r,1,n);i._availablePlugins.set(e,n)}}}destroy(){const t=[];for(const[,e]of this){if(typeof e.destroy=="function"&&!this._contextPlugins.has(e)){t.push(e.destroy())}}return Promise.all(t)}_add(t,e){this._plugins.set(t,e);const n=t.pluginName;if(!n){return}if(this._plugins.has(n)){throw new u["a"]("plugincollection-plugin-name-conflict",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:t})}this._plugins.set(n,e)}}Vn(wa,m);function Aa(t){return Array.isArray(t)?t:[t]}if(!window.CKEDITOR_TRANSLATIONS){window.CKEDITOR_TRANSLATIONS={}}function Ca(t,e,n){if(!window.CKEDITOR_TRANSLATIONS[t]){window.CKEDITOR_TRANSLATIONS[t]={}}const i=window.CKEDITOR_TRANSLATIONS[t];i.dictionary=i.dictionary||{};i.getPluralForm=n||i.getPluralForm;Object.assign(i.dictionary,e)}function va(t,e,n=1){if(typeof n!=="number"){throw new u["a"]("translation-service-quantity-not-a-number",null,{quantity:n})}const i=xa();if(i===1){t=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]}const o=e.id||e.string;if(i===0||!ya(t,o)){if(n!==1){return e.plural}return e.string}const r=window.CKEDITOR_TRANSLATIONS[t].dictionary;const s=window.CKEDITOR_TRANSLATIONS[t].getPluralForm||(t=>t===1?0:1);if(typeof r[o]==="string"){return r[o]}const a=Number(s(n));return r[o][a]}function _a(){window.CKEDITOR_TRANSLATIONS={}}function ya(t,e){return!!window.CKEDITOR_TRANSLATIONS[t]&&!!window.CKEDITOR_TRANSLATIONS[t].dictionary[e]}function xa(){return Object.keys(window.CKEDITOR_TRANSLATIONS).length}const Ea=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function Da(t){return Ea.includes(t)?"rtl":"ltr"}class Sa{constructor(t={}){this.uiLanguage=t.uiLanguage||"en";this.contentLanguage=t.contentLanguage||this.uiLanguage;this.uiLanguageDirection=Da(this.uiLanguage);this.contentLanguageDirection=Da(this.contentLanguage);this.t=(t,e)=>this._t(t,e)}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(t,e=[]){e=Aa(e);if(typeof t==="string"){t={string:t}}const n=!!t.plural;const i=n?e[0]:1;const o=va(this.uiLanguage,t,i);return Ta(o,e)}}function Ta(t,e){return t.replace(/%(\d+)/g,((t,n)=>nt.destroy()))).then((()=>this.plugins.destroy()))}_addEditor(t,e){if(this._contextOwner){throw new u["a"]("context-addeditor-private-context")}this.editors.add(t);if(e){this._contextOwner=t}}_removeEditor(t){if(this.editors.has(t)){this.editors.remove(t)}if(this._contextOwner===t){return this.destroy()}return Promise.resolve()}_getEditorConfig(){const t={};for(const e of this.config.names()){if(!["plugins","removePlugins","extraPlugins"].includes(e)){t[e]=this.config.get(e)}}return t}static create(t){return new Promise((e=>{const n=new this(t);e(n.initPlugins().then((()=>n)))}))}}class Ma{constructor(t){this.context=t}destroy(){this.stopListening()}static get isContextPlugin(){return true}}Vn(Ma,In);function Ba(t,e){const n=Math.min(t.length,e.length);for(let i=0;it.data.length){throw new u["a"]("view-textproxy-wrong-offsetintext",this)}if(n<0||e+n>t.data.length){throw new u["a"]("view-textproxy-wrong-length",this)}this.data=t.data.substring(e,e+n);this.offsetInText=e}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(t){return t==="$textProxy"||t==="view:$textProxy"||t==="textProxy"||t==="view:textProxy"}getAncestors(t={includeSelf:false,parentFirst:false}){const e=[];let n=t.includeSelf?this.textNode:this.parent;while(n!==null){e[t.parentFirst?"push":"unshift"](n);n=n.parent}return e}}function ja(t){const e=new Map;for(const n in t){e.set(n,t[n])}return e}function Fa(t){if(ka(t)){return new Map(t)}else{return ja(t)}}class Va{constructor(...t){this._patterns=[];this.add(...t)}add(...t){for(let e of t){if(typeof e=="string"||e instanceof RegExp){e={name:e}}this._patterns.push(e)}}match(...t){for(const e of t){for(const t of this._patterns){const n=Ua(e,t);if(n){return{element:e,pattern:t,match:n}}}}return null}matchAll(...t){const e=[];for(const n of t){for(const t of this._patterns){const i=Ua(n,t);if(i){e.push({element:n,pattern:t,match:i})}}}return e.length>0?e:null}getElementName(){if(this._patterns.length!==1){return null}const t=this._patterns[0];const e=t.name;return typeof t!="function"&&e&&!(e instanceof RegExp)?e:null}}function Ua(t,e){if(typeof e=="function"){return e(t)}const n={};if(e.name){n.name=Ha(e.name,t.name);if(!n.name){return null}}if(e.attributes){n.attributes=$a(e.attributes,t);if(!n.attributes){return null}}if(e.classes){n.classes=Ya(e.classes,t);if(!n.classes){return false}}if(e.styles){n.styles=Qa(e.styles,t);if(!n.styles){return false}}return n}function Ha(t,e){if(t instanceof RegExp){return!!e.match(t)}return t===e}function qa(t,e,n){const i=Wa(t);const o=Array.from(e);const r=[];i.forEach((([t,e])=>{o.forEach((i=>{if(Ga(t,i)&&Ka(e,i,n)){r.push(i)}}))}));if(!i.length||r.length{if(oi(t)){if(t.key===undefined||t.value===undefined){Object(u["b"])("matcher-pattern-missing-key-or-value",t)}return[t.key,t.value]}return[t,true]}))}if(oi(t)){return Object.entries(t)}return[[t,true]]}function Ga(t,e){return t===true||t===e||t instanceof RegExp&&e.match(t)}function Ka(t,e,n){if(t===true){return true}const i=n(e);return t===i||t instanceof RegExp&&!!String(i).match(t)}function $a(t,e){const n=new Set(e.getAttributeKeys());if(oi(t)){if(t.style!==undefined){Object(u["b"])("matcher-pattern-deprecated-attributes-style-key",t)}if(t.class!==undefined){Object(u["b"])("matcher-pattern-deprecated-attributes-class-key",t)}}else{n.delete("style");n.delete("class")}return qa(t,n,(t=>e.getAttribute(t)))}function Ya(t,e){return qa(t,e.getClassNames())}function Qa(t,e){return qa(t,e.getStyleNames(true),(t=>e.getStyle(t)))}var Za="[object Symbol]";function Ja(t){return typeof t=="symbol"||me(t)&&G(t)==Za}var Xa=Ja;var tc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ec=/^\w*$/;function nc(t,e){if(xe(t)){return false}var n=typeof t;if(n=="number"||n=="symbol"||n=="boolean"||t==null||Xa(t)){return true}return ec.test(t)||!tc.test(t)||e!=null&&t in Object(e)}var ic=nc;var oc="Expected a function";function rc(t,e){if(typeof t!="function"||e!=null&&typeof e!="function"){throw new TypeError(oc)}var n=function(){var i=arguments,o=e?e.apply(this,i):i[0],r=n.cache;if(r.has(o)){return r.get(o)}var s=t.apply(this,i);n.cache=r.set(o,s)||r;return s};n.cache=new(rc.Cache||fo);return n}rc.Cache=fo;var sc=rc;var ac=500;function cc(t){var e=sc(t,(function(t){if(n.size===ac){n.clear()}return t}));var n=e.cache;return e}var lc=cc;var dc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var uc=/\\(\\)?/g;var hc=lc((function(t){var e=[];if(t.charCodeAt(0)===46){e.push("")}t.replace(dc,(function(t,n,i,o){e.push(i?o.replace(uc,"$1"):n||t)}));return e}));var fc=hc;function gc(t,e){var n=-1,i=t==null?0:t.length,o=Array(i);while(++no?0:o+e}n=n>o?o:n;if(n<0){n+=o}o=e>n?0:n-e>>>0;e>>>=0;var r=Array(o);while(++ie===t));return Array.isArray(n)}set(t,e){if(S(t)){for(const[e,n]of Object.entries(t)){this._styleProcessor.toNormalizedForm(e,n,this._styles)}}else{this._styleProcessor.toNormalizedForm(t,e,this._styles)}}remove(t){const e=fl(t);jc(this._styles,e);delete this._styles[t];this._cleanEmptyObjectsOnPath(e)}getNormalized(t){return this._styleProcessor.getNormalized(t,this._styles)}toString(){if(this.isEmpty){return""}return this._getStylesEntries().map((t=>t.join(":"))).sort().join(";")+";"}getAsString(t){if(this.isEmpty){return}if(this._styles[t]&&!S(this._styles[t])){return this._styles[t]}const e=this._styleProcessor.getReducedForm(t,this._styles);const n=e.find((([e])=>e===t));if(Array.isArray(n)){return n[1]}}getStyleNames(t=false){if(this.isEmpty){return[]}if(t){return this._styleProcessor.getStyleNames(this._styles)}const e=this._getStylesEntries();return e.map((([t])=>t))}clear(){this._styles={}}_getStylesEntries(){const t=[];const e=Object.keys(this._styles);for(const n of e){t.push(...this._styleProcessor.getReducedForm(n,this._styles))}return t}_cleanEmptyObjectsOnPath(t){const e=t.split(".");const n=e.length>1;if(!n){return}const i=e.splice(0,e.length-1).join(".");const o=Vc(this._styles,i);if(!o){return}const r=!Array.from(Object.keys(o)).length;if(r){this.remove(i)}}}class ul{constructor(){this._normalizers=new Map;this._extractors=new Map;this._reducers=new Map;this._consumables=new Map}toNormalizedForm(t,e,n){if(S(e)){gl(n,fl(t),e);return}if(this._normalizers.has(t)){const i=this._normalizers.get(t);const{path:o,value:r}=i(e);gl(n,o,r)}else{gl(n,t,e)}}getNormalized(t,e){if(!t){return rl({},e)}if(e[t]!==undefined){return e[t]}if(this._extractors.has(t)){const n=this._extractors.get(t);if(typeof n==="string"){return Vc(e,n)}const i=n(t,e);if(i){return i}}return Vc(e,fl(t))}getReducedForm(t,e){const n=this.getNormalized(t,e);if(n===undefined){return[]}if(this._reducers.has(t)){const e=this._reducers.get(t);return e(n)}return[[t,n]]}getStyleNames(t){const e=Array.from(this._consumables.keys()).filter((e=>{const n=this.getNormalized(e,t);if(n&&typeof n=="object"){return Object.keys(n).length}return n}));const n=new Set([...e,...Object.keys(t)]);return Array.from(n.values())}getRelatedStyles(t){return this._consumables.get(t)||[]}setNormalizer(t,e){this._normalizers.set(t,e)}setExtractor(t,e){this._extractors.set(t,e)}setReducer(t,e){this._reducers.set(t,e)}setStyleRelation(t,e){this._mapStyleNames(t,e);for(const n of e){this._mapStyleNames(n,[t])}}_mapStyleNames(t,e){if(!this._consumables.has(t)){this._consumables.set(t,[])}this._consumables.get(t).push(...e)}}function hl(t){let e=null;let n=0;let i=0;let o=null;const r=new Map;if(t===""){return r}if(t.charAt(t.length-1)!=";"){t=t+";"}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(t){if(t=="class"){if(this._classes.size>0){return[...this._classes].join(" ")}return undefined}if(t=="style"){const t=this._styles.toString();return t==""?undefined:t}return this._attrs.get(t)}hasAttribute(t){if(t=="class"){return this._classes.size>0}if(t=="style"){return!this._styles.isEmpty}return this._attrs.has(t)}isSimilar(t){if(!(t instanceof ml)){return false}if(this===t){return true}if(this.name!=t.name){return false}if(this.isAllowedInsideAttributeElement!=t.isAllowedInsideAttributeElement){return false}if(this._attrs.size!==t._attrs.size||this._classes.size!==t._classes.size||this._styles.size!==t._styles.size){return false}for(const[e,n]of this._attrs){if(!t._attrs.has(e)||t._attrs.get(e)!==n){return false}}for(const e of this._classes){if(!t._classes.has(e)){return false}}for(const e of this._styles.getStyleNames()){if(!t._styles.has(e)||t._styles.getAsString(e)!==this._styles.getAsString(e)){return false}}return true}hasClass(...t){for(const e of t){if(!this._classes.has(e)){return false}}return true}getClassNames(){return this._classes.keys()}getStyle(t){return this._styles.getAsString(t)}getNormalizedStyle(t){return this._styles.getNormalized(t)}getStyleNames(t=false){return this._styles.getStyleNames(t)}hasStyle(...t){for(const e of t){if(!this._styles.has(e)){return false}}return true}findAncestor(...t){const e=new Va(...t);let n=this.parent;while(n){if(e.match(n)){return n}n=n.parent}return null}getCustomProperty(t){return this._customProperties.get(t)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const t=Array.from(this._classes).sort().join(",");const e=this._styles.toString();const n=Array.from(this._attrs).map((t=>`${t[0]}="${t[1]}"`)).sort().join(" ");return this.name+(t==""?"":` class="${t}"`)+(!e?"":` style="${e}"`)+(n==""?"":` ${n}`)}shouldRenderUnsafeAttribute(t){return this._unsafeAttributesToRender.includes(t)}_clone(t=false){const e=[];if(t){for(const n of this.getChildren()){e.push(n._clone(t))}}const n=new this.constructor(this.document,this.name,this._attrs,e);n._classes=new Set(this._classes);n._styles.set(this._styles.getNormalized());n._customProperties=new Map(this._customProperties);n.getFillerOffset=this.getFillerOffset;n._isAllowedInsideAttributeElement=this.isAllowedInsideAttributeElement;return n}_appendChild(t){return this._insertChild(this.childCount,t)}_insertChild(t,e){this._fireChange("children",this);let n=0;const i=bl(this.document,e);for(const e of i){if(e.parent!==null){e._remove()}e.parent=this;e.document=this.document;this._children.splice(t,0,e);t++;n++}return n}_removeChildren(t,e=1){this._fireChange("children",this);for(let n=t;n0){this._classes.clear();return true}return false}if(t=="style"){if(!this._styles.isEmpty){this._styles.clear();return true}return false}return this._attrs.delete(t)}_addClass(t){this._fireChange("attributes",this);for(const e of Aa(t)){this._classes.add(e)}}_removeClass(t){this._fireChange("attributes",this);for(const e of Aa(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 Aa(t)){this._styles.remove(e)}}_setCustomProperty(t,e){this._customProperties.set(t,e)}_removeCustomProperty(t){return this._customProperties.delete(t)}}function pl(t){t=Fa(t);for(const[e,n]of t){if(n===null){t.delete(e)}else if(typeof n!="string"){t.set(e,String(n))}}return t}function kl(t,e){const n=e.split(/\s+/);t.clear();n.forEach((e=>t.add(e)))}function bl(t,e){if(typeof e=="string"){return[new Ra(t,e)]}if(!ka(e)){e=[e]}return Array.from(e).map((e=>{if(typeof e=="string"){return new Ra(t,e)}if(e instanceof Oa){return new Ra(t,e.data)}return e}))}class wl extends ml{constructor(t,e,n,i){super(t,e,n,i);this.getFillerOffset=Al}is(t,e=null){if(!e){return t==="containerElement"||t==="view:containerElement"||t==="element"||t==="view:element"||t==="node"||t==="view:node"}else{return e===this.name&&(t==="containerElement"||t==="view:containerElement"||t==="element"||t==="view:element")}}}function Al(){const t=[...this.getChildren()];const e=t[this.childCount-1];if(e&&e.is("element","br")){return this.childCount}for(const e of t){if(!e.is("uiElement")){return null}}return this.childCount}class Cl extends wl{constructor(t,e,n,i){super(t,e,n,i);this.set("isReadOnly",false);this.set("isFocused",false);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){if(!e){return t==="editableElement"||t==="view:editableElement"||t==="containerElement"||t==="view:containerElement"||t==="element"||t==="view:element"||t==="node"||t==="view:node"}else{return e===this.name&&(t==="editableElement"||t==="view:editableElement"||t==="containerElement"||t==="view:containerElement"||t==="element"||t==="view:element")}}destroy(){this.stopListening()}}Vn(Cl,In);const vl=Symbol("rootName");class _l extends Cl{constructor(t,e){super(t,e);this.rootName="main"}is(t,e=null){if(!e){return 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"}else{return e===this.name&&(t==="rootElement"||t==="view:rootElement"||t==="editableElement"||t==="view:editableElement"||t==="containerElement"||t==="view:containerElement"||t==="element"||t==="view:element")}}get rootName(){return this.getCustomProperty(vl)}set rootName(t){this._setCustomProperty(vl,t)}set _name(t){this.name=t}}class yl{constructor(t={}){if(!t.boundaries&&!t.startPosition){throw new u["a"]("view-tree-walker-no-start-position",null)}if(t.direction&&t.direction!="forward"&&t.direction!="backward"){throw new u["a"]("view-tree-walker-unknown-direction",t.startPosition,{direction:t.direction})}this.boundaries=t.boundaries||null;if(t.startPosition){this.position=xl._createAt(t.startPosition)}else{this.position=xl._createAt(t.boundaries[t.direction=="backward"?"end":"start"])}this.direction=t.direction||"forward";this.singleCharacters=!!t.singleCharacters;this.shallow=!!t.shallow;this.ignoreElementEnd=!!t.ignoreElementEnd;this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null;this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(t){let e,n,i;do{i=this.position;({done:e,value:n}=this.next())}while(!e&&t(n));if(!e){this.position=i}}next(){if(this.direction=="forward"){return this._next()}else{return this._previous()}}_next(){let t=this.position.clone();const e=this.position;const n=t.parent;if(n.parent===null&&t.offset===n.childCount){return{done:true}}if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset){return{done:true}}let i;if(n instanceof Ra){if(t.isAtEnd){this.position=xl._createAfter(n);return this._next()}i=n.data[t.offset]}else{i=n.getChild(t.offset)}if(i instanceof ml){if(!this.shallow){t=new xl(i,0)}else{t.offset++}this.position=t;return this._formatReturnValue("elementStart",i,e,t,1)}else if(i instanceof Ra){if(this.singleCharacters){t=new xl(i,0);this.position=t;return this._next()}else{let n=i.data.length;let o;if(i==this._boundaryEndParent){n=this.boundaries.end.offset;o=new Oa(i,0,n);t=xl._createAfter(o)}else{o=new Oa(i,0,i.data.length);t.offset++}this.position=t;return this._formatReturnValue("text",o,e,t,n)}}else if(typeof i=="string"){let i;if(this.singleCharacters){i=1}else{const e=n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length;i=e-t.offset}const o=new Oa(n,t.offset,i);t.offset+=i;this.position=t;return this._formatReturnValue("text",o,e,t,i)}else{t=xl._createAfter(n);this.position=t;if(this.ignoreElementEnd){return this._next()}else{return this._formatReturnValue("elementEnd",n,e,t)}}}_previous(){let t=this.position.clone();const e=this.position;const n=t.parent;if(n.parent===null&&t.offset===0){return{done:true}}if(n==this._boundaryStartParent&&t.offset==this.boundaries.start.offset){return{done:true}}let i;if(n instanceof Ra){if(t.isAtStart){this.position=xl._createBefore(n);return this._previous()}i=n.data[t.offset-1]}else{i=n.getChild(t.offset-1)}if(i instanceof ml){if(!this.shallow){t=new xl(i,i.childCount);this.position=t;if(this.ignoreElementEnd){return this._previous()}else{return this._formatReturnValue("elementEnd",i,e,t)}}else{t.offset--;this.position=t;return this._formatReturnValue("elementStart",i,e,t,1)}}else if(i instanceof Ra){if(this.singleCharacters){t=new xl(i,i.data.length);this.position=t;return this._previous()}else{let n=i.data.length;let o;if(i==this._boundaryStartParent){const e=this.boundaries.start.offset;o=new Oa(i,e,i.data.length-e);n=o.data.length;t=xl._createBefore(o)}else{o=new Oa(i,0,i.data.length);t.offset--}this.position=t;return this._formatReturnValue("text",o,e,t,n)}}else if(typeof i=="string"){let i;if(!this.singleCharacters){const e=n===this._boundaryStartParent?this.boundaries.start.offset:0;i=t.offset-e}else{i=1}t.offset-=i;const o=new Oa(n,t.offset,i);this.position=t;return this._formatReturnValue("text",o,e,t,i)}else{t=xl._createBefore(n);this.position=t;return this._formatReturnValue("elementStart",n,e,t,1)}}_formatReturnValue(t,e,n,i,o){if(e instanceof Oa){if(e.offsetInText+e.data.length==e.textNode.data.length){if(this.direction=="forward"&&!(this.boundaries&&this.boundaries.end.isEqual(this.position))){i=xl._createAfter(e.textNode);this.position=i}else{n=xl._createAfter(e.textNode)}}if(e.offsetInText===0){if(this.direction=="backward"&&!(this.boundaries&&this.boundaries.start.isEqual(this.position))){i=xl._createBefore(e.textNode);this.position=i}else{n=xl._createBefore(e.textNode)}}}return{done:false,value:{type:t,item:e,previousPosition:n,nextPosition:i,length:o}}}}class xl{constructor(t,e){this.parent=t;this.offset=e}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 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;while(!(t instanceof Cl)){if(t.parent){t=t.parent}else{return null}}return t}getShiftedBy(t){const e=xl._createAt(this);const n=e.offset+t;e.offset=n<0?0:n;return e}getLastMatchingPosition(t,e={}){e.startPosition=this;const n=new yl(e);n.skip(t);return n.position}getAncestors(){if(this.parent.is("documentFragment")){return[this.parent]}else{return this.parent.getAncestors({includeSelf:true})}}getCommonAncestor(t){const e=this.getAncestors();const n=t.getAncestors();let i=0;while(e[i]==n[i]&&e[i]){i++}return i===0?null:e[i-1]}is(t){return t==="position"||t==="view:position"}isEqual(t){return this.parent==t.parent&&this.offset==t.offset}isBefore(t){return this.compareWith(t)=="before"}isAfter(t){return this.compareWith(t)=="after"}compareWith(t){if(this.root!==t.root){return"different"}if(this.isEqual(t)){return"same"}const e=this.parent.is("node")?this.parent.getPath():[];const n=t.parent.is("node")?t.parent.getPath():[];e.push(this.offset);n.push(t.offset);const i=Ba(e,n);switch(i){case"prefix":return"before";case"extension":return"after";default:return e[i]0?new this(n,i):new this(i,n)}static _createIn(t){return this._createFromParentsAndOffsets(t,0,t,t.childCount)}static _createOn(t){const e=t.is("$textProxy")?t.offsetSize:1;return this._createFromPositionAndShift(xl._createBefore(t),e)}}function Dl(t){if(t.item.is("attributeElement")||t.item.is("uiElement")){return true}return false}function Sl(t){let e=0;for(const n of t){e++}return e}class Tl{constructor(t=null,e,n){this._ranges=[];this._lastRangeBackward=false;this._isFake=false;this._fakeSelectionLabel="";this.setTo(t,e,n)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length){return null}const t=this._ranges[this._ranges.length-1];const e=this._lastRangeBackward?t.end:t.start;return e.clone()}get focus(){if(!this._ranges.length){return null}const t=this._ranges[this._ranges.length-1];const e=this._lastRangeBackward?t.start:t.end;return e.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 t of this._ranges){yield t.clone()}}getFirstRange(){let t=null;for(const e of this._ranges){if(!t||e.start.isBefore(t.start)){t=e}}return t?t.clone():null}getLastRange(){let t=null;for(const e of this._ranges){if(!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 false}if(this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel){return false}if(this.rangeCount!=t.rangeCount){return false}else if(this.rangeCount===0){return true}if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus)){return false}for(const e of this._ranges){let n=false;for(const i of t._ranges){if(e.isEqual(i)){n=true;break}}if(!n){return false}}return true}isSimilar(t){if(this.isBackward!=t.isBackward){return false}const e=Sl(this.getRanges());const n=Sl(t.getRanges());if(e!=n){return false}if(e==0){return true}for(let e of this.getRanges()){e=e.getTrimmed();let n=false;for(let i of t.getRanges()){i=i.getTrimmed();if(e.start.isEqual(i.start)&&e.end.isEqual(i.end)){n=true;break}}if(!n){return false}}return true}getSelectedElement(){if(this.rangeCount!==1){return null}return this.getFirstRange().getContainedElement()}setTo(t,e,n){if(t===null){this._setRanges([]);this._setFakeOptions(e)}else if(t instanceof Tl||t instanceof Il){this._setRanges(t.getRanges(),t.isBackward);this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel})}else if(t instanceof El){this._setRanges([t],e&&e.backward);this._setFakeOptions(e)}else if(t instanceof xl){this._setRanges([new El(t)]);this._setFakeOptions(e)}else if(t instanceof La){const i=!!n&&!!n.backward;let o;if(e===undefined){throw new u["a"]("view-selection-setto-required-second-parameter",this)}else if(e=="in"){o=El._createIn(t)}else if(e=="on"){o=El._createOn(t)}else{o=new El(xl._createAt(t,e))}this._setRanges([o],i);this._setFakeOptions(n)}else if(ka(t)){this._setRanges(t,e&&e.backward);this._setFakeOptions(e)}else{throw new u["a"]("view-selection-setto-not-selectable",this)}this.fire("change")}setFocus(t,e){if(this.anchor===null){throw new u["a"]("view-selection-setfocus-no-ranges",this)}const n=xl._createAt(t,e);if(n.compareWith(this.focus)=="same"){return}const i=this.anchor;this._ranges.pop();if(n.compareWith(i)=="before"){this._addRange(new El(n,i),true)}else{this._addRange(new El(i,n))}this.fire("change")}is(t){return t==="selection"||t==="view:selection"}_setRanges(t,e=false){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=false){if(!(t instanceof El)){throw new u["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 u["a"]("view-selection-range-intersects",this,{addedRange:t,intersectingRange:e})}}this._ranges.push(new El(t.start,t.end))}}Vn(Tl,m);class Il{constructor(t=null,e,n){this._selection=new Tl;this._selection.delegate("change").to(this);this._selection.setTo(t,e,n)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(t){return this._selection.isEqual(t)}isSimilar(t){return this._selection.isSimilar(t)}is(t){return t==="selection"||t=="documentSelection"||t=="view:selection"||t=="view:documentSelection"}_setTo(t,e,n){this._selection.setTo(t,e,n)}_setFocus(t,e){this._selection.setFocus(t,e)}}Vn(Il,m);class Ml extends r{constructor(t,e,n){super(t,e);this.startRange=n;this._eventPhase="none";this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const Bl=Symbol("bubbling contexts");const Nl={fire(t,...e){try{const n=t instanceof r?t:new r(this,t);const i=Ol(this);if(!i.size){return}Pl(n,"capturing",this);if(Ll(i,"$capture",n,...e)){return n.return}const o=n.startRange||this.selection.getFirstRange();const s=o?o.getContainedElement():null;const a=s?Boolean(Rl(i,s)):false;let c=s||jl(o);Pl(n,"atTarget",c);if(!a){if(Ll(i,"$text",n,...e)){return n.return}Pl(n,"bubbling",c)}while(c){if(c.is("rootElement")){if(Ll(i,"$root",n,...e)){return n.return}}else if(c.is("element")){if(Ll(i,c.name,n,...e)){return n.return}}if(Ll(i,c,n,...e)){return n.return}c=c.parent;Pl(n,"bubbling",c)}Pl(n,"bubbling",this);Ll(i,"$document",n,...e);return n.return}catch(t){u["a"].rethrowUnexpectedError(t,this)}},_addEventListener(t,e,n){const i=Aa(n.context||"$document");const o=Ol(this);for(const r of i){let i=o.get(r);if(!i){i=Object.create(m);o.set(r,i)}this.listenTo(i,t,e,n)}},_removeEventListener(t,e){const n=Ol(this);for(const i of n.values()){this.stopListening(i,t,e)}}};var zl=Nl;function Pl(t,e,n){if(t instanceof Ml){t._eventPhase=e;t._currentTarget=n}}function Ll(t,e,n,...i){const o=typeof e=="string"?t.get(e):Rl(t,e);if(!o){return false}o.fire(n,...i);return n.stop.called}function Rl(t,e){for(const[n,i]of t){if(typeof n=="function"&&n(e)){return i}}return null}function Ol(t){if(!t[Bl]){t[Bl]=new Map}return t[Bl]}function jl(t){if(!t){return null}const e=t.start.parent;const n=t.end.parent;const i=e.getPath();const o=n.getPath();return i.length>o.length?e:n}class Fl{constructor(t){this.selection=new Il;this.roots=new ba({idProperty:"rootName"});this.stylesProcessor=t;this.set("isReadOnly",false);this.set("isFocused",false);this.set("isSelecting",false);this.set("isComposing",false);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=false;do{for(const n of this._postFixers){e=n(t);if(e){break}}}while(e)}}Vn(Fl,zl);Vn(Fl,In);const Vl=10;class Ul extends ml{constructor(t,e,n,i){super(t,e,n,i);this.getFillerOffset=Hl;this._priority=Vl;this._id=null;this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null){throw new u["a"]("attribute-element-get-elements-with-same-id-no-id",this)}return new Set(this._clonesGroup)}is(t,e=null){if(!e){return t==="attributeElement"||t==="view:attributeElement"||t==="element"||t==="view:element"||t==="node"||t==="view:node"}else{return e===this.name&&(t==="attributeElement"||t==="view:attributeElement"||t==="element"||t==="view:element")}}isSimilar(t){if(this.id!==null||t.id!==null){return this.id===t.id}return super.isSimilar(t)&&this.priority==t.priority}_clone(t){const e=super._clone(t);e._priority=this._priority;e._id=this._id;return e}}Ul.DEFAULT_PRIORITY=Vl;function Hl(){if(ql(this)){return null}let t=this.parent;while(t&&t.is("attributeElement")){if(ql(t)>1){return null}t=t.parent}if(!t||ql(t)>1){return null}return this.childCount}function ql(t){return Array.from(t.getChildren()).filter((t=>!t.is("uiElement"))).length}class Wl extends ml{constructor(t,e,n,i){super(t,e,n,i);this._isAllowedInsideAttributeElement=true;this.getFillerOffset=Gl}is(t,e=null){if(!e){return t==="emptyElement"||t==="view:emptyElement"||t==="element"||t==="view:element"||t==="node"||t==="view:node"}else{return e===this.name&&(t==="emptyElement"||t==="view:emptyElement"||t==="element"||t==="view:element")}}_insertChild(t,e){if(e&&(e instanceof La||Array.from(e).length>0)){throw new u["a"]("view-emptyelement-cannot-add",[this,e])}}}function Gl(){return null}const Kl=navigator.userAgent.toLowerCase();const $l={isMac:Ql(Kl),isWindows:Zl(Kl),isGecko:Jl(Kl),isSafari:Xl(Kl),isiOS:td(Kl),isAndroid:ed(Kl),isBlink:nd(Kl),features:{isRegExpUnicodePropertySupported:id()}};var Yl=$l;function Ql(t){return t.indexOf("macintosh")>-1}function Zl(t){return t.indexOf("windows")>-1}function Jl(t){return!!t.match(/gecko\/\d+/)}function Xl(t){return t.indexOf(" applewebkit/")>-1&&t.indexOf("chrome")===-1}function td(t){return!!t.match(/iphone|ipad/i)||Ql(t)&&navigator.maxTouchPoints>0}function ed(t){return t.indexOf("android")>-1}function nd(t){return t.indexOf("chrome/")>-1&&t.indexOf("edge/")<0}function id(){let t=false;try{t="膰".search(new RegExp("[\\p{L}]","u"))===0}catch(t){}return t}const od={ctrl:"鈱",cmd:"鈱",alt:"鈱",shift:"鈬"};const rd={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"};const sd=md();const ad=Object.fromEntries(Object.entries(sd).map((([t,e])=>[e,t.charAt(0).toUpperCase()+t.slice(1)])));function cd(t){let e;if(typeof t=="string"){e=sd[t.toLowerCase()];if(!e){throw new u["a"]("keyboard-unknown-key",null,{key:t})}}else{e=t.keyCode+(t.altKey?sd.alt:0)+(t.ctrlKey?sd.ctrl:0)+(t.shiftKey?sd.shift:0)+(t.metaKey?sd.cmd:0)}return e}function ld(t){if(typeof t=="string"){t=pd(t)}return t.map((t=>typeof t=="string"?fd(t):t)).reduce(((t,e)=>e+t),0)}function dd(t){let e=ld(t);const n=Object.entries(Yl.isMac?od:rd);const i=n.reduce(((t,[n,i])=>{if((e&sd[n])!=0){e&=~sd[n];t+=i}return t}),"");return i+(e?ad[e]:"")}function ud(t){return t==sd.arrowright||t==sd.arrowleft||t==sd.arrowup||t==sd.arrowdown}function hd(t,e){const n=e==="ltr";switch(t){case sd.arrowleft:return n?"left":"right";case sd.arrowright:return n?"right":"left";case sd.arrowup:return"up";case sd.arrowdown:return"down"}}function fd(t){if(t.endsWith("!")){return cd(t.slice(0,-1))}const e=cd(t);return Yl.isMac&&e==sd.ctrl?sd.cmd:e}function gd(t,e){const n=hd(t,e);return n==="down"||n==="right"}function md(){const t={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let e=65;e<=90;e++){const n=String.fromCharCode(e);t[n.toLowerCase()]=e}for(let e=48;e<=57;e++){t[e-48]=e}for(let e=112;e<=123;e++){t["f"+(e-111)]=e}for(const e of"`-=[];',./\\"){t[e]=e.charCodeAt(0)}return t}function pd(t){return t.split("+").map((t=>t.trim()))}class kd extends ml{constructor(t,e,n,i){super(t,e,n,i);this._isAllowedInsideAttributeElement=true;this.getFillerOffset=wd}is(t,e=null){if(!e){return t==="uiElement"||t==="view:uiElement"||t==="element"||t==="view:element"||t==="node"||t==="view:node"}else{return e===this.name&&(t==="uiElement"||t==="view:uiElement"||t==="element"||t==="view:element")}}_insertChild(t,e){if(e&&(e instanceof La||Array.from(e).length>0)){throw new u["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 bd(t){t.document.on("arrowKey",((e,n)=>Ad(e,n,t.domConverter)),{priority:"low"})}function wd(){return null}function Ad(t,e,n){if(e.keyCode==sd.arrowright){const t=e.domTarget.ownerDocument.defaultView.getSelection();const i=t.rangeCount==1&&t.getRangeAt(0).collapsed;if(i||e.shiftKey){const e=t.focusNode;const o=t.focusOffset;const r=n.domPositionToView(e,o);if(r===null){return}let s=false;const a=r.getLastMatchingPosition((t=>{if(t.item.is("uiElement")){s=true}if(t.item.is("uiElement")||t.item.is("attributeElement")){return true}return false}));if(s){const e=n.viewPositionToDom(a);if(i){t.collapse(e.parent,e.offset)}else{t.extend(e.parent,e.offset)}}}}}class Cd extends ml{constructor(t,e,n,i){super(t,e,n,i);this._isAllowedInsideAttributeElement=true;this.getFillerOffset=vd}is(t,e=null){if(!e){return t==="rawElement"||t==="view:rawElement"||t===this.name||t==="view:"+this.name||t==="element"||t==="view:element"||t==="node"||t==="view:node"}else{return e===this.name&&(t==="rawElement"||t==="view:rawElement"||t==="element"||t==="view:element")}}_insertChild(t,e){if(e&&(e instanceof La||Array.from(e).length>0)){throw new u["a"]("view-rawelement-cannot-add",[this,e])}}}function vd(){return null}class _d{constructor(t,e){this.document=t;this._children=[];if(e){this._insertChild(0,e)}}[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(t){return t==="documentFragment"||t==="view:documentFragment"}_appendChild(t){return this._insertChild(this.childCount,t)}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(t,e){this._fireChange("children",this);let n=0;const i=yd(this.document,e);for(const e of i){if(e.parent!==null){e._remove()}e.parent=this;this._children.splice(t,0,e);t++;n++}return n}_removeChildren(t,e=1){this._fireChange("children",this);for(let n=t;n{if(typeof e=="string"){return new Ra(t,e)}if(e instanceof Oa){return new Ra(t,e.data)}return e}))}class xd{constructor(t){this.document=t;this._cloneGroups=new Map}setSelection(t,e,n){this.document.selection._setTo(t,e,n)}setSelectionFocus(t,e){this.document.selection._setFocus(t,e)}createDocumentFragment(t){return new _d(this.document,t)}createText(t){return new Ra(this.document,t)}createAttributeElement(t,e,n={}){const i=new Ul(this.document,t,e);if(typeof n.priority==="number"){i._priority=n.priority}if(n.id){i._id=n.id}if(n.renderUnsafeAttributes){i._unsafeAttributesToRender.push(...n.renderUnsafeAttributes)}return i}createContainerElement(t,e,n={}){const i=new wl(this.document,t,e);if(n.isAllowedInsideAttributeElement!==undefined){i._isAllowedInsideAttributeElement=n.isAllowedInsideAttributeElement}if(n.renderUnsafeAttributes){i._unsafeAttributesToRender.push(...n.renderUnsafeAttributes)}return i}createEditableElement(t,e,n={}){const i=new Cl(this.document,t,e);i._document=this.document;if(n.renderUnsafeAttributes){i._unsafeAttributesToRender.push(...n.renderUnsafeAttributes)}return i}createEmptyElement(t,e,n={}){const i=new Wl(this.document,t,e);if(n.isAllowedInsideAttributeElement!==undefined){i._isAllowedInsideAttributeElement=n.isAllowedInsideAttributeElement}if(n.renderUnsafeAttributes){i._unsafeAttributesToRender.push(...n.renderUnsafeAttributes)}return i}createUIElement(t,e,n,i={}){const o=new kd(this.document,t,e);if(n){o.render=n}if(i.isAllowedInsideAttributeElement!==undefined){o._isAllowedInsideAttributeElement=i.isAllowedInsideAttributeElement}return o}createRawElement(t,e,n,i={}){const o=new Cd(this.document,t,e);o.render=n||(()=>{});if(i.isAllowedInsideAttributeElement!==undefined){o._isAllowedInsideAttributeElement=i.isAllowedInsideAttributeElement}if(i.renderUnsafeAttributes){o._unsafeAttributesToRender.push(...i.renderUnsafeAttributes)}return o}setAttribute(t,e,n){n._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,n){if(oi(t)&&n===undefined){n=e}n._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,n){n._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}breakAttributes(t){if(t instanceof xl){return this._breakAttributes(t)}else{return this._breakAttributesRange(t)}}breakContainer(t){const e=t.parent;if(!e.is("containerElement")){throw new u["a"]("view-writer-break-non-container-element",this.document)}if(!e.parent){throw new u["a"]("view-writer-break-root",this.document)}if(t.isAtStart){return xl._createBefore(e)}else if(!t.isAtEnd){const n=e._clone(false);this.insert(xl._createAfter(e),n);const i=new El(t,xl._createAt(e,"end"));const o=new xl(n,0);this.move(i,o)}return xl._createAfter(e)}mergeAttributes(t){const e=t.offset;const n=t.parent;if(n.is("$text")){return t}if(n.is("attributeElement")&&n.childCount===0){const t=n.parent;const e=n.index;n._remove();this._removeFromClonedElementsGroup(n);return this.mergeAttributes(new xl(t,e))}const i=n.getChild(e-1);const o=n.getChild(e);if(!i||!o){return t}if(i.is("$text")&&o.is("$text")){return Md(i,o)}else if(i.is("attributeElement")&&o.is("attributeElement")&&i.isSimilar(o)){const t=i.childCount;i._appendChild(o.getChildren());o._remove();this._removeFromClonedElementsGroup(o);return this.mergeAttributes(new xl(i,t))}return t}mergeContainers(t){const e=t.nodeBefore;const n=t.nodeAfter;if(!e||!n||!e.is("containerElement")||!n.is("containerElement")){throw new u["a"]("view-writer-merge-containers-invalid-position",this.document)}const i=e.getChild(e.childCount-1);const o=i instanceof Ra?xl._createAt(i,"end"):xl._createAt(e,"end");this.move(El._createIn(n),xl._createAt(e,"end"));this.remove(El._createOn(n));return o}insert(t,e){e=ka(e)?[...e]:[e];Bd(e,this.document);const n=e.reduce(((t,e)=>{const n=t[t.length-1];const i=!(e.is("uiElement")&&e.isAllowedInsideAttributeElement);if(!n||n.breakAttributes!=i){t.push({breakAttributes:i,nodes:[e]})}else{n.nodes.push(e)}return t}),[]);let i=null;let o=t;for(const{nodes:t,breakAttributes:e}of n){const n=this._insertNodes(o,t,e);if(!i){i=n.start}o=n.end}if(!i){return new El(t)}return new El(i,o)}remove(t){const e=t instanceof El?t:El._createOn(t);Pd(e,this.document);if(e.isCollapsed){return new _d(this.document)}const{start:n,end:i}=this._breakAttributesRange(e,true);const o=n.parent;const r=i.offset-n.offset;const s=o._removeChildren(n.offset,r);for(const t of s){this._removeFromClonedElementsGroup(t)}const a=this.mergeAttributes(n);e.start=a;e.end=a.clone();return new _d(this.document,s)}clear(t,e){Pd(t,this.document);const n=t.getWalker({direction:"backward",ignoreElementEnd:true});for(const i of n){const n=i.item;let o;if(n.is("element")&&e.isSimilar(n)){o=El._createOn(n)}else if(!i.nextPosition.isAfter(t.start)&&n.is("$textProxy")){const t=n.getAncestors().find((t=>t.is("element")&&e.isSimilar(t)));if(t){o=El._createIn(t)}}if(o){if(o.end.isAfter(t.end)){o.end=t.end}if(o.start.isBefore(t.start)){o.start=t.start}this.remove(o)}}}move(t,e){let n;if(e.isAfter(t.end)){e=this._breakAttributes(e,true);const i=e.parent;const o=i.childCount;t=this._breakAttributesRange(t,true);n=this.remove(t);e.offset+=i.childCount-o}else{n=this.remove(t)}return this.insert(e,n)}wrap(t,e){if(!(e instanceof Ul)){throw new u["a"]("view-writer-wrap-invalid-attribute",this.document)}Pd(t,this.document);if(!t.isCollapsed){return this._wrapRange(t,e)}else{let n=t.start;if(n.parent.is("element")&&!Ed(n.parent)){n=n.getLastMatchingPosition((t=>t.item.is("uiElement")))}n=this._wrapPosition(n,e);const i=this.document.selection;if(i.isCollapsed&&i.getFirstPosition().isEqual(t.start)){this.setSelection(n)}return new El(n)}}unwrap(t,e){if(!(e instanceof Ul)){throw new u["a"]("view-writer-unwrap-invalid-attribute",this.document)}Pd(t,this.document);if(t.isCollapsed){return t}const{start:n,end:i}=this._breakAttributesRange(t,true);const o=n.parent;const r=this._unwrapChildren(o,n.offset,i.offset,e);const s=this.mergeAttributes(r.start);if(!s.isEqual(r.start)){r.end.offset--}const a=this.mergeAttributes(r.end);return new El(s,a)}rename(t,e){const n=new wl(this.document,t,e.getAttributes());this.insert(xl._createAfter(e),n);this.move(El._createIn(e),xl._createAt(n,0));this.remove(El._createOn(e));return n}clearClonedElementsGroup(t){this._cloneGroups.delete(t)}createPositionAt(t,e){return xl._createAt(t,e)}createPositionAfter(t){return xl._createAfter(t)}createPositionBefore(t){return xl._createBefore(t)}createRange(t,e){return new El(t,e)}createRangeOn(t){return El._createOn(t)}createRangeIn(t){return El._createIn(t)}createSelection(t,e,n){return new Tl(t,e,n)}_insertNodes(t,e,n){let i;if(n){i=Dd(t)}else{i=t.parent.is("$text")?t.parent.parent:t.parent}if(!i){throw new u["a"]("view-writer-invalid-position-container",this.document)}let o;if(n){o=this._breakAttributes(t,true)}else{o=t.parent.is("$text")?Id(t):t}const r=i._insertChild(o.offset,e);for(const t of e){this._addToClonedElementsGroup(t)}const s=o.getShiftedBy(r);const a=this.mergeAttributes(o);if(!a.isEqual(o)){s.offset--}const c=this.mergeAttributes(s);return new El(a,c)}_wrapChildren(t,e,n,i){let o=e;const r=[];while(ofalse;t.parent._insertChild(t.offset,n);const i=new El(t,t.getShiftedBy(1));this.wrap(i,e);const o=new xl(n.parent,n.index);n._remove();const r=o.nodeBefore;const s=o.nodeAfter;if(r instanceof Ra&&s instanceof Ra){return Md(r,s)}return Td(o)}_wrapAttributeElement(t,e){if(!Ld(t,e)){return false}if(t.name!==e.name||t.priority!==e.priority){return false}for(const n of t.getAttributeKeys()){if(n==="class"||n==="style"){continue}if(e.hasAttribute(n)&&e.getAttribute(n)!==t.getAttribute(n)){return false}}for(const n of t.getStyleNames()){if(e.hasStyle(n)&&e.getStyle(n)!==t.getStyle(n)){return false}}for(const n of t.getAttributeKeys()){if(n==="class"||n==="style"){continue}if(!e.hasAttribute(n)){this.setAttribute(n,t.getAttribute(n),e)}}for(const n of t.getStyleNames()){if(!e.hasStyle(n)){this.setStyle(n,t.getStyle(n),e)}}for(const n of t.getClassNames()){if(!e.hasClass(n)){this.addClass(n,e)}}return true}_unwrapAttributeElement(t,e){if(!Ld(t,e)){return false}if(t.name!==e.name||t.priority!==e.priority){return false}for(const n of t.getAttributeKeys()){if(n==="class"||n==="style"){continue}if(!e.hasAttribute(n)||e.getAttribute(n)!==t.getAttribute(n)){return false}}if(!e.hasClass(...t.getClassNames())){return false}for(const n of t.getStyleNames()){if(!e.hasStyle(n)||e.getStyle(n)!==t.getStyle(n)){return false}}for(const n of t.getAttributeKeys()){if(n==="class"||n==="style"){continue}this.removeAttribute(n,e)}this.removeClass(Array.from(t.getClassNames()),e);this.removeStyle(Array.from(t.getStyleNames()),e);return true}_breakAttributesRange(t,e=false){const n=t.start;const i=t.end;Pd(t,this.document);if(t.isCollapsed){const n=this._breakAttributes(t.start,e);return new El(n,n)}const o=this._breakAttributes(i,e);const r=o.parent.childCount;const s=this._breakAttributes(n,e);o.offset+=o.parent.childCount-r;return new El(s,o)}_breakAttributes(t,e=false){const n=t.offset;const i=t.parent;if(t.parent.is("emptyElement")){throw new u["a"]("view-writer-cannot-break-empty-element",this.document)}if(t.parent.is("uiElement")){throw new u["a"]("view-writer-cannot-break-ui-element",this.document)}if(t.parent.is("rawElement")){throw new u["a"]("view-writer-cannot-break-raw-element",this.document)}if(!e&&i.is("$text")&&zd(i.parent)){return t.clone()}if(zd(i)){return t.clone()}if(i.is("$text")){return this._breakAttributes(Id(t),e)}const o=i.childCount;if(n==o){const t=new xl(i.parent,i.index+1);return this._breakAttributes(t,e)}else{if(n===0){const t=new xl(i.parent,i.index);return this._breakAttributes(t,e)}else{const t=i.index+1;const o=i._clone();i.parent._insertChild(t,o);this._addToClonedElementsGroup(o);const r=i.childCount-n;const s=i._removeChildren(n,r);o._appendChild(s);const a=new xl(i.parent,t);return this._breakAttributes(a,e)}}}_addToClonedElementsGroup(t){if(!t.root.is("rootElement")){return}if(t.is("element")){for(const e of t.getChildren()){this._addToClonedElementsGroup(e)}}const e=t.id;if(!e){return}let n=this._cloneGroups.get(e);if(!n){n=new Set;this._cloneGroups.set(e,n)}n.add(t);t._clonesGroup=n}_removeFromClonedElementsGroup(t){if(t.is("element")){for(const e of t.getChildren()){this._removeFromClonedElementsGroup(e)}}const e=t.id;if(!e){return}const n=this._cloneGroups.get(e);if(!n){return}n.delete(t)}}function Ed(t){return Array.from(t.getChildren()).some((t=>!t.is("uiElement")))}function Dd(t){let e=t.parent;while(!zd(e)){if(!e){return undefined}e=e.parent}return e}function Sd(t,e){if(t.prioritye.priority){return false}return t.getIdentity()n instanceof t))){throw new u["a"]("view-writer-insert-invalid-node-type",e)}if(!n.is("$text")){Bd(n.getChildren(),e)}}}const Nd=[Ra,Ul,wl,Wl,Cd,kd];function zd(t){return t&&(t.is("containerElement")||t.is("documentFragment"))}function Pd(t,e){const n=Dd(t.start);const i=Dd(t.end);if(!n||!i||n!==i){throw new u["a"]("view-writer-invalid-range-container",e)}}function Ld(t,e){return t.id===null&&e.id===null}function Rd(t){return Object.prototype.toString.call(t)=="[object Text]"}const Od=t=>t.createTextNode("聽");const jd=t=>{const e=t.createElement("span");e.dataset.ckeFiller=true;e.innerHTML="聽";return e};const Fd=t=>{const e=t.createElement("br");e.dataset.ckeFiller=true;return e};const Vd=7;const Ud="鈦".repeat(Vd);function Hd(t){return Rd(t)&&t.data.substr(0,Vd)===Ud}function qd(t){return t.data.length==Vd&&Hd(t)}function Wd(t){if(Hd(t)){return t.data.slice(Vd)}else{return t.data}}function Gd(t){t.document.on("arrowKey",Kd,{priority:"low"})}function Kd(t,e){if(e.keyCode==sd.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(t.rangeCount==1&&t.getRangeAt(0).collapsed){const e=t.getRangeAt(0).startContainer;const n=t.getRangeAt(0).startOffset;if(Hd(e)&&n<=Vd){t.collapse(e,0)}}}}function $d(t,e,n,i=false){n=n||function(t,e){return t===e};if(!Array.isArray(t)){t=Array.prototype.slice.call(t)}if(!Array.isArray(e)){e=Array.prototype.slice.call(e)}const o=Yd(t,e,n);return i?Xd(o,e.length):Jd(e,o)}function Yd(t,e,n){const i=Qd(t,e,n);if(i===-1){return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1}}const o=Zd(t,i);const r=Zd(e,i);const s=Qd(o,r,n);const a=t.length-s;const c=e.length-s;return{firstIndex:i,lastIndexOld:a,lastIndexNew:c}}function Qd(t,e,n){for(let i=0;i0){n.push({index:i,type:"insert",values:t.slice(i,r)})}if(o-i>0){n.push({index:i+(r-i),type:"delete",howMany:o-i})}return n}function Xd(t,e){const{firstIndex:n,lastIndexOld:i,lastIndexNew:o}=t;if(n===-1){return Array(e).fill("equal")}let r=[];if(n>0){r=r.concat(Array(n).fill("equal"))}if(o-n>0){r=r.concat(Array(o-n).fill("insert"))}if(i-n>0){r=r.concat(Array(i-n).fill("delete"))}if(o200||o>200||i+o>300){return tu.fastDiff(t,e,n,true)}let r,s;if(ol?-1:1;if(d[i+h]){d[i]=d[i+h].slice(0)}if(!d[i]){d[i]=[]}d[i].push(o>l?r:s);let f=Math.max(o,l);let g=f-i;while(gl;g--){u[g]=h(g)}u[l]=h(l);f++}while(u[l]!==c);return d[l].slice(1)}tu.fastDiff=$d;function eu(t,e,n){t.insertBefore(n,t.childNodes[e]||null)}function nu(t){const e=t.parentNode;if(e){e.removeChild(t)}}function iu(t){if(t){if(t.defaultView){return t instanceof t.defaultView.Document}else if(t.ownerDocument&&t.ownerDocument.defaultView){return t instanceof t.ownerDocument.defaultView.Node}}return false}var ou=n(1);var ru=n.n(ou);var su=n(13);var au={injectType:"singletonStyleTag",attributes:{"data-cke":true}};au.insert="head";au.singleton=true;var cu=ru()(su["a"],au);var lu=su["a"].locals||{};class du{constructor(t,e){this.domDocuments=new Set;this.domConverter=t;this.markedAttributes=new Set;this.markedChildren=new Set;this.markedTexts=new Set;this.selection=e;this.set("isFocused",false);this.set("isSelecting",false);if(Yl.isBlink&&!Yl.isAndroid){this.on("change:isSelecting",(()=>{if(!this.isSelecting){this.render()}}))}this._inlineFiller=null;this._fakeSelectionContainer=null}markToSync(t,e){if(t==="text"){if(this.domConverter.mapViewToDom(e.parent)){this.markedTexts.add(e)}}else{if(!this.domConverter.mapViewToDom(e)){return}if(t==="attributes"){this.markedAttributes.add(e)}else if(t==="children"){this.markedChildren.add(e)}else{throw new u["a"]("view-renderer-unknown-type",this)}}}render(){let t;const e=Yl.isBlink&&!Yl.isAndroid?!this.isSelecting:true;for(const t of this.markedChildren){this._updateChildrenMappings(t)}if(e){if(this._inlineFiller&&!this._isSelectionInInlineFiller()){this._removeInlineFiller()}if(this._inlineFiller){t=this._getInlineFillerPosition()}else if(this._needsInlineFillerAtSelection()){t=this.selection.getFirstPosition();this.markedChildren.add(t.parent)}}else if(this._inlineFiller&&this._inlineFiller.parentNode){t=this.domConverter.domPositionToView(this._inlineFiller)}for(const t of this.markedAttributes){this._updateAttrs(t)}for(const e of this.markedChildren){this._updateChildren(e,{inlineFillerPosition:t})}for(const e of this.markedTexts){if(!this.markedChildren.has(e.parent)&&this.domConverter.mapViewToDom(e.parent)){this._updateText(e,{inlineFillerPosition:t})}}if(e){if(t){const e=this.domConverter.viewPositionToDom(t);const n=e.parent.ownerDocument;if(!Hd(e.parent)){this._inlineFiller=hu(n,e.parent,e.offset)}else{this._inlineFiller=e.parent}}else{this._inlineFiller=null}}this._updateFocus();this._updateSelection();this.markedTexts.clear();this.markedAttributes.clear();this.markedChildren.clear()}_updateChildrenMappings(t){const e=this.domConverter.mapViewToDom(t);if(!e){return}const n=Array.from(this.domConverter.mapViewToDom(t).childNodes);const i=Array.from(this.domConverter.viewChildrenToDom(t,e.ownerDocument,{withChildren:false}));const o=this._diffNodeLists(n,i);const r=this._findReplaceActions(o,n,i);if(r.indexOf("replace")!==-1){const e={equal:0,insert:0,delete:0};for(const o of r){if(o==="replace"){const o=e.equal+e.insert;const r=e.equal+e.delete;const s=t.getChild(o);if(s&&!(s.is("uiElement")||s.is("rawElement"))){this._updateElementMappings(s,n[r])}nu(i[o]);e.equal++}else{e[o]++}}}}_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();if(t.parent.is("$text")){return xl._createBefore(this.selection.getFirstPosition().parent)}else{return t}}_isSelectionInInlineFiller(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed){return false}const t=this.selection.getFirstPosition();const e=this.domConverter.viewPositionToDom(t);if(e&&Rd(e.parent)&&Hd(e.parent)){return true}return false}_removeInlineFiller(){const t=this._inlineFiller;if(!Hd(t)){throw new u["a"]("view-renderer-filler-was-lost",this)}if(qd(t)){t.remove()}else{t.data=t.data.substr(Vd)}this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed){return false}const t=this.selection.getFirstPosition();const e=t.parent;const n=t.offset;if(!this.domConverter.mapViewToDom(e.root)){return false}if(!e.is("element")){return false}if(!uu(e)){return false}if(n===e.getFillerOffset()){return false}const i=t.nodeBefore;const o=t.nodeAfter;if(i instanceof Ra||o instanceof Ra){return false}return true}_updateText(t,e){const n=this.domConverter.findCorrespondingDomText(t);const i=this.domConverter.viewToDom(t,n.ownerDocument);const o=n.data;let r=i.data;const s=e.inlineFillerPosition;if(s&&s.parent==t.parent&&s.offset==t.index){r=Ud+r}if(o!=r){const t=$d(o,r);for(const e of t){if(e.type==="insert"){n.insertData(e.index,e.values.join(""))}else{n.deleteData(e.index,e.howMany)}}}}_updateAttrs(t){const e=this.domConverter.mapViewToDom(t);if(!e){return}const n=Array.from(e.attributes).map((t=>t.name));const i=t.getAttributeKeys();for(const n of i){this.domConverter.setDomElementAttribute(e,n,t.getAttribute(n),t)}for(const i of n){if(!t.hasAttribute(i)){this.domConverter.removeDomElementAttribute(e,i)}}}_updateChildren(t,e){const n=this.domConverter.mapViewToDom(t);if(!n){return}const i=e.inlineFillerPosition;const o=this.domConverter.mapViewToDom(t).childNodes;const r=Array.from(this.domConverter.viewChildrenToDom(t,n.ownerDocument,{bind:true}));if(i&&i.parent===t){hu(n.ownerDocument,r,i.offset)}const s=this._diffNodeLists(o,r);let a=0;const c=new Set;for(const t of s){if(t==="delete"){c.add(o[a]);nu(o[a])}else if(t==="equal"){a++}}a=0;for(const t of s){if(t==="insert"){eu(n,a,r[a]);a++}else if(t==="equal"){this._markDescendantTextToSync(this.domConverter.domToView(r[a]));a++}}for(const t of c){if(!t.parentNode){this.domConverter.unbindDomElement(t)}}}_diffNodeLists(t,e){t=pu(t,this._fakeSelectionContainer);return tu(t,e,gu.bind(null,this.domConverter))}_findReplaceActions(t,e,n){if(t.indexOf("insert")===-1||t.indexOf("delete")===-1){return t}let i=[];let o=[];let r=[];const s={equal:0,insert:0,delete:0};for(const a of t){if(a==="insert"){r.push(n[s.equal+s.insert])}else if(a==="delete"){o.push(e[s.equal+s.delete])}else{i=i.concat(tu(o,r,fu).map((t=>t==="equal"?"replace":t)));i.push("equal");o=[];r=[]}s[a]++}return i.concat(tu(o,r,fu).map((t=>t==="equal"?"replace":t)))}_markDescendantTextToSync(t){if(!t){return}if(t.is("$text")){this.markedTexts.add(t)}else if(t.is("element")){for(const e of t.getChildren()){this._markDescendantTextToSync(e)}}}_updateSelection(){if(Yl.isBlink&&!Yl.isAndroid&&this.isSelecting&&!this.markedChildren.size){return}if(this.selection.rangeCount===0){this._removeDomSelection();this._removeFakeSelection();return}const t=this.domConverter.mapViewToDom(this.selection.editableElement);if(!this.isFocused||!t){return}if(this.selection.isFake){this._updateFakeSelection(t)}else{this._removeFakeSelection();this._updateDomSelection(t)}}_updateFakeSelection(t){const e=t.ownerDocument;if(!this._fakeSelectionContainer){this._fakeSelectionContainer=ku(e)}const n=this._fakeSelectionContainer;this.domConverter.bindFakeSelection(n,this.selection);if(!this._fakeSelectionNeedsUpdate(t)){return}if(!n.parentElement||n.parentElement!=t){t.appendChild(n)}n.textContent=this.selection.fakeSelectionLabel||"聽";const i=e.getSelection();const o=e.createRange();i.removeAllRanges();o.selectNodeContents(n);i.addRange(o)}_updateDomSelection(t){const e=t.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(e)){return}const n=this.domConverter.viewPositionToDom(this.selection.anchor);const i=this.domConverter.viewPositionToDom(this.selection.focus);e.collapse(n.parent,n.offset);e.extend(i.parent,i.offset);if(Yl.isGecko){mu(i,e)}}_domSelectionNeedsUpdate(t){if(!this.domConverter.isDomSelectionCorrect(t)){return true}const e=t&&this.domConverter.domSelectionToView(t);if(e&&this.selection.isEqual(e)){return false}if(!this.selection.isCollapsed&&this.selection.isSimilar(e)){return false}return true}_fakeSelectionNeedsUpdate(t){const e=this._fakeSelectionContainer;const n=t.ownerDocument.getSelection();if(!e||e.parentElement!==t){return true}if(n.anchorNode!==e&&!e.contains(n.anchorNode)){return true}return e.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const t of this.domDocuments){const e=t.getSelection();if(e.rangeCount){const e=t.activeElement;const n=this.domConverter.mapDomToView(e);if(e&&n){t.getSelection().removeAllRanges()}}}}_removeFakeSelection(){const t=this._fakeSelectionContainer;if(t){t.remove()}}_updateFocus(){if(this.isFocused){const t=this.selection.editableElement;if(t){this.domConverter.focus(t)}}}}Vn(du,In);function uu(t){if(t.getAttribute("contenteditable")=="false"){return false}const e=t.findAncestor((t=>t.hasAttribute("contenteditable")));return!e||e.getAttribute("contenteditable")=="true"}function hu(t,e,n){const i=e instanceof Array?e:e.childNodes;const o=i[n];if(Rd(o)){o.data=Ud+o.data;return o}else{const o=t.createTextNode(Ud);if(Array.isArray(e)){i.splice(n,0,o)}else{eu(e,n,o)}return o}}function fu(t,e){return iu(t)&&iu(e)&&!Rd(t)&&!Rd(e)&&t.nodeType!==Node.COMMENT_NODE&&e.nodeType!==Node.COMMENT_NODE&&t.tagName.toLowerCase()===e.tagName.toLowerCase()}function gu(t,e,n){if(e===n){return true}else if(Rd(e)&&Rd(n)){return e.data===n.data}else if(t.isBlockFiller(e)&&t.isBlockFiller(n)){return true}return false}function mu(t,e){const n=t.parent;if(n.nodeType!=Node.ELEMENT_NODE||t.offset!=n.childNodes.length-1){return}const i=n.childNodes[t.offset];if(i&&i.tagName=="BR"){e.addRange(e.getRangeAt(0))}}function pu(t,e){const n=Array.from(t);if(n.length==0||!e){return n}const i=n[n.length-1];if(i==e){n.pop()}return n}function ku(t){const e=t.createElement("div");e.className="ck-fake-selection-container";Object.assign(e.style,{position:"fixed",top:0,left:"-9999px",width:"42px"});e.textContent="聽";return e}var bu={window:window,document:document};function wu(t){let e=0;while(t.previousSibling){t=t.previousSibling;e++}return e}function Au(t){const e=[];while(t&&t.nodeType!=Node.DOCUMENT_NODE){e.unshift(t);t=t.parentNode}return e}const Cu=Fd(document);const vu=Od(document);const _u=jd(document);const yu="data-ck-unsafe-attribute-";const xu="data-ck-unsafe-element";class Eu{constructor(t,e={}){this.document=t;this.renderingMode=e.renderingMode||"editing";this.blockFillerMode=e.blockFillerMode||(this.renderingMode==="editing"?"br":"nbsp");this.preElements=["pre"];this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"];this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"];this._domToViewMapping=new WeakMap;this._viewToDomMapping=new WeakMap;this._fakeSelectionMapping=new WeakMap;this._rawContentElementMatcher=new Va;this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(t,e){this._fakeSelectionMapping.set(t,new Tl(e))}fakeSelectionToView(t){return this._fakeSelectionMapping.get(t)}bindElements(t,e){this._domToViewMapping.set(t,e);this._viewToDomMapping.set(e,t)}unbindDomElement(t){const e=this._domToViewMapping.get(t);if(e){this._domToViewMapping.delete(t);this._viewToDomMapping.delete(e);for(const e of t.childNodes){this.unbindDomElement(e)}}}bindDocumentFragments(t,e){this._domToViewMapping.set(t,e);this._viewToDomMapping.set(e,t)}shouldRenderAttribute(t,e,n){if(this.renderingMode==="data"){return true}t=t.toLowerCase();if(t.startsWith("on")){return false}if(t==="srcdoc"&&e.match(/\bon\S+\s*=|javascript:|<\s*\/*script/i)){return false}if(n==="img"&&(t==="src"||t==="srcset")){return true}if(n==="source"&&t==="srcset"){return true}if(e.match(/^\s*(javascript:|data:(image\/svg|text\/x?html))/i)){return false}return true}setContentOf(t,e){if(this.renderingMode==="data"){t.innerHTML=e;return}const n=(new DOMParser).parseFromString(e,"text/html");const i=n.createDocumentFragment();const o=n.body.childNodes;while(o.length>0){i.appendChild(o[0])}const r=n.createTreeWalker(i,NodeFilter.SHOW_ELEMENT);const s=[];let a;while(a=r.nextNode()){s.push(a)}for(const t of s){for(const e of t.getAttributeNames()){this.setDomElementAttribute(t,e,t.getAttribute(e))}const e=t.tagName.toLowerCase();if(this._shouldRenameElement(e)){Object(u["b"])("domconverter-unsafe-element-detected",{unsafeElement:t});t.replaceWith(this._createReplacementDomElement(e,t))}}while(t.firstChild){t.firstChild.remove()}t.append(i)}viewToDom(t,e,n={}){if(t.is("$text")){const n=this._processDataFromViewText(t);return e.createTextNode(n)}else{if(this.mapViewToDom(t)){return this.mapViewToDom(t)}let i;if(t.is("documentFragment")){i=e.createDocumentFragment();if(n.bind){this.bindDocumentFragments(i,t)}}else if(t.is("uiElement")){if(t.name==="$comment"){i=e.createComment(t.getCustomProperty("$rawContent"))}else{i=t.render(e,this)}if(n.bind){this.bindElements(i,t)}return i}else{if(this._shouldRenameElement(t.name)){Object(u["b"])("domconverter-unsafe-element-detected",{unsafeElement:t});i=this._createReplacementDomElement(t.name)}else if(t.hasAttribute("xmlns")){i=e.createElementNS(t.getAttribute("xmlns"),t.name)}else{i=e.createElement(t.name)}if(t.is("rawElement")){t.render(i,this)}if(n.bind){this.bindElements(i,t)}for(const e of t.getAttributeKeys()){this.setDomElementAttribute(i,e,t.getAttribute(e),t)}}if(n.withChildren!==false){for(const o of this.viewChildrenToDom(t,e,n)){i.appendChild(o)}}return i}}setDomElementAttribute(t,e,n,i=null){const o=this.shouldRenderAttribute(e,n,t.tagName.toLowerCase())||i&&i.shouldRenderUnsafeAttribute(e);if(!o){Object(u["b"])("domconverter-unsafe-attribute-detected",{domElement:t,key:e,value:n})}if(t.hasAttribute(e)&&!o){t.removeAttribute(e)}else if(t.hasAttribute(yu+e)&&o){t.removeAttribute(yu+e)}t.setAttribute(o?e:yu+e,n)}removeDomElementAttribute(t,e){if(e==xu){return}t.removeAttribute(e);t.removeAttribute(yu+e)}*viewChildrenToDom(t,e,n={}){const i=t.getFillerOffset&&t.getFillerOffset();let o=0;for(const r of t.getChildren()){if(i===o){yield this._getBlockFiller(e)}yield this.viewToDom(r,e,n);o++}if(i===o){yield this._getBlockFiller(e)}}viewRangeToDom(t){const e=this.viewPositionToDom(t.start);const n=this.viewPositionToDom(t.end);const i=document.createRange();i.setStart(e.parent,e.offset);i.setEnd(n.parent,n.offset);return i}viewPositionToDom(t){const e=t.parent;if(e.is("$text")){const n=this.findCorrespondingDomText(e);if(!n){return null}let i=t.offset;if(Hd(n)){i+=Vd}return{parent:n,offset:i}}else{let n,i,o;if(t.offset===0){n=this.mapViewToDom(e);if(!n){return null}o=n.childNodes[0]}else{const e=t.nodeBefore;i=e.is("$text")?this.findCorrespondingDomText(e):this.mapViewToDom(t.nodeBefore);if(!i){return null}n=i.parentNode;o=i.nextSibling}if(Rd(o)&&Hd(o)){return{parent:o,offset:Vd}}const r=i?wu(i)+1:0;return{parent:n,offset:r}}}domToView(t,e={}){if(this.isBlockFiller(t)){return null}const n=this.getHostViewElement(t);if(n){return n}if(this.isComment(t)&&e.skipComments){return null}if(Rd(t)){if(qd(t)){return null}else{const e=this._processDataFromDomText(t);return e===""?null:new Ra(this.document,e)}}else{if(this.mapDomToView(t)){return this.mapDomToView(t)}let n;if(this.isDocumentFragment(t)){n=new _d(this.document);if(e.bind){this.bindDocumentFragments(t,n)}}else{n=this._createViewElement(t,e);if(e.bind){this.bindElements(t,n)}const i=t.attributes;if(i){for(let t=i.length-1;t>=0;t--){n._setAttribute(i[t].name,i[t].value)}}if(this._isViewElementWithRawContent(n,e)||this.isComment(t)){const e=this.isComment(t)?t.data:t.innerHTML;n._setCustomProperty("$rawContent",e);this._encounteredRawContentDomNodes.add(t);return n}}if(e.withChildren!==false){for(const i of this.domChildrenToView(t,e)){n._appendChild(i)}}return n}}*domChildrenToView(t,e={}){for(let n=0;n{const{scrollLeft:e,scrollTop:n}=t;i.push([e,n])}));e.focus();Su(e,(t=>{const[e,n]=i.shift();t.scrollLeft=e;t.scrollTop=n}));bu.window.scrollTo(t,n)}}isElement(t){return t&&t.nodeType==Node.ELEMENT_NODE}isDocumentFragment(t){return t&&t.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(t){return t&&t.nodeType==Node.COMMENT_NODE}isBlockFiller(t){if(this.blockFillerMode=="br"){return t.isEqualNode(Cu)}if(t.tagName==="BR"&&Iu(t,this.blockElements)&&t.parentNode.childNodes.length===1){return true}return t.isEqualNode(_u)||Tu(t,this.blockElements)}isDomSelectionBackward(t){if(t.isCollapsed){return false}const e=document.createRange();e.setStart(t.anchorNode,t.anchorOffset);e.setEnd(t.focusNode,t.focusOffset);const n=e.collapsed;e.detach();return n}getHostViewElement(t){const e=Au(t);e.pop();while(e.length){const t=e.pop();const n=this._domToViewMapping.get(t);if(n&&(n.is("uiElement")||n.is("rawElement"))){return n}}return null}isDomSelectionCorrect(t){return this._isDomSelectionPositionCorrect(t.anchorNode,t.anchorOffset)&&this._isDomSelectionPositionCorrect(t.focusNode,t.focusOffset)}registerRawContentMatcher(t){this._rawContentElementMatcher.add(t)}_getBlockFiller(t){switch(this.blockFillerMode){case"nbsp":return Od(t);case"markedNbsp":return jd(t);case"br":return Fd(t)}}_isDomSelectionPositionCorrect(t,e){if(Rd(t)&&Hd(t)&&ethis.preElements.includes(t.name)))){return e}if(e.charAt(0)==" "){const n=this._getTouchingInlineViewNode(t,false);const i=n&&n.is("$textProxy")&&this._nodeEndsWithSpace(n);if(i||!n){e="聽"+e.substr(1)}}if(e.charAt(e.length-1)==" "){const n=this._getTouchingInlineViewNode(t,true);const i=n&&n.is("$textProxy")&&n.data.charAt(0)==" ";if(e.charAt(e.length-2)==" "||!n||i){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 false}const e=this._processDataFromViewText(t);return e.charAt(e.length-1)==" "}_processDataFromDomText(t){let e=t.data;if(Du(t,this.preElements)){return Wd(t)}e=e.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(t,false);const i=this._getTouchingInlineDomNode(t,true);const o=this._checkShouldLeftTrimDomText(t,n);const r=this._checkShouldRightTrimDomText(t,i);if(o){e=e.replace(/^ /,"")}if(r){e=e.replace(/ $/,"")}e=Wd(new Text(e));e=e.replace(/ \u00A0/g," ");const s=i&&this.isElement(i)&&i.tagName!="BR";const a=i&&Rd(i)&&i.data.charAt(0)==" ";if(/( |\u00A0)\u00A0$/.test(e)||!i||s||a){e=e.replace(/\u00A0$/," ")}if(o||n&&this.isElement(n)&&n.tagName!="BR"){e=e.replace(/^\u00A0/," ")}return e}_checkShouldLeftTrimDomText(t,e){if(!e){return true}if(this.isElement(e)){return e.tagName==="BR"}if(this._encounteredRawContentDomNodes.has(t.previousSibling)){return false}return/[^\S\u00A0]/.test(e.data.charAt(e.data.length-1))}_checkShouldRightTrimDomText(t,e){if(e){return false}return!Hd(t)}_getTouchingInlineViewNode(t,e){const n=new yl({startPosition:e?xl._createAfter(t):xl._createBefore(t),direction:e?"forward":"backward"});for(const t of n){if(t.item.is("element")&&this.inlineObjectElements.includes(t.item.name)){return t.item}else if(t.item.is("containerElement")){return null}else if(t.item.is("element","br")){return null}else if(t.item.is("$textProxy")){return t.item}}return null}_getTouchingInlineDomNode(t,e){if(!t.parentNode){return null}const n=e?"firstChild":"lastChild";const i=e?"nextSibling":"previousSibling";let o=true;do{if(!o&&t[n]){t=t[n]}else if(t[i]){t=t[i];o=false}else{t=t.parentNode;o=true}if(!t||this._isBlockElement(t)){return null}}while(!(Rd(t)||t.tagName=="BR"||this._isInlineObjectElement(t)));return t}_isBlockElement(t){return this.isElement(t)&&this.blockElements.includes(t.tagName.toLowerCase())}_isInlineObjectElement(t){return this.isElement(t)&&this.inlineObjectElements.includes(t.tagName.toLowerCase())}_createViewElement(t,e){if(this.isComment(t)){return new kd(this.document,"$comment")}const n=e.keepOriginalCase?t.tagName:t.tagName.toLowerCase();return new ml(this.document,n)}_isViewElementWithRawContent(t,e){return e.withChildren!==false&&this._rawContentElementMatcher.match(t)}_shouldRenameElement(t){return this.renderingMode=="editing"&&t.toLowerCase()=="script"}_createReplacementDomElement(t,e=null){const n=document.createElement("span");n.setAttribute(xu,t);if(e){while(e.firstChild){n.appendChild(e.firstChild)}for(const t of e.getAttributeNames()){n.setAttribute(t,e.getAttribute(t))}}return n}}function Du(t,e){const n=Au(t);return n.some((t=>t.tagName&&e.includes(t.tagName.toLowerCase())))}function Su(t,e){while(t&&t!=bu.document){e(t);t=t.parentNode}}function Tu(t,e){const n=t.isEqualNode(vu);return n&&Iu(t,e)&&t.parentNode.childNodes.length===1}function Iu(t,e){const n=t.parentNode;return n&&n.tagName&&e.includes(n.tagName.toLowerCase())}function Mu(t){const e=Object.prototype.toString.apply(t);if(e=="[object Window]"){return true}if(e=="[object global]"){return true}return false}const Bu=_n({},m,{listenTo(t,e,n,i={}){if(iu(t)||Mu(t)){const o={capture:!!i.useCapture,passive:!!i.usePassive};const r=this._getProxyEmitter(t,o)||new zu(t,o);this.listenTo(r,e,n,i)}else{m.listenTo.call(this,t,e,n,i)}},stopListening(t,e,n){if(iu(t)||Mu(t)){const i=this._getAllProxyEmitters(t);for(const t of i){this.stopListening(t,e,n)}}else{m.stopListening.call(this,t,e,n)}},_getProxyEmitter(t,e){return p(this,Lu(t,e))},_getAllProxyEmitters(t){return[{capture:false,passive:false},{capture:false,passive:true},{capture:true,passive:false},{capture:true,passive:true}].map((e=>this._getProxyEmitter(t,e))).filter((t=>!!t))}});var Nu=Bu;class zu{constructor(t,e){k(this,Lu(t,e));this._domNode=t;this._options=e}}_n(zu.prototype,m,{attach(t){if(this._domListeners&&this._domListeners[t]){return}const e=this._createDomListener(t);this._domNode.addEventListener(t,e,this._options);if(!this._domListeners){this._domListeners={}}this._domListeners[t]=e},detach(t){let e;if(this._domListeners[t]&&(!(e=this._events[t])||!e.callbacks.length)){this._domListeners[t].removeListener()}},_addEventListener(t,e,n){this.attach(t);m._addEventListener.call(this,t,e,n)},_removeEventListener(t,e){m._removeEventListener.call(this,t,e);this.detach(t)},_createDomListener(t){const e=e=>{this.fire(t,e)};e.removeListener=()=>{this._domNode.removeEventListener(t,e,this._options);delete this._domListeners[t]};return e}});function Pu(t){return t["data-ck-expando"]||(t["data-ck-expando"]=a())}function Lu(t,e){let n=Pu(t);for(const t of Object.keys(e).sort()){if(e[t]){n+="-"+t}}return n}class Ru{constructor(t){this.view=t;this.document=t.document;this.isEnabled=false}enable(){this.isEnabled=true}disable(){this.isEnabled=false}destroy(){this.disable();this.stopListening()}checkShouldIgnoreEventFromTarget(t){if(t&&t.nodeType===3){t=t.parentNode}if(!t||t.nodeType!==1){return false}return t.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}Vn(Ru,Nu);var Ou="__lodash_hash_undefined__";function ju(t){this.__data__.set(t,Ou);return this}var Fu=ju;function Vu(t){return this.__data__.has(t)}var Uu=Vu;function Hu(t){var e=-1,n=t==null?0:t.length;this.__data__=new fo;while(++ea)){return false}var l=r.get(t);var d=r.get(e);if(l&&d){return l==e&&d==t}var u=-1,h=true,f=n&Qu?new qu:undefined;r.set(t,e);r.set(e,t);while(++u{this.listenTo(t,e,((t,e)=>{if(this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(e.target)){this.onDomEvent(e)}}),{useCapture:this.useCapture})}))}fire(t,e,n){if(this.isEnabled){this.document.fire(t,new Oh(this.view,e,n))}}}class Fh extends jh{constructor(t){super(t);this.domEventType=["keydown","keyup"]}onDomEvent(t){this.fire(t.type,t,{keyCode:t.keyCode,altKey:t.altKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,metaKey:t.metaKey,get keystroke(){return cd(this)}})}}var Vh=function(){return T["a"].Date.now()};var Uh=Vh;var Hh=/\s/;function qh(t){var e=t.length;while(e--&&Hh.test(t.charAt(e))){}return e}var Wh=qh;var Gh=/^\s+/;function Kh(t){return t?t.slice(0,Wh(t)+1).replace(Gh,""):t}var $h=Kh;var Yh=0/0;var Qh=/^[-+]0x[0-9a-f]+$/i;var Zh=/^0b[01]+$/i;var Jh=/^0o[0-7]+$/i;var Xh=parseInt;function tf(t){if(typeof t=="number"){return t}if(Xa(t)){return Yh}if(S(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=S(e)?e+"":e}if(typeof t!="string"){return t===0?t:+t}t=$h(t);var n=Zh.test(t);return n||Jh.test(t)?Xh(t.slice(2),n?2:8):Qh.test(t)?Yh:+t}var ef=tf;var nf="Expected a function";var of=Math.max,rf=Math.min;function sf(t,e,n){var i,o,r,s,a,c,l=0,d=false,u=false,h=true;if(typeof t!="function"){throw new TypeError(nf)}e=ef(e)||0;if(S(n)){d=!!n.leading;u="maxWait"in n;r=u?of(ef(n.maxWait)||0,e):r;h="trailing"in n?!!n.trailing:h}function f(e){var n=i,r=o;i=o=undefined;l=e;s=t.apply(r,n);return s}function g(t){l=t;a=setTimeout(k,e);return d?f(t):s}function m(t){var n=t-c,i=t-l,o=e-n;return u?rf(o,r-i):o}function p(t){var n=t-c,i=t-l;return c===undefined||n>=e||n<0||u&&i>=r}function k(){var t=Uh();if(p(t)){return b(t)}a=setTimeout(k,m(t))}function b(t){a=undefined;if(h&&i){return f(t)}i=o=undefined;return s}function w(){if(a!==undefined){clearTimeout(a)}l=0;i=c=o=a=undefined}function A(){return a===undefined?s:b(Uh())}function C(){var t=Uh(),n=p(t);i=arguments;o=this;c=t;if(n){if(a===undefined){return g(c)}if(u){clearTimeout(a);a=setTimeout(k,e);return f(c)}}if(a===undefined){a=setTimeout(k,e)}return s}C.cancel=w;C.flush=A;return C}var af=sf;class cf extends Ru{constructor(t){super(t);this._fireSelectionChangeDoneDebounced=af((t=>this.document.fire("selectionChangeDone",t)),200)}observe(){const t=this.document;t.on("arrowKey",((e,n)=>{const i=t.selection;if(i.isFake&&this.isEnabled){n.preventDefault()}}),{context:"$capture"});t.on("arrowKey",((e,n)=>{const i=t.selection;if(i.isFake&&this.isEnabled){this._handleSelectionMove(n.keyCode)}}),{priority:"lowest"})}destroy(){super.destroy();this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(t){const e=this.document.selection;const n=new Tl(e.getRanges(),{backward:e.isBackward,fake:false});if(t==sd.arrowleft||t==sd.arrowup){n.setTo(n.getFirstPosition())}if(t==sd.arrowright||t==sd.arrowdown){n.setTo(n.getLastPosition())}const i={oldSelection:e,newSelection:n,domSelection:null};this.document.fire("selectionChange",i);this._fireSelectionChangeDoneDebounced(i)}}class lf extends Ru{constructor(t){super(t);this.mutationObserver=t.getObserver(Rh);this.selection=this.document.selection;this.domConverter=t.domConverter;this._documents=new WeakSet;this._fireSelectionChangeDoneDebounced=af((t=>this.document.fire("selectionChangeDone",t)),200);this._clearInfiniteLoopInterval=setInterval((()=>this._clearInfiniteLoop()),1e3);this._documentIsSelectingInactivityTimeoutDebounced=af((()=>this.document.isSelecting=false),5e3);this._loopbackCounter=0}observe(t){const e=t.ownerDocument;const n=()=>{this.document.isSelecting=true;this._documentIsSelectingInactivityTimeoutDebounced()};const i=()=>{this.document.isSelecting=false;this._documentIsSelectingInactivityTimeoutDebounced.cancel()};this.listenTo(t,"selectstart",n,{priority:"highest"});this.listenTo(t,"keydown",i,{priority:"highest"});this.listenTo(t,"keyup",i,{priority:"highest"});if(this._documents.has(e)){return}this.listenTo(e,"mouseup",i,{priority:"highest"});this.listenTo(e,"selectionchange",((t,n)=>{this._handleSelectionChange(n,e);this._documentIsSelectingInactivityTimeoutDebounced()}));this._documents.add(e)}destroy(){super.destroy();clearInterval(this._clearInfiniteLoopInterval);this._fireSelectionChangeDoneDebounced.cancel();this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_handleSelectionChange(t,e){if(!this.isEnabled){return}const n=e.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(n.anchorNode)){return}this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(n);if(i.rangeCount==0){this.view.hasDomSelection=false;return}this.view.hasDomSelection=true;if(this.selection.isEqual(i)&&this.domConverter.isDomSelectionCorrect(n)){return}if(++this._loopbackCounter>60){return}if(this.selection.isSimilar(i)){this.view.forceRender()}else{const t={oldSelection:this.selection,newSelection:i,domSelection:n};this.document.fire("selectionChange",t);this._fireSelectionChangeDoneDebounced(t)}}_clearInfiniteLoop(){this._loopbackCounter=0}}class df extends jh{constructor(t){super(t);this.domEventType=["focus","blur"];this.useCapture=true;const e=this.document;e.on("focus",(()=>{e.isFocused=true;this._renderTimeoutId=setTimeout((()=>t.change((()=>{}))),50)}));e.on("blur",((n,i)=>{const o=e.selection.editableElement;if(o===null||o===i.target){e.isFocused=false;t.change((()=>{}))}}))}onDomEvent(t){this.fire(t.type,t)}destroy(){if(this._renderTimeoutId){clearTimeout(this._renderTimeoutId)}super.destroy()}}class uf extends jh{constructor(t){super(t);this.domEventType=["compositionstart","compositionupdate","compositionend"];const e=this.document;e.on("compositionstart",(()=>{e.isComposing=true}));e.on("compositionend",(()=>{e.isComposing=false}))}onDomEvent(t){this.fire(t.type,t)}}class hf extends jh{constructor(t){super(t);this.domEventType=["beforeinput"]}onDomEvent(t){this.fire(t.type,t)}}class ff{constructor(){this._replacedElements=[]}replace(t,e){this._replacedElements.push({element:t,newElement:e});t.style.display="none";if(e){t.parentNode.insertBefore(e,t.nextSibling)}}restore(){this._replacedElements.forEach((({element:t,newElement:e})=>{t.style.display="";if(e){e.remove()}}));this._replacedElements=[]}}var gf="[object String]";function mf(t){return typeof t=="string"||!xe(t)&&me(t)&&G(t)==gf}var pf=mf;function kf(t,e,n={},i=[]){const o=n&&n.xmlns;const r=o?t.createElementNS(o,e):t.createElement(e);for(const t in n){r.setAttribute(t,n[t])}if(pf(i)||!ka(i)){i=[i]}for(let e of i){if(pf(e)){e=t.createTextNode(e)}r.appendChild(e)}return r}function bf(t){if(t instanceof HTMLTextAreaElement){return t.value}return t.innerHTML}function wf(t){return Object.prototype.toString.apply(t)=="[object Range]"}function Af(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 Cf=["top","right","bottom","left","width","height"];class vf{constructor(t){const e=wf(t);Object.defineProperty(this,"_source",{value:t._source||t,writable:true,enumerable:false});if(fa(t)||e){if(e){const e=vf.getDomRangeRects(t);_f(this,vf.getBoundingRect(e))}else{_f(this,t.getBoundingClientRect())}}else if(Mu(t)){const{innerWidth:e,innerHeight:n}=t;_f(this,{top:0,right:e,bottom:n,left:0,width:e,height:n})}else{_f(this,t)}}clone(){return new vf(this)}moveTo(t,e){this.top=e;this.right=t+this.width;this.bottom=e+this.height;this.left=t;return this}moveBy(t,e){this.top+=e;this.right+=t;this.left+=t;this.bottom+=e;return 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)};e.width=e.right-e.left;e.height=e.bottom-e.top;if(e.width<0||e.height<0){return null}else{return new vf(e)}}getIntersectionArea(t){const e=this.getIntersection(t);if(e){return e.getArea()}else{return 0}}getArea(){return this.width*this.height}getVisible(){const t=this._source;let e=this.clone();if(!yf(t)){let n=t.parentNode||t.commonAncestorContainer;while(n&&!yf(n)){const t=new vf(n);const i=e.getIntersection(t);if(i){if(i.getArea(){for(const e of t){const t=Ef._getElementCallbacks(e.target);if(t){for(const n of t){n(e)}}}}))}}Ef._observerInstance=null;Ef._elementCallbacks=null;class Df{constructor(t){this._callback=t;this._elements=new Set;this._previousRects=new Map;this._periodicCheckTimeout=null}observe(t){this._elements.add(t);this._checkElementRectsAndExecuteCallback();if(this._elements.size===1){this._startPeriodicCheck()}}unobserve(t){this._elements.delete(t);this._previousRects.delete(t);if(!this._elements.size){this._stopPeriodicCheck()}}_startPeriodicCheck(){const t=()=>{this._checkElementRectsAndExecuteCallback();this._periodicCheckTimeout=setTimeout(t,xf)};this.listenTo(bu.window,"resize",(()=>{this._checkElementRectsAndExecuteCallback()}));this._periodicCheckTimeout=setTimeout(t,xf)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout);this.stopListening();this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const t=[];for(const e of this._elements){if(this._hasRectChanged(e)){t.push({target:e,contentRect:this._previousRects.get(e)})}}if(t.length){this._callback(t)}}_hasRectChanged(t){if(!t.ownerDocument.body.contains(t)){return false}const e=new vf(t);const n=this._previousRects.get(t);const i=!n||!n.isEqual(e);this._previousRects.set(t,e);return i}}Vn(Df,Nu);function Sf(t,e){if(t instanceof HTMLTextAreaElement){t.value=e}t.innerHTML=e}function Tf(t){return e=>e+t}function If(t){const e=t.next();if(e.done){return null}return e.value}class Mf{constructor(){this.set("isFocused",false);this.set("focusedElement",null);this._elements=new Set;this._nextEventLoopTimeout=null}add(t){if(this._elements.has(t)){throw new u["a"]("focustracker-add-element-already-exist",this)}this.listenTo(t,"focus",(()=>this._focus(t)),{useCapture:true});this.listenTo(t,"blur",(()=>this._blur()),{useCapture:true});this._elements.add(t)}remove(t){if(t===this.focusedElement){this._blur(t)}if(this._elements.has(t)){this.stopListening(t);this._elements.delete(t)}}destroy(){this.stopListening()}_focus(t){clearTimeout(this._nextEventLoopTimeout);this.focusedElement=t;this.isFocused=true}_blur(){clearTimeout(this._nextEventLoopTimeout);this._nextEventLoopTimeout=setTimeout((()=>{this.focusedElement=null;this.isFocused=false}),0)}}Vn(Mf,Nu);Vn(Mf,In);class Bf{constructor(){this._listener=Object.create(Nu)}listenTo(t){this._listener.listenTo(t,"keydown",((t,e)=>{this._listener.fire("_keydown:"+cd(e),e)}))}set(t,e,n={}){const i=ld(t);const o=n.priority;this._listener.listenTo(this._listener,"_keydown:"+i,((t,n)=>{e(n,(()=>{n.preventDefault();n.stopPropagation();t.stop()}));t.return=true}),{priority:o})}press(t){return!!this._listener.fire("_keydown:"+cd(t),t)}destroy(){this._listener.stopListening()}}class Nf extends Ru{constructor(t){super(t);this.document.on("keydown",((t,e)=>{if(this.isEnabled&&ud(e.keyCode)){const n=new Ml(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(n,e);if(n.stop.called){t.stop()}}}))}observe(){}}const zf={};function Pf({target:t,viewportOffset:e=0}){const n=Hf(t);let i=n;let o=null;while(i){let r;if(i==n){r=qf(t)}else{r=qf(o)}Of(r,(()=>Wf(t,i)));const s=Wf(t,i);Rf(i,s,e);if(i.parent!=i){o=i.frameElement;i=i.parent;if(!o){return}}else{i=null}}}function Lf(t){const e=qf(t);Of(e,(()=>new vf(t)))}Object.assign(zf,{scrollViewportToShowTarget:Pf,scrollAncestorsToShowTarget:Lf});function Rf(t,e,n){const i=e.clone().moveBy(0,n);const o=e.clone().moveBy(0,-n);const r=new vf(t).excludeScrollbarsAndBorders();const s=[o,i];if(!s.every((t=>r.contains(t)))){let{scrollX:s,scrollY:a}=t;if(Ff(o,r)){a-=r.top-e.top+n}else if(jf(i,r)){a+=e.bottom-r.bottom+n}if(Vf(e,r)){s-=r.left-e.left+n}else if(Uf(e,r)){s+=e.right-r.right+n}t.scrollTo(s,a)}}function Of(t,e){const n=Hf(t);let i,o;while(t!=n.document.body){o=e();i=new vf(t).excludeScrollbarsAndBorders();if(!i.contains(o)){if(Ff(o,i)){t.scrollTop-=i.top-o.top}else if(jf(o,i)){t.scrollTop+=o.bottom-i.bottom}if(Vf(o,i)){t.scrollLeft-=i.left-o.left}else if(Uf(o,i)){t.scrollLeft+=o.right-i.right}}t=t.parentNode}}function jf(t,e){return t.bottom>e.bottom}function Ff(t,e){return t.tope.right}function Hf(t){if(wf(t)){return t.startContainer.ownerDocument.defaultView}else{return t.ownerDocument.defaultView}}function qf(t){if(wf(t)){let e=t.commonAncestorContainer;if(Rd(e)){e=e.parentNode}return e}else{return t.parentNode}}function Wf(t,e){const n=Hf(t);const i=new vf(t);if(n===e){return i}else{let t=n;while(t!=e){const e=t.frameElement;const n=new vf(e).excludeScrollbarsAndBorders();i.moveBy(n.left,n.top);t=t.parent}}return i}class Gf{constructor(t){this.document=new Fl(t);this.domConverter=new Eu(this.document);this.domRoots=new Map;this.set("isRenderingInProgress",false);this.set("hasDomSelection",false);this._renderer=new du(this.domConverter,this.document.selection);this._renderer.bind("isFocused","isSelecting").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 xd(this.document);this.addObserver(Rh);this.addObserver(lf);this.addObserver(df);this.addObserver(Fh);this.addObserver(cf);this.addObserver(uf);this.addObserver(Nf);if(Yl.isAndroid){this.addObserver(hf)}Gd(this);bd(this);this.on("render",(()=>{this._render();this.document.fire("layoutChanged");this._hasChangedSinceTheLastRendering=false}));this.listenTo(this.document.selection,"change",(()=>{this._hasChangedSinceTheLastRendering=true}));this.listenTo(this.document,"change:isFocused",(()=>{this._hasChangedSinceTheLastRendering=true}))}attachDomRoot(t,e="main"){const n=this.document.getRoot(e);n._name=t.tagName.toLowerCase();const i={};for(const{name:e,value:o}of Array.from(t.attributes)){i[e]=o;if(e==="class"){this._writer.addClass(o.split(" "),n)}else{this._writer.setAttribute(e,o,n)}}this._initialDomRootAttributes.set(t,i);const o=()=>{this._writer.setAttribute("contenteditable",!n.isReadOnly,n);if(n.isReadOnly){this._writer.addClass("ck-read-only",n)}else{this._writer.removeClass("ck-read-only",n)}};o();this.domRoots.set(e,t);this.domConverter.bindElements(t,n);this._renderer.markToSync("children",n);this._renderer.markToSync("attributes",n);this._renderer.domDocuments.add(t.ownerDocument);n.on("change:children",((t,e)=>this._renderer.markToSync("children",e)));n.on("change:attributes",((t,e)=>this._renderer.markToSync("attributes",e)));n.on("change:text",((t,e)=>this._renderer.markToSync("text",e)));n.on("change:isReadOnly",(()=>this.change(o)));n.on("change",(()=>{this._hasChangedSinceTheLastRendering=true}));for(const n of this._observers.values()){n.observe(t,e)}}detachDomRoot(t){const e=this.domRoots.get(t);Array.from(e.attributes).forEach((({name:t})=>e.removeAttribute(t)));const n=this._initialDomRootAttributes.get(e);for(const t in n){e.setAttribute(t,n[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,n]of this.domRoots){e.observe(n,t)}e.enable();return 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();if(t){Pf({target:this.domConverter.viewRangeToDom(t),viewportOffset:20})}}focus(){if(!this.document.isFocused){const t=this.document.selection.editableElement;if(t){this.domConverter.focus(t);this.forceRender()}else{}}}change(t){if(this.isRenderingInProgress||this._postFixersInProgress){throw new u["a"]("cannot-change-view-tree",this)}try{if(this._ongoingChange){return t(this._writer)}this._ongoingChange=true;const e=t(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 e}catch(t){u["a"].rethrowUnexpectedError(t,this)}}forceRender(){this._hasChangedSinceTheLastRendering=true;this.change((()=>{}))}destroy(){for(const t of this._observers.values()){t.destroy()}this.document.destroy();this.stopListening()}createPositionAt(t,e){return xl._createAt(t,e)}createPositionAfter(t){return xl._createAfter(t)}createPositionBefore(t){return xl._createBefore(t)}createRange(t,e){return new El(t,e)}createRangeOn(t){return El._createOn(t)}createRangeIn(t){return El._createIn(t)}createSelection(t,e,n){return new Tl(t,e,n)}_disableRendering(t){this._renderingDisabled=t;if(t==false){this.change((()=>{}))}}_render(){this.isRenderingInProgress=true;this.disableObservers();this._renderer.render();this.enableObservers();this.isRenderingInProgress=false}}Vn(Gf,In);class Kf{constructor(t){this.parent=null;this._attrs=Fa(t)}get index(){let t;if(!this.parent){return null}if((t=this.parent.getChildIndex(this))===null){throw new u["a"]("model-node-not-found-in-parent",this)}return t}get startOffset(){let t;if(!this.parent){return null}if((t=this.parent.getChildStartOffset(this))===null){throw new u["a"]("model-node-not-found-in-parent",this)}return t}get offsetSize(){return 1}get endOffset(){if(!this.parent){return null}return this.startOffset+this.offsetSize}get nextSibling(){const t=this.index;return t!==null&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return t!==null&&this.parent.getChild(t-1)||null}get root(){let t=this;while(t.parent){t=t.parent}return t}isAttached(){return this.root.is("rootElement")}getPath(){const t=[];let e=this;while(e.parent){t.unshift(e.startOffset);e=e.parent}return t}getAncestors(t={includeSelf:false,parentFirst:false}){const e=[];let n=t.includeSelf?this:this.parent;while(n){e[t.parentFirst?"push":"unshift"](n);n=n.parent}return e}getCommonAncestor(t,e={}){const n=this.getAncestors(e);const i=t.getAncestors(e);let o=0;while(n[o]==i[o]&&n[o]){o++}return o===0?null:n[o-1]}isBefore(t){if(this==t){return false}if(this.root!==t.root){return false}const e=this.getPath();const n=t.getPath();const i=Ba(e,n);switch(i){case"prefix":return true;case"extension":return false;default:return e[i]{t[e[0]]=e[1];return t}),{})}return t}is(t){return t==="node"||t==="model:node"}_clone(){return new Kf(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(t,e){this._attrs.set(t,e)}_setAttributesTo(t){this._attrs=Fa(t)}_removeAttribute(t){return this._attrs.delete(t)}_clearAttributes(){this._attrs.clear()}}class $f extends Kf{constructor(t,e){super(e);this._data=t||""}get offsetSize(){return this.data.length}get data(){return this._data}is(t){return t==="$text"||t==="model:$text"||t==="text"||t==="model:text"||t==="node"||t==="model:node"}toJSON(){const t=super.toJSON();t.data=this.data;return t}_clone(){return new $f(this.data,this.getAttributes())}static fromJSON(t){return new $f(t.data,t.attributes)}}class Yf{constructor(t,e,n){this.textNode=t;if(e<0||e>t.offsetSize){throw new u["a"]("model-textproxy-wrong-offsetintext",this)}if(n<0||e+n>t.offsetSize){throw new u["a"]("model-textproxy-wrong-length",this)}this.data=t.data.substring(e,e+n);this.offsetInText=e}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(t){return t==="$textProxy"||t==="model:$textProxy"||t==="textProxy"||t==="model:textProxy"}getPath(){const t=this.textNode.getPath();if(t.length>0){t[t.length-1]+=this.offsetInText}return t}getAncestors(t={includeSelf:false,parentFirst:false}){const e=[];let n=t.includeSelf?this:this.parent;while(n){e[t.parentFirst?"push":"unshift"](n);n=n.parent}return e}hasAttribute(t){return this.textNode.hasAttribute(t)}getAttribute(t){return this.textNode.getAttribute(t)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class Qf{constructor(t){this._nodes=[];if(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 e==-1?null:e}getNodeStartOffset(t){const e=this.getNodeIndex(t);return e===null?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 u["a"]("model-nodelist-index-out-of-bounds",this)}return this.getNodeStartOffset(e)}offsetToIndex(t){let e=0;for(const n of this._nodes){if(t>=e&&tt.toJSON()))}}class Zf extends Kf{constructor(t,e,n){super(e);this.name=t;this._children=new Qf;if(n){this._insertChild(0,n)}}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}is(t,e=null){if(!e){return t==="element"||t==="model:element"||t==="node"||t==="model:node"}return e===this.name&&(t==="element"||t==="model:element")}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}offsetToIndex(t){return this._children.offsetToIndex(t)}getNodeByPath(t){let e=this;for(const n of t){e=e.getChild(e.offsetToIndex(n))}return e}findAncestor(t,e={includeSelf:false}){let n=e.includeSelf?this:this.parent;while(n){if(n.name===t){return n}n=n.parent}return null}toJSON(){const t=super.toJSON();t.name=this.name;if(this._children.length>0){t.children=[];for(const e of this._children){t.children.push(e.toJSON())}}return t}_clone(t=false){const e=t?Array.from(this._children).map((t=>t._clone(true))):null;return new Zf(this.name,this.getAttributes(),e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const n=Jf(e);for(const t of n){if(t.parent!==null){t._remove()}t.parent=this}this._children._insertNodes(t,n)}_removeChildren(t,e=1){const n=this._children._removeNodes(t,e);for(const t of n){t.parent=null}return n}static fromJSON(t){let e=null;if(t.children){e=[];for(const n of t.children){if(n.name){e.push(Zf.fromJSON(n))}else{e.push($f.fromJSON(n))}}}return new Zf(t.name,t.attributes,e)}}function Jf(t){if(typeof t=="string"){return[new $f(t)]}if(!ka(t)){t=[t]}return Array.from(t).map((t=>{if(typeof t=="string"){return new $f(t)}if(t instanceof Yf){return new $f(t.data,t.getAttributes())}return t}))}class Xf{constructor(t={}){if(!t.boundaries&&!t.startPosition){throw new u["a"]("model-tree-walker-no-start-position",null)}const e=t.direction||"forward";if(e!="forward"&&e!="backward"){throw new u["a"]("model-tree-walker-unknown-direction",t,{direction:e})}this.direction=e;this.boundaries=t.boundaries||null;if(t.startPosition){this.position=t.startPosition.clone()}else{this.position=eg._createAt(this.boundaries[this.direction=="backward"?"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,n,i,o;do{i=this.position;o=this._visitedParent;({done:e,value:n}=this.next())}while(!e&&t(n));if(!e){this.position=i;this._visitedParent=o}}next(){if(this.direction=="forward"){return this._next()}else{return this._previous()}}_next(){const t=this.position;const e=this.position.clone();const n=this._visitedParent;if(n.parent===null&&e.offset===n.maxOffset){return{done:true}}if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset){return{done:true}}const i=e.parent;const o=ng(e,i);const r=o?o:ig(e,i,o);if(r instanceof Zf){if(!this.shallow){e.path.push(0);this._visitedParent=r}else{e.offset++}this.position=e;return tg("elementStart",r,t,e,1)}else if(r instanceof $f){let i;if(this.singleCharacters){i=1}else{let t=r.endOffset;if(this._boundaryEndParent==n&&this.boundaries.end.offsett){t=this.boundaries.start.offset}i=e.offset-t}const o=e.offset-r.startOffset;const s=new Yf(r,o-i,i);e.offset-=i;this.position=e;return tg("text",s,t,e,i)}else{e.path.pop();this.position=e;this._visitedParent=n.parent;return tg("elementStart",n,t,e,1)}}}function tg(t,e,n,i,o){return{done:false,value:{type:t,item:e,previousPosition:n,nextPosition:i,length:o}}}class eg{constructor(t,e,n="toNone"){if(!t.is("element")&&!t.is("documentFragment")){throw new u["a"]("model-position-root-invalid",t)}if(!(e instanceof Array)||e.length===0){throw new u["a"]("model-position-path-incorrect-format",t,{path:e})}if(t.is("rootElement")){e=e.slice()}else{e=[...t.getPath(),...e];t=t.root}this.root=t;this.path=e;this.stickiness=n}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;en.path.length){if(e.offset!==o.maxOffset){return false}e.path=e.path.slice(0,-1);o=o.parent;e.offset++}else{if(n.offset!==0){return false}n.path=n.path.slice(0,-1)}}}is(t){return t==="position"||t==="model:position"}hasSameParentAs(t){if(this.root!==t.root){return false}const e=this.getParentPath();const n=t.getParentPath();return Ba(e,n)=="same"}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=eg._createAt(this);break}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;const n=e.containsPosition(this)||e.start.isEqual(this)&&this.stickiness=="toNext";if(n){return this._getCombined(t.splitPosition,t.moveTargetPosition)}else{if(t.graveyardPosition){return this._getTransformedByMove(t.graveyardPosition,t.insertionPosition,1)}else{return this._getTransformedByInsertion(t.insertionPosition,1)}}}_getTransformedByMergeOperation(t){const e=t.movedRange;const n=e.containsPosition(this)||e.start.isEqual(this);let i;if(n){i=this._getCombined(t.sourcePosition,t.targetPosition);if(t.sourcePosition.isBefore(t.targetPosition)){i=i._getTransformedByDeletion(t.deletionPosition,1)}}else if(this.isEqual(t.deletionPosition)){i=eg._createAt(t.deletionPosition)}else{i=this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1)}return i}_getTransformedByDeletion(t,e){const n=eg._createAt(this);if(this.root!=t.root){return n}if(Ba(t.getParentPath(),this.getParentPath())=="same"){if(t.offsetthis.offset){return null}else{n.offset-=e}}}else if(Ba(t.getParentPath(),this.getParentPath())=="prefix"){const i=t.path.length-1;if(t.offset<=this.path[i]){if(t.offset+e>this.path[i]){return null}else{n.path[i]-=e}}}return n}_getTransformedByInsertion(t,e){const n=eg._createAt(this);if(this.root!=t.root){return n}if(Ba(t.getParentPath(),this.getParentPath())=="same"){if(t.offsete+1){const e=i.maxOffset-n.offset;if(e!==0){t.push(new rg(n,n.getShiftedBy(e)))}n.path=n.path.slice(0,-1);n.offset++;i=i.parent}while(n.path.length<=this.end.path.length){const e=this.end.path[n.path.length-1];const i=e-n.offset;if(i!==0){t.push(new rg(n,n.getShiftedBy(i)))}n.offset=e;n.path.push(0)}return t}getWalker(t={}){t.boundaries=this;return new Xf(t)}*getItems(t={}){t.boundaries=this;t.ignoreElementEnd=true;const e=new Xf(t);for(const t of e){yield t.item}}*getPositions(t={}){t.boundaries=this;const e=new Xf(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 rg(this.start,this.end)]}getTransformedByOperations(t){const e=[new rg(this.start,this.end)];for(const n of t){for(let t=0;t0?new this(n,i):new this(i,n)}static _createIn(t){return new this(eg._createAt(t,0),eg._createAt(t,t.maxOffset))}static _createOn(t){return this._createFromPositionAndShift(eg._createBefore(t),t.offsetSize)}static _createFromRanges(t){if(t.length===0){throw new u["a"]("range-create-from-ranges-empty-array",null)}else if(t.length==1){return t[0].clone()}const e=t[0];t.sort(((t,e)=>t.start.isAfter(e.start)?1:-1));const n=t.indexOf(e);const i=new this(e.start,e.end);if(n>0){for(let e=n-1;true;e++){if(t[e].end.isEqual(i.start)){i.start=eg._createAt(t[e].start)}else{break}}}for(let e=n+1;e{if(e.viewPosition){return}const n=this._modelToViewMapping.get(e.modelPosition.parent);e.viewPosition=this.findPositionIn(n,e.modelPosition.offset)}),{priority:"low"});this.on("viewToModelPosition",((t,e)=>{if(e.modelPosition){return}const n=this.findMappedViewAncestor(e.viewPosition);const i=this._viewToModelMapping.get(n);const o=this._toModelOffset(e.viewPosition.parent,e.viewPosition.offset,n);e.modelPosition=eg._createAt(i,o)}),{priority:"low"})}bindElements(t,e){this._modelToViewMapping.set(t,e);this._viewToModelMapping.set(e,t)}unbindViewElement(t){const e=this.toModelElement(t);this._viewToModelMapping.delete(t);if(this._elementToMarkerNames.has(t)){for(const e of this._elementToMarkerNames.get(t)){this._unboundMarkerNames.add(e)}}if(this._modelToViewMapping.get(e)==t){this._modelToViewMapping.delete(e)}}unbindModelElement(t){const e=this.toViewElement(t);this._modelToViewMapping.delete(t);if(this._viewToModelMapping.get(e)==t){this._viewToModelMapping.delete(e)}}bindElementToMarker(t,e){const n=this._markerNameToElements.get(e)||new Set;n.add(t);const i=this._elementToMarkerNames.get(t)||new Set;i.add(e);this._markerNameToElements.set(e,n);this._elementToMarkerNames.set(t,i)}unbindElementFromMarkerName(t,e){const n=this._markerNameToElements.get(e);if(n){n.delete(t);if(n.size==0){this._markerNameToElements.delete(e)}}const i=this._elementToMarkerNames.get(t);if(i){i.delete(e);if(i.size==0){this._elementToMarkerNames.delete(t)}}}flushUnboundMarkerNames(){const t=Array.from(this._unboundMarkerNames);this._unboundMarkerNames.clear();return 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 rg(this.toModelPosition(t.start),this.toModelPosition(t.end))}toViewRange(t){return new El(this.toViewPosition(t.start),this.toViewPosition(t.end))}toModelPosition(t){const e={viewPosition:t,mapper:this};this.fire("viewToModelPosition",e);return e.modelPosition}toViewPosition(t,e={isPhantom:false}){const n={modelPosition:t,mapper:this,isPhantom:e.isPhantom};this.fire("modelToViewPosition",n);return n.viewPosition}markerNameToElements(t){const e=this._markerNameToElements.get(t);if(!e){return null}const n=new Set;for(const t of e){if(t.is("attributeElement")){for(const e of t.getElementsWithSameId()){n.add(e)}}else{n.add(t)}}return n}registerViewToModelLength(t,e){this._viewToModelLengthCallbacks.set(t,e)}findMappedViewAncestor(t){let e=t.parent;while(!this._viewToModelMapping.has(e)){e=e.parent}return e}_toModelOffset(t,e,n){if(n!=t){const i=this._toModelOffset(t.parent,t.index,n);const o=this._toModelOffset(t,e,t);return i+o}if(t.is("$text")){return e}let i=0;for(let n=0;n1?e[0]+":"+e[1]:e[0]}class lg{constructor(t){this.conversionApi=Object.assign({dispatcher:this},t);this._reconversionEventsMapping=new Map}convertChanges(t,e,n){for(const e of t.getMarkersToRemove()){this.convertMarkerRemove(e.name,e.range,n)}const i=this._mapChangesWithAutomaticReconversion(t);for(const t of i){if(t.type==="insert"){this.convertInsert(rg._createFromPositionAndShift(t.position,t.length),n)}else if(t.type==="remove"){this.convertRemove(t.position,t.length,t.name,n)}else if(t.type==="reconvert"){this.reconvertElement(t.element,n)}else{this.convertAttribute(t.range,t.attributeKey,t.attributeOldValue,t.attributeNewValue,n)}}for(const t of this.conversionApi.mapper.flushUnboundMarkerNames()){const i=e.get(t).getRange();this.convertMarkerRemove(t,i,n);this.convertMarkerAdd(t,i,n)}for(const e of t.getMarkersToAdd()){this.convertMarkerAdd(e.name,e.range,n)}}convertInsert(t,e){this.conversionApi.writer=e;this.conversionApi.consumable=this._createInsertConsumable(t);for(const e of Array.from(t).map(hg)){this._convertInsertWithAttributes(e)}this._clearConversionApi()}convertRemove(t,e,n,i){this.conversionApi.writer=i;this.fire("remove:"+n,{position:t,length:e},this.conversionApi);this._clearConversionApi()}convertAttribute(t,e,n,i,o){this.conversionApi.writer=o;this.conversionApi.consumable=this._createConsumableForRange(t,`attribute:${e}`);for(const o of t){const t=o.item;const r=rg._createFromPositionAndShift(o.previousPosition,o.length);const s={item:t,range:r,attributeKey:e,attributeOldValue:n,attributeNewValue:i};this._testAndFire(`attribute:${e}`,s)}this._clearConversionApi()}reconvertElement(t,e){const n=rg._createOn(t);this.conversionApi.writer=e;this.conversionApi.consumable=this._createInsertConsumable(n);const i=this.conversionApi.mapper;const o=i.toViewElement(t);e.remove(o);this._convertInsertWithAttributes({item:t,range:n});const r=i.toViewElement(t);for(const n of rg._createIn(t)){const{item:t}=n;const o=fg(t,i);if(o){if(o.root!==r.root){e.move(e.createRangeOn(o),i.toViewPosition(eg._createBefore(t)))}}else{this._convertInsertWithAttributes(hg(n))}}i.unbindViewElement(o);this._clearConversionApi()}convertSelection(t,e,n){const i=Array.from(e.getMarkersAtPosition(t.getFirstPosition()));this.conversionApi.writer=n;this.conversionApi.consumable=this._createSelectionConsumable(t,i);this.fire("selection",{selection:t},this.conversionApi);if(!t.isCollapsed){this._clearConversionApi();return}for(const e of i){const n=e.getRange();if(!dg(t.getFirstPosition(),e,this.conversionApi.mapper)){continue}const i={item:t,markerName:e.name,markerRange:n};if(this.conversionApi.consumable.test(t,"addMarker:"+e.name)){this.fire("addMarker:"+e.name,i,this.conversionApi)}}for(const e of t.getAttributeKeys()){const n={item:t,range:t.getFirstRange(),attributeKey:e,attributeOldValue:null,attributeNewValue:t.getAttribute(e)};if(this.conversionApi.consumable.test(t,"attribute:"+n.attributeKey)){this.fire("attribute:"+n.attributeKey+":$text",n,this.conversionApi)}}this._clearConversionApi()}convertMarkerAdd(t,e,n){if(e.root.rootName=="$graveyard"){return}this.conversionApi.writer=n;const i="addMarker:"+t;const o=new ag;o.add(e,i);this.conversionApi.consumable=o;this.fire(i,{markerName:t,markerRange:e},this.conversionApi);if(!o.test(e,i)){this._clearConversionApi();return}this.conversionApi.consumable=this._createConsumableForRange(e,i);for(const n of e.getItems()){if(!this.conversionApi.consumable.test(n,i)){continue}const o={item:n,range:rg._createOn(n),markerName:t,markerRange:e};this.fire(i,o,this.conversionApi)}this._clearConversionApi()}convertMarkerRemove(t,e,n){if(e.root.rootName=="$graveyard"){return}this.conversionApi.writer=n;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 ag;for(const n of t){const t=n.item;e.add(t,"insert");for(const n of t.getAttributeKeys()){e.add(t,"attribute:"+n)}}return e}_createConsumableForRange(t,e){const n=new ag;for(const i of t.getItems()){n.add(i,e)}return n}_createSelectionConsumable(t,e){const n=new ag;n.add(t,"selection");for(const i of e){n.add(t,"addMarker:"+i.name)}for(const e of t.getAttributeKeys()){n.add(t,"attribute:"+e)}return n}_testAndFire(t,e){if(!this.conversionApi.consumable.test(e.item,t)){return}this.fire(ug(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;const n=[];for(const i of t.getChanges()){const t=i.position||i.range.start;const o=t.parent;const r=ng(t,o);if(r){n.push(i);continue}const s=i.type==="attribute"?ig(t,o,null):o;if(s.is("$text")){n.push(i);continue}let a;if(i.type==="attribute"){a=`attribute:${i.attributeKey}:${s.name}`}else{a=`${i.type}:${i.name}`}if(this._isReconvertTriggerEvent(a,s.name)){if(e.has(s)){continue}e.add(s);n.push({type:"reconvert",element:s})}else{n.push(i)}}return n}_isReconvertTriggerEvent(t,e){return this._reconversionEventsMapping.get(t)===e}}Vn(lg,m);function dg(t,e,n){const i=e.getRange();const o=Array.from(t.getAncestors());o.shift();o.reverse();const r=o.some((t=>{if(i.containsItem(t)){const e=n.toViewElement(t);return!!e.getCustomProperty("addHighlight")}}));return!r}function ug(t,e){const n=e.item.name||"$text";return`${t}:${n}`}function hg(t){const e=t.item;const n=rg._createFromPositionAndShift(t.previousPosition,t.length);return{item:e,range:n}}function fg(t,e){if(t.is("textProxy")){const n=e.toViewPosition(eg._createBefore(t));const i=n.parent;return i.is("$text")?i:null}return e.toViewElement(t)}class gg{constructor(t,e,n){this._lastRangeBackward=false;this._ranges=[];this._attrs=new Map;if(t){this.setTo(t,e,n)}}get anchor(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.end:t.start}return null}get focus(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.start:t.end}return null}get isCollapsed(){const t=this._ranges.length;if(t===1){return this._ranges[0].isCollapsed}else{return false}}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(t){if(this.rangeCount!=t.rangeCount){return false}else if(this.rangeCount===0){return true}if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus)){return false}for(const e of this._ranges){let n=false;for(const i of t._ranges){if(e.isEqual(i)){n=true;break}}if(!n){return false}}return true}*getRanges(){for(const t of this._ranges){yield new rg(t.start,t.end)}}getFirstRange(){let t=null;for(const e of this._ranges){if(!t||e.start.isBefore(t.start)){t=e}}return t?new rg(t.start,t.end):null}getLastRange(){let t=null;for(const e of this._ranges){if(!t||e.end.isAfter(t.end)){t=e}}return t?new rg(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,n){if(t===null){this._setRanges([])}else if(t instanceof gg){this._setRanges(t.getRanges(),t.isBackward)}else if(t&&typeof t.getRanges=="function"){this._setRanges(t.getRanges(),t.isBackward)}else if(t instanceof rg){this._setRanges([t],!!e&&!!e.backward)}else if(t instanceof eg){this._setRanges([new rg(t)])}else if(t instanceof Kf){const i=!!n&&!!n.backward;let o;if(e=="in"){o=rg._createIn(t)}else if(e=="on"){o=rg._createOn(t)}else if(e!==undefined){o=new rg(eg._createAt(t,e))}else{throw new u["a"]("model-selection-setto-required-second-parameter",[this,t])}this._setRanges([o],i)}else if(ka(t)){this._setRanges(t,e&&!!e.backward)}else{throw new u["a"]("model-selection-setto-not-selectable",[this,t])}}_setRanges(t,e=false){t=Array.from(t);const n=t.some((e=>{if(!(e instanceof rg)){throw new u["a"]("model-selection-set-ranges-not-range",[this,t])}return this._ranges.every((t=>!t.isEqual(e)))}));if(t.length===this._ranges.length&&!n){return}this._removeAllRanges();for(const e of t){this._pushRange(e)}this._lastRangeBackward=!!e;this.fire("change:range",{directChange:true})}setFocus(t,e){if(this.anchor===null){throw new u["a"]("model-selection-setfocus-no-ranges",[this,t])}const n=eg._createAt(t,e);if(n.compareWith(this.focus)=="same"){return}const i=this.anchor;if(this._ranges.length){this._popRange()}if(n.compareWith(i)=="before"){this._pushRange(new rg(n,i));this._lastRangeBackward=true}else{this._pushRange(new rg(i,n));this._lastRangeBackward=false}this.fire("change:range",{directChange:true})}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){if(this.hasAttribute(t)){this._attrs.delete(t);this.fire("change:attribute",{attributeKeys:[t],directChange:true})}}setAttribute(t,e){if(this.getAttribute(t)!==e){this._attrs.set(t,e);this.fire("change:attribute",{attributeKeys:[t],directChange:true})}}getSelectedElement(){if(this.rangeCount!==1){return null}return this.getFirstRange().getContainedElement()}is(t){return t==="selection"||t==="model:selection"}*getSelectedBlocks(){const t=new WeakSet;for(const e of this.getRanges()){const n=kg(e.start,t);if(n&&bg(n,e)){yield n}for(const n of e.getWalker()){const i=n.item;if(n.type=="elementEnd"&&pg(i,t,e)){yield i}}const i=kg(e.end,t);if(i&&!e.end.isTouching(eg._createAt(i,0))&&bg(i,e)){yield i}}}containsEntireContent(t=this.anchor.root){const e=eg._createAt(t,0);const n=eg._createAt(t,"end");return e.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(t){this._checkRange(t);this._ranges.push(new rg(t.start,t.end))}_checkRange(t){for(let e=0;e0){this._popRange()}}_popRange(){this._ranges.pop()}}Vn(gg,m);function mg(t,e){if(e.has(t)){return false}e.add(t);return t.root.document.model.schema.isBlock(t)&&t.parent}function pg(t,e,n){return mg(t,e)&&bg(t,n)}function kg(t,e){const n=t.parent;const i=n.root.document.model.schema;const o=t.parent.getAncestors({parentFirst:true,includeSelf:true});let r=false;const s=o.find((t=>{if(r){return false}r=i.isLimit(t);return!r&&mg(t,e)}));o.forEach((t=>e.add(t)));return s}function bg(t,e){const n=wg(t);if(!n){return true}const i=e.containsRange(rg._createOn(n),true);return!i}function wg(t){const e=t.root.document.model.schema;let n=t.parent;while(n){if(e.isBlock(n)){return n}n=n.parent}}class Ag extends rg{constructor(t,e){super(t,e);Cg.call(this)}detach(){this.stopListening()}is(t){return t==="liveRange"||t==="model:liveRange"||t=="range"||t==="model:range"}toRange(){return new rg(this.start,this.end)}static fromRange(t){return new Ag(t.start,t.end)}}function Cg(){this.listenTo(this.root.document.model,"applyOperation",((t,e)=>{const n=e[0];if(!n.isDocumentOperation){return}vg.call(this,n)}),{priority:"low"})}function vg(t){const e=this.getTransformedByOperation(t);const n=rg._createFromRanges(e);const i=!n.isEqual(this);const o=_g(this,t);let r=null;if(i){if(n.root.rootName=="$graveyard"){if(t.type=="remove"){r=t.sourcePosition}else{r=t.deletionPosition}}const e=this.toRange();this.start=n.start;this.end=n.end;this.fire("change:range",e,{deletionPosition:r})}else if(o){this.fire("change:content",this.toRange(),{deletionPosition:r})}}function _g(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 false}Vn(Ag,m);const yg="selection:";class xg{constructor(t){this._selection=new Eg(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(false)}observeMarkers(t){this._selection.observeMarkers(t)}is(t){return t==="selection"||t=="model:selection"||t=="documentSelection"||t=="model:documentSelection"}_setFocus(t,e){this._selection.setFocus(t,e)}_setTo(t,e,n){this._selection.setTo(t,e,n)}_setAttribute(t,e){this._selection.setAttribute(t,e)}_removeAttribute(t){this._selection.removeAttribute(t)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(t){this._selection.restoreGravity(t)}static _getStoreAttributeKey(t){return yg+t}static _isStoreAttributeKey(t){return t.startsWith(yg)}}Vn(xg,m);class Eg extends gg{constructor(t){super();this.markers=new ba({idProperty:"name"});this._model=t.model;this._document=t;this._attributePriority=new Map;this._selectionRestorePosition=null;this._hasChangedRange=false;this._overriddenGravityRegister=new Set;this._observedMarkers=new Set;this.listenTo(this._model,"applyOperation",((t,e)=>{const n=e[0];if(!n.isDocumentOperation||n.type=="marker"||n.type=="rename"||n.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 t of this.getRanges()){if(!this._document._validateSelectionRange(t)){throw new u["a"]("document-selection-wrong-position",this,{range:t})}}}));this.listenTo(this._model.markers,"update",((t,e,n,i)=>{this._updateMarker(e,i)}));this.listenTo(this._document,"change",((t,e)=>{Sg(this._model,e)}))}get isCollapsed(){const t=this._ranges.length;return t===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 t=0;t{this._hasChangedRange=true;if(e.root==this._document.graveyard){this._selectionRestorePosition=i.deletionPosition;const t=this._ranges.indexOf(e);this._ranges.splice(t,1);e.detach()}}));return e}_updateMarkers(){if(!this._observedMarkers.size){return}const t=[];let e=false;for(const e of this._model.markers){const n=e.name.split(":",1)[0];if(!this._observedMarkers.has(n)){continue}const i=e.getRange();for(const n of this.getRanges()){if(i.containsRange(n,!n.isCollapsed)){t.push(e)}}}const n=Array.from(this.markers);for(const n of t){if(!this.markers.has(n)){this.markers.add(n);e=true}}for(const n of Array.from(this.markers)){if(!t.includes(n)){this.markers.remove(n);e=true}}if(e){this.fire("change:marker",{oldMarkers:n,directChange:false})}}_updateMarker(t,e){const n=t.name.split(":",1)[0];if(!this._observedMarkers.has(n)){return}let i=false;const o=Array.from(this.markers);const r=this.markers.has(t);if(!e){if(r){this.markers.remove(t);i=true}}else{let n=false;for(const t of this.getRanges()){if(e.containsRange(t,!t.isCollapsed)){n=true;break}}if(n&&!r){this.markers.add(t);i=true}else if(!n&&r){this.markers.remove(t);i=true}}if(i){this.fire("change:marker",{oldMarkers:o,directChange:false})}}_updateAttributes(t){const e=Fa(this._getSurroundingAttributes());const n=Fa(this.getAttributes());if(t){this._attributePriority=new Map;this._attrs=new Map}else{for(const[t,e]of this._attributePriority){if(e=="low"){this._attrs.delete(t);this._attributePriority.delete(t)}}}this._setAttributesTo(e);const i=[];for(const[t,e]of this.getAttributes()){if(!n.has(t)||n.get(t)!==e){i.push(t)}}for(const[t]of n){if(!this.hasAttribute(t)){i.push(t)}}if(i.length>0){this.fire("change:attribute",{attributeKeys:i,directChange:false})}}_setAttribute(t,e,n=true){const i=n?"normal":"low";if(i=="low"&&this._attributePriority.get(t)=="normal"){return false}const o=super.getAttribute(t);if(o===e){return false}this._attrs.set(t,e);this._attributePriority.set(t,i);return true}_removeAttribute(t,e=true){const n=e?"normal":"low";if(n=="low"&&this._attributePriority.get(t)=="normal"){return false}this._attributePriority.set(t,n);if(!super.hasAttribute(t)){return false}this._attrs.delete(t);return true}_setAttributesTo(t){const e=new Set;for(const[e,n]of this.getAttributes()){if(t.get(e)===n){continue}this._removeAttribute(e,false)}for(const[n,i]of t){const t=this._setAttribute(n,i,false);if(t){e.add(n)}}return e}*_getStoredAttributes(){const t=this.getFirstPosition().parent;if(this.isCollapsed&&t.isEmpty){for(const e of t.getAttributeKeys()){if(e.startsWith(yg)){const n=e.substr(yg.length);yield[n,t.getAttribute(e)]}}}}_getSurroundingAttributes(){const t=this.getFirstPosition();const e=this._model.schema;let n=null;if(!this.isCollapsed){const t=this.getFirstRange();for(const i of t){if(i.item.is("element")&&e.isObject(i.item)){break}if(i.type=="text"){n=i.item.getAttributes();break}}}else{const i=t.textNode?t.textNode:t.nodeBefore;const o=t.textNode?t.textNode:t.nodeAfter;if(!this.isGravityOverridden){n=Dg(i)}if(!n){n=Dg(o)}if(!this.isGravityOverridden&&!n){let t=i;while(t&&!e.isInline(t)&&!n){t=t.previousSibling;n=Dg(t)}}if(!n){let t=o;while(t&&!e.isInline(t)&&!n){t=t.nextSibling;n=Dg(t)}}if(!n){n=this._getStoredAttributes()}}return n}_fixGraveyardSelection(t){const e=this._model.schema.getNearestSelectionRange(t);if(e){this._pushRange(e)}}}function Dg(t){if(t instanceof Yf||t instanceof $f){return t.getAttributes()}return null}function Sg(t,e){const n=t.document.differ;for(const i of n.getChanges()){if(i.type!="insert"){continue}const n=i.position.parent;const o=i.length===n.maxOffset;if(o){t.enqueueChange(e,(t=>{const e=Array.from(n.getAttributeKeys()).filter((t=>t.startsWith(yg)));for(const i of e){t.removeAttribute(i,n)}}))}}}class Tg{constructor(t){this._dispatchers=t}add(t){for(const e of this._dispatchers){t(e)}return this}}var Ig=1,Mg=4;function Bg(t){return aa(t,Ig|Mg)}var Ng=Bg;class zg extends Tg{elementToElement(t){return this.add(tm(t))}attributeToElement(t){return this.add(em(t))}attributeToAttribute(t){return this.add(nm(t))}markerToElement(t){return this.add(im(t))}markerToHighlight(t){return this.add(rm(t))}markerToData(t){return this.add(om(t))}}function Pg(){return(t,e,n)=>{if(!n.consumable.consume(e.item,"insert")){return}const i=n.writer;const o=n.mapper.toViewPosition(e.range.start);const r=i.createText(e.item.data);i.insert(o,r)}}function Lg(){return(t,e,n)=>{const i=n.mapper.toViewPosition(e.position);const o=e.position.getShiftedBy(e.length);const r=n.mapper.toViewPosition(o,{isPhantom:true});const s=n.writer.createRange(i,r);const a=n.writer.remove(s.getTrimmed());for(const t of n.writer.createRangeIn(a).getItems()){n.mapper.unbindViewElement(t)}}}function Rg(t,e){const n=t.createAttributeElement("span",e.attributes);if(e.classes){n._addClass(e.classes)}if(typeof e.priority==="number"){n._priority=e.priority}n._id=e.id;return n}function Og(){return(t,e,n)=>{const i=e.selection;if(i.isCollapsed){return}if(!n.consumable.consume(i,"selection")){return}const o=[];for(const t of i.getRanges()){const e=n.mapper.toViewRange(t);o.push(e)}n.writer.setSelection(o,{backward:i.isBackward})}}function jg(){return(t,e,n)=>{const i=e.selection;if(!i.isCollapsed){return}if(!n.consumable.consume(i,"selection")){return}const o=n.writer;const r=i.getFirstPosition();const s=n.mapper.toViewPosition(r);const a=o.breakAttributes(s);o.setSelection(a)}}function Fg(){return(t,e,n)=>{const i=n.writer;const o=i.document.selection;for(const t of o.getRanges()){if(t.isCollapsed){if(t.end.parent.isAttached()){n.writer.mergeAttributes(t.start)}}}i.setSelection(null)}}function Vg(t){return(e,n,i)=>{const o=t(n.attributeOldValue,i);const r=t(n.attributeNewValue,i);if(!o&&!r){return}if(!i.consumable.consume(n.item,e.name)){return}const s=i.writer;const a=s.document.selection;if(n.item instanceof gg||n.item instanceof xg){s.wrap(a.getFirstRange(),r)}else{let t=i.mapper.toViewRange(n.range);if(n.attributeOldValue!==null&&o){t=s.unwrap(t,o)}if(n.attributeNewValue!==null&&r){s.wrap(t,r)}}}}function Ug(t){return(e,n,i)=>{const o=t(n.item,i);if(!o){return}if(!i.consumable.consume(n.item,"insert")){return}const r=i.mapper.toViewPosition(n.range.start);i.mapper.bindElements(n.item,o);i.writer.insert(r,o)}}function Hg(t){return(e,n,i)=>{n.isOpening=true;const o=t(n,i);n.isOpening=false;const r=t(n,i);if(!o||!r){return}const s=n.markerRange;if(s.isCollapsed&&!i.consumable.consume(s,e.name)){return}for(const t of s){if(!i.consumable.consume(t.item,e.name)){return}}const a=i.mapper;const c=i.writer;c.insert(a.toViewPosition(s.start),o);i.mapper.bindElementToMarker(o,n.markerName);if(!s.isCollapsed){c.insert(a.toViewPosition(s.end),r);i.mapper.bindElementToMarker(r,n.markerName)}e.stop()}}function qg(){return(t,e,n)=>{const i=n.mapper.markerNameToElements(e.markerName);if(!i){return}for(const t of i){n.mapper.unbindElementFromMarkerName(t,e.markerName);n.writer.clear(n.writer.createRangeOn(t),t)}n.writer.clearClonedElementsGroup(e.markerName);t.stop()}}function Wg(t){return(e,n,i)=>{const o=t(n.markerName,i);if(!o){return}const r=n.markerRange;if(!i.consumable.consume(r,e.name)){return}Gg(r,false,i,n,o);Gg(r,true,i,n,o);e.stop()}}function Gg(t,e,n,i,o){const r=e?t.start:t.end;const s=r.nodeAfter&&r.nodeAfter.is("element")?r.nodeAfter:null;const a=r.nodeBefore&&r.nodeBefore.is("element")?r.nodeBefore:null;if(s||a){let t;let r;if(e&&s||!e&&!a){t=s;r=true}else{t=a;r=false}const c=n.mapper.toViewElement(t);if(c){Kg(c,e,r,n,i,o);return}}const c=n.mapper.toViewPosition(r);$g(c,e,n,i,o)}function Kg(t,e,n,i,o,r){const s=`data-${r.group}-${e?"start":"end"}-${n?"before":"after"}`;const a=t.hasAttribute(s)?t.getAttribute(s).split(","):[];a.unshift(r.name);i.writer.setAttribute(s,a.join(","),t);i.mapper.bindElementToMarker(t,o.markerName)}function $g(t,e,n,i,o){const r=`${o.group}-${e?"start":"end"}`;const s=o.name?{name:o.name}:null;const a=n.writer.createUIElement(r,s);n.writer.insert(t,a);n.mapper.bindElementToMarker(a,i.markerName)}function Yg(t){return(e,n,i)=>{const o=t(n.markerName,i);if(!o){return}const r=i.mapper.markerNameToElements(n.markerName);if(!r){return}for(const t of r){i.mapper.unbindElementFromMarkerName(t,n.markerName);if(t.is("containerElement")){s(`data-${o.group}-start-before`,t);s(`data-${o.group}-start-after`,t);s(`data-${o.group}-end-before`,t);s(`data-${o.group}-end-after`,t)}else{i.writer.clear(i.writer.createRangeOn(t),t)}}i.writer.clearClonedElementsGroup(n.markerName);e.stop();function s(t,e){if(e.hasAttribute(t)){const n=new Set(e.getAttribute(t).split(","));n.delete(o.name);if(n.size==0){i.writer.removeAttribute(t,e)}else{i.writer.setAttribute(t,Array.from(n).join(","),e)}}}}}function Qg(t){return(e,n,i)=>{const o=t(n.attributeOldValue,i);const r=t(n.attributeNewValue,i);if(!o&&!r){return}if(!i.consumable.consume(n.item,e.name)){return}const s=i.mapper.toViewElement(n.item);const a=i.writer;if(!s){throw new u["a"]("conversion-attribute-to-attribute-on-text",[n,i])}if(n.attributeOldValue!==null&&o){if(o.key=="class"){const t=Aa(o.value);for(const e of t){a.removeClass(e,s)}}else if(o.key=="style"){const t=Object.keys(o.value);for(const e of t){a.removeStyle(e,s)}}else{a.removeAttribute(o.key,s)}}if(n.attributeNewValue!==null&&r){if(r.key=="class"){const t=Aa(r.value);for(const e of t){a.addClass(e,s)}}else if(r.key=="style"){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)}}}}function Zg(t){return(e,n,i)=>{if(!n.item){return}if(!(n.item instanceof gg||n.item instanceof xg)&&!n.item.is("$textProxy")){return}const o=dm(t,n,i);if(!o){return}if(!i.consumable.consume(n.item,e.name)){return}const r=i.writer;const s=Rg(r,o);const a=r.document.selection;if(n.item instanceof gg||n.item instanceof xg){r.wrap(a.getFirstRange(),s,a)}else{const t=i.mapper.toViewRange(n.range);const e=r.wrap(t,s);for(const t of e.getItems()){if(t.is("attributeElement")&&t.isSimilar(s)){i.mapper.bindElementToMarker(t,n.markerName);break}}}}}function Jg(t){return(e,n,i)=>{if(!n.item){return}if(!(n.item instanceof Zf)){return}const o=dm(t,n,i);if(!o){return}if(!i.consumable.test(n.item,e.name)){return}const r=i.mapper.toViewElement(n.item);if(r&&r.getCustomProperty("addHighlight")){i.consumable.consume(n.item,e.name);for(const t of rg._createIn(n.item)){i.consumable.consume(t.item,e.name)}r.getCustomProperty("addHighlight")(r,o,i.writer);i.mapper.bindElementToMarker(r,n.markerName)}}}function Xg(t){return(e,n,i)=>{if(n.markerRange.isCollapsed){return}const o=dm(t,n,i);if(!o){return}const r=Rg(i.writer,o);const s=i.mapper.markerNameToElements(n.markerName);if(!s){return}for(const t of s){i.mapper.unbindElementFromMarkerName(t,n.markerName);if(t.is("attributeElement")){i.writer.unwrap(i.writer.createRangeOn(t),r)}else{t.getCustomProperty("removeHighlight")(t,o.id,i.writer)}}i.writer.clearClonedElementsGroup(n.markerName);e.stop()}}function tm(t){t=Ng(t);t.view=sm(t.view,"container");return e=>{e.on("insert:"+t.model,Ug(t.view),{priority:t.converterPriority||"normal"});if(t.triggerBy){if(t.triggerBy.attributes){for(const n of t.triggerBy.attributes){e._mapReconversionTriggerEvent(t.model,`attribute:${n}:${t.model}`)}}if(t.triggerBy.children){for(const n of t.triggerBy.children){e._mapReconversionTriggerEvent(t.model,`insert:${n}`);e._mapReconversionTriggerEvent(t.model,`remove:${n}`)}}}}}function em(t){t=Ng(t);const e=t.model.key?t.model.key:t.model;let n="attribute:"+e;if(t.model.name){n+=":"+t.model.name}if(t.model.values){for(const e of t.model.values){t.view[e]=sm(t.view[e],"attribute")}}else{t.view=sm(t.view,"attribute")}const i=cm(t);return e=>{e.on(n,Vg(i),{priority:t.converterPriority||"normal"})}}function nm(t){t=Ng(t);const e=t.model.key?t.model.key:t.model;let n="attribute:"+e;if(t.model.name){n+=":"+t.model.name}if(t.model.values){for(const e of t.model.values){t.view[e]=lm(t.view[e])}}else{t.view=lm(t.view)}const i=cm(t);return e=>{e.on(n,Qg(i),{priority:t.converterPriority||"normal"})}}function im(t){t=Ng(t);t.view=sm(t.view,"ui");return e=>{e.on("addMarker:"+t.model,Hg(t.view),{priority:t.converterPriority||"normal"});e.on("removeMarker:"+t.model,qg(t.view),{priority:t.converterPriority||"normal"})}}function om(t){t=Ng(t);const e=t.model;if(!t.view){t.view=n=>({group:e,name:n.substr(t.model.length+1)})}return n=>{n.on("addMarker:"+e,Wg(t.view),{priority:t.converterPriority||"normal"});n.on("removeMarker:"+e,Yg(t.view),{priority:t.converterPriority||"normal"})}}function rm(t){return e=>{e.on("addMarker:"+t.model,Zg(t.view),{priority:t.converterPriority||"normal"});e.on("addMarker:"+t.model,Jg(t.view),{priority:t.converterPriority||"normal"});e.on("removeMarker:"+t.model,Xg(t.view),{priority:t.converterPriority||"normal"})}}function sm(t,e){if(typeof t=="function"){return t}return(n,i)=>am(t,i,e)}function am(t,e,n){if(typeof t=="string"){t={name:t}}let i;const o=e.writer;const r=Object.assign({},t.attributes);if(n=="container"){i=o.createContainerElement(t.name,r)}else if(n=="attribute"){const e={priority:t.priority||Ul.DEFAULT_PRIORITY};i=o.createAttributeElement(t.name,r,e)}else{i=o.createUIElement(t.name,r)}if(t.styles){const e=Object.keys(t.styles);for(const n of e){o.setStyle(n,t.styles[n],i)}}if(t.classes){const e=t.classes;if(typeof e=="string"){o.addClass(e,i)}else{for(const t of e){o.addClass(t,i)}}}return i}function cm(t){if(t.model.values){return(e,n)=>{const i=t.view[e];if(i){return i(e,n)}return null}}else{return t.view}}function lm(t){if(typeof t=="string"){return e=>({key:t,value:e})}else if(typeof t=="object"){if(t.value){return()=>t}else{return e=>({key:t.key,value:e})}}else{return t}}function dm(t,e,n){const i=typeof t=="function"?t(e,n):t;if(!i){return null}if(!i.priority){i.priority=10}if(!i.id){i.id=e.markerName}return i}function um(t){const{schema:e,document:n}=t.model;for(const i of n.getRootNames()){const o=n.getRoot(i);if(o.isEmpty&&!e.checkChild(o,"$text")){if(e.checkChild(o,"paragraph")){t.insertElement("paragraph",o);return true}}}return false}function hm(t,e,n){const i=n.createContext(t);if(!n.checkChild(i,"paragraph")){return false}if(!n.checkChild(i.push("paragraph"),e)){return false}return true}function fm(t,e){const n=e.createElement("paragraph");e.insert(n,t);return e.createPositionAt(n,0)}class gm extends Tg{elementToElement(t){return this.add(bm(t))}elementToAttribute(t){return this.add(wm(t))}attributeToAttribute(t){return this.add(Am(t))}elementToMarker(t){return this.add(Cm(t))}dataToMarker(t){return this.add(vm(t))}}function mm(){return(t,e,n)=>{if(!e.modelRange&&n.consumable.consume(e.viewItem,{name:true})){const{modelRange:t,modelCursor:i}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t;e.modelCursor=i}}}function pm(){return(t,e,{schema:n,consumable:i,writer:o})=>{let r=e.modelCursor;if(!i.test(e.viewItem)){return}if(!n.checkChild(r,"$text")){if(!hm(r,"$text",n)){return}r=fm(r,o)}i.consume(e.viewItem);const s=o.createText(e.viewItem.data);o.insert(s,r);e.modelRange=o.createRange(r,r.getShiftedBy(s.offsetSize));e.modelCursor=e.modelRange.end}}function km(t,e){return(n,i)=>{const o=i.newSelection;const r=[];for(const t of o.getRanges()){r.push(e.toModelRange(t))}const s=t.createSelection(r,{backward:o.isBackward});if(!s.isEqual(t.document.selection)){t.change((t=>{t.setSelection(s)}))}}}function bm(t){t=Ng(t);const e=xm(t);const n=ym(t.view);const i=n?"element:"+n:"element";return n=>{n.on(i,e,{priority:t.converterPriority||"normal"})}}function wm(t){t=Ng(t);Sm(t);const e=Tm(t,false);const n=ym(t.view);const i=n?"element:"+n:"element";return n=>{n.on(i,e,{priority:t.converterPriority||"low"})}}function Am(t){t=Ng(t);let e=null;if(typeof t.view=="string"||t.view.key){e=Dm(t)}Sm(t,e);const n=Tm(t,true);return e=>{e.on("element",n,{priority:t.converterPriority||"low"})}}function Cm(t){t=Ng(t);Bm(t);return bm(t)}function vm(t){t=Ng(t);if(!t.model){t.model=e=>e?t.view+":"+e:t.view}const e=xm(Nm(t,"start"));const n=xm(Nm(t,"end"));return i=>{i.on("element:"+t.view+"-start",e,{priority:t.converterPriority||"normal"});i.on("element:"+t.view+"-end",n,{priority:t.converterPriority||"normal"});const o=l.get("low");const r=l.get("highest");const s=l.get(t.converterPriority)/r;i.on("element",_m(t),{priority:o+s})}}function _m(t){return(e,n,i)=>{const o=`data-${t.view}`;if(!i.consumable.test(n.viewItem,{attributes:o+"-end-after"})&&!i.consumable.test(n.viewItem,{attributes:o+"-start-after"})&&!i.consumable.test(n.viewItem,{attributes:o+"-end-before"})&&!i.consumable.test(n.viewItem,{attributes:o+"-start-before"})){return}if(!n.modelRange){Object.assign(n,i.convertChildren(n.viewItem,n.modelCursor))}if(i.consumable.consume(n.viewItem,{attributes:o+"-end-after"})){r(n.modelRange.end,n.viewItem.getAttribute(o+"-end-after").split(","))}if(i.consumable.consume(n.viewItem,{attributes:o+"-start-after"})){r(n.modelRange.end,n.viewItem.getAttribute(o+"-start-after").split(","))}if(i.consumable.consume(n.viewItem,{attributes:o+"-end-before"})){r(n.modelRange.start,n.viewItem.getAttribute(o+"-end-before").split(","))}if(i.consumable.consume(n.viewItem,{attributes:o+"-start-before"})){r(n.modelRange.start,n.viewItem.getAttribute(o+"-start-before").split(","))}function r(e,o){for(const r of o){const o=t.model(r,i);const s=i.writer.createElement("$marker",{"data-name":o});i.writer.insert(s,e);if(n.modelCursor.isEqual(e)){n.modelCursor=n.modelCursor.getShiftedBy(1)}else{n.modelCursor=n.modelCursor._getTransformedByInsertion(e,1)}n.modelRange=n.modelRange._getTransformedByInsertion(e,1)[0]}}}}function ym(t){if(typeof t=="string"){return t}if(typeof t=="object"&&typeof t.name=="string"){return t.name}return null}function xm(t){const e=new Va(t.view);return(n,i,o)=>{const r=e.match(i.viewItem);if(!r){return}const s=r.match;s.name=true;if(!o.consumable.test(i.viewItem,s)){return}const a=Em(t.model,i.viewItem,o);if(!a){return}if(!o.safeInsert(a,i.modelCursor)){return}o.consumable.consume(i.viewItem,s);o.convertChildren(i.viewItem,a);o.updateConversionResult(a,i)}}function Em(t,e,n){if(t instanceof Function){return t(e,n)}else{return n.writer.createElement(t)}}function Dm(t){if(typeof t.view=="string"){t.view={key:t.view}}const e=t.view.key;let n;if(e=="class"||e=="style"){const i=e=="class"?"classes":"styles";n={[i]:t.view.value}}else{const i=typeof t.view.value=="undefined"?/[\s\S]*/:t.view.value;n={attributes:{[e]:i}}}if(t.view.name){n.name=t.view.name}t.view=n;return e}function Sm(t,e=null){const n=e===null?true:t=>t.getAttribute(e);const i=typeof t.model!="object"?t.model:t.model.key;const o=typeof t.model!="object"||typeof t.model.value=="undefined"?n:t.model.value;t.model={key:i,value:o}}function Tm(t,e){const n=new Va(t.view);return(i,o,r)=>{const s=n.match(o.viewItem);if(!s){return}if(Im(t.view,o.viewItem)){s.match.name=true}else{delete s.match.name}if(!r.consumable.test(o.viewItem,s.match)){return}const a=t.model.key;const c=typeof t.model.value=="function"?t.model.value(o.viewItem,r):t.model.value;if(c===null){return}if(!o.modelRange){Object.assign(o,r.convertChildren(o.viewItem,o.modelCursor))}const l=Mm(o.modelRange,{key:a,value:c},e,r);if(l){r.consumable.consume(o.viewItem,s.match)}}}function Im(t,e){const n=typeof t=="function"?t(e):t;if(typeof n=="object"&&!ym(n)){return false}return!n.classes&&!n.attributes&&!n.styles}function Mm(t,e,n,i){let o=false;for(const r of Array.from(t.getItems({shallow:n}))){if(!i.schema.checkAttribute(r,e.key)){continue}o=true;if(r.hasAttribute(e.key)){continue}i.writer.setAttribute(e.key,e.value,r)}return o}function Bm(t){const e=t.model;t.model=(t,n)=>{const i=typeof e=="string"?e:e(t,n);return n.writer.createElement("$marker",{"data-name":i})}}function Nm(t,e){const n={};n.view=t.view+"-"+e;n.model=(e,n)=>{const i=e.getAttribute("name");const o=t.model(i,n);return n.writer.createElement("$marker",{"data-name":o})};return n}class zm{constructor(t,e){this.model=t;this.view=new Gf(e);this.mapper=new sg;this.downcastDispatcher=new lg({mapper:this.mapper,schema:t.schema});const n=this.model.document;const i=n.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(n,"change",(()=>{this.view.change((t=>{this.downcastDispatcher.convertChanges(n.differ,o,t);this.downcastDispatcher.convertSelection(i,o,t)}))}),{priority:"low"});this.listenTo(this.view.document,"selectionChange",km(this.model,this.mapper));this.downcastDispatcher.on("insert:$text",Pg(),{priority:"lowest"});this.downcastDispatcher.on("remove",Lg(),{priority:"low"});this.downcastDispatcher.on("selection",Fg(),{priority:"high"});this.downcastDispatcher.on("selection",Og(),{priority:"low"});this.downcastDispatcher.on("selection",jg(),{priority:"low"});this.view.document.roots.bindTo(this.model.document.roots).using((t=>{if(t.rootName=="$graveyard"){return null}const e=new _l(this.view.document,t.name);e.rootName=t.rootName;this.mapper.bindElements(t,e);return e}))}destroy(){this.view.destroy();this.stopListening()}}Vn(zm,In);class Pm{constructor(){this._commands=new Map}add(t,e){this._commands.set(t,e)}get(t){return this._commands.get(t)}execute(t,...e){const n=this.get(t);if(!n){throw new u["a"]("commandcollection-command-not-found",this,{commandName:t})}return n.execute(...e)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const t of this.commands()){t.destroy()}}}class Lm{constructor(){this._consumables=new Map}add(t,e){let n;if(t.is("$text")||t.is("documentFragment")){this._consumables.set(t,true);return}if(!this._consumables.has(t)){n=new Rm(t);this._consumables.set(t,n)}else{n=this._consumables.get(t)}n.add(e)}test(t,e){const n=this._consumables.get(t);if(n===undefined){return null}if(t.is("$text")||t.is("documentFragment")){return n}return n.test(e)}consume(t,e){if(this.test(t,e)){if(t.is("$text")||t.is("documentFragment")){this._consumables.set(t,false)}else{this._consumables.get(t).consume(e)}return true}return false}revert(t,e){const n=this._consumables.get(t);if(n!==undefined){if(t.is("$text")||t.is("documentFragment")){this._consumables.set(t,true)}else{n.revert(e)}}}static consumablesFromElement(t){const e={element:t,name:true,attributes:[],classes:[],styles:[]};const n=t.getAttributeKeys();for(const t of n){if(t=="style"||t=="class"){continue}e.attributes.push(t)}const i=t.getClassNames();for(const t of i){e.classes.push(t)}const o=t.getStyleNames();for(const t of o){e.styles.push(t)}return e}static createFrom(t,e){if(!e){e=new Lm(t)}if(t.is("$text")){e.add(t);return e}if(t.is("element")){e.add(t,Lm.consumablesFromElement(t))}if(t.is("documentFragment")){e.add(t)}for(const n of t.getChildren()){e=Lm.createFrom(n,e)}return e}}class Rm{constructor(t){this.element=t;this._canConsumeName=null;this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(t){if(t.name){this._canConsumeName=true}for(const e in this._consumables){if(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 n=this._test(e,t[e]);if(n!==true){return n}}}return true}consume(t){if(t.name){this._canConsumeName=false}for(const e in this._consumables){if(e in t){this._consume(e,t[e])}}}revert(t){if(t.name){this._canConsumeName=true}for(const e in this._consumables){if(e in t){this._revert(e,t[e])}}}_add(t,e){const n=xe(e)?e:[e];const i=this._consumables[t];for(const e of n){if(t==="attributes"&&(e==="class"||e==="style")){throw new u["a"]("viewconsumable-invalid-attribute",this)}i.set(e,true);if(t==="styles"){for(const t of this.element.document.stylesProcessor.getRelatedStyles(e)){i.set(t,true)}}}}_test(t,e){const n=xe(e)?e:[e];const i=this._consumables[t];for(const e of n){if(t==="attributes"&&(e==="class"||e==="style")){const t=e=="class"?"classes":"styles";const n=this._test(t,[...this._consumables[t].keys()]);if(n!==true){return n}}else{const t=i.get(e);if(t===undefined){return null}if(!t){return false}}}return true}_consume(t,e){const n=xe(e)?e:[e];const i=this._consumables[t];for(const e of n){if(t==="attributes"&&(e==="class"||e==="style")){const t=e=="class"?"classes":"styles";this._consume(t,[...this._consumables[t].keys()])}else{i.set(e,false);if(t=="styles"){for(const t of this.element.document.stylesProcessor.getRelatedStyles(e)){i.set(t,false)}}}}}_revert(t,e){const n=xe(e)?e:[e];const i=this._consumables[t];for(const e of n){if(t==="attributes"&&(e==="class"||e==="style")){const t=e=="class"?"classes":"styles";this._revert(t,[...this._consumables[t].keys()])}else{const t=i.get(e);if(t===false){i.set(e,true)}}}}}class Om{constructor(){this._sourceDefinitions={};this._attributeProperties={};this.decorate("checkChild");this.decorate("checkAttribute");this.on("checkAttribute",((t,e)=>{e[0]=new jm(e[0])}),{priority:"highest"});this.on("checkChild",((t,e)=>{e[0]=new jm(e[0]);e[1]=this.getDefinition(e[1])}),{priority:"highest"})}register(t,e){if(this._sourceDefinitions[t]){throw new u["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 u["a"]("schema-cannot-extend-missing-item",this,{itemName:t})}this._sourceDefinitions[t].push(Object.assign({},e));this._clearCache()}getDefinitions(){if(!this._compiledDefinitions){this._compile()}return this._compiledDefinitions}getDefinition(t){let e;if(typeof t=="string"){e=t}else if(t.is&&(t.is("$text")||t.is("$textProxy"))){e="$text"}else{e=t.name}return 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);if(!e){return false}return!!(e.isLimit||e.isObject)}isObject(t){const e=this.getDefinition(t);if(!e){return false}return!!(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);if(!e){return false}return!!(e.isSelectable||e.isObject)}isContent(t){const e=this.getDefinition(t);if(!e){return false}return!!(e.isContent||e.isObject)}checkChild(t,e){if(!e){return false}return this._checkContextMatch(e,t)}checkAttribute(t,e){const n=this.getDefinition(t.last);if(!n){return false}return n.allowAttributes.includes(e)}checkMerge(t,e=null){if(t instanceof eg){const e=t.nodeBefore;const n=t.nodeAfter;if(!(e instanceof Zf)){throw new u["a"]("schema-check-merge-no-element-before",this)}if(!(n instanceof Zf)){throw new u["a"]("schema-check-merge-no-element-after",this)}return this.checkMerge(e,n)}for(const n of e.getChildren()){if(!this.checkChild(t,n)){return false}}return true}addChildCheck(t){this.on("checkChild",((e,[n,i])=>{if(!i){return}const o=t(n,i);if(typeof o=="boolean"){e.stop();e.return=o}}),{priority:"high"})}addAttributeCheck(t){this.on("checkAttribute",((e,[n,i])=>{const o=t(n,i);if(typeof o=="boolean"){e.stop();e.return=o}}),{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 eg){e=t.parent}else{const n=t instanceof rg?[t]:Array.from(t.getRanges());e=n.reduce(((t,e)=>{const n=e.getCommonAncestor();if(!t){return n}return t.getCommonAncestor(n,{includeSelf:true})}),null)}while(!this.isLimit(e)){if(e.parent){e=e.parent}else{break}}return e}checkAttributeInSelection(t,e){if(t.isCollapsed){const n=t.getFirstPosition();const i=[...n.getAncestors(),new $f("",t.getAttributes())];return this.checkAttribute(i,e)}else{const n=t.getRanges();for(const t of n){for(const n of t){if(this.checkAttribute(n.item,e)){return true}}}}return false}*getValidRanges(t,e){t=np(t);for(const n of t){yield*this._getValidRangesForRange(n,e)}}getNearestSelectionRange(t,e="both"){if(this.checkChild(t,"$text")){return new rg(t)}let n,i;const o=t.getAncestors().reverse().find((t=>this.isLimit(t)))||t.root;if(e=="both"||e=="backward"){n=new Xf({boundaries:rg._createIn(o),startPosition:t,direction:"backward"})}if(e=="both"||e=="forward"){i=new Xf({boundaries:rg._createIn(o),startPosition:t})}for(const t of ep(n,i)){const e=t.walker==n?"elementEnd":"elementStart";const i=t.value;if(i.type==e&&this.isObject(i.item)){return rg._createOn(i.item)}if(this.checkChild(i.nextPosition,"$text")){return new rg(i.nextPosition)}}return null}findAllowedParent(t,e){let n=t.parent;while(n){if(this.checkChild(n,e)){return n}if(this.isLimit(n)){return null}n=n.parent}return null}removeDisallowedAttributes(t,e){for(const n of t){if(n.is("$text")){ip(this,n,e)}else{const t=rg._createIn(n);const i=t.getPositions();for(const t of i){const n=t.nodeBefore||t.parent;ip(this,n,e)}}}}createContext(t){return new jm(t)}_clearCache(){this._compiledDefinitions=null}_compile(){const t={};const e=this._sourceDefinitions;const n=Object.keys(e);for(const i of n){t[i]=Fm(e[i],i)}for(const e of n){Vm(t,e)}for(const e of n){Um(t,e)}for(const e of n){Hm(t,e)}for(const e of n){qm(t,e);Wm(t,e)}for(const e of n){Gm(t,e);Km(t,e);$m(t,e)}this._compiledDefinitions=t}_checkContextMatch(t,e,n=e.length-1){const i=e.getItem(n);if(t.allowIn.includes(i.name)){if(n==0){return true}else{const t=this.getDefinition(i);return this._checkContextMatch(t,e,n-1)}}else{return false}}*_getValidRangesForRange(t,e){let n=t.start;let i=t.start;for(const o of t.getItems({shallow:true})){if(o.is("element")){yield*this._getValidRangesForRange(rg._createIn(o),e)}if(!this.checkAttribute(o,e)){if(!n.isEqual(i)){yield new rg(n,i)}n=eg._createAfter(o)}i=eg._createAfter(o)}if(!n.isEqual(i)){yield new rg(n,i)}}}Vn(Om,In);class jm{constructor(t){if(t instanceof jm){return t}if(typeof t=="string"){t=[t]}else if(!Array.isArray(t)){t=t.getAncestors({includeSelf:true})}this._items=t.map(tp)}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 jm([t]);e._items=[...this._items,...e._items];return 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 Fm(t,e){const n={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};Ym(t,n);Qm(t,n,"allowIn");Qm(t,n,"allowContentOf");Qm(t,n,"allowWhere");Qm(t,n,"allowAttributes");Qm(t,n,"allowAttributesOf");Qm(t,n,"allowChildren");Qm(t,n,"inheritTypesFrom");Zm(t,n);return n}function Vm(t,e){const n=t[e];for(const i of n.allowChildren){const n=t[i];if(!n){continue}n.allowIn.push(e)}n.allowChildren.length=0}function Um(t,e){for(const n of t[e].allowContentOf){if(t[n]){const i=Jm(t,n);i.forEach((t=>{t.allowIn.push(e)}))}}delete t[e].allowContentOf}function Hm(t,e){for(const n of t[e].allowWhere){const i=t[n];if(i){const n=i.allowIn;t[e].allowIn.push(...n)}}delete t[e].allowWhere}function qm(t,e){for(const n of t[e].allowAttributesOf){const i=t[n];if(i){const n=i.allowAttributes;t[e].allowAttributes.push(...n)}}delete t[e].allowAttributesOf}function Wm(t,e){const n=t[e];for(const e of n.inheritTypesFrom){const i=t[e];if(i){const t=Object.keys(i).filter((t=>t.startsWith("is")));for(const e of t){if(!(e in n)){n[e]=i[e]}}}}delete n.inheritTypesFrom}function Gm(t,e){const n=t[e];const i=n.allowIn.filter((e=>t[e]));n.allowIn=Array.from(new Set(i))}function Km(t,e){const n=t[e];for(const i of n.allowIn){const n=t[i];n.allowChildren.push(e)}}function $m(t,e){const n=t[e];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function Ym(t,e){for(const n of t){const t=Object.keys(n).filter((t=>t.startsWith("is")));for(const i of t){e[i]=n[i]}}}function Qm(t,e,n){for(const i of t){if(typeof i[n]=="string"){e[n].push(i[n])}else if(Array.isArray(i[n])){e[n].push(...i[n])}}}function Zm(t,e){for(const n of t){const t=n.inheritAllFrom;if(t){e.allowContentOf.push(t);e.allowWhere.push(t);e.allowAttributesOf.push(t);e.inheritTypesFrom.push(t)}}}function Jm(t,e){const n=t[e];return Xm(t).filter((t=>t.allowIn.includes(n.name)))}function Xm(t){return Object.keys(t).map((e=>t[e]))}function tp(t){if(typeof t=="string"||t.is("documentFragment")){return{name:typeof t=="string"?t:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}}else{return{name:t.is("element")?t.name:"$text",*getAttributeKeys(){yield*t.getAttributeKeys()},getAttribute(e){return t.getAttribute(e)}}}}function*ep(t,e){let n=false;while(!n){n=true;if(t){const e=t.next();if(!e.done){n=false;yield{walker:t,value:e.value}}}if(e){const t=e.next();if(!t.done){n=false;yield{walker:e,value:t.value}}}}}function*np(t){for(const e of t){yield*e.getMinimalFlatRanges()}}function ip(t,e,n){for(const i of e.getAttributeKeys()){if(!t.checkAttribute(e,i)){n.removeAttribute(i,e)}}}class op{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,n=["$root"]){this.fire("viewCleanup",t);this._modelCursor=sp(n,e);this.conversionApi.writer=e;this.conversionApi.consumable=Lm.createFrom(t);this.conversionApi.store={};const{modelRange:i}=this._convertItem(t,this._modelCursor);const o=e.createDocumentFragment();if(i){this._removeEmptyElements();for(const t of Array.from(this._modelCursor.parent.getChildren())){e.append(t,o)}o.markers=rp(o,e)}this._modelCursor=null;this._splitParts.clear();this._cursorParents.clear();this.conversionApi.writer=null;this.conversionApi.store=null;return o}_convertItem(t,e){const n=Object.assign({viewItem:t,modelCursor:e,modelRange:null});if(t.is("element")){this.fire("element:"+t.name,n,this.conversionApi)}else if(t.is("$text")){this.fire("text",n,this.conversionApi)}else{this.fire("documentFragment",n,this.conversionApi)}if(n.modelRange&&!(n.modelRange instanceof rg)){throw new u["a"]("view-conversion-dispatcher-incorrect-result",this)}return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(t,e){let n=e.is("position")?e:eg._createAt(e,0);const i=new rg(n);for(const e of Array.from(t.getChildren())){const t=this._convertItem(e,n);if(t.modelRange instanceof rg){i.end=t.modelRange.end;n=t.modelCursor}}return{modelRange:i,modelCursor:n}}_safeInsert(t,e){const n=this._splitToAllowedParent(t,e);if(!n){return false}this.conversionApi.writer.insert(t,n.position);return true}_updateConversionResult(t,e){const n=this._getSplitParts(t);const i=this.conversionApi.writer;if(!e.modelRange){e.modelRange=i.createRange(i.createPositionBefore(t),i.createPositionAfter(n[n.length-1]))}const o=this._cursorParents.get(t);if(o){e.modelCursor=i.createPositionAt(o,0)}else{e.modelCursor=e.modelRange.end}}_splitToAllowedParent(t,e){const{schema:n,writer:i}=this.conversionApi;let o=n.findAllowedParent(e,t);if(o){if(o===e.parent){return{position:e}}if(this._modelCursor.parent.getAncestors().includes(o)){o=null}}if(!o){if(!hm(e,t,n)){return null}return{position:fm(e,i)}}const r=this.conversionApi.writer.split(e,o);const s=[];for(const t of r.range.getWalker()){if(t.type=="elementEnd"){s.push(t.item)}else{const e=s.pop();const n=t.item;this._registerSplitPair(e,n)}}const a=r.range.end.parent;this._cursorParents.set(t,a);return{position:r.position,cursorParent:a}}_registerSplitPair(t,e){if(!this._splitParts.has(t)){this._splitParts.set(t,[t])}const n=this._splitParts.get(t);this._splitParts.set(e,n);n.push(e)}_getSplitParts(t){let e;if(!this._splitParts.has(t)){e=[t]}else{e=this._splitParts.get(t)}return e}_removeEmptyElements(){let t=false;for(const e of this._splitParts.keys()){if(e.isEmpty){this.conversionApi.writer.remove(e);this._splitParts.delete(e);t=true}}if(t){this._removeEmptyElements()}}}Vn(op,m);function rp(t,e){const n=new Set;const i=new Map;const o=rg._createIn(t).getItems();for(const t of o){if(t.name=="$marker"){n.add(t)}}for(const t of n){const n=t.getAttribute("data-name");const o=e.createPositionBefore(t);if(!i.has(n)){i.set(n,new rg(o.clone()))}else{i.get(n).end=o.clone()}e.remove(t)}return i}function sp(t,e){let n;for(const i of new jm(t)){const t={};for(const e of i.getAttributeKeys()){t[e]=i.getAttribute(e)}const o=e.createElement(i.name,t);if(n){e.append(o,n)}n=eg._createAt(o,0)}return n}class ap{getHtml(t){const e=document.implementation.createHTMLDocument("");const n=e.createElement("div");n.appendChild(t);return n.innerHTML}}class cp{constructor(t){this.domParser=new DOMParser;this.domConverter=new Eu(t,{renderingMode:"data"});this.htmlWriter=new ap}toData(t){const e=this.domConverter.viewToDom(t,document);return this.htmlWriter.getHtml(e)}toView(t){const e=this._toDom(t);return this.domConverter.domToView(e)}registerRawContentMatcher(t){this.domConverter.registerRawContentMatcher(t)}useFillerType(t){this.domConverter.blockFillerMode=t=="marked"?"markedNbsp":"nbsp"}_toDom(t){const e=this.domParser.parseFromString(t,"text/html");const n=e.createDocumentFragment();let i=e.firstChild;while(!i.isSameNode(e.documentElement)){const t=i;i=i.nextSibling;if(t.nodeType==Node.COMMENT_NODE){n.appendChild(t)}}const o=e.body.childNodes;while(o.length>0){n.appendChild(o[0])}return n}}class lp{constructor(t,e){this.model=t;this.mapper=new sg;this.downcastDispatcher=new lg({mapper:this.mapper,schema:t.schema});this.downcastDispatcher.on("insert:$text",Pg(),{priority:"lowest"});this.upcastDispatcher=new op({schema:t.schema});this.viewDocument=new Fl(e);this.stylesProcessor=e;this.htmlProcessor=new cp(this.viewDocument);this.processor=this.htmlProcessor;this._viewWriter=new xd(this.viewDocument);this.upcastDispatcher.on("text",pm(),{priority:"lowest"});this.upcastDispatcher.on("element",mm(),{priority:"lowest"});this.upcastDispatcher.on("documentFragment",mm(),{priority:"lowest"});this.decorate("init");this.decorate("set");this.decorate("get");this.on("init",(()=>{this.fire("ready")}),{priority:"lowest"});this.on("ready",(()=>{this.model.enqueueChange("transparent",um)}),{priority:"lowest"})}get(t={}){const{rootName:e="main",trim:n="empty"}=t;if(!this._checkIfRootsExists([e])){throw new u["a"]("datacontroller-get-non-existent-root",this)}const i=this.model.document.getRoot(e);if(n==="empty"&&!this.model.hasContent(i,{ignoreWhitespaces:true})){return""}return this.stringify(i,t)}stringify(t,e={}){const n=this.toView(t,e);return this.processor.toData(n)}toView(t,e={}){const n=this.viewDocument;const i=this._viewWriter;this.mapper.clearBindings();const o=rg._createIn(t);const r=new _d(n);this.mapper.bindElements(t,r);this.downcastDispatcher.conversionApi.options=e;this.downcastDispatcher.convertInsert(o,i);const s=t.is("documentFragment")?Array.from(t.markers):dp(t);for(const[t,e]of s){this.downcastDispatcher.convertMarkerAdd(t,e,i)}delete this.downcastDispatcher.conversionApi.options;return r}init(t){if(this.model.document.version){throw new u["a"]("datacontroller-init-document-not-empty",this)}let e={};if(typeof t==="string"){e.main=t}else{e=t}if(!this._checkIfRootsExists(Object.keys(e))){throw new u["a"]("datacontroller-init-non-existent-root",this)}this.model.enqueueChange("transparent",(t=>{for(const n of Object.keys(e)){const i=this.model.document.getRoot(n);t.insert(this.parse(e[n],i),i,0)}}));return Promise.resolve()}set(t,e={}){let n={};if(typeof t==="string"){n.main=t}else{n=t}if(!this._checkIfRootsExists(Object.keys(n))){throw new u["a"]("datacontroller-set-non-existent-root",this)}const i=e.batchType||"default";this.model.enqueueChange(i,(t=>{t.setSelection(null);t.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const e of Object.keys(n)){const i=this.model.document.getRoot(e);t.remove(t.createRangeIn(i));t.insert(this.parse(n[e],i),i,0)}}))}parse(t,e="$root"){const n=this.processor.toView(t);return this.toModel(n,e)}toModel(t,e="$root"){return this.model.change((n=>this.upcastDispatcher.convert(t,n,e)))}addStyleProcessorRules(t){t(this.stylesProcessor)}registerRawContentMatcher(t){if(this.processor&&this.processor!==this.htmlProcessor){this.processor.registerRawContentMatcher(t)}this.htmlProcessor.registerRawContentMatcher(t)}destroy(){this.stopListening()}_checkIfRootsExists(t){for(const e of t){if(!this.model.document.getRootNames().includes(e)){return false}}return true}}Vn(lp,In);function dp(t){const e=[];const n=t.root.document;if(!n){return[]}const i=rg._createIn(t);for(const t of n.model.markers){const n=t.getRange();const o=n.isCollapsed;const r=n.start.isEqual(i.start)||n.end.isEqual(i.end);if(o&&r){e.push([t.name,n])}else{const o=i.getIntersection(n);if(o){e.push([t.name,o])}}}return e.sort((([t,e],[n,i])=>{if(e.end.compareWith(i.start)!=="after"){return 1}else if(e.start.compareWith(i.end)!=="before"){return-1}else{switch(e.start.compareWith(i.start)){case"before":return 1;case"after":return-1;default:switch(e.end.compareWith(i.end)){case"before":return 1;case"after":return-1;default:return n.localeCompare(t)}}}}))}class up{constructor(t,e){this._helpers=new Map;this._downcast=Aa(t);this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:true});this._upcast=Aa(e);this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:false})}addAlias(t,e){const n=this._downcast.includes(e);const i=this._upcast.includes(e);if(!i&&!n){throw new u["a"]("conversion-add-alias-dispatcher-not-registered",this)}this._createConversionHelpers({name:t,dispatchers:[e],isDowncast:n})}for(t){if(!this._helpers.has(t)){throw new u["a"]("conversion-for-unknown-group",this)}return this._helpers.get(t)}elementToElement(t){this.for("downcast").elementToElement(t);for(const{model:e,view:n}of hp(t)){this.for("upcast").elementToElement({model:e,view:n,converterPriority:t.converterPriority})}}attributeToElement(t){this.for("downcast").attributeToElement(t);for(const{model:e,view:n}of hp(t)){this.for("upcast").elementToAttribute({view:n,model:e,converterPriority:t.converterPriority})}}attributeToAttribute(t){this.for("downcast").attributeToAttribute(t);for(const{model:e,view:n}of hp(t)){this.for("upcast").attributeToAttribute({view:n,model:e})}}_createConversionHelpers({name:t,dispatchers:e,isDowncast:n}){if(this._helpers.has(t)){throw new u["a"]("conversion-group-exists",this)}const i=n?new zg(e):new gm(e);this._helpers.set(t,i)}}function*hp(t){if(t.model.values){for(const e of t.model.values){const n={key:t.model.key,value:e};const i=t.view[e];const o=t.upcastAlso?t.upcastAlso[e]:undefined;yield*fp(n,i,o)}}else{yield*fp(t.model,t.view,t.upcastAlso)}}function*fp(t,e,n){yield{model:t,view:e};if(n){for(const e of Aa(n)){yield{model:t,view:e}}}}class gp{constructor(t="default"){this.operations=[];this.type=t}get baseVersion(){for(const t of this.operations){if(t.baseVersion!==null){return t.baseVersion}}return null}addOperation(t){t.batch=this;this.operations.push(t);return t}}class mp{constructor(t){this.baseVersion=t;this.isDocumentOperation=this.baseVersion!==null;this.batch=null}_validate(){}toJSON(){const t=Object.assign({},this);t.__className=this.constructor.className;delete t.batch;delete t.isDocumentOperation;return t}static get className(){return"Operation"}static fromJSON(t){return new this(t.baseVersion)}}class pp{constructor(t){this.markers=new Map;this._children=new Qf;if(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 this.childCount===0}get root(){return this}get parent(){return null}is(t){return t==="documentFragment"||t==="model:documentFragment"}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}getPath(){return[]}getNodeByPath(t){let e=this;for(const n of t){e=e.getChild(e.offsetToIndex(n))}return e}offsetToIndex(t){return this._children.offsetToIndex(t)}toJSON(){const t=[];for(const e of this._children){t.push(e.toJSON())}return t}static fromJSON(t){const e=[];for(const n of t){if(n.name){e.push(Zf.fromJSON(n))}else{e.push($f.fromJSON(n))}}return new pp(e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const n=kp(e);for(const t of n){if(t.parent!==null){t._remove()}t.parent=this}this._children._insertNodes(t,n)}_removeChildren(t,e=1){const n=this._children._removeNodes(t,e);for(const t of n){t.parent=null}return n}}function kp(t){if(typeof t=="string"){return[new $f(t)]}if(!ka(t)){t=[t]}return Array.from(t).map((t=>{if(typeof t=="string"){return new $f(t)}if(t instanceof Yf){return new $f(t.data,t.getAttributes())}return t}))}function bp(t,e){e=vp(e);const n=e.reduce(((t,e)=>t+e.offsetSize),0);const i=t.parent;yp(t);const o=t.index;i._insertChild(o,e);_p(i,o+e.length);_p(i,o);return new rg(t,t.getShiftedBy(n))}function wp(t){if(!t.isFlat){throw new u["a"]("operation-utils-remove-range-not-flat",this)}const e=t.start.parent;yp(t.start);yp(t.end);const n=e._removeChildren(t.start.index,t.end.index-t.start.index);_p(e,t.start.index);return n}function Ap(t,e){if(!t.isFlat){throw new u["a"]("operation-utils-move-range-not-flat",this)}const n=wp(t);e=e._getTransformedByDeletion(t.start,t.end.offset-t.start.offset);return bp(e,n)}function Cp(t,e,n){yp(t.start);yp(t.end);for(const i of t.getItems({shallow:true})){const t=i.is("$textProxy")?i.textNode:i;if(n!==null){t._setAttribute(e,n)}else{t._removeAttribute(e)}_p(t.parent,t.index)}_p(t.end.parent,t.end.index)}function vp(t){const e=[];if(!(t instanceof Array)){t=[t]}for(let n=0;nt.maxOffset){throw new u["a"]("move-operation-nodes-do-not-exist",this)}else if(t===e&&n=n&&this.targetPosition.path[t]t._clone(true))));const e=new Mp(this.position,t,this.baseVersion);e.shouldReceiveAttributes=this.shouldReceiveAttributes;return e}getReversed(){const t=this.position.root.document.graveyard;const e=new eg(t,[0]);return new Ip(this.position,this.nodes.maxOffset,e,this.baseVersion+1)}_validate(){const t=this.position.parent;if(!t||t.maxOffsett._clone(true))));bp(this.position,t)}toJSON(){const t=super.toJSON();t.position=this.position.toJSON();t.nodes=this.nodes.toJSON();return t}static get className(){return"InsertOperation"}static fromJSON(t,e){const n=[];for(const e of t.nodes){if(e.name){n.push(Zf.fromJSON(e))}else{n.push($f.fromJSON(e))}}const i=new Mp(eg.fromJSON(t.position,e),n,t.baseVersion);i.shouldReceiveAttributes=t.shouldReceiveAttributes;return i}}class Bp extends mp{constructor(t,e,n,i,o,r){super(r);this.name=t;this.oldRange=e?e.clone():null;this.newRange=n?n.clone():null;this.affectsData=o;this._markers=i}get type(){return"marker"}clone(){return new Bp(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new Bp(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,true,this.affectsData)}toJSON(){const t=super.toJSON();if(this.oldRange){t.oldRange=this.oldRange.toJSON()}if(this.newRange){t.newRange=this.newRange.toJSON()}delete t._markers;return t}static get className(){return"MarkerOperation"}static fromJSON(t,e){return new Bp(t.name,t.oldRange?rg.fromJSON(t.oldRange,e):null,t.newRange?rg.fromJSON(t.newRange,e):null,e.model.markers,t.affectsData,t.baseVersion)}}class Np extends mp{constructor(t,e,n,i){super(i);this.position=t;this.position.stickiness="toNext";this.oldName=e;this.newName=n}get type(){return"rename"}clone(){return new Np(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new Np(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const t=this.position.nodeAfter;if(!(t instanceof Zf)){throw new u["a"]("rename-operation-wrong-position",this)}else if(t.name!==this.oldName){throw new u["a"]("rename-operation-wrong-name",this)}}_execute(){const t=this.position.nodeAfter;t.name=this.newName}toJSON(){const t=super.toJSON();t.position=this.position.toJSON();return t}static get className(){return"RenameOperation"}static fromJSON(t,e){return new Np(eg.fromJSON(t.position,e),t.oldName,t.newName,t.baseVersion)}}class zp extends mp{constructor(t,e,n,i,o){super(o);this.root=t;this.key=e;this.oldValue=n;this.newValue=i}get type(){if(this.oldValue===null){return"addRootAttribute"}else if(this.newValue===null){return"removeRootAttribute"}else{return"changeRootAttribute"}}clone(){return new zp(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new zp(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment")){throw new u["a"]("rootattribute-operation-not-a-root",this,{root:this.root,key:this.key})}if(this.oldValue!==null&&this.root.getAttribute(this.key)!==this.oldValue){throw new u["a"]("rootattribute-operation-wrong-old-value",this,{root:this.root,key:this.key})}if(this.oldValue===null&&this.newValue!==null&&this.root.hasAttribute(this.key)){throw new u["a"]("rootattribute-operation-attribute-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 t=super.toJSON();t.root=this.root.toJSON();return t}static get className(){return"RootAttributeOperation"}static fromJSON(t,e){if(!e.getRoot(t.root)){throw new u["a"]("rootattribute-operation-fromjson-no-root",this,{rootName:t.root})}return new zp(e.getRoot(t.root),t.key,t.oldValue,t.newValue,t.baseVersion)}}class Pp extends mp{constructor(t,e,n,i,o){super(o);this.sourcePosition=t.clone();this.sourcePosition.stickiness="toPrevious";this.howMany=e;this.targetPosition=n.clone();this.targetPosition.stickiness="toNext";this.graveyardPosition=i.clone()}get type(){return"merge"}get deletionPosition(){return new eg(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const t=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new rg(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);const e=this.sourcePosition.path.slice(0,-1);const n=new eg(this.sourcePosition.root,e)._getTransformedByMergeOperation(this);return new Lp(t,this.howMany,n,this.graveyardPosition,this.baseVersion+1)}_validate(){const t=this.sourcePosition.parent;const e=this.targetPosition.parent;if(!t.parent){throw new u["a"]("merge-operation-source-position-invalid",this)}else if(!e.parent){throw new u["a"]("merge-operation-target-position-invalid",this)}else if(this.howMany!=t.maxOffset){throw new u["a"]("merge-operation-how-many-invalid",this)}}_execute(){const t=this.sourcePosition.parent;const e=rg._createIn(t);Ap(e,this.targetPosition);Ap(rg._createOn(t),this.graveyardPosition)}toJSON(){const t=super.toJSON();t.sourcePosition=t.sourcePosition.toJSON();t.targetPosition=t.targetPosition.toJSON();t.graveyardPosition=t.graveyardPosition.toJSON();return t}static get className(){return"MergeOperation"}static fromJSON(t,e){const n=eg.fromJSON(t.sourcePosition,e);const i=eg.fromJSON(t.targetPosition,e);const o=eg.fromJSON(t.graveyardPosition,e);return new this(n,t.howMany,i,o,t.baseVersion)}}class Lp extends mp{constructor(t,e,n,i,o){super(o);this.splitPosition=t.clone();this.splitPosition.stickiness="toNext";this.howMany=e;this.insertionPosition=n;this.graveyardPosition=i?i.clone():null;if(this.graveyardPosition){this.graveyardPosition.stickiness="toNext"}}get type(){return"split"}get moveTargetPosition(){const t=this.insertionPosition.path.slice();t.push(0);return new eg(this.insertionPosition.root,t)}get movedRange(){const t=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new rg(this.splitPosition,t)}clone(){return new this.constructor(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.splitPosition.root.document.graveyard;const e=new eg(t,[0]);return new Pp(this.moveTargetPosition,this.howMany,this.splitPosition,e,this.baseVersion+1)}_validate(){const t=this.splitPosition.parent;const e=this.splitPosition.offset;if(!t||t.maxOffset{for(const e of t.getAttributeKeys()){this.removeAttribute(e,t)}};if(!(t instanceof rg)){e(t)}else{for(const n of t.getItems()){e(n)}}}move(t,e,n){this._assertWriterUsedCorrectly();if(!(t instanceof rg)){throw new u["a"]("writer-move-invalid-range",this)}if(!t.isFlat){throw new u["a"]("writer-move-range-not-flat",this)}const i=eg._createAt(e,n);if(i.isEqual(t.start)){return}this._addOperationForAffectedMarkers("move",t);if(!Hp(t.root,i.root)){throw new u["a"]("writer-move-different-document",this)}const o=t.root.document?t.root.document.version:null;const r=new Ip(t.start,t.end.offset-t.start.offset,i,o);this.batch.addOperation(r);this.model.applyOperation(r)}remove(t){this._assertWriterUsedCorrectly();const e=t instanceof rg?t:rg._createOn(t);const n=e.getMinimalFlatRanges().reverse();for(const t of n){this._addOperationForAffectedMarkers("move",t);Up(t.start,t.end.offset-t.start.offset,this.batch,this.model)}}merge(t){this._assertWriterUsedCorrectly();const e=t.nodeBefore;const n=t.nodeAfter;this._addOperationForAffectedMarkers("merge",t);if(!(e instanceof Zf)){throw new u["a"]("writer-merge-no-element-before",this)}if(!(n instanceof Zf)){throw new u["a"]("writer-merge-no-element-after",this)}if(!t.root.document){this._mergeDetached(t)}else{this._merge(t)}}createPositionFromPath(t,e,n){return this.model.createPositionFromPath(t,e,n)}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,n){return this.model.createSelection(t,e,n)}_mergeDetached(t){const e=t.nodeBefore;const n=t.nodeAfter;this.move(rg._createIn(n),eg._createAt(e,"end"));this.remove(n)}_merge(t){const e=eg._createAt(t.nodeBefore,"end");const n=eg._createAt(t.nodeAfter,0);const i=t.root.document.graveyard;const o=new eg(i,[0]);const r=t.root.document.version;const s=new Pp(n,t.nodeAfter.maxOffset,e,o,r);this.batch.addOperation(s);this.model.applyOperation(s)}rename(t,e){this._assertWriterUsedCorrectly();if(!(t instanceof Zf)){throw new u["a"]("writer-rename-not-element-instance",this)}const n=t.root.document?t.root.document.version:null;const i=new Np(eg._createBefore(t),t.name,e,n);this.batch.addOperation(i);this.model.applyOperation(i)}split(t,e){this._assertWriterUsedCorrectly();let n=t.parent;if(!n.parent){throw new u["a"]("writer-split-element-no-parent",this)}if(!e){e=n.parent}if(!t.parent.getAncestors({includeSelf:true}).includes(e)){throw new u["a"]("writer-split-invalid-limit-element",this)}let i,o;do{const e=n.root.document?n.root.document.version:null;const r=n.maxOffset-t.offset;const s=Lp.getInsertionPosition(t);const a=new Lp(t,r,s,null,e);this.batch.addOperation(a);this.model.applyOperation(a);if(!i&&!o){i=n;o=t.parent.nextSibling}t=this.createPositionAfter(t.parent);n=t.parent}while(n!==e);return{position:t,range:new rg(eg._createAt(i,"end"),eg._createAt(o,0))}}wrap(t,e){this._assertWriterUsedCorrectly();if(!t.isFlat){throw new u["a"]("writer-wrap-range-not-flat",this)}const n=e instanceof Zf?e:new Zf(e);if(n.childCount>0){throw new u["a"]("writer-wrap-element-not-empty",this)}if(n.parent!==null){throw new u["a"]("writer-wrap-element-attached",this)}this.insert(n,t.start);const i=new rg(t.start.getShiftedBy(1),t.end.getShiftedBy(1));this.move(i,eg._createAt(n,0))}unwrap(t){this._assertWriterUsedCorrectly();if(t.parent===null){throw new u["a"]("writer-unwrap-element-no-parent",this)}this.move(rg._createIn(t),this.createPositionAfter(t));this.remove(t)}addMarker(t,e){this._assertWriterUsedCorrectly();if(!e||typeof e.usingOperation!="boolean"){throw new u["a"]("writer-addmarker-no-usingoperation",this)}const n=e.usingOperation;const i=e.range;const o=e.affectsData===undefined?false:e.affectsData;if(this.model.markers.has(t)){throw new u["a"]("writer-addmarker-marker-exists",this)}if(!i){throw new u["a"]("writer-addmarker-no-range",this)}if(!n){return this.model.markers._set(t,i,n,o)}Vp(this,t,null,i,o);return this.model.markers.get(t)}updateMarker(t,e){this._assertWriterUsedCorrectly();const n=typeof t=="string"?t:t.name;const i=this.model.markers.get(n);if(!i){throw new u["a"]("writer-updatemarker-marker-not-exists",this)}if(!e){this.model.markers._refresh(i);return}const o=typeof e.usingOperation=="boolean";const r=typeof e.affectsData=="boolean";const s=r?e.affectsData:i.affectsData;if(!o&&!e.range&&!r){throw new u["a"]("writer-updatemarker-wrong-options",this)}const a=i.getRange();const c=e.range?e.range:a;if(o&&e.usingOperation!==i.managedUsingOperations){if(e.usingOperation){Vp(this,n,null,c,s)}else{Vp(this,n,a,null,s);this.model.markers._set(n,c,undefined,s)}return}if(i.managedUsingOperations){Vp(this,n,a,c,s)}else{this.model.markers._set(n,c,undefined,s)}}removeMarker(t){this._assertWriterUsedCorrectly();const e=typeof t=="string"?t:t.name;if(!this.model.markers.has(e)){throw new u["a"]("writer-removemarker-no-marker",this)}const n=this.model.markers.get(e);if(!n.managedUsingOperations){this.model.markers._remove(e);return}const i=n.getRange();Vp(this,e,i,null,n.affectsData)}setSelection(t,e,n){this._assertWriterUsedCorrectly();this.model.document.selection._setTo(t,e,n)}setSelectionFocus(t,e){this._assertWriterUsedCorrectly();this.model.document.selection._setFocus(t,e)}setSelectionAttribute(t,e){this._assertWriterUsedCorrectly();if(typeof t==="string"){this._setSelectionAttribute(t,e)}else{for(const[e,n]of Fa(t)){this._setSelectionAttribute(e,n)}}}removeSelectionAttribute(t){this._assertWriterUsedCorrectly();if(typeof t==="string"){this._removeSelectionAttribute(t)}else{for(const e of t){this._removeSelectionAttribute(e)}}}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(t){this.model.document.selection._restoreGravity(t)}_setSelectionAttribute(t,e){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const i=xg._getStoreAttributeKey(t);this.setAttribute(i,e,n.anchor.parent)}n._setAttribute(t,e)}_removeSelectionAttribute(t){const e=this.model.document.selection;if(e.isCollapsed&&e.anchor.parent.isEmpty){const n=xg._getStoreAttributeKey(t);this.removeAttribute(n,e.anchor.parent)}e._removeAttribute(t)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this){throw new u["a"]("writer-incorrect-use",this)}}_addOperationForAffectedMarkers(t,e){for(const n of this.model.markers){if(!n.managedUsingOperations){continue}const i=n.getRange();let o=false;if(t==="move"){o=e.containsPosition(i.start)||e.start.isEqual(i.start)||e.containsPosition(i.end)||e.end.isEqual(i.end)}else{const t=e.nodeBefore;const n=e.nodeAfter;const r=i.start.parent==t&&i.start.isAtEnd;const s=i.end.parent==n&&i.end.offset==0;const a=i.end.nodeAfter==n;const c=i.start.nodeAfter==n;o=r||s||a||c}if(o){this.updateMarker(n.name,{range:i})}}}}function jp(t,e,n,i){const o=t.model;const r=o.document;let s=i.start;let a;let c;let l;for(const t of i.getWalker({shallow:true})){l=t.item.getAttribute(e);if(a&&c!=l){if(c!=n){d()}s=a}a=t.nextPosition;c=l}if(a instanceof eg&&a!=s&&c!=n){d()}function d(){const i=new rg(s,a);const l=i.root.document?r.version:null;const d=new Sp(i,e,c,n,l);t.batch.addOperation(d);o.applyOperation(d)}}function Fp(t,e,n,i){const o=t.model;const r=o.document;const s=i.getAttribute(e);let a,c;if(s!=n){const l=i.root===i;if(l){const t=i.document?r.version:null;c=new zp(i,e,s,n,t)}else{a=new rg(eg._createBefore(i),t.createPositionAfter(i));const o=a.root.document?r.version:null;c=new Sp(a,e,s,n,o)}t.batch.addOperation(c);o.applyOperation(c)}}function Vp(t,e,n,i,o){const r=t.model;const s=r.document;const a=new Bp(e,n,i,r.markers,o,s.version);t.batch.addOperation(a);r.applyOperation(a)}function Up(t,e,n,i){let o;if(t.root.document){const n=i.document;const r=new eg(n.graveyard,[0]);o=new Ip(t,e,r,n.version)}else{o=new Tp(t,e)}n.addOperation(o);i.applyOperation(o)}function Hp(t,e){if(t===e){return true}if(t instanceof Rp&&e instanceof Rp){return true}return false}class qp{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 this._changesInElement.size==0&&this._changedMarkers.size==0}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=rg._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:true})){if(this._isInInsertedElement(e.parent)){continue}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);const n=this._isInInsertedElement(t.targetPosition.parent);if(!e){this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany)}if(!n){this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany)}break}case"rename":{if(this._isInInsertedElement(t.position.parent)){return}this._markRemove(t.position.parent,t.position.offset,1);this._markInsert(t.position.parent,t.position.offset,1);const e=rg._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;if(!this._isInInsertedElement(e)){this._markRemove(e,t.splitPosition.offset,t.howMany)}if(!this._isInInsertedElement(t.insertionPosition.parent)){this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1)}if(t.graveyardPosition){this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1)}break}case"merge":{const e=t.sourcePosition.parent;if(!this._isInInsertedElement(e.parent)){this._markRemove(e.parent,e.startOffset,1)}const n=t.graveyardPosition.parent;this._markInsert(n,t.graveyardPosition.offset,1);const i=t.targetPosition.parent;if(!this._isInInsertedElement(i)){this._markInsert(i,t.targetPosition.offset,e.maxOffset)}break}}this._cachedChanges=null}bufferMarkerChange(t,e,n,i){const o=this._changedMarkers.get(t);if(!o){this._changedMarkers.set(t,{oldRange:e,newRange:n,affectsData:i})}else{o.newRange=n;o.affectsData=i;if(o.oldRange==null&&o.newRange==null){this._changedMarkers.delete(t)}}}getMarkersToRemove(){const t=[];for(const[e,n]of this._changedMarkers){if(n.oldRange!=null){t.push({name:e,range:n.oldRange})}}return t}getMarkersToAdd(){const t=[];for(const[e,n]of this._changedMarkers){if(n.newRange!=null){t.push({name:e,range:n.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 true}}return this._changesInElement.size>0}getChanges(t={includeChangesInGraveyard:false}){if(this._cachedChanges){if(t.includeChangesInGraveyard){return this._cachedChangesWithGraveyard.slice()}else{return this._cachedChanges.slice()}}let e=[];for(const t of this._changesInElement.keys()){const n=this._changesInElement.get(t).sort(((t,e)=>{if(t.offset===e.offset){if(t.type!=e.type){return t.type=="remove"?-1:1}return 0}return t.offset{if(t.position.root!=e.position.root){return t.position.root.rootNamet));for(const t of e){delete t.changeCount;if(t.type=="attribute"){delete t.position;delete t.length}}this._changeCount=0;this._cachedChangesWithGraveyard=e.slice();this._cachedChanges=e.filter(Kp);if(t.includeChangesInGraveyard){return this._cachedChangesWithGraveyard}else{return this._cachedChanges}}reset(){this._changesInElement.clear();this._elementSnapshots.clear();this._changedMarkers.clear();this._cachedChanges=null}_markInsert(t,e,n){const i={type:"insert",offset:e,howMany:n,count:this._changeCount++};this._markChange(t,i)}_markRemove(t,e,n){const i={type:"remove",offset:e,howMany:n,count:this._changeCount++};this._markChange(t,i);this._removeAllNestedChanges(t,e,n)}_markAttribute(t){const e={type:"attribute",offset:t.startOffset,howMany:t.offsetSize,count:this._changeCount++};this._markChange(t.parent,e)}_markChange(t,e){this._makeSnapshot(t);const n=this._getChangesForElement(t);this._handleChange(e,n);n.push(e);for(let t=0;tn.offset){if(i>o){const t={type:"attribute",offset:o,howMany:i-o,count:this._changeCount++};this._handleChange(t,e);e.push(t)}t.nodesToHandle=n.offset-t.offset;t.howMany=t.nodesToHandle}else if(t.offset>=n.offset&&t.offseto){t.nodesToHandle=i-o;t.offset=o}else{t.nodesToHandle=0}}}if(n.type=="remove"){if(t.offsetn.offset){const o={type:"attribute",offset:n.offset,howMany:i-n.offset,count:this._changeCount++};this._handleChange(o,e);e.push(o);t.nodesToHandle=n.offset-t.offset;t.howMany=t.nodesToHandle}}if(n.type=="attribute"){if(t.offset>=n.offset&&i<=o){t.nodesToHandle=0;t.howMany=0;t.offset=0}else if(t.offset<=n.offset&&i>=o){n.howMany=0}}}}t.howMany=t.nodesToHandle;delete t.nodesToHandle}_getInsertDiff(t,e,n){return{type:"insert",position:eg._createAt(t,e),name:n,length:1,changeCount:this._changeCount++}}_getRemoveDiff(t,e,n){return{type:"remove",position:eg._createAt(t,e),name:n,length:1,changeCount:this._changeCount++}}_getAttributesDiff(t,e,n){const i=[];n=new Map(n);for(const[o,r]of e){const e=n.has(o)?n.get(o):null;if(e!==r){i.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:o,attributeOldValue:r,attributeNewValue:e,changeCount:this._changeCount++})}n.delete(o)}for(const[e,o]of n){i.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:e,attributeOldValue:null,attributeNewValue:o,changeCount:this._changeCount++})}return i}_isInInsertedElement(t){const e=t.parent;if(!e){return false}const n=this._changesInElement.get(e);const i=t.startOffset;if(n){for(const t of n){if(t.type=="insert"&&i>=t.offset&&ii){for(let e=0;e=t&&i.baseVersion{const n=e[0];if(n.isDocumentOperation&&n.baseVersion!==this.version){throw new u["a"]("model-document-applyoperation-wrong-version",this,{operation:n})}}),{priority:"highest"});this.listenTo(t,"applyOperation",((t,e)=>{const n=e[0];if(n.isDocumentOperation){this.differ.bufferOperation(n)}}),{priority:"high"});this.listenTo(t,"applyOperation",((t,e)=>{const n=e[0];if(n.isDocumentOperation){this.version++;this.history.addOperation(n)}}),{priority:"low"});this.listenTo(this.selection,"change",(()=>{this._hasSelectionChangedFromTheLastChangeBlock=true}));this.listenTo(t.markers,"update",((t,e,n,i)=>{this.differ.bufferMarkerChange(e.name,n,i,e.affectsData);if(n===null){e.on("change",((t,n)=>{this.differ.bufferMarkerChange(e.name,n,e.getRange(),e.affectsData)}))}}))}get graveyard(){return this.getRoot(tk)}createRoot(t="$root",e="main"){if(this.roots.get(e)){throw new u["a"]("model-document-createroot-name-exists",this,{name:e})}const n=new Rp(this,t,e);this.roots.add(n);return n}destroy(){this.selection.destroy();this.stopListening()}getRoot(t="main"){return this.roots.get(t)}getRootNames(){return Array.from(this.roots,(t=>t.rootName)).filter((t=>t!=tk))}registerPostFixer(t){this._postFixers.add(t)}toJSON(){const t=Pa(this);t.selection="[engine.model.DocumentSelection]";t.model="[engine.model.Model]";return t}_handleChangeBlock(t){if(this._hasDocumentChangedFromTheLastChangeBlock()){this._callPostFixers(t);this.selection.refresh();if(this.differ.hasDataChanges()){this.fire("change:data",t.batch)}else{this.fire("change",t.batch)}this.selection.refresh();this.differ.reset()}this._hasSelectionChangedFromTheLastChangeBlock=false}_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();const e=this.model;const n=e.schema;const i=e.createPositionFromPath(t,[0]);const o=n.getNearestSelectionRange(i);return o||e.createRange(i)}_validateSelectionRange(t){return nk(t.start)&&nk(t.end)}_callPostFixers(t){let e=false;do{for(const n of this._postFixers){this.selection.refresh();e=n(t);if(e){break}}}while(e)}}Vn(ek,m);function nk(t){const e=t.textNode;if(e){const n=e.data;const i=t.offset-e.startOffset;return!Jp(n,i)&&!Xp(n,i)}return true}class ik{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(t){const e=t instanceof ok?t.name:t;return this._markers.has(e)}get(t){return this._markers.get(t)||null}_set(t,e,n=false,i=false){const o=t instanceof ok?t.name:t;if(o.includes(",")){throw new u["a"]("markercollection-incorrect-marker-name",this)}const r=this._markers.get(o);if(r){const t=r.getRange();let s=false;if(!t.isEqual(e)){r._attachLiveRange(Ag.fromRange(e));s=true}if(n!=r.managedUsingOperations){r._managedUsingOperations=n;s=true}if(typeof i==="boolean"&&i!=r.affectsData){r._affectsData=i;s=true}if(s){this.fire("update:"+o,r,t,e)}return r}const s=Ag.fromRange(e);const a=new ok(o,s,n,i);this._markers.set(o,a);this.fire("update:"+o,a,null,e);return a}_remove(t){const e=t instanceof ok?t.name:t;const n=this._markers.get(e);if(n){this._markers.delete(e);this.fire("update:"+e,n,n.getRange(),null);this._destroyMarker(n);return true}return false}_refresh(t){const e=t instanceof ok?t.name:t;const n=this._markers.get(e);if(!n){throw new u["a"]("markercollection-refresh-marker-not-exists",this)}const i=n.getRange();this.fire("update:"+e,n,i,i,n.managedUsingOperations,n.affectsData)}*getMarkersAtPosition(t){for(const e of this){if(e.getRange().containsPosition(t)){yield e}}}*getMarkersIntersectingRange(t){for(const e of this){if(e.getRange().getIntersection(t)!==null){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()){if(e.name.startsWith(t+":")){yield e}}}_destroyMarker(t){t.stopListening();t._detachLiveRange()}}Vn(ik,m);class ok{constructor(t,e,n,i){this.name=t;this._liveRange=this._attachLiveRange(e);this._managedUsingOperations=n;this._affectsData=i}get managedUsingOperations(){if(!this._liveRange){throw new u["a"]("marker-destroyed",this)}return this._managedUsingOperations}get affectsData(){if(!this._liveRange){throw new u["a"]("marker-destroyed",this)}return this._affectsData}getStart(){if(!this._liveRange){throw new u["a"]("marker-destroyed",this)}return this._liveRange.start.clone()}getEnd(){if(!this._liveRange){throw new u["a"]("marker-destroyed",this)}return this._liveRange.end.clone()}getRange(){if(!this._liveRange){throw new u["a"]("marker-destroyed",this)}return this._liveRange.toRange()}is(t){return t==="marker"||t==="model:marker"}_attachLiveRange(t){if(this._liveRange){this._detachLiveRange()}t.delegate("change:range").to(this);t.delegate("change:content").to(this);this._liveRange=t;return t}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this);this._liveRange.stopDelegating("change:content",this);this._liveRange.detach();this._liveRange=null}}Vn(ok,m);class rk extends mp{get type(){return"noop"}clone(){return new rk(this.baseVersion)}getReversed(){return new rk(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const sk={};sk[Sp.className]=Sp;sk[Mp.className]=Mp;sk[Bp.className]=Bp;sk[Ip.className]=Ip;sk[rk.className]=rk;sk[mp.className]=mp;sk[Np.className]=Np;sk[zp.className]=zp;sk[Lp.className]=Lp;sk[Pp.className]=Pp;class ak{static fromJSON(t,e){return sk[t.__className].fromJSON(t,e)}}class ck extends eg{constructor(t,e,n="toNone"){super(t,e,n);if(!this.root.is("rootElement")){throw new u["a"]("model-liveposition-root-not-rootelement",t)}lk.call(this)}detach(){this.stopListening()}is(t){return t==="livePosition"||t==="model:livePosition"||t=="position"||t==="model:position"}toPosition(){return new eg(this.root,this.path.slice(),this.stickiness)}static fromPosition(t,e){return new this(t.root,t.path.slice(),e?e:t.stickiness)}}function lk(){this.listenTo(this.root.document.model,"applyOperation",((t,e)=>{const n=e[0];if(!n.isDocumentOperation){return}dk.call(this,n)}),{priority:"low"})}function dk(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)}}Vn(ck,m);function uk(t,e,n,i){return t.change((o=>{let r;if(!n){r=t.document.selection}else if(n instanceof gg||n instanceof xg){r=n}else{r=o.createSelection(n,i)}if(!r.isCollapsed){t.deleteContent(r,{doNotAutoparagraph:true})}const s=new hk(t,o,r.anchor);let a;if(e.is("documentFragment")){a=e.getChildren()}else{a=[e]}s.handleNodes(a);const c=s.getSelectionRange();if(c){if(r instanceof xg){o.setSelection(c)}else{r.setTo(c)}}else{}const l=s.getAffectedRange()||t.createRange(r.anchor);s.destroy();return l}))}class hk{constructor(t,e,n){this.model=t;this.writer=e;this.position=n;this.canMergeWith=new Set([this.position.parent]);this.schema=t.schema;this._documentFragment=e.createDocumentFragment();this._documentFragmentPosition=e.createPositionAt(this._documentFragment,0);this._firstNode=null;this._lastNode=null;this._lastAutoParagraph=null;this._filterAttributesOf=[];this._affectedStart=null;this._affectedEnd=null}handleNodes(t){for(const e of Array.from(t)){this._handleNode(e)}this._insertPartialFragment();if(this._lastAutoParagraph){this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph)}this._mergeOnRight();this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer);this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(t){const e=this.writer.createPositionAfter(this._lastNode);const n=this.writer.createPositionAfter(t);if(n.isAfter(e)){this._lastNode=t;if(this.position.parent!=t||!this.position.isAtEnd){throw new u["a"]("insertcontent-invalid-insertion-position",this)}this.position=n;this._setAffectedBoundaries(this.position)}}getSelectionRange(){if(this.nodeToSelect){return rg._createOn(this.nodeToSelect)}return this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){if(!this._affectedStart){return null}return new rg(this._affectedStart,this._affectedEnd)}destroy(){if(this._affectedStart){this._affectedStart.detach()}if(this._affectedEnd){this._affectedEnd.detach()}}_handleNode(t){if(this.schema.isObject(t)){this._handleObject(t);return}let e=this._checkAndAutoParagraphToAllowedPosition(t);if(!e){e=this._checkAndSplitToAllowedPosition(t);if(!e){this._handleDisallowedNode(t);return}}this._appendToFragment(t);if(!this._firstNode){this._firstNode=t}this._lastNode=t}_insertPartialFragment(){if(this._documentFragment.isEmpty){return}const t=ck.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position);if(this._documentFragment.getChild(0)==this._firstNode){this.writer.insert(this._firstNode,this.position);this._mergeOnLeft();this.position=t.toPosition()}if(!this._documentFragment.isEmpty){this.writer.insert(this._documentFragment,this.position)}this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0);this.position=t.toPosition();t.detach()}_handleObject(t){if(this._checkAndSplitToAllowedPosition(t)){this._appendToFragment(t)}else{this._tryAutoparagraphing(t)}}_handleDisallowedNode(t){if(t.is("element")){this.handleNodes(t.getChildren())}else{this._tryAutoparagraphing(t)}}_appendToFragment(t){if(!this.schema.checkChild(this.position,t)){throw new u["a"]("insertcontent-wrong-position",this,{node:t,position:this.position})}this.writer.insert(t,this._documentFragmentPosition);this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(t.offsetSize);if(this.schema.isObject(t)&&!this.schema.checkChild(this.position,"$text")){this.nodeToSelect=t}else{this.nodeToSelect=null}this._filterAttributesOf.push(t)}_setAffectedBoundaries(t){if(!this._affectedStart){this._affectedStart=ck.fromPosition(t,"toPrevious")}if(!this._affectedEnd||this._affectedEnd.isBefore(t)){if(this._affectedEnd){this._affectedEnd.detach()}this._affectedEnd=ck.fromPosition(t,"toNext")}}_mergeOnLeft(){const t=this._firstNode;if(!(t instanceof Zf)){return}if(!this._canMergeLeft(t)){return}const e=ck._createBefore(t);e.stickiness="toNext";const n=ck.fromPosition(this.position,"toNext");if(this._affectedStart.isEqual(e)){this._affectedStart.detach();this._affectedStart=ck._createAt(e.nodeBefore,"end","toPrevious")}if(this._firstNode===this._lastNode){this._firstNode=e.nodeBefore;this._lastNode=e.nodeBefore}this.writer.merge(e);if(e.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode){this._affectedEnd.detach();this._affectedEnd=ck._createAt(e.nodeBefore,"end","toNext")}this.position=n.toPosition();n.detach();this._filterAttributesOf.push(this.position.parent);e.detach()}_mergeOnRight(){const t=this._lastNode;if(!(t instanceof Zf)){return}if(!this._canMergeRight(t)){return}const e=ck._createAfter(t);e.stickiness="toNext";if(!this.position.isEqual(e)){throw new u["a"]("insertcontent-invalid-insertion-position",this)}this.position=eg._createAt(e.nodeBefore,"end");const n=ck.fromPosition(this.position,"toPrevious");if(this._affectedEnd.isEqual(e)){this._affectedEnd.detach();this._affectedEnd=ck._createAt(e.nodeBefore,"end","toNext")}if(this._firstNode===this._lastNode){this._firstNode=e.nodeBefore;this._lastNode=e.nodeBefore}this.writer.merge(e);if(e.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode){this._affectedStart.detach();this._affectedStart=ck._createAt(e.nodeBefore,0,"toPrevious")}this.position=n.toPosition();n.detach();this._filterAttributesOf.push(this.position.parent);e.detach()}_canMergeLeft(t){const e=t.previousSibling;return e instanceof Zf&&this.canMergeWith.has(e)&&this.model.schema.checkMerge(e,t)}_canMergeRight(t){const e=t.nextSibling;return e instanceof Zf&&this.canMergeWith.has(e)&&this.model.schema.checkMerge(t,e)}_tryAutoparagraphing(t){const e=this.writer.createElement("paragraph");if(this._getAllowedIn(this.position.parent,e)&&this.schema.checkChild(e,t)){e._appendChild(t);this._handleNode(e)}}_checkAndAutoParagraphToAllowedPosition(t){if(this.schema.checkChild(this.position.parent,t)){return true}if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",t)){return false}this._insertPartialFragment();const e=this.writer.createElement("paragraph");this.writer.insert(e,this.position);this._setAffectedBoundaries(this.position);this._lastAutoParagraph=e;this.position=this.writer.createPositionAt(e,0);return true}_checkAndSplitToAllowedPosition(t){const e=this._getAllowedIn(this.position.parent,t);if(!e){return false}if(e!=this.position.parent){this._insertPartialFragment()}while(e!=this.position.parent){if(this.position.isAtStart){const t=this.position.parent;this.position=this.writer.createPositionBefore(t);if(t.isEmpty&&t.parent===e){this.writer.remove(t)}}else if(this.position.isAtEnd){this.position=this.writer.createPositionAfter(this.position.parent)}else{const t=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position);this.writer.split(this.position);this.position=t;this.canMergeWith.add(this.position.nodeAfter)}}return true}_getAllowedIn(t,e){if(this.schema.checkChild(t,e)){return t}if(this.schema.isLimit(t)){return null}return this._getAllowedIn(t.parent,e)}}function fk(t,e,n={}){if(e.isCollapsed){return}const i=e.getFirstRange();if(i.root.rootName=="$graveyard"){return}const o=t.schema;t.change((t=>{if(!n.doNotResetEntireContent&&Ek(o,e)){xk(t,e,o);return}const[r,s]=gk(i);if(!r.isTouching(s)){t.remove(t.createRange(r,s))}if(!n.leaveUnmerged){pk(t,r,s);o.removeDisallowedAttributes(r.parent.getChildren(),t)}Dk(t,e,r);if(!n.doNotAutoparagraph&&vk(o,r)){yk(t,r,e)}r.detach();s.detach()}))}function gk(t){const e=t.root.document.model;const n=t.start;let i=t.end;if(e.hasContent(t,{ignoreMarkers:true})){const n=mk(i);if(n&&i.isTouching(e.createPositionAt(n,0))){const n=e.createSelection(t);e.modifySelection(n,{direction:"backward"});const o=n.getLastPosition();const r=e.createRange(o,i);if(!e.hasContent(r,{ignoreMarkers:true})){i=o}}}return[ck.fromPosition(n,"toPrevious"),ck.fromPosition(i,"toNext")]}function mk(t){const e=t.parent;const n=e.root.document.model.schema;const i=e.getAncestors({parentFirst:true,includeSelf:true});for(const t of i){if(n.isLimit(t)){return null}if(n.isBlock(t)){return t}}}function pk(t,e,n){const i=t.model;if(!Ak(t.model.schema,e,n)){return}const[o,r]=Ck(e,n);if(!o||!r){return}if(!i.hasContent(o,{ignoreMarkers:true})&&i.hasContent(r,{ignoreMarkers:true})){bk(t,e,n,o.parent)}else{kk(t,e,n,o.parent)}}function kk(t,e,n,i){const o=e.parent;const r=n.parent;if(o==i||r==i){return}e=t.createPositionAfter(o);n=t.createPositionBefore(r);if(!n.isEqual(e)){t.insert(r,e)}t.merge(e);while(n.parent.isEmpty){const e=n.parent;n=t.createPositionBefore(e);t.remove(e)}if(!Ak(t.model.schema,e,n)){return}kk(t,e,n,i)}function bk(t,e,n,i){const o=e.parent;const r=n.parent;if(o==i||r==i){return}e=t.createPositionAfter(o);n=t.createPositionBefore(r);if(!n.isEqual(e)){t.insert(o,n)}while(e.parent.isEmpty){const n=e.parent;e=t.createPositionBefore(n);t.remove(n)}n=t.createPositionBefore(r);wk(t,n);if(!Ak(t.model.schema,e,n)){return}bk(t,e,n,i)}function wk(t,e){const n=e.nodeBefore;const i=e.nodeAfter;if(n.name!=i.name){t.rename(n,i.name)}t.clearAttributes(n);t.setAttributes(Object.fromEntries(i.getAttributes()),n);t.merge(e)}function Ak(t,e,n){const i=e.parent;const o=n.parent;if(i==o){return false}if(t.isLimit(i)||t.isLimit(o)){return false}return _k(e,n,t)}function Ck(t,e){const n=t.getAncestors();const i=e.getAncestors();let o=0;while(n[o]&&n[o]==i[o]){o++}return[n[o],i[o]]}function vk(t,e){const n=t.checkChild(e,"$text");const i=t.checkChild(e,"paragraph");return!n&&i}function _k(t,e,n){const i=new rg(t,e);for(const t of i.getWalker()){if(n.isLimit(t.item)){return false}}return true}function yk(t,e,n){const i=t.createElement("paragraph");t.insert(i,e);Dk(t,n,t.createPositionAt(i,0))}function xk(t,e){const n=t.model.schema.getLimitElement(e);t.remove(t.createRangeIn(n));yk(t,t.createPositionAt(n,0),e)}function Ek(t,e){const n=t.getLimitElement(e);if(!e.containsEntireContent(n)){return false}const i=e.getFirstRange();if(i.start.parent==i.end.parent){return false}return t.checkChild(n,"paragraph")}function Dk(t,e,n){if(e instanceof xg){t.setSelection(n)}else{e.setTo(n)}}const Sk=' ,.?!:;"-()';function Tk(t,e,n={}){const i=t.schema;const o=n.direction!="backward";const r=n.unit?n.unit:"character";const s=e.focus;const a=new Xf({boundaries:Nk(s,o),singleCharacters:true,direction:o?"forward":"backward"});const c={walker:a,schema:i,isForward:o,unit:r};let l;while(l=a.next()){if(l.done){return}const n=Ik(c,l.value);if(n){if(e instanceof xg){t.change((t=>{t.setSelectionFocus(n)}))}else{e.setFocus(n)}return}}}function Ik(t,e){const{isForward:n,walker:i,unit:o,schema:r}=t;const{type:s,item:a,nextPosition:c}=e;if(s=="text"){if(t.unit==="word"){return Bk(i,n)}return Mk(i,o,n)}if(s==(n?"elementStart":"elementEnd")){if(r.isSelectable(a)){return eg._createAt(a,n?"after":"before")}if(r.checkChild(c,"$text")){return c}}else{if(r.isLimit(a)){i.skip((()=>true));return}if(r.checkChild(c,"$text")){return c}}}function Mk(t,e){const n=t.position.textNode;if(n){const i=n.data;let o=t.position.offset-n.startOffset;while(Jp(i,o)||e=="character"&&Xp(i,o)){t.next();o=t.position.offset-n.startOffset}}return t.position}function Bk(t,e){let n=t.position.textNode;if(n){let i=t.position.offset-n.startOffset;while(!zk(n.data,i,e)&&!Pk(n,i,e)){t.next();const o=e?t.position.nodeAfter:t.position.nodeBefore;if(o&&o.is("$text")){const i=o.data.charAt(e?0:o.data.length-1);if(!Sk.includes(i)){t.next();n=t.position.textNode}}i=t.position.offset-n.startOffset}}return t.position}function Nk(t,e){const n=t.root;const i=eg._createAt(n,e?"end":0);if(e){return new rg(t,i)}else{return new rg(i,t)}}function zk(t,e,n){const i=e+(n?0:-1);return Sk.includes(t.charAt(i))}function Pk(t,e,n){return e===(n?t.endOffset:0)}function Lk(t,e){return t.change((t=>{const n=t.createDocumentFragment();const i=e.getFirstRange();if(!i||i.isCollapsed){return n}const o=i.start.root;const r=i.start.getCommonPath(i.end);const s=o.getNodeByPath(r);let a;if(i.start.parent==i.end.parent){a=i}else{a=t.createRange(t.createPositionAt(s,i.start.path[r.length]),t.createPositionAt(s,i.end.path[r.length]+1))}const c=a.end.offset-a.start.offset;for(const e of a.getItems({shallow:true})){if(e.is("$textProxy")){t.appendText(e.data,e.getAttributes(),n)}else{t.append(t.cloneElement(e,true),n)}}if(a!=i){const e=i._getTransformedByMove(a.start,t.createPositionAt(n,0),c)[0];const o=t.createRange(t.createPositionAt(n,0),e.start);const r=t.createRange(e.end,t.createPositionAt(n,"end"));Rk(r,t);Rk(o,t)}return n}))}function Rk(t,e){const n=[];Array.from(t.getItems({direction:"backward"})).map((t=>e.createRangeOn(t))).filter((e=>{const n=(e.start.isAfter(t.start)||e.start.isEqual(t.start))&&(e.end.isBefore(t.end)||e.end.isEqual(t.end));return n})).forEach((t=>{n.push(t.start.parent);e.remove(t)}));n.forEach((t=>{let n=t;while(n.parent&&n.isEmpty){const t=e.createRangeOn(n);n=n.parent;e.remove(t)}}))}function Ok(t){t.document.registerPostFixer((e=>jk(e,t)))}function jk(t,e){const n=e.document.selection;const i=e.schema;const o=[];let r=false;for(const t of n.getRanges()){const e=Fk(t,i);if(e&&!e.isEqual(t)){o.push(e);r=true}else{o.push(t)}}if(r){t.setSelection(Wk(o),{backward:n.isBackward})}}function Fk(t,e){if(t.isCollapsed){return Vk(t,e)}return Uk(t,e)}function Vk(t,e){const n=t.start;const i=e.getNearestSelectionRange(n);if(!i){const t=n.getAncestors().reverse().find((t=>e.isObject(t)));if(t){return rg._createOn(t)}return null}if(!i.isCollapsed){return i}const o=i.start;if(n.isEqual(o)){return null}return new rg(o)}function Uk(t,e){const{start:n,end:i}=t;const o=e.checkChild(n,"$text");const r=e.checkChild(i,"$text");const s=e.getLimitElement(n);const a=e.getLimitElement(i);if(s===a){if(o&&r){return null}if(qk(n,i,e)){const t=n.nodeAfter&&e.isSelectable(n.nodeAfter);const o=t?null:e.getNearestSelectionRange(n,"forward");const r=i.nodeBefore&&e.isSelectable(i.nodeBefore);const s=r?null:e.getNearestSelectionRange(i,"backward");const a=o?o.start:n;const c=s?s.end:i;return new rg(a,c)}}const c=s&&!s.is("rootElement");const l=a&&!a.is("rootElement");if(c||l){const t=n.nodeAfter&&i.nodeBefore&&n.nodeAfter.parent===i.nodeBefore.parent;const o=c&&(!t||!Gk(n.nodeAfter,e));const r=l&&(!t||!Gk(i.nodeBefore,e));let d=n;let u=i;if(o){d=eg._createBefore(Hk(s,e))}if(r){u=eg._createAfter(Hk(a,e))}return new rg(d,u)}return null}function Hk(t,e){let n=t;let i=n;while(e.isLimit(i)&&i.parent){n=i;i=i.parent}return n}function qk(t,e,n){const i=t.nodeAfter&&!n.isLimit(t.nodeAfter)||n.checkChild(t,"$text");const o=e.nodeBefore&&!n.isLimit(e.nodeBefore)||n.checkChild(e,"$text");return i||o}function Wk(t){const e=[...t];const n=new Set;let i=1;while(i!n.has(e)));return o}function Gk(t,e){return t&&e.isSelectable(t)}class Kk{constructor(){this.markers=new ik;this.document=new ek(this);this.schema=new Om;this._pendingChanges=[];this._currentWriter=null;["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach((t=>this.decorate(t)));this.on("applyOperation",((t,e)=>{const n=e[0];n._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,isContent:true});this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:true});this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:true});this.schema.register("$marker");this.schema.addChildCheck(((t,e)=>{if(e.name==="$marker"){return true}}));Ok(this);this.document.registerPostFixer(um)}change(t){try{if(this._pendingChanges.length===0){this._pendingChanges.push({batch:new gp,callback:t});return this._runPendingChanges()[0]}else{return t(this._currentWriter)}}catch(t){u["a"].rethrowUnexpectedError(t,this)}}enqueueChange(t,e){try{if(typeof t==="string"){t=new gp(t)}else if(typeof t=="function"){e=t;t=new gp}this._pendingChanges.push({batch:t,callback:e});if(this._pendingChanges.length==1){this._runPendingChanges()}}catch(t){u["a"].rethrowUnexpectedError(t,this)}}applyOperation(t){t._execute()}insertContent(t,e,n){return uk(this,t,e,n)}deleteContent(t,e){fk(this,t,e)}modifySelection(t,e){Tk(this,t,e)}getSelectedContent(t){return Lk(this,t)}hasContent(t,e={}){const n=t instanceof Zf?rg._createIn(t):t;if(n.isCollapsed){return false}const{ignoreWhitespaces:i=false,ignoreMarkers:o=false}=e;if(!o){for(const t of this.markers.getMarkersIntersectingRange(n)){if(t.affectsData){return true}}}for(const t of n.getItems()){if(this.schema.isContent(t)){if(t.is("$textProxy")){if(!i){return true}else if(t.data.search(/\S/)!==-1){return true}}else{return true}}}return false}createPositionFromPath(t,e,n){return new eg(t,e,n)}createPositionAt(t,e){return eg._createAt(t,e)}createPositionAfter(t){return eg._createAfter(t)}createPositionBefore(t){return eg._createBefore(t)}createRange(t,e){return new rg(t,e)}createRangeIn(t){return rg._createIn(t)}createRangeOn(t){return rg._createOn(t)}createSelection(t,e,n){return new gg(t,e,n)}createBatch(t){return new gp(t)}createOperationFromJSON(t){return ak.fromJSON(t,this.document)}destroy(){this.document.destroy();this.stopListening()}_runPendingChanges(){const t=[];this.fire("_beforeChanges");while(this._pendingChanges.length){const e=this._pendingChanges[0].batch;this._currentWriter=new Op(this,e);const n=this._pendingChanges[0].callback(this._currentWriter);t.push(n);this.document._handleChangeBlock(this._currentWriter);this._pendingChanges.shift();this._currentWriter=null}this.fire("_afterChanges");return t}}Vn(Kk,In);class $k extends Bf{constructor(t){super();this.editor=t}set(t,e,n={}){if(typeof e=="string"){const t=e;e=(e,n)=>{this.editor.execute(t);n()}}super.set(t,e,n)}}class Yk{constructor(t={}){const e=t.language||this.constructor.defaultConfig&&this.constructor.defaultConfig.language;this._context=t.context||new Ia({language:e});this._context._addEditor(this,!t.context);const n=Array.from(this.constructor.builtinPlugins||[]);this.config=new ga(t,this.constructor.defaultConfig);this.config.define("plugins",n);this.config.define(this._context._getEditorConfig());this.plugins=new wa(this,n,this._context.plugins);this.locale=this._context.locale;this.t=this.locale.t;this.commands=new Pm;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 Kk;const i=new ul;this.data=new lp(this.model,i);this.editing=new zm(this.model,i);this.editing.view.document.bind("isReadOnly").to(this);this.conversion=new up([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 $k(this);this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const t=this.config;const e=t.get("plugins");const n=t.get("removePlugins")||[];const i=t.get("extraPlugins")||[];const o=t.get("substitutePlugins")||[];return this.plugins.init(e.concat(i),n,o)}destroy(){let t=Promise.resolve();if(this.state=="initializing"){t=new Promise((t=>this.once("ready",t)))}return 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){u["a"].rethrowUnexpectedError(t,this)}}focus(){this.editing.view.focus()}}Vn(Yk,In);class Qk{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(Zk(t),{callback:e,originalName:t})}create(t){if(!this.has(t)){throw new u["a"]("componentfactory-item-missing",this,{name:t})}return this._components.get(Zk(t)).callback(this.editor.locale)}has(t){return this._components.has(Zk(t))}}function Zk(t){return String(t).toLowerCase()}class Jk{constructor(t){this.editor=t;this.componentFactory=new Qk(t);this.focusTracker=new Mf;this.set("viewportOffset",this._readViewportOffsetFromConfig());this._editableElementsMap=new Map;this.listenTo(t.editing.view.document,"layoutChanged",(()=>this.update()))}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening();this.focusTracker.destroy();for(const t of this._editableElementsMap.values()){t.ckeditorInstance=null}this._editableElementsMap=new Map}setEditableElement(t,e){this._editableElementsMap.set(t,e);if(!e.ckeditorInstance){e.ckeditorInstance=this.editor}}getEditableElement(t="main"){return this._editableElementsMap.get(t)}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}_readViewportOffsetFromConfig(){const t=this.editor;const e=t.config.get("ui.viewportOffset");if(e){return e}const n=t.config.get("toolbar.viewportTopOffset");if(n){console.warn("editor-ui-deprecated-viewport-offset-config: "+"The `toolbar.vieportTopOffset` configuration option is deprecated. "+"It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead.");return{top:n}}return{top:0}}}Vn(Jk,In);function Xk(t){if(!J(t.updateSourceElement)){throw new u["a"]("attachtoform-missing-elementapi-interface",t)}const e=t.sourceElement;if(e&&e.tagName.toLowerCase()==="textarea"&&e.form){let n;const i=e.form;const o=()=>t.updateSourceElement();if(J(i.submit)){n=i.submit;i.submit=()=>{o();n.apply(i)}}i.addEventListener("submit",o);t.on("destroy",(()=>{i.removeEventListener("submit",o);if(n){i.submit=n}}))}}const tb={setData(t){this.data.set(t)},getData(t){return this.data.get(t)}};var eb=tb;const nb={updateSourceElement(){if(!this.sourceElement){throw new u["a"]("editor-missing-sourceelement",this)}Sf(this.sourceElement,this.data.get())}};var ib=nb;function ob(t){const e=t.sourceElement;if(!e){return}if(e.ckeditorInstance){throw new u["a"]("editor-source-element-already-used",t)}e.ckeditorInstance=t;t.once("destroy",(()=>{delete e.ckeditorInstance}))}class rb extends Ma{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",false);this._actions=new ba({idProperty:"_id"});this._actions.delegate("add","remove").to(this)}add(t){if(typeof t!=="string"){throw new u["a"]("pendingactions-add-invalid-message",this)}const e=Object.create(In);e.set("message",t);this._actions.add(e);this.hasAny=true;return 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]()}}var sb='';var ab='';var cb='';var lb='';var db='';var ub='';var hb='';var fb='';var gb='';var mb='';var pb='';var kb='';var bb='';var wb='';var Ab='';var Cb='';var vb='';var _b='';var yb='';var xb='';var Eb='';var Db='';var Sb='';var Tb='';var Ib='';var Mb='';var Bb='';var Nb='';var zb='';const Pb={cancel:sb,caption:ab,check:cb,cog:lb,eraser:db,lowVision:ub,image:hb,alignBottom:fb,alignMiddle:gb,alignTop:mb,alignLeft:pb,alignCenter:kb,alignRight:bb,alignJustify:wb,objectLeft:xb,objectCenter:Cb,objectRight:Eb,objectFullWidth:_b,objectInline:yb,objectBlockLeft:Ab,objectBlockRight:vb,objectSizeFull:Db,objectSizeLarge:Sb,objectSizeSmall:Tb,objectSizeMedium:Ib,pencil:Mb,pilcrow:Bb,quote:Nb,threeVerticalDots:zb};function Lb({emitter:t,activator:e,callback:n,contextElements:i}){t.listenTo(document,"mousedown",((t,o)=>{if(!e()){return}const r=typeof o.composedPath=="function"?o.composedPath():[];for(const t of i){if(t.contains(o.target)||r.includes(t)){return}}n()}))}function Rb(t){t.set("_isCssTransitionsDisabled",false);t.disableCssTransitions=()=>{t._isCssTransitionsDisabled=true};t.enableCssTransitions=()=>{t._isCssTransitionsDisabled=false};t.extendTemplate({attributes:{class:[t.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function Ob({view:t}){t.listenTo(t.element,"submit",((e,n)=>{n.preventDefault();t.fire("submit")}),{useCapture:true})}class jb extends ba{constructor(t=[]){super(t,{idProperty:"viewUid"});this.on("add",((t,e,n)=>{this._renderViewIntoCollectionParent(e,n)}));this.on("remove",((t,e)=>{if(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||!Fb(t)){throw new u["a"]("ui-viewcollection-delegate-wrong-events",this)}return{to:e=>{for(const n of this){for(const i of t){n.delegate(i).to(e)}}this.on("add",((n,i)=>{for(const n of t){i.delegate(n).to(e)}}));this.on("remove",((n,i)=>{for(const n of t){i.stopDelegating(n,e)}}))}}}_renderViewIntoCollectionParent(t,e){if(!t.isRendered){t.render()}if(t.element&&this._parentElement){this._parentElement.insertBefore(t.element,this._parentElement.children[e])}}}function Fb(t){return t.every((t=>typeof t=="string"))}var Vb=n(14);var Ub={injectType:"singletonStyleTag",attributes:{"data-cke":true}};Ub.insert="head";Ub.singleton=true;var Hb=ru()(Vb["a"],Ub);var qb=Vb["a"].locals||{};class Wb{constructor(t){this.element=null;this.isRendered=false;this.locale=t;this.t=t&&t.t;this._viewCollections=new ba;this._unboundChildren=this.createCollection();this._viewCollections.on("add",((e,n)=>{n.locale=t}));this.decorate("render")}get bindTemplate(){if(this._bindTemplate){return this._bindTemplate}return this._bindTemplate=Kb.bind(this,this)}createCollection(t){const e=new jb(t);this._viewCollections.add(e);return e}registerChild(t){if(!ka(t)){t=[t]}for(const e of t){this._unboundChildren.add(e)}}deregisterChild(t){if(!ka(t)){t=[t]}for(const e of t){this._unboundChildren.remove(e)}}setTemplate(t){this.template=new Kb(t)}extendTemplate(t){Kb.extend(this.template,t)}render(){if(this.isRendered){throw new u["a"]("ui-view-render-already-rendered",this)}if(this.template){this.element=this.template.render();this.registerChild(this.template.getViews())}this.isRendered=true}destroy(){this.stopListening();this._viewCollections.map((t=>t.destroy()));if(this.template&&this.template._revertData){this.template.revert(this.element)}}}Vn(Wb,Nu);Vn(Wb,In);const Gb="http://www.w3.org/1999/xhtml";class Kb{constructor(t){Object.assign(this,ow(iw(t)));this._isRendered=false;this._revertData=null}render(){const t=this._renderNode({intoFragment:true});this._isRendered=true;return t}apply(t){this._revertData=kw();this._renderNode({node:t,isApplying:true,revertData:this._revertData});return t}revert(t){if(!this._revertData){throw new u["a"]("ui-template-revert-not-applied",[this,t])}this._revertTemplateFromNode(t,this._revertData)}*getViews(){function*t(e){if(e.children){for(const n of e.children){if(gw(n)){yield n}else if(mw(n)){yield*t(n)}}}}yield*t(this)}static bind(t,e){return{to(n,i){return new Yb({eventNameOrFunction:n,attribute:n,observable:t,emitter:e,callback:i})},if(n,i,o){return new Qb({observable:t,emitter:e,attribute:n,valueIfTrue:i,callback:o})}}}static extend(t,e){if(t._isRendered){throw new u["a"]("template-extend-render",[this,t])}hw(t,ow(iw(e)))}_renderNode(t){let e;if(t.node){e=this.tag&&this.text}else{e=this.tag?this.text:!this.text}if(e){throw new u["a"]("ui-template-wrong-syntax",this)}if(this.text){return this._renderText(t)}else{return this._renderElement(t)}}_renderElement(t){let e=t.node;if(!e){e=t.node=document.createElementNS(this.ns||Gb,this.tag)}this._renderAttributes(t);this._renderElementChildren(t);this._setUpListeners(t);return e}_renderText(t){let e=t.node;if(e){t.revertData.text=e.textContent}else{e=t.node=document.createTextNode("")}if(Zb(this.text)){this._bindToObservable({schema:this.text,updater:tw(e),data:t})}else{e.textContent=this.text.join("")}return e}_renderAttributes(t){let e,n,i,o;if(!this.attributes){return}const r=t.node;const s=t.revertData;for(e in this.attributes){i=r.getAttribute(e);n=this.attributes[e];if(s){s.attributes[e]=i}o=S(n[0])&&n[0].ns?n[0].ns:null;if(Zb(n)){const a=o?n[0].value:n;if(s&&bw(e)){a.unshift(i)}this._bindToObservable({schema:a,updater:ew(r,e,o),data:t})}else if(e=="style"&&typeof n[0]!=="string"){this._renderStyleAttribute(n[0],t)}else{if(s&&i&&bw(e)){n.unshift(i)}n=n.map((t=>t?t.value||t:t)).reduce(((t,e)=>t.concat(e)),[]).reduce(dw,"");if(!fw(n)){r.setAttributeNS(o,e,n)}}}}_renderStyleAttribute(t,e){const n=e.node;for(const i in t){const o=t[i];if(Zb(o)){this._bindToObservable({schema:[o],updater:nw(n,i),data:e})}else{n.style[i]=o}}}_renderElementChildren(t){const e=t.node;const n=t.intoFragment?document.createDocumentFragment():e;const i=t.isApplying;let o=0;for(const r of this.children){if(pw(r)){if(!i){r.setParent(e);for(const t of r){n.appendChild(t.element)}}}else if(gw(r)){if(!i){if(!r.isRendered){r.render()}n.appendChild(r.element)}}else if(iu(r)){n.appendChild(r)}else{if(i){const e=t.revertData;const i=kw();e.children.push(i);r._renderNode({node:n.childNodes[o++],isApplying:true,revertData:i})}else{n.appendChild(r.render())}}}if(t.intoFragment){e.appendChild(n)}}_setUpListeners(t){if(!this.eventListeners){return}for(const e in this.eventListeners){const n=this.eventListeners[e].map((n=>{const[i,o]=e.split("@");return n.activateDomEventListener(i,o,t)}));if(t.revertData){t.revertData.bindings.push(n)}}}_bindToObservable({schema:t,updater:e,data:n}){const i=n.revertData;Xb(t,e,n);const o=t.filter((t=>!fw(t))).filter((t=>t.observable)).map((i=>i.activateAttributeListener(t,e,n)));if(i){i.bindings.push(o)}}_revertTemplateFromNode(t,e){for(const t of e.bindings){for(const e of t){e()}}if(e.text){t.textContent=e.text;return}for(const n in e.attributes){const i=e.attributes[n];if(i===null){t.removeAttribute(n)}else{t.setAttribute(n,i)}}for(let n=0;nXb(t,e,n);this.emitter.listenTo(this.observable,"change:"+this.attribute,i);return()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,i)}}}class Yb extends $b{activateDomEventListener(t,e,n){const i=(t,n)=>{if(!e||n.target.matches(e)){if(typeof this.eventNameOrFunction=="function"){this.eventNameOrFunction(n)}else{this.observable.fire(this.eventNameOrFunction,n)}}};this.emitter.listenTo(n.node,t,i);return()=>{this.emitter.stopListening(n.node,t,i)}}}class Qb extends $b{getValue(t){const e=super.getValue(t);return fw(e)?false:this.valueIfTrue||true}}function Zb(t){if(!t){return false}if(t.value){t=t.value}if(Array.isArray(t)){return t.some(Zb)}else if(t instanceof $b){return true}return false}function Jb(t,e){return t.map((t=>{if(t instanceof $b){return t.getValue(e)}return t}))}function Xb(t,e,{node:n}){let i=Jb(t,n);if(t.length==1&&t[0]instanceof Qb){i=i[0]}else{i=i.reduce(dw,"")}if(fw(i)){e.remove()}else{e.set(i)}}function tw(t){return{set(e){t.textContent=e},remove(){t.textContent=""}}}function ew(t,e,n){return{set(i){t.setAttributeNS(n,e,i)},remove(){t.removeAttributeNS(n,e)}}}function nw(t,e){return{set(n){t.style[e]=n},remove(){t.style[e]=null}}}function iw(t){const e=ua(t,(t=>{if(t&&(t instanceof $b||mw(t)||gw(t)||pw(t))){return t}}));return e}function ow(t){if(typeof t=="string"){t=aw(t)}else if(t.text){cw(t)}if(t.on){t.eventListeners=sw(t.on);delete t.on}if(!t.text){if(t.attributes){rw(t.attributes)}const e=[];if(t.children){if(pw(t.children)){e.push(t.children)}else{for(const n of t.children){if(mw(n)||gw(n)||iu(n)){e.push(n)}else{e.push(new Kb(n))}}}}t.children=e}return t}function rw(t){for(const e in t){if(t[e].value){t[e].value=Aa(t[e].value)}lw(t,e)}}function sw(t){for(const e in t){lw(t,e)}return t}function aw(t){return{text:[t]}}function cw(t){t.text=Aa(t.text)}function lw(t,e){t[e]=Aa(t[e])}function dw(t,e){if(fw(e)){return t}else if(fw(t)){return e}else{return`${t} ${e}`}}function uw(t,e){for(const n in e){if(t[n]){t[n].push(...e[n])}else{t[n]=e[n]}}}function hw(t,e){if(e.attributes){if(!t.attributes){t.attributes={}}uw(t.attributes,e.attributes)}if(e.eventListeners){if(!t.eventListeners){t.eventListeners={}}uw(t.eventListeners,e.eventListeners)}if(e.text){t.text.push(...e.text)}if(e.children&&e.children.length){if(t.children.length!=e.children.length){throw new u["a"]("ui-template-extend-children-mismatch",t)}let n=0;for(const i of e.children){hw(t.children[n++],i)}}}function fw(t){return!t&&t!==0}function gw(t){return t instanceof Wb}function mw(t){return t instanceof Kb}function pw(t){return t instanceof jb}function kw(){return{children:[],bindings:[],attributes:{}}}function bw(t){return t=="class"||t=="style"}class ww extends jb{constructor(t,e=[]){super(e);this.locale=t}attachToDom(){this._bodyCollectionContainer=new Kb({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");if(!t){t=kf(document,"div",{class:"ck-body-wrapper"});document.body.appendChild(t)}t.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy();if(this._bodyCollectionContainer){this._bodyCollectionContainer.remove()}const t=document.querySelector(".ck-body-wrapper");if(t&&t.childElementCount==0){t.remove()}}}var Aw=n(15);var Cw={injectType:"singletonStyleTag",attributes:{"data-cke":true}};Cw.insert="head";Cw.singleton=true;var vw=ru()(Aw["a"],Cw);var _w=Aw["a"].locals||{};class yw extends Wb{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");const e=t.querySelector("svg");const n=e.getAttribute("viewBox");if(n){this.viewBox=n}this.element.innerHTML="";while(e.childNodes.length>0){this.element.appendChild(e.childNodes[0])}}}_colorFillPaths(){if(this.fillColor){this.element.querySelectorAll(".ck-icon__fill").forEach((t=>{t.style.fill=this.fillColor}))}}}var xw=n(16);var Ew={injectType:"singletonStyleTag",attributes:{"data-cke":true}};Ew.insert="head";Ew.singleton=true;var Dw=ru()(xw["a"],Ew);var Sw=xw["a"].locals||{};class Tw extends Wb{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")}]}]})}}var Iw=n(17);var Mw={injectType:"singletonStyleTag",attributes:{"data-cke":true}};Mw.insert="head";Mw.singleton=true;var Bw=ru()(Iw["a"],Mw);var Nw=Iw["a"].locals||{};class zw extends Wb{constructor(t){super(t);const e=this.bindTemplate;const n=a();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(n);this.iconView=new yw;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?t:"button")),tabindex:e.to("tabindex"),"aria-labelledby":`ck-editor__aria-label_${n}`,"aria-disabled":e.if("isEnabled",true,(t=>!t)),"aria-pressed":e.to("isOn",(t=>this.isToggleable?String(t):false))},children:this.children,on:{mousedown:e.to((t=>{t.preventDefault()})),click:e.to((t=>{if(this.isEnabled){this.fire("execute")}else{t.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.keystroke){this.children.add(this.keystrokeView)}}focus(){this.element.focus()}_createTooltipView(){const t=new Tw;t.bind("text").to(this,"_tooltipString");t.bind("position").to(this,"tooltipPosition");return t}_createLabelView(t){const e=new Wb;const n=this.bindTemplate;e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:n.to("labelStyle"),id:`ck-editor__aria-label_${t}`},children:[{text:this.bindTemplate.to("label")}]});return e}_createKeystrokeView(){const t=new Wb;t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",(t=>dd(t)))}]});return t}_getTooltipString(t,e,n){if(t){if(typeof t=="string"){return t}else{if(n){n=dd(n)}if(t instanceof Function){return t(e,n)}else{return`${e}${n?` (${n})`:""}`}}}return""}}var Pw=n(18);var Lw={injectType:"singletonStyleTag",attributes:{"data-cke":true}};Lw.insert="head";Lw.singleton=true;var Rw=ru()(Pw["a"],Lw);var Ow=Pw["a"].locals||{};class jw extends zw{constructor(t){super(t);this.isToggleable=true;this.toggleSwitchView=this._createToggleView();this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render();this.children.add(this.toggleSwitchView)}_createToggleView(){const t=new Wb;t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]});return t}}function Fw(t,e){const n=t.t;const i={Black:n("Black"),"Dim grey":n("Dim grey"),Grey:n("Grey"),"Light grey":n("Light grey"),White:n("White"),Red:n("Red"),Orange:n("Orange"),Yellow:n("Yellow"),"Light green":n("Light green"),Green:n("Green"),Aquamarine:n("Aquamarine"),Turquoise:n("Turquoise"),"Light blue":n("Light blue"),Blue:n("Blue"),Purple:n("Purple")};return e.map((t=>{const e=i[t.label];if(e&&e!=t.label){t.label=e}return t}))}function Vw(t){return t.map(Uw).filter((t=>!!t))}function Uw(t){if(typeof t==="string"){return{model:t,label:t,hasBorder:false,view:{name:"span",styles:{color:t}}}}else{return{model:t.color,label:t.label||t.color,hasBorder:t.hasBorder===undefined?false:t.hasBorder,view:{name:"span",styles:{color:`${t.color}`}}}}}var Hw='';class qw extends zw{constructor(t){super(t);const e=this.bindTemplate;this.set("color");this.set("hasBorder");this.icon=Hw;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%)"}}class Ww{constructor(t){Object.assign(this,t);if(t.actions&&t.keystrokeHandler){for(const e in t.actions){let n=t.actions[e];if(typeof n=="string"){n=[n]}for(const i of n){t.keystrokeHandler.set(i,((t,n)=>{this[e]();n()}))}}}}get first(){return this.focusables.find(Gw)||null}get last(){return this.focusables.filter(Gw).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let t=null;if(this.focusTracker.focusedElement===null){return null}this.focusables.find(((e,n)=>{const i=e.element===this.focusTracker.focusedElement;if(i){t=n}return i}));return t}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(t){if(t){t.focus()}}_getFocusableItem(t){const e=this.current;const n=this.focusables.length;if(!n){return null}if(e===null){return this[t===1?"first":"last"]}let i=(e+n+t)%n;do{const e=this.focusables.get(i);if(Gw(e)){return e}i=(i+n+t)%n}while(i!==e);return null}}function Gw(t){return!!(t.focus&&bu.window.getComputedStyle(t.element).display!="none")}var Kw=n(19);var $w={injectType:"singletonStyleTag",attributes:{"data-cke":true}};$w.insert="head";$w.singleton=true;var Yw=ru()(Kw["a"],$w);var Qw=Kw["a"].locals||{};class Zw extends Wb{constructor(t,e){super(t);const n=e&&e.colorDefinitions||[];const i={};if(e&&e.columns){i.gridTemplateColumns=`repeat( ${e.columns}, 1fr)`}this.set("selectedColor");this.items=this.createCollection();this.focusTracker=new Mf;this.keystrokes=new Bf;this._focusCycler=new Ww({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}));n.forEach((t=>{const e=new qw;e.set({color:t.color,label:t.label,tooltip:true,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:i}});this.on("change:selectedColor",((t,e,n)=>{for(const t of this.items){t.isOn=t.color===n}}))}focus(){if(this.items.length){this.items.first.focus()}}focusLast(){if(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)}destroy(){super.destroy();this.focusTracker.destroy();this.keystrokes.destroy()}}var Jw='';class Xw extends zw{constructor(t){super(t);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 t=new yw;t.content=Jw;t.extendTemplate({attributes:{class:"ck-dropdown__arrow"}});return t}}var tA=n(20);var eA={injectType:"singletonStyleTag",attributes:{"data-cke":true}};eA.insert="head";eA.singleton=true;var nA=ru()(tA["a"],eA);var iA=tA["a"].locals||{};class oA extends Wb{constructor(t){super(t);const e=this.bindTemplate;this.set("class");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 Bf;this.focusTracker=new Mf;this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",e.to("class"),e.if("isVisible","ck-hidden",(t=>!t)),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render();this.children.add(this.actionView);this.children.add(this.arrowView);this.focusTracker.add(this.actionView.element);this.focusTracker.add(this.arrowView.element);this.keystrokes.listenTo(this.element);this.keystrokes.set("arrowright",((t,e)=>{if(this.focusTracker.focusedElement===this.actionView.element){this.arrowView.focus();e()}}));this.keystrokes.set("arrowleft",((t,e)=>{if(this.focusTracker.focusedElement===this.arrowView.element){this.actionView.focus();e()}}))}destroy(){super.destroy();this.focusTracker.destroy();this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(){const t=new zw;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);return t}_createArrowView(){const t=new zw;const e=t.bindTemplate;t.icon=Jw;t.extendTemplate({attributes:{class:"ck-splitbutton__arrow","aria-haspopup":true,"aria-expanded":e.to("isOn",(t=>String(t)))}});t.bind("isEnabled").to(this);t.delegate("execute").to(this,"open");return t}}class rA extends Wb{constructor(t){super(t);const e=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",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(){if(this.children.length){this.children.first.focus()}}focusLast(){if(this.children.length){const t=this.children.last;if(typeof t.focusLast==="function"){t.focusLast()}else{t.focus()}}}}var sA=n(21);var aA={injectType:"singletonStyleTag",attributes:{"data-cke":true}};aA.insert="head";aA.singleton=true;var cA=ru()(sA["a"],aA);var lA=sA["a"].locals||{};function dA(t){if(!t||!t.parentNode){return null}if(t.offsetParent===bu.document.body){return null}return t.offsetParent}function uA({element:t,target:e,positions:n,limiter:i,fitInViewport:o,viewportOffsetConfig:r}){if(J(e)){e=e()}if(J(i)){i=i()}const s=dA(t);const a=new vf(t);const c=new vf(e);let l;const d={targetRect:c,elementRect:a,positionedElementAncestor:s};if(!i&&!o){l=new pA(n[0],d)}else{const t=i&&new vf(i).getVisible();const e=o&&hA(r);Object.assign(d,{limiterRect:t,viewportRect:e});l=fA(n,d)||new pA(n[0],d)}return l}function hA(t){t=Object.assign({top:0,bottom:0,left:0,right:0},t);const e=new vf(bu.window);e.top+=t.top;e.height-=t.top;e.bottom-=t.bottom;e.height-=t.bottom;return e}function fA(t,e){const{elementRect:n}=e;const i=n.getArea();const o=t.map((t=>new pA(t,e))).filter((t=>!!t.name));let r=0;let s=null;for(const t of o){const{_limiterIntersectionArea:e,_viewportIntersectionArea:n}=t;if(e===i){return t}const o=n**2+e**2;if(o>r){r=o;s=t}}return s}function gA(t,e){const n=mA(new vf(e));const i=Af(e);let o=0;let r=0;o-=n.left;r-=n.top;o+=e.scrollLeft;r+=e.scrollTop;o-=i.left;r-=i.top;t.moveBy(o,r)}function mA(t){const{scrollX:e,scrollY:n}=bu.window;return t.clone().moveBy(e,n)}class pA{constructor(t,e){const n=t(e.targetRect,e.elementRect,e.viewportRect);if(!n){return}const{left:i,top:o,name:r,config:s}=n;Object.assign(this,{name:r,config:s});this._positioningFunctionCorrdinates={left:i,top:o};this._options=e}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get _limiterIntersectionArea(){const t=this._options.limiterRect;if(t){const e=this._options.viewportRect;if(e){const n=t.getIntersection(e);if(n){return n.getIntersectionArea(this._rect)}}else{return t.getIntersectionArea(this._rect)}}return 0}get _viewportIntersectionArea(){const t=this._options.viewportRect;if(t){return t.getIntersectionArea(this._rect)}return 0}get _rect(){if(this._cachedRect){return this._cachedRect}this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCorrdinates.left,this._positioningFunctionCorrdinates.top);return this._cachedRect}get _absoluteRect(){if(this._cachedAbsoluteRect){return this._cachedAbsoluteRect}this._cachedAbsoluteRect=mA(this._rect);if(this._options.positionedElementAncestor){gA(this._cachedAbsoluteRect,this._options.positionedElementAncestor)}return this._cachedAbsoluteRect}}class kA extends Wb{constructor(t,e,n){super(t);const i=this.bindTemplate;this.buttonView=e;this.panelView=n;this.set("isOpen",false);this.set("isEnabled",true);this.set("class");this.set("id");this.set("panelPosition","auto");this.keystrokes=new Bf;this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",i.to("class"),i.if("isEnabled","ck-disabled",(t=>!t))],id:i.to("id"),"aria-describedby":i.to("ariaDescribedById")},children:[e,n]});e.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render();this.listenTo(this.buttonView,"open",(()=>{this.isOpen=!this.isOpen}));this.panelView.bind("isVisible").to(this,"isOpen");this.on("change:isOpen",(()=>{if(!this.isOpen){return}if(this.panelPosition==="auto"){this.panelView.position=kA._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 t=(t,e)=>{if(this.isOpen){this.buttonView.focus();this.isOpen=false;e()}};this.keystrokes.set("arrowdown",((t,e)=>{if(this.buttonView.isEnabled&&!this.isOpen){this.isOpen=true;e()}}));this.keystrokes.set("arrowright",((t,e)=>{if(this.isOpen){e()}}));this.keystrokes.set("arrowleft",t);this.keystrokes.set("esc",t)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:t,north:e,southEast:n,southWest:i,northEast:o,northWest:r,southMiddleEast:s,southMiddleWest:a,northMiddleEast:c,northMiddleWest:l}=kA.defaultPanelPositions;if(this.locale.uiLanguageDirection!=="rtl"){return[n,i,s,a,t,o,r,c,l,e]}else{return[i,n,a,s,t,r,o,l,c,e]}}}kA.defaultPanelPositions={south:(t,e)=>({top:t.bottom,left:t.left-(e.width-t.width)/2,name:"s"}),southEast:t=>({top:t.bottom,left:t.left,name:"se"}),southWest:(t,e)=>({top:t.bottom,left:t.left-e.width+t.width,name:"sw"}),southMiddleEast:(t,e)=>({top:t.bottom,left:t.left-(e.width-t.width)/4,name:"sme"}),southMiddleWest:(t,e)=>({top:t.bottom,left:t.left-(e.width-t.width)*3/4,name:"smw"}),north:(t,e)=>({top:t.top-e.height,left:t.left-(e.width-t.width)/2,name:"n"}),northEast:(t,e)=>({top:t.top-e.height,left:t.left,name:"ne"}),northWest:(t,e)=>({top:t.top-e.height,left:t.left-e.width+t.width,name:"nw"}),northMiddleEast:(t,e)=>({top:t.top-e.height,left:t.left-(e.width-t.width)/4,name:"nme"}),northMiddleWest:(t,e)=>({top:t.top-e.height,left:t.left-(e.width-t.width)*3/4,name:"nmw"})};kA._getOptimalPosition=uA;class bA extends Wb{constructor(t){super(t);this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class wA extends Wb{constructor(t){super(t);this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function AA(t){return t.bindTemplate.to((e=>{if(e.target===t.element){e.preventDefault()}}))}function CA(t){if(Array.isArray(t)){return{items:t,removeItems:[]}}if(!t){return{items:[],removeItems:[]}}return Object.assign({items:[],removeItems:[]},t)}var vA=n(22);var _A={injectType:"singletonStyleTag",attributes:{"data-cke":true}};_A.insert="head";_A.singleton=true;var yA=ru()(vA["a"],_A);var xA=vA["a"].locals||{};class EA extends Wb{constructor(t,e){super(t);const n=this.bindTemplate;const i=this.t;this.options=e||{};this.set("ariaLabel",i("Editor toolbar"));this.set("maxWidth","auto");this.items=this.createCollection();this.focusTracker=new Mf;this.keystrokes=new Bf;this.set("class");this.set("isCompact",false);this.itemsView=new DA(t);this.children=this.createCollection();this.children.add(this.itemsView);this.focusables=this.createCollection();const o=t.uiLanguageDirection==="rtl";this._focusCycler=new Ww({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[o?"arrowright":"arrowleft","arrowup"],focusNext:[o?"arrowleft":"arrowright","arrowdown"]}});const r=["ck","ck-toolbar",n.to("class"),n.if("isCompact","ck-toolbar_compact")];if(this.options.shouldGroupWhenFull&&this.options.isFloating){r.push("ck-toolbar_floating")}this.setTemplate({tag:"div",attributes:{class:r,role:"toolbar","aria-label":n.to("ariaLabel"),style:{maxWidth:n.to("maxWidth")}},children:this.children,on:{mousedown:AA(this)}});this._behavior=this.options.shouldGroupWhenFull?new TA(this):new SA(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(){this._behavior.destroy();this.focusTracker.destroy();this.keystrokes.destroy();return super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(t,e){const n=CA(t);const i=n.items.filter(((t,i,o)=>{if(t==="|"){return true}if(n.removeItems.indexOf(t)!==-1){return false}if(t==="-"){if(this.options.shouldGroupWhenFull){Object(u["b"])("toolbarview-line-break-ignored-when-grouping-items",o);return false}return true}if(!e.has(t)){Object(u["b"])("toolbarview-item-unavailable",{name:t});return false}return true}));const o=this._cleanSeparators(i).map((t=>{if(t==="|"){return new bA}else if(t==="-"){return new wA}return e.create(t)}));this.items.addMany(o)}_cleanSeparators(t){const e=t=>t!=="-"&&t!=="|";const n=t.length;const i=t.findIndex(e);const o=n-t.slice().reverse().findIndex(e);return t.slice(i,o).filter(((t,n,i)=>{if(e(t)){return true}const o=n>0&&i[n-1]===t;return!o}))}}class DA extends Wb{constructor(t){super(t);this.children=this.createCollection();this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class SA{constructor(t){const e=t.bindTemplate;t.set("isVertical",false);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 TA{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=false;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 n=e.index;for(const t of e.removed){if(n>=this.ungroupedItems.length){this.groupedItems.remove(t)}else{this.ungroupedItems.remove(t)}}for(let t=n;tthis.ungroupedItems.length){this.groupedItems.add(i,t-this.ungroupedItems.length)}else{this.ungroupedItems.add(i,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){this.shouldUpdateGroupingOnNextResize=true;return}const t=this.groupedItems.length;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()}}if(this.groupedItems.length!==t){this.view.fire("groupedItemsUpdate")}}get _areItemsOverflowing(){if(!this.ungroupedItems.length){return false}const t=this.viewElement;const e=this.viewLocale.uiLanguageDirection;const n=new vf(t.lastChild);const i=new vf(t);if(!this.cachedPadding){const n=bu.window.getComputedStyle(t);const i=e==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(n[i])}if(e==="ltr"){return n.right>i.right-this.cachedPadding}else{return n.left{if(!t||t!==e.contentRect.width||this.shouldUpdateGroupingOnNextResize){this.shouldUpdateGroupingOnNextResize=false;this._updateGrouping();t=e.contentRect.width}}));this._updateGrouping()}_enableGroupingOnMaxWidthChange(t){t.on("change:maxWidth",(()=>{this._updateGrouping()}))}_groupLastItem(){if(!this.groupedItems.length){this.viewChildren.add(new bA);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 t=this.viewLocale;const e=t.t;const n=WA(t);n.class="ck-toolbar__grouped-dropdown";n.panelPosition=t.uiLanguageDirection==="ltr"?"sw":"se";GA(n,[]);n.buttonView.set({label:e("Show more items"),tooltip:true,tooltipPosition:t.uiLanguageDirection==="rtl"?"se":"sw",icon:zb});n.toolbarView.items.bindTo(this.groupedItems).using((t=>t));return n}_updateFocusCycleableItems(){this.viewFocusables.clear();this.ungroupedItems.map((t=>{this.viewFocusables.add(t)}));if(this.groupedItems.length){this.viewFocusables.add(this.groupedItemsDropdown)}}}var IA=n(23);var MA={injectType:"singletonStyleTag",attributes:{"data-cke":true}};MA.insert="head";MA.singleton=true;var BA=ru()(IA["a"],MA);var NA=IA["a"].locals||{};class zA extends Wb{constructor(){super();this.items=this.createCollection();this.focusTracker=new Mf;this.keystrokes=new Bf;this._focusCycler=new Ww({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)}destroy(){super.destroy();this.focusTracker.destroy();this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class PA extends Wb{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 LA extends Wb{constructor(t){super(t);this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}var RA=n(24);var OA={injectType:"singletonStyleTag",attributes:{"data-cke":true}};OA.insert="head";OA.singleton=true;var jA=ru()(RA["a"],OA);var FA=RA["a"].locals||{};var VA=n(25);var UA={injectType:"singletonStyleTag",attributes:{"data-cke":true}};UA.insert="head";UA.singleton=true;var HA=ru()(VA["a"],UA);var qA=VA["a"].locals||{};function WA(t,e=Xw){const n=new e(t);const i=new rA(t);const o=new kA(t,n,i);n.bind("isEnabled").to(o);if(n instanceof Xw){n.bind("isOn").to(o,"isOpen")}else{n.arrowView.bind("isOn").to(o,"isOpen")}$A(o);return o}function GA(t,e){const n=t.locale;const i=n.t;const o=t.toolbarView=new EA(n);o.set("ariaLabel",i("Dropdown toolbar"));t.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}});e.map((t=>o.items.add(t)));t.panelView.children.add(o);o.items.delegate("execute").to(t)}function KA(t,e){const n=t.locale;const i=t.listView=new zA(n);i.items.bindTo(e).using((({type:t,model:e})=>{if(t==="separator"){return new LA(n)}else if(t==="button"||t==="switchbutton"){const i=new PA(n);let o;if(t==="button"){o=new zw(n)}else{o=new jw(n)}o.bind(...Object.keys(e)).to(e);o.delegate("execute").to(i);i.children.add(o);return i}}));t.panelView.children.add(i);i.items.delegate("execute").to(t)}function $A(t){YA(t);QA(t);ZA(t)}function YA(t){t.on("render",(()=>{Lb({emitter:t,activator:()=>t.isOpen,callback:()=>{t.isOpen=false},contextElements:[t.element]})}))}function QA(t){t.on("execute",(e=>{if(e.source instanceof jw){return}t.isOpen=false}))}function ZA(t){t.keystrokes.set("arrowdown",((e,n)=>{if(t.isOpen){t.panelView.focus();n()}}));t.keystrokes.set("arrowup",((e,n)=>{if(t.isOpen){t.panelView.focusLast();n()}}))}var JA=n(26);var XA={injectType:"singletonStyleTag",attributes:{"data-cke":true}};XA.insert="head";XA.singleton=true;var tC=ru()(JA["a"],XA);var eC=JA["a"].locals||{};class nC extends Wb{constructor(t){super(t);this.body=new ww(t)}render(){super.render();this.body.attachToDom()}destroy(){this.body.detachFromDom();return super.destroy()}}var iC=n(27);var oC={injectType:"singletonStyleTag",attributes:{"data-cke":true}};oC.insert="head";oC.singleton=true;var rC=ru()(iC["a"],oC);var sC=iC["a"].locals||{};class aC extends Wb{constructor(t){super(t);this.set("text");this.set("for");this.id=`ck-editor__label_${a()}`;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 cC extends nC{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;const e=new aC;e.text=t("Rich Text Editor");e.extendTemplate({attributes:{class:"ck-voice-label"}});return e}}class lC extends Wb{constructor(t,e,n){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",false);this._editableElement=n;this._hasExternalElement=!!this._editableElement;this._editingView=e}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 t=this._editingView;if(t.isRenderingInProgress){n(this)}else{e(this)}function e(e){t.change((n=>{const i=t.document.getRoot(e.name);n.addClass(e.isFocused?"ck-focused":"ck-blurred",i);n.removeClass(e.isFocused?"ck-blurred":"ck-focused",i)}))}function n(i){t.once("change:isRenderingInProgress",((t,o,r)=>{if(!r){e(i)}else{n(i)}}))}}}class dC extends lC{constructor(t,e,n){super(t,e,n);this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const t=this._editingView;const e=this.t;t.change((n=>{const i=t.document.getRoot(this.name);n.setAttribute("aria-label",e("Rich Text Editor, %0",this.name),i)}))}}var uC=n(28);var hC={injectType:"singletonStyleTag",attributes:{"data-cke":true}};hC.insert="head";hC.singleton=true;var fC=ru()(uC["a"],hC);var gC=uC["a"].locals||{};class mC extends Wb{constructor(t,e={}){super(t);const n=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",n.to("class")]},children:this.children});const i=new Wb(t);i.setTemplate({tag:"span",attributes:{class:["ck","ck-form__header__label"]},children:[{text:n.to("label")}]});this.children.add(i)}}var pC=n(29);var kC={injectType:"singletonStyleTag",attributes:{"data-cke":true}};kC.insert="head";kC.singleton=true;var bC=ru()(pC["a"],kC);var wC=pC["a"].locals||{};class AC extends Wb{constructor(t){super(t);this.set("value");this.set("id");this.set("placeholder");this.set("isReadOnly",false);this.set("hasError",false);this.set("ariaDescribedById");this.focusTracker=new Mf;this.bind("isFocused").to(this.focusTracker);this.set("isEmpty",true);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",true),"aria-describedby":e.to("ariaDescribedById")},on:{input:e.to(((...t)=>{this.fire("input",...t);this._updateIsEmpty()})),change:e.to(this._updateIsEmpty.bind(this))}})}render(){super.render();this.focusTracker.add(this.element);this._setDomElementValue(this.value);this._updateIsEmpty();this.on("change:value",((t,e,n)=>{this._setDomElementValue(n);this._updateIsEmpty()}))}destroy(){super.destroy();this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=CC(this.element)}_setDomElementValue(t){this.element.value=!t&&t!==0?"":t}}function CC(t){return!t.value}class vC extends Wb{constructor(t){super(t);const e=this.bindTemplate;this.setTemplate({tag:"iframe",attributes:{class:["ck","ck-reset_all"],sandbox:"allow-same-origin allow-scripts"},on:{load:e.to("loaded")}})}render(){return new Promise((t=>{this.on("loaded",t);super.render()}))}}var _C=n(30);var yC={injectType:"singletonStyleTag",attributes:{"data-cke":true}};yC.insert="head";yC.singleton=true;var xC=ru()(_C["a"],yC);var EC=_C["a"].locals||{};class DC extends Wb{constructor(t,e){super(t);const n=`ck-labeled-field-view-${a()}`;const i=`ck-labeled-field-view-status-${a()}`;this.fieldView=e(this,n,i);this.set("label");this.set("isEnabled",true);this.set("isEmpty",true);this.set("isFocused",false);this.set("errorText",null);this.set("infoText",null);this.set("class");this.set("placeholder");this.labelView=this._createLabelView(n);this.statusView=this._createStatusView(i);this.bind("_statusText").to(this,"errorText",this,"infoText",((t,e)=>t||e));const o=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",o.to("class"),o.if("isEnabled","ck-disabled",(t=>!t)),o.if("isEmpty","ck-labeled-field-view_empty"),o.if("isFocused","ck-labeled-field-view_focused"),o.if("placeholder","ck-labeled-field-view_placeholder"),o.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 aC(this.locale);e.for=t;e.bind("text").to(this,"label");return e}_createStatusView(t){const e=new Wb(this.locale);const n=this.bindTemplate;e.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",n.if("errorText","ck-labeled-field-view__status_error"),n.if("_statusText","ck-hidden",(t=>!t))],id:t,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]});return e}focus(){this.fieldView.focus()}}function SC(t,e,n){const i=new AC(t.locale);i.set({id:e,ariaDescribedById:n});i.bind("isReadOnly").to(t,"isEnabled",(t=>!t));i.bind("hasError").to(t,"errorText",(t=>!!t));i.on("input",(()=>{t.errorText=null}));t.bind("isEmpty","isFocused","placeholder").to(i);return i}function TC(t,e,n){const i=WA(t.locale);i.set({id:e,ariaDescribedById:n});i.bind("isEnabled").to(t);return i}class IC extends Ma{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 MC{constructor(t,e){if(e){_n(this,e)}if(t){this.set(t)}}}Vn(MC,In);var BC=n(31);var NC={injectType:"singletonStyleTag",attributes:{"data-cke":true}};NC.insert="head";NC.singleton=true;var zC=ru()(BC["a"],NC);var PC=BC["a"].locals||{};const LC=Tf("px");const RC=bu.document.body;class OC extends Wb{constructor(t){super(t);const e=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",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",LC),left:e.to("left",LC)}},children:this.content})}show(){this.isVisible=true}hide(){this.isVisible=false}attachTo(t){this.show();const e=OC.defaultPositions;const n=Object.assign({},{element:this.element,positions:[e.southArrowNorth,e.southArrowNorthMiddleWest,e.southArrowNorthMiddleEast,e.southArrowNorthWest,e.southArrowNorthEast,e.northArrowSouth,e.northArrowSouthMiddleWest,e.northArrowSouthMiddleEast,e.northArrowSouthWest,e.northArrowSouthEast,e.viewportStickyNorth],limiter:RC,fitInViewport:true},t);const i=OC._getOptimalPosition(n);const o=parseInt(i.left);const r=parseInt(i.top);const{name:s,config:a={}}=i;const{withArrow:c=true}=a;Object.assign(this,{top:r,left:o,position:s,withArrow:c})}pin(t){this.unpin();this._pinWhenIsVisibleCallback=()=>{if(this.isVisible){this._startPinning(t)}else{this._stopPinning()}};this._startPinning(t);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(t){this.attachTo(t);const e=jC(t.target);const n=t.limiter?jC(t.limiter):RC;this.listenTo(bu.document,"scroll",((i,o)=>{const r=o.target;const s=e&&r.contains(e);const a=n&&r.contains(n);if(s||a||!e||!n){this.attachTo(t)}}),{useCapture:true});this.listenTo(bu.window,"resize",(()=>{this.attachTo(t)}))}_stopPinning(){this.stopListening(bu.document,"scroll");this.stopListening(bu.window,"resize")}}function jC(t){if(fa(t)){return t}if(wf(t)){return t.commonAncestorContainer}if(typeof t=="function"){return jC(t())}return null}OC.arrowHorizontalOffset=25;OC.arrowVerticalOffset=10;OC.stickyVerticalOffset=20;OC._getOptimalPosition=uA;OC.defaultPositions=FC();function FC({horizontalOffset:t=OC.arrowHorizontalOffset,verticalOffset:e=OC.arrowVerticalOffset,stickyVerticalOffset:n=OC.stickyVerticalOffset,config:i}={}){return{northWestArrowSouthWest:(e,n)=>({top:o(e,n),left:e.left-t,name:"arrow_sw",...i&&{config:i}}),northWestArrowSouthMiddleWest:(e,n)=>({top:o(e,n),left:e.left-n.width*.25-t,name:"arrow_smw",...i&&{config:i}}),northWestArrowSouth:(t,e)=>({top:o(t,e),left:t.left-e.width/2,name:"arrow_s",...i&&{config:i}}),northWestArrowSouthMiddleEast:(e,n)=>({top:o(e,n),left:e.left-n.width*.75+t,name:"arrow_sme",...i&&{config:i}}),northWestArrowSouthEast:(e,n)=>({top:o(e,n),left:e.left-n.width+t,name:"arrow_se",...i&&{config:i}}),northArrowSouthWest:(e,n)=>({top:o(e,n),left:e.left+e.width/2-t,name:"arrow_sw",...i&&{config:i}}),northArrowSouthMiddleWest:(e,n)=>({top:o(e,n),left:e.left+e.width/2-n.width*.25-t,name:"arrow_smw",...i&&{config:i}}),northArrowSouth:(t,e)=>({top:o(t,e),left:t.left+t.width/2-e.width/2,name:"arrow_s",...i&&{config:i}}),northArrowSouthMiddleEast:(e,n)=>({top:o(e,n),left:e.left+e.width/2-n.width*.75+t,name:"arrow_sme",...i&&{config:i}}),northArrowSouthEast:(e,n)=>({top:o(e,n),left:e.left+e.width/2-n.width+t,name:"arrow_se",...i&&{config:i}}),northEastArrowSouthWest:(e,n)=>({top:o(e,n),left:e.right-t,name:"arrow_sw",...i&&{config:i}}),northEastArrowSouthMiddleWest:(e,n)=>({top:o(e,n),left:e.right-n.width*.25-t,name:"arrow_smw",...i&&{config:i}}),northEastArrowSouth:(t,e)=>({top:o(t,e),left:t.right-e.width/2,name:"arrow_s",...i&&{config:i}}),northEastArrowSouthMiddleEast:(e,n)=>({top:o(e,n),left:e.right-n.width*.75+t,name:"arrow_sme",...i&&{config:i}}),northEastArrowSouthEast:(e,n)=>({top:o(e,n),left:e.right-n.width+t,name:"arrow_se",...i&&{config:i}}),southWestArrowNorthWest:(e,n)=>({top:r(e,n),left:e.left-t,name:"arrow_nw",...i&&{config:i}}),southWestArrowNorthMiddleWest:(e,n)=>({top:r(e,n),left:e.left-n.width*.25-t,name:"arrow_nmw",...i&&{config:i}}),southWestArrowNorth:(t,e)=>({top:r(t,e),left:t.left-e.width/2,name:"arrow_n",...i&&{config:i}}),southWestArrowNorthMiddleEast:(e,n)=>({top:r(e,n),left:e.left-n.width*.75+t,name:"arrow_nme",...i&&{config:i}}),southWestArrowNorthEast:(e,n)=>({top:r(e,n),left:e.left-n.width+t,name:"arrow_ne",...i&&{config:i}}),southArrowNorthWest:(e,n)=>({top:r(e,n),left:e.left+e.width/2-t,name:"arrow_nw",...i&&{config:i}}),southArrowNorthMiddleWest:(e,n)=>({top:r(e,n),left:e.left+e.width/2-n.width*.25-t,name:"arrow_nmw",...i&&{config:i}}),southArrowNorth:(t,e)=>({top:r(t,e),left:t.left+t.width/2-e.width/2,name:"arrow_n",...i&&{config:i}}),southArrowNorthMiddleEast:(e,n)=>({top:r(e,n),left:e.left+e.width/2-n.width*.75+t,name:"arrow_nme",...i&&{config:i}}),southArrowNorthEast:(e,n)=>({top:r(e,n),left:e.left+e.width/2-n.width+t,name:"arrow_ne",...i&&{config:i}}),southEastArrowNorthWest:(e,n)=>({top:r(e,n),left:e.right-t,name:"arrow_nw",...i&&{config:i}}),southEastArrowNorthMiddleWest:(e,n)=>({top:r(e,n),left:e.right-n.width*.25-t,name:"arrow_nmw",...i&&{config:i}}),southEastArrowNorth:(t,e)=>({top:r(t,e),left:t.right-e.width/2,name:"arrow_n",...i&&{config:i}}),southEastArrowNorthMiddleEast:(e,n)=>({top:r(e,n),left:e.right-n.width*.75+t,name:"arrow_nme",...i&&{config:i}}),southEastArrowNorthEast:(e,n)=>({top:r(e,n),left:e.right-n.width+t,name:"arrow_ne",...i&&{config:i}}),viewportStickyNorth:(t,e,o)=>{if(!t.getIntersection(o)){return null}return{top:o.top+n,left:t.left+t.width/2-e.width/2,name:"arrowless",config:{withArrow:false,...i}}}};function o(t,n){return t.top-n.height-e}function r(t){return t.bottom+e}}var VC='';var UC='';var HC=n(32);var qC={injectType:"singletonStyleTag",attributes:{"data-cke":true}};qC.insert="head";qC.singleton=true;var WC=ru()(HC["a"],qC);var GC=HC["a"].locals||{};var KC=n(33);var $C={injectType:"singletonStyleTag",attributes:{"data-cke":true}};$C.insert="head";$C.singleton=true;var YC=ru()(KC["a"],$C);var QC=KC["a"].locals||{};const ZC=Tf("px");class JC extends Un{static get pluginName(){return"ContextualBalloon"}constructor(t){super(t);this.positionLimiter=()=>{const t=this.editor.editing.view;const e=t.document;const n=e.selection.editableElement;if(n){return t.domConverter.mapViewToDom(n.root)}return null};this.set("visibleView",null);this.view=new OC(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",false);this._rotatorView=this._createRotatorView();this._fakePanelsView=this._createFakePanelsView()}destroy(){super.destroy();this.view.destroy();this._rotatorView.destroy();this._fakePanelsView.destroy()}hasView(t){return Array.from(this._viewToStack.keys()).includes(t)}add(t){if(this.hasView(t.view)){throw new u["a"]("contextualballoon-add-view-exist",[this,t])}const e=t.stackId||"main";if(!this._idToStack.has(e)){this._idToStack.set(e,new Map([[t.view,t]]));this._viewToStack.set(t.view,this._idToStack.get(e));this._numberOfStacks=this._idToStack.size;if(!this._visibleStack||t.singleViewMode){this.showStack(e)}return}const n=this._idToStack.get(e);if(t.singleViewMode){this.showStack(e)}n.set(t.view,t);this._viewToStack.set(t.view,n);if(n===this._visibleStack){this._showView(t)}}remove(t){if(!this.hasView(t)){throw new u["a"]("contextualballoon-remove-view-not-exist",[this,t])}const e=this._viewToStack.get(t);if(this._singleViewMode&&this.visibleView===t){this._singleViewMode=false}if(this.visibleView===t){if(e.size===1){if(this._idToStack.size>1){this._showNextStack()}else{this.view.hide();this.visibleView=null;this._rotatorView.hideView()}}else{this._showView(Array.from(e.values())[e.size-2])}}if(e.size===1){this._idToStack.delete(this._getStackId(e));this._numberOfStacks=this._idToStack.size}else{e.delete(t)}this._viewToStack.delete(t)}updatePosition(t){if(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 u["a"]("contextualballoon-showstack-stack-not-exist",this)}if(this._visibleStack===e){return}this._showView(Array.from(e.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(t){const e=Array.from(this._idToStack.entries()).find((e=>e[1]===t));return e[0]}_showNextStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)+1;if(!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;if(!t[e]){e=t.length-1}this.showStack(this._getStackId(t[e]))}_createRotatorView(){const t=new XC(this.editor.locale);const e=this.editor.locale.t;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,n)=>{if(n<2){return""}const i=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return e("%0 of %1",[i,n])}));t.buttonNextView.on("execute",(()=>{if(t.focusTracker.isFocused){this.editor.editing.view.focus()}this._showNextStack()}));t.buttonPrevView.on("execute",(()=>{if(t.focusTracker.isFocused){this.editor.editing.view.focus()}this._showPrevStack()}));return t}_createFakePanelsView(){const t=new tv(this.editor.locale,this.view);t.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",((t,e)=>{const n=!e&&t>=2;return n?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);return t}_showView({view:t,balloonClassName:e="",withArrow:n=true,singleViewMode:i=false}){this.view.class=e;this.view.withArrow=n;this._rotatorView.showView(t);this.visibleView=t;this.view.pin(this._getBalloonPosition());this._fakePanelsView.updatePosition();if(i){this._singleViewMode=true}}_getBalloonPosition(){let t=Array.from(this._visibleStack.values()).pop().position;if(t){if(!t.limiter){t=Object.assign({},t,{limiter:this.positionLimiter})}t=Object.assign({},t,{viewportOffsetConfig:this.editor.ui.viewportOffset})}return t}}class XC extends Wb{constructor(t){super(t);const e=t.t;const n=this.bindTemplate;this.set("isNavigationVisible",true);this.focusTracker=new Mf;this.buttonPrevView=this._createButtonView(e("Previous"),VC);this.buttonNextView=this._createButtonView(e("Next"),UC);this.content=this.createCollection();this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",n.to("isNavigationVisible",(t=>t?"":"ck-hidden"))]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:n.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render();this.focusTracker.add(this.element)}destroy(){super.destroy();this.focusTracker.destroy()}showView(t){this.hideView();this.content.add(t)}hideView(){this.content.clear()}_createButtonView(t,e){const n=new zw(this.locale);n.set({label:t,icon:e,tooltip:true});return n}}class tv extends Wb{constructor(t,e){super(t);const n=this.bindTemplate;this.set("top",0);this.set("left",0);this.set("height",0);this.set("width",0);this.set("numberOfPanels",0);this.content=this.createCollection();this._balloonPanelView=e;this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",n.to("numberOfPanels",(t=>t?"":"ck-hidden"))],style:{top:n.to("top",ZC),left:n.to("left",ZC),width:n.to("width",ZC),height:n.to("height",ZC)}},children:this.content});this.on("change:numberOfPanels",((t,e,n,i)=>{if(n>i){this._addPanels(n-i)}else{this._removePanels(i-n)}this.updatePosition()}))}_addPanels(t){while(t--){const t=new Wb;t.setTemplate({tag:"div"});this.content.add(t);this.registerChild(t)}}_removePanels(t){while(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;const{width:n,height:i}=new vf(this._balloonPanelView.element);Object.assign(this,{top:t,left:e,width:n,height:i})}}}var ev=n(34);var nv={injectType:"singletonStyleTag",attributes:{"data-cke":true}};nv.insert="head";nv.singleton=true;var iv=ru()(ev["a"],nv);var ov=ev["a"].locals||{};const rv=Tf("px");class sv extends Wb{constructor(t){super(t);const e=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 Kb({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:e.to("isSticky",(t=>t?"block":"none")),height:e.to("isSticky",(t=>t?rv(this._panelRect.height):null))}}}).render();this._contentPanel=new Kb({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?rv(this._contentPanelPlaceholder.getBoundingClientRect().width):null)),top:e.to("_hasViewportTopOffset",(t=>t?rv(this.viewportTopOffset):null)),bottom:e.to("_isStickyToTheLimiter",(t=>t?rv(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(bu.window,"scroll",(()=>{this._checkIfShouldBeSticky()}));this.listenTo(this,"change:isActive",(()=>{this._checkIfShouldBeSticky()}))}_checkIfShouldBeSticky(){const t=this._panelRect=this._contentPanel.getBoundingClientRect();let e;if(!this.limiterElement){this.isSticky=false}else{e=this._limiterRect=this.limiterElement.getBoundingClientRect();this.isSticky=this.isActive&&e.top{if(n.isFocused&&!i.focusTracker.isFocused){if(o){o()}i.focus();e()}}));i.keystrokes.set("Esc",((e,n)=>{if(i.focusTracker.isFocused){t.focus();if(r){r()}n()}}))}const cv=Tf("px");class lv extends Un{static get pluginName(){return"BalloonToolbar"}static get requires(){return[JC]}constructor(t){super(t);this._balloonConfig=CA(t.config.get("balloonToolbar"));this.toolbarView=this._createToolbarView();this.focusTracker=new Mf;t.ui.once("ready",(()=>{this.focusTracker.add(t.ui.getEditableElement());this.focusTracker.add(this.toolbarView.element)}));this._resizeObserver=null;this._balloon=t.plugins.get(JC);this._fireSelectionChangeDebounced=af((()=>this.fire("_selectionChangeDebounced")),200);this.decorate("show")}init(){const t=this.editor;const e=t.model.document.selection;this.listenTo(this.focusTracker,"change:isFocused",((t,e,n)=>{const i=this._balloon.visibleView===this.toolbarView;if(!n&&i){this.hide()}else if(n){this.show()}}));this.listenTo(e,"change:range",((t,n)=>{if(n.directChange||e.isCollapsed){this.hide()}this._fireSelectionChangeDebounced()}));this.listenTo(this,"_selectionChangeDebounced",(()=>{if(this.editor.editing.view.document.isFocused){this.show()}}));if(!this._balloonConfig.shouldNotGroupWhenFull){this.listenTo(t,"ready",(()=>{const e=t.ui.view.editable.element;this._resizeObserver=new Ef(e,(()=>{this.toolbarView.maxWidth=cv(new vf(e).width*.9)}))}))}this.listenTo(this.toolbarView,"groupedItemsUpdate",(()=>{this._updatePosition()}))}afterInit(){const t=this.editor.ui.componentFactory;this.toolbarView.fillFromConfig(this._balloonConfig,t)}_createToolbarView(){const t=!this._balloonConfig.shouldNotGroupWhenFull;const e=new EA(this.editor.locale,{shouldGroupWhenFull:t,isFloating:true});e.render();return e}show(){const t=this.editor;const e=t.model.document.selection;const n=t.model.schema;if(this._balloon.hasView(this.toolbarView)){return}if(e.isCollapsed){return}if(dv(e,n)){return}if(Array.from(this.toolbarView.items).every((t=>t.isEnabled!==undefined&&!t.isEnabled))){return}this.listenTo(this.editor.ui,"update",(()=>{this._updatePosition()}));this._balloon.add({view:this.toolbarView,position:this._getBalloonPositionData(),balloonClassName:"ck-toolbar-container"})}hide(){if(this._balloon.hasView(this.toolbarView)){this.stopListening(this.editor.ui,"update");this._balloon.remove(this.toolbarView)}}_getBalloonPositionData(){const t=this.editor;const e=t.editing.view;const n=e.document;const i=n.selection;const o=n.selection.isBackward;return{target:()=>{const t=o?i.getFirstRange():i.getLastRange();const n=vf.getDomRangeRects(e.domConverter.viewRangeToDom(t));if(o){return n[0]}else{if(n.length>1&&n[n.length-1].width===0){n.pop()}return n[n.length-1]}},positions:this._getBalloonPositions(o)}}_updatePosition(){this._balloon.updatePosition(this._getBalloonPositionData())}destroy(){super.destroy();this.stopListening();this._fireSelectionChangeDebounced.cancel();this.toolbarView.destroy();this.focusTracker.destroy();if(this._resizeObserver){this._resizeObserver.destroy()}}_getBalloonPositions(t){const e=Yl.isSafari&&Yl.isiOS;const n=e?FC({verticalOffset:Math.max(OC.arrowVerticalOffset,Math.round(20/bu.window.visualViewport.scale))}):OC.defaultPositions;return t?[n.northWestArrowSouth,n.northWestArrowSouthWest,n.northWestArrowSouthEast,n.northWestArrowSouthMiddleEast,n.northWestArrowSouthMiddleWest,n.southWestArrowNorth,n.southWestArrowNorthWest,n.southWestArrowNorthEast,n.southWestArrowNorthMiddleWest,n.southWestArrowNorthMiddleEast]:[n.southEastArrowNorth,n.southEastArrowNorthEast,n.southEastArrowNorthWest,n.southEastArrowNorthMiddleEast,n.southEastArrowNorthMiddleWest,n.northEastArrowSouth,n.northEastArrowSouthEast,n.northEastArrowSouthWest,n.northEastArrowSouthMiddleEast,n.northEastArrowSouthMiddleWest]}}function dv(t,e){if(t.rangeCount===1){return false}return[...t.getRanges()].every((t=>{const n=t.getContainedElement();return n&&e.isSelectable(n)}))}var uv=n(35);var hv={injectType:"singletonStyleTag",attributes:{"data-cke":true}};hv.insert="head";hv.singleton=true;var fv=ru()(uv["a"],hv);var gv=uv["a"].locals||{};const mv=Tf("px");class pv extends zw{constructor(t){super(t);const e=this.bindTemplate;this.isVisible=false;this.isToggleable=true;this.set("top",0);this.set("left",0);this.extendTemplate({attributes:{class:"ck-block-toolbar-button",style:{top:e.to("top",(t=>mv(t))),left:e.to("left",(t=>mv(t)))}}})}}const kv=Tf("px");class bv extends Un{static get pluginName(){return"BlockToolbar"}constructor(t){super(t);this._blockToolbarConfig=CA(this.editor.config.get("blockToolbar"));this.toolbarView=this._createToolbarView();this.panelView=this._createPanelView();this.buttonView=this._createButtonView();this._resizeObserver=null;Lb({emitter:this.panelView,contextElements:[this.panelView.element,this.buttonView.element],activator:()=>this.panelView.isVisible,callback:()=>this._hidePanel()})}init(){const t=this.editor;this.listenTo(t.model.document.selection,"change:range",((t,e)=>{if(e.directChange){this._hidePanel()}}));this.listenTo(t.ui,"update",(()=>this._updateButton()));this.listenTo(t,"change:isReadOnly",(()=>this._updateButton()),{priority:"low"});this.listenTo(t.ui.focusTracker,"change:isFocused",(()=>this._updateButton()));this.listenTo(this.buttonView,"change:isVisible",((t,e,n)=>{if(n){this.buttonView.listenTo(window,"resize",(()=>this._updateButton()))}else{this.buttonView.stopListening(window,"resize");this._hidePanel()}}))}afterInit(){const t=this.editor.ui.componentFactory;const e=this._blockToolbarConfig;this.toolbarView.fillFromConfig(e,t);for(const t of this.toolbarView.items){t.on("execute",(()=>this._hidePanel(true)),{priority:"high"})}if(!e.shouldNotGroupWhenFull){this.listenTo(this.editor,"ready",(()=>{const t=this.editor.ui.view.editable.element;this._resizeObserver=new Ef(t,(()=>{this.toolbarView.maxWidth=this._getToolbarMaxWidth()}))}))}}destroy(){super.destroy();this.panelView.destroy();this.buttonView.destroy();this.toolbarView.destroy();if(this._resizeObserver){this._resizeObserver.destroy()}}_createToolbarView(){const t=!this._blockToolbarConfig.shouldNotGroupWhenFull;const e=new EA(this.editor.locale,{shouldGroupWhenFull:t,isFloating:true});e.focusTracker.on("change:isFocused",((t,e,n)=>{if(!n){this._hidePanel()}}));return e}_createPanelView(){const t=this.editor;const e=new OC(t.locale);e.content.add(this.toolbarView);e.class="ck-toolbar-container";t.ui.view.body.add(e);t.ui.focusTracker.add(e.element);this.toolbarView.keystrokes.set("Esc",((t,e)=>{this._hidePanel(true);e()}));return e}_createButtonView(){const t=this.editor;const e=t.t;const n=new pv(t.locale);n.set({label:e("Edit block"),icon:Bb,withText:false});n.bind("isOn").to(this.panelView,"isVisible");n.bind("tooltip").to(this.panelView,"isVisible",(t=>!t));this.listenTo(n,"execute",(()=>{if(!this.panelView.isVisible){this._showPanel()}else{this._hidePanel(true)}}));t.ui.view.body.add(n);t.ui.focusTracker.add(n.element);return n}_updateButton(){const t=this.editor;const e=t.model;const n=t.editing.view;if(!t.ui.focusTracker.isFocused){this._hideButton();return}if(t.isReadOnly){this._hideButton();return}const i=Array.from(e.document.selection.getSelectedBlocks())[0];if(!i||Array.from(this.toolbarView.items).every((t=>!t.isEnabled))){this._hideButton();return}const o=n.domConverter.mapViewToDom(t.editing.mapper.toViewElement(i));this.buttonView.isVisible=true;this._attachButtonToElement(o);if(this.panelView.isVisible){this._showPanel()}}_hideButton(){this.buttonView.isVisible=false}_showPanel(){const t=this.panelView.isVisible;this.panelView.show();this.toolbarView.maxWidth=this._getToolbarMaxWidth();this.panelView.pin({target:this.buttonView.element,limiter:this.editor.ui.getEditableElement()});if(!t){this.toolbarView.items.get(0).focus()}}_hidePanel(t){this.panelView.isVisible=false;if(t){this.editor.editing.view.focus()}}_attachButtonToElement(t){const e=window.getComputedStyle(t);const n=new vf(this.editor.ui.getEditableElement());const i=parseInt(e.paddingTop,10);const o=parseInt(e.lineHeight,10)||parseInt(e.fontSize,10)*1.2;const r=uA({element:this.buttonView.element,target:t,positions:[(t,e)=>{let r;if(this.editor.locale.uiLanguageDirection==="ltr"){r=n.left-e.width}else{r=n.right}return{top:t.top+i+(o-e.height)/2,left:r}}]});this.buttonView.top=r.top;this.buttonView.left=r.left}_getToolbarMaxWidth(){const t=this.editor.ui.view.editable.element;const e=new vf(t);const n=new vf(this.buttonView.element);const i=this.editor.locale.uiLanguageDirection==="rtl";const o=i?n.left-e.right+n.width:e.left-n.left;return kv(e.width+o)}}var wv=n(36);var Av={injectType:"singletonStyleTag",attributes:{"data-cke":true}};Av.insert="head";Av.singleton=true;var Cv=ru()(wv["a"],Av);var vv=wv["a"].locals||{};const _v=new WeakMap;function yv(t){const{view:e,element:n,text:i,isDirectHost:o=true,keepOnFocus:r=false}=t;const s=e.document;if(!_v.has(s)){_v.set(s,new Map);s.registerPostFixer((t=>Tv(s,t)))}_v.get(s).set(n,{text:i,isDirectHost:o,keepOnFocus:r,hostElement:o?n:null});e.change((t=>Tv(s,t)))}function xv(t,e){const n=e.document;t.change((t=>{if(!_v.has(n)){return}const i=_v.get(n);const o=i.get(e);t.removeAttribute("data-placeholder",o.hostElement);Dv(t,o.hostElement);i.delete(e)}))}function Ev(t,e){if(!e.hasClass("ck-placeholder")){t.addClass("ck-placeholder",e);return true}return false}function Dv(t,e){if(e.hasClass("ck-placeholder")){t.removeClass("ck-placeholder",e);return true}return false}function Sv(t,e){if(!t.isAttached()){return false}const n=Array.from(t.getChildren()).some((t=>!t.is("uiElement")));if(n){return false}if(e){return true}const i=t.document;if(!i.isFocused){return true}const o=i.selection;const r=o.anchor;return r&&r.parent!==t}function Tv(t,e){const n=_v.get(t);const i=[];let o=false;for(const[t,r]of n){if(r.isDirectHost){i.push(t);if(Iv(e,t,r)){o=true}}}for(const[t,r]of n){if(r.isDirectHost){continue}const n=Mv(t);if(!n){continue}if(i.includes(n)){continue}r.hostElement=n;if(Iv(e,t,r)){o=true}}return o}function Iv(t,e,n){const{text:i,isDirectHost:o,hostElement:r}=n;let s=false;if(r.getAttribute("data-placeholder")!==i){t.setAttribute("data-placeholder",i,r);s=true}const a=o||e.childCount==1;if(a&&Sv(r,n.keepOnFocus)){if(Ev(t,r)){s=true}}else if(Dv(t,r)){s=true}return s}function Mv(t){if(t.childCount){const e=t.getChild(0);if(e.is("element")&&!e.is("uiElement")){return e}}return null}const Bv=new Map;function Nv(t,e,n){let i=Bv.get(t);if(!i){i=new Map;Bv.set(t,i)}i.set(e,n)}function zv(t,e){const n=Bv.get(t);if(n&&n.has(e)){return n.get(e)}return Pv}function Pv(t){return[t]}function Lv(t,e,n={}){const i=zv(t.constructor,e.constructor);try{t=t.clone();return i(t,e,n)}catch(t){throw t}}function Rv(t,e,n){t=t.slice();e=e.slice();const i=new Ov(n.document,n.useRelations,n.forceWeakRemove);i.setOriginalOperations(t);i.setOriginalOperations(e);const o=i.originalOperations;if(t.length==0||e.length==0){return{operationsA:t,operationsB:e,originalOperations:o}}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;while(a{if(t.key===e.key&&t.range.start.hasSameParentAs(e.range.start)){const i=t.range.getDifference(e.range).map((e=>new Sp(e,t.key,t.oldValue,t.newValue,0)));const o=t.range.getIntersection(e.range);if(o){if(n.aIsStrong){i.push(new Sp(o,e.key,e.newValue,t.newValue,0))}}if(i.length==0){return[new rk(0)]}return i}else{return[t]}}));Nv(Sp,Mp,((t,e)=>{if(t.range.start.hasSameParentAs(e.position)&&t.range.containsPosition(e.position)){const n=t.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes);const i=n.map((e=>new Sp(e,t.key,t.oldValue,t.newValue,t.baseVersion)));if(e.shouldReceiveAttributes){const n=Vv(e,t.key,t.oldValue);if(n){i.unshift(n)}}return i}t.range=t.range._getTransformedByInsertion(e.position,e.howMany,false)[0];return[t]}));function Vv(t,e,n){const i=t.nodes;const o=i.getNode(0).getAttribute(e);if(o==n){return null}const r=new rg(t.position,t.position.getShiftedBy(t.howMany));return new Sp(r,e,o,n,0)}Nv(Sp,Pp,((t,e)=>{const n=[];if(t.range.start.hasSameParentAs(e.deletionPosition)){if(t.range.containsPosition(e.deletionPosition)||t.range.start.isEqual(e.deletionPosition)){n.push(rg._createFromPositionAndShift(e.graveyardPosition,1))}}const i=t.range._getTransformedByMergeOperation(e);if(!i.isCollapsed){n.push(i)}return n.map((e=>new Sp(e,t.key,t.oldValue,t.newValue,t.baseVersion)))}));Nv(Sp,Ip,((t,e)=>{const n=Uv(t.range,e);return n.map((e=>new Sp(e,t.key,t.oldValue,t.newValue,t.baseVersion)))}));function Uv(t,e){const n=rg._createFromPositionAndShift(e.sourcePosition,e.howMany);let i=null;let o=[];if(n.containsRange(t,true)){i=t}else if(t.start.hasSameParentAs(n.start)){o=t.getDifference(n);i=t.getIntersection(n)}else{o=[t]}const r=[];for(let t of o){t=t._getTransformedByDeletion(e.sourcePosition,e.howMany);const n=e.getMovedRangeStart();const i=t.start.hasSameParentAs(n);t=t._getTransformedByInsertion(n,e.howMany,i);r.push(...t)}if(i){r.push(i._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,false)[0])}return r}Nv(Sp,Lp,((t,e)=>{if(t.range.end.isEqual(e.insertionPosition)){if(!e.graveyardPosition){t.range.end.offset++}return[t]}if(t.range.start.hasSameParentAs(e.splitPosition)&&t.range.containsPosition(e.splitPosition)){const n=t.clone();n.range=new rg(e.moveTargetPosition.clone(),t.range.end._getCombined(e.splitPosition,e.moveTargetPosition));t.range.end=e.splitPosition.clone();t.range.end.stickiness="toPrevious";return[t,n]}t.range=t.range._getTransformedBySplitOperation(e);return[t]}));Nv(Mp,Sp,((t,e)=>{const n=[t];if(t.shouldReceiveAttributes&&t.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(t.position)){const i=Vv(t,e.key,e.newValue);if(i){n.push(i)}}return n}));Nv(Mp,Mp,((t,e,n)=>{if(t.position.isEqual(e.position)&&n.aIsStrong){return[t]}t.position=t.position._getTransformedByInsertOperation(e);return[t]}));Nv(Mp,Ip,((t,e)=>{t.position=t.position._getTransformedByMoveOperation(e);return[t]}));Nv(Mp,Lp,((t,e)=>{t.position=t.position._getTransformedBySplitOperation(e);return[t]}));Nv(Mp,Pp,((t,e)=>{t.position=t.position._getTransformedByMergeOperation(e);return[t]}));Nv(Bp,Mp,((t,e)=>{if(t.oldRange){t.oldRange=t.oldRange._getTransformedByInsertOperation(e)[0]}if(t.newRange){t.newRange=t.newRange._getTransformedByInsertOperation(e)[0]}return[t]}));Nv(Bp,Bp,((t,e,n)=>{if(t.name==e.name){if(n.aIsStrong){t.oldRange=e.newRange?e.newRange.clone():null}else{return[new rk(0)]}}return[t]}));Nv(Bp,Pp,((t,e)=>{if(t.oldRange){t.oldRange=t.oldRange._getTransformedByMergeOperation(e)}if(t.newRange){t.newRange=t.newRange._getTransformedByMergeOperation(e)}return[t]}));Nv(Bp,Ip,((t,e,n)=>{if(t.oldRange){t.oldRange=rg._createFromRanges(t.oldRange._getTransformedByMoveOperation(e))}if(t.newRange){if(n.abRelation){const i=rg._createFromRanges(t.newRange._getTransformedByMoveOperation(e));if(n.abRelation.side=="left"&&e.targetPosition.isEqual(t.newRange.start)){t.newRange.start.path=n.abRelation.path;t.newRange.end=i.end;return[t]}else if(n.abRelation.side=="right"&&e.targetPosition.isEqual(t.newRange.end)){t.newRange.start=i.start;t.newRange.end.path=n.abRelation.path;return[t]}}t.newRange=rg._createFromRanges(t.newRange._getTransformedByMoveOperation(e))}return[t]}));Nv(Bp,Lp,((t,e,n)=>{if(t.oldRange){t.oldRange=t.oldRange._getTransformedBySplitOperation(e)}if(t.newRange){if(n.abRelation){const i=t.newRange._getTransformedBySplitOperation(e);if(t.newRange.start.isEqual(e.splitPosition)&&n.abRelation.wasStartBeforeMergedElement){t.newRange.start=eg._createAt(e.insertionPosition)}else if(t.newRange.start.isEqual(e.splitPosition)&&!n.abRelation.wasInLeftElement){t.newRange.start=eg._createAt(e.moveTargetPosition)}if(t.newRange.end.isEqual(e.splitPosition)&&n.abRelation.wasInRightElement){t.newRange.end=eg._createAt(e.moveTargetPosition)}else if(t.newRange.end.isEqual(e.splitPosition)&&n.abRelation.wasEndBeforeMergedElement){t.newRange.end=eg._createAt(e.insertionPosition)}else{t.newRange.end=i.end}return[t]}t.newRange=t.newRange._getTransformedBySplitOperation(e)}return[t]}));Nv(Pp,Mp,((t,e)=>{if(t.sourcePosition.hasSameParentAs(e.position)){t.howMany+=e.howMany}t.sourcePosition=t.sourcePosition._getTransformedByInsertOperation(e);t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e);return[t]}));Nv(Pp,Pp,((t,e,n)=>{if(t.sourcePosition.isEqual(e.sourcePosition)&&t.targetPosition.isEqual(e.targetPosition)){if(!n.bWasUndone){return[new rk(0)]}else{const n=e.graveyardPosition.path.slice();n.push(0);t.sourcePosition=new eg(e.graveyardPosition.root,n);t.howMany=0;return[t]}}if(t.sourcePosition.isEqual(e.sourcePosition)&&!t.targetPosition.isEqual(e.targetPosition)&&!n.bWasUndone&&n.abRelation!="splitAtSource"){const i=t.targetPosition.root.rootName=="$graveyard";const o=e.targetPosition.root.rootName=="$graveyard";const r=i&&!o;const s=o&&!i;const a=s||!r&&n.aIsStrong;if(a){const n=e.targetPosition._getTransformedByMergeOperation(e);const i=t.targetPosition._getTransformedByMergeOperation(e);return[new Ip(n,t.howMany,i,0)]}else{return[new rk(0)]}}if(t.sourcePosition.hasSameParentAs(e.targetPosition)){t.howMany+=e.howMany}t.sourcePosition=t.sourcePosition._getTransformedByMergeOperation(e);t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e);if(!t.graveyardPosition.isEqual(e.graveyardPosition)||!n.aIsStrong){t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)}return[t]}));Nv(Pp,Ip,((t,e,n)=>{const i=rg._createFromPositionAndShift(e.sourcePosition,e.howMany);if(e.type=="remove"&&!n.bWasUndone&&!n.forceWeakRemove){if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&i.containsPosition(t.sourcePosition)){return[new rk(0)]}}if(t.sourcePosition.hasSameParentAs(e.targetPosition)){t.howMany+=e.howMany}if(t.sourcePosition.hasSameParentAs(e.sourcePosition)){t.howMany-=e.howMany}t.sourcePosition=t.sourcePosition._getTransformedByMoveOperation(e);t.targetPosition=t.targetPosition._getTransformedByMoveOperation(e);if(!t.graveyardPosition.isEqual(e.targetPosition)){t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)}return[t]}));Nv(Pp,Lp,((t,e,n)=>{if(e.graveyardPosition){t.graveyardPosition=t.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1);if(t.deletionPosition.isEqual(e.graveyardPosition)){t.howMany=e.howMany}}if(t.targetPosition.isEqual(e.splitPosition)){const i=e.howMany!=0;const o=e.graveyardPosition&&t.deletionPosition.isEqual(e.graveyardPosition);if(i||o||n.abRelation=="mergeTargetNotMoved"){t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e);return[t]}}if(t.sourcePosition.isEqual(e.splitPosition)){if(n.abRelation=="mergeSourceNotMoved"){t.howMany=0;t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e);return[t]}if(n.abRelation=="mergeSameElement"||t.sourcePosition.offset>0){t.sourcePosition=e.moveTargetPosition.clone();t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e);return[t]}}if(t.sourcePosition.hasSameParentAs(e.splitPosition)){t.howMany=e.splitPosition.offset}t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e);t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e);return[t]}));Nv(Ip,Mp,((t,e)=>{const n=rg._createFromPositionAndShift(t.sourcePosition,t.howMany);const i=n._getTransformedByInsertOperation(e,false)[0];t.sourcePosition=i.start;t.howMany=i.end.offset-i.start.offset;if(!t.targetPosition.isEqual(e.position)){t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e)}return[t]}));Nv(Ip,Ip,((t,e,n)=>{const i=rg._createFromPositionAndShift(t.sourcePosition,t.howMany);const o=rg._createFromPositionAndShift(e.sourcePosition,e.howMany);let r=n.aIsStrong;let s=!n.aIsStrong;if(n.abRelation=="insertBefore"||n.baRelation=="insertAfter"){s=true}else if(n.abRelation=="insertAfter"||n.baRelation=="insertBefore"){s=false}let a;if(t.targetPosition.isEqual(e.targetPosition)&&s){a=t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany)}else{a=t.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}if(Hv(t,e)&&Hv(e,t)){return[e.getReversed()]}const c=i.containsPosition(e.targetPosition);if(c&&i.containsRange(o,true)){i.start=i.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany);i.end=i.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany);return qv([i],a)}const l=o.containsPosition(t.targetPosition);if(l&&o.containsRange(i,true)){i.start=i.start._getCombined(e.sourcePosition,e.getMovedRangeStart());i.end=i.end._getCombined(e.sourcePosition,e.getMovedRangeStart());return qv([i],a)}const d=Ba(t.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if(d=="prefix"||d=="extension"){i.start=i.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany);i.end=i.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany);return qv([i],a)}if(t.type=="remove"&&e.type!="remove"&&!n.aWasUndone&&!n.forceWeakRemove){r=true}else if(t.type!="remove"&&e.type=="remove"&&!n.bWasUndone&&!n.forceWeakRemove){r=false}const u=[];const h=i.getDifference(o);for(const t of h){t.start=t.start._getTransformedByDeletion(e.sourcePosition,e.howMany);t.end=t.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const n=Ba(t.start.getParentPath(),e.getMovedRangeStart().getParentPath())=="same";const i=t._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,n);u.push(...i)}const f=i.getIntersection(o);if(f!==null&&r){f.start=f.start._getCombined(e.sourcePosition,e.getMovedRangeStart());f.end=f.end._getCombined(e.sourcePosition,e.getMovedRangeStart());if(u.length===0){u.push(f)}else if(u.length==1){if(o.start.isBefore(i.start)||o.start.isEqual(i.start)){u.unshift(f)}else{u.push(f)}}else{u.splice(1,0,f)}}if(u.length===0){return[new rk(t.baseVersion)]}return qv(u,a)}));Nv(Ip,Lp,((t,e,n)=>{let i=t.targetPosition.clone();if(!t.targetPosition.isEqual(e.insertionPosition)||!e.graveyardPosition||n.abRelation=="moveTargetAfter"){i=t.targetPosition._getTransformedBySplitOperation(e)}const o=rg._createFromPositionAndShift(t.sourcePosition,t.howMany);if(o.end.isEqual(e.insertionPosition)){if(!e.graveyardPosition){t.howMany++}t.targetPosition=i;return[t]}if(o.start.hasSameParentAs(e.splitPosition)&&o.containsPosition(e.splitPosition)){let t=new rg(e.splitPosition,o.end);t=t._getTransformedBySplitOperation(e);const n=[new rg(o.start,e.splitPosition),t];return qv(n,i)}if(t.targetPosition.isEqual(e.splitPosition)&&n.abRelation=="insertAtSource"){i=e.moveTargetPosition}if(t.targetPosition.isEqual(e.insertionPosition)&&n.abRelation=="insertBetween"){i=t.targetPosition}const r=o._getTransformedBySplitOperation(e);const s=[r];if(e.graveyardPosition){const i=o.start.isEqual(e.graveyardPosition)||o.containsPosition(e.graveyardPosition);if(t.howMany>1&&i&&!n.aWasUndone){s.push(rg._createFromPositionAndShift(e.insertionPosition,1))}}return qv(s,i)}));Nv(Ip,Pp,((t,e,n)=>{const i=rg._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.sourcePosition)){if(t.type=="remove"&&!n.forceWeakRemove){if(!n.aWasUndone){const n=[];let i=e.graveyardPosition.clone();let o=e.targetPosition._getTransformedByMergeOperation(e);if(t.howMany>1){n.push(new Ip(t.sourcePosition,t.howMany-1,t.targetPosition,0));i=i._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1);o=o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1)}const r=e.deletionPosition._getCombined(t.sourcePosition,t.targetPosition);const s=new Ip(i,1,r,0);const a=s.getMovedRangeStart().path.slice();a.push(0);const c=new eg(s.targetPosition.root,a);o=o._getTransformedByMove(i,r,1);const l=new Ip(o,e.howMany,c,0);n.push(s);n.push(l);return n}}else{if(t.howMany==1){if(!n.bWasUndone){return[new rk(0)]}else{t.sourcePosition=e.graveyardPosition.clone();t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e);return[t]}}}}const o=rg._createFromPositionAndShift(t.sourcePosition,t.howMany);const r=o._getTransformedByMergeOperation(e);t.sourcePosition=r.start;t.howMany=r.end.offset-r.start.offset;t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e);return[t]}));Nv(Np,Mp,((t,e)=>{t.position=t.position._getTransformedByInsertOperation(e);return[t]}));Nv(Np,Pp,((t,e)=>{if(t.position.isEqual(e.deletionPosition)){t.position=e.graveyardPosition.clone();t.position.stickiness="toNext";return[t]}t.position=t.position._getTransformedByMergeOperation(e);return[t]}));Nv(Np,Ip,((t,e)=>{t.position=t.position._getTransformedByMoveOperation(e);return[t]}));Nv(Np,Np,((t,e,n)=>{if(t.position.isEqual(e.position)){if(n.aIsStrong){t.oldName=e.newName}else{return[new rk(0)]}}return[t]}));Nv(Np,Lp,((t,e)=>{const n=t.position.path;const i=e.splitPosition.getParentPath();if(Ba(n,i)=="same"&&!e.graveyardPosition){const e=new Np(t.position.getShiftedBy(1),t.oldName,t.newName,0);return[t,e]}t.position=t.position._getTransformedBySplitOperation(e);return[t]}));Nv(zp,zp,((t,e,n)=>{if(t.root===e.root&&t.key===e.key){if(!n.aIsStrong||t.newValue===e.newValue){return[new rk(0)]}else{t.oldValue=e.newValue}}return[t]}));Nv(Lp,Mp,((t,e)=>{if(t.splitPosition.hasSameParentAs(e.position)&&t.splitPosition.offset{if(!t.graveyardPosition&&!n.bWasUndone&&t.splitPosition.hasSameParentAs(e.sourcePosition)){const n=e.graveyardPosition.path.slice();n.push(0);const i=new eg(e.graveyardPosition.root,n);const o=Lp.getInsertionPosition(new eg(e.graveyardPosition.root,n));const r=new Lp(i,0,o,null,0);t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e);t.insertionPosition=Lp.getInsertionPosition(t.splitPosition);t.graveyardPosition=r.insertionPosition.clone();t.graveyardPosition.stickiness="toNext";return[r,t]}if(t.splitPosition.hasSameParentAs(e.deletionPosition)&&!t.splitPosition.isAfter(e.deletionPosition)){t.howMany--}if(t.splitPosition.hasSameParentAs(e.targetPosition)){t.howMany+=e.howMany}t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e);t.insertionPosition=Lp.getInsertionPosition(t.splitPosition);if(t.graveyardPosition){t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)}return[t]}));Nv(Lp,Ip,((t,e,n)=>{const i=rg._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.graveyardPosition){const o=i.start.isEqual(t.graveyardPosition)||i.containsPosition(t.graveyardPosition);if(!n.bWasUndone&&o){const n=t.splitPosition._getTransformedByMoveOperation(e);const i=t.graveyardPosition._getTransformedByMoveOperation(e);const o=i.path.slice();o.push(0);const r=new eg(i.root,o);const s=new Ip(n,t.howMany,r,0);return[s]}t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)}const o=t.splitPosition.isEqual(e.targetPosition);if(o&&(n.baRelation=="insertAtSource"||n.abRelation=="splitBefore")){t.howMany+=e.howMany;t.splitPosition=t.splitPosition._getTransformedByDeletion(e.sourcePosition,e.howMany);t.insertionPosition=Lp.getInsertionPosition(t.splitPosition);return[t]}if(o&&n.abRelation&&n.abRelation.howMany){const{howMany:e,offset:i}=n.abRelation;t.howMany+=e;t.splitPosition=t.splitPosition.getShiftedBy(i);return[t]}if(t.splitPosition.hasSameParentAs(e.sourcePosition)&&i.containsPosition(t.splitPosition)){const n=e.howMany-(t.splitPosition.offset-e.sourcePosition.offset);t.howMany-=n;if(t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset{if(t.splitPosition.isEqual(e.splitPosition)){if(!t.graveyardPosition&&!e.graveyardPosition){return[new rk(0)]}if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition)){return[new rk(0)]}if(n.abRelation=="splitBefore"){t.howMany=0;t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e);return[t]}}if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition)){const i=t.splitPosition.root.rootName=="$graveyard";const o=e.splitPosition.root.rootName=="$graveyard";const r=i&&!o;const s=o&&!i;const a=s||!r&&n.aIsStrong;if(a){const n=[];if(e.howMany){n.push(new Ip(e.moveTargetPosition,e.howMany,e.splitPosition,0))}if(t.howMany){n.push(new Ip(t.splitPosition,t.howMany,t.moveTargetPosition,0))}return n}else{return[new rk(0)]}}if(t.graveyardPosition){t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e)}if(t.splitPosition.isEqual(e.insertionPosition)&&n.abRelation=="splitBefore"){t.howMany++;return[t]}if(e.splitPosition.isEqual(t.insertionPosition)&&n.baRelation=="splitBefore"){const n=e.insertionPosition.path.slice();n.push(0);const i=new eg(e.insertionPosition.root,n);const o=new Ip(t.insertionPosition,1,i,0);return[t,o]}if(t.splitPosition.hasSameParentAs(e.splitPosition)&&t.splitPosition.offset{const{top:n,right:i,bottom:o,left:r}=e;const s=[];if(![n,i,r,o].every((t=>!!t))){if(n){s.push([t+"-top",n])}if(i){s.push([t+"-right",i])}if(o){s.push([t+"-bottom",o])}if(r){s.push([t+"-left",r])}}else{s.push([t,k_(e)])}return s}}function k_({top:t,right:e,bottom:n,left:i}){const o=[];if(i!==e){o.push(t,e,n,i)}else if(n!==t){o.push(t,e,n)}else if(e!==t){o.push(t,e)}else{o.push(t)}return o.join(" ")}function b_(t){return e=>({path:t,value:m_(e)})}function w_(t){return t.replace(/, /g,",").split(" ").map((t=>t.replace(/,/g,", ")))}function A_(t){t.setNormalizer("background",C_);t.setNormalizer("background-color",(t=>({path:"background.color",value:t})));t.setReducer("background",(t=>{const e=[];e.push(["background-color",t.color]);return e}));t.setStyleRelation("background",["background-color"])}function C_(t){const e={};const n=w_(t);for(const t of n){if(c_(t)){e.repeat=e.repeat||[];e.repeat.push(t)}else if(d_(t)){e.position=e.position||[];e.position.push(t)}else if(h_(t)){e.attachment=t}else if(t_(t)){e.color=t}else if(g_(t)){e.image=t}}return{path:"background",value:e}}function v_(t){t.setNormalizer("border",__);t.setNormalizer("border-top",y_("top"));t.setNormalizer("border-right",y_("right"));t.setNormalizer("border-bottom",y_("bottom"));t.setNormalizer("border-left",y_("left"));t.setNormalizer("border-color",x_("color"));t.setNormalizer("border-width",x_("width"));t.setNormalizer("border-style",x_("style"));t.setNormalizer("border-top-color",D_("color","top"));t.setNormalizer("border-top-style",D_("style","top"));t.setNormalizer("border-top-width",D_("width","top"));t.setNormalizer("border-right-color",D_("color","right"));t.setNormalizer("border-right-style",D_("style","right"));t.setNormalizer("border-right-width",D_("width","right"));t.setNormalizer("border-bottom-color",D_("color","bottom"));t.setNormalizer("border-bottom-style",D_("style","bottom"));t.setNormalizer("border-bottom-width",D_("width","bottom"));t.setNormalizer("border-left-color",D_("color","left"));t.setNormalizer("border-left-style",D_("style","left"));t.setNormalizer("border-left-width",D_("width","left"));t.setExtractor("border-top",S_("top"));t.setExtractor("border-right",S_("right"));t.setExtractor("border-bottom",S_("bottom"));t.setExtractor("border-left",S_("left"));t.setExtractor("border-top-color","border.color.top");t.setExtractor("border-right-color","border.color.right");t.setExtractor("border-bottom-color","border.color.bottom");t.setExtractor("border-left-color","border.color.left");t.setExtractor("border-top-width","border.width.top");t.setExtractor("border-right-width","border.width.right");t.setExtractor("border-bottom-width","border.width.bottom");t.setExtractor("border-left-width","border.width.left");t.setExtractor("border-top-style","border.style.top");t.setExtractor("border-right-style","border.style.right");t.setExtractor("border-bottom-style","border.style.bottom");t.setExtractor("border-left-style","border.style.left");t.setReducer("border-color",p_("border-color"));t.setReducer("border-style",p_("border-style"));t.setReducer("border-width",p_("border-width"));t.setReducer("border-top",B_("top"));t.setReducer("border-right",B_("right"));t.setReducer("border-bottom",B_("bottom"));t.setReducer("border-left",B_("left"));t.setReducer("border",M_());t.setStyleRelation("border",["border-color","border-style","border-width","border-top","border-right","border-bottom","border-left","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-width","border-right-width","border-bottom-width","border-left-width"]);t.setStyleRelation("border-color",["border-top-color","border-right-color","border-bottom-color","border-left-color"]);t.setStyleRelation("border-style",["border-top-style","border-right-style","border-bottom-style","border-left-style"]);t.setStyleRelation("border-width",["border-top-width","border-right-width","border-bottom-width","border-left-width"]);t.setStyleRelation("border-top",["border-top-color","border-top-style","border-top-width"]);t.setStyleRelation("border-right",["border-right-color","border-right-style","border-right-width"]);t.setStyleRelation("border-bottom",["border-bottom-color","border-bottom-style","border-bottom-width"]);t.setStyleRelation("border-left",["border-left-color","border-left-style","border-left-width"])}function __(t){const{color:e,style:n,width:i}=I_(t);return{path:"border",value:{color:m_(e),style:m_(n),width:m_(i)}}}function y_(t){return e=>{const{color:n,style:i,width:o}=I_(e);const r={};if(n!==undefined){r.color={[t]:n}}if(i!==undefined){r.style={[t]:i}}if(o!==undefined){r.width={[t]:o}}return{path:"border",value:r}}}function x_(t){return e=>({path:"border",value:E_(e,t)})}function E_(t,e){return{[e]:m_(t)}}function D_(t,e){return n=>({path:"border",value:{[t]:{[e]:n}}})}function S_(t){return(e,n)=>{if(n.border){return T_(n.border,t)}}}function T_(t,e){const n={};if(t.width&&t.width[e]){n.width=t.width[e]}if(t.style&&t.style[e]){n.style=t.style[e]}if(t.color&&t.color[e]){n.color=t.color[e]}return n}function I_(t){const e={};const n=w_(t);for(const t of n){if(o_(t)||/thin|medium|thick/.test(t)){e.width=t}else if(n_(t)){e.style=t}else{e.color=t}}return e}function M_(){return e=>{const n=T_(e,"top");const i=T_(e,"right");const o=T_(e,"bottom");const r=T_(e,"left");const s=[n,i,o,r];const a={width:t(s,"width"),style:t(s,"style"),color:t(s,"color")};const c=N_(a,"all");if(c.length){return c}const l=Object.entries(a).reduce(((t,[e,n])=>{if(n){t.push([`border-${e}`,n]);s.forEach((t=>t[e]=null))}return t}),[]);return[...l,...N_(n,"top"),...N_(i,"right"),...N_(o,"bottom"),...N_(r,"left")]};function t(t,e){return t.map((t=>t[e])).reduce(((t,e)=>t==e?t:null))}}function B_(t){return e=>N_(e,t)}function N_(t,e){const n=[];if(t&&t.width){n.push("width")}if(t&&t.style){n.push("style")}if(t&&t.color){n.push("color")}if(n.length==3){const i=n.map((e=>t[e])).join(" ");return[e=="all"?["border",i]:[`border-${e}`,i]]}if(e=="all"){return[]}return n.map((n=>[`border-${e}-${n}`,t[n]]))}function z_(t){t.setNormalizer("margin",b_("margin"));t.setNormalizer("margin-top",(t=>({path:"margin.top",value:t})));t.setNormalizer("margin-right",(t=>({path:"margin.right",value:t})));t.setNormalizer("margin-bottom",(t=>({path:"margin.bottom",value:t})));t.setNormalizer("margin-left",(t=>({path:"margin.left",value:t})));t.setReducer("margin",p_("margin"));t.setStyleRelation("margin",["margin-top","margin-right","margin-bottom","margin-left"])}function P_(t){t.setNormalizer("padding",b_("padding"));t.setNormalizer("padding-top",(t=>({path:"padding.top",value:t})));t.setNormalizer("padding-right",(t=>({path:"padding.right",value:t})));t.setNormalizer("padding-bottom",(t=>({path:"padding.bottom",value:t})));t.setNormalizer("padding-left",(t=>({path:"padding.left",value:t})));t.setReducer("padding",p_("padding"));t.setStyleRelation("padding",["padding-top","padding-right","padding-bottom","padding-left"])}class L_ extends Jk{constructor(t,e){super(t);this.view=e;this._toolbarConfig=CA(t.config.get("toolbar"));this._elementReplacer=new ff}get element(){return this.view.element}init(t){const e=this.editor;const n=this.view;const i=e.editing.view;const o=n.editable;const r=i.document.getRoot();o.name=r.rootName;n.render();const s=o.element;this.setEditableElement(o.name,s);this.focusTracker.add(s);n.editable.bind("isFocused").to(this.focusTracker);i.attachDomRoot(s);if(t){this._elementReplacer.replace(t,this.element)}this._initPlaceholder();this._initToolbar();this.fire("ready")}destroy(){const t=this.view;const e=this.editor.editing.view;this._elementReplacer.restore();e.detachDomRoot(t.editable.name);t.destroy();super.destroy()}_initToolbar(){const t=this.editor;const e=this.view;const n=t.editing.view;e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused");e.stickyPanel.limiterElement=e.element;e.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",(({top:t})=>t));e.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory);av({origin:n,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:e.toolbar})}_initPlaceholder(){const t=this.editor;const e=t.editing.view;const n=e.document.getRoot();const i=t.sourceElement;const o=t.config.get("placeholder")||i&&i.tagName.toLowerCase()==="textarea"&&i.getAttribute("placeholder");if(o){yv({view:e,element:n,text:o,isDirectHost:false,keepOnFocus:true})}}}var R_=n(37);var O_={injectType:"singletonStyleTag",attributes:{"data-cke":true}};O_.insert="head";O_.singleton=true;var j_=ru()(R_["a"],O_);var F_=R_["a"].locals||{};class V_ extends cC{constructor(t,e,n={}){super(t);this.stickyPanel=new sv(t);this.toolbar=new EA(t,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull});this.editable=new dC(t,e)}render(){super.render();this.stickyPanel.content.add(this.toolbar);this.top.add(this.stickyPanel);this.main.add(this.editable)}}class U_ extends Yk{constructor(t,e){super(e);if(fa(t)){this.sourceElement=t}this.model.document.createRoot();const n=!this.config.get("toolbar.shouldNotGroupWhenFull");const i=new V_(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:n});this.ui=new L_(this,i);Xk(this)}destroy(){if(this.sourceElement){this.updateSourceElement()}this.ui.destroy();return super.destroy()}static create(t,e={}){return new Promise((n=>{const i=new this(t,e);n(i.initPlugins().then((()=>i.ui.init(fa(t)?t:null))).then((()=>{if(!fa(t)&&e.initialData){throw new u["a"]("editor-create-initial-data",null)}const n=e.initialData!==undefined?e.initialData:H_(t);return i.data.init(n)})).then((()=>i.fire("ready"))).then((()=>i)))}))}}Vn(U_,eb);Vn(U_,ib);function H_(t){return fa(t)?bf(t):t}class q_{constructor(t,e=20){this.model=t;this.size=0;this.limit=e;this.isLocked=false;this._changeCallback=(t,e)=>{if(e.type!="transparent"&&e!==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(t){this.size+=t;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(t){if(!this.isLocked||t){this._batch=null;this.size=0}}}class W_ extends qn{constructor(t,e){super(t);this._buffer=new q_(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;const n=e.document;const i=t.text||"";const o=i.length;const r=t.range?e.createSelection(t.range):n.selection;const s=t.resultRange;e.enqueueChange(this._buffer.batch,(t=>{this._buffer.lock();this._batches.add(this._buffer.batch);e.deleteContent(r);if(i){e.insertContent(t.createText(i,n.selection.getAttributes()),r)}if(s){t.setSelection(s)}else if(!r.is("documentSelection")){t.setSelection(r)}this._buffer.unlock();this._buffer.input(o)}))}}function G_(t,e){const n=[];let i=0;let o;t.forEach((t=>{if(t=="equal"){r();i++}else if(t=="insert"){if(s("insert")){o.values.push(e[i])}else{r();o={type:"insert",index:i,values:[e[i]]}}i++}else{if(s("delete")){o.howMany++}else{r();o={type:"delete",index:i,howMany:1}}}}));r();return n;function r(){if(o){n.push(o);o=null}}function s(t){return o&&o.type==t}}function K_(t){if(t.length==0){return false}for(const e of t){if(e.type==="children"&&!$_(e)){return true}}return false}function $_(t){if(t.newChildren.length-t.oldChildren.length!=1){return}const e=tu(t.oldChildren,t.newChildren,Y_);const n=G_(e,t.newChildren);if(n.length>1){return}const i=n[0];if(!(!!i.values[0]&&i.values[0].is("$text"))){return}return i}function Y_(t,e){if(!!t&&t.is("$text")&&!!e&&e.is("$text")){return t.data===e.data}else{return t===e}}function Q_(t,e){const n=e.selection;const i=t.shiftKey&&t.keyCode===sd.delete;const o=!n.isCollapsed;return i&&o}function Z_(t){let e=null;const n=t.model;const i=t.editing.view;const o=t.commands.get("input");if(Yl.isAndroid){i.document.on("beforeinput",((t,e)=>r(e)),{priority:"lowest"})}else{i.document.on("keydown",((t,e)=>r(e)),{priority:"lowest"})}i.document.on("compositionstart",s,{priority:"lowest"});i.document.on("compositionend",(()=>{e=n.createSelection(n.document.selection)}),{priority:"lowest"});function r(t){if(Yl.isWindows&&Q_(t,i.document)){return}const r=n.document;const s=i.document.isComposing;const c=e&&e.isEqual(r.selection);e=null;if(!o.isEnabled){return}if(X_(t)||r.selection.isCollapsed){return}if(s&&t.keyCode===229){return}if(!s&&t.keyCode===229&&c){return}a()}function s(){const t=n.document;const e=t.selection.rangeCount===1?t.selection.getFirstRange().isFlat:true;if(t.selection.isCollapsed||e){return}a()}function a(){const t=o.buffer;t.lock();const e=t.batch;o._batches.add(e);n.enqueueChange(e,(()=>{n.deleteContent(n.document.selection)}));t.unlock()}}const J_=[cd("arrowUp"),cd("arrowRight"),cd("arrowDown"),cd("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++){J_.push(t)}function X_(t){if(t.ctrlKey||t.metaKey){return true}return J_.includes(t.keyCode)}function ty(t){t.editing.view.document.on("mutations",((e,n,i)=>{new ey(t).handle(n,i)}))}class ey{constructor(t){this.editor=t;this.editing=this.editor.editing}handle(t,e){if(K_(t)){this._handleContainerChildrenMutations(t,e)}else{for(const n of t){this._handleTextMutation(n,e);this._handleTextNodeInsertion(n)}}}_handleContainerChildrenMutations(t,e){const n=ny(t);if(!n){return}const i=this.editor.editing.view.domConverter;const o=i.mapViewToDom(n);const r=new Eu(this.editor.editing.view.document);const s=this.editor.data.toModel(r.domToView(o)).getChild(0);const a=this.editor.editing.mapper.toModelElement(n);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 g=this.editor.model.schema;if(!iy(c,g)||!iy(l,g)){return}const m=c.map((t=>t.is("$text")?t.data:"@")).join("").replace(/\u00A0/g," ");const p=l.map((t=>t.is("$text")?t.data:"@")).join("").replace(/\u00A0/g," ");if(p===m){return}const k=tu(p,m);const{firstChangeAt:b,insertions:w,deletions:A}=oy(k);let C=null;if(e){C=this.editing.mapper.toModelRange(e.getFirstRange())}const v=m.substr(b,w);const _=this.editor.model.createRange(this.editor.model.createPositionAt(a,b),this.editor.model.createPositionAt(a,b+A));this.editor.execute("input",{text:v,range:_,resultRange:C})}_handleTextMutation(t,e){if(t.type!="text"){return}const n=t.newText.replace(/\u00A0/g," ");const i=t.oldText.replace(/\u00A0/g," ");if(i===n){return}const o=tu(i,n);const{firstChangeAt:r,insertions:s,deletions:a}=oy(o);let c=null;if(e){c=this.editing.mapper.toModelRange(e.getFirstRange())}const l=this.editing.view.createPositionAt(t.node,r);const d=this.editing.mapper.toModelPosition(l);const u=this.editor.model.createRange(d,d.getShiftedBy(a));const h=n.substr(r,s);this.editor.execute("input",{text:h,range:u,resultRange:c})}_handleTextNodeInsertion(t){if(t.type!="children"){return}const e=$_(t);const n=this.editing.view.createPositionAt(t.node,e.index);const i=this.editing.mapper.toModelPosition(n);const o=e.values[0].data;this.editor.execute("input",{text:o.replace(/\u00A0/g," "),range:this.editor.model.createRange(i)})}}function ny(t){const e=t.map((t=>t.node)).reduce(((t,e)=>t.getCommonAncestor(e,{includeSelf:true})));if(!e){return}return e.getAncestors({includeSelf:true,parentFirst:true}).find((t=>t.is("containerElement")||t.is("rootElement")))}function iy(t,e){return t.every((t=>e.isInline(t)))}function oy(t){let e=null;let n=null;for(let i=0;i{this._buffer.lock();const o=i.createSelection(t.selection||n.selection);const r=t.sequence||1;const s=o.isCollapsed;if(o.isCollapsed){e.modifySelection(o,{direction:this.direction,unit:t.unit})}if(this._shouldEntireContentBeReplacedWithParagraph(r)){this._replaceEntireContentWithParagraph(i);return}if(this._shouldReplaceFirstBlockWithParagraph(o,r)){this.editor.execute("paragraph",{selection:o});return}if(o.isCollapsed){return}let a=0;o.getFirstRange().getMinimalFlatRanges().forEach((t=>{a+=Sl(t.getWalker({singleCharacters:true,ignoreElementEnd:true,shallow:true}))}));e.deleteContent(o,{doNotResetEntireContent:s,direction:this.direction});this._buffer.input(a);i.setSelection(o);this._buffer.unlock()}))}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1){return false}const e=this.editor.model;const n=e.document;const i=n.selection;const o=e.schema.getLimitElement(i);const r=i.isCollapsed&&i.containsEntireContent(o);if(!r){return false}if(!e.schema.checkChild(o,"paragraph")){return false}const s=o.getChild(0);if(s&&s.name==="paragraph"){return false}return true}_replaceEntireContentWithParagraph(t){const e=this.editor.model;const n=e.document;const i=n.selection;const o=e.schema.getLimitElement(i);const r=t.createElement("paragraph");t.remove(t.createRangeIn(o));t.insert(r,o);t.setSelection(r,0)}_shouldReplaceFirstBlockWithParagraph(t,e){const n=this.editor.model;if(e>1||this.direction!="backward"){return false}if(!t.isCollapsed){return false}const i=t.getFirstPosition();const o=n.schema.getLimitElement(i);const r=o.getChild(0);if(i.parent!=r){return false}if(!t.containsEntireContent(r)){return false}if(!n.schema.checkChild(o,"paragraph")){return false}if(r.name=="paragraph"){return false}return true}}class ay extends Ru{constructor(t){super(t);const e=t.document;let n=0;e.on("keyup",((t,e)=>{if(e.keyCode==sd.delete||e.keyCode==sd.backspace){n=0}}));e.on("keydown",((t,o)=>{if(Yl.isWindows&&Q_(o,e)){return}const r={};if(o.keyCode==sd.delete){r.direction="forward";r.unit="character"}else if(o.keyCode==sd.backspace){r.direction="backward";r.unit="codePoint"}else{return}const s=Yl.isMac?o.altKey:o.ctrlKey;r.unit=s?"word":r.unit;r.sequence=++n;i(t,o.domEvent,r)}));if(Yl.isAndroid){e.on("beforeinput",((e,n)=>{if(n.domEvent.inputType!="deleteContentBackward"){return}const o={unit:"codepoint",direction:"backward",sequence:1};const r=n.domTarget.ownerDocument.defaultView.getSelection();if(r.anchorNode==r.focusNode&&r.anchorOffset+1!=r.focusOffset){o.selectionToRemove=t.domConverter.domSelectionToView(r)}i(e,n.domEvent,o)}))}function i(t,n,i){const o=new Ml(e,"delete",e.selection.getFirstRange());e.fire(o,new Oh(e,n,i));if(o.stop.called){t.stop()}}}observe(){}}class cy extends Un{static get pluginName(){return"Delete"}init(){const t=this.editor;const e=t.editing.view;const n=e.document;const i=t.model.document;e.addObserver(ay);this._undoOnBackspace=false;const o=new sy(t,"forward");t.commands.add("deleteForward",o);t.commands.add("forwardDelete",o);t.commands.add("delete",new sy(t,"backward"));this.listenTo(n,"delete",((n,i)=>{const o={unit:i.unit,sequence:i.sequence};if(i.selectionToRemove){const e=t.model.createSelection();const n=[];for(const e of i.selectionToRemove.getRanges()){n.push(t.editing.mapper.toModelRange(e))}e.setTo(n);o.selection=e}t.execute(i.direction=="forward"?"deleteForward":"delete",o);i.preventDefault();e.scrollToTheSelection()}),{priority:"low"});if(Yl.isAndroid){let t=null;this.listenTo(n,"delete",((e,n)=>{const i=n.domTarget.ownerDocument.defaultView.getSelection();t={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}}),{priority:"lowest"});this.listenTo(n,"keyup",((e,n)=>{if(t){const e=n.domTarget.ownerDocument.defaultView.getSelection();e.collapse(t.anchorNode,t.anchorOffset);e.extend(t.focusNode,t.focusOffset);t=null}}))}if(this.editor.plugins.has("UndoEditing")){this.listenTo(n,"delete",((e,n)=>{if(this._undoOnBackspace&&n.direction=="backward"&&n.sequence==1&&n.unit=="codePoint"){this._undoOnBackspace=false;t.execute("undo");n.preventDefault();e.stop()}}),{context:"$capture"});this.listenTo(i,"change",(()=>{this._undoOnBackspace=false}))}}requestUndoOnBackspace(){if(this.editor.plugins.has("UndoEditing")){this._undoOnBackspace=true}}}class ly extends Un{static get requires(){return[ry,cy]}static get pluginName(){return"Typing"}}function dy(t,e){let n=t.start;const i=Array.from(t.getItems()).reduce(((t,i)=>{if(!(i.is("$text")||i.is("$textProxy"))){n=e.createPositionAfter(i);return""}return t+i.data}),"");return{text:i,range:e.createRange(n,t.end)}}class uy{constructor(t,e){this.model=t;this.testCallback=e;this.hasMatch=false;this.set("isEnabled",true);this.on("change:isEnabled",(()=>{if(this.isEnabled){this._startListening()}else{this.stopListening(t.document.selection);this.stopListening(t.document)}}));this._startListening()}_startListening(){const t=this.model;const e=t.document;this.listenTo(e.selection,"change:range",((t,{directChange:n})=>{if(!n){return}if(!e.selection.isCollapsed){if(this.hasMatch){this.fire("unmatched");this.hasMatch=false}return}this._evaluateTextBeforeSelection("selection")}));this.listenTo(e,"change:data",((t,e)=>{if(e.type=="transparent"){return}this._evaluateTextBeforeSelection("data",{batch:e})}))}_evaluateTextBeforeSelection(t,e={}){const n=this.model;const i=n.document;const o=i.selection;const r=n.createRange(n.createPositionAt(o.focus.parent,0),o.focus);const{text:s,range:a}=dy(r,n);const c=this.testCallback(s);if(!c&&this.hasMatch){this.fire("unmatched")}this.hasMatch=!!c;if(c){const n=Object.assign(e,{text:s,range:a});if(typeof c=="object"){Object.assign(n,c)}this.fire(`matched:${t}`,n)}}}Vn(uy,In);class hy extends Un{static get pluginName(){return"TwoStepCaretMovement"}constructor(t){super(t);this.attributes=new Set;this._overrideUid=null}init(){const t=this.editor;const e=t.model;const n=t.editing.view;const i=t.locale;const o=e.document.selection;this.listenTo(n.document,"arrowKey",((t,e)=>{if(!o.isCollapsed){return}if(e.shiftKey||e.altKey||e.ctrlKey){return}const n=e.keyCode==sd.arrowright;const r=e.keyCode==sd.arrowleft;if(!n&&!r){return}const s=i.contentLanguageDirection;let a=false;if(s==="ltr"&&n||s==="rtl"&&r){a=this._handleForwardMovement(e)}else{a=this._handleBackwardMovement(e)}if(a===true){t.stop()}}),{context:"$text",priority:"highest"});this._isNextGravityRestorationSkipped=false;this.listenTo(o,"change:range",((t,e)=>{if(this._isNextGravityRestorationSkipped){this._isNextGravityRestorationSkipped=false;return}if(!this._isGravityOverridden){return}if(!e.directChange&&ky(o.getFirstPosition(),this.attributes)){return}this._restoreGravity()}))}registerAttribute(t){this.attributes.add(t)}_handleForwardMovement(t){const e=this.attributes;const n=this.editor.model;const i=n.document.selection;const o=i.getFirstPosition();if(this._isGravityOverridden){return false}if(o.isAtStart&&fy(i,e)){return false}if(ky(o,e)){my(t);this._overrideGravity();return true}}_handleBackwardMovement(t){const e=this.attributes;const n=this.editor.model;const i=n.document.selection;const o=i.getFirstPosition();if(this._isGravityOverridden){my(t);this._restoreGravity();gy(n,e,o);return true}else{if(o.isAtStart){if(fy(i,e)){my(t);gy(n,e,o);return true}return false}if(py(o,e)){if(o.isAtEnd&&!fy(i,e)&&ky(o,e)){my(t);gy(n,e,o);return true}this._isNextGravityRestorationSkipped=true;this._overrideGravity();return false}}}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 fy(t,e){for(const n of e){if(t.hasAttribute(n)){return true}}return false}function gy(t,e,n){const i=n.nodeBefore;t.change((t=>{if(i){t.setSelectionAttribute(i.getAttributes())}else{t.removeSelectionAttribute(e)}}))}function my(t){t.preventDefault()}function py(t,e){const n=t.getShiftedBy(-1);return ky(n,e)}function ky(t,e){const{nodeBefore:n,nodeAfter:i}=t;for(const t of e){const e=n?n.getAttribute(t):undefined;const o=i?i.getAttribute(t):undefined;if(o!==e){return true}}return false}var by=/[\\^$.*+?()[\]{}|]/g,wy=RegExp(by.source);function Ay(t){t=vc(t);return t&&wy.test(t)?t.replace(by,"\\$&"):t}var Cy=Ay;const vy={copyright:{from:"(c)",to:"漏"},registeredTrademark:{from:"(r)",to:"庐"},trademark:{from:"(tm)",to:"鈩"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"陆",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"鈪",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"鈪",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"录",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"戮",null]},lessThanOrEqual:{from:"<=",to:"鈮"},greaterThanOrEqual:{from:">=",to:"鈮"},notEqual:{from:"!=",to:"鈮"},arrowLeft:{from:"<-",to:"鈫"},arrowRight:{from:"->",to:"鈫"},horizontalEllipsis:{from:"...",to:"鈥"},enDash:{from:/(^| )(--)( )$/,to:[null,"鈥",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"鈥",null]},quotesPrimary:{from:Ty('"'),to:[null,"鈥",null,"鈥"]},quotesSecondary:{from:Ty("'"),to:[null,"鈥",null,"鈥"]},quotesPrimaryEnGb:{from:Ty("'"),to:[null,"鈥",null,"鈥"]},quotesSecondaryEnGb:{from:Ty('"'),to:[null,"鈥",null,"鈥"]},quotesPrimaryPl:{from:Ty('"'),to:[null,"鈥",null,"鈥"]},quotesSecondaryPl:{from:Ty("'"),to:[null,"鈥",null,"鈥"]}};const _y={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]};const yy=["symbols","mathematical","typography","quotes"];class xy extends Un{static get requires(){return["Delete","Input"]}static get pluginName(){return"TextTransformation"}constructor(t){super(t);t.config.define("typing",{transformations:{include:yy}})}init(){const t=this.editor.model;const e=t.document.selection;e.on("change:range",(()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}));this._enableTransformationWatchers()}_enableTransformationWatchers(){const t=this.editor;const e=t.model;const n=t.plugins.get("Input");const i=t.plugins.get("Delete");const o=Iy(t.config.get("typing.transformations"));const r=t=>{for(const e of o){const n=e.from;const i=n.test(t);if(i){return{normalizedTransformation:e}}}};const s=(t,o)=>{if(!n.isInput(o.batch)){return}const{from:r,to:s}=o.normalizedTransformation;const a=r.exec(o.text);const c=s(a.slice(1));const l=o.range;let d=a.index;e.enqueueChange((t=>{for(let n=1;n{i.requestUndoOnBackspace()}))}))};const a=new uy(t.model,r);a.on("matched:data",s);a.bind("isEnabled").to(this)}}function Ey(t){if(typeof t=="string"){return new RegExp(`(${Cy(t)})$`)}return t}function Dy(t){if(typeof t=="string"){return()=>[t]}else if(t instanceof Array){return()=>t}return t}function Sy(t){const e=t.textNode?t.textNode:t.nodeAfter;return e.getAttributes()}function Ty(t){return new RegExp(`(^|\\s)(${t})([^${t}]*)(${t})$`)}function Iy(t){const e=t.extra||[];const n=t.remove||[];const i=t=>!n.includes(t);const o=t.include.concat(e).filter(i);return My(o).filter(i).map((t=>vy[t]||t)).map((t=>({from:Ey(t.from),to:Dy(t.to)})))}function My(t){const e=new Set;for(const n of t){if(_y[n]){for(const t of _y[n]){e.add(t)}}else{e.add(n)}}return Array.from(e)}function By(t,e,n,i){return i.createRange(Ny(t,e,n,true,i),Ny(t,e,n,false,i))}function Ny(t,e,n,i,o){let r=t.textNode||(i?t.nodeBefore:t.nodeAfter);let s=null;while(r&&r.getAttribute(e)==n){s=r;r=i?r.previousSibling:r.nextSibling}return s?o.createPositionAt(s,i?"before":"after"):t}function zy(t,e,n,i){const o=t.editing.view;const r=new Set;o.document.registerPostFixer((o=>{const s=t.model.document.selection;let a=false;if(s.hasAttribute(e)){const c=By(s.getFirstPosition(),e,s.getAttribute(e),t.model);const l=t.editing.mapper.toViewRange(c);for(const t of l.getItems()){if(t.is("element",n)&&!t.hasClass(i)){o.addClass(i,t);r.add(t);a=true}}}return a}));t.conversion.for("editingDowncast").add((t=>{t.on("insert",e,{priority:"highest"});t.on("remove",e,{priority:"highest"});t.on("attribute",e,{priority:"highest"});t.on("selection",e,{priority:"highest"});function e(){o.change((t=>{for(const e of r.values()){t.removeClass(i,e);r.delete(e)}}))}}))}function Py(t,e,n,i){let o;let r=null;if(typeof i=="function"){o=i}else{r=t.commands.get(i);o=()=>{t.execute(i)}}t.model.document.on("change:data",((s,a)=>{if(r&&!r.isEnabled||!e.isEnabled){return}const c=If(t.model.document.selection.getRanges());if(!c.isCollapsed){return}if(a.type=="transparent"){return}const l=Array.from(t.model.document.differ.getChanges());const d=l[0];if(l.length!=1||d.type!=="insert"||d.name!="$text"||d.length!=1){return}const u=d.position.parent;if(u.is("element","codeBlock")){return}if(u.is("element","listItem")&&typeof i!=="function"&&!["numberedList","bulletedList","todoList"].includes(i)){return}if(r&&r.value===true){return}const h=u.getChild(0);const f=t.model.createRangeOn(h);if(!f.containsRange(c)&&!c.end.isEqual(f.end)){return}const g=n.exec(h.data.substr(0,c.end.offset));if(!g){return}t.model.enqueueChange((e=>{const n=e.createPositionAt(u,0);const i=e.createPositionAt(u,g[0].length);const r=new Ag(n,i);const s=o({match:g});if(s!==false){e.remove(r);const n=t.model.document.selection.getFirstRange();const i=e.createRangeIn(u);if(u.isEmpty&&!i.isEqual(n)&&!i.containsRange(n,true)){e.remove(u)}}r.detach();t.model.enqueueChange((()=>{t.plugins.get("Delete").requestUndoOnBackspace()}))}))}))}function Ly(t,e,n,i){let o;let r;if(n instanceof RegExp){o=n}else{r=n}r=r||(t=>{let e;const n=[];const i=[];while((e=o.exec(t))!==null){if(e&&e.length<4){break}let{index:t,1:o,2:r,3:s}=e;const a=o+r+s;t+=e[0].length-a.length;const c=[t,t+o.length];const l=[t+o.length+r.length,t+o.length+r.length+s.length];n.push(c);n.push(l);i.push([t+o.length,t+o.length+r.length])}return{remove:n,format:i}});t.model.document.on("change:data",((n,o)=>{if(o.type=="transparent"||!e.isEnabled){return}const s=t.model;const a=s.document.selection;if(!a.isCollapsed){return}const c=Array.from(s.document.differ.getChanges());const l=c[0];if(c.length!=1||l.type!=="insert"||l.name!="$text"||l.length!=1){return}const d=a.focus;const u=d.parent;const{text:h,range:f}=Oy(s.createRange(s.createPositionAt(u,0),d),s);const g=r(h);const m=Ry(f.start,g.format,s);const p=Ry(f.start,g.remove,s);if(!(m.length&&p.length)){return}s.enqueueChange((e=>{const n=i(e,m);if(n===false){return}for(const t of p.reverse()){e.remove(t)}s.enqueueChange((()=>{t.plugins.get("Delete").requestUndoOnBackspace()}))}))}))}function Ry(t,e,n){return e.filter((t=>t[0]!==undefined&&t[1]!==undefined)).map((e=>n.createRange(t.getShiftedBy(e[0]),t.getShiftedBy(e[1]))))}function Oy(t,e){let n=t.start;const i=Array.from(t.getItems()).reduce(((t,i)=>{if(!(i.is("$text")||i.is("$textProxy"))||i.getAttribute("code")){n=e.createPositionAfter(i);return""}return t+i.data}),"");return{text:i,range:e.createRange(n,t.end)}}class jy extends Un{static get requires(){return[cy]}static get pluginName(){return"Autoformat"}afterInit(){this._addListAutoformats();this._addBasicStylesAutoformats();this._addHeadingAutoformats();this._addBlockQuoteAutoformats();this._addCodeBlockAutoformats();this._addHorizontalLineAutoformats()}_addListAutoformats(){const t=this.editor.commands;if(t.get("bulletedList")){Py(this.editor,this,/^[*-]\s$/,"bulletedList")}if(t.get("numberedList")){Py(this.editor,this,/^1[.|)]\s$/,"numberedList")}if(t.get("todoList")){Py(this.editor,this,/^\[\s?\]\s$/,"todoList")}if(t.get("checkTodoList")){Py(this.editor,this,/^\[\s?x\s?\]\s$/,(()=>{this.editor.execute("todoList");this.editor.execute("checkTodoList")}))}}_addBasicStylesAutoformats(){const t=this.editor.commands;if(t.get("bold")){const t=Fy(this.editor,"bold");Ly(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,t);Ly(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,t)}if(t.get("italic")){const t=Fy(this.editor,"italic");Ly(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,t);Ly(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,t)}if(t.get("code")){const t=Fy(this.editor,"code");Ly(this.editor,this,/(`)([^`]+)(`)$/g,t)}if(t.get("strikethrough")){const t=Fy(this.editor,"strikethrough");Ly(this.editor,this,/(~~)([^~]+)(~~)$/g,t)}}_addHeadingAutoformats(){const t=this.editor.commands.get("heading");if(t){t.modelElements.filter((t=>t.match(/^heading[1-6]$/))).forEach((e=>{const n=e[7];const i=new RegExp(`^(#{${n}})\\s$`);Py(this.editor,this,i,(()=>{if(!t.isEnabled||t.value===e){return false}this.editor.execute("heading",{value:e})}))}))}}_addBlockQuoteAutoformats(){if(this.editor.commands.get("blockQuote")){Py(this.editor,this,/^>\s$/,"blockQuote")}}_addCodeBlockAutoformats(){const t=this.editor;const e=t.model.document.selection;if(t.commands.get("codeBlock")){Py(t,this,/^```$/,(()=>{if(e.getFirstPosition().parent.is("element","listItem")){return false}this.editor.execute("codeBlock",{usePreviousLanguageChoice:true})}))}}_addHorizontalLineAutoformats(){if(this.editor.commands.get("horizontalLine")){Py(this.editor,this,/^---$/,"horizontalLine")}}}function Fy(t,e){return(n,i)=>{const o=t.commands.get(e);if(!o.isEnabled){return false}const r=t.model.schema.getValidRanges(i,e);for(const t of r){n.setAttribute(e,true,t)}n.removeSelectionAttribute(e)}}function Vy(t,e,n){var i=t.length;n=n===undefined?i:n;return!e&&n>=i?t:Nc(t,e,n)}var Uy=Vy;var Hy="\\ud800-\\udfff",qy="\\u0300-\\u036f",Wy="\\ufe20-\\ufe2f",Gy="\\u20d0-\\u20ff",Ky=qy+Wy+Gy,$y="\\ufe0e\\ufe0f";var Yy="\\u200d";var Qy=RegExp("["+Yy+Hy+Ky+$y+"]");function Zy(t){return Qy.test(t)}var Jy=Zy;function Xy(t){return t.split("")}var tx=Xy;var ex="\\ud800-\\udfff",nx="\\u0300-\\u036f",ix="\\ufe20-\\ufe2f",ox="\\u20d0-\\u20ff",rx=nx+ix+ox,sx="\\ufe0e\\ufe0f";var ax="["+ex+"]",cx="["+rx+"]",lx="\\ud83c[\\udffb-\\udfff]",dx="(?:"+cx+"|"+lx+")",ux="[^"+ex+"]",hx="(?:\\ud83c[\\udde6-\\uddff]){2}",fx="[\\ud800-\\udbff][\\udc00-\\udfff]",gx="\\u200d";var mx=dx+"?",px="["+sx+"]?",kx="(?:"+gx+"(?:"+[ux,hx,fx].join("|")+")"+px+mx+")*",bx=px+mx+kx,wx="(?:"+[ux+cx+"?",cx,hx,fx,ax].join("|")+")";var Ax=RegExp(lx+"(?="+lx+")|"+wx+bx,"g");function Cx(t){return t.match(Ax)||[]}var vx=Cx;function _x(t){return Jy(t)?vx(t):tx(t)}var yx=_x;function xx(t){return function(e){e=vc(e);var n=Jy(e)?yx(e):undefined;var i=n?n[0]:e.charAt(0);var o=n?Uy(n,1).join(""):e.slice(1);return i[t]()+o}}var Ex=xx;var Dx=Ex("toUpperCase");var Sx=Dx;const Tx=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;const Ix=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;const Mx=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i;const Bx=/^((\w+:(\/{2,})?)|(\W))/i;const Nx="Ctrl+K";function zx(t){return t.is("attributeElement")&&!!t.getCustomProperty("link")}function Px(t,{writer:e}){const n=e.createAttributeElement("a",{href:t},{priority:5});e.setCustomProperty("link",true,n);return n}function Lx(t){t=String(t);return Rx(t)?t:"#"}function Rx(t){const e=t.replace(Tx,"");return e.match(Ix)}function Ox(t,e){const n={"Open in a new tab":t("Open in a new tab"),Downloadable:t("Downloadable")};e.forEach((t=>{if(t.label&&n[t.label]){t.label=n[t.label]}return t}));return e}function jx(t){const e=[];if(t){for(const[n,i]of Object.entries(t)){const t=Object.assign({},i,{id:`link${Sx(n)}`});e.push(t)}}return e}function Fx(t,e){if(!t){return false}return e.checkAttribute(t.name,"linkHref")}function Vx(t){return Mx.test(t)}function Ux(t,e){const n=Vx(t)?"mailto:":e;const i=!!n&&!Bx.test(t);return t&&i?n+t:t}function Hx(t){window.open(t,"_blank","noopener")}const qx=4;const Wx=new RegExp("(^|\\s)"+"("+"("+"(?:(?:(?:https?|ftp):)?\\/\\/)"+"(?:\\S+(?::\\S*)?@)?"+"(?:"+"(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])"+"(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}"+"(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))"+"|"+"("+"((?!www\\.)|(www\\.))"+"(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+"+"(?:[a-z\\u00a1-\\uffff]{2,63})"+")"+")"+"(?::\\d{2,5})?"+"(?:[/?#]\\S*)?"+")"+"|"+"("+"(www.|(\\S+@))"+"((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+"+"(?:[a-z\\u00a1-\\uffff]{2,63})"+")"+")$","i");const Gx=2;class Kx extends Un{static get requires(){return[cy]}static get pluginName(){return"AutoLink"}init(){const t=this.editor;const e=t.model.document.selection;e.on("change:range",(()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}));this._enableTypingHandling()}afterInit(){this._enableEnterHandling();this._enableShiftEnterHandling()}_enableTypingHandling(){const t=this.editor;const e=new uy(t.model,(t=>{if(!$x(t)){return}const e=Yx(t.substr(0,t.length-1));if(e){return{url:e}}}));const n=t.plugins.get("Input");e.on("matched:data",((e,i)=>{const{batch:o,range:r,url:s}=i;if(!n.isInput(o)){return}const a=r.end.getShiftedBy(-1);const c=a.getShiftedBy(-s.length);const l=t.model.createRange(c,a);this._applyAutoLink(s,l)}));e.bind("isEnabled").to(this)}_enableEnterHandling(){const t=this.editor;const e=t.model;const n=t.commands.get("enter");if(!n){return}n.on("execute",(()=>{const t=e.document.selection.getFirstPosition();if(!t.parent.previousSibling){return}const n=e.createRangeIn(t.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(n)}))}_enableShiftEnterHandling(){const t=this.editor;const e=t.model;const n=t.commands.get("shiftEnter");if(!n){return}n.on("execute",(()=>{const t=e.document.selection.getFirstPosition();const n=e.createRange(e.createPositionAt(t.parent,0),t.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(n)}))}_checkAndApplyAutoLinkOnRange(t){const e=this.editor.model;const{text:n,range:i}=dy(t,e);const o=Yx(n);if(o){const t=e.createRange(i.end.getShiftedBy(-o.length),i.end);this._applyAutoLink(o,t)}}_applyAutoLink(t,e){const n=this.editor.model;const i=this.editor.plugins.get("Delete");if(!this.isEnabled||!Qx(e,n)){return}n.enqueueChange((o=>{const r=this.editor.config.get("link.defaultProtocol");const s=Ux(t,r);o.setAttribute("linkHref",s,e);n.enqueueChange((()=>{i.requestUndoOnBackspace()}))}))}}function $x(t){return t.length>qx&&t[t.length-1]===" "&&t[t.length-2]!==" "}function Yx(t){const e=Wx.exec(t);return e?e[Gx]:null}function Qx(t,e){return e.schema.checkAttributeInSelection(e.createSelection(t),"linkHref")}function*Zx(t,e){for(const n of e){if(n&&t.getAttributeProperties(n[0]).copyOnEnter){yield n}}}class Jx extends qn{execute(){const t=this.editor.model;const e=t.document;t.change((n=>{Xx(this.editor.model,n,e.selection,t.schema);this.fire("afterExecute",{writer:n})}))}}function Xx(t,e,n,i){const o=n.isCollapsed;const r=n.getFirstRange();const s=r.start.parent;const a=r.end.parent;if(i.isLimit(s)||i.isLimit(a)){if(!o&&s==a){t.deleteContent(n)}return}if(o){const t=Zx(e.model.schema,n.getAttributes());tE(e,r.start);e.setSelectionAttribute(t)}else{const i=!(r.start.isAtStart&&r.end.isAtEnd);const o=s==a;t.deleteContent(n,{leaveUnmerged:i});if(i){if(o){tE(e,n.focus)}else{e.setSelection(a,0)}}}}function tE(t,e){t.split(e);t.setSelection(e.parent.nextSibling,0)}class eE extends Ru{constructor(t){super(t);const e=this.document;e.on("keydown",((t,n)=>{if(this.isEnabled&&n.keyCode==sd.enter){const i=new Ml(e,"enter",e.selection.getFirstRange());e.fire(i,new Oh(e,n.domEvent,{isSoft:n.shiftKey}));if(i.stop.called){t.stop()}}}))}observe(){}}class nE extends Un{static get pluginName(){return"Enter"}init(){const t=this.editor;const e=t.editing.view;const n=e.document;e.addObserver(eE);t.commands.add("enter",new Jx(t));this.listenTo(n,"enter",((n,i)=>{i.preventDefault();if(i.isSoft){return}t.execute("enter");e.scrollToTheSelection()}),{priority:"low"})}}class iE extends qn{execute(){const t=this.editor.model;const e=t.document;t.change((n=>{rE(t,n,e.selection);this.fire("afterExecute",{writer:n})}))}refresh(){const t=this.editor.model;const e=t.document;this.isEnabled=oE(t.schema,e.selection)}}function oE(t,e){if(e.rangeCount>1){return false}const n=e.anchor;if(!n||!t.checkChild(n,"softBreak")){return false}const i=e.getFirstRange();const o=i.start.parent;const r=i.end.parent;if((aE(o,t)||aE(r,t))&&o!==r){return false}return true}function rE(t,e,n){const i=n.isCollapsed;const o=n.getFirstRange();const r=o.start.parent;const s=o.end.parent;const a=r==s;if(i){const i=Zx(t.schema,n.getAttributes());sE(t,e,o.end);e.removeSelectionAttribute(n.getAttributeKeys());e.setSelectionAttribute(i)}else{const i=!(o.start.isAtStart&&o.end.isAtEnd);t.deleteContent(n,{leaveUnmerged:i});if(a){sE(t,e,n.focus)}else{if(i){e.setSelection(s,0)}}}}function sE(t,e,n){const i=e.createElement("softBreak");t.insertContent(i,n);e.setSelection(i,"after")}function aE(t,e){if(t.is("rootElement")){return false}return e.isLimit(t)||aE(t.parent,e)}class cE extends Un{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor;const e=t.model.schema;const n=t.conversion;const i=t.editing.view;const o=i.document;e.register("softBreak",{allowWhere:"$text",isInline:true});n.for("upcast").elementToElement({model:"softBreak",view:"br"});n.for("downcast").elementToElement({model:"softBreak",view:(t,{writer:e})=>e.createEmptyElement("br")});i.addObserver(eE);t.commands.add("shiftEnter",new iE(t));this.listenTo(o,"enter",((e,n)=>{n.preventDefault();if(!n.isSoft){return}t.execute("shiftEnter");i.scrollToTheSelection()}),{priority:"low"})}}class lE extends qn{refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model;const n=e.schema;const i=e.document.selection;const o=Array.from(i.getSelectedBlocks());const r=t.forceValue===undefined?!this.value:t.forceValue;e.change((t=>{if(!r){this._removeQuote(t,o.filter(dE))}else{const e=o.filter((t=>dE(t)||hE(n,t)));this._applyQuote(t,e)}}))}_getValue(){const t=this.editor.model.document.selection;const e=If(t.getSelectedBlocks());return!!(e&&dE(e))}_checkEnabled(){if(this.value){return true}const t=this.editor.model.document.selection;const e=this.editor.model.schema;const n=If(t.getSelectedBlocks());if(!n){return false}return hE(e,n)}_removeQuote(t,e){uE(t,e).reverse().forEach((e=>{if(e.start.isAtStart&&e.end.isAtEnd){t.unwrap(e.start.parent);return}if(e.start.isAtStart){const n=t.createPositionBefore(e.start.parent);t.move(e,n);return}if(!e.end.isAtEnd){t.split(e.end)}const n=t.createPositionAfter(e.end.parent);t.move(e,n)}))}_applyQuote(t,e){const n=[];uE(t,e).reverse().forEach((e=>{let i=dE(e.start);if(!i){i=t.createElement("blockQuote");t.wrap(e,i)}n.push(i)}));n.reverse().reduce(((e,n)=>{if(e.nextSibling==n){t.merge(t.createPositionAfter(e));return e}return n}))}}function dE(t){return t.parent.name=="blockQuote"?t.parent:null}function uE(t,e){let n;let i=0;const o=[];while(i{const i=t.model.document.differ.getChanges();for(const t of i){if(t.type=="insert"){const i=t.position.nodeAfter;if(!i){continue}if(i.is("element","blockQuote")&&i.isEmpty){n.remove(i);return true}else if(i.is("element","blockQuote")&&!e.checkChild(t.position,i)){n.unwrap(i);return true}else if(i.is("element")){const t=n.createRangeIn(i);for(const i of t.getItems()){if(i.is("element","blockQuote")&&!e.checkChild(n.createPositionBefore(i),i)){n.unwrap(i);return true}}}}else if(t.type=="remove"){const e=t.position.parent;if(e.is("element","blockQuote")&&e.isEmpty){n.remove(e);return true}}}return false}));const n=this.editor.editing.view.document;const i=t.model.document.selection;const o=t.commands.get("blockQuote");this.listenTo(n,"enter",((e,n)=>{if(!i.isCollapsed||!o.value){return}const r=i.getLastPosition().parent;if(r.isEmpty){t.execute("blockQuote");t.editing.view.scrollToTheSelection();n.preventDefault();e.stop()}}),{context:"blockquote"});this.listenTo(n,"delete",((e,n)=>{if(n.direction!="backward"||!i.isCollapsed||!o.value){return}const r=i.getLastPosition().parent;if(r.isEmpty&&!r.previousSibling){t.execute("blockQuote");t.editing.view.scrollToTheSelection();n.preventDefault();e.stop()}}),{context:"blockquote"})}}var gE=n(38);var mE={injectType:"singletonStyleTag",attributes:{"data-cke":true}};mE.insert="head";mE.singleton=true;var pE=ru()(gE["a"],mE);var kE=gE["a"].locals||{};class bE extends Un{static get pluginName(){return"BlockQuoteUI"}init(){const t=this.editor;const e=t.t;t.ui.componentFactory.add("blockQuote",(n=>{const i=t.commands.get("blockQuote");const o=new zw(n);o.set({label:e("Block quote"),icon:Pb.quote,tooltip:true,isToggleable:true});o.bind("isOn","isEnabled").to(i,"value","isEnabled");this.listenTo(o,"execute",(()=>{t.execute("blockQuote");t.editing.view.focus()}));return o}))}}class wE extends Un{static get requires(){return[fE,bE]}static get pluginName(){return"BlockQuote"}}class AE extends qn{constructor(t,e){super(t);this.attributeKey=e}refresh(){const t=this.editor.model;const e=t.document;this.value=this._getValueFromFirstAllowedNode();this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model;const n=e.document;const i=n.selection;const o=t.forceValue===undefined?!this.value:t.forceValue;e.change((t=>{if(i.isCollapsed){if(o){t.setSelectionAttribute(this.attributeKey,true)}else{t.removeSelectionAttribute(this.attributeKey)}}else{const n=e.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const e of n){if(o){t.setAttribute(this.attributeKey,o,e)}else{t.removeAttribute(this.attributeKey,e)}}}}))}_getValueFromFirstAllowedNode(){const t=this.editor.model;const e=t.schema;const n=t.document.selection;if(n.isCollapsed){return n.hasAttribute(this.attributeKey)}for(const t of n.getRanges()){for(const n of t.getItems()){if(e.checkAttribute(n,this.attributeKey)){return n.hasAttribute(this.attributeKey)}}}return false}}const CE="bold";class vE extends Un{static get pluginName(){return"BoldEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:CE});t.model.schema.setAttributeProperties(CE,{isFormatting:true,copyOnEnter:true});t.conversion.attributeToElement({model:CE,view:"strong",upcastAlso:["b",t=>{const e=t.getStyle("font-weight");if(!e){return null}if(e=="bold"||Number(e)>=600){return{name:true,styles:["font-weight"]}}}]});t.commands.add(CE,new AE(t,CE));t.keystrokes.set("CTRL+B",CE)}}var _E='';const yE="bold";class xE extends Un{static get pluginName(){return"BoldUI"}init(){const t=this.editor;const e=t.t;t.ui.componentFactory.add(yE,(n=>{const i=t.commands.get(yE);const o=new zw(n);o.set({label:e("Bold"),icon:_E,keystroke:"CTRL+B",tooltip:true,isToggleable:true});o.bind("isOn","isEnabled").to(i,"value","isEnabled");this.listenTo(o,"execute",(()=>{t.execute(yE);t.editing.view.focus()}));return o}))}}class EE extends Un{static get requires(){return[vE,xE]}static get pluginName(){return"Bold"}}var DE='';class SE extends Un{static get pluginName(){return"CKFinderUI"}init(){const t=this.editor;const e=t.ui.componentFactory;const n=t.t;e.add("ckfinder",(e=>{const i=t.commands.get("ckfinder");const o=new zw(e);o.set({label:n("Insert image or file"),icon:DE,tooltip:true});o.bind("isEnabled").to(i);o.on("execute",(()=>{t.execute("ckfinder");t.editing.view.focus()}));return o}))}}class TE extends qn{constructor(t){super(t);this.stopListening(this.editor.model.document,"change");this.listenTo(this.editor.model.document,"change",(()=>this.refresh()),{priority:"low"})}refresh(){const t=this.editor.commands.get("insertImage");const e=this.editor.commands.get("link");this.isEnabled=t.isEnabled||e.isEnabled}execute(){const t=this.editor;const e=this.editor.config.get("ckfinder.openerMethod")||"modal";if(e!="popup"&&e!="modal"){throw new u["a"]("ckfinder-unknown-openermethod",t)}const n=this.editor.config.get("ckfinder.options")||{};n.chooseFiles=true;const i=n.onInit;if(!n.language){n.language=t.locale.uiLanguage}n.onInit=e=>{if(i){i(e)}e.on("files:choose",(n=>{const i=n.data.files.toArray();const o=i.filter((t=>!t.isImage()));const r=i.filter((t=>t.isImage()));for(const e of o){t.execute("link",e.getUrl())}const s=[];for(const t of r){const n=t.getUrl();s.push(n?n:e.request("file:getProxyUrl",{file:t}))}if(s.length){IE(t,s)}}));e.on("file:choose:resizedImage",(e=>{const n=e.data.resizedUrl;if(!n){const e=t.plugins.get("Notification");const n=t.locale.t;e.showWarning(n("Could not obtain resized image URL."),{title:n("Selecting resized image failed"),namespace:"ckfinder"});return}IE(t,[n])}))};window.CKFinder[e](n)}}function IE(t,e){const n=t.commands.get("insertImage");if(!n.isEnabled){const e=t.plugins.get("Notification");const n=t.locale.t;e.showWarning(n("Could not insert image at the current position."),{title:n("Inserting image failed"),namespace:"ckfinder"});return}t.execute("insertImage",{source:e})}class ME extends Un{static get pluginName(){return"CKFinderEditing"}static get requires(){return[IC,"LinkEditing"]}init(){const t=this.editor;if(!t.plugins.has("ImageBlockEditing")&&!t.plugins.has("ImageInlineEditing")){throw new u["a"]("ckfinder-missing-image-plugin",t)}t.commands.add("ckfinder",new TE(t))}}class BE extends Un{static get pluginName(){return"CKFinder"}static get requires(){return["Link","CKFinderUploadAdapter",ME,SE]}}class NE{constructor(){const t=new window.FileReader;this._reader=t;this._data=undefined;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;this.total=t.size;return new Promise(((n,i)=>{e.onload=()=>{const t=e.result;this._data=t;n(t)};e.onerror=()=>{i("error")};e.onabort=()=>{i("aborted")};this._reader.readAsDataURL(t)}))}abort(){this._reader.abort()}}Vn(NE,In);class zE extends Un{static get pluginName(){return"FileRepository"}static get requires(){return[rb]}init(){this.loaders=new ba;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){Object(u["b"])("filerepository-no-upload-adapter");return null}const e=new PE(Promise.resolve(t),this.createUploadAdapter);this.loaders.add(e);this._loadersMap.set(t,e);if(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){if(e.uploadTotal){t+=e.uploadTotal}}this.uploadTotal=t}));return e}destroyLoader(t){const e=t instanceof PE?t:this.getLoader(t);e._destroy();this.loaders.remove(e);this._loadersMap.forEach(((t,n)=>{if(t===e){this._loadersMap.delete(n)}}))}_updatePendingAction(){const t=this.editor.plugins.get(rb);if(this.loaders.length){if(!this._pendingAction){const e=this.editor.t;const n=t=>`${e("Upload in progress")} ${parseInt(t)}%.`;this._pendingAction=t.add(n(this.uploadedPercent));this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else{t.remove(this._pendingAction);this._pendingAction=null}}}Vn(zE,In);class PE{constructor(t,e){this.id=a();this._filePromiseWrapper=this._createFilePromiseWrapper(t);this._adapter=e(this);this._reader=new NE;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(){if(!this._filePromiseWrapper){return Promise.resolve(null)}else{return this._filePromiseWrapper.promise.then((t=>this._filePromiseWrapper?t:null))}}get data(){return this._reader.data}read(){if(this.status!="idle"){throw new u["a"]("filerepository-read-wrong-status",this)}this.status="reading";return this.file.then((t=>this._reader.read(t))).then((t=>{if(this.status!=="reading"){throw this.status}this.status="idle";return t})).catch((t=>{if(t==="aborted"){this.status="aborted";throw"aborted"}this.status="error";throw this._reader.error?this._reader.error:t}))}upload(){if(this.status!="idle"){throw new u["a"]("filerepository-upload-wrong-status",this)}this.status="uploading";return this.file.then((()=>this._adapter.upload())).then((t=>{this.uploadResponse=t;this.status="idle";return t})).catch((t=>{if(this.status==="aborted"){throw"aborted"}this.status="error";throw t}))}abort(){const t=this.status;this.status="aborted";if(!this._filePromiseWrapper.isFulfilled){this._filePromiseWrapper.promise.catch((()=>{}));this._filePromiseWrapper.rejecter("aborted")}else if(t=="reading"){this._reader.abort()}else if(t=="uploading"&&this._adapter.abort){this._adapter.abort()}this._destroy()}_destroy(){this._filePromiseWrapper=undefined;this._reader=undefined;this._adapter=undefined;this.uploadResponse=undefined}_createFilePromiseWrapper(t){const e={};e.promise=new Promise(((n,i)=>{e.rejecter=i;e.isFulfilled=false;t.then((t=>{e.isFulfilled=true;n(t)})).catch((t=>{e.isFulfilled=true;i(t)}))}));return e}}Vn(PE,In);class LE extends Wb{constructor(t){super(t);this.buttonView=new zw(t);this._fileInputView=new RE(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 RE extends Wb{constructor(t){super(t);this.set("acceptedType");this.set("allowMultipleFiles",false);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((()=>{if(this.element&&this.element.files&&this.element.files.length){this.fire("done",this.element.files)}this.element.value=""}))}})}open(){this.element.click()}}class OE extends Un{static get requires(){return[zE]}static get pluginName(){return"Base64UploadAdapter"}init(){this.editor.plugins.get(zE).createUploadAdapter=t=>new jE(t)}}class jE{constructor(t){this.loader=t}upload(){return new Promise(((t,e)=>{const n=this.reader=new window.FileReader;n.addEventListener("load",(()=>{t({default:n.result})}));n.addEventListener("error",(t=>{e(t)}));n.addEventListener("abort",(()=>{e()}));this.loader.file.then((t=>{n.readAsDataURL(t)}))}))}abort(){this.reader.abort()}}class FE extends Un{static get requires(){return[zE]}static get pluginName(){return"SimpleUploadAdapter"}init(){const t=this.editor.config.get("simpleUpload");if(!t){return}if(!t.uploadUrl){Object(u["b"])("simple-upload-adapter-missing-uploadurl");return}this.editor.plugins.get(zE).createUploadAdapter=e=>new VE(e,t)}}class VE{constructor(t,e){this.loader=t;this.options=e}upload(){return this.loader.file.then((t=>new Promise(((e,n)=>{this._initRequest();this._initListeners(e,n,t);this._sendRequest(t)}))))}abort(){if(this.xhr){this.xhr.abort()}}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.options.uploadUrl,true);t.responseType="json"}_initListeners(t,e,n){const i=this.xhr;const o=this.loader;const r=`Couldn't upload file: ${n.name}.`;i.addEventListener("error",(()=>e(r)));i.addEventListener("abort",(()=>e()));i.addEventListener("load",(()=>{const n=i.response;if(!n||n.error){return e(n&&n.error&&n.error.message?n.error.message:r)}const o=n.url?{default:n.url}:n.urls;t({...n,urls:o})}));if(i.upload){i.upload.addEventListener("progress",(t=>{if(t.lengthComputable){o.uploadTotal=t.total;o.uploaded=t.loaded}}))}}_sendRequest(t){const e=this.options.headers||{};const n=this.options.withCredentials||false;for(const t of Object.keys(e)){this.xhr.setRequestHeader(t,e[t])}this.xhr.withCredentials=n;const i=new FormData;i.append("upload",t);this.xhr.send(i)}}const UE="ckCsrfToken";const HE=40;const qE="abcdefghijklmnopqrstuvwxyz0123456789";function WE(){let t=GE(UE);if(!t||t.length!=HE){t=$E(HE);KE(UE,t)}return t}function GE(t){t=t.toLowerCase();const e=document.cookie.split(";");for(const n of e){const e=n.split("=");const i=decodeURIComponent(e[0].trim().toLowerCase());if(i===t){return decodeURIComponent(e[1])}}return null}function KE(t,e){document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)+";path=/"}function $E(t){let e="";const n=new Uint8Array(t);window.crypto.getRandomValues(n);for(let t=0;t.5?i.toUpperCase():i}return e}class YE extends Un{static get requires(){return[zE]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const t=this.editor.config.get("ckfinder.uploadUrl");if(!t){return}this.editor.plugins.get(zE).createUploadAdapter=e=>new QE(e,t,this.editor.t)}}class QE{constructor(t,e,n){this.loader=t;this.url=e;this.t=n}upload(){return this.loader.file.then((t=>new Promise(((e,n)=>{this._initRequest();this._initListeners(e,n,t);this._sendRequest(t)}))))}abort(){if(this.xhr){this.xhr.abort()}}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.url,true);t.responseType="json"}_initListeners(t,e,n){const i=this.xhr;const o=this.loader;const r=this.t;const s=r("Cannot upload file:")+` ${n.name}.`;i.addEventListener("error",(()=>e(s)));i.addEventListener("abort",(()=>e()));i.addEventListener("load",(()=>{const n=i.response;if(!n||!n.uploaded){return e(n&&n.error&&n.error.message?n.error.message:s)}t({default:n.url})}));if(i.upload){i.upload.addEventListener("progress",(t=>{if(t.lengthComputable){o.uploadTotal=t.total;o.uploaded=t.loaded}}))}}_sendRequest(t){const e=new FormData;e.append("upload",t);e.append("ckCsrfToken",WE());this.xhr.send(e)}}const ZE={autoRefresh:true};const JE=36e5;class XE{constructor(t,e=ZE){if(!t){throw new u["a"]("token-missing-token-url",this)}if(e.initValue){this._validateTokenValue(e.initValue)}this.set("value",e.initValue);if(typeof t==="function"){this._refresh=t}else{this._refresh=()=>tD(t)}this._options=Object.assign({},ZE,e)}init(){return new Promise(((t,e)=>{if(!this.value){this.refreshToken().then(t).catch(e);return}if(this._options.autoRefresh){this._registerRefreshTokenTimeout()}t(this)}))}refreshToken(){return this._refresh().then((t=>{this._validateTokenValue(t);this.set("value",t);if(this._options.autoRefresh){this._registerRefreshTokenTimeout()}})).then((()=>this))}destroy(){clearTimeout(this._tokenRefreshTimeout)}_validateTokenValue(t){const e=typeof t==="string";const n=!/^".*"$/.test(t);const i=e&&t.split(".").length===3;if(!(n&&i)){throw new u["a"]("token-not-in-jwt-format",this)}}_registerRefreshTokenTimeout(){const t=this._getTokenRefreshTimeoutTime();clearTimeout(this._tokenRefreshTimeout);this._tokenRefreshTimeout=setTimeout((()=>{this.refreshToken()}),t)}_getTokenRefreshTimeoutTime(){try{const[,t]=this.value.split(".");const{exp:e}=JSON.parse(atob(t));if(!e){return JE}const n=Math.floor((e*1e3-Date.now())/2);return n}catch(t){return JE}}static create(t,e=ZE){const n=new XE(t,e);return n.init()}}Vn(XE,In);function tD(t){return new Promise(((e,n)=>{const i=new XMLHttpRequest;i.open("GET",t);i.addEventListener("load",(()=>{const t=i.status;const o=i.response;if(t<200||t>299){return n(new u["a"]("token-cannot-download-new-token",null))}return e(o)}));i.addEventListener("error",(()=>n(new Error("Network Error"))));i.addEventListener("abort",(()=>n(new Error("Abort"))));i.send()}))}var eD=XE;const nD=/^data:(\S*?);base64,/;class iD{constructor(t,e,n){if(!t){throw new u["a"]("fileuploader-missing-file",null)}if(!e){throw new u["a"]("fileuploader-missing-token",null)}if(!n){throw new u["a"]("fileuploader-missing-api-address",null)}this.file=rD(t)?oD(t):t;this._token=e;this._apiAddress=n}onProgress(t){this.on("progress",((e,n)=>t(n)));return this}onError(t){this.once("error",((e,n)=>t(n)));return this}abort(){this.xhr.abort()}send(){this._prepareRequest();this._attachXHRListeners();return this._sendRequest()}_prepareRequest(){const t=new XMLHttpRequest;t.open("POST",this._apiAddress);t.setRequestHeader("Authorization",this._token.value);t.responseType="json";this.xhr=t}_attachXHRListeners(){const t=this;const e=this.xhr;e.addEventListener("error",n("Network Error"));e.addEventListener("abort",n("Abort"));if(e.upload){e.upload.addEventListener("progress",(t=>{if(t.lengthComputable){this.fire("progress",{total:t.total,uploaded:t.loaded})}}))}e.addEventListener("load",(()=>{const t=e.status;const n=e.response;if(t<200||t>299){return this.fire("error",n.message||n.error)}}));function n(e){return()=>t.fire("error",e)}}_sendRequest(){const t=new FormData;const e=this.xhr;t.append("file",this.file);return new Promise(((n,i)=>{e.addEventListener("load",(()=>{const t=e.status;const o=e.response;if(t<200||t>299){if(o.message){return i(new u["a"]("fileuploader-uploading-data-failed",this,{message:o.message}))}return i(o.error)}return n(o)}));e.addEventListener("error",(()=>i(new Error("Network Error"))));e.addEventListener("abort",(()=>i(new Error("Abort"))));e.send(t)}))}}Vn(iD,m);function oD(t,e=512){try{const n=t.match(nD)[1];const i=atob(t.replace(nD,""));const o=[];for(let t=0;t{const i=t.commands.get(kD);const o=new zw(n);o.set({label:e("Code"),icon:hD,tooltip:true,isToggleable:true});o.bind("isOn","isEnabled").to(i,"value","isEnabled");this.listenTo(o,"execute",(()=>{t.execute(kD);t.editing.view.focus()}));return o}))}}class wD extends Un{static get requires(){return[uD,bD]}static get pluginName(){return"Code"}}function AD(t){const e=t.t;const n=t.config.get("codeBlock.languages");for(const t of n){if(t.label==="Plain text"){t.label=e("Plain text")}if(t.class===undefined){t.class=`language-${t.language}`}}return n}function CD(t,e,n){const i={};for(const o of t){if(e==="class"){i[o[e].split(" ").shift()]=o[n]}else{i[o[e]]=o[n]}}return i}function vD(t){return t.data.match(/^(\s*)/)[0]}function _D(t,e){const n=t.createDocumentFragment();const i=e.split("\n");const o=i.reduce(((e,n,o)=>{e.push(n);if(o{if(a){this._applyCodeBlock(t,s,c)}else{this._removeCodeBlock(t,s)}}))}_getValue(){const t=this.editor.model.document.selection;const e=If(t.getSelectedBlocks());const n=!!(e&&e.is("element","codeBlock"));return n?e.getAttribute("language"):false}_checkEnabled(){if(this.value){return true}const t=this.editor.model.document.selection;const e=this.editor.model.schema;const n=If(t.getSelectedBlocks());if(!n){return false}return DD(e,n)}_applyCodeBlock(t,e,n){this._lastLanguage=n;const i=this.editor.model.schema;const o=e.filter((t=>DD(i,t)));for(const e of o){t.rename(e,"codeBlock");t.setAttribute("language",n,e);i.removeDisallowedAttributes([e],t);Array.from(e.getChildren()).filter((t=>!i.checkChild(e,t))).forEach((e=>t.remove(e)))}o.reverse().forEach(((e,n)=>{const i=o[n+1];if(e.previousSibling===i){t.appendElement("softBreak",i);t.merge(t.createPositionBefore(e))}}))}_removeCodeBlock(t,e){const n=e.filter((t=>t.is("element","codeBlock")));for(const e of n){const n=t.createRangeOn(e);for(const e of Array.from(n.getItems()).reverse()){if(e.is("element","softBreak")&&e.parent.is("element","codeBlock")){const{position:n}=t.split(t.createPositionBefore(e));t.rename(n.nodeAfter,"paragraph");t.removeAttribute("language",n.nodeAfter);t.remove(e)}}t.rename(e,"paragraph");t.removeAttribute("language",e)}}}function DD(t,e){if(e.is("rootElement")||t.isLimit(e)){return false}return t.checkChild(e.parent,"codeBlock")}function SD(t,e,n){if(t.language){return t.language}if(t.usePreviousLanguageChoice&&e){return e}return n}class TD extends qn{constructor(t){super(t);this._indentSequence=t.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor;const e=t.model;e.change((t=>{const n=yD(e);for(const e of n){t.insertText(this._indentSequence,e)}}))}_checkEnabled(){if(!this._indentSequence){return false}return xD(this.editor.model.document.selection)}}class ID extends qn{constructor(t){super(t);this._indentSequence=t.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor;const e=t.model;e.change((t=>{const n=yD(e);for(const e of n){const n=MD(this.editor.model,e,this._indentSequence);if(n){t.remove(n)}}}))}_checkEnabled(){if(!this._indentSequence){return false}const t=this.editor.model;if(!xD(t.document.selection)){return false}return yD(t).some((e=>MD(t,e,this._indentSequence)))}}function MD(t,e,n){const i=BD(e);if(!i){return null}const o=vD(i);const r=o.lastIndexOf(n);if(r+n.length!==o.length){return null}if(r===-1){return null}const{parent:s,startOffset:a}=i;return t.createRange(t.createPositionAt(s,a+r),t.createPositionAt(s,a+r+n.length))}function BD(t){let e=t.parent.getChild(t.index);if(!e||e.is("element","softBreak")){e=t.nodeBefore}if(!e||e.is("element","softBreak")){return null}return e}function ND(t,e,n=false){const i=CD(e,"language","class");const o=CD(e,"language","label");return(e,r,s)=>{const{writer:a,mapper:c,consumable:l}=s;if(!l.consume(r.item,"insert")){return}const d=r.item.getAttribute("language");const u=c.toViewPosition(t.createPositionBefore(r.item));const h={};if(n){h["data-language"]=o[d];h.spellcheck="false"}const f=a.createContainerElement("pre",h);const g=a.createContainerElement("code",{class:i[d]||null});a.insert(a.createPositionAt(f,0),g);a.insert(u,f);c.bindElements(r.item,g)}}function zD(t){return(e,n,i)=>{if(n.item.parent.name!=="codeBlock"){return}const{writer:o,mapper:r,consumable:s}=i;if(!s.consume(n.item,"insert")){return}const a=r.toViewPosition(t.createPositionBefore(n.item));o.insert(a,o.createText("\n"))}}function PD(t,e){const n=CD(e,"class","language");const i=e[0].language;return(t,e,o)=>{const r=e.viewItem;const s=r.parent;if(!s||!s.is("element","pre")){return}if(e.modelCursor.findAncestor("codeBlock")){return}const{consumable:a,writer:c}=o;if(!a.test(r,{name:true})){return}const l=c.createElement("codeBlock");const d=[...r.getClassNames()];if(!d.length){d.push("")}for(const t of d){const e=n[t];if(e){c.setAttribute("language",e,l);break}}if(!l.hasAttribute("language")){c.setAttribute("language",i,l)}o.convertChildren(r,l);if(!o.safeInsert(l,e.modelCursor)){return}a.consume(r,{name:true});o.updateConversionResult(l,e)}}function LD(){return(t,e,{consumable:n,writer:i})=>{let o=e.modelCursor;if(!n.test(e.viewItem)){return}if(!o.findAncestor("codeBlock")){return}n.consume(e.viewItem);const r=e.viewItem.data;const s=r.split("\n").map((t=>i.createText(t)));const a=s[s.length-1];for(const t of s){i.insert(t,o);o=o.getShiftedBy(t.offsetSize);if(t!==a){const t=i.createElement("softBreak");i.insert(t,o);o=i.createPositionAfter(t)}}e.modelRange=i.createRange(e.modelCursor,o);e.modelCursor=o}}const RD="paragraph";class OD extends Un{static get pluginName(){return"CodeBlockEditing"}static get requires(){return[cE]}constructor(t){super(t);t.config.define("codeBlock",{languages:[{language:"plaintext",label:"Plain text"},{language:"c",label:"C"},{language:"cs",label:"C#"},{language:"cpp",label:"C++"},{language:"css",label:"CSS"},{language:"diff",label:"Diff"},{language:"html",label:"HTML"},{language:"java",label:"Java"},{language:"javascript",label:"JavaScript"},{language:"php",label:"PHP"},{language:"python",label:"Python"},{language:"ruby",label:"Ruby"},{language:"typescript",label:"TypeScript"},{language:"xml",label:"XML"}],indentSequence:"\t"})}init(){const t=this.editor;const e=t.model.schema;const n=t.model;const i=t.editing.view;const o=AD(t);t.commands.add("codeBlock",new ED(t));t.commands.add("indentCodeBlock",new TD(t));t.commands.add("outdentCodeBlock",new ID(t));const r=t=>(e,n)=>{const i=this.editor.commands.get(t);if(i.isEnabled){this.editor.execute(t);n()}};t.keystrokes.set("Tab",r("indentCodeBlock"));t.keystrokes.set("Shift+Tab",r("outdentCodeBlock"));e.register("codeBlock",{allowWhere:"$block",allowChildren:"$text",isBlock:true,allowAttributes:["language"]});e.addAttributeCheck((t=>{if(t.endsWith("codeBlock $text")){return false}}));t.model.schema.addChildCheck(((t,e)=>{if(t.endsWith("codeBlock")&&e.isObject){return false}}));t.editing.downcastDispatcher.on("insert:codeBlock",ND(n,o,true));t.data.downcastDispatcher.on("insert:codeBlock",ND(n,o));t.data.downcastDispatcher.on("insert:softBreak",zD(n),{priority:"high"});t.data.upcastDispatcher.on("element:code",PD(i,o));t.data.upcastDispatcher.on("text",LD());this.listenTo(t.editing.view.document,"clipboardInput",((e,i)=>{let o=n.createRange(n.document.selection.anchor);if(i.targetRanges){o=t.editing.mapper.toModelRange(i.targetRanges[0])}if(!o.start.parent.is("element","codeBlock")){return}const r=i.dataTransfer.getData("text/plain");const s=new Kv(t.editing.view.document);i.content=_D(s,r)}));this.listenTo(n,"getSelectedContent",((t,[i])=>{const o=i.anchor;if(i.isCollapsed||!o.parent.is("element","codeBlock")||!o.hasSameParentAs(i.focus)){return}n.change((n=>{const r=t.return;if(r.childCount>1||i.containsEntireContent(o.parent)){const e=n.createElement("codeBlock",o.parent.getAttributes());n.append(r,e);const i=n.createDocumentFragment();n.append(e,i);t.return=i}else{const t=r.getChild(0);if(e.checkAttribute(t,"code")){n.setAttribute("code",true,t)}}}))}))}afterInit(){const t=this.editor;const e=t.commands;const n=e.get("indent");const i=e.get("outdent");if(n){n.registerChildCommand(e.get("indentCodeBlock"))}if(i){i.registerChildCommand(e.get("outdentCodeBlock"))}this.listenTo(t.editing.view.document,"enter",((e,n)=>{const i=t.model.document.selection.getLastPosition().parent;if(!i.is("element","codeBlock")){return}if(!FD(t,n.isSoft)&&!VD(t,n.isSoft)){jD(t)}n.preventDefault();e.stop()}),{context:"pre"})}}function jD(t){const e=t.model;const n=e.document;const i=n.selection.getLastPosition();const o=i.nodeBefore||i.textNode;let r;if(o&&o.is("$text")){r=vD(o)}t.model.change((e=>{t.execute("shiftEnter");if(r){e.insertText(r,n.selection.anchor)}}))}function FD(t,e){const n=t.model;const i=n.document;const o=t.editing.view;const r=i.selection.getLastPosition();const s=r.nodeAfter;if(e||!i.selection.isCollapsed||!r.isAtStart){return false}if(!HD(s)){return false}t.model.change((e=>{t.execute("enter");const n=i.selection.anchor.parent.previousSibling;e.rename(n,RD);e.setSelection(n,"in");t.model.schema.removeDisallowedAttributes([n],e);e.remove(s)}));o.scrollToTheSelection();return true}function VD(t,e){const n=t.model;const i=n.document;const o=t.editing.view;const r=i.selection.getLastPosition();const s=r.nodeBefore;let a;if(e||!i.selection.isCollapsed||!r.isAtEnd||!s||!s.previousSibling){return false}if(HD(s)&&HD(s.previousSibling)){a=n.createRange(n.createPositionBefore(s.previousSibling),n.createPositionAfter(s))}else if(UD(s)&&HD(s.previousSibling)&&HD(s.previousSibling.previousSibling)){a=n.createRange(n.createPositionBefore(s.previousSibling.previousSibling),n.createPositionAfter(s))}else if(UD(s)&&HD(s.previousSibling)&&UD(s.previousSibling.previousSibling)&&HD(s.previousSibling.previousSibling.previousSibling)){a=n.createRange(n.createPositionBefore(s.previousSibling.previousSibling.previousSibling),n.createPositionAfter(s))}else{return false}t.model.change((e=>{e.remove(a);t.execute("enter");const n=i.selection.anchor.parent;e.rename(n,RD);t.model.schema.removeDisallowedAttributes([n],e)}));o.scrollToTheSelection();return true}function UD(t){return t&&t.is("$text")&&!t.data.match(/\S/)}function HD(t){return t&&t.is("element","softBreak")}var qD='';var WD=n(40);var GD={injectType:"singletonStyleTag",attributes:{"data-cke":true}};GD.insert="head";GD.singleton=true;var KD=ru()(WD["a"],GD);var $D=WD["a"].locals||{};class YD extends Un{static get pluginName(){return"CodeBlockUI"}init(){const t=this.editor;const e=t.t;const n=t.ui.componentFactory;const i=AD(t);n.add("codeBlock",(n=>{const o=t.commands.get("codeBlock");const r=WA(n,oA);const s=r.buttonView;s.set({label:e("Insert code block"),tooltip:true,icon:qD,isToggleable:true});s.bind("isOn").to(o,"value",(t=>!!t));s.on("execute",(()=>{t.execute("codeBlock",{usePreviousLanguageChoice:true});t.editing.view.focus()}));r.on("execute",(e=>{t.execute("codeBlock",{language:e.source._codeBlockLanguage,forceValue:true});t.editing.view.focus()}));r.class="ck-code-block-dropdown";r.bind("isEnabled").to(o);KA(r,this._getLanguageListItemDefinitions(i));return r}))}_getLanguageListItemDefinitions(t){const e=this.editor;const n=e.commands.get("codeBlock");const i=new ba;for(const e of t){const t={type:"button",model:new MC({_codeBlockLanguage:e.language,label:e.label,withText:true})};t.model.bind("isOn").to(n,"value",(e=>e===t.model._codeBlockLanguage));i.add(t)}return i}}class QD extends Un{static get requires(){return[OD,YD]}static get pluginName(){return"CodeBlock"}}class ZD{constructor(t){this.files=JD(t);this._native=t}get types(){return this._native.types}getData(t){return this._native.getData(t)}setData(t,e){this._native.setData(t,e)}set effectAllowed(t){this._native.effectAllowed=t}get effectAllowed(){return this._native.effectAllowed}set dropEffect(t){this._native.dropEffect=t}get dropEffect(){return this._native.dropEffect}get isCanceled(){return this._native.dropEffect=="none"||!!this._native.mozUserCancelled}}function JD(t){const e=Array.from(t.files||[]);const n=Array.from(t.items||[]);if(e.length){return e}return n.filter((t=>t.kind==="file")).map((t=>t.getAsFile()))}class XD extends jh{constructor(t){super(t);const e=this.document;this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"];this.listenTo(e,"paste",n("clipboardInput"),{priority:"low"});this.listenTo(e,"drop",n("clipboardInput"),{priority:"low"});this.listenTo(e,"dragover",n("dragging"),{priority:"low"});function n(t){return(n,i)=>{i.preventDefault();const o=i.dropRange?[i.dropRange]:null;const s=new r(e,t);e.fire(s,{dataTransfer:i.dataTransfer,method:n.name,targetRanges:o,target:i.target});if(s.stop.called){i.stopPropagation()}}}}onDomEvent(t){const e={dataTransfer:new ZD(t.clipboardData?t.clipboardData:t.dataTransfer)};if(t.type=="drop"||t.type=="dragover"){e.dropRange=tS(this.view,t)}this.fire(t.type,t,e)}}function tS(t,e){const n=e.target.ownerDocument;const i=e.clientX;const o=e.clientY;let r;if(n.caretRangeFromPoint&&n.caretRangeFromPoint(i,o)){r=n.caretRangeFromPoint(i,o)}else if(e.rangeParent){r=n.createRange();r.setStart(e.rangeParent,e.rangeOffset);r.collapse(true)}if(r){return t.domConverter.domRangeToView(r)}return null}function eS(t){t=t.replace(//g,">").replace(/\r?\n\r?\n/g,"

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

    ")||t.includes("
    ")){t=`

    ${t}

    `}return t}function nS(t){return t.replace(/(\s+)<\/span>/g,((t,e)=>{if(e.length==1){return" "}return e})).replace(//g,"")}const iS=["figcaption","li"];function oS(t){let e="";if(t.is("$text")||t.is("$textProxy")){e=t.data}else if(t.is("element","img")&&t.hasAttribute("alt")){e=t.getAttribute("alt")}else if(t.is("element","br")){e="\n"}else{let n=null;for(const i of t.getChildren()){const t=oS(i);if(n&&(n.is("containerElement")||i.is("containerElement"))){if(iS.includes(n.name)||iS.includes(i.name)){e+="\n"}else{e+="\n\n"}}e+=t;n=i}}return e}class rS extends Un{static get pluginName(){return"ClipboardPipeline"}init(){const t=this.editor;const e=t.editing.view;e.addObserver(XD);this._setupPasteDrop();this._setupCopyCut()}_setupPasteDrop(){const t=this.editor;const e=t.model;const n=t.editing.view;const i=n.document;this.listenTo(i,"clipboardInput",(e=>{if(t.isReadOnly){e.stop()}}),{priority:"highest"});this.listenTo(i,"clipboardInput",((t,e)=>{const i=e.dataTransfer;let o=e.content||"";if(!o){if(i.getData("text/html")){o=nS(i.getData("text/html"))}else if(i.getData("text/plain")){o=eS(i.getData("text/plain"))}o=this.editor.data.htmlProcessor.toView(o)}const s=new r(this,"inputTransformation");this.fire(s,{content:o,dataTransfer:i,targetRanges:e.targetRanges,method:e.method});if(s.stop.called){t.stop()}n.scrollToTheSelection()}),{priority:"low"});this.listenTo(this,"inputTransformation",((t,n)=>{if(n.content.isEmpty){return}const i=this.editor.data;const o=i.toModel(n.content,"$clipboardHolder");if(o.childCount==0){return}t.stop();e.change((()=>{this.fire("contentInsertion",{content:o,method:n.method,dataTransfer:n.dataTransfer,targetRanges:n.targetRanges})}))}),{priority:"low"});this.listenTo(this,"contentInsertion",((t,n)=>{n.resultRange=e.insertContent(n.content)}),{priority:"low"})}_setupCopyCut(){const t=this.editor;const e=t.model.document;const n=t.editing.view;const i=n.document;function o(n,o){const r=o.dataTransfer;o.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));i.fire("clipboardOutput",{dataTransfer:r,content:s,method:n.name})}this.listenTo(i,"copy",o,{priority:"low"});this.listenTo(i,"cut",((e,n)=>{if(t.isReadOnly){n.preventDefault()}else{o(e,n)}}),{priority:"low"});this.listenTo(i,"clipboardOutput",((n,i)=>{if(!i.content.isEmpty){i.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(i.content));i.dataTransfer.setData("text/plain",oS(i.content))}if(i.method=="cut"){t.model.deleteContent(e.selection)}}),{priority:"low"})}}class sS{constructor(){this._stack=[]}add(t,e){const n=this._stack;const i=n[0];this._insertDescriptor(t);const o=n[0];if(i!==o&&!aS(i,o)){this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:e})}}remove(t,e){const n=this._stack;const i=n[0];this._removeDescriptor(t);const o=n[0];if(i!==o&&!aS(i,o)){this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:e})}}_insertDescriptor(t){const e=this._stack;const n=e.findIndex((e=>e.id===t.id));if(aS(t,e[n])){return}if(n>-1){e.splice(n,1)}let i=0;while(e[i]&&cS(e[i],t)){i++}e.splice(i,0,t)}_removeDescriptor(t){const e=this._stack;const n=e.findIndex((e=>e.id===t));if(n>-1){e.splice(n,1)}}}Vn(sS,m);function aS(t,e){return t&&e&&t.priority==e.priority&&lS(t.classes)==lS(e.classes)}function cS(t,e){if(t.priority>e.priority){return true}else if(t.prioritylS(e.classes)}function lS(t){return Array.isArray(t)?t.sort().join(","):t}var dS='';const uS="ck-widget";const hS="ck-widget_selected";function fS(t){if(!t.is("element")){return false}return!!t.getCustomProperty("widget")}function gS(t,e,n={}){if(!t.is("containerElement")){throw new u["a"]("widget-to-widget-wrong-element-type",null,{element:t})}e.setAttribute("contenteditable","false",t);e.addClass(uS,t);e.setCustomProperty("widget",true,t);t.getFillerOffset=_S;if(n.label){bS(t,n.label,e)}if(n.hasSelectionHandle){yS(t,e)}kS(t,e);return t}function mS(t,e,n){if(e.classes){n.addClass(Aa(e.classes),t)}if(e.attributes){for(const i in e.attributes){n.setAttribute(i,e.attributes[i],t)}}}function pS(t,e,n){if(e.classes){n.removeClass(Aa(e.classes),t)}if(e.attributes){for(const i in e.attributes){n.removeAttribute(i,t)}}}function kS(t,e,n=mS,i=pS){const o=new sS;o.on("change:top",((e,o)=>{if(o.oldDescriptor){i(t,o.oldDescriptor,o.writer)}if(o.newDescriptor){n(t,o.newDescriptor,o.writer)}}));e.setCustomProperty("addHighlight",((t,e,n)=>o.add(e,n)),t);e.setCustomProperty("removeHighlight",((t,e,n)=>o.remove(e,n)),t)}function bS(t,e,n){n.setCustomProperty("widgetLabel",e,t)}function wS(t){const e=t.getCustomProperty("widgetLabel");if(!e){return""}return typeof e=="function"?e():e}function AS(t,e){e.addClass(["ck-editor__editable","ck-editor__nested-editable"],t);e.setAttribute("contenteditable",t.isReadOnly?"false":"true",t);t.on("change:isReadOnly",((n,i,o)=>{e.setAttribute("contenteditable",o?"false":"true",t)}));t.on("change:isFocused",((n,i,o)=>{if(o){e.addClass("ck-editor__nested-editable_focused",t)}else{e.removeClass("ck-editor__nested-editable_focused",t)}}));kS(t,e);return t}function CS(t,e){const n=t.getSelectedElement();if(n){const i=IS(t);if(i){return e.createRange(e.createPositionAt(n,i))}if(e.schema.isObject(n)&&!e.schema.isInline(n)){return e.createRangeOn(n)}}const i=t.getSelectedBlocks().next().value;if(i){if(i.isEmpty){return e.createRange(e.createPositionAt(i,0))}const n=e.createPositionAfter(i);if(t.focus.isTouching(n)){return e.createRange(n)}return e.createRange(e.createPositionBefore(i))}return e.createRange(t.focus)}function vS(t,e){return(n,i)=>{const{mapper:o,viewPosition:r}=i;const s=o.findMappedViewAncestor(r);if(!e(s)){return}const a=o.toModelElement(s);i.modelPosition=t.createPositionAt(a,r.isAtStart?"before":"after")}}function _S(){return null}function yS(t,e){const n=e.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(t){const e=this.toDomElement(t);const n=new yw;n.set("content",dS);n.render();e.appendChild(n.element);return e}));e.insert(e.createPositionAt(t,0),n);e.addClass(["ck-widget_with-selection-handle"],t)}const xS="widget-type-around";function ES(t,e,n){return t&&fS(t)&&!n.isInline(e)}function DS(t){return t.closest(".ck-widget__type-around__button")}function SS(t){return t.classList.contains("ck-widget__type-around__button_before")?"before":"after"}function TS(t,e){const n=t.closest(".ck-widget");return e.mapDomToView(n)}function IS(t){return t.getAttribute(xS)}var MS='';var BS=n(41);var NS={injectType:"singletonStyleTag",attributes:{"data-cke":true}};NS.insert="head";NS.singleton=true;var zS=ru()(BS["a"],NS);var PS=BS["a"].locals||{};const LS=["before","after"];const RS=(new DOMParser).parseFromString(MS,"image/svg+xml").firstChild;const OS="ck-widget__type-around_disabled";class jS extends Un{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[nE,cy]}constructor(t){super(t);this._currentFakeCaretModelElement=null}init(){const t=this.editor;const e=t.editing.view;this.on("change:isEnabled",((n,i,o)=>{e.change((t=>{for(const n of e.document.roots){if(o){t.removeClass(OS,n)}else{t.addClass(OS,n)}}}));if(!o){t.model.change((t=>{t.removeSelectionAttribute(xS)}))}}));this._enableTypeAroundUIInjection();this._enableInsertingParagraphsOnButtonClick();this._enableInsertingParagraphsOnEnterKeypress();this._enableInsertingParagraphsOnTypingKeystroke();this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows();this._enableDeleteIntegration();this._enableInsertContentIntegration();this._enableDeleteContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(t,e){const n=this.editor;const i=n.editing.view;n.execute("insertParagraph",{position:n.model.createPositionAt(t,e)});i.focus();i.scrollToTheSelection()}_listenToIfEnabled(t,e,n,i){this.listenTo(t,e,((...t)=>{if(this.isEnabled){n(...t)}}),i)}_insertParagraphAccordingToFakeCaretPosition(){const t=this.editor;const e=t.model;const n=e.document.selection;const i=IS(n);if(!i){return false}const o=n.getSelectedElement();this._insertParagraph(o,i);return true}_enableTypeAroundUIInjection(){const t=this.editor;const e=t.model.schema;const n=t.locale.t;const i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};t.editing.downcastDispatcher.on("insert",((t,n,o)=>{const r=o.mapper.toViewElement(n.item);if(ES(r,n.item,e)){FS(o.writer,i,r)}}),{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const t=this.editor;const e=t.model;const n=e.document.selection;const i=e.schema;const o=t.editing.view;this._listenToIfEnabled(o.document,"arrowKey",((t,e)=>{this._handleArrowKeyPress(t,e)}),{context:[fS,"$text"],priority:"high"});this._listenToIfEnabled(n,"change:range",((e,n)=>{if(!n.directChange){return}t.model.change((t=>{t.removeSelectionAttribute(xS)}))}));this._listenToIfEnabled(e.document,"change:data",(()=>{const e=n.getSelectedElement();if(e){const n=t.editing.mapper.toViewElement(e);if(ES(n,e,i)){return}}t.model.change((t=>{t.removeSelectionAttribute(xS)}))}));this._listenToIfEnabled(t.editing.downcastDispatcher,"selection",((t,e,n)=>{const o=n.writer;if(this._currentFakeCaretModelElement){const t=n.mapper.toViewElement(this._currentFakeCaretModelElement);if(t){o.removeClass(LS.map(r),t);this._currentFakeCaretModelElement=null}}const s=e.selection.getSelectedElement();if(!s){return}const a=n.mapper.toViewElement(s);if(!ES(a,s,i)){return}const c=IS(e.selection);if(!c){return}o.addClass(r(c),a);this._currentFakeCaretModelElement=s}));this._listenToIfEnabled(t.ui.focusTracker,"change:isFocused",((e,n,i)=>{if(!i){t.model.change((t=>{t.removeSelectionAttribute(xS)}))}}));function r(t){return`ck-widget_type-around_show-fake-caret_${t}`}}_handleArrowKeyPress(t,e){const n=this.editor;const i=n.model;const o=i.document.selection;const r=i.schema;const s=n.editing.view;const a=e.keyCode;const c=gd(a,n.locale.contentLanguageDirection);const l=s.document.selection.getSelectedElement();const d=n.editing.mapper.toModelElement(l);let u;if(ES(l,d,r)){u=this._handleArrowKeyPressOnSelectedWidget(c)}else if(o.isCollapsed){u=this._handleArrowKeyPressWhenSelectionNextToAWidget(c)}else if(!e.shiftKey){u=this._handleArrowKeyPressWhenNonCollapsedSelection(c)}if(u){e.preventDefault();t.stop()}}_handleArrowKeyPressOnSelectedWidget(t){const e=this.editor;const n=e.model;const i=n.document.selection;const o=IS(i);return n.change((e=>{if(o){const n=o===(t?"after":"before");if(!n){e.removeSelectionAttribute(xS);return true}}else{e.setSelectionAttribute(xS,t?"after":"before");return true}return false}))}_handleArrowKeyPressWhenSelectionNextToAWidget(t){const e=this.editor;const n=e.model;const i=n.schema;const o=e.plugins.get("Widget");const r=o._getObjectElementNextToSelection(t);const s=e.editing.mapper.toViewElement(r);if(ES(s,r,i)){n.change((e=>{o._setSelectionOverElement(r);e.setSelectionAttribute(xS,t?"before":"after")}));return true}return false}_handleArrowKeyPressWhenNonCollapsedSelection(t){const e=this.editor;const n=e.model;const i=n.schema;const o=e.editing.mapper;const r=n.document.selection;const s=t?r.getLastPosition().nodeBefore:r.getFirstPosition().nodeAfter;const a=o.toViewElement(s);if(ES(a,s,i)){n.change((e=>{e.setSelection(s,"on");e.setSelectionAttribute(xS,t?"after":"before")}));return true}return false}_enableInsertingParagraphsOnButtonClick(){const t=this.editor;const e=t.editing.view;this._listenToIfEnabled(e.document,"mousedown",((n,i)=>{const o=DS(i.domTarget);if(!o){return}const r=SS(o);const s=TS(o,e.domConverter);const a=t.editing.mapper.toModelElement(s);this._insertParagraph(a,r);i.preventDefault();n.stop()}))}_enableInsertingParagraphsOnEnterKeypress(){const t=this.editor;const e=t.model.document.selection;const n=t.editing.view;this._listenToIfEnabled(n.document,"enter",((n,i)=>{if(n.eventPhase!="atTarget"){return}const o=e.getSelectedElement();const r=t.editing.mapper.toViewElement(o);const s=t.model.schema;let a;if(this._insertParagraphAccordingToFakeCaretPosition()){a=true}else if(ES(r,o,s)){this._insertParagraph(o,i.isSoft?"before":"after");a=true}if(a){i.preventDefault();n.stop()}}),{context:fS})}_enableInsertingParagraphsOnTypingKeystroke(){const t=this.editor;const e=t.editing.view;const n=[sd.enter,sd.delete,sd.backspace];this._listenToIfEnabled(e.document,"keydown",((t,e)=>{if(!n.includes(e.keyCode)&&!X_(e)){this._insertParagraphAccordingToFakeCaretPosition()}}),{priority:"high"})}_enableDeleteIntegration(){const t=this.editor;const e=t.editing.view;const n=t.model;const i=n.schema;this._listenToIfEnabled(e.document,"delete",((e,o)=>{if(e.eventPhase!="atTarget"){return}const r=IS(n.document.selection);if(!r){return}const s=o.direction;const a=n.document.selection.getSelectedElement();const c=r==="before";const l=s=="forward";const d=c===l;if(d){t.execute("delete",{selection:n.createSelection(a,"on")})}else{const e=i.getNearestSelectionRange(n.createPositionAt(a,r),s);if(e){if(!e.isCollapsed){n.change((n=>{n.setSelection(e);t.execute(l?"deleteForward":"delete")}))}else{const o=n.createSelection(e.start);n.modifySelection(o,{direction:s});if(!o.focus.isEqual(e.start)){n.change((n=>{n.setSelection(e);t.execute(l?"deleteForward":"delete")}))}else{const t=HS(i,e.start.parent);n.deleteContent(n.createSelection(t,"on"),{doNotAutoparagraph:true})}}}}o.preventDefault();e.stop()}),{context:fS})}_enableInsertContentIntegration(){const t=this.editor;const e=this.editor.model;const n=e.document.selection;this._listenToIfEnabled(t.model,"insertContent",((t,[i,o])=>{if(o&&!o.is("documentSelection")){return}const r=IS(n);if(!r){return}t.stop();return e.change((t=>{const o=n.getSelectedElement();const s=e.createPositionAt(o,r);const a=t.createSelection(s);const c=e.insertContent(i,a);t.setSelection(a);return c}))}),{priority:"high"})}_enableDeleteContentIntegration(){const t=this.editor;const e=this.editor.model;const n=e.document.selection;this._listenToIfEnabled(t.model,"deleteContent",((t,[e])=>{if(e&&!e.is("documentSelection")){return}const i=IS(n);if(i){t.stop()}}),{priority:"high"})}}function FS(t,e,n){const i=t.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(t){const n=this.toDomElement(t);VS(n,e);US(n);return n}));t.insert(t.createPositionAt(n,"end"),i)}function VS(t,e){for(const n of LS){const i=new Kb({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${n}`],title:e[n]},children:[t.ownerDocument.importNode(RS,true)]});t.appendChild(i.render())}}function US(t){const e=new Kb({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});t.appendChild(e.render())}function HS(t,e){let n=e;for(const i of e.getAncestors({parentFirst:true})){if(i.childCount>1||t.isLimit(i)){break}n=i}return n}function qS(t){const e=t.model;return(n,i)=>{const o=i.keyCode==sd.arrowup;const r=i.keyCode==sd.arrowdown;const s=i.shiftKey;const a=e.document.selection;if(!o&&!r){return}const c=r;if(s&&YS(a,c)){return}const l=WS(t,a,c);if(!l){return}if(l.isCollapsed){if(a.isCollapsed){return}else if(s){return}}if(l.isCollapsed||$S(t,l,c)){e.change((t=>{const n=c?l.end:l.start;if(s){const i=e.createSelection(a.anchor);i.setFocus(n);t.setSelection(i)}else{t.setSelection(n)}}));n.stop();i.preventDefault();i.stopPropagation()}}}function WS(t,e,n){const i=t.model;if(n){const t=e.isCollapsed?e.focus:e.getLastPosition();const n=GS(i,t,"forward");if(!n){return null}const o=i.createRange(t,n);const r=KS(i.schema,o,"backward");if(r){return i.createRange(t,r)}return null}else{const t=e.isCollapsed?e.focus:e.getFirstPosition();const n=GS(i,t,"backward");if(!n){return null}const o=i.createRange(n,t);const r=KS(i.schema,o,"forward");if(r){return i.createRange(r,t)}return null}}function GS(t,e,n){const i=t.schema;const o=t.createRangeIn(e.root);const r=n=="forward"?"elementStart":"elementEnd";for(const{previousPosition:t,item:s,type:a}of o.getWalker({startPosition:e,direction:n})){if(i.isLimit(s)&&!i.isInline(s)){return t}if(a==r&&i.isBlock(s)){return null}}return null}function KS(t,e,n){const i=n=="backward"?e.end:e.start;if(t.checkChild(i,"$text")){return i}for(const{nextPosition:i}of e.getWalker({direction:n})){if(t.checkChild(i,"$text")){return i}}return null}function $S(t,e,n){const i=t.model;const o=t.view.domConverter;if(n){const t=i.createSelection(e.start);i.modifySelection(t);if(!t.focus.isAtEnd&&!e.start.isEqual(t.focus)){e=i.createRange(t.focus,e.end)}}const r=t.mapper.toViewRange(e);const s=o.viewRangeToDom(r);const a=vf.getDomRangeRects(s);let c;for(const t of a){if(c===undefined){c=Math.round(t.bottom);continue}if(Math.round(t.top)>=c){return false}c=Math.max(c,Math.round(t.bottom))}return true}function YS(t,e){return!t.isCollapsed&&t.isBackward==e}var QS=n(42);var ZS={injectType:"singletonStyleTag",attributes:{"data-cke":true}};ZS.insert="head";ZS.singleton=true;var JS=ru()(QS["a"],ZS);var XS=QS["a"].locals||{};class tT extends Un{static get pluginName(){return"Widget"}static get requires(){return[jS,cy]}init(){const t=this.editor;const e=t.editing.view;const n=e.document;this._previouslySelected=new Set;this.editor.editing.downcastDispatcher.on("selection",((e,n,i)=>{const o=i.writer;const r=n.selection;if(r.isCollapsed){return}const s=r.getSelectedElement();if(!s){return}const a=t.editing.mapper.toViewElement(s);if(!fS(a)){return}if(!i.consumable.consume(r,"selection")){return}o.setSelection(o.createRangeOn(a),{fake:true,label:wS(a)})}));this.editor.editing.downcastDispatcher.on("selection",((t,e,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const i=n.writer;const o=i.document.selection;let r=null;for(const t of o.getRanges()){for(const e of t){const t=e.item;if(fS(t)&&!nT(t,r)){i.addClass(hS,t);this._previouslySelected.add(t);r=t}}}}),{priority:"low"});e.addObserver(Gv);this.listenTo(n,"mousedown",((...t)=>this._onMousedown(...t)));this.listenTo(n,"arrowKey",((...t)=>{this._handleSelectionChangeOnArrowKeyPress(...t)}),{context:[fS,"$text"]});this.listenTo(n,"arrowKey",((...t)=>{this._preventDefaultOnArrowKeyPress(...t)}),{context:"$root"});this.listenTo(n,"arrowKey",qS(this.editor.editing),{context:"$text"});this.listenTo(n,"delete",((t,e)=>{if(this._handleDelete(e.direction=="forward")){e.preventDefault();t.stop()}}),{context:"$root"})}_onMousedown(t,e){const n=this.editor;const i=n.editing.view;const o=i.document;let r=e.target;if(eT(r)){if((Yl.isSafari||Yl.isGecko)&&e.domEvent.detail>=3){const t=n.editing.mapper;const i=r.is("attributeElement")?r.findAncestor((t=>!t.is("attributeElement"))):r;const o=t.toModelElement(i);e.preventDefault();this.editor.model.change((t=>{t.setSelection(o,"in")}))}return}if(!fS(r)){r=r.findAncestor(fS);if(!r){return}}if(Yl.isAndroid){e.preventDefault()}if(!o.isFocused){i.focus()}const s=n.editing.mapper.toModelElement(r);this._setSelectionOverElement(s)}_handleSelectionChangeOnArrowKeyPress(t,e){const n=e.keyCode;const i=this.editor.model;const o=i.schema;const r=i.document.selection;const s=r.getSelectedElement();const a=hd(n,this.editor.locale.contentLanguageDirection);const c=a=="down"||a=="right";const l=a=="up"||a=="down";if(s&&o.isObject(s)){const n=c?r.getLastPosition():r.getFirstPosition();const s=o.getNearestSelectionRange(n,c?"forward":"backward");if(s){i.change((t=>{t.setSelection(s)}));e.preventDefault();t.stop()}return}if(!r.isCollapsed&&!e.shiftKey){const n=r.getFirstPosition();const s=r.getLastPosition();const a=n.nodeAfter;const l=s.nodeBefore;if(a&&o.isObject(a)||l&&o.isObject(l)){i.change((t=>{t.setSelection(c?s:n)}));e.preventDefault();t.stop()}return}if(!r.isCollapsed){return}const d=this._getObjectElementNextToSelection(c);if(d&&o.isObject(d)){if(o.isInline(d)&&l){return}this._setSelectionOverElement(d);e.preventDefault();t.stop()}}_preventDefaultOnArrowKeyPress(t,e){const n=this.editor.model;const i=n.schema;const o=n.document.selection.getSelectedElement();if(o&&i.isObject(o)){e.preventDefault();t.stop()}}_handleDelete(t){if(this.editor.isReadOnly){return}const e=this.editor.model.document;const n=e.selection;if(!n.isCollapsed){return}const i=this._getObjectElementNextToSelection(t);if(i){this.editor.model.change((t=>{let e=n.anchor.parent;while(e.isEmpty){const n=e;e=n.parent;t.remove(n)}this._setSelectionOverElement(i)}));return true}}_setSelectionOverElement(t){this.editor.model.change((e=>{e.setSelection(e.createRangeOn(t))}))}_getObjectElementNextToSelection(t){const e=this.editor.model;const n=e.schema;const i=e.document.selection;const o=e.createSelection(i);e.modifySelection(o,{direction:t?"forward":"backward"});if(o.isEqual(i)){return null}const r=t?o.focus.nodeBefore:o.focus.nodeAfter;if(!!r&&n.isObject(r)){return r}return null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected){t.removeClass(hS,e)}this._previouslySelected.clear()}}function eT(t){while(t){if(t.is("editableElement")&&!t.is("rootElement")){return true}if(fS(t)){return false}t=t.parent}return false}function nT(t,e){if(!e){return false}return Array.from(t.getAncestors()).includes(e)}var iT="Expected a function";function oT(t,e,n){var i=true,o=true;if(typeof t!="function"){throw new TypeError(iT)}if(S(n)){i="leading"in n?!!n.leading:i;o="trailing"in n?!!n.trailing:o}return af(t,e,{leading:i,maxWait:e,trailing:o})}var rT=oT;var sT=n(43);var aT={injectType:"singletonStyleTag",attributes:{"data-cke":true}};aT.insert="head";aT.singleton=true;var cT=ru()(sT["a"],aT);var lT=sT["a"].locals||{};class dT extends Un{static get pluginName(){return"DragDrop"}static get requires(){return[rS,tT]}init(){const t=this.editor;const e=t.editing.view;this._draggedRange=null;this._draggingUid="";this._draggableElement=null;this._updateDropMarkerThrottled=rT((t=>this._updateDropMarker(t)),40);this._removeDropMarkerDelayed=bT((()=>this._removeDropMarker()),40);this._clearDraggableAttributesDelayed=bT((()=>this._clearDraggableAttributes()),40);e.addObserver(XD);e.addObserver(Gv);this._setupDragging();this._setupContentInsertionIntegration();this._setupClipboardInputIntegration();this._setupDropMarker();this._setupDraggableAttributeHandling();this.listenTo(t,"change:isReadOnly",((t,e,n)=>{if(n){this.forceDisabled("readOnlyMode")}else{this.clearForceDisabled("readOnlyMode")}}));this.on("change:isEnabled",((t,e,n)=>{if(!n){this._finalizeDragging(false)}}));if(Yl.isAndroid){this.forceDisabled("noAndroidSupport")}}destroy(){if(this._draggedRange){this._draggedRange.detach();this._draggedRange=null}this._updateDropMarkerThrottled.cancel();this._removeDropMarkerDelayed.cancel();this._clearDraggableAttributesDelayed.cancel();return super.destroy()}_setupDragging(){const t=this.editor;const e=t.model;const n=e.document;const i=t.editing.view;const o=i.document;this.listenTo(o,"dragstart",((i,r)=>{const s=n.selection;if(r.target&&r.target.is("editableElement")){r.preventDefault();return}const c=r.target?wT(r.target):null;if(c){const n=t.editing.mapper.toModelElement(c);this._draggedRange=Ag.fromRange(e.createRangeOn(n));if(t.plugins.has("WidgetToolbarRepository")){t.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}}else if(!o.selection.isCollapsed){const t=o.selection.getSelectedElement();if(!t||!fS(t)){this._draggedRange=Ag.fromRange(s.getFirstRange())}}if(!this._draggedRange){r.preventDefault();return}this._draggingUid=a();r.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy";r.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const l=e.createSelection(this._draggedRange.toRange());const d=t.data.toView(e.getSelectedContent(l));o.fire("clipboardOutput",{dataTransfer:r.dataTransfer,content:d,method:i.name});if(!this.isEnabled){this._draggedRange.detach();this._draggedRange=null;this._draggingUid=""}}),{priority:"low"});this.listenTo(o,"dragend",((t,e)=>{this._finalizeDragging(!e.dataTransfer.isCanceled&&e.dataTransfer.dropEffect=="move")}),{priority:"low"});this.listenTo(o,"dragenter",(()=>{if(!this.isEnabled){return}i.focus()}));this.listenTo(o,"dragleave",(()=>{this._removeDropMarkerDelayed()}));this.listenTo(o,"dragging",((e,n)=>{if(!this.isEnabled){n.dataTransfer.dropEffect="none";return}this._removeDropMarkerDelayed.cancel();const i=uT(t,n.targetRanges,n.target);if(!this._draggedRange){n.dataTransfer.dropEffect="copy"}if(!Yl.isGecko){if(n.dataTransfer.effectAllowed=="copy"){n.dataTransfer.dropEffect="copy"}else if(["all","copyMove"].includes(n.dataTransfer.effectAllowed)){n.dataTransfer.dropEffect="move"}}if(i){this._updateDropMarkerThrottled(i)}}),{priority:"low"})}_setupClipboardInputIntegration(){const t=this.editor;const e=t.editing.view;const n=e.document;this.listenTo(n,"clipboardInput",((e,n)=>{if(n.method!="drop"){return}const i=uT(t,n.targetRanges,n.target);this._removeDropMarker();if(!i){this._finalizeDragging(false);e.stop();return}if(this._draggedRange&&this._draggingUid!=n.dataTransfer.getData("application/ckeditor5-dragging-uid")){this._draggedRange.detach();this._draggedRange=null;this._draggingUid=""}const o=kT(n.dataTransfer)=="move";if(o&&this._draggedRange&&this._draggedRange.containsRange(i,true)){this._finalizeDragging(false);e.stop();return}n.targetRanges=[t.editing.mapper.toViewRange(i)]}),{priority:"high"})}_setupContentInsertionIntegration(){const t=this.editor.plugins.get(rS);t.on("contentInsertion",((t,e)=>{if(!this.isEnabled||e.method!=="drop"){return}const n=e.targetRanges.map((t=>this.editor.editing.mapper.toModelRange(t)));this.editor.model.change((t=>t.setSelection(n)))}),{priority:"high"});t.on("contentInsertion",((t,e)=>{if(!this.isEnabled||e.method!=="drop"){return}const n=kT(e.dataTransfer)=="move";const i=!e.resultRange||!e.resultRange.isCollapsed;this._finalizeDragging(i&&n)}),{priority:"lowest"})}_setupDraggableAttributeHandling(){const t=this.editor;const e=t.editing.view;const n=e.document;this.listenTo(n,"mousedown",((i,o)=>{if(Yl.isAndroid||!o){return}this._clearDraggableAttributesDelayed.cancel();let r=wT(o.target);if(Yl.isBlink&&!t.isReadOnly&&!r&&!n.selection.isCollapsed){const t=n.selection.getSelectedElement();if(!t||!fS(t)){r=n.selection.editableElement}}if(r){e.change((t=>{t.setAttribute("draggable","true",r)}));this._draggableElement=t.editing.mapper.toModelElement(r)}}));this.listenTo(n,"mouseup",(()=>{if(!Yl.isAndroid){this._clearDraggableAttributesDelayed()}}))}_clearDraggableAttributes(){const t=this.editor.editing;t.view.change((e=>{if(this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"){e.removeAttribute("draggable",t.mapper.toViewElement(this._draggableElement))}this._draggableElement=null}))}_setupDropMarker(){const t=this.editor;t.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}});t.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(e,{writer:n})=>{const i=t.model.schema.checkChild(e.markerRange.start,"$text");if(!i){return}return n.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},(function(t){const e=this.toDomElement(t);e.innerHTML="⁠⁠";return e}))}})}_updateDropMarker(t){const e=this.editor;const n=e.model.markers;e.model.change((e=>{if(n.has("drop-target")){if(!n.get("drop-target").getRange().isEqual(t)){e.updateMarker("drop-target",{range:t})}}else{e.addMarker("drop-target",{range:t,usingOperation:false,affectsData:false})}}))}_removeDropMarker(){const t=this.editor.model;this._removeDropMarkerDelayed.cancel();this._updateDropMarkerThrottled.cancel();if(t.markers.has("drop-target")){t.change((t=>{t.removeMarker("drop-target")}))}}_finalizeDragging(t){const e=this.editor;const n=e.model;this._removeDropMarker();this._clearDraggableAttributes();if(e.plugins.has("WidgetToolbarRepository")){e.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop")}this._draggingUid="";if(!this._draggedRange){return}if(t&&this.isEnabled){n.deleteContent(n.createSelection(this._draggedRange),{doNotAutoparagraph:true})}this._draggedRange.detach();this._draggedRange=null}}function uT(t,e,n){const i=t.model;const o=t.editing.mapper;let r=null;const s=e?e[0].start:null;if(n.is("uiElement")){n=n.parent}r=hT(t,n);if(r){return r}const a=pT(t,n);const c=s?o.toModelPosition(s):null;if(!c){return fT(t,a)}r=gT(t,c,a);if(r){return r}r=i.schema.getNearestSelectionRange(c,Yl.isGecko?"forward":"backward");if(r){return r}return mT(t,c.parent)}function hT(t,e){const n=t.model;const i=t.editing.mapper;if(fS(e)){return n.createRangeOn(i.toModelElement(e))}if(!e.is("editableElement")){const t=e.findAncestor((t=>fS(t)||t.is("editableElement")));if(fS(t)){return n.createRangeOn(i.toModelElement(t))}}return null}function fT(t,e){const n=t.model;const i=n.schema;const o=n.createPositionAt(e,0);return i.getNearestSelectionRange(o,"forward")}function gT(t,e,n){const i=t.model;if(!i.schema.checkChild(n,"$block")){return null}const o=i.createPositionAt(n,0);const r=e.path.slice(0,o.path.length);const s=i.createPositionFromPath(e.root,r);const a=s.nodeAfter;if(a&&i.schema.isObject(a)){return i.createRangeOn(a)}return null}function mT(t,e){const n=t.model;while(e){if(n.schema.isObject(e)){return n.createRangeOn(e)}e=e.parent}}function pT(t,e){const n=t.editing.mapper;const i=t.editing.view;const o=n.toModelElement(e);if(o){return o}const r=i.createPositionBefore(e);const s=n.findMappedViewAncestor(r);return n.toModelElement(s)}function kT(t){if(Yl.isGecko){return t.dropEffect}return["all","copyMove"].includes(t.effectAllowed)?"move":"copy"}function bT(t,e){let n;function i(...o){i.cancel();n=setTimeout((()=>t(...o)),e)}i.cancel=()=>{clearTimeout(n)};return i}function wT(t){if(t.is("editableElement")){return null}if(t.hasClass("ck-widget__selection-handle")){return t.findAncestor(fS)}if(fS(t)){return t}const e=t.findAncestor((t=>fS(t)||t.is("editableElement")));if(fS(e)){return e}return null}class AT extends Un{static get pluginName(){return"PastePlainText"}static get requires(){return[rS]}init(){const t=this.editor;const e=t.model;const n=t.editing.view;const i=n.document;const o=e.document.selection;let r=false;n.addObserver(XD);this.listenTo(i,"keydown",((t,e)=>{r=e.shiftKey}));t.plugins.get(rS).on("contentInsertion",((t,n)=>{if(!r&&!CT(n.content,e.schema)){return}e.change((t=>{const i=Array.from(o.getAttributes()).filter((([t])=>e.schema.getAttributeProperties(t).isFormatting));if(!o.isCollapsed){e.deleteContent(o,{doNotAutoparagraph:true})}i.push(...o.getAttributes());const r=t.createRangeIn(n.content);for(const e of r.getItems()){if(e.is("$textProxy")){t.setAttributes(i,e)}}}))}))}}function CT(t,e){if(t.childCount>1){return false}const n=t.getChild(0);if(e.isObject(n)){return false}return[...n.getAttributeKeys()].length==0}class vT extends Un{static get pluginName(){return"Clipboard"}static get requires(){return[rS,dT,AT]}}class _T extends qn{constructor(t){super(t);this.affectsData=false}execute(){const t=this.editor.model;const e=t.document.selection;let n=t.schema.getLimitElement(e);if(e.containsEntireContent(n)||!yT(t.schema,n)){do{n=n.parent;if(!n){return}}while(!yT(t.schema,n))}t.change((t=>{t.setSelection(n,"in")}))}}function yT(t,e){return t.isLimit(e)&&(t.checkChild(e,"$text")||t.checkChild(e,"paragraph"))}const xT=ld("Ctrl+A");class ET extends Un{static get pluginName(){return"SelectAllEditing"}init(){const t=this.editor;const e=t.editing.view;const n=e.document;t.commands.add("selectAll",new _T(t));this.listenTo(n,"keydown",((e,n)=>{if(cd(n)===xT){t.execute("selectAll");n.preventDefault()}}))}}var DT='';class ST extends Un{static get pluginName(){return"SelectAllUI"}init(){const t=this.editor;t.ui.componentFactory.add("selectAll",(e=>{const n=t.commands.get("selectAll");const i=new zw(e);const o=e.t;i.set({label:o("Select all"),icon:DT,keystroke:"Ctrl+A",tooltip:true});i.bind("isOn","isEnabled").to(n,"value","isEnabled");this.listenTo(i,"execute",(()=>{t.execute("selectAll");t.editing.view.focus()}));return i}))}}class TT extends Un{static get requires(){return[ET,ST]}static get pluginName(){return"SelectAll"}}class IT extends qn{constructor(t){super(t);this._stack=[];this._createdBatches=new WeakSet;this.refresh();this.listenTo(t.data,"set",((t,e)=>{e[1]={...e[1]};const n=e[1];if(n.batchType){return}n.batchType="transparent"}),{priority:"high"});this.listenTo(t.data,"set",((t,e)=>{const n=e[1];if(n.batchType==="transparent"){this.clearStack()}}))}refresh(){this.isEnabled=this._stack.length>0}addBatch(t){const e=this.editor.model.document.selection;const n={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:n});this.refresh()}clearStack(){this._stack=[];this.refresh()}_restoreSelection(t,e,n){const i=this.editor.model;const o=i.document;const r=[];const s=t.map((t=>t.getTransformedByOperations(n)));const a=s.flat();for(const t of s){const e=t.filter((t=>t.root!=o.graveyard)).filter((t=>!BT(t,a)));if(!e.length){continue}MT(e);r.push(e[0])}if(r.length){i.change((t=>{t.setSelection(r,{backward:e})}))}}_undo(t,e){const n=this.editor.model;const i=n.document;this._createdBatches.add(e);const o=t.operations.slice().filter((t=>t.isDocumentOperation));o.reverse();for(const t of o){const o=t.baseVersion+1;const r=Array.from(i.history.getOperations(o));const s=Rv([t.getReversed()],r,{useRelations:true,document:this.editor.model.document,padWithNoOps:false,forceWeakRemove:true});const a=s.operationsA;for(const o of a){e.addOperation(o);n.applyOperation(o);i.history.setOperationAsUndone(t,o)}}}}function MT(t){t.sort(((t,e)=>t.start.isBefore(e.start)?-1:1));for(let e=1;ee!==t&&e.containsRange(t,true)))}class NT extends IT{execute(t=null){const e=t?this._stack.findIndex((e=>e.batch==t)):this._stack.length-1;const n=this._stack.splice(e,1)[0];const i=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(i,(()=>{this._undo(n.batch,i);const t=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,t);this.fire("revert",n.batch,i)}));this.refresh()}}class zT extends IT{execute(){const t=this._stack.pop();const e=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(e,(()=>{const n=t.batch.operations[t.batch.operations.length-1];const i=n.baseVersion+1;const 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 PT extends Un{static get pluginName(){return"UndoEditing"}constructor(t){super(t);this._batchRegistry=new WeakSet}init(){const t=this.editor;this._undoCommand=new NT(t);this._redoCommand=new zT(t);t.commands.add("undo",this._undoCommand);t.commands.add("redo",this._redoCommand);this.listenTo(t.model,"applyOperation",((t,e)=>{const n=e[0];if(!n.isDocumentOperation){return}const i=n.batch;const o=this._redoCommand._createdBatches.has(i);const r=this._undoCommand._createdBatches.has(i);const s=this._batchRegistry.has(i);if(s||i.type=="transparent"&&!o&&!r){return}else{if(o){this._undoCommand.addBatch(i)}else if(!r){this._undoCommand.addBatch(i);this._redoCommand.clearStack()}}this._batchRegistry.add(i)}),{priority:"highest"});this.listenTo(this._undoCommand,"revert",((t,e,n)=>{this._redoCommand.addBatch(n)}));t.keystrokes.set("CTRL+Z","undo");t.keystrokes.set("CTRL+Y","redo");t.keystrokes.set("CTRL+SHIFT+Z","redo")}}var LT='';var RT='';class OT extends Un{static get pluginName(){return"UndoUI"}init(){const t=this.editor;const e=t.locale;const n=t.t;const i=e.uiLanguageDirection=="ltr"?LT:RT;const o=e.uiLanguageDirection=="ltr"?RT:LT;this._addButton("undo",n("Undo"),"CTRL+Z",i);this._addButton("redo",n("Redo"),"CTRL+Y",o)}_addButton(t,e,n,i){const o=this.editor;o.ui.componentFactory.add(t,(r=>{const s=o.commands.get(t);const a=new zw(r);a.set({label:e,icon:i,keystroke:n,tooltip:true});a.bind("isEnabled").to(s,"isEnabled");this.listenTo(a,"execute",(()=>{o.execute(t);o.editing.view.focus()}));return a}))}}class jT extends Un{static get requires(){return[PT,OT]}static get pluginName(){return"Undo"}}class FT extends Un{static get requires(){return[vT,nE,TT,cE,ly,jT]}static get pluginName(){return"Essentials"}}var VT=n(44);var UT={injectType:"singletonStyleTag",attributes:{"data-cke":true}};UT.insert="head";UT.singleton=true;var HT=ru()(VT["a"],UT);var qT=VT["a"].locals||{};var WT=n(45);var GT={injectType:"singletonStyleTag",attributes:{"data-cke":true}};GT.insert="head";GT.singleton=true;var KT=ru()(WT["a"],GT);var $T=WT["a"].locals||{};class YT extends Wb{constructor(t){super(t);const e=t.t;this.set("matchCount",0);this.set("highlightOffset",0);this.set("isDirty",false);this.set("_areCommandsEnabled",{});this.set("_resultsCounterText","");this.set("_matchCase",false);this.set("_wholeWordsOnly",false);this.bind("_searchResultsFound").to(this,"matchCount",this,"isDirty",((t,e)=>t>0&&!e));this._findInputView=this._createInputField(e("Find in text鈥"));this._replaceInputView=this._createInputField(e("Replace with鈥"));this._findButtonView=this._createButton({label:e("Find"),class:"ck-button-find ck-button-action",withText:true});this._findPrevButtonView=this._createButton({label:e("Previous result"),class:"ck-button-prev",icon:VC,keystroke:"Shift+F3",tooltip:true});this._findNextButtonView=this._createButton({label:e("Next result"),class:"ck-button-next",icon:VC,keystroke:"F3",tooltip:true});this._optionsDropdown=this._createOptionsDropdown();this._replaceButtonView=this._createButton({label:e("Replace"),class:"ck-button-replace",withText:true});this._replaceAllButtonView=this._createButton({label:e("Replace all"),class:"ck-button-replaceall",withText:true});this._findFieldsetView=this._createFindFieldset();this._replaceFieldsetView=this._createReplaceFieldset();this._focusTracker=new Mf;this._keystrokes=new Bf;this._focusables=new jb;this._focusCycler=new Ww({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this._keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});this.setTemplate({tag:"form",attributes:{class:["ck","ck-find-and-replace-form"],tabindex:"-1"},children:[new mC(t,{label:e("Find and replace")}),this._findFieldsetView,this._replaceFieldsetView]});Rb(this)}render(){super.render();Ob({view:this});this._initFocusCycling();this._initKeystrokeHandling()}destroy(){super.destroy();this._focusTracker.destroy();this._keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}reset(){this._findInputView.errorText=null;this.isDirty=true}get _textToFind(){return this._findInputView.fieldView.element.value}get _textToReplace(){return this._replaceInputView.fieldView.element.value}_createFindFieldset(){const t=this.locale;const e=new Wb(t);this._findInputView.fieldView.on("input",(()=>{this.isDirty=true}));this._findButtonView.on("execute",this._onFindButtonExecute.bind(this));this._findPrevButtonView.delegate("execute").to(this,"findPrevious");this._findNextButtonView.delegate("execute").to(this,"findNext");this._findPrevButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",(({findPrevious:t})=>t));this._findNextButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",(({findNext:t})=>t));this._injectFindResultsCounter();e.setTemplate({tag:"fieldset",attributes:{class:["ck","ck-find-and-replace-form__find"]},children:[this._findInputView,this._findButtonView,this._findPrevButtonView,this._findNextButtonView]});return e}_onFindButtonExecute(){if(!this._textToFind){const t=this.t;this._findInputView.errorText=t("Text to find must not be empty.");return}this.isDirty=false;this.fire("findNext",{searchText:this._textToFind,matchCase:this._matchCase,wholeWords:this._wholeWordsOnly})}_injectFindResultsCounter(){const t=this.locale;const e=t.t;const n=this.bindTemplate;const i=new Wb(t);this.bind("_resultsCounterText").to(this,"highlightOffset",this,"matchCount",((t,n)=>e("%0 of %1",[t,n])));i.setTemplate({tag:"span",attributes:{class:["ck","ck-results-counter",n.if("isDirty","ck-hidden")]},children:[{text:n.to("_resultsCounterText")}]});const o=()=>{const e=this._findInputView.fieldView.element;if(!e||!e.offsetParent){return}const n=new vf(i.element).width;const o=t.uiLanguageDirection==="ltr"?"paddingRight":"paddingLeft";if(!n){e.style[o]=null}else{e.style[o]=`calc( 2 * var(--ck-spacing-standard) + ${n}px )`}};this.on("change:_resultsCounterText",o,{priority:"low"});this.on("change:isDirty",o,{priority:"low"});this._findInputView.template.children[0].children.push(i)}_createReplaceFieldset(){const t=this.locale;const e=t.t;const n=new Wb(t);this._replaceButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",(({replace:t},e)=>t&&e));this._replaceAllButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",(({replaceAll:t},e)=>t&&e));this._replaceInputView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",(({replace:t},e)=>t&&e));this._replaceInputView.bind("infoText").to(this._replaceInputView,"isEnabled",this._replaceInputView,"isFocused",((t,n)=>{if(t||!n){return""}return e("Tip: Find some text first in order to replace it.")}));this._replaceButtonView.on("execute",(()=>{this.fire("replace",{searchText:this._textToFind,replaceText:this._textToReplace})}));this._replaceAllButtonView.on("execute",(()=>{this.fire("replaceAll",{searchText:this._textToFind,replaceText:this._textToReplace});this.focus()}));n.setTemplate({tag:"fieldset",attributes:{class:["ck","ck-find-and-replace-form__replace"]},children:[this._replaceInputView,this._optionsDropdown,this._replaceButtonView,this._replaceAllButtonView]});return n}_createOptionsDropdown(){const t=this.locale;const e=t.t;const n=WA(t);n.class="ck-options-dropdown";n.buttonView.set({withText:false,label:e("Show options"),icon:Pb.cog,tooltip:true});const i=new MC({withText:true,label:e("Match case"),_isMatchCaseSwitch:true});const o=new MC({withText:true,label:e("Whole words only")});i.bind("isOn").to(this,"_matchCase");o.bind("isOn").to(this,"_wholeWordsOnly");n.on("execute",(t=>{if(t.source._isMatchCaseSwitch){this._matchCase=!this._matchCase}else{this._wholeWordsOnly=!this._wholeWordsOnly}this.isDirty=true}));KA(n,new ba([{type:"switchbutton",model:i},{type:"switchbutton",model:o}]));return n}_initFocusCycling(){const t=[this._findInputView,this._findButtonView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView,this._optionsDropdown,this._replaceButtonView,this._replaceAllButtonView];t.forEach((t=>{this._focusables.add(t);this._focusTracker.add(t.element)}))}_initKeystrokeHandling(){const t=t=>t.stopPropagation();const e=t=>{t.stopPropagation();t.preventDefault()};this._keystrokes.listenTo(this.element);this._keystrokes.set("f3",(t=>{e(t);this._findNextButtonView.fire("execute")}));this._keystrokes.set("shift+f3",(t=>{e(t);this._findPrevButtonView.fire("execute")}));this._keystrokes.set("enter",(t=>{const n=t.target;if(n===this._findInputView.fieldView.element){if(this._areCommandsEnabled.findNext){this._findNextButtonView.fire("execute")}else{this._findButtonView.fire("execute")}e(t)}else if(n===this._replaceInputView.fieldView.element&&!this.isDirty){this._replaceButtonView.fire("execute");e(t)}}));this._keystrokes.set("shift+enter",(t=>{const n=t.target;if(n!==this._findInputView.fieldView.element){return}if(this._areCommandsEnabled.findPrevious){this._findPrevButtonView.fire("execute")}else{this._findButtonView.fire("execute")}e(t)}));this._keystrokes.set("arrowright",t);this._keystrokes.set("arrowleft",t);this._keystrokes.set("arrowup",t);this._keystrokes.set("arrowdown",t);this.listenTo(this._findInputView.element,"selectstart",((t,e)=>{e.stopPropagation()}),{priority:"high"});this.listenTo(this._replaceInputView.element,"selectstart",((t,e)=>{e.stopPropagation()}),{priority:"high"})}_createButton(t){const e=new zw(this.locale);e.set(t);return e}_createInputField(t){const e=new DC(this.locale,SC);e.label=t;return e}}var QT='';class ZT extends Un{static get pluginName(){return"FindAndReplaceUI"}constructor(t){super(t);this.formView=null}init(){const t=this.editor;t.ui.componentFactory.add("findAndReplace",(e=>{const n=WA(e);const i=this.formView=new YT(t.locale);n.bind("isEnabled").to(t.commands.get("find"));n.panelView.children.add(i);n.on("change:isOpen",((t,e,n)=>{if(n){i.disableCssTransitions();i.reset();i._findInputView.fieldView.select();i.focus();i.enableCssTransitions()}else{i.focus();this.fire("searchReseted")}}),{priority:"low"});this._setupDropdownButton(n);this._setupFormView(i);return n}))}_setupDropdownButton(t){const e=this.editor;const n=e.locale.t;t.buttonView.set({icon:QT,label:n("Find and replace"),keystroke:"CTRL+F",tooltip:true});e.keystrokes.set("Ctrl+F",((e,n)=>{t.isOpen=true;n()}))}_setupFormView(t){const e=this.editor;const n=e.commands;const i=this.editor.plugins.get("FindAndReplaceEditing");const o=i.state;const r={before:-1,same:0,after:1};t.bind("highlightOffset").to(o,"highlightedResult",(t=>{if(!t){return 0}return Array.from(o.results).sort(((t,e)=>r[t.marker.getStart().compareWith(e.marker.getStart())])).indexOf(t)+1}));t.listenTo(o.results,"change",(()=>{t.matchCount=o.results.length}));t.bind("_areCommandsEnabled").to(n.get("findNext"),"isEnabled",n.get("findPrevious"),"isEnabled",n.get("replace"),"isEnabled",n.get("replaceAll"),"isEnabled",((t,e,n,i)=>({findNext:t,findPrevious:e,replace:n,replaceAll:i})));t.delegate("findNext","findPrevious","replace","replaceAll").to(this);t.on("change:isDirty",((t,e,n)=>{if(n){this.fire("searchReseted")}}))}}function JT(t,e,n,i){const o=i||new ba;e.change((i=>{[...t].forEach((({type:t,item:r})=>{if(t==="elementStart"){if(e.schema.checkChild(r,"$text")){const t=n({item:r,text:XT(e.createRangeIn(r))});if(!t){return}t.forEach((t=>{const e=`findResult:${a()}`;const n=i.addMarker(e,{usingOperation:false,affectsData:false,range:i.createRange(i.createPositionAt(r,t.start),i.createPositionAt(r,t.end))});const s=tI(o,n);o.add({id:e,label:t.label,marker:n},s)}))}}}))}));return o}function XT(t){return Array.from(t.getItems()).reduce(((t,e)=>{if(!(e.is("text")||e.is("textProxy"))){return`${t}\n`}return t+e.data}),"")}function tI(t,e){const n=t.find((({marker:t})=>e.getStart().isBefore(t.getStart())));return n?t.getIndex(n):t.length}function eI(t){const e=t.length-1;let n=t.index;if(t.length===3){n+=t[1].length}return{label:t[e],start:n,end:n+t[e].length}}function nI(t,e){let n="gu";if(!e.matchCase){n+="i"}let i=`(${Cy(t)})`;if(e.wholeWords){const e="[^a-zA-Z脌-蓮岣-峄縘";if(!new RegExp("^"+e).test(t)){i=`(^|${e}|_)${i}`}if(!new RegExp(e+"$").test(t)){i=`${i}(?=_|${e}|$)`}}const o=new RegExp(i,n);function r({text:t}){const e=[...t.matchAll(o)];return e.map(eI)}return r}class iI extends qn{constructor(t,e){super(t);this.isEnabled=true;this.affectsData=false;this._state=e}execute(t,{matchCase:e,wholeWords:n}={}){const{editor:i}=this;const{model:o}=i;let r;if(typeof t==="string"){r=nI(t,{matchCase:e,wholeWords:n});this._state.searchText=t}else{r=t}const s=o.document.getRootNames().reduce(((t,e)=>JT(o.createRangeIn(o.document.getRoot(e)),o,r,t)),null);this._state.clear(o);this._state.results.addMany(Array.from(s));this._state.highlightedResult=s.get(0);if(typeof t==="string"){this._state.searchText=t}this._state.matchCase=!!e;this._state.matchWholeWords=!!n;return{results:s,findCallback:r}}}class oI extends qn{constructor(t,e){super(t);this.isEnabled=true;this._state=e}execute(t,e){const{model:n}=this.editor;n.change((i=>{const o=e.marker.getRange();if(o.root.rootName==="$graveyard"){this._state.results.remove(e);return}let r={};for(const t of o.getItems()){if(t.is("$text")||t.is("$textProxy")){r=t.getAttributes();break}}n.insertContent(i.createText(t,r),o);if(this._state.results.has(e)){this._state.results.remove(e)}}))}}class rI extends oI{execute(t,e){const{editor:n}=this;const{model:i}=n;const o=e instanceof ba?e:i.document.getRootNames().reduce(((t,n)=>JT(i.createRangeIn(i.document.getRoot(n)),i,nI(e,this._state),t)),null);if(o.length){i.change((()=>{[...o].forEach((e=>{super.execute(t,e)}))}))}}}class sI extends qn{constructor(t,e){super(t);this.affectsData=false;this._state=e;this.isEnabled=false;this.listenTo(this._state.results,"change",(()=>{this.isEnabled=this._state.results.length>1}))}refresh(){this.isEnabled=this._state.results.length>1}execute(){const t=this._state.results;const e=t.getIndex(this._state.highlightedResult);const n=e+1>=t.length?0:e+1;this._state.highlightedResult=this._state.results.get(n)}}class aI extends sI{execute(){const t=this._state.results;const e=t.getIndex(this._state.highlightedResult);const n=e-1<0?this._state.results.length-1:e-1;this._state.highlightedResult=this._state.results.get(n)}}class cI{constructor(t){this.set("results",new ba);this.set("highlightedResult",null);this.set("searchText","");this.set("replaceText","");this.set("matchCase",false);this.set("matchWholeWords",false);this.results.on("change",((e,{removed:n,index:i})=>{n=Array.from(n);if(n.length){let e=false;t.change((i=>{for(const o of n){if(this.highlightedResult===o){e=true}if(t.markers.has(o.marker.name)){i.removeMarker(o.marker)}}}));if(e){const t=i>=this.results.length?0:i;this.highlightedResult=this.results.get(t)}}}))}clear(t){this.searchText="";t.change((e=>{if(this.highlightedResult){const n=this.highlightedResult.marker.name.split(":")[1];const i=t.markers.get(`findResultHighlighted:${n}`);if(i){e.removeMarker(i)}}[...this.results].forEach((({marker:t})=>{e.removeMarker(t)}))}));this.results.clear()}}Vn(cI,In);var lI=n(46);var dI={injectType:"singletonStyleTag",attributes:{"data-cke":true}};dI.insert="head";dI.singleton=true;var uI=ru()(lI["a"],dI);var hI=lI["a"].locals||{};const fI="ck-find-result_selected";function gI(t,e,n){const i=new Set;const o=new Set;const r=e.document.differ.getChanges();r.forEach((t=>{if(t.name==="$text"||e.schema.isInline(t.position.nodeAfter)){i.add(t.position.parent);[...e.markers.getMarkersAtPosition(t.position)].forEach((t=>{o.add(t.name)}))}else if(t.type==="insert"){i.add(t.position.nodeAfter)}}));e.document.differ.getChangedMarkers().forEach((({name:t,data:{newRange:e}})=>{if(e&&e.start.root.rootName==="$graveyard"){o.add(t)}}));i.forEach((t=>{const n=[...e.markers.getMarkersIntersectingRange(e.createRangeIn(t))];n.forEach((t=>o.add(t.name)))}));e.change((e=>{o.forEach((n=>{if(t.has(n)){t.remove(n)}e.removeMarker(n)}))}));i.forEach((i=>{JT(e.createRangeOn(i),e,n,t)}))}class mI extends Un{static get pluginName(){return"FindAndReplaceEditing"}init(){this._activeResults=null;this.state=new cI(this.editor.model);this._defineConverters();this._defineCommands();this.listenTo(this.state,"change:highlightedResult",((t,e,n,i)=>{const{model:o}=this.editor;o.change((t=>{if(i){const e=i.marker.name.split(":")[1];const n=o.markers.get(`findResultHighlighted:${e}`);if(n){t.removeMarker(n)}}if(n){const e=n.marker.name.split(":")[1];t.addMarker(`findResultHighlighted:${e}`,{usingOperation:false,affectsData:false,range:n.marker.getRange()})}}))}));const t=af(e.bind(this),32);this.listenTo(this.state,"change:highlightedResult",t,{priority:"low"});this.listenTo(this.editor,"destroy",t.cancel);function e(t,e,n){if(n){const t=this.editor.editing.view.domConverter;const e=this.editor.editing.mapper.toViewRange(n.marker.getRange());Pf({target:t.viewRangeToDom(e),viewportOffset:40})}}}find(t){const{editor:e}=this;const{model:n}=e;const{findCallback:i,results:o}=e.execute("find",t);this._activeResults=o;this.listenTo(n.document,"change:data",(()=>gI(this._activeResults,n,i)));return this._activeResults}stop(){if(!this._activeResults){return}this.stopListening(this.editor.model.document);this.state.clear(this.editor.model);this._activeResults=null}_defineCommands(){this.editor.commands.add("find",new iI(this.editor,this.state));this.editor.commands.add("findNext",new sI(this.editor,this.state));this.editor.commands.add("findPrevious",new aI(this.editor,this.state));this.editor.commands.add("replace",new oI(this.editor,this.state));this.editor.commands.add("replaceAll",new rI(this.editor,this.state))}_defineConverters(){const{editor:t}=this;t.conversion.for("editingDowncast").markerToHighlight({model:"findResult",view:({markerName:t})=>{const[,e]=t.split(":");return{name:"span",classes:["ck-find-result"],attributes:{"data-find-result":e}}}});t.conversion.for("editingDowncast").markerToHighlight({model:"findResultHighlighted",view:({markerName:t})=>{const[,e]=t.split(":");return{name:"span",classes:[fI],attributes:{"data-find-result":e}}}})}}class pI extends Un{static get requires(){return[mI,ZT]}static get pluginName(){return"FindAndReplace"}init(){const t=this.editor.plugins.get("FindAndReplaceUI");const e=this.editor.plugins.get("FindAndReplaceEditing");const n=e.state;t.on("findNext",((t,e)=>{if(e){n.searchText=e.searchText;this.editor.execute("find",e.searchText,e)}else{this.editor.execute("findNext")}}));t.on("findPrevious",((t,e)=>{if(e&&n.searchText!==e.searchText){this.editor.execute("find",e.searchText)}else{this.editor.execute("findPrevious")}}));t.on("replace",((t,e)=>{if(n.searchText!==e.searchText){this.editor.execute("find",e.searchText)}const i=n.highlightedResult;if(i){this.editor.execute("replace",e.replaceText,i)}}));t.on("replaceAll",((t,e)=>{if(n.searchText!==e.searchText){this.editor.execute("find",e.searchText)}this.editor.execute("replaceAll",e.replaceText,n.results)}));t.on("searchReseted",(()=>{n.clear(this.editor.model);e.stop()}))}}class kI extends qn{constructor(t,e){super(t);this.attributeKey=e}refresh(){const t=this.editor.model;const 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;const n=e.document;const i=n.selection;const o=t.value;e.change((t=>{if(i.isCollapsed){if(o){t.setSelectionAttribute(this.attributeKey,o)}else{t.removeSelectionAttribute(this.attributeKey)}}else{const n=e.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const e of n){if(o){t.setAttribute(this.attributeKey,o,e)}else{t.removeAttribute(this.attributeKey,e)}}}}))}}class bI extends ba{constructor(t){super(t);this.set("isEmpty",true);this.on("change",(()=>{this.set("isEmpty",this.length===0)}))}add(t,e){if(this.find((e=>e.color===t.color))){return}super.add(t,e)}hasColor(t){return!!this.find((e=>e.color===t))}}Vn(bI,In);var wI=n(47);var AI={injectType:"singletonStyleTag",attributes:{"data-cke":true}};AI.insert="head";AI.singleton=true;var CI=ru()(wI["a"],AI);var vI=wI["a"].locals||{};class _I extends Wb{constructor(t,{colors:e,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r}){super(t);this.items=this.createCollection();this.colorDefinitions=e;this.focusTracker=new Mf;this.keystrokes=new Bf;this.set("selectedColor");this.removeButtonLabel=i;this.columns=n;this.documentColors=new bI;this.documentColorsCount=r;this._focusCycler=new Ww({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(t,e){const n=t.document;const i=this.documentColorsCount;this.documentColors.clear();for(const o of n.getRootNames()){const r=n.getRoot(o);const s=t.createRangeIn(r);for(const t of s.getItems()){if(t.is("$textProxy")&&t.hasAttribute(e)){this._addColorToDocumentColors(t.getAttribute(e));if(this.documentColors.length>=i){return}}}}}updateSelectedColors(){const t=this.documentColorsGrid;const e=this.staticColorsGrid;const n=this.selectedColor;e.selectedColor=n;if(t){t.selectedColor=n}}render(){super.render();for(const t of this.items){this.focusTracker.add(t.element)}this.keystrokes.listenTo(this.element)}destroy(){super.destroy();this.focusTracker.destroy();this.keystrokes.destroy()}appendGrids(){if(this.staticColorsGrid){return}this.staticColorsGrid=this._createStaticColorsGrid();this.items.add(this.staticColorsGrid);if(this.documentColorsCount){const t=Kb.bind(this.documentColors,this.documentColors);const e=new aC(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 zw;t.set({withText:true,icon:Pb.eraser,tooltip:true,label:this.removeButtonLabel});t.class="ck-color-table__remove-color";t.on("execute",(()=>{this.fire("execute",{value:null})}));return t}_createStaticColorsGrid(){const t=new Zw(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});t.delegate("execute").to(this);return t}_createDocumentColorsGrid(){const t=Kb.bind(this.documentColors,this.documentColors);const e=new Zw(this.locale,{columns:this.columns});e.delegate("execute").to(this);e.extendTemplate({attributes:{class:t.if("isEmpty","ck-hidden")}});e.items.bindTo(this.documentColors).using((t=>{const e=new qw;e.set({color:t.color,hasBorder:t.options&&t.options.hasBorder});if(t.label){e.set({label:t.label,tooltip:true})}e.on("execute",(()=>{this.fire("execute",{value:t.color})}));return e}));this.documentColors.on("change:isEmpty",((t,n,i)=>{if(i){e.selectedColor=null}}));return e}_addColorToDocumentColors(t){const e=this.colorDefinitions.find((e=>e.color===t));if(!e){this.documentColors.add({color:t,label:t,options:{hasBorder:false}})}else{this.documentColors.add(Object.assign({},e))}}}const yI="fontSize";const xI="fontFamily";const EI="fontColor";const DI="fontBackgroundColor";function SI(t,e){const n={model:{key:t,values:[]},view:{},upcastAlso:{}};for(const t of e){n.model.values.push(t.model);n.view[t.model]=t.view;if(t.upcastAlso){n.upcastAlso[t.model]=t.upcastAlso}}return n}function TI(t){return e=>BI(e.getStyle(t))}function II(t){return(e,{writer:n})=>n.createAttributeElement("span",{style:`${t}:${e}`},{priority:7})}function MI({dropdownView:t,colors:e,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r}){const s=t.locale;const a=new _I(s,{colors:e,columns:n,removeButtonLabel:i,documentColorsLabel:o,documentColorsCount:r});t.colorTableView=a;t.panelView.children.add(a);a.delegate("execute").to(t,"execute");return a}function BI(t){return t.replace(/\s/g,"")}class NI extends kI{constructor(t){super(t,DI)}}class zI extends Un{static get pluginName(){return"FontBackgroundColorEditing"}constructor(t){super(t);t.config.define(DI,{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});t.data.addStyleProcessorRules(A_);t.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:DI,value:TI("background-color")}});t.conversion.for("downcast").attributeToElement({model:DI,view:II("background-color")});t.commands.add(DI,new NI(t));t.model.schema.extend("$text",{allowAttributes:DI});t.model.schema.setAttributeProperties(DI,{isFormatting:true,copyOnEnter:true})}}class PI extends Un{constructor(t,{commandName:e,icon:n,componentName:i,dropdownLabel:o}){super(t);this.commandName=e;this.componentName=i;this.icon=n;this.dropdownLabel=o;this.columns=t.config.get(`${this.componentName}.columns`);this.colorTableView=undefined}init(){const t=this.editor;const e=t.locale;const n=e.t;const i=t.commands.get(this.commandName);const o=Vw(t.config.get(this.componentName).colors);const r=Fw(e,o);const s=t.config.get(`${this.componentName}.documentColors`);t.ui.componentFactory.add(this.componentName,(e=>{const o=WA(e);this.colorTableView=MI({dropdownView:o,colors:r.map((t=>({label:t.label,color:t.model,options:{hasBorder:t.hasBorder}}))),columns:this.columns,removeButtonLabel:n("Remove color"),documentColorsLabel:s!==0?n("Document colors"):undefined,documentColorsCount:s===undefined?this.columns:s});this.colorTableView.bind("selectedColor").to(i,"value");o.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:true});o.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}});o.bind("isEnabled").to(i);o.on("execute",((e,n)=>{t.execute(this.commandName,n);t.editing.view.focus()}));o.on("change:isOpen",((e,n,i)=>{o.colorTableView.appendGrids();if(i){if(s!==0){this.colorTableView.updateDocumentColors(t.model,this.componentName)}this.colorTableView.updateSelectedColors()}}));return o}))}}var LI='';class RI extends PI{constructor(t){const e=t.locale.t;super(t,{commandName:DI,componentName:DI,icon:LI,dropdownLabel:e("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class OI extends Un{static get requires(){return[zI,RI]}static get pluginName(){return"FontBackgroundColor"}}class jI extends kI{constructor(t){super(t,EI)}}class FI extends Un{static get pluginName(){return"FontColorEditing"}constructor(t){super(t);t.config.define(EI,{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});t.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:EI,value:TI("color")}});t.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:EI,value:t=>t.getAttribute("color")}});t.conversion.for("downcast").attributeToElement({model:EI,view:II("color")});t.commands.add(EI,new jI(t));t.model.schema.extend("$text",{allowAttributes:EI});t.model.schema.setAttributeProperties(EI,{isFormatting:true,copyOnEnter:true})}}var VI='';class UI extends PI{constructor(t){const e=t.locale.t;super(t,{commandName:EI,componentName:EI,icon:VI,dropdownLabel:e("Font Color")})}static get pluginName(){return"FontColorUI"}}class HI extends Un{static get requires(){return[FI,UI]}static get pluginName(){return"FontColor"}}class qI extends kI{constructor(t){super(t,xI)}}function WI(t){return t.map(GI).filter((t=>!!t))}function GI(t){if(typeof t==="object"){return t}if(t==="default"){return{title:"Default",model:undefined}}if(typeof t!=="string"){return}return KI(t)}function KI(t){const e=t.replace(/"|'/g,"").split(",");const n=e[0];const i=e.map($I).join(", ");return{title:n,model:i,view:{name:"span",styles:{"font-family":i},priority:7}}}function $I(t){t=t.trim();if(t.indexOf(" ")>0){t=`'${t}'`}return t}class YI extends Un{static get pluginName(){return"FontFamilyEditing"}constructor(t){super(t);t.config.define(xI,{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 t=this.editor;t.model.schema.extend("$text",{allowAttributes:xI});t.model.schema.setAttributeProperties(xI,{isFormatting:true,copyOnEnter:true});const e=WI(t.config.get("fontFamily.options")).filter((t=>t.model));const n=SI(xI,e);if(t.config.get("fontFamily.supportAllValues")){this._prepareAnyValueConverters();this._prepareCompatibilityConverter()}else{t.conversion.attributeToElement(n)}t.commands.add(xI,new qI(t))}_prepareAnyValueConverters(){const t=this.editor;t.conversion.for("downcast").attributeToElement({model:xI,view:(t,{writer:e})=>e.createAttributeElement("span",{style:"font-family:"+t},{priority:7})});t.conversion.for("upcast").elementToAttribute({model:{key:xI,value:t=>t.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}_prepareCompatibilityConverter(){const t=this.editor;t.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{face:/.*/}},model:{key:xI,value:t=>t.getAttribute("face")}})}}var QI='';class ZI extends Un{static get pluginName(){return"FontFamilyUI"}init(){const t=this.editor;const e=t.t;const n=this._getLocalizedOptions();const i=t.commands.get(xI);t.ui.componentFactory.add(xI,(o=>{const r=WA(o);KA(r,JI(n,i));r.buttonView.set({label:e("Font Family"),icon:QI,tooltip:true});r.extendTemplate({attributes:{class:"ck-font-family-dropdown"}});r.bind("isEnabled").to(i);this.listenTo(r,"execute",(e=>{t.execute(e.source.commandName,{value:e.source.commandParam});t.editing.view.focus()}));return r}))}_getLocalizedOptions(){const t=this.editor;const e=t.t;const n=WI(t.config.get(xI).options);return n.map((t=>{if(t.title==="Default"){t.title=e("Default")}return t}))}}function JI(t,e){const n=new ba;for(const i of t){const t={type:"button",model:new MC({commandName:xI,commandParam:i.model,label:i.title,withText:true})};t.model.bind("isOn").to(e,"value",(t=>{if(t===i.model){return true}if(!t||!i.model){return false}return t.split(",")[0].replace(/'/g,"").toLowerCase()===i.model.toLowerCase()}));if(i.view&&i.view.styles){t.model.set("labelStyle",`font-family: ${i.view.styles["font-family"]}`)}n.add(t)}return n}class XI extends Un{static get requires(){return[YI,ZI]}static get pluginName(){return"FontFamily"}}class tM extends kI{constructor(t){super(t,yI)}}function eM(t){return t.map((t=>iM(t))).filter((t=>!!t))}const nM={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 iM(t){if(aM(t)){return rM(t)}const e=sM(t);if(e){return rM(e)}if(t==="default"){return{model:undefined,title:"Default"}}if(cM(t)){return}return oM(t)}function oM(t){if(typeof t==="number"||typeof t==="string"){t={title:String(t),model:`${parseFloat(t)}px`}}t.view={name:"span",styles:{"font-size":t.model}};return rM(t)}function rM(t){if(!t.view.priority){t.view.priority=7}return t}function sM(t){return nM[t]||nM[t.model]}function aM(t){return typeof t==="object"&&t.title&&t.model&&t.view}function cM(t){let e;if(typeof t==="object"){if(!t.model){throw new u["a"]("font-size-invalid-definition",null,t)}else{e=parseFloat(t.model)}}else{e=parseFloat(t)}return isNaN(e)}const lM=["x-small","x-small","small","medium","large","x-large","xx-large","xxx-large"];class dM extends Un{static get pluginName(){return"FontSizeEditing"}constructor(t){super(t);t.config.define(yI,{options:["tiny","small","default","big","huge"],supportAllValues:false})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:yI});t.model.schema.setAttributeProperties(yI,{isFormatting:true,copyOnEnter:true});const e=t.config.get("fontSize.supportAllValues");const n=eM(this.editor.config.get("fontSize.options")).filter((t=>t.model));const i=SI(yI,n);if(e){this._prepareAnyValueConverters(i);this._prepareCompatibilityConverter()}else{t.conversion.attributeToElement(i)}t.commands.add(yI,new tM(t))}_prepareAnyValueConverters(t){const e=this.editor;const n=t.model.values.filter((t=>!o_(String(t))&&!s_(String(t))));if(n.length){throw new u["a"]("font-size-invalid-use-of-named-presets",null,{presets:n})}e.conversion.for("downcast").attributeToElement({model:yI,view:(t,{writer:e})=>{if(!t){return}return e.createAttributeElement("span",{style:"font-size:"+t},{priority:7})}});e.conversion.for("upcast").elementToAttribute({model:{key:yI,value:t=>t.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}_prepareCompatibilityConverter(){const t=this.editor;t.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{size:/^[+-]?\d{1,3}$/}},model:{key:yI,value:t=>{const e=t.getAttribute("size");const n=e[0]==="-"||e[0]==="+";let i=parseInt(e,10);if(n){i=3+i}const o=lM.length-1;const r=Math.min(Math.max(i,0),o);return lM[r]}}})}}var uM='';var hM=n(48);var fM={injectType:"singletonStyleTag",attributes:{"data-cke":true}};fM.insert="head";fM.singleton=true;var gM=ru()(hM["a"],fM);var mM=hM["a"].locals||{};class pM extends Un{static get pluginName(){return"FontSizeUI"}init(){const t=this.editor;const e=t.t;const n=this._getLocalizedOptions();const i=t.commands.get(yI);t.ui.componentFactory.add(yI,(o=>{const r=WA(o);KA(r,kM(n,i));r.buttonView.set({label:e("Font Size"),icon:uM,tooltip:true});r.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}});r.bind("isEnabled").to(i);this.listenTo(r,"execute",(e=>{t.execute(e.source.commandName,{value:e.source.commandParam});t.editing.view.focus()}));return r}))}_getLocalizedOptions(){const t=this.editor;const e=t.t;const n={Default:e("Default"),Tiny:e("Tiny"),Small:e("Small"),Big:e("Big"),Huge:e("Huge")};const i=eM(t.config.get(yI).options);return i.map((t=>{const e=n[t.title];if(e&&e!=t.title){t=Object.assign({},t,{title:e})}return t}))}}function kM(t,e){const n=new ba;for(const i of t){const t={type:"button",model:new MC({commandName:yI,commandParam:i.model,label:i.title,class:"ck-fontsize-option",withText:true})};if(i.view&&i.view.styles){t.model.set("labelStyle",`font-size:${i.view.styles["font-size"]}`)}if(i.view&&i.view.classes){t.model.set("class",`${t.model.class} ${i.view.classes}`)}t.model.bind("isOn").to(e,"value",(t=>t===i.model));n.add(t)}return n}class bM extends Un{static get requires(){return[dM,pM]}static get pluginName(){return"FontSize"}}class wM extends qn{refresh(){const t=this.editor.model;const e=t.document;const n=If(e.selection.getSelectedBlocks());this.value=!!n&&n.is("element","paragraph");this.isEnabled=!!n&&AM(n,t.schema)}execute(t={}){const e=this.editor.model;const n=e.document;e.change((i=>{const o=(t.selection||n.selection).getSelectedBlocks();for(const t of o){if(!t.is("element","paragraph")&&AM(t,e.schema)){i.rename(t,"paragraph")}}}))}}function AM(t,e){return e.checkChild(t.parent,"paragraph")&&!e.isObject(t)}class CM extends qn{execute(t){const e=this.editor.model;let n=t.position;e.change((t=>{const i=t.createElement("paragraph");if(!e.schema.checkChild(n.parent,i)){const o=e.schema.findAllowedParent(n,i);if(!o){return}n=t.split(n,o).position}e.insertContent(i,n);t.setSelection(i,"in")}))}}class vM extends Un{static get pluginName(){return"Paragraph"}init(){const t=this.editor;const e=t.model;t.commands.add("paragraph",new wM(t));t.commands.add("insertParagraph",new CM(t));e.schema.register("paragraph",{inheritAllFrom:"$block"});t.conversion.elementToElement({model:"paragraph",view:"p"});t.conversion.for("upcast").elementToElement({model:(t,{writer:e})=>{if(!vM.paragraphLikeElements.has(t.name)){return null}if(t.isEmpty){return null}return e.createElement("paragraph")},view:/.+/,converterPriority:"low"})}}vM.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);var _M='';class yM extends Un{init(){const t=this.editor;const e=t.t;t.ui.componentFactory.add("paragraph",(n=>{const i=new zw(n);const o=t.commands.get("paragraph");i.label=e("Paragraph");i.icon=_M;i.tooltip=true;i.isToggleable=true;i.bind("isEnabled").to(o);i.bind("isOn").to(o,"value");i.on("execute",(()=>{t.execute("paragraph")}));return i}))}}class xM extends qn{constructor(t,e){super(t);this.modelElements=e}refresh(){const t=If(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name;this.isEnabled=!!t&&this.modelElements.some((e=>EM(t,e,this.editor.model.schema)))}execute(t){const e=this.editor.model;const n=e.document;const i=t.value;e.change((t=>{const o=Array.from(n.selection.getSelectedBlocks()).filter((t=>EM(t,i,e.schema)));for(const e of o){if(!e.is("element",i)){t.rename(e,i)}}}))}}function EM(t,e,n){return n.checkChild(t.parent,e)&&!n.isObject(t)}const DM="paragraph";class SM extends Un{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[vM]}init(){const t=this.editor;const e=t.config.get("heading.options");const n=[];for(const i of e){if(i.model!==DM){t.model.schema.register(i.model,{inheritAllFrom:"$block"});t.conversion.elementToElement(i);n.push(i.model)}}this._addDefaultH1Conversion(t);t.commands.add("heading",new xM(t,n))}afterInit(){const t=this.editor;const e=t.commands.get("enter");const n=t.config.get("heading.options");if(e){this.listenTo(e,"afterExecute",((e,i)=>{const o=t.model.document.selection.getFirstPosition().parent;const r=n.some((t=>o.is("element",t.model)));if(r&&!o.is("element",DM)&&o.childCount===0){i.writer.rename(o,DM)}}))}}_addDefaultH1Conversion(t){t.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:l.get("low")+1})}}function TM(t){const e=t.t;const n={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=n[t.title];if(e&&e!=t.title){t.title=e}return t}))}var IM=n(49);var MM={injectType:"singletonStyleTag",attributes:{"data-cke":true}};MM.insert="head";MM.singleton=true;var BM=ru()(IM["a"],MM);var NM=IM["a"].locals||{};class zM extends Un{static get pluginName(){return"HeadingUI"}init(){const t=this.editor;const e=t.t;const n=TM(t);const i=e("Choose heading");const o=e("Heading");t.ui.componentFactory.add("heading",(e=>{const r={};const s=new ba;const a=t.commands.get("heading");const c=t.commands.get("paragraph");const l=[a];for(const t of n){const e={type:"button",model:new MC({label:t.title,class:t.class,withText:true})};if(t.model==="paragraph"){e.model.bind("isOn").to(c,"value");e.model.set("commandName","paragraph");l.push(c)}else{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=WA(e);KA(d,s);d.buttonView.set({isOn:false,withText:true,tooltip:o});d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}});d.bind("isEnabled").toMany(l,"isEnabled",((...t)=>t.some((t=>t))));d.buttonView.bind("label").to(a,"value",c,"value",((t,e)=>{const n=t||e&&"paragraph";return r[n]?r[n]:i}));this.listenTo(d,"execute",(e=>{t.execute(e.source.commandName,e.source.commandValue?{value:e.source.commandValue}:undefined);t.editing.view.focus()}));return d}))}}class PM extends Un{static get requires(){return[SM,zM]}static get pluginName(){return"Heading"}}class LM extends qn{refresh(){const t=this.editor.model;const e=t.document;this.value=e.selection.getAttribute("highlight");this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"highlight")}execute(t={}){const e=this.editor.model;const n=e.document;const i=n.selection;const o=t.value;e.change((t=>{if(i.isCollapsed){const e=i.getFirstPosition();if(i.hasAttribute("highlight")){const n=t=>t.item.hasAttribute("highlight")&&t.item.getAttribute("highlight")===this.value;const i=e.getLastMatchingPosition(n,{direction:"backward"});const r=e.getLastMatchingPosition(n);const s=t.createRange(i,r);if(!o||this.value===o){if(!e.isEqual(r)){t.removeAttribute("highlight",s)}t.removeSelectionAttribute("highlight")}else{if(!e.isEqual(r)){t.setAttribute("highlight",o,s)}t.setSelectionAttribute("highlight",o)}}else if(o){t.setSelectionAttribute("highlight",o)}}else{const n=e.schema.getValidRanges(i.getRanges(),"highlight");for(const e of n){if(o){t.setAttribute("highlight",o,e)}else{t.removeAttribute("highlight",e)}}}}))}}class RM extends Un{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(OM(e));t.commands.add("highlight",new LM(t))}}function OM(t){const e={model:{key:"highlight",values:[]},view:{}};for(const n of t){e.model.values.push(n.model);e.view[n.model]={name:"mark",classes:n.class}}return e}var jM='';var FM='';var VM=n(50);var UM={injectType:"singletonStyleTag",attributes:{"data-cke":true}};UM.insert="head";UM.singleton=true;var HM=ru()(VM["a"],UM);var qM=VM["a"].locals||{};class WM extends Un{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;const e=this.editor.commands.get("highlight");this._addButton("removeHighlight",t("Remove highlight"),Pb.eraser,null,(t=>{t.bind("isEnabled").to(e,"isEnabled")}))}_addHighlighterButton(t){const e=this.editor.commands.get("highlight");this._addButton("highlight:"+t.model,t.title,KM(t.type),t.model,n);function n(n){n.bind("isEnabled").to(e,"isEnabled");n.bind("isOn").to(e,"value",(e=>e===t.model));n.iconView.fillColor=t.color;n.isToggleable=true}}_addButton(t,e,n,i,o){const r=this.editor;r.ui.componentFactory.add(t,(t=>{const s=new zw(t);const a=this.localizedOptionTitles[e]?this.localizedOptionTitles[e]:e;s.set({label:a,icon:n,tooltip:true});s.on("execute",(()=>{r.execute("highlight",{value:i});r.editing.view.focus()}));o(s);return s}))}_addDropdown(t){const e=this.editor;const n=e.t;const i=e.ui.componentFactory;const o=t[0];const r=t.reduce(((t,e)=>{t[e.model]=e;return t}),{});i.add("highlight",(s=>{const a=e.commands.get("highlight");const c=WA(s,oA);const l=c.buttonView;l.set({tooltip:n("Highlight"),lastExecuted:o.model,commandValue:o.model,isToggleable:true});l.bind("icon").to(a,"value",(t=>KM(u(t,"type"))));l.bind("color").to(a,"value",(t=>u(t,"color")));l.bind("commandValue").to(a,"value",(t=>u(t,"model")));l.bind("isOn").to(a,"value",(t=>!!t));l.delegate("execute").to(c);const d=t.map((t=>{const e=i.create("highlight:"+t.model);this.listenTo(e,"execute",(()=>c.buttonView.set({lastExecuted:t.model})));return e}));c.bind("isEnabled").toMany(d,"isEnabled",((...t)=>t.some((t=>t))));d.push(new bA);d.push(i.create("removeHighlight"));GA(c,d);GM(c);c.toolbarView.ariaLabel=n("Text highlight toolbar");l.on("execute",(()=>{e.execute("highlight",{value:l.commandValue});e.editing.view.focus()}));function u(t,e){const n=!t||t===l.lastExecuted?l.lastExecuted:t;return r[n][e]}return c}))}}function GM(t){const e=t.buttonView.actionView;e.iconView.bind("fillColor").to(t.buttonView,"color")}function KM(t){return t==="marker"?jM:FM}class $M extends Un{static get requires(){return[RM,WM]}static get pluginName(){return"Highlight"}}class YM extends Un{static get requires(){return[JC]}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=>{if(JM(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:n,getRelatedElement:i,balloonClassName:o="ck-toolbar-container"}){if(!n.length){Object(u["b"])("widget-toolbar-no-items",{toolbarId:t});return}const r=this.editor;const s=r.t;const a=new EA(r.locale);a.ariaLabel=e||s("Widget toolbar");if(this._toolbarDefinitions.has(t)){throw new u["a"]("widget-toolbar-duplicated",this,{toolbarId:t})}a.fillFromConfig(n,r.ui.componentFactory);this._toolbarDefinitions.set(t,{view:a,getRelatedElement:i,balloonClassName:o})}_updateToolbarsVisibility(){let t=0;let e=null;let n=null;for(const i of this._toolbarDefinitions.values()){const o=i.getRelatedElement(this.editor.editing.view.document.selection);if(!this.isEnabled||!o){if(this._isToolbarInBalloon(i)){this._hideToolbar(i)}}else if(!this.editor.ui.focusTracker.isFocused){if(this._isToolbarVisible(i)){this._hideToolbar(i)}}else{const r=o.getAncestors().length;if(r>t){t=r;e=o;n=i}}}if(n){this._showToolbar(n,e)}}_hideToolbar(t){this._balloon.remove(t.view);this.stopListening(this._balloon,"change:visibleView")}_showToolbar(t,e){if(this._isToolbarVisible(t)){QM(this.editor,e)}else if(!this._isToolbarInBalloon(t)){this._balloon.add({view:t.view,position:ZM(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);QM(this.editor,e)}}}))}}_isToolbarVisible(t){return this._balloon.visibleView===t.view}_isToolbarInBalloon(t){return this._balloon.hasView(t.view)}}function QM(t,e){const n=t.plugins.get("ContextualBalloon");const i=ZM(t,e);n.updatePosition(i)}function ZM(t,e){const n=t.editing.view;const i=OC.defaultPositions;return{target:n.domConverter.mapViewToDom(e),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,i.viewportStickyNorth]}}function JM(t){const e=t.getSelectedElement();return!!(e&&fS(e))}class XM{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,n){const i=new vf(e);this.activeHandlePosition=iB(t);this._referenceCoordinates=eB(e,oB(this.activeHandlePosition));this.originalWidth=i.width;this.originalHeight=i.height;this.aspectRatio=i.width/i.height;const o=n.style.width;if(o&&o.match(/^\d+(\.\d*)?%$/)){this.originalWidthPercents=parseFloat(o)}else{this.originalWidthPercents=tB(n,i)}}update(t){this.proposedWidth=t.width;this.proposedHeight=t.height;this.proposedWidthPercents=t.widthPercents;this.proposedHandleHostWidth=t.handleHostWidth;this.proposedHandleHostHeight=t.handleHostHeight}}Vn(XM,In);function tB(t,e){const n=t.parentElement;const i=parseFloat(n.ownerDocument.defaultView.getComputedStyle(n).width);return e.width/i*100}function eB(t,e){const n=new vf(t);const i=e.split("-");const o={x:i[1]=="right"?n.right:n.left,y:i[0]=="bottom"?n.bottom:n.top};o.x+=t.ownerDocument.defaultView.scrollX;o.y+=t.ownerDocument.defaultView.scrollY;return o}function nB(t){return`ck-widget__resizer__handle-${t}`}function iB(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const n of e){if(t.classList.contains(nB(n))){return n}}}function oB(t){const e=t.split("-");const n={top:"bottom",bottom:"top",left:"right",right:"left"};return`${n[e[0]]}-${n[e[1]]}`}class rB extends Wb{constructor(){super();const t=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",t.to("_viewPosition",(t=>t?`ck-orientation-${t}`:""))],style:{display:t.if("_isVisible","none",(t=>!t))}},children:[{text:t.to("_label")}]})}_bindToState(t,e){this.bind("_isVisible").to(e,"proposedWidth",e,"proposedHeight",((t,e)=>t!==null&&e!==null));this.bind("_label").to(e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",e,"proposedWidthPercents",((e,n,i)=>{if(t.unit==="px"){return`${e}脳${n}`}else{return`${i}%`}}));this.bind("_viewPosition").to(e,"activeHandlePosition",e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",((t,e,n)=>e<50||n<50?"above-center":t))}_dismiss(){this.unbind();this._isVisible=false}}class sB{constructor(t){this._options=t;this._viewResizerWrapper=null;this.set("isEnabled",true);this.decorate("begin");this.decorate("cancel");this.decorate("commit");this.decorate("updateSize");this.on("commit",(t=>{if(!this.state.proposedWidth&&!this.state.proposedWidthPercents){this._cleanup();t.stop()}}),{priority:"high"});this.on("change:isEnabled",(()=>{if(this.isEnabled){this.redraw()}}))}attach(){const t=this;const e=this._options.viewElement;const n=this._options.editor.editing.view;n.change((n=>{const i=n.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(e){const n=this.toDomElement(e);t._appendHandles(n);t._appendSizeUI(n);t.on("change:isEnabled",((t,e,i)=>{n.style.display=i?"":"none"}));n.style.display=t.isEnabled?"":"none";return n}));n.insert(n.createPositionAt(e,"end"),i);n.addClass("ck-widget_with-resizer",e);this._viewResizerWrapper=i}))}begin(t){this.state=new XM(this._options);this._sizeView._bindToState(this._options,this.state);this._initialViewWidth=this._options.viewElement.getStyle("width");this.state.begin(t,this._getHandleHost(),this._getResizeHost())}updateSize(t){const e=this._proposeNewSize(t);const n=this._options.editor.editing.view;n.change((t=>{const n=this._options.unit||"%";const i=(n==="%"?e.widthPercents:e.width)+n;t.setStyle("width",i,this._options.viewElement)}));const i=this._getHandleHost();const o=new vf(i);e.handleHostWidth=Math.round(o.width);e.handleHostHeight=Math.round(o.height);const r=new vf(i);e.width=Math.round(r.width);e.height=Math.round(r.height);this.redraw(o);this.state.update(e)}commit(){const t=this._options.unit||"%";const 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(!lB(e)){return}const n=e.parentElement;const i=this._getHandleHost();const o=this._viewResizerWrapper;const r=[o.getStyle("width"),o.getStyle("height"),o.getStyle("left"),o.getStyle("top")];let s;if(n.isSameNode(i)){const e=t||new vf(i);s=[e.width+"px",e.height+"px",undefined,undefined]}else{s=[i.offsetWidth+"px",i.offsetHeight+"px",i.offsetLeft+"px",i.offsetTop+"px"]}if(Ba(r,s)!=="same"){this._options.editor.editing.view.change((t=>{t.setStyle({width:s[0],height:s[1],left:s[2],top:s[3]},o)}))}}containsHandle(t){return this._domResizerWrapper.contains(t)}static isResizeHandle(t){return t.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss();const t=this._options.editor.editing.view;t.change((t=>{t.setStyle("width",this._initialViewWidth,this._options.viewElement)}))}_proposeNewSize(t){const e=this.state;const n=cB(t);const i=this._options.isCentered?this._options.isCentered(this):true;const o={x:e._referenceCoordinates.x-(n.x+e.originalWidth),y:n.y-e.originalHeight-e._referenceCoordinates.y};if(i&&e.activeHandlePosition.endsWith("-right")){o.x=n.x-(e._referenceCoordinates.x+e.originalWidth)}if(i){o.x*=2}const r={width:Math.abs(e.originalWidth+o.x),height:Math.abs(e.originalHeight+o.y)};r.dominant=r.width/e.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/e.aspectRatio}else{s.width=s.height*e.aspectRatio}return{width:Math.round(s.width),height:Math.round(s.height),widthPercents:Math.min(Math.round(e.originalWidthPercents/e.originalWidth*s.width*100)/100,100)}}_getResizeHost(){const t=this._domResizerWrapper.parentElement;return this._options.getResizeHost(t)}_getHandleHost(){const t=this._domResizerWrapper.parentElement;return this._options.getHandleHost(t)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const n of e){t.appendChild(new Kb({tag:"div",attributes:{class:`ck-widget__resizer__handle ${aB(n)}`}}).render())}}_appendSizeUI(t){this._sizeView=new rB;this._sizeView.render();t.appendChild(this._sizeView.element)}}Vn(sB,In);function aB(t){return`ck-widget__resizer__handle-${t}`}function cB(t){return{x:t.pageX,y:t.pageY}}function lB(t){return t&&t.ownerDocument&&t.ownerDocument.contains(t)}var dB=n(51);var uB={injectType:"singletonStyleTag",attributes:{"data-cke":true}};uB.insert="head";uB.singleton=true;var hB=ru()(dB["a"],uB);var fB=dB["a"].locals||{};class gB extends Un{static get pluginName(){return"WidgetResize"}init(){const t=this.editor.editing;const e=bu.window.document;this.set("visibleResizer",null);this.set("_activeResizer",null);this._resizers=new Map;t.view.addObserver(Gv);this._observer=Object.create(Nu);this.listenTo(t.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"});this._observer.listenTo(e,"mousemove",this._mouseMoveListener.bind(this));this._observer.listenTo(e,"mouseup",this._mouseUpListener.bind(this));const n=()=>{if(this.visibleResizer){this.visibleResizer.redraw()}};this._redrawFocusedResizerThrottled=rT(n,200);this.on("change:visibleResizer",n);this.editor.ui.on("update",this._redrawFocusedResizerThrottled);this.editor.model.document.on("change",(()=>{for(const[t,e]of this._resizers){if(!t.isAttached()){this._resizers.delete(t);e.destroy()}}}),{priority:"lowest"});this._observer.listenTo(bu.window,"resize",this._redrawFocusedResizerThrottled);const i=this.editor.editing.view.document.selection;i.on("change",(()=>{const t=i.getSelectedElement();this.visibleResizer=this.getResizerByViewElement(t)||null}))}destroy(){this._observer.stopListening();for(const t of this._resizers.values()){t.destroy()}this._redrawFocusedResizerThrottled.cancel()}attachTo(t){const e=new sB(t);const n=this.editor.plugins;e.attach();if(n.has("WidgetToolbarRepository")){const t=n.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 i=this.editor.editing.view.document.selection;const o=i.getSelectedElement();if(this.getResizerByViewElement(o)==e){this.visibleResizer=e}return 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 n=e.domTarget;if(!sB.isResizeHandle(n)){return}this._activeResizer=this._getResizerByHandle(n);if(this._activeResizer){this._activeResizer.begin(n);t.stop();e.preventDefault()}}_mouseMoveListener(t,e){if(this._activeResizer){this._activeResizer.updateSize(e)}}_mouseUpListener(){if(this._activeResizer){this._activeResizer.commit();this._activeResizer=null}}}Vn(gB,In);class mB extends qn{refresh(){const t=this.editor.model;const e=t.schema;const n=t.document.selection;this.isEnabled=pB(n,e,t)}execute(){const t=this.editor.model;t.change((e=>{const n=e.createElement("horizontalLine");t.insertContent(n);let i=n.nextSibling;const o=i&&t.schema.checkChild(i,"$text");if(!o&&t.schema.checkChild(n.parent,"paragraph")){i=e.createElement("paragraph");t.insertContent(i,e.createPositionAfter(n))}if(i){e.setSelection(i,0)}}))}}function pB(t,e,n){const i=kB(t,n);return e.checkChild(i,"horizontalLine")}function kB(t,e){const n=CS(t,e);const i=n.start.parent;if(i.isEmpty&&!i.is("element","$root")){return i.parent}return i}var bB=n(52);var wB={injectType:"singletonStyleTag",attributes:{"data-cke":true}};wB.insert="head";wB.singleton=true;var AB=ru()(bB["a"],wB);var CB=bB["a"].locals||{};class vB extends Un{static get pluginName(){return"HorizontalLineEditing"}init(){const t=this.editor;const e=t.model.schema;const n=t.t;const i=t.conversion;e.register("horizontalLine",{isObject:true,allowWhere:"$block"});i.for("dataDowncast").elementToElement({model:"horizontalLine",view:(t,{writer:e})=>e.createEmptyElement("hr")});i.for("editingDowncast").elementToElement({model:"horizontalLine",view:(t,{writer:e})=>{const i=n("Horizontal line");const o=e.createContainerElement("div");const r=e.createEmptyElement("hr");e.addClass("ck-horizontal-line",o);e.setCustomProperty("hr",true,o);e.insert(e.createPositionAt(o,0),r);return _B(o,e,i)}});i.for("upcast").elementToElement({view:"hr",model:"horizontalLine"});t.commands.add("horizontalLine",new mB(t))}}function _B(t,e,n){e.setCustomProperty("horizontalLine",true,t);return gS(t,e,{label:n})}var yB='';class xB extends Un{static get pluginName(){return"HorizontalLineUI"}init(){const t=this.editor;const e=t.t;t.ui.componentFactory.add("horizontalLine",(n=>{const i=t.commands.get("horizontalLine");const o=new zw(n);o.set({label:e("Horizontal line"),icon:yB,tooltip:true});o.bind("isEnabled").to(i,"isEnabled");this.listenTo(o,"execute",(()=>{t.execute("horizontalLine");t.editing.view.focus()}));return o}))}}class EB extends Un{static get requires(){return[vB,xB,tT]}static get pluginName(){return"HorizontalLine"}}class DB extends qn{refresh(){const t=this.editor.model;const e=t.schema;const n=t.document.selection;const i=IB(n);this.isEnabled=SB(n,e,t);this.value=i?i.getAttribute("value")||"":null}execute(t){const e=this.editor.model;const n=e.document.selection;e.change((i=>{let o;if(this.value!==null){o=IB(n)}else{o=i.createElement("rawHtml");e.insertContent(o);i.setSelection(o,"on")}i.setAttribute("value",t,o)}))}}function SB(t,e,n){const i=TB(t,n);return e.checkChild(i,"rawHtml")}function TB(t,e){const n=CS(t,e);const i=n.start.parent;if(i.isEmpty&&!i.is("element","$root")){return i.parent}return i}function IB(t){const e=t.getSelectedElement();if(e&&e.is("element","rawHtml")){return e}return null}var MB=n(53);var BB={injectType:"singletonStyleTag",attributes:{"data-cke":true}};BB.insert="head";BB.singleton=true;var NB=ru()(MB["a"],BB);var zB=MB["a"].locals||{};class PB extends Un{static get pluginName(){return"HtmlEmbedEditing"}constructor(t){super(t);t.config.define("htmlEmbed",{showPreviews:false,sanitizeHtml:t=>{Object(u["b"])("html-embed-provide-sanitize-function");return{html:t,hasChanged:false}}});this._widgetButtonViewReferences=new Set}init(){const t=this.editor;const e=t.model.schema;e.register("rawHtml",{isObject:true,allowWhere:"$block",allowAttributes:["value"]});t.commands.add("htmlEmbed",new DB(t));this._setupConversion()}_setupConversion(){const t=this.editor;const e=t.t;const n=t.editing.view;const i=this._widgetButtonViewReferences;const o=t.config.get("htmlEmbed");this.editor.editing.view.on("render",(()=>{for(const t of i){if(t.element.isConnected){return}t.destroy();i.delete(t)}}),{priority:"lowest"});t.data.registerRawContentMatcher({name:"div",classes:"raw-html-embed"});t.conversion.for("upcast").elementToElement({view:{name:"div",classes:"raw-html-embed"},model:(t,{writer:e})=>e.createElement("rawHtml",{value:t.getCustomProperty("$rawContent")})});t.conversion.for("dataDowncast").elementToElement({model:"rawHtml",view:(t,{writer:e})=>e.createRawElement("div",{class:"raw-html-embed"},(function(e){e.innerHTML=t.getAttribute("value")||""}))});t.conversion.for("editingDowncast").elementToElement({triggerBy:{attributes:["value"]},model:"rawHtml",view:(i,{writer:s})=>{let a,c,l;const d=s.createContainerElement("div",{class:"raw-html-embed","data-html-embed-label":e("HTML snippet"),dir:t.locale.uiLanguageDirection});const u=s.createRawElement("div",{class:"raw-html-embed__content-wrapper"},(function(e){a=e;r({domElement:e,editor:t,state:c,props:l});a.addEventListener("mousedown",(()=>{if(c.isEditable){const e=t.model;const n=e.document.selection.getSelectedElement();if(n!==i){e.change((t=>t.setSelection(i,"on")))}}}),true)}));const h={makeEditable(){c=Object.assign({},c,{isEditable:true});r({domElement:a,editor:t,state:c,props:l});n.change((t=>{t.setAttribute("data-cke-ignore-events","true",u)}));a.querySelector("textarea").focus()},save(e){if(e!==c.getRawHtmlValue()){t.execute("htmlEmbed",e);t.editing.view.focus()}else{this.cancel()}},cancel(){c=Object.assign({},c,{isEditable:false});r({domElement:a,editor:t,state:c,props:l});t.editing.view.focus();n.change((t=>{t.removeAttribute("data-cke-ignore-events",u)}))}};c={showPreviews:o.showPreviews,isEditable:false,getRawHtmlValue:()=>i.getAttribute("value")||""};l={sanitizeHtml:o.sanitizeHtml,textareaPlaceholder:e("Paste raw HTML here..."),onEditClick(){h.makeEditable()},onSaveClick(t){h.save(t)},onCancelClick(){h.cancel()}};s.insert(s.createPositionAt(d,0),u);s.setCustomProperty("rawHtmlApi",h,d);s.setCustomProperty("rawHtml",true,d);return gS(d,s,{widgetLabel:e("HTML snippet"),hasSelectionHandle:true})}});function r({domElement:t,editor:e,state:n,props:i}){t.textContent="";const o=t.ownerDocument;let r;if(n.isEditable){const e={isDisabled:false,placeholder:i.textareaPlaceholder};r=a({domDocument:o,state:n,props:e});t.append(r)}else if(n.showPreviews){const r={sanitizeHtml:i.sanitizeHtml};t.append(c({domDocument:o,state:n,props:r,editor:e}))}else{const e={isDisabled:true,placeholder:i.textareaPlaceholder};t.append(a({domDocument:o,state:n,props:e}))}const l={onEditClick:i.onEditClick,onSaveClick:()=>{i.onSaveClick(r.value)},onCancelClick:i.onCancelClick};t.prepend(s({editor:e,domDocument:o,state:n,props:l}))}function s({editor:t,domDocument:e,state:n,props:o}){const r=kf(e,"div",{class:"raw-html-embed__buttons-wrapper"});if(n.isEditable){const e=LB(t,"save",o.onSaveClick);const n=LB(t,"cancel",o.onCancelClick);r.append(e.element,n.element);i.add(e).add(n)}else{const e=LB(t,"edit",o.onEditClick);r.append(e.element);i.add(e)}return r}function a({domDocument:t,state:e,props:n}){const i=kf(t,"textarea",{placeholder:n.placeholder,class:"ck ck-reset ck-input ck-input-text raw-html-embed__source"});i.disabled=n.isDisabled;i.value=e.getRawHtmlValue();return i}function c({domDocument:t,state:n,props:i,editor:o}){const r=i.sanitizeHtml(n.getRawHtmlValue());const s=n.getRawHtmlValue().length>0?e("No preview available"):e("Empty snippet content");const a=kf(t,"div",{class:"ck ck-reset_all raw-html-embed__preview-placeholder"},s);const c=kf(t,"div",{class:"raw-html-embed__preview-content",dir:o.locale.contentLanguageDirection});const l=t.createRange();const d=l.createContextualFragment(r.html);c.appendChild(d);const u=kf(t,"div",{class:"raw-html-embed__preview"},[a,c]);return u}}}function LB(t,e,n){const i=t.locale.t;const o=new zw(t.locale);const r=t.commands.get("htmlEmbed");o.set({class:`raw-html-embed__${e}-button`,icon:Pb.pencil,tooltip:true,tooltipPosition:t.locale.uiLanguageDirection==="rtl"?"e":"w"});o.render();if(e==="edit"){o.set({icon:Pb.pencil,label:i("Edit source")});o.bind("isEnabled").to(r)}else if(e==="save"){o.set({icon:Pb.check,label:i("Save changes")});o.bind("isEnabled").to(r)}else{o.set({icon:Pb.cancel,label:i("Cancel")})}o.on("execute",n);return o}var RB='';class OB extends Un{static get pluginName(){return"HtmlEmbedUI"}init(){const t=this.editor;const e=t.t;t.ui.componentFactory.add("htmlEmbed",(n=>{const i=t.commands.get("htmlEmbed");const o=new zw(n);o.set({label:e("Insert HTML"),icon:RB,tooltip:true});o.bind("isEnabled").to(i,"isEnabled");this.listenTo(o,"execute",(()=>{t.execute("htmlEmbed");t.editing.view.focus();const e=t.editing.view.document.selection.getSelectedElement();e.getCustomProperty("rawHtmlApi").makeEditable()}));return o}))}}class jB extends Un{static get requires(){return[PB,OB,tT]}static get pluginName(){return"HtmlEmbed"}}class FB extends qn{refresh(){const t=this.editor;const e=t.plugins.get("ImageUtils");const n=e.getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!n;if(this.isEnabled&&n.hasAttribute("alt")){this.value=n.getAttribute("alt")}else{this.value=false}}execute(t){const e=this.editor;const n=e.plugins.get("ImageUtils");const i=e.model;const o=n.getClosestSelectedImageElement(i.document.selection);i.change((e=>{e.setAttribute("alt",t.newValue,o)}))}}function VB(t,e){const n=t.createEmptyElement("img");const i=e==="imageBlock"?t.createContainerElement("figure",{class:"image"}):t.createContainerElement("span",{class:"image-inline"},{isAllowedInsideAttributeElement:true});t.insert(t.createPositionAt(i,0),n);return i}function UB(t,e){if(t.plugins.has("ImageInlineEditing")!==t.plugins.has("ImageBlockEditing")){return{name:"img"}}const n=t.plugins.get("ImageUtils");return t=>{if(!n.isInlineImageView(t)){return null}const i=t.findAncestor(n.isBlockImageView)?"imageBlock":"imageInline";if(i!==e){return null}return{name:true}}}function HB(t,e){const n=If(e.getSelectedBlocks());if(!n||t.isObject(n)){return"imageBlock"}if(n.isEmpty&&n.name!="listItem"){return"imageBlock"}return"imageInline"}class qB extends Un{static get pluginName(){return"ImageUtils"}isImage(t){return this.isInlineImage(t)||this.isBlockImage(t)}isInlineImageView(t){return!!t&&t.is("element","img")}isBlockImageView(t){return!!t&&t.is("element","figure")&&t.hasClass("image")}insertImage(t={},e=null,n=null){const i=this.editor;const o=i.model;const r=o.document.selection;n=$B(i,e||r,n);t={...Object.fromEntries(r.getAttributes()),...t};for(const e in t){if(!o.schema.checkAttribute(n,e)){delete t[e]}}return o.change((i=>{const s=i.createElement(n,t);if(!e&&n!="imageInline"){e=CS(r,o)}o.insertContent(s,e);if(s.parent){i.setSelection(s,"on");return s}return null}))}getClosestSelectedImageWidget(t){const e=t.getSelectedElement();if(e&&this.isImageWidget(e)){return e}let n=t.getFirstPosition().parent;while(n){if(n.is("element")&&this.isImageWidget(n)){return n}n=n.parent}return null}getClosestSelectedImageElement(t){const e=t.getSelectedElement();return this.isImage(e)?e:t.getFirstPosition().findAncestor("imageBlock")}isImageAllowed(){const t=this.editor.model;const e=t.document.selection;return WB(this.editor,e)&&GB(e)}toImageWidget(t,e,n){e.setCustomProperty("image",true,t);const i=()=>{const e=this.findViewImgElement(t);const i=e.getAttribute("alt");return i?`${i} ${n}`:n};return gS(t,e,{label:i})}isImageWidget(t){return!!t.getCustomProperty("image")&&fS(t)}isBlockImage(t){return!!t&&t.is("element","imageBlock")}isInlineImage(t){return!!t&&t.is("element","imageInline")}findViewImgElement(t){if(this.isInlineImageView(t)){return t}const e=this.editor.editing.view;for(const{item:n}of e.createRangeIn(t)){if(this.isInlineImageView(n)){return n}}}}function WB(t,e){const n=$B(t,e);if(n=="imageBlock"){const n=KB(e,t.model);if(t.model.schema.checkChild(n,"imageBlock")){return true}}else if(t.model.schema.checkChild(e.focus,"imageInline")){return true}return false}function GB(t){return[...t.focus.getAncestors()].every((t=>!t.is("element","imageBlock")))}function KB(t,e){const n=CS(t,e);const i=n.start.parent;if(i.isEmpty&&!i.is("element","$root")){return i.parent}return i}function $B(t,e,n){const i=t.model.schema;const o=t.config.get("image.insert.type");if(!t.plugins.has("ImageBlockEditing")){return"imageInline"}if(!t.plugins.has("ImageInlineEditing")){return"imageBlock"}if(n){return n}if(o==="inline"){return"imageInline"}if(o==="block"){return"imageBlock"}if(e.is("selection")){return HB(i,e)}return i.checkChild(e,"imageInline")?"imageInline":"imageBlock"}class YB extends Un{static get requires(){return[qB]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new FB(this.editor))}}var QB=n(54);var ZB={injectType:"singletonStyleTag",attributes:{"data-cke":true}};ZB.insert="head";ZB.singleton=true;var JB=ru()(QB["a"],ZB);var XB=QB["a"].locals||{};class tN extends Wb{constructor(t){super(t);const e=this.locale.t;this.focusTracker=new Mf;this.keystrokes=new Bf;this.labeledInput=this._createLabeledInputView();this.saveButtonView=this._createButton(e("Save"),Pb.check,"ck-button-save");this.saveButtonView.type="submit";this.cancelButtonView=this._createButton(e("Cancel"),Pb.cancel,"ck-button-cancel","cancel");this._focusables=new jb;this._focusCycler=new Ww({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]});Rb(this)}render(){super.render();this.keystrokes.listenTo(this.element);Ob({view:this});[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach((t=>{this._focusables.add(t);this.focusTracker.add(t.element)}))}destroy(){super.destroy();this.focusTracker.destroy();this.keystrokes.destroy()}_createButton(t,e,n,i){const o=new zw(this.locale);o.set({label:t,icon:e,tooltip:true});o.extendTemplate({attributes:{class:n}});if(i){o.delegate("execute").to(this,i)}return o}_createLabeledInputView(){const t=this.locale.t;const e=new DC(this.locale,SC);e.label=t("Text alternative");return e}}function eN(t){const e=t.plugins.get("ContextualBalloon");if(t.plugins.get("ImageUtils").getClosestSelectedImageWidget(t.editing.view.document.selection)){const n=nN(t);e.updatePosition(n)}}function nN(t){const e=t.editing.view;const n=OC.defaultPositions;const i=t.plugins.get("ImageUtils");return{target:e.domConverter.viewToDom(i.getClosestSelectedImageWidget(e.document.selection)),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}class iN extends Un{static get requires(){return[JC]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton();this._createForm()}destroy(){super.destroy();this._form.destroy()}_createButton(){const t=this.editor;const e=t.t;t.ui.componentFactory.add("imageTextAlternative",(n=>{const i=t.commands.get("imageTextAlternative");const o=new zw(n);o.set({label:e("Change image text alternative"),icon:Pb.lowVision,tooltip:true});o.bind("isEnabled").to(i,"isEnabled");this.listenTo(o,"execute",(()=>{this._showForm()}));return o}))}_createForm(){const t=this.editor;const e=t.editing.view;const n=e.document;const i=t.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon");this._form=new tN(t.locale);this._form.render();this.listenTo(this._form,"submit",(()=>{t.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",((t,e)=>{this._hideForm(true);e()}));this.listenTo(t.ui,"update",(()=>{if(!i.getClosestSelectedImageWidget(n.selection)){this._hideForm(true)}else if(this._isVisible){eN(t)}}));Lb({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible){return}const t=this.editor;const e=t.commands.get("imageTextAlternative");const n=this._form.labeledInput;this._form.disableCssTransitions();if(!this._isInBalloon){this._balloon.add({view:this._form,position:nN(t)})}n.fieldView.value=n.fieldView.element.value=e.value||"";this._form.labeledInput.fieldView.select();this._form.enableCssTransitions()}_hideForm(t){if(!this._isInBalloon){return}if(this._form.focusTracker.isFocused){this._form.saveButtonView.focus()}this._balloon.remove(this._form);if(t){this.editor.editing.view.focus()}}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class oN extends Un{static get requires(){return[YB,iN]}static get pluginName(){return"ImageTextAlternative"}}function rN(t){return t=>{t.on("element:figure",e)};function e(e,n,i){if(!i.consumable.test(n.viewItem,{name:true,classes:"image"})){return}const o=t.findViewImgElement(n.viewItem);if(!o||!i.consumable.test(o,{name:true})){return}i.consumable.consume(n.viewItem,{name:true,classes:"image"});const r=i.convertItem(o,n.modelCursor);const s=If(r.modelRange.getItems());if(!s){i.consumable.revert(n.viewItem,{name:true,classes:"image"});return}i.convertChildren(n.viewItem,s);i.updateConversionResult(s,n)}}function sN(t){const e=["srcset","media","type"];return t=>{t.on("element:picture",n)};function n(n,i,o){const r=i.viewItem;if(!o.consumable.test(r,{name:true})){return}const s=new Map;for(const t of r.getChildren()){if(t.is("element","source")){const n={};for(const i of e){if(t.hasAttribute(i)){if(o.consumable.test(t,{attributes:i})){n[i]=t.getAttribute(i)}}}if(Object.keys(n).length){s.set(t,n)}}}const a=t.findViewImgElement(r);if(!a){return}let c=i.modelCursor.parent;if(!c.is("element","imageBlock")){const t=o.convertItem(a,i.modelCursor);i.modelRange=t.modelRange;i.modelCursor=t.modelCursor;c=If(t.modelRange.getItems())}o.consumable.consume(r,{name:true});for(const[t,e]of s){o.consumable.consume(t,{attributes:Object.keys(e)})}if(s.size){o.writer.setAttribute("sources",Array.from(s.values()),c)}o.convertChildren(r,c)}}function aN(t,e){return t=>{t.on(`attribute:srcset:${e}`,n)};function n(e,n,i){if(!i.consumable.consume(n.item,e.name)){return}const o=i.writer;const r=i.mapper.toViewElement(n.item);const s=t.findViewImgElement(r);if(n.attributeNewValue===null){const t=n.attributeOldValue;if(t.data){o.removeAttribute("srcset",s);o.removeAttribute("sizes",s);if(t.width){o.removeAttribute("width",s)}}}else{const t=n.attributeNewValue;if(t.data){o.setAttribute("srcset",t.data,s);o.setAttribute("sizes","100vw",s);if(t.width){o.setAttribute("width",t.width,s)}}}}}function cN(t){return t=>{t.on("attribute:sources:imageBlock",e);t.on("attribute:sources:imageInline",e)};function e(e,n,i){if(!i.consumable.consume(n.item,e.name)){return}const o=i.writer;const r=i.mapper.toViewElement(n.item);const s=t.findViewImgElement(r);if(n.attributeNewValue&&n.attributeNewValue.length){const t=o.createContainerElement("picture",{},{isAllowedInsideAttributeElement:true});for(const e of n.attributeNewValue){const n=o.createEmptyElement("source",e);o.insert(o.createPositionAt(t,"end"),n)}const e=[];let i=s.parent;while(i&&i.is("attributeElement")){const t=i.parent;o.unwrap(o.createRangeOn(s),i);e.unshift(i);i=t}o.insert(o.createPositionBefore(s),t);o.move(o.createRangeOn(s),o.createPositionAt(t,"end"));for(const n of e){o.wrap(o.createRangeOn(t),n)}}else if(s.parent.is("element","picture")){const t=s.parent;o.move(o.createRangeOn(s),o.createPositionBefore(t));o.remove(t)}}}function lN(t,e,n){return t=>{t.on(`attribute:${n}:${e}`,i)};function i(e,n,i){if(!i.consumable.consume(n.item,e.name)){return}const o=i.writer;const r=i.mapper.toViewElement(n.item);const s=t.findViewImgElement(r);o.setAttribute(n.attributeKey,n.attributeNewValue||"",s)}}class dN extends Ru{observe(t){this.listenTo(t,"load",((t,e)=>{const n=e.target;if(this.checkShouldIgnoreEventFromTarget(n)){return}if(n.tagName=="IMG"){this._fireEvents(e)}}),{useCapture:true})}_fireEvents(t){if(this.isEnabled){this.document.fire("layoutChanged");this.document.fire("imageLoaded",t)}}}class uN extends qn{constructor(t){super(t);const e=t.config.get("image.insert.type");if(!t.plugins.has("ImageBlockEditing")){if(e==="block"){Object(u["b"])("image-block-plugin-required")}}if(!t.plugins.has("ImageInlineEditing")){if(e==="inline"){Object(u["b"])("image-inline-plugin-required")}}}refresh(){this.isEnabled=this.editor.plugins.get("ImageUtils").isImageAllowed()}execute(t){const e=Aa(t.source);const n=this.editor.model.document.selection;const i=this.editor.plugins.get("ImageUtils");const o=Object.fromEntries(n.getAttributes());e.forEach(((t,e)=>{const r=n.getSelectedElement();if(typeof t==="string"){t={src:t}}if(e&&r&&i.isImage(r)){const e=this.editor.model.createPositionAfter(r);i.insertImage({...t,...o},e)}else{i.insertImage({...t,...o})}}))}}class hN extends Un{static get requires(){return[qB]}static get pluginName(){return"ImageEditing"}init(){const t=this.editor;const e=t.conversion;t.editing.view.addObserver(dN);e.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:t=>{const e={data:t.getAttribute("srcset")};if(t.hasAttribute("width")){e.width=t.getAttribute("width")}return e}}});const n=new uN(t);t.commands.add("insertImage",n);t.commands.add("imageInsert",n)}}class fN extends qn{constructor(t,e){super(t);this._modelElementName=e}refresh(){const t=this.editor;const e=t.plugins.get("ImageUtils");const n=e.getClosestSelectedImageElement(this.editor.model.document.selection);if(this._modelElementName==="imageBlock"){this.isEnabled=e.isInlineImage(n)}else{this.isEnabled=e.isBlockImage(n)}}execute(){const t=this.editor;const e=this.editor.model;const n=t.plugins.get("ImageUtils");const i=n.getClosestSelectedImageElement(e.document.selection);const o=Object.fromEntries(i.getAttributes());if(!o.src&&!o.uploadId){return null}return e.change((t=>{const r=Array.from(e.markers).filter((t=>t.getRange().containsItem(i)));const s=n.insertImage(o,e.createSelection(i,"on"),this._modelElementName);if(!s){return null}const a=t.createRangeOn(s);for(const e of r){const n=e.getRange();const i=n.root.rootName!="$graveyard"?n.getJoined(a,true):a;t.updateMarker(e,{range:i})}return{oldElement:i,newElement:s}}))}}class gN extends Un{static get requires(){return[hN,qB,rS]}static get pluginName(){return"ImageBlockEditing"}init(){const t=this.editor;const e=t.model.schema;e.register("imageBlock",{isObject:true,isBlock:true,allowWhere:"$block",allowAttributes:["alt","src","srcset"]});this._setupConversion();if(t.plugins.has("ImageInlineEditing")){t.commands.add("imageTypeBlock",new fN(this.editor,"imageBlock"));this._setupClipboardIntegration()}}_setupConversion(){const t=this.editor;const e=t.t;const n=t.conversion;const i=t.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageBlock",view:(t,{writer:e})=>VB(e,"imageBlock")});n.for("editingDowncast").elementToElement({model:"imageBlock",view:(t,{writer:n})=>i.toImageWidget(VB(n,"imageBlock"),n,e("image widget"))});n.for("downcast").add(lN(i,"imageBlock","src")).add(lN(i,"imageBlock","alt")).add(aN(i,"imageBlock"));n.for("upcast").elementToElement({view:UB(t,"imageBlock"),model:(t,{writer:e})=>e.createElement("imageBlock",t.hasAttribute("src")?{src:t.getAttribute("src")}:null)}).add(rN(i))}_setupClipboardIntegration(){const t=this.editor;const e=t.model;const n=t.editing.view;const i=t.plugins.get("ImageUtils");this.listenTo(t.plugins.get("ClipboardPipeline"),"inputTransformation",((o,r)=>{const s=Array.from(r.content.getChildren());let a;if(!s.every(i.isInlineImageView)){return}if(r.targetRanges){a=t.editing.mapper.toModelRange(r.targetRanges[0])}else{a=e.document.selection.getFirstRange()}const c=e.createSelection(a);if(HB(e.schema,c)==="imageBlock"){const t=new Kv(n.document);const e=s.map((e=>t.createElement("figure",{class:"image"},e)));r.content=t.createDocumentFragment(e)}}))}}var mN=n(55);var pN={injectType:"singletonStyleTag",attributes:{"data-cke":true}};pN.insert="head";pN.singleton=true;var kN=ru()(mN["a"],pN);var bN=mN["a"].locals||{};class wN extends Un{static get requires(){return[gN,tT,oN]}static get pluginName(){return"ImageBlock"}}class AN extends Un{static get requires(){return[hN,qB,rS]}static get pluginName(){return"ImageInlineEditing"}init(){const t=this.editor;const e=t.model.schema;e.register("imageInline",{isObject:true,isInline:true,allowWhere:"$text",allowAttributesOf:"$text",allowAttributes:["alt","src","srcset"]});e.addChildCheck(((t,e)=>{if(t.endsWith("caption")&&e.name==="imageInline"){return false}}));this._setupConversion();if(t.plugins.has("ImageBlockEditing")){t.commands.add("imageTypeInline",new fN(this.editor,"imageInline"));this._setupClipboardIntegration()}}_setupConversion(){const t=this.editor;const e=t.t;const n=t.conversion;const i=t.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageInline",view:(t,{writer:e})=>e.createEmptyElement("img")});n.for("editingDowncast").elementToElement({model:"imageInline",view:(t,{writer:n})=>i.toImageWidget(VB(n,"imageInline"),n,e("image widget"))});n.for("downcast").add(lN(i,"imageInline","src")).add(lN(i,"imageInline","alt")).add(aN(i,"imageInline"));n.for("upcast").elementToElement({view:UB(t,"imageInline"),model:(t,{writer:e})=>e.createElement("imageInline",t.hasAttribute("src")?{src:t.getAttribute("src")}:null)})}_setupClipboardIntegration(){const t=this.editor;const e=t.model;const n=t.editing.view;const i=t.plugins.get("ImageUtils");this.listenTo(t.plugins.get("ClipboardPipeline"),"inputTransformation",((o,r)=>{const s=Array.from(r.content.getChildren());let a;if(!s.every(i.isBlockImageView)){return}if(r.targetRanges){a=t.editing.mapper.toModelRange(r.targetRanges[0])}else{a=e.document.selection.getFirstRange()}const c=e.createSelection(a);if(HB(e.schema,c)==="imageInline"){const t=new Kv(n.document);const e=s.map((e=>{if(e.childCount===1){Array.from(e.getAttributes()).forEach((n=>t.setAttribute(...n,i.findViewImgElement(e))));return e.getChild(0)}else{return e}}));r.content=t.createDocumentFragment(e)}}))}}class CN extends Un{static get requires(){return[AN,tT,oN]}static get pluginName(){return"ImageInline"}}class vN extends Un{static get requires(){return[wN,CN]}static get pluginName(){return"Image"}}function _N(t){for(const e of t.getChildren()){if(!!e&&e.is("element","caption")){return e}}return null}function yN(t,e){const n=e.getFirstPosition().findAncestor("caption");if(!n){return null}if(t.isBlockImage(n.parent)){return n}return null}function xN(t,e){if(e.name=="figcaption"&&t.isBlockImageView(e.parent)){return{name:true}}return null}class EN extends qn{refresh(){const t=this.editor;const e=t.plugins.get("ImageUtils");if(!t.plugins.has(gN)){this.isEnabled=false;this.value=false;return}const n=t.model.document.selection;const i=n.getSelectedElement();if(!i){const t=yN(e,n);this.isEnabled=!!t;this.value=!!t;return}this.isEnabled=this.editor.plugins.get("ImageUtils").isImage(i);if(!this.isEnabled){this.value=false}else{this.value=!!_N(i)}}execute(t={}){const{focusCaptionOnShow:e}=t;this.editor.model.change((t=>{if(this.value){this._hideImageCaption(t)}else{this._showImageCaption(t,e)}}))}_showImageCaption(t,e){const n=this.editor.model;const i=n.document.selection;const o=this.editor.plugins.get("ImageCaptionEditing");let r=i.getSelectedElement();const s=o._getSavedCaption(r);if(this.editor.plugins.get("ImageUtils").isInlineImage(r)){this.editor.execute("imageTypeBlock");r=i.getSelectedElement()}const a=s||t.createElement("caption");t.append(a,r);if(e){t.setSelection(a,"in")}}_hideImageCaption(t){const e=this.editor;const n=e.model.document.selection;const i=e.plugins.get("ImageCaptionEditing");const o=e.plugins.get("ImageUtils");let r=n.getSelectedElement();let s;if(r){s=_N(r)}else{s=yN(o,n);r=s.parent}i._saveCaption(r,s);t.setSelection(r,"on");t.remove(s)}}class DN extends Un{static get requires(){return[qB]}static get pluginName(){return"ImageCaptionEditing"}constructor(t){super(t);this._savedCaptionsMap=new WeakMap}init(){const t=this.editor;const e=t.model.schema;if(!e.isRegistered("caption")){e.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:true})}else{e.extend("caption",{allowIn:"imageBlock"})}t.commands.add("toggleImageCaption",new EN(this.editor));this._setupConversion();this._setupImageTypeCommandsIntegration()}_setupConversion(){const t=this.editor;const e=t.editing.view;const n=t.plugins.get("ImageUtils");const i=t.t;t.conversion.for("upcast").elementToElement({view:t=>xN(n,t),model:"caption"});t.conversion.for("dataDowncast").elementToElement({model:"caption",view:(t,{writer:e})=>{if(!n.isBlockImage(t.parent)){return null}return e.createContainerElement("figcaption")}});t.conversion.for("editingDowncast").elementToElement({model:"caption",view:(t,{writer:o})=>{if(!n.isBlockImage(t.parent)){return null}const r=o.createEditableElement("figcaption");o.setCustomProperty("imageCaption",true,r);yv({view:e,element:r,text:i("Enter image caption"),keepOnFocus:true});return AS(r,o)}});t.editing.mapper.on("modelToViewPosition",SN(e));t.data.mapper.on("modelToViewPosition",SN(e))}_setupImageTypeCommandsIntegration(){const t=this.editor;const e=t.plugins.get("ImageUtils");const n=t.commands.get("imageTypeInline");const i=t.commands.get("imageTypeBlock");const o=t=>{if(!t.return){return}const{oldElement:n,newElement:i}=t.return;if(!n){return}if(e.isBlockImage(n)){const t=_N(n);if(t){this._saveCaption(i,t);return}}const o=this._getSavedCaption(n);if(o){this._saveCaption(i,o)}};if(n){this.listenTo(n,"execute",o,{priority:"low"})}if(i){this.listenTo(i,"execute",o,{priority:"low"})}}_getSavedCaption(t){const e=this._savedCaptionsMap.get(t);return e?Zf.fromJSON(e):null}_saveCaption(t,e){this._savedCaptionsMap.set(t,e.toJSON())}}function SN(t){return(e,n)=>{const i=n.modelPosition;const o=i.parent;if(!o.is("element","imageBlock")){return}const r=n.mapper.toViewElement(o);n.viewPosition=t.createPositionAt(r,i.offset+1)}}class TN extends Un{static get requires(){return[qB]}static get pluginName(){return"ImageCaptionUI"}init(){const t=this.editor;const e=t.editing.view;const n=t.plugins.get("ImageUtils");const i=t.t;t.ui.componentFactory.add("toggleImageCaption",(o=>{const r=t.commands.get("toggleImageCaption");const s=new zw(o);s.set({icon:Pb.caption,tooltip:true,isToggleable:true});s.bind("isOn","isEnabled").to(r,"value","isEnabled");s.bind("label").to(r,"value",(t=>t?i("Toggle caption off"):i("Toggle caption on")));this.listenTo(s,"execute",(()=>{t.execute("toggleImageCaption",{focusCaptionOnShow:true});const i=yN(n,t.model.document.selection);if(i){const n=t.editing.mapper.toViewElement(i);e.scrollToTheSelection();e.change((t=>{t.addClass("image__caption_highlighted",n)}))}}));return s}))}}var IN=n(56);var MN={injectType:"singletonStyleTag",attributes:{"data-cke":true}};MN.insert="head";MN.singleton=true;var BN=ru()(IN["a"],MN);var NN=IN["a"].locals||{};class zN extends Un{static get requires(){return[DN,TN]}static get pluginName(){return"ImageCaption"}}class PN extends qn{constructor(t,e){super(t);this._defaultStyles={imageBlock:false,imageInline:false};this._styles=new Map(e.map((t=>{if(t.isDefault){for(const e of t.modelElements){this._defaultStyles[e]=t.name}}return[t.name,t]})))}refresh(){const t=this.editor;const e=t.plugins.get("ImageUtils");const n=e.getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!n;if(!this.isEnabled){this.value=false}else if(n.hasAttribute("imageStyle")){this.value=n.getAttribute("imageStyle")}else{this.value=this._defaultStyles[n.name]}}execute(t={}){const e=this.editor;const n=e.model;const i=e.plugins.get("ImageUtils");n.change((e=>{const o=t.value;let r=i.getClosestSelectedImageElement(n.document.selection);if(o&&this.shouldConvertImageType(o,r)){this.editor.execute(i.isBlockImage(r)?"imageTypeInline":"imageTypeBlock");r=i.getClosestSelectedImageElement(n.document.selection)}if(!o||this._styles.get(o).isDefault){e.removeAttribute("imageStyle",r)}else{e.setAttribute("imageStyle",o,r)}}))}shouldConvertImageType(t,e){const n=this._styles.get(t).modelElements;return!n.includes(e.name)}}const{objectFullWidth:LN,objectInline:RN,objectLeft:ON,objectRight:jN,objectCenter:FN,objectBlockLeft:VN,objectBlockRight:UN}=Pb;const HN={inline:{name:"inline",title:"In line",icon:RN,modelElements:["imageInline"],isDefault:true},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:ON,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"},alignBlockLeft:{name:"alignBlockLeft",title:"Left aligned image",icon:VN,modelElements:["imageBlock"],className:"image-style-block-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:FN,modelElements:["imageBlock"],className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:jN,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"},alignBlockRight:{name:"alignBlockRight",title:"Right aligned image",icon:UN,modelElements:["imageBlock"],className:"image-style-block-align-right"},block:{name:"block",title:"Centered image",icon:FN,modelElements:["imageBlock"],isDefault:true},side:{name:"side",title:"Side image",icon:jN,modelElements:["imageBlock"],className:"image-style-side"}};const qN={full:LN,left:VN,right:UN,center:FN,inlineLeft:ON,inlineRight:jN,inline:RN};const WN=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function GN(t){const e=t.configuredStyles.options||[];const n=e.map((t=>YN(t))).filter((e=>QN(e,t)));return n}function KN(t,e){if(t&&e){return{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}}else if(t){return{options:["block","side"]}}else if(e){return{options:["inline","alignLeft","alignRight"]}}return{}}function $N(t){if(t.has("ImageBlockEditing")&&t.has("ImageInlineEditing")){return[...WN]}else{return[]}}function YN(t){if(typeof t==="string"){if(!HN[t]){t={name:t}}else{t={...HN[t]}}}else{t=ZN(HN[t.name],t)}if(typeof t.icon==="string"){t.icon=qN[t.icon]||t.icon}return t}function QN(t,{isBlockPluginLoaded:e,isInlinePluginLoaded:n}){const{modelElements:i,name:o}=t;if(!i||!i.length||!o){JN({style:t});return false}else{const o=[e?"imageBlock":null,n?"imageInline":null];if(!i.some((t=>o.includes(t)))){Object(u["b"])("image-style-missing-dependency",{style:t,missingPlugins:i.map((t=>t==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing"))});return false}}return true}function ZN(t,e){const n={...e};for(const i in t){if(!Object.prototype.hasOwnProperty.call(e,i)){n[i]=t[i]}}return n}function JN(t){Object(u["b"])("image-style-configuration-definition-invalid",t)}var XN={normalizeStyles:GN,getDefaultStylesConfiguration:KN,getDefaultDropdownDefinitions:$N,warnInvalidStyle:JN,DEFAULT_OPTIONS:HN,DEFAULT_ICONS:qN,DEFAULT_DROPDOWN_DEFINITIONS:WN};function tz(t){return(e,n,i)=>{if(!i.consumable.consume(n.item,e.name)){return}const o=nz(n.attributeNewValue,t);const r=nz(n.attributeOldValue,t);const s=i.mapper.toViewElement(n.item);const a=i.writer;if(r){a.removeClass(r.className,s)}if(o){a.addClass(o.className,s)}}}function ez(t){const e={imageInline:t.filter((t=>!t.isDefault&&t.modelElements.includes("imageInline"))),imageBlock:t.filter((t=>!t.isDefault&&t.modelElements.includes("imageBlock")))};return(t,n,i)=>{if(!n.modelRange){return}const o=n.viewItem;const r=If(n.modelRange.getItems());if(!r){return}if(!i.schema.checkAttribute(r,"imageStyle")){return}for(const t of e[r.name]){if(i.consumable.consume(o,{classes:t.className})){i.writer.setAttribute("imageStyle",t.name,r)}}}}function nz(t,e){for(const n of e){if(n.name===t){return n}}}class iz extends Un{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[qB]}init(){const{normalizeStyles:t,getDefaultStylesConfiguration:e}=XN;const n=this.editor;const i=n.plugins.has("ImageBlockEditing");const o=n.plugins.has("ImageInlineEditing");n.config.define("image.styles",e(i,o));this.normalizedStyles=t({configuredStyles:n.config.get("image.styles"),isBlockPluginLoaded:i,isInlinePluginLoaded:o});this._setupConversion(i,o);this._setupPostFixer();n.commands.add("imageStyle",new PN(n,this.normalizedStyles))}_setupConversion(t,e){const n=this.editor;const i=n.model.schema;const o=tz(this.normalizedStyles);const r=ez(this.normalizedStyles);n.editing.downcastDispatcher.on("attribute:imageStyle",o);n.data.downcastDispatcher.on("attribute:imageStyle",o);if(t){i.extend("imageBlock",{allowAttributes:"imageStyle"});n.data.upcastDispatcher.on("element:figure",r,{priority:"low"})}if(e){i.extend("imageInline",{allowAttributes:"imageStyle"});n.data.upcastDispatcher.on("element:img",r,{priority:"low"})}}_setupPostFixer(){const t=this.editor;const e=t.model.document;const n=t.plugins.get(qB);const i=new Map(this.normalizedStyles.map((t=>[t.name,t])));e.registerPostFixer((t=>{let o=false;for(const r of e.differ.getChanges()){if(r.type=="insert"||r.type=="attribute"&&r.attributeKey=="imageStyle"){let e=r.type=="insert"?r.position.nodeAfter:r.range.start.nodeAfter;if(e&&e.is("element","paragraph")&&e.childCount>0){e=e.getChild(0)}if(!n.isImage(e)){continue}const s=e.getAttribute("imageStyle");if(!s){continue}const a=i.get(s);if(!a||!a.modelElements.includes(e.name)){t.removeAttribute("imageStyle",e);o=true}}}return o}))}}var oz=n(57);var rz={injectType:"singletonStyleTag",attributes:{"data-cke":true}};rz.insert="head";rz.singleton=true;var sz=ru()(oz["a"],rz);var az=oz["a"].locals||{};class cz extends Un{static get requires(){return[iz]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Wrap text":t("Wrap text"),"Break text":t("Break text"),"In line":t("In line"),"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=this.editor.plugins;const e=this.editor.config.get("image.toolbar")||[];const n=lz(t.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const t of n){this._createButton(t)}const i=lz([...e.filter(S),...XN.getDefaultDropdownDefinitions(t)],this.localizedDefaultStylesTitles);for(const t of i){this._createDropdown(t,n)}}_createDropdown(t,e){const n=this.editor.ui.componentFactory;n.add(t.name,(i=>{let o;const{defaultItem:r,items:s,title:a}=t;const c=s.filter((t=>e.find((({name:e})=>dz(e)===t)))).map((t=>{const e=n.create(t);if(t===r){o=e}return e}));if(s.length!==c.length){XN.warnInvalidStyle({dropdown:t})}const l=WA(i,oA);const d=l.buttonView;GA(l,c);d.set({label:uz(a,o.label),class:null,tooltip:true});d.bind("icon").toMany(c,"isOn",((...t)=>{const e=t.findIndex(zt);return e<0?o.icon:c[e].icon}));d.bind("label").toMany(c,"isOn",((...t)=>{const e=t.findIndex(zt);return uz(a,e<0?o.label:c[e].label)}));d.bind("isOn").toMany(c,"isOn",((...t)=>t.some(zt)));d.bind("class").toMany(c,"isOn",((...t)=>t.some(zt)?"ck-splitbutton_flatten":null));d.on("execute",(()=>{if(!c.some((({isOn:t})=>t))){o.fire("execute")}else{l.isOpen=!l.isOpen}}));l.bind("isEnabled").toMany(c,"isEnabled",((...t)=>t.some(zt)));return l}))}_createButton(t){const e=t.name;this.editor.ui.componentFactory.add(dz(e),(n=>{const i=this.editor.commands.get("imageStyle");const o=new zw(n);o.set({label:t.title,icon:t.icon,tooltip:true,isToggleable:true});o.bind("isEnabled").to(i,"isEnabled");o.bind("isOn").to(i,"value",(t=>t===e));o.on("execute",this._executeCommand.bind(this,e));return o}))}_executeCommand(t){this.editor.execute("imageStyle",{value:t});this.editor.editing.view.focus()}}function lz(t,e){for(const n of t){if(e[n.title]){n.title=e[n.title]}}return t}function dz(t){return`imageStyle:${t}`}function uz(t,e){return(t?t+": ":"")+e}class hz extends Un{static get requires(){return[iz,cz]}static get pluginName(){return"ImageStyle"}}class fz extends Un{static get requires(){return[YM,qB]}static get pluginName(){return"ImageToolbar"}afterInit(){const t=this.editor;const e=t.t;const n=t.plugins.get(YM);const i=t.plugins.get("ImageUtils");n.register("image",{ariaLabel:e("Image toolbar"),items:gz(t.config.get("image.toolbar")||[]),getRelatedElement:t=>i.getClosestSelectedImageWidget(t)})}}function gz(t){return t.map((t=>S(t)?t.name:t))}function mz(t){const e=t.map((t=>t.replace("+","\\+")));return new RegExp(`^image\\/(${e.join("|")})$`)}function pz(t){return new Promise(((e,n)=>{const i=t.getAttribute("src");fetch(i).then((t=>t.blob())).then((t=>{const n=bz(t,i);const o=n.replace("image/","");const r=`image.${o}`;const s=new File([t],r,{type:n});e(s)})).catch((t=>t&&t.name==="TypeError"?wz(i).then(e).catch(n):n(t)))}))}function kz(t,e){if(!t.isInlineImageView(e)||!e.getAttribute("src")){return false}return e.getAttribute("src").match(/^data:image\/\w+;base64,/g)||e.getAttribute("src").match(/^blob:/g)}function bz(t,e){if(t.type){return t.type}else if(e.match(/data:(image\/\w+);base64/)){return e.match(/data:(image\/\w+);base64/)[1].toLowerCase()}else{return"image/jpeg"}}function wz(t){return Az(t).then((e=>{const n=bz(e,t);const i=n.replace("image/","");const o=`image.${i}`;return new File([e],o,{type:n})}))}function Az(t){return new Promise(((e,n)=>{const i=bu.document.createElement("img");i.addEventListener("load",(()=>{const t=bu.document.createElement("canvas");t.width=i.width;t.height=i.height;const o=t.getContext("2d");o.drawImage(i,0,0);t.toBlob((t=>t?e(t):n()))}));i.addEventListener("error",(()=>n()));i.src=t}))}class Cz extends Un{static get pluginName(){return"ImageUploadUI"}init(){const t=this.editor;const e=t.t;const n=n=>{const i=new LE(n);const o=t.commands.get("uploadImage");const r=t.config.get("image.upload.types");const s=mz(r);i.set({acceptedType:r.map((t=>`image/${t}`)).join(","),allowMultipleFiles:true});i.buttonView.set({label:e("Insert image"),icon:Pb.image,tooltip:true});i.buttonView.bind("isEnabled").to(o);i.on("done",((e,n)=>{const i=Array.from(n).filter((t=>s.test(t.type)));if(i.length){t.execute("uploadImage",{file:i})}}));return i};t.ui.componentFactory.add("uploadImage",n);t.ui.componentFactory.add("imageUpload",n)}}var vz=n(58);var _z={injectType:"singletonStyleTag",attributes:{"data-cke":true}};_z.insert="head";_z.singleton=true;var yz=ru()(vz["a"],_z);var xz=vz["a"].locals||{};var Ez=n(59);var Dz={injectType:"singletonStyleTag",attributes:{"data-cke":true}};Dz.insert="head";Dz.singleton=true;var Sz=ru()(Ez["a"],Dz);var Tz=Ez["a"].locals||{};var Iz=n(60);var Mz={injectType:"singletonStyleTag",attributes:{"data-cke":true}};Mz.insert="head";Mz.singleton=true;var Bz=ru()(Iz["a"],Mz);var Nz=Iz["a"].locals||{};class zz extends Un{static get pluginName(){return"ImageUploadProgress"}constructor(t){super(t);this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const t=this.editor;if(t.plugins.has("ImageBlockEditing")){t.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",((...t)=>this.uploadStatusChange(...t)))}if(t.plugins.has("ImageInlineEditing")){t.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",((...t)=>this.uploadStatusChange(...t)))}}uploadStatusChange(t,e,n){const i=this.editor;const o=e.item;const r=o.getAttribute("uploadId");if(!n.consumable.consume(e.item,t.name)){return}const s=i.plugins.get("ImageUtils");const a=i.plugins.get(zE);const c=r?e.attributeNewValue:null;const l=this.placeholder;const d=i.editing.mapper.toViewElement(o);const u=n.writer;if(c=="reading"){Pz(d,u);Rz(s,l,d,u);return}if(c=="uploading"){const t=a.loaders.get(r);Pz(d,u);if(!t){Rz(s,l,d,u)}else{Oz(d,u);jz(d,u,t,i.editing.view);Gz(s,d,u,t)}return}if(c=="complete"&&a.loaders.get(r)){Vz(d,u,i.editing.view)}Fz(d,u);Oz(d,u);Lz(d,u)}}function Pz(t,e){if(!t.hasClass("ck-appear")){e.addClass("ck-appear",t)}}function Lz(t,e){e.removeClass("ck-appear",t)}function Rz(t,e,n,i){if(!n.hasClass("ck-image-upload-placeholder")){i.addClass("ck-image-upload-placeholder",n)}const o=t.findViewImgElement(n);if(o.getAttribute("src")!==e){i.setAttribute("src",e,o)}if(!qz(n,"placeholder")){i.insert(i.createPositionAfter(o),Hz(i))}}function Oz(t,e){if(t.hasClass("ck-image-upload-placeholder")){e.removeClass("ck-image-upload-placeholder",t)}Wz(t,e,"placeholder")}function jz(t,e,n,i){const o=Uz(e);e.insert(e.createPositionAt(t,"end"),o);n.on("change:uploadedPercent",((t,e,n)=>{i.change((t=>{t.setStyle("width",n+"%",o)}))}))}function Fz(t,e){Wz(t,e,"progressBar")}function Vz(t,e,n){const i=e.createUIElement("div",{class:"ck-image-upload-complete-icon"});e.insert(e.createPositionAt(t,"end"),i);setTimeout((()=>{n.change((t=>t.remove(t.createRangeOn(i))))}),3e3)}function Uz(t){const e=t.createUIElement("div",{class:"ck-progress-bar"});t.setCustomProperty("progressBar",true,e);return e}function Hz(t){const e=t.createUIElement("div",{class:"ck-upload-placeholder-loader"});t.setCustomProperty("placeholder",true,e);return e}function qz(t,e){for(const n of t.getChildren()){if(n.getCustomProperty(e)){return n}}}function Wz(t,e,n){const i=qz(t,n);if(i){e.remove(e.createRangeOn(i))}}function Gz(t,e,n,i){if(i.data){const o=t.findViewImgElement(e);n.setAttribute("src",i.data,o)}}class Kz extends qn{refresh(){const t=this.editor;const e=t.plugins.get("ImageUtils");const n=t.model.document.selection.getSelectedElement();this.isEnabled=e.isImageAllowed()||e.isImage(n)}execute(t){const e=Aa(t.file);const n=this.editor.model.document.selection;const i=this.editor.plugins.get("ImageUtils");const o=Object.fromEntries(n.getAttributes());e.forEach(((t,e)=>{const r=n.getSelectedElement();if(e&&r&&i.isImage(r)){const e=this.editor.model.createPositionAfter(r);this._uploadImage(t,o,e)}else{this._uploadImage(t,o)}}))}_uploadImage(t,e,n){const i=this.editor;const o=i.plugins.get(zE);const r=o.createLoader(t);const s=i.plugins.get("ImageUtils");if(!r){return}s.insertImage({...e,uploadId:r.id},n)}}class $z extends Un{static get requires(){return[zE,IC,rS,qB]}static get pluginName(){return"ImageUploadEditing"}constructor(t){super(t);t.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}});this._uploadImageElements=new Map}init(){const t=this.editor;const e=t.model.document;const n=t.conversion;const i=t.plugins.get(zE);const o=t.plugins.get("ImageUtils");const r=mz(t.config.get("image.upload.types"));const s=new Kz(t);t.commands.add("uploadImage",s);t.commands.add("imageUpload",s);n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"});this.listenTo(t.editing.view.document,"clipboardInput",((e,n)=>{if(Yz(n.dataTransfer)){return}const i=Array.from(n.dataTransfer.files).filter((t=>{if(!t){return false}return r.test(t.type)}));if(!i.length){return}e.stop();t.model.change((e=>{if(n.targetRanges){e.setSelection(n.targetRanges.map((e=>t.editing.mapper.toModelRange(e))))}t.model.enqueueChange("default",(()=>{t.execute("uploadImage",{file:i})}))}))}));this.listenTo(t.plugins.get("ClipboardPipeline"),"inputTransformation",((e,n)=>{const r=Array.from(t.editing.view.createRangeIn(n.content)).filter((t=>kz(o,t.item)&&!t.item.getAttribute("uploadProcessed"))).map((t=>({promise:pz(t.item),imageElement:t.item})));if(!r.length){return}const s=new Kv(t.editing.view.document);for(const t of r){s.setAttribute("uploadProcessed",true,t.imageElement);const e=i.createLoader(t.promise);if(e){s.setAttribute("src","",t.imageElement);s.setAttribute("uploadId",e.id,t.imageElement)}}}));t.editing.view.document.on("dragover",((t,e)=>{e.preventDefault()}));e.on("change",(()=>{const n=e.differ.getChanges({includeChangesInGraveyard:true}).reverse();const o=new Set;for(const e of n){if(e.type=="insert"&&e.name!="$text"){const n=e.position.nodeAfter;const r=e.position.root.rootName=="$graveyard";for(const e of Qz(t,n)){const t=e.getAttribute("uploadId");if(!t){continue}const n=i.loaders.get(t);if(!n){continue}if(r){if(!o.has(t)){n.abort()}}else{o.add(t);this._uploadImageElements.set(t,e);if(n.status=="idle"){this._readAndUpload(n)}}}}}}));this.on("uploadComplete",((t,{imageElement:e,data:n})=>{const i=n.urls?n.urls:n;this.editor.model.change((t=>{t.setAttribute("src",i.default,e);this._parseAndSetSrcsetAttributeOnImage(i,e,t)}))}),{priority:"low"})}afterInit(){const t=this.editor.model.schema;if(this.editor.plugins.has("ImageBlockEditing")){t.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]})}if(this.editor.plugins.has("ImageInlineEditing")){t.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}}_readAndUpload(t){const e=this.editor;const n=e.model;const i=e.locale.t;const o=e.plugins.get(zE);const r=e.plugins.get(IC);const s=e.plugins.get("ImageUtils");const a=this._uploadImageElements;n.enqueueChange("transparent",(e=>{e.setAttribute("uploadStatus","reading",a.get(t.id))}));return t.read().then((()=>{const i=t.upload();const o=a.get(t.id);if(Yl.isSafari){const t=e.editing.mapper.toViewElement(o);const n=s.findViewImgElement(t);e.editing.view.once("render",(()=>{if(!n.parent){return}const t=e.editing.view.domConverter.mapViewToDom(n.parent);if(!t){return}const i=t.style.display;t.style.display="none";t._ckHack=t.offsetHeight;t.style.display=i}))}n.enqueueChange("transparent",(t=>{t.setAttribute("uploadStatus","uploading",o)}));return i})).then((e=>{n.enqueueChange("transparent",(n=>{const i=a.get(t.id);n.setAttribute("uploadStatus","complete",i);this.fire("uploadComplete",{data:e,imageElement:i})}));c()})).catch((e=>{if(t.status!=="error"&&t.status!=="aborted"){throw e}if(t.status=="error"&&e){r.showWarning(e,{title:i("Upload failed"),namespace:"upload"})}n.enqueueChange("transparent",(e=>{e.remove(a.get(t.id))}));c()}));function c(){n.enqueueChange("transparent",(e=>{const n=a.get(t.id);e.removeAttribute("uploadId",n);e.removeAttribute("uploadStatus",n);a.delete(t.id)}));o.destroyLoader(t)}}_parseAndSetSrcsetAttributeOnImage(t,e,n){let i=0;const o=Object.keys(t).filter((t=>{const e=parseInt(t,10);if(!isNaN(e)){i=Math.max(i,e);return true}})).map((e=>`${t[e]} ${e}w`)).join(", ");if(o!=""){n.setAttribute("srcset",{data:o,width:i},e)}}}function Yz(t){return Array.from(t.types).includes("text/html")&&t.getData("text/html")!==""}function Qz(t,e){const n=t.plugins.get("ImageUtils");return Array.from(t.model.createRangeOn(e)).filter((t=>n.isImage(t.item))).map((t=>t.item))}class Zz extends Un{static get pluginName(){return"ImageUpload"}static get requires(){return[$z,Cz,zz]}}class Jz extends Un{static get pluginName(){return"IndentEditing"}init(){const t=this.editor;t.commands.add("indent",new Gn(t));t.commands.add("outdent",new Gn(t))}}var Xz='';var tP='';class eP extends Un{static get pluginName(){return"IndentUI"}init(){const t=this.editor;const e=t.locale;const n=t.t;const i=e.uiLanguageDirection=="ltr"?Xz:tP;const o=e.uiLanguageDirection=="ltr"?tP:Xz;this._defineButton("indent",n("Increase indent"),i);this._defineButton("outdent",n("Decrease indent"),o)}_defineButton(t,e,n){const i=this.editor;i.ui.componentFactory.add(t,(o=>{const r=i.commands.get(t);const s=new zw(o);s.set({label:e,icon:n,tooltip:true});s.bind("isOn","isEnabled").to(r,"value","isEnabled");this.listenTo(s,"execute",(()=>{i.execute(t);i.editing.view.focus()}));return s}))}}class nP extends Un{static get pluginName(){return"Indent"}static get requires(){return[Jz,eP]}}const iP="italic";class oP extends Un{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:iP});t.model.schema.setAttributeProperties(iP,{isFormatting:true,copyOnEnter:true});t.conversion.attributeToElement({model:iP,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]});t.commands.add(iP,new AE(t,iP));t.keystrokes.set("CTRL+I",iP)}}var rP='';const sP="italic";class aP extends Un{static get pluginName(){return"ItalicUI"}init(){const t=this.editor;const e=t.t;t.ui.componentFactory.add(sP,(n=>{const i=t.commands.get(sP);const o=new zw(n);o.set({label:e("Italic"),icon:rP,keystroke:"CTRL+I",tooltip:true,isToggleable:true});o.bind("isOn","isEnabled").to(i,"value","isEnabled");this.listenTo(o,"execute",(()=>{t.execute(sP);t.editing.view.focus()}));return o}))}}class cP extends Un{static get requires(){return[oP,aP]}static get pluginName(){return"Italic"}}class lP{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){if(Array.isArray(t)){t.forEach((t=>this._definitions.add(t)))}else{this._definitions.add(t)}}getDispatcher(){return t=>{t.on("attribute:linkHref",((t,e,n)=>{if(!n.consumable.test(e.item,"attribute:linkHref")){return}const i=n.writer;const o=i.document.selection;for(const t of this._definitions){const r=i.createAttributeElement("a",t.attributes,{priority:5});if(t.classes){i.addClass(t.classes,r)}for(const e in t.styles){i.setStyle(e,t.styles[e],r)}i.setCustomProperty("link",true,r);if(t.callback(e.attributeNewValue)){if(e.item.is("selection")){i.wrap(o.getFirstRange(),r)}else{i.wrap(n.mapper.toViewRange(e.range),r)}}else{i.unwrap(n.mapper.toViewRange(e.range),r)}}}),{priority:"high"})}}getDispatcherForLinkedImage(){return t=>{t.on("attribute:linkHref:imageBlock",((t,e,{writer:n,mapper:i})=>{const o=i.toViewElement(e.item);const r=Array.from(o.getChildren()).find((t=>t.name==="a"));for(const t of this._definitions){const i=Fa(t.attributes);if(t.callback(e.attributeNewValue)){for(const[t,e]of i){if(t==="class"){n.addClass(e,r)}else{n.setAttribute(t,e,r)}}if(t.classes){n.addClass(t.classes,r)}for(const e in t.styles){n.setStyle(e,t.styles[e],r)}}else{for(const[t,e]of i){if(t==="class"){n.removeClass(e,r)}else{n.removeAttribute(t,r)}}if(t.classes){n.removeClass(t.classes,r)}for(const e in t.styles){n.removeStyle(e,r)}}}}))}}}class dP extends qn{constructor(t){super(t);this.manualDecorators=new ba;this.automaticDecorators=new lP}restoreManualDecoratorStates(){for(const t of this.manualDecorators){t.value=this._getDecoratorStateFromModel(t.id)}}refresh(){const t=this.editor.model;const e=t.document.selection;const n=e.getSelectedElement()||If(e.getSelectedBlocks());if(Fx(n,t.schema)){this.value=n.getAttribute("linkHref");this.isEnabled=t.schema.checkAttribute(n,"linkHref")}else{this.value=e.getAttribute("linkHref");this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref")}for(const t of this.manualDecorators){t.value=this._getDecoratorStateFromModel(t.id)}}execute(t,e={}){const n=this.editor.model;const i=n.document.selection;const o=[];const r=[];for(const t in e){if(e[t]){o.push(t)}else{r.push(t)}}n.change((e=>{if(i.isCollapsed){const s=i.getFirstPosition();if(i.hasAttribute("linkHref")){const a=By(s,"linkHref",i.getAttribute("linkHref"),n);e.setAttribute("linkHref",t,a);o.forEach((t=>{e.setAttribute(t,true,a)}));r.forEach((t=>{e.removeAttribute(t,a)}));e.setSelection(e.createPositionAfter(a.end.nodeBefore))}else if(t!==""){const r=Fa(i.getAttributes());r.set("linkHref",t);o.forEach((t=>{r.set(t,true)}));const{end:a}=n.insertContent(e.createText(t,r),s);e.setSelection(a)}["linkHref",...o,...r].forEach((t=>{e.removeSelectionAttribute(t)}))}else{const s=n.schema.getValidRanges(i.getRanges(),"linkHref");const a=[];for(const t of i.getSelectedBlocks()){if(n.schema.checkAttribute(t,"linkHref")){a.push(e.createRangeOn(t))}}const c=a.slice();for(const t of s){if(this._isRangeToUpdate(t,a)){c.push(t)}}for(const n of c){e.setAttribute("linkHref",t,n);o.forEach((t=>{e.setAttribute(t,true,n)}));r.forEach((t=>{e.removeAttribute(t,n)}))}}}))}_getDecoratorStateFromModel(t){const e=this.editor.model;const n=e.document.selection;const i=n.getSelectedElement();if(Fx(i,e.schema)){return i.getAttribute(t)}return n.getAttribute(t)}_isRangeToUpdate(t,e){for(const n of e){if(n.containsRange(t)){return false}}return true}}class uP extends qn{refresh(){const t=this.editor.model;const e=t.document.selection;const n=e.getSelectedElement();if(Fx(n,t.schema)){this.isEnabled=t.schema.checkAttribute(n,"linkHref")}else{this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref")}}execute(){const t=this.editor;const e=this.editor.model;const n=e.document.selection;const i=t.commands.get("link");e.change((t=>{const o=n.isCollapsed?[By(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),e)]:e.schema.getValidRanges(n.getRanges(),"linkHref");for(const e of o){t.removeAttribute("linkHref",e);if(i){for(const n of i.manualDecorators){t.removeAttribute(n.id,e)}}}}))}}class hP{constructor({id:t,label:e,attributes:n,classes:i,styles:o,defaultValue:r}){this.id=t;this.set("value");this.defaultValue=r;this.label=e;this.attributes=n;this.classes=i;this.styles=o}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}Vn(hP,In);var fP=n(61);var gP={injectType:"singletonStyleTag",attributes:{"data-cke":true}};gP.insert="head";gP.singleton=true;var mP=ru()(fP["a"],gP);var pP=fP["a"].locals||{};const kP="ck-link_selected";const bP="automatic";const wP="manual";const AP=/^(https?:)?\/\//;class CP extends Un{static get pluginName(){return"LinkEditing"}static get requires(){return[hy,ry,rS]}constructor(t){super(t);t.config.define("link",{addTargetToExternalLinks:false})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"linkHref"});t.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Px});t.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(t,e)=>Px(Lx(t),e)});t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:true}},model:{key:"linkHref",value:t=>t.getAttribute("href")}});t.commands.add("link",new dP(t));t.commands.add("unlink",new uP(t));const e=Ox(t.t,jx(t.config.get("link.decorators")));this._enableAutomaticDecorators(e.filter((t=>t.mode===bP)));this._enableManualDecorators(e.filter((t=>t.mode===wP)));const n=t.plugins.get(hy);n.registerAttribute("linkHref");zy(t,"linkHref","a",kP);this._enableLinkOpen();this._enableInsertContentSelectionAttributesFixer();this._enableClickingAfterLink();this._enableTypingOverLink();this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(t){const e=this.editor;const n=e.commands.get("link");const i=n.automaticDecorators;if(e.config.get("link.addTargetToExternalLinks")){i.add({id:"linkIsExternal",mode:bP,callback:t=>AP.test(t),attributes:{target:"_blank",rel:"noopener noreferrer"}})}i.add(t);if(i.length){e.conversion.for("downcast").add(i.getDispatcher())}}_enableManualDecorators(t){if(!t.length){return}const e=this.editor;const n=e.commands.get("link");const i=n.manualDecorators;t.forEach((t=>{e.model.schema.extend("$text",{allowAttributes:t.id});t=new hP(t);i.add(t);e.conversion.for("downcast").attributeToElement({model:t.id,view:(e,{writer:n})=>{if(e){const e=n.createAttributeElement("a",t.attributes,{priority:5});if(t.classes){n.addClass(t.classes,e)}for(const i in t.styles){n.setStyle(i,t.styles[i],e)}n.setCustomProperty("link",true,e);return e}}});e.conversion.for("upcast").elementToAttribute({view:{name:"a",...t._createPattern()},model:{key:t.id}})}))}_enableLinkOpen(){const t=this.editor;const e=t.editing.view;const n=e.document;const i=t.model.document;this.listenTo(n,"click",((t,e)=>{const n=Yl.isMac?e.domEvent.metaKey:e.domEvent.ctrlKey;if(!n){return}let i=e.domTarget;if(i.tagName.toLowerCase()!="a"){i=i.closest("a")}if(!i){return}const o=i.getAttribute("href");if(!o){return}t.stop();e.preventDefault();Hx(o)}),{context:"$capture"});this.listenTo(n,"enter",((t,e)=>{const n=i.selection;const o=n.getSelectedElement();const r=o?o.getAttribute("linkHref"):n.getAttribute("linkHref");const s=r&&e.domEvent.altKey;if(!s){return}t.stop();Hx(r)}),{context:"a"})}_enableInsertContentSelectionAttributesFixer(){const t=this.editor;const e=t.model;const n=e.document.selection;this.listenTo(e,"insertContent",(()=>{const t=n.anchor.nodeBefore;const i=n.anchor.nodeAfter;if(!n.hasAttribute("linkHref")){return}if(!t){return}if(!t.hasAttribute("linkHref")){return}if(i&&i.hasAttribute("linkHref")){return}e.change((t=>{vP(t,xP(e.schema))}))}),{priority:"low"})}_enableClickingAfterLink(){const t=this.editor;const e=t.model;t.editing.view.addObserver(Gv);let n=false;this.listenTo(t.editing.view.document,"mousedown",(()=>{n=true}));this.listenTo(t.editing.view.document,"selectionChange",(()=>{if(!n){return}n=false;const t=e.document.selection;if(!t.isCollapsed){return}if(!t.hasAttribute("linkHref")){return}const i=t.getFirstPosition();const o=By(i,"linkHref",t.getAttribute("linkHref"),e);if(i.isTouching(o.start)||i.isTouching(o.end)){e.change((t=>{vP(t,xP(e.schema))}))}}))}_enableTypingOverLink(){const t=this.editor;const e=t.editing.view;let n;let i;this.listenTo(e.document,"delete",(()=>{i=true}),{priority:"high"});this.listenTo(t.model,"deleteContent",(()=>{const e=t.model.document.selection;if(e.isCollapsed){return}if(i){i=false;return}if(!yP(t)){return}if(_P(t.model)){n=e.getAttributes()}}),{priority:"high"});this.listenTo(t.model,"insertContent",((e,[o])=>{i=false;if(!yP(t)){return}if(!n){return}t.model.change((t=>{for(const[e,i]of n){t.setAttribute(e,i,o)}}));n=null}),{priority:"high"})}_handleDeleteContentAfterLink(){const t=this.editor;const e=t.model;const n=e.document.selection;const i=t.editing.view;let o=false;let r=false;this.listenTo(i.document,"delete",((t,e)=>{r=e.domEvent.keyCode===sd.backspace}),{priority:"high"});this.listenTo(e,"deleteContent",(()=>{o=false;const t=n.getFirstPosition();const i=n.getAttribute("linkHref");if(!i){return}const r=By(t,"linkHref",i,e);o=r.containsPosition(t)||r.end.isEqual(t)}),{priority:"high"});this.listenTo(e,"deleteContent",(()=>{if(!r){return}r=false;if(o){return}t.model.enqueueChange((t=>{vP(t,xP(e.schema))}))}),{priority:"low"})}}function vP(t,e){t.removeSelectionAttribute("linkHref");for(const n of e){t.removeSelectionAttribute(n)}}function _P(t){const e=t.document.selection;const n=e.getFirstPosition();const i=e.getLastPosition();const o=n.nodeAfter;if(!o){return false}if(!o.is("$text")){return false}if(!o.hasAttribute("linkHref")){return false}const r=i.textNode||i.nodeBefore;if(o===r){return true}const s=By(n,"linkHref",o.getAttribute("linkHref"),t);return s.containsRange(t.createRange(n,i),true)}function yP(t){const e=t.plugins.get("Input");return e.isInput(t.model.change((t=>t.batch)))}function xP(t){const e=t.getDefinition("$text").allowAttributes;return e.filter((t=>t.startsWith("link")))}var EP=n(62);var DP={injectType:"singletonStyleTag",attributes:{"data-cke":true}};DP.insert="head";DP.singleton=true;var SP=ru()(EP["a"],DP);var TP=EP["a"].locals||{};class IP extends Wb{constructor(t,e){super(t);const n=t.t;this.focusTracker=new Mf;this.keystrokes=new Bf;this.urlInputView=this._createUrlInput();this.saveButtonView=this._createButton(n("Save"),Pb.check,"ck-button-save");this.saveButtonView.type="submit";this.cancelButtonView=this._createButton(n("Cancel"),Pb.cancel,"ck-button-cancel","cancel");this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e);this.children=this._createFormChildren(e.manualDecorators);this._focusables=new jb;this._focusCycler=new Ww({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];if(e.manualDecorators.length){i.push("ck-link-form_layout-vertical","ck-vertical-form")}this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children});Rb(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce(((t,e)=>{t[e.name]=e.isOn;return t}),{})}render(){super.render();Ob({view:this});const t=[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView];t.forEach((t=>{this._focusables.add(t);this.focusTracker.add(t.element)}));this.keystrokes.listenTo(this.element)}destroy(){super.destroy();this.focusTracker.destroy();this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t;const e=new DC(this.locale,SC);e.label=t("Link URL");return e}_createButton(t,e,n,i){const o=new zw(this.locale);o.set({label:t,icon:e,tooltip:true});o.extendTemplate({attributes:{class:n}});if(i){o.delegate("execute").to(this,i)}return o}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const n of t.manualDecorators){const i=new jw(this.locale);i.set({name:n.id,label:n.label,withText:true});i.bind("isOn").toMany([n,t],"value",((t,e)=>e===undefined&&t===undefined?n.defaultValue:t));i.on("execute",(()=>{n.set("value",!i.isOn)}));e.add(i)}return e}_createFormChildren(t){const e=this.createCollection();e.add(this.urlInputView);if(t.length){const t=new Wb;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)}e.add(this.saveButtonView);e.add(this.cancelButtonView);return e}}var MP=n(63);var BP={injectType:"singletonStyleTag",attributes:{"data-cke":true}};BP.insert="head";BP.singleton=true;var NP=ru()(MP["a"],BP);var zP=MP["a"].locals||{};var PP='';class LP extends Wb{constructor(t){super(t);const e=t.t;this.focusTracker=new Mf;this.keystrokes=new Bf;this.previewButtonView=this._createPreviewButton();this.unlinkButtonView=this._createButton(e("Unlink"),PP,"unlink");this.editButtonView=this._createButton(e("Edit link"),Pb.pencil,"edit");this.set("href");this._focusables=new jb;this._focusCycler=new Ww({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();const t=[this.previewButtonView,this.editButtonView,this.unlinkButtonView];t.forEach((t=>{this._focusables.add(t);this.focusTracker.add(t.element)}));this.keystrokes.listenTo(this.element)}destroy(){super.destroy();this.focusTracker.destroy();this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(t,e,n){const i=new zw(this.locale);i.set({label:t,icon:e,tooltip:true});i.delegate("execute").to(this,n);return i}_createPreviewButton(){const t=new zw(this.locale);const e=this.bindTemplate;const n=this.t;t.set({withText:true,tooltip:n("Open link in new tab")});t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",(t=>t&&Lx(t))),target:"_blank",rel:"noopener noreferrer"}});t.bind("label").to(this,"href",(t=>t||n("This link has no URL")));t.bind("isEnabled").to(this,"href",(t=>!!t));t.template.tag="a";t.template.eventListeners={};return t}}var RP='';const OP="link-ui";class jP extends Un{static get requires(){return[JC]}static get pluginName(){return"LinkUI"}init(){const t=this.editor;t.editing.view.addObserver(Wv);this.actionsView=this._createActionsView();this.formView=this._createFormView();this._balloon=t.plugins.get(JC);this._createToolbarLinkButton();this._enableUserBalloonInteractions();t.conversion.for("editingDowncast").markerToHighlight({model:OP,view:{classes:["ck-fake-link-selection"]}});t.conversion.for("editingDowncast").markerToElement({model:OP,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy();this.formView.destroy()}_createActionsView(){const t=this.editor;const e=new LP(t.locale);const n=t.commands.get("link");const i=t.commands.get("unlink");e.bind("href").to(n,"value");e.editButtonView.bind("isEnabled").to(n);e.unlinkButtonView.bind("isEnabled").to(i);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(Nx,((t,e)=>{this._addFormView();e()}));return e}_createFormView(){const t=this.editor;const e=t.commands.get("link");const n=t.config.get("link.defaultProtocol");const i=new IP(t.locale,e);i.urlInputView.fieldView.bind("value").to(e,"value");i.urlInputView.bind("isReadOnly").to(e,"isEnabled",(t=>!t));i.saveButtonView.bind("isEnabled").to(e);this.listenTo(i,"submit",(()=>{const{value:e}=i.urlInputView.fieldView.element;const o=Ux(e,n);t.execute("link",o,i.getDecoratorSwitchesState());this._closeFormView()}));this.listenTo(i,"cancel",(()=>{this._closeFormView()}));i.keystrokes.set("Esc",((t,e)=>{this._closeFormView();e()}));return i}_createToolbarLinkButton(){const t=this.editor;const e=t.commands.get("link");const n=t.t;t.keystrokes.set(Nx,((t,n)=>{n();if(e.isEnabled){this._showUI(true)}}));t.ui.componentFactory.add("link",(t=>{const i=new zw(t);i.isEnabled=true;i.label=n("Link");i.icon=RP;i.keystroke=Nx;i.tooltip=true;i.isToggleable=true;i.bind("isEnabled").to(e,"isEnabled");i.bind("isOn").to(e,"value",(t=>!!t));this.listenTo(i,"execute",(()=>this._showUI(true)));return i}))}_enableUserBalloonInteractions(){const t=this.editor.editing.view.document;this.listenTo(t,"click",(()=>{const t=this._getSelectedLinkElement();if(t){this._showUI()}}));this.editor.keystrokes.set("Tab",((t,e)=>{if(this._areActionsVisible&&!this.actionsView.focusTracker.isFocused){this.actionsView.focus();e()}}),{priority:"high"});this.editor.keystrokes.set("Esc",((t,e)=>{if(this._isUIVisible){this._hideUI();e()}}));Lb({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 t=this.editor;const e=t.commands.get("link");this.formView.disableCssTransitions();this._balloon.add({view:this.formView,position:this._getBalloonPositionData()});if(this._balloon.visibleView===this.formView){this.formView.urlInputView.fieldView.select()}this.formView.enableCssTransitions();this.formView.urlInputView.fieldView.element.value=e.value||""}_closeFormView(){const t=this.editor.commands.get("link");t.restoreManualDecoratorStates();if(t.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(t=false){if(!this._getSelectedLinkElement()){this._showFakeVisualSelection();this._addActionsView();if(t){this._balloon.showStack("main")}this._addFormView()}else{if(this._areActionsVisible){this._addFormView()}else{this._addActionsView()}if(t){this._balloon.showStack("main")}}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;const e=t.editing.view.document;let n=this._getSelectedLinkElement();let i=r();const o=()=>{const t=this._getSelectedLinkElement();const e=r();if(n&&!t||!n&&e!==i){this._hideUI()}else if(this._isUIVisible){this._balloon.updatePosition(this._getBalloonPositionData())}n=t;i=e};function r(){return e.selection.focus.getAncestors().reverse().find((t=>t.is("element")))}this.listenTo(t.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 t=this._balloon.visibleView;return t==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view;const e=this.editor.model;const n=t.document;let i=null;if(e.markers.has(OP)){const e=Array.from(this.editor.editing.mapper.markerNameToElements(OP));const n=t.createRange(t.createPositionBefore(e[0]),t.createPositionAfter(e[e.length-1]));i=t.domConverter.viewRangeToDom(n)}else{i=()=>{const e=this._getSelectedLinkElement();return e?t.domConverter.mapViewToDom(e):t.domConverter.viewRangeToDom(n.selection.getFirstRange())}}return{target:i}}_getSelectedLinkElement(){const t=this.editor.editing.view;const e=t.document.selection;const n=e.getSelectedElement();if(e.isCollapsed||n&&fS(n)){return FP(e.getFirstPosition())}else{const n=e.getFirstRange().getTrimmed();const i=FP(n.start);const o=FP(n.end);if(!i||i!=o){return null}if(t.createRangeIn(i).getTrimmed().isEqual(n)){return i}else{return null}}}_showFakeVisualSelection(){const t=this.editor.model;t.change((e=>{const n=t.document.selection.getFirstRange();if(t.markers.has(OP)){e.updateMarker(OP,{range:n})}else{if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition((({item:e})=>!t.schema.isContent(e)),{boundaries:n});e.addMarker(OP,{usingOperation:false,affectsData:false,range:e.createRange(i,n.end)})}else{e.addMarker(OP,{usingOperation:false,affectsData:false,range:n})}}}))}_hideFakeVisualSelection(){const t=this.editor.model;if(t.markers.has(OP)){t.change((t=>{t.removeMarker(OP)}))}}}function FP(t){return t.getAncestors().find((t=>zx(t)))}class VP extends Un{static get requires(){return[CP,jP,Kx]}static get pluginName(){return"Link"}}class UP extends Un{static get requires(){return["ImageEditing","ImageUtils",CP]}static get pluginName(){return"LinkImageEditing"}init(){const t=this.editor;const e=t.model.schema;if(t.plugins.has("ImageBlockEditing")){e.extend("imageBlock",{allowAttributes:["linkHref"]})}t.conversion.for("upcast").add(HP(t));t.conversion.for("downcast").add(qP(t));this._enableAutomaticDecorators();this._enableManualDecorators()}_enableAutomaticDecorators(){const t=this.editor;const e=t.commands.get("link");const n=e.automaticDecorators;if(n.length){t.conversion.for("downcast").add(n.getDispatcherForLinkedImage())}}_enableManualDecorators(){const t=this.editor;const e=t.commands.get("link");for(const n of e.manualDecorators){if(t.plugins.has("ImageBlockEditing")){t.model.schema.extend("imageBlock",{allowAttributes:n.id})}if(t.plugins.has("ImageInlineEditing")){t.model.schema.extend("imageInline",{allowAttributes:n.id})}t.conversion.for("downcast").add(WP(n));t.conversion.for("upcast").add(GP(t,n))}}}function HP(t){const e=t.plugins.has("ImageInlineEditing");const n=t.plugins.get("ImageUtils");return t=>{t.on("element:a",((t,i,o)=>{const r=i.viewItem;const s=n.findViewImgElement(r);if(!s){return}const a=s.findAncestor((t=>n.isBlockImageView(t)));if(e&&!a){return}const c={attributes:["href"]};if(!o.consumable.consume(r,c)){return}const l=r.getAttribute("href");if(!l){return}let d=i.modelCursor.parent;if(!d.is("element","imageBlock")){const t=o.convertItem(s,i.modelCursor);i.modelRange=t.modelRange;i.modelCursor=t.modelCursor;d=i.modelCursor.nodeBefore}if(d&&d.is("element","imageBlock")){o.writer.setAttribute("linkHref",l,d)}}),{priority:"high"})}}function qP(t){const e=t.plugins.get("ImageUtils");return t=>{t.on("attribute:linkHref:imageBlock",((t,n,i)=>{if(!i.consumable.consume(n.item,t.name)){return}const o=i.mapper.toViewElement(n.item);const r=i.writer;const s=Array.from(o.getChildren()).find((t=>t.name==="a"));const a=e.findViewImgElement(o);const c=a.parent.is("element","picture")?a.parent:a;if(s){if(n.attributeNewValue){r.setAttribute("href",n.attributeNewValue,s)}else{r.move(r.createRangeOn(c),r.createPositionAt(o,0));r.remove(s)}}else{const t=r.createContainerElement("a",{href:n.attributeNewValue});r.insert(r.createPositionAt(o,0),t);r.move(r.createRangeOn(c),r.createPositionAt(t,0))}}),{priority:"high"})}}function WP(t){return e=>{e.on(`attribute:${t.id}:imageBlock`,((e,n,i)=>{const o=i.mapper.toViewElement(n.item);const r=Array.from(o.getChildren()).find((t=>t.name==="a"));if(!r){return}for(const[e,n]of Fa(t.attributes)){i.writer.setAttribute(e,n,r)}if(t.classes){i.writer.addClass(t.classes,r)}for(const e in t.styles){i.writer.setStyle(e,t.styles[e],r)}}))}}function GP(t,e){const n=t.plugins.has("ImageInlineEditing");const i=t.plugins.get("ImageUtils");return t=>{t.on("element:a",((t,o,r)=>{const s=o.viewItem;const a=i.findViewImgElement(s);if(!a){return}const c=a.findAncestor((t=>i.isBlockImageView(t)));if(n&&!c){return}const l=new Va(e._createPattern());const d=l.match(s);if(!d){return}if(!r.consumable.consume(s,d.match)){return}const u=o.modelCursor.nodeBefore||o.modelCursor.parent;r.writer.setAttribute(e.id,true,u)}),{priority:"high"})}}class KP extends Un{static get requires(){return[CP,jP,"ImageBlockEditing"]}static get pluginName(){return"LinkImageUI"}init(){const t=this.editor;const e=t.editing.view.document;this.listenTo(e,"click",((e,n)=>{if(this._isSelectedLinkedImage(t.model.document.selection)){n.preventDefault();e.stop()}}),{priority:"high"});this._createToolbarLinkImageButton()}_createToolbarLinkImageButton(){const t=this.editor;const e=t.t;t.ui.componentFactory.add("linkImage",(n=>{const i=new zw(n);const o=t.plugins.get("LinkUI");const r=t.commands.get("link");i.set({isEnabled:true,label:e("Link image"),icon:RP,keystroke:Nx,tooltip:true,isToggleable:true});i.bind("isEnabled").to(r,"isEnabled");i.bind("isOn").to(r,"value",(t=>!!t));this.listenTo(i,"execute",(()=>{if(this._isSelectedLinkedImage(t.model.document.selection)){o._addActionsView()}else{o._showUI(true)}}));return i}))}_isSelectedLinkedImage(t){const e=t.getSelectedElement();const n=this.editor.plugins.get("ImageUtils");return n.isImage(e)&&e.hasAttribute("linkHref")}}var $P=n(64);var YP={injectType:"singletonStyleTag",attributes:{"data-cke":true}};YP.insert="head";YP.singleton=true;var QP=ru()($P["a"],YP);var ZP=$P["a"].locals||{};class JP extends Un{static get requires(){return[UP,KP]}static get pluginName(){return"LinkImage"}}class XP extends qn{constructor(t,e){super(t);this.type=e}refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model;const n=e.document;const i=Array.from(n.selection.getSelectedBlocks()).filter((t=>eL(t,e.schema)));const o=t.forceValue!==undefined?!t.forceValue:this.value;e.change((t=>{if(o){let e=i[i.length-1].nextSibling;let n=Number.POSITIVE_INFINITY;let o=[];while(e&&e.name=="listItem"&&e.getAttribute("listIndent")!==0){const t=e.getAttribute("listIndent");if(t=n){if(r>o.getAttribute("listIndent")){r=o.getAttribute("listIndent")}if(o.getAttribute("listIndent")==r){t[e?"unshift":"push"](o)}o=o[e?"previousSibling":"nextSibling"]}}}function eL(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class nL extends qn{constructor(t,e){super(t);this._indentBy=e=="forward"?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model;const e=t.document;let n=Array.from(e.selection.getSelectedBlocks());t.change((t=>{const e=n[n.length-1];let i=e.nextSibling;while(i&&i.name=="listItem"&&i.getAttribute("listIndent")>e.getAttribute("listIndent")){n.push(i);i=i.nextSibling}if(this._indentBy<0){n=n.reverse()}for(const e of n){const n=e.getAttribute("listIndent")+this._indentBy;if(n<0){t.rename(e,"paragraph")}else{t.setAttribute("listIndent",n,e)}}this.fire("_executeCleanup",n)}))}_checkEnabled(){const t=If(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem")){return false}if(this._indentBy>0){const e=t.getAttribute("listIndent");const n=t.getAttribute("listType");let i=t.previousSibling;while(i&&i.is("element","listItem")&&i.getAttribute("listIndent")>=e){if(i.getAttribute("listIndent")==e){return i.getAttribute("listType")==n}i=i.previousSibling}return false}return true}}function iL(t){const e=t.createContainerElement("li");e.getFillerOffset=hL;return e}function oL(t,e){const n=e.mapper;const i=e.writer;const o=t.getAttribute("listType")=="numbered"?"ol":"ul";const r=iL(i);const s=i.createContainerElement(o,null);i.insert(i.createPositionAt(s,0),r);n.bindElements(t,r);return r}function rL(t,e,n,i){const o=e.parent;const r=n.mapper;const s=n.writer;let a=r.toViewPosition(i.createPositionBefore(t));const c=cL(t.previousSibling,{sameIndent:true,smallerIndent:true,listIndent:t.getAttribute("listIndent")});const l=t.previousSibling;if(c&&c.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=r.toViewElement(c);a=s.breakContainer(s.createPositionAfter(t))}else{if(l&&l.name=="listItem"){a=r.toViewPosition(i.createPositionAt(l,"end"));const t=r.findMappedViewAncestor(a);const e=dL(t);if(e){a=s.createPositionBefore(e)}else{a=s.createPositionAt(t,"end")}}else{a=r.toViewPosition(i.createPositionBefore(t))}}a=aL(a);s.insert(a,o);if(l&&l.name=="listItem"){const t=r.toViewElement(l);const n=s.createRange(s.createPositionAt(t,0),a);const i=n.getWalker({ignoreElementEnd:true});for(const t of i){if(t.item.is("element","li")){const n=s.breakContainer(s.createPositionBefore(t.item));const o=t.item.parent;const r=s.createPositionAt(e,"end");sL(s,r.nodeBefore,r.nodeAfter);s.move(s.createRangeOn(o),r);i.position=n}}}else{const n=o.nextSibling;if(n&&(n.is("element","ul")||n.is("element","ol"))){let i=null;for(const e of n.getChildren()){const n=r.toModelElement(e);if(n&&n.getAttribute("listIndent")>t.getAttribute("listIndent")){i=e}else{break}}if(i){s.breakContainer(s.createPositionAfter(i));s.move(s.createRangeOn(i.parent),s.createPositionAt(e,"end"))}}}sL(s,o,o.nextSibling);sL(s,o.previousSibling,o)}function sL(t,e,n){if(!e||!n||e.name!="ul"&&e.name!="ol"){return null}if(e.name!=n.name||e.getAttribute("class")!==n.getAttribute("class")){return null}return t.mergeContainers(t.createPositionAfter(e))}function aL(t){return t.getLastMatchingPosition((t=>t.item.is("uiElement")))}function cL(t,e){const n=!!e.sameIndent;const i=!!e.smallerIndent;const o=e.listIndent;let r=t;while(r&&r.name=="listItem"){const t=r.getAttribute("listIndent");if(n&&o==t||i&&o>t){return r}if(e.direction==="forward"){r=r.nextSibling}else{r=r.previousSibling}}return null}function lL(t,e,n,i){t.ui.componentFactory.add(e,(o=>{const r=t.commands.get(e);const s=new zw(o);s.set({label:n,icon:i,tooltip:true,isToggleable:true});s.bind("isOn","isEnabled").to(r,"value","isEnabled");s.on("execute",(()=>{t.execute(e);t.editing.view.focus()}));return s}))}function dL(t){for(const e of t.getChildren()){if(e.name=="ul"||e.name=="ol"){return e}}return null}function uL(t,e){const n=[];const i=t.parent;const o={ignoreElementEnd:true,startPosition:t,shallow:true,direction:e};const r=i.getAttribute("listIndent");const s=[...new Xf(o)].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){continue}if(t.getAttribute("listType")!==i.getAttribute("listType")){break}if(t.getAttribute("listStyle")!==i.getAttribute("listStyle")){break}if(e==="backward"){n.unshift(t)}else{n.push(t)}}return n}function hL(){const t=!this.isEmpty&&(this.getChild(0).name=="ul"||this.getChild(0).name=="ol");if(this.isEmpty||t){return 0}return Al.call(this)}function fL(t){return(e,n,i)=>{const o=i.consumable;if(!o.test(n.item,"insert")||!o.test(n.item,"attribute:listType")||!o.test(n.item,"attribute:listIndent")){return}o.consume(n.item,"insert");o.consume(n.item,"attribute:listType");o.consume(n.item,"attribute:listIndent");const r=n.item;const s=oL(r,i);rL(r,s,i,t)}}function gL(t){return(e,n,i)=>{const o=i.mapper.toViewPosition(n.position);const r=o.getLastMatchingPosition((t=>!t.item.is("element","li")));const s=r.nodeAfter;const a=i.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){sL(a,l,l.nextSibling)}const h=i.mapper.toModelElement(s);TL(h.getAttribute("listIndent")+1,n.position,d.start,s,i,t);for(const t of a.createRangeIn(u).getItems()){i.mapper.unbindViewElement(t)}e.stop()}}function mL(t,e,n){if(!n.consumable.consume(e.item,"attribute:listType")){return}const i=n.mapper.toViewElement(e.item);const o=n.writer;o.breakContainer(o.createPositionBefore(i));o.breakContainer(o.createPositionAfter(i));const r=i.parent;const s=e.attributeNewValue=="numbered"?"ol":"ul";o.rename(s,r)}function pL(t,e,n){const i=n.mapper.toViewElement(e.item);const o=i.parent;const r=n.writer;sL(r,o,o.nextSibling);sL(r,o.previousSibling,o);for(const t of e.item.getChildren()){n.consumable.consume(t,"insert")}}function kL(t){return(e,n,i)=>{if(!i.consumable.consume(n.item,"attribute:listIndent")){return}const o=i.mapper.toViewElement(n.item);const r=i.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){sL(r,a,a.nextSibling)}TL(n.attributeOldValue+1,n.range.start,c.start,o,i,t);rL(n.item,o,i,t);for(const t of n.item.getChildren()){i.consumable.consume(t,"insert")}}}function bL(t,e,n){if(e.item.name!="listItem"){let t=n.mapper.toViewPosition(e.range.start);const i=n.writer;const o=[];while(t.parent.name=="ul"||t.parent.name=="ol"){t=i.breakContainer(t);if(t.parent.name!="li"){break}const e=t;const n=i.createPositionAt(t.parent,"end");if(!e.isEqual(n)){const t=i.remove(i.createRange(e,n));o.push(t)}t=i.createPositionAfter(t.parent)}if(o.length>0){for(let e=0;e0){const e=sL(i,n,n.nextSibling);if(e&&e.parent==n){t.offset--}}}sL(i,t.nodeBefore,t.nodeAfter)}}}function wL(t,e,n){const i=n.mapper.toViewPosition(e.position);const o=i.nodeBefore;const r=i.nodeAfter;sL(n.writer,o,r)}function AL(t,e,n){if(n.consumable.consume(e.viewItem,{name:true})){const t=n.writer;const i=t.createElement("listItem");const o=ML(e.viewItem);t.setAttribute("listIndent",o,i);const r=e.viewItem.parent&&e.viewItem.parent.name=="ol"?"numbered":"bulleted";t.setAttribute("listType",r,i);if(!n.safeInsert(i,e.modelCursor)){return}const s=DL(i,e.viewItem.getChildren(),n);e.modelRange=t.createRange(e.modelCursor,s);n.updateConversionResult(i,e)}}function CL(t,e,n){if(n.consumable.test(e.viewItem,{name:true})){const t=Array.from(e.viewItem.getChildren());for(const e of t){const t=!(e.is("element","li")||IL(e));if(t){e._remove()}}}}function vL(t,e,n){if(n.consumable.test(e.viewItem,{name:true})){if(e.viewItem.childCount===0){return}const t=[...e.viewItem.getChildren()];let n=false;for(const e of t){if(n&&!IL(e)){e._remove()}if(IL(e)){n=true}}}}function _L(t){return(e,n)=>{if(n.isPhantom){return}const i=n.modelPosition.nodeBefore;if(i&&i.is("element","listItem")){const e=n.mapper.toViewElement(i);const o=e.getAncestors().find(IL);const r=t.createPositionAt(e,0).getWalker();for(const t of r){if(t.type=="elementStart"&&t.item.is("element","li")){n.viewPosition=t.previousPosition;break}else if(t.type=="elementEnd"&&t.item==o){n.viewPosition=t.nextPosition;break}}}}}function yL(t){return(e,n)=>{const i=n.viewPosition;const o=i.parent;const r=n.mapper;if(o.name=="ul"||o.name=="ol"){if(!i.isAtEnd){const e=r.toModelElement(i.nodeAfter);n.modelPosition=t.createPositionBefore(e)}else{const e=r.toModelElement(i.nodeBefore);const o=r.getModelLength(i.nodeBefore);n.modelPosition=t.createPositionBefore(e).getShiftedBy(o)}e.stop()}else if(o.name=="li"&&i.nodeBefore&&(i.nodeBefore.name=="ul"||i.nodeBefore.name=="ol")){const s=r.toModelElement(o);let a=1;let c=i.nodeBefore;while(c&&IL(c)){a+=r.getModelLength(c);c=c.previousSibling}n.modelPosition=t.createPositionBefore(s).getShiftedBy(a);e.stop()}}}function xL(t,e){const n=t.document.differ.getChanges();const i=new Map;let o=false;for(const i of n){if(i.type=="insert"&&i.name=="listItem"){r(i.position)}else if(i.type=="insert"&&i.name!="listItem"){if(i.name!="$text"){const n=i.position.nodeAfter;if(n.hasAttribute("listIndent")){e.removeAttribute("listIndent",n);o=true}if(n.hasAttribute("listType")){e.removeAttribute("listType",n);o=true}if(n.hasAttribute("listStyle")){e.removeAttribute("listStyle",n);o=true}for(const e of Array.from(t.createRangeIn(n)).filter((t=>t.item.is("element","listItem")))){r(e.previousPosition)}}const n=i.position.getShiftedBy(i.length);r(n)}else if(i.type=="remove"&&i.name=="listItem"){r(i.position)}else if(i.type=="attribute"&&i.attributeKey=="listIndent"){r(i.range.start)}else if(i.type=="attribute"&&i.attributeKey=="listType"){r(i.range.start)}}for(const t of i.values()){s(t);a(t)}return o;function r(t){const e=t.nodeBefore;if(!e||!e.is("element","listItem")){const e=t.nodeAfter;if(e&&e.is("element","listItem")){i.set(e,e)}}else{let t=e;if(i.has(t)){return}for(let e=t.previousSibling;e&&e.is("element","listItem");e=t.previousSibling){t=e;if(i.has(t)){return}}i.set(e,t)}}function s(t){let n=0;let i=null;while(t&&t.is("element","listItem")){const r=t.getAttribute("listIndent");if(r>n){let s;if(i===null){i=r-n;s=n}else{if(i>r){i=r}s=r-i}e.setAttribute("listIndent",s,t);o=true}else{i=null;n=t.getAttribute("listIndent")+1}t=t.nextSibling}}function a(t){let n=[];let i=null;while(t&&t.is("element","listItem")){const r=t.getAttribute("listIndent");if(i&&i.getAttribute("listIndent")>r){n=n.slice(0,r+1)}if(r!=0){if(n[r]){const i=n[r];if(t.getAttribute("listType")!=i){e.setAttribute("listType",i,t);o=true}}else{n[r]=t.getAttribute("listType")}}i=t;t=t.nextSibling}}}function EL(t,[e,n]){let i=e.is("documentFragment")?e.getChild(0):e;let o;if(!n){o=this.document.selection}else{o=this.createSelection(n)}if(i&&i.is("element","listItem")){const t=o.getFirstPosition();let e=null;if(t.parent.is("element","listItem")){e=t.parent}else if(t.nodeBefore&&t.nodeBefore.is("element","listItem")){e=t.nodeBefore}if(e){const t=e.getAttribute("listIndent");if(t>0){while(i&&i.is("element","listItem")){i._setAttribute("listIndent",i.getAttribute("listIndent")+t);i=i.nextSibling}}}}}function DL(t,e,n){const{writer:i,schema:o}=n;let r=i.createPositionAfter(t);for(const s of e){if(s.name=="ul"||s.name=="ol"){r=n.convertItem(s,r).modelCursor}else{const e=n.convertItem(s,i.createPositionAt(t,"end"));const a=e.modelRange.start.nodeAfter;const c=a&&a.is("element")&&!o.checkChild(t,a.name);if(c){if(e.modelCursor.parent.is("element","listItem")){t=e.modelCursor.parent}else{t=SL(e.modelCursor)}r=i.createPositionAfter(t)}}}return r}function SL(t){const e=new Xf({startPosition:t});let n;do{n=e.next()}while(!n.value.item.is("element","listItem"));return n.value.item}function TL(t,e,n,i,o,r){const s=cL(e.nodeBefore,{sameIndent:true,smallerIndent:true,listIndent:t,foo:"b"});const a=o.mapper;const c=o.writer;const l=s?s.getAttribute("listIndent"):null;let d;if(!s){d=n}else if(l==t){const t=a.toViewElement(s).parent;d=c.createPositionAfter(t)}else{const t=r.createPositionAt(s,"end");d=a.toViewPosition(t)}d=aL(d);for(const t of[...i.getChildren()]){if(IL(t)){d=c.move(c.createRangeOn(t),d).end;sL(c,t,t.nextSibling);sL(c,t.previousSibling,t)}}}function IL(t){return t.is("element","ol")||t.is("element","ul")}function ML(t){let e=0;let n=t.parent;while(n){if(n.is("element","li")){e++}else{const t=n.previousSibling;if(t&&t.is("element","li")){e++}}n=n.parent}return e}class BL extends Un{static get pluginName(){return"ListEditing"}static get requires(){return[nE,cy]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data;const n=t.editing;t.model.document.registerPostFixer((e=>xL(t.model,e)));n.mapper.registerViewToModelLength("li",NL);e.mapper.registerViewToModelLength("li",NL);n.mapper.on("modelToViewPosition",_L(n.view));n.mapper.on("viewToModelPosition",yL(t.model));e.mapper.on("modelToViewPosition",_L(n.view));t.conversion.for("editingDowncast").add((e=>{e.on("insert",bL,{priority:"high"});e.on("insert:listItem",fL(t.model));e.on("attribute:listType:listItem",mL,{priority:"high"});e.on("attribute:listType:listItem",pL,{priority:"low"});e.on("attribute:listIndent:listItem",kL(t.model));e.on("remove:listItem",gL(t.model));e.on("remove",wL,{priority:"low"})}));t.conversion.for("dataDowncast").add((e=>{e.on("insert",bL,{priority:"high"});e.on("insert:listItem",fL(t.model))}));t.conversion.for("upcast").add((t=>{t.on("element:ul",CL,{priority:"high"});t.on("element:ol",CL,{priority:"high"});t.on("element:li",vL,{priority:"high"});t.on("element:li",AL)}));t.model.on("insertContent",EL,{priority:"high"});t.commands.add("numberedList",new XP(t,"numbered"));t.commands.add("bulletedList",new XP(t,"bulleted"));t.commands.add("indentList",new nL(t,"forward"));t.commands.add("outdentList",new nL(t,"backward"));const i=n.view.document;this.listenTo(i,"enter",((t,e)=>{const n=this.editor.model.document;const i=n.selection.getLastPosition().parent;if(n.selection.isCollapsed&&i.name=="listItem"&&i.isEmpty){this.editor.execute("outdentList");e.preventDefault();t.stop()}}),{context:"li"});this.listenTo(i,"delete",((t,e)=>{if(e.direction!=="backward"){return}const n=this.editor.model.document.selection;if(!n.isCollapsed){return}const i=n.getFirstPosition();if(!i.isAtStart){return}const o=i.parent;if(o.name!=="listItem"){return}const r=o.previousSibling&&o.previousSibling.name==="listItem";if(r){return}this.editor.execute("outdentList");e.preventDefault();t.stop()}),{context:"li"});const o=t=>(e,n)=>{const i=this.editor.commands.get(t);if(i.isEnabled){this.editor.execute(t);n()}};t.keystrokes.set("Tab",o("indentList"));t.keystrokes.set("Shift+Tab",o("outdentList"))}afterInit(){const t=this.editor.commands;const e=t.get("indent");const n=t.get("outdent");if(e){e.registerChildCommand(t.get("indentList"))}if(n){n.registerChildCommand(t.get("outdentList"))}}}function NL(t){let e=1;for(const n of t.getChildren()){if(n.name=="ul"||n.name=="ol"){for(const t of n.getChildren()){e+=NL(t)}}}return e}var zL='';var PL='';class LL extends Un{static get pluginName(){return"ListUI"}init(){const t=this.editor.t;lL(this.editor,"numberedList",t("Numbered List"),zL);lL(this.editor,"bulletedList",t("Bulleted List"),PL)}}class RL extends Un{static get requires(){return[BL,LL]}static get pluginName(){return"List"}}class OL extends qn{constructor(t,e){super(t);this._defaultType=e}refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model;const n=e.document;let i=[...n.selection.getSelectedBlocks()].filter((t=>t.is("element","listItem"))).map((t=>{const n=e.change((e=>e.createPositionAt(t,0)));return[...uL(n,"backward"),...uL(n,"forward")]})).flat();i=[...new Set(i)];if(!i.length){return}e.change((e=>{for(const n of i){e.setAttribute("listStyle",t.type||this._defaultType,n)}}))}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;if(t&&t.is("element","listItem")){return t.getAttribute("listStyle")}return null}_checkEnabled(){const t=this.editor;const e=t.commands.get("numberedList");const n=t.commands.get("bulletedList");return e.isEnabled||n.isEnabled}}const jL="default";class FL extends Un{static get requires(){return[BL]}static get pluginName(){return"ListStyleEditing"}init(){const t=this.editor;const e=t.model;e.schema.extend("listItem",{allowAttributes:["listStyle"]});t.commands.add("listStyle",new OL(t,jL));this.listenTo(t.commands.get("indentList"),"_executeCleanup",HL(t));this.listenTo(t.commands.get("outdentList"),"_executeCleanup",qL(t));this.listenTo(t.commands.get("bulletedList"),"_executeCleanup",YL(t));this.listenTo(t.commands.get("numberedList"),"_executeCleanup",YL(t));e.document.registerPostFixer(WL(t));t.conversion.for("upcast").add(VL());t.conversion.for("downcast").add(UL());this._mergeListStyleAttributeWhileMergingLists()}afterInit(){const t=this.editor;if(t.commands.get("todoList")){t.model.document.registerPostFixer($L(t))}}_mergeListStyleAttributeWhileMergingLists(){const t=this.editor;const e=t.model;let n;this.listenTo(e,"deleteContent",((t,[e])=>{const i=e.getFirstPosition();const o=e.getLastPosition();if(i.parent===o.parent){return}if(!i.parent.is("element","listItem")){return}const r=o.parent.nextSibling;if(!r||!r.is("element","listItem")){return}const s=cL(i.parent,{sameIndent:true,listIndent:r.getAttribute("listIndent")});if(!s){return}if(s.getAttribute("listType")===r.getAttribute("listType")){n=s}}),{priority:"high"});this.listenTo(e,"deleteContent",(()=>{if(!n){return}e.change((t=>{const e=cL(n.nextSibling,{sameIndent:true,listIndent:n.getAttribute("listIndent"),direction:"forward"});const i=[e,...uL(t.createPositionAt(e,0),"forward")];for(const e of i){t.setAttribute("listStyle",n.getAttribute("listStyle"),e)}}));n=null}),{priority:"low"})}}function VL(){return t=>{t.on("element:li",((t,e,n)=>{const i=e.viewItem.parent;if(!i){return}const o=i.getStyle("list-style-type")||jL;const r=e.modelRange.start.nodeAfter||e.modelRange.end.nodeBefore;n.writer.setAttribute("listStyle",o,r)}),{priority:"low"})}}function UL(){return n=>{n.on("attribute:listStyle:listItem",((n,i,o)=>{const r=o.writer;const s=i.item;const a=cL(s.previousSibling,{sameIndent:true,listIndent:s.getAttribute("listIndent"),direction:"backward"});const c=o.mapper.toViewElement(s);if(!t(s,a)){r.breakContainer(r.createPositionBefore(c))}e(r,i.attributeNewValue,c.parent)}),{priority:"low"})};function t(t,e){return e&&t.getAttribute("listType")===e.getAttribute("listType")&&t.getAttribute("listIndent")===e.getAttribute("listIndent")&&t.getAttribute("listStyle")===e.getAttribute("listStyle")}function e(t,e,n){if(e&&e!==jL){t.setStyle("list-style-type",e,n)}else{t.removeStyle("list-style-type",n)}}}function HL(t){return(e,n)=>{let i;const o=n[0];const r=o.getAttribute("listIndent");const s=n.filter((t=>t.getAttribute("listIndent")===r));if(o.previousSibling.getAttribute("listIndent")+1===r){i=jL}else{const t=cL(o.previousSibling,{sameIndent:true,direction:"backward",listIndent:r});i=t.getAttribute("listStyle")}t.model.change((t=>{for(const e of s){t.setAttribute("listStyle",i,e)}}))}}function qL(t){return(e,n)=>{n=n.reverse().filter((t=>t.is("element","listItem")));if(!n.length){return}const i=n[0].getAttribute("listIndent");const o=n[0].getAttribute("listType");let r=n[0].previousSibling;if(r.is("element","listItem")){while(r.getAttribute("listIndent")!==i){r=r.previousSibling}}else{r=null}if(!r){r=n[n.length-1].nextSibling}if(!r||!r.is("element","listItem")){return}if(r.getAttribute("listType")!==o){return}t.model.change((t=>{const e=n.filter((t=>t.getAttribute("listIndent")===i));for(const n of e){t.setAttribute("listStyle",r.getAttribute("listStyle"),n)}}))}}function WL(t){return e=>{let n=false;const i=QL(t.model.document.differ.getChanges()).filter((t=>t.getAttribute("listType")!=="todo"));if(!i.length){return n}let o=i[i.length-1].nextSibling;if(!o||!o.is("element","listItem")){o=i[i.length-1].previousSibling;if(o){const t=i[0].getAttribute("listIndent");while(o.is("element","listItem")&&o.getAttribute("listIndent")!==t){o=o.previousSibling;if(!o){break}}}}for(const t of i){if(!t.hasAttribute("listStyle")){if(GL(o,t)){e.setAttribute("listStyle",o.getAttribute("listStyle"),t)}else{e.setAttribute("listStyle",jL,t)}n=true}else{const i=t.previousSibling;if(KL(i,t)){e.setAttribute("listStyle",i.getAttribute("listStyle"),t);n=true}}}return n}}function GL(t,e){if(!t){return false}const n=t.getAttribute("listStyle");if(!n){return false}if(n===jL){return false}if(t.getAttribute("listType")!==e.getAttribute("listType")){return false}return true}function KL(t,e){if(!t||!t.is("element","listItem")){return false}if(e.getAttribute("listType")!==t.getAttribute("listType")){return false}const n=t.getAttribute("listIndent");if(n<1||n!==e.getAttribute("listIndent")){return false}const i=t.getAttribute("listStyle");if(!i||i===e.getAttribute("listStyle")){return false}return true}function $L(t){return e=>{const n=QL(t.model.document.differ.getChanges()).filter((t=>t.getAttribute("listType")==="todo"&&t.hasAttribute("listStyle")));if(!n.length){return false}for(const t of n){e.removeAttribute("listStyle",t)}return true}}function YL(t){return(e,n)=>{n=n.filter((t=>t.is("element","listItem")));t.model.change((t=>{for(const e of n){t.removeAttribute("listStyle",e)}}))}}function QL(t){const e=[];for(const n of t){const t=ZL(n);if(t&&t.is("element","listItem")){e.push(t)}}return e}function ZL(t){if(t.type==="attribute"){return t.range.start.nodeAfter}if(t.type==="insert"){return t.position.nodeAfter}return null}var JL='';var XL='';var tR='';var eR='';var nR='';var iR='';var oR='';var rR='';var sR='';var aR=n(65);var cR={injectType:"singletonStyleTag",attributes:{"data-cke":true}};cR.insert="head";cR.singleton=true;var lR=ru()(aR["a"],cR);var dR=aR["a"].locals||{};class uR extends Un{static get pluginName(){return"ListStyleUI"}init(){const t=this.editor;const e=t.locale.t;t.ui.componentFactory.add("bulletedList",hR({editor:t,parentCommandName:"bulletedList",buttonLabel:e("Bulleted List"),buttonIcon:PL,toolbarAriaLabel:e("Bulleted list styles toolbar"),styleDefinitions:[{label:e("Toggle the disc list style"),tooltip:e("Disc"),type:"disc",icon:JL},{label:e("Toggle the circle list style"),tooltip:e("Circle"),type:"circle",icon:XL},{label:e("Toggle the square list style"),tooltip:e("Square"),type:"square",icon:tR}]}));t.ui.componentFactory.add("numberedList",hR({editor:t,parentCommandName:"numberedList",buttonLabel:e("Numbered List"),buttonIcon:zL,toolbarAriaLabel:e("Numbered list styles toolbar"),styleDefinitions:[{label:e("Toggle the decimal list style"),tooltip:e("Decimal"),type:"decimal",icon:eR},{label:e("Toggle the decimal with leading zero list style"),tooltip:e("Decimal with leading zero"),type:"decimal-leading-zero",icon:nR},{label:e("Toggle the lower鈥搑oman list style"),tooltip:e("Lower鈥搑oman"),type:"lower-roman",icon:iR},{label:e("Toggle the upper鈥搑oman list style"),tooltip:e("Upper-roman"),type:"upper-roman",icon:oR},{label:e("Toggle the lower鈥搇atin list style"),tooltip:e("Lower-latin"),type:"lower-latin",icon:rR},{label:e("Toggle the upper鈥搇atin list style"),tooltip:e("Upper-latin"),type:"upper-latin",icon:sR}]}))}}function hR({editor:t,parentCommandName:e,buttonLabel:n,buttonIcon:i,toolbarAriaLabel:o,styleDefinitions:r}){const s=t.commands.get(e);const a=t.commands.get("listStyle");return c=>{const l=WA(c,oA);const d=l.buttonView;const u=fR({editor:t,parentCommandName:e,listStyleCommand:a});GA(l,r.map(u));l.bind("isEnabled").to(s);l.toolbarView.ariaLabel=o;l.class="ck-list-styles-dropdown";d.on("execute",(()=>{t.execute(e);t.editing.view.focus()}));d.set({label:n,icon:i,tooltip:true,isToggleable:true});d.bind("isOn").to(s,"value",(t=>!!t));return l}}function fR({editor:t,listStyleCommand:e,parentCommandName:n}){const i=t.locale;const o=t.commands.get(n);return({label:r,type:s,icon:a,tooltip:c})=>{const l=new zw(i);l.set({label:r,icon:a,tooltip:c});e.on("change:value",(()=>{l.isOn=e.value===s}));l.on("execute",(()=>{if(o.value){if(e.value!==s){t.execute("listStyle",{type:s})}else{t.execute("listStyle",{type:e._defaultType})}}else{t.model.change((()=>{t.execute(n);t.execute("listStyle",{type:s})}))}t.editing.view.focus()}));return l}}class gR extends Un{static get requires(){return[FL,uR]}static get pluginName(){return"ListStyle"}}var mR=n(11);var pR=n.n(mR);pR.a.use({tokenizer:{autolink:()=>null,url:()=>null},renderer:{checkbox(...t){return Object.getPrototypeOf(this).checkbox.call(this,...t).trimRight()}}});function kR(t){return pR.a.parse(t,{gfm:true,breaks:true,tables:true,xhtml:true,headerIds:false})}function bR(t){for(var e=1;e ");return"\n\n"+t+"\n\n"}};ER.list={filter:["ul","ol"],replacement:function(t,e){var n=e.parentNode;if(n.nodeName==="LI"&&n.lastElementChild===e){return"\n"+t}else{return"\n\n"+t+"\n\n"}}};ER.listItem={filter:"li",replacement:function(t,e,n){t=t.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var i=n.bulletListMarker+" ";var o=e.parentNode;if(o.nodeName==="OL"){var r=o.getAttribute("start");var s=Array.prototype.indexOf.call(o.children,e);i=(r?Number(r)+s:s+1)+". "}return i+t+(e.nextSibling&&!/\n$/.test(t)?"\n":"")}};ER.indentedCodeBlock={filter:function(t,e){return e.codeBlockStyle==="indented"&&t.nodeName==="PRE"&&t.firstChild&&t.firstChild.nodeName==="CODE"},replacement:function(t,e,n){return"\n\n "+e.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}};ER.fencedCodeBlock={filter:function(t,e){return e.codeBlockStyle==="fenced"&&t.nodeName==="PRE"&&t.firstChild&&t.firstChild.nodeName==="CODE"},replacement:function(t,e,n){var i=e.firstChild.className||"";var o=(i.match(/language-(\S+)/)||[null,""])[1];var r=e.firstChild.textContent;var s=n.fence.charAt(0);var a=3;var c=new RegExp("^"+s+"{3,}","gm");var l;while(l=c.exec(r)){if(l[0].length>=a){a=l[0].length+1}}var d=wR(s,a);return"\n\n"+d+o+"\n"+r.replace(/\n$/,"")+"\n"+d+"\n\n"}};ER.horizontalRule={filter:"hr",replacement:function(t,e,n){return"\n\n"+n.hr+"\n\n"}};ER.inlineLink={filter:function(t,e){return e.linkStyle==="inlined"&&t.nodeName==="A"&&t.getAttribute("href")},replacement:function(t,e){var n=e.getAttribute("href");var i=e.title?' "'+e.title+'"':"";return"["+t+"]("+n+i+")"}};ER.referenceLink={filter:function(t,e){return e.linkStyle==="referenced"&&t.nodeName==="A"&&t.getAttribute("href")},replacement:function(t,e,n){var i=e.getAttribute("href");var o=e.title?' "'+e.title+'"':"";var r;var s;switch(n.linkReferenceStyle){case"collapsed":r="["+t+"][]";s="["+t+"]: "+i+o;break;case"shortcut":r="["+t+"]";s="["+t+"]: "+i+o;break;default:var a=this.references.length+1;r="["+t+"]["+a+"]";s="["+a+"]: "+i+o}this.references.push(s);return r},references:[],append:function(t){var e="";if(this.references.length){e="\n\n"+this.references.join("\n")+"\n\n";this.references=[]}return e}};ER.emphasis={filter:["em","i"],replacement:function(t,e,n){if(!t.trim())return"";return n.emDelimiter+t+n.emDelimiter}};ER.strong={filter:["strong","b"],replacement:function(t,e,n){if(!t.trim())return"";return n.strongDelimiter+t+n.strongDelimiter}};ER.code={filter:function(t){var e=t.previousSibling||t.nextSibling;var n=t.parentNode.nodeName==="PRE"&&!e;return t.nodeName==="CODE"&&!n},replacement:function(t){if(!t.trim())return"";var e="`";var n="";var i="";var o=t.match(/`+/gm);if(o){if(/^`/.test(t))n=" ";if(/`$/.test(t))i=" ";while(o.indexOf(e)!==-1)e=e+"`"}return e+n+t+i+e}};ER.image={filter:"img",replacement:function(t,e){var n=e.alt||"";var i=e.getAttribute("src")||"";var o=e.title||"";var r=o?' "'+o+'"':"";return i?"!["+n+"]"+"("+i+r+")":""}};function DR(t){this.options=t;this._keep=[];this._remove=[];this.blankRule={replacement:t.blankReplacement};this.keepReplacement=t.keepReplacement;this.defaultRule={replacement:t.defaultReplacement};this.array=[];for(var e in t.rules)this.array.push(t.rules[e])}DR.prototype={add:function(t,e){this.array.unshift(e)},keep:function(t){this._keep.unshift({filter:t,replacement:this.keepReplacement})},remove:function(t){this._remove.unshift({filter:t,replacement:function(){return""}})},forNode:function(t){if(t.isBlank)return this.blankRule;var e;if(e=SR(this.array,t,this.options))return e;if(e=SR(this._keep,t,this.options))return e;if(e=SR(this._remove,t,this.options))return e;return this.defaultRule},forEach:function(t){for(var e=0;e-1)return true}else if(typeof i==="function"){if(i.call(t,e,n))return true}else{throw new TypeError("`filter` needs to be a string, array, or function")}}function IR(t){var e=t.element;var n=t.isBlock;var i=t.isVoid;var o=t.isPre||function(t){return t.nodeName==="PRE"};if(!e.firstChild||o(e))return;var r=null;var s=false;var a=null;var c=BR(a,e,o);while(c!==e){if(c.nodeType===3||c.nodeType===4){var l=c.data.replace(/[ \r\n\t]+/g," ");if((!r||/ $/.test(r.data))&&!s&&l[0]===" "){l=l.substr(1)}if(!l){c=MR(c);continue}c.data=l;r=c}else if(c.nodeType===1){if(n(c)||c.nodeName==="BR"){if(r){r.data=r.data.replace(/ $/,"")}r=null;s=false}else if(i(c)){r=null;s=true}}else{c=MR(c);continue}var d=BR(a,c,o);a=c;c=d}if(r){r.data=r.data.replace(/ $/,"");if(!r.data){MR(r)}}}function MR(t){var e=t.nextSibling||t.parentNode;t.parentNode.removeChild(t);return e}function BR(t,e,n){if(t&&t.parentNode===e||n(e)){return e.nextSibling||e.parentNode}return e.firstChild||e.nextSibling||e.parentNode}var NR=typeof window!=="undefined"?window:{};function zR(){var t=NR.DOMParser;var e=false;try{if((new t).parseFromString("","text/html")){e=true}}catch(t){}return e}function PR(){var t=function(){};{var e=n(77).JSDOM;t.prototype.parseFromString=function(t){return new e(t).window.document}}return t}var LR=zR()?NR.DOMParser:PR();function RR(t){var e;if(typeof t==="string"){var n=jR().parseFromString(''+t+"","text/html");e=n.getElementById("turndown-root")}else{e=t.cloneNode(true)}IR({element:e,isBlock:CR,isVoid:_R});return e}var OR;function jR(){OR=OR||new LR;return OR}function FR(t){t.isBlock=CR(t);t.isCode=t.nodeName.toLowerCase()==="code"||t.parentNode.isCode;t.isBlank=VR(t);t.flankingWhitespace=UR(t);return t}function VR(t){return["A","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"].indexOf(t.nodeName)===-1&&/^\s*$/i.test(t.textContent)&&!_R(t)&&!xR(t)}function UR(t){var e="";var n="";if(!t.isBlock){var i=/^\s/.test(t.textContent);var o=/\s$/.test(t.textContent);var r=t.isBlank&&i&&o;if(i&&!HR("left",t)){e=" "}if(!r&&o&&!HR("right",t)){n=" "}}return{leading:e,trailing:n}}function HR(t,e){var n;var i;var o;if(t==="left"){n=e.previousSibling;i=/ $/}else{n=e.nextSibling;i=/^ /}if(n){if(n.nodeType===3){o=i.test(n.nodeValue)}else if(n.nodeType===1&&!CR(n)){o=i.test(n.textContent)}}return o}var qR=Array.prototype.reduce;var WR=/^\n*/;var GR=/\n*$/;var KR=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function $R(t){if(!(this instanceof $R))return new $R(t);var e={rules:ER,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",blankReplacement:function(t,e){return e.isBlock?"\n\n":""},keepReplacement:function(t,e){return e.isBlock?"\n\n"+e.outerHTML+"\n\n":e.outerHTML},defaultReplacement:function(t,e){return e.isBlock?"\n\n"+t+"\n\n":t}};this.options=bR({},e,t);this.rules=new DR(this.options)}$R.prototype={turndown:function(t){if(!tO(t)){throw new TypeError(t+" is not a string, or an element/document/fragment node.")}if(t==="")return"";var e=YR.call(this,new RR(t));return QR.call(this,e)},use:function(t){if(Array.isArray(t)){for(var e=0;en){e+=mO(t.substring(n,o))}const r=i[0];e+=r;n=o+r.length}if(n]*)/.source,"gi");function*AO(t){for(const e of t.matchAll(wO)){const t=e[0];const n=CO(t);yield Object.assign([t.substring(0,n)],{index:e.index})}}function CO(t){let e=t.length;while(e>0){const n=t[e-1];if("?!.,:*_~'\"".includes(n)){e--}else if(n==")"){let n=0;for(let i=0;i{t.on("attribute:url:media",n)};function n(n,i,o){if(!o.consumable.consume(i.item,n.name)){return}const r=i.attributeNewValue;const s=o.writer;const a=o.mapper.toViewElement(i.item);const c=[...a.getChildren()].find((t=>t.getCustomProperty("media-content")));s.remove(c);const l=t.getMediaViewElement(s,r,e);s.insert(s.createPositionAt(a,0),l)}}function xO(t,e,n){e.setCustomProperty("media",true,t);return gS(t,e,{label:n})}function EO(t){const e=t.getSelectedElement();if(e&&DO(e)){return e}return null}function DO(t){return!!t.getCustomProperty("media")&&fS(t)}function SO(t,e,n,i){const o=t.createContainerElement("figure",{class:"media"});t.insert(t.createPositionAt(o,0),e.getMediaViewElement(t,n,i));return o}function TO(t){const e=t.getSelectedElement();if(e&&e.is("element","media")){return e}return null}function IO(t,e,n){t.change((i=>{const o=i.createElement("media",{url:e});t.insertContent(o,n);i.setSelection(o,"on")}))}class MO extends qn{refresh(){const t=this.editor.model;const e=t.document.selection;const n=TO(e);this.value=n?n.getAttribute("url"):null;this.isEnabled=NO(e)||BO(e,t)}execute(t){const e=this.editor.model;const n=e.document.selection;const i=TO(n);if(i){e.change((e=>{e.setAttribute("url",t,i)}))}else{IO(e,t,CS(n,e))}}}function BO(t,e){const n=CS(t,e);let i=n.start.parent;if(i.isEmpty&&!e.schema.isLimit(i)){i=i.parent}return e.schema.checkChild(i,"media")}function NO(t){const e=t.getSelectedElement();return!!e&&e.name==="media"}var zO='';const PO="0 0 64 42";class LO{constructor(t,e){const n=e.providers;const i=e.extraProviders||[];const o=new Set(e.removeProviders);const r=n.concat(i).filter((t=>{const e=t.name;if(!e){Object(u["b"])("media-embed-no-provider-name",{provider:t});return false}return!o.has(e)}));this.locale=t;this.providerDefinitions=r}hasMedia(t){return!!this._getMedia(t)}getMediaViewElement(t,e,n){return this._getMedia(e).getViewElement(t,n)}_getMedia(t){if(!t){return new RO(this.locale)}t=t.trim();for(const e of this.providerDefinitions){const n=e.html;const i=Aa(e.url);for(const e of i){const i=this._getUrlMatches(t,e);if(i){return new RO(this.locale,t,i,n)}}}return null}_getUrlMatches(t,e){let n=t.match(e);if(n){return n}let i=t.replace(/^https?:\/\//,"");n=i.match(e);if(n){return n}i=i.replace(/^www\./,"");n=i.match(e);if(n){return n}return null}}class RO{constructor(t,e,n,i){this.url=this._getValidUrl(e);this._t=t.t;this._match=n;this._previewRenderer=i}getViewElement(t,e){const n={};let i;if(e.renderForEditingView||e.renderMediaPreview&&this.url&&this._previewRenderer){if(this.url){n["data-oembed-url"]=this.url}if(e.renderForEditingView){n.class="ck-media__wrapper"}const o=this._getPreviewHtml(e);i=t.createRawElement("div",n,((t,e)=>{e.setContentOf(t,o)}))}else{if(this.url){n.url=this.url}i=t.createEmptyElement(e.elementName,n)}t.setCustomProperty("media-content",true,i);return i}_getPreviewHtml(t){if(this._previewRenderer){return this._previewRenderer(this._match)}else{if(this.url&&t.renderForEditingView){return this._getPlaceholderHtml()}return""}}_getPlaceholderHtml(){const t=new Tw;const e=new yw;t.text=this._t("Open media in new tab");e.content=zO;e.viewBox=PO;const n=new Kb({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();return n.outerHTML}_getValidUrl(t){if(!t){return null}if(t.match(/^https?/)){return t}return"https://"+t}}var OO=n(66);var jO={injectType:"singletonStyleTag",attributes:{"data-cke":true}};jO.insert="head";jO.singleton=true;var FO=ru()(OO["a"],jO);var VO=OO["a"].locals||{};class UO extends Un{static get pluginName(){return"MediaEmbedEditing"}constructor(t){super(t);t.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:/^dailymotion\.com\/video\/(\w+)/,html:t=>{const e=t[1];return'
    '+`"+"
    "}},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:t=>{const e=t[1];return'
    '+`"+"
    "}},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)/,/^youtube\.com\/embed\/([\w-]+)/,/^youtu\.be\/([\w-]+)/],html:t=>{const e=t[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:t=>{const e=t[1];return'
    '+`"+"
    "}},{name:"instagram",url:/^instagram\.com\/p\/(\w+)/},{name:"twitter",url:/^twitter\.com/},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]});this.registry=new LO(t.locale,t.config.get("mediaEmbed"))}init(){const t=this.editor;const e=t.model.schema;const n=t.t;const i=t.conversion;const o=t.config.get("mediaEmbed.previewsInData");const r=t.config.get("mediaEmbed.elementName");const s=this.registry;t.commands.add("mediaEmbed",new MO(t));e.register("media",{isObject:true,isBlock:true,allowWhere:"$block",allowAttributes:["url"]});i.for("dataDowncast").elementToElement({model:"media",view:(t,{writer:e})=>{const n=t.getAttribute("url");return SO(e,s,n,{elementName:r,renderMediaPreview:n&&o})}});i.for("dataDowncast").add(yO(s,{elementName:r,renderMediaPreview:o}));i.for("editingDowncast").elementToElement({model:"media",view:(t,{writer:e})=>{const i=t.getAttribute("url");const o=SO(e,s,i,{elementName:r,renderForEditingView:true});return xO(o,e,n("media widget"))}});i.for("editingDowncast").add(yO(s,{elementName:r,renderForEditingView:true}));i.for("upcast").elementToElement({view:t=>["oembed",r].includes(t.name)&&t.getAttribute("url")?{name:true}:null,model:(t,{writer:e})=>{const n=t.getAttribute("url");if(s.hasMedia(n)){return e.createElement("media",{url:n})}}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":true}},model:(t,{writer:e})=>{const n=t.getAttribute("data-oembed-url");if(s.hasMedia(n)){return e.createElement("media",{url:n})}}}).add((t=>{t.on("element:figure",e);function e(t,e,n){if(!n.consumable.consume(e.viewItem,{name:true,classes:"media"})){return}const{modelRange:i,modelCursor:o}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=i;e.modelCursor=o;const r=If(i.getItems());if(!r){n.consumable.revert(e.viewItem,{name:true,classes:"media"})}}}))}}const HO=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class qO extends Un{static get requires(){return[vT,cy,jT]}static get pluginName(){return"AutoMediaEmbed"}constructor(t){super(t);this._timeoutId=null;this._positionToInsert=null}init(){const t=this.editor;const e=t.model.document;this.listenTo(t.plugins.get("ClipboardPipeline"),"inputTransformation",(()=>{const t=e.selection.getFirstRange();const n=ck.fromPosition(t.start);n.stickiness="toPrevious";const i=ck.fromPosition(t.end);i.stickiness="toNext";e.once("change:data",(()=>{this._embedMediaBetweenPositions(n,i);n.detach();i.detach()}),{priority:"high"})}));t.commands.get("undo").on("execute",(()=>{if(this._timeoutId){bu.window.clearTimeout(this._timeoutId);this._positionToInsert.detach();this._timeoutId=null;this._positionToInsert=null}}),{priority:"high"})}_embedMediaBetweenPositions(t,e){const n=this.editor;const i=n.plugins.get(UO).registry;const o=new Ag(t,e);const r=o.getWalker({ignoreElementEnd:true});let s="";for(const t of r){if(t.item.is("$textProxy")){s+=t.item.data}}s=s.trim();if(!s.match(HO)){o.detach();return}if(!i.hasMedia(s)){o.detach();return}const a=n.commands.get("mediaEmbed");if(!a.isEnabled){o.detach();return}this._positionToInsert=ck.fromPosition(t);this._timeoutId=bu.window.setTimeout((()=>{n.model.change((t=>{this._timeoutId=null;t.remove(o);o.detach();let e;if(this._positionToInsert.root.rootName!=="$graveyard"){e=this._positionToInsert}IO(n.model,s,e);this._positionToInsert.detach();this._positionToInsert=null}));n.plugins.get("Delete").requestUndoOnBackspace()}),100)}}var WO=n(67);var GO={injectType:"singletonStyleTag",attributes:{"data-cke":true}};GO.insert="head";GO.singleton=true;var KO=ru()(WO["a"],GO);var $O=WO["a"].locals||{};class YO extends Wb{constructor(t,e){super(e);const n=e.t;this.focusTracker=new Mf;this.keystrokes=new Bf;this.set("mediaURLInputValue","");this.urlInputView=this._createUrlInput();this.saveButtonView=this._createButton(n("Save"),Pb.check,"ck-button-save");this.saveButtonView.type="submit";this.saveButtonView.bind("isEnabled").to(this,"mediaURLInputValue",(t=>!!t));this.cancelButtonView=this._createButton(n("Cancel"),Pb.cancel,"ck-button-cancel","cancel");this._focusables=new jb;this._focusCycler=new Ww({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]});Rb(this)}render(){super.render();Ob({view:this});const t=[this.urlInputView,this.saveButtonView,this.cancelButtonView];t.forEach((t=>{this._focusables.add(t);this.focusTracker.add(t.element)}));this.keystrokes.listenTo(this.element);const e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e);this.keystrokes.set("arrowleft",e);this.keystrokes.set("arrowup",e);this.keystrokes.set("arrowdown",e);this.listenTo(this.urlInputView.element,"selectstart",((t,e)=>{e.stopPropagation()}),{priority:"high"})}destroy(){super.destroy();this.focusTracker.destroy();this.keystrokes.destroy()}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){this.urlInputView.errorText=e;return false}}return true}resetFormStatus(){this.urlInputView.errorText=null;this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const t=this.locale.t;const e=new DC(this.locale,SC);const n=e.fieldView;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;n.on("input",(()=>{e.infoText=n.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault;this.mediaURLInputValue=n.element.value.trim()}));return e}_createButton(t,e,n,i){const o=new zw(this.locale);o.set({label:t,icon:e,tooltip:true});o.extendTemplate({attributes:{class:n}});if(i){o.delegate("execute").to(this,i)}return o}}var QO='';class ZO extends Un{static get requires(){return[UO]}static get pluginName(){return"MediaEmbedUI"}init(){const t=this.editor;const e=t.commands.get("mediaEmbed");const n=t.plugins.get(UO).registry;t.ui.componentFactory.add("mediaEmbed",(i=>{const o=WA(i);const r=new YO(JO(t.t,n),t.locale);this._setUpDropdown(o,r,e,t);this._setUpForm(o,r,e);return o}))}_setUpDropdown(t,e,n){const i=this.editor;const o=i.t;const r=t.buttonView;t.bind("isEnabled").to(n);t.panelView.children.add(e);r.set({label:o("Insert media"),icon:QO,tooltip:true});r.on("open",(()=>{e.disableCssTransitions();e.url=n.value||"";e.urlInputView.fieldView.select();e.focus();e.enableCssTransitions()}),{priority:"low"});t.on("submit",(()=>{if(e.isValid()){i.execute("mediaEmbed",e.url);s()}}));t.on("change:isOpen",(()=>e.resetFormStatus()));t.on("cancel",(()=>s()));function s(){i.editing.view.focus();t.isOpen=false}}_setUpForm(t,e,n){e.delegate("submit","cancel").to(t);e.urlInputView.bind("value").to(n,"value");e.urlInputView.bind("isReadOnly").to(n,"isEnabled",(t=>!t))}}function JO(t,e){return[e=>{if(!e.url.length){return t("The URL must not be empty.")}},n=>{if(!e.hasMedia(n.url)){return t("This media URL is not supported.")}}]}var XO=n(68);var tj={injectType:"singletonStyleTag",attributes:{"data-cke":true}};tj.insert="head";tj.singleton=true;var ej=ru()(XO["a"],tj);var nj=XO["a"].locals||{};class ij extends Un{static get requires(){return[UO,ZO,qO,tT]}static get pluginName(){return"MediaEmbed"}}function oj(t,e){for(const n of t.getChildren()){if(n.is("element","b")&&n.getStyle("font-weight")==="normal"){const i=t.getChildIndex(n);e.remove(n);e.insertChild(i,n.getChildren(),t)}}}function rj(t,e){if(!t.childCount){return}const n=new Kv(t.document);const i=aj(t,n);if(!i.length){return}let o=null;let r=1;i.forEach(((t,s)=>{const a=pj(i[s-1],t);const c=a?null:i[s-1];const l=bj(c,t);if(a){o=null;r=1}if(!o||l!==0){const i=cj(t,e);if(!o){o=hj(i,t.element,n)}else if(t.indent>r){const t=o.getChild(o.childCount-1);const e=t.getChild(t.childCount-1);o=hj(i,e,n);r+=1}else if(t.indentString.fromCharCode(parseInt(t,16)))).join(""))}function yj(t,e){const n=e.createRangeIn(t);const i=new Va({name:/v:(.+)/});const o=[];for(const t of n){if(t.type!="elementStart"){continue}const e=t.item;const n=e.previousSibling&&e.previousSibling.name||null;if(i.match(e)&&e.getAttribute("o:gfxdata")&&n!=="v:shapetype"){o.push(t.item.getAttribute("id"))}}return o}function xj(t,e,n){const i=n.createRangeIn(e);const o=new Va({name:"img"});const r=[];for(const e of i){if(o.match(e.item)){const n=e.item;const i=n.getAttribute("v:shapes")?n.getAttribute("v:shapes").split(" "):[];if(i.length&&i.every((e=>t.indexOf(e)>-1))){r.push(n)}else if(!n.getAttribute("src")){r.push(n)}}}for(const t of r){n.remove(t)}}function Ej(t,e){const n=e.createRangeIn(t);const i=new Va({name:/v:(.+)/});const o=[];for(const t of n){if(t.type=="elementStart"&&i.match(t.item)){o.push(t.item)}}for(const t of o){e.remove(t)}}function Dj(t,e){const n=e.createRangeIn(t);const i=new Va({name:"img"});const o=[];for(const t of n){if(i.match(t.item)){if(t.item.getAttribute("src").startsWith("file://")){o.push(t.item)}}}return o}function Sj(t){if(!t){return[]}const e=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/;const n=new RegExp("(?:("+e.source+"))([\\da-fA-F\\s]+)\\}","g");const i=t.match(n);const o=[];if(i){for(const t of i){let n=false;if(t.includes("\\pngblip")){n="image/png"}else if(t.includes("\\jpegblip")){n="image/jpeg"}if(n){o.push({hex:t.replace(e,"").replace(/[^\da-fA-F]/g,""),type:n})}}}return o}function Tj(t,e,n){if(t.length===e.length){for(let i=0;i/i;const Mj=/xmlns:o="urn:schemas-microsoft-com/i;class Bj{constructor(t){this.document=t}isActive(t){return Ij.test(t)||Mj.test(t)}execute(t){const{body:e,stylesString:n}=t._parsedData;rj(e,n);vj(e,t.dataTransfer.getData("text/rtf"));t.content=e}}function Nj(t){return Pj(Pj(t)).replace(/([^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/ <\//g,"聽<\/o:p>/g,"聽").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)<")}function zj(t){t.querySelectorAll("span[style*=spacerun]").forEach((t=>{const e=t.innerText.length||0;t.innerHTML=Array(e+1).join("聽 ").substr(0,e)}))}function Pj(t){return t.replace(/(\s+)<\/span>/g,((t,e)=>e.length===1?" ":Array(e.length+1).join("聽 ").substr(0,e.length)))}function Lj(t,e){const n=new DOMParser;t=t.replace(//;K.html=W(K.html,\"i\").replace(\"comment\",K._comment).replace(\"tag\",K._tag).replace(\"attribute\",/ +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/).getRegex();K.paragraph=W(K._paragraph).replace(\"hr\",K.hr).replace(\"heading\",\" {0,3}#{1,6} \").replace(\"|lheading\",\"\").replace(\"blockquote\",\" {0,3}>\").replace(\"fences\",\" {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n\").replace(\"list\",\" {0,3}(?:[*+-]|1[.)]) \").replace(\"html\",\")|<(?:script|pre|style|!--)\").replace(\"tag\",K._tag).getRegex();K.blockquote=W(K.blockquote).replace(\"paragraph\",K.paragraph).getRegex();K.normal=G({},K);K.gfm=G({},K.normal,{nptable:\"^ *([^|\\\\n ].*\\\\|.*)\\\\n\"+\" *([-:]+ *\\\\|[-| :]*)\"+\"(?:\\\\n((?:(?!\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)\",table:\"^ *\\\\|(.+)\\\\n\"+\" *\\\\|?( *[-:]+[-| :]*)\"+\"(?:\\\\n *((?:(?!\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)\"});K.gfm.nptable=W(K.gfm.nptable).replace(\"hr\",K.hr).replace(\"heading\",\" {0,3}#{1,6} \").replace(\"blockquote\",\" {0,3}>\").replace(\"code\",\" {4}[^\\\\n]\").replace(\"fences\",\" {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n\").replace(\"list\",\" {0,3}(?:[*+-]|1[.)]) \").replace(\"html\",\")|<(?:script|pre|style|!--)\").replace(\"tag\",K._tag).getRegex();K.gfm.table=W(K.gfm.table).replace(\"hr\",K.hr).replace(\"heading\",\" {0,3}#{1,6} \").replace(\"blockquote\",\" {0,3}>\").replace(\"code\",\" {4}[^\\\\n]\").replace(\"fences\",\" {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n\").replace(\"list\",\" {0,3}(?:[*+-]|1[.)]) \").replace(\"html\",\")|<(?:script|pre|style|!--)\").replace(\"tag\",K._tag).getRegex();K.pedantic=G({},K.normal,{html:W(\"^ *(?:comment *(?:\\\\n|\\\\s*$)\"+\"|<(tag)[\\\\s\\\\S]+? *(?:\\\\n{2,}|\\\\s*$)\"+\"|\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))\").replace(\"comment\",K._comment).replace(/tag/g,\"(?!(?:\"+\"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub\"+\"|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\"+\"\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b\").getRegex(),def:/^ *\\[([^\\]]+)\\]: *]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,heading:/^ *(#{1,6}) *([^\\n]+?) *(?:#+ *)?(?:\\n+|$)/,fences:q,paragraph:W(K.normal._paragraph).replace(\"hr\",K.hr).replace(\"heading\",\" *#{1,6} *[^\\n]\").replace(\"lheading\",K.lheading).replace(\"blockquote\",\" {0,3}>\").replace(\"|fences\",\"\").replace(\"|list\",\"\").replace(\"|html\",\"\").getRegex()});var $={escape:/^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,autolink:/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,url:q,tag:\"^comment\"+\"|^\"+\"|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>\"+\"|^<\\\\?[\\\\s\\\\S]*?\\\\?>\"+\"|^\"+\"|^\",link:/^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/,reflink:/^!?\\[(label)\\]\\[(?!\\s*\\])((?:\\\\[\\[\\]]?|[^\\[\\]\\\\])+)\\]/,nolink:/^!?\\[(?!\\s*\\])((?:\\[[^\\[\\]]*\\]|\\\\[\\[\\]]|[^\\[\\]])*)\\](?:\\[\\])?/,reflinkSearch:\"reflink|nolink(?!\\\\()\",strong:{start:/^(?:(\\*\\*(?=[*punctuation]))|\\*\\*)(?![\\s])|__/,middle:/^\\*\\*(?:(?:(?!overlapSkip)(?:[^*]|\\\\\\*)|overlapSkip)|\\*(?:(?!overlapSkip)(?:[^*]|\\\\\\*)|overlapSkip)*?\\*)+?\\*\\*$|^__(?![\\s])((?:(?:(?!overlapSkip)(?:[^_]|\\\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\\s]\\*\\*(?!\\*)|[punctuation]\\*\\*(?!\\*)(?:(?=[punctuation\\s]|$))/,endUnd:/[^\\s]__(?!_)(?:(?=[punctuation\\s])|$)/},em:{start:/^(?:(\\*(?=[punctuation]))|\\*)(?![*\\s])|_/,middle:/^\\*(?:(?:(?!overlapSkip)(?:[^*]|\\\\\\*)|overlapSkip)|\\*(?:(?!overlapSkip)(?:[^*]|\\\\\\*)|overlapSkip)*?\\*)+?\\*$|^_(?![_\\s])(?:(?:(?!overlapSkip)(?:[^_]|\\\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\\s]\\*(?!\\*)|[punctuation]\\*(?!\\*)(?:(?=[punctuation\\s]|$))/,endUnd:/[^\\s]_(?!_)(?:(?=[punctuation\\s])|$)/},code:/^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,br:/^( {2,}|\\\\)\\n(?!\\s*$)/,del:q,text:/^(`+|[^`])(?:[\\s\\S]*?(?:(?=[\\\\?@\\\\[\\\\]`^{|}~\";$.punctuation=W($.punctuation).replace(/punctuation/g,$._punctuation).getRegex();$._blockSkip=\"\\\\[[^\\\\]]*?\\\\]\\\\([^\\\\)]*?\\\\)|`[^`]*?`|<[^>]*?>\";$._overlapSkip=\"__[^_]*?__|\\\\*\\\\*\\\\[^\\\\*\\\\]*?\\\\*\\\\*\";$.em.start=W($.em.start).replace(/punctuation/g,$._punctuation).getRegex();$.em.middle=W($.em.middle).replace(/punctuation/g,$._punctuation).replace(/overlapSkip/g,$._overlapSkip).getRegex();$.em.endAst=W($.em.endAst,\"g\").replace(/punctuation/g,$._punctuation).getRegex();$.em.endUnd=W($.em.endUnd,\"g\").replace(/punctuation/g,$._punctuation).getRegex();$.strong.start=W($.strong.start).replace(/punctuation/g,$._punctuation).getRegex();$.strong.middle=W($.strong.middle).replace(/punctuation/g,$._punctuation).replace(/blockSkip/g,$._blockSkip).getRegex();$.strong.endAst=W($.strong.endAst,\"g\").replace(/punctuation/g,$._punctuation).getRegex();$.strong.endUnd=W($.strong.endUnd,\"g\").replace(/punctuation/g,$._punctuation).getRegex();$.blockSkip=W($._blockSkip,\"g\").getRegex();$.overlapSkip=W($._overlapSkip,\"g\").getRegex();$._escapes=/\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;$._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;$._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;$.autolink=W($.autolink).replace(\"scheme\",$._scheme).replace(\"email\",$._email).getRegex();$._attribute=/\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;$.tag=W($.tag).replace(\"comment\",K._comment).replace(\"attribute\",$._attribute).getRegex();$._label=/(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;$._href=/<(?:\\\\[<>]?|[^\\s<>\\\\])*>|[^\\s\\x00-\\x1f]*/;$._title=/\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;$.link=W($.link).replace(\"label\",$._label).replace(\"href\",$._href).replace(\"title\",$._title).getRegex();$.reflink=W($.reflink).replace(\"label\",$._label).getRegex();$.reflinkSearch=W($.reflinkSearch,\"g\").replace(\"reflink\",$.reflink).replace(\"nolink\",$.nolink).getRegex();$.normal=G({},$);$.pedantic=G({},$.normal,{strong:{start:/^__|\\*\\*/,middle:/^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,endAst:/\\*\\*(?!\\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\\*/,middle:/^()\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)|^_(?=\\S)([\\s\\S]*?\\S)_(?!_)/,endAst:/\\*(?!\\*)/g,endUnd:/_(?!_)/g},link:W(/^!?\\[(label)\\]\\((.*?)\\)/).replace(\"label\",$._label).getRegex(),reflink:W(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/).replace(\"label\",$._label).getRegex()});$.gfm=G({},$.normal,{escape:W($.escape).replace(\"])\",\"~|])\").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\\S)([\\s\\S]*?\\S)~+/,text:/^(`+|[^`])(?:[\\s\\S]*?(?:(?=[\\\\.5){i=\"x\"+i.toString(16)}e+=\"&#\"+i+\";\"}return e}var et=function(){function t(t){this.tokens=[];this.tokens.links=Object.create(null);this.options=t||Q;this.options.tokenizer=this.options.tokenizer||new H;this.tokenizer=this.options.tokenizer;this.tokenizer.options=this.options;var e={block:Z.normal,inline:J.normal};if(this.options.pedantic){e.block=Z.pedantic;e.inline=J.pedantic}else if(this.options.gfm){e.block=Z.gfm;if(this.options.breaks){e.inline=J.breaks}else{e.inline=J.gfm}}this.tokenizer.rules=e}t.lex=function e(n,i){var o=new t(i);return o.lex(n)};var n=t.prototype;n.lex=function t(e){e=e.replace(/\\r\\n|\\r/g,\"\\n\").replace(/\\t/g,\" \");this.blockTokens(e,this.tokens,true);this.inline(this.tokens);return this.tokens};n.blockTokens=function t(e,n,i){if(n===void 0){n=[]}if(i===void 0){i=true}e=e.replace(/^ +$/gm,\"\");var o,r,s,a;while(e){if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);if(o.type){n.push(o)}continue}if(o=this.tokenizer.code(e,n)){e=e.substring(o.raw.length);if(o.type){n.push(o)}else{a=n[n.length-1];a.raw+=\"\\n\"+o.raw;a.text+=\"\\n\"+o.text}continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length);n.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length);n.push(o);continue}if(o=this.tokenizer.nptable(e)){e=e.substring(o.raw.length);n.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length);n.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length);o.tokens=this.blockTokens(o.text,[],i);n.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length);s=o.items.length;for(r=0;r0){while((c=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null){if(l.includes(c[0].slice(c[0].lastIndexOf(\"[\")+1,-1))){a=a.slice(0,c.index)+\"[\"+\"a\".repeat(c[0].length-2)+\"]\"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex)}}}}while((c=this.tokenizer.rules.inline.blockSkip.exec(a))!=null){a=a.slice(0,c.index)+\"[\"+\"a\".repeat(c[0].length-2)+\"]\"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex)}while(e){if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length);n.push(s);continue}if(s=this.tokenizer.tag(e,i,o)){e=e.substring(s.raw.length);i=s.inLink;o=s.inRawBlock;n.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length);if(s.type===\"link\"){s.tokens=this.inlineTokens(s.text,[],true,o)}n.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length);if(s.type===\"link\"){s.tokens=this.inlineTokens(s.text,[],true,o)}n.push(s);continue}if(s=this.tokenizer.strong(e,a,r)){e=e.substring(s.raw.length);s.tokens=this.inlineTokens(s.text,[],i,o);n.push(s);continue}if(s=this.tokenizer.em(e,a,r)){e=e.substring(s.raw.length);s.tokens=this.inlineTokens(s.text,[],i,o);n.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length);n.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length);n.push(s);continue}if(s=this.tokenizer.del(e)){e=e.substring(s.raw.length);s.tokens=this.inlineTokens(s.text,[],i,o);n.push(s);continue}if(s=this.tokenizer.autolink(e,tt)){e=e.substring(s.raw.length);n.push(s);continue}if(!i&&(s=this.tokenizer.url(e,tt))){e=e.substring(s.raw.length);n.push(s);continue}if(s=this.tokenizer.inlineText(e,o,X)){e=e.substring(s.raw.length);r=s.raw.slice(-1);n.push(s);continue}if(e){var d=\"Infinite loop on byte: \"+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else{throw new Error(d)}}}return n};e(t,null,[{key:\"rules\",get:function t(){return{block:Z,inline:J}}}]);return t}();var nt=s.defaults;var it=P.cleanUrl,ot=P.escape;var rt=function(){function t(t){this.options=t||nt}var e=t.prototype;e.code=function t(e,n,i){var o=(n||\"\").match(/\\S*/)[0];if(this.options.highlight){var r=this.options.highlight(e,o);if(r!=null&&r!==e){i=true;e=r}}if(!o){return\"
    \"+(i?e:ot(e,true))+\"
    \\n\"}return'
    '+(i?e:ot(e,true))+\"
    \\n\"};e.blockquote=function t(e){return\"
    \\n\"+e+\"
    \\n\"};e.html=function t(e){return e};e.heading=function t(e,n,i,o){if(this.options.headerIds){return\"'+e+\"\\n\"}return\"\"+e+\"\\n\"};e.hr=function t(){return this.options.xhtml?\"
    \\n\":\"
    \\n\"};e.list=function t(e,n,i){var o=n?\"ol\":\"ul\",r=n&&i!==1?' start=\"'+i+'\"':\"\";return\"<\"+o+r+\">\\n\"+e+\"\\n\"};e.listitem=function t(e){return\"
  • \"+e+\"
  • \\n\"};e.checkbox=function t(e){return\" \"};e.paragraph=function t(e){return\"

    \"+e+\"

    \\n\"};e.table=function t(e,n){if(n)n=\"\"+n+\"\";return\"\\n\"+\"\\n\"+e+\"\\n\"+n+\"
    \\n\"};e.tablerow=function t(e){return\"\\n\"+e+\"\\n\"};e.tablecell=function t(e,n){var i=n.header?\"th\":\"td\";var o=n.align?\"<\"+i+' align=\"'+n.align+'\">':\"<\"+i+\">\";return o+e+\"\\n\"};e.strong=function t(e){return\"\"+e+\"\"};e.em=function t(e){return\"\"+e+\"\"};e.codespan=function t(e){return\"\"+e+\"\"};e.br=function t(){return this.options.xhtml?\"
    \":\"
    \"};e.del=function t(e){return\"\"+e+\"\"};e.link=function t(e,n,i){e=it(this.options.sanitize,this.options.baseUrl,e);if(e===null){return i}var o='
    \"+i+\"\";return o};e.image=function t(e,n,i){e=it(this.options.sanitize,this.options.baseUrl,e);if(e===null){return i}var o='\"'+i+'\"';if(n){o+='\":\">\";return o};e.text=function t(e){return e};return t}();var st=function(){function t(){}var e=t.prototype;e.strong=function t(e){return e};e.em=function t(e){return e};e.codespan=function t(e){return e};e.del=function t(e){return e};e.html=function t(e){return e};e.text=function t(e){return e};e.link=function t(e,n,i){return\"\"+i};e.image=function t(e,n,i){return\"\"+i};e.br=function t(){return\"\"};return t}();var at=function(){function t(){this.seen={}}var e=t.prototype;e.slug=function t(e){var t=e.toLowerCase().trim().replace(/<[!\\/a-z].*?>/gi,\"\").replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g,\"\").replace(/\\s/g,\"-\");if(this.seen.hasOwnProperty(t)){var n=t;do{this.seen[n]++;t=n+\"-\"+this.seen[n]}while(this.seen.hasOwnProperty(t))}this.seen[t]=0;return t};return t}();var ct=s.defaults;var lt=P.unescape;var dt=function(){function t(t){this.options=t||ct;this.options.renderer=this.options.renderer||new rt;this.renderer=this.options.renderer;this.renderer.options=this.options;this.textRenderer=new st;this.slugger=new at}t.parse=function e(n,i){var o=new t(i);return o.parse(n)};var e=t.prototype;e.parse=function t(e,n){if(n===void 0){n=true}var i=\"\",o,r,s,a,c,l,d,u,h,f,g,m,p,k,b,w,A,C;var v=e.length;for(o=0;o0&&b.tokens[0].type===\"text\"){b.tokens[0].text=C+\" \"+b.tokens[0].text;if(b.tokens[0].tokens&&b.tokens[0].tokens.length>0&&b.tokens[0].tokens[0].type===\"text\"){b.tokens[0].tokens[0].text=C+\" \"+b.tokens[0].tokens[0].text}}else{b.tokens.unshift({type:\"text\",text:C})}}else{k+=C}}k+=this.parse(b.tokens,p);h+=this.renderer.listitem(k,A,w)}i+=this.renderer.list(h,g,m);continue}case\"html\":{i+=this.renderer.html(f.text);continue}case\"paragraph\":{i+=this.renderer.paragraph(this.parseInline(f.tokens));continue}case\"text\":{h=f.tokens?this.parseInline(f.tokens):f.text;while(o+1An error occurred:

    \"+ft(t.message+\"\",true)+\"
    \"}throw t}}kt.options=kt.setOptions=function(t){ut(kt.defaults,t);mt(kt.defaults);return kt};kt.getDefaults=gt;kt.defaults=pt;kt.use=function(t){var e=ut({},t);if(t.renderer){(function(){var n=kt.defaults.renderer||new rt;var i=function e(i){var o=n[i];n[i]=function(){for(var e=arguments.length,r=new Array(e),s=0;s