diff --git a/kirby/.editorconfig b/kirby/.editorconfig
index a0ebce7..76df047 100755
--- a/kirby/.editorconfig
+++ b/kirby/.editorconfig
@@ -6,10 +6,19 @@
root = true
-[*.php]
+[*]
charset = utf-8
end_of_line = lf
-insert_final_newline = true
+indent_style = tab
+indent_size = 2
trim_trailing_whitespace = true
+
+[*.php]
+indent_size = 4
+insert_final_newline = true
+
+[*.yml]
indent_style = space
-indent_size = 4
\ No newline at end of file
+
+[*.md]
+trim_trailing_whitespace = false
\ No newline at end of file
diff --git a/kirby/bootstrap.php b/kirby/bootstrap.php
index 15121d2..a5e9766 100755
--- a/kirby/bootstrap.php
+++ b/kirby/bootstrap.php
@@ -5,31 +5,31 @@
* stop at older or too recent versions
*/
if (
- version_compare(PHP_VERSION, '7.4.0', '>=') === false ||
- version_compare(PHP_VERSION, '8.2.0', '<') === false
+ version_compare(PHP_VERSION, '7.4.0', '>=') === false ||
+ version_compare(PHP_VERSION, '8.2.0', '<') === false
) {
- die(include __DIR__ . '/views/php.php');
+ die(include __DIR__ . '/views/php.php');
}
if (is_file($autoloader = dirname(__DIR__) . '/vendor/autoload.php')) {
- /**
- * Always prefer a site-wide Composer autoloader
- * if it exists, it means that the user has probably
- * installed additional packages
- */
- include $autoloader;
+ /**
+ * Always prefer a site-wide Composer autoloader
+ * if it exists, it means that the user has probably
+ * installed additional packages
+ */
+ include $autoloader;
} elseif (is_file($autoloader = __DIR__ . '/vendor/autoload.php')) {
- /**
- * Fall back to the local autoloader if that exists
- */
- include $autoloader;
+ /**
+ * Fall back to the local autoloader if that exists
+ */
+ include $autoloader;
} else {
- /**
- * If neither one exists, don't bother searching;
- * it's a custom directory setup and the users need to
- * load the autoloader themselves
- */
+ /**
+ * If neither one exists, don't bother searching;
+ * it's a custom directory setup and the users need to
+ * load the autoloader themselves
+ */
}
diff --git a/kirby/composer.json b/kirby/composer.json
index 494d130..f8d080b 100755
--- a/kirby/composer.json
+++ b/kirby/composer.json
@@ -1,110 +1,110 @@
{
- "name": "getkirby/cms",
- "description": "The Kirby 3 core",
- "license": "proprietary",
- "type": "kirby-cms",
- "version": "3.7.0.2",
- "keywords": [
- "kirby",
- "cms",
- "core"
- ],
- "authors": [
- {
- "name": "Kirby Team",
- "email": "support@getkirby.com",
- "homepage": "https://getkirby.com"
- }
- ],
- "homepage": "https://getkirby.com",
- "support": {
- "email": "support@getkirby.com",
- "issues": "https://github.com/getkirby/kirby/issues",
- "forum": "https://forum.getkirby.com",
- "source": "https://github.com/getkirby/kirby"
- },
- "require": {
- "php": ">=7.4.0 <8.2.0",
- "ext-SimpleXML": "*",
- "ext-ctype": "*",
- "ext-curl": "*",
- "ext-dom": "*",
- "ext-filter": "*",
- "ext-hash": "*",
- "ext-iconv": "*",
- "ext-json": "*",
- "ext-libxml": "*",
- "ext-mbstring": "*",
- "ext-openssl": "*",
- "claviska/simpleimage": "3.6.5",
- "filp/whoops": "2.14.5",
- "getkirby/composer-installer": "^1.2.1",
- "laminas/laminas-escaper": "2.10.0",
- "michelf/php-smartypants": "1.8.1",
- "phpmailer/phpmailer": "6.6.3",
- "symfony/polyfill-intl-idn": "1.26.0",
- "symfony/polyfill-mbstring": "1.26.0"
- },
- "replace": {
- "symfony/polyfill-php72": "*"
- },
- "suggest": {
- "ext-PDO": "Support for using databases",
- "ext-apcu": "Support for the Apcu cache driver",
- "ext-exif": "Support for exif information from images",
- "ext-fileinfo": "Improved mime type detection for files",
- "ext-intl": "Improved i18n number formatting",
- "ext-memcached": "Support for the Memcached cache driver",
- "ext-zip": "Support for ZIP archive file functions",
- "ext-zlib": "Sanitization and validation for svgz files"
- },
- "autoload": {
- "psr-4": {
- "Kirby\\": "src/"
- },
- "classmap": [
- "dependencies/"
- ],
- "files": [
- "config/setup.php",
- "config/helpers.php"
- ]
- },
- "config": {
- "allow-plugins": {
- "getkirby/composer-installer": true
- },
- "optimize-autoloader": true,
- "platform": {
- "php": "7.4.0"
- },
- "platform-check": false
- },
- "extra": {
- "unused": [
- "symfony/polyfill-intl-idn"
- ]
- },
- "scripts": {
- "post-update-cmd": "curl -o cacert.pem https://curl.se/ca/cacert.pem",
- "analyze": [
- "@analyze:composer",
- "@analyze:psalm",
- "@analyze:phpcpd",
- "@analyze:phpmd"
- ],
- "analyze:composer": "composer validate --strict --no-check-version --no-check-all",
- "analyze:phpcpd": "phpcpd --fuzzy --exclude tests --exclude vendor .",
- "analyze:phpmd": "phpmd . ansi phpmd.xml.dist --exclude 'dependencies/*,tests/*,vendor/*'",
- "analyze:psalm": "psalm",
- "build": "./scripts/build",
- "ci": [
- "@fix",
- "@analyze",
- "@test"
- ],
- "fix": "php-cs-fixer fix",
- "test": "phpunit --stderr --coverage-html=tests/coverage",
- "zip": "composer archive --format=zip --file=dist"
- }
+ "name": "getkirby/cms",
+ "description": "The Kirby 3 core",
+ "license": "proprietary",
+ "type": "kirby-cms",
+ "version": "3.7.1",
+ "keywords": [
+ "kirby",
+ "cms",
+ "core"
+ ],
+ "authors": [
+ {
+ "name": "Kirby Team",
+ "email": "support@getkirby.com",
+ "homepage": "https://getkirby.com"
+ }
+ ],
+ "homepage": "https://getkirby.com",
+ "support": {
+ "email": "support@getkirby.com",
+ "issues": "https://github.com/getkirby/kirby/issues",
+ "forum": "https://forum.getkirby.com",
+ "source": "https://github.com/getkirby/kirby"
+ },
+ "require": {
+ "php": ">=7.4.0 <8.2.0",
+ "ext-SimpleXML": "*",
+ "ext-ctype": "*",
+ "ext-curl": "*",
+ "ext-dom": "*",
+ "ext-filter": "*",
+ "ext-hash": "*",
+ "ext-iconv": "*",
+ "ext-json": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-openssl": "*",
+ "claviska/simpleimage": "3.6.5",
+ "filp/whoops": "2.14.5",
+ "getkirby/composer-installer": "^1.2.1",
+ "laminas/laminas-escaper": "2.10.0",
+ "michelf/php-smartypants": "1.8.1",
+ "phpmailer/phpmailer": "6.6.3",
+ "symfony/polyfill-intl-idn": "1.26.0",
+ "symfony/polyfill-mbstring": "1.26.0"
+ },
+ "replace": {
+ "symfony/polyfill-php72": "*"
+ },
+ "suggest": {
+ "ext-PDO": "Support for using databases",
+ "ext-apcu": "Support for the Apcu cache driver",
+ "ext-exif": "Support for exif information from images",
+ "ext-fileinfo": "Improved mime type detection for files",
+ "ext-intl": "Improved i18n number formatting",
+ "ext-memcached": "Support for the Memcached cache driver",
+ "ext-zip": "Support for ZIP archive file functions",
+ "ext-zlib": "Sanitization and validation for svgz files"
+ },
+ "autoload": {
+ "psr-4": {
+ "Kirby\\": "src/"
+ },
+ "classmap": [
+ "dependencies/"
+ ],
+ "files": [
+ "config/setup.php",
+ "config/helpers.php"
+ ]
+ },
+ "config": {
+ "allow-plugins": {
+ "getkirby/composer-installer": true
+ },
+ "optimize-autoloader": true,
+ "platform": {
+ "php": "7.4.0"
+ },
+ "platform-check": false
+ },
+ "extra": {
+ "unused": [
+ "symfony/polyfill-intl-idn"
+ ]
+ },
+ "scripts": {
+ "post-update-cmd": "curl -o cacert.pem https://curl.se/ca/cacert.pem",
+ "analyze": [
+ "@analyze:composer",
+ "@analyze:psalm",
+ "@analyze:phpcpd",
+ "@analyze:phpmd"
+ ],
+ "analyze:composer": "composer validate --strict --no-check-version --no-check-all",
+ "analyze:phpcpd": "phpcpd --fuzzy --exclude tests --exclude vendor .",
+ "analyze:phpmd": "phpmd . ansi phpmd.xml.dist --exclude 'dependencies/*,tests/*,vendor/*'",
+ "analyze:psalm": "psalm",
+ "build": "./scripts/build",
+ "ci": [
+ "@fix",
+ "@analyze",
+ "@test"
+ ],
+ "fix": "php-cs-fixer fix",
+ "test": "phpunit --stderr --coverage-html=tests/coverage",
+ "zip": "composer archive --format=zip --file=dist"
+ }
}
diff --git a/kirby/composer.lock b/kirby/composer.lock
index 4e5b667..b327305 100755
--- a/kirby/composer.lock
+++ b/kirby/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "538cd92719a152cbecaaaec5cde21f03",
+ "content-hash": "1d71d8053b544a0d3380bc67234ff81d",
"packages": [
{
"name": "claviska/simpleimage",
diff --git a/kirby/config/aliases.php b/kirby/config/aliases.php
index a9a4a4f..ee795a3 100755
--- a/kirby/config/aliases.php
+++ b/kirby/config/aliases.php
@@ -1,81 +1,81 @@
'Kirby\Cms\Collection',
- 'field' => 'Kirby\Cms\Field',
- 'file' => 'Kirby\Cms\File',
- 'files' => 'Kirby\Cms\Files',
- 'find' => 'Kirby\Cms\Find',
- 'helpers' => 'Kirby\Cms\Helpers',
- 'html' => 'Kirby\Cms\Html',
- 'kirby' => 'Kirby\Cms\App',
- 'page' => 'Kirby\Cms\Page',
- 'pages' => 'Kirby\Cms\Pages',
- 'pagination' => 'Kirby\Cms\Pagination',
- 'r' => 'Kirby\Cms\R',
- 'response' => 'Kirby\Cms\Response',
- 's' => 'Kirby\Cms\S',
- 'sane' => 'Kirby\Sane\Sane',
- 'site' => 'Kirby\Cms\Site',
- 'structure' => 'Kirby\Cms\Structure',
- 'url' => 'Kirby\Cms\Url',
- 'user' => 'Kirby\Cms\User',
- 'users' => 'Kirby\Cms\Users',
- 'visitor' => 'Kirby\Cms\Visitor',
+ // cms classes
+ 'collection' => 'Kirby\Cms\Collection',
+ 'field' => 'Kirby\Cms\Field',
+ 'file' => 'Kirby\Cms\File',
+ 'files' => 'Kirby\Cms\Files',
+ 'find' => 'Kirby\Cms\Find',
+ 'helpers' => 'Kirby\Cms\Helpers',
+ 'html' => 'Kirby\Cms\Html',
+ 'kirby' => 'Kirby\Cms\App',
+ 'page' => 'Kirby\Cms\Page',
+ 'pages' => 'Kirby\Cms\Pages',
+ 'pagination' => 'Kirby\Cms\Pagination',
+ 'r' => 'Kirby\Cms\R',
+ 'response' => 'Kirby\Cms\Response',
+ 's' => 'Kirby\Cms\S',
+ 'sane' => 'Kirby\Sane\Sane',
+ 'site' => 'Kirby\Cms\Site',
+ 'structure' => 'Kirby\Cms\Structure',
+ 'url' => 'Kirby\Cms\Url',
+ 'user' => 'Kirby\Cms\User',
+ 'users' => 'Kirby\Cms\Users',
+ 'visitor' => 'Kirby\Cms\Visitor',
- // data handler
- 'data' => 'Kirby\Data\Data',
- 'json' => 'Kirby\Data\Json',
- 'yaml' => 'Kirby\Data\Yaml',
+ // data handler
+ 'data' => 'Kirby\Data\Data',
+ 'json' => 'Kirby\Data\Json',
+ 'yaml' => 'Kirby\Data\Yaml',
- // file classes
- 'asset' => 'Kirby\Filesystem\Asset',
- 'dir' => 'Kirby\Filesystem\Dir',
- 'f' => 'Kirby\Filesystem\F',
- 'mime' => 'Kirby\Filesystem\Mime',
+ // file classes
+ 'asset' => 'Kirby\Filesystem\Asset',
+ 'dir' => 'Kirby\Filesystem\Dir',
+ 'f' => 'Kirby\Filesystem\F',
+ 'mime' => 'Kirby\Filesystem\Mime',
- // data classes
- 'database' => 'Kirby\Database\Database',
- 'db' => 'Kirby\Database\Db',
+ // data classes
+ 'database' => 'Kirby\Database\Database',
+ 'db' => 'Kirby\Database\Db',
- // exceptions
- 'errorpageexception' => 'Kirby\Exception\ErrorPageException',
+ // exceptions
+ 'errorpageexception' => 'Kirby\Exception\ErrorPageException',
- // http classes
- 'cookie' => 'Kirby\Http\Cookie',
- 'header' => 'Kirby\Http\Header',
- 'remote' => 'Kirby\Http\Remote',
- 'server' => 'Kirby\Http\Server',
+ // http classes
+ 'cookie' => 'Kirby\Http\Cookie',
+ 'header' => 'Kirby\Http\Header',
+ 'remote' => 'Kirby\Http\Remote',
+ 'server' => 'Kirby\Http\Server',
- // image classes
- 'dimensions' => 'Kirby\Image\Dimensions',
+ // image classes
+ 'dimensions' => 'Kirby\Image\Dimensions',
- // panel classes
- 'panel' => 'Kirby\Panel\Panel',
+ // panel classes
+ 'panel' => 'Kirby\Panel\Panel',
- // toolkit classes
- 'a' => 'Kirby\Toolkit\A',
- 'c' => 'Kirby\Toolkit\Config',
- 'config' => 'Kirby\Toolkit\Config',
- 'escape' => 'Kirby\Toolkit\Escape',
- 'i18n' => 'Kirby\Toolkit\I18n',
- 'obj' => 'Kirby\Toolkit\Obj',
- 'str' => 'Kirby\Toolkit\Str',
- 'tpl' => 'Kirby\Toolkit\Tpl',
- 'v' => 'Kirby\Toolkit\V',
- 'xml' => 'Kirby\Toolkit\Xml',
+ // toolkit classes
+ 'a' => 'Kirby\Toolkit\A',
+ 'c' => 'Kirby\Toolkit\Config',
+ 'config' => 'Kirby\Toolkit\Config',
+ 'escape' => 'Kirby\Toolkit\Escape',
+ 'i18n' => 'Kirby\Toolkit\I18n',
+ 'obj' => 'Kirby\Toolkit\Obj',
+ 'str' => 'Kirby\Toolkit\Str',
+ 'tpl' => 'Kirby\Toolkit\Tpl',
+ 'v' => 'Kirby\Toolkit\V',
+ 'xml' => 'Kirby\Toolkit\Xml',
- // TODO: remove in 4.0.0
- 'kirby\cms\asset' => 'Kirby\Filesystem\Asset',
- 'kirby\cms\dir' => 'Kirby\Filesystem\Dir',
- 'kirby\cms\filename' => 'Kirby\Filesystem\Filename',
- 'kirby\cms\filefoundation' => 'Kirby\Filesystem\IsFile',
- 'kirby\cms\form' => 'Kirby\Form\Form',
- 'kirby\cms\kirbytag' => 'Kirby\Text\KirbyTag',
- 'kirby\cms\kirbytags' => 'Kirby\Text\KirbyTags',
- 'kirby\toolkit\dir' => 'Kirby\Filesystem\Dir',
- 'kirby\toolkit\f' => 'Kirby\Filesystem\F',
- 'kirby\toolkit\file' => 'Kirby\Filesystem\File',
- 'kirby\toolkit\mime' => 'Kirby\Filesystem\Mime',
+ // TODO: remove in 4.0.0
+ 'kirby\cms\asset' => 'Kirby\Filesystem\Asset',
+ 'kirby\cms\dir' => 'Kirby\Filesystem\Dir',
+ 'kirby\cms\filename' => 'Kirby\Filesystem\Filename',
+ 'kirby\cms\filefoundation' => 'Kirby\Filesystem\IsFile',
+ 'kirby\cms\form' => 'Kirby\Form\Form',
+ 'kirby\cms\kirbytag' => 'Kirby\Text\KirbyTag',
+ 'kirby\cms\kirbytags' => 'Kirby\Text\KirbyTags',
+ 'kirby\toolkit\dir' => 'Kirby\Filesystem\Dir',
+ 'kirby\toolkit\f' => 'Kirby\Filesystem\F',
+ 'kirby\toolkit\file' => 'Kirby\Filesystem\File',
+ 'kirby\toolkit\mime' => 'Kirby\Filesystem\Mime',
];
diff --git a/kirby/config/api/authentication.php b/kirby/config/api/authentication.php
index b089940..4758599 100755
--- a/kirby/config/api/authentication.php
+++ b/kirby/config/api/authentication.php
@@ -3,25 +3,25 @@
use Kirby\Exception\PermissionException;
return function () {
- $auth = $this->kirby()->auth();
- $allowImpersonation = $this->kirby()->option('api.allowImpersonation') ?? false;
+ $auth = $this->kirby()->auth();
+ $allowImpersonation = $this->kirby()->option('api.allowImpersonation') ?? false;
- // csrf token check
- if (
- $auth->type($allowImpersonation) === 'session' &&
- $auth->csrf() === false
- ) {
- throw new PermissionException('Unauthenticated');
- }
+ // csrf token check
+ if (
+ $auth->type($allowImpersonation) === 'session' &&
+ $auth->csrf() === false
+ ) {
+ throw new PermissionException('Unauthenticated');
+ }
- // get user from session or basic auth
- if ($user = $auth->user(null, $allowImpersonation)) {
- if ($user->role()->permissions()->for('access', 'panel') === false) {
- throw new PermissionException(['key' => 'access.panel']);
- }
+ // get user from session or basic auth
+ if ($user = $auth->user(null, $allowImpersonation)) {
+ if ($user->role()->permissions()->for('access', 'panel') === false) {
+ throw new PermissionException(['key' => 'access.panel']);
+ }
- return $user;
- }
+ return $user;
+ }
- throw new PermissionException('Unauthenticated');
+ throw new PermissionException('Unauthenticated');
};
diff --git a/kirby/config/api/collections.php b/kirby/config/api/collections.php
index fb3e218..3a34927 100755
--- a/kirby/config/api/collections.php
+++ b/kirby/config/api/collections.php
@@ -5,66 +5,66 @@
*/
return [
- /**
- * Children
- */
- 'children' => [
- 'model' => 'page',
- 'type' => 'Kirby\Cms\Pages',
- 'view' => 'compact'
- ],
+ /**
+ * Children
+ */
+ 'children' => [
+ 'model' => 'page',
+ 'type' => 'Kirby\Cms\Pages',
+ 'view' => 'compact'
+ ],
- /**
- * Files
- */
- 'files' => [
- 'model' => 'file',
- 'type' => 'Kirby\Cms\Files'
- ],
+ /**
+ * Files
+ */
+ 'files' => [
+ 'model' => 'file',
+ 'type' => 'Kirby\Cms\Files'
+ ],
- /**
- * Languages
- */
- 'languages' => [
- 'model' => 'language',
- 'type' => 'Kirby\Cms\Languages'
- ],
+ /**
+ * Languages
+ */
+ 'languages' => [
+ 'model' => 'language',
+ 'type' => 'Kirby\Cms\Languages'
+ ],
- /**
- * Pages
- */
- 'pages' => [
- 'model' => 'page',
- 'type' => 'Kirby\Cms\Pages',
- 'view' => 'compact'
- ],
+ /**
+ * Pages
+ */
+ 'pages' => [
+ 'model' => 'page',
+ 'type' => 'Kirby\Cms\Pages',
+ 'view' => 'compact'
+ ],
- /**
- * Roles
- */
- 'roles' => [
- 'model' => 'role',
- 'type' => 'Kirby\Cms\Roles',
- 'view' => 'compact'
- ],
+ /**
+ * Roles
+ */
+ 'roles' => [
+ 'model' => 'role',
+ 'type' => 'Kirby\Cms\Roles',
+ 'view' => 'compact'
+ ],
- /**
- * Translations
- */
- 'translations' => [
- 'model' => 'translation',
- 'type' => 'Kirby\Cms\Translations',
- 'view' => 'compact'
- ],
+ /**
+ * Translations
+ */
+ 'translations' => [
+ 'model' => 'translation',
+ 'type' => 'Kirby\Cms\Translations',
+ 'view' => 'compact'
+ ],
- /**
- * Users
- */
- 'users' => [
- 'default' => fn () => $this->users(),
- 'model' => 'user',
- 'type' => 'Kirby\Cms\Users',
- 'view' => 'compact'
- ]
+ /**
+ * Users
+ */
+ 'users' => [
+ 'default' => fn () => $this->users(),
+ 'model' => 'user',
+ 'type' => 'Kirby\Cms\Users',
+ 'view' => 'compact'
+ ]
];
diff --git a/kirby/config/api/models.php b/kirby/config/api/models.php
index 51d19fb..075442f 100755
--- a/kirby/config/api/models.php
+++ b/kirby/config/api/models.php
@@ -4,17 +4,17 @@
* Api Model Definitions
*/
return [
- 'File' => include __DIR__ . '/models/File.php',
- 'FileBlueprint' => include __DIR__ . '/models/FileBlueprint.php',
- 'FileVersion' => include __DIR__ . '/models/FileVersion.php',
- 'Language' => include __DIR__ . '/models/Language.php',
- 'Page' => include __DIR__ . '/models/Page.php',
- 'PageBlueprint' => include __DIR__ . '/models/PageBlueprint.php',
- 'Role' => include __DIR__ . '/models/Role.php',
- 'Site' => include __DIR__ . '/models/Site.php',
- 'SiteBlueprint' => include __DIR__ . '/models/SiteBlueprint.php',
- 'System' => include __DIR__ . '/models/System.php',
- 'Translation' => include __DIR__ . '/models/Translation.php',
- 'User' => include __DIR__ . '/models/User.php',
- 'UserBlueprint' => include __DIR__ . '/models/UserBlueprint.php',
+ 'File' => include __DIR__ . '/models/File.php',
+ 'FileBlueprint' => include __DIR__ . '/models/FileBlueprint.php',
+ 'FileVersion' => include __DIR__ . '/models/FileVersion.php',
+ 'Language' => include __DIR__ . '/models/Language.php',
+ 'Page' => include __DIR__ . '/models/Page.php',
+ 'PageBlueprint' => include __DIR__ . '/models/PageBlueprint.php',
+ 'Role' => include __DIR__ . '/models/Role.php',
+ 'Site' => include __DIR__ . '/models/Site.php',
+ 'SiteBlueprint' => include __DIR__ . '/models/SiteBlueprint.php',
+ 'System' => include __DIR__ . '/models/System.php',
+ 'Translation' => include __DIR__ . '/models/Translation.php',
+ 'User' => include __DIR__ . '/models/User.php',
+ 'UserBlueprint' => include __DIR__ . '/models/UserBlueprint.php',
];
diff --git a/kirby/config/api/models/File.php b/kirby/config/api/models/File.php
index d8d2fac..dac185d 100755
--- a/kirby/config/api/models/File.php
+++ b/kirby/config/api/models/File.php
@@ -7,109 +7,109 @@ use Kirby\Form\Form;
* File
*/
return [
- 'fields' => [
- 'blueprint' => fn (File $file) => $file->blueprint(),
- 'content' => fn (File $file) => Form::for($file)->values(),
- 'dimensions' => fn (File $file) => $file->dimensions()->toArray(),
- 'dragText' => fn (File $file) => $file->panel()->dragText(),
- 'exists' => fn (File $file) => $file->exists(),
- 'extension' => fn (File $file) => $file->extension(),
- 'filename' => fn (File $file) => $file->filename(),
- 'id' => fn (File $file) => $file->id(),
- 'link' => fn (File $file) => $file->panel()->url(true),
- 'mime' => fn (File $file) => $file->mime(),
- 'modified' => fn (File $file) => $file->modified('c'),
- 'name' => fn (File $file) => $file->name(),
- 'next' => fn (File $file) => $file->next(),
- 'nextWithTemplate' => function (File $file) {
- $files = $file->templateSiblings()->sorted();
- $index = $files->indexOf($file);
+ 'fields' => [
+ 'blueprint' => fn (File $file) => $file->blueprint(),
+ 'content' => fn (File $file) => Form::for($file)->values(),
+ 'dimensions' => fn (File $file) => $file->dimensions()->toArray(),
+ 'dragText' => fn (File $file) => $file->panel()->dragText(),
+ 'exists' => fn (File $file) => $file->exists(),
+ 'extension' => fn (File $file) => $file->extension(),
+ 'filename' => fn (File $file) => $file->filename(),
+ 'id' => fn (File $file) => $file->id(),
+ 'link' => fn (File $file) => $file->panel()->url(true),
+ 'mime' => fn (File $file) => $file->mime(),
+ 'modified' => fn (File $file) => $file->modified('c'),
+ 'name' => fn (File $file) => $file->name(),
+ 'next' => fn (File $file) => $file->next(),
+ 'nextWithTemplate' => function (File $file) {
+ $files = $file->templateSiblings()->sorted();
+ $index = $files->indexOf($file);
- return $files->nth($index + 1);
- },
- 'niceSize' => fn (File $file) => $file->niceSize(),
- 'options' => fn (File $file) => $file->panel()->options(),
- 'panelImage' => fn (File $file) => $file->panel()->image(),
- 'panelUrl' => fn (File $file) => $file->panel()->url(true),
- 'prev' => fn (File $file) => $file->prev(),
- 'prevWithTemplate' => function (File $file) {
- $files = $file->templateSiblings()->sorted();
- $index = $files->indexOf($file);
+ return $files->nth($index + 1);
+ },
+ 'niceSize' => fn (File $file) => $file->niceSize(),
+ 'options' => fn (File $file) => $file->panel()->options(),
+ 'panelImage' => fn (File $file) => $file->panel()->image(),
+ 'panelUrl' => fn (File $file) => $file->panel()->url(true),
+ 'prev' => fn (File $file) => $file->prev(),
+ 'prevWithTemplate' => function (File $file) {
+ $files = $file->templateSiblings()->sorted();
+ $index = $files->indexOf($file);
- return $files->nth($index - 1);
- },
- 'parent' => fn (File $file) => $file->parent(),
- 'parents' => fn (File $file) => $file->parents()->flip(),
- 'size' => fn (File $file) => $file->size(),
- 'template' => fn (File $file) => $file->template(),
- 'thumbs' => function ($file) {
- if ($file->isResizable() === false) {
- return null;
- }
+ return $files->nth($index - 1);
+ },
+ 'parent' => fn (File $file) => $file->parent(),
+ 'parents' => fn (File $file) => $file->parents()->flip(),
+ 'size' => fn (File $file) => $file->size(),
+ 'template' => fn (File $file) => $file->template(),
+ 'thumbs' => function ($file) {
+ if ($file->isResizable() === false) {
+ return null;
+ }
- return [
- 'tiny' => $file->resize(128)->url(),
- 'small' => $file->resize(256)->url(),
- 'medium' => $file->resize(512)->url(),
- 'large' => $file->resize(768)->url(),
- 'huge' => $file->resize(1024)->url(),
- ];
- },
- 'type' => fn (File $file) => $file->type(),
- 'url' => fn (File $file) => $file->url(),
- ],
- 'type' => 'Kirby\Cms\File',
- 'views' => [
- 'default' => [
- 'content',
- 'dimensions',
- 'exists',
- 'extension',
- 'filename',
- 'id',
- 'link',
- 'mime',
- 'modified',
- 'name',
- 'next' => 'compact',
- 'niceSize',
- 'parent' => 'compact',
- 'options',
- 'prev' => 'compact',
- 'size',
- 'template',
- 'type',
- 'url'
- ],
- 'compact' => [
- 'filename',
- 'id',
- 'link',
- 'type',
- 'url',
- ],
- 'panel' => [
- 'blueprint',
- 'content',
- 'dimensions',
- 'extension',
- 'filename',
- 'id',
- 'link',
- 'mime',
- 'modified',
- 'name',
- 'nextWithTemplate' => 'compact',
- 'niceSize',
- 'options',
- 'panelIcon',
- 'panelImage',
- 'parent' => 'compact',
- 'parents' => ['id', 'slug', 'title'],
- 'prevWithTemplate' => 'compact',
- 'template',
- 'type',
- 'url'
- ]
- ],
+ return [
+ 'tiny' => $file->resize(128)->url(),
+ 'small' => $file->resize(256)->url(),
+ 'medium' => $file->resize(512)->url(),
+ 'large' => $file->resize(768)->url(),
+ 'huge' => $file->resize(1024)->url(),
+ ];
+ },
+ 'type' => fn (File $file) => $file->type(),
+ 'url' => fn (File $file) => $file->url(),
+ ],
+ 'type' => 'Kirby\Cms\File',
+ 'views' => [
+ 'default' => [
+ 'content',
+ 'dimensions',
+ 'exists',
+ 'extension',
+ 'filename',
+ 'id',
+ 'link',
+ 'mime',
+ 'modified',
+ 'name',
+ 'next' => 'compact',
+ 'niceSize',
+ 'parent' => 'compact',
+ 'options',
+ 'prev' => 'compact',
+ 'size',
+ 'template',
+ 'type',
+ 'url'
+ ],
+ 'compact' => [
+ 'filename',
+ 'id',
+ 'link',
+ 'type',
+ 'url',
+ ],
+ 'panel' => [
+ 'blueprint',
+ 'content',
+ 'dimensions',
+ 'extension',
+ 'filename',
+ 'id',
+ 'link',
+ 'mime',
+ 'modified',
+ 'name',
+ 'nextWithTemplate' => 'compact',
+ 'niceSize',
+ 'options',
+ 'panelIcon',
+ 'panelImage',
+ 'parent' => 'compact',
+ 'parents' => ['id', 'slug', 'title'],
+ 'prevWithTemplate' => 'compact',
+ 'template',
+ 'type',
+ 'url'
+ ]
+ ],
];
diff --git a/kirby/config/api/models/FileBlueprint.php b/kirby/config/api/models/FileBlueprint.php
index 5279f8a..e781e45 100755
--- a/kirby/config/api/models/FileBlueprint.php
+++ b/kirby/config/api/models/FileBlueprint.php
@@ -6,13 +6,13 @@ use Kirby\Cms\FileBlueprint;
* FileBlueprint
*/
return [
- 'fields' => [
- 'name' => fn (FileBlueprint $blueprint) => $blueprint->name(),
- 'options' => fn (FileBlueprint $blueprint) => $blueprint->options(),
- 'tabs' => fn (FileBlueprint $blueprint) => $blueprint->tabs(),
- 'title' => fn (FileBlueprint $blueprint) => $blueprint->title(),
- ],
- 'type' => 'Kirby\Cms\FileBlueprint',
- 'views' => [
- ],
+ 'fields' => [
+ 'name' => fn (FileBlueprint $blueprint) => $blueprint->name(),
+ 'options' => fn (FileBlueprint $blueprint) => $blueprint->options(),
+ 'tabs' => fn (FileBlueprint $blueprint) => $blueprint->tabs(),
+ 'title' => fn (FileBlueprint $blueprint) => $blueprint->title(),
+ ],
+ 'type' => 'Kirby\Cms\FileBlueprint',
+ 'views' => [
+ ],
];
diff --git a/kirby/config/api/models/FileVersion.php b/kirby/config/api/models/FileVersion.php
index d5cea11..df2aac0 100755
--- a/kirby/config/api/models/FileVersion.php
+++ b/kirby/config/api/models/FileVersion.php
@@ -6,54 +6,54 @@ use Kirby\Cms\FileVersion;
* FileVersion
*/
return [
- 'fields' => [
- 'dimensions' => fn (FileVersion $file) => $file->dimensions()->toArray(),
- 'exists' => fn (FileVersion $file) => $file->exists(),
- 'extension' => fn (FileVersion $file) => $file->extension(),
- 'filename' => fn (FileVersion $file) => $file->filename(),
- 'id' => fn (FileVersion $file) => $file->id(),
- 'mime' => fn (FileVersion $file) => $file->mime(),
- 'modified' => fn (FileVersion $file) => $file->modified('c'),
- 'name' => fn (FileVersion $file) => $file->name(),
- 'niceSize' => fn (FileVersion $file) => $file->niceSize(),
- 'size' => fn (FileVersion $file) => $file->size(),
- 'type' => fn (FileVersion $file) => $file->type(),
- 'url' => fn (FileVersion $file) => $file->url(),
- ],
- 'type' => 'Kirby\Cms\FileVersion',
- 'views' => [
- 'default' => [
- 'dimensions',
- 'exists',
- 'extension',
- 'filename',
- 'id',
- 'mime',
- 'modified',
- 'name',
- 'niceSize',
- 'size',
- 'type',
- 'url'
- ],
- 'compact' => [
- 'filename',
- 'id',
- 'type',
- 'url',
- ],
- 'panel' => [
- 'dimensions',
- 'extension',
- 'filename',
- 'id',
- 'mime',
- 'modified',
- 'name',
- 'niceSize',
- 'template',
- 'type',
- 'url'
- ]
- ],
+ 'fields' => [
+ 'dimensions' => fn (FileVersion $file) => $file->dimensions()->toArray(),
+ 'exists' => fn (FileVersion $file) => $file->exists(),
+ 'extension' => fn (FileVersion $file) => $file->extension(),
+ 'filename' => fn (FileVersion $file) => $file->filename(),
+ 'id' => fn (FileVersion $file) => $file->id(),
+ 'mime' => fn (FileVersion $file) => $file->mime(),
+ 'modified' => fn (FileVersion $file) => $file->modified('c'),
+ 'name' => fn (FileVersion $file) => $file->name(),
+ 'niceSize' => fn (FileVersion $file) => $file->niceSize(),
+ 'size' => fn (FileVersion $file) => $file->size(),
+ 'type' => fn (FileVersion $file) => $file->type(),
+ 'url' => fn (FileVersion $file) => $file->url(),
+ ],
+ 'type' => 'Kirby\Cms\FileVersion',
+ 'views' => [
+ 'default' => [
+ 'dimensions',
+ 'exists',
+ 'extension',
+ 'filename',
+ 'id',
+ 'mime',
+ 'modified',
+ 'name',
+ 'niceSize',
+ 'size',
+ 'type',
+ 'url'
+ ],
+ 'compact' => [
+ 'filename',
+ 'id',
+ 'type',
+ 'url',
+ ],
+ 'panel' => [
+ 'dimensions',
+ 'extension',
+ 'filename',
+ 'id',
+ 'mime',
+ 'modified',
+ 'name',
+ 'niceSize',
+ 'template',
+ 'type',
+ 'url'
+ ]
+ ],
];
diff --git a/kirby/config/api/models/Language.php b/kirby/config/api/models/Language.php
index 1e76e14..362d6f5 100755
--- a/kirby/config/api/models/Language.php
+++ b/kirby/config/api/models/Language.php
@@ -6,25 +6,25 @@ use Kirby\Cms\Language;
* Language
*/
return [
- 'fields' => [
- 'code' => fn (Language $language) => $language->code(),
- 'default' => fn (Language $language) => $language->isDefault(),
- 'direction' => fn (Language $language) => $language->direction(),
- 'locale' => fn (Language $language) => $language->locale(),
- 'name' => fn (Language $language) => $language->name(),
- 'rules' => fn (Language $language) => $language->rules(),
- 'url' => fn (Language $language) => $language->url(),
- ],
- 'type' => 'Kirby\Cms\Language',
- 'views' => [
- 'default' => [
- 'code',
- 'default',
- 'direction',
- 'locale',
- 'name',
- 'rules',
- 'url'
- ]
- ]
+ 'fields' => [
+ 'code' => fn (Language $language) => $language->code(),
+ 'default' => fn (Language $language) => $language->isDefault(),
+ 'direction' => fn (Language $language) => $language->direction(),
+ 'locale' => fn (Language $language) => $language->locale(),
+ 'name' => fn (Language $language) => $language->name(),
+ 'rules' => fn (Language $language) => $language->rules(),
+ 'url' => fn (Language $language) => $language->url(),
+ ],
+ 'type' => 'Kirby\Cms\Language',
+ 'views' => [
+ 'default' => [
+ 'code',
+ 'default',
+ 'direction',
+ 'locale',
+ 'name',
+ 'rules',
+ 'url'
+ ]
+ ]
];
diff --git a/kirby/config/api/models/Page.php b/kirby/config/api/models/Page.php
index 50a1de2..03b6c7d 100755
--- a/kirby/config/api/models/Page.php
+++ b/kirby/config/api/models/Page.php
@@ -8,116 +8,116 @@ use Kirby\Form\Form;
* Page
*/
return [
- 'fields' => [
- 'blueprint' => fn (Page $page) => $page->blueprint(),
- 'blueprints' => fn (Page $page) => $page->blueprints(),
- 'children' => fn (Page $page) => $page->children(),
- 'content' => fn (Page $page) => Form::for($page)->values(),
- 'drafts' => fn (Page $page) => $page->drafts(),
- 'errors' => fn (Page $page) => $page->errors(),
- 'files' => fn (Page $page) => $page->files()->sorted(),
- 'hasChildren' => fn (Page $page) => $page->hasChildren(),
- 'hasDrafts' => fn (Page $page) => $page->hasDrafts(),
- 'hasFiles' => fn (Page $page) => $page->hasFiles(),
- 'id' => fn (Page $page) => $page->id(),
- 'isSortable' => fn (Page $page) => $page->isSortable(),
- /**
- * @deprecated 3.6.0
- * @todo Remove in 3.8.0
- * @codeCoverageIgnore
- */
- 'next' => function (Page $page) {
- Helpers::deprecated('The API field page.next has been deprecated and will be removed in 3.8.0.');
+ 'fields' => [
+ 'blueprint' => fn (Page $page) => $page->blueprint(),
+ 'blueprints' => fn (Page $page) => $page->blueprints(),
+ 'children' => fn (Page $page) => $page->children(),
+ 'content' => fn (Page $page) => Form::for($page)->values(),
+ 'drafts' => fn (Page $page) => $page->drafts(),
+ 'errors' => fn (Page $page) => $page->errors(),
+ 'files' => fn (Page $page) => $page->files()->sorted(),
+ 'hasChildren' => fn (Page $page) => $page->hasChildren(),
+ 'hasDrafts' => fn (Page $page) => $page->hasDrafts(),
+ 'hasFiles' => fn (Page $page) => $page->hasFiles(),
+ 'id' => fn (Page $page) => $page->id(),
+ 'isSortable' => fn (Page $page) => $page->isSortable(),
+ /**
+ * @deprecated 3.6.0
+ * @todo Remove in 3.8.0
+ * @codeCoverageIgnore
+ */
+ 'next' => function (Page $page) {
+ Helpers::deprecated('The API field page.next has been deprecated and will be removed in 3.8.0.');
- return $page
- ->nextAll()
- ->filter('intendedTemplate', $page->intendedTemplate())
- ->filter('status', $page->status())
- ->filter('isReadable', true)
- ->first();
- },
- 'num' => fn (Page $page) => $page->num(),
- 'options' => fn (Page $page) => $page->panel()->options(['preview']),
- 'panelImage' => fn (Page $page) => $page->panel()->image(),
- 'parent' => fn (Page $page) => $page->parent(),
- 'parents' => fn (Page $page) => $page->parents()->flip(),
- /**
- * @deprecated 3.6.0
- * @todo Remove in 3.8.0
- * @codeCoverageIgnore
- */
- 'prev' => function (Page $page) {
- Helpers::deprecated('The API field page.prev has been deprecated and will be removed in 3.8.0.');
+ return $page
+ ->nextAll()
+ ->filter('intendedTemplate', $page->intendedTemplate())
+ ->filter('status', $page->status())
+ ->filter('isReadable', true)
+ ->first();
+ },
+ 'num' => fn (Page $page) => $page->num(),
+ 'options' => fn (Page $page) => $page->panel()->options(['preview']),
+ 'panelImage' => fn (Page $page) => $page->panel()->image(),
+ 'parent' => fn (Page $page) => $page->parent(),
+ 'parents' => fn (Page $page) => $page->parents()->flip(),
+ /**
+ * @deprecated 3.6.0
+ * @todo Remove in 3.8.0
+ * @codeCoverageIgnore
+ */
+ 'prev' => function (Page $page) {
+ Helpers::deprecated('The API field page.prev has been deprecated and will be removed in 3.8.0.');
- return $page
- ->prevAll()
- ->filter('intendedTemplate', $page->intendedTemplate())
- ->filter('status', $page->status())
- ->filter('isReadable', true)
- ->last();
- },
- 'previewUrl' => fn (Page $page) => $page->previewUrl(),
- 'siblings' => function (Page $page) {
- if ($page->isDraft() === true) {
- return $page->parentModel()->children()->not($page);
- } else {
- return $page->siblings();
- }
- },
- 'slug' => fn (Page $page) => $page->slug(),
- 'status' => fn (Page $page) => $page->status(),
- 'template' => fn (Page $page) => $page->intendedTemplate()->name(),
- 'title' => fn (Page $page) => $page->title()->value(),
- 'url' => fn (Page $page) => $page->url(),
- ],
- 'type' => 'Kirby\Cms\Page',
- 'views' => [
- 'compact' => [
- 'id',
- 'title',
- 'url',
- 'num'
- ],
- 'default' => [
- 'content',
- 'id',
- 'status',
- 'num',
- 'options',
- 'parent' => 'compact',
- 'slug',
- 'template',
- 'title',
- 'url'
- ],
- 'panel' => [
- 'id',
- 'blueprint',
- 'content',
- 'status',
- 'options',
- 'next' => ['id', 'slug', 'title'],
- 'parents' => ['id', 'slug', 'title'],
- 'prev' => ['id', 'slug', 'title'],
- 'previewUrl',
- 'slug',
- 'title',
- 'url'
- ],
- 'selector' => [
- 'id',
- 'title',
- 'parent' => [
- 'id',
- 'title'
- ],
- 'children' => [
- 'hasChildren',
- 'id',
- 'panelIcon',
- 'panelImage',
- 'title',
- ],
- ]
- ],
+ return $page
+ ->prevAll()
+ ->filter('intendedTemplate', $page->intendedTemplate())
+ ->filter('status', $page->status())
+ ->filter('isReadable', true)
+ ->last();
+ },
+ 'previewUrl' => fn (Page $page) => $page->previewUrl(),
+ 'siblings' => function (Page $page) {
+ if ($page->isDraft() === true) {
+ return $page->parentModel()->children()->not($page);
+ } else {
+ return $page->siblings();
+ }
+ },
+ 'slug' => fn (Page $page) => $page->slug(),
+ 'status' => fn (Page $page) => $page->status(),
+ 'template' => fn (Page $page) => $page->intendedTemplate()->name(),
+ 'title' => fn (Page $page) => $page->title()->value(),
+ 'url' => fn (Page $page) => $page->url(),
+ ],
+ 'type' => 'Kirby\Cms\Page',
+ 'views' => [
+ 'compact' => [
+ 'id',
+ 'title',
+ 'url',
+ 'num'
+ ],
+ 'default' => [
+ 'content',
+ 'id',
+ 'status',
+ 'num',
+ 'options',
+ 'parent' => 'compact',
+ 'slug',
+ 'template',
+ 'title',
+ 'url'
+ ],
+ 'panel' => [
+ 'id',
+ 'blueprint',
+ 'content',
+ 'status',
+ 'options',
+ 'next' => ['id', 'slug', 'title'],
+ 'parents' => ['id', 'slug', 'title'],
+ 'prev' => ['id', 'slug', 'title'],
+ 'previewUrl',
+ 'slug',
+ 'title',
+ 'url'
+ ],
+ 'selector' => [
+ 'id',
+ 'title',
+ 'parent' => [
+ 'id',
+ 'title'
+ ],
+ 'children' => [
+ 'hasChildren',
+ 'id',
+ 'panelIcon',
+ 'panelImage',
+ 'title',
+ ],
+ ]
+ ],
];
diff --git a/kirby/config/api/models/PageBlueprint.php b/kirby/config/api/models/PageBlueprint.php
index c5de408..dc240ed 100755
--- a/kirby/config/api/models/PageBlueprint.php
+++ b/kirby/config/api/models/PageBlueprint.php
@@ -6,16 +6,16 @@ use Kirby\Cms\PageBlueprint;
* PageBlueprint
*/
return [
- 'fields' => [
- 'name' => fn (PageBlueprint $blueprint) => $blueprint->name(),
- 'num' => fn (PageBlueprint $blueprint) => $blueprint->num(),
- 'options' => fn (PageBlueprint $blueprint) => $blueprint->options(),
- 'preview' => fn (PageBlueprint $blueprint) => $blueprint->preview(),
- 'status' => fn (PageBlueprint $blueprint) => $blueprint->status(),
- 'tabs' => fn (PageBlueprint $blueprint) => $blueprint->tabs(),
- 'title' => fn (PageBlueprint $blueprint) => $blueprint->title(),
- ],
- 'type' => 'Kirby\Cms\PageBlueprint',
- 'views' => [
- ],
+ 'fields' => [
+ 'name' => fn (PageBlueprint $blueprint) => $blueprint->name(),
+ 'num' => fn (PageBlueprint $blueprint) => $blueprint->num(),
+ 'options' => fn (PageBlueprint $blueprint) => $blueprint->options(),
+ 'preview' => fn (PageBlueprint $blueprint) => $blueprint->preview(),
+ 'status' => fn (PageBlueprint $blueprint) => $blueprint->status(),
+ 'tabs' => fn (PageBlueprint $blueprint) => $blueprint->tabs(),
+ 'title' => fn (PageBlueprint $blueprint) => $blueprint->title(),
+ ],
+ 'type' => 'Kirby\Cms\PageBlueprint',
+ 'views' => [
+ ],
];
diff --git a/kirby/config/api/models/Role.php b/kirby/config/api/models/Role.php
index 93a9e01..e1d27c3 100755
--- a/kirby/config/api/models/Role.php
+++ b/kirby/config/api/models/Role.php
@@ -6,18 +6,18 @@ use Kirby\Cms\Role;
* Role
*/
return [
- 'fields' => [
- 'description' => fn (Role $role) => $role->description(),
- 'name' => fn (Role $role) => $role->name(),
- 'permissions' => fn (Role $role) => $role->permissions()->toArray(),
- 'title' => fn (Role $role) => $role->title(),
- ],
- 'type' => 'Kirby\Cms\Role',
- 'views' => [
- 'compact' => [
- 'description',
- 'name',
- 'title'
- ]
- ]
+ 'fields' => [
+ 'description' => fn (Role $role) => $role->description(),
+ 'name' => fn (Role $role) => $role->name(),
+ 'permissions' => fn (Role $role) => $role->permissions()->toArray(),
+ 'title' => fn (Role $role) => $role->title(),
+ ],
+ 'type' => 'Kirby\Cms\Role',
+ 'views' => [
+ 'compact' => [
+ 'description',
+ 'name',
+ 'title'
+ ]
+ ]
];
diff --git a/kirby/config/api/models/Site.php b/kirby/config/api/models/Site.php
index 4f5463c..c312ef4 100755
--- a/kirby/config/api/models/Site.php
+++ b/kirby/config/api/models/Site.php
@@ -7,46 +7,46 @@ use Kirby\Form\Form;
* Site
*/
return [
- 'default' => fn () => $this->site(),
- 'fields' => [
- 'blueprint' => fn (Site $site) => $site->blueprint(),
- 'children' => fn (Site $site) => $site->children(),
- 'content' => fn (Site $site) => Form::for($site)->values(),
- 'drafts' => fn (Site $site) => $site->drafts(),
- 'files' => fn (Site $site) => $site->files()->sorted(),
- 'options' => fn (Site $site) => $site->permissions()->toArray(),
- 'previewUrl' => fn (Site $site) => $site->previewUrl(),
- 'title' => fn (Site $site) => $site->title()->value(),
- 'url' => fn (Site $site) => $site->url(),
- ],
- 'type' => 'Kirby\Cms\Site',
- 'views' => [
- 'compact' => [
- 'title',
- 'url'
- ],
- 'default' => [
- 'content',
- 'options',
- 'title',
- 'url'
- ],
- 'panel' => [
- 'title',
- 'blueprint',
- 'content',
- 'options',
- 'previewUrl',
- 'url'
- ],
- 'selector' => [
- 'title',
- 'children' => [
- 'id',
- 'title',
- 'panelIcon',
- 'hasChildren'
- ],
- ]
- ]
+ 'default' => fn () => $this->site(),
+ 'fields' => [
+ 'blueprint' => fn (Site $site) => $site->blueprint(),
+ 'children' => fn (Site $site) => $site->children(),
+ 'content' => fn (Site $site) => Form::for($site)->values(),
+ 'drafts' => fn (Site $site) => $site->drafts(),
+ 'files' => fn (Site $site) => $site->files()->sorted(),
+ 'options' => fn (Site $site) => $site->permissions()->toArray(),
+ 'previewUrl' => fn (Site $site) => $site->previewUrl(),
+ 'title' => fn (Site $site) => $site->title()->value(),
+ 'url' => fn (Site $site) => $site->url(),
+ ],
+ 'type' => 'Kirby\Cms\Site',
+ 'views' => [
+ 'compact' => [
+ 'title',
+ 'url'
+ ],
+ 'default' => [
+ 'content',
+ 'options',
+ 'title',
+ 'url'
+ ],
+ 'panel' => [
+ 'title',
+ 'blueprint',
+ 'content',
+ 'options',
+ 'previewUrl',
+ 'url'
+ ],
+ 'selector' => [
+ 'title',
+ 'children' => [
+ 'id',
+ 'title',
+ 'panelIcon',
+ 'hasChildren'
+ ],
+ ]
+ ]
];
diff --git a/kirby/config/api/models/SiteBlueprint.php b/kirby/config/api/models/SiteBlueprint.php
index c940212..7841841 100755
--- a/kirby/config/api/models/SiteBlueprint.php
+++ b/kirby/config/api/models/SiteBlueprint.php
@@ -6,12 +6,12 @@ use Kirby\Cms\SiteBlueprint;
* SiteBlueprint
*/
return [
- 'fields' => [
- 'name' => fn (SiteBlueprint $blueprint) => $blueprint->name(),
- 'options' => fn (SiteBlueprint $blueprint) => $blueprint->options(),
- 'tabs' => fn (SiteBlueprint $blueprint) => $blueprint->tabs(),
- 'title' => fn (SiteBlueprint $blueprint) => $blueprint->title(),
- ],
- 'type' => 'Kirby\Cms\SiteBlueprint',
- 'views' => [],
+ 'fields' => [
+ 'name' => fn (SiteBlueprint $blueprint) => $blueprint->name(),
+ 'options' => fn (SiteBlueprint $blueprint) => $blueprint->options(),
+ 'tabs' => fn (SiteBlueprint $blueprint) => $blueprint->tabs(),
+ 'title' => fn (SiteBlueprint $blueprint) => $blueprint->title(),
+ ],
+ 'type' => 'Kirby\Cms\SiteBlueprint',
+ 'views' => [],
];
diff --git a/kirby/config/api/models/System.php b/kirby/config/api/models/System.php
index 0ad10eb..260aa45 100755
--- a/kirby/config/api/models/System.php
+++ b/kirby/config/api/models/System.php
@@ -7,92 +7,92 @@ use Kirby\Toolkit\Str;
* System
*/
return [
- 'fields' => [
- 'ascii' => fn () => Str::$ascii,
- 'authStatus' => fn () => $this->kirby()->auth()->status()->toArray(),
- 'defaultLanguage' => fn () => $this->kirby()->panelLanguage(),
- 'isOk' => fn (System $system) => $system->isOk(),
- 'isInstallable' => fn (System $system) => $system->isInstallable(),
- 'isInstalled' => fn (System $system) => $system->isInstalled(),
- 'isLocal' => fn (System $system) => $system->isLocal(),
- 'multilang' => fn () => $this->kirby()->option('languages', false) !== false,
- 'languages' => fn () => $this->kirby()->languages(),
- 'license' => fn (System $system) => $system->license(),
- 'locales' => function () {
- $locales = [];
- $translations = $this->kirby()->translations();
- foreach ($translations as $translation) {
- $locales[$translation->code()] = $translation->locale();
- }
- return $locales;
- },
- 'loginMethods' => fn (System $system) => array_keys($system->loginMethods()),
- 'requirements' => fn (System $system) => $system->toArray(),
- 'site' => fn (System $system) => $system->title(),
- 'slugs' => fn () => Str::$language,
- 'title' => fn () => $this->site()->title()->value(),
- 'translation' => function () {
- if ($user = $this->user()) {
- $translationCode = $user->language();
- } else {
- $translationCode = $this->kirby()->panelLanguage();
- }
+ 'fields' => [
+ 'ascii' => fn () => Str::$ascii,
+ 'authStatus' => fn () => $this->kirby()->auth()->status()->toArray(),
+ 'defaultLanguage' => fn () => $this->kirby()->panelLanguage(),
+ 'isOk' => fn (System $system) => $system->isOk(),
+ 'isInstallable' => fn (System $system) => $system->isInstallable(),
+ 'isInstalled' => fn (System $system) => $system->isInstalled(),
+ 'isLocal' => fn (System $system) => $system->isLocal(),
+ 'multilang' => fn () => $this->kirby()->option('languages', false) !== false,
+ 'languages' => fn () => $this->kirby()->languages(),
+ 'license' => fn (System $system) => $system->license(),
+ 'locales' => function () {
+ $locales = [];
+ $translations = $this->kirby()->translations();
+ foreach ($translations as $translation) {
+ $locales[$translation->code()] = $translation->locale();
+ }
+ return $locales;
+ },
+ 'loginMethods' => fn (System $system) => array_keys($system->loginMethods()),
+ 'requirements' => fn (System $system) => $system->toArray(),
+ 'site' => fn (System $system) => $system->title(),
+ 'slugs' => fn () => Str::$language,
+ 'title' => fn () => $this->site()->title()->value(),
+ 'translation' => function () {
+ if ($user = $this->user()) {
+ $translationCode = $user->language();
+ } else {
+ $translationCode = $this->kirby()->panelLanguage();
+ }
- if ($translation = $this->kirby()->translation($translationCode)) {
- return $translation;
- } else {
- return $this->kirby()->translation('en');
- }
- },
- 'kirbytext' => fn () => $this->kirby()->option('panel.kirbytext') ?? true,
- 'user' => fn () => $this->user(),
- 'version' => function () {
- $user = $this->user();
+ if ($translation = $this->kirby()->translation($translationCode)) {
+ return $translation;
+ } else {
+ return $this->kirby()->translation('en');
+ }
+ },
+ 'kirbytext' => fn () => $this->kirby()->option('panel.kirbytext') ?? true,
+ 'user' => fn () => $this->user(),
+ 'version' => function () {
+ $user = $this->user();
- if ($user && $user->role()->permissions()->for('access', 'system') === true) {
- return $this->kirby()->version();
- } else {
- return null;
- }
- }
- ],
- 'type' => 'Kirby\Cms\System',
- 'views' => [
- 'login' => [
- 'authStatus',
- 'isOk',
- 'isInstallable',
- 'isInstalled',
- 'loginMethods',
- 'title',
- 'translation'
- ],
- 'troubleshooting' => [
- 'isOk',
- 'isInstallable',
- 'isInstalled',
- 'title',
- 'translation',
- 'requirements'
- ],
- 'panel' => [
- 'ascii',
- 'defaultLanguage',
- 'isOk',
- 'isInstalled',
- 'isLocal',
- 'kirbytext',
- 'languages',
- 'license',
- 'locales',
- 'multilang',
- 'requirements',
- 'site',
- 'slugs',
- 'title',
- 'translation',
- 'user' => 'auth',
- 'version'
- ]
- ],
+ if ($user && $user->role()->permissions()->for('access', 'system') === true) {
+ return $this->kirby()->version();
+ } else {
+ return null;
+ }
+ }
+ ],
+ 'type' => 'Kirby\Cms\System',
+ 'views' => [
+ 'login' => [
+ 'authStatus',
+ 'isOk',
+ 'isInstallable',
+ 'isInstalled',
+ 'loginMethods',
+ 'title',
+ 'translation'
+ ],
+ 'troubleshooting' => [
+ 'isOk',
+ 'isInstallable',
+ 'isInstalled',
+ 'title',
+ 'translation',
+ 'requirements'
+ ],
+ 'panel' => [
+ 'ascii',
+ 'defaultLanguage',
+ 'isOk',
+ 'isInstalled',
+ 'isLocal',
+ 'kirbytext',
+ 'languages',
+ 'license',
+ 'locales',
+ 'multilang',
+ 'requirements',
+ 'site',
+ 'slugs',
+ 'title',
+ 'translation',
+ 'user' => 'auth',
+ 'version'
+ ]
+ ],
];
diff --git a/kirby/config/api/models/Translation.php b/kirby/config/api/models/Translation.php
index fe31b56..faf51e7 100755
--- a/kirby/config/api/models/Translation.php
+++ b/kirby/config/api/models/Translation.php
@@ -6,19 +6,19 @@ use Kirby\Cms\Translation;
* Translation
*/
return [
- 'fields' => [
- 'author' => fn (Translation $translation) => $translation->author(),
- 'data' => fn (Translation $translation) => $translation->dataWithFallback(),
- 'direction' => fn (Translation $translation) => $translation->direction(),
- 'id' => fn (Translation $translation) => $translation->id(),
- 'name' => fn (Translation $translation) => $translation->name(),
- ],
- 'type' => 'Kirby\Cms\Translation',
- 'views' => [
- 'compact' => [
- 'direction',
- 'id',
- 'name'
- ]
- ]
+ 'fields' => [
+ 'author' => fn (Translation $translation) => $translation->author(),
+ 'data' => fn (Translation $translation) => $translation->dataWithFallback(),
+ 'direction' => fn (Translation $translation) => $translation->direction(),
+ 'id' => fn (Translation $translation) => $translation->id(),
+ 'name' => fn (Translation $translation) => $translation->name(),
+ ],
+ 'type' => 'Kirby\Cms\Translation',
+ 'views' => [
+ 'compact' => [
+ 'direction',
+ 'id',
+ 'name'
+ ]
+ ]
];
diff --git a/kirby/config/api/models/User.php b/kirby/config/api/models/User.php
index c8a7a5f..5354e3a 100755
--- a/kirby/config/api/models/User.php
+++ b/kirby/config/api/models/User.php
@@ -7,71 +7,71 @@ use Kirby\Form\Form;
* User
*/
return [
- 'default' => fn () => $this->user(),
- 'fields' => [
- 'avatar' => fn (User $user) => $user->avatar() ? $user->avatar()->crop(512) : null,
- 'blueprint' => fn (User $user) => $user->blueprint(),
- 'content' => fn (User $user) => Form::for($user)->values(),
- 'email' => fn (User $user) => $user->email(),
- 'files' => fn (User $user) => $user->files()->sorted(),
- 'id' => fn (User $user) => $user->id(),
- 'language' => fn (User $user) => $user->language(),
- 'name' => fn (User $user) => $user->name()->value(),
- 'next' => fn (User $user) => $user->next(),
- 'options' => fn (User $user) => $user->panel()->options(),
- 'panelImage' => fn (User $user) => $user->panel()->image(),
- 'permissions' => fn (User $user) => $user->role()->permissions()->toArray(),
- 'prev' => fn (User $user) => $user->prev(),
- 'role' => fn (User $user) => $user->role(),
- 'roles' => fn (User $user) => $user->roles(),
- 'username' => fn (User $user) => $user->username()
- ],
- 'type' => 'Kirby\Cms\User',
- 'views' => [
- 'default' => [
- 'avatar',
- 'content',
- 'email',
- 'id',
- 'language',
- 'name',
- 'next' => 'compact',
- 'options',
- 'prev' => 'compact',
- 'role',
- 'username'
- ],
- 'compact' => [
- 'avatar' => 'compact',
- 'id',
- 'email',
- 'language',
- 'name',
- 'role' => 'compact',
- 'username'
- ],
- 'auth' => [
- 'avatar' => 'compact',
- 'permissions',
- 'email',
- 'id',
- 'name',
- 'role',
- 'language'
- ],
- 'panel' => [
- 'avatar' => 'compact',
- 'blueprint',
- 'content',
- 'email',
- 'id',
- 'language',
- 'name',
- 'next' => ['id', 'name'],
- 'options',
- 'prev' => ['id', 'name'],
- 'role',
- 'username',
- ],
- ]
+ 'default' => fn () => $this->user(),
+ 'fields' => [
+ 'avatar' => fn (User $user) => $user->avatar() ? $user->avatar()->crop(512) : null,
+ 'blueprint' => fn (User $user) => $user->blueprint(),
+ 'content' => fn (User $user) => Form::for($user)->values(),
+ 'email' => fn (User $user) => $user->email(),
+ 'files' => fn (User $user) => $user->files()->sorted(),
+ 'id' => fn (User $user) => $user->id(),
+ 'language' => fn (User $user) => $user->language(),
+ 'name' => fn (User $user) => $user->name()->value(),
+ 'next' => fn (User $user) => $user->next(),
+ 'options' => fn (User $user) => $user->panel()->options(),
+ 'panelImage' => fn (User $user) => $user->panel()->image(),
+ 'permissions' => fn (User $user) => $user->role()->permissions()->toArray(),
+ 'prev' => fn (User $user) => $user->prev(),
+ 'role' => fn (User $user) => $user->role(),
+ 'roles' => fn (User $user) => $user->roles(),
+ 'username' => fn (User $user) => $user->username()
+ ],
+ 'type' => 'Kirby\Cms\User',
+ 'views' => [
+ 'default' => [
+ 'avatar',
+ 'content',
+ 'email',
+ 'id',
+ 'language',
+ 'name',
+ 'next' => 'compact',
+ 'options',
+ 'prev' => 'compact',
+ 'role',
+ 'username'
+ ],
+ 'compact' => [
+ 'avatar' => 'compact',
+ 'id',
+ 'email',
+ 'language',
+ 'name',
+ 'role' => 'compact',
+ 'username'
+ ],
+ 'auth' => [
+ 'avatar' => 'compact',
+ 'permissions',
+ 'email',
+ 'id',
+ 'name',
+ 'role',
+ 'language'
+ ],
+ 'panel' => [
+ 'avatar' => 'compact',
+ 'blueprint',
+ 'content',
+ 'email',
+ 'id',
+ 'language',
+ 'name',
+ 'next' => ['id', 'name'],
+ 'options',
+ 'prev' => ['id', 'name'],
+ 'role',
+ 'username',
+ ],
+ ]
];
diff --git a/kirby/config/api/models/UserBlueprint.php b/kirby/config/api/models/UserBlueprint.php
index f20c88a..099a177 100755
--- a/kirby/config/api/models/UserBlueprint.php
+++ b/kirby/config/api/models/UserBlueprint.php
@@ -6,13 +6,13 @@ use Kirby\Cms\UserBlueprint;
* UserBlueprint
*/
return [
- 'fields' => [
- 'name' => fn (UserBlueprint $blueprint) => $blueprint->name(),
- 'options' => fn (UserBlueprint $blueprint) => $blueprint->options(),
- 'tabs' => fn (UserBlueprint $blueprint) => $blueprint->tabs(),
- 'title' => fn (UserBlueprint $blueprint) => $blueprint->title(),
- ],
- 'type' => 'Kirby\Cms\UserBlueprint',
- 'views' => [
- ],
+ 'fields' => [
+ 'name' => fn (UserBlueprint $blueprint) => $blueprint->name(),
+ 'options' => fn (UserBlueprint $blueprint) => $blueprint->options(),
+ 'tabs' => fn (UserBlueprint $blueprint) => $blueprint->tabs(),
+ 'title' => fn (UserBlueprint $blueprint) => $blueprint->title(),
+ ],
+ 'type' => 'Kirby\Cms\UserBlueprint',
+ 'views' => [
+ ],
];
diff --git a/kirby/config/api/routes.php b/kirby/config/api/routes.php
index fd3449d..749fbad 100755
--- a/kirby/config/api/routes.php
+++ b/kirby/config/api/routes.php
@@ -4,23 +4,23 @@
* Api Routes Definitions
*/
return function ($kirby) {
- $routes = array_merge(
- include __DIR__ . '/routes/auth.php',
- include __DIR__ . '/routes/pages.php',
- include __DIR__ . '/routes/roles.php',
- include __DIR__ . '/routes/site.php',
- include __DIR__ . '/routes/users.php',
- include __DIR__ . '/routes/files.php',
- include __DIR__ . '/routes/lock.php',
- include __DIR__ . '/routes/system.php',
- include __DIR__ . '/routes/translations.php'
- );
+ $routes = array_merge(
+ include __DIR__ . '/routes/auth.php',
+ include __DIR__ . '/routes/pages.php',
+ include __DIR__ . '/routes/roles.php',
+ include __DIR__ . '/routes/site.php',
+ include __DIR__ . '/routes/users.php',
+ include __DIR__ . '/routes/files.php',
+ include __DIR__ . '/routes/lock.php',
+ include __DIR__ . '/routes/system.php',
+ include __DIR__ . '/routes/translations.php'
+ );
- // only add the language routes if the
- // multi language setup is activated
- if ($kirby->option('languages', false) !== false) {
- $routes = array_merge($routes, include __DIR__ . '/routes/languages.php');
- }
+ // only add the language routes if the
+ // multi language setup is activated
+ if ($kirby->option('languages', false) !== false) {
+ $routes = array_merge($routes, include __DIR__ . '/routes/languages.php');
+ }
- return $routes;
+ return $routes;
};
diff --git a/kirby/config/api/routes/auth.php b/kirby/config/api/routes/auth.php
index 19f45a5..a4fcbb4 100755
--- a/kirby/config/api/routes/auth.php
+++ b/kirby/config/api/routes/auth.php
@@ -7,102 +7,102 @@ use Kirby\Exception\NotFoundException;
* Authentication
*/
return [
- [
- 'pattern' => 'auth',
- 'method' => 'GET',
- 'action' => function () {
- if ($user = $this->kirby()->auth()->user()) {
- return $this->resolve($user)->view('auth');
- }
+ [
+ 'pattern' => 'auth',
+ 'method' => 'GET',
+ 'action' => function () {
+ if ($user = $this->kirby()->auth()->user()) {
+ return $this->resolve($user)->view('auth');
+ }
- throw new NotFoundException('The user cannot be found');
- }
- ],
- [
- 'pattern' => 'auth/code',
- 'method' => 'POST',
- 'auth' => false,
- 'action' => function () {
- $auth = $this->kirby()->auth();
+ throw new NotFoundException('The user cannot be found');
+ }
+ ],
+ [
+ 'pattern' => 'auth/code',
+ 'method' => 'POST',
+ 'auth' => false,
+ 'action' => function () {
+ $auth = $this->kirby()->auth();
- // csrf token check
- if ($auth->type() === 'session' && $auth->csrf() === false) {
- throw new InvalidArgumentException('Invalid CSRF token');
- }
+ // csrf token check
+ if ($auth->type() === 'session' && $auth->csrf() === false) {
+ throw new InvalidArgumentException('Invalid CSRF token');
+ }
- $user = $auth->verifyChallenge($this->requestBody('code'));
+ $user = $auth->verifyChallenge($this->requestBody('code'));
- return [
- 'code' => 200,
- 'status' => 'ok',
- 'user' => $this->resolve($user)->view('auth')->toArray()
- ];
- }
- ],
- [
- 'pattern' => 'auth/login',
- 'method' => 'POST',
- 'auth' => false,
- 'action' => function () {
- $auth = $this->kirby()->auth();
- $methods = $this->kirby()->system()->loginMethods();
+ return [
+ 'code' => 200,
+ 'status' => 'ok',
+ 'user' => $this->resolve($user)->view('auth')->toArray()
+ ];
+ }
+ ],
+ [
+ 'pattern' => 'auth/login',
+ 'method' => 'POST',
+ 'auth' => false,
+ 'action' => function () {
+ $auth = $this->kirby()->auth();
+ $methods = $this->kirby()->system()->loginMethods();
- // csrf token check
- if ($auth->type() === 'session' && $auth->csrf() === false) {
- throw new InvalidArgumentException('Invalid CSRF token');
- }
+ // csrf token check
+ if ($auth->type() === 'session' && $auth->csrf() === false) {
+ throw new InvalidArgumentException('Invalid CSRF token');
+ }
- $email = $this->requestBody('email');
- $long = $this->requestBody('long');
- $password = $this->requestBody('password');
+ $email = $this->requestBody('email');
+ $long = $this->requestBody('long');
+ $password = $this->requestBody('password');
- if ($password) {
- if (isset($methods['password']) !== true) {
- throw new InvalidArgumentException('Login with password is not enabled');
- }
+ if ($password) {
+ if (isset($methods['password']) !== true) {
+ throw new InvalidArgumentException('Login with password is not enabled');
+ }
- if (
- isset($methods['password']['2fa']) === true &&
- $methods['password']['2fa'] === true
- ) {
- $status = $auth->login2fa($email, $password, $long);
- } else {
- $user = $auth->login($email, $password, $long);
- }
- } else {
- if (isset($methods['code']) === true) {
- $mode = 'login';
- } elseif (isset($methods['password-reset']) === true) {
- $mode = 'password-reset';
- } else {
- throw new InvalidArgumentException('Login without password is not enabled');
- }
+ if (
+ isset($methods['password']['2fa']) === true &&
+ $methods['password']['2fa'] === true
+ ) {
+ $status = $auth->login2fa($email, $password, $long);
+ } else {
+ $user = $auth->login($email, $password, $long);
+ }
+ } else {
+ if (isset($methods['code']) === true) {
+ $mode = 'login';
+ } elseif (isset($methods['password-reset']) === true) {
+ $mode = 'password-reset';
+ } else {
+ throw new InvalidArgumentException('Login without password is not enabled');
+ }
- $status = $auth->createChallenge($email, $long, $mode);
- }
+ $status = $auth->createChallenge($email, $long, $mode);
+ }
- if (isset($user)) {
- return [
- 'code' => 200,
- 'status' => 'ok',
- 'user' => $this->resolve($user)->view('auth')->toArray()
- ];
- } else {
- return [
- 'code' => 200,
- 'status' => 'ok',
- 'challenge' => $status->challenge()
- ];
- }
- }
- ],
- [
- 'pattern' => 'auth/logout',
- 'method' => 'POST',
- 'auth' => false,
- 'action' => function () {
- $this->kirby()->auth()->logout();
- return true;
- }
- ],
+ if (isset($user)) {
+ return [
+ 'code' => 200,
+ 'status' => 'ok',
+ 'user' => $this->resolve($user)->view('auth')->toArray()
+ ];
+ } else {
+ return [
+ 'code' => 200,
+ 'status' => 'ok',
+ 'challenge' => $status->challenge()
+ ];
+ }
+ }
+ ],
+ [
+ 'pattern' => 'auth/logout',
+ 'method' => 'POST',
+ 'auth' => false,
+ 'action' => function () {
+ $this->kirby()->auth()->logout();
+ return true;
+ }
+ ],
];
diff --git a/kirby/config/api/routes/files.php b/kirby/config/api/routes/files.php
index 77aea9c..c1b755b 100755
--- a/kirby/config/api/routes/files.php
+++ b/kirby/config/api/routes/files.php
@@ -8,125 +8,125 @@ $pattern = '(account|pages/[^/]+|site|users/[^/]+)';
*/
return [
- [
- 'pattern' => $pattern . '/files/(:any)/sections/(:any)',
- 'method' => 'GET',
- 'action' => function (string $path, string $filename, string $sectionName) {
- if ($section = $this->file($path, $filename)->blueprint()->section($sectionName)) {
- return $section->toResponse();
- }
- }
- ],
- [
- 'pattern' => $pattern . '/files/(:any)/fields/(:any)/(:all?)',
- 'method' => 'ALL',
- 'action' => function (string $parent, string $filename, string $fieldName, string $path = null) {
- if ($file = $this->file($parent, $filename)) {
- return $this->fieldApi($file, $fieldName, $path);
- }
- }
- ],
- [
- 'pattern' => $pattern . '/files',
- 'method' => 'GET',
- 'action' => function (string $path) {
- return $this->parent($path)->files()->sorted();
- }
- ],
- [
- 'pattern' => $pattern . '/files',
- 'method' => 'POST',
- 'action' => function (string $path) {
- // move_uploaded_file() not working with unit test
- // @codeCoverageIgnoreStart
- return $this->upload(function ($source, $filename) use ($path) {
- return $this->parent($path)->createFile([
- 'content' => [
- 'sort' => $this->requestBody('sort')
- ],
- 'source' => $source,
- 'template' => $this->requestBody('template'),
- 'filename' => $filename
- ]);
- });
- // @codeCoverageIgnoreEnd
- }
- ],
- [
- 'pattern' => $pattern . '/files/search',
- 'method' => 'GET|POST',
- 'action' => function (string $path) {
- $files = $this->parent($path)->files();
+ [
+ 'pattern' => $pattern . '/files/(:any)/sections/(:any)',
+ 'method' => 'GET',
+ 'action' => function (string $path, string $filename, string $sectionName) {
+ if ($section = $this->file($path, $filename)->blueprint()->section($sectionName)) {
+ return $section->toResponse();
+ }
+ }
+ ],
+ [
+ 'pattern' => $pattern . '/files/(:any)/fields/(:any)/(:all?)',
+ 'method' => 'ALL',
+ 'action' => function (string $parent, string $filename, string $fieldName, string $path = null) {
+ if ($file = $this->file($parent, $filename)) {
+ return $this->fieldApi($file, $fieldName, $path);
+ }
+ }
+ ],
+ [
+ 'pattern' => $pattern . '/files',
+ 'method' => 'GET',
+ 'action' => function (string $path) {
+ return $this->parent($path)->files()->sorted();
+ }
+ ],
+ [
+ 'pattern' => $pattern . '/files',
+ 'method' => 'POST',
+ 'action' => function (string $path) {
+ // move_uploaded_file() not working with unit test
+ // @codeCoverageIgnoreStart
+ return $this->upload(function ($source, $filename) use ($path) {
+ return $this->parent($path)->createFile([
+ 'content' => [
+ 'sort' => $this->requestBody('sort')
+ ],
+ 'source' => $source,
+ 'template' => $this->requestBody('template'),
+ 'filename' => $filename
+ ]);
+ });
+ // @codeCoverageIgnoreEnd
+ }
+ ],
+ [
+ 'pattern' => $pattern . '/files/search',
+ 'method' => 'GET|POST',
+ 'action' => function (string $path) {
+ $files = $this->parent($path)->files();
- if ($this->requestMethod() === 'GET') {
- return $files->search($this->requestQuery('q'));
- } else {
- return $files->query($this->requestBody());
- }
- }
- ],
- [
- 'pattern' => $pattern . '/files/sort',
- 'method' => 'PATCH',
- 'action' => function (string $path) {
- return $this->parent($path)->files()->changeSort(
- $this->requestBody('files'),
- $this->requestBody('index')
- );
- }
- ],
- [
- 'pattern' => $pattern . '/files/(:any)',
- 'method' => 'GET',
- 'action' => function (string $path, string $filename) {
- return $this->file($path, $filename);
- }
- ],
- [
- 'pattern' => $pattern . '/files/(:any)',
- 'method' => 'PATCH',
- 'action' => function (string $path, string $filename) {
- return $this->file($path, $filename)->update($this->requestBody(), $this->language(), true);
- }
- ],
- [
- 'pattern' => $pattern . '/files/(:any)',
- 'method' => 'POST',
- 'action' => function (string $path, string $filename) {
- return $this->upload(function ($source) use ($path, $filename) {
- return $this->file($path, $filename)->replace($source);
- });
- }
- ],
- [
- 'pattern' => $pattern . '/files/(:any)',
- 'method' => 'DELETE',
- 'action' => function (string $path, string $filename) {
- return $this->file($path, $filename)->delete();
- }
- ],
- [
- 'pattern' => $pattern . '/files/(:any)/name',
- 'method' => 'PATCH',
- 'action' => function (string $path, string $filename) {
- return $this->file($path, $filename)->changeName($this->requestBody('name'));
- }
- ],
- [
- 'pattern' => 'files/search',
- 'method' => 'GET|POST',
- 'action' => function () {
- $files = $this
- ->site()
- ->index(true)
- ->filter('isReadable', true)
- ->files();
+ if ($this->requestMethod() === 'GET') {
+ return $files->search($this->requestQuery('q'));
+ } else {
+ return $files->query($this->requestBody());
+ }
+ }
+ ],
+ [
+ 'pattern' => $pattern . '/files/sort',
+ 'method' => 'PATCH',
+ 'action' => function (string $path) {
+ return $this->parent($path)->files()->changeSort(
+ $this->requestBody('files'),
+ $this->requestBody('index')
+ );
+ }
+ ],
+ [
+ 'pattern' => $pattern . '/files/(:any)',
+ 'method' => 'GET',
+ 'action' => function (string $path, string $filename) {
+ return $this->file($path, $filename);
+ }
+ ],
+ [
+ 'pattern' => $pattern . '/files/(:any)',
+ 'method' => 'PATCH',
+ 'action' => function (string $path, string $filename) {
+ return $this->file($path, $filename)->update($this->requestBody(), $this->language(), true);
+ }
+ ],
+ [
+ 'pattern' => $pattern . '/files/(:any)',
+ 'method' => 'POST',
+ 'action' => function (string $path, string $filename) {
+ return $this->upload(function ($source) use ($path, $filename) {
+ return $this->file($path, $filename)->replace($source);
+ });
+ }
+ ],
+ [
+ 'pattern' => $pattern . '/files/(:any)',
+ 'method' => 'DELETE',
+ 'action' => function (string $path, string $filename) {
+ return $this->file($path, $filename)->delete();
+ }
+ ],
+ [
+ 'pattern' => $pattern . '/files/(:any)/name',
+ 'method' => 'PATCH',
+ 'action' => function (string $path, string $filename) {
+ return $this->file($path, $filename)->changeName($this->requestBody('name'));
+ }
+ ],
+ [
+ 'pattern' => 'files/search',
+ 'method' => 'GET|POST',
+ 'action' => function () {
+ $files = $this
+ ->site()
+ ->index(true)
+ ->filter('isReadable', true)
+ ->files();
- if ($this->requestMethod() === 'GET') {
- return $files->search($this->requestQuery('q'));
- } else {
- return $files->query($this->requestBody());
- }
- }
- ],
+ if ($this->requestMethod() === 'GET') {
+ return $files->search($this->requestQuery('q'));
+ } else {
+ return $files->query($this->requestBody());
+ }
+ }
+ ],
];
diff --git a/kirby/config/api/routes/languages.php b/kirby/config/api/routes/languages.php
index 8d8829b..4105ef2 100755
--- a/kirby/config/api/routes/languages.php
+++ b/kirby/config/api/routes/languages.php
@@ -4,43 +4,43 @@
* Roles Routes
*/
return [
- [
- 'pattern' => 'languages',
- 'method' => 'GET',
- 'action' => function () {
- return $this->kirby()->languages();
- }
- ],
- [
- 'pattern' => 'languages',
- 'method' => 'POST',
- 'action' => function () {
- return $this->kirby()->languages()->create($this->requestBody());
- }
- ],
- [
- 'pattern' => 'languages/(:any)',
- 'method' => 'GET',
- 'action' => function (string $code) {
- return $this->kirby()->languages()->find($code);
- }
- ],
- [
- 'pattern' => 'languages/(:any)',
- 'method' => 'PATCH',
- 'action' => function (string $code) {
- if ($language = $this->kirby()->languages()->find($code)) {
- return $language->update($this->requestBody());
- }
- }
- ],
- [
- 'pattern' => 'languages/(:any)',
- 'method' => 'DELETE',
- 'action' => function (string $code) {
- if ($language = $this->kirby()->languages()->find($code)) {
- return $language->delete();
- }
- }
- ]
+ [
+ 'pattern' => 'languages',
+ 'method' => 'GET',
+ 'action' => function () {
+ return $this->kirby()->languages();
+ }
+ ],
+ [
+ 'pattern' => 'languages',
+ 'method' => 'POST',
+ 'action' => function () {
+ return $this->kirby()->languages()->create($this->requestBody());
+ }
+ ],
+ [
+ 'pattern' => 'languages/(:any)',
+ 'method' => 'GET',
+ 'action' => function (string $code) {
+ return $this->kirby()->languages()->find($code);
+ }
+ ],
+ [
+ 'pattern' => 'languages/(:any)',
+ 'method' => 'PATCH',
+ 'action' => function (string $code) {
+ if ($language = $this->kirby()->languages()->find($code)) {
+ return $language->update($this->requestBody());
+ }
+ }
+ ],
+ [
+ 'pattern' => 'languages/(:any)',
+ 'method' => 'DELETE',
+ 'action' => function (string $code) {
+ if ($language = $this->kirby()->languages()->find($code)) {
+ return $language->delete();
+ }
+ }
+ ]
];
diff --git a/kirby/config/api/routes/lock.php b/kirby/config/api/routes/lock.php
index 935d5fe..c5b2da4 100755
--- a/kirby/config/api/routes/lock.php
+++ b/kirby/config/api/routes/lock.php
@@ -5,40 +5,40 @@
* Content Lock Routes
*/
return [
- [
- 'pattern' => '(:all)/lock',
- 'method' => 'PATCH',
- 'action' => function (string $path) {
- if ($lock = $this->parent($path)->lock()) {
- return $lock->create();
- }
- }
- ],
- [
- 'pattern' => '(:all)/lock',
- 'method' => 'DELETE',
- 'action' => function (string $path) {
- if ($lock = $this->parent($path)->lock()) {
- return $lock->remove();
- }
- }
- ],
- [
- 'pattern' => '(:all)/unlock',
- 'method' => 'PATCH',
- 'action' => function (string $path) {
- if ($lock = $this->parent($path)->lock()) {
- return $lock->unlock();
- }
- }
- ],
- [
- 'pattern' => '(:all)/unlock',
- 'method' => 'DELETE',
- 'action' => function (string $path) {
- if ($lock = $this->parent($path)->lock()) {
- return $lock->resolve();
- }
- }
- ],
+ [
+ 'pattern' => '(:all)/lock',
+ 'method' => 'PATCH',
+ 'action' => function (string $path) {
+ if ($lock = $this->parent($path)->lock()) {
+ return $lock->create();
+ }
+ }
+ ],
+ [
+ 'pattern' => '(:all)/lock',
+ 'method' => 'DELETE',
+ 'action' => function (string $path) {
+ if ($lock = $this->parent($path)->lock()) {
+ return $lock->remove();
+ }
+ }
+ ],
+ [
+ 'pattern' => '(:all)/unlock',
+ 'method' => 'PATCH',
+ 'action' => function (string $path) {
+ if ($lock = $this->parent($path)->lock()) {
+ return $lock->unlock();
+ }
+ }
+ ],
+ [
+ 'pattern' => '(:all)/unlock',
+ 'method' => 'DELETE',
+ 'action' => function (string $path) {
+ if ($lock = $this->parent($path)->lock()) {
+ return $lock->resolve();
+ }
+ }
+ ],
];
diff --git a/kirby/config/api/routes/pages.php b/kirby/config/api/routes/pages.php
index 525fdc4..3ff255c 100755
--- a/kirby/config/api/routes/pages.php
+++ b/kirby/config/api/routes/pages.php
@@ -6,116 +6,116 @@
*/
return [
- [
- 'pattern' => 'pages/(:any)',
- 'method' => 'GET',
- 'action' => function (string $id) {
- return $this->page($id);
- }
- ],
- [
- 'pattern' => 'pages/(:any)',
- 'method' => 'PATCH',
- 'action' => function (string $id) {
- return $this->page($id)->update($this->requestBody(), $this->language(), true);
- }
- ],
- [
- 'pattern' => 'pages/(:any)',
- 'method' => 'DELETE',
- 'action' => function (string $id) {
- return $this->page($id)->delete($this->requestBody('force', false));
- }
- ],
- [
- 'pattern' => 'pages/(:any)/blueprint',
- 'method' => 'GET',
- 'action' => function (string $id) {
- return $this->page($id)->blueprint();
- }
- ],
- [
- 'pattern' => 'pages/(:any)/blueprints',
- 'method' => 'GET',
- 'action' => function (string $id) {
- return $this->page($id)->blueprints($this->requestQuery('section'));
- }
- ],
- [
- 'pattern' => 'pages/(:any)/children',
- 'method' => 'GET',
- 'action' => function (string $id) {
- return $this->pages($id, $this->requestQuery('status'));
- }
- ],
- [
- 'pattern' => 'pages/(:any)/children',
- 'method' => 'POST',
- 'action' => function (string $id) {
- return $this->page($id)->createChild($this->requestBody());
- }
- ],
- [
- 'pattern' => 'pages/(:any)/children/search',
- 'method' => 'GET|POST',
- 'action' => function (string $id) {
- return $this->searchPages($id);
- }
- ],
- [
- 'pattern' => 'pages/(:any)/duplicate',
- 'method' => 'POST',
- 'action' => function (string $id) {
- return $this->page($id)->duplicate($this->requestBody('slug'), [
- 'children' => $this->requestBody('children'),
- 'files' => $this->requestBody('files'),
- ]);
- }
- ],
- [
- 'pattern' => 'pages/(:any)/slug',
- 'method' => 'PATCH',
- 'action' => function (string $id) {
- return $this->page($id)->changeSlug($this->requestBody('slug'));
- }
- ],
- [
- 'pattern' => 'pages/(:any)/status',
- 'method' => 'PATCH',
- 'action' => function (string $id) {
- return $this->page($id)->changeStatus($this->requestBody('status'), $this->requestBody('position'));
- }
- ],
- [
- 'pattern' => 'pages/(:any)/template',
- 'method' => 'PATCH',
- 'action' => function (string $id) {
- return $this->page($id)->changeTemplate($this->requestBody('template'));
- }
- ],
- [
- 'pattern' => 'pages/(:any)/title',
- 'method' => 'PATCH',
- 'action' => function (string $id) {
- return $this->page($id)->changeTitle($this->requestBody('title'));
- }
- ],
- [
- 'pattern' => 'pages/(:any)/sections/(:any)',
- 'method' => 'GET',
- 'action' => function (string $id, string $sectionName) {
- if ($section = $this->page($id)->blueprint()->section($sectionName)) {
- return $section->toResponse();
- }
- }
- ],
- [
- 'pattern' => 'pages/(:any)/fields/(:any)/(:all?)',
- 'method' => 'ALL',
- 'action' => function (string $id, string $fieldName, string $path = null) {
- if ($page = $this->page($id)) {
- return $this->fieldApi($page, $fieldName, $path);
- }
- }
- ],
+ [
+ 'pattern' => 'pages/(:any)',
+ 'method' => 'GET',
+ 'action' => function (string $id) {
+ return $this->page($id);
+ }
+ ],
+ [
+ 'pattern' => 'pages/(:any)',
+ 'method' => 'PATCH',
+ 'action' => function (string $id) {
+ return $this->page($id)->update($this->requestBody(), $this->language(), true);
+ }
+ ],
+ [
+ 'pattern' => 'pages/(:any)',
+ 'method' => 'DELETE',
+ 'action' => function (string $id) {
+ return $this->page($id)->delete($this->requestBody('force', false));
+ }
+ ],
+ [
+ 'pattern' => 'pages/(:any)/blueprint',
+ 'method' => 'GET',
+ 'action' => function (string $id) {
+ return $this->page($id)->blueprint();
+ }
+ ],
+ [
+ 'pattern' => 'pages/(:any)/blueprints',
+ 'method' => 'GET',
+ 'action' => function (string $id) {
+ return $this->page($id)->blueprints($this->requestQuery('section'));
+ }
+ ],
+ [
+ 'pattern' => 'pages/(:any)/children',
+ 'method' => 'GET',
+ 'action' => function (string $id) {
+ return $this->pages($id, $this->requestQuery('status'));
+ }
+ ],
+ [
+ 'pattern' => 'pages/(:any)/children',
+ 'method' => 'POST',
+ 'action' => function (string $id) {
+ return $this->page($id)->createChild($this->requestBody());
+ }
+ ],
+ [
+ 'pattern' => 'pages/(:any)/children/search',
+ 'method' => 'GET|POST',
+ 'action' => function (string $id) {
+ return $this->searchPages($id);
+ }
+ ],
+ [
+ 'pattern' => 'pages/(:any)/duplicate',
+ 'method' => 'POST',
+ 'action' => function (string $id) {
+ return $this->page($id)->duplicate($this->requestBody('slug'), [
+ 'children' => $this->requestBody('children'),
+ 'files' => $this->requestBody('files'),
+ ]);
+ }
+ ],
+ [
+ 'pattern' => 'pages/(:any)/slug',
+ 'method' => 'PATCH',
+ 'action' => function (string $id) {
+ return $this->page($id)->changeSlug($this->requestBody('slug'));
+ }
+ ],
+ [
+ 'pattern' => 'pages/(:any)/status',
+ 'method' => 'PATCH',
+ 'action' => function (string $id) {
+ return $this->page($id)->changeStatus($this->requestBody('status'), $this->requestBody('position'));
+ }
+ ],
+ [
+ 'pattern' => 'pages/(:any)/template',
+ 'method' => 'PATCH',
+ 'action' => function (string $id) {
+ return $this->page($id)->changeTemplate($this->requestBody('template'));
+ }
+ ],
+ [
+ 'pattern' => 'pages/(:any)/title',
+ 'method' => 'PATCH',
+ 'action' => function (string $id) {
+ return $this->page($id)->changeTitle($this->requestBody('title'));
+ }
+ ],
+ [
+ 'pattern' => 'pages/(:any)/sections/(:any)',
+ 'method' => 'GET',
+ 'action' => function (string $id, string $sectionName) {
+ if ($section = $this->page($id)->blueprint()->section($sectionName)) {
+ return $section->toResponse();
+ }
+ }
+ ],
+ [
+ 'pattern' => 'pages/(:any)/fields/(:any)/(:all?)',
+ 'method' => 'ALL',
+ 'action' => function (string $id, string $fieldName, string $path = null) {
+ if ($page = $this->page($id)) {
+ return $this->fieldApi($page, $fieldName, $path);
+ }
+ }
+ ],
];
diff --git a/kirby/config/api/routes/roles.php b/kirby/config/api/routes/roles.php
index bd91952..7dbe45f 100755
--- a/kirby/config/api/routes/roles.php
+++ b/kirby/config/api/routes/roles.php
@@ -4,27 +4,27 @@
* Roles Routes
*/
return [
- [
- 'pattern' => 'roles',
- 'method' => 'GET',
- 'action' => function () {
- $kirby = $this->kirby();
+ [
+ 'pattern' => 'roles',
+ 'method' => 'GET',
+ 'action' => function () {
+ $kirby = $this->kirby();
- switch ($kirby->request()->get('canBe')) {
- case 'changed':
- return $kirby->roles()->canBeChanged();
- case 'created':
- return $kirby->roles()->canBeCreated();
- default:
- return $kirby->roles();
- }
- }
- ],
- [
- 'pattern' => 'roles/(:any)',
- 'method' => 'GET',
- 'action' => function (string $name) {
- return $this->kirby()->roles()->find($name);
- }
- ]
+ switch ($kirby->request()->get('canBe')) {
+ case 'changed':
+ return $kirby->roles()->canBeChanged();
+ case 'created':
+ return $kirby->roles()->canBeCreated();
+ default:
+ return $kirby->roles();
+ }
+ }
+ ],
+ [
+ 'pattern' => 'roles/(:any)',
+ 'method' => 'GET',
+ 'action' => function (string $name) {
+ return $this->kirby()->roles()->find($name);
+ }
+ ]
];
diff --git a/kirby/config/api/routes/site.php b/kirby/config/api/routes/site.php
index 890707e..3f2601c 100755
--- a/kirby/config/api/routes/site.php
+++ b/kirby/config/api/routes/site.php
@@ -6,99 +6,99 @@
*/
return [
- [
- 'pattern' => 'site',
- 'action' => function () {
- return $this->site();
- }
- ],
- [
- 'pattern' => 'site',
- 'method' => 'PATCH',
- 'action' => function () {
- return $this->site()->update($this->requestBody(), $this->language(), true);
- }
- ],
- [
- 'pattern' => 'site/children',
- 'method' => 'GET',
- 'action' => function () {
- return $this->pages(null, $this->requestQuery('status'));
- }
- ],
- [
- 'pattern' => 'site/children',
- 'method' => 'POST',
- 'action' => function () {
- return $this->site()->createChild($this->requestBody());
- }
- ],
- [
- 'pattern' => 'site/children/search',
- 'method' => 'GET|POST',
- 'action' => function () {
- return $this->searchPages();
- }
- ],
- [
- 'pattern' => 'site/blueprint',
- 'method' => 'GET',
- 'action' => function () {
- return $this->site()->blueprint();
- }
- ],
- [
- 'pattern' => 'site/blueprints',
- 'method' => 'GET',
- 'action' => function () {
- return $this->site()->blueprints($this->requestQuery('section'));
- }
- ],
- [
- 'pattern' => 'site/find',
- 'method' => 'POST',
- 'action' => function () {
- return $this->site()->find(false, ...$this->requestBody());
- }
- ],
- [
- 'pattern' => 'site/title',
- 'method' => 'PATCH',
- 'action' => function () {
- return $this->site()->changeTitle($this->requestBody('title'));
- }
- ],
- [
- 'pattern' => 'site/search',
- 'method' => 'GET|POST',
- 'action' => function () {
- $pages = $this
- ->site()
- ->index(true)
- ->filter('isReadable', true);
+ [
+ 'pattern' => 'site',
+ 'action' => function () {
+ return $this->site();
+ }
+ ],
+ [
+ 'pattern' => 'site',
+ 'method' => 'PATCH',
+ 'action' => function () {
+ return $this->site()->update($this->requestBody(), $this->language(), true);
+ }
+ ],
+ [
+ 'pattern' => 'site/children',
+ 'method' => 'GET',
+ 'action' => function () {
+ return $this->pages(null, $this->requestQuery('status'));
+ }
+ ],
+ [
+ 'pattern' => 'site/children',
+ 'method' => 'POST',
+ 'action' => function () {
+ return $this->site()->createChild($this->requestBody());
+ }
+ ],
+ [
+ 'pattern' => 'site/children/search',
+ 'method' => 'GET|POST',
+ 'action' => function () {
+ return $this->searchPages();
+ }
+ ],
+ [
+ 'pattern' => 'site/blueprint',
+ 'method' => 'GET',
+ 'action' => function () {
+ return $this->site()->blueprint();
+ }
+ ],
+ [
+ 'pattern' => 'site/blueprints',
+ 'method' => 'GET',
+ 'action' => function () {
+ return $this->site()->blueprints($this->requestQuery('section'));
+ }
+ ],
+ [
+ 'pattern' => 'site/find',
+ 'method' => 'POST',
+ 'action' => function () {
+ return $this->site()->find(false, ...$this->requestBody());
+ }
+ ],
+ [
+ 'pattern' => 'site/title',
+ 'method' => 'PATCH',
+ 'action' => function () {
+ return $this->site()->changeTitle($this->requestBody('title'));
+ }
+ ],
+ [
+ 'pattern' => 'site/search',
+ 'method' => 'GET|POST',
+ 'action' => function () {
+ $pages = $this
+ ->site()
+ ->index(true)
+ ->filter('isReadable', true);
- if ($this->requestMethod() === 'GET') {
- return $pages->search($this->requestQuery('q'));
- } else {
- return $pages->query($this->requestBody());
- }
- }
- ],
- [
- 'pattern' => 'site/sections/(:any)',
- 'method' => 'GET',
- 'action' => function (string $sectionName) {
- if ($section = $this->site()->blueprint()->section($sectionName)) {
- return $section->toResponse();
- }
- }
- ],
- [
- 'pattern' => 'site/fields/(:any)/(:all?)',
- 'method' => 'ALL',
- 'action' => function (string $fieldName, string $path = null) {
- return $this->fieldApi($this->site(), $fieldName, $path);
- }
- ]
+ if ($this->requestMethod() === 'GET') {
+ return $pages->search($this->requestQuery('q'));
+ } else {
+ return $pages->query($this->requestBody());
+ }
+ }
+ ],
+ [
+ 'pattern' => 'site/sections/(:any)',
+ 'method' => 'GET',
+ 'action' => function (string $sectionName) {
+ if ($section = $this->site()->blueprint()->section($sectionName)) {
+ return $section->toResponse();
+ }
+ }
+ ],
+ [
+ 'pattern' => 'site/fields/(:any)/(:all?)',
+ 'method' => 'ALL',
+ 'action' => function (string $fieldName, string $path = null) {
+ return $this->fieldApi($this->site(), $fieldName, $path);
+ }
+ ]
];
diff --git a/kirby/config/api/routes/system.php b/kirby/config/api/routes/system.php
index 44c8807..0f6ba46 100755
--- a/kirby/config/api/routes/system.php
+++ b/kirby/config/api/routes/system.php
@@ -8,72 +8,72 @@ use Kirby\Exception\InvalidArgumentException;
*/
return [
- [
- 'pattern' => 'system',
- 'method' => 'GET',
- 'auth' => false,
- 'action' => function () {
- $system = $this->kirby()->system();
+ [
+ 'pattern' => 'system',
+ 'method' => 'GET',
+ 'auth' => false,
+ 'action' => function () {
+ $system = $this->kirby()->system();
- if ($this->kirby()->user()) {
- return $system;
- } else {
- if ($system->isOk() === true) {
- $info = $this->resolve($system)->view('login')->toArray();
- } else {
- $info = $this->resolve($system)->view('troubleshooting')->toArray();
- }
+ if ($this->kirby()->user()) {
+ return $system;
+ } else {
+ if ($system->isOk() === true) {
+ $info = $this->resolve($system)->view('login')->toArray();
+ } else {
+ $info = $this->resolve($system)->view('troubleshooting')->toArray();
+ }
- return [
- 'status' => 'ok',
- 'data' => $info,
- 'type' => 'model'
- ];
- }
- }
- ],
- [
- 'pattern' => 'system/register',
- 'method' => 'POST',
- 'action' => function () {
- return $this->kirby()->system()->register($this->requestBody('license'), $this->requestBody('email'));
- }
- ],
- [
- 'pattern' => 'system/install',
- 'method' => 'POST',
- 'auth' => false,
- 'action' => function () {
- $system = $this->kirby()->system();
- $auth = $this->kirby()->auth();
+ return [
+ 'status' => 'ok',
+ 'data' => $info,
+ 'type' => 'model'
+ ];
+ }
+ }
+ ],
+ [
+ 'pattern' => 'system/register',
+ 'method' => 'POST',
+ 'action' => function () {
+ return $this->kirby()->system()->register($this->requestBody('license'), $this->requestBody('email'));
+ }
+ ],
+ [
+ 'pattern' => 'system/install',
+ 'method' => 'POST',
+ 'auth' => false,
+ 'action' => function () {
+ $system = $this->kirby()->system();
+ $auth = $this->kirby()->auth();
- // csrf token check
- if ($auth->type() === 'session' && $auth->csrf() === false) {
- throw new InvalidArgumentException('Invalid CSRF token');
- }
+ // csrf token check
+ if ($auth->type() === 'session' && $auth->csrf() === false) {
+ throw new InvalidArgumentException('Invalid CSRF token');
+ }
- if ($system->isOk() === false) {
- throw new Exception('The server is not setup correctly');
- }
+ if ($system->isOk() === false) {
+ throw new Exception('The server is not setup correctly');
+ }
- if ($system->isInstallable() === false) {
- throw new Exception('The Panel cannot be installed');
- }
+ if ($system->isInstallable() === false) {
+ throw new Exception('The Panel cannot be installed');
+ }
- if ($system->isInstalled() === true) {
- throw new Exception('The Panel is already installed');
- }
+ if ($system->isInstalled() === true) {
+ throw new Exception('The Panel is already installed');
+ }
- // create the first user
- $user = $this->users()->create($this->requestBody());
- $token = $user->login($this->requestBody('password'));
+ // create the first user
+ $user = $this->users()->create($this->requestBody());
+ $token = $user->login($this->requestBody('password'));
- return [
- 'status' => 'ok',
- 'token' => $token,
- 'user' => $this->resolve($user)->view('auth')->toArray()
- ];
- }
- ]
+ return [
+ 'status' => 'ok',
+ 'token' => $token,
+ 'user' => $this->resolve($user)->view('auth')->toArray()
+ ];
+ }
+ ]
];
diff --git a/kirby/config/api/routes/translations.php b/kirby/config/api/routes/translations.php
index db7faca..2d949c5 100755
--- a/kirby/config/api/routes/translations.php
+++ b/kirby/config/api/routes/translations.php
@@ -4,21 +4,21 @@
* Translations Routes
*/
return [
- [
- 'pattern' => 'translations',
- 'method' => 'GET',
- 'auth' => false,
- 'action' => function () {
- return $this->kirby()->translations();
- }
- ],
- [
- 'pattern' => 'translations/(:any)',
- 'method' => 'GET',
- 'auth' => false,
- 'action' => function (string $code) {
- return $this->kirby()->translations()->find($code);
- }
- ]
+ [
+ 'pattern' => 'translations',
+ 'method' => 'GET',
+ 'auth' => false,
+ 'action' => function () {
+ return $this->kirby()->translations();
+ }
+ ],
+ [
+ 'pattern' => 'translations/(:any)',
+ 'method' => 'GET',
+ 'auth' => false,
+ 'action' => function (string $code) {
+ return $this->kirby()->translations()->find($code);
+ }
+ ]
];
diff --git a/kirby/config/api/routes/users.php b/kirby/config/api/routes/users.php
index abd09c5..daa245d 100755
--- a/kirby/config/api/routes/users.php
+++ b/kirby/config/api/routes/users.php
@@ -6,202 +6,202 @@ use Kirby\Filesystem\F;
* User Routes
*/
return [
- [
- 'pattern' => 'users',
- 'method' => 'GET',
- 'action' => function () {
- return $this->users()->sort('username', 'asc', 'email', 'asc');
- }
- ],
- [
- 'pattern' => 'users',
- 'method' => 'POST',
- 'action' => function () {
- return $this->users()->create($this->requestBody());
- }
- ],
- [
- 'pattern' => 'users/search',
- 'method' => 'GET|POST',
- 'action' => function () {
- if ($this->requestMethod() === 'GET') {
- return $this->users()->search($this->requestQuery('q'));
- } else {
- return $this->users()->query($this->requestBody());
- }
- }
- ],
- [
- 'pattern' => [
- '(account)',
- 'users/(:any)',
- ],
- 'method' => 'GET',
- 'action' => function (string $id) {
- return $this->user($id);
- }
- ],
- [
- 'pattern' => [
- '(account)',
- 'users/(:any)',
- ],
- 'method' => 'PATCH',
- 'action' => function (string $id) {
- return $this->user($id)->update($this->requestBody(), $this->language(), true);
- }
- ],
- [
- 'pattern' => [
- '(account)',
- 'users/(:any)',
- ],
- 'method' => 'DELETE',
- 'action' => function (string $id) {
- return $this->user($id)->delete();
- }
- ],
- [
- 'pattern' => [
- '(account)/avatar',
- 'users/(:any)/avatar',
- ],
- 'method' => 'GET',
- 'action' => function (string $id) {
- return $this->user($id)->avatar();
- }
- ],
- // @codeCoverageIgnoreStart
- [
- 'pattern' => [
- '(account)/avatar',
- 'users/(:any)/avatar',
- ],
- 'method' => 'POST',
- 'action' => function (string $id) {
- if ($avatar = $this->user($id)->avatar()) {
- $avatar->delete();
- }
+ [
+ 'pattern' => 'users',
+ 'method' => 'GET',
+ 'action' => function () {
+ return $this->users()->sort('username', 'asc', 'email', 'asc');
+ }
+ ],
+ [
+ 'pattern' => 'users',
+ 'method' => 'POST',
+ 'action' => function () {
+ return $this->users()->create($this->requestBody());
+ }
+ ],
+ [
+ 'pattern' => 'users/search',
+ 'method' => 'GET|POST',
+ 'action' => function () {
+ if ($this->requestMethod() === 'GET') {
+ return $this->users()->search($this->requestQuery('q'));
+ } else {
+ return $this->users()->query($this->requestBody());
+ }
+ }
+ ],
+ [
+ 'pattern' => [
+ '(account)',
+ 'users/(:any)',
+ ],
+ 'method' => 'GET',
+ 'action' => function (string $id) {
+ return $this->user($id);
+ }
+ ],
+ [
+ 'pattern' => [
+ '(account)',
+ 'users/(:any)',
+ ],
+ 'method' => 'PATCH',
+ 'action' => function (string $id) {
+ return $this->user($id)->update($this->requestBody(), $this->language(), true);
+ }
+ ],
+ [
+ 'pattern' => [
+ '(account)',
+ 'users/(:any)',
+ ],
+ 'method' => 'DELETE',
+ 'action' => function (string $id) {
+ return $this->user($id)->delete();
+ }
+ ],
+ [
+ 'pattern' => [
+ '(account)/avatar',
+ 'users/(:any)/avatar',
+ ],
+ 'method' => 'GET',
+ 'action' => function (string $id) {
+ return $this->user($id)->avatar();
+ }
+ ],
+ // @codeCoverageIgnoreStart
+ [
+ 'pattern' => [
+ '(account)/avatar',
+ 'users/(:any)/avatar',
+ ],
+ 'method' => 'POST',
+ 'action' => function (string $id) {
+ if ($avatar = $this->user($id)->avatar()) {
+ $avatar->delete();
+ }
- return $this->upload(function ($source, $filename) use ($id) {
- return $this->user($id)->createFile([
- 'filename' => 'profile.' . F::extension($filename),
- 'template' => 'avatar',
- 'source' => $source
- ]);
- }, $single = true);
- }
- ],
- // @codeCoverageIgnoreEnd
- [
- 'pattern' => [
- '(account)/avatar',
- 'users/(:any)/avatar',
- ],
- 'method' => 'DELETE',
- 'action' => function (string $id) {
- return $this->user($id)->avatar()->delete();
- }
- ],
- [
- 'pattern' => [
- '(account)/blueprint',
- 'users/(:any)/blueprint',
- ],
- 'method' => 'GET',
- 'action' => function (string $id) {
- return $this->user($id)->blueprint();
- }
- ],
- [
- 'pattern' => [
- '(account)/blueprints',
- 'users/(:any)/blueprints',
- ],
- 'method' => 'GET',
- 'action' => function (string $id) {
- return $this->user($id)->blueprints($this->requestQuery('section'));
- }
- ],
- [
- 'pattern' => [
- '(account)/email',
- 'users/(:any)/email',
- ],
- 'method' => 'PATCH',
- 'action' => function (string $id) {
- return $this->user($id)->changeEmail($this->requestBody('email'));
- }
- ],
- [
- 'pattern' => [
- '(account)/language',
- 'users/(:any)/language',
- ],
- 'method' => 'PATCH',
- 'action' => function (string $id) {
- return $this->user($id)->changeLanguage($this->requestBody('language'));
- }
- ],
- [
- 'pattern' => [
- '(account)/name',
- 'users/(:any)/name',
- ],
- 'method' => 'PATCH',
- 'action' => function (string $id) {
- return $this->user($id)->changeName($this->requestBody('name'));
- }
- ],
- [
- 'pattern' => [
- '(account)/password',
- 'users/(:any)/password',
- ],
- 'method' => 'PATCH',
- 'action' => function (string $id) {
- return $this->user($id)->changePassword($this->requestBody('password'));
- }
- ],
- [
- 'pattern' => [
- '(account)/role',
- 'users/(:any)/role',
- ],
- 'method' => 'PATCH',
- 'action' => function (string $id) {
- return $this->user($id)->changeRole($this->requestBody('role'));
- }
- ],
- [
- 'pattern' => [
- '(account)/roles',
- 'users/(:any)/roles',
- ],
- 'action' => function (string $id) {
- return $this->user($id)->roles();
- }
- ],
- [
- 'pattern' => [
- '(account)/sections/(:any)',
- 'users/(:any)/sections/(:any)',
- ],
- 'method' => 'GET',
- 'action' => function (string $id, string $sectionName) {
- if ($section = $this->user($id)->blueprint()->section($sectionName)) {
- return $section->toResponse();
- }
- }
- ],
- [
- 'pattern' => [
- '(account)/fields/(:any)/(:all?)',
- 'users/(:any)/fields/(:any)/(:all?)',
- ],
- 'method' => 'ALL',
- 'action' => function (string $id, string $fieldName, string $path = null) {
- return $this->fieldApi($this->user($id), $fieldName, $path);
- }
- ],
+ return $this->upload(function ($source, $filename) use ($id) {
+ return $this->user($id)->createFile([
+ 'filename' => 'profile.' . F::extension($filename),
+ 'template' => 'avatar',
+ 'source' => $source
+ ]);
+ }, $single = true);
+ }
+ ],
+ // @codeCoverageIgnoreEnd
+ [
+ 'pattern' => [
+ '(account)/avatar',
+ 'users/(:any)/avatar',
+ ],
+ 'method' => 'DELETE',
+ 'action' => function (string $id) {
+ return $this->user($id)->avatar()->delete();
+ }
+ ],
+ [
+ 'pattern' => [
+ '(account)/blueprint',
+ 'users/(:any)/blueprint',
+ ],
+ 'method' => 'GET',
+ 'action' => function (string $id) {
+ return $this->user($id)->blueprint();
+ }
+ ],
+ [
+ 'pattern' => [
+ '(account)/blueprints',
+ 'users/(:any)/blueprints',
+ ],
+ 'method' => 'GET',
+ 'action' => function (string $id) {
+ return $this->user($id)->blueprints($this->requestQuery('section'));
+ }
+ ],
+ [
+ 'pattern' => [
+ '(account)/email',
+ 'users/(:any)/email',
+ ],
+ 'method' => 'PATCH',
+ 'action' => function (string $id) {
+ return $this->user($id)->changeEmail($this->requestBody('email'));
+ }
+ ],
+ [
+ 'pattern' => [
+ '(account)/language',
+ 'users/(:any)/language',
+ ],
+ 'method' => 'PATCH',
+ 'action' => function (string $id) {
+ return $this->user($id)->changeLanguage($this->requestBody('language'));
+ }
+ ],
+ [
+ 'pattern' => [
+ '(account)/name',
+ 'users/(:any)/name',
+ ],
+ 'method' => 'PATCH',
+ 'action' => function (string $id) {
+ return $this->user($id)->changeName($this->requestBody('name'));
+ }
+ ],
+ [
+ 'pattern' => [
+ '(account)/password',
+ 'users/(:any)/password',
+ ],
+ 'method' => 'PATCH',
+ 'action' => function (string $id) {
+ return $this->user($id)->changePassword($this->requestBody('password'));
+ }
+ ],
+ [
+ 'pattern' => [
+ '(account)/role',
+ 'users/(:any)/role',
+ ],
+ 'method' => 'PATCH',
+ 'action' => function (string $id) {
+ return $this->user($id)->changeRole($this->requestBody('role'));
+ }
+ ],
+ [
+ 'pattern' => [
+ '(account)/roles',
+ 'users/(:any)/roles',
+ ],
+ 'action' => function (string $id) {
+ return $this->user($id)->roles();
+ }
+ ],
+ [
+ 'pattern' => [
+ '(account)/sections/(:any)',
+ 'users/(:any)/sections/(:any)',
+ ],
+ 'method' => 'GET',
+ 'action' => function (string $id, string $sectionName) {
+ if ($section = $this->user($id)->blueprint()->section($sectionName)) {
+ return $section->toResponse();
+ }
+ }
+ ],
+ [
+ 'pattern' => [
+ '(account)/fields/(:any)/(:all?)',
+ 'users/(:any)/fields/(:any)/(:all?)',
+ ],
+ 'method' => 'ALL',
+ 'action' => function (string $id, string $fieldName, string $path = null) {
+ return $this->fieldApi($this->user($id), $fieldName, $path);
+ }
+ ],
];
diff --git a/kirby/config/areas/account.php b/kirby/config/areas/account.php
index 304aca2..738a839 100755
--- a/kirby/config/areas/account.php
+++ b/kirby/config/areas/account.php
@@ -3,12 +3,12 @@
use Kirby\Toolkit\I18n;
return function () {
- return [
- 'icon' => 'account',
- 'label' => I18n::translate('view.account'),
- 'search' => 'users',
- 'dialogs' => require __DIR__ . '/account/dialogs.php',
- 'dropdowns' => require __DIR__ . '/account/dropdowns.php',
- 'views' => require __DIR__ . '/account/views.php'
- ];
+ return [
+ 'icon' => 'account',
+ 'label' => I18n::translate('view.account'),
+ 'search' => 'users',
+ 'dialogs' => require __DIR__ . '/account/dialogs.php',
+ 'dropdowns' => require __DIR__ . '/account/dropdowns.php',
+ 'views' => require __DIR__ . '/account/views.php'
+ ];
};
diff --git a/kirby/config/areas/account/dialogs.php b/kirby/config/areas/account/dialogs.php
index 15bf7b7..7c13062 100755
--- a/kirby/config/areas/account/dialogs.php
+++ b/kirby/config/areas/account/dialogs.php
@@ -4,67 +4,67 @@ $dialogs = require __DIR__ . '/../users/dialogs.php';
return [
- // change email
- 'account.changeEmail' => [
- 'pattern' => '(account)/changeEmail',
- 'load' => $dialogs['user.changeEmail']['load'],
- 'submit' => $dialogs['user.changeEmail']['submit'],
- ],
+ // change email
+ 'account.changeEmail' => [
+ 'pattern' => '(account)/changeEmail',
+ 'load' => $dialogs['user.changeEmail']['load'],
+ 'submit' => $dialogs['user.changeEmail']['submit'],
+ ],
- // change language
- 'account.changeLanguage' => [
- 'pattern' => '(account)/changeLanguage',
- 'load' => $dialogs['user.changeLanguage']['load'],
- 'submit' => $dialogs['user.changeLanguage']['submit'],
- ],
+ // change language
+ 'account.changeLanguage' => [
+ 'pattern' => '(account)/changeLanguage',
+ 'load' => $dialogs['user.changeLanguage']['load'],
+ 'submit' => $dialogs['user.changeLanguage']['submit'],
+ ],
- // change name
- 'account.changeName' => [
- 'pattern' => '(account)/changeName',
- 'load' => $dialogs['user.changeName']['load'],
- 'submit' => $dialogs['user.changeName']['submit'],
- ],
+ // change name
+ 'account.changeName' => [
+ 'pattern' => '(account)/changeName',
+ 'load' => $dialogs['user.changeName']['load'],
+ 'submit' => $dialogs['user.changeName']['submit'],
+ ],
- // change password
- 'account.changePassword' => [
- 'pattern' => '(account)/changePassword',
- 'load' => $dialogs['user.changePassword']['load'],
- 'submit' => $dialogs['user.changePassword']['submit'],
- ],
+ // change password
+ 'account.changePassword' => [
+ 'pattern' => '(account)/changePassword',
+ 'load' => $dialogs['user.changePassword']['load'],
+ 'submit' => $dialogs['user.changePassword']['submit'],
+ ],
- // change role
- 'account.changeRole' => [
- 'pattern' => '(account)/changeRole',
- 'load' => $dialogs['user.changeRole']['load'],
- 'submit' => $dialogs['user.changeRole']['submit'],
- ],
+ // change role
+ 'account.changeRole' => [
+ 'pattern' => '(account)/changeRole',
+ 'load' => $dialogs['user.changeRole']['load'],
+ 'submit' => $dialogs['user.changeRole']['submit'],
+ ],
- // delete
- 'account.delete' => [
- 'pattern' => '(account)/delete',
- 'load' => $dialogs['user.delete']['load'],
- 'submit' => $dialogs['user.delete']['submit'],
- ],
+ // delete
+ 'account.delete' => [
+ 'pattern' => '(account)/delete',
+ 'load' => $dialogs['user.delete']['load'],
+ 'submit' => $dialogs['user.delete']['submit'],
+ ],
- // change file name
- 'account.file.changeName' => [
- 'pattern' => '(account)/files/(:any)/changeName',
- 'load' => $dialogs['user.file.changeName']['load'],
- 'submit' => $dialogs['user.file.changeName']['submit'],
- ],
+ // change file name
+ 'account.file.changeName' => [
+ 'pattern' => '(account)/files/(:any)/changeName',
+ 'load' => $dialogs['user.file.changeName']['load'],
+ 'submit' => $dialogs['user.file.changeName']['submit'],
+ ],
- // change file sort
- 'account.file.changeSort' => [
- 'pattern' => '(account)/files/(:any)/changeSort',
- 'load' => $dialogs['user.file.changeSort']['load'],
- 'submit' => $dialogs['user.file.changeSort']['submit'],
- ],
+ // change file sort
+ 'account.file.changeSort' => [
+ 'pattern' => '(account)/files/(:any)/changeSort',
+ 'load' => $dialogs['user.file.changeSort']['load'],
+ 'submit' => $dialogs['user.file.changeSort']['submit'],
+ ],
- // delete
- 'account.file.delete' => [
- 'pattern' => '(account)/files/(:any)/delete',
- 'load' => $dialogs['user.file.delete']['load'],
- 'submit' => $dialogs['user.file.delete']['submit'],
- ],
+ // delete
+ 'account.file.delete' => [
+ 'pattern' => '(account)/files/(:any)/delete',
+ 'load' => $dialogs['user.file.delete']['load'],
+ 'submit' => $dialogs['user.file.delete']['submit'],
+ ],
];
diff --git a/kirby/config/areas/account/dropdowns.php b/kirby/config/areas/account/dropdowns.php
index 9cf2bd2..d739971 100755
--- a/kirby/config/areas/account/dropdowns.php
+++ b/kirby/config/areas/account/dropdowns.php
@@ -3,12 +3,12 @@
$dropdowns = require __DIR__ . '/../users/dropdowns.php';
return [
- 'account' => [
- 'pattern' => '(account)',
- 'options' => $dropdowns['user']['options']
- ],
- 'account.file' => [
- 'pattern' => '(account)/files/(:any)',
- 'options' => $dropdowns['user.file']['options']
- ],
+ 'account' => [
+ 'pattern' => '(account)',
+ 'options' => $dropdowns['user']['options']
+ ],
+ 'account.file' => [
+ 'pattern' => '(account)/files/(:any)',
+ 'options' => $dropdowns['user.file']['options']
+ ],
];
diff --git a/kirby/config/areas/account/views.php b/kirby/config/areas/account/views.php
index e85ef77..1ecd469 100755
--- a/kirby/config/areas/account/views.php
+++ b/kirby/config/areas/account/views.php
@@ -5,31 +5,31 @@ use Kirby\Cms\Find;
use Kirby\Panel\Panel;
return [
- 'account' => [
- 'pattern' => 'account',
- 'action' => fn () => [
- 'component' => 'k-account-view',
- 'props' => App::instance()->user()->panel()->props(),
- ],
- ],
- 'account.file' => [
- 'pattern' => 'account/files/(:any)',
- 'action' => function (string $filename) {
- return Find::file('account', $filename)->panel()->view();
- }
- ],
- 'account.logout' => [
- 'pattern' => 'logout',
- 'auth' => false,
- 'action' => function () {
- if ($user = App::instance()->user()) {
- $user->logout();
- }
- Panel::go('login');
- },
- ],
- 'account.password' => [
- 'pattern' => 'reset-password',
- 'action' => fn () => ['component' => 'k-reset-password-view']
- ]
+ 'account' => [
+ 'pattern' => 'account',
+ 'action' => fn () => [
+ 'component' => 'k-account-view',
+ 'props' => App::instance()->user()->panel()->props(),
+ ],
+ ],
+ 'account.file' => [
+ 'pattern' => 'account/files/(:any)',
+ 'action' => function (string $filename) {
+ return Find::file('account', $filename)->panel()->view();
+ }
+ ],
+ 'account.logout' => [
+ 'pattern' => 'logout',
+ 'auth' => false,
+ 'action' => function () {
+ if ($user = App::instance()->user()) {
+ $user->logout();
+ }
+ Panel::go('login');
+ },
+ ],
+ 'account.password' => [
+ 'pattern' => 'reset-password',
+ 'action' => fn () => ['component' => 'k-reset-password-view']
+ ]
];
diff --git a/kirby/config/areas/files/dialogs.php b/kirby/config/areas/files/dialogs.php
index 9a37449..44625eb 100755
--- a/kirby/config/areas/files/dialogs.php
+++ b/kirby/config/areas/files/dialogs.php
@@ -14,119 +14,119 @@ use Kirby\Toolkit\I18n;
* the appropriate routes in the areas.
*/
return [
- 'changeName' => [
- 'load' => function (string $path, string $filename) {
- $file = Find::file($path, $filename);
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => [
- 'name' => [
- 'label' => I18n::translate('name'),
- 'type' => 'slug',
- 'required' => true,
- 'icon' => 'title',
- 'allow' => '@._-',
- 'after' => '.' . $file->extension(),
- 'preselect' => true
- ]
- ],
- 'submitButton' => I18n::translate('rename'),
- 'value' => [
- 'name' => $file->name(),
- ]
- ]
- ];
- },
- 'submit' => function (string $path, string $filename) {
- $file = Find::file($path, $filename);
- $renamed = $file->changeName($file->kirby()->request()->get('name'));
- $oldUrl = $file->panel()->url(true);
- $newUrl = $renamed->panel()->url(true);
- $response = [
- 'event' => 'file.changeName',
- 'dispatch' => [
- 'content/move' => [
- $oldUrl,
- $newUrl
- ]
- ],
- ];
+ 'changeName' => [
+ 'load' => function (string $path, string $filename) {
+ $file = Find::file($path, $filename);
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => [
+ 'name' => [
+ 'label' => I18n::translate('name'),
+ 'type' => 'slug',
+ 'required' => true,
+ 'icon' => 'title',
+ 'allow' => '@._-',
+ 'after' => '.' . $file->extension(),
+ 'preselect' => true
+ ]
+ ],
+ 'submitButton' => I18n::translate('rename'),
+ 'value' => [
+ 'name' => $file->name(),
+ ]
+ ]
+ ];
+ },
+ 'submit' => function (string $path, string $filename) {
+ $file = Find::file($path, $filename);
+ $renamed = $file->changeName($file->kirby()->request()->get('name'));
+ $oldUrl = $file->panel()->url(true);
+ $newUrl = $renamed->panel()->url(true);
+ $response = [
+ 'event' => 'file.changeName',
+ 'dispatch' => [
+ 'content/move' => [
+ $oldUrl,
+ $newUrl
+ ]
+ ],
+ ];
- // check for a necessary redirect after the filename has changed
- if (Panel::referrer() === $oldUrl && $oldUrl !== $newUrl) {
- $response['redirect'] = $newUrl;
- }
+ // check for a necessary redirect after the filename has changed
+ if (Panel::referrer() === $oldUrl && $oldUrl !== $newUrl) {
+ $response['redirect'] = $newUrl;
+ }
- return $response;
- }
- ],
+ return $response;
+ }
+ ],
- 'changeSort' => [
- 'load' => function (string $path, string $filename) {
- $file = Find::file($path, $filename);
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => [
- 'position' => Field::filePosition($file)
- ],
- 'submitButton' => I18n::translate('change'),
- 'value' => [
- 'position' => $file->sort()->isEmpty() ? $file->siblings(false)->count() + 1 : $file->sort()->toInt(),
- ]
- ]
- ];
- },
- 'submit' => function (string $path, string $filename) {
- $file = Find::file($path, $filename);
- $files = $file->siblings()->sorted();
- $ids = $files->keys();
- $newIndex = (int)($file->kirby()->request()->get('position')) - 1;
- $oldIndex = $files->indexOf($file);
+ 'changeSort' => [
+ 'load' => function (string $path, string $filename) {
+ $file = Find::file($path, $filename);
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => [
+ 'position' => Field::filePosition($file)
+ ],
+ 'submitButton' => I18n::translate('change'),
+ 'value' => [
+ 'position' => $file->sort()->isEmpty() ? $file->siblings(false)->count() + 1 : $file->sort()->toInt(),
+ ]
+ ]
+ ];
+ },
+ 'submit' => function (string $path, string $filename) {
+ $file = Find::file($path, $filename);
+ $files = $file->siblings()->sorted();
+ $ids = $files->keys();
+ $newIndex = (int)($file->kirby()->request()->get('position')) - 1;
+ $oldIndex = $files->indexOf($file);
- array_splice($ids, $oldIndex, 1);
- array_splice($ids, $newIndex, 0, $file->id());
+ array_splice($ids, $oldIndex, 1);
+ array_splice($ids, $newIndex, 0, $file->id());
- $files->changeSort($ids);
+ $files->changeSort($ids);
- return [
- 'event' => 'file.sort',
- ];
- }
- ],
+ return [
+ 'event' => 'file.sort',
+ ];
+ }
+ ],
- 'delete' => [
- 'load' => function (string $path, string $filename) {
- $file = Find::file($path, $filename);
- return [
- 'component' => 'k-remove-dialog',
- 'props' => [
- 'text' => I18n::template('file.delete.confirm', [
- 'filename' => Escape::html($file->filename())
- ]),
- ]
- ];
- },
- 'submit' => function (string $path, string $filename) {
- $file = Find::file($path, $filename);
- $redirect = false;
- $referrer = Panel::referrer();
- $url = $file->panel()->url(true);
+ 'delete' => [
+ 'load' => function (string $path, string $filename) {
+ $file = Find::file($path, $filename);
+ return [
+ 'component' => 'k-remove-dialog',
+ 'props' => [
+ 'text' => I18n::template('file.delete.confirm', [
+ 'filename' => Escape::html($file->filename())
+ ]),
+ ]
+ ];
+ },
+ 'submit' => function (string $path, string $filename) {
+ $file = Find::file($path, $filename);
+ $redirect = false;
+ $referrer = Panel::referrer();
+ $url = $file->panel()->url(true);
- $file->delete();
+ $file->delete();
- // redirect to the parent model URL
- // if the dialog has been opened in the file view
- if ($referrer === $url) {
- $redirect = $file->parent()->panel()->url(true);
- }
+ // redirect to the parent model URL
+ // if the dialog has been opened in the file view
+ if ($referrer === $url) {
+ $redirect = $file->parent()->panel()->url(true);
+ }
- return [
- 'event' => 'file.delete',
- 'dispatch' => ['content/remove' => [$url]],
- 'redirect' => $redirect
- ];
- }
- ],
+ return [
+ 'event' => 'file.delete',
+ 'dispatch' => ['content/remove' => [$url]],
+ 'redirect' => $redirect
+ ];
+ }
+ ],
];
diff --git a/kirby/config/areas/files/dropdowns.php b/kirby/config/areas/files/dropdowns.php
index d038294..8687a54 100755
--- a/kirby/config/areas/files/dropdowns.php
+++ b/kirby/config/areas/files/dropdowns.php
@@ -3,7 +3,7 @@
use Kirby\Cms\Find;
return [
- 'file' => function (string $parent, string $filename) {
- return Find::file($parent, $filename)->panel()->dropdown();
- }
+ 'file' => function (string $parent, string $filename) {
+ return Find::file($parent, $filename)->panel()->dropdown();
+ }
];
diff --git a/kirby/config/areas/installation.php b/kirby/config/areas/installation.php
index 1440b19..7f707cb 100755
--- a/kirby/config/areas/installation.php
+++ b/kirby/config/areas/installation.php
@@ -4,37 +4,37 @@ use Kirby\Panel\Panel;
use Kirby\Toolkit\I18n;
return function ($kirby) {
- return [
- 'icon' => 'settings',
- 'label' => I18n::translate('view.installation'),
- 'views' => [
- 'installation' => [
- 'pattern' => 'installation',
- 'auth' => false,
- 'action' => function () use ($kirby) {
- $system = $kirby->system();
- return [
- 'component' => 'k-installation-view',
- 'props' => [
- 'isInstallable' => $system->isInstallable(),
- 'isInstalled' => $system->isInstalled(),
- 'isOk' => $system->isOk(),
- 'requirements' => $system->status(),
- 'translations' => $kirby->translations()->values(function ($translation) {
- return [
- 'text' => $translation->name(),
- 'value' => $translation->code(),
- ];
- }),
- ]
- ];
- }
- ],
- 'installation.fallback' => [
- 'pattern' => '(:all)',
- 'auth' => false,
- 'action' => fn () => Panel::go('installation')
- ]
- ]
- ];
+ return [
+ 'icon' => 'settings',
+ 'label' => I18n::translate('view.installation'),
+ 'views' => [
+ 'installation' => [
+ 'pattern' => 'installation',
+ 'auth' => false,
+ 'action' => function () use ($kirby) {
+ $system = $kirby->system();
+ return [
+ 'component' => 'k-installation-view',
+ 'props' => [
+ 'isInstallable' => $system->isInstallable(),
+ 'isInstalled' => $system->isInstalled(),
+ 'isOk' => $system->isOk(),
+ 'requirements' => $system->status(),
+ 'translations' => $kirby->translations()->values(function ($translation) {
+ return [
+ 'text' => $translation->name(),
+ 'value' => $translation->code(),
+ ];
+ }),
+ ]
+ ];
+ }
+ ],
+ 'installation.fallback' => [
+ 'pattern' => '(:all)',
+ 'auth' => false,
+ 'action' => fn () => Panel::go('installation')
+ ]
+ ]
+ ];
};
diff --git a/kirby/config/areas/languages.php b/kirby/config/areas/languages.php
index a454043..d464c58 100755
--- a/kirby/config/areas/languages.php
+++ b/kirby/config/areas/languages.php
@@ -3,11 +3,11 @@
use Kirby\Toolkit\I18n;
return function ($kirby) {
- return [
- 'icon' => 'globe',
- 'label' => I18n::translate('view.languages'),
- 'menu' => true,
- 'dialogs' => require __DIR__ . '/languages/dialogs.php',
- 'views' => require __DIR__ . '/languages/views.php'
- ];
+ return [
+ 'icon' => 'globe',
+ 'label' => I18n::translate('view.languages'),
+ 'menu' => true,
+ 'dialogs' => require __DIR__ . '/languages/dialogs.php',
+ 'views' => require __DIR__ . '/languages/views.php'
+ ];
};
diff --git a/kirby/config/areas/languages/dialogs.php b/kirby/config/areas/languages/dialogs.php
index ad927f7..a38b148 100755
--- a/kirby/config/areas/languages/dialogs.php
+++ b/kirby/config/areas/languages/dialogs.php
@@ -8,148 +8,148 @@ use Kirby\Toolkit\Escape;
use Kirby\Toolkit\I18n;
$languageDialogFields = [
- 'name' => [
- 'label' => I18n::translate('language.name'),
- 'type' => 'text',
- 'required' => true,
- 'icon' => 'title'
- ],
- 'code' => [
- 'label' => I18n::translate('language.code'),
- 'type' => 'text',
- 'required' => true,
- 'counter' => false,
- 'icon' => 'globe',
- 'width' => '1/2'
- ],
- 'direction' => [
- 'label' => I18n::translate('language.direction'),
- 'type' => 'select',
- 'required' => true,
- 'empty' => false,
- 'options' => [
- ['value' => 'ltr', 'text' => I18n::translate('language.direction.ltr')],
- ['value' => 'rtl', 'text' => I18n::translate('language.direction.rtl')]
- ],
- 'width' => '1/2'
- ],
- 'locale' => [
- 'label' => I18n::translate('language.locale'),
- 'type' => 'text',
- ],
+ 'name' => [
+ 'label' => I18n::translate('language.name'),
+ 'type' => 'text',
+ 'required' => true,
+ 'icon' => 'title'
+ ],
+ 'code' => [
+ 'label' => I18n::translate('language.code'),
+ 'type' => 'text',
+ 'required' => true,
+ 'counter' => false,
+ 'icon' => 'globe',
+ 'width' => '1/2'
+ ],
+ 'direction' => [
+ 'label' => I18n::translate('language.direction'),
+ 'type' => 'select',
+ 'required' => true,
+ 'empty' => false,
+ 'options' => [
+ ['value' => 'ltr', 'text' => I18n::translate('language.direction.ltr')],
+ ['value' => 'rtl', 'text' => I18n::translate('language.direction.rtl')]
+ ],
+ 'width' => '1/2'
+ ],
+ 'locale' => [
+ 'label' => I18n::translate('language.locale'),
+ 'type' => 'text',
+ ],
];
return [
- // create language
- 'language.create' => [
- 'pattern' => 'languages/create',
- 'load' => function () use ($languageDialogFields) {
- return [
- 'component' => 'k-language-dialog',
- 'props' => [
- 'fields' => $languageDialogFields,
- 'submitButton' => I18n::translate('language.create'),
- 'value' => [
- 'code' => '',
- 'direction' => 'ltr',
- 'locale' => '',
- 'name' => '',
- ]
- ]
- ];
- },
- 'submit' => function () {
- $kirby = App::instance();
+ // create language
+ 'language.create' => [
+ 'pattern' => 'languages/create',
+ 'load' => function () use ($languageDialogFields) {
+ return [
+ 'component' => 'k-language-dialog',
+ 'props' => [
+ 'fields' => $languageDialogFields,
+ 'submitButton' => I18n::translate('language.create'),
+ 'value' => [
+ 'code' => '',
+ 'direction' => 'ltr',
+ 'locale' => '',
+ 'name' => '',
+ ]
+ ]
+ ];
+ },
+ 'submit' => function () {
+ $kirby = App::instance();
- $data = $kirby->request()->get([
- 'code',
- 'direction',
- 'locale',
- 'name'
- ]);
- $kirby->languages()->create($data);
+ $data = $kirby->request()->get([
+ 'code',
+ 'direction',
+ 'locale',
+ 'name'
+ ]);
+ $kirby->languages()->create($data);
- return [
- 'event' => 'language.create'
- ];
- }
- ],
+ return [
+ 'event' => 'language.create'
+ ];
+ }
+ ],
- // delete language
- 'language.delete' => [
- 'pattern' => 'languages/(:any)/delete',
- 'load' => function (string $id) {
- $language = Find::language($id);
- return [
- 'component' => 'k-remove-dialog',
- 'props' => [
- 'text' => I18n::template('language.delete.confirm', [
- 'name' => Escape::html($language->name())
- ])
- ]
- ];
- },
- 'submit' => function (string $id) {
- Find::language($id)->delete();
- return [
- 'event' => 'language.delete',
- ];
- }
- ],
+ // delete language
+ 'language.delete' => [
+ 'pattern' => 'languages/(:any)/delete',
+ 'load' => function (string $id) {
+ $language = Find::language($id);
+ return [
+ 'component' => 'k-remove-dialog',
+ 'props' => [
+ 'text' => I18n::template('language.delete.confirm', [
+ 'name' => Escape::html($language->name())
+ ])
+ ]
+ ];
+ },
+ 'submit' => function (string $id) {
+ Find::language($id)->delete();
+ return [
+ 'event' => 'language.delete',
+ ];
+ }
+ ],
- // update language
- 'language.update' => [
- 'pattern' => 'languages/(:any)/update',
- 'load' => function (string $id) use ($languageDialogFields) {
- $language = Find::language($id);
- $fields = $languageDialogFields;
- $locale = $language->locale();
+ // update language
+ 'language.update' => [
+ 'pattern' => 'languages/(:any)/update',
+ 'load' => function (string $id) use ($languageDialogFields) {
+ $language = Find::language($id);
+ $fields = $languageDialogFields;
+ $locale = $language->locale();
- // use the first locale key if there's only one
- if (count($locale) === 1) {
- $locale = A::first($locale);
- }
+ // use the first locale key if there's only one
+ if (count($locale) === 1) {
+ $locale = A::first($locale);
+ }
- // the code of an existing language cannot be changed
- $fields['code']['disabled'] = true;
+ // the code of an existing language cannot be changed
+ $fields['code']['disabled'] = true;
- // if the locale settings is more complex than just a
- // single string, the text field won't do it anymore.
- // Changes can only be made in the language file and
- // we display a warning box instead.
- if (is_array($locale) === true) {
- $fields['locale'] = [
- 'label' => $fields['locale']['label'],
- 'type' => 'info',
- 'text' => I18n::translate('language.locale.warning')
- ];
- }
+ // if the locale settings is more complex than just a
+ // single string, the text field won't do it anymore.
+ // Changes can only be made in the language file and
+ // we display a warning box instead.
+ if (is_array($locale) === true) {
+ $fields['locale'] = [
+ 'label' => $fields['locale']['label'],
+ 'type' => 'info',
+ 'text' => I18n::translate('language.locale.warning')
+ ];
+ }
- return [
- 'component' => 'k-language-dialog',
- 'props' => [
- 'fields' => $fields,
- 'submitButton' => I18n::translate('save'),
- 'value' => [
- 'code' => $language->code(),
- 'direction' => $language->direction(),
- 'locale' => $locale,
- 'name' => $language->name(),
- 'rules' => $language->rules(),
- ]
- ]
- ];
- },
- 'submit' => function (string $id) {
- $kirby = App::instance();
+ return [
+ 'component' => 'k-language-dialog',
+ 'props' => [
+ 'fields' => $fields,
+ 'submitButton' => I18n::translate('save'),
+ 'value' => [
+ 'code' => $language->code(),
+ 'direction' => $language->direction(),
+ 'locale' => $locale,
+ 'name' => $language->name(),
+ 'rules' => $language->rules(),
+ ]
+ ]
+ ];
+ },
+ 'submit' => function (string $id) {
+ $kirby = App::instance();
- $data = $kirby->request()->get(['direction', 'locale', 'name']);
- $language = Find::language($id)->update($data);
+ $data = $kirby->request()->get(['direction', 'locale', 'name']);
+ $language = Find::language($id)->update($data);
- return [
- 'event' => 'language.update'
- ];
- }
- ],
+ return [
+ 'event' => 'language.update'
+ ];
+ }
+ ],
];
diff --git a/kirby/config/areas/languages/views.php b/kirby/config/areas/languages/views.php
index d824ebf..0eee9da 100755
--- a/kirby/config/areas/languages/views.php
+++ b/kirby/config/areas/languages/views.php
@@ -4,22 +4,22 @@ use Kirby\Cms\App;
use Kirby\Toolkit\Escape;
return [
- 'languages' => [
- 'pattern' => 'languages',
- 'action' => function () {
- $kirby = App::instance();
+ 'languages' => [
+ 'pattern' => 'languages',
+ 'action' => function () {
+ $kirby = App::instance();
- return [
- 'component' => 'k-languages-view',
- 'props' => [
- 'languages' => $kirby->languages()->values(fn ($language) => [
- 'default' => $language->isDefault(),
- 'id' => $language->code(),
- 'info' => Escape::html($language->code()),
- 'text' => Escape::html($language->name()),
- ])
- ]
- ];
- }
- ],
+ return [
+ 'component' => 'k-languages-view',
+ 'props' => [
+ 'languages' => $kirby->languages()->values(fn ($language) => [
+ 'default' => $language->isDefault(),
+ 'id' => $language->code(),
+ 'info' => Escape::html($language->code()),
+ 'text' => Escape::html($language->name()),
+ ])
+ ]
+ ];
+ }
+ ],
];
diff --git a/kirby/config/areas/login.php b/kirby/config/areas/login.php
index 590a7c4..56f30cb 100755
--- a/kirby/config/areas/login.php
+++ b/kirby/config/areas/login.php
@@ -4,41 +4,41 @@ use Kirby\Panel\Panel;
use Kirby\Toolkit\I18n;
return function ($kirby) {
- return [
- 'icon' => 'user',
- 'label' => I18n::translate('login'),
- 'views' => [
- 'login' => [
- 'pattern' => 'login',
- 'auth' => false,
- 'action' => function () use ($kirby) {
- $system = $kirby->system();
- $status = $kirby->auth()->status();
- return [
- 'component' => 'k-login-view',
- 'props' => [
- 'methods' => array_keys($system->loginMethods()),
- 'pending' => [
- 'email' => $status->email(),
- 'challenge' => $status->challenge()
- ]
- ],
- ];
- }
- ],
- 'login.fallback' => [
- 'pattern' => '(:all)',
- 'auth' => false,
- 'action' => function ($path) use ($kirby) {
- /**
- * Store the current path in the session
- * Once the user is logged in, the path will
- * be used to redirect to that view again
- */
- $kirby->session()->set('panel.path', $path);
- Panel::go('login');
- }
- ]
- ]
- ];
+ return [
+ 'icon' => 'user',
+ 'label' => I18n::translate('login'),
+ 'views' => [
+ 'login' => [
+ 'pattern' => 'login',
+ 'auth' => false,
+ 'action' => function () use ($kirby) {
+ $system = $kirby->system();
+ $status = $kirby->auth()->status();
+ return [
+ 'component' => 'k-login-view',
+ 'props' => [
+ 'methods' => array_keys($system->loginMethods()),
+ 'pending' => [
+ 'email' => $status->email(),
+ 'challenge' => $status->challenge()
+ ]
+ ],
+ ];
+ }
+ ],
+ 'login.fallback' => [
+ 'pattern' => '(:all)',
+ 'auth' => false,
+ 'action' => function ($path) use ($kirby) {
+ /**
+ * Store the current path in the session
+ * Once the user is logged in, the path will
+ * be used to redirect to that view again
+ */
+ $kirby->session()->set('panel.path', $path);
+ Panel::go('login');
+ }
+ ]
+ ]
+ ];
};
diff --git a/kirby/config/areas/site.php b/kirby/config/areas/site.php
index a246f7e..3f082be 100755
--- a/kirby/config/areas/site.php
+++ b/kirby/config/areas/site.php
@@ -3,16 +3,16 @@
use Kirby\Toolkit\I18n;
return function ($kirby) {
- return [
- 'breadcrumbLabel' => function () use ($kirby) {
- return $kirby->site()->title()->or(I18n::translate('view.site'))->toString();
- },
- 'icon' => 'home',
- 'label' => $kirby->site()->blueprint()->title() ?? I18n::translate('view.site'),
- 'menu' => true,
- 'dialogs' => require __DIR__ . '/site/dialogs.php',
- 'dropdowns' => require __DIR__ . '/site/dropdowns.php',
- 'searches' => require __DIR__ . '/site/searches.php',
- 'views' => require __DIR__ . '/site/views.php',
- ];
+ return [
+ 'breadcrumbLabel' => function () use ($kirby) {
+ return $kirby->site()->title()->or(I18n::translate('view.site'))->toString();
+ },
+ 'icon' => 'home',
+ 'label' => $kirby->site()->blueprint()->title() ?? I18n::translate('view.site'),
+ 'menu' => true,
+ 'dialogs' => require __DIR__ . '/site/dialogs.php',
+ 'dropdowns' => require __DIR__ . '/site/dropdowns.php',
+ 'searches' => require __DIR__ . '/site/searches.php',
+ 'views' => require __DIR__ . '/site/views.php',
+ ];
};
diff --git a/kirby/config/areas/site/dialogs.php b/kirby/config/areas/site/dialogs.php
index a8632b9..3101464 100755
--- a/kirby/config/areas/site/dialogs.php
+++ b/kirby/config/areas/site/dialogs.php
@@ -14,571 +14,571 @@ $files = require __DIR__ . '/../files/dialogs.php';
return [
- // change page position
- 'page.changeSort' => [
- 'pattern' => 'pages/(:any)/changeSort',
- 'load' => function (string $id) {
- $page = Find::page($id);
-
- if ($page->blueprint()->num() !== 'default') {
- throw new PermissionException([
- 'key' => 'page.sort.permission',
- 'data' => [
- 'slug' => $page->slug()
- ]
- ]);
- }
-
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => [
- 'position' => Field::pagePosition($page),
- ],
- 'submitButton' => I18n::translate('change'),
- 'value' => [
- 'position' => $page->panel()->position()
- ]
- ]
- ];
- },
- 'submit' => function (string $id) {
- $request = App::instance()->request();
-
- Find::page($id)->changeStatus(
- 'listed',
- $request->get('position')
- );
-
- return [
- 'event' => 'page.sort',
- ];
- }
- ],
-
- // change page status
- 'page.changeStatus' => [
- 'pattern' => 'pages/(:any)/changeStatus',
- 'load' => function (string $id) {
- $page = Find::page($id);
- $blueprint = $page->blueprint();
- $status = $page->status();
- $states = [];
- $position = null;
-
- foreach ($blueprint->status() as $key => $state) {
- $states[] = [
- 'value' => $key,
- 'text' => $state['label'],
- 'info' => $state['text'],
- ];
- }
-
- if ($status === 'draft') {
- $errors = $page->errors();
-
- // switch to the error dialog if there are
- // errors and the draft cannot be published
- if (count($errors) > 0) {
- return [
- 'component' => 'k-error-dialog',
- 'props' => [
- 'message' => I18n::translate('error.page.changeStatus.incomplete'),
- 'details' => $errors,
- ]
- ];
- }
- }
-
- $fields = [
- 'status' => [
- 'label' => I18n::translate('page.changeStatus.select'),
- 'type' => 'radio',
- 'required' => true,
- 'options' => $states
- ]
- ];
-
- if ($blueprint->num() === 'default') {
- $fields['position'] = Field::pagePosition($page, [
- 'when' => [
- 'status' => 'listed'
- ]
- ]);
-
- $position = $page->panel()->position();
- }
-
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => $fields,
- 'submitButton' => I18n::translate('change'),
- 'value' => [
- 'status' => $status,
- 'position' => $position
- ]
- ]
- ];
- },
- 'submit' => function (string $id) {
- $request = App::instance()->request();
-
- Find::page($id)->changeStatus(
- $request->get('status'),
- $request->get('position')
- );
-
- return [
- 'event' => 'page.changeStatus',
- ];
- }
- ],
-
- // change template
- 'page.changeTemplate' => [
- 'pattern' => 'pages/(:any)/changeTemplate',
- 'load' => function (string $id) {
- $page = Find::page($id);
- $blueprints = $page->blueprints();
-
- if (count($blueprints) <= 1) {
- throw new Exception([
- 'key' => 'page.changeTemplate.invalid',
- 'data' => [
- 'slug' => $id
- ]
- ]);
- }
-
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => [
- 'template' => Field::template($blueprints, [
- 'required' => true
- ])
- ],
- 'submitButton' => I18n::translate('change'),
- 'value' => [
- 'template' => $page->intendedTemplate()->name()
- ]
- ]
- ];
- },
- 'submit' => function (string $id) {
- $request = App::instance()->request();
-
- Find::page($id)->changeTemplate($request->get('template'));
-
- return [
- 'event' => 'page.changeTemplate',
- ];
- }
- ],
-
- // change title
- 'page.changeTitle' => [
- 'pattern' => 'pages/(:any)/changeTitle',
- 'load' => function (string $id) {
- $request = App::instance()->request();
-
- $page = Find::page($id);
- $permissions = $page->permissions();
- $select = $request->get('select', 'title');
-
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => [
- 'title' => Field::title([
- 'required' => true,
- 'preselect' => $select === 'title',
- 'disabled' => $permissions->can('changeTitle') === false
- ]),
- 'slug' => Field::slug([
- 'required' => true,
- 'preselect' => $select === 'slug',
- 'path' => $page->parent() ? '/' . $page->parent()->id() . '/' : '/',
- 'disabled' => $permissions->can('changeSlug') === false,
- 'wizard' => [
- 'text' => I18n::translate('page.changeSlug.fromTitle'),
- 'field' => 'title'
- ]
- ])
- ],
- 'autofocus' => false,
- 'submitButton' => I18n::translate('change'),
- 'value' => [
- 'title' => $page->title()->value(),
- 'slug' => $page->slug(),
- ]
- ]
- ];
- },
- 'submit' => function (string $id) {
- $request = App::instance()->request();
-
- $page = Find::page($id);
- $title = trim($request->get('title', ''));
- $slug = trim($request->get('slug', ''));
-
- // basic input validation before we move on
- if (Str::length($title) === 0) {
- throw new InvalidArgumentException([
- 'key' => 'page.changeTitle.empty'
- ]);
- }
-
- if (Str::length($slug) === 0) {
- throw new InvalidArgumentException([
- 'key' => 'page.slug.invalid'
- ]);
- }
-
- // nothing changed
- if ($page->title()->value() === $title && $page->slug() === $slug) {
- return true;
- }
-
- // prepare the response
- $response = [
- 'event' => []
- ];
-
- // the page title changed
- if ($page->title()->value() !== $title) {
- $page->changeTitle($title);
- $response['event'][] = 'page.changeTitle';
- }
-
- // the slug changed
- if ($page->slug() !== $slug) {
- $newPage = $page->changeSlug($slug);
- $response['event'][] = 'page.changeSlug';
- $response['dispatch'] = [
- 'content/move' => [
- $oldUrl = $page->panel()->url(true),
- $newUrl = $newPage->panel()->url(true)
- ]
- ];
-
- // check for a necessary redirect after the slug has changed
- if (Panel::referrer() === $oldUrl && $oldUrl !== $newUrl) {
- $response['redirect'] = $newUrl;
- }
- }
-
- return $response;
- }
- ],
-
- // create a new page
- 'page.create' => [
- 'pattern' => 'pages/create',
- 'load' => function () {
- $kirby = App::instance();
- $request = $kirby->request();
-
- // the parent model for the new page
- $parent = $request->get('parent', 'site');
-
- // the view on which the add button is located
- // this is important to find the right section
- // and provide the correct templates for the new page
- $view = $request->get('view', $parent);
-
- // templates will be fetched depending on the
- // section settings in the blueprint
- $section = $request->get('section');
-
- // this is the parent model
- $model = Find::parent($parent);
-
- // this is the view model
- // i.e. site if the add button is on
- // the dashboard
- $view = Find::parent($view);
-
- // available blueprints/templates for the new page
- // are always loaded depending on the matching section
- // in the view model blueprint
- $blueprints = $view->blueprints($section);
-
- // the pre-selected template
- $template = $blueprints[0]['name'] ?? $blueprints[0]['value'] ?? null;
-
- $fields = [
- 'parent' => Field::hidden(),
- 'title' => Field::title([
- 'required' => true,
- 'preselect' => true
- ]),
- 'slug' => Field::slug([
- 'required' => true,
- 'sync' => 'title',
- 'path' => empty($model->id()) === false ? '/' . $model->id() . '/' : '/'
- ]),
- 'template' => Field::hidden()
- ];
-
- // only show template field if > 1 templates available
- // or when in debug mode
- if (count($blueprints) > 1 || $kirby->option('debug') === true) {
- $fields['template'] = Field::template($blueprints, [
- 'required' => true
- ]);
- }
-
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => $fields,
- 'submitButton' => I18n::translate('page.draft.create'),
- 'value' => [
- 'parent' => $parent,
- 'slug' => '',
- 'template' => $template,
- 'title' => '',
- ]
- ]
- ];
- },
- 'submit' => function () {
- $request = App::instance()->request();
- $title = trim($request->get('title', ''));
-
- if (Str::length($title) === 0) {
- throw new InvalidArgumentException([
- 'key' => 'page.changeTitle.empty'
- ]);
- }
-
- $page = Find::parent($request->get('parent', 'site'))->createChild([
- 'content' => ['title' => $title],
- 'slug' => $request->get('slug'),
- 'template' => $request->get('template'),
- ]);
-
- return [
- 'event' => 'page.create',
- 'redirect' => $page->panel()->url(true)
- ];
- }
- ],
-
- // delete page
- 'page.delete' => [
- 'pattern' => 'pages/(:any)/delete',
- 'load' => function (string $id) {
- $page = Find::page($id);
- $text = I18n::template('page.delete.confirm', [
- 'title' => Escape::html($page->title()->value())
- ]);
-
- if ($page->childrenAndDrafts()->count() > 0) {
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => [
- 'info' => [
- 'type' => 'info',
- 'theme' => 'negative',
- 'text' => I18n::translate('page.delete.confirm.subpages')
- ],
- 'check' => [
- 'label' => I18n::translate('page.delete.confirm.title'),
- 'type' => 'text',
- 'counter' => false
- ]
- ],
- 'size' => 'medium',
- 'submitButton' => I18n::translate('delete'),
- 'text' => $text,
- 'theme' => 'negative',
- ]
- ];
- }
-
- return [
- 'component' => 'k-remove-dialog',
- 'props' => [
- 'text' => $text
- ]
- ];
- },
- 'submit' => function (string $id) {
- $request = App::instance()->request();
-
- $page = Find::page($id);
- $redirect = false;
- $referrer = Panel::referrer();
- $url = $page->panel()->url(true);
-
- if (
- $page->childrenAndDrafts()->count() > 0 &&
- $request->get('check') !== $page->title()->value()
- ) {
- throw new InvalidArgumentException(['key' => 'page.delete.confirm']);
- }
-
- $page->delete(true);
-
- // redirect to the parent model URL
- // if the dialog has been opened in the page view
- if ($referrer === $url) {
- $redirect = $page->parentModel()->panel()->url(true);
- }
-
- return [
- 'event' => 'page.delete',
- 'dispatch' => ['content/remove' => [$url]],
- 'redirect' => $redirect
- ];
- }
- ],
-
- // duplicate page
- 'page.duplicate' => [
- 'pattern' => 'pages/(:any)/duplicate',
- 'load' => function (string $id) {
- $page = Find::page($id);
- $hasChildren = $page->hasChildren();
- $hasFiles = $page->hasFiles();
- $toggleWidth = '1/' . count(array_filter([$hasChildren, $hasFiles]));
-
- $fields = [
- 'title' => Field::title([
- 'required' => true
- ]),
- 'slug' => Field::slug([
- 'required' => true,
- 'path' => $page->parent() ? '/' . $page->parent()->id() . '/' : '/',
- 'wizard' => [
- 'text' => I18n::translate('page.changeSlug.fromTitle'),
- 'field' => 'title'
- ]
- ])
- ];
-
- if ($hasFiles === true) {
- $fields['files'] = [
- 'label' => I18n::translate('page.duplicate.files'),
- 'type' => 'toggle',
- 'required' => true,
- 'width' => $toggleWidth
- ];
- }
-
- if ($hasChildren === true) {
- $fields['children'] = [
- 'label' => I18n::translate('page.duplicate.pages'),
- 'type' => 'toggle',
- 'required' => true,
- 'width' => $toggleWidth
- ];
- }
-
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => $fields,
- 'submitButton' => I18n::translate('duplicate'),
- 'value' => [
- 'children' => false,
- 'files' => false,
- 'slug' => $page->slug() . '-' . Str::slug(I18n::translate('page.duplicate.appendix')),
- 'title' => $page->title() . ' ' . I18n::translate('page.duplicate.appendix')
- ]
- ]
- ];
- },
- 'submit' => function (string $id) {
- $request = App::instance()->request();
-
- $newPage = Find::page($id)->duplicate($request->get('slug'), [
- 'children' => (bool)$request->get('children'),
- 'files' => (bool)$request->get('files'),
- 'title' => (string)$request->get('title'),
- ]);
-
- return [
- 'event' => 'page.duplicate',
- 'redirect' => $newPage->panel()->url(true)
- ];
- }
- ],
-
- // change filename
- 'page.file.changeName' => [
- 'pattern' => '(pages/.*?)/files/(:any)/changeName',
- 'load' => $files['changeName']['load'],
- 'submit' => $files['changeName']['submit'],
- ],
-
- // change sort
- 'page.file.changeSort' => [
- 'pattern' => '(pages/.*?)/files/(:any)/changeSort',
- 'load' => $files['changeSort']['load'],
- 'submit' => $files['changeSort']['submit'],
- ],
-
- // delete
- 'page.file.delete' => [
- 'pattern' => '(pages/.*?)/files/(:any)/delete',
- 'load' => $files['delete']['load'],
- 'submit' => $files['delete']['submit'],
- ],
-
- // change site title
- 'site.changeTitle' => [
- 'pattern' => 'site/changeTitle',
- 'load' => function () {
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => [
- 'title' => Field::title([
- 'required' => true,
- 'preselect' => true
- ])
- ],
- 'submitButton' => I18n::translate('rename'),
- 'value' => [
- 'title' => App::instance()->site()->title()->value()
- ]
- ]
- ];
- },
- 'submit' => function () {
- $kirby = App::instance();
-
- $kirby->site()->changeTitle($kirby->request()->get('title'));
- return [
- 'event' => 'site.changeTitle',
- ];
- }
- ],
-
- // change filename
- 'site.file.changeName' => [
- 'pattern' => '(site)/files/(:any)/changeName',
- 'load' => $files['changeName']['load'],
- 'submit' => $files['changeName']['submit'],
- ],
-
- // change sort
- 'site.file.changeSort' => [
- 'pattern' => '(site)/files/(:any)/changeSort',
- 'load' => $files['changeSort']['load'],
- 'submit' => $files['changeSort']['submit'],
- ],
-
- // delete
- 'site.file.delete' => [
- 'pattern' => '(site)/files/(:any)/delete',
- 'load' => $files['delete']['load'],
- 'submit' => $files['delete']['submit'],
- ],
+ // change page position
+ 'page.changeSort' => [
+ 'pattern' => 'pages/(:any)/changeSort',
+ 'load' => function (string $id) {
+ $page = Find::page($id);
+
+ if ($page->blueprint()->num() !== 'default') {
+ throw new PermissionException([
+ 'key' => 'page.sort.permission',
+ 'data' => [
+ 'slug' => $page->slug()
+ ]
+ ]);
+ }
+
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => [
+ 'position' => Field::pagePosition($page),
+ ],
+ 'submitButton' => I18n::translate('change'),
+ 'value' => [
+ 'position' => $page->panel()->position()
+ ]
+ ]
+ ];
+ },
+ 'submit' => function (string $id) {
+ $request = App::instance()->request();
+
+ Find::page($id)->changeStatus(
+ 'listed',
+ $request->get('position')
+ );
+
+ return [
+ 'event' => 'page.sort',
+ ];
+ }
+ ],
+
+ // change page status
+ 'page.changeStatus' => [
+ 'pattern' => 'pages/(:any)/changeStatus',
+ 'load' => function (string $id) {
+ $page = Find::page($id);
+ $blueprint = $page->blueprint();
+ $status = $page->status();
+ $states = [];
+ $position = null;
+
+ foreach ($blueprint->status() as $key => $state) {
+ $states[] = [
+ 'value' => $key,
+ 'text' => $state['label'],
+ 'info' => $state['text'],
+ ];
+ }
+
+ if ($status === 'draft') {
+ $errors = $page->errors();
+
+ // switch to the error dialog if there are
+ // errors and the draft cannot be published
+ if (count($errors) > 0) {
+ return [
+ 'component' => 'k-error-dialog',
+ 'props' => [
+ 'message' => I18n::translate('error.page.changeStatus.incomplete'),
+ 'details' => $errors,
+ ]
+ ];
+ }
+ }
+
+ $fields = [
+ 'status' => [
+ 'label' => I18n::translate('page.changeStatus.select'),
+ 'type' => 'radio',
+ 'required' => true,
+ 'options' => $states
+ ]
+ ];
+
+ if ($blueprint->num() === 'default') {
+ $fields['position'] = Field::pagePosition($page, [
+ 'when' => [
+ 'status' => 'listed'
+ ]
+ ]);
+
+ $position = $page->panel()->position();
+ }
+
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => $fields,
+ 'submitButton' => I18n::translate('change'),
+ 'value' => [
+ 'status' => $status,
+ 'position' => $position
+ ]
+ ]
+ ];
+ },
+ 'submit' => function (string $id) {
+ $request = App::instance()->request();
+
+ Find::page($id)->changeStatus(
+ $request->get('status'),
+ $request->get('position')
+ );
+
+ return [
+ 'event' => 'page.changeStatus',
+ ];
+ }
+ ],
+
+ // change template
+ 'page.changeTemplate' => [
+ 'pattern' => 'pages/(:any)/changeTemplate',
+ 'load' => function (string $id) {
+ $page = Find::page($id);
+ $blueprints = $page->blueprints();
+
+ if (count($blueprints) <= 1) {
+ throw new Exception([
+ 'key' => 'page.changeTemplate.invalid',
+ 'data' => [
+ 'slug' => $id
+ ]
+ ]);
+ }
+
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => [
+ 'template' => Field::template($blueprints, [
+ 'required' => true
+ ])
+ ],
+ 'submitButton' => I18n::translate('change'),
+ 'value' => [
+ 'template' => $page->intendedTemplate()->name()
+ ]
+ ]
+ ];
+ },
+ 'submit' => function (string $id) {
+ $request = App::instance()->request();
+
+ Find::page($id)->changeTemplate($request->get('template'));
+
+ return [
+ 'event' => 'page.changeTemplate',
+ ];
+ }
+ ],
+
+ // change title
+ 'page.changeTitle' => [
+ 'pattern' => 'pages/(:any)/changeTitle',
+ 'load' => function (string $id) {
+ $request = App::instance()->request();
+
+ $page = Find::page($id);
+ $permissions = $page->permissions();
+ $select = $request->get('select', 'title');
+
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => [
+ 'title' => Field::title([
+ 'required' => true,
+ 'preselect' => $select === 'title',
+ 'disabled' => $permissions->can('changeTitle') === false
+ ]),
+ 'slug' => Field::slug([
+ 'required' => true,
+ 'preselect' => $select === 'slug',
+ 'path' => $page->parent() ? '/' . $page->parent()->id() . '/' : '/',
+ 'disabled' => $permissions->can('changeSlug') === false,
+ 'wizard' => [
+ 'text' => I18n::translate('page.changeSlug.fromTitle'),
+ 'field' => 'title'
+ ]
+ ])
+ ],
+ 'autofocus' => false,
+ 'submitButton' => I18n::translate('change'),
+ 'value' => [
+ 'title' => $page->title()->value(),
+ 'slug' => $page->slug(),
+ ]
+ ]
+ ];
+ },
+ 'submit' => function (string $id) {
+ $request = App::instance()->request();
+
+ $page = Find::page($id);
+ $title = trim($request->get('title', ''));
+ $slug = trim($request->get('slug', ''));
+
+ // basic input validation before we move on
+ if (Str::length($title) === 0) {
+ throw new InvalidArgumentException([
+ 'key' => 'page.changeTitle.empty'
+ ]);
+ }
+
+ if (Str::length($slug) === 0) {
+ throw new InvalidArgumentException([
+ 'key' => 'page.slug.invalid'
+ ]);
+ }
+
+ // nothing changed
+ if ($page->title()->value() === $title && $page->slug() === $slug) {
+ return true;
+ }
+
+ // prepare the response
+ $response = [
+ 'event' => []
+ ];
+
+ // the page title changed
+ if ($page->title()->value() !== $title) {
+ $page->changeTitle($title);
+ $response['event'][] = 'page.changeTitle';
+ }
+
+ // the slug changed
+ if ($page->slug() !== $slug) {
+ $newPage = $page->changeSlug($slug);
+ $response['event'][] = 'page.changeSlug';
+ $response['dispatch'] = [
+ 'content/move' => [
+ $oldUrl = $page->panel()->url(true),
+ $newUrl = $newPage->panel()->url(true)
+ ]
+ ];
+
+ // check for a necessary redirect after the slug has changed
+ if (Panel::referrer() === $oldUrl && $oldUrl !== $newUrl) {
+ $response['redirect'] = $newUrl;
+ }
+ }
+
+ return $response;
+ }
+ ],
+
+ // create a new page
+ 'page.create' => [
+ 'pattern' => 'pages/create',
+ 'load' => function () {
+ $kirby = App::instance();
+ $request = $kirby->request();
+
+ // the parent model for the new page
+ $parent = $request->get('parent', 'site');
+
+ // the view on which the add button is located
+ // this is important to find the right section
+ // and provide the correct templates for the new page
+ $view = $request->get('view', $parent);
+
+ // templates will be fetched depending on the
+ // section settings in the blueprint
+ $section = $request->get('section');
+
+ // this is the parent model
+ $model = Find::parent($parent);
+
+ // this is the view model
+ // i.e. site if the add button is on
+ // the dashboard
+ $view = Find::parent($view);
+
+ // available blueprints/templates for the new page
+ // are always loaded depending on the matching section
+ // in the view model blueprint
+ $blueprints = $view->blueprints($section);
+
+ // the pre-selected template
+ $template = $blueprints[0]['name'] ?? $blueprints[0]['value'] ?? null;
+
+ $fields = [
+ 'parent' => Field::hidden(),
+ 'title' => Field::title([
+ 'required' => true,
+ 'preselect' => true
+ ]),
+ 'slug' => Field::slug([
+ 'required' => true,
+ 'sync' => 'title',
+ 'path' => empty($model->id()) === false ? '/' . $model->id() . '/' : '/'
+ ]),
+ 'template' => Field::hidden()
+ ];
+
+ // only show template field if > 1 templates available
+ // or when in debug mode
+ if (count($blueprints) > 1 || $kirby->option('debug') === true) {
+ $fields['template'] = Field::template($blueprints, [
+ 'required' => true
+ ]);
+ }
+
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => $fields,
+ 'submitButton' => I18n::translate('page.draft.create'),
+ 'value' => [
+ 'parent' => $parent,
+ 'slug' => '',
+ 'template' => $template,
+ 'title' => '',
+ ]
+ ]
+ ];
+ },
+ 'submit' => function () {
+ $request = App::instance()->request();
+ $title = trim($request->get('title', ''));
+
+ if (Str::length($title) === 0) {
+ throw new InvalidArgumentException([
+ 'key' => 'page.changeTitle.empty'
+ ]);
+ }
+
+ $page = Find::parent($request->get('parent', 'site'))->createChild([
+ 'content' => ['title' => $title],
+ 'slug' => $request->get('slug'),
+ 'template' => $request->get('template'),
+ ]);
+
+ return [
+ 'event' => 'page.create',
+ 'redirect' => $page->panel()->url(true)
+ ];
+ }
+ ],
+
+ // delete page
+ 'page.delete' => [
+ 'pattern' => 'pages/(:any)/delete',
+ 'load' => function (string $id) {
+ $page = Find::page($id);
+ $text = I18n::template('page.delete.confirm', [
+ 'title' => Escape::html($page->title()->value())
+ ]);
+
+ if ($page->childrenAndDrafts()->count() > 0) {
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => [
+ 'info' => [
+ 'type' => 'info',
+ 'theme' => 'negative',
+ 'text' => I18n::translate('page.delete.confirm.subpages')
+ ],
+ 'check' => [
+ 'label' => I18n::translate('page.delete.confirm.title'),
+ 'type' => 'text',
+ 'counter' => false
+ ]
+ ],
+ 'size' => 'medium',
+ 'submitButton' => I18n::translate('delete'),
+ 'text' => $text,
+ 'theme' => 'negative',
+ ]
+ ];
+ }
+
+ return [
+ 'component' => 'k-remove-dialog',
+ 'props' => [
+ 'text' => $text
+ ]
+ ];
+ },
+ 'submit' => function (string $id) {
+ $request = App::instance()->request();
+
+ $page = Find::page($id);
+ $redirect = false;
+ $referrer = Panel::referrer();
+ $url = $page->panel()->url(true);
+
+ if (
+ $page->childrenAndDrafts()->count() > 0 &&
+ $request->get('check') !== $page->title()->value()
+ ) {
+ throw new InvalidArgumentException(['key' => 'page.delete.confirm']);
+ }
+
+ $page->delete(true);
+
+ // redirect to the parent model URL
+ // if the dialog has been opened in the page view
+ if ($referrer === $url) {
+ $redirect = $page->parentModel()->panel()->url(true);
+ }
+
+ return [
+ 'event' => 'page.delete',
+ 'dispatch' => ['content/remove' => [$url]],
+ 'redirect' => $redirect
+ ];
+ }
+ ],
+
+ // duplicate page
+ 'page.duplicate' => [
+ 'pattern' => 'pages/(:any)/duplicate',
+ 'load' => function (string $id) {
+ $page = Find::page($id);
+ $hasChildren = $page->hasChildren();
+ $hasFiles = $page->hasFiles();
+ $toggleWidth = '1/' . count(array_filter([$hasChildren, $hasFiles]));
+
+ $fields = [
+ 'title' => Field::title([
+ 'required' => true
+ ]),
+ 'slug' => Field::slug([
+ 'required' => true,
+ 'path' => $page->parent() ? '/' . $page->parent()->id() . '/' : '/',
+ 'wizard' => [
+ 'text' => I18n::translate('page.changeSlug.fromTitle'),
+ 'field' => 'title'
+ ]
+ ])
+ ];
+
+ if ($hasFiles === true) {
+ $fields['files'] = [
+ 'label' => I18n::translate('page.duplicate.files'),
+ 'type' => 'toggle',
+ 'required' => true,
+ 'width' => $toggleWidth
+ ];
+ }
+
+ if ($hasChildren === true) {
+ $fields['children'] = [
+ 'label' => I18n::translate('page.duplicate.pages'),
+ 'type' => 'toggle',
+ 'required' => true,
+ 'width' => $toggleWidth
+ ];
+ }
+
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => $fields,
+ 'submitButton' => I18n::translate('duplicate'),
+ 'value' => [
+ 'children' => false,
+ 'files' => false,
+ 'slug' => $page->slug() . '-' . Str::slug(I18n::translate('page.duplicate.appendix')),
+ 'title' => $page->title() . ' ' . I18n::translate('page.duplicate.appendix')
+ ]
+ ]
+ ];
+ },
+ 'submit' => function (string $id) {
+ $request = App::instance()->request();
+
+ $newPage = Find::page($id)->duplicate($request->get('slug'), [
+ 'children' => (bool)$request->get('children'),
+ 'files' => (bool)$request->get('files'),
+ 'title' => (string)$request->get('title'),
+ ]);
+
+ return [
+ 'event' => 'page.duplicate',
+ 'redirect' => $newPage->panel()->url(true)
+ ];
+ }
+ ],
+
+ // change filename
+ 'page.file.changeName' => [
+ 'pattern' => '(pages/.*?)/files/(:any)/changeName',
+ 'load' => $files['changeName']['load'],
+ 'submit' => $files['changeName']['submit'],
+ ],
+
+ // change sort
+ 'page.file.changeSort' => [
+ 'pattern' => '(pages/.*?)/files/(:any)/changeSort',
+ 'load' => $files['changeSort']['load'],
+ 'submit' => $files['changeSort']['submit'],
+ ],
+
+ // delete
+ 'page.file.delete' => [
+ 'pattern' => '(pages/.*?)/files/(:any)/delete',
+ 'load' => $files['delete']['load'],
+ 'submit' => $files['delete']['submit'],
+ ],
+
+ // change site title
+ 'site.changeTitle' => [
+ 'pattern' => 'site/changeTitle',
+ 'load' => function () {
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => [
+ 'title' => Field::title([
+ 'required' => true,
+ 'preselect' => true
+ ])
+ ],
+ 'submitButton' => I18n::translate('rename'),
+ 'value' => [
+ 'title' => App::instance()->site()->title()->value()
+ ]
+ ]
+ ];
+ },
+ 'submit' => function () {
+ $kirby = App::instance();
+
+ $kirby->site()->changeTitle($kirby->request()->get('title'));
+ return [
+ 'event' => 'site.changeTitle',
+ ];
+ }
+ ],
+
+ // change filename
+ 'site.file.changeName' => [
+ 'pattern' => '(site)/files/(:any)/changeName',
+ 'load' => $files['changeName']['load'],
+ 'submit' => $files['changeName']['submit'],
+ ],
+
+ // change sort
+ 'site.file.changeSort' => [
+ 'pattern' => '(site)/files/(:any)/changeSort',
+ 'load' => $files['changeSort']['load'],
+ 'submit' => $files['changeSort']['submit'],
+ ],
+
+ // delete
+ 'site.file.delete' => [
+ 'pattern' => '(site)/files/(:any)/delete',
+ 'load' => $files['delete']['load'],
+ 'submit' => $files['delete']['submit'],
+ ],
];
diff --git a/kirby/config/areas/site/dropdowns.php b/kirby/config/areas/site/dropdowns.php
index c498c00..c08853b 100755
--- a/kirby/config/areas/site/dropdowns.php
+++ b/kirby/config/areas/site/dropdowns.php
@@ -5,22 +5,22 @@ use Kirby\Panel\Dropdown;
$files = require __DIR__ . '/../files/dropdowns.php';
return [
- 'changes' => [
- 'pattern' => 'changes',
- 'options' => fn () => Dropdown::changes()
- ],
- 'page' => [
- 'pattern' => 'pages/(:any)',
- 'options' => function (string $path) {
- return Find::page($path)->panel()->dropdown();
- }
- ],
- 'page.file' => [
- 'pattern' => '(pages/.*?)/files/(:any)',
- 'options' => $files['file']
- ],
- 'site.file' => [
- 'pattern' => '(site)/files/(:any)',
- 'options' => $files['file']
- ]
+ 'changes' => [
+ 'pattern' => 'changes',
+ 'options' => fn () => Dropdown::changes()
+ ],
+ 'page' => [
+ 'pattern' => 'pages/(:any)',
+ 'options' => function (string $path) {
+ return Find::page($path)->panel()->dropdown();
+ }
+ ],
+ 'page.file' => [
+ 'pattern' => '(pages/.*?)/files/(:any)',
+ 'options' => $files['file']
+ ],
+ 'site.file' => [
+ 'pattern' => '(site)/files/(:any)',
+ 'options' => $files['file']
+ ]
];
diff --git a/kirby/config/areas/site/searches.php b/kirby/config/areas/site/searches.php
index 0bdfd26..6719bb2 100755
--- a/kirby/config/areas/site/searches.php
+++ b/kirby/config/areas/site/searches.php
@@ -5,53 +5,53 @@ use Kirby\Toolkit\Escape;
use Kirby\Toolkit\I18n;
return [
- 'pages' => [
- 'label' => I18n::translate('pages'),
- 'icon' => 'page',
- 'query' => function (string $query = null) {
- $pages = App::instance()->site()
- ->index(true)
- ->search($query)
- ->filter('isReadable', true)
- ->limit(10);
+ 'pages' => [
+ 'label' => I18n::translate('pages'),
+ 'icon' => 'page',
+ 'query' => function (string $query = null) {
+ $pages = App::instance()->site()
+ ->index(true)
+ ->search($query)
+ ->filter('isReadable', true)
+ ->limit(10);
- $results = [];
+ $results = [];
- foreach ($pages as $page) {
- $results[] = [
- 'image' => $page->panel()->image(),
- 'text' => Escape::html($page->title()->value()),
- 'link' => $page->panel()->url(true),
- 'info' => Escape::html($page->id())
- ];
- }
+ foreach ($pages as $page) {
+ $results[] = [
+ 'image' => $page->panel()->image(),
+ 'text' => Escape::html($page->title()->value()),
+ 'link' => $page->panel()->url(true),
+ 'info' => Escape::html($page->id())
+ ];
+ }
- return $results;
- }
- ],
- 'files' => [
- 'label' => I18n::translate('files'),
- 'icon' => 'image',
- 'query' => function (string $query = null) {
- $files = App::instance()->site()
- ->index(true)
- ->filter('isReadable', true)
- ->files()
- ->search($query)
- ->limit(10);
+ return $results;
+ }
+ ],
+ 'files' => [
+ 'label' => I18n::translate('files'),
+ 'icon' => 'image',
+ 'query' => function (string $query = null) {
+ $files = App::instance()->site()
+ ->index(true)
+ ->filter('isReadable', true)
+ ->files()
+ ->search($query)
+ ->limit(10);
- $results = [];
+ $results = [];
- foreach ($files as $file) {
- $results[] = [
- 'image' => $file->panel()->image(),
- 'text' => Escape::html($file->filename()),
- 'link' => $file->panel()->url(true),
- 'info' => Escape::html($file->id())
- ];
- }
+ foreach ($files as $file) {
+ $results[] = [
+ 'image' => $file->panel()->image(),
+ 'text' => Escape::html($file->filename()),
+ 'link' => $file->panel()->url(true),
+ 'info' => Escape::html($file->id())
+ ];
+ }
- return $results;
- }
- ]
+ return $results;
+ }
+ ]
];
diff --git a/kirby/config/areas/site/views.php b/kirby/config/areas/site/views.php
index d0fcf85..7465d2e 100755
--- a/kirby/config/areas/site/views.php
+++ b/kirby/config/areas/site/views.php
@@ -4,24 +4,24 @@ use Kirby\Cms\App;
use Kirby\Cms\Find;
return [
- 'page' => [
- 'pattern' => 'pages/(:any)',
- 'action' => fn (string $path) => Find::page($path)->panel()->view()
- ],
- 'page.file' => [
- 'pattern' => 'pages/(:any)/files/(:any)',
- 'action' => function (string $id, string $filename) {
- return Find::file('pages/' . $id, $filename)->panel()->view();
- }
- ],
- 'site' => [
- 'pattern' => 'site',
- 'action' => fn () => App::instance()->site()->panel()->view()
- ],
- 'site.file' => [
- 'pattern' => 'site/files/(:any)',
- 'action' => function (string $filename) {
- return Find::file('site', $filename)->panel()->view();
- }
- ],
+ 'page' => [
+ 'pattern' => 'pages/(:any)',
+ 'action' => fn (string $path) => Find::page($path)->panel()->view()
+ ],
+ 'page.file' => [
+ 'pattern' => 'pages/(:any)/files/(:any)',
+ 'action' => function (string $id, string $filename) {
+ return Find::file('pages/' . $id, $filename)->panel()->view();
+ }
+ ],
+ 'site' => [
+ 'pattern' => 'site',
+ 'action' => fn () => App::instance()->site()->panel()->view()
+ ],
+ 'site.file' => [
+ 'pattern' => 'site/files/(:any)',
+ 'action' => function (string $filename) {
+ return Find::file('site', $filename)->panel()->view();
+ }
+ ],
];
diff --git a/kirby/config/areas/system.php b/kirby/config/areas/system.php
index 8fed5b2..9f3075a 100755
--- a/kirby/config/areas/system.php
+++ b/kirby/config/areas/system.php
@@ -3,11 +3,11 @@
use Kirby\Toolkit\I18n;
return function ($kirby) {
- return [
- 'icon' => 'settings',
- 'label' => I18n::translate('view.system'),
- 'menu' => true,
- 'dialogs' => require __DIR__ . '/system/dialogs.php',
- 'views' => require __DIR__ . '/system/views.php'
- ];
+ return [
+ 'icon' => 'settings',
+ 'label' => I18n::translate('view.system'),
+ 'menu' => true,
+ 'dialogs' => require __DIR__ . '/system/dialogs.php',
+ 'views' => require __DIR__ . '/system/views.php'
+ ];
};
diff --git a/kirby/config/areas/system/dialogs.php b/kirby/config/areas/system/dialogs.php
index 7cefd18..35a3f9a 100755
--- a/kirby/config/areas/system/dialogs.php
+++ b/kirby/config/areas/system/dialogs.php
@@ -5,82 +5,82 @@ use Kirby\Panel\Field;
use Kirby\Toolkit\I18n;
return [
- // license key
- 'license' => [
- 'load' => function () {
- $license = App::instance()->system()->license();
+ // license key
+ 'license' => [
+ 'load' => function () {
+ $license = App::instance()->system()->license();
- // @codeCoverageIgnoreStart
- // the system is registered but the license
- // key is only visible for admins
- if ($license === true) {
- $license = 'Kirby 3';
- }
- // @codeCoverageIgnoreEnd
+ // @codeCoverageIgnoreStart
+ // the system is registered but the license
+ // key is only visible for admins
+ if ($license === true) {
+ $license = 'Kirby 3';
+ }
+ // @codeCoverageIgnoreEnd
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'size' => 'medium',
- 'fields' => [
- 'license' => [
- 'type' => 'info',
- 'label' => I18n::translate('license'),
- 'text' => $license ? $license : I18n::translate('license.unregistered.label'),
- 'theme' => $license ? 'code' : 'negative',
- 'help' => $license ?
- // @codeCoverageIgnoreStart
- '' . I18n::translate('license.manage') . ' →' :
- // @codeCoverageIgnoreEnd
- '' . I18n::translate('license.buy') . ' →'
- ]
- ],
- 'submitButton' => false,
- 'cancelButton' => false,
- ]
- ];
- }
- ],
- // license registration
- 'registration' => [
- 'load' => function () {
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => [
- 'license' => [
- 'label' => I18n::translate('license.register.label'),
- 'type' => 'text',
- 'required' => true,
- 'counter' => false,
- 'placeholder' => 'K3-',
- 'help' => I18n::translate('license.register.help')
- ],
- 'email' => Field::email([
- 'required' => true
- ])
- ],
- 'submitButton' => I18n::translate('license.register'),
- 'value' => [
- 'license' => null,
- 'email' => null
- ]
- ]
- ];
- },
- 'submit' => function () {
- // @codeCoverageIgnoreStart
- $kirby = App::instance();
- $kirby->system()->register(
- $kirby->request()->get('license'),
- $kirby->request()->get('email')
- );
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'size' => 'medium',
+ 'fields' => [
+ 'license' => [
+ 'type' => 'info',
+ 'label' => I18n::translate('license'),
+ 'text' => $license ? $license : I18n::translate('license.unregistered.label'),
+ 'theme' => $license ? 'code' : 'negative',
+ 'help' => $license ?
+ // @codeCoverageIgnoreStart
+ '' . I18n::translate('license.manage') . ' →' :
+ // @codeCoverageIgnoreEnd
+ '' . I18n::translate('license.buy') . ' →'
+ ]
+ ],
+ 'submitButton' => false,
+ 'cancelButton' => false,
+ ]
+ ];
+ }
+ ],
+ // license registration
+ 'registration' => [
+ 'load' => function () {
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => [
+ 'license' => [
+ 'label' => I18n::translate('license.register.label'),
+ 'type' => 'text',
+ 'required' => true,
+ 'counter' => false,
+ 'placeholder' => 'K3-',
+ 'help' => I18n::translate('license.register.help')
+ ],
+ 'email' => Field::email([
+ 'required' => true
+ ])
+ ],
+ 'submitButton' => I18n::translate('license.register'),
+ 'value' => [
+ 'license' => null,
+ 'email' => null
+ ]
+ ]
+ ];
+ },
+ 'submit' => function () {
+ // @codeCoverageIgnoreStart
+ $kirby = App::instance();
+ $kirby->system()->register(
+ $kirby->request()->get('license'),
+ $kirby->request()->get('email')
+ );
- return [
- 'event' => 'system.register',
- 'message' => I18n::translate('license.register.success')
- ];
- // @codeCoverageIgnoreEnd
- }
- ],
+ return [
+ 'event' => 'system.register',
+ 'message' => I18n::translate('license.register.success')
+ ];
+ // @codeCoverageIgnoreEnd
+ }
+ ],
];
diff --git a/kirby/config/areas/system/views.php b/kirby/config/areas/system/views.php
index 7b2c265..8bab2a2 100755
--- a/kirby/config/areas/system/views.php
+++ b/kirby/config/areas/system/views.php
@@ -3,53 +3,53 @@
use Kirby\Cms\App;
return [
- 'system' => [
- 'pattern' => 'system',
- 'action' => function () {
- $kirby = App::instance();
- $system = $kirby->system();
- $license = $system->license();
+ 'system' => [
+ 'pattern' => 'system',
+ 'action' => function () {
+ $kirby = App::instance();
+ $system = $kirby->system();
+ $license = $system->license();
- // @codeCoverageIgnoreStart
- if ($license === true) {
- // valid license, but user is not admin
- $license = 'Kirby 3';
- } elseif ($license === false) {
- // no valid license
- $license = null;
- }
- // @codeCoverageIgnoreEnd
+ // @codeCoverageIgnoreStart
+ if ($license === true) {
+ // valid license, but user is not admin
+ $license = 'Kirby 3';
+ } elseif ($license === false) {
+ // no valid license
+ $license = null;
+ }
+ // @codeCoverageIgnoreEnd
- $plugins = $system->plugins()->values(function ($plugin) {
- return [
- 'author' => $plugin->authorsNames(),
- 'license' => $plugin->license(),
- 'name' => [
- 'text' => $plugin->name(),
- 'href' => $plugin->link(),
- ],
- 'version' => $plugin->version(),
- ];
- });
+ $plugins = $system->plugins()->values(function ($plugin) {
+ return [
+ 'author' => $plugin->authorsNames(),
+ 'license' => $plugin->license(),
+ 'name' => [
+ 'text' => $plugin->name(),
+ 'href' => $plugin->link(),
+ ],
+ 'version' => $plugin->version(),
+ ];
+ });
- return [
- 'component' => 'k-system-view',
- 'props' => [
- 'debug' => $kirby->option('debug', false),
- 'license' => $license,
- 'plugins' => $plugins,
- 'php' => phpversion(),
- 'server' => $system->serverSoftware(),
- 'https' => $kirby->environment()->https(),
- 'version' => $kirby->version(),
- 'urls' => [
- 'content' => $system->exposedFileUrl('content'),
- 'git' => $system->exposedFileUrl('git'),
- 'kirby' => $system->exposedFileUrl('kirby'),
- 'site' => $system->exposedFileUrl('site')
- ]
- ]
- ];
- }
- ],
+ return [
+ 'component' => 'k-system-view',
+ 'props' => [
+ 'debug' => $kirby->option('debug', false),
+ 'license' => $license,
+ 'plugins' => $plugins,
+ 'php' => phpversion(),
+ 'server' => $system->serverSoftware(),
+ 'https' => $kirby->environment()->https(),
+ 'version' => $kirby->version(),
+ 'urls' => [
+ 'content' => $system->exposedFileUrl('content'),
+ 'git' => $system->exposedFileUrl('git'),
+ 'kirby' => $system->exposedFileUrl('kirby'),
+ 'site' => $system->exposedFileUrl('site')
+ ]
+ ]
+ ];
+ }
+ ],
];
diff --git a/kirby/config/areas/users.php b/kirby/config/areas/users.php
index 830d1fe..ff7e130 100755
--- a/kirby/config/areas/users.php
+++ b/kirby/config/areas/users.php
@@ -3,14 +3,14 @@
use Kirby\Toolkit\I18n;
return function ($kirby) {
- return [
- 'icon' => 'users',
- 'label' => I18n::translate('view.users'),
- 'search' => 'users',
- 'menu' => true,
- 'dialogs' => require __DIR__ . '/users/dialogs.php',
- 'dropdowns' => require __DIR__ . '/users/dropdowns.php',
- 'searches' => require __DIR__ . '/users/searches.php',
- 'views' => require __DIR__ . '/users/views.php'
- ];
+ return [
+ 'icon' => 'users',
+ 'label' => I18n::translate('view.users'),
+ 'search' => 'users',
+ 'menu' => true,
+ 'dialogs' => require __DIR__ . '/users/dialogs.php',
+ 'dropdowns' => require __DIR__ . '/users/dropdowns.php',
+ 'searches' => require __DIR__ . '/users/searches.php',
+ 'views' => require __DIR__ . '/users/views.php'
+ ];
};
diff --git a/kirby/config/areas/users/dialogs.php b/kirby/config/areas/users/dialogs.php
index d3b8e2c..291abb3 100755
--- a/kirby/config/areas/users/dialogs.php
+++ b/kirby/config/areas/users/dialogs.php
@@ -13,299 +13,299 @@ $files = require __DIR__ . '/../files/dialogs.php';
return [
- // create
- 'user.create' => [
- 'pattern' => 'users/create',
- 'load' => function () {
- $kirby = App::instance();
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => [
- 'name' => Field::username(),
- 'email' => Field::email([
- 'link' => false,
- 'required' => true
- ]),
- 'password' => Field::password(),
- 'translation' => Field::translation([
- 'required' => true
- ]),
- 'role' => Field::role([
- 'required' => true
- ])
- ],
- 'submitButton' => I18n::translate('create'),
- 'value' => [
- 'name' => '',
- 'email' => '',
- 'password' => '',
- 'translation' => $kirby->panelLanguage(),
- 'role' => $kirby->user()->role()->name()
- ]
- ]
- ];
- },
- 'submit' => function () {
- $kirby = App::instance();
+ // create
+ 'user.create' => [
+ 'pattern' => 'users/create',
+ 'load' => function () {
+ $kirby = App::instance();
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => [
+ 'name' => Field::username(),
+ 'email' => Field::email([
+ 'link' => false,
+ 'required' => true
+ ]),
+ 'password' => Field::password(),
+ 'translation' => Field::translation([
+ 'required' => true
+ ]),
+ 'role' => Field::role([
+ 'required' => true
+ ])
+ ],
+ 'submitButton' => I18n::translate('create'),
+ 'value' => [
+ 'name' => '',
+ 'email' => '',
+ 'password' => '',
+ 'translation' => $kirby->panelLanguage(),
+ 'role' => $kirby->user()->role()->name()
+ ]
+ ]
+ ];
+ },
+ 'submit' => function () {
+ $kirby = App::instance();
- $kirby->users()->create([
- 'name' => $kirby->request()->get('name'),
- 'email' => $kirby->request()->get('email'),
- 'password' => $kirby->request()->get('password'),
- 'language' => $kirby->request()->get('translation'),
- 'role' => $kirby->request()->get('role')
- ]);
+ $kirby->users()->create([
+ 'name' => $kirby->request()->get('name'),
+ 'email' => $kirby->request()->get('email'),
+ 'password' => $kirby->request()->get('password'),
+ 'language' => $kirby->request()->get('translation'),
+ 'role' => $kirby->request()->get('role')
+ ]);
- return [
- 'event' => 'user.create'
- ];
- }
- ],
+ return [
+ 'event' => 'user.create'
+ ];
+ }
+ ],
- // change email
- 'user.changeEmail' => [
- 'pattern' => 'users/(:any)/changeEmail',
- 'load' => function (string $id) {
- $user = Find::user($id);
+ // change email
+ 'user.changeEmail' => [
+ 'pattern' => 'users/(:any)/changeEmail',
+ 'load' => function (string $id) {
+ $user = Find::user($id);
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => [
- 'email' => [
- 'label' => I18n::translate('email'),
- 'required' => true,
- 'type' => 'email',
- 'preselect' => true
- ]
- ],
- 'submitButton' => I18n::translate('change'),
- 'value' => [
- 'email' => $user->email()
- ]
- ]
- ];
- },
- 'submit' => function (string $id) {
- $request = App::instance()->request();
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => [
+ 'email' => [
+ 'label' => I18n::translate('email'),
+ 'required' => true,
+ 'type' => 'email',
+ 'preselect' => true
+ ]
+ ],
+ 'submitButton' => I18n::translate('change'),
+ 'value' => [
+ 'email' => $user->email()
+ ]
+ ]
+ ];
+ },
+ 'submit' => function (string $id) {
+ $request = App::instance()->request();
- Find::user($id)->changeEmail($request->get('email'));
+ Find::user($id)->changeEmail($request->get('email'));
- return [
- 'event' => 'user.changeEmail'
- ];
- }
- ],
+ return [
+ 'event' => 'user.changeEmail'
+ ];
+ }
+ ],
- // change language
- 'user.changeLanguage' => [
- 'pattern' => 'users/(:any)/changeLanguage',
- 'load' => function (string $id) {
- $user = Find::user($id);
+ // change language
+ 'user.changeLanguage' => [
+ 'pattern' => 'users/(:any)/changeLanguage',
+ 'load' => function (string $id) {
+ $user = Find::user($id);
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => [
- 'translation' => Field::translation(['required' => true])
- ],
- 'submitButton' => I18n::translate('change'),
- 'value' => [
- 'translation' => $user->language()
- ]
- ]
- ];
- },
- 'submit' => function (string $id) {
- $request = App::instance()->request();
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => [
+ 'translation' => Field::translation(['required' => true])
+ ],
+ 'submitButton' => I18n::translate('change'),
+ 'value' => [
+ 'translation' => $user->language()
+ ]
+ ]
+ ];
+ },
+ 'submit' => function (string $id) {
+ $request = App::instance()->request();
- Find::user($id)->changeLanguage($request->get('translation'));
+ Find::user($id)->changeLanguage($request->get('translation'));
- return [
- 'event' => 'user.changeLanguage',
- 'reload' => [
- 'globals' => '$translation'
- ]
- ];
- }
- ],
+ return [
+ 'event' => 'user.changeLanguage',
+ 'reload' => [
+ 'globals' => '$translation'
+ ]
+ ];
+ }
+ ],
- // change name
- 'user.changeName' => [
- 'pattern' => 'users/(:any)/changeName',
- 'load' => function (string $id) {
- $user = Find::user($id);
+ // change name
+ 'user.changeName' => [
+ 'pattern' => 'users/(:any)/changeName',
+ 'load' => function (string $id) {
+ $user = Find::user($id);
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => [
- 'name' => Field::username([
- 'preselect' => true
- ])
- ],
- 'submitButton' => I18n::translate('rename'),
- 'value' => [
- 'name' => $user->name()->value()
- ]
- ]
- ];
- },
- 'submit' => function (string $id) {
- $request = App::instance()->request();
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => [
+ 'name' => Field::username([
+ 'preselect' => true
+ ])
+ ],
+ 'submitButton' => I18n::translate('rename'),
+ 'value' => [
+ 'name' => $user->name()->value()
+ ]
+ ]
+ ];
+ },
+ 'submit' => function (string $id) {
+ $request = App::instance()->request();
- Find::user($id)->changeName($request->get('name'));
+ Find::user($id)->changeName($request->get('name'));
- return [
- 'event' => 'user.changeName'
- ];
- }
- ],
+ return [
+ 'event' => 'user.changeName'
+ ];
+ }
+ ],
- // change password
- 'user.changePassword' => [
- 'pattern' => 'users/(:any)/changePassword',
- 'load' => function (string $id) {
- $user = Find::user($id);
+ // change password
+ 'user.changePassword' => [
+ 'pattern' => 'users/(:any)/changePassword',
+ 'load' => function (string $id) {
+ $user = Find::user($id);
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => [
- 'password' => Field::password([
- 'label' => I18n::translate('user.changePassword.new'),
- ]),
- 'passwordConfirmation' => Field::password([
- 'label' => I18n::translate('user.changePassword.new.confirm'),
- ])
- ],
- 'submitButton' => I18n::translate('change'),
- ]
- ];
- },
- 'submit' => function (string $id) {
- $request = App::instance()->request();
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => [
+ 'password' => Field::password([
+ 'label' => I18n::translate('user.changePassword.new'),
+ ]),
+ 'passwordConfirmation' => Field::password([
+ 'label' => I18n::translate('user.changePassword.new.confirm'),
+ ])
+ ],
+ 'submitButton' => I18n::translate('change'),
+ ]
+ ];
+ },
+ 'submit' => function (string $id) {
+ $request = App::instance()->request();
- $user = Find::user($id);
- $password = $request->get('password');
- $passwordConfirmation = $request->get('passwordConfirmation');
+ $user = Find::user($id);
+ $password = $request->get('password');
+ $passwordConfirmation = $request->get('passwordConfirmation');
- // validate the password
- UserRules::validPassword($user, $password ?? '');
+ // validate the password
+ UserRules::validPassword($user, $password ?? '');
- // compare passwords
- if ($password !== $passwordConfirmation) {
- throw new InvalidArgumentException([
- 'key' => 'user.password.notSame'
- ]);
- }
+ // compare passwords
+ if ($password !== $passwordConfirmation) {
+ throw new InvalidArgumentException([
+ 'key' => 'user.password.notSame'
+ ]);
+ }
- // change password if everything's fine
- $user->changePassword($password);
+ // change password if everything's fine
+ $user->changePassword($password);
- return [
- 'event' => 'user.changePassword'
- ];
- }
- ],
+ return [
+ 'event' => 'user.changePassword'
+ ];
+ }
+ ],
- // change role
- 'user.changeRole' => [
- 'pattern' => 'users/(:any)/changeRole',
- 'load' => function (string $id) {
- $user = Find::user($id);
+ // change role
+ 'user.changeRole' => [
+ 'pattern' => 'users/(:any)/changeRole',
+ 'load' => function (string $id) {
+ $user = Find::user($id);
- return [
- 'component' => 'k-form-dialog',
- 'props' => [
- 'fields' => [
- 'role' => Field::role([
- 'label' => I18n::translate('user.changeRole.select'),
- 'required' => true,
- ])
- ],
- 'submitButton' => I18n::translate('user.changeRole'),
- 'value' => [
- 'role' => $user->role()->name()
- ]
- ]
- ];
- },
- 'submit' => function (string $id) {
- $request = App::instance()->request();
+ return [
+ 'component' => 'k-form-dialog',
+ 'props' => [
+ 'fields' => [
+ 'role' => Field::role([
+ 'label' => I18n::translate('user.changeRole.select'),
+ 'required' => true,
+ ])
+ ],
+ 'submitButton' => I18n::translate('user.changeRole'),
+ 'value' => [
+ 'role' => $user->role()->name()
+ ]
+ ]
+ ];
+ },
+ 'submit' => function (string $id) {
+ $request = App::instance()->request();
- $user = Find::user($id)->changeRole($request->get('role'));
+ $user = Find::user($id)->changeRole($request->get('role'));
- return [
- 'event' => 'user.changeRole',
- 'user' => $user->toArray()
- ];
- }
- ],
+ return [
+ 'event' => 'user.changeRole',
+ 'user' => $user->toArray()
+ ];
+ }
+ ],
- // delete
- 'user.delete' => [
- 'pattern' => 'users/(:any)/delete',
- 'load' => function (string $id) {
- $user = Find::user($id);
- $i18nPrefix = $user->isLoggedIn() ? 'account' : 'user';
+ // delete
+ 'user.delete' => [
+ 'pattern' => 'users/(:any)/delete',
+ 'load' => function (string $id) {
+ $user = Find::user($id);
+ $i18nPrefix = $user->isLoggedIn() ? 'account' : 'user';
- return [
- 'component' => 'k-remove-dialog',
- 'props' => [
- 'text' => I18n::template($i18nPrefix . '.delete.confirm', [
- 'email' => Escape::html($user->email())
- ])
- ]
- ];
- },
- 'submit' => function (string $id) {
- $user = Find::user($id);
- $redirect = false;
- $referrer = Panel::referrer();
- $url = $user->panel()->url(true);
+ return [
+ 'component' => 'k-remove-dialog',
+ 'props' => [
+ 'text' => I18n::template($i18nPrefix . '.delete.confirm', [
+ 'email' => Escape::html($user->email())
+ ])
+ ]
+ ];
+ },
+ 'submit' => function (string $id) {
+ $user = Find::user($id);
+ $redirect = false;
+ $referrer = Panel::referrer();
+ $url = $user->panel()->url(true);
- $user->delete();
+ $user->delete();
- // redirect to the users view
- // if the dialog has been opened in the user view
- if ($referrer === $url) {
- $redirect = '/users';
- }
+ // redirect to the users view
+ // if the dialog has been opened in the user view
+ if ($referrer === $url) {
+ $redirect = '/users';
+ }
- // logout the user if they deleted themselves
- if ($user->isLoggedIn()) {
- $redirect = '/logout';
- }
+ // logout the user if they deleted themselves
+ if ($user->isLoggedIn()) {
+ $redirect = '/logout';
+ }
- return [
- 'event' => 'user.delete',
- 'dispatch' => ['content/remove' => [$url]],
- 'redirect' => $redirect
- ];
- }
- ],
+ return [
+ 'event' => 'user.delete',
+ 'dispatch' => ['content/remove' => [$url]],
+ 'redirect' => $redirect
+ ];
+ }
+ ],
- // change file name
- 'user.file.changeName' => [
- 'pattern' => '(users/.*?)/files/(:any)/changeName',
- 'load' => $files['changeName']['load'],
- 'submit' => $files['changeName']['submit'],
- ],
+ // change file name
+ 'user.file.changeName' => [
+ 'pattern' => '(users/.*?)/files/(:any)/changeName',
+ 'load' => $files['changeName']['load'],
+ 'submit' => $files['changeName']['submit'],
+ ],
- // change file sort
- 'user.file.changeSort' => [
- 'pattern' => '(users/.*?)/files/(:any)/changeSort',
- 'load' => $files['changeSort']['load'],
- 'submit' => $files['changeSort']['submit'],
- ],
+ // change file sort
+ 'user.file.changeSort' => [
+ 'pattern' => '(users/.*?)/files/(:any)/changeSort',
+ 'load' => $files['changeSort']['load'],
+ 'submit' => $files['changeSort']['submit'],
+ ],
- // delete file
- 'user.file.delete' => [
- 'pattern' => '(users/.*?)/files/(:any)/delete',
- 'load' => $files['delete']['load'],
- 'submit' => $files['delete']['submit'],
- ]
+ // delete file
+ 'user.file.delete' => [
+ 'pattern' => '(users/.*?)/files/(:any)/delete',
+ 'load' => $files['delete']['load'],
+ 'submit' => $files['delete']['submit'],
+ ]
];
diff --git a/kirby/config/areas/users/dropdowns.php b/kirby/config/areas/users/dropdowns.php
index 2b3f15f..ec30a5f 100755
--- a/kirby/config/areas/users/dropdowns.php
+++ b/kirby/config/areas/users/dropdowns.php
@@ -5,14 +5,14 @@ use Kirby\Cms\Find;
$files = require __DIR__ . '/../files/dropdowns.php';
return [
- 'user' => [
- 'pattern' => 'users/(:any)',
- 'options' => function (string $id) {
- return Find::user($id)->panel()->dropdown();
- }
- ],
- 'user.file' => [
- 'pattern' => '(users/.*?)/files/(:any)',
- 'options' => $files['file']
- ]
+ 'user' => [
+ 'pattern' => 'users/(:any)',
+ 'options' => function (string $id) {
+ return Find::user($id)->panel()->dropdown();
+ }
+ ],
+ 'user.file' => [
+ 'pattern' => '(users/.*?)/files/(:any)',
+ 'options' => $files['file']
+ ]
];
diff --git a/kirby/config/areas/users/searches.php b/kirby/config/areas/users/searches.php
index e2bf106..25a5702 100755
--- a/kirby/config/areas/users/searches.php
+++ b/kirby/config/areas/users/searches.php
@@ -5,23 +5,23 @@ use Kirby\Toolkit\Escape;
use Kirby\Toolkit\I18n;
return [
- 'users' => [
- 'label' => I18n::translate('users'),
- 'icon' => 'users',
- 'query' => function (string $query = null) {
- $users = App::instance()->users()->search($query)->limit(10);
- $results = [];
+ 'users' => [
+ 'label' => I18n::translate('users'),
+ 'icon' => 'users',
+ 'query' => function (string $query = null) {
+ $users = App::instance()->users()->search($query)->limit(10);
+ $results = [];
- foreach ($users as $user) {
- $results[] = [
- 'image' => $user->panel()->image(),
- 'text' => Escape::html($user->username()),
- 'link' => $user->panel()->url(true),
- 'info' => Escape::html($user->role()->title())
- ];
- }
+ foreach ($users as $user) {
+ $results[] = [
+ 'image' => $user->panel()->image(),
+ 'text' => Escape::html($user->username()),
+ 'link' => $user->panel()->url(true),
+ 'info' => Escape::html($user->role()->title())
+ ];
+ }
- return $results;
- }
- ]
+ return $results;
+ }
+ ]
];
diff --git a/kirby/config/areas/users/views.php b/kirby/config/areas/users/views.php
index 9ce73d0..a03a5d6 100755
--- a/kirby/config/areas/users/views.php
+++ b/kirby/config/areas/users/views.php
@@ -5,62 +5,62 @@ use Kirby\Cms\Find;
use Kirby\Toolkit\Escape;
return [
- 'users' => [
- 'pattern' => 'users',
- 'action' => function () {
- $kirby = App::instance();
- $role = $kirby->request()->get('role');
- $roles = $kirby->roles()->toArray(fn ($role) => [
- 'id' => $role->id(),
- 'title' => $role->title(),
- ]);
+ 'users' => [
+ 'pattern' => 'users',
+ 'action' => function () {
+ $kirby = App::instance();
+ $role = $kirby->request()->get('role');
+ $roles = $kirby->roles()->toArray(fn ($role) => [
+ 'id' => $role->id(),
+ 'title' => $role->title(),
+ ]);
- return [
- 'component' => 'k-users-view',
- 'props' => [
- 'role' => function () use ($kirby, $roles, $role) {
- if ($role) {
- return $roles[$role] ?? null;
- }
- },
- 'roles' => array_values($roles),
- 'users' => function () use ($kirby, $role) {
- $users = $kirby->users();
+ return [
+ 'component' => 'k-users-view',
+ 'props' => [
+ 'role' => function () use ($kirby, $roles, $role) {
+ if ($role) {
+ return $roles[$role] ?? null;
+ }
+ },
+ 'roles' => array_values($roles),
+ 'users' => function () use ($kirby, $role) {
+ $users = $kirby->users();
- if (empty($role) === false) {
- $users = $users->role($role);
- }
+ if (empty($role) === false) {
+ $users = $users->role($role);
+ }
- $users = $users->paginate([
- 'limit' => 20,
- 'page' => $kirby->request()->get('page')
- ]);
+ $users = $users->paginate([
+ 'limit' => 20,
+ 'page' => $kirby->request()->get('page')
+ ]);
- return [
- 'data' => $users->values(fn ($user) => [
- 'id' => $user->id(),
- 'image' => $user->panel()->image(),
- 'info' => Escape::html($user->role()->title()),
- 'link' => $user->panel()->url(true),
- 'text' => Escape::html($user->username())
- ]),
- 'pagination' => $users->pagination()->toArray()
- ];
- },
- ]
- ];
- }
- ],
- 'user' => [
- 'pattern' => 'users/(:any)',
- 'action' => function (string $id) {
- return Find::user($id)->panel()->view();
- }
- ],
- 'user.file' => [
- 'pattern' => 'users/(:any)/files/(:any)',
- 'action' => function (string $id, string $filename) {
- return Find::file('users/' . $id, $filename)->panel()->view();
- }
- ],
+ return [
+ 'data' => $users->values(fn ($user) => [
+ 'id' => $user->id(),
+ 'image' => $user->panel()->image(),
+ 'info' => Escape::html($user->role()->title()),
+ 'link' => $user->panel()->url(true),
+ 'text' => Escape::html($user->username())
+ ]),
+ 'pagination' => $users->pagination()->toArray()
+ ];
+ },
+ ]
+ ];
+ }
+ ],
+ 'user' => [
+ 'pattern' => 'users/(:any)',
+ 'action' => function (string $id) {
+ return Find::user($id)->panel()->view();
+ }
+ ],
+ 'user.file' => [
+ 'pattern' => 'users/(:any)/files/(:any)',
+ 'action' => function (string $id, string $filename) {
+ return Find::file('users/' . $id, $filename)->panel()->view();
+ }
+ ],
];
diff --git a/kirby/config/blocks/image/image.php b/kirby/config/blocks/image/image.php
index e1902ec..3e3e3df 100755
--- a/kirby/config/blocks/image/image.php
+++ b/kirby/config/blocks/image/image.php
@@ -9,10 +9,10 @@ $ratio = $block->ratio()->or('auto');
$src = null;
if ($block->location() == 'web') {
- $src = $block->src()->esc();
+ $src = $block->src()->esc();
} elseif ($image = $block->image()->toFile()) {
- $alt = $alt ?? $image->alt();
- $src = $image->url();
+ $alt = $alt ?? $image->alt();
+ $src = $image->url();
}
?>
diff --git a/kirby/config/components.php b/kirby/config/components.php
index b60d34c..c05d886 100755
--- a/kirby/config/components.php
+++ b/kirby/config/components.php
@@ -21,395 +21,395 @@ use Kirby\Toolkit\Tpl as Snippet;
return [
- /**
- * Used by the `css()` helper
- *
- * @param \Kirby\Cms\App $kirby Kirby instance
- * @param string $url Relative or absolute URL
- * @param string|array $options An array of attributes for the link tag or a media attribute string
- */
- 'css' => fn (App $kirby, string $url, $options = null): string => $url,
+ /**
+ * Used by the `css()` helper
+ *
+ * @param \Kirby\Cms\App $kirby Kirby instance
+ * @param string $url Relative or absolute URL
+ * @param string|array $options An array of attributes for the link tag or a media attribute string
+ */
+ 'css' => fn (App $kirby, string $url, $options = null): string => $url,
- /**
- * Object and variable dumper
- * to help with debugging.
- *
- * @param \Kirby\Cms\App $kirby Kirby instance
- * @param mixed $variable
- * @param bool $echo
- * @return string
- *
- * @deprecated 3.7.0 Disable `dump()` via `KIRBY_HELPER_DUMP` instead and create your own function
- * @todo move to `Helpers::dump()`, remove component in 3.8.0
- */
- 'dump' => function (App $kirby, $variable, bool $echo = true) {
- if ($kirby->environment()->cli() === true) {
- $output = print_r($variable, true) . PHP_EOL;
- } else {
- $output = '
' . print_r($variable, true) . '
';
- }
+ /**
+ * Object and variable dumper
+ * to help with debugging.
+ *
+ * @param \Kirby\Cms\App $kirby Kirby instance
+ * @param mixed $variable
+ * @param bool $echo
+ * @return string
+ *
+ * @deprecated 3.7.0 Disable `dump()` via `KIRBY_HELPER_DUMP` instead and create your own function
+ * @todo move to `Helpers::dump()`, remove component in 3.8.0
+ */
+ 'dump' => function (App $kirby, $variable, bool $echo = true) {
+ if ($kirby->environment()->cli() === true) {
+ $output = print_r($variable, true) . PHP_EOL;
+ } else {
+ $output = '' . print_r($variable, true) . '
';
+ }
- if ($echo === true) {
- echo $output;
- }
+ if ($echo === true) {
+ echo $output;
+ }
- return $output;
- },
+ return $output;
+ },
- /**
- * Add your own email provider
- *
- * @param \Kirby\Cms\App $kirby Kirby instance
- * @param array $props
- * @param bool $debug
- */
- 'email' => function (App $kirby, array $props = [], bool $debug = false) {
- return new Emailer($props, $debug);
- },
+ /**
+ * Add your own email provider
+ *
+ * @param \Kirby\Cms\App $kirby Kirby instance
+ * @param array $props
+ * @param bool $debug
+ */
+ 'email' => function (App $kirby, array $props = [], bool $debug = false) {
+ return new Emailer($props, $debug);
+ },
- /**
- * Modify URLs for file objects
- *
- * @param \Kirby\Cms\App $kirby Kirby instance
- * @param \Kirby\Cms\File $file The original file object
- * @return string
- */
- 'file::url' => function (App $kirby, File $file): string {
- return $file->mediaUrl();
- },
+ /**
+ * Modify URLs for file objects
+ *
+ * @param \Kirby\Cms\App $kirby Kirby instance
+ * @param \Kirby\Cms\File $file The original file object
+ * @return string
+ */
+ 'file::url' => function (App $kirby, File $file): string {
+ return $file->mediaUrl();
+ },
- /**
- * Adapt file characteristics
- *
- * @param \Kirby\Cms\App $kirby Kirby instance
- * @param \Kirby\Cms\File|\Kirby\Filesystem\Asset $file The file object
- * @param array $options All thumb options (width, height, crop, blur, grayscale)
- * @return \Kirby\Cms\File|\Kirby\Cms\FileVersion|\Kirby\Filesystem\Asset
- */
- 'file::version' => function (App $kirby, $file, array $options = []) {
- // if file is not resizable, return
- if ($file->isResizable() === false) {
- return $file;
- }
+ /**
+ * Adapt file characteristics
+ *
+ * @param \Kirby\Cms\App $kirby Kirby instance
+ * @param \Kirby\Cms\File|\Kirby\Filesystem\Asset $file The file object
+ * @param array $options All thumb options (width, height, crop, blur, grayscale)
+ * @return \Kirby\Cms\File|\Kirby\Cms\FileVersion|\Kirby\Filesystem\Asset
+ */
+ 'file::version' => function (App $kirby, $file, array $options = []) {
+ // if file is not resizable, return
+ if ($file->isResizable() === false) {
+ return $file;
+ }
- // create url and root
- $mediaRoot = dirname($file->mediaRoot());
- $template = $mediaRoot . '/{{ name }}{{ attributes }}.{{ extension }}';
- $thumbRoot = (new Filename($file->root(), $template, $options))->toString();
- $thumbName = basename($thumbRoot);
+ // create url and root
+ $mediaRoot = dirname($file->mediaRoot());
+ $template = $mediaRoot . '/{{ name }}{{ attributes }}.{{ extension }}';
+ $thumbRoot = (new Filename($file->root(), $template, $options))->toString();
+ $thumbName = basename($thumbRoot);
- // check if the thumb already exists
- if (file_exists($thumbRoot) === false) {
+ // check if the thumb already exists
+ if (file_exists($thumbRoot) === false) {
- // if not, create job file
- $job = $mediaRoot . '/.jobs/' . $thumbName . '.json';
+ // if not, create job file
+ $job = $mediaRoot . '/.jobs/' . $thumbName . '.json';
- try {
- Data::write($job, array_merge($options, [
- 'filename' => $file->filename()
- ]));
- } catch (Throwable $e) {
- // if thumb doesn't exist yet and job file cannot
- // be created, return
- return $file;
- }
- }
+ try {
+ Data::write($job, array_merge($options, [
+ 'filename' => $file->filename()
+ ]));
+ } catch (Throwable $e) {
+ // if thumb doesn't exist yet and job file cannot
+ // be created, return
+ return $file;
+ }
+ }
- return new FileVersion([
- 'modifications' => $options,
- 'original' => $file,
- 'root' => $thumbRoot,
- 'url' => dirname($file->mediaUrl()) . '/' . $thumbName,
- ]);
- },
+ return new FileVersion([
+ 'modifications' => $options,
+ 'original' => $file,
+ 'root' => $thumbRoot,
+ 'url' => dirname($file->mediaUrl()) . '/' . $thumbName,
+ ]);
+ },
- /**
- * Used by the `js()` helper
- *
- * @param \Kirby\Cms\App $kirby Kirby instance
- * @param string $url Relative or absolute URL
- * @param string|array $options An array of attributes for the link tag or a media attribute string
- */
- 'js' => fn (App $kirby, string $url, $options = null): string => $url,
+ /**
+ * Used by the `js()` helper
+ *
+ * @param \Kirby\Cms\App $kirby Kirby instance
+ * @param string $url Relative or absolute URL
+ * @param string|array $options An array of attributes for the link tag or a media attribute string
+ */
+ 'js' => fn (App $kirby, string $url, $options = null): string => $url,
- /**
- * Add your own Markdown parser
- *
- * @param \Kirby\Cms\App $kirby Kirby instance
- * @param string $text Text to parse
- * @param array $options Markdown options
- * @param bool $inline Whether to wrap the text in `` tags (deprecated: set via $options['inline'] instead)
- * @return string
- * @todo remove $inline parameter in in 3.8.0
- */
- 'markdown' => function (App $kirby, string $text = null, array $options = [], bool $inline = false): string {
- static $markdown;
- static $config;
+ /**
+ * Add your own Markdown parser
+ *
+ * @param \Kirby\Cms\App $kirby Kirby instance
+ * @param string $text Text to parse
+ * @param array $options Markdown options
+ * @param bool $inline Whether to wrap the text in `
` tags (deprecated: set via $options['inline'] instead)
+ * @return string
+ * @todo remove $inline parameter in in 3.8.0
+ */
+ 'markdown' => function (App $kirby, string $text = null, array $options = [], bool $inline = false): string {
+ static $markdown;
+ static $config;
- // warning for deprecated fourth parameter
- if (func_num_args() === 4 && isset($options['inline']) === false) {
- // @codeCoverageIgnoreStart
- Helpers::deprecated('markdown component: the $inline parameter is deprecated and will be removed in Kirby 3.8.0. Use $options[\'inline\'] instead.');
- // @codeCoverageIgnoreEnd
- }
+ // warning for deprecated fourth parameter
+ if (func_num_args() === 4 && isset($options['inline']) === false) {
+ // @codeCoverageIgnoreStart
+ Helpers::deprecated('markdown component: the $inline parameter is deprecated and will be removed in Kirby 3.8.0. Use $options[\'inline\'] instead.');
+ // @codeCoverageIgnoreEnd
+ }
- // support for the deprecated fourth argument
- $options['inline'] ??= $inline;
+ // support for the deprecated fourth argument
+ $options['inline'] ??= $inline;
- // if the config options have changed or the component is called for the first time,
- // (re-)initialize the parser object
- if ($config !== $options) {
- $markdown = new Markdown($options);
- $config = $options;
- }
+ // if the config options have changed or the component is called for the first time,
+ // (re-)initialize the parser object
+ if ($config !== $options) {
+ $markdown = new Markdown($options);
+ $config = $options;
+ }
- return $markdown->parse($text, $options['inline'] ?? false);
- },
+ return $markdown->parse($text, $options['inline'] ?? false);
+ },
- /**
- * Add your own search engine
- *
- * @param \Kirby\Cms\App $kirby Kirby instance
- * @param \Kirby\Cms\Collection $collection Collection of searchable models
- * @param string $query
- * @param mixed $params
- * @return \Kirby\Cms\Collection|bool
- */
- 'search' => function (App $kirby, Collection $collection, string $query = null, $params = []) {
- if (empty(trim($query ?? '')) === true) {
- return $collection->limit(0);
- }
+ /**
+ * Add your own search engine
+ *
+ * @param \Kirby\Cms\App $kirby Kirby instance
+ * @param \Kirby\Cms\Collection $collection Collection of searchable models
+ * @param string $query
+ * @param mixed $params
+ * @return \Kirby\Cms\Collection|bool
+ */
+ 'search' => function (App $kirby, Collection $collection, string $query = null, $params = []) {
+ if (empty(trim($query ?? '')) === true) {
+ return $collection->limit(0);
+ }
- if (is_string($params) === true) {
- $params = ['fields' => Str::split($params, '|')];
- }
+ if (is_string($params) === true) {
+ $params = ['fields' => Str::split($params, '|')];
+ }
- $defaults = [
- 'fields' => [],
- 'minlength' => 2,
- 'score' => [],
- 'words' => false,
- ];
+ $defaults = [
+ 'fields' => [],
+ 'minlength' => 2,
+ 'score' => [],
+ 'words' => false,
+ ];
- $options = array_merge($defaults, $params);
- $collection = clone $collection;
- $searchWords = preg_replace('/(\s)/u', ',', $query);
- $searchWords = Str::split($searchWords, ',', $options['minlength']);
- $lowerQuery = Str::lower($query);
- $exactQuery = $options['words'] ? '(\b' . preg_quote($query) . '\b)' : preg_quote($query);
+ $options = array_merge($defaults, $params);
+ $collection = clone $collection;
+ $searchWords = preg_replace('/(\s)/u', ',', $query);
+ $searchWords = Str::split($searchWords, ',', $options['minlength']);
+ $lowerQuery = Str::lower($query);
+ $exactQuery = $options['words'] ? '(\b' . preg_quote($query) . '\b)' : preg_quote($query);
- if (empty($options['stopwords']) === false) {
- $searchWords = array_diff($searchWords, $options['stopwords']);
- }
+ if (empty($options['stopwords']) === false) {
+ $searchWords = array_diff($searchWords, $options['stopwords']);
+ }
- $searchWords = array_map(function ($value) use ($options) {
- return $options['words'] ? '\b' . preg_quote($value) . '\b' : preg_quote($value);
- }, $searchWords);
+ $searchWords = array_map(function ($value) use ($options) {
+ return $options['words'] ? '\b' . preg_quote($value) . '\b' : preg_quote($value);
+ }, $searchWords);
- $preg = '!(' . implode('|', $searchWords) . ')!i';
- $results = $collection->filter(function ($item) use ($query, $preg, $options, $lowerQuery, $exactQuery) {
- $data = $item->content()->toArray();
- $keys = array_keys($data);
- $keys[] = 'id';
+ $preg = '!(' . implode('|', $searchWords) . ')!i';
+ $results = $collection->filter(function ($item) use ($query, $preg, $options, $lowerQuery, $exactQuery) {
+ $data = $item->content()->toArray();
+ $keys = array_keys($data);
+ $keys[] = 'id';
- if (is_a($item, 'Kirby\Cms\User') === true) {
- $keys[] = 'name';
- $keys[] = 'email';
- $keys[] = 'role';
- } elseif (is_a($item, 'Kirby\Cms\Page') === true) {
- // apply the default score for pages
- $options['score'] = array_merge([
- 'id' => 64,
- 'title' => 64,
- ], $options['score']);
- }
+ if (is_a($item, 'Kirby\Cms\User') === true) {
+ $keys[] = 'name';
+ $keys[] = 'email';
+ $keys[] = 'role';
+ } elseif (is_a($item, 'Kirby\Cms\Page') === true) {
+ // apply the default score for pages
+ $options['score'] = array_merge([
+ 'id' => 64,
+ 'title' => 64,
+ ], $options['score']);
+ }
- if (empty($options['fields']) === false) {
- $fields = array_map('strtolower', $options['fields']);
- $keys = array_intersect($keys, $fields);
- }
+ if (empty($options['fields']) === false) {
+ $fields = array_map('strtolower', $options['fields']);
+ $keys = array_intersect($keys, $fields);
+ }
- $item->searchHits = 0;
- $item->searchScore = 0;
+ $item->searchHits = 0;
+ $item->searchScore = 0;
- foreach ($keys as $key) {
- $score = $options['score'][$key] ?? 1;
- $value = $data[$key] ?? (string)$item->$key();
+ foreach ($keys as $key) {
+ $score = $options['score'][$key] ?? 1;
+ $value = $data[$key] ?? (string)$item->$key();
- $lowerValue = Str::lower($value);
+ $lowerValue = Str::lower($value);
- // check for exact matches
- if ($lowerQuery == $lowerValue) {
- $item->searchScore += 16 * $score;
- $item->searchHits += 1;
+ // check for exact matches
+ if ($lowerQuery == $lowerValue) {
+ $item->searchScore += 16 * $score;
+ $item->searchHits += 1;
- // check for exact beginning matches
- } elseif ($options['words'] === false && Str::startsWith($lowerValue, $lowerQuery) === true) {
- $item->searchScore += 8 * $score;
- $item->searchHits += 1;
+ // check for exact beginning matches
+ } elseif ($options['words'] === false && Str::startsWith($lowerValue, $lowerQuery) === true) {
+ $item->searchScore += 8 * $score;
+ $item->searchHits += 1;
- // check for exact query matches
- } elseif ($matches = preg_match_all('!' . $exactQuery . '!i', $value, $r)) {
- $item->searchScore += 2 * $score;
- $item->searchHits += $matches;
- }
+ // check for exact query matches
+ } elseif ($matches = preg_match_all('!' . $exactQuery . '!i', $value, $r)) {
+ $item->searchScore += 2 * $score;
+ $item->searchHits += $matches;
+ }
- // check for any match
- if ($matches = preg_match_all($preg, $value, $r)) {
- $item->searchHits += $matches;
- $item->searchScore += $matches * $score;
- }
- }
+ // check for any match
+ if ($matches = preg_match_all($preg, $value, $r)) {
+ $item->searchHits += $matches;
+ $item->searchScore += $matches * $score;
+ }
+ }
- return $item->searchHits > 0;
- });
+ return $item->searchHits > 0;
+ });
- return $results->sort('searchScore', 'desc');
- },
+ return $results->sort('searchScore', 'desc');
+ },
- /**
- * Add your own SmartyPants parser
- *
- * @param \Kirby\Cms\App $kirby Kirby instance
- * @param string $text Text to parse
- * @param array $options SmartyPants options
- * @return string
- */
- 'smartypants' => function (App $kirby, string $text = null, array $options = []): string {
- static $smartypants;
- static $config;
+ /**
+ * Add your own SmartyPants parser
+ *
+ * @param \Kirby\Cms\App $kirby Kirby instance
+ * @param string $text Text to parse
+ * @param array $options SmartyPants options
+ * @return string
+ */
+ 'smartypants' => function (App $kirby, string $text = null, array $options = []): string {
+ static $smartypants;
+ static $config;
- // if the config options have changed or the component is called for the first time,
- // (re-)initialize the parser object
- if ($config !== $options) {
- $smartypants = new Smartypants($options);
- $config = $options;
- }
+ // if the config options have changed or the component is called for the first time,
+ // (re-)initialize the parser object
+ if ($config !== $options) {
+ $smartypants = new Smartypants($options);
+ $config = $options;
+ }
- return $smartypants->parse($text);
- },
+ return $smartypants->parse($text);
+ },
- /**
- * Add your own snippet loader
- *
- * @param \Kirby\Cms\App $kirby Kirby instance
- * @param string|array $name Snippet name
- * @param array $data Data array for the snippet
- * @return string|null
- */
- 'snippet' => function (App $kirby, $name, array $data = []): ?string {
- $snippets = A::wrap($name);
+ /**
+ * Add your own snippet loader
+ *
+ * @param \Kirby\Cms\App $kirby Kirby instance
+ * @param string|array $name Snippet name
+ * @param array $data Data array for the snippet
+ * @return string|null
+ */
+ 'snippet' => function (App $kirby, $name, array $data = []): ?string {
+ $snippets = A::wrap($name);
- foreach ($snippets as $name) {
- $name = (string)$name;
- $file = $kirby->root('snippets') . '/' . $name . '.php';
+ foreach ($snippets as $name) {
+ $name = (string)$name;
+ $file = $kirby->root('snippets') . '/' . $name . '.php';
- if (file_exists($file) === false) {
- $file = $kirby->extensions('snippets')[$name] ?? null;
- }
+ if (file_exists($file) === false) {
+ $file = $kirby->extensions('snippets')[$name] ?? null;
+ }
- if ($file) {
- break;
- }
- }
+ if ($file) {
+ break;
+ }
+ }
- return Snippet::load($file, $data);
- },
+ return Snippet::load($file, $data);
+ },
- /**
- * Add your own template engine
- *
- * @param \Kirby\Cms\App $kirby Kirby instance
- * @param string $name Template name
- * @param string $type Extension type
- * @param string $defaultType Default extension type
- * @return \Kirby\Cms\Template
- */
- 'template' => function (App $kirby, string $name, string $type = 'html', string $defaultType = 'html') {
- return new Template($name, $type, $defaultType);
- },
+ /**
+ * Add your own template engine
+ *
+ * @param \Kirby\Cms\App $kirby Kirby instance
+ * @param string $name Template name
+ * @param string $type Extension type
+ * @param string $defaultType Default extension type
+ * @return \Kirby\Cms\Template
+ */
+ 'template' => function (App $kirby, string $name, string $type = 'html', string $defaultType = 'html') {
+ return new Template($name, $type, $defaultType);
+ },
- /**
- * Add your own thumb generator
- *
- * @param \Kirby\Cms\App $kirby Kirby instance
- * @param string $src Root of the original file
- * @param string $dst Template string for the root to the desired destination
- * @param array $options All thumb options that should be applied: `width`, `height`, `crop`, `blur`, `grayscale`
- * @return string
- */
- 'thumb' => function (App $kirby, string $src, string $dst, array $options): string {
- $darkroom = Darkroom::factory(
- $kirby->option('thumbs.driver', 'gd'),
- $kirby->option('thumbs', [])
- );
- $options = $darkroom->preprocess($src, $options);
- $root = (new Filename($src, $dst, $options))->toString();
+ /**
+ * Add your own thumb generator
+ *
+ * @param \Kirby\Cms\App $kirby Kirby instance
+ * @param string $src Root of the original file
+ * @param string $dst Template string for the root to the desired destination
+ * @param array $options All thumb options that should be applied: `width`, `height`, `crop`, `blur`, `grayscale`
+ * @return string
+ */
+ 'thumb' => function (App $kirby, string $src, string $dst, array $options): string {
+ $darkroom = Darkroom::factory(
+ $kirby->option('thumbs.driver', 'gd'),
+ $kirby->option('thumbs', [])
+ );
+ $options = $darkroom->preprocess($src, $options);
+ $root = (new Filename($src, $dst, $options))->toString();
- F::copy($src, $root, true);
- $darkroom->process($root, $options);
+ F::copy($src, $root, true);
+ $darkroom->process($root, $options);
- return $root;
- },
+ return $root;
+ },
- /**
- * Modify all URLs
- *
- * @param \Kirby\Cms\App $kirby Kirby instance
- * @param string|null $path URL path
- * @param array|string|null $options Array of options for the Uri class
- * @return string
- */
- 'url' => function (App $kirby, string $path = null, $options = null): string {
- $language = null;
+ /**
+ * Modify all URLs
+ *
+ * @param \Kirby\Cms\App $kirby Kirby instance
+ * @param string|null $path URL path
+ * @param array|string|null $options Array of options for the Uri class
+ * @return string
+ */
+ 'url' => function (App $kirby, string $path = null, $options = null): string {
+ $language = null;
- // get language from simple string option
- if (is_string($options) === true) {
- $language = $options;
- $options = null;
- }
+ // get language from simple string option
+ if (is_string($options) === true) {
+ $language = $options;
+ $options = null;
+ }
- // get language from array
- if (is_array($options) === true && isset($options['language']) === true) {
- $language = $options['language'];
- unset($options['language']);
- }
+ // get language from array
+ if (is_array($options) === true && isset($options['language']) === true) {
+ $language = $options['language'];
+ unset($options['language']);
+ }
- // get a language url for the linked page, if the page can be found
- if ($kirby->multilang() === true) {
- $parts = Str::split($path, '#');
+ // get a language url for the linked page, if the page can be found
+ if ($kirby->multilang() === true) {
+ $parts = Str::split($path, '#');
- if ($parts[0] ?? null) {
- $page = $kirby->site()->find($parts[0]);
- } else {
- $page = $kirby->site()->page();
- }
+ if ($parts[0] ?? null) {
+ $page = $kirby->site()->find($parts[0]);
+ } else {
+ $page = $kirby->site()->page();
+ }
- if ($page) {
- $path = $page->url($language);
+ if ($page) {
+ $path = $page->url($language);
- if (isset($parts[1]) === true) {
- $path .= '#' . $parts[1];
- }
- }
- }
+ if (isset($parts[1]) === true) {
+ $path .= '#' . $parts[1];
+ }
+ }
+ }
- // keep relative urls
- if (
- $path !== null &&
- (substr($path, 0, 2) === './' || substr($path, 0, 3) === '../')
- ) {
- return $path;
- }
+ // keep relative urls
+ if (
+ $path !== null &&
+ (substr($path, 0, 2) === './' || substr($path, 0, 3) === '../')
+ ) {
+ return $path;
+ }
- $url = Url::makeAbsolute($path, $kirby->url());
+ $url = Url::makeAbsolute($path, $kirby->url());
- if ($options === null) {
- return $url;
- }
+ if ($options === null) {
+ return $url;
+ }
- return (new Uri($url, $options))->toString();
- },
+ return (new Uri($url, $options))->toString();
+ },
];
diff --git a/kirby/config/fields/checkboxes.php b/kirby/config/fields/checkboxes.php
index 6837b45..c8d962d 100755
--- a/kirby/config/fields/checkboxes.php
+++ b/kirby/config/fields/checkboxes.php
@@ -4,58 +4,58 @@ use Kirby\Toolkit\A;
use Kirby\Toolkit\Str;
return [
- 'mixins' => ['min', 'options'],
- 'props' => [
- /**
- * Unset inherited props
- */
- 'after' => null,
- 'before' => null,
- 'icon' => null,
- 'placeholder' => null,
+ 'mixins' => ['min', 'options'],
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'after' => null,
+ 'before' => null,
+ 'icon' => null,
+ 'placeholder' => null,
- /**
- * Arranges the checkboxes in the given number of columns
- */
- 'columns' => function (int $columns = 1) {
- return $columns;
- },
- /**
- * Default value for the field, which will be used when a page/file/user is created
- */
- 'default' => function ($default = null) {
- return Str::split($default, ',');
- },
- /**
- * Maximum number of checked boxes
- */
- 'max' => function (int $max = null) {
- return $max;
- },
- /**
- * Minimum number of checked boxes
- */
- 'min' => function (int $min = null) {
- return $min;
- },
- 'value' => function ($value = null) {
- return Str::split($value, ',');
- },
- ],
- 'computed' => [
- 'default' => function () {
- return $this->sanitizeOptions($this->default);
- },
- 'value' => function () {
- return $this->sanitizeOptions($this->value);
- },
- ],
- 'save' => function ($value): string {
- return A::join($value, ', ');
- },
- 'validations' => [
- 'options',
- 'max',
- 'min'
- ]
+ /**
+ * Arranges the checkboxes in the given number of columns
+ */
+ 'columns' => function (int $columns = 1) {
+ return $columns;
+ },
+ /**
+ * Default value for the field, which will be used when a page/file/user is created
+ */
+ 'default' => function ($default = null) {
+ return Str::split($default, ',');
+ },
+ /**
+ * Maximum number of checked boxes
+ */
+ 'max' => function (int $max = null) {
+ return $max;
+ },
+ /**
+ * Minimum number of checked boxes
+ */
+ 'min' => function (int $min = null) {
+ return $min;
+ },
+ 'value' => function ($value = null) {
+ return Str::split($value, ',');
+ },
+ ],
+ 'computed' => [
+ 'default' => function () {
+ return $this->sanitizeOptions($this->default);
+ },
+ 'value' => function () {
+ return $this->sanitizeOptions($this->value);
+ },
+ ],
+ 'save' => function ($value): string {
+ return A::join($value, ', ');
+ },
+ 'validations' => [
+ 'options',
+ 'max',
+ 'min'
+ ]
];
diff --git a/kirby/config/fields/date.php b/kirby/config/fields/date.php
index e2124c4..ffb6dc4 100755
--- a/kirby/config/fields/date.php
+++ b/kirby/config/fields/date.php
@@ -7,148 +7,148 @@ use Kirby\Toolkit\I18n;
use Kirby\Toolkit\Str;
return [
- 'mixins' => ['datetime'],
- 'props' => [
- /**
- * Unset inherited props
- */
- 'placeholder' => null,
+ 'mixins' => ['datetime'],
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'placeholder' => null,
- /**
- * Activate/deactivate the dropdown calendar
- */
- 'calendar' => function (bool $calendar = true) {
- return $calendar;
- },
+ /**
+ * Activate/deactivate the dropdown calendar
+ */
+ 'calendar' => function (bool $calendar = true) {
+ return $calendar;
+ },
- /**
- * Default date when a new page/file/user gets created
- */
- 'default' => function (string $default = null): string {
- return $this->toDatetime($default) ?? '';
- },
+ /**
+ * Default date when a new page/file/user gets created
+ */
+ 'default' => function (string $default = null): string {
+ return $this->toDatetime($default) ?? '';
+ },
- /**
- * Custom format (dayjs tokens: `DD`, `MM`, `YYYY`) that is
- * used to display the field in the Panel
- */
- 'display' => function ($display = 'YYYY-MM-DD') {
- return I18n::translate($display, $display);
- },
+ /**
+ * Custom format (dayjs tokens: `DD`, `MM`, `YYYY`) that is
+ * used to display the field in the Panel
+ */
+ 'display' => function ($display = 'YYYY-MM-DD') {
+ return I18n::translate($display, $display);
+ },
- /**
- * Changes the calendar icon to something custom
- */
- 'icon' => function (string $icon = 'calendar') {
- return $icon;
- },
+ /**
+ * Changes the calendar icon to something custom
+ */
+ 'icon' => function (string $icon = 'calendar') {
+ return $icon;
+ },
- /**
- * Latest date, which can be selected/saved (Y-m-d)
- */
- 'max' => function (string $max = null): ?string {
- return Date::optional($max);
- },
- /**
- * Earliest date, which can be selected/saved (Y-m-d)
- */
- 'min' => function (string $min = null): ?string {
- return Date::optional($min);
- },
+ /**
+ * Latest date, which can be selected/saved (Y-m-d)
+ */
+ 'max' => function (string $max = null): ?string {
+ return Date::optional($max);
+ },
+ /**
+ * Earliest date, which can be selected/saved (Y-m-d)
+ */
+ 'min' => function (string $min = null): ?string {
+ return Date::optional($min);
+ },
- /**
- * Round to the nearest: sub-options for `unit` (day) and `size` (1)
- */
- 'step' => function ($step = null) {
- return $step;
- },
+ /**
+ * Round to the nearest: sub-options for `unit` (day) and `size` (1)
+ */
+ 'step' => function ($step = null) {
+ return $step;
+ },
- /**
- * Pass `true` or an array of time field options to show the time selector.
- */
- 'time' => function ($time = false) {
- return $time;
- },
- /**
- * Must be a parseable date string
- */
- 'value' => function ($value = null) {
- return $value;
- }
- ],
- 'computed' => [
- 'display' => function () {
- if ($this->display) {
- return Str::upper($this->display);
- }
- },
- 'format' => function () {
- return $this->props['format'] ?? ($this->time === false ? 'Y-m-d' : 'Y-m-d H:i:s');
- },
- 'time' => function () {
- if ($this->time === false) {
- return false;
- }
+ /**
+ * Pass `true` or an array of time field options to show the time selector.
+ */
+ 'time' => function ($time = false) {
+ return $time;
+ },
+ /**
+ * Must be a parseable date string
+ */
+ 'value' => function ($value = null) {
+ return $value;
+ }
+ ],
+ 'computed' => [
+ 'display' => function () {
+ if ($this->display) {
+ return Str::upper($this->display);
+ }
+ },
+ 'format' => function () {
+ return $this->props['format'] ?? ($this->time === false ? 'Y-m-d' : 'Y-m-d H:i:s');
+ },
+ 'time' => function () {
+ if ($this->time === false) {
+ return false;
+ }
- $props = is_array($this->time) ? $this->time : [];
- $props['model'] = $this->model();
- $field = new Field('time', $props);
- return $field->toArray();
- },
- 'step' => function () {
- if ($this->time === false || empty($this->time['step']) === true) {
- return Date::stepConfig($this->step, [
- 'size' => 1,
- 'unit' => 'day'
- ]);
- }
+ $props = is_array($this->time) ? $this->time : [];
+ $props['model'] = $this->model();
+ $field = new Field('time', $props);
+ return $field->toArray();
+ },
+ 'step' => function () {
+ if ($this->time === false || empty($this->time['step']) === true) {
+ return Date::stepConfig($this->step, [
+ 'size' => 1,
+ 'unit' => 'day'
+ ]);
+ }
- return Date::stepConfig($this->time['step'], [
- 'size' => 5,
- 'unit' => 'minute'
- ]);
- },
- 'value' => function (): string {
- return $this->toDatetime($this->value) ?? '';
- },
- ],
- 'validations' => [
- 'date',
- 'minMax' => function ($value) {
- if (!$value = Date::optional($value)) {
- return true;
- }
+ return Date::stepConfig($this->time['step'], [
+ 'size' => 5,
+ 'unit' => 'minute'
+ ]);
+ },
+ 'value' => function (): string {
+ return $this->toDatetime($this->value) ?? '';
+ },
+ ],
+ 'validations' => [
+ 'date',
+ 'minMax' => function ($value) {
+ if (!$value = Date::optional($value)) {
+ return true;
+ }
- $min = Date::optional($this->min);
- $max = Date::optional($this->max);
+ $min = Date::optional($this->min);
+ $max = Date::optional($this->max);
- $format = $this->time === false ? 'd.m.Y' : 'd.m.Y H:i';
+ $format = $this->time === false ? 'd.m.Y' : 'd.m.Y H:i';
- if ($min && $max && $value->isBetween($min, $max) === false) {
- throw new Exception([
- 'key' => 'validation.date.between',
- 'data' => [
- 'min' => $min->format($format),
- 'max' => $min->format($format)
- ]
- ]);
- } elseif ($min && $value->isMin($min) === false) {
- throw new Exception([
- 'key' => 'validation.date.after',
- 'data' => [
- 'date' => $min->format($format),
- ]
- ]);
- } elseif ($max && $value->isMax($max) === false) {
- throw new Exception([
- 'key' => 'validation.date.before',
- 'data' => [
- 'date' => $max->format($format),
- ]
- ]);
- }
+ if ($min && $max && $value->isBetween($min, $max) === false) {
+ throw new Exception([
+ 'key' => 'validation.date.between',
+ 'data' => [
+ 'min' => $min->format($format),
+ 'max' => $min->format($format)
+ ]
+ ]);
+ } elseif ($min && $value->isMin($min) === false) {
+ throw new Exception([
+ 'key' => 'validation.date.after',
+ 'data' => [
+ 'date' => $min->format($format),
+ ]
+ ]);
+ } elseif ($max && $value->isMax($max) === false) {
+ throw new Exception([
+ 'key' => 'validation.date.before',
+ 'data' => [
+ 'date' => $max->format($format),
+ ]
+ ]);
+ }
- return true;
- },
- ]
+ return true;
+ },
+ ]
];
diff --git a/kirby/config/fields/email.php b/kirby/config/fields/email.php
index e7892b8..5c4630f 100755
--- a/kirby/config/fields/email.php
+++ b/kirby/config/fields/email.php
@@ -3,38 +3,38 @@
use Kirby\Toolkit\I18n;
return [
- 'extends' => 'text',
- 'props' => [
- /**
- * Unset inherited props
- */
- 'converter' => null,
- 'counter' => null,
+ 'extends' => 'text',
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'converter' => null,
+ 'counter' => null,
- /**
- * Sets the HTML5 autocomplete mode for the input
- */
- 'autocomplete' => function (string $autocomplete = 'email') {
- return $autocomplete;
- },
+ /**
+ * Sets the HTML5 autocomplete mode for the input
+ */
+ 'autocomplete' => function (string $autocomplete = 'email') {
+ return $autocomplete;
+ },
- /**
- * Changes the email icon to something custom
- */
- 'icon' => function (string $icon = 'email') {
- return $icon;
- },
+ /**
+ * Changes the email icon to something custom
+ */
+ 'icon' => function (string $icon = 'email') {
+ return $icon;
+ },
- /**
- * Custom placeholder text, when the field is empty.
- */
- 'placeholder' => function ($value = null) {
- return I18n::translate($value, $value) ?? I18n::translate('email.placeholder');
- }
- ],
- 'validations' => [
- 'minlength',
- 'maxlength',
- 'email'
- ]
+ /**
+ * Custom placeholder text, when the field is empty.
+ */
+ 'placeholder' => function ($value = null) {
+ return I18n::translate($value, $value) ?? I18n::translate('email.placeholder');
+ }
+ ],
+ 'validations' => [
+ 'minlength',
+ 'maxlength',
+ 'email'
+ ]
];
diff --git a/kirby/config/fields/files.php b/kirby/config/fields/files.php
index 10fa851..5fef3e2 100755
--- a/kirby/config/fields/files.php
+++ b/kirby/config/fields/files.php
@@ -4,128 +4,128 @@ use Kirby\Data\Data;
use Kirby\Toolkit\A;
return [
- 'mixins' => [
- 'filepicker',
- 'layout',
- 'min',
- 'picker',
- 'upload'
- ],
- 'props' => [
- /**
- * Unset inherited props
- */
- 'after' => null,
- 'before' => null,
- 'autofocus' => null,
- 'icon' => null,
- 'placeholder' => null,
+ 'mixins' => [
+ 'filepicker',
+ 'layout',
+ 'min',
+ 'picker',
+ 'upload'
+ ],
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'after' => null,
+ 'before' => null,
+ 'autofocus' => null,
+ 'icon' => null,
+ 'placeholder' => null,
- /**
- * Sets the file(s), which are selected by default when a new page is created
- */
- 'default' => function ($default = null) {
- return $default;
- },
+ /**
+ * Sets the file(s), which are selected by default when a new page is created
+ */
+ 'default' => function ($default = null) {
+ return $default;
+ },
- 'value' => function ($value = null) {
- return $value;
- }
- ],
- 'computed' => [
- 'parentModel' => function () {
- if (is_string($this->parent) === true && $model = $this->model()->query($this->parent, 'Kirby\Cms\Model')) {
- return $model;
- }
+ 'value' => function ($value = null) {
+ return $value;
+ }
+ ],
+ 'computed' => [
+ 'parentModel' => function () {
+ if (is_string($this->parent) === true && $model = $this->model()->query($this->parent, 'Kirby\Cms\Model')) {
+ return $model;
+ }
- return $this->model();
- },
- 'parent' => function () {
- return $this->parentModel->apiUrl(true);
- },
- 'query' => function () {
- return $this->query ?? $this->parentModel::CLASS_ALIAS . '.files';
- },
- 'default' => function () {
- return $this->toFiles($this->default);
- },
- 'value' => function () {
- return $this->toFiles($this->value);
- },
- ],
- 'methods' => [
- 'fileResponse' => function ($file) {
- return $file->panel()->pickerData([
- 'image' => $this->image,
- 'info' => $this->info ?? false,
- 'layout' => $this->layout,
- 'model' => $this->model(),
- 'text' => $this->text,
- ]);
- },
- 'toFiles' => function ($value = null) {
- $files = [];
+ return $this->model();
+ },
+ 'parent' => function () {
+ return $this->parentModel->apiUrl(true);
+ },
+ 'query' => function () {
+ return $this->query ?? $this->parentModel::CLASS_ALIAS . '.files';
+ },
+ 'default' => function () {
+ return $this->toFiles($this->default);
+ },
+ 'value' => function () {
+ return $this->toFiles($this->value);
+ },
+ ],
+ 'methods' => [
+ 'fileResponse' => function ($file) {
+ return $file->panel()->pickerData([
+ 'image' => $this->image,
+ 'info' => $this->info ?? false,
+ 'layout' => $this->layout,
+ 'model' => $this->model(),
+ 'text' => $this->text,
+ ]);
+ },
+ 'toFiles' => function ($value = null) {
+ $files = [];
- foreach (Data::decode($value, 'yaml') as $id) {
- if (is_array($id) === true) {
- $id = $id['id'] ?? null;
- }
+ foreach (Data::decode($value, 'yaml') as $id) {
+ if (is_array($id) === true) {
+ $id = $id['id'] ?? null;
+ }
- if ($id !== null && ($file = $this->kirby()->file($id, $this->model()))) {
- $files[] = $this->fileResponse($file);
- }
- }
+ if ($id !== null && ($file = $this->kirby()->file($id, $this->model()))) {
+ $files[] = $this->fileResponse($file);
+ }
+ }
- return $files;
- }
- ],
- 'api' => function () {
- return [
- [
- 'pattern' => '/',
- 'action' => function () {
- $field = $this->field();
+ return $files;
+ }
+ ],
+ 'api' => function () {
+ return [
+ [
+ 'pattern' => '/',
+ 'action' => function () {
+ $field = $this->field();
- return $field->filepicker([
- 'image' => $field->image(),
- 'info' => $field->info(),
- 'layout' => $field->layout(),
- 'limit' => $field->limit(),
- 'page' => $this->requestQuery('page'),
- 'query' => $field->query(),
- 'search' => $this->requestQuery('search'),
- 'text' => $field->text()
- ]);
- }
- ],
- [
- 'pattern' => 'upload',
- 'method' => 'POST',
- 'action' => function () {
- $field = $this->field();
- $uploads = $field->uploads();
+ return $field->filepicker([
+ 'image' => $field->image(),
+ 'info' => $field->info(),
+ 'layout' => $field->layout(),
+ 'limit' => $field->limit(),
+ 'page' => $this->requestQuery('page'),
+ 'query' => $field->query(),
+ 'search' => $this->requestQuery('search'),
+ 'text' => $field->text()
+ ]);
+ }
+ ],
+ [
+ 'pattern' => 'upload',
+ 'method' => 'POST',
+ 'action' => function () {
+ $field = $this->field();
+ $uploads = $field->uploads();
- // move_uploaded_file() not working with unit test
- // @codeCoverageIgnoreStart
- return $field->upload($this, $uploads, function ($file, $parent) use ($field) {
- return $file->panel()->pickerData([
- 'image' => $field->image(),
- 'info' => $field->info(),
- 'layout' => $field->layout(),
- 'model' => $field->model(),
- 'text' => $field->text(),
- ]);
- });
- // @codeCoverageIgnoreEnd
- }
- ]
- ];
- },
- 'save' => function ($value = null) {
- return A::pluck($value, 'uuid');
- },
- 'validations' => [
- 'max',
- 'min'
- ]
+ // move_uploaded_file() not working with unit test
+ // @codeCoverageIgnoreStart
+ return $field->upload($this, $uploads, function ($file, $parent) use ($field) {
+ return $file->panel()->pickerData([
+ 'image' => $field->image(),
+ 'info' => $field->info(),
+ 'layout' => $field->layout(),
+ 'model' => $field->model(),
+ 'text' => $field->text(),
+ ]);
+ });
+ // @codeCoverageIgnoreEnd
+ }
+ ]
+ ];
+ },
+ 'save' => function ($value = null) {
+ return A::pluck($value, 'uuid');
+ },
+ 'validations' => [
+ 'max',
+ 'min'
+ ]
];
diff --git a/kirby/config/fields/gap.php b/kirby/config/fields/gap.php
index 6844d6c..b2dbd70 100755
--- a/kirby/config/fields/gap.php
+++ b/kirby/config/fields/gap.php
@@ -1,5 +1,5 @@
false
+ 'save' => false
];
diff --git a/kirby/config/fields/headline.php b/kirby/config/fields/headline.php
index c87dd53..01994ad 100755
--- a/kirby/config/fields/headline.php
+++ b/kirby/config/fields/headline.php
@@ -1,26 +1,26 @@
false,
- 'props' => [
- /**
- * Unset inherited props
- */
- 'after' => null,
- 'autofocus' => null,
- 'before' => null,
- 'default' => null,
- 'disabled' => null,
- 'icon' => null,
- 'placeholder' => null,
- 'required' => null,
- 'translate' => null,
+ 'save' => false,
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'after' => null,
+ 'autofocus' => null,
+ 'before' => null,
+ 'default' => null,
+ 'disabled' => null,
+ 'icon' => null,
+ 'placeholder' => null,
+ 'required' => null,
+ 'translate' => null,
- /**
- * If `false`, the prepended number will be hidden
- */
- 'numbered' => function (bool $numbered = true) {
- return $numbered;
- }
- ]
+ /**
+ * If `false`, the prepended number will be hidden
+ */
+ 'numbered' => function (bool $numbered = true) {
+ return $numbered;
+ }
+ ]
];
diff --git a/kirby/config/fields/info.php b/kirby/config/fields/info.php
index dcf174b..4df8ed3 100755
--- a/kirby/config/fields/info.php
+++ b/kirby/config/fields/info.php
@@ -3,42 +3,42 @@
use Kirby\Toolkit\I18n;
return [
- 'props' => [
- /**
- * Unset inherited props
- */
- 'after' => null,
- 'autofocus' => null,
- 'before' => null,
- 'default' => null,
- 'disabled' => null,
- 'icon' => null,
- 'placeholder' => null,
- 'required' => null,
- 'translate' => null,
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'after' => null,
+ 'autofocus' => null,
+ 'before' => null,
+ 'default' => null,
+ 'disabled' => null,
+ 'icon' => null,
+ 'placeholder' => null,
+ 'required' => null,
+ 'translate' => null,
- /**
- * Text to be displayed
- */
- 'text' => function ($value = null) {
- return I18n::translate($value, $value);
- },
+ /**
+ * Text to be displayed
+ */
+ 'text' => function ($value = null) {
+ return I18n::translate($value, $value);
+ },
- /**
- * Change the design of the info box
- */
- 'theme' => function (string $theme = null) {
- return $theme;
- }
- ],
- 'computed' => [
- 'text' => function () {
- if ($text = $this->text) {
- $text = $this->model()->toSafeString($text);
- $text = $this->kirby()->kirbytext($text);
- return $text;
- }
- }
- ],
- 'save' => false,
+ /**
+ * Change the design of the info box
+ */
+ 'theme' => function (string $theme = null) {
+ return $theme;
+ }
+ ],
+ 'computed' => [
+ 'text' => function () {
+ if ($text = $this->text) {
+ $text = $this->model()->toSafeString($text);
+ $text = $this->kirby()->kirbytext($text);
+ return $text;
+ }
+ }
+ ],
+ 'save' => false,
];
diff --git a/kirby/config/fields/line.php b/kirby/config/fields/line.php
index 6844d6c..b2dbd70 100755
--- a/kirby/config/fields/line.php
+++ b/kirby/config/fields/line.php
@@ -1,5 +1,5 @@
false
+ 'save' => false
];
diff --git a/kirby/config/fields/list.php b/kirby/config/fields/list.php
index c4d886f..74493a7 100755
--- a/kirby/config/fields/list.php
+++ b/kirby/config/fields/list.php
@@ -1,17 +1,17 @@
[
- /**
- * Sets the allowed HTML formats. Available formats: `bold`, `italic`, `underline`, `strike`, `code`, `link`. Activate them all by passing `true`. Deactivate them all by passing `false`
- */
- 'marks' => function ($marks = true) {
- return $marks;
- }
- ],
- 'computed' => [
- 'value' => function () {
- return trim($this->value ?? '');
- }
- ]
+ 'props' => [
+ /**
+ * Sets the allowed HTML formats. Available formats: `bold`, `italic`, `underline`, `strike`, `code`, `link`. Activate them all by passing `true`. Deactivate them all by passing `false`
+ */
+ 'marks' => function ($marks = true) {
+ return $marks;
+ }
+ ],
+ 'computed' => [
+ 'value' => function () {
+ return trim($this->value ?? '');
+ }
+ ]
];
diff --git a/kirby/config/fields/mixins/datetime.php b/kirby/config/fields/mixins/datetime.php
index 8a2125f..b47a865 100755
--- a/kirby/config/fields/mixins/datetime.php
+++ b/kirby/config/fields/mixins/datetime.php
@@ -3,33 +3,33 @@
use Kirby\Toolkit\Date;
return [
- 'props' => [
- /**
- * Defines a custom format that is used when the field is saved
- */
- 'format' => function (string $format = null) {
- return $format;
- }
- ],
- 'methods' => [
- 'toDatetime' => function ($value, string $format = 'Y-m-d H:i:s') {
- if ($date = Date::optional($value)) {
- if ($this->step) {
- $step = Date::stepConfig($this->step);
- $date->round($step['unit'], $step['size']);
- }
+ 'props' => [
+ /**
+ * Defines a custom format that is used when the field is saved
+ */
+ 'format' => function (string $format = null) {
+ return $format;
+ }
+ ],
+ 'methods' => [
+ 'toDatetime' => function ($value, string $format = 'Y-m-d H:i:s') {
+ if ($date = Date::optional($value)) {
+ if ($this->step) {
+ $step = Date::stepConfig($this->step);
+ $date->round($step['unit'], $step['size']);
+ }
- return $date->format($format);
- }
+ return $date->format($format);
+ }
- return null;
- }
- ],
- 'save' => function ($value) {
- if ($date = Date::optional($value)) {
- return $date->format($this->format);
- }
+ return null;
+ }
+ ],
+ 'save' => function ($value) {
+ if ($date = Date::optional($value)) {
+ return $date->format($this->format);
+ }
- return '';
- },
+ return '';
+ },
];
diff --git a/kirby/config/fields/mixins/filepicker.php b/kirby/config/fields/mixins/filepicker.php
index ba81230..092adc9 100755
--- a/kirby/config/fields/mixins/filepicker.php
+++ b/kirby/config/fields/mixins/filepicker.php
@@ -3,12 +3,12 @@
use Kirby\Cms\FilePicker;
return [
- 'methods' => [
- 'filepicker' => function (array $params = []) {
- // fetch the parent model
- $params['model'] = $this->model();
+ 'methods' => [
+ 'filepicker' => function (array $params = []) {
+ // fetch the parent model
+ $params['model'] = $this->model();
- return (new FilePicker($params))->toArray();
- }
- ]
+ return (new FilePicker($params))->toArray();
+ }
+ ]
];
diff --git a/kirby/config/fields/mixins/layout.php b/kirby/config/fields/mixins/layout.php
index 3fdb1eb..4ac0138 100755
--- a/kirby/config/fields/mixins/layout.php
+++ b/kirby/config/fields/mixins/layout.php
@@ -1,21 +1,21 @@
[
- /**
- * Changes the layout of the selected entries.
- * Available layouts: `list`, `cardlets`, `cards`
- */
- 'layout' => function (string $layout = 'list') {
- $layouts = ['list', 'cardlets', 'cards'];
- return in_array($layout, $layouts) ? $layout : 'list';
- },
+ 'props' => [
+ /**
+ * Changes the layout of the selected entries.
+ * Available layouts: `list`, `cardlets`, `cards`
+ */
+ 'layout' => function (string $layout = 'list') {
+ $layouts = ['list', 'cardlets', 'cards'];
+ return in_array($layout, $layouts) ? $layout : 'list';
+ },
- /**
- * Layout size for cards: `tiny`, `small`, `medium`, `large` or `huge`
- */
- 'size' => function (string $size = 'auto') {
- return $size;
- },
- ]
+ /**
+ * Layout size for cards: `tiny`, `small`, `medium`, `large` or `huge`
+ */
+ 'size' => function (string $size = 'auto') {
+ return $size;
+ },
+ ]
];
diff --git a/kirby/config/fields/mixins/min.php b/kirby/config/fields/mixins/min.php
index 33e24d4..f5262ea 100755
--- a/kirby/config/fields/mixins/min.php
+++ b/kirby/config/fields/mixins/min.php
@@ -1,22 +1,22 @@
[
- 'min' => function () {
- // set min to at least 1, if required
- if ($this->required === true) {
- return $this->min ?? 1;
- }
+ 'computed' => [
+ 'min' => function () {
+ // set min to at least 1, if required
+ if ($this->required === true) {
+ return $this->min ?? 1;
+ }
- return $this->min;
- },
- 'required' => function () {
- // set required to true if min is set
- if ($this->min) {
- return true;
- }
+ return $this->min;
+ },
+ 'required' => function () {
+ // set required to true if min is set
+ if ($this->min) {
+ return true;
+ }
- return $this->required;
- }
- ]
+ return $this->required;
+ }
+ ]
];
diff --git a/kirby/config/fields/mixins/options.php b/kirby/config/fields/mixins/options.php
index 170761a..465ac50 100755
--- a/kirby/config/fields/mixins/options.php
+++ b/kirby/config/fields/mixins/options.php
@@ -3,46 +3,46 @@
use Kirby\Form\Options;
return [
- 'props' => [
- /**
- * API settings for options requests. This will only take affect when `options` is set to `api`.
- */
- 'api' => function ($api = null) {
- return $api;
- },
- /**
- * An array with options
- */
- 'options' => function ($options = []) {
- return $options;
- },
- /**
- * Query settings for options queries. This will only take affect when `options` is set to `query`.
- */
- 'query' => function ($query = null) {
- return $query;
- },
- ],
- 'computed' => [
- 'options' => function (): array {
- return $this->getOptions();
- }
- ],
- 'methods' => [
- 'getOptions' => function () {
- return Options::factory(
- $this->options(),
- $this->props,
- $this->model()
- );
- },
- 'sanitizeOption' => function ($option) {
- $allowed = array_column($this->options(), 'value');
- return in_array($option, $allowed, true) === true ? $option : null;
- },
- 'sanitizeOptions' => function ($options) {
- $allowed = array_column($this->options(), 'value');
- return array_intersect($options, $allowed);
- },
- ]
+ 'props' => [
+ /**
+ * API settings for options requests. This will only take affect when `options` is set to `api`.
+ */
+ 'api' => function ($api = null) {
+ return $api;
+ },
+ /**
+ * An array with options
+ */
+ 'options' => function ($options = []) {
+ return $options;
+ },
+ /**
+ * Query settings for options queries. This will only take affect when `options` is set to `query`.
+ */
+ 'query' => function ($query = null) {
+ return $query;
+ },
+ ],
+ 'computed' => [
+ 'options' => function (): array {
+ return $this->getOptions();
+ }
+ ],
+ 'methods' => [
+ 'getOptions' => function () {
+ return Options::factory(
+ $this->options(),
+ $this->props,
+ $this->model()
+ );
+ },
+ 'sanitizeOption' => function ($option) {
+ $allowed = array_column($this->options(), 'value');
+ return in_array($option, $allowed, true) === true ? $option : null;
+ },
+ 'sanitizeOptions' => function ($options) {
+ $allowed = array_column($this->options(), 'value');
+ return array_intersect($options, $allowed);
+ },
+ ]
];
diff --git a/kirby/config/fields/mixins/pagepicker.php b/kirby/config/fields/mixins/pagepicker.php
index bbdc86e..276d8c7 100755
--- a/kirby/config/fields/mixins/pagepicker.php
+++ b/kirby/config/fields/mixins/pagepicker.php
@@ -3,12 +3,12 @@
use Kirby\Cms\PagePicker;
return [
- 'methods' => [
- 'pagepicker' => function (array $params = []) {
- // inject the current model
- $params['model'] = $this->model();
+ 'methods' => [
+ 'pagepicker' => function (array $params = []) {
+ // inject the current model
+ $params['model'] = $this->model();
- return (new PagePicker($params))->toArray();
- }
- ]
+ return (new PagePicker($params))->toArray();
+ }
+ ]
];
diff --git a/kirby/config/fields/mixins/picker.php b/kirby/config/fields/mixins/picker.php
index c2660ad..97b4f8a 100755
--- a/kirby/config/fields/mixins/picker.php
+++ b/kirby/config/fields/mixins/picker.php
@@ -3,76 +3,76 @@
use Kirby\Toolkit\I18n;
return [
- 'props' => [
- /**
- * The placeholder text if none have been selected yet
- */
- 'empty' => function ($empty = null) {
- return I18n::translate($empty, $empty);
- },
+ 'props' => [
+ /**
+ * The placeholder text if none have been selected yet
+ */
+ 'empty' => function ($empty = null) {
+ return I18n::translate($empty, $empty);
+ },
- /**
- * Image settings for each item
- */
- 'image' => function ($image = null) {
- return $image;
- },
+ /**
+ * Image settings for each item
+ */
+ 'image' => function ($image = null) {
+ return $image;
+ },
- /**
- * Info text for each item
- */
- 'info' => function (string $info = null) {
- return $info;
- },
+ /**
+ * Info text for each item
+ */
+ 'info' => function (string $info = null) {
+ return $info;
+ },
- /**
- * Whether each item should be clickable
- */
- 'link' => function (bool $link = true) {
- return $link;
- },
+ /**
+ * Whether each item should be clickable
+ */
+ 'link' => function (bool $link = true) {
+ return $link;
+ },
- /**
- * The minimum number of required selected
- */
- 'min' => function (int $min = null) {
- return $min;
- },
+ /**
+ * The minimum number of required selected
+ */
+ 'min' => function (int $min = null) {
+ return $min;
+ },
- /**
- * The maximum number of allowed selected
- */
- 'max' => function (int $max = null) {
- return $max;
- },
+ /**
+ * The maximum number of allowed selected
+ */
+ 'max' => function (int $max = null) {
+ return $max;
+ },
- /**
- * If `false`, only a single one can be selected
- */
- 'multiple' => function (bool $multiple = true) {
- return $multiple;
- },
+ /**
+ * If `false`, only a single one can be selected
+ */
+ 'multiple' => function (bool $multiple = true) {
+ return $multiple;
+ },
- /**
- * Query for the items to be included in the picker
- */
- 'query' => function (string $query = null) {
- return $query;
- },
+ /**
+ * Query for the items to be included in the picker
+ */
+ 'query' => function (string $query = null) {
+ return $query;
+ },
- /**
- * Enable/disable the search field in the picker
- */
- 'search' => function (bool $search = true) {
- return $search;
- },
+ /**
+ * Enable/disable the search field in the picker
+ */
+ 'search' => function (bool $search = true) {
+ return $search;
+ },
- /**
- * Main text for each item
- */
- 'text' => function (string $text = null) {
- return $text;
- },
+ /**
+ * Main text for each item
+ */
+ 'text' => function (string $text = null) {
+ return $text;
+ },
- ],
+ ],
];
diff --git a/kirby/config/fields/mixins/upload.php b/kirby/config/fields/mixins/upload.php
index 1572ae4..166aeb1 100755
--- a/kirby/config/fields/mixins/upload.php
+++ b/kirby/config/fields/mixins/upload.php
@@ -5,69 +5,69 @@ use Kirby\Cms\File;
use Kirby\Exception\Exception;
return [
- 'props' => [
- /**
- * Sets the upload options for linked files (since 3.2.0)
- */
- 'uploads' => function ($uploads = []) {
- if ($uploads === false) {
- return false;
- }
+ 'props' => [
+ /**
+ * Sets the upload options for linked files (since 3.2.0)
+ */
+ 'uploads' => function ($uploads = []) {
+ if ($uploads === false) {
+ return false;
+ }
- if (is_string($uploads) === true) {
- $uploads = ['template' => $uploads];
- }
+ if (is_string($uploads) === true) {
+ $uploads = ['template' => $uploads];
+ }
- if (is_array($uploads) === false) {
- $uploads = [];
- }
+ if (is_array($uploads) === false) {
+ $uploads = [];
+ }
- $template = $uploads['template'] ?? null;
+ $template = $uploads['template'] ?? null;
- if ($template) {
- $file = new File([
- 'filename' => 'tmp',
- 'parent' => $this->model(),
- 'template' => $template
- ]);
+ if ($template) {
+ $file = new File([
+ 'filename' => 'tmp',
+ 'parent' => $this->model(),
+ 'template' => $template
+ ]);
- $uploads['accept'] = $file->blueprint()->acceptMime();
- } else {
- $uploads['accept'] = '*';
- }
+ $uploads['accept'] = $file->blueprint()->acceptMime();
+ } else {
+ $uploads['accept'] = '*';
+ }
- return $uploads;
- },
- ],
- 'methods' => [
- 'upload' => function (Api $api, $params, Closure $map) {
- if ($params === false) {
- throw new Exception('Uploads are disabled for this field');
- }
+ return $uploads;
+ },
+ ],
+ 'methods' => [
+ 'upload' => function (Api $api, $params, Closure $map) {
+ if ($params === false) {
+ throw new Exception('Uploads are disabled for this field');
+ }
- if ($parentQuery = ($params['parent'] ?? null)) {
- $parent = $this->model()->query($parentQuery);
- } else {
- $parent = $this->model();
- }
+ if ($parentQuery = ($params['parent'] ?? null)) {
+ $parent = $this->model()->query($parentQuery);
+ } else {
+ $parent = $this->model();
+ }
- if (is_a($parent, 'Kirby\Cms\File') === true) {
- $parent = $parent->parent();
- }
+ if (is_a($parent, 'Kirby\Cms\File') === true) {
+ $parent = $parent->parent();
+ }
- return $api->upload(function ($source, $filename) use ($parent, $params, $map) {
- $file = $parent->createFile([
- 'source' => $source,
- 'template' => $params['template'] ?? null,
- 'filename' => $filename,
- ]);
+ return $api->upload(function ($source, $filename) use ($parent, $params, $map) {
+ $file = $parent->createFile([
+ 'source' => $source,
+ 'template' => $params['template'] ?? null,
+ 'filename' => $filename,
+ ]);
- if (is_a($file, 'Kirby\Cms\File') === false) {
- throw new Exception('The file could not be uploaded');
- }
+ if (is_a($file, 'Kirby\Cms\File') === false) {
+ throw new Exception('The file could not be uploaded');
+ }
- return $map($file, $parent);
- });
- }
- ]
+ return $map($file, $parent);
+ });
+ }
+ ]
];
diff --git a/kirby/config/fields/mixins/userpicker.php b/kirby/config/fields/mixins/userpicker.php
index 41c2b62..4f8556c 100755
--- a/kirby/config/fields/mixins/userpicker.php
+++ b/kirby/config/fields/mixins/userpicker.php
@@ -3,11 +3,11 @@
use Kirby\Cms\UserPicker;
return [
- 'methods' => [
- 'userpicker' => function (array $params = []) {
- $params['model'] = $this->model();
+ 'methods' => [
+ 'userpicker' => function (array $params = []) {
+ $params['model'] = $this->model();
- return (new UserPicker($params))->toArray();
- }
- ]
+ return (new UserPicker($params))->toArray();
+ }
+ ]
];
diff --git a/kirby/config/fields/multiselect.php b/kirby/config/fields/multiselect.php
index 4ed2422..37ab356 100755
--- a/kirby/config/fields/multiselect.php
+++ b/kirby/config/fields/multiselect.php
@@ -1,32 +1,32 @@
'tags',
- 'props' => [
- /**
- * Unset inherited props
- */
- 'accept' => null,
- /**
- * Custom icon to replace the arrow down.
- */
- 'icon' => function (string $icon = null) {
- return $icon;
- },
- /**
- * Enable/disable the search in the dropdown
- * Also limit displayed items (display: 20)
- * and set minimum number of characters to search (min: 3)
- */
- 'search' => function ($search = true) {
- return $search;
- },
- /**
- * If `true`, selected entries will be sorted
- * according to their position in the dropdown
- */
- 'sort' => function (bool $sort = false) {
- return $sort;
- },
- ]
+ 'extends' => 'tags',
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'accept' => null,
+ /**
+ * Custom icon to replace the arrow down.
+ */
+ 'icon' => function (string $icon = null) {
+ return $icon;
+ },
+ /**
+ * Enable/disable the search in the dropdown
+ * Also limit displayed items (display: 20)
+ * and set minimum number of characters to search (min: 3)
+ */
+ 'search' => function ($search = true) {
+ return $search;
+ },
+ /**
+ * If `true`, selected entries will be sorted
+ * according to their position in the dropdown
+ */
+ 'sort' => function (bool $sort = false) {
+ return $sort;
+ },
+ ]
];
diff --git a/kirby/config/fields/number.php b/kirby/config/fields/number.php
index 92a23ee..62470ed 100755
--- a/kirby/config/fields/number.php
+++ b/kirby/config/fields/number.php
@@ -3,46 +3,46 @@
use Kirby\Toolkit\Str;
return [
- 'props' => [
- /**
- * Default number that will be saved when a new page/user/file is created
- */
- 'default' => function ($default = null) {
- return $this->toNumber($default);
- },
- /**
- * The lowest allowed number
- */
- 'min' => function (float $min = null) {
- return $min;
- },
- /**
- * The highest allowed number
- */
- 'max' => function (float $max = null) {
- return $max;
- },
- /**
- * Allowed incremental steps between numbers (i.e `0.5`)
- */
- 'step' => function ($step = null) {
- return $this->toNumber($step);
- },
- 'value' => function ($value = null) {
- return $this->toNumber($value);
- }
- ],
- 'methods' => [
- 'toNumber' => function ($value) {
- if ($this->isEmpty($value) === true) {
- return null;
- }
+ 'props' => [
+ /**
+ * Default number that will be saved when a new page/user/file is created
+ */
+ 'default' => function ($default = null) {
+ return $this->toNumber($default);
+ },
+ /**
+ * The lowest allowed number
+ */
+ 'min' => function (float $min = null) {
+ return $min;
+ },
+ /**
+ * The highest allowed number
+ */
+ 'max' => function (float $max = null) {
+ return $max;
+ },
+ /**
+ * Allowed incremental steps between numbers (i.e `0.5`)
+ */
+ 'step' => function ($step = null) {
+ return $this->toNumber($step);
+ },
+ 'value' => function ($value = null) {
+ return $this->toNumber($value);
+ }
+ ],
+ 'methods' => [
+ 'toNumber' => function ($value) {
+ if ($this->isEmpty($value) === true) {
+ return null;
+ }
- return is_float($value) === true ? $value : (float)Str::float($value);
- }
- ],
- 'validations' => [
- 'min',
- 'max'
- ]
+ return is_float($value) === true ? $value : (float)Str::float($value);
+ }
+ ],
+ 'validations' => [
+ 'min',
+ 'max'
+ ]
];
diff --git a/kirby/config/fields/pages.php b/kirby/config/fields/pages.php
index 3f42c4b..8eaa70d 100755
--- a/kirby/config/fields/pages.php
+++ b/kirby/config/fields/pages.php
@@ -5,107 +5,107 @@ use Kirby\Data\Data;
use Kirby\Toolkit\A;
return [
- 'mixins' => [
- 'layout',
- 'min',
- 'pagepicker',
- 'picker',
- ],
- 'props' => [
- /**
- * Unset inherited props
- */
- 'after' => null,
- 'autofocus' => null,
- 'before' => null,
- 'icon' => null,
- 'placeholder' => null,
+ 'mixins' => [
+ 'layout',
+ 'min',
+ 'pagepicker',
+ 'picker',
+ ],
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'after' => null,
+ 'autofocus' => null,
+ 'before' => null,
+ 'icon' => null,
+ 'placeholder' => null,
- /**
- * Default selected page(s) when a new page/file/user is created
- */
- 'default' => function ($default = null) {
- return $this->toPages($default);
- },
+ /**
+ * Default selected page(s) when a new page/file/user is created
+ */
+ 'default' => function ($default = null) {
+ return $this->toPages($default);
+ },
- /**
- * Optional query to select a specific set of pages
- */
- 'query' => function (string $query = null) {
- return $query;
- },
+ /**
+ * Optional query to select a specific set of pages
+ */
+ 'query' => function (string $query = null) {
+ return $query;
+ },
- /**
- * Optionally include subpages of pages
- */
- 'subpages' => function (bool $subpages = true) {
- return $subpages;
- },
+ /**
+ * Optionally include subpages of pages
+ */
+ 'subpages' => function (bool $subpages = true) {
+ return $subpages;
+ },
- 'value' => function ($value = null) {
- return $this->toPages($value);
- },
- ],
- 'computed' => [
- /**
- * Unset inherited computed
- */
- 'default' => null
- ],
- 'methods' => [
- 'pageResponse' => function ($page) {
- return $page->panel()->pickerData([
- 'image' => $this->image,
- 'info' => $this->info,
- 'layout' => $this->layout,
- 'text' => $this->text,
- ]);
- },
- 'toPages' => function ($value = null) {
- $pages = [];
- $kirby = App::instance();
+ 'value' => function ($value = null) {
+ return $this->toPages($value);
+ },
+ ],
+ 'computed' => [
+ /**
+ * Unset inherited computed
+ */
+ 'default' => null
+ ],
+ 'methods' => [
+ 'pageResponse' => function ($page) {
+ return $page->panel()->pickerData([
+ 'image' => $this->image,
+ 'info' => $this->info,
+ 'layout' => $this->layout,
+ 'text' => $this->text,
+ ]);
+ },
+ 'toPages' => function ($value = null) {
+ $pages = [];
+ $kirby = App::instance();
- foreach (Data::decode($value, 'yaml') as $id) {
- if (is_array($id) === true) {
- $id = $id['id'] ?? null;
- }
+ foreach (Data::decode($value, 'yaml') as $id) {
+ if (is_array($id) === true) {
+ $id = $id['id'] ?? null;
+ }
- if ($id !== null && ($page = $kirby->page($id))) {
- $pages[] = $this->pageResponse($page);
- }
- }
+ if ($id !== null && ($page = $kirby->page($id))) {
+ $pages[] = $this->pageResponse($page);
+ }
+ }
- return $pages;
- }
- ],
- 'api' => function () {
- return [
- [
- 'pattern' => '/',
- 'action' => function () {
- $field = $this->field();
+ return $pages;
+ }
+ ],
+ 'api' => function () {
+ return [
+ [
+ 'pattern' => '/',
+ 'action' => function () {
+ $field = $this->field();
- return $field->pagepicker([
- 'image' => $field->image(),
- 'info' => $field->info(),
- 'layout' => $field->layout(),
- 'limit' => $field->limit(),
- 'page' => $this->requestQuery('page'),
- 'parent' => $this->requestQuery('parent'),
- 'query' => $field->query(),
- 'search' => $this->requestQuery('search'),
- 'subpages' => $field->subpages(),
- 'text' => $field->text()
- ]);
- }
- ]
- ];
- },
- 'save' => function ($value = null) {
- return A::pluck($value, 'id');
- },
- 'validations' => [
- 'max',
- 'min'
- ]
+ return $field->pagepicker([
+ 'image' => $field->image(),
+ 'info' => $field->info(),
+ 'layout' => $field->layout(),
+ 'limit' => $field->limit(),
+ 'page' => $this->requestQuery('page'),
+ 'parent' => $this->requestQuery('parent'),
+ 'query' => $field->query(),
+ 'search' => $this->requestQuery('search'),
+ 'subpages' => $field->subpages(),
+ 'text' => $field->text()
+ ]);
+ }
+ ]
+ ];
+ },
+ 'save' => function ($value = null) {
+ return A::pluck($value, 'id');
+ },
+ 'validations' => [
+ 'max',
+ 'min'
+ ]
];
diff --git a/kirby/config/fields/radio.php b/kirby/config/fields/radio.php
index dd9ffc3..4846053 100755
--- a/kirby/config/fields/radio.php
+++ b/kirby/config/fields/radio.php
@@ -1,29 +1,29 @@
['options'],
- 'props' => [
- /**
- * Unset inherited props
- */
- 'after' => null,
- 'before' => null,
- 'icon' => null,
- 'placeholder' => null,
+ 'mixins' => ['options'],
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'after' => null,
+ 'before' => null,
+ 'icon' => null,
+ 'placeholder' => null,
- /**
- * Arranges the radio buttons in the given number of columns
- */
- 'columns' => function (int $columns = 1) {
- return $columns;
- },
- ],
- 'computed' => [
- 'default' => function () {
- return $this->sanitizeOption($this->default);
- },
- 'value' => function () {
- return $this->sanitizeOption($this->value) ?? '';
- }
- ]
+ /**
+ * Arranges the radio buttons in the given number of columns
+ */
+ 'columns' => function (int $columns = 1) {
+ return $columns;
+ },
+ ],
+ 'computed' => [
+ 'default' => function () {
+ return $this->sanitizeOption($this->default);
+ },
+ 'value' => function () {
+ return $this->sanitizeOption($this->value) ?? '';
+ }
+ ]
];
diff --git a/kirby/config/fields/range.php b/kirby/config/fields/range.php
index 5f14388..04221f1 100755
--- a/kirby/config/fields/range.php
+++ b/kirby/config/fields/range.php
@@ -1,24 +1,24 @@
'number',
- 'props' => [
- /**
- * Unset inherited props
- */
- 'placeholder' => null,
+ 'extends' => 'number',
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'placeholder' => null,
- /**
- * The maximum value on the slider
- */
- 'max' => function (float $max = 100) {
- return $max;
- },
- /**
- * Enables/disables the tooltip and set the before and after values
- */
- 'tooltip' => function ($tooltip = true) {
- return $tooltip;
- },
- ]
+ /**
+ * The maximum value on the slider
+ */
+ 'max' => function (float $max = 100) {
+ return $max;
+ },
+ /**
+ * Enables/disables the tooltip and set the before and after values
+ */
+ 'tooltip' => function ($tooltip = true) {
+ return $tooltip;
+ },
+ ]
];
diff --git a/kirby/config/fields/select.php b/kirby/config/fields/select.php
index 24b14b6..04b468d 100755
--- a/kirby/config/fields/select.php
+++ b/kirby/config/fields/select.php
@@ -1,24 +1,24 @@
'radio',
- 'props' => [
- /**
- * Unset inherited props
- */
- 'columns' => null,
+ 'extends' => 'radio',
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'columns' => null,
- /**
- * Custom icon to replace the arrow down.
- */
- 'icon' => function (string $icon = null) {
- return $icon;
- },
- /**
- * Custom placeholder string for empty option.
- */
- 'placeholder' => function (string $placeholder = '—') {
- return $placeholder;
- },
- ]
+ /**
+ * Custom icon to replace the arrow down.
+ */
+ 'icon' => function (string $icon = null) {
+ return $icon;
+ },
+ /**
+ * Custom placeholder string for empty option.
+ */
+ 'placeholder' => function (string $placeholder = '—') {
+ return $placeholder;
+ },
+ ]
];
diff --git a/kirby/config/fields/slug.php b/kirby/config/fields/slug.php
index d927415..9d8efb5 100755
--- a/kirby/config/fields/slug.php
+++ b/kirby/config/fields/slug.php
@@ -2,54 +2,54 @@
return [
- 'extends' => 'text',
- 'props' => [
- /**
- * Unset inherited props
- */
- 'converter' => null,
- 'counter' => null,
- 'spellcheck' => null,
+ 'extends' => 'text',
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'converter' => null,
+ 'counter' => null,
+ 'spellcheck' => null,
- /**
- * Set of characters allowed in the slug
- */
- 'allow' => function (string $allow = '') {
- return $allow;
- },
+ /**
+ * Set of characters allowed in the slug
+ */
+ 'allow' => function (string $allow = '') {
+ return $allow;
+ },
- /**
- * Changes the link icon
- */
- 'icon' => function (string $icon = 'url') {
- return $icon;
- },
+ /**
+ * Changes the link icon
+ */
+ 'icon' => function (string $icon = 'url') {
+ return $icon;
+ },
- /**
- * Set prefix for the help text
- */
- 'path' => function (string $path = null) {
- return $path;
- },
+ /**
+ * Set prefix for the help text
+ */
+ 'path' => function (string $path = null) {
+ return $path;
+ },
- /**
- * Name of another field that should be used to
- * automatically update this field's value
- */
- 'sync' => function (string $sync = null) {
- return $sync;
- },
+ /**
+ * Name of another field that should be used to
+ * automatically update this field's value
+ */
+ 'sync' => function (string $sync = null) {
+ return $sync;
+ },
- /**
- * Set to object with keys `field` and `text` to add
- * button to generate from another field
- */
- 'wizard' => function ($wizard = false) {
- return $wizard;
- }
- ],
- 'validations' => [
- 'minlength',
- 'maxlength'
- ],
+ /**
+ * Set to object with keys `field` and `text` to add
+ * button to generate from another field
+ */
+ 'wizard' => function ($wizard = false) {
+ return $wizard;
+ }
+ ],
+ 'validations' => [
+ 'minlength',
+ 'maxlength'
+ ],
];
diff --git a/kirby/config/fields/structure.php b/kirby/config/fields/structure.php
index f26b9ac..48b2841 100755
--- a/kirby/config/fields/structure.php
+++ b/kirby/config/fields/structure.php
@@ -5,200 +5,200 @@ use Kirby\Form\Form;
use Kirby\Toolkit\I18n;
return [
- 'mixins' => ['min'],
- 'props' => [
- /**
- * Unset inherited props
- */
- 'after' => null,
- 'before' => null,
- 'autofocus' => null,
- 'icon' => null,
- 'placeholder' => null,
+ 'mixins' => ['min'],
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'after' => null,
+ 'before' => null,
+ 'autofocus' => null,
+ 'icon' => null,
+ 'placeholder' => null,
- /**
- * Optional columns definition to only show selected fields in the structure table.
- */
- 'columns' => function (array $columns = []) {
- // lower case all keys, because field names will
- // be lowercase as well.
- return array_change_key_case($columns);
- },
+ /**
+ * Optional columns definition to only show selected fields in the structure table.
+ */
+ 'columns' => function (array $columns = []) {
+ // lower case all keys, because field names will
+ // be lowercase as well.
+ return array_change_key_case($columns);
+ },
- /**
- * Toggles duplicating rows for the structure
- */
- 'duplicate' => function (bool $duplicate = true) {
- return $duplicate;
- },
+ /**
+ * Toggles duplicating rows for the structure
+ */
+ 'duplicate' => function (bool $duplicate = true) {
+ return $duplicate;
+ },
- /**
- * The placeholder text if no items have been added yet
- */
- 'empty' => function ($empty = null) {
- return I18n::translate($empty, $empty);
- },
+ /**
+ * The placeholder text if no items have been added yet
+ */
+ 'empty' => function ($empty = null) {
+ return I18n::translate($empty, $empty);
+ },
- /**
- * Set the default rows for the structure
- */
- 'default' => function (array $default = null) {
- return $default;
- },
+ /**
+ * Set the default rows for the structure
+ */
+ 'default' => function (array $default = null) {
+ return $default;
+ },
- /**
- * Fields setup for the structure form. Works just like fields in regular forms.
- */
- 'fields' => function (array $fields) {
- return $fields;
- },
- /**
- * The number of entries that will be displayed on a single page. Afterwards pagination kicks in.
- */
- 'limit' => function (int $limit = null) {
- return $limit;
- },
- /**
- * Maximum allowed entries in the structure. Afterwards the "Add" button will be switched off.
- */
- 'max' => function (int $max = null) {
- return $max;
- },
- /**
- * Minimum required entries in the structure
- */
- 'min' => function (int $min = null) {
- return $min;
- },
- /**
- * Toggles adding to the top or bottom of the list
- */
- 'prepend' => function (bool $prepend = null) {
- return $prepend;
- },
- /**
- * Toggles drag & drop sorting
- */
- 'sortable' => function (bool $sortable = null) {
- return $sortable;
- },
- /**
- * Sorts the entries by the given field and order (i.e. `title desc`)
- * Drag & drop is disabled in this case
- */
- 'sortBy' => function (string $sort = null) {
- return $sort;
- }
- ],
- 'computed' => [
- 'default' => function () {
- return $this->rows($this->default);
- },
- 'value' => function () {
- return $this->rows($this->value);
- },
- 'fields' => function () {
- if (empty($this->fields) === true) {
- throw new Exception('Please provide some fields for the structure');
- }
+ /**
+ * Fields setup for the structure form. Works just like fields in regular forms.
+ */
+ 'fields' => function (array $fields) {
+ return $fields;
+ },
+ /**
+ * The number of entries that will be displayed on a single page. Afterwards pagination kicks in.
+ */
+ 'limit' => function (int $limit = null) {
+ return $limit;
+ },
+ /**
+ * Maximum allowed entries in the structure. Afterwards the "Add" button will be switched off.
+ */
+ 'max' => function (int $max = null) {
+ return $max;
+ },
+ /**
+ * Minimum required entries in the structure
+ */
+ 'min' => function (int $min = null) {
+ return $min;
+ },
+ /**
+ * Toggles adding to the top or bottom of the list
+ */
+ 'prepend' => function (bool $prepend = null) {
+ return $prepend;
+ },
+ /**
+ * Toggles drag & drop sorting
+ */
+ 'sortable' => function (bool $sortable = null) {
+ return $sortable;
+ },
+ /**
+ * Sorts the entries by the given field and order (i.e. `title desc`)
+ * Drag & drop is disabled in this case
+ */
+ 'sortBy' => function (string $sort = null) {
+ return $sort;
+ }
+ ],
+ 'computed' => [
+ 'default' => function () {
+ return $this->rows($this->default);
+ },
+ 'value' => function () {
+ return $this->rows($this->value);
+ },
+ 'fields' => function () {
+ if (empty($this->fields) === true) {
+ throw new Exception('Please provide some fields for the structure');
+ }
- return $this->form()->fields()->toArray();
- },
- 'columns' => function () {
- $columns = [];
- $mobile = 0;
+ return $this->form()->fields()->toArray();
+ },
+ 'columns' => function () {
+ $columns = [];
+ $mobile = 0;
- if (empty($this->columns)) {
- foreach ($this->fields as $field) {
+ if (empty($this->columns)) {
+ foreach ($this->fields as $field) {
- // Skip hidden and unsaveable fields
- // They should never be included as column
- if ($field['type'] === 'hidden' || $field['saveable'] === false) {
- continue;
- }
+ // Skip hidden and unsaveable fields
+ // They should never be included as column
+ if ($field['type'] === 'hidden' || $field['saveable'] === false) {
+ continue;
+ }
- $columns[$field['name']] = [
- 'type' => $field['type'],
- 'label' => $field['label'] ?? $field['name']
- ];
- }
- } else {
- foreach ($this->columns as $columnName => $columnProps) {
- if (is_array($columnProps) === false) {
- $columnProps = [];
- }
+ $columns[$field['name']] = [
+ 'type' => $field['type'],
+ 'label' => $field['label'] ?? $field['name']
+ ];
+ }
+ } else {
+ foreach ($this->columns as $columnName => $columnProps) {
+ if (is_array($columnProps) === false) {
+ $columnProps = [];
+ }
- $field = $this->fields[$columnName] ?? null;
+ $field = $this->fields[$columnName] ?? null;
- if (empty($field) === true || $field['saveable'] === false) {
- continue;
- }
+ if (empty($field) === true || $field['saveable'] === false) {
+ continue;
+ }
- if (($columnProps['mobile'] ?? false) === true) {
- $mobile++;
- }
+ if (($columnProps['mobile'] ?? false) === true) {
+ $mobile++;
+ }
- $columns[$columnName] = array_merge($columnProps, [
- 'type' => $field['type'],
- 'label' => $field['label'] ?? $field['name']
- ]);
- }
- }
+ $columns[$columnName] = array_merge($columnProps, [
+ 'type' => $field['type'],
+ 'label' => $field['label'] ?? $field['name']
+ ]);
+ }
+ }
- // make the first column visible on mobile
- // if no other mobile columns are defined
- if ($mobile === 0) {
- $columns[array_key_first($columns)]['mobile'] = true;
- }
+ // make the first column visible on mobile
+ // if no other mobile columns are defined
+ if ($mobile === 0) {
+ $columns[array_key_first($columns)]['mobile'] = true;
+ }
- return $columns;
- }
- ],
- 'methods' => [
- 'rows' => function ($value) {
- $rows = Data::decode($value, 'yaml');
- $value = [];
+ return $columns;
+ }
+ ],
+ 'methods' => [
+ 'rows' => function ($value) {
+ $rows = Data::decode($value, 'yaml');
+ $value = [];
- foreach ($rows as $index => $row) {
- if (is_array($row) === false) {
- continue;
- }
+ foreach ($rows as $index => $row) {
+ if (is_array($row) === false) {
+ continue;
+ }
- $value[] = $this->form($row)->values();
- }
+ $value[] = $this->form($row)->values();
+ }
- return $value;
- },
- 'form' => function (array $values = []) {
- return new Form([
- 'fields' => $this->attrs['fields'],
- 'values' => $values,
- 'model' => $this->model
- ]);
- },
- ],
- 'api' => function () {
- return [
- [
- 'pattern' => 'validate',
- 'method' => 'ALL',
- 'action' => function () {
- return array_values($this->field()->form($this->requestBody())->errors());
- }
- ]
- ];
- },
- 'save' => function ($value) {
- $data = [];
+ return $value;
+ },
+ 'form' => function (array $values = []) {
+ return new Form([
+ 'fields' => $this->attrs['fields'],
+ 'values' => $values,
+ 'model' => $this->model
+ ]);
+ },
+ ],
+ 'api' => function () {
+ return [
+ [
+ 'pattern' => 'validate',
+ 'method' => 'ALL',
+ 'action' => function () {
+ return array_values($this->field()->form($this->requestBody())->errors());
+ }
+ ]
+ ];
+ },
+ 'save' => function ($value) {
+ $data = [];
- foreach ($value as $row) {
- $data[] = $this->form($row)->content();
- }
+ foreach ($value as $row) {
+ $data[] = $this->form($row)->content();
+ }
- return $data;
- },
- 'validations' => [
- 'min',
- 'max'
- ]
+ return $data;
+ },
+ 'validations' => [
+ 'min',
+ 'max'
+ ]
];
diff --git a/kirby/config/fields/tags.php b/kirby/config/fields/tags.php
index 5cfd4f4..98cfbb4 100755
--- a/kirby/config/fields/tags.php
+++ b/kirby/config/fields/tags.php
@@ -5,99 +5,99 @@ use Kirby\Toolkit\Str;
use Kirby\Toolkit\V;
return [
- 'mixins' => ['min', 'options'],
- 'props' => [
+ 'mixins' => ['min', 'options'],
+ 'props' => [
- /**
- * Unset inherited props
- */
- 'after' => null,
- 'before' => null,
- 'placeholder' => null,
+ /**
+ * Unset inherited props
+ */
+ 'after' => null,
+ 'before' => null,
+ 'placeholder' => null,
- /**
- * If set to `all`, any type of input is accepted. If set to `options` only the predefined options are accepted as input.
- */
- 'accept' => function ($value = 'all') {
- return V::in($value, ['all', 'options']) ? $value : 'all';
- },
- /**
- * Changes the tag icon
- */
- 'icon' => function ($icon = 'tag') {
- return $icon;
- },
- /**
- * Set to `list` to display each tag with 100% width,
- * otherwise the tags are displayed inline
- */
- 'layout' => function (?string $layout = null) {
- return $layout;
- },
- /**
- * Minimum number of required entries/tags
- */
- 'min' => function (int $min = null) {
- return $min;
- },
- /**
- * Maximum number of allowed entries/tags
- */
- 'max' => function (int $max = null) {
- return $max;
- },
- /**
- * Custom tags separator, which will be used to store tags in the content file
- */
- 'separator' => function (string $separator = ',') {
- return $separator;
- },
- ],
- 'computed' => [
- 'default' => function (): array {
- return $this->toTags($this->default);
- },
- 'value' => function (): array {
- return $this->toTags($this->value);
- }
- ],
- 'methods' => [
- 'toTags' => function ($value) {
- if (is_null($value) === true) {
- return [];
- }
+ /**
+ * If set to `all`, any type of input is accepted. If set to `options` only the predefined options are accepted as input.
+ */
+ 'accept' => function ($value = 'all') {
+ return V::in($value, ['all', 'options']) ? $value : 'all';
+ },
+ /**
+ * Changes the tag icon
+ */
+ 'icon' => function ($icon = 'tag') {
+ return $icon;
+ },
+ /**
+ * Set to `list` to display each tag with 100% width,
+ * otherwise the tags are displayed inline
+ */
+ 'layout' => function (?string $layout = null) {
+ return $layout;
+ },
+ /**
+ * Minimum number of required entries/tags
+ */
+ 'min' => function (int $min = null) {
+ return $min;
+ },
+ /**
+ * Maximum number of allowed entries/tags
+ */
+ 'max' => function (int $max = null) {
+ return $max;
+ },
+ /**
+ * Custom tags separator, which will be used to store tags in the content file
+ */
+ 'separator' => function (string $separator = ',') {
+ return $separator;
+ },
+ ],
+ 'computed' => [
+ 'default' => function (): array {
+ return $this->toTags($this->default);
+ },
+ 'value' => function (): array {
+ return $this->toTags($this->value);
+ }
+ ],
+ 'methods' => [
+ 'toTags' => function ($value) {
+ if (is_null($value) === true) {
+ return [];
+ }
- $options = $this->options();
+ $options = $this->options();
- // transform into value-text objects
- return array_map(function ($option) use ($options) {
+ // transform into value-text objects
+ return array_map(function ($option) use ($options) {
- // already a valid object
- if (is_array($option) === true && isset($option['value'], $option['text']) === true) {
- return $option;
- }
+ // already a valid object
+ if (is_array($option) === true && isset($option['value'], $option['text']) === true) {
+ return $option;
+ }
- $index = array_search($option, array_column($options, 'value'));
+ $index = array_search($option, array_column($options, 'value'));
- if ($index !== false) {
- return $options[$index];
- }
+ if ($index !== false) {
+ return $options[$index];
+ }
- return [
- 'value' => $option,
- 'text' => $option,
- ];
- }, Str::split($value, $this->separator()));
- }
- ],
- 'save' => function (array $value = null): string {
- return A::join(
- A::pluck($value, 'value'),
- $this->separator() . ' '
- );
- },
- 'validations' => [
- 'min',
- 'max'
- ]
+ return [
+ 'value' => $option,
+ 'text' => $option,
+ ];
+ }, Str::split($value, $this->separator()));
+ }
+ ],
+ 'save' => function (array $value = null): string {
+ return A::join(
+ A::pluck($value, 'value'),
+ $this->separator() . ' '
+ );
+ },
+ 'validations' => [
+ 'min',
+ 'max'
+ ]
];
diff --git a/kirby/config/fields/tel.php b/kirby/config/fields/tel.php
index 3d73430..715d587 100755
--- a/kirby/config/fields/tel.php
+++ b/kirby/config/fields/tel.php
@@ -1,27 +1,27 @@
'text',
- 'props' => [
- /**
- * Unset inherited props
- */
- 'converter' => null,
- 'counter' => null,
- 'spellcheck' => null,
+ 'extends' => 'text',
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'converter' => null,
+ 'counter' => null,
+ 'spellcheck' => null,
- /**
- * Sets the HTML5 autocomplete attribute
- */
- 'autocomplete' => function (string $autocomplete = 'tel') {
- return $autocomplete;
- },
+ /**
+ * Sets the HTML5 autocomplete attribute
+ */
+ 'autocomplete' => function (string $autocomplete = 'tel') {
+ return $autocomplete;
+ },
- /**
- * Changes the phone icon
- */
- 'icon' => function (string $icon = 'phone') {
- return $icon;
- }
- ]
+ /**
+ * Changes the phone icon
+ */
+ 'icon' => function (string $icon = 'phone') {
+ return $icon;
+ }
+ ]
];
diff --git a/kirby/config/fields/text.php b/kirby/config/fields/text.php
index bc13bd1..7abd86f 100755
--- a/kirby/config/fields/text.php
+++ b/kirby/config/fields/text.php
@@ -4,99 +4,99 @@ use Kirby\Exception\InvalidArgumentException;
use Kirby\Toolkit\Str;
return [
- 'props' => [
+ 'props' => [
- /**
- * The field value will be converted with the selected converter before the value gets saved. Available converters: `lower`, `upper`, `ucfirst`, `slug`
- */
- 'converter' => function ($value = null) {
- if ($value !== null && in_array($value, array_keys($this->converters())) === false) {
- throw new InvalidArgumentException([
- 'key' => 'field.converter.invalid',
- 'data' => ['converter' => $value]
- ]);
- }
+ /**
+ * The field value will be converted with the selected converter before the value gets saved. Available converters: `lower`, `upper`, `ucfirst`, `slug`
+ */
+ 'converter' => function ($value = null) {
+ if ($value !== null && in_array($value, array_keys($this->converters())) === false) {
+ throw new InvalidArgumentException([
+ 'key' => 'field.converter.invalid',
+ 'data' => ['converter' => $value]
+ ]);
+ }
- return $value;
- },
+ return $value;
+ },
- /**
- * Shows or hides the character counter in the top right corner
- */
- 'counter' => function (bool $counter = true) {
- return $counter;
- },
+ /**
+ * Shows or hides the character counter in the top right corner
+ */
+ 'counter' => function (bool $counter = true) {
+ return $counter;
+ },
- /**
- * Maximum number of allowed characters
- */
- 'maxlength' => function (int $maxlength = null) {
- return $maxlength;
- },
+ /**
+ * Maximum number of allowed characters
+ */
+ 'maxlength' => function (int $maxlength = null) {
+ return $maxlength;
+ },
- /**
- * Minimum number of required characters
- */
- 'minlength' => function (int $minlength = null) {
- return $minlength;
- },
+ /**
+ * Minimum number of required characters
+ */
+ 'minlength' => function (int $minlength = null) {
+ return $minlength;
+ },
- /**
- * A regular expression, which will be used to validate the input
- */
- 'pattern' => function (string $pattern = null) {
- return $pattern;
- },
+ /**
+ * A regular expression, which will be used to validate the input
+ */
+ 'pattern' => function (string $pattern = null) {
+ return $pattern;
+ },
- /**
- * If `false`, spellcheck will be switched off
- */
- 'spellcheck' => function (bool $spellcheck = false) {
- return $spellcheck;
- },
- ],
- 'computed' => [
- 'default' => function () {
- return $this->convert($this->default);
- },
- 'value' => function () {
- return (string)$this->convert($this->value);
- }
- ],
- 'methods' => [
- 'convert' => function ($value) {
- if ($this->converter() === null) {
- return $value;
- }
+ /**
+ * If `false`, spellcheck will be switched off
+ */
+ 'spellcheck' => function (bool $spellcheck = false) {
+ return $spellcheck;
+ },
+ ],
+ 'computed' => [
+ 'default' => function () {
+ return $this->convert($this->default);
+ },
+ 'value' => function () {
+ return (string)$this->convert($this->value);
+ }
+ ],
+ 'methods' => [
+ 'convert' => function ($value) {
+ if ($this->converter() === null) {
+ return $value;
+ }
- $converter = $this->converters()[$this->converter()];
+ $converter = $this->converters()[$this->converter()];
- if (is_array($value) === true) {
- return array_map($converter, $value);
- }
+ if (is_array($value) === true) {
+ return array_map($converter, $value);
+ }
- return call_user_func($converter, trim($value ?? ''));
- },
- 'converters' => function (): array {
- return [
- 'lower' => function ($value) {
- return Str::lower($value);
- },
- 'slug' => function ($value) {
- return Str::slug($value);
- },
- 'ucfirst' => function ($value) {
- return Str::ucfirst($value);
- },
- 'upper' => function ($value) {
- return Str::upper($value);
- },
- ];
- },
- ],
- 'validations' => [
- 'minlength',
- 'maxlength',
- 'pattern'
- ]
+ return call_user_func($converter, trim($value ?? ''));
+ },
+ 'converters' => function (): array {
+ return [
+ 'lower' => function ($value) {
+ return Str::lower($value);
+ },
+ 'slug' => function ($value) {
+ return Str::slug($value);
+ },
+ 'ucfirst' => function ($value) {
+ return Str::ucfirst($value);
+ },
+ 'upper' => function ($value) {
+ return Str::upper($value);
+ },
+ ];
+ },
+ ],
+ 'validations' => [
+ 'minlength',
+ 'maxlength',
+ 'pattern'
+ ]
];
diff --git a/kirby/config/fields/textarea.php b/kirby/config/fields/textarea.php
index aaf2962..7b51c1f 100755
--- a/kirby/config/fields/textarea.php
+++ b/kirby/config/fields/textarea.php
@@ -1,123 +1,123 @@
['filepicker', 'upload'],
- 'props' => [
- /**
- * Unset inherited props
- */
- 'after' => null,
- 'before' => null,
+ 'mixins' => ['filepicker', 'upload'],
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'after' => null,
+ 'before' => null,
- /**
- * Enables/disables the format buttons. Can either be `true`/`false` or a list of allowed buttons. Available buttons: `headlines`, `italic`, `bold`, `link`, `email`, `file`, `code`, `ul`, `ol` (as well as `|` for a divider)
- */
- 'buttons' => function ($buttons = true) {
- return $buttons;
- },
+ /**
+ * Enables/disables the format buttons. Can either be `true`/`false` or a list of allowed buttons. Available buttons: `headlines`, `italic`, `bold`, `link`, `email`, `file`, `code`, `ul`, `ol` (as well as `|` for a divider)
+ */
+ 'buttons' => function ($buttons = true) {
+ return $buttons;
+ },
- /**
- * Enables/disables the character counter in the top right corner
- */
- 'counter' => function (bool $counter = true) {
- return $counter;
- },
+ /**
+ * Enables/disables the character counter in the top right corner
+ */
+ 'counter' => function (bool $counter = true) {
+ return $counter;
+ },
- /**
- * Sets the default text when a new page/file/user is created
- */
- 'default' => function (string $default = null) {
- return trim($default ?? '');
- },
+ /**
+ * Sets the default text when a new page/file/user is created
+ */
+ 'default' => function (string $default = null) {
+ return trim($default ?? '');
+ },
- /**
- * Sets the options for the files picker
- */
- 'files' => function ($files = []) {
- if (is_string($files) === true) {
- return ['query' => $files];
- }
+ /**
+ * Sets the options for the files picker
+ */
+ 'files' => function ($files = []) {
+ if (is_string($files) === true) {
+ return ['query' => $files];
+ }
- if (is_array($files) === false) {
- $files = [];
- }
+ if (is_array($files) === false) {
+ $files = [];
+ }
- return $files;
- },
+ return $files;
+ },
- /**
- * Sets the font family (sans or monospace)
- */
- 'font' => function (string $font = null) {
- return $font === 'monospace' ? 'monospace' : 'sans-serif';
- },
+ /**
+ * Sets the font family (sans or monospace)
+ */
+ 'font' => function (string $font = null) {
+ return $font === 'monospace' ? 'monospace' : 'sans-serif';
+ },
- /**
- * Maximum number of allowed characters
- */
- 'maxlength' => function (int $maxlength = null) {
- return $maxlength;
- },
+ /**
+ * Maximum number of allowed characters
+ */
+ 'maxlength' => function (int $maxlength = null) {
+ return $maxlength;
+ },
- /**
- * Minimum number of required characters
- */
- 'minlength' => function (int $minlength = null) {
- return $minlength;
- },
+ /**
+ * Minimum number of required characters
+ */
+ 'minlength' => function (int $minlength = null) {
+ return $minlength;
+ },
- /**
- * Changes the size of the textarea. Available sizes: `small`, `medium`, `large`, `huge`
- */
- 'size' => function (string $size = null) {
- return $size;
- },
+ /**
+ * Changes the size of the textarea. Available sizes: `small`, `medium`, `large`, `huge`
+ */
+ 'size' => function (string $size = null) {
+ return $size;
+ },
- /**
- * If `false`, spellcheck will be switched off
- */
- 'spellcheck' => function (bool $spellcheck = true) {
- return $spellcheck;
- },
+ /**
+ * If `false`, spellcheck will be switched off
+ */
+ 'spellcheck' => function (bool $spellcheck = true) {
+ return $spellcheck;
+ },
- 'value' => function (string $value = null) {
- return trim($value ?? '');
- }
- ],
- 'api' => function () {
- return [
- [
- 'pattern' => 'files',
- 'action' => function () {
- $params = array_merge($this->field()->files(), [
- 'page' => $this->requestQuery('page'),
- 'search' => $this->requestQuery('search')
- ]);
+ 'value' => function (string $value = null) {
+ return trim($value ?? '');
+ }
+ ],
+ 'api' => function () {
+ return [
+ [
+ 'pattern' => 'files',
+ 'action' => function () {
+ $params = array_merge($this->field()->files(), [
+ 'page' => $this->requestQuery('page'),
+ 'search' => $this->requestQuery('search')
+ ]);
- return $this->field()->filepicker($params);
- }
- ],
- [
- 'pattern' => 'upload',
- 'method' => 'POST',
- 'action' => function () {
- $field = $this->field();
- $uploads = $field->uploads();
+ return $this->field()->filepicker($params);
+ }
+ ],
+ [
+ 'pattern' => 'upload',
+ 'method' => 'POST',
+ 'action' => function () {
+ $field = $this->field();
+ $uploads = $field->uploads();
- return $this->field()->upload($this, $uploads, function ($file, $parent) use ($field) {
- $absolute = $field->model()->is($parent) === false;
+ return $this->field()->upload($this, $uploads, function ($file, $parent) use ($field) {
+ $absolute = $field->model()->is($parent) === false;
- return [
- 'filename' => $file->filename(),
- 'dragText' => $file->panel()->dragText('auto', $absolute),
- ];
- });
- }
- ]
- ];
- },
- 'validations' => [
- 'minlength',
- 'maxlength'
- ]
+ return [
+ 'filename' => $file->filename(),
+ 'dragText' => $file->panel()->dragText('auto', $absolute),
+ ];
+ });
+ }
+ ]
+ ];
+ },
+ 'validations' => [
+ 'minlength',
+ 'maxlength'
+ ]
];
diff --git a/kirby/config/fields/time.php b/kirby/config/fields/time.php
index 5dbb536..69a2da9 100755
--- a/kirby/config/fields/time.php
+++ b/kirby/config/fields/time.php
@@ -5,122 +5,122 @@ use Kirby\Toolkit\Date;
use Kirby\Toolkit\I18n;
return [
- 'mixins' => ['datetime'],
- 'props' => [
- /**
- * Unset inherited props
- */
- 'placeholder' => null,
+ 'mixins' => ['datetime'],
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'placeholder' => null,
- /**
- * Sets the default time when a new page/file/user is created
- */
- 'default' => function ($default = null): ?string {
- return $default;
- },
+ /**
+ * Sets the default time when a new page/file/user is created
+ */
+ 'default' => function ($default = null): ?string {
+ return $default;
+ },
- /**
- * Custom format (dayjs tokens: `HH`, `hh`, `mm`, `ss`, `a`) that is
- * used to display the field in the Panel
- */
- 'display' => function ($display = null) {
- return I18n::translate($display, $display);
- },
+ /**
+ * Custom format (dayjs tokens: `HH`, `hh`, `mm`, `ss`, `a`) that is
+ * used to display the field in the Panel
+ */
+ 'display' => function ($display = null) {
+ return I18n::translate($display, $display);
+ },
- /**
- * Changes the clock icon
- */
- 'icon' => function (string $icon = 'clock') {
- return $icon;
- },
- /**
- * Latest time, which can be selected/saved (H:i or H:i:s)
- */
- 'max' => function (string $max = null): ?string {
- return Date::optional($max);
- },
- /**
- * Earliest time, which can be selected/saved (H:i or H:i:s)
- */
- 'min' => function (string $min = null): ?string {
- return Date::optional($min);
- },
+ /**
+ * Changes the clock icon
+ */
+ 'icon' => function (string $icon = 'clock') {
+ return $icon;
+ },
+ /**
+ * Latest time, which can be selected/saved (H:i or H:i:s)
+ */
+ 'max' => function (string $max = null): ?string {
+ return Date::optional($max);
+ },
+ /**
+ * Earliest time, which can be selected/saved (H:i or H:i:s)
+ */
+ 'min' => function (string $min = null): ?string {
+ return Date::optional($min);
+ },
- /**
- * `12` or `24` hour notation. If `12`, an AM/PM selector will be shown.
- * If `display` is defined, that option will take priority.
- */
- 'notation' => function (int $value = 24) {
- return $value === 24 ? 24 : 12;
- },
- /**
- * Round to the nearest: sub-options for `unit` (minute) and `size` (5)
- */
- 'step' => function ($step = null) {
- return Date::stepConfig($step, [
- 'size' => 5,
- 'unit' => 'minute',
- ]);
- },
- 'value' => function ($value = null): ?string {
- return $value;
- }
- ],
- 'computed' => [
- 'display' => function () {
- if ($this->display) {
- return $this->display;
- }
+ /**
+ * `12` or `24` hour notation. If `12`, an AM/PM selector will be shown.
+ * If `display` is defined, that option will take priority.
+ */
+ 'notation' => function (int $value = 24) {
+ return $value === 24 ? 24 : 12;
+ },
+ /**
+ * Round to the nearest: sub-options for `unit` (minute) and `size` (5)
+ */
+ 'step' => function ($step = null) {
+ return Date::stepConfig($step, [
+ 'size' => 5,
+ 'unit' => 'minute',
+ ]);
+ },
+ 'value' => function ($value = null): ?string {
+ return $value;
+ }
+ ],
+ 'computed' => [
+ 'display' => function () {
+ if ($this->display) {
+ return $this->display;
+ }
- return $this->notation === 24 ? 'HH:mm' : 'hh:mm a';
- },
- 'default' => function (): string {
- return $this->toDatetime($this->default, 'H:i:s') ?? '';
- },
- 'format' => function () {
- return $this->props['format'] ?? 'H:i:s';
- },
- 'value' => function (): ?string {
- return $this->toDatetime($this->value, 'H:i:s') ?? '';
- }
- ],
- 'validations' => [
- 'time',
- 'minMax' => function ($value) {
- if (!$value = Date::optional($value)) {
- return true;
- }
+ return $this->notation === 24 ? 'HH:mm' : 'hh:mm a';
+ },
+ 'default' => function (): string {
+ return $this->toDatetime($this->default, 'H:i:s') ?? '';
+ },
+ 'format' => function () {
+ return $this->props['format'] ?? 'H:i:s';
+ },
+ 'value' => function (): ?string {
+ return $this->toDatetime($this->value, 'H:i:s') ?? '';
+ }
+ ],
+ 'validations' => [
+ 'time',
+ 'minMax' => function ($value) {
+ if (!$value = Date::optional($value)) {
+ return true;
+ }
- $min = Date::optional($this->min);
- $max = Date::optional($this->max);
+ $min = Date::optional($this->min);
+ $max = Date::optional($this->max);
- $format = 'H:i:s';
+ $format = 'H:i:s';
- if ($min && $max && $value->isBetween($min, $max) === false) {
- throw new Exception([
- 'key' => 'validation.time.between',
- 'data' => [
- 'min' => $min->format($format),
- 'max' => $min->format($format)
- ]
- ]);
- } elseif ($min && $value->isMin($min) === false) {
- throw new Exception([
- 'key' => 'validation.time.after',
- 'data' => [
- 'time' => $min->format($format),
- ]
- ]);
- } elseif ($max && $value->isMax($max) === false) {
- throw new Exception([
- 'key' => 'validation.time.before',
- 'data' => [
- 'time' => $max->format($format),
- ]
- ]);
- }
+ if ($min && $max && $value->isBetween($min, $max) === false) {
+ throw new Exception([
+ 'key' => 'validation.time.between',
+ 'data' => [
+ 'min' => $min->format($format),
+ 'max' => $min->format($format)
+ ]
+ ]);
+ } elseif ($min && $value->isMin($min) === false) {
+ throw new Exception([
+ 'key' => 'validation.time.after',
+ 'data' => [
+ 'time' => $min->format($format),
+ ]
+ ]);
+ } elseif ($max && $value->isMax($max) === false) {
+ throw new Exception([
+ 'key' => 'validation.time.before',
+ 'data' => [
+ 'time' => $max->format($format),
+ ]
+ ]);
+ }
- return true;
- },
- ]
+ return true;
+ },
+ ]
];
diff --git a/kirby/config/fields/toggle.php b/kirby/config/fields/toggle.php
index 6ea330f..4cb8a6e 100755
--- a/kirby/config/fields/toggle.php
+++ b/kirby/config/fields/toggle.php
@@ -5,69 +5,69 @@ use Kirby\Toolkit\A;
use Kirby\Toolkit\I18n;
return [
- 'props' => [
- /**
- * Unset inherited props
- */
- 'placeholder' => null,
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'placeholder' => null,
- /**
- * Default value which will be saved when a new page/user/file is created
- */
- 'default' => function ($default = null) {
- return $this->default = $default;
- },
- /**
- * Sets the text next to the toggle. The text can be a string or an array of two options. The first one is the negative text and the second one the positive. The text will automatically switch when the toggle is triggered.
- */
- 'text' => function ($value = null) {
- $model = $this->model();
+ /**
+ * Default value which will be saved when a new page/user/file is created
+ */
+ 'default' => function ($default = null) {
+ return $this->default = $default;
+ },
+ /**
+ * Sets the text next to the toggle. The text can be a string or an array of two options. The first one is the negative text and the second one the positive. The text will automatically switch when the toggle is triggered.
+ */
+ 'text' => function ($value = null) {
+ $model = $this->model();
- if (is_array($value) === true) {
- if (A::isAssociative($value) === true) {
- return $model->toSafeString(I18n::translate($value, $value));
- }
+ if (is_array($value) === true) {
+ if (A::isAssociative($value) === true) {
+ return $model->toSafeString(I18n::translate($value, $value));
+ }
- foreach ($value as $key => $val) {
- $value[$key] = $model->toSafeString(I18n::translate($val, $val));
- }
+ foreach ($value as $key => $val) {
+ $value[$key] = $model->toSafeString(I18n::translate($val, $val));
+ }
- return $value;
- }
+ return $value;
+ }
- if (empty($value) === false) {
- return $model->toSafeString(I18n::translate($value, $value));
- }
+ if (empty($value) === false) {
+ return $model->toSafeString(I18n::translate($value, $value));
+ }
- return $value;
- },
- ],
- 'computed' => [
- 'default' => function () {
- return $this->toBool($this->default);
- },
- 'value' => function () {
- if ($this->props['value'] === null) {
- return $this->default();
- } else {
- return $this->toBool($this->props['value']);
- }
- }
- ],
- 'methods' => [
- 'toBool' => function ($value) {
- return in_array($value, [true, 'true', 1, '1', 'on'], true) === true;
- }
- ],
- 'save' => function (): string {
- return $this->value() === true ? 'true' : 'false';
- },
- 'validations' => [
- 'boolean',
- 'required' => function ($value) {
- if ($this->isRequired() && ($value === false || $this->isEmpty($value))) {
- throw new InvalidArgumentException(I18n::translate('field.required'));
- }
- },
- ]
+ return $value;
+ },
+ ],
+ 'computed' => [
+ 'default' => function () {
+ return $this->toBool($this->default);
+ },
+ 'value' => function () {
+ if ($this->props['value'] === null) {
+ return $this->default();
+ } else {
+ return $this->toBool($this->props['value']);
+ }
+ }
+ ],
+ 'methods' => [
+ 'toBool' => function ($value) {
+ return in_array($value, [true, 'true', 1, '1', 'on'], true) === true;
+ }
+ ],
+ 'save' => function (): string {
+ return $this->value() === true ? 'true' : 'false';
+ },
+ 'validations' => [
+ 'boolean',
+ 'required' => function ($value) {
+ if ($this->isRequired() && ($value === false || $this->isEmpty($value))) {
+ throw new InvalidArgumentException(I18n::translate('field.required'));
+ }
+ },
+ ]
];
diff --git a/kirby/config/fields/toggles.php b/kirby/config/fields/toggles.php
index 694dd21..c922c2b 100755
--- a/kirby/config/fields/toggles.php
+++ b/kirby/config/fields/toggles.php
@@ -1,41 +1,41 @@
['options'],
- 'props' => [
- /**
- * Unset inherited props
- */
- 'after' => null,
- 'before' => null,
- 'icon' => null,
- 'placeholder' => null,
+ 'mixins' => ['options'],
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'after' => null,
+ 'before' => null,
+ 'icon' => null,
+ 'placeholder' => null,
- /**
- * Toggles will automatically span the full width of the field. With the grow option, you can disable this behaviour for a more compact layout.
- */
- 'grow' => function (bool $grow = true) {
- return $grow;
- },
- /**
- * If `false` all labels will be hidden for icon-only toggles.
- */
- 'labels' => function (bool $labels = true) {
- return $labels;
- },
- /**
- * A toggle can be deactivated on click. If reset is `false` deactivating a toggle is no longer possible.
- */
- 'reset' => function (bool $reset = true) {
- return $reset;
- }
- ],
- 'computed' => [
- 'default' => function () {
- return $this->sanitizeOption($this->default);
- },
- 'value' => function () {
- return $this->sanitizeOption($this->value) ?? '';
- },
- ]
+ /**
+ * Toggles will automatically span the full width of the field. With the grow option, you can disable this behaviour for a more compact layout.
+ */
+ 'grow' => function (bool $grow = true) {
+ return $grow;
+ },
+ /**
+ * If `false` all labels will be hidden for icon-only toggles.
+ */
+ 'labels' => function (bool $labels = true) {
+ return $labels;
+ },
+ /**
+ * A toggle can be deactivated on click. If reset is `false` deactivating a toggle is no longer possible.
+ */
+ 'reset' => function (bool $reset = true) {
+ return $reset;
+ }
+ ],
+ 'computed' => [
+ 'default' => function () {
+ return $this->sanitizeOption($this->default);
+ },
+ 'value' => function () {
+ return $this->sanitizeOption($this->value) ?? '';
+ },
+ ]
];
diff --git a/kirby/config/fields/url.php b/kirby/config/fields/url.php
index f92dd2c..e9e191f 100755
--- a/kirby/config/fields/url.php
+++ b/kirby/config/fields/url.php
@@ -3,39 +3,39 @@
use Kirby\Toolkit\I18n;
return [
- 'extends' => 'text',
- 'props' => [
- /**
- * Unset inherited props
- */
- 'converter' => null,
- 'counter' => null,
- 'spellcheck' => null,
+ 'extends' => 'text',
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'converter' => null,
+ 'counter' => null,
+ 'spellcheck' => null,
- /**
- * Sets the HTML5 autocomplete attribute
- */
- 'autocomplete' => function (string $autocomplete = 'url') {
- return $autocomplete;
- },
+ /**
+ * Sets the HTML5 autocomplete attribute
+ */
+ 'autocomplete' => function (string $autocomplete = 'url') {
+ return $autocomplete;
+ },
- /**
- * Changes the link icon
- */
- 'icon' => function (string $icon = 'url') {
- return $icon;
- },
+ /**
+ * Changes the link icon
+ */
+ 'icon' => function (string $icon = 'url') {
+ return $icon;
+ },
- /**
- * Sets custom placeholder text, when the field is empty
- */
- 'placeholder' => function ($value = null) {
- return I18n::translate($value, $value) ?? 'https://example.com';
- }
- ],
- 'validations' => [
- 'minlength',
- 'maxlength',
- 'url'
- ],
+ /**
+ * Sets custom placeholder text, when the field is empty
+ */
+ 'placeholder' => function ($value = null) {
+ return I18n::translate($value, $value) ?? 'https://example.com';
+ }
+ ],
+ 'validations' => [
+ 'minlength',
+ 'maxlength',
+ 'url'
+ ],
];
diff --git a/kirby/config/fields/users.php b/kirby/config/fields/users.php
index 91964df..8641eee 100755
--- a/kirby/config/fields/users.php
+++ b/kirby/config/fields/users.php
@@ -5,101 +5,101 @@ use Kirby\Data\Data;
use Kirby\Toolkit\A;
return [
- 'mixins' => [
- 'layout',
- 'min',
- 'picker',
- 'userpicker'
- ],
- 'props' => [
- /**
- * Unset inherited props
- */
- 'after' => null,
- 'autofocus' => null,
- 'before' => null,
- 'icon' => null,
- 'placeholder' => null,
+ 'mixins' => [
+ 'layout',
+ 'min',
+ 'picker',
+ 'userpicker'
+ ],
+ 'props' => [
+ /**
+ * Unset inherited props
+ */
+ 'after' => null,
+ 'autofocus' => null,
+ 'before' => null,
+ 'icon' => null,
+ 'placeholder' => null,
- /**
- * Default selected user(s) when a new page/file/user is created
- */
- 'default' => function ($default = null) {
- if ($default === false) {
- return [];
- }
+ /**
+ * Default selected user(s) when a new page/file/user is created
+ */
+ 'default' => function ($default = null) {
+ if ($default === false) {
+ return [];
+ }
- if ($default === null && $user = $this->kirby()->user()) {
- return [
- $this->userResponse($user)
- ];
- }
+ if ($default === null && $user = $this->kirby()->user()) {
+ return [
+ $this->userResponse($user)
+ ];
+ }
- return $this->toUsers($default);
- },
+ return $this->toUsers($default);
+ },
- 'value' => function ($value = null) {
- return $this->toUsers($value);
- },
- ],
- 'computed' => [
- /**
- * Unset inherited computed
- */
- 'default' => null
- ],
- 'methods' => [
- 'userResponse' => function ($user) {
- return $user->panel()->pickerData([
- 'info' => $this->info,
- 'image' => $this->image,
- 'layout' => $this->layout,
- 'text' => $this->text,
- ]);
- },
- 'toUsers' => function ($value = null) {
- $users = [];
- $kirby = App::instance();
+ 'value' => function ($value = null) {
+ return $this->toUsers($value);
+ },
+ ],
+ 'computed' => [
+ /**
+ * Unset inherited computed
+ */
+ 'default' => null
+ ],
+ 'methods' => [
+ 'userResponse' => function ($user) {
+ return $user->panel()->pickerData([
+ 'info' => $this->info,
+ 'image' => $this->image,
+ 'layout' => $this->layout,
+ 'text' => $this->text,
+ ]);
+ },
+ 'toUsers' => function ($value = null) {
+ $users = [];
+ $kirby = App::instance();
- foreach (Data::decode($value, 'yaml') as $email) {
- if (is_array($email) === true) {
- $email = $email['email'] ?? null;
- }
+ foreach (Data::decode($value, 'yaml') as $email) {
+ if (is_array($email) === true) {
+ $email = $email['email'] ?? null;
+ }
- if ($email !== null && ($user = $kirby->user($email))) {
- $users[] = $this->userResponse($user);
- }
- }
+ if ($email !== null && ($user = $kirby->user($email))) {
+ $users[] = $this->userResponse($user);
+ }
+ }
- return $users;
- }
- ],
- 'api' => function () {
- return [
- [
- 'pattern' => '/',
- 'action' => function () {
- $field = $this->field();
+ return $users;
+ }
+ ],
+ 'api' => function () {
+ return [
+ [
+ 'pattern' => '/',
+ 'action' => function () {
+ $field = $this->field();
- return $field->userpicker([
- 'image' => $field->image(),
- 'info' => $field->info(),
- 'layout' => $field->layout(),
- 'limit' => $field->limit(),
- 'page' => $this->requestQuery('page'),
- 'query' => $field->query(),
- 'search' => $this->requestQuery('search'),
- 'text' => $field->text()
- ]);
- }
- ]
- ];
- },
- 'save' => function ($value = null) {
- return A::pluck($value, 'id');
- },
- 'validations' => [
- 'max',
- 'min'
- ]
+ return $field->userpicker([
+ 'image' => $field->image(),
+ 'info' => $field->info(),
+ 'layout' => $field->layout(),
+ 'limit' => $field->limit(),
+ 'page' => $this->requestQuery('page'),
+ 'query' => $field->query(),
+ 'search' => $this->requestQuery('search'),
+ 'text' => $field->text()
+ ]);
+ }
+ ]
+ ];
+ },
+ 'save' => function ($value = null) {
+ return A::pluck($value, 'id');
+ },
+ 'validations' => [
+ 'max',
+ 'min'
+ ]
];
diff --git a/kirby/config/fields/writer.php b/kirby/config/fields/writer.php
index a19e9b0..73c4976 100755
--- a/kirby/config/fields/writer.php
+++ b/kirby/config/fields/writer.php
@@ -3,34 +3,34 @@
use Kirby\Sane\Sane;
return [
- 'props' => [
- /**
- * Enables inline mode, which will not wrap new lines in paragraphs and creates hard breaks instead.
- *
- * @param bool $inline
- */
- 'inline' => function (bool $inline = false) {
- return $inline;
- },
- /**
- * Sets the allowed HTML formats. Available formats: `bold`, `italic`, `underline`, `strike`, `code`, `link`, `email`. Activate them all by passing `true`. Deactivate them all by passing `false`
- * @param array|bool $marks
- */
- 'marks' => function ($marks = true) {
- return $marks;
- },
- /**
- * Sets the allowed nodes. Available nodes: `paragraph`, `heading`, `bulletList`, `orderedList`. Activate/deactivate them all by passing `true`/`false`. Default nodes are `paragraph`, `heading`, `bulletList`, `orderedList`.
- * @param array|bool|null $nodes
- */
- 'nodes' => function ($nodes = null) {
- return $nodes;
- }
- ],
- 'computed' => [
- 'value' => function () {
- $value = trim($this->value ?? '');
- return Sane::sanitize($value, 'html');
- }
- ],
+ 'props' => [
+ /**
+ * Enables inline mode, which will not wrap new lines in paragraphs and creates hard breaks instead.
+ *
+ * @param bool $inline
+ */
+ 'inline' => function (bool $inline = false) {
+ return $inline;
+ },
+ /**
+ * Sets the allowed HTML formats. Available formats: `bold`, `italic`, `underline`, `strike`, `code`, `link`, `email`. Activate them all by passing `true`. Deactivate them all by passing `false`
+ * @param array|bool $marks
+ */
+ 'marks' => function ($marks = true) {
+ return $marks;
+ },
+ /**
+ * Sets the allowed nodes. Available nodes: `paragraph`, `heading`, `bulletList`, `orderedList`. Activate/deactivate them all by passing `true`/`false`. Default nodes are `paragraph`, `heading`, `bulletList`, `orderedList`.
+ * @param array|bool|null $nodes
+ */
+ 'nodes' => function ($nodes = null) {
+ return $nodes;
+ }
+ ],
+ 'computed' => [
+ 'value' => function () {
+ $value = trim($this->value ?? '');
+ return Sane::sanitize($value, 'html');
+ }
+ ],
];
diff --git a/kirby/config/helpers.php b/kirby/config/helpers.php
index 9e6adab..f8d0476 100755
--- a/kirby/config/helpers.php
+++ b/kirby/config/helpers.php
@@ -14,758 +14,758 @@ use Kirby\Toolkit\Str;
use Kirby\Toolkit\V;
if (Helpers::hasOverride('asset') === false) { // @codeCoverageIgnore
- /**
- * Helper to create an asset object
- *
- * @param string $path
- * @return \Kirby\Filesystem\Asset
- */
- function asset(string $path)
- {
- return new Asset($path);
- }
+ /**
+ * Helper to create an asset object
+ *
+ * @param string $path
+ * @return \Kirby\Filesystem\Asset
+ */
+ function asset(string $path)
+ {
+ return new Asset($path);
+ }
}
if (Helpers::hasOverride('attr') === false) { // @codeCoverageIgnore
- /**
- * Generates a list of HTML attributes
- *
- * @param array|null $attr A list of attributes as key/value array
- * @param string|null $before An optional string that will be prepended if the result is not empty
- * @param string|null $after An optional string that will be appended if the result is not empty
- * @return string|null
- */
- function attr(?array $attr = null, ?string $before = null, ?string $after = null): ?string
- {
- return Html::attr($attr, null, $before, $after);
- }
+ /**
+ * Generates a list of HTML attributes
+ *
+ * @param array|null $attr A list of attributes as key/value array
+ * @param string|null $before An optional string that will be prepended if the result is not empty
+ * @param string|null $after An optional string that will be appended if the result is not empty
+ * @return string|null
+ */
+ function attr(?array $attr = null, ?string $before = null, ?string $after = null): ?string
+ {
+ return Html::attr($attr, null, $before, $after);
+ }
}
if (Helpers::hasOverride('collection') === false) { // @codeCoverageIgnore
- /**
- * Returns the result of a collection by name
- *
- * @param string $name
- * @return \Kirby\Cms\Collection|null
- */
- function collection(string $name)
- {
- return App::instance()->collection($name);
- }
+ /**
+ * Returns the result of a collection by name
+ *
+ * @param string $name
+ * @return \Kirby\Cms\Collection|null
+ */
+ function collection(string $name)
+ {
+ return App::instance()->collection($name);
+ }
}
if (Helpers::hasOverride('csrf') === false) { // @codeCoverageIgnore
- /**
- * Checks / returns a CSRF token
- *
- * @param string|null $check Pass a token here to compare it to the one in the session
- * @return string|bool Either the token or a boolean check result
- */
- function csrf(?string $check = null)
- {
- // check explicitly if there have been no arguments at all;
- // checking for null introduces a security issue because null could come
- // from user input or bugs in the calling code!
- if (func_num_args() === 0) {
- return App::instance()->csrf();
- }
+ /**
+ * Checks / returns a CSRF token
+ *
+ * @param string|null $check Pass a token here to compare it to the one in the session
+ * @return string|bool Either the token or a boolean check result
+ */
+ function csrf(?string $check = null)
+ {
+ // check explicitly if there have been no arguments at all;
+ // checking for null introduces a security issue because null could come
+ // from user input or bugs in the calling code!
+ if (func_num_args() === 0) {
+ return App::instance()->csrf();
+ }
- return App::instance()->csrf($check);
- }
+ return App::instance()->csrf($check);
+ }
}
if (Helpers::hasOverride('css') === false) { // @codeCoverageIgnore
- /**
- * Creates one or multiple CSS link tags
- *
- * @param string|array $url Relative or absolute URLs, an array of URLs or `@auto` for automatic template css loading
- * @param string|array $options Pass an array of attributes for the link tag or a media attribute string
- * @return string|null
- */
- function css($url, $options = null): ?string
- {
- return Html::css($url, $options);
- }
+ /**
+ * Creates one or multiple CSS link tags
+ *
+ * @param string|array $url Relative or absolute URLs, an array of URLs or `@auto` for automatic template css loading
+ * @param string|array $options Pass an array of attributes for the link tag or a media attribute string
+ * @return string|null
+ */
+ function css($url, $options = null): ?string
+ {
+ return Html::css($url, $options);
+ }
}
if (Helpers::hasOverride('deprecated') === false) { // @codeCoverageIgnore
- /**
- * Triggers a deprecation warning if debug mode is active
- * @since 3.3.0
- *
- * @param string $message
- * @return bool Whether the warning was triggered
- */
- function deprecated(string $message): bool
- {
- return Helpers::deprecated($message);
- }
+ /**
+ * Triggers a deprecation warning if debug mode is active
+ * @since 3.3.0
+ *
+ * @param string $message
+ * @return bool Whether the warning was triggered
+ */
+ function deprecated(string $message): bool
+ {
+ return Helpers::deprecated($message);
+ }
}
if (Helpers::hasOverride('dump') === false) { // @codeCoverageIgnore
- /**
- * Simple object and variable dumper
- * to help with debugging.
- *
- * @param mixed $variable
- * @param bool $echo
- * @return string
- */
- function dump($variable, bool $echo = true): string
- {
- return Helpers::dump($variable, $echo);
- }
+ /**
+ * Simple object and variable dumper
+ * to help with debugging.
+ *
+ * @param mixed $variable
+ * @param bool $echo
+ * @return string
+ */
+ function dump($variable, bool $echo = true): string
+ {
+ return Helpers::dump($variable, $echo);
+ }
}
if (Helpers::hasOverride('e') === false) { // @codeCoverageIgnore
- /**
- * Smart version of echo with an if condition as first argument
- *
- * @param mixed $condition
- * @param mixed $value The string to be echoed if the condition is true
- * @param mixed $alternative An alternative string which should be echoed when the condition is false
- */
- function e($condition, $value, $alternative = null)
- {
- echo $condition ? $value : $alternative;
- }
+ /**
+ * Smart version of echo with an if condition as first argument
+ *
+ * @param mixed $condition
+ * @param mixed $value The string to be echoed if the condition is true
+ * @param mixed $alternative An alternative string which should be echoed when the condition is false
+ */
+ function e($condition, $value, $alternative = null)
+ {
+ echo $condition ? $value : $alternative;
+ }
}
if (Helpers::hasOverride('esc') === false) { // @codeCoverageIgnore
- /**
- * Escape context specific output
- *
- * @param string $string Untrusted data
- * @param string $context Location of output (`html`, `attr`, `js`, `css`, `url` or `xml`)
- * @return string Escaped data
- */
- function esc(string $string, string $context = 'html'): string
- {
- return Str::esc($string, $context);
- }
+ /**
+ * Escape context specific output
+ *
+ * @param string $string Untrusted data
+ * @param string $context Location of output (`html`, `attr`, `js`, `css`, `url` or `xml`)
+ * @return string Escaped data
+ */
+ function esc(string $string, string $context = 'html'): string
+ {
+ return Str::esc($string, $context);
+ }
}
if (Helpers::hasOverride('get') === false) { // @codeCoverageIgnore
- /**
- * Shortcut for $kirby->request()->get()
- *
- * @param mixed $key The key to look for. Pass false or null to return the entire request array.
- * @param mixed $default Optional default value, which should be returned if no element has been found
- * @return mixed
- */
- function get($key = null, $default = null)
- {
- return App::instance()->request()->get($key, $default);
- }
+ /**
+ * Shortcut for $kirby->request()->get()
+ *
+ * @param mixed $key The key to look for. Pass false or null to return the entire request array.
+ * @param mixed $default Optional default value, which should be returned if no element has been found
+ * @return mixed
+ */
+ function get($key = null, $default = null)
+ {
+ return App::instance()->request()->get($key, $default);
+ }
}
if (Helpers::hasOverride('gist') === false) { // @codeCoverageIgnore
- /**
- * Embeds a Github Gist
- *
- * @param string $url
- * @param string|null $file
- * @return string
- */
- function gist(string $url, ?string $file = null): string
- {
- return App::instance()->kirbytag([
- 'gist' => $url,
- 'file' => $file,
- ]);
- }
+ /**
+ * Embeds a Github Gist
+ *
+ * @param string $url
+ * @param string|null $file
+ * @return string
+ */
+ function gist(string $url, ?string $file = null): string
+ {
+ return App::instance()->kirbytag([
+ 'gist' => $url,
+ 'file' => $file,
+ ]);
+ }
}
if (Helpers::hasOverride('go') === false) { // @codeCoverageIgnore
- /**
- * Redirects to the given Urls
- * Urls can be relative or absolute.
- *
- * @param string $url
- * @param int $code
- * @return void
- */
- function go(string $url = '/', int $code = 302)
- {
- Response::go($url, $code);
- }
+ /**
+ * Redirects to the given Urls
+ * Urls can be relative or absolute.
+ *
+ * @param string $url
+ * @param int $code
+ * @return void
+ */
+ function go(string $url = '/', int $code = 302)
+ {
+ Response::go($url, $code);
+ }
}
if (Helpers::hasOverride('h') === false) { // @codeCoverageIgnore
- /**
- * Shortcut for html()
- *
- * @param string|null $string unencoded text
- * @param bool $keepTags
- * @return string
- */
- function h(?string $string, bool $keepTags = false): string
- {
- return Html::encode($string, $keepTags);
- }
+ /**
+ * Shortcut for html()
+ *
+ * @param string|null $string unencoded text
+ * @param bool $keepTags
+ * @return string
+ */
+ function h(?string $string, bool $keepTags = false): string
+ {
+ return Html::encode($string, $keepTags);
+ }
}
if (Helpers::hasOverride('html') === false) { // @codeCoverageIgnore
- /**
- * Creates safe html by encoding special characters
- *
- * @param string|null $string unencoded text
- * @param bool $keepTags
- * @return string
- */
- function html(?string $string, bool $keepTags = false): string
- {
- return Html::encode($string, $keepTags);
- }
+ /**
+ * Creates safe html by encoding special characters
+ *
+ * @param string|null $string unencoded text
+ * @param bool $keepTags
+ * @return string
+ */
+ function html(?string $string, bool $keepTags = false): string
+ {
+ return Html::encode($string, $keepTags);
+ }
}
if (Helpers::hasOverride('image') === false) { // @codeCoverageIgnore
- /**
- * Return an image from any page
- * specified by the path
- *
- * Example:
- * = image('some/page/myimage.jpg') ?>
- *
- * @param string|null $path
- * @return \Kirby\Cms\File|null
- */
- function image(?string $path = null)
- {
- return App::instance()->image($path);
- }
+ /**
+ * Return an image from any page
+ * specified by the path
+ *
+ * Example:
+ * = image('some/page/myimage.jpg') ?>
+ *
+ * @param string|null $path
+ * @return \Kirby\Cms\File|null
+ */
+ function image(?string $path = null)
+ {
+ return App::instance()->image($path);
+ }
}
if (Helpers::hasOverride('invalid') === false) { // @codeCoverageIgnore
- /**
- * Runs a number of validators on a set of data and checks if the data is invalid
- *
- * @param array $data
- * @param array $rules
- * @param array $messages
- * @return array
- */
- function invalid(array $data = [], array $rules = [], array $messages = []): array
- {
- return V::invalid($data, $rules, $messages);
- }
+ /**
+ * Runs a number of validators on a set of data and checks if the data is invalid
+ *
+ * @param array $data
+ * @param array $rules
+ * @param array $messages
+ * @return array
+ */
+ function invalid(array $data = [], array $rules = [], array $messages = []): array
+ {
+ return V::invalid($data, $rules, $messages);
+ }
}
if (Helpers::hasOverride('js') === false) { // @codeCoverageIgnore
- /**
- * Creates a script tag to load a javascript file
- *
- * @param string|array $url
- * @param string|array $options
- * @return string|null
- */
- function js($url, $options = null): ?string
- {
- return Html::js($url, $options);
- }
+ /**
+ * Creates a script tag to load a javascript file
+ *
+ * @param string|array $url
+ * @param string|array $options
+ * @return string|null
+ */
+ function js($url, $options = null): ?string
+ {
+ return Html::js($url, $options);
+ }
}
if (Helpers::hasOverride('kirby') === false) { // @codeCoverageIgnore
- /**
- * Returns the Kirby object in any situation
- *
- * @return \Kirby\Cms\App
- */
- function kirby()
- {
- return App::instance();
- }
+ /**
+ * Returns the Kirby object in any situation
+ *
+ * @return \Kirby\Cms\App
+ */
+ function kirby()
+ {
+ return App::instance();
+ }
}
if (Helpers::hasOverride('kirbytag') === false) { // @codeCoverageIgnore
- /**
- * Makes it possible to use any defined Kirbytag as standalone function
- *
- * @param string|array $type
- * @param string|null $value
- * @param array $attr
- * @param array $data
- * @return string
- */
- function kirbytag($type, ?string $value = null, array $attr = [], array $data = []): string
- {
- return App::instance()->kirbytag($type, $value, $attr, $data);
- }
+ /**
+ * Makes it possible to use any defined Kirbytag as standalone function
+ *
+ * @param string|array $type
+ * @param string|null $value
+ * @param array $attr
+ * @param array $data
+ * @return string
+ */
+ function kirbytag($type, ?string $value = null, array $attr = [], array $data = []): string
+ {
+ return App::instance()->kirbytag($type, $value, $attr, $data);
+ }
}
if (Helpers::hasOverride('kirbytags') === false) { // @codeCoverageIgnore
- /**
- * Parses KirbyTags in the given string. Shortcut
- * for `$kirby->kirbytags($text, $data)`
- *
- * @param string|null $text
- * @param array $data
- * @return string
- */
- function kirbytags(?string $text = null, array $data = []): string
- {
- return App::instance()->kirbytags($text, $data);
- }
+ /**
+ * Parses KirbyTags in the given string. Shortcut
+ * for `$kirby->kirbytags($text, $data)`
+ *
+ * @param string|null $text
+ * @param array $data
+ * @return string
+ */
+ function kirbytags(?string $text = null, array $data = []): string
+ {
+ return App::instance()->kirbytags($text, $data);
+ }
}
if (Helpers::hasOverride('kirbytext') === false) { // @codeCoverageIgnore
- /**
- * Parses KirbyTags and Markdown in the
- * given string. Shortcut for `$kirby->kirbytext()`
- *
- * @param string|null $text
- * @param array $data
- * @return string
- */
- function kirbytext(?string $text = null, array $data = []): string
- {
- return App::instance()->kirbytext($text, $data);
- }
+ /**
+ * Parses KirbyTags and Markdown in the
+ * given string. Shortcut for `$kirby->kirbytext()`
+ *
+ * @param string|null $text
+ * @param array $data
+ * @return string
+ */
+ function kirbytext(?string $text = null, array $data = []): string
+ {
+ return App::instance()->kirbytext($text, $data);
+ }
}
if (Helpers::hasOverride('kirbytextinline') === false) { // @codeCoverageIgnore
- /**
- * Parses KirbyTags and inline Markdown in the
- * given string.
- * @since 3.1.0
- *
- * @param string|null $text
- * @param array $options
- * @return string
- */
- function kirbytextinline(?string $text = null, array $options = []): string
- {
- $options['markdown']['inline'] = true;
- return App::instance()->kirbytext($text, $options);
- }
+ /**
+ * Parses KirbyTags and inline Markdown in the
+ * given string.
+ * @since 3.1.0
+ *
+ * @param string|null $text
+ * @param array $options
+ * @return string
+ */
+ function kirbytextinline(?string $text = null, array $options = []): string
+ {
+ $options['markdown']['inline'] = true;
+ return App::instance()->kirbytext($text, $options);
+ }
}
if (Helpers::hasOverride('kt') === false) { // @codeCoverageIgnore
- /**
- * Shortcut for `kirbytext()` helper
- *
- * @param string|null $text
- * @param array $data
- * @return string
- */
- function kt(?string $text = null, array $data = []): string
- {
- return App::instance()->kirbytext($text, $data);
- }
+ /**
+ * Shortcut for `kirbytext()` helper
+ *
+ * @param string|null $text
+ * @param array $data
+ * @return string
+ */
+ function kt(?string $text = null, array $data = []): string
+ {
+ return App::instance()->kirbytext($text, $data);
+ }
}
if (Helpers::hasOverride('kti') === false) { // @codeCoverageIgnore
- /**
- * Shortcut for `kirbytextinline()` helper
- * @since 3.1.0
- *
- * @param string|null $text
- * @param array $options
- * @return string
- */
- function kti(?string $text = null, array $options = []): string
- {
- $options['markdown']['inline'] = true;
- return App::instance()->kirbytext($text, $options);
- }
+ /**
+ * Shortcut for `kirbytextinline()` helper
+ * @since 3.1.0
+ *
+ * @param string|null $text
+ * @param array $options
+ * @return string
+ */
+ function kti(?string $text = null, array $options = []): string
+ {
+ $options['markdown']['inline'] = true;
+ return App::instance()->kirbytext($text, $options);
+ }
}
if (Helpers::hasOverride('load') === false) { // @codeCoverageIgnore
- /**
- * A super simple class autoloader
- *
- * @param array $classmap
- * @param string|null $base
- * @return void
- */
- function load(array $classmap, ?string $base = null): void
- {
- F::loadClasses($classmap, $base);
- }
+ /**
+ * A super simple class autoloader
+ *
+ * @param array $classmap
+ * @param string|null $base
+ * @return void
+ */
+ function load(array $classmap, ?string $base = null): void
+ {
+ F::loadClasses($classmap, $base);
+ }
}
if (Helpers::hasOverride('markdown') === false) { // @codeCoverageIgnore
- /**
- * Parses markdown in the given string. Shortcut for
- * `$kirby->markdown($text)`
- *
- * @param string|null $text
- * @param array $options
- * @return string
- */
- function markdown(?string $text = null, array $options = []): string
- {
- return App::instance()->markdown($text, $options);
- }
+ /**
+ * Parses markdown in the given string. Shortcut for
+ * `$kirby->markdown($text)`
+ *
+ * @param string|null $text
+ * @param array $options
+ * @return string
+ */
+ function markdown(?string $text = null, array $options = []): string
+ {
+ return App::instance()->markdown($text, $options);
+ }
}
if (Helpers::hasOverride('option') === false) { // @codeCoverageIgnore
- /**
- * Shortcut for `$kirby->option($key, $default)`
- *
- * @param string $key
- * @param mixed $default
- * @return mixed
- */
- function option(string $key, $default = null)
- {
- return App::instance()->option($key, $default);
- }
+ /**
+ * Shortcut for `$kirby->option($key, $default)`
+ *
+ * @param string $key
+ * @param mixed $default
+ * @return mixed
+ */
+ function option(string $key, $default = null)
+ {
+ return App::instance()->option($key, $default);
+ }
}
if (Helpers::hasOverride('page') === false) { // @codeCoverageIgnore
- /**
- * Fetches a single page by id or
- * the current page when no id is specified
- *
- * @param string|null $id
- * @return \Kirby\Cms\Page|null
- */
- function page(?string $id = null)
- {
- if (empty($id) === true) {
- return App::instance()->site()->page();
- }
+ /**
+ * Fetches a single page by id or
+ * the current page when no id is specified
+ *
+ * @param string|null $id
+ * @return \Kirby\Cms\Page|null
+ */
+ function page(?string $id = null)
+ {
+ if (empty($id) === true) {
+ return App::instance()->site()->page();
+ }
- return App::instance()->site()->find($id);
- }
+ return App::instance()->site()->find($id);
+ }
}
if (Helpers::hasOverride('pages') === false) { // @codeCoverageIgnore
- /**
- * Helper to build pages collection
- *
- * @param string|array ...$id
- * @return \Kirby\Cms\Pages|null
- */
- function pages(...$id)
- {
- // ensure that a list of string arguments and an array
- // as the first argument are treated the same
- if (count($id) === 1 && is_array($id[0]) === true) {
- $id = $id[0];
- }
+ /**
+ * Helper to build pages collection
+ *
+ * @param string|array ...$id
+ * @return \Kirby\Cms\Pages|null
+ */
+ function pages(...$id)
+ {
+ // ensure that a list of string arguments and an array
+ // as the first argument are treated the same
+ if (count($id) === 1 && is_array($id[0]) === true) {
+ $id = $id[0];
+ }
- // always passes $id an array; ensures we get a
- // collection even if only one ID is passed
- return App::instance()->site()->find($id);
- }
+ // always passes $id an array; ensures we get a
+ // collection even if only one ID is passed
+ return App::instance()->site()->find($id);
+ }
}
if (Helpers::hasOverride('param') === false) { // @codeCoverageIgnore
- /**
- * Returns a single param from the URL
- *
- * @param string $key
- * @param string|null $fallback
- * @return string|null
- */
- function param(string $key, ?string $fallback = null): ?string
- {
- return App::instance()->request()->url()->params()->$key ?? $fallback;
- }
+ /**
+ * Returns a single param from the URL
+ *
+ * @param string $key
+ * @param string|null $fallback
+ * @return string|null
+ */
+ function param(string $key, ?string $fallback = null): ?string
+ {
+ return App::instance()->request()->url()->params()->$key ?? $fallback;
+ }
}
if (Helpers::hasOverride('params') === false) { // @codeCoverageIgnore
- /**
- * Returns all params from the current Url
- *
- * @return array
- */
- function params(): array
- {
- return App::instance()->request()->url()->params()->toArray();
- }
+ /**
+ * Returns all params from the current Url
+ *
+ * @return array
+ */
+ function params(): array
+ {
+ return App::instance()->request()->url()->params()->toArray();
+ }
}
if (Helpers::hasOverride('r') === false) { // @codeCoverageIgnore
- /**
- * Smart version of return with an if condition as first argument
- *
- * @param mixed $condition
- * @param mixed $value The string to be returned if the condition is true
- * @param mixed $alternative An alternative string which should be returned when the condition is false
- * @return mixed
- */
- function r($condition, $value, $alternative = null)
- {
- return $condition ? $value : $alternative;
- }
+ /**
+ * Smart version of return with an if condition as first argument
+ *
+ * @param mixed $condition
+ * @param mixed $value The string to be returned if the condition is true
+ * @param mixed $alternative An alternative string which should be returned when the condition is false
+ * @return mixed
+ */
+ function r($condition, $value, $alternative = null)
+ {
+ return $condition ? $value : $alternative;
+ }
}
if (Helpers::hasOverride('router') === false) { // @codeCoverageIgnore
- /**
- * Creates a micro-router and executes
- * the routing action immediately
- * @since 3.6.0
- *
- * @param string|null $path
- * @param string $method
- * @param array $routes
- * @param \Closure|null $callback
- * @return mixed
- */
- function router(?string $path = null, string $method = 'GET', array $routes = [], ?Closure $callback = null)
- {
- return Router::execute($path, $method, $routes, $callback);
- }
+ /**
+ * Creates a micro-router and executes
+ * the routing action immediately
+ * @since 3.6.0
+ *
+ * @param string|null $path
+ * @param string $method
+ * @param array $routes
+ * @param \Closure|null $callback
+ * @return mixed
+ */
+ function router(?string $path = null, string $method = 'GET', array $routes = [], ?Closure $callback = null)
+ {
+ return Router::execute($path, $method, $routes, $callback);
+ }
}
if (Helpers::hasOverride('site') === false) { // @codeCoverageIgnore
- /**
- * Returns the current site object
- *
- * @return \Kirby\Cms\Site
- */
- function site()
- {
- return App::instance()->site();
- }
+ /**
+ * Returns the current site object
+ *
+ * @return \Kirby\Cms\Site
+ */
+ function site()
+ {
+ return App::instance()->site();
+ }
}
if (Helpers::hasOverride('size') === false) { // @codeCoverageIgnore
- /**
- * Determines the size/length of numbers, strings, arrays and countable objects
- *
- * @param mixed $value
- * @return int
- * @throws \Kirby\Exception\InvalidArgumentException
- */
- function size($value): int
- {
- return Helpers::size($value);
- }
+ /**
+ * Determines the size/length of numbers, strings, arrays and countable objects
+ *
+ * @param mixed $value
+ * @return int
+ * @throws \Kirby\Exception\InvalidArgumentException
+ */
+ function size($value): int
+ {
+ return Helpers::size($value);
+ }
}
if (Helpers::hasOverride('smartypants') === false) { // @codeCoverageIgnore
- /**
- * Enhances the given string with
- * smartypants. Shortcut for `$kirby->smartypants($text)`
- *
- * @param string|null $text
- * @return string
- */
- function smartypants(?string $text = null): string
- {
- return App::instance()->smartypants($text);
- }
+ /**
+ * Enhances the given string with
+ * smartypants. Shortcut for `$kirby->smartypants($text)`
+ *
+ * @param string|null $text
+ * @return string
+ */
+ function smartypants(?string $text = null): string
+ {
+ return App::instance()->smartypants($text);
+ }
}
if (Helpers::hasOverride('snippet') === false) { // @codeCoverageIgnore
- /**
- * Embeds a snippet from the snippet folder
- *
- * @param string|array $name
- * @param array|object $data
- * @param bool $return
- * @return string|null
- */
- function snippet($name, $data = [], bool $return = false): ?string
- {
- return App::instance()->snippet($name, $data, $return);
- }
+ /**
+ * Embeds a snippet from the snippet folder
+ *
+ * @param string|array $name
+ * @param array|object $data
+ * @param bool $return
+ * @return string|null
+ */
+ function snippet($name, $data = [], bool $return = false): ?string
+ {
+ return App::instance()->snippet($name, $data, $return);
+ }
}
if (Helpers::hasOverride('svg') === false) { // @codeCoverageIgnore
- /**
- * Includes an SVG file by absolute or
- * relative file path.
- *
- * @param string|\Kirby\Cms\File $file
- * @return string|false
- */
- function svg($file)
- {
- return Html::svg($file);
- }
+ /**
+ * Includes an SVG file by absolute or
+ * relative file path.
+ *
+ * @param string|\Kirby\Cms\File $file
+ * @return string|false
+ */
+ function svg($file)
+ {
+ return Html::svg($file);
+ }
}
if (Helpers::hasOverride('t') === false) { // @codeCoverageIgnore
- /**
- * Returns translate string for key from translation file
- *
- * @param string|array $key
- * @param string|null $fallback
- * @param string|null $locale
- * @return array|string|null
- */
- function t($key, string $fallback = null, string $locale = null)
- {
- return I18n::translate($key, $fallback, $locale);
- }
+ /**
+ * Returns translate string for key from translation file
+ *
+ * @param string|array $key
+ * @param string|null $fallback
+ * @param string|null $locale
+ * @return array|string|null
+ */
+ function t($key, string $fallback = null, string $locale = null)
+ {
+ return I18n::translate($key, $fallback, $locale);
+ }
}
if (Helpers::hasOverride('tc') === false) { // @codeCoverageIgnore
- /**
- * Translates a count
- *
- * @param string $key
- * @param int $count
- * @param string|null $locale
- * @param bool $formatNumber If set to `false`, the count is not formatted
- * @return mixed
- */
- function tc(
- string $key,
- int $count,
- string $locale = null,
- bool $formatNumber = true
- ) {
- return I18n::translateCount($key, $count, $locale, $formatNumber);
- }
+ /**
+ * Translates a count
+ *
+ * @param string $key
+ * @param int $count
+ * @param string|null $locale
+ * @param bool $formatNumber If set to `false`, the count is not formatted
+ * @return mixed
+ */
+ function tc(
+ string $key,
+ int $count,
+ string $locale = null,
+ bool $formatNumber = true
+ ) {
+ return I18n::translateCount($key, $count, $locale, $formatNumber);
+ }
}
if (Helpers::hasOverride('timestamp') === false) { // @codeCoverageIgnore
- /**
- * Rounds the minutes of the given date
- * by the defined step
- *
- * @param string|null $date
- * @param int|array|null $step array of `unit` and `size` to round to nearest
- * @return int|null
- */
- function timestamp(?string $date = null, $step = null): ?int
- {
- return Date::roundedTimestamp($date, $step);
- }
+ /**
+ * Rounds the minutes of the given date
+ * by the defined step
+ *
+ * @param string|null $date
+ * @param int|array|null $step array of `unit` and `size` to round to nearest
+ * @return int|null
+ */
+ function timestamp(?string $date = null, $step = null): ?int
+ {
+ return Date::roundedTimestamp($date, $step);
+ }
}
if (Helpers::hasOverride('tt') === false) { // @codeCoverageIgnore
- /**
- * Translate by key and then replace
- * placeholders in the text
- *
- * @param string $key
- * @param string|array|null $fallback
- * @param array|null $replace
- * @param string|null $locale
- * @return string
- */
- function tt(string $key, $fallback = null, ?array $replace = null, ?string $locale = null): string
- {
- return I18n::template($key, $fallback, $replace, $locale);
- }
+ /**
+ * Translate by key and then replace
+ * placeholders in the text
+ *
+ * @param string $key
+ * @param string|array|null $fallback
+ * @param array|null $replace
+ * @param string|null $locale
+ * @return string
+ */
+ function tt(string $key, $fallback = null, ?array $replace = null, ?string $locale = null): string
+ {
+ return I18n::template($key, $fallback, $replace, $locale);
+ }
}
if (Helpers::hasOverride('twitter') === false) { // @codeCoverageIgnore
- /**
- * Builds a Twitter link
- *
- * @param string $username
- * @param string|null $text
- * @param string|null $title
- * @param string|null $class
- * @return string
- */
- function twitter(string $username, ?string $text = null, ?string $title = null, ?string $class = null): string
- {
- return App::instance()->kirbytag([
- 'twitter' => $username,
- 'text' => $text,
- 'title' => $title,
- 'class' => $class
- ]);
- }
+ /**
+ * Builds a Twitter link
+ *
+ * @param string $username
+ * @param string|null $text
+ * @param string|null $title
+ * @param string|null $class
+ * @return string
+ */
+ function twitter(string $username, ?string $text = null, ?string $title = null, ?string $class = null): string
+ {
+ return App::instance()->kirbytag([
+ 'twitter' => $username,
+ 'text' => $text,
+ 'title' => $title,
+ 'class' => $class
+ ]);
+ }
}
if (Helpers::hasOverride('u') === false) { // @codeCoverageIgnore
- /**
- * Shortcut for url()
- *
- * @param string|null $path
- * @param array|string|null $options
- * @return string
- */
- function u(?string $path = null, $options = null): string
- {
- return Url::to($path, $options);
- }
+ /**
+ * Shortcut for url()
+ *
+ * @param string|null $path
+ * @param array|string|null $options
+ * @return string
+ */
+ function u(?string $path = null, $options = null): string
+ {
+ return Url::to($path, $options);
+ }
}
if (Helpers::hasOverride('url') === false) { // @codeCoverageIgnore
- /**
- * Builds an absolute URL for a given path
- *
- * @param string|null $path
- * @param array|string|null $options
- * @return string
- */
- function url(?string $path = null, $options = null): string
- {
- return Url::to($path, $options);
- }
+ /**
+ * Builds an absolute URL for a given path
+ *
+ * @param string|null $path
+ * @param array|string|null $options
+ * @return string
+ */
+ function url(?string $path = null, $options = null): string
+ {
+ return Url::to($path, $options);
+ }
}
if (Helpers::hasOverride('uuid') === false) { // @codeCoverageIgnore
- /**
- * Creates a compliant v4 UUID
- *
- * @return string
- */
- function uuid(): string
- {
- return Str::uuid();
- }
+ /**
+ * Creates a compliant v4 UUID
+ *
+ * @return string
+ */
+ function uuid(): string
+ {
+ return Str::uuid();
+ }
}
if (Helpers::hasOverride('video') === false) { // @codeCoverageIgnore
- /**
- * Creates a video embed via iframe for Youtube or Vimeo
- * videos. The embed Urls are automatically detected from
- * the given Url.
- *
- * @param string $url
- * @param array $options
- * @param array $attr
- * @return string|null
- */
- function video(string $url, array $options = [], array $attr = []): ?string
- {
- return Html::video($url, $options, $attr);
- }
+ /**
+ * Creates a video embed via iframe for Youtube or Vimeo
+ * videos. The embed Urls are automatically detected from
+ * the given Url.
+ *
+ * @param string $url
+ * @param array $options
+ * @param array $attr
+ * @return string|null
+ */
+ function video(string $url, array $options = [], array $attr = []): ?string
+ {
+ return Html::video($url, $options, $attr);
+ }
}
if (Helpers::hasOverride('vimeo') === false) { // @codeCoverageIgnore
- /**
- * Embeds a Vimeo video by URL in an iframe
- *
- * @param string $url
- * @param array $options
- * @param array $attr
- * @return string|null
- */
- function vimeo(string $url, array $options = [], array $attr = []): ?string
- {
- return Html::vimeo($url, $options, $attr);
- }
+ /**
+ * Embeds a Vimeo video by URL in an iframe
+ *
+ * @param string $url
+ * @param array $options
+ * @param array $attr
+ * @return string|null
+ */
+ function vimeo(string $url, array $options = [], array $attr = []): ?string
+ {
+ return Html::vimeo($url, $options, $attr);
+ }
}
if (Helpers::hasOverride('widont') === false) { // @codeCoverageIgnore
- /**
- * The widont function makes sure that there are no
- * typographical widows at the end of a paragraph –
- * that's a single word in the last line
- *
- * @param string|null $string
- * @return string
- */
- function widont(string $string = null): string
- {
- return Str::widont($string);
- }
+ /**
+ * The widont function makes sure that there are no
+ * typographical widows at the end of a paragraph –
+ * that's a single word in the last line
+ *
+ * @param string|null $string
+ * @return string
+ */
+ function widont(string $string = null): string
+ {
+ return Str::widont($string);
+ }
}
if (Helpers::hasOverride('youtube') === false) { // @codeCoverageIgnore
- /**
- * Embeds a Youtube video by URL in an iframe
- *
- * @param string $url
- * @param array $options
- * @param array $attr
- * @return string|null
- */
- function youtube(string $url, array $options = [], array $attr = []): ?string
- {
- return Html::youtube($url, $options, $attr);
- }
+ /**
+ * Embeds a Youtube video by URL in an iframe
+ *
+ * @param string $url
+ * @param array $options
+ * @param array $attr
+ * @return string|null
+ */
+ function youtube(string $url, array $options = [], array $attr = []): ?string
+ {
+ return Html::youtube($url, $options, $attr);
+ }
}
diff --git a/kirby/config/methods.php b/kirby/config/methods.php
index d49f799..00209c0 100755
--- a/kirby/config/methods.php
+++ b/kirby/config/methods.php
@@ -19,596 +19,596 @@ use Kirby\Toolkit\Xml;
* Field method setup
*/
return function (App $app) {
- return [
+ return [
- // states
+ // states
- /**
- * Converts the field value into a proper boolean and inverts it
- *
- * @param \Kirby\Cms\Field $field
- * @return bool
- */
- 'isFalse' => function (Field $field): bool {
- return $field->toBool() === false;
- },
+ /**
+ * Converts the field value into a proper boolean and inverts it
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return bool
+ */
+ 'isFalse' => function (Field $field): bool {
+ return $field->toBool() === false;
+ },
- /**
- * Converts the field value into a proper boolean
- *
- * @param \Kirby\Cms\Field $field
- * @return bool
- */
- 'isTrue' => function (Field $field): bool {
- return $field->toBool() === true;
- },
+ /**
+ * Converts the field value into a proper boolean
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return bool
+ */
+ 'isTrue' => function (Field $field): bool {
+ return $field->toBool() === true;
+ },
- /**
- * Validates the field content with the given validator and parameters
- *
- * @param string $validator
- * @param mixed ...$arguments A list of optional validator arguments
- * @return bool
- */
- 'isValid' => function (Field $field, string $validator, ...$arguments): bool {
- return V::$validator($field->value, ...$arguments);
- },
+ /**
+ * Validates the field content with the given validator and parameters
+ *
+ * @param string $validator
+ * @param mixed ...$arguments A list of optional validator arguments
+ * @return bool
+ */
+ 'isValid' => function (Field $field, string $validator, ...$arguments): bool {
+ return V::$validator($field->value, ...$arguments);
+ },
- // converters
- /**
- * Converts a yaml or json field to a Blocks object
- *
- * @param \Kirby\Cms\Field $field
- * @return \Kirby\Cms\Blocks
- */
- 'toBlocks' => function (Field $field) {
- try {
- $blocks = Blocks::factory(Blocks::parse($field->value()), [
- 'parent' => $field->parent(),
- ]);
+ // converters
+ /**
+ * Converts a yaml or json field to a Blocks object
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return \Kirby\Cms\Blocks
+ */
+ 'toBlocks' => function (Field $field) {
+ try {
+ $blocks = Blocks::factory(Blocks::parse($field->value()), [
+ 'parent' => $field->parent(),
+ ]);
- return $blocks->filter('isHidden', false);
- } catch (Throwable $e) {
- if ($field->parent() === null) {
- $message = 'Invalid blocks data for "' . $field->key() . '" field';
- } else {
- $message = 'Invalid blocks data for "' . $field->key() . '" field on parent "' . $field->parent()->title() . '"';
- }
+ return $blocks->filter('isHidden', false);
+ } catch (Throwable $e) {
+ if ($field->parent() === null) {
+ $message = 'Invalid blocks data for "' . $field->key() . '" field';
+ } else {
+ $message = 'Invalid blocks data for "' . $field->key() . '" field on parent "' . $field->parent()->title() . '"';
+ }
- throw new InvalidArgumentException($message);
- }
- },
+ throw new InvalidArgumentException($message);
+ }
+ },
- /**
- * Converts the field value into a proper boolean
- *
- * @param \Kirby\Cms\Field $field
- * @param bool $default Default value if the field is empty
- * @return bool
- */
- 'toBool' => function (Field $field, $default = false): bool {
- $value = $field->isEmpty() ? $default : $field->value;
- return filter_var($value, FILTER_VALIDATE_BOOLEAN);
- },
+ /**
+ * Converts the field value into a proper boolean
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param bool $default Default value if the field is empty
+ * @return bool
+ */
+ 'toBool' => function (Field $field, $default = false): bool {
+ $value = $field->isEmpty() ? $default : $field->value;
+ return filter_var($value, FILTER_VALIDATE_BOOLEAN);
+ },
- /**
- * Parses the field value with the given method
- *
- * @param \Kirby\Cms\Field $field
- * @param string $method [',', 'yaml', 'json']
- * @return array
- */
- 'toData' => function (Field $field, string $method = ',') {
- switch ($method) {
- case 'yaml':
- case 'json':
- return Data::decode($field->value, $method);
- default:
- return $field->split($method);
- }
- },
+ /**
+ * Parses the field value with the given method
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param string $method [',', 'yaml', 'json']
+ * @return array
+ */
+ 'toData' => function (Field $field, string $method = ',') {
+ switch ($method) {
+ case 'yaml':
+ case 'json':
+ return Data::decode($field->value, $method);
+ default:
+ return $field->split($method);
+ }
+ },
- /**
- * Converts the field value to a timestamp or a formatted date
- *
- * @param \Kirby\Cms\Field $field
- * @param string|\IntlDateFormatter|null $format PHP date formatting string
- * @param string|null $fallback Fallback string for `strtotime` (since 3.2)
- * @return string|int
- */
- 'toDate' => function (Field $field, $format = null, string $fallback = null) use ($app) {
- if (empty($field->value) === true && $fallback === null) {
- return null;
- }
+ /**
+ * Converts the field value to a timestamp or a formatted date
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param string|\IntlDateFormatter|null $format PHP date formatting string
+ * @param string|null $fallback Fallback string for `strtotime` (since 3.2)
+ * @return string|int
+ */
+ 'toDate' => function (Field $field, $format = null, string $fallback = null) use ($app) {
+ if (empty($field->value) === true && $fallback === null) {
+ return null;
+ }
- if (empty($field->value) === false) {
- $time = $field->toTimestamp();
- } else {
- $time = strtotime($fallback);
- }
+ if (empty($field->value) === false) {
+ $time = $field->toTimestamp();
+ } else {
+ $time = strtotime($fallback);
+ }
- $handler = $app->option('date.handler', 'date');
- return Str::date($time, $format, $handler);
- },
+ $handler = $app->option('date.handler', 'date');
+ return Str::date($time, $format, $handler);
+ },
- /**
- * Returns a file object from a filename in the field
- *
- * @param \Kirby\Cms\Field $field
- * @return \Kirby\Cms\File|null
- */
- 'toFile' => function (Field $field) {
- return $field->toFiles()->first();
- },
+ /**
+ * Returns a file object from a filename in the field
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return \Kirby\Cms\File|null
+ */
+ 'toFile' => function (Field $field) {
+ return $field->toFiles()->first();
+ },
- /**
- * Returns a file collection from a yaml list of filenames in the field
- *
- * @param \Kirby\Cms\Field $field
- * @param string $separator
- * @return \Kirby\Cms\Files
- */
- 'toFiles' => function (Field $field, string $separator = 'yaml') {
- $parent = $field->parent();
- $files = new Files([]);
+ /**
+ * Returns a file collection from a yaml list of filenames in the field
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param string $separator
+ * @return \Kirby\Cms\Files
+ */
+ 'toFiles' => function (Field $field, string $separator = 'yaml') {
+ $parent = $field->parent();
+ $files = new Files([]);
- foreach ($field->toData($separator) as $id) {
- if ($file = $parent->kirby()->file($id, $parent)) {
- $files->add($file);
- }
- }
+ foreach ($field->toData($separator) as $id) {
+ if ($file = $parent->kirby()->file($id, $parent)) {
+ $files->add($file);
+ }
+ }
- return $files;
- },
+ return $files;
+ },
- /**
- * Converts the field value into a proper float
- *
- * @param \Kirby\Cms\Field $field
- * @param float $default Default value if the field is empty
- * @return float
- */
- 'toFloat' => function (Field $field, float $default = 0) {
- $value = $field->isEmpty() ? $default : $field->value;
- return (float)$value;
- },
+ /**
+ * Converts the field value into a proper float
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param float $default Default value if the field is empty
+ * @return float
+ */
+ 'toFloat' => function (Field $field, float $default = 0) {
+ $value = $field->isEmpty() ? $default : $field->value;
+ return (float)$value;
+ },
- /**
- * Converts the field value into a proper integer
- *
- * @param \Kirby\Cms\Field $field
- * @param int $default Default value if the field is empty
- * @return int
- */
- 'toInt' => function (Field $field, int $default = 0) {
- $value = $field->isEmpty() ? $default : $field->value;
- return (int)$value;
- },
+ /**
+ * Converts the field value into a proper integer
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param int $default Default value if the field is empty
+ * @return int
+ */
+ 'toInt' => function (Field $field, int $default = 0) {
+ $value = $field->isEmpty() ? $default : $field->value;
+ return (int)$value;
+ },
- /**
- * Parse layouts and turn them into
- * Layout objects
- *
- * @param \Kirby\Cms\Field $field
- * @return \Kirby\Cms\Layouts
- */
- 'toLayouts' => function (Field $field) {
- return Layouts::factory(Layouts::parse($field->value()), [
- 'parent' => $field->parent()
- ]);
- },
+ /**
+ * Parse layouts and turn them into
+ * Layout objects
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return \Kirby\Cms\Layouts
+ */
+ 'toLayouts' => function (Field $field) {
+ return Layouts::factory(Layouts::parse($field->value()), [
+ 'parent' => $field->parent()
+ ]);
+ },
- /**
- * Wraps a link tag around the field value. The field value is used as the link text
- *
- * @param \Kirby\Cms\Field $field
- * @param mixed $attr1 Can be an optional Url. If no Url is set, the Url of the Page, File or Site will be used. Can also be an array of link attributes
- * @param mixed $attr2 If `$attr1` is used to set the Url, you can use `$attr2` to pass an array of additional attributes.
- * @return string
- */
- 'toLink' => function (Field $field, $attr1 = null, $attr2 = null) {
- if (is_string($attr1) === true) {
- $href = $attr1;
- $attr = $attr2;
- } else {
- $href = $field->parent()->url();
- $attr = $attr1;
- }
+ /**
+ * Wraps a link tag around the field value. The field value is used as the link text
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param mixed $attr1 Can be an optional Url. If no Url is set, the Url of the Page, File or Site will be used. Can also be an array of link attributes
+ * @param mixed $attr2 If `$attr1` is used to set the Url, you can use `$attr2` to pass an array of additional attributes.
+ * @return string
+ */
+ 'toLink' => function (Field $field, $attr1 = null, $attr2 = null) {
+ if (is_string($attr1) === true) {
+ $href = $attr1;
+ $attr = $attr2;
+ } else {
+ $href = $field->parent()->url();
+ $attr = $attr1;
+ }
- if ($field->parent()->isActive()) {
- $attr['aria-current'] = 'page';
- }
+ if ($field->parent()->isActive()) {
+ $attr['aria-current'] = 'page';
+ }
- return Html::a($href, $field->value, $attr ?? []);
- },
+ return Html::a($href, $field->value, $attr ?? []);
+ },
- /**
- * Returns a page object from a page id in the field
- *
- * @param \Kirby\Cms\Field $field
- * @return \Kirby\Cms\Page|null
- */
- 'toPage' => function (Field $field) {
- return $field->toPages()->first();
- },
+ /**
+ * Returns a page object from a page id in the field
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return \Kirby\Cms\Page|null
+ */
+ 'toPage' => function (Field $field) {
+ return $field->toPages()->first();
+ },
- /**
- * Returns a pages collection from a yaml list of page ids in the field
- *
- * @param \Kirby\Cms\Field $field
- * @param string $separator Can be any other separator to split the field value by
- * @return \Kirby\Cms\Pages
- */
- 'toPages' => function (Field $field, string $separator = 'yaml') use ($app) {
- return $app->site()->find(false, false, ...$field->toData($separator));
- },
+ /**
+ * Returns a pages collection from a yaml list of page ids in the field
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param string $separator Can be any other separator to split the field value by
+ * @return \Kirby\Cms\Pages
+ */
+ 'toPages' => function (Field $field, string $separator = 'yaml') use ($app) {
+ return $app->site()->find(false, false, ...$field->toData($separator));
+ },
- /**
- * Converts a yaml field to a Structure object
- *
- * @param \Kirby\Cms\Field $field
- * @return \Kirby\Cms\Structure
- */
- 'toStructure' => function (Field $field) {
- try {
- return new Structure(Data::decode($field->value, 'yaml'), $field->parent());
- } catch (Exception $e) {
- if ($field->parent() === null) {
- $message = 'Invalid structure data for "' . $field->key() . '" field';
- } else {
- $message = 'Invalid structure data for "' . $field->key() . '" field on parent "' . $field->parent()->title() . '"';
- }
+ /**
+ * Converts a yaml field to a Structure object
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return \Kirby\Cms\Structure
+ */
+ 'toStructure' => function (Field $field) {
+ try {
+ return new Structure(Data::decode($field->value, 'yaml'), $field->parent());
+ } catch (Exception $e) {
+ if ($field->parent() === null) {
+ $message = 'Invalid structure data for "' . $field->key() . '" field';
+ } else {
+ $message = 'Invalid structure data for "' . $field->key() . '" field on parent "' . $field->parent()->title() . '"';
+ }
- throw new InvalidArgumentException($message);
- }
- },
+ throw new InvalidArgumentException($message);
+ }
+ },
- /**
- * Converts the field value to a Unix timestamp
- *
- * @param \Kirby\Cms\Field $field
- * @return int
- */
- 'toTimestamp' => function (Field $field): int {
- return strtotime($field->value);
- },
+ /**
+ * Converts the field value to a Unix timestamp
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return int
+ */
+ 'toTimestamp' => function (Field $field): int {
+ return strtotime($field->value);
+ },
- /**
- * Turns the field value into an absolute Url
- *
- * @param \Kirby\Cms\Field $field
- * @return string
- */
- 'toUrl' => function (Field $field): string {
- return Url::to($field->value);
- },
+ /**
+ * Turns the field value into an absolute Url
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return string
+ */
+ 'toUrl' => function (Field $field): string {
+ return Url::to($field->value);
+ },
- /**
- * Converts a user email address to a user object
- *
- * @param \Kirby\Cms\Field $field
- * @return \Kirby\Cms\User|null
- */
- 'toUser' => function (Field $field) {
- return $field->toUsers()->first();
- },
+ /**
+ * Converts a user email address to a user object
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return \Kirby\Cms\User|null
+ */
+ 'toUser' => function (Field $field) {
+ return $field->toUsers()->first();
+ },
- /**
- * Returns a users collection from a yaml list of user email addresses in the field
- *
- * @param \Kirby\Cms\Field $field
- * @param string $separator
- * @return \Kirby\Cms\Users
- */
- 'toUsers' => function (Field $field, string $separator = 'yaml') use ($app) {
- return $app->users()->find(false, false, ...$field->toData($separator));
- },
+ /**
+ * Returns a users collection from a yaml list of user email addresses in the field
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param string $separator
+ * @return \Kirby\Cms\Users
+ */
+ 'toUsers' => function (Field $field, string $separator = 'yaml') use ($app) {
+ return $app->users()->find(false, false, ...$field->toData($separator));
+ },
- // inspectors
+ // inspectors
- /**
- * Returns the length of the field content
- */
- 'length' => function (Field $field) {
- return Str::length($field->value);
- },
+ /**
+ * Returns the length of the field content
+ */
+ 'length' => function (Field $field) {
+ return Str::length($field->value);
+ },
- /**
- * Returns the number of words in the text
- */
- 'words' => function (Field $field) {
- return str_word_count(strip_tags($field->value));
- },
+ /**
+ * Returns the number of words in the text
+ */
+ 'words' => function (Field $field) {
+ return str_word_count(strip_tags($field->value));
+ },
- // manipulators
+ // manipulators
- /**
- * Applies the callback function to the field
- * @since 3.4.0
- *
- * @param \Kirby\Cms\Field $field
- * @param Closure $callback
- */
- 'callback' => function (Field $field, Closure $callback) {
- return $callback($field);
- },
+ /**
+ * Applies the callback function to the field
+ * @since 3.4.0
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param Closure $callback
+ */
+ 'callback' => function (Field $field, Closure $callback) {
+ return $callback($field);
+ },
- /**
- * Escapes the field value to be safely used in HTML
- * templates without the risk of XSS attacks
- *
- * @param \Kirby\Cms\Field $field
- * @param string $context Location of output (`html`, `attr`, `js`, `css`, `url` or `xml`)
- */
- 'escape' => function (Field $field, string $context = 'html') {
- $field->value = Str::esc($field->value, $context);
- return $field;
- },
+ /**
+ * Escapes the field value to be safely used in HTML
+ * templates without the risk of XSS attacks
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param string $context Location of output (`html`, `attr`, `js`, `css`, `url` or `xml`)
+ */
+ 'escape' => function (Field $field, string $context = 'html') {
+ $field->value = Str::esc($field->value, $context);
+ return $field;
+ },
- /**
- * Creates an excerpt of the field value without html
- * or any other formatting.
- *
- * @param \Kirby\Cms\Field $field
- * @param int $cahrs
- * @param bool $strip
- * @param string $rep
- * @return \Kirby\Cms\Field
- */
- 'excerpt' => function (Field $field, int $chars = 0, bool $strip = true, string $rep = ' …') {
- $field->value = Str::excerpt($field->kirbytext()->value(), $chars, $strip, $rep);
- return $field;
- },
+ /**
+ * Creates an excerpt of the field value without html
+ * or any other formatting.
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param int $cahrs
+ * @param bool $strip
+ * @param string $rep
+ * @return \Kirby\Cms\Field
+ */
+ 'excerpt' => function (Field $field, int $chars = 0, bool $strip = true, string $rep = ' …') {
+ $field->value = Str::excerpt($field->kirbytext()->value(), $chars, $strip, $rep);
+ return $field;
+ },
- /**
- * Converts the field content to valid HTML
- *
- * @param \Kirby\Cms\Field $field
- * @return \Kirby\Cms\Field
- */
- 'html' => function (Field $field) {
- $field->value = Html::encode($field->value);
- return $field;
- },
+ /**
+ * Converts the field content to valid HTML
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return \Kirby\Cms\Field
+ */
+ 'html' => function (Field $field) {
+ $field->value = Html::encode($field->value);
+ return $field;
+ },
- /**
- * Strips all block-level HTML elements from the field value,
- * it can be safely placed inside of other inline elements
- * without the risk of breaking the HTML structure.
- * @since 3.3.0
- *
- * @param \Kirby\Cms\Field $field
- * @return \Kirby\Cms\Field
- */
- 'inline' => function (Field $field) {
- // List of valid inline elements taken from: https://developer.mozilla.org/de/docs/Web/HTML/Inline_elemente
- // Obsolete elements, script tags, image maps and form elements have
- // been excluded for safety reasons and as they are most likely not
- // needed in most cases.
- $field->value = strip_tags($field->value, Html::$inlineList);
- return $field;
- },
+ /**
+ * Strips all block-level HTML elements from the field value,
+ * it can be safely placed inside of other inline elements
+ * without the risk of breaking the HTML structure.
+ * @since 3.3.0
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return \Kirby\Cms\Field
+ */
+ 'inline' => function (Field $field) {
+ // List of valid inline elements taken from: https://developer.mozilla.org/de/docs/Web/HTML/Inline_elemente
+ // Obsolete elements, script tags, image maps and form elements have
+ // been excluded for safety reasons and as they are most likely not
+ // needed in most cases.
+ $field->value = strip_tags($field->value, Html::$inlineList);
+ return $field;
+ },
- /**
- * Converts the field content from Markdown/Kirbytext to valid HTML
- *
- * @param \Kirby\Cms\Field $field
- * @param array $options
- * @return \Kirby\Cms\Field
- */
- 'kirbytext' => function (Field $field, array $options = []) use ($app) {
- $field->value = $app->kirbytext($field->value, A::merge($options, [
- 'parent' => $field->parent(),
- 'field' => $field
- ]));
+ /**
+ * Converts the field content from Markdown/Kirbytext to valid HTML
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param array $options
+ * @return \Kirby\Cms\Field
+ */
+ 'kirbytext' => function (Field $field, array $options = []) use ($app) {
+ $field->value = $app->kirbytext($field->value, A::merge($options, [
+ 'parent' => $field->parent(),
+ 'field' => $field
+ ]));
- return $field;
- },
+ return $field;
+ },
- /**
- * Converts the field content from inline Markdown/Kirbytext
- * to valid HTML
- * @since 3.1.0
- *
- * @param \Kirby\Cms\Field $field
- * @param array $options
- * @return \Kirby\Cms\Field
- */
- 'kirbytextinline' => function (Field $field, array $options = []) use ($app) {
- $field->value = $app->kirbytext($field->value, A::merge($options, [
- 'parent' => $field->parent(),
- 'field' => $field,
- 'markdown' => [
- 'inline' => true
- ]
- ]));
+ /**
+ * Converts the field content from inline Markdown/Kirbytext
+ * to valid HTML
+ * @since 3.1.0
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param array $options
+ * @return \Kirby\Cms\Field
+ */
+ 'kirbytextinline' => function (Field $field, array $options = []) use ($app) {
+ $field->value = $app->kirbytext($field->value, A::merge($options, [
+ 'parent' => $field->parent(),
+ 'field' => $field,
+ 'markdown' => [
+ 'inline' => true
+ ]
+ ]));
- return $field;
- },
+ return $field;
+ },
- /**
- * Parses all KirbyTags without also parsing Markdown
- *
- * @param \Kirby\Cms\Field $field
- * @return \Kirby\Cms\Field
- */
- 'kirbytags' => function (Field $field) use ($app) {
- $field->value = $app->kirbytags($field->value, [
- 'parent' => $field->parent(),
- 'field' => $field
- ]);
+ /**
+ * Parses all KirbyTags without also parsing Markdown
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return \Kirby\Cms\Field
+ */
+ 'kirbytags' => function (Field $field) use ($app) {
+ $field->value = $app->kirbytags($field->value, [
+ 'parent' => $field->parent(),
+ 'field' => $field
+ ]);
- return $field;
- },
+ return $field;
+ },
- /**
- * Converts the field content to lowercase
- *
- * @param \Kirby\Cms\Field $field
- * @return \Kirby\Cms\Field
- */
- 'lower' => function (Field $field) {
- $field->value = Str::lower($field->value);
- return $field;
- },
+ /**
+ * Converts the field content to lowercase
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return \Kirby\Cms\Field
+ */
+ 'lower' => function (Field $field) {
+ $field->value = Str::lower($field->value);
+ return $field;
+ },
- /**
- * Converts markdown to valid HTML
- *
- * @param \Kirby\Cms\Field $field
- * @param array $options
- * @return \Kirby\Cms\Field
- */
- 'markdown' => function (Field $field, array $options = []) use ($app) {
- $field->value = $app->markdown($field->value, $options);
- return $field;
- },
+ /**
+ * Converts markdown to valid HTML
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param array $options
+ * @return \Kirby\Cms\Field
+ */
+ 'markdown' => function (Field $field, array $options = []) use ($app) {
+ $field->value = $app->markdown($field->value, $options);
+ return $field;
+ },
- /**
- * Converts all line breaks in the field content to `
` tags.
- * @since 3.3.0
- *
- * @param \Kirby\Cms\Field $field
- * @return \Kirby\Cms\Field
- */
- 'nl2br' => function (Field $field) {
- $field->value = nl2br($field->value, false);
- return $field;
- },
+ /**
+ * Converts all line breaks in the field content to `
` tags.
+ * @since 3.3.0
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return \Kirby\Cms\Field
+ */
+ 'nl2br' => function (Field $field) {
+ $field->value = nl2br($field->value, false);
+ return $field;
+ },
- /**
- * Uses the field value as Kirby query
- *
- * @param \Kirby\Cms\Field $field
- * @param string|null $expect
- * @return mixed
- */
- 'query' => function (Field $field, string $expect = null) use ($app) {
- if ($parent = $field->parent()) {
- return $parent->query($field->value, $expect);
- }
+ /**
+ * Uses the field value as Kirby query
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param string|null $expect
+ * @return mixed
+ */
+ 'query' => function (Field $field, string $expect = null) use ($app) {
+ if ($parent = $field->parent()) {
+ return $parent->query($field->value, $expect);
+ }
- return Str::query($field->value, [
- 'kirby' => $app,
- 'site' => $app->site(),
- 'page' => $app->page()
- ]);
- },
+ return Str::query($field->value, [
+ 'kirby' => $app,
+ 'site' => $app->site(),
+ 'page' => $app->page()
+ ]);
+ },
- /**
- * It parses any queries found in the field value.
- *
- * @param \Kirby\Cms\Field $field
- * @param array $data
- * @param string $fallback Fallback for tokens in the template that cannot be replaced
- * @return \Kirby\Cms\Field
- */
- 'replace' => function (Field $field, array $data = [], string $fallback = '') use ($app) {
- if ($parent = $field->parent()) {
- // never pass `null` as the $template to avoid the fallback to the model ID
- $field->value = $parent->toString($field->value ?? '', $data, $fallback);
- } else {
- $field->value = Str::template($field->value, array_replace([
- 'kirby' => $app,
- 'site' => $app->site(),
- 'page' => $app->page()
- ], $data), ['fallback' => $fallback]);
- }
+ /**
+ * It parses any queries found in the field value.
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param array $data
+ * @param string $fallback Fallback for tokens in the template that cannot be replaced
+ * @return \Kirby\Cms\Field
+ */
+ 'replace' => function (Field $field, array $data = [], string $fallback = '') use ($app) {
+ if ($parent = $field->parent()) {
+ // never pass `null` as the $template to avoid the fallback to the model ID
+ $field->value = $parent->toString($field->value ?? '', $data, $fallback);
+ } else {
+ $field->value = Str::template($field->value, array_replace([
+ 'kirby' => $app,
+ 'site' => $app->site(),
+ 'page' => $app->page()
+ ], $data), ['fallback' => $fallback]);
+ }
- return $field;
- },
+ return $field;
+ },
- /**
- * Cuts the string after the given length and
- * adds "…" if it is longer
- *
- * @param \Kirby\Cms\Field $field
- * @param int $length The number of characters in the string
- * @param string $appendix An optional replacement for the missing rest
- * @return \Kirby\Cms\Field
- */
- 'short' => function (Field $field, int $length, string $appendix = '…') {
- $field->value = Str::short($field->value, $length, $appendix);
- return $field;
- },
+ /**
+ * Cuts the string after the given length and
+ * adds "…" if it is longer
+ *
+ * @param \Kirby\Cms\Field $field
+ * @param int $length The number of characters in the string
+ * @param string $appendix An optional replacement for the missing rest
+ * @return \Kirby\Cms\Field
+ */
+ 'short' => function (Field $field, int $length, string $appendix = '…') {
+ $field->value = Str::short($field->value, $length, $appendix);
+ return $field;
+ },
- /**
- * Converts the field content to a slug
- *
- * @param \Kirby\Cms\Field $field
- * @return \Kirby\Cms\Field
- */
- 'slug' => function (Field $field) {
- $field->value = Str::slug($field->value);
- return $field;
- },
+ /**
+ * Converts the field content to a slug
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return \Kirby\Cms\Field
+ */
+ 'slug' => function (Field $field) {
+ $field->value = Str::slug($field->value);
+ return $field;
+ },
- /**
- * Applies SmartyPants to the field
- *
- * @param \Kirby\Cms\Field $field
- * @return \Kirby\Cms\Field
- */
- 'smartypants' => function (Field $field) use ($app) {
- $field->value = $app->smartypants($field->value);
- return $field;
- },
+ /**
+ * Applies SmartyPants to the field
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return \Kirby\Cms\Field
+ */
+ 'smartypants' => function (Field $field) use ($app) {
+ $field->value = $app->smartypants($field->value);
+ return $field;
+ },
- /**
- * Splits the field content into an array
- *
- * @param \Kirby\Cms\Field $field
- * @return array
- */
- 'split' => function (Field $field, $separator = ',') {
- return Str::split((string)$field->value, $separator);
- },
+ /**
+ * Splits the field content into an array
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return array
+ */
+ 'split' => function (Field $field, $separator = ',') {
+ return Str::split((string)$field->value, $separator);
+ },
- /**
- * Converts the field content to uppercase
- *
- * @param \Kirby\Cms\Field $field
- * @return \Kirby\Cms\Field
- */
- 'upper' => function (Field $field) {
- $field->value = Str::upper($field->value);
- return $field;
- },
+ /**
+ * Converts the field content to uppercase
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return \Kirby\Cms\Field
+ */
+ 'upper' => function (Field $field) {
+ $field->value = Str::upper($field->value);
+ return $field;
+ },
- /**
- * Avoids typographical widows in strings by replacing
- * the last space with ` `
- *
- * @param \Kirby\Cms\Field $field
- * @return \Kirby\Cms\Field
- */
- 'widont' => function (Field $field) {
- $field->value = Str::widont($field->value);
- return $field;
- },
+ /**
+ * Avoids typographical widows in strings by replacing
+ * the last space with ` `
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return \Kirby\Cms\Field
+ */
+ 'widont' => function (Field $field) {
+ $field->value = Str::widont($field->value);
+ return $field;
+ },
- /**
- * Converts the field content to valid XML
- *
- * @param \Kirby\Cms\Field $field
- * @return \Kirby\Cms\Field
- */
- 'xml' => function (Field $field) {
- $field->value = Xml::encode($field->value);
- return $field;
- },
+ /**
+ * Converts the field content to valid XML
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return \Kirby\Cms\Field
+ */
+ 'xml' => function (Field $field) {
+ $field->value = Xml::encode($field->value);
+ return $field;
+ },
- // aliases
+ // aliases
- /**
- * Parses yaml in the field content and returns an array
- *
- * @param \Kirby\Cms\Field $field
- * @return array
- */
- 'yaml' => function (Field $field): array {
- return $field->toData('yaml');
- },
+ /**
+ * Parses yaml in the field content and returns an array
+ *
+ * @param \Kirby\Cms\Field $field
+ * @return array
+ */
+ 'yaml' => function (Field $field): array {
+ return $field->toData('yaml');
+ },
- ];
+ ];
};
diff --git a/kirby/config/presets/files.php b/kirby/config/presets/files.php
index 9299701..c5cea1d 100755
--- a/kirby/config/presets/files.php
+++ b/kirby/config/presets/files.php
@@ -3,24 +3,24 @@
use Kirby\Toolkit\I18n;
return function (array $props) {
- $props['sections'] = [
- 'files' => [
- 'headline' => $props['headline'] ?? I18n::translate('files'),
- 'type' => 'files',
- 'layout' => $props['layout'] ?? 'cards',
- 'template' => $props['template'] ?? null,
- 'image' => $props['image'] ?? null,
- 'info' => '{{ file.dimensions }}'
- ]
- ];
+ $props['sections'] = [
+ 'files' => [
+ 'headline' => $props['headline'] ?? I18n::translate('files'),
+ 'type' => 'files',
+ 'layout' => $props['layout'] ?? 'cards',
+ 'template' => $props['template'] ?? null,
+ 'image' => $props['image'] ?? null,
+ 'info' => '{{ file.dimensions }}'
+ ]
+ ];
- // remove global options
- unset(
- $props['headline'],
- $props['layout'],
- $props['template'],
- $props['image']
- );
+ // remove global options
+ unset(
+ $props['headline'],
+ $props['layout'],
+ $props['template'],
+ $props['image']
+ );
- return $props;
+ return $props;
};
diff --git a/kirby/config/presets/page.php b/kirby/config/presets/page.php
index 49d2daf..fa0e6e6 100755
--- a/kirby/config/presets/page.php
+++ b/kirby/config/presets/page.php
@@ -3,72 +3,72 @@
use Kirby\Toolkit\I18n;
return function ($props) {
- $section = function ($defaults, $props) {
- if ($props === true) {
- $props = [];
- }
+ $section = function ($defaults, $props) {
+ if ($props === true) {
+ $props = [];
+ }
- if (is_string($props) === true) {
- $props = [
- 'headline' => $props
- ];
- }
+ if (is_string($props) === true) {
+ $props = [
+ 'headline' => $props
+ ];
+ }
- return array_replace_recursive($defaults, $props);
- };
+ return array_replace_recursive($defaults, $props);
+ };
- if (empty($props['sidebar']) === false) {
- $sidebar = $props['sidebar'];
- } else {
- $sidebar = [];
+ if (empty($props['sidebar']) === false) {
+ $sidebar = $props['sidebar'];
+ } else {
+ $sidebar = [];
- $pages = $props['pages'] ?? [];
- $files = $props['files'] ?? [];
+ $pages = $props['pages'] ?? [];
+ $files = $props['files'] ?? [];
- if ($pages !== false) {
- $sidebar['pages'] = $section([
- 'headline' => I18n::translate('pages'),
- 'type' => 'pages',
- 'status' => 'all',
- 'layout' => 'list',
- ], $pages);
- }
+ if ($pages !== false) {
+ $sidebar['pages'] = $section([
+ 'headline' => I18n::translate('pages'),
+ 'type' => 'pages',
+ 'status' => 'all',
+ 'layout' => 'list',
+ ], $pages);
+ }
- if ($files !== false) {
- $sidebar['files'] = $section([
- 'headline' => I18n::translate('files'),
- 'type' => 'files',
- 'layout' => 'list'
- ], $files);
- }
- }
+ if ($files !== false) {
+ $sidebar['files'] = $section([
+ 'headline' => I18n::translate('files'),
+ 'type' => 'files',
+ 'layout' => 'list'
+ ], $files);
+ }
+ }
- if (empty($sidebar) === true) {
- $props['fields'] = $props['fields'] ?? [];
+ if (empty($sidebar) === true) {
+ $props['fields'] = $props['fields'] ?? [];
- unset(
- $props['files'],
- $props['pages']
- );
- } else {
- $props['columns'] = [
- [
- 'width' => '2/3',
- 'fields' => $props['fields'] ?? []
- ],
- [
- 'width' => '1/3',
- 'sections' => $sidebar
- ],
- ];
+ unset(
+ $props['files'],
+ $props['pages']
+ );
+ } else {
+ $props['columns'] = [
+ [
+ 'width' => '2/3',
+ 'fields' => $props['fields'] ?? []
+ ],
+ [
+ 'width' => '1/3',
+ 'sections' => $sidebar
+ ],
+ ];
- unset(
- $props['fields'],
- $props['files'],
- $props['pages'],
- $props['sidebar']
- );
- }
+ unset(
+ $props['fields'],
+ $props['files'],
+ $props['pages'],
+ $props['sidebar']
+ );
+ }
- return $props;
+ return $props;
};
diff --git a/kirby/config/presets/pages.php b/kirby/config/presets/pages.php
index ff590bc..21e76aa 100755
--- a/kirby/config/presets/pages.php
+++ b/kirby/config/presets/pages.php
@@ -4,56 +4,56 @@ use Kirby\Toolkit\I18n;
return function (array $props) {
- // load the general templates setting for all sections
- $templates = $props['templates'] ?? null;
+ // load the general templates setting for all sections
+ $templates = $props['templates'] ?? null;
- $section = function ($headline, $status, $props) use ($templates) {
- $defaults = [
- 'headline' => $headline,
- 'type' => 'pages',
- 'layout' => 'list',
- 'status' => $status
- ];
+ $section = function ($headline, $status, $props) use ($templates) {
+ $defaults = [
+ 'headline' => $headline,
+ 'type' => 'pages',
+ 'layout' => 'list',
+ 'status' => $status
+ ];
- if ($props === true) {
- $props = [];
- }
+ if ($props === true) {
+ $props = [];
+ }
- if (is_string($props) === true) {
- $props = [
- 'headline' => $props
- ];
- }
+ if (is_string($props) === true) {
+ $props = [
+ 'headline' => $props
+ ];
+ }
- // inject the global templates definition
- if (empty($templates) === false) {
- $props['templates'] = $props['templates'] ?? $templates;
- }
+ // inject the global templates definition
+ if (empty($templates) === false) {
+ $props['templates'] = $props['templates'] ?? $templates;
+ }
- return array_replace_recursive($defaults, $props);
- };
+ return array_replace_recursive($defaults, $props);
+ };
- $sections = [];
+ $sections = [];
- $drafts = $props['drafts'] ?? [];
- $unlisted = $props['unlisted'] ?? false;
- $listed = $props['listed'] ?? [];
+ $drafts = $props['drafts'] ?? [];
+ $unlisted = $props['unlisted'] ?? false;
+ $listed = $props['listed'] ?? [];
- if ($drafts !== false) {
- $sections['drafts'] = $section(I18n::translate('pages.status.draft'), 'drafts', $drafts);
- }
+ if ($drafts !== false) {
+ $sections['drafts'] = $section(I18n::translate('pages.status.draft'), 'drafts', $drafts);
+ }
- if ($unlisted !== false) {
- $sections['unlisted'] = $section(I18n::translate('pages.status.unlisted'), 'unlisted', $unlisted);
- }
+ if ($unlisted !== false) {
+ $sections['unlisted'] = $section(I18n::translate('pages.status.unlisted'), 'unlisted', $unlisted);
+ }
- if ($listed !== false) {
- $sections['listed'] = $section(I18n::translate('pages.status.listed'), 'listed', $listed);
- }
+ if ($listed !== false) {
+ $sections['listed'] = $section(I18n::translate('pages.status.listed'), 'listed', $listed);
+ }
- // cleaning up
- unset($props['drafts'], $props['unlisted'], $props['listed'], $props['templates']);
+ // cleaning up
+ unset($props['drafts'], $props['unlisted'], $props['listed'], $props['templates']);
- return array_merge($props, ['sections' => $sections]);
+ return array_merge($props, ['sections' => $sections]);
};
diff --git a/kirby/config/routes.php b/kirby/config/routes.php
index 2c55031..134ad60 100755
--- a/kirby/config/routes.php
+++ b/kirby/config/routes.php
@@ -8,141 +8,141 @@ use Kirby\Panel\Plugins;
use Kirby\Toolkit\Str;
return function ($kirby) {
- $api = $kirby->option('api.slug', 'api');
- $panel = $kirby->option('panel.slug', 'panel');
- $index = $kirby->url('index');
- $media = $kirby->url('media');
+ $api = $kirby->option('api.slug', 'api');
+ $panel = $kirby->option('panel.slug', 'panel');
+ $index = $kirby->url('index');
+ $media = $kirby->url('media');
- if (Str::startsWith($media, $index) === true) {
- $media = Str::after($media, $index);
- } else {
- // media URL is outside of the site, we can't make routing work;
- // fall back to the standard media route
- $media = 'media';
- }
+ if (Str::startsWith($media, $index) === true) {
+ $media = Str::after($media, $index);
+ } else {
+ // media URL is outside of the site, we can't make routing work;
+ // fall back to the standard media route
+ $media = 'media';
+ }
- /**
- * Before routes are running before the
- * plugin routes and cannot be overwritten by
- * plugins.
- */
- $before = [
- [
- 'pattern' => $api . '/(:all)',
- 'method' => 'ALL',
- 'env' => 'api',
- 'action' => function ($path = null) use ($kirby) {
- if ($kirby->option('api') === false) {
- return null;
- }
+ /**
+ * Before routes are running before the
+ * plugin routes and cannot be overwritten by
+ * plugins.
+ */
+ $before = [
+ [
+ 'pattern' => $api . '/(:all)',
+ 'method' => 'ALL',
+ 'env' => 'api',
+ 'action' => function ($path = null) use ($kirby) {
+ if ($kirby->option('api') === false) {
+ return null;
+ }
- $request = $kirby->request();
+ $request = $kirby->request();
- return $kirby->api()->render($path, $this->method(), [
- 'body' => $request->body()->toArray(),
- 'files' => $request->files()->toArray(),
- 'headers' => $request->headers(),
- 'query' => $request->query()->toArray(),
- ]);
- }
- ],
- [
- 'pattern' => $media . '/plugins/index.(css|js)',
- 'env' => 'media',
- 'action' => function (string $type) use ($kirby) {
- $plugins = new Plugins();
+ return $kirby->api()->render($path, $this->method(), [
+ 'body' => $request->body()->toArray(),
+ 'files' => $request->files()->toArray(),
+ 'headers' => $request->headers(),
+ 'query' => $request->query()->toArray(),
+ ]);
+ }
+ ],
+ [
+ 'pattern' => $media . '/plugins/index.(css|js)',
+ 'env' => 'media',
+ 'action' => function (string $type) use ($kirby) {
+ $plugins = new Plugins();
- return $kirby
- ->response()
- ->type($type)
- ->body($plugins->read($type));
- }
- ],
- [
- 'pattern' => $media . '/plugins/(:any)/(:any)/(:all).(css|map|gif|js|mjs|jpg|png|svg|webp|avif|woff2|woff|json)',
- 'env' => 'media',
- 'action' => function (string $provider, string $pluginName, string $filename, string $extension) {
- return PluginAssets::resolve($provider . '/' . $pluginName, $filename . '.' . $extension);
- }
- ],
- [
- 'pattern' => $media . '/pages/(:all)/(:any)/(:any)',
- 'env' => 'media',
- 'action' => function ($path, $hash, $filename) use ($kirby) {
- return Media::link($kirby->page($path), $hash, $filename);
- }
- ],
- [
- 'pattern' => $media . '/site/(:any)/(:any)',
- 'env' => 'media',
- 'action' => function ($hash, $filename) use ($kirby) {
- return Media::link($kirby->site(), $hash, $filename);
- }
- ],
- [
- 'pattern' => $media . '/users/(:any)/(:any)/(:any)',
- 'env' => 'media',
- 'action' => function ($id, $hash, $filename) use ($kirby) {
- return Media::link($kirby->user($id), $hash, $filename);
- }
- ],
- [
- 'pattern' => $media . '/assets/(:all)/(:any)/(:any)',
- 'env' => 'media',
- 'action' => function ($path, $hash, $filename) {
- return Media::thumb($path, $hash, $filename);
- }
- ],
- [
- 'pattern' => $panel . '/(:all?)',
- 'method' => 'ALL',
- 'env' => 'panel',
- 'action' => function ($path = null) {
- return Panel::router($path);
- }
- ],
- ];
+ return $kirby
+ ->response()
+ ->type($type)
+ ->body($plugins->read($type));
+ }
+ ],
+ [
+ 'pattern' => $media . '/plugins/(:any)/(:any)/(:all).(css|map|gif|js|mjs|jpg|png|svg|webp|avif|woff2|woff|json)',
+ 'env' => 'media',
+ 'action' => function (string $provider, string $pluginName, string $filename, string $extension) {
+ return PluginAssets::resolve($provider . '/' . $pluginName, $filename . '.' . $extension);
+ }
+ ],
+ [
+ 'pattern' => $media . '/pages/(:all)/(:any)/(:any)',
+ 'env' => 'media',
+ 'action' => function ($path, $hash, $filename) use ($kirby) {
+ return Media::link($kirby->page($path), $hash, $filename);
+ }
+ ],
+ [
+ 'pattern' => $media . '/site/(:any)/(:any)',
+ 'env' => 'media',
+ 'action' => function ($hash, $filename) use ($kirby) {
+ return Media::link($kirby->site(), $hash, $filename);
+ }
+ ],
+ [
+ 'pattern' => $media . '/users/(:any)/(:any)/(:any)',
+ 'env' => 'media',
+ 'action' => function ($id, $hash, $filename) use ($kirby) {
+ return Media::link($kirby->user($id), $hash, $filename);
+ }
+ ],
+ [
+ 'pattern' => $media . '/assets/(:all)/(:any)/(:any)',
+ 'env' => 'media',
+ 'action' => function ($path, $hash, $filename) {
+ return Media::thumb($path, $hash, $filename);
+ }
+ ],
+ [
+ 'pattern' => $panel . '/(:all?)',
+ 'method' => 'ALL',
+ 'env' => 'panel',
+ 'action' => function ($path = null) {
+ return Panel::router($path);
+ }
+ ],
+ ];
- // Multi-language setup
- if ($kirby->multilang() === true) {
- $after = LanguageRoutes::create($kirby);
- } else {
+ // Multi-language setup
+ if ($kirby->multilang() === true) {
+ $after = LanguageRoutes::create($kirby);
+ } else {
- // Single-language home
- $after[] = [
- 'pattern' => '',
- 'method' => 'ALL',
- 'env' => 'site',
- 'action' => function () use ($kirby) {
- return $kirby->resolve();
- }
- ];
+ // Single-language home
+ $after[] = [
+ 'pattern' => '',
+ 'method' => 'ALL',
+ 'env' => 'site',
+ 'action' => function () use ($kirby) {
+ return $kirby->resolve();
+ }
+ ];
- // redirect the home page folder to the real homepage
- $after[] = [
- 'pattern' => $kirby->option('home', 'home'),
- 'method' => 'ALL',
- 'env' => 'site',
- 'action' => function () use ($kirby) {
- return $kirby
- ->response()
- ->redirect($kirby->site()->url());
- }
- ];
+ // redirect the home page folder to the real homepage
+ $after[] = [
+ 'pattern' => $kirby->option('home', 'home'),
+ 'method' => 'ALL',
+ 'env' => 'site',
+ 'action' => function () use ($kirby) {
+ return $kirby
+ ->response()
+ ->redirect($kirby->site()->url());
+ }
+ ];
- // Single-language subpages
- $after[] = [
- 'pattern' => '(:all)',
- 'method' => 'ALL',
- 'env' => 'site',
- 'action' => function (string $path) use ($kirby) {
- return $kirby->resolve($path);
- }
- ];
- }
+ // Single-language subpages
+ $after[] = [
+ 'pattern' => '(:all)',
+ 'method' => 'ALL',
+ 'env' => 'site',
+ 'action' => function (string $path) use ($kirby) {
+ return $kirby->resolve($path);
+ }
+ ];
+ }
- return [
- 'before' => $before,
- 'after' => $after
- ];
+ return [
+ 'before' => $before,
+ 'after' => $after
+ ];
};
diff --git a/kirby/config/sections/fields.php b/kirby/config/sections/fields.php
index 065f478..38565e5 100755
--- a/kirby/config/sections/fields.php
+++ b/kirby/config/sections/fields.php
@@ -3,55 +3,55 @@
use Kirby\Form\Form;
return [
- 'props' => [
- 'fields' => function (array $fields = []) {
- return $fields;
- }
- ],
- 'computed' => [
- 'form' => function () {
- $fields = $this->fields;
- $disabled = $this->model->permissions()->update() === false;
- $lang = $this->model->kirby()->languageCode();
- $content = $this->model->content($lang)->toArray();
+ 'props' => [
+ 'fields' => function (array $fields = []) {
+ return $fields;
+ }
+ ],
+ 'computed' => [
+ 'form' => function () {
+ $fields = $this->fields;
+ $disabled = $this->model->permissions()->update() === false;
+ $lang = $this->model->kirby()->languageCode();
+ $content = $this->model->content($lang)->toArray();
- if ($disabled === true) {
- foreach ($fields as $key => $props) {
- $fields[$key]['disabled'] = true;
- }
- }
+ if ($disabled === true) {
+ foreach ($fields as $key => $props) {
+ $fields[$key]['disabled'] = true;
+ }
+ }
- return new Form([
- 'fields' => $fields,
- 'values' => $content,
- 'model' => $this->model,
- 'strict' => true
- ]);
- },
- 'fields' => function () {
- $fields = $this->form->fields()->toArray();
+ return new Form([
+ 'fields' => $fields,
+ 'values' => $content,
+ 'model' => $this->model,
+ 'strict' => true
+ ]);
+ },
+ 'fields' => function () {
+ $fields = $this->form->fields()->toArray();
- if (is_a($this->model, 'Kirby\Cms\Page') === true || is_a($this->model, 'Kirby\Cms\Site') === true) {
- // the title should never be updated directly via
- // fields section to avoid conflicts with the rename dialog
- unset($fields['title']);
- }
+ if (is_a($this->model, 'Kirby\Cms\Page') === true || is_a($this->model, 'Kirby\Cms\Site') === true) {
+ // the title should never be updated directly via
+ // fields section to avoid conflicts with the rename dialog
+ unset($fields['title']);
+ }
- foreach ($fields as $index => $props) {
- unset($fields[$index]['value']);
- }
+ foreach ($fields as $index => $props) {
+ unset($fields[$index]['value']);
+ }
- return $fields;
- }
- ],
- 'methods' => [
- 'errors' => function () {
- return $this->form->errors();
- }
- ],
- 'toArray' => function () {
- return [
- 'fields' => $this->fields,
- ];
- }
+ return $fields;
+ }
+ ],
+ 'methods' => [
+ 'errors' => function () {
+ return $this->form->errors();
+ }
+ ],
+ 'toArray' => function () {
+ return [
+ 'fields' => $this->fields,
+ ];
+ }
];
diff --git a/kirby/config/sections/files.php b/kirby/config/sections/files.php
index 91eae0e..d25e167 100755
--- a/kirby/config/sections/files.php
+++ b/kirby/config/sections/files.php
@@ -4,203 +4,203 @@ use Kirby\Cms\File;
use Kirby\Toolkit\I18n;
return [
- 'mixins' => [
- 'details',
- 'empty',
- 'headline',
- 'help',
- 'layout',
- 'min',
- 'max',
- 'pagination',
- 'parent',
- 'search',
- 'sort'
- ],
- 'props' => [
- /**
- * Filters all files by template and also sets the template, which will be used for all uploads
- */
- 'template' => function (string $template = null) {
- return $template;
- },
- /**
- * Setup for the main text in the list or cards. By default this will display the filename.
- */
- 'text' => function ($text = '{{ file.filename }}') {
- return I18n::translate($text, $text);
- }
- ],
- 'computed' => [
- 'accept' => function () {
- if ($this->template) {
- $file = new File([
- 'filename' => 'tmp',
- 'parent' => $this->model(),
- 'template' => $this->template
- ]);
+ 'mixins' => [
+ 'details',
+ 'empty',
+ 'headline',
+ 'help',
+ 'layout',
+ 'min',
+ 'max',
+ 'pagination',
+ 'parent',
+ 'search',
+ 'sort'
+ ],
+ 'props' => [
+ /**
+ * Filters all files by template and also sets the template, which will be used for all uploads
+ */
+ 'template' => function (string $template = null) {
+ return $template;
+ },
+ /**
+ * Setup for the main text in the list or cards. By default this will display the filename.
+ */
+ 'text' => function ($text = '{{ file.filename }}') {
+ return I18n::translate($text, $text);
+ }
+ ],
+ 'computed' => [
+ 'accept' => function () {
+ if ($this->template) {
+ $file = new File([
+ 'filename' => 'tmp',
+ 'parent' => $this->model(),
+ 'template' => $this->template
+ ]);
- return $file->blueprint()->acceptMime();
- }
+ return $file->blueprint()->acceptMime();
+ }
- return null;
- },
- 'parent' => function () {
- return $this->parentModel();
- },
- 'files' => function () {
- $files = $this->parent->files()->template($this->template);
+ return null;
+ },
+ 'parent' => function () {
+ return $this->parentModel();
+ },
+ 'files' => function () {
+ $files = $this->parent->files()->template($this->template);
- // filter out all protected files
- $files = $files->filter('isReadable', true);
+ // filter out all protected files
+ $files = $files->filter('isReadable', true);
- // search
- if ($this->search === true && empty($this->searchterm) === false) {
- $files = $files->search($this->searchterm);
- }
+ // search
+ if ($this->search === true && empty($this->searchterm) === false) {
+ $files = $files->search($this->searchterm);
+ }
- // sort
- if ($this->sortBy) {
- $files = $files->sort(...$files::sortArgs($this->sortBy));
- } else {
- $files = $files->sorted();
- }
+ // sort
+ if ($this->sortBy) {
+ $files = $files->sort(...$files::sortArgs($this->sortBy));
+ } else {
+ $files = $files->sorted();
+ }
- // flip
- if ($this->flip === true) {
- $files = $files->flip();
- }
+ // flip
+ if ($this->flip === true) {
+ $files = $files->flip();
+ }
- // apply the default pagination
- $files = $files->paginate([
- 'page' => $this->page,
- 'limit' => $this->limit,
- 'method' => 'none' // the page is manually provided
- ]);
+ // apply the default pagination
+ $files = $files->paginate([
+ 'page' => $this->page,
+ 'limit' => $this->limit,
+ 'method' => 'none' // the page is manually provided
+ ]);
- return $files;
- },
- 'data' => function () {
- $data = [];
+ return $files;
+ },
+ 'data' => function () {
+ $data = [];
- // the drag text needs to be absolute when the files come from
- // a different parent model
- $dragTextAbsolute = $this->model->is($this->parent) === false;
+ // the drag text needs to be absolute when the files come from
+ // a different parent model
+ $dragTextAbsolute = $this->model->is($this->parent) === false;
- foreach ($this->files as $file) {
- $panel = $file->panel();
+ foreach ($this->files as $file) {
+ $panel = $file->panel();
- $item = [
- 'dragText' => $panel->dragText('auto', $dragTextAbsolute),
- 'extension' => $file->extension(),
- 'filename' => $file->filename(),
- 'id' => $file->id(),
- 'image' => $panel->image(
- $this->image,
- $this->layout === 'table' ? 'list' : $this->layout
- ),
- 'info' => $file->toSafeString($this->info ?? false),
- 'link' => $panel->url(true),
- 'mime' => $file->mime(),
- 'parent' => $file->parent()->panel()->path(),
- 'template' => $file->template(),
- 'text' => $file->toSafeString($this->text),
- 'url' => $file->url(),
- ];
+ $item = [
+ 'dragText' => $panel->dragText('auto', $dragTextAbsolute),
+ 'extension' => $file->extension(),
+ 'filename' => $file->filename(),
+ 'id' => $file->id(),
+ 'image' => $panel->image(
+ $this->image,
+ $this->layout === 'table' ? 'list' : $this->layout
+ ),
+ 'info' => $file->toSafeString($this->info ?? false),
+ 'link' => $panel->url(true),
+ 'mime' => $file->mime(),
+ 'parent' => $file->parent()->panel()->path(),
+ 'template' => $file->template(),
+ 'text' => $file->toSafeString($this->text),
+ 'url' => $file->url(),
+ ];
- if ($this->layout === 'table') {
- $item = $this->columnsValues($item, $file);
- }
+ if ($this->layout === 'table') {
+ $item = $this->columnsValues($item, $file);
+ }
- $data[] = $item;
- }
+ $data[] = $item;
+ }
- return $data;
- },
- 'total' => function () {
- return $this->files->pagination()->total();
- },
- 'errors' => function () {
- $errors = [];
+ return $data;
+ },
+ 'total' => function () {
+ return $this->files->pagination()->total();
+ },
+ 'errors' => function () {
+ $errors = [];
- if ($this->validateMax() === false) {
- $errors['max'] = I18n::template('error.section.files.max.' . I18n::form($this->max), [
- 'max' => $this->max,
- 'section' => $this->headline
- ]);
- }
+ if ($this->validateMax() === false) {
+ $errors['max'] = I18n::template('error.section.files.max.' . I18n::form($this->max), [
+ 'max' => $this->max,
+ 'section' => $this->headline
+ ]);
+ }
- if ($this->validateMin() === false) {
- $errors['min'] = I18n::template('error.section.files.min.' . I18n::form($this->min), [
- 'min' => $this->min,
- 'section' => $this->headline
- ]);
- }
+ if ($this->validateMin() === false) {
+ $errors['min'] = I18n::template('error.section.files.min.' . I18n::form($this->min), [
+ 'min' => $this->min,
+ 'section' => $this->headline
+ ]);
+ }
- if (empty($errors) === true) {
- return [];
- }
+ if (empty($errors) === true) {
+ return [];
+ }
- return [
- $this->name => [
- 'label' => $this->headline,
- 'message' => $errors,
- ]
- ];
- },
- 'pagination' => function () {
- return $this->pagination();
- },
- 'upload' => function () {
- if ($this->isFull() === true) {
- return false;
- }
+ return [
+ $this->name => [
+ 'label' => $this->headline,
+ 'message' => $errors,
+ ]
+ ];
+ },
+ 'pagination' => function () {
+ return $this->pagination();
+ },
+ 'upload' => function () {
+ if ($this->isFull() === true) {
+ return false;
+ }
- // count all uploaded files
- $total = count($this->data);
- $max = $this->max ? $this->max - $total : null;
+ // count all uploaded files
+ $total = count($this->data);
+ $max = $this->max ? $this->max - $total : null;
- if ($this->max && $total === $this->max - 1) {
- $multiple = false;
- } else {
- $multiple = true;
- }
+ if ($this->max && $total === $this->max - 1) {
+ $multiple = false;
+ } else {
+ $multiple = true;
+ }
- $template = $this->template === 'default' ? null : $this->template;
+ $template = $this->template === 'default' ? null : $this->template;
- return [
- 'accept' => $this->accept,
- 'multiple' => $multiple,
- 'max' => $max,
- 'api' => $this->parent->apiUrl(true) . '/files',
- 'attributes' => array_filter([
- 'sort' => $this->sortable === true ? $total + 1 : null,
- 'template' => $template
- ])
- ];
- }
- ],
- 'toArray' => function () {
- return [
- 'data' => $this->data,
- 'errors' => $this->errors,
- 'options' => [
- 'accept' => $this->accept,
- 'apiUrl' => $this->parent->apiUrl(true),
- 'columns' => $this->columns,
- 'empty' => $this->empty,
- 'headline' => $this->headline,
- 'help' => $this->help,
- 'layout' => $this->layout,
- 'link' => $this->link(),
- 'max' => $this->max,
- 'min' => $this->min,
- 'search' => $this->search,
- 'size' => $this->size,
- 'sortable' => $this->sortable,
- 'upload' => $this->upload
- ],
- 'pagination' => $this->pagination
- ];
- }
+ return [
+ 'accept' => $this->accept,
+ 'multiple' => $multiple,
+ 'max' => $max,
+ 'api' => $this->parent->apiUrl(true) . '/files',
+ 'attributes' => array_filter([
+ 'sort' => $this->sortable === true ? $total + 1 : null,
+ 'template' => $template
+ ])
+ ];
+ }
+ ],
+ 'toArray' => function () {
+ return [
+ 'data' => $this->data,
+ 'errors' => $this->errors,
+ 'options' => [
+ 'accept' => $this->accept,
+ 'apiUrl' => $this->parent->apiUrl(true),
+ 'columns' => $this->columns,
+ 'empty' => $this->empty,
+ 'headline' => $this->headline,
+ 'help' => $this->help,
+ 'layout' => $this->layout,
+ 'link' => $this->link(),
+ 'max' => $this->max,
+ 'min' => $this->min,
+ 'search' => $this->search,
+ 'size' => $this->size,
+ 'sortable' => $this->sortable,
+ 'upload' => $this->upload
+ ],
+ 'pagination' => $this->pagination
+ ];
+ }
];
diff --git a/kirby/config/sections/info.php b/kirby/config/sections/info.php
index 555af89..e348bd4 100755
--- a/kirby/config/sections/info.php
+++ b/kirby/config/sections/info.php
@@ -3,31 +3,31 @@
use Kirby\Toolkit\I18n;
return [
- 'mixins' => [
- 'headline',
- ],
- 'props' => [
- 'text' => function ($text = null) {
- return I18n::translate($text, $text);
- },
- 'theme' => function (string $theme = null) {
- return $theme;
- }
- ],
- 'computed' => [
- 'text' => function () {
- if ($this->text) {
- $text = $this->model()->toSafeString($this->text);
- $text = $this->kirby()->kirbytext($text);
- return $text;
- }
- },
- ],
- 'toArray' => function () {
- return [
- 'headline' => $this->headline,
- 'text' => $this->text,
- 'theme' => $this->theme
- ];
- }
+ 'mixins' => [
+ 'headline',
+ ],
+ 'props' => [
+ 'text' => function ($text = null) {
+ return I18n::translate($text, $text);
+ },
+ 'theme' => function (string $theme = null) {
+ return $theme;
+ }
+ ],
+ 'computed' => [
+ 'text' => function () {
+ if ($this->text) {
+ $text = $this->model()->toSafeString($this->text);
+ $text = $this->kirby()->kirbytext($text);
+ return $text;
+ }
+ },
+ ],
+ 'toArray' => function () {
+ return [
+ 'headline' => $this->headline,
+ 'text' => $this->text,
+ 'theme' => $this->theme
+ ];
+ }
];
diff --git a/kirby/config/sections/mixins/details.php b/kirby/config/sections/mixins/details.php
index 1f2f58b..3d2c928 100755
--- a/kirby/config/sections/mixins/details.php
+++ b/kirby/config/sections/mixins/details.php
@@ -3,34 +3,34 @@
use Kirby\Toolkit\I18n;
return [
- 'props' => [
- /**
- * Image options to control the source and look of preview
- */
- 'image' => function ($image = null) {
- return $image ?? [];
- },
- /**
- * Optional info text setup. Info text is shown on the right (lists, cardlets) or below (cards) the title.
- */
- 'info' => function ($info = null) {
- return I18n::translate($info, $info);
- },
- /**
- * Setup for the main text in the list or cards. By default this will display the title.
- */
- 'text' => function ($text = '{{ model.title }}') {
- return I18n::translate($text, $text);
- }
- ],
- 'methods' => [
- 'link' => function () {
- $modelLink = $this->model->panel()->url(true);
- $parentLink = $this->parent->panel()->url(true);
+ 'props' => [
+ /**
+ * Image options to control the source and look of preview
+ */
+ 'image' => function ($image = null) {
+ return $image ?? [];
+ },
+ /**
+ * Optional info text setup. Info text is shown on the right (lists, cardlets) or below (cards) the title.
+ */
+ 'info' => function ($info = null) {
+ return I18n::translate($info, $info);
+ },
+ /**
+ * Setup for the main text in the list or cards. By default this will display the title.
+ */
+ 'text' => function ($text = '{{ model.title }}') {
+ return I18n::translate($text, $text);
+ }
+ ],
+ 'methods' => [
+ 'link' => function () {
+ $modelLink = $this->model->panel()->url(true);
+ $parentLink = $this->parent->panel()->url(true);
- if ($modelLink !== $parentLink) {
- return $parentLink;
- }
- }
- ]
+ if ($modelLink !== $parentLink) {
+ return $parentLink;
+ }
+ }
+ ]
];
diff --git a/kirby/config/sections/mixins/empty.php b/kirby/config/sections/mixins/empty.php
index 967b252..97c2404 100755
--- a/kirby/config/sections/mixins/empty.php
+++ b/kirby/config/sections/mixins/empty.php
@@ -3,19 +3,19 @@
use Kirby\Toolkit\I18n;
return [
- 'props' => [
- /**
- * Sets the text for the empty state box
- */
- 'empty' => function ($empty = null) {
- return I18n::translate($empty, $empty);
- }
- ],
- 'computed' => [
- 'empty' => function () {
- if ($this->empty) {
- return $this->model()->toSafeString($this->empty);
- }
- }
- ]
+ 'props' => [
+ /**
+ * Sets the text for the empty state box
+ */
+ 'empty' => function ($empty = null) {
+ return I18n::translate($empty, $empty);
+ }
+ ],
+ 'computed' => [
+ 'empty' => function () {
+ if ($this->empty) {
+ return $this->model()->toSafeString($this->empty);
+ }
+ }
+ ]
];
diff --git a/kirby/config/sections/mixins/headline.php b/kirby/config/sections/mixins/headline.php
index 5e426f9..df323c6 100755
--- a/kirby/config/sections/mixins/headline.php
+++ b/kirby/config/sections/mixins/headline.php
@@ -4,39 +4,39 @@ use Kirby\Cms\Helpers;
use Kirby\Toolkit\I18n;
return [
- 'props' => [
- /**
- * The headline for the section. This can be a simple string or a template with additional info from the parent page.
- * @todo remove in 3.9.0
- */
- 'headline' => function ($headline = null) {
- // TODO: add deprecation notive in 3.8.0
- // if ($headline !== null) {
- // Helpers::deprecated('`headline` prop for sections has been deprecated and will be removed in Kirby 3.9.0. Use `label` instead.');
- // }
+ 'props' => [
+ /**
+ * The headline for the section. This can be a simple string or a template with additional info from the parent page.
+ * @todo remove in 3.9.0
+ */
+ 'headline' => function ($headline = null) {
+ // TODO: add deprecation notive in 3.8.0
+ // if ($headline !== null) {
+ // Helpers::deprecated('`headline` prop for sections has been deprecated and will be removed in Kirby 3.9.0. Use `label` instead.');
+ // }
- return I18n::translate($headline, $headline);
- },
- /**
- * The label for the section. This can be a simple string or
- * a template with additional info from the parent page.
- * Replaces the `headline` prop.
- */
- 'label' => function ($label = null) {
- return I18n::translate($label, $label);
- }
- ],
- 'computed' => [
- 'headline' => function () {
- if ($this->headline) {
- return $this->model()->toString($this->headline);
- }
+ return I18n::translate($headline, $headline);
+ },
+ /**
+ * The label for the section. This can be a simple string or
+ * a template with additional info from the parent page.
+ * Replaces the `headline` prop.
+ */
+ 'label' => function ($label = null) {
+ return I18n::translate($label, $label);
+ }
+ ],
+ 'computed' => [
+ 'headline' => function () {
+ if ($this->headline) {
+ return $this->model()->toString($this->headline);
+ }
- if ($this->label) {
- return $this->model()->toString($this->label);
- }
+ if ($this->label) {
+ return $this->model()->toString($this->label);
+ }
- return ucfirst($this->name);
- }
- ]
+ return ucfirst($this->name);
+ }
+ ]
];
diff --git a/kirby/config/sections/mixins/help.php b/kirby/config/sections/mixins/help.php
index 1619e32..c95db08 100755
--- a/kirby/config/sections/mixins/help.php
+++ b/kirby/config/sections/mixins/help.php
@@ -3,21 +3,21 @@
use Kirby\Toolkit\I18n;
return [
- 'props' => [
- /**
- * Sets the help text
- */
- 'help' => function ($help = null) {
- return I18n::translate($help, $help);
- }
- ],
- 'computed' => [
- 'help' => function () {
- if ($this->help) {
- $help = $this->model()->toSafeString($this->help);
- $help = $this->kirby()->kirbytext($help);
- return $help;
- }
- }
- ]
+ 'props' => [
+ /**
+ * Sets the help text
+ */
+ 'help' => function ($help = null) {
+ return I18n::translate($help, $help);
+ }
+ ],
+ 'computed' => [
+ 'help' => function () {
+ if ($this->help) {
+ $help = $this->model()->toSafeString($this->help);
+ $help = $this->kirby()->kirbytext($help);
+ return $help;
+ }
+ }
+ ]
];
diff --git a/kirby/config/sections/mixins/layout.php b/kirby/config/sections/mixins/layout.php
index 83f7b9a..1b5ee6e 100755
--- a/kirby/config/sections/mixins/layout.php
+++ b/kirby/config/sections/mixins/layout.php
@@ -4,122 +4,122 @@ use Kirby\Toolkit\I18n;
use Kirby\Toolkit\Str;
return [
- 'props' => [
- /**
- * Columns config for `layout: table`
- */
- 'columns' => function (array $columns = null) {
- return $columns ?? [];
- },
- /**
- * Section layout.
- * Available layout methods: `list`, `cardlets`, `cards`, `table`.
- */
- 'layout' => function (string $layout = 'list') {
- $layouts = ['list', 'cardlets', 'cards', 'table'];
- return in_array($layout, $layouts) ? $layout : 'list';
- },
- /**
- * The size option controls the size of cards. By default cards are auto-sized and the cards grid will always fill the full width. With a size you can disable auto-sizing. Available sizes: `tiny`, `small`, `medium`, `large`, `huge`
- */
- 'size' => function (string $size = 'auto') {
- return $size;
- },
- ],
- 'computed' => [
- 'columns' => function () {
- $columns = [];
+ 'props' => [
+ /**
+ * Columns config for `layout: table`
+ */
+ 'columns' => function (array $columns = null) {
+ return $columns ?? [];
+ },
+ /**
+ * Section layout.
+ * Available layout methods: `list`, `cardlets`, `cards`, `table`.
+ */
+ 'layout' => function (string $layout = 'list') {
+ $layouts = ['list', 'cardlets', 'cards', 'table'];
+ return in_array($layout, $layouts) ? $layout : 'list';
+ },
+ /**
+ * The size option controls the size of cards. By default cards are auto-sized and the cards grid will always fill the full width. With a size you can disable auto-sizing. Available sizes: `tiny`, `small`, `medium`, `large`, `huge`
+ */
+ 'size' => function (string $size = 'auto') {
+ return $size;
+ },
+ ],
+ 'computed' => [
+ 'columns' => function () {
+ $columns = [];
- if ($this->layout !== 'table') {
- return [];
- }
+ if ($this->layout !== 'table') {
+ return [];
+ }
- if ($this->image !== false) {
- $columns['image'] = [
- 'label' => ' ',
- 'mobile' => true,
- 'type' => 'image',
- 'width' => 'var(--table-row-height)'
- ];
- }
+ if ($this->image !== false) {
+ $columns['image'] = [
+ 'label' => ' ',
+ 'mobile' => true,
+ 'type' => 'image',
+ 'width' => 'var(--table-row-height)'
+ ];
+ }
- if ($this->text) {
- $columns['title'] = [
- 'label' => I18n::translate('title'),
- 'mobile' => true,
- 'type' => 'url',
- ];
- }
+ if ($this->text) {
+ $columns['title'] = [
+ 'label' => I18n::translate('title'),
+ 'mobile' => true,
+ 'type' => 'url',
+ ];
+ }
- if ($this->info) {
- $columns['info'] = [
- 'label' => I18n::translate('info'),
- 'type' => 'text',
- ];
- }
+ if ($this->info) {
+ $columns['info'] = [
+ 'label' => I18n::translate('info'),
+ 'type' => 'text',
+ ];
+ }
- foreach ($this->columns as $columnName => $column) {
- if ($column === true) {
- $column = [];
- }
+ foreach ($this->columns as $columnName => $column) {
+ if ($column === true) {
+ $column = [];
+ }
- if ($column === false) {
- continue;
- }
+ if ($column === false) {
+ continue;
+ }
- // fallback for labels
- $column['label'] ??= Str::ucfirst($columnName);
+ // fallback for labels
+ $column['label'] ??= Str::ucfirst($columnName);
- // make sure to translate labels
- $column['label'] = I18n::translate($column['label'], $column['label']);
+ // make sure to translate labels
+ $column['label'] = I18n::translate($column['label'], $column['label']);
- // keep the original column name as id
- $column['id'] = $columnName;
+ // keep the original column name as id
+ $column['id'] = $columnName;
- // add the custom column to the array with a key that won't
- // override the system columns
- $columns[$columnName . 'Cell'] = $column;
- }
+ // add the custom column to the array with a key that won't
+ // override the system columns
+ $columns[$columnName . 'Cell'] = $column;
+ }
- if ($this->type === 'pages') {
- $columns['flag'] = [
- 'label' => ' ',
- 'mobile' => true,
- 'type' => 'flag',
- 'width' => 'var(--table-row-height)',
- ];
- }
+ if ($this->type === 'pages') {
+ $columns['flag'] = [
+ 'label' => ' ',
+ 'mobile' => true,
+ 'type' => 'flag',
+ 'width' => 'var(--table-row-height)',
+ ];
+ }
- return $columns;
- },
- ],
- 'methods' => [
- 'columnsValues' => function (array $item, $model) {
- $item['title'] = [
- 'text' => $item['text'],
- 'href' => $model->panel()->url(true)
- ];
+ return $columns;
+ },
+ ],
+ 'methods' => [
+ 'columnsValues' => function (array $item, $model) {
+ $item['title'] = [
+ 'text' => $item['text'],
+ 'href' => $model->panel()->url(true)
+ ];
- foreach ($this->columns as $columnName => $column) {
- // don't overwrite essential columns
- if (isset($item[$columnName]) === true) {
- continue;
- }
+ foreach ($this->columns as $columnName => $column) {
+ // don't overwrite essential columns
+ if (isset($item[$columnName]) === true) {
+ continue;
+ }
- if (empty($column['value']) === false) {
- if ($column['type'] ?? false === 'html') {
- $value = $model->toString($column['value']);
- } else {
- $value = $model->toSafeString($column['value']);
- }
- } else {
- $value = $model->content()->get($column['id'] ?? $columnName)->value();
- }
+ if (empty($column['value']) === false) {
+ if ($column['type'] ?? false === 'html') {
+ $value = $model->toString($column['value']);
+ } else {
+ $value = $model->toSafeString($column['value']);
+ }
+ } else {
+ $value = $model->content()->get($column['id'] ?? $columnName)->value();
+ }
- $item[$columnName] = $value;
- }
+ $item[$columnName] = $value;
+ }
- return $item;
- }
- ],
+ return $item;
+ }
+ ],
];
diff --git a/kirby/config/sections/mixins/max.php b/kirby/config/sections/mixins/max.php
index 5ce303c..a87c1cc 100755
--- a/kirby/config/sections/mixins/max.php
+++ b/kirby/config/sections/mixins/max.php
@@ -1,28 +1,28 @@
[
- /**
- * Sets the maximum number of allowed entries in the section
- */
- 'max' => function (int $max = null) {
- return $max;
- }
- ],
- 'methods' => [
- 'isFull' => function () {
- if ($this->max) {
- return $this->total >= $this->max;
- }
+ 'props' => [
+ /**
+ * Sets the maximum number of allowed entries in the section
+ */
+ 'max' => function (int $max = null) {
+ return $max;
+ }
+ ],
+ 'methods' => [
+ 'isFull' => function () {
+ if ($this->max) {
+ return $this->total >= $this->max;
+ }
- return false;
- },
- 'validateMax' => function () {
- if ($this->max && $this->total > $this->max) {
- return false;
- }
+ return false;
+ },
+ 'validateMax' => function () {
+ if ($this->max && $this->total > $this->max) {
+ return false;
+ }
- return true;
- }
- ]
+ return true;
+ }
+ ]
];
diff --git a/kirby/config/sections/mixins/min.php b/kirby/config/sections/mixins/min.php
index bfc495d..6295f2d 100755
--- a/kirby/config/sections/mixins/min.php
+++ b/kirby/config/sections/mixins/min.php
@@ -1,21 +1,21 @@
[
- /**
- * Sets the minimum number of required entries in the section
- */
- 'min' => function (int $min = null) {
- return $min;
- }
- ],
- 'methods' => [
- 'validateMin' => function () {
- if ($this->min && $this->min > $this->total) {
- return false;
- }
+ 'props' => [
+ /**
+ * Sets the minimum number of required entries in the section
+ */
+ 'min' => function (int $min = null) {
+ return $min;
+ }
+ ],
+ 'methods' => [
+ 'validateMin' => function () {
+ if ($this->min && $this->min > $this->total) {
+ return false;
+ }
- return true;
- }
- ]
+ return true;
+ }
+ ]
];
diff --git a/kirby/config/sections/mixins/pagination.php b/kirby/config/sections/mixins/pagination.php
index 491245a..3b2a2b0 100755
--- a/kirby/config/sections/mixins/pagination.php
+++ b/kirby/config/sections/mixins/pagination.php
@@ -4,34 +4,34 @@ use Kirby\Cms\App;
use Kirby\Toolkit\Pagination;
return [
- 'props' => [
- /**
- * Sets the number of items per page. If there are more items the pagination navigation will be shown at the bottom of the section.
- */
- 'limit' => function (int $limit = 20) {
- return $limit;
- },
- /**
- * Sets the default page for the pagination. This will overwrite default pagination.
- */
- 'page' => function (int $page = null) {
- return App::instance()->request()->get('page', $page);
- },
- ],
- 'methods' => [
- 'pagination' => function () {
- $pagination = new Pagination([
- 'limit' => $this->limit,
- 'page' => $this->page,
- 'total' => $this->total
- ]);
+ 'props' => [
+ /**
+ * Sets the number of items per page. If there are more items the pagination navigation will be shown at the bottom of the section.
+ */
+ 'limit' => function (int $limit = 20) {
+ return $limit;
+ },
+ /**
+ * Sets the default page for the pagination. This will overwrite default pagination.
+ */
+ 'page' => function (int $page = null) {
+ return App::instance()->request()->get('page', $page);
+ },
+ ],
+ 'methods' => [
+ 'pagination' => function () {
+ $pagination = new Pagination([
+ 'limit' => $this->limit,
+ 'page' => $this->page,
+ 'total' => $this->total
+ ]);
- return [
- 'limit' => $pagination->limit(),
- 'offset' => $pagination->offset(),
- 'page' => $pagination->page(),
- 'total' => $pagination->total(),
- ];
- }
- ]
+ return [
+ 'limit' => $pagination->limit(),
+ 'offset' => $pagination->offset(),
+ 'page' => $pagination->page(),
+ 'total' => $pagination->total(),
+ ];
+ }
+ ]
];
diff --git a/kirby/config/sections/mixins/parent.php b/kirby/config/sections/mixins/parent.php
index 3534acf..2df8425 100755
--- a/kirby/config/sections/mixins/parent.php
+++ b/kirby/config/sections/mixins/parent.php
@@ -3,41 +3,41 @@
use Kirby\Exception\Exception;
return [
- 'props' => [
- /**
- * Sets the query to a parent to find items for the list
- */
- 'parent' => function (string $parent = null) {
- return $parent;
- }
- ],
- 'methods' => [
- 'parentModel' => function () {
- $parent = $this->parent;
+ 'props' => [
+ /**
+ * Sets the query to a parent to find items for the list
+ */
+ 'parent' => function (string $parent = null) {
+ return $parent;
+ }
+ ],
+ 'methods' => [
+ 'parentModel' => function () {
+ $parent = $this->parent;
- if (is_string($parent) === true) {
- $query = $parent;
- $parent = $this->model->query($query);
+ if (is_string($parent) === true) {
+ $query = $parent;
+ $parent = $this->model->query($query);
- if (!$parent) {
- throw new Exception('The parent for the query "' . $query . '" cannot be found in the section "' . $this->name() . '"');
- }
+ if (!$parent) {
+ throw new Exception('The parent for the query "' . $query . '" cannot be found in the section "' . $this->name() . '"');
+ }
- if (
- is_a($parent, 'Kirby\Cms\Page') === false &&
- is_a($parent, 'Kirby\Cms\Site') === false &&
- is_a($parent, 'Kirby\Cms\File') === false &&
- is_a($parent, 'Kirby\Cms\User') === false
- ) {
- throw new Exception('The parent for the section "' . $this->name() . '" has to be a page, site or user object');
- }
- }
+ if (
+ is_a($parent, 'Kirby\Cms\Page') === false &&
+ is_a($parent, 'Kirby\Cms\Site') === false &&
+ is_a($parent, 'Kirby\Cms\File') === false &&
+ is_a($parent, 'Kirby\Cms\User') === false
+ ) {
+ throw new Exception('The parent for the section "' . $this->name() . '" has to be a page, site or user object');
+ }
+ }
- if ($parent === null) {
- return $this->model;
- }
+ if ($parent === null) {
+ return $this->model;
+ }
- return $parent;
- }
- ]
+ return $parent;
+ }
+ ]
];
diff --git a/kirby/config/sections/mixins/search.php b/kirby/config/sections/mixins/search.php
index 566a8e6..c0aa4bb 100755
--- a/kirby/config/sections/mixins/search.php
+++ b/kirby/config/sections/mixins/search.php
@@ -3,17 +3,17 @@
use Kirby\Cms\App;
return [
- 'props' => [
- /**
- * Enable/disable the search in the sections
- */
- 'search' => function (bool $search = false): bool {
- return $search;
- }
- ],
- 'computed' => [
- 'searchterm' => function (): ?string {
- return App::instance()->request()->get('searchterm');
- }
- ]
+ 'props' => [
+ /**
+ * Enable/disable the search in the sections
+ */
+ 'search' => function (bool $search = false): bool {
+ return $search;
+ }
+ ],
+ 'computed' => [
+ 'searchterm' => function (): ?string {
+ return App::instance()->request()->get('searchterm');
+ }
+ ]
];
diff --git a/kirby/config/sections/mixins/sort.php b/kirby/config/sections/mixins/sort.php
index e9bbb28..54c7531 100755
--- a/kirby/config/sections/mixins/sort.php
+++ b/kirby/config/sections/mixins/sort.php
@@ -1,53 +1,53 @@
[
- /**
- * Enables/disables reverse sorting
- */
- 'flip' => function (bool $flip = false) {
- return $flip;
- },
- /**
- * Enables/disables manual sorting
- */
- 'sortable' => function (bool $sortable = true) {
- return $sortable;
- },
- /**
- * Overwrites manual sorting and sorts by the given field and sorting direction (i.e. `date desc`)
- */
- 'sortBy' => function (string $sortBy = null) {
- return $sortBy;
- },
- ],
- 'computed' => [
- 'sortable' => function () {
- if ($this->sortable === false) {
- return false;
- }
+ 'props' => [
+ /**
+ * Enables/disables reverse sorting
+ */
+ 'flip' => function (bool $flip = false) {
+ return $flip;
+ },
+ /**
+ * Enables/disables manual sorting
+ */
+ 'sortable' => function (bool $sortable = true) {
+ return $sortable;
+ },
+ /**
+ * Overwrites manual sorting and sorts by the given field and sorting direction (i.e. `date desc`)
+ */
+ 'sortBy' => function (string $sortBy = null) {
+ return $sortBy;
+ },
+ ],
+ 'computed' => [
+ 'sortable' => function () {
+ if ($this->sortable === false) {
+ return false;
+ }
- if (
- $this->type === 'pages' &&
- in_array($this->status, ['listed', 'published', 'all']) === false
- ) {
- return false;
- }
+ if (
+ $this->type === 'pages' &&
+ in_array($this->status, ['listed', 'published', 'all']) === false
+ ) {
+ return false;
+ }
- // don't allow sorting while search filter is active
- if (empty($this->query) === false) {
- return false;
- }
+ // don't allow sorting while search filter is active
+ if (empty($this->query) === false) {
+ return false;
+ }
- if ($this->sortBy !== null) {
- return false;
- }
+ if ($this->sortBy !== null) {
+ return false;
+ }
- if ($this->flip === true) {
- return false;
- }
+ if ($this->flip === true) {
+ return false;
+ }
- return true;
- }
- ]
+ return true;
+ }
+ ]
];
diff --git a/kirby/config/sections/pages.php b/kirby/config/sections/pages.php
index f4c98da..1317d71 100755
--- a/kirby/config/sections/pages.php
+++ b/kirby/config/sections/pages.php
@@ -6,258 +6,258 @@ use Kirby\Toolkit\A;
use Kirby\Toolkit\I18n;
return [
- 'mixins' => [
- 'details',
- 'empty',
- 'headline',
- 'help',
- 'layout',
- 'min',
- 'max',
- 'pagination',
- 'parent',
- 'search',
- 'sort'
- ],
- 'props' => [
- /**
- * Optional array of templates that should only be allowed to add
- * or `false` to completely disable page creation
- */
- 'create' => function ($create = null) {
- return $create;
- },
- /**
- * Filters pages by their status. Available status settings: `draft`, `unlisted`, `listed`, `published`, `all`.
- */
- 'status' => function (string $status = '') {
- if ($status === 'drafts') {
- $status = 'draft';
- }
+ 'mixins' => [
+ 'details',
+ 'empty',
+ 'headline',
+ 'help',
+ 'layout',
+ 'min',
+ 'max',
+ 'pagination',
+ 'parent',
+ 'search',
+ 'sort'
+ ],
+ 'props' => [
+ /**
+ * Optional array of templates that should only be allowed to add
+ * or `false` to completely disable page creation
+ */
+ 'create' => function ($create = null) {
+ return $create;
+ },
+ /**
+ * Filters pages by their status. Available status settings: `draft`, `unlisted`, `listed`, `published`, `all`.
+ */
+ 'status' => function (string $status = '') {
+ if ($status === 'drafts') {
+ $status = 'draft';
+ }
- if (in_array($status, ['all', 'draft', 'published', 'listed', 'unlisted']) === false) {
- $status = 'all';
- }
+ if (in_array($status, ['all', 'draft', 'published', 'listed', 'unlisted']) === false) {
+ $status = 'all';
+ }
- return $status;
- },
- /**
- * Filters the list by templates and sets template options when adding new pages to the section.
- */
- 'templates' => function ($templates = null) {
- return A::wrap($templates ?? $this->template);
- }
- ],
- 'computed' => [
- 'parent' => function () {
- $parent = $this->parentModel();
+ return $status;
+ },
+ /**
+ * Filters the list by templates and sets template options when adding new pages to the section.
+ */
+ 'templates' => function ($templates = null) {
+ return A::wrap($templates ?? $this->template);
+ }
+ ],
+ 'computed' => [
+ 'parent' => function () {
+ $parent = $this->parentModel();
- if (
- is_a($parent, 'Kirby\Cms\Site') === false &&
- is_a($parent, 'Kirby\Cms\Page') === false
- ) {
- throw new InvalidArgumentException('The parent is invalid. You must choose the site or a page as parent.');
- }
+ if (
+ is_a($parent, 'Kirby\Cms\Site') === false &&
+ is_a($parent, 'Kirby\Cms\Page') === false
+ ) {
+ throw new InvalidArgumentException('The parent is invalid. You must choose the site or a page as parent.');
+ }
- return $parent;
- },
- 'pages' => function () {
- switch ($this->status) {
- case 'draft':
- $pages = $this->parent->drafts();
- break;
- case 'listed':
- $pages = $this->parent->children()->listed();
- break;
- case 'published':
- $pages = $this->parent->children();
- break;
- case 'unlisted':
- $pages = $this->parent->children()->unlisted();
- break;
- default:
- $pages = $this->parent->childrenAndDrafts();
- }
+ return $parent;
+ },
+ 'pages' => function () {
+ switch ($this->status) {
+ case 'draft':
+ $pages = $this->parent->drafts();
+ break;
+ case 'listed':
+ $pages = $this->parent->children()->listed();
+ break;
+ case 'published':
+ $pages = $this->parent->children();
+ break;
+ case 'unlisted':
+ $pages = $this->parent->children()->unlisted();
+ break;
+ default:
+ $pages = $this->parent->childrenAndDrafts();
+ }
- // filters pages that are protected and not in the templates list
- // internal `filter()` method used instead of foreach loop that previously included `unset()`
- // because `unset()` is updating the original data, `filter()` is just filtering
- // also it has been tested that there is no performance difference
- // even in 0.1 seconds on 100k virtual pages
- $pages = $pages->filter(function ($page) {
- // remove all protected pages
- if ($page->isReadable() === false) {
- return false;
- }
+ // filters pages that are protected and not in the templates list
+ // internal `filter()` method used instead of foreach loop that previously included `unset()`
+ // because `unset()` is updating the original data, `filter()` is just filtering
+ // also it has been tested that there is no performance difference
+ // even in 0.1 seconds on 100k virtual pages
+ $pages = $pages->filter(function ($page) {
+ // remove all protected pages
+ if ($page->isReadable() === false) {
+ return false;
+ }
- // filter by all set templates
- if ($this->templates && in_array($page->intendedTemplate()->name(), $this->templates) === false) {
- return false;
- }
+ // filter by all set templates
+ if ($this->templates && in_array($page->intendedTemplate()->name(), $this->templates) === false) {
+ return false;
+ }
- return true;
- });
+ return true;
+ });
- // search
- if ($this->search === true && empty($this->searchterm) === false) {
- $pages = $pages->search($this->searchterm);
- }
+ // search
+ if ($this->search === true && empty($this->searchterm) === false) {
+ $pages = $pages->search($this->searchterm);
+ }
- // sort
- if ($this->sortBy) {
- $pages = $pages->sort(...$pages::sortArgs($this->sortBy));
- }
+ // sort
+ if ($this->sortBy) {
+ $pages = $pages->sort(...$pages::sortArgs($this->sortBy));
+ }
- // flip
- if ($this->flip === true) {
- $pages = $pages->flip();
- }
+ // flip
+ if ($this->flip === true) {
+ $pages = $pages->flip();
+ }
- // pagination
- $pages = $pages->paginate([
- 'page' => $this->page,
- 'limit' => $this->limit,
- 'method' => 'none' // the page is manually provided
- ]);
+ // pagination
+ $pages = $pages->paginate([
+ 'page' => $this->page,
+ 'limit' => $this->limit,
+ 'method' => 'none' // the page is manually provided
+ ]);
- return $pages;
- },
- 'total' => function () {
- return $this->pages->pagination()->total();
- },
- 'data' => function () {
- $data = [];
+ return $pages;
+ },
+ 'total' => function () {
+ return $this->pages->pagination()->total();
+ },
+ 'data' => function () {
+ $data = [];
- foreach ($this->pages as $page) {
- $panel = $page->panel();
- $permissions = $page->permissions();
+ foreach ($this->pages as $page) {
+ $panel = $page->panel();
+ $permissions = $page->permissions();
- $item = [
- 'dragText' => $panel->dragText(),
- 'id' => $page->id(),
- 'image' => $panel->image(
- $this->image,
- $this->layout === 'table' ? 'list' : $this->layout
- ),
- 'info' => $page->toSafeString($this->info ?? false),
- 'link' => $panel->url(true),
- 'parent' => $page->parentId(),
- 'permissions' => [
- 'sort' => $permissions->can('sort'),
- 'changeSlug' => $permissions->can('changeSlug'),
- 'changeStatus' => $permissions->can('changeStatus'),
- 'changeTitle' => $permissions->can('changeTitle'),
- ],
- 'status' => $page->status(),
- 'template' => $page->intendedTemplate()->name(),
- 'text' => $page->toSafeString($this->text),
- ];
+ $item = [
+ 'dragText' => $panel->dragText(),
+ 'id' => $page->id(),
+ 'image' => $panel->image(
+ $this->image,
+ $this->layout === 'table' ? 'list' : $this->layout
+ ),
+ 'info' => $page->toSafeString($this->info ?? false),
+ 'link' => $panel->url(true),
+ 'parent' => $page->parentId(),
+ 'permissions' => [
+ 'sort' => $permissions->can('sort'),
+ 'changeSlug' => $permissions->can('changeSlug'),
+ 'changeStatus' => $permissions->can('changeStatus'),
+ 'changeTitle' => $permissions->can('changeTitle'),
+ ],
+ 'status' => $page->status(),
+ 'template' => $page->intendedTemplate()->name(),
+ 'text' => $page->toSafeString($this->text),
+ ];
- if ($this->layout === 'table') {
- $item = $this->columnsValues($item, $page);
- }
+ if ($this->layout === 'table') {
+ $item = $this->columnsValues($item, $page);
+ }
- $data[] = $item;
- }
+ $data[] = $item;
+ }
- return $data;
- },
- 'errors' => function () {
- $errors = [];
+ return $data;
+ },
+ 'errors' => function () {
+ $errors = [];
- if ($this->validateMax() === false) {
- $errors['max'] = I18n::template('error.section.pages.max.' . I18n::form($this->max), [
- 'max' => $this->max,
- 'section' => $this->headline
- ]);
- }
+ if ($this->validateMax() === false) {
+ $errors['max'] = I18n::template('error.section.pages.max.' . I18n::form($this->max), [
+ 'max' => $this->max,
+ 'section' => $this->headline
+ ]);
+ }
- if ($this->validateMin() === false) {
- $errors['min'] = I18n::template('error.section.pages.min.' . I18n::form($this->min), [
- 'min' => $this->min,
- 'section' => $this->headline
- ]);
- }
+ if ($this->validateMin() === false) {
+ $errors['min'] = I18n::template('error.section.pages.min.' . I18n::form($this->min), [
+ 'min' => $this->min,
+ 'section' => $this->headline
+ ]);
+ }
- if (empty($errors) === true) {
- return [];
- }
+ if (empty($errors) === true) {
+ return [];
+ }
- return [
- $this->name => [
- 'label' => $this->headline,
- 'message' => $errors,
- ]
- ];
- },
- 'add' => function () {
- if ($this->create === false) {
- return false;
- }
+ return [
+ $this->name => [
+ 'label' => $this->headline,
+ 'message' => $errors,
+ ]
+ ];
+ },
+ 'add' => function () {
+ if ($this->create === false) {
+ return false;
+ }
- if (in_array($this->status, ['draft', 'all']) === false) {
- return false;
- }
+ if (in_array($this->status, ['draft', 'all']) === false) {
+ return false;
+ }
- if ($this->isFull() === true) {
- return false;
- }
+ if ($this->isFull() === true) {
+ return false;
+ }
- return true;
- },
- 'pagination' => function () {
- return $this->pagination();
- }
- ],
- 'methods' => [
- 'blueprints' => function () {
- $blueprints = [];
- $templates = empty($this->create) === false ? A::wrap($this->create) : $this->templates;
+ return true;
+ },
+ 'pagination' => function () {
+ return $this->pagination();
+ }
+ ],
+ 'methods' => [
+ 'blueprints' => function () {
+ $blueprints = [];
+ $templates = empty($this->create) === false ? A::wrap($this->create) : $this->templates;
- if (empty($templates) === true) {
- $templates = $this->kirby()->blueprints();
- }
+ if (empty($templates) === true) {
+ $templates = $this->kirby()->blueprints();
+ }
- // convert every template to a usable option array
- // for the template select box
- foreach ($templates as $template) {
- try {
- $props = Blueprint::load('pages/' . $template);
+ // convert every template to a usable option array
+ // for the template select box
+ foreach ($templates as $template) {
+ try {
+ $props = Blueprint::load('pages/' . $template);
- $blueprints[] = [
- 'name' => basename($props['name']),
- 'title' => $props['title'],
- ];
- } catch (Throwable $e) {
- $blueprints[] = [
- 'name' => basename($template),
- 'title' => ucfirst($template),
- ];
- }
- }
+ $blueprints[] = [
+ 'name' => basename($props['name']),
+ 'title' => $props['title'],
+ ];
+ } catch (Throwable $e) {
+ $blueprints[] = [
+ 'name' => basename($template),
+ 'title' => ucfirst($template),
+ ];
+ }
+ }
- return $blueprints;
- }
- ],
- 'toArray' => function () {
- return [
- 'data' => $this->data,
- 'errors' => $this->errors,
- 'options' => [
- 'add' => $this->add,
- 'columns' => $this->columns,
- 'empty' => $this->empty,
- 'headline' => $this->headline,
- 'help' => $this->help,
- 'layout' => $this->layout,
- 'link' => $this->link(),
- 'max' => $this->max,
- 'min' => $this->min,
- 'search' => $this->search,
- 'size' => $this->size,
- 'sortable' => $this->sortable
- ],
- 'pagination' => $this->pagination,
- ];
- }
+ return $blueprints;
+ }
+ ],
+ 'toArray' => function () {
+ return [
+ 'data' => $this->data,
+ 'errors' => $this->errors,
+ 'options' => [
+ 'add' => $this->add,
+ 'columns' => $this->columns,
+ 'empty' => $this->empty,
+ 'headline' => $this->headline,
+ 'help' => $this->help,
+ 'layout' => $this->layout,
+ 'link' => $this->link(),
+ 'max' => $this->max,
+ 'min' => $this->min,
+ 'search' => $this->search,
+ 'size' => $this->size,
+ 'sortable' => $this->sortable
+ ],
+ 'pagination' => $this->pagination,
+ ];
+ }
];
diff --git a/kirby/config/sections/stats.php b/kirby/config/sections/stats.php
index 662d3f6..e04755b 100755
--- a/kirby/config/sections/stats.php
+++ b/kirby/config/sections/stats.php
@@ -3,60 +3,60 @@
use Kirby\Toolkit\I18n;
return [
- 'mixins' => [
- 'headline',
- ],
- 'props' => [
- /**
- * Array or query string for reports. Each report needs a `label` and `value` and can have additional `info`, `link` and `theme` settings.
- */
- 'reports' => function ($reports = null) {
- if ($reports === null) {
- return [];
- }
+ 'mixins' => [
+ 'headline',
+ ],
+ 'props' => [
+ /**
+ * Array or query string for reports. Each report needs a `label` and `value` and can have additional `info`, `link` and `theme` settings.
+ */
+ 'reports' => function ($reports = null) {
+ if ($reports === null) {
+ return [];
+ }
- if (is_string($reports) === true) {
- $reports = $this->model()->query($reports);
- }
+ if (is_string($reports) === true) {
+ $reports = $this->model()->query($reports);
+ }
- if (is_array($reports) === false) {
- return [];
- }
+ if (is_array($reports) === false) {
+ return [];
+ }
- return $reports;
- },
- /**
- * The size of the report cards. Available sizes: `tiny`, `small`, `medium`, `large`
- */
- 'size' => function (string $size = 'large') {
- return $size;
- }
- ],
- 'computed' => [
- 'reports' => function () {
- $reports = [];
- $model = $this->model();
- $value = fn ($value) => $value === null ? null : $model->toString($value);
+ return $reports;
+ },
+ /**
+ * The size of the report cards. Available sizes: `tiny`, `small`, `medium`, `large`
+ */
+ 'size' => function (string $size = 'large') {
+ return $size;
+ }
+ ],
+ 'computed' => [
+ 'reports' => function () {
+ $reports = [];
+ $model = $this->model();
+ $value = fn ($value) => $value === null ? null : $model->toString($value);
- foreach ($this->reports as $report) {
- if (is_string($report) === true) {
- $report = $model->query($report);
- }
+ foreach ($this->reports as $report) {
+ if (is_string($report) === true) {
+ $report = $model->query($report);
+ }
- if (is_array($report) === false) {
- continue;
- }
+ if (is_array($report) === false) {
+ continue;
+ }
- $reports[] = [
- 'label' => I18n::translate($report['label'], $report['label']),
- 'value' => $value($report['value'] ?? null),
- 'info' => $value($report['info'] ?? null),
- 'link' => $value($report['link'] ?? null),
- 'theme' => $value($report['theme'] ?? null)
- ];
- }
+ $reports[] = [
+ 'label' => I18n::translate($report['label'], $report['label']),
+ 'value' => $value($report['value'] ?? null),
+ 'info' => $value($report['info'] ?? null),
+ 'link' => $value($report['link'] ?? null),
+ 'theme' => $value($report['theme'] ?? null)
+ ];
+ }
- return $reports;
- }
- ]
+ return $reports;
+ }
+ ]
];
diff --git a/kirby/config/setup.php b/kirby/config/setup.php
index eadb131..853b54b 100755
--- a/kirby/config/setup.php
+++ b/kirby/config/setup.php
@@ -11,11 +11,11 @@ define('DS', '/');
$aliases = require_once __DIR__ . '/aliases.php';
spl_autoload_register(function ($class) use ($aliases) {
- $class = strtolower($class);
+ $class = strtolower($class);
- if (isset($aliases[$class]) === true) {
- class_alias($aliases[$class], $class);
- }
+ if (isset($aliases[$class]) === true) {
+ class_alias($aliases[$class], $class);
+ }
});
/**
@@ -24,13 +24,13 @@ spl_autoload_register(function ($class) use ($aliases) {
$testDir = dirname(__DIR__) . '/tests';
if (is_dir($testDir) === true) {
- spl_autoload_register(function ($className) use ($testDir) {
- $path = str_replace('Kirby\\', '', $className);
- $path = str_replace('\\', '/', $path);
- $file = $testDir . '/' . $path . '.php';
+ spl_autoload_register(function ($className) use ($testDir) {
+ $path = str_replace('Kirby\\', '', $className);
+ $path = str_replace('\\', '/', $path);
+ $file = $testDir . '/' . $path . '.php';
- if (file_exists($file)) {
- include $file;
- }
- });
+ if (file_exists($file)) {
+ include $file;
+ }
+ });
}
diff --git a/kirby/config/tags.php b/kirby/config/tags.php
index 702b55a..54e7115 100755
--- a/kirby/config/tags.php
+++ b/kirby/config/tags.php
@@ -9,316 +9,316 @@ use Kirby\Toolkit\Str;
*/
return [
- /**
- * Date
- */
- 'date' => [
- 'attr' => [],
- 'html' => function ($tag) {
- return strtolower($tag->date) === 'year' ? date('Y') : date($tag->date);
- }
- ],
+ /**
+ * Date
+ */
+ 'date' => [
+ 'attr' => [],
+ 'html' => function ($tag) {
+ return strtolower($tag->date) === 'year' ? date('Y') : date($tag->date);
+ }
+ ],
- /**
- * Email
- */
- 'email' => [
- 'attr' => [
- 'class',
- 'rel',
- 'target',
- 'text',
- 'title'
- ],
- 'html' => function ($tag) {
- return Html::email($tag->value, $tag->text, [
- 'class' => $tag->class,
- 'rel' => $tag->rel,
- 'target' => $tag->target,
- 'title' => $tag->title,
- ]);
- }
- ],
+ /**
+ * Email
+ */
+ 'email' => [
+ 'attr' => [
+ 'class',
+ 'rel',
+ 'target',
+ 'text',
+ 'title'
+ ],
+ 'html' => function ($tag) {
+ return Html::email($tag->value, $tag->text, [
+ 'class' => $tag->class,
+ 'rel' => $tag->rel,
+ 'target' => $tag->target,
+ 'title' => $tag->title,
+ ]);
+ }
+ ],
- /**
- * File
- */
- 'file' => [
- 'attr' => [
- 'class',
- 'download',
- 'rel',
- 'target',
- 'text',
- 'title'
- ],
- 'html' => function ($tag) {
- if (!$file = $tag->file($tag->value)) {
- return $tag->text;
- }
+ /**
+ * File
+ */
+ 'file' => [
+ 'attr' => [
+ 'class',
+ 'download',
+ 'rel',
+ 'target',
+ 'text',
+ 'title'
+ ],
+ 'html' => function ($tag) {
+ if (!$file = $tag->file($tag->value)) {
+ return $tag->text;
+ }
- // use filename if the text is empty and make sure to
- // ignore markdown italic underscores in filenames
- if (empty($tag->text) === true) {
- $tag->text = str_replace('_', '\_', $file->filename());
- }
+ // use filename if the text is empty and make sure to
+ // ignore markdown italic underscores in filenames
+ if (empty($tag->text) === true) {
+ $tag->text = str_replace('_', '\_', $file->filename());
+ }
- return Html::a($file->url(), $tag->text, [
- 'class' => $tag->class,
- 'download' => $tag->download !== 'false',
- 'rel' => $tag->rel,
- 'target' => $tag->target,
- 'title' => $tag->title,
- ]);
- }
- ],
+ return Html::a($file->url(), $tag->text, [
+ 'class' => $tag->class,
+ 'download' => $tag->download !== 'false',
+ 'rel' => $tag->rel,
+ 'target' => $tag->target,
+ 'title' => $tag->title,
+ ]);
+ }
+ ],
- /**
- * Gist
- */
- 'gist' => [
- 'attr' => [
- 'file'
- ],
- 'html' => function ($tag) {
- return Html::gist($tag->value, $tag->file);
- }
- ],
+ /**
+ * Gist
+ */
+ 'gist' => [
+ 'attr' => [
+ 'file'
+ ],
+ 'html' => function ($tag) {
+ return Html::gist($tag->value, $tag->file);
+ }
+ ],
- /**
- * Image
- */
- 'image' => [
- 'attr' => [
- 'alt',
- 'caption',
- 'class',
- 'height',
- 'imgclass',
- 'link',
- 'linkclass',
- 'rel',
- 'target',
- 'title',
- 'width'
- ],
- 'html' => function ($tag) {
- if ($tag->file = $tag->file($tag->value)) {
- $tag->src = $tag->file->url();
- $tag->alt = $tag->alt ?? $tag->file->alt()->or(' ')->value();
- $tag->title = $tag->title ?? $tag->file->title()->value();
- $tag->caption = $tag->caption ?? $tag->file->caption()->value();
- } else {
- $tag->src = Url::to($tag->value);
- }
+ /**
+ * Image
+ */
+ 'image' => [
+ 'attr' => [
+ 'alt',
+ 'caption',
+ 'class',
+ 'height',
+ 'imgclass',
+ 'link',
+ 'linkclass',
+ 'rel',
+ 'target',
+ 'title',
+ 'width'
+ ],
+ 'html' => function ($tag) {
+ if ($tag->file = $tag->file($tag->value)) {
+ $tag->src = $tag->file->url();
+ $tag->alt = $tag->alt ?? $tag->file->alt()->or(' ')->value();
+ $tag->title = $tag->title ?? $tag->file->title()->value();
+ $tag->caption = $tag->caption ?? $tag->file->caption()->value();
+ } else {
+ $tag->src = Url::to($tag->value);
+ }
- $link = function ($img) use ($tag) {
- if (empty($tag->link) === true) {
- return $img;
- }
+ $link = function ($img) use ($tag) {
+ if (empty($tag->link) === true) {
+ return $img;
+ }
- if ($link = $tag->file($tag->link)) {
- $link = $link->url();
- } else {
- $link = $tag->link === 'self' ? $tag->src : $tag->link;
- }
+ if ($link = $tag->file($tag->link)) {
+ $link = $link->url();
+ } else {
+ $link = $tag->link === 'self' ? $tag->src : $tag->link;
+ }
- return Html::a($link, [$img], [
- 'rel' => $tag->rel,
- 'class' => $tag->linkclass,
- 'target' => $tag->target
- ]);
- };
+ return Html::a($link, [$img], [
+ 'rel' => $tag->rel,
+ 'class' => $tag->linkclass,
+ 'target' => $tag->target
+ ]);
+ };
- $image = Html::img($tag->src, [
- 'width' => $tag->width,
- 'height' => $tag->height,
- 'class' => $tag->imgclass,
- 'title' => $tag->title,
- 'alt' => $tag->alt ?? ' '
- ]);
+ $image = Html::img($tag->src, [
+ 'width' => $tag->width,
+ 'height' => $tag->height,
+ 'class' => $tag->imgclass,
+ 'title' => $tag->title,
+ 'alt' => $tag->alt ?? ' '
+ ]);
- if ($tag->kirby()->option('kirbytext.image.figure', true) === false) {
- return $link($image);
- }
+ if ($tag->kirby()->option('kirbytext.image.figure', true) === false) {
+ return $link($image);
+ }
- // render KirbyText in caption
- if ($tag->caption) {
- $options = ['markdown' => ['inline' => true]];
- $caption = $tag->kirby()->kirbytext($tag->caption, $options);
- $tag->caption = [$caption];
- }
+ // render KirbyText in caption
+ if ($tag->caption) {
+ $options = ['markdown' => ['inline' => true]];
+ $caption = $tag->kirby()->kirbytext($tag->caption, $options);
+ $tag->caption = [$caption];
+ }
- return Html::figure([ $link($image) ], $tag->caption, [
- 'class' => $tag->class
- ]);
- }
- ],
+ return Html::figure([ $link($image) ], $tag->caption, [
+ 'class' => $tag->class
+ ]);
+ }
+ ],
- /**
- * Link
- */
- 'link' => [
- 'attr' => [
- 'class',
- 'lang',
- 'rel',
- 'role',
- 'target',
- 'title',
- 'text',
- ],
- 'html' => function ($tag) {
- if (empty($tag->lang) === false) {
- $tag->value = Url::to($tag->value, $tag->lang);
- }
+ /**
+ * Link
+ */
+ 'link' => [
+ 'attr' => [
+ 'class',
+ 'lang',
+ 'rel',
+ 'role',
+ 'target',
+ 'title',
+ 'text',
+ ],
+ 'html' => function ($tag) {
+ if (empty($tag->lang) === false) {
+ $tag->value = Url::to($tag->value, $tag->lang);
+ }
- return Html::a($tag->value, $tag->text, [
- 'rel' => $tag->rel,
- 'class' => $tag->class,
- 'role' => $tag->role,
- 'title' => $tag->title,
- 'target' => $tag->target,
- ]);
- }
- ],
+ return Html::a($tag->value, $tag->text, [
+ 'rel' => $tag->rel,
+ 'class' => $tag->class,
+ 'role' => $tag->role,
+ 'title' => $tag->title,
+ 'target' => $tag->target,
+ ]);
+ }
+ ],
- /**
- * Tel
- */
- 'tel' => [
- 'attr' => [
- 'class',
- 'rel',
- 'text',
- 'title'
- ],
- 'html' => function ($tag) {
- return Html::tel($tag->value, $tag->text, [
- 'class' => $tag->class,
- 'rel' => $tag->rel,
- 'title' => $tag->title
- ]);
- }
- ],
+ /**
+ * Tel
+ */
+ 'tel' => [
+ 'attr' => [
+ 'class',
+ 'rel',
+ 'text',
+ 'title'
+ ],
+ 'html' => function ($tag) {
+ return Html::tel($tag->value, $tag->text, [
+ 'class' => $tag->class,
+ 'rel' => $tag->rel,
+ 'title' => $tag->title
+ ]);
+ }
+ ],
- /**
- * Twitter
- */
- 'twitter' => [
- 'attr' => [
- 'class',
- 'rel',
- 'target',
- 'text',
- 'title'
- ],
- 'html' => function ($tag) {
+ /**
+ * Twitter
+ */
+ 'twitter' => [
+ 'attr' => [
+ 'class',
+ 'rel',
+ 'target',
+ 'text',
+ 'title'
+ ],
+ 'html' => function ($tag) {
- // get and sanitize the username
- $username = str_replace('@', '', $tag->value);
+ // get and sanitize the username
+ $username = str_replace('@', '', $tag->value);
- // build the profile url
- $url = 'https://twitter.com/' . $username;
+ // build the profile url
+ $url = 'https://twitter.com/' . $username;
- // sanitize the link text
- $text = $tag->text ?? '@' . $username;
+ // sanitize the link text
+ $text = $tag->text ?? '@' . $username;
- // build the final link
- return Html::a($url, $text, [
- 'class' => $tag->class,
- 'rel' => $tag->rel,
- 'target' => $tag->target,
- 'title' => $tag->title,
- ]);
- }
- ],
+ // build the final link
+ return Html::a($url, $text, [
+ 'class' => $tag->class,
+ 'rel' => $tag->rel,
+ 'target' => $tag->target,
+ 'title' => $tag->title,
+ ]);
+ }
+ ],
- /**
- * Video
- */
- 'video' => [
- 'attr' => [
- 'autoplay',
- 'caption',
- 'controls',
- 'class',
- 'height',
- 'loop',
- 'muted',
- 'poster',
- 'preload',
- 'style',
- 'width',
- ],
- 'html' => function ($tag) {
- // checks and gets if poster is local file
- if (
- empty($tag->poster) === false &&
- Str::startsWith($tag->poster, 'http://') !== true &&
- Str::startsWith($tag->poster, 'https://') !== true
- ) {
- if ($poster = $tag->file($tag->poster)) {
- $tag->poster = $poster->url();
- }
- }
+ /**
+ * Video
+ */
+ 'video' => [
+ 'attr' => [
+ 'autoplay',
+ 'caption',
+ 'controls',
+ 'class',
+ 'height',
+ 'loop',
+ 'muted',
+ 'poster',
+ 'preload',
+ 'style',
+ 'width',
+ ],
+ 'html' => function ($tag) {
+ // checks and gets if poster is local file
+ if (
+ empty($tag->poster) === false &&
+ Str::startsWith($tag->poster, 'http://') !== true &&
+ Str::startsWith($tag->poster, 'https://') !== true
+ ) {
+ if ($poster = $tag->file($tag->poster)) {
+ $tag->poster = $poster->url();
+ }
+ }
- // checks video is local or provider(remote)
- $isLocalVideo = (
- Str::startsWith($tag->value, 'http://') !== true &&
- Str::startsWith($tag->value, 'https://') !== true
- );
- $isProviderVideo = (
- $isLocalVideo === false &&
- (
- Str::contains($tag->value, 'youtu', true) === true ||
- Str::contains($tag->value, 'vimeo', true) === true
- )
- );
+ // checks video is local or provider(remote)
+ $isLocalVideo = (
+ Str::startsWith($tag->value, 'http://') !== true &&
+ Str::startsWith($tag->value, 'https://') !== true
+ );
+ $isProviderVideo = (
+ $isLocalVideo === false &&
+ (
+ Str::contains($tag->value, 'youtu', true) === true ||
+ Str::contains($tag->value, 'vimeo', true) === true
+ )
+ );
- // default attributes for local and remote videos
- $attrs = [
- 'height' => $tag->height,
- 'width' => $tag->width
- ];
+ // default attributes for local and remote videos
+ $attrs = [
+ 'height' => $tag->height,
+ 'width' => $tag->width
+ ];
- // don't use attributes that iframe doesn't support
- if ($isProviderVideo === false) {
- // converts tag attributes to supported formats (listed below) to output correct html
- // booleans: autoplay, controls, loop, muted
- // strings : poster, preload
- // for ex : `autoplay` will not work if `false` is a `string` instead of a `boolean`
- $attrs['autoplay'] = $autoplay = Str::toType($tag->autoplay, 'bool');
- $attrs['controls'] = Str::toType($tag->controls ?? true, 'bool');
- $attrs['loop'] = Str::toType($tag->loop, 'bool');
- $attrs['muted'] = Str::toType($tag->muted ?? $autoplay, 'bool');
- $attrs['poster'] = $tag->poster;
- $attrs['preload'] = $tag->preload;
- }
+ // don't use attributes that iframe doesn't support
+ if ($isProviderVideo === false) {
+ // converts tag attributes to supported formats (listed below) to output correct html
+ // booleans: autoplay, controls, loop, muted
+ // strings : poster, preload
+ // for ex : `autoplay` will not work if `false` is a `string` instead of a `boolean`
+ $attrs['autoplay'] = $autoplay = Str::toType($tag->autoplay, 'bool');
+ $attrs['controls'] = Str::toType($tag->controls ?? true, 'bool');
+ $attrs['loop'] = Str::toType($tag->loop, 'bool');
+ $attrs['muted'] = Str::toType($tag->muted ?? $autoplay, 'bool');
+ $attrs['poster'] = $tag->poster;
+ $attrs['preload'] = $tag->preload;
+ }
- // handles local and remote video file
- if ($isLocalVideo === true) {
- // handles local video file
- if ($tag->file = $tag->file($tag->value)) {
- $source = Html::tag('source', '', [
- 'src' => $tag->file->url(),
- 'type' => $tag->file->mime()
- ]);
- $video = Html::tag('video', [$source], $attrs);
- }
- } else {
- $video = Html::video(
- $tag->value,
- $tag->kirby()->option('kirbytext.video.options', []),
- $attrs
- );
- }
+ // handles local and remote video file
+ if ($isLocalVideo === true) {
+ // handles local video file
+ if ($tag->file = $tag->file($tag->value)) {
+ $source = Html::tag('source', '', [
+ 'src' => $tag->file->url(),
+ 'type' => $tag->file->mime()
+ ]);
+ $video = Html::tag('video', [$source], $attrs);
+ }
+ } else {
+ $video = Html::video(
+ $tag->value,
+ $tag->kirby()->option('kirbytext.video.options', []),
+ $attrs
+ );
+ }
- return Html::figure([$video ?? ''], $tag->caption, [
- 'class' => $tag->class ?? 'video',
- 'style' => $tag->style
- ]);
- }
- ],
+ return Html::figure([$video ?? ''], $tag->caption, [
+ 'class' => $tag->class ?? 'video',
+ 'style' => $tag->style
+ ]);
+ }
+ ],
];
diff --git a/kirby/config/templates/emails/auth/login.php b/kirby/config/templates/emails/auth/login.php
index e552481..cacea18 100755
--- a/kirby/config/templates/emails/auth/login.php
+++ b/kirby/config/templates/emails/auth/login.php
@@ -9,8 +9,8 @@ use Kirby\Toolkit\I18n;
* @var int $timeout
*/
echo I18n::template(
- 'login.email.login.body',
- null,
- compact('user', 'site', 'code', 'timeout'),
- $user->language()
+ 'login.email.login.body',
+ null,
+ compact('user', 'site', 'code', 'timeout'),
+ $user->language()
);
diff --git a/kirby/config/templates/emails/auth/password-reset.php b/kirby/config/templates/emails/auth/password-reset.php
index 3cd55de..4480f31 100755
--- a/kirby/config/templates/emails/auth/password-reset.php
+++ b/kirby/config/templates/emails/auth/password-reset.php
@@ -9,8 +9,8 @@ use Kirby\Toolkit\I18n;
* @var int $timeout
*/
echo I18n::template(
- 'login.email.password-reset.body',
- null,
- compact('user', 'site', 'code', 'timeout'),
- $user->language()
+ 'login.email.password-reset.body',
+ null,
+ compact('user', 'site', 'code', 'timeout'),
+ $user->language()
);
diff --git a/kirby/i18n/translations/ru.json b/kirby/i18n/translations/ru.json
index f4acd25..c38fb9d 100755
--- a/kirby/i18n/translations/ru.json
+++ b/kirby/i18n/translations/ru.json
@@ -177,7 +177,7 @@
"error.user.duplicate": "Пользователь с Email \"{email}\" уже есть",
"error.user.email.invalid": "Пожалуйста, введите правильный адрес эл. почты",
"error.user.language.invalid": "Введите правильный язык",
- "error.user.notFound": "\u0410\u043a\u043a\u0430\u0443\u043d\u0442 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d",
+ "error.user.notFound": "Пользователь \"{name}\" не найден",
"error.user.password.invalid": "Пожалуйста, введите правильный пароль. Он должен состоять минимум из 8 символов.",
"error.user.password.notSame": "\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u043f\u0430\u0440\u043e\u043b\u044c",
"error.user.password.undefined": "У пользователя нет пароля",
@@ -238,11 +238,11 @@
"field.blocks.delete.confirm": "Вы действительно хотите удалить этот блок?",
"field.blocks.delete.confirm.all": "Вы действительно хотите удалить все блоки?",
"field.blocks.delete.confirm.selected": "Вы действительно хотите удалить эти блоки?",
- "field.blocks.empty": "Еще нет блоков",
+ "field.blocks.empty": "Блоков нет",
"field.blocks.fieldsets.label": "Пожалуйста, выберите тип блока…",
"field.blocks.fieldsets.paste": "Нажмите {{ shortcut }} чтобы вставить/импортировать блоки из буфера памяти",
"field.blocks.gallery.name": "Галерея",
- "field.blocks.gallery.images.empty": "Еще нет изображений",
+ "field.blocks.gallery.images.empty": "Изображений нет",
"field.blocks.gallery.images.label": "Изображения",
"field.blocks.heading.level": "Уровень",
"field.blocks.heading.name": "Заголовок",
@@ -275,17 +275,17 @@
"field.blocks.video.url.label": "Ссылка на видео",
"field.blocks.video.url.placeholder": "https://youtube.com/?v=",
- "field.files.empty": "Еще не выбраны файлы",
+ "field.files.empty": "Файлы не выбраны",
"field.layout.delete": "Удалить разметку",
"field.layout.delete.confirm": "Вы действительно хотите удалить эту разметку?",
- "field.layout.empty": "Еще нет строк",
+ "field.layout.empty": "Строк нет",
"field.layout.select": "Выберите разметку",
- "field.pages.empty": "Еще не выбраны страницы",
+ "field.pages.empty": "Страницы не выбраны",
"field.structure.delete.confirm": "Вы точно хотите удалить эту запись?",
- "field.structure.empty": "Еще нет записей",
- "field.users.empty": "Еще нет пользователей",
+ "field.structure.empty": "Записей нет",
+ "field.users.empty": "Пользователей нет",
"file.blueprint": "У файла пока нет разметки. Вы можете определить новые секции и поля разметки в /site/blueprints/files/{blueprint}.yml",
"file.delete.confirm": "Вы точно хотите удалить файл
{filename}?",
@@ -297,7 +297,7 @@
"hide": "Скрыть",
"hour": "Час",
"import": "Импортировать",
- "info": "Info",
+ "info": "Информация",
"insert": "\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c",
"insert.after": "Вставить ниже",
"insert.before": "Вставить выше",
@@ -333,14 +333,14 @@
"languages": "Языки",
"languages.default": "Главный язык",
- "languages.empty": "Еще нет языков",
+ "languages.empty": "Языков нет",
"languages.secondary": "Дополнительные языки",
- "languages.secondary.empty": "Еще нет дополнительных языков",
+ "languages.secondary.empty": "Дополнительных языков нет",
"license": "Лицензия",
"license.buy": "Купить лицензию",
"license.register": "Зарегистрировать",
- "license.manage": "Manage your licenses",
+ "license.manage": "Управление лицензиями",
"license.register.help": "После покупки вы получили по эл. почте код лицензии. Пожалуйста скопируйте и вставьте сюда чтобы зарегистрировать.",
"license.register.label": "Пожалуйста вставьте код лицензии",
"license.register.success": "Спасибо за поддержку Kirby",
@@ -353,7 +353,7 @@
"loading": "Загрузка",
"lock.unsaved": "Несохраненные изменения",
- "lock.unsaved.empty": "Больше нет несохраненных изменений",
+ "lock.unsaved.empty": "Несохраненных изменений больше нет",
"lock.isLocked": "Несохраненные изменения пользователя {email}",
"lock.file.isLocked": "В данный момент этот файл редактирует {email}, поэтому его нельзя изменить.",
"lock.page.isLocked": "В данный момент эту страницу редактирует {email}, поэтому его нельзя изменить.",
@@ -406,7 +406,7 @@
"open": "Открыть",
"open.newWindow": "Открывать в новом окне",
"options": "Опции",
- "options.none": "Нет параметров",
+ "options.none": "Параметров нет",
"orientation": "Ориентация",
"orientation.landscape": "Горизонтальная",
@@ -424,7 +424,7 @@
"page.delete.confirm.subpages": "У этой страницы есть внутренние страницы.
Все внутренние страницы так же будут удалены.",
"page.delete.confirm.title": "Напишите название страницы, чтобы подтвердить",
"page.draft.create": "Создать черновик",
- "page.duplicate.appendix": "Скопировать",
+ "page.duplicate.appendix": "(копия)",
"page.duplicate.files": "Копировать файлы",
"page.duplicate.pages": "Копировать страницы",
"page.sort": "Изменить позицию",
@@ -437,7 +437,7 @@
"page.status.unlisted.description": "Страница доступна только по URL",
"pages": "Страницы",
- "pages.empty": "Еще нет страниц",
+ "pages.empty": "Страниц нет",
"pages.status.draft": "Черновики",
"pages.status.listed": "Опубликовано",
"pages.status.unlisted": "Скрытая",
@@ -462,7 +462,7 @@
"role.admin.description": "Администратор имеет все права",
"role.admin.title": "Администратор",
"role.all": "Все",
- "role.empty": "Нет пользователей с такой ролью",
+ "role.empty": "Пользователей с такой ролью нет",
"role.description.placeholder": "Без описания",
"role.nobody.description": "Эта роль применяется если у пользователя нет никаких прав",
"role.nobody.title": "Никто",
@@ -485,7 +485,7 @@
"slug": "Понятная ссылка",
"sort": "Сортировать",
- "stats.empty": "Нет уведомлений",
+ "stats.empty": "Статистики нет",
"system.issues.content": "Похоже, к папке content есть несанкционированный доступ",
"system.issues.debug": "Включен режим отладки (debugging). Используйте его только при разработке.",
"system.issues.git": "Похоже, к папке .git есть несанкционированный доступ",
@@ -524,9 +524,9 @@
"translation.locale": "ru_RU",
"upload": "Закачать",
- "upload.error.cantMove": "Загруженный файл не может быть перемещен",
+ "upload.error.cantMove": "Не удается переместить загруженный файл",
"upload.error.cantWrite": "Не получилось записать файл на диск",
- "upload.error.default": "Не получилось загрузить файл",
+ "upload.error.default": "Не удалось загрузить файл",
"upload.error.extension": "Загрузка файла не удалась из за расширения",
"upload.error.formSize": "Загруженный файл больше чем MAX_FILE_SIZE настройка в форме",
"upload.error.iniPostSize": "Загружаемый файл больше чем post_max_size настройка в php.ini",
diff --git a/kirby/panel/cypress.config.js b/kirby/panel/cypress.config.js
new file mode 100755
index 0000000..bbb1589
--- /dev/null
+++ b/kirby/panel/cypress.config.js
@@ -0,0 +1,11 @@
+const { defineConfig } = require("cypress");
+
+module.exports = defineConfig({
+ video: false,
+
+ e2e: {
+ baseUrl: "http://sandbox.test",
+ specPattern: "src/**/*.e2e.js",
+ supportFile: false
+ }
+});
diff --git a/kirby/panel/dist/js/index.js b/kirby/panel/dist/js/index.js
index 13a5c8e..da66f28 100755
--- a/kirby/panel/dist/js/index.js
+++ b/kirby/panel/dist/js/index.js
@@ -1 +1 @@
-var t=Object.defineProperty,e=Object.defineProperties,n=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,r=(e,n,i)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i,a=(t,e)=>{for(var n in e||(e={}))s.call(e,n)&&r(t,n,e[n]);if(i)for(var n of i(e))o.call(e,n)&&r(t,n,e[n]);return t},l=(t,i)=>e(t,n(i));import{V as u,a as c,m as d,d as p,c as h,b as f,I as m,P as g,S as k,F as v,N as b,s as y,l as $,w as _,e as x,f as w,t as S,g as C,h as O,i as E,j as A,k as T,n as I,D as M,o as L,E as j,p as D,q as B,r as P,T as N,u as q,v as F,x as R,y as z,z as Y,A as H,B as U,C as K,G as J,H as G,J as V}from"./vendor.js";var W=t=>({changeName:async(e,n,i)=>t.patch(e+"/files/"+n+"/name",{name:i}),delete:async(e,n)=>t.delete(e+"/files/"+n),async get(e,n,i){let s=await t.get(e+"/files/"+n,i);return!0===Array.isArray(s.content)&&(s.content={}),s},link(t,e,n){return"/"+this.url(t,e,n)},update:async(e,n,i)=>t.patch(e+"/files/"+n,i),url(t,e,n){let i=t+"/files/"+e;return n&&(i+="/"+n),i}}),X=t=>({async blueprint(e){return t.get("pages/"+this.id(e)+"/blueprint")},async blueprints(e,n){return t.get("pages/"+this.id(e)+"/blueprints",{section:n})},async changeSlug(e,n){return t.patch("pages/"+this.id(e)+"/slug",{slug:n})},async changeStatus(e,n,i){return t.patch("pages/"+this.id(e)+"/status",{status:n,position:i})},async changeTemplate(e,n){return t.patch("pages/"+this.id(e)+"/template",{template:n})},async changeTitle(e,n){return t.patch("pages/"+this.id(e)+"/title",{title:n})},async children(e,n){return t.post("pages/"+this.id(e)+"/children/search",n)},async create(e,n){return null===e||"/"===e?t.post("site/children",n):t.post("pages/"+this.id(e)+"/children",n)},async delete(e,n){return t.delete("pages/"+this.id(e),n)},async duplicate(e,n,i){return t.post("pages/"+this.id(e)+"/duplicate",{slug:n,children:i.children||!1,files:i.files||!1})},async get(e,n){let i=await t.get("pages/"+this.id(e),n);return!0===Array.isArray(i.content)&&(i.content={}),i},id:t=>t.replace(/\//g,"+"),async files(e,n){return t.post("pages/"+this.id(e)+"/files/search",n)},link(t){return"/"+this.url(t)},async preview(t){return(await this.get(this.id(t),{select:"previewUrl"})).previewUrl},async search(e,n){return e?t.post("pages/"+this.id(e)+"/children/search?select=id,title,hasChildren",n):t.post("site/children/search?select=id,title,hasChildren",n)},async update(e,n){return t.patch("pages/"+this.id(e),n)},url(t,e){let n=null===t?"pages":"pages/"+String(t).replace(/\//g,"+");return e&&(n+="/"+e),n}});var Z=t=>({running:0,async request(e,n,i=!1){n=Object.assign(n||{},{credentials:"same-origin",cache:"no-store",headers:a({"x-requested-with":"xmlhttprequest","content-type":"application/json"},n.headers)}),t.methodOverwrite&&"GET"!==n.method&&"POST"!==n.method&&(n.headers["x-http-method-override"]=n.method,n.method="POST"),n=t.onPrepare(n);const s=e+"/"+JSON.stringify(n);t.onStart(s,i),this.running++;const o=await fetch([t.endpoint,e].join(t.endpoint.endsWith("/")||e.startsWith("/")?"":"/"),n);try{const e=await async function(t){const e=await t.text();let n;try{n=JSON.parse(e)}catch(i){return window.panel.$vue.$api.onParserError({html:e}),!1}return n}(o);if(o.status<200||o.status>299)throw e;if("error"===e.status)throw e;let n=e;return e.data&&"model"===e.type&&(n=e.data),this.running--,t.onComplete(s),t.onSuccess(e),n}catch(r){throw this.running--,t.onComplete(s),t.onError(r),r}},async get(t,e,n,i=!1){return e&&(t+="?"+Object.keys(e).filter((t=>void 0!==e[t]&&null!==e[t])).map((t=>t+"="+e[t])).join("&")),this.request(t,Object.assign(n||{},{method:"GET"}),i)},async post(t,e,n,i="POST",s=!1){return this.request(t,Object.assign(n||{},{method:i,body:JSON.stringify(e)}),s)},async patch(t,e,n,i=!1){return this.post(t,e,n,"PATCH",i)},async delete(t,e,n,i=!1){return this.post(t,e,n,"DELETE",i)}}),Q=t=>({blueprint:async e=>t.get("users/"+e+"/blueprint"),blueprints:async(e,n)=>t.get("users/"+e+"/blueprints",{section:n}),changeEmail:async(e,n)=>t.patch("users/"+e+"/email",{email:n}),changeLanguage:async(e,n)=>t.patch("users/"+e+"/language",{language:n}),changeName:async(e,n)=>t.patch("users/"+e+"/name",{name:n}),changePassword:async(e,n)=>t.patch("users/"+e+"/password",{password:n}),changeRole:async(e,n)=>t.patch("users/"+e+"/role",{role:n}),create:async e=>t.post("users",e),delete:async e=>t.delete("users/"+e),deleteAvatar:async e=>t.delete("users/"+e+"/avatar"),link(t,e){return"/"+this.url(t,e)},async list(e){return t.post(this.url(null,"search"),e)},get:async(e,n)=>t.get("users/"+e,n),async roles(e){return(await t.get(this.url(e,"roles"))).data.map((t=>({info:t.description||`(${window.panel.$t("role.description.placeholder")})`,text:t.title,value:t.name})))},search:async e=>t.post("users/search",e),update:async(e,n)=>t.patch("users/"+e,n),url(t,e){let n=t?"users/"+t:"users";return e&&(n+="/"+e),n}}),tt={install(t,e){t.prototype.$api=t.$api=((t={})=>{const e=a(a({},{endpoint:"/api",methodOverwrite:!0,onPrepare:t=>t,onStart(){},onComplete(){},onSuccess(){},onParserError(){},onError(t){throw window.console.log(t.message),t}}),t.config||{});let n=a(a(a({},e),Z(e)),t);return n.auth=(t=>({async login(e){const n={long:e.remember||!1,email:e.email,password:e.password};return t.post("auth/login",n)},logout:async()=>t.post("auth/logout"),user:async e=>t.get("auth",e),verifyCode:async e=>t.post("auth/code",{code:e})}))(n),n.files=W(n),n.languages=(t=>({create:async e=>t.post("languages",e),delete:async e=>t.delete("languages/"+e),get:async e=>t.get("languages/"+e),list:async()=>t.get("languages"),update:async(e,n)=>t.patch("languages/"+e,n)}))(n),n.pages=X(n),n.roles=(t=>({list:async e=>t.get("roles",e),get:async e=>t.get("roles/"+e)}))(n),n.system=(t=>({get:async(e={view:"panel"})=>t.get("system",e),install:async e=>(await t.post("system/install",e)).user,register:async e=>t.post("system/register",e)}))(n),n.site=(t=>({blueprint:async()=>t.get("site/blueprint"),blueprints:async()=>t.get("site/blueprints"),changeTitle:async e=>t.patch("site/title",{title:e}),children:async e=>t.post("site/children/search",e),get:async(e={view:"panel"})=>t.get("site",e),update:async e=>t.post("site",e)}))(n),n.translations=(t=>({list:async()=>t.get("translations"),get:async e=>t.get("translations/"+e)}))(n),n.users=Q(n),n})({config:{endpoint:window.panel.$urls.api,onComplete:n=>{t.$api.requests=t.$api.requests.filter((t=>t!==n)),0===t.$api.requests.length&&e.dispatch("isLoading",!1)},onError:e=>{window.panel.$config.debug&&window.console.error(e),403!==e.code||"Unauthenticated"!==e.message&&"access.panel"!==e.key||t.prototype.$go("/logout")},onParserError:({html:t,silent:n})=>{e.dispatch("fatal",{html:t,silent:n})},onPrepare:t=>(window.panel.$language&&(t.headers["x-language"]=window.panel.$language.code),t.headers["x-csrf"]=window.panel.$system.csrf,t),onStart:(n,i=!1)=>{!1===i&&e.dispatch("isLoading",!0),t.$api.requests.push(n)},onSuccess:()=>{clearInterval(t.$api.ping),t.$api.ping=setInterval(t.$api.auth.user,3e5)}},ping:null,requests:[]}),t.$api.ping=setInterval(t.$api.auth.user,3e5)}},et={name:"Fiber",data:()=>({component:null,state:window.fiber,key:null}),created(){this.$fiber.init(this.state,{base:document.querySelector("base").href,headers:()=>({"X-CSRF":this.state.$system.csrf}),onFatal({text:t,options:e}){this.$store.dispatch("fatal",{html:t,silent:e.silent})},onFinish:()=>{0===this.$api.requests.length&&this.$store.dispatch("isLoading",!1)},onPushState:t=>{window.history.pushState(t,"",t.$url)},onReplaceState:t=>{window.history.replaceState(t,"",t.$url)},onStart:({silent:t})=>{!0!==t&&this.$store.dispatch("isLoading",!0)},onSwap:async(t,e)=>{e=a({navigate:!0,replace:!1},e),this.setGlobals(t),this.setTitle(t),this.setTranslation(t),this.component=t.$view.component,this.state=t,this.key=!0===e.replace?this.key:t.$view.timestamp,!0===e.navigate&&this.navigate()},query:()=>{var t;return{language:null==(t=this.state.$language)?void 0:t.code}}}),window.addEventListener("popstate",this.$reload)},methods:{navigate(){this.$store.dispatch("navigate")},setGlobals(t){["$config","$direction","$language","$languages","$license","$menu","$multilang","$permissions","$searches","$system","$translation","$urls","$user","$view"].forEach((e=>{void 0!==t[e]?u.prototype[e]=window.panel[e]=t[e]:u.prototype[e]=t[e]=window.panel[e]}))},setTitle(t){t.$view.title?document.title=t.$view.title+" | "+t.$system.title:document.title=t.$system.title},setTranslation(t){t.$translation&&(document.documentElement.lang=t.$translation.code)}},render(t){if(this.component)return t(this.component,{key:this.key,props:this.state.$view.props})}};function nt(t){if(void 0!==t)return JSON.parse(JSON.stringify(t))}function it(t,e){for(const n of Object.keys(e))e[n]instanceof Object&&Object.assign(e[n],it(t[n]||{},e[n]));return Object.assign(t||{},e),t}var st={clone:nt,isEmpty:function(t){return null==t||""===t||("object"==typeof t&&0===Object.keys(t).length&&t.constructor===Object||void 0!==t.length&&0===t.length)},merge:it};const ot=(t,e)=>{localStorage.setItem("kirby$content$"+t,JSON.stringify(e))};var rt={namespaced:!0,state:{current:null,models:{},status:{enabled:!0}},getters:{exists:t=>e=>Object.prototype.hasOwnProperty.call(t.models,e),hasChanges:(t,e)=>t=>{const n=e.model(t).changes;return Object.keys(n).length>0},isCurrent:t=>e=>t.current===e,id:t=>e=>(e=e||t.current,window.panel.$language?e+"?language="+window.panel.$language.code:e),model:(t,e)=>n=>(n=n||t.current,!0===e.exists(n)?t.models[n]:{api:null,originals:{},values:{},changes:{}}),originals:(t,e)=>t=>nt(e.model(t).originals),values:(t,e)=>t=>a(a({},e.originals(t)),e.changes(t)),changes:(t,e)=>t=>nt(e.model(t).changes)},mutations:{CLEAR(t){Object.keys(t.models).forEach((e=>{t.models[e].changes={}})),Object.keys(localStorage).forEach((t=>{t.startsWith("kirby$content$")&&localStorage.removeItem(t)}))},CREATE(t,[e,n]){if(!n)return!1;let i=t.models[e]?t.models[e].changes:n.changes;u.set(t.models,e,{api:n.api,originals:n.originals,changes:i||{}})},CURRENT(t,e){t.current=e},MOVE(t,[e,n]){const i=nt(t.models[e]);u.delete(t.models,e),u.set(t.models,n,i);const s=localStorage.getItem("kirby$content$"+e);localStorage.removeItem("kirby$content$"+e),localStorage.setItem("kirby$content$"+n,s)},REMOVE(t,e){u.delete(t.models,e),localStorage.removeItem("kirby$content$"+e)},REVERT(t,e){t.models[e]&&(u.set(t.models[e],"changes",{}),localStorage.removeItem("kirby$content$"+e))},STATUS(t,e){u.set(t.status,"enabled",e)},UPDATE(t,[e,n,i]){if(!t.models[e])return!1;void 0===i&&(i=null),i=nt(i);const s=JSON.stringify(i);JSON.stringify(t.models[e].originals[n])==s?u.delete(t.models[e].changes,n):u.set(t.models[e].changes,n,i),ot(e,{api:t.models[e].api,originals:t.models[e].originals,changes:t.models[e].changes})}},actions:{init(t){Object.keys(localStorage).filter((t=>t.startsWith("kirby$content$"))).map((t=>t.split("kirby$content$")[1])).forEach((e=>{const n=localStorage.getItem("kirby$content$"+e);t.commit("CREATE",[e,JSON.parse(n)])})),Object.keys(localStorage).filter((t=>t.startsWith("kirby$form$"))).map((t=>t.split("kirby$form$")[1])).forEach((e=>{const n=localStorage.getItem("kirby$form$"+e);let i=null;try{i=JSON.parse(n)}catch(o){}if(!i||!i.api)return localStorage.removeItem("kirby$form$"+e),!1;const s={api:i.api,originals:i.originals,changes:i.values};t.commit("CREATE",[e,s]),ot(e,s),localStorage.removeItem("kirby$form$"+e)}))},clear(t){t.commit("CLEAR")},create(t,e){const n=nt(e.content);Array.isArray(e.ignore)&&e.ignore.forEach((t=>delete n[t])),e.id=t.getters.id(e.id);const i={api:e.api,originals:n,changes:{}};t.commit("CREATE",[e.id,i]),t.dispatch("current",e.id)},current(t,e){t.commit("CURRENT",e)},disable(t){t.commit("STATUS",!1)},enable(t){t.commit("STATUS",!0)},move(t,[e,n]){e=t.getters.id(e),n=t.getters.id(n),t.commit("MOVE",[e,n])},remove(t,e){t.commit("REMOVE",e),t.getters.isCurrent(e)&&t.commit("CURRENT",null)},revert(t,e){e=e||t.state.current,t.commit("REVERT",e)},async save(t,e){if(e=e||t.state.current,t.getters.isCurrent(e)&&!1===t.state.status.enabled)return!1;t.dispatch("disable");const n=t.getters.model(e),i=a(a({},n.originals),n.changes);try{await u.$api.patch(n.api,i),t.commit("CREATE",[e,l(a({},n),{originals:i})]),t.dispatch("revert",e)}finally{t.dispatch("enable")}},update(t,[e,n,i]){i=i||t.state.current,t.commit("UPDATE",[i,e,n])}}},at={namespaced:!0,state:{open:[]},mutations:{CLOSE(t,e){t.open=e?t.open.filter((t=>t.id!==e)):[]},GOTO(t,e){t.open=t.open.slice(0,t.open.findIndex((t=>t.id===e))+1)},OPEN(t,e){t.open.push(e)}},actions:{close(t,e){t.commit("CLOSE",e)},goto(t,e){t.commit("GOTO",e)},open(t,e){t.commit("OPEN",e)}}},lt={timer:null,namespaced:!0,state:{type:null,message:null,details:null,timeout:null},mutations:{SET(t,e){t.type=e.type,t.message=e.message,t.details=e.details,t.timeout=e.timeout},UNSET(t){t.type=null,t.message=null,t.details=null,t.timeout=null}},actions:{close(t){clearTimeout(this.timer),t.commit("UNSET")},deprecated(t,e){console.warn("Deprecated: "+e)},error(t,e){let n=e;"string"==typeof e&&(n={message:e}),e instanceof Error&&(n={message:e.message},window.panel.$config.debug&&window.console.error(e)),t.dispatch("dialog",{component:"k-error-dialog",props:n},{root:!0}),t.dispatch("close")},open(t,e){t.dispatch("close"),t.commit("SET",e),e.timeout&&(this.timer=setTimeout((()=>{t.dispatch("close")}),e.timeout))},success(t,e){"string"==typeof e&&(e={message:e}),t.dispatch("open",a({type:"success",timeout:4e3},e))}}};u.use(c);var ut=new c.Store({strict:!1,state:{dialog:null,drag:null,fatal:!1,isLoading:!1},mutations:{SET_DIALOG(t,e){t.dialog=e},SET_DRAG(t,e){t.drag=e},SET_FATAL(t,e){t.fatal=e},SET_LOADING(t,e){t.isLoading=e}},actions:{dialog(t,e){t.commit("SET_DIALOG",e)},drag(t,e){t.commit("SET_DRAG",e)},fatal(t,e){!1!==e?(console.error("The JSON response could not be parsed"),window.panel.$config.debug&&console.info(e.html),e.silent||t.commit("SET_FATAL",e.html)):t.commit("SET_FATAL",!1)},isLoading(t,e){t.commit("SET_LOADING",!0===e)},navigate(t){t.dispatch("dialog",null),t.dispatch("drawers/close")}},modules:{content:rt,drawers:at,notification:lt}}),ct={install(t){window.panel=window.panel||{},window.onunhandledrejection=t=>{t.preventDefault(),ut.dispatch("notification/error",t.reason)},window.panel.deprecated=t=>{ut.dispatch("notification/deprecated",t)},window.panel.error=t.config.errorHandler=t=>{ut.dispatch("notification/error",t)}}},dt={install(t){const e=d(),n={$on:e.on,$off:e.off,$emit:e.emit,click(t){n.$emit("click",t)},copy(t){n.$emit("copy",t)},dragenter(t){n.entered=t.target,n.prevent(t),n.$emit("dragenter",t)},dragleave(t){n.prevent(t),n.entered===t.target&&n.$emit("dragleave",t)},drop(t){n.prevent(t),n.$emit("drop",t)},entered:null,focus(t){n.$emit("focus",t)},keydown(e){let i=["keydown"];(e.metaKey||e.ctrlKey)&&i.push("cmd"),!0===e.altKey&&i.push("alt"),!0===e.shiftKey&&i.push("shift");let s=t.prototype.$helper.string.lcfirst(e.key);const o={escape:"esc",arrowUp:"up",arrowDown:"down",arrowLeft:"left",arrowRight:"right"};o[s]&&(s=o[s]),!1===["alt","control","shift","meta"].includes(s)&&i.push(s),n.$emit(i.join("."),e),n.$emit("keydown",e)},keyup(t){n.$emit("keyup",t)},online(t){n.$emit("online",t)},offline(t){n.$emit("offline",t)},paste(t){n.$emit("paste",t)},prevent(t){t.stopPropagation(),t.preventDefault()}};window.addEventListener("online",n.online),window.addEventListener("offline",n.offline),window.addEventListener("dragenter",n.dragenter,!1),window.addEventListener("dragover",n.prevent,!1),window.addEventListener("dragexit",n.prevent,!1),window.addEventListener("dragleave",n.dragleave,!1),window.addEventListener("drop",n.drop,!1),window.addEventListener("keydown",n.keydown,!1),window.addEventListener("keyup",n.keyup,!1),document.addEventListener("click",n.click,!1),document.addEventListener("copy",n.copy,!0),document.addEventListener("focus",n.focus,!0),document.addEventListener("paste",n.paste,!0),t.prototype.$events=n}};class pt{constructor(t={}){this.options=a({base:"/",headers:()=>({}),onFatal:()=>{},onFinish:()=>{},onPushState:()=>{},onReplaceState:()=>{},onStart:()=>{},onSwap:()=>{},query:()=>({})},t),this.state={}}init(t={},e={}){this.options=a(a({},this.options),e),this.setState(t)}arrayToString(t){return!1===Array.isArray(t)?String(t):t.join(",")}body(t){return"object"==typeof t?JSON.stringify(t):t}async fetch(t,e){return fetch(t,e)}async go(t,e){try{const n=await this.request(t,e);return!1!==n&&this.setState(n,e)}catch(n){if(!0!==(null==e?void 0:e.silent))throw n}}query(t={},e={}){let n=new URLSearchParams(e);return"object"!=typeof t&&(t={}),Object.entries(t).forEach((([t,e])=>{null!==e&&n.set(t,e)})),Object.entries(this.options.query()).forEach((([t,e])=>{var i,s;null!==(e=null!=(s=null!=(i=n.get(t))?i:e)?s:null)&&n.set(t,e)})),n}redirect(t){window.location.href=t}reload(t={}){return this.go(window.location.href,l(a({},t),{replace:!0}))}async request(t="",e={}){var n;const i=!!(e=a({globals:!1,method:"GET",only:[],query:{},silent:!1,type:"$view"},e)).globals&&this.arrayToString(e.globals),s=this.arrayToString(e.only);this.options.onStart(e);try{const r=this.url(t,e.query);if(new URL(r).origin!==location.origin)return this.redirect(r),!1;const u=await this.fetch(r,{method:e.method,body:this.body(e.body),credentials:"same-origin",cache:"no-store",headers:a(l(a({},this.options.headers()),{"X-Fiber":!0,"X-Fiber-Globals":i,"X-Fiber-Only":s,"X-Fiber-Referrer":(null==(n=this.state.$view)?void 0:n.path)||null}),e.headers)});if(!1===u.headers.has("X-Fiber"))return this.redirect(u.url),!1;const c=await u.text();let d;try{d=JSON.parse(c)}catch(o){return this.options.onFatal({url:r,path:t,options:e,response:u,text:c}),!1}if(!d[e.type])throw Error(`The ${e.type} could not be loaded`);const p=d[e.type];if(p.error)throw Error(p.error);return"$view"===e.type?s.length?it(this.state,d):d:p}finally{this.options.onFinish(e)}}async setState(t,e={}){return"object"==typeof t&&(this.state=nt(t),!0===e.replace||this.url(this.state.$url).href===window.location.href?this.options.onReplaceState(this.state,e):this.options.onPushState(this.state,e),this.options.onSwap(this.state,e),this.state)}url(t="",e={}){return(t="string"==typeof t&&null===t.match(/^https?:\/\//)?new URL(this.options.base+t.replace(/^\//,"")):new URL(t)).search=this.query(e,t.search),t}}const ht=async function(t){return a({cancel:null,submit:null,props:{}},t)},ft=async function(t,e={}){let n=null,i=null;"function"==typeof e?(n=e,e={}):(n=e.submit,i=e.cancel);let s=await this.$fiber.request("dialogs/"+t,l(a({},e),{type:"$dialog"}));return"object"==typeof s&&(s.submit=n||null,s.cancel=i||null,s)};async function mt(t,e={}){let n=null;if(n="object"==typeof t?await ht.call(this,t):await ft.call(this,t,e),!n)return!1;if(!n.component||!1===this.$helper.isComponent(n.component))throw Error("The dialog component does not exist");return n.props=n.props||{},this.$store.dispatch("dialog",n),n}function gt(t,e={}){return async n=>{const i=await this.$fiber.request("dropdowns/"+t,l(a({},e),{type:"$dropdown"}));if(!i)return!1;if(!1===Array.isArray(i.options)||0===i.options.length)throw Error("The dropdown is empty");i.options.map((t=>(t.dialog&&(t.click=()=>{const e="string"==typeof t.dialog?t.dialog:t.dialog.url,n="object"==typeof t.dialog?t.dialog:{};return this.$dialog(e,n)}),t))),n(i.options)}}async function kt(t,e,n={}){return await this.$fiber.request("search/"+t,a({query:{query:e},type:"$search"},n))}var vt={install(t){const e=new pt;t.prototype.$fiber=window.panel.$fiber=e,t.prototype.$dialog=window.panel.$dialog=mt,t.prototype.$dropdown=window.panel.$dropdown=gt,t.prototype.$go=window.panel.$go=e.go.bind(e),t.prototype.$reload=window.panel.$reload=e.reload.bind(e),t.prototype.$request=window.panel.$request=e.request.bind(e),t.prototype.$search=window.panel.$search=kt,t.prototype.$url=window.panel.$url=e.url.bind(e)}};var bt={read:function(t){if(!t)return null;if("string"==typeof t)return t;if(t instanceof ClipboardEvent){t.preventDefault();const e=t.clipboardData.getData("text/html")||t.clipboardData.getData("text/plain")||null;if(e)return e.replace(/\u00a0/g," ")}return null},write:function(t,e){if("string"!=typeof t&&(t=JSON.stringify(t,null,2)),e&&e instanceof ClipboardEvent)return e.preventDefault(),e.clipboardData.setData("text/plain",t),!0;const n=document.createElement("textarea");if(n.value=t,document.body.append(n),navigator.userAgent.match(/ipad|ipod|iphone/i)){n.contentEditable=!0,n.readOnly=!0;const t=document.createRange();t.selectNodeContents(n);const e=window.getSelection();e.removeAllRanges(),e.addRange(t),n.setSelectionRange(0,999999)}else n.select();return document.execCommand("copy"),n.remove(),!0}};function yt(t){if("string"==typeof t){if("pattern"===(t=t.toLowerCase()))return"var(--color-gray-800) var(--bg-pattern)";if(!1===t.startsWith("#")&&!1===t.startsWith("var(")){const e="--color-"+t;if(window.getComputedStyle(document.documentElement).getPropertyValue(e))return`var(${e})`}return t}}var $t=(t,e)=>{let n=null;return function(){clearTimeout(n),n=setTimeout((()=>t.apply(this,arguments)),e)}};function _t(t,e=!1){if(!t.match("youtu"))return!1;let n=null;try{n=new URL(t)}catch(d){return!1}const i=n.pathname.split("/").filter((t=>""!==t)),s=i[0],o=i[1],r="https://"+(!0===e?"www.youtube-nocookie.com":n.host)+"/embed",a=t=>!!t&&null!==t.match(/^[a-zA-Z0-9_-]+$/);let l=n.searchParams,u=null;switch(i.join("/")){case"embed/videoseries":case"playlist":a(l.get("list"))&&(u=r+"/videoseries");break;case"watch":a(l.get("v"))&&(u=r+"/"+l.get("v"),l.has("t")&&l.set("start",l.get("t")),l.delete("v"),l.delete("t"));break;default:n.host.includes("youtu.be")&&a(s)?(u="https://www.youtube.com/embed/"+s,l.has("t")&&l.set("start",l.get("t")),l.delete("t")):"embed"===s&&a(o)&&(u=r+"/"+o)}if(!u)return!1;const c=l.toString();return c.length&&(u+="?"+c),u}function xt(t,e=!1){let n=null;try{n=new URL(t)}catch(l){return!1}const i=n.pathname.split("/").filter((t=>""!==t));let s=n.searchParams,o=null;switch(!0===e&&s.append("dnt",1),n.host){case"vimeo.com":case"www.vimeo.com":o=i[0];break;case"player.vimeo.com":o=i[1]}if(!o||!o.match(/^[0-9]*$/))return!1;let r="https://player.vimeo.com/video/"+o;const a=s.toString();return a.length&&(r+="?"+a),r}var wt={youtube:_t,vimeo:xt,video:function(t,e=!1){return t.includes("youtu")?_t(t,e):!!t.includes("vimeo")&&xt(t,e)}},St=t=>void 0!==u.options.components[t],Ct=t=>!!t.dataTransfer&&(!!t.dataTransfer.types&&(!0===t.dataTransfer.types.includes("Files")&&!1===t.dataTransfer.types.includes("text/plain")));var Ot={metaKey:function(){return window.navigator.userAgent.indexOf("Mac")>-1?"cmd":"ctrl"}},Et=(t="3/2",e="100%",n=!0)=>{const i=String(t).split("/");if(2!==i.length)return e;const s=Number(i[0]),o=Number(i[1]);let r=100;return 0!==s&&0!==o&&(r=n?r/s*o:r/o*s,r=parseFloat(String(r)).toFixed(2)),r+"%"},At=t=>{var e=(t=t||{}).desc?-1:1,n=-e,i=/^0/,s=/\s+/g,o=/^\s+|\s+$/g,r=/[^\x00-\x80]/,a=/^0x[0-9a-f]+$/i,l=/(0x[\da-fA-F]+|(^[\+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|\d+)/g,u=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=t.insensitive?function(t){return function(t){if(t.toLocaleLowerCase)return t.toLocaleLowerCase();return t.toLowerCase()}(""+t).replace(o,"")}:function(t){return(""+t).replace(o,"")};function d(t){return t.replace(l,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")}function p(t,e){return(!t.match(i)||1===e)&&parseFloat(t)||t.replace(s," ").replace(o,"")||0}return function(t,i){var s=c(t),o=c(i);if(!s&&!o)return 0;if(!s&&o)return n;if(s&&!o)return e;var l=d(s),h=d(o),f=parseInt(s.match(a),16)||1!==l.length&&Date.parse(s),m=parseInt(o.match(a),16)||f&&o.match(u)&&Date.parse(o)||null;if(m){if(fm)return e}for(var g=l.length,k=h.length,v=0,b=Math.max(g,k);v0)return e;if(_<0)return n;if(v===b-1)return 0}else{if(y<$)return n;if(y>$)return e}}return 0}};function Tt(t){const e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(t).replace(/[&<>"'`=/]/g,(t=>e[t]))}function It(t,e={}){const n=(t,e={})=>{var i;const s=Tt(t.shift()),o=null!=(i=e[s])?i:null;return null===o?Object.prototype.hasOwnProperty.call(e,s)||"…":0===t.length?o:n(t,o)},i="[{]{1,2}[\\s]?",s="[\\s]?[}]{1,2}";return(t=t.replace(new RegExp(`${i}(.*?)${s}`,"gi"),((t,i)=>n(i.split("."),e)))).replace(new RegExp(`${i}.*${s}`,"gi"),"…")}function Mt(t){const e=String(t);return e.charAt(0).toUpperCase()+e.slice(1)}RegExp.escape=function(t){return t.replace(new RegExp("[-/\\\\^$*+?.()[\\]{}]","gu"),"\\$&")};var Lt={camelToKebab:function(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()},escapeHTML:Tt,hasEmoji:function(t){if("string"!=typeof t)return!1;const e=t.match(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c\ude32-\ude3a]|[\ud83c\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/i);return null!==e&&null!==e.length},lcfirst:function(t){const e=String(t);return e.charAt(0).toLowerCase()+e.slice(1)},pad:function(t,e=2){t=String(t);let n="";for(;n.length]+)>)/gi,"")},template:It,ucfirst:Mt,ucwords:function(t){return String(t).split(/ /g).map((t=>Mt(t))).join(" ")},uuid:function(){let t,e,n="";for(t=0;t<32;t++)e=16*Math.random()|0,8!=t&&12!=t&&16!=t&&20!=t||(n+="-"),n+=(12==t?4:16==t?3&e|8:e).toString(16);return n}},jt=(t,e)=>{const n=Object.assign({url:"/",field:"file",method:"POST",attributes:{},complete:function(){},error:function(){},success:function(){},progress:function(){}},e),i=new FormData;i.append(n.field,t,t.name),n.attributes&&Object.keys(n.attributes).forEach((t=>{i.append(t,n.attributes[t])}));const s=new XMLHttpRequest,o=e=>{if(!e.lengthComputable||!n.progress)return;let i=Math.max(0,Math.min(100,e.loaded/e.total*100));n.progress(s,t,Math.ceil(i))};s.upload.addEventListener("loadstart",o),s.upload.addEventListener("progress",o),s.addEventListener("load",(e=>{let i=null;try{i=JSON.parse(e.target.response)}catch(o){i={status:"error",message:"The file could not be uploaded"}}"error"===i.status?n.error(s,t,i):(n.success(s,t,i),n.progress(s,t,100))})),s.addEventListener("error",(e=>{const i=JSON.parse(e.target.response);n.error(s,t,i),n.progress(s,t,100)})),s.open(n.method,n.url,!0),n.headers&&Object.keys(n.headers).forEach((t=>{const e=n.headers[t];s.setRequestHeader(t,e)})),s.send(i)},Dt={install(t){Array.prototype.sortBy=function(e){const n=t.prototype.$helper.sort(),i=e.split(" "),s=i[0],o=i[1]||"asc";return this.sort(((t,e)=>{const i=String(t[s]).toLowerCase(),r=String(e[s]).toLowerCase();return"desc"===o?n(r,i):n(i,r)}))},t.prototype.$helper={clipboard:bt,clone:st.clone,color:yt,embed:wt,isComponent:St,isUploadEvent:Ct,debounce:$t,keyboard:Ot,object:st,pad:Lt.pad,ratio:Et,slug:Lt.slug,sort:At,string:Lt,upload:jt,uuid:Lt.uuid},t.prototype.$esc=Lt.escapeHTML}},Bt={install(t){t.$t=t.prototype.$t=window.panel.$t=(t,e,n=null)=>{if("string"!=typeof t)return;const i=window.panel.$translation.data[t]||n;return"string"!=typeof i?i:It(i,e)},t.directive("direction",{inserted(t,e,n){!0!==n.context.disabled?t.dir=n.context.$direction:t.dir=null}})}};p.extend(h),p.extend(((t,e,n)=>{n.interpret=(t,e="date")=>{const i={date:{"YYYY-MM-DD":!0,"YYYY-MM-D":!0,"YYYY-MM-":!0,"YYYY-MM":!0,"YYYY-M-DD":!0,"YYYY-M-D":!0,"YYYY-M-":!0,"YYYY-M":!0,"YYYY-":!0,YYYYMMDD:!0,"MMM DD YYYY":!1,"MMM D YYYY":!1,"MMM DD YY":!1,"MMM D YY":!1,"MMM DD":!1,"MMM D":!1,"DD MMMM YYYY":!1,"DD MMMM YY":!1,"DD MMMM":!1,"D MMMM YYYY":!1,"D MMMM YY":!1,"D MMMM":!1,"DD MMM YYYY":!1,"D MMM YYYY":!1,"DD MMM YY":!1,"D MMM YY":!1,"DD MMM":!1,"D MMM":!1,"DD MM YYYY":!1,"DD M YYYY":!1,"D MM YYYY":!1,"D M YYYY":!1,"DD MM YY":!1,"D MM YY":!1,"DD M YY":!1,"D M YY":!1,YYYY:!0,MMMM:!0,MMM:!0,"DD MM":!1,"DD M":!1,"D MM":!1,"D M":!1,DD:!1,D:!1},time:{"HH:mm:ss a":!1,"HH:mm:ss":!1,"HH:mm a":!1,"HH:mm":!1,"HH a":!1,HH:!1}};if("string"==typeof t&&""!==t)for(const s in i[e]){const o=n(t,s,i[e][s]);if(!0===o.isValid())return o}return null}})),p.extend(((t,e,n)=>{const i=t=>"date"===t?"YYYY-MM-DD":"time"===t?"HH:mm:ss":"YYYY-MM-DD HH:mm:ss";e.prototype.toISO=function(t="datetime"){return this.format(i(t))},n.iso=function(t,e="datetime"){const s=n(t,i(e));return s&&s.isValid()?s:null}})),p.extend(((t,e)=>{e.prototype.merge=function(t,e="date"){let n=this.clone();if(!t||!t.isValid())return this;if("string"==typeof e){const t={date:["year","month","date"],time:["hour","minute","second"]};if(!1===Object.prototype.hasOwnProperty.call(t,e))throw new Error("Invalid merge unit alias");e=t[e]}for(const i of e)n=n.set(i,t.get(i));return n}})),p.extend(((t,e,n)=>{n.pattern=t=>new class{constructor(t,e){this.dayjs=t,this.pattern=e;const n={year:["YY","YYYY"],month:["M","MM","MMM","MMMM"],day:["D","DD"],hour:["h","hh","H","HH"],minute:["m","mm"],second:["s","ss"],meridiem:["a"]};this.parts=this.pattern.split(/\W/).map(((t,e)=>{const i=this.pattern.indexOf(t);return{index:e,unit:Object.keys(n)[Object.values(n).findIndex((e=>e.includes(t)))],start:i,end:i+(t.length-1)}}))}at(t,e=t){const n=this.parts.filter((n=>n.start<=t&&n.end>=e-1));return n[0]?n[0]:this.parts.filter((e=>e.start<=t)).pop()}format(t){return t&&t.isValid()?t.format(this.pattern):null}}(n,t)})),p.extend(((t,e)=>{e.prototype.round=function(t="date",e=1){const n=["second","minute","hour","date","month","year"];if("day"===t&&(t="date"),!1===n.includes(t))throw new Error("Invalid rounding unit");if(["date","month","year"].includes(t)&&1!==e||"hour"===t&&24%e!=0||["second","minute"].includes(t)&&60%e!=0)throw"Invalid rounding size for "+t;let i=this.clone();const s=n.indexOf(t),o=n.slice(0,s),r=o.pop();if(o.forEach((t=>i=i.startOf(t))),r){const e={month:12,date:i.daysInMonth(),hour:24,minute:60,second:60}[r];Math.round(i.get(r)/e)*e===e&&(i=i.add(1,"date"===t?"day":t)),i=i.startOf(t)}return i=i.set(t,Math.round(i.get(t)/e)*e),i}})),p.extend(((t,e,n)=>{e.prototype.validate=function(t,e,i="day"){if(!this.isValid())return!1;if(!t)return!0;t=n.iso(t);const s={min:"isAfter",max:"isBefore"}[e];return this.isSame(t,i)||this[s](t,i)}}));var Pt={install(t){t.prototype.$library={autosize:f,dayjs:p}}},Nt={props:{blueprint:String,lock:[Boolean,Object],help:String,name:String,parent:String,timestamp:Number},methods:{load(){return this.$api.get(this.parent+"/sections/"+this.name)}}},qt={install(t){const e=a({},t.options.components),n={section:Nt};for(const[i,s]of Object.entries(window.panel.plugins.components))s.template||s.render||s.extends?("string"==typeof(null==s?void 0:s.extends)&&(e[s.extends]?s.extends=e[s.extends].extend({options:s,components:a(a({},e),s.components||{})}):s.extends=null),s.template&&(s.render=null),s.mixins&&(s.mixins=s.mixins.map((t=>"string"==typeof t?n[t]:t))),e[i]&&window.console.warn(`Plugin is replacing "${i}"`),t.component(i,s),e[i]=t.options.components[i]):ut.dispatch("notification/error",`Neither template or render method provided nor extending a component when loading plugin component "${i}". The component has not been registered.`);for(const i of window.panel.plugins.use)t.use(i)}};function Ft(t,e,n,i,s,o,r,a){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),i&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),r?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},u._ssrRegister=l):s&&(l=a?function(){s.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,l):[l]}return{exports:t,options:u}}const Rt={props:{autofocus:{type:Boolean,default:!0},cancelButton:{type:[String,Boolean],default:!0},icon:{type:String,default:"check"},size:{type:String,default:"default"},submitButton:{type:[String,Boolean],default:!0},theme:String,visible:Boolean},data:()=>({notification:null}),computed:{buttons(){let t=[];return this.cancelButton&&t.push({icon:"cancel",text:this.cancelButtonLabel,class:"k-dialog-button-cancel",click:this.cancel}),this.submitButtonConfig&&t.push({icon:this.icon,text:this.submitButtonLabel,theme:this.theme,class:"k-dialog-button-submit",click:this.submit}),t},cancelButtonLabel(){return!1!==this.cancelButton&&(!0===this.cancelButton||0===this.cancelButton.length?this.$t("cancel"):this.cancelButton)},submitButtonConfig(){return void 0!==this.$attrs.button?this.$attrs.button:void 0===this.submitButton||this.submitButton},submitButtonLabel(){return!0===this.submitButton||0===this.submitButton.length?this.$t("confirm"):this.submitButton}},created(){this.$events.$on("keydown.esc",this.close,!1)},destroyed(){this.$events.$off("keydown.esc",this.close,!1)},mounted(){this.visible&&this.$nextTick(this.open)},methods:{onOverlayClose(){this.notification=null,this.$emit("close"),this.$events.$off("keydown.esc",this.close),this.$store.dispatch("dialog",!1)},open(){this.$store.state.dialog||this.$store.dispatch("dialog",!0),this.notification=null,this.$refs.overlay.open(),this.$emit("open"),this.$events.$on("keydown.esc",this.close)},close(){this.$refs.overlay&&this.$refs.overlay.close()},cancel(){this.$emit("cancel"),this.close()},focus(){var t;if(null==(t=this.$refs.dialog)?void 0:t.querySelector){const t=this.$refs.dialog.querySelector(".k-dialog-button-cancel");"function"==typeof(null==t?void 0:t.focus)&&t.focus()}},error(t){this.notification={message:t,type:"error"}},submit(){this.$emit("submit")},success(t){this.notification={message:t,type:"success"}}}},zt={};var Yt=Ft(Rt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-overlay",{ref:"overlay",attrs:{autofocus:t.autofocus,centered:!0},on:{close:t.onOverlayClose,ready:function(e){return t.$emit("ready")}}},[n("div",{ref:"dialog",staticClass:"k-dialog",class:t.$vnode.data.staticClass,attrs:{"data-size":t.size},on:{mousedown:function(t){t.stopPropagation()}}},[t.notification?n("div",{staticClass:"k-dialog-notification",attrs:{"data-theme":t.notification.type}},[n("p",[t._v(t._s(t.notification.message))]),n("k-button",{attrs:{icon:"cancel"},on:{click:function(e){t.notification=null}}})],1):t._e(),n("div",{staticClass:"k-dialog-body scroll-y-auto"},[t._t("default")],2),t.$slots.footer||t.buttons.length?n("footer",{staticClass:"k-dialog-footer"},[t._t("footer",(function(){return[n("k-button-group",{attrs:{buttons:t.buttons}})]}))],2):t._e()])])}),[],!1,Ht,null,null,null);function Ht(t){for(let e in zt)this[e]=zt[e]}var Ut=function(){return Yt.exports}(),Kt={props:{autofocus:{type:Boolean,default:!0},cancelButton:{type:[String,Boolean],default:!0},icon:String,submitButton:{type:[String,Boolean],default:!0},size:String,theme:String,visible:Boolean},methods:{close(){this.$refs.dialog.close(),this.$emit("close")},error(t){this.$refs.dialog.error(t)},open(){this.$refs.dialog.open(),this.$emit("open")},success(t){this.$refs.dialog.close(),t.route&&this.$go(t.route),t.message&&this.$store.dispatch("notification/success",t.message),t.event&&("string"==typeof t.event&&(t.event=[t.event]),t.event.forEach((e=>{this.$events.$emit(e,t)}))),!1!==Object.prototype.hasOwnProperty.call(t,"emit")&&!1===t.emit||this.$emit("success")}}};const Jt={};var Gt=Ft({mixins:[Kt],props:{details:[Object,Array],message:String,size:{type:String,default:"medium"}},computed:{detailsList(){return Array.isArray(this.details)?this.details:Object.values(this.details||{})}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-dialog",{ref:"dialog",staticClass:"k-error-dialog",attrs:{"cancel-button":!1,size:t.size,visible:!0},on:{cancel:function(e){return t.$emit("cancel")},close:function(e){return t.$emit("close")},submit:function(e){return t.$refs.dialog.close()}}},[n("k-text",[t._v(t._s(t.message))]),t.detailsList.length?n("dl",{staticClass:"k-error-details"},[t._l(t.detailsList,(function(e,i){return[n("dt",{key:"detail-label-"+i},[t._v(" "+t._s(e.label)+" ")]),n("dd",{key:"detail-message-"+i},["object"==typeof e.message?[n("ul",t._l(e.message,(function(e,i){return n("li",{key:i},[t._v(" "+t._s(e)+" ")])})),0)]:[t._v(" "+t._s(e.message)+" ")]],2)]}))],2):t._e()],1)}),[],!1,Vt,null,null,null);function Vt(t){for(let e in Jt)this[e]=Jt[e]}var Wt=function(){return Gt.exports}();const Xt={};var Zt=Ft({props:{code:Number,component:String,path:String,props:Object,referrer:String},methods:{close(){this.$refs.dialog.close()},onCancel(){"function"==typeof this.$store.state.dialog.cancel&&this.$store.state.dialog.cancel({dialog:this})},async onSubmit(t){let e=null;try{if("function"==typeof this.$store.state.dialog.submit)e=await this.$store.state.dialog.submit({dialog:this,value:t});else{if(!this.path)throw"The dialog needs a submit action or a dialog route path to be submitted";e=await this.$request(this.path,{body:t,method:"POST",type:"$dialog",headers:{"X-Fiber-Referrer":this.referrer}})}if(!1===e)return!1;this.close(),this.$store.dispatch("notification/success",":)"),e.event&&("string"==typeof e.event&&(e.event=[e.event]),e.event.forEach((t=>{this.$events.$emit(t,e)}))),e.dispatch&&Object.keys(e.dispatch).forEach((t=>{const n=e.dispatch[t];this.$store.dispatch(t,!0===Array.isArray(n)?[...n]:n)})),e.redirect?this.$go(e.redirect):this.$reload(e.reload||{})}catch(n){this.$refs.dialog.error(n)}}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)(t.component,t._b({ref:"dialog",tag:"component",attrs:{visible:!0},on:{cancel:t.onCancel,submit:t.onSubmit}},"component",t.props,!1))}),[],!1,Qt,null,null,null);function Qt(t){for(let e in Xt)this[e]=Xt[e]}var te=function(){return Zt.exports}(),ee={data:()=>({models:[],issue:null,selected:{},options:{endpoint:null,max:null,multiple:!0,parent:null,selected:[],search:!0},search:null,pagination:{limit:20,page:1,total:0}}),computed:{checkedIcon(){return!0===this.multiple?"check":"circle-filled"},collection(){return{empty:this.emptyProps,items:this.items,link:!1,layout:"list",pagination:a({details:!0,dropdown:!1,align:"center"},this.pagination),sortable:!1}},items(){return this.models.map(this.item)},multiple(){return!0===this.options.multiple&&1!==this.options.max}},watch:{search(){this.updateSearch()}},created(){this.updateSearch=$t(this.updateSearch,200)},methods:{async fetch(){const t=a({page:this.pagination.page,search:this.search},this.fetchData||{});try{const e=await this.$api.get(this.options.endpoint,t);this.models=e.data,this.pagination=e.pagination,this.onFetched&&this.onFetched(e)}catch(e){this.models=[],this.issue=e.message}},async open(t,e){this.pagination.page=0,this.search=null;let n=!0;Array.isArray(t)?(this.models=t,n=!1):(this.models=[],e=t),this.options=a(a({},this.options),e),this.selected={},this.options.selected.forEach((t=>{this.$set(this.selected,t,{id:t})})),n&&await this.fetch(),this.$refs.dialog.open()},paginate(t){this.pagination.page=t.page,this.pagination.limit=t.limit,this.fetch()},submit(){this.$emit("submit",Object.values(this.selected)),this.$refs.dialog.close()},isSelected(t){return void 0!==this.selected[t.id]},item:t=>t,toggle(t){!1!==this.options.multiple&&1!==this.options.max||(this.selected={}),!0!==this.isSelected(t)?this.options.max&&this.options.max<=Object.keys(this.selected).length||this.$set(this.selected,t.id,t):this.$delete(this.selected,t.id)},toggleBtn(t){const e=this.isSelected(t);return{icon:e?this.checkedIcon:"circle-outline",tooltip:e?this.$t("remove"):this.$t("select"),theme:e?"positive":null}},updateSearch(){this.pagination.page=0,this.fetch()}}};const ne={};var ie=Ft({mixins:[ee],computed:{emptyProps(){return{icon:"image",text:this.$t("dialog.files.empty")}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-dialog",{ref:"dialog",staticClass:"k-files-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[n("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.options.search?n("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",type:"text",icon:"search"},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}}):t._e(),n("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function(e){var i=e.item;return[n("k-button",t._b({on:{click:function(e){return t.toggle(i)}}},"k-button",t.toggleBtn(i),!1))]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,se,null,null,null);function se(t){for(let e in ne)this[e]=ne[e]}var oe=function(){return ie.exports}();const re={mixins:[Kt],props:{fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!0},size:{type:String,default:"medium"},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("save")},text:{type:String},theme:{type:String,default:"positive"},value:{type:Object,default:()=>({})}},data(){return{model:this.value}},computed:{hasFields(){return Object.keys(this.fields).length>0}},watch:{value(t,e){t!==e&&(this.model=t)}}},ae={};var le=Ft(re,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},close:function(e){return t.$emit("close")},ready:function(e){return t.$emit("ready")},submit:function(e){return t.$refs.form.submit()}}},"k-dialog",t.$props,!1),[t.text?[n("k-text",{domProps:{innerHTML:t._s(t.text)}})]:t._e(),t.hasFields?n("k-form",{ref:"form",attrs:{value:t.model,fields:t.fields,novalidate:t.novalidate},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}}):n("k-box",{attrs:{theme:"negative"}},[t._v(" This form dialog has no fields ")])],2)}),[],!1,ue,null,null,null);function ue(t){for(let e in ae)this[e]=ae[e]}var ce=function(){return le.exports}();const de={};var pe=Ft({extends:ce,watch:{"model.name"(t){this.fields.code.disabled||this.onNameChanges(t)},"model.code"(t){this.fields.code.disabled||(this.model.code=this.$helper.slug(t,[this.$system.ascii]),this.onCodeChanges(this.model.code))}},methods:{onCodeChanges(t){if(!t)return this.model.locale=null;if(t.length>=2)if(-1!==t.indexOf("-")){let e=t.split("-"),n=[e[0],e[1].toUpperCase()];this.model.locale=n.join("_")}else{let e=this.$system.locales||[];(null==e?void 0:e[t])?this.model.locale=e[t]:this.model.locale=null}},onNameChanges(t){this.model.code=this.$helper.slug(t,[this.model.rules,this.$system.ascii]).substr(0,2)}}},undefined,undefined,!1,he,null,null,null);function he(t){for(let e in de)this[e]=de[e]}var fe=function(){return pe.exports}();const me={};var ge=Ft({mixins:[ee],data(){const t=ee.data();return l(a({},t),{model:{title:null,parent:null},options:l(a({},t.options),{parent:null})})},computed:{emptyProps(){return{icon:"page",text:this.$t("dialog.pages.empty")}},fetchData(){return{parent:this.options.parent}}},methods:{back(){this.options.parent=this.model.parent,this.pagination.page=1,this.fetch()},go(t){this.options.parent=t.id,this.pagination.page=1,this.fetch()},onFetched(t){this.model=t.model}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-dialog",{ref:"dialog",staticClass:"k-pages-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[n("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.model?n("header",{staticClass:"k-pages-dialog-navbar"},[n("k-button",{attrs:{disabled:!t.model.id,tooltip:t.$t("back"),icon:"angle-left"},on:{click:t.back}}),n("k-headline",[t._v(t._s(t.model.title))])],1):t._e(),t.options.search?n("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",type:"text",icon:"search"},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}}):t._e(),n("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function(e){var i=e.item;return[n("k-button",t._b({on:{click:function(e){return t.toggle(i)}}},"k-button",t.toggleBtn(i),!1)),i?n("k-button",{attrs:{disabled:!i.hasChildren,tooltip:t.$t("open"),icon:"angle-right"},on:{click:function(e){return e.stopPropagation(),t.go(i)}}}):t._e()]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,ke,null,null,null);function ke(t){for(let e in me)this[e]=me[e]}var ve=function(){return ge.exports}();const be={mixins:[Kt],props:{icon:{type:String,default:"trash"},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("delete")},text:String,theme:{type:String,default:"negative"}}},ye={};var $e=Ft(be,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("k-text-dialog",t._g(t._b({ref:"dialog"},"k-text-dialog",t.$props,!1),t.$listeners),[t._t("default")],2)}),[],!1,_e,null,null,null);function _e(t){for(let e in ye)this[e]=ye[e]}var xe=function(){return $e.exports}();const we={};var Se=Ft({mixins:[Kt],props:{text:String}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-dialog",t._g(t._b({ref:"dialog"},"k-dialog",t.$props,!1),t.$listeners),[t._t("default",(function(){return[t.text?n("k-text",{domProps:{innerHTML:t._s(t.text)}}):n("k-box",{attrs:{theme:"negative"}},[t._v(" This dialog does not define any text ")])]}))],2)}),[],!1,Ce,null,null,null);function Ce(t){for(let e in we)this[e]=we[e]}var Oe=function(){return Se.exports}();const Ee={};var Ae=Ft({mixins:[ee],computed:{emptyProps(){return{icon:"users",text:this.$t("dialog.users.empty")}}},methods:{item:t=>l(a({},t),{key:t.email,info:t.info!==t.text?t.info:null})}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-dialog",{ref:"dialog",staticClass:"k-users-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[n("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.options.search?n("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",type:"text",icon:"search"},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}}):t._e(),n("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function(e){var i=e.item;return[n("k-button",t._b({on:{click:function(e){return t.toggle(i)}}},"k-button",t.toggleBtn(i),!1))]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,Te,null,null,null);function Te(t){for(let e in Ee)this[e]=Ee[e]}var Ie=function(){return Ae.exports}();const Me={};var Le=Ft({inheritAttrs:!1,props:{id:String,icon:String,tab:String,tabs:Object,title:String},data:()=>({click:!1}),computed:{breadcrumb(){return this.$store.state.drawers.open},hasTabs(){return this.tabs&&Object.keys(this.tabs).length>1},index(){return this.breadcrumb.findIndex((t=>t.id===this._uid))},nested(){return this.index>0}},watch:{index(){-1===this.index&&this.close()}},destroyed(){this.$store.dispatch("drawers/close",this._uid)},methods:{close(){this.$refs.overlay.close()},goTo(t){if(t===this._uid)return!0;this.$store.dispatch("drawers/goto",t)},mouseup(){!0===this.click&&this.close(),this.click=!1},mousedown(t=!1){this.click=t,!0===this.click&&this.$store.dispatch("drawers/close")},onClose(){this.$store.dispatch("drawers/close",this._uid),this.$emit("close")},onOpen(){this.$store.dispatch("drawers/open",{id:this._uid,icon:this.icon,title:this.title}),this.$emit("open")},open(){this.$refs.overlay.open()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-overlay",{ref:"overlay",attrs:{dimmed:!1},on:{close:t.onClose,open:t.onOpen}},[n("div",{staticClass:"k-drawer",attrs:{"data-id":t.id,"data-nested":t.nested},on:{mousedown:function(e){return e.stopPropagation(),t.mousedown(!0)},mouseup:t.mouseup}},[n("div",{staticClass:"k-drawer-box",on:{mousedown:function(e){return e.stopPropagation(),t.mousedown(!1)}}},[n("header",{staticClass:"k-drawer-header"},[1===t.breadcrumb.length?n("h2",{staticClass:"k-drawer-title"},[n("k-icon",{attrs:{type:t.icon}}),t._v(" "+t._s(t.title)+" ")],1):n("ul",{staticClass:"k-drawer-breadcrumb"},t._l(t.breadcrumb,(function(e){return n("li",{key:e.id},[n("k-button",{attrs:{icon:e.icon,text:e.title},on:{click:function(n){return t.goTo(e.id)}}})],1)})),0),t.hasTabs?n("nav",{staticClass:"k-drawer-tabs"},t._l(t.tabs,(function(e){return n("k-button",{key:e.name,staticClass:"k-drawer-tab",attrs:{current:t.tab==e.name,text:e.label},on:{click:function(n){return n.stopPropagation(),t.$emit("tab",e.name)}}})})),1):t._e(),n("nav",{staticClass:"k-drawer-options"},[t._t("options"),n("k-button",{staticClass:"k-drawer-option",attrs:{icon:"check"},on:{click:t.close}})],2)]),n("div",{staticClass:"k-drawer-body scroll-y-auto"},[t._t("default")],2)])])])}),[],!1,je,null,null,null);function je(t){for(let e in Me)this[e]=Me[e]}var De=function(){return Le.exports}(),Be=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-drawer",{ref:"drawer",staticClass:"k-form-drawer",attrs:{id:t.id,icon:t.icon,tabs:t.tabs,tab:t.tab,title:t.title},on:{close:function(e){return t.$emit("close")},open:function(e){return t.$emit("open")},tab:function(e){t.tab=e}},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0},{key:"default",fn:function(){return[0===Object.keys(t.fields).length?n("k-box",{attrs:{theme:"info"}},[t._v(" "+t._s(t.empty)+" ")]):n("k-form",{ref:"form",attrs:{autofocus:!0,fields:t.fields,value:t.$helper.clone(t.value)},on:{input:function(e){return t.$emit("input",e)}}})]},proxy:!0}],null,!0)})};const Pe={};var Ne=Ft({inheritAttrs:!1,props:{empty:{type:String,default:()=>"Missing field setup"},icon:String,id:String,tabs:Object,title:String,type:String,value:Object},data:()=>({tab:null}),computed:{fields(){const t=this.tab||null;return(this.tabs[t]||this.firstTab).fields||{}},firstTab(){return Object.values(this.tabs)[0]}},methods:{close(){this.$refs.drawer.close()},focus(t){var e;"function"==typeof(null==(e=this.$refs.form)?void 0:e.focus)&&this.$refs.form.focus(t)},open(t,e=!0){this.$refs.drawer.open(),this.tab=t||this.firstTab.name,!1!==e&&setTimeout((()=>{let t=Object.values(this.fields).filter((t=>!0===t.autofocus))[0]||null;this.focus(t)}),1)}}},Be,[],!1,qe,null,null,null);function qe(t){for(let e in Pe)this[e]=Pe[e]}var Fe=function(){return Ne.exports}();const Re={props:{html:{type:Boolean,default:!1},limit:{type:Number,default:10},skip:{type:Array,default:()=>[]},options:Array,query:String},data:()=>({matches:[],selected:{text:null}}),methods:{close(){this.$refs.dropdown.close()},onSelect(t){this.$emit("select",t),this.$refs.dropdown.close()},search(t){if(t.length<1)return;const e=new RegExp(RegExp.escape(t),"ig");this.matches=this.options.filter((t=>!!t.text&&(-1===this.skip.indexOf(t.value)&&null!==t.text.match(e)))).slice(0,this.limit),this.$emit("search",t,this.matches),this.$refs.dropdown.open()}}},ze={};var Ye=Ft(Re,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-dropdown",{staticClass:"k-autocomplete"},[t._t("default"),n("k-dropdown-content",t._g({ref:"dropdown",attrs:{autofocus:!0}},t.$listeners),t._l(t.matches,(function(e,i){return n("k-dropdown-item",t._b({key:i,on:{mousedown:function(n){return t.onSelect(e)},keydown:[function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"tab",9,n.key,"Tab")?null:(n.preventDefault(),t.onSelect(e))},function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"enter",13,n.key,"Enter")?null:(n.preventDefault(),t.onSelect(e))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:(e.preventDefault(),t.close.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:(e.preventDefault(),t.close.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:(e.preventDefault(),t.close.apply(null,arguments))}]}},"k-dropdown-item",e,!1),[n("span",{domProps:{innerHTML:t._s(t.html?e.text:t.$esc(e.text))}})])})),1),t._v(" "+t._s(t.query)+" ")],2)}),[],!1,He,null,null,null);function He(t){for(let e in ze)this[e]=ze[e]}var Ue=function(){return Ye.exports}();const Ke={props:{disabled:Boolean,max:String,min:String,value:String},data(){return this.data(this.value)},computed:{numberOfDays(){return this.toDate().daysInMonth()},firstWeekday(){const t=this.toDate().day();return t>0?t:7},weekdays(){return["mon","tue","wed","thu","fri","sat","sun"].map((t=>this.$t("days."+t)))},weeks(){const t=this.firstWeekday-1;return Math.ceil((this.numberOfDays+t)/7)},monthnames(){return["january","february","march","april","may","june","july","august","september","october","november","december"].map((t=>this.$t("months."+t)))},months(){var t=[];return this.monthnames.forEach(((e,n)=>{const i=this.toDate(1,n);t.push({value:n,text:e,disabled:i.isBefore(this.current.min,"month")||i.isAfter(this.current.max,"month")})})),t},years(){var t,e,n,i;const s=null!=(e=null==(t=this.current.min)?void 0:t.get("year"))?e:this.current.year-20,o=null!=(i=null==(n=this.current.max)?void 0:n.get("year"))?i:this.current.year+20;return this.toOptions(s,o)}},watch:{value(t){const e=this.data(t);this.dt=e.dt,this.current=e.current}},methods:{data(t){const e=this.$library.dayjs.iso(t),n=this.$library.dayjs();return{dt:e,current:{month:(null!=e?e:n).month(),year:(null!=e?e:n).year(),min:this.$library.dayjs.iso(this.min),max:this.$library.dayjs.iso(this.max)}}},days(t){let e=[];const n=7*(t-1)+1,i=n+7;for(let s=n;sthis.numberOfDays;e.push(n?"":t)}return e},isDisabled(t){const e=this.toDate(t);return this.disabled||e.isBefore(this.current.min,"day")||e.isAfter(this.current.max,"day")},isSelected(t){return this.toDate(t).isSame(this.dt,"day")},isToday(t){const e=this.$library.dayjs();return this.toDate(t).isSame(e,"day")},onInput(){var t;this.$emit("input",(null==(t=this.dt)?void 0:t.toISO("date"))||null)},onNext(){const t=this.toDate().add(1,"month");this.show(t)},onPrev(){const t=this.toDate().subtract(1,"month");this.show(t)},select(t){const e="today"===t?this.$library.dayjs().merge(this.toDate(),"time"):this.toDate(t);this.dt=e,this.show(e),this.onInput()},show(t){this.current.year=t.year(),this.current.month=t.month()},toDate(t=1,e=this.current.month){return this.$library.dayjs(`${this.current.year}-${e+1}-${t}`)},toOptions(t,e){for(var n=[],i=t;i<=e;i++)n.push({value:i,text:this.$helper.pad(i)});return n}}},Je={};var Ge=Ft(Ke,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-calendar-input"},[n("nav",[n("k-button",{attrs:{icon:"angle-left"},on:{click:t.onPrev}}),n("span",{staticClass:"k-calendar-selects"},[n("k-select-input",{attrs:{options:t.months,disabled:t.disabled,required:!0},model:{value:t.current.month,callback:function(e){t.$set(t.current,"month",t._n(e))},expression:"current.month"}}),n("k-select-input",{attrs:{options:t.years,disabled:t.disabled,required:!0},model:{value:t.current.year,callback:function(e){t.$set(t.current,"year",t._n(e))},expression:"current.year"}})],1),n("k-button",{attrs:{icon:"angle-right"},on:{click:t.onNext}})],1),n("table",{staticClass:"k-calendar-table"},[n("thead",[n("tr",t._l(t.weekdays,(function(e){return n("th",{key:"weekday_"+e},[t._v(" "+t._s(e)+" ")])})),0)]),n("tbody",t._l(t.weeks,(function(e){return n("tr",{key:"week_"+e},t._l(t.days(e),(function(e,i){return n("td",{key:"day_"+i,staticClass:"k-calendar-day",attrs:{"aria-current":!!t.isToday(e)&&"date","aria-selected":!!t.isSelected(e)&&"date"}},[e?n("k-button",{attrs:{disabled:t.isDisabled(e),text:e},on:{click:function(n){return t.select(e)}}}):t._e()],1)})),0)})),0),n("tfoot",[n("tr",[n("td",{staticClass:"k-calendar-today",attrs:{colspan:"7"}},[n("k-button",{attrs:{text:t.$t("today")},on:{click:function(e){return t.select("today")}}})],1)])])])])}),[],!1,Ve,null,null,null);function Ve(t){for(let e in Je)this[e]=Je[e]}var We=function(){return Ge.exports}();const Xe={props:{count:Number,min:Number,max:Number,required:{type:Boolean,default:!1}},computed:{valid(){return!1===this.required&&0===this.count||(!0!==this.required||0!==this.count)&&(!(this.min&&this.countthis.max))}}},Ze={};var Qe=Ft(Xe,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{staticClass:"k-counter",attrs:{"data-invalid":!t.valid}},[n("span",[t._v(t._s(t.count))]),t.min&&t.max?n("span",{staticClass:"k-counter-rules"},[t._v("("+t._s(t.min)+"–"+t._s(t.max)+")")]):t.min?n("span",{staticClass:"k-counter-rules"},[t._v("≥ "+t._s(t.min))]):t.max?n("span",{staticClass:"k-counter-rules"},[t._v("≤ "+t._s(t.max))]):t._e()])}),[],!1,tn,null,null,null);function tn(t){for(let e in Ze)this[e]=Ze[e]}var en=function(){return Qe.exports}();const nn={props:{disabled:Boolean,config:Object,fields:{type:[Array,Object],default:()=>({})},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},data(){return{errors:{},listeners:l(a({},this.$listeners),{submit:this.onSubmit})}},methods:{focus(t){var e,n;null==(n=null==(e=this.$refs.fields)?void 0:e.focus)||n.call(e,t)},onSubmit(){this.$emit("submit",this.value)},submit(){this.$refs.submitter.click()}}},sn={};var on=Ft(nn,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("form",{ref:"form",staticClass:"k-form",attrs:{method:"POST",autocomplete:"off",novalidate:""},on:{submit:function(e){return e.preventDefault(),t.onSubmit.apply(null,arguments)}}},[t._t("header"),t._t("default",(function(){return[n("k-fieldset",t._g({ref:"fields",attrs:{disabled:t.disabled,fields:t.fields,novalidate:t.novalidate},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}},t.listeners))]})),t._t("footer"),n("input",{ref:"submitter",staticClass:"k-form-submitter",attrs:{type:"submit"}})],2)}),[],!1,rn,null,null,null);function rn(t){for(let e in sn)this[e]=sn[e]}var an=function(){return on.exports}();const ln={props:{lock:[Boolean,Object]},data:()=>({isRefreshing:null,isLocking:null}),computed:{hasChanges(){return this.$store.getters["content/hasChanges"]()},isDisabled(){return!1===this.$store.state.content.status.enabled},isLocked(){return"lock"===this.lockState},isUnlocked(){return"unlock"===this.lockState},mode(){return null!==this.lockState?this.lockState:!0===this.hasChanges?"changes":null},lockState(){return this.supportsLocking&&this.lock?this.lock.state:null},supportsLocking(){return!1!==this.lock},theme(){return"lock"===this.mode?"negative":"unlock"===this.mode?"info":"notice"}},watch:{hasChanges:{handler(t,e){!0===this.supportsLocking&&!1===this.isLocked&&!1===this.isUnlocked&&(!0===t?(this.onLock(),this.isLocking=setInterval(this.onLock,3e4)):e&&(clearInterval(this.isLocking),this.onLock(!1)))},immediate:!0},isLocked(t){!1===t&&this.$events.$emit("model.reload")}},created(){this.supportsLocking&&(this.isRefreshing=setInterval(this.check,1e4)),this.$events.$on("keydown.cmd.s",this.onSave)},destroyed(){clearInterval(this.isRefreshing),clearInterval(this.isLocking),this.$events.$off("keydown.cmd.s",this.onSave)},methods:{check(){this.$reload({navigate:!1,only:"$view.props.lock",silent:!0})},async onLock(t=!0){const e=[this.$view.path+"/lock",null,null,!0];if(!0===t)try{await this.$api.patch(...e)}catch(n){clearInterval(this.isLocking),this.$store.dispatch("content/revert")}else clearInterval(this.isLocking),await this.$api.delete(...e)},onDownload(){let t="";const e=this.$store.getters["content/changes"]();Object.keys(e).forEach((n=>{t+=n+": \n\n"+e[n],t+="\n\n----\n\n"}));let n=document.createElement("a");n.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),n.setAttribute("download",this.$view.path+".txt"),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)},async onResolve(){await this.onUnlock(!1),this.$store.dispatch("content/revert")},onRevert(){this.$refs.revert.open()},async onSave(t){if(!t)return!1;t.preventDefault&&t.preventDefault();try{await this.$store.dispatch("content/save"),this.$events.$emit("model.update"),this.$store.dispatch("notification/success",":)")}catch(e){if(403===e.code)return;e.details&&Object.keys(e.details).length>0?this.$store.dispatch("notification/error",{message:this.$t("error.form.incomplete"),details:e.details}):this.$store.dispatch("notification/error",{message:this.$t("error.form.notSaved"),details:[{label:"Exception: "+e.exception,message:e.message}]})}},async onUnlock(t=!0){const e=[this.$view.path+"/unlock",null,null,!0];!0===t?await this.$api.patch(...e):await this.$api.delete(...e),this.$reload({silent:!0})},revert(){this.$store.dispatch("content/revert"),this.$refs.revert.close()}}},un={};var cn=Ft(ln,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("nav",{staticClass:"k-form-buttons",attrs:{"data-theme":t.theme}},["unlock"===t.mode?n("k-view",[n("p",{staticClass:"k-form-lock-info"},[t._v(" "+t._s(t.$t("lock.isUnlocked"))+" ")]),n("span",{staticClass:"k-form-lock-buttons"},[n("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("download"),icon:"download"},on:{click:t.onDownload}}),n("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("confirm"),icon:"check"},on:{click:t.onResolve}})],1)]):"lock"===t.mode?n("k-view",[n("p",{staticClass:"k-form-lock-info"},[n("k-icon",{attrs:{type:"lock"}}),n("span",{domProps:{innerHTML:t._s(t.$t("lock.isLocked",{email:t.$esc(t.lock.data.email)}))}})],1),t.lock.data.unlockable?n("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("lock.unlock"),icon:"unlock"},on:{click:function(e){return t.onUnlock()}}}):n("k-icon",{staticClass:"k-form-lock-loader",attrs:{type:"loader"}})],1):"changes"===t.mode?n("k-view",[n("k-button",{staticClass:"k-form-button",attrs:{disabled:t.isDisabled,text:t.$t("revert"),icon:"undo"},on:{click:t.onRevert}}),n("k-button",{staticClass:"k-form-button",attrs:{disabled:t.isDisabled,text:t.$t("save"),icon:"check"},on:{click:t.onSave}})],1):t._e(),n("k-dialog",{ref:"revert",attrs:{"submit-button":t.$t("revert"),icon:"undo",theme:"negative"},on:{submit:t.revert}},[n("k-text",{domProps:{innerHTML:t._s(t.$t("revert.confirm"))}})],1)],1)}),[],!1,dn,null,null,null);function dn(t){for(let e in un)this[e]=un[e]}var pn=function(){return cn.exports}();const hn={};var fn=Ft({data:()=>({isOpen:!1,options:[]}),computed:{hasChanges(){return this.ids.length>0},ids(){return Object.keys(this.store).filter((t=>{var e;return Object.keys((null==(e=this.store[t])?void 0:e.changes)||{}).length>0}))},store(){return this.$store.state.content.models}},methods:{async toggle(){if(!1===this.$refs.list.isOpen)try{await this.$dropdown("changes",{method:"POST",body:{ids:this.ids}})((t=>{this.options=t}))}catch(t){return this.$store.dispatch("notification/success",this.$t("lock.unsaved.empty")),this.$store.dispatch("content/clear"),!1}this.$refs.list&&this.$refs.list.toggle()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.hasChanges?n("k-dropdown",{staticClass:"k-form-indicator"},[n("k-button",{staticClass:"k-form-indicator-toggle k-topbar-button",attrs:{icon:"edit"},on:{click:t.toggle}}),n("k-dropdown-content",{ref:"list",attrs:{align:"right",theme:"light"}},[n("p",{staticClass:"k-form-indicator-info"},[t._v(t._s(t.$t("lock.unsaved"))+":")]),n("hr"),t._l(t.options,(function(e){return n("k-dropdown-item",t._b({key:e.id},"k-dropdown-item",e,!1),[t._v(" "+t._s(e.text)+" ")])}))],2)],1):t._e()}),[],!1,mn,null,null,null);function mn(t){for(let e in hn)this[e]=hn[e]}var gn=function(){return fn.exports}(),kn={props:{after:String}},vn={props:{autofocus:Boolean}},bn={props:{before:String}},yn={props:{disabled:Boolean}},$n={props:{help:String}},_n={props:{id:{type:[Number,String],default(){return this._uid}}}},xn={props:{invalid:Boolean}},wn={props:{label:String}},Sn={props:{name:[Number,String]}},Cn={props:{required:Boolean}};const On={mixins:[yn,$n,wn,Sn,Cn],props:{counter:[Boolean,Object],endpoints:Object,input:[String,Number],translate:Boolean,type:String}},En={};var An=Ft({mixins:[On],inheritAttrs:!1,computed:{labelText(){return this.label||" "}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"k-field k-field-name-"+t.name,attrs:{"data-disabled":t.disabled,"data-translate":t.translate},on:{focusin:function(e){return t.$emit("focus",e)},focusout:function(e){return t.$emit("blur",e)}}},[t._t("header",(function(){return[n("header",{staticClass:"k-field-header"},[t._t("label",(function(){return[n("label",{staticClass:"k-field-label",attrs:{for:t.input}},[t._v(" "+t._s(t.labelText)+" "),t.required?n("abbr",{attrs:{title:t.$t("field.required")}},[t._v("*")]):t._e()])]})),t._t("options"),t._t("counter",(function(){return[t.counter?n("k-counter",t._b({staticClass:"k-field-counter",attrs:{required:t.required}},"k-counter",t.counter,!1)):t._e()]}))],2)]})),t._t("default"),t._t("footer",(function(){return[t.help||t.$slots.help?n("footer",{staticClass:"k-field-footer"},[t._t("help",(function(){return[t.help?n("k-text",{staticClass:"k-field-help",attrs:{theme:"help"},domProps:{innerHTML:t._s(t.help)}}):t._e()]}))],2):t._e()]}))],2)}),[],!1,Tn,null,null,null);function Tn(t){for(let e in En)this[e]=En[e]}var In=function(){return An.exports}();const Mn={props:{config:Object,disabled:Boolean,fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},data:()=>({errors:{}}),methods:{focus(t){if(t)return void(this.hasField(t)&&"function"==typeof this.$refs[t][0].focus&&this.$refs[t][0].focus());const e=Object.keys(this.$refs)[0];this.focus(e)},hasFieldType(t){return this.$helper.isComponent(`k-${t}-field`)},hasField(t){var e;return null==(e=this.$refs[t])?void 0:e[0]},meetsCondition(t){if(!t.when)return!0;let e=!0;return Object.keys(t.when).forEach((n=>{this.value[n.toLowerCase()]!==t.when[n]&&(e=!1)})),e},onInvalid(t,e,n,i){this.errors[i]=e,this.$emit("invalid",this.errors)},hasErrors(){return Object.keys(this.errors).length}}},Ln={};var jn=Ft(Mn,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("fieldset",{staticClass:"k-fieldset"},[n("k-grid",[t._l(t.fields,(function(e,i){return["hidden"!==e.type&&t.meetsCondition(e)?n("k-column",{key:e.signature,attrs:{width:e.width}},[n("k-error-boundary",[t.hasFieldType(e.type)?n("k-"+e.type+"-field",t._b({ref:i,refInFor:!0,tag:"component",attrs:{"form-data":t.value,name:i,novalidate:t.novalidate,disabled:t.disabled||e.disabled},on:{input:function(n){return t.$emit("input",t.value,e,i)},focus:function(n){return t.$emit("focus",n,e,i)},invalid:function(n,s){return t.onInvalid(n,s,e,i)},submit:function(n){return t.$emit("submit",n,e,i)}},model:{value:t.value[i],callback:function(e){t.$set(t.value,i,e)},expression:"value[fieldName]"}},"component",e,!1)):n("k-box",{attrs:{theme:"negative"}},[n("k-text",{attrs:{size:"small"}},[t._v(" The field type "),n("strong",[t._v('"'+t._s(i)+'"')]),t._v(" does not exist ")])],1)],1)],1):t._e()]}))],2)],1)}),[],!1,Dn,null,null,null);function Dn(t){for(let e in Ln)this[e]=Ln[e]}var Bn=function(){return jn.exports}();const Pn={mixins:[kn,bn,yn,xn],props:{autofocus:Boolean,type:String,icon:[String,Boolean],theme:String,novalidate:{type:Boolean,default:!1},value:{type:[String,Boolean,Number,Object,Array],default:null}}},Nn={};var qn=Ft({mixins:[Pn],inheritAttrs:!1,data(){return{isInvalid:this.invalid,listeners:l(a({},this.$listeners),{invalid:(t,e)=>{this.isInvalid=t,this.$emit("invalid",t,e)}})}},computed:{inputProps(){return a(a({},this.$props),this.$attrs)}},methods:{blur(t){(null==t?void 0:t.relatedTarget)&&!1===this.$el.contains(t.relatedTarget)&&this.trigger(null,"blur")},focus(t){this.trigger(t,"focus")},select(t){this.trigger(t,"select")},trigger(t,e){var n,i,s;if("INPUT"===(null==(n=null==t?void 0:t.target)?void 0:n.tagName)&&"function"==typeof(null==(i=null==t?void 0:t.target)?void 0:i[e]))return void t.target[e]();if("function"==typeof(null==(s=this.$refs.input)?void 0:s[e]))return void this.$refs.input[e]();const o=this.$el.querySelector("input, select, textarea");"function"==typeof(null==o?void 0:o[e])&&o[e]()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-input",attrs:{"data-disabled":t.disabled,"data-invalid":!t.novalidate&&t.isInvalid,"data-theme":t.theme,"data-type":t.type}},[t.$slots.before||t.before?n("span",{staticClass:"k-input-before",on:{click:t.focus}},[t._t("before",(function(){return[t._v(t._s(t.before))]}))],2):t._e(),n("span",{staticClass:"k-input-element",on:{click:function(e){return e.stopPropagation(),t.focus.apply(null,arguments)}}},[t._t("default",(function(){return[n("k-"+t.type+"-input",t._g(t._b({ref:"input",tag:"component",attrs:{value:t.value}},"component",t.inputProps,!1),t.listeners))]}))],2),t.$slots.after||t.after?n("span",{staticClass:"k-input-after",on:{click:t.focus}},[t._t("after",(function(){return[t._v(t._s(t.after))]}))],2):t._e(),t.$slots.icon||t.icon?n("span",{staticClass:"k-input-icon",on:{click:t.focus}},[t._t("icon",(function(){return[n("k-icon",{attrs:{type:t.icon}})]}))],2):t._e()])}),[],!1,Fn,null,null,null);function Fn(t){for(let e in Nn)this[e]=Nn[e]}var Rn=function(){return qn.exports}();const zn={};var Yn=Ft({props:{methods:Array},data:()=>({currentForm:null,isLoading:!1,issue:"",user:{email:"",password:"",remember:!1}}),computed:{canToggle(){return null!==this.codeMode&&!0===this.methods.includes("password")&&(!0===this.methods.includes("password-reset")||!0===this.methods.includes("code"))},codeMode(){return!0===this.methods.includes("password-reset")?"password-reset":!0===this.methods.includes("code")?"code":null},fields(){let t={email:{autofocus:!0,label:this.$t("email"),type:"email",required:!0,link:!1}};return"email-password"===this.form&&(t.password={label:this.$t("password"),type:"password",minLength:8,required:!0,autocomplete:"current-password",counter:!1}),t},form(){return this.currentForm?this.currentForm:"password"===this.methods[0]?"email-password":"email"},isResetForm(){return"password-reset"===this.codeMode&&"email"===this.form},toggleText(){return this.$t("login.toggleText."+this.codeMode+"."+this.formOpposite(this.form))}},methods:{formOpposite:t=>"email-password"===t?"email":"email-password",async login(){this.issue=null,this.isLoading=!0;let t=Object.assign({},this.user);"email"===this.currentForm&&(t.password=null),!0===this.isResetForm&&(t.remember=!1);try{await this.$api.auth.login(t),this.$reload({globals:["$system","$translation"]})}catch(e){this.issue=e.message}finally{this.isLoading=!1}},toggleForm(){this.currentForm=this.formOpposite(this.form),this.$refs.fieldset.focus("email")}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("form",{staticClass:"k-login-form",on:{submit:function(e){return e.preventDefault(),t.login.apply(null,arguments)}}},[n("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("login"))+" ")]),t.issue?n("k-login-alert",{on:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),n("div",{staticClass:"k-login-fields"},[!0===t.canToggle?n("button",{staticClass:"k-login-toggler",attrs:{type:"button"},on:{click:t.toggleForm}},[t._v(" "+t._s(t.toggleText)+" ")]):t._e(),n("k-fieldset",{ref:"fieldset",attrs:{novalidate:!0,fields:t.fields},model:{value:t.user,callback:function(e){t.user=e},expression:"user"}})],1),n("div",{staticClass:"k-login-buttons"},[!1===t.isResetForm?n("span",{staticClass:"k-login-checkbox"},[n("k-checkbox-input",{attrs:{value:t.user.remember,label:t.$t("login.remember")},on:{input:function(e){t.user.remember=e}}})],1):t._e(),n("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("login"+(t.isResetForm?".reset":"")))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)],1)],1)}),[],!1,Hn,null,null,null);function Hn(t){for(let e in zn)this[e]=zn[e]}var Un=function(){return Yn.exports}();const Kn={};var Jn=Ft({props:{methods:Array,pending:Object},data:()=>({code:"",isLoadingBack:!1,isLoadingLogin:!1,issue:""}),computed:{mode(){return!0===this.methods.includes("password-reset")?"password-reset":"login"}},methods:{async back(){this.isLoadingBack=!0,this.$go("/logout")},async login(){this.issue=null,this.isLoadingLogin=!0;try{await this.$api.auth.verifyCode(this.code),this.$store.dispatch("notification/success",this.$t("welcome")),"password-reset"===this.mode?this.$go("reset-password"):this.$reload()}catch(t){this.issue=t.message}finally{this.isLoadingLogin=!1}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("form",{staticClass:"k-login-form k-login-code-form",on:{submit:function(e){return e.preventDefault(),t.login.apply(null,arguments)}}},[n("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("login"))+" ")]),t.issue?n("k-login-alert",{on:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),n("k-user-info",{attrs:{user:t.pending.email}}),n("k-text-field",{attrs:{autofocus:!0,counter:!1,help:t.$t("login.code.text."+t.pending.challenge),label:t.$t("login.code.label."+t.mode),novalidate:!0,placeholder:t.$t("login.code.placeholder."+t.pending.challenge),required:!0,autocomplete:"one-time-code",icon:"unlock",name:"code"},model:{value:t.code,callback:function(e){t.code=e},expression:"code"}}),n("div",{staticClass:"k-login-buttons"},[n("k-button",{staticClass:"k-login-button k-login-back-button",attrs:{icon:"angle-left"},on:{click:t.back}},[t._v(" "+t._s(t.$t("back"))+" "),t.isLoadingBack?[t._v(" … ")]:t._e()],2),n("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("login"+("password-reset"===t.mode?".reset":"")))+" "),t.isLoadingLogin?[t._v(" … ")]:t._e()],2)],1)],1)}),[],!1,Gn,null,null,null);function Gn(t){for(let e in Kn)this[e]=Kn[e]}var Vn=function(){return Jn.exports}();const Wn={};var Xn=Ft({props:{display:{type:String,default:"HH:mm"},value:String},computed:{day(){return this.formatTimes([6,7,8,9,10,11,"-",12,13,14,15,16,17])},night(){return this.formatTimes([18,19,20,21,22,23,"-",0,1,2,3,4,5])}},methods:{formatTimes(t){return t.map((t=>{if("-"===t)return t;const e=this.$library.dayjs(t+":00","H:mm");return{display:e.format(this.display),select:e.toISO("time")}}))},select(t){this.$emit("input",t)}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-times"},[n("div",{staticClass:"k-times-slot"},[n("k-icon",{attrs:{type:"sun"}}),n("ul",t._l(t.day,(function(e){return n("li",{key:e.select},["-"===e?n("hr"):n("k-button",{on:{click:function(n){return t.select(e.select)}}},[t._v(t._s(e.display))])],1)})),0)],1),n("div",{staticClass:"k-times-slot"},[n("k-icon",{attrs:{type:"moon"}}),n("ul",t._l(t.night,(function(e){return n("li",{key:e.select},["-"===e?n("hr"):n("k-button",{on:{click:function(n){return t.select(e.select)}}},[t._v(t._s(e.display))])],1)})),0)],1)])}),[],!1,Zn,null,null,null);function Zn(t){for(let e in Wn)this[e]=Wn[e]}var Qn=function(){return Xn.exports}();const ti={props:{accept:{type:String,default:"*"},attributes:{type:Object},max:{type:Number},method:{type:String,default:"POST"},multiple:{type:Boolean,default:!0},url:{type:String}},data(){return{options:this.$props,completed:{},errors:[],files:[],total:0}},computed:{limit(){return!1===this.options.multiple?1:this.options.max}},methods:{open(t){this.params(t),setTimeout((()=>{this.$refs.input.click()}),1)},params(t){this.options=Object.assign({},this.$props,t)},select(t){this.upload(t.target.files)},drop(t,e){this.params(e),this.upload(t)},upload(t){this.$refs.dialog.open(),this.files=[...t],this.completed={},this.errors=[],this.hasErrors=!1,this.limit&&(this.files=this.files.slice(0,this.limit)),this.total=this.files.length,this.files.forEach((t=>{var e,n;this.$helper.upload(t,{url:this.options.url,attributes:this.options.attributes,method:this.options.method,headers:{"X-CSRF":window.panel.$system.csrf},progress:(t,e,n)=>{var i,s;null==(s=null==(i=this.$refs[e.name])?void 0:i[0])||s.set(n)},success:(t,e,n)=>{this.complete(e,n.data)},error:(t,e,n)=>{this.errors.push({file:e,message:n.message}),this.complete(e,n.data)}}),void 0!==(null==(n=null==(e=this.options)?void 0:e.attributes)?void 0:n.sort)&&this.options.attributes.sort++}))},complete(t,e){if(this.completed[t.name]=e,Object.keys(this.completed).length==this.total){if(this.$refs.input.value="",this.errors.length>0)return this.$forceUpdate(),void this.$emit("error",this.files);setTimeout((()=>{this.$refs.dialog.close(),this.$emit("success",this.files,Object.values(this.completed))}),250)}}}},ei={};var ni=Ft(ti,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-upload"},[n("input",{ref:"input",attrs:{accept:t.options.accept,multiple:t.options.multiple,"aria-hidden":"true",type:"file",tabindex:"-1"},on:{change:t.select,click:function(t){t.stopPropagation()}}}),n("k-dialog",{ref:"dialog",staticClass:"k-upload-dialog",attrs:{"cancel-button":!1,"submit-button":!1,size:"medium"},scopedSlots:t._u([{key:"footer",fn:function(){return[t.errors.length>0?[n("k-button-group",{attrs:{buttons:[{icon:"check",text:t.$t("confirm"),click:function(){return t.$refs.dialog.close()}}]}})]:t._e()]},proxy:!0}])},[t.errors.length>0?[n("k-headline",[t._v(t._s(t.$t("upload.errors")))]),n("ul",{staticClass:"k-upload-error-list"},t._l(t.errors,(function(e,i){return n("li",{key:"error-"+i},[n("p",{staticClass:"k-upload-error-filename"},[t._v(" "+t._s(e.file.name)+" ")]),n("p",{staticClass:"k-upload-error-message"},[t._v(" "+t._s(e.message)+" ")])])})),0)]:[n("k-headline",[t._v(t._s(t.$t("upload.progress")))]),n("ul",{staticClass:"k-upload-list"},t._l(t.files,(function(e,i){return n("li",{key:"file-"+i},[n("k-progress",{ref:e.name,refInFor:!0}),n("p",{staticClass:"k-upload-list-filename"},[t._v(" "+t._s(e.name)+" ")]),n("p",[t._v(t._s(t.errors[e.name]))])],1)})),0)]],2)],1)}),[],!1,ii,null,null,null);function ii(t){for(let e in ei)this[e]=ei[e]}var si=function(){return ni.exports}();var oi=t=>({$from:e})=>((t,e)=>{for(let n=t.depth;n>0;n--){const i=t.node(n);if(e(i))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:i}}})(e,t),ri=t=>e=>{if((t=>t instanceof b)(e)){const{node:n,$from:i}=e;if(((t,e)=>Array.isArray(t)&&t.indexOf(e.type)>-1||e.type===t)(t,n))return{node:n,pos:i.pos,depth:i.depth}}},ai=(t,e,n={})=>{const i=ri(e)(t.selection)||oi((t=>t.type===e))(t.selection);return Object.keys(n).length&&i?i.node.hasMarkup(e,a(a({},i.node.attrs),n)):!!i};function li(t=null,e=null){if(!t||!e)return!1;const n=t.parent.childAfter(t.parentOffset);if(!n.node)return!1;const i=n.node.marks.find((t=>t.type===e));if(!i)return!1;let s=t.index(),o=t.start()+n.offset,r=s+1,a=o+n.node.nodeSize;for(;s>0&&i.isInSet(t.parent.child(s-1).marks);)s-=1,o-=t.parent.child(s).nodeSize;for(;r{s=[...s,...t.marks]}));const o=s.find((t=>t.type.name===e.name));return o?o.attrs:{}},getNodeAttrs:function(t,e){const{from:n,to:i}=t.selection;let s=[];t.doc.nodesBetween(n,i,(t=>{s=[...s,t]}));const o=s.reverse().find((t=>t.type.name===e.name));return o?o.attrs:{}},markInputRule:function(t,e,n){return new m(t,((t,i,s,o)=>{const r=n instanceof Function?n(i):n,{tr:a}=t,l=i.length-1;let u=o,c=s;if(i[l]){const n=s+i[0].indexOf(i[l-1]),r=n+i[l-1].length-1,d=n+i[l-1].lastIndexOf(i[l]),p=d+i[l].length,h=function(t,e,n){let i=[];return n.doc.nodesBetween(t,e,((t,e)=>{i=[...i,...t.marks.map((n=>({start:e,end:e+t.nodeSize,mark:n})))]})),i}(s,o,t).filter((t=>{const{excluded:n}=t.mark.type;return n.find((t=>t.name===e.name))})).filter((t=>t.end>n));if(h.length)return!1;pn&&a.delete(n,d),c=n,u=c+i[l].length}return a.addMark(c,u,e.create(r)),a.removeStoredMark(e),a}))},markIsActive:function(t,e){const{from:n,$from:i,to:s,empty:o}=t.selection;return o?!!e.isInSet(t.storedMarks||i.marks()):!!t.doc.rangeHasMark(n,s,e)},markPasteRule:function(t,e,n){const i=(s,o)=>{const r=[];return s.forEach((s=>{var a;if(s.isText){const{text:i,marks:l}=s;let u,c=0;const d=!!l.filter((t=>"link"===t.type.name))[0];for(;!d&&null!==(u=t.exec(i));)if((null==(a=null==o?void 0:o.type)?void 0:a.allowsMarkType(e))&&u[1]){const t=u.index,i=t+u[0].length,o=t+u[0].indexOf(u[1]),a=o+u[1].length,l=n instanceof Function?n(u):n;t>0&&r.push(s.cut(c,t)),r.push(s.cut(o,a).mark(e.create(l).addToSet(s.marks))),c=i}cnew k(i(t.content),t.openStart,t.openEnd)}})},minMax:function(t=0,e=0,n=0){return Math.min(Math.max(parseInt(t,10),e),n)},nodeIsActive:ai,nodeInputRule:function(t,e,n){return new m(t,((t,i,s,o)=>{const r=n instanceof Function?n(i):n,{tr:a}=t;return i[0]&&a.replaceWith(s-1,o,e.create(r)),a}))},pasteRule:function(t,e,n){const i=s=>{const o=[];return s.forEach((s=>{if(s.isText){const{text:i}=s;let r,a=0;do{if(r=t.exec(i),r){const t=r.index,i=t+r[0].length,l=n instanceof Function?n(r[0]):n;t>0&&o.push(s.cut(a,t)),o.push(s.cut(t,i).mark(e.create(l).addToSet(s.marks))),a=i}}while(r);anew k(i(t.content),t.openStart,t.openEnd)}})},removeMark:function(t){return(e,n)=>{const{tr:i,selection:s}=e;let{from:o,to:r}=s;const{$from:a,empty:l}=s;if(l){const e=li(a,t);o=e.from,r=e.to}return i.removeMark(o,r,t),n(i)}},toggleBlockType:function(t,e,n={}){return(i,s,o)=>ai(i,t,n)?y(e)(i,s,o):y(t,n)(i,s,o)},toggleList:function(t,e){return(n,i,s)=>{const{schema:o,selection:r}=n,{$from:a,$to:l}=r,u=a.blockRange(l);if(!u)return!1;const c=oi((t=>ui(t,o)))(r);if(u.depth>=1&&c&&u.depth-c.depth<=1){if(c.node.type===t)return $(e)(n,i,s);if(ui(c.node,o)&&t.validContent(c.node.content)){const{tr:e}=n;return e.setNodeMarkup(c.pos,t),i&&i(e),!1}}return _(t)(n,i,s)}},updateMark:function(t,e){return(n,i)=>{const{tr:s,selection:o,doc:r}=n,{ranges:a,empty:l}=o;if(l){const{from:n,to:i}=li(o.$from,t);r.rangeHasMark(n,i,t)&&s.removeMark(n,i,t),s.addMark(n,i,t.create(e))}else a.forEach((n=>{const{$to:i,$from:o}=n;r.rangeHasMark(o.pos,i.pos,t)&&s.removeMark(o.pos,i.pos,t),s.addMark(o.pos,i.pos,t.create(e))}));return i(s)}}};class di{constructor(t=[],e){t.forEach((t=>{t.bindEditor(e),t.init()})),this.extensions=t}commands({schema:t,view:e}){return this.extensions.filter((t=>t.commands)).reduce(((n,i)=>{const{name:s,type:o}=i,r={},l=i.commands(a({schema:t,utils:ci},["node","mark"].includes(o)?{type:t[`${o}s`][s]}:{})),u=(t,n)=>{r[t]=t=>{if("function"!=typeof n||!e.editable)return!1;e.focus();const i=n(t);return"function"==typeof i?i(e.state,e.dispatch,e):i}};return"object"==typeof l?Object.entries(l).forEach((([t,e])=>{u(t,e)})):u(s,l),a(a({},n),r)}),{})}buttons(t="mark"){const e={};return this.extensions.filter((e=>e.type===t)).filter((t=>t.button)).forEach((t=>{Array.isArray(t.button)?t.button.forEach((t=>{e[t.id||t.name]=t})):e[t.name]=t.button})),e}getAllowedExtensions(t){return t instanceof Array||!t?t instanceof Array?this.extensions.filter((e=>!t.includes(e.name))):this.extensions:[]}getFromExtensions(t,e,n=this.extensions){return n.filter((t=>["extension"].includes(t.type))).filter((e=>e[t])).map((n=>n[t](l(a({},e),{utils:ci}))))}getFromNodesAndMarks(t,e,n=this.extensions){return n.filter((t=>["node","mark"].includes(t.type))).filter((e=>e[t])).map((n=>n[t](l(a({},e),{type:e.schema[`${n.type}s`][n.name],utils:ci}))))}inputRules({schema:t,excludedExtensions:e}){const n=this.getAllowedExtensions(e);return[...this.getFromExtensions("inputRules",{schema:t},n),...this.getFromNodesAndMarks("inputRules",{schema:t},n)].reduce(((t,e)=>[...t,...e]),[])}keymaps({schema:t}){return[...this.getFromExtensions("keys",{schema:t}),...this.getFromNodesAndMarks("keys",{schema:t})].map((t=>I(t)))}get marks(){return this.extensions.filter((t=>"mark"===t.type)).reduce(((t,{name:e,schema:n})=>l(a({},t),{[e]:n})),{})}get nodes(){return this.extensions.filter((t=>"node"===t.type)).reduce(((t,{name:e,schema:n})=>l(a({},t),{[e]:n})),{})}get options(){const{view:t}=this;return this.extensions.reduce(((e,n)=>l(a({},e),{[n.name]:new Proxy(n.options,{set(e,n,i){const s=e[n]!==i;return Object.assign(e,{[n]:i}),s&&t.updateState(t.state),!0}})})),{})}pasteRules({schema:t,excludedExtensions:e}){const n=this.getAllowedExtensions(e);return[...this.getFromExtensions("pasteRules",{schema:t},n),...this.getFromNodesAndMarks("pasteRules",{schema:t},n)].reduce(((t,e)=>[...t,...e]),[])}plugins({schema:t}){return[...this.getFromExtensions("plugins",{schema:t}),...this.getFromNodesAndMarks("plugins",{schema:t})].reduce(((t,e)=>[...t,...e]),[]).map((t=>t instanceof g?t:new g(t)))}}class pi{constructor(t={}){this.options=a(a({},this.defaults),t)}init(){return null}bindEditor(t=null){this.editor=t}get name(){return null}get type(){return"extension"}get defaults(){return{}}plugins(){return[]}inputRules(){return[]}pasteRules(){return[]}keys(){return{}}}class hi extends pi{constructor(t={}){super(t)}get type(){return"node"}get schema(){return null}commands(){return{}}}class fi extends hi{get defaults(){return{inline:!1}}get name(){return"doc"}get schema(){return{content:this.options.inline?"paragraph+":"block+"}}}class mi extends hi{get button(){return{id:this.name,icon:"paragraph",label:window.panel.$t("toolbar.button.paragraph"),name:this.name}}commands({utils:t,type:e}){return{paragraph:()=>t.setBlockType(e)}}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}get name(){return"paragraph"}}class gi extends hi{get name(){return"text"}get schema(){return{group:"inline"}}}class ki extends class{emit(t,...e){this._callbacks=this._callbacks||{};const n=this._callbacks[t];return n&&n.forEach((t=>t.apply(this,e))),this}off(t,e){if(arguments.length){const n=this._callbacks?this._callbacks[t]:null;n&&(e?this._callbacks[t]=n.filter((t=>t!==e)):delete this._callbacks[t])}else this._callbacks={};return this}on(t,e){return this._callbacks=this._callbacks||{},this._callbacks[t]=this._callbacks[t]||[],this._callbacks[t].push(e),this}}{constructor(t={}){super(),this.defaults={autofocus:!1,content:"",disableInputRules:!1,disablePasteRules:!1,editable:!0,element:null,extensions:[],emptyDocument:{type:"doc",content:[]},events:{},inline:!1,parseOptions:{},topNode:"doc",useBuiltInExtensions:!0},this.init(t)}blur(){this.view.dom.blur()}get builtInExtensions(){return this.options.useBuiltInExtensions?[new fi({inline:this.options.inline}),new gi,new mi]:[]}buttons(t){return this.extensions.buttons(t)}clearContent(t=!1){this.setContent(this.options.emptyDocument,t)}command(t,...e){this.commands[t]&&this.commands[t](...e)}createCommands(){return this.extensions.commands({schema:this.schema,view:this.view})}createDocument(t,e=this.options.parseOptions){if(null===t)return this.schema.nodeFromJSON(this.options.emptyDocument);if("object"==typeof t)try{return this.schema.nodeFromJSON(t)}catch(n){return window.console.warn("Invalid content.","Passed value:",t,"Error:",n),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"==typeof t){const n=`${t}
`,i=(new window.DOMParser).parseFromString(n,"text/html").body.firstElementChild;return M.fromSchema(this.schema).parse(i,e)}return!1}createEvents(){const t=this.options.events||{};return Object.entries(t).forEach((([t,e])=>{this.on(t,e)})),t}createExtensions(){return new di([...this.builtInExtensions,...this.options.extensions],this)}createFocusEvents(){const t=(t,e,n)=>{this.focused=n,this.emit(n?"focus":"blur",{event:e,state:t.state,view:t});const i=this.state.tr.setMeta("focused",n);this.view.dispatch(i)};return new g({props:{attributes:{tabindex:0},handleDOMEvents:{focus:(e,n)=>{t(e,n,!0)},blur:(e,n)=>{t(e,n,!1)}}}})}createInputRules(){return this.extensions.inputRules({schema:this.schema,excludedExtensions:this.options.disableInputRules})}createKeymaps(){return this.extensions.keymaps({schema:this.schema})}createMarks(){return this.extensions.marks}createNodes(){return this.extensions.nodes}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createPlugins(){return this.extensions.plugins({schema:this.schema})}createSchema(){return new L({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return j.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,D({rules:this.inputRules}),...this.pasteRules,...this.keymaps,I({Backspace:q}),I(F),this.createFocusEvents()]})}createView(){return new B(this.element,{dispatchTransaction:this.dispatchTransaction.bind(this),editable:()=>this.options.editable,handlePaste:(t,e)=>{if("function"==typeof this.events.paste){const t=e.clipboardData.getData("text/html"),n=e.clipboardData.getData("text/plain");if(!0===this.events.paste(e,t,n))return!0}},handleDrop:(...t)=>{this.emit("drop",...t)},state:this.createState()})}destroy(){this.view&&this.view.destroy()}dispatchTransaction(t){const e=this.state,n=this.state.apply(t);this.view.updateState(n),this.selection={from:this.state.selection.from,to:this.state.selection.to},this.setActiveNodesAndMarks();const i={editor:this,getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:t};this.emit("transaction",i),!t.docChanged&&t.getMeta("preventUpdate")||this.emit("update",i);const{from:s,to:o}=this.state.selection,r=!e||!e.selection.eq(n.selection);this.emit(n.selection.empty?"deselect":"select",l(a({},i),{from:s,hasChanged:r,to:o}))}focus(t=null){if(this.view.focused&&null===t||!1===t)return;const{from:e,to:n}=this.selectionAtPosition(t);this.setSelection(e,n),setTimeout((()=>this.view.focus()),10)}getHTML(){const t=document.createElement("div"),e=P.fromSchema(this.schema).serializeFragment(this.state.doc.content);return t.appendChild(e),this.options.inline&&t.querySelector("p")?t.querySelector("p").innerHTML:t.innerHTML}getJSON(){return this.state.doc.toJSON()}getMarkAttrs(t=null){return this.activeMarkAttrs[t]}getSchemaJSON(){return JSON.parse(JSON.stringify({nodes:this.nodes,marks:this.marks}))}init(t={}){this.options=a(a({},this.defaults),t),this.element=this.options.element,this.focused=!1,this.selection={from:0,to:0},this.events=this.createEvents(),this.extensions=this.createExtensions(),this.nodes=this.createNodes(),this.marks=this.createMarks(),this.schema=this.createSchema(),this.keymaps=this.createKeymaps(),this.inputRules=this.createInputRules(),this.pasteRules=this.createPasteRules(),this.plugins=this.createPlugins(),this.view=this.createView(),this.commands=this.createCommands(),this.setActiveNodesAndMarks(),!1!==this.options.autofocus&&this.focus(this.options.autofocus),this.emit("init",{view:this.view,state:this.state}),this.extensions.view=this.view,this.setContent(this.options.content,!0)}isEditable(){return this.options.editable}isEmpty(){if(this.state)return 0===this.state.doc.textContent.length}get isActive(){return Object.entries(a(a({},this.activeMarks),this.activeNodes)).reduce(((t,[e,n])=>l(a({},t),{[e]:(t={})=>n(t)})),{})}removeMark(t){if(this.schema.marks[t])return ci.removeMark(this.schema.marks[t])(this.state,this.view.dispatch)}selectionAtPosition(t=null){if(this.selection&&null===t)return this.selection;if("start"===t||!0===t)return{from:0,to:0};if("end"===t){const{doc:t}=this.state;return{from:t.content.size,to:t.content.size}}return{from:t,to:t}}setActiveNodesAndMarks(){this.activeMarks=Object.values(this.schema.marks).filter((t=>ci.markIsActive(this.state,t))).map((t=>t.name)),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce(((t,[e,n])=>l(a({},t),{[e]:ci.getMarkAttrs(this.state,n)})),{}),this.activeNodes=Object.values(this.schema.nodes).filter((t=>ci.nodeIsActive(this.state,t))).map((t=>t.name)),this.activeNodeAttrs=Object.entries(this.schema.nodes).reduce(((t,[e,n])=>l(a({},t),{[e]:ci.getNodeAttrs(this.state,n)})),{})}setContent(t={},e=!1,n){const{doc:i,tr:s}=this.state,o=this.createDocument(t,n),r=N.create(i,0,i.content.size),a=s.setSelection(r).replaceSelectionWith(o,!1).setMeta("preventUpdate",!e);this.view.dispatch(a)}setSelection(t=0,e=0){const{doc:n,tr:i}=this.state,s=ci.minMax(t,0,n.content.size),o=ci.minMax(e,0,n.content.size),r=N.create(n,s,o),a=i.setSelection(r);this.view.dispatch(a)}get state(){return this.view?this.view.state:null}toggleMark(t){if(this.schema.marks[t])return ci.toggleMark(this.schema.marks[t])(this.state,this.view.dispatch)}updateMark(t,e){if(this.schema.marks[t])return ci.updateMark(this.schema.marks[t],e)(this.state,this.view.dispatch)}}const vi={};var bi=Ft({data:()=>({link:{href:null,title:null,target:!1}}),computed:{fields(){return{href:{label:this.$t("url"),type:"text",icon:"url"},title:{label:this.$t("title"),type:"text",icon:"title"},target:{label:this.$t("open.newWindow"),type:"toggle",text:[this.$t("no"),this.$t("yes")]}}}},methods:{open(t){this.link=a({title:null,target:!1},t),this.link.target=Boolean(this.link.target),this.$refs.dialog.open()},submit(){this.$emit("submit",l(a({},this.link),{target:this.link.target?"_blank":null})),this.$refs.dialog.close()}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("k-form-dialog",{ref:"dialog",attrs:{fields:t.fields,"submit-button":t.$t("confirm"),size:"medium"},on:{close:function(e){return t.$emit("close")},submit:t.submit},model:{value:t.link,callback:function(e){t.link=e},expression:"link"}})}),[],!1,yi,null,null,null);function yi(t){for(let e in vi)this[e]=vi[e]}var $i=function(){return bi.exports}();const _i={};var xi=Ft({data:()=>({email:{email:null,title:null}}),computed:{fields(){return{href:{label:this.$t("email"),type:"email",icon:"email"},title:{label:this.$t("title"),type:"text",icon:"title"}}}},methods:{open(t){this.email=a({title:null},t),this.$refs.dialog.open()},submit(){this.$emit("submit",this.email),this.$refs.dialog.close()}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("k-form-dialog",{ref:"dialog",attrs:{fields:t.fields,"submit-button":t.$t("confirm"),size:"medium"},on:{close:function(e){return t.$emit("close")},submit:t.submit},model:{value:t.email,callback:function(e){t.email=e},expression:"email"}})}),[],!1,wi,null,null,null);function wi(t){for(let e in _i)this[e]=_i[e]}var Si=function(){return xi.exports}();class Ci extends pi{constructor(t={}){super(t)}command(){return()=>{}}remove(){this.editor.removeMark(this.name)}get schema(){return null}get type(){return"mark"}toggle(){return this.editor.toggleMark(this.name)}update(t){this.editor.updateMark(this.name,t)}}class Oi extends Ci{get button(){return{icon:"code",label:window.panel.$t("toolbar.button.code")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:`)([^`]+)(?:`)$/,t)]}keys(){return{"Mod-`":()=>this.toggle()}}get name(){return"code"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/(?:`)([^`]+)(?:`)/g,t)]}get schema(){return{excludes:"_",parseDOM:[{tag:"code"}],toDOM:()=>["code",0]}}}class Ei extends Ci{get button(){return{icon:"bold",label:window.panel.$t("toolbar.button.bold")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,t)]}keys(){return{"Mod-b":()=>this.toggle()}}get name(){return"bold"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g,t)]}get schema(){return{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM:()=>["strong",0]}}}class Ai extends Ci{get button(){return{icon:"italic",label:window.panel.$t("toolbar.button.italic")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,t),e.markInputRule(/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,t)]}keys(){return{"Mod-i":()=>this.toggle()}}get name(){return"italic"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/_([^_]+)_/g,t),e.markPasteRule(/\*([^*]+)\*/g,t)]}get schema(){return{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}}}class Ti extends Ci{get button(){return{icon:"url",label:window.panel.$t("toolbar.button.link")}}commands(){return{link:()=>{this.editor.emit("link",this.editor)},insertLink:(t={})=>{if(t.href)return this.update(t)},removeLink:()=>this.remove(),toggleLink:(t={})=>{var e;(null==(e=t.href)?void 0:e.length)>0?this.editor.command("insertLink",t):this.editor.command("removeLink")}}}get defaults(){return{target:null}}get name(){return"link"}pasteRules({type:t,utils:e}){return[e.pasteRule(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b([-a-zA-Z0-9@:%_+.~#?&//=,]*)/gi,t,(t=>({href:t})))]}plugins(){return[{props:{handleClick:(t,e,n)=>{const i=this.editor.getMarkAttrs("link");i.href&&!0===n.altKey&&n.target instanceof HTMLAnchorElement&&(n.stopPropagation(),window.open(i.href,i.target))}}}]}get schema(){return{attrs:{href:{default:null},target:{default:null},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]:not([href^='mailto:'])",getAttrs:t=>({href:t.getAttribute("href"),target:t.getAttribute("target"),title:t.getAttribute("title")})}],toDOM:t=>["a",l(a({},t.attrs),{rel:"noopener noreferrer"}),0]}}}class Ii extends Ci{get button(){return{icon:"email",label:"Email"}}commands(){return{email:()=>{this.editor.emit("email")},insertEmail:(t={})=>{if(t.href)return this.update(t)},removeEmail:()=>this.remove(),toggleEmail:(t={})=>{var e;(null==(e=t.href)?void 0:e.length)>0?this.editor.command("insertEmail",t):this.editor.command("removeEmail")}}}get defaults(){return{target:null}}get name(){return"email"}pasteRules({type:t,utils:e}){return[e.pasteRule(/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/gi,t,(t=>({href:t})))]}plugins(){return[{props:{handleClick:(t,e,n)=>{const i=this.editor.getMarkAttrs("email");i.href&&!0===n.altKey&&n.target instanceof HTMLAnchorElement&&(n.stopPropagation(),window.open(i.href))}}}]}get schema(){return{attrs:{href:{default:null},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href^='mailto:']",getAttrs:t=>({href:t.getAttribute("href").replace("mailto:",""),title:t.getAttribute("title")})}],toDOM:t=>["a",l(a({},t.attrs),{href:"mailto:"+t.attrs.href}),0]}}}class Mi extends Ci{get button(){return{icon:"strikethrough",label:window.panel.$t("toolbar.button.strike")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/~([^~]+)~$/,t)]}keys(){return{"Mod-d":()=>this.toggle()}}get name(){return"strike"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/~([^~]+)~/g,t)]}get schema(){return{parseDOM:[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",getAttrs:t=>"line-through"===t}],toDOM:()=>["s",0]}}}class Li extends Ci{get button(){return{icon:"underline",label:window.panel.$t("toolbar.button.underline")}}commands(){return()=>this.toggle()}keys(){return{"Mod-u":()=>this.toggle()}}get name(){return"underline"}get schema(){return{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:t=>"underline"===t}],toDOM:()=>["u",0]}}}class ji extends hi{get button(){return{id:this.name,icon:"list-bullet",label:window.panel.$t("toolbar.button.ul"),name:this.name,when:["listItem","bulletList","orderedList"]}}commands({type:t,schema:e,utils:n}){return()=>n.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^\s*([-+*])\s$/,t)]}keys({type:t,schema:e,utils:n}){return{"Shift-Ctrl-8":n.toggleList(t,e.nodes.listItem)}}get name(){return"bulletList"}get schema(){return{content:"listItem+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]}}}class Di extends hi{commands({utils:t,type:e}){return()=>this.createHardBreak(t,e)}createHardBreak(t,e){return t.chainCommands(t.exitCode,((t,n)=>(n(t.tr.replaceSelectionWith(e.create()).scrollIntoView()),!0)))}get defaults(){return{enter:!1,text:!1}}keys({utils:t,type:e}){const n=this.createHardBreak(t,e);let i={"Mod-Enter":n,"Shift-Enter":n};return this.options.enter&&(i.Enter=n),i}get name(){return"hardBreak"}get schema(){return{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]}}}class Bi extends hi{get button(){return this.options.levels.map((t=>({id:`h${t}`,command:`h${t}`,icon:`h${t}`,label:window.panel.$t("toolbar.button.heading."+t),attrs:{level:t},name:this.name,when:["heading","paragraph"]})))}commands({type:t,schema:e,utils:n}){let i={toggleHeading:i=>n.toggleBlockType(t,e.nodes.paragraph,i)};return this.options.levels.forEach((s=>{i[`h${s}`]=()=>n.toggleBlockType(t,e.nodes.paragraph,{level:s})})),i}get defaults(){return{levels:[1,2,3,4,5,6]}}inputRules({type:t,utils:e}){return this.options.levels.map((n=>e.textblockTypeInputRule(new RegExp(`^(#{1,${n}})\\s$`),t,(()=>({level:n})))))}keys({type:t,utils:e}){return this.options.levels.reduce(((n,i)=>a(a({},n),{[`Shift-Ctrl-${i}`]:e.setBlockType(t,{level:i})})),{})}get name(){return"heading"}get schema(){return{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,draggable:!1,parseDOM:this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}}))),toDOM:t=>[`h${t.attrs.level}`,0]}}}class Pi extends hi{commands({type:t}){return()=>(e,n)=>n(e.tr.replaceSelectionWith(t.create()))}inputRules({type:t,utils:e}){return[e.nodeInputRule(/^(?:---|___\s|\*\*\*\s)$/,t)]}get name(){return"horizontalRule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}}class Ni extends hi{keys({type:t,utils:e}){return{Enter:e.splitListItem(t),"Shift-Tab":e.liftListItem(t),Tab:e.sinkListItem(t)}}get name(){return"listItem"}get schema(){return{content:"paragraph block*",defining:!0,draggable:!1,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}}}class qi extends hi{get button(){return{id:this.name,icon:"list-numbers",label:window.panel.$t("toolbar.button.ol"),name:this.name,when:["listItem","bulletList","orderedList"]}}commands({type:t,schema:e,utils:n}){return()=>n.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^(\d+)\.\s$/,t,(t=>({order:+t[1]})),((t,e)=>e.childCount+e.attrs.order===+t[1]))]}keys({type:t,schema:e,utils:n}){return{"Shift-Ctrl-9":n.toggleList(t,e.nodes.listItem)}}get name(){return"orderedList"}get schema(){return{attrs:{order:{default:1}},content:"listItem+",group:"block",parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1===t.attrs.order?["ol",0]:["ol",{start:t.attrs.order},0]}}}class Fi extends pi{commands(){return{undo:()=>R,redo:()=>z,undoDepth:()=>Y,redoDepth:()=>H}}get defaults(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":R,"Mod-y":z,"Shift-Mod-z":z,"Mod-я":R,"Shift-Mod-я":z}}get name(){return"history"}plugins(){return[U({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}}class Ri extends pi{commands(){return{insertHtml:t=>(e,n)=>{let i=document.createElement("div");i.innerHTML=t.trim();const s=M.fromSchema(e.schema).parse(i);n(e.tr.replaceSelectionWith(s).scrollIntoView())}}}}class zi extends pi{constructor(t={}){super(t)}close(){this.visible=!1,this.emit()}emit(){this.editor.emit("toolbar",{marks:this.marks,nodes:this.nodes,nodeAttrs:this.nodeAttrs,position:this.position,visible:this.visible})}init(){this.position={left:0,bottom:0},this.visible=!1,this.editor.on("blur",(()=>{this.close()})),this.editor.on("deselect",(()=>{this.close()})),this.editor.on("select",(({hasChanged:t})=>{!1!==t?this.open():this.emit()}))}get marks(){return this.editor.activeMarks}get nodes(){return this.editor.activeNodes}get nodeAttrs(){return this.editor.activeNodeAttrs}open(){this.visible=!0,this.reposition(),this.emit()}reposition(){const{from:t,to:e}=this.editor.selection,n=this.editor.view.coordsAtPos(t),i=this.editor.view.coordsAtPos(e,!0),s=this.editor.element.getBoundingClientRect();let o=(n.left+i.left)/2-s.left,r=Math.round(s.bottom-n.top);return this.position={bottom:r,left:o}}get type(){return"toolbar"}}const Yi={props:{activeMarks:{type:Array,default:()=>[]},activeNodes:{type:Array,default:()=>[]},activeNodeAttrs:{type:[Array,Object],default:()=>[]},editor:{type:Object,required:!0},marks:{type:Array},isParagraphNodeHidden:{type:Boolean,default:!1}},computed:{activeButton(){return Object.values(this.nodeButtons).find((t=>this.isButtonActive(t)))||!1},hasVisibleButtons(){const t=Object.keys(this.nodeButtons);return t.length>1||1===t.length&&!1===t.includes("paragraph")},markButtons(){return this.buttons("mark")},nodeButtons(){let t=this.buttons("node");return!0===this.isParagraphNodeHidden&&t.paragraph&&delete t.paragraph,t}},methods:{buttons(t){const e=this.editor.buttons(t);let n=this.sorting;!1!==n&&!1!==Array.isArray(n)||(n=Object.keys(e));let i={};return n.forEach((t=>{e[t]&&(i[t]=e[t])})),i},command(t,...e){this.$emit("command",t,...e)},isButtonActive(t){if("paragraph"===t.name)return 1===this.activeNodes.length&&this.activeNodes.includes(t.name);let e=!0;if(t.attrs){const n=Object.values(this.activeNodeAttrs).find((e=>JSON.stringify(e)===JSON.stringify(t.attrs)));e=Boolean(n||!1)}return!0===e&&this.activeNodes.includes(t.name)},isButtonCurrent(t){return!!this.activeButton&&this.activeButton.id===t.id},isButtonDisabled(t){var e;if(null==(e=this.activeButton)?void 0:e.when){return!1===this.activeButton.when.includes(t.name)}return!1},needDividerAfterNode(t){let e=["paragraph"],n=Object.keys(this.nodeButtons);return(n.includes("bulletList")||n.includes("orderedList"))&&e.push("h6"),e.includes(t.id)}}},Hi={};var Ui=Ft(Yi,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-writer-toolbar"},[t.hasVisibleButtons?n("k-dropdown",{nativeOn:{mousedown:function(t){t.preventDefault()}}},[n("k-button",{class:{"k-writer-toolbar-button k-writer-toolbar-nodes":!0,"k-writer-toolbar-button-active":!!t.activeButton},attrs:{icon:t.activeButton.icon||"title"},on:{click:function(e){return t.$refs.nodes.toggle()}}}),n("k-dropdown-content",{ref:"nodes"},[t._l(t.nodeButtons,(function(e,i){return[n("k-dropdown-item",{key:i,attrs:{current:t.isButtonCurrent(e),disabled:t.isButtonDisabled(e),icon:e.icon},on:{click:function(n){return t.command(e.command||i)}}},[t._v(" "+t._s(e.label)+" ")]),t.needDividerAfterNode(e)?n("hr",{key:i+"-divider"}):t._e()]}))],2)],1):t._e(),t._l(t.markButtons,(function(e,i){return n("k-button",{key:i,class:{"k-writer-toolbar-button":!0,"k-writer-toolbar-button-active":t.activeMarks.includes(i)},attrs:{icon:e.icon,tooltip:e.label},on:{mousedown:function(n){return n.preventDefault(),t.command(e.command||i)}}})}))],2)}),[],!1,Ki,null,null,null);function Ki(t){for(let e in Hi)this[e]=Hi[e]}const Ji={props:{autofocus:Boolean,breaks:Boolean,code:Boolean,disabled:Boolean,emptyDocument:{type:Object,default:()=>({type:"doc",content:[]})},headings:[Array,Boolean],inline:{type:Boolean,default:!1},marks:{type:[Array,Boolean],default:!0},nodes:{type:[Array,Boolean],default:()=>["heading","bulletList","orderedList"]},paste:{type:Function,default:()=>()=>!1},placeholder:String,spellcheck:Boolean,extensions:Array,value:{type:String,default:""}}},Gi={};var Vi=Ft({components:{"k-writer-email-dialog":Si,"k-writer-link-dialog":$i,"k-writer-toolbar":function(){return Ui.exports}()},mixins:[Ji],data(){return{editor:null,json:{},html:this.value,isEmpty:!0,toolbar:!1}},computed:{isParagraphNodeHidden(){return!0===Array.isArray(this.nodes)&&3!==this.nodes.length&&!1===this.nodes.includes("paragraph")}},watch:{value(t,e){t!==e&&t!==this.html&&(this.html=t,this.editor.setContent(this.html))}},mounted(){this.editor=new ki({autofocus:this.autofocus,content:this.value,editable:!this.disabled,element:this.$el,emptyDocument:this.emptyDocument,events:{link:t=>{this.$refs.linkDialog.open(t.getMarkAttrs("link"))},email:()=>{this.$refs.emailDialog.open(this.editor.getMarkAttrs("email"))},paste:this.paste,toolbar:t=>{this.toolbar=t,this.toolbar.visible&&this.$nextTick((()=>{this.onToolbarOpen()}))},update:t=>{if(!this.editor)return;const e=JSON.stringify(this.editor.getJSON());e!==JSON.stringify(this.json)&&(this.json=e,this.isEmpty=t.editor.isEmpty(),this.html=t.editor.getHTML(),this.isEmpty&&(0===t.editor.activeNodes.length||t.editor.activeNodes.includes("paragraph"))&&(this.html=""),this.$emit("input",this.html))}},extensions:[...this.createMarks(),...this.createNodes(),new Fi,new Ri,new zi,...this.extensions||[]],inline:this.inline}),this.isEmpty=this.editor.isEmpty(),this.json=this.editor.getJSON()},beforeDestroy(){this.editor.destroy()},methods:{filterExtensions(t,e,n){!1===e?e=[]:!0!==e&&!1!==Array.isArray(e)||(e=Object.keys(t));let i=[];return e.forEach((e=>{t[e]&&i.push(t[e])})),"function"==typeof n&&(i=n(e,i)),i},command(t,...e){this.editor.command(t,...e)},createMarks(){return this.filterExtensions({bold:new Ei,italic:new Ai,strike:new Mi,underline:new Li,code:new Oi,link:new Ti,email:new Ii},this.marks)},createNodes(){const t=new Di({text:!0,enter:this.inline});return!0===this.inline?[t]:this.filterExtensions({bulletList:new ji,orderedList:new qi,heading:new Bi,horizontalRule:new Pi,listItem:new Ni},this.nodes,((e,n)=>((e.includes("bulletList")||e.includes("orderedList"))&&n.push(new Ni),n.push(t),n)))},getHTML(){return this.editor.getHTML()},focus(){this.editor.focus()},onToolbarOpen(){if(this.$refs.toolbar){const t=this.$el.clientWidth,e=this.$refs.toolbar.$el.clientWidth;let n=this.toolbar.position.left;n-e/2<0&&(n=n+(e/2-n)-20),n+e/2>t&&(n=n-(n+e/2-t)+20),n!==this.toolbar.position.left&&(this.$refs.toolbar.$el.style.left=n+"px")}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"direction",rawName:"v-direction"}],ref:"editor",staticClass:"k-writer",attrs:{"data-empty":t.isEmpty,"data-placeholder":t.placeholder,spellcheck:t.spellcheck}},[t.editor?[t.toolbar.visible?n("k-writer-toolbar",{ref:"toolbar",style:{bottom:t.toolbar.position.bottom+"px","inset-inline-start":t.toolbar.position.left+"px"},attrs:{editor:t.editor,"active-marks":t.toolbar.marks,"active-nodes":t.toolbar.nodes,"active-node-attrs":t.toolbar.nodeAttrs,"is-paragraph-node-hidden":t.isParagraphNodeHidden},on:{command:function(e){return t.editor.command(e)}}}):t._e(),n("k-writer-link-dialog",{ref:"linkDialog",on:{close:function(e){return t.editor.focus()},submit:function(e){return t.editor.command("toggleLink",e)}}}),n("k-writer-email-dialog",{ref:"emailDialog",on:{close:function(e){return t.editor.focus()},submit:function(e){return t.editor.command("toggleEmail",e)}}})]:t._e()],2)}),[],!1,Wi,null,null,null);function Wi(t){for(let e in Gi)this[e]=Gi[e]}var Xi=function(){return Vi.exports}();const Zi={};var Qi=Ft({},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-login-alert",on:{click:function(e){return t.$emit("click")}}},[n("span",[t._t("default")],2),n("k-icon",{attrs:{type:"alert"}})],1)}),[],!1,ts,null,null,null);function ts(t){for(let e in Zi)this[e]=Zi[e]}var es=function(){return Qi.exports}();const ns={};var is=Ft({props:{fields:Object,index:[Number,String],total:Number,value:Object},mounted(){this.$store.dispatch("content/disable"),this.$events.$on("keydown.cmd.s",this.onSubmit),this.$events.$on("keydown.esc",this.onDiscard)},destroyed(){this.$events.$off("keydown.cmd.s",this.onSubmit),this.$events.$off("keydown.esc",this.onDiscard),this.$store.dispatch("content/enable")},methods:{focus(t){this.$refs.form.focus(t)},onDiscard(){this.$emit("discard")},onInput(t){this.$emit("input",t)},onSubmit(){this.$emit("submit")}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-structure-form"},[n("div",{staticClass:"k-structure-backdrop",on:{click:t.onDiscard}}),n("section",[n("k-form",{ref:"form",staticClass:"k-structure-form-fields",attrs:{value:t.value,fields:t.fields},on:{input:t.onInput,submit:t.onSubmit}}),n("footer",{staticClass:"k-structure-form-buttons"},[n("k-button",{staticClass:"k-structure-form-cancel-button",attrs:{text:t.$t("cancel"),icon:"cancel"},on:{click:function(e){return t.$emit("close")}}}),"new"!==t.index?n("k-pagination",{attrs:{dropdown:!1,total:t.total,limit:1,page:t.index+1,details:!0},on:{paginate:function(e){return t.$emit("paginate",e)}}}):t._e(),n("k-button",{staticClass:"k-structure-form-submit-button",attrs:{text:t.$t("new"!==t.index?"confirm":"add"),icon:"check"},on:{click:t.onSubmit}})],1)],1)])}),[],!1,ss,null,null,null);function ss(t){for(let e in ns)this[e]=ns[e]}var os=function(){return is.exports}();const rs=function(t){this.command("insert",((e,n)=>{let i=[];return n.split("\n").forEach(((e,n)=>{let s="ol"===t?n+1+".":"-";i.push(s+" "+e)})),i.join("\n")}))},as={layout:["headlines","bold","italic","|","link","email","file","|","code","ul","ol"],props:{buttons:{type:[Boolean,Array],default:!0},uploads:[Boolean,Object,Array]},data(){let t={},e={},n=[],i=this.commands();return!1===this.buttons?t:(Array.isArray(this.buttons)&&(n=this.buttons),!0!==Array.isArray(this.buttons)&&(n=this.$options.layout),n.forEach(((n,s)=>{if("|"===n)t["divider-"+s]={divider:!0};else if(i[n]){let s=i[n];t[n]=s,s.shortcut&&(e[s.shortcut]=n)}})),{layout:t,shortcuts:e})},methods:{command(t,e){"function"==typeof t?t.apply(this):this.$emit("command",t,e)},close(){Object.keys(this.$refs).forEach((t=>{const e=this.$refs[t][0];"function"==typeof(null==e?void 0:e.close)&&e.close()}))},fileCommandSetup(){let t={label:this.$t("toolbar.button.file"),icon:"attachment"};return!1===this.uploads?t.command="selectFile":t.dropdown={select:{label:this.$t("toolbar.button.file.select"),icon:"check",command:"selectFile"},upload:{label:this.$t("toolbar.button.file.upload"),icon:"upload",command:"uploadFile"}},t},commands(){return{headlines:{label:this.$t("toolbar.button.headings"),icon:"title",dropdown:{h1:{label:this.$t("toolbar.button.heading.1"),icon:"title",command:"prepend",args:"#"},h2:{label:this.$t("toolbar.button.heading.2"),icon:"title",command:"prepend",args:"##"},h3:{label:this.$t("toolbar.button.heading.3"),icon:"title",command:"prepend",args:"###"}}},bold:{label:this.$t("toolbar.button.bold"),icon:"bold",command:"wrap",args:"**",shortcut:"b"},italic:{label:this.$t("toolbar.button.italic"),icon:"italic",command:"wrap",args:"*",shortcut:"i"},link:{label:this.$t("toolbar.button.link"),icon:"url",shortcut:"k",command:"dialog",args:"link"},email:{label:this.$t("toolbar.button.email"),icon:"email",shortcut:"e",command:"dialog",args:"email"},file:this.fileCommandSetup(),code:{label:this.$t("toolbar.button.code"),icon:"code",command:"wrap",args:"`"},ul:{label:this.$t("toolbar.button.ul"),icon:"list-bullet",command(){return rs.apply(this,["ul"])}},ol:{label:this.$t("toolbar.button.ol"),icon:"list-numbers",command(){return rs.apply(this,["ol"])}}}},shortcut(t,e){if(this.shortcuts[t]){const n=this.layout[this.shortcuts[t]];if(!n)return!1;e.preventDefault(),this.command(n.command,n.args)}}}},ls={};var us=Ft(as,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("nav",{staticClass:"k-toolbar"},[n("div",{staticClass:"k-toolbar-wrapper"},[n("div",{staticClass:"k-toolbar-buttons"},[t._l(t.layout,(function(e,i){return[e.divider?[n("span",{key:i,staticClass:"k-toolbar-divider"})]:e.dropdown?[n("k-dropdown",{key:i},[n("k-button",{key:i,staticClass:"k-toolbar-button",attrs:{icon:e.icon,tooltip:e.label,tabindex:"-1"},on:{click:function(e){t.$refs[i+"-dropdown"][0].toggle()}}}),n("k-dropdown-content",{ref:i+"-dropdown",refInFor:!0},t._l(e.dropdown,(function(e,i){return n("k-dropdown-item",{key:i,attrs:{icon:e.icon},on:{click:function(n){return t.command(e.command,e.args)}}},[t._v(" "+t._s(e.label)+" ")])})),1)],1)]:[n("k-button",{key:i,staticClass:"k-toolbar-button",attrs:{icon:e.icon,tooltip:e.label,tabindex:"-1"},on:{click:function(n){return t.command(e.command,e.args)}}})]]}))],2)])])}),[],!1,cs,null,null,null);function cs(t){for(let e in ls)this[e]=ls[e]}var ds=function(){return us.exports}();const ps={};var hs=Ft({data(){return{value:{email:null,text:null},fields:{email:{label:this.$t("email"),type:"email"},text:{label:this.$t("link.text"),type:"text"}}}},computed:{kirbytext(){return this.$config.kirbytext}},methods:{open(t,e){this.value.text=e,this.$refs.dialog.open()},cancel(){this.$emit("cancel")},createKirbytext(){var t;const e=this.value.email||"";return(null==(t=this.value.text)?void 0:t.length)>0?`(email: ${e} text: ${this.value.text})`:`(email: ${e})`},createMarkdown(){var t;const e=this.value.email||"";return(null==(t=this.value.text)?void 0:t.length)>0?`[${this.value.text}](mailto:${e})`:`<${e}>`},submit(){this.$emit("submit",this.kirbytext?this.createKirbytext():this.createMarkdown()),this.value={email:null,text:null},this.$refs.dialog.close()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-dialog",{ref:"dialog",attrs:{"submit-button":t.$t("insert")},on:{close:t.cancel,submit:function(e){return t.$refs.form.submit()}}},[n("k-form",{ref:"form",attrs:{fields:t.fields},on:{submit:t.submit},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}})],1)}),[],!1,fs,null,null,null);function fs(t){for(let e in ps)this[e]=ps[e]}var ms=function(){return hs.exports}();const gs={};var ks=Ft({data(){return{value:{url:null,text:null},fields:{url:{label:this.$t("link"),type:"text",placeholder:this.$t("url.placeholder"),icon:"url"},text:{label:this.$t("link.text"),type:"text"}}}},computed:{kirbytext(){return this.$config.kirbytext}},methods:{open(t,e){this.value.text=e,this.$refs.dialog.open()},cancel(){this.$emit("cancel")},createKirbytext(){return this.value.text.length>0?`(link: ${this.value.url} text: ${this.value.text})`:`(link: ${this.value.url})`},createMarkdown(){return this.value.text.length>0?`[${this.value.text}](${this.value.url})`:`<${this.value.url}>`},submit(){this.$emit("submit",this.kirbytext?this.createKirbytext():this.createMarkdown()),this.value={url:null,text:null},this.$refs.dialog.close()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-dialog",{ref:"dialog",attrs:{"submit-button":t.$t("insert")},on:{close:t.cancel,submit:function(e){return t.$refs.form.submit()}}},[n("k-form",{ref:"form",attrs:{fields:t.fields},on:{submit:t.submit},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}})],1)}),[],!1,vs,null,null,null);function vs(t){for(let e in gs)this[e]=gs[e]}var bs=function(){return ks.exports}();const ys={mixins:[vn,yn,_n,wn,Cn],inheritAttrs:!1,props:{value:Boolean},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onChange(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||K.required}}}},$s={};var _s=Ft(ys,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("label",{staticClass:"k-checkbox-input",on:{click:function(t){t.stopPropagation()}}},[n("input",{ref:"input",staticClass:"k-checkbox-input-native input-hidden",attrs:{id:t.id,disabled:t.disabled,type:"checkbox"},domProps:{checked:t.value},on:{change:function(e){return t.onChange(e.target.checked)}}}),n("span",{staticClass:"k-checkbox-input-icon",attrs:{"aria-hidden":"true"}},[n("svg",{attrs:{width:"12",height:"10",viewBox:"0 0 12 10",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M1 5l3.3 3L11 1","stroke-width":"2",fill:"none","fill-rule":"evenodd"}})])]),n("span",{staticClass:"k-checkbox-input-label",domProps:{innerHTML:t._s(t.label)}})])}),[],!1,xs,null,null,null);function xs(t){for(let e in $s)this[e]=$s[e]}var ws=function(){return _s.exports}();const Ss={mixins:[vn,yn,_n,Cn],props:{columns:Number,max:Number,min:Number,options:Array,value:{type:[Array,Object],default:()=>[]}}},Cs={};var Os=Ft({mixins:[Ss],inheritAttrs:!1,data(){return{selected:this.valueToArray(this.value)}},watch:{value(t){this.selected=this.valueToArray(t)},selected(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$el.querySelector("input").focus()},onInput(t,e){if(!0===e)this.selected.push(t);else{const e=this.selected.indexOf(t);-1!==e&&this.selected.splice(e,1)}this.$emit("input",this.selected)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()},valueToArray:t=>!0===Array.isArray(t)?t:"string"==typeof t?String(t).split(","):"object"==typeof t?Object.values(t):void 0},validations(){return{selected:{required:!this.required||K.required,min:!this.min||K.minLength(this.min),max:!this.max||K.maxLength(this.max)}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",{staticClass:"k-checkboxes-input",style:"--columns:"+t.columns},t._l(t.options,(function(e,i){return n("li",{key:i},[n("k-checkbox-input",{attrs:{id:t.id+"-"+i,label:e.text,value:-1!==t.selected.indexOf(e.value)},on:{input:function(n){return t.onInput(e.value,n)}}})],1)})),0)}),[],!1,Es,null,null,null);function Es(t){for(let e in Cs)this[e]=Cs[e]}var As=function(){return Os.exports}();const Ts={mixins:[vn,yn,_n,Cn],props:{display:{type:String,default:"DD.MM.YYYY"},max:String,min:String,step:{type:Object,default:()=>({size:1,unit:"day"})},type:{type:String,default:"date"},value:String}},Is={};var Ms=Ft({mixins:[Ts],inheritAttrs:!1,data:()=>({dt:null,formatted:null}),computed:{inputType:()=>"date",pattern(){return this.$library.dayjs.pattern(this.display)},rounding(){return a(a({},this.$options.props.step.default()),this.step)}},watch:{value:{handler(t,e){if(t!==e){const e=this.toDatetime(t);this.commit(e)}},immediate:!0}},created(){this.$events.$on("keydown.cmd.s",this.onBlur)},destroyed(){this.$events.$off("keydown.cmd.s",this.onBlur)},methods:{alter(t){let e=this.parse()||this.round(this.$library.dayjs()),n=this.rounding.unit,i=this.rounding.size;const s=this.selection();null!==s&&("meridiem"===s.unit?(t="pm"===e.format("a")?"subtract":"add",n="hour",i=12):(n=s.unit,n!==this.rounding.unit&&(i=1))),e=e[t](i,n).round(this.rounding.unit,this.rounding.size),this.commit(e),this.emit(e),this.$nextTick((()=>this.select(s)))},commit(t){this.dt=t,this.formatted=this.pattern.format(t),this.$emit("invalid",this.$v.$invalid,this.$v)},emit(t){this.$emit("input",this.toISO(t))},focus(){this.$refs.input.focus()},onArrowDown(){this.alter("subtract")},onArrowUp(){this.alter("add")},onBlur(){const t=this.parse();this.commit(t),this.emit(t)},onEnter(){this.onBlur(),this.$nextTick((()=>this.$emit("submit")))},onInput(t){const e=this.parse(),n=this.pattern.format(e);if(!t||n==t)return this.commit(e),this.emit(e)},onTab(t){""!=this.$refs.input.value&&(this.onBlur(),this.$nextTick((()=>{const e=this.selection();if(this.$refs.input&&e.start===this.$refs.input.selectionStart&&e.end===this.$refs.input.selectionEnd-1)if(t.shiftKey){if(0===e.index)return;this.selectPrev(e.index)}else{if(e.index===this.pattern.parts.length-1)return;this.selectNext(e.index)}else t.shiftKey?this.selectLast():this.selectFirst();t.preventDefault()})))},parse(){let t=this.$refs.input.value;return t=this.$library.dayjs.interpret(t,this.inputType),this.round(t)},round(t){return(null==t?void 0:t.round(this.rounding.unit,this.rounding.size))||null},select(t){var e;t||(t=this.selection()),null==(e=this.$refs.input)||e.setSelectionRange(t.start,t.end+1)},selectFirst(){this.select(this.pattern.parts[0])},selectLast(){this.select(this.pattern.parts[this.pattern.parts.length-1])},selectNext(t){this.select(this.pattern.parts[t+1])},selectPrev(t){this.select(this.pattern.parts[t-1])},selection(){return this.pattern.at(this.$refs.input.selectionStart,this.$refs.input.selectionEnd)},toDatetime(t){return this.round(this.$library.dayjs.iso(t,this.inputType))},toISO(t){return(null==t?void 0:t.toISO(this.inputType))||null}},validations(){return{value:{min:!this.dt||!this.min||(()=>this.dt.validate(this.min,"min",this.rounding.unit)),max:!this.dt||!this.max||(()=>this.dt.validate(this.max,"max",this.rounding.unit)),required:!this.required||(()=>!!this.dt)}}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{directives:[{name:"model",rawName:"v-model",value:t.formatted,expression:"formatted"},{name:"direction",rawName:"v-direction"}],ref:"input",class:`k-text-input k-${t.type}-input`,attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled,placeholder:t.display,required:t.required,autocomplete:"off",spellcheck:"false",type:"text"},domProps:{value:t.formatted},on:{blur:t.onBlur,focus:function(e){return t.$emit("focus")},input:[function(e){e.target.composing||(t.formatted=e.target.value)},function(e){return t.onInput(e.target.value)}],keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.stopPropagation(),e.preventDefault(),t.onArrowDown.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.stopPropagation(),e.preventDefault(),t.onArrowUp.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:t.onTab.apply(null,arguments)}]}})}),[],!1,Ls,null,null,null);function Ls(t){for(let e in Is)this[e]=Is[e]}var js=function(){return Ms.exports}();const Ds={mixins:[vn,yn,_n,Sn,Cn],props:{autocomplete:{type:[Boolean,String],default:"off"},maxlength:Number,minlength:Number,pattern:String,placeholder:String,preselect:Boolean,spellcheck:{type:[Boolean,String],default:"off"},type:{type:String,default:"text"},value:String}},Bs={};var Ps=Ft({mixins:[Ds],inheritAttrs:!1,data(){return{listeners:l(a({},this.$listeners),{input:t=>this.onInput(t.target.value)})}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.$refs.input.select()}},validations(){return{value:{required:!this.required||K.required,minLength:!this.minlength||K.minLength(this.minlength),maxLength:!this.maxlength||K.maxLength(this.maxlength),email:"email"!==this.type||K.email,url:"url"!==this.type||K.url,pattern:!this.pattern||(t=>!this.required&&!t||!this.$refs.input.validity.patternMismatch)}}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",t._g(t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-text-input"},"input",{autocomplete:t.autocomplete,autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,type:t.type,value:t.value},!1),t.listeners))}),[],!1,Ns,null,null,null);function Ns(t){for(let e in Bs)this[e]=Bs[e]}var qs=function(){return Ps.exports}();const Fs={mixins:[Ds],props:{autocomplete:{type:String,default:"email"},placeholder:{type:String,default:()=>window.panel.$t("email.placeholder")},type:{type:String,default:"email"}}};const Rs={};var zs=Ft({extends:qs,mixins:[Fs]},undefined,undefined,!1,Ys,null,null,null);function Ys(t){for(let e in Rs)this[e]=Rs[e]}var Hs=function(){return zs.exports}();class Us extends fi{get schema(){return{content:"bulletList|orderedList"}}}const Ks={inheritAttrs:!1,props:{autofocus:Boolean,marks:{type:[Array,Boolean],default:!0},value:String},data(){return{list:this.value,html:this.value}},computed:{extensions:()=>[new Us({inline:!0})]},watch:{value(t){t!==this.html&&(this.list=t,this.html=t)}},methods:{focus(){this.$refs.input.focus()},onInput(t){let e=(new DOMParser).parseFromString(t,"text/html").querySelector("ul, ol");e&&0!==e.textContent.trim().length?(this.list=t,this.html=t.replace(/(|<\/p>)/gi,""),this.$emit("input",this.html)):this.$emit("input",this.list="")}}},Js={};var Gs=Ft(Ks,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("k-writer",t._b({ref:"input",staticClass:"k-list-input",attrs:{extensions:t.extensions,nodes:["bulletList","orderedList"],value:t.list},on:{input:t.onInput}},"k-writer",t.$props,!1))}),[],!1,Vs,null,null,null);function Vs(t){for(let e in Js)this[e]=Js[e]}var Ws=function(){return Gs.exports}();const Xs={mixins:[yn,_n,Cn],props:{max:Number,min:Number,layout:String,options:{type:Array,default:()=>[]},search:[Object,Boolean],separator:{type:String,default:","},sort:Boolean,value:{type:Array,required:!0,default:()=>[]}}},Zs={};var Qs=Ft({mixins:[Xs],inheritAttrs:!1,data(){return{state:this.value,q:null,limit:!0,scrollTop:0}},computed:{draggable(){return this.state.length>1&&!this.sort},dragOptions(){return{disabled:!this.draggable,draggable:".k-tag",delay:1}},emptyLabel(){return this.q?this.$t("search.results.none"):this.$t("options.none")},filtered(){var t;return(null==(t=this.q)?void 0:t.length)>=(this.search.min||0)?this.options.filter((t=>this.isFiltered(t))).map((t=>l(a({},t),{display:this.toHighlightedString(t.text),info:this.toHighlightedString(t.value)}))):this.options.map((t=>l(a({},t),{display:t.text,info:t.value})))},more(){return!this.max||this.state.lengththis.options.findIndex((e=>e.value===t.value));return t.sort(((t,n)=>e(t)-e(n)))},visible(){return this.limit?this.filtered.slice(0,this.search.display||this.filtered.length):this.filtered}},watch:{value(t){this.state=t,this.onInvalid()}},mounted(){this.onInvalid(),this.$events.$on("click",this.close),this.$events.$on("keydown.cmd.s",this.close)},destroyed(){this.$events.$off("click",this.close),this.$events.$off("keydown.cmd.s",this.close)},methods:{add(t){!0===this.more&&(this.state.push(t),this.onInput())},blur(){this.close()},close(){!0===this.$refs.dropdown.isOpen&&(this.$refs.dropdown.close(),this.limit=!0)},escape(){this.q?this.q=null:this.close()},focus(){this.$refs.dropdown.open()},index(t){return this.state.findIndex((e=>e.value===t.value))},isFiltered(t){return String(t.text).match(this.regex)||String(t.value).match(this.regex)},isSelected(t){return-1!==this.index(t)},navigate(t){var e,n,i;"prev"===t&&(t="previous"),null==(i=null==(n=null==(e=document.activeElement)?void 0:e[t+"Sibling"])?void 0:n.focus)||i.call(n)},onClose(){!1===this.$refs.dropdown.isOpen&&(document.activeElement===this.$parent.$el&&(this.q=null),this.$parent.$el.focus())},onInput(){this.$emit("input",this.sorted)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onOpen(){this.$nextTick((()=>{var t,e;null==(e=null==(t=this.$refs.search)?void 0:t.focus)||e.call(t),this.$refs.dropdown.$el.querySelector(".k-multiselect-options").scrollTop=this.scrollTop}))},remove(t){this.state.splice(this.index(t),1),this.onInput()},select(t){this.scrollTop=this.$refs.dropdown.$el.querySelector(".k-multiselect-options").scrollTop,t={text:t.text,value:t.value},this.isSelected(t)?this.remove(t):this.add(t)},toHighlightedString(t){return(t=this.$helper.string.stripHTML(t)).replace(this.regex,"$1")}},validations(){return{state:{required:!this.required||K.required,minLength:!this.min||K.minLength(this.min),maxLength:!this.max||K.maxLength(this.max)}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-draggable",{staticClass:"k-multiselect-input",attrs:{list:t.state,options:t.dragOptions,"data-layout":t.layout,element:"k-dropdown"},on:{end:t.onInput},nativeOn:{click:function(e){return t.$refs.dropdown.toggle.apply(null,arguments)}},scopedSlots:t._u([{key:"footer",fn:function(){return[n("k-dropdown-content",{ref:"dropdown",on:{open:t.onOpen,close:t.onClose},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:(e.stopPropagation(),t.close.apply(null,arguments))}}},[t.search?n("k-dropdown-item",{staticClass:"k-multiselect-search",attrs:{icon:"search"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.q,expression:"q"}],ref:"search",attrs:{placeholder:t.search.min?t.$t("search.min",{min:t.search.min}):t.$t("search")+" …"},domProps:{value:t.q},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:(e.stopPropagation(),t.escape.apply(null,arguments))},input:function(e){e.target.composing||(t.q=e.target.value)}}})]):t._e(),n("div",{staticClass:"k-multiselect-options scroll-y-auto"},[t._l(t.visible,(function(e){return n("k-dropdown-item",{key:e.value,class:{"k-multiselect-option":!0,selected:t.isSelected(e),disabled:!t.more},attrs:{icon:t.isSelected(e)?"check":"circle-outline"},on:{click:function(n){return n.preventDefault(),t.select(e)}},nativeOn:{keydown:[function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"enter",13,n.key,"Enter")?null:(n.preventDefault(),n.stopPropagation(),t.select(e))},function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"space",32,n.key,[" ","Spacebar"])?null:(n.preventDefault(),n.stopPropagation(),t.select(e))}]}},[n("span",{domProps:{innerHTML:t._s(e.display)}}),n("span",{staticClass:"k-multiselect-value",domProps:{innerHTML:t._s(e.info)}})])})),0===t.filtered.length?n("k-dropdown-item",{staticClass:"k-multiselect-option",attrs:{disabled:!0}},[t._v(" "+t._s(t.emptyLabel)+" ")]):t._e()],2),t.visible.lengththis.onInput(t.target.value),blur:this.onBlur})}},watch:{value(t){this.number=t},number:{immediate:!0,handler(){this.onInvalid()}}},mounted(){this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{decimals(){const t=Number(this.step||0);return Math.floor(t)===t?0:-1!==t.toString().indexOf("e")?parseInt(t.toFixed(16).split(".")[1].split("").reverse().join("")).toString().length:t.toString().split(".")[1].length||0},format(t){if(isNaN(t)||""===t)return"";const e=this.decimals();return t=e?parseFloat(t).toFixed(e):Number.isInteger(this.step)?parseInt(t):parseFloat(t)},clean(){this.number=this.format(this.number)},emit(t){t=parseFloat(t),isNaN(t)&&(t=""),t!==this.value&&this.$emit("input",t)},focus(){this.$refs.input.focus()},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.number=t,this.emit(t)},onBlur(){this.clean(),this.emit(this.number)},select(){this.$refs.input.select()}},validations(){return{value:{required:!this.required||K.required,min:!this.min||K.minValue(this.min),max:!this.max||K.maxValue(this.max)}}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",t._g(t._b({ref:"input",staticClass:"k-number-input",attrs:{step:t.stepNumber,type:"number"},domProps:{value:t.number},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.ctrlKey?t.clean.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?t.clean.apply(null,arguments):null}]}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,max:t.max,min:t.min,name:t.name,placeholder:t.placeholder,required:t.required},!1),t.listeners))}),[],!1,oo,null,null,null);function oo(t){for(let e in io)this[e]=io[e]}var ro=function(){return so.exports}();const ao={mixins:[Ds],props:{autocomplete:{type:String,default:"new-password"},type:{type:String,default:"password"}}};const lo={};var uo=Ft({extends:qs,mixins:[ao]},undefined,undefined,!1,co,null,null,null);function co(t){for(let e in lo)this[e]=lo[e]}var po=function(){return uo.exports}();const ho={mixins:[vn,yn,_n,Cn],props:{columns:Number,options:Array,value:[String,Number,Boolean]}},fo={};var mo=Ft({mixins:[ho],inheritAttrs:!1,watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$el.querySelector("input").focus()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||K.required}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",{staticClass:"k-radio-input",style:"--columns:"+t.columns},t._l(t.options,(function(e,i){return n("li",{key:i},[n("input",{staticClass:"k-radio-input-native",attrs:{id:t.id+"-"+i,name:t.id,type:"radio"},domProps:{value:e.value,checked:t.value===e.value},on:{change:function(n){return t.onInput(e.value)}}}),e.info?n("label",{attrs:{for:t.id+"-"+i}},[n("span",{staticClass:"k-radio-input-text",domProps:{innerHTML:t._s(e.text)}}),n("span",{staticClass:"k-radio-input-info",domProps:{innerHTML:t._s(e.info)}})]):n("label",{attrs:{for:t.id+"-"+i},domProps:{innerHTML:t._s(e.text)}}),e.icon?n("k-icon",{attrs:{type:e.icon}}):t._e()],1)})),0)}),[],!1,go,null,null,null);function go(t){for(let e in fo)this[e]=fo[e]}var ko=function(){return mo.exports}();const vo={mixins:[vn,yn,_n,Sn,Cn],props:{default:[Number,String],max:{type:Number,default:100},min:{type:Number,default:0},step:{type:Number,default:1},tooltip:{type:[Boolean,Object],default:()=>({before:null,after:null})},value:[Number,String]}},bo={};var yo=Ft({mixins:[vo],inheritAttrs:!1,data(){return{listeners:l(a({},this.$listeners),{input:t=>this.onInput(t.target.value)})}},computed:{baseline(){return this.min<0?0:this.min},label(){return this.required||this.value||0===this.value?this.format(this.position):"–"},position(){return this.value||0===this.value?this.value:this.default||this.baseline}},watch:{position(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},format(t){const e=document.lang?document.lang.replace("_","-"):"en",n=this.step.toString().split("."),i=n.length>1?n[1].length:0;return new Intl.NumberFormat(e,{minimumFractionDigits:i}).format(t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.$emit("input",t)}},validations(){return{position:{required:!this.required||K.required,min:!this.min||K.minValue(this.min),max:!this.max||K.maxValue(this.max)}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("label",{staticClass:"k-range-input"},[n("input",t._g(t._b({ref:"input",staticClass:"k-range-input-native",style:`--min: ${t.min}; --max: ${t.max}; --value: ${t.position}`,attrs:{type:"range"},domProps:{value:t.position}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,max:t.max,min:t.min,name:t.name,required:t.required,step:t.step},!1),t.listeners)),t.tooltip?n("span",{staticClass:"k-range-input-tooltip"},[t.tooltip.before?n("span",{staticClass:"k-range-input-tooltip-before"},[t._v(t._s(t.tooltip.before))]):t._e(),n("span",{staticClass:"k-range-input-tooltip-text"},[t._v(t._s(t.label))]),t.tooltip.after?n("span",{staticClass:"k-range-input-tooltip-after"},[t._v(t._s(t.tooltip.after))]):t._e()]):t._e()])}),[],!1,$o,null,null,null);function $o(t){for(let e in bo)this[e]=bo[e]}var _o=function(){return yo.exports}();const xo={mixins:[vn,yn,_n,Sn,Cn],props:{ariaLabel:String,default:String,empty:{type:[Boolean,String],default:!0},placeholder:String,options:{type:Array,default:()=>[]},value:{type:[String,Number,Boolean],default:""}}},wo={};var So=Ft({mixins:[xo],inheritAttrs:!1,data(){return{selected:this.value,listeners:l(a({},this.$listeners),{click:t=>this.onClick(t),change:t=>this.onInput(t.target.value),input:()=>{}})}},computed:{emptyOption(){return this.placeholder||"—"},hasEmptyOption(){return!1!==this.empty&&!(this.required&&this.default)},label(){const t=this.text(this.selected);return""===this.selected||null===this.selected||null===t?this.emptyOption:t}},watch:{value(t){this.selected=t,this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onClick(t){t.stopPropagation(),this.$emit("click",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.selected=t,this.$emit("input",this.selected)},select(){this.focus()},text(t){let e=null;return this.options.forEach((n=>{n.value==t&&(e=n.text)})),e}},validations(){return{selected:{required:!this.required||K.required}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{staticClass:"k-select-input",attrs:{"data-disabled":t.disabled,"data-empty":""===t.selected}},[n("select",t._g({ref:"input",staticClass:"k-select-input-native",attrs:{id:t.id,autofocus:t.autofocus,"aria-label":t.ariaLabel,disabled:t.disabled,name:t.name,required:t.required},domProps:{value:t.selected}},t.listeners),[t.hasEmptyOption?n("option",{attrs:{disabled:t.required,value:""}},[t._v(" "+t._s(t.emptyOption)+" ")]):t._e(),t._l(t.options,(function(e){return n("option",{key:e.value,attrs:{disabled:e.disabled},domProps:{value:e.value}},[t._v(" "+t._s(e.text)+" ")])}))],2),t._v(" "+t._s(t.label)+" ")])}),[],!1,Co,null,null,null);function Co(t){for(let e in wo)this[e]=wo[e]}var Oo=function(){return So.exports}();const Eo={mixins:[Ds],props:{allow:{type:String,default:""},formData:{type:Object,default:()=>({})},sync:{type:String}}},Ao={};var To=Ft({extends:qs,mixins:[Eo],data(){return{slug:this.sluggify(this.value),slugs:this.$language?this.$language.rules:this.$system.slugs,syncValue:null}},watch:{formData:{handler(t){return!this.disabled&&(!(!this.sync||void 0===t[this.sync])&&(t[this.sync]!=this.syncValue&&(this.syncValue=t[this.sync],void this.onInput(this.sluggify(this.syncValue)))))},deep:!0,immediate:!0},value(t){(t=this.sluggify(t))!==this.slug&&(this.slug=t,this.$emit("input",this.slug))}},methods:{sluggify(t){return this.$helper.slug(t,[this.slugs,this.$system.ascii],this.allow)},onInput(t){this.slug=this.sluggify(t),this.$emit("input",this.slug)}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",t._g(t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-text-input",attrs:{autocomplete:"off",spellcheck:"false",type:"text"},domProps:{value:t.slug}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required},!1),t.listeners))}),[],!1,Io,null,null,null);function Io(t){for(let e in Ao)this[e]=Ao[e]}var Mo=function(){return To.exports}();const Lo={mixins:[vn,yn,_n,Sn,Cn],props:{accept:{type:String,default:"all"},icon:{type:[String,Boolean],default:"tag"},layout:String,max:Number,min:Number,options:{type:Array,default:()=>[]},separator:{type:String,default:","},value:{type:Array,default:()=>[]}}},jo={};var Do=Ft({mixins:[Lo],inheritAttrs:!1,data(){return{tags:this.prepareTags(this.value),selected:null,newTag:null,tagOptions:this.options.map((t=>{var e;return(null==(e=this.icon)?void 0:e.length)>0&&(t.icon=this.icon),t}),this)}},computed:{dragOptions(){return{delay:1,disabled:!this.draggable,draggable:".k-tag"}},draggable(){return this.tags.length>1},skip(){return this.tags.map((t=>t.value))}},watch:{value(t){this.tags=this.prepareTags(t),this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{addString(t){if(t)if((t=t.trim()).includes(this.separator))t.split(this.separator).forEach((t=>{this.addString(t)}));else if(0!==t.length)if("options"===this.accept){const e=this.options.filter((e=>e.text===t))[0];if(!e)return;this.addTag(e)}else this.addTag({text:t,value:t})},addTag(t){this.addTagToIndex(t),this.$refs.autocomplete.close(),this.$refs.input.focus()},addTagToIndex(t){if("options"===this.accept){if(!this.options.filter((e=>e.value===t.value))[0])return}-1===this.index(t)&&(!this.max||this.tags.length=this.tags.length)return;break;case"first":e=0;break;case"last":e=this.tags.length-1;break;default:e=t}let i=this.tags[e];if(i){let t=this.$refs[i.value];if(null==t?void 0:t[0])return{ref:t[0],tag:i,index:e}}return!1},index(t){return this.tags.findIndex((e=>e.value===t.value))},onInput(){this.$emit("input",this.tags)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},leaveInput(t){0===t.target.selectionStart&&t.target.selectionStart===t.target.selectionEnd&&0!==this.tags.length&&(this.$refs.autocomplete.close(),this.navigate("last"),t.preventDefault())},navigate(t){var e=this.get(t);e?(e.ref.focus(),this.selectTag(e.tag)):"next"===t&&(this.$refs.input.focus(),this.selectTag(null))},prepareTags:t=>!1===Array.isArray(t)?[]:t.map((t=>"string"==typeof t?{text:t,value:t}:t)),remove(t){const e=this.get("prev"),n=this.get("next");this.tags.splice(this.index(t),1),this.onInput(),e?(this.selectTag(e.tag),e.ref.focus()):n?this.selectTag(n.tag):(this.selectTag(null),this.$refs.input.focus())},select(){this.focus()},selectTag(t){this.selected=t},tab(t){var e;(null==(e=this.newTag)?void 0:e.length)>0&&(t.preventDefault(),this.addString(this.newTag))},type(t){this.newTag=t,this.$refs.autocomplete.search(t)}},validations(){return{tags:{required:!this.required||K.required,minLength:!this.min||K.minLength(this.min),maxLength:!this.max||K.maxLength(this.max)}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-draggable",{directives:[{name:"direction",rawName:"v-direction"}],ref:"box",staticClass:"k-tags-input",attrs:{list:t.tags,"data-layout":t.layout,options:t.dragOptions},on:{end:t.onInput},scopedSlots:t._u([{key:"footer",fn:function(){return[n("span",{staticClass:"k-tags-input-element"},[n("k-autocomplete",{ref:"autocomplete",attrs:{html:!0,options:t.options,skip:t.skip},on:{select:t.addTag,leave:function(e){return t.$refs.input.focus()}}},[n("input",{directives:[{name:"model",rawName:"v-model.trim",value:t.newTag,expression:"newTag",modifiers:{trim:!0}}],ref:"input",attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled||t.max&&t.tags.length>=t.max,name:t.name,autocomplete:"off",type:"text"},domProps:{value:t.newTag},on:{input:[function(e){e.target.composing||(t.newTag=e.target.value.trim())},function(e){return t.type(e.target.value)}],blur:[t.blurInput,function(e){return t.$forceUpdate()}],keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?t.blurInput.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.leaveInput.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.enter.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.tab.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.leaveInput.apply(null,arguments)}]}})])],1)]},proxy:!0}])},t._l(t.tags,(function(e,i){return n("k-tag",{key:i,ref:e.value,refInFor:!0,attrs:{removable:!t.disabled,name:"tag"},on:{remove:function(n){return t.remove(e)}},nativeOn:{click:function(t){t.stopPropagation()},blur:function(e){return t.selectTag(null)},focus:function(n){return t.selectTag(e)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:t.navigate("prev")},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:t.navigate("next")}],dblclick:function(n){return t.edit(e)}}},[n("span",{domProps:{innerHTML:t._s(e.text)}})])})),1)}),[],!1,Bo,null,null,null);function Bo(t){for(let e in jo)this[e]=jo[e]}var Po=function(){return Do.exports}();const No={mixins:[Ds],props:{autocomplete:{type:String,default:"tel"},type:{type:String,default:"tel"}}};const qo={};var Fo=Ft({extends:qs,mixins:[No]},undefined,undefined,!1,Ro,null,null,null);function Ro(t){for(let e in qo)this[e]=qo[e]}var zo=function(){return Fo.exports}();const Yo={mixins:[vn,yn,_n,Sn,Cn],props:{buttons:{type:[Boolean,Array],default:!0},endpoints:Object,font:String,maxlength:Number,minlength:Number,placeholder:String,preselect:Boolean,size:String,spellcheck:{type:[Boolean,String],default:"off"},theme:String,uploads:[Boolean,Object,Array],value:String}},Ho={};var Uo=Ft({mixins:[Yo],inheritAttrs:!1,data:()=>({over:!1}),watch:{value(){this.onInvalid(),this.$nextTick((()=>{this.resize()}))}},mounted(){this.$nextTick((()=>{this.$library.autosize(this.$refs.input)})),this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{cancel(){this.$refs.input.focus()},dialog(t){if(!this.$refs[t+"Dialog"])throw"Invalid toolbar dialog";this.$refs[t+"Dialog"].open(this.$refs.input,this.selection())},focus(){this.$refs.input.focus()},insert(t){const e=this.$refs.input,n=e.value;setTimeout((()=>{if(e.focus(),document.execCommand("insertText",!1,t),e.value===n){const n=e.value.slice(0,e.selectionStart)+t+e.value.slice(e.selectionEnd);e.value=n,this.$emit("input",n)}})),this.resize()},insertFile(t){(null==t?void 0:t.length)>0&&this.insert(t.map((t=>t.dragText)).join("\n\n"))},insertUpload(t,e){this.insert(e.map((t=>t.dragText)).join("\n\n")),this.$events.$emit("model.update")},onClick(){this.$refs.toolbar&&this.$refs.toolbar.close()},onCommand(t,e){"function"==typeof this[t]?"function"==typeof e?this[t](e(this.$refs.input,this.selection())):this[t](e):window.console.warn(t+" is not a valid command")},onDrop(t){if(this.uploads&&this.$helper.isUploadEvent(t))return this.$refs.fileUpload.drop(t.dataTransfer.files,{url:this.$urls.api+"/"+this.endpoints.field+"/upload",multiple:!1});const e=this.$store.state.drag;"text"===(null==e?void 0:e.type)&&(this.focus(),this.insert(e.data))},onFocus(t){this.$emit("focus",t)},onInput(t){this.$emit("input",t.target.value)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onOut(){this.$refs.input.blur(),this.over=!1},onOver(t){if(this.uploads&&this.$helper.isUploadEvent(t))return t.dataTransfer.dropEffect="copy",this.focus(),void(this.over=!0);const e=this.$store.state.drag;"text"===(null==e?void 0:e.type)&&(t.dataTransfer.dropEffect="copy",this.focus(),this.over=!0)},onShortcut(t){!1!==this.buttons&&"Meta"!==t.key&&"Control"!==t.key&&this.$refs.toolbar&&this.$refs.toolbar.shortcut(t.key,t)},onSubmit(t){return this.$emit("submit",t)},prepend(t){this.insert(t+" "+this.selection())},resize(){this.$library.autosize.update(this.$refs.input)},select(){this.$refs.select()},selectFile(){this.$refs.fileDialog.open({endpoint:this.endpoints.field+"/files",multiple:!1})},selection(){const t=this.$refs.input,e=t.selectionStart,n=t.selectionEnd;return t.value.substring(e,n)},uploadFile(){this.$refs.fileUpload.open({url:this.$urls.api+"/"+this.endpoints.field+"/upload",multiple:!1})},wrap(t){this.insert(t+this.selection()+t)}},validations(){return{value:{required:!this.required||K.required,minLength:!this.minlength||K.minLength(this.minlength),maxLength:!this.maxlength||K.maxLength(this.maxlength)}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-textarea-input",attrs:{"data-over":t.over,"data-size":t.size,"data-theme":t.theme}},[n("div",{staticClass:"k-textarea-input-wrapper"},[t.buttons&&!t.disabled?n("k-toolbar",{ref:"toolbar",attrs:{buttons:t.buttons,disabled:t.disabled,uploads:t.uploads},on:{command:t.onCommand},nativeOn:{mousedown:function(t){t.preventDefault()}}}):t._e(),n("textarea",t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-textarea-input-native",attrs:{"data-font":t.font},on:{click:t.onClick,focus:t.onFocus,input:t.onInput,keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.metaKey?t.onSubmit.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.ctrlKey?t.onSubmit.apply(null,arguments):null},function(e){return e.metaKey?t.onShortcut.apply(null,arguments):null},function(e){return e.ctrlKey?t.onShortcut.apply(null,arguments):null}],dragover:t.onOver,dragleave:t.onOut,drop:t.onDrop}},"textarea",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,value:t.value},!1))],1),n("k-toolbar-email-dialog",{ref:"emailDialog",on:{cancel:t.cancel,submit:function(e){return t.insert(e)}}}),n("k-toolbar-link-dialog",{ref:"linkDialog",on:{cancel:t.cancel,submit:function(e){return t.insert(e)}}}),n("k-files-dialog",{ref:"fileDialog",on:{cancel:t.cancel,submit:function(e){return t.insertFile(e)}}}),t.uploads?n("k-upload",{ref:"fileUpload",on:{success:t.insertUpload}}):t._e()],1)}),[],!1,Ko,null,null,null);function Ko(t){for(let e in Ho)this[e]=Ho[e]}var Jo=function(){return Uo.exports}();const Go={props:{display:{type:String,default:"HH:mm"},max:String,min:String,step:{type:Object,default:()=>({size:5,unit:"minute"})},type:{type:String,default:"time"},value:String}};const Vo={};var Wo=Ft({mixins:[js,Go],computed:{inputType:()=>"time"}},undefined,undefined,!1,Xo,null,null,null);function Xo(t){for(let e in Vo)this[e]=Vo[e]}var Zo=function(){return Wo.exports}();const Qo={props:{autofocus:Boolean,disabled:Boolean,id:[Number,String],text:{type:[Array,String]},required:Boolean,value:Boolean}},tr={};var er=Ft({mixins:[Qo],inheritAttrs:!1,computed:{label(){const t=this.text||[this.$t("off"),this.$t("on")];return Array.isArray(t)?this.value?t[1]:t[0]:t}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onEnter(t){"Enter"===t.key&&this.$refs.input.click()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.$refs.input.focus()}},validations(){return{value:{required:!this.required||K.required}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("label",{staticClass:"k-toggle-input",attrs:{"data-disabled":t.disabled}},[n("input",{ref:"input",staticClass:"k-toggle-input-native",attrs:{id:t.id,disabled:t.disabled,type:"checkbox"},domProps:{checked:t.value},on:{change:function(e){return t.onInput(e.target.checked)}}}),n("span",{staticClass:"k-toggle-input-label",domProps:{innerHTML:t._s(t.label)}})])}),[],!1,nr,null,null,null);function nr(t){for(let e in tr)this[e]=tr[e]}var ir=function(){return er.exports}();const sr={mixins:[vn,yn,_n,Cn],props:{columns:Number,grow:Boolean,labels:Boolean,options:Array,reset:Boolean,value:[String,Number,Boolean]}},or={};var rr=Ft({inheritAttrs:!1,mixins:[sr],watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){(this.$el.querySelector("input[checked]")||this.$el.querySelector("input")).focus()},onClick(t){t===this.value&&this.reset&&!this.required&&this.$emit("input","")},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||K.required}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",{staticClass:"k-toggles-input",style:"--options:"+(t.columns||t.options.length),attrs:{"data-invalid":t.$v.$invalid,"data-labels":t.labels}},t._l(t.options,(function(e,i){return n("li",{key:i},[n("input",{staticClass:"input-hidden",attrs:{id:t.id+"-"+i,name:t.id,type:"radio"},domProps:{value:e.value,checked:t.value===e.value},on:{click:function(n){return t.onClick(e.value)},change:function(n){return t.onInput(e.value)}}}),n("label",{attrs:{for:t.id+"-"+i,title:e.text}},[e.icon?n("k-icon",{attrs:{type:e.icon}}):t._e(),t.labels?n("span",{staticClass:"k-toggles-text"},[t._v(" "+t._s(e.text)+" ")]):t._e()],1)])})),0)}),[],!1,ar,null,null,null);function ar(t){for(let e in or)this[e]=or[e]}var lr=function(){return rr.exports}();const ur={mixins:[Ds],props:{autocomplete:{type:String,default:"url"},type:{type:String,default:"url"}}};const cr={};var dr=Ft({extends:qs,mixins:[ur]},undefined,undefined,!1,pr,null,null,null);function pr(t){for(let e in cr)this[e]=cr[e]}var hr=function(){return dr.exports}();u.component("k-checkbox-input",ws),u.component("k-checkboxes-input",As),u.component("k-date-input",js),u.component("k-email-input",Hs),u.component("k-list-input",Ws),u.component("k-multiselect-input",eo),u.component("k-number-input",ro),u.component("k-password-input",po),u.component("k-radio-input",ko),u.component("k-range-input",_o),u.component("k-select-input",Oo),u.component("k-slug-input",Mo),u.component("k-tags-input",Po),u.component("k-tel-input",zo),u.component("k-text-input",qs),u.component("k-textarea-input",Jo),u.component("k-time-input",Zo),u.component("k-toggle-input",ir),u.component("k-toggles-input",lr),u.component("k-url-input",hr);const fr={mixins:[On],inheritAttrs:!1,props:{autofocus:Boolean,empty:String,fieldsets:Object,fieldsetGroups:Object,group:String,max:{type:Number,default:null},value:{type:Array,default:()=>[]}},data:()=>({opened:[]}),computed:{hasFieldsets(){return Object.keys(this.fieldsets).length},isEmpty(){return 0===this.value.length},isFull(){return null!==this.max&&this.value.length>=this.max}},methods:{focus(){this.$refs.blocks.focus()}}},mr={};var gr=Ft(fr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-blocks-field",scopedSlots:t._u([{key:"options",fn:function(){return[t.hasFieldsets?n("k-dropdown",[n("k-button",{attrs:{icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),n("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[n("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"add"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}},[t._v(" "+t._s(t.$t("add"))+" ")]),n("hr"),n("k-dropdown-item",{attrs:{disabled:t.isEmpty,icon:"template"},on:{click:function(e){return t.$refs.blocks.copyAll()}}},[t._v(" "+t._s(t.$t("copy.all"))+" ")]),n("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"download"},on:{click:function(e){return t.$refs.blocks.pasteboard()}}},[t._v(" "+t._s(t.$t("paste"))+" ")]),n("hr"),n("k-dropdown-item",{attrs:{disabled:t.isEmpty,icon:"trash"},on:{click:function(e){return t.$refs.blocks.confirmToRemoveAll()}}},[t._v(" "+t._s(t.$t("delete.all"))+" ")])],1)],1):t._e()]},proxy:!0}])},"k-field",t.$props,!1),[n("k-blocks",t._g({ref:"blocks",attrs:{autofocus:t.autofocus,compact:!1,empty:t.empty,endpoints:t.endpoints,fieldsets:t.fieldsets,"fieldset-groups":t.fieldsetGroups,group:t.group,max:t.max,value:t.value},on:{close:function(e){t.opened=e},open:function(e){t.opened=e}}},t.$listeners))],1)}),[],!1,kr,null,null,null);function kr(t){for(let e in mr)this[e]=mr[e]}var vr=function(){return gr.exports}(),br={props:{counter:{type:Boolean,default:!0}},computed:{counterOptions(){var t,e;if(null===this.value||this.disabled||!1===this.counter)return!1;let n=0;return this.value&&(n=Array.isArray(this.value)?this.value.length:String(this.value).length),{count:n,min:null!=(t=this.min)?t:this.minlength,max:null!=(e=this.max)?e:this.maxlength}}}};const yr={};var $r=Ft({mixins:[On,Pn,Ss,br],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-checkboxes-field",attrs:{counter:t.counterOptions}},"k-field",t.$props,!1),[n("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"checkboxes"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,_r,null,null,null);function _r(t){for(let e in yr)this[e]=yr[e]}var xr=function(){return $r.exports}();const wr={mixins:[On,Pn,Ts],inheritAttrs:!1,props:{calendar:{type:Boolean,default:!0},icon:{type:String,default:"calendar"},time:{type:[Boolean,Object],default:()=>({})},times:{type:Boolean,default:!0}},data(){return{isInvalid:!1,iso:this.toIso(this.value)}},computed:{isEmpty(){return this.time?null===this.iso.date&&this.iso.time:null===this.iso.date}},watch:{value(t,e){t!==e&&(this.iso=this.toIso(t))}},methods:{focus(){this.$refs.dateInput.focus()},now(){const t=this.$library.dayjs();return{date:t.toISO("date"),time:this.time?t.toISO("time"):"00:00:00"}},onInput(){if(this.isEmpty)return this.$emit("input","");const t=this.$library.dayjs.iso(this.iso.date+" "+this.iso.time);(t||null!==this.iso.date&&null!==this.iso.time)&&this.$emit("input",(null==t?void 0:t.toISO())||"")},onCalendarInput(t){var e;null==(e=this.$refs.calendar)||e.close(),this.onDateInput(t)},onDateInput(t){t&&!this.iso.time&&(this.iso.time=this.now().time),this.iso.date=t,this.onInput()},onDateInvalid(t){this.isInvalid=t},onTimeInput(t){t&&!this.iso.date&&(this.iso.date=this.now().date),this.iso.time=t,this.onInput()},onTimesInput(t){var e;null==(e=this.$refs.times)||e.close(),this.onTimeInput(t+":00")},toIso(t){const e=this.$library.dayjs.iso(t);return{date:(null==e?void 0:e.toISO("date"))||null,time:(null==e?void 0:e.toISO("time"))||null}}}},Sr={};var Cr=Ft(wr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-date-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[n("div",{ref:"body",staticClass:"k-date-field-body",attrs:{"data-invalid":!t.novalidate&&t.isInvalid,"data-theme":"field"}},[n("k-input",t._b({ref:"dateInput",attrs:{id:t._uid,autofocus:t.autofocus,disabled:t.disabled,display:t.display,max:t.max,min:t.min,required:t.required,value:t.value,theme:"field",type:"date"},on:{invalid:t.onDateInvalid,input:t.onDateInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.calendar?{key:"icon",fn:function(){return[n("k-dropdown",[n("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,tooltip:t.$t("date.select")},on:{click:function(e){return t.$refs.calendar.toggle()}}}),n("k-dropdown-content",{ref:"calendar",attrs:{align:"right"}},[n("k-calendar",{attrs:{value:t.value,min:t.min,max:t.max},on:{input:t.onCalendarInput}})],1)],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1)),t.time?n("k-input",{ref:"timeInput",attrs:{disabled:t.disabled,display:t.time.display,required:t.required,step:t.time.step,value:t.iso.time,icon:t.time.icon,theme:"field",type:"time"},on:{input:t.onTimeInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[n("k-dropdown",[n("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.time.icon||"clock",tooltip:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),n("k-dropdown-content",{ref:"times",attrs:{align:"right"}},[n("k-times",{attrs:{display:t.time.display,value:t.value},on:{input:t.onTimesInput}})],1)],1)]},proxy:!0}:null],null,!0)}):t._e()],1)])}),[],!1,Or,null,null,null);function Or(t){for(let e in Sr)this[e]=Sr[e]}var Er=function(){return Cr.exports}();const Ar={mixins:[On,Pn,Fs],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"email"}},computed:{mailto(){var t;return(null==(t=this.value)?void 0:t.length)>0?"mailto:"+this.value:null}},methods:{focus(){this.$refs.input.focus()}}},Tr={};var Ir=Ft(Ar,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-email-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[n("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"email"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link?n("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.mailto,tooltip:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,Mr,null,null,null);function Mr(t){for(let e in Tr)this[e]=Tr[e]}var Lr=function(){return Ir.exports}(),jr={mixins:[On],inheritAttrs:!1,props:{empty:String,info:String,link:Boolean,layout:{type:String,default:"list"},max:Number,multiple:Boolean,parent:String,search:Boolean,size:String,text:String,value:{type:Array,default:()=>[]}},data(){return{selected:this.value}},computed:{btnIcon(){return!this.multiple&&this.selected.length>0?"refresh":"add"},btnLabel(){return!this.multiple&&this.selected.length>0?this.$t("change"):this.$t("add")},collection(){return{empty:this.emptyProps,items:this.selected,layout:this.layout,link:this.link,size:this.size,sortable:!this.disabled&&this.selected.length>1}},isInvalid(){return!(!this.required||0!==this.selected.length)||(!!(this.min&&this.selected.lengththis.max))},items(){return this.models.map(this.item)},more(){return!this.max||this.max>this.selected.length}},watch:{value(t){this.selected=t}},methods:{focus(){},item:t=>t,onInput(){this.$emit("input",this.selected)},open(){if(this.disabled)return!1;this.$refs.selector.open({endpoint:this.endpoints.field,max:this.max,multiple:this.multiple,search:this.search,selected:this.selected.map((t=>t.id))})},remove(t){this.selected.splice(t,1),this.onInput()},removeById(t){this.selected=this.selected.filter((e=>e.id!==t)),this.onInput()},select(t){0!==t.length?(this.selected=this.selected.filter((e=>t.filter((t=>t.id===e.id)).length>0)),t.forEach((t=>{0===this.selected.filter((e=>t.id===e.id)).length&&this.selected.push(t)})),this.onInput()):this.selected=[]}}};const Dr={mixins:[jr],props:{uploads:[Boolean,Object,Array]},computed:{emptyProps(){return{icon:"image",text:this.empty||this.$t("field.files.empty")}},moreUpload(){return!this.disabled&&this.more&&this.uploads},options(){return this.uploads?{icon:this.btnIcon,text:this.btnLabel,options:[{icon:"check",text:this.$t("select"),click:"open"},{icon:"upload",text:this.$t("upload"),click:"upload"}]}:{options:[{icon:"check",text:this.$t("select"),click:()=>this.open()}]}},uploadParams(){return{accept:this.uploads.accept,max:this.max,multiple:this.multiple,url:this.$urls.api+"/"+this.endpoints.field+"/upload"}}},created(){this.$events.$on("file.delete",this.removeById)},destroyed(){this.$events.$off("file.delete",this.removeById)},methods:{drop(t){return!1!==this.uploads&&this.$refs.fileUpload.drop(t,this.uploadParams)},prompt(){if(this.disabled)return!1;this.moreUpload?this.$refs.options.toggle():this.open()},onAction(t){if(this.moreUpload)switch(t){case"open":return this.open();case"upload":return this.$refs.fileUpload.open(this.uploadParams)}},isSelected(t){return this.selected.find((e=>e.id===t.id))},upload(t,e){!1===this.multiple&&(this.selected=[]),e.forEach((t=>{this.isSelected(t)||this.selected.push(t)})),this.onInput(),this.$events.$emit("model.update")}}},Br={};var Pr=Ft(Dr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-files-field",scopedSlots:t._u([t.more&&!t.disabled?{key:"options",fn:function(){return[n("k-button-group",{staticClass:"k-field-options"},[n("k-options-dropdown",t._b({ref:"options",on:{action:t.onAction}},"k-options-dropdown",t.options,!1))],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[n("k-dropzone",{attrs:{disabled:!t.moreUpload},on:{drop:t.drop}},[n("k-collection",t._b({on:{empty:t.prompt,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function(e){var i=e.index;return[t.disabled?t._e():n("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(i)}}})]}}])},"k-collection",t.collection,!1))],1),n("k-files-dialog",{ref:"selector",on:{submit:t.select}}),n("k-upload",{ref:"fileUpload",on:{success:t.upload}})],1)}),[],!1,Nr,null,null,null);function Nr(t){for(let e in Br)this[e]=Br[e]}var qr=function(){return Pr.exports}();const Fr={};var Rr=Ft({},(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"k-field k-gap-field"})}),[],!1,zr,null,null,null);function zr(t){for(let e in Fr)this[e]=Fr[e]}var Yr=function(){return Rr.exports}();const Hr={mixins:[$n,wn],props:{numbered:Boolean}},Ur={};var Kr=Ft(Hr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-headline-field"},[n("k-headline",{attrs:{"data-numbered":t.numbered,size:"large"}},[t._v(" "+t._s(t.label)+" ")]),t.help?n("footer",{staticClass:"k-field-footer"},[t.help?n("k-text",{staticClass:"k-field-help",attrs:{theme:"help"},domProps:{innerHTML:t._s(t.help)}}):t._e()],1):t._e()],1)}),[],!1,Jr,null,null,null);function Jr(t){for(let e in Ur)this[e]=Ur[e]}var Gr=function(){return Kr.exports}();const Vr={};var Wr=Ft({mixins:[$n,wn],props:{text:String,theme:{type:String,default:"info"}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-field k-info-field"},[n("k-headline",[t._v(t._s(t.label))]),n("k-box",{attrs:{theme:t.theme}},[n("k-text",{domProps:{innerHTML:t._s(t.text)}})],1),t.help?n("footer",{staticClass:"k-field-footer"},[t.help?n("k-text",{staticClass:"k-field-help",attrs:{theme:"help"},domProps:{innerHTML:t._s(t.help)}}):t._e()],1):t._e()],1)}),[],!1,Xr,null,null,null);function Xr(t){for(let e in Vr)this[e]=Vr[e]}var Zr=function(){return Wr.exports}();const Qr={props:{blocks:Array,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean,width:String}},ta={};var ea=Ft(Qr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-column k-layout-column",attrs:{id:t.id,"data-width":t.width,tabindex:"0"},on:{dblclick:function(e){return t.$refs.blocks.choose(t.blocks.length)}}},[n("k-blocks",{ref:"blocks",attrs:{endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets,value:t.blocks,group:"layout"},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{dblclick:function(t){t.stopPropagation()}}})],1)}),[],!1,na,null,null,null);function na(t){for(let e in ta)this[e]=ta[e]}const ia={components:{"k-layout-column":function(){return ea.exports}()},props:{attrs:[Array,Object],columns:Array,disabled:Boolean,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean,settings:Object},computed:{tabs(){let t=this.settings.tabs;return Object.entries(t).forEach((([e,n])=>{Object.entries(n.fields).forEach((([n])=>{t[e].fields[n].endpoints={field:this.endpoints.field+"/fields/"+n,section:this.endpoints.section,model:this.endpoints.model}}))})),t}}},sa={};var oa=Ft(ia,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("section",{staticClass:"k-layout",attrs:{"data-selected":t.isSelected,tabindex:"0"},on:{click:function(e){return t.$emit("select")}}},[n("k-grid",{staticClass:"k-layout-columns"},t._l(t.columns,(function(e,i){return n("k-layout-column",t._b({key:e.id,attrs:{endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets},on:{input:function(n){return t.$emit("updateColumn",{column:e,columnIndex:i,blocks:n})}}},"k-layout-column",e,!1))})),1),t.disabled?t._e():n("nav",{staticClass:"k-layout-toolbar"},[t.settings?n("k-button",{staticClass:"k-layout-toolbar-button",attrs:{tooltip:t.$t("settings"),icon:"settings"},on:{click:function(e){return t.$refs.drawer.open()}}}):t._e(),n("k-dropdown",[n("k-button",{staticClass:"k-layout-toolbar-button",attrs:{icon:"angle-down"},on:{click:function(e){return t.$refs.options.toggle()}}}),n("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[n("k-dropdown-item",{attrs:{icon:"angle-up"},on:{click:function(e){return t.$emit("prepend")}}},[t._v(" "+t._s(t.$t("insert.before"))+" ")]),n("k-dropdown-item",{attrs:{icon:"angle-down"},on:{click:function(e){return t.$emit("append")}}},[t._v(" "+t._s(t.$t("insert.after"))+" ")]),n("hr"),t.settings?n("k-dropdown-item",{attrs:{icon:"settings"},on:{click:function(e){return t.$refs.drawer.open()}}},[t._v(" "+t._s(t.$t("settings"))+" ")]):t._e(),n("k-dropdown-item",{attrs:{icon:"copy"},on:{click:function(e){return t.$emit("duplicate")}}},[t._v(" "+t._s(t.$t("duplicate"))+" ")]),n("hr"),n("k-dropdown-item",{attrs:{icon:"trash"},on:{click:function(e){return t.$refs.confirmRemoveDialog.open()}}},[t._v(" "+t._s(t.$t("field.layout.delete"))+" ")])],1)],1),n("k-sort-handle")],1),t.settings?n("k-form-drawer",{ref:"drawer",staticClass:"k-layout-drawer",attrs:{tabs:t.tabs,title:t.$t("settings"),value:t.attrs,icon:"settings"},on:{input:function(e){return t.$emit("updateAttrs",e)}}}):t._e(),n("k-remove-dialog",{ref:"confirmRemoveDialog",attrs:{text:t.$t("field.layout.delete.confirm")},on:{submit:function(e){return t.$emit("remove")}}})],1)}),[],!1,ra,null,null,null);function ra(t){for(let e in sa)this[e]=sa[e]}var aa=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.rows.length?[n("k-draggable",t._b({staticClass:"k-layouts",on:{sort:t.save}},"k-draggable",t.draggableOptions,!1),t._l(t.rows,(function(e,i){return n("k-layout",t._b({key:e.id,attrs:{disabled:t.disabled,endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets,"is-selected":t.selected===e.id,settings:t.settings},on:{append:function(e){return t.selectLayout(i+1)},duplicate:function(n){return t.duplicateLayout(i,e)},prepend:function(e){return t.selectLayout(i)},remove:function(n){return t.removeLayout(e)},select:function(n){t.selected=e.id},updateAttrs:function(e){return t.updateAttrs(i,e)},updateColumn:function(n){return t.updateColumn(Object.assign({layout:e,layoutIndex:i},n))}}},"k-layout",e,!1))})),1),t.disabled?t._e():n("k-button",{staticClass:"k-layout-add-button",attrs:{icon:"add"},on:{click:function(e){return t.selectLayout(t.rows.length)}}})]:[n("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"},on:{click:function(e){return t.selectLayout(0)}}},[t._v(" "+t._s(t.empty||t.$t("field.layout.empty"))+" ")])],n("k-dialog",{ref:"selector",staticClass:"k-layout-selector",attrs:{"cancel-button":!1,"submit-button":!1,size:"medium"}},[n("k-headline",[t._v(t._s(t.$t("field.layout.select")))]),n("ul",t._l(t.layouts,(function(e,i){return n("li",{key:i,staticClass:"k-layout-selector-option"},[n("k-grid",{nativeOn:{click:function(n){return t.addLayout(e)}}},t._l(e,(function(t,e){return n("k-column",{key:e,attrs:{width:t}})})),1)],1)})),0)],1)],2)};const la={components:{"k-layout":function(){return oa.exports}()},props:{disabled:Boolean,empty:String,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,layouts:Array,max:Number,settings:Object,value:Array},data(){return{currentLayout:null,nextIndex:null,rows:this.value,selected:null}},computed:{draggableOptions(){return{id:this._uid,handle:!0,list:this.rows}}},watch:{value(){this.rows=this.value}},methods:{async addLayout(t){let e=await this.$api.post(this.endpoints.field+"/layout",{columns:t});this.rows.splice(this.nextIndex,0,e),this.layouts.length>1&&this.$refs.selector.close(),this.save()},duplicateLayout(t,e){let n=l(a({},this.$helper.clone(e)),{id:this.$helper.uuid()});n.columns=n.columns.map((t=>(t.id=this.$helper.uuid(),t.blocks=t.blocks.map((t=>(t.id=this.$helper.uuid(),t))),t))),this.rows.splice(t+1,0,n),this.save()},removeLayout(t){const e=this.rows.findIndex((e=>e.id===t.id));-1!==e&&this.$delete(this.rows,e),this.save()},save(){this.$emit("input",this.rows)},selectLayout(t){this.nextIndex=t,1!==this.layouts.length?this.$refs.selector.open():this.addLayout(this.layouts[0])},updateColumn(t){this.rows[t.layoutIndex].columns[t.columnIndex].blocks=t.blocks,this.save()},updateAttrs(t,e){this.rows[t].attrs=e,this.save()}}},ua={};var ca=Ft(la,aa,[],!1,da,null,null,null);function da(t){for(let e in ua)this[e]=ua[e]}const pa={};var ha=Ft({components:{"k-block-layouts":function(){return ca.exports}()},mixins:[On],inheritAttrs:!1,props:{empty:String,fieldsetGroups:Object,fieldsets:Object,layouts:{type:Array,default:()=>[["1/1"]]},settings:Object,value:{type:Array,default:()=>[]}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-layout-field"},"k-field",t.$props,!1),[n("k-block-layouts",t._b({on:{input:function(e){return t.$emit("input",e)}}},"k-block-layouts",t.$props,!1))],1)}),[],!1,fa,null,null,null);function fa(t){for(let e in pa)this[e]=pa[e]}var ma=function(){return ha.exports}();const ga={};var ka=Ft({},(function(){var t=this.$createElement;return(this._self._c||t)("hr",{staticClass:"k-line-field"})}),[],!1,va,null,null,null);function va(t){for(let e in ga)this[e]=ga[e]}var ba=function(){return ka.exports}();const ya={mixins:[On,Pn],inheritAttrs:!1,props:{marks:[Array,Boolean],value:String},methods:{focus(){this.$refs.input.focus()}}},$a={};var _a=Ft(ya,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-list-field",attrs:{input:t._uid,counter:!1}},"k-field",t.$props,!1),[n("k-input",t._b({ref:"input",attrs:{id:t._uid,marks:t.marks,value:t.value,type:"list",theme:"field"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[],!1,xa,null,null,null);function xa(t){for(let e in $a)this[e]=$a[e]}var wa=function(){return _a.exports}();const Sa={};var Ca=Ft({mixins:[On,Pn,Xs,br],inheritAttrs:!1,props:{icon:{type:String,default:"angle-down"}},mounted(){this.$refs.input.$el.setAttribute("tabindex",0)},methods:{blur(t){this.$refs.input.blur(t)},focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-multiselect-field",attrs:{input:t._uid,counter:t.counterOptions},on:{blur:t.blur},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.focus.apply(null,arguments))}}},"k-field",t.$props,!1),[n("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"multiselect"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,Oa,null,null,null);function Oa(t){for(let e in Sa)this[e]=Sa[e]}var Ea=function(){return Ca.exports}();const Aa={};var Ta=Ft({mixins:[On,Pn,no],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-number-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[n("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"number"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,Ia,null,null,null);function Ia(t){for(let e in Aa)this[e]=Aa[e]}var Ma=function(){return Ta.exports}();const La={};var ja=Ft({mixins:[jr],computed:{emptyProps(){return{icon:"page",text:this.empty||this.$t("field.pages.empty")}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-pages-field",scopedSlots:t._u([{key:"options",fn:function(){return[n("k-button-group",{staticClass:"k-field-options"},[t.more&&!t.disabled?n("k-button",{staticClass:"k-field-options-button",attrs:{icon:t.btnIcon,text:t.btnLabel},on:{click:t.open}}):t._e()],1)]},proxy:!0}])},"k-field",t.$props,!1),[n("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function(e){var i=e.index;return[t.disabled?t._e():n("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(i)}}})]}}])},"k-collection",t.collection,!1)),n("k-pages-dialog",{ref:"selector",on:{submit:t.select}})],1)}),[],!1,Da,null,null,null);function Da(t){for(let e in La)this[e]=La[e]}var Ba=function(){return ja.exports}();const Pa={};var Na=Ft({mixins:[On,Pn,ao,br],inheritAttrs:!1,props:{minlength:{type:Number,default:8},icon:{type:String,default:"key"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-password-field",attrs:{input:t._uid,counter:t.counterOptions},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[n("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"password"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,qa,null,null,null);function qa(t){for(let e in Pa)this[e]=Pa[e]}var Fa=function(){return Na.exports}();const Ra={};var za=Ft({mixins:[On,Pn,ho],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-radio-field"},"k-field",t.$props,!1),[n("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"radio"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,Ya,null,null,null);function Ya(t){for(let e in Ra)this[e]=Ra[e]}var Ha=function(){return za.exports}();const Ua={};var Ka=Ft({mixins:[Pn,On,vo],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-range-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[n("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"range"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,Ja,null,null,null);function Ja(t){for(let e in Ua)this[e]=Ua[e]}var Ga=function(){return Ka.exports}();const Va={};var Wa=Ft({mixins:[On,Pn,xo],inheritAttrs:!1,props:{icon:{type:String,default:"angle-down"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-select-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[n("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"select"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,Xa,null,null,null);function Xa(t){for(let e in Va)this[e]=Va[e]}var Za=function(){return Wa.exports}();const Qa={mixins:[On,Pn,Eo],inheritAttrs:!1,props:{icon:{type:String,default:"url"},path:{type:String},wizard:{type:[Boolean,Object],default:!1}},data(){return{slug:this.value}},computed:{preview(){return void 0!==this.help?this.help:void 0!==this.path?this.path+this.value:null}},watch:{value(){this.slug=this.value}},methods:{focus(){this.$refs.input.focus()},onWizard(){var t;this.formData[null==(t=this.wizard)?void 0:t.field]&&(this.slug=this.formData[this.wizard.field])}}},tl={};var el=Ft(Qa,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-slug-field",attrs:{input:t._uid,help:t.preview},scopedSlots:t._u([t.wizard&&t.wizard.text?{key:"options",fn:function(){return[n("k-button",{attrs:{text:t.wizard.text,icon:"wand"},on:{click:t.onWizard}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[n("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,value:t.slug,theme:"field",type:"slug"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,nl,null,null,null);function nl(t){for(let e in tl)this[e]=tl[e]}var il=function(){return el.exports}();const sl={mixins:[On],inheritAttrs:!1,props:{columns:Object,duplicate:{type:Boolean,default:!0},empty:String,fields:Object,limit:Number,max:Number,min:Number,prepend:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},sortBy:String,value:{type:Array,default:()=>[]}},data(){return{autofocus:null,items:this.toItems(this.value),currentIndex:null,currentModel:null,trash:null,page:1}},computed:{dragOptions(){return{disabled:!this.isSortable,fallbackClass:"k-sortable-row-fallback"}},form(){let t={};return Object.keys(this.fields).forEach((e=>{let n=this.fields[e];n.section=this.name,n.endpoints={field:this.endpoints.field+"+"+e,section:this.endpoints.section,model:this.endpoints.model},null===this.autofocus&&!0===n.autofocus&&(this.autofocus=e),t[e]=n})),t},index(){return this.limit?(this.page-1)*this.limit:1},more(){return!0!==this.disabled&&!(this.max&&this.items.length>=this.max)},isInvalid(){return!0!==this.disabled&&(!!(this.min&&this.items.lengththis.max))},isSortable(){return!this.sortBy&&(!this.limit&&(!0!==this.disabled&&(!(this.items.length<=1)&&!1!==this.sortable)))},pagination(){let t=0;return this.limit&&(t=(this.page-1)*this.limit),{page:this.page,offset:t,limit:this.limit,total:this.items.length,align:"center",details:!0}},options(){let t=[],e=this.duplicate&&this.more&&null===this.currentIndex;return e&&t.push({icon:"copy",text:this.$t("duplicate"),click:"duplicate"}),t.push({icon:"remove",text:e?this.$t("remove"):null,click:"remove"}),t},paginatedItems(){return this.limit?this.items.slice(this.pagination.offset,this.pagination.offset+this.limit):this.items}},watch:{value(t){t!=this.items&&(this.items=this.toItems(t))}},methods:{add(t){!0===this.prepend?this.items.unshift(t):this.items.push(t)},focus(){var t,e;null==(e=null==(t=this.$refs.add)?void 0:t.focus)||e.call(t)},jump(t,e){this.open(t+this.pagination.offset,e)},onAdd(){if(!0===this.disabled)return!1;if(null!==this.currentIndex)return this.onFormDiscard(),!1;let t={};for(const e in this.fields)t[e]=this.$helper.clone(this.fields[e].default);this.currentIndex="new",this.currentModel=t,this.onFormOpen()},onFormClose(){this.currentIndex=null,this.currentModel=null},onFormDiscard(){if("new"===this.currentIndex){if(0===Object.values(this.currentModel).filter((t=>!1===this.$helper.object.isEmpty(t))).length)return void this.onFormClose()}this.onFormSubmit()},onFormOpen(t=this.autofocus){this.$nextTick((()=>{var e;null==(e=this.$refs.form)||e.focus(t)}))},async onFormPaginate(t){await this.save(),this.open(t)},async onFormSubmit(){try{await this.save(),this.onFormClose()}catch(t){}},onInput(t=this.items){this.$emit("input",t)},onOption(t,e,n){switch(t){case"remove":this.onFormClose(),this.trash=n+this.pagination.offset,this.$refs.remove.open();break;case"duplicate":this.add(this.items[n+this.pagination.offset]),this.onInput()}},onRemove(){if(null===this.trash)return!1;this.items.splice(this.trash,1),this.trash=null,this.$refs.remove.close(),this.onInput(),0===this.paginatedItems.length&&this.page>1&&this.page--,this.items=this.sort(this.items)},open(t,e){this.currentIndex=t,this.currentModel=this.$helper.clone(this.items[t]),this.onFormOpen(e)},paginate({page:t}){this.page=t},sort(t){return this.sortBy?t.sortBy(this.sortBy):t},async save(){if(null!==this.currentIndex&&void 0!==this.currentIndex)try{return await this.validate(this.currentModel),"new"===this.currentIndex?this.add(this.currentModel):this.items[this.currentIndex]=this.currentModel,this.items=this.sort(this.items),this.onInput(),!0}catch(t){throw this.$store.dispatch("notification/error",{message:this.$t("error.form.incomplete"),details:t}),t}},toItems(t){return!1===Array.isArray(t)?[]:this.sort(t)},async validate(t){const e=await this.$api.post(this.endpoints.field+"/validate",t);if(e.length>0)throw e;return!0}}},ol={};var rl=Ft(sl,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-structure-field",nativeOn:{click:function(t){t.stopPropagation()}},scopedSlots:t._u([{key:"options",fn:function(){return[t.more&&null===t.currentIndex?n("k-button",{ref:"add",attrs:{id:t._uid,text:t.$t("add"),icon:"add"},on:{click:t.onAdd}}):t._e()]},proxy:!0}])},"k-field",t.$props,!1),[null!==t.currentIndex?n("k-structure-form",{ref:"form",attrs:{fields:t.form,index:t.currentIndex,total:t.items.length},on:{close:t.onFormClose,discard:t.onFormDiscard,paginate:function(e){return t.onFormPaginate(e.offset)},submit:t.onFormSubmit},model:{value:t.currentModel,callback:function(e){t.currentModel=e},expression:"currentModel"}}):0===t.items.length?n("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"list-bullet"},on:{click:t.onAdd}},[t._v(" "+t._s(t.empty||t.$t("field.structure.empty"))+" ")]):[n("k-table",{attrs:{columns:t.columns,disabled:t.disabled,fields:t.fields,empty:t.$t("field.structure.empty"),index:t.index,options:t.options,rows:t.paginatedItems,sortable:t.isSortable,"data-invalid":t.isInvalid},on:{cell:function(e){return t.jump(e.rowIndex,e.columnIndex)},input:t.onInput,option:t.onOption}}),t.limit?n("k-pagination",t._b({on:{paginate:t.paginate}},"k-pagination",t.pagination,!1)):t._e(),t.disabled?t._e():n("k-dialog",{ref:"remove",attrs:{"submit-button":t.$t("delete"),theme:"negative"},on:{submit:t.onRemove}},[n("k-text",[t._v(t._s(t.$t("field.structure.delete.confirm")))])],1)]],2)}),[],!1,al,null,null,null);function al(t){for(let e in ol)this[e]=ol[e]}var ll=function(){return rl.exports}();const ul={};var cl=Ft({mixins:[On,Pn,Lo,br],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-tags-field",attrs:{input:t._uid,counter:t.counterOptions}},"k-field",t.$props,!1),[n("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"tags"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,dl,null,null,null);function dl(t){for(let e in ul)this[e]=ul[e]}var pl=function(){return cl.exports}();const hl={};var fl=Ft({mixins:[On,Pn,No],inheritAttrs:!1,props:{icon:{type:String,default:"phone"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-tel-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[n("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"tel"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,ml,null,null,null);function ml(t){for(let e in hl)this[e]=hl[e]}var gl=function(){return fl.exports}();const kl={};var vl=Ft({mixins:[On,Pn,Ds,br],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()},select(){this.$refs.input.select()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-text-field",attrs:{input:t._uid,counter:t.counterOptions},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[n("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,bl,null,null,null);function bl(t){for(let e in kl)this[e]=kl[e]}var yl=function(){return vl.exports}();const $l={};var _l=Ft({mixins:[On,Pn,Yo,br],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-textarea-field",attrs:{input:t._uid,counter:t.counterOptions}},"k-field",t.$props,!1),[n("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,type:"textarea",theme:"field"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,xl,null,null,null);function xl(t){for(let e in $l)this[e]=$l[e]}var wl=function(){return _l.exports}();const Sl={mixins:[On,Pn,Go],inheritAttrs:!1,props:{icon:{type:String,default:"clock"},times:{type:Boolean,default:!0}},methods:{focus(){this.$refs.input.focus()},select(t){var e;this.$emit("input",t),null==(e=this.$refs.times)||e.close()}}},Cl={};var Ol=Ft(Sl,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-time-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[n("k-input",t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"time"},on:{input:function(e){return t.$emit("input",e||"")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[n("k-dropdown",[n("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon||"clock",tooltip:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),n("k-dropdown-content",{ref:"times",attrs:{align:"right"}},[n("k-times",{attrs:{display:t.display,value:t.value},on:{input:t.select}})],1)],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1))],1)}),[],!1,El,null,null,null);function El(t){for(let e in Cl)this[e]=Cl[e]}var Al=function(){return Ol.exports}();const Tl={};var Il=Ft({mixins:[On,Pn,Qo],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-toggle-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[n("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"toggle"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,Ml,null,null,null);function Ml(t){for(let e in Tl)this[e]=Tl[e]}var Ll=function(){return Il.exports}();const jl={};var Dl=Ft({inheritAttrs:!1,mixins:[On,Pn,sr],methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-toggles-field"},"k-field",t.$props,!1),[n("k-input",t._g(t._b({ref:"input",class:{grow:t.grow},attrs:{id:t._uid,theme:"field",type:"toggles"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,Bl,null,null,null);function Bl(t){for(let e in jl)this[e]=jl[e]}var Pl=function(){return Dl.exports}();const Nl={mixins:[On,Pn,ur],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"url"}},methods:{focus(){this.$refs.input.focus()}}},ql={};var Fl=Ft(Nl,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-url-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[n("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"url"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link?n("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.value,tooltip:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,Rl,null,null,null);function Rl(t){for(let e in ql)this[e]=ql[e]}var zl=function(){return Fl.exports}();const Yl={};var Hl=Ft({mixins:[jr],computed:{emptyProps(){return{icon:"users",text:this.empty||this.$t("field.users.empty")}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-users-field",scopedSlots:t._u([{key:"options",fn:function(){return[n("k-button-group",{staticClass:"k-field-options"},[t.more&&!t.disabled?n("k-button",{staticClass:"k-field-options-button",attrs:{icon:t.btnIcon,text:t.btnLabel},on:{click:t.open}}):t._e()],1)]},proxy:!0}])},"k-field",t.$props,!1),[n("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function(e){var i=e.index;return[t.disabled?t._e():n("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(i)}}})]}}])},"k-collection",t.collection,!1)),n("k-users-dialog",{ref:"selector",on:{submit:t.select}})],1)}),[],!1,Ul,null,null,null);function Ul(t){for(let e in Yl)this[e]=Yl[e]}var Kl=function(){return Hl.exports}();const Jl={};var Gl=Ft({mixins:[On,Pn,Ji],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-field",t._b({staticClass:"k-writer-field",attrs:{input:t._uid,counter:!1}},"k-field",t.$props,!1),[n("k-input",t._b({attrs:{after:t.after,before:t.before,icon:t.icon,theme:"field"}},"k-input",t.$props,!1),[n("k-writer",t._b({ref:"input",staticClass:"k-writer-field-input",attrs:{value:t.value},on:{input:function(e){return t.$emit("input",e)}}},"k-writer",t.$props,!1))],1)],1)}),[],!1,Vl,null,null,null);function Vl(t){for(let e in Jl)this[e]=Jl[e]}var Wl=function(){return Gl.exports}();u.component("k-blocks-field",vr),u.component("k-checkboxes-field",xr),u.component("k-date-field",Er),u.component("k-email-field",Lr),u.component("k-files-field",qr),u.component("k-gap-field",Yr),u.component("k-headline-field",Gr),u.component("k-info-field",Zr),u.component("k-layout-field",ma),u.component("k-line-field",ba),u.component("k-list-field",wa),u.component("k-multiselect-field",Ea),u.component("k-number-field",Ma),u.component("k-pages-field",Ba),u.component("k-password-field",Fa),u.component("k-radio-field",Ha),u.component("k-range-field",Ga),u.component("k-select-field",Za),u.component("k-slug-field",il),u.component("k-structure-field",ll),u.component("k-tags-field",pl),u.component("k-text-field",yl),u.component("k-textarea-field",wl),u.component("k-tel-field",gl),u.component("k-time-field",Al),u.component("k-toggle-field",Ll),u.component("k-toggles-field",Pl),u.component("k-url-field",zl),u.component("k-users-field",Kl),u.component("k-writer-field",Wl);const Xl={props:{cover:Boolean,ratio:String},computed:{ratioPadding(){return this.$helper.ratio(this.ratio)}}},Zl={};var Ql=Ft(Xl,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("span",{staticClass:"k-aspect-ratio",style:{"padding-bottom":t.ratioPadding},attrs:{"data-cover":t.cover}},[t._t("default")],2)}),[],!1,tu,null,null,null);function tu(t){for(let e in Zl)this[e]=Zl[e]}var eu=function(){return Ql.exports}();const nu={};var iu=Ft({},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-bar"},[t.$slots.left?n("div",{staticClass:"k-bar-slot",attrs:{"data-position":"left"}},[t._t("left")],2):t._e(),t.$slots.center?n("div",{staticClass:"k-bar-slot",attrs:{"data-position":"center"}},[t._t("center")],2):t._e(),t.$slots.right?n("div",{staticClass:"k-bar-slot",attrs:{"data-position":"right"}},[t._t("right")],2):t._e()])}),[],!1,su,null,null,null);function su(t){for(let e in nu)this[e]=nu[e]}var ou=function(){return iu.exports}();const ru={props:{theme:{type:String,default:"none"},text:String,html:{type:Boolean,default:!1}}},au={};var lu=Ft(ru,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",t._g({staticClass:"k-box",attrs:{"data-theme":t.theme}},t.$listeners),[t._t("default",(function(){return[t.html?n("k-text",{domProps:{innerHTML:t._s(t.text)}}):n("k-text",[t._v(" "+t._s(t.text)+" ")])]}))],2)}),[],!1,uu,null,null,null);function uu(t){for(let e in au)this[e]=au[e]}var cu=function(){return lu.exports}();const du={};var pu=Ft({inheritAttrs:!1,props:{back:String,color:String,element:{type:String,default:"li"},image:Object,link:String,text:String}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n(t.link?"k-link":"p",{tag:"component",staticClass:"k-bubble",style:{color:t.$helper.color(t.color),background:t.$helper.color(t.back)},attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[t.image?n("k-item-image",{attrs:{image:t.image,layout:"list"}}):t._e(),t._v(" "+t._s(t.text)+" ")],1)}),[],!1,hu,null,null,null);function hu(t){for(let e in du)this[e]=du[e]}var fu=function(){return pu.exports}();const mu={};var gu=Ft({inheritAttrs:!1,props:{bubbles:Array},computed:{items(){let t=this.bubbles;return"string"==typeof t&&(t=t.split(",")),t.map((t=>"string"==typeof t?{text:t}:t))}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",{staticClass:"k-bubbles"},t._l(t.items,(function(e,i){return n("li",{key:i},[n("k-bubble",t._b({},"k-bubble",e,!1))],1)})),0)}),[],!1,ku,null,null,null);function ku(t){for(let e in mu)this[e]=mu[e]}var vu=function(){return gu.exports}();const bu={props:{columns:{type:[Object,Array],default:()=>({})},empty:Object,help:String,items:{type:[Array,Object],default:()=>[]},layout:{type:String,default:"list"},link:{type:Boolean,default:!0},size:String,sortable:Boolean,pagination:{type:[Boolean,Object],default:()=>!1}},computed:{hasPagination(){return!1!==this.pagination&&(!0!==this.paginationOptions.hide&&!(this.pagination.total<=this.pagination.limit))},hasFooter(){return!(!this.hasPagination&&!this.help)},paginationOptions(){const t="object"!=typeof this.pagination?{}:this.pagination;return a({limit:10,details:!0,keys:!1,total:0,hide:!1},t)}},watch:{$props(){this.$forceUpdate()}},methods:{onEmpty(t){t.stopPropagation(),this.$emit("empty")},onOption(...t){this.$emit("action",...t),this.$emit("option",...t)}}},yu={};var $u=Ft(bu,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-collection"},[t.items.length?n("k-items",{attrs:{columns:t.columns,items:t.items,layout:t.layout,link:t.link,size:t.size,sortable:t.sortable},on:{change:function(e){return t.$emit("change",e)},item:function(e){return t.$emit("item",e)},option:t.onOption,sort:function(e){return t.$emit("sort",e)}},scopedSlots:t._u([{key:"options",fn:function(e){var n=e.item,i=e.itemIndex;return[t._t("options",null,null,{item:n,index:i})]}}],null,!0)}):n("k-empty",t._g(t._b({attrs:{layout:t.layout}},"k-empty",t.empty,!1),t.$listeners.empty?{click:t.onEmpty}:{})),t.hasFooter?n("footer",{staticClass:"k-collection-footer"},[t.help?n("k-text",{staticClass:"k-collection-help",attrs:{theme:"help"},domProps:{innerHTML:t._s(t.help)}}):t._e(),n("div",{staticClass:"k-collection-pagination"},[t.hasPagination?n("k-pagination",t._b({on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.paginationOptions,!1)):t._e()],1)],1):t._e()],1)}),[],!1,_u,null,null,null);function _u(t){for(let e in yu)this[e]=yu[e]}var xu=function(){return $u.exports}();const wu={props:{width:String,sticky:Boolean}},Su={};var Cu=Ft(wu,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-column",attrs:{"data-width":t.width,"data-sticky":t.sticky}},[n("div",[t._t("default")],2)])}),[],!1,Ou,null,null,null);function Ou(t){for(let e in Su)this[e]=Su[e]}var Eu=function(){return Cu.exports}();const Au={props:{disabled:{type:Boolean,default:!1}},data:()=>({files:[],dragging:!1,over:!1}),methods:{cancel(){this.reset()},reset(){this.dragging=!1,this.over=!1},onDrop(t){return!0===this.disabled||!1===this.$helper.isUploadEvent(t)?this.reset():(this.$events.$emit("dropzone.drop"),this.files=t.dataTransfer.files,this.$emit("drop",this.files),void this.reset())},onEnter(t){!1===this.disabled&&this.$helper.isUploadEvent(t)&&(this.dragging=!0)},onLeave(){this.reset()},onOver(t){!1===this.disabled&&this.$helper.isUploadEvent(t)&&(t.dataTransfer.dropEffect="copy",this.over=!0)}}},Tu={};var Iu=Ft(Au,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"k-dropzone",attrs:{"data-dragging":t.dragging,"data-over":t.over},on:{dragenter:t.onEnter,dragleave:t.onLeave,dragover:t.onOver,drop:t.onDrop}},[t._t("default")],2)}),[],!1,Mu,null,null,null);function Mu(t){for(let e in Tu)this[e]=Tu[e]}var Lu=function(){return Iu.exports}();const ju={};var Du=Ft({props:{text:String,icon:String,layout:{type:String,default:"list"}},computed:{element(){return void 0!==this.$listeners.click?"button":"div"}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n(t.element,t._g({tag:"component",staticClass:"k-empty",attrs:{"data-layout":t.layout,type:"button"===t.element&&"button"}},t.$listeners),[t.icon?n("k-icon",{attrs:{type:t.icon}}):t._e(),n("p",[t._t("default",(function(){return[t._v(t._s(t.text))]}))],2)],1)}),[],!1,Bu,null,null,null);function Bu(t){for(let e in ju)this[e]=ju[e]}var Pu=function(){return Du.exports}();const Nu={};var qu=Ft({props:{details:Array,image:Object,url:String}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-file-preview"},[n("k-view",{staticClass:"k-file-preview-layout"},[n("div",{staticClass:"k-file-preview-image"},[n("k-link",{staticClass:"k-file-preview-image-link",attrs:{to:t.url,title:t.$t("open"),target:"_blank"}},[n("k-item-image",{attrs:{image:t.image,layout:"cards"}})],1)],1),n("div",{staticClass:"k-file-preview-details"},[n("ul",t._l(t.details,(function(e){return n("li",{key:e.title},[n("h3",[t._v(t._s(e.title))]),n("p",[e.link?n("k-link",{attrs:{to:e.link,tabindex:"-1",target:"_blank"}},[t._v(" /"+t._s(e.text)+" ")]):[t._v(" "+t._s(e.text)+" ")]],2)])})),0)])])],1)}),[],!1,Fu,null,null,null);function Fu(t){for(let e in Nu)this[e]=Nu[e]}var Ru=function(){return qu.exports}();const zu={};var Yu=Ft({props:{gutter:String}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"k-grid",attrs:{"data-gutter":t.gutter}},[t._t("default")],2)}),[],!1,Hu,null,null,null);function Hu(t){for(let e in zu)this[e]=zu[e]}var Uu=function(){return Yu.exports}();const Ku={props:{editable:Boolean,tab:String,tabs:{type:Array,default:()=>[]}},computed:{tabsWithBadges(){const t=Object.keys(this.$store.getters["content/changes"]());return this.tabs.map((e=>{let n=[];return Object.values(e.columns).forEach((t=>{Object.values(t.sections).forEach((t=>{"fields"===t.type&&Object.keys(t.fields).forEach((t=>{n.push(t)}))}))})),e.badge=n.filter((e=>t.includes(e.toLowerCase()))).length,e}))}}},Ju={};var Gu=Ft(Ku,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("header",{staticClass:"k-header",attrs:{"data-editable":t.editable,"data-tabs":t.tabsWithBadges.length>1}},[n("k-headline",{attrs:{tag:"h1",size:"huge"}},[t.editable&&t.$listeners.edit?n("span",{staticClass:"k-headline-editable",on:{click:function(e){return t.$emit("edit")}}},[t._t("default"),n("k-icon",{attrs:{type:"edit"}})],2):t._t("default")],2),t.$slots.left||t.$slots.right?n("k-bar",{staticClass:"k-header-buttons",scopedSlots:t._u([{key:"left",fn:function(){return[t._t("left")]},proxy:!0},{key:"right",fn:function(){return[t._t("right")]},proxy:!0}],null,!0)}):t._e(),n("k-tabs",{attrs:{tab:t.tab,tabs:t.tabsWithBadges,theme:"notice"}})],1)}),[],!1,Vu,null,null,null);function Vu(t){for(let e in Ju)this[e]=Ju[e]}var Wu=function(){return Gu.exports}();const Xu={};var Zu=Ft({inheritAttrs:!1},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-panel",{staticClass:"k-panel-inside",attrs:{tabindex:"0"}},[n("header",{staticClass:"k-panel-header"},[n("k-topbar",{attrs:{breadcrumb:t.$view.breadcrumb,license:t.$license,menu:t.$menu,view:t.$view}})],1),n("main",{staticClass:"k-panel-view scroll-y"},[t._t("default")],2),t._t("footer")],2)}),[],!1,Qu,null,null,null);function Qu(t){for(let e in Xu)this[e]=Xu[e]}var tc=function(){return Zu.exports}(),ec=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("article",t._b({staticClass:"k-item",class:!!t.layout&&"k-"+t.layout+"-item",attrs:{"data-has-figure":t.hasFigure,"data-has-flag":Boolean(t.flag),"data-has-info":Boolean(t.info),"data-has-options":Boolean(t.options),tabindex:"-1"},on:{click:function(e){return t.$emit("click",e)},dragstart:function(e){return t.$emit("drag",e)}}},"article",t.data,!1),[t._t("image",(function(){return[t.hasFigure?n("k-item-image",{attrs:{image:t.image,layout:t.layout,width:t.width}}):t._e()]})),t.sortable?n("k-sort-handle",{staticClass:"k-item-sort-handle"}):t._e(),n("header",{staticClass:"k-item-content"},[t._t("default",(function(){return[n("h3",{staticClass:"k-item-title"},[!1!==t.link?n("k-link",{staticClass:"k-item-title-link",attrs:{target:t.target,to:t.link}},[n("span",{domProps:{innerHTML:t._s(t.title)}})]):n("span",{domProps:{innerHTML:t._s(t.title)}})],1),t.info?n("p",{staticClass:"k-item-info",domProps:{innerHTML:t._s(t.info)}}):t._e()]}))],2),t.flag||t.options||t.$slots.options?n("footer",{staticClass:"k-item-footer"},[n("nav",{staticClass:"k-item-buttons",on:{click:function(t){t.stopPropagation()}}},[t.flag?n("k-status-icon",t._b({},"k-status-icon",t.flag,!1)):t._e(),t._t("options",(function(){return[t.options?n("k-options-dropdown",{staticClass:"k-item-options-dropdown",attrs:{options:t.options},on:{option:t.onOption}}):t._e()]}))],2)]):t._e()],2)};const nc={inheritAttrs:!1,props:{data:Object,flag:Object,image:[Object,Boolean],info:String,layout:{type:String,default:"list"},link:{type:[Boolean,String,Function]},options:{type:[Array,Function,String]},sortable:Boolean,target:String,text:String,width:String},computed:{hasFigure(){return!1!==this.image&&Object.keys(this.image).length>0},title(){return this.text||"-"}},methods:{onOption(t){this.$emit("action",t),this.$emit("option",t)}}},ic={};var sc=Ft(nc,ec,[],!1,oc,null,null,null);function oc(t){for(let e in ic)this[e]=ic[e]}var rc=function(){return sc.exports}();const ac={inheritAttrs:!1,props:{image:[Object,Boolean],layout:{type:String,default:"list"},width:String},computed:{back(){return this.image.back||"black"},ratio(){return"cards"===this.layout&&this.image.ratio||"1/1"},size(){switch(this.layout){case"cards":return"large";case"cardlets":return"medium";default:return"regular"}},sizes(){switch(this.width){case"1/2":case"2/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 44em, 27em";case"1/3":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 29.333em, 27em";case"1/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 22em, 27em";case"2/3":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 27em, 27em";case"3/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 66em, 27em";default:return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 88em, 27em"}}}},lc={};var uc=Ft(ac,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.image?n("div",{staticClass:"k-item-figure",style:{background:t.$helper.color(t.back)}},[t.image.src?n("k-image",{staticClass:"k-item-image",attrs:{cover:t.image.cover,ratio:t.ratio,sizes:t.sizes,src:t.image.src,srcset:t.image.srcset}}):n("k-aspect-ratio",{attrs:{ratio:t.ratio}},[n("k-icon",{staticClass:"k-item-icon",attrs:{color:t.$helper.color(t.image.color),type:t.image.icon}})],1)],1):t._e()}),[],!1,cc,null,null,null);function cc(t){for(let e in lc)this[e]=lc[e]}var dc=function(){return uc.exports}();const pc={inheritAttrs:!1,props:{columns:{type:[Object,Array],default:()=>({})},items:{type:Array,default:()=>[]},layout:{type:String,default:"list"},link:{type:Boolean,default:!0},image:{type:[Object,Boolean],default:()=>({})},sortable:Boolean,empty:{type:[String,Object]},size:{type:String,default:"default"}},computed:{dragOptions(){return{sort:this.sortable,disabled:!1===this.sortable,draggable:".k-draggable-item"}},table(){return{columns:this.columns,rows:this.items,sortable:this.sortable}}},methods:{onDragStart(t,e){this.$store.dispatch("drag",{type:"text",data:e})},onOption(t,e,n){this.$emit("option",t,e,n)},imageOptions(t){let e=this.image,n=t.image;return!1!==e&&!1!==n&&("object"!=typeof e&&(e={}),"object"!=typeof n&&(n={}),a(a({},n),e))}}},hc={};var fc=Ft(pc,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return"table"===t.layout?n("k-table",t._b({on:{change:function(e){return t.$emit("change",e)},sort:function(e){return t.$emit("sort",e)},option:t.onOption}},"k-table",t.table,!1)):n("k-draggable",{staticClass:"k-items",class:"k-"+t.layout+"-items",attrs:{handle:!0,options:t.dragOptions,"data-layout":t.layout,"data-size":t.size,list:t.items},on:{change:function(e){return t.$emit("change",e)},end:function(e){return t.$emit("sort",t.items,e)}}},t._l(t.items,(function(e,i){return n("k-item",t._b({key:e.id||i,class:{"k-draggable-item":t.sortable&&e.sortable},attrs:{image:t.imageOptions(e),layout:t.layout,link:!!t.link&&e.link,sortable:t.sortable&&e.sortable,width:e.column},on:{click:function(n){return t.$emit("item",e,i)},drag:function(n){return t.onDragStart(n,e.dragText)},option:function(n){return t.onOption(n,e,i)}},nativeOn:{mouseover:function(n){return t.$emit("hover",n,e,i)}},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options",null,null,{item:e,itemIndex:i})]},proxy:!0}],null,!0)},"k-item",e,!1))})),1)}),[],!1,mc,null,null,null);function mc(t){for(let e in hc)this[e]=hc[e]}var gc=function(){return fc.exports}();const kc={inheritAttrs:!0,props:{autofocus:{type:Boolean,default:!0},centered:{type:Boolean,default:!1},dimmed:{type:Boolean,default:!0},loading:{type:Boolean,default:!1}},data:()=>({isOpen:!1,scrollTop:0}),methods:{close(){!1!==this.isOpen&&(this.isOpen=!1,this.$emit("close"),this.restoreScrollPosition(),this.$events.$off("keydown.esc",this.close))},focus(){var t,e;let n=this.$refs.overlay.querySelector("\n [autofocus],\n [data-autofocus]\n ");return null===n&&(n=this.$refs.overlay.querySelector("\n input,\n textarea,\n select,\n button\n ")),"function"==typeof(null==n?void 0:n.focus)?n.focus():"function"==typeof(null==(e=null==(t=this.$slots.default[0])?void 0:t.context)?void 0:e.focus)?this.$slots.default[0].context.focus():void 0},open(){!0!==this.isOpen&&(this.storeScrollPosition(),this.isOpen=!0,this.$emit("open"),this.$events.$on("keydown.esc",this.close),setTimeout((()=>{!0===this.autofocus&&this.focus(),document.querySelector(".k-overlay > *").addEventListener("mousedown",(t=>t.stopPropagation())),this.$emit("ready")}),1))},restoreScrollPosition(){const t=document.querySelector(".k-panel-view");(null==t?void 0:t.scrollTop)&&(t.scrollTop=this.scrollTop)},storeScrollPosition(){const t=document.querySelector(".k-panel-view");(null==t?void 0:t.scrollTop)?this.scrollTop=t.scrollTop:this.scrollTop=0}}},vc={};var bc=Ft(kc,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.isOpen?n("portal",[n("div",t._g({ref:"overlay",staticClass:"k-overlay",class:t.$vnode.data.staticClass,attrs:{"data-centered":t.loading||t.centered,"data-dimmed":t.dimmed,"data-loading":t.loading,dir:t.$translation.direction},on:{mousedown:t.close}},t.$listeners),[t.loading?n("k-loader",{staticClass:"k-overlay-loader"}):t._t("default",null,{close:t.close,isOpen:t.isOpen})],2)]):t._e()}),[],!1,yc,null,null,null);function yc(t){for(let e in vc)this[e]=vc[e]}var $c=function(){return bc.exports}();const _c={};var xc=Ft({computed:{defaultLanguage(){return!!this.$language&&this.$language.default},dialog(){return this.$helper.clone(this.$store.state.dialog)},language(){return this.$language?this.$language.code:null},role(){return this.$user?this.$user.role:null},user(){return this.$user?this.$user.id:null}},created(){this.$events.$on("drop",this.drop)},destroyed(){this.$events.$off("drop",this.drop)},methods:{drop(){this.$store.dispatch("drag",null)}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-panel",attrs:{"data-dragging":t.$store.state.drag,"data-loading":t.$store.state.isLoading,"data-language":t.language,"data-language-default":t.defaultLanguage,"data-role":t.role,"data-translation":t.$translation.code,"data-user":t.user,dir:t.$translation.direction}},[t._t("default"),t.$store.state.dialog&&t.$store.state.dialog.props?[n("k-fiber-dialog",t._b({},"k-fiber-dialog",t.dialog,!1))]:t._e(),!1!==t.$store.state.fatal?n("k-fatal",{attrs:{html:t.$store.state.fatal}}):t._e(),!1===t.$system.isLocal?n("k-offline-warning"):t._e(),n("k-icons")],2)}),[],!1,wc,null,null,null);function wc(t){for(let e in _c)this[e]=_c[e]}var Sc=function(){return xc.exports}();const Cc={};var Oc=Ft({props:{reports:Array,size:{type:String,default:"large"}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("dl",{staticClass:"k-stats",attrs:{"data-size":t.size}},t._l(t.reports,(function(e,i){return n(e.link?"k-link":"div",{key:i,tag:"component",staticClass:"k-stat",attrs:{"data-theme":e.theme,"data-click":!!e.click,to:e.link},on:{click:function(t){e.click&&e.click()}}},[n("dt",{staticClass:"k-stat-label"},[t._v(t._s(e.label))]),n("dd",{staticClass:"k-stat-value"},[t._v(t._s(e.value))]),n("dd",{staticClass:"k-stat-info"},[t._v(t._s(e.info))])])})),1)}),[],!1,Ec,null,null,null);function Ec(t){for(let e in Cc)this[e]=Cc[e]}var Ac=function(){return Oc.exports}();const Tc={inheritAttrs:!1,props:{columns:Object,disabled:Boolean,fields:{type:Object,default:()=>({})},empty:String,index:{type:[Number,Boolean],default:1},rows:Array,options:[Array,Function],sortable:Boolean},data(){return{values:this.rows}},computed:{columnsCount(){return Object.keys(this.columns).length},dragOptions(){return{disabled:!this.sortable,fallbackClass:"k-table-row-fallback",ghostClass:"k-table-row-ghost"}},hasIndexColumn(){return this.sortable||!1!==this.index},hasOptions(){return this.options||Object.values(this.values).filter((t=>t.options)).length>0}},watch:{rows(){this.values=this.rows}},methods:{isColumnEmpty(t){return 0===this.rows.filter((e=>!1===this.$helper.object.isEmpty(e[t]))).length},label(t,e){return t.label||this.$helper.string.ucfirst(e)},onChange(t){this.$emit("change",t)},onCell(t){this.$emit("cell",t)},onCellUpdate({columnIndex:t,rowIndex:e,value:n}){this.values[e][t]=n,this.$emit("input",this.values)},onHeader(t){this.$emit("header",t)},onOption(t,e,n){this.$emit("option",t,e,n)},onSort(){this.$emit("input",this.values),this.$emit("sort",this.values)},width(t){return"string"!=typeof t?"auto":!1===t.includes("/")?t:this.$helper.ratio(t,"auto",!1)}}},Ic={};var Mc=Ft(Tc,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"k-table",attrs:{"data-disabled":t.disabled,"data-indexed":t.hasIndexColumn}},[n("thead",[n("tr",[t.hasIndexColumn?n("th",{staticClass:"k-table-index-column",attrs:{"data-mobile":""}},[t._v(" # ")]):t._e(),t._l(t.columns,(function(e,i){return n("th",{key:i+"-header",staticClass:"k-table-column",style:"width:"+t.width(e.width),attrs:{"data-mobile":e.mobile},on:{click:function(n){return t.onHeader({column:e,columnIndex:i})}}},[t._t("header",(function(){return[t._v(" "+t._s(t.label(e,i))+" ")]}),null,{column:e,columnIndex:i,label:t.label(e,i)})],2)})),t.hasOptions?n("th",{staticClass:"k-table-options-column",attrs:{"data-mobile":""}}):t._e()],2)]),n("k-draggable",{attrs:{list:t.values,options:t.dragOptions,handle:!0,element:"tbody"},on:{change:t.onChange,end:t.onSort}},[0===t.rows.length?n("tr",[n("td",{staticClass:"k-table-empty",attrs:{colspan:t.columnsCount}},[t._v(" "+t._s(t.empty)+" ")])]):t._l(t.values,(function(e,i){return n("tr",{key:i},[t.hasIndexColumn?n("td",{staticClass:"k-table-index-column",attrs:{"data-sortable":t.sortable&&!1!==e.sortable,"data-mobile":""}},[t._t("index",(function(){return[n("div",{staticClass:"k-table-index",domProps:{textContent:t._s(t.index+i)}})]}),null,{row:e,rowIndex:i}),t.sortable&&!1!==e.sortable?n("k-sort-handle",{staticClass:"k-table-sort-handle"}):t._e()],2):t._e(),t._l(t.columns,(function(s,o){return n("k-table-cell",{key:i+"-"+o,staticClass:"k-table-column",style:"width:"+t.width(s.width),attrs:{column:s,field:t.fields[o],row:e,mobile:s.mobile,value:e[o]},on:{input:function(e){return t.onCellUpdate({columnIndex:o,rowIndex:i,value:e})}},nativeOn:{click:function(n){return t.onCell({row:e,rowIndex:i,column:s,columnIndex:o})}}})})),t.hasOptions?n("td",{staticClass:"k-table-options-column",attrs:{"data-mobile":""}},[t._t("options",(function(){return[n("k-options-dropdown",{attrs:{options:e.options||t.options,text:(e.options||t.options).length>1},on:{option:function(n){return t.onOption(n,e,i)}}})]}),null,{row:e,rowIndex:i,options:t.options})],2):t._e()],2)}))],2)],1)}),[],!1,Lc,null,null,null);function Lc(t){for(let e in Ic)this[e]=Ic[e]}var jc=function(){return Mc.exports}();const Dc={inheritAttrs:!1,props:{column:Object,field:Object,mobile:{type:Boolean,default:!1},row:Object,value:{default:""}},computed:{component(){return this.$helper.isComponent(`k-${this.type}-field-preview`)?`k-${this.type}-field-preview`:this.$helper.isComponent(`k-table-${this.type}-cell`)?`k-table-${this.type}-cell`:Array.isArray(this.value)?"k-array-field-preview":"k-text-field-preview"},type(){var t;return this.column.type||(null==(t=this.field)?void 0:t.type)}}},Bc={};var Pc=Ft(Dc,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("td",{attrs:{"data-align":t.column.align,"data-mobile":t.mobile}},[!1===t.$helper.object.isEmpty(t.value)?[n(t.component,{tag:"component",attrs:{column:t.column,field:t.field,row:t.row,value:t.value},on:{input:function(e){return t.$emit("input",e)}}})]:t._e()],2)}),[],!1,Nc,null,null,null);function Nc(t){for(let e in Bc)this[e]=Bc[e]}var qc=function(){return Pc.exports}();const Fc={};var Rc=Ft({props:{tab:String,tabs:Array,theme:String},data(){return{size:null,visibleTabs:this.tabs,invisibleTabs:[]}},computed:{current(){return(this.tabs.find((t=>t.name===this.tab))||this.tabs[0]||{}).name}},watch:{tabs:{handler(t){this.visibleTabs=t,this.invisibleTabs=[],this.resize(!0)},immediate:!0}},created(){window.addEventListener("resize",this.resize)},destroyed(){window.removeEventListener("resize",this.resize)},methods:{resize(t){if(this.tabs&&!(this.tabs.length<=1)){if(this.tabs.length<=3)return this.visibleTabs=this.tabs,void(this.invisibleTabs=[]);if(window.innerWidth>=700){if("large"===this.size&&!t)return;this.visibleTabs=this.tabs,this.invisibleTabs=[],this.size="large"}else{if("small"===this.size&&!t)return;this.visibleTabs=this.tabs.slice(0,2),this.invisibleTabs=this.tabs.slice(2),this.size="small"}}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.tabs&&t.tabs.length>1?n("div",{staticClass:"k-tabs",attrs:{"data-theme":t.theme}},[n("nav",[t._l(t.visibleTabs,(function(e){return n("k-button",{key:e.name,staticClass:"k-tab-button",attrs:{link:e.link,current:t.current===e.name,icon:e.icon,tooltip:e.label}},[t._v(" "+t._s(e.label||e.text||e.name)+" "),e.badge?n("span",{staticClass:"k-tabs-badge"},[t._v(" "+t._s(e.badge)+" ")]):t._e()])})),t.invisibleTabs.length?n("k-button",{staticClass:"k-tab-button k-tabs-dropdown-button",attrs:{text:t.$t("more"),icon:"dots"},on:{click:function(e){return e.stopPropagation(),t.$refs.more.toggle()}}}):t._e()],2),t.invisibleTabs.length?n("k-dropdown-content",{ref:"more",staticClass:"k-tabs-dropdown",attrs:{align:"right"}},t._l(t.invisibleTabs,(function(e){return n("k-dropdown-item",{key:"more-"+e.name,attrs:{link:e.link,current:t.tab===e.name,icon:e.icon,tooltip:e.label}},[t._v(" "+t._s(e.label||e.text||e.name)+" ")])})),1):t._e()],1):t._e()}),[],!1,zc,null,null,null);function zc(t){for(let e in Fc)this[e]=Fc[e]}var Yc=function(){return Rc.exports}();const Hc={};var Uc=Ft({props:{align:String}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"k-view",attrs:{"data-align":t.align}},[t._t("default")],2)}),[],!1,Kc,null,null,null);function Kc(t){for(let e in Hc)this[e]=Hc[e]}var Jc=function(){return Uc.exports}();const Gc={components:{draggable:J},props:{data:Object,element:String,handle:[String,Boolean],list:[Array,Object],move:Function,options:Object},data(){return{listeners:l(a({},this.$listeners),{start:t=>{this.$store.dispatch("drag",{}),this.$listeners.start&&this.$listeners.start(t)},end:t=>{this.$store.dispatch("drag",null),this.$listeners.end&&this.$listeners.end(t)}})}},computed:{dragOptions(){let t=!1;return t=!0===this.handle?".k-sort-handle":this.handle,a({fallbackClass:"k-sortable-fallback",fallbackOnBody:!0,forceFallback:!0,ghostClass:"k-sortable-ghost",handle:t,scroll:document.querySelector(".k-panel-view")},this.options)}}},Vc={};var Wc=Ft(Gc,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("draggable",t._g(t._b({staticClass:"k-draggable",attrs:{"component-data":t.data,tag:t.element,list:t.list,move:t.move},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("footer")]},proxy:!0}],null,!0)},"draggable",t.dragOptions,!1),t.listeners),[t._t("default")],2)}),[],!1,Xc,null,null,null);function Xc(t){for(let e in Vc)this[e]=Vc[e]}var Zc=function(){return Wc.exports}();const Qc={};var td=Ft({data:()=>({error:null}),errorCaptured(t){return this.$config.debug&&window.console.warn(t),this.error=t,!1},render(t){return this.error?this.$slots.error?this.$slots.error[0]:this.$scopedSlots.error?this.$scopedSlots.error({error:this.error}):t("k-box",{attrs:{theme:"negative"}},this.error.message||this.error):this.$slots.default[0]}},undefined,undefined,!1,ed,null,null,null);function ed(t){for(let e in Qc)this[e]=Qc[e]}var nd=function(){return td.exports}();const id={};var sd=Ft({props:{html:String},mounted(){try{let t=this.$refs.iframe.contentWindow.document;t.open(),t.write(this.html),t.close()}catch(t){console.error(t)}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-fatal"},[n("div",{staticClass:"k-fatal-box"},[n("k-bar",{scopedSlots:t._u([{key:"left",fn:function(){return[n("k-headline",[t._v(" The JSON response could not be parsed ")])]},proxy:!0},{key:"right",fn:function(){return[n("k-button",{attrs:{icon:"cancel",text:"Close"},on:{click:function(e){return t.$store.dispatch("fatal",!1)}}})]},proxy:!0}])}),n("iframe",{ref:"iframe",staticClass:"k-fatal-iframe"})],1)])}),[],!1,od,null,null,null);function od(t){for(let e in id)this[e]=id[e]}var rd=function(){return sd.exports}();const ad={};var ld=Ft({props:{link:String,size:{type:String},tag:{type:String,default:"h2"},theme:{type:String}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n(t.tag,t._g({tag:"component",staticClass:"k-headline",attrs:{"data-theme":t.theme,"data-size":t.size}},t.$listeners),[t.link?n("k-link",{attrs:{to:t.link}},[t._t("default")],2):t._t("default")],2)}),[],!1,ud,null,null,null);function ud(t){for(let e in ad)this[e]=ad[e]}var cd=function(){return ld.exports}();const dd={};var pd=Ft({props:{alt:String,color:String,back:String,size:String,type:String},computed:{isEmoji(){return this.$helper.string.hasEmoji(this.type)}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{class:"k-icon k-icon-"+t.type,style:{background:t.$helper.color(t.back)},attrs:{"aria-label":t.alt,role:t.alt?"img":null,"aria-hidden":!t.alt,"data-back":t.back,"data-size":t.size}},[t.isEmoji?n("span",{staticClass:"k-icon-emoji"},[t._v(t._s(t.type))]):n("svg",{style:{color:t.$helper.color(t.color)},attrs:{viewBox:"0 0 16 16"}},[n("use",{attrs:{"xlink:href":"#icon-"+t.type}})])])}),[],!1,hd,null,null,null);function hd(t){for(let e in dd)this[e]=dd[e]}var fd=function(){return pd.exports}(),md=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("svg",{staticClass:"k-icons",attrs:{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",overflow:"hidden"}},[n("defs",t._l(t.$options.icons,(function(e,i){return n("symbol",{key:i,attrs:{id:"icon-"+i,viewBox:"0 0 16 16"},domProps:{innerHTML:t._s(e)}})})),0)])},gd=[];const kd={icons:window.panel.plugins.icons},vd={};var bd=Ft(kd,md,gd,!1,yd,null,null,null);function yd(t){for(let e in vd)this[e]=vd[e]}var $d=function(){return bd.exports}();const _d={props:{alt:String,back:String,cover:Boolean,ratio:String,sizes:String,src:String,srcset:String},data:()=>({loaded:{type:Boolean,default:!1},error:{type:Boolean,default:!1}}),computed:{ratioPadding(){return this.$helper.ratio(this.ratio||"1/1")}},created(){let t=new Image;t.onload=()=>{this.loaded=!0,this.$emit("load")},t.onerror=()=>{this.error=!0,this.$emit("error")},t.src=this.src}},xd={};var wd=Ft(_d,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",t._g({staticClass:"k-image",attrs:{"data-ratio":t.ratio,"data-back":t.back,"data-cover":t.cover}},t.$listeners),[n("span",{style:"padding-bottom:"+t.ratioPadding},[t.loaded?n("img",{key:t.src,attrs:{alt:t.alt||"",src:t.src,srcset:t.srcset,sizes:t.sizes},on:{dragstart:function(t){t.preventDefault()}}}):t._e(),t.loaded||t.error?t._e():n("k-loader",{attrs:{position:"center",theme:"light"}}),!t.loaded&&t.error?n("k-icon",{staticClass:"k-image-error",attrs:{type:"cancel"}}):t._e()],1)])}),[],!1,Sd,null,null,null);function Sd(t){for(let e in xd)this[e]=xd[e]}var Cd=function(){return wd.exports}();const Od={};var Ed=Ft({},(function(){var t=this.$createElement,e=this._self._c||t;return e("span",{staticClass:"k-loader"},[e("k-icon",{staticClass:"k-loader-icon",attrs:{type:"loader"}})],1)}),[],!1,Ad,null,null,null);function Ad(t){for(let e in Od)this[e]=Od[e]}var Td=function(){return Ed.exports}();const Id={};var Md=Ft({data:()=>({offline:!1}),created(){this.$events.$on("offline",this.isOffline),this.$events.$on("online",this.isOnline)},destroyed(){this.$events.$off("offline",this.isOffline),this.$events.$off("online",this.isOnline)},methods:{isOnline(){this.offline=!1},isOffline(){this.offline=!0}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.offline?n("div",{staticClass:"k-offline-warning"},[n("p",[n("k-icon",{attrs:{type:"bolt"}}),t._v(" "+t._s(t.$t("error.offline")))],1)]):t._e()}),[],!1,Ld,null,null,null);function Ld(t){for(let e in Id)this[e]=Id[e]}var jd=function(){return Md.exports}();const Dd=(t,e=!1)=>{if(t>=0&&t<=100)return!0;if(e)throw new Error("value has to be between 0 and 100");return!1},Bd={};var Pd=Ft({props:{value:{type:Number,default:0,validator:Dd}},data(){return{state:this.value}},watch:{value(t){this.state=t}},methods:{set(t){Dd(t,!0),this.state=t}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("progress",{staticClass:"k-progress",attrs:{max:"100"},domProps:{value:t.state}},[t._v(t._s(t.state)+"%")])}),[],!1,Nd,null,null,null);function Nd(t){for(let e in Bd)this[e]=Bd[e]}var qd=function(){return Pd.exports}();const Fd={};var Rd=Ft({},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-registration"},[n("p",[t._v(t._s(t.$t("license.unregistered")))]),n("k-button",{staticClass:"k-topbar-button",attrs:{responsive:!0,tooltip:t.$t("license.unregistered"),icon:"key"},on:{click:function(e){return t.$dialog("registration")}}},[t._v(" "+t._s(t.$t("license.register"))+" ")]),n("k-button",{staticClass:"k-topbar-button",attrs:{responsive:!0,link:"https://getkirby.com/buy",target:"_blank",icon:"cart"}},[t._v(" "+t._s(t.$t("license.buy"))+" ")])],1)}),[],!1,zd,null,null,null);function zd(t){for(let e in Fd)this[e]=Fd[e]}var Yd=function(){return Rd.exports}();const Hd={};var Ud=Ft({props:{icon:{type:String,default:"sort"}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("k-icon",{staticClass:"k-sort-handle",attrs:{type:t.icon,"aria-hidden":"true"}})}),[],!1,Kd,null,null,null);function Kd(t){for(let e in Hd)this[e]=Hd[e]}var Jd=function(){return Ud.exports}();const Gd={props:{click:{type:Function,default:()=>{}},disabled:Boolean,responsive:Boolean,status:String,text:String,tooltip:String},computed:{icon(){return"draft"===this.status?"circle-outline":"unlisted"===this.status?"circle-half":"circle"},theme(){return"draft"===this.status?"negative":"unlisted"===this.status?"info":"positive"},title(){let t=this.tooltip||this.text;return this.disabled&&(t+=` (${this.$t("disabled")})`),t}},methods:{onClick(){this.click(),this.$emit("click")}}},Vd={};var Wd=Ft(Gd,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("k-button",{class:"k-status-icon k-status-icon-"+t.status,attrs:{disabled:t.disabled,icon:t.icon,responsive:t.responsive,text:t.text,theme:t.theme,tooltip:t.title},on:{click:t.onClick}})}),[],!1,Xd,null,null,null);function Xd(t){for(let e in Vd)this[e]=Vd[e]}var Zd=function(){return Wd.exports}();const Qd={};var tp=Ft({props:{align:String,size:String,theme:String}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"k-text",attrs:{"data-align":t.align,"data-size":t.size,"data-theme":t.theme}},[t._t("default")],2)}),[],!1,ep,null,null,null);function ep(t){for(let e in Qd)this[e]=Qd[e]}var np=function(){return tp.exports}();const ip={};var sp=Ft({props:{user:[Object,String]}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-user-info"},[t.user.avatar?n("k-image",{attrs:{cover:!0,src:t.user.avatar.url,ratio:"1/1"}}):n("k-icon",{attrs:{type:"user"}}),t._v(" "+t._s(t.user.name||t.user.email||t.user)+" ")],1)}),[],!1,op,null,null,null);function op(t){for(let e in ip)this[e]=ip[e]}var rp=function(){return sp.exports}();const ap={};var lp=Ft({props:{crumbs:{type:Array,default:()=>[]},label:{type:String,default:"Breadcrumb"},view:Object},computed:{dropdown(){return this.segments.map((t=>l(a({},t),{text:t.label,icon:"angle-right"})))},segments(){return[{link:this.view.link,label:this.view.breadcrumbLabel,icon:this.view.icon,loading:this.$store.state.isLoading},...this.crumbs]}},methods:{isLast(t){return this.crumbs.length-1===t}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("nav",{staticClass:"k-breadcrumb",attrs:{"aria-label":t.label}},[n("k-dropdown",{staticClass:"k-breadcrumb-dropdown"},[n("k-button",{attrs:{icon:"road-sign"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),n("k-dropdown-content",{ref:"dropdown",attrs:{options:t.dropdown,theme:"light"}})],1),n("ol",t._l(t.segments,(function(e,i){return n("li",{key:i},[n("k-link",{staticClass:"k-breadcrumb-link",attrs:{title:e.text||e.label,to:e.link,"aria-current":!!t.isLast(i)&&"page"}},[e.loading?n("k-loader",{staticClass:"k-breadcrumb-icon"}):e.icon?n("k-icon",{staticClass:"k-breadcrumb-icon",attrs:{type:e.icon}}):t._e(),n("span",{staticClass:"k-breadcrumb-link-text"},[t._v(" "+t._s(e.text||e.label)+" ")])],1)],1)})),0)],1)}),[],!1,up,null,null,null);function up(t){for(let e in ap)this[e]=ap[e]}var cp=function(){return lp.exports}();const dp={inheritAttrs:!1,props:{autofocus:Boolean,click:Function,current:[String,Boolean],disabled:Boolean,icon:String,id:[String,Number],link:String,responsive:Boolean,rel:String,role:String,target:String,tabindex:String,text:[String,Number],theme:String,tooltip:String,type:{type:String,default:"button"}},computed:{component(){return!0===this.disabled?"k-button-disabled":this.link?"k-button-link":"k-button-native"}},methods:{focus(){this.$refs.button.focus&&this.$refs.button.focus()},tab(){this.$refs.button.tab&&this.$refs.button.tab()},untab(){this.$refs.button.untab&&this.$refs.button.untab()}}},pp={};var hp=Ft(dp,(function(){var t=this,e=t.$createElement;return(t._self._c||e)(t.component,t._g(t._b({ref:"button",tag:"component"},"component",t.$props,!1),t.$listeners),[t.text?[t._v(" "+t._s(t.text)+" ")]:t._t("default")],2)}),[],!1,fp,null,null,null);function fp(t){for(let e in pp)this[e]=pp[e]}var mp=function(){return hp.exports}();const gp={inheritAttrs:!1,props:{icon:String,id:[String,Number],responsive:Boolean,theme:String,tooltip:String}},kp={};var vp=Ft(gp,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{staticClass:"k-button",attrs:{id:t.id,"data-disabled":!0,"data-responsive":t.responsive,"data-theme":t.theme,title:t.tooltip}},[t.icon?n("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?n("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,bp,null,null,null);function bp(t){for(let e in kp)this[e]=kp[e]}var yp=function(){return vp.exports}();const $p={};var _p=Ft({props:{buttons:Array}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-button-group"},[t.$slots.default?t._t("default"):t._l(t.buttons,(function(e,i){return n("k-button",t._b({key:i},"k-button",e,!1))}))],2)}),[],!1,xp,null,null,null);function xp(t){for(let e in $p)this[e]=$p[e]}var wp=function(){return _p.exports}();const Sp={inheritAttrs:!1,props:{autofocus:Boolean,current:[String,Boolean],icon:String,id:[String,Number],link:String,rel:String,responsive:Boolean,role:String,target:String,tabindex:String,theme:String,tooltip:String},methods:{focus(){this.$el.focus()}}},Cp={};var Op=Ft(Sp,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-link",t._g({staticClass:"k-button",attrs:{id:t.id,"aria-current":t.current,autofocus:t.autofocus,"data-theme":t.theme,"data-responsive":t.responsive,rel:t.rel,role:t.role,tabindex:t.tabindex,target:t.target,title:t.tooltip,to:t.link}},t.$listeners),[t.icon?n("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?n("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,Ep,null,null,null);function Ep(t){for(let e in Cp)this[e]=Cp[e]}var Ap=function(){return Op.exports}(),Tp={mounted(){this.$el.addEventListener("keyup",this.onTab,!0),this.$el.addEventListener("blur",this.onUntab,!0)},destroyed(){this.$el.removeEventListener("keyup",this.onTab,!0),this.$el.removeEventListener("blur",this.onUntab,!0)},methods:{focus(){this.$el.focus&&this.$el.focus()},onTab(t){9===t.keyCode&&this.$el.setAttribute("data-tabbed",!0)},onUntab(){this.$el.removeAttribute("data-tabbed")},tab(){this.$el.focus(),this.$el.setAttribute("data-tabbed",!0)},untab(){this.$el.removeAttribute("data-tabbed")}}};const Ip={mixins:[Tp],inheritAttrs:!1,props:{autofocus:Boolean,click:{type:Function,default:()=>{}},current:[String,Boolean],icon:String,id:[String,Number],responsive:Boolean,role:String,tabindex:String,theme:String,tooltip:String,type:{type:String,default:"button"}}},Mp={};var Lp=Ft(Ip,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("button",t._g({staticClass:"k-button",attrs:{id:t.id,"aria-current":t.current,autofocus:t.autofocus,"data-theme":t.theme,"data-responsive":t.responsive,role:t.role,tabindex:t.tabindex,title:t.tooltip,type:t.type},on:{click:t.click}},t.$listeners),[t.icon?n("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?n("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,jp,null,null,null);function jp(t){for(let e in Mp)this[e]=Mp[e]}var Dp=function(){return Lp.exports}();const Bp={};var Pp=Ft({},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("span",{staticClass:"k-dropdown",on:{click:function(t){t.stopPropagation()}}},[t._t("default")],2)}),[],!1,Np,null,null,null);function Np(t){for(let e in Bp)this[e]=Bp[e]}var qp=function(){return Pp.exports}();let Fp=null;const Rp={};var zp=Ft({props:{align:{type:String,default:"left"},options:[Array,Function,String],theme:{type:String,default:"dark"}},data:()=>({current:-1,dropup:!1,isOpen:!1,items:[]}),methods:{async fetchOptions(t){if(!this.options)return t(this.items);"string"==typeof this.options?this.$dropdown(this.options)(t):"function"==typeof this.options?this.options(t):Array.isArray(this.options)&&t(this.options)},onOptionClick(t){"function"==typeof t.click?t.click.call(this):t.click&&this.$emit("action",t.click)},open(){this.reset(),Fp&&Fp!==this&&Fp.close(),this.fetchOptions((t=>{this.$events.$on("keydown",this.navigate),this.$events.$on("click",this.close),this.items=t,this.isOpen=!0,Fp=this,this.onOpen(),this.$emit("open")}))},reset(){this.current=-1,this.$events.$off("keydown",this.navigate),this.$events.$off("click",this.close)},close(){this.reset(),this.isOpen=Fp=!1,this.$emit("close")},toggle(){this.isOpen?this.close():this.open()},focus(t=0){var e;(null==(e=this.$children[t])?void 0:e.focus)&&(this.current=t,this.$children[t].focus())},onOpen(){this.dropup=!1,this.$nextTick((()=>{if(this.$el){let t=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,e=50,n=this.$el.getBoundingClientRect().top||0,i=this.$el.clientHeight;n+i>t-e&&i+2*ethis.$children.length-1){const t=this.$children.filter((t=>!1===t.disabled));this.current=this.$children.indexOf(t[t.length-1]);break}if(this.$children[this.current]&&!1===this.$children[this.current].disabled){this.focus(this.current);break}}break;case"Tab":for(;;){if(this.current++,this.current>this.$children.length-1){this.close(),this.$emit("leave",t.code);break}if(this.$children[this.current]&&!1===this.$children[this.current].disabled)break}}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.isOpen?n("div",{staticClass:"k-dropdown-content",attrs:{"data-align":t.align,"data-dropup":t.dropup,"data-theme":t.theme}},[t._t("default",(function(){return[t._l(t.items,(function(e,i){return["-"===e?n("hr",{key:t._uid+"-item-"+i}):n("k-dropdown-item",t._b({key:t._uid+"-item-"+i,ref:t._uid+"-item-"+i,refInFor:!0,on:{click:function(n){return t.onOptionClick(e)}}},"k-dropdown-item",e,!1),[t._v(" "+t._s(e.text)+" ")])]}))]}))],2):t._e()}),[],!1,Yp,null,null,null);function Yp(t){for(let e in Rp)this[e]=Rp[e]}var Hp=function(){return zp.exports}();const Up={inheritAttrs:!1,props:{disabled:Boolean,icon:String,image:[String,Object],link:String,target:String,theme:String,upload:String,current:[String,Boolean]},data(){return{listeners:l(a({},this.$listeners),{click:t=>{this.$parent.close(),this.$emit("click",t)}})}},methods:{focus(){this.$refs.button.focus()},tab(){this.$refs.button.tab()}}},Kp={};var Jp=Ft(Up,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("k-button",t._g(t._b({ref:"button",staticClass:"k-dropdown-item"},"k-button",t.$props,!1),t.listeners),[t._t("default")],2)}),[],!1,Gp,null,null,null);function Gp(t){for(let e in Kp)this[e]=Kp[e]}var Vp=function(){return Jp.exports}();const Wp={mixins:[Tp],props:{disabled:Boolean,rel:String,tabindex:[String,Number],target:String,title:String,to:[String,Function]},data(){return{relAttr:"_blank"===this.target?"noreferrer noopener":this.rel,listeners:l(a({},this.$listeners),{click:this.onClick})}},computed:{href(){return"function"==typeof this.to?"":"/"!==this.to[0]||this.target?!0===this.to.includes("@")&&!1===this.to.includes("/")?"mailto:"+this.to:this.to:this.$url(this.to)}},methods:{isRoutable(t){if(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)return!1;if(t.defaultPrevented)return!1;if(void 0!==t.button&&0!==t.button)return!1;if(this.target)return!1;if("string"==typeof this.href){if(this.href.includes("://")||this.href.startsWith("//"))return!1;if(this.href.includes("mailto:"))return!1}return!0},onClick(t){if(!0===this.disabled)return t.preventDefault(),!1;"function"==typeof this.to&&(t.preventDefault(),this.to()),this.isRoutable(t)&&(t.preventDefault(),this.$go(this.to)),this.$emit("click",t)}}},Xp={};var Zp=Ft(Wp,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.to&&!t.disabled?n("a",t._g({ref:"link",staticClass:"k-link",attrs:{href:t.href,rel:t.relAttr,tabindex:t.tabindex,target:t.target,title:t.title}},t.listeners),[t._t("default")],2):n("span",{staticClass:"k-link",attrs:{title:t.title,"data-disabled":""}},[t._t("default")],2)}),[],!1,Qp,null,null,null);function Qp(t){for(let e in Xp)this[e]=Xp[e]}var th=function(){return Zp.exports}();const eh={};var nh=Ft({computed:{defaultLanguage(){return this.$languages.find((t=>!0===t.default))},language(){return this.$language},languages(){return this.$languages.filter((t=>!1===t.default))}},methods:{change(t){this.$emit("change",t),this.$go(window.location,{query:{language:t.code}})}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.languages.length?n("k-dropdown",{staticClass:"k-languages-dropdown"},[n("k-button",{attrs:{text:t.language.name,responsive:!0,icon:"globe"},on:{click:function(e){return t.$refs.languages.toggle()}}}),t.languages?n("k-dropdown-content",{ref:"languages"},[n("k-dropdown-item",{on:{click:function(e){return t.change(t.defaultLanguage)}}},[t._v(" "+t._s(t.defaultLanguage.name)+" ")]),n("hr"),t._l(t.languages,(function(e){return n("k-dropdown-item",{key:e.code,on:{click:function(n){return t.change(e)}}},[t._v(" "+t._s(e.name)+" ")])}))],2):t._e()],1):t._e()}),[],!1,ih,null,null,null);function ih(t){for(let e in eh)this[e]=eh[e]}var sh=function(){return nh.exports}();const oh={props:{align:{type:String,default:"right"},icon:{type:String,default:"dots"},options:{type:[Array,Function,String],default:()=>[]},text:{type:[Boolean,String],default:!0},theme:{type:String,default:"dark"}},computed:{hasSingleOption(){return Array.isArray(this.options)&&1===this.options.length}},methods:{onAction(t,e,n){"function"==typeof t?t.call(this):(this.$emit("action",t,e,n),this.$emit("option",t,e,n))},toggle(){this.$refs.options.toggle()}}},rh={};var ah=Ft(oh,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.hasSingleOption?n("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{icon:t.options[0].icon||t.icon,tooltip:t.options[0].tooltip||t.options[0].text},on:{click:function(e){return t.onAction(t.options[0].option||t.options[0].click,t.options[0],0)}}},[!0===t.text?[t._v(" "+t._s(t.options[0].text)+" ")]:!1!==t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2):t.options.length?n("k-dropdown",{staticClass:"k-options-dropdown"},[n("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{icon:t.icon,tooltip:t.$t("options")},on:{click:function(e){return t.$refs.options.toggle()}}},[t.text&&!0!==t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2),n("k-dropdown-content",{ref:"options",staticClass:"k-options-dropdown-content",attrs:{align:t.align,options:t.options},on:{action:t.onAction}})],1):t._e()}),[],!1,lh,null,null,null);function lh(t){for(let e in rh)this[e]=rh[e]}var uh=function(){return ah.exports}();const ch={props:{align:{type:String,default:"left"},details:{type:Boolean,default:!1},dropdown:{type:Boolean,default:!0},keys:{type:Boolean,default:!1},limit:{type:Number,default:10},page:{type:Number,default:1},pageLabel:{type:String,default:()=>window.panel.$t("pagination.page")},total:{type:Number,default:0},prevLabel:{type:String,default:()=>window.panel.$t("prev")},nextLabel:{type:String,default:()=>window.panel.$t("next")},validate:{type:Function,default:()=>Promise.resolve()}},data(){return{currentPage:this.page}},computed:{show(){return this.pages>1},start(){return(this.currentPage-1)*this.limit+1},end(){let t=this.start-1+this.limit;return t>this.total?this.total:t},detailsText(){return 1===this.limit?this.start+" / ":this.start+"-"+this.end+" / "},pages(){return Math.ceil(this.total/this.limit)},hasPrev(){return this.start>1},hasNext(){return this.endthis.limit},offset(){return this.start-1}},watch:{page(t){this.currentPage=parseInt(t)}},created(){!0===this.keys&&window.addEventListener("keydown",this.navigate,!1)},destroyed(){window.removeEventListener("keydown",this.navigate,!1)},methods:{async goTo(t){try{await this.validate(t),t<1&&(t=1),t>this.pages&&(t=this.pages),this.currentPage=t,this.$refs.dropdown&&this.$refs.dropdown.close(),this.$emit("paginate",{page:this.currentPage,start:this.start,end:this.end,limit:this.limit,offset:this.offset})}catch(e){}},prev(){this.goTo(this.currentPage-1)},next(){this.goTo(this.currentPage+1)},navigate(t){switch(t.code){case"ArrowLeft":this.prev();break;case"ArrowRight":this.next()}}}},dh={};var ph=Ft(ch,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.show?n("nav",{staticClass:"k-pagination",attrs:{"data-align":t.align}},[t.show?n("k-button",{attrs:{disabled:!t.hasPrev,tooltip:t.prevLabel,icon:"angle-left"},on:{click:t.prev}}):t._e(),t.details?[t.dropdown?[n("k-dropdown",[n("k-button",{staticClass:"k-pagination-details",attrs:{disabled:!t.hasPages},on:{click:function(e){return t.$refs.dropdown.toggle()}}},[t.total>1?[t._v(" "+t._s(t.detailsText)+" ")]:t._e(),t._v(" "+t._s(t.total)+" ")],2),n("k-dropdown-content",{ref:"dropdown",staticClass:"k-pagination-selector",on:{open:function(e){t.$nextTick((function(){return t.$refs.page.focus()}))}}},[n("div",{staticClass:"k-pagination-settings"},[n("label",{attrs:{for:"k-pagination-page"}},[n("span",[t._v(t._s(t.pageLabel)+":")]),n("select",{ref:"page",attrs:{id:"k-pagination-page"}},t._l(t.pages,(function(e){return n("option",{key:e,domProps:{selected:t.page===e,value:e}},[t._v(" "+t._s(e)+" ")])})),0)]),n("k-button",{attrs:{icon:"check"},on:{click:function(e){return t.goTo(t.$refs.page.value)}}})],1)])],1)]:[n("span",{staticClass:"k-pagination-details"},[t.total>1?[t._v(" "+t._s(t.detailsText)+" ")]:t._e(),t._v(" "+t._s(t.total)+" ")],2)]]:t._e(),t.show?n("k-button",{attrs:{disabled:!t.hasNext,tooltip:t.nextLabel,icon:"angle-right"},on:{click:t.next}}):t._e()],2):t._e()}),[],!1,hh,null,null,null);function hh(t){for(let e in dh)this[e]=dh[e]}var fh=function(){return ph.exports}();const mh={props:{prev:{type:[Boolean,Object],default:!1},next:{type:[Boolean,Object],default:!1}},computed:{buttons(){return[l(a({},this.button(this.prev)),{icon:"angle-left"}),l(a({},this.button(this.next)),{icon:"angle-right"})]}},methods:{button:t=>t||{disabled:!0,link:"#"}}},gh={};var kh=Ft(mh,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("k-button-group",{staticClass:"k-prev-next",attrs:{buttons:t.buttons}})}),[],!1,vh,null,null,null);function vh(t){for(let e in gh)this[e]=gh[e]}var bh=function(){return kh.exports}();const yh={};var $h=Ft({props:{types:{type:Object,default:()=>({})},type:String},data(){return{isLoading:!1,hasResults:!0,items:[],currentType:this.getType(this.type),q:null,selected:-1}},watch:{q(t,e){t!==e&&this.search(this.q)},currentType(t,e){t!==e&&this.search(this.q)},type(){this.currentType=this.getType(this.type)}},created(){this.search=$t(this.search,250),this.$events.$on("keydown.cmd.shift.f",this.open)},destroyed(){this.$events.$off("keydown.cmd.shift.f",this.open)},methods:{changeType(t){this.currentType=this.getType(t),this.$nextTick((()=>{this.$refs.input.focus()}))},close(){this.$refs.overlay.close(),this.hasResults=!0,this.items=[],this.q=null},getType(t){return this.types[t]||this.types[Object.keys(this.types)[0]]},navigate(t){this.$go(t.link),this.close()},onDown(){this.selected=0&&this.select(this.selected-1)},open(){this.$refs.overlay.open()},async search(t){this.isLoading=!0,this.$refs.types&&this.$refs.types.close();try{if(null===t||""===t)throw Error("Empty query");const e=await this.$search(this.currentType.id,t);if(!1===e)throw Error("JSON parsing failed");this.items=e.results}catch(e){this.items=[]}finally{this.select(-1),this.isLoading=!1,this.hasResults=this.items.length>0}},select(t){if(this.selected=t,this.$refs.items){const e=this.$refs.items.$el.querySelectorAll(".k-item");[...e].forEach((t=>delete t.dataset.selected)),t>=0&&(e[t].dataset.selected=!0)}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-overlay",{ref:"overlay"},[n("div",{staticClass:"k-search",attrs:{role:"search"}},[n("div",{staticClass:"k-search-input"},[n("k-dropdown",{staticClass:"k-search-types"},[n("k-button",{attrs:{icon:t.currentType.icon,text:t.currentType.label},on:{click:function(e){return t.$refs.types.toggle()}}}),n("k-dropdown-content",{ref:"types"},t._l(t.types,(function(e,i){return n("k-dropdown-item",{key:i,attrs:{icon:e.icon},on:{click:function(e){return t.changeType(i)}}},[t._v(" "+t._s(e.label)+" ")])})),1)],1),n("input",{directives:[{name:"model",rawName:"v-model",value:t.q,expression:"q"}],ref:"input",attrs:{placeholder:t.$t("search")+" …","aria-label":t.$t("search"),autofocus:!0,type:"text"},domProps:{value:t.q},on:{input:[function(e){e.target.composing||(t.q=e.target.value)},function(e){t.hasResults=!0}],keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.onDown.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.onUp.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:(e.preventDefault(),t.onTab.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onEnter.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.close.apply(null,arguments)}]}}),n("k-button",{staticClass:"k-search-close",attrs:{icon:t.isLoading?"loader":"cancel",tooltip:t.$t("close")},on:{click:t.close}})],1),!t.q||t.hasResults&&!t.items.length?t._e():n("div",{staticClass:"k-search-results"},[t.items.length?n("k-collection",{ref:"items",attrs:{items:t.items},on:{hover:t.onHover},nativeOn:{mouseout:function(e){return t.select(-1)}}}):t.hasResults?t._e():n("p",{staticClass:"k-search-empty"},[t._v(" "+t._s(t.$t("search.results.none"))+" ")])],1)])])}),[],!1,_h,null,null,null);function _h(t){for(let e in yh)this[e]=yh[e]}var xh=function(){return $h.exports}();const wh={props:{removable:Boolean},methods:{remove(){this.removable&&this.$emit("remove")},focus(){this.$refs.button.focus()}}},Sh={};var Ch=Ft(wh,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{ref:"button",staticClass:"k-tag",attrs:{tabindex:"0"},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:(e.preventDefault(),t.remove.apply(null,arguments))}}},[n("span",{staticClass:"k-tag-text"},[t._t("default")],2),t.removable?n("k-icon",{staticClass:"k-tag-toggle",attrs:{type:"cancel-small"},nativeOn:{click:function(e){return t.remove.apply(null,arguments)}}}):t._e()],1)}),[],!1,Oh,null,null,null);function Oh(t){for(let e in Sh)this[e]=Sh[e]}var Eh=function(){return Ch.exports}();const Ah={props:{breadcrumb:Array,license:Boolean,menu:Array,title:String,view:Object},computed:{notification(){return this.$store.state.notification.type&&"error"!==this.$store.state.notification.type?this.$store.state.notification:null}}},Th={};var Ih=Ft(Ah,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-topbar"},[n("k-view",[n("div",{staticClass:"k-topbar-wrapper"},[n("k-dropdown",{staticClass:"k-topbar-menu"},[n("k-button",{staticClass:"k-topbar-button k-topbar-menu-button",attrs:{tooltip:t.$t("menu"),icon:"bars"},on:{click:function(e){return t.$refs.menu.toggle()}}},[n("k-icon",{attrs:{type:"angle-down"}})],1),n("k-dropdown-content",{ref:"menu",staticClass:"k-topbar-menu",attrs:{options:t.menu,theme:"light"}})],1),n("k-breadcrumb",{staticClass:"k-topbar-breadcrumb",attrs:{crumbs:t.breadcrumb,view:t.view}}),n("div",{staticClass:"k-topbar-signals"},[t.notification?n("k-button",{staticClass:"k-topbar-notification k-topbar-button",attrs:{text:t.notification.message,theme:"positive"},on:{click:function(e){return t.$store.dispatch("notification/close")}}}):t.license?t._e():n("k-registration"),n("k-form-indicator"),n("k-button",{staticClass:"k-topbar-button",attrs:{tooltip:t.$t("search"),icon:"search"},on:{click:function(e){return t.$refs.search.open()}}})],1)],1)]),n("k-search",{ref:"search",attrs:{type:t.$view.search||"pages",types:t.$searches}})],1)}),[],!1,Mh,null,null,null);function Mh(t){for(let e in Th)this[e]=Th[e]}var Lh=function(){return Ih.exports}();const jh={props:{empty:String,blueprint:String,lock:[Boolean,Object],parent:String,tab:Object},computed:{content(){return this.$store.getters["content/values"]()}},methods:{exists(t){return this.$helper.isComponent(`k-${t}-section`)},meetsCondition(t){if(!t.when)return!0;let e=!0;return Object.keys(t.when).forEach((n=>{this.content[n.toLowerCase()]!==t.when[n]&&(e=!1)})),e}}},Dh={};var Bh=Ft(jh,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return 0===t.tab.columns.length?n("k-box",{attrs:{html:!0,text:t.empty,theme:"info"}}):n("k-grid",{staticClass:"k-sections",attrs:{gutter:"large"}},t._l(t.tab.columns,(function(e,i){return n("k-column",{key:t.parent+"-column-"+i,attrs:{width:e.width,sticky:e.sticky}},[t._l(e.sections,(function(s,o){return[t.meetsCondition(s)?[t.exists(s.type)?n("k-"+s.type+"-section",t._b({key:t.parent+"-column-"+i+"-section-"+o+"-"+t.blueprint,tag:"component",class:"k-section k-section-name-"+s.name,attrs:{column:e.width,lock:t.lock,name:s.name,parent:t.parent,timestamp:t.$view.timestamp},on:{submit:function(e){return t.$emit("submit",e)}}},"component",s,!1)):[n("k-box",{key:t.parent+"-column-"+i+"-section-"+o,attrs:{text:t.$t("error.section.type.invalid",{type:s.type}),theme:"negative"}})]]:t._e()]}))],2)})),1)}),[],!1,Ph,null,null,null);function Ph(t){for(let e in Dh)this[e]=Dh[e]}var Nh=function(){return Bh.exports}();const qh={};var Fh=Ft({mixins:[Nt],inheritAttrs:!1,data:()=>({fields:{},isLoading:!0,issue:null}),computed:{values(){return this.$store.getters["content/values"]()}},watch:{timestamp(){this.fetch()}},created(){this.input=$t(this.input,50),this.fetch()},methods:{input(t,e,n){this.$store.dispatch("content/update",[n,t[n]])},async fetch(){try{const t=await this.load();this.fields=t.fields,Object.keys(this.fields).forEach((t=>{this.fields[t].section=this.name,this.fields[t].endpoints={field:this.parent+"/fields/"+t,section:this.parent+"/sections/"+this.name,model:this.parent}}))}catch(t){this.issue=t}finally{this.isLoading=!1}},onSubmit(t){this.$events.$emit("keydown.cmd.s",t)}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.isLoading?t._e():n("section",{staticClass:"k-fields-section"},[t.issue?[n("k-headline",{staticClass:"k-fields-issue-headline"},[t._v(" Error ")]),n("k-box",{attrs:{text:t.issue.message,html:!1,theme:"negative"}})]:t._e(),n("k-form",{attrs:{fields:t.fields,validate:!0,value:t.values,disabled:t.lock&&"lock"===t.lock.state},on:{input:t.input,submit:t.onSubmit}})],2)}),[],!1,Rh,null,null,null);function Rh(t){for(let e in qh)this[e]=qh[e]}var zh=function(){return Fh.exports}(),Yh=function(){var t=this,e=t.$createElement,n=t._self._c||e;return!1===t.isLoading?n("section",{class:`k-models-section k-${t.type}-section`,attrs:{"data-processing":t.isProcessing}},[n("header",{staticClass:"k-section-header"},[n("k-headline",{attrs:{link:t.options.link}},[t._v(" "+t._s(t.options.headline||" ")+" "),t.options.min?n("abbr",{attrs:{title:t.$t("section.required")}},[t._v("*")]):t._e()]),n("k-button-group",{attrs:{buttons:t.buttons}})],1),t.error?n("k-box",{attrs:{theme:"negative"}},[n("k-text",{attrs:{size:"small"}},[n("strong",[t._v(" "+t._s(t.$t("error.section.notLoaded",{name:t.name}))+": ")]),t._v(" "+t._s(t.error)+" ")])],1):[n("k-dropzone",{attrs:{disabled:!t.canDrop},on:{drop:t.onDrop}},[t.searching&&t.options.search?n("k-input",{staticClass:"k-models-section-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",type:"text"},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.onSearchToggle.apply(null,arguments)}},model:{value:t.searchterm,callback:function(e){t.searchterm=e},expression:"searchterm"}}):t._e(),n("k-collection",t._g(t._b({attrs:{"data-invalid":t.isInvalid},on:{action:t.onAction,change:t.onChange,sort:t.onSort,paginate:t.onPaginate}},"k-collection",t.collection,!1),t.canAdd?{empty:t.onAdd}:{}))],1),n("k-upload",{ref:"upload",on:{success:t.onUpload,error:t.reload}})]],2):t._e()},Hh=[];const Uh={inheritAttrs:!1,props:{blueprint:String,column:String,parent:String,name:String,timestamp:Number},data:()=>({data:[],error:null,isLoading:!1,isProcessing:!1,options:{columns:{},empty:null,headline:null,help:null,layout:"list",link:null,max:null,min:null,size:null,sortable:null},pagination:{page:null},searchterm:null,searching:!1}),computed:{addIcon:()=>"add",buttons(){let t=[];return this.canSearch&&t.push({icon:"filter",text:this.$t("search"),click:this.onSearchToggle,responsive:!0}),this.canAdd&&t.push({icon:this.addIcon,text:this.$t("add"),click:this.onAdd}),t},canAdd:()=>!0,canDrop:()=>!1,canSearch(){return this.options.search},collection(){return{columns:this.options.columns,empty:this.emptyPropsWithSearch,layout:this.options.layout,help:this.options.help,items:this.items,pagination:this.pagination,sortable:!this.isProcessing&&this.options.sortable,size:this.options.size}},emptyProps(){return{icon:"page",text:this.$t("pages.empty")}},emptyPropsWithSearch(){return l(a({},this.emptyProps),{text:this.searching?this.$t("search.results.none"):this.options.empty||this.emptyProps.text})},items(){return this.data},isInvalid(){var t;return!((null==(t=this.searchterm)?void 0:t.length)>0)&&(!!(this.options.min&&this.data.lengththis.options.max))},paginationId(){return"kirby$pagination$"+this.parent+"/"+this.name},type:()=>"models"},watch:{searchterm:$t((function(){this.pagination.page=0,this.reload()}),200),timestamp(){this.reload()}},created(){this.load()},methods:{async load(t){t||(this.isLoading=!0),this.isProcessing=!0,null===this.pagination.page&&(this.pagination.page=localStorage.getItem(this.paginationId)||1);try{const t=await this.$api.get(this.parent+"/sections/"+this.name,{page:this.pagination.page,searchterm:this.searchterm});this.options=t.options,this.pagination=t.pagination,this.data=t.data}catch(e){this.error=e.message}finally{this.isProcessing=!1,this.isLoading=!1}},onAction(){},onAdd(){},onChange(){},onDrop(){},onSort(){},onPaginate(t){localStorage.setItem(this.paginationId,t.page),this.pagination=t,this.reload()},onSearchToggle(){this.searching=!this.searching,this.searchterm=null},onUpload(){},async reload(){await this.load(!0)},update(){this.reload(),this.$events.$emit("model.update")}}},Kh={};var Jh=Ft(Uh,Yh,Hh,!1,Gh,null,null,null);function Gh(t){for(let e in Kh)this[e]=Kh[e]}var Vh=function(){return Jh.exports}();const Wh={};var Xh=Ft({extends:Vh,computed:{addIcon:()=>"upload",canAdd(){return this.$permissions.files.create&&!1!==this.options.upload},canDrop(){return!1!==this.canAdd},emptyProps(){return{icon:"image",text:this.$t("files.empty")}},items(){return this.data.map((t=>(t.sortable=this.options.sortable,t.column=this.column,t.options=this.$dropdown(t.link,{query:{view:"list",update:this.options.sortable,delete:this.data.length>this.options.min}}),t.data={"data-id":t.id,"data-template":t.template},t)))},type:()=>"files",uploadProps(){return l(a({},this.options.upload),{url:this.$urls.api+"/"+this.options.upload.api})}},created(){this.load(),this.$events.$on("model.update",this.reload),this.$events.$on("file.sort",this.reload)},destroyed(){this.$events.$off("model.update",this.reload),this.$events.$off("file.sort",this.reload)},methods:{onAction(t,e){"replace"===t&&this.replace(e)},onAdd(){this.canAdd&&this.$refs.upload.open(this.uploadProps)},onDrop(t){this.canAdd&&this.$refs.upload.drop(t,this.uploadProps)},async onSort(t){if(!1===this.options.sortable)return!1;this.isProcessing=!0;try{await this.$api.patch(this.options.apiUrl+"/files/sort",{files:t.map((t=>t.id)),index:this.pagination.offset}),this.$store.dispatch("notification/success",":)"),this.$events.$emit("file.sort")}catch(e){this.reload(),this.$store.dispatch("notification/error",e.message)}finally{this.isProcessing=!1}},onUpload(){this.$events.$emit("file.create"),this.$events.$emit("model.update"),this.$store.dispatch("notification/success",":)")},replace(t){this.$refs.upload.open({url:this.$urls.api+"/"+t.link,accept:"."+t.extension+","+t.mime,multiple:!1})}}},undefined,undefined,!1,Zh,null,null,null);function Zh(t){for(let e in Wh)this[e]=Wh[e]}var Qh=function(){return Xh.exports}();const tf={};var ef=Ft({mixins:[Nt],data:()=>({headline:null,text:null,theme:null}),async created(){const t=await this.load();this.headline=t.headline,this.text=t.text,this.theme=t.theme||"info"}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("section",{staticClass:"k-info-section"},[n("k-headline",{staticClass:"k-info-section-headline"},[t._v(" "+t._s(t.headline)+" ")]),n("k-box",{attrs:{theme:t.theme}},[n("k-text",{domProps:{innerHTML:t._s(t.text)}})],1)],1)}),[],!1,nf,null,null,null);function nf(t){for(let e in tf)this[e]=tf[e]}var sf=function(){return ef.exports}();const of={};var rf=Ft({extends:Vh,computed:{canAdd(){return this.options.add&&this.$permissions.pages.create},items(){return this.data.map((t=>{const e=!1!==t.permissions.changeStatus;return t.flag={status:t.status,tooltip:this.$t("page.status"),disabled:!e,click:()=>this.$dialog(t.link+"/changeStatus")},t.sortable=t.permissions.sort&&this.options.sortable,t.deletable=this.data.length>this.options.min,t.column=this.column,t.options=this.$dropdown(t.link,{query:{view:"list",delete:t.deletable,sort:t.sortable}}),t.data={"data-id":t.id,"data-status":t.status,"data-template":t.template},t}))}},created(){this.load(),this.$events.$on("page.changeStatus",this.reload),this.$events.$on("page.sort",this.reload)},destroyed(){this.$events.$off("page.changeStatus",this.reload),this.$events.$off("page.sort",this.reload)},methods:{onAdd(){this.canAdd&&this.$dialog("pages/create",{query:{parent:this.options.link||this.parent,view:this.parent,section:this.name}})},async onChange(t){let e=null;if(t.added&&(e="added"),t.moved&&(e="moved"),e){this.isProcessing=!0;const i=t[e].element,s=t[e].newIndex+1+this.pagination.offset;try{await this.$api.pages.changeStatus(i.id,"listed",s),this.$store.dispatch("notification/success",":)"),this.$events.$emit("page.sort",i)}catch(n){this.$store.dispatch("notification/error",{message:n.message,details:n.details}),await this.reload()}finally{this.isProcessing=!1}}}}},undefined,undefined,!1,af,null,null,null);function af(t){for(let e in of)this[e]=of[e]}var lf=function(){return rf.exports}();const uf={};var cf=Ft({mixins:[Nt],data:()=>({isLoading:!0,headline:null,reports:null,size:null}),async created(){const t=await this.load();this.isLoading=!1,this.headline=t.headline,this.reports=t.reports,this.size=t.size},methods:{}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return!1===t.isLoading?n("section",{staticClass:"k-stats-section"},[n("header",{staticClass:"k-section-header"},[n("k-headline",[t._v(" "+t._s(t.headline)+" ")])],1),t.reports.length>0?n("k-stats",{attrs:{reports:t.reports,size:t.size}}):n("k-empty",{attrs:{icon:"chart"}},[t._v(" "+t._s(t.empty||t.$t("stats.empty")))])],1):t._e()}),[],!1,df,null,null,null);function df(t){for(let e in uf)this[e]=uf[e]}var pf=function(){return cf.exports}();u.component("k-sections",Nh),u.component("k-fields-section",zh),u.component("k-files-section",Qh),u.component("k-info-section",sf),u.component("k-pages-section",lf),u.component("k-stats-section",pf);const hf={props:{blueprint:String,next:Object,prev:Object,permissions:{type:Object,default:()=>({})},lock:{type:[Boolean,Object]},model:{type:Object,default:()=>({})},tab:{type:Object,default:()=>({columns:[]})},tabs:{type:Array,default:()=>[]}},computed:{id(){return this.model.link},isLocked(){var t;return"lock"===(null==(t=this.lock)?void 0:t.state)},protectedFields:()=>[]},watch:{"model.id":{handler(){this.content()},immediate:!0}},created(){this.$events.$on("model.reload",this.reload),this.$events.$on("keydown.left",this.toPrev),this.$events.$on("keydown.right",this.toNext)},destroyed(){this.$events.$off("model.reload",this.reload),this.$events.$off("keydown.left",this.toPrev),this.$events.$off("keydown.right",this.toNext)},methods:{content(){this.$store.dispatch("content/create",{id:this.id,api:this.id,content:this.model.content,ignore:this.protectedFields})},async reload(){await this.$reload(),this.content()},toPrev(t){this.prev&&"body"===t.target.localName&&this.$go(this.prev.link)},toNext(t){this.next&&"body"===t.target.localName&&this.$go(this.next.link)}}};const ff={};var mf=Ft(hf,undefined,undefined,!1,gf,null,null,null);function gf(t){for(let e in ff)this[e]=ff[e]}var kf=function(){return mf.exports}();const vf={};var bf=Ft({extends:kf,computed:{avatarOptions(){return[{icon:"upload",text:this.$t("change"),click:()=>this.$refs.upload.open()},{icon:"trash",text:this.$t("delete"),click:this.deleteAvatar}]},buttons(){return[{icon:"email",text:`${this.$t("email")}: ${this.model.email}`,disabled:!this.permissions.changeEmail||this.isLocked,click:()=>this.$dialog(this.id+"/changeEmail")},{icon:"bolt",text:`${this.$t("role")}: ${this.model.role}`,disabled:!this.permissions.changeRole||this.isLocked,click:()=>this.$dialog(this.id+"/changeRole")},{icon:"globe",text:`${this.$t("language")}: ${this.model.language}`,disabled:!this.permissions.changeLanguage||this.isLocked,click:()=>this.$dialog(this.id+"/changeLanguage")}]},uploadApi(){return this.$urls.api+"/"+this.id+"/avatar"}},methods:{async deleteAvatar(){await this.$api.users.deleteAvatar(this.model.id),this.avatar=null,this.$store.dispatch("notification/success",":)"),this.$reload()},onAvatar(){this.model.avatar?this.$refs.picture.toggle():this.$refs.upload.open()},uploadedAvatar(){this.$store.dispatch("notification/success",":)"),this.$reload()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[n("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[n("div",{staticClass:"k-user-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[n("div",{staticClass:"k-user-profile"},[n("k-view",[n("k-dropdown",[n("k-button",{staticClass:"k-user-view-image",attrs:{tooltip:t.$t("avatar"),disabled:t.isLocked},on:{click:t.onAvatar}},[t.model.avatar?n("k-image",{attrs:{cover:!0,src:t.model.avatar,ratio:"1/1"}}):n("k-icon",{attrs:{back:"gray-900",color:"gray-200",type:"user"}})],1),t.model.avatar?n("k-dropdown-content",{ref:"picture",attrs:{options:t.avatarOptions}}):t._e()],1),n("k-button-group",{attrs:{buttons:t.buttons}})],1)],1),n("k-view",[n("k-header",{attrs:{editable:t.permissions.changeName&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"left",fn:function(){return[n("k-button-group",[n("k-dropdown",{staticClass:"k-user-view-options"},[n("k-button",{attrs:{disabled:t.isLocked,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),n("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)}})],1),n("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[t.model.account?t._e():n("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[t.model.name&&0!==t.model.name.length?[t._v(" "+t._s(t.model.name)+" ")]:n("span",{staticClass:"k-user-name-placeholder"},[t._v(" "+t._s(t.$t("name"))+" … ")])],2),n("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("user.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}}),n("k-upload",{ref:"upload",attrs:{url:t.uploadApi,multiple:!1,accept:"image/*"},on:{success:t.uploadedAvatar}})],1)],1)])}),[],!1,yf,null,null,null);function yf(t){for(let e in vf)this[e]=vf[e]}var $f=function(){return bf.exports}();const _f={};var xf=Ft({extends:$f,prevnext:!1},undefined,undefined,!1,wf,null,null,null);function wf(t){for(let e in _f)this[e]=_f[e]}var Sf=function(){return xf.exports}();const Cf={};var Of=Ft({props:{error:String,layout:String}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n(`k-${t.layout}`,{tag:"component"},[n("k-view",{staticClass:"k-error-view"},[n("div",{staticClass:"k-error-view-content"},[n("k-text",[n("p",[n("k-icon",{staticClass:"k-error-view-icon",attrs:{type:"alert"}})],1),t._t("default",(function(){return[n("p",[t._v(" "+t._s(t.error)+" ")])]}))],2)],1)])],1)}),[],!1,Ef,null,null,null);function Ef(t){for(let e in Cf)this[e]=Cf[e]}var Af=function(){return Of.exports}();const Tf={};var If=Ft({extends:kf,props:{preview:Object},methods:{action(t){if("replace"===t)this.$refs.upload.open({url:this.$urls.api+"/"+this.id,accept:"."+this.model.extension+","+this.model.mime,multiple:!1})},onUpload(){this.$store.dispatch("notification/success",":)"),this.$reload()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[n("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[n("div",{staticClass:"k-file-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[n("k-file-preview",t._b({},"k-file-preview",t.preview,!1)),n("k-view",{staticClass:"k-file-content"},[n("k-header",{attrs:{editable:t.permissions.changeName&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"left",fn:function(){return[n("k-button-group",[n("k-button",{staticClass:"k-file-view-options",attrs:{link:t.preview.url,responsive:!0,text:t.$t("open"),icon:"open",target:"_blank"}}),n("k-dropdown",{staticClass:"k-file-view-options"},[n("k-button",{attrs:{disabled:t.isLocked,responsive:!0,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),n("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)},on:{action:t.action}})],1),n("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[n("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[t._v(" "+t._s(t.model.filename)+" ")]),n("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("file.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}}),n("k-upload",{ref:"upload",on:{success:t.onUpload}})],1)],1)])}),[],!1,Mf,null,null,null);function Mf(t){for(let e in Tf)this[e]=Tf[e]}var Lf=function(){return If.exports}();const jf={props:{isInstallable:Boolean,isInstalled:Boolean,isOk:Boolean,requirements:Object,translations:Array},data(){return{user:{name:"",email:"",language:this.$translation.code,password:"",role:"admin"}}},computed:{fields(){return{email:{label:this.$t("email"),type:"email",link:!1,autofocus:!0,required:!0},password:{label:this.$t("password"),type:"password",placeholder:this.$t("password")+" …",required:!0},language:{label:this.$t("language"),type:"select",options:this.translations,icon:"globe",empty:!1,required:!0}}},isReady(){return this.isOk&&this.isInstallable},isComplete(){return this.isOk&&this.isInstalled}},methods:{async install(){try{await this.$api.system.install(this.user),await this.$reload({globals:["$system","$translation"]}),this.$store.dispatch("notification/success",this.$t("welcome")+"!")}catch(t){this.$store.dispatch("notification/error",t)}}}},Df={};var Bf=Ft(jf,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-panel",[n("k-view",{staticClass:"k-installation-view",attrs:{align:"center"}},[t.isComplete?n("k-text",[n("k-headline",[t._v(t._s(t.$t("installation.completed")))]),n("k-link",{attrs:{to:"/login"}},[t._v(" "+t._s(t.$t("login"))+" ")])],1):t.isReady?n("form",{on:{submit:function(e){return e.preventDefault(),t.install.apply(null,arguments)}}},[n("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("installation"))+" ")]),n("k-fieldset",{attrs:{fields:t.fields,novalidate:!0},model:{value:t.user,callback:function(e){t.user=e},expression:"user"}}),n("k-button",{attrs:{text:t.$t("install"),type:"submit",icon:"check"}})],1):n("div",[n("k-headline",[t._v(" "+t._s(t.$t("installation.issues.headline"))+" ")]),n("ul",{staticClass:"k-installation-issues"},[!1===t.isInstallable?n("li",[n("k-icon",{attrs:{type:"alert"}}),n("span",{domProps:{innerHTML:t._s(t.$t("installation.disabled"))}})],1):t._e(),!1===t.requirements.php?n("li",[n("k-icon",{attrs:{type:"alert"}}),n("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.php"))}})],1):t._e(),!1===t.requirements.server?n("li",[n("k-icon",{attrs:{type:"alert"}}),n("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.server"))}})],1):t._e(),!1===t.requirements.mbstring?n("li",[n("k-icon",{attrs:{type:"alert"}}),n("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.mbstring"))}})],1):t._e(),!1===t.requirements.curl?n("li",[n("k-icon",{attrs:{type:"alert"}}),n("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.curl"))}})],1):t._e(),!1===t.requirements.accounts?n("li",[n("k-icon",{attrs:{type:"alert"}}),n("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.accounts"))}})],1):t._e(),!1===t.requirements.content?n("li",[n("k-icon",{attrs:{type:"alert"}}),n("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.content"))}})],1):t._e(),!1===t.requirements.media?n("li",[n("k-icon",{attrs:{type:"alert"}}),n("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.media"))}})],1):t._e(),!1===t.requirements.sessions?n("li",[n("k-icon",{attrs:{type:"alert"}}),n("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.sessions"))}})],1):t._e()]),n("k-button",{attrs:{text:t.$t("retry"),icon:"refresh"},on:{click:t.$reload}})],1)],1)],1)}),[],!1,Pf,null,null,null);function Pf(t){for(let e in Df)this[e]=Df[e]}var Nf=function(){return Bf.exports}();const qf={};var Ff=Ft({props:{languages:{type:Array,default:()=>[]}},computed:{languagesCollection(){return this.languages.map((t=>l(a({},t),{image:{back:"black",color:"gray",icon:"globe"},link:()=>{this.$dialog(`languages/${t.id}/update`)},options:[{icon:"edit",text:this.$t("edit"),click(){this.$dialog(`languages/${t.id}/update`)}},{icon:"trash",text:this.$t("delete"),disabled:t.default&&1!==this.languages.length,click(){this.$dialog(`languages/${t.id}/delete`)}}]})))},primaryLanguage(){return this.languagesCollection.filter((t=>t.default))},secondaryLanguages(){return this.languagesCollection.filter((t=>!1===t.default))}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-inside",[n("k-view",{staticClass:"k-languages-view"},[n("k-header",[t._v(" "+t._s(t.$t("view.languages"))+" "),n("k-button-group",{attrs:{slot:"left"},slot:"left"},[n("k-button",{attrs:{text:t.$t("language.create"),icon:"add"},on:{click:function(e){return t.$dialog("languages/create")}}})],1)],1),n("section",{staticClass:"k-languages"},[t.languages.length>0?[n("section",{staticClass:"k-languages-view-section"},[n("header",{staticClass:"k-languages-view-section-header"},[n("k-headline",[t._v(t._s(t.$t("languages.default")))])],1),n("k-collection",{attrs:{items:t.primaryLanguage}})],1),n("section",{staticClass:"k-languages-view-section"},[n("header",{staticClass:"k-languages-view-section-header"},[n("k-headline",[t._v(t._s(t.$t("languages.secondary")))])],1),t.secondaryLanguages.length?n("k-collection",{attrs:{items:t.secondaryLanguages}}):n("k-empty",{attrs:{icon:"globe"},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.secondary.empty"))+" ")])],1)]:0===t.languages.length?[n("k-empty",{attrs:{icon:"globe"},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.empty"))+" ")])]:t._e()],2)],1)],1)}),[],!1,Rf,null,null,null);function Rf(t){for(let e in qf)this[e]=qf[e]}var zf=function(){return Ff.exports}(),Yf=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-panel",["login"===t.form?n("k-view",{staticClass:"k-login-view",attrs:{align:"center"}},[n("k-login-plugin",{attrs:{methods:t.methods}})],1):"code"===t.form?n("k-view",{staticClass:"k-login-code-view",attrs:{align:"center"}},[n("k-login-code",t._b({},"k-login-code",t.$props,!1))],1):t._e()],1)},Hf=[];const Uf={components:{"k-login-plugin":window.panel.plugins.login||Un},props:{methods:Array,pending:Object},computed:{form(){return this.pending.email?"code":this.$user?null:"login"}},created(){this.$store.dispatch("content/clear")}},Kf={};var Jf=Ft(Uf,Yf,Hf,!1,Gf,null,null,null);function Gf(t){for(let e in Kf)this[e]=Kf[e]}var Vf=function(){return Jf.exports}();const Wf={};var Xf=Ft({extends:kf,props:{status:Object},computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[n("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[n("k-view",{staticClass:"k-page-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[n("k-header",{attrs:{editable:t.permissions.changeTitle&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeTitle")}},scopedSlots:t._u([{key:"left",fn:function(){return[n("k-button-group",[t.permissions.preview&&t.model.previewUrl?n("k-button",{staticClass:"k-page-view-preview",attrs:{link:t.model.previewUrl,responsive:!0,text:t.$t("open"),icon:"open",target:"_blank"}}):t._e(),t.status?n("k-status-icon",{attrs:{status:t.model.status,disabled:!t.permissions.changeStatus||t.isLocked,responsive:!0,text:t.status.label},on:{click:function(e){return t.$dialog(t.id+"/changeStatus")}}}):t._e(),n("k-dropdown",{staticClass:"k-page-view-options"},[n("k-button",{attrs:{disabled:!0===t.isLocked,responsive:!0,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),n("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)}})],1),n("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[t.model.id?n("k-prev-next",{attrs:{prev:t.prev,next:t.next}}):t._e()]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),n("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("page.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}})],1)],1)}),[],!1,Zf,null,null,null);function Zf(t){for(let e in Wf)this[e]=Wf[e]}var Qf=function(){return Xf.exports}();const tm={};var em=Ft({props:{id:String},computed:{view(){return"k-"+this.id+"-plugin-view"}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-inside",[n(t.view,{tag:"component"})],1)}),[],!1,nm,null,null,null);function nm(t){for(let e in tm)this[e]=tm[e]}var im=function(){return em.exports}();const sm={};var om=Ft({data:()=>({isLoading:!1,issue:"",values:{password:null,passwordConfirmation:null}}),computed:{fields(){return{password:{autofocus:!0,label:this.$t("user.changePassword.new"),icon:"key",type:"password"},passwordConfirmation:{label:this.$t("user.changePassword.new.confirm"),icon:"key",type:"password"}}}},mounted(){this.$store.dispatch("title",this.$t("view.resetPassword"))},methods:{async submit(){if(!this.values.password||this.values.password.length<8)return this.issue=this.$t("error.user.password.invalid"),!1;if(this.values.password!==this.values.passwordConfirmation)return this.issue=this.$t("error.user.password.notSame"),!1;this.isLoading=!0;try{await this.$api.users.changePassword(this.$user.id,this.values.password),this.$store.dispatch("notification/success",":)"),this.$go("/")}catch(t){this.issue=t.message}finally{this.isLoading=!1}}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-inside",[n("k-view",{staticClass:"k-password-reset-view",attrs:{align:"center"}},[n("k-form",{attrs:{fields:t.fields,"submit-button":t.$t("change")},on:{submit:t.submit},scopedSlots:t._u([{key:"header",fn:function(){return[n("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("view.resetPassword"))+" ")]),t.issue?n("k-login-alert",{on:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),n("k-user-info",{attrs:{user:t.$user}})]},proxy:!0},{key:"footer",fn:function(){return[n("div",{staticClass:"k-login-buttons"},[n("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("change"))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)],1)]},proxy:!0}]),model:{value:t.values,callback:function(e){t.values=e},expression:"values"}})],1)],1)}),[],!1,rm,null,null,null);function rm(t){for(let e in sm)this[e]=sm[e]}var am=function(){return om.exports}();const lm={};var um=Ft({extends:kf,computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[n("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[n("k-view",{staticClass:"k-site-view",attrs:{"data-locked":t.isLocked,"data-id":"/","data-template":"site"}},[n("k-header",{attrs:{editable:t.permissions.changeTitle&&!t.isLocked,tabs:t.tabs,tab:t.tab.name},on:{edit:function(e){return t.$dialog("site/changeTitle")}},scopedSlots:t._u([{key:"left",fn:function(){return[n("k-button-group",[n("k-button",{staticClass:"k-site-view-preview",attrs:{link:t.model.previewUrl,responsive:!0,text:t.$t("open"),icon:"open",target:"_blank"}}),n("k-languages-dropdown")],1)]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),n("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("site.blueprint"),lock:t.lock,tab:t.tab,parent:"site"},on:{submit:function(e){return t.$emit("submit",e)}}})],1)],1)}),[],!1,cm,null,null,null);function cm(t){for(let e in lm)this[e]=lm[e]}var dm=function(){return um.exports}();const pm={props:{debug:Boolean,license:String,php:String,plugins:Array,server:String,https:Boolean,urls:Object,version:String},data:()=>({security:[]}),computed:{environment(){return[{label:this.$t("license"),value:this.license?"Kirby 3":this.$t("license.unregistered.label"),theme:this.license?null:"negative",click:this.license?()=>this.$dialog("license"):()=>this.$dialog("registration")},{label:this.$t("version"),value:this.version,link:"https://github.com/getkirby/kirby/releases/tag/"+this.version},{label:"PHP",value:this.php},{label:this.$t("server"),value:this.server||"?"}]}},async created(){console.info("Running system health checks for the Panel system view; failed requests in the following console output are expected behavior.");let t=(Promise.allSettled||Promise.all).bind(Promise);await t([this.check("content"),this.check("debug"),this.check("git"),this.check("https"),this.check("kirby"),this.check("site")]),console.info("System health checks ended.")},methods:{async check(t){switch(t){case"debug":!0===this.debug&&this.securityIssue(t);break;case"https":!0!==this.https&&this.securityIssue(t);break;default:const e=this.urls[t];if(!e)return!1;!0===await this.isAccessible(e)&&this.securityIssue(t)}},securityIssue(t){this.security.push({image:{back:"var(--color-red-200)",icon:"alert",color:"var(--color-red)"},id:t,text:this.$t("system.issues."+t),link:"https://getkirby.com/security/"+t})},isAccessible:async t=>(await fetch(t,{cache:"no-store"})).status<400,retry(){this.$go(window.location.href)}}},hm={};var fm=Ft(pm,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-inside",[n("k-view",{staticClass:"k-system-view"},[n("k-header",[t._v(" "+t._s(t.$t("view.system"))+" ")]),n("section",{staticClass:"k-system-view-section"},[n("header",{staticClass:"k-system-view-section-header"},[n("k-headline",[t._v(t._s(t.$t("environment")))])],1),n("k-stats",{staticClass:"k-system-info",attrs:{reports:t.environment,size:"medium"}})],1),t.security.length?n("section",{staticClass:"k-system-view-section"},[n("header",{staticClass:"k-system-view-section-header"},[n("k-headline",[t._v(t._s(t.$t("security")))]),n("k-button",{attrs:{tooltip:t.$t("retry"),icon:"refresh"},on:{click:t.retry}})],1),n("k-items",{attrs:{items:t.security}})],1):t._e(),t.plugins.length?n("section",{staticClass:"k-system-view-section"},[n("header",{staticClass:"k-system-view-section-header"},[n("k-headline",{attrs:{link:"https://getkirby.com/plugins"}},[t._v(" "+t._s(t.$t("plugins"))+" ")])],1),n("k-table",{attrs:{index:!1,columns:{name:{label:t.$t("name"),type:"url",mobile:!0},author:{label:t.$t("author")},license:{label:t.$t("license")},version:{label:t.$t("version"),width:"8rem",mobile:!0}},rows:t.plugins}})],1):t._e()],1)],1)}),[],!1,mm,null,null,null);function mm(t){for(let e in hm)this[e]=hm[e]}var gm=function(){return fm.exports}();const km={};var vm=Ft({props:{role:Object,roles:Array,search:String,title:String,users:Object},computed:{items(){return this.users.data.map((t=>(t.options=this.$dropdown(t.link),t)))}},methods:{paginate(t){this.$reload({query:{page:t.page}})}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-inside",[n("k-view",{staticClass:"k-users-view"},[n("k-header",{scopedSlots:t._u([{key:"left",fn:function(){return[n("k-button-group",{attrs:{buttons:[{disabled:!1===t.$permissions.users.create,text:t.$t("user.create"),icon:"add",click:function(){return t.$dialog("users/create")}}]}})]},proxy:!0},{key:"right",fn:function(){return[n("k-button-group",[n("k-dropdown",[n("k-button",{attrs:{responsive:!0,text:`${t.$t("role")}: ${t.role?t.role.title:t.$t("role.all")}`,icon:"funnel"},on:{click:function(e){return t.$refs.roles.toggle()}}}),n("k-dropdown-content",{ref:"roles",attrs:{align:"right"}},[n("k-dropdown-item",{attrs:{icon:"bolt",link:"/users"}},[t._v(" "+t._s(t.$t("role.all"))+" ")]),n("hr"),t._l(t.roles,(function(e){return n("k-dropdown-item",{key:e.id,attrs:{link:"/users/?role="+e.id,icon:"bolt"}},[t._v(" "+t._s(e.title)+" ")])}))],2)],1)],1)]},proxy:!0}])},[t._v(" "+t._s(t.$t("view.users"))+" ")]),t.users.data.length>0?[n("k-collection",{attrs:{items:t.items,pagination:t.users.pagination},on:{paginate:t.paginate}})]:0===t.users.pagination.total?[n("k-empty",{attrs:{icon:"users"}},[t._v(" "+t._s(t.$t("role.empty"))+" ")])]:t._e()],2)],1)}),[],!1,bm,null,null,null);function bm(t){for(let e in km)this[e]=km[e]}var ym=function(){return vm.exports}();const $m={};var _m=Ft({computed:{placeholder(){return this.field("code",{}).placeholder},languages(){return this.field("language",{options:[]}).options}},methods:{focus(){this.$refs.code.focus()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-block-type-code-editor"},[n("k-input",{ref:"code",attrs:{buttons:!1,placeholder:t.placeholder,spellcheck:!1,value:t.content.code,type:"textarea"},on:{input:function(e){return t.update({code:e})}}}),t.languages.length?n("div",{staticClass:"k-block-type-code-editor-language"},[n("k-icon",{attrs:{type:"code"}}),n("k-input",{ref:"language",attrs:{empty:!1,options:t.languages,value:t.content.language,type:"select"},on:{input:function(e){return t.update({language:e})}}})],1):t._e()],1)}),[],!1,xm,null,null,null);function xm(t){for(let e in $m)this[e]=$m[e]}var wm=function(){return _m.exports}(),Sm=Object.freeze(Object.defineProperty({__proto__:null,default:wm},Symbol.toStringTag,{value:"Module"}));const Cm={};var Om=Ft({},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("k-block-title",{attrs:{content:t.content,fieldset:t.fieldset},on:{dblclick:function(e){return t.$emit("open")}}})}),[],!1,Em,null,null,null);function Em(t){for(let e in Cm)this[e]=Cm[e]}var Am=function(){return Om.exports}(),Tm=Object.freeze(Object.defineProperty({__proto__:null,default:Am},Symbol.toStringTag,{value:"Module"}));const Im={};var Mm=Ft({},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",{on:{dblclick:t.open}},[0===t.content.images.length?[n("li"),n("li"),n("li"),n("li"),n("li")]:t._l(t.content.images,(function(t){return n("li",{key:t.id},[n("img",{attrs:{src:t.url,srcset:t.image.srcset,alt:t.alt}})])}))],2)}),[],!1,Lm,null,null,null);function Lm(t){for(let e in Im)this[e]=Im[e]}var jm=function(){return Mm.exports}(),Dm=Object.freeze(Object.defineProperty({__proto__:null,default:jm},Symbol.toStringTag,{value:"Module"}));const Bm={};var Pm=Ft({computed:{textField(){return this.field("text",{marks:!0})}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-block-type-heading-input",attrs:{"data-level":t.content.level}},[n("k-writer",{ref:"input",attrs:{inline:!0,marks:t.textField.marks,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}})],1)}),[],!1,Nm,null,null,null);function Nm(t){for(let e in Bm)this[e]=Bm[e]}var qm=function(){return Pm.exports}(),Fm=Object.freeze(Object.defineProperty({__proto__:null,default:qm},Symbol.toStringTag,{value:"Module"}));const Rm={};var zm=Ft({computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop||!1},src(){var t;return"web"===this.content.location?this.content.src:!!(null==(t=this.content.image[0])?void 0:t.url)&&this.content.image[0].url},ratio(){return this.content.ratio||!1}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-block-figure",{attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.image.placeholder")+" …","is-empty":!t.src,"empty-icon":"image"},on:{open:t.open,update:t.update}},[t.src?[t.ratio?n("k-aspect-ratio",{attrs:{ratio:t.ratio,cover:t.crop}},[n("img",{attrs:{alt:t.content.alt,src:t.src}})]):n("img",{staticClass:"k-block-type-image-auto",attrs:{alt:t.content.alt,src:t.src}})]:t._e()],2)}),[],!1,Ym,null,null,null);function Ym(t){for(let e in Rm)this[e]=Rm[e]}var Hm=function(){return zm.exports}(),Um=Object.freeze(Object.defineProperty({__proto__:null,default:Hm},Symbol.toStringTag,{value:"Module"}));const Km={};var Jm=Ft({},(function(){var t=this;t.$createElement;return t._self._c,t._m(0)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",[e("hr")])}],!1,Gm,null,null,null);function Gm(t){for(let e in Km)this[e]=Km[e]}var Vm=function(){return Jm.exports}(),Wm=Object.freeze(Object.defineProperty({__proto__:null,default:Vm},Symbol.toStringTag,{value:"Module"}));const Xm={};var Zm=Ft({computed:{marks(){return this.field("text",{}).marks}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("k-input",{ref:"input",staticClass:"k-block-type-list-input",attrs:{marks:t.marks,value:t.content.text,type:"list"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,Qm,null,null,null);function Qm(t){for(let e in Xm)this[e]=Xm[e]}var tg=function(){return Zm.exports}(),eg=Object.freeze(Object.defineProperty({__proto__:null,default:tg},Symbol.toStringTag,{value:"Module"}));const ng={};var ig=Ft({computed:{placeholder(){return this.field("text",{}).placeholder}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("k-input",{ref:"input",staticClass:"k-block-type-markdown-input",attrs:{buttons:!1,placeholder:t.placeholder,spellcheck:!1,value:t.content.text,type:"textarea"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,sg,null,null,null);function sg(t){for(let e in ng)this[e]=ng[e]}var og=function(){return ig.exports}(),rg=Object.freeze(Object.defineProperty({__proto__:null,default:og},Symbol.toStringTag,{value:"Module"}));const ag={};var lg=Ft({computed:{citationField(){return this.field("citation",{})},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.text.focus()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-block-type-quote-editor"},[n("k-writer",{ref:"text",staticClass:"k-block-type-quote-text",attrs:{inline:!0,marks:t.textField.marks,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}}),n("k-writer",{ref:"citation",staticClass:"k-block-type-quote-citation",attrs:{inline:!0,marks:t.citationField.marks,placeholder:t.citationField.placeholder,value:t.content.citation},on:{input:function(e){return t.update({citation:e})}}})],1)}),[],!1,ug,null,null,null);function ug(t){for(let e in ag)this[e]=ag[e]}var cg=function(){return lg.exports}(),dg=Object.freeze(Object.defineProperty({__proto__:null,default:cg},Symbol.toStringTag,{value:"Module"}));const pg={};var hg=Ft({inheritAttrs:!1,computed:{columns(){return this.table.columns||this.fields},fields(){return this.table.fields||{}},rows(){return this.content.rows||[]},table(){let t=null;for(const e of Object.values(this.fieldset.tabs))e.fields.rows&&(t=e.fields.rows);return t||{}}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("k-table",{staticClass:"k-block-type-table-preview",attrs:{columns:t.columns,empty:t.$t("field.structure.empty"),rows:t.rows},nativeOn:{dblclick:function(e){return t.open.apply(null,arguments)}}})}),[],!1,fg,null,null,null);function fg(t){for(let e in pg)this[e]=pg[e]}var mg=function(){return hg.exports}(),gg=Object.freeze(Object.defineProperty({__proto__:null,default:mg},Symbol.toStringTag,{value:"Module"}));const kg={};var vg=Ft({props:{endpoints:Object},computed:{textField(){return this.field("text",{})}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("k-writer",{ref:"input",staticClass:"k-block-type-text-input",attrs:{inline:t.textField.inline,marks:t.textField.marks,nodes:t.textField.nodes,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}})}),[],!1,bg,null,null,null);function bg(t){for(let e in kg)this[e]=kg[e]}var yg=function(){return vg.exports}(),$g=Object.freeze(Object.defineProperty({__proto__:null,default:yg},Symbol.toStringTag,{value:"Module"}));const _g={};var xg=Ft({computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},video(){return this.$helper.embed.video(this.content.url,!0)}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-block-figure",{attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.video.placeholder")+" …","is-empty":!t.video,"empty-icon":"video"},on:{open:t.open,update:t.update}},[n("k-aspect-ratio",{attrs:{ratio:"16/9"}},[t.video?n("iframe",{attrs:{src:t.video,referrerpolicy:"strict-origin-when-cross-origin"}}):t._e()])],1)}),[],!1,wg,null,null,null);function wg(t){for(let e in _g)this[e]=_g[e]}var Sg=function(){return xg.exports}(),Cg=Object.freeze(Object.defineProperty({__proto__:null,default:Sg},Symbol.toStringTag,{value:"Module"}));const Og={inheritAttrs:!1,props:{attrs:[Array,Object],content:[Array,Object],endpoints:Object,fieldset:Object,id:String,isBatched:Boolean,isFull:Boolean,isHidden:Boolean,isLastInBatch:Boolean,isSelected:Boolean,name:String,next:Object,prev:Object,type:String},data:()=>({skipFocus:!1}),computed:{className(){let t=["k-block-type-"+this.type];return this.fieldset.preview!==this.type&&t.push("k-block-type-"+this.fieldset.preview),!1===this.wysiwyg&&t.push("k-block-type-default"),t},customComponent(){return this.wysiwyg?this.wysiwygComponent:"k-block-type-default"},isEditable(){return!1!==this.fieldset.editable},listeners(){return l(a({},this.$listeners),{confirmToRemove:this.confirmToRemove,open:this.open})},tabs(){let t=this.fieldset.tabs;return Object.entries(t).forEach((([e,n])=>{Object.entries(n.fields).forEach((([n])=>{t[e].fields[n].section=this.name,t[e].fields[n].endpoints={field:this.endpoints.field+"/fieldsets/"+this.type+"/fields/"+n,section:this.endpoints.section,model:this.endpoints.model}}))})),t},wysiwyg(){return!1!==this.wysiwygComponent},wysiwygComponent(){if(!1===this.fieldset.preview)return!1;let t;return this.fieldset.preview&&(t="k-block-type-"+this.fieldset.preview,this.$helper.isComponent(t))?t:(t="k-block-type-"+this.type,!!this.$helper.isComponent(t)&&t)}},methods:{close(){this.$refs.drawer.close()},confirmToRemove(){this.$refs.removeDialog.open()},focus(){!0!==this.skipFocus&&("function"==typeof this.$refs.editor.focus?this.$refs.editor.focus():this.$refs.container.focus())},onFocusIn(t){var e,n;(null==(n=null==(e=this.$refs.options)?void 0:e.$el)?void 0:n.contains(t.target))||this.$emit("focus",t)},goTo(t){t&&(this.skipFocus=!0,this.close(),this.$nextTick((()=>{t.$refs.container.focus(),t.open(),this.skipFocus=!1})))},open(){var t;null==(t=this.$refs.drawer)||t.open()},remove(){this.$refs.removeDialog.close(),this.$emit("remove",this.id)}}},Eg={};var Ag=Ft(Og,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"container",staticClass:"k-block-container",class:"k-block-container-type-"+t.type,attrs:{"data-batched":t.isBatched,"data-disabled":t.fieldset.disabled,"data-hidden":t.isHidden,"data-id":t.id,"data-last-in-batch":t.isLastInBatch,"data-selected":t.isSelected,"data-translate":t.fieldset.translate,tabindex:"0"},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),t.$emit("sortDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),t.$emit("sortUp")):null}],focus:function(e){return t.$emit("focus")},focusin:t.onFocusIn}},[n("div",{staticClass:"k-block",class:t.className},[n(t.customComponent,t._g(t._b({ref:"editor",tag:"component"},"component",t.$props,!1),t.listeners))],1),n("k-block-options",t._g({ref:"options",attrs:{"is-batched":t.isBatched,"is-editable":t.isEditable,"is-full":t.isFull,"is-hidden":t.isHidden}},t.listeners)),t.isEditable&&!t.isBatched?n("k-form-drawer",{ref:"drawer",staticClass:"k-block-drawer",attrs:{id:t.id,icon:t.fieldset.icon||"box",tabs:t.tabs,title:t.fieldset.name,value:t.content},on:{close:function(e){return t.focus()},input:function(e){return t.$emit("update",e)}},scopedSlots:t._u([{key:"options",fn:function(){return[t.isHidden?n("k-button",{staticClass:"k-drawer-option",attrs:{icon:"hidden"},on:{click:function(e){return t.$emit("show")}}}):t._e(),n("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.prev,icon:"angle-left"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.goTo(t.prev)}}}),n("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.goTo(t.next)}}}),n("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.confirmToRemove.apply(null,arguments)}}})]},proxy:!0}],null,!1,2211169536)}):t._e(),n("k-remove-dialog",{ref:"removeDialog",attrs:{text:t.$t("field.blocks.delete.confirm")},on:{submit:t.remove}})],1)}),[],!1,Tg,null,null,null);function Tg(t){for(let e in Eg)this[e]=Eg[e]}var Ig=function(){return Ag.exports}();const Mg={};var Lg=Ft({inheritAttrs:!1,computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{close(){this.$refs.dialog.close()},open(){this.$refs.dialog.open()},onPaste(t){this.$emit("paste",t),this.close()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-dialog",{ref:"dialog",staticClass:"k-block-importer",attrs:{"cancel-button":!1,"submit-button":!1,size:"large"}},[n("label",{attrs:{for:"pasteboard"},domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}}),n("textarea",{attrs:{id:"pasteboard"},on:{paste:function(e){return e.preventDefault(),t.onPaste.apply(null,arguments)}}})])}),[],!1,jg,null,null,null);function jg(t){for(let e in Mg)this[e]=Mg[e]}const Dg={components:{"k-block-pasteboard":function(){return Lg.exports}()},inheritAttrs:!1,props:{autofocus:Boolean,empty:String,endpoints:Object,fieldsets:Object,fieldsetGroups:Object,group:String,max:{type:Number,default:null},value:{type:Array,default:()=>[]}},data(){return{isMultiSelectKey:!1,batch:[],blocks:this.value,current:null,isFocussed:!1}},computed:{draggableOptions(){return{id:this._uid,handle:".k-sort-handle",list:this.blocks,move:this.move,delay:10,data:{fieldsets:this.fieldsets,isFull:this.isFull},options:{group:this.group}}},hasFieldsets(){return Object.keys(this.fieldsets).length},isEditing(){return this.$store.state.dialog||this.$store.state.drawers.open.length>0},isEmpty(){return 0===this.blocks.length},isFull(){return null!==this.max&&this.blocks.length>=this.max},selected(){return this.current},selectedOrBatched(){return this.batch.length>0?this.batch:this.selected?[this.selected]:[]}},watch:{value(){this.blocks=this.value}},created(){this.$events.$on("copy",this.copy),this.$events.$on("focus",this.onOutsideFocus),this.$events.$on("keydown",this.onKey),this.$events.$on("keyup",this.onKey),this.$events.$on("paste",this.onPaste)},destroyed(){this.$events.$off("copy",this.copy),this.$events.$off("focus",this.onOutsideFocus),this.$events.$off("keydown",this.onKey),this.$events.$off("keyup",this.onKey),this.$events.$off("paste",this.onPaste)},mounted(){!0===this.$props.autofocus&&this.focus()},methods:{append(t,e){if("string"!=typeof t){if(Array.isArray(t)){let n=this.$helper.clone(t).map((t=>(t.id=this.$helper.uuid(),t)));const i=Object.keys(this.fieldsets);if(n=n.filter((t=>i.includes(t.type))),this.max){const t=this.max-this.blocks.length;n=n.slice(0,t)}this.blocks.splice(e,0,...n),this.save()}}else this.add(t,e)},async add(t="text",e){const n=await this.$api.get(this.endpoints.field+"/fieldsets/"+t);this.blocks.splice(e,0,n),this.save(),this.$nextTick((()=>{this.focusOrOpen(n)}))},addToBatch(t){null!==this.selected&&!1===this.batch.includes(this.selected)&&(this.batch.push(this.selected),this.current=null),!1===this.batch.includes(t.id)&&this.batch.push(t.id)},choose(t){if(1===Object.keys(this.fieldsets).length){const e=Object.values(this.fieldsets)[0].type;this.add(e,t)}else this.$refs.selector.open(t)},chooseToConvert(t){this.$refs.selector.open(t,{disabled:[t.type],headline:this.$t("field.blocks.changeType"),event:"convert"})},click(t){this.$emit("click",t)},confirmToRemoveAll(){this.$refs.removeAll.open()},confirmToRemoveSelected(){this.$refs.removeSelected.open()},copy(t){if(!0===this.isEditing)return!1;if(0===this.blocks.length)return!1;if(0===this.selectedOrBatched.length)return!1;if(!0===this.isInputEvent(t))return!1;let e=[];if(this.blocks.forEach((t=>{this.selectedOrBatched.includes(t.id)&&e.push(t)})),0===e.length)return!1;this.$helper.clipboard.write(e,t),t instanceof ClipboardEvent==!1&&(this.batch=this.selectedOrBatched),this.$store.dispatch("notification/success",`${e.length} copied!`)},copyAll(){this.selectAll(),this.copy(),this.deselectAll()},async convert(t,e){var n;const i=this.findIndex(e.id);if(-1===i)return!1;const s=t=>{var e;let n={};for(const i of Object.values(null!=(e=null==t?void 0:t.tabs)?e:{}))n=a(a({},n),i.fields);return n},o=this.blocks[i],r=await this.$api.get(this.endpoints.field+"/fieldsets/"+t),u=this.fieldsets[o.type],c=this.fieldsets[t];if(!c)return!1;let d=r.content;const p=s(c),h=s(u);for(const[a,l]of Object.entries(p)){const t=h[a];(null==t?void 0:t.type)===l.type&&(null==(n=null==o?void 0:o.content)?void 0:n[a])&&(d[a]=o.content[a])}this.blocks[i]=l(a({},r),{id:o.id,content:d}),this.save()},deselectAll(){this.batch=[],this.current=null},async duplicate(t,e){const n=l(a({},this.$helper.clone(t)),{id:this.$helper.uuid()});this.blocks.splice(e+1,0,n),this.save()},fieldset(t){return this.fieldsets[t.type]||{icon:"box",name:t.type,tabs:{content:{fields:{}}},type:t.type}},find(t){return this.blocks.find((e=>e.id===t))},findIndex(t){return this.blocks.findIndex((e=>e.id===t))},focus(t){(null==t?void 0:t.id)&&this.$refs["block-"+t.id]?this.$refs["block-"+t.id][0].focus():this.blocks[0]&&this.focus(this.blocks[0])},focusOrOpen(t){this.fieldsets[t.type].wysiwyg?this.focus(t):this.open(t)},hide(t){this.$set(t,"isHidden",!0),this.save()},isBatched(t){return this.batch.includes(t.id)},isInputEvent(){const t=document.querySelector(":focus");return t&&t.matches("input, textarea, [contenteditable], .k-writer")},isLastInBatch(t){const[e]=this.batch.slice(-1);return e&&t.id===e},isOnlyInstance:()=>1===document.querySelectorAll(".k-blocks").length,isSelected(t){return this.selected&&this.selected===t.id},move(t){if(t.from!==t.to){const e=t.draggedContext.element,n=t.relatedContext.component.componentData||t.relatedContext.component.$parent.componentData;if(!1===Object.keys(n.fieldsets).includes(e.type))return!1;if(!0===n.isFull)return!1}return!0},onKey(t){this.isMultiSelectKey=t.metaKey||t.ctrlKey||t.altKey},onOutsideFocus(t){if("function"==typeof t.target.closest&&t.target.closest(".k-dialog"))return;const e=document.querySelector(".k-overlay:last-of-type");if(!1===this.$el.contains(t.target)&&(!e||!1===e.contains(t.target)))return this.select(null);if(e){const e=this.$el.closest(".k-layout-column");if(!1===(null==e?void 0:e.contains(t.target)))return this.select(null)}},onPaste(t){var e;return!0!==this.isInputEvent(t)&&(!0===this.isEditing?!0===(null==(e=this.$refs.selector)?void 0:e.isOpen())&&this.paste(t):(0!==this.selectedOrBatched.length||!0===this.isOnlyInstance())&&this.paste(t))},open(t){this.$refs["block-"+t.id]&&this.$refs["block-"+t.id][0].open()},async paste(t){const e=this.$helper.clipboard.read(t),n=await this.$api.post(this.endpoints.field+"/paste",{html:e});let i=this.selectedOrBatched[this.selectedOrBatched.length-1],s=this.findIndex(i);-1===s&&(s=this.blocks.length),this.append(n,s+1)},pasteboard(){this.$refs.pasteboard.open()},prevNext(t){if(this.blocks[t]){let e=this.blocks[t];if(this.$refs["block-"+e.id])return this.$refs["block-"+e.id][0]}},remove(t){var e;const n=this.findIndex(t.id);-1!==n&&((null==(e=this.selected)?void 0:e.id)===t.id&&this.select(null),this.$delete(this.blocks,n),this.save())},removeAll(){this.batch=[],this.blocks=[],this.save(),this.$refs.removeAll.close()},removeSelected(){this.batch.forEach((t=>{const e=this.findIndex(t);-1!==e&&this.$delete(this.blocks,e)})),this.deselectAll(),this.save(),this.$refs.removeSelected.close()},save(){this.$emit("input",this.blocks)},select(t,e=null){if(e&&this.isMultiSelectKey&&this.onKey(e),t&&this.isMultiSelectKey)return this.addToBatch(t),void(this.current=null);this.batch=[],this.current=t?t.id:null},selectAll(){this.batch=Object.values(this.blocks).map((t=>t.id))},show(t){this.$set(t,"isHidden",!1),this.save()},sort(t,e,n){if(n<0)return;let i=this.$helper.clone(this.blocks);i.splice(e,1),i.splice(n,0,t),this.blocks=i,this.save(),this.$nextTick((()=>{this.focus(t)}))},update(t,e){const n=this.findIndex(t.id);-1!==n&&Object.entries(e).forEach((([t,e])=>{this.$set(this.blocks[n].content,t,e)})),this.save()}}},Bg={};var Pg=Ft(Dg,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"wrapper",staticClass:"k-blocks",attrs:{"data-empty":0===t.blocks.length,"data-multi-select-key":t.isMultiSelectKey},on:{focusin:function(e){t.focussed=!0},focusout:function(e){t.focussed=!1}}},[t.hasFieldsets?[n("k-draggable",t._b({staticClass:"k-blocks-list",on:{sort:t.save},scopedSlots:t._u([{key:"footer",fn:function(){return[n("k-empty",{staticClass:"k-blocks-empty",attrs:{icon:"box"},on:{click:function(e){return t.choose(t.blocks.length)}}},[t._v(" "+t._s(t.empty||t.$t("field.blocks.empty"))+" ")])]},proxy:!0}],null,!1,2413899928)},"k-draggable",t.draggableOptions,!1),t._l(t.blocks,(function(e,i){return n("k-block",t._b({key:e.id,ref:"block-"+e.id,refInFor:!0,attrs:{endpoints:t.endpoints,fieldset:t.fieldset(e),"is-batched":t.isBatched(e),"is-last-in-batch":t.isLastInBatch(e),"is-full":t.isFull,"is-hidden":!0===e.isHidden,"is-selected":t.isSelected(e),next:t.prevNext(i+1),prev:t.prevNext(i-1)},on:{append:function(e){return t.append(e,i+1)},blur:function(e){return t.select(null)},choose:function(e){return t.choose(e)},chooseToAppend:function(e){return t.choose(i+1)},chooseToConvert:function(n){return t.chooseToConvert(e)},chooseToPrepend:function(e){return t.choose(i)},copy:function(e){return t.copy()},confirmToRemoveSelected:t.confirmToRemoveSelected,duplicate:function(n){return t.duplicate(e,i)},focus:function(n){return t.select(e)},hide:function(n){return t.hide(e)},paste:function(e){return t.pasteboard()},prepend:function(e){return t.add(e,i)},remove:function(n){return t.remove(e)},sortDown:function(n){return t.sort(e,i,i+1)},sortUp:function(n){return t.sort(e,i,i-1)},show:function(n){return t.show(e)},update:function(n){return t.update(e,n)}},nativeOn:{click:function(n){return n.stopPropagation(),t.select(e,n)}}},"k-block",e,!1))})),1),n("k-block-selector",{ref:"selector",attrs:{fieldsets:t.fieldsets,"fieldset-groups":t.fieldsetGroups},on:{add:t.add,convert:t.convert,paste:function(e){return t.paste(e)}}}),n("k-remove-dialog",{ref:"removeAll",attrs:{text:t.$t("field.blocks.delete.confirm.all")},on:{submit:t.removeAll}}),n("k-remove-dialog",{ref:"removeSelected",attrs:{text:t.$t("field.blocks.delete.confirm.selected")},on:{submit:t.removeSelected}}),n("k-block-pasteboard",{ref:"pasteboard",on:{paste:function(e){return t.paste(e)}}})]:[n("k-box",{attrs:{theme:"info"}},[t._v(" No fieldsets yet ")])]],2)}),[],!1,Ng,null,null,null);function Ng(t){for(let e in Bg)this[e]=Bg[e]}var qg=function(){return Pg.exports}();const Fg={inheritAttrs:!1,props:{caption:String,captionMarks:[Boolean,Array],cover:{type:Boolean,default:!0},isEmpty:Boolean,emptyIcon:String,emptyText:String,ratio:String},computed:{ratioPadding(){return this.$helper.ratio(this.ratio||"16/9")}}},Rg={};var zg=Ft(Fg,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("figure",{staticClass:"k-block-figure"},[t.isEmpty?n("k-button",{staticClass:"k-block-figure-empty",attrs:{icon:t.emptyIcon,text:t.emptyText},on:{click:function(e){return t.$emit("open")}}}):n("span",{staticClass:"k-block-figure-container",on:{dblclick:function(e){return t.$emit("open")}}},[t._t("default")],2),t.caption?n("figcaption",[n("k-writer",{attrs:{inline:!0,marks:t.captionMarks,value:t.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}})],1):t._e()],1)}),[],!1,Yg,null,null,null);function Yg(t){for(let e in Rg)this[e]=Rg[e]}var Hg=function(){return zg.exports}();const Ug={props:{isBatched:Boolean,isEditable:Boolean,isFull:Boolean,isHidden:Boolean},methods:{open(){this.$refs.options.open()}}},Kg={};var Jg=Ft(Ug,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-dropdown",{staticClass:"k-block-options"},[t.isBatched?[n("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("copy"),icon:"template"},on:{click:function(e){return e.preventDefault(),t.$emit("copy")}}}),n("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("remove"),icon:"trash"},on:{click:function(e){return e.preventDefault(),t.$emit("confirmToRemoveSelected")}}})]:[t.isEditable?n("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("edit"),icon:"edit"},on:{click:function(e){return t.$emit("open")}}}):t._e(),n("k-button",{staticClass:"k-block-options-button",attrs:{disabled:t.isFull,tooltip:t.$t("insert.after"),icon:"add"},on:{click:function(e){return t.$emit("chooseToAppend")}}}),n("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("delete"),icon:"trash"},on:{click:function(e){return t.$emit("confirmToRemove")}}}),n("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("more"),icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),n("k-button",{staticClass:"k-block-options-button k-sort-handle",attrs:{tooltip:t.$t("sort"),icon:"sort"},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.$emit("sortUp"))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.$emit("sortDown"))}]}}),n("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[n("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"angle-up"},on:{click:function(e){return t.$emit("chooseToPrepend")}}},[t._v(" "+t._s(t.$t("insert.before"))+" ")]),n("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"angle-down"},on:{click:function(e){return t.$emit("chooseToAppend")}}},[t._v(" "+t._s(t.$t("insert.after"))+" ")]),n("hr"),t.isEditable?n("k-dropdown-item",{attrs:{icon:"edit"},on:{click:function(e){return t.$emit("open")}}},[t._v(" "+t._s(t.$t("edit"))+" ")]):t._e(),n("k-dropdown-item",{attrs:{icon:"refresh"},on:{click:function(e){return t.$emit("chooseToConvert")}}},[t._v(" "+t._s(t.$t("field.blocks.changeType"))+" ")]),n("hr"),n("k-dropdown-item",{attrs:{icon:"template"},on:{click:function(e){return t.$emit("copy")}}},[t._v(" "+t._s(t.$t("copy"))+" ")]),n("k-dropdown-item",{attrs:{icon:"download"},on:{click:function(e){return t.$emit("paste")}}},[t._v(" "+t._s(t.$t("paste.after"))+" ")]),n("hr"),n("k-dropdown-item",{attrs:{icon:t.isHidden?"preview":"hidden"},on:{click:function(e){return t.$emit(t.isHidden?"show":"hide")}}},[t._v(" "+t._s(!0===t.isHidden?t.$t("show"):t.$t("hide"))+" ")]),n("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"copy"},on:{click:function(e){return t.$emit("duplicate")}}},[t._v(" "+t._s(t.$t("duplicate"))+" ")]),n("hr"),n("k-dropdown-item",{attrs:{icon:"trash"},on:{click:function(e){return t.$emit("confirmToRemove")}}},[t._v(" "+t._s(t.$t("delete"))+" ")])],1)]],2)}),[],!1,Gg,null,null,null);function Gg(t){for(let e in Kg)this[e]=Kg[e]}var Vg=function(){return Jg.exports}();const Wg={};var Xg=Ft({inheritAttrs:!1,props:{endpoint:String,fieldsets:Object,fieldsetGroups:Object},data(){return{dialogIsOpen:!1,disabled:[],headline:null,payload:null,event:"add",groups:this.createGroups()}},computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{add(t){this.$emit(this.event,t,this.payload),this.$refs.dialog.close()},close(){this.$refs.dialog.close()},createGroups(){let t={},e=0;const n=this.fieldsetGroups||{blocks:{label:this.$t("field.blocks.fieldsets.label"),sets:Object.keys(this.fieldsets)}};return Object.keys(n).forEach((i=>{let s=n[i];s.open=!1!==s.open,s.fieldsets=s.sets.filter((t=>this.fieldsets[t])).map((t=>(e++,l(a({},this.fieldsets[t]),{index:e})))),0!==s.fieldsets.length&&(t[i]=s)})),t},isOpen(){return this.dialogIsOpen},navigate(t){var e,n;null==(n=null==(e=this.$refs["fieldset-"+t])?void 0:e[0])||n.focus()},onClose(){this.dialogIsOpen=!1,this.$events.$off("paste",this.close)},onOpen(){this.dialogIsOpen=!0,this.$events.$on("paste",this.close)},open(t,e={}){const n=a({event:"add",disabled:[],headline:null},e);this.event=n.event,this.disabled=n.disabled,this.headline=n.headline,this.payload=t,this.$refs.dialog.open()}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("k-dialog",{ref:"dialog",staticClass:"k-block-selector",attrs:{"cancel-button":!1,"submit-button":!1,size:"medium"},on:{open:t.onOpen,close:t.onClose}},[t.headline?n("k-headline",[t._v(" "+t._s(t.headline)+" ")]):t._e(),t._l(t.groups,(function(e,i){return n("details",{key:i,attrs:{open:e.open}},[n("summary",[t._v(t._s(e.label))]),n("div",{staticClass:"k-block-types"},t._l(e.fieldsets,(function(e){return n("k-button",{key:e.name,ref:"fieldset-"+e.index,refInFor:!0,attrs:{disabled:t.disabled.includes(e.type),icon:e.icon||"box",text:e.name},on:{keydown:[function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"up",38,n.key,["Up","ArrowUp"])?null:t.navigate(e.index-1)},function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"down",40,n.key,["Down","ArrowDown"])?null:t.navigate(e.index+1)}],click:function(n){return t.add(e.type)}}})})),1)])})),n("p",{staticClass:"k-clipboard-hint",domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}})],2)}),[],!1,Zg,null,null,null);function Zg(t){for(let e in Wg)this[e]=Wg[e]}var Qg=function(){return Xg.exports}();const tk={};var ek=Ft({inheritAttrs:!1,props:{fieldset:Object,content:Object},computed:{icon(){return this.fieldset.icon||"box"},label(){if(!this.fieldset.label||0===this.fieldset.label.length)return!1;if(this.fieldset.label===this.fieldset.name)return!1;const t=this.$helper.string.template(this.fieldset.label,this.content);return"…"!==t&&t},name(){return this.fieldset.name}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",t._g({staticClass:"k-block-title"},t.$listeners),[n("k-icon",{staticClass:"k-block-icon",attrs:{type:t.icon}}),n("span",{staticClass:"k-block-name"},[t._v(" "+t._s(t.name)+" ")]),t.label?n("span",{staticClass:"k-block-label"},[t._v(" "+t._s(t.label)+" ")]):t._e()],1)}),[],!1,nk,null,null,null);function nk(t){for(let e in tk)this[e]=tk[e]}var ik=function(){return ek.exports}();const sk={};var ok=Ft({inheritAttrs:!1,props:{content:[Object,Array],fieldset:Object},methods:{field(t,e=null){let n=null;return Object.values(this.fieldset.tabs).forEach((e=>{e.fields[t]&&(n=e.fields[t])})),n||e},open(){this.$emit("open")},update(t){this.$emit("update",a(a({},this.content),t))}}},undefined,undefined,!1,rk,null,null,null);function rk(t){for(let e in sk)this[e]=sk[e]}var ak=function(){return ok.exports}();u.component("k-block",Ig),u.component("k-blocks",qg),u.component("k-block-figure",Hg),u.component("k-block-options",Vg),u.component("k-block-selector",Qg),u.component("k-block-title",ik),u.component("k-block-type",ak);const lk={"./Types/Code.vue":Sm,"./Types/Default.vue":Tm,"./Types/Gallery.vue":Dm,"./Types/Heading.vue":Fm,"./Types/Image.vue":Um,"./Types/Line.vue":Wm,"./Types/List.vue":eg,"./Types/Markdown.vue":rg,"./Types/Quote.vue":dg,"./Types/Table.vue":gg,"./Types/Text.vue":$g,"./Types/Video.vue":Cg};Object.keys(lk).map((t=>{const e=t.match(/\/([a-zA-Z]*)\.vue/)[1].toLowerCase();let n=lk[t].default;n.extends=ak,u.component("k-block-type-"+e,n)}));var uk={inheritAttrs:!1,props:{column:{type:Object,default:()=>({})},field:Object,value:{}}};const ck={};var dk=Ft({inheritAttrs:!1,mixins:[uk],props:{value:[Array,String]},computed:{bubbles(){var t,e;let n=this.value;const i=(null==(t=this.column)?void 0:t.options)||(null==(e=this.field)?void 0:e.options)||[];return"string"==typeof n&&(n=n.split(",")),n.map((t=>{"string"==typeof t&&(t={value:t,text:t});for(const e of i)e.value===t.value&&(t.text=e.text);return a({back:"light",color:"black"},t)}))}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-bubbles-field-preview",class:t.$options.class},[n("k-bubbles",{attrs:{bubbles:t.bubbles}})],1)}),[],!1,pk,null,null,null);function pk(t){for(let e in ck)this[e]=ck[e]}var hk=function(){return dk.exports}();const fk={};var mk=Ft({inheritAttrs:!1,extends:hk,class:"k-array-field-preview",computed:{bubbles(){return[{text:1===this.value.length?`1 ${this.$t("entry")}`:`${this.value.length} ${this.$t("entries")}`}]}}},undefined,undefined,!1,gk,null,null,null);function gk(t){for(let e in fk)this[e]=fk[e]}var kk=function(){return mk.exports}();const vk={};var bk=Ft({mixins:[uk],inheritAttrs:!1,computed:{text(){return this.value}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("p",{staticClass:"k-text-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),t._t("default",(function(){return[t._v(t._s(t.text))]})),t._v(" "+t._s(t.column.after)+" ")],2)}),[],!1,yk,null,null,null);function yk(t){for(let e in vk)this[e]=vk[e]}var $k=function(){return bk.exports}();const _k={};var xk=Ft({inheritAttrs:!1,extends:$k,props:{value:String},class:"k-date-field-preview",computed:{text(){var t,e,n,i,s,o;if("string"!=typeof this.value)return"";const r=this.$library.dayjs(this.value);if(!r)return"";let a=(null==(t=this.column)?void 0:t.display)||(null==(e=this.field)?void 0:e.display)||"YYYY-MM-DD",l=(null==(i=null==(n=this.column)?void 0:n.time)?void 0:i.display)||(null==(o=null==(s=this.field)?void 0:s.time)?void 0:o.display);return l&&(a+=" "+l),r.format(a)}}},undefined,undefined,!1,wk,null,null,null);function wk(t){for(let e in _k)this[e]=_k[e]}var Sk=function(){return xk.exports}();const Ck={};var Ok=Ft({mixins:[uk],props:{value:[String,Object]},computed:{link(){return"object"==typeof this.value?this.value.href:this.value},text(){return"object"==typeof this.value?this.value.text:this.link}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("p",{staticClass:"k-url-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),n("k-link",{attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[t._v(" "+t._s(t.text)+" ")]),t._v(" "+t._s(t.column.after)+" ")],1)}),[],!1,Ek,null,null,null);function Ek(t){for(let e in Ck)this[e]=Ck[e]}var Ak=function(){return Ok.exports}();const Tk={};var Ik=Ft({extends:Ak,class:"k-email-field-preview"},undefined,undefined,!1,Mk,null,null,null);function Mk(t){for(let e in Tk)this[e]=Tk[e]}var Lk=function(){return Ik.exports}();const jk={};var Dk=Ft({inheritAttrs:!1,extends:hk,class:"k-files-field-preview",computed:{bubbles(){return this.value.map((t=>({text:t.filename,link:t.link,image:t.image})))}}},undefined,undefined,!1,Bk,null,null,null);function Bk(t){for(let e in jk)this[e]=jk[e]}var Pk=function(){return Dk.exports}();const Nk={};var qk=Ft({mixins:[uk],inheritAttrs:!1,props:{value:Object}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("k-status-icon",t._b({staticClass:"k-flag-field-preview"},"k-status-icon",t.value,!1))}),[],!1,Fk,null,null,null);function Fk(t){for(let e in Nk)this[e]=Nk[e]}var Rk=function(){return qk.exports}();const zk={};var Yk=Ft({inheritAttrs:!1,mixins:[uk],props:{value:String},computed:{html(){return this.value}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"k-html-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),n("div",{domProps:{innerHTML:t._s(t.html)}}),t._v(" "+t._s(t.column.after)+" ")])}),[],!1,Hk,null,null,null);function Hk(t){for(let e in zk)this[e]=zk[e]}var Uk=function(){return Yk.exports}();const Kk={};var Jk=Ft({inheritAttrs:!1,mixins:[uk],props:{value:[Object]}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("k-item-image",{staticClass:"k-image-field-preview",attrs:{image:t.value,layout:"list"}})}),[],!1,Gk,null,null,null);function Gk(t){for(let e in Kk)this[e]=Kk[e]}var Vk=function(){return Jk.exports}();const Wk={};var Xk=Ft({inheritAttrs:!1,extends:hk,class:"k-pages-field-preview"},undefined,undefined,!1,Zk,null,null,null);function Zk(t){for(let e in Wk)this[e]=Wk[e]}var Qk=function(){return Xk.exports}();const tv={};var ev=Ft({inheritAttrs:!1,extends:$k,props:{value:String},class:"k-time-field-preview",computed:{text(){const t=this.$library.dayjs.iso(this.value,"time");return(null==t?void 0:t.format(this.field.display))||""}}},undefined,undefined,!1,nv,null,null,null);function nv(t){for(let e in tv)this[e]=tv[e]}var iv=function(){return ev.exports}();const sv={props:{field:Object,value:Boolean,column:Object},computed:{text(){return!1!==this.column.text?this.field.text:null}}},ov={};var rv=Ft(sv,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("k-input",{staticClass:"k-toggle-field-preview",attrs:{text:t.text,value:t.value,type:"toggle"},on:{input:function(e){return t.$emit("input",e)}}})}),[],!1,av,null,null,null);function av(t){for(let e in ov)this[e]=ov[e]}var lv=function(){return rv.exports}();const uv={};var cv=Ft({inheritAttrs:!1,extends:hk,class:"k-users-field-preview",computed:{bubble(){return this.value.map((t=>({text:t.username,link:t.link,image:t.image})))}}},undefined,undefined,!1,dv,null,null,null);function dv(t){for(let e in uv)this[e]=uv[e]}var pv=function(){return cv.exports}();u.component("k-array-field-preview",kk),u.component("k-bubbles-field-preview",hk),u.component("k-date-field-preview",Sk),u.component("k-email-field-preview",Lk),u.component("k-files-field-preview",Pk),u.component("k-flag-field-preview",Rk),u.component("k-html-field-preview",Uk),u.component("k-image-field-preview",Vk),u.component("k-pages-field-preview",Qk),u.component("k-text-field-preview",$k),u.component("k-toggle-field-preview",lv),u.component("k-time-field-preview",iv),u.component("k-url-field-preview",Ak),u.component("k-users-field-preview",pv),u.component("k-list-field-preview",Uk),u.component("k-writer-field-preview",Uk),u.component("k-checkboxes-field-preview",hk),u.component("k-multiselect-field-preview",hk),u.component("k-radio-field-preview",hk),u.component("k-select-field-preview",hk),u.component("k-tags-field-preview",hk),u.component("k-dialog",Ut),u.component("k-error-dialog",Wt),u.component("k-fiber-dialog",te),u.component("k-files-dialog",oe),u.component("k-form-dialog",ce),u.component("k-language-dialog",fe),u.component("k-pages-dialog",ve),u.component("k-remove-dialog",xe),u.component("k-text-dialog",Oe),u.component("k-users-dialog",Ie),u.component("k-drawer",De),u.component("k-form-drawer",Fe),u.component("k-calendar",We),u.component("k-counter",en),u.component("k-autocomplete",Ue),u.component("k-form",an),u.component("k-form-buttons",pn),u.component("k-form-indicator",gn),u.component("k-field",In),u.component("k-fieldset",Bn),u.component("k-input",Rn),u.component("k-login",Un),u.component("k-login-code",Vn),u.component("k-times",Qn),u.component("k-upload",si),u.component("k-writer",Xi),u.component("k-login-alert",es),u.component("k-structure-form",os),u.component("k-toolbar",ds),u.component("k-toolbar-email-dialog",ms),u.component("k-toolbar-link-dialog",bs),u.component("k-aspect-ratio",eu),u.component("k-bar",ou),u.component("k-box",cu),u.component("k-bubble",fu),u.component("k-bubbles",vu),u.component("k-collection",xu),u.component("k-column",Eu),u.component("k-dropzone",Lu),u.component("k-empty",Pu),u.component("k-file-preview",Ru),u.component("k-grid",Uu),u.component("k-header",Wu),u.component("k-inside",tc),u.component("k-item",rc),u.component("k-item-image",dc),u.component("k-items",gc),u.component("k-overlay",$c),u.component("k-panel",Sc),u.component("k-stats",Ac),u.component("k-table",jc),u.component("k-table-cell",qc),u.component("k-tabs",Yc),u.component("k-view",Jc),u.component("k-draggable",Zc),u.component("k-error-boundary",nd),u.component("k-fatal",rd),u.component("k-headline",cd),u.component("k-icon",fd),u.component("k-icons",$d),u.component("k-image",Cd),u.component("k-loader",Td),u.component("k-offline-warning",jd),u.component("k-progress",qd),u.component("k-registration",Yd),u.component("k-status-icon",Zd),u.component("k-sort-handle",Jd),u.component("k-text",np),u.component("k-user-info",rp),u.component("k-breadcrumb",cp),u.component("k-button",mp),u.component("k-button-disabled",yp),u.component("k-button-group",wp),u.component("k-button-link",Ap),u.component("k-button-native",Dp),u.component("k-dropdown",qp),u.component("k-dropdown-content",Hp),u.component("k-dropdown-item",Vp),u.component("k-languages-dropdown",sh),u.component("k-link",th),u.component("k-options-dropdown",uh),u.component("k-pagination",fh),u.component("k-prev-next",bh),u.component("k-search",xh),u.component("k-tag",Eh),u.component("k-topbar",Lh),u.component("k-account-view",Sf),u.component("k-error-view",Af),u.component("k-file-view",Lf),u.component("k-installation-view",Nf),u.component("k-languages-view",zf),u.component("k-login-view",Vf),u.component("k-page-view",Qf),u.component("k-plugin-view",im),u.component("k-reset-password-view",am),u.component("k-site-view",dm),u.component("k-system-view",gm),u.component("k-users-view",ym),u.component("k-user-view",$f);u.config.productionTip=!1,u.config.devtools=!0,u.use(ct),u.use(Dt),u.use(Pt),u.use(qt),u.use(dt),u.use(Bt),u.use(vt),u.use(tt,ut),u.use(G),u.use(V),new u({store:ut,created(){window.panel.$vue=window.panel.app=this,window.panel.plugins.created.forEach((t=>t(this))),this.$store.dispatch("content/init")},render:t=>t(et)}).$mount("#app");
+import{V as t,a as e,m as s,d as i,c as n,b as o,I as r,P as l,S as a,F as u,N as c,s as d,l as p,w as h,e as m,f,t as g,g as k,h as b,i as v,j as y,k as $,n as _,D as x,o as w,E as S,p as C,q as O,r as A,T,u as I,v as M,x as L,y as E,z as j,A as B,B as D,C as P,G as N,H as q,J as F}from"./vendor.js";var R=t=>({changeName:async(e,s,i)=>t.patch(e+"/files/"+s+"/name",{name:i}),delete:async(e,s)=>t.delete(e+"/files/"+s),async get(e,s,i){let n=await t.get(e+"/files/"+s,i);return!0===Array.isArray(n.content)&&(n.content={}),n},link(t,e,s){return"/"+this.url(t,e,s)},update:async(e,s,i)=>t.patch(e+"/files/"+s,i),url(t,e,s){let i=t+"/files/"+e;return s&&(i+="/"+s),i}}),z=t=>({async blueprint(e){return t.get("pages/"+this.id(e)+"/blueprint")},async blueprints(e,s){return t.get("pages/"+this.id(e)+"/blueprints",{section:s})},async changeSlug(e,s){return t.patch("pages/"+this.id(e)+"/slug",{slug:s})},async changeStatus(e,s,i){return t.patch("pages/"+this.id(e)+"/status",{status:s,position:i})},async changeTemplate(e,s){return t.patch("pages/"+this.id(e)+"/template",{template:s})},async changeTitle(e,s){return t.patch("pages/"+this.id(e)+"/title",{title:s})},async children(e,s){return t.post("pages/"+this.id(e)+"/children/search",s)},async create(e,s){return null===e||"/"===e?t.post("site/children",s):t.post("pages/"+this.id(e)+"/children",s)},async delete(e,s){return t.delete("pages/"+this.id(e),s)},async duplicate(e,s,i){return t.post("pages/"+this.id(e)+"/duplicate",{slug:s,children:i.children||!1,files:i.files||!1})},async get(e,s){let i=await t.get("pages/"+this.id(e),s);return!0===Array.isArray(i.content)&&(i.content={}),i},id:t=>t.replace(/\//g,"+"),async files(e,s){return t.post("pages/"+this.id(e)+"/files/search",s)},link(t){return"/"+this.url(t)},async preview(t){return(await this.get(this.id(t),{select:"previewUrl"})).previewUrl},async search(e,s){return e?t.post("pages/"+this.id(e)+"/children/search?select=id,title,hasChildren",s):t.post("site/children/search?select=id,title,hasChildren",s)},async update(e,s){return t.patch("pages/"+this.id(e),s)},url(t,e){let s=null===t?"pages":"pages/"+String(t).replace(/\//g,"+");return e&&(s+="/"+e),s}});var Y=t=>({running:0,async request(e,s,i=!1){s=Object.assign(s||{},{credentials:"same-origin",cache:"no-store",headers:{"x-requested-with":"xmlhttprequest","content-type":"application/json",...s.headers}}),t.methodOverwrite&&"GET"!==s.method&&"POST"!==s.method&&(s.headers["x-http-method-override"]=s.method,s.method="POST"),s=t.onPrepare(s);const n=e+"/"+JSON.stringify(s);t.onStart(n,i),this.running++;const o=await fetch([t.endpoint,e].join(t.endpoint.endsWith("/")||e.startsWith("/")?"":"/"),s);try{const e=await async function(t){const e=await t.text();let s;try{s=JSON.parse(e)}catch(i){return window.panel.$vue.$api.onParserError({html:e}),!1}return s}(o);if(o.status<200||o.status>299)throw e;if("error"===e.status)throw e;let s=e;return e.data&&"model"===e.type&&(s=e.data),this.running--,t.onComplete(n),t.onSuccess(e),s}catch(r){throw this.running--,t.onComplete(n),t.onError(r),r}},async get(t,e,s,i=!1){return e&&(t+="?"+Object.keys(e).filter((t=>void 0!==e[t]&&null!==e[t])).map((t=>t+"="+e[t])).join("&")),this.request(t,Object.assign(s||{},{method:"GET"}),i)},async post(t,e,s,i="POST",n=!1){return this.request(t,Object.assign(s||{},{method:i,body:JSON.stringify(e)}),n)},async patch(t,e,s,i=!1){return this.post(t,e,s,"PATCH",i)},async delete(t,e,s,i=!1){return this.post(t,e,s,"DELETE",i)}}),H=t=>({blueprint:async e=>t.get("users/"+e+"/blueprint"),blueprints:async(e,s)=>t.get("users/"+e+"/blueprints",{section:s}),changeEmail:async(e,s)=>t.patch("users/"+e+"/email",{email:s}),changeLanguage:async(e,s)=>t.patch("users/"+e+"/language",{language:s}),changeName:async(e,s)=>t.patch("users/"+e+"/name",{name:s}),changePassword:async(e,s)=>t.patch("users/"+e+"/password",{password:s}),changeRole:async(e,s)=>t.patch("users/"+e+"/role",{role:s}),create:async e=>t.post("users",e),delete:async e=>t.delete("users/"+e),deleteAvatar:async e=>t.delete("users/"+e+"/avatar"),link(t,e){return"/"+this.url(t,e)},async list(e){return t.post(this.url(null,"search"),e)},get:async(e,s)=>t.get("users/"+e,s),async roles(e){return(await t.get(this.url(e,"roles"))).data.map((t=>({info:t.description||`(${window.panel.$t("role.description.placeholder")})`,text:t.title,value:t.name})))},search:async e=>t.post("users/search",e),update:async(e,s)=>t.patch("users/"+e,s),url(t,e){let s=t?"users/"+t:"users";return e&&(s+="/"+e),s}}),U={install(t,e){t.prototype.$api=t.$api=((t={})=>{const e={...{endpoint:"/api",methodOverwrite:!0,onPrepare:t=>t,onStart(){},onComplete(){},onSuccess(){},onParserError(){},onError(t){throw window.console.log(t.message),t}},...t.config||{}};let s={...e,...Y(e),...t};return s.auth=(t=>({async login(e){const s={long:e.remember||!1,email:e.email,password:e.password};return t.post("auth/login",s)},logout:async()=>t.post("auth/logout"),user:async e=>t.get("auth",e),verifyCode:async e=>t.post("auth/code",{code:e})}))(s),s.files=R(s),s.languages=(t=>({create:async e=>t.post("languages",e),delete:async e=>t.delete("languages/"+e),get:async e=>t.get("languages/"+e),list:async()=>t.get("languages"),update:async(e,s)=>t.patch("languages/"+e,s)}))(s),s.pages=z(s),s.roles=(t=>({list:async e=>t.get("roles",e),get:async e=>t.get("roles/"+e)}))(s),s.system=(t=>({get:async(e={view:"panel"})=>t.get("system",e),install:async e=>(await t.post("system/install",e)).user,register:async e=>t.post("system/register",e)}))(s),s.site=(t=>({blueprint:async()=>t.get("site/blueprint"),blueprints:async()=>t.get("site/blueprints"),changeTitle:async e=>t.patch("site/title",{title:e}),children:async e=>t.post("site/children/search",e),get:async(e={view:"panel"})=>t.get("site",e),update:async e=>t.post("site",e)}))(s),s.translations=(t=>({list:async()=>t.get("translations"),get:async e=>t.get("translations/"+e)}))(s),s.users=H(s),s})({config:{endpoint:window.panel.$urls.api,onComplete:s=>{t.$api.requests=t.$api.requests.filter((t=>t!==s)),0===t.$api.requests.length&&e.dispatch("isLoading",!1)},onError:e=>{window.panel.$config.debug&&window.console.error(e),403!==e.code||"Unauthenticated"!==e.message&&"access.panel"!==e.key||t.prototype.$go("/logout")},onParserError:({html:t,silent:s})=>{e.dispatch("fatal",{html:t,silent:s})},onPrepare:t=>(window.panel.$language&&(t.headers["x-language"]=window.panel.$language.code),t.headers["x-csrf"]=window.panel.$system.csrf,t),onStart:(s,i=!1)=>{!1===i&&e.dispatch("isLoading",!0),t.$api.requests.push(s)},onSuccess:()=>{clearInterval(t.$api.ping),t.$api.ping=setInterval(t.$api.auth.user,3e5)}},ping:null,requests:[]}),t.$api.ping=setInterval(t.$api.auth.user,3e5)}},K={name:"Fiber",data:()=>({component:null,state:window.fiber,key:null}),created(){this.$fiber.init(this.state,{base:document.querySelector("base").href,headers:()=>({"X-CSRF":this.state.$system.csrf}),onFatal({text:t,options:e}){this.$store.dispatch("fatal",{html:t,silent:e.silent})},onFinish:()=>{0===this.$api.requests.length&&this.$store.dispatch("isLoading",!1)},onPushState:t=>{window.history.pushState(t,"",t.$url)},onReplaceState:t=>{window.history.replaceState(t,"",t.$url)},onStart:({silent:t})=>{!0!==t&&this.$store.dispatch("isLoading",!0)},onSwap:async(t,e)=>{e={navigate:!0,replace:!1,...e},this.setGlobals(t),this.setTitle(t),this.setTranslation(t),this.component=t.$view.component,this.state=t,this.key=!0===e.replace?this.key:t.$view.timestamp,!0===e.navigate&&this.navigate()},query:()=>{var t;return{language:null==(t=this.state.$language)?void 0:t.code}}}),window.addEventListener("popstate",this.$reload)},methods:{navigate(){this.$store.dispatch("navigate")},setGlobals(e){["$config","$direction","$language","$languages","$license","$menu","$multilang","$permissions","$searches","$system","$translation","$urls","$user","$view"].forEach((s=>{void 0!==e[s]?t.prototype[s]=window.panel[s]=e[s]:t.prototype[s]=e[s]=window.panel[s]}))},setTitle(t){t.$view.title?document.title=t.$view.title+" | "+t.$system.title:document.title=t.$system.title},setTranslation(t){t.$translation&&(document.documentElement.lang=t.$translation.code)}},render(t){if(this.component)return t(this.component,{key:this.key,props:this.state.$view.props})}};function J(t){if(void 0!==t)return JSON.parse(JSON.stringify(t))}function G(t,e){for(const s of Object.keys(e))e[s]instanceof Object&&Object.assign(e[s],G(t[s]||{},e[s]));return Object.assign(t||{},e),t}var V={clone:J,isEmpty:function(t){return null==t||""===t||("object"==typeof t&&0===Object.keys(t).length&&t.constructor===Object||void 0!==t.length&&0===t.length)},merge:G};const W=(t,e)=>{localStorage.setItem("kirby$content$"+t,JSON.stringify(e))};var X={namespaced:!0,state:{current:null,models:{},status:{enabled:!0}},getters:{exists:t=>e=>Object.prototype.hasOwnProperty.call(t.models,e),hasChanges:(t,e)=>t=>{const s=e.model(t).changes;return Object.keys(s).length>0},isCurrent:t=>e=>t.current===e,id:t=>e=>(e=e||t.current,window.panel.$language?e+"?language="+window.panel.$language.code:e),model:(t,e)=>s=>(s=s||t.current,!0===e.exists(s)?t.models[s]:{api:null,originals:{},values:{},changes:{}}),originals:(t,e)=>t=>J(e.model(t).originals),values:(t,e)=>t=>({...e.originals(t),...e.changes(t)}),changes:(t,e)=>t=>J(e.model(t).changes)},mutations:{CLEAR(t){Object.keys(t.models).forEach((e=>{t.models[e].changes={}})),Object.keys(localStorage).forEach((t=>{t.startsWith("kirby$content$")&&localStorage.removeItem(t)}))},CREATE(e,[s,i]){if(!i)return!1;let n=e.models[s]?e.models[s].changes:i.changes;t.set(e.models,s,{api:i.api,originals:i.originals,changes:n||{}})},CURRENT(t,e){t.current=e},MOVE(e,[s,i]){const n=J(e.models[s]);t.delete(e.models,s),t.set(e.models,i,n);const o=localStorage.getItem("kirby$content$"+s);localStorage.removeItem("kirby$content$"+s),localStorage.setItem("kirby$content$"+i,o)},REMOVE(e,s){t.delete(e.models,s),localStorage.removeItem("kirby$content$"+s)},REVERT(e,s){e.models[s]&&(t.set(e.models[s],"changes",{}),localStorage.removeItem("kirby$content$"+s))},STATUS(e,s){t.set(e.status,"enabled",s)},UPDATE(e,[s,i,n]){if(!e.models[s])return!1;void 0===n&&(n=null),n=J(n);const o=JSON.stringify(n);JSON.stringify(e.models[s].originals[i])==o?t.delete(e.models[s].changes,i):t.set(e.models[s].changes,i,n),W(s,{api:e.models[s].api,originals:e.models[s].originals,changes:e.models[s].changes})}},actions:{init(t){Object.keys(localStorage).filter((t=>t.startsWith("kirby$content$"))).map((t=>t.split("kirby$content$")[1])).forEach((e=>{const s=localStorage.getItem("kirby$content$"+e);t.commit("CREATE",[e,JSON.parse(s)])})),Object.keys(localStorage).filter((t=>t.startsWith("kirby$form$"))).map((t=>t.split("kirby$form$")[1])).forEach((e=>{const s=localStorage.getItem("kirby$form$"+e);let i=null;try{i=JSON.parse(s)}catch(o){}if(!i||!i.api)return localStorage.removeItem("kirby$form$"+e),!1;const n={api:i.api,originals:i.originals,changes:i.values};t.commit("CREATE",[e,n]),W(e,n),localStorage.removeItem("kirby$form$"+e)}))},clear(t){t.commit("CLEAR")},create(t,e){const s=J(e.content);Array.isArray(e.ignore)&&e.ignore.forEach((t=>delete s[t])),e.id=t.getters.id(e.id);const i={api:e.api,originals:s,changes:{}};t.commit("CREATE",[e.id,i]),t.dispatch("current",e.id)},current(t,e){t.commit("CURRENT",e)},disable(t){t.commit("STATUS",!1)},enable(t){t.commit("STATUS",!0)},move(t,[e,s]){e=t.getters.id(e),s=t.getters.id(s),t.commit("MOVE",[e,s])},remove(t,e){t.commit("REMOVE",e),t.getters.isCurrent(e)&&t.commit("CURRENT",null)},revert(t,e){e=e||t.state.current,t.commit("REVERT",e)},async save(e,s){if(s=s||e.state.current,e.getters.isCurrent(s)&&!1===e.state.status.enabled)return!1;e.dispatch("disable");const i=e.getters.model(s),n={...i.originals,...i.changes};try{await t.$api.patch(i.api,n),e.commit("CREATE",[s,{...i,originals:n}]),e.dispatch("revert",s)}finally{e.dispatch("enable")}},update(t,[e,s,i]){i=i||t.state.current,t.commit("UPDATE",[i,e,s])}}},Z={namespaced:!0,state:{open:[]},mutations:{CLOSE(t,e){t.open=e?t.open.filter((t=>t.id!==e)):[]},GOTO(t,e){t.open=t.open.slice(0,t.open.findIndex((t=>t.id===e))+1)},OPEN(t,e){t.open.push(e)}},actions:{close(t,e){t.commit("CLOSE",e)},goto(t,e){t.commit("GOTO",e)},open(t,e){t.commit("OPEN",e)}}},Q={timer:null,namespaced:!0,state:{type:null,message:null,details:null,timeout:null},mutations:{SET(t,e){t.type=e.type,t.message=e.message,t.details=e.details,t.timeout=e.timeout},UNSET(t){t.type=null,t.message=null,t.details=null,t.timeout=null}},actions:{close(t){clearTimeout(this.timer),t.commit("UNSET")},deprecated(t,e){console.warn("Deprecated: "+e)},error(t,e){let s=e;"string"==typeof e&&(s={message:e}),e instanceof Error&&(s={message:e.message},window.panel.$config.debug&&window.console.error(e)),t.dispatch("dialog",{component:"k-error-dialog",props:s},{root:!0}),t.dispatch("close")},open(t,e){t.dispatch("close"),t.commit("SET",e),e.timeout&&(this.timer=setTimeout((()=>{t.dispatch("close")}),e.timeout))},success(t,e){"string"==typeof e&&(e={message:e}),t.dispatch("open",{type:"success",timeout:4e3,...e})}}};t.use(e);var tt=new e.Store({strict:!1,state:{dialog:null,drag:null,fatal:!1,isLoading:!1},mutations:{SET_DIALOG(t,e){t.dialog=e},SET_DRAG(t,e){t.drag=e},SET_FATAL(t,e){t.fatal=e},SET_LOADING(t,e){t.isLoading=e}},actions:{dialog(t,e){t.commit("SET_DIALOG",e)},drag(t,e){t.commit("SET_DRAG",e)},fatal(t,e){!1!==e?(console.error("The JSON response could not be parsed"),window.panel.$config.debug&&console.info(e.html),e.silent||t.commit("SET_FATAL",e.html)):t.commit("SET_FATAL",!1)},isLoading(t,e){t.commit("SET_LOADING",!0===e)},navigate(t){t.dispatch("dialog",null),t.dispatch("drawers/close")}},modules:{content:X,drawers:Z,notification:Q}}),et={install(t){window.panel=window.panel||{},window.onunhandledrejection=t=>{t.preventDefault(),tt.dispatch("notification/error",t.reason)},window.panel.deprecated=t=>{tt.dispatch("notification/deprecated",t)},window.panel.error=t.config.errorHandler=t=>{tt.dispatch("notification/error",t)}}},st={install(t){const e=s(),i={$on:e.on,$off:e.off,$emit:e.emit,blur(t){i.$emit("blur",t)},click(t){i.$emit("click",t)},copy(t){i.$emit("copy",t)},dragenter(t){i.entered=t.target,i.prevent(t),i.$emit("dragenter",t)},dragleave(t){i.prevent(t),i.entered===t.target&&i.$emit("dragleave",t)},drop(t){i.prevent(t),i.$emit("drop",t)},entered:null,focus(t){i.$emit("focus",t)},keydown(e){let s=["keydown"];(e.metaKey||e.ctrlKey)&&s.push("cmd"),!0===e.altKey&&s.push("alt"),!0===e.shiftKey&&s.push("shift");let n=t.prototype.$helper.string.lcfirst(e.key);const o={escape:"esc",arrowUp:"up",arrowDown:"down",arrowLeft:"left",arrowRight:"right"};o[n]&&(n=o[n]),!1===["alt","control","shift","meta"].includes(n)&&s.push(n),i.$emit(s.join("."),e),i.$emit("keydown",e)},keyup(t){i.$emit("keyup",t)},online(t){i.$emit("online",t)},offline(t){i.$emit("offline",t)},paste(t){i.$emit("paste",t)},prevent(t){t.stopPropagation(),t.preventDefault()}};document.addEventListener("click",i.click,!1),document.addEventListener("copy",i.copy,!0),document.addEventListener("focus",i.focus,!0),document.addEventListener("paste",i.paste,!0),window.addEventListener("blur",i.blur,!1),window.addEventListener("dragenter",i.dragenter,!1),window.addEventListener("dragexit",i.prevent,!1),window.addEventListener("dragleave",i.dragleave,!1),window.addEventListener("drop",i.drop,!1),window.addEventListener("dragover",i.prevent,!1),window.addEventListener("keydown",i.keydown,!1),window.addEventListener("keyup",i.keyup,!1),window.addEventListener("offline",i.offline),window.addEventListener("online",i.online),t.prototype.$events=i}};class it{constructor(t={}){this.options={base:"/",headers:()=>({}),onFatal:()=>{},onFinish:()=>{},onPushState:()=>{},onReplaceState:()=>{},onStart:()=>{},onSwap:()=>{},query:()=>({}),...t},this.state={}}init(t={},e={}){this.options={...this.options,...e},this.setState(t)}arrayToString(t){return!1===Array.isArray(t)?String(t):t.join(",")}body(t){return"object"==typeof t?JSON.stringify(t):t}async fetch(t,e){return fetch(t,e)}async go(t,e){try{const s=await this.request(t,e);return!1!==s&&this.setState(s,e)}catch(s){if(!0!==(null==e?void 0:e.silent))throw s}}query(t={},e={}){let s=new URLSearchParams(e);return"object"!=typeof t&&(t={}),Object.entries(t).forEach((([t,e])=>{null!==e&&s.set(t,e)})),Object.entries(this.options.query()).forEach((([t,e])=>{var i,n;null!==(e=null!=(n=null!=(i=s.get(t))?i:e)?n:null)&&s.set(t,e)})),s}redirect(t){window.location.href=t}reload(t={}){return this.go(window.location.href,{...t,replace:!0})}async request(t="",e={}){var s;const i=!!(e={globals:!1,method:"GET",only:[],query:{},silent:!1,type:"$view",...e}).globals&&this.arrayToString(e.globals),n=this.arrayToString(e.only);this.options.onStart(e);try{const r=this.url(t,e.query);if(new URL(r).origin!==location.origin)return this.redirect(r),!1;const l=await this.fetch(r,{method:e.method,body:this.body(e.body),credentials:"same-origin",cache:"no-store",headers:{...this.options.headers(),"X-Fiber":!0,"X-Fiber-Globals":i,"X-Fiber-Only":n,"X-Fiber-Referrer":(null==(s=this.state.$view)?void 0:s.path)||null,...e.headers}});if(!1===l.headers.has("X-Fiber"))return this.redirect(l.url),!1;const a=await l.text();let u;try{u=JSON.parse(a)}catch(o){return this.options.onFatal({url:r,path:t,options:e,response:l,text:a}),!1}if(!u[e.type])throw Error(`The ${e.type} could not be loaded`);const c=u[e.type];if(c.error)throw Error(c.error);return"$view"===e.type?n.length?G(this.state,u):u:c}finally{this.options.onFinish(e)}}async setState(t,e={}){return"object"==typeof t&&(this.state=J(t),!0===e.replace||this.url(this.state.$url).href===window.location.href?this.options.onReplaceState(this.state,e):this.options.onPushState(this.state,e),this.options.onSwap(this.state,e),this.state)}url(t="",e={}){return(t="string"==typeof t&&null===t.match(/^https?:\/\//)?new URL(this.options.base+t.replace(/^\//,"")):new URL(t)).search=this.query(e,t.search),t}}const nt=async function(t){return{cancel:null,submit:null,props:{},...t}},ot=async function(t,e={}){let s=null,i=null;"function"==typeof e?(s=e,e={}):(s=e.submit,i=e.cancel);let n=await this.$fiber.request("dialogs/"+t,{...e,type:"$dialog"});return"object"==typeof n&&(n.submit=s||null,n.cancel=i||null,n)};async function rt(t,e={}){let s=null;if(s="object"==typeof t?await nt.call(this,t):await ot.call(this,t,e),!s)return!1;if(!s.component||!1===this.$helper.isComponent(s.component))throw Error("The dialog component does not exist");return s.props=s.props||{},this.$store.dispatch("dialog",s),s}function lt(t,e={}){return async s=>{const i=await this.$fiber.request("dropdowns/"+t,{...e,type:"$dropdown"});if(!i)return!1;if(!1===Array.isArray(i.options)||0===i.options.length)throw Error("The dropdown is empty");i.options.map((t=>(t.dialog&&(t.click=()=>{const e="string"==typeof t.dialog?t.dialog:t.dialog.url,s="object"==typeof t.dialog?t.dialog:{};return this.$dialog(e,s)}),t))),s(i.options)}}async function at(t,e,s={}){return await this.$fiber.request("search/"+t,{query:{query:e},type:"$search",...s})}var ut={install(t){const e=new it;t.prototype.$fiber=window.panel.$fiber=e,t.prototype.$dialog=window.panel.$dialog=rt,t.prototype.$dropdown=window.panel.$dropdown=lt,t.prototype.$go=window.panel.$go=e.go.bind(e),t.prototype.$reload=window.panel.$reload=e.reload.bind(e),t.prototype.$request=window.panel.$request=e.request.bind(e),t.prototype.$search=window.panel.$search=at,t.prototype.$url=window.panel.$url=e.url.bind(e)}};var ct={read:function(t){if(!t)return null;if("string"==typeof t)return t;if(t instanceof ClipboardEvent){t.preventDefault();const e=t.clipboardData.getData("text/html")||t.clipboardData.getData("text/plain")||null;if(e)return e.replace(/\u00a0/g," ")}return null},write:function(t,e){if("string"!=typeof t&&(t=JSON.stringify(t,null,2)),e&&e instanceof ClipboardEvent)return e.preventDefault(),e.clipboardData.setData("text/plain",t),!0;const s=document.createElement("textarea");if(s.value=t,document.body.append(s),navigator.userAgent.match(/ipad|ipod|iphone/i)){s.contentEditable=!0,s.readOnly=!0;const t=document.createRange();t.selectNodeContents(s);const e=window.getSelection();e.removeAllRanges(),e.addRange(t),s.setSelectionRange(0,999999)}else s.select();return document.execCommand("copy"),s.remove(),!0}};function dt(t){if("string"==typeof t){if("pattern"===(t=t.toLowerCase()))return"var(--color-gray-800) var(--bg-pattern)";if(!1===t.startsWith("#")&&!1===t.startsWith("var(")){const e="--color-"+t;if(window.getComputedStyle(document.documentElement).getPropertyValue(e))return`var(${e})`}return t}}var pt=(t,e)=>{let s=null;return function(){clearTimeout(s),s=setTimeout((()=>t.apply(this,arguments)),e)}};function ht(t,e=!1){if(!t.match("youtu"))return!1;let s=null;try{s=new URL(t)}catch(d){return!1}const i=s.pathname.split("/").filter((t=>""!==t)),n=i[0],o=i[1],r="https://"+(!0===e?"www.youtube-nocookie.com":s.host)+"/embed",l=t=>!!t&&null!==t.match(/^[a-zA-Z0-9_-]+$/);let a=s.searchParams,u=null;switch(i.join("/")){case"embed/videoseries":case"playlist":l(a.get("list"))&&(u=r+"/videoseries");break;case"watch":l(a.get("v"))&&(u=r+"/"+a.get("v"),a.has("t")&&a.set("start",a.get("t")),a.delete("v"),a.delete("t"));break;default:s.host.includes("youtu.be")&&l(n)?(u="https://www.youtube.com/embed/"+n,a.has("t")&&a.set("start",a.get("t")),a.delete("t")):"embed"===n&&l(o)&&(u=r+"/"+o)}if(!u)return!1;const c=a.toString();return c.length&&(u+="?"+c),u}function mt(t,e=!1){let s=null;try{s=new URL(t)}catch(a){return!1}const i=s.pathname.split("/").filter((t=>""!==t));let n=s.searchParams,o=null;switch(!0===e&&n.append("dnt",1),s.host){case"vimeo.com":case"www.vimeo.com":o=i[0];break;case"player.vimeo.com":o=i[1]}if(!o||!o.match(/^[0-9]*$/))return!1;let r="https://player.vimeo.com/video/"+o;const l=n.toString();return l.length&&(r+="?"+l),r}var ft={youtube:ht,vimeo:mt,video:function(t,e=!1){return t.includes("youtu")?ht(t,e):!!t.includes("vimeo")&&mt(t,e)}},gt=e=>void 0!==t.options.components[e],kt=t=>!!t.dataTransfer&&(!!t.dataTransfer.types&&(!0===t.dataTransfer.types.includes("Files")&&!1===t.dataTransfer.types.includes("text/plain")));var bt={metaKey:function(){return window.navigator.userAgent.indexOf("Mac")>-1?"cmd":"ctrl"}},vt=(t="3/2",e="100%",s=!0)=>{const i=String(t).split("/");if(2!==i.length)return e;const n=Number(i[0]),o=Number(i[1]);let r=100;return 0!==n&&0!==o&&(r=s?r/n*o:r/o*n,r=parseFloat(String(r)).toFixed(2)),r+"%"},yt=t=>{var e=(t=t||{}).desc?-1:1,s=-e,i=/^0/,n=/\s+/g,o=/^\s+|\s+$/g,r=/[^\x00-\x80]/,l=/^0x[0-9a-f]+$/i,a=/(0x[\da-fA-F]+|(^[\+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|\d+)/g,u=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=t.insensitive?function(t){return function(t){if(t.toLocaleLowerCase)return t.toLocaleLowerCase();return t.toLowerCase()}(""+t).replace(o,"")}:function(t){return(""+t).replace(o,"")};function d(t){return t.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")}function p(t,e){return(!t.match(i)||1===e)&&parseFloat(t)||t.replace(n," ").replace(o,"")||0}return function(t,i){var n=c(t),o=c(i);if(!n&&!o)return 0;if(!n&&o)return s;if(n&&!o)return e;var a=d(n),h=d(o),m=parseInt(n.match(l),16)||1!==a.length&&Date.parse(n),f=parseInt(o.match(l),16)||m&&o.match(u)&&Date.parse(o)||null;if(f){if(mf)return e}for(var g=a.length,k=h.length,b=0,v=Math.max(g,k);b0)return e;if(_<0)return s;if(b===v-1)return 0}else{if(y<$)return s;if(y>$)return e}}return 0}};function $t(t){const e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(t).replace(/[&<>"'`=/]/g,(t=>e[t]))}function _t(t,e={}){const s=(t,e={})=>{var i;const n=$t(t.shift()),o=null!=(i=e[n])?i:null;return null===o?Object.prototype.hasOwnProperty.call(e,n)||"…":0===t.length?o:s(t,o)},i="[{]{1,2}[\\s]?",n="[\\s]?[}]{1,2}";return(t=t.replace(new RegExp(`${i}(.*?)${n}`,"gi"),((t,i)=>s(i.split("."),e)))).replace(new RegExp(`${i}.*${n}`,"gi"),"…")}function xt(t){const e=String(t);return e.charAt(0).toUpperCase()+e.slice(1)}RegExp.escape=function(t){return t.replace(new RegExp("[-/\\\\^$*+?.()[\\]{}]","gu"),"\\$&")};var wt={camelToKebab:function(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()},escapeHTML:$t,hasEmoji:function(t){if("string"!=typeof t)return!1;const e=t.match(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c\ude32-\ude3a]|[\ud83c\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/i);return null!==e&&null!==e.length},lcfirst:function(t){const e=String(t);return e.charAt(0).toLowerCase()+e.slice(1)},pad:function(t,e=2){t=String(t);let s="";for(;s.length]+)>)/gi,"")},template:_t,ucfirst:xt,ucwords:function(t){return String(t).split(/ /g).map((t=>xt(t))).join(" ")},uuid:function(){let t,e,s="";for(t=0;t<32;t++)e=16*Math.random()|0,8!=t&&12!=t&&16!=t&&20!=t||(s+="-"),s+=(12==t?4:16==t?3&e|8:e).toString(16);return s}},St=(t,e)=>{const s=Object.assign({url:"/",field:"file",method:"POST",attributes:{},complete:function(){},error:function(){},success:function(){},progress:function(){}},e),i=new FormData;i.append(s.field,t,t.name),s.attributes&&Object.keys(s.attributes).forEach((t=>{i.append(t,s.attributes[t])}));const n=new XMLHttpRequest,o=e=>{if(!e.lengthComputable||!s.progress)return;let i=Math.max(0,Math.min(100,e.loaded/e.total*100));s.progress(n,t,Math.ceil(i))};n.upload.addEventListener("loadstart",o),n.upload.addEventListener("progress",o),n.addEventListener("load",(e=>{let i=null;try{i=JSON.parse(e.target.response)}catch(o){i={status:"error",message:"The file could not be uploaded"}}"error"===i.status?s.error(n,t,i):(s.success(n,t,i),s.progress(n,t,100))})),n.addEventListener("error",(e=>{const i=JSON.parse(e.target.response);s.error(n,t,i),s.progress(n,t,100)})),n.open(s.method,s.url,!0),s.headers&&Object.keys(s.headers).forEach((t=>{const e=s.headers[t];n.setRequestHeader(t,e)})),n.send(i)},Ct={install(t){Array.prototype.sortBy=function(e){const s=t.prototype.$helper.sort(),i=e.split(" "),n=i[0],o=i[1]||"asc";return this.sort(((t,e)=>{const i=String(t[n]).toLowerCase(),r=String(e[n]).toLowerCase();return"desc"===o?s(r,i):s(i,r)}))},t.prototype.$helper={clipboard:ct,clone:V.clone,color:dt,embed:ft,isComponent:gt,isUploadEvent:kt,debounce:pt,keyboard:bt,object:V,pad:wt.pad,ratio:vt,slug:wt.slug,sort:yt,string:wt,upload:St,uuid:wt.uuid},t.prototype.$esc=wt.escapeHTML}},Ot={install(t){t.$t=t.prototype.$t=window.panel.$t=(t,e,s=null)=>{if("string"!=typeof t)return;const i=window.panel.$translation.data[t]||s;return"string"!=typeof i?i:_t(i,e)},t.directive("direction",{inserted(t,e,s){!0!==s.context.disabled?t.dir=s.context.$direction:t.dir=null}})}};i.extend(n),i.extend(((t,e,s)=>{s.interpret=(t,e="date")=>{const i={date:{"YYYY-MM-DD":!0,"YYYY-MM-D":!0,"YYYY-MM-":!0,"YYYY-MM":!0,"YYYY-M-DD":!0,"YYYY-M-D":!0,"YYYY-M-":!0,"YYYY-M":!0,"YYYY-":!0,YYYYMMDD:!0,"MMM DD YYYY":!1,"MMM D YYYY":!1,"MMM DD YY":!1,"MMM D YY":!1,"MMM DD":!1,"MMM D":!1,"DD MMMM YYYY":!1,"DD MMMM YY":!1,"DD MMMM":!1,"D MMMM YYYY":!1,"D MMMM YY":!1,"D MMMM":!1,"DD MMM YYYY":!1,"D MMM YYYY":!1,"DD MMM YY":!1,"D MMM YY":!1,"DD MMM":!1,"D MMM":!1,"DD MM YYYY":!1,"DD M YYYY":!1,"D MM YYYY":!1,"D M YYYY":!1,"DD MM YY":!1,"D MM YY":!1,"DD M YY":!1,"D M YY":!1,YYYY:!0,MMMM:!0,MMM:!0,"DD MM":!1,"DD M":!1,"D MM":!1,"D M":!1,DD:!1,D:!1},time:{"HH:mm:ss a":!1,"HH:mm:ss":!1,"HH:mm a":!1,"HH:mm":!1,"HH a":!1,HH:!1}};if("string"==typeof t&&""!==t)for(const n in i[e]){const o=s(t,n,i[e][n]);if(!0===o.isValid())return o}return null}})),i.extend(((t,e,s)=>{const i=t=>"date"===t?"YYYY-MM-DD":"time"===t?"HH:mm:ss":"YYYY-MM-DD HH:mm:ss";e.prototype.toISO=function(t="datetime"){return this.format(i(t))},s.iso=function(t,e="datetime"){const n=s(t,i(e));return n&&n.isValid()?n:null}})),i.extend(((t,e)=>{e.prototype.merge=function(t,e="date"){let s=this.clone();if(!t||!t.isValid())return this;if("string"==typeof e){const t={date:["year","month","date"],time:["hour","minute","second"]};if(!1===Object.prototype.hasOwnProperty.call(t,e))throw new Error("Invalid merge unit alias");e=t[e]}for(const i of e)s=s.set(i,t.get(i));return s}})),i.extend(((t,e,s)=>{s.pattern=t=>new class{constructor(t,e){this.dayjs=t,this.pattern=e;const s={year:["YY","YYYY"],month:["M","MM","MMM","MMMM"],day:["D","DD"],hour:["h","hh","H","HH"],minute:["m","mm"],second:["s","ss"],meridiem:["a"]};this.parts=this.pattern.split(/\W/).map(((t,e)=>{const i=this.pattern.indexOf(t);return{index:e,unit:Object.keys(s)[Object.values(s).findIndex((e=>e.includes(t)))],start:i,end:i+(t.length-1)}}))}at(t,e=t){const s=this.parts.filter((s=>s.start<=t&&s.end>=e-1));return s[0]?s[0]:this.parts.filter((e=>e.start<=t)).pop()}format(t){return t&&t.isValid()?t.format(this.pattern):null}}(s,t)})),i.extend(((t,e)=>{e.prototype.round=function(t="date",e=1){const s=["second","minute","hour","date","month","year"];if("day"===t&&(t="date"),!1===s.includes(t))throw new Error("Invalid rounding unit");if(["date","month","year"].includes(t)&&1!==e||"hour"===t&&24%e!=0||["second","minute"].includes(t)&&60%e!=0)throw"Invalid rounding size for "+t;let i=this.clone();const n=s.indexOf(t),o=s.slice(0,n),r=o.pop();if(o.forEach((t=>i=i.startOf(t))),r){const e={month:12,date:i.daysInMonth(),hour:24,minute:60,second:60}[r];Math.round(i.get(r)/e)*e===e&&(i=i.add(1,"date"===t?"day":t)),i=i.startOf(t)}return i=i.set(t,Math.round(i.get(t)/e)*e),i}})),i.extend(((t,e,s)=>{e.prototype.validate=function(t,e,i="day"){if(!this.isValid())return!1;if(!t)return!0;t=s.iso(t);const n={min:"isAfter",max:"isBefore"}[e];return this.isSame(t,i)||this[n](t,i)}}));var At={install(t){t.prototype.$library={autosize:o,dayjs:i}}},Tt={props:{blueprint:String,lock:[Boolean,Object],help:String,name:String,parent:String,timestamp:Number},methods:{load(){return this.$api.get(this.parent+"/sections/"+this.name)}}},It={install(t){const e={...t.options.components},s={section:Tt};for(const[i,n]of Object.entries(window.panel.plugins.components))n.template||n.render||n.extends?("string"==typeof(null==n?void 0:n.extends)&&(e[n.extends]?n.extends=e[n.extends].extend({options:n,components:{...e,...n.components||{}}}):n.extends=null),n.template&&(n.render=null),n.mixins&&(n.mixins=n.mixins.map((t=>"string"==typeof t?s[t]:t))),e[i]&&window.console.warn(`Plugin is replacing "${i}"`),t.component(i,n),e[i]=t.options.components[i]):tt.dispatch("notification/error",`Neither template or render method provided nor extending a component when loading plugin component "${i}". The component has not been registered.`);for(const i of window.panel.plugins.use)t.use(i)}};function Mt(t,e,s,i,n,o,r,l){var a,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=s,u._compiled=!0),i&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),r?(a=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},u._ssrRegister=a):n&&(a=l?function(){n.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:n),a)if(u.functional){u._injectStyles=a;var c=u.render;u.render=function(t,e){return a.call(e),c(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,a):[a]}return{exports:t,options:u}}var Lt=Mt({props:{autofocus:{type:Boolean,default:!0},cancelButton:{type:[String,Boolean],default:!0},icon:{type:String,default:"check"},size:{type:String,default:"default"},submitButton:{type:[String,Boolean],default:!0},theme:String,visible:Boolean},data:()=>({notification:null}),computed:{buttons(){let t=[];return this.cancelButton&&t.push({icon:"cancel",text:this.cancelButtonLabel,class:"k-dialog-button-cancel",click:this.cancel}),this.submitButtonConfig&&t.push({icon:this.icon,text:this.submitButtonLabel,theme:this.theme,class:"k-dialog-button-submit",click:this.submit}),t},cancelButtonLabel(){return!1!==this.cancelButton&&(!0===this.cancelButton||0===this.cancelButton.length?this.$t("cancel"):this.cancelButton)},submitButtonConfig(){return void 0!==this.$attrs.button?this.$attrs.button:void 0===this.submitButton||this.submitButton},submitButtonLabel(){return!0===this.submitButton||0===this.submitButton.length?this.$t("confirm"):this.submitButton}},created(){this.$events.$on("keydown.esc",this.close,!1)},destroyed(){this.$events.$off("keydown.esc",this.close,!1)},mounted(){this.visible&&this.$nextTick(this.open)},methods:{onOverlayClose(){this.notification=null,this.$emit("close"),this.$events.$off("keydown.esc",this.close),this.$store.dispatch("dialog",!1)},open(){this.$store.state.dialog||this.$store.dispatch("dialog",!0),this.notification=null,this.$refs.overlay.open(),this.$emit("open"),this.$events.$on("keydown.esc",this.close)},close(){this.$refs.overlay&&this.$refs.overlay.close()},cancel(){this.$emit("cancel"),this.close()},focus(){var t;if(null==(t=this.$refs.dialog)?void 0:t.querySelector){const t=this.$refs.dialog.querySelector(".k-dialog-button-cancel");"function"==typeof(null==t?void 0:t.focus)&&t.focus()}},error(t){this.notification={message:t,type:"error"}},submit(){this.$emit("submit")},success(t){this.notification={message:t,type:"success"}}}},(function(){var t=this,e=t._self._c;return e("k-overlay",{ref:"overlay",attrs:{autofocus:t.autofocus,centered:!0},on:{close:t.onOverlayClose,ready:function(e){return t.$emit("ready")}}},[e("div",{ref:"dialog",staticClass:"k-dialog",class:t.$vnode.data.staticClass,attrs:{"data-size":t.size},on:{mousedown:function(t){t.stopPropagation()}}},[t.notification?e("div",{staticClass:"k-dialog-notification",attrs:{"data-theme":t.notification.type}},[e("p",[t._v(t._s(t.notification.message))]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){t.notification=null}}})],1):t._e(),e("div",{staticClass:"k-dialog-body scroll-y-auto"},[t._t("default")],2),t.$slots.footer||t.buttons.length?e("footer",{staticClass:"k-dialog-footer"},[t._t("footer",(function(){return[e("k-button-group",{attrs:{buttons:t.buttons}})]}))],2):t._e()])])}),[],!1,null,null,null,null).exports,Et={props:{autofocus:{type:Boolean,default:!0},cancelButton:{type:[String,Boolean],default:!0},icon:String,submitButton:{type:[String,Boolean],default:!0},size:String,theme:String,visible:Boolean},methods:{close(){this.$refs.dialog.close(),this.$emit("close")},error(t){this.$refs.dialog.error(t)},open(){this.$refs.dialog.open(),this.$emit("open")},success(t){this.$refs.dialog.close(),t.route&&this.$go(t.route),t.message&&this.$store.dispatch("notification/success",t.message),t.event&&("string"==typeof t.event&&(t.event=[t.event]),t.event.forEach((e=>{this.$events.$emit(e,t)}))),!1!==Object.prototype.hasOwnProperty.call(t,"emit")&&!1===t.emit||this.$emit("success")}}};var jt=Mt({mixins:[Et],props:{details:[Object,Array],message:String,size:{type:String,default:"medium"}},computed:{detailsList(){return Array.isArray(this.details)?this.details:Object.values(this.details||{})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-error-dialog",attrs:{"cancel-button":!1,size:t.size,visible:!0},on:{cancel:function(e){return t.$emit("cancel")},close:function(e){return t.$emit("close")},submit:function(e){return t.$refs.dialog.close()}}},[e("k-text",[t._v(t._s(t.message))]),t.detailsList.length?e("dl",{staticClass:"k-error-details"},[t._l(t.detailsList,(function(s,i){return[e("dt",{key:"detail-label-"+i},[t._v(" "+t._s(s.label)+" ")]),e("dd",{key:"detail-message-"+i},["object"==typeof s.message?[e("ul",t._l(s.message,(function(s,i){return e("li",{key:i},[t._v(" "+t._s(s)+" ")])})),0)]:[t._v(" "+t._s(s.message)+" ")]],2)]}))],2):t._e()],1)}),[],!1,null,null,null,null).exports;var Bt=Mt({props:{code:Number,component:String,path:String,props:Object,referrer:String},methods:{close(){this.$refs.dialog.close()},onCancel(){"function"==typeof this.$store.state.dialog.cancel&&this.$store.state.dialog.cancel({dialog:this})},async onSubmit(t){let e=null;try{if("function"==typeof this.$store.state.dialog.submit)e=await this.$store.state.dialog.submit({dialog:this,value:t});else{if(!this.path)throw"The dialog needs a submit action or a dialog route path to be submitted";e=await this.$request(this.path,{body:t,method:"POST",type:"$dialog",headers:{"X-Fiber-Referrer":this.referrer}})}if(!1===e)return!1;this.close(),this.$store.dispatch("notification/success",":)"),e.event&&("string"==typeof e.event&&(e.event=[e.event]),e.event.forEach((t=>{this.$events.$emit(t,e)}))),e.dispatch&&Object.keys(e.dispatch).forEach((t=>{const s=e.dispatch[t];this.$store.dispatch(t,!0===Array.isArray(s)?[...s]:s)})),e.redirect?this.$go(e.redirect):this.$reload(e.reload||{})}catch(s){this.$refs.dialog.error(s)}}}},(function(){var t=this;return(0,t._self._c)(t.component,t._b({ref:"dialog",tag:"component",attrs:{visible:!0},on:{cancel:t.onCancel,submit:t.onSubmit}},"component",t.props,!1))}),[],!1,null,null,null,null).exports,Dt={data:()=>({models:[],issue:null,selected:{},options:{endpoint:null,max:null,multiple:!0,parent:null,selected:[],search:!0},search:null,pagination:{limit:20,page:1,total:0}}),computed:{checkedIcon(){return!0===this.multiple?"check":"circle-filled"},collection(){return{empty:this.emptyProps,items:this.items,link:!1,layout:"list",pagination:{details:!0,dropdown:!1,align:"center",...this.pagination},sortable:!1}},items(){return this.models.map(this.item)},multiple(){return!0===this.options.multiple&&1!==this.options.max}},watch:{search(){this.updateSearch()}},created(){this.updateSearch=pt(this.updateSearch,200)},methods:{async fetch(){const t={page:this.pagination.page,search:this.search,...this.fetchData||{}};try{const e=await this.$api.get(this.options.endpoint,t);this.models=e.data,this.pagination=e.pagination,this.onFetched&&this.onFetched(e)}catch(e){this.models=[],this.issue=e.message}},async open(t,e){this.pagination.page=0,this.search=null;let s=!0;Array.isArray(t)?(this.models=t,s=!1):(this.models=[],e=t),this.options={...this.options,...e},this.selected={},this.options.selected.forEach((t=>{this.$set(this.selected,t,{id:t})})),s&&await this.fetch(),this.$refs.dialog.open()},paginate(t){this.pagination.page=t.page,this.pagination.limit=t.limit,this.fetch()},submit(){this.$emit("submit",Object.values(this.selected)),this.$refs.dialog.close()},isSelected(t){return void 0!==this.selected[t.id]},item:t=>t,toggle(t){!1!==this.options.multiple&&1!==this.options.max||(this.selected={}),!0!==this.isSelected(t)?this.options.max&&this.options.max<=Object.keys(this.selected).length||this.$set(this.selected,t.id,t):this.$delete(this.selected,t.id)},toggleBtn(t){const e=this.isSelected(t);return{icon:e?this.checkedIcon:"circle-outline",tooltip:e?this.$t("remove"):this.$t("select"),theme:e?"positive":null}},updateSearch(){this.pagination.page=0,this.fetch()}}};var Pt=Mt({mixins:[Dt],computed:{emptyProps(){return{icon:"image",text:this.$t("dialog.files.empty")}}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-files-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[e("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.options.search?e("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",type:"text",icon:"search"},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}}):t._e(),e("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:s}){return[e("k-button",t._b({on:{click:function(e){return t.toggle(s)}}},"k-button",t.toggleBtn(s),!1))]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,null,null,null,null).exports;var Nt=Mt({mixins:[Et],props:{fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!0},size:{type:String,default:"medium"},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("save")},text:{type:String},theme:{type:String,default:"positive"},value:{type:Object,default:()=>({})}},data(){return{model:this.value}},computed:{hasFields(){return Object.keys(this.fields).length>0}},watch:{value(t,e){t!==e&&(this.model=t)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},close:function(e){return t.$emit("close")},ready:function(e){return t.$emit("ready")},submit:function(e){return t.$refs.form.submit()}}},"k-dialog",t.$props,!1),[t.text?[e("k-text",{domProps:{innerHTML:t._s(t.text)}})]:t._e(),t.hasFields?e("k-form",{ref:"form",attrs:{value:t.model,fields:t.fields,novalidate:t.novalidate},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"negative"}},[t._v(" This form dialog has no fields ")])],2)}),[],!1,null,null,null,null).exports;var qt=Mt({extends:Nt,watch:{"model.name"(t){this.fields.code.disabled||this.onNameChanges(t)},"model.code"(t){this.fields.code.disabled||(this.model.code=this.$helper.slug(t,[this.$system.ascii]),this.onCodeChanges(this.model.code))}},methods:{onCodeChanges(t){if(!t)return this.model.locale=null;if(t.length>=2)if(-1!==t.indexOf("-")){let e=t.split("-"),s=[e[0],e[1].toUpperCase()];this.model.locale=s.join("_")}else{let e=this.$system.locales||[];(null==e?void 0:e[t])?this.model.locale=e[t]:this.model.locale=null}},onNameChanges(t){this.model.code=this.$helper.slug(t,[this.model.rules,this.$system.ascii]).substr(0,2)}}},null,null,!1,null,null,null,null).exports;var Ft=Mt({mixins:[Dt],data(){const t=Dt.data();return{...t,model:{title:null,parent:null},options:{...t.options,parent:null}}},computed:{emptyProps(){return{icon:"page",text:this.$t("dialog.pages.empty")}},fetchData(){return{parent:this.options.parent}}},methods:{back(){this.options.parent=this.model.parent,this.pagination.page=1,this.fetch()},go(t){this.options.parent=t.id,this.pagination.page=1,this.fetch()},onFetched(t){this.model=t.model}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-pages-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[e("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.model?e("header",{staticClass:"k-pages-dialog-navbar"},[e("k-button",{attrs:{disabled:!t.model.id,tooltip:t.$t("back"),icon:"angle-left"},on:{click:t.back}}),e("k-headline",[t._v(t._s(t.model.title))])],1):t._e(),t.options.search?e("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",type:"text",icon:"search"},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}}):t._e(),e("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:s}){return[e("k-button",t._b({on:{click:function(e){return t.toggle(s)}}},"k-button",t.toggleBtn(s),!1)),s?e("k-button",{attrs:{disabled:!s.hasChildren,tooltip:t.$t("open"),icon:"angle-right"},on:{click:function(e){return e.stopPropagation(),t.go(s)}}}):t._e()]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,null,null,null,null).exports;var Rt=Mt({mixins:[Et],props:{icon:{type:String,default:"trash"},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("delete")},text:String,theme:{type:String,default:"negative"}}},(function(){var t=this;return(0,t._self._c)("k-text-dialog",t._g(t._b({ref:"dialog"},"k-text-dialog",t.$props,!1),t.$listeners),[t._t("default")],2)}),[],!1,null,null,null,null).exports;var zt=Mt({mixins:[Et],props:{text:String}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._g(t._b({ref:"dialog"},"k-dialog",t.$props,!1),t.$listeners),[t._t("default",(function(){return[t.text?e("k-text",{domProps:{innerHTML:t._s(t.text)}}):e("k-box",{attrs:{theme:"negative"}},[t._v(" This dialog does not define any text ")])]}))],2)}),[],!1,null,null,null,null).exports;var Yt=Mt({mixins:[Dt],computed:{emptyProps(){return{icon:"users",text:this.$t("dialog.users.empty")}}},methods:{item:t=>({...t,key:t.email,info:t.info!==t.text?t.info:null})}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-users-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[e("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.options.search?e("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",type:"text",icon:"search"},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}}):t._e(),e("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:s}){return[e("k-button",t._b({on:{click:function(e){return t.toggle(s)}}},"k-button",t.toggleBtn(s),!1))]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,null,null,null,null).exports;var Ht=Mt({inheritAttrs:!1,props:{id:String,icon:String,tab:String,tabs:Object,title:String},data:()=>({click:!1}),computed:{breadcrumb(){return this.$store.state.drawers.open},hasTabs(){return this.tabs&&Object.keys(this.tabs).length>1},index(){return this.breadcrumb.findIndex((t=>t.id===this._uid))},nested(){return this.index>0}},watch:{index(){-1===this.index&&this.close()}},destroyed(){this.$store.dispatch("drawers/close",this._uid)},methods:{close(){this.$refs.overlay.close()},goTo(t){if(t===this._uid)return!0;this.$store.dispatch("drawers/goto",t)},mouseup(){!0===this.click&&this.close(),this.click=!1},mousedown(t=!1){this.click=t,!0===this.click&&this.$store.dispatch("drawers/close")},onClose(){this.$store.dispatch("drawers/close",this._uid),this.$emit("close")},onOpen(){this.$store.dispatch("drawers/open",{id:this._uid,icon:this.icon,title:this.title}),this.$emit("open")},open(){this.$refs.overlay.open()}}},(function(){var t=this,e=t._self._c;return e("k-overlay",{ref:"overlay",attrs:{dimmed:!1},on:{close:t.onClose,open:t.onOpen}},[e("div",{staticClass:"k-drawer",attrs:{"data-id":t.id,"data-nested":t.nested},on:{mousedown:function(e){return e.stopPropagation(),t.mousedown(!0)},mouseup:t.mouseup}},[e("div",{staticClass:"k-drawer-box",on:{mousedown:function(e){return e.stopPropagation(),t.mousedown(!1)}}},[e("header",{staticClass:"k-drawer-header"},[1===t.breadcrumb.length?e("h2",{staticClass:"k-drawer-title"},[e("k-icon",{attrs:{type:t.icon}}),t._v(" "+t._s(t.title)+" ")],1):e("ul",{staticClass:"k-drawer-breadcrumb"},t._l(t.breadcrumb,(function(s){return e("li",{key:s.id},[e("k-button",{attrs:{icon:s.icon,text:s.title},on:{click:function(e){return t.goTo(s.id)}}})],1)})),0),t.hasTabs?e("nav",{staticClass:"k-drawer-tabs"},t._l(t.tabs,(function(s){return e("k-button",{key:s.name,staticClass:"k-drawer-tab",attrs:{current:t.tab==s.name,text:s.label},on:{click:function(e){return e.stopPropagation(),t.$emit("tab",s.name)}}})})),1):t._e(),e("nav",{staticClass:"k-drawer-options"},[t._t("options"),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"check"},on:{click:t.close}})],2)]),e("div",{staticClass:"k-drawer-body scroll-y-auto"},[t._t("default")],2)])])])}),[],!1,null,null,null,null).exports;var Ut=Mt({inheritAttrs:!1,props:{empty:{type:String,default:()=>"Missing field setup"},icon:String,id:String,tabs:Object,title:String,type:String,value:Object},data:()=>({tab:null}),computed:{fields(){const t=this.tab||null;return(this.tabs[t]||this.firstTab).fields||{}},firstTab(){return Object.values(this.tabs)[0]}},methods:{close(){this.$refs.drawer.close()},focus(t){var e;"function"==typeof(null==(e=this.$refs.form)?void 0:e.focus)&&this.$refs.form.focus(t)},open(t,e=!0){this.$refs.drawer.open(),this.tab=t||this.firstTab.name,!1!==e&&setTimeout((()=>{let t=Object.values(this.fields).filter((t=>!0===t.autofocus))[0]||null;this.focus(t)}),1)}}},(function(){var t=this,e=t._self._c;return e("k-drawer",{ref:"drawer",staticClass:"k-form-drawer",attrs:{id:t.id,icon:t.icon,tabs:t.tabs,tab:t.tab,title:t.title},on:{close:function(e){return t.$emit("close")},open:function(e){return t.$emit("open")},tab:function(e){t.tab=e}},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0},{key:"default",fn:function(){return[0===Object.keys(t.fields).length?e("k-box",{attrs:{theme:"info"}},[t._v(" "+t._s(t.empty)+" ")]):e("k-form",{ref:"form",attrs:{autofocus:!0,fields:t.fields,value:t.$helper.clone(t.value)},on:{input:function(e){return t.$emit("input",e)}}})]},proxy:!0}],null,!0)})}),[],!1,null,null,null,null).exports;var Kt=Mt({props:{html:{type:Boolean,default:!1},limit:{type:Number,default:10},skip:{type:Array,default:()=>[]},options:Array,query:String},data:()=>({matches:[],selected:{text:null}}),methods:{close(){this.$refs.dropdown.close()},onSelect(t){this.$emit("select",t),this.$refs.dropdown.close()},search(t){if(t.length<1)return;const e=new RegExp(RegExp.escape(t),"ig");this.matches=this.options.filter((t=>!!t.text&&(-1===this.skip.indexOf(t.value)&&null!==t.text.match(e)))).slice(0,this.limit),this.$emit("search",t,this.matches),this.$refs.dropdown.open()}}},(function(){var t=this,e=t._self._c;return e("k-dropdown",{staticClass:"k-autocomplete"},[t._t("default"),e("k-dropdown-content",t._g({ref:"dropdown",attrs:{autofocus:!0}},t.$listeners),t._l(t.matches,(function(s,i){return e("k-dropdown-item",t._b({key:i,on:{mousedown:function(e){return t.onSelect(s)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:(e.preventDefault(),t.onSelect(s))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onSelect(s))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:(e.preventDefault(),t.close.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:(e.preventDefault(),t.close.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:(e.preventDefault(),t.close.apply(null,arguments))}]}},"k-dropdown-item",s,!1),[e("span",{domProps:{innerHTML:t._s(t.html?s.text:t.$esc(s.text))}})])})),1),t._v(" "+t._s(t.query)+" ")],2)}),[],!1,null,null,null,null).exports;var Jt=Mt({props:{disabled:Boolean,max:String,min:String,value:String},data(){return this.data(this.value)},computed:{numberOfDays(){return this.toDate().daysInMonth()},firstWeekday(){const t=this.toDate().day();return t>0?t:7},weekdays(){return["mon","tue","wed","thu","fri","sat","sun"].map((t=>this.$t("days."+t)))},weeks(){const t=this.firstWeekday-1;return Math.ceil((this.numberOfDays+t)/7)},monthnames(){return["january","february","march","april","may","june","july","august","september","october","november","december"].map((t=>this.$t("months."+t)))},months(){var t=[];return this.monthnames.forEach(((e,s)=>{const i=this.toDate(1,s);t.push({value:s,text:e,disabled:i.isBefore(this.current.min,"month")||i.isAfter(this.current.max,"month")})})),t},years(){var t,e,s,i;const n=null!=(e=null==(t=this.current.min)?void 0:t.get("year"))?e:this.current.year-20,o=null!=(i=null==(s=this.current.max)?void 0:s.get("year"))?i:this.current.year+20;return this.toOptions(n,o)}},watch:{value(t){const e=this.data(t);this.dt=e.dt,this.current=e.current}},methods:{data(t){const e=this.$library.dayjs.iso(t),s=this.$library.dayjs();return{dt:e,current:{month:(null!=e?e:s).month(),year:(null!=e?e:s).year(),min:this.$library.dayjs.iso(this.min),max:this.$library.dayjs.iso(this.max)}}},days(t){let e=[];const s=7*(t-1)+1,i=s+7;for(let n=s;nthis.numberOfDays;e.push(s?"":t)}return e},isDisabled(t){const e=this.toDate(t);return this.disabled||e.isBefore(this.current.min,"day")||e.isAfter(this.current.max,"day")},isSelected(t){return this.toDate(t).isSame(this.dt,"day")},isToday(t){const e=this.$library.dayjs();return this.toDate(t).isSame(e,"day")},onInput(){var t;this.$emit("input",(null==(t=this.dt)?void 0:t.toISO("date"))||null)},onNext(){const t=this.toDate().add(1,"month");this.show(t)},onPrev(){const t=this.toDate().subtract(1,"month");this.show(t)},select(t){const e="today"===t?this.$library.dayjs().merge(this.toDate(),"time"):this.toDate(t);this.dt=e,this.show(e),this.onInput()},show(t){this.current.year=t.year(),this.current.month=t.month()},toDate(t=1,e=this.current.month){return this.$library.dayjs(`${this.current.year}-${e+1}-${t}`)},toOptions(t,e){for(var s=[],i=t;i<=e;i++)s.push({value:i,text:this.$helper.pad(i)});return s}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-calendar-input"},[e("nav",[e("k-button",{attrs:{icon:"angle-left"},on:{click:t.onPrev}}),e("span",{staticClass:"k-calendar-selects"},[e("k-select-input",{attrs:{options:t.months,disabled:t.disabled,required:!0},model:{value:t.current.month,callback:function(e){t.$set(t.current,"month",t._n(e))},expression:"current.month"}}),e("k-select-input",{attrs:{options:t.years,disabled:t.disabled,required:!0},model:{value:t.current.year,callback:function(e){t.$set(t.current,"year",t._n(e))},expression:"current.year"}})],1),e("k-button",{attrs:{icon:"angle-right"},on:{click:t.onNext}})],1),e("table",{staticClass:"k-calendar-table"},[e("thead",[e("tr",t._l(t.weekdays,(function(s){return e("th",{key:"weekday_"+s},[t._v(" "+t._s(s)+" ")])})),0)]),e("tbody",t._l(t.weeks,(function(s){return e("tr",{key:"week_"+s},t._l(t.days(s),(function(s,i){return e("td",{key:"day_"+i,staticClass:"k-calendar-day",attrs:{"aria-current":!!t.isToday(s)&&"date","aria-selected":!!t.isSelected(s)&&"date"}},[s?e("k-button",{attrs:{disabled:t.isDisabled(s),text:s},on:{click:function(e){return t.select(s)}}}):t._e()],1)})),0)})),0),e("tfoot",[e("tr",[e("td",{staticClass:"k-calendar-today",attrs:{colspan:"7"}},[e("k-button",{attrs:{text:t.$t("today")},on:{click:function(e){return t.select("today")}}})],1)])])])])}),[],!1,null,null,null,null).exports;var Gt=Mt({props:{count:Number,min:Number,max:Number,required:{type:Boolean,default:!1}},computed:{valid(){return!1===this.required&&0===this.count||(!0!==this.required||0!==this.count)&&(!(this.min&&this.countthis.max))}}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-counter",attrs:{"data-invalid":!t.valid}},[e("span",[t._v(t._s(t.count))]),t.min&&t.max?e("span",{staticClass:"k-counter-rules"},[t._v("("+t._s(t.min)+"–"+t._s(t.max)+")")]):t.min?e("span",{staticClass:"k-counter-rules"},[t._v("≥ "+t._s(t.min))]):t.max?e("span",{staticClass:"k-counter-rules"},[t._v("≤ "+t._s(t.max))]):t._e()])}),[],!1,null,null,null,null).exports;var Vt=Mt({props:{disabled:Boolean,config:Object,fields:{type:[Array,Object],default:()=>({})},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},data(){return{errors:{},listeners:{...this.$listeners,submit:this.onSubmit}}},methods:{focus(t){var e,s;null==(s=null==(e=this.$refs.fields)?void 0:e.focus)||s.call(e,t)},onSubmit(){this.$emit("submit",this.value)},submit(){this.$refs.submitter.click()}}},(function(){var t=this,e=t._self._c;return e("form",{ref:"form",staticClass:"k-form",attrs:{method:"POST",autocomplete:"off",novalidate:""},on:{submit:function(e){return e.preventDefault(),t.onSubmit.apply(null,arguments)}}},[t._t("header"),t._t("default",(function(){return[e("k-fieldset",t._g({ref:"fields",attrs:{disabled:t.disabled,fields:t.fields,novalidate:t.novalidate},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}},t.listeners))]})),t._t("footer"),e("input",{ref:"submitter",staticClass:"k-form-submitter",attrs:{type:"submit"}})],2)}),[],!1,null,null,null,null).exports;var Wt=Mt({props:{lock:[Boolean,Object]},data:()=>({isRefreshing:null,isLocking:null}),computed:{hasChanges(){return this.$store.getters["content/hasChanges"]()},isDisabled(){return!1===this.$store.state.content.status.enabled},isLocked(){return"lock"===this.lockState},isUnlocked(){return"unlock"===this.lockState},mode(){return null!==this.lockState?this.lockState:!0===this.hasChanges?"changes":null},lockState(){return this.supportsLocking&&this.lock?this.lock.state:null},supportsLocking(){return!1!==this.lock},theme(){return"lock"===this.mode?"negative":"unlock"===this.mode?"info":"notice"}},watch:{hasChanges:{handler(t,e){!0===this.supportsLocking&&!1===this.isLocked&&!1===this.isUnlocked&&(!0===t?(this.onLock(),this.isLocking=setInterval(this.onLock,3e4)):e&&(clearInterval(this.isLocking),this.onLock(!1)))},immediate:!0},isLocked(t){!1===t&&this.$events.$emit("model.reload")}},created(){this.supportsLocking&&(this.isRefreshing=setInterval(this.check,1e4)),this.$events.$on("keydown.cmd.s",this.onSave)},destroyed(){clearInterval(this.isRefreshing),clearInterval(this.isLocking),this.$events.$off("keydown.cmd.s",this.onSave)},methods:{check(){this.$reload({navigate:!1,only:"$view.props.lock",silent:!0})},async onLock(t=!0){const e=[this.$view.path+"/lock",null,null,!0];if(!0===t)try{await this.$api.patch(...e)}catch(s){clearInterval(this.isLocking),this.$store.dispatch("content/revert")}else clearInterval(this.isLocking),await this.$api.delete(...e)},onDownload(){let t="";const e=this.$store.getters["content/changes"]();Object.keys(e).forEach((s=>{t+=s+": \n\n"+e[s],t+="\n\n----\n\n"}));let s=document.createElement("a");s.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),s.setAttribute("download",this.$view.path+".txt"),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)},async onResolve(){await this.onUnlock(!1),this.$store.dispatch("content/revert")},onRevert(){this.$refs.revert.open()},async onSave(t){if(!t)return!1;t.preventDefault&&t.preventDefault();try{await this.$store.dispatch("content/save"),this.$events.$emit("model.update"),this.$store.dispatch("notification/success",":)")}catch(e){if(403===e.code)return;e.details&&Object.keys(e.details).length>0?this.$store.dispatch("notification/error",{message:this.$t("error.form.incomplete"),details:e.details}):this.$store.dispatch("notification/error",{message:this.$t("error.form.notSaved"),details:[{label:"Exception: "+e.exception,message:e.message}]})}},async onUnlock(t=!0){const e=[this.$view.path+"/unlock",null,null,!0];!0===t?await this.$api.patch(...e):await this.$api.delete(...e),this.$reload({silent:!0})},revert(){this.$store.dispatch("content/revert"),this.$refs.revert.close()}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-form-buttons",attrs:{"data-theme":t.theme}},["unlock"===t.mode?e("k-view",[e("p",{staticClass:"k-form-lock-info"},[t._v(" "+t._s(t.$t("lock.isUnlocked"))+" ")]),e("span",{staticClass:"k-form-lock-buttons"},[e("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("download"),icon:"download"},on:{click:t.onDownload}}),e("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("confirm"),icon:"check"},on:{click:t.onResolve}})],1)]):"lock"===t.mode?e("k-view",[e("p",{staticClass:"k-form-lock-info"},[e("k-icon",{attrs:{type:"lock"}}),e("span",{domProps:{innerHTML:t._s(t.$t("lock.isLocked",{email:t.$esc(t.lock.data.email)}))}})],1),t.lock.data.unlockable?e("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("lock.unlock"),icon:"unlock"},on:{click:function(e){return t.onUnlock()}}}):e("k-icon",{staticClass:"k-form-lock-loader",attrs:{type:"loader"}})],1):"changes"===t.mode?e("k-view",[e("k-button",{staticClass:"k-form-button",attrs:{disabled:t.isDisabled,text:t.$t("revert"),icon:"undo"},on:{click:t.onRevert}}),e("k-button",{staticClass:"k-form-button",attrs:{disabled:t.isDisabled,text:t.$t("save"),icon:"check"},on:{click:t.onSave}})],1):t._e(),e("k-dialog",{ref:"revert",attrs:{"submit-button":t.$t("revert"),icon:"undo",theme:"negative"},on:{submit:t.revert}},[e("k-text",{domProps:{innerHTML:t._s(t.$t("revert.confirm"))}})],1)],1)}),[],!1,null,null,null,null).exports;var Xt=Mt({data:()=>({isOpen:!1,options:[]}),computed:{hasChanges(){return this.ids.length>0},ids(){return Object.keys(this.store).filter((t=>{var e;return Object.keys((null==(e=this.store[t])?void 0:e.changes)||{}).length>0}))},store(){return this.$store.state.content.models}},methods:{async toggle(){if(!1===this.$refs.list.isOpen)try{await this.$dropdown("changes",{method:"POST",body:{ids:this.ids}})((t=>{this.options=t}))}catch(t){return this.$store.dispatch("notification/success",this.$t("lock.unsaved.empty")),this.$store.dispatch("content/clear"),!1}this.$refs.list&&this.$refs.list.toggle()}}},(function(){var t=this,e=t._self._c;return t.hasChanges?e("k-dropdown",{staticClass:"k-form-indicator"},[e("k-button",{staticClass:"k-form-indicator-toggle k-topbar-button",attrs:{icon:"edit"},on:{click:t.toggle}}),e("k-dropdown-content",{ref:"list",attrs:{align:"right",theme:"light"}},[e("p",{staticClass:"k-form-indicator-info"},[t._v(t._s(t.$t("lock.unsaved"))+":")]),e("hr"),t._l(t.options,(function(s){return e("k-dropdown-item",t._b({key:s.id},"k-dropdown-item",s,!1),[t._v(" "+t._s(s.text)+" ")])}))],2)],1):t._e()}),[],!1,null,null,null,null).exports,Zt={props:{after:String}},Qt={props:{autofocus:Boolean}},te={props:{before:String}},ee={props:{disabled:Boolean}},se={props:{help:String}},ie={props:{id:{type:[Number,String],default(){return this._uid}}}},ne={props:{invalid:Boolean}},oe={props:{label:String}},re={props:{name:[Number,String]}},le={props:{required:Boolean}};const ae={mixins:[ee,se,oe,re,le],props:{counter:[Boolean,Object],endpoints:Object,input:[String,Number],translate:Boolean,type:String}};var ue=Mt({mixins:[ae],inheritAttrs:!1,computed:{labelText(){return this.label||" "}}},(function(){var t=this,e=t._self._c;return e("div",{class:"k-field k-field-name-"+t.name,attrs:{"data-disabled":t.disabled,"data-translate":t.translate},on:{focusin:function(e){return t.$emit("focus",e)},focusout:function(e){return t.$emit("blur",e)}}},[t._t("header",(function(){return[e("header",{staticClass:"k-field-header"},[t._t("label",(function(){return[e("label",{staticClass:"k-field-label",attrs:{for:t.input}},[t._v(" "+t._s(t.labelText)+" "),t.required?e("abbr",{attrs:{title:t.$t("field.required")}},[t._v("*")]):t._e()])]})),t._t("options"),t._t("counter",(function(){return[t.counter?e("k-counter",t._b({staticClass:"k-field-counter",attrs:{required:t.required}},"k-counter",t.counter,!1)):t._e()]}))],2)]})),t._t("default"),t._t("footer",(function(){return[t.help||t.$slots.help?e("footer",{staticClass:"k-field-footer"},[t._t("help",(function(){return[t.help?e("k-text",{staticClass:"k-field-help",attrs:{theme:"help"},domProps:{innerHTML:t._s(t.help)}}):t._e()]}))],2):t._e()]}))],2)}),[],!1,null,null,null,null).exports;var ce=Mt({props:{config:Object,disabled:Boolean,fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},data:()=>({errors:{}}),methods:{focus(t){if(t)return void(this.hasField(t)&&"function"==typeof this.$refs[t][0].focus&&this.$refs[t][0].focus());const e=Object.keys(this.$refs)[0];this.focus(e)},hasFieldType(t){return this.$helper.isComponent(`k-${t}-field`)},hasField(t){var e;return null==(e=this.$refs[t])?void 0:e[0]},meetsCondition(t){if(!t.when)return!0;let e=!0;return Object.keys(t.when).forEach((s=>{this.value[s.toLowerCase()]!==t.when[s]&&(e=!1)})),e},onInvalid(t,e,s,i){this.errors[i]=e,this.$emit("invalid",this.errors)},hasErrors(){return Object.keys(this.errors).length}}},(function(){var t=this,e=t._self._c;return e("fieldset",{staticClass:"k-fieldset"},[e("k-grid",[t._l(t.fields,(function(s,i){return["hidden"!==s.type&&t.meetsCondition(s)?e("k-column",{key:s.signature,attrs:{width:s.width}},[e("k-error-boundary",[t.hasFieldType(s.type)?e("k-"+s.type+"-field",t._b({ref:i,refInFor:!0,tag:"component",attrs:{"form-data":t.value,name:i,novalidate:t.novalidate,disabled:t.disabled||s.disabled},on:{input:function(e){return t.$emit("input",t.value,s,i)},focus:function(e){return t.$emit("focus",e,s,i)},invalid:(e,n)=>t.onInvalid(e,n,s,i),submit:function(e){return t.$emit("submit",e,s,i)}},model:{value:t.value[i],callback:function(e){t.$set(t.value,i,e)},expression:"value[fieldName]"}},"component",s,!1)):e("k-box",{attrs:{theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[t._v(" The field type "),e("strong",[t._v('"'+t._s(i)+'"')]),t._v(" does not exist ")])],1)],1)],1):t._e()]}))],2)],1)}),[],!1,null,null,null,null).exports;const de={mixins:[Zt,te,ee,ne],props:{autofocus:Boolean,type:String,icon:[String,Boolean],theme:String,novalidate:{type:Boolean,default:!1},value:{type:[String,Boolean,Number,Object,Array],default:null}}};var pe=Mt({mixins:[de],inheritAttrs:!1,data(){return{isInvalid:this.invalid,listeners:{...this.$listeners,invalid:(t,e)=>{this.isInvalid=t,this.$emit("invalid",t,e)}}}},computed:{inputProps(){return{...this.$props,...this.$attrs}}},methods:{blur(t){(null==t?void 0:t.relatedTarget)&&!1===this.$el.contains(t.relatedTarget)&&this.trigger(null,"blur")},focus(t){this.trigger(t,"focus")},select(t){this.trigger(t,"select")},trigger(t,e){var s,i,n;if("INPUT"===(null==(s=null==t?void 0:t.target)?void 0:s.tagName)&&"function"==typeof(null==(i=null==t?void 0:t.target)?void 0:i[e]))return void t.target[e]();if("function"==typeof(null==(n=this.$refs.input)?void 0:n[e]))return void this.$refs.input[e]();const o=this.$el.querySelector("input, select, textarea");"function"==typeof(null==o?void 0:o[e])&&o[e]()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-input",attrs:{"data-disabled":t.disabled,"data-invalid":!t.novalidate&&t.isInvalid,"data-theme":t.theme,"data-type":t.type}},[t.$slots.before||t.before?e("span",{staticClass:"k-input-before",on:{click:t.focus}},[t._t("before",(function(){return[t._v(t._s(t.before))]}))],2):t._e(),e("span",{staticClass:"k-input-element",on:{click:function(e){return e.stopPropagation(),t.focus.apply(null,arguments)}}},[t._t("default",(function(){return[e("k-"+t.type+"-input",t._g(t._b({ref:"input",tag:"component",attrs:{value:t.value}},"component",t.inputProps,!1),t.listeners))]}))],2),t.$slots.after||t.after?e("span",{staticClass:"k-input-after",on:{click:t.focus}},[t._t("after",(function(){return[t._v(t._s(t.after))]}))],2):t._e(),t.$slots.icon||t.icon?e("span",{staticClass:"k-input-icon",on:{click:t.focus}},[t._t("icon",(function(){return[e("k-icon",{attrs:{type:t.icon}})]}))],2):t._e()])}),[],!1,null,null,null,null).exports;var he=Mt({props:{methods:Array},data:()=>({currentForm:null,isLoading:!1,issue:"",user:{email:"",password:"",remember:!1}}),computed:{canToggle(){return null!==this.codeMode&&!0===this.methods.includes("password")&&(!0===this.methods.includes("password-reset")||!0===this.methods.includes("code"))},codeMode(){return!0===this.methods.includes("password-reset")?"password-reset":!0===this.methods.includes("code")?"code":null},fields(){let t={email:{autofocus:!0,label:this.$t("email"),type:"email",required:!0,link:!1}};return"email-password"===this.form&&(t.password={label:this.$t("password"),type:"password",minLength:8,required:!0,autocomplete:"current-password",counter:!1}),t},form(){return this.currentForm?this.currentForm:"password"===this.methods[0]?"email-password":"email"},isResetForm(){return"password-reset"===this.codeMode&&"email"===this.form},toggleText(){return this.$t("login.toggleText."+this.codeMode+"."+this.formOpposite(this.form))}},methods:{formOpposite:t=>"email-password"===t?"email":"email-password",async login(){this.issue=null,this.isLoading=!0;let t=Object.assign({},this.user);"email"===this.currentForm&&(t.password=null),!0===this.isResetForm&&(t.remember=!1);try{await this.$api.auth.login(t),this.$reload({globals:["$system","$translation"]})}catch(e){this.issue=e.message}finally{this.isLoading=!1}},toggleForm(){this.currentForm=this.formOpposite(this.form),this.$refs.fieldset.focus("email")}}},(function(){var t=this,e=t._self._c;return e("form",{staticClass:"k-login-form",on:{submit:function(e){return e.preventDefault(),t.login.apply(null,arguments)}}},[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("login"))+" ")]),t.issue?e("k-login-alert",{on:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),e("div",{staticClass:"k-login-fields"},[!0===t.canToggle?e("button",{staticClass:"k-login-toggler",attrs:{type:"button"},on:{click:t.toggleForm}},[t._v(" "+t._s(t.toggleText)+" ")]):t._e(),e("k-fieldset",{ref:"fieldset",attrs:{novalidate:!0,fields:t.fields},model:{value:t.user,callback:function(e){t.user=e},expression:"user"}})],1),e("div",{staticClass:"k-login-buttons"},[!1===t.isResetForm?e("span",{staticClass:"k-login-checkbox"},[e("k-checkbox-input",{attrs:{value:t.user.remember,label:t.$t("login.remember")},on:{input:function(e){t.user.remember=e}}})],1):t._e(),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("login"+(t.isResetForm?".reset":"")))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)],1)],1)}),[],!1,null,null,null,null).exports;var me=Mt({props:{methods:Array,pending:Object},data:()=>({code:"",isLoadingBack:!1,isLoadingLogin:!1,issue:""}),computed:{mode(){return!0===this.methods.includes("password-reset")?"password-reset":"login"}},methods:{async back(){this.isLoadingBack=!0,this.$go("/logout")},async login(){this.issue=null,this.isLoadingLogin=!0;try{await this.$api.auth.verifyCode(this.code),this.$store.dispatch("notification/success",this.$t("welcome")),"password-reset"===this.mode?this.$go("reset-password"):this.$reload()}catch(t){this.issue=t.message}finally{this.isLoadingLogin=!1}}}},(function(){var t=this,e=t._self._c;return e("form",{staticClass:"k-login-form k-login-code-form",on:{submit:function(e){return e.preventDefault(),t.login.apply(null,arguments)}}},[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("login"))+" ")]),t.issue?e("k-login-alert",{on:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),e("k-user-info",{attrs:{user:t.pending.email}}),e("k-text-field",{attrs:{autofocus:!0,counter:!1,help:t.$t("login.code.text."+t.pending.challenge),label:t.$t("login.code.label."+t.mode),novalidate:!0,placeholder:t.$t("login.code.placeholder."+t.pending.challenge),required:!0,autocomplete:"one-time-code",icon:"unlock",name:"code"},model:{value:t.code,callback:function(e){t.code=e},expression:"code"}}),e("div",{staticClass:"k-login-buttons"},[e("k-button",{staticClass:"k-login-button k-login-back-button",attrs:{icon:"angle-left"},on:{click:t.back}},[t._v(" "+t._s(t.$t("back"))+" "),t.isLoadingBack?[t._v(" … ")]:t._e()],2),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("login"+("password-reset"===t.mode?".reset":"")))+" "),t.isLoadingLogin?[t._v(" … ")]:t._e()],2)],1)],1)}),[],!1,null,null,null,null).exports;var fe=Mt({props:{display:{type:String,default:"HH:mm"},value:String},computed:{day(){return this.formatTimes([6,7,8,9,10,11,"-",12,13,14,15,16,17])},night(){return this.formatTimes([18,19,20,21,22,23,"-",0,1,2,3,4,5])}},methods:{formatTimes(t){return t.map((t=>{if("-"===t)return t;const e=this.$library.dayjs(t+":00","H:mm");return{display:e.format(this.display),select:e.toISO("time")}}))},select(t){this.$emit("input",t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-times"},[e("div",{staticClass:"k-times-slot"},[e("k-icon",{attrs:{type:"sun"}}),e("ul",t._l(t.day,(function(s){return e("li",{key:s.select},["-"===s?e("hr"):e("k-button",{on:{click:function(e){return t.select(s.select)}}},[t._v(t._s(s.display))])],1)})),0)],1),e("div",{staticClass:"k-times-slot"},[e("k-icon",{attrs:{type:"moon"}}),e("ul",t._l(t.night,(function(s){return e("li",{key:s.select},["-"===s?e("hr"):e("k-button",{on:{click:function(e){return t.select(s.select)}}},[t._v(t._s(s.display))])],1)})),0)],1)])}),[],!1,null,null,null,null).exports;var ge=Mt({props:{accept:{type:String,default:"*"},attributes:{type:Object},max:{type:Number},method:{type:String,default:"POST"},multiple:{type:Boolean,default:!0},url:{type:String}},data(){return{options:this.$props,completed:{},errors:[],files:[],total:0}},computed:{limit(){return!1===this.options.multiple?1:this.options.max}},methods:{open(t){this.params(t),setTimeout((()=>{this.$refs.input.click()}),1)},params(t){this.options=Object.assign({},this.$props,t)},select(t){this.upload(t.target.files)},drop(t,e){this.params(e),this.upload(t)},upload(t){this.$refs.dialog.open(),this.files=[...t],this.completed={},this.errors=[],this.hasErrors=!1,this.limit&&(this.files=this.files.slice(0,this.limit)),this.total=this.files.length,this.files.forEach((t=>{var e,s;this.$helper.upload(t,{url:this.options.url,attributes:this.options.attributes,method:this.options.method,headers:{"X-CSRF":window.panel.$system.csrf},progress:(t,e,s)=>{var i,n;null==(n=null==(i=this.$refs[e.name])?void 0:i[0])||n.set(s)},success:(t,e,s)=>{this.complete(e,s.data)},error:(t,e,s)=>{this.errors.push({file:e,message:s.message}),this.complete(e,s.data)}}),void 0!==(null==(s=null==(e=this.options)?void 0:e.attributes)?void 0:s.sort)&&this.options.attributes.sort++}))},complete(t,e){if(this.completed[t.name]=e,Object.keys(this.completed).length==this.total){if(this.$refs.input.value="",this.errors.length>0)return this.$forceUpdate(),void this.$emit("error",this.files);setTimeout((()=>{this.$refs.dialog.close(),this.$emit("success",this.files,Object.values(this.completed))}),250)}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-upload"},[e("input",{ref:"input",attrs:{accept:t.options.accept,multiple:t.options.multiple,"aria-hidden":"true",type:"file",tabindex:"-1"},on:{change:t.select,click:function(t){t.stopPropagation()}}}),e("k-dialog",{ref:"dialog",staticClass:"k-upload-dialog",attrs:{"cancel-button":!1,"submit-button":!1,size:"medium"},scopedSlots:t._u([{key:"footer",fn:function(){return[t.errors.length>0?[e("k-button-group",{attrs:{buttons:[{icon:"check",text:t.$t("confirm"),click:()=>t.$refs.dialog.close()}]}})]:t._e()]},proxy:!0}])},[t.errors.length>0?[e("k-headline",[t._v(t._s(t.$t("upload.errors")))]),e("ul",{staticClass:"k-upload-error-list"},t._l(t.errors,(function(s,i){return e("li",{key:"error-"+i},[e("p",{staticClass:"k-upload-error-filename"},[t._v(" "+t._s(s.file.name)+" ")]),e("p",{staticClass:"k-upload-error-message"},[t._v(" "+t._s(s.message)+" ")])])})),0)]:[e("k-headline",[t._v(t._s(t.$t("upload.progress")))]),e("ul",{staticClass:"k-upload-list"},t._l(t.files,(function(s,i){return e("li",{key:"file-"+i},[e("k-progress",{ref:s.name,refInFor:!0}),e("p",{staticClass:"k-upload-list-filename"},[t._v(" "+t._s(s.name)+" ")]),e("p",[t._v(t._s(t.errors[s.name]))])],1)})),0)]],2)],1)}),[],!1,null,null,null,null).exports;var ke=t=>({$from:e})=>((t,e)=>{for(let s=t.depth;s>0;s--){const i=t.node(s);if(e(i))return{pos:s>0?t.before(s):0,start:t.start(s),depth:s,node:i}}})(e,t),be=t=>e=>{if((t=>t instanceof c)(e)){const{node:s,$from:i}=e;if(((t,e)=>Array.isArray(t)&&t.indexOf(e.type)>-1||e.type===t)(t,s))return{node:s,pos:i.pos,depth:i.depth}}},ve=(t,e,s={})=>{const i=be(e)(t.selection)||ke((t=>t.type===e))(t.selection);return Object.keys(s).length&&i?i.node.hasMarkup(e,{...i.node.attrs,...s}):!!i};function ye(t=null,e=null){if(!t||!e)return!1;const s=t.parent.childAfter(t.parentOffset);if(!s.node)return!1;const i=s.node.marks.find((t=>t.type===e));if(!i)return!1;let n=t.index(),o=t.start()+s.offset,r=n+1,l=o+s.node.nodeSize;for(;n>0&&i.isInSet(t.parent.child(n-1).marks);)n-=1,o-=t.parent.child(n).nodeSize;for(;r{n=[...n,...t.marks]}));const o=n.find((t=>t.type.name===e.name));return o?o.attrs:{}},getNodeAttrs:function(t,e){const{from:s,to:i}=t.selection;let n=[];t.doc.nodesBetween(s,i,(t=>{n=[...n,t]}));const o=n.reverse().find((t=>t.type.name===e.name));return o?o.attrs:{}},markInputRule:function(t,e,s){return new r(t,((t,i,n,o)=>{const r=s instanceof Function?s(i):s,{tr:l}=t,a=i.length-1;let u=o,c=n;if(i[a]){const s=n+i[0].indexOf(i[a-1]),r=s+i[a-1].length-1,d=s+i[a-1].lastIndexOf(i[a]),p=d+i[a].length,h=function(t,e,s){let i=[];return s.doc.nodesBetween(t,e,((t,e)=>{i=[...i,...t.marks.map((s=>({start:e,end:e+t.nodeSize,mark:s})))]})),i}(n,o,t).filter((t=>{const{excluded:s}=t.mark.type;return s.find((t=>t.name===e.name))})).filter((t=>t.end>s));if(h.length)return!1;ps&&l.delete(s,d),c=s,u=c+i[a].length}return l.addMark(c,u,e.create(r)),l.removeStoredMark(e),l}))},markIsActive:function(t,e){const{from:s,$from:i,to:n,empty:o}=t.selection;return o?!!e.isInSet(t.storedMarks||i.marks()):!!t.doc.rangeHasMark(s,n,e)},markPasteRule:function(t,e,s){const i=(n,o)=>{const r=[];return n.forEach((n=>{var l;if(n.isText){const{text:i,marks:a}=n;let u,c=0;const d=!!a.filter((t=>"link"===t.type.name))[0];for(;!d&&null!==(u=t.exec(i));)if((null==(l=null==o?void 0:o.type)?void 0:l.allowsMarkType(e))&&u[1]){const t=u.index,i=t+u[0].length,o=t+u[0].indexOf(u[1]),l=o+u[1].length,a=s instanceof Function?s(u):s;t>0&&r.push(n.cut(c,t)),r.push(n.cut(o,l).mark(e.create(a).addToSet(n.marks))),c=i}cnew a(i(t.content),t.openStart,t.openEnd)}})},minMax:function(t=0,e=0,s=0){return Math.min(Math.max(parseInt(t,10),e),s)},nodeIsActive:ve,nodeInputRule:function(t,e,s){return new r(t,((t,i,n,o)=>{const r=s instanceof Function?s(i):s,{tr:l}=t;return i[0]&&l.replaceWith(n-1,o,e.create(r)),l}))},pasteRule:function(t,e,s){const i=n=>{const o=[];return n.forEach((n=>{if(n.isText){const{text:i}=n;let r,l=0;do{if(r=t.exec(i),r){const t=r.index,i=t+r[0].length,a=s instanceof Function?s(r[0]):s;t>0&&o.push(n.cut(l,t)),o.push(n.cut(t,i).mark(e.create(a).addToSet(n.marks))),l=i}}while(r);lnew a(i(t.content),t.openStart,t.openEnd)}})},removeMark:function(t){return(e,s)=>{const{tr:i,selection:n}=e;let{from:o,to:r}=n;const{$from:l,empty:a}=n;if(a){const e=ye(l,t);o=e.from,r=e.to}return i.removeMark(o,r,t),s(i)}},toggleBlockType:function(t,e,s={}){return(i,n,o)=>ve(i,t,s)?d(e)(i,n,o):d(t,s)(i,n,o)},toggleList:function(t,e){return(s,i,n)=>{const{schema:o,selection:r}=s,{$from:l,$to:a}=r,u=l.blockRange(a);if(!u)return!1;const c=ke((t=>$e(t,o)))(r);if(u.depth>=1&&c&&u.depth-c.depth<=1){if(c.node.type===t)return p(e)(s,i,n);if($e(c.node,o)&&t.validContent(c.node.content)){const{tr:e}=s;return e.setNodeMarkup(c.pos,t),i&&i(e),!1}}return h(t)(s,i,n)}},updateMark:function(t,e){return(s,i)=>{const{tr:n,selection:o,doc:r}=s,{ranges:l,empty:a}=o;if(a){const{from:s,to:i}=ye(o.$from,t);r.rangeHasMark(s,i,t)&&n.removeMark(s,i,t),n.addMark(s,i,t.create(e))}else l.forEach((s=>{const{$to:i,$from:o}=s;r.rangeHasMark(o.pos,i.pos,t)&&n.removeMark(o.pos,i.pos,t),n.addMark(o.pos,i.pos,t.create(e))}));return i(n)}}};class xe{constructor(t=[],e){t.forEach((t=>{t.bindEditor(e),t.init()})),this.extensions=t}commands({schema:t,view:e}){return this.extensions.filter((t=>t.commands)).reduce(((s,i)=>{const{name:n,type:o}=i,r={},l=i.commands({schema:t,utils:_e,...["node","mark"].includes(o)?{type:t[`${o}s`][n]}:{}}),a=(t,s)=>{r[t]=t=>{if("function"!=typeof s||!e.editable)return!1;e.focus();const i=s(t);return"function"==typeof i?i(e.state,e.dispatch,e):i}};return"object"==typeof l?Object.entries(l).forEach((([t,e])=>{a(t,e)})):a(n,l),{...s,...r}}),{})}buttons(t="mark"){const e={};return this.extensions.filter((e=>e.type===t)).filter((t=>t.button)).forEach((t=>{Array.isArray(t.button)?t.button.forEach((t=>{e[t.id||t.name]=t})):e[t.name]=t.button})),e}getAllowedExtensions(t){return t instanceof Array||!t?t instanceof Array?this.extensions.filter((e=>!t.includes(e.name))):this.extensions:[]}getFromExtensions(t,e,s=this.extensions){return s.filter((t=>["extension"].includes(t.type))).filter((e=>e[t])).map((s=>s[t]({...e,utils:_e})))}getFromNodesAndMarks(t,e,s=this.extensions){return s.filter((t=>["node","mark"].includes(t.type))).filter((e=>e[t])).map((s=>s[t]({...e,type:e.schema[`${s.type}s`][s.name],utils:_e})))}inputRules({schema:t,excludedExtensions:e}){const s=this.getAllowedExtensions(e);return[...this.getFromExtensions("inputRules",{schema:t},s),...this.getFromNodesAndMarks("inputRules",{schema:t},s)].reduce(((t,e)=>[...t,...e]),[])}keymaps({schema:t}){return[...this.getFromExtensions("keys",{schema:t}),...this.getFromNodesAndMarks("keys",{schema:t})].map((t=>_(t)))}get marks(){return this.extensions.filter((t=>"mark"===t.type)).reduce(((t,{name:e,schema:s})=>({...t,[e]:s})),{})}get nodes(){return this.extensions.filter((t=>"node"===t.type)).reduce(((t,{name:e,schema:s})=>({...t,[e]:s})),{})}get options(){const{view:t}=this;return this.extensions.reduce(((e,s)=>({...e,[s.name]:new Proxy(s.options,{set(e,s,i){const n=e[s]!==i;return Object.assign(e,{[s]:i}),n&&t.updateState(t.state),!0}})})),{})}pasteRules({schema:t,excludedExtensions:e}){const s=this.getAllowedExtensions(e);return[...this.getFromExtensions("pasteRules",{schema:t},s),...this.getFromNodesAndMarks("pasteRules",{schema:t},s)].reduce(((t,e)=>[...t,...e]),[])}plugins({schema:t}){return[...this.getFromExtensions("plugins",{schema:t}),...this.getFromNodesAndMarks("plugins",{schema:t})].reduce(((t,e)=>[...t,...e]),[]).map((t=>t instanceof l?t:new l(t)))}}class we{constructor(t={}){this.options={...this.defaults,...t}}init(){return null}bindEditor(t=null){this.editor=t}get name(){return null}get type(){return"extension"}get defaults(){return{}}plugins(){return[]}inputRules(){return[]}pasteRules(){return[]}keys(){return{}}}class Se extends we{constructor(t={}){super(t)}get type(){return"node"}get schema(){return null}commands(){return{}}}class Ce extends Se{get defaults(){return{inline:!1}}get name(){return"doc"}get schema(){return{content:this.options.inline?"inline*":"block+"}}}class Oe extends Se{get button(){return{id:this.name,icon:"paragraph",label:window.panel.$t("toolbar.button.paragraph"),name:this.name}}commands({utils:t,type:e}){return{paragraph:()=>t.setBlockType(e)}}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}get name(){return"paragraph"}}class Ae extends Se{get name(){return"text"}get schema(){return{group:"inline"}}}class Te extends class{emit(t,...e){this._callbacks=this._callbacks||{};const s=this._callbacks[t];return s&&s.forEach((t=>t.apply(this,e))),this}off(t,e){if(arguments.length){const s=this._callbacks?this._callbacks[t]:null;s&&(e?this._callbacks[t]=s.filter((t=>t!==e)):delete this._callbacks[t])}else this._callbacks={};return this}on(t,e){return this._callbacks=this._callbacks||{},this._callbacks[t]=this._callbacks[t]||[],this._callbacks[t].push(e),this}}{constructor(t={}){super(),this.defaults={autofocus:!1,content:"",disableInputRules:!1,disablePasteRules:!1,editable:!0,element:null,extensions:[],emptyDocument:{type:"doc",content:[]},events:{},inline:!1,parseOptions:{},topNode:"doc",useBuiltInExtensions:!0},this.init(t)}blur(){this.view.dom.blur()}get builtInExtensions(){return this.options.useBuiltInExtensions?[new Ce({inline:this.options.inline}),new Ae,new Oe]:[]}buttons(t){return this.extensions.buttons(t)}clearContent(t=!1){this.setContent(this.options.emptyDocument,t)}command(t,...e){this.commands[t]&&this.commands[t](...e)}createCommands(){return this.extensions.commands({schema:this.schema,view:this.view})}createDocument(t,e=this.options.parseOptions){if(null===t)return this.schema.nodeFromJSON(this.options.emptyDocument);if("object"==typeof t)try{return this.schema.nodeFromJSON(t)}catch(s){return window.console.warn("Invalid content.","Passed value:",t,"Error:",s),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"==typeof t){const s=`${t}
`,i=(new window.DOMParser).parseFromString(s,"text/html").body.firstElementChild;return x.fromSchema(this.schema).parse(i,e)}return!1}createEvents(){const t=this.options.events||{};return Object.entries(t).forEach((([t,e])=>{this.on(t,e)})),t}createExtensions(){return new xe([...this.builtInExtensions,...this.options.extensions],this)}createFocusEvents(){const t=(t,e,s=!0)=>{this.focused=s,this.emit(s?"focus":"blur",{event:e,state:t.state,view:t});const i=this.state.tr.setMeta("focused",s);this.view.dispatch(i)};return new l({props:{attributes:{tabindex:0},handleDOMEvents:{focus:(e,s)=>{t(e,s,!0)},blur:(e,s)=>{t(e,s,!1)}}}})}createInputRules(){return this.extensions.inputRules({schema:this.schema,excludedExtensions:this.options.disableInputRules})}createKeymaps(){return this.extensions.keymaps({schema:this.schema})}createMarks(){return this.extensions.marks}createNodes(){return this.extensions.nodes}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createPlugins(){return this.extensions.plugins({schema:this.schema})}createSchema(){return new w({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return S.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,C({rules:this.inputRules}),...this.pasteRules,...this.keymaps,_({Backspace:I}),_(M),this.createFocusEvents()]})}createView(){return new O(this.element,{dispatchTransaction:this.dispatchTransaction.bind(this),editable:()=>this.options.editable,handlePaste:(t,e)=>{if("function"==typeof this.events.paste){const t=e.clipboardData.getData("text/html"),s=e.clipboardData.getData("text/plain");if(!0===this.events.paste(e,t,s))return!0}},handleDrop:(...t)=>{this.emit("drop",...t)},state:this.createState()})}destroy(){this.view&&this.view.destroy()}dispatchTransaction(t){const e=this.state,s=this.state.apply(t);this.view.updateState(s),this.selection={from:this.state.selection.from,to:this.state.selection.to},this.setActiveNodesAndMarks();const i={editor:this,getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:t};this.emit("transaction",i),!t.docChanged&&t.getMeta("preventUpdate")||this.emit("update",i);const{from:n,to:o}=this.state.selection,r=!e||!e.selection.eq(s.selection);this.emit(s.selection.empty?"deselect":"select",{...i,from:n,hasChanged:r,to:o})}focus(t=null){if(this.view.focused&&null===t||!1===t)return;const{from:e,to:s}=this.selectionAtPosition(t);this.setSelection(e,s),setTimeout((()=>this.view.focus()),10)}getHTML(){const t=document.createElement("div"),e=A.fromSchema(this.schema).serializeFragment(this.state.doc.content);return t.appendChild(e),this.options.inline&&t.querySelector("p")?t.querySelector("p").innerHTML:t.innerHTML}getJSON(){return this.state.doc.toJSON()}getMarkAttrs(t=null){return this.activeMarkAttrs[t]}getSchemaJSON(){return JSON.parse(JSON.stringify({nodes:this.nodes,marks:this.marks}))}init(t={}){this.options={...this.defaults,...t},this.element=this.options.element,this.focused=!1,this.selection={from:0,to:0},this.events=this.createEvents(),this.extensions=this.createExtensions(),this.nodes=this.createNodes(),this.marks=this.createMarks(),this.schema=this.createSchema(),this.keymaps=this.createKeymaps(),this.inputRules=this.createInputRules(),this.pasteRules=this.createPasteRules(),this.plugins=this.createPlugins(),this.view=this.createView(),this.commands=this.createCommands(),this.setActiveNodesAndMarks(),!1!==this.options.autofocus&&this.focus(this.options.autofocus),this.emit("init",{view:this.view,state:this.state}),this.extensions.view=this.view,this.setContent(this.options.content,!0)}isEditable(){return this.options.editable}isEmpty(){if(this.state)return 0===this.state.doc.textContent.length}get isActive(){return Object.entries({...this.activeMarks,...this.activeNodes}).reduce(((t,[e,s])=>({...t,[e]:(t={})=>s(t)})),{})}removeMark(t){if(this.schema.marks[t])return _e.removeMark(this.schema.marks[t])(this.state,this.view.dispatch)}selectionAtPosition(t=null){if(this.selection&&null===t)return this.selection;if("start"===t||!0===t)return{from:0,to:0};if("end"===t){const{doc:t}=this.state;return{from:t.content.size,to:t.content.size}}return{from:t,to:t}}setActiveNodesAndMarks(){this.activeMarks=Object.values(this.schema.marks).filter((t=>_e.markIsActive(this.state,t))).map((t=>t.name)),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce(((t,[e,s])=>({...t,[e]:_e.getMarkAttrs(this.state,s)})),{}),this.activeNodes=Object.values(this.schema.nodes).filter((t=>_e.nodeIsActive(this.state,t))).map((t=>t.name)),this.activeNodeAttrs=Object.entries(this.schema.nodes).reduce(((t,[e,s])=>({...t,[e]:_e.getNodeAttrs(this.state,s)})),{})}setContent(t={},e=!1,s){const{doc:i,tr:n}=this.state,o=this.createDocument(t,s),r=n.replaceWith(0,i.content.size,o).setMeta("preventUpdate",!e);this.view.dispatch(r)}setSelection(t=0,e=0){const{doc:s,tr:i}=this.state,n=_e.minMax(t,0,s.content.size),o=_e.minMax(e,0,s.content.size),r=T.create(s,n,o),l=i.setSelection(r);this.view.dispatch(l)}get state(){return this.view?this.view.state:null}toggleMark(t){if(this.schema.marks[t])return _e.toggleMark(this.schema.marks[t])(this.state,this.view.dispatch)}updateMark(t,e){if(this.schema.marks[t])return _e.updateMark(this.schema.marks[t],e)(this.state,this.view.dispatch)}}var Ie=Mt({data:()=>({link:{href:null,title:null,target:!1}}),computed:{fields(){return{href:{label:this.$t("url"),type:"text",icon:"url"},title:{label:this.$t("title"),type:"text",icon:"title"},target:{label:this.$t("open.newWindow"),type:"toggle",text:[this.$t("no"),this.$t("yes")]}}}},methods:{open(t){this.link={title:null,target:!1,...t},this.link.target=Boolean(this.link.target),this.$refs.dialog.open()},submit(){this.$emit("submit",{...this.link,target:this.link.target?"_blank":null}),this.$refs.dialog.close()}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",{ref:"dialog",attrs:{fields:t.fields,"submit-button":t.$t("confirm"),size:"medium"},on:{close:function(e){return t.$emit("close")},submit:t.submit},model:{value:t.link,callback:function(e){t.link=e},expression:"link"}})}),[],!1,null,null,null,null).exports;var Me=Mt({data:()=>({email:{email:null,title:null}}),computed:{fields(){return{href:{label:this.$t("email"),type:"email",icon:"email"},title:{label:this.$t("title"),type:"text",icon:"title"}}}},methods:{open(t){this.email={title:null,...t},this.$refs.dialog.open()},submit(){this.$emit("submit",this.email),this.$refs.dialog.close()}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",{ref:"dialog",attrs:{fields:t.fields,"submit-button":t.$t("confirm"),size:"medium"},on:{close:function(e){return t.$emit("close")},submit:t.submit},model:{value:t.email,callback:function(e){t.email=e},expression:"email"}})}),[],!1,null,null,null,null).exports;class Le extends we{constructor(t={}){super(t)}command(){return()=>{}}remove(){this.editor.removeMark(this.name)}get schema(){return null}get type(){return"mark"}toggle(){return this.editor.toggleMark(this.name)}update(t){this.editor.updateMark(this.name,t)}}class Ee extends Le{get button(){return{icon:"code",label:window.panel.$t("toolbar.button.code")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:`)([^`]+)(?:`)$/,t)]}keys(){return{"Mod-`":()=>this.toggle()}}get name(){return"code"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/(?:`)([^`]+)(?:`)/g,t)]}get schema(){return{excludes:"_",parseDOM:[{tag:"code"}],toDOM:()=>["code",0]}}}class je extends Le{get button(){return{icon:"bold",label:window.panel.$t("toolbar.button.bold")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,t)]}keys(){return{"Mod-b":()=>this.toggle()}}get name(){return"bold"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g,t)]}get schema(){return{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM:()=>["strong",0]}}}class Be extends Le{get button(){return{icon:"italic",label:window.panel.$t("toolbar.button.italic")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,t),e.markInputRule(/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,t)]}keys(){return{"Mod-i":()=>this.toggle()}}get name(){return"italic"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/_([^_]+)_/g,t),e.markPasteRule(/\*([^*]+)\*/g,t)]}get schema(){return{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}}}class De extends Le{get button(){return{icon:"url",label:window.panel.$t("toolbar.button.link")}}commands(){return{link:()=>{this.editor.emit("link",this.editor)},insertLink:(t={})=>{if(t.href)return this.update(t)},removeLink:()=>this.remove(),toggleLink:(t={})=>{var e;(null==(e=t.href)?void 0:e.length)>0?this.editor.command("insertLink",t):this.editor.command("removeLink")}}}get defaults(){return{target:null}}get name(){return"link"}pasteRules({type:t,utils:e}){return[e.pasteRule(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b([-a-zA-Z0-9@:%_+.~#?&//=,]*)/gi,t,(t=>({href:t})))]}plugins(){return[{props:{handleClick:(t,e,s)=>{const i=this.editor.getMarkAttrs("link");i.href&&!0===s.altKey&&s.target instanceof HTMLAnchorElement&&(s.stopPropagation(),window.open(i.href,i.target))}}}]}get schema(){return{attrs:{href:{default:null},target:{default:null},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]:not([href^='mailto:'])",getAttrs:t=>({href:t.getAttribute("href"),target:t.getAttribute("target"),title:t.getAttribute("title")})}],toDOM:t=>["a",{...t.attrs,rel:"noopener noreferrer"},0]}}}class Pe extends Le{get button(){return{icon:"email",label:"Email"}}commands(){return{email:()=>{this.editor.emit("email")},insertEmail:(t={})=>{if(t.href)return this.update(t)},removeEmail:()=>this.remove(),toggleEmail:(t={})=>{var e;(null==(e=t.href)?void 0:e.length)>0?this.editor.command("insertEmail",t):this.editor.command("removeEmail")}}}get defaults(){return{target:null}}get name(){return"email"}pasteRules({type:t,utils:e}){return[e.pasteRule(/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/gi,t,(t=>({href:t})))]}plugins(){return[{props:{handleClick:(t,e,s)=>{const i=this.editor.getMarkAttrs("email");i.href&&!0===s.altKey&&s.target instanceof HTMLAnchorElement&&(s.stopPropagation(),window.open(i.href))}}}]}get schema(){return{attrs:{href:{default:null},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href^='mailto:']",getAttrs:t=>({href:t.getAttribute("href").replace("mailto:",""),title:t.getAttribute("title")})}],toDOM:t=>["a",{...t.attrs,href:"mailto:"+t.attrs.href},0]}}}class Ne extends Le{get button(){return{icon:"strikethrough",label:window.panel.$t("toolbar.button.strike")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/~([^~]+)~$/,t)]}keys(){return{"Mod-d":()=>this.toggle()}}get name(){return"strike"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/~([^~]+)~/g,t)]}get schema(){return{parseDOM:[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",getAttrs:t=>"line-through"===t}],toDOM:()=>["s",0]}}}class qe extends Le{get button(){return{icon:"underline",label:window.panel.$t("toolbar.button.underline")}}commands(){return()=>this.toggle()}keys(){return{"Mod-u":()=>this.toggle()}}get name(){return"underline"}get schema(){return{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:t=>"underline"===t}],toDOM:()=>["u",0]}}}class Fe extends Se{get button(){return{id:this.name,icon:"list-bullet",label:window.panel.$t("toolbar.button.ul"),name:this.name,when:["listItem","bulletList","orderedList"]}}commands({type:t,schema:e,utils:s}){return()=>s.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^\s*([-+*])\s$/,t)]}keys({type:t,schema:e,utils:s}){return{"Shift-Ctrl-8":s.toggleList(t,e.nodes.listItem)}}get name(){return"bulletList"}get schema(){return{content:"listItem+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]}}}class Re extends Se{commands({utils:t,type:e}){return()=>this.createHardBreak(t,e)}createHardBreak(t,e){return t.chainCommands(t.exitCode,((t,s)=>(s(t.tr.replaceSelectionWith(e.create()).scrollIntoView()),!0)))}get defaults(){return{enter:!1,text:!1}}keys({utils:t,type:e}){const s=this.createHardBreak(t,e);let i={"Mod-Enter":s,"Shift-Enter":s};return this.options.enter&&(i.Enter=s),i}get name(){return"hardBreak"}get schema(){return{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]}}}class ze extends Se{get button(){return this.options.levels.map((t=>({id:`h${t}`,command:`h${t}`,icon:`h${t}`,label:window.panel.$t("toolbar.button.heading."+t),attrs:{level:t},name:this.name,when:["heading","paragraph"]})))}commands({type:t,schema:e,utils:s}){let i={toggleHeading:i=>s.toggleBlockType(t,e.nodes.paragraph,i)};return this.options.levels.forEach((n=>{i[`h${n}`]=()=>s.toggleBlockType(t,e.nodes.paragraph,{level:n})})),i}get defaults(){return{levels:[1,2,3,4,5,6]}}inputRules({type:t,utils:e}){return this.options.levels.map((s=>e.textblockTypeInputRule(new RegExp(`^(#{1,${s}})\\s$`),t,(()=>({level:s})))))}keys({type:t,utils:e}){return this.options.levels.reduce(((s,i)=>({...s,[`Shift-Ctrl-${i}`]:e.setBlockType(t,{level:i})})),{})}get name(){return"heading"}get schema(){return{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,draggable:!1,parseDOM:this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}}))),toDOM:t=>[`h${t.attrs.level}`,0]}}}class Ye extends Se{commands({type:t}){return()=>(e,s)=>s(e.tr.replaceSelectionWith(t.create()))}inputRules({type:t,utils:e}){return[e.nodeInputRule(/^(?:---|___\s|\*\*\*\s)$/,t)]}get name(){return"horizontalRule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}}class He extends Se{keys({type:t,utils:e}){return{Enter:e.splitListItem(t),"Shift-Tab":e.liftListItem(t),Tab:e.sinkListItem(t)}}get name(){return"listItem"}get schema(){return{content:"paragraph block*",defining:!0,draggable:!1,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}}}class Ue extends Se{get button(){return{id:this.name,icon:"list-numbers",label:window.panel.$t("toolbar.button.ol"),name:this.name,when:["listItem","bulletList","orderedList"]}}commands({type:t,schema:e,utils:s}){return()=>s.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^(\d+)\.\s$/,t,(t=>({order:+t[1]})),((t,e)=>e.childCount+e.attrs.order===+t[1]))]}keys({type:t,schema:e,utils:s}){return{"Shift-Ctrl-9":s.toggleList(t,e.nodes.listItem)}}get name(){return"orderedList"}get schema(){return{attrs:{order:{default:1}},content:"listItem+",group:"block",parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1===t.attrs.order?["ol",0]:["ol",{start:t.attrs.order},0]}}}class Ke extends we{commands(){return{undo:()=>L,redo:()=>E,undoDepth:()=>j,redoDepth:()=>B}}get defaults(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":L,"Mod-y":E,"Shift-Mod-z":E,"Mod-я":L,"Shift-Mod-я":E}}get name(){return"history"}plugins(){return[D({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}}class Je extends we{commands(){return{insertHtml:t=>(e,s)=>{let i=document.createElement("div");i.innerHTML=t.trim();const n=x.fromSchema(e.schema).parse(i);s(e.tr.replaceSelectionWith(n).scrollIntoView())}}}}class Ge extends we{constructor(t={}){super(t)}close(){this.visible=!1,this.emit()}emit(){this.editor.emit("toolbar",{marks:this.marks,nodes:this.nodes,nodeAttrs:this.nodeAttrs,position:this.position,visible:this.visible})}init(){this.position={left:0,bottom:0},this.visible=!1,this.editor.on("blur",(()=>{this.close()})),this.editor.on("deselect",(()=>{this.close()})),this.editor.on("select",(({hasChanged:t})=>{!1!==t?this.open():this.emit()}))}get marks(){return this.editor.activeMarks}get nodes(){return this.editor.activeNodes}get nodeAttrs(){return this.editor.activeNodeAttrs}open(){this.visible=!0,this.reposition(),this.emit()}reposition(){const{from:t,to:e}=this.editor.selection,s=this.editor.view.coordsAtPos(t),i=this.editor.view.coordsAtPos(e,!0),n=this.editor.element.getBoundingClientRect();let o=(s.left+i.left)/2-n.left,r=Math.round(n.bottom-s.top);return this.position={bottom:r,left:o}}get type(){return"toolbar"}}var Ve=Mt({props:{activeMarks:{type:Array,default:()=>[]},activeNodes:{type:Array,default:()=>[]},activeNodeAttrs:{type:[Array,Object],default:()=>[]},editor:{type:Object,required:!0},marks:{type:Array},isParagraphNodeHidden:{type:Boolean,default:!1}},computed:{activeButton(){return Object.values(this.nodeButtons).find((t=>this.isButtonActive(t)))||!1},hasVisibleButtons(){const t=Object.keys(this.nodeButtons);return t.length>1||1===t.length&&!1===t.includes("paragraph")},markButtons(){return this.buttons("mark")},nodeButtons(){let t=this.buttons("node");return!0===this.isParagraphNodeHidden&&t.paragraph&&delete t.paragraph,t}},methods:{buttons(t){const e=this.editor.buttons(t);let s=this.sorting;!1!==s&&!1!==Array.isArray(s)||(s=Object.keys(e));let i={};return s.forEach((t=>{e[t]&&(i[t]=e[t])})),i},command(t,...e){this.$emit("command",t,...e)},isButtonActive(t){if("paragraph"===t.name)return 1===this.activeNodes.length&&this.activeNodes.includes(t.name);let e=!0;if(t.attrs){const s=Object.values(this.activeNodeAttrs).find((e=>JSON.stringify(e)===JSON.stringify(t.attrs)));e=Boolean(s||!1)}return!0===e&&this.activeNodes.includes(t.name)},isButtonCurrent(t){return!!this.activeButton&&this.activeButton.id===t.id},isButtonDisabled(t){var e;if(null==(e=this.activeButton)?void 0:e.when){return!1===this.activeButton.when.includes(t.name)}return!1},needDividerAfterNode(t){let e=["paragraph"],s=Object.keys(this.nodeButtons);return(s.includes("bulletList")||s.includes("orderedList"))&&e.push("h6"),e.includes(t.id)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-writer-toolbar"},[t.hasVisibleButtons?e("k-dropdown",{nativeOn:{mousedown:function(t){t.preventDefault()}}},[e("k-button",{class:{"k-writer-toolbar-button k-writer-toolbar-nodes":!0,"k-writer-toolbar-button-active":!!t.activeButton},attrs:{icon:t.activeButton.icon||"title"},on:{click:function(e){return t.$refs.nodes.toggle()}}}),e("k-dropdown-content",{ref:"nodes"},[t._l(t.nodeButtons,(function(s,i){return[e("k-dropdown-item",{key:i,attrs:{current:t.isButtonCurrent(s),disabled:t.isButtonDisabled(s),icon:s.icon},on:{click:function(e){return t.command(s.command||i)}}},[t._v(" "+t._s(s.label)+" ")]),t.needDividerAfterNode(s)?e("hr",{key:i+"-divider"}):t._e()]}))],2)],1):t._e(),t._l(t.markButtons,(function(s,i){return e("k-button",{key:i,class:{"k-writer-toolbar-button":!0,"k-writer-toolbar-button-active":t.activeMarks.includes(i)},attrs:{icon:s.icon,tooltip:s.label},on:{mousedown:function(e){return e.preventDefault(),t.command(s.command||i)}}})}))],2)}),[],!1,null,null,null,null).exports;const We={props:{autofocus:Boolean,breaks:Boolean,code:Boolean,disabled:Boolean,emptyDocument:{type:Object,default:()=>({type:"doc",content:[]})},headings:[Array,Boolean],inline:{type:Boolean,default:!1},marks:{type:[Array,Boolean],default:!0},nodes:{type:[Array,Boolean],default:()=>["heading","bulletList","orderedList"]},paste:{type:Function,default:()=>()=>!1},placeholder:String,spellcheck:Boolean,extensions:Array,value:{type:String,default:""}}};var Xe=Mt({components:{"k-writer-email-dialog":Me,"k-writer-link-dialog":Ie,"k-writer-toolbar":Ve},mixins:[We],data(){return{editor:null,json:{},html:this.value,isEmpty:!0,toolbar:!1}},computed:{isParagraphNodeHidden(){return!0===Array.isArray(this.nodes)&&3!==this.nodes.length&&!1===this.nodes.includes("paragraph")}},watch:{value(t,e){t!==e&&t!==this.html&&(this.html=t,this.editor.setContent(this.html))}},mounted(){this.editor=new Te({autofocus:this.autofocus,content:this.value,editable:!this.disabled,element:this.$el,emptyDocument:this.emptyDocument,events:{link:t=>{this.$refs.linkDialog.open(t.getMarkAttrs("link"))},email:()=>{this.$refs.emailDialog.open(this.editor.getMarkAttrs("email"))},paste:this.paste,toolbar:t=>{this.toolbar=t,this.toolbar.visible&&this.$nextTick((()=>{this.onToolbarOpen()}))},update:t=>{if(!this.editor)return;const e=JSON.stringify(this.editor.getJSON());e!==JSON.stringify(this.json)&&(this.json=e,this.isEmpty=t.editor.isEmpty(),this.html=t.editor.getHTML(),this.isEmpty&&(0===t.editor.activeNodes.length||t.editor.activeNodes.includes("paragraph"))&&(this.html=""),this.$emit("input",this.html))}},extensions:[...this.createMarks(),...this.createNodes(),new Ke,new Je,new Ge,...this.extensions||[]],inline:this.inline}),this.isEmpty=this.editor.isEmpty(),this.json=this.editor.getJSON()},beforeDestroy(){this.editor.destroy()},methods:{filterExtensions(t,e,s){!1===e?e=[]:!0!==e&&!1!==Array.isArray(e)||(e=Object.keys(t));let i=[];return e.forEach((e=>{t[e]&&i.push(t[e])})),"function"==typeof s&&(i=s(e,i)),i},command(t,...e){this.editor.command(t,...e)},createMarks(){return this.filterExtensions({bold:new je,italic:new Be,strike:new Ne,underline:new qe,code:new Ee,link:new De,email:new Pe},this.marks)},createNodes(){const t=new Re({text:!0,enter:this.inline});return!0===this.inline?[t]:this.filterExtensions({bulletList:new Fe,orderedList:new Ue,heading:new ze,horizontalRule:new Ye,listItem:new He},this.nodes,((e,s)=>((e.includes("bulletList")||e.includes("orderedList"))&&s.push(new He),s.push(t),s)))},getHTML(){return this.editor.getHTML()},focus(){this.editor.focus()},onToolbarOpen(){if(this.$refs.toolbar){const t=this.$el.clientWidth,e=this.$refs.toolbar.$el.clientWidth;let s=this.toolbar.position.left;s-e/2<0&&(s=s+(e/2-s)-20),s+e/2>t&&(s=s-(s+e/2-t)+20),s!==this.toolbar.position.left&&(this.$refs.toolbar.$el.style.left=s+"px")}}}},(function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"direction",rawName:"v-direction"}],ref:"editor",staticClass:"k-writer",attrs:{"data-empty":t.isEmpty,"data-placeholder":t.placeholder,spellcheck:t.spellcheck}},[t.editor?[t.toolbar.visible?e("k-writer-toolbar",{ref:"toolbar",style:{bottom:t.toolbar.position.bottom+"px","inset-inline-start":t.toolbar.position.left+"px"},attrs:{editor:t.editor,"active-marks":t.toolbar.marks,"active-nodes":t.toolbar.nodes,"active-node-attrs":t.toolbar.nodeAttrs,"is-paragraph-node-hidden":t.isParagraphNodeHidden},on:{command:function(e){return t.editor.command(e)}}}):t._e(),e("k-writer-link-dialog",{ref:"linkDialog",on:{close:function(e){return t.editor.focus()},submit:function(e){return t.editor.command("toggleLink",e)}}}),e("k-writer-email-dialog",{ref:"emailDialog",on:{close:function(e){return t.editor.focus()},submit:function(e){return t.editor.command("toggleEmail",e)}}})]:t._e()],2)}),[],!1,null,null,null,null).exports;var Ze=Mt({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-login-alert",on:{click:function(e){return t.$emit("click")}}},[e("span",[t._t("default")],2),e("k-icon",{attrs:{type:"alert"}})],1)}),[],!1,null,null,null,null).exports;var Qe=Mt({props:{fields:Object,index:[Number,String],total:Number,value:Object},mounted(){this.$store.dispatch("content/disable"),this.$events.$on("keydown.cmd.s",this.onSubmit),this.$events.$on("keydown.esc",this.onDiscard)},destroyed(){this.$events.$off("keydown.cmd.s",this.onSubmit),this.$events.$off("keydown.esc",this.onDiscard),this.$store.dispatch("content/enable")},methods:{focus(t){this.$refs.form.focus(t)},onDiscard(){this.$emit("discard")},onInput(t){this.$emit("input",t)},onSubmit(){this.$emit("submit")}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-structure-form"},[e("div",{staticClass:"k-structure-backdrop",on:{click:t.onDiscard}}),e("section",[e("k-form",{ref:"form",staticClass:"k-structure-form-fields",attrs:{value:t.value,fields:t.fields},on:{input:t.onInput,submit:t.onSubmit}}),e("footer",{staticClass:"k-structure-form-buttons"},[e("k-button",{staticClass:"k-structure-form-cancel-button",attrs:{text:t.$t("cancel"),icon:"cancel"},on:{click:function(e){return t.$emit("close")}}}),"new"!==t.index?e("k-pagination",{attrs:{dropdown:!1,total:t.total,limit:1,page:t.index+1,details:!0},on:{paginate:function(e){return t.$emit("paginate",e)}}}):t._e(),e("k-button",{staticClass:"k-structure-form-submit-button",attrs:{text:t.$t("new"!==t.index?"confirm":"add"),icon:"check"},on:{click:t.onSubmit}})],1)],1)])}),[],!1,null,null,null,null).exports;const ts=function(t){this.command("insert",((e,s)=>{let i=[];return s.split("\n").forEach(((e,s)=>{let n="ol"===t?s+1+".":"-";i.push(n+" "+e)})),i.join("\n")}))};var es=Mt({layout:["headlines","bold","italic","|","link","email","file","|","code","ul","ol"],props:{buttons:{type:[Boolean,Array],default:!0},uploads:[Boolean,Object,Array]},data(){let t={},e={},s=[],i=this.commands();return!1===this.buttons?t:(Array.isArray(this.buttons)&&(s=this.buttons),!0!==Array.isArray(this.buttons)&&(s=this.$options.layout),s.forEach(((s,n)=>{if("|"===s)t["divider-"+n]={divider:!0};else if(i[s]){let n=i[s];t[s]=n,n.shortcut&&(e[n.shortcut]=s)}})),{layout:t,shortcuts:e})},methods:{command(t,e){"function"==typeof t?t.apply(this):this.$emit("command",t,e)},close(){Object.keys(this.$refs).forEach((t=>{const e=this.$refs[t][0];"function"==typeof(null==e?void 0:e.close)&&e.close()}))},fileCommandSetup(){let t={label:this.$t("toolbar.button.file"),icon:"attachment"};return!1===this.uploads?t.command="selectFile":t.dropdown={select:{label:this.$t("toolbar.button.file.select"),icon:"check",command:"selectFile"},upload:{label:this.$t("toolbar.button.file.upload"),icon:"upload",command:"uploadFile"}},t},commands(){return{headlines:{label:this.$t("toolbar.button.headings"),icon:"title",dropdown:{h1:{label:this.$t("toolbar.button.heading.1"),icon:"title",command:"prepend",args:"#"},h2:{label:this.$t("toolbar.button.heading.2"),icon:"title",command:"prepend",args:"##"},h3:{label:this.$t("toolbar.button.heading.3"),icon:"title",command:"prepend",args:"###"}}},bold:{label:this.$t("toolbar.button.bold"),icon:"bold",command:"wrap",args:"**",shortcut:"b"},italic:{label:this.$t("toolbar.button.italic"),icon:"italic",command:"wrap",args:"*",shortcut:"i"},link:{label:this.$t("toolbar.button.link"),icon:"url",shortcut:"k",command:"dialog",args:"link"},email:{label:this.$t("toolbar.button.email"),icon:"email",shortcut:"e",command:"dialog",args:"email"},file:this.fileCommandSetup(),code:{label:this.$t("toolbar.button.code"),icon:"code",command:"wrap",args:"`"},ul:{label:this.$t("toolbar.button.ul"),icon:"list-bullet",command(){return ts.apply(this,["ul"])}},ol:{label:this.$t("toolbar.button.ol"),icon:"list-numbers",command(){return ts.apply(this,["ol"])}}}},shortcut(t,e){if(this.shortcuts[t]){const s=this.layout[this.shortcuts[t]];if(!s)return!1;e.preventDefault(),this.command(s.command,s.args)}}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-toolbar"},[e("div",{staticClass:"k-toolbar-wrapper"},[e("div",{staticClass:"k-toolbar-buttons"},[t._l(t.layout,(function(s,i){return[s.divider?[e("span",{key:i,staticClass:"k-toolbar-divider"})]:s.dropdown?[e("k-dropdown",{key:i},[e("k-button",{key:i,staticClass:"k-toolbar-button",attrs:{icon:s.icon,tooltip:s.label,tabindex:"-1"},on:{click:function(e){t.$refs[i+"-dropdown"][0].toggle()}}}),e("k-dropdown-content",{ref:i+"-dropdown",refInFor:!0},t._l(s.dropdown,(function(s,i){return e("k-dropdown-item",{key:i,attrs:{icon:s.icon},on:{click:function(e){return t.command(s.command,s.args)}}},[t._v(" "+t._s(s.label)+" ")])})),1)],1)]:[e("k-button",{key:i,staticClass:"k-toolbar-button",attrs:{icon:s.icon,tooltip:s.label,tabindex:"-1"},on:{click:function(e){return t.command(s.command,s.args)}}})]]}))],2)])])}),[],!1,null,null,null,null).exports;var ss=Mt({data(){return{value:{email:null,text:null},fields:{email:{label:this.$t("email"),type:"email"},text:{label:this.$t("link.text"),type:"text"}}}},computed:{kirbytext(){return this.$config.kirbytext}},methods:{open(t,e){this.value.text=e,this.$refs.dialog.open()},cancel(){this.$emit("cancel")},createKirbytext(){var t;const e=this.value.email||"";return(null==(t=this.value.text)?void 0:t.length)>0?`(email: ${e} text: ${this.value.text})`:`(email: ${e})`},createMarkdown(){var t;const e=this.value.email||"";return(null==(t=this.value.text)?void 0:t.length)>0?`[${this.value.text}](mailto:${e})`:`<${e}>`},submit(){this.$emit("submit",this.kirbytext?this.createKirbytext():this.createMarkdown()),this.value={email:null,text:null},this.$refs.dialog.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",attrs:{"submit-button":t.$t("insert")},on:{close:t.cancel,submit:function(e){return t.$refs.form.submit()}}},[e("k-form",{ref:"form",attrs:{fields:t.fields},on:{submit:t.submit},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}})],1)}),[],!1,null,null,null,null).exports;var is=Mt({data(){return{value:{url:null,text:null},fields:{url:{label:this.$t("link"),type:"text",placeholder:this.$t("url.placeholder"),icon:"url"},text:{label:this.$t("link.text"),type:"text"}}}},computed:{kirbytext(){return this.$config.kirbytext}},methods:{open(t,e){this.value.text=e,this.$refs.dialog.open()},cancel(){this.$emit("cancel")},createKirbytext(){return this.value.text.length>0?`(link: ${this.value.url} text: ${this.value.text})`:`(link: ${this.value.url})`},createMarkdown(){return this.value.text.length>0?`[${this.value.text}](${this.value.url})`:`<${this.value.url}>`},submit(){this.$emit("submit",this.kirbytext?this.createKirbytext():this.createMarkdown()),this.value={url:null,text:null},this.$refs.dialog.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",attrs:{"submit-button":t.$t("insert")},on:{close:t.cancel,submit:function(e){return t.$refs.form.submit()}}},[e("k-form",{ref:"form",attrs:{fields:t.fields},on:{submit:t.submit},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}})],1)}),[],!1,null,null,null,null).exports;var ns=Mt({mixins:[Qt,ee,ie,oe,le],inheritAttrs:!1,props:{value:Boolean},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onChange(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||P.required}}}},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-checkbox-input",on:{click:function(t){t.stopPropagation()}}},[e("input",{ref:"input",staticClass:"k-checkbox-input-native input-hidden",attrs:{id:t.id,disabled:t.disabled,type:"checkbox"},domProps:{checked:t.value},on:{change:function(e){return t.onChange(e.target.checked)}}}),e("span",{staticClass:"k-checkbox-input-icon",attrs:{"aria-hidden":"true"}},[e("svg",{attrs:{width:"12",height:"10",viewBox:"0 0 12 10",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{d:"M1 5l3.3 3L11 1","stroke-width":"2",fill:"none","fill-rule":"evenodd"}})])]),e("span",{staticClass:"k-checkbox-input-label",domProps:{innerHTML:t._s(t.label)}})])}),[],!1,null,null,null,null).exports;const os={mixins:[Qt,ee,ie,le],props:{columns:Number,max:Number,min:Number,options:Array,value:{type:[Array,Object],default:()=>[]}}};var rs=Mt({mixins:[os],inheritAttrs:!1,data(){return{selected:this.valueToArray(this.value)}},watch:{value(t){this.selected=this.valueToArray(t)},selected(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$el.querySelector("input").focus()},onInput(t,e){if(!0===e)this.selected.push(t);else{const e=this.selected.indexOf(t);-1!==e&&this.selected.splice(e,1)}this.$emit("input",this.selected)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()},valueToArray:t=>!0===Array.isArray(t)?t:"string"==typeof t?String(t).split(","):"object"==typeof t?Object.values(t):void 0},validations(){return{selected:{required:!this.required||P.required,min:!this.min||P.minLength(this.min),max:!this.max||P.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-checkboxes-input",style:"--columns:"+t.columns},t._l(t.options,(function(s,i){return e("li",{key:i},[e("k-checkbox-input",{attrs:{id:t.id+"-"+i,label:s.text,value:-1!==t.selected.indexOf(s.value)},on:{input:function(e){return t.onInput(s.value,e)}}})],1)})),0)}),[],!1,null,null,null,null).exports;const ls={mixins:[Qt,ee,ie,le],props:{display:{type:String,default:"DD.MM.YYYY"},max:String,min:String,step:{type:Object,default:()=>({size:1,unit:"day"})},type:{type:String,default:"date"},value:String}};var as=Mt({mixins:[ls],inheritAttrs:!1,data:()=>({dt:null,formatted:null}),computed:{inputType:()=>"date",pattern(){return this.$library.dayjs.pattern(this.display)},rounding(){return{...this.$options.props.step.default(),...this.step}}},watch:{value:{handler(t,e){if(t!==e){const e=this.toDatetime(t);this.commit(e)}},immediate:!0}},created(){this.$events.$on("keydown.cmd.s",this.onBlur)},destroyed(){this.$events.$off("keydown.cmd.s",this.onBlur)},methods:{alter(t){let e=this.parse()||this.round(this.$library.dayjs()),s=this.rounding.unit,i=this.rounding.size;const n=this.selection();null!==n&&("meridiem"===n.unit?(t="pm"===e.format("a")?"subtract":"add",s="hour",i=12):(s=n.unit,s!==this.rounding.unit&&(i=1))),e=e[t](i,s).round(this.rounding.unit,this.rounding.size),this.commit(e),this.emit(e),this.$nextTick((()=>this.select(n)))},commit(t){this.dt=t,this.formatted=this.pattern.format(t),this.$emit("invalid",this.$v.$invalid,this.$v)},emit(t){this.$emit("input",this.toISO(t))},focus(){this.$refs.input.focus()},onArrowDown(){this.alter("subtract")},onArrowUp(){this.alter("add")},onBlur(){const t=this.parse();this.commit(t),this.emit(t)},onEnter(){this.onBlur(),this.$nextTick((()=>this.$emit("submit")))},onInput(t){const e=this.parse(),s=this.pattern.format(e);if(!t||s==t)return this.commit(e),this.emit(e)},onTab(t){""!=this.$refs.input.value&&(this.onBlur(),this.$nextTick((()=>{const e=this.selection();if(this.$refs.input&&e.start===this.$refs.input.selectionStart&&e.end===this.$refs.input.selectionEnd-1)if(t.shiftKey){if(0===e.index)return;this.selectPrev(e.index)}else{if(e.index===this.pattern.parts.length-1)return;this.selectNext(e.index)}else t.shiftKey?this.selectLast():this.selectFirst();t.preventDefault()})))},parse(){let t=this.$refs.input.value;return t=this.$library.dayjs.interpret(t,this.inputType),this.round(t)},round(t){return(null==t?void 0:t.round(this.rounding.unit,this.rounding.size))||null},select(t){var e;t||(t=this.selection()),null==(e=this.$refs.input)||e.setSelectionRange(t.start,t.end+1)},selectFirst(){this.select(this.pattern.parts[0])},selectLast(){this.select(this.pattern.parts[this.pattern.parts.length-1])},selectNext(t){this.select(this.pattern.parts[t+1])},selectPrev(t){this.select(this.pattern.parts[t-1])},selection(){return this.pattern.at(this.$refs.input.selectionStart,this.$refs.input.selectionEnd)},toDatetime(t){return this.round(this.$library.dayjs.iso(t,this.inputType))},toISO(t){return(null==t?void 0:t.toISO(this.inputType))||null}},validations(){return{value:{min:!this.dt||!this.min||(()=>this.dt.validate(this.min,"min",this.rounding.unit)),max:!this.dt||!this.max||(()=>this.dt.validate(this.max,"max",this.rounding.unit)),required:!this.required||(()=>!!this.dt)}}}},(function(){var t=this;return(0,t._self._c)("input",{directives:[{name:"model",rawName:"v-model",value:t.formatted,expression:"formatted"},{name:"direction",rawName:"v-direction"}],ref:"input",class:`k-text-input k-${t.type}-input`,attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled,placeholder:t.display,required:t.required,autocomplete:"off",spellcheck:"false",type:"text"},domProps:{value:t.formatted},on:{blur:t.onBlur,focus:function(e){return t.$emit("focus")},input:[function(e){e.target.composing||(t.formatted=e.target.value)},function(e){return t.onInput(e.target.value)}],keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.stopPropagation(),e.preventDefault(),t.onArrowDown.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.stopPropagation(),e.preventDefault(),t.onArrowUp.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:t.onTab.apply(null,arguments)}]}})}),[],!1,null,null,null,null).exports;const us={mixins:[Qt,ee,ie,re,le],props:{autocomplete:{type:[Boolean,String],default:"off"},maxlength:Number,minlength:Number,pattern:String,placeholder:String,preselect:Boolean,spellcheck:{type:[Boolean,String],default:"off"},type:{type:String,default:"text"},value:String}};var cs=Mt({mixins:[us],inheritAttrs:!1,data(){return{listeners:{...this.$listeners,input:t=>this.onInput(t.target.value)}}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.$refs.input.select()}},validations(){return{value:{required:!this.required||P.required,minLength:!this.minlength||P.minLength(this.minlength),maxLength:!this.maxlength||P.maxLength(this.maxlength),email:"email"!==this.type||P.email,url:"url"!==this.type||P.url,pattern:!this.pattern||(t=>!this.required&&!t||!this.$refs.input.validity.patternMismatch)}}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-text-input"},"input",{autocomplete:t.autocomplete,autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,type:t.type,value:t.value},!1),t.listeners))}),[],!1,null,null,null,null).exports;const ds={mixins:[us],props:{autocomplete:{type:String,default:"email"},placeholder:{type:String,default:()=>window.panel.$t("email.placeholder")},type:{type:String,default:"email"}}};var ps=Mt({extends:cs,mixins:[ds]},null,null,!1,null,null,null,null).exports;class hs extends Ce{get schema(){return{content:"bulletList|orderedList"}}}var ms=Mt({inheritAttrs:!1,props:{autofocus:Boolean,marks:{type:[Array,Boolean],default:!0},value:String},data(){return{list:this.value,html:this.value}},computed:{extensions:()=>[new hs({inline:!0})]},watch:{value(t){t!==this.html&&(this.list=t,this.html=t)}},methods:{focus(){this.$refs.input.focus()},onInput(t){let e=(new DOMParser).parseFromString(t,"text/html").querySelector("ul, ol");e&&0!==e.textContent.trim().length?(this.list=t,this.html=t.replace(/(|<\/p>)/gi,""),this.$emit("input",this.html)):this.$emit("input",this.list="")}}},(function(){var t=this;return(0,t._self._c)("k-writer",t._b({ref:"input",staticClass:"k-list-input",attrs:{extensions:t.extensions,nodes:["bulletList","orderedList"],value:t.list},on:{input:t.onInput}},"k-writer",t.$props,!1))}),[],!1,null,null,null,null).exports;const fs={mixins:[ee,ie,le],props:{max:Number,min:Number,layout:String,options:{type:Array,default:()=>[]},search:[Object,Boolean],separator:{type:String,default:","},sort:Boolean,value:{type:Array,required:!0,default:()=>[]}}};var gs=Mt({mixins:[fs],inheritAttrs:!1,data(){return{state:this.value,q:null,limit:!0,scrollTop:0}},computed:{draggable(){return this.state.length>1&&!this.sort},dragOptions(){return{disabled:!this.draggable,draggable:".k-tag",delay:1}},emptyLabel(){return this.q?this.$t("search.results.none"):this.$t("options.none")},filtered(){var t;return(null==(t=this.q)?void 0:t.length)>=(this.search.min||0)?this.options.filter((t=>this.isFiltered(t))).map((t=>({...t,display:this.toHighlightedString(t.text),info:this.toHighlightedString(t.value)}))):this.options.map((t=>({...t,display:t.text,info:t.value})))},more(){return!this.max||this.state.lengththis.options.findIndex((e=>e.value===t.value));return t.sort(((t,s)=>e(t)-e(s)))},visible(){return this.limit?this.filtered.slice(0,this.search.display||this.filtered.length):this.filtered}},watch:{value(t){this.state=t,this.onInvalid()}},mounted(){this.onInvalid(),this.$events.$on("click",this.close),this.$events.$on("keydown.cmd.s",this.close)},destroyed(){this.$events.$off("click",this.close),this.$events.$off("keydown.cmd.s",this.close)},methods:{add(t){!0===this.more&&(this.state.push(t),this.onInput())},blur(){this.close()},close(){!0===this.$refs.dropdown.isOpen&&(this.$refs.dropdown.close(),this.limit=!0)},escape(){this.q?this.q=null:this.close()},focus(){this.$refs.dropdown.open()},index(t){return this.state.findIndex((e=>e.value===t.value))},isFiltered(t){return String(t.text).match(this.regex)||String(t.value).match(this.regex)},isSelected(t){return-1!==this.index(t)},navigate(t){var e,s,i;"prev"===t&&(t="previous"),null==(i=null==(s=null==(e=document.activeElement)?void 0:e[t+"Sibling"])?void 0:s.focus)||i.call(s)},onClose(){!1===this.$refs.dropdown.isOpen&&(document.activeElement===this.$parent.$el&&(this.q=null),this.$parent.$el.focus())},onInput(){this.$emit("input",this.sorted)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onOpen(){this.$nextTick((()=>{var t,e;null==(e=null==(t=this.$refs.search)?void 0:t.focus)||e.call(t),this.$refs.dropdown.$el.querySelector(".k-multiselect-options").scrollTop=this.scrollTop}))},remove(t){this.state.splice(this.index(t),1),this.onInput()},select(t){this.scrollTop=this.$refs.dropdown.$el.querySelector(".k-multiselect-options").scrollTop,t={text:t.text,value:t.value},this.isSelected(t)?this.remove(t):this.add(t)},toHighlightedString(t){return(t=this.$helper.string.stripHTML(t)).replace(this.regex,"$1")}},validations(){return{state:{required:!this.required||P.required,minLength:!this.min||P.minLength(this.min),maxLength:!this.max||P.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("k-draggable",{staticClass:"k-multiselect-input",attrs:{list:t.state,options:t.dragOptions,"data-layout":t.layout,element:"k-dropdown"},on:{end:t.onInput},nativeOn:{click:function(e){return t.$refs.dropdown.toggle.apply(null,arguments)}},scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-dropdown-content",{ref:"dropdown",on:{open:t.onOpen,close:t.onClose},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:(e.stopPropagation(),t.close.apply(null,arguments))}}},[t.search?e("k-dropdown-item",{staticClass:"k-multiselect-search",attrs:{icon:"search"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.q,expression:"q"}],ref:"search",attrs:{placeholder:t.search.min?t.$t("search.min",{min:t.search.min}):t.$t("search")+" …"},domProps:{value:t.q},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:(e.stopPropagation(),t.escape.apply(null,arguments))},input:function(e){e.target.composing||(t.q=e.target.value)}}})]):t._e(),e("div",{staticClass:"k-multiselect-options scroll-y-auto"},[t._l(t.visible,(function(s){return e("k-dropdown-item",{key:s.value,class:{"k-multiselect-option":!0,selected:t.isSelected(s),disabled:!t.more},attrs:{icon:t.isSelected(s)?"check":"circle-outline"},on:{click:function(e){return e.preventDefault(),t.select(s)}},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),e.stopPropagation(),t.select(s))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:(e.preventDefault(),e.stopPropagation(),t.select(s))}]}},[e("span",{domProps:{innerHTML:t._s(s.display)}}),e("span",{staticClass:"k-multiselect-value",domProps:{innerHTML:t._s(s.info)}})])})),0===t.filtered.length?e("k-dropdown-item",{staticClass:"k-multiselect-option",attrs:{disabled:!0}},[t._v(" "+t._s(t.emptyLabel)+" ")]):t._e()],2),t.visible.lengththis.onInput(t.target.value),blur:this.onBlur}}},watch:{value(t){this.number=t},number:{immediate:!0,handler(){this.onInvalid()}}},mounted(){this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{decimals(){const t=Number(this.step||0);return Math.floor(t)===t?0:-1!==t.toString().indexOf("e")?parseInt(t.toFixed(16).split(".")[1].split("").reverse().join("")).toString().length:t.toString().split(".")[1].length||0},format(t){if(isNaN(t)||""===t)return"";const e=this.decimals();return t=e?parseFloat(t).toFixed(e):Number.isInteger(this.step)?parseInt(t):parseFloat(t)},clean(){this.number=this.format(this.number)},emit(t){t=parseFloat(t),isNaN(t)&&(t=""),t!==this.value&&this.$emit("input",t)},focus(){this.$refs.input.focus()},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.number=t,this.emit(t)},onBlur(){this.clean(),this.emit(this.number)},select(){this.$refs.input.select()}},validations(){return{value:{required:!this.required||P.required,min:!this.min||P.minValue(this.min),max:!this.max||P.maxValue(this.max)}}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({ref:"input",staticClass:"k-number-input",attrs:{step:t.stepNumber,type:"number"},domProps:{value:t.number},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.ctrlKey?t.clean.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?t.clean.apply(null,arguments):null}]}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,max:t.max,min:t.min,name:t.name,placeholder:t.placeholder,required:t.required},!1),t.listeners))}),[],!1,null,null,null,null).exports;const vs={mixins:[us],props:{autocomplete:{type:String,default:"new-password"},type:{type:String,default:"password"}}};var ys=Mt({extends:cs,mixins:[vs]},null,null,!1,null,null,null,null).exports;const $s={mixins:[Qt,ee,ie,le],props:{columns:Number,options:Array,value:[String,Number,Boolean]}};var _s=Mt({mixins:[$s],inheritAttrs:!1,watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$el.querySelector("input").focus()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||P.required}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-radio-input",style:"--columns:"+t.columns},t._l(t.options,(function(s,i){return e("li",{key:i},[e("input",{staticClass:"k-radio-input-native",attrs:{id:t.id+"-"+i,name:t.id,type:"radio"},domProps:{value:s.value,checked:t.value===s.value},on:{change:function(e){return t.onInput(s.value)}}}),s.info?e("label",{attrs:{for:t.id+"-"+i}},[e("span",{staticClass:"k-radio-input-text",domProps:{innerHTML:t._s(s.text)}}),e("span",{staticClass:"k-radio-input-info",domProps:{innerHTML:t._s(s.info)}})]):e("label",{attrs:{for:t.id+"-"+i},domProps:{innerHTML:t._s(s.text)}}),s.icon?e("k-icon",{attrs:{type:s.icon}}):t._e()],1)})),0)}),[],!1,null,null,null,null).exports;const xs={mixins:[Qt,ee,ie,re,le],props:{default:[Number,String],max:{type:Number,default:100},min:{type:Number,default:0},step:{type:Number,default:1},tooltip:{type:[Boolean,Object],default:()=>({before:null,after:null})},value:[Number,String]}};var ws=Mt({mixins:[xs],inheritAttrs:!1,data(){return{listeners:{...this.$listeners,input:t=>this.onInput(t.target.value)}}},computed:{baseline(){return this.min<0?0:this.min},label(){return this.required||this.value||0===this.value?this.format(this.position):"–"},position(){return this.value||0===this.value?this.value:this.default||this.baseline}},watch:{position(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},format(t){const e=document.lang?document.lang.replace("_","-"):"en",s=this.step.toString().split("."),i=s.length>1?s[1].length:0;return new Intl.NumberFormat(e,{minimumFractionDigits:i}).format(t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.$emit("input",t)}},validations(){return{position:{required:!this.required||P.required,min:!this.min||P.minValue(this.min),max:!this.max||P.maxValue(this.max)}}}},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-range-input"},[e("input",t._g(t._b({ref:"input",staticClass:"k-range-input-native",style:`--min: ${t.min}; --max: ${t.max}; --value: ${t.position}`,attrs:{type:"range"},domProps:{value:t.position}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,max:t.max,min:t.min,name:t.name,required:t.required,step:t.step},!1),t.listeners)),t.tooltip?e("span",{staticClass:"k-range-input-tooltip"},[t.tooltip.before?e("span",{staticClass:"k-range-input-tooltip-before"},[t._v(t._s(t.tooltip.before))]):t._e(),e("span",{staticClass:"k-range-input-tooltip-text"},[t._v(t._s(t.label))]),t.tooltip.after?e("span",{staticClass:"k-range-input-tooltip-after"},[t._v(t._s(t.tooltip.after))]):t._e()]):t._e()])}),[],!1,null,null,null,null).exports;const Ss={mixins:[Qt,ee,ie,re,le],props:{ariaLabel:String,default:String,empty:{type:[Boolean,String],default:!0},placeholder:String,options:{type:Array,default:()=>[]},value:{type:[String,Number,Boolean],default:""}}};var Cs=Mt({mixins:[Ss],inheritAttrs:!1,data(){return{selected:this.value,listeners:{...this.$listeners,click:t=>this.onClick(t),change:t=>this.onInput(t.target.value),input:()=>{}}}},computed:{emptyOption(){return this.placeholder||"—"},hasEmptyOption(){return!1!==this.empty&&!(this.required&&this.default)},label(){const t=this.text(this.selected);return""===this.selected||null===this.selected||null===t?this.emptyOption:t}},watch:{value(t){this.selected=t,this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onClick(t){t.stopPropagation(),this.$emit("click",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.selected=t,this.$emit("input",this.selected)},select(){this.focus()},text(t){let e=null;return this.options.forEach((s=>{s.value==t&&(e=s.text)})),e}},validations(){return{selected:{required:!this.required||P.required}}}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-select-input",attrs:{"data-disabled":t.disabled,"data-empty":""===t.selected}},[e("select",t._g({ref:"input",staticClass:"k-select-input-native",attrs:{id:t.id,autofocus:t.autofocus,"aria-label":t.ariaLabel,disabled:t.disabled,name:t.name,required:t.required},domProps:{value:t.selected}},t.listeners),[t.hasEmptyOption?e("option",{attrs:{disabled:t.required,value:""}},[t._v(" "+t._s(t.emptyOption)+" ")]):t._e(),t._l(t.options,(function(s){return e("option",{key:s.value,attrs:{disabled:s.disabled},domProps:{value:s.value}},[t._v(" "+t._s(s.text)+" ")])}))],2),t._v(" "+t._s(t.label)+" ")])}),[],!1,null,null,null,null).exports;const Os={mixins:[us],props:{allow:{type:String,default:""},formData:{type:Object,default:()=>({})},sync:{type:String}}};var As=Mt({extends:cs,mixins:[Os],data(){return{slug:this.sluggify(this.value),slugs:this.$language?this.$language.rules:this.$system.slugs,syncValue:null}},watch:{formData:{handler(t){return!this.disabled&&(!(!this.sync||void 0===t[this.sync])&&(t[this.sync]!=this.syncValue&&(this.syncValue=t[this.sync],void this.onInput(this.sluggify(this.syncValue)))))},deep:!0,immediate:!0},value(t){(t=this.sluggify(t))!==this.slug&&(this.slug=t,this.$emit("input",this.slug))}},methods:{sluggify(t){return this.$helper.slug(t,[this.slugs,this.$system.ascii],this.allow)},onInput(t){this.slug=this.sluggify(t),this.$emit("input",this.slug)}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-text-input",attrs:{autocomplete:"off",spellcheck:"false",type:"text"},domProps:{value:t.slug}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required},!1),t.listeners))}),[],!1,null,null,null,null).exports;const Ts={mixins:[Qt,ee,ie,re,le],props:{accept:{type:String,default:"all"},icon:{type:[String,Boolean],default:"tag"},layout:String,max:Number,min:Number,options:{type:Array,default:()=>[]},separator:{type:String,default:","},value:{type:Array,default:()=>[]}}};var Is=Mt({mixins:[Ts],inheritAttrs:!1,data(){return{tags:this.prepareTags(this.value),selected:null,newTag:null,tagOptions:this.options.map((t=>{var e;return(null==(e=this.icon)?void 0:e.length)>0&&(t.icon=this.icon),t}),this)}},computed:{dragOptions(){return{delay:1,disabled:!this.draggable,draggable:".k-tag"}},draggable(){return this.tags.length>1},skip(){return this.tags.map((t=>t.value))}},watch:{value(t){this.tags=this.prepareTags(t),this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{addString(t){if(t)if((t=t.trim()).includes(this.separator))t.split(this.separator).forEach((t=>{this.addString(t)}));else if(0!==t.length)if("options"===this.accept){const e=this.options.filter((e=>e.text===t))[0];if(!e)return;this.addTag(e)}else this.addTag({text:t,value:t})},addTag(t){this.addTagToIndex(t),this.$refs.autocomplete.close(),this.$refs.input.focus()},addTagToIndex(t){if("options"===this.accept){if(!this.options.filter((e=>e.value===t.value))[0])return}-1===this.index(t)&&(!this.max||this.tags.length=this.tags.length)return;break;case"first":e=0;break;case"last":e=this.tags.length-1;break;default:e=t}let i=this.tags[e];if(i){let t=this.$refs[i.value];if(null==t?void 0:t[0])return{ref:t[0],tag:i,index:e}}return!1},index(t){return this.tags.findIndex((e=>e.value===t.value))},onInput(){this.$emit("input",this.tags)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},leaveInput(t){0===t.target.selectionStart&&t.target.selectionStart===t.target.selectionEnd&&0!==this.tags.length&&(this.$refs.autocomplete.close(),this.navigate("last"),t.preventDefault())},navigate(t){var e=this.get(t);e?(e.ref.focus(),this.selectTag(e.tag)):"next"===t&&(this.$refs.input.focus(),this.selectTag(null))},prepareTags:t=>!1===Array.isArray(t)?[]:t.map((t=>"string"==typeof t?{text:t,value:t}:t)),remove(t){const e=this.get("prev"),s=this.get("next");this.tags.splice(this.index(t),1),this.onInput(),e?(this.selectTag(e.tag),e.ref.focus()):s?this.selectTag(s.tag):(this.selectTag(null),this.$refs.input.focus())},select(){this.focus()},selectTag(t){this.selected=t},tab(t){var e;(null==(e=this.newTag)?void 0:e.length)>0&&(t.preventDefault(),this.addString(this.newTag))},type(t){this.newTag=t,this.$refs.autocomplete.search(t)}},validations(){return{tags:{required:!this.required||P.required,minLength:!this.min||P.minLength(this.min),maxLength:!this.max||P.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("k-draggable",{directives:[{name:"direction",rawName:"v-direction"}],ref:"box",staticClass:"k-tags-input",attrs:{list:t.tags,"data-layout":t.layout,options:t.dragOptions},on:{end:t.onInput},scopedSlots:t._u([{key:"footer",fn:function(){return[e("span",{staticClass:"k-tags-input-element"},[e("k-autocomplete",{ref:"autocomplete",attrs:{html:!0,options:t.options,skip:t.skip},on:{select:t.addTag,leave:function(e){return t.$refs.input.focus()}}},[e("input",{directives:[{name:"model",rawName:"v-model.trim",value:t.newTag,expression:"newTag",modifiers:{trim:!0}}],ref:"input",attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled||t.max&&t.tags.length>=t.max,name:t.name,autocomplete:"off",type:"text"},domProps:{value:t.newTag},on:{input:[function(e){e.target.composing||(t.newTag=e.target.value.trim())},function(e){return t.type(e.target.value)}],blur:[t.blurInput,function(e){return t.$forceUpdate()}],keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?t.blurInput.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.leaveInput.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.enter.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.tab.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.leaveInput.apply(null,arguments)}]}})])],1)]},proxy:!0}])},t._l(t.tags,(function(s,i){return e("k-tag",{key:i,ref:s.value,refInFor:!0,attrs:{removable:!t.disabled,name:"tag"},on:{remove:function(e){return t.remove(s)}},nativeOn:{click:function(t){t.stopPropagation()},blur:function(e){return t.selectTag(null)},focus:function(e){return t.selectTag(s)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:t.navigate("prev")},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:t.navigate("next")}],dblclick:function(e){return t.edit(s)}}},[e("span",{domProps:{innerHTML:t._s(s.text)}})])})),1)}),[],!1,null,null,null,null).exports;const Ms={mixins:[us],props:{autocomplete:{type:String,default:"tel"},type:{type:String,default:"tel"}}};var Ls=Mt({extends:cs,mixins:[Ms]},null,null,!1,null,null,null,null).exports;const Es={mixins:[Qt,ee,ie,re,le],props:{buttons:{type:[Boolean,Array],default:!0},endpoints:Object,font:String,maxlength:Number,minlength:Number,placeholder:String,preselect:Boolean,size:String,spellcheck:{type:[Boolean,String],default:"off"},theme:String,uploads:[Boolean,Object,Array],value:String}};var js=Mt({mixins:[Es],inheritAttrs:!1,data:()=>({over:!1}),watch:{value(){this.onInvalid(),this.$nextTick((()=>{this.resize()}))}},mounted(){this.$nextTick((()=>{this.$library.autosize(this.$refs.input)})),this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{cancel(){this.$refs.input.focus()},dialog(t){if(!this.$refs[t+"Dialog"])throw"Invalid toolbar dialog";this.$refs[t+"Dialog"].open(this.$refs.input,this.selection())},focus(){this.$refs.input.focus()},insert(t){const e=this.$refs.input,s=e.value;setTimeout((()=>{if(e.focus(),document.execCommand("insertText",!1,t),e.value===s){const s=e.value.slice(0,e.selectionStart)+t+e.value.slice(e.selectionEnd);e.value=s,this.$emit("input",s)}})),this.resize()},insertFile(t){(null==t?void 0:t.length)>0&&this.insert(t.map((t=>t.dragText)).join("\n\n"))},insertUpload(t,e){this.insert(e.map((t=>t.dragText)).join("\n\n")),this.$events.$emit("model.update")},onClick(){this.$refs.toolbar&&this.$refs.toolbar.close()},onCommand(t,e){"function"==typeof this[t]?"function"==typeof e?this[t](e(this.$refs.input,this.selection())):this[t](e):window.console.warn(t+" is not a valid command")},onDrop(t){if(this.uploads&&this.$helper.isUploadEvent(t))return this.$refs.fileUpload.drop(t.dataTransfer.files,{url:this.$urls.api+"/"+this.endpoints.field+"/upload",multiple:!1});const e=this.$store.state.drag;"text"===(null==e?void 0:e.type)&&(this.focus(),this.insert(e.data))},onFocus(t){this.$emit("focus",t)},onInput(t){this.$emit("input",t.target.value)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onOut(){this.$refs.input.blur(),this.over=!1},onOver(t){if(this.uploads&&this.$helper.isUploadEvent(t))return t.dataTransfer.dropEffect="copy",this.focus(),void(this.over=!0);const e=this.$store.state.drag;"text"===(null==e?void 0:e.type)&&(t.dataTransfer.dropEffect="copy",this.focus(),this.over=!0)},onShortcut(t){!1!==this.buttons&&"Meta"!==t.key&&"Control"!==t.key&&this.$refs.toolbar&&this.$refs.toolbar.shortcut(t.key,t)},onSubmit(t){return this.$emit("submit",t)},prepend(t){this.insert(t+" "+this.selection())},resize(){this.$library.autosize.update(this.$refs.input)},select(){this.$refs.select()},selectFile(){this.$refs.fileDialog.open({endpoint:this.endpoints.field+"/files",multiple:!1})},selection(){const t=this.$refs.input,e=t.selectionStart,s=t.selectionEnd;return t.value.substring(e,s)},uploadFile(){this.$refs.fileUpload.open({url:this.$urls.api+"/"+this.endpoints.field+"/upload",multiple:!1})},wrap(t){this.insert(t+this.selection()+t)}},validations(){return{value:{required:!this.required||P.required,minLength:!this.minlength||P.minLength(this.minlength),maxLength:!this.maxlength||P.maxLength(this.maxlength)}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-textarea-input",attrs:{"data-over":t.over,"data-size":t.size,"data-theme":t.theme}},[e("div",{staticClass:"k-textarea-input-wrapper"},[t.buttons&&!t.disabled?e("k-toolbar",{ref:"toolbar",attrs:{buttons:t.buttons,disabled:t.disabled,uploads:t.uploads},on:{command:t.onCommand},nativeOn:{mousedown:function(t){t.preventDefault()}}}):t._e(),e("textarea",t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-textarea-input-native",attrs:{"data-font":t.font},on:{click:t.onClick,focus:t.onFocus,input:t.onInput,keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.metaKey?t.onSubmit.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.ctrlKey?t.onSubmit.apply(null,arguments):null},function(e){return e.metaKey?t.onShortcut.apply(null,arguments):null},function(e){return e.ctrlKey?t.onShortcut.apply(null,arguments):null}],dragover:t.onOver,dragleave:t.onOut,drop:t.onDrop}},"textarea",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,value:t.value},!1))],1),e("k-toolbar-email-dialog",{ref:"emailDialog",on:{cancel:t.cancel,submit:function(e){return t.insert(e)}}}),e("k-toolbar-link-dialog",{ref:"linkDialog",on:{cancel:t.cancel,submit:function(e){return t.insert(e)}}}),e("k-files-dialog",{ref:"fileDialog",on:{cancel:t.cancel,submit:function(e){return t.insertFile(e)}}}),t.uploads?e("k-upload",{ref:"fileUpload",on:{success:t.insertUpload}}):t._e()],1)}),[],!1,null,null,null,null).exports;const Bs={props:{display:{type:String,default:"HH:mm"},max:String,min:String,step:{type:Object,default:()=>({size:5,unit:"minute"})},type:{type:String,default:"time"},value:String}};var Ds=Mt({mixins:[as,Bs],computed:{inputType:()=>"time"}},null,null,!1,null,null,null,null).exports;const Ps={props:{autofocus:Boolean,disabled:Boolean,id:[Number,String],text:{type:[Array,String]},required:Boolean,value:Boolean}};var Ns=Mt({mixins:[Ps],inheritAttrs:!1,computed:{label(){const t=this.text||[this.$t("off"),this.$t("on")];return Array.isArray(t)?this.value?t[1]:t[0]:t}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onEnter(t){"Enter"===t.key&&this.$refs.input.click()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.$refs.input.focus()}},validations(){return{value:{required:!this.required||P.required}}}},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-toggle-input",attrs:{"data-disabled":t.disabled}},[e("input",{ref:"input",staticClass:"k-toggle-input-native",attrs:{id:t.id,disabled:t.disabled,type:"checkbox"},domProps:{checked:t.value},on:{change:function(e){return t.onInput(e.target.checked)}}}),e("span",{staticClass:"k-toggle-input-label",domProps:{innerHTML:t._s(t.label)}})])}),[],!1,null,null,null,null).exports;const qs={mixins:[Qt,ee,ie,le],props:{columns:Number,grow:Boolean,labels:Boolean,options:Array,reset:Boolean,value:[String,Number,Boolean]}};var Fs=Mt({inheritAttrs:!1,mixins:[qs],watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){(this.$el.querySelector("input[checked]")||this.$el.querySelector("input")).focus()},onClick(t){t===this.value&&this.reset&&!this.required&&this.$emit("input","")},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||P.required}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-toggles-input",style:"--options:"+(t.columns||t.options.length),attrs:{"data-invalid":t.$v.$invalid,"data-labels":t.labels}},t._l(t.options,(function(s,i){return e("li",{key:i},[e("input",{staticClass:"input-hidden",attrs:{id:t.id+"-"+i,name:t.id,type:"radio"},domProps:{value:s.value,checked:t.value===s.value},on:{click:function(e){return t.onClick(s.value)},change:function(e){return t.onInput(s.value)}}}),e("label",{attrs:{for:t.id+"-"+i,title:s.text}},[s.icon?e("k-icon",{attrs:{type:s.icon}}):t._e(),t.labels?e("span",{staticClass:"k-toggles-text"},[t._v(" "+t._s(s.text)+" ")]):t._e()],1)])})),0)}),[],!1,null,null,null,null).exports;const Rs={mixins:[us],props:{autocomplete:{type:String,default:"url"},type:{type:String,default:"url"}}};var zs=Mt({extends:cs,mixins:[Rs]},null,null,!1,null,null,null,null).exports;t.component("k-checkbox-input",ns),t.component("k-checkboxes-input",rs),t.component("k-date-input",as),t.component("k-email-input",ps),t.component("k-list-input",ms),t.component("k-multiselect-input",gs),t.component("k-number-input",bs),t.component("k-password-input",ys),t.component("k-radio-input",_s),t.component("k-range-input",ws),t.component("k-select-input",Cs),t.component("k-slug-input",As),t.component("k-tags-input",Is),t.component("k-tel-input",Ls),t.component("k-text-input",cs),t.component("k-textarea-input",js),t.component("k-time-input",Ds),t.component("k-toggle-input",Ns),t.component("k-toggles-input",Fs),t.component("k-url-input",zs);var Ys=Mt({mixins:[ae],inheritAttrs:!1,props:{autofocus:Boolean,empty:String,fieldsets:Object,fieldsetGroups:Object,group:String,max:{type:Number,default:null},value:{type:Array,default:()=>[]}},data:()=>({opened:[]}),computed:{hasFieldsets(){return Object.keys(this.fieldsets).length},isEmpty(){return 0===this.value.length},isFull(){return null!==this.max&&this.value.length>=this.max}},methods:{focus(){this.$refs.blocks.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-blocks-field",scopedSlots:t._u([{key:"options",fn:function(){return[t.hasFieldsets?e("k-dropdown",[e("k-button",{attrs:{icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"add"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}},[t._v(" "+t._s(t.$t("add"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{disabled:t.isEmpty,icon:"template"},on:{click:function(e){return t.$refs.blocks.copyAll()}}},[t._v(" "+t._s(t.$t("copy.all"))+" ")]),e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"download"},on:{click:function(e){return t.$refs.blocks.pasteboard()}}},[t._v(" "+t._s(t.$t("paste"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{disabled:t.isEmpty,icon:"trash"},on:{click:function(e){return t.$refs.blocks.confirmToRemoveAll()}}},[t._v(" "+t._s(t.$t("delete.all"))+" ")])],1)],1):t._e()]},proxy:!0}])},"k-field",t.$props,!1),[e("k-blocks",t._g({ref:"blocks",attrs:{autofocus:t.autofocus,compact:!1,empty:t.empty,endpoints:t.endpoints,fieldsets:t.fieldsets,"fieldset-groups":t.fieldsetGroups,group:t.group,max:t.max,value:t.value},on:{close:function(e){t.opened=e},open:function(e){t.opened=e}}},t.$listeners))],1)}),[],!1,null,null,null,null).exports,Hs={props:{counter:{type:Boolean,default:!0}},computed:{counterOptions(){var t,e;if(null===this.value||this.disabled||!1===this.counter)return!1;let s=0;return this.value&&(s=Array.isArray(this.value)?this.value.length:String(this.value).length),{count:s,min:null!=(t=this.min)?t:this.minlength,max:null!=(e=this.max)?e:this.maxlength}}}};var Us=Mt({mixins:[ae,de,os,Hs],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-checkboxes-field",attrs:{counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"checkboxes"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;var Ks=Mt({mixins:[ae,de,ls],inheritAttrs:!1,props:{calendar:{type:Boolean,default:!0},icon:{type:String,default:"calendar"},time:{type:[Boolean,Object],default:()=>({})},times:{type:Boolean,default:!0}},data(){return{isInvalid:!1,iso:this.toIso(this.value)}},computed:{isEmpty(){return this.time?null===this.iso.date&&this.iso.time:null===this.iso.date}},watch:{value(t,e){t!==e&&(this.iso=this.toIso(t))}},methods:{focus(){this.$refs.dateInput.focus()},now(){const t=this.$library.dayjs();return{date:t.toISO("date"),time:this.time?t.toISO("time"):"00:00:00"}},onInput(){if(this.isEmpty)return this.$emit("input","");const t=this.$library.dayjs.iso(this.iso.date+" "+this.iso.time);(t||null!==this.iso.date&&null!==this.iso.time)&&this.$emit("input",(null==t?void 0:t.toISO())||"")},onCalendarInput(t){var e;null==(e=this.$refs.calendar)||e.close(),this.onDateInput(t)},onDateInput(t){t&&!this.iso.time&&(this.iso.time=this.now().time),this.iso.date=t,this.onInput()},onDateInvalid(t){this.isInvalid=t},onTimeInput(t){t&&!this.iso.date&&(this.iso.date=this.now().date),this.iso.time=t,this.onInput()},onTimesInput(t){var e;null==(e=this.$refs.times)||e.close(),this.onTimeInput(t+":00")},toIso(t){const e=this.$library.dayjs.iso(t);return{date:(null==e?void 0:e.toISO("date"))||null,time:(null==e?void 0:e.toISO("time"))||null}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-date-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("div",{ref:"body",staticClass:"k-date-field-body",attrs:{"data-invalid":!t.novalidate&&t.isInvalid,"data-theme":"field"}},[e("k-input",t._b({ref:"dateInput",attrs:{id:t._uid,autofocus:t.autofocus,disabled:t.disabled,display:t.display,max:t.max,min:t.min,required:t.required,value:t.value,theme:"field",type:"date"},on:{invalid:t.onDateInvalid,input:t.onDateInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.calendar?{key:"icon",fn:function(){return[e("k-dropdown",[e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,tooltip:t.$t("date.select")},on:{click:function(e){return t.$refs.calendar.toggle()}}}),e("k-dropdown-content",{ref:"calendar",attrs:{align:"right"}},[e("k-calendar",{attrs:{value:t.value,min:t.min,max:t.max},on:{input:t.onCalendarInput}})],1)],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1)),t.time?e("k-input",{ref:"timeInput",attrs:{disabled:t.disabled,display:t.time.display,required:t.required,step:t.time.step,value:t.iso.time,icon:t.time.icon,theme:"field",type:"time"},on:{input:t.onTimeInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-dropdown",[e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.time.icon||"clock",tooltip:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{align:"right"}},[e("k-times",{attrs:{display:t.time.display,value:t.value},on:{input:t.onTimesInput}})],1)],1)]},proxy:!0}:null],null,!0)}):t._e()],1)])}),[],!1,null,null,null,null).exports;var Js=Mt({mixins:[ae,de,ds],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"email"}},computed:{mailto(){var t;return(null==(t=this.value)?void 0:t.length)>0?"mailto:"+this.value:null}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-email-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"email"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.mailto,tooltip:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,Gs={mixins:[ae],inheritAttrs:!1,props:{empty:String,info:String,link:Boolean,layout:{type:String,default:"list"},max:Number,multiple:Boolean,parent:String,search:Boolean,size:String,text:String,value:{type:Array,default:()=>[]}},data(){return{selected:this.value}},computed:{btnIcon(){return!this.multiple&&this.selected.length>0?"refresh":"add"},btnLabel(){return!this.multiple&&this.selected.length>0?this.$t("change"):this.$t("add")},collection(){return{empty:this.emptyProps,items:this.selected,layout:this.layout,link:this.link,size:this.size,sortable:!this.disabled&&this.selected.length>1}},isInvalid(){return!(!this.required||0!==this.selected.length)||(!!(this.min&&this.selected.lengththis.max))},items(){return this.models.map(this.item)},more(){return!this.max||this.max>this.selected.length}},watch:{value(t){this.selected=t}},methods:{focus(){},item:t=>t,onInput(){this.$emit("input",this.selected)},open(){if(this.disabled)return!1;this.$refs.selector.open({endpoint:this.endpoints.field,max:this.max,multiple:this.multiple,search:this.search,selected:this.selected.map((t=>t.id))})},remove(t){this.selected.splice(t,1),this.onInput()},removeById(t){this.selected=this.selected.filter((e=>e.id!==t)),this.onInput()},select(t){0!==t.length?(this.selected=this.selected.filter((e=>t.filter((t=>t.id===e.id)).length>0)),t.forEach((t=>{0===this.selected.filter((e=>t.id===e.id)).length&&this.selected.push(t)})),this.onInput()):this.selected=[]}}};var Vs=Mt({mixins:[Gs],props:{uploads:[Boolean,Object,Array]},computed:{emptyProps(){return{icon:"image",text:this.empty||this.$t("field.files.empty")}},moreUpload(){return!this.disabled&&this.more&&this.uploads},options(){return this.uploads?{icon:this.btnIcon,text:this.btnLabel,options:[{icon:"check",text:this.$t("select"),click:"open"},{icon:"upload",text:this.$t("upload"),click:"upload"}]}:{options:[{icon:"check",text:this.$t("select"),click:()=>this.open()}]}},uploadParams(){return{accept:this.uploads.accept,max:this.max,multiple:this.multiple,url:this.$urls.api+"/"+this.endpoints.field+"/upload"}}},created(){this.$events.$on("file.delete",this.removeById)},destroyed(){this.$events.$off("file.delete",this.removeById)},methods:{drop(t){return!1!==this.uploads&&this.$refs.fileUpload.drop(t,this.uploadParams)},prompt(){if(this.disabled)return!1;this.moreUpload?this.$refs.options.toggle():this.open()},onAction(t){if(this.moreUpload)switch(t){case"open":return this.open();case"upload":return this.$refs.fileUpload.open(this.uploadParams)}},isSelected(t){return this.selected.find((e=>e.id===t.id))},upload(t,e){!1===this.multiple&&(this.selected=[]),e.forEach((t=>{this.isSelected(t)||this.selected.push(t)})),this.onInput(),this.$events.$emit("model.update")}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-files-field",scopedSlots:t._u([t.more&&!t.disabled?{key:"options",fn:function(){return[e("k-button-group",{staticClass:"k-field-options"},[e("k-options-dropdown",t._b({ref:"options",on:{action:t.onAction}},"k-options-dropdown",t.options,!1))],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-dropzone",{attrs:{disabled:!t.moreUpload},on:{drop:t.drop}},[e("k-collection",t._b({on:{empty:t.prompt,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function({index:s}){return[t.disabled?t._e():e("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(s)}}})]}}])},"k-collection",t.collection,!1))],1),e("k-files-dialog",{ref:"selector",on:{submit:t.select}}),e("k-upload",{ref:"fileUpload",on:{success:t.upload}})],1)}),[],!1,null,null,null,null).exports;var Ws=Mt({},(function(){return(0,this._self._c)("div",{staticClass:"k-field k-gap-field"})}),[],!1,null,null,null,null).exports;var Xs=Mt({mixins:[se,oe],props:{numbered:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-headline-field"},[e("k-headline",{attrs:{"data-numbered":t.numbered,size:"large"}},[t._v(" "+t._s(t.label)+" ")]),t.help?e("footer",{staticClass:"k-field-footer"},[t.help?e("k-text",{staticClass:"k-field-help",attrs:{theme:"help"},domProps:{innerHTML:t._s(t.help)}}):t._e()],1):t._e()],1)}),[],!1,null,null,null,null).exports;var Zs=Mt({mixins:[se,oe],props:{text:String,theme:{type:String,default:"info"}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-field k-info-field"},[e("k-headline",[t._v(t._s(t.label))]),e("k-box",{attrs:{theme:t.theme}},[e("k-text",{domProps:{innerHTML:t._s(t.text)}})],1),t.help?e("footer",{staticClass:"k-field-footer"},[t.help?e("k-text",{staticClass:"k-field-help",attrs:{theme:"help"},domProps:{innerHTML:t._s(t.help)}}):t._e()],1):t._e()],1)}),[],!1,null,null,null,null).exports;var Qs=Mt({components:{"k-block-layouts":Mt({components:{"k-layout":Mt({components:{"k-layout-column":Mt({props:{blocks:Array,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean,width:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column k-layout-column",attrs:{id:t.id,"data-width":t.width,tabindex:"0"},on:{dblclick:function(e){return t.$refs.blocks.choose(t.blocks.length)}}},[e("k-blocks",{ref:"blocks",attrs:{endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets,value:t.blocks,group:"layout"},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{dblclick:function(t){t.stopPropagation()}}})],1)}),[],!1,null,null,null,null).exports},props:{attrs:[Array,Object],columns:Array,disabled:Boolean,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean,settings:Object},computed:{tabs(){let t=this.settings.tabs;return Object.entries(t).forEach((([e,s])=>{Object.entries(s.fields).forEach((([s])=>{t[e].fields[s].endpoints={field:this.endpoints.field+"/fields/"+s,section:this.endpoints.section,model:this.endpoints.model}}))})),t}}},(function(){var t=this,e=t._self._c;return e("section",{staticClass:"k-layout",attrs:{"data-selected":t.isSelected,tabindex:"0"},on:{click:function(e){return t.$emit("select")}}},[e("k-grid",{staticClass:"k-layout-columns"},t._l(t.columns,(function(s,i){return e("k-layout-column",t._b({key:s.id,attrs:{endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets},on:{input:function(e){return t.$emit("updateColumn",{column:s,columnIndex:i,blocks:e})}}},"k-layout-column",s,!1))})),1),t.disabled?t._e():e("nav",{staticClass:"k-layout-toolbar"},[t.settings?e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{tooltip:t.$t("settings"),icon:"settings"},on:{click:function(e){return t.$refs.drawer.open()}}}):t._e(),e("k-dropdown",[e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{icon:"angle-down"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{icon:"angle-up"},on:{click:function(e){return t.$emit("prepend")}}},[t._v(" "+t._s(t.$t("insert.before"))+" ")]),e("k-dropdown-item",{attrs:{icon:"angle-down"},on:{click:function(e){return t.$emit("append")}}},[t._v(" "+t._s(t.$t("insert.after"))+" ")]),e("hr"),t.settings?e("k-dropdown-item",{attrs:{icon:"settings"},on:{click:function(e){return t.$refs.drawer.open()}}},[t._v(" "+t._s(t.$t("settings"))+" ")]):t._e(),e("k-dropdown-item",{attrs:{icon:"copy"},on:{click:function(e){return t.$emit("duplicate")}}},[t._v(" "+t._s(t.$t("duplicate"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:"trash"},on:{click:function(e){return t.$refs.confirmRemoveDialog.open()}}},[t._v(" "+t._s(t.$t("field.layout.delete"))+" ")])],1)],1),e("k-sort-handle")],1),t.settings?e("k-form-drawer",{ref:"drawer",staticClass:"k-layout-drawer",attrs:{tabs:t.tabs,title:t.$t("settings"),value:t.attrs,icon:"settings"},on:{input:function(e){return t.$emit("updateAttrs",e)}}}):t._e(),e("k-remove-dialog",{ref:"confirmRemoveDialog",attrs:{text:t.$t("field.layout.delete.confirm")},on:{submit:function(e){return t.$emit("remove")}}})],1)}),[],!1,null,null,null,null).exports},props:{disabled:Boolean,empty:String,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,layouts:Array,max:Number,settings:Object,value:Array},data(){return{currentLayout:null,nextIndex:null,rows:this.value,selected:null}},computed:{draggableOptions(){return{id:this._uid,handle:!0,list:this.rows}}},watch:{value(){this.rows=this.value}},methods:{async addLayout(t){let e=await this.$api.post(this.endpoints.field+"/layout",{columns:t});this.rows.splice(this.nextIndex,0,e),this.layouts.length>1&&this.$refs.selector.close(),this.save()},duplicateLayout(t,e){let s={...this.$helper.clone(e),id:this.$helper.uuid()};s.columns=s.columns.map((t=>(t.id=this.$helper.uuid(),t.blocks=t.blocks.map((t=>(t.id=this.$helper.uuid(),t))),t))),this.rows.splice(t+1,0,s),this.save()},removeLayout(t){const e=this.rows.findIndex((e=>e.id===t.id));-1!==e&&this.$delete(this.rows,e),this.save()},save(){this.$emit("input",this.rows)},selectLayout(t){this.nextIndex=t,1!==this.layouts.length?this.$refs.selector.open():this.addLayout(this.layouts[0])},updateColumn(t){this.rows[t.layoutIndex].columns[t.columnIndex].blocks=t.blocks,this.save()},updateAttrs(t,e){this.rows[t].attrs=e,this.save()}}},(function(){var t=this,e=t._self._c;return e("div",[t.rows.length?[e("k-draggable",t._b({staticClass:"k-layouts",on:{sort:t.save}},"k-draggable",t.draggableOptions,!1),t._l(t.rows,(function(s,i){return e("k-layout",t._b({key:s.id,attrs:{disabled:t.disabled,endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets,"is-selected":t.selected===s.id,settings:t.settings},on:{append:function(e){return t.selectLayout(i+1)},duplicate:function(e){return t.duplicateLayout(i,s)},prepend:function(e){return t.selectLayout(i)},remove:function(e){return t.removeLayout(s)},select:function(e){t.selected=s.id},updateAttrs:function(e){return t.updateAttrs(i,e)},updateColumn:function(e){return t.updateColumn({layout:s,layoutIndex:i,...e})}}},"k-layout",s,!1))})),1),t.disabled?t._e():e("k-button",{staticClass:"k-layout-add-button",attrs:{icon:"add"},on:{click:function(e){return t.selectLayout(t.rows.length)}}})]:[e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"},on:{click:function(e){return t.selectLayout(0)}}},[t._v(" "+t._s(t.empty||t.$t("field.layout.empty"))+" ")])],e("k-dialog",{ref:"selector",staticClass:"k-layout-selector",attrs:{"cancel-button":!1,"submit-button":!1,size:"medium"}},[e("k-headline",[t._v(t._s(t.$t("field.layout.select")))]),e("ul",t._l(t.layouts,(function(s,i){return e("li",{key:i,staticClass:"k-layout-selector-option"},[e("k-grid",{nativeOn:{click:function(e){return t.addLayout(s)}}},t._l(s,(function(t,s){return e("k-column",{key:s,attrs:{width:t}})})),1)],1)})),0)],1)],2)}),[],!1,null,null,null,null).exports},mixins:[ae],inheritAttrs:!1,props:{empty:String,fieldsetGroups:Object,fieldsets:Object,layouts:{type:Array,default:()=>[["1/1"]]},settings:Object,value:{type:Array,default:()=>[]}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-layout-field"},"k-field",t.$props,!1),[e("k-block-layouts",t._b({on:{input:function(e){return t.$emit("input",e)}}},"k-block-layouts",t.$props,!1))],1)}),[],!1,null,null,null,null).exports;var ti=Mt({},(function(){return(0,this._self._c)("hr",{staticClass:"k-line-field"})}),[],!1,null,null,null,null).exports;var ei=Mt({mixins:[ae,de],inheritAttrs:!1,props:{marks:[Array,Boolean],value:String},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-list-field",attrs:{input:t._uid,counter:!1}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{id:t._uid,marks:t.marks,value:t.value,type:"list",theme:"field"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports;var si=Mt({mixins:[ae,de,fs,Hs],inheritAttrs:!1,props:{icon:{type:String,default:"angle-down"}},mounted(){this.$refs.input.$el.setAttribute("tabindex",0)},methods:{blur(t){this.$refs.input.blur(t)},focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-multiselect-field",attrs:{input:t._uid,counter:t.counterOptions},on:{blur:t.blur},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.focus.apply(null,arguments))}}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"multiselect"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;var ii=Mt({mixins:[ae,de,ks],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-number-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"number"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;var ni=Mt({mixins:[Gs],computed:{emptyProps(){return{icon:"page",text:this.empty||this.$t("field.pages.empty")}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-pages-field",scopedSlots:t._u([{key:"options",fn:function(){return[e("k-button-group",{staticClass:"k-field-options"},[t.more&&!t.disabled?e("k-button",{staticClass:"k-field-options-button",attrs:{icon:t.btnIcon,text:t.btnLabel},on:{click:t.open}}):t._e()],1)]},proxy:!0}])},"k-field",t.$props,!1),[e("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function({index:s}){return[t.disabled?t._e():e("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(s)}}})]}}])},"k-collection",t.collection,!1)),e("k-pages-dialog",{ref:"selector",on:{submit:t.select}})],1)}),[],!1,null,null,null,null).exports;var oi=Mt({mixins:[ae,de,vs,Hs],inheritAttrs:!1,props:{minlength:{type:Number,default:8},icon:{type:String,default:"key"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-password-field",attrs:{input:t._uid,counter:t.counterOptions},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"password"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;var ri=Mt({mixins:[ae,de,$s],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-radio-field"},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"radio"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;var li=Mt({mixins:[de,ae,xs],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-range-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"range"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;var ai=Mt({mixins:[ae,de,Ss],inheritAttrs:!1,props:{icon:{type:String,default:"angle-down"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-select-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"select"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;var ui=Mt({mixins:[ae,de,Os],inheritAttrs:!1,props:{icon:{type:String,default:"url"},path:{type:String},wizard:{type:[Boolean,Object],default:!1}},data(){return{slug:this.value}},computed:{preview(){return void 0!==this.help?this.help:void 0!==this.path?this.path+this.value:null}},watch:{value(){this.slug=this.value}},methods:{focus(){this.$refs.input.focus()},onWizard(){var t;this.formData[null==(t=this.wizard)?void 0:t.field]&&(this.slug=this.formData[this.wizard.field])}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-slug-field",attrs:{input:t._uid,help:t.preview},scopedSlots:t._u([t.wizard&&t.wizard.text?{key:"options",fn:function(){return[e("k-button",{attrs:{text:t.wizard.text,icon:"wand"},on:{click:t.onWizard}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,value:t.slug,theme:"field",type:"slug"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;var ci=Mt({mixins:[ae],inheritAttrs:!1,props:{columns:Object,duplicate:{type:Boolean,default:!0},empty:String,fields:Object,limit:Number,max:Number,min:Number,prepend:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},sortBy:String,value:{type:Array,default:()=>[]}},data(){return{autofocus:null,items:this.toItems(this.value),currentIndex:null,currentModel:null,trash:null,page:1}},computed:{dragOptions(){return{disabled:!this.isSortable,fallbackClass:"k-sortable-row-fallback"}},form(){let t={};return Object.keys(this.fields).forEach((e=>{let s=this.fields[e];s.section=this.name,s.endpoints={field:this.endpoints.field+"+"+e,section:this.endpoints.section,model:this.endpoints.model},null===this.autofocus&&!0===s.autofocus&&(this.autofocus=e),t[e]=s})),t},index(){return this.limit?(this.page-1)*this.limit:1},more(){return!0!==this.disabled&&!(this.max&&this.items.length>=this.max)},isInvalid(){return!0!==this.disabled&&(!!(this.min&&this.items.lengththis.max))},isSortable(){return!this.sortBy&&(!this.limit&&(!0!==this.disabled&&(!(this.items.length<=1)&&!1!==this.sortable)))},pagination(){let t=0;return this.limit&&(t=(this.page-1)*this.limit),{page:this.page,offset:t,limit:this.limit,total:this.items.length,align:"center",details:!0}},options(){let t=[],e=this.duplicate&&this.more&&null===this.currentIndex;return e&&t.push({icon:"copy",text:this.$t("duplicate"),click:"duplicate"}),t.push({icon:"remove",text:e?this.$t("remove"):null,click:"remove"}),t},paginatedItems(){return this.limit?this.items.slice(this.pagination.offset,this.pagination.offset+this.limit):this.items}},watch:{value(t){t!=this.items&&(this.items=this.toItems(t))}},methods:{add(t){!0===this.prepend?this.items.unshift(t):this.items.push(t)},focus(){var t,e;null==(e=null==(t=this.$refs.add)?void 0:t.focus)||e.call(t)},jump(t,e){this.open(t+this.pagination.offset,e)},onAdd(){if(!0===this.disabled)return!1;if(null!==this.currentIndex)return this.onFormDiscard(),!1;let t={};for(const e in this.fields)t[e]=this.$helper.clone(this.fields[e].default);this.currentIndex="new",this.currentModel=t,this.onFormOpen()},onFormClose(){this.currentIndex=null,this.currentModel=null},onFormDiscard(){if("new"===this.currentIndex){if(0===Object.values(this.currentModel).filter((t=>!1===this.$helper.object.isEmpty(t))).length)return void this.onFormClose()}this.onFormSubmit()},onFormOpen(t=this.autofocus){this.$nextTick((()=>{var e;null==(e=this.$refs.form)||e.focus(t)}))},async onFormPaginate(t){await this.save(),this.open(t)},async onFormSubmit(){try{await this.save(),this.onFormClose()}catch(t){}},onInput(t=this.items){this.$emit("input",t)},onOption(t,e,s){switch(t){case"remove":this.onFormClose(),this.trash=s+this.pagination.offset,this.$refs.remove.open();break;case"duplicate":this.add(this.items[s+this.pagination.offset]),this.onInput()}},onRemove(){if(null===this.trash)return!1;this.items.splice(this.trash,1),this.trash=null,this.$refs.remove.close(),this.onInput(),0===this.paginatedItems.length&&this.page>1&&this.page--,this.items=this.sort(this.items)},open(t,e){this.currentIndex=t,this.currentModel=this.$helper.clone(this.items[t]),this.onFormOpen(e)},paginate({page:t}){this.page=t},sort(t){return this.sortBy?t.sortBy(this.sortBy):t},async save(){if(null!==this.currentIndex&&void 0!==this.currentIndex)try{return await this.validate(this.currentModel),"new"===this.currentIndex?this.add(this.currentModel):this.items[this.currentIndex]=this.currentModel,this.items=this.sort(this.items),this.onInput(),!0}catch(t){throw this.$store.dispatch("notification/error",{message:this.$t("error.form.incomplete"),details:t}),t}},toItems(t){return!1===Array.isArray(t)?[]:this.sort(t)},async validate(t){const e=await this.$api.post(this.endpoints.field+"/validate",t);if(e.length>0)throw e;return!0}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-structure-field",nativeOn:{click:function(t){t.stopPropagation()}},scopedSlots:t._u([{key:"options",fn:function(){return[t.more&&null===t.currentIndex?e("k-button",{ref:"add",attrs:{id:t._uid,text:t.$t("add"),icon:"add"},on:{click:t.onAdd}}):t._e()]},proxy:!0}])},"k-field",t.$props,!1),[null!==t.currentIndex?e("k-structure-form",{ref:"form",attrs:{fields:t.form,index:t.currentIndex,total:t.items.length},on:{close:t.onFormClose,discard:t.onFormDiscard,paginate:function(e){return t.onFormPaginate(e.offset)},submit:t.onFormSubmit},model:{value:t.currentModel,callback:function(e){t.currentModel=e},expression:"currentModel"}}):0===t.items.length?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"list-bullet"},on:{click:t.onAdd}},[t._v(" "+t._s(t.empty||t.$t("field.structure.empty"))+" ")]):[e("k-table",{attrs:{columns:t.columns,disabled:t.disabled,fields:t.fields,empty:t.$t("field.structure.empty"),index:t.index,options:t.options,rows:t.paginatedItems,sortable:t.isSortable,"data-invalid":t.isInvalid},on:{cell:function(e){return t.jump(e.rowIndex,e.columnIndex)},input:t.onInput,option:t.onOption}}),t.limit?e("k-pagination",t._b({on:{paginate:t.paginate}},"k-pagination",t.pagination,!1)):t._e(),t.disabled?t._e():e("k-dialog",{ref:"remove",attrs:{"submit-button":t.$t("delete"),theme:"negative"},on:{submit:t.onRemove}},[e("k-text",[t._v(t._s(t.$t("field.structure.delete.confirm")))])],1)]],2)}),[],!1,null,null,null,null).exports;var di=Mt({mixins:[ae,de,Ts,Hs],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-tags-field",attrs:{input:t._uid,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"tags"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;var pi=Mt({mixins:[ae,de,Ms],inheritAttrs:!1,props:{icon:{type:String,default:"phone"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-tel-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"tel"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;var hi=Mt({mixins:[ae,de,us,Hs],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()},select(){this.$refs.input.select()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-text-field",attrs:{input:t._uid,counter:t.counterOptions},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;var mi=Mt({mixins:[ae,de,Es,Hs],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-textarea-field",attrs:{input:t._uid,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,type:"textarea",theme:"field"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;var fi=Mt({mixins:[ae,de,Bs],inheritAttrs:!1,props:{icon:{type:String,default:"clock"},times:{type:Boolean,default:!0}},methods:{focus(){this.$refs.input.focus()},select(t){var e;this.$emit("input",t),null==(e=this.$refs.times)||e.close()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-time-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"time"},on:{input:function(e){return t.$emit("input",e||"")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-dropdown",[e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon||"clock",tooltip:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{align:"right"}},[e("k-times",{attrs:{display:t.display,value:t.value},on:{input:t.select}})],1)],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports;var gi=Mt({mixins:[ae,de,Ps],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-toggle-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"toggle"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;var ki=Mt({inheritAttrs:!1,mixins:[ae,de,qs],methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-toggles-field"},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",class:{grow:t.grow},attrs:{id:t._uid,theme:"field",type:"toggles"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;var bi=Mt({mixins:[ae,de,Rs],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"url"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-url-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"url"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.value,tooltip:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;var vi=Mt({mixins:[Gs],computed:{emptyProps(){return{icon:"users",text:this.empty||this.$t("field.users.empty")}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-users-field",scopedSlots:t._u([{key:"options",fn:function(){return[e("k-button-group",{staticClass:"k-field-options"},[t.more&&!t.disabled?e("k-button",{staticClass:"k-field-options-button",attrs:{icon:t.btnIcon,text:t.btnLabel},on:{click:t.open}}):t._e()],1)]},proxy:!0}])},"k-field",t.$props,!1),[e("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function({index:s}){return[t.disabled?t._e():e("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(s)}}})]}}])},"k-collection",t.collection,!1)),e("k-users-dialog",{ref:"selector",on:{submit:t.select}})],1)}),[],!1,null,null,null,null).exports;var yi=Mt({mixins:[ae,de,We],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-writer-field",attrs:{input:t._uid,counter:!1}},"k-field",t.$props,!1),[e("k-input",t._b({attrs:{after:t.after,before:t.before,icon:t.icon,theme:"field"}},"k-input",t.$props,!1),[e("k-writer",t._b({ref:"input",staticClass:"k-writer-field-input",attrs:{value:t.value},on:{input:function(e){return t.$emit("input",e)}}},"k-writer",t.$props,!1))],1)],1)}),[],!1,null,null,null,null).exports;t.component("k-blocks-field",Ys),t.component("k-checkboxes-field",Us),t.component("k-date-field",Ks),t.component("k-email-field",Js),t.component("k-files-field",Vs),t.component("k-gap-field",Ws),t.component("k-headline-field",Xs),t.component("k-info-field",Zs),t.component("k-layout-field",Qs),t.component("k-line-field",ti),t.component("k-list-field",ei),t.component("k-multiselect-field",si),t.component("k-number-field",ii),t.component("k-pages-field",ni),t.component("k-password-field",oi),t.component("k-radio-field",ri),t.component("k-range-field",li),t.component("k-select-field",ai),t.component("k-slug-field",ui),t.component("k-structure-field",ci),t.component("k-tags-field",di),t.component("k-text-field",hi),t.component("k-textarea-field",mi),t.component("k-tel-field",pi),t.component("k-time-field",fi),t.component("k-toggle-field",gi),t.component("k-toggles-field",ki),t.component("k-url-field",bi),t.component("k-users-field",vi),t.component("k-writer-field",yi);var $i=Mt({props:{cover:Boolean,ratio:String},computed:{ratioPadding(){return this.$helper.ratio(this.ratio)}}},(function(){var t=this;return(0,t._self._c)("span",{staticClass:"k-aspect-ratio",style:{"padding-bottom":t.ratioPadding},attrs:{"data-cover":t.cover}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;var _i=Mt({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-bar"},[t.$slots.left?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"left"}},[t._t("left")],2):t._e(),t.$slots.center?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"center"}},[t._t("center")],2):t._e(),t.$slots.right?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"right"}},[t._t("right")],2):t._e()])}),[],!1,null,null,null,null).exports;var xi=Mt({props:{theme:{type:String,default:"none"},text:String,html:{type:Boolean,default:!1}}},(function(){var t=this,e=t._self._c;return e("div",t._g({staticClass:"k-box",attrs:{"data-theme":t.theme}},t.$listeners),[t._t("default",(function(){return[t.html?e("k-text",{domProps:{innerHTML:t._s(t.text)}}):e("k-text",[t._v(" "+t._s(t.text)+" ")])]}))],2)}),[],!1,null,null,null,null).exports;var wi=Mt({inheritAttrs:!1,props:{back:String,color:String,element:{type:String,default:"li"},image:Object,link:String,text:String}},(function(){var t=this,e=t._self._c;return e(t.link?"k-link":"p",{tag:"component",staticClass:"k-bubble",style:{color:t.$helper.color(t.color),background:t.$helper.color(t.back)},attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[t.image?e("k-item-image",{attrs:{image:t.image,layout:"list"}}):t._e(),t._v(" "+t._s(t.text)+" ")],1)}),[],!1,null,null,null,null).exports;var Si=Mt({inheritAttrs:!1,props:{bubbles:Array},computed:{items(){let t=this.bubbles;return"string"==typeof t&&(t=t.split(",")),t.map((t=>"string"==typeof t?{text:t}:t))}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-bubbles"},t._l(t.items,(function(s,i){return e("li",{key:i},[e("k-bubble",t._b({},"k-bubble",s,!1))],1)})),0)}),[],!1,null,null,null,null).exports;var Ci=Mt({props:{columns:{type:[Object,Array],default:()=>({})},empty:Object,help:String,items:{type:[Array,Object],default:()=>[]},layout:{type:String,default:"list"},link:{type:Boolean,default:!0},size:String,sortable:Boolean,pagination:{type:[Boolean,Object],default:()=>!1}},computed:{hasPagination(){return!1!==this.pagination&&(!0!==this.paginationOptions.hide&&!(this.pagination.total<=this.pagination.limit))},hasFooter(){return!(!this.hasPagination&&!this.help)},paginationOptions(){return{limit:10,details:!0,keys:!1,total:0,hide:!1,..."object"!=typeof this.pagination?{}:this.pagination}}},watch:{$props(){this.$forceUpdate()}},methods:{onEmpty(t){t.stopPropagation(),this.$emit("empty")},onOption(...t){this.$emit("action",...t),this.$emit("option",...t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-collection"},[t.items.length?e("k-items",{attrs:{columns:t.columns,items:t.items,layout:t.layout,link:t.link,size:t.size,sortable:t.sortable},on:{change:function(e){return t.$emit("change",e)},item:function(e){return t.$emit("item",e)},option:t.onOption,sort:function(e){return t.$emit("sort",e)}},scopedSlots:t._u([{key:"options",fn:function({item:e,itemIndex:s}){return[t._t("options",null,null,{item:e,index:s})]}}],null,!0)}):e("k-empty",t._g(t._b({attrs:{layout:t.layout}},"k-empty",t.empty,!1),t.$listeners.empty?{click:t.onEmpty}:{})),t.hasFooter?e("footer",{staticClass:"k-collection-footer"},[t.help?e("k-text",{staticClass:"k-collection-help",attrs:{theme:"help"},domProps:{innerHTML:t._s(t.help)}}):t._e(),e("div",{staticClass:"k-collection-pagination"},[t.hasPagination?e("k-pagination",t._b({on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.paginationOptions,!1)):t._e()],1)],1):t._e()],1)}),[],!1,null,null,null,null).exports;var Oi=Mt({props:{width:String,sticky:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column",attrs:{"data-width":t.width,"data-sticky":t.sticky}},[e("div",[t._t("default")],2)])}),[],!1,null,null,null,null).exports;var Ai=Mt({props:{disabled:{type:Boolean,default:!1}},data:()=>({files:[],dragging:!1,over:!1}),methods:{cancel(){this.reset()},reset(){this.dragging=!1,this.over=!1},onDrop(t){return!0===this.disabled||!1===this.$helper.isUploadEvent(t)?this.reset():(this.$events.$emit("dropzone.drop"),this.files=t.dataTransfer.files,this.$emit("drop",this.files),void this.reset())},onEnter(t){!1===this.disabled&&this.$helper.isUploadEvent(t)&&(this.dragging=!0)},onLeave(){this.reset()},onOver(t){!1===this.disabled&&this.$helper.isUploadEvent(t)&&(t.dataTransfer.dropEffect="copy",this.over=!0)}}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-dropzone",attrs:{"data-dragging":t.dragging,"data-over":t.over},on:{dragenter:t.onEnter,dragleave:t.onLeave,dragover:t.onOver,drop:t.onDrop}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;var Ti=Mt({props:{text:String,icon:String,layout:{type:String,default:"list"}},computed:{element(){return void 0!==this.$listeners.click?"button":"div"}}},(function(){var t=this,e=t._self._c;return e(t.element,t._g({tag:"component",staticClass:"k-empty",attrs:{"data-layout":t.layout,type:"button"===t.element&&"button"}},t.$listeners),[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),e("p",[t._t("default",(function(){return[t._v(t._s(t.text))]}))],2)],1)}),[],!1,null,null,null,null).exports;var Ii=Mt({props:{details:Array,image:Object,url:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-file-preview"},[e("k-view",{staticClass:"k-file-preview-layout"},[e("div",{staticClass:"k-file-preview-image"},[e("k-link",{staticClass:"k-file-preview-image-link",attrs:{to:t.url,title:t.$t("open"),target:"_blank"}},[e("k-item-image",{attrs:{image:t.image,layout:"cards"}})],1)],1),e("div",{staticClass:"k-file-preview-details"},[e("ul",t._l(t.details,(function(s){return e("li",{key:s.title},[e("h3",[t._v(t._s(s.title))]),e("p",[s.link?e("k-link",{attrs:{to:s.link,tabindex:"-1",target:"_blank"}},[t._v(" /"+t._s(s.text)+" ")]):[t._v(" "+t._s(s.text)+" ")]],2)])})),0)])])],1)}),[],!1,null,null,null,null).exports;var Mi=Mt({props:{gutter:String}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-grid",attrs:{"data-gutter":t.gutter}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;var Li=Mt({props:{editable:Boolean,tab:String,tabs:{type:Array,default:()=>[]}},computed:{tabsWithBadges(){const t=Object.keys(this.$store.getters["content/changes"]());return this.tabs.map((e=>{let s=[];return Object.values(e.columns).forEach((t=>{Object.values(t.sections).forEach((t=>{"fields"===t.type&&Object.keys(t.fields).forEach((t=>{s.push(t)}))}))})),e.badge=s.filter((e=>t.includes(e.toLowerCase()))).length,e}))}}},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-header",attrs:{"data-editable":t.editable,"data-tabs":t.tabsWithBadges.length>1}},[e("k-headline",{attrs:{tag:"h1",size:"huge"}},[t.editable&&t.$listeners.edit?e("span",{staticClass:"k-headline-editable",on:{click:function(e){return t.$emit("edit")}}},[t._t("default"),e("k-icon",{attrs:{type:"edit"}})],2):t._t("default")],2),t.$slots.left||t.$slots.right?e("k-bar",{staticClass:"k-header-buttons",scopedSlots:t._u([{key:"left",fn:function(){return[t._t("left")]},proxy:!0},{key:"right",fn:function(){return[t._t("right")]},proxy:!0}],null,!0)}):t._e(),e("k-tabs",{attrs:{tab:t.tab,tabs:t.tabsWithBadges,theme:"notice"}})],1)}),[],!1,null,null,null,null).exports;var Ei=Mt({inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-panel",{staticClass:"k-panel-inside",attrs:{tabindex:"0"}},[e("header",{staticClass:"k-panel-header"},[e("k-topbar",{attrs:{breadcrumb:t.$view.breadcrumb,license:t.$license,menu:t.$menu,view:t.$view}})],1),e("main",{staticClass:"k-panel-view scroll-y"},[t._t("default")],2),t._t("footer")],2)}),[],!1,null,null,null,null).exports;var ji=Mt({inheritAttrs:!1,props:{data:Object,flag:Object,image:[Object,Boolean],info:String,layout:{type:String,default:"list"},link:{type:[Boolean,String,Function]},options:{type:[Array,Function,String]},sortable:Boolean,target:String,text:String,width:String},computed:{hasFigure(){return!1!==this.image&&Object.keys(this.image).length>0},title(){return this.text||"-"}},methods:{onOption(t){this.$emit("action",t),this.$emit("option",t)}}},(function(){var t=this,e=t._self._c;return e("article",t._b({staticClass:"k-item",class:!!t.layout&&"k-"+t.layout+"-item",attrs:{"data-has-figure":t.hasFigure,"data-has-flag":Boolean(t.flag),"data-has-info":Boolean(t.info),"data-has-options":Boolean(t.options),tabindex:"-1"},on:{click:function(e){return t.$emit("click",e)},dragstart:function(e){return t.$emit("drag",e)}}},"article",t.data,!1),[t._t("image",(function(){return[t.hasFigure?e("k-item-image",{attrs:{image:t.image,layout:t.layout,width:t.width}}):t._e()]})),t.sortable?e("k-sort-handle",{staticClass:"k-item-sort-handle"}):t._e(),e("header",{staticClass:"k-item-content"},[t._t("default",(function(){return[e("h3",{staticClass:"k-item-title"},[!1!==t.link?e("k-link",{staticClass:"k-item-title-link",attrs:{target:t.target,to:t.link}},[e("span",{domProps:{innerHTML:t._s(t.title)}})]):e("span",{domProps:{innerHTML:t._s(t.title)}})],1),t.info?e("p",{staticClass:"k-item-info",domProps:{innerHTML:t._s(t.info)}}):t._e()]}))],2),t.flag||t.options||t.$slots.options?e("footer",{staticClass:"k-item-footer"},[e("nav",{staticClass:"k-item-buttons",on:{click:function(t){t.stopPropagation()}}},[t.flag?e("k-status-icon",t._b({},"k-status-icon",t.flag,!1)):t._e(),t._t("options",(function(){return[t.options?e("k-options-dropdown",{staticClass:"k-item-options-dropdown",attrs:{options:t.options},on:{option:t.onOption}}):t._e()]}))],2)]):t._e()],2)}),[],!1,null,null,null,null).exports;var Bi=Mt({inheritAttrs:!1,props:{image:[Object,Boolean],layout:{type:String,default:"list"},width:String},computed:{back(){return this.image.back||"black"},ratio(){return"cards"===this.layout&&this.image.ratio||"1/1"},size(){switch(this.layout){case"cards":return"large";case"cardlets":return"medium";default:return"regular"}},sizes(){switch(this.width){case"1/2":case"2/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 44em, 27em";case"1/3":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 29.333em, 27em";case"1/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 22em, 27em";case"2/3":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 27em, 27em";case"3/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 66em, 27em";default:return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 88em, 27em"}}}},(function(){var t=this,e=t._self._c;return t.image?e("div",{staticClass:"k-item-figure",style:{background:t.$helper.color(t.back)}},[t.image.src?e("k-image",{staticClass:"k-item-image",attrs:{cover:t.image.cover,ratio:t.ratio,sizes:t.sizes,src:t.image.src,srcset:t.image.srcset}}):e("k-aspect-ratio",{attrs:{ratio:t.ratio}},[e("k-icon",{staticClass:"k-item-icon",attrs:{color:t.$helper.color(t.image.color),type:t.image.icon}})],1)],1):t._e()}),[],!1,null,null,null,null).exports;var Di=Mt({inheritAttrs:!1,props:{columns:{type:[Object,Array],default:()=>({})},items:{type:Array,default:()=>[]},layout:{type:String,default:"list"},link:{type:Boolean,default:!0},image:{type:[Object,Boolean],default:()=>({})},sortable:Boolean,empty:{type:[String,Object]},size:{type:String,default:"default"}},computed:{dragOptions(){return{sort:this.sortable,disabled:!1===this.sortable,draggable:".k-draggable-item"}},table(){return{columns:this.columns,rows:this.items,sortable:this.sortable}}},methods:{onDragStart(t,e){this.$store.dispatch("drag",{type:"text",data:e})},onOption(t,e,s){this.$emit("option",t,e,s)},imageOptions(t){let e=this.image,s=t.image;return!1!==e&&!1!==s&&("object"!=typeof e&&(e={}),"object"!=typeof s&&(s={}),{...s,...e})}}},(function(){var t=this,e=t._self._c;return"table"===t.layout?e("k-table",t._b({on:{change:function(e){return t.$emit("change",e)},sort:function(e){return t.$emit("sort",e)},option:t.onOption}},"k-table",t.table,!1)):e("k-draggable",{staticClass:"k-items",class:"k-"+t.layout+"-items",attrs:{handle:!0,options:t.dragOptions,"data-layout":t.layout,"data-size":t.size,list:t.items},on:{change:function(e){return t.$emit("change",e)},end:function(e){return t.$emit("sort",t.items,e)}}},t._l(t.items,(function(s,i){return e("k-item",t._b({key:s.id||i,class:{"k-draggable-item":t.sortable&&s.sortable},attrs:{image:t.imageOptions(s),layout:t.layout,link:!!t.link&&s.link,sortable:t.sortable&&s.sortable,width:s.column},on:{click:function(e){return t.$emit("item",s,i)},drag:function(e){return t.onDragStart(e,s.dragText)},option:function(e){return t.onOption(e,s,i)}},nativeOn:{mouseover:function(e){return t.$emit("hover",e,s,i)}},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options",null,null,{item:s,itemIndex:i})]},proxy:!0}],null,!0)},"k-item",s,!1))})),1)}),[],!1,null,null,null,null).exports;var Pi=Mt({inheritAttrs:!0,props:{autofocus:{type:Boolean,default:!0},centered:{type:Boolean,default:!1},dimmed:{type:Boolean,default:!0},loading:{type:Boolean,default:!1}},data:()=>({isOpen:!1,scrollTop:0}),methods:{close(){!1!==this.isOpen&&(this.isOpen=!1,this.$emit("close"),this.restoreScrollPosition(),this.$events.$off("keydown.esc",this.close))},focus(){var t,e;let s=this.$refs.overlay.querySelector("\n [autofocus],\n [data-autofocus]\n ");return null===s&&(s=this.$refs.overlay.querySelector("\n input,\n textarea,\n select,\n button\n ")),"function"==typeof(null==s?void 0:s.focus)?s.focus():"function"==typeof(null==(e=null==(t=this.$slots.default[0])?void 0:t.context)?void 0:e.focus)?this.$slots.default[0].context.focus():void 0},open(){!0!==this.isOpen&&(this.storeScrollPosition(),this.isOpen=!0,this.$emit("open"),this.$events.$on("keydown.esc",this.close),setTimeout((()=>{!0===this.autofocus&&this.focus(),document.querySelector(".k-overlay > *").addEventListener("mousedown",(t=>t.stopPropagation())),this.$emit("ready")}),1))},restoreScrollPosition(){const t=document.querySelector(".k-panel-view");(null==t?void 0:t.scrollTop)&&(t.scrollTop=this.scrollTop)},storeScrollPosition(){const t=document.querySelector(".k-panel-view");(null==t?void 0:t.scrollTop)?this.scrollTop=t.scrollTop:this.scrollTop=0}}},(function(){var t=this,e=t._self._c;return t.isOpen?e("portal",[e("div",t._g({ref:"overlay",staticClass:"k-overlay",class:t.$vnode.data.staticClass,attrs:{"data-centered":t.loading||t.centered,"data-dimmed":t.dimmed,"data-loading":t.loading,dir:t.$translation.direction},on:{mousedown:t.close}},t.$listeners),[t.loading?e("k-loader",{staticClass:"k-overlay-loader"}):t._t("default",null,{close:t.close,isOpen:t.isOpen})],2)]):t._e()}),[],!1,null,null,null,null).exports;var Ni=Mt({computed:{defaultLanguage(){return!!this.$language&&this.$language.default},dialog(){return this.$helper.clone(this.$store.state.dialog)},language(){return this.$language?this.$language.code:null},role(){return this.$user?this.$user.role:null},user(){return this.$user?this.$user.id:null}},created(){this.$events.$on("drop",this.drop)},destroyed(){this.$events.$off("drop",this.drop)},methods:{drop(){this.$store.dispatch("drag",null)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-panel",attrs:{"data-dragging":t.$store.state.drag,"data-loading":t.$store.state.isLoading,"data-language":t.language,"data-language-default":t.defaultLanguage,"data-role":t.role,"data-translation":t.$translation.code,"data-user":t.user,dir:t.$translation.direction}},[t._t("default"),t.$store.state.dialog&&t.$store.state.dialog.props?[e("k-fiber-dialog",t._b({},"k-fiber-dialog",t.dialog,!1))]:t._e(),!1!==t.$store.state.fatal?e("k-fatal",{attrs:{html:t.$store.state.fatal}}):t._e(),!1===t.$system.isLocal?e("k-offline-warning"):t._e(),e("k-icons")],2)}),[],!1,null,null,null,null).exports;var qi=Mt({props:{reports:Array,size:{type:String,default:"large"}}},(function(){var t=this,e=t._self._c;return e("dl",{staticClass:"k-stats",attrs:{"data-size":t.size}},t._l(t.reports,(function(s,i){return e(s.link?"k-link":"div",{key:i,tag:"component",staticClass:"k-stat",attrs:{"data-theme":s.theme,"data-click":!!s.click,to:s.link},on:{click:function(t){s.click&&s.click()}}},[e("dt",{staticClass:"k-stat-label"},[t._v(t._s(s.label))]),e("dd",{staticClass:"k-stat-value"},[t._v(t._s(s.value))]),e("dd",{staticClass:"k-stat-info"},[t._v(t._s(s.info))])])})),1)}),[],!1,null,null,null,null).exports;var Fi=Mt({inheritAttrs:!1,props:{columns:Object,disabled:Boolean,fields:{type:Object,default:()=>({})},empty:String,index:{type:[Number,Boolean],default:1},rows:Array,options:[Array,Function],sortable:Boolean},data(){return{values:this.rows}},computed:{columnsCount(){return Object.keys(this.columns).length},dragOptions(){return{disabled:!this.sortable,fallbackClass:"k-table-row-fallback",ghostClass:"k-table-row-ghost"}},hasIndexColumn(){return this.sortable||!1!==this.index},hasOptions(){return this.options||Object.values(this.values).filter((t=>t.options)).length>0}},watch:{rows(){this.values=this.rows}},methods:{isColumnEmpty(t){return 0===this.rows.filter((e=>!1===this.$helper.object.isEmpty(e[t]))).length},label(t,e){return t.label||this.$helper.string.ucfirst(e)},onChange(t){this.$emit("change",t)},onCell(t){this.$emit("cell",t)},onCellUpdate({columnIndex:t,rowIndex:e,value:s}){this.values[e][t]=s,this.$emit("input",this.values)},onHeader(t){this.$emit("header",t)},onOption(t,e,s){this.$emit("option",t,e,s)},onSort(){this.$emit("input",this.values),this.$emit("sort",this.values)},width(t){return"string"!=typeof t?"auto":!1===t.includes("/")?t:this.$helper.ratio(t,"auto",!1)}}},(function(){var t=this,e=t._self._c;return e("table",{staticClass:"k-table",attrs:{"data-disabled":t.disabled,"data-indexed":t.hasIndexColumn}},[e("thead",[e("tr",[t.hasIndexColumn?e("th",{staticClass:"k-table-index-column",attrs:{"data-mobile":""}},[t._v(" # ")]):t._e(),t._l(t.columns,(function(s,i){return e("th",{key:i+"-header",staticClass:"k-table-column",style:"width:"+t.width(s.width),attrs:{"data-mobile":s.mobile},on:{click:function(e){return t.onHeader({column:s,columnIndex:i})}}},[t._t("header",(function(){return[t._v(" "+t._s(t.label(s,i))+" ")]}),null,{column:s,columnIndex:i,label:t.label(s,i)})],2)})),t.hasOptions?e("th",{staticClass:"k-table-options-column",attrs:{"data-mobile":""}}):t._e()],2)]),e("k-draggable",{attrs:{list:t.values,options:t.dragOptions,handle:!0,element:"tbody"},on:{change:t.onChange,end:t.onSort}},[0===t.rows.length?e("tr",[e("td",{staticClass:"k-table-empty",attrs:{colspan:t.columnsCount}},[t._v(" "+t._s(t.empty)+" ")])]):t._l(t.values,(function(s,i){return e("tr",{key:i},[t.hasIndexColumn?e("td",{staticClass:"k-table-index-column",attrs:{"data-sortable":t.sortable&&!1!==s.sortable,"data-mobile":""}},[t._t("index",(function(){return[e("div",{staticClass:"k-table-index",domProps:{textContent:t._s(t.index+i)}})]}),null,{row:s,rowIndex:i}),t.sortable&&!1!==s.sortable?e("k-sort-handle",{staticClass:"k-table-sort-handle"}):t._e()],2):t._e(),t._l(t.columns,(function(n,o){return e("k-table-cell",{key:i+"-"+o,staticClass:"k-table-column",style:"width:"+t.width(n.width),attrs:{column:n,field:t.fields[o],row:s,mobile:n.mobile,value:s[o]},on:{input:function(e){return t.onCellUpdate({columnIndex:o,rowIndex:i,value:e})}},nativeOn:{click:function(e){return t.onCell({row:s,rowIndex:i,column:n,columnIndex:o})}}})})),t.hasOptions?e("td",{staticClass:"k-table-options-column",attrs:{"data-mobile":""}},[t._t("options",(function(){return[e("k-options-dropdown",{attrs:{options:s.options||t.options,text:(s.options||t.options).length>1},on:{option:function(e){return t.onOption(e,s,i)}}})]}),null,{row:s,rowIndex:i,options:t.options})],2):t._e()],2)}))],2)],1)}),[],!1,null,null,null,null).exports;var Ri=Mt({inheritAttrs:!1,props:{column:Object,field:Object,mobile:{type:Boolean,default:!1},row:Object,value:{default:""}},computed:{component(){return this.$helper.isComponent(`k-${this.type}-field-preview`)?`k-${this.type}-field-preview`:this.$helper.isComponent(`k-table-${this.type}-cell`)?`k-table-${this.type}-cell`:Array.isArray(this.value)?"k-array-field-preview":"k-text-field-preview"},type(){var t;return this.column.type||(null==(t=this.field)?void 0:t.type)}}},(function(){var t=this,e=t._self._c;return e("td",{attrs:{"data-align":t.column.align,"data-mobile":t.mobile}},[!1===t.$helper.object.isEmpty(t.value)?[e(t.component,{tag:"component",attrs:{column:t.column,field:t.field,row:t.row,value:t.value},on:{input:function(e){return t.$emit("input",e)}}})]:t._e()],2)}),[],!1,null,null,null,null).exports;var zi=Mt({props:{tab:String,tabs:Array,theme:String},data(){return{size:null,visibleTabs:this.tabs,invisibleTabs:[]}},computed:{current(){return(this.tabs.find((t=>t.name===this.tab))||this.tabs[0]||{}).name}},watch:{tabs:{handler(t){this.visibleTabs=t,this.invisibleTabs=[],this.resize(!0)},immediate:!0}},created(){window.addEventListener("resize",this.resize)},destroyed(){window.removeEventListener("resize",this.resize)},methods:{resize(t){if(this.tabs&&!(this.tabs.length<=1)){if(this.tabs.length<=3)return this.visibleTabs=this.tabs,void(this.invisibleTabs=[]);if(window.innerWidth>=700){if("large"===this.size&&!t)return;this.visibleTabs=this.tabs,this.invisibleTabs=[],this.size="large"}else{if("small"===this.size&&!t)return;this.visibleTabs=this.tabs.slice(0,2),this.invisibleTabs=this.tabs.slice(2),this.size="small"}}}}},(function(){var t=this,e=t._self._c;return t.tabs&&t.tabs.length>1?e("div",{staticClass:"k-tabs",attrs:{"data-theme":t.theme}},[e("nav",[t._l(t.visibleTabs,(function(s){return e("k-button",{key:s.name,staticClass:"k-tab-button",attrs:{link:s.link,current:t.current===s.name,icon:s.icon,tooltip:s.label}},[t._v(" "+t._s(s.label||s.text||s.name)+" "),s.badge?e("span",{staticClass:"k-tabs-badge"},[t._v(" "+t._s(s.badge)+" ")]):t._e()])})),t.invisibleTabs.length?e("k-button",{staticClass:"k-tab-button k-tabs-dropdown-button",attrs:{text:t.$t("more"),icon:"dots"},on:{click:function(e){return e.stopPropagation(),t.$refs.more.toggle()}}}):t._e()],2),t.invisibleTabs.length?e("k-dropdown-content",{ref:"more",staticClass:"k-tabs-dropdown",attrs:{align:"right"}},t._l(t.invisibleTabs,(function(s){return e("k-dropdown-item",{key:"more-"+s.name,attrs:{link:s.link,current:t.tab===s.name,icon:s.icon,tooltip:s.label}},[t._v(" "+t._s(s.label||s.text||s.name)+" ")])})),1):t._e()],1):t._e()}),[],!1,null,null,null,null).exports;var Yi=Mt({props:{align:String}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-view",attrs:{"data-align":t.align}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;var Hi=Mt({components:{draggable:N},props:{data:Object,element:String,handle:[String,Boolean],list:[Array,Object],move:Function,options:Object},data(){return{listeners:{...this.$listeners,start:t=>{this.$store.dispatch("drag",{}),this.$listeners.start&&this.$listeners.start(t)},end:t=>{this.$store.dispatch("drag",null),this.$listeners.end&&this.$listeners.end(t)}}}},computed:{dragOptions(){let t=!1;return t=!0===this.handle?".k-sort-handle":this.handle,{fallbackClass:"k-sortable-fallback",fallbackOnBody:!0,forceFallback:!0,ghostClass:"k-sortable-ghost",handle:t,scroll:document.querySelector(".k-panel-view"),...this.options}}}},(function(){var t=this;return(0,t._self._c)("draggable",t._g(t._b({staticClass:"k-draggable",attrs:{"component-data":t.data,tag:t.element,list:t.list,move:t.move},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("footer")]},proxy:!0}],null,!0)},"draggable",t.dragOptions,!1),t.listeners),[t._t("default")],2)}),[],!1,null,null,null,null).exports;var Ui=Mt({data:()=>({error:null}),errorCaptured(t){return this.$config.debug&&window.console.warn(t),this.error=t,!1},render(t){return this.error?this.$slots.error?this.$slots.error[0]:this.$scopedSlots.error?this.$scopedSlots.error({error:this.error}):t("k-box",{attrs:{theme:"negative"}},this.error.message||this.error):this.$slots.default[0]}},null,null,!1,null,null,null,null).exports;var Ki=Mt({props:{html:String},mounted(){try{let t=this.$refs.iframe.contentWindow.document;t.open(),t.write(this.html),t.close()}catch(t){console.error(t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-fatal"},[e("div",{staticClass:"k-fatal-box"},[e("k-bar",{scopedSlots:t._u([{key:"left",fn:function(){return[e("k-headline",[t._v(" The JSON response could not be parsed ")])]},proxy:!0},{key:"right",fn:function(){return[e("k-button",{attrs:{icon:"cancel",text:"Close"},on:{click:function(e){return t.$store.dispatch("fatal",!1)}}})]},proxy:!0}])}),e("iframe",{ref:"iframe",staticClass:"k-fatal-iframe"})],1)])}),[],!1,null,null,null,null).exports;var Ji=Mt({props:{link:String,size:{type:String},tag:{type:String,default:"h2"},theme:{type:String}}},(function(){var t=this,e=t._self._c;return e(t.tag,t._g({tag:"component",staticClass:"k-headline",attrs:{"data-theme":t.theme,"data-size":t.size}},t.$listeners),[t.link?e("k-link",{attrs:{to:t.link}},[t._t("default")],2):t._t("default")],2)}),[],!1,null,null,null,null).exports;var Gi=Mt({props:{alt:String,color:String,back:String,size:String,type:String},computed:{isEmoji(){return this.$helper.string.hasEmoji(this.type)}}},(function(){var t=this,e=t._self._c;return e("span",{class:"k-icon k-icon-"+t.type,style:{background:t.$helper.color(t.back)},attrs:{"aria-label":t.alt,role:t.alt?"img":null,"aria-hidden":!t.alt,"data-back":t.back,"data-size":t.size}},[t.isEmoji?e("span",{staticClass:"k-icon-emoji"},[t._v(t._s(t.type))]):e("svg",{style:{color:t.$helper.color(t.color)},attrs:{viewBox:"0 0 16 16"}},[e("use",{attrs:{"xlink:href":"#icon-"+t.type}})])])}),[],!1,null,null,null,null).exports;var Vi=Mt({icons:window.panel.plugins.icons},(function(){var t=this,e=t._self._c;return e("svg",{staticClass:"k-icons",attrs:{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",overflow:"hidden"}},[e("defs",t._l(t.$options.icons,(function(s,i){return e("symbol",{key:i,attrs:{id:"icon-"+i,viewBox:"0 0 16 16"},domProps:{innerHTML:t._s(s)}})})),0)])}),[],!1,null,null,null,null).exports;var Wi=Mt({props:{alt:String,back:String,cover:Boolean,ratio:String,sizes:String,src:String,srcset:String},data:()=>({loaded:{type:Boolean,default:!1},error:{type:Boolean,default:!1}}),computed:{ratioPadding(){return this.$helper.ratio(this.ratio||"1/1")}},created(){let t=new Image;t.onload=()=>{this.loaded=!0,this.$emit("load")},t.onerror=()=>{this.error=!0,this.$emit("error")},t.src=this.src}},(function(){var t=this,e=t._self._c;return e("span",t._g({staticClass:"k-image",attrs:{"data-ratio":t.ratio,"data-back":t.back,"data-cover":t.cover}},t.$listeners),[e("span",{style:"padding-bottom:"+t.ratioPadding},[t.loaded?e("img",{key:t.src,attrs:{alt:t.alt||"",src:t.src,srcset:t.srcset,sizes:t.sizes},on:{dragstart:function(t){t.preventDefault()}}}):t._e(),t.loaded||t.error?t._e():e("k-loader",{attrs:{position:"center",theme:"light"}}),!t.loaded&&t.error?e("k-icon",{staticClass:"k-image-error",attrs:{type:"cancel"}}):t._e()],1)])}),[],!1,null,null,null,null).exports;var Xi=Mt({},(function(){var t=this._self._c;return t("span",{staticClass:"k-loader"},[t("k-icon",{staticClass:"k-loader-icon",attrs:{type:"loader"}})],1)}),[],!1,null,null,null,null).exports;var Zi=Mt({data:()=>({offline:!1}),created(){this.$events.$on("offline",this.isOffline),this.$events.$on("online",this.isOnline)},destroyed(){this.$events.$off("offline",this.isOffline),this.$events.$off("online",this.isOnline)},methods:{isOnline(){this.offline=!1},isOffline(){this.offline=!0}}},(function(){var t=this,e=t._self._c;return t.offline?e("div",{staticClass:"k-offline-warning"},[e("p",[e("k-icon",{attrs:{type:"bolt"}}),t._v(" "+t._s(t.$t("error.offline")))],1)]):t._e()}),[],!1,null,null,null,null).exports;const Qi=(t,e=!1)=>{if(t>=0&&t<=100)return!0;if(e)throw new Error("value has to be between 0 and 100");return!1};var tn=Mt({props:{value:{type:Number,default:0,validator:Qi}},data(){return{state:this.value}},watch:{value(t){this.state=t}},methods:{set(t){Qi(t,!0),this.state=t}}},(function(){var t=this;return(0,t._self._c)("progress",{staticClass:"k-progress",attrs:{max:"100"},domProps:{value:t.state}},[t._v(t._s(t.state)+"%")])}),[],!1,null,null,null,null).exports;var en=Mt({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-registration"},[e("p",[t._v(t._s(t.$t("license.unregistered")))]),e("k-button",{staticClass:"k-topbar-button",attrs:{responsive:!0,tooltip:t.$t("license.unregistered"),icon:"key"},on:{click:function(e){return t.$dialog("registration")}}},[t._v(" "+t._s(t.$t("license.register"))+" ")]),e("k-button",{staticClass:"k-topbar-button",attrs:{responsive:!0,link:"https://getkirby.com/buy",target:"_blank",icon:"cart"}},[t._v(" "+t._s(t.$t("license.buy"))+" ")])],1)}),[],!1,null,null,null,null).exports;var sn=Mt({props:{icon:{type:String,default:"sort"}}},(function(){return(0,this._self._c)("k-icon",{staticClass:"k-sort-handle",attrs:{type:this.icon,"aria-hidden":"true"}})}),[],!1,null,null,null,null).exports;var nn=Mt({props:{click:{type:Function,default:()=>{}},disabled:Boolean,responsive:Boolean,status:String,text:String,tooltip:String},computed:{icon(){return"draft"===this.status?"circle-outline":"unlisted"===this.status?"circle-half":"circle"},theme(){return"draft"===this.status?"negative":"unlisted"===this.status?"info":"positive"},title(){let t=this.tooltip||this.text;return this.disabled&&(t+=` (${this.$t("disabled")})`),t}},methods:{onClick(){this.click(),this.$emit("click")}}},(function(){var t=this;return(0,t._self._c)("k-button",{class:"k-status-icon k-status-icon-"+t.status,attrs:{disabled:t.disabled,icon:t.icon,responsive:t.responsive,text:t.text,theme:t.theme,tooltip:t.title},on:{click:t.onClick}})}),[],!1,null,null,null,null).exports;var on=Mt({props:{align:String,size:String,theme:String}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-text",attrs:{"data-align":t.align,"data-size":t.size,"data-theme":t.theme}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;var rn=Mt({props:{user:[Object,String]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-user-info"},[t.user.avatar?e("k-image",{attrs:{cover:!0,src:t.user.avatar.url,ratio:"1/1"}}):e("k-icon",{attrs:{type:"user"}}),t._v(" "+t._s(t.user.name||t.user.email||t.user)+" ")],1)}),[],!1,null,null,null,null).exports;var ln=Mt({props:{crumbs:{type:Array,default:()=>[]},label:{type:String,default:"Breadcrumb"},view:Object},computed:{dropdown(){return this.segments.map((t=>({...t,text:t.label,icon:"angle-right"})))},segments(){return[{link:this.view.link,label:this.view.breadcrumbLabel,icon:this.view.icon,loading:this.$store.state.isLoading},...this.crumbs]}},methods:{isLast(t){return this.crumbs.length-1===t}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-breadcrumb",attrs:{"aria-label":t.label}},[e("k-dropdown",{staticClass:"k-breadcrumb-dropdown"},[e("k-button",{attrs:{icon:"road-sign"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.dropdown,theme:"light"}})],1),e("ol",t._l(t.segments,(function(s,i){return e("li",{key:i},[e("k-link",{staticClass:"k-breadcrumb-link",attrs:{title:s.text||s.label,to:s.link,"aria-current":!!t.isLast(i)&&"page"}},[s.loading?e("k-loader",{staticClass:"k-breadcrumb-icon"}):s.icon?e("k-icon",{staticClass:"k-breadcrumb-icon",attrs:{type:s.icon}}):t._e(),e("span",{staticClass:"k-breadcrumb-link-text"},[t._v(" "+t._s(s.text||s.label)+" ")])],1)],1)})),0)],1)}),[],!1,null,null,null,null).exports;var an=Mt({inheritAttrs:!1,props:{autofocus:Boolean,click:Function,current:[String,Boolean],disabled:Boolean,icon:String,id:[String,Number],link:String,responsive:Boolean,rel:String,role:String,target:String,tabindex:String,text:[String,Number],theme:String,tooltip:String,type:{type:String,default:"button"}},computed:{component(){return!0===this.disabled?"k-button-disabled":this.link?"k-button-link":"k-button-native"}},methods:{focus(){this.$refs.button.focus&&this.$refs.button.focus()},tab(){this.$refs.button.tab&&this.$refs.button.tab()},untab(){this.$refs.button.untab&&this.$refs.button.untab()}}},(function(){var t=this;return(0,t._self._c)(t.component,t._g(t._b({ref:"button",tag:"component"},"component",t.$props,!1),t.$listeners),[t.text?[t._v(" "+t._s(t.text)+" ")]:t._t("default")],2)}),[],!1,null,null,null,null).exports;var un=Mt({inheritAttrs:!1,props:{icon:String,id:[String,Number],responsive:Boolean,theme:String,tooltip:String}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-button",attrs:{id:t.id,"data-disabled":!0,"data-responsive":t.responsive,"data-theme":t.theme,title:t.tooltip}},[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports;var cn=Mt({props:{buttons:Array}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-button-group"},[t.$slots.default?t._t("default"):t._l(t.buttons,(function(s,i){return e("k-button",t._b({key:i},"k-button",s,!1))}))],2)}),[],!1,null,null,null,null).exports;var dn=Mt({inheritAttrs:!1,props:{autofocus:Boolean,current:[String,Boolean],icon:String,id:[String,Number],link:String,rel:String,responsive:Boolean,role:String,target:String,tabindex:String,theme:String,tooltip:String},methods:{focus(){this.$el.focus()}}},(function(){var t=this,e=t._self._c;return e("k-link",t._g({staticClass:"k-button",attrs:{id:t.id,"aria-current":t.current,autofocus:t.autofocus,"data-theme":t.theme,"data-responsive":t.responsive,rel:t.rel,role:t.role,tabindex:t.tabindex,target:t.target,title:t.tooltip,to:t.link}},t.$listeners),[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports,pn={mounted(){this.$el.addEventListener("keyup",this.onTab,!0),this.$el.addEventListener("blur",this.onUntab,!0)},destroyed(){this.$el.removeEventListener("keyup",this.onTab,!0),this.$el.removeEventListener("blur",this.onUntab,!0)},methods:{focus(){this.$el.focus&&this.$el.focus()},onTab(t){9===t.keyCode&&this.$el.setAttribute("data-tabbed",!0)},onUntab(){this.$el.removeAttribute("data-tabbed")},tab(){this.$el.focus(),this.$el.setAttribute("data-tabbed",!0)},untab(){this.$el.removeAttribute("data-tabbed")}}};var hn=Mt({mixins:[pn],inheritAttrs:!1,props:{autofocus:Boolean,click:{type:Function,default:()=>{}},current:[String,Boolean],icon:String,id:[String,Number],responsive:Boolean,role:String,tabindex:String,theme:String,tooltip:String,type:{type:String,default:"button"}}},(function(){var t=this,e=t._self._c;return e("button",t._g({staticClass:"k-button",attrs:{id:t.id,"aria-current":t.current,autofocus:t.autofocus,"data-theme":t.theme,"data-responsive":t.responsive,role:t.role,tabindex:t.tabindex,title:t.tooltip,type:t.type},on:{click:t.click}},t.$listeners),[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports;var mn=Mt({},(function(){return(0,this._self._c)("span",{staticClass:"k-dropdown",on:{click:function(t){t.stopPropagation()}}},[this._t("default")],2)}),[],!1,null,null,null,null).exports;let fn=null;var gn=Mt({props:{align:{type:String,default:"left"},options:[Array,Function,String],theme:{type:String,default:"dark"}},data:()=>({current:-1,dropup:!1,isOpen:!1,items:[]}),methods:{async fetchOptions(t){if(!this.options)return t(this.items);"string"==typeof this.options?this.$dropdown(this.options)(t):"function"==typeof this.options?this.options(t):Array.isArray(this.options)&&t(this.options)},onOptionClick(t){"function"==typeof t.click?t.click.call(this):t.click&&this.$emit("action",t.click)},open(){this.reset(),fn&&fn!==this&&fn.close(),this.fetchOptions((t=>{this.$events.$on("keydown",this.navigate),this.$events.$on("click",this.close),this.items=t,this.isOpen=!0,fn=this,this.onOpen(),this.$emit("open")}))},reset(){this.current=-1,this.$events.$off("keydown",this.navigate),this.$events.$off("click",this.close)},close(){this.reset(),this.isOpen=fn=!1,this.$emit("close")},toggle(){this.isOpen?this.close():this.open()},focus(t=0){var e;(null==(e=this.$children[t])?void 0:e.focus)&&(this.current=t,this.$children[t].focus())},onOpen(){this.dropup=!1,this.$nextTick((()=>{if(this.$el){let t=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,e=50,s=this.$el.getBoundingClientRect().top||0,i=this.$el.clientHeight;s+i>t-e&&i+2*ethis.$children.length-1){const t=this.$children.filter((t=>!1===t.disabled));this.current=this.$children.indexOf(t[t.length-1]);break}if(this.$children[this.current]&&!1===this.$children[this.current].disabled){this.focus(this.current);break}}break;case"Tab":for(;;){if(this.current++,this.current>this.$children.length-1){this.close(),this.$emit("leave",t.code);break}if(this.$children[this.current]&&!1===this.$children[this.current].disabled)break}}}}},(function(){var t=this,e=t._self._c;return t.isOpen?e("div",{staticClass:"k-dropdown-content",attrs:{"data-align":t.align,"data-dropup":t.dropup,"data-theme":t.theme}},[t._t("default",(function(){return[t._l(t.items,(function(s,i){return["-"===s?e("hr",{key:t._uid+"-item-"+i}):e("k-dropdown-item",t._b({key:t._uid+"-item-"+i,ref:t._uid+"-item-"+i,refInFor:!0,on:{click:function(e){return t.onOptionClick(s)}}},"k-dropdown-item",s,!1),[t._v(" "+t._s(s.text)+" ")])]}))]}))],2):t._e()}),[],!1,null,null,null,null).exports;var kn=Mt({inheritAttrs:!1,props:{disabled:Boolean,icon:String,image:[String,Object],link:String,target:String,theme:String,upload:String,current:[String,Boolean]},data(){return{listeners:{...this.$listeners,click:t=>{this.$parent.close(),this.$emit("click",t)}}}},methods:{focus(){this.$refs.button.focus()},tab(){this.$refs.button.tab()}}},(function(){var t=this;return(0,t._self._c)("k-button",t._g(t._b({ref:"button",staticClass:"k-dropdown-item"},"k-button",t.$props,!1),t.listeners),[t._t("default")],2)}),[],!1,null,null,null,null).exports;var bn=Mt({mixins:[pn],props:{disabled:Boolean,rel:String,tabindex:[String,Number],target:String,title:String,to:[String,Function]},data(){return{relAttr:"_blank"===this.target?"noreferrer noopener":this.rel,listeners:{...this.$listeners,click:this.onClick}}},computed:{href(){return"function"==typeof this.to?"":"/"!==this.to[0]||this.target?!0===this.to.includes("@")&&!1===this.to.includes("/")?"mailto:"+this.to:this.to:this.$url(this.to)}},methods:{isRoutable(t){if(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)return!1;if(t.defaultPrevented)return!1;if(void 0!==t.button&&0!==t.button)return!1;if(this.target)return!1;if("string"==typeof this.href){if(this.href.includes("://")||this.href.startsWith("//"))return!1;if(this.href.includes("mailto:"))return!1}return!0},onClick(t){if(!0===this.disabled)return t.preventDefault(),!1;"function"==typeof this.to&&(t.preventDefault(),this.to()),this.isRoutable(t)&&(t.preventDefault(),this.$go(this.to)),this.$emit("click",t)}}},(function(){var t=this,e=t._self._c;return t.to&&!t.disabled?e("a",t._g({ref:"link",staticClass:"k-link",attrs:{href:t.href,rel:t.relAttr,tabindex:t.tabindex,target:t.target,title:t.title}},t.listeners),[t._t("default")],2):e("span",{staticClass:"k-link",attrs:{title:t.title,"data-disabled":""}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;var vn=Mt({computed:{defaultLanguage(){return this.$languages.find((t=>!0===t.default))},language(){return this.$language},languages(){return this.$languages.filter((t=>!1===t.default))}},methods:{change(t){this.$emit("change",t),this.$go(window.location,{query:{language:t.code}})}}},(function(){var t=this,e=t._self._c;return t.languages.length?e("k-dropdown",{staticClass:"k-languages-dropdown"},[e("k-button",{attrs:{text:t.language.name,responsive:!0,icon:"globe"},on:{click:function(e){return t.$refs.languages.toggle()}}}),t.languages?e("k-dropdown-content",{ref:"languages"},[e("k-dropdown-item",{on:{click:function(e){return t.change(t.defaultLanguage)}}},[t._v(" "+t._s(t.defaultLanguage.name)+" ")]),e("hr"),t._l(t.languages,(function(s){return e("k-dropdown-item",{key:s.code,on:{click:function(e){return t.change(s)}}},[t._v(" "+t._s(s.name)+" ")])}))],2):t._e()],1):t._e()}),[],!1,null,null,null,null).exports;var yn=Mt({props:{align:{type:String,default:"right"},icon:{type:String,default:"dots"},options:{type:[Array,Function,String],default:()=>[]},text:{type:[Boolean,String],default:!0},theme:{type:String,default:"dark"}},computed:{hasSingleOption(){return Array.isArray(this.options)&&1===this.options.length}},methods:{onAction(t,e,s){"function"==typeof t?t.call(this):(this.$emit("action",t,e,s),this.$emit("option",t,e,s))},toggle(){this.$refs.options.toggle()}}},(function(){var t=this,e=t._self._c;return t.hasSingleOption?e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{icon:t.options[0].icon||t.icon,tooltip:t.options[0].tooltip||t.options[0].text},on:{click:function(e){return t.onAction(t.options[0].option||t.options[0].click,t.options[0],0)}}},[!0===t.text?[t._v(" "+t._s(t.options[0].text)+" ")]:!1!==t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2):t.options.length?e("k-dropdown",{staticClass:"k-options-dropdown"},[e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{icon:t.icon,tooltip:t.$t("options")},on:{click:function(e){return t.$refs.options.toggle()}}},[t.text&&!0!==t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2),e("k-dropdown-content",{ref:"options",staticClass:"k-options-dropdown-content",attrs:{align:t.align,options:t.options},on:{action:t.onAction}})],1):t._e()}),[],!1,null,null,null,null).exports;var $n=Mt({props:{align:{type:String,default:"left"},details:{type:Boolean,default:!1},dropdown:{type:Boolean,default:!0},keys:{type:Boolean,default:!1},limit:{type:Number,default:10},page:{type:Number,default:1},pageLabel:{type:String,default:()=>window.panel.$t("pagination.page")},total:{type:Number,default:0},prevLabel:{type:String,default:()=>window.panel.$t("prev")},nextLabel:{type:String,default:()=>window.panel.$t("next")},validate:{type:Function,default:()=>Promise.resolve()}},data(){return{currentPage:this.page}},computed:{show(){return this.pages>1},start(){return(this.currentPage-1)*this.limit+1},end(){let t=this.start-1+this.limit;return t>this.total?this.total:t},detailsText(){return 1===this.limit?this.start+" / ":this.start+"-"+this.end+" / "},pages(){return Math.ceil(this.total/this.limit)},hasPrev(){return this.start>1},hasNext(){return this.endthis.limit},offset(){return this.start-1}},watch:{page(t){this.currentPage=parseInt(t)}},created(){!0===this.keys&&window.addEventListener("keydown",this.navigate,!1)},destroyed(){window.removeEventListener("keydown",this.navigate,!1)},methods:{async goTo(t){try{await this.validate(t),t<1&&(t=1),t>this.pages&&(t=this.pages),this.currentPage=t,this.$refs.dropdown&&this.$refs.dropdown.close(),this.$emit("paginate",{page:this.currentPage,start:this.start,end:this.end,limit:this.limit,offset:this.offset})}catch(e){}},prev(){this.goTo(this.currentPage-1)},next(){this.goTo(this.currentPage+1)},navigate(t){switch(t.code){case"ArrowLeft":this.prev();break;case"ArrowRight":this.next()}}}},(function(){var t=this,e=t._self._c;return t.show?e("nav",{staticClass:"k-pagination",attrs:{"data-align":t.align}},[t.show?e("k-button",{attrs:{disabled:!t.hasPrev,tooltip:t.prevLabel,icon:"angle-left"},on:{click:t.prev}}):t._e(),t.details?[t.dropdown?[e("k-dropdown",[e("k-button",{staticClass:"k-pagination-details",attrs:{disabled:!t.hasPages},on:{click:function(e){return t.$refs.dropdown.toggle()}}},[t.total>1?[t._v(" "+t._s(t.detailsText)+" ")]:t._e(),t._v(" "+t._s(t.total)+" ")],2),e("k-dropdown-content",{ref:"dropdown",staticClass:"k-pagination-selector",on:{open:function(e){t.$nextTick((()=>t.$refs.page.focus()))}}},[e("div",{staticClass:"k-pagination-settings"},[e("label",{attrs:{for:"k-pagination-page"}},[e("span",[t._v(t._s(t.pageLabel)+":")]),e("select",{ref:"page",attrs:{id:"k-pagination-page"}},t._l(t.pages,(function(s){return e("option",{key:s,domProps:{selected:t.page===s,value:s}},[t._v(" "+t._s(s)+" ")])})),0)]),e("k-button",{attrs:{icon:"check"},on:{click:function(e){return t.goTo(t.$refs.page.value)}}})],1)])],1)]:[e("span",{staticClass:"k-pagination-details"},[t.total>1?[t._v(" "+t._s(t.detailsText)+" ")]:t._e(),t._v(" "+t._s(t.total)+" ")],2)]]:t._e(),t.show?e("k-button",{attrs:{disabled:!t.hasNext,tooltip:t.nextLabel,icon:"angle-right"},on:{click:t.next}}):t._e()],2):t._e()}),[],!1,null,null,null,null).exports;var _n=Mt({props:{prev:{type:[Boolean,Object],default:!1},next:{type:[Boolean,Object],default:!1}},computed:{buttons(){return[{...this.button(this.prev),icon:"angle-left"},{...this.button(this.next),icon:"angle-right"}]}},methods:{button:t=>t||{disabled:!0,link:"#"}}},(function(){return(0,this._self._c)("k-button-group",{staticClass:"k-prev-next",attrs:{buttons:this.buttons}})}),[],!1,null,null,null,null).exports;var xn=Mt({props:{types:{type:Object,default:()=>({})},type:String},data(){return{isLoading:!1,hasResults:!0,items:[],currentType:this.getType(this.type),q:null,selected:-1}},watch:{q(t,e){t!==e&&this.search(this.q)},currentType(t,e){t!==e&&this.search(this.q)},type(){this.currentType=this.getType(this.type)}},created(){this.search=pt(this.search,250),this.$events.$on("keydown.cmd.shift.f",this.open)},destroyed(){this.$events.$off("keydown.cmd.shift.f",this.open)},methods:{changeType(t){this.currentType=this.getType(t),this.$nextTick((()=>{this.$refs.input.focus()}))},close(){this.$refs.overlay.close(),this.hasResults=!0,this.items=[],this.q=null},getType(t){return this.types[t]||this.types[Object.keys(this.types)[0]]},navigate(t){this.$go(t.link),this.close()},onDown(){this.selected=0&&this.select(this.selected-1)},open(){this.$refs.overlay.open()},async search(t){this.isLoading=!0,this.$refs.types&&this.$refs.types.close();try{if(null===t||""===t)throw Error("Empty query");const e=await this.$search(this.currentType.id,t);if(!1===e)throw Error("JSON parsing failed");this.items=e.results}catch(e){this.items=[]}finally{this.select(-1),this.isLoading=!1,this.hasResults=this.items.length>0}},select(t){if(this.selected=t,this.$refs.items){const e=this.$refs.items.$el.querySelectorAll(".k-item");[...e].forEach((t=>delete t.dataset.selected)),t>=0&&(e[t].dataset.selected=!0)}}}},(function(){var t=this,e=t._self._c;return e("k-overlay",{ref:"overlay"},[e("div",{staticClass:"k-search",attrs:{role:"search"}},[e("div",{staticClass:"k-search-input"},[e("k-dropdown",{staticClass:"k-search-types"},[e("k-button",{attrs:{icon:t.currentType.icon,text:t.currentType.label},on:{click:function(e){return t.$refs.types.toggle()}}}),e("k-dropdown-content",{ref:"types"},t._l(t.types,(function(s,i){return e("k-dropdown-item",{key:i,attrs:{icon:s.icon},on:{click:function(e){return t.changeType(i)}}},[t._v(" "+t._s(s.label)+" ")])})),1)],1),e("input",{directives:[{name:"model",rawName:"v-model",value:t.q,expression:"q"}],ref:"input",attrs:{placeholder:t.$t("search")+" …","aria-label":t.$t("search"),autofocus:!0,type:"text"},domProps:{value:t.q},on:{input:[function(e){e.target.composing||(t.q=e.target.value)},function(e){t.hasResults=!0}],keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.onDown.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.onUp.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:(e.preventDefault(),t.onTab.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onEnter.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.close.apply(null,arguments)}]}}),e("k-button",{staticClass:"k-search-close",attrs:{icon:t.isLoading?"loader":"cancel",tooltip:t.$t("close")},on:{click:t.close}})],1),!t.q||t.hasResults&&!t.items.length?t._e():e("div",{staticClass:"k-search-results"},[t.items.length?e("k-collection",{ref:"items",attrs:{items:t.items},on:{hover:t.onHover},nativeOn:{mouseout:function(e){return t.select(-1)}}}):t.hasResults?t._e():e("p",{staticClass:"k-search-empty"},[t._v(" "+t._s(t.$t("search.results.none"))+" ")])],1)])])}),[],!1,null,null,null,null).exports;var wn=Mt({props:{removable:Boolean},methods:{remove(){this.removable&&this.$emit("remove")},focus(){this.$refs.button.focus()}}},(function(){var t=this,e=t._self._c;return e("span",{ref:"button",staticClass:"k-tag",attrs:{tabindex:"0"},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:(e.preventDefault(),t.remove.apply(null,arguments))}}},[e("span",{staticClass:"k-tag-text"},[t._t("default")],2),t.removable?e("k-icon",{staticClass:"k-tag-toggle",attrs:{type:"cancel-small"},nativeOn:{click:function(e){return t.remove.apply(null,arguments)}}}):t._e()],1)}),[],!1,null,null,null,null).exports;var Sn=Mt({props:{breadcrumb:Array,license:Boolean,menu:Array,title:String,view:Object},computed:{notification(){return this.$store.state.notification.type&&"error"!==this.$store.state.notification.type?this.$store.state.notification:null}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-topbar"},[e("k-view",[e("div",{staticClass:"k-topbar-wrapper"},[e("k-dropdown",{staticClass:"k-topbar-menu"},[e("k-button",{staticClass:"k-topbar-button k-topbar-menu-button",attrs:{tooltip:t.$t("menu"),icon:"bars"},on:{click:function(e){return t.$refs.menu.toggle()}}},[e("k-icon",{attrs:{type:"angle-down"}})],1),e("k-dropdown-content",{ref:"menu",staticClass:"k-topbar-menu",attrs:{options:t.menu,theme:"light"}})],1),e("k-breadcrumb",{staticClass:"k-topbar-breadcrumb",attrs:{crumbs:t.breadcrumb,view:t.view}}),e("div",{staticClass:"k-topbar-signals"},[t.notification?e("k-button",{staticClass:"k-topbar-notification k-topbar-button",attrs:{text:t.notification.message,theme:"positive"},on:{click:function(e){return t.$store.dispatch("notification/close")}}}):t.license?t._e():e("k-registration"),e("k-form-indicator"),e("k-button",{staticClass:"k-topbar-button",attrs:{tooltip:t.$t("search"),icon:"search"},on:{click:function(e){return t.$refs.search.open()}}})],1)],1)]),e("k-search",{ref:"search",attrs:{type:t.$view.search||"pages",types:t.$searches}})],1)}),[],!1,null,null,null,null).exports;var Cn=Mt({props:{empty:String,blueprint:String,lock:[Boolean,Object],parent:String,tab:Object},computed:{content(){return this.$store.getters["content/values"]()}},methods:{exists(t){return this.$helper.isComponent(`k-${t}-section`)},meetsCondition(t){if(!t.when)return!0;let e=!0;return Object.keys(t.when).forEach((s=>{this.content[s.toLowerCase()]!==t.when[s]&&(e=!1)})),e}}},(function(){var t=this,e=t._self._c;return 0===t.tab.columns.length?e("k-box",{attrs:{html:!0,text:t.empty,theme:"info"}}):e("k-grid",{staticClass:"k-sections",attrs:{gutter:"large"}},t._l(t.tab.columns,(function(s,i){return e("k-column",{key:t.parent+"-column-"+i,attrs:{width:s.width,sticky:s.sticky}},[t._l(s.sections,(function(n,o){return[t.meetsCondition(n)?[t.exists(n.type)?e("k-"+n.type+"-section",t._b({key:t.parent+"-column-"+i+"-section-"+o+"-"+t.blueprint,tag:"component",class:"k-section k-section-name-"+n.name,attrs:{column:s.width,lock:t.lock,name:n.name,parent:t.parent,timestamp:t.$view.timestamp},on:{submit:function(e){return t.$emit("submit",e)}}},"component",n,!1)):[e("k-box",{key:t.parent+"-column-"+i+"-section-"+o,attrs:{text:t.$t("error.section.type.invalid",{type:n.type}),theme:"negative"}})]]:t._e()]}))],2)})),1)}),[],!1,null,null,null,null).exports;var On=Mt({mixins:[Tt],inheritAttrs:!1,data:()=>({fields:{},isLoading:!0,issue:null}),computed:{values(){return this.$store.getters["content/values"]()}},watch:{timestamp(){this.fetch()}},created(){this.input=pt(this.input,50),this.fetch()},methods:{input(t,e,s){this.$store.dispatch("content/update",[s,t[s]])},async fetch(){try{const t=await this.load();this.fields=t.fields,Object.keys(this.fields).forEach((t=>{this.fields[t].section=this.name,this.fields[t].endpoints={field:this.parent+"/fields/"+t,section:this.parent+"/sections/"+this.name,model:this.parent}}))}catch(t){this.issue=t}finally{this.isLoading=!1}},onSubmit(t){this.$events.$emit("keydown.cmd.s",t)}}},(function(){var t=this,e=t._self._c;return t.isLoading?t._e():e("section",{staticClass:"k-fields-section"},[t.issue?[e("k-headline",{staticClass:"k-fields-issue-headline"},[t._v(" Error ")]),e("k-box",{attrs:{text:t.issue.message,html:!1,theme:"negative"}})]:t._e(),e("k-form",{attrs:{fields:t.fields,validate:!0,value:t.values,disabled:t.lock&&"lock"===t.lock.state},on:{input:t.input,submit:t.onSubmit}})],2)}),[],!1,null,null,null,null).exports;var An=Mt({inheritAttrs:!1,props:{blueprint:String,column:String,parent:String,name:String,timestamp:Number},data:()=>({data:[],error:null,isLoading:!1,isProcessing:!1,options:{columns:{},empty:null,headline:null,help:null,layout:"list",link:null,max:null,min:null,size:null,sortable:null},pagination:{page:null},searchterm:null,searching:!1}),computed:{addIcon:()=>"add",buttons(){let t=[];return this.canSearch&&t.push({icon:"filter",text:this.$t("search"),click:this.onSearchToggle,responsive:!0}),this.canAdd&&t.push({icon:this.addIcon,text:this.$t("add"),click:this.onAdd}),t},canAdd:()=>!0,canDrop:()=>!1,canSearch(){return this.options.search},collection(){return{columns:this.options.columns,empty:this.emptyPropsWithSearch,layout:this.options.layout,help:this.options.help,items:this.items,pagination:this.pagination,sortable:!this.isProcessing&&this.options.sortable,size:this.options.size}},emptyProps(){return{icon:"page",text:this.$t("pages.empty")}},emptyPropsWithSearch(){return{...this.emptyProps,text:this.searching?this.$t("search.results.none"):this.options.empty||this.emptyProps.text}},items(){return this.data},isInvalid(){var t;return!((null==(t=this.searchterm)?void 0:t.length)>0)&&(!!(this.options.min&&this.data.lengththis.options.max))},paginationId(){return"kirby$pagination$"+this.parent+"/"+this.name},type:()=>"models"},watch:{searchterm:pt((function(){this.pagination.page=0,this.reload()}),200),timestamp(){this.reload()}},created(){this.load()},methods:{async load(t){t||(this.isLoading=!0),this.isProcessing=!0,null===this.pagination.page&&(this.pagination.page=localStorage.getItem(this.paginationId)||1);try{const t=await this.$api.get(this.parent+"/sections/"+this.name,{page:this.pagination.page,searchterm:this.searchterm});this.options=t.options,this.pagination=t.pagination,this.data=t.data}catch(e){this.error=e.message}finally{this.isProcessing=!1,this.isLoading=!1}},onAction(){},onAdd(){},onChange(){},onDrop(){},onSort(){},onPaginate(t){localStorage.setItem(this.paginationId,t.page),this.pagination=t,this.reload()},onSearchToggle(){this.searching=!this.searching,this.searchterm=null},onUpload(){},async reload(){await this.load(!0)},update(){this.reload(),this.$events.$emit("model.update")}}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("section",{class:`k-models-section k-${t.type}-section`,attrs:{"data-processing":t.isProcessing}},[e("header",{staticClass:"k-section-header"},[e("k-headline",{attrs:{link:t.options.link}},[t._v(" "+t._s(t.options.headline||" ")+" "),t.options.min?e("abbr",{attrs:{title:t.$t("section.required")}},[t._v("*")]):t._e()]),e("k-button-group",{attrs:{buttons:t.buttons}})],1),t.error?e("k-box",{attrs:{theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[e("strong",[t._v(" "+t._s(t.$t("error.section.notLoaded",{name:t.name}))+": ")]),t._v(" "+t._s(t.error)+" ")])],1):[e("k-dropzone",{attrs:{disabled:!t.canDrop},on:{drop:t.onDrop}},[t.searching&&t.options.search?e("k-input",{staticClass:"k-models-section-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",type:"text"},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.onSearchToggle.apply(null,arguments)}},model:{value:t.searchterm,callback:function(e){t.searchterm=e},expression:"searchterm"}}):t._e(),e("k-collection",t._g(t._b({attrs:{"data-invalid":t.isInvalid},on:{action:t.onAction,change:t.onChange,sort:t.onSort,paginate:t.onPaginate}},"k-collection",t.collection,!1),t.canAdd?{empty:t.onAdd}:{}))],1),e("k-upload",{ref:"upload",on:{success:t.onUpload,error:t.reload}})]],2):t._e()}),[],!1,null,null,null,null).exports;var Tn=Mt({extends:An,computed:{addIcon:()=>"upload",canAdd(){return this.$permissions.files.create&&!1!==this.options.upload},canDrop(){return!1!==this.canAdd},emptyProps(){return{icon:"image",text:this.$t("files.empty")}},items(){return this.data.map((t=>(t.sortable=this.options.sortable,t.column=this.column,t.options=this.$dropdown(t.link,{query:{view:"list",update:this.options.sortable,delete:this.data.length>this.options.min}}),t.data={"data-id":t.id,"data-template":t.template},t)))},type:()=>"files",uploadProps(){return{...this.options.upload,url:this.$urls.api+"/"+this.options.upload.api}}},created(){this.load(),this.$events.$on("model.update",this.reload),this.$events.$on("file.sort",this.reload)},destroyed(){this.$events.$off("model.update",this.reload),this.$events.$off("file.sort",this.reload)},methods:{onAction(t,e){"replace"===t&&this.replace(e)},onAdd(){this.canAdd&&this.$refs.upload.open(this.uploadProps)},onDrop(t){this.canAdd&&this.$refs.upload.drop(t,this.uploadProps)},async onSort(t){if(!1===this.options.sortable)return!1;this.isProcessing=!0;try{await this.$api.patch(this.options.apiUrl+"/files/sort",{files:t.map((t=>t.id)),index:this.pagination.offset}),this.$store.dispatch("notification/success",":)"),this.$events.$emit("file.sort")}catch(e){this.reload(),this.$store.dispatch("notification/error",e.message)}finally{this.isProcessing=!1}},onUpload(){this.$events.$emit("file.create"),this.$events.$emit("model.update"),this.$store.dispatch("notification/success",":)")},replace(t){this.$refs.upload.open({url:this.$urls.api+"/"+t.link,accept:"."+t.extension+","+t.mime,multiple:!1})}}},null,null,!1,null,null,null,null).exports;var In=Mt({mixins:[Tt],data:()=>({headline:null,text:null,theme:null}),async created(){const t=await this.load();this.headline=t.headline,this.text=t.text,this.theme=t.theme||"info"}},(function(){var t=this,e=t._self._c;return e("section",{staticClass:"k-info-section"},[e("k-headline",{staticClass:"k-info-section-headline"},[t._v(" "+t._s(t.headline)+" ")]),e("k-box",{attrs:{theme:t.theme}},[e("k-text",{domProps:{innerHTML:t._s(t.text)}})],1)],1)}),[],!1,null,null,null,null).exports;var Mn=Mt({extends:An,computed:{canAdd(){return this.options.add&&this.$permissions.pages.create},items(){return this.data.map((t=>{const e=!1!==t.permissions.changeStatus;return t.flag={status:t.status,tooltip:this.$t("page.status"),disabled:!e,click:()=>this.$dialog(t.link+"/changeStatus")},t.sortable=t.permissions.sort&&this.options.sortable,t.deletable=this.data.length>this.options.min,t.column=this.column,t.options=this.$dropdown(t.link,{query:{view:"list",delete:t.deletable,sort:t.sortable}}),t.data={"data-id":t.id,"data-status":t.status,"data-template":t.template},t}))}},created(){this.load(),this.$events.$on("page.changeStatus",this.reload),this.$events.$on("page.sort",this.reload)},destroyed(){this.$events.$off("page.changeStatus",this.reload),this.$events.$off("page.sort",this.reload)},methods:{onAdd(){this.canAdd&&this.$dialog("pages/create",{query:{parent:this.options.link||this.parent,view:this.parent,section:this.name}})},async onChange(t){let e=null;if(t.added&&(e="added"),t.moved&&(e="moved"),e){this.isProcessing=!0;const i=t[e].element,n=t[e].newIndex+1+this.pagination.offset;try{await this.$api.pages.changeStatus(i.id,"listed",n),this.$store.dispatch("notification/success",":)"),this.$events.$emit("page.sort",i)}catch(s){this.$store.dispatch("notification/error",{message:s.message,details:s.details}),await this.reload()}finally{this.isProcessing=!1}}}}},null,null,!1,null,null,null,null).exports;var Ln=Mt({mixins:[Tt],data:()=>({isLoading:!0,headline:null,reports:null,size:null}),async created(){const t=await this.load();this.isLoading=!1,this.headline=t.headline,this.reports=t.reports,this.size=t.size},methods:{}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("section",{staticClass:"k-stats-section"},[e("header",{staticClass:"k-section-header"},[e("k-headline",[t._v(" "+t._s(t.headline)+" ")])],1),t.reports.length>0?e("k-stats",{attrs:{reports:t.reports,size:t.size}}):e("k-empty",{attrs:{icon:"chart"}},[t._v(" "+t._s(t.empty||t.$t("stats.empty")))])],1):t._e()}),[],!1,null,null,null,null).exports;t.component("k-sections",Cn),t.component("k-fields-section",On),t.component("k-files-section",Tn),t.component("k-info-section",In),t.component("k-pages-section",Mn),t.component("k-stats-section",Ln);var En=Mt({props:{blueprint:String,next:Object,prev:Object,permissions:{type:Object,default:()=>({})},lock:{type:[Boolean,Object]},model:{type:Object,default:()=>({})},tab:{type:Object,default:()=>({columns:[]})},tabs:{type:Array,default:()=>[]}},computed:{id(){return this.model.link},isLocked(){var t;return"lock"===(null==(t=this.lock)?void 0:t.state)},protectedFields:()=>[]},watch:{"model.id":{handler(){this.content()},immediate:!0}},created(){this.$events.$on("model.reload",this.reload),this.$events.$on("keydown.left",this.toPrev),this.$events.$on("keydown.right",this.toNext)},destroyed(){this.$events.$off("model.reload",this.reload),this.$events.$off("keydown.left",this.toPrev),this.$events.$off("keydown.right",this.toNext)},methods:{content(){this.$store.dispatch("content/create",{id:this.id,api:this.id,content:this.model.content,ignore:this.protectedFields})},async reload(){await this.$reload(),this.content()},toPrev(t){this.prev&&"body"===t.target.localName&&this.$go(this.prev.link)},toNext(t){this.next&&"body"===t.target.localName&&this.$go(this.next.link)}}},null,null,!1,null,null,null,null).exports;var jn=Mt({extends:En,computed:{avatarOptions(){return[{icon:"upload",text:this.$t("change"),click:()=>this.$refs.upload.open()},{icon:"trash",text:this.$t("delete"),click:this.deleteAvatar}]},buttons(){return[{icon:"email",text:`${this.$t("email")}: ${this.model.email}`,disabled:!this.permissions.changeEmail||this.isLocked,click:()=>this.$dialog(this.id+"/changeEmail")},{icon:"bolt",text:`${this.$t("role")}: ${this.model.role}`,disabled:!this.permissions.changeRole||this.isLocked,click:()=>this.$dialog(this.id+"/changeRole")},{icon:"globe",text:`${this.$t("language")}: ${this.model.language}`,disabled:!this.permissions.changeLanguage||this.isLocked,click:()=>this.$dialog(this.id+"/changeLanguage")}]},uploadApi(){return this.$urls.api+"/"+this.id+"/avatar"}},methods:{async deleteAvatar(){await this.$api.users.deleteAvatar(this.model.id),this.avatar=null,this.$store.dispatch("notification/success",":)"),this.$reload()},onAvatar(){this.model.avatar?this.$refs.picture.toggle():this.$refs.upload.open()},uploadedAvatar(){this.$store.dispatch("notification/success",":)"),this.$reload()}}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("div",{staticClass:"k-user-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[e("div",{staticClass:"k-user-profile"},[e("k-view",[e("k-dropdown",[e("k-button",{staticClass:"k-user-view-image",attrs:{tooltip:t.$t("avatar"),disabled:t.isLocked},on:{click:t.onAvatar}},[t.model.avatar?e("k-image",{attrs:{cover:!0,src:t.model.avatar,ratio:"1/1"}}):e("k-icon",{attrs:{back:"gray-900",color:"gray-200",type:"user"}})],1),t.model.avatar?e("k-dropdown-content",{ref:"picture",attrs:{options:t.avatarOptions}}):t._e()],1),e("k-button-group",{attrs:{buttons:t.buttons}})],1)],1),e("k-view",[e("k-header",{attrs:{editable:t.permissions.changeName&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[e("k-dropdown",{staticClass:"k-user-view-options"},[e("k-button",{attrs:{disabled:t.isLocked,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)}})],1),e("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[t.model.account?t._e():e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[t.model.name&&0!==t.model.name.length?[t._v(" "+t._s(t.model.name)+" ")]:e("span",{staticClass:"k-user-name-placeholder"},[t._v(" "+t._s(t.$t("name"))+" … ")])],2),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("user.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}}),e("k-upload",{ref:"upload",attrs:{url:t.uploadApi,multiple:!1,accept:"image/*"},on:{success:t.uploadedAvatar}})],1)],1)])}),[],!1,null,null,null,null).exports;var Bn=Mt({extends:jn,prevnext:!1},null,null,!1,null,null,null,null).exports;var Dn=Mt({props:{error:String,layout:String}},(function(){var t=this,e=t._self._c;return e(`k-${t.layout}`,{tag:"component"},[e("k-view",{staticClass:"k-error-view"},[e("div",{staticClass:"k-error-view-content"},[e("k-text",[e("p",[e("k-icon",{staticClass:"k-error-view-icon",attrs:{type:"alert"}})],1),t._t("default",(function(){return[e("p",[t._v(" "+t._s(t.error)+" ")])]}))],2)],1)])],1)}),[],!1,null,null,null,null).exports;var Pn=Mt({extends:En,props:{preview:Object},methods:{action(t){if("replace"===t)this.$refs.upload.open({url:this.$urls.api+"/"+this.id,accept:"."+this.model.extension+","+this.model.mime,multiple:!1})},onUpload(){this.$store.dispatch("notification/success",":)"),this.$reload()}}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("div",{staticClass:"k-file-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[e("k-file-preview",t._b({},"k-file-preview",t.preview,!1)),e("k-view",{staticClass:"k-file-content"},[e("k-header",{attrs:{editable:t.permissions.changeName&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-file-view-options",attrs:{link:t.preview.url,responsive:!0,text:t.$t("open"),icon:"open",target:"_blank"}}),e("k-dropdown",{staticClass:"k-file-view-options"},[e("k-button",{attrs:{disabled:t.isLocked,responsive:!0,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)},on:{action:t.action}})],1),e("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[t._v(" "+t._s(t.model.filename)+" ")]),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("file.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}}),e("k-upload",{ref:"upload",on:{success:t.onUpload}})],1)],1)])}),[],!1,null,null,null,null).exports;var Nn=Mt({props:{isInstallable:Boolean,isInstalled:Boolean,isOk:Boolean,requirements:Object,translations:Array},data(){return{user:{name:"",email:"",language:this.$translation.code,password:"",role:"admin"}}},computed:{fields(){return{email:{label:this.$t("email"),type:"email",link:!1,autofocus:!0,required:!0},password:{label:this.$t("password"),type:"password",placeholder:this.$t("password")+" …",required:!0},language:{label:this.$t("language"),type:"select",options:this.translations,icon:"globe",empty:!1,required:!0}}},isReady(){return this.isOk&&this.isInstallable},isComplete(){return this.isOk&&this.isInstalled}},methods:{async install(){try{await this.$api.system.install(this.user),await this.$reload({globals:["$system","$translation"]}),this.$store.dispatch("notification/success",this.$t("welcome")+"!")}catch(t){this.$store.dispatch("notification/error",t)}}}},(function(){var t=this,e=t._self._c;return e("k-panel",[e("k-view",{staticClass:"k-installation-view",attrs:{align:"center"}},[t.isComplete?e("k-text",[e("k-headline",[t._v(t._s(t.$t("installation.completed")))]),e("k-link",{attrs:{to:"/login"}},[t._v(" "+t._s(t.$t("login"))+" ")])],1):t.isReady?e("form",{on:{submit:function(e){return e.preventDefault(),t.install.apply(null,arguments)}}},[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("installation"))+" ")]),e("k-fieldset",{attrs:{fields:t.fields,novalidate:!0},model:{value:t.user,callback:function(e){t.user=e},expression:"user"}}),e("k-button",{attrs:{text:t.$t("install"),type:"submit",icon:"check"}})],1):e("div",[e("k-headline",[t._v(" "+t._s(t.$t("installation.issues.headline"))+" ")]),e("ul",{staticClass:"k-installation-issues"},[!1===t.isInstallable?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.disabled"))}})],1):t._e(),!1===t.requirements.php?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.php"))}})],1):t._e(),!1===t.requirements.server?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.server"))}})],1):t._e(),!1===t.requirements.mbstring?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.mbstring"))}})],1):t._e(),!1===t.requirements.curl?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.curl"))}})],1):t._e(),!1===t.requirements.accounts?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.accounts"))}})],1):t._e(),!1===t.requirements.content?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.content"))}})],1):t._e(),!1===t.requirements.media?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.media"))}})],1):t._e(),!1===t.requirements.sessions?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.sessions"))}})],1):t._e()]),e("k-button",{attrs:{text:t.$t("retry"),icon:"refresh"},on:{click:t.$reload}})],1)],1)],1)}),[],!1,null,null,null,null).exports;var qn=Mt({props:{languages:{type:Array,default:()=>[]}},computed:{languagesCollection(){return this.languages.map((t=>({...t,image:{back:"black",color:"gray",icon:"globe"},link:()=>{this.$dialog(`languages/${t.id}/update`)},options:[{icon:"edit",text:this.$t("edit"),click(){this.$dialog(`languages/${t.id}/update`)}},{icon:"trash",text:this.$t("delete"),disabled:t.default&&1!==this.languages.length,click(){this.$dialog(`languages/${t.id}/delete`)}}]})))},primaryLanguage(){return this.languagesCollection.filter((t=>t.default))},secondaryLanguages(){return this.languagesCollection.filter((t=>!1===t.default))}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-languages-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.languages"))+" "),e("k-button-group",{attrs:{slot:"left"},slot:"left"},[e("k-button",{attrs:{text:t.$t("language.create"),icon:"add"},on:{click:function(e){return t.$dialog("languages/create")}}})],1)],1),e("section",{staticClass:"k-languages"},[t.languages.length>0?[e("section",{staticClass:"k-languages-view-section"},[e("header",{staticClass:"k-languages-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("languages.default")))])],1),e("k-collection",{attrs:{items:t.primaryLanguage}})],1),e("section",{staticClass:"k-languages-view-section"},[e("header",{staticClass:"k-languages-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("languages.secondary")))])],1),t.secondaryLanguages.length?e("k-collection",{attrs:{items:t.secondaryLanguages}}):e("k-empty",{attrs:{icon:"globe"},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.secondary.empty"))+" ")])],1)]:0===t.languages.length?[e("k-empty",{attrs:{icon:"globe"},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.empty"))+" ")])]:t._e()],2)],1)],1)}),[],!1,null,null,null,null).exports;var Fn=Mt({components:{"k-login-plugin":window.panel.plugins.login||he},props:{methods:Array,pending:Object},computed:{form(){return this.pending.email?"code":this.$user?null:"login"}},created(){this.$store.dispatch("content/clear")}},(function(){var t=this,e=t._self._c;return e("k-panel",["login"===t.form?e("k-view",{staticClass:"k-login-view",attrs:{align:"center"}},[e("k-login-plugin",{attrs:{methods:t.methods}})],1):"code"===t.form?e("k-view",{staticClass:"k-login-code-view",attrs:{align:"center"}},[e("k-login-code",t._b({},"k-login-code",t.$props,!1))],1):t._e()],1)}),[],!1,null,null,null,null).exports;var Rn=Mt({extends:En,props:{status:Object},computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("k-view",{staticClass:"k-page-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[e("k-header",{attrs:{editable:t.permissions.changeTitle&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeTitle")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[t.permissions.preview&&t.model.previewUrl?e("k-button",{staticClass:"k-page-view-preview",attrs:{link:t.model.previewUrl,responsive:!0,text:t.$t("open"),icon:"open",target:"_blank"}}):t._e(),t.status?e("k-status-icon",{attrs:{status:t.model.status,disabled:!t.permissions.changeStatus||t.isLocked,responsive:!0,text:t.status.label},on:{click:function(e){return t.$dialog(t.id+"/changeStatus")}}}):t._e(),e("k-dropdown",{staticClass:"k-page-view-options"},[e("k-button",{attrs:{disabled:!0===t.isLocked,responsive:!0,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)}})],1),e("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[t.model.id?e("k-prev-next",{attrs:{prev:t.prev,next:t.next}}):t._e()]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("page.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}})],1)],1)}),[],!1,null,null,null,null).exports;var zn=Mt({props:{id:String},computed:{view(){return"k-"+this.id+"-plugin-view"}}},(function(){var t=this._self._c;return t("k-inside",[t(this.view,{tag:"component"})],1)}),[],!1,null,null,null,null).exports;var Yn=Mt({data:()=>({isLoading:!1,issue:"",values:{password:null,passwordConfirmation:null}}),computed:{fields(){return{password:{autofocus:!0,label:this.$t("user.changePassword.new"),icon:"key",type:"password"},passwordConfirmation:{label:this.$t("user.changePassword.new.confirm"),icon:"key",type:"password"}}}},mounted(){this.$store.dispatch("title",this.$t("view.resetPassword"))},methods:{async submit(){if(!this.values.password||this.values.password.length<8)return this.issue=this.$t("error.user.password.invalid"),!1;if(this.values.password!==this.values.passwordConfirmation)return this.issue=this.$t("error.user.password.notSame"),!1;this.isLoading=!0;try{await this.$api.users.changePassword(this.$user.id,this.values.password),this.$store.dispatch("notification/success",":)"),this.$go("/")}catch(t){this.issue=t.message}finally{this.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-password-reset-view",attrs:{align:"center"}},[e("k-form",{attrs:{fields:t.fields,"submit-button":t.$t("change")},on:{submit:t.submit},scopedSlots:t._u([{key:"header",fn:function(){return[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("view.resetPassword"))+" ")]),t.issue?e("k-login-alert",{on:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),e("k-user-info",{attrs:{user:t.$user}})]},proxy:!0},{key:"footer",fn:function(){return[e("div",{staticClass:"k-login-buttons"},[e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("change"))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)],1)]},proxy:!0}]),model:{value:t.values,callback:function(e){t.values=e},expression:"values"}})],1)],1)}),[],!1,null,null,null,null).exports;var Hn=Mt({extends:En,computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("k-view",{staticClass:"k-site-view",attrs:{"data-locked":t.isLocked,"data-id":"/","data-template":"site"}},[e("k-header",{attrs:{editable:t.permissions.changeTitle&&!t.isLocked,tabs:t.tabs,tab:t.tab.name},on:{edit:function(e){return t.$dialog("site/changeTitle")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-site-view-preview",attrs:{link:t.model.previewUrl,responsive:!0,text:t.$t("open"),icon:"open",target:"_blank"}}),e("k-languages-dropdown")],1)]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("site.blueprint"),lock:t.lock,tab:t.tab,parent:"site"},on:{submit:function(e){return t.$emit("submit",e)}}})],1)],1)}),[],!1,null,null,null,null).exports;var Un=Mt({props:{debug:Boolean,license:String,php:String,plugins:Array,server:String,https:Boolean,urls:Object,version:String},data:()=>({security:[]}),computed:{environment(){return[{label:this.$t("license"),value:this.license?"Kirby 3":this.$t("license.unregistered.label"),theme:this.license?null:"negative",click:this.license?()=>this.$dialog("license"):()=>this.$dialog("registration")},{label:this.$t("version"),value:this.version,link:"https://github.com/getkirby/kirby/releases/tag/"+this.version},{label:"PHP",value:this.php},{label:this.$t("server"),value:this.server||"?"}]}},async created(){console.info("Running system health checks for the Panel system view; failed requests in the following console output are expected behavior.");let t=(Promise.allSettled||Promise.all).bind(Promise);await t([this.check("content"),this.check("debug"),this.check("git"),this.check("https"),this.check("kirby"),this.check("site")]),console.info("System health checks ended.")},methods:{async check(t){switch(t){case"debug":!0===this.debug&&this.securityIssue(t);break;case"https":!0!==this.https&&this.securityIssue(t);break;default:const e=this.urls[t];if(!e)return!1;!0===await this.isAccessible(e)&&this.securityIssue(t)}},securityIssue(t){this.security.push({image:{back:"var(--color-red-200)",icon:"alert",color:"var(--color-red)"},id:t,text:this.$t("system.issues."+t),link:"https://getkirby.com/security/"+t})},isAccessible:async t=>(await fetch(t,{cache:"no-store"})).status<400,retry(){this.$go(window.location.href)}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-system-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.system"))+" ")]),e("section",{staticClass:"k-system-view-section"},[e("header",{staticClass:"k-system-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("environment")))])],1),e("k-stats",{staticClass:"k-system-info",attrs:{reports:t.environment,size:"medium"}})],1),t.security.length?e("section",{staticClass:"k-system-view-section"},[e("header",{staticClass:"k-system-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("security")))]),e("k-button",{attrs:{tooltip:t.$t("retry"),icon:"refresh"},on:{click:t.retry}})],1),e("k-items",{attrs:{items:t.security}})],1):t._e(),t.plugins.length?e("section",{staticClass:"k-system-view-section"},[e("header",{staticClass:"k-system-view-section-header"},[e("k-headline",{attrs:{link:"https://getkirby.com/plugins"}},[t._v(" "+t._s(t.$t("plugins"))+" ")])],1),e("k-table",{attrs:{index:!1,columns:{name:{label:t.$t("name"),type:"url",mobile:!0},author:{label:t.$t("author")},license:{label:t.$t("license")},version:{label:t.$t("version"),width:"8rem",mobile:!0}},rows:t.plugins}})],1):t._e()],1)],1)}),[],!1,null,null,null,null).exports;var Kn=Mt({props:{role:Object,roles:Array,search:String,title:String,users:Object},computed:{items(){return this.users.data.map((t=>(t.options=this.$dropdown(t.link),t)))}},methods:{paginate(t){this.$reload({query:{page:t.page}})}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-users-view"},[e("k-header",{scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",{attrs:{buttons:[{disabled:!1===t.$permissions.users.create,text:t.$t("user.create"),icon:"add",click:()=>t.$dialog("users/create")}]}})]},proxy:!0},{key:"right",fn:function(){return[e("k-button-group",[e("k-dropdown",[e("k-button",{attrs:{responsive:!0,text:`${t.$t("role")}: ${t.role?t.role.title:t.$t("role.all")}`,icon:"funnel"},on:{click:function(e){return t.$refs.roles.toggle()}}}),e("k-dropdown-content",{ref:"roles",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{icon:"bolt",link:"/users"}},[t._v(" "+t._s(t.$t("role.all"))+" ")]),e("hr"),t._l(t.roles,(function(s){return e("k-dropdown-item",{key:s.id,attrs:{link:"/users/?role="+s.id,icon:"bolt"}},[t._v(" "+t._s(s.title)+" ")])}))],2)],1)],1)]},proxy:!0}])},[t._v(" "+t._s(t.$t("view.users"))+" ")]),t.users.data.length>0?[e("k-collection",{attrs:{items:t.items,pagination:t.users.pagination},on:{paginate:t.paginate}})]:0===t.users.pagination.total?[e("k-empty",{attrs:{icon:"users"}},[t._v(" "+t._s(t.$t("role.empty"))+" ")])]:t._e()],2)],1)}),[],!1,null,null,null,null).exports;var Jn=Mt({computed:{placeholder(){return this.field("code",{}).placeholder},languages(){return this.field("language",{options:[]}).options}},methods:{focus(){this.$refs.code.focus()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-code-editor"},[e("k-input",{ref:"code",attrs:{buttons:!1,placeholder:t.placeholder,spellcheck:!1,value:t.content.code,type:"textarea"},on:{input:function(e){return t.update({code:e})}}}),t.languages.length?e("div",{staticClass:"k-block-type-code-editor-language"},[e("k-icon",{attrs:{type:"code"}}),e("k-input",{ref:"language",attrs:{empty:!1,options:t.languages,value:t.content.language,type:"select"},on:{input:function(e){return t.update({language:e})}}})],1):t._e()],1)}),[],!1,null,null,null,null).exports,Gn=Object.freeze(Object.defineProperty({__proto__:null,default:Jn},Symbol.toStringTag,{value:"Module"}));var Vn=Mt({},(function(){var t=this;return(0,t._self._c)("k-block-title",{attrs:{content:t.content,fieldset:t.fieldset},on:{dblclick:function(e){return t.$emit("open")}}})}),[],!1,null,null,null,null).exports,Wn=Object.freeze(Object.defineProperty({__proto__:null,default:Vn},Symbol.toStringTag,{value:"Module"}));var Xn=Mt({},(function(){var t=this,e=t._self._c;return e("ul",{on:{dblclick:t.open}},[0===t.content.images.length?[e("li"),e("li"),e("li"),e("li"),e("li")]:t._l(t.content.images,(function(t){return e("li",{key:t.id},[e("img",{attrs:{src:t.url,srcset:t.image.srcset,alt:t.alt}})])}))],2)}),[],!1,null,null,null,null).exports,Zn=Object.freeze(Object.defineProperty({__proto__:null,default:Xn},Symbol.toStringTag,{value:"Module"}));var Qn=Mt({computed:{textField(){return this.field("text",{marks:!0})}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-heading-input",attrs:{"data-level":t.content.level}},[e("k-writer",{ref:"input",attrs:{inline:!0,marks:t.textField.marks,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}})],1)}),[],!1,null,null,null,null).exports,to=Object.freeze(Object.defineProperty({__proto__:null,default:Qn},Symbol.toStringTag,{value:"Module"}));var eo=Mt({computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop||!1},src(){var t;return"web"===this.content.location?this.content.src:!!(null==(t=this.content.image[0])?void 0:t.url)&&this.content.image[0].url},ratio(){return this.content.ratio||!1}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.image.placeholder")+" …","is-empty":!t.src,"empty-icon":"image"},on:{open:t.open,update:t.update}},[t.src?[t.ratio?e("k-aspect-ratio",{attrs:{ratio:t.ratio,cover:t.crop}},[e("img",{attrs:{alt:t.content.alt,src:t.src}})]):e("img",{staticClass:"k-block-type-image-auto",attrs:{alt:t.content.alt,src:t.src}})]:t._e()],2)}),[],!1,null,null,null,null).exports,so=Object.freeze(Object.defineProperty({__proto__:null,default:eo},Symbol.toStringTag,{value:"Module"}));var io=Mt({},(function(){return this._self._c,this._m(0)}),[function(){var t=this._self._c;return t("div",[t("hr")])}],!1,null,null,null,null).exports,no=Object.freeze(Object.defineProperty({__proto__:null,default:io},Symbol.toStringTag,{value:"Module"}));var oo=Mt({computed:{marks(){return this.field("text",{}).marks}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-list-input",attrs:{marks:t.marks,value:t.content.text,type:"list"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports,ro=Object.freeze(Object.defineProperty({__proto__:null,default:oo},Symbol.toStringTag,{value:"Module"}));var lo=Mt({computed:{placeholder(){return this.field("text",{}).placeholder}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-markdown-input",attrs:{buttons:!1,placeholder:t.placeholder,spellcheck:!1,value:t.content.text,type:"textarea"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports,ao=Object.freeze(Object.defineProperty({__proto__:null,default:lo},Symbol.toStringTag,{value:"Module"}));var uo=Mt({computed:{citationField(){return this.field("citation",{})},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.text.focus()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-quote-editor"},[e("k-writer",{ref:"text",staticClass:"k-block-type-quote-text",attrs:{inline:!0,marks:t.textField.marks,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}}),e("k-writer",{ref:"citation",staticClass:"k-block-type-quote-citation",attrs:{inline:!0,marks:t.citationField.marks,placeholder:t.citationField.placeholder,value:t.content.citation},on:{input:function(e){return t.update({citation:e})}}})],1)}),[],!1,null,null,null,null).exports,co=Object.freeze(Object.defineProperty({__proto__:null,default:uo},Symbol.toStringTag,{value:"Module"}));var po=Mt({inheritAttrs:!1,computed:{columns(){return this.table.columns||this.fields},fields(){return this.table.fields||{}},rows(){return this.content.rows||[]},table(){let t=null;for(const e of Object.values(this.fieldset.tabs))e.fields.rows&&(t=e.fields.rows);return t||{}}}},(function(){var t=this;return(0,t._self._c)("k-table",{staticClass:"k-block-type-table-preview",attrs:{columns:t.columns,empty:t.$t("field.structure.empty"),rows:t.rows},nativeOn:{dblclick:function(e){return t.open.apply(null,arguments)}}})}),[],!1,null,null,null,null).exports,ho=Object.freeze(Object.defineProperty({__proto__:null,default:po},Symbol.toStringTag,{value:"Module"}));var mo=Mt({props:{endpoints:Object},computed:{textField(){return this.field("text",{})}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this;return(0,t._self._c)("k-writer",{ref:"input",staticClass:"k-block-type-text-input",attrs:{inline:t.textField.inline,marks:t.textField.marks,nodes:t.textField.nodes,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports,fo=Object.freeze(Object.defineProperty({__proto__:null,default:mo},Symbol.toStringTag,{value:"Module"}));var go=Mt({computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},video(){return this.$helper.embed.video(this.content.url,!0)}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.video.placeholder")+" …","is-empty":!t.video,"empty-icon":"video"},on:{open:t.open,update:t.update}},[e("k-aspect-ratio",{attrs:{ratio:"16/9"}},[t.video?e("iframe",{attrs:{src:t.video,referrerpolicy:"strict-origin-when-cross-origin"}}):t._e()])],1)}),[],!1,null,null,null,null).exports,ko=Object.freeze(Object.defineProperty({__proto__:null,default:go},Symbol.toStringTag,{value:"Module"}));var bo=Mt({inheritAttrs:!1,props:{attrs:[Array,Object],content:[Array,Object],endpoints:Object,fieldset:Object,id:String,isBatched:Boolean,isFull:Boolean,isHidden:Boolean,isLastInBatch:Boolean,isSelected:Boolean,name:String,next:Object,prev:Object,type:String},data:()=>({skipFocus:!1}),computed:{className(){let t=["k-block-type-"+this.type];return this.fieldset.preview!==this.type&&t.push("k-block-type-"+this.fieldset.preview),!1===this.wysiwyg&&t.push("k-block-type-default"),t},customComponent(){return this.wysiwyg?this.wysiwygComponent:"k-block-type-default"},isEditable(){return!1!==this.fieldset.editable},listeners(){return{...this.$listeners,confirmToRemove:this.confirmToRemove,open:this.open}},tabs(){let t=this.fieldset.tabs;return Object.entries(t).forEach((([e,s])=>{Object.entries(s.fields).forEach((([s])=>{t[e].fields[s].section=this.name,t[e].fields[s].endpoints={field:this.endpoints.field+"/fieldsets/"+this.type+"/fields/"+s,section:this.endpoints.section,model:this.endpoints.model}}))})),t},wysiwyg(){return!1!==this.wysiwygComponent},wysiwygComponent(){if(!1===this.fieldset.preview)return!1;let t;return this.fieldset.preview&&(t="k-block-type-"+this.fieldset.preview,this.$helper.isComponent(t))?t:(t="k-block-type-"+this.type,!!this.$helper.isComponent(t)&&t)}},methods:{close(){this.$refs.drawer.close()},confirmToRemove(){this.$refs.removeDialog.open()},focus(){!0!==this.skipFocus&&("function"==typeof this.$refs.editor.focus?this.$refs.editor.focus():this.$refs.container.focus())},onFocusIn(t){var e,s;(null==(s=null==(e=this.$refs.options)?void 0:e.$el)?void 0:s.contains(t.target))||this.$emit("focus",t)},goTo(t){t&&(this.skipFocus=!0,this.close(),this.$nextTick((()=>{t.$refs.container.focus(),t.open(),this.skipFocus=!1})))},open(){var t;null==(t=this.$refs.drawer)||t.open()},remove(){this.$refs.removeDialog.close(),this.$emit("remove",this.id)}}},(function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"k-block-container",class:"k-block-container-type-"+t.type,attrs:{"data-batched":t.isBatched,"data-disabled":t.fieldset.disabled,"data-hidden":t.isHidden,"data-id":t.id,"data-last-in-batch":t.isLastInBatch,"data-selected":t.isSelected,"data-translate":t.fieldset.translate,tabindex:"0"},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),t.$emit("sortDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),t.$emit("sortUp")):null}],focus:function(e){return t.$emit("focus")},focusin:t.onFocusIn}},[e("div",{staticClass:"k-block",class:t.className},[e(t.customComponent,t._g(t._b({ref:"editor",tag:"component"},"component",t.$props,!1),t.listeners))],1),e("k-block-options",t._g({ref:"options",attrs:{"is-batched":t.isBatched,"is-editable":t.isEditable,"is-full":t.isFull,"is-hidden":t.isHidden}},t.listeners)),t.isEditable&&!t.isBatched?e("k-form-drawer",{ref:"drawer",staticClass:"k-block-drawer",attrs:{id:t.id,icon:t.fieldset.icon||"box",tabs:t.tabs,title:t.fieldset.name,value:t.content},on:{close:function(e){return t.focus()},input:function(e){return t.$emit("update",e)}},scopedSlots:t._u([{key:"options",fn:function(){return[t.isHidden?e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"hidden"},on:{click:function(e){return t.$emit("show")}}}):t._e(),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.prev,icon:"angle-left"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.goTo(t.prev)}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.goTo(t.next)}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.confirmToRemove.apply(null,arguments)}}})]},proxy:!0}],null,!1,2211169536)}):t._e(),e("k-remove-dialog",{ref:"removeDialog",attrs:{text:t.$t("field.blocks.delete.confirm")},on:{submit:t.remove}})],1)}),[],!1,null,null,null,null).exports;var vo=Mt({components:{"k-block-pasteboard":Mt({inheritAttrs:!1,computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{close(){this.$refs.dialog.close()},open(){this.$refs.dialog.open()},onPaste(t){this.$emit("paste",t),this.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-block-importer",attrs:{"cancel-button":!1,"submit-button":!1,size:"large"}},[e("label",{attrs:{for:"pasteboard"},domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}}),e("textarea",{attrs:{id:"pasteboard"},on:{paste:function(e){return e.preventDefault(),t.onPaste.apply(null,arguments)}}})])}),[],!1,null,null,null,null).exports},inheritAttrs:!1,props:{autofocus:Boolean,empty:String,endpoints:Object,fieldsets:Object,fieldsetGroups:Object,group:String,max:{type:Number,default:null},value:{type:Array,default:()=>[]}},data(){return{isMultiSelectKey:!1,batch:[],blocks:this.value,current:null,isFocussed:!1}},computed:{draggableOptions(){return{id:this._uid,handle:".k-sort-handle",list:this.blocks,move:this.move,delay:10,data:{fieldsets:this.fieldsets,isFull:this.isFull},options:{group:this.group}}},hasFieldsets(){return Object.keys(this.fieldsets).length},isEditing(){return this.$store.state.dialog||this.$store.state.drawers.open.length>0},isEmpty(){return 0===this.blocks.length},isFull(){return null!==this.max&&this.blocks.length>=this.max},selected(){return this.current},selectedOrBatched(){return this.batch.length>0?this.batch:this.selected?[this.selected]:[]}},watch:{value(){this.blocks=this.value}},created(){this.$events.$on("blur",this.onBlur),this.$events.$on("copy",this.copy),this.$events.$on("focus",this.onOutsideFocus),this.$events.$on("keydown",this.onKey),this.$events.$on("keyup",this.onKey),this.$events.$on("paste",this.onPaste)},destroyed(){this.$events.$off("blur",this.onBlur),this.$events.$off("copy",this.copy),this.$events.$off("focus",this.onOutsideFocus),this.$events.$off("keydown",this.onKey),this.$events.$off("keyup",this.onKey),this.$events.$off("paste",this.onPaste)},mounted(){!0===this.$props.autofocus&&this.focus()},methods:{append(t,e){if("string"!=typeof t){if(Array.isArray(t)){let s=this.$helper.clone(t).map((t=>(t.id=this.$helper.uuid(),t)));const i=Object.keys(this.fieldsets);if(s=s.filter((t=>i.includes(t.type))),this.max){const t=this.max-this.blocks.length;s=s.slice(0,t)}this.blocks.splice(e,0,...s),this.save()}}else this.add(t,e)},async add(t="text",e){const s=await this.$api.get(this.endpoints.field+"/fieldsets/"+t);this.blocks.splice(e,0,s),this.save(),this.$nextTick((()=>{this.focusOrOpen(s)}))},addToBatch(t){null!==this.selected&&!1===this.batch.includes(this.selected)&&(this.batch.push(this.selected),this.current=null),!1===this.batch.includes(t.id)&&this.batch.push(t.id)},choose(t){if(1===Object.keys(this.fieldsets).length){const e=Object.values(this.fieldsets)[0].type;this.add(e,t)}else this.$refs.selector.open(t)},chooseToConvert(t){this.$refs.selector.open(t,{disabled:[t.type],headline:this.$t("field.blocks.changeType"),event:"convert"})},click(t){this.$emit("click",t)},confirmToRemoveAll(){this.$refs.removeAll.open()},confirmToRemoveSelected(){this.$refs.removeSelected.open()},copy(t){if(!0===this.isEditing)return!1;if(0===this.blocks.length)return!1;if(0===this.selectedOrBatched.length)return!1;if(!0===this.isInputEvent(t))return!1;let e=[];if(this.blocks.forEach((t=>{this.selectedOrBatched.includes(t.id)&&e.push(t)})),0===e.length)return!1;this.$helper.clipboard.write(e,t),t instanceof ClipboardEvent==!1&&(this.batch=this.selectedOrBatched),this.$store.dispatch("notification/success",`${e.length} copied!`)},copyAll(){this.selectAll(),this.copy(),this.deselectAll()},async convert(t,e){var s;const i=this.findIndex(e.id);if(-1===i)return!1;const n=t=>{var e;let s={};for(const i of Object.values(null!=(e=null==t?void 0:t.tabs)?e:{}))s={...s,...i.fields};return s},o=this.blocks[i],r=await this.$api.get(this.endpoints.field+"/fieldsets/"+t),l=this.fieldsets[o.type],a=this.fieldsets[t];if(!a)return!1;let u=r.content;const c=n(a),d=n(l);for(const[p,h]of Object.entries(c)){const t=d[p];(null==t?void 0:t.type)===h.type&&(null==(s=null==o?void 0:o.content)?void 0:s[p])&&(u[p]=o.content[p])}this.blocks[i]={...r,id:o.id,content:u},this.save()},deselectAll(){this.batch=[],this.current=null},async duplicate(t,e){const s={...this.$helper.clone(t),id:this.$helper.uuid()};this.blocks.splice(e+1,0,s),this.save()},fieldset(t){return this.fieldsets[t.type]||{icon:"box",name:t.type,tabs:{content:{fields:{}}},type:t.type}},find(t){return this.blocks.find((e=>e.id===t))},findIndex(t){return this.blocks.findIndex((e=>e.id===t))},focus(t){(null==t?void 0:t.id)&&this.$refs["block-"+t.id]?this.$refs["block-"+t.id][0].focus():this.blocks[0]&&this.focus(this.blocks[0])},focusOrOpen(t){this.fieldsets[t.type].wysiwyg?this.focus(t):this.open(t)},hide(t){this.$set(t,"isHidden",!0),this.save()},isBatched(t){return this.batch.includes(t.id)},isInputEvent(){const t=document.querySelector(":focus");return t&&t.matches("input, textarea, [contenteditable], .k-writer")},isLastInBatch(t){const[e]=this.batch.slice(-1);return e&&t.id===e},isOnlyInstance:()=>1===document.querySelectorAll(".k-blocks").length,isSelected(t){return this.selected&&this.selected===t.id},move(t){if(t.from!==t.to){const e=t.draggedContext.element,s=t.relatedContext.component.componentData||t.relatedContext.component.$parent.componentData;if(!1===Object.keys(s.fieldsets).includes(e.type))return!1;if(!0===s.isFull)return!1}return!0},onBlur(){0===this.batch.length&&(this.isMultiSelectKey=!1)},onKey(t){this.isMultiSelectKey=t.metaKey||t.ctrlKey||t.altKey},onOutsideFocus(t){if("function"==typeof t.target.closest&&t.target.closest(".k-dialog"))return;const e=document.querySelector(".k-overlay:last-of-type");if(!1===this.$el.contains(t.target)&&(!e||!1===e.contains(t.target)))return this.select(null);if(e){const e=this.$el.closest(".k-layout-column");if(!1===(null==e?void 0:e.contains(t.target)))return this.select(null)}},onPaste(t){var e;return!0!==this.isInputEvent(t)&&(!0===this.isEditing?!0===(null==(e=this.$refs.selector)?void 0:e.isOpen())&&this.paste(t):(0!==this.selectedOrBatched.length||!0===this.isOnlyInstance())&&this.paste(t))},open(t){this.$refs["block-"+t.id]&&this.$refs["block-"+t.id][0].open()},async paste(t){const e=this.$helper.clipboard.read(t),s=await this.$api.post(this.endpoints.field+"/paste",{html:e});let i=this.selectedOrBatched[this.selectedOrBatched.length-1],n=this.findIndex(i);-1===n&&(n=this.blocks.length),this.append(s,n+1)},pasteboard(){this.$refs.pasteboard.open()},prevNext(t){if(this.blocks[t]){let e=this.blocks[t];if(this.$refs["block-"+e.id])return this.$refs["block-"+e.id][0]}},remove(t){var e;const s=this.findIndex(t.id);-1!==s&&((null==(e=this.selected)?void 0:e.id)===t.id&&this.select(null),this.$delete(this.blocks,s),this.save())},removeAll(){this.batch=[],this.blocks=[],this.save(),this.$refs.removeAll.close()},removeSelected(){this.batch.forEach((t=>{const e=this.findIndex(t);-1!==e&&this.$delete(this.blocks,e)})),this.deselectAll(),this.save(),this.$refs.removeSelected.close()},save(){this.$emit("input",this.blocks)},select(t,e=null){if(e&&this.isMultiSelectKey&&this.onKey(e),t&&this.isMultiSelectKey)return this.addToBatch(t),void(this.current=null);this.batch=[],this.current=t?t.id:null},selectAll(){this.batch=Object.values(this.blocks).map((t=>t.id))},show(t){this.$set(t,"isHidden",!1),this.save()},sort(t,e,s){if(s<0)return;let i=this.$helper.clone(this.blocks);i.splice(e,1),i.splice(s,0,t),this.blocks=i,this.save(),this.$nextTick((()=>{this.focus(t)}))},update(t,e){const s=this.findIndex(t.id);-1!==s&&Object.entries(e).forEach((([t,e])=>{this.$set(this.blocks[s].content,t,e)})),this.save()}}},(function(){var t=this,e=t._self._c;return e("div",{ref:"wrapper",staticClass:"k-blocks",attrs:{"data-empty":0===t.blocks.length,"data-multi-select-key":t.isMultiSelectKey},on:{focusin:function(e){t.focussed=!0},focusout:function(e){t.focussed=!1}}},[t.hasFieldsets?[e("k-draggable",t._b({staticClass:"k-blocks-list",on:{sort:t.save},scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-empty",{staticClass:"k-blocks-empty",attrs:{icon:"box"},on:{click:function(e){return t.choose(t.blocks.length)}}},[t._v(" "+t._s(t.empty||t.$t("field.blocks.empty"))+" ")])]},proxy:!0}],null,!1,2413899928)},"k-draggable",t.draggableOptions,!1),t._l(t.blocks,(function(s,i){return e("k-block",t._b({key:s.id,ref:"block-"+s.id,refInFor:!0,attrs:{endpoints:t.endpoints,fieldset:t.fieldset(s),"is-batched":t.isBatched(s),"is-last-in-batch":t.isLastInBatch(s),"is-full":t.isFull,"is-hidden":!0===s.isHidden,"is-selected":t.isSelected(s),next:t.prevNext(i+1),prev:t.prevNext(i-1)},on:{append:function(e){return t.append(e,i+1)},blur:function(e){return t.select(null)},choose:function(e){return t.choose(e)},chooseToAppend:function(e){return t.choose(i+1)},chooseToConvert:function(e){return t.chooseToConvert(s)},chooseToPrepend:function(e){return t.choose(i)},copy:function(e){return t.copy()},confirmToRemoveSelected:t.confirmToRemoveSelected,duplicate:function(e){return t.duplicate(s,i)},focus:function(e){return t.select(s)},hide:function(e){return t.hide(s)},paste:function(e){return t.pasteboard()},prepend:function(e){return t.add(e,i)},remove:function(e){return t.remove(s)},sortDown:function(e){return t.sort(s,i,i+1)},sortUp:function(e){return t.sort(s,i,i-1)},show:function(e){return t.show(s)},update:function(e){return t.update(s,e)}},nativeOn:{click:function(e){return e.stopPropagation(),t.select(s,e)}}},"k-block",s,!1))})),1),e("k-block-selector",{ref:"selector",attrs:{fieldsets:t.fieldsets,"fieldset-groups":t.fieldsetGroups},on:{add:t.add,convert:t.convert,paste:function(e){return t.paste(e)}}}),e("k-remove-dialog",{ref:"removeAll",attrs:{text:t.$t("field.blocks.delete.confirm.all")},on:{submit:t.removeAll}}),e("k-remove-dialog",{ref:"removeSelected",attrs:{text:t.$t("field.blocks.delete.confirm.selected")},on:{submit:t.removeSelected}}),e("k-block-pasteboard",{ref:"pasteboard",on:{paste:function(e){return t.paste(e)}}})]:[e("k-box",{attrs:{theme:"info"}},[t._v(" No fieldsets yet ")])]],2)}),[],!1,null,null,null,null).exports;var yo=Mt({inheritAttrs:!1,props:{caption:String,captionMarks:[Boolean,Array],cover:{type:Boolean,default:!0},isEmpty:Boolean,emptyIcon:String,emptyText:String,ratio:String},computed:{ratioPadding(){return this.$helper.ratio(this.ratio||"16/9")}}},(function(){var t=this,e=t._self._c;return e("figure",{staticClass:"k-block-figure"},[t.isEmpty?e("k-button",{staticClass:"k-block-figure-empty",attrs:{icon:t.emptyIcon,text:t.emptyText},on:{click:function(e){return t.$emit("open")}}}):e("span",{staticClass:"k-block-figure-container",on:{dblclick:function(e){return t.$emit("open")}}},[t._t("default")],2),t.caption?e("figcaption",[e("k-writer",{attrs:{inline:!0,marks:t.captionMarks,value:t.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;var $o=Mt({props:{isBatched:Boolean,isEditable:Boolean,isFull:Boolean,isHidden:Boolean},methods:{open(){this.$refs.options.open()}}},(function(){var t=this,e=t._self._c;return e("k-dropdown",{staticClass:"k-block-options"},[t.isBatched?[e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("copy"),icon:"template"},on:{click:function(e){return e.preventDefault(),t.$emit("copy")}}}),e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("remove"),icon:"trash"},on:{click:function(e){return e.preventDefault(),t.$emit("confirmToRemoveSelected")}}})]:[t.isEditable?e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("edit"),icon:"edit"},on:{click:function(e){return t.$emit("open")}}}):t._e(),e("k-button",{staticClass:"k-block-options-button",attrs:{disabled:t.isFull,tooltip:t.$t("insert.after"),icon:"add"},on:{click:function(e){return t.$emit("chooseToAppend")}}}),e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("delete"),icon:"trash"},on:{click:function(e){return t.$emit("confirmToRemove")}}}),e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("more"),icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-button",{staticClass:"k-block-options-button k-sort-handle",attrs:{tooltip:t.$t("sort"),icon:"sort"},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.$emit("sortUp"))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.$emit("sortDown"))}]}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"angle-up"},on:{click:function(e){return t.$emit("chooseToPrepend")}}},[t._v(" "+t._s(t.$t("insert.before"))+" ")]),e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"angle-down"},on:{click:function(e){return t.$emit("chooseToAppend")}}},[t._v(" "+t._s(t.$t("insert.after"))+" ")]),e("hr"),t.isEditable?e("k-dropdown-item",{attrs:{icon:"edit"},on:{click:function(e){return t.$emit("open")}}},[t._v(" "+t._s(t.$t("edit"))+" ")]):t._e(),e("k-dropdown-item",{attrs:{icon:"refresh"},on:{click:function(e){return t.$emit("chooseToConvert")}}},[t._v(" "+t._s(t.$t("field.blocks.changeType"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:"template"},on:{click:function(e){return t.$emit("copy")}}},[t._v(" "+t._s(t.$t("copy"))+" ")]),e("k-dropdown-item",{attrs:{icon:"download"},on:{click:function(e){return t.$emit("paste")}}},[t._v(" "+t._s(t.$t("paste.after"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:t.isHidden?"preview":"hidden"},on:{click:function(e){return t.$emit(t.isHidden?"show":"hide")}}},[t._v(" "+t._s(!0===t.isHidden?t.$t("show"):t.$t("hide"))+" ")]),e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"copy"},on:{click:function(e){return t.$emit("duplicate")}}},[t._v(" "+t._s(t.$t("duplicate"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:"trash"},on:{click:function(e){return t.$emit("confirmToRemove")}}},[t._v(" "+t._s(t.$t("delete"))+" ")])],1)]],2)}),[],!1,null,null,null,null).exports;var _o=Mt({inheritAttrs:!1,props:{endpoint:String,fieldsets:Object,fieldsetGroups:Object},data(){return{dialogIsOpen:!1,disabled:[],headline:null,payload:null,event:"add",groups:this.createGroups()}},computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{add(t){this.$emit(this.event,t,this.payload),this.$refs.dialog.close()},close(){this.$refs.dialog.close()},createGroups(){let t={},e=0;const s=this.fieldsetGroups||{blocks:{label:this.$t("field.blocks.fieldsets.label"),sets:Object.keys(this.fieldsets)}};return Object.keys(s).forEach((i=>{let n=s[i];n.open=!1!==n.open,n.fieldsets=n.sets.filter((t=>this.fieldsets[t])).map((t=>(e++,{...this.fieldsets[t],index:e}))),0!==n.fieldsets.length&&(t[i]=n)})),t},isOpen(){return this.dialogIsOpen},navigate(t){var e,s;null==(s=null==(e=this.$refs["fieldset-"+t])?void 0:e[0])||s.focus()},onClose(){this.dialogIsOpen=!1,this.$events.$off("paste",this.close)},onOpen(){this.dialogIsOpen=!0,this.$events.$on("paste",this.close)},open(t,e={}){const s={event:"add",disabled:[],headline:null,...e};this.event=s.event,this.disabled=s.disabled,this.headline=s.headline,this.payload=t,this.$refs.dialog.open()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-block-selector",attrs:{"cancel-button":!1,"submit-button":!1,size:"medium"},on:{open:t.onOpen,close:t.onClose}},[t.headline?e("k-headline",[t._v(" "+t._s(t.headline)+" ")]):t._e(),t._l(t.groups,(function(s,i){return e("details",{key:i,attrs:{open:s.open}},[e("summary",[t._v(t._s(s.label))]),e("div",{staticClass:"k-block-types"},t._l(s.fieldsets,(function(s){return e("k-button",{key:s.name,ref:"fieldset-"+s.index,refInFor:!0,attrs:{disabled:t.disabled.includes(s.type),icon:s.icon||"box",text:s.name},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:t.navigate(s.index-1)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:t.navigate(s.index+1)}],click:function(e){return t.add(s.type)}}})})),1)])})),e("p",{staticClass:"k-clipboard-hint",domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}})],2)}),[],!1,null,null,null,null).exports;var xo=Mt({inheritAttrs:!1,props:{fieldset:Object,content:Object},computed:{icon(){return this.fieldset.icon||"box"},label(){if(!this.fieldset.label||0===this.fieldset.label.length)return!1;if(this.fieldset.label===this.fieldset.name)return!1;const t=this.$helper.string.template(this.fieldset.label,this.content);return"…"!==t&&t},name(){return this.fieldset.name}}},(function(){var t=this,e=t._self._c;return e("div",t._g({staticClass:"k-block-title"},t.$listeners),[e("k-icon",{staticClass:"k-block-icon",attrs:{type:t.icon}}),e("span",{staticClass:"k-block-name"},[t._v(" "+t._s(t.name)+" ")]),t.label?e("span",{staticClass:"k-block-label"},[t._v(" "+t._s(t.label)+" ")]):t._e()],1)}),[],!1,null,null,null,null).exports;var wo=Mt({inheritAttrs:!1,props:{content:[Object,Array],fieldset:Object},methods:{field(t,e=null){let s=null;return Object.values(this.fieldset.tabs).forEach((e=>{e.fields[t]&&(s=e.fields[t])})),s||e},open(){this.$emit("open")},update(t){this.$emit("update",{...this.content,...t})}}},null,null,!1,null,null,null,null).exports;t.component("k-block",bo),t.component("k-blocks",vo),t.component("k-block-figure",yo),t.component("k-block-options",$o),t.component("k-block-selector",_o),t.component("k-block-title",xo),t.component("k-block-type",wo);const So={"./Types/Code.vue":Gn,"./Types/Default.vue":Wn,"./Types/Gallery.vue":Zn,"./Types/Heading.vue":to,"./Types/Image.vue":so,"./Types/Line.vue":no,"./Types/List.vue":ro,"./Types/Markdown.vue":ao,"./Types/Quote.vue":co,"./Types/Table.vue":ho,"./Types/Text.vue":fo,"./Types/Video.vue":ko};Object.keys(So).map((e=>{const s=e.match(/\/([a-zA-Z]*)\.vue/)[1].toLowerCase();let i=So[e].default;i.extends=wo,t.component("k-block-type-"+s,i)}));var Co={inheritAttrs:!1,props:{column:{type:Object,default:()=>({})},field:Object,value:{}}};var Oo=Mt({inheritAttrs:!1,mixins:[Co],props:{value:[Array,String]},computed:{bubbles(){var t,e;let s=this.value;const i=(null==(t=this.column)?void 0:t.options)||(null==(e=this.field)?void 0:e.options)||[];return"string"==typeof s&&(s=s.split(",")),s.map((t=>{"string"==typeof t&&(t={value:t,text:t});for(const e of i)e.value===t.value&&(t.text=e.text);return{back:"light",color:"black",...t}}))}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-bubbles-field-preview",class:t.$options.class},[e("k-bubbles",{attrs:{bubbles:t.bubbles}})],1)}),[],!1,null,null,null,null).exports;var Ao=Mt({inheritAttrs:!1,extends:Oo,class:"k-array-field-preview",computed:{bubbles(){return[{text:1===this.value.length?`1 ${this.$t("entry")}`:`${this.value.length} ${this.$t("entries")}`}]}}},null,null,!1,null,null,null,null).exports;var To=Mt({mixins:[Co],inheritAttrs:!1,computed:{text(){return this.value}}},(function(){var t=this;return(0,t._self._c)("p",{staticClass:"k-text-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),t._t("default",(function(){return[t._v(t._s(t.text))]})),t._v(" "+t._s(t.column.after)+" ")],2)}),[],!1,null,null,null,null).exports;var Io=Mt({inheritAttrs:!1,extends:To,props:{value:String},class:"k-date-field-preview",computed:{text(){var t,e,s,i,n,o;if("string"!=typeof this.value)return"";const r=this.$library.dayjs(this.value);if(!r)return"";let l=(null==(t=this.column)?void 0:t.display)||(null==(e=this.field)?void 0:e.display)||"YYYY-MM-DD",a=(null==(i=null==(s=this.column)?void 0:s.time)?void 0:i.display)||(null==(o=null==(n=this.field)?void 0:n.time)?void 0:o.display);return a&&(l+=" "+a),r.format(l)}}},null,null,!1,null,null,null,null).exports;var Mo=Mt({mixins:[Co],props:{value:[String,Object]},computed:{link(){return"object"==typeof this.value?this.value.href:this.value},text(){return"object"==typeof this.value?this.value.text:this.link}}},(function(){var t=this,e=t._self._c;return e("p",{staticClass:"k-url-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),e("k-link",{attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[t._v(" "+t._s(t.text)+" ")]),t._v(" "+t._s(t.column.after)+" ")],1)}),[],!1,null,null,null,null).exports;var Lo=Mt({extends:Mo,class:"k-email-field-preview"},null,null,!1,null,null,null,null).exports;var Eo=Mt({inheritAttrs:!1,extends:Oo,class:"k-files-field-preview",computed:{bubbles(){return this.value.map((t=>({text:t.filename,link:t.link,image:t.image})))}}},null,null,!1,null,null,null,null).exports;var jo=Mt({mixins:[Co],inheritAttrs:!1,props:{value:Object}},(function(){var t=this;return(0,t._self._c)("k-status-icon",t._b({staticClass:"k-flag-field-preview"},"k-status-icon",t.value,!1))}),[],!1,null,null,null,null).exports;var Bo=Mt({inheritAttrs:!1,mixins:[Co],props:{value:String},computed:{html(){return this.value}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-html-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),e("div",{domProps:{innerHTML:t._s(t.html)}}),t._v(" "+t._s(t.column.after)+" ")])}),[],!1,null,null,null,null).exports;var Do=Mt({inheritAttrs:!1,mixins:[Co],props:{value:[Object]}},(function(){return(0,this._self._c)("k-item-image",{staticClass:"k-image-field-preview",attrs:{image:this.value,layout:"list"}})}),[],!1,null,null,null,null).exports;var Po=Mt({inheritAttrs:!1,extends:Oo,class:"k-pages-field-preview"},null,null,!1,null,null,null,null).exports;var No=Mt({inheritAttrs:!1,extends:To,props:{value:String},class:"k-time-field-preview",computed:{text(){const t=this.$library.dayjs.iso(this.value,"time");return(null==t?void 0:t.format(this.field.display))||""}}},null,null,!1,null,null,null,null).exports;var qo=Mt({props:{field:Object,value:Boolean,column:Object},computed:{text(){return!1!==this.column.text?this.field.text:null}}},(function(){var t=this;return(0,t._self._c)("k-input",{staticClass:"k-toggle-field-preview",attrs:{text:t.text,value:t.value,type:"toggle"},on:{input:function(e){return t.$emit("input",e)}}})}),[],!1,null,null,null,null).exports;var Fo=Mt({inheritAttrs:!1,extends:Oo,class:"k-users-field-preview",computed:{bubble(){return this.value.map((t=>({text:t.username,link:t.link,image:t.image})))}}},null,null,!1,null,null,null,null).exports;t.component("k-array-field-preview",Ao),t.component("k-bubbles-field-preview",Oo),t.component("k-date-field-preview",Io),t.component("k-email-field-preview",Lo),t.component("k-files-field-preview",Eo),t.component("k-flag-field-preview",jo),t.component("k-html-field-preview",Bo),t.component("k-image-field-preview",Do),t.component("k-pages-field-preview",Po),t.component("k-text-field-preview",To),t.component("k-toggle-field-preview",qo),t.component("k-time-field-preview",No),t.component("k-url-field-preview",Mo),t.component("k-users-field-preview",Fo),t.component("k-list-field-preview",Bo),t.component("k-writer-field-preview",Bo),t.component("k-checkboxes-field-preview",Oo),t.component("k-multiselect-field-preview",Oo),t.component("k-radio-field-preview",Oo),t.component("k-select-field-preview",Oo),t.component("k-tags-field-preview",Oo),t.component("k-dialog",Lt),t.component("k-error-dialog",jt),t.component("k-fiber-dialog",Bt),t.component("k-files-dialog",Pt),t.component("k-form-dialog",Nt),t.component("k-language-dialog",qt),t.component("k-pages-dialog",Ft),t.component("k-remove-dialog",Rt),t.component("k-text-dialog",zt),t.component("k-users-dialog",Yt),t.component("k-drawer",Ht),t.component("k-form-drawer",Ut),t.component("k-calendar",Jt),t.component("k-counter",Gt),t.component("k-autocomplete",Kt),t.component("k-form",Vt),t.component("k-form-buttons",Wt),t.component("k-form-indicator",Xt),t.component("k-field",ue),t.component("k-fieldset",ce),t.component("k-input",pe),t.component("k-login",he),t.component("k-login-code",me),t.component("k-times",fe),t.component("k-upload",ge),t.component("k-writer",Xe),t.component("k-login-alert",Ze),t.component("k-structure-form",Qe),t.component("k-toolbar",es),t.component("k-toolbar-email-dialog",ss),t.component("k-toolbar-link-dialog",is),t.component("k-aspect-ratio",$i),t.component("k-bar",_i),t.component("k-box",xi),t.component("k-bubble",wi),t.component("k-bubbles",Si),t.component("k-collection",Ci),t.component("k-column",Oi),t.component("k-dropzone",Ai),t.component("k-empty",Ti),t.component("k-file-preview",Ii),t.component("k-grid",Mi),t.component("k-header",Li),t.component("k-inside",Ei),t.component("k-item",ji),t.component("k-item-image",Bi),t.component("k-items",Di),t.component("k-overlay",Pi),t.component("k-panel",Ni),t.component("k-stats",qi),t.component("k-table",Fi),t.component("k-table-cell",Ri),t.component("k-tabs",zi),t.component("k-view",Yi),t.component("k-draggable",Hi),t.component("k-error-boundary",Ui),t.component("k-fatal",Ki),t.component("k-headline",Ji),t.component("k-icon",Gi),t.component("k-icons",Vi),t.component("k-image",Wi),t.component("k-loader",Xi),t.component("k-offline-warning",Zi),t.component("k-progress",tn),t.component("k-registration",en),t.component("k-status-icon",nn),t.component("k-sort-handle",sn),t.component("k-text",on),t.component("k-user-info",rn),t.component("k-breadcrumb",ln),t.component("k-button",an),t.component("k-button-disabled",un),t.component("k-button-group",cn),t.component("k-button-link",dn),t.component("k-button-native",hn),t.component("k-dropdown",mn),t.component("k-dropdown-content",gn),t.component("k-dropdown-item",kn),t.component("k-languages-dropdown",vn),t.component("k-link",bn),t.component("k-options-dropdown",yn),t.component("k-pagination",$n),t.component("k-prev-next",_n),t.component("k-search",xn),t.component("k-tag",wn),t.component("k-topbar",Sn),t.component("k-account-view",Bn),t.component("k-error-view",Dn),t.component("k-file-view",Pn),t.component("k-installation-view",Nn),t.component("k-languages-view",qn),t.component("k-login-view",Fn),t.component("k-page-view",Rn),t.component("k-plugin-view",zn),t.component("k-reset-password-view",Yn),t.component("k-site-view",Hn),t.component("k-system-view",Un),t.component("k-users-view",Kn),t.component("k-user-view",jn);t.config.productionTip=!1,t.config.devtools=!0,t.use(et),t.use(Ct),t.use(At),t.use(It),t.use(st),t.use(Ot),t.use(ut),t.use(U,tt),t.use(q),t.use(F),new t({store:tt,created(){window.panel.$vue=window.panel.app=this,window.panel.plugins.created.forEach((t=>t(this))),this.$store.dispatch("content/init")},render:t=>t(K)}).$mount("#app");
diff --git a/kirby/panel/dist/js/vendor.js b/kirby/panel/dist/js/vendor.js
index 6df18c1..352c160 100755
--- a/kirby/panel/dist/js/vendor.js
+++ b/kirby/panel/dist/js/vendor.js
@@ -1,19 +1,19 @@
/*!
- * Vue.js v2.6.14
- * (c) 2014-2021 Evan You
+ * Vue.js v2.7.4
+ * (c) 2014-2022 Evan You
* Released under the MIT License.
*/
-var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var s=Object.prototype.toString;function a(e){return"[object Object]"===s.call(e)}function l(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function c(e){return n(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function u(e){return null==e?"":Array.isArray(e)||a(e)&&e.toString===s?JSON.stringify(e,null,2):String(e)}function d(e){var t=parseFloat(e);return isNaN(t)?e:t}function h(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var g=Object.prototype.hasOwnProperty;function v(e,t){return g.call(e,t)}function y(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var b=/-(\w)/g,w=y((function(e){return e.replace(b,(function(e,t){return t?t.toUpperCase():""}))})),x=y((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),S=/\B([A-Z])/g,k=y((function(e){return e.replace(S,"-$1").toLowerCase()}));var C=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function O(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function M(e,t){for(var n in t)e[n]=t[n];return e}function _(e){for(var t={},n=0;n0,Y=H&&H.indexOf("edge/")>0;H&&H.indexOf("android");var U=H&&/iphone|ipad|ipod|ios/.test(H)||"ios"===q;H&&/chrome\/\d+/.test(H),H&&/phantomjs/.test(H);var X,G=H&&H.match(/firefox\/(\d+)/),Z={}.watch,Q=!1;if(V)try{var ee={};Object.defineProperty(ee,"passive",{get:function(){Q=!0}}),window.addEventListener("test-passive",null,ee)}catch(wy){}var te=function(){return void 0===X&&(X=!V&&!W&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),X},ne=V&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function re(e){return"function"==typeof e&&/native code/.test(e.toString())}var ie,oe="undefined"!=typeof Symbol&&re(Symbol)&&"undefined"!=typeof Reflect&&re(Reflect.ownKeys);ie="undefined"!=typeof Set&&re(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var se=D,ae=0,le=function(){this.id=ae++,this.subs=[]};le.prototype.addSub=function(e){this.subs.push(e)},le.prototype.removeSub=function(e){m(this.subs,e)},le.prototype.depend=function(){le.target&&le.target.addDep(this)},le.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!v(i,"default"))s=!1;else if(""===s||s===k(e)){var l=Le(String,i.type);(l<0||a0&&(ut((a=dt(a,(o||"")+"_"+s))[0])&&ut(c)&&(u[l]=me(c.text+a[0].text),a.shift()),u.push.apply(u,a)):i(a)?ut(c)?u[l]=me(c.text+a):""!==a&&u.push(me(a)):ut(a)&&ut(c)?u[l]=me(c.text+a.text):(r(e._isVList)&&n(a.tag)&&t(a.key)&&n(o)&&(a.key="__vlist"+o+"_"+s+"__"),u.push(a)));return u}function ht(e,t){if(e){for(var n=Object.create(null),r=oe?Reflect.ownKeys(e):Object.keys(e),i=0;i0,s=t?!!t.$stable:!o,a=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(s&&r&&r!==e&&a===r.$key&&!o&&!r.$hasNormal)return r;for(var l in i={},t)t[l]&&"$"!==l[0]&&(i[l]=vt(n,l,t[l]))}else i={};for(var c in n)c in i||(i[c]=yt(n,c));return t&&Object.isExtensible(t)&&(t._normalized=i),F(i,"$stable",s),F(i,"$key",a),F(i,"$hasNormal",o),i}function vt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({}),t=(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:ct(e))&&e[0];return e&&(!t||1===e.length&&t.isComment&&!mt(t))?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function yt(e,t){return function(){return e[t]}}function bt(e,t){var r,i,s,a,l;if(Array.isArray(e)||"string"==typeof e)for(r=new Array(e.length),i=0,s=e.length;idocument.createEvent("Event").timeStamp&&(dn=function(){return hn.now()})}function fn(){var e,t;for(un=dn(),ln=!0,rn.sort((function(e,t){return e.id-t.id})),cn=0;cncn&&rn[n].id>e.id;)n--;rn.splice(n+1,0,e)}else rn.push(e);an||(an=!0,et(fn))}}(this)},mn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user){var n='callback for watcher "'+this.expression+'"';Ve(this.cb,this.vm,[e,t],this.vm,n)}else this.cb.call(this.vm,e,t)}}},mn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},mn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},mn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||m(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var gn={enumerable:!0,configurable:!0,get:D,set:D};function vn(e,t,n){gn.get=function(){return this[t][n]},gn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,gn)}function yn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&xe(!1);var o=function(o){i.push(o);var s=Re(o,t,n,e);Ce(r,o,s),o in e||vn(e,"_props",o)};for(var s in t)o(s);xe(!0)}(e,t.props),t.methods&&function(e,t){for(var n in e.$options.props,t)e[n]="function"!=typeof t[n]?D:C(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;a(t=e._data="function"==typeof t?function(e,t){ue();try{return e.call(t,t)}catch(wy){return Be(wy,t,"data()"),{}}finally{de()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props;e.$options.methods;var i=n.length;for(;i--;){var o=n[i];r&&v(r,o)||j(o)||vn(e,"_data",o)}ke(t,!0)}(e):ke(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=te();for(var i in t){var o=t[i],s="function"==typeof o?o:o.get;r||(n[i]=new mn(e,s||D,D,bn)),i in e||wn(e,i,o)}}(e,t.computed),t.watch&&t.watch!==Z&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===s.call(n)&&e.test(t));var n}function $n(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var s=n[o];if(s){var a=s.name;a&&!t(a)&&An(n,o,r,i)}}}function An(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,m(n,t)}Mn.prototype._init=function(t){var n=this;n._uid=Cn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=Pe(On(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&Xt(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=ft(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return Bt(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Bt(t,e,n,r,i,!0)};var o=r&&r.data;Ce(t,"$attrs",o&&o.attrs||e,null,!0),Ce(t,"$listeners",n._parentListeners||e,null,!0)}(n),nn(n,"beforeCreate"),function(e){var t=ht(e.$options.inject,e);t&&(xe(!1),Object.keys(t).forEach((function(n){Ce(e,n,t[n])})),xe(!0))}(n),yn(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),nn(n,"created"),n.$options.el&&n.$mount(n.$options.el)},function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=Oe,e.prototype.$delete=Me,e.prototype.$watch=function(e,t,n){var r=this;if(a(t))return kn(r,e,t,n);(n=n||{}).user=!0;var i=new mn(r,e,t,n);if(n.immediate){var o='callback for immediate watcher "'+i.expression+'"';ue(),Ve(t,r,[i.value],r,o),de()}return function(){i.teardown()}}}(Mn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?O(n):n;for(var r=O(arguments,1),i='event handler for "'+e+'"',o=0,s=n.length;oparseInt(this.max)&&An(t,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)An(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",(function(t){$n(e,(function(e){return Tn(t,e)}))})),this.$watch("exclude",(function(t){$n(e,(function(e){return!Tn(t,e)}))}))},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=Jt(e),n=t&&t.componentOptions;if(n){var r=Dn(n),i=this.include,o=this.exclude;if(i&&(!r||!Tn(i,r))||o&&r&&Tn(o,r))return t;var s=this.cache,a=this.keys,l=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;s[l]?(t.componentInstance=s[l].componentInstance,m(a,l),a.push(l)):(this.vnodeToCache=t,this.keyToCache=l),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return R}};Object.defineProperty(e,"config",t),e.util={warn:se,extend:M,mergeOptions:Pe,defineReactive:Ce},e.set=Oe,e.delete=Me,e.nextTick=et,e.observable=function(e){return ke(e),e},e.options=Object.create(null),P.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,M(e.options.components,Nn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=O(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Pe(this.options,e),this}}(e),_n(e),function(e){P.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&a(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(Mn),Object.defineProperty(Mn.prototype,"$isServer",{get:te}),Object.defineProperty(Mn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Mn,"FunctionalRenderContext",{value:Pt}),Mn.version="2.6.14";var Pn=h("style,class"),In=h("input,textarea,option,select,progress"),Rn=function(e,t,n){return"value"===n&&In(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},zn=h("contenteditable,draggable,spellcheck"),jn=h("events,caret,typing,plaintext-only"),Fn=h("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Ln="http://www.w3.org/1999/xlink",Bn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Vn=function(e){return Bn(e)?e.slice(6,e.length):""},Wn=function(e){return null==e||!1===e};function qn(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Hn(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=Hn(t,r.data));return function(e,t){if(n(e)||n(t))return Jn(e,Kn(t));return""}(t.staticClass,t.class)}function Hn(e,t){return{staticClass:Jn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function Jn(e,t){return e?t?e+" "+t:e:t||""}function Kn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?yr(e,t,n):Fn(t)?Wn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):zn(t)?e.setAttribute(t,function(e,t){return Wn(t)||"false"===t?"false":"contenteditable"===e&&jn(t)?t:"true"}(t,n)):Bn(t)?Wn(n)?e.removeAttributeNS(Ln,Vn(t)):e.setAttributeNS(Ln,t,n):yr(e,t,n)}function yr(e,t,n){if(Wn(n))e.removeAttribute(t);else{if(J&&!K&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var br={create:gr,update:gr};function wr(e,r){var i=r.elm,o=r.data,s=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(s)||t(s.staticClass)&&t(s.class)))){var a=qn(r),l=i._transitionClasses;n(l)&&(a=Jn(a,Kn(l))),a!==i._prevClass&&(i.setAttribute("class",a),i._prevClass=a)}}var xr,Sr,kr,Cr,Or,Mr,_r={create:wr,update:wr},Dr=/[\w).+\-_$\]]/;function Tr(e){var t,n,r,i,o,s=!1,a=!1,l=!1,c=!1,u=0,d=0,h=0,f=0;for(r=0;r=0&&" "===(m=e.charAt(p));p--);m&&Dr.test(m)||(c=!0)}}else void 0===i?(f=r+1,i=e.slice(0,r).trim()):g();function g(){(o||(o=[])).push(e.slice(f,r).trim()),f=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==f&&g(),o)for(r=0;r-1?{exp:e.slice(0,Cr),key:'"'+e.slice(Cr+1)+'"'}:{exp:e,key:null};Sr=e,Cr=Or=Mr=0;for(;!Jr();)Kr(kr=Hr())?Ur(kr):91===kr&&Yr(kr);return{exp:e.slice(0,Or),key:e.slice(Or+1,Mr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function Hr(){return Sr.charCodeAt(++Cr)}function Jr(){return Cr>=xr}function Kr(e){return 34===e||39===e}function Yr(e){var t=1;for(Or=Cr;!Jr();)if(Kr(e=Hr()))Ur(e);else if(91===e&&t++,93===e&&t--,0===t){Mr=Cr;break}}function Ur(e){for(var t=e;!Jr()&&(e=Hr())!==t;);}var Xr;function Gr(e,t,n){var r=Xr;return function i(){var o=t.apply(null,arguments);null!==o&&ei(e,i,n,r)}}var Zr=Je&&!(G&&Number(G[1])<=53);function Qr(e,t,n,r){if(Zr){var i=un,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}Xr.addEventListener(e,t,Q?{capture:n,passive:r}:n)}function ei(e,t,n,r){(r||Xr).removeEventListener(e,t._wrapper||t,n)}function ti(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};Xr=r.elm,function(e){if(n(e.__r)){var t=J?"change":"input";e[t]=[].concat(e.__r,e[t]||[]),delete e.__r}n(e.__c)&&(e.change=[].concat(e.__c,e.change||[]),delete e.__c)}(i),st(i,o,Qr,ei,Gr,r.context),Xr=void 0}}var ni,ri={create:ti,update:ti};function ii(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,s=r.elm,a=e.data.domProps||{},l=r.data.domProps||{};for(i in n(l.__ob__)&&(l=r.data.domProps=M({},l)),a)i in l||(s[i]="");for(i in l){if(o=l[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===a[i])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===i&&"PROGRESS"!==s.tagName){s._value=o;var c=t(o)?"":String(o);oi(s,c)&&(s.value=c)}else if("innerHTML"===i&&Xn(s.tagName)&&t(s.innerHTML)){(ni=ni||document.createElement("div")).innerHTML="";for(var u=ni.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;u.firstChild;)s.appendChild(u.firstChild)}else if(o!==a[i])try{s[i]=o}catch(wy){}}}}function oi(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(wy){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.number)return d(r)!==d(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var si={create:ii,update:ii},ai=y((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}));function li(e){var t=ci(e.style);return e.staticStyle?M(e.staticStyle,t):t}function ci(e){return Array.isArray(e)?_(e):"string"==typeof e?ai(e):e}var ui,di=/^--/,hi=/\s*!important$/,fi=function(e,t,n){if(di.test(t))e.style.setProperty(t,n);else if(hi.test(n))e.style.setProperty(k(t),n.replace(hi,""),"important");else{var r=mi(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(yi).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function wi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(yi).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function xi(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&M(t,Si(e.name||"v")),M(t,e),t}return"string"==typeof e?Si(e):void 0}}var Si=y((function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}})),ki=V&&!K,Ci="transition",Oi="transitionend",Mi="animation",_i="animationend";ki&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ci="WebkitTransition",Oi="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Mi="WebkitAnimation",_i="webkitAnimationEnd"));var Di=V?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ti(e){Di((function(){Di(e)}))}function $i(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),bi(e,t))}function Ai(e,t){e._transitionClasses&&m(e._transitionClasses,t),wi(e,t)}function Ei(e,t,n){var r=Pi(e,t),i=r.type,o=r.timeout,s=r.propCount;if(!i)return n();var a="transition"===i?Oi:_i,l=0,c=function(){e.removeEventListener(a,u),n()},u=function(t){t.target===e&&++l>=s&&c()};setTimeout((function(){l0&&(n="transition",u=s,d=o.length):"animation"===t?c>0&&(n="animation",u=c,d=l.length):d=(n=(u=Math.max(s,c))>0?s>c?"transition":"animation":null)?"transition"===n?o.length:l.length:0,{type:n,timeout:u,propCount:d,hasTransform:"transition"===n&&Ni.test(r[Ci+"Property"])}}function Ii(e,t){for(;e.length1}function Bi(e,t){!0!==t.data.show&&zi(t)}var Vi=function(e){var o,s,a={},l=e.modules,c=e.nodeOps;for(o=0;op?b(e,t(i[v+1])?null:i[v+1].elm,i,f,v,o):f>v&&x(r,h,p)}(h,m,v,o,u):n(v)?(n(e.text)&&c.setTextContent(h,""),b(h,null,v,0,v.length-1,o)):n(m)?x(m,0,m.length-1):n(e.text)&&c.setTextContent(h,""):e.text!==i.text&&c.setTextContent(h,i.text),n(p)&&n(f=p.hook)&&n(f=f.postpatch)&&f(e,i)}}}function O(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,s.selected!==o&&(s.selected=o);else if(A(Ki(s),r))return void(e.selectedIndex!==a&&(e.selectedIndex=a));i||(e.selectedIndex=-1)}}function Ji(e,t){return t.every((function(t){return!A(t,e)}))}function Ki(e){return"_value"in e?e._value:e.value}function Yi(e){e.target.composing=!0}function Ui(e){e.target.composing&&(e.target.composing=!1,Xi(e.target,"input"))}function Xi(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Gi(e){return!e.componentInstance||e.data&&e.data.transition?e:Gi(e.componentInstance._vnode)}var Zi={model:Wi,show:{bind:function(e,t,n){var r=t.value,i=(n=Gi(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,zi(n,(function(){e.style.display=o}))):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Gi(n)).data&&n.data.transition?(n.data.show=!0,r?zi(n,(function(){e.style.display=e.__vOriginalDisplay})):ji(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Qi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function eo(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?eo(Jt(t.children)):e}function to(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[w(o)]=i[o];return t}function no(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var ro=function(e){return e.tag||mt(e)},io=function(e){return"show"===e.name},oo={name:"transition",props:Qi,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(ro)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var s=eo(o);if(!s)return o;if(this._leaving)return no(e,o);var a="__transition-"+this._uid+"-";s.key=null==s.key?s.isComment?a+"comment":a+s.tag:i(s.key)?0===String(s.key).indexOf(a)?s.key:a+s.key:s.key;var l=(s.data||(s.data={})).transition=to(this),c=this._vnode,u=eo(c);if(s.data.directives&&s.data.directives.some(io)&&(s.data.show=!0),u&&u.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(s,u)&&!mt(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var d=u.data.transition=M({},l);if("out-in"===r)return this._leaving=!0,at(d,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),no(e,o);if("in-out"===r){if(mt(s))return c;var h,f=function(){h()};at(l,"afterEnter",f),at(l,"enterCancelled",f),at(d,"delayLeave",(function(e){h=e}))}}return o}}},so=M({tag:String,moveClass:String},Qi);delete so.mode;var ao={props:so,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Zt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],s=to(this),a=0;a-1?Qn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Qn[e]=/HTMLUnknownElement/.test(t.toString())},M(Mn.options.directives,Zi),M(Mn.options.components,ho),Mn.prototype.__patch__=V?Vi:D,Mn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=pe),nn(e,"beforeMount"),r=function(){e._update(e._render(),n)},new mn(e,r,D,{before:function(){e._isMounted&&!e._isDestroyed&&nn(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,nn(e,"mounted")),e}(this,e=e&&V?tr(e):void 0,t)},V&&setTimeout((function(){R.devtools&&ne&&ne.emit("init",Mn)}),0);var fo=/\{\{((?:.|\r?\n)+?)\}\}/g,po=/[-.*+?^${}()|[\]\/\\]/g,mo=y((function(e){var t=e[0].replace(po,"\\$&"),n=e[1].replace(po,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")}));var go={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=Lr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Fr(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var vo,yo={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=Lr(e,"style");n&&(e.staticStyle=JSON.stringify(ai(n)));var r=Fr(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},bo=function(e){return(vo=vo||document.createElement("div")).innerHTML=e,vo.textContent},wo=h("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),xo=h("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),So=h("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),ko=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Co=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Oo="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+z.source+"]*",Mo="((?:"+Oo+"\\:)?"+Oo+")",_o=new RegExp("^<"+Mo),Do=/^\s*(\/?)>/,To=new RegExp("^<\\/"+Mo+"[^>]*>"),$o=/^]+>/i,Ao=/^",""":'"',"&":"&","
":"\n"," ":"\t","'":"'"},Ro=/&(?:lt|gt|quot|amp|#39);/g,zo=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,jo=h("pre,textarea",!0),Fo=function(e,t){return e&&jo(e)&&"\n"===t[0]};function Lo(e,t){var n=t?zo:Ro;return e.replace(n,(function(e){return Io[e]}))}var Bo,Vo,Wo,qo,Ho,Jo,Ko,Yo,Uo=/^@|^v-on:/,Xo=/^v-|^@|^:|^#/,Go=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Zo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Qo=/^\(|\)$/g,es=/^\[.*\]$/,ts=/:(.*)$/,ns=/^:|^\.|^v-bind:/,rs=/\.[^.\]]+(?=[^\]]*$)/g,is=/^v-slot(:|$)|^#/,ss=/[\r\n]/,as=/[ \f\t\r\n]+/g,ls=y(bo);function cs(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:gs(t),rawAttrsMap:{},parent:n,children:[]}}function us(e,t){Bo=t.warn||Ar,Jo=t.isPreTag||T,Ko=t.mustUseProp||T,Yo=t.getTagNamespace||T,t.isReservedTag,Wo=Er(t.modules,"transformNode"),qo=Er(t.modules,"preTransformNode"),Ho=Er(t.modules,"postTransformNode"),Vo=t.delimiters;var n,r,i=[],o=!1!==t.preserveWhitespace,s=t.whitespace,a=!1,l=!1;function c(e){if(u(e),a||e.processed||(e=ds(e,t)),i.length||e===n||n.if&&(e.elseif||e.else)&&fs(n,{exp:e.elseif,block:e}),r&&!e.forbidden)if(e.elseif||e.else)s=e,c=function(e){for(var t=e.length;t--;){if(1===e[t].type)return e[t];e.pop()}}(r.children),c&&c.if&&fs(c,{exp:s.elseif,block:s});else{if(e.slotScope){var o=e.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[o]=e}r.children.push(e),e.parent=r}var s,c;e.children=e.children.filter((function(e){return!e.slotScope})),u(e),e.pre&&(a=!1),Jo(e.tag)&&(l=!1);for(var d=0;d]*>)","i")),h=e.replace(d,(function(e,n,r){return c=r.length,No(u)||"noscript"===u||(n=n.replace(//g,"$1").replace(//g,"$1")),Fo(u,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""}));l+=e.length-h.length,e=h,M(u,l-c,l)}else{var f=e.indexOf("<");if(0===f){if(Ao.test(e)){var p=e.indexOf("--\x3e");if(p>=0){t.shouldKeepComment&&t.comment(e.substring(4,p),l,l+p+3),k(p+3);continue}}if(Eo.test(e)){var m=e.indexOf("]>");if(m>=0){k(m+2);continue}}var g=e.match($o);if(g){k(g[0].length);continue}var v=e.match(To);if(v){var y=l;k(v[0].length),M(v[1],y,l);continue}var b=C();if(b){O(b),Fo(b.tagName,e)&&k(1);continue}}var w=void 0,x=void 0,S=void 0;if(f>=0){for(x=e.slice(f);!(To.test(x)||_o.test(x)||Ao.test(x)||Eo.test(x)||(S=x.indexOf("<",1))<0);)f+=S,x=e.slice(f);w=e.substring(0,f)}f<0&&(w=e),w&&k(w.length),t.chars&&w&&t.chars(w,l-w.length,l)}if(e===n){t.chars&&t.chars(e);break}}function k(t){l+=t,e=e.substring(t)}function C(){var t=e.match(_o);if(t){var n,r,i={tagName:t[1],attrs:[],start:l};for(k(t[0].length);!(n=e.match(Do))&&(r=e.match(Co)||e.match(ko));)r.start=l,k(r[0].length),r.end=l,i.attrs.push(r);if(n)return i.unarySlash=n[1],k(n[0].length),i.end=l,i}}function O(e){var n=e.tagName,l=e.unarySlash;o&&("p"===r&&So(n)&&M(r),a(n)&&r===n&&M(n));for(var c=s(n)||!!l,u=e.attrs.length,d=new Array(u),h=0;h=0&&i[s].lowerCasedTag!==a;s--);else s=0;if(s>=0){for(var c=i.length-1;c>=s;c--)t.end&&t.end(i[c].tag,n,o);i.length=s,r=s&&i[s-1].tag}else"br"===a?t.start&&t.start(e,[],!0,n,o):"p"===a&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}M()}(e,{warn:Bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,o,s,u,d){var h=r&&r.ns||Yo(e);J&&"svg"===h&&(o=function(e){for(var t=[],n=0;nl&&(a.push(o=e.slice(l,i)),s.push(JSON.stringify(o)));var c=Tr(r[1].trim());s.push("_s("+c+")"),a.push({"@binding":c}),l=i+r[0].length}return l-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),jr(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+s+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+qr(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+qr(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+qr(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===s)!function(e,t,n){var r=n&&n.number,i=Fr(e,"value")||"null";Nr(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),jr(e,"change",qr(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,s=i.number,a=i.trim,l=!o&&"range"!==r,c=o?"change":"range"===r?"__r":"input",u="$event.target.value";a&&(u="$event.target.value.trim()");s&&(u="_n("+u+")");var d=qr(t,u);l&&(d="if($event.target.composing)return;"+d);Nr(e,"value","("+t+")"),jr(e,c,d,null,!0),(a||s)&&jr(e,"blur","$forceUpdate()")}(e,r,i);else if(!R.isReservedTag(o))return Wr(e,r,i),!1;return!0},text:function(e,t){t.value&&Nr(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&Nr(e,"innerHTML","_s("+t.value+")",t)}},Os={expectHTML:!0,modules:ws,directives:Cs,isPreTag:function(e){return"pre"===e},isUnaryTag:wo,mustUseProp:Rn,canBeLeftOpenTag:xo,isReservedTag:Gn,getTagNamespace:Zn,staticKeys:(xs=ws,xs.reduce((function(e,t){return e.concat(t.staticKeys||[])}),[]).join(","))},Ms=y((function(e){return h("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))}));function _s(e,t){e&&(Ss=Ms(t.staticKeys||""),ks=t.isReservedTag||T,Ds(e),Ts(e,!1))}function Ds(e){if(e.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||f(e.tag)||!ks(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(Ss)))}(e),1===e.type){if(!ks(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var t=0,n=e.children.length;t|^function(?:\s+[\w$]+)?\s*\(/,As=/\([^)]*?\);*$/,Es=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ns={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ps={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Is=function(e){return"if("+e+")return null;"},Rs={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Is("$event.target !== $event.currentTarget"),ctrl:Is("!$event.ctrlKey"),shift:Is("!$event.shiftKey"),alt:Is("!$event.altKey"),meta:Is("!$event.metaKey"),left:Is("'button' in $event && $event.button !== 0"),middle:Is("'button' in $event && $event.button !== 1"),right:Is("'button' in $event && $event.button !== 2")};function zs(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var s=js(e[o]);e[o]&&e[o].dynamic?i+=o+","+s+",":r+='"'+o+'":'+s+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function js(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map((function(e){return js(e)})).join(",")+"]";var t=Es.test(e.value),n=$s.test(e.value),r=Es.test(e.value.replace(As,""));if(e.modifiers){var i="",o="",s=[];for(var a in e.modifiers)if(Rs[a])o+=Rs[a],Ns[a]&&s.push(a);else if("exact"===a){var l=e.modifiers;o+=Is(["ctrl","shift","alt","meta"].filter((function(e){return!l[e]})).map((function(e){return"$event."+e+"Key"})).join("||"))}else s.push(a);return s.length&&(i+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(Fs).join("&&")+")return null;"}(s)),o&&(i+=o),"function($event){"+i+(t?"return "+e.value+".apply(null, arguments)":n?"return ("+e.value+").apply(null, arguments)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function Fs(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Ns[e],r=Ps[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Ls={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:D},Bs=function(e){this.options=e,this.warn=e.warn||Ar,this.transforms=Er(e.modules,"transformCode"),this.dataGenFns=Er(e.modules,"genData"),this.directives=M(M({},Ls),e.directives);var t=e.isReservedTag||T;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Vs(e,t){var n=new Bs(t);return{render:"with(this){return "+(e?"script"===e.tag?"null":Ws(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Ws(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return qs(e,t);if(e.once&&!e.onceProcessed)return Hs(e,t);if(e.for&&!e.forProcessed)return Ys(e,t);if(e.if&&!e.ifProcessed)return Js(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=Zs(e,t),i="_t("+n+(r?",function(){return "+r+"}":""),o=e.attrs||e.dynamicAttrs?ta((e.attrs||[]).concat(e.dynamicAttrs||[]).map((function(e){return{name:w(e.name),value:e.value,dynamic:e.dynamic}}))):null,s=e.attrsMap["v-bind"];!o&&!s||r||(i+=",null");o&&(i+=","+o);s&&(i+=(o?"":",null")+","+s);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:Zs(t,n,!0);return"_c("+e+","+Us(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Us(e,t));var i=e.inlineTemplate?null:Zs(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o>>0}(s):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var o=function(e,t){var n=e.children[0];if(n&&1===n.type){var r=Vs(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map((function(e){return"function(){"+e+"}"})).join(",")+"]}"}}(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+ta(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Xs(e){return 1===e.type&&("slot"===e.tag||e.children.some(Xs))}function Gs(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Js(e,t,Gs,"null");if(e.for&&!e.forProcessed)return Ys(e,t,Gs);var r="_empty_"===e.slotScope?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(Zs(e,t)||"undefined")+":undefined":Zs(e,t)||"undefined":Ws(e,t))+"}",o=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+o+"}"}function Zs(e,t,n,r,i){var o=e.children;if(o.length){var s=o[0];if(1===o.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag){var a=n?t.maybeComponent(s)?",1":",0":"";return""+(r||Ws)(s,t)+a}var l=n?function(e,t){for(var n=0,r=0;r':'',sa.innerHTML.indexOf("
")>0}var ua=!!V&&ca(!1),da=!!V&&ca(!0),ha=y((function(e){var t=tr(e);return t&&t.innerHTML})),fa=Mn.prototype.$mount;Mn.prototype.$mount=function(e,t){if((e=e&&tr(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ha(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=la(r,{outputSourceRange:!1,shouldDecodeNewlines:ua,shouldDecodeNewlinesForHref:da,delimiters:n.delimiters,comments:n.comments},this),o=i.render,s=i.staticRenderFns;n.render=o,n.staticRenderFns=s}}return fa.call(this,e,t)},Mn.compile=la;var pa=("undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function ma(e,t){if(void 0===t&&(t=[]),null===e||"object"!=typeof e)return e;var n,r=(n=function(t){return t.original===e},t.filter(n)[0]);if(r)return r.copy;var i=Array.isArray(e)?[]:{};return t.push({original:e,copy:i}),Object.keys(e).forEach((function(n){i[n]=ma(e[n],t)})),i}function ga(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}function va(e){return null!==e&&"object"==typeof e}var ya=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var n=e.state;this.state=("function"==typeof n?n():n)||{}},ba={namespaced:{configurable:!0}};ba.namespaced.get=function(){return!!this._rawModule.namespaced},ya.prototype.addChild=function(e,t){this._children[e]=t},ya.prototype.removeChild=function(e){delete this._children[e]},ya.prototype.getChild=function(e){return this._children[e]},ya.prototype.hasChild=function(e){return e in this._children},ya.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)},ya.prototype.forEachChild=function(e){ga(this._children,e)},ya.prototype.forEachGetter=function(e){this._rawModule.getters&&ga(this._rawModule.getters,e)},ya.prototype.forEachAction=function(e){this._rawModule.actions&&ga(this._rawModule.actions,e)},ya.prototype.forEachMutation=function(e){this._rawModule.mutations&&ga(this._rawModule.mutations,e)},Object.defineProperties(ya.prototype,ba);var wa,xa=function(e){this.register([],e,!1)};function Sa(e,t,n){if(t.update(n),n.modules)for(var r in n.modules){if(!t.getChild(r))return;Sa(e.concat(r),t.getChild(r),n.modules[r])}}xa.prototype.get=function(e){return e.reduce((function(e,t){return e.getChild(t)}),this.root)},xa.prototype.getNamespace=function(e){var t=this.root;return e.reduce((function(e,n){return e+((t=t.getChild(n)).namespaced?n+"/":"")}),"")},xa.prototype.update=function(e){Sa([],this.root,e)},xa.prototype.register=function(e,t,n){var r=this;void 0===n&&(n=!0);var i=new ya(t,n);0===e.length?this.root=i:this.get(e.slice(0,-1)).addChild(e[e.length-1],i);t.modules&&ga(t.modules,(function(t,i){r.register(e.concat(i),t,n)}))},xa.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1],r=t.getChild(n);r&&r.runtime&&t.removeChild(n)},xa.prototype.isRegistered=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1];return!!t&&t.hasChild(n)};var ka=function(e){var t=this;void 0===e&&(e={}),!wa&&"undefined"!=typeof window&&window.Vue&&Aa(window.Vue);var n=e.plugins;void 0===n&&(n=[]);var r=e.strict;void 0===r&&(r=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new xa(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new wa,this._makeLocalGettersCache=Object.create(null);var i=this,o=this.dispatch,s=this.commit;this.dispatch=function(e,t){return o.call(i,e,t)},this.commit=function(e,t,n){return s.call(i,e,t,n)},this.strict=r;var a=this._modules.root.state;Da(this,a,[],this._modules.root),_a(this,a),n.forEach((function(e){return e(t)})),(void 0!==e.devtools?e.devtools:wa.config.devtools)&&function(e){pa&&(e._devtoolHook=pa,pa.emit("vuex:init",e),pa.on("vuex:travel-to-state",(function(t){e.replaceState(t)})),e.subscribe((function(e,t){pa.emit("vuex:mutation",e,t)}),{prepend:!0}),e.subscribeAction((function(e,t){pa.emit("vuex:action",e,t)}),{prepend:!0}))}(this)},Ca={state:{configurable:!0}};function Oa(e,t,n){return t.indexOf(e)<0&&(n&&n.prepend?t.unshift(e):t.push(e)),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}function Ma(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var n=e.state;Da(e,n,[],e._modules.root,!0),_a(e,n,t)}function _a(e,t,n){var r=e._vm;e.getters={},e._makeLocalGettersCache=Object.create(null);var i=e._wrappedGetters,o={};ga(i,(function(t,n){o[n]=function(e,t){return function(){return e(t)}}(t,e),Object.defineProperty(e.getters,n,{get:function(){return e._vm[n]},enumerable:!0})}));var s=wa.config.silent;wa.config.silent=!0,e._vm=new wa({data:{$$state:t},computed:o}),wa.config.silent=s,e.strict&&function(e){e._vm.$watch((function(){return this._data.$$state}),(function(){}),{deep:!0,sync:!0})}(e),r&&(n&&e._withCommit((function(){r._data.$$state=null})),wa.nextTick((function(){return r.$destroy()})))}function Da(e,t,n,r,i){var o=!n.length,s=e._modules.getNamespace(n);if(r.namespaced&&(e._modulesNamespaceMap[s],e._modulesNamespaceMap[s]=r),!o&&!i){var a=Ta(t,n.slice(0,-1)),l=n[n.length-1];e._withCommit((function(){wa.set(a,l,r.state)}))}var c=r.context=function(e,t,n){var r=""===t,i={dispatch:r?e.dispatch:function(n,r,i){var o=$a(n,r,i),s=o.payload,a=o.options,l=o.type;return a&&a.root||(l=t+l),e.dispatch(l,s)},commit:r?e.commit:function(n,r,i){var o=$a(n,r,i),s=o.payload,a=o.options,l=o.type;a&&a.root||(l=t+l),e.commit(l,s,a)}};return Object.defineProperties(i,{getters:{get:r?function(){return e.getters}:function(){return function(e,t){if(!e._makeLocalGettersCache[t]){var n={},r=t.length;Object.keys(e.getters).forEach((function(i){if(i.slice(0,r)===t){var o=i.slice(r);Object.defineProperty(n,o,{get:function(){return e.getters[i]},enumerable:!0})}})),e._makeLocalGettersCache[t]=n}return e._makeLocalGettersCache[t]}(e,t)}},state:{get:function(){return Ta(e.state,n)}}}),i}(e,s,n);r.forEachMutation((function(t,n){!function(e,t,n,r){(e._mutations[t]||(e._mutations[t]=[])).push((function(t){n.call(e,r.state,t)}))}(e,s+n,t,c)})),r.forEachAction((function(t,n){var r=t.root?n:s+n,i=t.handler||t;!function(e,t,n,r){(e._actions[t]||(e._actions[t]=[])).push((function(t){var i,o=n.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},t);return(i=o)&&"function"==typeof i.then||(o=Promise.resolve(o)),e._devtoolHook?o.catch((function(t){throw e._devtoolHook.emit("vuex:error",t),t})):o}))}(e,r,i,c)})),r.forEachGetter((function(t,n){!function(e,t,n,r){if(e._wrappedGetters[t])return;e._wrappedGetters[t]=function(e){return n(r.state,r.getters,e.state,e.getters)}}(e,s+n,t,c)})),r.forEachChild((function(r,o){Da(e,t,n.concat(o),r,i)}))}function Ta(e,t){return t.reduce((function(e,t){return e[t]}),e)}function $a(e,t,n){return va(e)&&e.type&&(n=t,t=e,e=e.type),{type:e,payload:t,options:n}}function Aa(e){wa&&e===wa||
+var t=Object.freeze({}),e=Array.isArray;function n(t){return null==t}function r(t){return null!=t}function o(t){return!0===t}function i(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function s(t){return"function"==typeof t}function a(t){return null!==t&&"object"==typeof t}var l=Object.prototype.toString;function c(t){return"[object Object]"===l.call(t)}function u(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return r(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function h(t){return null==t?"":Array.isArray(t)||c(t)&&t.toString===l?JSON.stringify(t,null,2):String(t)}function f(t){var e=parseFloat(t);return isNaN(e)?t:e}function p(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o-1)return t.splice(n,1)}}var y=Object.prototype.hasOwnProperty;function b(t,e){return y.call(t,e)}function w(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var x=/-(\w)/g,S=w((function(t){return t.replace(x,(function(t,e){return e?e.toUpperCase():""}))})),k=w((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),_=/\B([A-Z])/g,O=w((function(t){return t.replace(_,"-$1").toLowerCase()}));var C=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function M(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function D(t,e){for(var n in e)t[n]=e[n];return t}function T(t){for(var e={},n=0;n0,U=J&&J.indexOf("edge/")>0;J&&J.indexOf("android");var G=J&&/iphone|ipad|ipod|ios/.test(J);J&&/chrome\/\d+/.test(J),J&&/phantomjs/.test(J);var X,Z=J&&J.match(/firefox\/(\d+)/),Q={}.watch,tt=!1;if(H)try{var et={};Object.defineProperty(et,"passive",{get:function(){tt=!0}}),window.addEventListener("test-passive",null,et)}catch(jy){}var nt=function(){return void 0===X&&(X=!H&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),X},rt=H&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ot(t){return"function"==typeof t&&/native code/.test(t.toString())}var it,st="undefined"!=typeof Symbol&&ot(Symbol)&&"undefined"!=typeof Reflect&&ot(Reflect.ownKeys);it="undefined"!=typeof Set&&ot(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var at=null;function lt(t){void 0===t&&(t=null),t||at&&at._scope.off(),at=t,t&&t._scope.on()}var ct=$,ut=0,dt=function(){function t(){this.id=ut++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){v(this.subs,t)},t.prototype.depend=function(e){t.target&&t.target.addDep(this)},t.prototype.notify=function(t){for(var e=this.subs.slice(),n=0,r=e.length;n0&&(Pt((l=It(l,"".concat(s||"","_").concat(a)))[0])&&Pt(u)&&(d[c]=vt(u.text+l[0].text),l.shift()),d.push.apply(d,l)):i(l)?Pt(u)?d[c]=vt(u.text+l):""!==l&&d.push(vt(l)):Pt(l)&&Pt(u)?d[c]=vt(u.text+l.text):(o(t._isVList)&&r(l.tag)&&n(l.key)&&r(s)&&(l.key="__vlist".concat(s,"_").concat(a,"__")),d.push(l)));return d}function Rt(e){var n=e.$options,r=n.setup;if(r){var o=e._setupContext=function(e){return{get attrs(){return function(e){if(!e._attrsProxy){var n=e._attrsProxy={};V(n,"_v_attr_proxy",!0),zt(n,e.$attrs,t,e)}return e._attrsProxy}(e)},get slots(){return function(t){t._slotsProxy||Ft(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(e)},emit:C(e.$emit,e),expose:function(t){t&&Object.keys(t).forEach((function(n){return _t(e,t,n)}))}}}(e);lt(e),ft();var i=rn(r,null,[e._props||xt({}),o],e,"setup");if(pt(),lt(),s(i))n.render=i;else if(a(i))if(e._setupState=i,i.__sfc){var l=e._setupProxy={};for(var c in i)"__sfc"!==c&&_t(l,i,c)}else for(var c in i)B(c)||_t(e,i,c)}}function zt(t,e,n,r){var o=!1;for(var i in e)i in t?e[i]!==n[i]&&(o=!0):(o=!0,jt(t,i,r));for(var i in t)i in e||(o=!0,delete t[i]);return o}function jt(t,e,n){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n.$attrs[e]}})}function Ft(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var Lt={enumerable:!0,configurable:!0,get:$,set:$};function Bt(t,e,n){Lt.get=function(){return this[e][n]},Lt.set=function(t){this[e][n]=t},Object.defineProperty(t,n,Lt)}function Vt(t){var n=t.$options;if(n.props&&function(t,e){var n=t.$options.propsData||{},r=t._props=xt({}),o=t.$options._propKeys=[];t.$parent&&wn(!1);var i=function(i){o.push(i);var s=Rn(i,e,n,t);_n(r,i,s),i in t||Bt(t,"_props",i)};for(var s in e)i(s);wn(!0)}(t,n.props),Rt(t),n.methods&&function(t,e){for(var n in t.$options.props,e)t[n]="function"!=typeof e[n]?$:C(e[n],t)}(t,n.methods),n.data)!function(t){var e=t.$options.data;c(e=t._data=s(e)?function(t,e){ft();try{return t.call(e,e)}catch(jy){return nn(jy,e,"data()"),{}}finally{pt()}}(e,t):e||{})||(e={});var n=Object.keys(e),r=t.$options.props;t.$options.methods;var o=n.length;for(;o--;){var i=n[o];r&&b(r,i)||B(i)||Bt(t,"_data",i)}var a=kn(e);a&&a.vmCount++}(t);else{var r=kn(t._data={});r&&r.vmCount++}n.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=nt();for(var o in e){var i=e[o],a=s(i)?i:i.get;r||(n[o]=new en(t,a||$,$,qt)),o in t||Ht(t,o,i)}}(t,n.computed),n.watch&&n.watch!==Q&&function(t,n){for(var r in n){var o=n[r];if(e(o))for(var i=0;i0,a=n?!!n.$stable:!s,l=n&&n.$key;if(n){if(n._normalized)return n._normalized;if(a&&o&&o!==t&&l===o.$key&&!s&&!o.$hasNormal)return o;for(var c in i={},n)n[c]&&"$"!==c[0]&&(i[c]=oe(e,r,c,n[c]))}else i={};for(var u in r)u in i||(i[u]=ie(r,u));return n&&Object.isExtensible(n)&&(n._normalized=i),V(i,"$stable",a),V(i,"$key",l),V(i,"$hasNormal",s),i}function oe(t,n,r,o){var i=function(){var n=at;lt(t);var r=arguments.length?o.apply(null,arguments):o({}),i=(r=r&&"object"==typeof r&&!e(r)?[r]:At(r))&&r[0];return lt(n),r&&(!i||1===r.length&&i.isComment&&!ne(i))?void 0:r};return o.proxy&&Object.defineProperty(n,r,{get:i,enumerable:!0,configurable:!0}),i}function ie(t,e){return function(){return t[e]}}function se(t,n){var o,i,s,l,c=null;if(e(t)||"string"==typeof t)for(c=new Array(t.length),o=0,i=t.length;odocument.createEvent("Event").timeStamp&&(Xe=function(){return Ze.now()})}function Qe(){var t,e;for(Ge=Xe(),Ye=!0,qe.sort((function(t,e){return t.id-e.id})),Ue=0;UeUe&&qe[n].id>t.id;)n--;qe.splice(n+1,0,t)}else qe.push(t);Ke||(Ke=!0,gn(Qe))}}(this)},t.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||a(t)||this.deep){var e=this.value;if(this.value=t,this.user){var n='callback for watcher "'.concat(this.expression,'"');rn(this.cb,this.vm,[t,e],this.vm,n)}else this.cb.call(this.vm,t,e)}}},t.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},t.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},t.prototype.teardown=function(){if(this.vm&&!this.vm._isBeingDestroyed&&v(this.vm._scope.effects,this),this.active){for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1,this.onStop&&this.onStop()}},t}();function nn(t,e,n){ft();try{if(e)for(var r=e;r=r.$parent;){var o=r.$options.errorCaptured;if(o)for(var i=0;i-1)if(i&&!b(o,"default"))a=!1;else if(""===a||a===O(t)){var c=Ln(String,o.type);(c<0||l-1:"string"==typeof t?t.split(",").indexOf(n)>-1:(r=t,"[object RegExp]"===l.call(r)&&t.test(n));var r}function Hn(t,e){var n=t.cache,r=t.keys,o=t._vnode;for(var i in n){var s=n[i];if(s){var a=s.name;a&&!e(a)&&Jn(n,i,r,o)}}}function Jn(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,v(n,e)}Bn.prototype._init=function(e){var n=this;n._uid=Zt++,n._isVue=!0,n.__v_skip=!0,n._scope=new Xt(!0),e&&e._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(n,e):n.$options=Pn(Qt(n.constructor),e||{},n),n._renderProxy=n,n._self=n,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(n),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&ze(t,e)}(n),function(e){e._vnode=null,e._staticTrees=null;var n=e.$options,r=e.$vnode=n._parentVnode,o=r&&r.context;e.$slots=te(n._renderChildren,o),e.$scopedSlots=t,e._c=function(t,n,r,o){return De(e,t,n,r,o,!1)},e.$createElement=function(t,n,r,o){return De(e,t,n,r,o,!0)};var i=r&&r.data;_n(e,"$attrs",i&&i.attrs||t,null,!0),_n(e,"$listeners",n._parentListeners||t,null,!0)}(n),We(n,"beforeCreate"),function(t){var e=Gt(t.$options.inject,t);e&&(wn(!1),Object.keys(e).forEach((function(n){_n(t,n,e[n])})),wn(!0))}(n),Vt(n),function(t){var e=t.$options.provide;if(e){var n=s(e)?e.call(t):e;if(!a(n))return;var r=st?Reflect.ownKeys(n):Object.keys(n);lt(t);for(var o=0;o1?M(n):n;for(var r=M(arguments,1),o='event handler for "'.concat(t,'"'),i=0,s=n.length;iparseInt(this.max)&&Jn(e,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Jn(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Hn(t,(function(t){return qn(e,t)}))})),this.$watch("exclude",(function(e){Hn(t,(function(t){return!qn(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Ae(t),n=e&&e.componentOptions;if(n){var r=Wn(n),o=this.include,i=this.exclude;if(o&&(!r||!qn(o,r))||i&&r&&qn(i,r))return e;var s=this.cache,a=this.keys,l=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;s[l]?(e.componentInstance=s[l].componentInstance,v(a,l),a.push(l)):(this.vnodeToCache=e,this.keyToCache=l),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return F}};Object.defineProperty(t,"config",e),t.util={warn:ct,extend:D,mergeOptions:Pn,defineReactive:_n},t.set=On,t.delete=Cn,t.nextTick=gn,t.observable=function(t){return kn(t),t},t.options=Object.create(null),z.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,D(t.options.components,Yn),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=M(arguments,1);return n.unshift(this),s(t.install)?t.install.apply(t,n):s(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Pn(this.options,t),this}}(t),Vn(t),function(t){z.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&c(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&s(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(Bn),Object.defineProperty(Bn.prototype,"$isServer",{get:nt}),Object.defineProperty(Bn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Bn,"FunctionalRenderContext",{value:xe}),Bn.version="2.7.4";var Un=p("style,class"),Gn=p("input,textarea,option,select,progress"),Xn=function(t,e,n){return"value"===n&&Gn(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},Zn=p("contenteditable,draggable,spellcheck"),Qn=p("events,caret,typing,plaintext-only"),tr=p("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),er="http://www.w3.org/1999/xlink",nr=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},rr=function(t){return nr(t)?t.slice(6,t.length):""},or=function(t){return null==t||!1===t};function ir(t){for(var e=t.data,n=t,o=t;r(o.componentInstance);)(o=o.componentInstance._vnode)&&o.data&&(e=sr(o.data,e));for(;r(n=n.parent);)n&&n.data&&(e=sr(e,n.data));return function(t,e){if(r(t)||r(e))return ar(t,lr(e));return""}(e.staticClass,e.class)}function sr(t,e){return{staticClass:ar(t.staticClass,e.staticClass),class:r(t.class)?[t.class,e.class]:e.class}}function ar(t,e){return t?e?t+" "+e:t:e||""}function lr(t){return Array.isArray(t)?function(t){for(var e,n="",o=0,i=t.length;o-1?Pr(t,e,n):tr(e)?or(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Zn(e)?t.setAttribute(e,function(t,e){return or(e)||"false"===e?"false":"contenteditable"===t&&Qn(e)?e:"true"}(e,n)):nr(e)?or(n)?t.removeAttributeNS(er,rr(e)):t.setAttributeNS(er,e,n):Pr(t,e,n)}function Pr(t,e,n){if(or(n))t.removeAttribute(e);else{if(K&&!Y&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var Ir={create:Nr,update:Nr};function Rr(t,e){var o=e.elm,i=e.data,s=t.data;if(!(n(i.staticClass)&&n(i.class)&&(n(s)||n(s.staticClass)&&n(s.class)))){var a=ir(e),l=o._transitionClasses;r(l)&&(a=ar(a,lr(l))),a!==o._prevClass&&(o.setAttribute("class",a),o._prevClass=a)}}var zr,jr,Fr,Lr,Br,Vr,Wr={create:Rr,update:Rr},qr=/[\w).+\-_$\]]/;function Hr(t){var e,n,r,o,i,s=!1,a=!1,l=!1,c=!1,u=0,d=0,h=0,f=0;for(r=0;r=0&&" "===(m=t.charAt(p));p--);m&&qr.test(m)||(c=!0)}}else void 0===o?(f=r+1,o=t.slice(0,r).trim()):g();function g(){(i||(i=[])).push(t.slice(f,r).trim()),f=r+1}if(void 0===o?o=t.slice(0,r).trim():0!==f&&g(),i)for(r=0;r-1?{exp:t.slice(0,Lr),key:'"'+t.slice(Lr+1)+'"'}:{exp:t,key:null};jr=t,Lr=Br=Vr=0;for(;!lo();)co(Fr=ao())?ho(Fr):91===Fr&&uo(Fr);return{exp:t.slice(0,Br),key:t.slice(Br+1,Vr)}}(t);return null===n.key?"".concat(t,"=").concat(e):"$set(".concat(n.exp,", ").concat(n.key,", ").concat(e,")")}function ao(){return jr.charCodeAt(++Lr)}function lo(){return Lr>=zr}function co(t){return 34===t||39===t}function uo(t){var e=1;for(Br=Lr;!lo();)if(co(t=ao()))ho(t);else if(91===t&&e++,93===t&&e--,0===e){Vr=Lr;break}}function ho(t){for(var e=t;!lo()&&(t=ao())!==e;);}var fo;function po(t,e,n){var r=fo;return function o(){var i=e.apply(null,arguments);null!==i&&vo(t,o,n,r)}}var mo=ln&&!(Z&&Number(Z[1])<=53);function go(t,e,n,r){if(mo){var o=Ge,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}fo.addEventListener(t,e,tt?{capture:n,passive:r}:n)}function vo(t,e,n,r){(r||fo).removeEventListener(t,e._wrapper||e,n)}function yo(t,e){if(!n(t.data.on)||!n(e.data.on)){var o=e.data.on||{},i=t.data.on||{};fo=e.elm||t.elm,function(t){if(r(t.__r)){var e=K?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}r(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(o),$t(o,i,go,vo,po,e.context),fo=void 0}}var bo,wo={create:yo,update:yo,destroy:function(t){return yo(t,xr)}};function xo(t,e){if(!n(t.data.domProps)||!n(e.data.domProps)){var i,s,a=e.elm,l=t.data.domProps||{},c=e.data.domProps||{};for(i in(r(c.__ob__)||o(c._v_attr_proxy))&&(c=e.data.domProps=D({},c)),l)i in c||(a[i]="");for(i in c){if(s=c[i],"textContent"===i||"innerHTML"===i){if(e.children&&(e.children.length=0),s===l[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i&&"PROGRESS"!==a.tagName){a._value=s;var u=n(s)?"":String(s);So(a,u)&&(a.value=u)}else if("innerHTML"===i&&dr(a.tagName)&&n(a.innerHTML)){(bo=bo||document.createElement("div")).innerHTML="");for(var d=bo.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;d.firstChild;)a.appendChild(d.firstChild)}else if(s!==l[i])try{a[i]=s}catch(jy){}}}}function So(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(jy){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,o=t._vModifiers;if(r(o)){if(o.number)return f(n)!==f(e);if(o.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var ko={create:xo,update:xo},_o=w((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function Oo(t){var e=Co(t.style);return t.staticStyle?D(t.staticStyle,e):e}function Co(t){return Array.isArray(t)?T(t):"string"==typeof t?_o(t):t}var Mo,Do=/^--/,To=/\s*!important$/,$o=function(t,e,n){if(Do.test(e))t.style.setProperty(e,n);else if(To.test(n))t.style.setProperty(O(e),n.replace(To,""),"important");else{var r=No(e);if(Array.isArray(n))for(var o=0,i=n.length;o-1?e.split(Io).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function zo(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Io).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function jo(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&D(e,Fo(t.name||"v")),D(e,t),e}return"string"==typeof t?Fo(t):void 0}}var Fo=w((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),Lo=H&&!Y,Bo="transition",Vo="transitionend",Wo="animation",qo="animationend";Lo&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Bo="WebkitTransition",Vo="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Wo="WebkitAnimation",qo="webkitAnimationEnd"));var Ho=H?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Jo(t){Ho((function(){Ho(t)}))}function Ko(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),Ro(t,e))}function Yo(t,e){t._transitionClasses&&v(t._transitionClasses,e),zo(t,e)}function Uo(t,e,n){var r=Xo(t,e),o=r.type,i=r.timeout,s=r.propCount;if(!o)return n();var a="transition"===o?Vo:qo,l=0,c=function(){t.removeEventListener(a,u),n()},u=function(e){e.target===t&&++l>=s&&c()};setTimeout((function(){l0&&(n="transition",u=s,d=i.length):"animation"===e?c>0&&(n="animation",u=c,d=l.length):d=(n=(u=Math.max(s,c))>0?s>c?"transition":"animation":null)?"transition"===n?i.length:l.length:0,{type:n,timeout:u,propCount:d,hasTransform:"transition"===n&&Go.test(r[Bo+"Property"])}}function Zo(t,e){for(;t.length1}function oi(t,e){!0!==e.data.show&&ti(e)}var ii=function(t){var s,a,l={},c=t.modules,u=t.nodeOps;for(s=0;sp?w(t,n(o[v+1])?null:o[v+1].elm,o,f,v,i):f>v&&S(e,d,p)}(d,m,g,i,c):r(g)?(r(t.text)&&u.setTextContent(d,""),w(d,null,g,0,g.length-1,i)):r(m)?S(m,0,m.length-1):r(t.text)&&u.setTextContent(d,""):t.text!==e.text&&u.setTextContent(d,e.text),r(p)&&r(f=p.hook)&&r(f=f.postpatch)&&f(t,e)}}}function C(t,e,n){if(o(n)&&r(t.parent))t.parent.data.pendingInsert=e;else for(var i=0;i-1,s.selected!==i&&(s.selected=i);else if(A(ui(s),r))return void(t.selectedIndex!==a&&(t.selectedIndex=a));o||(t.selectedIndex=-1)}}function ci(t,e){return e.every((function(e){return!A(e,t)}))}function ui(t){return"_value"in t?t._value:t.value}function di(t){t.target.composing=!0}function hi(t){t.target.composing&&(t.target.composing=!1,fi(t.target,"input"))}function fi(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function pi(t){return!t.componentInstance||t.data&&t.data.transition?t:pi(t.componentInstance._vnode)}var mi={model:si,show:{bind:function(t,e,n){var r=e.value,o=(n=pi(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,ti(n,(function(){t.style.display=i}))):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=pi(n)).data&&n.data.transition?(n.data.show=!0,r?ti(n,(function(){t.style.display=t.__vOriginalDisplay})):ei(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}}},gi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function vi(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?vi(Ae(e.children)):t}function yi(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var r in o)e[S(r)]=o[r];return e}function bi(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var wi=function(t){return t.tag||ne(t)},xi=function(t){return"show"===t.name},Si={name:"transition",props:gi,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(wi)).length){var r=this.mode,o=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var s=vi(o);if(!s)return o;if(this._leaving)return bi(t,o);var a="__transition-".concat(this._uid,"-");s.key=null==s.key?s.isComment?a+"comment":a+s.tag:i(s.key)?0===String(s.key).indexOf(a)?s.key:a+s.key:s.key;var l=(s.data||(s.data={})).transition=yi(this),c=this._vnode,u=vi(c);if(s.data.directives&&s.data.directives.some(xi)&&(s.data.show=!0),u&&u.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(s,u)&&!ne(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var d=u.data.transition=D({},l);if("out-in"===r)return this._leaving=!0,Et(d,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),bi(t,o);if("in-out"===r){if(ne(s))return c;var h,f=function(){h()};Et(l,"afterEnter",f),Et(l,"enterCancelled",f),Et(d,"delayLeave",(function(t){h=t}))}}return o}}},ki=D({tag:String,moveClass:String},gi);delete ki.mode;var _i={props:ki,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=Fe(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],s=yi(this),a=0;a-1?pr[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:pr[t]=/HTMLUnknownElement/.test(e.toString())},D(Bn.options.directives,mi),D(Bn.options.components,Di),Bn.prototype.__patch__=H?ii:$,Bn.prototype.$mount=function(t,e){return function(t,e,n){var r;t.$el=e,t.$options.render||(t.$options.render=gt),We(t,"beforeMount"),r=function(){t._update(t._render(),n)},new en(t,r,$,{before:function(){t._isMounted&&!t._isDestroyed&&We(t,"beforeUpdate")}},!0),n=!1;var o=t._preWatchers;if(o)for(var i=0;i\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Li=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Bi="[a-zA-Z_][\\-\\.0-9_a-zA-Z".concat(L.source,"]*"),Vi="((?:".concat(Bi,"\\:)?").concat(Bi,")"),Wi=new RegExp("^<".concat(Vi)),qi=/^\s*(\/?)>/,Hi=new RegExp("^<\\/".concat(Vi,"[^>]*>")),Ji=/^]+>/i,Ki=/^",""":'"',"&":"&","
":"\n"," ":"\t","'":"'"},Zi=/&(?:lt|gt|quot|amp|#39);/g,Qi=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,ts=p("pre,textarea",!0),es=function(t,e){return t&&ts(t)&&"\n"===e[0]};function ns(t,e){var n=e?Qi:Zi;return t.replace(n,(function(t){return Xi[t]}))}function rs(t,e){for(var n,r,o=[],i=e.expectHTML,s=e.isUnaryTag||E,a=e.canBeLeftOpenTag||E,l=0,c=function(){if(n=t,r&&Ui(r)){var c=0,h=r.toLowerCase(),f=Gi[h]||(Gi[h]=new RegExp("([\\s\\S]*?)("+h+"[^>]*>)","i"));S=t.replace(f,(function(t,n,r){return c=r.length,Ui(h)||"noscript"===h||(n=n.replace(//g,"$1").replace(//g,"$1")),es(h,n)&&(n=n.slice(1)),e.chars&&e.chars(n),""}));l+=t.length-S.length,t=S,d(h,l-c,l)}else{var p=t.indexOf("<");if(0===p){if(Ki.test(t)){var m=t.indexOf("--\x3e");if(m>=0)return e.shouldKeepComment&&e.comment&&e.comment(t.substring(4,m),l,l+m+3),u(m+3),"continue"}if(Yi.test(t)){var g=t.indexOf("]>");if(g>=0)return u(g+2),"continue"}var v=t.match(Ji);if(v)return u(v[0].length),"continue";var y=t.match(Hi);if(y){var b=l;return u(y[0].length),d(y[1],b,l),"continue"}var w=function(){var e=t.match(Wi);if(e){var n={tagName:e[1],attrs:[],start:l};u(e[0].length);for(var r=void 0,o=void 0;!(r=t.match(qi))&&(o=t.match(Li)||t.match(Fi));)o.start=l,u(o[0].length),o.end=l,n.attrs.push(o);if(r)return n.unarySlash=r[1],u(r[0].length),n.end=l,n}}();if(w)return function(t){var n=t.tagName,l=t.unarySlash;i&&("p"===r&&ji(n)&&d(r),a(n)&&r===n&&d(n));for(var c=s(n)||!!l,u=t.attrs.length,h=new Array(u),f=0;f=0){for(S=t.slice(p);!(Hi.test(S)||Wi.test(S)||Ki.test(S)||Yi.test(S)||(k=S.indexOf("<",1))<0);)p+=k,S=t.slice(p);x=t.substring(0,p)}p<0&&(x=t),x&&u(x.length),e.chars&&x&&e.chars(x,l-x.length,l)}if(t===n)return e.chars&&e.chars(t),"break"};t;){if("break"===c())break}function u(e){l+=e,t=t.substring(e)}function d(t,n,i){var s,a;if(null==n&&(n=l),null==i&&(i=l),t)for(a=t.toLowerCase(),s=o.length-1;s>=0&&o[s].lowerCasedTag!==a;s--);else s=0;if(s>=0){for(var c=o.length-1;c>=s;c--)e.end&&e.end(o[c].tag,n,i);o.length=s,r=s&&o[s-1].tag}else"br"===a?e.start&&e.start(t,[],!0,n,i):"p"===a&&(e.start&&e.start(t,[],!1,n,i),e.end&&e.end(t,n,i))}d()}var is,ss,as,ls,cs,us,ds,hs,fs=/^@|^v-on:/,ps=/^v-|^@|^:|^#/,ms=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,gs=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,vs=/^\(|\)$/g,ys=/^\[.*\]$/,bs=/:(.*)$/,ws=/^:|^\.|^v-bind:/,xs=/\.[^.\]]+(?=[^\]]*$)/g,Ss=/^v-slot(:|$)|^#/,ks=/[\r\n]/,_s=/[ \f\t\r\n]+/g,Os=w(Ii);function Cs(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:As(e),rawAttrsMap:{},parent:n,children:[]}}function Ms(t,e){is=e.warn||Kr,us=e.isPreTag||E,ds=e.mustUseProp||E,hs=e.getTagNamespace||E,e.isReservedTag,as=Yr(e.modules,"transformNode"),ls=Yr(e.modules,"preTransformNode"),cs=Yr(e.modules,"postTransformNode"),ss=e.delimiters;var n,r,o=[],i=!1!==e.preserveWhitespace,s=e.whitespace,a=!1,l=!1;function c(t){if(u(t),a||t.processed||(t=Ds(t,e)),o.length||t===n||n.if&&(t.elseif||t.else)&&$s(n,{exp:t.elseif,block:t}),r&&!t.forbidden)if(t.elseif||t.else)s=t,c=function(t){for(var e=t.length;e--;){if(1===t[e].type)return t[e];t.pop()}}(r.children),c&&c.if&&$s(c,{exp:s.elseif,block:s});else{if(t.slotScope){var i=t.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[i]=t}r.children.push(t),t.parent=r}var s,c;t.children=t.children.filter((function(t){return!t.slotScope})),u(t),t.pre&&(a=!1),us(t.tag)&&(l=!1);for(var d=0;dl&&(a.push(i=t.slice(l,o)),s.push(JSON.stringify(i)));var c=Hr(r[1].trim());s.push("_s(".concat(c,")")),a.push({"@binding":c}),l=o+r[0].length}return l-1")+("true"===i?":(".concat(e,")"):":_q(".concat(e,",").concat(i,")"))),to(t,"change","var $$a=".concat(e,",")+"$$el=$event.target,"+"$$c=$$el.checked?(".concat(i,"):(").concat(s,");")+"if(Array.isArray($$a)){"+"var $$v=".concat(r?"_n("+o+")":o,",")+"$$i=_i($$a,$$v);"+"if($$el.checked){$$i<0&&(".concat(so(e,"$$a.concat([$$v])"),")}")+"else{$$i>-1&&(".concat(so(e,"$$a.slice(0,$$i).concat($$a.slice($$i+1))"),")}")+"}else{".concat(so(e,"$$c"),"}"),null,!0)}(t,r,o);else if("input"===i&&"radio"===s)!function(t,e,n){var r=n&&n.number,o=eo(t,"value")||"null";o=r?"_n(".concat(o,")"):o,Ur(t,"checked","_q(".concat(e,",").concat(o,")")),to(t,"change",so(e,o),null,!0)}(t,r,o);else if("input"===i||"textarea"===i)!function(t,e,n){var r=t.attrsMap.type,o=n||{},i=o.lazy,s=o.number,a=o.trim,l=!i&&"range"!==r,c=i?"change":"range"===r?"__r":"input",u="$event.target.value";a&&(u="$event.target.value.trim()");s&&(u="_n(".concat(u,")"));var d=so(e,u);l&&(d="if($event.target.composing)return;".concat(d));Ur(t,"value","(".concat(e,")")),to(t,c,d,null,!0),(a||s)&&to(t,"blur","$forceUpdate()")}(t,r,o);else if(!F.isReservedTag(i))return io(t,r,o),!1;return!0},text:function(t,e){e.value&&Ur(t,"textContent","_s(".concat(e.value,")"),e)},html:function(t,e){e.value&&Ur(t,"innerHTML","_s(".concat(e.value,")"),e)}},Vs={expectHTML:!0,modules:zs,directives:Bs,isPreTag:function(t){return"pre"===t},isUnaryTag:Ri,mustUseProp:Xn,canBeLeftOpenTag:zi,isReservedTag:hr,getTagNamespace:fr,staticKeys:(js=zs,js.reduce((function(t,e){return t.concat(e.staticKeys||[])}),[]).join(","))},Ws=w((function(t){return p("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(t?","+t:""))}));function qs(t,e){t&&(Fs=Ws(e.staticKeys||""),Ls=e.isReservedTag||E,Hs(t),Js(t,!1))}function Hs(t){if(t.static=function(t){if(2===t.type)return!1;if(3===t.type)return!0;return!(!t.pre&&(t.hasBindings||t.if||t.for||m(t.tag)||!Ls(t.tag)||function(t){for(;t.parent;){if("template"!==(t=t.parent).tag)return!1;if(t.for)return!0}return!1}(t)||!Object.keys(t).every(Fs)))}(t),1===t.type){if(!Ls(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var e=0,n=t.children.length;e|^function(?:\s+[\w$]+)?\s*\(/,Ys=/\([^)]*?\);*$/,Us=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Gs={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Xs={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Zs=function(t){return"if(".concat(t,")return null;")},Qs={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Zs("$event.target !== $event.currentTarget"),ctrl:Zs("!$event.ctrlKey"),shift:Zs("!$event.shiftKey"),alt:Zs("!$event.altKey"),meta:Zs("!$event.metaKey"),left:Zs("'button' in $event && $event.button !== 0"),middle:Zs("'button' in $event && $event.button !== 1"),right:Zs("'button' in $event && $event.button !== 2")};function ta(t,e){var n=e?"nativeOn:":"on:",r="",o="";for(var i in t){var s=ea(t[i]);t[i]&&t[i].dynamic?o+="".concat(i,",").concat(s,","):r+='"'.concat(i,'":').concat(s,",")}return r="{".concat(r.slice(0,-1),"}"),o?n+"_d(".concat(r,",[").concat(o.slice(0,-1),"])"):n+r}function ea(t){if(!t)return"function(){}";if(Array.isArray(t))return"[".concat(t.map((function(t){return ea(t)})).join(","),"]");var e=Us.test(t.value),n=Ks.test(t.value),r=Us.test(t.value.replace(Ys,""));if(t.modifiers){var o="",i="",s=[],a=function(e){if(Qs[e])i+=Qs[e],Gs[e]&&s.push(e);else if("exact"===e){var n=t.modifiers;i+=Zs(["ctrl","shift","alt","meta"].filter((function(t){return!n[t]})).map((function(t){return"$event.".concat(t,"Key")})).join("||"))}else s.push(e)};for(var l in t.modifiers)a(l);s.length&&(o+=function(t){return"if(!$event.type.indexOf('key')&&"+"".concat(t.map(na).join("&&"),")return null;")}(s)),i&&(o+=i);var c=e?"return ".concat(t.value,".apply(null, arguments)"):n?"return (".concat(t.value,").apply(null, arguments)"):r?"return ".concat(t.value):t.value;return"function($event){".concat(o).concat(c,"}")}return e||n?t.value:"function($event){".concat(r?"return ".concat(t.value):t.value,"}")}function na(t){var e=parseInt(t,10);if(e)return"$event.keyCode!==".concat(e);var n=Gs[t],r=Xs[t];return"_k($event.keyCode,"+"".concat(JSON.stringify(t),",")+"".concat(JSON.stringify(n),",")+"$event.key,"+"".concat(JSON.stringify(r))+")"}var ra={on:function(t,e){t.wrapListeners=function(t){return"_g(".concat(t,",").concat(e.value,")")}},bind:function(t,e){t.wrapData=function(n){return"_b(".concat(n,",'").concat(t.tag,"',").concat(e.value,",").concat(e.modifiers&&e.modifiers.prop?"true":"false").concat(e.modifiers&&e.modifiers.sync?",true":"",")")}},cloak:$},oa=function(t){this.options=t,this.warn=t.warn||Kr,this.transforms=Yr(t.modules,"transformCode"),this.dataGenFns=Yr(t.modules,"genData"),this.directives=D(D({},ra),t.directives);var e=t.isReservedTag||E;this.maybeComponent=function(t){return!!t.component||!e(t.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function ia(t,e){var n=new oa(e),r=t?"script"===t.tag?"null":sa(t,n):'_c("div")';return{render:"with(this){return ".concat(r,"}"),staticRenderFns:n.staticRenderFns}}function sa(t,e){if(t.parent&&(t.pre=t.pre||t.parent.pre),t.staticRoot&&!t.staticProcessed)return la(t,e);if(t.once&&!t.onceProcessed)return ca(t,e);if(t.for&&!t.forProcessed)return ha(t,e);if(t.if&&!t.ifProcessed)return ua(t,e);if("template"!==t.tag||t.slotTarget||e.pre){if("slot"===t.tag)return function(t,e){var n=t.slotName||'"default"',r=ga(t,e),o="_t(".concat(n).concat(r?",function(){return ".concat(r,"}"):""),i=t.attrs||t.dynamicAttrs?ba((t.attrs||[]).concat(t.dynamicAttrs||[]).map((function(t){return{name:S(t.name),value:t.value,dynamic:t.dynamic}}))):null,s=t.attrsMap["v-bind"];!i&&!s||r||(o+=",null");i&&(o+=",".concat(i));s&&(o+="".concat(i?"":",null",",").concat(s));return o+")"}(t,e);var n=void 0;if(t.component)n=function(t,e,n){var r=e.inlineTemplate?null:ga(e,n,!0);return"_c(".concat(t,",").concat(fa(e,n)).concat(r?",".concat(r):"",")")}(t.component,t,e);else{var r=void 0;(!t.plain||t.pre&&e.maybeComponent(t))&&(r=fa(t,e));var o=void 0,i=e.options.bindings;i&&!1!==i.__isScriptSetup&&(o=aa(i,t.tag)||aa(i,S(t.tag))||aa(i,k(S(t.tag)))),o||(o="'".concat(t.tag,"'"));var s=t.inlineTemplate?null:ga(t,e,!0);n="_c(".concat(o).concat(r?",".concat(r):"").concat(s?",".concat(s):"",")")}for(var a=0;a>>0}(s)):"",")")}(t,t.scopedSlots,e),",")),t.model&&(n+="model:{value:".concat(t.model.value,",callback:").concat(t.model.callback,",expression:").concat(t.model.expression,"},")),t.inlineTemplate){var i=function(t,e){var n=t.children[0];if(n&&1===n.type){var r=ia(n,e.options);return"inlineTemplate:{render:function(){".concat(r.render,"},staticRenderFns:[").concat(r.staticRenderFns.map((function(t){return"function(){".concat(t,"}")})).join(","),"]}")}}(t,e);i&&(n+="".concat(i,","))}return n=n.replace(/,$/,"")+"}",t.dynamicAttrs&&(n="_b(".concat(n,',"').concat(t.tag,'",').concat(ba(t.dynamicAttrs),")")),t.wrapData&&(n=t.wrapData(n)),t.wrapListeners&&(n=t.wrapListeners(n)),n}function pa(t){return 1===t.type&&("slot"===t.tag||t.children.some(pa))}function ma(t,e){var n=t.attrsMap["slot-scope"];if(t.if&&!t.ifProcessed&&!n)return ua(t,e,ma,"null");if(t.for&&!t.forProcessed)return ha(t,e,ma);var r="_empty_"===t.slotScope?"":String(t.slotScope),o="function(".concat(r,"){")+"return ".concat("template"===t.tag?t.if&&n?"(".concat(t.if,")?").concat(ga(t,e)||"undefined",":undefined"):ga(t,e)||"undefined":sa(t,e),"}"),i=r?"":",proxy:true";return"{key:".concat(t.slotTarget||'"default"',",fn:").concat(o).concat(i,"}")}function ga(t,e,n,r,o){var i=t.children;if(i.length){var s=i[0];if(1===i.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag){var a=n?e.maybeComponent(s)?",1":",0":"";return"".concat((r||sa)(s,e)).concat(a)}var l=n?function(t,e){for(var n=0,r=0;r':'',_a.innerHTML.indexOf("
")>0}var Da=!!H&&Ma(!1),Ta=!!H&&Ma(!0),$a=w((function(t){var e=gr(t);return e&&e.innerHTML})),Ea=Bn.prototype.$mount;Bn.prototype.$mount=function(t,e){if((t=t&&gr(t))===document.body||t===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=$a(r));else{if(!r.nodeType)return this;r=r.innerHTML}else t&&(r=function(t){if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}(t));if(r){var o=Ca(r,{outputSourceRange:!1,shouldDecodeNewlines:Da,shouldDecodeNewlinesForHref:Ta,delimiters:n.delimiters,comments:n.comments},this),i=o.render,s=o.staticRenderFns;n.render=i,n.staticRenderFns=s}}return Ea.call(this,t,e)},Bn.compile=Ca;var Na=("undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function Aa(t,e){if(void 0===e&&(e=[]),null===t||"object"!=typeof t)return t;var n,r=(n=function(e){return e.original===t},e.filter(n)[0]);if(r)return r.copy;var o=Array.isArray(t)?[]:{};return e.push({original:t,copy:o}),Object.keys(t).forEach((function(n){o[n]=Aa(t[n],e)})),o}function Pa(t,e){Object.keys(t).forEach((function(n){return e(t[n],n)}))}function Ia(t){return null!==t&&"object"==typeof t}var Ra=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var n=t.state;this.state=("function"==typeof n?n():n)||{}},za={namespaced:{configurable:!0}};za.namespaced.get=function(){return!!this._rawModule.namespaced},Ra.prototype.addChild=function(t,e){this._children[t]=e},Ra.prototype.removeChild=function(t){delete this._children[t]},Ra.prototype.getChild=function(t){return this._children[t]},Ra.prototype.hasChild=function(t){return t in this._children},Ra.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},Ra.prototype.forEachChild=function(t){Pa(this._children,t)},Ra.prototype.forEachGetter=function(t){this._rawModule.getters&&Pa(this._rawModule.getters,t)},Ra.prototype.forEachAction=function(t){this._rawModule.actions&&Pa(this._rawModule.actions,t)},Ra.prototype.forEachMutation=function(t){this._rawModule.mutations&&Pa(this._rawModule.mutations,t)},Object.defineProperties(Ra.prototype,za);var ja,Fa=function(t){this.register([],t,!1)};function La(t,e,n){if(e.update(n),n.modules)for(var r in n.modules){if(!e.getChild(r))return;La(t.concat(r),e.getChild(r),n.modules[r])}}Fa.prototype.get=function(t){return t.reduce((function(t,e){return t.getChild(e)}),this.root)},Fa.prototype.getNamespace=function(t){var e=this.root;return t.reduce((function(t,n){return t+((e=e.getChild(n)).namespaced?n+"/":"")}),"")},Fa.prototype.update=function(t){La([],this.root,t)},Fa.prototype.register=function(t,e,n){var r=this;void 0===n&&(n=!0);var o=new Ra(e,n);0===t.length?this.root=o:this.get(t.slice(0,-1)).addChild(t[t.length-1],o);e.modules&&Pa(e.modules,(function(e,o){r.register(t.concat(o),e,n)}))},Fa.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1],r=e.getChild(n);r&&r.runtime&&e.removeChild(n)},Fa.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];return!!e&&e.hasChild(n)};var Ba=function(t){var e=this;void 0===t&&(t={}),!ja&&"undefined"!=typeof window&&window.Vue&&Ua(window.Vue);var n=t.plugins;void 0===n&&(n=[]);var r=t.strict;void 0===r&&(r=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new Fa(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new ja,this._makeLocalGettersCache=Object.create(null);var o=this,i=this.dispatch,s=this.commit;this.dispatch=function(t,e){return i.call(o,t,e)},this.commit=function(t,e,n){return s.call(o,t,e,n)},this.strict=r;var a=this._modules.root.state;Ja(this,a,[],this._modules.root),Ha(this,a),n.forEach((function(t){return t(e)})),(void 0!==t.devtools?t.devtools:ja.config.devtools)&&function(t){Na&&(t._devtoolHook=Na,Na.emit("vuex:init",t),Na.on("vuex:travel-to-state",(function(e){t.replaceState(e)})),t.subscribe((function(t,e){Na.emit("vuex:mutation",t,e)}),{prepend:!0}),t.subscribeAction((function(t,e){Na.emit("vuex:action",t,e)}),{prepend:!0}))}(this)},Va={state:{configurable:!0}};function Wa(t,e,n){return e.indexOf(t)<0&&(n&&n.prepend?e.unshift(t):e.push(t)),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function qa(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;Ja(t,n,[],t._modules.root,!0),Ha(t,n,e)}function Ha(t,e,n){var r=t._vm;t.getters={},t._makeLocalGettersCache=Object.create(null);var o=t._wrappedGetters,i={};Pa(o,(function(e,n){i[n]=function(t,e){return function(){return t(e)}}(e,t),Object.defineProperty(t.getters,n,{get:function(){return t._vm[n]},enumerable:!0})}));var s=ja.config.silent;ja.config.silent=!0,t._vm=new ja({data:{$$state:e},computed:i}),ja.config.silent=s,t.strict&&function(t){t._vm.$watch((function(){return this._data.$$state}),(function(){}),{deep:!0,sync:!0})}(t),r&&(n&&t._withCommit((function(){r._data.$$state=null})),ja.nextTick((function(){return r.$destroy()})))}function Ja(t,e,n,r,o){var i=!n.length,s=t._modules.getNamespace(n);if(r.namespaced&&(t._modulesNamespaceMap[s],t._modulesNamespaceMap[s]=r),!i&&!o){var a=Ka(e,n.slice(0,-1)),l=n[n.length-1];t._withCommit((function(){ja.set(a,l,r.state)}))}var c=r.context=function(t,e,n){var r=""===e,o={dispatch:r?t.dispatch:function(n,r,o){var i=Ya(n,r,o),s=i.payload,a=i.options,l=i.type;return a&&a.root||(l=e+l),t.dispatch(l,s)},commit:r?t.commit:function(n,r,o){var i=Ya(n,r,o),s=i.payload,a=i.options,l=i.type;a&&a.root||(l=e+l),t.commit(l,s,a)}};return Object.defineProperties(o,{getters:{get:r?function(){return t.getters}:function(){return function(t,e){if(!t._makeLocalGettersCache[e]){var n={},r=e.length;Object.keys(t.getters).forEach((function(o){if(o.slice(0,r)===e){var i=o.slice(r);Object.defineProperty(n,i,{get:function(){return t.getters[o]},enumerable:!0})}})),t._makeLocalGettersCache[e]=n}return t._makeLocalGettersCache[e]}(t,e)}},state:{get:function(){return Ka(t.state,n)}}}),o}(t,s,n);r.forEachMutation((function(e,n){!function(t,e,n,r){(t._mutations[e]||(t._mutations[e]=[])).push((function(e){n.call(t,r.state,e)}))}(t,s+n,e,c)})),r.forEachAction((function(e,n){var r=e.root?n:s+n,o=e.handler||e;!function(t,e,n,r){(t._actions[e]||(t._actions[e]=[])).push((function(e){var o,i=n.call(t,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:t.getters,rootState:t.state},e);return(o=i)&&"function"==typeof o.then||(i=Promise.resolve(i)),t._devtoolHook?i.catch((function(e){throw t._devtoolHook.emit("vuex:error",e),e})):i}))}(t,r,o,c)})),r.forEachGetter((function(e,n){!function(t,e,n,r){if(t._wrappedGetters[e])return;t._wrappedGetters[e]=function(t){return n(r.state,r.getters,t.state,t.getters)}}(t,s+n,e,c)})),r.forEachChild((function(r,i){Ja(t,e,n.concat(i),r,o)}))}function Ka(t,e){return e.reduce((function(t,e){return t[e]}),t)}function Ya(t,e,n){return Ia(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}function Ua(t){ja&&t===ja||
/*!
* vuex v3.6.2
* (c) 2021 Evan You
* @license MIT
*/
-function(e){if(Number(e.version.split(".")[0])>=2)e.mixin({beforeCreate:n});else{var t=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[n].concat(e.init):n,t.call(this,e)}}function n(){var e=this.$options;e.store?this.$store="function"==typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}(wa=e)}Ca.state.get=function(){return this._vm._data.$$state},Ca.state.set=function(e){},ka.prototype.commit=function(e,t,n){var r=this,i=$a(e,t,n),o=i.type,s=i.payload,a={type:o,payload:s},l=this._mutations[o];l&&(this._withCommit((function(){l.forEach((function(e){e(s)}))})),this._subscribers.slice().forEach((function(e){return e(a,r.state)})))},ka.prototype.dispatch=function(e,t){var n=this,r=$a(e,t),i=r.type,o=r.payload,s={type:i,payload:o},a=this._actions[i];if(a){try{this._actionSubscribers.slice().filter((function(e){return e.before})).forEach((function(e){return e.before(s,n.state)}))}catch(wy){}var l=a.length>1?Promise.all(a.map((function(e){return e(o)}))):a[0](o);return new Promise((function(e,t){l.then((function(t){try{n._actionSubscribers.filter((function(e){return e.after})).forEach((function(e){return e.after(s,n.state)}))}catch(wy){}e(t)}),(function(e){try{n._actionSubscribers.filter((function(e){return e.error})).forEach((function(t){return t.error(s,n.state,e)}))}catch(wy){}t(e)}))}))}},ka.prototype.subscribe=function(e,t){return Oa(e,this._subscribers,t)},ka.prototype.subscribeAction=function(e,t){return Oa("function"==typeof e?{before:e}:e,this._actionSubscribers,t)},ka.prototype.watch=function(e,t,n){var r=this;return this._watcherVM.$watch((function(){return e(r.state,r.getters)}),t,n)},ka.prototype.replaceState=function(e){var t=this;this._withCommit((function(){t._vm._data.$$state=e}))},ka.prototype.registerModule=function(e,t,n){void 0===n&&(n={}),"string"==typeof e&&(e=[e]),this._modules.register(e,t),Da(this,this.state,e,this._modules.get(e),n.preserveState),_a(this,this.state)},ka.prototype.unregisterModule=function(e){var t=this;"string"==typeof e&&(e=[e]),this._modules.unregister(e),this._withCommit((function(){var n=Ta(t.state,e.slice(0,-1));wa.delete(n,e[e.length-1])})),Ma(this)},ka.prototype.hasModule=function(e){return"string"==typeof e&&(e=[e]),this._modules.isRegistered(e)},ka.prototype.hotUpdate=function(e){this._modules.update(e),Ma(this,!0)},ka.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(ka.prototype,Ca);var Ea=za((function(e,t){var n={};return Ra(t).forEach((function(t){var r=t.key,i=t.val;n[r]=function(){var t=this.$store.state,n=this.$store.getters;if(e){var r=ja(this.$store,"mapState",e);if(!r)return;t=r.context.state,n=r.context.getters}return"function"==typeof i?i.call(this,t,n):t[i]},n[r].vuex=!0})),n})),Na=za((function(e,t){var n={};return Ra(t).forEach((function(t){var r=t.key,i=t.val;n[r]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=this.$store.commit;if(e){var o=ja(this.$store,"mapMutations",e);if(!o)return;r=o.context.commit}return"function"==typeof i?i.apply(this,[r].concat(t)):r.apply(this.$store,[i].concat(t))}})),n})),Pa=za((function(e,t){var n={};return Ra(t).forEach((function(t){var r=t.key,i=t.val;i=e+i,n[r]=function(){if(!e||ja(this.$store,"mapGetters",e))return this.$store.getters[i]},n[r].vuex=!0})),n})),Ia=za((function(e,t){var n={};return Ra(t).forEach((function(t){var r=t.key,i=t.val;n[r]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=this.$store.dispatch;if(e){var o=ja(this.$store,"mapActions",e);if(!o)return;r=o.context.dispatch}return"function"==typeof i?i.apply(this,[r].concat(t)):r.apply(this.$store,[i].concat(t))}})),n}));function Ra(e){return function(e){return Array.isArray(e)||va(e)}(e)?Array.isArray(e)?e.map((function(e){return{key:e,val:e}})):Object.keys(e).map((function(t){return{key:t,val:e[t]}})):[]}function za(e){return function(t,n){return"string"!=typeof t?(n=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,n)}}function ja(e,t,n){return e._modulesNamespaceMap[n]}function Fa(e,t,n){var r=n?e.groupCollapsed:e.group;try{r.call(e,t)}catch(wy){e.log(t)}}function La(e){try{e.groupEnd()}catch(wy){e.log("—— log end ——")}}function Ba(){var e=new Date;return" @ "+Va(e.getHours(),2)+":"+Va(e.getMinutes(),2)+":"+Va(e.getSeconds(),2)+"."+Va(e.getMilliseconds(),3)}function Va(e,t){return n="0",r=t-e.toString().length,new Array(r+1).join(n)+e;var n,r}var Wa={Store:ka,install:Aa,version:"3.6.2",mapState:Ea,mapMutations:Na,mapGetters:Pa,mapActions:Ia,createNamespacedHelpers:function(e){return{mapState:Ea.bind(null,e),mapGetters:Pa.bind(null,e),mapMutations:Na.bind(null,e),mapActions:Ia.bind(null,e)}},createLogger:function(e){void 0===e&&(e={});var t=e.collapsed;void 0===t&&(t=!0);var n=e.filter;void 0===n&&(n=function(e,t,n){return!0});var r=e.transformer;void 0===r&&(r=function(e){return e});var i=e.mutationTransformer;void 0===i&&(i=function(e){return e});var o=e.actionFilter;void 0===o&&(o=function(e,t){return!0});var s=e.actionTransformer;void 0===s&&(s=function(e){return e});var a=e.logMutations;void 0===a&&(a=!0);var l=e.logActions;void 0===l&&(l=!0);var c=e.logger;return void 0===c&&(c=console),function(e){var u=ma(e.state);void 0!==c&&(a&&e.subscribe((function(e,o){var s=ma(o);if(n(e,u,s)){var a=Ba(),l=i(e),d="mutation "+e.type+a;Fa(c,d,t),c.log("%c prev state","color: #9E9E9E; font-weight: bold",r(u)),c.log("%c mutation","color: #03A9F4; font-weight: bold",l),c.log("%c next state","color: #4CAF50; font-weight: bold",r(s)),La(c)}u=s})),l&&e.subscribeAction((function(e,n){if(o(e,n)){var r=Ba(),i=s(e),a="action "+e.type+r;Fa(c,a,t),c.log("%c action","color: #03A9F4; font-weight: bold",i),La(c)}})))}}};function qa(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map((function(e){e(n)})),(r=e.get("*"))&&r.slice().map((function(e){e(t,n)}))}}}var Ha,Ja,Ka="function"==typeof Map?new Map:(Ha=[],Ja=[],{has:function(e){return Ha.indexOf(e)>-1},get:function(e){return Ja[Ha.indexOf(e)]},set:function(e,t){-1===Ha.indexOf(e)&&(Ha.push(e),Ja.push(t))},delete:function(e){var t=Ha.indexOf(e);t>-1&&(Ha.splice(t,1),Ja.splice(t,1))}}),Ya=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(wy){Ya=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function Ua(e){var t=Ka.get(e);t&&t.destroy()}function Xa(e){var t=Ka.get(e);t&&t.update()}var Ga=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((Ga=function(e){return e}).destroy=function(e){return e},Ga.update=function(e){return e}):((Ga=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return function(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!Ka.has(e)){var t,n=null,r=null,i=null,o=function(){e.clientWidth!==r&&c()},s=function(t){window.removeEventListener("resize",o,!1),e.removeEventListener("input",c,!1),e.removeEventListener("keyup",c,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",c,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),Ka.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",c,!1),window.addEventListener("resize",o,!1),e.addEventListener("input",c,!1),e.addEventListener("autosize:update",c,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",Ka.set(e,{destroy:s,update:c}),"vertical"===(t=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),n="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(n)&&(n=0),c()}function a(t){var n=e.style.width;e.style.width="0px",e.style.width=n,e.style.overflowY=t}function l(){if(0!==e.scrollHeight){var t=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),i=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+n+"px",r=e.clientWidth,t.forEach((function(e){e.node.scrollTop=e.scrollTop})),i&&(document.documentElement.scrollTop=i)}}function c(){l();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r=t?e:""+Array(t+1-r.length).join(n)+e},y={s:v,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+v(r,2,"0")+":"+v(i,2,"0")},m:function e(t,n){if(t.date()1)return e(s[0])}else{var a=t.name;w[a]=t,i=a}return!r&&i&&(b=i),i||!r&&b},k=function(e,t){if(x(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new O(n)},C=y;C.l=S,C.i=x,C.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var O=function(){function g(e){this.$L=S(e.locale,null,!0),this.parse(e)}var v=g.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(C.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},v.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},v.$utils=function(){return C},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(e,t){var n=k(e);return this.startOf(t)<=n&&n<=this.endOf(t)},v.isAfter=function(e,t){return k(e)68?1900:2e3)},a=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],c=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},d={A:[i,function(e){this.afternoon=u(e,!1)}],a:[i,function(e){this.afternoon=u(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[i,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],M:[r,a("month")],MM:[n,a("month")],MMM:[i,function(e){var t=c("months"),n=(c("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(e){this.year=s(e)}],YYYY:[/\d{4}/,a("year")],Z:l,ZZ:l};function h(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=s.length,l=0;l-1)return new Date(("X"===t?1e3:1)*e);var r=h(t)(e),i=r.year,o=r.month,s=r.day,a=r.hours,l=r.minutes,c=r.seconds,u=r.milliseconds,d=r.zone,f=new Date,p=s||(i||o?1:f.getDate()),m=i||f.getFullYear(),g=0;i&&!o||(g=o>0?o-1:f.getMonth());var v=a||0,y=l||0,b=c||0,w=u||0;return d?new Date(Date.UTC(m,g,p,v,y,b,w+60*d.offset*1e3)):n?new Date(Date.UTC(m,g,p,v,y,b,w)):new Date(m,g,p,v,y,b,w)}catch(x){return new Date("")}}(t,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date("")),o={}}else if(a instanceof Array)for(var f=a.length,p=1;p<=f;p+=1){s[1]=a[p-1];var m=n.apply(this,s);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}p===f&&(this.$d=new Date(""))}else i.call(this,e)}}}();function il(e){return(il="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var ol={selector:"vue-portal-target-".concat(((e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t})())},sl=function(e){return ol.selector=e},al="undefined"!=typeof window&&void 0!==("undefined"==typeof document?"undefined":il(document)),ll=Mn.extend({abstract:!0,name:"PortalOutlet",props:["nodes","tag"],data:function(e){return{updatedNodes:e.nodes}},render:function(e){var t=this.updatedNodes&&this.updatedNodes();return t?1!==t.length||t[0].text?e(this.tag||"DIV",t):t:e()},destroyed:function(){var e=this.$el;e&&e.parentNode.removeChild(e)}}),cl=Mn.extend({name:"VueSimplePortal",props:{disabled:{type:Boolean},prepend:{type:Boolean},selector:{type:String,default:function(){return"#".concat(ol.selector)}},tag:{type:String,default:"DIV"}},render:function(e){if(this.disabled){var t=this.$scopedSlots&&this.$scopedSlots.default();return t?t.length<2&&!t[0].text?t:e(this.tag,t):e()}return e()},created:function(){this.getTargetEl()||this.insertTargetEl()},updated:function(){var e=this;this.$nextTick((function(){e.disabled||e.slotFn===e.$scopedSlots.default||(e.container.updatedNodes=e.$scopedSlots.default),e.slotFn=e.$scopedSlots.default}))},beforeDestroy:function(){this.unmount()},watch:{disabled:{immediate:!0,handler:function(e){e?this.unmount():this.$nextTick(this.mount)}}},methods:{getTargetEl:function(){if(al)return document.querySelector(this.selector)},insertTargetEl:function(){if(al){var e=document.querySelector("body"),t=document.createElement(this.tag);t.id=this.selector.substring(1),e.appendChild(t)}},mount:function(){if(al){var e=this.getTargetEl(),t=document.createElement("DIV");this.prepend&&e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t),this.container=new ll({el:t,parent:this,propsData:{tag:this.tag,nodes:this.$scopedSlots.default}})}},unmount:function(){this.container&&(this.container.$destroy(),delete this.container)}}});function ul(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.component(t.name||"portal",cl),t.defaultSelector&&sl(t.defaultSelector)}"undefined"!=typeof window&&window.Vue&&window.Vue===Mn&&Mn.use(ul);var dl={},hl={};function fl(e){return null==e}function pl(e){return null!=e}function ml(e,t){return t.tag===e.tag&&t.key===e.key}function gl(e){var t=e.tag;e.vm=new t({data:e.args})}function vl(e,t,n){var r,i,o={};for(r=t;r<=n;++r)pl(i=e[r].key)&&(o[i]=r);return o}function yl(e,t,n){for(;t<=n;++t)gl(e[t])}function bl(e,t,n){for(;t<=n;++t){var r=e[t];pl(r)&&(r.vm.$destroy(),r.vm=null)}}function wl(e,t){e!==t&&(t.vm=e.vm,function(e){for(var t=Object.keys(e.args),n=0;na?yl(t,s,u):s>u&&bl(e,o,a)}(e,t):pl(t)?yl(t,0,t.length-1):pl(e)&&bl(e,0,e.length-1)};var xl={};function Sl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kl(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?a:a.$sub[0]:null}}},computed:{run:function(){var e=this,t=this.lazyParentModel();if(Array.isArray(t)&&t.__ob__){var n=t.__ob__.dep;n.depend();var r=n.constructor.target;if(!this._indirectWatcher){var i=r.constructor;this._indirectWatcher=new i(this,(function(){return e.runRule(t)}),null,{lazy:!0})}var o=this.getModel();if(!this._indirectWatcher.dirty&&this._lastModel===o)return this._indirectWatcher.depend(),r.value;this._lastModel=o,this._indirectWatcher.evaluate(),this._indirectWatcher.depend()}else this._indirectWatcher&&(this._indirectWatcher.teardown(),this._indirectWatcher=null);return this._indirectWatcher?this._indirectWatcher.value:this.runRule(t)},$params:function(){return this.run.params},proxy:function(){var e=this.run.output;return e.__isVuelidateAsyncVm?!!e.v:!!e},$pending:function(){var e=this.run.output;return!!e.__isVuelidateAsyncVm&&e.p}},destroyed:function(){this._indirectWatcher&&(this._indirectWatcher.teardown(),this._indirectWatcher=null)}}),a=i.extend({data:function(){return{dirty:!1,validations:null,lazyModel:null,model:null,prop:null,lazyParentModel:null,rootModel:null}},methods:s(s({},g),{},{refProxy:function(e){return this.getRef(e).proxy},getRef:function(e){return this.refs[e]},isNested:function(e){return"function"!=typeof this.validations[e]}}),computed:s(s({},p),{},{nestedKeys:function(){return this.keys.filter(this.isNested)},ruleKeys:function(){var e=this;return this.keys.filter((function(t){return!e.isNested(t)}))},keys:function(){return Object.keys(this.validations).filter((function(e){return"$params"!==e}))},proxy:function(){var e=this,t=u(this.keys,(function(t){return{enumerable:!0,configurable:!0,get:function(){return e.refProxy(t)}}})),n=u(v,(function(t){return{enumerable:!0,configurable:!0,get:function(){return e[t]}}})),r=u(y,(function(t){return{enumerable:!1,configurable:!0,get:function(){return e[t]}}})),i=this.hasIter()?{$iter:{enumerable:!0,value:Object.defineProperties({},s({},t))}}:{};return Object.defineProperties({},s(s(s(s({},t),i),{},{$model:{enumerable:!0,get:function(){var t=e.lazyParentModel();return null!=t?t[e.prop]:null},set:function(t){var n=e.lazyParentModel();null!=n&&(n[e.prop]=t,e.$touch())}}},n),r))},children:function(){var e=this;return[].concat(r(this.nestedKeys.map((function(t){return w(e,t)}))),r(this.ruleKeys.map((function(t){return x(e,t)})))).filter(Boolean)}})}),l=a.extend({methods:{isNested:function(e){return void 0!==this.validations[e]()},getRef:function(e){var t=this;return{get proxy(){return t.validations[e]()||!1}}}}}),m=a.extend({computed:{keys:function(){var e=this.getModel();return h(e)?Object.keys(e):[]},tracker:function(){var e=this,t=this.validations.$trackBy;return t?function(n){return"".concat(f(e.rootModel,e.getModelKey(n),t))}:function(e){return"".concat(e)}},getModelLazy:function(){var e=this;return function(){return e.getModel()}},children:function(){var e=this,n=this.validations,r=this.getModel(),i=s({},n);delete i.$trackBy;var o={};return this.keys.map((function(n){var s=e.tracker(n);return o.hasOwnProperty(s)?null:(o[s]=!0,(0,t.h)(a,s,{validations:i,prop:n,lazyParentModel:e.getModelLazy,model:r[n],rootModel:e.rootModel}))})).filter(Boolean)}},methods:{isNested:function(){return!0},getRef:function(e){return this.refs[this.tracker(e)]},hasIter:function(){return!0}}}),w=function(e,n){if("$each"===n)return(0,t.h)(m,n,{validations:e.validations[n],lazyParentModel:e.lazyParentModel,prop:n,lazyModel:e.getModel,rootModel:e.rootModel});var r=e.validations[n];if(Array.isArray(r)){var i=e.rootModel,o=u(r,(function(e){return function(){return f(i,i.$v,e)}}),(function(e){return Array.isArray(e)?e.join("."):e}));return(0,t.h)(l,n,{validations:o,lazyParentModel:c,prop:n,lazyModel:c,rootModel:i})}return(0,t.h)(a,n,{validations:r,lazyParentModel:e.getModel,prop:n,lazyModel:e.getModelKey,rootModel:e.rootModel})},x=function(e,n){return(0,t.h)(o,n,{rule:e.validations[n],lazyParentModel:e.lazyParentModel,lazyModel:e.getModel,rootModel:e.rootModel})};return b={VBase:i,Validation:a}},x=null;var S=function(e,n){var r=function(e){if(x)return x;for(var t=e.constructor;t.super;)t=t.super;return x=t,t}(e),i=w(r),o=i.Validation;return new(0,i.VBase)({computed:{children:function(){var r="function"==typeof n?n.call(e):n;return[(0,t.h)(o,"$v",{validations:r,lazyParentModel:c,prop:"$v",model:e,rootModel:e})]}}})},k={data:function(){var e=this.$options.validations;return e&&(this._vuelidate=S(this,e)),{}},beforeCreate:function(){var e=this.$options;e.validations&&(e.computed||(e.computed={}),e.computed.$v||(e.computed.$v=function(){return this._vuelidate?this._vuelidate.refs.$v.proxy:null}))},beforeDestroy:function(){this._vuelidate&&(this._vuelidate.$destroy(),this._vuelidate=null)}};function C(e){e.mixin(k)}e.validationMixin=k;var O=C;e.default=O}(dl);var El=Qa(dl);function Nl(e){this.content=e}function Pl(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let e=0;i.text[e]==o.text[e];e++)n++;return n}if(i.content.size||o.content.size){let e=Pl(i.content,o.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function Il(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e>1}},Nl.from=function(e){if(e instanceof Nl)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Nl(t)};class Rl{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let n=0;ne&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(i+=s.text.slice(Math.max(e,a)-a,t-a),o=!n):s.isLeaf&&r?(i+="function"==typeof r?r(s):r,o=!n):!o&&s.isBlock&&(i+=n,o=!0)}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);ie)for(let i=0,o=0;oe&&((ot)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new Rl(n,r)}cutByIndex(e,t){return e==t?Rl.empty:0==e&&t==this.content.length?this:new Rl(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new Rl(r,i)}addToStart(e){return new Rl([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Rl(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?jl(n+1,i):jl(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return Rl.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Rl(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Rl.empty;let t,n=0;for(let r=0;rthis.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;te.type.rank-t.type.rank)),t}}Ll.none=[];class Bl extends Error{}class Vl{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=ql(this.content,e+this.openStart,t);return n&&new Vl(n,this.openStart,this.openEnd)}removeBetween(e,t){return new Vl(Wl(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return Vl.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new Vl(Rl.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)r++;return new Vl(e,n,r)}}function Wl(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(Wl(o.content,t-i-1,n-i-1)))}function ql(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=ql(s.content,t-o-1,n);return a&&e.replaceChild(i,s.copy(a))}function Hl(e,t,n){if(n.openStart>e.depth)throw new Bl("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Bl("Inconsistent open depths");return Jl(e,t,n,0)}function Jl(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r=0;i--)r=t.node(i).copy(Rl.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Gl(o,Zl(e,i,s,t,r))}{let r=e.parent,i=r.content;return Gl(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return Gl(o,Ql(e,t,r))}function Kl(e,t){if(!t.type.compatibleContent(e.type))throw new Bl("Cannot join "+t.type.name+" onto "+e.type.name)}function Yl(e,t,n){let r=e.node(n);return Kl(r,t.node(n)),r}function Ul(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Xl(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Ul(e.nodeAfter,r),o++));for(let a=o;ai&&Yl(e,t,i+1),s=r.depth>i&&Yl(n,r,i+1),a=[];return Xl(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(Kl(o,s),Ul(Gl(o,Zl(e,t,n,r,i+1)),a)):(o&&Ul(Gl(o,Ql(e,t,i+1)),a),Xl(t,n,i,a),s&&Ul(Gl(s,Ql(n,r,i+1)),a)),Xl(r,null,i,a),new Rl(a)}function Ql(e,t,n){let r=[];if(Xl(null,e,n,r),e.depth>n){Ul(Gl(Yl(e,t,n+1),Ql(e,t,n+1)),r)}return Xl(t,null,n,r),new Rl(r)}Vl.empty=new Vl(Rl.empty,0,0);class ec{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let i=0;i0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ic(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let o=e;;){let{index:e,offset:t}=o.content.findIndex(i),s=i-t;if(n.push(o,e,r+t),!s)break;if(o=o.child(e),o.isText)break;i=s-1,r+=t+1}return new ec(t,n,i)}static resolveCached(e,t){for(let r=0;re&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),lc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Rl.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let a=r;ae.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=Rl.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}sc.prototype.text=void 0;class ac extends sc{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):lc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ac(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ac(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function lc(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class cc{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new uc(e,t);if(null==n.next)return cc.empty;let r=dc(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return n(vc(e,0));function n(r){let i=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let o=t[r.join(",")]=new cc(r.indexOf(e.length-1)>-1);for(let e=0;ee.to=t))}function o(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(o(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),i(o(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return i(o(e.expr,t),s),i(o(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(o(e.expr,t));if("range"==e.type){let s=t;for(let t=0;te.createAndFill())));for(let e=0;e=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r{let r=n+(t.validEnd?"*":" ")+" ";for(let i=0;i"+e.indexOf(t.next[i].next);return r})).join("\n")}}cc.empty=new cc(!0);class uc{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function dc(e){let t=[];do{t.push(hc(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function hc(e){let t=[];do{t.push(fc(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function fc(e){let t=function(e){if(e.eat("(")){let t=dc(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let e=n[o];e.groups.indexOf(t)>-1&&i.push(e)}0==i.length&&e.err("No node type or group '"+t+"' found");return i}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=mc(e,t)}return t}function pc(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function mc(e,t){let n=pc(e),r=n;return e.eat(",")&&(r="}"!=e.next?pc(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function gc(e,t){return t-e}function vc(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;tn[e]=new xc(e,t,r)));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class Sc{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class kc{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=wc(r.attrs),this.excluded=null;let i=yc(this.attrs);this.instance=i?new Ll(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Ll(this,bc(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new kc(e,r++,t,i))),n}removeFromSet(e){for(var t=0;t-1}}class Cc{constructor(e){this.cached=Object.create(null),this.spec={nodes:Nl.from(e.nodes),marks:Nl.from(e.marks||{}),topNode:e.topNode},this.nodes=xc.compile(this.spec.nodes,this),this.marks=kc.compile(this.spec.marks,this);let t=Object.create(null);for(let n in this.nodes){if(n in this.marks)throw new RangeError(n+" can not be both a node and a mark");let e=this.nodes[n],r=e.spec.content||"",i=e.spec.marks;e.contentMatch=t[r]||(t[r]=cc.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==i?null:i?Oc(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let n in this.marks){let e=this.marks[n],t=e.spec.excludes;e.excluded=null==t?[e]:""==t?[]:Oc(this,t.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof xc))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new ac(n,n.defaultAttrs,e,Ll.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return sc.fromJSON(this,e)}markFromJSON(e){return Ll.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Oc(e,t){let n=[];for(let r=0;r-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Mc{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new Ec(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Ec(this,t,!0);return n.addAll(e,t.from,t.to),Vl.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;re.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r{n(e=Pc(e)),e.mark=r}))}for(let r in e.nodes){let t=e.nodes[r].spec.parseDOM;t&&t.forEach((e=>{n(e=Pc(e)),e.node=r}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Mc(e,Mc.schemaRules(e)))}}const _c={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Dc={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Tc={ol:!0,ul:!0};function $c(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class Ac{constructor(e,t,n,r,i,o,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Ll.none,this.stashMarks=[],this.match=o||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Rl.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=Rl.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Rl.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;tthis.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(e,t,n){let r=t||0;for(let i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(let r=0;rthis.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(e){let t=function(e,t){for(let n=0;n=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function Nc(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Pc(e){let t={};for(let n in e)t[n]=e[n];return t}function Ic(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n{if(i.length||e.marks.length){let n=0,o=0;for(;n=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Rc.renderSpec(jc(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,i=t[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?e.createElementNS(n,i):e.createElement(i),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let c=l;cl)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:o}=Rc.renderSpec(e,i,n);if(s.appendChild(t),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Rc(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=zc(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return zc(e.marks)}}function zc(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function jc(e){return e.document||window.document}const Fc=Math.pow(2,16);function Lc(e){return 65535&e}class Bc{constructor(e,t=!1,n=null){this.pos=e,this.deleted=t,this.recover=n}}class Vc{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Vc.empty)return Vc.empty}recover(e){let t=0,n=Lc(e);if(!this.inverted)for(let r=0;re)break;let l=this.ranges[s+i],c=this.ranges[s+o],u=a+l;if(e<=u){let i=a+r+((l?e==a?-1:e==u?1:t:t)<0?0:c);if(n)return i;let o=e==(t<0?a:u)?null:s/3+(e-a)*Fc;return new Bc(i,t<0?e!=a:e!=u,o)}r+=c-l}return n?e+r:new Bc(e+r)}touches(e,t){let n=0,r=Lc(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;se)break;let a=this.ranges[s+i];if(e<=t+a&&s==3*r)return!0;n+=this.ranges[s+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new Wc;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;ni&&te.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return Jc.fromReplace(e,this.from,this.to,i)}invert(){return new Uc(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Yc(t.pos,n.pos,this.mark)}merge(e){return e instanceof Yc&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Yc(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Yc(t.from,t.to,e.markFromJSON(t.mark))}}Hc.jsonID("addMark",Yc);class Uc extends Hc{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new Vl(Kc(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Jc.fromReplace(e,this.from,this.to,n)}invert(){return new Yc(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Uc(t.pos,n.pos,this.mark)}merge(e){return e instanceof Uc&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Uc(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Uc(t.from,t.to,e.markFromJSON(t.mark))}}Hc.jsonID("removeMark",Uc);class Xc extends Hc{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Zc(e,this.from,this.to)?Jc.fail("Structure replace would overwrite content"):Jc.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Vc([this.from,this.to-this.from,this.slice.size])}invert(e){return new Xc(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted?null:new Xc(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof Xc)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?Vl.empty:new Vl(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Xc(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?Vl.empty:new Vl(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Xc(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Xc(t.from,t.to,Vl.fromJSON(e,t.slice),!!t.structure)}}Hc.jsonID("replace",Xc);class Gc extends Hc{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(Zc(e,this.from,this.gapFrom)||Zc(e,this.gapTo,this.to)))return Jc.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Jc.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Jc.fromReplace(e,this.from,this.to,n):Jc.fail("Content does not fit in gap")}getMap(){return new Vc([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Gc(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deleted&&n.deleted||rn.pos?null:new Gc(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Gc(t.from,t.to,t.gapFrom,t.gapTo,Vl.fromJSON(e,t.slice),t.insert,!!t.structure)}}function Zc(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Qc(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function eu(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(no;c--,u--){let e=i.node(c),t=i.index(c);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount),o=r&&r[u]||e;if(o!=e&&(n=n.replaceChild(0,o.type.create(o.attrs))),!e.canReplace(t+1,e.childCount)||!o.type.validContent(n))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function iu(e,t){let n=e.resolve(t),r=n.index();return i=n.nodeBefore,o=n.nodeAfter,!(!i||!o||i.isLeaf||!i.canAppend(o))&&n.parent.canReplace(r,r+1);var i,o}function ou(e,t,n=t,r=Vl.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return su(i,o,r)?new Xc(t,n,r):new au(i,o,r).fit()}function su(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Hc.jsonID("replaceAround",Gc);class au{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=Rl.empty;for(let r=0;r<=e.depth;r++){let t=e.node(r);this.frontier.push({type:t.type,match:t.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=Rl.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new Vl(i,o,s);return e>-1?new Gc(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Xc(n.pos,r.pos,a):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let n,r=null;t?(r=uu(this.unplaced.content,t-1).firstChild,n=r.content):n=this.unplaced.content;let i=n.firstChild;for(let o=this.depth;o>=0;o--){let n,{type:s,match:a}=this.frontier[o],l=null;if(1==e&&(i?a.matchType(i.type)||(l=a.fillBefore(Rl.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:t,frontierDepth:o,parent:r,inject:l};if(2==e&&i&&(n=a.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:o,parent:r,wrap:n};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=uu(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new Vl(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=uu(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new Vl(lu(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new Vl(lu(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let p=0;p1||0==a||e.content.size)&&(u=t,c.push(du(e.mark(d.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?h:-1)))}let f=l==s.childCount;f||(h=-1),this.placed=cu(this.placed,t,Rl.from(c)),this.frontier[t].match=u,f&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let p=0,m=s;p1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t=0;n--){let{match:t,type:r}=this.frontier[n],i=hu(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=cu(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=cu(this.placed,this.depth,Rl.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(Rl.empty,!0);e.childCount&&(this.placed=cu(this.placed,this.frontier.length,e))}}function lu(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(lu(e.firstChild.content,t-1,n)))}function cu(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(cu(e.lastChild.content,t-1,n)))}function uu(e,t){for(let n=0;n1&&(r=r.replaceChild(0,du(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Rl.empty,!0)))),e.copy(r)}function hu(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;rr){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(Rl.empty,!0))}return e}function mu(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(it.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}let gu=class extends Error{};gu=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(gu.prototype=Object.create(Error.prototype)).constructor=gu,gu.prototype.name="TransformError";const vu=Object.create(null);class yu{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new bu(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;i--){let r=t<0?Du(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):Du(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,n);if(r)return r}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Mu(e.node(0))}static atStart(e){return Du(e,e,0,0,1)||new Mu(e)}static atEnd(e){return Du(e,e,e.content.size,e.childCount,-1)||new Mu(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=vu[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in vu)throw new RangeError("Duplicate use of selection JSON ID "+e);return vu[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Su.between(this.$anchor,this.$head).getBookmark()}}yu.prototype.visible=!0;class bu{constructor(e,t){this.$from=e,this.$to=t}}let wu=!1;function xu(e){wu||e.parent.inlineContent||(wu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Su extends yu{constructor(e,t=e){xu(e),xu(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return yu.near(n);let r=e.resolve(t.map(this.anchor));return new Su(r.parent.inlineContent?r:n,n)}replace(e,t=Vl.empty){if(super.replace(e,t),t==Vl.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof Su&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ku(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Su(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=yu.findFrom(t,n,!0)||yu.findFrom(t,-n,!0);if(!e)return yu.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(yu.findFrom(e,-n,!0)||yu.findFrom(e,n,!0)).$anchor).posnew Mu(e)};function Du(e,t,n,r,i,o=!1){if(t.inlineContent)return Su.create(e,n);for(let s=r-(i>0?0:1);i>0?s=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&Cu.isSelectable(r))return Cu.create(e,n-(i<0?r.nodeSize:0))}else{let t=Du(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function Tu(e,t,n){let r=e.steps.length-1;if(r{null==i&&(i=r)})),e.setSelection(yu.near(e.doc.resolve(i),n)))}class $u extends class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Wc}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new gu(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=Vl.empty){let r=ou(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new Vl(Rl.from(n),0,0))}delete(e,t){return this.replace(e,t,Vl.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(su(i,o,r))return e.step(new Xc(t,n,r));let s=mu(i,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let h=i.depth,f=i.pos-1;h>0;h--,f--){let e=i.node(h).type.spec;if(e.defining||e.definingAsContext||e.isolating)break;s.indexOf(h)>-1?a=h:i.before(h)==f&&s.splice(1,0,-h)}let l=s.indexOf(a),c=[],u=r.openStart;for(let h=r.content,f=0;;f++){let e=h.firstChild;if(c.push(e),f==r.openStart)break;h=e.content}for(let h=u-1;h>=0;h--){let e=c[h].type,t=fu(e);if(t&&i.node(l).type!=e)u=h;else if(t||!e.isTextblock)break}for(let h=r.openStart;h>=0;h--){let t=(h+u+1)%(r.openStart+1),a=c[t];if(a)for(let c=0;c=0&&(e.replace(t,n,r),!(e.steps.length>d));h--){let e=s[h];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let e=r.index(i);if(r.node(i).canReplaceWith(e,e,n))return r.before(i+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let e=r.indexAfter(i);if(r.node(i).canReplaceWith(e,e,n))return r.after(i+1);if(e0&&(n||r.node(t-1).canReplace(r.index(t-1),i.indexAfter(t-1))))return e.delete(r.before(t),i.after(t))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return e.delete(r.before(s),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),l=s,c=a,u=Rl.empty,d=0;for(let p=o,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,u=Rl.from(r.node(p).copy(u)),d++):l--;let h=Rl.empty,f=0;for(let p=o,m=!1;p>n;p--)m||i.after(p+1)=0;s--){if(r.size){let e=n[s].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Rl.from(n[s].type.create(n[s].attrs,r))}let i=t.start,o=t.end;e.step(new Gc(i,o,i,o,new Vl(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,i)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(o).map(n),r)){e.clearIncompatible(e.mapping.slice(o).map(n,1),r);let s=e.mapping.slice(o),a=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Gc(a,l,a+1,l-1,new Vl(Rl.from(r.create(i,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r=[]){return function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Gc(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new Vl(Rl.from(s),0,0),1,!0))}(this,e,t,n,r),this}split(e,t=1,n){return function(e,t,n=1,r){let i=e.doc.resolve(t),o=Rl.empty,s=Rl.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){o=Rl.from(i.node(a).copy(o));let e=r&&r[c];s=Rl.from(e?e.type.create(e.attrs,s):i.node(a).copy(s))}e.step(new Xc(t,t,new Vl(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),d=Math.min(l+e.nodeSize,n),h=r.addToSet(u);for(let e=0;ee.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;o++;let a=null;if(r instanceof kc){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;ee.step(new Uc(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],s=t+1;for(let a=0;a=0;a--)e.step(o[a])}(this,e,t,n),this}}{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return Ll.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Ll.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(yu.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Au(e,t){return t&&e?e.bind(t):e}class Eu{constructor(e,t,n){this.name=e,this.init=Au(t.init,n),this.apply=Au(t.apply,n)}}const Nu=[new Eu("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new Eu("selection",{init:(e,t)=>e.selection||yu.atStart(t.doc),apply:e=>e.selection}),new Eu("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new Eu("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class Pu{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Nu.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Eu(e.key,e.spec.state,e))}))}}class Iu{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;ne.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new Pu(e.schema,e.plugins),i=new Iu(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=sc.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=yu.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(i[r.name]=a.fromJSON.call(s,e,t[o],i))}i[r.name]=r.init(e,i)}})),i}}function Ru(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=Ru(i,t,{})),n[r]=i}return n}class zu{constructor(e){this.spec=e,this.props={},e.props&&Ru(e.props,this,this.props),this.key=e.key?e.key.key:Fu("plugin")}getState(e){return e[this.key]}}const ju=Object.create(null);function Fu(e){return e in ju?e+"$"+ ++ju[e]:(ju[e]=0,e+"$")}class Lu{constructor(e="key"){this.key=Fu(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Bu="undefined"!=typeof navigator?navigator:null,Vu="undefined"!=typeof document?document:null,Wu=Bu&&Bu.userAgent||"",qu=/Edge\/(\d+)/.exec(Wu),Hu=/MSIE \d/.exec(Wu),Ju=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Wu),Ku=!!(Hu||Ju||qu),Yu=Hu?document.documentMode:Ju?+Ju[1]:qu?+qu[1]:0,Uu=!Ku&&/gecko\/(\d+)/i.test(Wu);Uu&&(/Firefox\/(\d+)/.exec(Wu)||[0,0])[1];const Xu=!Ku&&/Chrome\/(\d+)/.exec(Wu),Gu=!!Xu,Zu=Xu?+Xu[1]:0,Qu=!Ku&&!!Bu&&/Apple Computer/.test(Bu.vendor),ed=Qu&&(/Mobile\/\w+/.test(Wu)||!!Bu&&Bu.maxTouchPoints>2),td=ed||!!Bu&&/Mac/.test(Bu.platform),nd=/Android \d/.test(Wu),rd=!!Vu&&"webkitFontSmoothing"in Vu.documentElement.style,id=rd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,od=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},sd=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let ad=null;const ld=function(e,t,n){let r=ad||(ad=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},cd=function(e,t,n,r){return n&&(dd(e,t,n,r,-1)||dd(e,t,n,r,1))},ud=/^(img|br|input|textarea|hr)$/i;function dd(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:hd(e))){let n=e.parentNode;if(!n||1!=n.nodeType||fd(e)||ud.test(e.nodeName)||"false"==e.contentEditable)return!1;t=od(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?hd(e):0}}}function hd(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function fd(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const pd=function(e){let t=e.isCollapsed;return t&&Gu&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function md(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function gd(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function vd(e,t){return"number"==typeof e?e:e[t]}function yd(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function bd(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=sd(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,a=n?gd(o):yd(e),l=0,c=0;if(t.topa.bottom-vd(r,"bottom")&&(c=t.bottom-a.bottom+vd(i,"bottom")),t.lefta.right-vd(r,"right")&&(l=t.right-a.right+vd(i,"right")),l||c)if(n)o.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}if(n)break}}function wd(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=sd(r));return t}function xd(e,t){for(let n=0;n=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);let e=d.left>t.left?d.left-t.left:d.right=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=c+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:e,offset:o}:kd(n,r)}function Cd(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Od(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&i++}n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(o=function(e,t,n,r){let i=-1;for(let o=t;o!=e.dom;){let t=e.docView.nearestDesc(o,!0);if(!t)return null;if(t.node.isBlock&&t.parent){let e=t.dom.getBoundingClientRect();if(e.left>r.left||e.top>r.top)i=t.posBefore;else{if(!(e.right-1?i:e.docView.posFromDOM(t,n,1)}(e,n,i,t))}null==o&&(o=function(e,t,n){let{node:r,offset:i}=kd(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,s,t));let a=e.docView.nearestDesc(s,!0);return{pos:o,inside:a?a.posAtStart-a.border:-1}}function _d(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const Dd=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Td(e,t,n){let{node:r,offset:i}=e.docView.domFromPos(t,n<0?-1:1),o=rd||Uu;if(3==r.nodeType){if(!o||!Dd.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,$d(_d(ld(r,e,t),o),o<0)}{let e=_d(ld(r,i,i),n);if(Uu&&i&&/\s/.test(r.nodeValue[i-1])&&i=0)}if(i&&(n<0||i==hd(r))){let e=r.childNodes[i-1],t=3==e.nodeType?ld(e,hd(e)-(o?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return $d(_d(t,1),!1)}if(i=0)}function $d(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Ad(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Ed(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}const Nd=/[\u0590-\u08ac]/;let Pd=null,Id=null,Rd=!1;function zd(e,t,n){return Pd==t&&Id==n?Rd:(Pd=t,Id=n,Rd="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return Ed(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.dom;break}t=n.dom.parentNode}let r=Td(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=ld(e,0,e.nodeValue.length).getClientRects()}for(let e=0;ei.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return Nd.test(r.parent.textContent)&&a.modify?Ed(e,t,(()=>{let t=a.getRangeAt(0),i=a.focusNode,o=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");let l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||i==a.focusNode&&o==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?o:s}(e,t,n))}class jd{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tod(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;te||t instanceof Hd){i=e-o;break}o=n}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof Fd&&n.side>=0;r--);if(t<=0){let e,n=!0;for(;e=r?this.children[r-1]:null,e&&e.dom.parentNode!=this.contentDOM;r--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?od(e.dom)+1:0}}{let e,n=!0;for(;e=r=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=od(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;ef&&ot){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r=n:en){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?2:1,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirtyi?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Ld extends jd{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class Bd extends jd{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=Rc.renderSpec(document,t.type.spec.toDOM(t,n))),new Bd(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty0&&(i=ih(i,0,e,n));for(let s=0;ss?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),c=l&&l.dom,u=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else c||({dom:c,contentDOM:u}=Rc.renderSpec(document,t.type.spec.toDOM(t)));u||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return c=Qd(c,n,t),l?s=new Jd(e,t,n,r,c,u||null,d,l,i,o+1):t.isText?new qd(e,t,n,r,c,d,i):new Vd(e,t,n,r,c,u||null,d,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Rl.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&eh(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new nh(this,o&&o.node);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;no;)a.push(i[s++]);let h=o+u.nodeSize;if(u.isText){let e=h;s!e.inline)):a.slice(),t.forChild(o,u),d),o=h}}(this.node,this.innerDeco,((t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?Ll.none:this.node.child(i).marks,n,e),a.placeWidget(t,e,r)}),((t,o,l,c)=>{let u;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,o,l,c)||s&&e.state.selection.from>r&&e.state.selection.to-1&&a.updateNodeAt(t,o,l,u,e)||a.updateNextNode(t,o,l,e,c)||a.addNode(t,o,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),Kd(this.contentDOM,this.children,e),ed&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof Su)||nt+this.node.content.size)return null;let i=e.domSelection(),o=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=hd(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t=n){let e=a=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new Ld(this,i,t,r);e.input.compositionNodes.push(o),this.children=ih(this.children,n,n+r.length,e,o)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(eh(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Gd(this.dom,this.nodeDOM,Xd(this.outerDeco,this.node,t),Xd(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Wd(e,t,n,r,i){return Qd(r,t,e),new Vd(void 0,e,t,n,r,r,r,i,0)}class qd extends Vd{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new qd(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class Hd extends jd{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Jd extends Vd{constructor(e,t,n,r,i,o,s,a,l,c){super(e,t,n,r,i,o,s,l,c),this.spec=a}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Kd(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Bd)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n>1,o=Math.min(i,e.length);for(;r-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=Bd.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let s=this.index,a=Math.min(this.top.children.length,s+5);s=n||u<=t?o.push(l):(cn&&o.push(l.slice(n-c,l.size,r)))}return o}function oh(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(pd(n)){for(a=c;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&Cu.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==hd(e);r||i;){if(e==n)return!0;let t=od(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==hd(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new Cu(s==e?c:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=ph(e,a,c,"pointer"==t||e.state.selection.head{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{sh(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const lh=Qu||Gu&&Zu<63;function ch(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=rr(e,t,n)))||Su.between(t,n,r)}function mh(e){return(!e.editable||e.root.activeElement==e.dom)&&gh(e)}function gh(e){let t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(n){return!1}}function vh(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&yu.findFrom(o,t)}function yh(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function bh(e,t,n){let r=e.state.selection;if(!(r instanceof Su)){if(r instanceof Cu&&r.node.isInline)return yh(e,new Su(t>0?r.$to:r.$from));{let n=vh(e.state,t);return!!n&&yh(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=vh(e.state,t);return!!(n&&n instanceof Cu)&&yh(e,n)}if(!(td&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(Cu.isSelectable(o)?yh(e,new Cu(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!rd&&yh(e,new Su(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function wh(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function xh(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function Sh(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(Uu&&1==n.nodeType&&r0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(xh(e))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(Ch(n))break;{let t=n.previousSibling;for(;t&&xh(t);)i=n.parentNode,o=od(t),t=t.previousSibling;if(t)n=t,r=wh(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?Oh(e,t,n,r):i&&Oh(e,t,i,o)}function kh(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=wh(n);for(;;)if(r{e.state==i&&ah(e)}),50)}function Mh(e,t,n){let r=e.state.selection;if(r instanceof Su&&!r.empty||n.indexOf("s")>-1)return!1;if(td&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=vh(e.state,t);if(n&&n instanceof Cu)return yh(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof Mu?yu.near(n,t):yu.findFrom(n,t);return!!s&&yh(e,s)}return!1}function _h(e,t){if(!(e.state.selection instanceof Su))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function Dh(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Th(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||td&&72==n&&"c"==r?_h(e,-1)||Sh(e):46==n||td&&68==n&&"c"==r?_h(e,1)||kh(e):13==n||27==n||(37==n||td&&66==n&&"c"==r?bh(e,-1,r)||Sh(e):39==n||td&&70==n&&"c"==r?bh(e,1,r)||kh(e):38==n||td&&80==n&&"c"==r?Mh(e,-1,r)||Sh(e):40==n||td&&78==n&&"c"==r?function(e){if(!Qu||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Dh(e,n,"true"),setTimeout((()=>Dh(e,n,"false")),20)}return!1}(e)||Mh(e,1,r)||kh(e):r==(td?"m":"c")&&(66==n||73==n||89==n||90==n))}function $h(e,t){let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||Rc.fromSchema(e.state.schema),a=Lh(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,d=0;for(;u&&1==u.nodeType&&(c=jh[u.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}u=l.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n")}}function Ah(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||r)})),a)return t?new Vl(Rl.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):Vl.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,i,r)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=Rc.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),o=function(e){let t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=Lh().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&jh[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>""+e+">")).reverse().join(""));if(r.innerHTML=e,n)for(let o=0;o0&&o.firstChild;d--)o=o.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Mc.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!u),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Eh.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(u)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(wy){return e}let{content:i,openStart:o,openEnd:s}=e;for(let a=n.length-2;a>=0;a-=2){let e=r.nodes[n[a]];if(!e||e.hasRequiredAttrs())break;i=Rl.from(e.create(n[a+1],i)),o++,s++}return new Vl(i,o,s)}(zh(s,+u[1],+u[2]),u[4]);else if(s=Vl.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&Ph(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=Ih(o[o.length-1],r.length));let t=Nh(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return Rl.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let n=s.content.firstChild;e{s=e(s)})),s}const Eh=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Nh(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Rl.from(e));return e}function Ph(e,t,n,r,i){if(i=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Rl.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function zh(e,t,n){return t{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Jh(e,t))}))}function Jh(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Kh(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Yh(e){return{left:e.clientX,top:e.clientY}}function Uh(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(e.someProp(t,(t=>s>o.depth?t(e,n,o.nodeAfter,o.before(s),i,!0):t(e,n,o.node(s),o.before(s),i,!1))))return!0;return!1}function Xh(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Gh(e,t,n,r,i){return Uh(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof Cu&&(n=i.node);let o=e.state.doc.resolve(t);for(let s=o.depth+1;s>0;s--){let e=s>o.depth?o.nodeAfter:o.node(s);if(Cu.isSelectable(e)){r=n&&i.$from.depth>0&&s>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(s);break}}return null!=r&&(Xh(e,Cu.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&Cu.isSelectable(r))&&(Xh(e,new Cu(n),"pointer"),!0)}(e,n))}function Zh(e,t,n,r){return Uh(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Qh(e,t,n,r){return Uh(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Xh(e,Su.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let t=o>i.depth?i.nodeAfter:i.node(o),n=i.before(o);if(t.inlineContent)Xh(e,Su.create(r,n+1,n+1+t.content.size),"pointer");else{if(!Cu.isSelectable(t))continue;Xh(e,Cu.create(r,n),"pointer")}return!0}}(e,n,r)}function ef(e){return lf(e)}Vh.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!rf(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!nd||!Gu||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!ed||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||Th(e,n)?n.preventDefault():qh(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,md(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},Vh.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Vh.keypress=(e,t)=>{let n=t;if(rf(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||td&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof Su&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const tf=td?"metaKey":"ctrlKey";Bh.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=ef(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[tf]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(Yh(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new nf(e,s,n,!!r)):("doubleClick"==o?Zh:Qh)(e,s.pos,s.inside,n)?n.preventDefault():qh(e,"pointer"))};class nf{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[tf],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof Cu&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Uu||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),qh(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>ah(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Yh(e))),this.allowDefault||!t?qh(this.view,"pointer"):Gh(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Qu&&this.mightDrag&&!this.mightDrag.node.isAtom||Gu&&!(this.view.state.selection instanceof Su)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Xh(this.view,yu.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):qh(this.view,"pointer")}move(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),qh(this.view,"pointer"),0==e.buttons&&this.done()}}function rf(e,t){return!!e.composing||!!(Qu&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Bh.touchdown=e=>{ef(e),qh(e,"pointer")},Bh.contextmenu=e=>ef(e);const of=nd?5e3:-1;function sf(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>lf(e)),t))}function af(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function lf(e,t=!1){if(!(nd&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),af(e),t||e.docView&&e.docView.dirty){let t=oh(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}Vh.compositionstart=Vh.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),lf(e,!0),e.markCursor=null;else if(lf(e),Uu&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let r=n<0?e.lastChild:e.childNodes[n-1];if(!r)break;if(3==r.nodeType){t.collapse(r,r.nodeValue.length);break}e=r,n=-1}}e.input.composing=!0}sf(e,of)},Vh.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,sf(e,20))};const cf=Ku&&Yu<15||ed&&id<604;function uf(e,t,n,r){let i=Ah(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,i||Vl.empty))))return!0;if(!i)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Bh.copy=Vh.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=cf?null:n.clipboardData,s=r.content(),{dom:a,text:l}=$h(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Vh.paste=(e,t)=>{let n=t;if(e.composing&&!nd)return;let r=cf?null:n.clipboardData;r&&uf(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?uf(e,r.value,null,t):uf(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class df{constructor(e,t){this.slice=e,this.move=t}}const hf=td?"altKey":"ctrlKey";Bh.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Yh(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof Cu?i.to-1:i.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(Cu.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(Cu.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=$h(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(cf?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",cf||n.dataTransfer.setData("text/plain",l),e.dragging=new df(s,!n[hf])},Bh.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},Vh.dragover=Vh.dragenter=(e,t)=>t.preventDefault(),Vh.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Yh(n));if(!i)return;let o=e.state.doc.resolve(i.pos);if(!o)return;let s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=Ah(e,n.dataTransfer.getData(cf?"Text":"text/plain"),cf?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[hf]);if(e.someProp("handleDrop",(t=>t(e,n,s||Vl.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?function(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o=0;e--){let t=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,n=r.index(e)+(t>0?1:0),s=r.node(e),a=!1;if(1==o)a=s.canReplace(n,n,i);else{let e=s.contentMatchAt(n).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(n,n,e[0])}if(a)return 0==t?r.pos:t<0?r.before(e+1):r.after(e+1)}return null}(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let c=e.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,h=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(h))return;let f=c.doc.resolve(u);if(d&&Cu.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Cu(f));else{let t=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),c.setSelection(ph(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},Bh.focus=e=>{e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&ah(e)}),20))},Bh.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Bh.beforeinput=(e,t)=>{if(Gu&&nd&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,md(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let os in Vh)Bh[os]=Vh[os];function ff(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class pf{constructor(e,t){this.toDOM=e,this.spec=t||bf,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new vf(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof pf&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ff(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class mf{constructor(e,t){this.attrs=e,this.spec=t||bf}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new vf(i,o,this)}valid(e,t){return t.from=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;oe){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==xf||0==e.maps.length?this:this.mapInner(e,t,0,0,n||bf)}mapInner(e,t,n,r,i){let o;for(let s=0;s{for(let s=0;sc+o)continue;let u=a[s]+o;t>=u?a[s+1]=e<=u?-2:-1:n>=i&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l)}};for(let u=0;u=r.content.size){c=!0;continue}let d=n.map(e[u+1]+o,-1)-i,{index:h,offset:f}=r.content.findIndex(l),p=r.maybeChild(h);if(p&&f==l&&f+p.nodeSize==d){let r=a[u+2].mapInner(n,p,t+1,e[u]+o+1,s);r!=xf?(a[u]=l,a[u+1]=d,a[u+2]=r):(a[u+1]=-2,c=!0)}else c=!0}if(c){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o{let s,a=o+n;if(s=Cf(t,e,a)){for(r||(r=this.children.slice());io&&t.to=e){this.children[s]==e&&(n=this.children[s+2]);break}let i=e+1,o=i+t.content.size;for(let s=0;si&&e.type instanceof mf){let t=Math.max(i,e.from)-i,n=Math.min(o,e.to)-i;tn.map(e,t,bf)));return Sf.from(n)}forChild(e,t){if(t.isLeaf)return wf.empty;let n=[];for(let r=0;rn&&o.to{let a=Cf(e,t,s+n);if(a){o=!0;let e=Mf(a,t,n+s+1,r);e!=xf&&i.push(s,s+t.nodeSize,e)}}));let s=kf(o?Of(e):e,-n).sort(_f);for(let a=0;a0;)t++;e.splice(t,0,n)}function $f(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=xf&&t.push(r)})),e.cursorWrapper&&t.push(wf.create(e.state.doc,[e.cursorWrapper.deco])),Sf.from(t)}const Af={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Ef=Ku&&Yu<=11;class Nf{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Pf{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Nf,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),Ef&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&this.observer.observe(this.view.dom,Af),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(mh(this.view)){if(this.suppressingSelectionUpdates)return ah(this.view);if(Ku&&Yu<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&cd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(e){if(0==e.rangeCount)return!0;let t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){if(!this.view.docView||this.flushingSoon>-1)return;let e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);let t=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&mh(this.view)&&!this.ignoreSelectionChange(t),r=-1,i=-1,o=!1,s=[];if(this.view.editable)for(let a=0;a1){let e=s.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,i),function(e){if(If)return;If=!0,"normal"==getComputedStyle(e.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(r,i,o,s),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||ah(this.view),this.currentSelection.set(t))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;nDate.now()-50?e.input.lastSelectionOrigin:null,n=oh(e,t);if(n&&!e.state.selection.eq(n)){let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let a=e.state.selection,l=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelection(),u=c.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],pd(c)||r.push({node:c.focusNode,offset:c.focusOffset})),Gu&&8===e.input.lastKeyCode)for(let g=s;g>o;g--){let e=i.childNodes[g-1],t=e.pmViewDesc;if("BR"==e.nodeName&&!t){s=g;break}if(!t||t.size)break}let d=e.state.doc,h=e.someProp("domParser")||Mc.fromSchema(e.state.schema),f=d.resolve(a),p=null,m=h.parse(i,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Rf,context:f});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),p={anchor:e+a,head:t+a}}return{doc:m,sel:p,from:a,to:l}}(e,t,n);if(Gu&&e.cursorWrapper&&l.sel&&l.sel.anchor==e.cursorWrapper.deco.from){let t=e.cursorWrapper.deco.type.toDOM.nextSibling,n=t&&t.nodeValue?t.nodeValue.length:1;l.sel={anchor:l.sel.anchor+n,head:l.sel.anchor+n}}let c,u,d=e.state.doc,h=d.slice(l.from,l.to);8===e.input.lastKeyCode&&Date.now()-100=s?o-r:0,a=o+(a-s),s=o}else if(a=a?o-r:0,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(h.content,l.doc.content,l.from,c,u);if((ed&&e.input.lastIOSEnter>Date.now()-225||nd)&&i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",(t=>t(e,md(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!f){if(!(r&&a instanceof Su&&!a.empty&&a.$head.sameParent(a.$anchor))||e.composing||l.sel&&l.sel.anchor!=l.sel.head){if(l.sel){let t=jf(e,e.state.doc,l.sel);t&&!t.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(t))}return}f={start:a.from,endA:a.to,endB:a.to}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&f.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?f.start=e.state.selection.from:f.endA=e.state.selection.to-2&&e.state.selection.to<=l.to&&(f.endB+=e.state.selection.to-f.endA,f.endA=e.state.selection.to)),Ku&&Yu<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>l.from&&" "==l.doc.textBetween(f.start-l.from-1,f.start-l.from+1)&&(f.start--,f.endA--,f.endB--);let p,m=l.doc.resolveNoCache(f.start-l.from),g=l.doc.resolveNoCache(f.endB-l.from),v=d.resolve(f.start),y=m.sameParent(g)&&m.parent.inlineContent&&v.end()>=f.endA;if((ed&&e.input.lastIOSEnter>Date.now()-225&&(!y||i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!y&&m.post(e,md(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>f.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||Ff(r,!0,!1)n||Ff(s,!0,!1)t(e,md(8,"Backspace")))))return void(nd&&Gu&&e.domObserver.suppressSelectionUpdates());Gu&&nd&&f.endB==f.start&&(e.input.lastAndroidDelete=Date.now()),nd&&!y&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==f.endA&&(f.endB-=2,g=l.doc.resolveNoCache(f.endB-l.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,md(13,"Enter"))}))}),20));let b,w,x,S=f.start,k=f.endA;if(y)if(m.pos==g.pos)Ku&&Yu<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>ah(e)),20)),b=e.state.tr.delete(S,k),w=d.resolve(f.start).marksAcross(d.resolve(f.endA));else if(f.endA==f.endB&&(x=function(e,t){let n,r,i,o=e.firstChild.marks,s=t.firstChild.marks,a=o,l=s;for(let u=0;ue.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let u=0;un(e,S,k,t))))return;b=e.state.tr.insertText(t,S,k)}if(b||(b=e.state.tr.replace(S,k,l.doc.slice(f.start-l.from,f.endB-l.from))),l.sel){let t=jf(e,b.doc,l.sel);t&&!(Gu&&nd&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastAndroidDeletet.content.size?null:ph(e,t.resolve(n.anchor),t.resolve(n.head))}function Ff(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}class Lf{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Wh,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Hf),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Wf(this),Vf(this),this.nodeViews=qf(this),this.docView=Wd(this.state.doc,Bf(this),$f(this),this.dom,this),this.domObserver=new Pf(this,((e,t,n,r)=>zf(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in Bh){let n=Bh[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Kh(e,t)||Jh(e,t)||!e.editable&&t.type in Vh||n(e,t)})}Qu&&e.dom.addEventListener("input",(()=>null)),Hh(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Hh(this),this._props=e,e.plugins&&(e.plugins.forEach(Hf),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;if(e.storedMarks&&this.composing&&(af(this),i=!0),this.state=e,t){let e=qf(this);(function(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,r=!0),Hh(this)}this.editable=Wf(this),Vf(this);let o=$f(this),s=Bf(this),a=t?"reset":e.scrollToSelection>n.scrollToSelection?"to selection":"preserve",l=r||!this.docView.matchesNode(e.doc,s,o);!l&&e.selection.eq(n.selection)||(i=!0);let c="preserve"==a&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:wd(e.dom)}}(this);if(i){this.domObserver.stop();let t=l&&(Ku||Gu)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(l){let n=Gu?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(e.doc,s,o,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Wd(e.doc,s,o,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return cd(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?ah(this,t):(hh(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(n),"reset"==a)this.dom.scrollTop=0;else if("to selection"==a){let t=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(e.selection instanceof Cu){let n=this.docView.domAfterPos(e.selection.from);1==n.nodeType&&bd(this,n.getBoundingClientRect(),t)}else bd(this,this.coordsAtPos(e.selection.head,1),t)}else c&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;xd(n,0==r?0:r-t)}(c)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;tt.ownerDocument.getSelection()),this._root=t;return e||document}posAtCoords(e){return Md(this,e)}coordsAtPos(e,t=1){return Td(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return zd(this,t||this.state,e)}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],$f(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Jh(e,t)||!Bh[t.type]||!e.editable&&t.type in Vh||Bh[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelection(){return this.root.getSelection()}}function Bf(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e&&(t.class+=" "+n[e]),"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),[vf.node(0,e.state.doc.content.size,t)]}function Vf(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:vf.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Wf(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function qf(e){let t=Object.create(null);return e.someProp("nodeViews",(e=>{for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])})),t}function Hf(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Jf={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},Kf={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Yf="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Uf="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Xf="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Gf="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Zf="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Qf=Yf&&(Gf||+Yf[1]<57)||Xf&&Gf,ep=0;ep<10;ep++)Jf[48+ep]=Jf[96+ep]=String(ep);for(ep=1;ep<=24;ep++)Jf[ep+111]="F"+ep;for(ep=65;ep<=90;ep++)Jf[ep]=String.fromCharCode(ep+32),Kf[ep]=String.fromCharCode(ep);for(var tp in Jf)Kf.hasOwnProperty(tp)||(Kf[tp]=Jf[tp]);const np="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function rp(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let a=0;a127)&&(r=Jf[n.keyCode])&&r!=i){let i=t[ip(r,n,!0)];if(i&&i(e.state,e.dispatch,e))return!0}else if(o&&n.shiftKey){let r=t[ip(i,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}const ap=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function lp(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function cp(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function up(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=dp(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(yu.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0};function fp(e,t,n){let r,i,o=t.nodeBefore,s=t.nodeAfter;if(o.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(o,o+1)||!i.isTextblock&&!iu(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&i.matchType(r[0]||s.type).validEnd){if(n){let i=t.pos+s.nodeSize,a=Rl.empty;for(let e=r.length-1;e>=0;e--)a=Rl.from(r[e].create(null,a));a=Rl.from(o.copy(a));let l=e.tr.step(new Gc(t.pos-1,i,t.pos,i,new Vl(a,1,0),r.length,!0)),c=i+2*r.length;iu(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let l=yu.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&eu(c);if(null!=u&&u>=t.depth)return n&&n(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&lp(s,"start",!0)&&lp(o,"end")){let r=o,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=Rl.empty;for(let e=i.length-1;e>=0;e--)r=Rl.from(i[e].copy(r));n(e.tr.step(new Gc(t.pos-i.length,t.pos+s.nodeSize,t.pos+l,t.pos+s.nodeSize-l,new Vl(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function pp(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(Su.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const mp=pp(-1),gp=pp(1);function vp(e,t=null){return function(n,r){let{from:i,to:o}=n.selection,s=!1;return n.doc.nodesBetween(i,o,((r,i)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{let t=n.doc.resolve(i),r=t.index();s=t.parent.canReplaceWith(r,r+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,o,e,t).scrollIntoView()),!0)}}function yp(e,t=null){return function(n,r){let{empty:i,$cursor:o,ranges:s}=n.selection;if(i&&!o||!function(e,t,n){for(let r=0;r{if(s)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)})),s)return!0}return!1}(n.doc,s,e))return!1;if(r)if(o)e.isInSet(n.storedMarks||o.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{let i=!1,o=n.tr;for(let t=0;!i&&t{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;let i=cp(r);if(!i){let n=r.blockRange(),i=n&&eu(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&fp(e,i,t))return!0;if(0==r.parent.content.size&&(lp(o,"end")||Cu.isSelectable(o))){let n=ou(e.doc,r.before(),r.after(),Vl.empty);if(n&&n.slice.size{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=cp(r)}let s=o&&o.nodeBefore;return!(!s||!Cu.isSelectable(s))&&(t&&t(e.tr.setSelection(Cu.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)})),xp=bp(ap,((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)}),((e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Mu||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=dp(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(ru(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&eu(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)}),((e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof Cu&&e.selection.node.isBlock)return!(!n.parentOffset||!ru(e.doc,n.pos))&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(t){let i=r.parentOffset==r.parent.content.size,o=e.tr;(e.selection instanceof Su||e.selection instanceof Mu)&&o.deleteSelection();let s=0==n.depth?null:dp(n.node(-1).contentMatchAt(n.indexAfter(-1))),a=i&&s?[{type:s}]:void 0,l=ru(o.doc,o.mapping.map(n.pos),1,a);if(a||l||!ru(o.doc,o.mapping.map(n.pos),1,s?[{type:s}]:void 0)||(s&&(a=[{type:s}]),l=!0),l&&(o.split(o.mapping.map(n.pos),1,a),!i&&!n.parentOffset&&n.parent.type!=s)){let e=o.mapping.map(n.before()),t=o.doc.resolve(e);s&&n.node(-1).canReplaceWith(t.index(),t.index()+1,s)&&o.setNodeMarkup(o.mapping.map(n.before()),s)}t(o.scrollIntoView())}return!0})),"Mod-Enter":hp,Backspace:wp,"Mod-Backspace":wp,"Shift-Backspace":wp,Delete:xp,"Mod-Delete":xp,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new Mu(e.doc))),!0)},kp={"Ctrl-h":Sp.Backspace,"Alt-Backspace":Sp["Mod-Backspace"],"Ctrl-d":Sp.Delete,"Ctrl-Alt-Backspace":Sp["Mod-Delete"],"Alt-Delete":Sp["Mod-Delete"],"Alt-d":Sp["Mod-Delete"],"Ctrl-a":mp,"Ctrl-e":gp};for(let os in Sp)kp[os]=Sp[os];const Cp=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?kp:Sp;class Op{constructor(e,t){var n;this.match=e,this.match=e,this.handler="string"==typeof t?(n=t,function(e,t,r,i){let o=n;if(t[1]){let e=t[0].lastIndexOf(t[1]);o+=t[0].slice(e+t[1].length);let n=(r+=e)-i;n>0&&(o=t[0].slice(e-n,e)+o,r=i)}return e.tr.insertText(o,r,i)}):t}}function Mp({rules:e}){let t=new zu({state:{init:()=>null,apply(e,t){let n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(n,r,i,o)=>_p(n,r,i,o,e,t),handleDOMEvents:{compositionend:n=>{setTimeout((()=>{let{$cursor:r}=n.state.selection;r&&_p(n,r.pos,r.pos,"",e,t)}))}}},isInputRules:!0});return t}function _p(e,t,n,r,i,o){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r;for(let c=0;c{let n=e.plugins;for(let r=0;r=0;e--)n.step(r.steps[e].invert(r.docs[e]));if(i.text){let t=n.doc.resolve(i.from).marks();n.replaceWith(i.from,i.to,e.schema.text(i.text,t))}else n.delete(i.from,i.to);t(n)}return!0}}return!1};function Tp(e,t,n=null,r){return new Op(e,((e,i,o,s)=>{let a=n instanceof Function?n(i):n,l=e.tr.delete(o,s),c=l.doc.resolve(o).blockRange(),u=c&&tu(c,t,a);if(!u)return null;l.wrap(c,u);let d=l.doc.resolve(o-1).nodeBefore;return d&&d.type==t&&iu(l.doc,o-1)&&(!r||r(i,d))&&l.join(o-1),l}))}function $p(e,t,n=null){return new Op(e,((e,r,i,o)=>{let s=e.doc.resolve(i),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(i,o).setBlockType(i,i,t,a):null}))}new Op(/--$/,"—"),new Op(/\.\.\.$/,"…"),new Op(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new Op(/"$/,"”"),new Op(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new Op(/'$/,"’");const Ap=["ol",0],Ep=["ul",0],Np=["li",0],Pp={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:e=>({order:e.hasAttribute("start")?+e.getAttribute("start"):1})}],toDOM:e=>1==e.attrs.order?Ap:["ol",{start:e.attrs.order},0]},Ip={parseDOM:[{tag:"ul"}],toDOM:()=>Ep},Rp={parseDOM:[{tag:"li"}],toDOM:()=>Np,defining:!0};function zp(e,t){let n={};for(let r in e)n[r]=e[r];for(let r in t)n[r]=t[r];return n}function jp(e,t,n){return e.append({ordered_list:zp(Pp,{content:"list_item+",group:n}),bullet_list:zp(Ip,{content:"list_item+",group:n}),list_item:zp(Rp,{content:t})})}function Fp(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;let e=n.doc.resolve(s.start-2);l=new ic(e,e,s.depth),s.endIndex=0;u--)o=Rl.from(n[u].type.create(n[u].attrs,o));e.step(new Gc(t.start-(r?2:0),t.end,t.start,t.end,new Vl(o,0,0),n.length,!0));let s=0;for(let u=0;u=r.depth-3;e--)i=Rl.from(r.node(e).copy(i));let s=r.indexAfter(-1){if(c>-1)return!1;e.isTextblock&&0==e.content.size&&(c=t+1)})),c>-1&&l.setSelection(yu.near(l.doc.resolve(c))),n(l.scrollIntoView())}return!0}let a=i.pos==r.end()?s.contentMatchAt(0).defaultType:null,l=t.tr.delete(r.pos,i.pos),c=a?[null,{type:a}]:void 0;return!!ru(l.doc,r.pos,2,c)&&(n&&n(l.split(r.pos,2,c).scrollIntoView()),!0)}}function Bp(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));return!!o&&(!n||(r.node(o.depth-1).type==e?function(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);om;p--)f-=i.child(p).nodeSize,r.delete(f-1,f+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?Rl.empty:Rl.from(i))))return!1;let d=o.pos,h=d+s.nodeSize;return r.step(new Gc(d-(a?1:0),h+(l?1:0),d+1,h-1,new Vl((a?Rl.empty:Rl.from(i.copy(Rl.empty))).append(l?Rl.empty:Rl.from(i.copy(Rl.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,o)))}}function Vp(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=e)return!1;if(n){let r=l.lastChild&&l.lastChild.type==a.type,i=Rl.from(r?e.create():null),s=new Vl(Rl.from(e.create(null,Rl.from(a.type.create(null,i)))),r?3:1,0),c=o.start,u=o.end;n(t.tr.step(new Gc(c-(r?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0}}var Wp=function(){};Wp.prototype.append=function(e){return e.length?(e=Wp.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},Wp.prototype.prepend=function(e){return e.length?Wp.from(e).append(this):this},Wp.prototype.appendInner=function(e){return new Hp(this,e)},Wp.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Wp.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Wp.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Wp.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Wp.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},Wp.from=function(e){return e instanceof Wp?e:e&&e.length?new qp(e):Wp.empty};var qp=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Wp);Wp.empty=new qp([]);var Hp=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return ei&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&(!(n=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Wp),Jp=Wp;class Kp{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new Yp(e.map));let t,i=e.step.map(n.slice(r));i&&a.maybeStep(i).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new Yp(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(r)):e.selection,s=new Kp(this.items.slice(0,i).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,t,n,r){let i=[],o=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let c=0;cXp&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),o-=l),new Kp(s.append(i),o)}remapping(e,t){let n=new Wc;return this.items.forEach(((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new Kp(this.items.append(e.map((e=>new Yp(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(a+1,r));c&&s++,n.push(new Yp(l,o,c))}else n.push(new Yp(l))}),r);let l=[];for(let d=t;d500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let l,c=new Yp(s.invert(),e,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else o.map&&n--}),this.items.length,0),new Kp(Jp.from(r.reverse()),i)}}Kp.empty=new Kp(Jp.empty,0);class Yp{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Yp(t.getMap().invert(),t,this.selection)}}}class Up{constructor(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r}}const Xp=20;function Gp(e){let t=[];return e.forEach(((e,n,r,i)=>t.push(r,i))),t}function Zp(e,t){if(!e)return null;let n=[];for(let r=0;rnew Up(Kp.empty,Kp.empty,null,0),apply:(t,n,r)=>function(e,t,n,r){let i,o=n.getMeta(rm);if(o)return o.historyState;n.getMeta(im)&&(e=new Up(e.done,e.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(rm))return s.getMeta(rm).redo?new Up(e.done.addTransform(n,void 0,r,nm(t)),e.undone,Gp(n.mapping.maps[n.steps.length-1]),e.prevTime):new Up(e.done,e.undone.addTransform(n,void 0,r,nm(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new Up(e.done.rebased(n,i),e.undone.rebased(n,i),Zp(e.prevRanges,n.mapping),e.prevTime):new Up(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Zp(e.prevRanges,n.mapping),e.prevTime);{let i=0==e.prevTime||!s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let i=0;i=t[i]&&(n=!0)})),n}(n,e.prevRanges)),o=s?Zp(e.prevRanges,n.mapping):Gp(n.mapping.maps[n.steps.length-1]);return new Up(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,nm(t)),Kp.empty,o,n.time)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?sm:"historyRedo"==n?am:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}const sm=(e,t)=>{let n=rm.getState(e);return!(!n||0==n.done.eventCount)&&(t&&Qp(n,e,t,!1),!0)},am=(e,t)=>{let n=rm.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&Qp(n,e,t,!0),!0)};function lm(e){let t=rm.getState(e);return t?t.done.eventCount:0}function cm(e){let t=rm.getState(e);return t?t.undone.eventCount:0}var um={},dm={},hm={},fm={};Object.defineProperty(fm,"__esModule",{value:!0}),fm.default=void 0;var pm=xl.withParams;fm.default=pm,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.req=e.regex=e.ref=e.len=void 0,Object.defineProperty(e,"withParams",{enumerable:!0,get:function(){return n.default}});var t,n=(t=fm)&&t.__esModule?t:{default:t};function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=function(e){if(Array.isArray(e))return!!e.length;if(null==e)return!1;if(!1===e)return!0;if(e instanceof Date)return!isNaN(e.getTime());if("object"===r(e)){for(var t in e)return!0;return!1}return!!String(e).length};e.req=i;e.len=function(e){return Array.isArray(e)?e.length:"object"===r(e)?Object.keys(e).length:String(e).length};e.ref=function(e,t,n){return"function"==typeof e?e.call(t,n):n[e]};e.regex=function(e,t){return(0,n.default)({type:e},(function(e){return!i(e)||t.test(e)}))}}(hm),Object.defineProperty(dm,"__esModule",{value:!0}),dm.default=void 0;var mm=(0,hm.regex)("alpha",/^[a-zA-Z]*$/);dm.default=mm;var gm={};Object.defineProperty(gm,"__esModule",{value:!0}),gm.default=void 0;var vm=(0,hm.regex)("alphaNum",/^[a-zA-Z0-9]*$/);gm.default=vm;var ym={};Object.defineProperty(ym,"__esModule",{value:!0}),ym.default=void 0;var bm=(0,hm.regex)("numeric",/^[0-9]*$/);ym.default=bm;var wm={};Object.defineProperty(wm,"__esModule",{value:!0}),wm.default=void 0;var xm=hm;wm.default=function(e,t){return(0,xm.withParams)({type:"between",min:e,max:t},(function(n){return!(0,xm.req)(n)||(!/\s/.test(n)||n instanceof Date)&&+e<=+n&&+t>=+n}))};var Sm={};Object.defineProperty(Sm,"__esModule",{value:!0}),Sm.default=void 0;var km=(0,hm.regex)("email",/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i);Sm.default=km;var Cm={};Object.defineProperty(Cm,"__esModule",{value:!0}),Cm.default=void 0;var Om=hm,Mm=(0,Om.withParams)({type:"ipAddress"},(function(e){if(!(0,Om.req)(e))return!0;if("string"!=typeof e)return!1;var t=e.split(".");return 4===t.length&&t.every(_m)}));Cm.default=Mm;var _m=function(e){if(e.length>3||0===e.length)return!1;if("0"===e[0]&&"0"!==e)return!1;if(!e.match(/^\d+$/))return!1;var t=0|+e;return t>=0&&t<=255},Dm={};Object.defineProperty(Dm,"__esModule",{value:!0}),Dm.default=void 0;var Tm=hm;Dm.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":";return(0,Tm.withParams)({type:"macAddress"},(function(t){if(!(0,Tm.req)(t))return!0;if("string"!=typeof t)return!1;var n="string"==typeof e&&""!==e?t.split(e):12===t.length||16===t.length?t.match(/.{2}/g):null;return null!==n&&(6===n.length||8===n.length)&&n.every($m)}))};var $m=function(e){return e.toLowerCase().match(/^[0-9a-f]{2}$/)},Am={};Object.defineProperty(Am,"__esModule",{value:!0}),Am.default=void 0;var Em=hm;Am.default=function(e){return(0,Em.withParams)({type:"maxLength",max:e},(function(t){return!(0,Em.req)(t)||(0,Em.len)(t)<=e}))};var Nm={};Object.defineProperty(Nm,"__esModule",{value:!0}),Nm.default=void 0;var Pm=hm;Nm.default=function(e){return(0,Pm.withParams)({type:"minLength",min:e},(function(t){return!(0,Pm.req)(t)||(0,Pm.len)(t)>=e}))};var Im={};Object.defineProperty(Im,"__esModule",{value:!0}),Im.default=void 0;var Rm=hm,zm=(0,Rm.withParams)({type:"required"},(function(e){return(0,Rm.req)("string"==typeof e?e.trim():e)}));Im.default=zm;var jm={};Object.defineProperty(jm,"__esModule",{value:!0}),jm.default=void 0;var Fm=hm;jm.default=function(e){return(0,Fm.withParams)({type:"requiredIf",prop:e},(function(t,n){return!(0,Fm.ref)(e,this,n)||(0,Fm.req)(t)}))};var Lm={};Object.defineProperty(Lm,"__esModule",{value:!0}),Lm.default=void 0;var Bm=hm;Lm.default=function(e){return(0,Bm.withParams)({type:"requiredUnless",prop:e},(function(t,n){return!!(0,Bm.ref)(e,this,n)||(0,Bm.req)(t)}))};var Vm={};Object.defineProperty(Vm,"__esModule",{value:!0}),Vm.default=void 0;var Wm=hm;Vm.default=function(e){return(0,Wm.withParams)({type:"sameAs",eq:e},(function(t,n){return t===(0,Wm.ref)(e,this,n)}))};var qm={};Object.defineProperty(qm,"__esModule",{value:!0}),qm.default=void 0;var Hm=(0,hm.regex)("url",/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[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]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i);qm.default=Hm;var Jm={};Object.defineProperty(Jm,"__esModule",{value:!0}),Jm.default=void 0;var Km=hm;Jm.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&t.reduce((function(t,n){return t||n.apply(e,r)}),!1)}))};var Ym={};Object.defineProperty(Ym,"__esModule",{value:!0}),Ym.default=void 0;var Um=hm;Ym.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&t.reduce((function(t,n){return t&&n.apply(e,r)}),!0)}))};var Xm={};Object.defineProperty(Xm,"__esModule",{value:!0}),Xm.default=void 0;var Gm=hm;Xm.default=function(e){return(0,Gm.withParams)({type:"not"},(function(t,n){return!(0,Gm.req)(t)||!e.call(this,t,n)}))};var Zm={};Object.defineProperty(Zm,"__esModule",{value:!0}),Zm.default=void 0;var Qm=hm;Zm.default=function(e){return(0,Qm.withParams)({type:"minValue",min:e},(function(t){return!(0,Qm.req)(t)||(!/\s/.test(t)||t instanceof Date)&&+t>=+e}))};var eg={};Object.defineProperty(eg,"__esModule",{value:!0}),eg.default=void 0;var tg=hm;eg.default=function(e){return(0,tg.withParams)({type:"maxValue",max:e},(function(t){return!(0,tg.req)(t)||(!/\s/.test(t)||t instanceof Date)&&+t<=+e}))};var ng={};Object.defineProperty(ng,"__esModule",{value:!0}),ng.default=void 0;var rg=(0,hm.regex)("integer",/(^[0-9]*$)|(^-[0-9]+$)/);ng.default=rg;var ig={};Object.defineProperty(ig,"__esModule",{value:!0}),ig.default=void 0;var og=(0,hm.regex)("decimal",/^[-]?\d*(\.\d+)?$/);
+function(t){if(Number(t.version.split(".")[0])>=2)t.mixin({beforeCreate:n});else{var e=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[n].concat(t.init):n,e.call(this,t)}}function n(){var t=this.$options;t.store?this.$store="function"==typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}(ja=t)}Va.state.get=function(){return this._vm._data.$$state},Va.state.set=function(t){},Ba.prototype.commit=function(t,e,n){var r=this,o=Ya(t,e,n),i=o.type,s=o.payload,a={type:i,payload:s},l=this._mutations[i];l&&(this._withCommit((function(){l.forEach((function(t){t(s)}))})),this._subscribers.slice().forEach((function(t){return t(a,r.state)})))},Ba.prototype.dispatch=function(t,e){var n=this,r=Ya(t,e),o=r.type,i=r.payload,s={type:o,payload:i},a=this._actions[o];if(a){try{this._actionSubscribers.slice().filter((function(t){return t.before})).forEach((function(t){return t.before(s,n.state)}))}catch(jy){}var l=a.length>1?Promise.all(a.map((function(t){return t(i)}))):a[0](i);return new Promise((function(t,e){l.then((function(e){try{n._actionSubscribers.filter((function(t){return t.after})).forEach((function(t){return t.after(s,n.state)}))}catch(jy){}t(e)}),(function(t){try{n._actionSubscribers.filter((function(t){return t.error})).forEach((function(e){return e.error(s,n.state,t)}))}catch(jy){}e(t)}))}))}},Ba.prototype.subscribe=function(t,e){return Wa(t,this._subscribers,e)},Ba.prototype.subscribeAction=function(t,e){return Wa("function"==typeof t?{before:t}:t,this._actionSubscribers,e)},Ba.prototype.watch=function(t,e,n){var r=this;return this._watcherVM.$watch((function(){return t(r.state,r.getters)}),e,n)},Ba.prototype.replaceState=function(t){var e=this;this._withCommit((function(){e._vm._data.$$state=t}))},Ba.prototype.registerModule=function(t,e,n){void 0===n&&(n={}),"string"==typeof t&&(t=[t]),this._modules.register(t,e),Ja(this,this.state,t,this._modules.get(t),n.preserveState),Ha(this,this.state)},Ba.prototype.unregisterModule=function(t){var e=this;"string"==typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit((function(){var n=Ka(e.state,t.slice(0,-1));ja.delete(n,t[t.length-1])})),qa(this)},Ba.prototype.hasModule=function(t){return"string"==typeof t&&(t=[t]),this._modules.isRegistered(t)},Ba.prototype.hotUpdate=function(t){this._modules.update(t),qa(this,!0)},Ba.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(Ba.prototype,Va);var Ga=el((function(t,e){var n={};return tl(e).forEach((function(e){var r=e.key,o=e.val;n[r]=function(){var e=this.$store.state,n=this.$store.getters;if(t){var r=nl(this.$store,"mapState",t);if(!r)return;e=r.context.state,n=r.context.getters}return"function"==typeof o?o.call(this,e,n):e[o]},n[r].vuex=!0})),n})),Xa=el((function(t,e){var n={};return tl(e).forEach((function(e){var r=e.key,o=e.val;n[r]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=this.$store.commit;if(t){var i=nl(this.$store,"mapMutations",t);if(!i)return;r=i.context.commit}return"function"==typeof o?o.apply(this,[r].concat(e)):r.apply(this.$store,[o].concat(e))}})),n})),Za=el((function(t,e){var n={};return tl(e).forEach((function(e){var r=e.key,o=e.val;o=t+o,n[r]=function(){if(!t||nl(this.$store,"mapGetters",t))return this.$store.getters[o]},n[r].vuex=!0})),n})),Qa=el((function(t,e){var n={};return tl(e).forEach((function(e){var r=e.key,o=e.val;n[r]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=this.$store.dispatch;if(t){var i=nl(this.$store,"mapActions",t);if(!i)return;r=i.context.dispatch}return"function"==typeof o?o.apply(this,[r].concat(e)):r.apply(this.$store,[o].concat(e))}})),n}));function tl(t){return function(t){return Array.isArray(t)||Ia(t)}(t)?Array.isArray(t)?t.map((function(t){return{key:t,val:t}})):Object.keys(t).map((function(e){return{key:e,val:t[e]}})):[]}function el(t){return function(e,n){return"string"!=typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function nl(t,e,n){return t._modulesNamespaceMap[n]}function rl(t,e,n){var r=n?t.groupCollapsed:t.group;try{r.call(t,e)}catch(jy){t.log(e)}}function ol(t){try{t.groupEnd()}catch(jy){t.log("—— log end ——")}}function il(){var t=new Date;return" @ "+sl(t.getHours(),2)+":"+sl(t.getMinutes(),2)+":"+sl(t.getSeconds(),2)+"."+sl(t.getMilliseconds(),3)}function sl(t,e){return n="0",r=e-t.toString().length,new Array(r+1).join(n)+t;var n,r}var al={Store:Ba,install:Ua,version:"3.6.2",mapState:Ga,mapMutations:Xa,mapGetters:Za,mapActions:Qa,createNamespacedHelpers:function(t){return{mapState:Ga.bind(null,t),mapGetters:Za.bind(null,t),mapMutations:Xa.bind(null,t),mapActions:Qa.bind(null,t)}},createLogger:function(t){void 0===t&&(t={});var e=t.collapsed;void 0===e&&(e=!0);var n=t.filter;void 0===n&&(n=function(t,e,n){return!0});var r=t.transformer;void 0===r&&(r=function(t){return t});var o=t.mutationTransformer;void 0===o&&(o=function(t){return t});var i=t.actionFilter;void 0===i&&(i=function(t,e){return!0});var s=t.actionTransformer;void 0===s&&(s=function(t){return t});var a=t.logMutations;void 0===a&&(a=!0);var l=t.logActions;void 0===l&&(l=!0);var c=t.logger;return void 0===c&&(c=console),function(t){var u=Aa(t.state);void 0!==c&&(a&&t.subscribe((function(t,i){var s=Aa(i);if(n(t,u,s)){var a=il(),l=o(t),d="mutation "+t.type+a;rl(c,d,e),c.log("%c prev state","color: #9E9E9E; font-weight: bold",r(u)),c.log("%c mutation","color: #03A9F4; font-weight: bold",l),c.log("%c next state","color: #4CAF50; font-weight: bold",r(s)),ol(c)}u=s})),l&&t.subscribeAction((function(t,n){if(i(t,n)){var r=il(),o=s(t),a="action "+t.type+r;rl(c,a,e),c.log("%c action","color: #03A9F4; font-weight: bold",o),ol(c)}})))}}};function ll(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r?r.push(n):t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var r=t.get(e);r&&r.slice().map((function(t){t(n)})),(r=t.get("*"))&&r.slice().map((function(t){t(e,n)}))}}}var cl,ul,dl="function"==typeof Map?new Map:(cl=[],ul=[],{has:function(t){return cl.indexOf(t)>-1},get:function(t){return ul[cl.indexOf(t)]},set:function(t,e){-1===cl.indexOf(t)&&(cl.push(t),ul.push(e))},delete:function(t){var e=cl.indexOf(t);e>-1&&(cl.splice(e,1),ul.splice(e,1))}}),hl=function(t){return new Event(t,{bubbles:!0})};try{new Event("test")}catch(jy){hl=function(t){var e=document.createEvent("Event");return e.initEvent(t,!0,!1),e}}function fl(t){var e=dl.get(t);e&&e.destroy()}function pl(t){var e=dl.get(t);e&&e.update()}var ml=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((ml=function(t){return t}).destroy=function(t){return t},ml.update=function(t){return t}):((ml=function(t,e){return t&&Array.prototype.forEach.call(t.length?t:[t],(function(t){return function(t){if(t&&t.nodeName&&"TEXTAREA"===t.nodeName&&!dl.has(t)){var e,n=null,r=null,o=null,i=function(){t.clientWidth!==r&&c()},s=function(e){window.removeEventListener("resize",i,!1),t.removeEventListener("input",c,!1),t.removeEventListener("keyup",c,!1),t.removeEventListener("autosize:destroy",s,!1),t.removeEventListener("autosize:update",c,!1),Object.keys(e).forEach((function(n){t.style[n]=e[n]})),dl.delete(t)}.bind(t,{height:t.style.height,resize:t.style.resize,overflowY:t.style.overflowY,overflowX:t.style.overflowX,wordWrap:t.style.wordWrap});t.addEventListener("autosize:destroy",s,!1),"onpropertychange"in t&&"oninput"in t&&t.addEventListener("keyup",c,!1),window.addEventListener("resize",i,!1),t.addEventListener("input",c,!1),t.addEventListener("autosize:update",c,!1),t.style.overflowX="hidden",t.style.wordWrap="break-word",dl.set(t,{destroy:s,update:c}),"vertical"===(e=window.getComputedStyle(t,null)).resize?t.style.resize="none":"both"===e.resize&&(t.style.resize="horizontal"),n="content-box"===e.boxSizing?-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)):parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth),isNaN(n)&&(n=0),c()}function a(e){var n=t.style.width;t.style.width="0px",t.style.width=n,t.style.overflowY=e}function l(){if(0!==t.scrollHeight){var e=function(t){for(var e=[];t&&t.parentNode&&t.parentNode instanceof Element;)t.parentNode.scrollTop&&e.push({node:t.parentNode,scrollTop:t.parentNode.scrollTop}),t=t.parentNode;return e}(t),o=document.documentElement&&document.documentElement.scrollTop;t.style.height="",t.style.height=t.scrollHeight+n+"px",r=t.clientWidth,e.forEach((function(t){t.node.scrollTop=t.scrollTop})),o&&(document.documentElement.scrollTop=o)}}function c(){l();var e=Math.round(parseFloat(t.style.height)),n=window.getComputedStyle(t,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):t.offsetHeight;if(r=e?t:""+Array(e+1-r.length).join(n)+t},y={s:v,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),o=n%60;return(e<=0?"+":"-")+v(r,2,"0")+":"+v(o,2,"0")},m:function t(e,n){if(e.date()1)return t(s[0])}else{var a=e.name;w[a]=e,o=a}return!r&&o&&(b=o),o||!r&&b},k=function(t,e){if(x(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new O(n)},_=y;_.l=S,_.i=x,_.w=function(t,e){return k(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var O=function(){function g(t){this.$L=S(t.locale,null,!0),this.parse(t)}var v=g.prototype;return v.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(_.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(p);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},v.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},v.$utils=function(){return _},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(t,e){var n=k(t);return this.startOf(e)<=n&&n<=this.endOf(e)},v.isAfter=function(t,e){return k(t)68?1900:2e3)},a=function(t){return function(e){this[t]=+e}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),n=60*e[1]+(+e[2]||0);return 0===n?0:"+"===e[0]?-n:n}(t)}],c=function(t){var e=i[t];return e&&(e.indexOf?e:e.s.concat(e.f))},u=function(t,e){var n,r=i.meridiem;if(r){for(var o=1;o<=24;o+=1)if(t.indexOf(r(o,0,e))>-1){n=o>12;break}}else n=t===(e?"pm":"PM");return n},d={A:[o,function(t){this.afternoon=u(t,!1)}],a:[o,function(t){this.afternoon=u(t,!0)}],S:[/\d/,function(t){this.milliseconds=100*+t}],SS:[n,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[o,function(t){var e=i.ordinal,n=t.match(/\d+/);if(this.day=n[0],e)for(var r=1;r<=31;r+=1)e(r).replace(/\[|\]/g,"")===t&&(this.day=r)}],M:[r,a("month")],MM:[n,a("month")],MMM:[o,function(t){var e=c("months"),n=(c("monthsShort")||e.map((function(t){return t.slice(0,3)}))).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[o,function(t){var e=c("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(t){this.year=s(t)}],YYYY:[/\d{4}/,a("year")],Z:l,ZZ:l};function h(n){var r,o;r=n,o=i&&i.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,n,r){var i=r&&r.toUpperCase();return n||o[r]||t[r]||o[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))).match(e),a=s.length,l=0;l-1)return new Date(("X"===e?1e3:1)*t);var r=h(e)(t),o=r.year,i=r.month,s=r.day,a=r.hours,l=r.minutes,c=r.seconds,u=r.milliseconds,d=r.zone,f=new Date,p=s||(o||i?1:f.getDate()),m=o||f.getFullYear(),g=0;o&&!i||(g=i>0?i-1:f.getMonth());var v=a||0,y=l||0,b=c||0,w=u||0;return d?new Date(Date.UTC(m,g,p,v,y,b,w+60*d.offset*1e3)):n?new Date(Date.UTC(m,g,p,v,y,b,w)):new Date(m,g,p,v,y,b,w)}catch(x){return new Date("")}}(e,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&e!=this.format(a)&&(this.$d=new Date("")),i={}}else if(a instanceof Array)for(var f=a.length,p=1;p<=f;p+=1){s[1]=a[p-1];var m=n.apply(this,s);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}p===f&&(this.$d=new Date(""))}else o.call(this,t)}}}();function Sl(t){return(Sl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var kl={selector:"vue-portal-target-".concat(((t=21)=>{let e="",n=t;for(;n--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e})())},_l=function(t){return kl.selector=t},Ol="undefined"!=typeof window&&void 0!==("undefined"==typeof document?"undefined":Sl(document)),Cl=Bn.extend({abstract:!0,name:"PortalOutlet",props:["nodes","tag"],data:function(t){return{updatedNodes:t.nodes}},render:function(t){var e=this.updatedNodes&&this.updatedNodes();return e?1!==e.length||e[0].text?t(this.tag||"DIV",e):e:t()},destroyed:function(){var t=this.$el;t&&t.parentNode.removeChild(t)}}),Ml=Bn.extend({name:"VueSimplePortal",props:{disabled:{type:Boolean},prepend:{type:Boolean},selector:{type:String,default:function(){return"#".concat(kl.selector)}},tag:{type:String,default:"DIV"}},render:function(t){if(this.disabled){var e=this.$scopedSlots&&this.$scopedSlots.default();return e?e.length<2&&!e[0].text?e:t(this.tag,e):t()}return t()},created:function(){this.getTargetEl()||this.insertTargetEl()},updated:function(){var t=this;this.$nextTick((function(){t.disabled||t.slotFn===t.$scopedSlots.default||(t.container.updatedNodes=t.$scopedSlots.default),t.slotFn=t.$scopedSlots.default}))},beforeDestroy:function(){this.unmount()},watch:{disabled:{immediate:!0,handler:function(t){t?this.unmount():this.$nextTick(this.mount)}}},methods:{getTargetEl:function(){if(Ol)return document.querySelector(this.selector)},insertTargetEl:function(){if(Ol){var t=document.querySelector("body"),e=document.createElement(this.tag);e.id=this.selector.substring(1),t.appendChild(e)}},mount:function(){if(Ol){var t=this.getTargetEl(),e=document.createElement("DIV");this.prepend&&t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e),this.container=new Cl({el:e,parent:this,propsData:{tag:this.tag,nodes:this.$scopedSlots.default}})}},unmount:function(){this.container&&(this.container.$destroy(),delete this.container)}}});function Dl(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.component(e.name||"portal",Ml),e.defaultSelector&&_l(e.defaultSelector)}"undefined"!=typeof window&&window.Vue&&window.Vue===Bn&&Bn.use(Dl);var Tl={},$l={};function El(t){return null==t}function Nl(t){return null!=t}function Al(t,e){return e.tag===t.tag&&e.key===t.key}function Pl(t){var e=t.tag;t.vm=new e({data:t.args})}function Il(t,e,n){var r,o,i={};for(r=e;r<=n;++r)Nl(o=t[r].key)&&(i[o]=r);return i}function Rl(t,e,n){for(;e<=n;++e)Pl(t[e])}function zl(t,e,n){for(;e<=n;++e){var r=t[e];Nl(r)&&(r.vm.$destroy(),r.vm=null)}}function jl(t,e){t!==e&&(e.vm=t.vm,function(t){for(var e=Object.keys(t.args),n=0;na?Rl(e,s,u):s>u&&zl(t,i,a)}(t,e):Nl(e)?Rl(e,0,e.length-1):Nl(t)&&zl(t,0,t.length-1)};var Fl={};function Ll(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Bl(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n