From 83f265a672c4305a51989bff690e6fa146198abd Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 25 Sep 2024 12:01:43 +0200 Subject: [PATCH 001/362] Use Form Controls in Model Views --- panel/src/components/Views/Files/FileView.vue | 7 ++++++- panel/src/components/Views/ModelView.vue | 3 +++ panel/src/components/Views/Pages/PageView.vue | 7 ++++++- panel/src/components/Views/Pages/SiteView.vue | 7 ++++++- panel/src/components/Views/Users/UserView.vue | 7 ++++++- 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/panel/src/components/Views/Files/FileView.vue b/panel/src/components/Views/Files/FileView.vue index daff32b066..bfe661d060 100644 --- a/panel/src/components/Views/Files/FileView.vue +++ b/panel/src/components/Views/Files/FileView.vue @@ -19,7 +19,12 @@ diff --git a/panel/src/components/Views/ModelView.vue b/panel/src/components/Views/ModelView.vue index 31a75dcecb..268000b969 100644 --- a/panel/src/components/Views/ModelView.vue +++ b/panel/src/components/Views/ModelView.vue @@ -44,6 +44,9 @@ export default { isLocked() { return this.$panel.content.isLocked; }, + isUnsaved() { + return this.$panel.content.hasUnpublishedChanges; + }, protectedFields() { return []; } diff --git a/panel/src/components/Views/Pages/PageView.vue b/panel/src/components/Views/Pages/PageView.vue index 77616ff8f9..c9f5595cf6 100644 --- a/panel/src/components/Views/Pages/PageView.vue +++ b/panel/src/components/Views/Pages/PageView.vue @@ -19,7 +19,12 @@ diff --git a/panel/src/components/Views/Pages/SiteView.vue b/panel/src/components/Views/Pages/SiteView.vue index b45919dbdb..2660ea552b 100644 --- a/panel/src/components/Views/Pages/SiteView.vue +++ b/panel/src/components/Views/Pages/SiteView.vue @@ -15,7 +15,12 @@ diff --git a/panel/src/components/Views/Users/UserView.vue b/panel/src/components/Views/Users/UserView.vue index e226787f9d..bb5694c7dc 100644 --- a/panel/src/components/Views/Users/UserView.vue +++ b/panel/src/components/Views/Users/UserView.vue @@ -27,7 +27,12 @@ From 01f7b698439dd69ddabc1f5d73665477e5f0c23b Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 25 Sep 2024 12:01:50 +0200 Subject: [PATCH 002/362] Remove FormButton component --- panel/src/components/Forms/FormButtons.vue | 301 --------------------- panel/src/components/Forms/index.js | 2 - 2 files changed, 303 deletions(-) delete mode 100644 panel/src/components/Forms/FormButtons.vue diff --git a/panel/src/components/Forms/FormButtons.vue b/panel/src/components/Forms/FormButtons.vue deleted file mode 100644 index efc3e7b440..0000000000 --- a/panel/src/components/Forms/FormButtons.vue +++ /dev/null @@ -1,301 +0,0 @@ - - - diff --git a/panel/src/components/Forms/index.js b/panel/src/components/Forms/index.js index 4369e3d4c1..f83d5e8965 100644 --- a/panel/src/components/Forms/index.js +++ b/panel/src/components/Forms/index.js @@ -3,7 +3,6 @@ import Counter from "./Counter.vue"; import Field from "./Field.vue"; import Fieldset from "./Fieldset.vue"; import Form from "./Form.vue"; -import FormButtons from "./FormButtons.vue"; import FormControls from "./FormControls.vue"; import Input from "./Input.vue"; @@ -21,7 +20,6 @@ export default { app.component("k-field", Field); app.component("k-fieldset", Fieldset); app.component("k-form", Form); - app.component("k-form-buttons", FormButtons); app.component("k-form-controls", FormControls); app.component("k-input", Input); From a524d800396f3736316787f3213127950f4fafc0 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 25 Sep 2024 12:26:09 +0200 Subject: [PATCH 003/362] Refactor changes dialog component for new backend implementation --- i18n/translations/en.json | 5 +- .../src/components/Dialogs/ChangesDialog.vue | 63 +++++++++---------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/i18n/translations/en.json b/i18n/translations/en.json index 773bf21520..106c002ae6 100644 --- a/i18n/translations/en.json +++ b/i18n/translations/en.json @@ -468,7 +468,10 @@ "loading": "Loading", "lock.unsaved": "Unsaved changes", - "lock.unsaved.empty": "There are no more unsaved changes", + "lock.unsaved.empty": "There are no unsaved changes", + "lock.unsaved.files": "Unsaved files", + "lock.unsaved.pages": "Unsaved pages", + "lock.unsaved.users": "Unsaved accounts", "lock.isLocked": "Unsaved changes by {email}", "lock.unlock": "Unlock", "lock.unlock.submit": "Unlock and overwrite unsaved changes by {email}", diff --git a/panel/src/components/Dialogs/ChangesDialog.vue b/panel/src/components/Dialogs/ChangesDialog.vue index 1ef85b0ebb..9f3bae5adf 100644 --- a/panel/src/components/Dialogs/ChangesDialog.vue +++ b/panel/src/components/Dialogs/ChangesDialog.vue @@ -1,13 +1,24 @@ @@ -24,11 +35,13 @@ export default { cancelButton: { default: false }, - changes: { - type: Array + files: { + type: Array, + default: () => [] }, - loading: { - type: Boolean + pages: { + type: Array, + default: () => [] }, // eslint-disable-next-line vue/require-prop-types size: { @@ -37,35 +50,19 @@ export default { // eslint-disable-next-line vue/require-prop-types submitButton: { default: false - } - }, - computed: { - ids() { - return Object.keys(this.store).filter( - (id) => this.$helper.object.length(this.store[id]?.changes) > 0 - ); }, - store() { - return this.$store.state.content.models; - } - }, - watch: { - ids: { - handler(ids) { - this.$panel.dialog.refresh({ - method: "POST", - body: { - ids: ids - } - }); - }, - immediate: true + users: { + type: Array, + default: () => [] } } }; diff --git a/panel/src/components/Navigation/Button.vue b/panel/src/components/Navigation/Button.vue index 9d59cc4770..67751f81a7 100644 --- a/panel/src/components/Navigation/Button.vue +++ b/panel/src/components/Navigation/Button.vue @@ -381,11 +381,13 @@ export default { position: absolute; top: 0; inset-inline-end: 0; - transform: translate(50%, -20%); + transform: translate(40%, -20%); + min-width: 1em; + min-height: 1em; font-variant-numeric: tabular-nums; line-height: 1.5; padding: 0 var(--spacing-1); - border-radius: 1rem; + border-radius: 50%; text-align: center; font-size: 0.6rem; box-shadow: var(--shadow-md); diff --git a/panel/src/components/View/Buttons/LanguagesDropdown.vue b/panel/src/components/View/Buttons/LanguagesDropdown.vue index c6b65405d2..dbd0899464 100644 --- a/panel/src/components/View/Buttons/LanguagesDropdown.vue +++ b/panel/src/components/View/Buttons/LanguagesDropdown.vue @@ -15,28 +15,21 @@ export default { mixins: [ButtonProps], props: { /** - * Number of translations with unsaved changes - * other than the currently viewed one + * If translations other than the currently-viewed one + * have any unsaved changes */ - changes: Number, + hasChanges: Boolean, options: String }, computed: { changesBadge() { - let changes = this.changes ?? 0; - - if (this.$panel.content.hasChanges) { - changes++; - } - - if (changes === 0) { - return; + if (this.hasChanges || this.$panel.content.hasChanges) { + return { + theme: "notice" + }; } - return { - theme: "notice", - text: changes - }; + return; } } }; diff --git a/src/Panel/Ui/Buttons/LanguagesDropdown.php b/src/Panel/Ui/Buttons/LanguagesDropdown.php index bca236d24a..606ceb3015 100644 --- a/src/Panel/Ui/Buttons/LanguagesDropdown.php +++ b/src/Panel/Ui/Buttons/LanguagesDropdown.php @@ -42,23 +42,21 @@ class: 'k-languages-dropdown', } /** - * Returns the number of translations with unsaved changes - * other than the current one (as the current one will be considered - * dynamically in `` based on its state) + * Returns if any translation other than the current one has unsaved changes + * (the current will be considered dynamically in `` + * based on its state) */ - public function changes(): int + public function hasChanges(): bool { - $count = 0; - foreach (Languages::ensure() as $language) { if ($this->kirby->language()?->code() !== $language->code()) { if ($this->model->version(VersionId::changes())->exists($language) === true) { - $count++; + return true; } } } - return $count; + return false; } public function option(Language $language): array @@ -102,7 +100,7 @@ public function props(): array { return [ ...parent::props(), - 'changes' => $this->changes() + 'hasChanges' => $this->hasChanges() ]; } diff --git a/tests/Panel/Ui/Buttons/LanguagesDropdownTest.php b/tests/Panel/Ui/Buttons/LanguagesDropdownTest.php index 043dd3e0db..1e86ad8cf8 100644 --- a/tests/Panel/Ui/Buttons/LanguagesDropdownTest.php +++ b/tests/Panel/Ui/Buttons/LanguagesDropdownTest.php @@ -13,9 +13,9 @@ class LanguagesDropdownTest extends AreaTestCase { /** - * @covers ::changes + * @covers ::hasChanges */ - public function testChanges() + public function testHasChanges() { $this->install(); $this->installLanguages(); @@ -24,15 +24,15 @@ public function testChanges() $button = new LanguagesDropdown($page); // no changes - $this->assertSame(0, $button->changes()); - - // changes in other translations - $page->version('changes')->create([], 'de'); - $this->assertSame(1, $button->changes()); + $this->assertFalse($button->hasChanges()); // changes in current translation (not considered) $page->version('changes')->create([], 'en'); - $this->assertSame(1, $button->changes()); + $this->assertFalse($button->hasChanges()); + + // changes in other translations + $page->version('changes')->create([], 'de'); + $this->assertTrue($button->hasChanges()); } /** @@ -97,7 +97,7 @@ public function testProps() $page = new Page(['slug' => 'test']); $button = new LanguagesDropdown($page); $props = $button->props(); - $this->assertSame(0, $props['changes']); + $this->assertFalse($props['hasChanges']); } /** From 2aedbac5a50adce3f87dc42d7b189d67c6536fc1 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Tue, 22 Oct 2024 14:24:17 +0200 Subject: [PATCH 126/362] Fix cs --- panel/src/components/View/Buttons/LanguagesDropdown.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel/src/components/View/Buttons/LanguagesDropdown.vue b/panel/src/components/View/Buttons/LanguagesDropdown.vue index dbd0899464..6ce725c9e4 100644 --- a/panel/src/components/View/Buttons/LanguagesDropdown.vue +++ b/panel/src/components/View/Buttons/LanguagesDropdown.vue @@ -29,7 +29,7 @@ export default { }; } - return; + return null; } } }; From b0b93b4096af9b0a0b00d2aed2b9798197a20d78 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Tue, 22 Oct 2024 13:12:52 +0200 Subject: [PATCH 127/362] Lab: fix view buttons examples --- .../lab/components/buttons/6_view-button/index.vue | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/panel/lab/components/buttons/6_view-button/index.vue b/panel/lab/components/buttons/6_view-button/index.vue index c82bdf6a9a..bb69720db2 100644 --- a/panel/lab/components/buttons/6_view-button/index.vue +++ b/panel/lab/components/buttons/6_view-button/index.vue @@ -17,25 +17,18 @@ :options="[{ text: 'Option A' }, { text: 'Option B' }]" /> - - - - + - - + From 2eeea10b553f5f51a481e8f1132c7d436dfa5323 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 22 Oct 2024 10:09:45 +0200 Subject: [PATCH 128/362] Add the plugin as required argument for the license object --- src/Plugin/License.php | 15 +++++++++++---- src/Plugin/Plugin.php | 8 ++++++-- tests/Plugin/LicenseTest.php | 29 ++++++++++++++++++++++++----- 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/src/Plugin/License.php b/src/Plugin/License.php index 09a6098286..11ff37c258 100644 --- a/src/Plugin/License.php +++ b/src/Plugin/License.php @@ -2,6 +2,7 @@ namespace Kirby\Plugin; +use Closure; use Stringable; /** @@ -18,6 +19,7 @@ class License implements Stringable protected LicenseStatus $status; public function __construct( + protected Plugin $plugin, protected string $name, protected string|null $link = null, LicenseStatus|null $status = null @@ -36,14 +38,17 @@ public function __toString(): string /** * Creates a license instance from a given value */ - public static function from(License|array|string|null $license): static - { - if ($license instanceof License) { - return $license; + public static function from( + Plugin $plugin, + Closure|array|string|null $license + ): static { + if ($license instanceof Closure) { + return $license($plugin); } if (is_array($license)) { return new static( + plugin: $plugin, name: $license['name'] ?? '', link: $license['link'] ?? null, status: LicenseStatus::from($license['status'] ?? 'active') @@ -52,12 +57,14 @@ public static function from(License|array|string|null $license): static if ($license === null || $license === '-') { return new static( + plugin: $plugin, name: '-', status: LicenseStatus::from('unknown') ); } return new static( + plugin: $plugin, name: $license, status: LicenseStatus::from('active') ); diff --git a/src/Plugin/Plugin.php b/src/Plugin/Plugin.php index f6fe211059..6eb2261548 100644 --- a/src/Plugin/Plugin.php +++ b/src/Plugin/Plugin.php @@ -2,6 +2,7 @@ namespace Kirby\Plugin; +use Closure; use Composer\InstalledVersions; use Exception; use Kirby\Cms\App; @@ -41,7 +42,7 @@ public function __construct( protected string $name, protected array $extends = [], protected array $info = [], - License|string|array|null $license = null, + Closure|string|array|null $license = null, protected string|null $root = null, protected string|null $version = null, ) { @@ -78,7 +79,10 @@ public function __construct( $this->info = [...$info, ...$this->info]; // set the license - $this->license = License::from($license ?? $this->info['license'] ?? '-'); + $this->license = License::from( + plugin: $this, + license: $license ?? $this->info['license'] ?? '-' + ); } /** diff --git a/tests/Plugin/LicenseTest.php b/tests/Plugin/LicenseTest.php index b074b0bf3e..9ff84d5f95 100644 --- a/tests/Plugin/LicenseTest.php +++ b/tests/Plugin/LicenseTest.php @@ -9,12 +9,20 @@ */ class LicenseTest extends TestCase { + protected function plugin(): Plugin + { + return new Plugin( + name: 'test/test' + ); + } + /** * @covers ::__toString */ public function test__toString(): void { $license = new License( + plugin: $this->plugin(), name: 'Custom license' ); @@ -26,7 +34,7 @@ public function test__toString(): void */ public function testFromArray(): void { - $license = License::from([ + $license = License::from($this->plugin(), [ 'name' => 'Custom license', 'link' => 'https://getkirby.com', 'status' => 'missing' @@ -39,9 +47,16 @@ public function testFromArray(): void /** * @covers ::from */ - public function testFromInstance(): void + public function testFromClosure(): void { - $license = License::from(License::from('Custom license')); + $license = License::from($this->plugin(), function ($plugin) { + return new License( + plugin: $plugin, + name: 'Custom license', + status: LicenseStatus::from('active') + ); + }); + $this->assertSame('Custom license', $license->name()); $this->assertSame('active', $license->status()->value()); } @@ -51,7 +66,7 @@ public function testFromInstance(): void */ public function testFromString(): void { - $license = License::from('Custom license'); + $license = License::from($this->plugin(), 'Custom license'); $this->assertSame('Custom license', $license->name()); $this->assertSame('active', $license->status()->value()); } @@ -61,7 +76,7 @@ public function testFromString(): void */ public function testFromNull(): void { - $license = License::from(null); + $license = License::from($this->plugin(), null); $this->assertSame('-', $license->name()); $this->assertSame('unknown', $license->status()->value()); } @@ -72,6 +87,7 @@ public function testFromNull(): void public function testLink(): void { $license = new License( + plugin: $this->plugin(), name: 'Custom license', link: 'https://getkirby.com' ); @@ -85,6 +101,7 @@ public function testLink(): void public function testName(): void { $license = new License( + plugin: $this->plugin(), name: 'Custom license' ); @@ -97,6 +114,7 @@ public function testName(): void public function testStatus(): void { $license = new License( + plugin: $this->plugin(), name: 'Custom license', status: LicenseStatus::from('missing') ); @@ -111,6 +129,7 @@ public function testStatus(): void public function testToArray(): void { $license = new License( + plugin: $this->plugin(), name: 'Custom license', ); From 4a8094d71b8fc6ce7d5dfd29d934b343c9f22df6 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 22 Oct 2024 13:44:44 +0200 Subject: [PATCH 129/362] Fix type hinting in AppPlugins trait --- src/Cms/AppPlugins.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cms/AppPlugins.php b/src/Cms/AppPlugins.php index cdf4379f9a..d5b5f016dc 100644 --- a/src/Cms/AppPlugins.php +++ b/src/Cms/AppPlugins.php @@ -870,7 +870,7 @@ public static function plugin( array $info = [], string|null $root = null, string|null $version = null, - License|string|array|null $license = null, + Closure|string|array|null $license = null, ): Plugin|null { if ($extends === null) { return static::$plugins[$name] ?? null; From 63e4b20e60f2e34dbb727fe6fdc11b1a30e10899 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Tue, 22 Oct 2024 18:53:17 +0200 Subject: [PATCH 130/362] Clean up `ModelWithContent::convertTo()` --- src/Cms/ModelWithContent.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Cms/ModelWithContent.php b/src/Cms/ModelWithContent.php index ea2838a9b7..142dff41fd 100644 --- a/src/Cms/ModelWithContent.php +++ b/src/Cms/ModelWithContent.php @@ -189,8 +189,8 @@ protected function convertTo(string $blueprint): static // first close object with new blueprint as template $new = $this->clone(['template' => $blueprint]); - // temporary compatibility change (TODO: also convert changes) - $identifier = VersionId::latest(); + // get version (only handling latest version) + $version = $new->version(VersionId::latest()); // for multilang, we go through all translations and // covnert the content for each of them, remove the content file @@ -203,7 +203,7 @@ protected function convertTo(string $blueprint): static $content = $this->content($code)->convertTo($blueprint); // delete the old text file - $this->version($identifier)->delete($code); + $version->delete($code); // save to re-create the translation content file // with the converted/updated content @@ -227,7 +227,7 @@ protected function convertTo(string $blueprint): static $content = $this->content()->convertTo($blueprint); // delete the old text file - $this->version($identifier)->delete('default'); + $version->delete('default'); return $new->save($content); } From 913928a93c5b3dc909772a97cd44306a7c660ee6 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 23 Oct 2024 11:08:53 +0200 Subject: [PATCH 131/362] Fix type hinting --- src/Cms/UserRules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cms/UserRules.php b/src/Cms/UserRules.php index ef74772a6c..86f0fc0484 100644 --- a/src/Cms/UserRules.php +++ b/src/Cms/UserRules.php @@ -193,7 +193,7 @@ public static function create(User $user, array $props = []): void // allow to create the first user if ($user->kirby()->users()->count() === 0) { - return true; + return; } // check user permissions (if not on install) From 388277bf0ce98189798cdfd46117c78755617cf0 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 23 Oct 2024 11:08:23 +0200 Subject: [PATCH 132/362] Create VersionRules class and use it in all modification actions --- src/Content/Version.php | 42 ++++++++++++++------ src/Content/VersionRules.php | 74 ++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 12 deletions(-) create mode 100644 src/Content/VersionRules.php diff --git a/src/Content/Version.php b/src/Content/Version.php index facdf22038..3f24d909a3 100644 --- a/src/Content/Version.php +++ b/src/Content/Version.php @@ -7,7 +7,6 @@ use Kirby\Cms\Languages; use Kirby\Cms\ModelWithContent; use Kirby\Cms\Page; -use Kirby\Exception\LogicException; use Kirby\Exception\NotFoundException; /** @@ -97,6 +96,9 @@ public function create( ): void { $language = Language::ensure($language); + // check if creating is allowed + VersionRules::create($this, $fields, $language); + // track the changes if ($this->id->is(VersionId::changes()) === true) { (new Changes())->track($this->model); @@ -114,7 +116,12 @@ public function create( */ public function delete(Language|string $language = 'default'): void { - $this->model->storage()->delete($this->id, Language::ensure($language)); + $language = Language::ensure($language); + + // check if deleting is allowed + VersionRules::delete($this, $language); + + $this->model->storage()->delete($this->id, $language); // untrack the changes if the version does no longer exist // in any of the available languages @@ -231,12 +238,18 @@ public function move( Language|string|null $toLanguage = null, Storage|null $toStorage = null ): void { + $fromLanguage = Language::ensure($fromLanguage); + $toLanguage = Language::ensure($toLanguage ?? $fromLanguage); + + // check if moving is allowed + VersionRules::move($this, $fromLanguage, $toVersionId ?? $this->id, $toLanguage); + $this->ensure($fromLanguage); $this->model->storage()->move( fromVersionId: $this->id, - fromLanguage: Language::ensure($fromLanguage), + fromLanguage: $fromLanguage, toVersionId: $toVersionId, - toLanguage: $toLanguage ? Language::ensure($toLanguage) : null, + toLanguage: $toLanguage, toStorage: $toStorage ); } @@ -319,17 +332,14 @@ protected function prepareFieldsForContent( */ public function publish(Language|string $language = 'default'): void { - if ($this->id->is(VersionId::latest()) === true) { - throw new LogicException( - message: 'This version is already published' - ); - } - $language = Language::ensure($language); // the version needs to exist $this->ensure($language); + // check if publishing is allowed + VersionRules::publish($this, $language); + // update the latest version $this->model->update( input: $this->read($language), @@ -370,9 +380,13 @@ public function replace( array $fields, Language|string $language = 'default' ): void { + $language = Language::ensure($language); + + // the version needs to exist $this->ensure($language); - $language = Language::ensure($language); + // check if replacing is allowed + VersionRules::replace($this, $fields, $language); $this->model->storage()->update( versionId: $this->id, @@ -424,9 +438,13 @@ public function update( array $fields, Language|string $language = 'default' ): void { + $language = Language::ensure($language); + + // the version needs to exist $this->ensure($language); - $language = Language::ensure($language); + // check if updating is allowed + VersionRules::update($this, $fields, $language); // merge the previous state with the new state to always // update to a complete version diff --git a/src/Content/VersionRules.php b/src/Content/VersionRules.php new file mode 100644 index 0000000000..092eb495b4 --- /dev/null +++ b/src/Content/VersionRules.php @@ -0,0 +1,74 @@ + + * @link https://getkirby.com + * @copyright Bastian Allgeier + * @license https://getkirby.com/license + */ +class VersionRules +{ + public static function create( + Version $version, + array $fields, + Language $language + ): void { + + } + + public static function delete( + Version $version, + Language $language + ): void { + + } + + public static function move( + Version $version, + Language $fromLanguage, + VersionId $toVersionId, + Language $toLanguage + ): void { + + } + + public static function publish( + Version $version, + Language $language + ): void { + if ($version->id()->is(VersionId::latest()) === true) { + throw new LogicException( + message: 'This version is already published' + ); + } + + } + + public static function replace( + Version $version, + array $fields, + Language $language + ): void { + + } + + public static function update( + Version $version, + array $fields, + Language $language + ): void { + + } +} From 9e46365cc632e60457854616da0949e010d4e61b Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 23 Oct 2024 11:11:44 +0200 Subject: [PATCH 133/362] New Version::isLatest method --- src/Content/Version.php | 8 ++++++++ src/Content/VersionRules.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Content/Version.php b/src/Content/Version.php index 3f24d909a3..2f23029b85 100644 --- a/src/Content/Version.php +++ b/src/Content/Version.php @@ -202,6 +202,14 @@ public function id(): VersionId return $this->id; } + /** + * Checks if the version is the latest version + */ + public function isLatest(): bool + { + return $this->id->is(VersionId::latest()); + } + /** * Returns the parent model */ diff --git a/src/Content/VersionRules.php b/src/Content/VersionRules.php index 092eb495b4..69cdfa110f 100644 --- a/src/Content/VersionRules.php +++ b/src/Content/VersionRules.php @@ -48,7 +48,7 @@ public static function publish( Version $version, Language $language ): void { - if ($version->id()->is(VersionId::latest()) === true) { + if ($version->isLatest() === true) { throw new LogicException( message: 'This version is already published' ); From 3eda02498f2ff270de143537efeb692cbe75d687 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 23 Oct 2024 15:07:24 +0200 Subject: [PATCH 134/362] New Version::lock and Version::isLocked methods --- src/Content/Version.php | 42 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/src/Content/Version.php b/src/Content/Version.php index 2f23029b85..df7bbf8c24 100644 --- a/src/Content/Version.php +++ b/src/Content/Version.php @@ -210,6 +210,33 @@ public function isLatest(): bool return $this->id->is(VersionId::latest()); } + /** + * Checks if the version is locked for the current user + */ + public function isLocked(Language|string $language = 'default'): bool + { + // check if the version is locked in any language + if ($language === '*') { + foreach (Languages::ensure() as $language) { + if ($this->isLocked($language) === true) { + return true; + } + } + + return false; + } + + return $this->lock($language)->isLocked(); + } + + /** + * Returns the lock object for the version + */ + public function lock(Language|string $language = 'default'): Lock + { + return Lock::for($this, Language::ensure($language)); + } + /** * Returns the parent model */ @@ -246,17 +273,26 @@ public function move( Language|string|null $toLanguage = null, Storage|null $toStorage = null ): void { + $fromVersion = $this; $fromLanguage = Language::ensure($fromLanguage); $toLanguage = Language::ensure($toLanguage ?? $fromLanguage); + $toVersion = $this->model->version($toVersionId ?? $this->id); // check if moving is allowed - VersionRules::move($this, $fromLanguage, $toVersionId ?? $this->id, $toLanguage); + VersionRules::move( + fromVersion: $fromVersion, + fromLanguage: $fromLanguage, + toVersion: $toVersion, + toLanguage: $toLanguage + ); + // make sure that the version exists $this->ensure($fromLanguage); + $this->model->storage()->move( - fromVersionId: $this->id, + fromVersionId: $fromVersion->id(), fromLanguage: $fromLanguage, - toVersionId: $toVersionId, + toVersionId: $toVersion->id(), toLanguage: $toLanguage, toStorage: $toStorage ); From 67fb29fb14f2d0f156b7f041bfcf4e50bea9ae8f Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 23 Oct 2024 15:07:41 +0200 Subject: [PATCH 135/362] Refactor for new Version lock methods --- src/Cms/ModelWithContent.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Cms/ModelWithContent.php b/src/Cms/ModelWithContent.php index 142dff41fd..102c5f9399 100644 --- a/src/Cms/ModelWithContent.php +++ b/src/Cms/ModelWithContent.php @@ -335,11 +335,7 @@ public function kirby(): App */ public function lock(): Lock { - // get the changes for the current model - $version = $this->version(VersionId::changes()); - - // return lock object for the changes - return Lock::for($version); + return $this->version(VersionId::changes())->lock(); } /** From c2c595800e168be6e6ba5ee1020ab4efe848ed2e Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 23 Oct 2024 15:08:06 +0200 Subject: [PATCH 136/362] Use Version::save to avoid conflicts with existing eversions --- src/Content/Translation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Content/Translation.php b/src/Content/Translation.php index fd392b73fb..ea024743b6 100644 --- a/src/Content/Translation.php +++ b/src/Content/Translation.php @@ -92,7 +92,7 @@ public static function create( $fields['slug'] = $slug; } - $version->create($fields, $language); + $version->save($fields, $language); return new static( model: $model, From 8713acede892cdd1bfd5d10d475fb11ecd4e1fce Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 23 Oct 2024 15:09:18 +0200 Subject: [PATCH 137/362] First set of version rule logic --- src/Content/VersionRules.php | 49 ++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/src/Content/VersionRules.php b/src/Content/VersionRules.php index 69cdfa110f..7f72e9b260 100644 --- a/src/Content/VersionRules.php +++ b/src/Content/VersionRules.php @@ -25,23 +25,49 @@ public static function create( array $fields, Language $language ): void { + if ($version->exists($language) === true) { + throw new LogicException( + message: 'The Version already exists' + ); + } + if ($version->isLatest() === false) { + if ($version->model()->version(VersionId::latest())->exists($language) === false) { + throw new LogicException( + message: 'A matching latest version for the changes does not exist' + ); + } + } } public static function delete( Version $version, Language $language ): void { - + if ($version->isLocked('*') === true) { + throw new LogicException( + message: 'The Version is locked and cannot be deleted' + ); + } } public static function move( - Version $version, + Version $fromVersion, Language $fromLanguage, - VersionId $toVersionId, + Version $toVersion, Language $toLanguage ): void { + if ($fromVersion->isLocked('*') === true) { + throw new LogicException( + message: 'The source version is locked and cannot be moved' + ); + } + if ($toVersion->isLocked('*') === true) { + throw new LogicException( + message: 'The destination version is locked' + ); + } } public static function publish( @@ -54,6 +80,11 @@ public static function publish( ); } + if ($version->isLocked('*') === true) { + throw new LogicException( + message: 'The version is locked and cannot be published' + ); + } } public static function replace( @@ -61,7 +92,11 @@ public static function replace( array $fields, Language $language ): void { - + if ($version->isLocked('*') === true) { + throw new LogicException( + message: 'The version is locked and cannot be replaced' + ); + } } public static function update( @@ -69,6 +104,10 @@ public static function update( array $fields, Language $language ): void { - + if ($version->isLocked('*') === true) { + throw new LogicException( + message: 'The version is locked and cannot be updated' + ); + } } } From 371fd0639165bba2f5ec4adcfc0c64478396646d Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 23 Oct 2024 15:09:29 +0200 Subject: [PATCH 138/362] Improve unit tests after version rules kick in --- tests/Cms/Models/ModelWithContentTest.php | 13 +++-- tests/Content/ChangesTest.php | 18 ++++--- tests/Content/LockTest.php | 66 ++++++++++++----------- tests/Content/VersionTest.php | 26 ++++----- 4 files changed, 70 insertions(+), 53 deletions(-) diff --git a/tests/Cms/Models/ModelWithContentTest.php b/tests/Cms/Models/ModelWithContentTest.php index 30ff27c974..4c9c385213 100644 --- a/tests/Cms/Models/ModelWithContentTest.php +++ b/tests/Cms/Models/ModelWithContentTest.php @@ -238,20 +238,25 @@ public function testContentWithChanges() $page = $app->page('foo'); - $this->assertSame(null, $page->content()->title()->value()); + // create the latest version + $page->version('latest')->save([ + 'title' => 'Original Title' + ]); + + $this->assertSame('Original Title', $page->content()->title()->value()); // create some changes $page->version('changes')->save([ - 'title' => 'Test' + 'title' => 'Changed Title' ]); VersionId::$render = VersionId::changes(); - $this->assertSame('Test', $page->content()->title()->value()); + $this->assertSame('Changed Title', $page->content()->title()->value()); VersionId::$render = null; - $this->assertSame(null, $page->content()->title()->value()); + $this->assertSame('Original Title', $page->content()->title()->value()); } /** diff --git a/tests/Content/ChangesTest.php b/tests/Content/ChangesTest.php index e4396c99f8..f23364b3eb 100644 --- a/tests/Content/ChangesTest.php +++ b/tests/Content/ChangesTest.php @@ -84,7 +84,8 @@ public function testFiles() $this->assertSame([], $this->app->cache('changes')->get('files')); // in cache and changes exist in reality - $this->app->file('test/test.jpg')->version(VersionId::changes())->create([]); + $this->app->file('test/test.jpg')->version(VersionId::latest())->save([]); + $this->app->file('test/test.jpg')->version(VersionId::changes())->save([]); $this->assertSame($cache, $this->app->cache('changes')->get('files')); $this->assertCount(1, $changes->files()); @@ -116,13 +117,16 @@ public function testGenerateCache() $changes = new Changes(); $file = $this->app->file('test/test.jpg'); - $file->version(VersionId::changes())->create(['foo' => 'bar']); + $file->version(VersionId::latest())->save(['foo' => 'bar']); + $file->version(VersionId::changes())->save(['foo' => 'bar']); $page = $this->app->page('test'); - $page->version(VersionId::changes())->create(['foo' => 'bar']); + $page->version(VersionId::latest())->save(['foo' => 'bar']); + $page->version(VersionId::changes())->save(['foo' => 'bar']); $user = $this->app->user('test'); - $user->version(VersionId::changes())->create(['foo' => 'bar']); + $user->version(VersionId::latest())->save(['foo' => 'bar']); + $user->version(VersionId::changes())->save(['foo' => 'bar']); $this->app->cache('changes')->flush(); @@ -156,7 +160,8 @@ public function testPages() $this->assertSame([], $this->app->cache('changes')->get('pages')); // in cache and changes exist in reality - $this->app->page('test')->version(VersionId::changes())->create([]); + $this->app->page('test')->version(VersionId::latest())->save([]); + $this->app->page('test')->version(VersionId::changes())->save([]); $this->assertSame($cache, $this->app->cache('changes')->get('pages')); $this->assertCount(1, $changes->pages()); @@ -348,7 +353,8 @@ public function testUsers() $this->assertSame([], $this->app->cache('changes')->get('users')); // in cache and changes exist in reality - $this->app->user('test')->version(VersionId::changes())->create([]); + $this->app->user('test')->version(VersionId::latest())->save([]); + $this->app->user('test')->version(VersionId::changes())->save([]); $this->assertSame($cache, $this->app->cache('changes')->get('users')); $this->assertCount(1, $changes->users()); diff --git a/tests/Content/LockTest.php b/tests/Content/LockTest.php index 0662832590..1914b64de5 100644 --- a/tests/Content/LockTest.php +++ b/tests/Content/LockTest.php @@ -13,6 +13,34 @@ class LockTest extends TestCase { public const TMP = KIRBY_TMP_DIR . '/Content.LockTest'; + protected function createChangesVersion(): Version + { + $version = new Version( + model: $this->app->page('test'), + id: VersionId::changes() + ); + + $version->create([ + 'title' => 'Test' + ]); + + return $version; + } + + protected function createLatestVersion(): Version + { + $latest = new Version( + model: $this->app->page('test'), + id: VersionId::latest() + ); + + $latest->create([ + 'title' => 'Test' + ]); + + return $latest; + } + public function setUp(): void { $this->app = new App([ @@ -46,16 +74,9 @@ public function testForWithAuthenticatedUser() { $this->app->impersonate('admin'); - $version = new Version( - model: $this->app->page('test'), - id: VersionId::changes() - ); - - $version->create([ - 'title' => 'Test' - ]); - - $lock = Lock::for($version); + $latest = $this->createLatestVersion(); + $changes = $this->createChangesVersion(); + $lock = Lock::for($changes); $this->assertTrue($lock->isActive()); $this->assertFalse($lock->isLocked()); @@ -70,19 +91,13 @@ public function testForWithDifferentUser() // create the version with the admin user $this->app->impersonate('admin'); - $version = new Version( - model: $this->app->page('test'), - id: VersionId::changes() - ); - - $version->create([ - 'title' => 'Test' - ]); + $latest = $this->createLatestVersion(); + $changes = $this->createChangesVersion(); // switch to a different user to simulate locked content $this->app->impersonate('editor'); - $lock = Lock::for($version); + $lock = Lock::for($changes); $this->assertTrue($lock->isActive()); $this->assertTrue($lock->isLocked()); @@ -97,17 +112,8 @@ public function testForWithoutUser() // create the version with the admin user $this->app->impersonate('admin'); - // the latest version won't have a user id - $version = new Version( - model: $this->app->page('test'), - id: VersionId::latest() - ); - - $version->create([ - 'title' => 'Test' - ]); - - $lock = Lock::for($version); + $latest = $this->createLatestVersion(); + $lock = Lock::for($latest); $this->assertNull($lock->user()); } diff --git a/tests/Content/VersionTest.php b/tests/Content/VersionTest.php index 77e4acc85c..9aaf6580b9 100644 --- a/tests/Content/VersionTest.php +++ b/tests/Content/VersionTest.php @@ -175,12 +175,12 @@ public function testCreateMultiLanguage(): void $this->assertContentFileDoesNotExist('de'); // with Language argument - $version->create([ + $version->save([ 'title' => 'Test' ], $this->app->language('en')); // with string argument - $version->create([ + $version->save([ 'title' => 'Test' ], 'de'); @@ -202,7 +202,7 @@ public function testCreateSingleLanguage(): void $this->assertContentFileDoesNotExist(); - $version->create([ + $version->save([ 'title' => 'Test' ]); @@ -238,7 +238,7 @@ public function testCreateWithDirtyFields(): void ); // primary language - $version->create([ + $version->save([ 'title' => 'Test', 'uuid' => '12345', 'Subtitle' => 'Subtitle', @@ -337,16 +337,16 @@ public function testDiffMultiLanguage() id: VersionId::changes() ); - $a->create($content = [ + $a->save($content = [ 'title' => 'Title', 'subtitle' => 'Subtitle', ], 'en'); - $a->create($content, 'de'); + $a->save($content, 'de'); - $b->create($content, 'en'); + $b->save($content, 'en'); - $b->create([ + $b->save([ 'title' => 'Title', 'subtitle' => 'Subtitle (changed)', ], 'de'); @@ -381,12 +381,12 @@ public function testDiffSingleLanguage() id: VersionId::changes() ); - $a->create([ + $a->save([ 'title' => 'Title', 'subtitle' => 'Subtitle', ]); - $b->create([ + $b->save([ 'title' => 'Title', 'subtitle' => 'Subtitle (changed)', ]); @@ -417,12 +417,12 @@ public function testDiffWithoutChanges() id: VersionId::changes() ); - $a->create([ + $a->save([ 'title' => 'Title', 'subtitle' => 'Subtitle', ]); - $b->create([ + $b->save([ 'title' => 'Title', 'subtitle' => 'Subtitle', ]); @@ -444,7 +444,7 @@ public function testDiffWithSameVersion() id: VersionId::latest() ); - $a->create([ + $a->save([ 'title' => 'Title', 'subtitle' => 'Subtitle', ]); From 07419f042afdb05bdc26be92a2d7b627ca937159 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 23 Oct 2024 15:40:35 +0200 Subject: [PATCH 139/362] Fix more unit tests --- tests/Panel/ChangesDialogTest.php | 12 ++++++++---- tests/Panel/Ui/Buttons/LanguagesDropdownTest.php | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/Panel/ChangesDialogTest.php b/tests/Panel/ChangesDialogTest.php index 59ace08725..05654740e7 100644 --- a/tests/Panel/ChangesDialogTest.php +++ b/tests/Panel/ChangesDialogTest.php @@ -68,7 +68,8 @@ public function testFiles(): void { $this->setUpModels(); - $this->app->file('file://test')->version(VersionId::changes())->create([]); + $this->app->file('file://test')->version(VersionId::latest())->save([]); + $this->app->file('file://test')->version(VersionId::changes())->save([]); $dialog = new ChangesDialog(); $files = $dialog->files(); @@ -94,7 +95,8 @@ public function testItems(): void { $this->setUpModels(); $page = $this->app->page('page://test'); - $page->version(VersionId::changes())->create([]); + $page->version(VersionId::latest())->save([]); + $page->version(VersionId::changes())->save([]); $dialog = new ChangesDialog(); $pages = new Pages([$page]); @@ -132,7 +134,8 @@ public function testPages(): void { $this->setUpModels(); - $this->app->page('page://test')->version(VersionId::changes())->create([]); + $this->app->page('page://test')->version(VersionId::latest())->save([]); + $this->app->page('page://test')->version(VersionId::changes())->save([]); $dialog = new ChangesDialog(); $pages = $dialog->pages(); @@ -158,7 +161,8 @@ public function testUsers(): void { $this->setUpModels(); - $this->app->user('user://test')->version(VersionId::changes())->create([]); + $this->app->user('user://test')->version(VersionId::latest())->save([]); + $this->app->user('user://test')->version(VersionId::changes())->save([]); $dialog = new ChangesDialog(); $users = $dialog->users(); diff --git a/tests/Panel/Ui/Buttons/LanguagesDropdownTest.php b/tests/Panel/Ui/Buttons/LanguagesDropdownTest.php index 1e86ad8cf8..1729d9a15a 100644 --- a/tests/Panel/Ui/Buttons/LanguagesDropdownTest.php +++ b/tests/Panel/Ui/Buttons/LanguagesDropdownTest.php @@ -27,11 +27,13 @@ public function testHasChanges() $this->assertFalse($button->hasChanges()); // changes in current translation (not considered) - $page->version('changes')->create([], 'en'); + $page->version('latest')->save([], 'en'); + $page->version('changes')->save([], 'en'); $this->assertFalse($button->hasChanges()); // changes in other translations - $page->version('changes')->create([], 'de'); + $page->version('latest')->save([], 'de'); + $page->version('changes')->save([], 'de'); $this->assertTrue($button->hasChanges()); } From 002a441715c8e0064f5b1a7f3e24f0c13700ebc3 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 23 Oct 2024 16:42:05 +0200 Subject: [PATCH 140/362] Unit tests for the VersionRules class --- src/Content/VersionRules.php | 20 +-- tests/Content/VersionRulesTest.php | 200 +++++++++++++++++++++++++++++ 2 files changed, 211 insertions(+), 9 deletions(-) create mode 100644 tests/Content/VersionRulesTest.php diff --git a/src/Content/VersionRules.php b/src/Content/VersionRules.php index 7f72e9b260..95ab7a0bcf 100644 --- a/src/Content/VersionRules.php +++ b/src/Content/VersionRules.php @@ -27,16 +27,18 @@ public static function create( ): void { if ($version->exists($language) === true) { throw new LogicException( - message: 'The Version already exists' + message: 'The version already exists' ); } - if ($version->isLatest() === false) { - if ($version->model()->version(VersionId::latest())->exists($language) === false) { - throw new LogicException( - message: 'A matching latest version for the changes does not exist' - ); - } + if ($version->isLatest() === true) { + return; + } + + if ($version->model()->version(VersionId::latest())->exists($language) === false) { + throw new LogicException( + message: 'A matching latest version for the changes does not exist' + ); } } @@ -46,7 +48,7 @@ public static function delete( ): void { if ($version->isLocked('*') === true) { throw new LogicException( - message: 'The Version is locked and cannot be deleted' + message: 'The version is locked and cannot be deleted' ); } } @@ -65,7 +67,7 @@ public static function move( if ($toVersion->isLocked('*') === true) { throw new LogicException( - message: 'The destination version is locked' + message: 'The target version is locked and cannot be overwritten' ); } } diff --git a/tests/Content/VersionRulesTest.php b/tests/Content/VersionRulesTest.php new file mode 100644 index 0000000000..1ca03a69d7 --- /dev/null +++ b/tests/Content/VersionRulesTest.php @@ -0,0 +1,200 @@ +setUpSingleLanguage(); + + $version = new ExistingVersion( + model: $this->model, + id: VersionId::latest(), + ); + + $this->expectException(LogicException::class); + $this->expectExceptionMessage('The version already exists'); + + VersionRules::create($version, [], Language::ensure()); + } + + public function testCreateWhenLatestVersionDoesNotExist() + { + $this->setUpSingleLanguage(); + + $version = new Version( + model: $this->model, + id: VersionId::changes(), + ); + + // remove the model root to simulate a missing latest version + Dir::remove($this->model->root()); + + $this->expectException(LogicException::class); + $this->expectExceptionMessage('A matching latest version for the changes does not exist'); + + VersionRules::create($version, [], Language::ensure()); + } + + /** + * @covers ::delete + */ + public function testDeleteWhenTheVersionIsLocked() + { + $this->setUpSingleLanguage(); + + $version = new LockedVersion( + model: $this->model, + id: VersionId::changes(), + ); + + $this->expectException(LogicException::class); + $this->expectExceptionMessage('The version is locked and cannot be deleted'); + + VersionRules::delete($version, Language::ensure()); + } + + /** + * @covers ::move + */ + public function testMoveWhenTheSourceVersionIsLocked() + { + $this->setUpSingleLanguage(); + + $source = new LockedVersion( + model: $this->model, + id: VersionId::changes(), + ); + + $target = new Version( + model: $this->model, + id: VersionId::changes(), + ); + + $this->expectException(LogicException::class); + $this->expectExceptionMessage('The source version is locked and cannot be moved'); + + VersionRules::move($source, Language::ensure(), $target, Language::ensure()); + } + + /** + * @covers ::move + */ + public function testMoveWhenTheTargetVersionIsLocked() + { + $this->setUpSingleLanguage(); + + $source = new Version( + model: $this->model, + id: VersionId::changes(), + ); + + $target = new LockedVersion( + model: $this->model, + id: VersionId::changes(), + ); + + $this->expectException(LogicException::class); + $this->expectExceptionMessage('The target version is locked and cannot be overwritten'); + + VersionRules::move($source, Language::ensure(), $target, Language::ensure()); + } + + /** + * @covers ::publish + */ + public function testPublishTheLatestVersion() + { + $this->setUpSingleLanguage(); + + $version = new Version( + model: $this->model, + id: VersionId::latest(), + ); + + $this->expectException(LogicException::class); + $this->expectExceptionMessage('This version is already published'); + + VersionRules::publish($version, Language::ensure()); + } + + public function testPublishWhenTheVersionIsLocked() + { + $this->setUpSingleLanguage(); + + $version = new LockedVersion( + model: $this->model, + id: VersionId::changes(), + ); + + $this->expectException(LogicException::class); + $this->expectExceptionMessage('The version is locked and cannot be published'); + + VersionRules::publish($version, Language::ensure()); + } + + /** + * @covers ::replace + */ + public function testReplaceWhenTheVersionIsLocked() + { + $this->setUpSingleLanguage(); + + $version = new LockedVersion( + model: $this->model, + id: VersionId::changes(), + ); + + $this->expectException(LogicException::class); + $this->expectExceptionMessage('The version is locked and cannot be replaced'); + + VersionRules::replace($version, [], Language::ensure()); + } + + /** + * @covers ::update + */ + public function testUpdateWhenTheVersionIsLocked() + { + $this->setUpSingleLanguage(); + + $version = new LockedVersion( + model: $this->model, + id: VersionId::changes(), + ); + + $this->expectException(LogicException::class); + $this->expectExceptionMessage('The version is locked and cannot be updated'); + + VersionRules::update($version, [], Language::ensure()); + } +} From ad889bb4fb6d2475646aa10eb386853fdf78d708 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 23 Oct 2024 16:55:03 +0200 Subject: [PATCH 141/362] First tests for Version::lock and Version::isLocked --- tests/Content/VersionTest.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/Content/VersionTest.php b/tests/Content/VersionTest.php index 9aaf6580b9..463271510b 100644 --- a/tests/Content/VersionTest.php +++ b/tests/Content/VersionTest.php @@ -639,6 +639,36 @@ public function testId(): void $this->assertSame($id, $version->id()); } + /** + * @covers ::isLocked + */ + public function testIsLocked(): void + { + $this->setUpSingleLanguage(); + + $version = new Version( + model: $this->model, + id: VersionId::latest() + ); + + $this->assertFalse($version->isLocked()); + } + + /** + * @covers ::lock + */ + public function testLock(): void + { + $this->setUpSingleLanguage(); + + $version = new Version( + model: $this->model, + id: VersionId::latest() + ); + + $this->assertInstanceOf(Lock::class, $version->lock()); + } + /** * @covers ::model */ From 9bdddcd6c4b293972c9b17f2bb202fe4e6445542 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 24 Oct 2024 09:14:14 +0200 Subject: [PATCH 142/362] Add option to specifiy the language for the lock --- src/Content/Lock.php | 8 ++++++-- src/Content/Version.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Content/Lock.php b/src/Content/Lock.php index 4915f0befc..334f2b8e99 100644 --- a/src/Content/Lock.php +++ b/src/Content/Lock.php @@ -3,6 +3,7 @@ namespace Kirby\Content; use Kirby\Cms\App; +use Kirby\Cms\Language; use Kirby\Cms\User; use Kirby\Toolkit\Str; @@ -34,8 +35,11 @@ public function __construct( * lock user id from the version. */ public static function for( - Version $version + Version $version, + Language|string $language = 'default' ): static { + $language = Language::ensure($language); + // if the version does not exist, it cannot be locked if ($version->exists() === false) { // create an open lock for the current user @@ -45,7 +49,7 @@ public static function for( } // Read the locked user id from the version - if ($userId = ($version->read('default')['lock'] ?? null)) { + if ($userId = ($version->read($language)['lock'] ?? null)) { $user = App::instance()->user($userId); } diff --git a/src/Content/Version.php b/src/Content/Version.php index df7bbf8c24..ff32aba089 100644 --- a/src/Content/Version.php +++ b/src/Content/Version.php @@ -234,7 +234,7 @@ public function isLocked(Language|string $language = 'default'): bool */ public function lock(Language|string $language = 'default'): Lock { - return Lock::for($this, Language::ensure($language)); + return Lock::for($this, $language); } /** From bb4489adb46acc3829bf15b40f63d75ac199a9c1 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 24 Oct 2024 09:51:18 +0200 Subject: [PATCH 143/362] Move Version::ensure and Storage::ensure to VersionRules --- src/Content/Lock.php | 2 +- src/Content/MemoryStorage.php | 1 - src/Content/PlainTextStorage.php | 5 - src/Content/Storage.php | 22 ---- src/Content/Version.php | 37 ++---- src/Content/VersionRules.php | 51 +++++++++ tests/Content/MemoryStorageTest.php | 14 --- tests/Content/PlainTextStorageTest.php | 14 --- tests/Content/VersionRulesTest.php | 153 +++++++++++++++++++++++++ tests/Content/VersionTest.php | 92 --------------- 10 files changed, 213 insertions(+), 178 deletions(-) diff --git a/src/Content/Lock.php b/src/Content/Lock.php index 334f2b8e99..b420e49b5e 100644 --- a/src/Content/Lock.php +++ b/src/Content/Lock.php @@ -41,7 +41,7 @@ public static function for( $language = Language::ensure($language); // if the version does not exist, it cannot be locked - if ($version->exists() === false) { + if ($version->exists($language) === false) { // create an open lock for the current user return new static( user: App::instance()->user(), diff --git a/src/Content/MemoryStorage.php b/src/Content/MemoryStorage.php index c105df40e2..8655897206 100644 --- a/src/Content/MemoryStorage.php +++ b/src/Content/MemoryStorage.php @@ -75,7 +75,6 @@ public function modified(VersionId $versionId, Language $language): int|null */ public function read(VersionId $versionId, Language $language): array { - $this->ensure($versionId, $language); return $this->cache->get($this->cacheId($versionId, $language)); } diff --git a/src/Content/PlainTextStorage.php b/src/Content/PlainTextStorage.php index dd75d1f7d7..0c9821f9c6 100644 --- a/src/Content/PlainTextStorage.php +++ b/src/Content/PlainTextStorage.php @@ -230,11 +230,6 @@ public function modified(VersionId $versionId, Language $language): int|null */ public function read(VersionId $versionId, Language $language): array { - // Verify that the version exists. The `::exists` method - // makes sure to validate this correctly, based on the - // requested version and language - $this->ensure($versionId, $language); - $contentFile = $this->contentFile($versionId, $language); if (file_exists($contentFile) === true) { diff --git a/src/Content/Storage.php b/src/Content/Storage.php index 9309874ca8..2b8cf308b9 100644 --- a/src/Content/Storage.php +++ b/src/Content/Storage.php @@ -6,7 +6,6 @@ use Kirby\Cms\Language; use Kirby\Cms\Languages; use Kirby\Cms\ModelWithContent; -use Kirby\Exception\NotFoundException; use Kirby\Toolkit\A; /** @@ -105,26 +104,6 @@ public function deleteLanguage(Language $language): void } } - /** - * Checks if a version/language combination exists and otherwise - * will throw a `NotFoundException` - * - * @throws \Kirby\Exception\NotFoundException If the version does not exist - */ - public function ensure(VersionId $versionId, Language $language): void - { - if ($this->exists($versionId, $language) === true) { - return; - } - - $message = match($this->model->kirby()->multilang()) { - true => 'Version "' . $versionId . ' (' . $language->code() . ')" does not already exist', - false => 'Version "' . $versionId . '" does not already exist', - }; - - throw new NotFoundException($message); - } - /** * Checks if a version exists */ @@ -275,7 +254,6 @@ public function touchLanguage(Language $language): void */ public function update(VersionId $versionId, Language $language, array $fields): void { - $this->ensure($versionId, $language); $this->write($versionId, $language, $fields); } diff --git a/src/Content/Version.php b/src/Content/Version.php index ff32aba089..c36d52876b 100644 --- a/src/Content/Version.php +++ b/src/Content/Version.php @@ -156,21 +156,6 @@ public function diff( return array_diff_assoc($b, $a); } - /** - * Ensure that the version exists and otherwise - * throw an exception - * - * @throws \Kirby\Exception\NotFoundException if the version does not exist - */ - public function ensure( - Language|string $language = 'default' - ): void { - $this->model->storage()->ensure( - $this->id, - Language::ensure($language) - ); - } - /** * Checks if a version exists for the given language */ @@ -286,9 +271,6 @@ public function move( toLanguage: $toLanguage ); - // make sure that the version exists - $this->ensure($fromLanguage); - $this->model->storage()->move( fromVersionId: $fromVersion->id(), fromLanguage: $fromLanguage, @@ -378,9 +360,6 @@ public function publish(Language|string $language = 'default'): void { $language = Language::ensure($language); - // the version needs to exist - $this->ensure($language); - // check if publishing is allowed VersionRules::publish($this, $language); @@ -405,6 +384,9 @@ public function read(Language|string $language = 'default'): array|null $language = Language::ensure($language); try { + // make sure that the version exists + VersionRules::read($this, $language); + $fields = $this->model->storage()->read($this->id, $language); $fields = $this->prepareFieldsAfterRead($fields, $language); return $fields; @@ -426,9 +408,6 @@ public function replace( ): void { $language = Language::ensure($language); - // the version needs to exist - $this->ensure($language); - // check if replacing is allowed VersionRules::replace($this, $fields, $language); @@ -467,8 +446,11 @@ public function save( */ public function touch(Language|string $language = 'default'): void { - $this->ensure($language); - $this->model->storage()->touch($this->id, Language::ensure($language)); + $language = Language::ensure($language); + + VersionRules::touch($this, $language); + + $this->model->storage()->touch($this->id, $language); } /** @@ -484,9 +466,6 @@ public function update( ): void { $language = Language::ensure($language); - // the version needs to exist - $this->ensure($language); - // check if updating is allowed VersionRules::update($this, $fields, $language); diff --git a/src/Content/VersionRules.php b/src/Content/VersionRules.php index 95ab7a0bcf..a1a678f1c3 100644 --- a/src/Content/VersionRules.php +++ b/src/Content/VersionRules.php @@ -4,6 +4,7 @@ use Kirby\Cms\Language; use Kirby\Exception\LogicException; +use Kirby\Exception\NotFoundException; /** * The VersionRules class handles the validation for all @@ -42,6 +43,26 @@ public static function create( } } + /** + * Checks if a version/language combination exists and otherwise + * will throw a `NotFoundException` + * + * @throws \Kirby\Exception\NotFoundException If the version does not exist + */ + public static function ensure(Version $version, Language $language): void + { + if ($version->exists($language) === true) { + return; + } + + $message = match($version->model()->kirby()->multilang()) { + true => 'Version "' . $version->id() . ' (' . $language->code() . ')" does not already exist', + false => 'Version "' . $version->id() . '" does not already exist', + }; + + throw new NotFoundException($message); + } + public static function delete( Version $version, Language $language @@ -59,12 +80,17 @@ public static function move( Version $toVersion, Language $toLanguage ): void { + // make sure that the source version exists + static::ensure($fromVersion, $fromLanguage); + + // check if the source version is locked in any language if ($fromVersion->isLocked('*') === true) { throw new LogicException( message: 'The source version is locked and cannot be moved' ); } + // check if the target version is locked in any language if ($toVersion->isLocked('*') === true) { throw new LogicException( message: 'The target version is locked and cannot be overwritten' @@ -76,12 +102,17 @@ public static function publish( Version $version, Language $language ): void { + // the latest version is already published if ($version->isLatest() === true) { throw new LogicException( message: 'This version is already published' ); } + // make sure that the version exists + static::ensure($version, $language); + + // check if the version is locked in any language if ($version->isLocked('*') === true) { throw new LogicException( message: 'The version is locked and cannot be published' @@ -89,11 +120,22 @@ public static function publish( } } + public static function read( + Version $version, + Language $language + ): void { + static::ensure($version, $language); + } + public static function replace( Version $version, array $fields, Language $language ): void { + // make sure that the version exists + static::ensure($version, $language); + + // check if the version is locked in any language if ($version->isLocked('*') === true) { throw new LogicException( message: 'The version is locked and cannot be replaced' @@ -101,11 +143,20 @@ public static function replace( } } + public static function touch( + Version $version, + Language $language + ): void { + static::ensure($version, $language); + } + public static function update( Version $version, array $fields, Language $language ): void { + static::ensure($version, $language); + if ($version->isLocked('*') === true) { throw new LogicException( message: 'The version is locked and cannot be updated' diff --git a/tests/Content/MemoryStorageTest.php b/tests/Content/MemoryStorageTest.php index a603dd1ef7..c24f87af46 100644 --- a/tests/Content/MemoryStorageTest.php +++ b/tests/Content/MemoryStorageTest.php @@ -3,7 +3,6 @@ namespace Kirby\Content; use Kirby\Cms\Language; -use Kirby\Exception\NotFoundException; /** * @coversDefaultClass Kirby\Content\MemoryStorage @@ -313,19 +312,6 @@ public function testModifiedSomeExistingSingleLanguage() $this->assertNull($this->storage->modified(VersionId::latest(), $language)); } - /** - * @covers ::read - */ - public function testReadWhenMissing() - { - $this->setUpSingleLanguage(); - - $this->expectException(NotFoundException::class); - $this->expectExceptionMessage('Version "changes" does not already exist'); - - $this->storage->read(VersionId::changes(), Language::single()); - } - /** * @covers ::touch */ diff --git a/tests/Content/PlainTextStorageTest.php b/tests/Content/PlainTextStorageTest.php index a774c5dd03..a6702cd0d8 100644 --- a/tests/Content/PlainTextStorageTest.php +++ b/tests/Content/PlainTextStorageTest.php @@ -7,7 +7,6 @@ use Kirby\Cms\Page; use Kirby\Cms\User; use Kirby\Data\Data; -use Kirby\Exception\NotFoundException; use Kirby\Filesystem\Dir; /** @@ -378,19 +377,6 @@ public function testReadLatestSingleLang() $this->assertSame($fields, $this->storage->read(VersionId::latest(), Language::single())); } - /** - * @covers ::read - */ - public function testReadWhenMissing() - { - $this->setUpSingleLanguage(); - - $this->expectException(NotFoundException::class); - $this->expectExceptionMessage('Version "changes" does not already exist'); - - $this->storage->read(VersionId::changes(), Language::single()); - } - /** * @covers ::touch */ diff --git a/tests/Content/VersionRulesTest.php b/tests/Content/VersionRulesTest.php index 1ca03a69d7..e8551572f0 100644 --- a/tests/Content/VersionRulesTest.php +++ b/tests/Content/VersionRulesTest.php @@ -4,6 +4,7 @@ use Kirby\Cms\Language; use Kirby\Exception\LogicException; +use Kirby\Exception\NotFoundException; use Kirby\Filesystem\Dir; class ExistingVersion extends Version @@ -47,6 +48,9 @@ public function testCreateWhenTheVersionAlreadyExists() VersionRules::create($version, [], Language::ensure()); } + /** + * @covers ::create + */ public function testCreateWhenLatestVersionDoesNotExist() { $this->setUpSingleLanguage(); @@ -83,6 +87,95 @@ public function testDeleteWhenTheVersionIsLocked() VersionRules::delete($version, Language::ensure()); } + /** + * @covers ::ensure + */ + public function testEnsureMultiLanguage(): void + { + $this->setUpMultiLanguage(); + + $version = new Version( + model: $this->model, + id: VersionId::latest() + ); + + $this->createContentMultiLanguage(); + + $this->assertNull(VersionRules::ensure($version, Language::ensure('en'))); + $this->assertNull(VersionRules::ensure($version, Language::ensure('de'))); + } + + /** + * @covers ::ensure + */ + public function testEnsureSingleLanguage(): void + { + $this->setUpSingleLanguage(); + + $version = new Version( + model: $this->model, + id: VersionId::latest() + ); + + $this->createContentSingleLanguage(); + + $this->assertNull(VersionRules::ensure($version, Language::ensure())); + } + + /** + * @covers ::ensure + */ + public function testEnsureWhenMissingMultiLanguage(): void + { + $this->setUpMultiLanguage(); + + $version = new Version( + model: $this->model, + id: VersionId::changes() + ); + + $this->expectException(NotFoundException::class); + $this->expectExceptionMessage('Version "changes (de)" does not already exist'); + + VersionRules::ensure($version, Language::ensure('de')); + } + + /** + * @covers ::ensure + */ + public function testEnsureWhenMissingSingleLanguage(): void + { + $this->setUpSingleLanguage(); + + $version = new Version( + model: $this->model, + id: VersionId::changes() + ); + + $this->expectException(NotFoundException::class); + $this->expectExceptionMessage('Version "changes" does not already exist'); + + VersionRules::ensure($version, Language::ensure()); + } + + /** + * @covers ::ensure + */ + public function testEnsureWithInvalidLanguage(): void + { + $this->setUpMultiLanguage(); + + $version = new Version( + model: $this->model, + id: VersionId::latest() + ); + + $this->expectException(NotFoundException::class); + $this->expectExceptionMessage('Invalid language: fr'); + + VersionRules::ensure($version, Language::ensure('fr')); + } + /** * @covers ::move */ @@ -100,6 +193,9 @@ public function testMoveWhenTheSourceVersionIsLocked() id: VersionId::changes(), ); + $source->save([]); + $target->save([]); + $this->expectException(LogicException::class); $this->expectExceptionMessage('The source version is locked and cannot be moved'); @@ -123,6 +219,10 @@ public function testMoveWhenTheTargetVersionIsLocked() id: VersionId::changes(), ); + // the source needs to exist to jump to the + // next logic issue + $source->save([]); + $this->expectException(LogicException::class); $this->expectExceptionMessage('The target version is locked and cannot be overwritten'); @@ -147,6 +247,9 @@ public function testPublishTheLatestVersion() VersionRules::publish($version, Language::ensure()); } + /** + * @covers ::publish + */ public function testPublishWhenTheVersionIsLocked() { $this->setUpSingleLanguage(); @@ -156,12 +259,36 @@ public function testPublishWhenTheVersionIsLocked() id: VersionId::changes(), ); + $version->save([]); + $this->expectException(LogicException::class); $this->expectExceptionMessage('The version is locked and cannot be published'); VersionRules::publish($version, Language::ensure()); } + /** + * @covers ::read + */ + public function testReadWhenMissing() + { + $this->setUpSingleLanguage(); + + $version = new Version( + model: $this->model, + id: VersionId::latest(), + ); + + // make sure that the version does not exist + // just because the model root exists + Dir::remove($this->model->root()); + + $this->expectException(NotFoundException::class); + $this->expectExceptionMessage('Version "latest" does not already exist'); + + VersionRules::read($version, Language::ensure()); + } + /** * @covers ::replace */ @@ -174,12 +301,36 @@ public function testReplaceWhenTheVersionIsLocked() id: VersionId::changes(), ); + $version->save([]); + $this->expectException(LogicException::class); $this->expectExceptionMessage('The version is locked and cannot be replaced'); VersionRules::replace($version, [], Language::ensure()); } + /** + * @covers ::touch + */ + public function testTouchWhenMissing() + { + $this->setUpSingleLanguage(); + + $version = new Version( + model: $this->model, + id: VersionId::latest(), + ); + + // make sure that the version does not exist + // just because the model root exists + Dir::remove($this->model->root()); + + $this->expectException(NotFoundException::class); + $this->expectExceptionMessage('Version "latest" does not already exist'); + + VersionRules::touch($version, Language::ensure()); + } + /** * @covers ::update */ @@ -192,6 +343,8 @@ public function testUpdateWhenTheVersionIsLocked() id: VersionId::changes(), ); + $version->save([]); + $this->expectException(LogicException::class); $this->expectExceptionMessage('The version is locked and cannot be updated'); diff --git a/tests/Content/VersionTest.php b/tests/Content/VersionTest.php index 463271510b..391825422c 100644 --- a/tests/Content/VersionTest.php +++ b/tests/Content/VersionTest.php @@ -454,98 +454,6 @@ public function testDiffWithSameVersion() $this->assertSame([], $diff); } - /** - * @covers ::ensure - */ - public function testEnsureMultiLanguage(): void - { - $this->setUpMultiLanguage(); - - $version = new Version( - model: $this->model, - id: VersionId::latest() - ); - - $this->createContentMultiLanguage(); - - $this->assertNull($version->ensure('en')); - $this->assertNull($version->ensure($this->app->language('en'))); - - $this->assertNull($version->ensure('de')); - $this->assertNull($version->ensure($this->app->language('de'))); - } - - /** - * @covers ::ensure - */ - public function testEnsureSingleLanguage(): void - { - $this->setUpSingleLanguage(); - - $version = new Version( - model: $this->model, - id: VersionId::latest() - ); - - $this->createContentSingleLanguage(); - - $this->assertNull($version->ensure()); - } - - /** - * @covers ::ensure - */ - public function testEnsureWhenMissingMultiLanguage(): void - { - $this->setUpMultiLanguage(); - - $version = new Version( - model: $this->model, - id: VersionId::changes() - ); - - $this->expectException(NotFoundException::class); - $this->expectExceptionMessage('Version "changes (de)" does not already exist'); - - $version->ensure('de'); - } - - /** - * @covers ::ensure - */ - public function testEnsureWhenMissingSingleLanguage(): void - { - $this->setUpSingleLanguage(); - - $version = new Version( - model: $this->model, - id: VersionId::changes() - ); - - $this->expectException(NotFoundException::class); - $this->expectExceptionMessage('Version "changes" does not already exist'); - - $version->ensure(); - } - - /** - * @covers ::ensure - */ - public function testEnsureWithInvalidLanguage(): void - { - $this->setUpMultiLanguage(); - - $version = new Version( - model: $this->model, - id: VersionId::latest() - ); - - $this->expectException(NotFoundException::class); - $this->expectExceptionMessage('Invalid language: fr'); - - $version->ensure('fr'); - } - /** * @covers ::exists */ From 0d2b40c993b654bdc5784f9672d99e97e250cece Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 25 Oct 2024 09:39:36 +0200 Subject: [PATCH 144/362] Simplify version check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nico Hoffmann ෴. --- src/Content/Version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Content/Version.php b/src/Content/Version.php index c36d52876b..2fad2bd109 100644 --- a/src/Content/Version.php +++ b/src/Content/Version.php @@ -192,7 +192,7 @@ public function id(): VersionId */ public function isLatest(): bool { - return $this->id->is(VersionId::latest()); + return $this->id->is('latest'); } /** From fa87fc87fc0760a6e47508698ed1ab22aa4c31c9 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 25 Oct 2024 14:45:03 +0200 Subject: [PATCH 145/362] Remove invalid throw annotations and always return an array --- src/Content/MemoryStorage.php | 4 +--- src/Content/PlainTextStorage.php | 1 - src/Content/Storage.php | 2 -- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Content/MemoryStorage.php b/src/Content/MemoryStorage.php index 8655897206..9ad44b007a 100644 --- a/src/Content/MemoryStorage.php +++ b/src/Content/MemoryStorage.php @@ -70,12 +70,10 @@ public function modified(VersionId $versionId, Language $language): int|null * Returns the stored content fields * * @return array - * - * @throws \Kirby\Exception\NotFoundException If the version does not exist */ public function read(VersionId $versionId, Language $language): array { - return $this->cache->get($this->cacheId($versionId, $language)); + return $this->cache->get($this->cacheId($versionId, $language)) ?? []; } /** diff --git a/src/Content/PlainTextStorage.php b/src/Content/PlainTextStorage.php index 0c9821f9c6..8d63c63b3a 100644 --- a/src/Content/PlainTextStorage.php +++ b/src/Content/PlainTextStorage.php @@ -226,7 +226,6 @@ public function modified(VersionId $versionId, Language $language): int|null * Returns the stored content fields * * @return array - * @throws \Kirby\Exception\NotFoundException If the version is missing */ public function read(VersionId $versionId, Language $language): array { diff --git a/src/Content/Storage.php b/src/Content/Storage.php index 2b8cf308b9..937a50b15b 100644 --- a/src/Content/Storage.php +++ b/src/Content/Storage.php @@ -197,8 +197,6 @@ public function moveLanguage( * Returns the stored content fields * * @return array - * - * @throws \Kirby\Exception\NotFoundException If the version does not exist */ abstract public function read(VersionId $versionId, Language $language): array; From c5c0c46d684aa0210b0c3a3fd6f45558151842dc Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 17 Oct 2024 13:40:43 +0200 Subject: [PATCH 146/362] Pass the model to the Fields collection --- src/Form/Form.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Form/Form.php b/src/Form/Form.php index d40d626a0a..fca7e21781 100644 --- a/src/Form/Form.php +++ b/src/Form/Form.php @@ -44,6 +44,7 @@ public function __construct(array $props) $fields = $props['fields'] ?? []; $values = $props['values'] ?? []; $input = $props['input'] ?? []; + $model = $props['model'] ?? null; $strict = $props['strict'] ?? false; $inject = $props; @@ -59,7 +60,10 @@ public function __construct(array $props) unset($inject['fields'], $inject['values'], $inject['input']); - $this->fields = new Fields(); + $this->fields = new Fields( + model: $model + ); + $this->values = []; foreach ($fields as $name => $props) { From ad44c60b7018e2fc554b6701287820790b948656 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 17 Oct 2024 13:41:27 +0200 Subject: [PATCH 147/362] Use Field::isSaveable instead of Field::save --- src/Form/Form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Form/Form.php b/src/Form/Form.php index fca7e21781..24fb9be298 100644 --- a/src/Form/Form.php +++ b/src/Form/Form.php @@ -86,7 +86,7 @@ public function __construct(array $props) $field = static::exceptionField($e, $props); } - if ($field->save() !== false) { + if ($field->isSaveable() === true) { $this->values[$name] = $field->value(); } @@ -123,7 +123,7 @@ public function data($defaults = false, bool $includeNulls = true): array $data = $this->values; foreach ($this->fields as $field) { - if ($field->save() === false || $field->unset() === true) { + if ($field->isSaveable() === false || $field->unset() === true) { if ($includeNulls === true) { $data[$field->name()] = null; } else { From 7e942316d8a16549d226caa9db17ab8fc6b969ca Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 17 Oct 2024 13:59:34 +0200 Subject: [PATCH 148/362] New Fields::findByKey and Fields::findByKeyRecursive methods --- src/Form/Fields.php | 47 +++++++++++++++++++++++++++++++++++++++ src/Form/Form.php | 34 +++++----------------------- tests/Form/FieldsTest.php | 47 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+), 29 deletions(-) diff --git a/src/Form/Fields.php b/src/Form/Fields.php index 4d1f2f35ae..bed886db57 100644 --- a/src/Form/Fields.php +++ b/src/Form/Fields.php @@ -6,6 +6,7 @@ use Kirby\Cms\ModelWithContent; use Kirby\Toolkit\A; use Kirby\Toolkit\Collection; +use Kirby\Toolkit\Str; /** * A collection of Field objects @@ -106,6 +107,52 @@ public function fill(array $input): static return $this; } + /** + * Find a field by key/name + */ + public function findByKey(string $key): Field|FieldClass|null + { + if (str_contains($key, '+')) { + return $this->findByKeyRecursive($key); + } + + return parent::findByKey($key); + } + + /** + * Find fields in nested forms recursively + */ + public function findByKeyRecursive(string $key): Field|FieldClass|null + { + $fields = $this; + $names = Str::split($key, '+'); + $index = 0; + $count = count($names); + $field = null; + + foreach ($names as $name) { + $index++; + + if ($field = $fields->get($name)) { + if ($count !== $index) { + $form = $field->form(); + + if ($form instanceof Form === false) { + return null; + } + + $fields = $form->fields(); + } + + continue; + } + + return null; + } + + return $field; + } + /** * Converts the fields collection to an * array and also does that for every diff --git a/src/Form/Form.php b/src/Form/Form.php index 24fb9be298..1287875aaa 100644 --- a/src/Form/Form.php +++ b/src/Form/Form.php @@ -9,7 +9,6 @@ use Kirby\Data\Data; use Kirby\Exception\NotFoundException; use Kirby\Toolkit\A; -use Kirby\Toolkit\Str; use Throwable; /** @@ -175,36 +174,13 @@ public static function exceptionField( */ public function field(string $name): Field|FieldClass { - $form = $this; - $fieldNames = Str::split($name, '+'); - $index = 0; - $count = count($fieldNames); - $field = null; - - foreach ($fieldNames as $fieldName) { - $index++; - - if ($field = $form->fields()->get($fieldName)) { - if ($count !== $index) { - $form = $field->form(); - } - - continue; - } - - throw new NotFoundException( - message: 'The field "' . $fieldName . '" could not be found' - ); + if ($field = $this->fields->find($name)) { + return $field; } - // it can get this error only if $name is an empty string as $name = '' - if ($field === null) { - throw new NotFoundException( - message: 'No field could be loaded' - ); - } - - return $field; + throw new NotFoundException( + message: 'No field could be loaded' + ); } /** diff --git a/tests/Form/FieldsTest.php b/tests/Form/FieldsTest.php index 0fc29b2d1d..670fe2583e 100644 --- a/tests/Form/FieldsTest.php +++ b/tests/Form/FieldsTest.php @@ -183,6 +183,53 @@ public function testFill() $this->assertSame($input, $fields->toArray(fn ($field) => $field->value())); } + /** + * @covers ::findByKey + * @covers ::findByKeyRecursive + */ + public function testFind() + { + Field::$types['test'] = [ + 'methods' => [ + 'form' => function () { + return new Form([ + 'fields' => [ + 'child' => [ + 'type' => 'text', + ], + ], + 'model' => $this->model + ]); + } + ] + ]; + + $fields = new Fields([ + 'mother' => [ + 'type' => 'test', + ], + ], $this->model); + + $this->assertSame('mother', $fields->find('mother')->name()); + $this->assertSame('child', $fields->find('mother+child')->name()); + $this->assertNull($fields->find('mother+missing-child')); + } + + /** + * @covers ::findByKey + * @covers ::findByKeyRecursive + */ + public function testFindWhenFieldHasNoForm() + { + $fields = new Fields([ + 'mother' => [ + 'type' => 'text', + ], + ], $this->model); + + $this->assertNull($fields->find('mother+child')); + } + /** * @covers ::toArray */ From 0a4b857f3ca14f362607788ca9519ece2a754a72 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 17 Oct 2024 14:01:50 +0200 Subject: [PATCH 149/362] Remove unnecessary check for a blueprint method --- src/Form/Form.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Form/Form.php b/src/Form/Form.php index 1287875aaa..45a0dee762 100644 --- a/src/Form/Form.php +++ b/src/Form/Form.php @@ -212,12 +212,7 @@ public static function for( $props['model'] = $model; // search for the blueprint - if ( - method_exists($model, 'blueprint') === true && - $blueprint = $model->blueprint() - ) { - $props['fields'] = $blueprint->fields(); - } + $props['fields'] = $model->blueprint()->fields(); $ignoreDisabled = $props['ignoreDisabled'] ?? false; From 07dc78bc9a264e90579aa7b86380b5e2768609be Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 17 Oct 2024 14:57:05 +0200 Subject: [PATCH 150/362] Align Field::data and Field::value with FieldClass::data and FieldClass::value --- src/Form/Field.php | 28 ++++++++++++++++++---------- tests/Form/FieldTest.php | 23 +++++++++++++++++++++++ 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/src/Form/Field.php b/src/Form/Field.php index 4c3730a35d..14d0cd2c56 100644 --- a/src/Form/Field.php +++ b/src/Form/Field.php @@ -77,17 +77,17 @@ public function __construct( } /** - * Returns field data + * @deprecated 3.5.0 + * @todo remove when the general field class setup has been refactored + * + * Returns the field data + * in a format to be stored + * in Kirby's content fields */ public function data(bool $default = false): mixed { - $save = $this->options['save'] ?? true; - - if ($default === true && $this->isEmpty($this->value)) { - $value = $this->default(); - } else { - $value = $this->value; - } + $save = $this->options['save'] ?? true; + $value = $this->value($default); if ($save === false) { return null; @@ -446,8 +446,16 @@ protected function validations(): array * Returns the value of the field if saveable * otherwise it returns null */ - public function value(): mixed + public function value(bool $default = false): mixed { - return $this->isSaveable() ? $this->value : null; + if ($this->isSaveable() === false) { + return null; + } + + if ($default === true && $this->isEmpty() === true) { + return $this->default(); + } + + return $this->value; } } diff --git a/tests/Form/FieldTest.php b/tests/Form/FieldTest.php index ac4ec618b0..f11d6ee2ec 100644 --- a/tests/Form/FieldTest.php +++ b/tests/Form/FieldTest.php @@ -1239,6 +1239,29 @@ public function testValidateWithCustomValidator() $this->assertSame(['test' => 'Invalid value: abc'], $field->errors()); } + public function testValue() + { + Field::$types['test'] = []; + + $field = new Field('test'); + $this->assertNull($field->value()); + + $field = new Field('test', ['value' => 'Test']); + $this->assertSame('Test', $field->value()); + + $field = new Field('test', ['default' => 'Default value']); + $this->assertNull($field->value()); + + $field = new Field('test', ['default' => 'Default value']); + $this->assertSame('Default value', $field->value(true)); + + Field::$types['test'] = [ + 'save' => false + ]; + + $field = new Field('test', ['value' => 'Test']); + $this->assertNull($field->value()); + } public function testWidth() { From 4b55cd8befbeab9cef927cf9c2d99618c1871ac8 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 17 Oct 2024 17:46:30 +0200 Subject: [PATCH 151/362] New Value mixin --- src/Form/Field.php | 48 ++--------------- src/Form/FieldClass.php | 75 +------------------------- src/Form/Mixin/Value.php | 110 +++++++++++++++++++++++++++++++++++++++ src/Form/Validations.php | 28 +++++----- tests/Form/FieldTest.php | 25 --------- 5 files changed, 128 insertions(+), 158 deletions(-) create mode 100644 src/Form/Mixin/Value.php diff --git a/src/Form/Field.php b/src/Form/Field.php index 14d0cd2c56..1570641814 100644 --- a/src/Form/Field.php +++ b/src/Form/Field.php @@ -30,6 +30,9 @@ class Field extends Component use Mixin\Model; use Mixin\Validation; use Mixin\When; + use Mixin\Value { + isEmptyValue as protected isEmptyValueFromTrait; + } /** * Parent collection with all fields of the current form @@ -322,34 +325,6 @@ public function isDisabled(): bool return $this->disabled === true; } - /** - * Checks if the field is empty - * @deprecated 5.0.0 Passing arguments is deprecated. Use `::isEmptyValue()` instead to check for - */ - public function isEmpty(mixed ...$args): bool - { - $value = match (count($args)) { - 0 => $this->value(), - default => $args[0] - }; - - return $this->isEmptyValue($value); - } - - /** - * Checks if the given value is considered empty - * - * @since 5.0.0 - */ - public function isEmptyValue(mixed $value = null): bool - { - if ($empty = $this->options['isEmpty'] ?? null) { - return $empty->call($this, $value); - } - - return in_array($value, [null, '', []], true); - } - /** * Checks if the field is hidden */ @@ -441,21 +416,4 @@ protected function validations(): array { return $this->options['validations'] ?? []; } - - /** - * Returns the value of the field if saveable - * otherwise it returns null - */ - public function value(bool $default = false): mixed - { - if ($this->isSaveable() === false) { - return null; - } - - if ($default === true && $this->isEmpty() === true) { - return $this->default(); - } - - return $this->value; - } } diff --git a/src/Form/FieldClass.php b/src/Form/FieldClass.php index fb6b525256..eaa330f529 100644 --- a/src/Form/FieldClass.php +++ b/src/Form/FieldClass.php @@ -3,10 +3,8 @@ namespace Kirby\Form; use Kirby\Cms\HasSiblings; -use Kirby\Data\Data; use Kirby\Toolkit\I18n; use Kirby\Toolkit\Str; -use Throwable; /** * Abstract field class to be used instead @@ -28,6 +26,7 @@ abstract class FieldClass use Mixin\Api; use Mixin\Model; use Mixin\Validation; + use Mixin\Value; use Mixin\When; protected string|null $after; @@ -108,19 +107,6 @@ public function data(bool $default = false): mixed return $this->store($this->value($default)); } - /** - * Returns the default value for the field, - * which will be used when a page/file/user is created - */ - public function default(): mixed - { - if (is_string($this->default) === false) { - return $this->default; - } - - return $this->stringTemplate($this->default); - } - /** * Returns optional dialog routes for the field */ @@ -191,16 +177,6 @@ public function isDisabled(): bool return $this->disabled; } - public function isEmpty(): bool - { - return $this->isEmptyValue($this->value()); - } - - public function isEmptyValue(mixed $value = null): bool - { - return in_array($value, [null, '', []], true); - } - public function isHidden(): bool { return false; @@ -425,55 +401,6 @@ public function type(): string return lcfirst(basename(str_replace(['\\', 'Field'], ['/', ''], static::class))); } - /** - * Returns the value of the field if saveable - * otherwise it returns null - */ - public function value(bool $default = false): mixed - { - if ($this->isSaveable() === false) { - return null; - } - - if ($default === true && $this->isEmpty() === true) { - return $this->default(); - } - - return $this->value; - } - - protected function valueFromJson(mixed $value): array - { - try { - return Data::decode($value, 'json'); - } catch (Throwable) { - return []; - } - } - - protected function valueFromYaml(mixed $value): array - { - return Data::decode($value, 'yaml'); - } - - protected function valueToJson( - array|null $value = null, - bool $pretty = false - ): string { - $constants = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; - - if ($pretty === true) { - $constants |= JSON_PRETTY_PRINT; - } - - return json_encode($value, $constants); - } - - protected function valueToYaml(array|null $value = null): string - { - return Data::encode($value, 'yaml'); - } - /** * Returns the width of the field in * the Panel grid diff --git a/src/Form/Mixin/Value.php b/src/Form/Mixin/Value.php new file mode 100644 index 0000000000..499808fd15 --- /dev/null +++ b/src/Form/Mixin/Value.php @@ -0,0 +1,110 @@ + + * @link https://getkirby.com + * @copyright Bastian Allgeier + * @license https://opensource.org/licenses/MIT + */ +trait Value +{ + /** + * @deprecated 3.5.0 + * @todo remove when the general field class setup has been refactored + * + * Returns the field data + * in a format to be stored + * in Kirby's content fields + */ + public function default(): mixed + { + if (is_string($this->default) === false) { + return $this->default; + } + + return $this->model->toString($this->default); + } + + /** + * Checks if the field is empty + */ + public function isEmpty(): bool + { + return $this->isEmptyValue($this->value()); + } + + /** + * Checks if the given value is considered empty + */ + public function isEmptyValue(mixed $value = null): bool + { + return in_array($value, [null, '', []], true); + } + + /** + * Returns the value of the field if saveable + * otherwise it returns null + */ + public function value(bool $default = false): mixed + { + if ($this->isSaveable() === false) { + return null; + } + + if ($default === true && $this->isEmpty() === true) { + return $this->default(); + } + + return $this->value; + } + + /** + * Decodes a JSON string into an array + */ + protected function valueFromJson(mixed $value): array + { + try { + return Data::decode($value, 'json'); + } catch (Throwable) { + return []; + } + } + + /** + * Decodes a YAML string into an array + */ + protected function valueFromYaml(mixed $value): array + { + return Data::decode($value, 'yaml'); + } + + /** + * Encodes an array into a JSON string + */ + protected function valueToJson( + array|null $value = null, + bool $pretty = false + ): string { + $constants = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; + + if ($pretty === true) { + $constants |= JSON_PRETTY_PRINT; + } + + return json_encode($value, $constants); + } + + /** + * Encodes an array into a YAML string + */ + protected function valueToYaml(array|null $value = null): string + { + return Data::encode($value, 'yaml'); + } +} diff --git a/src/Form/Validations.php b/src/Form/Validations.php index f72cfbed1a..0aebbbadfd 100644 --- a/src/Form/Validations.php +++ b/src/Form/Validations.php @@ -24,7 +24,7 @@ class Validations */ public static function boolean($field, $value): bool { - if ($field->isEmpty($value) === false) { + if ($field->isEmptyValue($value) === false) { if (is_bool($value) === false) { throw new InvalidArgumentException( key: 'validation.boolean' @@ -42,7 +42,7 @@ public static function boolean($field, $value): bool */ public static function date(Field|FieldClass $field, mixed $value): bool { - if ($field->isEmpty($value) === false) { + if ($field->isEmptyValue($value) === false) { if (V::date($value) !== true) { throw new InvalidArgumentException( message: V::message('date', $value) @@ -60,7 +60,7 @@ public static function date(Field|FieldClass $field, mixed $value): bool */ public static function email(Field|FieldClass $field, mixed $value): bool { - if ($field->isEmpty($value) === false) { + if ($field->isEmptyValue($value) === false) { if (V::email($value) === false) { throw new InvalidArgumentException( message: V::message('email', $value) @@ -79,7 +79,7 @@ public static function email(Field|FieldClass $field, mixed $value): bool public static function max(Field|FieldClass $field, mixed $value): bool { if ( - $field->isEmpty($value) === false && + $field->isEmptyValue($value) === false && $field->max() !== null ) { if (V::max($value, $field->max()) === false) { @@ -100,7 +100,7 @@ public static function max(Field|FieldClass $field, mixed $value): bool public static function maxlength(Field|FieldClass $field, mixed $value): bool { if ( - $field->isEmpty($value) === false && + $field->isEmptyValue($value) === false && $field->maxlength() !== null ) { if (V::maxLength($value, $field->maxlength()) === false) { @@ -121,7 +121,7 @@ public static function maxlength(Field|FieldClass $field, mixed $value): bool public static function min(Field|FieldClass $field, mixed $value): bool { if ( - $field->isEmpty($value) === false && + $field->isEmptyValue($value) === false && $field->min() !== null ) { if (V::min($value, $field->min()) === false) { @@ -142,7 +142,7 @@ public static function min(Field|FieldClass $field, mixed $value): bool public static function minlength(Field|FieldClass $field, mixed $value): bool { if ( - $field->isEmpty($value) === false && + $field->isEmptyValue($value) === false && $field->minlength() !== null ) { if (V::minLength($value, $field->minlength()) === false) { @@ -162,7 +162,7 @@ public static function minlength(Field|FieldClass $field, mixed $value): bool */ public static function pattern(Field|FieldClass $field, mixed $value): bool { - if ($field->isEmpty($value) === false) { + if ($field->isEmptyValue($value) === false) { if ($pattern = $field->pattern()) { // ensure that that pattern needs to match the whole // input value from start to end, not just a partial match @@ -189,8 +189,8 @@ public static function required(Field|FieldClass $field, mixed $value): bool { if ( $field->isRequired() === true && - $field->save() === true && - $field->isEmpty($value) === true + $field->isSaveable() === true && + $field->isEmptyValue($value) === true ) { throw new InvalidArgumentException( key: 'validation.required' @@ -207,7 +207,7 @@ public static function required(Field|FieldClass $field, mixed $value): bool */ public static function option(Field|FieldClass $field, mixed $value): bool { - if ($field->isEmpty($value) === false) { + if ($field->isEmptyValue($value) === false) { $values = array_column($field->options(), 'value'); if (in_array($value, $values, true) !== true) { @@ -227,7 +227,7 @@ public static function option(Field|FieldClass $field, mixed $value): bool */ public static function options(Field|FieldClass $field, mixed $value): bool { - if ($field->isEmpty($value) === false) { + if ($field->isEmptyValue($value) === false) { $values = array_column($field->options(), 'value'); foreach ($value as $val) { if (in_array($val, $values, true) === false) { @@ -248,7 +248,7 @@ public static function options(Field|FieldClass $field, mixed $value): bool */ public static function time(Field|FieldClass $field, mixed $value): bool { - if ($field->isEmpty($value) === false) { + if ($field->isEmptyValue($value) === false) { if (V::time($value) !== true) { throw new InvalidArgumentException( message: V::message('time', $value) @@ -266,7 +266,7 @@ public static function time(Field|FieldClass $field, mixed $value): bool */ public static function url(Field|FieldClass $field, mixed $value): bool { - if ($field->isEmpty($value) === false) { + if ($field->isEmptyValue($value) === false) { if (V::url($value) === false) { throw new InvalidArgumentException( message: V::message('url', $value) diff --git a/tests/Form/FieldTest.php b/tests/Form/FieldTest.php index f11d6ee2ec..7942d00490 100644 --- a/tests/Form/FieldTest.php +++ b/tests/Form/FieldTest.php @@ -558,34 +558,9 @@ public function testIsEmpty($value, $expected) ]); $this->assertSame($expected, $field->isEmpty()); - $this->assertSame($expected, $field->isEmpty($value)); $this->assertSame($expected, $field->isEmptyValue($value)); } - /** - * @covers ::isEmpty - * @covers ::isEmptyValue - */ - public function testIsEmptyWithCustomFunction() - { - Field::$types = [ - 'test' => [ - 'isEmpty' => fn ($value) => $value === 0 - ] - ]; - - $page = new Page(['slug' => 'test']); - - $field = new Field('test', [ - 'model' => $page - ]); - - $this->assertFalse($field->isEmpty(null)); - $this->assertFalse($field->isEmptyValue(null)); - $this->assertTrue($field->isEmpty(0)); - $this->assertTrue($field->isEmptyValue(0)); - } - /** * @covers ::isHidden */ From eb61d94c34a50efe432965e72325be760b94a43e Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 18 Oct 2024 11:44:34 +0200 Subject: [PATCH 152/362] Move needsValue to the Value mixin --- src/Form/Mixin/Value.php | 22 ++++++++++++++++++++++ src/Form/Mixin/When.php | 22 ---------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/Form/Mixin/Value.php b/src/Form/Mixin/Value.php index 499808fd15..4b02665db2 100644 --- a/src/Form/Mixin/Value.php +++ b/src/Form/Mixin/Value.php @@ -47,6 +47,28 @@ public function isEmptyValue(mixed $value = null): bool return in_array($value, [null, '', []], true); } + /** + * Checks if the field needs a value before being saved; + * this is the case if all of the following requirements are met: + * - The field is saveable + * - The field is required + * - The field is currently empty + * - The field is not currently inactive because of a `when` rule + */ + protected function needsValue(): bool + { + if ( + $this->isSaveable() === false || + $this->isRequired() === false || + $this->isEmpty() === false || + $this->isActive() === false + ) { + return false; + } + + return true; + } + /** * Returns the value of the field if saveable * otherwise it returns null diff --git a/src/Form/Mixin/When.php b/src/Form/Mixin/When.php index d723fa6bd5..1bc18c921a 100644 --- a/src/Form/Mixin/When.php +++ b/src/Form/Mixin/When.php @@ -40,28 +40,6 @@ public function isActive(): bool return true; } - /** - * Checks if the field needs a value before being saved; - * this is the case if all of the following requirements are met: - * - The field is saveable - * - The field is required - * - The field is currently empty - * - The field is not currently inactive because of a `when` rule - */ - protected function needsValue(): bool - { - if ( - $this->isSaveable() === false || - $this->isRequired() === false || - $this->isEmpty() === false || - $this->isActive() === false - ) { - return false; - } - - return true; - } - /** * Setter for the `when` condition */ From 042ba134ece15fe29cc9770022c88d31e4f3d4b5 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Sat, 19 Oct 2024 16:51:06 +0200 Subject: [PATCH 153/362] Move ::data and ::store to Value mixin and make ::store protected --- src/Form/Field.php | 43 ++++++++++++++++------------------- src/Form/FieldClass.php | 23 ------------------- src/Form/Mixin/Value.php | 40 ++++++++++++++++++++++++++++---- tests/Form/FieldClassTest.php | 7 ++++-- 4 files changed, 59 insertions(+), 54 deletions(-) diff --git a/src/Form/Field.php b/src/Form/Field.php index 1570641814..a397ab8713 100644 --- a/src/Form/Field.php +++ b/src/Form/Field.php @@ -79,30 +79,6 @@ public function __construct( $this->siblings = $siblings ?? new Fields([$this]); } - /** - * @deprecated 3.5.0 - * @todo remove when the general field class setup has been refactored - * - * Returns the field data - * in a format to be stored - * in Kirby's content fields - */ - public function data(bool $default = false): mixed - { - $save = $this->options['save'] ?? true; - $value = $this->value($default); - - if ($save === false) { - return null; - } - - if ($save instanceof Closure) { - return $save->call($this, $value); - } - - return $value; - } - /** * Default props and computed of the field */ @@ -389,6 +365,25 @@ protected function siblingsCollection(): Fields return $this->siblings; } + /** + * Converts the given value to a value + * that can be stored in the text file + */ + protected function store(mixed $value): mixed + { + $store = $this->options['save'] ?? true; + + if ($store === false) { + return null; + } + + if ($store instanceof Closure) { + return $store->call($this, $value); + } + + return $value; + } + /** * Converts the field to a plain array */ diff --git a/src/Form/FieldClass.php b/src/Form/FieldClass.php index eaa330f529..43e01fe05e 100644 --- a/src/Form/FieldClass.php +++ b/src/Form/FieldClass.php @@ -94,19 +94,6 @@ public function before(): string|null return $this->stringTemplate($this->before); } - /** - * @deprecated 3.5.0 - * @todo remove when the general field class setup has been refactored - * - * Returns the field data - * in a format to be stored - * in Kirby's content fields - */ - public function data(bool $default = false): mixed - { - return $this->store($this->value($default)); - } - /** * Returns optional dialog routes for the field */ @@ -202,7 +189,6 @@ public function label(): string ); } - /** * Returns the field name */ @@ -364,15 +350,6 @@ protected function stringTemplate(string|null $string = null): string|null return null; } - /** - * Converts the given value to a value - * that can be stored in the text file - */ - public function store(mixed $value): mixed - { - return $value; - } - /** * Should the field be translatable? */ diff --git a/src/Form/Mixin/Value.php b/src/Form/Mixin/Value.php index 4b02665db2..3d201df898 100644 --- a/src/Form/Mixin/Value.php +++ b/src/Form/Mixin/Value.php @@ -15,12 +15,16 @@ trait Value { /** - * @deprecated 3.5.0 + * @deprecated 3.5.0 Use `::toStoredValue()` instead * @todo remove when the general field class setup has been refactored - * - * Returns the field data - * in a format to be stored - * in Kirby's content fields + */ + public function data(bool $default = false): mixed + { + return $this->toStoredValue($default); + } + + /** + * Returns the default value of the field */ public function default(): mixed { @@ -69,6 +73,32 @@ protected function needsValue(): bool return true; } + /** + * Converts the given value to a value + * that can be stored in the text file + */ + protected function store(mixed $value): mixed + { + return $value; + } + + /** + * Returns the value of the field in a format to be used in forms + * @alias for `::value()` + */ + public function toFormValue(bool $default = false): mixed + { + return $this->value($default); + } + + /** + * Returns the value of the field in a format to be stored by our storage classes + */ + public function toStoredValue(bool $default = false): mixed + { + return $this->store($this->value($default)); + } + /** * Returns the value of the field if saveable * otherwise it returns null diff --git a/tests/Form/FieldClassTest.php b/tests/Form/FieldClassTest.php index d5d2704004..4437585e98 100644 --- a/tests/Form/FieldClassTest.php +++ b/tests/Form/FieldClassTest.php @@ -548,11 +548,14 @@ public function testSiblings() /** * @covers ::store + * @covers ::toStoredValue */ - public function testStore() + public function testToStoredValue() { $field = new TestField(); - $this->assertSame('test', $field->store('test')); + $field->fill('test'); + + $this->assertSame('test', $field->toStoredValue()); } /** From df0828d84a166896a62a091e7c2c01d9ee70802b Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Sat, 19 Oct 2024 16:51:29 +0200 Subject: [PATCH 154/362] Make ::store protected in other field classes --- src/Form/Field/BlocksField.php | 2 +- src/Form/Field/LayoutField.php | 2 +- tests/Form/Fields/BlocksFieldTest.php | 27 ++++++++++++++++----------- tests/Form/Fields/LayoutFieldTest.php | 13 ++++++++----- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/Form/Field/BlocksField.php b/src/Form/Field/BlocksField.php index b5a341a9d6..9fa3ba9d8b 100644 --- a/src/Form/Field/BlocksField.php +++ b/src/Form/Field/BlocksField.php @@ -238,7 +238,7 @@ public function routes(): array ]; } - public function store(mixed $value): mixed + protected function store(mixed $value): mixed { $blocks = $this->blocksToValues((array)$value, 'content'); diff --git a/src/Form/Field/LayoutField.php b/src/Form/Field/LayoutField.php index 8d8e70c499..73f1726c28 100644 --- a/src/Form/Field/LayoutField.php +++ b/src/Form/Field/LayoutField.php @@ -267,7 +267,7 @@ public function settings(): Fieldset|null return $this->settings; } - public function store(mixed $value): mixed + protected function store(mixed $value): mixed { $value = Layouts::factory($value, ['parent' => $this->model])->toArray(); diff --git a/tests/Form/Fields/BlocksFieldTest.php b/tests/Form/Fields/BlocksFieldTest.php index c4a6b69c78..9e7275079b 100644 --- a/tests/Form/Fields/BlocksFieldTest.php +++ b/tests/Form/Fields/BlocksFieldTest.php @@ -114,12 +114,13 @@ public function testPretty() $expected = [ [ - 'id' => 'uuid', - 'type' => 'heading', 'content' => [ 'level' => '', 'text' => 'A nice block/heäding' - ] + ], + 'id' => 'uuid', + 'isHidden' => false, + 'type' => 'heading', ], ]; @@ -131,7 +132,7 @@ public function testPretty() $pretty = json_encode($expected, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); $this->assertTrue($field->pretty()); - $this->assertSame($pretty, $field->store($value)); + $this->assertSame($pretty, $field->toStoredValue()); } public function testProps() @@ -279,7 +280,7 @@ public function testRouteFieldset() $this->assertSame('text', $response['type']); } - public function testStore() + public function testToStoredValue() { $value = [ [ @@ -293,12 +294,13 @@ public function testStore() $expected = [ [ - 'id' => 'uuid', - 'type' => 'heading', 'content' => [ 'level' => '', 'text' => 'A nice block/heäding' - ] + ], + 'id' => 'uuid', + 'isHidden' => false, + 'type' => 'heading', ], ]; @@ -308,12 +310,15 @@ public function testStore() $this->assertSame( json_encode($expected, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), - $field->store($value) + $field->toStoredValue() ); // empty tests - $this->assertSame('', $field->store(null)); - $this->assertSame('', $field->store([])); + $field->fill(null); + $this->assertSame('', $field->toStoredValue()); + + $field->fill([]); + $this->assertSame('', $field->toStoredValue()); } public function testTranslateField() diff --git a/tests/Form/Fields/LayoutFieldTest.php b/tests/Form/Fields/LayoutFieldTest.php index c287d09b89..1859136d47 100644 --- a/tests/Form/Fields/LayoutFieldTest.php +++ b/tests/Form/Fields/LayoutFieldTest.php @@ -128,8 +128,8 @@ public function testRoutes() $this->assertIsArray($routes); $this->assertCount(7, $routes); } - - public function testStore() + + public function testToStoredValue() { $value = [ [ @@ -162,7 +162,7 @@ public function testStore() 'value' => $value ]); - $store = $field->store($value); + $store = $field->toStoredValue(); $this->assertIsString($store); // ensure that the Unicode characters and slashes are not encoded @@ -178,8 +178,11 @@ public function testStore() $this->assertSame('A nice block/heäding', $result[0]['columns'][0]['blocks'][0]['content']['text']); // empty tests - $this->assertSame('', $field->store(null)); - $this->assertSame('', $field->store([])); + $field->fill(null); + $this->assertSame('', $field->toStoredValue()); + + $field->fill([]); + $this->assertSame('', $field->toStoredValue()); } public function testValidations() From cc1a45c95db4f24e89163d3e05ea93b83daa2aca Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Sat, 19 Oct 2024 16:55:35 +0200 Subject: [PATCH 155/362] New Fields::toFormValues and Fields::toStoredValues --- src/Form/Fields.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Form/Fields.php b/src/Form/Fields.php index bed886db57..ee9ee268ca 100644 --- a/src/Form/Fields.php +++ b/src/Form/Fields.php @@ -162,4 +162,20 @@ public function toArray(Closure|null $map = null): array { return A::map($this->data, $map ?? fn ($field) => $field->toArray()); } + + /** + * Returns an array with the form value of each field + */ + public function toFormValues(bool $defaults = false): array + { + return $this->toArray(fn ($field) => $field->toFormValue($defaults)); + } + + /** + * Returns an array with the stored value of each field + */ + public function toStoredValues(bool $defaults = false): array + { + return $this->toArray(fn ($field) => $field->toStoredValue($defaults)); + } } From 8415ac2ebafb1a513ea19fb5e46c556e60c9376d Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 21 Oct 2024 13:15:37 +0200 Subject: [PATCH 156/362] New Form::toFormValues and Form::toStoredValues methods --- src/Form/Form.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Form/Form.php b/src/Form/Form.php index 45a0dee762..45ed62d14c 100644 --- a/src/Form/Form.php +++ b/src/Form/Form.php @@ -303,6 +303,22 @@ public function toArray(): array return $array; } + /** + * Returns an array with the form value of each field + */ + public function toFormValues(bool $defaults = false): array + { + return $this->fields->toFormValues($defaults); + } + + /** + * Returns an array with the stored value of each field + */ + public function toStoredValues(bool $defaults = false): array + { + return $this->fields->toStoredValues($defaults); + } + /** * Returns form values */ From 954e4629bbba139c45caac789592d342933c7f86 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 21 Oct 2024 13:38:18 +0200 Subject: [PATCH 157/362] Return null in the original store method to keep it aligned with the one in the Field class --- src/Form/Mixin/Value.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Form/Mixin/Value.php b/src/Form/Mixin/Value.php index 3d201df898..562839a737 100644 --- a/src/Form/Mixin/Value.php +++ b/src/Form/Mixin/Value.php @@ -79,6 +79,10 @@ protected function needsValue(): bool */ protected function store(mixed $value): mixed { + if ($this->isSaveable() === false) { + return null; + } + return $value; } From f40592ebad00672ee6e2c11d678bc8ade3a63eb7 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 21 Oct 2024 13:39:02 +0200 Subject: [PATCH 158/362] Use ::toStoredValue in the old Form::data method --- src/Form/Form.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Form/Form.php b/src/Form/Form.php index 45ed62d14c..3f0f288844 100644 --- a/src/Form/Form.php +++ b/src/Form/Form.php @@ -122,17 +122,17 @@ public function data($defaults = false, bool $includeNulls = true): array $data = $this->values; foreach ($this->fields as $field) { - if ($field->isSaveable() === false || $field->unset() === true) { - if ($includeNulls === true) { - $data[$field->name()] = null; - } else { - unset($data[$field->name()]); - } + if ($field->unset() === true) { + $data[$field->name()] = null; } else { - $data[$field->name()] = $field->data($defaults); + $data[$field->name()] = $field->toStoredValue($defaults); } } + if ($includeNulls === false) { + $data = array_filter($data, fn ($value) => $value !== null); + } + return $data; } @@ -276,12 +276,12 @@ protected static function prepareFieldsForLanguage( /** * Converts the data of fields to strings * - * @param false $defaults + * @deprecated 5.0.0 Use `::toStoredValues` instead */ public function strings($defaults = false): array { return A::map( - $this->data($defaults), + $this->toStoredValues($defaults), fn ($value) => match (true) { is_array($value) => Data::encode($value, 'yaml'), default => $value From de8009f0cdd04607c184f91a72fc8a507f7ef48d Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 21 Oct 2024 13:42:17 +0200 Subject: [PATCH 159/362] Revert the strings method refactoring until toStoredValues properly works --- src/Form/Form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Form/Form.php b/src/Form/Form.php index 3f0f288844..cdf389da1e 100644 --- a/src/Form/Form.php +++ b/src/Form/Form.php @@ -281,7 +281,7 @@ protected static function prepareFieldsForLanguage( public function strings($defaults = false): array { return A::map( - $this->toStoredValues($defaults), + $this->data($defaults), fn ($value) => match (true) { is_array($value) => Data::encode($value, 'yaml'), default => $value From 62d8958ca7e78bb0595581f79d47facecfee2692 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 21 Oct 2024 13:42:21 +0200 Subject: [PATCH 160/362] Fix CS issue --- tests/Form/Fields/LayoutFieldTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Form/Fields/LayoutFieldTest.php b/tests/Form/Fields/LayoutFieldTest.php index 1859136d47..9e0f1199ff 100644 --- a/tests/Form/Fields/LayoutFieldTest.php +++ b/tests/Form/Fields/LayoutFieldTest.php @@ -128,7 +128,7 @@ public function testRoutes() $this->assertIsArray($routes); $this->assertCount(7, $routes); } - + public function testToStoredValue() { $value = [ From 33cf8ec37b9bc4b888dbbb787f4b0aaae473028c Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 21 Oct 2024 14:03:49 +0200 Subject: [PATCH 161/362] Improve prop unsetting --- src/Toolkit/Component.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Toolkit/Component.php b/src/Toolkit/Component.php index ea6e629de9..7296456e71 100644 --- a/src/Toolkit/Component.php +++ b/src/Toolkit/Component.php @@ -149,6 +149,14 @@ public static function defaults(): array */ protected function applyProp(string $name, mixed $value): void { + // unset prop + if ($value === null) { + unset($this->props[$name]); + unset($this->$name); + return; + } + + // apply a prop via a closure if ($value instanceof Closure) { if (isset($this->attrs[$name]) === true) { try { @@ -170,6 +178,7 @@ protected function applyProp(string $name, mixed $value): void } } + // simple prop assignment by value $this->$name = $this->props[$name] = $value; } From 002f9c389362ddcbda05f2862b390e5eee667096 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 21 Oct 2024 15:11:05 +0200 Subject: [PATCH 162/362] New Translatable mixin --- src/Form/Field.php | 1 + src/Form/FieldClass.php | 15 +-------------- src/Form/Mixin/Translatable.php | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 14 deletions(-) create mode 100644 src/Form/Mixin/Translatable.php diff --git a/src/Form/Field.php b/src/Form/Field.php index a397ab8713..7b52168962 100644 --- a/src/Form/Field.php +++ b/src/Form/Field.php @@ -28,6 +28,7 @@ class Field extends Component use HasSiblings; use Mixin\Api; use Mixin\Model; + use Mixin\Translatable; use Mixin\Validation; use Mixin\When; use Mixin\Value { diff --git a/src/Form/FieldClass.php b/src/Form/FieldClass.php index 43e01fe05e..8134a3c48a 100644 --- a/src/Form/FieldClass.php +++ b/src/Form/FieldClass.php @@ -25,6 +25,7 @@ abstract class FieldClass use HasSiblings; use Mixin\Api; use Mixin\Model; + use Mixin\Translatable; use Mixin\Validation; use Mixin\Value; use Mixin\When; @@ -41,7 +42,6 @@ abstract class FieldClass protected string|null $placeholder; protected bool $required; protected Fields $siblings; - protected bool $translate; protected mixed $value = null; protected string|null $width; @@ -317,11 +317,6 @@ protected function setSiblings(Fields|null $siblings = null): void $this->siblings = $siblings ?? new Fields([$this]); } - protected function setTranslate(bool $translate = true): void - { - $this->translate = $translate; - } - /** * Setter for the field width */ @@ -350,14 +345,6 @@ protected function stringTemplate(string|null $string = null): string|null return null; } - /** - * Should the field be translatable? - */ - public function translate(): bool - { - return $this->translate; - } - /** * Converts the field to a plain array */ diff --git a/src/Form/Mixin/Translatable.php b/src/Form/Mixin/Translatable.php new file mode 100644 index 0000000000..9ff58fbb10 --- /dev/null +++ b/src/Form/Mixin/Translatable.php @@ -0,0 +1,33 @@ + + * @link https://getkirby.com + * @copyright Bastian Allgeier + * @license https://opensource.org/licenses/MIT + */ +trait Translatable +{ + protected bool $translate = true; + + public function isTranslatable(): bool + { + return $this->translate; + } + + protected function setTranslate(bool $translate = true): void + { + $this->translate = $translate; + } + + /** + * Should the field be translatable? + */ + public function translate(): bool + { + return $this->translate; + } +} From 2f6258aee61902163e3f968df4cd9e42e8875393 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 24 Oct 2024 12:44:44 +0200 Subject: [PATCH 163/362] Fix CS issues --- src/Toolkit/Component.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Toolkit/Component.php b/src/Toolkit/Component.php index 7296456e71..54f9bb6ab0 100644 --- a/src/Toolkit/Component.php +++ b/src/Toolkit/Component.php @@ -151,8 +151,8 @@ protected function applyProp(string $name, mixed $value): void { // unset prop if ($value === null) { - unset($this->props[$name]); - unset($this->$name); + unset($this->props[$name], $this->$name); + return; } From 01ebc84fabfc2386a770d7cd4528918e0ef14946 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 24 Oct 2024 12:50:51 +0200 Subject: [PATCH 164/362] Fix unit tests --- src/Form/Form.php | 2 +- tests/Cms/Api/ApiTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Form/Form.php b/src/Form/Form.php index cdf389da1e..0eb692a8cc 100644 --- a/src/Form/Form.php +++ b/src/Form/Form.php @@ -179,7 +179,7 @@ public function field(string $name): Field|FieldClass } throw new NotFoundException( - message: 'No field could be loaded' + message: 'The field could not be found' ); } diff --git a/tests/Cms/Api/ApiTest.php b/tests/Cms/Api/ApiTest.php index 24fb274895..d1bc3e83fa 100644 --- a/tests/Cms/Api/ApiTest.php +++ b/tests/Cms/Api/ApiTest.php @@ -591,7 +591,7 @@ public function testFieldApiInvalidField() ]); $this->expectException(NotFoundException::class); - $this->expectExceptionMessage('The field "nonexists" could not be found'); + $this->expectExceptionMessage('The field could not be found'); $page = $app->page('test'); $app->api()->fieldApi($page, 'nonexists'); @@ -608,7 +608,7 @@ public function testFieldApiEmptyField() ]); $this->expectException(NotFoundException::class); - $this->expectExceptionMessage('No field could be loaded'); + $this->expectExceptionMessage('The field could not be found'); $page = $app->page('test'); $app->api()->fieldApi($page, ''); From 2604b9d94a8387183b46f25b8bff9caf7b781701 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 24 Oct 2024 13:53:03 +0200 Subject: [PATCH 165/362] Add Fields class unit tests --- tests/Form/FieldsTest.php | 69 +++++++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 18 deletions(-) diff --git a/tests/Form/FieldsTest.php b/tests/Form/FieldsTest.php index 670fe2583e..2d0a2f8260 100644 --- a/tests/Form/FieldsTest.php +++ b/tests/Form/FieldsTest.php @@ -28,13 +28,11 @@ public function testConstruct() $fields = new Fields([ 'a' => [ 'type' => 'text', - 'model' => $this->model ], 'b' => [ 'type' => 'text', - 'model' => $this->model ], - ]); + ], $this->model); $this->assertSame('a', $fields->first()->name()); $this->assertSame($this->model, $fields->first()->model()); @@ -70,15 +68,13 @@ public function testDefaults() $fields = new Fields([ 'a' => [ 'default' => 'a', - 'model' => $this->model, 'type' => 'text' ], 'b' => [ 'default' => 'b', - 'model' => $this->model, 'type' => 'text' ], - ]); + ], $this->model); $this->assertSame(['a' => 'a', 'b' => 'b'], $fields->defaults()); } @@ -92,17 +88,15 @@ public function testErrors() 'a' => [ 'label' => 'A', 'type' => 'text', - 'model' => $this->model, 'required' => true ], 'b' => [ 'label' => 'B', 'type' => 'text', - 'model' => $this->model, 'maxlength' => 3, 'value' => 'Too long' ], - ]); + ], $this->model); $this->assertSame([ 'a' => [ @@ -141,13 +135,11 @@ public function testErrorsWithoutErrors() $fields = new Fields([ 'a' => [ 'type' => 'text', - 'model' => $this->model ], 'b' => [ 'type' => 'text', - 'model' => $this->model ], - ]); + ], $this->model); $this->assertSame([], $fields->errors()); } @@ -160,15 +152,13 @@ public function testFill() $fields = new Fields([ 'a' => [ 'type' => 'text', - 'model' => $this->model, 'value' => 'A' ], 'b' => [ 'type' => 'text', - 'model' => $this->model, 'value' => 'B' ], - ]); + ], $this->model); $this->assertSame([ 'a' => 'A', @@ -238,14 +228,57 @@ public function testToArray() $fields = new Fields([ 'a' => [ 'type' => 'text', - 'model' => $this->model ], 'b' => [ 'type' => 'text', - 'model' => $this->model ], - ]); + ], $this->model); $this->assertSame(['a' => 'a', 'b' => 'b'], $fields->toArray(fn ($field) => $field->name())); } + + /** + * @covers ::toFormValues + */ + public function testToFormValues() + { + $fields = new Fields([ + 'a' => [ + 'type' => 'text', + 'value' => 'Value a' + ], + 'b' => [ + 'type' => 'text', + 'value' => 'Value b' + ], + ], $this->model); + + $this->assertSame(['a' => 'Value a', 'b' => 'Value b'], $fields->toFormValues()); + } + + /** + * @covers ::toStoredValues + */ + public function testToStoredValues() + { + Field::$types['test'] = [ + 'save' => function ($value) { + return $value . ' stored'; + } + ]; + + $fields = new Fields([ + 'a' => [ + 'type' => 'test', + 'value' => 'Value a' + ], + 'b' => [ + 'type' => 'test', + 'value' => 'Value b' + ], + ], $this->model); + + $this->assertSame(['a' => 'Value a', 'b' => 'Value b'], $fields->toFormValues()); + $this->assertSame(['a' => 'Value a stored', 'b' => 'Value b stored'], $fields->toStoredValues()); + } } From b11520cc0011a426abb17fe308abb2b1754346a8 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 24 Oct 2024 15:52:12 +0200 Subject: [PATCH 166/362] Clean up FormTest class --- tests/Form/FormTest.php | 504 ++++++++++++++++++++-------------------- 1 file changed, 249 insertions(+), 255 deletions(-) diff --git a/tests/Form/FormTest.php b/tests/Form/FormTest.php index ae4464df6a..011c8f0fa1 100644 --- a/tests/Form/FormTest.php +++ b/tests/Form/FormTest.php @@ -5,6 +5,7 @@ use Exception; use Kirby\Cms\App; use Kirby\Cms\File; +use Kirby\Cms\ModelWithContent; use Kirby\Cms\Page; use Kirby\TestCase; @@ -13,12 +14,34 @@ */ class FormTest extends TestCase { + public const TMP = KIRBY_TMP_DIR . '/Form.Form'; + + protected ModelWithContent $model; + + public function setUp(): void + { + $this->setUpSingleLanguage([ + 'children' => [ + [ + 'slug' => 'test' + ] + ] + ]); + + $this->model = $this->app->page('test'); + $this->setUpTmp(); + } + public function tearDown(): void { App::destroy(); + $this->tearDownTmp(); } - public function testDataWithoutFields() + /** + * @covers ::content + */ + public function testContent() { $form = new Form([ 'fields' => [], @@ -28,35 +51,37 @@ public function testDataWithoutFields() ] ]); - $this->assertSame($values, $form->data()); + $this->assertSame($values, $form->content()); } /** - * @covers ::exceptionField + * @covers ::content + * @covers ::data */ - public function testExceptionFieldDebug() + public function testContentAndDataFromUnsaveableFields() { - $exception = new Exception('This is an error'); - - $app = new App(); - $props = ['name' => 'test', 'model' => $app->site()]; - $field = Form::exceptionField($exception, $props)->toArray(); - $this->assertSame('info', $field['type']); - $this->assertSame('Error in "test" field.', $field['label']); - $this->assertSame('

This is an error

', $field['text']); - $this->assertSame('negative', $field['theme']); + $form = new Form([ + 'fields' => [ + 'info' => [ + 'type' => 'info', + ] + ], + 'model' => $this->model, + 'values' => [ + 'info' => 'Yay' + ] + ]); - $app = $app->clone(['options' => ['debug' => true]]); - $props = ['name' => 'test', 'model' => $app->site()]; - $field = Form::exceptionField($exception, $props)->toArray(); - $this->assertSame('info', $field['type']); - $this->assertSame('Error in "test" field.', $field['label']); - $this->assertStringContainsString('

This is an error in file:', $field['text']); - $this->assertStringContainsString('tests/Form/FormTest.php line: 39

', $field['text']); - $this->assertSame('negative', $field['theme']); + $this->assertCount(0, $form->content()); + $this->assertArrayNotHasKey('info', $form->content()); + $this->assertCount(1, $form->data()); + $this->assertArrayHasKey('info', $form->data()); } - public function testValuesWithoutFields() + /** + * @covers ::data + */ + public function testDataWithoutFields() { $form = new Form([ 'fields' => [], @@ -66,25 +91,21 @@ public function testValuesWithoutFields() ] ]); - $this->assertSame($values, $form->values()); + $this->assertSame($values, $form->data()); } + /** + * @covers ::data + */ public function testDataFromUnsaveableFields() { - new App([ - 'roots' => [ - 'index' => '/dev/null' - ] - ]); - - $page = new Page(['slug' => 'test']); $form = new Form([ 'fields' => [ 'info' => [ 'type' => 'info', - 'model' => $page ] ], + 'model' => $this->model, 'values' => [ 'info' => 'Yay' ] @@ -93,28 +114,23 @@ public function testDataFromUnsaveableFields() $this->assertNull($form->data()['info']); } + /** + * @covers ::data + */ public function testDataFromNestedFields() { - new App([ - 'roots' => [ - 'index' => '/dev/null' - ] - ]); - - $page = new Page(['slug' => 'test']); $form = new Form([ 'fields' => [ 'structure' => [ 'type' => 'structure', - 'model' => $page, 'fields' => [ 'tags' => [ 'type' => 'tags', - 'model' => $page ] ] ] ], + 'model' => $this->model, 'values' => $values = [ 'structure' => [ [ @@ -127,129 +143,146 @@ public function testDataFromNestedFields() $this->assertSame('a, b', $form->data()['structure'][0]['tags']); } - public function testInvalidFieldType() - { - new App([ - 'roots' => [ - 'index' => '/dev/null' - ] - ]); - - $page = new Page(['slug' => 'test']); - $form = new Form([ - 'fields' => [ - 'test' => [ - 'type' => 'does-not-exist', - 'model' => $page - ] - ] - ]); - - $field = $form->fields()->first(); - - $this->assertSame('info', $field->type()); - $this->assertSame('negative', $field->theme()); - $this->assertSame('Error in "test" field.', $field->label()); - $this->assertSame('

Field "test": The field type "does-not-exist" does not exist

', $field->text()); - } - - public function testFieldOrder() + /** + * @covers ::data + * @covers ::values + */ + public function testDataWithCorrectFieldOrder() { - new App([ - 'roots' => [ - 'index' => '/dev/null' - ] - ]); - - $page = new Page(['slug' => 'test']); $form = new Form([ 'fields' => [ 'a' => [ - 'type' => 'text', - 'model' => $page + 'type' => 'text', ], 'b' => [ - 'type' => 'text', - 'model' => $page + 'type' => 'text', ] ], + 'input' => [ + 'b' => 'B modified' + ], + 'model' => $this->model, 'values' => [ 'c' => 'C', 'b' => 'B', 'a' => 'A', ], - 'input' => [ - 'b' => 'B modified' - ] ]); - $this->assertTrue(['a' => 'A', 'b' => 'B modified', 'c' => 'C'] === $form->values()); $this->assertTrue(['a' => 'A', 'b' => 'B modified', 'c' => 'C'] === $form->data()); + $this->assertTrue(['a' => 'A', 'b' => 'B modified', 'c' => 'C'] === $form->values()); } - public function testStrictMode() + /** + * @covers ::data + * @covers ::values + */ + public function testDataWithStrictMode() { - new App([ - 'roots' => [ - 'index' => '/dev/null' - ] - ]); - - $page = new Page(['slug' => 'test']); $form = new Form([ 'fields' => [ 'a' => [ 'type' => 'text', - 'model' => $page ], 'b' => [ 'type' => 'text', - 'model' => $page ] ], + 'input' => [ + 'c' => 'C' + ], + 'model' => $this->model, + 'strict' => true, 'values' => [ 'b' => 'B', 'a' => 'A' ], - 'input' => [ - 'c' => 'C' - ], - 'strict' => true ]); - $this->assertTrue(['a' => 'A', 'b' => 'B'] === $form->values()); $this->assertTrue(['a' => 'A', 'b' => 'B'] === $form->data()); + $this->assertTrue(['a' => 'A', 'b' => 'B'] === $form->values()); } - public function testErrors() + /** + * @covers ::data + * @covers ::values + */ + public function testDataWithUntranslatedFields() { - new App([ - 'roots' => [ - 'index' => '/dev/null' + $this->setUpMultiLanguage(); + + $this->model = new Page([ + 'slug' => 'test', + 'blueprint' => [ + 'fields' => [ + 'a' => [ + 'type' => 'text' + ], + 'b' => [ + 'type' => 'text', + 'translate' => false + ] + ], ] ]); - $page = new Page(['slug' => 'test']); + // default language + $form = Form::for($this->model, [ + 'input' => [ + 'a' => 'A', + 'b' => 'B' + ] + ]); + + $expected = [ + 'a' => 'A', + 'b' => 'B' + ]; + + $this->assertSame($expected, $form->values()); + + // secondary language + $form = Form::for($this->model, [ + 'language' => 'de', + 'input' => [ + 'a' => 'A', + 'b' => 'B' + ] + ]); + + $expected = [ + 'a' => 'A', + 'b' => '' + ]; + + $this->assertSame($expected, $form->values()); + } + + /** + * @covers ::errors + * @covers ::isInvalid + * @covers ::isValid + */ + public function testErrors() + { $form = new Form([ 'fields' => [ 'a' => [ 'label' => 'Email', 'type' => 'email', - 'model' => $page ], 'b' => [ 'label' => 'Url', 'type' => 'url', - 'model' => $page ] ], + 'model' => $this->model, 'values' => [ 'a' => 'A', 'b' => 'B', ] ]); - $this->assertTrue($form->isInvalid()); $this->assertFalse($form->isValid()); @@ -274,106 +307,86 @@ public function testErrors() $this->assertSame($expected, $form->errors()); } - public function testToArray() + /** + * @covers ::exceptionField + */ + public function testExceptionField() { - new App([ - 'roots' => [ - 'index' => '/dev/null' - ] - ]); - - $page = new Page(['slug' => 'test']); $form = new Form([ 'fields' => [ - 'a' => [ - 'label' => 'A', - 'type' => 'text', - 'model' => $page - ], - 'b' => [ - 'label' => 'B', - 'type' => 'text', - 'model' => $page + 'test' => [ + 'type' => 'does-not-exist', + 'model' => $this->model ] - ], - 'values' => [ - 'a' => 'A', - 'b' => 'B', ] ]); - $this->assertSame([], $form->toArray()['errors']); - $this->assertArrayHasKey('a', $form->toArray()['fields']); - $this->assertArrayHasKey('b', $form->toArray()['fields']); - $this->assertCount(2, $form->toArray()['fields']); - $this->assertFalse($form->toArray()['invalid']); + $field = $form->fields()->first(); + + $this->assertSame('info', $field->type()); + $this->assertSame('negative', $field->theme()); + $this->assertSame('Error in "test" field.', $field->label()); + $this->assertSame('

Field "test": The field type "does-not-exist" does not exist

', $field->text()); } - public function testContent() + /** + * @covers ::exceptionField + */ + public function testExceptionFieldInDebugMode() { - $form = new Form([ - 'fields' => [], - 'values' => $values = [ - 'a' => 'A', - 'b' => 'B' - ] - ]); + $exception = new Exception('This is an error'); - $this->assertSame($values, $form->content()); - } + // debug mode off + $props = [ + 'name' => 'test', + 'model' => $this->app->site() + ]; - public function testContentFromUnsaveableFields() - { - new App([ - 'roots' => [ - 'index' => '/dev/null' - ] - ]); + $field = Form::exceptionField($exception, $props)->toArray(); + $this->assertSame('info', $field['type']); + $this->assertSame('Error in "test" field.', $field['label']); + $this->assertSame('

This is an error

', $field['text']); + $this->assertSame('negative', $field['theme']); - $page = new Page(['slug' => 'test']); - $form = new Form([ - 'fields' => [ - 'info' => [ - 'type' => 'info', - 'model' => $page - ] - ], - 'values' => [ - 'info' => 'Yay' - ] - ]); + // debug mode on + $this->app->clone(['options' => ['debug' => true]]); - $this->assertCount(0, $form->content()); - $this->assertArrayNotHasKey('info', $form->content()); - $this->assertCount(1, $form->data()); - $this->assertArrayHasKey('info', $form->data()); + $props = [ + 'name' => 'test', + 'model' => $this->app->site() + ]; + + $field = Form::exceptionField($exception, $props)->toArray(); + $this->assertSame('info', $field['type']); + $this->assertSame('Error in "test" field.', $field['label']); + $this->assertStringContainsString('

This is an error in file:', $field['text']); + $this->assertStringContainsString('tests/Form/FormTest.php line:', $field['text']); + $this->assertSame('negative', $field['theme']); } - public function testStrings() + /** + * @covers ::for + */ + public function testForFileWithoutBlueprint() { - $form = new Form([ - 'fields' => [], - 'values' => [ - 'a' => 'A', - 'b' => 'B', - 'c' => [ - 'd' => 'D', - 'e' => 'E' - ] - ] + $file = new File([ + 'filename' => 'test.jpg', + 'parent' => $this->model, + 'content' => [] ]); - $this->assertSame([ - 'a' => 'A', - 'b' => 'B', - 'c' => "d: D\ne: E\n" - ], $form->strings()); + $form = Form::for($file, [ + 'values' => ['a' => 'A', 'b' => 'B'] + ]); + + $this->assertSame(['a' => 'A', 'b' => 'B'], $form->data()); } - public function testPageForm() + /** + * @covers ::for + */ + public function testForPage() { - App::instance(); - $page = new Page([ 'slug' => 'test', 'content' => [ @@ -407,7 +420,10 @@ public function testPageForm() $this->assertSame('', $values['date']); } - public function testPageFormWithClosures() + /** + * @covers ::for + */ + public function testForPageWithClosureValues() { $page = new Page([ 'slug' => 'test', @@ -429,95 +445,73 @@ public function testPageFormWithClosures() $this->assertSame('B', $values['b']); } - public function testFileFormWithoutBlueprint() + /** + * @covers ::strings + */ + public function testStrings() { - new App([ - 'roots' => [ - 'index' => '/dev/null' + $form = new Form([ + 'fields' => [], + 'values' => [ + 'a' => 'A', + 'b' => 'B', + 'c' => [ + 'd' => 'D', + 'e' => 'E' + ] ] ]); - $page = new Page([ - 'slug' => 'test' - ]); - - $file = new File([ - 'filename' => 'test.jpg', - 'parent' => $page, - 'content' => [] - ]); - - $form = Form::for($file, [ - 'values' => ['a' => 'A', 'b' => 'B'] - ]); - - $this->assertSame(['a' => 'A', 'b' => 'B'], $form->data()); + $this->assertSame([ + 'a' => 'A', + 'b' => 'B', + 'c' => "d: D\ne: E\n" + ], $form->strings()); } - public function testUntranslatedFields() + /** + * @covers ::toArray + */ + public function testToArray() { - $app = new App([ - 'roots' => [ - 'index' => '/dev/null' - ], - 'options' => [ - 'languages' => true - ], - 'languages' => [ - [ - 'code' => 'en', - 'default' => true + $form = new Form([ + 'fields' => [ + 'a' => [ + 'label' => 'A', + 'type' => 'text', ], - [ - 'code' => 'de' + 'b' => [ + 'label' => 'B', + 'type' => 'text', ] - ] - ]); - - $page = new Page([ - 'slug' => 'test', - 'blueprint' => [ - 'fields' => [ - 'a' => [ - 'type' => 'text' - ], - 'b' => [ - 'type' => 'text', - 'translate' => false - ] - ], - ] - ]); - - // default language - $form = Form::for($page, [ - 'input' => [ + ], + 'model' => $this->model, + 'values' => [ 'a' => 'A', - 'b' => 'B' + 'b' => 'B', ] ]); - $expected = [ - 'a' => 'A', - 'b' => 'B' - ]; - - $this->assertSame($expected, $form->values()); + $this->assertSame([], $form->toArray()['errors']); + $this->assertArrayHasKey('a', $form->toArray()['fields']); + $this->assertArrayHasKey('b', $form->toArray()['fields']); + $this->assertCount(2, $form->toArray()['fields']); + $this->assertFalse($form->toArray()['invalid']); + } - // secondary language - $form = Form::for($page, [ - 'language' => 'de', - 'input' => [ + /** + * @covers ::values + */ + public function testValuesWithoutFields() + { + $form = new Form([ + 'fields' => [], + 'values' => $values = [ 'a' => 'A', 'b' => 'B' ] ]); - $expected = [ - 'a' => 'A', - 'b' => '' - ]; - - $this->assertSame($expected, $form->values()); + $this->assertSame($values, $form->values()); } } From d460bdb5b0db19c14f0ac9910aa3d7c2716173b7 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 24 Oct 2024 16:00:24 +0200 Subject: [PATCH 167/362] Add unit tests for toStoredValues and toFormValues --- tests/Form/FormTest.php | 57 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/tests/Form/FormTest.php b/tests/Form/FormTest.php index 011c8f0fa1..fbe03ae956 100644 --- a/tests/Form/FormTest.php +++ b/tests/Form/FormTest.php @@ -499,6 +499,63 @@ public function testToArray() $this->assertFalse($form->toArray()['invalid']); } + /** + * @covers ::toFormValues + */ + public function testToFormValues() + { + $form = new Form([ + 'fields' => [ + 'a' => [ + 'type' => 'text', + ], + 'b' => [ + 'type' => 'text', + ] + ], + 'values' => $values = [ + 'a' => 'A', + 'b' => 'B', + ] + ]); + + $this->assertSame($values, $form->toFormValues()); + } + + /** + * @covers ::toStoredValues + */ + public function testToStoredValues() + { + Field::$types['test'] = [ + 'save' => function ($value) { + return $value . ' stored'; + } + ]; + + $form = new Form([ + 'fields' => [ + 'a' => [ + 'type' => 'test', + ], + 'b' => [ + 'type' => 'test', + ] + ], + 'values' => [ + 'a' => 'A', + 'b' => 'B', + ] + ]); + + $expected = [ + 'a' => 'A stored', + 'b' => 'B stored' + ]; + + $this->assertSame($expected, $form->toStoredValues()); + } + /** * @covers ::values */ From 899ccbe0f26816157e315296602b62bfb50255cf Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 24 Oct 2024 16:05:02 +0200 Subject: [PATCH 168/362] =?UTF-8?q?Remove=20isTranslatable=20for=20now=20u?= =?UTF-8?q?ntil=20it=E2=80=99s=20properly=20implemented?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Form/Mixin/Translatable.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Form/Mixin/Translatable.php b/src/Form/Mixin/Translatable.php index 9ff58fbb10..05d8cdf987 100644 --- a/src/Form/Mixin/Translatable.php +++ b/src/Form/Mixin/Translatable.php @@ -13,11 +13,9 @@ trait Translatable { protected bool $translate = true; - public function isTranslatable(): bool - { - return $this->translate; - } - + /** + * Set the translatable status + */ protected function setTranslate(bool $translate = true): void { $this->translate = $translate; From 44f0118530c28355d48a7c2ee6ccea753eaa6170 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 24 Oct 2024 16:13:43 +0200 Subject: [PATCH 169/362] Add unit tests for Field::toStoredValue and Field::toFormValue --- tests/Form/FieldTest.php | 151 +++++++++++++++++++++------------------ 1 file changed, 82 insertions(+), 69 deletions(-) diff --git a/tests/Form/FieldTest.php b/tests/Form/FieldTest.php index 7942d00490..e26ef71421 100644 --- a/tests/Form/FieldTest.php +++ b/tests/Form/FieldTest.php @@ -181,51 +181,6 @@ public function testBefore() $this->assertSame('blog', $field->before); } - /** - * @covers ::data - */ - public function testData() - { - Field::$types = [ - 'test' => [ - 'props' => [ - 'value' => fn ($value) => $value - ], - 'save' => fn ($value) => implode(', ', $value) - ] - ]; - - $page = new Page(['slug' => 'test']); - - $field = new Field('test', [ - 'model' => $page, - 'value' => ['a', 'b', 'c'] - ]); - - $this->assertSame('a, b, c', $field->data()); - } - - /** - * @covers ::data - */ - public function testDataWhenUnsaveable() - { - Field::$types = [ - 'test' => [ - 'save' => false - ] - ]; - - $model = new Page(['slug' => 'test']); - - $field = new Field('test', [ - 'model' => $model, - 'value' => 'something' - ]); - - $this->assertNull($field->data()); - } - public function testDefault() { Field::$types = [ @@ -1068,6 +1023,88 @@ public function testToArray() $this->assertArrayNotHasKey('model', $array); } + /** + * @covers ::toFormValue + * @covers ::value + */ + public function testToFormValue() + { + Field::$types['test'] = []; + + $field = new Field('test'); + $this->assertNull($field->toFormValue()); + $this->assertNull($field->value()); + + $field = new Field('test', ['value' => 'Test']); + $this->assertSame('Test', $field->toFormValue()); + $this->assertSame('Test', $field->value()); + + $field = new Field('test', ['default' => 'Default value']); + $this->assertNull($field->toFormValue()); + $this->assertNull($field->value()); + + $field = new Field('test', ['default' => 'Default value']); + $this->assertSame('Default value', $field->toFormValue(true)); + $this->assertSame('Default value', $field->value(true)); + + Field::$types['test'] = [ + 'save' => false + ]; + + $field = new Field('test', ['value' => 'Test']); + $this->assertNull($field->toFormValue()); + $this->assertNull($field->value()); + } + + /** + * @covers ::toStoredValue + * @covers ::data + */ + public function testToStoredValue() + { + Field::$types = [ + 'test' => [ + 'props' => [ + 'value' => fn ($value) => $value + ], + 'save' => fn ($value) => implode(', ', $value) + ] + ]; + + $page = new Page(['slug' => 'test']); + + $field = new Field('test', [ + 'model' => $page, + 'value' => ['a', 'b', 'c'] + ]); + + $this->assertSame('a, b, c', $field->toStoredValue()); + $this->assertSame('a, b, c', $field->data()); + } + + /** + * @covers ::toStoredValue + * @covers ::data + */ + public function testToStoredValueWhenUnsaveable() + { + Field::$types = [ + 'test' => [ + 'save' => false + ] + ]; + + $model = new Page(['slug' => 'test']); + + $field = new Field('test', [ + 'model' => $model, + 'value' => 'something' + ]); + + $this->assertNull($field->toStoredValue()); + $this->assertNull($field->data()); + } + /** * @covers ::validate * @covers ::validations @@ -1214,30 +1251,6 @@ public function testValidateWithCustomValidator() $this->assertSame(['test' => 'Invalid value: abc'], $field->errors()); } - public function testValue() - { - Field::$types['test'] = []; - - $field = new Field('test'); - $this->assertNull($field->value()); - - $field = new Field('test', ['value' => 'Test']); - $this->assertSame('Test', $field->value()); - - $field = new Field('test', ['default' => 'Default value']); - $this->assertNull($field->value()); - - $field = new Field('test', ['default' => 'Default value']); - $this->assertSame('Default value', $field->value(true)); - - Field::$types['test'] = [ - 'save' => false - ]; - - $field = new Field('test', ['value' => 'Test']); - $this->assertNull($field->value()); - } - public function testWidth() { Field::$types = [ From bf4c4e7413e888ad6db4b085a4344b2bd4fa6810 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 24 Oct 2024 17:01:49 +0200 Subject: [PATCH 170/362] Additional unit tests --- tests/Form/FieldTest.php | 94 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/tests/Form/FieldTest.php b/tests/Form/FieldTest.php index e26ef71421..995d6dc901 100644 --- a/tests/Form/FieldTest.php +++ b/tests/Form/FieldTest.php @@ -4,6 +4,7 @@ use Kirby\Cms\App; use Kirby\Cms\Page; +use Kirby\Data\Data; use Kirby\Exception\InvalidArgumentException; use Kirby\TestCase; @@ -1058,6 +1059,7 @@ public function testToFormValue() /** * @covers ::toStoredValue + * @covers ::store * @covers ::data */ public function testToStoredValue() @@ -1084,6 +1086,7 @@ public function testToStoredValue() /** * @covers ::toStoredValue + * @covers ::store * @covers ::data */ public function testToStoredValueWhenUnsaveable() @@ -1277,4 +1280,95 @@ public function testWidth() $this->assertSame('1/2', $field->width); } + /** + * @covers ::valueFromJson + */ + public function testValueFromJson() + { + // no defined as default + Field::$types = [ + 'test' => [ + 'props' => [ + 'value' => function (string $value): array { + return $this->valueFromJson($value); + } + ] + ] + ]; + + $field = new Field('test', [ + 'model' => $model = new Page(['slug' => 'test']), + 'value' => json_encode($value = ['a' => 'A']) + ]); + + $this->assertSame($value, $field->toFormValue()); + } + + /** + * @covers ::valueFromYaml + */ + public function testValueFromYaml() + { + // no defined as default + Field::$types = [ + 'test' => [ + 'props' => [ + 'value' => function (string $value): array { + return $this->valueFromYaml($value); + } + ] + ] + ]; + + $field = new Field('test', [ + 'model' => $model = new Page(['slug' => 'test']), + 'value' => Data::encode($value = ['a' => 'A'], 'yml') + ]); + + $this->assertSame($value, $field->toFormValue()); + } + + /** + * @covers ::valueToJson + */ + public function testValueToJson() + { + // no defined as default + Field::$types = [ + 'test' => [ + 'save' => function (array $value): string { + return $this->valueToJson($value); + } + ] + ]; + + $field = new Field('test', [ + 'model' => $model = new Page(['slug' => 'test']), + 'value' => ['a' => 'A'] + ]); + + $this->assertSame('{"a":"A"}', $field->toStoredValue()); + } + + /** + * @covers ::valueToYaml + */ + public function testValueToYaml() + { + // no defined as default + Field::$types = [ + 'test' => [ + 'save' => function (array $value): string { + return $this->valueToYaml($value); + } + ] + ]; + + $field = new Field('test', [ + 'model' => $model = new Page(['slug' => 'test']), + 'value' => ['a' => 'A'] + ]); + + $this->assertSame("a: A\n", $field->toStoredValue()); + } } From 169e1e235484546f6cc07c07aff66fac89b3c581 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Tue, 5 Nov 2024 17:09:44 +0100 Subject: [PATCH 171/362] `Version::isIdentical()` --- src/Api/Controller/Changes.php | 2 +- src/Content/Version.php | 71 ++++++---- tests/Content/VersionTest.php | 230 +++++++++++++++------------------ 3 files changed, 153 insertions(+), 150 deletions(-) diff --git a/src/Api/Controller/Changes.php b/src/Api/Controller/Changes.php index d283088bb5..19ae55dc91 100644 --- a/src/Api/Controller/Changes.php +++ b/src/Api/Controller/Changes.php @@ -87,7 +87,7 @@ public static function save(ModelWithContent $model, array $input): array language: 'current' ); - if ($latest->diff(version: $changes, language: 'current') === []) { + if ($changes->isIdentical(version: $latest, language: 'current')) { $changes->delete(); } diff --git a/src/Content/Version.php b/src/Content/Version.php index 2fad2bd109..93228f09ff 100644 --- a/src/Content/Version.php +++ b/src/Content/Version.php @@ -130,32 +130,6 @@ public function delete(Language|string $language = 'default'): void } } - /** - * Returns the changed fields, compared to the given version - */ - public function diff( - Version|VersionId|string $version, - Language|string $language = 'default' - ): array { - if (is_string($version) === true) { - $version = VersionId::from($version); - } - - if ($version instanceof VersionId) { - $version = $this->model->version($version); - } - - - if ($version->id()->is($this->id) === true) { - return []; - } - - $a = $this->content($language)->toArray(); - $b = $version->content($language)->toArray(); - - return array_diff_assoc($b, $a); - } - /** * Checks if a version exists for the given language */ @@ -187,6 +161,51 @@ public function id(): VersionId return $this->id; } + /** + * Returns whether the content of both versions + * is identical + */ + public function isIdentical( + Version|VersionId|string $version, + Language|string $language = 'default' + ): bool { + if (is_string($version) === true) { + $version = VersionId::from($version); + } + + if ($version instanceof VersionId) { + $version = $this->model->version($version); + } + + + if ($version->id()->is($this->id) === true) { + return true; + } + + $language = Language::ensure($language); + + // read fields low-level from storage + $a = $this->read($language) ?? []; + $b = $version->read($language) ?? []; + + // apply same preparation as for content + $a = $this->prepareFieldsForContent($a, $language); + $b = $this->prepareFieldsForContent($b, $language); + + // remove additional fields that should not be + // considered in the comparison + unset( + $a['uuid'], + $b['uuid'] + ); + + // ensure both arrays of fields are sorted the same + ksort($a); + ksort($b); + + return $a === $b; + } + /** * Checks if the version is the latest version */ diff --git a/tests/Content/VersionTest.php b/tests/Content/VersionTest.php index 391825422c..f59d12b50d 100644 --- a/tests/Content/VersionTest.php +++ b/tests/Content/VersionTest.php @@ -321,9 +321,102 @@ public function testDeleteSingleLanguage(): void } /** - * @covers ::diff + * @covers ::exists */ - public function testDiffMultiLanguage() + public function testExistsLatestMultiLanguage(): void + { + $this->setUpMultiLanguage(); + + $version = new Version( + model: $this->model, + id: VersionId::latest() + ); + + $this->assertDirectoryExists($this->model->root()); + + // the default version + default language exists without + // content file as long as the page directory exists + $this->assertTrue($version->exists('en')); + $this->assertTrue($version->exists($this->app->language('en'))); + + // the secondary language only exists as soon as the content + // file also exists + $this->assertFalse($version->exists('de')); + $this->assertFalse($version->exists($this->app->language('de'))); + + $this->createContentMultiLanguage(); + + $this->assertTrue($version->exists('de')); + $this->assertTrue($version->exists($this->app->language('de'))); + } + + /** + * @covers ::exists + */ + public function testExistsWithLanguageWildcard(): void + { + $this->setUpMultiLanguage(); + + $version = new Version( + model: $this->model, + id: VersionId::latest() + ); + + $this->createContentMultiLanguage(); + + $this->assertTrue($version->exists('en')); + $this->assertTrue($version->exists('de')); + $this->assertTrue($version->exists('*')); + + // delete the German translation + $version->delete('de'); + + $this->assertTrue($version->exists('en')); + $this->assertFalse($version->exists('de')); + + // The wildcard should now still return true + // because the English translation still exists + $this->assertTrue($version->exists('*')); + } + + /** + * @covers ::exists + */ + public function testExistsLatestSingleLanguage(): void + { + $this->setUpSingleLanguage(); + + $version = new Version( + model: $this->model, + id: VersionId::latest() + ); + + $this->assertDirectoryExists($this->model->root()); + + // the default version exists without content file as long as + // the page directory exists + $this->assertTrue($version->exists()); + } + + /** + * @covers ::id + */ + public function testId(): void + { + $this->setUpSingleLanguage(); + + $version = new Version( + model: $this->model, + id: $id = VersionId::latest() + ); + + $this->assertSame($id, $version->id()); + } + + /** + * @covers ::isIdentical + */ + public function testIsIdenticalMultiLanguage() { $this->setUpMultiLanguage(); @@ -352,22 +445,16 @@ public function testDiffMultiLanguage() ], 'de'); // no changes in English - $diffEN = $a->diff(VersionId::changes(), 'en'); - $expectedEN = []; - - $this->assertSame($expectedEN, $diffEN); + $this->assertTrue($a->isIdentical(VersionId::changes(), 'en')); // changed subtitle in German - $diffDE = $a->diff(VersionId::changes(), 'de'); - $expectedDE = ['subtitle' => 'Subtitle (changed)']; - - $this->assertSame($expectedDE, $diffDE); + $this->assertFalse($a->isIdentical(VersionId::changes(), 'de')); } /** - * @covers ::diff + * @covers ::isIdentical */ - public function testDiffSingleLanguage() + public function testIsIdenticalSingleLanguage() { $this->setUpSingleLanguage(); @@ -381,7 +468,7 @@ public function testDiffSingleLanguage() id: VersionId::changes() ); - $a->save([ + $a->save($content = [ 'title' => 'Title', 'subtitle' => 'Subtitle', ]); @@ -391,19 +478,13 @@ public function testDiffSingleLanguage() 'subtitle' => 'Subtitle (changed)', ]); - $diff = $a->diff('changes'); - - // the result array should contain the changed fields - // the changed values - $expected = ['subtitle' => 'Subtitle (changed)']; - - $this->assertSame($expected, $diff); + $this->assertFalse($a->isIdentical('changes')); } /** - * @covers ::diff + * @covers ::isIdentical */ - public function testDiffWithoutChanges() + public function testIsIdenticalWithoutChanges() { $this->setUpSingleLanguage(); @@ -427,15 +508,13 @@ public function testDiffWithoutChanges() 'subtitle' => 'Subtitle', ]); - $diff = $a->diff(VersionId::changes()); - - $this->assertSame([], $diff); + $this->assertTrue($a->isIdentical('changes')); } /** - * @covers ::diff + * @covers ::isIdentical */ - public function testDiffWithSameVersion() + public function testIsIdenticalWithSameVersion() { $this->setUpSingleLanguage(); @@ -449,102 +528,7 @@ public function testDiffWithSameVersion() 'subtitle' => 'Subtitle', ]); - $diff = $a->diff(VersionId::latest()); - - $this->assertSame([], $diff); - } - - /** - * @covers ::exists - */ - public function testExistsLatestMultiLanguage(): void - { - $this->setUpMultiLanguage(); - - $version = new Version( - model: $this->model, - id: VersionId::latest() - ); - - $this->assertDirectoryExists($this->model->root()); - - // the default version + default language exists without - // content file as long as the page directory exists - $this->assertTrue($version->exists('en')); - $this->assertTrue($version->exists($this->app->language('en'))); - - // the secondary language only exists as soon as the content - // file also exists - $this->assertFalse($version->exists('de')); - $this->assertFalse($version->exists($this->app->language('de'))); - - $this->createContentMultiLanguage(); - - $this->assertTrue($version->exists('de')); - $this->assertTrue($version->exists($this->app->language('de'))); - } - - /** - * @covers ::exists - */ - public function testExistsWithLanguageWildcard(): void - { - $this->setUpMultiLanguage(); - - $version = new Version( - model: $this->model, - id: VersionId::latest() - ); - - $this->createContentMultiLanguage(); - - $this->assertTrue($version->exists('en')); - $this->assertTrue($version->exists('de')); - $this->assertTrue($version->exists('*')); - - // delete the German translation - $version->delete('de'); - - $this->assertTrue($version->exists('en')); - $this->assertFalse($version->exists('de')); - - // The wildcard should now still return true - // because the English translation still exists - $this->assertTrue($version->exists('*')); - } - - /** - * @covers ::exists - */ - public function testExistsLatestSingleLanguage(): void - { - $this->setUpSingleLanguage(); - - $version = new Version( - model: $this->model, - id: VersionId::latest() - ); - - $this->assertDirectoryExists($this->model->root()); - - // the default version exists without content file as long as - // the page directory exists - $this->assertTrue($version->exists()); - } - - /** - * @covers ::id - */ - public function testId(): void - { - $this->setUpSingleLanguage(); - - $version = new Version( - model: $this->model, - id: $id = VersionId::latest() - ); - - $this->assertSame($id, $version->id()); + $this->assertTrue($a->isIdentical('latest')); } /** From 15a6b3c845be567fb918ecda7d80b54821ab78c6 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 9 Oct 2024 16:32:07 +0200 Subject: [PATCH 172/362] First draft for a new comparison view --- config/areas/site/views.php | 17 +++ panel/public/img/icons.svg | 9 ++ panel/src/components/Forms/FormControls.vue | 2 +- .../Views/Pages/PageComparisonView.vue | 136 ++++++++++++++++++ panel/src/components/Views/Pages/index.js | 2 + src/Panel/Page.php | 2 +- 6 files changed, 166 insertions(+), 2 deletions(-) create mode 100644 panel/src/components/Views/Pages/PageComparisonView.vue diff --git a/config/areas/site/views.php b/config/areas/site/views.php index 7465d2e324..36bd2868bb 100644 --- a/config/areas/site/views.php +++ b/config/areas/site/views.php @@ -8,6 +8,23 @@ 'pattern' => 'pages/(:any)', 'action' => fn (string $path) => Find::page($path)->panel()->view() ], + 'page.changes.compare' => [ + 'pattern' => 'pages/(:any)/changes/compare', + 'action' => function (string $path) { + $page = Find::page($path); + + return [ + 'component' => 'k-page-comparison-view', + 'props' => [ + 'changes' => $page->previewUrl() . '?_version=changes', + 'backlink' => $page->panel()->url(true), + 'lock' => $page->lock()->toArray(), + 'published' => $page->previewUrl(), + ], + 'title' => $page->title()->value(), + ]; + } + ], 'page.file' => [ 'pattern' => 'pages/(:any)/files/(:any)', 'action' => function (string $id, string $filename) { diff --git a/panel/public/img/icons.svg b/panel/public/img/icons.svg index 4ac88fe8b5..ce4efe04ea 100644 --- a/panel/public/img/icons.svg +++ b/panel/public/img/icons.svg @@ -359,6 +359,15 @@ + + + + + + + + + diff --git a/panel/src/components/Forms/FormControls.vue b/panel/src/components/Forms/FormControls.vue index 7c287d4ef1..d7fd9d7cd3 100644 --- a/panel/src/components/Forms/FormControls.vue +++ b/panel/src/components/Forms/FormControls.vue @@ -41,7 +41,7 @@ diff --git a/panel/src/components/Views/Pages/PageComparisonView.vue b/panel/src/components/Views/Pages/PageComparisonView.vue new file mode 100644 index 0000000000..3855e8e45d --- /dev/null +++ b/panel/src/components/Views/Pages/PageComparisonView.vue @@ -0,0 +1,136 @@ + + + + + diff --git a/panel/src/components/Views/Pages/index.js b/panel/src/components/Views/Pages/index.js index 98ac2a67bf..7b1238c742 100644 --- a/panel/src/components/Views/Pages/index.js +++ b/panel/src/components/Views/Pages/index.js @@ -1,9 +1,11 @@ import PageView from "./PageView.vue"; +import PageComparisonView from "./PageComparisonView.vue"; import SiteView from "./SiteView.vue"; export default { install(app) { app.component("k-page-view", PageView); + app.component("k-page-comparison-view", PageComparisonView); app.component("k-site-view", SiteView); } }; diff --git a/src/Panel/Page.php b/src/Panel/Page.php index f9b157caca..5b6afc2399 100644 --- a/src/Panel/Page.php +++ b/src/Panel/Page.php @@ -365,7 +365,7 @@ public function props(): array ...$props, ...$this->prevNext(), 'blueprint' => $this->model->intendedTemplate()->name(), - 'changesUrl' => $this->model->previewUrl() . '?_version=changes', + 'changesUrl' => $this->url(true) . '/changes/compare', 'model' => $model, 'title' => $model['title'], ]; From 97568ca443506b114849c796709e93c509bc1bb7 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 9 Oct 2024 16:52:08 +0200 Subject: [PATCH 173/362] Open in new window buttons --- .../Views/Pages/PageComparisonView.vue | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/panel/src/components/Views/Pages/PageComparisonView.vue b/panel/src/components/Views/Pages/PageComparisonView.vue index 3855e8e45d..8f97ab22bb 100644 --- a/panel/src/components/Views/Pages/PageComparisonView.vue +++ b/panel/src/components/Views/Pages/PageComparisonView.vue @@ -51,11 +51,29 @@

- Published version + + Published version + +
- Changed version + + Changed version + +
@@ -125,6 +143,9 @@ export default { border-right: 1px solid var(--color-border); } .k-page-comparison-grid > section .k-headline { + display: flex; + align-items: center; + justify-content: space-between; margin-bottom: var(--spacing-3); } .k-page-comparison-grid iframe { From 3a79ce4f2e341849532e97916aa75eb8453f0a08 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 22 Oct 2024 12:31:19 +0200 Subject: [PATCH 174/362] Rename view to k-page-changes-view --- config/areas/site/views.php | 18 +- .../Views/Pages/PageChangesView.vue | 165 ++++++++++++++++++ .../Views/Pages/PageComparisonView.vue | 157 ----------------- panel/src/components/Views/Pages/index.js | 4 +- src/Panel/Page.php | 2 +- 5 files changed, 178 insertions(+), 168 deletions(-) create mode 100644 panel/src/components/Views/Pages/PageChangesView.vue delete mode 100644 panel/src/components/Views/Pages/PageComparisonView.vue diff --git a/config/areas/site/views.php b/config/areas/site/views.php index 36bd2868bb..5a5ae1a00a 100644 --- a/config/areas/site/views.php +++ b/config/areas/site/views.php @@ -8,20 +8,22 @@ 'pattern' => 'pages/(:any)', 'action' => fn (string $path) => Find::page($path)->panel()->view() ], - 'page.changes.compare' => [ - 'pattern' => 'pages/(:any)/changes/compare', + 'page.changes' => [ + 'pattern' => 'pages/(:any)/changes', 'action' => function (string $path) { $page = Find::page($path); + $view = Find::page($path)->panel()->view(); return [ - 'component' => 'k-page-comparison-view', + 'component' => 'k-page-changes-view', 'props' => [ - 'changes' => $page->previewUrl() . '?_version=changes', - 'backlink' => $page->panel()->url(true), - 'lock' => $page->lock()->toArray(), - 'published' => $page->previewUrl(), + ...$view['props'], + 'src' => [ + 'changes' => $page->previewUrl() . '?_version=changes', + 'latest' => $page->previewUrl(), + ] ], - 'title' => $page->title()->value(), + 'title' => $view['title'], ]; } ], diff --git a/panel/src/components/Views/Pages/PageChangesView.vue b/panel/src/components/Views/Pages/PageChangesView.vue new file mode 100644 index 0000000000..c2252248ce --- /dev/null +++ b/panel/src/components/Views/Pages/PageChangesView.vue @@ -0,0 +1,165 @@ + + + + + diff --git a/panel/src/components/Views/Pages/PageComparisonView.vue b/panel/src/components/Views/Pages/PageComparisonView.vue deleted file mode 100644 index 8f97ab22bb..0000000000 --- a/panel/src/components/Views/Pages/PageComparisonView.vue +++ /dev/null @@ -1,157 +0,0 @@ - - - - - diff --git a/panel/src/components/Views/Pages/index.js b/panel/src/components/Views/Pages/index.js index 7b1238c742..3df6769f36 100644 --- a/panel/src/components/Views/Pages/index.js +++ b/panel/src/components/Views/Pages/index.js @@ -1,11 +1,11 @@ import PageView from "./PageView.vue"; -import PageComparisonView from "./PageComparisonView.vue"; +import PageChangesView from "./PageChangesView.vue"; import SiteView from "./SiteView.vue"; export default { install(app) { app.component("k-page-view", PageView); - app.component("k-page-comparison-view", PageComparisonView); + app.component("k-page-changes-view", PageChangesView); app.component("k-site-view", SiteView); } }; diff --git a/src/Panel/Page.php b/src/Panel/Page.php index 5b6afc2399..ff380550fb 100644 --- a/src/Panel/Page.php +++ b/src/Panel/Page.php @@ -365,7 +365,7 @@ public function props(): array ...$props, ...$this->prevNext(), 'blueprint' => $this->model->intendedTemplate()->name(), - 'changesUrl' => $this->url(true) . '/changes/compare', + 'changesUrl' => $this->url(true) . '/changes', 'model' => $model, 'title' => $model['title'], ]; From 08ae8ecd7aa2248f4a450e768c92ffe445f2a91f Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 22 Oct 2024 12:31:38 +0200 Subject: [PATCH 175/362] Move view logic to ModelView component instead of the content module --- panel/src/components/Views/ModelView.vue | 6 ++++-- panel/src/panel/content.js | 7 ++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/panel/src/components/Views/ModelView.vue b/panel/src/components/Views/ModelView.vue index 33314fbf7b..db9845f6e1 100644 --- a/panel/src/components/Views/ModelView.vue +++ b/panel/src/components/Views/ModelView.vue @@ -92,6 +92,7 @@ export default { } await this.$panel.content.discard(); + this.$panel.view.reload(); }, onInput(values) { if (this.isLocked === true) { @@ -105,13 +106,14 @@ export default { e?.preventDefault?.(); this.onSubmit(); }, - onSubmit(values = {}) { + async onSubmit(values = {}) { if (this.isLocked === true) { return false; } this.$panel.content.update(values); - this.$panel.content.publish(); + await this.$panel.content.publish(); + await this.$panel.view.refresh(); }, toPrev(e) { if (this.prev && e.target.localName === "body") { diff --git a/panel/src/panel/content.js b/panel/src/panel/content.js index 3165fb40e6..df943ae661 100644 --- a/panel/src/panel/content.js +++ b/panel/src/panel/content.js @@ -47,7 +47,6 @@ export default (panel) => { try { await panel.api.post(this.api + "/changes/discard"); panel.view.props.content = panel.view.props.originals; - panel.view.reload(); } finally { this.isProcessing = false; } @@ -102,13 +101,11 @@ export default (panel) => { panel.view.props.originals = panel.view.props.content; - await panel.view.refresh(); + panel.events.emit("model.update"); + panel.notification.success(); } finally { this.isProcessing = false; } - - panel.events.emit("model.update"); - panel.notification.success(); }, /** From fd5d4a825cc8e7a6a0eec9d01111f387d47fa011 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 22 Oct 2024 12:33:43 +0200 Subject: [PATCH 176/362] Make iframes responsive --- panel/src/components/Views/Pages/PageChangesView.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/panel/src/components/Views/Pages/PageChangesView.vue b/panel/src/components/Views/Pages/PageChangesView.vue index c2252248ce..4ef87d7010 100644 --- a/panel/src/components/Views/Pages/PageChangesView.vue +++ b/panel/src/components/Views/Pages/PageChangesView.vue @@ -134,8 +134,11 @@ export default { display: grid; grid-template-columns: 100%; } -.k-page-changes-grid[data-mode="compare"] { - grid-template-columns: 50% 50%; + +@media screen and (min-width: 50rem) { + .k-page-changes-grid[data-mode="compare"] { + grid-template-columns: 50% 50%; + } } .k-page-changes-grid > section { From 99a781c93bc34897d8be53107d03bd008ab27bf3 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 22 Oct 2024 12:36:34 +0200 Subject: [PATCH 177/362] Set a default background for the iframes --- panel/src/components/Views/Pages/PageChangesView.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/panel/src/components/Views/Pages/PageChangesView.vue b/panel/src/components/Views/Pages/PageChangesView.vue index 4ef87d7010..1d56aae768 100644 --- a/panel/src/components/Views/Pages/PageChangesView.vue +++ b/panel/src/components/Views/Pages/PageChangesView.vue @@ -160,6 +160,7 @@ export default { flex-grow: 1; border-radius: var(--rounded-lg); box-shadow: var(--shadow-xl); + background: var(--color-white); } .k-page-changes-grid .k-empty { flex-grow: 1; From 5484c1af10fc323f70b2c2edf75d1b755d95bae1 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 22 Oct 2024 12:44:22 +0200 Subject: [PATCH 178/362] Fix CS issues --- config/areas/site/views.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/areas/site/views.php b/config/areas/site/views.php index 5a5ae1a00a..03158542cd 100644 --- a/config/areas/site/views.php +++ b/config/areas/site/views.php @@ -19,7 +19,7 @@ 'props' => [ ...$view['props'], 'src' => [ - 'changes' => $page->previewUrl() . '?_version=changes', + 'changes' => $page->previewUrl() . '?_version=changes', 'latest' => $page->previewUrl(), ] ], From a5c57994e0d1706ad0f537bf7496e90ca8115d18 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 22 Oct 2024 12:56:50 +0200 Subject: [PATCH 179/362] Add a unit test for the changes route --- tests/Panel/Areas/SiteTest.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/Panel/Areas/SiteTest.php b/tests/Panel/Areas/SiteTest.php index 3cd44563e5..dd36143690 100644 --- a/tests/Panel/Areas/SiteTest.php +++ b/tests/Panel/Areas/SiteTest.php @@ -58,6 +58,27 @@ public function testPage(): void $this->assertNull($props['prev']); } + public function testPageChanges(): void + { + $this->login(); + + $this->app->site()->createChild([ + 'slug' => 'test', + 'isDraft' => false, + 'content' => [ + 'title' => 'Test' + ] + ]); + + $view = $this->view('pages/test/changes'); + $props = $view['props']; + + $this->assertSame('k-page-changes-view', $view['component']); + $this->assertSame('Test', $view['title']); + $this->assertSame('/test?_version=changes', $props['src']['changes']); + $this->assertSame('/test', $props['src']['latest']); + } + public function testPageFileWithoutModel(): void { $this->login(); From 076003662d7e397f78c39074877247a81e8cc2f3 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 22 Oct 2024 14:23:06 +0200 Subject: [PATCH 180/362] Translated labels --- i18n/translations/en.json | 3 +++ .../components/Views/Pages/PageChangesView.vue | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/i18n/translations/en.json b/i18n/translations/en.json index e97387a5df..e500f11d69 100644 --- a/i18n/translations/en.json +++ b/i18n/translations/en.json @@ -748,10 +748,13 @@ "users": "Users", "version": "Version", + "version.changes": "Changed version", + "version.compare": "Compare versions", "version.current": "Current version", "version.latest": "Latest version", "versionInformation": "Version information", + "view": "View", "view.account": "Your account", "view.installation": "Installation", "view.languages": "Languages", diff --git a/panel/src/components/Views/Pages/PageChangesView.vue b/panel/src/components/Views/Pages/PageChangesView.vue index 1d56aae768..a2ceb64889 100644 --- a/panel/src/components/Views/Pages/PageChangesView.vue +++ b/panel/src/components/Views/Pages/PageChangesView.vue @@ -2,9 +2,17 @@
- + - There are no unsaved changes + {{ $t("lock.unsaved.empty") }} @@ -71,19 +79,19 @@ export default { modes() { return { latest: { - label: "Latest version", + label: this.$t("version.latest"), icon: "layout-right", current: this.mode === "latest", click: () => (this.mode = "latest") }, changes: { - label: "Changed version", + label: this.$t("version.changes"), icon: "layout-left", current: this.mode === "changes", click: () => (this.mode = "changes") }, compare: { - label: "Side by side", + label: this.$t("version.compare"), icon: "layout-columns", current: this.mode === "compare", click: () => (this.mode = "compare") From 57927a8d3f0721dec1eba2a53c3854324aecc000 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 22 Oct 2024 14:25:02 +0200 Subject: [PATCH 181/362] Responsive header buttons --- panel/src/components/Views/Pages/PageChangesView.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/panel/src/components/Views/Pages/PageChangesView.vue b/panel/src/components/Views/Pages/PageChangesView.vue index a2ceb64889..0b410ae849 100644 --- a/panel/src/components/Views/Pages/PageChangesView.vue +++ b/panel/src/components/Views/Pages/PageChangesView.vue @@ -4,6 +4,7 @@ Date: Tue, 22 Oct 2024 14:25:07 +0200 Subject: [PATCH 182/362] Responsive form controls --- panel/src/components/Forms/FormControls.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/panel/src/components/Forms/FormControls.vue b/panel/src/components/Forms/FormControls.vue index d7fd9d7cd3..0ff9ef615e 100644 --- a/panel/src/components/Forms/FormControls.vue +++ b/panel/src/components/Forms/FormControls.vue @@ -4,6 +4,7 @@ Date: Tue, 22 Oct 2024 16:04:12 +0200 Subject: [PATCH 183/362] Better wording MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nico Hoffmann ෴. --- i18n/translations/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/translations/en.json b/i18n/translations/en.json index e500f11d69..3b947c7211 100644 --- a/i18n/translations/en.json +++ b/i18n/translations/en.json @@ -749,7 +749,7 @@ "version": "Version", "version.changes": "Changed version", - "version.compare": "Compare versions", + "version.compare": "Comparing versions", "version.current": "Current version", "version.latest": "Latest version", "versionInformation": "Version information", From 4378bce9fca6ff7ff5bbb1fc6072f9be1983ac71 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 22 Oct 2024 16:06:37 +0200 Subject: [PATCH 184/362] Remove repeating code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nico Hoffmann ෴. --- config/areas/site/views.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/areas/site/views.php b/config/areas/site/views.php index 03158542cd..d6f976fa96 100644 --- a/config/areas/site/views.php +++ b/config/areas/site/views.php @@ -12,7 +12,7 @@ 'pattern' => 'pages/(:any)/changes', 'action' => function (string $path) { $page = Find::page($path); - $view = Find::page($path)->panel()->view(); + $view = $page->panel()->view(); return [ 'component' => 'k-page-changes-view', From d3eefd0755a89e126077ef1a21f92abb43e8e806 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 22 Oct 2024 16:10:14 +0200 Subject: [PATCH 185/362] Flip the menu order --- panel/src/components/Views/Pages/PageChangesView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel/src/components/Views/Pages/PageChangesView.vue b/panel/src/components/Views/Pages/PageChangesView.vue index 0b410ae849..e3e50e7c08 100644 --- a/panel/src/components/Views/Pages/PageChangesView.vue +++ b/panel/src/components/Views/Pages/PageChangesView.vue @@ -101,7 +101,7 @@ export default { }; }, dropdown() { - return [this.modes.latest, this.modes.changes, "-", this.modes.compare]; + return [this.modes.compare, "-", this.modes.latest, this.modes.changes]; } }, methods: { From 5e8513d11f8fab52c7e34346837b272c42cfe12a Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 4 Nov 2024 16:45:03 +0100 Subject: [PATCH 186/362] New expand and collapse icons --- panel/public/img/icons.svg | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/panel/public/img/icons.svg b/panel/public/img/icons.svg index ce4efe04ea..7852a28e71 100644 --- a/panel/public/img/icons.svg +++ b/panel/public/img/icons.svg @@ -131,6 +131,9 @@ + + + @@ -179,6 +182,9 @@ + + + From 99662e30e2c8b72b9eec4ae22521835d06f625d3 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 4 Nov 2024 16:52:46 +0100 Subject: [PATCH 187/362] Various UX changes --- .../Views/Pages/PageChangesView.vue | 181 ++++++++++++------ 1 file changed, 119 insertions(+), 62 deletions(-) diff --git a/panel/src/components/Views/Pages/PageChangesView.vue b/panel/src/components/Views/Pages/PageChangesView.vue index e3e50e7c08..dda3cad5e7 100644 --- a/panel/src/components/Views/Pages/PageChangesView.vue +++ b/panel/src/components/Views/Pages/PageChangesView.vue @@ -5,59 +5,92 @@ + @click="$refs.tree.toggle()" + > + + + {{ title }} + + + - + - -
-
- - {{ modes.latest.label }} - - - +
+
+ {{ modes.latest.label }} + + + + +
+
-
- - {{ modes.changes.label }} - - - + +
+
+ {{ modes.changes.label }} + + + + + +
+ {{ $t("lock.unsaved.empty") }}
@@ -80,23 +113,23 @@ export default { computed: { modes() { return { - latest: { - label: this.$t("version.latest"), - icon: "layout-right", - current: this.mode === "latest", - click: () => (this.mode = "latest") - }, changes: { label: this.$t("version.changes"), icon: "layout-left", current: this.mode === "changes", - click: () => (this.mode = "changes") + click: () => this.changeMode("changes") }, compare: { label: this.$t("version.compare"), icon: "layout-columns", current: this.mode === "compare", - click: () => (this.mode = "compare") + click: () => this.changeMode("compare") + }, + latest: { + label: this.$t("version.latest"), + icon: "layout-right", + current: this.mode === "latest", + click: () => this.changeMode("latest") } }; }, @@ -104,14 +137,30 @@ export default { return [this.modes.compare, "-", this.modes.latest, this.modes.changes]; } }, + watch: { + id: { + handler() { + this.changeMode(localStorage.getItem("kirby$preview$mode")); + }, + immediate: true + } + }, methods: { + changeMode(mode) { + if (!mode || !this.modes[mode]) { + return; + } + + this.mode = mode; + localStorage.setItem("kirby$preview$mode", mode); + }, async onDiscard() { if (this.isLocked === true) { return false; } await this.$panel.content.discard(); - await this.$panel.view.open(this.link); + await this.$panel.view.reload(); }, async onSubmit() { if (this.isLocked === true) { @@ -119,7 +168,7 @@ export default { } await this.$panel.content.publish(); - await this.$panel.view.open(this.link); + await this.$panel.reload(); } } }; @@ -136,31 +185,39 @@ export default { .k-page-changes-header { container-type: inline-size; display: flex; - align-items: center; + gap: var(--spacing-2); justify-content: space-between; + align-items: center; padding: var(--spacing-2); border-bottom: 1px solid var(--color-border); } -.k-page-changes-grid { - display: grid; - grid-template-columns: 100%; -} -@media screen and (min-width: 50rem) { - .k-page-changes-grid[data-mode="compare"] { - grid-template-columns: 50% 50%; +@media screen and (max-width: 40rem) { + .k-page-changes-header-controls > .k-button { + --button-text-display: none; } } -.k-page-changes-grid > section { +.k-page-changes-grid { + display: flex; +} +@media screen and (max-width: 60rem) { + .k-page-changes-grid { + flex-direction: column; + } +} +.k-page-changes-grid .k-page-changes-panel + .k-page-changes-panel { + border-left: 1px solid var(--color-border); +} +.k-page-changes-panel { + flex-grow: 1; display: flex; flex-direction: column; padding: var(--spacing-6); + background: var(--color-gray-200); } -.k-page-changes-grid > section:first-child { - border-right: 1px solid var(--color-border); -} -.k-page-changes-grid > section .k-headline { +.k-page-changes-panel header { + container-type: inline-size; display: flex; align-items: center; justify-content: space-between; From b76419d8d344f33674ad83940551f6508f2ef111 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 5 Nov 2024 12:24:35 +0100 Subject: [PATCH 188/362] Improve the wording in the discard dialog --- i18n/translations/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/translations/en.json b/i18n/translations/en.json index 3b947c7211..e140c0a97c 100644 --- a/i18n/translations/en.json +++ b/i18n/translations/en.json @@ -378,7 +378,7 @@ "filter": "Filter", "form.discard": "Discard changes", - "form.discard.confirm": "Do you really want to delete all unpublished changes?", + "form.discard.confirm": "Do you really want to discard all your changes?", "form.locked": "This content is disabled for you as it is currently edited by another user", "form.unsaved": "The current changes have not yet been saved", "form.preview": "Preview changes", From 16b93c7c4baf75171f9597500067a6da1f8b0abf Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 6 Nov 2024 11:47:52 +0100 Subject: [PATCH 189/362] New asterisk and window icons --- panel/public/img/icons.svg | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/panel/public/img/icons.svg b/panel/public/img/icons.svg index 7852a28e71..8ea8e714b4 100644 --- a/panel/public/img/icons.svg +++ b/panel/public/img/icons.svg @@ -36,6 +36,9 @@ + + + @@ -658,6 +661,9 @@ + + + From 541aed2340e372296ba34be2018be7fa4bdf47ce Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 6 Nov 2024 11:48:03 +0100 Subject: [PATCH 190/362] Slightly better wording --- i18n/translations/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/translations/en.json b/i18n/translations/en.json index e140c0a97c..0e03083c4a 100644 --- a/i18n/translations/en.json +++ b/i18n/translations/en.json @@ -749,7 +749,7 @@ "version": "Version", "version.changes": "Changed version", - "version.compare": "Comparing versions", + "version.compare": "Compare versions", "version.current": "Current version", "version.latest": "Latest version", "versionInformation": "Version information", From b407d6b55427bf46704ac9a7904b1a7cce2ba0b3 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 6 Nov 2024 11:52:55 +0100 Subject: [PATCH 191/362] Rename View and implement for the site --- config/areas/site/views.php | 57 +++++++++---- panel/src/components/Views/Pages/PageView.vue | 2 +- panel/src/components/Views/Pages/SiteView.vue | 2 +- panel/src/components/Views/Pages/index.js | 2 - .../PageChangesView.vue => PreviewView.vue} | 81 +++++++++---------- panel/src/components/Views/index.js | 2 + src/Panel/Page.php | 32 +++++--- src/Panel/Site.php | 1 - 8 files changed, 102 insertions(+), 77 deletions(-) rename panel/src/components/Views/{Pages/PageChangesView.vue => PreviewView.vue} (76%) diff --git a/config/areas/site/views.php b/config/areas/site/views.php index d6f976fa96..8c8d6e8e77 100644 --- a/config/areas/site/views.php +++ b/config/areas/site/views.php @@ -8,31 +8,34 @@ 'pattern' => 'pages/(:any)', 'action' => fn (string $path) => Find::page($path)->panel()->view() ], - 'page.changes' => [ - 'pattern' => 'pages/(:any)/changes', - 'action' => function (string $path) { - $page = Find::page($path); - $view = $page->panel()->view(); + 'page.file' => [ + 'pattern' => 'pages/(:any)/files/(:any)', + 'action' => function (string $id, string $filename) { + return Find::file('pages/' . $id, $filename)->panel()->view(); + } + ], + 'page.preview' => [ + 'pattern' => 'pages/(:any)/preview/(changes|latest|compare)', + 'action' => function (string $path, string $mode) { + $page = Find::page($path); + $view = $page->panel()->view(); + $preview = $page->previewUrl(); return [ - 'component' => 'k-page-changes-view', + 'component' => 'k-preview-view', 'props' => [ ...$view['props'], - 'src' => [ - 'changes' => $page->previewUrl() . '?_version=changes', - 'latest' => $page->previewUrl(), + 'back' => $view['props']['link'], + 'mode' => $mode, + 'src' => [ + 'changes' => $preview . '?_version=changes', + 'latest' => $preview, ] ], - 'title' => $view['title'], + 'title' => $view['props']['title'] . ' | ' . I18n::translate('changes'), ]; } ], - '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() @@ -43,4 +46,26 @@ return Find::file('site', $filename)->panel()->view(); } ], + 'site.preview' => [ + 'pattern' => 'site/preview/(changes|latest|compare)', + 'action' => function (string $mode) { + $site = App::instance()->site(); + $view = $site->panel()->view(); + $preview = $site->previewUrl(); + + return [ + 'component' => 'k-preview-view', + 'props' => [ + ...$view['props'], + 'back' => $view['props']['link'], + 'mode' => $mode, + 'src' => [ + 'changes' => $preview . '?_version=changes', + 'latest' => $preview, + ] + ], + 'title' => I18n::translate('view.site') . ' | ' . I18n::translate('changes'), + ]; + } + ], ]; diff --git a/panel/src/components/Views/Pages/PageView.vue b/panel/src/components/Views/Pages/PageView.vue index 221df81afa..f66c3c62a9 100644 --- a/panel/src/components/Views/Pages/PageView.vue +++ b/panel/src/components/Views/Pages/PageView.vue @@ -24,7 +24,7 @@ :is-locked="isLocked" :is-unsaved="isUnsaved" :modified="modified" - :preview="changesUrl" + :preview="api + '/preview/compare'" @discard="onDiscard" @submit="onSubmit" /> diff --git a/panel/src/components/Views/Pages/SiteView.vue b/panel/src/components/Views/Pages/SiteView.vue index c20786de5e..235d16771e 100644 --- a/panel/src/components/Views/Pages/SiteView.vue +++ b/panel/src/components/Views/Pages/SiteView.vue @@ -20,7 +20,7 @@ :is-locked="isLocked" :is-unsaved="isUnsaved" :modified="modified" - :preview="changesUrl" + :preview="api + '/preview/compare'" @discard="onDiscard" @submit="onSubmit" /> diff --git a/panel/src/components/Views/Pages/index.js b/panel/src/components/Views/Pages/index.js index 3df6769f36..98ac2a67bf 100644 --- a/panel/src/components/Views/Pages/index.js +++ b/panel/src/components/Views/Pages/index.js @@ -1,11 +1,9 @@ import PageView from "./PageView.vue"; -import PageChangesView from "./PageChangesView.vue"; import SiteView from "./SiteView.vue"; export default { install(app) { app.component("k-page-view", PageView); - app.component("k-page-changes-view", PageChangesView); app.component("k-site-view", SiteView); } }; diff --git a/panel/src/components/Views/Pages/PageChangesView.vue b/panel/src/components/Views/PreviewView.vue similarity index 76% rename from panel/src/components/Views/Pages/PageChangesView.vue rename to panel/src/components/Views/PreviewView.vue index dda3cad5e7..a86df4a8da 100644 --- a/panel/src/components/Views/Pages/PageChangesView.vue +++ b/panel/src/components/Views/PreviewView.vue @@ -1,9 +1,9 @@ diff --git a/panel/src/components/Views/index.js b/panel/src/components/Views/index.js index e19f91a66c..86922c17b5 100644 --- a/panel/src/components/Views/index.js +++ b/panel/src/components/Views/index.js @@ -1,4 +1,5 @@ import ErrorView from "./ErrorView.vue"; +import PreviewView from "./PreviewView.vue"; import SearchView from "./SearchView.vue"; import Files from "./Files/index.js"; @@ -12,6 +13,7 @@ import System from "./System/index.js"; export default { install(app) { app.component("k-error-view", ErrorView); + app.component("k-preview-view", PreviewView); app.component("k-search-view", SearchView); app.use(Files); diff --git a/src/Panel/Page.php b/src/Panel/Page.php index ff380550fb..75cfd5ff97 100644 --- a/src/Panel/Page.php +++ b/src/Panel/Page.php @@ -103,16 +103,27 @@ public function dropdown(array $options = []): array $result = []; if ($view === 'list') { - $result['preview'] = [ - 'link' => $page->previewUrl(), - 'target' => '_blank', - 'icon' => 'open', - 'text' => I18n::translate('open'), - 'disabled' => $this->isDisabledDropdownOption('preview', $options, $permissions) - ]; - $result[] = '-'; + } + $result['preview'] = [ + 'link' => $page->previewUrl(), + 'target' => '_blank', + 'icon' => 'open', + 'text' => I18n::translate('open'), + 'disabled' => $this->isDisabledDropdownOption('preview', $options, $permissions) + ]; + + $result[] = '-'; + + $result['changes'] = [ + 'icon' => 'window', + 'link' => $page->panel()->url(true) . '/preview/compare', + 'text' => I18n::translate('preview'), + ]; + + $result[] = '-'; + $result['changeTitle'] = [ 'dialog' => [ 'url' => $url . '/changeTitle', @@ -365,7 +376,6 @@ public function props(): array ...$props, ...$this->prevNext(), 'blueprint' => $this->model->intendedTemplate()->name(), - 'changesUrl' => $this->url(true) . '/changes', 'model' => $model, 'title' => $model['title'], ]; @@ -382,8 +392,8 @@ public function view(): array return [ 'breadcrumb' => $this->model->panel()->breadcrumb(), 'component' => 'k-page-view', - 'props' => $this->props(), - 'title' => $this->model->title()->toString(), + 'props' => $props = $this->props(), + 'title' => $props['title'], ]; } } diff --git a/src/Panel/Site.php b/src/Panel/Site.php index fc87be3c10..95aff7b854 100644 --- a/src/Panel/Site.php +++ b/src/Panel/Site.php @@ -95,7 +95,6 @@ public function props(): array return [ ...$props, 'blueprint' => 'site', - 'changesUrl' => $this->model->previewUrl() . '?_version=changes', 'id' => '/', 'model' => $model, 'title' => $model['title'], From 9677b7a63f93530562e3e6cbe67256ccf8cd5829 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 6 Nov 2024 11:54:53 +0100 Subject: [PATCH 192/362] Fix the options in the page dropdown --- src/Panel/Page.php | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/Panel/Page.php b/src/Panel/Page.php index 75cfd5ff97..2c0e5bdc6f 100644 --- a/src/Panel/Page.php +++ b/src/Panel/Page.php @@ -103,27 +103,24 @@ public function dropdown(array $options = []): array $result = []; if ($view === 'list') { + $result['open'] = [ + 'link' => $page->previewUrl(), + 'target' => '_blank', + 'icon' => 'open', + 'text' => I18n::translate('open'), + 'disabled' => $this->isDisabledDropdownOption('preview', $options, $permissions) + ]; + + $result['preview'] = [ + 'icon' => 'window', + 'link' => $page->panel()->url(true) . '/preview/compare', + 'text' => I18n::translate('preview'), + ]; + + $result[] = '-'; } - $result['preview'] = [ - 'link' => $page->previewUrl(), - 'target' => '_blank', - 'icon' => 'open', - 'text' => I18n::translate('open'), - 'disabled' => $this->isDisabledDropdownOption('preview', $options, $permissions) - ]; - - $result[] = '-'; - - $result['changes'] = [ - 'icon' => 'window', - 'link' => $page->panel()->url(true) . '/preview/compare', - 'text' => I18n::translate('preview'), - ]; - - $result[] = '-'; - $result['changeTitle'] = [ 'dialog' => [ 'url' => $url . '/changeTitle', From 029a8b5a1e8ed1a0b26954649d2a118c25399068 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 6 Nov 2024 11:58:39 +0100 Subject: [PATCH 193/362] Fix / add unit tests --- src/Panel/Page.php | 1 - tests/Panel/Areas/SiteTest.php | 57 +++++++++++++++++++++------------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/src/Panel/Page.php b/src/Panel/Page.php index 2c0e5bdc6f..37ec0c73a8 100644 --- a/src/Panel/Page.php +++ b/src/Panel/Page.php @@ -118,7 +118,6 @@ public function dropdown(array $options = []): array ]; $result[] = '-'; - } $result['changeTitle'] = [ diff --git a/tests/Panel/Areas/SiteTest.php b/tests/Panel/Areas/SiteTest.php index dd36143690..05957c5989 100644 --- a/tests/Panel/Areas/SiteTest.php +++ b/tests/Panel/Areas/SiteTest.php @@ -58,27 +58,6 @@ public function testPage(): void $this->assertNull($props['prev']); } - public function testPageChanges(): void - { - $this->login(); - - $this->app->site()->createChild([ - 'slug' => 'test', - 'isDraft' => false, - 'content' => [ - 'title' => 'Test' - ] - ]); - - $view = $this->view('pages/test/changes'); - $props = $view['props']; - - $this->assertSame('k-page-changes-view', $view['component']); - $this->assertSame('Test', $view['title']); - $this->assertSame('/test?_version=changes', $props['src']['changes']); - $this->assertSame('/test', $props['src']['latest']); - } - public function testPageFileWithoutModel(): void { $this->login(); @@ -140,6 +119,27 @@ public function testPageFile(): void $this->assertNull($props['prev']); } + public function testPagePreview(): void + { + $this->login(); + + $this->app->site()->createChild([ + 'slug' => 'test', + 'isDraft' => false, + 'content' => [ + 'title' => 'Test' + ] + ]); + + $view = $this->view('pages/test/preview/changes'); + $props = $view['props']; + + $this->assertSame('k-preview-view', $view['component']); + $this->assertSame('Test | Changes', $view['title']); + $this->assertSame('/test?_version=changes', $props['src']['changes']); + $this->assertSame('/test', $props['src']['latest']); + } + public function testSiteWithoutAuthentication(): void { $this->assertRedirect('site', 'login'); @@ -214,6 +214,21 @@ public function testSiteFile(): void $this->assertNull($props['prev']); } + public function testSitePreview(): void + { + $this->login(); + + $this->app->site(); + + $view = $this->view('site/preview/changes'); + $props = $view['props']; + + $this->assertSame('k-preview-view', $view['component']); + $this->assertSame('Site | Changes', $view['title']); + $this->assertSame('/?_version=changes', $props['src']['changes']); + $this->assertSame('/', $props['src']['latest']); + } + public function testSiteTitle(): void { $this->app([ From 3914f1bb5f48abc0e7518f95ef4949e51f5df10c Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 6 Nov 2024 13:20:14 +0100 Subject: [PATCH 194/362] New PreviewDropdownButton to handle the open/preview/copy dropdowns --- config/areas/site/buttons.php | 14 ++++- i18n/translations/en.json | 2 + panel/src/components/Forms/FormControls.vue | 2 +- panel/src/panel/events.js | 9 +++ src/Panel/Page.php | 9 ++- .../Ui/Buttons/PreviewDropdownButton.php | 58 +++++++++++++++++++ 6 files changed, 85 insertions(+), 9 deletions(-) create mode 100644 src/Panel/Ui/Buttons/PreviewDropdownButton.php diff --git a/config/areas/site/buttons.php b/config/areas/site/buttons.php index 6daea92d60..575148af5c 100644 --- a/config/areas/site/buttons.php +++ b/config/areas/site/buttons.php @@ -5,16 +5,24 @@ use Kirby\Cms\Site; use Kirby\Panel\Ui\Buttons\LanguagesDropdown; use Kirby\Panel\Ui\Buttons\PageStatusButton; -use Kirby\Panel\Ui\Buttons\PreviewButton; +use Kirby\Panel\Ui\Buttons\PreviewDropdownButton; use Kirby\Panel\Ui\Buttons\SettingsButton; return [ 'site.preview' => function (Site $site) { - return new PreviewButton(link: $site->url()); + return new PreviewDropdownButton( + open: $site->url(), + preview: $site->panel()->url(true) . '/preview/compare', + copy: $site->url(), + ); }, 'page.preview' => function (Page $page) { if ($page->permissions()->can('preview') === true) { - return new PreviewButton(link: $page->previewUrl()); + return new PreviewDropdownButton( + open: $page->previewUrl(), + preview: $page->panel()->url(true) . '/preview/compare', + copy: $page->previewUrl(), + ); } }, 'page.settings' => function (Page $page) { diff --git a/i18n/translations/en.json b/i18n/translations/en.json index 0e03083c4a..c5b9ba62ce 100644 --- a/i18n/translations/en.json +++ b/i18n/translations/en.json @@ -18,9 +18,11 @@ "collapse.all": "Collapse All", "color": "Color", "coordinates": "Coordinates", + "copied": "Copied", "copy": "Copy", "copy.all": "Copy all", "copy.success": "{count} copied!", + "copy.url": "Copy URL", "create": "Create", "custom": "Custom", diff --git a/panel/src/components/Forms/FormControls.vue b/panel/src/components/Forms/FormControls.vue index 0ff9ef615e..d64a5c6eb1 100644 --- a/panel/src/components/Forms/FormControls.vue +++ b/panel/src/components/Forms/FormControls.vue @@ -42,7 +42,7 @@ diff --git a/panel/src/panel/events.js b/panel/src/panel/events.js index 6cd16ba7d8..fa2852a37f 100644 --- a/panel/src/panel/events.js +++ b/panel/src/panel/events.js @@ -33,6 +33,15 @@ export default (panel) => { emitter.on("keydown.cmd.shift.f", () => panel.search()); emitter.on("keydown.cmd./", () => panel.search()); + /** + * Custom copy to clipboard event + * @since 5.0.0 + */ + emitter.on("copyToClipboard", async (e) => { + navigator.clipboard.writeText(e); + panel.notification.success(panel.t("copied") + "!"); + }); + /** * Config for globally delegated events. * Some events need to be fired on the document diff --git a/src/Panel/Page.php b/src/Panel/Page.php index 37ec0c73a8..4b63eee132 100644 --- a/src/Panel/Page.php +++ b/src/Panel/Page.php @@ -92,11 +92,10 @@ public function dragText(string|null $type = null): string */ public function dropdown(array $options = []): array { - $page = $this->model; - $request = $page->kirby()->request(); - $defaults = $request->get(['view', 'sort', 'delete']); - $options = [...$defaults, $options]; - + $page = $this->model; + $request = $page->kirby()->request(); + $defaults = $request->get(['view', 'sort', 'delete']); + $options = [...$defaults, ...$options]; $permissions = $this->options(['preview']); $view = $options['view'] ?? 'view'; $url = $this->url(true); diff --git a/src/Panel/Ui/Buttons/PreviewDropdownButton.php b/src/Panel/Ui/Buttons/PreviewDropdownButton.php new file mode 100644 index 0000000000..61eb5ac7fc --- /dev/null +++ b/src/Panel/Ui/Buttons/PreviewDropdownButton.php @@ -0,0 +1,58 @@ + + * @link https://getkirby.com + * @copyright Bastian Allgeier + * @license https://getkirby.com/license + * @since 5.0.0 + * @internal + */ +class PreviewDropdownButton extends ViewButton +{ + public function __construct( + public string $open, + public string|null $preview, + public string|null $copy + ) { + parent::__construct( + class: 'k-preview-dropdown-view-button', + icon: 'open', + options: $this->options(), + title: I18n::translate('open') + ); + } + + public function options(): array + { + return [ + [ + 'text' => I18n::translate('open'), + 'icon' => 'open', + 'link' => $this->open, + 'target' => '_blank' + ], + [ + 'text' => I18n::translate('preview'), + 'icon' => 'window', + 'link' => $this->preview, + ], + '-', + [ + 'text' => I18n::translate('copy.url'), + 'icon' => 'copy', + 'click' => [ + 'global' => 'copyToClipboard', + 'payload' => $this->copy + ] + ] + ]; + } +} From 9f00a640d5edc181b431278c06341a27fcee9c39 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Sat, 9 Nov 2024 11:21:18 +0100 Subject: [PATCH 195/362] Fix outdated toggle method --- panel/src/components/Views/PreviewView.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/panel/src/components/Views/PreviewView.vue b/panel/src/components/Views/PreviewView.vue index a86df4a8da..6b3d41e1fc 100644 --- a/panel/src/components/Views/PreviewView.vue +++ b/panel/src/components/Views/PreviewView.vue @@ -9,7 +9,6 @@ icon="angle-left" size="sm" variant="filled" - @click="$refs.tree.toggle()" > From b6fbccfe95399c9a61b1d1a8f75bddbd8624566c Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Sat, 9 Nov 2024 12:59:10 +0100 Subject: [PATCH 196/362] Clarify the usage of ::toStoredValue and ::toFormValue and remove protected ::store method --- src/Form/Field.php | 38 +++++++++++++++++----------------- src/Form/Field/BlocksField.php | 27 ++++++++++++------------ src/Form/Field/LayoutField.php | 3 ++- src/Form/Mixin/Value.php | 35 +++++++++++-------------------- tests/Form/FieldClassTest.php | 1 - tests/Form/FieldTest.php | 2 -- 6 files changed, 47 insertions(+), 59 deletions(-) diff --git a/src/Form/Field.php b/src/Form/Field.php index 7b52168962..af8fa44a55 100644 --- a/src/Form/Field.php +++ b/src/Form/Field.php @@ -366,25 +366,6 @@ protected function siblingsCollection(): Fields return $this->siblings; } - /** - * Converts the given value to a value - * that can be stored in the text file - */ - protected function store(mixed $value): mixed - { - $store = $this->options['save'] ?? true; - - if ($store === false) { - return null; - } - - if ($store instanceof Closure) { - return $store->call($this, $value); - } - - return $value; - } - /** * Converts the field to a plain array */ @@ -405,6 +386,25 @@ public function toArray(): array ); } + /** + * Returns the value of the field in a format to be stored by our storage classes + */ + public function toStoredValue(bool $default = false): mixed + { + $value = $this->value($default); + $store = $this->options['save'] ?? true; + + if ($store === false) { + return null; + } + + if ($store instanceof Closure) { + return $store->call($this, $value); + } + + return $value; + } + /** * Defines all validation rules */ diff --git a/src/Form/Field/BlocksField.php b/src/Form/Field/BlocksField.php index 9fa3ba9d8b..fe7ede7463 100644 --- a/src/Form/Field/BlocksField.php +++ b/src/Form/Field/BlocksField.php @@ -238,19 +238,6 @@ public function routes(): array ]; } - protected function store(mixed $value): mixed - { - $blocks = $this->blocksToValues((array)$value, 'content'); - - // returns empty string to avoid storing empty array as string `[]` - // and to consistency work with `$field->isEmpty()` - if ($blocks === []) { - return ''; - } - - return $this->valueToJson($blocks, $this->pretty()); - } - protected function setDefault(mixed $default = null): void { // set id for blocks if not exists @@ -287,6 +274,20 @@ protected function setPretty(bool $pretty = false): void $this->pretty = $pretty; } + public function toStoredValue(bool $default = false): mixed + { + $value = $this->toFormValue($default); + $blocks = $this->blocksToValues((array)$value, 'content'); + + // returns empty string to avoid storing empty array as string `[]` + // and to consistency work with `$field->isEmpty()` + if ($blocks === []) { + return ''; + } + + return $this->valueToJson($blocks, $this->pretty()); + } + public function validations(): array { return [ diff --git a/src/Form/Field/LayoutField.php b/src/Form/Field/LayoutField.php index 73f1726c28..7b893a12f4 100644 --- a/src/Form/Field/LayoutField.php +++ b/src/Form/Field/LayoutField.php @@ -267,8 +267,9 @@ public function settings(): Fieldset|null return $this->settings; } - protected function store(mixed $value): mixed + public function toStoredValue(bool $default = false): mixed { + $value = $this->toFormValue($default); $value = Layouts::factory($value, ['parent' => $this->model])->toArray(); // returns empty string to avoid storing empty array as string `[]` diff --git a/src/Form/Mixin/Value.php b/src/Form/Mixin/Value.php index 562839a737..82198798d1 100644 --- a/src/Form/Mixin/Value.php +++ b/src/Form/Mixin/Value.php @@ -40,7 +40,7 @@ public function default(): mixed */ public function isEmpty(): bool { - return $this->isEmptyValue($this->value()); + return $this->isEmptyValue($this->toFormValue()); } /** @@ -74,25 +74,20 @@ protected function needsValue(): bool } /** - * Converts the given value to a value - * that can be stored in the text file + * Returns the value of the field in a format to be used in forms + * @alias for `::value()` */ - protected function store(mixed $value): mixed + public function toFormValue(bool $default = false): mixed { if ($this->isSaveable() === false) { return null; } - return $value; - } + if ($default === true && $this->isEmpty() === true) { + return $this->default(); + } - /** - * Returns the value of the field in a format to be used in forms - * @alias for `::value()` - */ - public function toFormValue(bool $default = false): mixed - { - return $this->value($default); + return $this->value; } /** @@ -100,24 +95,18 @@ public function toFormValue(bool $default = false): mixed */ public function toStoredValue(bool $default = false): mixed { - return $this->store($this->value($default)); + return $this->toFormValue($default); } /** * Returns the value of the field if saveable * otherwise it returns null + * + * @alias for `::toFormValue()` might get deprecated or reused later */ public function value(bool $default = false): mixed { - if ($this->isSaveable() === false) { - return null; - } - - if ($default === true && $this->isEmpty() === true) { - return $this->default(); - } - - return $this->value; + return $this->toFormValue($default); } /** diff --git a/tests/Form/FieldClassTest.php b/tests/Form/FieldClassTest.php index 4437585e98..d24dac8ad3 100644 --- a/tests/Form/FieldClassTest.php +++ b/tests/Form/FieldClassTest.php @@ -547,7 +547,6 @@ public function testSiblings() } /** - * @covers ::store * @covers ::toStoredValue */ public function testToStoredValue() diff --git a/tests/Form/FieldTest.php b/tests/Form/FieldTest.php index 995d6dc901..f94ff166de 100644 --- a/tests/Form/FieldTest.php +++ b/tests/Form/FieldTest.php @@ -1059,7 +1059,6 @@ public function testToFormValue() /** * @covers ::toStoredValue - * @covers ::store * @covers ::data */ public function testToStoredValue() @@ -1086,7 +1085,6 @@ public function testToStoredValue() /** * @covers ::toStoredValue - * @covers ::store * @covers ::data */ public function testToStoredValueWhenUnsaveable() From 8c455ee017e67d8bb584a1eb70c48240a91a03b3 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Sat, 9 Nov 2024 13:02:38 +0100 Subject: [PATCH 197/362] Remove outdated trait import --- src/Form/Field.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Form/Field.php b/src/Form/Field.php index af8fa44a55..310f42a096 100644 --- a/src/Form/Field.php +++ b/src/Form/Field.php @@ -31,9 +31,7 @@ class Field extends Component use Mixin\Translatable; use Mixin\Validation; use Mixin\When; - use Mixin\Value { - isEmptyValue as protected isEmptyValueFromTrait; - } + use Mixin\Value; /** * Parent collection with all fields of the current form From 1959a4210205f684d2dd2c912eae0aaef9e43f13 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Tue, 5 Nov 2024 18:46:01 +0100 Subject: [PATCH 198/362] `Form\Value`: Move data methods to `Data` classes --- src/Data/Data.php | 18 +++++-- src/Data/Json.php | 13 +++-- src/Form/Field/BlocksField.php | 3 +- src/Form/Field/LayoutField.php | 6 ++- src/Form/Mixin/Value.php | 47 ----------------- tests/Form/FieldClassTest.php | 68 ------------------------- tests/Form/FieldTest.php | 92 ---------------------------------- 7 files changed, 29 insertions(+), 218 deletions(-) diff --git a/src/Data/Data.php b/src/Data/Data.php index d7f7c6ee7e..d952f55f14 100644 --- a/src/Data/Data.php +++ b/src/Data/Data.php @@ -4,6 +4,7 @@ use Kirby\Exception\Exception; use Kirby\Filesystem\F; +use Throwable; /** * The `Data` class provides readers and @@ -80,9 +81,20 @@ public static function handler(string $type): Handler /** * Decodes data with the specified handler */ - public static function decode($string, string $type): array - { - return static::handler($type)->decode($string); + public static function decode( + $string, + string $type, + bool $exceptions = true + ): array { + try { + return static::handler($type)->decode($string); + } catch (Throwable $e) { + if ($exceptions === false) { + return []; + } + + throw $e; + } } /** diff --git a/src/Data/Json.php b/src/Data/Json.php index 6fcb74e158..124435f11a 100644 --- a/src/Data/Json.php +++ b/src/Data/Json.php @@ -18,12 +18,15 @@ class Json extends Handler /** * Converts an array to an encoded JSON string */ - public static function encode($data): string + public static function encode($data, bool $pretty = false): string { - return json_encode( - $data, - JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE - ); + $constants = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; + + if ($pretty === true) { + $constants |= JSON_PRETTY_PRINT; + } + + return json_encode($data, $constants); } /** diff --git a/src/Form/Field/BlocksField.php b/src/Form/Field/BlocksField.php index fe7ede7463..dbadae0042 100644 --- a/src/Form/Field/BlocksField.php +++ b/src/Form/Field/BlocksField.php @@ -8,6 +8,7 @@ use Kirby\Cms\Fieldset; use Kirby\Cms\Fieldsets; use Kirby\Cms\ModelWithContent; +use Kirby\Data\Json; use Kirby\Exception\InvalidArgumentException; use Kirby\Exception\NotFoundException; use Kirby\Form\FieldClass; @@ -285,7 +286,7 @@ public function toStoredValue(bool $default = false): mixed return ''; } - return $this->valueToJson($blocks, $this->pretty()); + return Json::encode($blocks, pretty: $this->pretty()); } public function validations(): array diff --git a/src/Form/Field/LayoutField.php b/src/Form/Field/LayoutField.php index 7b893a12f4..b58adaf60b 100644 --- a/src/Form/Field/LayoutField.php +++ b/src/Form/Field/LayoutField.php @@ -7,6 +7,8 @@ use Kirby\Cms\Fieldset; use Kirby\Cms\Layout; use Kirby\Cms\Layouts; +use Kirby\Data\Data; +use Kirby\Data\Json; use Kirby\Exception\InvalidArgumentException; use Kirby\Form\Form; use Kirby\Toolkit\Str; @@ -30,7 +32,7 @@ public function __construct(array $params) public function fill(mixed $value = null): void { - $value = $this->valueFromJson($value); + $value = Data::decode($value, type: 'json', exceptions: false); $layouts = Layouts::factory($value, ['parent' => $this->model])->toArray(); foreach ($layouts as $layoutIndex => $layout) { @@ -288,7 +290,7 @@ public function toStoredValue(bool $default = false): mixed } } - return $this->valueToJson($value, $this->pretty()); + return Json::encode($value, pretty: $this->pretty()); } public function validations(): array diff --git a/src/Form/Mixin/Value.php b/src/Form/Mixin/Value.php index 82198798d1..4f4bd91cf3 100644 --- a/src/Form/Mixin/Value.php +++ b/src/Form/Mixin/Value.php @@ -2,9 +2,6 @@ namespace Kirby\Form\Mixin; -use Kirby\Data\Data; -use Throwable; - /** * @package Kirby Form * @author Bastian Allgeier @@ -108,48 +105,4 @@ public function value(bool $default = false): mixed { return $this->toFormValue($default); } - - /** - * Decodes a JSON string into an array - */ - protected function valueFromJson(mixed $value): array - { - try { - return Data::decode($value, 'json'); - } catch (Throwable) { - return []; - } - } - - /** - * Decodes a YAML string into an array - */ - protected function valueFromYaml(mixed $value): array - { - return Data::decode($value, 'yaml'); - } - - /** - * Encodes an array into a JSON string - */ - protected function valueToJson( - array|null $value = null, - bool $pretty = false - ): string { - $constants = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; - - if ($pretty === true) { - $constants |= JSON_PRETTY_PRINT; - } - - return json_encode($value, $constants); - } - - /** - * Encodes an array into a YAML string - */ - protected function valueToYaml(array|null $value = null): string - { - return Data::encode($value, 'yaml'); - } } diff --git a/tests/Form/FieldClassTest.php b/tests/Form/FieldClassTest.php index d24dac8ad3..27b9c508b2 100644 --- a/tests/Form/FieldClassTest.php +++ b/tests/Form/FieldClassTest.php @@ -4,7 +4,6 @@ use Exception; use Kirby\Cms\Page; -use Kirby\Exception\InvalidArgumentException; use Kirby\TestCase; class TestField extends FieldClass @@ -27,22 +26,6 @@ public function isSaveable(): bool } } -class JsonField extends FieldClass -{ - public function fill($value = null): void - { - $this->value = $this->valueFromJson($value); - } -} - -class YamlField extends FieldClass -{ - public function fill($value = null): void - { - $this->value = $this->valueFromYaml($value); - } -} - class ValidatedField extends FieldClass { public function validations(): array @@ -599,57 +582,6 @@ public function testValue() $this->assertNull($field->value()); } - /** - * @covers ::valueFromJson - */ - public function testValueFromJson() - { - $value = [ - [ - 'content' => 'Heading 1', - 'id' => 'h1', - 'type' => 'h1', - ] - ]; - - // use simple value - $field = new JsonField(['value' => json_encode($value)]); - $this->assertSame($value, $field->value()); - - // use empty value - $field = new JsonField(['value' => '']); - $this->assertSame([], $field->value()); - - // use invalid value - $field = new JsonField(['value' => '{invalid}']); - $this->assertSame([], $field->value()); - } - - /** - * @covers ::valueFromYaml - */ - public function testValueFromYaml() - { - $value = "name: Homer\nchildren:\n - Lisa\n - Bart\n - Maggie\n"; - $expected = [ - 'name' => 'Homer', - 'children' => ['Lisa', 'Bart', 'Maggie'] - ]; - - // use simple value - $field = new YamlField(['value' => $value]); - $this->assertSame($expected, $field->value()); - - // use empty value - $field = new YamlField(['value' => '']); - $this->assertSame([], $field->value()); - - // use invalid value - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid YAML data; please pass a string'); - new YamlField(['value' => new \stdClass()]); - } - /** * @covers ::when */ diff --git a/tests/Form/FieldTest.php b/tests/Form/FieldTest.php index f94ff166de..f2b209114e 100644 --- a/tests/Form/FieldTest.php +++ b/tests/Form/FieldTest.php @@ -1277,96 +1277,4 @@ public function testWidth() $this->assertSame('1/2', $field->width()); $this->assertSame('1/2', $field->width); } - - /** - * @covers ::valueFromJson - */ - public function testValueFromJson() - { - // no defined as default - Field::$types = [ - 'test' => [ - 'props' => [ - 'value' => function (string $value): array { - return $this->valueFromJson($value); - } - ] - ] - ]; - - $field = new Field('test', [ - 'model' => $model = new Page(['slug' => 'test']), - 'value' => json_encode($value = ['a' => 'A']) - ]); - - $this->assertSame($value, $field->toFormValue()); - } - - /** - * @covers ::valueFromYaml - */ - public function testValueFromYaml() - { - // no defined as default - Field::$types = [ - 'test' => [ - 'props' => [ - 'value' => function (string $value): array { - return $this->valueFromYaml($value); - } - ] - ] - ]; - - $field = new Field('test', [ - 'model' => $model = new Page(['slug' => 'test']), - 'value' => Data::encode($value = ['a' => 'A'], 'yml') - ]); - - $this->assertSame($value, $field->toFormValue()); - } - - /** - * @covers ::valueToJson - */ - public function testValueToJson() - { - // no defined as default - Field::$types = [ - 'test' => [ - 'save' => function (array $value): string { - return $this->valueToJson($value); - } - ] - ]; - - $field = new Field('test', [ - 'model' => $model = new Page(['slug' => 'test']), - 'value' => ['a' => 'A'] - ]); - - $this->assertSame('{"a":"A"}', $field->toStoredValue()); - } - - /** - * @covers ::valueToYaml - */ - public function testValueToYaml() - { - // no defined as default - Field::$types = [ - 'test' => [ - 'save' => function (array $value): string { - return $this->valueToYaml($value); - } - ] - ]; - - $field = new Field('test', [ - 'model' => $model = new Page(['slug' => 'test']), - 'value' => ['a' => 'A'] - ]); - - $this->assertSame("a: A\n", $field->toStoredValue()); - } } From 9cddba23c661849bc23f6d924ec86dfabb89325f Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Sat, 9 Nov 2024 12:44:40 +0100 Subject: [PATCH 199/362] Change parameter name to `$fail` --- src/Data/Data.php | 4 ++-- src/Form/Field/LayoutField.php | 2 +- tests/Data/DataTest.php | 10 ++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Data/Data.php b/src/Data/Data.php index d952f55f14..bf812a9be7 100644 --- a/src/Data/Data.php +++ b/src/Data/Data.php @@ -84,12 +84,12 @@ public static function handler(string $type): Handler public static function decode( $string, string $type, - bool $exceptions = true + bool $fail = true ): array { try { return static::handler($type)->decode($string); } catch (Throwable $e) { - if ($exceptions === false) { + if ($fail === false) { return []; } diff --git a/src/Form/Field/LayoutField.php b/src/Form/Field/LayoutField.php index b58adaf60b..39e89739ad 100644 --- a/src/Form/Field/LayoutField.php +++ b/src/Form/Field/LayoutField.php @@ -32,7 +32,7 @@ public function __construct(array $params) public function fill(mixed $value = null): void { - $value = Data::decode($value, type: 'json', exceptions: false); + $value = Data::decode($value, type: 'json', fail: false); $layouts = Layouts::factory($value, ['parent' => $this->model])->toArray(); foreach ($layouts as $layoutIndex => $layout) { diff --git a/tests/Data/DataTest.php b/tests/Data/DataTest.php index 425b651a23..a1261b0470 100644 --- a/tests/Data/DataTest.php +++ b/tests/Data/DataTest.php @@ -132,6 +132,16 @@ public function testDecodeInvalid3($handler) Data::decode(true, $handler); } + /** + * @covers ::decode + * @dataProvider handlerProvider + */ + public function testDecodeInvalidNoExceptions($handler) + { + $data = Data::decode(1, $handler, fail: false); + $this->assertSame([], $data); + } + public static function handlerProvider(): array { // the PHP handler doesn't support decoding and therefore cannot be From dd3fa82e55f4b3552ba8aceb7edbb0d6a0946a0f Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Sat, 9 Nov 2024 12:47:46 +0100 Subject: [PATCH 200/362] Add test for `JSON::encode(pretty: true)` --- tests/Data/JsonTest.php | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/tests/Data/JsonTest.php b/tests/Data/JsonTest.php index 8f943845f9..0764e39365 100644 --- a/tests/Data/JsonTest.php +++ b/tests/Data/JsonTest.php @@ -57,15 +57,6 @@ public function testDecodeInvalid2() Json::decode(1); } - /** - * @covers ::encode - */ - public function testEncodeUnicode() - { - $string = 'здравей'; - $this->assertSame('"' . $string . '"', Json::encode($string)); - } - /** * @covers ::decode */ @@ -87,4 +78,34 @@ public function testDecodeCorrupted2() Json::decode('true'); } + + /** + * @covers ::encode + */ + public function testEncodePretty() + { + $array = [ + 'name' => 'Homer', + 'children' => ['Lisa', 'Bart', 'Maggie'] + ]; + + $data = Json::encode($array, pretty: true); + $this->assertSame('{ + "name": "Homer", + "children": [ + "Lisa", + "Bart", + "Maggie" + ] +}', $data); + } + + /** + * @covers ::encode + */ + public function testEncodeUnicode() + { + $string = 'здравей'; + $this->assertSame('"' . $string . '"', Json::encode($string)); + } } From 78ccaf7dded3a9393432387bf551355a9476cf08 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Sat, 9 Nov 2024 13:14:26 +0100 Subject: [PATCH 201/362] Improve copy language strings --- i18n/translations/en.json | 4 ++-- panel/src/components/Forms/Blocks/Blocks.vue | 2 +- panel/src/components/Forms/Layouts/Layouts.vue | 2 +- panel/src/panel/events.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/i18n/translations/en.json b/i18n/translations/en.json index c5b9ba62ce..71c9747425 100644 --- a/i18n/translations/en.json +++ b/i18n/translations/en.json @@ -18,10 +18,10 @@ "collapse.all": "Collapse All", "color": "Color", "coordinates": "Coordinates", - "copied": "Copied", "copy": "Copy", "copy.all": "Copy all", - "copy.success": "{count} copied!", + "copy.success": "Copied", + "copy.success.multiple": "{count} copied!", "copy.url": "Copy URL", "create": "Create", "custom": "Custom", diff --git a/panel/src/components/Forms/Blocks/Blocks.vue b/panel/src/components/Forms/Blocks/Blocks.vue index 1ef942077f..cccdf8c123 100644 --- a/panel/src/components/Forms/Blocks/Blocks.vue +++ b/panel/src/components/Forms/Blocks/Blocks.vue @@ -263,7 +263,7 @@ export default { // a sign that it has been copied this.$panel.notification.success({ - message: this.$t("copy.success", { count: blocks.length }), + message: this.$t("copy.success.multiple", { count: blocks.length }), icon: "template" }); }, diff --git a/panel/src/components/Forms/Layouts/Layouts.vue b/panel/src/components/Forms/Layouts/Layouts.vue index 8268ec2b46..12cb3c8b7d 100644 --- a/panel/src/components/Forms/Layouts/Layouts.vue +++ b/panel/src/components/Forms/Layouts/Layouts.vue @@ -103,7 +103,7 @@ export default { // a sign that it has been pasted this.$panel.notification.success({ - message: this.$t("copy.success", { count: copy.length ?? 1 }), + message: this.$t("copy.success.multiple", { count: copy.length ?? 1 }), icon: "template" }); }, diff --git a/panel/src/panel/events.js b/panel/src/panel/events.js index fa2852a37f..35cf2491c7 100644 --- a/panel/src/panel/events.js +++ b/panel/src/panel/events.js @@ -39,7 +39,7 @@ export default (panel) => { */ emitter.on("copyToClipboard", async (e) => { navigator.clipboard.writeText(e); - panel.notification.success(panel.t("copied") + "!"); + panel.notification.success(panel.t("copy.success") + "!"); }); /** From 1b98a11e41185ef8f899db13f2b863d298517ab9 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Sat, 9 Nov 2024 13:20:49 +0100 Subject: [PATCH 202/362] Use existing clipboard helper --- panel/src/panel/events.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panel/src/panel/events.js b/panel/src/panel/events.js index 35cf2491c7..7f22804bc2 100644 --- a/panel/src/panel/events.js +++ b/panel/src/panel/events.js @@ -1,4 +1,5 @@ import { lcfirst } from "@/helpers/string"; +import clipboard from "@/helpers/clipboard"; import mitt from "mitt"; /** @@ -38,7 +39,7 @@ export default (panel) => { * @since 5.0.0 */ emitter.on("copyToClipboard", async (e) => { - navigator.clipboard.writeText(e); + clipboard.write(e); panel.notification.success(panel.t("copy.success") + "!"); }); From 1b3a5a5701012f2f5e9fa27d233314d932f9857b Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Sat, 9 Nov 2024 13:41:37 +0100 Subject: [PATCH 203/362] New VersionId option for preview URLs --- config/areas/site/views.php | 18 ++++++++---------- src/Cms/Page.php | 24 +++++++++++++++--------- src/Cms/Site.php | 26 +++++++++++++++++++++----- 3 files changed, 44 insertions(+), 24 deletions(-) diff --git a/config/areas/site/views.php b/config/areas/site/views.php index 8c8d6e8e77..4b294448b8 100644 --- a/config/areas/site/views.php +++ b/config/areas/site/views.php @@ -17,9 +17,8 @@ 'page.preview' => [ 'pattern' => 'pages/(:any)/preview/(changes|latest|compare)', 'action' => function (string $path, string $mode) { - $page = Find::page($path); - $view = $page->panel()->view(); - $preview = $page->previewUrl(); + $page = Find::page($path); + $view = $page->panel()->view(); return [ 'component' => 'k-preview-view', @@ -28,8 +27,8 @@ 'back' => $view['props']['link'], 'mode' => $mode, 'src' => [ - 'changes' => $preview . '?_version=changes', - 'latest' => $preview, + 'changes' => $page->previewUrl('changes'), + 'latest' => $page->previewUrl('latest'), ] ], 'title' => $view['props']['title'] . ' | ' . I18n::translate('changes'), @@ -49,9 +48,8 @@ 'site.preview' => [ 'pattern' => 'site/preview/(changes|latest|compare)', 'action' => function (string $mode) { - $site = App::instance()->site(); - $view = $site->panel()->view(); - $preview = $site->previewUrl(); + $site = App::instance()->site(); + $view = $site->panel()->view(); return [ 'component' => 'k-preview-view', @@ -60,8 +58,8 @@ 'back' => $view['props']['link'], 'mode' => $mode, 'src' => [ - 'changes' => $preview . '?_version=changes', - 'latest' => $preview, + 'changes' => $site->previewUrl('changes'), + 'latest' => $site->previewUrl('latest'), ] ], 'title' => I18n::translate('view.site') . ' | ' . I18n::translate('changes'), diff --git a/src/Cms/Page.php b/src/Cms/Page.php index 81477884a7..1a1131e518 100644 --- a/src/Cms/Page.php +++ b/src/Cms/Page.php @@ -4,6 +4,7 @@ use Closure; use Kirby\Content\Field; +use Kirby\Content\VersionId; use Kirby\Exception\Exception; use Kirby\Exception\InvalidArgumentException; use Kirby\Exception\NotFoundException; @@ -929,26 +930,31 @@ public function permissions(): PagePermissions * Draft preview Url * @internal */ - public function previewUrl(): string|null + public function previewUrl(VersionId|string $version = 'latest'): string|null { - $preview = $this->blueprint()->preview(); + $versionId = VersionId::from($version); + $url = $this->blueprint()->preview(); - if ($preview === false) { + if ($url === false) { return null; } - $url = match ($preview) { - true => $this->url(), - default => $preview + $url = match ($url) { + true, null => $this->url(), + default => $url }; + $uri = new Uri($url ?? $this->url()); + if ($this->isDraft() === true) { - $uri = new Uri($url); $uri->query->token = $this->token(); - $url = $uri->toString(); } - return $url; + if ($versionId->is('changes') === true) { + $uri->query->_version = 'changes'; + } + + return $uri->toString(); } /** diff --git a/src/Cms/Site.php b/src/Cms/Site.php index e9c3142c32..bb681c01e1 100644 --- a/src/Cms/Site.php +++ b/src/Cms/Site.php @@ -2,9 +2,11 @@ namespace Kirby\Cms; +use Kirby\Content\VersionId; use Kirby\Exception\InvalidArgumentException; use Kirby\Exception\LogicException; use Kirby\Filesystem\Dir; +use Kirby\Http\Uri; use Kirby\Panel\Site as Panel; use Kirby\Toolkit\A; @@ -351,13 +353,27 @@ public function permissions(): SitePermissions * Preview Url * @internal */ - public function previewUrl(): string|null + public function previewUrl(VersionId|string $versionId = 'latest'): string|null { - return match ($preview = $this->blueprint()->preview()) { - true => $this->url(), - false => null, - default => $preview + $versionId = VersionId::from($versionId); + $url = $this->blueprint()->preview(); + + if ($url === false) { + return null; + } + + $url = match ($url) { + true, null => $this->url(), + default => $url }; + + $uri = new Uri($url); + + if ($versionId->is('changes') === true) { + $uri->query->_version = 'changes'; + } + + return $uri->toString(); } /** From 23aba266ce55dfe8fae2d0bcb998d90d9e0217b3 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Sat, 9 Nov 2024 13:43:13 +0100 Subject: [PATCH 204/362] Add use statement --- config/areas/site/views.php | 1 + 1 file changed, 1 insertion(+) diff --git a/config/areas/site/views.php b/config/areas/site/views.php index 4b294448b8..99bc955043 100644 --- a/config/areas/site/views.php +++ b/config/areas/site/views.php @@ -2,6 +2,7 @@ use Kirby\Cms\App; use Kirby\Cms\Find; +use Kirby\Toolkit\I18n; return [ 'page' => [ From 05d31fa3502d71c7a265a841638505017edb6d92 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 11 Nov 2024 11:42:47 +0100 Subject: [PATCH 205/362] Remove unnecessary fallback --- src/Cms/Page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cms/Page.php b/src/Cms/Page.php index 1a1131e518..aa3c31bb72 100644 --- a/src/Cms/Page.php +++ b/src/Cms/Page.php @@ -944,7 +944,7 @@ public function previewUrl(VersionId|string $version = 'latest'): string|null default => $url }; - $uri = new Uri($url ?? $this->url()); + $uri = new Uri($url); if ($this->isDraft() === true) { $uri->query->token = $this->token(); From 4c268d76f28212ad9ff5499e469ebf5668003bf5 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 11 Nov 2024 11:58:46 +0100 Subject: [PATCH 206/362] Throw a permission exception if the preview view cannot be visited --- config/areas/site/views.php | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/config/areas/site/views.php b/config/areas/site/views.php index 99bc955043..1fd682e463 100644 --- a/config/areas/site/views.php +++ b/config/areas/site/views.php @@ -2,6 +2,7 @@ use Kirby\Cms\App; use Kirby\Cms\Find; +use Kirby\Exception\PermissionException; use Kirby\Toolkit\I18n; return [ @@ -21,6 +22,13 @@ $page = Find::page($path); $view = $page->panel()->view(); + $changesUrl = $page->previewUrl('changes'); + $latestUrl = $page->previewUrl('latest'); + + if ($latestUrl === null) { + throw new PermissionException('The preview is not available'); + } + return [ 'component' => 'k-preview-view', 'props' => [ @@ -28,8 +36,8 @@ 'back' => $view['props']['link'], 'mode' => $mode, 'src' => [ - 'changes' => $page->previewUrl('changes'), - 'latest' => $page->previewUrl('latest'), + 'changes' => $changesUrl, + 'latest' => $latestUrl, ] ], 'title' => $view['props']['title'] . ' | ' . I18n::translate('changes'), @@ -52,6 +60,13 @@ $site = App::instance()->site(); $view = $site->panel()->view(); + $changesUrl = $site->previewUrl('changes'); + $latestUrl = $site->previewUrl('latest'); + + if ($latestUrl === null) { + throw new PermissionException('The preview is not available'); + } + return [ 'component' => 'k-preview-view', 'props' => [ @@ -59,8 +74,8 @@ 'back' => $view['props']['link'], 'mode' => $mode, 'src' => [ - 'changes' => $site->previewUrl('changes'), - 'latest' => $site->previewUrl('latest'), + 'changes' => $changesUrl, + 'latest' => $latestUrl, ] ], 'title' => I18n::translate('view.site') . ' | ' . I18n::translate('changes'), From 43b0070d2e7d97ef72cd0ad19844ab34015e83da Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 11 Nov 2024 11:58:53 +0100 Subject: [PATCH 207/362] Remove outdated prop --- panel/src/components/Views/ModelView.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/panel/src/components/Views/ModelView.vue b/panel/src/components/Views/ModelView.vue index db9845f6e1..5b131565bc 100644 --- a/panel/src/components/Views/ModelView.vue +++ b/panel/src/components/Views/ModelView.vue @@ -9,7 +9,6 @@ export default { api: String, blueprint: String, buttons: Array, - changesUrl: String, content: Object, id: String, link: String, From b6a041a1d00f7d2f3e8268cd9bfbb6f912c47b63 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 11 Nov 2024 11:59:10 +0100 Subject: [PATCH 208/362] Check for permissions for the preview button in the dropdown --- panel/src/components/Views/Pages/PageView.vue | 2 +- panel/src/components/Views/Pages/SiteView.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/panel/src/components/Views/Pages/PageView.vue b/panel/src/components/Views/Pages/PageView.vue index f66c3c62a9..2bfb8c778c 100644 --- a/panel/src/components/Views/Pages/PageView.vue +++ b/panel/src/components/Views/Pages/PageView.vue @@ -24,7 +24,7 @@ :is-locked="isLocked" :is-unsaved="isUnsaved" :modified="modified" - :preview="api + '/preview/compare'" + :preview="permissions.preview ? api + '/preview/compare' : false" @discard="onDiscard" @submit="onSubmit" /> diff --git a/panel/src/components/Views/Pages/SiteView.vue b/panel/src/components/Views/Pages/SiteView.vue index 235d16771e..8527594275 100644 --- a/panel/src/components/Views/Pages/SiteView.vue +++ b/panel/src/components/Views/Pages/SiteView.vue @@ -20,7 +20,7 @@ :is-locked="isLocked" :is-unsaved="isUnsaved" :modified="modified" - :preview="api + '/preview/compare'" + :preview="permissions.preview ? api + '/preview/compare' : false" @discard="onDiscard" @submit="onSubmit" /> From bb96335bf2c2a9df609931af9d8ed43de67c78cc Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 11 Nov 2024 12:04:41 +0100 Subject: [PATCH 209/362] Leave the preview view on esc --- panel/src/components/Views/PreviewView.vue | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/panel/src/components/Views/PreviewView.vue b/panel/src/components/Views/PreviewView.vue index 6b3d41e1fc..b1416f5efd 100644 --- a/panel/src/components/Views/PreviewView.vue +++ b/panel/src/components/Views/PreviewView.vue @@ -139,6 +139,12 @@ export default { return [this.modes.compare, "-", this.modes.latest, this.modes.changes]; } }, + mounted() { + this.$events.on("keydown.esc", this.onExit); + }, + destroyed() { + this.$events.off("keydown.esc", this.onExit); + }, methods: { changeMode(mode) { if (!mode || !this.modes[mode]) { @@ -155,6 +161,13 @@ export default { await this.$panel.content.discard(); await this.$panel.view.reload(); }, + onExit() { + if (this.$panel.overlays().length > 0) { + return; + } + + this.$panel.view.open(this.link); + }, async onSubmit() { if (this.isLocked === true) { return false; From f9ce581b634c76b9793aeba4bbac9bbd1c597df4 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 11 Nov 2024 12:09:16 +0100 Subject: [PATCH 210/362] Rename clipboard event --- panel/src/panel/events.js | 2 +- src/Panel/Ui/Buttons/PreviewDropdownButton.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/panel/src/panel/events.js b/panel/src/panel/events.js index 7f22804bc2..a99104e3ec 100644 --- a/panel/src/panel/events.js +++ b/panel/src/panel/events.js @@ -38,7 +38,7 @@ export default (panel) => { * Custom copy to clipboard event * @since 5.0.0 */ - emitter.on("copyToClipboard", async (e) => { + emitter.on("clipboard.write", async (e) => { clipboard.write(e); panel.notification.success(panel.t("copy.success") + "!"); }); diff --git a/src/Panel/Ui/Buttons/PreviewDropdownButton.php b/src/Panel/Ui/Buttons/PreviewDropdownButton.php index 61eb5ac7fc..0d6ed526b9 100644 --- a/src/Panel/Ui/Buttons/PreviewDropdownButton.php +++ b/src/Panel/Ui/Buttons/PreviewDropdownButton.php @@ -49,7 +49,7 @@ public function options(): array 'text' => I18n::translate('copy.url'), 'icon' => 'copy', 'click' => [ - 'global' => 'copyToClipboard', + 'global' => 'clipboard.write', 'payload' => $this->copy ] ] From f6cb654728f6d374c578353edefc7c41bc17c9d4 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 11 Nov 2024 12:31:18 +0100 Subject: [PATCH 211/362] =?UTF-8?q?Don=E2=80=99t=20deprecate=20::strings?= =?UTF-8?q?=20just=20yet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Form/Form.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Form/Form.php b/src/Form/Form.php index 0eb692a8cc..85260707b2 100644 --- a/src/Form/Form.php +++ b/src/Form/Form.php @@ -275,8 +275,6 @@ protected static function prepareFieldsForLanguage( /** * Converts the data of fields to strings - * - * @deprecated 5.0.0 Use `::toStoredValues` instead */ public function strings($defaults = false): array { From ba3778e150f1f4a6f2e57e0c97e4cd15b8f7c306 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 11 Nov 2024 12:36:14 +0100 Subject: [PATCH 212/362] Fix the deprecation warning in Field::data --- src/Form/Mixin/Value.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Form/Mixin/Value.php b/src/Form/Mixin/Value.php index 4f4bd91cf3..154b77a738 100644 --- a/src/Form/Mixin/Value.php +++ b/src/Form/Mixin/Value.php @@ -12,8 +12,7 @@ trait Value { /** - * @deprecated 3.5.0 Use `::toStoredValue()` instead - * @todo remove when the general field class setup has been refactored + * @deprecated 5.0.0 Use `::toStoredValue()` instead */ public function data(bool $default = false): mixed { From 49a67de42a8e30035d96f294602740365d1586f0 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 11 Nov 2024 12:45:40 +0100 Subject: [PATCH 213/362] Improve readability and add inline comments --- src/Form/Fields.php | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/Form/Fields.php b/src/Form/Fields.php index ee9ee268ca..e191622572 100644 --- a/src/Form/Fields.php +++ b/src/Form/Fields.php @@ -133,21 +133,27 @@ public function findByKeyRecursive(string $key): Field|FieldClass|null foreach ($names as $name) { $index++; - if ($field = $fields->get($name)) { - if ($count !== $index) { - $form = $field->form(); + // search for the field by name + $field = $fields->get($name); - if ($form instanceof Form === false) { - return null; - } + // if the field cannot be found, + // there's no point in going further + if ($field === null) { + return null; + } + + // there are more parts in the key + if ($index < $count) { + $form = $field->form(); - $fields = $form->fields(); + // the search can only continue for + // fields with valid nested forms + if ($form instanceof Form === false) { + return null; } - continue; + $fields = $form->fields(); } - - return null; } return $field; From fc76eb2ed5d582e7aa326d33aca0896f60114bba Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 11 Nov 2024 13:49:17 +0100 Subject: [PATCH 214/362] Revert unnecessary change --- src/Form/Form.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Form/Form.php b/src/Form/Form.php index 85260707b2..044b65dd38 100644 --- a/src/Form/Form.php +++ b/src/Form/Form.php @@ -122,17 +122,17 @@ public function data($defaults = false, bool $includeNulls = true): array $data = $this->values; foreach ($this->fields as $field) { - if ($field->unset() === true) { - $data[$field->name()] = null; + if ($field->isSaveable() === false || $field->unset() === true) { + if ($includeNulls === true) { + $data[$field->name()] = null; + } else { + unset($data[$field->name()]); + } } else { $data[$field->name()] = $field->toStoredValue($defaults); } } - if ($includeNulls === false) { - $data = array_filter($data, fn ($value) => $value !== null); - } - return $data; } From 0a08c1b8420b7f1b8077f2386ee68c919c5a6a93 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Sat, 9 Nov 2024 17:25:12 +0100 Subject: [PATCH 215/362] `Data::read(fail: false)` --- src/Cms/Language.php | 12 ++---------- src/Cms/Translation.php | 9 ++++----- src/Data/Data.php | 21 ++++++++++++++++----- src/Plugin/Plugin.php | 8 +------- tests/Data/DataTest.php | 9 +++++++++ 5 files changed, 32 insertions(+), 27 deletions(-) diff --git a/src/Cms/Language.php b/src/Cms/Language.php index d5265c2c79..6e02ed50db 100644 --- a/src/Cms/Language.php +++ b/src/Cms/Language.php @@ -375,11 +375,7 @@ public static function loadRules(string $code): array $file = $kirby->root('i18n:rules') . '/' . Str::before($code, '_') . '.json'; } - try { - return Data::read($file); - } catch (\Exception) { - return []; - } + return Data::read($file, fail: false); } /** @@ -471,11 +467,7 @@ public function rules(): array */ public function save(): static { - try { - $existingData = Data::read($this->root()); - } catch (Throwable) { - $existingData = []; - } + $existingData = Data::read($this->root(), fail: false); $data = [ ...$existingData, diff --git a/src/Cms/Translation.php b/src/Cms/Translation.php index 72d473127a..7e0a619b06 100644 --- a/src/Cms/Translation.php +++ b/src/Cms/Translation.php @@ -111,11 +111,10 @@ public static function load( string $root, array $inject = [] ): static { - try { - $data = [...Data::read($root), ...$inject]; - } catch (Exception) { - $data = []; - } + $data = [ + ...Data::read($root, fail: false), + ...$inject + ]; return new static($code, $data); } diff --git a/src/Data/Data.php b/src/Data/Data.php index bf812a9be7..5a01c9071c 100644 --- a/src/Data/Data.php +++ b/src/Data/Data.php @@ -110,11 +110,22 @@ public static function encode($data, string $type): string * the data handler is automatically chosen by * the extension if not specified */ - public static function read(string $file, string|null $type = null): array - { - $type ??= F::extension($file); - $handler = static::handler($type); - return $handler->read($file); + public static function read( + string $file, + string|null $type = null, + bool $fail = true + ): array { + try { + $type ??= F::extension($file); + $handler = static::handler($type); + return $handler->read($file); + } catch (Throwable $e) { + if ($fail === false) { + return []; + } + + throw $e; + } } /** diff --git a/src/Plugin/Plugin.php b/src/Plugin/Plugin.php index 6eb2261548..0946a23115 100644 --- a/src/Plugin/Plugin.php +++ b/src/Plugin/Plugin.php @@ -69,13 +69,7 @@ public function __construct( } // read composer.json and use as info fallback - try { - $info = Data::read($this->manifest()); - } catch (Exception) { - // there is no manifest file or it is invalid - $info = []; - } - + $info = Data::read($this->manifest(), fail: false); $this->info = [...$info, ...$this->info]; // set the license diff --git a/tests/Data/DataTest.php b/tests/Data/DataTest.php index a1261b0470..130dc50ca7 100644 --- a/tests/Data/DataTest.php +++ b/tests/Data/DataTest.php @@ -196,6 +196,15 @@ public function testReadInvalid() Data::read(static::TMP . '/data.foo'); } + /** + * @covers ::read + */ + public function testReadInvalidNoException() + { + $data = Data::read(static::TMP . '/data.foo', fail: false); + $this->assertSame([], $data); + } + /** * @covers ::write * @covers ::handler From d3b8edf184114b8fb5e19aa06c151fbd9f66cdfe Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Mon, 11 Nov 2024 19:43:08 +0100 Subject: [PATCH 216/362] Fix cs --- src/Cms/Language.php | 1 - src/Cms/Translation.php | 1 - 2 files changed, 2 deletions(-) diff --git a/src/Cms/Language.php b/src/Cms/Language.php index 6e02ed50db..bd5f8fb44e 100644 --- a/src/Cms/Language.php +++ b/src/Cms/Language.php @@ -10,7 +10,6 @@ use Kirby\Toolkit\Locale; use Kirby\Toolkit\Str; use Stringable; -use Throwable; /** * The `$language` object represents diff --git a/src/Cms/Translation.php b/src/Cms/Translation.php index 7e0a619b06..13d6df2d46 100644 --- a/src/Cms/Translation.php +++ b/src/Cms/Translation.php @@ -2,7 +2,6 @@ namespace Kirby\Cms; -use Exception; use Kirby\Data\Data; use Kirby\Toolkit\Str; From dc527522f4b35ed793e16de3c7bc967c344b50dd Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 12 Nov 2024 15:12:45 +0100 Subject: [PATCH 217/362] Preflight for 4.5.0-rc.1 --- cacert.pem | 102 +++++++++++++++++- composer.json | 2 +- composer.lock | 2 +- i18n/translations/cs.json | 10 +- i18n/translations/ko.json | 10 +- i18n/translations/nl.json | 6 +- i18n/translations/pt_PT.json | 12 +-- i18n/translations/sv_SE.json | 10 +- panel/dist/css/style.min.css | 2 +- panel/dist/img/icons.svg | 3 + panel/dist/js/Docs.min.js | 2 +- panel/dist/js/DocsView.min.js | 2 +- panel/dist/js/Highlight.min.js | 2 +- panel/dist/js/IndexView.min.js | 2 +- panel/dist/js/PlaygroundView.min.js | 2 +- .../js/container-query-polyfill.modern.min.js | 2 +- panel/dist/js/index.min.js | 2 +- panel/dist/js/vendor.min.js | 6 +- panel/dist/js/vuedraggable.min.js | 2 +- panel/dist/ui/ColoroptionsInput.json | 2 +- panel/dist/ui/RadioField.json | 2 +- panel/dist/ui/RadioInput.json | 2 +- vendor/composer/installed.php | 12 +-- 23 files changed, 150 insertions(+), 49 deletions(-) diff --git a/cacert.pem b/cacert.pem index 86d6cd80cc..f2c24a589d 100644 --- a/cacert.pem +++ b/cacert.pem @@ -1,7 +1,9 @@ ## ## Bundle of CA Root Certificates ## -## Certificate data from Mozilla as of: Tue Jul 2 03:12:04 2024 GMT +## Certificate data from Mozilla as of: Tue Sep 24 03:12:04 2024 GMT +## +## Find updated versions here: https://curl.se/docs/caextract.html ## ## This is a bundle of X.509 certificates of public Certificate Authorities ## (CA). These were automatically extracted from Mozilla's root certificates @@ -14,7 +16,7 @@ ## Just configure this file as the SSLCACertificateFile. ## ## Conversion done with mk-ca-bundle.pl version 1.29. -## SHA256: 456ff095dde6dd73354c5c28c73d9c06f53b61a803963414cb91a1d92945cdd3 +## SHA256: 36105b01631f9fc03b1eca779b44a30a1a5890b9bf8dc07ccb001a07301e01cf ## @@ -3566,3 +3568,99 @@ Y1w8ndYn81LsF7Kpryz3dvgwHQYDVR0OBBYEFJPhQ2NcPJ3WJ/NS7Beyqa8s93b4MA4GA1UdDwEB cFBTApFwhVmpHqTm6iMxoAACMQD94vizrxa5HnPEluPBMBnYfubDl94cT7iJLzPrSA8Z94dGXSaQ pYXFuXqUPoeovQA= -----END CERTIFICATE----- + +TWCA CYBER Root CA +================== +-----BEGIN CERTIFICATE----- +MIIFjTCCA3WgAwIBAgIQQAE0jMIAAAAAAAAAATzyxjANBgkqhkiG9w0BAQwFADBQMQswCQYDVQQG +EwJUVzESMBAGA1UEChMJVEFJV0FOLUNBMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJUV0NB +IENZQkVSIFJvb3QgQ0EwHhcNMjIxMTIyMDY1NDI5WhcNNDcxMTIyMTU1OTU5WjBQMQswCQYDVQQG +EwJUVzESMBAGA1UEChMJVEFJV0FOLUNBMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJUV0NB +IENZQkVSIFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDG+Moe2Qkgfh1s +Ts6P40czRJzHyWmqOlt47nDSkvgEs1JSHWdyKKHfi12VCv7qze33Kc7wb3+szT3vsxxFavcokPFh +V8UMxKNQXd7UtcsZyoC5dc4pztKFIuwCY8xEMCDa6pFbVuYdHNWdZsc/34bKS1PE2Y2yHer43CdT +o0fhYcx9tbD47nORxc5zb87uEB8aBs/pJ2DFTxnk684iJkXXYJndzk834H/nY62wuFm40AZoNWDT +Nq5xQwTxaWV4fPMf88oon1oglWa0zbfuj3ikRRjpJi+NmykosaS3Om251Bw4ckVYsV7r8Cibt4LK +/c/WMw+f+5eesRycnupfXtuq3VTpMCEobY5583WSjCb+3MX2w7DfRFlDo7YDKPYIMKoNM+HvnKkH +IuNZW0CP2oi3aQiotyMuRAlZN1vH4xfyIutuOVLF3lSnmMlLIJXcRolftBL5hSmO68gnFSDAS9TM +fAxsNAwmmyYxpjyn9tnQS6Jk/zuZQXLB4HCX8SS7K8R0IrGsayIyJNN4KsDAoS/xUgXJP+92ZuJF +2A09rZXIx4kmyA+upwMu+8Ff+iDhcK2wZSA3M2Cw1a/XDBzCkHDXShi8fgGwsOsVHkQGzaRP6AzR +wyAQ4VRlnrZR0Bp2a0JaWHY06rc3Ga4udfmW5cFZ95RXKSWNOkyrTZpB0F8mAwIDAQABo2MwYTAO +BgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBSdhWEUfMFib5do5E83 +QOGt4A1WNzAdBgNVHQ4EFgQUnYVhFHzBYm+XaORPN0DhreANVjcwDQYJKoZIhvcNAQEMBQADggIB +AGSPesRiDrWIzLjHhg6hShbNcAu3p4ULs3a2D6f/CIsLJc+o1IN1KriWiLb73y0ttGlTITVX1olN +c79pj3CjYcya2x6a4CD4bLubIp1dhDGaLIrdaqHXKGnK/nZVekZn68xDiBaiA9a5F/gZbG0jAn/x +X9AKKSM70aoK7akXJlQKTcKlTfjF/biBzysseKNnTKkHmvPfXvt89YnNdJdhEGoHK4Fa0o635yDR +IG4kqIQnoVesqlVYL9zZyvpoBJ7tRCT5dEA7IzOrg1oYJkK2bVS1FmAwbLGg+LhBoF1JSdJlBTrq +/p1hvIbZv97Tujqxf36SNI7JAG7cmL3c7IAFrQI932XtCwP39xaEBDG6k5TY8hL4iuO/Qq+n1M0R +FxbIQh0UqEL20kCGoE8jypZFVmAGzbdVAaYBlGX+bgUJurSkquLvWL69J1bY73NxW0Qz8ppy6rBe +Pm6pUlvscG21h483XjyMnM7k8M4MZ0HMzvaAq07MTFb1wWFZk7Q+ptq4NxKfKjLji7gh7MMrZQzv +It6IKTtM1/r+t+FHvpw+PoP7UV31aPcuIYXcv/Fa4nzXxeSDwWrruoBa3lwtcHb4yOWHh8qgnaHl +IhInD0Q9HWzq1MKLL295q39QpsQZp6F6t5b5wR9iWqJDB0BeJsas7a5wFsWqynKKTbDPAYsDP27X +-----END CERTIFICATE----- + +SecureSign Root CA12 +==================== +-----BEGIN CERTIFICATE----- +MIIDcjCCAlqgAwIBAgIUZvnHwa/swlG07VOX5uaCwysckBYwDQYJKoZIhvcNAQELBQAwUTELMAkG +A1UEBhMCSlAxIzAhBgNVBAoTGkN5YmVydHJ1c3QgSmFwYW4gQ28uLCBMdGQuMR0wGwYDVQQDExRT +ZWN1cmVTaWduIFJvb3QgQ0ExMjAeFw0yMDA0MDgwNTM2NDZaFw00MDA0MDgwNTM2NDZaMFExCzAJ +BgNVBAYTAkpQMSMwIQYDVQQKExpDeWJlcnRydXN0IEphcGFuIENvLiwgTHRkLjEdMBsGA1UEAxMU +U2VjdXJlU2lnbiBSb290IENBMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6OcE3 +emhFKxS06+QT61d1I02PJC0W6K6OyX2kVzsqdiUzg2zqMoqUm048luT9Ub+ZyZN+v/mtp7JIKwcc +J/VMvHASd6SFVLX9kHrko+RRWAPNEHl57muTH2SOa2SroxPjcf59q5zdJ1M3s6oYwlkm7Fsf0uZl +fO+TvdhYXAvA42VvPMfKWeP+bl+sg779XSVOKik71gurFzJ4pOE+lEa+Ym6b3kaosRbnhW70CEBF +EaCeVESE99g2zvVQR9wsMJvuwPWW0v4JhscGWa5Pro4RmHvzC1KqYiaqId+OJTN5lxZJjfU+1Uef +NzFJM3IFTQy2VYzxV4+Kh9GtxRESOaCtAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0P +AQH/BAQDAgEGMB0GA1UdDgQWBBRXNPN0zwRL1SXm8UC2LEzZLemgrTANBgkqhkiG9w0BAQsFAAOC +AQEAPrvbFxbS8hQBICw4g0utvsqFepq2m2um4fylOqyttCg6r9cBg0krY6LdmmQOmFxv3Y67ilQi +LUoT865AQ9tPkbeGGuwAtEGBpE/6aouIs3YIcipJQMPTw4WJmBClnW8Zt7vPemVV2zfrPIpyMpce +mik+rY3moxtt9XUa5rBouVui7mlHJzWhhpmA8zNL4WukJsPvdFlseqJkth5Ew1DgDzk9qTPxpfPS +vWKErI4cqc1avTc7bgoitPQV55FYxTpE05Uo2cBl6XLK0A+9H7MV2anjpEcJnuDLN/v9vZfVvhga +aaI5gdka9at/yOPiZwud9AzqVN/Ssq+xIvEg37xEHA== +-----END CERTIFICATE----- + +SecureSign Root CA14 +==================== +-----BEGIN CERTIFICATE----- +MIIFcjCCA1qgAwIBAgIUZNtaDCBO6Ncpd8hQJ6JaJ90t8sswDQYJKoZIhvcNAQEMBQAwUTELMAkG +A1UEBhMCSlAxIzAhBgNVBAoTGkN5YmVydHJ1c3QgSmFwYW4gQ28uLCBMdGQuMR0wGwYDVQQDExRT +ZWN1cmVTaWduIFJvb3QgQ0ExNDAeFw0yMDA0MDgwNzA2MTlaFw00NTA0MDgwNzA2MTlaMFExCzAJ +BgNVBAYTAkpQMSMwIQYDVQQKExpDeWJlcnRydXN0IEphcGFuIENvLiwgTHRkLjEdMBsGA1UEAxMU +U2VjdXJlU2lnbiBSb290IENBMTQwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDF0nqh +1oq/FjHQmNE6lPxauG4iwWL3pwon71D2LrGeaBLwbCRjOfHw3xDG3rdSINVSW0KZnvOgvlIfX8xn +bacuUKLBl422+JX1sLrcneC+y9/3OPJH9aaakpUqYllQC6KxNedlsmGy6pJxaeQp8E+BgQQ8sqVb +1MWoWWd7VRxJq3qdwudzTe/NCcLEVxLbAQ4jeQkHO6Lo/IrPj8BGJJw4J+CDnRugv3gVEOuGTgpa +/d/aLIJ+7sr2KeH6caH3iGicnPCNvg9JkdjqOvn90Ghx2+m1K06Ckm9mH+Dw3EzsytHqunQG+bOE +kJTRX45zGRBdAuVwpcAQ0BB8b8VYSbSwbprafZX1zNoCr7gsfXmPvkPx+SgojQlD+Ajda8iLLCSx +jVIHvXiby8posqTdDEx5YMaZ0ZPxMBoH064iwurO8YQJzOAUbn8/ftKChazcqRZOhaBgy/ac18iz +ju3Gm5h1DVXoX+WViwKkrkMpKBGk5hIwAUt1ax5mnXkvpXYvHUC0bcl9eQjs0Wq2XSqypWa9a4X0 +dFbD9ed1Uigspf9mR6XU/v6eVL9lfgHWMI+lNpyiUBzuOIABSMbHdPTGrMNASRZhdCyvjG817XsY +AFs2PJxQDcqSMxDxJklt33UkN4Ii1+iW/RVLApY+B3KVfqs9TC7XyvDf4Fg/LS8EmjijAQIDAQAB +o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUBpOjCl4oaTeq +YR3r6/wtbyPk86AwDQYJKoZIhvcNAQEMBQADggIBAJaAcgkGfpzMkwQWu6A6jZJOtxEaCnFxEM0E +rX+lRVAQZk5KQaID2RFPeje5S+LGjzJmdSX7684/AykmjbgWHfYfM25I5uj4V7Ibed87hwriZLoA +ymzvftAj63iP/2SbNDefNWWipAA9EiOWWF3KY4fGoweITedpdopTzfFP7ELyk+OZpDc8h7hi2/Ds +Hzc/N19DzFGdtfCXwreFamgLRB7lUe6TzktuhsHSDCRZNhqfLJGP4xjblJUK7ZGqDpncllPjYYPG +FrojutzdfhrGe0K22VoF3Jpf1d+42kd92jjbrDnVHmtsKheMYc2xbXIBw8MgAGJoFjHVdqqGuw6q +nsb58Nn4DSEC5MUoFlkRudlpcyqSeLiSV5sI8jrlL5WwWLdrIBRtFO8KvH7YVdiI2i/6GaX7i+B/ +OfVyK4XELKzvGUWSTLNhB9xNH27SgRNcmvMSZ4PPmz+Ln52kuaiWA3rF7iDeM9ovnhp6dB7h7sxa +OgTdsxoEqBRjrLdHEoOabPXm6RUVkRqEGQ6UROcSjiVbgGcZ3GOTEAtlLor6CZpO2oYofaphNdgO +pygau1LgePhsumywbrmHXumZNTfxPWQrqaA0k89jL9WB365jJ6UeTo3cKXhZ+PmhIIynJkBugnLN +eLLIjzwec+fBH7/PzqUqm9tEZDKgu39cJRNItX+S +-----END CERTIFICATE----- + +SecureSign Root CA15 +==================== +-----BEGIN CERTIFICATE----- +MIICIzCCAamgAwIBAgIUFhXHw9hJp75pDIqI7fBw+d23PocwCgYIKoZIzj0EAwMwUTELMAkGA1UE +BhMCSlAxIzAhBgNVBAoTGkN5YmVydHJ1c3QgSmFwYW4gQ28uLCBMdGQuMR0wGwYDVQQDExRTZWN1 +cmVTaWduIFJvb3QgQ0ExNTAeFw0yMDA0MDgwODMyNTZaFw00NTA0MDgwODMyNTZaMFExCzAJBgNV +BAYTAkpQMSMwIQYDVQQKExpDeWJlcnRydXN0IEphcGFuIENvLiwgTHRkLjEdMBsGA1UEAxMUU2Vj +dXJlU2lnbiBSb290IENBMTUwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQLUHSNZDKZmbPSYAi4Io5G +dCx4wCtELW1fHcmuS1Iggz24FG1Th2CeX2yF2wYUleDHKP+dX+Sq8bOLbe1PL0vJSpSRZHX+AezB +2Ot6lHhWGENfa4HL9rzatAy2KZMIaY+jQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD +AgEGMB0GA1UdDgQWBBTrQciu/NWeUUj1vYv0hyCTQSvT9DAKBggqhkjOPQQDAwNoADBlAjEA2S6J +fl5OpBEHvVnCB96rMjhTKkZEBhd6zlHp4P9mLQlO4E/0BdGF9jVg3PVys0Z9AjBEmEYagoUeYWmJ +SwdLZrWeqrqgHkHZAXQ6bkU6iYAZezKYVWOr62Nuk22rGwlgMU4= +-----END CERTIFICATE----- diff --git a/composer.json b/composer.json index 1ccb4073a2..e75b1e6fff 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "The Kirby core", "license": "proprietary", "type": "kirby-cms", - "version": "4.4.0", + "version": "4.5.0-rc.1", "keywords": [ "kirby", "cms", diff --git a/composer.lock b/composer.lock index ea8097d53d..580d9d07cd 100644 --- a/composer.lock +++ b/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": "a49870b845c1d596a44c5af23c4dd685", + "content-hash": "0cc5ffc791a52ffb1f139b57e2ae953f", "packages": [ { "name": "christian-riesen/base32", diff --git a/i18n/translations/cs.json b/i18n/translations/cs.json index 326b6751f3..e2154f9fc6 100644 --- a/i18n/translations/cs.json +++ b/i18n/translations/cs.json @@ -126,12 +126,12 @@ "error.form.notSaved": "Formulář nemohl být uložen", "error.language.code": "Zadejte prosím platný kód jazyka", - "error.language.create.permission": "You are not allowed to create a language", - "error.language.delete.permission": "You are not allowed to delete the language", + "error.language.create.permission": "Nemáte dovoleno vytvořit jazyk", + "error.language.delete.permission": "Nemáte dovoleno jazyk vymazat", "error.language.duplicate": "Jazyk již existuje", "error.language.name": "Zadejte prosím platné jméno jazyka", "error.language.notFound": "Jazyk nebyl nalezen", - "error.language.update.permission": "You are not allowed to update the language", + "error.language.update.permission": "Nemáte dovoleno aktualizovat jazyk", "error.layout.validation.block": "V rozvržení {layoutIndex} je v poli \"{field}\" v bloku {blockIndex} při použití \"{fieldset}\" typu chyba", "error.layout.validation.settings": "Chyba v nastavení rozvržení {index}", @@ -620,8 +620,8 @@ "stats.empty": "Žádná hlášení", "status": "Stav", - "system.info.copy": "Copy info", - "system.info.copied": "System info copied", + "system.info.copy": "Kopírovat informace", + "system.info.copied": "Systémové informace zkopírovány", "system.issues.content": "Složka content je zřejmě přístupná zvenčí", "system.issues.eol.kirby": "Instalovaná verze Kirby dosáhla konce životnosti a nebude již dále dostávat bezpečnostní aktualizace", "system.issues.eol.plugin": "Instalovaná verze doplňku { plugin } dosáhla konce životnosti a nebude již dále dostávat bezpečnostní aktualizace", diff --git a/i18n/translations/ko.json b/i18n/translations/ko.json index d203767169..4dae542a3e 100644 --- a/i18n/translations/ko.json +++ b/i18n/translations/ko.json @@ -126,12 +126,12 @@ "error.form.notSaved": "항목을 저장할 수 없습니다.", "error.language.code": "올바른 언어 코드를 입력하세요.", - "error.language.create.permission": "You are not allowed to create a language", - "error.language.delete.permission": "You are not allowed to delete the language", + "error.language.create.permission": "언어를 등록할 권한이 없습니다.", + "error.language.delete.permission": "언어를 삭제할 권한이 없습니다.", "error.language.duplicate": "이미 등록한 언어입니다.", "error.language.name": "올바른 언어명을 입력하세요.", "error.language.notFound": "언어를 찾을 수 없습니다.", - "error.language.update.permission": "You are not allowed to update the language", + "error.language.update.permission": "언어를 변경할 권한이 없습니다.", "error.layout.validation.block": "레이아웃({layoutIndex})의 특정 블록 유형({fieldset})을 사용하는 블록({blockIndex})의 특정 필드({field})에 오류가 있습니다.", "error.layout.validation.settings": "레이아웃({index}) 옵션을 확인하세요.", @@ -620,8 +620,8 @@ "stats.empty": "관련 기록이 없습니다.", "status": "상태", - "system.info.copy": "Copy info", - "system.info.copied": "System info copied", + "system.info.copy": "정보 복사", + "system.info.copied": "시스템 정보가 복사되었습니다.", "system.issues.content": "/content 폴더의 권한을 확인하세요.", "system.issues.eol.kirby": "설치된 Kirby 버전이 만료되었습니다. 더 이상 보안 업데이트를 받을 수 없습니다.", "system.issues.eol.plugin": "설치된 플러그인({plugin}의 지원이 종료되었습니다. 더 이상 보안 업데이트를 받을 수 없습니다.", diff --git a/i18n/translations/nl.json b/i18n/translations/nl.json index 997697a581..37fde74dc6 100644 --- a/i18n/translations/nl.json +++ b/i18n/translations/nl.json @@ -126,12 +126,12 @@ "error.form.notSaved": "Het formulier kon niet worden opgeslagen", "error.language.code": "Vul een geldige code voor deze taal in", - "error.language.create.permission": "You are not allowed to create a language", - "error.language.delete.permission": "You are not allowed to delete the language", + "error.language.create.permission": "Je hebt geen rechten om een taal toe te voegen", + "error.language.delete.permission": "Je hebt geen rechten om een taal te verwijderen", "error.language.duplicate": "De taal bestaat al", "error.language.name": "Vul een geldige naam voor deze taal in", "error.language.notFound": "De taal kan niet worden gevonden", - "error.language.update.permission": "You are not allowed to update the language", + "error.language.update.permission": "Je hebt geen rechten om deze taal te updaten", "error.layout.validation.block": "Er is een fout opgetreden bij het \"{field}\" veld in blok {blockIndex} in het \"{fieldset}\" bloktype in layout {layoutIndex}", "error.layout.validation.settings": "Er is een fout gevonden in de instellingen van ontwerp {index} ", diff --git a/i18n/translations/pt_PT.json b/i18n/translations/pt_PT.json index 574c257c87..3da7c4738e 100644 --- a/i18n/translations/pt_PT.json +++ b/i18n/translations/pt_PT.json @@ -104,16 +104,16 @@ "error.file.extension.forbidden": "A extensão \"{extension}\" não é permitida", "error.file.extension.invalid": "Extensão inválida: {extension}", "error.file.extension.missing": "As extensões de \"{filename}\" estão em falta", - "error.file.maxheight": "A altura da imagem não deve exceder {height} pixels", + "error.file.maxheight": "A altura da imagem não deve exceder {height} píxeis", "error.file.maxsize": "O ficheiro é demasiado grande", - "error.file.maxwidth": "A largura da imagem não deve exceder {width} pixels", + "error.file.maxwidth": "A largura da imagem não deve exceder {width} píxeis", "error.file.mime.differs": "O ficheiro enviado precisa de ser do tipo \"{mime}\"", "error.file.mime.forbidden": "O tipo de mídia \"{mime}\" não é permitido", "error.file.mime.invalid": "Tipo de mídia inválido: {mime}", "error.file.mime.missing": "Não foi possível detectar o tipo de mídia de \"{filename}\"", - "error.file.minheight": "A altura da imagem deve ter pelo menos {height} pixels", + "error.file.minheight": "A altura da imagem deve ter pelo menos {height} píxeis", "error.file.minsize": "O ficheiro é demasiado pequeno", - "error.file.minwidth": "A largura da imagem deve ter pelo menos {width} pixels", + "error.file.minwidth": "A largura da imagem deve ter pelo menos {width} píxeis", "error.file.name.unique": "O nome do ficheiro deve ser único", "error.file.name.missing": "O nome do ficheiro não pode ficar em branco", "error.file.notFound": "Não foi possível encontrar o ficheiro \"{filename}\"", @@ -490,7 +490,7 @@ "login.totp.disable.option": "Desativar códigos de segurança", "login.totp.disable.label": "Insira a sua palavra-passe para desativar códigos de segurança", "login.totp.disable.help": "No futuro, um segundo fator diferente, como um código de início de sessão enviado por e-mail, será solicitado quando iniciar a sessão. Poderá configurar códigos de segurança novamente mais tarde.", - "login.totp.disable.admin": "

Isto irá desactivar os códigos de segurança para {user}.

No futuro, um segundo fator diferente, como um código de início de sessão enviado por e-mail, será solicitado quando eles iniciarem a sessão. {user} poderá configurar códigos de segurança novamente após o próximo início de sessão.

", + "login.totp.disable.admin": "

Isto irá desativar os códigos de segurança para {user}.

No futuro, um segundo fator diferente, como um código de início de sessão enviado por e-mail, será solicitado quando eles iniciarem a sessão. {user} poderá configurar códigos de segurança novamente após o próximo início de sessão.

", "login.totp.disable.success": "Códigos de segurança desativados", "logout": "Sair", @@ -573,7 +573,7 @@ "paste": "Colar", "paste.after": "Colar após", "paste.success": "{count} colados!", - "pixel": "Pixel", + "pixel": "Píxel", "plugin": "Plugin", "plugins": "Plugins", "prev": "Anterior", diff --git a/i18n/translations/sv_SE.json b/i18n/translations/sv_SE.json index feb5caf9c9..75e2e206ed 100644 --- a/i18n/translations/sv_SE.json +++ b/i18n/translations/sv_SE.json @@ -126,12 +126,12 @@ "error.form.notSaved": "Formuläret kunde inte sparas", "error.language.code": "Ange en giltig kod för språket", - "error.language.create.permission": "You are not allowed to create a language", - "error.language.delete.permission": "You are not allowed to delete the language", + "error.language.create.permission": "Du saknar behörighet att skapa ett nytt språk", + "error.language.delete.permission": "Du saknar behörighet att radera språket", "error.language.duplicate": "Språket finns redan", "error.language.name": "Ange ett giltigt namn för språket", "error.language.notFound": "Språket hittades inte", - "error.language.update.permission": "You are not allowed to update the language", + "error.language.update.permission": "Du saknar behörighet att redigera språket", "error.layout.validation.block": "Det finns ett fel i fältet \"{field}\" i blocket {blockIndex} med blocktypen \"{fieldset}\" i layouten {layoutIndex}", "error.layout.validation.settings": "Det finns ett fel i inställningarna för layout {index}", @@ -620,8 +620,8 @@ "stats.empty": "Inga rapporter", "status": "Status", - "system.info.copy": "Copy info", - "system.info.copied": "System info copied", + "system.info.copy": "Kopiera info", + "system.info.copied": "Systeminformation kopierad", "system.issues.content": "Mappen content verkar vara exponerad", "system.issues.eol.kirby": "Din installerade Kirby-version har nått slutet av sin livscykel och kommer inte att få fler säkerhetsuppdateringar", "system.issues.eol.plugin": "Den installerade versionen av tillägget { plugin } har nått slutet på sin livscykel och kommer inte att få fler säkerhetsuppdateringar.", diff --git a/panel/dist/css/style.min.css b/panel/dist/css/style.min.css index 0a7f7067f7..428cf4b381 100644 --- a/panel/dist/css/style.min.css +++ b/panel/dist/css/style.min.css @@ -1 +1 @@ -.k-items{position:relative;display:grid;container-type:inline-size}.k-items[data-layout=list]{gap:2px}.k-items[data-layout=cardlets]{--items-size: 1fr;display:grid;gap:.75rem;grid-template-columns:repeat(auto-fill,minmax(var(--items-size),1fr))}@container (min-width: 15rem){.k-items[data-layout=cardlets]{--items-size: 15rem}}.k-items[data-layout=cards]{display:grid;gap:1.5rem;grid-template-columns:1fr}@container (min-width: 6rem){.k-items[data-layout=cards][data-size=tiny]{grid-template-columns:repeat(auto-fill,minmax(6rem,1fr))}}@container (min-width: 9rem){.k-items[data-layout=cards][data-size=small]{grid-template-columns:repeat(auto-fill,minmax(9rem,1fr))}}@container (min-width: 12rem){.k-items[data-layout=cards][data-size=auto],.k-items[data-layout=cards][data-size=medium]{grid-template-columns:repeat(auto-fill,minmax(12rem,1fr))}}@container (min-width: 15rem){.k-items[data-layout=cards][data-size=large]{grid-template-columns:repeat(auto-fill,minmax(15rem,1fr))}}@container (min-width: 18rem){.k-items[data-layout=cards][data-size=huge]{grid-template-columns:repeat(auto-fill,minmax(18rem,1fr))}}.k-collection-footer{display:flex;justify-content:space-between;align-items:flex-start;flex-wrap:nowrap;gap:var(--spacing-12);margin-top:var(--spacing-2)}.k-empty{max-width:100%}:root{--item-button-height: var(--height-md);--item-button-width: var(--height-md);--item-height: auto;--item-height-cardlet: calc(var(--height-md) * 3)}.k-item{position:relative;background:var(--color-white);box-shadow:var(--shadow);border-radius:var(--rounded);height:var(--item-height);container-type:inline-size}.k-item:has(a:focus){outline:2px solid var(--color-focus)}@supports not selector(:has(*)){.k-item:focus-within{outline:2px solid var(--color-focus)}}.k-item .k-icon-frame{--back: var(--color-gray-300)}.k-item-content{line-height:1.25;overflow:hidden;padding:var(--spacing-2)}.k-item-content a:focus{outline:0}.k-item-content a:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0}.k-item-info{color:var(--color-text-dimmed)}.k-item-options{transform:translate(0);z-index:1;display:flex;align-items:center;justify-content:space-between}.k-item-options[data-only-option=true]{justify-content:flex-end}.k-item-options .k-button{--button-height: var(--item-button-height);--button-width: var(--item-button-width)}.k-item .k-sort-button{position:absolute;z-index:2}.k-item:not(:hover):not(.k-sortable-fallback) .k-sort-button{opacity:0}.k-item[data-layout=list]{--item-height: var( --field-input-height );--item-button-height: var(--item-height);--item-button-width: auto;display:grid;height:var(--item-height);align-items:center;grid-template-columns:1fr auto}.k-item[data-layout=list][data-has-image=true]{grid-template-columns:var(--item-height) 1fr auto}.k-item[data-layout=list] .k-frame{--ratio: 1/1;border-start-start-radius:var(--rounded);border-end-start-radius:var(--rounded);height:var(--item-height)}.k-item[data-layout=list] .k-item-content{display:flex;min-width:0;white-space:nowrap;gap:var(--spacing-2);justify-content:space-between}.k-item[data-layout=list] .k-item-title,.k-item[data-layout=list] .k-item-info{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.k-item[data-layout=list] .k-item-title{flex-shrink:1}.k-item[data-layout=list] .k-item-info{flex-shrink:2}@container (max-width: 30rem){.k-item[data-layout=list] .k-item-title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.k-item[data-layout=list] .k-item-info{display:none}}.k-item[data-layout=list] .k-sort-button{--button-width: calc(1.5rem + var(--spacing-1));--button-height: var(--item-height);left:calc(-1 * var(--button-width))}.k-item:is([data-layout=cardlets],[data-layout=cards]) .k-sort-button{top:var(--spacing-2);inset-inline-start:var(--spacing-2);background:#ffffff7f;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);box-shadow:0 2px 5px #0003;--button-width: 1.5rem;--button-height: 1.5rem;--button-rounded: var(--rounded-sm);--button-padding: 0;--icon-size: 14px}.k-item:is([data-layout=cardlets],[data-layout=cards]) .k-sort-button:hover{background:#fffffff2}.k-item[data-layout=cardlets]{--item-height: var(--item-height-cardlet);display:grid;grid-template-areas:"content" "options";grid-template-columns:1fr;grid-template-rows:1fr var(--height-md)}.k-item[data-layout=cardlets][data-has-image=true]{grid-template-areas:"image content" "image options";grid-template-columns:minmax(0,var(--item-height)) 1fr}.k-item[data-layout=cardlets] .k-frame{grid-area:image;border-start-start-radius:var(--rounded);border-end-start-radius:var(--rounded);aspect-ratio:auto;height:var(--item-height)}.k-item[data-layout=cardlets] .k-item-content{grid-area:content}.k-item[data-layout=cardlets] .k-item-info{margin-top:.125em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.k-item[data-layout=cardlets] .k-item-options{grid-area:options}.k-item[data-layout=cards]{display:flex;flex-direction:column}.k-item[data-layout=cards] .k-frame{border-start-start-radius:var(--rounded);border-start-end-radius:var(--rounded)}.k-item[data-layout=cards] .k-item-content{flex-grow:1;padding:var(--spacing-2)}.k-item[data-layout=cards] .k-item-info{margin-top:.125em}.k-item[data-theme=disabled]{background:transparent;box-shadow:none;outline:1px solid var(--color-border);outline-offset:-1px}.k-dialog-body{padding:var(--dialog-padding)}.k-dialog[data-has-footer=true] .k-dialog-body{padding-bottom:0}.k-button-group.k-dialog-buttons{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-3);--button-height: var(--height-lg)}.k-dialog-fields{padding-bottom:.5rem;container-type:inline-size}.k-dialog-footer{padding:var(--dialog-padding);line-height:1;flex-shrink:0}.k-dialog .k-notification{padding-block:.325rem;border-start-start-radius:var(--dialog-rounded);border-start-end-radius:var(--dialog-rounded);margin-top:-1px}.k-dialog-search{margin-bottom:.75rem;--input-color-border: transparent;--input-color-back: var(--color-gray-300)}:root{--dialog-color-back: var(--color-light);--dialog-color-text: currentColor;--dialog-margin: var(--spacing-6);--dialog-padding: var(--spacing-6);--dialog-rounded: var(--rounded-xl);--dialog-shadow: var(--shadow-xl);--dialog-width: 22rem}.k-dialog-portal{padding:var(--dialog-margin)}.k-dialog{position:relative;background:var(--dialog-color-back);color:var(--dialog-color-text);width:clamp(10rem,100%,var(--dialog-width));box-shadow:var(--dialog-shadow);border-radius:var(--dialog-rounded);line-height:1;display:flex;flex-direction:column;overflow:clip;container-type:inline-size}@media screen and (min-width: 20rem){.k-dialog[data-size=small]{--dialog-width: 20rem}}@media screen and (min-width: 22rem){.k-dialog[data-size=default]{--dialog-width: 22rem}}@media screen and (min-width: 30rem){.k-dialog[data-size=medium]{--dialog-width: 30rem}}@media screen and (min-width: 40rem){.k-dialog[data-size=large]{--dialog-width: 40rem}}@media screen and (min-width: 60rem){.k-dialog[data-size=huge]{--dialog-width: 60rem}}.k-dialog .k-pagination{margin-bottom:-1.5rem;display:flex;justify-content:center;align-items:center}.k-changes-dialog .k-headline{margin-top:-.5rem;margin-bottom:var(--spacing-3)}.k-error-details{background:var(--color-white);display:block;overflow:auto;padding:1rem;font-size:var(--text-sm);line-height:1.25em;margin-top:.75rem}.k-error-details dt{color:var(--color-red-500);margin-bottom:.25rem}.k-error-details dd{overflow:hidden;overflow-wrap:break-word;text-overflow:ellipsis}.k-error-details dd:not(:last-of-type){margin-bottom:1.5em}.k-error-details li{white-space:pre-line}.k-error-details li:not(:last-child){border-bottom:1px solid var(--color-background);padding-bottom:.25rem;margin-bottom:.25rem}.k-models-dialog .k-list-item{cursor:pointer}.k-models-dialog .k-choice-input{--choice-color-checked: var(--color-focus);display:flex;align-items:center;height:var(--item-button-height);margin-inline-end:var(--spacing-3)}.k-models-dialog .k-choice-input input{top:0}.k-models-dialog .k-collection-footer .k-pagination{margin-bottom:0}.k-license-dialog-status{display:flex;align-items:center;gap:var(--spacing-2)}.k-license-dialog .k-icon{color:var(--theme-color-700)}.k-page-template-switch{margin-bottom:var(--spacing-6);padding-bottom:var(--spacing-6);border-bottom:1px dashed var(--color-gray-300)}.k-page-move-dialog .k-headline{margin-bottom:var(--spacing-2)}.k-page-move-parent{--tree-color-back: var(--color-white);--tree-color-hover-back: var(--color-light);padding:var(--spacing-3);background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow)}.k-pages-dialog-navbar{display:flex;align-items:center;justify-content:center;margin-bottom:.5rem;padding-inline-end:38px}.k-pages-dialog-navbar .k-button[aria-disabled]{opacity:0}.k-pages-dialog-navbar .k-headline{flex-grow:1;text-align:center}.k-pages-dialog-option[aria-disabled]{opacity:.25}.k-search-dialog{--dialog-padding: 0;--dialog-rounded: var(--rounded);overflow:visible}.k-overlay[open][data-type=dialog]>.k-portal>.k-search-dialog{margin-top:0}.k-totp-dialog-headline{margin-bottom:var(--spacing-1)}.k-totp-dialog-intro{margin-bottom:var(--spacing-6)}.k-totp-dialog-grid{display:grid;gap:var(--spacing-6)}@media screen and (min-width: 40rem){.k-totp-dialog-grid{grid-template-columns:1fr 1fr;gap:var(--spacing-8)}}.k-totp-qrcode .k-box[data-theme]{padding:var(--box-padding-inline)}.k-totp-dialog-fields .k-field-name-confirm{--input-height: var(--height-xl);--input-rounded: var(--rounded);--input-font-size: var(--text-3xl)}.k-upload-dialog.k-dialog{--dialog-width: 40rem}.k-upload-replace-dialog .k-upload-items{display:flex;gap:var(--spacing-3);align-items:center}.k-upload-original{width:6rem;border-radius:var(--rounded);box-shadow:var(--shadow);overflow:hidden}.k-upload-replace-dialog .k-upload-item{flex-grow:1}.k-drawer-body{padding:var(--drawer-body-padding);flex-grow:1;background:var(--color-background)}.k-drawer-body .k-writer-input:focus-within .k-toolbar:not([data-inline=true]),.k-drawer-body .k-textarea-input-wrapper:focus-within .k-toolbar,.k-drawer-body .k-table th{top:-1.5rem}.k-drawer-header{--button-height: calc(var(--drawer-header-height) - var(--spacing-1));flex-shrink:0;height:var(--drawer-header-height);padding-inline-start:var(--drawer-header-padding);display:flex;align-items:center;line-height:1;justify-content:space-between;background:var(--color-white);font-size:var(--text-sm)}.k-drawer-breadcrumb{flex-grow:1}.k-drawer-options{display:flex;align-items:center;padding-inline-end:.75rem}.k-drawer-option{--button-width: var(--button-height)}.k-drawer-option[aria-disabled]{opacity:var(--opacity-disabled)}.k-notification.k-drawer-notification{padding:.625rem 1.5rem}.k-drawer-tabs{display:flex;align-items:center;line-height:1}.k-drawer-tab.k-button{--button-height: calc(var(--drawer-header-height) - var(--spacing-1));--button-padding: var(--spacing-3);display:flex;align-items:center;font-size:var(--text-xs);overflow-x:visible}.k-drawer-tab.k-button[aria-current]:after{position:absolute;bottom:-2px;inset-inline:var(--button-padding);content:"";background:var(--color-black);height:2px;z-index:1}:root{--drawer-body-padding: 1.5rem;--drawer-color-back: var(--color-light);--drawer-header-height: 2.5rem;--drawer-header-padding: 1rem;--drawer-shadow: var(--shadow-xl);--drawer-width: 50rem}.k-drawer-overlay+.k-drawer-overlay{--overlay-color-back: none}.k-drawer{--header-sticky-offset: calc(var(--drawer-body-padding) * -1);z-index:var(--z-toolbar);flex-basis:var(--drawer-width);position:relative;display:flex;flex-direction:column;background:var(--drawer-color-back);box-shadow:var(--drawer-shadow);container-type:inline-size}.k-drawer[aria-disabled]{display:none;pointer-events:none}.k-dropdown{position:relative}:root{--dropdown-color-bg: var(--color-black);--dropdown-color-text: var(--color-white);--dropdown-color-hr: rgba(255, 255, 255, .25);--dropdown-padding: var(--spacing-2);--dropdown-rounded: var(--rounded);--dropdown-shadow: var(--shadow-xl)}.k-dropdown-content{--dropdown-x: 0;--dropdown-y: 0;position:absolute;inset-block-start:0;inset-inline-start:initial;left:0;width:max-content;padding:var(--dropdown-padding);background:var(--dropdown-color-bg);border-radius:var(--dropdown-rounded);color:var(--dropdown-color-text);box-shadow:var(--dropdown-shadow);text-align:start;transform:translate(var(--dropdown-x),var(--dropdown-y))}.k-dropdown-content::backdrop{background:none}.k-dropdown-content[data-align-x=end]{--dropdown-x: -100%}.k-dropdown-content[data-align-x=center]{--dropdown-x: -50%}.k-dropdown-content[data-align-y=top]{--dropdown-y: -100%}.k-dropdown-content hr{margin:.5rem 0;height:1px;background:var(--dropdown-color-hr)}.k-dropdown-content[data-theme=light]{--dropdown-color-bg: var(--color-white);--dropdown-color-text: var(--color-black);--dropdown-color-hr: rgba(0, 0, 0, .1)}.k-dropdown-item.k-button{--button-align: flex-start;--button-color-text: var(--dropdown-color-text);--button-height: var(--height-sm);--button-rounded: var(--rounded-sm);--button-width: 100%;display:flex;gap:.75rem}.k-dropdown-item.k-button:focus{outline:var(--outline)}.k-dropdown-item.k-button[aria-current]{--button-color-text: var(--color-blue-500)}.k-dropdown-item.k-button:not([aria-disabled]):hover{--button-color-back: var(--dropdown-color-hr)}.k-options-dropdown{display:flex;justify-content:center;align-items:center}:root{--picklist-rounded: var(--rounded-sm);--picklist-highlight: var(--color-yellow-500)}.k-picklist-input{--choice-color-text: currentColor;--button-rounded: var(--picklist-rounded)}.k-picklist-input-header{--input-rounded: var(--picklist-rounded)}.k-picklist-input-search{display:flex;align-items:center;border-radius:var(--picklist-rounded)}.k-picklist-input-search .k-search-input{height:var(--button-height)}.k-picklist-input-search:focus-within{outline:var(--outline)}.k-picklist-dropdown .k-picklist-input-create:focus{outline:0}.k-picklist-dropdown .k-picklist-input-create[aria-disabled=true]{visibility:hidden}.k-picklist-input-options.k-grid{--columns: 1}.k-picklist-input-options li+li{margin-top:var(--spacing-1)}.k-picklist-input-options .k-choice-input{padding-inline:var(--spacing-2)}.k-picklist-input-options .k-choice-input{--choice-color-checked: var(--color-focus)}.k-picklist-input-options .k-choice-input:has(:checked){--choice-color-text: var(--color-focus)}.k-picklist-input-options .k-choice-input[aria-disabled=true]{--choice-color-text: var(--color-text-dimmed)}.k-picklist-input-options .k-choice-input:has(:focus-within){outline:var(--outline)}.k-picklist-input-options .k-choice-input b{font-weight:var(--font-normal);color:var(--picklist-highlight)}.k-picklist-input-more.k-button{--button-width: 100%;--button-align: start;--button-color-text: var(--color-text-dimmed);padding-inline:var(--spacing-2)}.k-picklist-input-more.k-button .k-button-icon{position:relative;inset-inline-start:-1px}.k-picklist-input-empty{height:var(--button-height);line-height:1.25rem;padding:var(--spacing-1) var(--spacing-2);color:var(--color-text-dimmed)}.k-picklist-dropdown{--color-text-dimmed: var(--color-gray-400);padding:0;max-width:30rem;min-width:8rem}.k-picklist-dropdown :where(.k-picklist-input-header,.k-picklist-input-body,.k-picklist-input-footer){padding:var(--dropdown-padding)}.k-picklist-dropdown .k-picklist-input-header{border-bottom:1px solid var(--dropdown-color-hr)}.k-picklist-dropdown .k-picklist-input-search{background:var(--dropdown-color-hr);padding-inline-end:var(--input-padding)}.k-picklist-dropdown .k-picklist-input-create{--button-rounded: 1rem;--button-height: 1.125rem}.k-picklist-dropdown .k-picklist-input-create:focus{--button-color-back: var(--color-blue-500);--button-color-text: var(--color-black)}.k-picklist-dropdown .k-picklist-input-body{max-height:calc(var(--button-height) * 9.5 + 2px * 9 + var(--dropdown-padding));overflow-y:auto;outline-offset:-2px;overscroll-behavior:contain;scroll-padding-top:var(--dropdown-padding);scroll-padding-bottom:var(--dropdown-padding)}.k-picklist-dropdown .k-picklist-input-options .k-choice-input{--choice-color-border: var(--dropdown-color-hr);--choice-color-back: var(--dropdown-color-hr);--choice-color-info: var(--color-text-dimmed);min-height:var(--button-height);border-radius:var(--picklist-rounded);padding-block:.375rem}.k-picklist-dropdown .k-picklist-input-options li+li{margin-top:0}.k-picklist-dropdown .k-picklist-input-options .k-choice-input[aria-disabled=true] input{--choice-color-border: var(--dropdown-color-hr);--choice-color-back: var(--dropdown-color-hr);--choice-color-checked: var(--dropdown-color-hr);opacity:var(--opacity-disabled)}.k-picklist-dropdown .k-picklist-input-options .k-choice-input:not([aria-disabled=true]):hover{background-color:var(--dropdown-color-hr)}.k-picklist-dropdown .k-picklist-input-options .k-choice-input:not([aria-disabled=true]):focus-within{--choice-color-text: var(--color-blue-500)}.k-picklist-dropdown .k-picklist-input-more.k-button:hover{--button-color-back: var(--dropdown-color-hr)}.k-picklist-dropdown .k-picklist-input-body+.k-picklist-input-footer{border-top:1px solid var(--dropdown-color-hr)}.k-counter{font-size:var(--text-xs);color:var(--color-gray-900)}.k-counter[data-invalid=true]{color:var(--color-red-700)}.k-counter-rules{color:var(--color-gray-600);padding-inline-start:.5rem}.k-form-submitter{display:none}.k-field[data-disabled=true]{cursor:not-allowed}.k-field[data-disabled=true] *{pointer-events:none}.k-field[data-disabled=true] .k-text[data-theme=help] *{pointer-events:initial}.k-field-header{display:flex;justify-content:space-between;align-items:center;gap:var(--spacing-6);position:relative;margin-bottom:var(--spacing-2)}.k-field-options{flex-shrink:0}.k-field:focus-within>.k-field-header>.k-field-counter{display:block}.k-field-footer{margin-top:var(--spacing-2)}.k-fieldset{border:0}:root{--input-color-back: var(--color-white);--input-color-border: var(--color-border);--input-color-description: var(--color-text-dimmed);--input-color-icon: currentColor;--input-color-placeholder: var(--color-gray-600);--input-color-text: currentColor;--input-font-family: var(--font-sans);--input-font-size: var(--text-sm);--input-height: 2.25rem;--input-leading: 1;--input-outline-focus: var(--outline);--input-padding: var(--spacing-2);--input-padding-multiline: .475rem var(--input-padding);--input-rounded: var(--rounded);--input-shadow: none}@media (pointer: coarse){:root{--input-font-size: var(--text-md);--input-padding-multiline: .375rem var(--input-padding)}}.k-input{display:flex;align-items:center;line-height:var(--input-leading);border:0;background:var(--input-color-back);border-radius:var(--input-rounded);outline:1px solid var(--input-color-border);color:var(--input-color-text);min-height:var(--input-height);box-shadow:var(--input-shadow);font-family:var(--input-font-family);font-size:var(--input-font-size)}.k-input:focus-within{outline:var(--input-outline-focus)}.k-input-element{flex-grow:1}.k-input-icon{color:var(--input-color-icon);display:flex;justify-content:center;align-items:center;width:var(--input-height)}.k-input-icon-button{width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-shrink:0}.k-input-description{color:var(--input-color-description);padding-inline:var(--input-padding)}.k-input-before{padding-inline-end:0}.k-input-after{padding-inline-start:0}.k-input :where(.k-input-description,.k-input-icon){align-self:stretch;display:flex;align-items:center;flex-shrink:0}.k-input[data-disabled=true]{--input-color-back: var(--color-background);--input-color-icon: var(--color-gray-600);pointer-events:none}.k-block-title{display:flex;align-items:center;min-width:0;padding-inline-end:.75rem;line-height:1;gap:var(--spacing-2)}.k-block-icon{--icon-color: var(--color-gray-600);width:1rem}.k-block-label{color:var(--color-text-dimmed);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.k-block-type-default .k-block-title{line-height:1.5em}.k-block-options{--toolbar-size: 30px;box-shadow:var(--shadow-toolbar)}.k-block-options>.k-button:not(:last-of-type){border-inline-end:1px solid var(--color-background)}.k-block-options .k-dropdown-content{margin-top:.5rem}.k-block-container{position:relative;padding:var(--spacing-3);background:var(--color-white);border-radius:var(--rounded)}.k-block-container:not(:last-of-type){border-bottom:1px dashed rgba(0,0,0,.1)}.k-block-container:focus{outline:0}.k-block-container[data-selected=true]{z-index:2;outline:var(--outline);border-bottom-color:transparent}.k-block-container[data-batched=true]:after{position:absolute;top:0;right:0;bottom:0;left:0;content:"";background:#b1c2d82d;mix-blend-mode:multiply}.k-block-container .k-block-options{display:none;position:absolute;top:0;inset-inline-end:var(--spacing-3);margin-top:calc(-1.75rem + 2px)}.k-block-container[data-last-selected=true]>.k-block-options{display:flex}.k-block-container[data-hidden=true] .k-block{opacity:.25}.k-drawer-options .k-drawer-option[data-disabled=true]{vertical-align:middle;display:inline-grid}.k-block-container[data-disabled=true]{background:var(--color-background)}.k-block-container:is(.k-sortable-ghost,.k-sortable-fallback) .k-block{position:relative;max-height:4rem;overflow:hidden}.k-block-container:is(.k-sortable-ghost,.k-sortable-fallback) .k-block:after{position:absolute;bottom:0;content:"";height:2rem;width:100%;background:linear-gradient(to top,var(--color-white),transparent)}.k-blocks{border-radius:var(--rounded)}.k-blocks:not([data-empty=true],[data-disabled=true]){background:var(--color-white);box-shadow:var(--shadow)}.k-blocks[data-disabled=true]:not([data-empty=true]){border:1px solid var(--input-color-border)}.k-blocks-list[data-multi-select-key=true]>.k-block-container *{pointer-events:none}.k-blocks-list[data-multi-select-key=true]>.k-block-container .k-blocks *{pointer-events:all}.k-blocks .k-sortable-ghost{outline:2px solid var(--color-focus);box-shadow:#11111140 0 5px 10px;cursor:grabbing;cursor:-moz-grabbing;cursor:-webkit-grabbing}.k-blocks-list>.k-blocks-empty{display:flex;align-items:center}.k-block-importer .k-dialog-body{padding:0}.k-block-importer label{display:block;padding:var(--spacing-6) var(--spacing-6) 0;color:var(--color-text-dimmed);line-height:var(--leading-normal)}.k-block-importer label small{display:block;font-size:inherit}.k-block-importer textarea{width:100%;height:20rem;background:none;font:inherit;color:var(--color-white);border:0;padding:var(--spacing-6);resize:none}.k-block-importer textarea:focus{outline:0}.k-block-selector .k-headline{margin-bottom:1rem}.k-block-selector details+details{margin-top:var(--spacing-6)}.k-block-selector summary{font-size:var(--text-xs);cursor:pointer;color:var(--color-text-dimmed)}.k-block-selector details:only-of-type summary{pointer-events:none}.k-block-selector summary:focus{outline:0}.k-block-selector summary:focus-visible{color:var(--color-focus)}.k-block-types{display:grid;grid-gap:2px;margin-top:.75rem;grid-template-columns:repeat(1,1fr)}.k-block-types .k-button{--button-color-icon: var(--color-text);--button-color-back: var(--color-white);--button-padding: var(--spacing-3);width:100%;justify-content:start;gap:1rem;box-shadow:var(--shadow)}.k-block-types .k-button[aria-disabled]{opacity:var(--opacity-disabled);--button-color-back: var(--color-gray-200);box-shadow:none}.k-clipboard-hint{padding-top:1.5rem;line-height:var(--leading-normal);font-size:var(--text-xs);color:var(--color-text-dimmed)}.k-clipboard-hint small{display:block;font-size:inherit;color:var(--color-text-dimmed)}.k-block-background-dropdown>.k-button{--color-frame-rounded: 0;--color-frame-size: 1.5rem;--button-height: 1.5rem;--button-padding: 0 .125rem;--button-color-back: var(--color-white);gap:.25rem;box-shadow:var(--shadow-toolbar);border:1px solid var(--color-white)}.k-block-background-dropdown .k-color-frame{border-right:1px solid var(--color-gray-300)}.k-block-background-dropdown .k-color-frame:after{box-shadow:none}.k-block .k-block-background-dropdown{position:absolute;inset-inline-end:var(--spacing-3);bottom:var(--spacing-3);opacity:0;transition:opacity .2s ease-in-out}.k-block:hover .k-block-background-dropdown{opacity:1}.k-block-figure:not([data-empty=true]){--block-figure-back: var(--color-white);background:var(--block-figure-back)}.k-block-figure-container:not([data-disabled=true]){cursor:pointer}.k-block-figure iframe{border:0;pointer-events:none;background:var(--color-black)}.k-block-figure figcaption{padding-top:.5rem;color:var(--color-text-dimmed);font-size:var(--text-sm);text-align:center}.k-block-figure-empty{--button-width: 100%;--button-height: 6rem;--button-color-text: var(--color-text-dimmed);--button-color-back: var(--color-gray-200)}.k-block-figure-empty,.k-block-figure-container>*{border-radius:var(--rounded-sm)}.k-block-figure-caption{display:flex;justify-content:center;padding-top:var(--spacing-3)}.k-block-figure-caption .k-writer{width:max-content;text-align:center}.k-block-figure-caption .k-writer .k-text{color:var(--color-gray-600);font-size:var(--text-sm);mix-blend-mode:exclusion}.k-block-type-code-editor{position:relative}.k-block-type-code-editor .k-input{--input-color-border: none;--input-color-back: var(--color-black);--input-color-text: var(--color-white);--input-font-family: var(--font-mono);--input-outline-focus: none;--input-padding: var(--spacing-3);--input-padding-multiline: var(--input-padding)}.k-block-type-code-editor .k-input[data-type=textarea]{white-space:pre-wrap}.k-block-type-code-editor-language{--input-font-size: var(--text-xs);position:absolute;inset-inline-end:0;bottom:0}.k-block-type-code-editor-language .k-input-element{padding-inline-start:1.5rem}.k-block-type-code-editor-language .k-input-icon{inset-inline-start:0}.k-block-container.k-block-container-type-fields{padding-block:0}.k-block-container:not([data-hidden=true]) .k-block-type-fields>:not([data-collapsed=true]){padding-bottom:var(--spacing-3)}.k-block-type-fields-header{display:flex;justify-content:space-between}.k-block-type-fields-header .k-block-title{padding-block:var(--spacing-3);cursor:pointer;white-space:nowrap}.k-block-type-fields-form{background-color:var(--color-gray-200);padding:var(--spacing-6) var(--spacing-6) var(--spacing-8);border-radius:var(--rounded-sm);container:column / inline-size}.k-block-container-type-fields[data-hidden=true] :where(.k-drawer-tabs,.k-block-type-fields-form){display:none}.k-block-container.k-block-container-type-gallery{padding:0}.k-block-type-gallery>figure{padding:var(--spacing-3);border-radius:var(--rounded)}.k-block-type-gallery>figure:not([data-empty=true]){background:var(--block-back)}.k-block-type-gallery ul{display:grid;grid-gap:.75rem;grid-template-columns:repeat(auto-fit,minmax(6rem,1fr));line-height:0;align-items:center;justify-content:center}.k-block-type-gallery:not([data-disabled=true]) ul{cursor:pointer}.k-block-type-gallery ul .k-image-frame{border-radius:var(--rounded-sm)}.k-block-type-gallery[data-disabled=true] .k-block-type-gallery-placeholder{background:var(--color-gray-250)}.k-block-type-gallery-placeholder{background:var(--color-background)}.k-block-type-heading-input{display:flex;align-items:center;line-height:1.25em;font-size:var(--text-size);font-weight:var(--font-bold)}.k-block-type-heading-input[data-level=h1]{--text-size: var(--text-3xl);line-height:1.125em}.k-block-type-heading-input[data-level=h2]{--text-size: var(--text-2xl)}.k-block-type-heading-input[data-level=h3]{--text-size: var(--text-xl)}.k-block-type-heading-input[data-level=h4]{--text-size: var(--text-lg)}.k-block-type-heading-input[data-level=h5]{--text-size: var(--text-md);line-height:1.5em}.k-block-type-heading-input[data-level=h6]{--text-size: var(--text-sm);line-height:1.5em}.k-block-type-heading-input .k-writer .ProseMirror strong{font-weight:700}.k-block-type-heading-level{--input-color-back: transparent;--input-color-border: none;--input-color-text: var(--color-gray-600);font-weight:var(--font-bold);text-transform:uppercase}.k-block-container.k-block-container-type-image{padding:0}.k-block-type-image .k-block-figure{padding:var(--spacing-3);border-radius:var(--rounded)}.k-block-type-image .k-block-figure-container{text-align:center;line-height:0}.k-block-type-image .k-block-figure[data-empty=true]{padding:var(--spacing-3)}.k-block-type-image-auto{max-width:100%;max-height:30rem;margin-inline:auto}.k-block-type-image .k-background-dropdown{position:absolute;inset-inline-end:var(--spacing-3);bottom:var(--spacing-3);opacity:0;transition:opacity .2s ease-in-out}.k-block-type-image:hover .k-background-dropdown{opacity:1}.k-block-type-line hr{margin-block:.75rem;border:0;border-top:1px solid var(--color-border)}.k-block-type-list-input{--input-color-back: transparent;--input-color-border: none;--input-outline-focus: none}.k-block-type-markdown-input{--input-color-back: var(--color-light);--input-color-border: none;--input-outline-focus: none;--input-padding-multiline: var(--spacing-3)}.k-block-type-quote-editor{padding-inline-start:var(--spacing-3);border-inline-start:2px solid var(--color-black)}.k-block-type-quote-text{font-size:var(--text-xl);margin-bottom:var(--spacing-1);line-height:1.25em}.k-block-type-quote-citation{font-style:italic;color:var(--color-text-dimmed)}.k-block-type-table-preview{cursor:pointer;border:1px solid var(--color-gray-300);border-spacing:0;border-radius:var(--rounded-sm)}.k-block-type-table-preview :where(th,td){text-align:start;line-height:1.5em;font-size:var(--text-sm)}.k-block-type-table-preview th{padding:.5rem .75rem}.k-block-type-table-preview td:not(.k-table-index-column){padding:0 .75rem}.k-block-type-table-preview td>*,.k-block-type-table-preview td [class$=-field-preview]{padding:0}.k-block-type-text-input{line-height:1.5;height:100%}.k-block-container.k-block-container-type-text{padding:0}.k-block-type-text-input.k-writer[data-toolbar-inline=true]{padding:var(--spacing-3)}.k-block-type-text-input.k-writer:not([data-toolbar-inline=true])>.ProseMirror,.k-block-type-text-input.k-writer:not([data-toolbar-inline=true])[data-placeholder][data-empty=true]:before{padding:var(--spacing-3) var(--spacing-6)}.k-block-type-text-input.k-textarea-input .k-textarea-input-native{padding:var(--input-padding-multiline)}.k-block-type-video-figure video{pointer-events:none}.k-blocks-field{position:relative}.k-blocks-field>footer{display:flex;justify-content:center;margin-top:var(--spacing-3)}.k-string-input{padding:var(--input-padding);border-radius:var(--input-rounded)}.k-string-input:focus{outline:0}.k-string-input[data-font=monospace]{font-family:var(--font-mono)}.k-color-field{--color-frame-size: calc(var(--input-height) - var(--spacing-2))}.k-color-field .k-input-before{align-items:center;padding-inline-start:var(--spacing-1)}.k-color-field-options{--color-frame-size: var(--input-height)}.k-color-field-picker{padding:var(--spacing-3)}.k-color-field-picker-toggle{--color-frame-rounded: var(--rounded-sm);border-radius:var(--color-frame-rounded)}.k-color-field .k-colorname-input{padding-inline:var(--input-padding)}.k-color-field .k-colorname-input:focus{outline:0}.k-date-input:disabled::placeholder{opacity:0}.k-date-field-body{display:grid;gap:var(--spacing-2)}@container (min-width: 20rem){.k-date-field-body[data-has-time=true]{grid-template-columns:1fr minmax(6rem,9rem)}}.k-text-input{padding:var(--input-padding);border-radius:var(--input-rounded)}.k-text-input:focus{outline:0}.k-text-input[data-font=monospace]{font-family:var(--font-mono)}.k-text-input:disabled::placeholder{opacity:0}.k-models-field[data-disabled=true] .k-item *{pointer-events:all!important}.k-headline-field{position:relative;padding-top:1.5rem}.k-fieldset>.k-grid .k-column:first-child .k-headline-field{padding-top:0}.k-headline-field h2.k-headline{font-weight:var(--font-normal)}.k-headline-field footer{margin-top:var(--spacing-2)}.k-info-field .k-headline{padding-bottom:.75rem;line-height:1.25rem}.k-layout-column{position:relative;height:100%;display:flex;flex-direction:column;background:var(--color-white);min-height:6rem}.k-layout-column:focus{outline:0}.k-layout-column>.k-blocks{background:none;box-shadow:none;padding:0;height:100%;background:var(--color-white);min-height:4rem}.k-layout-column>.k-blocks[data-empty=true]{min-height:6rem}.k-layout-column>.k-blocks>.k-blocks-list{display:flex;flex-direction:column;height:100%}.k-layout-column>.k-blocks>.k-blocks-list>.k-block-container:last-of-type{flex-grow:1}.k-layout-column>.k-blocks>.k-blocks-list>.k-blocks-empty.k-box{--box-color-back: transparent;position:absolute;top:0;right:0;bottom:0;left:0;justify-content:center;opacity:0;transition:opacity .3s;border:0}.k-layout-column>.k-blocks>.k-blocks-list>.k-blocks-empty:hover{opacity:1}.k-layout{--layout-border-color: var(--color-gray-300);--layout-toolbar-width: 2rem;position:relative;padding-inline-end:var(--layout-toolbar-width);background:#fff;box-shadow:var(--shadow)}[data-disabled=true] .k-layout{padding-inline-end:0}.k-layout:not(:last-of-type){margin-bottom:1px}.k-layout:focus{outline:0}.k-layout-toolbar{position:absolute;inset-block:0;inset-inline-end:0;width:var(--layout-toolbar-width);display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding-bottom:var(--spacing-2);font-size:var(--text-sm);background:var(--color-gray-100);border-inline-start:1px solid var(--color-light);color:var(--color-gray-500)}.k-layout-toolbar:hover{color:var(--color-black)}.k-layout-toolbar-button{width:var(--layout-toolbar-width);height:var(--layout-toolbar-width)}.k-layout-columns.k-grid{grid-gap:1px;background:var(--layout-border-color);background:var(--color-gray-300)}.k-layout:not(:first-child) .k-layout-columns.k-grid{border-top:0}.k-layouts .k-sortable-ghost{position:relative;box-shadow:#11111140 0 5px 10px;outline:2px solid var(--color-focus);cursor:grabbing;z-index:1}.k-layout-field>footer{display:flex;justify-content:center;margin-top:var(--spacing-3)}.k-line-field{position:relative;border:0;height:3rem;width:auto}.k-line-field:after{position:absolute;content:"";top:50%;margin-top:-1px;inset-inline:0;height:1px;background:var(--color-border)}.k-link-input-header{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:.25rem;height:var(--input-height);grid-area:header}.k-link-input-toggle.k-button{--button-height: var(--height-sm);--button-rounded: var(--rounded-sm);--button-color-back: var(--color-gray-200);margin-inline-start:.25rem}.k-link-input-model{display:flex;justify-content:space-between;margin-inline-end:var(--spacing-1)}.k-link-input-model-placeholder.k-button{--button-align: flex-start;--button-color-text: var(--color-gray-600);--button-height: var(--height-sm);--button-padding: var(--spacing-2);--button-rounded: var(--rounded-sm);flex-grow:1;overflow:hidden;white-space:nowrap;align-items:center}.k-link-field .k-link-field-preview{--tag-height: var(--height-sm);padding-inline:0}.k-link-field .k-link-field-preview .k-tag:focus{outline:0}.k-link-field .k-link-field-preview .k-tag:focus-visible{outline:var(--outline)}.k-link-field .k-link-field-preview .k-tag-text{font-size:var(--text-sm)}.k-link-input-model-toggle{align-self:center;--button-height: var(--height-sm);--button-width: var(--height-sm);--button-rounded: var(--rounded-sm)}.k-link-input-body{display:grid;overflow:hidden;border-top:1px solid var(--color-gray-300);background:var(--color-gray-100);--tree-color-back: var(--color-gray-100);--tree-color-hover-back: var(--color-gray-200)}.k-link-input-body[data-type=page] .k-page-browser{padding:var(--spacing-2);padding-bottom:calc(var(--spacing-2) - 1px);width:100%;container-type:inline-size;overflow:auto}.k-link-field .k-bubbles-field-preview{--bubble-rounded: var(--rounded-sm);--bubble-size: var(--height-sm);padding-inline:0}.k-link-field .k-bubbles-field-preview .k-bubble{font-size:var(--text-sm)}.k-link-field[data-disabled=true] .k-link-input-model-placeholder{display:none}.k-link-field[data-disabled=true] input::placeholder{opacity:0}.k-writer{position:relative;width:100%;display:grid;grid-template-areas:"content";gap:var(--spacing-1)}.k-writer .ProseMirror{overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;white-space:pre-wrap;font-variant-ligatures:none;grid-area:content;padding:var(--input-padding-multiline)}.k-writer .ProseMirror:focus{outline:0}.k-writer .ProseMirror *{caret-color:currentColor}.k-writer .ProseMirror hr.ProseMirror-selectednode{outline:var(--outline)}.k-writer[data-placeholder][data-empty=true]:before{grid-area:content;content:attr(data-placeholder);color:var(--input-color-placeholder);pointer-events:none;white-space:pre-wrap;word-wrap:break-word;line-height:var(--text-line-height);padding:var(--input-padding-multiline)}.k-list-input.k-writer[data-placeholder][data-empty=true]:before{padding-inline-start:2.5em}.k-list-field .k-list-input .ProseMirror,.k-list-field .k-list-input:before{padding:.475rem .5rem .475rem .75rem}:root{--tags-gap: .375rem}.k-tags{display:inline-flex;gap:var(--tags-gap);align-items:center;flex-wrap:wrap}.k-tags .k-sortable-ghost{outline:var(--outline)}.k-tags[data-layout=list],.k-tags[data-layout=list] .k-tag{width:100%}.k-tags.k-draggable .k-tag-text{cursor:grab}.k-tags.k-draggable .k-tag-text:active{cursor:grabbing}.k-multiselect-input{padding:var(--tags-gap);cursor:pointer}.k-multiselect-input-toggle.k-button{opacity:0}.k-tags-input{padding:var(--tags-gap)}.k-tags-input[data-can-add=true]{cursor:pointer}.k-tags-input-toggle.k-button{--button-color-text: var(--input-color-placeholder);opacity:0}.k-tags-input-toggle.k-button:focus{--button-color-text: var(--input-color-text)}.k-tags-input:focus-within .k-tags-input-toggle{opacity:1}.k-tags-input .k-picklist-dropdown{margin-top:var(--spacing-1)}.k-tags-input .k-picklist-dropdown .k-choice-input{gap:0}.k-tags-input .k-picklist-dropdown .k-choice-input:focus-within{outline:var(--outline)}.k-tags-input .k-picklist-dropdown .k-choice-input input{opacity:0;width:0}.k-number-input{padding:var(--input-padding);border-radius:var(--input-rounded)}.k-number-input:focus{outline:0}.k-table.k-object-field-table{table-layout:auto}.k-table.k-object-field-table tbody td{max-width:0}@container (max-width: 40rem){.k-object-field{overflow:hidden}.k-object-field-table.k-table tbody :where(th):is([data-mobile=true]){width:1px!important;white-space:normal;word-break:normal}}.k-range-input{--range-track-height: 1px;--range-track-back: var(--color-gray-300);--range-tooltip-back: var(--color-black);display:flex;align-items:center;border-radius:var(--range-track-height)}.k-range-input input[type=range]:focus{outline:0}.k-range-input-tooltip{position:relative;display:flex;align-items:center;color:var(--color-white);font-size:var(--text-xs);font-variant-numeric:tabular-nums;line-height:1;text-align:center;border-radius:var(--rounded-sm);background:var(--range-tooltip-back);margin-inline-start:var(--spacing-3);padding:0 var(--spacing-1);white-space:nowrap}.k-range-input-tooltip:after{position:absolute;top:50%;inset-inline-start:-3px;width:0;height:0;transform:translateY(-50%);border-block:3px solid transparent;border-inline-end:3px solid var(--range-tooltip-back);content:""}.k-range-input-tooltip>*{padding:var(--spacing-1)}.k-range-input[data-disabled=true]{--range-tooltip-back: var(--color-gray-600)}.k-input[data-type=range] .k-range-input{padding-inline:var(--input-padding)}.k-select-input{position:relative;display:block;overflow:hidden;padding:var(--input-padding);border-radius:var(--input-rounded)}.k-select-input[data-empty=true]{color:var(--input-color-placeholder)}.k-select-input-native{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;z-index:1}.k-select-input-native[disabled]{cursor:default}.k-input[data-type=select]{position:relative}.k-input[data-type=select] .k-input-icon{position:absolute;inset-block:0;inset-inline-end:0}.k-structure-field:not([data-disabled=true]) td.k-table-column{cursor:pointer}.k-structure-field .k-table+footer{display:flex;justify-content:center;margin-top:var(--spacing-3)}.k-field-counter{display:none}.k-text-field:focus-within .k-field-counter{display:block}.k-toolbar.k-textarea-toolbar{border-end-start-radius:0;border-end-end-radius:0;border-bottom:1px solid var(--toolbar-border)}.k-toolbar.k-textarea-toolbar>.k-button:first-child{border-end-start-radius:0}.k-toolbar.k-textarea-toolbar>.k-button:last-child{border-end-end-radius:0}.k-textarea-input[data-size=small]{--textarea-size: 7.5rem}.k-textarea-input[data-size=medium]{--textarea-size: 15rem}.k-textarea-input[data-size=large]{--textarea-size: 30rem}.k-textarea-input[data-size=huge]{--textarea-size: 45rem}.k-textarea-input-wrapper{position:relative;display:block}.k-textarea-input-native{resize:none;min-height:var(--textarea-size)}.k-textarea-input-native:focus{outline:0}.k-textarea-input-native[data-font=monospace]{font-family:var(--font-mono)}.k-input[data-type=textarea] .k-input-element{min-width:0}.k-input[data-type=textarea] .k-textarea-input-native{padding:var(--input-padding-multiline)}.k-time-input:disabled::placeholder{opacity:0}.k-input[data-type=toggle]{--input-color-border: transparent;--input-shadow: var(--shadow)}.k-input[data-type=toggle] .k-input-before{padding-inline-end:calc(var(--input-padding) / 2)}.k-input[data-type=toggle] .k-toggle-input{padding-inline-start:var(--input-padding)}.k-input[data-type=toggle][data-disabled]{box-shadow:none;border:1px solid var(--color-border)}.k-input[data-type=toggles]{display:inline-flex}.k-input[data-type=toggles].grow{display:flex}.k-input[data-type=toggles]:has(.k-empty){outline:0;display:flex}.k-toggles-input{display:grid;grid-template-columns:repeat(var(--options),minmax(0,1fr));gap:1px;border-radius:var(--rounded);line-height:1;background:var(--color-border);overflow:hidden}.k-toggles-input li{height:var(--field-input-height);background:var(--color-white)}.k-toggles-input label{align-items:center;background:var(--color-white);cursor:pointer;display:flex;font-size:var(--text-sm);justify-content:center;line-height:1.25;padding:0 var(--spacing-3);height:100%}.k-toggles-input li[data-disabled=true] label{color:var(--color-text-dimmed);background:var(--color-light)}.k-toggles-input .k-icon+.k-toggles-text{margin-inline-start:var(--spacing-2)}.k-toggles-input input:focus:not(:checked)+label{background:var(--color-blue-200)}.k-toggles-input input:checked+label{background:var(--color-black);color:var(--color-white)}.k-alpha-input{--range-track-back: linear-gradient(to right, transparent, currentColor);--range-track-height: var(--range-thumb-size);color:#000;background:var(--color-white) var(--pattern-light)}.k-calendar-input{--button-height: var(--height-sm);--button-width: var(--button-height);--button-padding: 0;padding:var(--spacing-2);width:min-content}.k-calendar-table{table-layout:fixed;min-width:15rem}.k-calendar-input .k-button{justify-content:center}.k-calendar-input>nav{display:flex;direction:ltr;align-items:center;margin-bottom:var(--spacing-2)}.k-calendar-selects{flex-grow:1;display:flex;align-items:center;justify-content:center}[dir=ltr] .k-calendar-selects{direction:ltr}[dir=rtl] .k-calendar-selects{direction:rtl}.k-calendar-selects .k-select-input{display:flex;align-items:center;text-align:center;height:var(--button-height);padding:0 .5rem;border-radius:var(--input-rounded)}.k-calendar-selects .k-select-input:focus-within{outline:var(--outline)}.k-calendar-input th{padding-block:.5rem;color:var(--color-gray-500);font-size:var(--text-xs);text-align:center}.k-calendar-day{padding:2px}.k-calendar-day[aria-current=date] .k-button{text-decoration:underline}.k-calendar-day[aria-selected=date] .k-button,.k-calendar-day[aria-selected=date] .k-button:focus{--button-color-text: var(--color-text);--button-color-back: var(--color-blue-500)}.k-calendar-day[aria-selected=date] .k-button:focus-visible{outline-offset:2px}.k-calendar-today{padding-top:var(--spacing-2);text-align:center}.k-calendar-today .k-button{--button-width: auto;--button-padding: var(--spacing-3);font-size:var(--text-xs);text-decoration:underline}.k-choice-input{display:flex;gap:var(--spacing-3);min-width:0}.k-choice-input input{top:2px}.k-choice-input-label{display:flex;line-height:1.25rem;flex-direction:column;min-width:0;color:var(--choice-color-text)}.k-choice-input-label>*{display:block;overflow:hidden;text-overflow:ellipsis}.k-choice-input-label-info{color:var(--choice-color-info)}.k-choice-input[aria-disabled]{cursor:not-allowed}:where(.k-checkboxes-field,.k-radio-field) .k-choice-input{min-height:var(--input-height);padding-block:var(--spacing-2);padding-inline:var(--spacing-3);border-radius:var(--input-rounded)}:where(.k-checkboxes-field,.k-radio-field) .k-choice-input:not([aria-disabled=true]){background:var(--input-color-back);box-shadow:var(--shadow)}:where(.k-checkboxes-field,.k-radio-field) .k-choice-input[aria-disabled=true]{border:1px solid var(--input-color-border)}.k-coloroptions-input{--color-preview-size: var(--input-height)}.k-coloroptions-input ul{display:grid;grid-template-columns:repeat(auto-fill,var(--color-preview-size));gap:var(--spacing-2)}.k-coloroptions-input input:focus+.k-color-frame{outline:var(--outline)}.k-coloroptions-input[disabled] label{opacity:var(--opacity-disabled);cursor:not-allowed}.k-coloroptions-input input:checked+.k-color-frame{outline:1px solid var(--color-gray-600);outline-offset:2px}.k-colorpicker-input{--h: 0;--s: 0%;--l: 0%;--a: 1;--range-thumb-size: .75rem;--range-track-height: .75rem;display:flex;flex-direction:column;gap:var(--spacing-3);width:max-content}.k-colorpicker-input .k-coords-input{border-radius:var(--rounded-sm);aspect-ratio:1/1;background:linear-gradient(to bottom,transparent,#000),linear-gradient(to right,#fff,hsl(var(--h),100%,50%))}.k-colorpicker-input .k-alpha-input{color:hsl(var(--h),var(--s),var(--l))}.k-colorpicker-input .k-coloroptions-input ul{grid-template-columns:repeat(6,1fr)}.k-coords-input{position:relative;display:block!important}.k-coords-input img{width:100%}.k-coords-input-thumb{position:absolute;aspect-ratio:1/1;width:var(--range-thumb-size);background:var(--range-thumb-color);border-radius:var(--range-thumb-size);box-shadow:var(--range-thumb-shadow);transform:translate(-50%,-50%);cursor:move}.k-coords-input[data-empty] .k-coords-input-thumb{opacity:0}.k-coords-input-thumb:active{cursor:grabbing}.k-coords-input:focus-within{outline:var(--outline)}.k-coords-input[aria-disabled]{pointer-events:none;opacity:var(--opacity-disabled)}.k-coords-input .k-coords-input-thumb:focus{outline:var(--outline)}.k-hue-input{--range-track-back: linear-gradient( to right, hsl(0, 100%, 50%) 0%, hsl(60, 100%, 50%) 16.67%, hsl(120, 100%, 50%) 33.33%, hsl(180, 100%, 50%) 50%, hsl(240, 100%, 50%) 66.67%, hsl(320, 100%, 50%) 83.33%, hsl(360, 100%, 50%) 100% ) no-repeat;--range-track-height: var(--range-thumb-size)}.k-timeoptions-input{--button-height: var(--height-sm);display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-3)}.k-timeoptions-input h3{display:flex;align-items:center;padding-inline:var(--button-padding);height:var(--button-height);margin-bottom:var(--spacing-1)}.k-timeoptions-input hr{margin:var(--spacing-2) var(--spacing-3)}.k-timeoptions-input .k-button[aria-selected=time]{--button-color-text: var(--color-text);--button-color-back: var(--color-blue-500)}.k-layout-selector h3{margin-top:-.5rem;margin-bottom:var(--spacing-3)}.k-layout-selector-options{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--spacing-6)}@media screen and (min-width: 65em){.k-layout-selector-options{grid-template-columns:repeat(var(--columns),1fr)}}.k-layout-selector-option{--color-border: hsla(var(--color-gray-hs), 0%, 6%);--color-back: var(--color-white);border-radius:var(--rounded)}.k-layout-selector-option:focus-visible{outline:var(--outline);outline-offset:-1px}.k-layout-selector-option .k-grid{border:1px solid var(--color-border);gap:1px;grid-template-columns:repeat(var(--columns),1fr);cursor:pointer;background:var(--color-border);border-radius:var(--rounded);overflow:hidden;box-shadow:var(--shadow);height:5rem}.k-layout-selector-option .k-column{grid-column:span var(--span);background:var(--color-back);height:100%}.k-layout-selector-option:hover{--color-border: var(--color-gray-500);--color-back: var(--color-gray-100)}.k-layout-selector-option[aria-current]{--color-border: var(--color-focus);--color-back: var(--color-blue-300)}.k-bubbles{display:flex;gap:.25rem}.k-bubbles-field-preview{--bubble-back: var(--color-light);--bubble-text: var(--color-black);padding:.375rem var(--table-cell-padding);overflow:hidden}.k-bubbles-field-preview .k-bubbles{gap:.375rem}.k-color-field-preview{--color-frame-rounded: var(--tag-rounded);--color-frame-size: var(--tag-height);padding:.375rem var(--table-cell-padding);display:flex;align-items:center;gap:var(--spacing-2)}.k-text-field-preview{padding:.325rem .75rem;overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.k-url-field-preview{padding-inline:var(--table-cell-padding)}.k-url-field-preview[data-link]{color:var(--link-color)}.k-url-field-preview a{display:inline-flex;align-items:center;height:var(--height-xs);padding-inline:var(--spacing-1);margin-inline:calc(var(--spacing-1) * -1);border-radius:var(--rounded);max-width:100%;min-width:0}.k-url-field-preview a>*{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-decoration:underline;text-underline-offset:var(--link-underline-offset)}.k-url-field-preview a:hover{color:var(--color-black)}.k-flag-field-preview{--button-height: var(--table-row-height);--button-width: 100%;outline-offset:-2px}.k-html-field-preview{padding:.375rem var(--table-cell-padding);overflow:hidden;text-overflow:ellipsis}.k-image-field-preview{height:100%}.k-link-field-preview{--tag-height: var(--height-xs);--tag-color-back: var(--color-gray-200);--tag-color-text: var(--color-black);--tag-color-toggle: var(--tag-color-text);--tag-color-toggle-border: var(--color-gray-300);--tag-color-focus-back: var(--tag-color-back);--tag-color-focus-text: var(--tag-color-text);padding-inline:var(--table-cell-padding);min-width:0}.k-link-field-preview .k-tag{min-width:0;max-width:100%}.k-link-field-preview .k-tag-text{font-size:var(--text-xs);min-width:0}.k-toggle-field-preview{padding-inline:var(--table-cell-padding)}:root{--toolbar-size: var(--height);--toolbar-text: var(--color-black);--toolbar-back: var(--color-white);--toolbar-hover: rgba(239, 239, 239, .5);--toolbar-border: rgba(0, 0, 0, .1);--toolbar-current: var(--color-focus)}.k-toolbar{display:flex;max-width:100%;height:var(--toolbar-size);align-items:center;overflow-x:auto;overflow-y:hidden;color:var(--toolbar-text);background:var(--toolbar-back);border-radius:var(--rounded)}.k-toolbar[data-theme=dark]{--toolbar-text: var(--color-white);--toolbar-back: var(--color-black);--toolbar-hover: rgba(255, 255, 255, .2);--toolbar-border: var(--color-gray-800)}.k-toolbar>hr{height:var(--toolbar-size);width:1px;border-left:1px solid var(--toolbar-border)}.k-toolbar-button.k-button{--button-width: var(--toolbar-size);--button-height: var(--toolbar-size);--button-rounded: 0;outline-offset:-2px}.k-toolbar-button:hover{--button-color-back: var(--toolbar-hover)}.k-toolbar .k-button[aria-current]{--button-color-text: var(--toolbar-current)}.k-toolbar>.k-button:first-child{border-start-start-radius:var(--rounded);border-end-start-radius:var(--rounded)}.k-toolbar>.k-button:last-child{border-start-end-radius:var(--rounded);border-end-end-radius:var(--rounded)}:where(.k-textarea-input,.k-writer-input):not(:focus-within){--toolbar-text: var(--color-gray-400);--toolbar-border: var(--color-background)}:where(.k-textarea-input,.k-writer-input):focus-within .k-toolbar:not([data-inline=true]){position:sticky;top:var(--header-sticky-offset);inset-inline:0;z-index:1;box-shadow:#0000000d 0 2px 5px}.k-writer:not([data-toolbar-inline=true]):not([data-disabled=true]){grid-template-areas:"topbar" "content";grid-template-rows:var(--toolbar-size) 1fr;gap:0}.k-writer:not(:focus-within){--toolbar-current: currentColor}.k-writer-toolbar[data-inline=true]{position:absolute;z-index:calc(var(--z-dropdown) + 1);max-width:none;box-shadow:var(--shadow-toolbar)}.k-writer-toolbar:not([data-inline=true]){border-end-start-radius:0;border-end-end-radius:0;border-bottom:1px solid var(--toolbar-border)}.k-writer-toolbar:not([data-inline=true])>.k-button:first-child{border-end-start-radius:0}.k-writer-toolbar:not([data-inline=true])>.k-button:last-child{border-end-end-radius:0}.k-aspect-ratio{position:relative;display:block;overflow:hidden;padding-bottom:100%}.k-aspect-ratio>*{position:absolute!important;top:0;right:0;bottom:0;left:0;height:100%;width:100%;object-fit:contain}.k-aspect-ratio[data-cover=true]>*{object-fit:cover}:root{--bar-height: var(--height-xs)}.k-bar{display:flex;align-items:center;gap:var(--spacing-3);height:var(--bar-height);justify-content:space-between}.k-bar:where([data-align=center]){justify-content:center}.k-bar:where([data-align=end]):has(:first-child:last-child){justify-content:end}.k-bar-slot{flex-grow:1}.k-bar-slot[data-position=center]{text-align:center}.k-bar-slot[data-position=right]{text-align:end}:root{--box-height: var( --field-input-height );--box-padding-inline: var(--spacing-2);--box-font-size: var(--text-sm);--box-color-back: none;--box-color-text: currentColor}.k-box{--icon-color: var(--box-color-icon);--text-font-size: var(--box-font-size);display:flex;width:100%;align-items:center;gap:var(--spacing-2);color:var(--box-color-text);background:var(--box-color-back);word-wrap:break-word}.k-box[data-theme]{--box-color-back: var(--theme-color-back);--box-color-text: var(--theme-color-text);--box-color-icon: var(--theme-color-700);min-height:var(--box-height);line-height:1.25;padding:.375rem var(--box-padding-inline);border-radius:var(--rounded)}.k-box[data-theme=text],.k-box[data-theme=white]{box-shadow:var(--shadow)}.k-box[data-theme=text]{padding:var(--spacing-6)}.k-box[data-theme=none]{padding:0}.k-box[data-align=center]{justify-content:center}:root{--bubble-size: 1.525rem;--bubble-back: var(--color-light);--bubble-rounded: var(--rounded-sm);--bubble-text: var(--color-black)}.k-bubble{width:min-content;height:var(--bubble-size);white-space:nowrap;line-height:1.5;background:var(--bubble-back);color:var(--bubble-text);border-radius:var(--bubble-rounded);overflow:hidden}.k-bubble .k-frame{width:var(--bubble-size);height:var(--bubble-size)}.k-bubble[data-has-text=true]{display:flex;gap:var(--spacing-2);align-items:center;padding-inline-end:.5rem;font-size:var(--text-xs)}.k-column{min-width:0}.k-column[data-sticky=true]{align-self:stretch}.k-column[data-sticky=true]>div{position:sticky;top:calc(var(--header-sticky-offset) + 2vh);z-index:2}.k-column[data-disabled=true]{cursor:not-allowed;opacity:.4}.k-column[data-disabled=true] *{pointer-events:none}.k-column[data-disabled=true] .k-text[data-theme=help] *{pointer-events:initial}.k-frame{--fit: contain;--ratio: 1/1;position:relative;display:flex;justify-content:center;align-items:center;aspect-ratio:var(--ratio);background:var(--back);overflow:hidden}.k-frame:where([data-theme]){--back: var(--theme-color-back);color:var(--theme-color-text)}.k-frame *:where(img,video,iframe,button){position:absolute;top:0;right:0;bottom:0;left:0;height:100%;width:100%;object-fit:var(--fit)}.k-frame>*{overflow:hidden;text-overflow:ellipsis;min-width:0;min-height:0}:root{--color-frame-back: none;--color-frame-rounded: var(--rounded);--color-frame-size: 100%;--color-frame-darkness: 0%}.k-color-frame.k-frame{background:var(--pattern-light);width:var(--color-frame-size);color:transparent;border-radius:var(--color-frame-rounded);overflow:hidden;background-clip:padding-box}.k-color-frame:after{border-radius:var(--color-frame-rounded);box-shadow:0 0 0 1px inset hsla(0,0%,var(--color-frame-darkness),.175);position:absolute;top:0;right:0;bottom:0;left:0;background:var(--color-frame-back);content:""}.k-dropzone{position:relative}.k-dropzone:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;display:none;pointer-events:none;z-index:1;border-radius:var(--rounded)}.k-dropzone[data-over=true]:after{display:block;background:hsla(var(--color-blue-hs),var(--color-blue-l-300),.6);outline:var(--outline)}.k-grid{--columns: 12;--grid-inline-gap: 0;--grid-block-gap: 0;display:grid;align-items:start;grid-column-gap:var(--grid-inline-gap);grid-row-gap:var(--grid-block-gap)}.k-grid>*{--width: calc(1 / var(--columns));--span: calc(var(--columns) * var(--width))}@container (min-width: 30rem){.k-grid{grid-template-columns:repeat(var(--columns),1fr)}.k-grid>*{grid-column:span var(--span)}.k-grid[data-gutter=small]{--grid-inline-gap: 1rem;--grid-block-gap: 1rem}.k-grid:where([data-gutter=medium],[data-gutter=large],[data-gutter=huge]){--grid-inline-gap: 1.5rem;--grid-block-gap: 1.5rem}}@container (min-width: 65em){.k-grid[data-gutter=large]{--grid-inline-gap: 3rem}.k-grid[data-gutter=huge]{--grid-inline-gap: 4.5rem}}@container (min-width: 90em){.k-grid[data-gutter=large]{--grid-inline-gap: 4.5rem}.k-grid[data-gutter=huge]{--grid-inline-gap: 6rem}}@container (min-width: 120em){.k-grid[data-gutter=large]{--grid-inline-gap: 6rem}.k-grid[data-gutter=huge]{--grid-inline-gap: 7.5rem}}:root{--columns-inline-gap: clamp(.75rem, 6cqw, 6rem);--columns-block-gap: var(--spacing-8)}.k-grid[data-variant=columns]{--grid-inline-gap: var(--columns-inline-gap);--grid-block-gap: var(--columns-block-gap)}.k-grid:where([data-variant=columns],[data-variant=fields])>*{container:column / inline-size}.k-grid[data-variant=fields]{gap:var(--spacing-8)}.k-grid[data-variant=choices]{align-items:stretch;gap:2px}:root{--header-color-back: var(--color-light);--header-padding-block: var(--spacing-4);--header-sticky-offset: var(--scroll-top)}.k-header{position:relative;display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;border-bottom:1px solid var(--color-border);background:var(--header-color-back);padding-top:var(--header-padding-block);margin-bottom:var(--spacing-12);box-shadow:2px 0 0 0 var(--header-color-back),-2px 0 0 0 var(--header-color-back)}.k-header-title{font-size:var(--text-h1);font-weight:var(--font-h1);line-height:var(--leading-h1);margin-bottom:var(--header-padding-block);min-width:0}.k-header-title-button{display:inline-flex;text-align:start;gap:var(--spacing-2);align-items:baseline;max-width:100%;outline:0}.k-header-title-text{overflow-x:clip;text-overflow:ellipsis}.k-header-title-icon{--icon-color: var(--color-text-dimmed);border-radius:var(--rounded);transition:opacity .2s;display:grid;flex-shrink:0;place-items:center;height:var(--height-sm);width:var(--height-sm);opacity:0}.k-header-title-button:is(:hover,:focus) .k-header-title-icon{opacity:1}.k-header-title-button:is(:focus) .k-header-title-icon{outline:var(--outline)}.k-header-buttons{display:flex;flex-shrink:0;gap:var(--spacing-2);margin-bottom:var(--header-padding-block)}.k-header[data-has-buttons=true]{position:sticky;top:var(--scroll-top);z-index:var(--z-toolbar)}:root:has(.k-header[data-has-buttons=true]){--header-sticky-offset: calc(var(--scroll-top) + 4rem)}:root{--icon-size: 18px;--icon-color: currentColor}.k-icon{width:var(--icon-size);height:var(--icon-size);flex-shrink:0;color:var(--icon-color)}.k-icon[data-type=loader]{animation:Spin 1.5s linear infinite}@media only screen and (-webkit-min-device-pixel-ratio: 2),not all,not all,not all,only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx){.k-button-icon [data-type=emoji]{font-size:1.25em}}.k-icon-frame [data-type=emoji]{overflow:visible}.k-image[data-back=pattern]{--back: var(--color-black) var(--pattern)}.k-image[data-back=black]{--back: var(--color-black)}.k-image[data-back=white]{--back: var(--color-white);color:var(--color-gray-900)}:root{--overlay-color-back: var(--color-backdrop)}.k-overlay[open]{position:fixed;overscroll-behavior:contain;top:0;right:0;bottom:0;left:0;width:100%;height:100vh;height:100dvh;background:none;z-index:var(--z-dialog);transform:translateZ(0);overflow:hidden}.k-overlay[open]::backdrop{background:none}.k-overlay[open]>.k-portal{position:fixed;top:0;right:0;bottom:0;left:0;background:var(--overlay-color-back);overflow:auto}.k-overlay[open][data-type=dialog]>.k-portal{display:inline-flex}.k-overlay[open][data-type=dialog]>.k-portal>*{margin:auto}.k-overlay[open][data-type=drawer]>.k-portal{--overlay-color-back: rgba(0, 0, 0, .2);display:flex;align-items:stretch;justify-content:flex-end}html[data-overlay]{overflow:hidden}html[data-overlay] body{overflow:scroll}:root{--stat-value-text-size: var(--text-2xl);--stat-info-text-color: var(--color-text-dimmed)}.k-stat{display:flex;flex-direction:column;padding:var(--spacing-3) var(--spacing-6);background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);line-height:var(--leading-normal)}.k-stat.k-link:hover{cursor:pointer;background:var(--color-gray-100)}.k-stat :where(dt,dd){display:block}.k-stat-value{order:1;font-size:var(--stat-value-text-size);margin-bottom:var(--spacing-1)}.k-stat-label{--icon-size: var(--text-sm);order:2;display:flex;justify-content:start;align-items:center;gap:var(--spacing-1);font-size:var(--text-xs)}.k-stat-info{order:3;font-size:var(--text-xs);color:var(--stat-info-text-color)}.k-stat:is([data-theme]) .k-stat-info{--stat-info-text-color: var(--theme-color-700)}.k-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(14rem,1fr));grid-auto-rows:1fr;grid-gap:var(--spacing-2px)}.k-stats[data-size=small]{--stat-value-text-size: var(--text-md)}.k-stats[data-size=medium]{--stat-value-text-size: var(--text-xl)}.k-stats[data-size=large]{--stat-value-text-size: var(--text-2xl)}.k-stats[data-size=huge]{--stat-value-text-size: var(--text-3xl)}:root{--table-cell-padding: var(--spacing-3);--table-color-back: var(--color-white);--table-color-border: var(--color-background);--table-color-hover: var(--color-gray-100);--table-color-th-back: var(--color-gray-100);--table-color-th-text: var(--color-text-dimmed);--table-row-height: var(--input-height)}.k-table{position:relative;background:var(--table-color-back);box-shadow:var(--shadow);border-radius:var(--rounded)}.k-table table{table-layout:fixed}.k-table th,.k-table td{padding-inline:var(--table-cell-padding);height:var(--table-row-height);overflow:hidden;text-overflow:ellipsis;width:100%;border-inline-end:1px solid var(--table-color-border);line-height:1.25}.k-table tr>*:last-child{border-inline-end:0}.k-table th,.k-table tr:not(:last-child) td{border-block-end:1px solid var(--table-color-border)}.k-table :where(td,th)[data-align]{text-align:var(--align)}.k-table th{padding-inline:var(--table-cell-padding);font-family:var(--font-mono);font-size:var(--text-xs);color:var(--table-color-th-text);background:var(--table-color-th-back)}.k-table th[data-has-button]{padding:0}.k-table th button{padding-inline:var(--table-cell-padding);height:100%;width:100%;border-radius:var(--rounded);text-align:start}.k-table th button:focus-visible{outline-offset:-2px}.k-table thead th:first-child{border-start-start-radius:var(--rounded)}.k-table thead th:last-child{border-start-end-radius:var(--rounded)}.k-table thead th{position:sticky;top:var(--header-sticky-offset);inset-inline:0;z-index:1}.k-table tbody tr:hover td{background:var(--table-color-hover)}.k-table tbody th{width:auto;white-space:nowrap;overflow:visible;border-radius:0}.k-table tbody tr:first-child th{border-start-start-radius:var(--rounded)}.k-table tbody tr:last-child th{border-end-start-radius:var(--rounded);border-block-end:0}.k-table-row-ghost{background:var(--color-white);outline:var(--outline);border-radius:var(--rounded);margin-bottom:2px;cursor:grabbing}.k-table-row-fallback{opacity:0!important}.k-table .k-table-index-column{width:var(--table-row-height);text-align:center}.k-table .k-table-index{font-size:var(--text-xs);color:var(--color-text-dimmed);line-height:1.1em}.k-table .k-table-index-column .k-sort-handle{--button-width: 100%;display:none}.k-table tr.k-table-sortable-row:hover .k-table-index-column .k-table-index{display:none}.k-table tr.k-table-sortable-row:hover .k-table-index-column .k-sort-handle{display:flex}.k-table .k-table-options-column{padding:0;width:var(--table-row-height);text-align:center}.k-table .k-table-options-column .k-options-dropdown-toggle{--button-width: 100%;--button-height: 100%;outline-offset:-2px}.k-table-empty{color:var(--color-text-dimmed);font-size:var(--text-sm)}.k-table[aria-disabled=true]{--table-color-back: transparent;--table-color-border: var(--color-border);--table-color-hover: transparent;--table-color-th-back: transparent;border:1px solid var(--table-color-border);box-shadow:none}.k-table[aria-disabled=true] thead th{position:static}@container (max-width: 40rem){.k-table{overflow-x:auto}.k-table thead th{position:static}.k-table .k-options-dropdown-toggle{aspect-ratio:auto!important}.k-table :where(th,td):not(.k-table-index-column,.k-table-options-column,[data-column-id=image],[data-column-id=flag]){width:auto!important}.k-table :where(th,td):not([data-mobile=true]){display:none}}.k-table-pagination{border-top:1px solid var(--table-color-border);height:var(--table-row-height);background:var(--table-color-th-back);display:flex;justify-content:center;border-end-start-radius:var(--rounded);border-end-end-radius:var(--rounded)}.k-table-pagination>.k-button{--button-color-back: transparent;border-left:0!important}.k-table .k-table-cell{padding:0}.k-tabs{--button-height: var(--height-md);--button-padding: var(--spacing-2);display:flex;gap:var(--spacing-1);margin-bottom:var(--spacing-12);margin-inline:calc(var(--button-padding) * -1)}.k-tabs-tab{position:relative}.k-tab-button.k-button{margin-block:2px;overflow-x:visible}.k-tab-button[aria-current]:after{position:absolute;content:"";height:2px;inset-inline:var(--button-padding);bottom:-2px;background:currentColor}.k-tabs-badge{position:absolute;top:2px;font-variant-numeric:tabular-nums;inset-inline-end:var(--button-padding);transform:translate(75%);line-height:1.5;padding:0 var(--spacing-1);border-radius:1rem;text-align:center;font-size:10px;box-shadow:var(--shadow-md);background:var(--theme-color-back);border:1px solid var(--theme-color-500);color:var(--theme-color-text);z-index:1}.k-view{padding-inline:1.5rem}@container (min-width: 30rem){.k-view{padding-inline:3rem}}.k-view[data-align=center]{height:100vh;display:flex;align-items:center;justify-content:center;padding:0 3rem;overflow:auto}.k-view[data-align=center]>*{flex-basis:22.5rem}.k-fatal[open]{background:var(--overlay-color-back);padding:var(--spacing-6)}.k-fatal-box{position:relative;width:100%;box-shadow:var(--dialog-shadow);border-radius:var(--dialog-rounded);line-height:1;height:calc(100vh - 3rem);height:calc(100dvh - 3rem);display:flex;flex-direction:column;overflow:hidden}.k-fatal-iframe{border:0;width:100%;flex-grow:1;background:var(--color-white);padding:var(--spacing-3)}.k-icons{position:absolute;width:0;height:0}.k-loader{z-index:1}.k-loader-icon{animation:Spin .9s linear infinite}.k-notification{padding:.75rem 1.5rem;background:var(--color-gray-900);width:100%;line-height:1.25rem;color:var(--color-white);display:flex;flex-shrink:0;align-items:center}.k-notification[data-theme]{background:var(--theme-color-back);color:var(--color-black)}.k-notification p{flex-grow:1;word-wrap:break-word;overflow:hidden}.k-notification .k-button{display:flex;margin-inline-start:1rem}.k-offline-warning{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--z-offline);background:var(--color-backdrop);display:flex;align-items:center;justify-content:center;line-height:1}.k-offline-warning p{display:flex;align-items:center;gap:.5rem;background:var(--color-white);box-shadow:var(--shadow);padding:.75rem;border-radius:var(--rounded)}.k-offline-warning p .k-icon{color:var(--color-red-400)}:root{--progress-height: var(--spacing-2);--progress-color-back: var(--color-gray-300);--progress-color-value: var(--color-focus)}progress{display:block;width:100%;height:var(--progress-height);border-radius:var(--progress-height);overflow:hidden;border:0}progress::-webkit-progress-bar{background:var(--progress-color-back)}progress::-webkit-progress-value{background:var(--progress-color-value);border-radius:var(--progress-height)}progress::-moz-progress-bar{background:var(--progress-color-value)}progress:not([value])::-webkit-progress-bar{background:var(--progress-color-value)}progress:not([value])::-moz-progress-bar{background:var(--progress-color-value)}.k-sort-handle{cursor:grab;z-index:1}.k-sort-handle:active{cursor:grabbing}.k-breadcrumb{--breadcrumb-divider: "/";overflow-x:clip;padding:2px}.k-breadcrumb ol{display:none;gap:.125rem;align-items:center}.k-breadcrumb ol li{display:flex;align-items:center;min-width:0;transition:flex-shrink .1s}.k-breadcrumb ol li:has(.k-icon){min-width:2.25rem}.k-breadcrumb ol li:not(:last-child):after{content:var(--breadcrumb-divider);opacity:.175;flex-shrink:0}.k-breadcrumb .k-icon[data-type=loader]{opacity:.5}.k-breadcrumb ol li:is(:hover,:focus-within){flex-shrink:0}.k-button.k-breadcrumb-link{flex-shrink:1;min-width:0;justify-content:flex-start}.k-breadcrumb-dropdown{display:grid}.k-breadcrumb-dropdown .k-dropdown-content{width:15rem}@container (min-width: 40em){.k-breadcrumb ol{display:flex}.k-breadcrumb-dropdown{display:none}}.k-browser{container-type:inline-size;font-size:var(--text-sm)}.k-browser-items{--browser-item-gap: 1px;--browser-item-size: 1fr;--browser-item-height: var(--height-sm);--browser-item-padding: .25rem;--browser-item-rounded: var(--rounded);display:grid;column-gap:var(--browser-item-gap);row-gap:var(--browser-item-gap);grid-template-columns:repeat(auto-fill,minmax(var(--browser-item-size),1fr))}.k-browser-item{display:flex;overflow:hidden;gap:.5rem;align-items:center;flex-shrink:0;height:var(--browser-item-height);padding-inline:calc(var(--browser-item-padding) + 1px);border-radius:var(--browser-item-rounded);white-space:nowrap;cursor:pointer}.k-browser-item-image{height:calc(var(--browser-item-height) - var(--browser-item-padding) * 2);aspect-ratio:1/1;border-radius:var(--rounded-sm);box-shadow:var(--shadow);flex-shrink:0}.k-browser-item-image.k-icon-frame{box-shadow:none;background:var(--color-white)}.k-browser-item-image svg{transform:scale(.8)}.k-browser-item input{position:absolute;box-shadow:var(--shadow);opacity:0;width:0}.k-browser-item[aria-selected]{background:var(--color-blue-300)}:root{--button-align: center;--button-height: var(--height-md);--button-width: auto;--button-color-back: none;--button-color-text: currentColor;--button-color-icon: currentColor;--button-padding: var(--spacing-2);--button-rounded: var(--spacing-1);--button-text-display: block;--button-icon-display: block}.k-button{position:relative;display:inline-flex;align-items:center;justify-content:var(--button-align);gap:.5rem;padding-inline:var(--button-padding);white-space:nowrap;line-height:1;border-radius:var(--button-rounded);background:var(--button-color-back);height:var(--button-height);width:var(--button-width);color:var(--button-color-text);font-variant-numeric:tabular-nums;overflow-x:clip;text-align:var(--button-align);flex-shrink:0}.k-button-icon{--icon-color: var(--button-color-icon);flex-shrink:0;display:var(--button-icon-display)}.k-button-text{text-overflow:ellipsis;overflow-x:clip;display:var(--button-text-display);min-width:0}.k-button:where([data-theme]){--button-color-icon: var(--theme-color-icon);--button-color-text: var(--theme-color-text)}.k-button:where([data-theme$=-icon]){--button-color-text: currentColor}.k-button:where([data-variant=dimmed]){--button-color-icon: var(--color-text);--button-color-text: var(--color-text-dimmed)}.k-button:where([data-variant=dimmed]):not([aria-disabled]):is(:hover,[aria-current]) .k-button-text{filter:brightness(75%)}.k-button:where([data-variant=dimmed][data-theme]){--button-color-icon: var(--theme-color-icon);--button-color-text: var(--theme-color-text-dimmed)}.k-button:where([data-variant=dimmed][data-theme$=-icon]){--button-color-text: var(--color-text-dimmed)}.k-button:where([data-variant=filled]){--button-color-back: var(--color-gray-300)}.k-button:where([data-variant=filled]):not([aria-disabled]):hover{filter:brightness(97%)}.k-button:where([data-variant=filled][data-theme]){--button-color-icon: var(--theme-color-700);--button-color-back: var(--theme-color-back)}.k-button:where([data-theme$=-icon][data-variant=filled]){--button-color-icon: hsl( var(--theme-color-hs), 57% );--button-color-back: var(--color-gray-300)}.k-button:not([data-has-text=true]){--button-padding: 0;aspect-ratio:1/1}@container (max-width: 30rem){.k-button[data-responsive=true][data-has-icon=true]{--button-padding: 0;aspect-ratio:1/1;--button-text-display: none}.k-button[data-responsive=text][data-has-text=true]{--button-icon-display: none}.k-button[data-responsive][data-has-icon=true] .k-button-arrow{display:none}}.k-button:not(button,a,summary,label,.k-link){pointer-events:none}.k-button:where([data-size=xs]){--button-height: var(--height-xs);--button-padding: .325rem}.k-button:where([data-size=sm]){--button-height: var(--height-sm);--button-padding: .5rem}.k-button:where([data-size=lg]){--button-height: var(--height-lg)}.k-button-arrow{--icon-size: 14px;width:max-content;margin-inline-start:-.125rem}.k-button:where([aria-disabled]){cursor:not-allowed}.k-button:where([aria-disabled])>*{opacity:var(--opacity-disabled)}.k-button-group{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}.k-button-group:where([data-layout=collapsed]){gap:0;flex-wrap:nowrap}.k-button-group[data-layout=collapsed]>.k-button[data-variant=filled]:not(:last-child){border-start-end-radius:0;border-end-end-radius:0}.k-button-group[data-layout=collapsed]>.k-button[data-variant=filled]:not(:first-child){border-start-start-radius:0;border-end-start-radius:0;border-left:1px solid var(--theme-color-500, var(--color-gray-400))}.k-button-group[data-layout=collapsed]>.k-button[data-variant=filled]:focus-visible{z-index:1;border-radius:var(--button-rounded)}.k-file-browser{container-type:inline-size;overflow:hidden}.k-file-browser-layout{display:grid;grid-template-columns:minmax(10rem,15rem) 1fr;grid-template-rows:1fr auto;grid-template-areas:"tree items" "tree pagination"}.k-file-browser-tree{grid-area:tree;padding:var(--spacing-2);border-right:1px solid var(--color-gray-300)}.k-file-browser-items{grid-area:items;padding:var(--spacing-2);background:var(--color-gray-100)}.k-file-browser-back-button{display:none}.k-file-browser-pagination{background:var(--color-gray-100);padding:var(--spacing-2);display:flex;justify-content:end}@container (max-width: 30rem){.k-file-browser-layout{grid-template-columns:minmax(0,1fr);min-height:10rem}.k-file-browser-back-button{width:100%;height:var(--height-sm);display:flex;align-items:center;justify-content:flex-start;padding-inline:.25rem;margin-bottom:.5rem;background:var(--color-gray-200);border-radius:var(--rounded)}.k-file-browser-tree{border-right:0}.k-file-browser-pagination{justify-content:start}.k-file-browser[data-view=files] .k-file-browser-layout{grid-template-rows:1fr auto;grid-template-areas:"items" "pagination"}.k-file-browser[data-view=files] .k-file-browser-tree,.k-file-browser[data-view=tree] .k-file-browser-items,.k-file-browser[data-view=tree] .k-file-browser-pagination{display:none}}:root{--tree-color-back: var(--color-gray-200);--tree-color-hover-back: var(--color-gray-300);--tree-color-selected-back: var(--color-blue-300);--tree-color-selected-text: var(--color-black);--tree-color-text: var(--color-gray-dimmed);--tree-level: 0;--tree-indentation: .6rem}.k-tree-branch{display:flex;align-items:center;padding-inline-start:calc(var(--tree-level) * var(--tree-indentation));margin-bottom:1px}.k-tree-branch[data-has-subtree=true]{inset-block-start:calc(var(--tree-level) * 1.5rem);z-index:calc(100 - var(--tree-level));background:var(--tree-color-back)}.k-tree-branch:hover,li[aria-current]>.k-tree-branch{--tree-color-text: var(--tree-color-selected-text);background:var(--tree-color-hover-back);border-radius:var(--rounded)}li[aria-current]>.k-tree-branch{background:var(--tree-color-selected-back)}.k-tree-toggle{--icon-size: 12px;width:1rem;aspect-ratio:1/1;display:grid;place-items:center;padding:0;border-radius:var(--rounded-sm);margin-inline-start:.25rem;flex-shrink:0}.k-tree-toggle:hover{background:#00000013}.k-tree-toggle[disabled]{visibility:hidden}.k-tree-folder{display:flex;height:var(--height-sm);border-radius:var(--rounded-sm);padding-inline:.25rem;width:100%;align-items:center;gap:.325rem;min-width:3rem;line-height:1.25;font-size:var(--text-sm)}@container (max-width: 15rem){.k-tree{--tree-indentation: .375rem}.k-tree-folder{padding-inline:.125rem}.k-tree-folder .k-icon{display:none}}.k-tree-folder>.k-frame{flex-shrink:0}.k-tree-folder-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:currentColor}.k-tree-folder[disabled]{opacity:var(--opacity-disabled)}.k-pagination{flex-shrink:0}.k-pagination-details{--button-padding: var(--spacing-3);font-size:var(--text-xs)}.k-pagination-selector{--button-height: var(--height);--dropdown-padding: 0;overflow:visible}.k-pagination-selector form{display:flex;align-items:center;justify-content:space-between}.k-pagination-selector label{display:flex;align-items:center;gap:var(--spacing-2);padding-inline-start:var(--spacing-3)}.k-pagination-selector select{--height: calc(var(--button-height) - .5rem);width:auto;min-width:var(--height);height:var(--height);text-align:center;background:var(--color-gray-800);color:var(--color-white);border-radius:var(--rounded-sm)}.k-prev-next{direction:ltr;flex-shrink:0}.k-search-bar-input{--button-height: var(--input-height);display:flex;align-items:center}.k-search-bar-types{flex-shrink:0;border-inline-end:1px solid var(--color-border)}.k-search-bar-input input{flex-grow:1;padding-inline:.75rem;height:var(--input-height);line-height:var(--input-height);border-radius:var(--rounded);font-size:var(--input-font-size)}.k-search-bar-input input:focus{outline:0}.k-search-bar-input .k-search-bar-close{flex-shrink:0}.k-search-bar-results{border-top:1px solid var(--color-border);padding:1rem}.k-search-bar-results .k-item[data-selected=true]{outline:var(--outline)}.k-search-bar-footer{text-align:center}.k-search-bar-footer p{color:var(--color-text-dimmed)}.k-search-bar-footer .k-button{margin-top:var(--spacing-4)}:root{--tag-color-back: var(--color-black);--tag-color-text: var(--color-white);--tag-color-toggle: currentColor;--tag-color-disabled-back: var(--color-gray-600);--tag-color-disabled-text: var(--tag-color-text);--tag-height: var(--height-xs);--tag-rounded: var(--rounded-sm)}.k-tag{position:relative;height:var(--tag-height);display:flex;align-items:center;justify-content:space-between;font-size:var(--text-sm);line-height:1;color:var(--tag-color-text);background-color:var(--tag-color-back);border-radius:var(--tag-rounded);cursor:pointer;-webkit-user-select:none;user-select:none}.k-tag:not([aria-disabled]):focus{outline:var(--outline)}.k-tag-image{height:100%;border-radius:var(--rounded-xs);overflow:hidden;flex-shrink:0;border-radius:0;border-start-start-radius:var(--tag-rounded);border-end-start-radius:var(--tag-rounded);background-clip:padding-box}.k-tag-text{padding-inline:var(--spacing-2);line-height:var(--leading-tight);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.k-tag[data-has-toggle=true] .k-tag-text{padding-inline-end:0}.k-tag-toggle{--icon-size: 14px;width:var(--tag-height);height:var(--tag-height);filter:brightness(70%);flex-shrink:0}.k-tag-toggle:hover{filter:brightness(100%)}.k-tag:where([aria-disabled]){background-color:var(--tag-color-disabled-back);color:var(--tag-color-disabled-text);cursor:not-allowed}.k-button[data-disabled=true]{opacity:.5;pointer-events:none;cursor:default}.k-card-options>.k-button[data-disabled=true]{display:inline-flex}.k-section+.k-section{margin-top:var(--columns-block-gap)}.k-section-header{display:flex;justify-content:space-between;align-items:center;gap:var(--spacing-6);margin-bottom:var(--spacing-2)}.k-section-buttons{flex-shrink:0}.k-fields-section input[type=submit]{display:none}[data-locked=true] .k-fields-section{opacity:.2;pointer-events:none}.k-models-section[data-processing=true]{pointer-events:none}.k-models-section-search.k-input{--input-color-back: var(--color-gray-300);--input-color-border: transparent;margin-bottom:var(--spacing-3)}:root{--code-color-back: var(--color-black);--code-color-icon: var(--color-gray-500);--code-color-text: var(--color-gray-200, white);--code-font-family: var(--font-mono);--code-font-size: 1em;--code-inline-color-back: var(--color-blue-300);--code-inline-color-border: var(--color-blue-400);--code-inline-color-text: var(--color-blue-900);--code-inline-font-size: .9em;--code-padding: var(--spacing-3)}code{font-family:var(--code-font-family);font-size:var(--code-font-size);font-weight:var(--font-normal)}.k-code,.k-text pre{position:relative;display:block;max-width:100%;padding:var(--code-padding);border-radius:var(--rounded, .5rem);background:var(--code-color-back);color:var(--code-color-text);white-space:nowrap;overflow-y:hidden;overflow-x:auto;line-height:1.5;-moz-tab-size:2;tab-size:2}.k-code:not(code),.k-text pre{white-space:pre-wrap}.k-code:before{position:absolute;content:attr(data-language);inset-block-start:0;inset-inline-end:0;padding:.5rem .5rem .25rem .25rem;font-size:calc(.75 * var(--text-xs));background:var(--code-color-back);border-radius:var(--rounded, .5rem)}.k-text>code,.k-text *:not(pre)>code{display:inline-flex;padding-inline:var(--spacing-1);font-size:var(--code-inline-font-size);color:var(--code-inline-color-text);background:var(--code-inline-color-back);border-radius:var(--rounded);outline:1px solid var(--code-inline-color-border);outline-offset:-1px}:root{--text-h1: 2em;--text-h2: 1.75em;--text-h3: 1.5em;--text-h4: 1.25em;--text-h5: 1.125em;--text-h6: 1em;--font-h1: var(--font-semi);--font-h2: var(--font-semi);--font-h3: var(--font-semi);--font-h4: var(--font-semi);--font-h5: var(--font-semi);--font-h6: var(--font-semi);--leading-h1: 1.125;--leading-h2: 1.125;--leading-h3: 1.25;--leading-h4: 1.375;--leading-h5: 1.5;--leading-h6: 1.5}.k-headline{line-height:1.5em;font-weight:var(--font-bold)}.h1,.k-text h1,.k-headline[data-size=huge]{color:var(--color-h1, var(--color-h));font-family:var(--font-family-h1);font-size:var(--text-h1);font-weight:var(--font-h1);line-height:var(--leading-h1)}.h2,.k-text h2,.k-headline[data-size=large]{color:var(--color-h2, var(--color-h));font-family:var(--font-family-h2);font-size:var(--text-h2);font-weight:var(--font-h2);line-height:var(--leading-h2)}.h3,.k-text h3{color:var(--color-h3, var(--color-h));font-family:var(--font-family-h3);font-size:var(--text-h3);font-weight:var(--font-h3);line-height:var(--leading-h3)}.h4,.k-text h4,.k-headline[data-size=small]{color:var(--color-h4, var(--color-h));font-family:var(--font-family-h4);font-size:var(--text-h4);font-weight:var(--font-h4);line-height:var(--leading-h4)}.h5,.k-text h5{color:var(--color-h5, var(--color-h));font-family:var(--font-family-h5);font-size:var(--text-h5);font-weight:var(--font-h5);line-height:var(--leading-h5)}.h6,.k-text h6{color:var(--color-h6, var(--color-h));font-family:var(--font-family-h6);font-size:var(--text-h6);font-weight:var(--font-h6);line-height:var(--leading-h6)}.k-text>*+h6{margin-block-start:calc(var(--text-line-height) * 1.5em)}.k-headline[data-theme]{color:var(--theme)}.k-label{position:relative;display:flex;align-items:center;height:var(--height-xs);font-weight:var(--font-semi);min-width:0;flex:1}[aria-disabled] .k-label{opacity:var(--opacity-disabled);cursor:not-allowed}.k-label>a{display:inline-flex;height:var(--height-xs);align-items:center;padding-inline:var(--spacing-2);margin-inline-start:calc(-1 * var(--spacing-2));border-radius:var(--rounded);min-width:0}.k-label-text{text-overflow:ellipsis;white-space:nowrap;overflow-x:clip;min-width:0}.k-label abbr{font-size:var(--text-xs);color:var(--color-gray-500);margin-inline-start:var(--spacing-1)}.k-label abbr.k-label-invalid{display:none;color:var(--color-red-700)}:where(.k-field:has([data-invalid]),.k-section:has([data-invalid]))>header>.k-label abbr.k-label-invalid{display:inline-block}.k-field:has([data-invalid])>.k-field-header>.k-label abbr:has(+abbr.k-label-invalid){display:none}:root{--text-font-size: 1em;--text-line-height: 1.5;--link-color: var(--color-blue-800);--link-underline-offset: 2px}.k-text{font-size:var(--text-font-size);line-height:var(--text-line-height)}.k-text[data-size=tiny]{--text-font-size: var(--text-xs)}.k-text[data-size=small]{--text-font-size: var(--text-sm)}.k-text[data-size=medium]{--text-font-size: var(--text-md)}.k-text[data-size=large]{--text-font-size: var(--text-xl)}.k-text[data-align]{text-align:var(--align)}.k-text>:where(audio,blockquote,details,div,figure,h1,h2,h3,h4,h5,h6,hr,iframe,img,object,ol,p,picture,pre,table,ul)+*{margin-block-start:calc(var(--text-line-height) * 1em)}.k-text :where(.k-link,a){color:var(--link-color);text-decoration:underline;text-underline-offset:var(--link-underline-offset);border-radius:var(--rounded-xs);outline-offset:2px}.k-text ol,.k-text ul{padding-inline-start:1.75em}.k-text ol{list-style:numeric}.k-text ol>li{list-style:decimal}.k-text ul>li{list-style:disc}.k-text ul ul>li{list-style:circle}.k-text ul ul ul>li{list-style:square}.k-text blockquote{font-size:var(--text-lg);line-height:1.25;padding-inline-start:var(--spacing-4);border-inline-start:2px solid var(--color-black)}.k-text img{border-radius:var(--rounded)}.k-text iframe{width:100%;aspect-ratio:16/9;border-radius:var(--rounded)}.k-text hr{background:var(--color-border);height:1px}.k-help{color:var(--color-text-dimmed)}.k-upload-item-preview{--icon-size: 24px;grid-area:preview;display:flex;aspect-ratio:1/1;width:100%;height:100%;overflow:hidden;border-start-start-radius:var(--rounded);border-end-start-radius:var(--rounded)}.k-upload-item-preview:focus{border-radius:var(--rounded);outline:2px solid var(--color-focus);z-index:1}.k-upload-item{accent-color:var(--color-focus);display:grid;grid-template-areas:"preview input input" "preview body toggle";grid-template-columns:6rem 1fr auto;grid-template-rows:var(--input-height) 1fr;border-radius:var(--rounded);background:var(--color-white);box-shadow:var(--shadow);min-height:6rem}.k-upload-item-body{grid-area:body;display:flex;flex-direction:column;justify-content:space-between;padding:var(--spacing-2) var(--spacing-3);min-width:0}.k-upload-item-input.k-input{--input-color-border: transparent;--input-padding: var(--spacing-2) var(--spacing-3);--input-rounded: 0;grid-area:input;font-size:var(--text-sm);border-bottom:1px solid var(--color-light);border-start-end-radius:var(--rounded)}.k-upload-item-input.k-input:focus-within{outline:2px solid var(--color-focus);z-index:1;border-radius:var(--rounded)}.k-upload-item-input.k-input[data-disabled=true]{--input-color-back: var(--color-white)}.k-upload-item-input .k-input-after{color:var(--color-gray-600)}.k-upload-item-meta{font-size:var(--text-xs);color:var(--color-gray-600)}.k-upload-item-error{font-size:var(--text-xs);margin-top:.25rem;color:var(--color-red-700)}.k-upload-item-progress{--progress-height: .25rem;--progress-color-back: var(--color-light);margin-bottom:.3125rem}.k-upload-item-toggle{grid-area:toggle;align-self:end}.k-upload-item-toggle>*{padding:var(--spacing-3)}.k-upload-item[data-completed] .k-upload-item-progress{--progress-color-value: var(--color-green-400)}.k-upload-items{display:grid;gap:.25rem}.k-activation{position:relative;display:flex;color:var(--dropdown-color-text);background:var(--dropdown-color-bg);border-radius:var(--dropdown-rounded);box-shadow:var(--dropdown-shadow);justify-content:space-between}.k-activation p{padding-inline-start:var(--spacing-3);padding-inline-end:var(--spacing-2);padding-block:.425rem;line-height:1.25}.k-activation p strong{font-weight:var(--font-normal);margin-inline-end:var(--spacing-1)}.k-activation p :where(button,a){color:var(--color-pink-400);text-decoration:underline;text-decoration-color:currentColor;text-underline-offset:2px;border-radius:var(--rounded-sm)}.k-activation-toggle{--button-color-text: var(--color-gray-400);--button-rounded: 0;border-left:1px solid var(--dropdown-color-hr)}.k-activation-toggle:is(:hover,:focus){--button-color-text: var(--color-white)}.k-activation-toggle:focus{--button-rounded: var(--rounded)}:root{--main-padding-inline: clamp(var(--spacing-6), 5cqw, var(--spacing-24))}.k-panel-main{min-height:100vh;min-height:100dvh;padding:var(--spacing-3) var(--main-padding-inline) var(--spacing-24);container:main / inline-size;margin-inline-start:var(--main-start)}.k-panel-notification{--button-height: var(--height-md);--button-color-icon: var(--theme-color-900);--button-color-text: var(--theme-color-900);border:1px solid var(--theme-color-500);position:fixed;inset-block-end:var(--menu-padding);inset-inline-end:var(--menu-padding);box-shadow:var(--dropdown-shadow);z-index:var(--z-notification)}:root{--menu-button-height: var(--height);--menu-button-width: 100%;--menu-color-back: var(--color-gray-250);--menu-color-border: var(--color-gray-300);--menu-display: none;--menu-display-backdrop: block;--menu-padding: var(--spacing-3);--menu-shadow: var(--shadow-xl);--menu-toggle-height: var(--menu-button-height);--menu-toggle-width: 1rem;--menu-width-closed: calc( var(--menu-button-height) + 2 * var(--menu-padding) );--menu-width-open: 12rem;--menu-width: var(--menu-width-open)}.k-panel-menu{position:fixed;inset-inline-start:0;inset-block:0;z-index:var(--z-navigation);display:var(--menu-display);width:var(--menu-width);background-color:var(--menu-color-back);border-right:1px solid var(--menu-color-border);box-shadow:var(--menu-shadow)}.k-panel-menu-body{display:flex;flex-direction:column;gap:var(--spacing-4);padding:var(--menu-padding);overscroll-behavior:contain;overflow-x:hidden;overflow-y:auto;height:100%}.k-panel-menu-search{margin-bottom:var(--spacing-8)}.k-panel-menu-buttons{display:flex;flex-direction:column;width:100%}.k-panel-menu-buttons[data-second-last=true]{flex-grow:1}.k-panel-menu-buttons:last-child{justify-content:flex-end}.k-panel-menu-button{--button-align: flex-start;--button-height: var(--menu-button-height);--button-width: var(--menu-button-width);--button-padding: 7px;flex-shrink:0}.k-panel-menu-button[aria-current]{--button-color-back: var(--color-white);box-shadow:var(--shadow)}.k-panel-menu-button:focus{z-index:1}.k-panel[data-menu=true]{--menu-button-width: 100%;--menu-display: block;--menu-width: var(--menu-width-open)}.k-panel[data-menu=true]:after{content:"";position:fixed;top:0;right:0;bottom:0;left:0;background:var(--color-backdrop);display:var(--menu-display-backdrop);pointer-events:none}.k-panel-menu-toggle{--button-align: flex-start;--button-height: 100%;--button-width: var(--menu-toggle-width);position:absolute;inset-block:0;inset-inline-start:100%;align-items:flex-start;border-radius:0;overflow:visible;opacity:0;transition:opacity .2s}.k-panel-menu-toggle:focus{outline:0}.k-panel-menu-toggle .k-button-icon{display:grid;place-items:center;height:var(--menu-toggle-height);width:var(--menu-toggle-width);margin-top:var(--menu-padding);border-block:1px solid var(--menu-color-border);border-inline-end:1px solid var(--menu-color-border);background:var(--menu-color-back);border-start-end-radius:var(--button-rounded);border-end-end-radius:var(--button-rounded)}@media (max-width: 60rem){.k-panel-menu .k-activation-button{margin-bottom:var(--spacing-3)}.k-panel-menu .k-activation-toggle{display:none}}@media (min-width: 60rem){.k-panel{--menu-display: block;--menu-display-backdrop: none;--menu-shadow: none;--main-start: var(--menu-width)}.k-panel[data-menu=false]{--menu-button-width: var(--menu-button-height);--menu-width: var(--menu-width-closed)}.k-panel-menu-proxy{display:none}.k-panel-menu-toggle:focus-visible,.k-panel-menu[data-hover] .k-panel-menu-toggle{opacity:1}.k-panel-menu-toggle:focus-visible .k-button-icon{outline:var(--outline);border-radius:var(--button-rounded)}.k-panel-menu-search[aria-disabled=true]{opacity:0}.k-panel-menu .k-activation{position:absolute;bottom:var(--menu-padding);inset-inline-start:100%;height:var(--height-md);width:max-content;margin-left:var(--menu-padding)}.k-panel-menu .k-activation:before{position:absolute;content:"";top:50%;left:-4px;margin-top:-4px;border-top:4px solid transparent;border-right:4px solid var(--color-black);border-bottom:4px solid transparent}.k-panel-menu .k-activation p :where(button,a){padding-inline:var(--spacing-1)}.k-panel-menu .k-activation-toggle{border-left:1px solid var(--dropdown-color-hr)}}.k-panel.k-panel-outside{display:grid;grid-template-rows:1fr;place-items:center;min-height:100vh;min-height:100dvh;padding:var(--spacing-6)}:root{--scroll-top: 0rem}html{overflow-x:hidden;overflow-y:scroll;background:var(--color-light)}body{font-size:var(--text-sm)}.k-panel[data-loading=true]{animation:LoadingCursor .5s}.k-panel[data-loading=true]:after,.k-panel[data-dragging=true]{-webkit-user-select:none;user-select:none}.k-topbar{position:relative;margin-inline:calc(var(--button-padding) * -1);margin-bottom:var(--spacing-8);display:flex;align-items:center;gap:var(--spacing-1)}.k-topbar-breadcrumb{margin-inline-start:-2px;flex-shrink:1;min-width:0}.k-topbar-spacer{flex-grow:1}.k-topbar-signals{display:flex;align-items:center}.k-search-view .k-header{margin-bottom:0}.k-header+.k-search-view-results{margin-top:var(--spacing-12)}.k-search-view-input{--input-color-border: transparent;--input-color-back: var(--color-gray-300);--input-height: var(--height-md);width:40cqw}.k-file-view-header,.k-file-view[data-has-tabs=true] .k-file-preview{margin-bottom:0}.k-file-preview{display:grid;align-items:stretch;background:var(--color-gray-900);border-radius:var(--rounded-lg);margin-bottom:var(--spacing-12);overflow:hidden}.k-file-preview-thumb-column{background:var(--pattern);aspect-ratio:1/1}.k-file-preview-thumb{display:flex;align-items:center;justify-content:center;height:100%;padding:var(--spacing-12);container-type:size}.k-file-preview-thumb img{width:auto;max-width:100cqw;max-height:100cqh}.k-file-preview-thumb>.k-icon{--icon-size: 3rem}.k-file-preview-thumb>.k-button{position:absolute;top:var(--spacing-2);inset-inline-start:var(--spacing-2)}.k-file-preview .k-coords-input{--opacity-disabled: 1;--range-thumb-color: hsl(216 60% 60% / .75);--range-thumb-size: 1.25rem;--range-thumb-shadow: none;cursor:crosshair}.k-file-preview .k-coords-input-thumb:after{--size: .4rem;--pos: calc(50% - (var(--size) / 2));position:absolute;top:var(--pos);inset-inline-start:var(--pos);width:var(--size);height:var(--size);content:"";background:var(--color-white);border-radius:50%}.k-file-preview:not([data-has-focus=true]) .k-coords-input-thumb{display:none}.k-file-preview-details{display:grid}.k-file-preview-details dl{display:grid;grid-template-columns:repeat(auto-fill,minmax(14rem,1fr));grid-gap:var(--spacing-6) var(--spacing-12);align-self:center;line-height:1.5em;padding:var(--spacing-6)}.k-file-preview-details dt{font-size:var(--text-sm);font-weight:500;font-weight:var(--font-semi);color:var(--color-gray-500);margin-bottom:var(--spacing-1)}.k-file-preview-details :where(dd,a){font-size:var(--text-xs);color:#ffffff80;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#ffffffbf;font-size:var(--text-sm)}.k-file-preview-focus-info dd{display:flex;align-items:center}.k-file-preview-focus-info .k-button{--button-padding: var(--spacing-2);--button-color-back: var(--color-gray-800)}.k-file-preview[data-has-focus=true] .k-file-preview-focus-info .k-button{flex-direction:row-reverse}@container (min-width: 36rem){.k-file-preview{grid-template-columns:50% auto}.k-file-preview-thumb-column{aspect-ratio:auto}}@container (min-width: 65rem){.k-file-preview{grid-template-columns:33.333% auto}.k-file-preview-thumb-column{aspect-ratio:1/1}}@container (min-width: 90rem){.k-file-preview-layout{grid-template-columns:25% auto}}.k-installation-dialog{--dialog-color-back: var(--color-white);--dialog-shadow: var(--shadow);container-type:inline-size}.k-installation-view .k-button{margin-top:var(--spacing-3);width:100%}.k-installation-view form .k-button{margin-top:var(--spacing-10)}.k-installation-view .k-headline{font-weight:var(--font-semi);margin-top:-.5rem;margin-bottom:.75rem}.k-installation-issues{line-height:1.5em;font-size:var(--text-sm)}.k-installation-issues li{position:relative;padding:var(--spacing-6);background:var(--color-red-300);padding-inline-start:3.5rem;border-radius:var(--rounded)}.k-installation-issues .k-icon{position:absolute;top:calc(1.5rem + 2px);inset-inline-start:1.5rem}.k-installation-issues .k-icon{color:var(--color-red-700)}.k-installation-issues li:not(:last-child){margin-bottom:2px}.k-installation-issues li code{font:inherit;color:var(--color-red-700)}.k-login-code-form .k-user-info{margin-bottom:var(--spacing-6)}.k-login-form{position:relative}.k-login-form label abbr{visibility:hidden}.k-login-toggler{position:absolute;top:-2px;inset-inline-end:calc(var(--spacing-2) * -1);color:var(--link-color);text-decoration:underline;text-decoration-color:var(--link-color);text-underline-offset:1px;height:var(--height-xs);line-height:1;padding-inline:var(--spacing-2);border-radius:var(--rounded);z-index:1}.k-login{--dialog-color-back: var(--color-white);--dialog-shadow: var(--shadow);container-type:inline-size}.k-login-buttons{--button-padding: var(--spacing-3);display:flex;gap:1.5rem;align-items:center;justify-content:space-between;margin-top:var(--spacing-10)}.k-page-view[data-has-tabs=true] .k-page-view-header,.k-site-view[data-has-tabs=true] .k-site-view-header{margin-bottom:0}.k-user-name-placeholder{color:var(--color-gray-500);transition:color .3s}.k-user-view-header[data-editable=true] .k-user-name-placeholder:hover{color:var(--color-gray-900)}.k-user-view-header{margin-bottom:0;border-bottom:0}.k-user-view .k-user-profile{margin-bottom:var(--spacing-12)}.k-user-view[data-has-tabs=true] .k-user-profile{margin-bottom:0}.k-password-reset-view .k-user-info{margin-bottom:var(--spacing-8)}.k-user-view-image{padding:0}.k-user-view-image .k-frame{width:6rem;height:6rem;border-radius:var(--rounded);line-height:0}.k-user-view-image .k-icon-frame{--back: var(--color-black);--icon-color: var(--color-gray-200)}.k-user-info{display:flex;align-items:center;font-size:var(--text-sm);height:var(--height-lg);gap:.75rem;padding-inline:var(--spacing-2);background:var(--color-white);box-shadow:var(--shadow)}.k-user-info :where(.k-image-frame,.k-icon-frame){width:1.5rem;border-radius:var(--rounded-sm)}.k-user-profile{--button-height: auto;padding:var(--spacing-2);background:var(--color-white);border-radius:var(--rounded-lg);display:flex;align-items:center;gap:var(--spacing-3);box-shadow:var(--shadow)}.k-user-profile .k-button-group{display:flex;flex-direction:column;align-items:flex-start}.k-users-view-header{margin-bottom:0}.k-system-info .k-stat-label{color:var(--theme, var(--color-black))}.k-table-update-status-cell{padding:0 .75rem;display:flex;align-items:center;height:100%}.k-table-update-status-cell-version,.k-table-update-status-cell-button{font-variant-numeric:tabular-nums}.k-plugin-info{display:grid;column-gap:var(--spacing-3);row-gap:2px;padding:var(--button-padding)}.k-plugin-info dt{color:var(--color-gray-400)}.k-plugin-info dd[data-theme]{color:var(--theme-color-600)}@container (max-width: 30em){.k-plugin-info dd:not(:last-of-type){margin-bottom:var(--spacing-2)}}@container (min-width: 30em){.k-plugin-info{width:20rem;grid-template-columns:1fr auto}}:root{--color-l-100: 98%;--color-l-200: 94%;--color-l-300: 88%;--color-l-400: 80%;--color-l-500: 70%;--color-l-600: 60%;--color-l-700: 45%;--color-l-800: 30%;--color-l-900: 15%;--color-red-h: 0;--color-red-s: 80%;--color-red-hs: var(--color-red-h), var(--color-red-s);--color-red-boost: 3%;--color-red-l-100: calc(var(--color-l-100) + var(--color-red-boost));--color-red-l-200: calc(var(--color-l-200) + var(--color-red-boost));--color-red-l-300: calc(var(--color-l-300) + var(--color-red-boost));--color-red-l-400: calc(var(--color-l-400) + var(--color-red-boost));--color-red-l-500: calc(var(--color-l-500) + var(--color-red-boost));--color-red-l-600: calc(var(--color-l-600) + var(--color-red-boost));--color-red-l-700: calc(var(--color-l-700) + var(--color-red-boost));--color-red-l-800: calc(var(--color-l-800) + var(--color-red-boost));--color-red-l-900: calc(var(--color-l-900) + var(--color-red-boost));--color-red-100: hsl(var(--color-red-hs), var(--color-red-l-100));--color-red-200: hsl(var(--color-red-hs), var(--color-red-l-200));--color-red-300: hsl(var(--color-red-hs), var(--color-red-l-300));--color-red-400: hsl(var(--color-red-hs), var(--color-red-l-400));--color-red-500: hsl(var(--color-red-hs), var(--color-red-l-500));--color-red-600: hsl(var(--color-red-hs), var(--color-red-l-600));--color-red-700: hsl(var(--color-red-hs), var(--color-red-l-700));--color-red-800: hsl(var(--color-red-hs), var(--color-red-l-800));--color-red-900: hsl(var(--color-red-hs), var(--color-red-l-900));--color-orange-h: 28;--color-orange-s: 80%;--color-orange-hs: var(--color-orange-h), var(--color-orange-s);--color-orange-boost: 2.5%;--color-orange-l-100: calc(var(--color-l-100) + var(--color-orange-boost));--color-orange-l-200: calc(var(--color-l-200) + var(--color-orange-boost));--color-orange-l-300: calc(var(--color-l-300) + var(--color-orange-boost));--color-orange-l-400: calc(var(--color-l-400) + var(--color-orange-boost));--color-orange-l-500: calc(var(--color-l-500) + var(--color-orange-boost));--color-orange-l-600: calc(var(--color-l-600) + var(--color-orange-boost));--color-orange-l-700: calc(var(--color-l-700) + var(--color-orange-boost));--color-orange-l-800: calc(var(--color-l-800) + var(--color-orange-boost));--color-orange-l-900: calc(var(--color-l-900) + var(--color-orange-boost));--color-orange-100: hsl(var(--color-orange-hs), var(--color-orange-l-100));--color-orange-200: hsl(var(--color-orange-hs), var(--color-orange-l-200));--color-orange-300: hsl(var(--color-orange-hs), var(--color-orange-l-300));--color-orange-400: hsl(var(--color-orange-hs), var(--color-orange-l-400));--color-orange-500: hsl(var(--color-orange-hs), var(--color-orange-l-500));--color-orange-600: hsl(var(--color-orange-hs), var(--color-orange-l-600));--color-orange-700: hsl(var(--color-orange-hs), var(--color-orange-l-700));--color-orange-800: hsl(var(--color-orange-hs), var(--color-orange-l-800));--color-orange-900: hsl(var(--color-orange-hs), var(--color-orange-l-900));--color-yellow-h: 47;--color-yellow-s: 80%;--color-yellow-hs: var(--color-yellow-h), var(--color-yellow-s);--color-yellow-boost: 0%;--color-yellow-l-100: calc(var(--color-l-100) + var(--color-yellow-boost));--color-yellow-l-200: calc(var(--color-l-200) + var(--color-yellow-boost));--color-yellow-l-300: calc(var(--color-l-300) + var(--color-yellow-boost));--color-yellow-l-400: calc(var(--color-l-400) + var(--color-yellow-boost));--color-yellow-l-500: calc(var(--color-l-500) + var(--color-yellow-boost));--color-yellow-l-600: calc(var(--color-l-600) + var(--color-yellow-boost));--color-yellow-l-700: calc(var(--color-l-700) + var(--color-yellow-boost));--color-yellow-l-800: calc(var(--color-l-800) + var(--color-yellow-boost));--color-yellow-l-900: calc(var(--color-l-900) + var(--color-yellow-boost));--color-yellow-100: hsl(var(--color-yellow-hs), var(--color-yellow-l-100));--color-yellow-200: hsl(var(--color-yellow-hs), var(--color-yellow-l-200));--color-yellow-300: hsl(var(--color-yellow-hs), var(--color-yellow-l-300));--color-yellow-400: hsl(var(--color-yellow-hs), var(--color-yellow-l-400));--color-yellow-500: hsl(var(--color-yellow-hs), var(--color-yellow-l-500));--color-yellow-600: hsl(var(--color-yellow-hs), var(--color-yellow-l-600));--color-yellow-700: hsl(var(--color-yellow-hs), var(--color-yellow-l-700));--color-yellow-800: hsl(var(--color-yellow-hs), var(--color-yellow-l-800));--color-yellow-900: hsl(var(--color-yellow-hs), var(--color-yellow-l-900));--color-green-h: 80;--color-green-s: 60%;--color-green-hs: var(--color-green-h), var(--color-green-s);--color-green-boost: -2.5%;--color-green-l-100: calc(var(--color-l-100) + var(--color-green-boost));--color-green-l-200: calc(var(--color-l-200) + var(--color-green-boost));--color-green-l-300: calc(var(--color-l-300) + var(--color-green-boost));--color-green-l-400: calc(var(--color-l-400) + var(--color-green-boost));--color-green-l-500: calc(var(--color-l-500) + var(--color-green-boost));--color-green-l-600: calc(var(--color-l-600) + var(--color-green-boost));--color-green-l-700: calc(var(--color-l-700) + var(--color-green-boost));--color-green-l-800: calc(var(--color-l-800) + var(--color-green-boost));--color-green-l-900: calc(var(--color-l-900) + var(--color-green-boost));--color-green-100: hsl(var(--color-green-hs), var(--color-green-l-100));--color-green-200: hsl(var(--color-green-hs), var(--color-green-l-200));--color-green-300: hsl(var(--color-green-hs), var(--color-green-l-300));--color-green-400: hsl(var(--color-green-hs), var(--color-green-l-400));--color-green-500: hsl(var(--color-green-hs), var(--color-green-l-500));--color-green-600: hsl(var(--color-green-hs), var(--color-green-l-600));--color-green-700: hsl(var(--color-green-hs), var(--color-green-l-700));--color-green-800: hsl(var(--color-green-hs), var(--color-green-l-800));--color-green-900: hsl(var(--color-green-hs), var(--color-green-l-900));--color-aqua-h: 180;--color-aqua-s: 50%;--color-aqua-hs: var(--color-aqua-h), var(--color-aqua-s);--color-aqua-boost: 0%;--color-aqua-l-100: calc(var(--color-l-100) + var(--color-aqua-boost));--color-aqua-l-200: calc(var(--color-l-200) + var(--color-aqua-boost));--color-aqua-l-300: calc(var(--color-l-300) + var(--color-aqua-boost));--color-aqua-l-400: calc(var(--color-l-400) + var(--color-aqua-boost));--color-aqua-l-500: calc(var(--color-l-500) + var(--color-aqua-boost));--color-aqua-l-600: calc(var(--color-l-600) + var(--color-aqua-boost));--color-aqua-l-700: calc(var(--color-l-700) + var(--color-aqua-boost));--color-aqua-l-800: calc(var(--color-l-800) + var(--color-aqua-boost));--color-aqua-l-900: calc(var(--color-l-900) + var(--color-aqua-boost));--color-aqua-100: hsl(var(--color-aqua-hs), var(--color-aqua-l-100));--color-aqua-200: hsl(var(--color-aqua-hs), var(--color-aqua-l-200));--color-aqua-300: hsl(var(--color-aqua-hs), var(--color-aqua-l-300));--color-aqua-400: hsl(var(--color-aqua-hs), var(--color-aqua-l-400));--color-aqua-500: hsl(var(--color-aqua-hs), var(--color-aqua-l-500));--color-aqua-600: hsl(var(--color-aqua-hs), var(--color-aqua-l-600));--color-aqua-700: hsl(var(--color-aqua-hs), var(--color-aqua-l-700));--color-aqua-800: hsl(var(--color-aqua-hs), var(--color-aqua-l-800));--color-aqua-900: hsl(var(--color-aqua-hs), var(--color-aqua-l-900));--color-blue-h: 210;--color-blue-s: 65%;--color-blue-hs: var(--color-blue-h), var(--color-blue-s);--color-blue-boost: 3%;--color-blue-l-100: calc(var(--color-l-100) + var(--color-blue-boost));--color-blue-l-200: calc(var(--color-l-200) + var(--color-blue-boost));--color-blue-l-300: calc(var(--color-l-300) + var(--color-blue-boost));--color-blue-l-400: calc(var(--color-l-400) + var(--color-blue-boost));--color-blue-l-500: calc(var(--color-l-500) + var(--color-blue-boost));--color-blue-l-600: calc(var(--color-l-600) + var(--color-blue-boost));--color-blue-l-700: calc(var(--color-l-700) + var(--color-blue-boost));--color-blue-l-800: calc(var(--color-l-800) + var(--color-blue-boost));--color-blue-l-900: calc(var(--color-l-900) + var(--color-blue-boost));--color-blue-100: hsl(var(--color-blue-hs), var(--color-blue-l-100));--color-blue-200: hsl(var(--color-blue-hs), var(--color-blue-l-200));--color-blue-300: hsl(var(--color-blue-hs), var(--color-blue-l-300));--color-blue-400: hsl(var(--color-blue-hs), var(--color-blue-l-400));--color-blue-500: hsl(var(--color-blue-hs), var(--color-blue-l-500));--color-blue-600: hsl(var(--color-blue-hs), var(--color-blue-l-600));--color-blue-700: hsl(var(--color-blue-hs), var(--color-blue-l-700));--color-blue-800: hsl(var(--color-blue-hs), var(--color-blue-l-800));--color-blue-900: hsl(var(--color-blue-hs), var(--color-blue-l-900));--color-purple-h: 275;--color-purple-s: 60%;--color-purple-hs: var(--color-purple-h), var(--color-purple-s);--color-purple-boost: 0%;--color-purple-l-100: calc(var(--color-l-100) + var(--color-purple-boost));--color-purple-l-200: calc(var(--color-l-200) + var(--color-purple-boost));--color-purple-l-300: calc(var(--color-l-300) + var(--color-purple-boost));--color-purple-l-400: calc(var(--color-l-400) + var(--color-purple-boost));--color-purple-l-500: calc(var(--color-l-500) + var(--color-purple-boost));--color-purple-l-600: calc(var(--color-l-600) + var(--color-purple-boost));--color-purple-l-700: calc(var(--color-l-700) + var(--color-purple-boost));--color-purple-l-800: calc(var(--color-l-800) + var(--color-purple-boost));--color-purple-l-900: calc(var(--color-l-900) + var(--color-purple-boost));--color-purple-100: hsl(var(--color-purple-hs), var(--color-purple-l-100));--color-purple-200: hsl(var(--color-purple-hs), var(--color-purple-l-200));--color-purple-300: hsl(var(--color-purple-hs), var(--color-purple-l-300));--color-purple-400: hsl(var(--color-purple-hs), var(--color-purple-l-400));--color-purple-500: hsl(var(--color-purple-hs), var(--color-purple-l-500));--color-purple-600: hsl(var(--color-purple-hs), var(--color-purple-l-600));--color-purple-700: hsl(var(--color-purple-hs), var(--color-purple-l-700));--color-purple-800: hsl(var(--color-purple-hs), var(--color-purple-l-800));--color-purple-900: hsl(var(--color-purple-hs), var(--color-purple-l-900));--color-pink-h: 320;--color-pink-s: 70%;--color-pink-hs: var(--color-pink-h), var(--color-pink-s);--color-pink-boost: 0%;--color-pink-l-100: calc(var(--color-l-100) + var(--color-pink-boost));--color-pink-l-200: calc(var(--color-l-200) + var(--color-pink-boost));--color-pink-l-300: calc(var(--color-l-300) + var(--color-pink-boost));--color-pink-l-400: calc(var(--color-l-400) + var(--color-pink-boost));--color-pink-l-500: calc(var(--color-l-500) + var(--color-pink-boost));--color-pink-l-600: calc(var(--color-l-600) + var(--color-pink-boost));--color-pink-l-700: calc(var(--color-l-700) + var(--color-pink-boost));--color-pink-l-800: calc(var(--color-l-800) + var(--color-pink-boost));--color-pink-l-900: calc(var(--color-l-900) + var(--color-pink-boost));--color-pink-100: hsl(var(--color-pink-hs), var(--color-pink-l-100));--color-pink-200: hsl(var(--color-pink-hs), var(--color-pink-l-200));--color-pink-300: hsl(var(--color-pink-hs), var(--color-pink-l-300));--color-pink-400: hsl(var(--color-pink-hs), var(--color-pink-l-400));--color-pink-500: hsl(var(--color-pink-hs), var(--color-pink-l-500));--color-pink-600: hsl(var(--color-pink-hs), var(--color-pink-l-600));--color-pink-700: hsl(var(--color-pink-hs), var(--color-pink-l-700));--color-pink-800: hsl(var(--color-pink-hs), var(--color-pink-l-800));--color-pink-900: hsl(var(--color-pink-hs), var(--color-pink-l-900));--color-gray-h: 0;--color-gray-s: 0%;--color-gray-hs: var(--color-gray-h), var(--color-gray-s);--color-gray-boost: 0%;--color-gray-l-100: calc(var(--color-l-100) + var(--color-gray-boost));--color-gray-l-200: calc(var(--color-l-200) + var(--color-gray-boost));--color-gray-l-300: calc(var(--color-l-300) + var(--color-gray-boost));--color-gray-l-400: calc(var(--color-l-400) + var(--color-gray-boost));--color-gray-l-500: calc(var(--color-l-500) + var(--color-gray-boost));--color-gray-l-600: calc(var(--color-l-600) + var(--color-gray-boost));--color-gray-l-700: calc(var(--color-l-700) + var(--color-gray-boost));--color-gray-l-800: calc(var(--color-l-800) + var(--color-gray-boost));--color-gray-l-900: calc(var(--color-l-900) + var(--color-gray-boost));--color-gray-100: hsl(var(--color-gray-hs), var(--color-gray-l-100));--color-gray-200: hsl(var(--color-gray-hs), var(--color-gray-l-200));--color-gray-250: #e8e8e8;--color-gray-300: hsl(var(--color-gray-hs), var(--color-gray-l-300));--color-gray-400: hsl(var(--color-gray-hs), var(--color-gray-l-400));--color-gray-500: hsl(var(--color-gray-hs), var(--color-gray-l-500));--color-gray-600: hsl(var(--color-gray-hs), var(--color-gray-l-600));--color-gray-700: hsl(var(--color-gray-hs), var(--color-gray-l-700));--color-gray-800: hsl(var(--color-gray-hs), var(--color-gray-l-800));--color-gray-900: hsl(var(--color-gray-hs), var(--color-gray-l-900));--color-backdrop: rgba(0, 0, 0, .6);--color-black: black;--color-border: var(--color-gray-300);--color-dark: var(--color-gray-900);--color-focus: var(--color-blue-600);--color-light: var(--color-gray-200);--color-text: var(--color-black);--color-text-dimmed: var(--color-gray-700);--color-white: white;--color-background: var(--color-light);--color-gray: var(--color-gray-600);--color-red: var(--color-red-600);--color-orange: var(--color-orange-600);--color-yellow: var(--color-yellow-600);--color-green: var(--color-green-600);--color-aqua: var(--color-aqua-600);--color-blue: var(--color-blue-600);--color-purple: var(--color-purple-600);--color-focus-light: var(--color-focus);--color-focus-outline: var(--color-focus);--color-negative: var(--color-red-700);--color-negative-light: var(--color-red-500);--color-negative-outline: var(--color-red-900);--color-notice: var(--color-orange-700);--color-notice-light: var(--color-orange-500);--color-positive: var(--color-green-700);--color-positive-light: var(--color-green-500);--color-positive-outline: var(--color-green-900);--color-text-light: var(--color-text-dimmed)}:root{--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--font-mono: "SFMono-Regular", Consolas, Liberation Mono, Menlo, Courier, monospace}:root{--text-xs: .75rem;--text-sm: .875rem;--text-md: 1rem;--text-lg: 1.125rem;--text-xl: 1.25rem;--text-2xl: 1.5rem;--text-3xl: 1.75rem;--text-4xl: 2.5rem;--text-5xl: 3rem;--text-6xl: 4rem;--text-base: var(--text-md);--font-size-tiny: var(--text-xs);--font-size-small: var(--text-sm);--font-size-medium: var(--text-base);--font-size-large: var(--text-xl);--font-size-huge: var(--text-2xl);--font-size-monster: var(--text-3xl)}:root{--font-thin: 300;--font-normal: 400;--font-semi: 500;--font-bold: 600}:root{--height-xs: 1.5rem;--height-sm: 1.75rem;--height-md: 2rem;--height-lg: 2.25rem;--height-xl: 2.5rem;--height: var(--height-md)}:root{--opacity-disabled: .5}:root{--rounded-xs: 1px;--rounded-sm: .125rem;--rounded-md: .25rem;--rounded-lg: .375rem;--rounded-xl: .5rem;--rounded: var(--rounded-md)}:root{--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .05), 0 1px 2px 0 rgba(0, 0, 0, .025);--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .05);--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .05);--shadow: var(--shadow-sm);--shadow-toolbar: rgba(0, 0, 0, .1) -2px 0 5px, var(--shadow), var(--shadow-xl);--shadow-outline: var(--color-focus, currentColor) 0 0 0 2px;--shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, .06);--shadow-sticky: rgba(0, 0, 0, .05) 0 2px 5px;--box-shadow-dropdown: var(--shadow-dropdown);--box-shadow-item: var(--shadow);--box-shadow-focus: var(--shadow-xl);--shadow-dropdown: var(--shadow-lg);--shadow-item: var(--shadow-sm)}:root{--spacing-0: 0;--spacing-1: .25rem;--spacing-2: .5rem;--spacing-3: .75rem;--spacing-4: 1rem;--spacing-6: 1.5rem;--spacing-8: 2rem;--spacing-12: 3rem;--spacing-16: 4rem;--spacing-24: 6rem;--spacing-36: 9rem;--spacing-48: 12rem;--spacing-px: 1px;--spacing-2px: 2px;--spacing-5: 1.25rem;--spacing-10: 2.5rem;--spacing-20: 5rem}:root{--z-offline: 1200;--z-fatal: 1100;--z-loader: 1000;--z-notification: 900;--z-dialog: 800;--z-navigation: 700;--z-dropdown: 600;--z-drawer: 500;--z-dropzone: 400;--z-toolbar: 300;--z-content: 200;--z-background: 100}:root{--pattern-size: 16px;--pattern-light: repeating-conic-gradient( hsl(0, 0%, 100%) 0% 25%, hsl(0, 0%, 90%) 0% 50% ) 50% / var(--pattern-size) var(--pattern-size);--pattern-dark: repeating-conic-gradient( hsla(0, 0%, 15%) 0% 25%, hsl(0, 0%, 22%) 0% 50% ) 50% / var(--pattern-size) var(--pattern-size);--pattern: var(--pattern-dark)}:root{--container: 80rem;--leading-none: 1;--leading-tight: 1.25;--leading-snug: 1.375;--leading-normal: 1.5;--leading-relaxed: 1.625;--leading-loose: 2;--field-input-padding: var(--input-padding);--field-input-height: var(--input-height);--field-input-line-height: var(--input-leading);--field-input-font-size: var(--input-font-size);--bg-pattern: var(--pattern)}:root{--choice-color-back: var(--color-white);--choice-color-border: var(--color-gray-500);--choice-color-checked: var(--color-black);--choice-color-disabled: var(--color-gray-400);--choice-color-icon: var(--color-light);--choice-color-info: var(--color-text-dimmed);--choice-color-text: var(--color-text);--choice-color-toggle: var(--choice-color-disabled);--choice-height: 1rem;--choice-rounded: var(--rounded-sm)}input:where([type=checkbox],[type=radio]){position:relative;cursor:pointer;overflow:hidden;flex-shrink:0;height:var(--choice-height);aspect-ratio:1/1;border:1px solid var(--choice-color-border);-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:var(--choice-rounded);background:var(--choice-color-back);box-shadow:var(--shadow-sm)}input:where([type=checkbox],[type=radio]):after{position:absolute;content:"";display:none;place-items:center;text-align:center}input:where([type=checkbox],[type=radio]):focus{outline:var(--outline);outline-offset:-1px;color:var(--color-focus)}input:where([type=checkbox]):checked{border-color:var(--choice-color-checked)}input:where([type=checkbox],[type=radio]):checked:after{background:var(--choice-color-checked);display:grid}input:where([type=checkbox],[type=radio]):checked:focus{--choice-color-checked: var(--color-focus)}input:where([type=checkbox],[type=radio])[disabled]{--choice-color-back: none;--choice-color-border: var(--color-gray-300);--choice-color-checked: var(--choice-color-disabled);box-shadow:none;cursor:not-allowed}input[type=checkbox]:checked:after{content:"✓";top:0;right:0;bottom:0;left:0;font-weight:700;color:var(--choice-color-icon);line-height:1}input[type=radio]{--choice-rounded: 50%}input[type=radio]:after{top:3px;right:3px;bottom:3px;left:3px;font-size:9px;border-radius:var(--choice-rounded)}input[type=checkbox][data-variant=toggle]{--choice-rounded: var(--choice-height);width:calc(var(--choice-height) * 2);aspect-ratio:2/1}input[type=checkbox][data-variant=toggle]:after{background:var(--choice-color-toggle);display:grid;top:1px;right:1px;bottom:1px;left:1px;width:.8rem;font-size:7px;border-radius:var(--choice-rounded);transition:margin-inline-start 75ms ease-in-out,background .1s ease-in-out}input[type=checkbox][data-variant=toggle]:checked{border-color:var(--choice-color-border)}input[type=checkbox][data-variant=toggle]:checked:after{background:var(--choice-color-checked);margin-inline-start:50%}:root{--range-thumb-color: var(--color-white);--range-thumb-focus-outline: var(--outline);--range-thumb-size: 1rem;--range-thumb-shadow: rgba(0, 0, 0, .1) 0 2px 4px 2px, rgba(0, 0, 0, .125) 0 0 0 1px;--range-track-back: var(--color-gray-250);--range-track-height: var(--range-thumb-size)}:where(input[type=range]){display:flex;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;height:var(--range-thumb-size);border-radius:var(--range-track-size);width:100%}:where(input[type=range])::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:var(--range-thumb-size);height:var(--range-thumb-size);border:0;background:var(--range-thumb-color);box-shadow:var(--range-thumb-shadow);transform:translateZ(0);margin-top:calc(((var(--range-thumb-size) - var(--range-track-height)) / 2) * -1);border-radius:50%;z-index:1;cursor:grab}:where(input[type=range])::-moz-range-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:var(--range-thumb-size);height:var(--range-thumb-size);border:0;background:var(--range-thumb-color);box-shadow:var(--range-thumb-shadow);border-radius:50%;transform:translateZ(0);z-index:1;cursor:grab}:where(input[type=range])::-webkit-slider-thumb:active{cursor:grabbing}:where(input[type=range])::-moz-range-thumb:active{cursor:grabbing}:where(input[type=range])::-webkit-slider-runnable-track{background:var(--range-track-back);height:var(--range-track-height);border-radius:var(--range-track-height)}:where(input[type=range])::-moz-range-track{background:var(--range-track-back);height:var(--range-track-height);border-radius:var(--range-track-height)}:where(input[type=range][disabled]){--range-thumb-color: rgba(255, 255, 255, .2)}:where(input[type=range][disabled])::-webkit-slider-thumb{cursor:not-allowed}:where(input[type=range][disabled])::-moz-range-thumb{cursor:not-allowed}:where(input[type=range]):focus{outline:var(--outline)}:where(input[type=range]):focus::-webkit-slider-thumb{outline:var(--range-thumb-focus-outline)}:where(input[type=range]):focus::-moz-range-thumb{outline:var(--range-thumb-focus-outline)}*,*:before,*:after{margin:0;padding:0;box-sizing:border-box}:where(b,strong){font-weight:var(--font-bold, 600)}:where([hidden]){display:none!important}:where(abbr){text-decoration:none}:where(input,button,textarea,select){border:0;font:inherit;line-height:inherit;color:inherit;background:none}:where(fieldset){border:0}:where(legend){width:100%;float:left}:where(legend+*){clear:both}:where(select){-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--color-white);color:var(--color-black);cursor:pointer}:where(textarea,select,input:not([type=checkbox],[type=radio],[type=reset],[type=submit])){width:100%;font-variant-numeric:tabular-nums}:where(textarea){resize:vertical;line-height:1.5}:where(input)::-webkit-calendar-picker-indicator{display:none}:where(input[type=search]){-webkit-appearance:none;-moz-appearance:none;appearance:none}:where(input)::-webkit-search-cancel-button{display:none}:where(button,label,select,summary,[role=button],[role=option]){cursor:pointer}:where(select[multiple]) option{display:flex;align-items:center}:where(input:-webkit-autofill){-webkit-text-fill-color:var(--input-color-text)!important;-webkit-background-clip:text}:where(:disabled){cursor:not-allowed}*::placeholder{color:var(--input-color-placeholder);opacity:1}:where(a){color:currentColor;text-decoration:none;text-underline-offset:.2ex}:where(ul,ol){list-style:none}:where(img,svg,video,canvas,audio,iframe,embed,object){display:block}:where(iframe){border:0}:where(img,picture,svg){max-inline-size:100%;block-size:auto}:where(p,h1,h2,h3,h4,h5,h6){overflow-wrap:break-word}:where(h1,h2,h3,h4,h5,h6){font:inherit}:where(:focus,:focus-visible,:focus-within){outline-color:var(--color-focus, currentColor);outline-offset:0}:where(:focus-visible){outline:var(--outline, 2px solid var(--color-focus, currentColor))}:where(:invalid){box-shadow:none;outline:0}:where(dialog){border:0;max-width:none;max-height:none}:where(hr){border:0}:where(table){font:inherit;width:100%;border-spacing:0;font-variant-numeric:tabular-nums}:where(table th){font:inherit;text-align:start}:where(svg){fill:currentColor}body{font-family:var(--font-sans, sans-serif);font-size:var(--text-sm);line-height:1;position:relative;accent-color:var(--color-focus, currentColor)}:where(sup,sub){position:relative;line-height:0;vertical-align:baseline;font-size:75%}:where(sup){top:-.5em}:where(sub){bottom:-.25em}:where(mark){background:var(--color-yellow-300)}:where(kbd){display:inline-block;padding-inline:var(--spacing-2);border-radius:var(--rounded);background:var(--color-white);box-shadow:var(--shadow)}[data-align=left]{--align: start}[data-align=center]{--align: center}[data-align=right]{--align: end}@keyframes LoadingCursor{to{cursor:progress}}@keyframes Spin{to{transform:rotate(360deg)}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}[data-theme]{--theme-color-h: 0;--theme-color-s: 0%;--theme-color-hs: var(--theme-color-h), var(--theme-color-s);--theme-color-boost: 3%;--theme-color-l-100: calc(var(--color-l-100) + var(--theme-color-boost));--theme-color-l-200: calc(var(--color-l-200) + var(--theme-color-boost));--theme-color-l-300: calc(var(--color-l-300) + var(--theme-color-boost));--theme-color-l-400: calc(var(--color-l-400) + var(--theme-color-boost));--theme-color-l-500: calc(var(--color-l-500) + var(--theme-color-boost));--theme-color-l-600: calc(var(--color-l-600) + var(--theme-color-boost));--theme-color-l-700: calc(var(--color-l-700) + var(--theme-color-boost));--theme-color-l-800: calc(var(--color-l-800) + var(--theme-color-boost));--theme-color-l-900: calc(var(--color-l-900) + var(--theme-color-boost));--theme-color-100: hsl(var(--theme-color-hs), var(--theme-color-l-100));--theme-color-200: hsl(var(--theme-color-hs), var(--theme-color-l-200));--theme-color-300: hsl(var(--theme-color-hs), var(--theme-color-l-300));--theme-color-400: hsl(var(--theme-color-hs), var(--theme-color-l-400));--theme-color-500: hsl(var(--theme-color-hs), var(--theme-color-l-500));--theme-color-600: hsl(var(--theme-color-hs), var(--theme-color-l-600));--theme-color-700: hsl(var(--theme-color-hs), var(--theme-color-l-700));--theme-color-800: hsl(var(--theme-color-hs), var(--theme-color-l-800));--theme-color-900: hsl(var(--theme-color-hs), var(--theme-color-l-900));--theme-color-text: var(--theme-color-900);--theme-color-text-dimmed: hsl( var(--theme-color-h), calc(var(--theme-color-s) - 60%), 50% );--theme-color-back: var(--theme-color-400);--theme-color-hover: var(--theme-color-500);--theme-color-icon: var(--theme-color-600)}[data-theme^=red],[data-theme^=error],[data-theme^=negative]{--theme-color-h: var(--color-red-h);--theme-color-s: var(--color-red-s);--theme-color-boost: var(--color-red-boost)}[data-theme^=orange],[data-theme^=notice]{--theme-color-h: var(--color-orange-h);--theme-color-s: var(--color-orange-s);--theme-color-boost: var(--color-orange-boost)}[data-theme^=yellow],[data-theme^=warning]{--theme-color-h: var(--color-yellow-h);--theme-color-s: var(--color-yellow-s);--theme-color-boost: var(--color-yellow-boost)}[data-theme^=blue],[data-theme^=info]{--theme-color-h: var(--color-blue-h);--theme-color-s: var(--color-blue-s);--theme-color-boost: var(--color-blue-boost)}[data-theme^=pink],[data-theme^=love]{--theme-color-h: var(--color-pink-h);--theme-color-s: var(--color-pink-s);--theme-color-boost: var(--color-pink-boost)}[data-theme^=green],[data-theme^=positive]{--theme-color-h: var(--color-green-h);--theme-color-s: var(--color-green-s);--theme-color-boost: var(--color-green-boost)}[data-theme^=aqua]{--theme-color-h: var(--color-aqua-h);--theme-color-s: var(--color-aqua-s);--theme-color-boost: var(--color-aqua-boost)}[data-theme^=purple]{--theme-color-h: var(--color-purple-h);--theme-color-s: var(--color-purple-s);--theme-color-boost: var(--color-purple-boost)}[data-theme^=gray],[data-theme^=passive]{--theme-color-h: var(--color-gray-h);--theme-color-s: var(--color-gray-s);--theme-color-boost: 10%}[data-theme^=white],[data-theme^=text]{--theme-color-back: var(--color-white);--theme-color-icon: var(--color-gray-800);--theme-color-text: var(--color-text);--color-h: var(--color-black)}[data-theme^=dark]{--theme-color-h: var(--color-gray-h);--theme-color-s: var(--color-gray-s);--theme-color-boost: var(--color-gray-boost);--theme-color-back: var(--color-gray-800);--theme-color-icon: var(--color-gray-500);--theme-color-text: var(--color-gray-200)}[data-theme=code]{--theme-color-back: var(--code-color-back);--theme-color-hover: var(--color-black);--theme-color-icon: var(--code-color-icon);--theme-color-text: var(--code-color-text);font-family:var(--code-font-family);font-size:var(--code-font-size)}[data-theme=empty]{--theme-color-back: var(--color-light);--theme-color-border: var(--color-gray-400);--theme-color-icon: var(--color-gray-600);--theme-color-text: var(--color-text-dimmed);border:1px dashed var(--theme-color-border)}[data-theme=none]{--theme-color-back: transparent;--theme-color-border: transparent;--theme-color-icon: var(--color-text);--theme-color-text: var(--color-text)}[data-theme]{--theme: var(--theme-color-700);--theme-light: var(--theme-color-500);--theme-bg: var(--theme-color-500)}:root{--outline: 2px solid var(--color-focus, currentColor)}.scroll-x,.scroll-x-auto,.scroll-y,.scroll-y-auto{-webkit-overflow-scrolling:touch;transform:translateZ(0)}.scroll-x{overflow-x:scroll;overflow-y:hidden}.scroll-x-auto{overflow-x:auto;overflow-y:hidden}.scroll-y{overflow-x:hidden;overflow-y:scroll}.scroll-y-auto{overflow-x:hidden;overflow-y:auto}.input-hidden{position:absolute;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:0;height:0;opacity:0}.k-lab-index-view .k-header{margin-bottom:0}.k-lab-index-view .k-panel-main>.k-box{margin-bottom:var(--spacing-8)}.k-lab-index-view .k-list-items{grid-template-columns:repeat(auto-fill,minmax(12rem,1fr))}.k-lab-docs-deprecated .k-box{box-shadow:var(--shadow)}.k-lab-docs-examples .k-code+.k-code{margin-top:var(--spacing-4)}.k-lab-docs-prop-values{font-size:var(--text-xs);border-left:2px solid var(--color-blue-300);padding-inline-start:var(--spacing-2)}.k-lab-docs-prop-values dl{font-weight:var(--font-bold)}.k-lab-docs-prop-values dl+dl{margin-top:var(--spacing-2)}.k-lab-docs-prop-values dd{display:inline-flex;flex-wrap:wrap;gap:var(--spacing-1)}.k-lab-docs-desc-header{display:flex;justify-content:space-between;align-items:center}.k-table .k-lab-docs-deprecated{--box-height: var(--height-xs);--text-font-size: var(--text-xs)}.k-labs-docs-params li{list-style:square;margin-inline-start:var(--spacing-3)}.k-labs-docs-params .k-lab-docs-types{margin-inline:1ch}.k-lab-docs-types{display:inline-flex;flex-wrap:wrap;gap:var(--spacing-1)}.k-lab-docs-types.k-text code{color:var(--color-gray-800);outline-color:var(--color-gray-400);background:var(--color-gray-300)}.k-lab-docs-types code:is([data-type=boolean],[data-type=Boolean]){color:var(--color-purple-800);outline-color:var(--color-purple-400);background:var(--color-purple-300)}.k-lab-docs-types code:is([data-type=string],[data-type=String]){color:var(--color-green-800);outline-color:var(--color-green-500);background:var(--color-green-300)}.k-lab-docs-types code:is([data-type=number],[data-type=Number]){color:var(--color-orange-800);outline-color:var(--color-orange-500);background:var(--color-orange-300)}.k-lab-docs-types code:is([data-type=array],[data-type=Array]){color:var(--color-aqua-800);outline-color:var(--color-aqua-500);background:var(--color-aqua-300)}.k-lab-docs-types code:is([data-type=object],[data-type=Object]){color:var(--color-yellow-800);outline-color:var(--color-yellow-500);background:var(--color-yellow-300)}.k-lab-docs-types code[data-type=func]{color:var(--color-pink-800);outline-color:var(--color-pink-400);background:var(--color-pink-300)}.k-lab-docs-section+.k-lab-docs-section{margin-top:var(--spacing-12)}.k-lab-docs-section .k-headline{margin-bottom:var(--spacing-3)}.k-lab-docs-section .k-table td{padding:.375rem var(--table-cell-padding);vertical-align:top;line-height:1.5;word-break:break-word}.k-lab-docs-description :where(.k-text,.k-box)+:where(.k-text,.k-box){margin-top:var(--spacing-3)}.k-lab-docs-required{margin-inline-start:var(--spacing-1);font-size:.7rem;vertical-align:super;color:var(--color-red-600)}.k-lab-docs-since{margin-top:var(--spacing-1);font-size:var(--text-xs);color:var(--color-gray-600)}.k-lab-example{position:relative;container-type:inline-size;max-width:100%;outline-offset:-2px;border-radius:var(--rounded);border:1px solid var(--color-gray-300)}.k-lab-example+.k-lab-example{margin-top:var(--spacing-12)}.k-lab-example-header{display:flex;justify-content:space-between;align-items:center;height:var(--height-md);padding-block:var(--spacing-3);padding-inline:var(--spacing-2);border-bottom:1px solid var(--color-gray-300)}.k-lab-example-label{font-size:12px;color:var(--color-text-dimmed)}.k-lab-example-canvas,.k-lab-example-code{padding:var(--spacing-16)}.k-lab-example[data-flex] .k-lab-example-canvas{display:flex;align-items:center;gap:var(--spacing-6)}.k-lab-example-inspector{--icon-size: 13px;--button-color-icon: var(--color-gray-500)}.k-lab-example-inspector .k-button:not([data-theme]):hover{--button-color-icon: var(--color-gray-600)}.k-lab-example-inspector .k-button:where([data-theme]){--button-color-icon: var(--color-gray-800)}.k-lab-examples>:where(.k-text,.k-box){margin-bottom:var(--spacing-6)}.k-lab-form>footer{border-top:1px dashed var(--color-border);padding-top:var(--spacing-6)}.k-lab-playground-view[data-has-tabs=true] .k-header{margin-bottom:0}.k-lab-examples h2{margin-bottom:var(--spacing-6)}.k-lab-examples *+h2{margin-top:var(--spacing-12)}.k-lab-input-examples .k-lab-example:has(:invalid){outline:2px solid var(--color-red-500);outline-offset:-2px}.k-lab-input-examples-focus .k-lab-example-canvas>.k-button{margin-top:var(--spacing-6)}.k-lab-helpers-examples .k-lab-example .k-text{margin-bottom:var(--spacing-6)}.k-lab-helpers-examples h2{margin-bottom:var(--spacing-3);font-weight:var(--font-bold)}.token.punctuation,.token.comment,.token.doctype{color:var(--color-gray-500)}.token.tag,.token.markup,.token.variable,.token.this,.token.selector,.token.key,.token.kirbytag-bracket,.token.prolog,.token.delimiter{color:var(--color-red-500)}.token.constant,.token.number,.token.boolean,.token.boolean.important,.token.attr-name,.token.kirbytag-attr,.token.kirbytag-name,.token.entity,.token.bold,.token.bold>.punctuation{color:var(--color-orange-500)}.token.keyword,.token.italic,.token.italic>.punctuation{color:var(--color-purple-500)}.token.function{color:var(--color-blue-500)}.token.operator,.token.title{color:var(--color-aqua-500)}.token.string,.token.attr-value,.token.attr-value .punctuation,.token.list.punctuation{color:var(--color-green-500)}.token.scope,.token.class-name,.token.property,.token.url{color:var(--color-yellow-500)}.token.title,.token.kirbytag-bracket,.token.list.punctuation,.token.bold{font-weight:var(--font-bold)}.token.title .punctuation{color:var(--color-gray-500)}.token.italic{font-style:italic} +.k-items{position:relative;display:grid;container-type:inline-size}.k-items[data-layout=list]{gap:2px}.k-items[data-layout=cardlets]{--items-size: 1fr;display:grid;gap:.75rem;grid-template-columns:repeat(auto-fill,minmax(var(--items-size),1fr))}@container (min-width: 15rem){.k-items[data-layout=cardlets]{--items-size: 15rem}}.k-items[data-layout=cards]{display:grid;gap:1.5rem;grid-template-columns:1fr}@container (min-width: 6rem){.k-items[data-layout=cards][data-size=tiny]{grid-template-columns:repeat(auto-fill,minmax(6rem,1fr))}}@container (min-width: 9rem){.k-items[data-layout=cards][data-size=small]{grid-template-columns:repeat(auto-fill,minmax(9rem,1fr))}}@container (min-width: 12rem){.k-items[data-layout=cards][data-size=auto],.k-items[data-layout=cards][data-size=medium]{grid-template-columns:repeat(auto-fill,minmax(12rem,1fr))}}@container (min-width: 15rem){.k-items[data-layout=cards][data-size=large]{grid-template-columns:repeat(auto-fill,minmax(15rem,1fr))}}@container (min-width: 18rem){.k-items[data-layout=cards][data-size=huge]{grid-template-columns:repeat(auto-fill,minmax(18rem,1fr))}}.k-collection-footer{display:flex;justify-content:space-between;align-items:flex-start;flex-wrap:nowrap;gap:var(--spacing-12);margin-top:var(--spacing-2)}.k-empty{max-width:100%}:root{--item-button-height: var(--height-md);--item-button-width: var(--height-md);--item-height: auto;--item-height-cardlet: calc(var(--height-md) * 3)}.k-item{position:relative;background:var(--color-white);box-shadow:var(--shadow);border-radius:var(--rounded);height:var(--item-height);container-type:inline-size}.k-item:has(a:focus){outline:2px solid var(--color-focus)}@supports not selector(:has(*)){.k-item:focus-within{outline:2px solid var(--color-focus)}}.k-item .k-icon-frame{--back: var(--color-gray-300)}.k-item-content{line-height:1.25;overflow:hidden;padding:var(--spacing-2)}.k-item-content a:focus{outline:0}.k-item-content a:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0}.k-item-info{color:var(--color-text-dimmed)}.k-item-options{transform:translate(0);z-index:1;display:flex;align-items:center;justify-content:space-between}.k-item-options[data-only-option=true]{justify-content:flex-end}.k-item-options .k-button{--button-height: var(--item-button-height);--button-width: var(--item-button-width)}.k-item .k-sort-button{position:absolute;z-index:2}.k-item:not(:hover):not(.k-sortable-fallback) .k-sort-button{opacity:0}.k-item[data-layout=list]{--item-height: var( --field-input-height );--item-button-height: var(--item-height);--item-button-width: auto;display:grid;height:var(--item-height);align-items:center;grid-template-columns:1fr auto}.k-item[data-layout=list][data-has-image=true]{grid-template-columns:var(--item-height) 1fr auto}.k-item[data-layout=list] .k-frame{--ratio: 1/1;border-start-start-radius:var(--rounded);border-end-start-radius:var(--rounded);height:var(--item-height)}.k-item[data-layout=list] .k-item-content{display:flex;min-width:0;white-space:nowrap;gap:var(--spacing-2);justify-content:space-between}.k-item[data-layout=list] .k-item-title,.k-item[data-layout=list] .k-item-info{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.k-item[data-layout=list] .k-item-title{flex-shrink:1}.k-item[data-layout=list] .k-item-info{flex-shrink:2}@container (max-width: 30rem){.k-item[data-layout=list] .k-item-title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.k-item[data-layout=list] .k-item-info{display:none}}.k-item[data-layout=list] .k-sort-button{--button-width: calc(1.5rem + var(--spacing-1));--button-height: var(--item-height);left:calc(-1 * var(--button-width))}.k-item:is([data-layout=cardlets],[data-layout=cards]) .k-sort-button{top:var(--spacing-2);inset-inline-start:var(--spacing-2);background:#ffffff7f;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);box-shadow:0 2px 5px #0003;--button-width: 1.5rem;--button-height: 1.5rem;--button-rounded: var(--rounded-sm);--button-padding: 0;--icon-size: 14px}.k-item:is([data-layout=cardlets],[data-layout=cards]) .k-sort-button:hover{background:#fffffff2}.k-item[data-layout=cardlets]{--item-height: var(--item-height-cardlet);display:grid;grid-template-areas:"content" "options";grid-template-columns:1fr;grid-template-rows:1fr var(--height-md)}.k-item[data-layout=cardlets][data-has-image=true]{grid-template-areas:"image content" "image options";grid-template-columns:minmax(0,var(--item-height)) 1fr}.k-item[data-layout=cardlets] .k-frame{grid-area:image;border-start-start-radius:var(--rounded);border-end-start-radius:var(--rounded);aspect-ratio:auto;height:var(--item-height)}.k-item[data-layout=cardlets] .k-item-content{grid-area:content}.k-item[data-layout=cardlets] .k-item-info{margin-top:.125em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.k-item[data-layout=cardlets] .k-item-options{grid-area:options}.k-item[data-layout=cards]{display:flex;flex-direction:column}.k-item[data-layout=cards] .k-frame{border-start-start-radius:var(--rounded);border-start-end-radius:var(--rounded)}.k-item[data-layout=cards] .k-item-content{flex-grow:1;padding:var(--spacing-2)}.k-item[data-layout=cards] .k-item-info{margin-top:.125em}.k-item[data-theme=disabled]{background:transparent;box-shadow:none;outline:1px solid var(--color-border);outline-offset:-1px}.k-dialog-body{padding:var(--dialog-padding)}.k-dialog[data-has-footer=true] .k-dialog-body{padding-bottom:0}.k-button-group.k-dialog-buttons{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-3);--button-height: var(--height-lg)}.k-dialog-fields{padding-bottom:.5rem;container-type:inline-size}.k-dialog-footer{padding:var(--dialog-padding);line-height:1;flex-shrink:0}.k-dialog .k-notification{padding-block:.325rem;border-start-start-radius:var(--dialog-rounded);border-start-end-radius:var(--dialog-rounded);margin-top:-1px}.k-dialog-search{margin-bottom:.75rem;--input-color-border: transparent;--input-color-back: var(--color-gray-300)}:root{--dialog-color-back: var(--color-light);--dialog-color-text: currentColor;--dialog-margin: var(--spacing-6);--dialog-padding: var(--spacing-6);--dialog-rounded: var(--rounded-xl);--dialog-shadow: var(--shadow-xl);--dialog-width: 22rem}.k-dialog-portal{padding:var(--dialog-margin)}.k-dialog{position:relative;background:var(--dialog-color-back);color:var(--dialog-color-text);width:clamp(10rem,100%,var(--dialog-width));box-shadow:var(--dialog-shadow);border-radius:var(--dialog-rounded);line-height:1;display:flex;flex-direction:column;overflow:clip;container-type:inline-size}@media screen and (min-width: 20rem){.k-dialog[data-size=small]{--dialog-width: 20rem}}@media screen and (min-width: 22rem){.k-dialog[data-size=default]{--dialog-width: 22rem}}@media screen and (min-width: 30rem){.k-dialog[data-size=medium]{--dialog-width: 30rem}}@media screen and (min-width: 40rem){.k-dialog[data-size=large]{--dialog-width: 40rem}}@media screen and (min-width: 60rem){.k-dialog[data-size=huge]{--dialog-width: 60rem}}.k-dialog .k-pagination{margin-bottom:-1.5rem;display:flex;justify-content:center;align-items:center}.k-changes-dialog .k-headline{margin-top:-.5rem;margin-bottom:var(--spacing-3)}.k-error-details{background:var(--color-white);display:block;overflow:auto;padding:1rem;font-size:var(--text-sm);line-height:1.25em;margin-top:.75rem}.k-error-details dt{color:var(--color-red-500);margin-bottom:.25rem}.k-error-details dd{overflow:hidden;overflow-wrap:break-word;text-overflow:ellipsis}.k-error-details dd:not(:last-of-type){margin-bottom:1.5em}.k-error-details li{white-space:pre-line}.k-error-details li:not(:last-child){border-bottom:1px solid var(--color-background);padding-bottom:.25rem;margin-bottom:.25rem}.k-models-dialog .k-list-item{cursor:pointer}.k-models-dialog .k-choice-input{--choice-color-checked: var(--color-focus);display:flex;align-items:center;height:var(--item-button-height);margin-inline-end:var(--spacing-3)}.k-models-dialog .k-choice-input input{top:0}.k-models-dialog .k-collection-footer .k-pagination{margin-bottom:0}.k-license-dialog-status{display:flex;align-items:center;gap:var(--spacing-2)}.k-license-dialog .k-icon{color:var(--theme-color-700)}.k-page-template-switch{margin-bottom:var(--spacing-6);padding-bottom:var(--spacing-6);border-bottom:1px dashed var(--color-gray-300)}.k-page-move-dialog .k-headline{margin-bottom:var(--spacing-2)}.k-page-move-parent{--tree-color-back: var(--color-white);--tree-color-hover-back: var(--color-light);padding:var(--spacing-3);background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow)}.k-pages-dialog-navbar{display:flex;align-items:center;justify-content:center;margin-bottom:.5rem;padding-inline-end:38px}.k-pages-dialog-navbar .k-button[aria-disabled]{opacity:0}.k-pages-dialog-navbar .k-headline{flex-grow:1;text-align:center}.k-pages-dialog-option[aria-disabled]{opacity:.25}.k-search-dialog{--dialog-padding: 0;--dialog-rounded: var(--rounded);overflow:visible}.k-overlay[open][data-type=dialog]>.k-portal>.k-search-dialog{margin-top:0}.k-totp-dialog-headline{margin-bottom:var(--spacing-1)}.k-totp-dialog-intro{margin-bottom:var(--spacing-6)}.k-totp-dialog-grid{display:grid;gap:var(--spacing-6)}@media screen and (min-width: 40rem){.k-totp-dialog-grid{grid-template-columns:1fr 1fr;gap:var(--spacing-8)}}.k-totp-qrcode .k-box[data-theme]{padding:var(--box-padding-inline)}.k-totp-dialog-fields .k-field-name-confirm{--input-height: var(--height-xl);--input-rounded: var(--rounded);--input-font-size: var(--text-3xl)}.k-upload-dialog.k-dialog{--dialog-width: 40rem}.k-upload-replace-dialog .k-upload-items{display:flex;gap:var(--spacing-3);align-items:center}.k-upload-original{width:6rem;border-radius:var(--rounded);box-shadow:var(--shadow);overflow:hidden}.k-upload-replace-dialog .k-upload-item{flex-grow:1}.k-drawer-body{padding:var(--drawer-body-padding);flex-grow:1;background:var(--color-background)}.k-drawer-body .k-writer-input:focus-within .k-toolbar:not([data-inline=true]),.k-drawer-body .k-textarea-input-wrapper:focus-within .k-toolbar,.k-drawer-body .k-table th{top:-1.5rem}.k-drawer-header{--button-height: calc(var(--drawer-header-height) - var(--spacing-1));flex-shrink:0;height:var(--drawer-header-height);padding-inline-start:var(--drawer-header-padding);display:flex;align-items:center;line-height:1;justify-content:space-between;background:var(--color-white);font-size:var(--text-sm)}.k-drawer-breadcrumb{flex-grow:1}.k-drawer-options{display:flex;align-items:center;padding-inline-end:.75rem}.k-drawer-option{--button-width: var(--button-height)}.k-drawer-option[aria-disabled]{opacity:var(--opacity-disabled)}.k-notification.k-drawer-notification{padding:.625rem 1.5rem}.k-drawer-tabs{display:flex;align-items:center;line-height:1}.k-drawer-tab.k-button{--button-height: calc(var(--drawer-header-height) - var(--spacing-1));--button-padding: var(--spacing-3);display:flex;align-items:center;font-size:var(--text-xs);overflow-x:visible}.k-drawer-tab.k-button[aria-current]:after{position:absolute;bottom:-2px;inset-inline:var(--button-padding);content:"";background:var(--color-black);height:2px;z-index:1}:root{--drawer-body-padding: 1.5rem;--drawer-color-back: var(--color-light);--drawer-header-height: 2.5rem;--drawer-header-padding: 1rem;--drawer-shadow: var(--shadow-xl);--drawer-width: 50rem}.k-drawer-overlay+.k-drawer-overlay{--overlay-color-back: none}.k-drawer{--header-sticky-offset: calc(var(--drawer-body-padding) * -1);z-index:var(--z-toolbar);flex-basis:var(--drawer-width);position:relative;display:flex;flex-direction:column;background:var(--drawer-color-back);box-shadow:var(--drawer-shadow);container-type:inline-size}.k-drawer[aria-disabled]{display:none;pointer-events:none}.k-dropdown{position:relative}:root{--dropdown-color-bg: var(--color-black);--dropdown-color-text: var(--color-white);--dropdown-color-current: var(--color-blue-500);--dropdown-color-hr: rgba(255, 255, 255, .25);--dropdown-padding: var(--spacing-2);--dropdown-rounded: var(--rounded);--dropdown-shadow: var(--shadow-xl)}.k-dropdown-content{--dropdown-x: 0;--dropdown-y: 0;position:absolute;inset-block-start:0;inset-inline-start:initial;left:0;width:max-content;padding:var(--dropdown-padding);background:var(--dropdown-color-bg);border-radius:var(--dropdown-rounded);color:var(--dropdown-color-text);box-shadow:var(--dropdown-shadow);text-align:start;transform:translate(var(--dropdown-x),var(--dropdown-y))}.k-dropdown-content::backdrop{background:none}.k-dropdown-content[data-align-x=end]{--dropdown-x: -100%}.k-dropdown-content[data-align-x=center]{--dropdown-x: -50%}.k-dropdown-content[data-align-y=top]{--dropdown-y: -100%}.k-dropdown-content hr{margin:.5rem 0;height:1px;background:var(--dropdown-color-hr)}.k-dropdown-content[data-theme=light]{--dropdown-color-bg: var(--color-white);--dropdown-color-text: var(--color-black);--dropdown-color-current: var(--color-blue-800);--dropdown-color-hr: rgba(0, 0, 0, .1)}.k-dropdown-item.k-button{--button-align: flex-start;--button-color-text: var(--dropdown-color-text);--button-height: var(--height-sm);--button-rounded: var(--rounded-sm);--button-width: 100%;display:flex}.k-dropdown-item.k-button:focus{outline:var(--outline)}.k-dropdown-item.k-button[aria-current]{--button-color-text: var(--dropdown-color-current)}.k-dropdown-item.k-button[aria-current]:after{margin-inline-start:auto;text-align:center;content:"✓";padding-inline-start:var(--spacing-1)}.k-dropdown-item.k-button:not([aria-disabled]):hover{--button-color-back: var(--dropdown-color-hr)}.k-options-dropdown{display:flex;justify-content:center;align-items:center}:root{--picklist-rounded: var(--rounded-sm);--picklist-highlight: var(--color-yellow-500)}.k-picklist-input{--choice-color-text: currentColor;--button-rounded: var(--picklist-rounded)}.k-picklist-input-header{--input-rounded: var(--picklist-rounded)}.k-picklist-input-search{display:flex;align-items:center;border-radius:var(--picklist-rounded)}.k-picklist-input-search .k-search-input{height:var(--button-height)}.k-picklist-input-search:focus-within{outline:var(--outline)}.k-picklist-dropdown .k-picklist-input-create:focus{outline:0}.k-picklist-dropdown .k-picklist-input-create[aria-disabled=true]{visibility:hidden}.k-picklist-input-options.k-grid{--columns: 1}.k-picklist-input-options li+li{margin-top:var(--spacing-1)}.k-picklist-input-options .k-choice-input{padding-inline:var(--spacing-2)}.k-picklist-input-options .k-choice-input{--choice-color-checked: var(--color-focus)}.k-picklist-input-options .k-choice-input:has(:checked){--choice-color-text: var(--color-focus)}.k-picklist-input-options .k-choice-input[aria-disabled=true]{--choice-color-text: var(--color-text-dimmed)}.k-picklist-input-options .k-choice-input:has(:focus-within){outline:var(--outline)}.k-picklist-input-options .k-choice-input b{font-weight:var(--font-normal);color:var(--picklist-highlight)}.k-picklist-input-more.k-button{--button-width: 100%;--button-align: start;--button-color-text: var(--color-text-dimmed);padding-inline:var(--spacing-2)}.k-picklist-input-more.k-button .k-button-icon{position:relative;inset-inline-start:-1px}.k-picklist-input-empty{height:var(--button-height);line-height:1.25rem;padding:var(--spacing-1) var(--spacing-2);color:var(--color-text-dimmed)}.k-picklist-dropdown{--color-text-dimmed: var(--color-gray-400);padding:0;max-width:30rem;min-width:8rem}.k-picklist-dropdown :where(.k-picklist-input-header,.k-picklist-input-body,.k-picklist-input-footer){padding:var(--dropdown-padding)}.k-picklist-dropdown .k-picklist-input-header{border-bottom:1px solid var(--dropdown-color-hr)}.k-picklist-dropdown .k-picklist-input-search{background:var(--dropdown-color-hr);padding-inline-end:var(--input-padding)}.k-picklist-dropdown .k-picklist-input-create{--button-rounded: 1rem;--button-height: 1.125rem}.k-picklist-dropdown .k-picklist-input-create:focus{--button-color-back: var(--color-blue-500);--button-color-text: var(--color-black)}.k-picklist-dropdown .k-picklist-input-body{max-height:calc(var(--button-height) * 9.5 + 2px * 9 + var(--dropdown-padding));overflow-y:auto;outline-offset:-2px;overscroll-behavior:contain;scroll-padding-top:var(--dropdown-padding);scroll-padding-bottom:var(--dropdown-padding)}.k-picklist-dropdown .k-picklist-input-options .k-choice-input{--choice-color-border: var(--dropdown-color-hr);--choice-color-back: var(--dropdown-color-hr);--choice-color-info: var(--color-text-dimmed);min-height:var(--button-height);border-radius:var(--picklist-rounded);padding-block:.375rem}.k-picklist-dropdown .k-picklist-input-options li+li{margin-top:0}.k-picklist-dropdown .k-picklist-input-options .k-choice-input[aria-disabled=true] input{--choice-color-border: var(--dropdown-color-hr);--choice-color-back: var(--dropdown-color-hr);--choice-color-checked: var(--dropdown-color-hr);opacity:var(--opacity-disabled)}.k-picklist-dropdown .k-picklist-input-options .k-choice-input:not([aria-disabled=true]):hover{background-color:var(--dropdown-color-hr)}.k-picklist-dropdown .k-picklist-input-options .k-choice-input:not([aria-disabled=true]):focus-within{--choice-color-text: var(--color-blue-500)}.k-picklist-dropdown .k-picklist-input-more.k-button:hover{--button-color-back: var(--dropdown-color-hr)}.k-picklist-dropdown .k-picklist-input-body+.k-picklist-input-footer{border-top:1px solid var(--dropdown-color-hr)}.k-counter{font-size:var(--text-xs);color:var(--color-gray-900)}.k-counter[data-invalid=true]{color:var(--color-red-700)}.k-counter-rules{color:var(--color-gray-600);padding-inline-start:.5rem}.k-form-submitter{display:none}.k-field[data-disabled=true]{cursor:not-allowed}.k-field[data-disabled=true] *{pointer-events:none}.k-field[data-disabled=true] .k-text[data-theme=help] *{pointer-events:initial}.k-field-header{display:flex;justify-content:space-between;align-items:center;gap:var(--spacing-6);position:relative;margin-bottom:var(--spacing-2)}.k-field-options{flex-shrink:0}.k-field:focus-within>.k-field-header>.k-field-counter{display:block}.k-field-footer{margin-top:var(--spacing-2)}.k-fieldset{border:0}:root{--input-color-back: var(--color-white);--input-color-border: var(--color-border);--input-color-description: var(--color-text-dimmed);--input-color-icon: currentColor;--input-color-placeholder: var(--color-gray-600);--input-color-text: currentColor;--input-font-family: var(--font-sans);--input-font-size: var(--text-sm);--input-height: 2.25rem;--input-leading: 1;--input-outline-focus: var(--outline);--input-padding: var(--spacing-2);--input-padding-multiline: .475rem var(--input-padding);--input-rounded: var(--rounded);--input-shadow: none}@media (pointer: coarse){:root{--input-font-size: var(--text-md);--input-padding-multiline: .375rem var(--input-padding)}}.k-input{display:flex;align-items:center;line-height:var(--input-leading);border:0;background:var(--input-color-back);border-radius:var(--input-rounded);outline:1px solid var(--input-color-border);color:var(--input-color-text);min-height:var(--input-height);box-shadow:var(--input-shadow);font-family:var(--input-font-family);font-size:var(--input-font-size)}.k-input:focus-within{outline:var(--input-outline-focus)}.k-input-element{flex-grow:1}.k-input-icon{color:var(--input-color-icon);display:flex;justify-content:center;align-items:center;width:var(--input-height)}.k-input-icon-button{width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-shrink:0}.k-input-description{color:var(--input-color-description);padding-inline:var(--input-padding)}.k-input-before{padding-inline-end:0}.k-input-after{padding-inline-start:0}.k-input :where(.k-input-description,.k-input-icon){align-self:stretch;display:flex;align-items:center;flex-shrink:0}.k-input[data-disabled=true]{--input-color-back: var(--color-background);--input-color-icon: var(--color-gray-600);pointer-events:none}.k-block-title{display:flex;align-items:center;min-width:0;padding-inline-end:.75rem;line-height:1;gap:var(--spacing-2)}.k-block-icon{--icon-color: var(--color-gray-600);width:1rem}.k-block-label{color:var(--color-text-dimmed);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.k-block-type-default .k-block-title{line-height:1.5em}.k-block-options{--toolbar-size: 30px;box-shadow:var(--shadow-toolbar)}.k-block-options>.k-button:not(:last-of-type){border-inline-end:1px solid var(--color-background)}.k-block-options .k-dropdown-content{margin-top:.5rem}.k-block-container{position:relative;padding:var(--spacing-3);background:var(--color-white);border-radius:var(--rounded)}.k-block-container:not(:last-of-type){border-bottom:1px dashed rgba(0,0,0,.1)}.k-block-container:focus{outline:0}.k-block-container[data-selected=true]{z-index:2;outline:var(--outline);border-bottom-color:transparent}.k-block-container[data-batched=true]:after{position:absolute;top:0;right:0;bottom:0;left:0;content:"";background:#b1c2d82d;mix-blend-mode:multiply}.k-block-container .k-block-options{display:none;position:absolute;top:0;inset-inline-end:var(--spacing-3);margin-top:calc(-1.75rem + 2px)}.k-block-container[data-last-selected=true]>.k-block-options{display:flex}.k-block-container[data-hidden=true] .k-block{opacity:.25}.k-drawer-options .k-drawer-option[data-disabled=true]{vertical-align:middle;display:inline-grid}.k-block-container[data-disabled=true]{background:var(--color-background)}.k-block-container:is(.k-sortable-ghost,.k-sortable-fallback) .k-block{position:relative;max-height:4rem;overflow:hidden}.k-block-container:is(.k-sortable-ghost,.k-sortable-fallback) .k-block:after{position:absolute;bottom:0;content:"";height:2rem;width:100%;background:linear-gradient(to top,var(--color-white),transparent)}.k-blocks{border-radius:var(--rounded)}.k-blocks:not([data-empty=true],[data-disabled=true]){background:var(--color-white);box-shadow:var(--shadow)}.k-blocks[data-disabled=true]:not([data-empty=true]){border:1px solid var(--input-color-border)}.k-blocks-list[data-multi-select-key=true]>.k-block-container *{pointer-events:none}.k-blocks-list[data-multi-select-key=true]>.k-block-container .k-blocks *{pointer-events:all}.k-blocks .k-sortable-ghost{outline:2px solid var(--color-focus);box-shadow:#11111140 0 5px 10px;cursor:grabbing;cursor:-moz-grabbing;cursor:-webkit-grabbing}.k-blocks-list>.k-blocks-empty{display:flex;align-items:center}.k-block-importer .k-dialog-body{padding:0}.k-block-importer label{display:block;padding:var(--spacing-6) var(--spacing-6) 0;color:var(--color-text-dimmed);line-height:var(--leading-normal)}.k-block-importer label small{display:block;font-size:inherit}.k-block-importer textarea{width:100%;height:20rem;background:none;font:inherit;color:var(--color-white);border:0;padding:var(--spacing-6);resize:none}.k-block-importer textarea:focus{outline:0}.k-block-selector .k-headline{margin-bottom:1rem}.k-block-selector details+details{margin-top:var(--spacing-6)}.k-block-selector summary{font-size:var(--text-xs);cursor:pointer;color:var(--color-text-dimmed)}.k-block-selector details:only-of-type summary{pointer-events:none}.k-block-selector summary:focus{outline:0}.k-block-selector summary:focus-visible{color:var(--color-focus)}.k-block-types{display:grid;grid-gap:2px;margin-top:.75rem;grid-template-columns:repeat(1,1fr)}.k-block-types .k-button{--button-color-icon: var(--color-text);--button-color-back: var(--color-white);--button-padding: var(--spacing-3);width:100%;justify-content:start;gap:1rem;box-shadow:var(--shadow)}.k-block-types .k-button[aria-disabled]{opacity:var(--opacity-disabled);--button-color-back: var(--color-gray-200);box-shadow:none}.k-clipboard-hint{padding-top:1.5rem;line-height:var(--leading-normal);font-size:var(--text-xs);color:var(--color-text-dimmed)}.k-clipboard-hint small{display:block;font-size:inherit;color:var(--color-text-dimmed)}.k-block-background-dropdown>.k-button{--color-frame-rounded: 0;--color-frame-size: 1.5rem;--button-height: 1.5rem;--button-padding: 0 .125rem;--button-color-back: var(--color-white);gap:.25rem;box-shadow:var(--shadow-toolbar);border:1px solid var(--color-white)}.k-block-background-dropdown .k-color-frame{border-right:1px solid var(--color-gray-300)}.k-block-background-dropdown .k-color-frame:after{box-shadow:none}.k-block .k-block-background-dropdown{position:absolute;inset-inline-end:var(--spacing-3);bottom:var(--spacing-3);opacity:0;transition:opacity .2s ease-in-out}.k-block:hover .k-block-background-dropdown{opacity:1}.k-block-figure:not([data-empty=true]){--block-figure-back: var(--color-white);background:var(--block-figure-back)}.k-block-figure-container:not([data-disabled=true]){cursor:pointer}.k-block-figure iframe{border:0;pointer-events:none;background:var(--color-black)}.k-block-figure figcaption{padding-top:.5rem;color:var(--color-text-dimmed);font-size:var(--text-sm);text-align:center}.k-block-figure-empty{--button-width: 100%;--button-height: 6rem;--button-color-text: var(--color-text-dimmed);--button-color-back: var(--color-gray-200)}.k-block-figure-empty,.k-block-figure-container>*{border-radius:var(--rounded-sm)}.k-block-figure-caption{display:flex;justify-content:center;padding-top:var(--spacing-3)}.k-block-figure-caption .k-writer{width:max-content;text-align:center}.k-block-figure-caption .k-writer .k-text{color:var(--color-gray-600);font-size:var(--text-sm);mix-blend-mode:exclusion}.k-block-type-code-editor{position:relative}.k-block-type-code-editor .k-input{--input-color-border: none;--input-color-back: var(--color-black);--input-color-text: var(--color-white);--input-font-family: var(--font-mono);--input-outline-focus: none;--input-padding: var(--spacing-3);--input-padding-multiline: var(--input-padding)}.k-block-type-code-editor .k-input[data-type=textarea]{white-space:pre-wrap}.k-block-type-code-editor-language{--input-font-size: var(--text-xs);position:absolute;inset-inline-end:0;bottom:0}.k-block-type-code-editor-language .k-input-element{padding-inline-start:1.5rem}.k-block-type-code-editor-language .k-input-icon{inset-inline-start:0}.k-block-container.k-block-container-type-fields{padding-block:0}.k-block-container:not([data-hidden=true]) .k-block-type-fields>:not([data-collapsed=true]){padding-bottom:var(--spacing-3)}.k-block-type-fields-header{display:flex;justify-content:space-between}.k-block-type-fields-header .k-block-title{padding-block:var(--spacing-3);cursor:pointer;white-space:nowrap}.k-block-type-fields-form{background-color:var(--color-gray-200);padding:var(--spacing-6) var(--spacing-6) var(--spacing-8);border-radius:var(--rounded-sm);container:column / inline-size}.k-block-container-type-fields[data-hidden=true] :where(.k-drawer-tabs,.k-block-type-fields-form){display:none}.k-block-container.k-block-container-type-gallery{padding:0}.k-block-type-gallery>figure{padding:var(--spacing-3);border-radius:var(--rounded)}.k-block-type-gallery>figure:not([data-empty=true]){background:var(--block-back)}.k-block-type-gallery ul{display:grid;grid-gap:.75rem;grid-template-columns:repeat(auto-fit,minmax(6rem,1fr));line-height:0;align-items:center;justify-content:center}.k-block-type-gallery:not([data-disabled=true]) ul{cursor:pointer}.k-block-type-gallery ul .k-image-frame{border-radius:var(--rounded-sm)}.k-block-type-gallery[data-disabled=true] .k-block-type-gallery-placeholder{background:var(--color-gray-250)}.k-block-type-gallery-placeholder{background:var(--color-background)}.k-block-type-heading-input{display:flex;align-items:center;line-height:1.25em;font-size:var(--text-size);font-weight:var(--font-bold)}.k-block-type-heading-input[data-level=h1]{--text-size: var(--text-3xl);line-height:1.125em}.k-block-type-heading-input[data-level=h2]{--text-size: var(--text-2xl)}.k-block-type-heading-input[data-level=h3]{--text-size: var(--text-xl)}.k-block-type-heading-input[data-level=h4]{--text-size: var(--text-lg)}.k-block-type-heading-input[data-level=h5]{--text-size: var(--text-md);line-height:1.5em}.k-block-type-heading-input[data-level=h6]{--text-size: var(--text-sm);line-height:1.5em}.k-block-type-heading-input .k-writer .ProseMirror strong{font-weight:700}.k-block-type-heading-level{--input-color-back: transparent;--input-color-border: none;--input-color-text: var(--color-gray-600);font-weight:var(--font-bold);text-transform:uppercase}.k-block-container.k-block-container-type-image{padding:0}.k-block-type-image .k-block-figure{padding:var(--spacing-3);border-radius:var(--rounded)}.k-block-type-image .k-block-figure-container{text-align:center;line-height:0}.k-block-type-image .k-block-figure[data-empty=true]{padding:var(--spacing-3)}.k-block-type-image-auto{max-width:100%;max-height:30rem;margin-inline:auto}.k-block-type-image .k-background-dropdown{position:absolute;inset-inline-end:var(--spacing-3);bottom:var(--spacing-3);opacity:0;transition:opacity .2s ease-in-out}.k-block-type-image:hover .k-background-dropdown{opacity:1}.k-block-type-line hr{margin-block:.75rem;border:0;border-top:1px solid var(--color-border)}.k-block-type-list-input{--input-color-back: transparent;--input-color-border: none;--input-outline-focus: none}.k-block-type-markdown-input{--input-color-back: var(--color-light);--input-color-border: none;--input-outline-focus: none;--input-padding-multiline: var(--spacing-3)}.k-block-type-quote-editor{padding-inline-start:var(--spacing-3);border-inline-start:2px solid var(--color-black)}.k-block-type-quote-text{font-size:var(--text-xl);margin-bottom:var(--spacing-1);line-height:1.25em}.k-block-type-quote-citation{font-style:italic;color:var(--color-text-dimmed)}.k-block-type-table-preview{cursor:pointer;border:1px solid var(--color-gray-300);border-spacing:0;border-radius:var(--rounded-sm)}.k-block-type-table-preview :where(th,td){text-align:start;line-height:1.5em;font-size:var(--text-sm)}.k-block-type-table-preview th{padding:.5rem .75rem}.k-block-type-table-preview td:not(.k-table-index-column){padding:0 .75rem}.k-block-type-table-preview td>*,.k-block-type-table-preview td [class$=-field-preview]{padding:0}.k-block-type-text-input{line-height:1.5;height:100%}.k-block-container.k-block-container-type-text{padding:0}.k-block-type-text-input.k-writer[data-toolbar-inline=true]{padding:var(--spacing-3)}.k-block-type-text-input.k-writer:not([data-toolbar-inline=true])>.ProseMirror,.k-block-type-text-input.k-writer:not([data-toolbar-inline=true])[data-placeholder][data-empty=true]:before{padding:var(--spacing-3) var(--spacing-6)}.k-block-type-text-input.k-textarea-input .k-textarea-input-native{padding:var(--input-padding-multiline)}.k-block-type-video-figure video{pointer-events:none}.k-blocks-field{position:relative}.k-blocks-field>footer{display:flex;justify-content:center;margin-top:var(--spacing-3)}.k-string-input{padding:var(--input-padding);border-radius:var(--input-rounded)}.k-string-input:focus{outline:0}.k-string-input[data-font=monospace]{font-family:var(--font-mono)}.k-color-field{--color-frame-size: calc(var(--input-height) - var(--spacing-2))}.k-color-field .k-input-before{align-items:center;padding-inline-start:var(--spacing-1)}.k-color-field-options{--color-frame-size: var(--input-height)}.k-color-field-picker{padding:var(--spacing-3)}.k-color-field-picker-toggle{--color-frame-rounded: var(--rounded-sm);border-radius:var(--color-frame-rounded)}.k-color-field .k-colorname-input{padding-inline:var(--input-padding)}.k-color-field .k-colorname-input:focus{outline:0}.k-date-input:disabled::placeholder{opacity:0}.k-date-field-body{display:grid;gap:var(--spacing-2)}@container (min-width: 20rem){.k-date-field-body[data-has-time=true]{grid-template-columns:1fr minmax(6rem,9rem)}}.k-text-input{padding:var(--input-padding);border-radius:var(--input-rounded)}.k-text-input:focus{outline:0}.k-text-input[data-font=monospace]{font-family:var(--font-mono)}.k-text-input:disabled::placeholder{opacity:0}.k-models-field[data-disabled=true] .k-item *{pointer-events:all!important}.k-headline-field{position:relative;padding-top:1.5rem}.k-fieldset>.k-grid .k-column:first-child .k-headline-field{padding-top:0}.k-headline-field h2.k-headline{font-weight:var(--font-normal)}.k-headline-field footer{margin-top:var(--spacing-2)}.k-info-field .k-headline{padding-bottom:.75rem;line-height:1.25rem}.k-layout-column{position:relative;height:100%;display:flex;flex-direction:column;background:var(--color-white);min-height:6rem}.k-layout-column:focus{outline:0}.k-layout-column>.k-blocks{background:none;box-shadow:none;padding:0;height:100%;background:var(--color-white);min-height:4rem}.k-layout-column>.k-blocks[data-empty=true]{min-height:6rem}.k-layout-column>.k-blocks>.k-blocks-list{display:flex;flex-direction:column;height:100%}.k-layout-column>.k-blocks>.k-blocks-list>.k-block-container:last-of-type{flex-grow:1}.k-layout-column>.k-blocks>.k-blocks-list>.k-blocks-empty.k-box{--box-color-back: transparent;position:absolute;top:0;right:0;bottom:0;left:0;justify-content:center;opacity:0;transition:opacity .3s;border:0}.k-layout-column>.k-blocks>.k-blocks-list>.k-blocks-empty:hover{opacity:1}.k-layout{--layout-border-color: var(--color-gray-300);--layout-toolbar-width: 2rem;position:relative;padding-inline-end:var(--layout-toolbar-width);background:#fff;box-shadow:var(--shadow)}[data-disabled=true] .k-layout{padding-inline-end:0}.k-layout:not(:last-of-type){margin-bottom:1px}.k-layout:focus{outline:0}.k-layout-toolbar{position:absolute;inset-block:0;inset-inline-end:0;width:var(--layout-toolbar-width);display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding-bottom:var(--spacing-2);font-size:var(--text-sm);background:var(--color-gray-100);border-inline-start:1px solid var(--color-light);color:var(--color-gray-500)}.k-layout-toolbar:hover{color:var(--color-black)}.k-layout-toolbar-button{width:var(--layout-toolbar-width);height:var(--layout-toolbar-width)}.k-layout-columns.k-grid{grid-gap:1px;background:var(--layout-border-color);background:var(--color-gray-300)}.k-layout:not(:first-child) .k-layout-columns.k-grid{border-top:0}.k-layouts .k-sortable-ghost{position:relative;box-shadow:#11111140 0 5px 10px;outline:2px solid var(--color-focus);cursor:grabbing;z-index:1}.k-layout-field>footer{display:flex;justify-content:center;margin-top:var(--spacing-3)}.k-line-field{position:relative;border:0;height:3rem;width:auto}.k-line-field:after{position:absolute;content:"";top:50%;margin-top:-1px;inset-inline:0;height:1px;background:var(--color-border)}.k-link-input-header{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:.25rem;height:var(--input-height);grid-area:header}.k-link-input-toggle.k-button{--button-height: var(--height-sm);--button-rounded: var(--rounded-sm);--button-color-back: var(--color-gray-200);margin-inline-start:.25rem}.k-link-input-model{display:flex;justify-content:space-between;margin-inline-end:var(--spacing-1)}.k-link-input-model-placeholder.k-button{--button-align: flex-start;--button-color-text: var(--color-gray-600);--button-height: var(--height-sm);--button-padding: var(--spacing-2);--button-rounded: var(--rounded-sm);flex-grow:1;overflow:hidden;white-space:nowrap;align-items:center}.k-link-field .k-link-field-preview{--tag-height: var(--height-sm);padding-inline:0}.k-link-field .k-link-field-preview .k-tag:focus{outline:0}.k-link-field .k-link-field-preview .k-tag:focus-visible{outline:var(--outline)}.k-link-field .k-link-field-preview .k-tag-text{font-size:var(--text-sm)}.k-link-input-model-toggle{align-self:center;--button-height: var(--height-sm);--button-width: var(--height-sm);--button-rounded: var(--rounded-sm)}.k-link-input-body{display:grid;overflow:hidden;border-top:1px solid var(--color-gray-300);background:var(--color-gray-100);--tree-color-back: var(--color-gray-100);--tree-color-hover-back: var(--color-gray-200)}.k-link-input-body[data-type=page] .k-page-browser{padding:var(--spacing-2);padding-bottom:calc(var(--spacing-2) - 1px);width:100%;container-type:inline-size;overflow:auto}.k-link-field .k-bubbles-field-preview{--bubble-rounded: var(--rounded-sm);--bubble-size: var(--height-sm);padding-inline:0}.k-link-field .k-bubbles-field-preview .k-bubble{font-size:var(--text-sm)}.k-link-field[data-disabled=true] .k-link-input-model-placeholder{display:none}.k-link-field[data-disabled=true] input::placeholder{opacity:0}.k-writer{position:relative;width:100%;display:grid;grid-template-areas:"content";gap:var(--spacing-1)}.k-writer .ProseMirror{overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;white-space:pre-wrap;font-variant-ligatures:none;grid-area:content;padding:var(--input-padding-multiline)}.k-writer .ProseMirror:focus{outline:0}.k-writer .ProseMirror *{caret-color:currentColor}.k-writer .ProseMirror hr.ProseMirror-selectednode{outline:var(--outline)}.k-writer[data-placeholder][data-empty=true]:before{grid-area:content;content:attr(data-placeholder);color:var(--input-color-placeholder);pointer-events:none;white-space:pre-wrap;word-wrap:break-word;line-height:var(--text-line-height);padding:var(--input-padding-multiline)}.k-list-input.k-writer[data-placeholder][data-empty=true]:before{padding-inline-start:2.5em}.k-list-field .k-list-input .ProseMirror,.k-list-field .k-list-input:before{padding:.475rem .5rem .475rem .75rem}:root{--tags-gap: .375rem}.k-tags{display:inline-flex;gap:var(--tags-gap);align-items:center;flex-wrap:wrap}.k-tags .k-sortable-ghost{outline:var(--outline)}.k-tags[data-layout=list],.k-tags[data-layout=list] .k-tag{width:100%}.k-tags.k-draggable .k-tag-text{cursor:grab}.k-tags.k-draggable .k-tag-text:active{cursor:grabbing}.k-multiselect-input{padding:var(--tags-gap);cursor:pointer}.k-multiselect-input-toggle.k-button{opacity:0}.k-tags-input{padding:var(--tags-gap)}.k-tags-input[data-can-add=true]{cursor:pointer}.k-tags-input-toggle.k-button{--button-color-text: var(--input-color-placeholder);opacity:0}.k-tags-input-toggle.k-button:focus{--button-color-text: var(--input-color-text)}.k-tags-input:focus-within .k-tags-input-toggle{opacity:1}.k-tags-input .k-picklist-dropdown{margin-top:var(--spacing-1)}.k-tags-input .k-picklist-dropdown .k-choice-input:focus-within{outline:var(--outline)}.k-number-input{padding:var(--input-padding);border-radius:var(--input-rounded)}.k-number-input:focus{outline:0}.k-table.k-object-field-table{table-layout:auto}.k-table.k-object-field-table tbody td{max-width:0}@container (max-width: 40rem){.k-object-field{overflow:hidden}.k-object-field-table.k-table tbody :where(th):is([data-mobile=true]){width:1px!important;white-space:normal;word-break:normal}}.k-range-input{--range-track-height: 1px;--range-track-back: var(--color-gray-300);--range-tooltip-back: var(--color-black);display:flex;align-items:center;border-radius:var(--range-track-height)}.k-range-input input[type=range]:focus{outline:0}.k-range-input-tooltip{position:relative;display:flex;align-items:center;color:var(--color-white);font-size:var(--text-xs);font-variant-numeric:tabular-nums;line-height:1;text-align:center;border-radius:var(--rounded-sm);background:var(--range-tooltip-back);margin-inline-start:var(--spacing-3);padding:0 var(--spacing-1);white-space:nowrap}.k-range-input-tooltip:after{position:absolute;top:50%;inset-inline-start:-3px;width:0;height:0;transform:translateY(-50%);border-block:3px solid transparent;border-inline-end:3px solid var(--range-tooltip-back);content:""}.k-range-input-tooltip>*{padding:var(--spacing-1)}.k-range-input[data-disabled=true]{--range-tooltip-back: var(--color-gray-600)}.k-input[data-type=range] .k-range-input{padding-inline:var(--input-padding)}.k-select-input{position:relative;display:block;overflow:hidden;padding:var(--input-padding);border-radius:var(--input-rounded)}.k-select-input[data-empty=true]{color:var(--input-color-placeholder)}.k-select-input-native{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;z-index:1}.k-select-input-native[disabled]{cursor:default}.k-input[data-type=select]{position:relative}.k-input[data-type=select] .k-input-icon{position:absolute;inset-block:0;inset-inline-end:0}.k-structure-field:not([data-disabled=true]) td.k-table-column{cursor:pointer}.k-structure-field .k-table+footer{display:flex;justify-content:center;margin-top:var(--spacing-3)}.k-field-counter{display:none}.k-text-field:focus-within .k-field-counter{display:block}.k-toolbar.k-textarea-toolbar{border-end-start-radius:0;border-end-end-radius:0;border-bottom:1px solid var(--toolbar-border)}.k-toolbar.k-textarea-toolbar>.k-button:first-child{border-end-start-radius:0}.k-toolbar.k-textarea-toolbar>.k-button:last-child{border-end-end-radius:0}.k-textarea-input[data-size=small]{--textarea-size: 7.5rem}.k-textarea-input[data-size=medium]{--textarea-size: 15rem}.k-textarea-input[data-size=large]{--textarea-size: 30rem}.k-textarea-input[data-size=huge]{--textarea-size: 45rem}.k-textarea-input-wrapper{position:relative;display:block}.k-textarea-input-native{resize:none;min-height:var(--textarea-size)}.k-textarea-input-native:focus{outline:0}.k-textarea-input-native[data-font=monospace]{font-family:var(--font-mono)}.k-input[data-type=textarea] .k-input-element{min-width:0}.k-input[data-type=textarea] .k-textarea-input-native{padding:var(--input-padding-multiline)}.k-time-input:disabled::placeholder{opacity:0}.k-input[data-type=toggle]{--input-color-border: transparent;--input-shadow: var(--shadow)}.k-input[data-type=toggle] .k-input-before{padding-inline-end:calc(var(--input-padding) / 2)}.k-input[data-type=toggle] .k-toggle-input{padding-inline-start:var(--input-padding)}.k-input[data-type=toggle][data-disabled]{box-shadow:none;border:1px solid var(--color-border)}.k-input[data-type=toggles]{display:inline-flex}.k-input[data-type=toggles].grow{display:flex}.k-input[data-type=toggles]:has(.k-empty){outline:0;display:flex}.k-toggles-input{display:grid;grid-template-columns:repeat(var(--options),minmax(0,1fr));gap:1px;border-radius:var(--rounded);line-height:1;background:var(--color-border);overflow:hidden}.k-toggles-input li{height:var(--field-input-height);background:var(--color-white)}.k-toggles-input label{align-items:center;background:var(--color-white);cursor:pointer;display:flex;font-size:var(--text-sm);justify-content:center;line-height:1.25;padding:0 var(--spacing-3);height:100%}.k-toggles-input li[data-disabled=true] label{color:var(--color-text-dimmed);background:var(--color-light)}.k-toggles-input .k-icon+.k-toggles-text{margin-inline-start:var(--spacing-2)}.k-toggles-input input:focus:not(:checked)+label{background:var(--color-blue-200)}.k-toggles-input input:checked+label{background:var(--color-black);color:var(--color-white)}.k-alpha-input{--range-track-back: linear-gradient(to right, transparent, currentColor);--range-track-height: var(--range-thumb-size);color:#000;background:var(--color-white) var(--pattern-light)}.k-calendar-input{--button-height: var(--height-sm);--button-width: var(--button-height);--button-padding: 0;padding:var(--spacing-2);width:min-content}.k-calendar-table{table-layout:fixed;min-width:15rem}.k-calendar-input .k-button{justify-content:center}.k-calendar-input>nav{display:flex;direction:ltr;align-items:center;margin-bottom:var(--spacing-2)}.k-calendar-selects{flex-grow:1;display:flex;align-items:center;justify-content:center}[dir=ltr] .k-calendar-selects{direction:ltr}[dir=rtl] .k-calendar-selects{direction:rtl}.k-calendar-selects .k-select-input{display:flex;align-items:center;text-align:center;height:var(--button-height);padding:0 .5rem;border-radius:var(--input-rounded)}.k-calendar-selects .k-select-input:focus-within{outline:var(--outline)}.k-calendar-input th{padding-block:.5rem;color:var(--color-gray-500);font-size:var(--text-xs);text-align:center}.k-calendar-day{padding:2px}.k-calendar-day[aria-current=date] .k-button{text-decoration:underline}.k-calendar-day[aria-selected=date] .k-button,.k-calendar-day[aria-selected=date] .k-button:focus{--button-color-text: var(--color-text);--button-color-back: var(--color-blue-500)}.k-calendar-day[aria-selected=date] .k-button:focus-visible{outline-offset:2px}.k-calendar-today{padding-top:var(--spacing-2);text-align:center}.k-calendar-today .k-button{--button-width: auto;--button-padding: var(--spacing-3);font-size:var(--text-xs);text-decoration:underline}.k-choice-input{display:flex;gap:var(--spacing-3);min-width:0}.k-choice-input input{top:2px}.k-choice-input-label{display:flex;line-height:1.25rem;flex-direction:column;min-width:0;color:var(--choice-color-text)}.k-choice-input-label>*{display:block;overflow:hidden;text-overflow:ellipsis}.k-choice-input-label-info{color:var(--choice-color-info)}.k-choice-input[aria-disabled]{cursor:not-allowed}:where(.k-checkboxes-field,.k-radio-field) .k-choice-input{min-height:var(--input-height);padding-block:var(--spacing-2);padding-inline:var(--spacing-3);border-radius:var(--input-rounded)}:where(.k-checkboxes-field,.k-radio-field) .k-choice-input:not([aria-disabled=true]){background:var(--input-color-back);box-shadow:var(--shadow)}:where(.k-checkboxes-field,.k-radio-field) .k-choice-input[aria-disabled=true]{border:1px solid var(--input-color-border)}.k-coloroptions-input{--color-preview-size: var(--input-height)}.k-coloroptions-input ul{display:grid;grid-template-columns:repeat(auto-fill,var(--color-preview-size));gap:var(--spacing-2)}.k-coloroptions-input input:focus+.k-color-frame{outline:var(--outline)}.k-coloroptions-input[disabled] label{opacity:var(--opacity-disabled);cursor:not-allowed}.k-coloroptions-input input:checked+.k-color-frame{outline:1px solid var(--color-gray-600);outline-offset:2px}.k-colorpicker-input{--h: 0;--s: 0%;--l: 0%;--a: 1;--range-thumb-size: .75rem;--range-track-height: .75rem;display:flex;flex-direction:column;gap:var(--spacing-3);width:max-content}.k-colorpicker-input .k-coords-input{border-radius:var(--rounded-sm);aspect-ratio:1/1;background:linear-gradient(to bottom,transparent,#000),linear-gradient(to right,#fff,hsl(var(--h),100%,50%))}.k-colorpicker-input .k-alpha-input{color:hsl(var(--h),var(--s),var(--l))}.k-colorpicker-input .k-coloroptions-input ul{grid-template-columns:repeat(6,1fr)}.k-coords-input{position:relative;display:block!important}.k-coords-input img{width:100%}.k-coords-input-thumb{position:absolute;aspect-ratio:1/1;width:var(--range-thumb-size);background:var(--range-thumb-color);border-radius:var(--range-thumb-size);box-shadow:var(--range-thumb-shadow);transform:translate(-50%,-50%);cursor:move}.k-coords-input[data-empty] .k-coords-input-thumb{opacity:0}.k-coords-input-thumb:active{cursor:grabbing}.k-coords-input:focus-within{outline:var(--outline)}.k-coords-input[aria-disabled]{pointer-events:none;opacity:var(--opacity-disabled)}.k-coords-input .k-coords-input-thumb:focus{outline:var(--outline)}.k-hue-input{--range-track-back: linear-gradient( to right, hsl(0, 100%, 50%) 0%, hsl(60, 100%, 50%) 16.67%, hsl(120, 100%, 50%) 33.33%, hsl(180, 100%, 50%) 50%, hsl(240, 100%, 50%) 66.67%, hsl(320, 100%, 50%) 83.33%, hsl(360, 100%, 50%) 100% ) no-repeat;--range-track-height: var(--range-thumb-size)}.k-timeoptions-input{--button-height: var(--height-sm);display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-3)}.k-timeoptions-input h3{display:flex;align-items:center;padding-inline:var(--button-padding);height:var(--button-height);margin-bottom:var(--spacing-1)}.k-timeoptions-input hr{margin:var(--spacing-2) var(--spacing-3)}.k-timeoptions-input .k-button[aria-selected=time]{--button-color-text: var(--color-text);--button-color-back: var(--color-blue-500)}.k-layout-selector h3{margin-top:-.5rem;margin-bottom:var(--spacing-3)}.k-layout-selector-options{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--spacing-6)}@media screen and (min-width: 65em){.k-layout-selector-options{grid-template-columns:repeat(var(--columns),1fr)}}.k-layout-selector-option{--color-border: hsla(var(--color-gray-hs), 0%, 6%);--color-back: var(--color-white);border-radius:var(--rounded)}.k-layout-selector-option:focus-visible{outline:var(--outline);outline-offset:-1px}.k-layout-selector-option .k-grid{border:1px solid var(--color-border);gap:1px;grid-template-columns:repeat(var(--columns),1fr);cursor:pointer;background:var(--color-border);border-radius:var(--rounded);overflow:hidden;box-shadow:var(--shadow);height:5rem}.k-layout-selector-option .k-column{grid-column:span var(--span);background:var(--color-back);height:100%}.k-layout-selector-option:hover{--color-border: var(--color-gray-500);--color-back: var(--color-gray-100)}.k-layout-selector-option[aria-current]{--color-border: var(--color-focus);--color-back: var(--color-blue-300)}.k-bubbles{display:flex;gap:.25rem}.k-bubbles-field-preview{--bubble-back: var(--color-light);--bubble-text: var(--color-black);padding:.375rem var(--table-cell-padding);overflow:hidden}.k-bubbles-field-preview .k-bubbles{gap:.375rem}.k-color-field-preview{--color-frame-rounded: var(--tag-rounded);--color-frame-size: var(--tag-height);padding:.375rem var(--table-cell-padding);display:flex;align-items:center;gap:var(--spacing-2)}.k-text-field-preview{padding:.325rem .75rem;overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.k-url-field-preview{padding-inline:var(--table-cell-padding)}.k-url-field-preview[data-link]{color:var(--link-color)}.k-url-field-preview a{display:inline-flex;align-items:center;height:var(--height-xs);padding-inline:var(--spacing-1);margin-inline:calc(var(--spacing-1) * -1);border-radius:var(--rounded);max-width:100%;min-width:0}.k-url-field-preview a>*{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-decoration:underline;text-underline-offset:var(--link-underline-offset)}.k-url-field-preview a:hover{color:var(--color-black)}.k-flag-field-preview{--button-height: var(--table-row-height);--button-width: 100%;outline-offset:-2px}.k-html-field-preview{padding:.375rem var(--table-cell-padding);overflow:hidden;text-overflow:ellipsis}.k-image-field-preview{height:100%}.k-link-field-preview{--tag-height: var(--height-xs);--tag-color-back: var(--color-gray-200);--tag-color-text: var(--color-black);--tag-color-toggle: var(--tag-color-text);--tag-color-toggle-border: var(--color-gray-300);--tag-color-focus-back: var(--tag-color-back);--tag-color-focus-text: var(--tag-color-text);padding-inline:var(--table-cell-padding);min-width:0}.k-link-field-preview .k-tag{min-width:0;max-width:100%}.k-link-field-preview .k-tag-text{font-size:var(--text-xs);min-width:0}.k-toggle-field-preview{padding-inline:var(--table-cell-padding)}:root{--toolbar-size: var(--height);--toolbar-text: var(--color-black);--toolbar-back: var(--color-white);--toolbar-hover: rgba(239, 239, 239, .5);--toolbar-border: rgba(0, 0, 0, .1);--toolbar-current: var(--color-focus)}.k-toolbar{display:flex;max-width:100%;height:var(--toolbar-size);align-items:center;overflow-x:auto;overflow-y:hidden;color:var(--toolbar-text);background:var(--toolbar-back);border-radius:var(--rounded)}.k-toolbar[data-theme=dark]{--toolbar-text: var(--color-white);--toolbar-back: var(--color-black);--toolbar-hover: rgba(255, 255, 255, .2);--toolbar-border: var(--color-gray-800)}.k-toolbar>hr{height:var(--toolbar-size);width:1px;border-left:1px solid var(--toolbar-border)}.k-toolbar-button.k-button{--button-width: var(--toolbar-size);--button-height: var(--toolbar-size);--button-rounded: 0;outline-offset:-2px}.k-toolbar-button:hover{--button-color-back: var(--toolbar-hover)}.k-toolbar .k-button[aria-current]{--button-color-text: var(--toolbar-current)}.k-toolbar>.k-button:first-child{border-start-start-radius:var(--rounded);border-end-start-radius:var(--rounded)}.k-toolbar>.k-button:last-child{border-start-end-radius:var(--rounded);border-end-end-radius:var(--rounded)}:where(.k-textarea-input,.k-writer-input):not(:focus-within){--toolbar-text: var(--color-gray-400);--toolbar-border: var(--color-background)}:where(.k-textarea-input,.k-writer-input):focus-within .k-toolbar:not([data-inline=true]){position:sticky;top:var(--header-sticky-offset);inset-inline:0;z-index:1;box-shadow:#0000000d 0 2px 5px}.k-writer:not([data-toolbar-inline=true]):not([data-disabled=true]){grid-template-areas:"topbar" "content";grid-template-rows:var(--toolbar-size) 1fr;gap:0}.k-writer:not(:focus-within){--toolbar-current: currentColor}.k-writer-toolbar[data-inline=true]{position:absolute;z-index:calc(var(--z-dropdown) + 1);max-width:none;box-shadow:var(--shadow-toolbar)}.k-writer-toolbar:not([data-inline=true]){border-end-start-radius:0;border-end-end-radius:0;border-bottom:1px solid var(--toolbar-border)}.k-writer-toolbar:not([data-inline=true])>.k-button:first-child{border-end-start-radius:0}.k-writer-toolbar:not([data-inline=true])>.k-button:last-child{border-end-end-radius:0}.k-aspect-ratio{position:relative;display:block;overflow:hidden;padding-bottom:100%}.k-aspect-ratio>*{position:absolute!important;top:0;right:0;bottom:0;left:0;height:100%;width:100%;object-fit:contain}.k-aspect-ratio[data-cover=true]>*{object-fit:cover}:root{--bar-height: var(--height-xs)}.k-bar{display:flex;align-items:center;gap:var(--spacing-3);height:var(--bar-height);justify-content:space-between}.k-bar:where([data-align=center]){justify-content:center}.k-bar:where([data-align=end]):has(:first-child:last-child){justify-content:end}.k-bar-slot{flex-grow:1}.k-bar-slot[data-position=center]{text-align:center}.k-bar-slot[data-position=right]{text-align:end}:root{--box-height: var( --field-input-height );--box-padding-inline: var(--spacing-2);--box-font-size: var(--text-sm);--box-color-back: none;--box-color-text: currentColor}.k-box{--icon-color: var(--box-color-icon);--text-font-size: var(--box-font-size);display:flex;width:100%;align-items:center;gap:var(--spacing-2);color:var(--box-color-text);background:var(--box-color-back);word-wrap:break-word}.k-box[data-theme]{--box-color-back: var(--theme-color-back);--box-color-text: var(--theme-color-text);--box-color-icon: var(--theme-color-700);min-height:var(--box-height);line-height:1.25;padding:.375rem var(--box-padding-inline);border-radius:var(--rounded)}.k-box[data-theme=text],.k-box[data-theme=white]{box-shadow:var(--shadow)}.k-box[data-theme=text]{padding:var(--spacing-6)}.k-box[data-theme=none]{padding:0}.k-box[data-align=center]{justify-content:center}:root{--bubble-size: 1.525rem;--bubble-back: var(--color-light);--bubble-rounded: var(--rounded-sm);--bubble-text: var(--color-black)}.k-bubble{width:min-content;height:var(--bubble-size);white-space:nowrap;line-height:1.5;background:var(--bubble-back);color:var(--bubble-text);border-radius:var(--bubble-rounded);overflow:hidden}.k-bubble .k-frame{width:var(--bubble-size);height:var(--bubble-size)}.k-bubble[data-has-text=true]{display:flex;gap:var(--spacing-2);align-items:center;padding-inline-end:.5rem;font-size:var(--text-xs)}.k-column{min-width:0}.k-column[data-sticky=true]{align-self:stretch}.k-column[data-sticky=true]>div{position:sticky;top:calc(var(--header-sticky-offset) + 2vh);z-index:2}.k-column[data-disabled=true]{cursor:not-allowed;opacity:.4}.k-column[data-disabled=true] *{pointer-events:none}.k-column[data-disabled=true] .k-text[data-theme=help] *{pointer-events:initial}.k-frame{--fit: contain;--ratio: 1/1;position:relative;display:flex;justify-content:center;align-items:center;aspect-ratio:var(--ratio);background:var(--back);overflow:hidden}.k-frame:where([data-theme]){--back: var(--theme-color-back);color:var(--theme-color-text)}.k-frame *:where(img,video,iframe,button){position:absolute;top:0;right:0;bottom:0;left:0;height:100%;width:100%;object-fit:var(--fit)}.k-frame>*{overflow:hidden;text-overflow:ellipsis;min-width:0;min-height:0}:root{--color-frame-back: none;--color-frame-rounded: var(--rounded);--color-frame-size: 100%;--color-frame-darkness: 0%}.k-color-frame.k-frame{background:var(--pattern-light);width:var(--color-frame-size);color:transparent;border-radius:var(--color-frame-rounded);overflow:hidden;background-clip:padding-box}.k-color-frame:after{border-radius:var(--color-frame-rounded);box-shadow:0 0 0 1px inset hsla(0,0%,var(--color-frame-darkness),.175);position:absolute;top:0;right:0;bottom:0;left:0;background:var(--color-frame-back);content:""}.k-dropzone{position:relative}.k-dropzone:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;display:none;pointer-events:none;z-index:1;border-radius:var(--rounded)}.k-dropzone[data-over=true]:after{display:block;background:hsla(var(--color-blue-hs),var(--color-blue-l-300),.6);outline:var(--outline)}.k-grid{--columns: 12;--grid-inline-gap: 0;--grid-block-gap: 0;display:grid;align-items:start;grid-column-gap:var(--grid-inline-gap);grid-row-gap:var(--grid-block-gap)}.k-grid>*{--width: calc(1 / var(--columns));--span: calc(var(--columns) * var(--width))}@container (min-width: 30rem){.k-grid{grid-template-columns:repeat(var(--columns),1fr)}.k-grid>*{grid-column:span var(--span)}.k-grid[data-gutter=small]{--grid-inline-gap: 1rem;--grid-block-gap: 1rem}.k-grid:where([data-gutter=medium],[data-gutter=large],[data-gutter=huge]){--grid-inline-gap: 1.5rem;--grid-block-gap: 1.5rem}}@container (min-width: 65em){.k-grid[data-gutter=large]{--grid-inline-gap: 3rem}.k-grid[data-gutter=huge]{--grid-inline-gap: 4.5rem}}@container (min-width: 90em){.k-grid[data-gutter=large]{--grid-inline-gap: 4.5rem}.k-grid[data-gutter=huge]{--grid-inline-gap: 6rem}}@container (min-width: 120em){.k-grid[data-gutter=large]{--grid-inline-gap: 6rem}.k-grid[data-gutter=huge]{--grid-inline-gap: 7.5rem}}:root{--columns-inline-gap: clamp(.75rem, 6cqw, 6rem);--columns-block-gap: var(--spacing-8)}.k-grid[data-variant=columns]{--grid-inline-gap: var(--columns-inline-gap);--grid-block-gap: var(--columns-block-gap)}.k-grid:where([data-variant=columns],[data-variant=fields])>*{container:column / inline-size}.k-grid[data-variant=fields]{gap:var(--spacing-8)}.k-grid[data-variant=choices]{align-items:stretch;gap:2px}:root{--header-color-back: var(--color-light);--header-padding-block: var(--spacing-4);--header-sticky-offset: var(--scroll-top)}.k-header{position:relative;display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;border-bottom:1px solid var(--color-border);background:var(--header-color-back);padding-top:var(--header-padding-block);margin-bottom:var(--spacing-12);box-shadow:2px 0 0 0 var(--header-color-back),-2px 0 0 0 var(--header-color-back)}.k-header-title{font-size:var(--text-h1);font-weight:var(--font-h1);line-height:var(--leading-h1);margin-bottom:var(--header-padding-block);min-width:0}.k-header-title-button{display:inline-flex;text-align:start;gap:var(--spacing-2);align-items:baseline;max-width:100%;outline:0}.k-header-title-text{overflow-x:clip;text-overflow:ellipsis}.k-header-title-icon{--icon-color: var(--color-text-dimmed);border-radius:var(--rounded);transition:opacity .2s;display:grid;flex-shrink:0;place-items:center;height:var(--height-sm);width:var(--height-sm);opacity:0}.k-header-title-button:is(:hover,:focus) .k-header-title-icon{opacity:1}.k-header-title-button:is(:focus) .k-header-title-icon{outline:var(--outline)}.k-header-buttons{display:flex;flex-shrink:0;gap:var(--spacing-2);margin-bottom:var(--header-padding-block)}.k-header[data-has-buttons=true]{position:sticky;top:var(--scroll-top);z-index:var(--z-toolbar)}:root:has(.k-header[data-has-buttons=true]){--header-sticky-offset: calc(var(--scroll-top) + 4rem)}:root{--icon-size: 18px;--icon-color: currentColor}.k-icon{width:var(--icon-size);height:var(--icon-size);flex-shrink:0;color:var(--icon-color)}.k-icon[data-type=loader]{animation:Spin 1.5s linear infinite}@media only screen and (-webkit-min-device-pixel-ratio: 2),not all,not all,not all,only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx){.k-button-icon [data-type=emoji]{font-size:1.25em}}.k-icon-frame [data-type=emoji]{overflow:visible}.k-image[data-back=pattern]{--back: var(--color-black) var(--pattern)}.k-image[data-back=black]{--back: var(--color-black)}.k-image[data-back=white]{--back: var(--color-white);color:var(--color-gray-900)}:root{--overlay-color-back: var(--color-backdrop)}.k-overlay[open]{position:fixed;overscroll-behavior:contain;top:0;right:0;bottom:0;left:0;width:100%;height:100vh;height:100dvh;background:none;z-index:var(--z-dialog);transform:translateZ(0);overflow:hidden}.k-overlay[open]::backdrop{background:none}.k-overlay[open]>.k-portal{position:fixed;top:0;right:0;bottom:0;left:0;background:var(--overlay-color-back);overflow:auto}.k-overlay[open][data-type=dialog]>.k-portal{display:inline-flex}.k-overlay[open][data-type=dialog]>.k-portal>*{margin:auto}.k-overlay[open][data-type=drawer]>.k-portal{--overlay-color-back: rgba(0, 0, 0, .2);display:flex;align-items:stretch;justify-content:flex-end}html[data-overlay]{overflow:hidden}html[data-overlay] body{overflow:scroll}:root{--stat-value-text-size: var(--text-2xl);--stat-info-text-color: var(--color-text-dimmed)}.k-stat{display:flex;flex-direction:column;padding:var(--spacing-3) var(--spacing-6);background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);line-height:var(--leading-normal)}.k-stat.k-link:hover{cursor:pointer;background:var(--color-gray-100)}.k-stat :where(dt,dd){display:block}.k-stat-value{order:1;font-size:var(--stat-value-text-size);margin-bottom:var(--spacing-1)}.k-stat-label{--icon-size: var(--text-sm);order:2;display:flex;justify-content:start;align-items:center;gap:var(--spacing-1);font-size:var(--text-xs)}.k-stat-info{order:3;font-size:var(--text-xs);color:var(--stat-info-text-color)}.k-stat:is([data-theme]) .k-stat-info{--stat-info-text-color: var(--theme-color-700)}.k-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(14rem,1fr));grid-auto-rows:1fr;grid-gap:var(--spacing-2px)}.k-stats[data-size=small]{--stat-value-text-size: var(--text-md)}.k-stats[data-size=medium]{--stat-value-text-size: var(--text-xl)}.k-stats[data-size=large]{--stat-value-text-size: var(--text-2xl)}.k-stats[data-size=huge]{--stat-value-text-size: var(--text-3xl)}:root{--table-cell-padding: var(--spacing-3);--table-color-back: var(--color-white);--table-color-border: var(--color-background);--table-color-hover: var(--color-gray-100);--table-color-th-back: var(--color-gray-100);--table-color-th-text: var(--color-text-dimmed);--table-row-height: var(--input-height)}.k-table{position:relative;background:var(--table-color-back);box-shadow:var(--shadow);border-radius:var(--rounded)}.k-table table{table-layout:fixed}.k-table th,.k-table td{padding-inline:var(--table-cell-padding);height:var(--table-row-height);overflow:hidden;text-overflow:ellipsis;width:100%;border-inline-end:1px solid var(--table-color-border);line-height:1.25}.k-table tr>*:last-child{border-inline-end:0}.k-table th,.k-table tr:not(:last-child) td{border-block-end:1px solid var(--table-color-border)}.k-table :where(td,th)[data-align]{text-align:var(--align)}.k-table th{padding-inline:var(--table-cell-padding);font-family:var(--font-mono);font-size:var(--text-xs);color:var(--table-color-th-text);background:var(--table-color-th-back)}.k-table th[data-has-button]{padding:0}.k-table th button{padding-inline:var(--table-cell-padding);height:100%;width:100%;border-radius:var(--rounded);text-align:start}.k-table th button:focus-visible{outline-offset:-2px}.k-table thead th:first-child{border-start-start-radius:var(--rounded)}.k-table thead th:last-child{border-start-end-radius:var(--rounded)}.k-table thead th{position:sticky;top:var(--header-sticky-offset);inset-inline:0;z-index:1}.k-table tbody tr:hover td{background:var(--table-color-hover)}.k-table tbody th{width:auto;white-space:nowrap;overflow:visible;border-radius:0}.k-table tbody tr:first-child th{border-start-start-radius:var(--rounded)}.k-table tbody tr:last-child th{border-end-start-radius:var(--rounded);border-block-end:0}.k-table-row-ghost{background:var(--color-white);outline:var(--outline);border-radius:var(--rounded);margin-bottom:2px;cursor:grabbing}.k-table-row-fallback{opacity:0!important}.k-table .k-table-index-column{width:var(--table-row-height);text-align:center}.k-table .k-table-index{font-size:var(--text-xs);color:var(--color-text-dimmed);line-height:1.1em}.k-table .k-table-index-column .k-sort-handle{--button-width: 100%;display:none}.k-table tr.k-table-sortable-row:hover .k-table-index-column .k-table-index{display:none}.k-table tr.k-table-sortable-row:hover .k-table-index-column .k-sort-handle{display:flex}.k-table .k-table-options-column{padding:0;width:var(--table-row-height);text-align:center}.k-table .k-table-options-column .k-options-dropdown-toggle{--button-width: 100%;--button-height: 100%;outline-offset:-2px}.k-table-empty{color:var(--color-text-dimmed);font-size:var(--text-sm)}.k-table[aria-disabled=true]{--table-color-back: transparent;--table-color-border: var(--color-border);--table-color-hover: transparent;--table-color-th-back: transparent;border:1px solid var(--table-color-border);box-shadow:none}.k-table[aria-disabled=true] thead th{position:static}@container (max-width: 40rem){.k-table{overflow-x:auto}.k-table thead th{position:static}.k-table .k-options-dropdown-toggle{aspect-ratio:auto!important}.k-table :where(th,td):not(.k-table-index-column,.k-table-options-column,[data-column-id=image],[data-column-id=flag]){width:auto!important}.k-table :where(th,td):not([data-mobile=true]){display:none}}.k-table-pagination{border-top:1px solid var(--table-color-border);height:var(--table-row-height);background:var(--table-color-th-back);display:flex;justify-content:center;border-end-start-radius:var(--rounded);border-end-end-radius:var(--rounded)}.k-table-pagination>.k-button{--button-color-back: transparent;border-left:0!important}.k-table .k-table-cell{padding:0}.k-tabs{--button-height: var(--height-md);--button-padding: var(--spacing-2);display:flex;gap:var(--spacing-1);margin-bottom:var(--spacing-12);margin-inline:calc(var(--button-padding) * -1)}.k-tabs-tab{position:relative}.k-tab-button.k-button{margin-block:2px;overflow-x:visible}.k-tab-button[aria-current]:after{position:absolute;content:"";height:2px;inset-inline:var(--button-padding);bottom:-2px;background:currentColor}.k-tabs-badge{position:absolute;top:2px;font-variant-numeric:tabular-nums;inset-inline-end:var(--button-padding);transform:translate(75%);line-height:1.5;padding:0 var(--spacing-1);border-radius:1rem;text-align:center;font-size:10px;box-shadow:var(--shadow-md);background:var(--theme-color-back);border:1px solid var(--theme-color-500);color:var(--theme-color-text);z-index:1}.k-view{padding-inline:1.5rem}@container (min-width: 30rem){.k-view{padding-inline:3rem}}.k-view[data-align=center]{height:100vh;display:flex;align-items:center;justify-content:center;padding:0 3rem;overflow:auto}.k-view[data-align=center]>*{flex-basis:22.5rem}.k-fatal[open]{background:var(--overlay-color-back);padding:var(--spacing-6)}.k-fatal-box{position:relative;width:100%;box-shadow:var(--dialog-shadow);border-radius:var(--dialog-rounded);line-height:1;height:calc(100vh - 3rem);height:calc(100dvh - 3rem);display:flex;flex-direction:column;overflow:hidden}.k-fatal-iframe{border:0;width:100%;flex-grow:1;background:var(--color-white);padding:var(--spacing-3)}.k-icons{position:absolute;width:0;height:0}.k-loader{z-index:1}.k-loader-icon{animation:Spin .9s linear infinite}.k-notification{padding:.75rem 1.5rem;background:var(--color-gray-900);width:100%;line-height:1.25rem;color:var(--color-white);display:flex;flex-shrink:0;align-items:center}.k-notification[data-theme]{background:var(--theme-color-back);color:var(--color-black)}.k-notification p{flex-grow:1;word-wrap:break-word;overflow:hidden}.k-notification .k-button{display:flex;margin-inline-start:1rem}.k-offline-warning{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--z-offline);background:var(--color-backdrop);display:flex;align-items:center;justify-content:center;line-height:1}.k-offline-warning p{display:flex;align-items:center;gap:.5rem;background:var(--color-white);box-shadow:var(--shadow);padding:.75rem;border-radius:var(--rounded)}.k-offline-warning p .k-icon{color:var(--color-red-400)}:root{--progress-height: var(--spacing-2);--progress-color-back: var(--color-gray-300);--progress-color-value: var(--color-focus)}progress{display:block;width:100%;height:var(--progress-height);border-radius:var(--progress-height);overflow:hidden;border:0}progress::-webkit-progress-bar{background:var(--progress-color-back)}progress::-webkit-progress-value{background:var(--progress-color-value);border-radius:var(--progress-height)}progress::-moz-progress-bar{background:var(--progress-color-value)}progress:not([value])::-webkit-progress-bar{background:var(--progress-color-value)}progress:not([value])::-moz-progress-bar{background:var(--progress-color-value)}.k-sort-handle{cursor:grab;z-index:1}.k-sort-handle:active{cursor:grabbing}.k-breadcrumb{--breadcrumb-divider: "/";overflow-x:clip;padding:2px}.k-breadcrumb ol{display:none;gap:.125rem;align-items:center}.k-breadcrumb ol li{display:flex;align-items:center;min-width:0;transition:flex-shrink .1s}.k-breadcrumb ol li:has(.k-icon){min-width:2.25rem}.k-breadcrumb ol li:not(:last-child):after{content:var(--breadcrumb-divider);opacity:.175;flex-shrink:0}.k-breadcrumb .k-icon[data-type=loader]{opacity:.5}.k-breadcrumb ol li:is(:hover,:focus-within){flex-shrink:0}.k-button.k-breadcrumb-link{flex-shrink:1;min-width:0;justify-content:flex-start}.k-breadcrumb-dropdown{display:grid}.k-breadcrumb-dropdown .k-dropdown-content{width:15rem}@container (min-width: 40em){.k-breadcrumb ol{display:flex}.k-breadcrumb-dropdown{display:none}}.k-browser{container-type:inline-size;font-size:var(--text-sm)}.k-browser-items{--browser-item-gap: 1px;--browser-item-size: 1fr;--browser-item-height: var(--height-sm);--browser-item-padding: .25rem;--browser-item-rounded: var(--rounded);display:grid;column-gap:var(--browser-item-gap);row-gap:var(--browser-item-gap);grid-template-columns:repeat(auto-fill,minmax(var(--browser-item-size),1fr))}.k-browser-item{display:flex;overflow:hidden;gap:.5rem;align-items:center;flex-shrink:0;height:var(--browser-item-height);padding-inline:calc(var(--browser-item-padding) + 1px);border-radius:var(--browser-item-rounded);white-space:nowrap;cursor:pointer}.k-browser-item-image{height:calc(var(--browser-item-height) - var(--browser-item-padding) * 2);aspect-ratio:1/1;border-radius:var(--rounded-sm);box-shadow:var(--shadow);flex-shrink:0}.k-browser-item-image.k-icon-frame{box-shadow:none;background:var(--color-white)}.k-browser-item-image svg{transform:scale(.8)}.k-browser-item input{position:absolute;box-shadow:var(--shadow);opacity:0;width:0}.k-browser-item[aria-selected]{background:var(--color-blue-300)}:root{--button-align: center;--button-height: var(--height-md);--button-width: auto;--button-color-back: none;--button-color-text: currentColor;--button-color-icon: currentColor;--button-padding: var(--spacing-2);--button-rounded: var(--spacing-1);--button-text-display: block;--button-icon-display: block}.k-button{position:relative;display:inline-flex;align-items:center;justify-content:var(--button-align);gap:.5rem;padding-inline:var(--button-padding);white-space:nowrap;line-height:1;border-radius:var(--button-rounded);background:var(--button-color-back);height:var(--button-height);width:var(--button-width);color:var(--button-color-text);font-variant-numeric:tabular-nums;overflow-x:clip;text-align:var(--button-align);flex-shrink:0}.k-button-icon{--icon-color: var(--button-color-icon);flex-shrink:0;display:var(--button-icon-display)}.k-button-text{text-overflow:ellipsis;overflow-x:clip;display:var(--button-text-display);min-width:0}.k-button:where([data-theme]){--button-color-icon: var(--theme-color-icon);--button-color-text: var(--theme-color-text)}.k-button:where([data-theme$=-icon]){--button-color-text: currentColor}.k-button:where([data-variant=dimmed]){--button-color-icon: var(--color-text);--button-color-text: var(--color-text-dimmed)}.k-button:where([data-variant=dimmed]):not([aria-disabled]):is(:hover,[aria-current]) .k-button-text{filter:brightness(75%)}.k-button:where([data-variant=dimmed][data-theme]){--button-color-icon: var(--theme-color-icon);--button-color-text: var(--theme-color-text-dimmed)}.k-button:where([data-variant=dimmed][data-theme$=-icon]){--button-color-text: var(--color-text-dimmed)}.k-button:where([data-variant=filled]){--button-color-back: var(--color-gray-300)}.k-button:where([data-variant=filled]):not([aria-disabled]):hover{filter:brightness(97%)}.k-button:where([data-variant=filled][data-theme]){--button-color-icon: var(--theme-color-700);--button-color-back: var(--theme-color-back)}.k-button:where([data-theme$=-icon][data-variant=filled]){--button-color-icon: hsl( var(--theme-color-hs), 57% );--button-color-back: var(--color-gray-300)}.k-button:not([data-has-text=true]){--button-padding: 0;aspect-ratio:1/1}@container (max-width: 30rem){.k-button[data-responsive=true][data-has-icon=true]{--button-padding: 0;aspect-ratio:1/1;--button-text-display: none}.k-button[data-responsive=text][data-has-text=true]{--button-icon-display: none}.k-button[data-responsive][data-has-icon=true] .k-button-arrow{display:none}}.k-button:not(button,a,summary,label,.k-link){pointer-events:none}.k-button:where([data-size=xs]){--button-height: var(--height-xs);--button-padding: .325rem}.k-button:where([data-size=sm]){--button-height: var(--height-sm);--button-padding: .5rem}.k-button:where([data-size=lg]){--button-height: var(--height-lg)}.k-button-arrow{width:max-content;margin-inline-start:-.25rem;margin-inline-end:-.125rem}.k-button:where([aria-disabled]){cursor:not-allowed}.k-button:where([aria-disabled])>*{opacity:var(--opacity-disabled)}.k-button-group{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}.k-button-group:where([data-layout=collapsed]){gap:0;flex-wrap:nowrap}.k-button-group[data-layout=collapsed]>.k-button[data-variant=filled]:not(:last-child){border-start-end-radius:0;border-end-end-radius:0}.k-button-group[data-layout=collapsed]>.k-button[data-variant=filled]:not(:first-child){border-start-start-radius:0;border-end-start-radius:0;border-left:1px solid var(--theme-color-500, var(--color-gray-400))}.k-button-group[data-layout=collapsed]>.k-button[data-variant=filled]:focus-visible{z-index:1;border-radius:var(--button-rounded)}.k-file-browser{container-type:inline-size;overflow:hidden}.k-file-browser-layout{display:grid;grid-template-columns:minmax(10rem,15rem) 1fr;grid-template-rows:1fr auto;grid-template-areas:"tree items" "tree pagination"}.k-file-browser-tree{grid-area:tree;padding:var(--spacing-2);border-right:1px solid var(--color-gray-300)}.k-file-browser-items{grid-area:items;padding:var(--spacing-2);background:var(--color-gray-100)}.k-file-browser-back-button{display:none}.k-file-browser-pagination{background:var(--color-gray-100);padding:var(--spacing-2);display:flex;justify-content:end}@container (max-width: 30rem){.k-file-browser-layout{grid-template-columns:minmax(0,1fr);min-height:10rem}.k-file-browser-back-button{width:100%;height:var(--height-sm);display:flex;align-items:center;justify-content:flex-start;padding-inline:.25rem;margin-bottom:.5rem;background:var(--color-gray-200);border-radius:var(--rounded)}.k-file-browser-tree{border-right:0}.k-file-browser-pagination{justify-content:start}.k-file-browser[data-view=files] .k-file-browser-layout{grid-template-rows:1fr auto;grid-template-areas:"items" "pagination"}.k-file-browser[data-view=files] .k-file-browser-tree,.k-file-browser[data-view=tree] .k-file-browser-items,.k-file-browser[data-view=tree] .k-file-browser-pagination{display:none}}:root{--tree-color-back: var(--color-gray-200);--tree-color-hover-back: var(--color-gray-300);--tree-color-selected-back: var(--color-blue-300);--tree-color-selected-text: var(--color-black);--tree-color-text: var(--color-gray-dimmed);--tree-level: 0;--tree-indentation: .6rem}.k-tree-branch{display:flex;align-items:center;padding-inline-start:calc(var(--tree-level) * var(--tree-indentation));margin-bottom:1px}.k-tree-branch[data-has-subtree=true]{inset-block-start:calc(var(--tree-level) * 1.5rem);z-index:calc(100 - var(--tree-level));background:var(--tree-color-back)}.k-tree-branch:hover,li[aria-current]>.k-tree-branch{--tree-color-text: var(--tree-color-selected-text);background:var(--tree-color-hover-back);border-radius:var(--rounded)}li[aria-current]>.k-tree-branch{background:var(--tree-color-selected-back)}.k-tree-toggle{--icon-size: 12px;width:1rem;aspect-ratio:1/1;display:grid;place-items:center;padding:0;border-radius:var(--rounded-sm);margin-inline-start:.25rem;flex-shrink:0}.k-tree-toggle:hover{background:#00000013}.k-tree-toggle[disabled]{visibility:hidden}.k-tree-folder{display:flex;height:var(--height-sm);border-radius:var(--rounded-sm);padding-inline:.25rem;width:100%;align-items:center;gap:.325rem;min-width:3rem;line-height:1.25;font-size:var(--text-sm)}@container (max-width: 15rem){.k-tree{--tree-indentation: .375rem}.k-tree-folder{padding-inline:.125rem}.k-tree-folder .k-icon{display:none}}.k-tree-folder>.k-frame{flex-shrink:0}.k-tree-folder-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:currentColor}.k-tree-folder[disabled]{opacity:var(--opacity-disabled)}.k-pagination{flex-shrink:0}.k-pagination-details{--button-padding: var(--spacing-3);font-size:var(--text-xs)}.k-pagination-selector{--button-height: var(--height);--dropdown-padding: 0;overflow:visible}.k-pagination-selector form{display:flex;align-items:center;justify-content:space-between}.k-pagination-selector label{display:flex;align-items:center;gap:var(--spacing-2);padding-inline-start:var(--spacing-3)}.k-pagination-selector select{--height: calc(var(--button-height) - .5rem);width:auto;min-width:var(--height);height:var(--height);text-align:center;background:var(--color-gray-800);color:var(--color-white);border-radius:var(--rounded-sm)}.k-prev-next{direction:ltr;flex-shrink:0}.k-search-bar-input{--button-height: var(--input-height);display:flex;align-items:center}.k-search-bar-types{flex-shrink:0;border-inline-end:1px solid var(--color-border)}.k-search-bar-input input{flex-grow:1;padding-inline:.75rem;height:var(--input-height);line-height:var(--input-height);border-radius:var(--rounded);font-size:var(--input-font-size)}.k-search-bar-input input:focus{outline:0}.k-search-bar-input .k-search-bar-close{flex-shrink:0}.k-search-bar-results{border-top:1px solid var(--color-border);padding:1rem}.k-search-bar-results .k-item[data-selected=true]{outline:var(--outline)}.k-search-bar-footer{text-align:center}.k-search-bar-footer p{color:var(--color-text-dimmed)}.k-search-bar-footer .k-button{margin-top:var(--spacing-4)}:root{--tag-color-back: var(--color-black);--tag-color-text: var(--color-white);--tag-color-toggle: currentColor;--tag-color-disabled-back: var(--color-gray-600);--tag-color-disabled-text: var(--tag-color-text);--tag-height: var(--height-xs);--tag-rounded: var(--rounded-sm)}.k-tag{position:relative;height:var(--tag-height);display:flex;align-items:center;justify-content:space-between;font-size:var(--text-sm);line-height:1;color:var(--tag-color-text);background-color:var(--tag-color-back);border-radius:var(--tag-rounded);cursor:pointer;-webkit-user-select:none;user-select:none}.k-tag:not([aria-disabled]):focus{outline:var(--outline)}.k-tag-image{height:100%;border-radius:var(--rounded-xs);overflow:hidden;flex-shrink:0;border-radius:0;border-start-start-radius:var(--tag-rounded);border-end-start-radius:var(--tag-rounded);background-clip:padding-box}.k-tag-text{padding-inline:var(--spacing-2);line-height:var(--leading-tight);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.k-tag[data-has-toggle=true] .k-tag-text{padding-inline-end:0}.k-tag-toggle{--icon-size: 14px;width:var(--tag-height);height:var(--tag-height);filter:brightness(70%);flex-shrink:0}.k-tag-toggle:hover{filter:brightness(100%)}.k-tag:where([aria-disabled]){background-color:var(--tag-color-disabled-back);color:var(--tag-color-disabled-text);cursor:not-allowed}.k-button[data-disabled=true]{opacity:.5;pointer-events:none;cursor:default}.k-card-options>.k-button[data-disabled=true]{display:inline-flex}.k-section+.k-section{margin-top:var(--columns-block-gap)}.k-section-header{display:flex;justify-content:space-between;align-items:center;gap:var(--spacing-6);margin-bottom:var(--spacing-2)}.k-section-buttons{flex-shrink:0}.k-fields-section input[type=submit]{display:none}[data-locked=true] .k-fields-section{opacity:.2;pointer-events:none}.k-models-section[data-processing=true]{pointer-events:none}.k-models-section-search.k-input{--input-color-back: var(--color-gray-300);--input-color-border: transparent;margin-bottom:var(--spacing-3)}:root{--code-color-back: var(--color-black);--code-color-icon: var(--color-gray-500);--code-color-text: var(--color-gray-200, white);--code-font-family: var(--font-mono);--code-font-size: 1em;--code-inline-color-back: var(--color-blue-300);--code-inline-color-border: var(--color-blue-400);--code-inline-color-text: var(--color-blue-900);--code-inline-font-size: .9em;--code-padding: var(--spacing-3)}code{font-family:var(--code-font-family);font-size:var(--code-font-size);font-weight:var(--font-normal)}.k-code,.k-text pre{position:relative;display:block;max-width:100%;padding:var(--code-padding);border-radius:var(--rounded, .5rem);background:var(--code-color-back);color:var(--code-color-text);white-space:nowrap;overflow-y:hidden;overflow-x:auto;line-height:1.5;-moz-tab-size:2;tab-size:2}.k-code:not(code),.k-text pre{white-space:pre-wrap}.k-code:before{position:absolute;content:attr(data-language);inset-block-start:0;inset-inline-end:0;padding:.5rem .5rem .25rem .25rem;font-size:calc(.75 * var(--text-xs));background:var(--code-color-back);border-radius:var(--rounded, .5rem)}.k-text>code,.k-text *:not(pre)>code{display:inline-flex;padding-inline:var(--spacing-1);font-size:var(--code-inline-font-size);color:var(--code-inline-color-text);background:var(--code-inline-color-back);border-radius:var(--rounded);outline:1px solid var(--code-inline-color-border);outline-offset:-1px}:root{--text-h1: 2em;--text-h2: 1.75em;--text-h3: 1.5em;--text-h4: 1.25em;--text-h5: 1.125em;--text-h6: 1em;--font-h1: var(--font-semi);--font-h2: var(--font-semi);--font-h3: var(--font-semi);--font-h4: var(--font-semi);--font-h5: var(--font-semi);--font-h6: var(--font-semi);--leading-h1: 1.125;--leading-h2: 1.125;--leading-h3: 1.25;--leading-h4: 1.375;--leading-h5: 1.5;--leading-h6: 1.5}.k-headline{line-height:1.5em;font-weight:var(--font-bold)}.h1,.k-text h1,.k-headline[data-size=huge]{color:var(--color-h1, var(--color-h));font-family:var(--font-family-h1);font-size:var(--text-h1);font-weight:var(--font-h1);line-height:var(--leading-h1)}.h2,.k-text h2,.k-headline[data-size=large]{color:var(--color-h2, var(--color-h));font-family:var(--font-family-h2);font-size:var(--text-h2);font-weight:var(--font-h2);line-height:var(--leading-h2)}.h3,.k-text h3{color:var(--color-h3, var(--color-h));font-family:var(--font-family-h3);font-size:var(--text-h3);font-weight:var(--font-h3);line-height:var(--leading-h3)}.h4,.k-text h4,.k-headline[data-size=small]{color:var(--color-h4, var(--color-h));font-family:var(--font-family-h4);font-size:var(--text-h4);font-weight:var(--font-h4);line-height:var(--leading-h4)}.h5,.k-text h5{color:var(--color-h5, var(--color-h));font-family:var(--font-family-h5);font-size:var(--text-h5);font-weight:var(--font-h5);line-height:var(--leading-h5)}.h6,.k-text h6{color:var(--color-h6, var(--color-h));font-family:var(--font-family-h6);font-size:var(--text-h6);font-weight:var(--font-h6);line-height:var(--leading-h6)}.k-text>*+h6{margin-block-start:calc(var(--text-line-height) * 1.5em)}.k-headline[data-theme]{color:var(--theme)}.k-label{position:relative;display:flex;align-items:center;height:var(--height-xs);font-weight:var(--font-semi);min-width:0;flex:1}[aria-disabled] .k-label{opacity:var(--opacity-disabled);cursor:not-allowed}.k-label>a{display:inline-flex;height:var(--height-xs);align-items:center;padding-inline:var(--spacing-2);margin-inline-start:calc(-1 * var(--spacing-2));border-radius:var(--rounded);min-width:0}.k-label-text{text-overflow:ellipsis;white-space:nowrap;overflow-x:clip;min-width:0}.k-label abbr{font-size:var(--text-xs);color:var(--color-gray-500);margin-inline-start:var(--spacing-1)}.k-label abbr.k-label-invalid{display:none;color:var(--color-red-700)}:where(.k-field:has([data-invalid]),.k-section:has([data-invalid]))>header>.k-label abbr.k-label-invalid{display:inline-block}.k-field:has([data-invalid])>.k-field-header>.k-label abbr:has(+abbr.k-label-invalid){display:none}:root{--text-font-size: 1em;--text-line-height: 1.5;--link-color: var(--color-blue-800);--link-underline-offset: 2px}.k-text{font-size:var(--text-font-size);line-height:var(--text-line-height)}.k-text[data-size=tiny]{--text-font-size: var(--text-xs)}.k-text[data-size=small]{--text-font-size: var(--text-sm)}.k-text[data-size=medium]{--text-font-size: var(--text-md)}.k-text[data-size=large]{--text-font-size: var(--text-xl)}.k-text[data-align]{text-align:var(--align)}.k-text>:where(audio,blockquote,details,div,figure,h1,h2,h3,h4,h5,h6,hr,iframe,img,object,ol,p,picture,pre,table,ul)+*{margin-block-start:calc(var(--text-line-height) * 1em)}.k-text :where(.k-link,a){color:var(--link-color);text-decoration:underline;text-underline-offset:var(--link-underline-offset);border-radius:var(--rounded-xs);outline-offset:2px}.k-text ol,.k-text ul{padding-inline-start:1.75em}.k-text ol{list-style:numeric}.k-text ol>li{list-style:decimal}.k-text ul>li{list-style:disc}.k-text ul ul>li{list-style:circle}.k-text ul ul ul>li{list-style:square}.k-text blockquote{font-size:var(--text-lg);line-height:1.25;padding-inline-start:var(--spacing-4);border-inline-start:2px solid var(--color-black)}.k-text img{border-radius:var(--rounded)}.k-text iframe{width:100%;aspect-ratio:16/9;border-radius:var(--rounded)}.k-text hr{background:var(--color-border);height:1px}.k-help{color:var(--color-text-dimmed)}.k-upload-item-preview{--icon-size: 24px;grid-area:preview;display:flex;aspect-ratio:1/1;width:100%;height:100%;overflow:hidden;border-start-start-radius:var(--rounded);border-end-start-radius:var(--rounded)}.k-upload-item-preview:focus{border-radius:var(--rounded);outline:2px solid var(--color-focus);z-index:1}.k-upload-item{accent-color:var(--color-focus);display:grid;grid-template-areas:"preview input input" "preview body toggle";grid-template-columns:6rem 1fr auto;grid-template-rows:var(--input-height) 1fr;border-radius:var(--rounded);background:var(--color-white);box-shadow:var(--shadow);min-height:6rem}.k-upload-item-body{grid-area:body;display:flex;flex-direction:column;justify-content:space-between;padding:var(--spacing-2) var(--spacing-3);min-width:0}.k-upload-item-input.k-input{--input-color-border: transparent;--input-padding: var(--spacing-2) var(--spacing-3);--input-rounded: 0;grid-area:input;font-size:var(--text-sm);border-bottom:1px solid var(--color-light);border-start-end-radius:var(--rounded)}.k-upload-item-input.k-input:focus-within{outline:2px solid var(--color-focus);z-index:1;border-radius:var(--rounded)}.k-upload-item-input.k-input[data-disabled=true]{--input-color-back: var(--color-white)}.k-upload-item-input .k-input-after{color:var(--color-gray-600)}.k-upload-item-meta{font-size:var(--text-xs);color:var(--color-gray-600)}.k-upload-item-error{font-size:var(--text-xs);margin-top:.25rem;color:var(--color-red-700)}.k-upload-item-progress{--progress-height: .25rem;--progress-color-back: var(--color-light);margin-bottom:.3125rem}.k-upload-item-toggle{grid-area:toggle;align-self:end}.k-upload-item-toggle>*{padding:var(--spacing-3)}.k-upload-item[data-completed] .k-upload-item-progress{--progress-color-value: var(--color-green-400)}.k-upload-items{display:grid;gap:.25rem}.k-activation{position:relative;display:flex;color:var(--dropdown-color-text);background:var(--dropdown-color-bg);border-radius:var(--dropdown-rounded);box-shadow:var(--dropdown-shadow);justify-content:space-between}.k-activation p{padding-inline-start:var(--spacing-3);padding-inline-end:var(--spacing-2);padding-block:.425rem;line-height:1.25}.k-activation p strong{font-weight:var(--font-normal);margin-inline-end:var(--spacing-1)}.k-activation p :where(button,a){color:var(--color-pink-400);text-decoration:underline;text-decoration-color:currentColor;text-underline-offset:2px;border-radius:var(--rounded-sm)}.k-activation-toggle{--button-color-text: var(--color-gray-400);--button-rounded: 0;border-left:1px solid var(--dropdown-color-hr)}.k-activation-toggle:is(:hover,:focus){--button-color-text: var(--color-white)}.k-activation-toggle:focus{--button-rounded: var(--rounded)}:root{--main-padding-inline: clamp(var(--spacing-6), 5cqw, var(--spacing-24))}.k-panel-main{min-height:100vh;min-height:100dvh;padding:var(--spacing-3) var(--main-padding-inline) var(--spacing-24);container:main / inline-size;margin-inline-start:var(--main-start)}.k-panel-notification{--button-height: var(--height-md);--button-color-icon: var(--theme-color-900);--button-color-text: var(--theme-color-900);border:1px solid var(--theme-color-500);position:fixed;inset-block-end:var(--menu-padding);inset-inline-end:var(--menu-padding);box-shadow:var(--dropdown-shadow);z-index:var(--z-notification)}:root{--menu-button-height: var(--height);--menu-button-width: 100%;--menu-color-back: var(--color-gray-250);--menu-color-border: var(--color-gray-300);--menu-display: none;--menu-display-backdrop: block;--menu-padding: var(--spacing-3);--menu-shadow: var(--shadow-xl);--menu-toggle-height: var(--menu-button-height);--menu-toggle-width: 1rem;--menu-width-closed: calc( var(--menu-button-height) + 2 * var(--menu-padding) );--menu-width-open: 12rem;--menu-width: var(--menu-width-open)}.k-panel-menu{position:fixed;inset-inline-start:0;inset-block:0;z-index:var(--z-navigation);display:var(--menu-display);width:var(--menu-width);background-color:var(--menu-color-back);border-right:1px solid var(--menu-color-border);box-shadow:var(--menu-shadow)}.k-panel-menu-body{display:flex;flex-direction:column;gap:var(--spacing-4);padding:var(--menu-padding);overscroll-behavior:contain;overflow-x:hidden;overflow-y:auto;height:100%}.k-panel-menu-search{margin-bottom:var(--spacing-8)}.k-panel-menu-buttons{display:flex;flex-direction:column;width:100%}.k-panel-menu-buttons[data-second-last=true]{flex-grow:1}.k-panel-menu-buttons:last-child{justify-content:flex-end}.k-panel-menu-button{--button-align: flex-start;--button-height: var(--menu-button-height);--button-width: var(--menu-button-width);--button-padding: 7px;flex-shrink:0}.k-panel-menu-button[aria-current]{--button-color-back: var(--color-white);box-shadow:var(--shadow)}.k-panel-menu-button:focus{z-index:1}.k-panel[data-menu=true]{--menu-button-width: 100%;--menu-display: block;--menu-width: var(--menu-width-open)}.k-panel[data-menu=true]:after{content:"";position:fixed;top:0;right:0;bottom:0;left:0;background:var(--color-backdrop);display:var(--menu-display-backdrop);pointer-events:none}.k-panel-menu-toggle{--button-align: flex-start;--button-height: 100%;--button-width: var(--menu-toggle-width);position:absolute;inset-block:0;inset-inline-start:100%;align-items:flex-start;border-radius:0;overflow:visible;opacity:0;transition:opacity .2s}.k-panel-menu-toggle:focus{outline:0}.k-panel-menu-toggle .k-button-icon{display:grid;place-items:center;height:var(--menu-toggle-height);width:var(--menu-toggle-width);margin-top:var(--menu-padding);border-block:1px solid var(--menu-color-border);border-inline-end:1px solid var(--menu-color-border);background:var(--menu-color-back);border-start-end-radius:var(--button-rounded);border-end-end-radius:var(--button-rounded)}@media (max-width: 60rem){.k-panel-menu .k-activation-button{margin-bottom:var(--spacing-3)}.k-panel-menu .k-activation-toggle{display:none}}@media (min-width: 60rem){.k-panel{--menu-display: block;--menu-display-backdrop: none;--menu-shadow: none;--main-start: var(--menu-width)}.k-panel[data-menu=false]{--menu-button-width: var(--menu-button-height);--menu-width: var(--menu-width-closed)}.k-panel-menu-proxy{display:none}.k-panel-menu-toggle:focus-visible,.k-panel-menu[data-hover] .k-panel-menu-toggle{opacity:1}.k-panel-menu-toggle:focus-visible .k-button-icon{outline:var(--outline);border-radius:var(--button-rounded)}.k-panel-menu-search[aria-disabled=true]{opacity:0}.k-panel-menu .k-activation{position:absolute;bottom:var(--menu-padding);inset-inline-start:100%;height:var(--height-md);width:max-content;margin-left:var(--menu-padding)}.k-panel-menu .k-activation:before{position:absolute;content:"";top:50%;left:-4px;margin-top:-4px;border-top:4px solid transparent;border-right:4px solid var(--color-black);border-bottom:4px solid transparent}.k-panel-menu .k-activation p :where(button,a){padding-inline:var(--spacing-1)}.k-panel-menu .k-activation-toggle{border-left:1px solid var(--dropdown-color-hr)}}.k-panel.k-panel-outside{display:grid;grid-template-rows:1fr;place-items:center;min-height:100vh;min-height:100dvh;padding:var(--spacing-6)}:root{--scroll-top: 0rem}html{overflow-x:hidden;overflow-y:scroll;background:var(--color-light)}body{font-size:var(--text-sm)}.k-panel[data-loading=true]{animation:LoadingCursor .5s}.k-panel[data-loading=true]:after,.k-panel[data-dragging=true]{-webkit-user-select:none;user-select:none}.k-topbar{position:relative;margin-inline:calc(var(--button-padding) * -1);margin-bottom:var(--spacing-8);display:flex;align-items:center;gap:var(--spacing-1)}.k-topbar-breadcrumb{margin-inline-start:-2px;flex-shrink:1;min-width:0}.k-topbar-spacer{flex-grow:1}.k-topbar-signals{display:flex;align-items:center}.k-search-view .k-header{margin-bottom:0}.k-header+.k-search-view-results{margin-top:var(--spacing-12)}.k-search-view-input{--input-color-border: transparent;--input-color-back: var(--color-gray-300);--input-height: var(--height-md);width:40cqw}.k-file-view-header,.k-file-view[data-has-tabs=true] .k-file-preview{margin-bottom:0}.k-file-preview{display:grid;align-items:stretch;background:var(--color-gray-900);border-radius:var(--rounded-lg);margin-bottom:var(--spacing-12);overflow:hidden}.k-file-preview-thumb-column{background:var(--pattern);aspect-ratio:1/1}.k-file-preview-thumb{display:flex;align-items:center;justify-content:center;height:100%;padding:var(--spacing-12);container-type:size}.k-file-preview-thumb img{width:auto;max-width:100cqw;max-height:100cqh}.k-file-preview-thumb>.k-icon{--icon-size: 3rem}.k-file-preview-thumb>.k-button{position:absolute;top:var(--spacing-2);inset-inline-start:var(--spacing-2)}.k-file-preview .k-coords-input{--opacity-disabled: 1;--range-thumb-color: hsl(216 60% 60% / .75);--range-thumb-size: 1.25rem;--range-thumb-shadow: none;cursor:crosshair}.k-file-preview .k-coords-input-thumb:after{--size: .4rem;--pos: calc(50% - (var(--size) / 2));position:absolute;top:var(--pos);inset-inline-start:var(--pos);width:var(--size);height:var(--size);content:"";background:var(--color-white);border-radius:50%}.k-file-preview:not([data-has-focus=true]) .k-coords-input-thumb{display:none}.k-file-preview-details{display:grid}.k-file-preview-details dl{display:grid;grid-template-columns:repeat(auto-fill,minmax(14rem,1fr));grid-gap:var(--spacing-6) var(--spacing-12);align-self:center;line-height:1.5em;padding:var(--spacing-6)}.k-file-preview-details dt{font-size:var(--text-sm);font-weight:500;font-weight:var(--font-semi);color:var(--color-gray-500);margin-bottom:var(--spacing-1)}.k-file-preview-details :where(dd,a){font-size:var(--text-xs);color:#ffffff80;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#ffffffbf;font-size:var(--text-sm)}.k-file-preview-focus-info dd{display:flex;align-items:center}.k-file-preview-focus-info .k-button{--button-padding: var(--spacing-2);--button-color-back: var(--color-gray-800)}.k-file-preview[data-has-focus=true] .k-file-preview-focus-info .k-button{flex-direction:row-reverse}@container (min-width: 36rem){.k-file-preview{grid-template-columns:50% auto}.k-file-preview-thumb-column{aspect-ratio:auto}}@container (min-width: 65rem){.k-file-preview{grid-template-columns:33.333% auto}.k-file-preview-thumb-column{aspect-ratio:1/1}}@container (min-width: 90rem){.k-file-preview-layout{grid-template-columns:25% auto}}.k-installation-dialog{--dialog-color-back: var(--color-white);--dialog-shadow: var(--shadow);container-type:inline-size}.k-installation-view .k-button{margin-top:var(--spacing-3);width:100%}.k-installation-view form .k-button{margin-top:var(--spacing-10)}.k-installation-view .k-headline{font-weight:var(--font-semi);margin-top:-.5rem;margin-bottom:.75rem}.k-installation-issues{line-height:1.5em;font-size:var(--text-sm)}.k-installation-issues li{position:relative;padding:var(--spacing-6);background:var(--color-red-300);padding-inline-start:3.5rem;border-radius:var(--rounded)}.k-installation-issues .k-icon{position:absolute;top:calc(1.5rem + 2px);inset-inline-start:1.5rem}.k-installation-issues .k-icon{color:var(--color-red-700)}.k-installation-issues li:not(:last-child){margin-bottom:2px}.k-installation-issues li code{font:inherit;color:var(--color-red-700)}.k-login-code-form .k-user-info{margin-bottom:var(--spacing-6)}.k-login-form{position:relative}.k-login-form label abbr{visibility:hidden}.k-login-toggler{position:absolute;top:-2px;inset-inline-end:calc(var(--spacing-2) * -1);color:var(--link-color);text-decoration:underline;text-decoration-color:var(--link-color);text-underline-offset:1px;height:var(--height-xs);line-height:1;padding-inline:var(--spacing-2);border-radius:var(--rounded);z-index:1}.k-login{--dialog-color-back: var(--color-white);--dialog-shadow: var(--shadow);container-type:inline-size}.k-login-buttons{--button-padding: var(--spacing-3);display:flex;gap:1.5rem;align-items:center;justify-content:space-between;margin-top:var(--spacing-10)}.k-page-view[data-has-tabs=true] .k-page-view-header,.k-site-view[data-has-tabs=true] .k-site-view-header{margin-bottom:0}.k-user-name-placeholder{color:var(--color-gray-500);transition:color .3s}.k-user-view-header[data-editable=true] .k-user-name-placeholder:hover{color:var(--color-gray-900)}.k-user-view-header{margin-bottom:0;border-bottom:0}.k-user-view .k-user-profile{margin-bottom:var(--spacing-12)}.k-user-view[data-has-tabs=true] .k-user-profile{margin-bottom:0}.k-password-reset-view .k-user-info{margin-bottom:var(--spacing-8)}.k-user-view-image{padding:0}.k-user-view-image .k-frame{width:6rem;height:6rem;border-radius:var(--rounded);line-height:0}.k-user-view-image .k-icon-frame{--back: var(--color-black);--icon-color: var(--color-gray-200)}.k-user-info{display:flex;align-items:center;font-size:var(--text-sm);height:var(--height-lg);gap:.75rem;padding-inline:var(--spacing-2);background:var(--color-white);box-shadow:var(--shadow)}.k-user-info :where(.k-image-frame,.k-icon-frame){width:1.5rem;border-radius:var(--rounded-sm)}.k-user-profile{--button-height: auto;padding:var(--spacing-2);background:var(--color-white);border-radius:var(--rounded-lg);display:flex;align-items:center;gap:var(--spacing-3);box-shadow:var(--shadow)}.k-user-profile .k-button-group{display:flex;flex-direction:column;align-items:flex-start}.k-users-view-header{margin-bottom:0}.k-system-info .k-stat-label{color:var(--theme, var(--color-black))}.k-table-update-status-cell{padding:0 .75rem;display:flex;align-items:center;height:100%}.k-table-update-status-cell-version,.k-table-update-status-cell-button{font-variant-numeric:tabular-nums}.k-plugin-info{display:grid;column-gap:var(--spacing-3);row-gap:2px;padding:var(--button-padding)}.k-plugin-info dt{color:var(--color-gray-400)}.k-plugin-info dd[data-theme]{color:var(--theme-color-600)}@container (max-width: 30em){.k-plugin-info dd:not(:last-of-type){margin-bottom:var(--spacing-2)}}@container (min-width: 30em){.k-plugin-info{width:20rem;grid-template-columns:1fr auto}}:root{--color-l-100: 98%;--color-l-200: 94%;--color-l-300: 88%;--color-l-400: 80%;--color-l-500: 70%;--color-l-600: 60%;--color-l-700: 45%;--color-l-800: 30%;--color-l-900: 15%;--color-red-h: 0;--color-red-s: 80%;--color-red-hs: var(--color-red-h), var(--color-red-s);--color-red-boost: 3%;--color-red-l-100: calc(var(--color-l-100) + var(--color-red-boost));--color-red-l-200: calc(var(--color-l-200) + var(--color-red-boost));--color-red-l-300: calc(var(--color-l-300) + var(--color-red-boost));--color-red-l-400: calc(var(--color-l-400) + var(--color-red-boost));--color-red-l-500: calc(var(--color-l-500) + var(--color-red-boost));--color-red-l-600: calc(var(--color-l-600) + var(--color-red-boost));--color-red-l-700: calc(var(--color-l-700) + var(--color-red-boost));--color-red-l-800: calc(var(--color-l-800) + var(--color-red-boost));--color-red-l-900: calc(var(--color-l-900) + var(--color-red-boost));--color-red-100: hsl(var(--color-red-hs), var(--color-red-l-100));--color-red-200: hsl(var(--color-red-hs), var(--color-red-l-200));--color-red-300: hsl(var(--color-red-hs), var(--color-red-l-300));--color-red-400: hsl(var(--color-red-hs), var(--color-red-l-400));--color-red-500: hsl(var(--color-red-hs), var(--color-red-l-500));--color-red-600: hsl(var(--color-red-hs), var(--color-red-l-600));--color-red-700: hsl(var(--color-red-hs), var(--color-red-l-700));--color-red-800: hsl(var(--color-red-hs), var(--color-red-l-800));--color-red-900: hsl(var(--color-red-hs), var(--color-red-l-900));--color-orange-h: 28;--color-orange-s: 80%;--color-orange-hs: var(--color-orange-h), var(--color-orange-s);--color-orange-boost: 2.5%;--color-orange-l-100: calc(var(--color-l-100) + var(--color-orange-boost));--color-orange-l-200: calc(var(--color-l-200) + var(--color-orange-boost));--color-orange-l-300: calc(var(--color-l-300) + var(--color-orange-boost));--color-orange-l-400: calc(var(--color-l-400) + var(--color-orange-boost));--color-orange-l-500: calc(var(--color-l-500) + var(--color-orange-boost));--color-orange-l-600: calc(var(--color-l-600) + var(--color-orange-boost));--color-orange-l-700: calc(var(--color-l-700) + var(--color-orange-boost));--color-orange-l-800: calc(var(--color-l-800) + var(--color-orange-boost));--color-orange-l-900: calc(var(--color-l-900) + var(--color-orange-boost));--color-orange-100: hsl(var(--color-orange-hs), var(--color-orange-l-100));--color-orange-200: hsl(var(--color-orange-hs), var(--color-orange-l-200));--color-orange-300: hsl(var(--color-orange-hs), var(--color-orange-l-300));--color-orange-400: hsl(var(--color-orange-hs), var(--color-orange-l-400));--color-orange-500: hsl(var(--color-orange-hs), var(--color-orange-l-500));--color-orange-600: hsl(var(--color-orange-hs), var(--color-orange-l-600));--color-orange-700: hsl(var(--color-orange-hs), var(--color-orange-l-700));--color-orange-800: hsl(var(--color-orange-hs), var(--color-orange-l-800));--color-orange-900: hsl(var(--color-orange-hs), var(--color-orange-l-900));--color-yellow-h: 47;--color-yellow-s: 80%;--color-yellow-hs: var(--color-yellow-h), var(--color-yellow-s);--color-yellow-boost: 0%;--color-yellow-l-100: calc(var(--color-l-100) + var(--color-yellow-boost));--color-yellow-l-200: calc(var(--color-l-200) + var(--color-yellow-boost));--color-yellow-l-300: calc(var(--color-l-300) + var(--color-yellow-boost));--color-yellow-l-400: calc(var(--color-l-400) + var(--color-yellow-boost));--color-yellow-l-500: calc(var(--color-l-500) + var(--color-yellow-boost));--color-yellow-l-600: calc(var(--color-l-600) + var(--color-yellow-boost));--color-yellow-l-700: calc(var(--color-l-700) + var(--color-yellow-boost));--color-yellow-l-800: calc(var(--color-l-800) + var(--color-yellow-boost));--color-yellow-l-900: calc(var(--color-l-900) + var(--color-yellow-boost));--color-yellow-100: hsl(var(--color-yellow-hs), var(--color-yellow-l-100));--color-yellow-200: hsl(var(--color-yellow-hs), var(--color-yellow-l-200));--color-yellow-300: hsl(var(--color-yellow-hs), var(--color-yellow-l-300));--color-yellow-400: hsl(var(--color-yellow-hs), var(--color-yellow-l-400));--color-yellow-500: hsl(var(--color-yellow-hs), var(--color-yellow-l-500));--color-yellow-600: hsl(var(--color-yellow-hs), var(--color-yellow-l-600));--color-yellow-700: hsl(var(--color-yellow-hs), var(--color-yellow-l-700));--color-yellow-800: hsl(var(--color-yellow-hs), var(--color-yellow-l-800));--color-yellow-900: hsl(var(--color-yellow-hs), var(--color-yellow-l-900));--color-green-h: 80;--color-green-s: 60%;--color-green-hs: var(--color-green-h), var(--color-green-s);--color-green-boost: -2.5%;--color-green-l-100: calc(var(--color-l-100) + var(--color-green-boost));--color-green-l-200: calc(var(--color-l-200) + var(--color-green-boost));--color-green-l-300: calc(var(--color-l-300) + var(--color-green-boost));--color-green-l-400: calc(var(--color-l-400) + var(--color-green-boost));--color-green-l-500: calc(var(--color-l-500) + var(--color-green-boost));--color-green-l-600: calc(var(--color-l-600) + var(--color-green-boost));--color-green-l-700: calc(var(--color-l-700) + var(--color-green-boost));--color-green-l-800: calc(var(--color-l-800) + var(--color-green-boost));--color-green-l-900: calc(var(--color-l-900) + var(--color-green-boost));--color-green-100: hsl(var(--color-green-hs), var(--color-green-l-100));--color-green-200: hsl(var(--color-green-hs), var(--color-green-l-200));--color-green-300: hsl(var(--color-green-hs), var(--color-green-l-300));--color-green-400: hsl(var(--color-green-hs), var(--color-green-l-400));--color-green-500: hsl(var(--color-green-hs), var(--color-green-l-500));--color-green-600: hsl(var(--color-green-hs), var(--color-green-l-600));--color-green-700: hsl(var(--color-green-hs), var(--color-green-l-700));--color-green-800: hsl(var(--color-green-hs), var(--color-green-l-800));--color-green-900: hsl(var(--color-green-hs), var(--color-green-l-900));--color-aqua-h: 180;--color-aqua-s: 50%;--color-aqua-hs: var(--color-aqua-h), var(--color-aqua-s);--color-aqua-boost: 0%;--color-aqua-l-100: calc(var(--color-l-100) + var(--color-aqua-boost));--color-aqua-l-200: calc(var(--color-l-200) + var(--color-aqua-boost));--color-aqua-l-300: calc(var(--color-l-300) + var(--color-aqua-boost));--color-aqua-l-400: calc(var(--color-l-400) + var(--color-aqua-boost));--color-aqua-l-500: calc(var(--color-l-500) + var(--color-aqua-boost));--color-aqua-l-600: calc(var(--color-l-600) + var(--color-aqua-boost));--color-aqua-l-700: calc(var(--color-l-700) + var(--color-aqua-boost));--color-aqua-l-800: calc(var(--color-l-800) + var(--color-aqua-boost));--color-aqua-l-900: calc(var(--color-l-900) + var(--color-aqua-boost));--color-aqua-100: hsl(var(--color-aqua-hs), var(--color-aqua-l-100));--color-aqua-200: hsl(var(--color-aqua-hs), var(--color-aqua-l-200));--color-aqua-300: hsl(var(--color-aqua-hs), var(--color-aqua-l-300));--color-aqua-400: hsl(var(--color-aqua-hs), var(--color-aqua-l-400));--color-aqua-500: hsl(var(--color-aqua-hs), var(--color-aqua-l-500));--color-aqua-600: hsl(var(--color-aqua-hs), var(--color-aqua-l-600));--color-aqua-700: hsl(var(--color-aqua-hs), var(--color-aqua-l-700));--color-aqua-800: hsl(var(--color-aqua-hs), var(--color-aqua-l-800));--color-aqua-900: hsl(var(--color-aqua-hs), var(--color-aqua-l-900));--color-blue-h: 210;--color-blue-s: 65%;--color-blue-hs: var(--color-blue-h), var(--color-blue-s);--color-blue-boost: 3%;--color-blue-l-100: calc(var(--color-l-100) + var(--color-blue-boost));--color-blue-l-200: calc(var(--color-l-200) + var(--color-blue-boost));--color-blue-l-300: calc(var(--color-l-300) + var(--color-blue-boost));--color-blue-l-400: calc(var(--color-l-400) + var(--color-blue-boost));--color-blue-l-500: calc(var(--color-l-500) + var(--color-blue-boost));--color-blue-l-600: calc(var(--color-l-600) + var(--color-blue-boost));--color-blue-l-700: calc(var(--color-l-700) + var(--color-blue-boost));--color-blue-l-800: calc(var(--color-l-800) + var(--color-blue-boost));--color-blue-l-900: calc(var(--color-l-900) + var(--color-blue-boost));--color-blue-100: hsl(var(--color-blue-hs), var(--color-blue-l-100));--color-blue-200: hsl(var(--color-blue-hs), var(--color-blue-l-200));--color-blue-300: hsl(var(--color-blue-hs), var(--color-blue-l-300));--color-blue-400: hsl(var(--color-blue-hs), var(--color-blue-l-400));--color-blue-500: hsl(var(--color-blue-hs), var(--color-blue-l-500));--color-blue-600: hsl(var(--color-blue-hs), var(--color-blue-l-600));--color-blue-700: hsl(var(--color-blue-hs), var(--color-blue-l-700));--color-blue-800: hsl(var(--color-blue-hs), var(--color-blue-l-800));--color-blue-900: hsl(var(--color-blue-hs), var(--color-blue-l-900));--color-purple-h: 275;--color-purple-s: 60%;--color-purple-hs: var(--color-purple-h), var(--color-purple-s);--color-purple-boost: 0%;--color-purple-l-100: calc(var(--color-l-100) + var(--color-purple-boost));--color-purple-l-200: calc(var(--color-l-200) + var(--color-purple-boost));--color-purple-l-300: calc(var(--color-l-300) + var(--color-purple-boost));--color-purple-l-400: calc(var(--color-l-400) + var(--color-purple-boost));--color-purple-l-500: calc(var(--color-l-500) + var(--color-purple-boost));--color-purple-l-600: calc(var(--color-l-600) + var(--color-purple-boost));--color-purple-l-700: calc(var(--color-l-700) + var(--color-purple-boost));--color-purple-l-800: calc(var(--color-l-800) + var(--color-purple-boost));--color-purple-l-900: calc(var(--color-l-900) + var(--color-purple-boost));--color-purple-100: hsl(var(--color-purple-hs), var(--color-purple-l-100));--color-purple-200: hsl(var(--color-purple-hs), var(--color-purple-l-200));--color-purple-300: hsl(var(--color-purple-hs), var(--color-purple-l-300));--color-purple-400: hsl(var(--color-purple-hs), var(--color-purple-l-400));--color-purple-500: hsl(var(--color-purple-hs), var(--color-purple-l-500));--color-purple-600: hsl(var(--color-purple-hs), var(--color-purple-l-600));--color-purple-700: hsl(var(--color-purple-hs), var(--color-purple-l-700));--color-purple-800: hsl(var(--color-purple-hs), var(--color-purple-l-800));--color-purple-900: hsl(var(--color-purple-hs), var(--color-purple-l-900));--color-pink-h: 320;--color-pink-s: 70%;--color-pink-hs: var(--color-pink-h), var(--color-pink-s);--color-pink-boost: 0%;--color-pink-l-100: calc(var(--color-l-100) + var(--color-pink-boost));--color-pink-l-200: calc(var(--color-l-200) + var(--color-pink-boost));--color-pink-l-300: calc(var(--color-l-300) + var(--color-pink-boost));--color-pink-l-400: calc(var(--color-l-400) + var(--color-pink-boost));--color-pink-l-500: calc(var(--color-l-500) + var(--color-pink-boost));--color-pink-l-600: calc(var(--color-l-600) + var(--color-pink-boost));--color-pink-l-700: calc(var(--color-l-700) + var(--color-pink-boost));--color-pink-l-800: calc(var(--color-l-800) + var(--color-pink-boost));--color-pink-l-900: calc(var(--color-l-900) + var(--color-pink-boost));--color-pink-100: hsl(var(--color-pink-hs), var(--color-pink-l-100));--color-pink-200: hsl(var(--color-pink-hs), var(--color-pink-l-200));--color-pink-300: hsl(var(--color-pink-hs), var(--color-pink-l-300));--color-pink-400: hsl(var(--color-pink-hs), var(--color-pink-l-400));--color-pink-500: hsl(var(--color-pink-hs), var(--color-pink-l-500));--color-pink-600: hsl(var(--color-pink-hs), var(--color-pink-l-600));--color-pink-700: hsl(var(--color-pink-hs), var(--color-pink-l-700));--color-pink-800: hsl(var(--color-pink-hs), var(--color-pink-l-800));--color-pink-900: hsl(var(--color-pink-hs), var(--color-pink-l-900));--color-gray-h: 0;--color-gray-s: 0%;--color-gray-hs: var(--color-gray-h), var(--color-gray-s);--color-gray-boost: 0%;--color-gray-l-100: calc(var(--color-l-100) + var(--color-gray-boost));--color-gray-l-200: calc(var(--color-l-200) + var(--color-gray-boost));--color-gray-l-300: calc(var(--color-l-300) + var(--color-gray-boost));--color-gray-l-400: calc(var(--color-l-400) + var(--color-gray-boost));--color-gray-l-500: calc(var(--color-l-500) + var(--color-gray-boost));--color-gray-l-600: calc(var(--color-l-600) + var(--color-gray-boost));--color-gray-l-700: calc(var(--color-l-700) + var(--color-gray-boost));--color-gray-l-800: calc(var(--color-l-800) + var(--color-gray-boost));--color-gray-l-900: calc(var(--color-l-900) + var(--color-gray-boost));--color-gray-100: hsl(var(--color-gray-hs), var(--color-gray-l-100));--color-gray-200: hsl(var(--color-gray-hs), var(--color-gray-l-200));--color-gray-250: #e8e8e8;--color-gray-300: hsl(var(--color-gray-hs), var(--color-gray-l-300));--color-gray-400: hsl(var(--color-gray-hs), var(--color-gray-l-400));--color-gray-500: hsl(var(--color-gray-hs), var(--color-gray-l-500));--color-gray-600: hsl(var(--color-gray-hs), var(--color-gray-l-600));--color-gray-700: hsl(var(--color-gray-hs), var(--color-gray-l-700));--color-gray-800: hsl(var(--color-gray-hs), var(--color-gray-l-800));--color-gray-900: hsl(var(--color-gray-hs), var(--color-gray-l-900));--color-backdrop: rgba(0, 0, 0, .6);--color-black: black;--color-border: var(--color-gray-300);--color-dark: var(--color-gray-900);--color-focus: var(--color-blue-600);--color-light: var(--color-gray-200);--color-text: var(--color-black);--color-text-dimmed: var(--color-gray-700);--color-white: white;--color-background: var(--color-light);--color-gray: var(--color-gray-600);--color-red: var(--color-red-600);--color-orange: var(--color-orange-600);--color-yellow: var(--color-yellow-600);--color-green: var(--color-green-600);--color-aqua: var(--color-aqua-600);--color-blue: var(--color-blue-600);--color-purple: var(--color-purple-600);--color-focus-light: var(--color-focus);--color-focus-outline: var(--color-focus);--color-negative: var(--color-red-700);--color-negative-light: var(--color-red-500);--color-negative-outline: var(--color-red-900);--color-notice: var(--color-orange-700);--color-notice-light: var(--color-orange-500);--color-positive: var(--color-green-700);--color-positive-light: var(--color-green-500);--color-positive-outline: var(--color-green-900);--color-text-light: var(--color-text-dimmed)}:root{--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--font-mono: "SFMono-Regular", Consolas, Liberation Mono, Menlo, Courier, monospace}:root{--text-xs: .75rem;--text-sm: .875rem;--text-md: 1rem;--text-lg: 1.125rem;--text-xl: 1.25rem;--text-2xl: 1.5rem;--text-3xl: 1.75rem;--text-4xl: 2.5rem;--text-5xl: 3rem;--text-6xl: 4rem;--text-base: var(--text-md);--font-size-tiny: var(--text-xs);--font-size-small: var(--text-sm);--font-size-medium: var(--text-base);--font-size-large: var(--text-xl);--font-size-huge: var(--text-2xl);--font-size-monster: var(--text-3xl)}:root{--font-thin: 300;--font-normal: 400;--font-semi: 500;--font-bold: 600}:root{--height-xs: 1.5rem;--height-sm: 1.75rem;--height-md: 2rem;--height-lg: 2.25rem;--height-xl: 2.5rem;--height: var(--height-md)}:root{--opacity-disabled: .5}:root{--rounded-xs: 1px;--rounded-sm: .125rem;--rounded-md: .25rem;--rounded-lg: .375rem;--rounded-xl: .5rem;--rounded: var(--rounded-md)}:root{--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .05), 0 1px 2px 0 rgba(0, 0, 0, .025);--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .05);--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .05);--shadow: var(--shadow-sm);--shadow-toolbar: rgba(0, 0, 0, .1) -2px 0 5px, var(--shadow), var(--shadow-xl);--shadow-outline: var(--color-focus, currentColor) 0 0 0 2px;--shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, .06);--shadow-sticky: rgba(0, 0, 0, .05) 0 2px 5px;--box-shadow-dropdown: var(--shadow-dropdown);--box-shadow-item: var(--shadow);--box-shadow-focus: var(--shadow-xl);--shadow-dropdown: var(--shadow-lg);--shadow-item: var(--shadow-sm)}:root{--spacing-0: 0;--spacing-1: .25rem;--spacing-2: .5rem;--spacing-3: .75rem;--spacing-4: 1rem;--spacing-6: 1.5rem;--spacing-8: 2rem;--spacing-12: 3rem;--spacing-16: 4rem;--spacing-24: 6rem;--spacing-36: 9rem;--spacing-48: 12rem;--spacing-px: 1px;--spacing-2px: 2px;--spacing-5: 1.25rem;--spacing-10: 2.5rem;--spacing-20: 5rem}:root{--z-offline: 1200;--z-fatal: 1100;--z-loader: 1000;--z-notification: 900;--z-dialog: 800;--z-navigation: 700;--z-dropdown: 600;--z-drawer: 500;--z-dropzone: 400;--z-toolbar: 300;--z-content: 200;--z-background: 100}:root{--pattern-size: 16px;--pattern-light: repeating-conic-gradient( hsl(0, 0%, 100%) 0% 25%, hsl(0, 0%, 90%) 0% 50% ) 50% / var(--pattern-size) var(--pattern-size);--pattern-dark: repeating-conic-gradient( hsla(0, 0%, 15%) 0% 25%, hsl(0, 0%, 22%) 0% 50% ) 50% / var(--pattern-size) var(--pattern-size);--pattern: var(--pattern-dark)}:root{--container: 80rem;--leading-none: 1;--leading-tight: 1.25;--leading-snug: 1.375;--leading-normal: 1.5;--leading-relaxed: 1.625;--leading-loose: 2;--field-input-padding: var(--input-padding);--field-input-height: var(--input-height);--field-input-line-height: var(--input-leading);--field-input-font-size: var(--input-font-size);--bg-pattern: var(--pattern)}:root{--choice-color-back: var(--color-white);--choice-color-border: var(--color-gray-500);--choice-color-checked: var(--color-black);--choice-color-disabled: var(--color-gray-400);--choice-color-icon: var(--color-light);--choice-color-info: var(--color-text-dimmed);--choice-color-text: var(--color-text);--choice-color-toggle: var(--choice-color-disabled);--choice-height: 1rem;--choice-rounded: var(--rounded-sm)}input:where([type=checkbox],[type=radio]){position:relative;cursor:pointer;overflow:hidden;flex-shrink:0;height:var(--choice-height);aspect-ratio:1/1;border:1px solid var(--choice-color-border);-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:var(--choice-rounded);background:var(--choice-color-back);box-shadow:var(--shadow-sm)}input:where([type=checkbox],[type=radio]):after{position:absolute;content:"";display:none;place-items:center;text-align:center}input:where([type=checkbox],[type=radio]):focus{outline:var(--outline);outline-offset:-1px;color:var(--color-focus)}input:where([type=checkbox]):checked{border-color:var(--choice-color-checked)}input:where([type=checkbox],[type=radio]):checked:after{background:var(--choice-color-checked);display:grid}input:where([type=checkbox],[type=radio]):checked:focus{--choice-color-checked: var(--color-focus)}input:where([type=checkbox],[type=radio])[disabled]{--choice-color-back: none;--choice-color-border: var(--color-gray-300);--choice-color-checked: var(--choice-color-disabled);box-shadow:none;cursor:not-allowed}input[type=checkbox]:checked:after{content:"✓";top:0;right:0;bottom:0;left:0;font-weight:700;color:var(--choice-color-icon);line-height:1}input[type=radio]{--choice-rounded: 50%}input[type=radio]:after{top:3px;right:3px;bottom:3px;left:3px;font-size:9px;border-radius:var(--choice-rounded)}input[type=checkbox][data-variant=toggle]{--choice-rounded: var(--choice-height);width:calc(var(--choice-height) * 2);aspect-ratio:2/1}input[type=checkbox][data-variant=toggle]:after{background:var(--choice-color-toggle);display:grid;top:1px;right:1px;bottom:1px;left:1px;width:.8rem;font-size:7px;border-radius:var(--choice-rounded);transition:margin-inline-start 75ms ease-in-out,background .1s ease-in-out}input[type=checkbox][data-variant=toggle]:checked{border-color:var(--choice-color-border)}input[type=checkbox][data-variant=toggle]:checked:after{background:var(--choice-color-checked);margin-inline-start:50%}:root{--range-thumb-color: var(--color-white);--range-thumb-focus-outline: var(--outline);--range-thumb-size: 1rem;--range-thumb-shadow: rgba(0, 0, 0, .1) 0 2px 4px 2px, rgba(0, 0, 0, .125) 0 0 0 1px;--range-track-back: var(--color-gray-250);--range-track-height: var(--range-thumb-size)}:where(input[type=range]){display:flex;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;height:var(--range-thumb-size);border-radius:var(--range-track-size);width:100%}:where(input[type=range])::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:var(--range-thumb-size);height:var(--range-thumb-size);border:0;background:var(--range-thumb-color);box-shadow:var(--range-thumb-shadow);transform:translateZ(0);margin-top:calc(((var(--range-thumb-size) - var(--range-track-height)) / 2) * -1);border-radius:50%;z-index:1;cursor:grab}:where(input[type=range])::-moz-range-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:var(--range-thumb-size);height:var(--range-thumb-size);border:0;background:var(--range-thumb-color);box-shadow:var(--range-thumb-shadow);border-radius:50%;transform:translateZ(0);z-index:1;cursor:grab}:where(input[type=range])::-webkit-slider-thumb:active{cursor:grabbing}:where(input[type=range])::-moz-range-thumb:active{cursor:grabbing}:where(input[type=range])::-webkit-slider-runnable-track{background:var(--range-track-back);height:var(--range-track-height);border-radius:var(--range-track-height)}:where(input[type=range])::-moz-range-track{background:var(--range-track-back);height:var(--range-track-height);border-radius:var(--range-track-height)}:where(input[type=range][disabled]){--range-thumb-color: rgba(255, 255, 255, .2)}:where(input[type=range][disabled])::-webkit-slider-thumb{cursor:not-allowed}:where(input[type=range][disabled])::-moz-range-thumb{cursor:not-allowed}:where(input[type=range]):focus{outline:var(--outline)}:where(input[type=range]):focus::-webkit-slider-thumb{outline:var(--range-thumb-focus-outline)}:where(input[type=range]):focus::-moz-range-thumb{outline:var(--range-thumb-focus-outline)}*,*:before,*:after{margin:0;padding:0;box-sizing:border-box}:where(b,strong){font-weight:var(--font-bold, 600)}:where([hidden]){display:none!important}:where(abbr){text-decoration:none}:where(input,button,textarea,select){border:0;font:inherit;line-height:inherit;color:inherit;background:none}:where(fieldset){border:0}:where(legend){width:100%;float:left}:where(legend+*){clear:both}:where(select){-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--color-white);color:var(--color-black);cursor:pointer}:where(textarea,select,input:not([type=checkbox],[type=radio],[type=reset],[type=submit])){width:100%;font-variant-numeric:tabular-nums}:where(textarea){resize:vertical;line-height:1.5}:where(input)::-webkit-calendar-picker-indicator{display:none}:where(input[type=search]){-webkit-appearance:none;-moz-appearance:none;appearance:none}:where(input)::-webkit-search-cancel-button{display:none}:where(button,label,select,summary,[role=button],[role=option]){cursor:pointer}:where(select[multiple]) option{display:flex;align-items:center}:where(input:-webkit-autofill){-webkit-text-fill-color:var(--input-color-text)!important;-webkit-background-clip:text}:where(:disabled){cursor:not-allowed}*::placeholder{color:var(--input-color-placeholder);opacity:1}:where(a){color:currentColor;text-decoration:none;text-underline-offset:.2ex}:where(ul,ol){list-style:none}:where(img,svg,video,canvas,audio,iframe,embed,object){display:block}:where(iframe){border:0}:where(img,picture,svg){max-inline-size:100%;block-size:auto}:where(p,h1,h2,h3,h4,h5,h6){overflow-wrap:break-word}:where(h1,h2,h3,h4,h5,h6){font:inherit}:where(:focus,:focus-visible,:focus-within){outline-color:var(--color-focus, currentColor);outline-offset:0}:where(:focus-visible){outline:var(--outline, 2px solid var(--color-focus, currentColor))}:where(:invalid){box-shadow:none;outline:0}:where(dialog){border:0;max-width:none;max-height:none}:where(hr){border:0}:where(table){font:inherit;width:100%;border-spacing:0;font-variant-numeric:tabular-nums}:where(table th){font:inherit;text-align:start}:where(svg){fill:currentColor}body{font-family:var(--font-sans, sans-serif);font-size:var(--text-sm);line-height:1;position:relative;accent-color:var(--color-focus, currentColor)}:where(sup,sub){position:relative;line-height:0;vertical-align:baseline;font-size:75%}:where(sup){top:-.5em}:where(sub){bottom:-.25em}:where(mark){background:var(--color-yellow-300)}:where(kbd){display:inline-block;padding-inline:var(--spacing-2);border-radius:var(--rounded);background:var(--color-white);box-shadow:var(--shadow)}[data-align=left]{--align: start}[data-align=center]{--align: center}[data-align=right]{--align: end}@keyframes LoadingCursor{to{cursor:progress}}@keyframes Spin{to{transform:rotate(360deg)}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}[data-theme]{--theme-color-h: 0;--theme-color-s: 0%;--theme-color-hs: var(--theme-color-h), var(--theme-color-s);--theme-color-boost: 3%;--theme-color-l-100: calc(var(--color-l-100) + var(--theme-color-boost));--theme-color-l-200: calc(var(--color-l-200) + var(--theme-color-boost));--theme-color-l-300: calc(var(--color-l-300) + var(--theme-color-boost));--theme-color-l-400: calc(var(--color-l-400) + var(--theme-color-boost));--theme-color-l-500: calc(var(--color-l-500) + var(--theme-color-boost));--theme-color-l-600: calc(var(--color-l-600) + var(--theme-color-boost));--theme-color-l-700: calc(var(--color-l-700) + var(--theme-color-boost));--theme-color-l-800: calc(var(--color-l-800) + var(--theme-color-boost));--theme-color-l-900: calc(var(--color-l-900) + var(--theme-color-boost));--theme-color-100: hsl(var(--theme-color-hs), var(--theme-color-l-100));--theme-color-200: hsl(var(--theme-color-hs), var(--theme-color-l-200));--theme-color-300: hsl(var(--theme-color-hs), var(--theme-color-l-300));--theme-color-400: hsl(var(--theme-color-hs), var(--theme-color-l-400));--theme-color-500: hsl(var(--theme-color-hs), var(--theme-color-l-500));--theme-color-600: hsl(var(--theme-color-hs), var(--theme-color-l-600));--theme-color-700: hsl(var(--theme-color-hs), var(--theme-color-l-700));--theme-color-800: hsl(var(--theme-color-hs), var(--theme-color-l-800));--theme-color-900: hsl(var(--theme-color-hs), var(--theme-color-l-900));--theme-color-text: var(--theme-color-900);--theme-color-text-dimmed: hsl( var(--theme-color-h), calc(var(--theme-color-s) - 60%), 50% );--theme-color-back: var(--theme-color-400);--theme-color-hover: var(--theme-color-500);--theme-color-icon: var(--theme-color-600)}[data-theme^=red],[data-theme^=error],[data-theme^=negative]{--theme-color-h: var(--color-red-h);--theme-color-s: var(--color-red-s);--theme-color-boost: var(--color-red-boost)}[data-theme^=orange],[data-theme^=notice]{--theme-color-h: var(--color-orange-h);--theme-color-s: var(--color-orange-s);--theme-color-boost: var(--color-orange-boost)}[data-theme^=yellow],[data-theme^=warning]{--theme-color-h: var(--color-yellow-h);--theme-color-s: var(--color-yellow-s);--theme-color-boost: var(--color-yellow-boost)}[data-theme^=blue],[data-theme^=info]{--theme-color-h: var(--color-blue-h);--theme-color-s: var(--color-blue-s);--theme-color-boost: var(--color-blue-boost)}[data-theme^=pink],[data-theme^=love]{--theme-color-h: var(--color-pink-h);--theme-color-s: var(--color-pink-s);--theme-color-boost: var(--color-pink-boost)}[data-theme^=green],[data-theme^=positive]{--theme-color-h: var(--color-green-h);--theme-color-s: var(--color-green-s);--theme-color-boost: var(--color-green-boost)}[data-theme^=aqua]{--theme-color-h: var(--color-aqua-h);--theme-color-s: var(--color-aqua-s);--theme-color-boost: var(--color-aqua-boost)}[data-theme^=purple]{--theme-color-h: var(--color-purple-h);--theme-color-s: var(--color-purple-s);--theme-color-boost: var(--color-purple-boost)}[data-theme^=gray],[data-theme^=passive]{--theme-color-h: var(--color-gray-h);--theme-color-s: var(--color-gray-s);--theme-color-boost: 10%}[data-theme^=white],[data-theme^=text]{--theme-color-back: var(--color-white);--theme-color-icon: var(--color-gray-800);--theme-color-text: var(--color-text);--color-h: var(--color-black)}[data-theme^=dark]{--theme-color-h: var(--color-gray-h);--theme-color-s: var(--color-gray-s);--theme-color-boost: var(--color-gray-boost);--theme-color-back: var(--color-gray-800);--theme-color-icon: var(--color-gray-500);--theme-color-text: var(--color-gray-200)}[data-theme=code]{--theme-color-back: var(--code-color-back);--theme-color-hover: var(--color-black);--theme-color-icon: var(--code-color-icon);--theme-color-text: var(--code-color-text);font-family:var(--code-font-family);font-size:var(--code-font-size)}[data-theme=empty]{--theme-color-back: var(--color-light);--theme-color-border: var(--color-gray-400);--theme-color-icon: var(--color-gray-600);--theme-color-text: var(--color-text-dimmed);border:1px dashed var(--theme-color-border)}[data-theme=none]{--theme-color-back: transparent;--theme-color-border: transparent;--theme-color-icon: var(--color-text);--theme-color-text: var(--color-text)}[data-theme]{--theme: var(--theme-color-700);--theme-light: var(--theme-color-500);--theme-bg: var(--theme-color-500)}:root{--outline: 2px solid var(--color-focus, currentColor)}.scroll-x,.scroll-x-auto,.scroll-y,.scroll-y-auto{-webkit-overflow-scrolling:touch;transform:translateZ(0)}.scroll-x{overflow-x:scroll;overflow-y:hidden}.scroll-x-auto{overflow-x:auto;overflow-y:hidden}.scroll-y{overflow-x:hidden;overflow-y:scroll}.scroll-y-auto{overflow-x:hidden;overflow-y:auto}.input-hidden{position:absolute;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:0;height:0;opacity:0}.k-lab-index-view .k-header{margin-bottom:0}.k-lab-index-view .k-panel-main>.k-box{margin-bottom:var(--spacing-8)}.k-lab-index-view .k-list-items{grid-template-columns:repeat(auto-fill,minmax(12rem,1fr))}.k-lab-docs-deprecated .k-box{box-shadow:var(--shadow)}.k-lab-docs-examples .k-code+.k-code{margin-top:var(--spacing-4)}.k-lab-docs-prop-values{font-size:var(--text-xs);border-left:2px solid var(--color-blue-300);padding-inline-start:var(--spacing-2)}.k-lab-docs-prop-values dl{font-weight:var(--font-bold)}.k-lab-docs-prop-values dl+dl{margin-top:var(--spacing-2)}.k-lab-docs-prop-values dd{display:inline-flex;flex-wrap:wrap;gap:var(--spacing-1)}.k-lab-docs-desc-header{display:flex;justify-content:space-between;align-items:center}.k-table .k-lab-docs-deprecated{--box-height: var(--height-xs);--text-font-size: var(--text-xs)}.k-labs-docs-params li{list-style:square;margin-inline-start:var(--spacing-3)}.k-labs-docs-params .k-lab-docs-types{margin-inline:1ch}.k-lab-docs-types{display:inline-flex;flex-wrap:wrap;gap:var(--spacing-1)}.k-lab-docs-types.k-text code{color:var(--color-gray-800);outline-color:var(--color-gray-400);background:var(--color-gray-300)}.k-lab-docs-types code:is([data-type=boolean],[data-type=Boolean]){color:var(--color-purple-800);outline-color:var(--color-purple-400);background:var(--color-purple-300)}.k-lab-docs-types code:is([data-type=string],[data-type=String]){color:var(--color-green-800);outline-color:var(--color-green-500);background:var(--color-green-300)}.k-lab-docs-types code:is([data-type=number],[data-type=Number]){color:var(--color-orange-800);outline-color:var(--color-orange-500);background:var(--color-orange-300)}.k-lab-docs-types code:is([data-type=array],[data-type=Array]){color:var(--color-aqua-800);outline-color:var(--color-aqua-500);background:var(--color-aqua-300)}.k-lab-docs-types code:is([data-type=object],[data-type=Object]){color:var(--color-yellow-800);outline-color:var(--color-yellow-500);background:var(--color-yellow-300)}.k-lab-docs-types code[data-type=func]{color:var(--color-pink-800);outline-color:var(--color-pink-400);background:var(--color-pink-300)}.k-lab-docs-section+.k-lab-docs-section{margin-top:var(--spacing-12)}.k-lab-docs-section .k-headline{margin-bottom:var(--spacing-3)}.k-lab-docs-section .k-table td{padding:.375rem var(--table-cell-padding);vertical-align:top;line-height:1.5;word-break:break-word}.k-lab-docs-description :where(.k-text,.k-box)+:where(.k-text,.k-box){margin-top:var(--spacing-3)}.k-lab-docs-required{margin-inline-start:var(--spacing-1);font-size:.7rem;vertical-align:super;color:var(--color-red-600)}.k-lab-docs-since{margin-top:var(--spacing-1);font-size:var(--text-xs);color:var(--color-gray-600)}.k-lab-example{position:relative;container-type:inline-size;max-width:100%;outline-offset:-2px;border-radius:var(--rounded);border:1px solid var(--color-gray-300)}.k-lab-example+.k-lab-example{margin-top:var(--spacing-12)}.k-lab-example-header{display:flex;justify-content:space-between;align-items:center;height:var(--height-md);padding-block:var(--spacing-3);padding-inline:var(--spacing-2);border-bottom:1px solid var(--color-gray-300)}.k-lab-example-label{font-size:12px;color:var(--color-text-dimmed)}.k-lab-example-canvas,.k-lab-example-code{padding:var(--spacing-16)}.k-lab-example[data-flex] .k-lab-example-canvas{display:flex;align-items:center;gap:var(--spacing-6)}.k-lab-example-inspector{--icon-size: 13px;--button-color-icon: var(--color-gray-500)}.k-lab-example-inspector .k-button:not([data-theme]):hover{--button-color-icon: var(--color-gray-600)}.k-lab-example-inspector .k-button:where([data-theme]){--button-color-icon: var(--color-gray-800)}.k-lab-examples>:where(.k-text,.k-box){margin-bottom:var(--spacing-6)}.k-lab-form>footer{border-top:1px dashed var(--color-border);padding-top:var(--spacing-6)}.k-lab-playground-view[data-has-tabs=true] .k-header{margin-bottom:0}.k-lab-examples h2{margin-bottom:var(--spacing-6)}.k-lab-examples *+h2{margin-top:var(--spacing-12)}.k-lab-input-examples .k-lab-example:has(:invalid){outline:2px solid var(--color-red-500);outline-offset:-2px}.k-lab-input-examples-focus .k-lab-example-canvas>.k-button{margin-top:var(--spacing-6)}.k-lab-helpers-examples .k-lab-example .k-text{margin-bottom:var(--spacing-6)}.k-lab-helpers-examples h2{margin-bottom:var(--spacing-3);font-weight:var(--font-bold)}.token.punctuation,.token.comment,.token.doctype{color:var(--color-gray-500)}.token.tag,.token.markup,.token.variable,.token.this,.token.selector,.token.key,.token.kirbytag-bracket,.token.prolog,.token.delimiter{color:var(--color-red-500)}.token.constant,.token.number,.token.boolean,.token.boolean.important,.token.attr-name,.token.kirbytag-attr,.token.kirbytag-name,.token.entity,.token.bold,.token.bold>.punctuation{color:var(--color-orange-500)}.token.keyword,.token.italic,.token.italic>.punctuation{color:var(--color-purple-500)}.token.function{color:var(--color-blue-500)}.token.operator,.token.title{color:var(--color-aqua-500)}.token.string,.token.attr-value,.token.attr-value .punctuation,.token.list.punctuation{color:var(--color-green-500)}.token.scope,.token.class-name,.token.property,.token.url{color:var(--color-yellow-500)}.token.title,.token.kirbytag-bracket,.token.list.punctuation,.token.bold{font-weight:var(--font-bold)}.token.title .punctuation{color:var(--color-gray-500)}.token.italic{font-style:italic} diff --git a/panel/dist/img/icons.svg b/panel/dist/img/icons.svg index b9a176c475..4ac88fe8b5 100644 --- a/panel/dist/img/icons.svg +++ b/panel/dist/img/icons.svg @@ -20,6 +20,9 @@ + + + diff --git a/panel/dist/js/Docs.min.js b/panel/dist/js/Docs.min.js index c835a2397c..7a252c4085 100644 --- a/panel/dist/js/Docs.min.js +++ b/panel/dist/js/Docs.min.js @@ -1 +1 @@ -import{n as t}from"./index.min.js";const e={props:{deprecated:String}};const s=t({mixins:[e]},(function(){var t=this,e=t._self._c;return t.deprecated.length?e("section",{staticClass:"k-lab-docs-section k-lab-docs-deprecated"},[e("k-lab-docs-deprecated",{attrs:{deprecated:t.deprecated}})],1):t._e()}),[],!1,null,null,null,null).exports,l={props:{description:String,since:String}};const a=t({mixins:[l]},(function(){var t,e,s,l=this,a=l._self._c;return(null==(t=l.description)?void 0:t.length)||(null==(e=l.since)?void 0:e.length)?a("section",{staticClass:"k-lab-docs-section"},[a("header",{staticClass:"k-lab-docs-desc-header"},[a("k-headline",{staticClass:"h3"},[l._v("Description")]),(null==(s=l.since)?void 0:s.length)?a("k-text",[l._v(" Since "),a("code",[l._v(l._s(l.since))])]):l._e()],1),a("k-box",{attrs:{theme:"text"}},[a("k-text",{attrs:{html:l.description}})],1)],1):l._e()}),[],!1,null,null,null,null).exports,n={props:{examples:{default:()=>[],type:Array}}};const c=t({mixins:[n]},(function(){var t=this,e=t._self._c;return t.examples.length?e("section",{staticClass:"k-lab-docs-section k-lab-docs-examples"},[e("k-headline",{staticClass:"h3"},[t._v("Examples")]),t._l(t.examples,(function(s,l){return e("k-code",{key:l,attrs:{language:"html"}},[t._v(t._s(s.content))])}))],2):t._e()}),[],!1,null,null,null,null).exports,r={props:{props:{default:()=>[],type:Array}}};const i=t({mixins:[r]},(function(){var t=this,e=t._self._c;return t.props.length?e("section",{staticClass:"k-lab-docs-section"},[e("k-headline",{staticClass:"h3"},[t._v("Props")]),e("div",{staticClass:"k-table"},[e("table",[t._m(0),e("tbody",t._l(t.props,(function(s){var l,a,n,c,r,i,o,d,p;return e("tr",{key:s.name},[e("td",[e("k-text",[e("code",[t._v(t._s(s.name))]),s.required?e("abbr",{staticClass:"k-lab-docs-required"},[t._v("✶")]):t._e(),(null==(l=s.since)?void 0:l.length)?e("div",{staticClass:"k-lab-docs-since"},[t._v(" since "+t._s(s.since)+" ")]):t._e()])],1),e("td",[e("k-lab-docs-types",{attrs:{types:null==(a=s.type)?void 0:a.split("|")}})],1),e("td",[s.default?e("k-text",[e("code",[t._v(t._s(s.default))])]):t._e()],1),e("td",{staticClass:"k-lab-docs-description"},[e("k-lab-docs-deprecated",{attrs:{deprecated:s.deprecated}}),(null==(n=s.description)?void 0:n.length)?e("k-text",{attrs:{html:s.description}}):t._e(),(null==(c=s.value)?void 0:c.length)||(null==(r=s.values)?void 0:r.length)||(null==(i=s.example)?void 0:i.length)?e("k-text",{staticClass:"k-lab-docs-prop-values"},[(null==(o=s.value)?void 0:o.length)?e("dl",[e("dt",[t._v("Value")]),e("dd",[e("code",[t._v(t._s(s.value))])])]):t._e(),(null==(d=s.values)?void 0:d.length)?e("dl",[e("dt",[t._v("Values")]),e("dd",t._l(s.values,(function(s){return e("code",{key:s},[t._v(" "+t._s(s.replaceAll("`",""))+" ")])})),0)]):t._e(),(null==(p=s.example)?void 0:p.length)?e("dl",[e("dt",[t._v("Example")]),e("dd",[e("code",[t._v(t._s(s.example))])])]):t._e()]):t._e()],1)])})),0)])])],1):t._e()}),[function(){var t=this,e=t._self._c;return e("thead",[e("th",{staticStyle:{width:"10rem"}},[t._v("Name")]),e("th",{staticStyle:{width:"10rem"}},[t._v("Type")]),e("th",{staticStyle:{width:"10rem"}},[t._v("Default")]),e("th",[t._v("Description")])])}],!1,null,null,null,null).exports,o={props:{slots:{default:()=>[],type:Array}},computed:{hasBindings(){return this.slots.filter((t=>t.bindings.length)).length}}};const d=t({mixins:[o]},(function(){var t=this,e=t._self._c;return t.slots.length?e("section",{staticClass:"k-lab-docs-section"},[e("k-headline",{staticClass:"h3"},[t._v("Slots")]),e("div",{staticClass:"k-table"},[e("table",[e("thead",[e("th",{staticStyle:{width:"10rem"}},[t._v("Slot")]),e("th",[t._v("Description")]),t.hasBindings?e("th",[t._v("Bindings")]):t._e()]),e("tbody",t._l(t.slots,(function(s){var l;return e("tr",{key:s.name},[e("td",{staticStyle:{width:"12rem"}},[e("k-text",[e("code",[t._v(t._s(s.name))]),(null==(l=s.since)?void 0:l.length)?e("div",{staticClass:"k-lab-docs-since"},[t._v(" since "+t._s(s.since)+" ")]):t._e()])],1),e("td",[e("k-lab-docs-deprecated",{attrs:{deprecated:s.deprecated}}),e("k-text",{attrs:{html:s.description}})],1),t.hasBindings?e("td",[e("k-lab-docs-params",{attrs:{params:s.bindings}})],1):t._e()])})),0)])])],1):t._e()}),[],!1,null,null,null,null).exports,p={props:{events:{default:()=>[],type:Array}},computed:{hasProperties(){return this.events.filter((t=>t.properties.length)).length}}};const u=t({mixins:[p]},(function(){var t=this,e=t._self._c;return t.events.length?e("section",{staticClass:"k-lab-docs-section"},[e("k-headline",{staticClass:"h3"},[t._v("Events")]),e("div",{staticClass:"k-table"},[e("table",[e("thead",[e("th",{staticStyle:{width:"10rem"}},[t._v("Event")]),e("th",[t._v("Description")]),t.hasProperties?e("th",[t._v("Properties")]):t._e()]),e("tbody",t._l(t.events,(function(s){var l;return e("tr",{key:s.name},[e("td",[e("k-text",[e("code",[t._v(t._s(s.name))]),(null==(l=s.since)?void 0:l.length)?e("div",{staticClass:"k-lab-docs-since"},[t._v(" since "+t._s(s.since)+" ")]):t._e()])],1),e("td",[e("k-lab-docs-deprecated",{attrs:{deprecated:s.deprecated}}),e("k-text",{attrs:{html:s.description}})],1),t.hasProperties?e("td",[e("k-lab-docs-params",{attrs:{params:s.properties}})],1):t._e()])})),0)])])],1):t._e()}),[],!1,null,null,null,null).exports,_={props:{methods:{default:()=>[],type:Array}}};const h=t({mixins:[_]},(function(){var t=this,e=t._self._c;return t.methods.length?e("section",{staticClass:"k-lab-docs-section"},[e("k-headline",{staticClass:"h3"},[t._v("Methods")]),e("div",{staticClass:"k-table"},[e("table",[t._m(0),e("tbody",t._l(t.methods,(function(s){var l;return e("tr",{key:s.name},[e("td",[e("k-text",[e("code",[t._v(t._s(s.name))]),(null==(l=s.since)?void 0:l.length)?e("div",{staticClass:"k-lab-docs-since"},[t._v(" since "+t._s(s.since)+" ")]):t._e()])],1),e("td",[e("k-lab-docs-deprecated",{attrs:{deprecated:s.deprecated}}),e("k-text",{attrs:{html:s.description}})],1),e("td",[e("k-lab-docs-params",{attrs:{params:s.params}})],1),e("td",[e("k-lab-docs-types",{attrs:{types:[s.returns]}})],1)])})),0)])])],1):t._e()}),[function(){var t=this,e=t._self._c;return e("thead",[e("th",{staticStyle:{width:"10rem"}},[t._v("Method")]),e("th",[t._v("Description")]),e("th",{staticStyle:{width:"16rem"}},[t._v("Params")]),e("th",{staticStyle:{width:"10rem"}},[t._v("Returns")])])}],!1,null,null,null,null).exports,v={props:{docBlock:String}};const k=t({mixins:[v]},(function(){var t,e=this,s=e._self._c;return(null==(t=e.docBlock)?void 0:t.length)?s("section",{staticClass:"k-lab-docs-section"},[s("header",[s("k-headline",{staticClass:"h3"},[e._v("Further information")])],1),s("k-box",{attrs:{theme:"text"}},[s("k-text",{attrs:{html:e.docBlock}})],1)],1):e._e()}),[],!1,null,null,null,null).exports;const m=t({props:{deprecated:{type:String}}},(function(){var t,e=this,s=e._self._c;return(null==(t=e.deprecated)?void 0:t.length)?s("k-box",{staticClass:"k-lab-docs-deprecated",attrs:{icon:"protected",theme:"warning"}},[s("k-text",{attrs:{html:"Deprecated: "+e.deprecated}})],1):e._e()}),[],!1,null,null,null,null).exports;const b=t({props:{params:{type:Array,default:()=>[]}}},(function(){var t=this,e=t._self._c;return t.params.length?e("ul",{staticClass:"k-labs-docs-params"},t._l(t.params,(function(s){return e("li",{key:s.name},[e("k-text",[e("code",[t._v(t._s(s.name))]),e("k-lab-docs-types",{attrs:{types:[s.type]}}),s.description.length?e("span",{domProps:{innerHTML:t._s(s.description)}}):t._e()],1)],1)})),0):t._e()}),[],!1,null,null,null,null).exports;const x=t({props:{types:{type:Array,default:()=>[]}}},(function(){var t=this,e=t._self._c;return e("k-text",{staticClass:"k-lab-docs-types"},t._l(t.types,(function(s){return e("code",{key:s,attrs:{"data-type":s}},[t._v(" "+t._s(s)+" ")])})),0)}),[],!1,null,null,null,null).exports;Vue.component("k-lab-docs-deprecated",m),Vue.component("k-lab-docs-params",b),Vue.component("k-lab-docs-types",x);const f=t({components:{"k-lab-docs-deprecated":s,"k-lab-docs-description":a,"k-lab-docs-examples":c,"k-lab-docs-props":i,"k-lab-docs-slots":d,"k-lab-docs-events":u,"k-lab-docs-methods":h,"k-lab-docs-docblock":k},mixins:[e,l,n,r,o,p,_,v],props:{component:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-lab-docs"},[e("k-lab-docs-deprecated",{attrs:{deprecated:t.deprecated}}),e("k-lab-docs-description",{attrs:{description:t.description,since:t.since}}),e("k-lab-docs-examples",{attrs:{examples:t.examples}}),e("k-lab-docs-props",{attrs:{props:t.props}}),e("k-lab-docs-slots",{attrs:{slots:t.slots}}),e("k-lab-docs-events",{attrs:{events:t.events}}),e("k-lab-docs-methods",{attrs:{methods:t.methods}}),e("k-lab-docs-docblock",{attrs:{"doc-block":t.docBlock}})],1)}),[],!1,null,null,null,null).exports;export{f as D}; +import{n as t}from"./index.min.js";const e={props:{deprecated:String}};const s=t({mixins:[e]},(function(){var t=this,e=t._self._c;return t.deprecated.length?e("section",{staticClass:"k-lab-docs-section k-lab-docs-deprecated"},[e("k-lab-docs-deprecated",{attrs:{deprecated:t.deprecated}})],1):t._e()}),[]).exports,a={props:{description:String,since:String}};const n=t({mixins:[a]},(function(){var t,e,s,a=this,n=a._self._c;return(null==(t=a.description)?void 0:t.length)||(null==(e=a.since)?void 0:e.length)?n("section",{staticClass:"k-lab-docs-section"},[n("header",{staticClass:"k-lab-docs-desc-header"},[n("k-headline",{staticClass:"h3"},[a._v("Description")]),(null==(s=a.since)?void 0:s.length)?n("k-text",[a._v(" Since "),n("code",[a._v(a._s(a.since))])]):a._e()],1),n("k-box",{attrs:{theme:"text"}},[n("k-text",{attrs:{html:a.description}})],1)],1):a._e()}),[]).exports,c={props:{examples:{default:()=>[],type:Array}}};const r=t({mixins:[c]},(function(){var t=this,e=t._self._c;return t.examples.length?e("section",{staticClass:"k-lab-docs-section k-lab-docs-examples"},[e("k-headline",{staticClass:"h3"},[t._v("Examples")]),t._l(t.examples,(function(s,a){return e("k-code",{key:a,attrs:{language:"html"}},[t._v(t._s(s.content))])}))],2):t._e()}),[]).exports,l={props:{props:{default:()=>[],type:Array}}};const i=t({mixins:[l]},(function(){var t=this,e=t._self._c;return t.props.length?e("section",{staticClass:"k-lab-docs-section"},[e("k-headline",{staticClass:"h3"},[t._v("Props")]),e("div",{staticClass:"k-table"},[e("table",[t._m(0),e("tbody",t._l(t.props,(function(s){var a,n,c,r,l,i,o,d,p;return e("tr",{key:s.name},[e("td",[e("k-text",[e("code",[t._v(t._s(s.name))]),s.required?e("abbr",{staticClass:"k-lab-docs-required"},[t._v("✶")]):t._e(),(null==(a=s.since)?void 0:a.length)?e("div",{staticClass:"k-lab-docs-since"},[t._v(" since "+t._s(s.since)+" ")]):t._e()])],1),e("td",[e("k-lab-docs-types",{attrs:{types:null==(n=s.type)?void 0:n.split("|")}})],1),e("td",[s.default?e("k-text",[e("code",[t._v(t._s(s.default))])]):t._e()],1),e("td",{staticClass:"k-lab-docs-description"},[e("k-lab-docs-deprecated",{attrs:{deprecated:s.deprecated}}),(null==(c=s.description)?void 0:c.length)?e("k-text",{attrs:{html:s.description}}):t._e(),(null==(r=s.value)?void 0:r.length)||(null==(l=s.values)?void 0:l.length)||(null==(i=s.example)?void 0:i.length)?e("k-text",{staticClass:"k-lab-docs-prop-values"},[(null==(o=s.value)?void 0:o.length)?e("dl",[e("dt",[t._v("Value")]),e("dd",[e("code",[t._v(t._s(s.value))])])]):t._e(),(null==(d=s.values)?void 0:d.length)?e("dl",[e("dt",[t._v("Values")]),e("dd",t._l(s.values,(function(s){return e("code",{key:s},[t._v(" "+t._s(s.replaceAll("`",""))+" ")])})),0)]):t._e(),(null==(p=s.example)?void 0:p.length)?e("dl",[e("dt",[t._v("Example")]),e("dd",[e("code",[t._v(t._s(s.example))])])]):t._e()]):t._e()],1)])})),0)])])],1):t._e()}),[function(){var t=this,e=t._self._c;return e("thead",[e("th",{staticStyle:{width:"10rem"}},[t._v("Name")]),e("th",{staticStyle:{width:"10rem"}},[t._v("Type")]),e("th",{staticStyle:{width:"10rem"}},[t._v("Default")]),e("th",[t._v("Description")])])}]).exports,o={props:{slots:{default:()=>[],type:Array}},computed:{hasBindings(){return this.slots.filter((t=>t.bindings.length)).length}}};const d=t({mixins:[o]},(function(){var t=this,e=t._self._c;return t.slots.length?e("section",{staticClass:"k-lab-docs-section"},[e("k-headline",{staticClass:"h3"},[t._v("Slots")]),e("div",{staticClass:"k-table"},[e("table",[e("thead",[e("th",{staticStyle:{width:"10rem"}},[t._v("Slot")]),e("th",[t._v("Description")]),t.hasBindings?e("th",[t._v("Bindings")]):t._e()]),e("tbody",t._l(t.slots,(function(s){var a;return e("tr",{key:s.name},[e("td",{staticStyle:{width:"12rem"}},[e("k-text",[e("code",[t._v(t._s(s.name))]),(null==(a=s.since)?void 0:a.length)?e("div",{staticClass:"k-lab-docs-since"},[t._v(" since "+t._s(s.since)+" ")]):t._e()])],1),e("td",[e("k-lab-docs-deprecated",{attrs:{deprecated:s.deprecated}}),e("k-text",{attrs:{html:s.description}})],1),t.hasBindings?e("td",[e("k-lab-docs-params",{attrs:{params:s.bindings}})],1):t._e()])})),0)])])],1):t._e()}),[]).exports,p={props:{events:{default:()=>[],type:Array}},computed:{hasProperties(){return this.events.filter((t=>t.properties.length)).length}}};const _=t({mixins:[p]},(function(){var t=this,e=t._self._c;return t.events.length?e("section",{staticClass:"k-lab-docs-section"},[e("k-headline",{staticClass:"h3"},[t._v("Events")]),e("div",{staticClass:"k-table"},[e("table",[e("thead",[e("th",{staticStyle:{width:"10rem"}},[t._v("Event")]),e("th",[t._v("Description")]),t.hasProperties?e("th",[t._v("Properties")]):t._e()]),e("tbody",t._l(t.events,(function(s){var a;return e("tr",{key:s.name},[e("td",[e("k-text",[e("code",[t._v(t._s(s.name))]),(null==(a=s.since)?void 0:a.length)?e("div",{staticClass:"k-lab-docs-since"},[t._v(" since "+t._s(s.since)+" ")]):t._e()])],1),e("td",[e("k-lab-docs-deprecated",{attrs:{deprecated:s.deprecated}}),e("k-text",{attrs:{html:s.description}})],1),t.hasProperties?e("td",[e("k-lab-docs-params",{attrs:{params:s.properties}})],1):t._e()])})),0)])])],1):t._e()}),[]).exports,h={props:{methods:{default:()=>[],type:Array}}};const v=t({mixins:[h]},(function(){var t=this,e=t._self._c;return t.methods.length?e("section",{staticClass:"k-lab-docs-section"},[e("k-headline",{staticClass:"h3"},[t._v("Methods")]),e("div",{staticClass:"k-table"},[e("table",[t._m(0),e("tbody",t._l(t.methods,(function(s){var a;return e("tr",{key:s.name},[e("td",[e("k-text",[e("code",[t._v(t._s(s.name))]),(null==(a=s.since)?void 0:a.length)?e("div",{staticClass:"k-lab-docs-since"},[t._v(" since "+t._s(s.since)+" ")]):t._e()])],1),e("td",[e("k-lab-docs-deprecated",{attrs:{deprecated:s.deprecated}}),e("k-text",{attrs:{html:s.description}})],1),e("td",[e("k-lab-docs-params",{attrs:{params:s.params}})],1),e("td",[e("k-lab-docs-types",{attrs:{types:[s.returns]}})],1)])})),0)])])],1):t._e()}),[function(){var t=this,e=t._self._c;return e("thead",[e("th",{staticStyle:{width:"10rem"}},[t._v("Method")]),e("th",[t._v("Description")]),e("th",{staticStyle:{width:"16rem"}},[t._v("Params")]),e("th",{staticStyle:{width:"10rem"}},[t._v("Returns")])])}]).exports,k={props:{docBlock:String}};const u=t({mixins:[k]},(function(){var t,e=this,s=e._self._c;return(null==(t=e.docBlock)?void 0:t.length)?s("section",{staticClass:"k-lab-docs-section"},[s("header",[s("k-headline",{staticClass:"h3"},[e._v("Further information")])],1),s("k-box",{attrs:{theme:"text"}},[s("k-text",{attrs:{html:e.docBlock}})],1)],1):e._e()}),[]).exports;const m=t({props:{deprecated:{type:String}}},(function(){var t,e=this,s=e._self._c;return(null==(t=e.deprecated)?void 0:t.length)?s("k-box",{staticClass:"k-lab-docs-deprecated",attrs:{icon:"protected",theme:"warning"}},[s("k-text",{attrs:{html:"Deprecated: "+e.deprecated}})],1):e._e()}),[]).exports;const b=t({props:{params:{type:Array,default:()=>[]}}},(function(){var t=this,e=t._self._c;return t.params.length?e("ul",{staticClass:"k-labs-docs-params"},t._l(t.params,(function(s){return e("li",{key:s.name},[e("k-text",[e("code",[t._v(t._s(s.name))]),e("k-lab-docs-types",{attrs:{types:[s.type]}}),s.description.length?e("span",{domProps:{innerHTML:t._s(s.description)}}):t._e()],1)],1)})),0):t._e()}),[]).exports;const x=t({props:{types:{type:Array,default:()=>[]}}},(function(){var t=this,e=t._self._c;return e("k-text",{staticClass:"k-lab-docs-types"},t._l(t.types,(function(s){return e("code",{key:s,attrs:{"data-type":s}},[t._v(" "+t._s(s)+" ")])})),0)}),[]).exports;Vue.component("k-lab-docs-deprecated",m),Vue.component("k-lab-docs-params",b),Vue.component("k-lab-docs-types",x);const f=t({components:{"k-lab-docs-deprecated":s,"k-lab-docs-description":n,"k-lab-docs-examples":r,"k-lab-docs-props":i,"k-lab-docs-slots":d,"k-lab-docs-events":_,"k-lab-docs-methods":v,"k-lab-docs-docblock":u},mixins:[e,a,c,l,o,p,h,k],props:{component:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-lab-docs"},[e("k-lab-docs-deprecated",{attrs:{deprecated:t.deprecated}}),e("k-lab-docs-description",{attrs:{description:t.description,since:t.since}}),e("k-lab-docs-examples",{attrs:{examples:t.examples}}),e("k-lab-docs-props",{attrs:{props:t.props}}),e("k-lab-docs-slots",{attrs:{slots:t.slots}}),e("k-lab-docs-events",{attrs:{events:t.events}}),e("k-lab-docs-methods",{attrs:{methods:t.methods}}),e("k-lab-docs-docblock",{attrs:{"doc-block":t.docBlock}})],1)}),[]).exports;export{f as D}; diff --git a/panel/dist/js/DocsView.min.js b/panel/dist/js/DocsView.min.js index 1ad9f61da1..887e7dc8ef 100644 --- a/panel/dist/js/DocsView.min.js +++ b/panel/dist/js/DocsView.min.js @@ -1 +1 @@ -import{D as t}from"./Docs.min.js";import{n as s}from"./index.min.js";import"./vendor.min.js";const o=s({components:{"k-lab-docs":t},props:{component:String,docs:Object,lab:String},mounted(){},methods:{reloadDocs(){this.$panel.view.refresh()}}},(function(){var t=this,s=t._self._c;return s("k-panel-inside",{staticClass:"k-lab-docs-view"},[s("k-header",[t._v(" "+t._s(t.component)+" "),t.docs.github||t.lab?s("k-button-group",{attrs:{slot:"buttons"},slot:"buttons"},[t.lab?s("k-button",{attrs:{icon:"lab",text:"Lab examples",size:"sm",variant:"filled",link:"/lab/"+t.lab}}):t._e(),t.docs.github?s("k-button",{attrs:{icon:"github",size:"sm",variant:"filled",link:t.docs.github,target:"_blank"}}):t._e()],1):t._e()],1),s("k-lab-docs",t._b({},"k-lab-docs",t.docs,!1))],1)}),[],!1,null,null,null,null).exports;export{o as default}; +import{D as t}from"./Docs.min.js";import{n as s}from"./index.min.js";import"./vendor.min.js";const o=s({components:{"k-lab-docs":t},props:{component:String,docs:Object,lab:String},mounted(){},methods:{reloadDocs(){this.$panel.view.refresh()}}},(function(){var t=this,s=t._self._c;return s("k-panel-inside",{staticClass:"k-lab-docs-view"},[s("k-header",[t._v(" "+t._s(t.component)+" "),t.docs.github||t.lab?s("k-button-group",{attrs:{slot:"buttons"},slot:"buttons"},[t.lab?s("k-button",{attrs:{icon:"lab",text:"Lab examples",size:"sm",variant:"filled",link:"/lab/"+t.lab}}):t._e(),t.docs.github?s("k-button",{attrs:{icon:"github",size:"sm",variant:"filled",link:t.docs.github,target:"_blank"}}):t._e()],1):t._e()],1),s("k-lab-docs",t._b({},"k-lab-docs",t.docs,!1))],1)}),[]).exports;export{o as default}; diff --git a/panel/dist/js/Highlight.min.js b/panel/dist/js/Highlight.min.js index f449f197d8..76b89e9c61 100644 --- a/panel/dist/js/Highlight.min.js +++ b/panel/dist/js/Highlight.min.js @@ -1 +1 @@ -import{n as e}from"./index.min.js";import"./vendor.min.js";var t=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,a={},r={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=c.reach);F+=w.value.length,w=w.next){var A=w.value;if(t.length>e.length)return;if(!(A instanceof i)){var $,_=1;if(y){if(!($=s(x,F,e,m))||$.index>=e.length)break;var z=$.index,S=$.index+$[0].length,j=F;for(j+=w.value.length;z>=j;)j+=(w=w.next).value.length;if(F=j-=w.value.length,w.value instanceof i)continue;for(var E=w;E!==t.tail&&(jc.reach&&(c.reach=L);var C=w.prev;if(O&&(C=u(t,C,O),F+=O.length),d(t,C,_),w=u(t,C,new i(g,h?r.tokenize(P,h):P,k,P)),q&&u(t,w,q),_>1){var T={cause:g+","+f,reach:L};l(e,t,n,w.prev,F,T),c&&T.reach>c.reach&&(c.reach=T.reach)}}}}}}function o(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function u(e,t,n){var a=t.next,r={value:n,prev:t,next:a};return t.next=r,a.prev=r,e.length++,r}function d(e,t,n){for(var a=t.next,r=0;r"+i.content+""},!e.document)return e.addEventListener?(r.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),a=n.language,i=n.code,s=n.immediateClose;e.postMessage(r.highlight(i,r.languages[a],a)),s&&e.close()}),!1),r):r;var c=r.util.currentScript();function g(){r.manual||r.highlightAll()}if(c&&(r.filename=c.src,c.hasAttribute("data-manual")&&(r.manual=!0)),!r.manual){var p=document.readyState;"loading"===p||"interactive"===p&&c&&c.defer?document.addEventListener("DOMContentLoaded",g):window.requestAnimationFrame?window.requestAnimationFrame(g):window.setTimeout(g,16)}return r}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});"undefined"!=typeof module&&module.exports&&(module.exports=t),"undefined"!=typeof global&&(global.Prism=t),t.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(e,n){var a={};a["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[n]},a.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:a}};r["language-"+n]={pattern:/[\s\S]+/,inside:t.languages[n]};var i={};i[e]={pattern:RegExp("(<__[^>]*>)(?:))*\\]\\]>|(?!)".replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(e,n){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp("(^|[\"'\\s])(?:"+e+")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))","i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:t.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:[^;{\\s\"']|\\s+(?!\\s)|"+t.source+")*?(?:;|(?=\\s*\\{))"),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|(?:[^\\\\\r\n()\"']|\\\\[^])*)\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp("((?:^|[^$\\w\\xA0-\\uFFFF.\"'\\])\\s]|\\b(?:return|yield))\\s*)/(?:(?:\\[(?:[^\\]\\\\\r\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|/\\*(?:[^*]|\\*(?!/))*\\*/)*(?:$|[\r\n,.;:})\\]]|//))"),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute("on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)","javascript")),t.languages.js=t.languages.javascript,function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,a,r,i){if(n.language===a){var s=n.tokenStack=[];n.code=n.code.replace(r,(function(e){if("function"==typeof i&&!i(e))return e;for(var r,l=s.length;-1!==n.code.indexOf(r=t(a,l));)++l;return s[l]=e,r})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,a){if(n.language===a&&n.tokenStack){n.grammar=e.languages[a];var r=0,i=Object.keys(n.tokenStack);!function s(l){for(var o=0;o=i.length);o++){var u=l[o];if("string"==typeof u||u.content&&"string"==typeof u.content){var d=i[r],c=n.tokenStack[d],g="string"==typeof u?u:u.content,p=t(a,d),f=g.indexOf(p);if(f>-1){++r;var b=g.substring(0,f),h=new e.Token(a,e.tokenize(c,n.grammar),"language-"+a,c),m=g.substring(f+p.length),y=[];b&&y.push.apply(y,s([b])),y.push(h),m&&y.push.apply(y,s([m])),"string"==typeof u?l.splice.apply(l,[o,1].concat(y)):u.content=y}}else u.content&&s(u.content)}return l}(n.tokens)}}}})}(t),function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],a=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,r=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,i=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:a,operator:r,punctuation:i};var s={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},l=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:s}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:s}}];e.languages.insertBefore("php","variable",{string:l,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:l,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:a,operator:r,punctuation:i}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",(function(t){/<\?/.test(t.code)&&e.languages["markup-templating"].buildPlaceholders(t,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")}))}(t),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,a="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",r="(?:[^\\s\\x00-\\x08\\x0e-\\x1f!\"#%&'*,\\-:>?@[\\]`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*".replace(//g,(function(){return"[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]"})),i="\"(?:[^\"\\\\\r\n]|\\\\.)*\"|'(?:[^'\\\\\r\n]|\\\\.)*'";function s(e,t){t=(t||"").replace(/m/g,"")+"m";var n="([:\\-,[{]\\s*(?:\\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\\]|\\}|(?:[\r\n]\\s*)?#))".replace(/<>/g,(function(){return a})).replace(/<>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp("([\\-:]\\s*(?:\\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\\S[^\r\n]*(?:\\2[^\r\n]+)*)".replace(/<>/g,(function(){return a}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp("((?:^|[:\\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\\s*:\\s)".replace(/<>/g,(function(){return a})).replace(/<>/g,(function(){return"(?:"+r+"|"+i+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:s("\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?"),lookbehind:!0,alias:"number"},boolean:{pattern:s("false|true","i"),lookbehind:!0,alias:"important"},null:{pattern:s("null|~","i"),lookbehind:!0,alias:"important"},string:{pattern:s(i),lookbehind:!0,greedy:!0},number:{pattern:s("[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)","i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(t),t.manual=!0;const n=e({mounted(){t.highlightAll(this.$el)},updated(){t.highlightAll(this.$el)},render(){return this.$scopedSlots.default({})}},null,null,!1,null,null,null,null).exports;export{n as default}; +import{n as e}from"./index.min.js";import"./vendor.min.js";var t=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,a=0,n={},r={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=c.reach);F+=w.value.length,w=w.next){var A=w.value;if(t.length>e.length)return;if(!(A instanceof i)){var $,_=1;if(y){if(!($=s(x,F,e,m))||$.index>=e.length)break;var z=$.index,S=$.index+$[0].length,j=F;for(j+=w.value.length;z>=j;)j+=(w=w.next).value.length;if(F=j-=w.value.length,w.value instanceof i)continue;for(var E=w;E!==t.tail&&(jc.reach&&(c.reach=L);var C=w.prev;if(O&&(C=u(t,C,O),F+=O.length),d(t,C,_),w=u(t,C,new i(g,h?r.tokenize(P,h):P,k,P)),q&&u(t,w,q),_>1){var T={cause:g+","+f,reach:L};l(e,t,a,w.prev,F,T),c&&T.reach>c.reach&&(c.reach=T.reach)}}}}}}function o(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function u(e,t,a){var n=t.next,r={value:a,prev:t,next:n};return t.next=r,n.prev=r,e.length++,r}function d(e,t,a){for(var n=t.next,r=0;r"+i.content+""},!e.document)return e.addEventListener?(r.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var a=JSON.parse(t.data),n=a.language,i=a.code,s=a.immediateClose;e.postMessage(r.highlight(i,r.languages[n],n)),s&&e.close()}),!1),r):r;var c=r.util.currentScript();function g(){r.manual||r.highlightAll()}if(c&&(r.filename=c.src,c.hasAttribute("data-manual")&&(r.manual=!0)),!r.manual){var p=document.readyState;"loading"===p||"interactive"===p&&c&&c.defer?document.addEventListener("DOMContentLoaded",g):window.requestAnimationFrame?window.requestAnimationFrame(g):window.setTimeout(g,16)}return r}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});"undefined"!=typeof module&&module.exports&&(module.exports=t),"undefined"!=typeof global&&(global.Prism=t),t.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(e,a){var n={};n["language-"+a]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[a]},n.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:n}};r["language-"+a]={pattern:/[\s\S]+/,inside:t.languages[a]};var i={};i[e]={pattern:RegExp("(<__[^>]*>)(?:))*\\]\\]>|(?!)".replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(e,a){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp("(^|[\"'\\s])(?:"+e+")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))","i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[a,"language-"+a],inside:t.languages[a]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:[^;{\\s\"']|\\s+(?!\\s)|"+t.source+")*?(?:;|(?=\\s*\\{))"),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|(?:[^\\\\\r\n()\"']|\\\\[^])*)\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var a=e.languages.markup;a&&(a.tag.addInlined("style","css"),a.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp("((?:^|[^$\\w\\xA0-\\uFFFF.\"'\\])\\s]|\\b(?:return|yield))\\s*)/(?:(?:\\[(?:[^\\]\\\\\r\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|/\\*(?:[^*]|\\*(?!/))*\\*/)*(?:$|[\r\n,.;:})\\]]|//))"),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute("on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)","javascript")),t.languages.js=t.languages.javascript,function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(a,n,r,i){if(a.language===n){var s=a.tokenStack=[];a.code=a.code.replace(r,(function(e){if("function"==typeof i&&!i(e))return e;for(var r,l=s.length;-1!==a.code.indexOf(r=t(n,l));)++l;return s[l]=e,r})),a.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(a,n){if(a.language===n&&a.tokenStack){a.grammar=e.languages[n];var r=0,i=Object.keys(a.tokenStack);!function s(l){for(var o=0;o=i.length);o++){var u=l[o];if("string"==typeof u||u.content&&"string"==typeof u.content){var d=i[r],c=a.tokenStack[d],g="string"==typeof u?u:u.content,p=t(n,d),f=g.indexOf(p);if(f>-1){++r;var b=g.substring(0,f),h=new e.Token(n,e.tokenize(c,a.grammar),"language-"+n,c),m=g.substring(f+p.length),y=[];b&&y.push.apply(y,s([b])),y.push(h),m&&y.push.apply(y,s([m])),"string"==typeof u?l.splice.apply(l,[o,1].concat(y)):u.content=y}}else u.content&&s(u.content)}return l}(a.tokens)}}}})}(t),function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,a=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],n=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,r=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,i=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:a,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:n,operator:r,punctuation:i};var s={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},l=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:s}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:s}}];e.languages.insertBefore("php","variable",{string:l,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:l,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:a,number:n,operator:r,punctuation:i}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",(function(t){/<\?/.test(t.code)&&e.languages["markup-templating"].buildPlaceholders(t,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")}))}(t),function(e){var t=/[*&][^\s[\]{},]+/,a=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,n="(?:"+a.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+a.source+")?)",r="(?:[^\\s\\x00-\\x08\\x0e-\\x1f!\"#%&'*,\\-:>?@[\\]`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*".replace(//g,(function(){return"[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]"})),i="\"(?:[^\"\\\\\r\n]|\\\\.)*\"|'(?:[^'\\\\\r\n]|\\\\.)*'";function s(e,t){t=(t||"").replace(/m/g,"")+"m";var a="([:\\-,[{]\\s*(?:\\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\\]|\\}|(?:[\r\n]\\s*)?#))".replace(/<>/g,(function(){return n})).replace(/<>/g,(function(){return e}));return RegExp(a,t)}e.languages.yaml={scalar:{pattern:RegExp("([\\-:]\\s*(?:\\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\\S[^\r\n]*(?:\\2[^\r\n]+)*)".replace(/<>/g,(function(){return n}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp("((?:^|[:\\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\\s*:\\s)".replace(/<>/g,(function(){return n})).replace(/<>/g,(function(){return"(?:"+r+"|"+i+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:s("\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?"),lookbehind:!0,alias:"number"},boolean:{pattern:s("false|true","i"),lookbehind:!0,alias:"important"},null:{pattern:s("null|~","i"),lookbehind:!0,alias:"important"},string:{pattern:s(i),lookbehind:!0,greedy:!0},number:{pattern:s("[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)","i"),lookbehind:!0},tag:a,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(t),t.manual=!0;const a=e({mounted(){t.highlightAll(this.$el)},updated(){t.highlightAll(this.$el)},render(){return this.$scopedSlots.default({})}},null,null).exports;export{a as default}; diff --git a/panel/dist/js/IndexView.min.js b/panel/dist/js/IndexView.min.js index b6a13b3ac8..e840b24c05 100644 --- a/panel/dist/js/IndexView.min.js +++ b/panel/dist/js/IndexView.min.js @@ -1 +1 @@ -import{n as e}from"./index.min.js";import"./vendor.min.js";const t=e({props:{categories:Array,info:String,tab:String}},(function(){var e=this,t=e._self._c;return t("k-panel-inside",{staticClass:"k-lab-index-view"},[t("k-header",[e._v("Lab")]),t("k-tabs",{attrs:{tab:e.tab,tabs:[{name:"examples",label:"Examples",link:"/lab"},{name:"docs",label:"Docs",link:"/lab/docs"}]}}),e.info?t("k-box",{attrs:{icon:"question",theme:"info",text:e.info,html:!0}}):e._e(),e._l(e.categories,(function(e){return t("k-section",{key:e.name,attrs:{headline:e.name}},[t("k-collection",{attrs:{items:e.examples,empty:{icon:e.icon,text:"Add examples to "+e.path}}})],1)}))],2)}),[],!1,null,null,null,null).exports;export{t as default}; +import{n as e}from"./index.min.js";import"./vendor.min.js";const t=e({props:{categories:Array,info:String,tab:String}},(function(){var e=this,t=e._self._c;return t("k-panel-inside",{staticClass:"k-lab-index-view"},[t("k-header",[e._v("Lab")]),t("k-tabs",{attrs:{tab:e.tab,tabs:[{name:"examples",label:"Examples",link:"/lab"},{name:"docs",label:"Docs",link:"/lab/docs"}]}}),e.info?t("k-box",{attrs:{icon:"question",theme:"info",text:e.info,html:!0}}):e._e(),e._l(e.categories,(function(e){return t("k-section",{key:e.name,attrs:{headline:e.name}},[t("k-collection",{attrs:{items:e.examples,empty:{icon:e.icon,text:"Add examples to "+e.path}}})],1)}))],2)}),[]).exports;export{t as default}; diff --git a/panel/dist/js/PlaygroundView.min.js b/panel/dist/js/PlaygroundView.min.js index 02545219ef..e83bb605ac 100644 --- a/panel/dist/js/PlaygroundView.min.js +++ b/panel/dist/js/PlaygroundView.min.js @@ -1 +1 @@ -import{D as t}from"./Docs.min.js";import{n as e}from"./index.min.js";import"./vendor.min.js";const n=e({props:{docs:Object},emits:["cancel"],computed:{options(){const t=[{icon:"expand",link:"lab/docs/"+this.docs.component}];return this.docs.github&&t.unshift({icon:"github",link:this.docs.github,target:"_blank"}),t}}},(function(){var t=this,e=t._self._c;return e("k-drawer",t._b({ref:"drawer",staticClass:"k-form-drawer",attrs:{options:t.options},on:{submit:function(e){return t.$emit("cancel")}}},"k-drawer",t.$attrs,!1),[e("k-lab-docs",t._b({},"k-lab-docs",t.docs,!1))],1)}),[],!1,null,null,null,null).exports;const l=e({props:{code:{type:Boolean,default:!0},label:String,flex:Boolean},data:()=>({mode:"preview"}),computed:{component(){return window.UiExamples[this.label]}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-lab-example",attrs:{"data-flex":t.flex,tabindex:"0"}},[e("header",{staticClass:"k-lab-example-header"},[e("h3",{staticClass:"k-lab-example-label"},[t._v(t._s(t.label))]),t.code?e("k-button-group",{staticClass:"k-lab-example-inspector",attrs:{layout:"collapsed"}},[e("k-button",{attrs:{theme:"preview"===t.mode?"info":null,icon:"preview",size:"xs",title:"Preview"},on:{click:function(e){t.mode="preview"}}}),e("k-button",{attrs:{theme:"inspect"===t.mode?"info":null,icon:"code",size:"xs",title:"Vue code"},on:{click:function(e){t.mode="inspect"}}})],1):t._e()],1),"preview"===t.mode?e("div",{staticClass:"k-lab-example-canvas"},[t._t("default")],2):t._e(),"inspect"===t.mode?e("div",{staticClass:"k-lab-example-code"},[e("k-code",{attrs:{language:"html"}},[t._v(t._s(t.component))])],1):t._e()])}),[],!1,null,null,null,null).exports;const a=e({},(function(){return(0,this._self._c)("div",{staticClass:"k-lab-examples"},[this._t("default")],2)}),[],!1,null,null,null,null).exports;const o=e({methods:{submit(t){const e=Object.fromEntries(new FormData(t));this.$panel.dialog.open({component:"k-lab-output-dialog",props:{code:JSON.stringify(e,null,2)}})}}},(function(){var t=this,e=t._self._c;return e("form",{staticClass:"k-lab-form",on:{submit:function(e){return e.preventDefault(),t.submit(e.target)}}},[t._t("default"),e("footer",[e("k-button",{attrs:{type:"submit",icon:"check",theme:"positive",variant:"filled"}},[t._v(" Submit ")])],1)],2)}),[],!1,null,null,null,null).exports;const s=e({props:{code:String,language:{default:"js",type:String}},emits:["cancel"]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({attrs:{size:"large","cancel-button":!1,"submit-button":!1},on:{cancel:function(e){return t.$emit("cancel")}}},"k-dialog",t.$attrs,!1),[e("k-code",{attrs:{language:t.language}},[t._v(t._s(t.code))])],1)}),[],!1,null,null,null,null).exports;const i=e({},(function(){var t=this._self._c;return t("div",{staticClass:"k-table"},[t("table",[t("tbody",[t("tr",[t("td",{staticClass:"k-table-cell",attrs:{"data-mobile":"true"}},[this._t("default")],2)])])])])}),[],!1,null,null,null,null).exports;Vue.component("k-lab-docs",t),Vue.component("k-lab-docs-drawer",n),Vue.component("k-lab-example",l),Vue.component("k-lab-examples",a),Vue.component("k-lab-form",o),Vue.component("k-lab-output-dialog",s),Vue.component("k-lab-table-cell",i);const r=e({props:{docs:String,examples:[Object,Array],file:String,github:String,props:[Object,Array],styles:String,tab:String,tabs:{type:Array,default:()=>[]},template:String,title:String},data:()=>({component:null}),watch:{tab:{handler(){this.createComponent()},immediate:!0}},mounted(){this.$panel.view.path.replace(/lab\//,"")},methods:{async createComponent(){if(!this.file)return;const{default:t}=await import(this.$panel.url(this.file)+"?cache="+Date.now());t.template=this.template,this.component={...t},window.UiExamples=this.examples},openDocs(){this.$panel.drawer.open(`lab/docs/${this.docs}`)},async reloadComponent(){await this.$panel.view.refresh(),this.createComponent()},reloadDocs(){this.$panel.drawer.isOpen&&this.$panel.drawer.refresh()}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-lab-playground-view",attrs:{"data-has-tabs":t.tabs.length>1}},[e("k-header",{scopedSlots:t._u([{key:"buttons",fn:function(){return[t.docs||t.github?e("k-button-group",[t.docs?e("k-button",{attrs:{text:t.docs,icon:"book",size:"sm",variant:"filled"},on:{click:t.openDocs}}):t._e(),t.github?e("k-button",{attrs:{link:t.github,icon:"github",size:"sm",target:"_blank",variant:"filled"}}):t._e()],1):t._e()]},proxy:!0}])},[t._v(" "+t._s(t.title)+" ")]),e("k-tabs",{attrs:{tab:t.tab,tabs:t.tabs}}),t.component?e(t.component,t._b({tag:"component"},"component",t.props,!1)):t._e(),t.styles?e("style",{tag:"component",domProps:{innerHTML:t._s(t.styles)}}):t._e()],1)}),[],!1,null,null,null,null).exports;export{r as default}; +import{D as t}from"./Docs.min.js";import{n as e}from"./index.min.js";import"./vendor.min.js";const a=e({props:{docs:Object},emits:["cancel"],computed:{options(){const t=[{icon:"expand",link:"lab/docs/"+this.docs.component}];return this.docs.github&&t.unshift({icon:"github",link:this.docs.github,target:"_blank"}),t}}},(function(){var t=this,e=t._self._c;return e("k-drawer",t._b({ref:"drawer",staticClass:"k-form-drawer",attrs:{options:t.options},on:{submit:function(e){return t.$emit("cancel")}}},"k-drawer",t.$attrs,!1),[e("k-lab-docs",t._b({},"k-lab-docs",t.docs,!1))],1)}),[]).exports;const o=e({props:{code:{type:Boolean,default:!0},label:String,flex:Boolean},data:()=>({mode:"preview"}),computed:{component(){return window.UiExamples[this.label]}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-lab-example",attrs:{"data-flex":t.flex,tabindex:"0"}},[e("header",{staticClass:"k-lab-example-header"},[e("h3",{staticClass:"k-lab-example-label"},[t._v(t._s(t.label))]),t.code?e("k-button-group",{staticClass:"k-lab-example-inspector",attrs:{layout:"collapsed"}},[e("k-button",{attrs:{theme:"preview"===t.mode?"info":null,icon:"preview",size:"xs",title:"Preview"},on:{click:function(e){t.mode="preview"}}}),e("k-button",{attrs:{theme:"inspect"===t.mode?"info":null,icon:"code",size:"xs",title:"Vue code"},on:{click:function(e){t.mode="inspect"}}})],1):t._e()],1),"preview"===t.mode?e("div",{staticClass:"k-lab-example-canvas"},[t._t("default")],2):t._e(),"inspect"===t.mode?e("div",{staticClass:"k-lab-example-code"},[e("k-code",{attrs:{language:"html"}},[t._v(t._s(t.component))])],1):t._e()])}),[]).exports;const s=e({},(function(){return(0,this._self._c)("div",{staticClass:"k-lab-examples"},[this._t("default")],2)}),[]).exports;const n=e({methods:{submit(t){const e=Object.fromEntries(new FormData(t));this.$panel.dialog.open({component:"k-lab-output-dialog",props:{code:JSON.stringify(e,null,2)}})}}},(function(){var t=this,e=t._self._c;return e("form",{staticClass:"k-lab-form",on:{submit:function(e){return e.preventDefault(),t.submit(e.target)}}},[t._t("default"),e("footer",[e("k-button",{attrs:{type:"submit",icon:"check",theme:"positive",variant:"filled"}},[t._v(" Submit ")])],1)],2)}),[]).exports;const i=e({props:{code:String,language:{default:"js",type:String}},emits:["cancel"]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({attrs:{size:"large","cancel-button":!1,"submit-button":!1},on:{cancel:function(e){return t.$emit("cancel")}}},"k-dialog",t.$attrs,!1),[e("k-code",{attrs:{language:t.language}},[t._v(t._s(t.code))])],1)}),[]).exports;const l=e({},(function(){var t=this._self._c;return t("div",{staticClass:"k-table"},[t("table",[t("tbody",[t("tr",[t("td",{staticClass:"k-table-cell",attrs:{"data-mobile":"true"}},[this._t("default")],2)])])])])}),[]).exports;Vue.component("k-lab-docs",t),Vue.component("k-lab-docs-drawer",a),Vue.component("k-lab-example",o),Vue.component("k-lab-examples",s),Vue.component("k-lab-form",n),Vue.component("k-lab-output-dialog",i),Vue.component("k-lab-table-cell",l);const r=e({props:{docs:String,examples:[Object,Array],file:String,github:String,props:[Object,Array],styles:String,tab:String,tabs:{type:Array,default:()=>[]},template:String,title:String},data:()=>({component:null}),watch:{tab:{handler(){this.createComponent()},immediate:!0}},mounted(){this.$panel.view.path.replace(/lab\//,"")},methods:{async createComponent(){if(!this.file)return;const{default:t}=await import(this.$panel.url(this.file)+"?cache="+Date.now());t.template=this.template,this.component={...t},window.UiExamples=this.examples},openDocs(){this.$panel.drawer.open(`lab/docs/${this.docs}`)},async reloadComponent(){await this.$panel.view.refresh(),this.createComponent()},reloadDocs(){this.$panel.drawer.isOpen&&this.$panel.drawer.refresh()}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-lab-playground-view",attrs:{"data-has-tabs":t.tabs.length>1}},[e("k-header",{scopedSlots:t._u([{key:"buttons",fn:function(){return[t.docs||t.github?e("k-button-group",[t.docs?e("k-button",{attrs:{text:t.docs,icon:"book",size:"sm",variant:"filled"},on:{click:t.openDocs}}):t._e(),t.github?e("k-button",{attrs:{link:t.github,icon:"github",size:"sm",target:"_blank",variant:"filled"}}):t._e()],1):t._e()]},proxy:!0}])},[t._v(" "+t._s(t.title)+" ")]),e("k-tabs",{attrs:{tab:t.tab,tabs:t.tabs}}),t.component?e(t.component,t._b({tag:"component"},"component",t.props,!1)):t._e(),t.styles?e("style",{tag:"component",domProps:{innerHTML:t._s(t.styles)}}):t._e()],1)}),[]).exports;export{r as default}; diff --git a/panel/dist/js/container-query-polyfill.modern.min.js b/panel/dist/js/container-query-polyfill.modern.min.js index 94adb9a4a7..7053dd7bc9 100644 --- a/panel/dist/js/container-query-polyfill.modern.min.js +++ b/panel/dist/js/container-query-polyfill.modern.min.js @@ -1 +1 @@ -function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?{type:2,value:n/r}:{type:1};case 6:return null!=n&&null!=r?{type:4,value:r>=n?"portrait":"landscape"}:{type:1}}}function n(e,t){switch(e.type){case 1:case 2:case 3:case 4:return i(e,t);case 5:{const n=t.sizeFeatures.get(e.feature);return null==n?{type:1}:n}case 6:return e.value}}function r(e){return{type:5,value:e}}function u(e,t,n){return r(function(e,t,n){switch(n){case 1:return e===t;case 2:return e>t;case 3:return e>=t;case 4:return ee*t))}return null}function c(e,t){switch(e.type){case 2:return 0===e.value?0:null;case 3:return l(e,t)}return null}function i(e,t){switch(e.type){case 4:return function(e,t){const o=n(e.left,t),s=n(e.right,t),l=e.operator;if(4===o.type&&4===s.type||5===o.type&&5===s.type)return i=o,a=s,1===l?r(i.value===a.value):{type:1};var i,a;if(3===o.type||3===s.type){const e=c(o,t),n=c(s,t);if(null!=e&&null!=n)return u(e,n,l)}else if(2===o.type&&2===s.type)return u(o.value,s.value,l);return{type:1}}(e,t);case 2:return function(e,t){const n=i(e.left,t);return 5!==n.type||!0!==n.value?n:i(e.right,t)}(e,t);case 3:return function(e,t){const n=i(e.left,t);return 5===n.type&&!0===n.value?n:i(e.right,t)}(e,t);case 1:{const n=i(e.value,t);return 5===n.type?{type:5,value:!n.value}:{type:1}}case 5:return a(n(e,t));case 6:return a(e.value)}}function a(e){switch(e.type){case 5:return e;case 2:case 3:return{type:5,value:e.value>0}}return{type:1}}const f=Array.from({length:4},(()=>Math.floor(256*Math.random()).toString(16))).join(""),p=S("container"),y=S("container-type"),h=S("container-name"),v=`data-cqs-${f}`,d=`data-cqc-${f}`,m=S("cqw"),w=S("cqh"),g=S("cqi"),b=S("cqb");function S(e){return`--cq-${e}-${f}`}const x=Symbol();function q(e,t){const n={value:t,errorIndices:[],index:-1,at(r){const u=n.index+r;return u>=e.length?t:e[u]},consume:e=>(n.index+=e,n.value=n.at(0),n.value),reconsume(){n.index-=1},error(){n.errorIndices.push(n.index)}};return n}function C(e){return q(e,{type:0})}function*$(e){const t=[];let n=!1;for(const b of e){const e=b.codePointAt(0);n&&10!==e&&(n=!1,t.push(10)),0===e||e>=55296&&e<=57343?t.push(65533):13===e?n=!0:t.push(e)}const r=q(t,-1),{at:u,consume:o,error:s,reconsume:l}=r;function c(){return String.fromCodePoint(r.value)}function i(){return{type:13,value:c()}}function a(){for(;z(u(1));)o(1)}function f(){for(;-1!==r.value;)if(o(1),42===u(0)&&47===u(1))return void o(1);s()}function p(){const[e,t]=function(){let e=0,t="",n=u(1);for(43!==n&&45!==n||(o(1),t+=c());k(u(1));)o(1),t+=c();if(46===u(1)&&k(u(2)))for(e=1,o(1),t+=c();k(u(1));)o(1),t+=c();if(n=u(1),69===n||101===n){const n=u(2);if(k(n))for(e=1,o(1),t+=c();k(u(1));)o(1),t+=c();else if((45===n||43===n)&&k(u(3)))for(e=1,o(1),t+=c(),o(1),t+=c();k(u(1));)o(1),t+=c()}return[t,e]}(),n=u(1);return d(n,u(1),u(2))?{type:15,value:e,flag:t,unit:w()}:37===n?(o(1),{type:16,value:e}):{type:17,value:e,flag:t}}function y(){const e=w();let t=u(1);if("url"===e.toLowerCase()&&40===t){for(o(1);z(u(1))&&z(u(2));)o(1);t=u(1);const n=u(2);return 34===t||39===t?{type:23,value:e}:!z(t)||34!==n&&39!==n?function(){let e="";for(a();;){const n=o(1);if(41===n)return{type:20,value:e};if(-1===n)return s(),{type:20,value:e};if(z(n)){a();const t=u(1);return 41===t||-1===t?(o(1),-1===n&&s(),{type:20,value:e}):(g(),{type:21})}if(34===n||39===n||40===n||(t=n)>=0&&t<=8||11===t||t>=14&&t<=31||127===t)return s(),g(),{type:21};if(92===n){if(!j(n,u(1)))return s(),{type:21};e+=v()}else e+=c()}var t}():{type:23,value:e}}return 40===t?(o(1),{type:23,value:e}):{type:24,value:e}}function h(e){let t="";for(;;){const n=o(1);if(-1===n||n===e)return-1===n&&s(),{type:2,value:t};if(E(n))return s(),l(),{type:3};if(92===n){const e=u(1);if(-1===e)continue;E(e)?o(1):t+=v()}else t+=c()}}function v(){const e=o(1);if(A(e)){const t=[e];for(let e=0;e<5;e++){const e=u(1);if(!A(e))break;t.push(e),o(1)}z(u(1))&&o(1);let n=parseInt(String.fromCodePoint(...t),16);return(0===n||n>=55296&&n<=57343||n>1114111)&&(n=65533),String.fromCodePoint(n)}return-1===e?(s(),String.fromCodePoint(65533)):c()}function d(e,t,n){return 45===e?L(t)||45===t||j(t,n):!!L(e)}function m(e,t,n){return 43===e||45===e?k(t)||46===t&&k(n):!(46!==e||!k(t))||!!k(e)}function w(){let e="";for(;;){const t=o(1);if(M(t))e+=c();else{if(!j(t,u(1)))return l(),e;e+=v()}}}function g(){for(;;){const e=o(1);if(-1===e)return;j(e,u(1))&&v()}}for(;;){const e=o(1);if(47===e&&42===u(1))o(2),f();else if(z(e))a(),yield{type:1};else if(34===e)yield h(e);else if(35===e){const e=u(1);M(e)||j(e,u(2))?yield{type:14,flag:d(u(1),u(2),u(3))?1:0,value:w()}:yield i()}else if(39===e)yield h(e);else if(40===e)yield{type:4};else if(41===e)yield{type:5};else if(43===e)m(e,u(1),u(2))?(l(),yield p()):yield i();else if(44===e)yield{type:6};else if(45===e){const t=u(1),n=u(2);m(e,t,n)?(l(),yield p()):45===t&&62===n?(o(2),yield{type:19}):d(e,t,n)?(l(),yield y()):yield i()}else if(46===e)m(e,u(1),u(2))?(l(),yield p()):yield i();else if(58===e)yield{type:7};else if(59===e)yield{type:8};else if(60===e)33===u(1)&&45===u(2)&&45===u(3)?yield{type:18}:yield i();else if(64===e)if(d(u(1),u(2),u(3))){const e=w();yield{type:22,value:e}}else yield i();else if(91===e)yield{type:9};else if(92===e)j(e,u(1))?(l(),yield y()):(s(),yield i());else if(93===e)yield{type:10};else if(123===e)yield{type:11};else if(125===e)yield{type:12};else if(k(e))l(),yield p();else if(L(e))l(),yield y();else{if(-1===e)return yield{type:0},r.errorIndices;yield{type:13,value:c()}}}}function k(e){return e>=48&&e<=57}function A(e){return k(e)||e>=65&&e<=70||e>=97&&e<=102}function E(e){return 10===e||13===e||12===e}function z(e){return E(e)||9===e||32===e}function L(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128||95===e}function j(e,t){return 92===e&&!E(t)}function M(e){return L(e)||k(e)||45===e}const T={11:12,9:10,4:5};function P(t,n){const r=function(e,t){const n=[];for(;;)switch(e.consume(1).type){case 1:break;case 0:return{type:3,value:n};case 18:case 19:if(!1!==t){e.reconsume();const t=U(e);t!==x&&n.push(t)}break;case 22:e.reconsume(),n.push(F(e));break;default:{e.reconsume();const t=U(e);t!==x&&n.push(t);break}}}(C(t),!0===n);return e({},r,{value:r.value.map((t=>{return 26===t.type?0===(n=t).value.value.type?e({},n,{value:e({},n.value,{value:(r=n.value.value.value,function(e){const t=[],n=[];for(;;){const r=e.consume(1);switch(r.type){case 1:case 8:break;case 0:return{type:1,value:[...n,...t]};case 22:e.reconsume(),t.push(F(e));break;case 24:{const t=[r];let u=e.at(1);for(;8!==u.type&&0!==u.type;)t.push(I(e)),u=e.at(1);const o=R(C(t));o!==x&&n.push(o);break}case 13:if("&"===r.value){e.reconsume();const n=U(e);n!==x&&t.push(n);break}default:{e.error(),e.reconsume();let t=e.at(1);for(;8!==t.type&&0!==t.type;)I(e),t=e.at(1);break}}}}(C(r)))})}):n:t;var n,r}))})}function N(e){const t=C(e),n=[];for(;;){if(0===t.consume(1).type)return n;t.reconsume(),n.push(I(t))}}function O(e){for(;1===e.at(1).type;)e.consume(1)}function F(e){let t=e.consume(1);if(22!==t.type)throw new Error(`Unexpected type ${t.type}`);const n=t.value,r=[];for(;;)switch(t=e.consume(1),t.type){case 8:return{type:25,name:n,prelude:r,value:null};case 0:return e.error(),{type:25,name:n,prelude:r,value:null};case 11:return{type:25,name:n,prelude:r,value:Q(e)};case 28:if(11===t.source.type)return{type:25,name:n,prelude:r,value:t};default:e.reconsume(),r.push(I(e))}}function U(e){let t=e.value;const n=[];for(;;)switch(t=e.consume(1),t.type){case 0:return e.error(),x;case 11:return{type:26,prelude:n,value:Q(e)};case 28:if(11===t.source.type)return{type:26,prelude:n,value:t};default:e.reconsume(),n.push(I(e))}}function R(e){const t=e.consume(1);if(24!==t.type)throw new Error(`Unexpected type ${t.type}`);const n=t.value,r=[];let u=!1;if(O(e),7!==e.at(1).type)return e.error(),x;for(e.consume(1),O(e);0!==e.at(1).type;)r.push(I(e));const o=r[r.length-2],s=r[r.length-1];return o&&13===o.type&&"!"===o.value&&24===s.type&&"important"===s.value.toLowerCase()&&(u=!0,r.splice(r.length-2)),{type:29,name:n,value:r,important:u}}function I(e){const t=e.consume(1);switch(t.type){case 11:case 9:case 4:return Q(e);case 23:return function(e){let t=e.value;if(23!==t.type)throw new Error(`Unexpected type ${t.type}`);const n=t.value,r=[];for(;;)switch(t=e.consume(1),t.type){case 5:return{type:27,name:n,value:r};case 0:return e.error(),{type:27,name:n,value:r};default:e.reconsume(),r.push(I(e))}}(e);default:return t}}function Q(e){let t=e.value;const n=t,r=T[n.type];if(!r)throw new Error(`Unexpected type ${t.type}`);const u=[];for(;;)switch(t=e.consume(1),t.type){case r:return{type:28,source:n,value:{type:0,value:u}};case 0:return e.error(),{type:28,source:n,value:{type:0,value:u}};default:e.reconsume(),u.push(I(e))}}function H(e){return O(e),0===e.at(1).type}const V={11:["{","}"],9:["[","]"],4:["(",")"]};function D(e,t){switch(e.type){case 25:return`@${CSS.escape(e.name)} ${e.prelude.map((e=>D(e))).join("")}${e.value?D(e.value):";"}`;case 26:return`${e.prelude.map((e=>D(e))).join("")}${D(e.value)}`;case 28:{const[t,n]=V[e.source.type];return`${t}${W(e.value)}${n}`}case 27:return`${CSS.escape(e.name)}(${e.value.map((e=>D(e))).join("")})`;case 29:return`${CSS.escape(e.name)}:${e.value.map((e=>D(e))).join("")}${e.important?" !important":""}`;case 1:return" ";case 8:return";";case 7:return":";case 14:return"#"+CSS.escape(e.value);case 24:return CSS.escape(e.value);case 15:return e.value+CSS.escape(e.unit);case 13:case 17:return e.value;case 2:return`"${CSS.escape(e.value)}"`;case 6:return",";case 20:return"url("+CSS.escape(e.value)+")";case 22:return"@"+CSS.escape(e.value);case 16:return e.value+"%";default:throw new Error(`Unsupported token ${e.type}`)}}function W(e,t){return e.value.map((t=>{let n=D(t);return 29===t.type&&0!==e.type&&(n+=";"),n})).join("")}function _(e){return D(e)}function B(e){const t=e.at(1);return 13===t.type&&"="===t.value&&(e.consume(1),!0)}function G(e,t){const n=[];for(;;){const r=e.at(1);if(0===r.type||t&&7===r.type||13===r.type&&(">"===r.value||"<"===r.value||"="===r.value))break;n.push(e.consume(1))}return n}function Y(e){O(e);const t=e.consume(1);return 13!==t.type?x:">"===t.value?B(e)?3:2:"<"===t.value?B(e)?5:4:"="===t.value?1:x}function J(e){return 4===e||5===e}function K(e){return 2===e||3===e}function X(e,t,n){const r=function(e){O(e);const t=e.consume(1);return O(e),24!==t.type||0!==e.at(1).type?x:t.value}(C(e));if(r===x)return x;let u=r.toLowerCase();return u=n?n(u):u,t.has(u)?u:x}function Z(e){return{type:13,value:e}}function ee(e,t){return{type:29,name:e,value:t,important:!1}}function te(e){return{type:24,value:e}}function ne(e,t){return{type:27,name:e,value:t}}function re(e){return ne("var",[te(e)])}function ue(e,t){O(e);let n=!1,r=e.at(1);if(24===r.type){if("not"!==r.value.toLowerCase())return x;e.consume(1),O(e),n=!0}let u=function(e){const t=e.consume(1);switch(t.type){case 28:{if(4!==t.source.type)return x;const e=ue(C(t.value.value),null);return e!==x?e:{type:4,value:t}}case 27:return{type:4,value:t};default:return x}}(e);if(u===x)return x;u=n?{type:1,value:u}:u,O(e),r=e.at(1);const o=24===r.type?r.value.toLowerCase():null;if(null!==o){if(e.consume(1),O(e),"and"!==o&&"or"!==o||null!==t&&o!==t)return x;const n=ue(e,o);return n===x?x:{type:"and"===o?2:3,left:u,right:n}}return H(e)?u:x}function oe(e){return ue(e,null)}function se(e){switch(e.type){case 1:return[te("not"),{type:1},...se(e.value)];case 2:case 3:return[...se(e.left),{type:1},te(2===e.type?"and":"or"),{type:1},...se(e.right)];case 4:return[e.value]}}const le={width:1,height:2,"inline-size":3,"block-size":4,"aspect-ratio":5,orientation:6},ce=new Set(Object.keys(le)),ie=new Set(["none","and","not","or","normal","auto"]),ae=new Set(["initial","inherit","revert","revert-layer","unset"]),fe=new Set(["size","inline-size"]);function pe(e,t,n,r){const u=n();if(u===x)return x;let o=[u,null];O(e);const s=e.at(1);if(13===s.type){if(s.value!==t)return x;e.consume(1),O(e);const n=r();O(e),n!==x&&(o=[u,n])}return H(e)?o:x}function ye(e){const t=e.consume(1);return 17===t.type?parseInt(t.value):x}function he(e){const t=C(e);O(t);const n=t.consume(1);let r=x;switch(n.type){case 17:t.reconsume(),r=function(e){const t=pe(e,"/",(()=>ye(e)),(()=>ye(e)));return t===x?x:{type:2,value:t[0]/(null!==t[1]?t[1]:1)}}(t);break;case 15:r={type:3,value:parseInt(n.value),unit:n.unit.toLowerCase()};break;case 24:{const e=n.value.toLowerCase();switch(e){case"landscape":case"portrait":r={type:4,value:e}}}}return r===x?x:H(t)?{type:6,value:r}:x}function ve(e){return!we(e=e.toLowerCase())&&!ie.has(e)}function de(e,t){const n=[];for(;;){O(e);const r=e.at(1);if(24!==r.type||!t(r.value))return n;e.consume(1),n.push(r.value)}}function me(e){const t=[];for(;;){O(e);const n=e.at(1);if(24!==n.type)break;const r=n.value;if(!ve(r))break;e.consume(1),t.push(r)}return t}function we(e){return ae.has(e)}function ge(e){return e.map((e=>"cq-"+e))}function be(e){const t=de(e,(e=>we(e)));return 1===t.length?ge(t):x}function Se(e,t){const n=de(e,(e=>"none"===e));if(1===n.length)return ge(n);if(0!==n.length)return x;if(t){const t=be(e);if(t!==x)return t}const r=me(e);return r.length>0&&(!t||H(e))?r:x}function xe(e,t){if(t){const t=be(e);if(t!==x)return t}return function(e){const t=de(e,(e=>"normal"===e));if(1===t.length)return ge(t);if(0!==t.length)return x;const n=de(e,(e=>fe.has(e)));return n.length>0&&H(e)?n:x}(e)}function qe(e){const t=C(e),n=be(t);if(n!==x)return[n,n];const r=pe(t,"/",(()=>Se(t,!1)),(()=>xe(t,!1)));return r!==x&&H(t)?[r[0],r[1]||[]]:x}function Ce(e){const t=C(e),n=me(t);if(!n||n.length>1)return x;const r=oe(t);if(r===x)return x;const u={features:new Set},o=$e(r,u);return H(t)?{name:n.length>0?n[0]:null,condition:o,features:u.features}:x}function $e(e,t){switch(e.type){case 1:return{type:1,value:$e(e.value,t)};case 2:case 3:return{type:2===e.type?2:3,left:$e(e.left,t),right:$e(e.right,t)};case 4:if(28===e.value.type){const n=function(e,t){const n=function(e,t){const n=G(e,!0),r=e.at(1);if(0===r.type){const e=X(n,t);return e!==x&&t.has(e)?{type:1,feature:e}:x}if(7===r.type){e.consume(1);const r=G(e,!1);let u=1;const o=X(n,t,(e=>e.startsWith("min-")?(u=3,e.substring(4)):e.startsWith("max-")?(u=5,e.substring(4)):e));return o!==x?{type:2,feature:o,bounds:[null,[u,r]]}:x}const u=Y(e);if(u===x)return x;const o=G(e,!1);if(0===e.at(1).type){const e=X(n,t);if(e!==x)return{type:2,feature:e,bounds:[null,[u,o]]};const r=X(o,t);return r!==x?{type:2,feature:r,bounds:[[u,n],null]}:x}const s=Y(e);if(s===x||!(K(u)&&K(s)||J(u)&&J(s)))return x;const l=G(e,!1),c=X(o,t);return c!==x?{type:2,feature:c,bounds:[[u,n],[s,l]]}:x}(e,ce);if(n===x)return x;const r=le[n.feature];if(null==r)return x;if(t.features.add(r),1===n.type)return{type:5,feature:r};{const e={type:5,feature:r};let t=x;if(null!==n.bounds[0]){const r=he(n.bounds[0][1]);if(r===x)return x;t={type:4,operator:n.bounds[0][0],left:r,right:e}}if(null!==n.bounds[1]){const r=he(n.bounds[1][1]);if(r===x)return x;const u={type:4,operator:n.bounds[1][0],left:e,right:r};t=t!==x?{type:2,left:t,right:u}:u}return t}}(C(e.value.value.value),t);if(n!==x)return n}return{type:6,value:{type:1}}}}let ke=0;const Ae={cqw:m,cqh:w,cqi:g,cqb:b},Ee=CSS.supports("selector(:where(div))"),ze=":not(.container-query-polyfill)";N(Array.from($(ze)));const Le=document.createElement("div"),je=new Set(["before","after","first-line","first-letter"]);function Me(e,t){return ne("calc",[{type:17,flag:e.flag,value:e.value},Z("*"),t])}function Te(t){return t.map((t=>{switch(t.type){case 15:return function(e){const t=e.unit,n=Ae[t];return null!=n?Me(e,re(n)):"cqmin"===t||"cqmax"===t?Me(e,ne(e.unit.slice(2),[re(g),{type:6},re(b)])):e}(t);case 27:return e({},t,{value:Te(t.value)})}return t}))}function Pe(t){switch(t.name){case"container":return qe(t.value)?e({},t,{name:p}):t;case"container-name":return Se(C(t.value),!0)?e({},t,{name:h}):t;case"container-type":return null!=xe(C(t.value),!0)?e({},t,{name:y}):t}return e({},t,{value:Te(t.value)})}function Ne(t,n){return e({},t,{value:t.value.map((t=>{switch(t.type){case 25:return Qe(t,n);case 26:return r=t,(u=n).transformStyleRule(e({},r,{value:Ue(r.value,u)}));default:return t}var r,u}))})}function Oe(e){return 0===e.type||6===e.type}function Fe(e){for(let t=e.length-1;t>=0;t--)if(1!==e[t].type)return e.slice(0,t+1);return e}function Ue(t,n){return function(t,n){const r=[];let u=null,o=null;for(const e of t.value.value)switch(e.type){case 25:{const t=n?n(e):e;t&&r.push(t)}break;case 29:{const t=Pe(e);switch(t.name){case p:{const t=qe(e.value);t!==x&&(u=t[0],o=t[1]);break}case h:{const t=Se(C(e.value),!0);t!==x&&(u=t);break}case y:{const t=xe(C(e.value),!0);t!==x&&(o=t);break}default:r.push(t)}}}return u&&u.length>0&&r.push(ee(h,[te(u.join(" "))])),o&&o.length>0&&r.push(ee(y,[te(o.join(" "))])),e({},t,{value:{type:2,value:r}})}(t,(e=>Qe(e,n)))}function Re(t){if(1===t.type)return e({},t,{value:Re(t.value)});if(2===t.type||3===t.type)return e({},t,{left:Re(t.left),right:Re(t.right)});if(4===t.type&&28===t.value.type){const n=function(e){const t=C(e);return O(t),24!==t.at(1).type?x:R(t)||x}(t.value.value.value);if(n!==x)return e({},t,{value:e({},t.value,{value:{type:0,value:[Pe(n)]}})})}return t}function Ie(t,n){let r=oe(C(t.prelude));return r=r!==x?Re(r):x,e({},t,{prelude:r!==x?se(r):t.prelude,value:t.value?e({},t.value,{value:Ne(P(t.value.value.value),n)}):null})}function Qe(t,n){switch(t.name.toLocaleLowerCase()){case"media":case"layer":return u=n,e({},r=t,{value:r.value?e({},r.value,{value:Ne(P(r.value.value.value),u)}):null});case"keyframes":return function(t,n){let r=null;return t.value&&(r=e({},t.value,{value:{type:3,value:P(t.value.value.value).value.map((t=>{switch(t.type){case 26:return u=n,e({},r=t,{value:Ue(r.value,u)});case 25:return Qe(t,n)}var r,u}))}})),e({},t,{value:r})}(t,n);case"supports":return Ie(t,n);case"container":return function(t,n){if(t.value){const r=Ce(t.prelude);if(r!==x){const u={rule:r,selector:null,parent:n.parent,uid:"c"+ke++},o=new Set,s=[],l=Ne(P(t.value.value.value),{descriptors:n.descriptors,parent:u,transformStyleRule:t=>{const[n,r]=function(e,t){const n=C(e),r=[],u=[];for(;;){if(0===n.at(1).type)return[r,u];const c=Math.max(0,n.index);for(;o=n.at(1),l=n.at(2),!(Oe(o)||7===o.type&&(7===l.type||24===l.type&&je.has(l.value.toLowerCase())));)n.consume(1);const i=n.index+1,a=e.slice(c,i),f=a.length>0?Fe(a):[Z("*")];for(;!Oe(n.at(1));)n.consume(1);const p=e.slice(i,Math.max(0,n.index+1));let y=f,h=[{type:28,source:{type:9},value:{type:0,value:[te(p.length>0?v:d),Z("~"),Z("="),{type:2,value:t}]}}];if(Ee)h=[Z(":"),ne("where",h)];else{const e=f.map(_).join("");e.endsWith(ze)?y=N(Array.from($(e.substring(0,e.length-ze.length)))):s.push({actual:e,expected:e+ze})}r.push(...f),u.push(...y),u.push(...h),u.push(...p),n.consume(1)}var o,l}(t.prelude,u.uid);if(s.length>0)return t;const l=n.map(_).join("");try{Le.matches(l),o.add(l)}catch(c){}return e({},t,{prelude:r})}}).value;if(s.length>0){const e=new Set,t=[];let n=0;for(const{actual:u}of s)n=Math.max(n,u.length);const r=Array.from({length:n},(()=>" ")).join("");for(const{actual:u,expected:o}of s)e.has(u)||(t.push(`${u}${r.substring(0,n-u.length)} => ${o}`),e.add(u));console.warn(`The :where() pseudo-class is not supported by this browser. To use the Container Query Polyfill, you must modify the selectors under your @container rules:\n\n${t.join("\n")}`)}return o.size>0&&(u.selector=Array.from(o).join(", ")),n.descriptors.push(u),{type:25,name:"media",prelude:[te("all")],value:e({},t.value,{value:{type:3,value:l}})}}}return t}(t,n)}var r,u;return t}class He{constructor(e){this.value=void 0,this.value=e}}function Ve(e,t){if(e===t)return!0;if(typeof e==typeof t&&null!==e&&null!==t&&"object"==typeof e){if(Array.isArray(e)){if(!Array.isArray(t)||t.length!==e.length)return!1;for(let n=0,r=e.length;nthis.styles.getPropertyValue(e)));this.context.viewportChanged({width:e.width,height:e.height})}}function nt(e){const t=new AbortController;return e(t.signal).catch((e=>{if(!(e instanceof DOMException&&"AbortError"===e.message))throw e})),t}function rt(e){let t=0;if(0===e.length)return t;if(e.startsWith("cq-")&&("normal"===(e=e.substring(3))||we(e)))return t;const n=e.split(" ");for(const r of n)switch(r){case"size":t|=3;break;case"inline-size":t|=1;break;default:return 0}return t}function ut(e){let t=0;return"none"!==e&&(t|=1,"contents"===e||"inline"===e||Je.test(e)||(t|=2)),t}function ot(e,t){return parseFloat(e(t))}function st(e,t){return t.reduce(((t,n)=>t+ot(e,n)),0)}function lt(e){let t=0,n=0;return"border-box"===e("box-sizing")&&(t=st(e,Ge),n=st(e,Ye)),{fontSize:ot(e,"font-size"),width:ot(e,"width")-t,height:ot(e,"height")-n}}function ct(e){return{containerType:rt(e(y).trim()),containerNames:(n=e(h).trim(),n.startsWith("cq-")&&("none"===(n=n.substring(3))||we(n))?new Set([]):new Set(0===n.length?[]:n.split(" "))),writingAxis:(t=e("writing-mode").trim(),Be.has(t)?1:0),displayFlags:ut(e("display").trim())};var t,n}function it(e,t,n){null!=n?n!=e.getPropertyValue(t)&&e.setProperty(t,n):e.removeProperty(t)}function at(e){const t=e[We];return null!=t?t:[]}function ft(e,t){e[We]=t}new Promise((e=>{})),window.CQPolyfill={version:"1.0.2"},"container"in document.documentElement.style||function(){function n(e){return e[De]||null}const r=document.documentElement;if(n(r))return;const u=document.createElement(`cq-polyfill-${f}`),o=document.createElement("style");new MutationObserver((e=>{for(const t of e){for(const e of t.removedNodes){const t=n(e);null==t||t.disconnect()}t.target.nodeType!==Node.DOCUMENT_NODE&&t.target.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&null===t.target.parentNode||"attributes"===t.type&&t.attributeName&&(t.attributeName===v||t.attributeName===d||t.target instanceof Element&&t.target.getAttribute(t.attributeName)===t.oldValue)||(k(t.target).mutate(),h())}})).observe(r,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0});const s=new ResizeObserver((e=>{for(const t of e)k(t.target).resize();k(r).update(q())})),l=new Ke(r);async function c(e,{source:t,url:n,signal:u}){const o=function(e,t){try{const n=Array.from($(e));if(t)for(let e=0;ee};return{source:W(Ne(P(n,!0),r)),descriptors:r.descriptors}}catch(n){return console.warn("An error occurred while transpiling stylesheet: "+n),{source:e,descriptors:[]}}}(t,n?n.toString():void 0);let s=()=>{},l=()=>{};const c=k(r);let i=!1;return null!=u&&u.aborted||(l=()=>{if(!i){const{sheet:t}=e;null!=t&&(ft(t,o.descriptors),i=!0,s=()=>{ft(t),c.mutate(),h()},c.mutate(),h())}}),{source:o.source,dispose:s,refresh:l}}const a={cqw:null,cqh:null};function p({width:e,height:t}){a.cqw=e,a.cqh=t}function y(e,t,n){if(e instanceof Element&&t){let r="";for(const[n,u]of t.conditions){const t=n.value;null!=t.selector&&null!=u&&!(2&~u)&&e.matches(t.selector)&&(r.length>0&&(r+=" "),r+=t.uid)}r.length>0?e.setAttribute(n,r):e.removeAttribute(n)}}function h(){s.unobserve(r),s.observe(r)}const S=()=>{const e=[];for(const t of document.styleSheets)for(const n of at(t))e.push([new He(n),0]);return e},x=window.getComputedStyle(r),q=()=>{const t=e=>x.getPropertyValue(e),n=ct(t),r=lt(t);return{parentState:null,conditions:S(),context:e({},a,{fontSize:r.fontSize,rootFontSize:r.fontSize,writingAxis:n.writingAxis}),displayFlags:n.displayFlags,isQueryContainer:!1}},C=e=>e;function k(a){let f=n(a);if(!f){let h,S=null,x=!1;a===r?(h=l,S=C):a===u?(x=!0,h=new tt(u,{viewportChanged:p})):h=a===o?new et(o):a instanceof HTMLLinkElement?new Xe(a,{registerStyleSheet:t=>c(a,e({},t))}):a instanceof HTMLStyleElement?new Ze(a,{registerStyleSheet:t=>c(a,e({},t))}):new Ke(a);let q=Symbol();if(null==S&&a instanceof Element){const n=function(n){const r=window.getComputedStyle(n);return function(){let n=null;return(...u)=>{if(null==n||!Ve(n[0],u)){const o=(n=>{const{context:u,conditions:o}=n,s=e=>r.getPropertyValue(e),l=ct(s),c=e({},u,{writingAxis:l.writingAxis});let a=o,f=!1,p=l.displayFlags;!(1&n.displayFlags)&&(p=0);const{containerType:y,containerNames:h}=l;if(y>0){const e=y>0&&!(2&~p),n=new Map(o.map((e=>[e[0].value,e[1]])));if(a=[],f=!0,e){const e=lt(s);c.fontSize=e.fontSize;const r=function(e,t){const n={value:t.width},r={value:t.height};let u=n,o=r;if(1===e.writingAxis){const e=u;u=o,o=e}return!!(2&~e.containerType)&&(o.value=void 0),{width:n.value,height:r.value,inlineSize:u.value,blockSize:o.value}}(l,e),f={sizeFeatures:r,treeContext:c},p=e=>{const{rule:r}=e,u=r.name,o=null==u||h.has(u)?function(e,n){const r=new Map,u=n.sizeFeatures;for(const s of e.features){const e=t(s,u);if(1===e.type)return null;r.set(s,e)}const o=i(e.condition,{sizeFeatures:r,treeContext:n.treeContext});return 5===o.type?o.value:null}(r,f):null;var s;return null==o?1===((null!=(s=n.get(e))?s:0)&&1):!0===o},y=(e,t)=>{let n=e.get(t);if(null==n){const r=p(t);n=(r?1:0)|(!0!==r||null!=t.parent&&1&~y(e,t.parent)?0:2),e.set(t,n)}return n},v=new Map;for(const t of o)a.push([t[0],y(v,t[0].value)]);c.cqw=null!=r.width?r.width/100:u.cqw,c.cqh=null!=r.height?r.height/100:u.cqh}}return{parentState:new He(n),conditions:a,context:c,displayFlags:p,isQueryContainer:f}})(...u);null!=n&&Ve(n[1],o)||(n=[u,o])}return n[1]}}()}(a);S=e=>n(e,q)}const $=S||C;let A=null;const E=e=>{const t=A,n=$(e);return A=n,[A,A!==t]},z=a instanceof HTMLElement||a instanceof SVGElement?a.style:null;let L=!1;f={connect(){for(let e=a.firstChild;null!=e;e=e.nextSibling)k(e);h.connected()},disconnect(){a instanceof Element&&(s.unobserve(a),a.removeAttribute(v),a.removeAttribute(d)),z&&(z.removeProperty(g),z.removeProperty(b),z.removeProperty(m),z.removeProperty(w));for(let e=a.firstChild;null!=e;e=e.nextSibling){const t=n(e);null==t||t.disconnect()}h.disconnected(),delete a[De]},update(e){const[t,n]=E(e);if(n){if(y(a,e,d),y(a,t,v),a instanceof Element){const e=x||t.isQueryContainer;e&&!L?(s.observe(a),L=!0):!e&&L&&(s.unobserve(a),L=!1)}if(z){const n=t.context,r=n.writingAxis;let u=null,o=null,s=null,l=null;(r!==e.context.writingAxis||t.isQueryContainer)&&(u=`var(${0===r?m:w})`,o=`var(${1===r?m:w})`),e&&!t.isQueryContainer||(n.cqw&&(s=n.cqw+"px"),n.cqh&&(l=n.cqh+"px")),it(z,g,u),it(z,b,o),it(z,m,s),it(z,w,l)}h.updated()}for(let r=a.firstChild;null!=r;r=r.nextSibling)k(r).update(t)},resize(){q=Symbol()},mutate(){q=Symbol();for(let e=a.firstChild;null!=e;e=e.nextSibling)k(e).mutate()}},a[De]=f,f.connect()}return f}r.prepend(o,u),k(r),h()}(); +function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?{type:2,value:n/r}:{type:1};case 6:return null!=n&&null!=r?{type:4,value:r>=n?"portrait":"landscape"}:{type:1}}}function n(e,t){switch(e.type){case 1:case 2:case 3:case 4:return i(e,t);case 5:{const n=t.sizeFeatures.get(e.feature);return null==n?{type:1}:n}case 6:return e.value}}function r(e){return{type:5,value:e}}function u(e,t,n){return r(function(e,t,n){switch(n){case 1:return e===t;case 2:return e>t;case 3:return e>=t;case 4:return ee*t))}return null}function c(e,t){switch(e.type){case 2:return 0===e.value?0:null;case 3:return l(e,t)}return null}function i(e,t){switch(e.type){case 4:return function(e,t){const o=n(e.left,t),s=n(e.right,t),l=e.operator;if(4===o.type&&4===s.type||5===o.type&&5===s.type)return i=o,a=s,1===l?r(i.value===a.value):{type:1};var i,a;if(3===o.type||3===s.type){const e=c(o,t),n=c(s,t);if(null!=e&&null!=n)return u(e,n,l)}else if(2===o.type&&2===s.type)return u(o.value,s.value,l);return{type:1}}(e,t);case 2:return function(e,t){const n=i(e.left,t);return 5!==n.type||!0!==n.value?n:i(e.right,t)}(e,t);case 3:return function(e,t){const n=i(e.left,t);return 5===n.type&&!0===n.value?n:i(e.right,t)}(e,t);case 1:{const n=i(e.value,t);return 5===n.type?{type:5,value:!n.value}:{type:1}}case 5:return a(n(e,t));case 6:return a(e.value)}}function a(e){switch(e.type){case 5:return e;case 2:case 3:return{type:5,value:e.value>0}}return{type:1}}const f=Array.from({length:4},(()=>Math.floor(256*Math.random()).toString(16))).join(""),p=S("container"),y=S("container-type"),h=S("container-name"),v=`data-cqs-${f}`,d=`data-cqc-${f}`,m=S("cqw"),w=S("cqh"),g=S("cqi"),b=S("cqb");function S(e){return`--cq-${e}-${f}`}const x=Symbol();function q(e,t){const n={value:t,errorIndices:[],index:-1,at(r){const u=n.index+r;return u>=e.length?t:e[u]},consume:e=>(n.index+=e,n.value=n.at(0),n.value),reconsume(){n.index-=1},error(){n.errorIndices.push(n.index)}};return n}function C(e){return q(e,{type:0})}function*$(e){const t=[];let n=!1;for(const b of e){const e=b.codePointAt(0);n&&10!==e&&(n=!1,t.push(10)),0===e||e>=55296&&e<=57343?t.push(65533):13===e?n=!0:t.push(e)}const r=q(t,-1),{at:u,consume:o,error:s,reconsume:l}=r;function c(){return String.fromCodePoint(r.value)}function i(){return{type:13,value:c()}}function a(){for(;z(u(1));)o(1)}function f(){for(;-1!==r.value;)if(o(1),42===u(0)&&47===u(1))return void o(1);s()}function p(){const[e,t]=function(){let e=0,t="",n=u(1);for(43!==n&&45!==n||(o(1),t+=c());k(u(1));)o(1),t+=c();if(46===u(1)&&k(u(2)))for(e=1,o(1),t+=c();k(u(1));)o(1),t+=c();if(n=u(1),69===n||101===n){const n=u(2);if(k(n))for(e=1,o(1),t+=c();k(u(1));)o(1),t+=c();else if((45===n||43===n)&&k(u(3)))for(e=1,o(1),t+=c(),o(1),t+=c();k(u(1));)o(1),t+=c()}return[t,e]}(),n=u(1);return d(n,u(1),u(2))?{type:15,value:e,flag:t,unit:w()}:37===n?(o(1),{type:16,value:e}):{type:17,value:e,flag:t}}function y(){const e=w();let t=u(1);if("url"===e.toLowerCase()&&40===t){for(o(1);z(u(1))&&z(u(2));)o(1);t=u(1);const n=u(2);return 34===t||39===t?{type:23,value:e}:!z(t)||34!==n&&39!==n?function(){let e="";for(a();;){const n=o(1);if(41===n)return{type:20,value:e};if(-1===n)return s(),{type:20,value:e};if(z(n)){a();const t=u(1);return 41===t||-1===t?(o(1),-1===n&&s(),{type:20,value:e}):(g(),{type:21})}if(34===n||39===n||40===n||(t=n)>=0&&t<=8||11===t||t>=14&&t<=31||127===t)return s(),g(),{type:21};if(92===n){if(!j(n,u(1)))return s(),{type:21};e+=v()}else e+=c()}var t}():{type:23,value:e}}return 40===t?(o(1),{type:23,value:e}):{type:24,value:e}}function h(e){let t="";for(;;){const n=o(1);if(-1===n||n===e)return-1===n&&s(),{type:2,value:t};if(E(n))return s(),l(),{type:3};if(92===n){const e=u(1);if(-1===e)continue;E(e)?o(1):t+=v()}else t+=c()}}function v(){const e=o(1);if(A(e)){const t=[e];for(let e=0;e<5;e++){const e=u(1);if(!A(e))break;t.push(e),o(1)}z(u(1))&&o(1);let n=parseInt(String.fromCodePoint(...t),16);return(0===n||n>=55296&&n<=57343||n>1114111)&&(n=65533),String.fromCodePoint(n)}return-1===e?(s(),String.fromCodePoint(65533)):c()}function d(e,t,n){return 45===e?L(t)||45===t||j(t,n):!!L(e)}function m(e,t,n){return 43===e||45===e?k(t)||46===t&&k(n):!(46!==e||!k(t))||!!k(e)}function w(){let e="";for(;;){const t=o(1);if(M(t))e+=c();else{if(!j(t,u(1)))return l(),e;e+=v()}}}function g(){for(;;){const e=o(1);if(-1===e)return;j(e,u(1))&&v()}}for(;;){const e=o(1);if(47===e&&42===u(1))o(2),f();else if(z(e))a(),yield{type:1};else if(34===e)yield h(e);else if(35===e){const e=u(1);M(e)||j(e,u(2))?yield{type:14,flag:d(u(1),u(2),u(3))?1:0,value:w()}:yield i()}else if(39===e)yield h(e);else if(40===e)yield{type:4};else if(41===e)yield{type:5};else if(43===e)m(e,u(1),u(2))?(l(),yield p()):yield i();else if(44===e)yield{type:6};else if(45===e){const t=u(1),n=u(2);m(e,t,n)?(l(),yield p()):45===t&&62===n?(o(2),yield{type:19}):d(e,t,n)?(l(),yield y()):yield i()}else if(46===e)m(e,u(1),u(2))?(l(),yield p()):yield i();else if(58===e)yield{type:7};else if(59===e)yield{type:8};else if(60===e)33===u(1)&&45===u(2)&&45===u(3)?yield{type:18}:yield i();else if(64===e)if(d(u(1),u(2),u(3))){const e=w();yield{type:22,value:e}}else yield i();else if(91===e)yield{type:9};else if(92===e)j(e,u(1))?(l(),yield y()):(s(),yield i());else if(93===e)yield{type:10};else if(123===e)yield{type:11};else if(125===e)yield{type:12};else if(k(e))l(),yield p();else if(L(e))l(),yield y();else{if(-1===e)return yield{type:0},r.errorIndices;yield{type:13,value:c()}}}}function k(e){return e>=48&&e<=57}function A(e){return k(e)||e>=65&&e<=70||e>=97&&e<=102}function E(e){return 10===e||13===e||12===e}function z(e){return E(e)||9===e||32===e}function L(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128||95===e}function j(e,t){return 92===e&&!E(t)}function M(e){return L(e)||k(e)||45===e}const T={11:12,9:10,4:5};function P(t,n){const r=function(e,t){const n=[];for(;;)switch(e.consume(1).type){case 1:break;case 0:return{type:3,value:n};case 18:case 19:if(!1!==t){e.reconsume();const t=U(e);t!==x&&n.push(t)}break;case 22:e.reconsume(),n.push(F(e));break;default:{e.reconsume();const t=U(e);t!==x&&n.push(t);break}}}(C(t),!0===n);return e({},r,{value:r.value.map((t=>{return 26===t.type?0===(n=t).value.value.type?e({},n,{value:e({},n.value,{value:(r=n.value.value.value,function(e){const t=[],n=[];for(;;){const r=e.consume(1);switch(r.type){case 1:case 8:break;case 0:return{type:1,value:[...n,...t]};case 22:e.reconsume(),t.push(F(e));break;case 24:{const t=[r];let u=e.at(1);for(;8!==u.type&&0!==u.type;)t.push(I(e)),u=e.at(1);const o=R(C(t));o!==x&&n.push(o);break}case 13:if("&"===r.value){e.reconsume();const n=U(e);n!==x&&t.push(n);break}default:{e.error(),e.reconsume();let t=e.at(1);for(;8!==t.type&&0!==t.type;)I(e),t=e.at(1);break}}}}(C(r)))})}):n:t;var n,r}))})}function N(e){const t=C(e),n=[];for(;;){if(0===t.consume(1).type)return n;t.reconsume(),n.push(I(t))}}function O(e){for(;1===e.at(1).type;)e.consume(1)}function F(e){let t=e.consume(1);if(22!==t.type)throw new Error(`Unexpected type ${t.type}`);const n=t.value,r=[];for(;;)switch(t=e.consume(1),t.type){case 8:return{type:25,name:n,prelude:r,value:null};case 0:return e.error(),{type:25,name:n,prelude:r,value:null};case 11:return{type:25,name:n,prelude:r,value:Q(e)};case 28:if(11===t.source.type)return{type:25,name:n,prelude:r,value:t};default:e.reconsume(),r.push(I(e))}}function U(e){let t=e.value;const n=[];for(;;)switch(t=e.consume(1),t.type){case 0:return e.error(),x;case 11:return{type:26,prelude:n,value:Q(e)};case 28:if(11===t.source.type)return{type:26,prelude:n,value:t};default:e.reconsume(),n.push(I(e))}}function R(e){const t=e.consume(1);if(24!==t.type)throw new Error(`Unexpected type ${t.type}`);const n=t.value,r=[];let u=!1;if(O(e),7!==e.at(1).type)return e.error(),x;for(e.consume(1),O(e);0!==e.at(1).type;)r.push(I(e));const o=r[r.length-2],s=r[r.length-1];return o&&13===o.type&&"!"===o.value&&24===s.type&&"important"===s.value.toLowerCase()&&(u=!0,r.splice(r.length-2)),{type:29,name:n,value:r,important:u}}function I(e){const t=e.consume(1);switch(t.type){case 11:case 9:case 4:return Q(e);case 23:return function(e){let t=e.value;if(23!==t.type)throw new Error(`Unexpected type ${t.type}`);const n=t.value,r=[];for(;;)switch(t=e.consume(1),t.type){case 5:return{type:27,name:n,value:r};case 0:return e.error(),{type:27,name:n,value:r};default:e.reconsume(),r.push(I(e))}}(e);default:return t}}function Q(e){let t=e.value;const n=t,r=T[n.type];if(!r)throw new Error(`Unexpected type ${t.type}`);const u=[];for(;;)switch(t=e.consume(1),t.type){case r:return{type:28,source:n,value:{type:0,value:u}};case 0:return e.error(),{type:28,source:n,value:{type:0,value:u}};default:e.reconsume(),u.push(I(e))}}function H(e){return O(e),0===e.at(1).type}const V={11:["{","}"],9:["[","]"],4:["(",")"]};function D(e,t){switch(e.type){case 25:return`@${CSS.escape(e.name)} ${e.prelude.map((e=>D(e))).join("")}${e.value?D(e.value):";"}`;case 26:return`${e.prelude.map((e=>D(e))).join("")}${D(e.value)}`;case 28:{const[t,n]=V[e.source.type];return`${t}${W(e.value)}${n}`}case 27:return`${CSS.escape(e.name)}(${e.value.map((e=>D(e))).join("")})`;case 29:return`${CSS.escape(e.name)}:${e.value.map((e=>D(e))).join("")}${e.important?" !important":""}`;case 1:return" ";case 8:return";";case 7:return":";case 14:return"#"+CSS.escape(e.value);case 24:return CSS.escape(e.value);case 15:return e.value+CSS.escape(e.unit);case 13:case 17:return e.value;case 2:return`"${CSS.escape(e.value)}"`;case 6:return",";case 20:return"url("+CSS.escape(e.value)+")";case 22:return"@"+CSS.escape(e.value);case 16:return e.value+"%";default:throw new Error(`Unsupported token ${e.type}`)}}function W(e,t){return e.value.map((t=>{let n=D(t);return 29===t.type&&0!==e.type&&(n+=";"),n})).join("")}function _(e){return D(e)}function B(e){const t=e.at(1);return 13===t.type&&"="===t.value&&(e.consume(1),!0)}function G(e,t){const n=[];for(;;){const r=e.at(1);if(0===r.type||t&&7===r.type||13===r.type&&(">"===r.value||"<"===r.value||"="===r.value))break;n.push(e.consume(1))}return n}function Y(e){O(e);const t=e.consume(1);return 13!==t.type?x:">"===t.value?B(e)?3:2:"<"===t.value?B(e)?5:4:"="===t.value?1:x}function J(e){return 4===e||5===e}function K(e){return 2===e||3===e}function X(e,t,n){const r=function(e){O(e);const t=e.consume(1);return O(e),24!==t.type||0!==e.at(1).type?x:t.value}(C(e));if(r===x)return x;let u=r.toLowerCase();return u=n?n(u):u,t.has(u)?u:x}function Z(e){return{type:13,value:e}}function ee(e,t){return{type:29,name:e,value:t,important:!1}}function te(e){return{type:24,value:e}}function ne(e,t){return{type:27,name:e,value:t}}function re(e){return ne("var",[te(e)])}function ue(e,t){O(e);let n=!1,r=e.at(1);if(24===r.type){if("not"!==r.value.toLowerCase())return x;e.consume(1),O(e),n=!0}let u=function(e){const t=e.consume(1);switch(t.type){case 28:{if(4!==t.source.type)return x;const e=ue(C(t.value.value),null);return e!==x?e:{type:4,value:t}}case 27:return{type:4,value:t};default:return x}}(e);if(u===x)return x;u=n?{type:1,value:u}:u,O(e),r=e.at(1);const o=24===r.type?r.value.toLowerCase():null;if(null!==o){if(e.consume(1),O(e),"and"!==o&&"or"!==o||null!==t&&o!==t)return x;const n=ue(e,o);return n===x?x:{type:"and"===o?2:3,left:u,right:n}}return H(e)?u:x}function oe(e){return ue(e,null)}function se(e){switch(e.type){case 1:return[te("not"),{type:1},...se(e.value)];case 2:case 3:return[...se(e.left),{type:1},te(2===e.type?"and":"or"),{type:1},...se(e.right)];case 4:return[e.value]}}const le={width:1,height:2,"inline-size":3,"block-size":4,"aspect-ratio":5,orientation:6},ce=new Set(Object.keys(le)),ie=new Set(["none","and","not","or","normal","auto"]),ae=new Set(["initial","inherit","revert","revert-layer","unset"]),fe=new Set(["size","inline-size"]);function pe(e,t,n,r){const u=n();if(u===x)return x;let o=[u,null];O(e);const s=e.at(1);if(13===s.type){if(s.value!==t)return x;e.consume(1),O(e);const n=r();O(e),n!==x&&(o=[u,n])}return H(e)?o:x}function ye(e){const t=e.consume(1);return 17===t.type?parseInt(t.value):x}function he(e){const t=C(e);O(t);const n=t.consume(1);let r=x;switch(n.type){case 17:t.reconsume(),r=function(e){const t=pe(e,"/",(()=>ye(e)),(()=>ye(e)));return t===x?x:{type:2,value:t[0]/(null!==t[1]?t[1]:1)}}(t);break;case 15:r={type:3,value:parseInt(n.value),unit:n.unit.toLowerCase()};break;case 24:{const e=n.value.toLowerCase();switch(e){case"landscape":case"portrait":r={type:4,value:e}}}}return r===x?x:H(t)?{type:6,value:r}:x}function ve(e){return!we(e=e.toLowerCase())&&!ie.has(e)}function de(e,t){const n=[];for(;;){O(e);const r=e.at(1);if(24!==r.type||!t(r.value))return n;e.consume(1),n.push(r.value)}}function me(e){const t=[];for(;;){O(e);const n=e.at(1);if(24!==n.type)break;const r=n.value;if(!ve(r))break;e.consume(1),t.push(r)}return t}function we(e){return ae.has(e)}function ge(e){return e.map((e=>"cq-"+e))}function be(e){const t=de(e,(e=>we(e)));return 1===t.length?ge(t):x}function Se(e,t){const n=de(e,(e=>"none"===e));if(1===n.length)return ge(n);if(0!==n.length)return x;if(t){const t=be(e);if(t!==x)return t}const r=me(e);return r.length>0&&(!t||H(e))?r:x}function xe(e,t){if(t){const t=be(e);if(t!==x)return t}return function(e){const t=de(e,(e=>"normal"===e));if(1===t.length)return ge(t);if(0!==t.length)return x;const n=de(e,(e=>fe.has(e)));return n.length>0&&H(e)?n:x}(e)}function qe(e){const t=C(e),n=be(t);if(n!==x)return[n,n];const r=pe(t,"/",(()=>Se(t,!1)),(()=>xe(t,!1)));return r!==x&&H(t)?[r[0],r[1]||[]]:x}function Ce(e){const t=C(e),n=me(t);if(!n||n.length>1)return x;const r=oe(t);if(r===x)return x;const u={features:new Set},o=$e(r,u);return H(t)?{name:n.length>0?n[0]:null,condition:o,features:u.features}:x}function $e(e,t){switch(e.type){case 1:return{type:1,value:$e(e.value,t)};case 2:case 3:return{type:2===e.type?2:3,left:$e(e.left,t),right:$e(e.right,t)};case 4:if(28===e.value.type){const n=function(e,t){const n=function(e,t){const n=G(e,!0),r=e.at(1);if(0===r.type){const e=X(n,t);return e!==x&&t.has(e)?{type:1,feature:e}:x}if(7===r.type){e.consume(1);const r=G(e,!1);let u=1;const o=X(n,t,(e=>e.startsWith("min-")?(u=3,e.substring(4)):e.startsWith("max-")?(u=5,e.substring(4)):e));return o!==x?{type:2,feature:o,bounds:[null,[u,r]]}:x}const u=Y(e);if(u===x)return x;const o=G(e,!1);if(0===e.at(1).type){const e=X(n,t);if(e!==x)return{type:2,feature:e,bounds:[null,[u,o]]};const r=X(o,t);return r!==x?{type:2,feature:r,bounds:[[u,n],null]}:x}const s=Y(e);if(s===x||!(K(u)&&K(s)||J(u)&&J(s)))return x;const l=G(e,!1),c=X(o,t);return c!==x?{type:2,feature:c,bounds:[[u,n],[s,l]]}:x}(e,ce);if(n===x)return x;const r=le[n.feature];if(null==r)return x;if(t.features.add(r),1===n.type)return{type:5,feature:r};{const e={type:5,feature:r};let t=x;if(null!==n.bounds[0]){const r=he(n.bounds[0][1]);if(r===x)return x;t={type:4,operator:n.bounds[0][0],left:r,right:e}}if(null!==n.bounds[1]){const r=he(n.bounds[1][1]);if(r===x)return x;const u={type:4,operator:n.bounds[1][0],left:e,right:r};t=t!==x?{type:2,left:t,right:u}:u}return t}}(C(e.value.value.value),t);if(n!==x)return n}return{type:6,value:{type:1}}}}let ke=0;const Ae={cqw:m,cqh:w,cqi:g,cqb:b},Ee=CSS.supports("selector(:where(div))"),ze=":not(.container-query-polyfill)";N(Array.from($(ze)));const Le=document.createElement("div"),je=new Set(["before","after","first-line","first-letter"]);function Me(e,t){return ne("calc",[{type:17,flag:e.flag,value:e.value},Z("*"),t])}function Te(t){return t.map((t=>{switch(t.type){case 15:return function(e){const t=e.unit,n=Ae[t];return null!=n?Me(e,re(n)):"cqmin"===t||"cqmax"===t?Me(e,ne(e.unit.slice(2),[re(g),{type:6},re(b)])):e}(t);case 27:return e({},t,{value:Te(t.value)})}return t}))}function Pe(t){switch(t.name){case"container":return qe(t.value)?e({},t,{name:p}):t;case"container-name":return Se(C(t.value),!0)?e({},t,{name:h}):t;case"container-type":return null!=xe(C(t.value),!0)?e({},t,{name:y}):t}return e({},t,{value:Te(t.value)})}function Ne(t,n){return e({},t,{value:t.value.map((t=>{switch(t.type){case 25:return Qe(t,n);case 26:return r=t,(u=n).transformStyleRule(e({},r,{value:Ue(r.value,u)}));default:return t}var r,u}))})}function Oe(e){return 0===e.type||6===e.type}function Fe(e){for(let t=e.length-1;t>=0;t--)if(1!==e[t].type)return e.slice(0,t+1);return e}function Ue(t,n){return function(t,n){const r=[];let u=null,o=null;for(const e of t.value.value)switch(e.type){case 25:{const t=n?n(e):e;t&&r.push(t)}break;case 29:{const t=Pe(e);switch(t.name){case p:{const t=qe(e.value);t!==x&&(u=t[0],o=t[1]);break}case h:{const t=Se(C(e.value),!0);t!==x&&(u=t);break}case y:{const t=xe(C(e.value),!0);t!==x&&(o=t);break}default:r.push(t)}}}return u&&u.length>0&&r.push(ee(h,[te(u.join(" "))])),o&&o.length>0&&r.push(ee(y,[te(o.join(" "))])),e({},t,{value:{type:2,value:r}})}(t,(e=>Qe(e,n)))}function Re(t){if(1===t.type)return e({},t,{value:Re(t.value)});if(2===t.type||3===t.type)return e({},t,{left:Re(t.left),right:Re(t.right)});if(4===t.type&&28===t.value.type){const n=function(e){const t=C(e);return O(t),24!==t.at(1).type?x:R(t)||x}(t.value.value.value);if(n!==x)return e({},t,{value:e({},t.value,{value:{type:0,value:[Pe(n)]}})})}return t}function Ie(t,n){let r=oe(C(t.prelude));return r=r!==x?Re(r):x,e({},t,{prelude:r!==x?se(r):t.prelude,value:t.value?e({},t.value,{value:Ne(P(t.value.value.value),n)}):null})}function Qe(t,n){switch(t.name.toLocaleLowerCase()){case"media":case"layer":return u=n,e({},r=t,{value:r.value?e({},r.value,{value:Ne(P(r.value.value.value),u)}):null});case"keyframes":return function(t,n){let r=null;return t.value&&(r=e({},t.value,{value:{type:3,value:P(t.value.value.value).value.map((t=>{switch(t.type){case 26:return u=n,e({},r=t,{value:Ue(r.value,u)});case 25:return Qe(t,n)}var r,u}))}})),e({},t,{value:r})}(t,n);case"supports":return Ie(t,n);case"container":return function(t,n){if(t.value){const r=Ce(t.prelude);if(r!==x){const u={rule:r,selector:null,parent:n.parent,uid:"c"+ke++},o=new Set,s=[],l=Ne(P(t.value.value.value),{descriptors:n.descriptors,parent:u,transformStyleRule:t=>{const[n,r]=function(e,t){const n=C(e),r=[],u=[];for(;;){if(0===n.at(1).type)return[r,u];const c=Math.max(0,n.index);for(;o=n.at(1),l=n.at(2),!(Oe(o)||7===o.type&&(7===l.type||24===l.type&&je.has(l.value.toLowerCase())));)n.consume(1);const i=n.index+1,a=e.slice(c,i),f=a.length>0?Fe(a):[Z("*")];for(;!Oe(n.at(1));)n.consume(1);const p=e.slice(i,Math.max(0,n.index+1));let y=f,h=[{type:28,source:{type:9},value:{type:0,value:[te(p.length>0?v:d),Z("~"),Z("="),{type:2,value:t}]}}];if(Ee)h=[Z(":"),ne("where",h)];else{const e=f.map(_).join("");e.endsWith(ze)?y=N(Array.from($(e.substring(0,e.length-31)))):s.push({actual:e,expected:e+ze})}r.push(...f),u.push(...y),u.push(...h),u.push(...p),n.consume(1)}var o,l}(t.prelude,u.uid);if(s.length>0)return t;const l=n.map(_).join("");try{Le.matches(l),o.add(l)}catch(c){}return e({},t,{prelude:r})}}).value;if(s.length>0){const e=new Set,t=[];let n=0;for(const{actual:u}of s)n=Math.max(n,u.length);const r=Array.from({length:n},(()=>" ")).join("");for(const{actual:u,expected:o}of s)e.has(u)||(t.push(`${u}${r.substring(0,n-u.length)} => ${o}`),e.add(u));console.warn(`The :where() pseudo-class is not supported by this browser. To use the Container Query Polyfill, you must modify the selectors under your @container rules:\n\n${t.join("\n")}`)}return o.size>0&&(u.selector=Array.from(o).join(", ")),n.descriptors.push(u),{type:25,name:"media",prelude:[te("all")],value:e({},t.value,{value:{type:3,value:l}})}}}return t}(t,n)}var r,u;return t}class He{constructor(e){this.value=void 0,this.value=e}}function Ve(e,t){if(e===t)return!0;if(typeof e==typeof t&&null!==e&&null!==t&&"object"==typeof e){if(Array.isArray(e)){if(!Array.isArray(t)||t.length!==e.length)return!1;for(let n=0,r=e.length;nthis.styles.getPropertyValue(e)));this.context.viewportChanged({width:e.width,height:e.height})}}function nt(e){const t=new AbortController;return e(t.signal).catch((e=>{if(!(e instanceof DOMException&&"AbortError"===e.message))throw e})),t}function rt(e){let t=0;if(0===e.length)return t;if(e.startsWith("cq-")&&("normal"===(e=e.substring(3))||we(e)))return t;const n=e.split(" ");for(const r of n)switch(r){case"size":t|=3;break;case"inline-size":t|=1;break;default:return 0}return t}function ut(e){let t=0;return"none"!==e&&(t|=1,"contents"===e||"inline"===e||Je.test(e)||(t|=2)),t}function ot(e,t){return parseFloat(e(t))}function st(e,t){return t.reduce(((t,n)=>t+ot(e,n)),0)}function lt(e){let t=0,n=0;return"border-box"===e("box-sizing")&&(t=st(e,Ge),n=st(e,Ye)),{fontSize:ot(e,"font-size"),width:ot(e,"width")-t,height:ot(e,"height")-n}}function ct(e){return{containerType:rt(e(y).trim()),containerNames:(n=e(h).trim(),n.startsWith("cq-")&&("none"===(n=n.substring(3))||we(n))?new Set([]):new Set(0===n.length?[]:n.split(" "))),writingAxis:(t=e("writing-mode").trim(),Be.has(t)?1:0),displayFlags:ut(e("display").trim())};var t,n}function it(e,t,n){null!=n?n!=e.getPropertyValue(t)&&e.setProperty(t,n):e.removeProperty(t)}function at(e){const t=e[We];return null!=t?t:[]}function ft(e,t){e[We]=t}new Promise((e=>{})),window.CQPolyfill={version:"1.0.2"},"container"in document.documentElement.style||function(){function n(e){return e[De]||null}const r=document.documentElement;if(n(r))return;const u=document.createElement(`cq-polyfill-${f}`),o=document.createElement("style");new MutationObserver((e=>{for(const t of e){for(const e of t.removedNodes){const t=n(e);null==t||t.disconnect()}t.target.nodeType!==Node.DOCUMENT_NODE&&t.target.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&null===t.target.parentNode||"attributes"===t.type&&t.attributeName&&(t.attributeName===v||t.attributeName===d||t.target instanceof Element&&t.target.getAttribute(t.attributeName)===t.oldValue)||(k(t.target).mutate(),h())}})).observe(r,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0});const s=new ResizeObserver((e=>{for(const t of e)k(t.target).resize();k(r).update(q())})),l=new Ke(r);async function c(e,{source:t,url:n,signal:u}){const o=function(e,t){try{const n=Array.from($(e));if(t)for(let e=0;ee};return{source:W(Ne(P(n,!0),r)),descriptors:r.descriptors}}catch(n){return console.warn("An error occurred while transpiling stylesheet: "+n),{source:e,descriptors:[]}}}(t,n?n.toString():void 0);let s=()=>{},l=()=>{};const c=k(r);let i=!1;return null!=u&&u.aborted||(l=()=>{if(!i){const{sheet:t}=e;null!=t&&(ft(t,o.descriptors),i=!0,s=()=>{ft(t),c.mutate(),h()},c.mutate(),h())}}),{source:o.source,dispose:s,refresh:l}}const a={cqw:null,cqh:null};function p({width:e,height:t}){a.cqw=e,a.cqh=t}function y(e,t,n){if(e instanceof Element&&t){let r="";for(const[n,u]of t.conditions){const t=n.value;null!=t.selector&&null!=u&&!(2&~u)&&e.matches(t.selector)&&(r.length>0&&(r+=" "),r+=t.uid)}r.length>0?e.setAttribute(n,r):e.removeAttribute(n)}}function h(){s.unobserve(r),s.observe(r)}const S=()=>{const e=[];for(const t of document.styleSheets)for(const n of at(t))e.push([new He(n),0]);return e},x=window.getComputedStyle(r),q=()=>{const t=e=>x.getPropertyValue(e),n=ct(t),r=lt(t);return{parentState:null,conditions:S(),context:e({},a,{fontSize:r.fontSize,rootFontSize:r.fontSize,writingAxis:n.writingAxis}),displayFlags:n.displayFlags,isQueryContainer:!1}},C=e=>e;function k(a){let f=n(a);if(!f){let h,S=null,x=!1;a===r?(h=l,S=C):a===u?(x=!0,h=new tt(u,{viewportChanged:p})):h=a===o?new et(o):a instanceof HTMLLinkElement?new Xe(a,{registerStyleSheet:t=>c(a,e({},t))}):a instanceof HTMLStyleElement?new Ze(a,{registerStyleSheet:t=>c(a,e({},t))}):new Ke(a);let q=Symbol();if(null==S&&a instanceof Element){const n=function(n){const r=window.getComputedStyle(n);return function(){let n=null;return(...u)=>{if(null==n||!Ve(n[0],u)){const o=(n=>{const{context:u,conditions:o}=n,s=e=>r.getPropertyValue(e),l=ct(s),c=e({},u,{writingAxis:l.writingAxis});let a=o,f=!1,p=l.displayFlags;!(1&n.displayFlags)&&(p=0);const{containerType:y,containerNames:h}=l;if(y>0){const e=y>0&&!(2&~p),n=new Map(o.map((e=>[e[0].value,e[1]])));if(a=[],f=!0,e){const e=lt(s);c.fontSize=e.fontSize;const r=function(e,t){const n={value:t.width},r={value:t.height};let u=n,o=r;if(1===e.writingAxis){const e=u;u=o,o=e}return!!(2&~e.containerType)&&(o.value=void 0),{width:n.value,height:r.value,inlineSize:u.value,blockSize:o.value}}(l,e),f={sizeFeatures:r,treeContext:c},p=e=>{const{rule:r}=e,u=r.name,o=null==u||h.has(u)?function(e,n){const r=new Map,u=n.sizeFeatures;for(const s of e.features){const e=t(s,u);if(1===e.type)return null;r.set(s,e)}const o=i(e.condition,{sizeFeatures:r,treeContext:n.treeContext});return 5===o.type?o.value:null}(r,f):null;var s;return null==o?1===((null!=(s=n.get(e))?s:0)&&1):!0===o},y=(e,t)=>{let n=e.get(t);if(null==n){const r=p(t);n=(r?1:0)|(!0!==r||null!=t.parent&&1&~y(e,t.parent)?0:2),e.set(t,n)}return n},v=new Map;for(const t of o)a.push([t[0],y(v,t[0].value)]);c.cqw=null!=r.width?r.width/100:u.cqw,c.cqh=null!=r.height?r.height/100:u.cqh}}return{parentState:new He(n),conditions:a,context:c,displayFlags:p,isQueryContainer:f}})(...u);null!=n&&Ve(n[1],o)||(n=[u,o])}return n[1]}}()}(a);S=e=>n(e,q)}const $=S||C;let A=null;const E=e=>{const t=A,n=$(e);return A=n,[A,A!==t]},z=a instanceof HTMLElement||a instanceof SVGElement?a.style:null;let L=!1;f={connect(){for(let e=a.firstChild;null!=e;e=e.nextSibling)k(e);h.connected()},disconnect(){a instanceof Element&&(s.unobserve(a),a.removeAttribute(v),a.removeAttribute(d)),z&&(z.removeProperty(g),z.removeProperty(b),z.removeProperty(m),z.removeProperty(w));for(let e=a.firstChild;null!=e;e=e.nextSibling){const t=n(e);null==t||t.disconnect()}h.disconnected(),delete a[De]},update(e){const[t,n]=E(e);if(n){if(y(a,e,d),y(a,t,v),a instanceof Element){const e=x||t.isQueryContainer;e&&!L?(s.observe(a),L=!0):!e&&L&&(s.unobserve(a),L=!1)}if(z){const n=t.context,r=n.writingAxis;let u=null,o=null,s=null,l=null;(r!==e.context.writingAxis||t.isQueryContainer)&&(u=`var(${0===r?m:w})`,o=`var(${1===r?m:w})`),e&&!t.isQueryContainer||(n.cqw&&(s=n.cqw+"px"),n.cqh&&(l=n.cqh+"px")),it(z,g,u),it(z,b,o),it(z,m,s),it(z,w,l)}h.updated()}for(let r=a.firstChild;null!=r;r=r.nextSibling)k(r).update(t)},resize(){q=Symbol()},mutate(){q=Symbol();for(let e=a.firstChild;null!=e;e=e.nextSibling)k(e).mutate()}},a[De]=f,f.connect()}return f}r.prepend(o,u),k(r),h()}(); diff --git a/panel/dist/js/index.min.js b/panel/dist/js/index.min.js index b4ac2b0a63..5d27ac0f93 100644 --- a/panel/dist/js/index.min.js +++ b/panel/dist/js/index.min.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./IndexView.min.js","./vendor.min.js","./DocsView.min.js","./Docs.min.js","./PlaygroundView.min.js","./Highlight.min.js"])))=>i.map(i=>d[i]); -import{v as t,I as e,P as i,S as n,F as s,N as o,s as l,l as a,w as r,a as u,b as c,c as d,e as p,t as h,d as m,f,g,h as k,i as b,k as v,D as y,j as $,E as w,m as x,n as _,o as C,T as S,u as O,p as M,q as A,r as I,x as D,y as j,z as E,A as L,B as T,C as B,G as q,H as P,V as N,J as z}from"./vendor.min.js";const F={},Y=function(t,e,i){let n=Promise.resolve();if(e&&e.length>0){const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),o=(null==s?void 0:s.nonce)||(null==s?void 0:s.getAttribute("nonce"));n=Promise.all(e.map((e=>{if(e=function(t,e){return new URL(t,e).href}(e,i),e in F)return;F[e]=!0;const n=e.endsWith(".css"),s=n?'[rel="stylesheet"]':"";if(!!i)for(let i=t.length-1;i>=0;i--){const s=t[i];if(s.href===e&&(!n||"stylesheet"===s.rel))return}else if(document.querySelector(`link[href="${e}"]${s}`))return;const l=document.createElement("link");return l.rel=n?"stylesheet":"modulepreload",n||(l.as="script",l.crossOrigin=""),l.href=e,o&&l.setAttribute("nonce",o),document.head.appendChild(l),n?new Promise(((t,i)=>{l.addEventListener("load",t),l.addEventListener("error",(()=>i(new Error(`Unable to preload CSS for ${e}`))))})):void 0})))}return n.then((()=>t())).catch((t=>{const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=t,window.dispatchEvent(e),!e.defaultPrevented)throw t}))},R={created(){this.$panel.events.subscribe();for(const t of this.$panel.plugins.created)t(this);this.$panel.events.on("popstate",(()=>{this.$panel.open(window.location.href)})),this.$panel.events.on("drop",(()=>{this.$panel.drag.stop()})),this.$store.dispatch("content/init")},destroyed(){this.$panel.events.unsubscribe()},render(t){if(this.$panel.view.component)return t(this.$panel.view.component,{key:this.$panel.view.component,props:this.$panel.view.props})}},U={props:{after:String}},H={props:{autocomplete:String}},V={props:{autofocus:Boolean}},K={props:{before:String}},W={props:{disabled:Boolean}},J={props:{font:String}},G={props:{help:String}},X={props:{id:{type:[Number,String],default(){return this._uid}}}},Z={props:{invalid:Boolean}},Q={props:{label:String}},tt={props:{layout:{type:String,default:"list"}}},et={props:{maxlength:Number}},it={props:{minlength:Number}},nt={props:{name:[Number,String]}},st={props:{options:{default:()=>[],type:Array}}},ot={props:{pattern:String}},lt={props:{placeholder:[Number,String]}},at={props:{required:Boolean}},rt={props:{spellcheck:{type:Boolean,default:!0}}};function ut(t,e,i,n,s,o,l,a){var r,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=i,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),l?(r=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(l)},u._ssrRegister=r):s&&(r=a?function(){s.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:s),r)if(u.functional){u._injectStyles=r;var c=u.render;u.render=function(t,e){return r.call(e),c(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,r):[r]}return{exports:t,options:u}}const ct={mixins:[tt],inheritAttrs:!1,props:{columns:{type:[Object,Array],default:()=>({})},fields:{type:Object,default:()=>({})},items:{type:Array,default:()=>[]},link:{type:Boolean,default:!0},sortable:Boolean,size:{type:String,default:"medium"},theme:String}};const dt=ut({mixins:[ct],props:{image:{type:[Object,Boolean],default:()=>({})}},emits:["change","hover","item","option","sort"],computed:{dragOptions(){return{sort:this.sortable,disabled:!1===this.sortable,draggable:".k-draggable-item"}},table(){return{columns:this.columns,fields:this.fields,rows:this.items,sortable:this.sortable}}},methods:{onDragStart(t,e){this.$panel.drag.start("text",e)},onOption(t,e,i){this.$emit("option",t,e,i)},imageOptions(t){let e=this.image,i=t.image;return!1!==e&&!1!==i&&("object"!=typeof e&&(e={}),"object"!=typeof i&&(i={}),{...i,...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},scopedSlots:t._u([t.$scopedSlots.options?{key:"options",fn:function({row:e,rowIndex:i}){return[t._t("options",null,null,{item:e,index:i})]}}:null],null,!0)},"k-table",t.table,!1)):e("k-draggable",{staticClass:"k-items",class:"k-"+t.layout+"-items",attrs:{"data-layout":t.layout,"data-size":t.size,handle:!0,list:t.items,options:t.dragOptions},on:{change:function(e){return t.$emit("change",e)},end:function(e){return t.$emit("sort",t.items,e)}}},[t._l(t.items,(function(i,n){return[t._t("default",(function(){return[e("k-item",t._b({key:i.id??n,class:{"k-draggable-item":t.sortable&&i.sortable},attrs:{image:t.imageOptions(i),layout:t.layout,link:!!t.link&&i.link,sortable:t.sortable&&i.sortable,theme:t.theme,width:i.column},on:{click:function(e){return t.$emit("item",i,n)},drag:function(e){return t.onDragStart(e,i.dragText)},option:function(e){return t.onOption(e,i,n)}},nativeOn:{mouseover:function(e){return t.$emit("hover",e,i,n)}},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options",null,null,{item:i,index:n})]},proxy:!0}],null,!0)},"k-item",i,!1))]}),null,{item:i,itemIndex:n})]}))],2)}),[],!1,null,null,null,null).exports;const pt=ut({mixins:[ct],props:{empty:{type:Object,default:()=>({})},help:String,pagination:{type:[Boolean,Object],default:!1}},emits:["action","change","empty","item","option","paginate","sort"],computed:{hasPagination(){return!1!==this.pagination&&(!0!==this.paginationOptions.hide&&!(this.pagination.total<=this.pagination.limit))},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"},[0===t.items.length?e("k-empty",t._g(t._b({attrs:{layout:t.layout}},"k-empty",t.empty,!1),t.$listeners.empty?{click:t.onEmpty}:{})):e("k-items",t._b({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,index:i}){return[t._t("options",null,null,{item:e,index:i})]}}],null,!0)},"k-items",{columns:t.columns,fields:t.fields,items:t.items,layout:t.layout,link:t.link,size:t.size,sortable:t.sortable,theme:t.theme},!1)),t.help||t.hasPagination?e("footer",{staticClass:"k-collection-footer"},[e("k-text",{staticClass:"k-help k-collection-help",attrs:{html:t.help}}),t.hasPagination?e("k-pagination",t._b({on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.paginationOptions,!1)):t._e()],1):t._e()],1)}),[],!1,null,null,null,null).exports;const ht=ut({mixins:[tt],props:{text:String,icon:String},emits:["click"],computed:{attrs(){const t={button:void 0!==this.$listeners.click,icon:this.icon,theme:"empty"};return"cardlets"!==this.layout&&"cards"!==this.layout||(t.align="center",t.height="var(--item-height-cardlet)"),t}}},(function(){var t=this;return(0,t._self._c)("k-box",t._b({staticClass:"k-empty",nativeOn:{click:function(e){return t.$emit("click",e)}}},"k-box",t.attrs,!1),[t._t("default",(function(){return[t._v(" "+t._s(t.text)+" ")]}))],2)}),[],!1,null,null,null,null).exports,mt={mixins:[tt],props:{image:[Object,Boolean],width:{type:String,default:"1/1"}}};const ft=ut({mixins:[mt],inheritAttrs:!1,computed:{attrs(){return{back:this.image.back??"gray-500",cover:!0,...this.image,ratio:"list"===this.layout?"auto":this.image.ratio,size:this.sizes}},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.src?e("k-image-frame",t._b({staticClass:"k-item-image"},"k-image-frame",t.attrs,!1)):e("k-icon-frame",t._b({staticClass:"k-item-image"},"k-icon-frame",t.attrs,!1))}),[],!1,null,null,null,null).exports;const gt=ut({mixins:[mt,tt],inheritAttrs:!1,props:{buttons:{type:Array,default:()=>[]},data:Object,info:String,link:{type:[Boolean,String,Function]},options:{type:[Array,Function,String]},sortable:Boolean,target:String,text:String,theme:String},emits:["action","click","drag","option"],computed:{hasFigure(){return!1!==this.image&&this.$helper.object.length(this.image)>0},title(){return this.$helper.string.stripHTML(this.$helper.string.unescapeHTML(this.text)).trim()}},methods:{onOption(t){this.$emit("action",t),this.$emit("option",t)}}},(function(){var t,e=this,i=e._self._c;return i("div",e._b({staticClass:"k-item",class:!!e.layout&&"k-"+e.layout+"-item",attrs:{"data-has-image":e.hasFigure,"data-layout":e.layout,"data-theme":e.theme},on:{click:function(t){return e.$emit("click",t)},dragstart:function(t){return e.$emit("drag",t)}}},"div",e.data,!1),[e._t("image",(function(){return[e.hasFigure?i("k-item-image",{attrs:{image:e.image,layout:e.layout,width:e.width}}):e._e()]})),e.sortable?i("k-sort-handle",{staticClass:"k-item-sort-handle",attrs:{tabindex:"-1"}}):e._e(),i("div",{staticClass:"k-item-content"},[i("h3",{staticClass:"k-item-title",attrs:{title:e.title}},[!1!==e.link?i("k-link",{attrs:{target:e.target,to:e.link}},[i("span",{domProps:{innerHTML:e._s(e.text??"–")}})]):i("span",{domProps:{innerHTML:e._s(e.text??"–")}})],1),e.info?i("p",{staticClass:"k-item-info",domProps:{innerHTML:e._s(e.info)}}):e._e()]),i("div",{staticClass:"k-item-options",attrs:{"data-only-option":!(null==(t=e.buttons)?void 0:t.length)||!e.options&&!e.$slots.options}},[e._l(e.buttons,(function(t,n){return i("k-button",e._b({key:"button-"+n},"k-button",t,!1))})),e._t("options",(function(){return[e.options?i("k-options-dropdown",{staticClass:"k-item-options-dropdown",attrs:{options:e.options},on:{option:e.onOption}}):e._e()]}))],2)],2)}),[],!1,null,null,null,null).exports,kt={install(t){t.component("k-collection",pt),t.component("k-empty",ht),t.component("k-item",gt),t.component("k-item-image",ft),t.component("k-items",dt)}};const bt=ut({},(function(){return(0,this._self._c)("div",{staticClass:"k-dialog-body"},[this._t("default")],2)}),[],!1,null,null,null,null).exports;function vt(t){return"object"==typeof t&&(null==t?void 0:t.constructor)===Object}function yt(t){return Object.keys(t??{}).length}function $t(t){return Object.keys(t).reduce(((e,i)=>(e[i.toLowerCase()]=t[i],e)),{})}const wt={clone:function(t){if(void 0!==t)return structuredClone(t)},isEmpty:function(t){return null==t||""===t||(!(!vt(t)||0!==yt(t))||0===t.length)},isObject:vt,length:yt,merge:function t(e,i={}){for(const n in i)i[n]instanceof Object&&Object.assign(i[n],t(e[n]??{},i[n]));return Object.assign(e??{},i),e},same:function(t,e){return JSON.stringify(t)===JSON.stringify(e)},toLowerKeys:$t},xt={props:{cancelButton:{default:!0,type:[Boolean,String,Object]},disabled:{default:!1,type:Boolean},icon:{default:"check",type:String},submitButton:{type:[Boolean,String,Object],default:!0},theme:{default:"positive",type:String}}};const _t=ut({mixins:[xt],emits:["cancel"],computed:{cancel(){return this.button(this.cancelButton,{click:()=>this.$emit("cancel"),class:"k-dialog-button-cancel",icon:"cancel",text:this.$t("cancel"),variant:"filled"})},submit(){return this.button(this.submitButton,{class:"k-dialog-button-submit",disabled:this.disabled||this.$panel.dialog.isLoading,icon:this.icon,text:this.$t("confirm"),theme:this.theme,type:"submit",variant:"filled"})}},methods:{button:(t,e)=>"string"==typeof t?{...e,text:t}:!1!==t&&(!1===vt(t)?e:{...e,...t})}},(function(){var t=this,e=t._self._c;return e("k-button-group",{staticClass:"k-dialog-buttons"},[t.cancel?e("k-button",t._b({},"k-button",t.cancel,!1)):t._e(),t.submit?e("k-button",t._b({attrs:{icon:t.$panel.dialog.isLoading?"loader":t.submit.icon}},"k-button",t.submit,!1)):t._e()],1)}),[],!1,null,null,null,null).exports,Ct={props:{empty:{default:()=>window.panel.$t("dialog.fields.empty"),type:String},fields:{default:()=>[],type:[Array,Object]},novalidate:{default:!0,type:Boolean},value:{default:()=>({}),type:Object}}};const St=ut({mixins:[Ct],emits:["input","submit"],computed:{hasFields(){return this.$helper.object.length(this.fields)>0}}},(function(){var t=this,e=t._self._c;return t.hasFields?e("k-fieldset",{staticClass:"k-dialog-fields",attrs:{novalidate:t.novalidate,fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports;const Ot=ut({},(function(){return(0,this._self._c)("footer",{staticClass:"k-dialog-footer"},[this._t("default")],2)}),[],!1,null,null,null,null).exports;const Mt=ut({},(function(){var t=this,e=t._self._c;return"dialog"===t.$panel.notification.context?e("k-notification",{staticClass:"k-dialog-notification"}):t._e()}),[],!1,null,null,null,null).exports;const At=ut({props:{autofocus:{default:!0,type:Boolean},placeholder:{type:String},value:{type:String}},emits:["search"]},(function(){var t=this;return(0,t._self._c)("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:t.autofocus,placeholder:t.placeholder,value:t.value,icon:"search",type:"search"},on:{input:function(e){return t.$emit("search",e)}}})}),[],!1,null,null,null,null).exports,It={props:{empty:{type:String,default:()=>window.panel.$t("dialog.text.empty")},text:{type:String}}};const Dt=ut({mixins:[It]},(function(){var t=this,e=t._self._c;return t.text?e("k-text",{attrs:{html:t.text}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports,jt={install(t){t.component("k-dialog-body",bt),t.component("k-dialog-buttons",_t),t.component("k-dialog-fields",St),t.component("k-dialog-footer",Ot),t.component("k-dialog-notification",Mt),t.component("k-dialog-search",At),t.component("k-dialog-text",Dt)}},Et={mixins:[xt],props:{size:{default:"default",type:String},visible:{default:!1,type:Boolean}},emits:["cancel","close","input","submit","success"],methods:{cancel(){this.$emit("cancel")},close(){this.$emit("close")},error(t){this.$panel.notification.error(t)},focus(t){this.$panel.dialog.focus(t)},input(t){this.$emit("input",t)},open(){this.$panel.dialog.open(this)},submit(){this.$emit("submit",this.value)},success(t){this.$emit("success",t)}}};const Lt=ut({mixins:[Et]},(function(){var t=this,e=t._self._c;return t.visible?e("portal",{attrs:{to:"dialog"}},[e("form",{staticClass:"k-dialog",class:t.$vnode.data.staticClass,attrs:{"data-has-footer":t.cancelButton||t.submitButton,"data-size":t.size,method:"dialog"},on:{click:function(t){t.stopPropagation()},submit:function(e){return e.preventDefault(),t.$emit("submit")}}},[t._t("header",(function(){return[e("k-dialog-notification")]})),t.$slots.default?e("k-dialog-body",[t._t("default")],2):t._e(),t._t("footer",(function(){return[t.cancelButton||t.submitButton?e("k-dialog-footer",[e("k-dialog-buttons",{attrs:{"cancel-button":t.cancelButton,disabled:t.disabled,icon:t.icon,"submit-button":t.submitButton,theme:t.theme},on:{cancel:function(e){return t.$emit("cancel")}}})],1):t._e()]}))],2)]):t._e()}),[],!1,null,null,null,null).exports;const Tt=ut({mixins:[Et],props:{cancelButton:{default:!1},changes:{type:Array},loading:{type:Boolean},size:{default:"medium"},submitButton:{default:!1}},computed:{ids(){return Object.keys(this.store).filter((t=>{var e;return this.$helper.object.length(null==(e=this.store[t])?void 0:e.changes)>0}))},store(){return this.$store.state.content.models}},watch:{ids:{handler(t){this.$panel.dialog.refresh({method:"POST",body:{ids:t}})},immediate:!0}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({staticClass:"k-changes-dialog"},"k-dialog",t.$props,!1),[!1===t.loading?[e("k-headline",[t._v(t._s(t.$t("lock.unsaved")))]),t.changes.length?e("k-items",{attrs:{items:t.changes,layout:"list"}}):e("k-empty",{attrs:{icon:"edit-line"}},[t._v(t._s(t.$t("lock.unsaved.empty")))])]:[e("k-icon",{attrs:{type:"loader"}})]],2)}),[],!1,null,null,null,null).exports;const Bt=ut({mixins:[Et,Ct],props:{fields:{default:()=>({href:{label:window.panel.$t("email"),type:"email",icon:"email"},title:{label:window.panel.$t("title"),type:"text",icon:"title"}})},size:{default:"medium"},submitButton:{default:()=>window.panel.$t("insert")}},data(){return{values:{href:"",title:null,...this.value}}},methods:{submit(){this.$emit("submit",this.values)}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",t._b({attrs:{value:t.values},on:{cancel:function(e){return t.$emit("cancel")},input:function(e){t.values=e},submit:t.submit}},"k-form-dialog",t.$props,!1))}),[],!1,null,null,null,null).exports;const qt=ut({mixins:[Et],props:{details:[Object,Array],message:String,size:{default:"medium",type:String}},emits:["cancel"],computed:{detailsList(){return Array.fromObject(this.details)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-error-dialog",attrs:{"cancel-button":!1,"submit-button":!1,size:t.size,visible:t.visible},on:{cancel:function(e){return t.$emit("cancel")}}},[e("k-text",[t._v(t._s(t.message))]),t.detailsList.length?e("dl",{staticClass:"k-error-details"},[t._l(t.detailsList,(function(i,n){return[e("dt",{key:"detail-label-"+n},[t._v(" "+t._s(i.label)+" ")]),e("dd",{key:"detail-message-"+n},["object"==typeof i.message?[e("ul",t._l(i.message,(function(i,n){return e("li",{key:n},[t._v(" "+t._s(i)+" ")])})),0)]:[t._v(" "+t._s(i.message)+" ")]],2)]}))],2):t._e()],1)}),[],!1,null,null,null,null).exports;const Pt=ut({},(function(){var t=this;return(0,t._self._c)(t.$panel.dialog.component,t._g(t._b({key:t.$panel.dialog.timestamp,tag:"component",attrs:{visible:!0}},"component",t.$panel.dialog.props,!1),t.$panel.dialog.listeners()))}),[],!1,null,null,null,null).exports,Nt=(t,e)=>{let i=null;return(...n)=>{clearTimeout(i),i=setTimeout((()=>t.apply(void 0,n)),e)}},zt={props:{delay:{default:200,type:Number},hasSearch:{default:!0,type:Boolean}},data:()=>({query:""}),watch:{query(){!1!==this.hasSearch&&this.search()}},created(){this.search=Nt(this.search,this.delay)},methods:{async search(){console.warn("Search mixin: Please implement a `search` method.")}}},Ft={props:{endpoint:String,empty:Object,fetchParams:Object,item:{type:Function,default:t=>t},max:Number,multiple:{type:Boolean,default:!0},size:{type:String,default:"medium"},value:{type:Array,default:()=>[]}}};const Yt=ut({mixins:[Et,zt,Ft],emits:["cancel","fetched","submit"],data(){return{models:[],selected:this.value.reduce(((t,e)=>({...t,[e]:{id:e}})),{}),pagination:{limit:20,page:1,total:0}}},computed:{items(){return this.models.map(this.item)}},watch:{fetchParams(t,e){!1===this.$helper.object.same(t,e)&&(this.pagination.page=1,this.fetch())}},mounted(){this.fetch()},methods:{async fetch(){const t={page:this.pagination.page,search:this.query,...this.fetchParams};try{this.$panel.dialog.isLoading=!0;const e=await this.$api.get(this.endpoint,t);this.models=e.data,this.pagination=e.pagination,this.$emit("fetched",e)}catch(e){this.$panel.error(e),this.models=[]}finally{this.$panel.dialog.isLoading=!1}},isSelected(t){return void 0!==this.selected[t.id]},paginate(t){this.pagination.page=t.page,this.pagination.limit=t.limit,this.fetch()},submit(){this.$emit("submit",Object.values(this.selected))},async search(){this.pagination.page=0,await this.fetch()},toggle(t){if(!1!==this.multiple&&1!==this.max||(this.selected={}),this.isSelected(t))return Vue.del(this.selected,t.id);this.max&&this.max<=this.$helper.object.length(this.selected)||Vue.set(this.selected,t.id,t)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({staticClass:"k-models-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},"k-dialog",t.$props,!1),[t._t("header"),t.hasSearch?e("k-dialog-search",{attrs:{value:t.query},on:{search:function(e){t.query=e}}}):t._e(),e("k-collection",{attrs:{empty:{...t.empty,text:t.$panel.dialog.isLoading?t.$t("loading"):t.empty.text},items:t.items,link:!1,pagination:{details:!0,dropdown:!1,align:"center",...t.pagination},sortable:!1,layout:"list"},on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:i}){return[e("k-choice-input",{attrs:{checked:t.isSelected(i),type:t.multiple&&1!==t.max?"checkbox":"radio",title:t.isSelected(i)?t.$t("remove"):t.$t("select")},on:{click:function(e){return e.stopPropagation(),t.toggle(i)}}}),t._t("options",null,null,{item:i})]}}],null,!0)})],2)}),[],!1,null,null,null,null).exports;const Rt=ut({mixins:[Et,Ft],props:{empty:{type:Object,default:()=>({icon:"image",text:window.panel.$t("dialog.files.empty")})}}},(function(){var t=this;return(0,t._self._c)("k-models-dialog",t._b({on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",e)}}},"k-models-dialog",t.$props,!1))}),[],!1,null,null,null,null).exports;const Ut=ut({mixins:[Et,Ct],props:{size:{default:"medium"},submitButton:{default:()=>window.panel.$t("save")},text:{type:String}},emits:["cancel","input","submit"]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-dialog",t.$props,!1),[t._t("default",(function(){return[t.text?e("k-dialog-text",{attrs:{text:t.text}}):t._e(),e("k-dialog-fields",{attrs:{fields:t.fields,novalidate:t.novalidate,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})]}))],2)}),[],!1,null,null,null,null).exports;const Ht=ut({extends:Ut,watch:{"value.name"(t){this.fields.code.disabled||this.onNameChanges(t)},"value.code"(t){this.fields.code.disabled||(this.value.code=this.$helper.slug(t,[this.$panel.system.ascii]),this.onCodeChanges(this.value.code))}},methods:{onCodeChanges(t){if(!t)return this.value.locale=null;if(t.length>=2)if(-1!==t.indexOf("-")){let e=t.split("-"),i=[e[0],e[1].toUpperCase()];this.value.locale=i.join("_")}else{let e=this.$panel.system.locales??[];this.value.locale=null==e?void 0:e[t]}},onNameChanges(t){this.value.code=this.$helper.slug(t,[this.value.rules,this.$panel.system.ascii]).substr(0,2)}}},null,null,!1,null,null,null,null).exports;const Vt=ut({mixins:[{mixins:[Et],props:{license:Object,size:{default:"large"}}}]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-license-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-bar",{staticStyle:{"margin-bottom":"var(--spacing-2)"}},[e("h2",{staticClass:"k-headline"},[t._v(" "+t._s(t.$t("license"))+" ")])]),e("div",{staticClass:"k-table"},[e("table",{staticStyle:{"table-layout":"auto"}},[e("tbody",[e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("type")))]),e("td",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.license.type))])]),t.license.code?e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("license.code")))]),e("td",{staticClass:"k-text",attrs:{"data-mobile":"true"}},[e("code",[t._v(t._s(t.license.code))])])]):t._e(),t.license.info?e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("status")))]),e("td",{attrs:{"data-mobile":"true","data-theme":t.license.theme}},[e("p",{staticClass:"k-license-dialog-status"},[e("k-icon",{attrs:{type:t.license.icon}}),t._v(" "+t._s(t.license.info)+" ")],1)])]):t._e()])])])],1)}),[],!1,null,null,null,null).exports;const Kt=ut({mixins:[Et,Ct],props:{fields:{default:()=>({href:{label:window.panel.$t("link"),type:"link",placeholder:window.panel.$t("url.placeholder"),icon:"url"},title:{label:window.panel.$t("title"),type:"text",icon:"title"},target:{label:window.panel.$t("open.newWindow"),type:"toggle",text:[window.panel.$t("no"),window.panel.$t("yes")]}})},size:{default:"medium"},submitButton:{default:()=>window.panel.$t("insert")}},data(){return{values:{href:"",title:null,...this.value,target:Boolean(this.value.target??!1)}}},methods:{submit(){const t=this.values.href.replace("file://","/@/file/").replace("page://","/@/page/");this.$emit("submit",{...this.values,href:t,target:this.values.target?"_blank":null})}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",t._b({attrs:{value:t.values},on:{cancel:function(e){return t.$emit("cancel")},input:function(e){t.values=e},submit:t.submit}},"k-form-dialog",t.$props,!1))}),[],!1,null,null,null,null).exports;const Wt=ut({mixins:[Ut],props:{blueprints:{type:Array},size:{default:"medium",type:String},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("save")},template:{type:String}},computed:{templates(){return this.blueprints.map((t=>({text:t.title,value:t.name})))}},methods:{pick(t){this.$panel.dialog.reload({query:{...this.$panel.dialog.query,slug:this.value.slug,template:t,title:this.value.title}})}}},(function(){var t=this,e=t._self._c;return e("k-form-dialog",t._b({ref:"dialog",staticClass:"k-page-create-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-form-dialog",t.$props,!1),[t.templates.length>1?e("k-select-field",{staticClass:"k-page-template-switch",attrs:{empty:!1,label:t.$t("template"),options:t.templates,required:!0,value:t.template},on:{input:function(e){return t.pick(e)}}}):t._e(),e("k-dialog-fields",{attrs:{fields:t.fields,novalidate:t.novalidate,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],1)}),[],!1,null,null,null,null).exports;const Jt=ut({mixins:[Et],props:{value:{default:()=>({}),type:Object}},emits:["cancel","input","submit"],methods:{select(t){this.$emit("input",{...this.value,parent:t.value})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-page-move-dialog",attrs:{"submit-button":{icon:"parent",text:t.$t("move")},size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-dialog",t.$props,!1),[e("k-headline",[t._v(t._s(t.$t("page.move")))]),e("div",{staticClass:"k-page-move-parent",attrs:{tabindex:"0","data-autofocus":""}},[e("k-page-tree",{attrs:{current:t.value.parent,move:t.value.move,identifier:"id"},on:{select:t.select}})],1)],1)}),[],!1,null,null,null,null).exports;const Gt=ut({mixins:[Et,Ft],props:{empty:{type:Object,default:()=>({icon:"page",text:window.panel.$t("dialog.pages.empty")})}},data:()=>({model:null,parent:null})},(function(){var t=this,e=t._self._c;return e("k-models-dialog",t._b({attrs:{"fetch-params":{parent:t.parent}},on:{cancel:function(e){return t.$emit("cancel")},fetched:function(e){t.model=e.model},submit:function(e){return t.$emit("submit",e)}},scopedSlots:t._u([t.model?{key:"header",fn:function(){return[e("header",{staticClass:"k-pages-dialog-navbar"},[e("k-button",{attrs:{disabled:!t.model.id,title:t.$t("back"),icon:"angle-left"},on:{click:function(e){t.parent=t.model.parent}}}),e("k-headline",[t._v(t._s(t.model.title))])],1)]},proxy:!0}:null,t.model?{key:"options",fn:function({item:i}){return[e("k-button",{staticClass:"k-pages-dialog-option",attrs:{disabled:!i.hasChildren,title:t.$t("open"),icon:"angle-right"},on:{click:function(e){e.stopPropagation(),t.parent=i.id}}})]}}:null],null,!0)},"k-models-dialog",t.$props,!1))}),[],!1,null,null,null,null).exports;const Xt=ut({mixins:[{mixins:[Et,It]}]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[t._t("default",(function(){return[e("k-dialog-text",{attrs:{text:t.text}})]}))],2)}),[],!1,null,null,null,null).exports;const Zt=ut({mixins:[Xt],props:{icon:{default:"trash"},submitButton:{default:()=>window.panel.$t("delete")},theme:{default:"negative"}}},(function(){var t=this;return(0,t._self._c)("k-text-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-text-dialog",t.$props,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Qt=ut({mixins:[Et],props:{type:String},emits:["cancel"],data:()=>({results:null,pagination:{}}),methods:{focus(){var t;null==(t=this.$refs.search)||t.focus()},navigate(t){t&&(this.$go(t.link),this.close())},async search({type:t,query:e}){const i=await this.$panel.search(t,e);i&&(this.results=i.results,this.pagination=i.pagination)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{staticClass:"k-search-dialog",attrs:{"cancel-button":!1,"submit-button":!1,visible:!0,role:"search",size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[e("k-search-bar",{ref:"search",attrs:{"default-type":t.type??t.$panel.view.search,"is-loading":t.$panel.searcher.isLoading,pagination:t.pagination,results:t.results,types:t.$panel.searches},on:{close:t.close,more:function(e){return t.$go("search",{query:e})},navigate:t.navigate,search:t.search}})],1)}),[],!1,null,null,null,null).exports;const te=ut({mixins:[{mixins:[Et,Ct]}],props:{fields:null,qr:{type:String,required:!0},size:{default:"large"},submitButton:{default:()=>({text:window.panel.$t("activate"),icon:"lock",theme:"notice"})}},emits:["cancel","input","submit"]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-dialog-text",{staticClass:"k-totp-dialog-intro",attrs:{text:t.$t("login.totp.enable.intro")}}),e("div",{staticClass:"k-totp-dialog-grid"},[e("div",{staticClass:"k-totp-qrcode"},[e("k-info-field",{attrs:{label:t.$t("login.totp.enable.qr.label"),text:t.qr,help:t.$t("login.totp.enable.qr.help",{secret:t.value.secret}),theme:"passive"}})],1),e("k-dialog-fields",{staticClass:"k-totp-dialog-fields",attrs:{fields:{info:{label:t.$t("login.totp.enable.confirm.headline"),type:"info",text:t.$t("login.totp.enable.confirm.text"),theme:"none"},confirm:{label:t.$t("login.totp.enable.confirm.label"),type:"text",counter:!1,font:"monospace",required:!0,placeholder:t.$t("login.code.placeholder.totp"),help:t.$t("login.totp.enable.confirm.help")},secret:{type:"hidden"}},novalidate:!0,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],1)],1)}),[],!1,null,null,null,null).exports;const ee=ut({mixins:[Et],props:{submitButton:{type:[String,Boolean,Object],default:()=>({icon:"upload",text:window.panel.$t("upload")})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-upload-dialog",attrs:{disabled:t.disabled||0===t.$panel.upload.files.length},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-dropzone",{on:{drop:function(e){return t.$panel.upload.select(e)}}},[0===t.$panel.upload.files.length?e("k-empty",{attrs:{icon:"upload",layout:"cards"},on:{click:function(e){return t.$panel.upload.pick()}}},[t._v(" "+t._s(t.$t("files.empty"))+" ")]):e("k-upload-items",{attrs:{items:t.$panel.upload.files},on:{remove:e=>{t.$panel.upload.remove(e.id)},rename:(t,e)=>{t.name=e}}})],1)],1)}),[],!1,null,null,null,null).exports;const ie=ut({extends:ee,props:{original:Object,submitButton:{type:[String,Boolean,Object],default:()=>({icon:"upload",text:window.panel.$t("replace")})}},computed:{file(){return this.$panel.upload.files[0]}}},(function(){var t,e,i,n,s=this,o=s._self._c;return o("k-dialog",s._b({ref:"dialog",staticClass:"k-upload-dialog k-upload-replace-dialog",on:{cancel:function(t){return s.$emit("cancel")},submit:function(t){return s.$emit("submit")}}},"k-dialog",s.$props,!1),[o("ul",{staticClass:"k-upload-items"},[o("li",{staticClass:"k-upload-original"},[o("k-upload-item-preview",{attrs:{color:null==(t=s.original.image)?void 0:t.color,icon:null==(e=s.original.image)?void 0:e.icon,url:s.original.url,type:s.original.mime}})],1),o("li",[s._v("←")]),o("k-upload-item",s._b({attrs:{color:null==(i=s.original.image)?void 0:i.color,editable:!1,icon:null==(n=s.original.image)?void 0:n.icon,name:s.$helper.file.name(s.original.filename),removable:!1}},"k-upload-item",s.file,!1))],1)])}),[],!1,null,null,null,null).exports;const ne=ut({mixins:[Et,Ft],props:{empty:{type:Object,default:()=>({icon:"users",text:window.panel.$t("dialog.users.empty")})},item:{type:Function,default:t=>({...t,key:t.email,info:t.info!==t.text?t.info:null})}}},(function(){var t=this;return(0,t._self._c)("k-models-dialog",t._b({on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",e)}}},"k-models-dialog",t.$props,!1))}),[],!1,null,null,null,null).exports,se={install(t){t.use(jt),t.component("k-dialog",Lt),t.component("k-changes-dialog",Tt),t.component("k-email-dialog",Bt),t.component("k-error-dialog",qt),t.component("k-fiber-dialog",Pt),t.component("k-files-dialog",Rt),t.component("k-form-dialog",Ut),t.component("k-license-dialog",Vt),t.component("k-link-dialog",Kt),t.component("k-language-dialog",Ht),t.component("k-models-dialog",Yt),t.component("k-page-create-dialog",Wt),t.component("k-page-move-dialog",Jt),t.component("k-pages-dialog",Gt),t.component("k-remove-dialog",Zt),t.component("k-search-dialog",Qt),t.component("k-text-dialog",Xt),t.component("k-totp-dialog",te),t.component("k-upload-dialog",ee),t.component("k-upload-replace-dialog",ie),t.component("k-users-dialog",ne)}};const oe=ut({},(function(){return(0,this._self._c)("div",{staticClass:"k-drawer-body scroll-y-auto"},[this._t("default")],2)}),[],!1,null,null,null,null).exports,le={props:{empty:{type:String,default:()=>window.panel.$t("drawer.fields.empty")},fields:Object,novalidate:{type:Boolean,default:!0},value:Object}};const ae=ut({mixins:[le],emits:["input","submit"],computed:{hasFields(){return this.$helper.object.length(this.fields)>0}}},(function(){var t=this,e=t._self._c;return t.hasFields?e("k-fieldset",{staticClass:"k-drawer-fields",attrs:{novalidate:t.novalidate,fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports,re={props:{breadcrumb:{default:()=>[],type:Array},tab:{type:String},tabs:{default:()=>({}),type:Object}}};const ue=ut({mixins:[re],emits:["crumb","tab"]},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-drawer-header"},[e("nav",{staticClass:"k-breadcrumb k-drawer-breadcrumb"},[e("ol",t._l(t.breadcrumb,(function(i,n){return e("li",{key:i.id},[e("k-button",{staticClass:"k-breadcrumb-link",attrs:{icon:i.props.icon,text:i.props.title,current:n===t.breadcrumb.length-1,variant:"dimmed"},on:{click:function(e){return t.$emit("crumb",i.id)}}})],1)})),0)]),e("k-drawer-tabs",{attrs:{tab:t.tab,tabs:t.tabs},on:{open:function(e){return t.$emit("tab",e)}}}),e("nav",{staticClass:"k-drawer-options"},[t._t("default"),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"check",type:"submit"}})],2)],1)}),[],!1,null,null,null,null).exports;const ce=ut({},(function(){var t=this,e=t._self._c;return"drawer"===t.$panel.notification.context?e("k-notification",{staticClass:"k-drawer-notification"}):t._e()}),[],!1,null,null,null,null).exports;const de=ut({mixins:[{props:{tab:{type:String},tabs:{default:()=>({}),type:[Array,Object]}}}],emits:["open"],computed:{hasTabs(){return this.$helper.object.length(this.tabs)>1}}},(function(){var t=this,e=t._self._c;return t.hasTabs?e("nav",{staticClass:"k-drawer-tabs"},t._l(t.tabs,(function(i){return e("k-button",{key:i.name,staticClass:"k-drawer-tab",attrs:{current:t.tab===i.name,text:i.label},on:{click:function(e){return t.$emit("open",i.name)}}})})),1):t._e()}),[],!1,null,null,null,null).exports,pe={props:{empty:{type:String,default:()=>window.panel.$t("drawer.text.empty")},text:{type:String}}};const he=ut({mixins:[pe]},(function(){var t=this,e=t._self._c;return t.text?e("k-text",{attrs:{html:t.text}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports,me={install(t){t.component("k-drawer-body",oe),t.component("k-drawer-fields",ae),t.component("k-drawer-header",ue),t.component("k-drawer-notification",ce),t.component("k-drawer-tabs",de),t.component("k-drawer-text",he)}},fe={mixins:[re],props:{disabled:{default:!1,type:Boolean},icon:String,id:String,options:{type:Array},title:String,visible:{default:!1,type:Boolean}}};const ge=ut({mixins:[fe],emits:["cancel","crumb","submit","tab"]},(function(){var t=this,e=t._self._c;return t.visible?e("portal",{attrs:{to:"drawer"}},[e("form",{staticClass:"k-drawer",class:t.$vnode.data.staticClass,attrs:{"aria-disabled":t.disabled,method:"dialog"},on:{submit:function(e){return e.preventDefault(),t.$emit("submit")}}},[e("k-drawer-notification"),e("k-drawer-header",{attrs:{breadcrumb:t.breadcrumb,tab:t.tab,tabs:t.tabs},on:{crumb:function(e){return t.$emit("crumb",e)},tab:function(e){return t.$emit("tab",e)}}},[t._t("options",(function(){return[t._l(t.options,(function(i,n){return[i.dropdown?[e("k-button",t._b({key:"btn-"+n,staticClass:"k-drawer-option",on:{click:function(e){t.$refs["dropdown-"+n][0].toggle()}}},"k-button",i,!1)),e("k-dropdown-content",{key:"dropdown-"+n,ref:"dropdown-"+n,refInFor:!0,attrs:{options:i.dropdown,"align-x":"end",theme:"light"}})]:e("k-button",t._b({key:n,staticClass:"k-drawer-option"},"k-button",i,!1))]}))]}))],2),e("k-drawer-body",[t._t("default")],2)],1)]):t._e()}),[],!1,null,null,null,null).exports,ke={props:{hidden:{type:Boolean},next:{type:Object},prev:{type:Object}}};const be=ut({mixins:[fe,le,ke],emits:["cancel","crumb","input","next","prev","remove","show","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-form-drawer",t._b({ref:"drawer",staticClass:"k-block-drawer",on:{cancel:function(e){return t.$emit("cancel",e)},crumb:function(e){return t.$emit("crumb",e)},input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)},tab:function(e){return t.$emit("tab",e)}},scopedSlots:t._u([{key:"options",fn:function(){return[t.hidden?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 t.$emit("prev")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return t.$emit("next")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return t.$emit("remove")}}})]},proxy:!0}])},"k-form-drawer",t.$props,!1))}),[],!1,null,null,null,null).exports;const ve=ut({methods:{isCurrent(t){return this.$panel.drawer.id===t}}},(function(){var t=this,e=t._self._c;return e("div",t._l(t.$panel.drawer.history.milestones,(function(i){return e(i.component,t._g(t._b({key:i.id,tag:"component",attrs:{breadcrumb:t.$panel.drawer.breadcrumb,disabled:!1===t.isCurrent(i.id),visible:!0}},"component",t.isCurrent(i.id)?t.$panel.drawer.props:i.props,!1),t.isCurrent(i.id)?t.$panel.drawer.listeners():i.on))})),1)}),[],!1,null,null,null,null).exports;const ye=ut({mixins:[fe,le],emits:["cancel","crumb","input","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-drawer",t._b({ref:"drawer",staticClass:"k-form-drawer",on:{cancel:function(e){return t.$emit("cancel")},crumb:function(e){return t.$emit("crumb",e)},submit:function(e){return t.$emit("submit",t.value)},tab:function(e){return t.$emit("tab",e)}}},"k-drawer",t.$props,!1),[t._t("options",null,{slot:"options"}),e("k-drawer-fields",{attrs:{fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],2)}),[],!1,null,null,null,null).exports;const $e=ut({mixins:[fe,le,{props:{next:{type:Object},prev:{type:Object}}}],emits:["cancel","crumb","input","next","prev","remove","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-form-drawer",t._b({ref:"drawer",staticClass:"k-structure-drawer",on:{cancel:function(e){return t.$emit("cancel",e)},crumb:function(e){return t.$emit("crumb",e)},input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)},tab:function(e){return t.$emit("tab",e)}},scopedSlots:t._u([{key:"options",fn:function(){return[e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.prev,icon:"angle-left"},on:{click:function(e){return t.$emit("prev")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return t.$emit("next")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return t.$emit("remove")}}})]},proxy:!0}])},"k-form-drawer",t.$props,!1))}),[],!1,null,null,null,null).exports;const we=ut({mixins:[fe,pe],emits:["cancel","crumb","input","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-drawer",t._b({ref:"drawer",staticClass:"k-text-drawer",on:{cancel:function(e){return t.$emit("cancel")},crumb:function(e){return t.$emit("crumb",e)},submit:function(e){return t.$emit("submit",t.value)},tab:function(e){return t.$emit("tab",e)}}},"k-drawer",t.$props,!1),[t._t("options",null,{slot:"options"}),e("k-dialog-text",{attrs:{text:t.text}})],2)}),[],!1,null,null,null,null).exports,xe={install(t){t.use(me),t.component("k-drawer",ge),t.component("k-block-drawer",be),t.component("k-fiber-drawer",ve),t.component("k-form-drawer",ye),t.component("k-structure-drawer",$e),t.component("k-text-drawer",we)}};const _e=ut({mounted(){window.panel.deprecated(" will be removed in a future version. Since Kirby 4.0, you don't need it anymore as wrapper element. Use `` as standalone instead.")}},(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 Ce=null;const Se=ut({props:{align:{type:String},alignX:{type:String,default:"start"},alignY:{type:String,default:"bottom"},disabled:{type:Boolean,default:!1},navigate:{default:!0,type:Boolean},options:[Array,Function,String],theme:{type:String,default:"dark"}},emits:["action","close","open"],data(){return{axis:{x:this.alignX,y:this.alignY},position:{x:0,y:0},isOpen:!1,items:[],opener:null}},mounted(){this.align&&window.panel.deprecated(": `align` prop will be removed in a future version. Use the `alignX` prop instead.")},methods:{close(){var t;null==(t=this.$refs.dropdown)||t.close()},async fetchOptions(t){return this.options?"string"==typeof this.options?this.$dropdown(this.options)(t):"function"==typeof this.options?this.options(t):Array.isArray(this.options)?t(this.options):void 0:t(this.items)},focus(t=0){this.$refs.navigate.focus(t)},onClick(){this.close()},onClose(){this.resetPosition(),this.isOpen=Ce=!1,this.$emit("close"),window.removeEventListener("resize",this.setPosition)},async onOpen(){this.isOpen=!0;const t=window.scrollY;Ce=this,await this.$nextTick(),this.$el&&this.opener&&(window.addEventListener("resize",this.setPosition),await this.setPosition(),window.scrollTo(0,t),this.$emit("open"))},onOptionClick(t){return this.close(),"function"==typeof t.click?t.click.call(this):"string"==typeof t.click?this.$emit("action",t.click):void(t.click&&(t.click.name&&this.$emit(t.click.name,t.click.payload),t.click.global&&this.$events.emit(t.click.global,t.click.payload)))},open(t){var e,i;if(!0===this.disabled)return!1;Ce&&Ce!==this&&Ce.close(),this.opener=t??(null==(e=window.event)?void 0:e.target.closest("button"))??(null==(i=window.event)?void 0:i.target),this.fetchOptions((t=>{this.items=t,this.onOpen()}))},async setPosition(){this.axis={x:this.alignX??this.align,y:this.alignY},"right"===this.axis.x?this.axis.x="end":"left"===this.axis.x&&(this.axis.x="start"),"rtl"===this.$panel.direction&&("start"===this.axis.x?this.axis.x="end":"end"===this.axis.x&&(this.axis.x="start")),this.opener.$el&&(this.opener=this.opener.$el);const t=this.opener.getBoundingClientRect();this.position.x=t.left+window.scrollX+t.width,this.position.y=t.top+window.scrollY+t.height,!0!==this.$el.open&&this.$el.showModal(),await this.$nextTick();const e=this.$el.getBoundingClientRect(),i=10;"end"===this.axis.x?t.left-e.widthwindow.innerWidth-i&&e.width+ie.top&&(this.axis.y="bottom"):t.top+e.height>window.innerHeight-i&&e.height+i!0===t.default));t.push(this.item(e)),t.push("-");const i=this.languages.filter((t=>!1===t.default));for(const n of i)t.push(this.item(n));return t}},methods:{change(t){this.$reload({query:{language:t.code}})},item(t){return{click:()=>this.change(t),current:t.code===this.language.code,text:t.name}}}},(function(){var t=this,e=t._self._c;return t.languages.length>1?e("div",{staticClass:"k-languages-dropdown"},[e("k-button",{attrs:{dropdown:!0,text:t.code,icon:"translate",responsive:"text",size:"sm",variant:"filled"},on:{click:function(e){return t.$refs.languages.toggle()}}}),e("k-dropdown-content",{ref:"languages",attrs:{options:t.options}})],1):t._e()}),[],!1,null,null,null,null).exports;const Ae=ut({props:{align:{type:String,default:"right"},disabled:{type:Boolean},icon:{type:String,default:"dots"},options:{type:[Array,Function,String],default:()=>[]},text:{type:[Boolean,String],default:!0},theme:{type:String,default:"dark"},size:String,variant:String},emits:["action","option"],computed:{hasSingleOption(){return Array.isArray(this.options)&&1===this.options.length}},methods:{onAction(t,e,i){"function"==typeof t?t.call(this):(this.$emit("action",t,e,i),this.$emit("option",t,e,i))},toggle(t=this.$el){this.$refs.options.toggle(t)}}},(function(){var t=this,e=t._self._c;return t.hasSingleOption?e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{disabled:t.disabled,icon:t.options[0].icon??t.icon,size:t.options[0].size??t.size,title:t.options[0].title??t.options[0].tooltip??t.options[0].text,variant:t.options[0].variant??t.variant},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("div",{staticClass:"k-options-dropdown"},[e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{disabled:t.disabled,dropdown:!0,icon:t.icon,size:t.size,text:!0!==t.text&&!1!==t.text?t.text:null,title:t.$t("options"),variant:t.variant},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",staticClass:"k-options-dropdown-content",attrs:{"align-x":t.align,options:t.options},on:{action:t.onAction}})],1):t._e()}),[],!1,null,null,null,null).exports,Ie={mixins:[V,W,X,nt,at]},De={mixins:[Ie],inheritAttrs:!1,emits:["input"],methods:{focus(){this.$el.focus()}}},je={mixins:[V,W,st,at],props:{ignore:{default:()=>[],type:Array},max:Number,min:Number,search:{default:!0,type:[Object,Boolean]}}},Ee={mixins:[Ie,je],props:{create:{type:[Boolean,Object],default:!1},multiple:{type:Boolean,default:!0},value:{type:[Array,String],default:()=>[]}},emits:["create","escape","input"]};const Le=ut({mixins:[De,Ee],data(){return{display:this.search.display??!0,query:""}},computed:{choices(){let t=this.filteredOptions;return!0!==this.display&&(t=t.slice(0,this.display)),t.map((t=>({...t,disabled:t.disabled||this.isFull&&!1===this.value.includes(t.value),text:this.highlight(t.text)})))},filteredOptions(){if(!(this.query.length<(this.search.min??0)))return this.$helper.array.search(this.options,this.query,{field:"text"})},isFull(){return this.max&&this.value.length>=this.max},placeholder(){return this.search.placeholder?this.search.placeholder:this.options.length>0?this.$t("filter")+"…":this.$t("enter")+"…"},showCreate(){var t;if(!1===this.create)return!1;if(this.isFull)return!1;if(0===this.query.trim().length)return!1;if(!0===this.ignore.includes(this.query))return!1;if(!0===(null==(t=this.create.ignore)?void 0:t.includes(this.query)))return!1;return 0===this.options.filter((t=>t.text===this.query||t.value===this.query)).length},showEmpty(){return!1===this.create&&0===this.filteredOptions.length}},watch:{value:{handler(){this.$emit("invalid",this.$v.$invalid,this.$v)},immediate:!0}},methods:{add(){this.showCreate&&this.$emit("create",this.query)},enter(t){var e;null==(e=t.target)||e.click()},escape(){0===this.query.length?this.$emit("escape"):this.query=""},focus(){var t;this.$refs.search?this.$refs.search.focus():null==(t=this.$refs.options)||t.focus()},highlight(t){if(t=this.$helper.string.stripHTML(t),this.query.length>0){const e=new RegExp(`(${RegExp.escape(this.query)})`,"ig");return t.replace(e,"$1")}return t},input(t){this.$emit("input",t)}},validations(){return{value:{required:!this.required||t.required,minLength:!this.min||t.minLength(this.min),maxLength:!this.max||t.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("k-navigate",{staticClass:"k-picklist-input",attrs:{element:"nav",axis:"y",select:"input[type=search], label, .k-picklist-input-body button"},on:{prev:function(e){return t.$emit("escape")}}},[t.search?e("header",{staticClass:"k-picklist-input-header"},[e("div",{staticClass:"k-picklist-input-search"},[e("k-search-input",{ref:"search",attrs:{autofocus:t.autofocus,disabled:t.disabled,placeholder:t.placeholder,value:t.query},on:{input:function(e){t.query=e}},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"escape",void 0,e.key,void 0)?null:(e.preventDefault(),t.escape.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.add.apply(null,arguments))}]}}),t.showCreate?e("k-button",{staticClass:"k-picklist-input-create",attrs:{icon:"add",size:"xs"},on:{click:t.add}}):t._e()],1)]):t._e(),t.filteredOptions.length?[e("div",{staticClass:"k-picklist-input-body"},[e(t.multiple?"k-checkboxes-input":"k-radio-input",{ref:"options",tag:"component",staticClass:"k-picklist-input-options",attrs:{disabled:t.disabled,options:t.choices,value:t.value},on:{input:t.input},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.enter.apply(null,arguments))}}}),!0!==t.display&&t.filteredOptions.length>t.display?e("k-button",{staticClass:"k-picklist-input-more",attrs:{icon:"angle-down"},on:{click:function(e){t.display=!0}}},[t._v(" "+t._s(t.$t("options.all",{count:t.filteredOptions.length}))+" ")]):t._e()],1)]:t.showEmpty?[e("div",{staticClass:"k-picklist-input-body"},[e("p",{staticClass:"k-picklist-input-empty"},[t._v(" "+t._s(t.$t("options.none"))+" ")])])]:t._e()],2)}),[],!1,null,null,null,null).exports;const Te=ut({mixins:[Ee],emits:["create","input"],methods:{close(){this.$refs.dropdown.close()},add(t){this.$emit("create",t)},input(t){this.$emit("input",t)},open(t){this.$refs.dropdown.open(t)},toggle(){this.$refs.dropdown.toggle()}}},(function(){var t=this,e=t._self._c;return e("k-dropdown-content",{ref:"dropdown",staticClass:"k-picklist-dropdown",attrs:{"align-x":"start",disabled:t.disabled,navigate:!1},nativeOn:{click:function(t){t.stopPropagation()}}},[e("k-picklist-input",t._b({on:{create:t.add,input:t.input,escape:function(e){return t.$refs.dropdown.close()}},nativeOn:{click:function(t){t.stopPropagation()}}},"k-picklist-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,Be={install(t){t.component("k-dropdown",_e),t.component("k-dropdown-content",Se),t.component("k-dropdown-item",Oe),t.component("k-languages-dropdown",Me),t.component("k-options-dropdown",Ae),t.component("k-picklist-dropdown",Te)}};const qe=ut({props:{html:{type:Boolean,default:!1},limit:{type:Number,default:10},skip:{type:Array,default:()=>[]},options:Array,query:String},emits:["leave","search","select"],data:()=>({matches:[],selected:{text:null}}),mounted(){window.panel.deprecated(" will be removed in a future version.")},methods:{close(){this.$refs.dropdown.close()},onSelect(t){this.$emit("select",t),this.$refs.dropdown.close()},search(t){const e=this.options.filter((t=>-1!==this.skip.indexOf(t.value)));this.matches=this.$helper.array.search(e,t,{field:"text",limit:this.limit}),this.$emit("search",t,this.matches),this.$refs.dropdown.open()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-autocomplete"},[t._t("default"),e("k-dropdown-content",{ref:"dropdown",attrs:{autofocus:!0},on:{leave:function(e){return t.$emit("leave")}}},t._l(t.matches,(function(i,n){return e("k-dropdown-item",t._b({key:n,nativeOn:{mousedown:function(e){return t.onSelect(i)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:(e.preventDefault(),t.onSelect(i))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onSelect(i))},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",i,!1),[e("span",{domProps:{innerHTML:t._s(t.html?i.text:t.$esc(i.text))}})])})),1),t._v(" "+t._s(t.query)+" ")],2)}),[],!1,null,null,null,null).exports;const Pe=ut({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.min&&t.max?[t._v(t._s(t.min)+"–"+t._s(t.max))]:t.min?[t._v("≥ "+t._s(t.min))]:t.max?[t._v("≤ "+t._s(t.max))]:t._e()],2):t._e()])}),[],!1,null,null,null,null).exports;const Ne=ut({props:{disabled:Boolean,config:Object,fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},emits:["focus","input","submit"],data:()=>({errors:{}}),methods:{focus(t){var e,i;null==(i=null==(e=this.$refs.fields)?void 0:e.focus)||i.call(e,t)},onFocus(t,e,i){this.$emit("focus",t,e,i)},onInput(t,e,i){this.$emit("input",t,e,i)},onInvalid(t){this.$emit("invalid",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",{ref:"fields",attrs:{disabled:t.disabled,fields:t.fields,novalidate:t.novalidate,value:t.value},on:{focus:t.onFocus,input:t.onInput,invalid:t.onInvalid,submit:t.onSubmit}})]})),t._t("footer"),e("input",{ref:"submitter",staticClass:"k-form-submitter",attrs:{type:"submit"}})],2)}),[],!1,null,null,null,null).exports;const ze=ut({props:{lock:[Boolean,Object]},data:()=>({isLoading:null,isLocking:null}),computed:{api(){return[this.$panel.view.path+"/lock",null,null,!0]},buttons(){return"unlock"===this.mode?[{icon:"check",text:this.$t("lock.isUnlocked"),click:()=>this.resolve()},{icon:"download",text:this.$t("download"),click:()=>this.download()}]:"lock"===this.mode?[{icon:this.lock.data.unlockable?"unlock":"loader",text:this.$t("lock.isLocked",{email:this.$esc(this.lock.data.email)}),title:this.$t("lock.unlock"),disabled:!this.lock.data.unlockable,click:()=>this.unlock()}]:"changes"===this.mode?[{icon:"undo",text:this.$t("revert"),click:()=>this.revert()},{icon:"check",text:this.$t("save"),click:()=>this.save()}]:[]},disabled(){return"unlock"!==this.mode&&("lock"===this.mode?!this.lock.data.unlockable:"changes"===this.mode&&this.isDisabled)},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":"changes"===this.mode?"notice":null}},watch:{hasChanges:{handler(t,e){!0===this.supportsLocking&&!1===this.isLocked&&!1===this.isUnlocked&&(!0===t?(this.locking(),this.isLocking=setInterval(this.locking,3e4)):e&&(clearInterval(this.isLocking),this.locking(!1)))},immediate:!0},isLocked(t){!1===t&&this.$events.emit("model.reload")}},mounted(){this.supportsLocking&&(this.isLoading=setInterval(this.check,1e4)),this.$events.on("view.save",this.save)},destroyed(){clearInterval(this.isLoading),clearInterval(this.isLocking),this.$events.off("view.save",this.save)},methods:{async check(){if(!1===this.$panel.isOffline){const{lock:t}=await this.$api.get(...this.api);Vue.set(this.$panel.view.props,"lock",t)}},download(){let t="";const e=this.$store.getters["content/changes"]();for(const n in e){const i=e[n];t+=n+": \n\n","object"==typeof i&&Object.keys(i).length||Array.isArray(i)&&i.length?t+=JSON.stringify(i,null,2):t+=i,t+="\n\n----\n\n"}let i=document.createElement("a");i.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),i.setAttribute("download",this.$panel.view.path+".txt"),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)},async locking(t=!0){if(!0!==this.$panel.isOffline)if(!0===t)try{await this.$api.patch(...this.api)}catch{clearInterval(this.isLocking),this.$store.dispatch("content/revert")}else clearInterval(this.isLocking),await this.$api.delete(...this.api)},async resolve(){await this.unlock(!1),this.$store.dispatch("content/revert")},revert(){this.$panel.dialog.open({component:"k-remove-dialog",props:{submitButton:{icon:"undo",text:this.$t("revert")},text:this.$t("revert.confirm")},on:{submit:()=>{this.$store.dispatch("content/revert"),this.$panel.dialog.close()}}})},async save(t){var e;null==(e=null==t?void 0:t.preventDefault)||e.call(t),await this.$store.dispatch("content/save"),this.$events.emit("model.update"),this.$panel.notification.success()},async unlock(t=!0){const e=[this.$panel.view.path+"/unlock",null,null,!0];!0!==t?(await this.$api.delete(...e),this.$reload({silent:!0})):this.$panel.dialog.open({component:"k-remove-dialog",props:{submitButton:{icon:"unlock",text:this.$t("lock.unlock")},text:this.$t("lock.unlock.submit",{email:this.$esc(this.lock.data.email)})},on:{submit:async()=>{await this.$api.patch(...e),this.$panel.dialog.close(),this.$reload({silent:!0})}}})}}},(function(){var t=this,e=t._self._c;return t.buttons.length>0?e("k-button-group",{staticClass:"k-form-buttons",attrs:{layout:"collapsed"}},t._l(t.buttons,(function(i){return e("k-button",t._b({key:i.icon,attrs:{size:"sm",variant:"filled",disabled:t.isDisabled,responsive:!0,theme:t.theme}},"k-button",i,!1))})),1):t._e()}),[],!1,null,null,null,null).exports,Fe={mixins:[W,G,X,Q,nt,at],props:{counter:[Boolean,Object],endpoints:Object,input:[String,Number],translate:Boolean,type:String}};const Ye=ut({mixins:[Fe],inheritAttrs:!1,emits:["blur","focus"]},(function(){var t=this,e=t._self._c;return e("div",{class:["k-field",`k-field-name-${t.name}`,`k-field-type-${t.type}`],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("k-label",{attrs:{input:t.input,required:t.required,title:t.label,type:"field"}},[t._v(" "+t._s(t.label)+" ")])]})),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-help k-field-help",attrs:{html:t.help}}):t._e()]}))],2):t._e()]}))],2)}),[],!1,null,null,null,null).exports;const Re=ut({props:{config:Object,disabled:Boolean,fields:{type:[Array,Object],default:()=>({})},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},emits:["focus","input","invalid","submit"],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]},onInvalid(t,e,i,n){this.errors[n]=e,this.$emit("invalid",this.errors)},onInput(t,e,i){const n=this.value;this.$set(n,i,t),this.$emit("input",n,e,i)},hasErrors(){return this.$helper.object.length(this.errors)>0}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-fieldset"},[e("k-grid",{attrs:{variant:"fields"}},[t._l(t.fields,(function(i,n){return[t.$helper.field.isVisible(i,t.value)?e("k-column",{key:i.signature,attrs:{width:i.width}},[t.hasFieldType(i.type)?e("k-"+i.type+"-field",t._b({ref:n,refInFor:!0,tag:"component",attrs:{disabled:t.disabled||i.disabled,"form-data":t.value,name:n,novalidate:t.novalidate,value:t.value[n]},on:{input:function(e){return t.onInput(e,i,n)},focus:function(e){return t.$emit("focus",e,i,n)},invalid:(e,s)=>t.onInvalid(e,s,i,n),submit:function(e){return t.$emit("submit",e,i,n)}}},"component",i,!1)):e("k-box",{attrs:{theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[t._v(" "+t._s(t.$t("error.field.type.missing",{name:n,type:i.type}))+" ")])],1)],1):t._e()]}))],2)],1)}),[],!1,null,null,null,null).exports,Ue={mixins:[U,K,W,Z],inheritAttrs:!1,props:{autofocus:Boolean,type:String,icon:[String,Boolean],novalidate:{type:Boolean,default:!1},value:{type:[String,Boolean,Number,Object,Array],default:null}}};const He=ut({mixins:[Ue],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}}},watch:{invalid(){this.isInvalid=this.invalid}},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 i,n,s;if("INPUT"===(null==(i=null==t?void 0:t.target)?void 0:i.tagName)&&"function"==typeof(null==(n=null==t?void 0:t.target)?void 0:n[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._self._c;return e("div",{staticClass:"k-input",attrs:{"data-disabled":t.disabled,"data-invalid":!t.novalidate&&t.isInvalid,"data-type":t.type}},[t.$slots.before||t.before?e("span",{staticClass:"k-input-description 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-description 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;const Ve=ut({props:{accept:{type:String,default:"*"},attributes:{type:Object},max:{type:Number},method:{type:String,default:"POST"},multiple:{type:Boolean,default:!0},url:{type:String}},emits:["success"],methods:{open(t){window.panel.deprecated(" will be removed in a future version. Use `$panel.upload.open()` instead."),this.$panel.upload.pick(this.params(t))},params(t){return{...this.$props,...t??{},on:{complete:(t,e)=>{this.$emit("success",t,e)}}}},select(t){this.$panel.upload.select(t.target.files)},drop(t,e){window.panel.deprecated(" will be removed in a future version. Use `$panel.upload.select()` instead."),this.$panel.upload.open(t,this.params(e))},upload(t,e){window.panel.deprecated(" will be removed in a future version. Use `$panel.upload.select()` instead."),this.$panel.upload.select(t,this.params(e)),this.$panel.upload.start()}},render:()=>""},null,null,!1,null,null,null,null).exports,Ke={props:{content:{default:()=>({}),type:[Array,Object]},fieldset:{default:()=>({}),type:Object}}};const We=ut({mixins:[Ke],inheritAttrs:!1,computed:{icon(){return this.fieldset.icon??"box"},label(){if(!this.fieldset.label||0===this.fieldset.label.length)return!1;if(this.fieldset.label===this.name)return!1;let t=this.$helper.string.template(this.fieldset.label,this.content);return"…"!==t&&(t=this.$helper.string.stripHTML(t),this.$helper.string.unescapeHTML(t))},name(){return this.fieldset.name??this.fieldset.label}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-title"},[e("k-icon",{staticClass:"k-block-icon",attrs:{type:t.icon}}),t.name?e("span",{staticClass:"k-block-name"},[t._v(" "+t._s(t.name)+" ")]):t._e(),t.label?e("span",{staticClass:"k-block-label"},[t._v(" "+t._s(t.label)+" ")]):t._e()],1)}),[],!1,null,null,null,null).exports,Je={mixins:[Ke,W],props:{endpoints:{default:()=>({}),type:[Array,Object]},id:String}};const Ge=ut({mixins:[Je],inheritAttrs:!1,methods:{field(t,e=null){let i=null;for(const n of Object.values(this.fieldset.tabs??{}))n.fields[t]&&(i=n.fields[t]);return i??e},open(){this.$emit("open")},update(t){this.$emit("update",{...this.content,...t})}}},(function(){var t=this;return(0,t._self._c)("k-block-title",{attrs:{content:t.content,fieldset:t.fieldset},nativeOn:{dblclick:function(e){return t.$emit("open")}}})}),[],!1,null,null,null,null).exports,Xe={props:{isBatched:Boolean,isFull:Boolean,isHidden:Boolean,isMergable:Boolean}};const Ze=ut({mixins:[Xe],props:{isEditable:Boolean,isSplitable:Boolean},emits:["chooseToAppend","chooseToConvert","chooseToPrepend","copy","duplicate","hide","merge","open","paste","remove","removeSelected","show","split","sortDown","sortUp"],computed:{buttons(){return this.isBatched?[{icon:"template",title:this.$t("copy"),click:()=>this.$emit("copy")},{when:this.isMergable,icon:"merge",title:this.$t("merge"),click:()=>this.$emit("merge")},{icon:"trash",title:this.$t("remove"),click:()=>this.$emit("removeSelected")}]:[{when:this.isEditable,icon:"edit",title:this.$t("edit"),click:()=>this.$emit("open")},{icon:"add",title:this.$t("insert.after"),disabled:this.isFull,click:()=>this.$emit("chooseToAppend")},{icon:"trash",title:this.$t("delete"),click:()=>this.$emit("remove")},{icon:"sort",title:this.$t("sort.drag"),class:"k-sort-handle",key:t=>this.sort(t)},{icon:"dots",title:this.$t("more"),dropdown:[{icon:"angle-up",label:this.$t("insert.before"),disabled:this.isFull,click:()=>this.$emit("chooseToPrepend")},{icon:"angle-down",label:this.$t("insert.after"),disabled:this.isFull,click:()=>this.$emit("chooseToAppend")},"-",{when:this.isEditable,icon:"edit",label:this.$t("edit"),click:()=>this.$emit("open")},{icon:"refresh",label:this.$t("field.blocks.changeType"),click:()=>this.$emit("chooseToConvert")},{when:this.isSplitable,icon:"split",label:this.$t("split"),click:()=>this.$emit("split")},"-",{icon:"template",label:this.$t("copy"),click:()=>this.$emit("copy")},{icon:"download",label:this.$t("paste.after"),disabled:this.isFull,click:()=>this.$emit("paste")},"-",{icon:this.isHidden?"preview":"hidden",label:this.isHidden?this.$t("show"):this.$t("hide"),click:()=>this.$emit(this.isHidden?"show":"hide")},{icon:"copy",label:this.$t("duplicate"),click:()=>this.$emit("duplicate")},"-",{icon:"trash",label:this.$t("delete"),click:()=>this.$emit("remove")}]}]}},methods:{open(){this.$refs.options.open()},sort(t){switch(t.preventDefault(),t.key){case"ArrowUp":this.$emit("sortUp");break;case"ArrowDown":this.$emit("sortDown")}}}},(function(){return(0,this._self._c)("k-toolbar",{staticClass:"k-block-options",attrs:{buttons:this.buttons},nativeOn:{mousedown:function(t){t.preventDefault()}}})}),[],!1,null,null,null,null).exports;const Qe=ut({mixins:[Je,Xe],inheritAttrs:!1,props:{attrs:{default:()=>({}),type:[Array,Object]},isLastSelected:Boolean,isSelected:Boolean,name:String,next:Object,prev:Object,type:String},emits:["append","chooseToAppend","chooseToConvert","chooseToPrepend","close","copy","duplicate","focus","hide","merge","open","paste","prepend","remove","selectDown","selectUp","show","sortDown","sortUp","split","submit","update"],computed:{className(){let t=["k-block-type-"+this.type];return this.fieldset.preview&&this.fieldset.preview!==this.type&&t.push("k-block-type-"+this.fieldset.preview),!1===this.wysiwyg&&t.push("k-block-type-default"),t},containerType(){const t=this.fieldset.preview;return!1!==t&&(t&&this.$helper.isComponent("k-block-type-"+t)?t:!!this.$helper.isComponent("k-block-type-"+this.type)&&this.type)},customComponent(){return this.wysiwyg?this.wysiwygComponent:"k-block-type-default"},isDisabled(){return!0===this.disabled||!0===this.fieldset.disabled},isEditable(){return!1!==this.fieldset.editable},listeners(){return{append:t=>this.$emit("append",t),chooseToAppend:t=>this.$emit("chooseToAppend",t),chooseToConvert:t=>this.$emit("chooseToConvert",t),chooseToPrepend:t=>this.$emit("chooseToPrepend",t),close:()=>this.$emit("close"),copy:()=>this.$emit("copy"),duplicate:()=>this.$emit("duplicate"),focus:()=>this.$emit("focus"),hide:()=>this.$emit("hide"),merge:()=>this.$emit("merge"),open:t=>this.open(t),paste:()=>this.$emit("paste"),prepend:t=>this.$emit("prepend",t),remove:()=>this.remove(),removeSelected:()=>this.$emit("removeSelected"),show:()=>this.$emit("show"),sortDown:()=>this.$emit("sortDown"),sortUp:()=>this.$emit("sortUp"),split:t=>this.$emit("split",t),update:t=>this.$emit("update",t)}},tabs(){const t=this.fieldset.tabs??{};for(const[e,i]of Object.entries(t))for(const[n]of Object.entries(i.fields??{}))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};return t},wysiwyg(){return!1!==this.wysiwygComponent},wysiwygComponent(){return!!this.containerType&&"k-block-type-"+this.containerType}},methods:{backspace(t){if(t.target.matches("[contenteditable], input, textarea"))return!1;t.preventDefault(),this.remove()},close(){this.$panel.drawer.close(this.id)},focus(){var t,e;"function"==typeof(null==(t=this.$refs.editor)?void 0:t.focus)?this.$refs.editor.focus():null==(e=this.$refs.container)||e.focus()},goTo(t){var e;t&&(null==(e=t.$refs.container)||e.focus(),t.open(null,!0))},isSplitable(){var t;return!0!==this.isFull&&(!!this.$refs.editor&&((this.$refs.editor.isSplitable??!0)&&"function"==typeof(null==(t=this.$refs.editor)?void 0:t.split)))},onClose(){this.$emit("close"),this.focus()},onFocus(t){this.disabled||this.$emit("focus",t)},onFocusIn(t){var e,i;this.disabled||(null==(i=null==(e=this.$refs.options)?void 0:e.$el)?void 0:i.contains(t.target))||this.$emit("focus",t)},onInput(t){this.$emit("update",t)},open(t,e=!1){!this.isEditable||this.isBatched||this.isDisabled||(this.$panel.drawer.open({component:"k-block-drawer",id:this.id,tab:t,on:{close:this.onClose,input:this.onInput,next:()=>this.goTo(this.next),prev:()=>this.goTo(this.prev),remove:this.remove,show:this.show,submit:this.submit},props:{hidden:this.isHidden,icon:this.fieldset.icon??"box",next:this.next,prev:this.prev,tabs:this.tabs,title:this.fieldset.name,value:this.content},replace:e}),this.$emit("open"))},remove(){if(this.isBatched)return this.$emit("removeSelected");this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm")},on:{submit:()=>{this.$panel.dialog.close(),this.close(),this.$emit("remove",this.id)}}})},show(){this.$emit("show")},submit(){this.close(),this.$emit("submit")}}},(function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"k-block-container",class:["k-block-container-fieldset-"+t.type,t.containerType?"k-block-container-type-"+t.containerType:""],attrs:{"data-batched":t.isBatched,"data-disabled":t.isDisabled,"data-hidden":t.isHidden,"data-id":t.id,"data-last-selected":t.isLastSelected,"data-selected":t.isSelected,"data-translate":t.fieldset.translate,tabindex:t.isDisabled?null:0},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"j",void 0,e.key,void 0)?null:e.ctrlKey?(e.preventDefault(),e.stopPropagation(),t.$emit("merge")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.altKey?(e.preventDefault(),e.stopPropagation(),t.$emit("selectDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey&&e.altKey?(e.preventDefault(),e.stopPropagation(),t.$emit("selectUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),e.stopPropagation(),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(),e.stopPropagation(),t.$emit("sortUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:e.ctrlKey?(e.stopPropagation(),t.backspace.apply(null,arguments)):null}],focus:function(e){return e.stopPropagation(),t.onFocus.apply(null,arguments)},focusin:function(e){return e.stopPropagation(),t.onFocusIn.apply(null,arguments)}}},[e("div",{staticClass:"k-block",class:t.className,attrs:{"data-disabled":t.isDisabled}},[e(t.customComponent,t._g(t._b({ref:"editor",tag:"component",attrs:{tabs:t.tabs}},"component",t.$props,!1),t.listeners))],1),t.isDisabled?t._e():e("k-block-options",t._g(t._b({ref:"options"},"k-block-options",{isBatched:t.isBatched,isEditable:t.isEditable,isFull:t.isFull,isHidden:t.isHidden,isMergable:t.isMergable,isSplitable:t.isSplitable()},!1),{...t.listeners,split:()=>t.$refs.editor.split(),open:()=>{"function"==typeof t.$refs.editor.open?t.$refs.editor.open():t.open()}}))],1)}),[],!1,null,null,null,null).exports,ti={mixins:[V,W,X],props:{empty:String,endpoints:Object,fieldsets:Object,fieldsetGroups:Object,group:String,max:{type:Number,default:null},value:{type:Array,default:()=>[]}},emits:["input"]};const ei=ut({mixins:[ti],inheritAttrs:!1,data(){return{blocks:this.value??[],isEditing:!1,isMultiSelectKey:!1,selected:[]}},computed:{draggableOptions(){return{id:this.id,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 this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.blocks.length},isFull(){return null!==this.max&&this.blocks.length>=this.max},isMergable(){if(this.selected.length<2)return!1;const t=this.selected.map((t=>this.find(t)));return!(new Set(t.map((t=>t.type))).size>1)&&"function"==typeof this.ref(t[0]).$refs.editor.merge}},watch:{value(){this.blocks=this.value}},mounted(){!0===this.$props.autofocus&&setTimeout(this.focus,100),this.$events.on("blur",this.onBlur),this.$events.on("click",this.onClickGlobal),this.$events.on("copy",this.onCopy),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("click",this.onClickGlobal),this.$events.off("copy",this.onCopy),this.$events.off("keydown",this.onKey),this.$events.off("keyup",this.onKey),this.$events.off("paste",this.onPaste)},methods:{async add(t="text",e){const i=await this.$api.get(this.endpoints.field+"/fieldsets/"+t);this.blocks.splice(e,0,i),this.save(),await this.$nextTick(),this.focusOrOpen(i)},choose(t){if(1===this.$helper.object.length(this.fieldsets))return this.add(Object.values(this.fieldsets)[0].type,t);this.$panel.dialog.open({component:"k-block-selector",props:{fieldsetGroups:this.fieldsetGroups,fieldsets:this.fieldsets},on:{submit:e=>{this.add(e,t),this.$panel.dialog.close()},paste:e=>{this.paste(e,t)}}})},chooseToConvert(t){this.$panel.dialog.open({component:"k-block-selector",props:{disabledFieldsets:[t.type],fieldsetGroups:this.fieldsetGroups,fieldsets:this.fieldsets,headline:this.$t("field.blocks.changeType")},on:{submit:e=>{this.convert(e,t),this.$panel.dialog.close()},paste:this.paste}})},copy(t){if(0===this.blocks.length)return!1;if(0===this.selected.length)return!1;let e=[];for(const i of this.blocks)this.selected.includes(i.id)&&e.push(i);if(0===e.length)return!1;this.$helper.clipboard.write(e,t),this.selected=e.map((t=>t.id)),this.$panel.notification.success({message:this.$t("copy.success",{count:e.length}),icon:"template"})},copyAll(){this.selectAll(),this.copy(),this.deselectAll()},async convert(t,e){var i;const n=this.findIndex(e.id);if(-1===n)return!1;const s=t=>{let e={};for(const i of Object.values((null==t?void 0:t.tabs)??{}))e={...e,...i.fields};return e},o=this.blocks[n],l=await this.$api.get(this.endpoints.field+"/fieldsets/"+t),a=this.fieldsets[o.type],r=this.fieldsets[t];if(!r)return!1;let u=l.content;const c=s(r),d=s(a);for(const[p,h]of Object.entries(c)){const t=d[p];(null==t?void 0:t.type)===h.type&&(null==(i=null==o?void 0:o.content)?void 0:i[p])&&(u[p]=o.content[p])}this.blocks[n]={...l,id:o.id,content:u},this.save()},deselect(t){const e=this.selected.findIndex((e=>e===t.id));-1!==e&&this.selected.splice(e,1)},deselectAll(){this.selected=[]},async duplicate(t,e){const i={...structuredClone(t),id:this.$helper.uuid()};this.blocks.splice(e+1,0,i),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){const e=this.ref(t);this.selected=[(null==t?void 0:t.id)??this.blocks[0]],null==e||e.focus(),null==e||e.$el.scrollIntoView({block:"nearest"})},focusOrOpen(t){this.fieldsets[t.type].wysiwyg?this.focus(t):this.open(t)},hide(t){Vue.set(t,"isHidden",!0),this.save()},isInputEvent(){const t=document.querySelector(":focus");return null==t?void 0:t.matches("input, textarea, [contenteditable], .k-writer")},isLastSelected(t){const[e]=this.selected.slice(-1);return e&&t.id===e},isOnlyInstance:()=>1===document.querySelectorAll(".k-blocks").length,isSelected(t){return this.selected.includes(t.id)},async merge(){if(this.isMergable){const t=this.selected.map((t=>this.find(t)));this.ref(t[0]).$refs.editor.merge(t);for(const e of t.slice(1))this.remove(e);await this.$nextTick(),this.focus(t[0])}},move(t){if(t.from!==t.to){const e=t.draggedContext.element,i=t.relatedContext.component.componentData||t.relatedContext.component.$parent.componentData;if(!1===Object.keys(i.fieldsets).includes(e.type))return!1;if(!0===i.isFull)return!1}return!0},onBlur(){0===this.selected.length&&(this.isMultiSelectKey=!1)},onClickBlock(t,e){e&&this.isMultiSelectKey&&this.onKey(e),this.isMultiSelectKey&&(e.preventDefault(),e.stopPropagation(),this.isSelected(t)?this.deselect(t):this.select(t))},onClickGlobal(t){var e;if("function"==typeof t.target.closest&&(t.target.closest(".k-dialog")||t.target.closest(".k-drawer")))return;const i=document.querySelector(".k-overlay:last-of-type");!1!==this.$el.contains(t.target)||!1!==(null==i?void 0:i.contains(t.target))?i&&!1===(null==(e=this.$el.closest(".k-layout-column"))?void 0:e.contains(t.target))&&this.deselectAll():this.deselectAll()},onCopy(t){return!1!==this.$el.contains(t.target)&&!0!==this.isEditing&&!0!==this.$panel.dialog.isOpen&&!0!==this.isInputEvent(t)&&this.copy(t)},onFocus(t){!1===this.isMultiSelectKey&&(this.selected=[t.id])},async onKey(t){if(this.isMultiSelectKey=t.metaKey||t.ctrlKey||t.altKey,"Escape"===t.code&&this.selected.length>1){const t=this.find(this.selected[0]);await this.$nextTick(),this.focus(t)}},onPaste(t){return!0!==this.isInputEvent(t)&&(!0!==this.isEditing&&!0!==this.$panel.dialog.isOpen&&((0!==this.selected.length||!1!==this.$el.contains(t.target))&&this.paste(t)))},open(t){var e;null==(e=this.$refs["block-"+t.id])||e[0].open()},async paste(t,e){const i=this.$helper.clipboard.read(t);let n=await this.$api.post(this.endpoints.field+"/paste",{html:i});if(void 0===e){let t=this.selected[this.selected.length-1];-1===(e=this.findIndex(t))&&(e=this.blocks.length),e++}if(this.max){const t=this.max-this.blocks.length;n=n.slice(0,t)}this.blocks.splice(e,0,...n),this.save(),this.$panel.notification.success({message:this.$t("paste.success",{count:n.length}),icon:"download"})},pasteboard(){this.$panel.dialog.open({component:"k-block-pasteboard",on:{paste:this.paste}})},prevNext(t){var e;if(this.blocks[t])return null==(e=this.$refs["block-"+this.blocks[t].id])?void 0:e[0]},ref(t){var e,i;return null==(i=this.$refs["block-"+((null==t?void 0:t.id)??(null==(e=this.blocks[0])?void 0:e.id))])?void 0:i[0]},remove(t){const e=this.findIndex(t.id);-1!==e&&(this.deselect(t),this.$delete(this.blocks,e),this.save())},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm.all"),submitButton:this.$t("delete.all")},on:{submit:()=>{this.selected=[],this.blocks=[],this.save(),this.$panel.dialog.close()}}})},removeSelected(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm.selected")},on:{submit:()=>{for(const t of this.selected){const e=this.findIndex(t);-1!==e&&this.$delete(this.blocks,e)}this.deselectAll(),this.save(),this.$panel.dialog.close()}}})},save(){this.$emit("input",this.blocks)},select(t){!1===this.isSelected(t)&&this.selected.push(t.id)},selectDown(){const t=this.selected[this.selected.length-1],e=this.findIndex(t)+1;e=0&&this.select(this.blocks[e])},selectAll(){this.selected=Object.values(this.blocks).map((t=>t.id))},show(t){Vue.set(t,"isHidden",!1),this.save()},async sort(t,e,i){if(i<0)return;let n=structuredClone(this.blocks);n.splice(e,1),n.splice(i,0,t),this.blocks=n,this.save(),await this.$nextTick(),this.focus(t)},async split(t,e,i){const n=structuredClone(t);n.content={...n.content,...i[0]};const s=await this.$api.get(this.endpoints.field+"/fieldsets/"+t.type);s.content={...s.content,...n.content,...i[1]},this.blocks.splice(e,1,n,s),this.save(),await this.$nextTick(),this.focus(s)},update(t,e){const i=this.findIndex(t.id);if(-1!==i)for(const n in e)Vue.set(this.blocks[i].content,n,e[n]);this.save()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-blocks",attrs:{"data-disabled":t.disabled,"data-empty":0===t.blocks.length}},[t.hasFieldsets?[e("k-draggable",t._b({staticClass:"k-blocks-list",attrs:{"data-multi-select-key":t.isMultiSelectKey},on:{sort:t.save},scopedSlots:t._u([0===t.blocks.length?{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],null,!0)},"k-draggable",t.draggableOptions,!1),t._l(t.blocks,(function(i,n){return e("k-block",t._b({key:i.id,ref:"block-"+i.id,refInFor:!0,on:{append:function(e){return t.add(e,n+1)},chooseToAppend:function(e){return t.choose(n+1)},chooseToConvert:function(e){return t.chooseToConvert(i)},chooseToPrepend:function(e){return t.choose(n)},close:function(e){t.isEditing=!1},copy:function(e){return t.copy()},duplicate:function(e){return t.duplicate(i,n)},focus:function(e){return t.onFocus(i)},hide:function(e){return t.hide(i)},merge:function(e){return t.merge()},open:function(e){t.isEditing=!0},paste:function(e){return t.pasteboard()},prepend:function(e){return t.add(e,n)},remove:function(e){return t.remove(i)},removeSelected:t.removeSelected,show:function(e){return t.show(i)},selectDown:t.selectDown,selectUp:t.selectUp,sortDown:function(e){return t.sort(i,n,n+1)},sortUp:function(e){return t.sort(i,n,n-1)},split:function(e){return t.split(i,n,e)},update:function(e){return t.update(i,e)}},nativeOn:{click:function(e){return t.onClickBlock(i,e)}}},"k-block",{...i,disabled:t.disabled,endpoints:t.endpoints,fieldset:t.fieldset(i),isBatched:t.isSelected(i)&&t.selected.length>1,isFull:t.isFull,isHidden:!0===i.isHidden,isLastSelected:t.isLastSelected(i),isMergable:t.isMergable,isSelected:t.isSelected(i),next:t.prevNext(n+1),prev:t.prevNext(n-1)},!1))})),1)]:e("k-empty",{attrs:{icon:"box"}},[t._v(" "+t._s(t.$t("field.blocks.fieldsets.empty"))+" ")])],2)}),[],!1,null,null,null,null).exports;const ii=ut({inheritAttrs:!1,emits:["close","paste","submit"],computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{paste(t){this.$emit("close"),this.$emit("paste",t)}}},(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,visible:!0,size:"large"},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},[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.paste.apply(null,arguments)}}})])}),[],!1,null,null,null,null).exports;const ni=ut({inheritAttrs:!1,props:{disabledFieldsets:{default:()=>[],type:Array},fieldsets:{type:Object},fieldsetGroups:{type:Object},headline:{type:String},size:{type:String,default:"medium"},value:{default:null,type:String}},emits:["cancel","input","paste","submit"],data:()=>({selected:null}),computed:{groups(){const t={};let e=0;const i=this.fieldsetGroups??{blocks:{label:this.$t("field.blocks.fieldsets.label"),sets:Object.keys(this.fieldsets)}};for(const n in i){const s=i[n];s.open=!1!==s.open,s.fieldsets=s.sets.filter((t=>this.fieldsets[t])).map((t=>(e++,{...this.fieldsets[t],index:e}))),0!==s.fieldsets.length&&(t[n]=s)}return t},shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},mounted(){this.$events.on("paste",this.paste)},destroyed(){this.$events.off("paste",this.paste)},methods:{paste(t){this.$emit("paste",t),this.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{staticClass:"k-block-selector",attrs:{"cancel-button":!1,size:t.size,"submit-button":!1,visible:!0},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},[t.headline?e("k-headline",[t._v(" "+t._s(t.headline)+" ")]):t._e(),t._l(t.groups,(function(i,n){return e("details",{key:n,attrs:{open:i.open}},[e("summary",[t._v(t._s(i.label))]),e("k-navigate",{staticClass:"k-block-types"},t._l(i.fieldsets,(function(i){return e("k-button",{key:i.name,attrs:{disabled:t.disabledFieldsets.includes(i.type),icon:i.icon??"box",text:i.name,size:"lg"},on:{click:function(e){return t.$emit("submit",i.type)}},nativeOn:{focus:function(e){return t.$emit("input",i.type)}}})})),1)],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;const si=ut({props:{value:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-background-dropdown"},[e("k-button",{attrs:{dropdown:!0,size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.dropdown.toggle()}}},[e("k-color-frame",{attrs:{color:t.value,ratio:"1/1"}})],1),e("k-dropdown-content",{ref:"dropdown",attrs:{"align-x":"end",options:[{text:t.$t("field.blocks.figure.back.plain"),click:"var(--color-white)"},{text:t.$t("field.blocks.figure.back.pattern.light"),click:"var(--pattern-light)"},{text:t.$t("field.blocks.figure.back.pattern.dark"),click:"var(--pattern)"}]},on:{action:function(e){return t.$emit("input",e)}}})],1)}),[],!1,null,null,null,null).exports;const oi=ut({inheritAttrs:!1,props:{back:String,caption:String,captionMarks:{default:!0,type:[Boolean,Array]},disabled:Boolean,isEmpty:Boolean,emptyIcon:String,emptyText:String},emits:["open","update"]},(function(){var t=this,e=t._self._c;return e("figure",{staticClass:"k-block-figure",style:{"--block-figure-back":t.back},attrs:{"data-empty":t.isEmpty}},[t.isEmpty?e("k-button",{staticClass:"k-block-figure-empty",attrs:{disabled:t.disabled,icon:t.emptyIcon,text:t.emptyText},on:{click:function(e){return t.$emit("open")}}}):e("span",{staticClass:"k-block-figure-container",attrs:{"data-disabled":t.disabled},on:{dblclick:function(e){return t.$emit("open")}}},[t._t("default")],2),t.caption?e("k-block-figure-caption",{attrs:{disabled:t.disabled,marks:t.captionMarks,value:t.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const li=ut({props:{disabled:Boolean,marks:[Array,Boolean],value:String}},(function(){var t=this,e=t._self._c;return e("figcaption",{staticClass:"k-block-figure-caption"},[e("k-writer",{attrs:{disabled:t.disabled,inline:!0,marks:t.marks,spellcheck:!1,value:t.value},on:{input:function(e){return t.$emit("input",e)}}})],1)}),[],!1,null,null,null,null).exports;const ai=ut({extends:Ge,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,disabled:t.disabled,placeholder:t.placeholder,spellcheck:!1,value:t.content.code,font:"monospace",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-input",{ref:"language",attrs:{disabled:t.disabled,empty:!1,options:t.languages,value:t.content.language,icon:"code",type:"select"},on:{input:function(e){return t.update({language:e})}}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const ri=ut({extends:Ge,props:{tabs:Object},data(){return{collapsed:this.state(),tab:Object.keys(this.tabs)[0]}},computed:{fields(){var t;return null==(t=this.tabs[this.tab])?void 0:t.fields},values(){return Object.assign({},this.content)}},methods:{open(){this.$emit("open",this.tab)},state(t){const e=`kirby.fieldsBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return JSON.parse(sessionStorage.getItem(e));sessionStorage.setItem(e,t)},toggle(){this.collapsed=!this.collapsed,this.state(this.collapsed)}}},(function(){var t=this,e=t._self._c;return e("div",{attrs:{"data-collapsed":t.collapsed},on:{dblclick:function(e){!t.fieldset.wysiwyg&&t.$emit("open")}}},[e("header",{staticClass:"k-block-type-fields-header"},[e("k-block-title",{attrs:{content:t.values,fieldset:t.fieldset},nativeOn:{click:function(e){return t.toggle.apply(null,arguments)}}}),t.collapsed?t._e():e("k-drawer-tabs",{attrs:{tab:t.tab,tabs:t.fieldset.tabs},on:{open:function(e){t.tab=e}}})],1),t.collapsed?t._e():e("k-form",{ref:"form",staticClass:"k-block-type-fields-form",attrs:{autofocus:!0,disabled:t.disabled||!t.fieldset.wysiwyg,fields:t.fields,value:t.values},on:{input:function(e){return t.$emit("update",e)}}})],1)}),[],!1,null,null,null,null).exports;const ui=ut({extends:Ge,data(){return{back:this.onBack()??"white"}},computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop},isEmpty(){var t;return!(null==(t=this.content.images)?void 0:t.length)},ratio(){return this.content.ratio}},methods:{onBack(t){const e=`kirby.galleryBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return sessionStorage.getItem(e);this.back=t,sessionStorage.setItem(e,t)}}},(function(){var t=this,e=t._self._c;return e("figure",{style:{"--block-back":t.back},attrs:{"data-empty":t.isEmpty}},[e("ul",{on:{dblclick:t.open}},[t.isEmpty?t._l(3,(function(i){return e("li",{key:i,staticClass:"k-block-type-gallery-placeholder"},[e("k-image-frame",{attrs:{ratio:t.ratio}})],1)})):[t._l(t.content.images,(function(i){return e("li",{key:i.id},[e("k-image-frame",{attrs:{ratio:t.ratio,cover:t.crop,src:i.url,srcset:i.image.srcset,alt:i.alt}})],1)})),e("k-block-background-dropdown",{attrs:{value:t.back},on:{input:t.onBack}})]],2),t.content.caption?e("k-block-figure-caption",{attrs:{disabled:t.disabled,marks:t.captionMarks,value:t.content.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const ci=ut({extends:Ge,inheritAttrs:!1,emits:["append","open","split","update"],computed:{isSplitable(){return this.content.text.length>0&&!1===this.$refs.input.isCursorAtStart&&!1===this.$refs.input.isCursorAtEnd},keys(){return{Enter:()=>!0===this.$refs.input.isCursorAtEnd?this.$emit("append","text"):this.split(),"Mod-Enter":this.split}},levels(){return this.field("level",{options:[]}).options},textField(){return this.field("text",{marks:!0})}},methods:{focus(){this.$refs.input.focus()},merge(t){this.update({text:t.map((t=>t.content.text)).join(" ")})},split(){var t,e;const i=null==(e=(t=this.$refs.input).getSplitContent)?void 0:e.call(t);i&&this.$emit("split",[{text:i[0]},{level:"h"+Math.min(parseInt(this.content.level.slice(1))+1,6),text:i[1]}])}}},(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",t._b({ref:"input",attrs:{disabled:t.disabled,inline:!0,keys:t.keys,value:t.content.text},on:{input:function(e){return t.update({text:e})}}},"k-writer",t.textField,!1)),t.levels.length>1?e("k-input",{ref:"level",staticClass:"k-block-type-heading-level",attrs:{disabled:t.disabled,empty:!1,options:t.levels,value:t.content.level,type:"select"},on:{input:function(e){return t.update({level:e})}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const di=ut({extends:Ge,data(){return{back:this.onBack()??"white"}},computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop??!1},src(){var t,e;return"web"===this.content.location?this.content.src:!!(null==(e=null==(t=this.content.image)?void 0:t[0])?void 0:e.url)&&this.content.image[0].url},ratio(){return this.content.ratio??!1}},methods:{onBack(t){const e=`kirby.imageBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return sessionStorage.getItem(e);this.back=t,sessionStorage.setItem(e,t)}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{attrs:{back:t.back,caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.image.placeholder")+" …",disabled:t.disabled,"is-empty":!t.src,"empty-icon":"image"},on:{open:t.open,update:t.update}},[t.src?[t.ratio?e("k-image-frame",{attrs:{ratio:t.ratio,cover:t.crop,alt:t.content.alt,src:t.src}}):e("img",{staticClass:"k-block-type-image-auto",attrs:{alt:t.content.alt,src:t.src}}),e("k-block-background-dropdown",{attrs:{value:t.back},on:{input:t.onBack}})]:t._e()],2)}),[],!1,null,null,null,null).exports;const pi=ut({},(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;const hi=ut({extends:Ge,emits:["open","split","update"],computed:{isSplitable(){return this.content.text.length>0&&!1===this.input().isCursorAtStart&&!1===this.input().isCursorAtEnd},keys(){return{"Mod-Enter":this.split}},marks(){return this.field("text",{}).marks}},methods:{focus(){this.$refs.input.focus()},input(){return this.$refs.input.$refs.input.$refs.input},merge(t){this.update({text:t.map((t=>t.content.text)).join("").replaceAll("
    ","")})},split(){var t,e;const i=null==(e=(t=this.input()).getSplitContent)?void 0:e.call(t);i&&this.$emit("split",[{text:i[0].replace(/(
  • <\/p><\/li><\/ul>)$/,"

")},{text:i[1].replace(/^(
  • <\/p><\/li>)/,"

      ")}])}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-list-input",attrs:{disabled:t.disabled,keys:t.keys,marks:t.marks,value:t.content.text,type:"list"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports;const mi=ut({extends:Ge,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,disabled:t.disabled,placeholder:t.placeholder,spellcheck:!1,value:t.content.text,font:"monospace",type:"textarea"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports;const fi=ut({extends:Ge,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:{disabled:t.disabled,inline:t.textField.inline??!1,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:{disabled:t.disabled,inline:t.citationField.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;const gi=ut({extends:Ge,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;const ki=ut({extends:Ge,emits:["open","split","update"],computed:{component(){const t="k-"+this.textField.type+"-input";return this.$helper.isComponent(t)?t:"k-writer-input"},isSplitable(){return this.content.text.length>0&&!1===this.input().isCursorAtStart&&!1===this.input().isCursorAtEnd},keys(){const t={"Mod-Enter":this.split};return!0===this.textField.inline&&(t.Enter=this.split),t},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.input.focus()},input(){return this.$refs.input.$refs.input},merge(t){this.update({text:t.map((t=>t.content.text)).join(this.textField.inline?" ":"")})},split(){var t,e;const i=null==(e=(t=this.input()).getSplitContent)?void 0:e.call(t);i&&("writer"===this.textField.type&&(i[0]=i[0].replace(/(

      <\/p>)$/,""),i[1]=i[1].replace(/^(

      <\/p>)/,"")),this.$emit("split",i.map((t=>({text:t})))))}}},(function(){var t=this;return(0,t._self._c)(t.component,t._b({ref:"input",tag:"component",staticClass:"k-block-type-text-input",attrs:{disabled:t.disabled,keys:t.keys,value:t.content.text},on:{input:function(e){return t.update({text:e})}}},"component",t.textField,!1))}),[],!1,null,null,null,null).exports;const bi=ut({extends:Ge,computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},location(){return this.content.location},poster(){var t,e;return null==(e=null==(t=this.content.poster)?void 0:t[0])?void 0:e.url},video(){var t,e;return"kirby"===this.content.location?null==(e=null==(t=this.content.video)?void 0:t[0])?void 0:e.url:this.$helper.embed.video(this.content.url??"",!0)}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{staticClass:"k-block-type-video-figure",attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,disabled:t.disabled,"empty-text":t.$t("field.blocks.video.placeholder")+" …","is-empty":!t.video,"empty-icon":"video"},on:{open:t.open,update:t.update}},[e("k-frame",{attrs:{ratio:"16/9"}},[t.video?["kirby"==t.location?e("video",{attrs:{src:t.video,poster:t.poster,controls:""}}):e("iframe",{attrs:{src:t.video,referrerpolicy:"strict-origin-when-cross-origin"}})]:t._e()],2)],1)}),[],!1,null,null,null,null).exports,vi={install(t){t.component("k-block",Qe),t.component("k-blocks",ei),t.component("k-block-options",Ze),t.component("k-block-pasteboard",ii),t.component("k-block-selector",ni),t.component("k-block-background-dropdown",si),t.component("k-block-figure",oi),t.component("k-block-figure-caption",li),t.component("k-block-title",We),t.component("k-block-type-code",ai),t.component("k-block-type-default",Ge),t.component("k-block-type-fields",ri),t.component("k-block-type-gallery",ui),t.component("k-block-type-heading",ci),t.component("k-block-type-image",di),t.component("k-block-type-line",pi),t.component("k-block-type-list",hi),t.component("k-block-type-markdown",mi),t.component("k-block-type-quote",fi),t.component("k-block-type-table",gi),t.component("k-block-type-text",ki),t.component("k-block-type-video",bi)}};const yi=ut({mixins:[Fe,ti],inheritAttrs:!1,data:()=>({opened:[]}),computed:{hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.value.length},isFull(){return this.max&&this.value.length>=this.max},options(){return[{click:()=>this.$refs.blocks.copyAll(),disabled:this.isEmpty,icon:"template",text:this.$t("copy.all")},{click:()=>this.$refs.blocks.pasteboard(),disabled:this.isFull,icon:"download",text:this.$t("paste")},"-",{click:()=>this.$refs.blocks.removeAll(),disabled:this.isEmpty,icon:"trash",text:this.$t("delete.all")}]}},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([!t.disabled&&t.hasFieldsets?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{staticClass:"input-focus",attrs:{autofocus:t.autofocus,disabled:t.isFull,responsive:!0,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}}),e("k-button",{attrs:{icon:"dots",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:t.options,"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-blocks",t._g(t._b({ref:"blocks",on:{close:function(e){t.opened=e},open:function(e){t.opened=e}}},"k-blocks",t.$props,!1),t.$listeners)),t.disabled||t.isEmpty||t.isFull||!t.hasFieldsets?t._e():e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}})],1)],1)}),[],!1,null,null,null,null).exports,$i={mixins:[Ie,st],props:{columns:{default:1,type:Number},max:Number,min:Number,theme:String,value:{type:Array,default:()=>[]}}};const wi=ut({mixins:[De,$i],data:()=>({selected:[]}),computed:{choices(){return this.options.map(((t,e)=>({autofocus:this.autofocus&&0===e,checked:this.selected.includes(t.value),disabled:this.disabled||t.disabled,id:`${this.id}-${e}`,info:t.info,label:t.text,name:this.name??this.id,type:"checkbox",value:t.value})))}},watch:{value:{handler(t){this.selected=Array.isArray(t)?t:[],this.validate()},immediate:!0}},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},input(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)},select(){this.focus()},validate(){this.$emit("invalid",this.$v.$invalid,this.$v)}},validations(){return{selected:{required:!this.required||t.required,min:!this.min||t.minLength(this.min),max:!this.max||t.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-checkboxes-input k-grid",style:{"--columns":t.columns},attrs:{"data-variant":"choices"}},t._l(t.choices,(function(i,n){return e("li",{key:n},[e("k-choice-input",t._b({on:{input:function(e){return t.input(i.value,e)}}},"k-choice-input",i,!1))],1)})),0)}),[],!1,null,null,null,null).exports,xi={props:{counter:{type:Boolean,default:!0}},computed:{counterOptions(){const t=this.counterValue??this.value;return!(!1===this.counter||this.disabled||!t)&&{count:Array.isArray(t)?t.length:String(t).length,min:this.$props.min??this.$props.minlength,max:this.$props.max??this.$props.maxlength}},counterValue:()=>null}};const _i=ut({mixins:[Fe,Ue,$i,xi],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t,e=this,i=e._self._c;return i("k-field",e._b({staticClass:"k-checkboxes-field",attrs:{input:e.id+"-0",counter:e.counterOptions}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?i("k-checkboxes-input",e._g(e._b({ref:"input"},"k-checkboxes-input",e.$props,!1),e.$listeners)):i("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[],!1,null,null,null,null).exports,Ci={mixins:[Ie,H,J,et,it,ot,lt,rt],props:{ariaLabel:String,type:{default:"text",type:String},value:{type:String}}};const Si=ut({mixins:[De,Ci]},(function(){var t=this;return(0,t._self._c)("input",t._b({directives:[{name:"direction",rawName:"v-direction"}],staticClass:"k-string-input",attrs:{"aria-label":t.ariaLabel,"data-font":t.font},on:{input:function(e){return t.$emit("input",e.target.value)}}},"input",{autocomplete:t.autocomplete,autofocus:t.autofocus,disabled:t.disabled,id:t.id,maxlength:t.maxlength,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))}),[],!1,null,null,null,null).exports,Oi={mixins:[Ci],props:{autocomplete:null,font:null,maxlength:null,minlength:null,pattern:null,spellcheck:null,alpha:{type:Boolean,default:!0},format:{type:String,default:"hex",validator:t=>["hex","rgb","hsl"].includes(t)}}};const Mi=ut({mixins:[Si,Oi],watch:{value(){this.validate()}},mounted(){this.validate()},methods:{convert(t){if(!t)return t;try{return this.$library.colors.toString(t,this.format,this.alpha)}catch{const e=document.createElement("div");return e.style.color=t,document.body.append(e),t=window.getComputedStyle(e).color,e.remove(),this.$library.colors.toString(t,this.format,this.alpha)}},convertAndEmit(t){this.emit(this.convert(t))},emit(t){this.$emit("input",t)},onBlur(){this.convertAndEmit(this.value)},onPaste(t){t instanceof ClipboardEvent&&(t=this.$helper.clipboard.read(t,!0)),this.convertAndEmit(t)},async onSave(){var t;this.convertAndEmit(this.value),await this.$nextTick(),null==(t=this.$el.form)||t.requestSubmit()},validate(){let t="";null===this.$library.colors.parse(this.value)&&(t=this.$t("error.validation.color",{format:this.format})),this.$el.setCustomValidity(t)}}},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-colorname-input",attrs:{spellcheck:!1,autocomplete:"off",type:"text"},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{blur:function(e){return t.onBlur.apply(null,arguments)},paste:function(e){return t.onPaste.apply(null,arguments)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?(e.stopPropagation(),e.preventDefault(),t.onSave.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onSave.apply(null,arguments)}]}},"k-string-input",t.$props,!1))}),[],!1,null,null,null,null).exports;const Ai=ut({mixins:[Fe,Ue,Oi],inheritAttrs:!1,props:{icon:{type:String,default:"pipette"},mode:{type:String,default:"picker",validator:t=>["picker","input","options"].includes(t)},options:{type:Array,default:()=>[]}},computed:{convertedOptions(){return this.options.map((t=>({...t,value:this.convert(t.value)})))},currentOption(){return this.convertedOptions.find((t=>t.value===this.value))}},methods:{convert(t){return this.$library.colors.toString(t,this.format,this.alpha)}}},(function(){var t,e=this,i=e._self._c;return i("k-field",e._b({staticClass:"k-color-field",attrs:{input:e.id}},"k-field",e.$props,!1),["options"===e.mode?i("k-coloroptions-input",e._b({staticClass:"k-color-field-options",attrs:{options:e.convertedOptions},on:{input:function(t){return e.$emit("input",t)}}},"k-coloroptions-input",e.$props,!1)):i("k-input",e._b({attrs:{type:"color"},scopedSlots:e._u([{key:"before",fn:function(){return["picker"===e.mode?[i("button",{staticClass:"k-color-field-picker-toggle",attrs:{disabled:e.disabled,type:"button"},on:{click:function(t){return e.$refs.picker.toggle()}}},[i("k-color-frame",{attrs:{color:e.value}})],1),i("k-dropdown-content",{ref:"picker",staticClass:"k-color-field-picker"},[i("k-colorpicker-input",e._b({ref:"color",attrs:{options:e.convertedOptions},on:{input:function(t){return e.$emit("input",t)}},nativeOn:{click:function(t){t.stopPropagation()}}},"k-colorpicker-input",e.$props,!1))],1)]:i("k-color-frame",{attrs:{color:e.value}})]},proxy:!0},{key:"default",fn:function(){return[i("k-colorname-input",e._b({on:{input:function(t){return e.$emit("input",t)}}},"k-colorname-input",e.$props,!1))]},proxy:!0},(null==(t=e.currentOption)?void 0:t.text)?{key:"after",fn:function(){return[i("span",{domProps:{innerHTML:e._s(e.currentOption.text)}})]},proxy:!0}:null,"picker"===e.mode?{key:"icon",fn:function(){return[i("k-button",{staticClass:"k-input-icon-button",attrs:{icon:e.icon},on:{click:function(t){return t.stopPropagation(),e.$refs.picker.toggle()}}})]},proxy:!0}:null],null,!0)},"k-input",e.$props,!1))],1)}),[],!1,null,null,null,null).exports,Ii={props:{max:String,min:String,value:String}},Di={mixins:[Ie,Ii],props:{display:{type:String,default:"DD.MM.YYYY"},step:{type:Object,default:()=>({size:1,unit:"day"})},type:{type:String,default:"date"}}};const ji=ut({mixins:[De,Di],emits:["input","focus","submit"],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}},methods:{async alter(t){let e=this.parse()??this.round(this.$library.dayjs()),i=this.rounding.unit,n=this.rounding.size;const s=this.selection();null!==s&&("meridiem"===s.unit?(t="pm"===e.format("a")?"subtract":"add",i="hour",n=12):(i=s.unit,i!==this.rounding.unit&&(n=1))),e=e[t](n,i).round(this.rounding.unit,this.rounding.size),this.commit(e),this.emit(e),await this.$nextTick(),this.select(s)},commit(t){this.dt=t,this.formatted=this.pattern.format(t),this.validate(),this.$emit("invalid",this.$v.$invalid,this.$v)},emit(t){this.$emit("input",this.toISO(t))},onArrowDown(){this.alter("subtract")},onArrowUp(){this.alter("add")},onBlur(){const t=this.parse();this.commit(t),this.emit(t)},async onEnter(){this.onBlur(),await this.$nextTick(),this.$emit("submit")},onInput(t){const e=this.parse(),i=this.pattern.format(e);if(!t||i==t)return this.commit(e),this.emit(e)},async onTab(t){if(""==this.$el.value)return;this.onBlur(),await this.$nextTick();const e=this.selection();if(this.$el&&e.start===this.$el.selectionStart&&e.end===this.$el.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{if(this.$el&&this.$el.selectionStart==e.end+1&&e.index==this.pattern.parts.length-1)return;if(this.$el&&this.$el.selectionEnd-1>e.end){const t=this.pattern.at(this.$el.selectionEnd,this.$el.selectionEnd);this.select(this.pattern.parts[t.index])}else this.select(this.pattern.parts[e.index])}t.preventDefault()},parse(){const t=this.$library.dayjs.interpret(this.$el.value,this.inputType);return this.round(t)},round(t){return null==t?void 0:t.round(this.rounding.unit,this.rounding.size)},select(t){var e;t??(t=this.selection()),null==(e=this.$el)||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.$el.selectionStart,this.$el.selectionEnd)},toDatetime(t){return this.round(this.$library.dayjs.iso(t,this.inputType))},toISO(t){return null==t?void 0:t.toISO(this.inputType)},validate(){var t,e,i;const n=[];this.required&&!this.dt&&n.push(this.$t("error.validation.required")),this.min&&!1===(null==(t=this.dt)?void 0:t.validate(this.min,"min",this.rounding.unit))&&n.push(this.$t("error.validation.date.after",{date:this.min})),this.max&&!1===(null==(e=this.dt)?void 0:e.validate(this.max,"max",this.rounding.unit))&&n.push(this.$t("error.validation.date.before",{date:this.max})),null==(i=this.$el)||i.setCustomValidity(n.join(", "))}},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:"direction",rawName:"v-direction"}],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){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,"s",void 0,e.key,void 0)?null:e.metaKey?(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.ctrlKey?(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments)):null},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 Ei=ut({mixins:[Fe,Ue,Di],inheritAttrs:!1,props:{calendar:{type:Boolean,default:!0},icon:{type:String,default:"calendar"},time:{type:[Boolean,Object],default:()=>({})},times:{type:Boolean,default:!0}},emits:["input","submit"],data(){return{isInvalid:!1,iso:this.toIso(this.value)}},computed:{isEmpty(){return this.time?!this.iso.date||!this.iso.time:!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())??"")},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.id}},"k-field",t.$props,!1),[e("div",{ref:"body",staticClass:"k-date-field-body",attrs:{"data-has-time":Boolean(t.time),"data-invalid":!t.novalidate&&t.isInvalid}},[e("k-input",t._b({ref:"dateInput",attrs:{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-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.icon,title:t.$t("date.select")},on:{click:function(e){return t.$refs.calendar.toggle()}}}),e("k-dropdown-content",{ref:"calendar",attrs:{"align-x":"end"}},[e("k-calendar",{attrs:{value:t.iso.date,min:t.min,max:t.max},on:{input:t.onDateInput}})],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,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-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.time.icon??"clock",title:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{"align-x":"end"}},[e("k-timeoptions-input",{attrs:{display:t.time.display,value:t.value},on:{input:t.onTimesInput}})],1)]},proxy:!0}:null],null,!0)}):t._e()],1)])}),[],!1,null,null,null,null).exports,Li={mixins:[Ie,J,et,it,ot,lt,rt],props:{autocomplete:{type:[Boolean,String],default:"off"},preselect:Boolean,type:{type:String,default:"text"},value:String}};const Ti=ut({mixins:[De,Li],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:{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||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.maxLength(this.maxlength),email:"email"!==this.type||t.email,url:"url"!==this.type||t.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",attrs:{"data-font":t.font}},"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,Bi={mixins:[Li],props:{autocomplete:{type:String,default:"email"},placeholder:{type:String,default:()=>window.panel.$t("email.placeholder")},type:{type:String,default:"email"}}};const qi=ut({extends:Ti,mixins:[Bi]},null,null,!1,null,null,null,null).exports;const Pi=ut({mixins:[Fe,Ue,Bi],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.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{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,title: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;const Ni=ut({type:"model",mixins:[Fe,V,tt],inheritAttrs:!1,props:{empty:String,info:String,link:Boolean,max:Number,multiple:Boolean,parent:String,search:Boolean,size:String,text:String,value:{type:Array,default:()=>[]}},emits:["change","input"],data(){return{selected:this.value}},computed:{buttons(){return[{autofocus:this.autofocus,text:this.$t("select"),icon:"checklist",responsive:!0,click:()=>this.open()}]},collection(){return{empty:this.emptyProps,items:this.selected,layout:this.layout,link:this.link,size:this.size,sortable:!this.disabled&&this.selected.length>1,theme:this.disabled?"disabled":null}},hasDropzone:()=>!1,isInvalid(){return this.required&&0===this.selected.length||this.min&&this.selected.lengththis.max},more(){return!this.max||this.max>this.selected.length}},watch:{value(t){this.selected=t}},methods:{drop(){},focus(){},onInput(){this.$emit("input",this.selected)},open(){if(this.disabled)return!1;this.$panel.dialog.open({component:`k-${this.$options.type}-dialog`,props:{endpoint:this.endpoints.field,hasSearch:this.search,max:this.max,multiple:this.multiple,value:this.selected.map((t=>t.id))},on:{submit:t=>{this.select(t),this.$panel.dialog.close()}}})},remove(t){this.selected.splice(t,1),this.onInput()},removeById(t){this.selected=this.selected.filter((e=>e.id!==t)),this.onInput()},select(t){if(0===t.length)return this.selected=[],void this.onInput();this.selected=this.selected.filter((e=>t.find((t=>t.id===e.id))));for(const e of t)this.selected.find((t=>e.id===t.id))||this.selected.push(e);this.onInput()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:`k-models-field k-${t.$options.type}-field`,scopedSlots:t._u([t.disabled?null:{key:"options",fn:function(){return[e("k-button-group",{ref:"buttons",staticClass:"k-field-options",attrs:{buttons:t.buttons,layout:"collapsed",size:"xs",variant:"filled"}})]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-dropzone",{attrs:{disabled:!t.hasDropzone},on:{drop:t.drop}},[e("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([t.disabled?null:{key:"options",fn:function({index:i}){return[e("k-button",{attrs:{title:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(i)}}})]}}],null,!0)},"k-collection",t.collection,!1))],1)],1)}),[],!1,null,null,null,null).exports;const zi=ut({extends:Ni,type:"files",props:{uploads:[Boolean,Object,Array]},computed:{buttons(){const t=Ni.computed.buttons.call(this);return this.hasDropzone&&t.unshift({autofocus:this.autofocus,text:this.$t("upload"),responsive:!0,icon:"upload",click:()=>this.$panel.upload.pick(this.uploadOptions)}),t},emptyProps(){return{icon:"image",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.files.empty"):this.$t("field.files.empty.single"))}},hasDropzone(){return!this.disabled&&this.more&&this.uploads},uploadOptions(){return{accept:this.uploads.accept,max:this.max,multiple:this.multiple,preview:this.uploads.preview,url:this.$panel.urls.api+"/"+this.endpoints.field+"/upload",on:{done:t=>{!1===this.multiple&&(this.selected=[]);for(const e of t)void 0===this.selected.find((t=>t.id===e.id))&&this.selected.push(e);this.onInput(),this.$events.emit("file.upload"),this.$events.emit("model.update")}}}}},mounted(){this.$events.on("file.delete",this.removeById)},destroyed(){this.$events.off("file.delete",this.removeById)},methods:{drop(t){return!1!==this.uploads&&this.$panel.upload.open(t,this.uploadOptions)}}},null,null,!1,null,null,null,null).exports;const Fi=ut({},(function(){return(0,this._self._c)("div",{staticClass:"k-field k-gap-field"})}),[],!1,null,null,null,null).exports;const Yi=ut({mixins:[G,Q],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-headline-field"},[e("k-headline",{staticClass:"h2"},[t._v(" "+t._s(t.label)+" ")]),t.help?e("footer",{staticClass:"k-field-footer"},[e("k-text",{staticClass:"k-help k-field-help",attrs:{html:t.help}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const Ri=ut({mixins:[G,Q],props:{icon:String,text:String,theme:{type:String,default:"info"}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-field k-info-field"},[t.label?e("k-headline",[t._v(t._s(t.label))]):t._e(),e("k-box",{attrs:{icon:t.icon,theme:t.theme}},[e("k-text",{attrs:{html:t.text}})],1),t.help?e("footer",{staticClass:"k-field-footer"},[e("k-text",{staticClass:"k-help k-field-help",attrs:{html:t.help}})],1):t._e()],1)}),[],!1,null,null,null,null).exports,Ui={props:{endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean}};const Hi=ut({mixins:[Ui],props:{blocks:Array,width:{type:String,default:"1/1"}},emits:["input"]},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column k-layout-column",style:{"--width":t.width},attrs:{id:t.id,tabindex:"0"},on:{dblclick:function(e){return t.$refs.blocks.choose(t.blocks.length)}}},[e("k-blocks",t._b({ref:"blocks",on:{input:function(e){return t.$emit("input",e)}},nativeOn:{dblclick:function(t){t.stopPropagation()}}},"k-blocks",{endpoints:t.endpoints,fieldsets:t.fieldsets,fieldsetGroups:t.fieldsetGroups,group:"layout",value:t.blocks},!1))],1)}),[],!1,null,null,null,null).exports,Vi={mixins:[Ui,W],props:{columns:Array,layouts:{type:Array,default:()=>[["1/1"]]},settings:Object}};const Ki=ut({mixins:[Vi],props:{attrs:[Array,Object]},emits:["append","change","copy","duplicate","prepend","remove","select","updateAttrs","updateColumn"],computed:{options(){return[{click:()=>this.$emit("prepend"),icon:"angle-up",text:this.$t("insert.before")},{click:()=>this.$emit("append"),icon:"angle-down",text:this.$t("insert.after")},"-",{click:()=>this.openSettings(),icon:"settings",text:this.$t("settings"),when:!1===this.$helper.object.isEmpty(this.settings)},{click:()=>this.$emit("duplicate"),icon:"copy",text:this.$t("duplicate")},{click:()=>this.$emit("change"),disabled:1===this.layouts.length,icon:"dashboard",text:this.$t("field.layout.change")},"-",{click:()=>this.$emit("copy"),icon:"template",text:this.$t("copy")},{click:()=>this.$emit("paste"),icon:"download",text:this.$t("paste.after")},"-",{click:()=>this.remove(),icon:"trash",text:this.$t("field.layout.delete")}]},tabs(){let t=this.settings.tabs;for(const[e,i]of Object.entries(t))for(const n in i.fields)t[e].fields[n].endpoints={field:this.endpoints.field+"/fields/"+n,section:this.endpoints.section,model:this.endpoints.model};return t}},methods:{openSettings(){this.$panel.drawer.open({component:"k-form-drawer",props:{icon:"settings",tabs:this.tabs,title:this.$t("settings"),value:this.attrs},on:{input:t=>this.$emit("updateAttrs",t)}})},remove(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.layout.delete.confirm")},on:{submit:()=>{this.$emit("remove"),this.$panel.dialog.close()}}})}}},(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(i,n){return e("k-layout-column",t._b({key:i.id,on:{input:function(e){return t.$emit("updateColumn",{column:i,columnIndex:n,blocks:e})}}},"k-layout-column",{...i,endpoints:t.endpoints,fieldsetGroups:t.fieldsetGroups,fieldsets:t.fieldsets},!1))})),1),t.disabled?t._e():e("nav",{staticClass:"k-layout-toolbar"},[t.settings?e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{title:t.$t("settings"),icon:"settings"},on:{click:t.openSettings}}):t._e(),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:{options:t.options,"align-x":"end"}}),e("k-sort-handle")],1)],1)}),[],!1,null,null,null,null).exports,Wi={mixins:[Vi,X],props:{empty:String,max:Number,selector:Object,value:{type:Array,default:()=>[]}}};const Ji=ut({mixins:[Wi],emits:["input"],data(){return{current:null,nextIndex:null,rows:this.value,selected:null}},computed:{draggableOptions(){return{id:this.id,handle:!0,list:this.rows}},hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0}},watch:{value(){this.rows=this.value}},methods:{copy(t,e){if(0===this.rows.length)return!1;const i=void 0!==e?this.rows[e]:this.rows;this.$helper.clipboard.write(JSON.stringify(i),t),this.$panel.notification.success({message:this.$t("copy.success",{count:i.length??1}),icon:"template"})},change(t,e){const i=e.columns.map((t=>t.width)),n=this.layouts.findIndex((t=>t.toString()===i.toString()));this.$panel.dialog.open({component:"k-layout-selector",props:{label:this.$t("field.layout.change"),layouts:this.layouts,selector:this.selector,value:this.layouts[n]},on:{submit:i=>{this.onChange(i,n,{rowIndex:t,layoutIndex:n,layout:e}),this.$panel.dialog.close()}}})},duplicate(t,e){const i=structuredClone(e),n=this.updateIds(i);this.rows.splice(t+1,0,...n),this.save()},async onAdd(t){let e=await this.$api.post(this.endpoints.field+"/layout",{columns:t});this.rows.splice(this.nextIndex,0,e),this.save()},async onChange(t,e,i){if(e===this.layouts[i.layoutIndex])return;const n=i.layout,s=await this.$api.post(this.endpoints.field+"/layout",{attrs:n.attrs,columns:t}),o=n.columns.filter((t=>{var e;return(null==(e=null==t?void 0:t.blocks)?void 0:e.length)>0})),l=[];if(0===o.length)l.push(s);else{const t=Math.ceil(o.length/s.columns.length)*s.columns.length;for(let e=0;e{var n;return t.blocks=(null==(n=o[i+e])?void 0:n.blocks)??[],t})),t.columns.filter((t=>{var e;return null==(e=null==t?void 0:t.blocks)?void 0:e.length})).length&&l.push(t)}}this.rows.splice(i.rowIndex,1,...l),this.save()},async paste(t,e=this.rows.length){let i=await this.$api.post(this.endpoints.field+"/layout/paste",{json:this.$helper.clipboard.read(t)});i.length&&(this.rows.splice(e,0,...i),this.save()),this.$panel.notification.success({message:this.$t("paste.success",{count:i.length}),icon:"download"})},pasteboard(t){this.$panel.dialog.open({component:"k-block-pasteboard",on:{paste:e=>this.paste(e,t)}})},remove(t){const e=this.rows.findIndex((e=>e.id===t.id));-1!==e&&this.$delete(this.rows,e),this.save()},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.layout.delete.confirm.all")},on:{submit:()=>{this.rows=[],this.save(),this.$panel.dialog.close()}}})},save(){this.$emit("input",this.rows)},select(t){if(this.nextIndex=t,1===this.layouts.length)return this.onAdd(this.layouts[0]);this.$panel.dialog.open({component:"k-layout-selector",props:{layouts:this.layouts,selector:this.selector,value:null},on:{submit:t=>{this.onAdd(t),this.$panel.dialog.close()}}})},updateAttrs(t,e){this.rows[t].attrs=e,this.save()},updateColumn(t){this.rows[t.index].columns[t.columnIndex].blocks=t.blocks,this.save()},updateIds(t){return!1===Array.isArray(t)&&(t=[t]),t.map((t=>(t.id=this.$helper.uuid(),t.columns=t.columns.map((t=>(t.id=this.$helper.uuid(),t.blocks=t.blocks.map((t=>(t.id=this.$helper.uuid(),t))),t))),t)))}}},(function(){var t=this,e=t._self._c;return e("div",[t.hasFieldsets&&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(i,n){return e("k-layout",t._b({key:i.id,on:{append:function(e){return t.select(n+1)},change:function(e){return t.change(n,i)},copy:function(e){return t.copy(e,n)},duplicate:function(e){return t.duplicate(n,i)},paste:function(e){return t.pasteboard(n+1)},prepend:function(e){return t.select(n)},remove:function(e){return t.remove(i)},select:function(e){t.selected=i.id},updateAttrs:function(e){return t.updateAttrs(n,e)},updateColumn:function(e){return t.updateColumn({layout:i,index:n,...e})}}},"k-layout",{...i,disabled:t.disabled,endpoints:t.endpoints,fieldsetGroups:t.fieldsetGroups,fieldsets:t.fieldsets,isSelected:t.selected===i.id,layouts:t.layouts,settings:t.settings},!1))})),1)]:!1===t.hasFieldsets?e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"}},[t._v(" "+t._s(t.$t("field.blocks.fieldsets.empty"))+" ")]):e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"},on:{click:function(e){return t.select(0)}}},[t._v(" "+t._s(t.empty??t.$t("field.layout.empty"))+" ")])],2)}),[],!1,null,null,null,null).exports;const Gi=ut({mixins:[Fe,Wi,V],inheritAttrs:!1,computed:{hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.value.length},options(){return[{click:()=>this.$refs.layouts.copy(),disabled:this.isEmpty,icon:"template",text:this.$t("copy.all")},{click:()=>this.$refs.layouts.pasteboard(),icon:"download",text:this.$t("paste")},"-",{click:()=>this.$refs.layouts.removeAll(),disabled:this.isEmpty,icon:"trash",text:this.$t("delete.all")}]}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-layout-field",scopedSlots:t._u([!t.disabled&&t.hasFieldsets?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{staticClass:"input-focus",attrs:{autofocus:t.autofocus,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.layouts.select(0)}}}),e("k-button",{attrs:{icon:"dots",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:t.options,"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-layouts",t._b({ref:"layouts",on:{input:function(e){return t.$emit("input",e)}}},"k-layouts",t.$props,!1)),!t.disabled&&t.hasFieldsets?e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.layouts.select(t.value.length)}}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const Xi=ut({},(function(){return(0,this._self._c)("hr",{staticClass:"k-line-field"})}),[],!1,null,null,null,null).exports;const Zi=ut({mixins:[{mixins:[Fe,Ue,Ie,st],props:{value:{default:"",type:String}}}],inheritAttrs:!1,data:()=>({linkType:null,linkValue:null,expanded:!1,isInvalid:!1}),computed:{activeTypes(){return this.$helper.link.types(this.options)},activeTypesOptions(){const t=[];for(const e in this.activeTypes)t.push({click:()=>this.switchType(e),current:e===this.currentType.id,icon:this.activeTypes[e].icon,label:this.activeTypes[e].label});return t},currentType(){return this.activeTypes[this.linkType]??Object.values(this.activeTypes)[0]}},watch:{value:{async handler(t,e){if(t===e||t===this.linkValue)return;const i=this.$helper.link.detect(t,this.activeTypes);i&&(this.linkType=i.type,this.linkValue=i.link)},immediate:!0}},mounted(){this.$events.on("click",this.onOutsideClick)},destroyed(){this.$events.off("click",this.onOutsideClick)},methods:{clear(){this.linkValue="",this.$emit("input","")},focus(){var t;null==(t=this.$refs.input)||t.focus()},onInput(t){const e=(null==t?void 0:t.trim())??"";if(this.linkType??(this.linkType=this.currentType.id),this.linkValue=e,!e.length)return this.clear();this.$emit("input",this.currentType.value(e))},onInvalid(t){this.isInvalid=!!t},onOutsideClick(t){!1===this.$el.contains(t.target)&&(this.expanded=!1)},removeModel(){this.clear(),this.expanded=!1},selectModel(t){t.uuid?this.onInput(t.uuid):(this.switchType("url"),this.onInput(t.url))},async switchType(t){t!==this.currentType.id&&(this.isInvalid=!1,this.linkType=t,this.clear(),"page"===this.currentType.id||"file"===this.currentType.id?this.expanded=!0:this.expanded=!1,await this.$nextTick(),this.focus())},toggle(){this.expanded=!this.expanded}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-link-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({attrs:{invalid:t.isInvalid,icon:!1}},"k-input",t.$props,!1),[e("div",{staticClass:"k-link-input-header"},[e("k-button",{staticClass:"k-link-input-toggle",attrs:{disabled:t.disabled,dropdown:!t.disabled&&t.activeTypesOptions.length>1,icon:t.currentType.icon,variant:"filled"},on:{click:function(e){t.activeTypesOptions.length>1?t.$refs.types.toggle():t.toggle()}}},[t._v(" "+t._s(t.currentType.label)+" ")]),e("k-dropdown-content",{ref:"types",attrs:{options:t.activeTypesOptions}}),"page"===t.currentType.id||"file"===t.currentType.id?e("div",{staticClass:"k-link-input-model",on:{click:t.toggle}},[e("k-link-field-preview",{attrs:{removable:!0,type:t.currentType.id,value:t.value},on:{remove:t.removeModel},scopedSlots:t._u([{key:"placeholder",fn:function(){return[e("k-button",{staticClass:"k-link-input-model-placeholder"},[t._v(" "+t._s(t.currentType.placeholder)+" ")])]},proxy:!0}],null,!1,3171606015)}),e("k-button",{staticClass:"k-link-input-model-toggle",attrs:{icon:"bars"}})],1):e("k-"+t.currentType.input+"-input",{ref:"input",tag:"component",attrs:{id:t.id,disabled:t.disabled,pattern:t.currentType.pattern??null,placeholder:t.currentType.placeholder,value:t.linkValue},on:{invalid:t.onInvalid,input:t.onInput}})],1),"page"===t.currentType.id?e("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"k-link-input-body",attrs:{"data-type":"page"}},[e("div",{staticClass:"k-page-browser"},[e("k-page-tree",{attrs:{current:t.$helper.link.getPageUUID(t.value),root:!1},on:{select:function(e){return t.selectModel(e)}}})],1)]):"file"===t.currentType.id?e("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"k-link-input-body",attrs:{"data-type":"file"}},[e("k-file-browser",{attrs:{opened:t.$panel.view.props.model.uuid??t.$panel.view.props.model.id,selected:t.$helper.link.getFileUUID(t.value)},on:{select:function(e){return t.selectModel(e)}}})],1):t._e()])],1)}),[],!1,null,null,null,null).exports;const Qi=t=>({$from:e})=>((t,e)=>{for(let i=t.depth;i>0;i--){const n=t.node(i);if(e(n))return{pos:i>0?t.before(i):0,start:t.start(i),depth:i,node:n}}})(e,t),tn=t=>e=>{if((t=>t instanceof o)(e)){const{node:i,$from:n}=e;if(((t,e)=>Array.isArray(t)&&t.indexOf(e.type)>-1||e.type===t)(t,i))return{node:i,pos:n.pos,depth:n.depth}}},en=(t,e,i={})=>{const n=tn(e)(t.selection)||Qi((t=>t.type===e))(t.selection);return 0!==yt(i)&&n?n.node.hasMarkup(e,{...n.node.attrs,...i}):!!n};function nn(t=null,e=null){if(!t||!e)return!1;const i=t.parent.childAfter(t.parentOffset);if(!i.node)return!1;const n=i.node.marks.find((t=>t.type===e));if(!n)return!1;let s=t.index(),o=t.start()+i.offset,l=s+1,a=o+i.node.nodeSize;for(;s>0&&n.isInSet(t.parent.child(s-1).marks);)s-=1,o-=t.parent.child(s).nodeSize;for(;l{s=[...s,...t.marks]}));const o=s.find((t=>t.type.name===e.name));return o?o.attrs:{}},getNodeAttrs:function(t,e){const{from:i,to:n}=t.selection;let s=[];t.doc.nodesBetween(i,n,(t=>{s=[...s,t]}));const o=s.reverse().find((t=>t.type.name===e.name));return o?o.attrs:{}},insertNode:function(t,e,i,n){return(s,o)=>{o(s.tr.replaceSelectionWith(t.create(e,i,n)).scrollIntoView())}},markInputRule:function(t,i,n){return new e(t,((t,e,s,o)=>{const l=n instanceof Function?n(e):n,{tr:a}=t,r=e.length-1;let u=o,c=s;if(e[r]){const n=s+e[0].indexOf(e[r-1]),l=n+e[r-1].length-1,d=n+e[r-1].lastIndexOf(e[r]),p=d+e[r].length,h=function(t,e,i){let n=[];return i.doc.nodesBetween(t,e,((t,e)=>{n=[...n,...t.marks.map((i=>({start:e,end:e+t.nodeSize,mark:i})))]})),n}(s,o,t).filter((t=>{const{excluded:e}=t.mark.type;return e.find((t=>t.name===i.name))})).filter((t=>t.end>n));if(h.length)return!1;pn&&a.delete(n,d),c=n,u=c+e[r].length}return a.addMark(c,u,i.create(l)),a.removeStoredMark(i),a}))},markIsActive:function(t,e){const{from:i,$from:n,to:s,empty:o}=t.selection;return o?!!e.isInSet(t.storedMarks||n.marks()):!!t.doc.rangeHasMark(i,s,e)},markPasteRule:function(t,e,o){const l=(i,n)=>{const a=[];return i.forEach((i=>{var s;if(i.isText){const{text:l,marks:r}=i;let u,c=0;const d=!!r.filter((t=>"link"===t.type.name))[0];for(;!d&&null!==(u=t.exec(l));)if((null==(s=null==n?void 0:n.type)?void 0:s.allowsMarkType(e))&&u[1]){const t=u.index,n=t+u[0].length,s=t+u[0].indexOf(u[1]),l=s+u[1].length,r=o instanceof Function?o(u):o;t>0&&a.push(i.cut(c,t)),a.push(i.cut(s,l).mark(e.create(r).addToSet(i.marks))),c=n}cnew n(l(t.content),t.openStart,t.openEnd)}})},minMax:function(t=0,e=0,i=0){return Math.min(Math.max(parseInt(t,10),e),i)},nodeIsActive:en,nodeInputRule:function(t,i,n){return new e(t,((t,e,s,o)=>{const l=n instanceof Function?n(e):n,{tr:a}=t;return e[0]&&a.replaceWith(s,o,i.create(l)),a}))},pasteRule:function(t,e,o){const l=i=>{const n=[];return i.forEach((i=>{if(i.isText){const{text:s}=i;let l,a=0;do{if(l=t.exec(s),l){const t=l.index,s=t+l[0].length,r=o instanceof Function?o(l[0]):o;t>0&&n.push(i.cut(a,t)),n.push(i.cut(t,s).mark(e.create(r).addToSet(i.marks))),a=s}}while(l);anew n(l(t.content),t.openStart,t.openEnd)}})},removeMark:function(t){return(e,i)=>{const{tr:n,selection:s}=e;let{from:o,to:l}=s;const{$from:a,empty:r}=s;if(r){const e=nn(a,t);o=e.from,l=e.to}return n.removeMark(o,l,t),i(n)}},toggleBlockType:function(t,e,i={}){return(n,s,o)=>en(n,t,i)?l(e)(n,s,o):l(t,i)(n,s,o)},toggleList:function(t,e){return(i,n,s)=>{const{schema:o,selection:l}=i,{$from:u,$to:c}=l,d=u.blockRange(c);if(!d)return!1;const p=Qi((t=>sn(t,o)))(l);if(d.depth>=1&&p&&d.depth-p.depth<=1){if(p.node.type===t)return a(e)(i,n,s);if(sn(p.node,o)&&t.validContent(p.node.content)){const{tr:e}=i;return e.setNodeMarkup(p.pos,t),n&&n(e),!1}}return r(t)(i,n,s)}},toggleWrap:function(t,e={}){return(i,n,s)=>en(i,t,e)?u(i,n):c(t,e)(i,n,s)},updateMark:function(t,e){return(i,n)=>{const{tr:s,selection:o,doc:l}=i,{ranges:a,empty:r}=o;if(r){const{from:i,to:n}=nn(o.$from,t);l.rangeHasMark(i,n,t)&&s.removeMark(i,n,t),s.addMark(i,n,t.create(e))}else a.forEach((i=>{const{$to:n,$from:o}=i;l.rangeHasMark(o.pos,n.pos,t)&&s.removeMark(o.pos,n.pos,t),s.addMark(o.pos,n.pos,t.create(e))}));return n(s)}}};class ln{emit(t,...e){this._callbacks=this._callbacks??{};const i=this._callbacks[t]??[];for(const n of i)n.apply(this,e);return this}off(t,e){if(arguments.length){const i=this._callbacks?this._callbacks[t]:null;i&&(e?this._callbacks[t]=i.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}}class an{constructor(t=[],e){for(const i of t)i.bindEditor(e),i.init();this.extensions=t}commands({schema:t,view:e}){return this.extensions.filter((t=>t.commands)).reduce(((i,n)=>{const{name:s,type:o}=n,l={},a=n.commands({schema:t,utils:on,...["node","mark"].includes(o)?{type:t[`${o}s`][s]}:{}}),r=(t,i)=>{l[t]=t=>{if("function"!=typeof i||!e.editable)return!1;e.focus();const n=i(t);return"function"==typeof n?n(e.state,e.dispatch,e):n}};if("object"==typeof a)for(const[t,e]of Object.entries(a))r(t,e);else r(s,a);return{...i,...l}}),{})}buttons(t="mark"){const e={};for(const i of this.extensions)if(i.type===t&&i.button)if(Array.isArray(i.button))for(const t of i.button)e[t.id??t.name]=t;else e[i.name]=i.button;return e}getAllowedExtensions(t){return t instanceof Array||!t?t instanceof Array?this.extensions.filter((e=>!t.includes(e.name))):this.extensions:[]}getFromExtensions(t,e,i=this.extensions){return i.filter((t=>["extension"].includes(t.type))).filter((e=>e[t])).map((i=>i[t]({...e,utils:on})))}getFromNodesAndMarks(t,e,i=this.extensions){return i.filter((t=>["node","mark"].includes(t.type))).filter((e=>e[t])).map((i=>i[t]({...e,type:e.schema[`${i.type}s`][i.name],utils:on})))}inputRules({schema:t,excludedExtensions:e}){const i=this.getAllowedExtensions(e);return[...this.getFromExtensions("inputRules",{schema:t},i),...this.getFromNodesAndMarks("inputRules",{schema:t},i)].reduce(((t,e)=>[...t,...e]),[])}keymaps({schema:t}){return[...this.getFromExtensions("keys",{schema:t}),...this.getFromNodesAndMarks("keys",{schema:t})].map((t=>v(t)))}get marks(){return this.extensions.filter((t=>"mark"===t.type)).reduce(((t,{name:e,schema:i})=>({...t,[e]:i})),{})}get markViews(){return this.extensions.filter((t=>["mark"].includes(t.type))).filter((t=>t.view)).reduce(((t,{name:e,view:i})=>({...t,[e]:i})),{})}get nodes(){return this.extensions.filter((t=>"node"===t.type)).reduce(((t,{name:e,schema:i})=>({...t,[e]:i})),{})}get nodeViews(){return this.extensions.filter((t=>["node"].includes(t.type))).filter((t=>t.view)).reduce(((t,{name:e,view:i})=>({...t,[e]:i})),{})}get options(){const{view:t}=this;return this.extensions.reduce(((e,i)=>({...e,[i.name]:new Proxy(i.options,{set(e,i,n){const s=e[i]!==n;return Object.assign(e,{[i]:n}),s&&t.updateState(t.state),!0}})})),{})}pasteRules({schema:t,excludedExtensions:e}){const i=this.getAllowedExtensions(e);return[...this.getFromExtensions("pasteRules",{schema:t},i),...this.getFromNodesAndMarks("pasteRules",{schema:t},i)].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 i?t:new i(t)))}}class rn{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 un extends rn{constructor(t={}){super(t)}get type(){return"node"}get schema(){return{}}commands(){return{}}}class cn extends un{get defaults(){return{inline:!1}}get name(){return"doc"}get schema(){return{content:this.options.inline?"inline*":"block+"}}}class dn extends un{get button(){return{id:this.name,icon:"paragraph",label:window.panel.$t("toolbar.button.paragraph"),name:this.name,separator:!0}}commands({utils:t,schema:e,type:i}){return{paragraph:()=>this.editor.activeNodes.includes("bulletList")?t.toggleList(e.nodes.bulletList,e.nodes.listItem):this.editor.activeNodes.includes("orderedList")?t.toggleList(e.nodes.orderedList,e.nodes.listItem):this.editor.activeNodes.includes("quote")?t.toggleWrap(e.nodes.quote):t.setBlockType(i)}}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}get name(){return"paragraph"}}let pn=class extends un{get name(){return"text"}get schema(){return{group:"inline"}}};class hn extends ln{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!0!==this.options.useBuiltInExtensions?[]:[new cn({inline:this.options.inline}),new pn,new dn]}buttons(t){return this.extensions.buttons(t)}clearContent(t=!1){this.setContent(this.options.emptyDocument,t)}command(t,...e){var i,n;null==(n=(i=this.commands)[t])||n.call(i,...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(i){return window.console.warn("Invalid content.","Passed value:",t,"Error:",i),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"==typeof t){const i=`

      ${t}
      `,n=(new window.DOMParser).parseFromString(i,"text/html").body.firstElementChild;return y.fromSchema(this.schema).parse(n,e)}return!1}createEvents(){const t=this.options.events??{};for(const[e,i]of Object.entries(t))this.on(e,i);return t}createExtensions(){return new an([...this.builtInExtensions,...this.options.extensions],this)}createFocusEvents(){const t=(t,e,i=!0)=>{this.focused=i,this.emit(i?"focus":"blur",{event:e,state:t.state,view:t});const n=this.state.tr.setMeta("focused",i);this.view.dispatch(n)};return new i({props:{attributes:{tabindex:0},handleDOMEvents:{focus:(e,i)=>t(e,i,!0),blur:(e,i)=>t(e,i,!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}createMarkViews(){return this.extensions.markViews}createNodes(){return this.extensions.nodes}createNodeViews(){return this.extensions.nodeViews}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createPlugins(){return this.extensions.plugins({schema:this.schema})}createSchema(){return new $({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return w.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,x({rules:this.inputRules}),...this.pasteRules,...this.keymaps,v({Backspace:O}),v(M),this.createFocusEvents()]})}createView(){return new _(this.element,{dispatchTransaction:this.dispatchTransaction.bind(this),attributes:{class:"k-text"},editable:()=>this.options.editable,handlePaste:(t,e)=>{if("function"==typeof this.events.paste){const t=e.clipboardData.getData("text/html"),i=e.clipboardData.getData("text/plain");if(!0===this.events.paste(e,t,i))return!0}},handleDrop:(...t)=>{this.emit("drop",...t)},markViews:this.createMarkViews(),nodeViews:this.createNodeViews(),state:this.createState()})}destroy(){this.view&&this.view.destroy()}dispatchTransaction(t){const e=this.state,i=this.state.apply(t);this.view.updateState(i),this.setActiveNodesAndMarks();const n={editor:this,getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:t};this.emit("transaction",n),!t.docChanged&&t.getMeta("preventUpdate")||this.emit("update",n);const{from:s,to:o}=this.state.selection,l=!e||!e.selection.eq(i.selection);this.emit(i.selection.empty?"deselect":"select",{...n,from:s,hasChanged:l,to:o})}focus(t=null){if(this.view.focused&&null===t||!1===t)return;const{from:e,to:i}=this.selectionAtPosition(t);this.setSelection(e,i),setTimeout((()=>this.view.focus()),10)}getHTML(t=this.state.doc.content){const e=document.createElement("div"),i=C.fromSchema(this.schema).serializeFragment(t);return e.appendChild(i),this.options.inline&&e.querySelector("p")?e.querySelector("p").innerHTML:e.innerHTML}getHTMLStartToSelection(){const t=this.state.doc.slice(0,this.selection.head).content;return this.getHTML(t)}getHTMLSelectionToEnd(){const t=this.state.doc.slice(this.selection.head).content;return this.getHTML(t)}getHTMLStartToSelectionToEnd(){return[this.getHTMLStartToSelection(),this.getHTMLSelectionToEnd()]}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.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)}insertText(t,e=!1){const{tr:i}=this.state,n=i.insertText(t);if(this.view.dispatch(n),e){const e=i.selection.from,n=e-t.length;this.setSelection(n,e)}}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,i])=>({...t,[e]:(t={})=>i(t)})),{})}removeMark(t){if(this.schema.marks[t])return on.removeMark(this.schema.marks[t])(this.state,this.view.dispatch)}get selection(){return this.state.selection}get selectionAtEnd(){return S.atEnd(this.state.doc)}get selectionIsAtEnd(){return this.selection.head===this.selectionAtEnd.head}get selectionAtStart(){return S.atStart(this.state.doc)}get selectionIsAtStart(){return this.selection.head===this.selectionAtStart.head}selectionAtPosition(t=null){return null===t?this.selection:"start"===t||!0===t?this.selectionAtStart:"end"===t?this.selectionAtEnd:{from:t,to:t}}setActiveNodesAndMarks(){this.activeMarks=Object.values(this.schema.marks).filter((t=>on.markIsActive(this.state,t))).map((t=>t.name)),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce(((t,[e,i])=>({...t,[e]:on.getMarkAttrs(this.state,i)})),{}),this.activeNodes=Object.values(this.schema.nodes).filter((t=>on.nodeIsActive(this.state,t))).map((t=>t.name)),this.activeNodeAttrs=Object.entries(this.schema.nodes).reduce(((t,[e,i])=>({...t,[e]:on.getNodeAttrs(this.state,i)})),{})}setContent(t={},e=!1,i){const{doc:n,tr:s}=this.state,o=this.createDocument(t,i),l=s.replaceWith(0,n.content.size,o).setMeta("preventUpdate",!e);this.view.dispatch(l)}setSelection(t=0,e=0){const{doc:i,tr:n}=this.state,s=on.minMax(t,0,i.content.size),o=on.minMax(e,0,i.content.size),l=S.create(i,s,o),a=n.setSelection(l);this.view.dispatch(a)}get state(){var t;return null==(t=this.view)?void 0:t.state}toggleMark(t){if(this.schema.marks[t])return on.toggleMark(this.schema.marks[t])(this.state,this.view.dispatch)}updateMark(t,e){if(this.schema.marks[t])return on.updateMark(this.schema.marks[t],e)(this.state,this.view.dispatch)}}class mn extends rn{command(){return()=>{}}remove(){this.editor.removeMark(this.name)}get schema(){return{}}get type(){return"mark"}toggle(){return this.editor.toggleMark(this.name)}update(t){this.editor.updateMark(this.name,t)}}class fn extends mn{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 gn extends mn{get button(){return{icon:"clear",label:window.panel.$t("toolbar.button.clear")}}commands(){return()=>this.clear()}clear(){const{state:t}=this.editor,{from:e,to:i}=t.tr.selection;for(const n of this.editor.activeMarks){const s=t.schema.marks[n],o=this.editor.state.tr.removeMark(e,i,s);this.editor.view.dispatch(o)}}get name(){return"clear"}}let kn=class extends mn{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 bn extends mn{get button(){return{icon:"email",label:window.panel.$t("toolbar.button.email")}}commands(){return{email:t=>{if(t.altKey||t.metaKey)return this.remove();this.editor.emit("email",this.editor)},insertEmail:(t={})=>{const{selection:e}=this.editor.state;if(e.empty&&this.editor.insertText(t.href,!0),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,i)=>{const n=this.editor.getMarkAttrs("email");n.href&&!0===i.altKey&&i.target instanceof HTMLAnchorElement&&(i.stopPropagation(),window.open(n.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 vn extends mn{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]}}}let yn=class extends mn{get button(){return{icon:"url",label:window.panel.$t("toolbar.button.link")}}commands(){return{link:t=>{if(t.altKey||t.metaKey)return this.remove();this.editor.emit("link",this.editor)},insertLink:(t={})=>{const{selection:e}=this.editor.state;if(e.empty&&!1===this.editor.activeMarks.includes("link")&&this.editor.insertText(t.href,!0),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,i)=>{const n=this.editor.getMarkAttrs("link");n.href&&!0===i.altKey&&i.target instanceof HTMLAnchorElement&&(i.stopPropagation(),window.open(n.href,n.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},0]}}};class $n extends mn{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]}}}let wn=class extends mn{get button(){return{icon:"superscript",label:window.panel.$t("toolbar.button.sup")}}commands(){return()=>this.toggle()}get name(){return"sup"}get schema(){return{parseDOM:[{tag:"sup"}],toDOM:()=>["sup",0]}}};class xn extends mn{get button(){return{icon:"subscript",label:window.panel.$t("toolbar.button.sub")}}commands(){return()=>this.toggle()}get name(){return"sub"}get schema(){return{parseDOM:[{tag:"sub"}],toDOM:()=>["sub",0]}}}class _n extends mn{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 Cn extends un{get button(){return{id:this.name,icon:"list-bullet",label:window.panel.$t("toolbar.button.ul"),name:this.name,when:["listItem","bulletList","orderedList","paragraph"]}}commands({type:t,schema:e,utils:i}){return()=>i.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^\s*([-+*])\s$/,t)]}keys({type:t,schema:e,utils:i}){return{"Shift-Ctrl-8":i.toggleList(t,e.nodes.listItem)}}get name(){return"bulletList"}get schema(){return{content:"listItem+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]}}}class Sn extends un{commands({utils:t,type:e}){return()=>this.createHardBreak(t,e)}createHardBreak(t,e){return t.chainCommands(t.exitCode,t.insertNode(e))}get defaults(){return{enter:!1,text:!1}}keys({utils:t,type:e}){const i=this.createHardBreak(t,e);let n={"Mod-Enter":i,"Shift-Enter":i};return this.options.enter&&(n.Enter=i),n}get name(){return"hardBreak"}get schema(){return{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]}}}class On extends un{get button(){const t=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"]})));return t[t.length-1].separator=!0,t}commands({type:t,schema:e,utils:i}){let n={toggleHeading:n=>i.toggleBlockType(t,e.nodes.paragraph,n)};for(const s of this.options.levels)n[`h${s}`]=()=>i.toggleBlockType(t,e.nodes.paragraph,{level:s});return n}get defaults(){return{levels:[1,2,3,4,5,6]}}inputRules({type:t,utils:e}){return this.options.levels.map((i=>e.textblockTypeInputRule(new RegExp(`^(#{1,${i}})\\s$`),t,(()=>({level:i})))))}keys({type:t,utils:e}){return this.options.levels.reduce(((i,n)=>({...i,[`Shift-Ctrl-${n}`]:e.setBlockType(t,{level:n})})),{})}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 Mn extends un{commands({type:t,utils:e}){return()=>e.insertNode(t)}inputRules({type:t,utils:e}){const i=e.nodeInputRule(/^(?:---|___\s|\*\*\*\s)$/,t),n=i.handler;return i.handler=(t,e,i,s)=>n(t,e,i,s).replaceWith(i-1,i,""),[i]}get name(){return"horizontalRule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}}class An extends un{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 In extends un{get button(){return{id:this.name,icon:"list-numbers",label:window.panel.$t("toolbar.button.ol"),name:this.name,when:["listItem","bulletList","orderedList","paragraph"],separator:!0}}commands({type:t,schema:e,utils:i}){return()=>i.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:i}){return{"Shift-Ctrl-9":i.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 Dn extends un{get button(){return{id:this.name,icon:"quote",label:window.panel.$t("field.blocks.quote.name"),name:this.name}}commands({type:t,utils:e}){return()=>e.toggleWrap(t)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^\s*>\s$/,t)]}keys({utils:t}){return{"Shift-Tab":(e,i)=>t.lift(e,i)}}get name(){return"quote"}get schema(){return{content:"block+",group:"block",defining:!0,draggable:!1,parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]}}}let jn=class extends rn{commands(){return{undo:()=>A,redo:()=>I,undoDepth:()=>D,redoDepth:()=>j}}get defaults(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":A,"Mod-y":I,"Shift-Mod-z":I,"Mod-я":A,"Shift-Mod-я":I}}get name(){return"history"}plugins(){return[E({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}};class En extends rn{commands(){return{insertHtml:t=>(e,i)=>{let n=document.createElement("div");n.innerHTML=t.trim();const s=y.fromSchema(e.schema).parse(n);i(e.tr.replaceSelectionWith(s).scrollIntoView())}}}}class Ln extends rn{keys(){const t={};for(const e in this.options)t[e]=()=>(this.options[e](),!0);return t}}let Tn=class extends rn{constructor(t){super(),this.writer=t}get component(){return this.writer.$refs.toolbar}init(){this.editor.on("deselect",(({event:t})=>{var e;return null==(e=this.component)?void 0:e.close(t)})),this.editor.on("select",(({hasChanged:t})=>{var e;!1!==t&&(null==(e=this.component)||e.open())}))}get type(){return"toolbar"}};const Bn={mixins:[V,W,lt,rt],props:{breaks:Boolean,code:Boolean,emptyDocument:{type:Object,default:()=>({type:"doc",content:[]})},extensions:Array,headings:{default:()=>[1,2,3,4,5,6],type:[Array,Boolean]},inline:Boolean,keys:Object,marks:{type:[Array,Boolean],default:!0},nodes:{type:[Array,Boolean],default:()=>["heading","bulletList","orderedList"]},paste:{type:Function,default:()=>()=>!1},toolbar:{type:Object,default:()=>({inline:!0})},value:{type:String,default:""}}};const qn=ut({mixins:[Bn],emits:["input"],data(){return{editor:null,json:{},html:this.value,isEmpty:!0}},computed:{isCursorAtEnd(){return this.editor.selectionIsAtEnd},isCursorAtStart(){return this.editor.selectionIsAtStart},toolbarOptions(){return{marks:Array.isArray(this.marks)?this.marks:void 0,...this.toolbar,editor:this.editor}}},watch:{value(t,e){t!==e&&t!==this.html&&(this.html=t,this.editor.setContent(this.html))}},mounted(){this.editor=new hn({autofocus:this.autofocus,content:this.value,editable:!this.disabled,element:this.$el,emptyDocument:this.emptyDocument,parseOptions:{preserveWhitespace:!0},events:{link:t=>{this.$panel.dialog.open({component:"k-link-dialog",props:{value:t.getMarkAttrs("link")},on:{cancel:()=>t.focus(),submit:e=>{this.$panel.dialog.close(),t.command("toggleLink",e)}}})},email:t=>{this.$panel.dialog.open({component:"k-email-dialog",props:{value:this.editor.getMarkAttrs("email")},on:{cancel:()=>t.focus(),submit:e=>{this.$panel.dialog.close(),t.command("toggleEmail",e)}}})},paste:this.paste,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 Ln(this.keys),new jn,new En,new Tn(this),...this.extensions||[]],inline:this.inline}),this.isEmpty=this.editor.isEmpty(),this.json=this.editor.getJSON(),this.$panel.events.on("click",this.onBlur),this.$panel.events.on("focus",this.onBlur)},beforeDestroy(){this.editor.destroy(),this.$panel.events.off("click",this.onBlur),this.$panel.events.off("focus",this.onBlur)},methods:{command(t,...e){this.editor.command(t,...e)},createMarks(){return this.filterExtensions({clear:new gn,code:new kn,underline:new _n,strike:new $n,link:new yn,email:new bn,bold:new fn,italic:new vn,sup:new wn,sub:new xn,...this.createMarksFromPanelPlugins()},this.marks)},createMarksFromPanelPlugins(){const t=window.panel.plugins.writerMarks??{},e={};for(const i in t)e[i]=Object.create(mn.prototype,Object.getOwnPropertyDescriptors({name:i,...t[i]}));return e},createNodes(){const t=new Sn({text:!0,enter:this.inline});return this.filterExtensions({bulletList:new Cn,orderedList:new In,heading:new On({levels:this.headings}),horizontalRule:new Mn,listItem:new An,quote:new Dn,...this.createNodesFromPanelPlugins()},this.nodes,((e,i)=>((e.includes("bulletList")||e.includes("orderedList"))&&i.push(new An),!0===this.inline&&(i=i.filter((t=>!0===t.schema.inline))),i.push(t),i)))},createNodesFromPanelPlugins(){const t=window.panel.plugins.writerNodes??{},e={};for(const i in t)e[i]=Object.create(un.prototype,Object.getOwnPropertyDescriptors({name:i,...t[i]}));return e},getHTML(){return this.editor.getHTML()},filterExtensions(t,e,i){!1===e?e=[]:!0!==e&&!1!==Array.isArray(e)||(e=Object.keys(t));let n=[];for(const s in t)e.includes(s)&&n.push(t[s]);return"function"==typeof i&&(n=i(e,n)),n},focus(){this.editor.focus()},getSplitContent(){return this.editor.getHTMLStartToSelectionToEnd()},onBlur(t){var e;!1===this.$el.contains(t.target)&&(null==(e=this.$refs.toolbar)||e.close())},onCommand(t,...e){this.editor.command(t,...e)}}},(function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"direction",rawName:"v-direction"}],ref:"editor",staticClass:"k-writer",attrs:{"data-disabled":t.disabled,"data-empty":t.isEmpty,"data-placeholder":t.placeholder,"data-toolbar-inline":Boolean(t.toolbar.inline??!0),spellcheck:t.spellcheck}},[t.editor&&!t.disabled?e("k-writer-toolbar",t._b({ref:"toolbar",on:{command:t.onCommand}},"k-writer-toolbar",t.toolbarOptions,!1)):t._e()],1)}),[],!1,null,null,null,null).exports,Pn={mixins:[Ie,Bn,et,it]};const Nn=ut({mixins:[De,Pn],computed:{counterValue(){const t=this.$helper.string.stripHTML(this.value??"");return this.$helper.string.unescapeHTML(t)}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)}},validations(){return{counterValue:{required:!this.required||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.maxLength(this.maxlength)}}}},(function(){var t=this;return(0,t._self._c)("k-writer",t._b({ref:"input",staticClass:"k-writer-input",on:{input:function(e){return t.$emit("input",e)}}},"k-writer",t.$props,!1))}),[],!1,null,null,null,null).exports;class zn extends cn{get schema(){return{content:this.options.nodes.join("|")}}}const Fn={mixins:[Pn],inheritAttrs:!1,props:{nodes:{type:Array,default:()=>["bulletList","orderedList"]}}};const Yn=ut({mixins:[De,Fn],data(){return{list:this.value,html:this.value}},computed:{listExtensions(){return[new zn({inline:!0,nodes:this.nodes})]}},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.listExtensions,value:t.list},on:{input:t.onInput}},"k-writer",t.$props,!1))}),[],!1,null,null,null,null).exports;const Rn=ut({mixins:[Fe,Ue,Fn],inheritAttrs:!1,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.id,counter:!1}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"list"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,Un={mixins:[W,X,st],inheritAttrs:!1,props:{layout:String,sort:{default:!1,type:Boolean},value:{default:()=>[],type:Array}}};const Hn=ut({mixins:[Un],props:{draggable:{default:!0,type:Boolean}},emits:["edit","input"],data:()=>({tags:[]}),computed:{dragOptions(){return{delay:1,disabled:!this.isDraggable,draggable:".k-tag",handle:".k-tag-text"}},isDraggable(){return!0!==this.sort&&!1!==this.draggable&&0!==this.tags.length&&!0!==this.disabled}},watch:{value:{handler(){let t=structuredClone(this.value);if(!0===this.sort){const e=[];for(const i of this.options){const n=t.indexOf(i.value);-1!==n&&(e.push(i),t.splice(n,1))}e.push(...t),t=e}this.tags=t.map(this.tag).filter((t=>t))},immediate:!0}},methods:{edit(t,e,i){!1===this.disabled&&this.$emit("edit",t,e,i)},focus(t="last"){this.$refs.navigate.move(t)},index(t){return this.tags.findIndex((e=>e.value===t.value))},input(){this.$emit("input",this.tags.map((t=>t.value)))},navigate(t){this.focus(t)},remove(t){this.tags.length<=1?this.navigate("last"):this.navigate("prev"),this.tags.splice(t,1),this.input()},option(t){return this.options.find((e=>e.value===t.value))},select(){this.focus()},tag(t){"object"!=typeof t&&(t={value:t});const e=this.option(t);return e||{text:this.$helper.string.escapeHTML(t.text??t.value),value:t.value}}}},(function(){var t=this,e=t._self._c;return e("k-navigate",{ref:"navigate",attrs:{axis:"list"===t.layout?"y":"x",select:":where(.k-tag, .k-tags-navigatable):not(:disabled)"}},[e("k-draggable",{staticClass:"k-tags",attrs:{list:t.tags,options:t.dragOptions,"data-layout":t.layout},on:{end:t.input},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("default")]},proxy:!0}],null,!0)},t._l(t.tags,(function(i,n){return e("k-tag",{key:n,attrs:{disabled:t.disabled,image:i.image,removable:!t.disabled,name:"tag"},on:{remove:function(e){return t.remove(n,i)}},nativeOn:{click:function(t){t.stopPropagation()},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.edit(n,i,e)},dblclick:function(e){return t.edit(n,i,e)}}},[e("span",{domProps:{innerHTML:t._s(i.text)}})])})),1)],1)}),[],!1,null,null,null,null).exports,Vn={mixins:[nt,at,Un,je],props:{value:{default:()=>[],type:Array}},watch:{value:{handler(){this.$emit("invalid",this.$v.$invalid,this.$v)},immediate:!0}},validations(){return{value:{required:!this.required||t.required,minLength:!this.min||t.minLength(this.min),maxLength:!this.max||t.maxLength(this.max)}}},methods:{open(){this.$refs.dropdown.open(this.$el)}}};const Kn=ut({mixins:[De,Vn]},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-multiselect-input"},[e("k-tags",t._b({ref:"tags",on:{input:function(e){return t.$emit("input",e)}},nativeOn:{click:function(e){return e.stopPropagation(),t.open.apply(null,arguments)}}},"k-tags",t.$props,!1),[!t.max||t.value.length({editing:null}),computed:{canAdd(){return!this.max||this.value.length!1===this.value.includes(t.value)))},picklist(){return{disabled:this.disabled,create:this.showCreate,ignore:this.ignore,min:this.min,max:this.max,search:this.showSearch}},replacableOptions(){return this.options.filter((t=>{var e;return!1===this.value.includes(t.value)||t.value===(null==(e=this.editing)?void 0:e.tag.value)}))},showCreate(){return"options"!==this.accept&&(!this.editing||{submit:this.$t("replace.with")})},showSearch(){return!1!==this.search&&(this.editing?{placeholder:this.$t("replace.with"),...this.search}:"options"===this.accept?{placeholder:this.$t("filter"),...this.search}:this.search)}},methods:{create(t){const e=t.split(this.separator).map((t=>t.trim())),i=structuredClone(this.value);for(let n of e)n=this.$refs.tags.tag(n,this.separator),!0===this.isAllowed(n)&&i.push(n.value);this.$emit("input",i),this.$refs.create.close()},async edit(t,e){this.editing={index:t,tag:e},this.$refs.replace.open()},focus(){this.canAdd&&this.$refs.create.open()},isAllowed(t){return"object"==typeof t&&0!==t.value.trim().length&&(!("options"===this.accept&&!this.$refs.tags.option(t))&&!0!==this.value.includes(t.value))},pick(t){this.$emit("input",t),this.$refs.create.close()},replace(t){const{index:e}=this.editing,i=this.$refs.tags.tag(t);if(this.$refs.replace.close(),this.editing=null,!1===this.isAllowed(i))return!1;const n=structuredClone(this.value);n.splice(e,1,i.value),this.$emit("input",n),this.$refs.tags.navigate(e)},toggle(t){return!(t.metaKey||t.altKey||t.ctrlKey)&&("ArrowDown"===t.key?(this.$refs.create.open(),void t.preventDefault()):void(String.fromCharCode(t.keyCode).match(/(\w)/g)&&this.$refs.create.open()))}}},(function(){var t,e=this,i=e._self._c;return i("div",{staticClass:"k-tags-input",attrs:{"data-can-add":e.canAdd}},[i("k-tags",e._b({ref:"tags",on:{edit:e.edit,input:function(t){return e.$emit("input",t)}},nativeOn:{click:function(t){var i,n;t.stopPropagation(),null==(n=null==(i=e.$refs.toggle)?void 0:i.$el)||n.click()}}},"k-tags",e.$props,!1),[e.canAdd?i("k-button",{ref:"toggle",staticClass:"k-tags-input-toggle k-tags-navigatable input-focus",attrs:{id:e.id,autofocus:e.autofocus,disabled:e.disabled,size:"xs",icon:"add"},on:{click:function(t){return e.$refs.create.open()}},nativeOn:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:e.$refs.tags.focus("prev")},function(t){return e.toggle.apply(null,arguments)}]}}):e._e()],1),i("k-picklist-dropdown",e._b({ref:"replace",attrs:{multiple:!1,options:e.replacableOptions,value:(null==(t=e.editing)?void 0:t.tag.value)??""},on:{create:e.replace,input:e.replace}},"k-picklist-dropdown",e.picklist,!1)),i("k-picklist-dropdown",e._b({ref:"create",attrs:{options:e.creatableOptions,value:e.value},on:{create:e.create,input:e.pick}},"k-picklist-dropdown",e.picklist,!1))],1)}),[],!1,null,null,null,null).exports;const Gn=ut({mixins:[Fe,Ue,Wn,xi],inheritAttrs:!1,computed:{hasNoOptions(){return 0===this.options.length&&"options"===this.accept}},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.id,counter:t.counterOptions}},"k-field",t.$props,!1),[t.hasNoOptions?e("k-empty",{attrs:{icon:t.icon,text:t.$t("options.none")}}):e("k-input",t._g(t._b({ref:"input",attrs:{type:"tags"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Xn=ut({extends:Gn,inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-multiselect-field",attrs:{input:t.id,counter:t.counterOptions}},"k-field",t.$props,!1),[t.hasNoOptions?e("k-empty",{attrs:{icon:t.icon,text:t.$t("options.none")}}):e("k-input",t._g(t._b({ref:"input",attrs:{type:"multiselect"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,Zn={mixins:[Ie,lt],props:{max:Number,min:Number,name:[Number,String],preselect:Boolean,step:[Number,String],value:{type:[Number,String],default:""}}};const Qn=ut({mixins:[De,Zn],data(){return{number:this.format(this.value),stepNumber:this.format(this.step),timeout:null,listeners:{...this.$listeners,input:t=>this.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)},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||t.required,min:!this.min||t.minValue(this.min),max:!this.max||t.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 ts=ut({mixins:[Fe,Ue,Zn],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.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"number"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const es=ut({mixins:[Fe,Ue],props:{empty:String,fields:[Object,Array],value:[String,Object]},data:()=>({object:{}}),computed:{hasFields(){return this.$helper.object.length(this.fields)>0},isEmpty(){return null===this.object||0===this.$helper.object.length(this.object)},isInvalid(){return!0===this.required&&this.isEmpty}},watch:{value:{handler(t){this.object=this.valueToObject(t)},immediate:!0}},methods:{add(){this.object=this.$helper.field.form(this.fields),this.save(),this.open()},cell(t,e){this.$set(this.object,t,e),this.save()},form(t){const e=this.$helper.field.subfields(this,this.fields);if(t)for(const i in e)e[i].autofocus=i===t;return e},remove(){this.object={},this.save()},open(t){if(this.disabled)return!1;this.$panel.drawer.open({component:"k-form-drawer",props:{breadcrumb:[],icon:"box",tab:"object",tabs:{object:{fields:this.form(t)}},title:this.label,value:this.object},on:{input:t=>{for(const e in t)this.$set(this.object,e,t[e]);this.save()}}})},save(){this.$emit("input",this.object)},valueToObject:t=>"object"!=typeof t?{}:t}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-object-field",scopedSlots:t._u([!t.disabled&&t.hasFields?{key:"options",fn:function(){return[t.isEmpty?e("k-button",{attrs:{icon:"add",size:"xs",variant:"filled"},on:{click:t.add}}):e("k-button",{attrs:{icon:"remove",size:"xs",variant:"filled"},on:{click:t.remove}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[t.hasFields?[t.isEmpty?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"box"},on:{click:t.add}},[t._v(" "+t._s(t.empty??t.$t("field.object.empty"))+" ")]):e("table",{staticClass:"k-table k-object-field-table",attrs:{"aria-disabled":t.disabled,"data-invalid":t.isInvalid}},[e("tbody",[t._l(t.fields,(function(i){return[i.saveable&&t.$helper.field.isVisible(i,t.value)?e("tr",{key:i.name,on:{click:function(e){return t.open(i.name)}}},[e("th",{attrs:{"data-has-button":"","data-mobile":"true"}},[e("button",{attrs:{type:"button"}},[t._v(t._s(i.label))])]),e("k-table-cell",{attrs:{column:i,field:i,mobile:!0,value:t.object[i.name]},on:{input:function(e){return t.cell(i.name,e)}}})],1):t._e()]}))],2)])]:[e("k-empty",{attrs:{icon:"box"}},[t._v(t._s(t.$t("fields.empty")))])]],2)}),[],!1,null,null,null,null).exports;const is=ut({extends:Ni,type:"pages",computed:{emptyProps(){return{icon:"page",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.pages.empty"):this.$t("field.pages.empty.single"))}}}},null,null,!1,null,null,null,null).exports,ns={mixins:[Li],props:{autocomplete:{type:String,default:"new-password"},type:{type:String,default:"password"}}};const ss=ut({extends:Ti,mixins:[ns]},null,null,!1,null,null,null,null).exports;const os=ut({mixins:[Fe,Ue,ns,xi],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.id,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:{type:"password"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,ls={mixins:[Ie,st],props:{columns:Number,reset:{default:!0,type:Boolean},theme:String,value:[String,Number,Boolean]}};const as=ut({mixins:[De,ls],computed:{choices(){return this.options.map(((t,e)=>({autofocus:this.autofocus&&0===e,checked:this.value===t.value,disabled:this.disabled||t.disabled,id:`${this.id}-${e}`,info:t.info,label:t.text,name:this.name??this.id,type:"radio",value:t.value})))}},watch:{value:{handler(){this.validate()},immediate:!0}},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},select(){this.focus()},toggle(t){t===this.value&&this.reset&&!this.required&&this.$emit("input","")},validate(){this.$emit("invalid",this.$v.$invalid,this.$v)}},validations(){return{value:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-radio-input k-grid",style:{"--columns":t.columns},attrs:{"data-variant":"choices"}},t._l(t.choices,(function(i,n){return e("li",{key:n},[e("k-choice-input",t._b({on:{input:function(e){return t.$emit("input",i.value)}},nativeOn:{click:function(e){return e.stopPropagation(),t.toggle(i.value)}}},"k-choice-input",i,!1))],1)})),0)}),[],!1,null,null,null,null).exports;const rs=ut({mixins:[Fe,Ue,ls],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t,e=this,i=e._self._c;return i("k-field",e._b({staticClass:"k-radio-field",attrs:{input:e.id+"-0"}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?i("k-radio-input",e._g(e._b({ref:"input"},"k-radio-input",e.$props,!1),e.$listeners)):i("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[],!1,null,null,null,null).exports,us={mixins:[Ie],props:{default:[Number,String],max:{type:Number,default:100},min:{type:Number,default:0},step:{type:[Number,String],default:1},tooltip:{type:[Boolean,Object],default:()=>({before:null,after:null})},value:[Number,String]}};const cs=ut({mixins:[De,us],computed:{baseline(){return this.min<0?0:this.min},isEmpty(){return""===this.value||void 0===this.value||null===this.value},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()},value(){this.validate()}},mounted(){this.onInvalid(),this.validate(),this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},format(t){const e=document.lang?document.lang.replace("_","-"):"en",i=this.step.toString().split("."),n=i.length>1?i[1].length:0;return new Intl.NumberFormat(e,{minimumFractionDigits:n}).format(t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.$emit("input",t)},validate(){var t;const e=[];this.required&&!0===this.isEmpty&&e.push(this.$t("error.validation.required")),!1===this.isEmpty&&this.min&&this.valuethis.max&&e.push(this.$t("error.validation.max",{max:this.max})),null==(t=this.$refs.range)||t.setCustomValidity(e.join(", "))}},validations(){return{position:{required:!this.required||t.required,min:!this.min||t.minValue(this.min),max:!this.max||t.maxValue(this.max)}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-range-input",attrs:{"data-disabled":t.disabled}},[e("input",t._b({ref:"range",attrs:{type:"range"},domProps:{value:t.position},on:{input:function(e){return t.$emit("input",e.target.valueAsNumber)}}},"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.tooltip?e("output",{staticClass:"k-range-input-tooltip",attrs:{for:t.id}},[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 ds=ut({mixins:[Ue,Fe,us],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.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"range"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,ps={mixins:[Ie,st,lt],props:{ariaLabel:String,default:String,empty:{type:[Boolean,String],default:!0},value:{type:[String,Number,Boolean],default:""}}};const hs=ut({mixins:[De,ps],emits:["click","input"],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)},isEmpty(){return null===this.selected||void 0===this.selected||""===this.selected},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;for(const i of this.options)i.value==t&&(e=i.text);return e}},validations(){return{selected:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-select-input",attrs:{"data-disabled":t.disabled,"data-empty":t.isEmpty}},[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(i){return e("option",{key:i.value,attrs:{disabled:i.disabled},domProps:{value:i.value}},[t._v(" "+t._s(i.text)+" ")])}))],2),t._v(" "+t._s(t.label)+" ")])}),[],!1,null,null,null,null).exports;const ms=ut({mixins:[Fe,Ue,ps],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.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"select"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,fs={mixins:[Li],props:{allow:{type:String,default:""},formData:{type:Object,default:()=>({})},sync:{type:String}}};const gs=ut({extends:Ti,mixins:[fs],data(){return{slug:this.sluggify(this.value),slugs:this.$panel.language.rules??this.$panel.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.$panel.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 ks=ut({mixins:[Fe,Ue,fs],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;let e=null==(t=this.wizard)?void 0:t.field;if(e){const t=this.formData[e.toLowerCase()];t&&(this.slug=t)}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-slug-field",attrs:{input:t.id,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:"sparkling",size:"xs",variant:"filled"},on:{click:t.onWizard}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{value:t.slug,type:"slug"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const bs=ut({mixins:[Fe],inheritAttrs:!1,props:{autofocus:Boolean,columns:Object,duplicate:{type:Boolean,default:!0},empty:String,fields:[Array,Object],limit:Number,max:Number,min:Number,prepend:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},sortBy:String,value:{type:Array,default:()=>[]}},data:()=>({items:[],page:1}),computed:{dragOptions(){return{disabled:!this.isSortable,fallbackClass:"k-sortable-row-fallback"}},index(){return this.limit?(this.page-1)*this.limit+1:1},more(){return!0!==this.disabled&&!(this.max&&this.items.length>=this.max)},hasFields(){return this.$helper.object.length(this.fields)>0},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(){if(this.disabled)return[];let t=[],e=this.duplicate&&this.more;return t.push({icon:"edit",text:this.$t("edit"),click:"edit"}),t.push({disabled:!e,icon:"copy",text:this.$t("duplicate"),click:"duplicate"}),t.push("-"),t.push({icon:"trash",text:e?this.$t("delete"):null,click:"remove"}),t},paginatedItems(){return this.limit?this.items.slice(this.pagination.offset,this.pagination.offset+this.limit):this.items}},watch:{value:{handler(t){t!==this.items&&(this.items=this.toItems(t))},immediate:!0}},methods:{add(t=null){if(!1===this.more)return!1;(t=t??this.$helper.field.form(this.fields))._id=t._id??this.$helper.uuid(),!0===this.prepend?this.items.unshift(t):this.items.push(t),this.save(),this.open(t)},close(){this.$panel.drawer.close(this.id)},focus(){var t,e;null==(e=null==(t=this.$refs.add)?void 0:t.focus)||e.call(t)},form(t){const e=this.$helper.field.subfields(this,this.fields);if(t)for(const i in e)e[i].autofocus=i===t;return e},findIndex(t){return this.items.findIndex((e=>e._id===t._id))},navigate(t,e){const i=this.findIndex(t);!0!==this.disabled&&-1!==i&&this.open(this.items[i+e],null,!0)},open(t,e,i=!1){const n=this.findIndex(t);if(!0===this.disabled||-1===n)return!1;this.$panel.drawer.open({component:"k-structure-drawer",id:this.id,props:{icon:this.icon??"list-bullet",next:this.items[n+1],prev:this.items[n-1],tabs:{content:{fields:this.form(e)}},title:this.label,value:t},replace:i,on:{input:e=>{const i=this.findIndex(t);this.$panel.drawer.props.next=this.items[i+1],this.$panel.drawer.props.prev=this.items[i-1],this.$set(this.items,i,e),this.save()},next:()=>{this.navigate(t,1)},prev:()=>{this.navigate(t,-1)},remove:()=>{this.remove(t)}}})},option(t,e){switch(t){case"remove":this.remove(e);break;case"duplicate":this.add({...structuredClone(e),_id:this.$helper.uuid()});break;case"edit":this.open(e)}},paginate({page:t}){this.page=t},remove(t){const e=this.findIndex(t);this.disabled||-1===e||this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.structure.delete.confirm")},on:{submit:()=>{this.items.splice(e,1),this.save(),this.$panel.dialog.close(),this.close(),0===this.paginatedItems.length&&this.page>1&&this.page--}}})},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.structure.delete.confirm.all")},on:{submit:()=>{this.page=1,this.items=[],this.save(),this.$panel.dialog.close()}}})},save(t=this.items){this.$emit("input",t)},sort(t){return this.sortBy?this.$helper.array.sortBy(t,this.sortBy):t},toItems(t){return!1===Array.isArray(t)?[]:(t=t.map((t=>({_id:t._id??this.$helper.uuid(),...t}))),this.sort(t))}}},(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([t.hasFields&&!t.disabled?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{attrs:{autofocus:t.autofocus,disabled:!t.more,responsive:!0,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.add()}}}),e("k-button",{attrs:{icon:"dots",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:[{click:()=>t.add(),disabled:!t.more,icon:"add",text:t.$t("add")},{click:()=>t.removeAll(),disabled:0===t.items.length||t.disabled,icon:"trash",text:t.$t("delete.all")}],"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[t.hasFields?[0===t.items.length?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"list-bullet"},on:{click:function(e){return t.add()}}},[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,pagination:!!t.limit&&t.pagination,rows:t.paginatedItems,sortable:t.isSortable,"data-invalid":t.isInvalid},on:{cell:function(e){return t.open(e.row,e.columnIndex)},input:t.save,option:t.option,paginate:t.paginate}}),t.more?e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.add()}}})],1):t._e()]]:[e("k-empty",{attrs:{icon:"list-bullet"}},[t._v(t._s(t.$t("fields.empty")))])]],2)}),[],!1,null,null,null,null).exports,vs={mixins:[Li],props:{autocomplete:{default:"tel"},placeholder:{default:()=>window.panel.$t("tel.placeholder")},type:{default:"tel"}}};const ys=ut({extends:Ti,mixins:[vs]},null,null,!1,null,null,null,null).exports;const $s=ut({mixins:[Fe,Ue,vs],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.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"tel"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const ws=ut({mixins:[Fe,Ue,Li,xi],inheritAttrs:!1,computed:{inputType(){return this.$helper.isComponent(`k-${this.type}-input`)?this.type:"text"}},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.id,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:{type:t.inputType}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,xs={props:{buttons:{type:[Array,Boolean],default:!0},uploads:[Boolean,Object,Array]}};const _s=ut({mixins:[xs],emits:["command"],computed:{commands(){return{headlines:{label:this.$t("toolbar.button.headings"),icon:"title",dropdown:[{label:this.$t("toolbar.button.heading.1"),icon:"h1",click:()=>this.command("prepend","#")},{label:this.$t("toolbar.button.heading.2"),icon:"h2",click:()=>this.command("prepend","##")},{label:this.$t("toolbar.button.heading.3"),icon:"h3",click:()=>this.command("prepend","###")}]},bold:{label:this.$t("toolbar.button.bold"),icon:"bold",click:()=>this.command("toggle","**"),shortcut:"b"},italic:{label:this.$t("toolbar.button.italic"),icon:"italic",click:()=>this.command("toggle","*"),shortcut:"i"},link:{label:this.$t("toolbar.button.link"),icon:"url",click:()=>this.command("dialog","link"),shortcut:"k"},email:{label:this.$t("toolbar.button.email"),icon:"email",click:()=>this.command("dialog","email"),shortcut:"e"},file:{label:this.$t("toolbar.button.file"),icon:"attachment",click:()=>this.command("file"),dropdown:this.uploads?[{label:this.$t("toolbar.button.file.select"),icon:"check",click:()=>this.command("file")},{label:this.$t("toolbar.button.file.upload"),icon:"upload",click:()=>this.command("upload")}]:void 0},code:{label:this.$t("toolbar.button.code"),icon:"code",click:()=>this.command("toggle","`")},ul:{label:this.$t("toolbar.button.ul"),icon:"list-bullet",click:()=>this.command("insert",((t,e)=>e.split("\n").map((t=>"- "+t)).join("\n")))},ol:{label:this.$t("toolbar.button.ol"),icon:"list-numbers",click:()=>this.command("insert",((t,e)=>e.split("\n").map(((t,e)=>e+1+". "+t)).join("\n")))}}},default:()=>["headlines","|","bold","italic","code","|","link","email","file","|","ul","ol"],layout(){if(!1===this.buttons)return[];const t=[],e=Array.isArray(this.buttons)?this.buttons:this.default,i={...this.commands,...window.panel.plugins.textareaButtons??{}};for(const n of e)if("|"===n)t.push("|");else if(i[n]){const e={...i[n],click:()=>{var t;null==(t=i[n].click)||t.call(this)}};t.push(e)}return t}},methods:{close(){this.$refs.toolbar.close()},command(t,...e){this.$emit("command",t,...e)},shortcut(t,e){var i;const n=this.layout.find((e=>e.shortcut===t));n&&(e.preventDefault(),null==(i=n.click)||i.call(n))}}},(function(){return(0,this._self._c)("k-toolbar",{ref:"toolbar",staticClass:"k-textarea-toolbar",attrs:{buttons:this.layout}})}),[],!1,null,null,null,null).exports,Cs={mixins:[xs,Ie,J,et,it,lt,rt],props:{endpoints:Object,preselect:Boolean,size:String,theme:String,value:String}};const Ss=ut({mixins:[De,Cs],emits:["focus","input","submit"],data:()=>({over:!1}),computed:{uploadOptions(){const t=this.restoreSelectionCallback();return{url:this.$panel.urls.api+"/"+this.endpoints.field+"/upload",multiple:!1,on:{cancel:t,done:e=>{t((()=>this.insertUpload(e)))}}}}},watch:{async value(){this.onInvalid(),await this.$nextTick(),this.$library.autosize.update(this.$refs.input)}},async mounted(){await this.$nextTick(),this.$library.autosize(this.$refs.input),this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{dialog(t){const e=this.restoreSelectionCallback();this.$panel.dialog.open({component:"k-toolbar-"+t+"-dialog",props:{value:this.parseSelection()},on:{cancel:e,submit:t=>{this.$panel.dialog.close(),e((()=>this.insert(t)))}}})},file(){const t=this.restoreSelectionCallback();this.$panel.dialog.open({component:"k-files-dialog",props:{endpoint:this.endpoints.field+"/files",multiple:!1},on:{cancel:t,submit:e=>{t((()=>this.insertFile(e))),this.$panel.dialog.close()}}})},focus(){this.$refs.input.focus()},insert(t){const e=this.$refs.input,i=e.value;"function"==typeof t&&(t=t(this.$refs.input,this.selection())),setTimeout((()=>{if(e.focus(),document.execCommand("insertText",!1,t),e.value===i){const i=e.selectionStart,n=e.selectionEnd,s=i===n?"end":"select";e.setRangeText(t,i,n,s)}this.$emit("input",e.value)}))},insertFile(t){(null==t?void 0:t.length)>0&&this.insert(t.map((t=>t.dragText)).join("\n\n"))},insertUpload(t){this.insertFile(t),this.$events.emit("model.update")},onCommand(t,...e){if("function"!=typeof this[t])return console.warn(t+" is not a valid command");this[t](...e)},onDrop(t){if(this.uploads&&this.$helper.isUploadEvent(t))return this.$panel.upload.open(t.dataTransfer.files,this.uploadOptions);"text"===this.$panel.drag.type&&(this.focus(),this.insert(this.$panel.drag.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);"text"===this.$panel.drag.type&&(t.dataTransfer.dropEffect="copy",this.focus(),this.over=!0)},onShortcut(t){var e;!1!==this.buttons&&"Meta"!==t.key&&"Control"!==t.key&&(null==(e=this.$refs.toolbar)||e.shortcut(t.key,t))},onSubmit(t){return this.$emit("submit",t)},parseSelection(){const t=this.selection();if(0===(null==t?void 0:t.length))return{href:null,title:null};let e;e=this.$panel.config.kirbytext?/^\(link:\s*(?.*?)(?:\s*text:\s*(?.*?))?\)$/is:/^(\[(?.*?)\]\((?.*?)\))|(<(?.*?)>)$/is;const i=e.exec(t);return null!==i?{href:i.groups.url??i.groups.link,title:i.groups.text??null}:{href:null,title:t}},prepend(t){this.insert(t+" "+this.selection())},restoreSelectionCallback(){const t=this.$refs.input.selectionStart,e=this.$refs.input.selectionEnd;return i=>{setTimeout((()=>{this.$refs.input.setSelectionRange(t,e),i&&i()}))}},select(){this.$refs.select()},selection(){return this.$refs.input.value.substring(this.$refs.input.selectionStart,this.$refs.input.selectionEnd)},toggle(t,e){e=e??t;const i=this.selection();return i.startsWith(t)&&i.endsWith(e)?this.insert(i.slice(t.length).slice(0,i.length-t.length-e.length)):this.wrap(t,e)},upload(){this.$panel.upload.pick(this.uploadOptions)},wrap(t,e){this.insert(t+this.selection()+(e??t))}},validations(){return{value:{required:!this.required||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.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}},[e("div",{staticClass:"k-textarea-input-wrapper"},[t.buttons&&!t.disabled?e("k-textarea-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:function(e){var i;null==(i=t.$refs.toolbar)||i.close()},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?e.ctrlKey||e.shiftKey||e.altKey?null:t.onShortcut.apply(null,arguments):null},function(e){return e.ctrlKey?e.shiftKey||e.altKey||e.metaKey?null: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)])}),[],!1,null,null,null,null).exports;const Os=ut({mixins:[Fe,Ue,Cs,xi],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.id,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"textarea"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,Ms={props:{max:String,min:String,value:String}},As={mixins:[Ms],props:{display:{type:String,default:"HH:mm"},step:{type:Object,default:()=>({size:5,unit:"minute"})},type:{type:String,default:"time"}}};const Is=ut({mixins:[ji,As],computed:{inputType:()=>"time"}},null,null,!1,null,null,null,null).exports;const Ds=ut({mixins:[Fe,Ue,As],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.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"time"},on:{input:function(e){return t.$emit("input",e??"")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.icon??"clock",title:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{"align-x":"end"}},[e("k-timeoptions-input",{attrs:{display:t.display,value:t.value},on:{input:t.select}})],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,js={props:{autofocus:Boolean,disabled:Boolean,id:[Number,String],text:{type:[Array,String]},required:Boolean,value:Boolean}};const Es=ut({mixins:[De,js],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:{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||t.required}}}},(function(){var t=this;return(0,t._self._c)("k-choice-input",{ref:"input",staticClass:"k-toggle-input",attrs:{id:t.id,checked:t.value,disabled:t.disabled,label:t.label,type:"checkbox",variant:"toggle"},on:{input:function(e){return t.$emit("input",e)}}})}),[],!1,null,null,null,null).exports;const Ls=ut({mixins:[Fe,Ue,js],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.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"toggle"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,Ts={mixins:[Ie],props:{columns:Number,grow:Boolean,labels:Boolean,options:Array,reset:Boolean,value:[String,Number,Boolean]}};const Bs=ut({mixins:[De,Ts],watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input[checked]")||this.$el.querySelector("input"))||t.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||t.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(i,n){return e("li",{key:n,attrs:{"data-disabled":t.disabled}},[e("input",{staticClass:"input-hidden",attrs:{id:t.id+"-"+n,"aria-label":i.text,disabled:t.disabled,name:t.id,type:"radio"},domProps:{value:i.value,checked:t.value===i.value},on:{click:function(e){return t.onClick(i.value)},change:function(e){return t.onInput(i.value)}}}),e("label",{attrs:{for:t.id+"-"+n,title:i.text}},[i.icon?e("k-icon",{attrs:{type:i.icon}}):t._e(),t.labels||!i.icon?e("span",{staticClass:"k-toggles-text",domProps:{innerHTML:t._s(i.text)}}):t._e()],1)])})),0)}),[],!1,null,null,null,null).exports;const qs=ut({mixins:[Fe,Ue,Ts],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)}}},(function(){var t,e=this,i=e._self._c;return i("k-field",e._b({staticClass:"k-toggles-field",attrs:{input:e.id}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?i("k-input",e._g(e._b({ref:"input",class:{grow:e.grow},attrs:{type:"toggles"}},"k-input",e.$props,!1),e.$listeners)):i("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[],!1,null,null,null,null).exports,Ps={mixins:[Li],props:{autocomplete:{type:String,default:"url"},placeholder:{type:String,default:()=>window.panel.$t("url.placeholder")},type:{type:String,default:"url"}}};const Ns=ut({extends:Ti,mixins:[Ps]},null,null,!1,null,null,null,null).exports;const zs=ut({mixins:[Fe,Ue,Ps],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"url"}},computed:{isValidUrl(){return""!==this.value&&!0===this.$helper.url.isUrl(this.value,!0)}},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.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"url"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link&&t.isValidUrl?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.value,title: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;const Fs=ut({extends:Ni,type:"users",computed:{emptyProps(){return{icon:"users",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.users.empty"):this.$t("field.users.empty.single"))}}}},null,null,!1,null,null,null,null).exports;const Ys=ut({mixins:[Fe,Ue,Pn,xi],inheritAttrs:!1,computed:{counterValue(){const t=this.$helper.string.stripHTML(this.value??"");return this.$helper.string.unescapeHTML(t)}},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.id,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{after:t.after,before:t.before,icon:t.icon,type:"writer"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,Rs={install(t){t.component("k-blocks-field",yi),t.component("k-checkboxes-field",_i),t.component("k-color-field",Ai),t.component("k-date-field",Ei),t.component("k-email-field",Pi),t.component("k-files-field",zi),t.component("k-gap-field",Fi),t.component("k-headline-field",Yi),t.component("k-info-field",Ri),t.component("k-layout-field",Gi),t.component("k-line-field",Xi),t.component("k-link-field",Zi),t.component("k-list-field",Rn),t.component("k-multiselect-field",Xn),t.component("k-number-field",ts),t.component("k-object-field",es),t.component("k-pages-field",is),t.component("k-password-field",os),t.component("k-radio-field",rs),t.component("k-range-field",ds),t.component("k-select-field",ms),t.component("k-slug-field",ks),t.component("k-structure-field",bs),t.component("k-tags-field",Gn),t.component("k-text-field",ws),t.component("k-textarea-field",Os),t.component("k-tel-field",$s),t.component("k-time-field",Ds),t.component("k-toggle-field",Ls),t.component("k-toggles-field",qs),t.component("k-url-field",zs),t.component("k-users-field",Fs),t.component("k-writer-field",Ys)}},Us={mixins:[us],props:{max:null,min:null,step:{default:.01,type:Number},tooltip:{default:!1,type:[Boolean,Object]}}};const Hs=ut({mixins:[cs,Us]},(function(){var t=this;return(0,t._self._c)("k-range-input",t._b({staticClass:"k-alpha-input",attrs:{min:0,max:1},on:{input:function(e){return t.$emit("input",e)}}},"k-range-input",t.$props,!1))}),[],!1,null,null,null,null).exports;const Vs=ut({mixins:[Ie,Ii],data(){const t=this.$library.dayjs();return{maxdate:null,mindate:null,month:t.month(),selected:null,today:t,year:t.year()}},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,i)=>{t.push({value:i,text:e})})),t},years(){const t=this.year-20,e=this.year+20;return this.toOptions(t,e)}},watch:{max:{handler(t,e){t!==e&&(this.maxdate=this.$library.dayjs.interpret(t,"date"))},immediate:!0},min:{handler(t,e){t!==e&&(this.mindate=this.$library.dayjs.interpret(t,"date"))},immediate:!0},value:{handler(t,e){t!==e&&(this.selected=this.$library.dayjs.interpret(t,"date"),this.show(this.selected))},immediate:!0}},methods:{days(t){let e=[];const i=7*(t-1)+1,n=i+7;for(let s=i;sthis.numberOfDays;e.push(i?"":t)}return e},isDisabled(t){const e=this.toDate(t);return this.disabled||e.isBefore(this.mindate,"day")||e.isAfter(this.maxdate,"day")},isSelected(t){return this.toDate(t).isSame(this.selected,"day")},isToday(t){return this.toDate(t).isSame(this.today,"day")},onNext(){const t=this.toDate().add(1,"month");this.show(t)},onPrev(){const t=this.toDate().subtract(1,"month");this.show(t)},select(t){this.$emit("input",(null==t?void 0:t.toISO("date"))??null)},show(t){this.month=(t??this.today).month(),this.year=(t??this.today).year()},toDate(t=1,e){return this.$library.dayjs(`${this.year}-${(e??this.month)+1}-${t}`)},toOptions(t,e){for(var i=[],n=t;n<=e;n++)i.push({value:n,text:this.$helper.pad(n)});return i}}},(function(){var t=this,e=t._self._c;return e("fieldset",{staticClass:"k-calendar-input",on:{click:function(t){t.stopPropagation()}}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("date.select")))]),e("nav",[e("k-button",{attrs:{title:t.$t("prev"),icon:"angle-left"},on:{click:t.onPrev}}),e("span",{staticClass:"k-calendar-selects"},[e("k-select-input",{attrs:{"aria-label":t.$t("month"),autofocus:t.autofocus,options:t.months,empty:!1,required:!0,value:t.month},on:{input:function(e){t.month=Number(e)}}}),e("k-select-input",{attrs:{"aria-label":t.$t("year"),options:t.years,empty:!1,required:!0,value:t.year},on:{input:function(e){t.year=Number(e)}}})],1),e("k-button",{attrs:{title:t.$t("next"),icon:"angle-right"},on:{click:t.onNext}})],1),e("table",{key:t.year+"-"+t.month,staticClass:"k-calendar-table"},[e("thead",[e("tr",t._l(t.weekdays,(function(i){return e("th",{key:"weekday_"+i},[t._v(" "+t._s(i)+" ")])})),0)]),e("tbody",t._l(t.weeks,(function(i){return e("tr",{key:"week_"+i},t._l(t.days(i),(function(i,n){return e("td",{key:"day_"+n,staticClass:"k-calendar-day",attrs:{"aria-current":!!t.isToday(i)&&"date","aria-selected":!!t.isSelected(i)&&"date"}},[i?e("k-button",{attrs:{disabled:t.isDisabled(i),text:i},on:{click:function(e){t.select(t.toDate(i))}}}):t._e()],1)})),0)})),0),e("tfoot",[e("tr",[e("td",{staticClass:"k-calendar-today",attrs:{colspan:"7"}},[e("k-button",{attrs:{disabled:t.disabled,text:t.$t("today")},on:{click:function(e){t.show(t.today),t.select(t.today)}}})],1)])])]),e("input",{staticClass:"input-hidden",attrs:{id:t.id,disabled:t.disabled,min:t.min,max:t.max,name:t.name,required:t.required,tabindex:"-1",type:"date"},domProps:{value:t.value}})])}),[],!1,null,null,null,null).exports;const Ks=ut({mixins:[De,{mixins:[Ie],props:{checked:{type:Boolean},info:{type:String},label:{type:String},type:{default:"checkbox",type:String},value:{type:[Boolean,Number,String]},variant:{type:String}}}]},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-choice-input",attrs:{"aria-disabled":t.disabled}},[e("input",t._b({class:{"sr-only":"invisible"===t.variant},attrs:{"data-variant":t.variant},on:{input:function(e){return t.$emit("input",e.target.checked)}}},"input",{autofocus:t.autofocus,id:t.id,checked:t.checked,disabled:t.disabled,name:t.name,required:t.required,type:t.type,value:t.value},!1)),t.label||t.info?e("span",{staticClass:"k-choice-input-label"},[e("span",{staticClass:"k-choice-input-label-text",domProps:{innerHTML:t._s(t.label)}}),t.info?e("span",{staticClass:"k-choice-input-label-info",domProps:{innerHTML:t._s(t.info)}}):t._e()]):t._e()])}),[],!1,null,null,null,null).exports;const Ws=ut({extends:Ks},null,null,!1,null,null,null,null).exports;const Js=ut({mixins:[as,{mixins:[ls],props:{format:{type:String,default:"hex",validator:t=>["hex","rgb","hsl"].includes(t)},value:{type:String}}}],computed:{choices(){return this.options.map((t=>({...t,title:t.text??t.value,value:this.colorToString(t.value)})))}},methods:{colorToString(t){try{return this.$library.colors.toString(t,this.format)}catch{return t}}}},(function(){var t=this,e=t._self._c;return t.choices.length?e("fieldset",{staticClass:"k-coloroptions-input",attrs:{disabled:t.disabled}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("options")))]),e("ul",t._l(t.choices,(function(i,n){return e("li",{key:n},[e("label",{attrs:{title:i.title}},[e("input",{staticClass:"input-hidden",attrs:{autofocus:t.autofocus&&0===n,disabled:t.disabled,name:t.name??t.id,required:t.required,type:"radio"},domProps:{checked:i.value===t.value,value:i.value},on:{click:function(e){return t.toggle(i.value)},input:function(e){return t.$emit("input",i.value)}}}),e("k-color-frame",{attrs:{color:i.value}})],1)])})),0)]):t._e()}),[],!1,null,null,null,null).exports;const Gs=ut({mixins:[De,{mixins:[Ie,st],props:{alpha:{default:!0,type:Boolean},format:{default:"hex",type:String,validator:t=>["hex","rgb","hsl"].includes(t)},value:{type:[Object,String]}}}],data:()=>({color:{h:0,s:0,v:1,a:1},formatted:null}),computed:{coords(){return this.value?{x:100*this.color.s,y:100*(1-this.color.v)}:null},hsl(){try{const t=this.$library.colors.convert(this.color,"hsl");return{h:t.h,s:(100*t.s).toFixed()+"%",l:(100*t.l).toFixed()+"%",a:t.a}}catch{return{h:0,s:"0%",l:"0%",a:1}}}},watch:{value:{handler(t,e){if(t===e||t===this.formatted)return;const i=this.$library.colors.parseAs(t??"","hsv");i?(this.formatted=this.$library.colors.toString(i,this.format),this.color=i):(this.formatted=null,this.color={h:0,s:0,v:1,a:1})},immediate:!0}},methods:{between:(t,e,i)=>Math.min(Math.max(t,e),i),emit(){return this.formatted=this.$library.colors.toString(this.color,this.format),this.$emit("input",this.formatted)},focus(){this.$refs.coords.focus()},setAlpha(t){this.color.a=this.alpha?this.between(Number(t),0,1):1,this.emit()},setCoords(t){if(!t)return this.$emit("input","");const e=Math.round(t.x),i=Math.round(t.y);this.color.s=this.between(e/100,0,1),this.color.v=this.between(1-i/100,0,1),this.emit()},setHue(t){this.color.h=this.between(Number(t),0,360),this.emit()}}},(function(){var t=this,e=t._self._c;return e("fieldset",{staticClass:"k-colorpicker-input",style:{"--h":t.hsl.h,"--s":t.hsl.s,"--l":t.hsl.l,"--a":t.hsl.a}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("color")))]),e("k-coords-input",{ref:"coords",attrs:{autofocus:t.autofocus,disabled:t.disabled,required:t.required,value:t.coords},on:{input:function(e){return t.setCoords(e)}}}),e("label",{attrs:{"aria-label":t.$t("hue")}},[e("k-hue-input",{attrs:{disabled:t.disabled,required:t.required,value:t.color.h},on:{input:function(e){return t.setHue(e)}}})],1),t.alpha?e("label",{attrs:{"aria-label":t.$t("alpha")}},[e("k-alpha-input",{attrs:{disabled:t.disabled,required:t.required,value:t.color.a},on:{input:function(e){return t.setAlpha(e)}}})],1):t._e(),e("k-coloroptions-input",{attrs:{disabled:t.disabled,format:t.format,options:t.options,required:t.required,value:t.value},on:{input:function(e){return t.$emit("input",e)}}}),e("input",{staticClass:"input-hidden",attrs:{name:t.name,required:t.required,tabindex:"-1",type:"text"},domProps:{value:t.formatted}})],1)}),[],!1,null,null,null,null).exports;const Xs=ut({mixins:[De,{mixins:[Ie],props:{reset:{default:!0,type:Boolean},value:{default:()=>({x:0,y:0}),type:Object}}}],data:()=>({x:0,y:0}),watch:{value:{handler(t){const e=this.parse(t);this.x=(null==e?void 0:e.x)??0,this.y=(null==e?void 0:e.y)??0},immediate:!0}},methods:{focus(){var t;null==(t=this.$el.querySelector("button"))||t.focus()},getCoords:(t,e)=>({x:Math.min(Math.max(t.clientX-e.left,0),e.width),y:Math.min(Math.max(t.clientY-e.top,0),e.height)}),onDelete(){this.reset&&!this.required&&this.$emit("input",null)},onDrag(t){if(0!==t.button)return;const e=t=>this.onMove(t),i=()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",i)};window.addEventListener("mousemove",e),window.addEventListener("mouseup",i)},onEnter(){var t;null==(t=this.$el.form)||t.requestSubmit()},onInput(t,e){if(t.preventDefault(),t.stopPropagation(),this.disabled)return!1;this.x=Math.min(Math.max(parseFloat(e.x??this.x??0),0),100),this.y=Math.min(Math.max(parseFloat(e.y??this.y??0),0),100),this.$emit("input",{x:this.x,y:this.y})},onKeys(t){const e=t.shiftKey?10:1,i={ArrowUp:{y:this.y-e},ArrowDown:{y:this.y+e},ArrowLeft:{x:this.x-e},ArrowRight:{x:this.x+e}};i[t.key]&&this.onInput(t,i[t.key])},async onMove(t){const e=this.$el.getBoundingClientRect(),i=this.getCoords(t,e),n=i.x/e.width*100,s=i.y/e.height*100;this.onInput(t,{x:n,y:s}),await this.$nextTick(),this.focus()},parse(t){if("object"==typeof t)return t;const e={"top left":{x:0,y:0},"top center":{x:50,y:0},"top right":{x:100,y:0},"center left":{x:0,y:50},center:{x:50,y:50},"center center":{x:50,y:50},"center right":{x:100,y:50},"bottom left":{x:0,y:100},"bottom center":{x:50,y:100},"bottom right":{x:100,y:100}};if(e[t])return e[t];const i=t.split(",").map((t=>t.trim()));return{x:i[0],y:i[1]??0}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-coords-input",attrs:{"aria-disabled":t.disabled,"data-empty":!t.value},on:{mousedown:t.onDrag,click:t.onMove,keydown:t.onKeys}},[t._t("default"),e("button",{staticClass:"k-coords-input-thumb",style:{left:`${t.x}%`,top:`${t.y}%`},attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onEnter.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:t.onDelete.apply(null,arguments)}]}}),e("input",{staticClass:"input-hidden",attrs:{name:t.name,required:t.required,tabindex:"-1",type:"text"},domProps:{value:t.value?[t.value.x,t.value.y]:null}})],2)}),[],!1,null,null,null,null).exports,Zs={mixins:[us],props:{max:null,min:null,step:{default:1,type:Number},tooltip:{default:!1,type:[Boolean,Object]}}};const Qs=ut({mixins:[cs,Zs]},(function(){var t=this;return(0,t._self._c)("k-range-input",t._b({staticClass:"k-hue-input",attrs:{min:0,max:360},on:{input:function(e){return t.$emit("input",e)}}},"k-range-input",t.$props,!1))}),[],!1,null,null,null,null).exports;const to=ut({mixins:[Si,{mixins:[Ci],props:{autocomplete:null,pattern:null,spellcheck:null,placeholder:{default:()=>window.panel.$t("search")+" …",type:String}}}]},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-search-input",attrs:{spellcheck:!1,autocomplete:"off",type:"search"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[],!1,null,null,null,null).exports;const eo=ut({mixins:[De,{mixins:[Ie,Ms]}],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:{focus(){this.$el.querySelector("button").focus()},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-timeoptions-input"},[e("div",[e("h3",[e("k-icon",{attrs:{type:"sun"}}),t._v(" "),e("span",{staticClass:"sr-only"},[t._v(t._s(t.$t("day")))])],1),e("ul",t._l(t.day,(function(i,n){return e("li",{key:i.select},["-"===i?e("hr"):e("k-button",{attrs:{autofocus:t.autofocus&&0===n,disabled:t.disabled,selected:i.select===t.value&&"time"},on:{click:function(e){return t.select(i.select)}}},[t._v(" "+t._s(i.display)+" ")])],1)})),0)]),e("div",[e("h3",[e("k-icon",{attrs:{type:"moon"}}),t._v(" "),e("span",{staticClass:"sr-only"},[t._v(t._s(t.$t("night")))])],1),e("ul",t._l(t.night,(function(i){return e("li",{key:i.select},["-"===i?e("hr"):e("k-button",{attrs:{disabled:t.disabled,selected:i.select===t.value&&"time"},on:{click:function(e){return t.select(i.select)}}},[t._v(" "+t._s(i.display)+" ")])],1)})),0)]),e("input",{staticClass:"input-hidden",attrs:{id:t.id,disabled:t.disabled,min:t.min,max:t.max,name:t.name,required:t.required,tabindex:"-1",type:"time"},domProps:{value:t.value}})])}),[],!1,null,null,null,null).exports,io={install(t){t.component("k-alpha-input",Hs),t.component("k-calendar-input",Vs),t.component("k-checkbox-input",Ws),t.component("k-checkboxes-input",wi),t.component("k-choice-input",Ks),t.component("k-colorname-input",Mi),t.component("k-coloroptions-input",Js),t.component("k-colorpicker-input",Gs),t.component("k-coords-input",Xs),t.component("k-date-input",ji),t.component("k-email-input",qi),t.component("k-hue-input",Qs),t.component("k-list-input",Yn),t.component("k-multiselect-input",Kn),t.component("k-number-input",Qn),t.component("k-password-input",ss),t.component("k-picklist-input",Le),t.component("k-radio-input",as),t.component("k-range-input",cs),t.component("k-search-input",to),t.component("k-select-input",hs),t.component("k-slug-input",gs),t.component("k-string-input",Si),t.component("k-tags-input",Jn),t.component("k-tel-input",ys),t.component("k-text-input",Ti),t.component("k-textarea-input",Ss),t.component("k-time-input",Is),t.component("k-timeoptions-input",eo),t.component("k-toggle-input",Es),t.component("k-toggles-input",Bs),t.component("k-url-input",Ns),t.component("k-writer-input",Nn),t.component("k-calendar",Vs),t.component("k-times",eo)}};const no=ut({mixins:[Et],inheritAttrs:!1,props:{cancelButton:{default:!1},label:{default(){return this.$t("field.layout.select")},type:String},layouts:{type:Array},selector:Object,submitButton:{default:!1},value:{type:Array}},emits:["cancel","input","submit"]},(function(){var t,e,i=this,n=i._self._c;return n("k-dialog",i._b({staticClass:"k-layout-selector",attrs:{size:(null==(t=i.selector)?void 0:t.size)??"medium"},on:{cancel:function(t){return i.$emit("cancel")},submit:function(t){return i.$emit("submit",i.value)}}},"k-dialog",i.$props,!1),[n("h3",{staticClass:"k-label"},[i._v(i._s(i.label))]),n("k-navigate",{staticClass:"k-layout-selector-options",style:{"--columns":Number((null==(e=i.selector)?void 0:e.columns)??3)},attrs:{axis:"x"}},i._l(i.layouts,(function(t,e){return n("button",{key:e,staticClass:"k-layout-selector-option",attrs:{"aria-current":i.value===t,"aria-label":t.join(","),value:t},on:{click:function(e){return i.$emit("input",t)}}},[n("k-grid",{attrs:{"aria-hidden":""}},i._l(t,(function(t,e){return n("k-column",{key:e,attrs:{width:t}})})),1)],1)})),0)],1)}),[],!1,null,null,null,null).exports,so={install(t){t.component("k-layout",Ki),t.component("k-layout-column",Hi),t.component("k-layouts",Ji),t.component("k-layout-selector",no)}},oo={inheritAttrs:!1,props:{column:{default:()=>({}),type:Object},field:{default:()=>({}),type:Object},value:{}}},lo={props:{html:{type:Boolean}}};const ao=ut({mixins:[lo],inheritAttrs:!1,props:{bubbles:[Array,String]},computed:{items(){let t=this.bubbles;return"string"==typeof t&&(t=t.split(",")),t.map((t=>"string"===t?{text:t}:t))}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-bubbles"},t._l(t.items,(function(i,n){return e("li",{key:n},[e("k-bubble",t._b({attrs:{html:t.html}},"k-bubble",i,!1))],1)})),0)}),[],!1,null,null,null,null).exports;const ro=ut({mixins:[oo,lo],props:{value:{default:()=>[],type:[Array,String]}},computed:{bubbles(){let t=this.value;const e=this.column.options??this.field.options??[];return"string"==typeof t&&(t=t.split(",")),(t??[]).map((t=>{"string"==typeof t&&(t={value:t,text:t});for(const i of e)i.value===t.value&&(t.text=i.text);return 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,html:t.html}})],1)}),[],!1,null,null,null,null).exports;const uo=ut({extends:ro,inheritAttrs:!1,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;const co=ut({mixins:[oo],props:{value:String},computed:{text(){var t;if(!this.value)return;const e=this.$library.colors.toString(this.value,this.field.format,this.field.alpha),i=null==(t=this.field.options)?void 0:t.find((t=>this.$library.colors.toString(t.value,this.field.format,this.field.alpha)===e));return i?i.text:null}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-color-field-preview"},[e("k-color-frame",{attrs:{color:t.value}}),t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2)}),[],!1,null,null,null,null).exports;const po=ut({mixins:[oo],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;const ho=ut({extends:po,props:{value:String},class:"k-date-field-preview",computed:{display(){return this.column.display??this.field.display},format(){var t;let e=this.display??"YYYY-MM-DD";return(null==(t=this.time)?void 0:t.display)&&(e+=" "+this.time.display),e},parsed(){return this.$library.dayjs(this.value)},text(){var t;return!1===this.parsed.isValid()?this.value:null==(t=this.parsed)?void 0:t.format(this.format)},time(){return this.column.time??this.field.time}}},null,null,!1,null,null,null,null).exports;const mo=ut({mixins:[oo],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,attrs:{"data-link":t.link}},[t._v(" "+t._s(t.column.before)+" "),e("k-link",{attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[e("span",[t._v(t._s(t.text))])]),t._v(" "+t._s(t.column.after)+" ")],1)}),[],!1,null,null,null,null).exports;const fo=ut({extends:mo,class:"k-email-field-preview"},null,null,!1,null,null,null,null).exports;const go=ut({extends:ro,class:"k-files-field-preview",props:{html:{type:Boolean,default:!0}},computed:{bubbles(){return this.value.map((t=>({text:t.filename,link:t.link,image:t.image})))}}},null,null,!1,null,null,null,null).exports;const ko=ut({mixins:[oo],props:{value:Object},computed:{status(){var t;return{...this.$helper.page.status(null==(t=this.value)?void 0:t.status),...this.value}}}},(function(){var t=this,e=t._self._c;return t.value?e("k-button",t._b({staticClass:"k-flag-field-preview",attrs:{size:"md"}},"k-button",t.status,!1)):t._e()}),[],!1,null,null,null,null).exports;const bo=ut({mixins:[oo],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("k-text",{attrs:{html:t.html}}),t._v(" "+t._s(t.column.after)+" ")],1)}),[],!1,null,null,null,null).exports;const vo=ut({mixins:[oo],props:{value:[Object]}},(function(){var t=this,e=t._self._c;return t.value?e("k-item-image",{staticClass:"k-image-field-preview",attrs:{image:t.value}}):t._e()}),[],!1,null,null,null,null).exports;const yo=ut({mixins:[oo],inheritAttrs:!1,props:{removable:Boolean,type:String},emits:["remove"],data:()=>({model:null}),computed:{currentType(){return this.type??this.detected.type},detected(){return this.$helper.link.detect(this.value)},isLink(){return["url","email","tel"].includes(this.currentType)}},watch:{detected:{async handler(t,e){t!==e&&(this.model=await this.$helper.link.preview(this.detected))},immediate:!0},type(){this.model=null}}},(function(){var t=this,e=t._self._c;return e("div",{class:{"k-link-field-preview":!0,"k-url-field-preview":t.isLink}},["page"===t.currentType||"file"===t.currentType?[t.model?[e("k-tag",{attrs:{image:{...t.model.image,cover:!0},removable:t.removable,text:t.model.label},on:{remove:function(e){return t.$emit("remove",e)}}})]:t._t("placeholder")]:t.isLink?[e("p",{staticClass:"k-text"},[e("a",{attrs:{href:t.value,target:"_blank"}},[e("span",[t._v(t._s(t.detected.link))])])])]:[t._v(" "+t._s(t.detected.link)+" ")]],2)}),[],!1,null,null,null,null).exports;const $o=ut({extends:ro,class:"k-object-field-preview",props:{value:[Array,Object]},computed:{bubbles(){return this.value?[{text:"{ ... }"}]:[]}}},null,null,!1,null,null,null,null).exports;const wo=ut({extends:ro,inheritAttrs:!1,class:"k-pages-field-preview",props:{html:{type:Boolean,default:!0}}},null,null,!1,null,null,null,null).exports;const xo=ut({extends:ho,class:"k-time-field-preview",computed:{format(){return this.display??"HH:mm"},parsed(){return this.$library.dayjs.iso(this.value,"time")},text(){var t;return null==(t=this.parsed)?void 0:t.format(this.format)}}},null,null,!1,null,null,null,null).exports;const _o=ut({mixins:[oo],props:{value:Boolean},emits:["input"],computed:{isEditable(){return!0!==this.field.disabled},text(){return!1!==this.column.text?this.field.text:null}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-toggle-field-preview"},[e("k-toggle-input",{attrs:{disabled:!t.isEditable,text:t.text,value:t.value},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{click:function(e){t.isEditable&&e.stopPropagation()}}})],1)}),[],!1,null,null,null,null).exports;const Co=ut({extends:ro,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,So={install(t){t.component("k-array-field-preview",uo),t.component("k-bubbles-field-preview",ro),t.component("k-color-field-preview",co),t.component("k-date-field-preview",ho),t.component("k-email-field-preview",fo),t.component("k-files-field-preview",go),t.component("k-flag-field-preview",ko),t.component("k-html-field-preview",bo),t.component("k-image-field-preview",vo),t.component("k-link-field-preview",yo),t.component("k-object-field-preview",$o),t.component("k-pages-field-preview",wo),t.component("k-text-field-preview",po),t.component("k-toggle-field-preview",_o),t.component("k-time-field-preview",xo),t.component("k-url-field-preview",mo),t.component("k-users-field-preview",Co),t.component("k-list-field-preview",bo),t.component("k-writer-field-preview",bo),t.component("k-checkboxes-field-preview",ro),t.component("k-multiselect-field-preview",ro),t.component("k-radio-field-preview",ro),t.component("k-select-field-preview",ro),t.component("k-tags-field-preview",ro),t.component("k-toggles-field-preview",ro)}};const Oo=ut({mixins:[{props:{buttons:{type:Array,default:()=>[]},theme:{type:String,default:"light"}}}],methods:{close(){for(const t in this.$refs){const e=this.$refs[t][0];"function"==typeof(null==e?void 0:e.close)&&e.close()}}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-toolbar",attrs:{"data-theme":t.theme}},[t._l(t.buttons,(function(i,n){var s;return["|"===i?e("hr",{key:n}):i.when??1?e("k-button",{key:n,class:["k-toolbar-button",i.class],attrs:{current:i.current,disabled:i.disabled,icon:i.icon,title:i.label,tabindex:"0"},on:{click:function(e){var s,o;(null==(s=i.dropdown)?void 0:s.length)?t.$refs[n+"-dropdown"][0].toggle():null==(o=i.click)||o.call(i,e)}},nativeOn:{keydown:function(t){var e;null==(e=i.key)||e.call(i,t)}}}):t._e(),(i.when??1)&&(null==(s=i.dropdown)?void 0:s.length)?e("k-dropdown-content",{key:n+"-dropdown",ref:n+"-dropdown",refInFor:!0,attrs:{options:i.dropdown,theme:"dark"===t.theme?"light":"dark"}}):t._e()]}))],2)}),[],!1,null,null,null,null).exports;const Mo=ut({extends:Bt,props:{fields:{default:()=>{const t=Bt.props.fields.default();return t.title.label=window.panel.$t("link.text"),t}}},methods:{submit(){const t=this.values.href??"",e=this.values.title??"";return this.$panel.config.kirbytext?(null==e?void 0:e.length)>0?this.$emit("submit",`(email: ${t} text: ${e})`):this.$emit("submit",`(email: ${t})`):(null==e?void 0:e.length)>0?this.$emit("submit",`[${e}](mailto:${t})`):this.$emit("submit",`<${t}>`)}}},null,null,!1,null,null,null,null).exports;const Ao=ut({extends:Kt,props:{fields:{default:()=>({href:{label:window.panel.$t("link"),type:"link",placeholder:window.panel.$t("url.placeholder"),icon:"url"},title:{label:window.panel.$t("link.text"),type:"text",icon:"title"}})}},methods:{submit(){const t=this.values.href??"",e=this.values.title??"";return this.$panel.config.kirbytext?(null==e?void 0:e.length)>0?this.$emit("submit",`(link: ${t} text: ${e})`):this.$emit("submit",`(link: ${t})`):(null==e?void 0:e.length)>0?this.$emit("submit",`[${e}](${t})`):this.$emit("submit",`<${t}>`)}}},null,null,!1,null,null,null,null).exports,Io={install(t){t.component("k-toolbar",Oo),t.component("k-textarea-toolbar",_s),t.component("k-toolbar-email-dialog",Mo),t.component("k-toolbar-link-dialog",Ao)}};const Do=ut({props:{editor:{required:!0,type:Object},inline:{default:!0,type:Boolean},marks:{default:()=>["bold","italic","underline","strike","code","|","link","email","|","clear"],type:[Array,Boolean]},nodes:{default:!0,type:[Array,Boolean]}},emits:["command"],data:()=>({isOpen:!1,position:{x:0,y:0}}),computed:{activeNode(){return Object.values(this.nodeButtons).find((t=>this.isNodeActive(t)))??!1},buttons(){var t,e,i;const n=[];if(this.hasNodes){const s=[];let o=0;for(const n in this.nodeButtons){const l=this.nodeButtons[n];s.push({current:(null==(t=this.activeNode)?void 0:t.id)===l.id,disabled:!1===(null==(i=null==(e=this.activeNode)?void 0:e.when)?void 0:i.includes(l.name)),icon:l.icon,label:l.label,click:()=>this.command(l.command??n)}),!0===l.separator&&o!==Object.keys(this.nodeButtons).length-1&&s.push("-"),o++}n.push({current:Boolean(this.activeNode),icon:this.activeNode.icon??"title",dropdown:s})}if(this.hasNodes&&this.hasMarks&&n.push("|"),this.hasMarks)for(const s in this.markButtons){const t=this.markButtons[s];"|"!==t?n.push({current:this.editor.activeMarks.includes(s),icon:t.icon,label:t.label,click:e=>this.command(t.command??s,e)}):n.push("|")}return n},hasMarks(){return this.$helper.object.length(this.markButtons)>0},hasNodes(){return this.$helper.object.length(this.nodeButtons)>1},markButtons(){const t=this.editor.buttons("mark");if(!1===this.marks||0===this.$helper.object.length(t))return{};if(!0===this.marks)return t;const e={};for(const[i,n]of this.marks.entries())"|"===n?e["divider"+i]="|":t[n]&&(e[n]=t[n]);return e},nodeButtons(){const t=this.editor.buttons("node");if(!1===this.nodes||0===this.$helper.object.length(t))return{};if("block+"!==this.editor.nodes.doc.content&&t.paragraph&&delete t.paragraph,!0===this.nodes)return t;const e={};for(const i of this.nodes)t[i]&&(e[i]=t[i]);return e},positions(){return!1===this.inline?null:{top:this.position.y+"px",left:this.position.x+"px"}}},methods:{close(t){t&&!1!==this.$el.contains(t.relatedTarget)||(this.isOpen=!1)},command(t,...e){this.$emit("command",t,...e)},isNodeActive(t){if(!1===this.editor.activeNodes.includes(t.name))return!1;if("paragraph"===t.name)return!1===this.editor.activeNodes.includes("listItem")&&!1===this.editor.activeNodes.includes("quote");if(t.attrs){if(void 0===Object.values(this.editor.activeNodeAttrs).find((e=>JSON.stringify(e)===JSON.stringify(t.attrs))))return!1}return!0},open(){this.isOpen=!0,this.inline&&this.$nextTick(this.setPosition)},setPosition(){const t=this.$el.getBoundingClientRect(),e=this.editor.element.getBoundingClientRect(),i=document.querySelector(".k-panel-menu").getBoundingClientRect(),{from:n,to:s}=this.editor.selection,o=this.editor.view.coordsAtPos(n),l=this.editor.view.coordsAtPos(s,!0),a=new DOMRect(o.left,o.top,l.right-o.left,l.bottom-o.top);let r=a.x-e.x+a.width/2-t.width/2,u=a.y-e.y-t.height-5;if(t.widthe.width&&(r=e.width-t.width);else{const n=e.x+r,s=n+t.width,o=i.width+20,l=20;nwindow.innerWidth-l&&(r-=s-(window.innerWidth-l))}this.position={x:r,y:u}}}},(function(){var t=this,e=t._self._c;return t.isOpen||!t.inline?e("k-toolbar",{ref:"toolbar",staticClass:"k-writer-toolbar",style:t.positions,attrs:{buttons:t.buttons,"data-inline":t.inline,theme:t.inline?"dark":"light"}}):t._e()}),[],!1,null,null,null,null).exports,jo={install(t){t.component("k-writer-toolbar",Do),t.component("k-writer",qn)}},Eo={install(t){t.component("k-counter",Pe),t.component("k-autocomplete",qe),t.component("k-form",Ne),t.component("k-form-buttons",ze),t.component("k-field",Ye),t.component("k-fieldset",Re),t.component("k-input",He),t.component("k-upload",Ve),t.use(vi),t.use(io),t.use(Rs),t.use(so),t.use(So),t.use(Io),t.use(jo)}},Lo=()=>Y((()=>import("./IndexView.min.js")),__vite__mapDeps([0,1]),import.meta.url),To=()=>Y((()=>import("./DocsView.min.js")),__vite__mapDeps([2,3,1]),import.meta.url),Bo=()=>Y((()=>import("./PlaygroundView.min.js")),__vite__mapDeps([4,3,1]),import.meta.url),qo={install(t){t.component("k-lab-index-view",Lo),t.component("k-lab-docs-view",To),t.component("k-lab-playground-view",Bo)}};const Po=ut({props:{cover:Boolean,ratio:String},computed:{ratioPadding(){return this.$helper.ratio(this.ratio)}},mounted(){window.panel.deprecated(" will be removed in a future version. Use the instead.")}},(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;const No=ut({props:{align:{type:String,default:"start"}},mounted(){(this.$slots.left||this.$slots.center||this.$slots.right)&&window.panel.deprecated(": left/centre/right slots will be removed in a future version. Use with default slot only instead.")}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-bar",attrs:{"data-align":t.align}},[t.$slots.left||t.$slots.center||t.$slots.right?[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()]:t._t("default")],2)}),[],!1,null,null,null,null).exports;const zo=ut({props:{align:{type:String,default:"start"},button:Boolean,height:String,icon:String,theme:{type:String},text:String,html:{type:Boolean}},computed:{element(){return this.button?"button":"div"},type(){return this.button?"button":null}}},(function(){var t=this,e=t._self._c;return e(t.element,{tag:"component",staticClass:"k-box",style:t.height?{"--box-height":t.height}:null,attrs:{"data-align":t.align,"data-theme":t.theme,type:t.type}},[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),t._t("default",(function(){return[t.html?e("k-text",{attrs:{html:t.text}}):e("k-text",[t._v(" "+t._s(t.text)+" ")])]}),null,{html:t.html,text:t.text})],2)}),[],!1,null,null,null,null).exports;const Fo=ut({inheritAttrs:!1,props:{back:String,color:String,element:{type:String,default:"li"},html:{type:Boolean},image:Object,link:String,text:String},mounted(){this.back&&window.panel.deprecated(": `back` prop will be removed in a future version. Use the `--bubble-back` CSS property instead."),this.color&&window.panel.deprecated(": `color` prop will be removed in a future version. Use the `--bubble-text` CSS property instead.")}},(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,"data-has-text":Boolean(t.text)},nativeOn:{click:function(t){t.stopPropagation()}}},[t._t("image",(function(){var i;return[(null==(i=t.image)?void 0:i.src)?e("k-image-frame",t._b({},"k-image-frame",t.image,!1)):t.image?e("k-icon-frame",t._b({},"k-icon-frame",t.image,!1)):e("span")]})),t.text?[t.html?e("span",{staticClass:"k-bubble-text",domProps:{innerHTML:t._s(t.text)}}):e("span",{staticClass:"k-bubble-text"},[t._v(t._s(t.text))])]:t._e()],2)}),[],!1,null,null,null,null).exports;const Yo=ut({props:{width:{type:String,default:"1/1"},sticky:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column",style:{"--width":t.width},attrs:{"data-sticky":t.sticky}},[t.sticky?e("div",[t._t("default")],2):t._t("default")],2)}),[],!1,null,null,null,null).exports,Ro={props:{element:{type:String,default:"div"},fit:String,ratio:String,cover:Boolean,back:String,theme:String}};const Uo=ut({mixins:[Ro],inheritAttrs:!1,computed:{background(){return this.$helper.color(this.back)}}},(function(){var t=this;return(0,t._self._c)(t.element,{tag:"component",staticClass:"k-frame",style:{"--fit":t.fit??(t.cover?"cover":"contain"),"--ratio":t.ratio,"--back":t.background},attrs:{"data-theme":t.theme}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Ho=ut({mixins:[{mixins:[Ro],props:{color:String}}],inheritAttrs:!1},(function(){var t=this;return(0,t._self._c)("k-frame",t._b({staticClass:"k-color-frame",style:{"--color-frame-back":t.color}},"k-frame",t.$props,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Vo=ut({props:{disabled:{type:Boolean}},emits:["drop"],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;const Ko=ut({props:{gutter:String,variant:String},mounted(){this.gutter&&window.panel.deprecated(': the `gutter` prop will be removed in a future version. Use `style="gap: "` or `variant` prop instead.')}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-grid",attrs:{"data-gutter":t.gutter,"data-variant":t.variant}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Wo=ut({props:{editable:{type:Boolean},tabs:Array},emits:["edit"],mounted(){this.tabs&&window.panel.deprecated(": `tabs` prop isn't supported anymore and has no effect. Use `` as standalone component instead."),(this.$slots.left||this.$slots.right)&&window.panel.deprecated(": left/right slots will be removed in a future version. Use `buttons` slot instead.")}},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-header",attrs:{"data-has-buttons":Boolean(t.$slots.buttons||t.$slots.left||t.$slots.right)}},[e("h1",{staticClass:"k-header-title"},[t.editable?e("button",{staticClass:"k-header-title-button",attrs:{type:"button"},on:{click:function(e){return t.$emit("edit")}}},[e("span",{staticClass:"k-header-title-text"},[t._t("default")],2),e("span",{staticClass:"k-header-title-icon"},[e("k-icon",{attrs:{type:"edit"}})],1)]):e("span",{staticClass:"k-header-title-text"},[t._t("default")],2)]),t.$slots.buttons||t.$slots.left||t.$slots.right?e("div",{staticClass:"k-header-buttons"},[t._t("buttons"),t._t("left"),t._t("right")],2):t._e()])}),[],!1,null,null,null,null).exports,Jo={props:{alt:String,color:String,type:String}};const Go=ut({mixins:[Jo],computed:{isEmoji(){return this.$helper.string.hasEmoji(this.type)}}},(function(){var t=this,e=t._self._c;return t.isEmoji?e("span",{attrs:{"data-type":"emoji"}},[t._v(t._s(t.type))]):e("svg",{staticClass:"k-icon",style:{color:t.$helper.color(t.color)},attrs:{"aria-label":t.alt,role:t.alt?"img":null,"aria-hidden":!t.alt,"data-type":t.type}},[e("use",{attrs:{"xlink:href":"#icon-"+t.type}})])}),[],!1,null,null,null,null).exports;const Xo=ut({mixins:[{mixins:[Ro,Jo],props:{type:null,icon:String}}],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-frame",t._b({staticClass:"k-icon-frame",attrs:{element:"figure"}},"k-frame",t.$props,!1),[e("k-icon",t._b({},"k-icon",{color:t.color,type:t.icon,alt:t.alt},!1))],1)}),[],!1,null,null,null,null).exports;const Zo=ut({mixins:[{mixins:[Ro],props:{alt:String,sizes:String,src:String,srcset:String}}],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-frame",t._g(t._b({staticClass:"k-image-frame k-image",attrs:{element:"figure"}},"k-frame",t.$props,!1),t.$listeners),[t.src?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()])}),[],!1,null,null,null,null).exports;const Qo=ut({mixins:[{props:{autofocus:{default:!0,type:Boolean},nested:{default:!1,type:Boolean},type:{default:"overlay",type:String},visible:{default:!1,type:Boolean}}}],inheritAttrs:!0,emits:["cancel","close","open"],watch:{visible(t,e){t!==e&&this.toggle()}},mounted(){this.toggle()},methods:{cancel(){this.$emit("cancel"),this.close()},close(){if(!1!==this.$refs.overlay.open)return this.nested?this.onClose():void this.$refs.overlay.close()},focus(){this.$helper.focus(this.$refs.overlay)},onCancel(t){this.nested&&(t.preventDefault(),this.cancel())},onClick(t){t.target.matches(".k-portal")&&this.cancel()},onClose(){this.$emit("close")},open(){!0!==this.$refs.overlay.open&&this.$refs.overlay.showModal(),setTimeout((()=>{!0===this.autofocus&&this.focus(),this.$emit("open")}))},toggle(){!0===this.visible?this.open():this.close()}}},(function(){var t=this;return(0,t._self._c)("dialog",{ref:"overlay",staticClass:"k-overlay",attrs:{"data-type":t.type},on:{cancel:t.onCancel,mousedown:t.onClick,touchdown:t.onClick,close:t.onClose}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const tl=ut({props:{label:String,value:String,icon:String,info:String,theme:String,link:String,click:Function,dialog:{type:[String,Object]}},computed:{component(){return null!==this.target?"k-link":"div"},target(){return this.link?this.link:this.click?this.click:this.dialog?()=>this.$dialog(this.dialog):null}}},(function(){var t=this,e=t._self._c;return e(t.component,{tag:"component",staticClass:"k-stat",attrs:{"data-theme":t.theme,to:t.target}},[t.label?e("dt",{staticClass:"k-stat-label"},[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),t._v(" "+t._s(t.label)+" ")],1):t._e(),t.value?e("dd",{staticClass:"k-stat-value"},[t._v(t._s(t.value))]):t._e(),t.info?e("dd",{staticClass:"k-stat-info"},[t._v(t._s(t.info))]):t._e()])}),[],!1,null,null,null,null).exports;const el=ut({props:{reports:{type:Array,default:()=>[]},size:{type:String,default:"large"}},methods:{component(t){return null!==this.target(t)?"k-link":"div"},target(t){return t.link?t.link:t.click?t.click:t.dialog?()=>this.$dialog(t.dialog):null}}},(function(){var t=this,e=t._self._c;return e("dl",{staticClass:"k-stats",attrs:{"data-size":t.size}},t._l(t.reports,(function(i,n){return e("k-stat",t._b({key:n},"k-stat",i,!1))})),1)}),[],!1,null,null,null,null).exports;const il=ut({inheritAttrs:!1,props:{columns:{type:Object,default:()=>({})},disabled:Boolean,fields:{type:Object,default:()=>({})},empty:String,index:{type:[Number,Boolean],default:1},rows:Array,options:{default:()=>[],type:[Array,Function]},pagination:[Object,Boolean],sortable:Boolean},emits:["cell","change","header","input","option","paginate","sort"],data(){return{values:this.rows}},computed:{colspan(){let t=this.columnsCount;return this.hasIndexColumn&&t++,this.hasOptions&&t++,t},columnsCount(){return this.$helper.object.length(this.columns)},dragOptions(){return{disabled:!this.sortable,draggable:".k-table-sortable-row",fallbackClass:"k-table-row-fallback",ghostClass:"k-table-row-ghost"}},hasIndexColumn(){return this.sortable||!1!==this.index},hasOptions(){var t;return this.$scopedSlots.options||(null==(t=this.options)?void 0:t.length)>0||Object.values(this.values).filter((t=>null==t?void 0: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:i}){this.values[e][t]=i,this.$emit("input",this.values)},onHeader(t){this.$emit("header",t)},onOption(t,e,i){this.$emit("option",t,e,i)},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("div",{staticClass:"k-table",attrs:{"aria-disabled":t.disabled}},[e("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":"true"}},[t._v(" # ")]):t._e(),t._l(t.columns,(function(i,n){return e("th",{key:n+"-header",staticClass:"k-table-column",style:{width:t.width(i.width)},attrs:{"data-align":i.align,"data-column-id":n,"data-mobile":i.mobile},on:{click:function(e){return t.onHeader({column:i,columnIndex:n})}}},[t._t("header",(function(){return[t._v(" "+t._s(t.label(i,n))+" ")]}),null,{column:i,columnIndex:n,label:t.label(i,n)})],2)})),t.hasOptions?e("th",{staticClass:"k-table-options-column",attrs:{"data-mobile":"true"}}):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.colspan}},[t._v(" "+t._s(t.empty)+" ")])]):t._l(t.values,(function(i,n){return e("tr",{key:n,class:{"k-table-sortable-row":t.sortable&&!1!==i.sortable}},[t.hasIndexColumn?e("td",{staticClass:"k-table-index-column",attrs:{"data-mobile":"true"}},[t._t("index",(function(){return[e("div",{staticClass:"k-table-index",domProps:{textContent:t._s(t.index+n)}})]}),null,{row:i,rowIndex:n}),t.sortable&&!1!==i.sortable?e("k-sort-handle",{staticClass:"k-table-sort-handle"}):t._e()],2):t._e(),t._l(t.columns,(function(s,o){return e("k-table-cell",{key:n+"-"+o,staticClass:"k-table-column",style:{width:t.width(s.width)},attrs:{id:o,column:s,field:t.fields[o],row:i,mobile:s.mobile,value:i[o]},on:{input:function(e){return t.onCellUpdate({columnIndex:o,rowIndex:n,value:e})}},nativeOn:{click:function(e){return t.onCell({row:i,rowIndex:n,column:s,columnIndex:o})}}})})),t.hasOptions?e("td",{staticClass:"k-table-options-column",attrs:{"data-mobile":"true"}},[t._t("options",(function(){return[e("k-options-dropdown",{attrs:{options:i.options??t.options,text:(i.options??t.options).length>1},on:{option:function(e){return t.onOption(e,i,n)}}})]}),null,{row:i,rowIndex:n})],2):t._e()],2)}))],2)],1),t.pagination?e("k-pagination",t._b({staticClass:"k-table-pagination",on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.pagination,!1)):t._e()],1)}),[],!1,null,null,null,null).exports;const nl=ut({inheritAttrs:!1,props:{column:Object,field:Object,id:String,mobile:{type:Boolean,default:!1},row:Object,value:{default:""}},emits:["input"],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":"object"==typeof this.value?"k-object-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",{staticClass:"k-table-cell",attrs:{"data-align":t.column.align,"data-column-id":t.id,"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()],1)}),[],!1,null,null,null,null).exports;const sl=ut({props:{tab:String,tabs:{type:Array,default:()=>[]},theme:{type:String,default:"passive"}},data(){return{observer:null,visible:this.tabs,invisible:[]}},computed:{buttons(){return this.visible.map(this.button)},current(){const t=this.tabs.find((t=>t.name===this.tab))??this.tabs[0];return null==t?void 0:t.name},dropdown(){return this.invisible.map(this.button)}},watch:{tabs:{async handler(){var t;null==(t=this.observer)||t.disconnect(),await this.$nextTick(),this.$el instanceof Element&&(this.observer=new ResizeObserver(this.resize),this.observer.observe(this.$el))},immediate:!0}},destroyed(){var t;null==(t=this.observer)||t.disconnect()},methods:{button(t){return{...t,current:t.name===this.current,title:t.label,text:t.label??t.text??t.name}},async resize(){const t=this.$el.offsetWidth;this.visible=this.tabs,this.invisible=[],await this.$nextTick();const e=[...this.$refs.visible].map((t=>t.$el.offsetWidth));let i=32;for(let n=0;nt)return this.visible=this.tabs.slice(0,n),void(this.invisible=this.tabs.slice(n))}}},(function(){var t=this,e=t._self._c;return t.tabs.length>1?e("nav",{staticClass:"k-tabs"},[t._l(t.buttons,(function(i){return e("div",{key:i.name,staticClass:"k-tabs-tab"},[e("k-button",t._b({ref:"visible",refInFor:!0,staticClass:"k-tab-button",attrs:{variant:"dimmed"}},"k-button",i,!1),[t._v(" "+t._s(i.text)+" ")]),i.badge?e("span",{staticClass:"k-tabs-badge",attrs:{"data-theme":t.theme}},[t._v(" "+t._s(i.badge)+" ")]):t._e()],1)})),t.invisible.length?[e("k-button",{staticClass:"k-tab-button k-tabs-dropdown-button",attrs:{current:!!t.invisible.find((e=>t.tab===e.name)),title:t.$t("more"),icon:"dots",variant:"dimmed"},on:{click:function(e){return e.stopPropagation(),t.$refs.more.toggle()}}}),e("k-dropdown-content",{ref:"more",staticClass:"k-tabs-dropdown",attrs:{options:t.dropdown,"align-x":"end"}})]:t._e()],2):t._e()}),[],!1,null,null,null,null).exports;const ol=ut({props:{align:String},mounted(){window.panel.deprecated(" will be removed in a future version.")}},(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,ll={install(t){t.component("k-aspect-ratio",Po),t.component("k-bar",No),t.component("k-box",zo),t.component("k-bubble",Fo),t.component("k-bubbles",ao),t.component("k-color-frame",Ho),t.component("k-column",Yo),t.component("k-dropzone",Vo),t.component("k-frame",Uo),t.component("k-grid",Ko),t.component("k-header",Wo),t.component("k-icon-frame",Xo),t.component("k-image-frame",Zo),t.component("k-image",Zo),t.component("k-overlay",Qo),t.component("k-stat",tl),t.component("k-stats",el),t.component("k-table",il),t.component("k-table-cell",nl),t.component("k-tabs",sl),t.component("k-view",ol)}};const al=ut({components:{draggable:()=>Y((()=>import("./vuedraggable.min.js")),[],import.meta.url)},props:{data:Object,element:{type:String,default:"div"},handle:[String,Boolean],list:[Array,Object],move:Function,options:Object},emits:["change","end","sort","start"],computed:{dragOptions(){let t=this.handle;return!0===t&&(t=".k-sort-handle"),{fallbackClass:"k-sortable-fallback",fallbackOnBody:!0,forceFallback:!0,ghostClass:"k-sortable-ghost",handle:t,scroll:document.querySelector(".k-panel-main"),...this.options}}},methods:{onStart(t){this.$panel.drag.start("data",{}),this.$emit("start",t)},onEnd(t){this.$panel.drag.stop(),this.$emit("end",t)}}},(function(){var t=this;return(0,t._self._c)("draggable",t._b({staticClass:"k-draggable",attrs:{"component-data":t.data,tag:t.element,list:t.list,move:t.move},on:{change:function(e){return t.$emit("change",e)},end:t.onEnd,sort:function(e){return t.$emit("sort",e)},start:t.onStart},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("footer")]},proxy:!0}],null,!0)},"draggable",t.dragOptions,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const rl=ut({data:()=>({error:null}),errorCaptured(t){return this.$panel.debug&&window.console.warn(t),this.error=t,!1},render(){return this.error?this.$slots.error?this.$slots.error[0]:this.$scopedSlots.error?this.$scopedSlots.error({error:this.error}):Vue.h("k-box",{attrs:{theme:"negative"}},this.error.message??this.error):this.$slots.default[0]}},null,null,!1,null,null,null,null).exports;const ul=ut({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("k-overlay",{staticClass:"k-fatal",attrs:{visible:!0}},[e("div",{staticClass:"k-fatal-box"},[e("div",{staticClass:"k-notification",attrs:{"data-theme":"negative"}},[e("p",[t._v("The JSON response could not be parsed")]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return e.stopPropagation(),t.$panel.notification.close()}}})],1),e("iframe",{ref:"iframe",staticClass:"k-fatal-iframe"})])])}),[],!1,null,null,null,null).exports;const cl=ut({icons:window.panel.plugins.icons,methods:{viewbox(t,e){const i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.innerHTML=e,document.body.appendChild(i);const n=i.getBBox(),s=(n.width+2*n.x+(n.height+2*n.y))/2,o=Math.abs(s-16),l=Math.abs(s-24);return document.body.removeChild(i),o element with the corresponding viewBox attribute.`),"0 0 16 16"):"0 0 24 24"}}},(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(i,n){return e("symbol",{key:n,attrs:{id:"icon-"+n,viewBox:t.viewbox(n,i)},domProps:{innerHTML:t._s(i)}})})),0)])}),[],!1,null,null,null,null).exports;const dl=ut({mounted(){window.panel.deprecated(' will be removed in a future version. Use instead.')}},(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;const pl=ut({},(function(){var t=this,e=t._self._c;return t.$panel.notification.isOpen?e("div",{staticClass:"k-notification",attrs:{"data-theme":t.$panel.notification.theme}},[e("p",[t._v(t._s(t.$panel.notification.message))]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return t.$panel.notification.close()}}})],1):t._e()}),[],!1,null,null,null,null).exports;const hl=ut({},(function(){var t=this,e=t._self._c;return t.$panel.isOffline?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,ml=(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};const fl=ut({props:{value:{type:Number,default:0,validator:ml}},data(){return{state:this.value}},watch:{value(t){this.state=t}},methods:{set(t){window.panel.deprecated(": `set` method will be removed in a future version. Use the `value` prop instead."),ml(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;const gl=ut({},(function(){return(0,this._self._c)("k-button",{staticClass:"k-sort-handle k-sort-button",attrs:{title:this.$t("sort.drag"),icon:"sort","aria-hidden":"true"}})}),[],!1,null,null,null,null).exports,kl={install(t){t.component("k-draggable",al),t.component("k-error-boundary",rl),t.component("k-fatal",ul),t.component("k-icon",Go),t.component("k-icons",cl),t.component("k-loader",dl),t.component("k-notification",pl),t.component("k-offline-warning",hl),t.component("k-progress",fl),t.component("k-sort-handle",gl)}};const bl=ut({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(){const t=[];return this.view&&t.push({link:this.view.link,label:this.view.label??this.view.breadcrumbLabel,icon:this.view.icon,loading:this.$panel.isLoading}),[...t,...this.crumbs]}},mounted(){this.view&&window.panel.deprecated(": `view` prop will be removed in a future version. Use `crumbs` instead.")}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-breadcrumb",attrs:{"aria-label":t.label}},[t.segments.length>1?e("div",{staticClass:"k-breadcrumb-dropdown"},[e("k-button",{attrs:{icon:"home"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.dropdown}})],1):t._e(),e("ol",t._l(t.segments,(function(i,n){return e("li",{key:n},[e("k-button",{staticClass:"k-breadcrumb-link",attrs:{icon:i.loading?"loader":i.icon,link:i.link,disabled:!i.link,text:i.text??i.label,title:i.text??i.label,current:n===t.segments.length-1&&"page",variant:"dimmed",size:"sm"}})],1)})),0)])}),[],!1,null,null,null,null).exports;const vl=ut({props:{items:{type:Array},name:{default:"items",type:String},selected:{type:String},type:{default:"radio",type:String}},emits:["select"]},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-browser"},[e("div",{staticClass:"k-browser-items"},t._l(t.items,(function(i){return e("label",{key:i.value,staticClass:"k-browser-item",attrs:{"aria-selected":t.selected===i.value}},[e("input",{attrs:{name:t.name,type:t.type},domProps:{checked:t.selected===i.value},on:{change:function(e){return t.$emit("select",i)}}}),i.image?e("k-item-image",{staticClass:"k-browser-item-image",attrs:{image:{...i.image,cover:!0,back:"black"}}}):t._e(),e("span",{staticClass:"k-browser-item-info"},[t._v(" "+t._s(i.label)+" ")])],1)})),0)])}),[],!1,null,null,null,null).exports,yl={props:{disabled:Boolean,download:Boolean,rel:String,tabindex:[String,Number],target:String,title:String}};const $l=ut({mixins:[yl],props:{to:[String,Function]},emits:["click"],computed:{href(){return"function"==typeof this.to?"":"/"!==this.to[0]||this.target?!0===this.to.includes("@")&&!1===this.to.includes("/")&&!1===this.to.startsWith("mailto:")?"mailto:"+this.to:this.to:this.$url(this.to)},relAttr(){return"_blank"===this.target?"noreferrer noopener":this.rel}},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",{ref:"link",staticClass:"k-link",attrs:{download:t.download,href:t.href,rel:t.relAttr,tabindex:t.tabindex,target:t.target,title:t.title},on:{click:t.onClick}},[t._t("default")],2):e("span",{staticClass:"k-link",attrs:{title:t.title,"aria-disabled":""}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const wl=ut({mixins:[{mixins:[yl],props:{autofocus:Boolean,click:{type:Function,default:()=>{}},current:[String,Boolean],dialog:String,drawer:String,dropdown:Boolean,element:String,icon:String,id:[String,Number],link:String,responsive:[Boolean,String],role:String,selected:[String,Boolean],size:String,text:[String,Number],theme:String,tooltip:String,type:{type:String,default:"button"},variant:String}}],inheritAttrs:!1,emits:["click"],computed:{attrs(){const t={"aria-current":this.current,"aria-disabled":this.disabled,"aria-label":this.text??this.title,"aria-selected":this.selected,"data-responsive":this.responsive,"data-size":this.size,"data-theme":this.theme,"data-variant":this.variant,id:this.id,tabindex:this.tabindex,title:this.title??this.tooltip};return"k-link"===this.component?(t.disabled=this.disabled,t.download=this.download,t.to=this.link,t.rel=this.rel,t.target=this.target):"button"===this.component&&(t.autofocus=this.autofocus,t.role=this.role,t.type=this.type),this.dropdown&&(t["aria-haspopup"]="menu",t["data-dropdown"]=this.dropdown),t},component(){return this.element?this.element:this.link?"k-link":"button"}},mounted(){this.tooltip&&window.panel.deprecated(": the `tooltip` prop will be removed in a future version. Use the `title` prop instead.")},methods:{focus(){var t,e;null==(e=(t=this.$el).focus)||e.call(t)},onClick(t){var e;return this.disabled?(t.preventDefault(),!1):this.dialog?this.$dialog(this.dialog):this.drawer?this.$drawer(this.drawer):(null==(e=this.click)||e.call(this,t),void this.$emit("click",t))}}},(function(){var t=this,e=t._self._c;return e(t.component,t._b({tag:"component",staticClass:"k-button",attrs:{"data-has-icon":Boolean(t.icon),"data-has-text":Boolean(t.text||t.$slots.default)},on:{click:t.onClick}},"component",t.attrs,!1),[t.icon?e("span",{staticClass:"k-button-icon"},[e("k-icon",{attrs:{type:t.icon}})],1):t._e(),t.text||t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default",(function(){return[t._v(" "+t._s(t.text)+" ")]}))],2):t._e(),t.dropdown&&(t.text||t.$slots.default)?e("span",{staticClass:"k-button-arrow"},[e("k-icon",{attrs:{type:"angle-down"}})],1):t._e()])}),[],!1,null,null,null,null).exports;const xl=ut({props:{buttons:Array,layout:String,variant:String,theme:String,size:String,responsive:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-button-group",attrs:{"data-layout":t.layout}},[t.$slots.default?t._t("default"):t._l(t.buttons,(function(i,n){return e("k-button",t._b({key:n},"k-button",{variant:t.variant,theme:t.theme,size:t.size,responsive:t.responsive,...i},!1))}))],2)}),[],!1,null,null,null,null).exports;const _l=ut({props:{limit:{default:50,type:Number},opened:{type:String},selected:{type:String}},emits:["select"],data(){return{files:[],page:null,pagination:null,view:this.opened?"files":"tree"}},methods:{paginate(t){this.selectPage(this.page,t.page)},selectFile(t){this.$emit("select",t)},async selectPage(t,e=1){this.page=t;const i="/"===t.id?"/site/files":"/pages/"+this.$api.pages.id(t.id)+"/files",{data:n,pagination:s}=await this.$api.get(i,{select:"filename,id,panelImage,url,uuid",limit:this.limit,page:e});this.pagination=s,this.files=n.map((t=>({label:t.filename,image:t.panelImage,id:t.id,url:t.url,uuid:t.uuid,value:t.uuid??t.url}))),this.view="files"},async togglePage(){await this.$nextTick(),this.$refs.tree.scrollIntoView({behaviour:"smooth",block:"nearest",inline:"nearest"})}}},(function(){var t,e,i=this,n=i._self._c;return n("div",{staticClass:"k-file-browser",attrs:{"data-view":i.view}},[n("div",{staticClass:"k-file-browser-layout"},[n("aside",{ref:"tree",staticClass:"k-file-browser-tree"},[n("k-page-tree",{attrs:{current:(null==(t=i.page)?void 0:t.value)??i.opened},on:{select:i.selectPage,toggleBranch:i.togglePage}})],1),n("div",{ref:"items",staticClass:"k-file-browser-items"},[n("k-button",{staticClass:"k-file-browser-back-button",attrs:{icon:"angle-left",text:null==(e=i.page)?void 0:e.label},on:{click:function(t){i.view="tree"}}}),i.files.length?n("k-browser",{attrs:{items:i.files,selected:i.selected},on:{select:i.selectFile}}):i._e()],1),n("div",{staticClass:"k-file-browser-pagination",on:{click:function(t){t.stopPropagation()}}},[i.pagination?n("k-pagination",i._b({attrs:{details:!0},on:{paginate:i.paginate}},"k-pagination",i.pagination,!1)):i._e()],1)])])}),[],!1,null,null,null,null).exports;const Cl=ut({props:{tab:String,tabs:{type:Array,default:()=>[]}},computed:{withBadges(){const t=Object.keys(this.$store.getters["content/changes"]());return this.tabs.map((e=>{const i=[];for(const t in e.columns)for(const n in e.columns[t].sections)if("fields"===e.columns[t].sections[n].type)for(const s in e.columns[t].sections[n].fields)i.push(s);return e.badge=i.filter((e=>t.includes(e.toLowerCase()))).length,e}))}}},(function(){var t=this;return(0,t._self._c)("k-tabs",{staticClass:"k-model-tabs",attrs:{tab:t.tab,tabs:t.withBadges,theme:"notice"}})}),[],!1,null,null,null,null).exports;const Sl=ut({props:{axis:String,disabled:Boolean,element:{type:String,default:"div"},select:{type:String,default:":where(button, a):not(:disabled)"}},emits:["next","prev"],computed:{keys(){switch(this.axis){case"x":return{ArrowLeft:this.prev,ArrowRight:this.next};case"y":return{ArrowUp:this.prev,ArrowDown:this.next};default:return{ArrowLeft:this.prev,ArrowRight:this.next,ArrowUp:this.prev,ArrowDown:this.next}}}},mounted(){this.$el.addEventListener("keydown",this.keydown)},destroyed(){this.$el.removeEventListener("keydown",this.keydown)},methods:{focus(t=0,e){this.move(t,e)},keydown(t){var e;if(this.disabled)return!1;null==(e=this.keys[t.key])||e.apply(this,[t])},move(t=0,e){var i;const n=[...this.$el.querySelectorAll(this.select)];let s=n.findIndex((t=>t===document.activeElement||t.contains(document.activeElement)));switch(-1===s&&(s=0),t){case"first":t=0;break;case"next":t=s+1;break;case"last":t=n.length-1;break;case"prev":t=s-1}t<0?this.$emit("prev"):t>=n.length?this.$emit("next"):null==(i=n[t])||i.focus(),null==e||e.preventDefault()},next(t){this.move("next",t)},prev(t){this.move("prev",t)}}},(function(){var t=this;return(0,t._self._c)(t.element,{tag:"component",staticClass:"k-navigate"},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Ol=ut({name:"k-tree",inheritAttrs:!1,props:{element:{type:String,default:"k-tree"},current:{type:String},items:{type:[Array,Object]},level:{default:0,type:Number}},emits:["close","open","select","toggle"],data(){return{state:this.items}},methods:{arrow:t=>!0===t.loading?"loader":t.open?"angle-down":"angle-right",close(t){this.$set(t,"open",!1),this.$emit("close",t)},isItem:(t,e)=>t.value===e,open(t){this.$set(t,"open",!0),this.$emit("open",t)},select(t){this.$emit("select",t)},toggle(t){this.$emit("toggle",t),!0===t.open?this.close(t):this.open(t)}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-tree",class:t.$options.name,style:{"--tree-level":t.level}},t._l(t.state,(function(i){return e("li",{key:i.value,attrs:{"aria-expanded":i.open,"aria-current":t.isItem(i,t.current)}},[e("p",{staticClass:"k-tree-branch",attrs:{"data-has-subtree":i.hasChildren&&i.open}},[e("button",{staticClass:"k-tree-toggle",attrs:{disabled:!i.hasChildren,type:"button"},on:{click:function(e){return t.toggle(i)}}},[e("k-icon",{attrs:{type:t.arrow(i)}})],1),e("button",{staticClass:"k-tree-folder",attrs:{disabled:i.disabled,type:"button"},on:{click:function(e){return t.select(i)},dblclick:function(e){return t.toggle(i)}}},[e("k-icon-frame",{attrs:{icon:i.icon??"folder"}}),e("span",{staticClass:"k-tree-folder-label"},[t._v(t._s(i.label))])],1)]),i.hasChildren&&i.open?[e(t.$options.name,t._b({ref:i.value,refInFor:!0,tag:"component",attrs:{items:i.children,level:t.level+1},on:{close:function(e){return t.$emit("close",e)},open:function(e){return t.$emit("open",e)},select:function(e){return t.$emit("select",e)},toggle:function(e){return t.$emit("toggle",e)}}},"component",t.$props,!1))]:t._e()],2)})),0)}),[],!1,null,null,null,null).exports;const Ml=ut({name:"k-page-tree",extends:Ol,inheritAttrs:!1,props:{current:{type:String},move:{type:String},root:{default:!0,type:Boolean}},data:()=>({state:[]}),async mounted(){if(this.items)this.state=this.items;else{const t=await this.load(null);await this.open(t[0]),this.state=this.root?t:t[0].children,this.current&&this.preselect(this.current)}},methods:{findItem(t){return this.state.find((e=>this.isItem(e,t)))},isItem:(t,e)=>t.value===e||t.uuid===e||t.id===e,async load(t){return await this.$panel.get("site/tree",{query:{move:this.move??null,parent:t}})},async open(t){if(!1===t.hasChildren)return!1;this.$set(t,"loading",!0),"string"==typeof t.children&&(t.children=await this.load(t.children)),this.$set(t,"open",!0),this.$set(t,"loading",!1)},async preselect(t){const e=(await this.$panel.get("site/tree/parents",{query:{page:t}})).data;this.root&&e.unshift("site://");let i=this;for(let s=0;sPromise.resolve()}},emits:["paginate"],computed:{detailsText(){return 1===this.limit?this.start:this.start+"-"+this.end},end(){return Math.min(this.start-1+this.limit,this.total)},offset(){return this.start-1},pages(){return Math.ceil(this.total/this.limit)},start(){return(this.page-1)*this.limit+1}},methods:{async goTo(t){var e;try{await this.validate(t),null==(e=this.$refs.dropdown)||e.close();const i=((t=Math.max(1,Math.min(t,this.pages)))-1)*this.limit+1;this.$emit("paginate",{page:t,start:i,end:Math.min(i-1+this.limit,this.total),limit:this.limit,offset:i-1,total:this.total})}catch{}},prev(){this.goTo(this.page-1)},next(){this.goTo(this.page+1)}}},(function(){var t=this,e=t._self._c;return t.pages>1?e("k-button-group",{staticClass:"k-pagination",attrs:{layout:"collapsed"},nativeOn:{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.prev.apply(null,arguments)},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.next.apply(null,arguments)}]}},[e("k-button",{staticClass:"k-pagination-button",attrs:{disabled:t.start<=1,title:t.$t("prev"),icon:"angle-left",size:"xs",variant:"filled"},on:{click:t.prev}}),t.details?[e("k-button",{staticClass:"k-pagination-details",attrs:{disabled:t.total<=t.limit,text:t.total>1?`${t.detailsText} / ${t.total}`:t.total,size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",staticClass:"k-pagination-selector",attrs:{"align-x":"end"},nativeOn:{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:void e.stopPropagation()},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:void e.stopPropagation()}]}},[e("form",{attrs:{method:"dialog"},on:{click:function(t){t.stopPropagation()},submit:function(e){return t.goTo(t.$refs.page.value)}}},[e("label",[t._v(" "+t._s(t.$t("pagination.page"))+": "),e("select",{ref:"page",attrs:{autofocus:!0}},t._l(t.pages,(function(i){return e("option",{key:i,domProps:{selected:t.page===i,value:i}},[t._v(" "+t._s(i)+" ")])})),0)]),e("k-button",{attrs:{type:"submit",icon:"check"}})],1)])]:t._e(),e("k-button",{staticClass:"k-pagination-button",attrs:{disabled:t.end>=t.total,title:t.$t("next"),icon:"angle-right",size:"xs",variant:"filled"},on:{click:t.next}})],2):t._e()}),[],!1,null,null,null,null).exports;const Il=ut({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"}]},isFullyDisabled(){return 0===this.buttons.filter((t=>!t.disabled)).length}},methods:{button:t=>t||{disabled:!0,link:"#"}}},(function(){var t=this,e=t._self._c;return t.isFullyDisabled?t._e():e("k-button-group",{staticClass:"k-prev-next",attrs:{buttons:t.buttons,layout:"collapsed",size:"xs"}})}),[],!1,null,null,null,null).exports;const Dl=ut({mixins:[zt],props:{defaultType:String,isLoading:Boolean,pagination:{type:Object,default:()=>({})},results:Array,types:{type:Object,default:()=>({})}},emits:["close","more","navigate","search"],data(){return{selected:-1,type:this.types[this.defaultType]?this.defaultType:Object.keys(this.types)[0]}},computed:{typesDropdown(){return Object.values(this.types).map((t=>({...t,current:this.type===t.id,click:()=>{this.type=t.id,this.focus()}})))}},watch:{type(){this.search()}},methods:{focus(){var t;null==(t=this.$refs.input)||t.focus()},onDown(){this.select(Math.min(this.selected+1,this.results.length-1))},onEnter(){this.$emit("navigate",this.results[this.selected]??this.results[0])},onUp(){this.select(Math.max(this.selected-1,-1))},async search(){var t,e;null==(t=this.$refs.types)||t.close(),null==(e=this.select)||e.call(this,-1),this.$emit("search",{type:this.type,query:this.query})},select(t){var e;this.selected=t;const i=(null==(e=this.$refs.results)?void 0:e.$el.querySelectorAll(".k-item"))??[];for(const n of i)delete n.dataset.selected;t>=0&&(i[t].dataset.selected=!0)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-search-bar"},[e("div",{staticClass:"k-search-bar-input"},[t.typesDropdown.length>1?[e("k-button",{staticClass:"k-search-bar-types",attrs:{dropdown:!0,icon:t.types[t.type].icon,text:t.types[t.type].label,variant:"dimmed"},on:{click:function(e){return t.$refs.types.toggle()}}}),e("k-dropdown-content",{ref:"types",attrs:{options:t.typesDropdown}})]:t._e(),e("k-search-input",{ref:"input",attrs:{"aria-label":t.$t("search"),autofocus:!0,value:t.query},on:{input:function(e){t.query=e}},nativeOn:{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,"enter",13,e.key,"Enter")?null:t.onEnter.apply(null,arguments)}]}}),e("k-button",{staticClass:"k-search-bar-close",attrs:{icon:t.isLoading?"loader":"cancel",title:t.$t("close")},on:{click:function(e){return t.$emit("close")}}})],2),t.results?e("div",{staticClass:"k-search-bar-results"},[t.results.length?e("k-collection",{ref:"results",attrs:{items:t.results},nativeOn:{mouseout:function(e){return t.select(-1)}}}):t._e(),e("footer",{staticClass:"k-search-bar-footer"},[0===t.results.length?e("p",[t._v(" "+t._s(t.$t("search.results.none"))+" ")]):t._e(),t.results.length will be removed in a future version. Use instead.')}},(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;const Ll=ut({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},mounted(){window.panel.deprecated(' will be removed in a future version. Use instead.')},methods:{focus(){this.$el.focus()}}},(function(){var t=this,e=t._self._c;return e("k-link",{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.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;const Tl=ut({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"}},mounted(){window.panel.deprecated(" will be removed in a future version. Use instead.")}},(function(){var t=this,e=t._self._c;return e("button",{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.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,Bl={install(t){t.component("k-breadcrumb",bl),t.component("k-browser",vl),t.component("k-button",wl),t.component("k-button-group",xl),t.component("k-file-browser",_l),t.component("k-link",$l),t.component("k-model-tabs",Cl),t.component("k-navigate",Sl),t.component("k-page-tree",Ml),t.component("k-pagination",Al),t.component("k-prev-next",Il),t.component("k-search-bar",Dl),t.component("k-tag",jl),t.component("k-tags",Hn),t.component("k-tree",Ol),t.component("k-button-disabled",El),t.component("k-button-link",Ll),t.component("k-button-native",Tl)}};const ql=ut({props:{buttons:Array,headline:String,invalid:Boolean,label:String,link:String,required:Boolean}},(function(){var t=this,e=t._self._c;return e("section",{staticClass:"k-section",attrs:{"data-invalid":t.invalid}},[t.label||t.headline||t.buttons||t.$slots.options?e("header",{staticClass:"k-section-header"},[e("k-label",{attrs:{invalid:t.invalid,link:t.link,required:t.required,title:t.label??t.headline,type:"section"}},[t._v(" "+t._s(t.label??t.headline)+" ")]),t._t("options",(function(){return[t.buttons?e("k-button-group",{staticClass:"k-section-buttons",attrs:{buttons:t.buttons,size:"xs",variant:"filled"}}):t._e()]}))],2):t._e(),t._t("default")],2)}),[],!1,null,null,null,null).exports;const Pl=ut({props:{empty:String,blueprint:String,lock:[Boolean,Object],parent:String,tab:Object},emits:["submit"],computed:{content(){return this.$store.getters["content/values"]()}},methods:{exists(t){return this.$helper.isComponent(`k-${t}-section`)}}},(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:{variant:"columns"}},t._l(t.tab.columns,(function(i,n){return e("k-column",{key:t.parent+"-column-"+n,attrs:{width:i.width,sticky:i.sticky}},[t._l(i.sections,(function(s,o){return[t.$helper.field.isVisible(s,t.content)?[t.exists(s.type)?e("k-"+s.type+"-section",t._b({key:t.parent+"-column-"+n+"-section-"+o+"-"+t.blueprint,tag:"component",class:"k-section-name-"+s.name,attrs:{column:i.width,lock:t.lock,name:s.name,parent:t.parent,timestamp:t.$panel.view.timestamp},on:{submit:function(e){return t.$emit("submit",e)}}},"component",s,!1)):[e("k-box",{key:t.parent+"-column-"+n+"-section-"+o,attrs:{text:t.$t("error.section.type.invalid",{type:s.type}),icon:"alert",theme:"negative"}})]]:t._e()]}))],2)})),1)}),[],!1,null,null,null,null).exports,Nl={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)}}};const zl=ut({mixins:[Nl],inheritAttrs:!1,data:()=>({fields:{},isLoading:!0,issue:null}),computed:{values(){return this.$store.getters["content/values"]()}},watch:{timestamp(){this.fetch()}},mounted(){this.onInput=Nt(this.onInput,50),this.fetch()},methods:{async fetch(){try{const t=await this.load();this.fields=t.fields;for(const e in this.fields)this.fields[e].section=this.name,this.fields[e].endpoints={field:this.parent+"/fields/"+e,section:this.parent+"/sections/"+this.name,model:this.parent}}catch(t){this.issue=t}finally{this.isLoading=!1}},onInput(t,e,i){this.$store.dispatch("content/update",[i,t[i]])},onSubmit(t){this.$store.dispatch("content/update",[null,t]),this.$events.emit("keydown.cmd.s",t)}}},(function(){var t=this,e=t._self._c;return t.isLoading?t._e():e("k-section",{staticClass:"k-fields-section",attrs:{headline:t.issue?"Error":null}},[t.issue?e("k-box",{attrs:{text:t.issue.message,html:!1,icon:"alert",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.onInput,submit:t.onSubmit}})],1)}),[],!1,null,null,null,null).exports;const Fl=ut({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("filter"),click:this.onSearchToggle,responsive:!0}),this.canAdd&&t.push({icon:this.addIcon,text:this.$t("add"),click:this.onAdd,responsive:!0}),t},canAdd:()=>!0,canDrop:()=>!1,canSearch(){return this.options.search},collection(){return{columns:this.options.columns,empty:this.emptyPropsWithSearch,fields:this.options.fields,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(){this.search()},timestamp(){this.reload()}},mounted(){this.search=Nt(this.search,200),this.load()},methods:{async load(t){this.isProcessing=!0,t||(this.isLoading=!0);const e=this.pagination.page??localStorage.getItem(this.paginationId)??1;try{const t=await this.$api.get(this.parent+"/sections/"+this.name,{page:e,searchterm:this.searchterm});this.options=t.options,this.pagination=t.pagination,this.data=t.data}catch(i){this.error=i.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},async reload(){await this.load(!0)},async search(){this.pagination.page=0,await this.reload()},update(){this.reload(),this.$events.emit("model.update")}}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("k-section",{class:`k-models-section k-${t.type}-section`,attrs:{buttons:t.buttons,"data-processing":t.isProcessing,headline:t.options.headline??" ",invalid:t.isInvalid,link:t.options.link,required:Boolean(t.options.min)}},[t.error?e("k-box",{attrs:{icon:"alert",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("filter")+" …",value:t.searchterm,icon:"search",type:"text"},on:{input:function(e){t.searchterm=e},keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.onSearchToggle.apply(null,arguments)}}}):t._e(),e("k-collection",t._g(t._b({on:{action:t.onAction,change:t.onChange,sort:t.onSort,paginate:t.onPaginate}},"k-collection",t.collection,!1),t.canAdd?{empty:t.onAdd}:{}))],1)]],2):t._e()}),[],!1,null,null,null,null).exports;const Yl=ut({extends:Fl,computed:{addIcon:()=>"upload",canAdd(){return this.$panel.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",uploadOptions(){return{...this.options.upload,url:this.$panel.urls.api+"/"+this.options.upload.api,on:{complete:()=>{this.$panel.notification.success({context:"view"}),this.$events.emit("file.upload")}}}}},mounted(){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.$panel.upload.pick(this.uploadOptions)},onDrop(t){this.canAdd&&this.$panel.upload.open(t,this.uploadOptions)},async onSort(t){if(!1===this.options.sortable)return!1;this.isProcessing=!0;try{await this.$api.patch(this.options.apiUrl+"/sort",{files:t.map((t=>t.id)),index:this.pagination.offset}),this.$panel.notification.success(),this.$events.emit("file.sort")}catch(e){this.$panel.error(e),this.reload()}finally{this.isProcessing=!1}},replace(t){this.$panel.upload.replace(t,this.uploadOptions)}}},null,null,!1,null,null,null,null).exports;const Rl=ut({mixins:[Nl],inheritAttrs:!1,data:()=>({icon:null,label:null,text:null,theme:null}),async mounted(){const t=await this.load();this.icon=t.icon,this.label=t.label,this.text=t.text,this.theme=t.theme??"info"}},(function(){var t=this,e=t._self._c;return e("k-section",{staticClass:"k-info-section",attrs:{headline:t.label}},[e("k-box",{attrs:{html:!0,icon:t.icon,text:t.text,theme:t.theme}})],1)}),[],!1,null,null,null,null).exports;const Ul=ut({extends:Fl,computed:{canAdd(){return this.options.add&&this.$panel.permissions.pages.create},items(){return this.data.map((t=>{const e=!1===t.permissions.changeStatus,i=this.$helper.page.status(t.status,e);return i.click=()=>this.$dialog(t.link+"/changeStatus"),t.flag={status:t.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.buttons=[i,...t.buttons??[]],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}))},type:()=>"pages"},mounted(){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 n=t[e].element,s=t[e].newIndex+1+this.pagination.offset;try{await this.$api.pages.changeStatus(n.id,"listed",s),this.$panel.notification.success(),this.$events.emit("page.sort",n)}catch(i){this.$panel.error({message:i.message,details:i.details}),await this.reload()}finally{this.isProcessing=!1}}}}},null,null,!1,null,null,null,null).exports;const Hl=ut({mixins:[Nl],data:()=>({headline:null,isLoading:!0,reports:null,size:null}),async mounted(){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("k-section",{staticClass:"k-stats-section",attrs:{headline:t.headline}},[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.$t("stats.empty")))])],1):t._e()}),[],!1,null,null,null,null).exports,Vl={install(t){t.component("k-section",ql),t.component("k-sections",Pl),t.component("k-fields-section",zl),t.component("k-files-section",Yl),t.component("k-info-section",Rl),t.component("k-pages-section",Ul),t.component("k-stats-section",Hl)}};const Kl=ut({components:{"k-highlight":()=>Y((()=>import("./Highlight.min.js")),__vite__mapDeps([5,1]),import.meta.url)},props:{language:{type:String}}},(function(){var t=this,e=t._self._c;return e("k-highlight",[e("div",[e("pre",{staticClass:"k-code",attrs:{"data-language":t.language}},[e("code",{key:t.$slots.default[0].text+"-"+t.language,class:t.language?`language-${t.language}`:null},[t._t("default")],2)])])])}),[],!1,null,null,null,null).exports;const Wl=ut({props:{link:String,size:{type:String},tag:{type:String,default:"h2"},theme:{type:String}},emits:["click"],mounted(){this.size&&window.panel.deprecated(": the `size` prop will be removed in a future version. Use the `tag` prop instead."),this.theme&&window.panel.deprecated(": the `theme` prop will be removed in a future version.")}},(function(){var t=this,e=t._self._c;return e(t.tag,{tag:"component",staticClass:"k-headline",attrs:{"data-theme":t.theme,"data-size":t.size},on:{click:function(e){return t.$emit("click",e)}}},[t.link?e("k-link",{attrs:{to:t.link}},[t._t("default")],2):t._t("default")],2)}),[],!1,null,null,null,null).exports;const Jl=ut({props:{input:{type:[String,Number]},invalid:{type:Boolean},link:{type:String},required:{default:!1,type:Boolean},type:{default:"field",type:String}},computed:{element(){return"section"===this.type?"h2":"label"}}},(function(){var t=this,e=t._self._c;return e(t.element,{tag:"component",staticClass:"k-label",class:"k-"+t.type+"-label",attrs:{for:t.input,"data-invalid":t.invalid}},[t.link?e("k-link",{attrs:{to:t.link}},[e("span",{staticClass:"k-label-text"},[t._t("default")],2)]):e("span",{staticClass:"k-label-text"},[t._t("default")],2),t.required&&!t.invalid?e("abbr",{attrs:{title:t.$t(t.type+".required")}},[t._v("✶")]):t._e(),e("abbr",{staticClass:"k-label-invalid",attrs:{title:t.$t(t.type+".invalid")}},[t._v("×")])],1)}),[],!1,null,null,null,null).exports;const Gl=ut({props:{align:String,html:String,size:String,theme:String},computed:{attrs(){return{class:"k-text","data-align":this.align,"data-size":this.size,"data-theme":this.theme}}},mounted(){this.theme&&window.panel.deprecated(': the `theme` prop will be removed in a future version. For help text, add `.k-help "` CSS class instead.')}},(function(){var t=this,e=t._self._c;return t.html?e("div",t._b({domProps:{innerHTML:t._s(t.html)}},"div",t.attrs,!1)):e("div",t._b({},"div",t.attrs,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports,Xl={install(t){t.component("k-code",Kl),t.component("k-headline",Wl),t.component("k-label",Jl),t.component("k-text",Gl)}},Zl={props:{back:String,color:String,cover:{type:Boolean,default:!0},icon:String,type:String,url:String}};const Ql=ut({mixins:[Zl],computed:{fallbackColor(){var t,e,i;return(null==(t=this.type)?void 0:t.startsWith("image/"))?"orange-500":(null==(e=this.type)?void 0:e.startsWith("audio/"))?"aqua-500":(null==(i=this.type)?void 0:i.startsWith("video/"))?"yellow-500":"white"},fallbackIcon(){var t,e,i;return(null==(t=this.type)?void 0:t.startsWith("image/"))?"image":(null==(e=this.type)?void 0:e.startsWith("audio/"))?"audio":(null==(i=this.type)?void 0:i.startsWith("video/"))?"video":"file"},isPreviewable(){return["image/jpeg","image/jpg","image/gif","image/png","image/webp","image/avif","image/svg+xml"].includes(this.type)}}},(function(){var t=this,e=t._self._c;return e("a",{staticClass:"k-upload-item-preview",attrs:{href:t.url,target:"_blank"}},[t.isPreviewable?e("k-image",{attrs:{cover:t.cover,src:t.url,back:t.back??"pattern"}}):e("k-icon-frame",{attrs:{color:t.color??t.fallbackColor,icon:t.icon??t.fallbackIcon,back:t.back??"black",ratio:"1/1"}})],1)}),[],!1,null,null,null,null).exports;const ta=ut({mixins:[Zl],props:{completed:Boolean,editable:{type:Boolean,default:!0},error:[String,Boolean],extension:String,id:String,name:String,niceSize:String,progress:Number,removable:{type:Boolean,default:!0}},emits:["remove","rename"]},(function(){var t=this,e=t._self._c;return e("li",{staticClass:"k-upload-item",attrs:{"data-completed":t.completed}},[e("k-upload-item-preview",{attrs:{back:t.back,color:t.color,cover:t.cover,icon:t.icon,type:t.type,url:t.url}}),e("k-input",{staticClass:"k-upload-item-input",attrs:{disabled:t.completed||!t.editable,after:"."+t.extension,novalidate:!0,required:!0,value:t.name,allow:"a-z0-9@._-",type:"slug"},on:{input:function(e){return t.$emit("rename",e)}}}),e("div",{staticClass:"k-upload-item-body"},[e("p",{staticClass:"k-upload-item-meta"},[t._v(" "+t._s(t.niceSize)+" "),t.progress?[t._v(" - "+t._s(t.progress)+"% ")]:t._e()],2),t.error?e("p",{staticClass:"k-upload-item-error"},[t._v(" "+t._s(t.error)+" ")]):t.progress?e("k-progress",{staticClass:"k-upload-item-progress",attrs:{value:t.progress}}):t._e()],1),e("div",{staticClass:"k-upload-item-toggle"},[t.completed||t.progress||!t.removable?!t.completed&&t.progress?e("k-button",{attrs:{disabled:!0,icon:"loader"}}):t.completed?e("k-button",{attrs:{icon:"check",theme:"positive"},on:{click:function(e){return t.$emit("remove")}}}):t._e():e("k-button",{attrs:{icon:"remove"},on:{click:function(e){return t.$emit("remove")}}})],1)],1)}),[],!1,null,null,null,null).exports;const ea=ut({props:{items:Array},emits:["remove","rename"]},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-upload-items"},t._l(t.items,(function(i){return e("k-upload-item",t._b({key:i.id,on:{rename:function(e){return t.$emit("rename",i,e)},remove:function(e){return t.$emit("remove",i)}}},"k-upload-item",i,!1))})),1)}),[],!1,null,null,null,null).exports,ia={install(t){t.component("k-upload-item",ta),t.component("k-upload-item-preview",Ql),t.component("k-upload-items",ea)}};const na=ut({props:{status:{default:"missing",type:String}}},(function(){var t=this,e=t._self._c;return t.$panel.activation.isOpen?e("div",{staticClass:"k-activation"},[e("p",[e("strong",[t._v(t._s(t.$t(`license.status.${t.status}.bubble`)))]),"missing"===t.status?[e("a",{attrs:{href:"https://getkirby.com/buy",target:"_blank"}},[t._v(t._s(t.$t("license.buy")))]),t._v(" & "),e("button",{attrs:{type:"button"},on:{click:function(e){return t.$dialog("registration")}}},[t._v(" "+t._s(t.$t("license.activate"))+" ")])]:t._e()],2),e("k-button",{staticClass:"k-activation-toggle",attrs:{icon:"cancel-small"},on:{click:function(e){return t.$panel.activation.close()}}})],1):t._e()}),[],!1,null,null,null,null).exports;const sa=ut({computed:{notification(){return"view"!==this.$panel.notification.context||this.$panel.notification.isFatal?null:this.$panel.notification}}},(function(){var t=this,e=t._self._c;return e("k-panel",{staticClass:"k-panel-inside"},[e("k-panel-menu"),e("main",{staticClass:"k-panel-main"},[e("k-topbar",{attrs:{breadcrumb:t.$panel.view.breadcrumb,view:t.$panel.view}},[t._t("topbar")],2),t._t("default")],2),t.notification&&"error"!==t.notification.type?e("k-button",{staticClass:"k-panel-notification",attrs:{icon:t.notification.icon,text:t.notification.message,theme:t.notification.theme,variant:"filled"},on:{click:function(e){return t.notification.close()}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const oa=ut({data:()=>({over:!1}),computed:{activationButton(){return"missing"===this.$panel.license?{click:()=>this.$dialog("registration"),text:this.$t("activate")}:"legacy"===this.$panel.license&&{click:()=>this.$dialog("license"),text:this.$t("renew")}},hasSearch(){return this.$helper.object.length(this.$panel.searches)>0},menus(){return this.$helper.array.split(this.$panel.menu.entries,"-")}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-panel-menu",attrs:{"aria-label":t.$t("menu"),"data-hover":t.$panel.menu.hover},on:{mouseenter:function(e){t.$panel.menu.hover=!0},mouseleave:function(e){t.$panel.menu.hover=!1}}},[e("div",{staticClass:"k-panel-menu-body"},[t.hasSearch?e("k-button",{staticClass:"k-panel-menu-search k-panel-menu-button",attrs:{text:t.$t("search"),icon:"search"},on:{click:function(e){return t.$panel.search()}}}):t._e(),t._l(t.menus,(function(i,n){return e("menu",{key:n,staticClass:"k-panel-menu-buttons",attrs:{"data-second-last":n===t.menus.length-2}},t._l(i,(function(i){return e("k-button",t._b({key:i.id,staticClass:"k-panel-menu-button",attrs:{title:i.title??i.text}},"k-button",i,!1))})),1)})),t.activationButton?e("menu",[e("k-button",t._b({staticClass:"k-activation-button k-panel-menu-button",attrs:{icon:"key",theme:"love",variant:"filled"}},"k-button",t.activationButton,!1)),e("k-activation",{attrs:{status:t.$panel.license}})],1):t._e()],2),e("k-button",{staticClass:"k-panel-menu-toggle",attrs:{icon:t.$panel.menu.isOpen?"angle-left":"angle-right",title:t.$panel.menu.isOpen?t.$t("collapse"):t.$t("expand"),size:"xs"},on:{click:function(e){return t.$panel.menu.toggle()}}})],1)}),[],!1,null,null,null,null).exports;const la=ut({},(function(){return(0,this._self._c)("k-panel",{staticClass:"k-panel-outside",attrs:{tabindex:"0"}},[this._t("default")],2)}),[],!1,null,null,null,null).exports;const aa=ut({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-panel",attrs:{"data-dragging":t.$panel.drag.isDragging,"data-loading":t.$panel.isLoading,"data-language":t.$panel.language.code,"data-language-default":t.$panel.language.isDefault,"data-menu":t.$panel.menu.isOpen?"true":"false","data-role":t.$panel.user.role,"data-translation":t.$panel.translation.code,"data-user":t.$panel.user.id,dir:t.$panel.direction}},[t._t("default"),t.$panel.dialog.isOpen&&!t.$panel.dialog.legacy?e("k-fiber-dialog"):t._e(),t.$panel.drawer.isOpen&&!t.$panel.drawer.legacy?e("k-fiber-drawer"):t._e(),t.$panel.notification.isFatal&&t.$panel.notification.isOpen?e("k-fatal",{attrs:{html:t.$panel.notification.message}}):t._e(),e("k-offline-warning"),e("k-icons"),e("k-overlay",{attrs:{nested:t.$panel.drawer.history.milestones.length>1,visible:t.$panel.drawer.isOpen,type:"drawer"},on:{close:function(e){return t.$panel.drawer.close()}}},[e("portal-target",{staticClass:"k-drawer-portal k-portal",attrs:{name:"drawer",multiple:""}})],1),e("k-overlay",{attrs:{visible:t.$panel.dialog.isOpen,type:"dialog"},on:{close:function(e){return t.$panel.dialog.close()}}},[e("portal-target",{staticClass:"k-dialog-portal k-portal",attrs:{name:"dialog",multiple:""}})],1),e("portal-target",{staticClass:"k-overlay-portal k-portal",attrs:{name:"overlay",multiple:""}})],2)}),[],!1,null,null,null,null).exports;const ra=ut({props:{breadcrumb:Array,view:Object},computed:{crumbs(){return[{link:this.view.link,label:this.view.label??this.view.breadcrumbLabel,icon:this.view.icon,loading:this.$panel.isLoading},...this.breadcrumb]}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-topbar"},[e("k-button",{staticClass:"k-panel-menu-proxy",attrs:{icon:"bars"},on:{click:function(e){return t.$panel.menu.toggle()}}}),e("k-breadcrumb",{staticClass:"k-topbar-breadcrumb",attrs:{crumbs:t.crumbs}}),e("div",{staticClass:"k-topbar-spacer"}),e("div",{staticClass:"k-topbar-signals"},[t._t("default")],2)],1)}),[],!1,null,null,null,null).exports,ua={install(t){t.component("k-activation",na),t.component("k-panel",aa),t.component("k-panel-inside",sa),t.component("k-panel-menu",oa),t.component("k-panel-outside",la),t.component("k-topbar",ra),t.component("k-inside",sa),t.component("k-outside",la)}};const ca=ut({props:{error:String,layout:String}},(function(){var t=this,e=t._self._c;return e(`k-panel-${t.layout}`,{tag:"component",staticClass:"k-error-view"},["outside"===t.layout?[e("div",[e("k-box",{attrs:{icon:"alert",theme:"negative"}},[t._v(t._s(t.error))])],1)]:[e("k-header",[t._v(t._s(t.$t("error")))]),e("k-box",{attrs:{icon:"alert",theme:"negative"}},[t._v(t._s(t.error))])]],2)}),[],!1,null,null,null,null).exports;const da=ut({mixins:[zt],props:{type:{default:"pages",type:String}},data:()=>({query:new URLSearchParams(window.location.search).get("query"),pagination:{},results:[]}),computed:{currentType(){return this.$panel.searches[this.type]??Object.values(this.$panel.searches)[0]},empty(){return this.isLoading?this.$t("searching")+"…":this.query.length<2?this.$t("search.min",{min:2}):this.$t("search.results.none")},isLoading(){return this.$panel.searcher.isLoading},tabs(){const t=[];for(const e in this.$panel.searches){const i=this.$panel.searches[e];t.push({label:i.label,link:"/search/?type="+e+"&query="+this.query,name:e})}return t}},watch:{isLoading(t){this.$panel.isLoading=t},query:{handler(){this.search(1)},immediate:!0},type(){this.search()}},methods:{focus(){var t;null==(t=this.$refs.input)||t.focus()},onPaginate(t){this.search(t.page)},async search(t){t||(t=new URLSearchParams(window.location.search).get("page")??1);const e=this.$panel.url(window.location,{type:this.currentType.id,query:this.query,page:t});window.history.pushState("","",e.toString());const i=await this.$panel.search(this.currentType.id,this.query,{page:t,limit:15});i&&(this.results=i.results??[],this.pagination=i.pagination)}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-search-view"},[e("k-header",[t._v(" "+t._s(t.$t("search"))+" "),e("k-input",{ref:"input",staticClass:"k-search-view-input",attrs:{slot:"buttons","aria-label":t.$t("search"),autofocus:!0,icon:t.isLoading?"loader":"search",placeholder:t.$t("search")+" …",spellcheck:!1,value:t.query,type:"text"},on:{input:function(e){t.query=e}},slot:"buttons"})],1),e("k-tabs",{attrs:{tab:t.currentType.id,tabs:t.tabs}}),e("div",{staticClass:"k-search-view-results"},[e("k-collection",{attrs:{items:t.results,empty:{icon:t.isLoading?"loader":"search",text:t.empty},pagination:t.pagination},on:{paginate:t.onPaginate}})],1)],1)}),[],!1,null,null,null,null).exports;const pa=ut({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:{"$panel.view.timestamp":{handler(){this.$store.dispatch("content/create",{id:this.id,api:this.id,content:this.model.content,ignore:this.protectedFields})},immediate:!0}},mounted(){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:{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;const ha=ut({extends:pa,props:{preview:Object},computed:{focus(){const t=this.$store.getters["content/values"]().focus;if(!t)return;const[e,i]=t.replaceAll("%","").split(" ");return{x:parseFloat(e),y:parseFloat(i)}}},methods:{action(t){if("replace"===t)return this.$panel.upload.replace({...this.preview,...this.model})},setFocus(t){!0===this.$helper.object.isObject(t)&&(t=`${t.x}% ${t.y}%`),this.$store.dispatch("content/update",["focus",t])}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-file-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-id":t.model.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{staticClass:"k-file-view-header",attrs:{editable:t.permissions.changeName&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-file-view-options",attrs:{link:t.preview.url,responsive:!0,title:t.$t("open"),icon:"open",size:"sm",target:"_blank",variant:"filled"}}),e("k-button",{staticClass:"k-file-view-options",attrs:{disabled:t.isLocked,dropdown:!0,title:t.$t("settings"),icon:"cog",size:"sm",variant:"filled"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id),"align-x":"end"},on:{action:t.action}}),e("k-languages-dropdown")],1),e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[t._v(" "+t._s(t.model.filename)+" ")]),e("k-file-preview",t._b({attrs:{focus:t.focus},on:{focus:t.setFocus}},"k-file-preview",t.preview,!1)),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),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}})],1)}),[],!1,null,null,null,null).exports;const ma=ut({props:{focus:Object},emits:["set"],methods:{set(){this.$emit("set",{x:50,y:50})},reset(){this.$emit("set",void 0)}}},(function(){var t=this;return(0,t._self._c)("k-button",{attrs:{icon:t.focus?"cancel-small":"preview",title:t.focus?t.$t("file.focus.reset"):void 0,size:"xs",variant:"filled"},on:{click:function(e){t.focus?t.reset():t.set()}}},[t.focus?[t._v(t._s(t.focus.x)+"% "+t._s(t.focus.y)+"%")]:[t._v(t._s(t.$t("file.focus.placeholder")))]],2)}),[],!1,null,null,null,null).exports;const fa=ut({props:{details:{default:()=>[],type:Array},focus:{type:Object},focusable:Boolean,image:{default:()=>({}),type:Object},url:String},emits:["focus"],computed:{options(){return[{icon:"open",text:this.$t("open"),link:this.url,target:"_blank"},{icon:"cancel",text:this.$t("file.focus.reset"),click:()=>this.$refs.focus.reset(),when:this.focusable&&this.focus},{icon:"preview",text:this.$t("file.focus.placeholder"),click:()=>this.$refs.focus.set(),when:this.focusable&&!this.focus}]}},methods:{setFocus(t){if(!t)return this.$emit("focus",null);this.$emit("focus",{x:t.x.toFixed(1),y:t.y.toFixed(1)})}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-file-preview",attrs:{"data-has-focus":Boolean(t.focus)}},[e("div",{staticClass:"k-file-preview-thumb-column"},[e("div",{staticClass:"k-file-preview-thumb"},[t.image.src?[e("k-coords-input",{attrs:{disabled:!t.focusable,value:t.focus},on:{input:function(e){return t.setFocus(e)}}},[e("img",t._b({on:{dragstart:function(t){t.preventDefault()}}},"img",t.image,!1))]),e("k-button",{staticStyle:{color:"var(--color-gray-500)"},attrs:{icon:"dots",size:"xs"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.options,theme:"light"}})]:e("k-icon",{staticClass:"k-item-icon",attrs:{color:t.$helper.color(t.image.color),type:t.image.icon}})],2)]),e("div",{staticClass:"k-file-preview-details"},[e("dl",[t._l(t.details,(function(i){return e("div",{key:i.title},[e("dt",[t._v(t._s(i.title))]),e("dd",[i.link?e("k-link",{attrs:{to:i.link,tabindex:"-1",target:"_blank"}},[t._v(" /"+t._s(i.text)+" ")]):[t._v(" "+t._s(i.text)+" ")]],2)])})),t.image.src?e("div",{staticClass:"k-file-preview-focus-info"},[e("dt",[t._v(t._s(t.$t("file.focus.title")))]),e("dd",[t.focusable?e("k-file-focus-button",{ref:"focus",attrs:{focus:t.focus},on:{set:t.setFocus}}):t.focus?[t._v(" "+t._s(t.focus.x)+"% "+t._s(t.focus.y)+"% ")]:[t._v("–")]],2)]):t._e()],2)])])}),[],!1,null,null,null,null).exports,ga={install(t){t.component("k-file-view",ha),t.component("k-file-preview",fa),t.component("k-file-focus-button",ma)}};const ka=ut({props:{isInstallable:Boolean,isInstalled:Boolean,isOk:Boolean,requirements:Object,translations:Array},data(){return{user:{name:"",email:"",language:this.$panel.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:"translate",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.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"})}catch(t){this.$panel.error(t)}}}},(function(){var t=this,e=t._self._c;return e("k-panel-outside",{staticClass:"k-installation-view"},[e("div",{staticClass:"k-dialog k-installation-dialog"},[e("k-dialog-body",[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,value:t.user},on:{input:function(e){t.user=e}}}),e("k-button",{attrs:{text:t.$t("install"),icon:"check",size:"lg",theme:"positive",type:"submit",variant:"filled"}})],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",size:"lg",theme:"positive",variant:"filled"},on:{click:t.$reload}})],1)],1)],1)])}),[],!1,null,null,null,null).exports,ba={install(t){t.component("k-installation-view",ka)}};const va=ut({props:{languages:{type:Array,default:()=>[]},variables:{type:Boolean,default:!0}},computed:{languagesCollection(){return this.languages.map((t=>({...t,image:{back:"black",color:"gray",icon:"translate"},link:()=>{if(!1===this.variables)return null;this.$go(`languages/${t.id}`)},options:[{icon:"edit",text:this.$t("edit"),disabled:!1===this.variables,click:()=>this.$go(`languages/${t.id}`)},{icon:"cog",text:this.$t("settings"),disabled:!this.$panel.permissions.languages.update,click:()=>this.$dialog(`languages/${t.id}/update`)},{when:t.deletable,icon:"trash",text:this.$t("delete"),disabled:!this.$panel.permissions.languages.delete,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-panel-inside",{staticClass:"k-languages-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.languages"))+" "),e("k-button-group",{attrs:{slot:"buttons"},slot:"buttons"},[e("k-button",{attrs:{disabled:!t.$panel.permissions.languages.create,text:t.$t("language.create"),icon:"add",size:"sm",variant:"filled"},on:{click:function(e){return t.$dialog("languages/create")}}})],1)],1),t.languages.length>0?[e("k-section",{attrs:{headline:t.$t("languages.default")}},[e("k-collection",{attrs:{items:t.primaryLanguage}})],1),e("k-section",{attrs:{headline:t.$t("languages.secondary")}},[t.secondaryLanguages.length?e("k-collection",{attrs:{items:t.secondaryLanguages}}):e("k-empty",{attrs:{icon:"translate",disabled:!t.$panel.permissions.languages.create},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:"translate",disabled:!t.$panel.permissions.languages.create},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.empty"))+" ")])]:t._e()],2)}),[],!1,null,null,null,null).exports;const ya=ut({props:{code:String,deletable:Boolean,direction:String,id:String,info:Array,next:Object,name:String,prev:Object,translations:Array,url:String},computed:{canUpdate(){return this.$panel.permissions.languages.update}},methods:{createTranslation(){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/create`)},option(t,e){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/${window.btoa(encodeURIComponent(e.key))}/${t}`)},remove(){this.$dialog(`languages/${this.id}/delete`)},update(t){this.$dialog(`languages/${this.id}/update`,{on:{ready:()=>{this.$panel.dialog.focus(t)}}})},updateTranslation({row:t}){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/${window.btoa(encodeURIComponent(t.key))}/update`)}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-language-view",scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{attrs:{editable:t.canUpdate},on:{edit:function(e){return t.update()}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[e("k-button",{attrs:{link:t.url,title:t.$t("open"),icon:"open",size:"sm",target:"_blank",variant:"filled"}}),e("k-button",{attrs:{disabled:!t.canUpdate,title:t.$t("settings"),icon:"cog",size:"sm",variant:"filled"},on:{click:function(e){return t.update()}}}),t.deletable?e("k-button",{attrs:{disabled:!t.$panel.permissions.languages.delete,title:t.$t("delete"),icon:"trash",size:"sm",variant:"filled"},on:{click:function(e){return t.remove()}}}):t._e()],1)]},proxy:!0}])},[t._v(" "+t._s(t.name)+" ")]),e("k-section",{attrs:{headline:t.$t("language.settings")}},[e("k-stats",{attrs:{reports:t.info,size:"small"}})],1),e("k-section",{attrs:{buttons:[{click:t.createTranslation,disabled:!t.canUpdate,icon:"add",text:t.$t("add")}],headline:t.$t("language.variables")}},[t.translations.length?[e("k-table",{attrs:{columns:{key:{label:t.$t("language.variable.key"),mobile:!0,width:"1/4"},value:{label:t.$t("language.variable.value"),mobile:!0}},disabled:!t.canUpdate,rows:t.translations},on:{cell:t.updateTranslation,option:t.option}})]:[e("k-empty",{attrs:{disabled:!t.canUpdate,icon:"translate"},on:{click:t.createTranslation}},[t._v(" "+t._s(t.$t("language.variables.empty"))+" ")])]],2)],1)}),[],!1,null,null,null,null).exports,$a={install(t){t.component("k-languages-view",va),t.component("k-language-view",ya)}};const wa=ut({emits:["click"]},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-notification k-login-alert",attrs:{"data-theme":"error"}},[e("p",[t._t("default")],2),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return t.$emit("click")}}})],1)}),[],!1,null,null,null,null).exports,xa={props:{methods:{type:Array,default:()=>[]},pending:{type:Object,default:()=>({challenge:"email"})},value:String}};const _a=ut({mixins:[xa],emits:["error"],data(){return{code:this.value??"",isLoading:!1}},computed:{mode(){return this.methods.includes("password-reset")?"password-reset":"login"},submitText(){const t=this.isLoading?" …":"";return"password-reset"===this.mode?this.$t("login.reset")+t:this.$t("login")+t}},methods:{async login(){this.$emit("error",null),this.isLoading=!0;try{await this.$api.auth.verifyCode(this.code),this.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"}),"password-reset"===this.mode?this.$go("reset-password"):this.$reload()}catch(t){this.$emit("error",t)}finally{this.isLoading=!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)}}},[t.pending.email?e("k-user-info",{attrs:{user:t.pending.email}}):t._e(),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,value:t.code,autocomplete:"one-time-code",icon:"unlock",name:"code"},on:{input:function(e){t.code=e}}}),e("footer",{staticClass:"k-login-buttons"},[e("k-button",{staticClass:"k-login-button k-login-back-button",attrs:{icon:"angle-left",link:"/logout",size:"lg",variant:"filled"}},[t._v(" "+t._s(t.$t("back"))+" ")]),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",size:"lg",type:"submit",theme:"positive",variant:"filled"}},[t._v(" "+t._s(t.submitText)+" ")])],1)],1)}),[],!1,null,null,null,null).exports,Ca={props:{methods:{type:Array,default:()=>[]},value:{type:Object,default:()=>({})}}};const Sa=ut({mixins:[Ca],emits:["error"],data(){return{mode:null,isLoading:!1,user:{email:"",password:"",remember:!1,...this.value}}},computed:{alternateMode(){return"email-password"===this.form?"email":"email-password"},canToggle(){return null!==this.codeMode&&(!1!==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(){const 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.mode?this.mode:"password"===this.methods[0]?"email-password":"email"},isResetForm(){return"password-reset"===this.codeMode&&"email"===this.form},submitText(){const t=this.isLoading?" …":"";return this.isResetForm?this.$t("login.reset")+t:this.$t("login")+t},toggleText(){return this.$t("login.toggleText."+this.codeMode+"."+this.alternateMode)}},methods:{async login(){this.$emit("error",null),this.isLoading=!0;const t={...this.user};"email"===this.mode&&(t.password=null),!0===this.isResetForm&&(t.remember=!1);try{await this.$api.auth.login(t),this.$reload({globals:["$system","$translation"]}),this.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"})}catch(e){this.$emit("error",e)}finally{this.isLoading=!1}},toggle(){this.mode=this.alternateMode,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("div",{staticClass:"k-login-fields"},[!0===t.canToggle?e("button",{staticClass:"k-login-toggler",attrs:{type:"button"},on:{click:t.toggle}},[t._v(" "+t._s(t.toggleText)+" ")]):t._e(),e("k-fieldset",{ref:"fieldset",attrs:{novalidate:!0,fields:t.fields,value:t.user},on:{input:function(e){t.user=e}}})],1),e("footer",{staticClass:"k-login-buttons"},[!1===t.isResetForm?e("k-checkbox-input",{attrs:{label:t.$t("login.remember"),checked:t.user.remember,value:t.user.remember},on:{input:function(e){t.user.remember=e}}}):t._e(),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",size:"lg",theme:"positive",type:"submit",variant:"filled"}},[t._v(" "+t._s(t.submitText)+" ")])],1)])}),[],!1,null,null,null,null).exports;const Oa=ut({components:{"k-login-plugin-form":window.panel.plugins.login},mixins:[xa,Ca],props:{value:{type:Object,default:()=>({code:"",email:"",password:""})}},data:()=>({issue:""}),computed:{component:()=>window.panel.plugins.login?"k-login-plugin-form":"k-login-form",form(){return this.pending.email?"code":"login"}},mounted(){this.$store.dispatch("content/clear")},methods:{async onError(t){null!==t?(!0===t.details.challengeDestroyed&&await this.$reload({globals:["$system"]}),this.issue=t.message):this.issue=null}}},(function(){var t=this,e=t._self._c;return e("k-panel-outside",{class:"code"===t.form?"k-login-code-view":"k-login-view"},[e("div",{staticClass:"k-dialog k-login k-login-dialog"},[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("login"))+" ")]),t.issue?e("k-login-alert",{nativeOn:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),e("k-dialog-body",["code"===t.form?e("k-login-code-form",t._b({on:{error:t.onError}},"k-login-code-form",{methods:t.methods,pending:t.pending,value:t.value.code},!1)):e(t.component,t._b({tag:"component",on:{error:t.onError}},"component",{methods:t.methods,value:t.value},!1))],1)],1)])}),[],!1,null,null,null,null).exports,Ma={install(t){t.component("k-login-alert",wa),t.component("k-login-code-form",_a),t.component("k-login-form",Sa),t.component("k-login-view",Oa),t.component("k-login",Sa),t.component("k-login-code",_a)}};const Aa=ut({extends:pa,props:{status:Object},computed:{protectedFields:()=>["title"],statusBtn(){return{...this.$helper.page.status.call(this,this.model.status,!this.permissions.changeStatus||this.isLocked),responsive:!0,size:"sm",text:this.status.label,variant:"filled"}}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-page-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-id":t.model.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[t.model.id?e("k-prev-next",{attrs:{prev:t.prev,next:t.next}}):t._e()]},proxy:!0}])},[e("k-header",{staticClass:"k-page-view-header",attrs:{editable:t.permissions.changeTitle&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.id+"/changeTitle")}},scopedSlots:t._u([{key:"buttons",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,title:t.$t("open"),icon:"open",target:"_blank",variant:"filled",size:"sm"}}):t._e(),e("k-button",{staticClass:"k-page-view-options",attrs:{disabled:!0===t.isLocked,dropdown:!0,title:t.$t("settings"),icon:"cog",variant:"filled",size:"sm"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id),"align-x":"end"}}),e("k-languages-dropdown"),t.status?e("k-button",t._b({staticClass:"k-page-view-status",on:{click:function(e){return t.$dialog(t.id+"/changeStatus")}}},"k-button",t.statusBtn,!1)):t._e()],1),e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),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,null,null,null,null).exports;const Ia=ut({extends:pa,emits:["submit"],computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-site-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-locked":t.isLocked,"data-id":"/","data-template":"site"}},[e("k-header",{staticClass:"k-site-view-header",attrs:{editable:t.permissions.changeTitle&&!t.isLocked},on:{edit:function(e){return t.$dialog("site/changeTitle")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-site-view-preview",attrs:{link:t.model.previewUrl,title:t.$t("open"),icon:"open",target:"_blank",variant:"filled",size:"sm"}}),e("k-languages-dropdown")],1),e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),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,null,null,null,null).exports,Da={install(t){t.component("k-page-view",Aa),t.component("k-site-view",Ia)}};const ja=ut({extends:pa},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-user-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-id":t.model.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{staticClass:"k-user-view-header",attrs:{editable:t.permissions.changeName&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-user-view-options",attrs:{disabled:t.isLocked,dropdown:!0,title:t.$t("settings"),icon:"cog",size:"sm",variant:"filled"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{"align-x":"end",options:t.$dropdown(t.id)}}),e("k-languages-dropdown")],1),e("k-form-buttons",{attrs:{lock:t.lock}})]},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-user-profile",{attrs:{"is-locked":t.isLocked,model:t.model,permissions:t.permissions}}),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),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}})],1)}),[],!1,null,null,null,null).exports;const Ea=ut({extends:ja,prevnext:!1},null,null,!1,null,null,null,null).exports;const La=ut({data:()=>({isLoading:!1,values:{password:null,passwordConfirmation:null}}),computed:{fields(){return{password:{autofocus:!0,label:this.$t("user.changePassword.new"),icon:"key",type:"password",width:"1/2"},passwordConfirmation:{label:this.$t("user.changePassword.new.confirm"),icon:"key",type:"password",width:"1/2"}}}},mounted(){this.$panel.title=this.$t("view.resetPassword")},methods:{async submit(){if(!this.values.password||this.values.password.length<8)return this.$panel.notification.error(this.$t("error.user.password.invalid"));if(this.values.password!==this.values.passwordConfirmation)return this.$panel.notification.error(this.$t("error.user.password.notSame"));this.isLoading=!0;try{await this.$api.users.changePassword(this.$panel.user.id,this.values.password),this.$panel.notification.success(),this.$go("/")}catch(t){this.$panel.notification.error(t)}finally{this.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-password-reset-view"},[e("form",{on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[e("k-header",{scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button",{attrs:{icon:"check",theme:"notice",type:"submit",variant:"filled",size:"sm"}},[t._v(" "+t._s(t.$t("change"))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)]},proxy:!0}])},[t._v(" "+t._s(t.$t("view.resetPassword"))+" ")]),e("k-user-info",{attrs:{user:t.$panel.user}}),e("k-fieldset",{attrs:{fields:t.fields,value:t.values}})],1)])}),[],!1,null,null,null,null).exports;const Ta=ut({props:{model:Object},methods:{open(){this.model.avatar?this.$refs.dropdown.toggle():this.upload()},async remove(){await this.$api.users.deleteAvatar(this.model.id),this.$panel.notification.success(),this.$reload()},upload(){this.$panel.upload.pick({url:this.$panel.urls.api+"/"+this.model.link+"/avatar",accept:"image/*",immediate:!0,multiple:!1})}}},(function(){var t=this,e=t._self._c;return e("k-button",{staticClass:"k-user-view-image",attrs:{title:t.$t("avatar")},on:{click:t.open}},[t.model.avatar?[e("k-image-frame",{attrs:{cover:!0,src:t.model.avatar}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:[{icon:"upload",text:t.$t("change"),click:t.upload},{icon:"trash",text:t.$t("delete"),click:t.remove}]}})]:e("k-icon-frame",{attrs:{icon:"user"}})],2)}),[],!1,null,null,null,null).exports;const Ba=ut({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-frame",{attrs:{cover:!0,src:t.user.avatar.url,ratio:"1/1"}}):e("k-icon-frame",{attrs:{color:"white",back:"black",icon:"user"}}),t._v(" "+t._s(t.user.name??t.user.email??t.user)+" ")],1)}),[],!1,null,null,null,null).exports;const qa=ut({props:{isLocked:Boolean,model:Object,permissions:Object}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-user-profile"},[e("k-user-avatar",{attrs:{disabled:t.isLocked,model:t.model}}),e("k-button-group",{attrs:{buttons:[{icon:"email",text:`${t.model.email}`,title:`${t.$t("email")}: ${t.model.email}`,disabled:!t.permissions.changeEmail||t.isLocked,click:()=>t.$dialog(t.model.link+"/changeEmail")},{icon:"bolt",text:`${t.model.role}`,title:`${t.$t("role")}: ${t.model.role}`,disabled:!t.permissions.changeRole||t.isLocked,click:()=>t.$dialog(t.model.link+"/changeRole")},{icon:"translate",text:`${t.model.language}`,title:`${t.$t("language")}: ${t.model.language}`,disabled:!t.permissions.changeLanguage||t.isLocked,click:()=>t.$dialog(t.model.link+"/changeLanguage")}]}})],1)}),[],!1,null,null,null,null).exports;const Pa=ut({props:{role:Object,roles:Array,search:String,title:String,users:Object},computed:{empty(){return{icon:"users",text:this.$t("role.empty")}},items(){return this.users.data.map((t=>(t.options=this.$dropdown(t.link),t)))},tabs(){const t=[{name:"all",label:this.$t("role.all"),link:"/users"}];for(const e of this.roles)t.push({name:e.id,label:e.title,link:"/users?role="+e.id});return t}},methods:{create(){var t;this.$dialog("users/create",{query:{role:null==(t=this.role)?void 0:t.id}})},paginate(t){this.$reload({query:{page:t.page}})}}},(function(){var t,e=this,i=e._self._c;return i("k-panel-inside",{staticClass:"k-users-view"},[i("k-header",{staticClass:"k-users-view-header",scopedSlots:e._u([{key:"buttons",fn:function(){return[i("k-button",{attrs:{disabled:!e.$panel.permissions.users.create,text:e.$t("user.create"),icon:"add",size:"sm",variant:"filled"},on:{click:e.create}})]},proxy:!0}])},[e._v(" "+e._s(e.$t("view.users"))+" ")]),i("k-tabs",{attrs:{tab:(null==(t=e.role)?void 0:t.id)??"all",tabs:e.tabs}}),i("k-collection",{attrs:{empty:e.empty,items:e.items,pagination:e.users.pagination},on:{paginate:e.paginate}})],1)}),[],!1,null,null,null,null).exports,Na={install(t){t.component("k-account-view",Ea),t.component("k-reset-password-view",La),t.component("k-user-avatar",Ta),t.component("k-user-info",Ba),t.component("k-user-profile",qa),t.component("k-user-view",ja),t.component("k-users-view",Pa)}};const za=ut({components:{Plugins:ut({props:{plugins:Array}},(function(){var t=this,e=t._self._c;return t.plugins.length?e("k-section",{attrs:{headline:t.$t("plugins"),link:"https://getkirby.com/plugins"}},[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"),type:"update-status",mobile:!0,width:"10rem"}},rows:t.plugins}})],1):t._e()}),[],!1,null,null,null,null).exports,Security:ut({props:{exceptions:Array,security:Array,urls:Object},data(){return{issues:structuredClone(this.security)}},async mounted(){console.info("Running system health checks for the Panel system view; failed requests in the following console output are expected behavior.");const t=(Promise.allSettled??Promise.all).bind(Promise),e=Object.entries(this.urls).map(this.check);await t(e),console.info(`System health checks ended. ${this.issues.length-this.security.length} issues with accessible files/folders found (see the security list in the system view).`)},methods:{async check([t,e]){if(!e)return;const{status:i}=await fetch(e,{cache:"no-store"});i<400&&this.issues.push({id:t,text:this.$t("system.issues."+t),link:"https://getkirby.com/security/"+t,icon:"folder"})},retry(){this.$go(window.location.href)}}},(function(){var t=this,e=t._self._c;return t.issues.length?e("k-section",{attrs:{headline:t.$t("security"),buttons:[{title:t.$t("retry"),icon:"refresh",click:t.retry}]}},[e("k-items",{attrs:{items:t.issues.map((t=>({image:{back:"var(--color-red-200)",icon:t.icon??"alert",color:"var(--color-red)"},target:"_blank",...t})))}})],1):t._e()}),[],!1,null,null,null,null).exports},props:{environment:Array,exceptions:Array,info:Object,plugins:Array,security:Array,urls:Object},mounted(){this.exceptions.length>0&&(console.info("The following errors occurred during the update check of Kirby and/or plugins:"),this.exceptions.map((t=>console.warn(t))),console.info("End of errors from the update check."))},methods:{copy(){const t=JSON.stringify({info:this.info,security:this.security.map((t=>t.text)),plugins:this.plugins.map((t=>({name:t.name.text,version:t.version.currentVersion})))},null,2);this.$helper.clipboard.write(t),this.$panel.notification.success({message:this.$t("system.info.copied")})}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-system-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.system"))+" ")]),e("k-section",{attrs:{headline:t.$t("environment"),buttons:[{text:t.$t("system.info.copy"),icon:"copy",responsive:!0,click:t.copy}]}},[e("k-stats",{staticClass:"k-system-info",attrs:{reports:t.environment,size:"medium"}})],1),e("security",{attrs:{security:t.security,urls:t.urls}}),e("plugins",{attrs:{plugins:t.plugins}})],1)}),[],!1,null,null,null,null).exports;const Fa=ut({props:{value:[String,Object]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-table-update-status-cell"},["string"==typeof t.value?e("span",{staticClass:"k-table-update-status-cell-version"},[t._v(" "+t._s(t.value)+" ")]):[e("k-button",{staticClass:"k-table-update-status-cell-button",attrs:{dropdown:!0,icon:t.value.icon,href:t.value.url,text:t.value.currentVersion,theme:t.value.theme,size:"xs",variant:"filled"},on:{click:function(e){return e.stopPropagation(),t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{"align-x":"end"}},[e("dl",{staticClass:"k-plugin-info"},[e("dt",[t._v(t._s(t.$t("plugin")))]),e("dd",[t._v(t._s(t.value.pluginName))]),e("dt",[t._v(t._s(t.$t("version.current")))]),e("dd",[t._v(t._s(t.value.currentVersion))]),e("dt",[t._v(t._s(t.$t("version.latest")))]),e("dd",[t._v(t._s(t.value.latestVersion))]),e("dt",[t._v(t._s(t.$t("system.updateStatus")))]),e("dd",{attrs:{"data-theme":t.value.theme}},[t._v(t._s(t.value.label))])]),t.value.url?[e("hr"),e("k-button",{attrs:{icon:"open",link:t.value.url}},[t._v(" "+t._s(t.$t("versionInformation"))+" ")])]:t._e()],2)]],2)}),[],!1,null,null,null,null).exports,Ya={install(t){t.component("k-system-view",za),t.component("k-table-update-status-cell",Fa)}};const Ra=ut({props:{id:String},mounted(){window.panel.deprecated(" will be removed in a future version.")}},(function(){var t=this._self._c;return t("k-panel-inside",[t("k-"+this.id+"-plugin-view",{tag:"component"})],1)}),[],!1,null,null,null,null).exports,Ua={install(t){t.component("k-error-view",ca),t.component("k-search-view",da),t.use(ga),t.use(ba),t.use($a),t.use(Ma),t.use(Da),t.use(Ya),t.use(Na),t.component("k-plugin-view",Ra)}},Ha={install(t){t.use(kt),t.use(se),t.use(xe),t.use(Be),t.use(Eo),t.use(qo),t.use(ll),t.use(kl),t.use(Bl),t.use(Vl),t.use(Xl),t.use(ia),t.use(ua),t.use(Ua),t.use(L)}},Va={install(t){window.onunhandledrejection=t=>{t.preventDefault(),window.panel.error(t.reason)},t.config.errorHandler=window.panel.error.bind(window.panel)}},Ka=(t={})=>{var e=t.desc?-1:1,i=-e,n=/^0/,s=/\s+/g,o=/^\s+|\s+$/g,l=/[^\x00-\x80]/,a=/^0x[0-9a-f]+$/i,r=/(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(r,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")}function p(t,e){return(!t.match(n)||1===e)&&parseFloat(t)||t.replace(s," ").replace(o,"")||0}return function(t,n){var s=c(t),o=c(n);if(!s&&!o)return 0;if(!s&&o)return i;if(s&&!o)return e;var r=d(s),h=d(o),m=parseInt(s.match(a),16)||1!==r.length&&Date.parse(s),f=parseInt(o.match(a),16)||m&&o.match(u)&&Date.parse(o)||null;if(f){if(mf)return e}for(var g=r.length,k=h.length,b=0,v=Math.max(g,k);b0)return e;if(w<0)return i;if(b===v-1)return 0}else{if(y<$)return i;if(y>$)return e}}return 0}};function Wa(t){return Array.isArray(t)?t:Object.values(t??{})}RegExp.escape=function(t){return t.replace(new RegExp("[-/\\\\^$*+?.()[\\]{}]","gu"),"\\$&")};function Ja(t,e){return t.reduce(((t,i)=>(i===e?t.push([]):t[t.length-1].push(i),t)),[[]])}function Ga(t){return Array.isArray(t)?t:[t]}Array.fromObject=Wa,Object.defineProperty(Array.prototype,"sortBy",{value:function(t){return t(this,t)},enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(Array.prototype,"split",{value:function(t){return Ja(this,t)},enumerable:!1,writable:!0,configurable:!0}),Array.wrap=Ga;const Xa={fromObject:Wa,search:(t,e,i={})=>{if((e??"").length<=(i.min??0))return t;const n=new RegExp(RegExp.escape(e),"ig"),s=i.field??"text",o=t.filter((t=>!!t[s]&&null!==t[s].match(n)));return i.limit?o.slice(0,i.limit):o},sortBy:function(t,e){const i=e.split(" "),n=i[0],s=i[1]??"asc",o=Ka({desc:"desc"===s,insensitive:!0});return t.sort(((t,e)=>{const i=String(t[n]??""),s=String(e[n]??"");return o(i,s)}))},split:Ja,wrap:Ga};const Za={read:function(t,e=!1){if(!t)return null;if("string"==typeof t)return t;if(t instanceof ClipboardEvent){if(t.preventDefault(),!0===e)return t.clipboardData.getData("text/plain");const i=t.clipboardData.getData("text/html")||t.clipboardData.getData("text/plain")||null;if(i)return i.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 i=document.createElement("textarea");if(i.value=t,document.body.append(i),navigator.userAgent.match(/ipad|ipod|iphone/i)){i.contentEditable=!0,i.readOnly=!0;const t=document.createRange();t.selectNodeContents(i);const e=window.getSelection();e.removeAllRanges(),e.addRange(t),i.setSelectionRange(0,999999)}else i.select();return document.execCommand("copy"),i.remove(),!0}};function Qa(t){if("string"==typeof t){if("pattern"===(t=t.toLowerCase()))return"var(--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}}function tr(t,e=!1){if(!t.match("youtu"))return!1;let i=null;try{i=new URL(t)}catch{return!1}const n=i.pathname.split("/").filter((t=>""!==t)),s=n[0],o=n[1],l="https://"+(!0===e?"www.youtube-nocookie.com":i.host)+"/embed",a=t=>!!t&&null!==t.match(/^[a-zA-Z0-9_-]+$/);let r=i.searchParams,u=null;switch(n.join("/")){case"embed/videoseries":case"playlist":a(r.get("list"))&&(u=l+"/videoseries");break;case"watch":a(r.get("v"))&&(u=l+"/"+r.get("v"),r.has("t")&&r.set("start",r.get("t")),r.delete("v"),r.delete("t"));break;default:i.host.includes("youtu.be")&&a(s)?(u=!0===e?"https://www.youtube-nocookie.com/embed/"+s:"https://www.youtube.com/embed/"+s,r.has("t")&&r.set("start",r.get("t")),r.delete("t")):["embed","shorts"].includes(s)&&a(o)&&(u=l+"/"+o)}if(!u)return!1;const c=r.toString();return c.length&&(u+="?"+c),u}function er(t,e=!1){let i=null;try{i=new URL(t)}catch{return!1}const n=i.pathname.split("/").filter((t=>""!==t));let s=i.searchParams,o=null;switch(!0===e&&s.append("dnt",1),i.host){case"vimeo.com":case"www.vimeo.com":o=n[0];break;case"player.vimeo.com":o=n[1]}if(!o||!o.match(/^[0-9]*$/))return!1;let l="https://player.vimeo.com/video/"+o;const a=s.toString();return a.length&&(l+="?"+a),l}const ir={youtube:tr,vimeo:er,video:function(t,e=!1){return!0===t.includes("youtu")?tr(t,e):!0===t.includes("vimeo")&&er(t,e)}};function nr(t){var e;if(void 0!==t.default)return structuredClone(t.default);const i=window.panel.app.$options.components[`k-${t.type}-field`],n=null==(e=null==i?void 0:i.options.props)?void 0:e.value;if(void 0===n)return;const s=null==n?void 0:n.default;return"function"==typeof s?s():void 0!==s?s:null}const sr={defaultValue:nr,form:function(t){const e={};for(const i in t){const n=nr(t[i]);void 0!==n&&(e[i]=n)}return e},isVisible:function(t,e){if("hidden"===t.type||!0===t.hidden)return!1;if(!t.when)return!0;for(const i in t.when){const n=e[i.toLowerCase()],s=t.when[i];if((void 0!==n||!(""===s||Array.isArray(s)&&0===s.length))&&n!==s)return!1}return!0},subfields:function(t,e){let i={};for(const n in e){const s=e[n];s.section=t.name,t.endpoints&&(s.endpoints={field:t.endpoints.field+"+"+n,section:t.endpoints.section,model:t.endpoints.model}),i[n]=s}return i}},or=t=>t.split(".").slice(-1).join(""),lr=t=>t.split(".").slice(0,-1).join("."),ar=t=>Intl.NumberFormat("en",{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow"}).format(t),rr={extension:or,name:lr,niceSize:ar};function ur(t,e){if("string"==typeof t&&(t=document.querySelector(t)),!t)return!1;if(!e&&t.contains(document.activeElement)&&t!==document.activeElement)return!1;const i=[":where([autofocus], [data-autofocus])",":where(input, textarea, select, [contenteditable=true], .input-focus)","[type=submit]","button"];e&&i.unshift(`[name="${e}"]`);const n=function(t,e){for(const i of e){const e=t.querySelector(i);if(!0===cr(e))return e}return null}(t,i);return n?(n.focus(),n):!0===cr(t)&&(t.focus(),t)}function cr(t){return!!t&&(!t.matches("[disabled], [aria-disabled], input[type=hidden]")&&(!t.closest("[aria-disabled]")&&!t.closest("[disabled]")&&"function"==typeof t.focus))}const dr=t=>"function"==typeof window.Vue.options.components[t],pr=t=>!!t.dataTransfer&&(!!t.dataTransfer.types&&(!0===t.dataTransfer.types.includes("Files")&&!1===t.dataTransfer.types.includes("text/plain")));const hr={metaKey:function(){return window.navigator.userAgent.indexOf("Mac")>-1?"cmd":"ctrl"}};function mr(t){return!0===t.startsWith("file://")||!0===t.startsWith("/@/file/")}function fr(t){return"site://"===t||!0===t.startsWith("page://")||!0===t.startsWith("/@/page/")}function gr(t=[]){const e={url:{detect:t=>/^(http|https):\/\//.test(t),icon:"url",id:"url",label:window.panel.$t("url"),link:t=>t,placeholder:window.panel.$t("url.placeholder"),input:"url",value:t=>t},page:{detect:t=>!0===fr(t),icon:"page",id:"page",label:window.panel.$t("page"),link:t=>t,placeholder:window.panel.$t("select")+" …",input:"text",value:t=>t},file:{detect:t=>!0===mr(t),icon:"file",id:"file",label:window.panel.$t("file"),link:t=>t,placeholder:window.panel.$t("select")+" …",value:t=>t},email:{detect:t=>t.startsWith("mailto:"),icon:"email",id:"email",label:window.panel.$t("email"),link:t=>t.replace(/^mailto:/,""),placeholder:window.panel.$t("email.placeholder"),input:"email",value:t=>"mailto:"+t},tel:{detect:t=>t.startsWith("tel:"),icon:"phone",id:"tel",label:window.panel.$t("tel"),link:t=>t.replace(/^tel:/,""),pattern:"[+]{0,1}[0-9]+",placeholder:window.panel.$t("tel.placeholder"),input:"tel",value:t=>"tel:"+t},anchor:{detect:t=>t.startsWith("#"),icon:"anchor",id:"anchor",label:"Anchor",link:t=>t,pattern:"^#.+",placeholder:"#element",input:"text",value:t=>t},custom:{detect:()=>!0,icon:"title",id:"custom",label:window.panel.$t("custom"),link:t=>t,input:"text",value:t=>t}};if(!t.length)return e;const i={};for(const n of t)i[n]=e[n];return i}const kr={detect:function(t,e){if(t=t??"",e=e??gr(),0===t.length)return{type:Object.keys(e)[0]??"url",link:""};for(const i in e)if(!0===e[i].detect(t))return{type:i,link:e[i].link(t)}},getFileUUID:function(t){return t.replace("/@/file/","file://")},getPageUUID:function(t){return t.replace("/@/page/","page://")},isFileUUID:mr,isPageUUID:fr,preview:async function({type:t,link:e},i){return"page"===t&&e?await async function(t,e=["title","panelImage"]){if("site://"===t)return{label:window.panel.$t("view.site")};try{const i=await window.panel.api.pages.get(t,{select:e.join(",")});return{label:i.title,image:i.panelImage}}catch{return null}}(e,i):"file"===t&&e?await async function(t,e=["filename","panelImage"]){try{const i=await window.panel.api.files.get(null,t,{select:e.join(",")});return{label:i.filename,image:i.panelImage}}catch{return null}}(e,i):e?{label:e}:null},types:gr};const br={status:function(t,e=!1){const i={class:"k-status-icon",icon:"status-"+t,title:window.panel.$t("page.status")+": "+window.panel.$t("page.status."+t),disabled:e,size:"xs",style:"--icon-size: 15px"};return e&&(i.title+=` (${window.panel.$t("disabled")})`),i.theme="draft"===t?"negative-icon":"unlisted"===t?"info-icon":"positive-icon",i}},vr=(t="3/2",e="100%",i=!0)=>{const n=String(t).split("/");if(2!==n.length)return e;const s=Number(n[0]),o=Number(n[1]);let l=100;return 0!==s&&0!==o&&(l=i?l/s*o:l/o*s,l=parseFloat(String(l)).toFixed(2)),l+"%"},yr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function $r(t){return String(t).replace(/[&<>"'`=/]/g,(t=>yr[t]))}function wr(t){return!t||0===String(t).length}function xr(t){const e=String(t);return e.charAt(0).toLowerCase()+e.slice(1)}function _r(t="",e=""){const i=new RegExp(`^(${RegExp.escape(e)})+`,"g");return t.replace(i,"")}function Cr(t="",e=""){const i=new RegExp(`(${RegExp.escape(e)})+$`,"g");return t.replace(i,"")}function Sr(t,e={}){const i=(t,e={})=>{const n=e[$r(t.shift())]??"…";return"…"===n||0===t.length?n:i(t,n)},n="[{]{1,2}[\\s]?",s="[\\s]?[}]{1,2}";return(t=t.replace(new RegExp(`${n}(.*?)${s}`,"gi"),((t,n)=>i(n.split("."),e)))).replace(new RegExp(`${n}.*${s}`,"gi"),"…")}function Or(t){const e=String(t);return e.charAt(0).toUpperCase()+e.slice(1)}function Mr(){let t,e,i="";for(t=0;t<32;t++)e=16*Math.random()|0,8!=t&&12!=t&&16!=t&&20!=t||(i+="-"),i+=(12==t?4:16==t?3&e|8:e).toString(16);return i}const Ar={camelToKebab:function(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()},escapeHTML:$r,hasEmoji:function(t){if("string"!=typeof t)return!1;if(!0===/^[a-z0-9_-]+$/.test(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},isEmpty:wr,lcfirst:xr,ltrim:_r,pad:function(t,e=2){t=String(t);let i="";for(;i.length]+)>)/gi,"")},template:Sr,ucfirst:Or,ucwords:function(t){return String(t).split(/ /g).map((t=>Or(t))).join(" ")},unescapeHTML:function(t){for(const e in yr)t=String(t).replaceAll(yr[e],e);return t},uuid:Mr},Ir=async(t,e)=>new Promise(((i,n)=>{const s={url:"/",field:"file",method:"POST",filename:t.name,headers:{},attributes:{},complete:()=>{},error:()=>{},success:()=>{},progress:()=>{}},o=Object.assign(s,e),l=new XMLHttpRequest,a=new FormData;a.append(o.field,t,o.filename);for(const t in o.attributes){const e=o.attributes[t];null!=e&&a.append(t,e)}const r=e=>{if(e.lengthComputable&&o.progress){const i=Math.max(0,Math.min(100,Math.ceil(e.loaded/e.total*100)));o.progress(l,t,i)}};l.upload.addEventListener("loadstart",r),l.upload.addEventListener("progress",r),l.addEventListener("load",(e=>{let s=null;try{s=JSON.parse(e.target.response)}catch{s={status:"error",message:"The file could not be uploaded"}}"error"===s.status?(o.error(l,t,s),n(s)):(o.progress(l,t,100),o.success(l,t,s),i(s))})),l.addEventListener("error",(e=>{const i=JSON.parse(e.target.response);o.progress(l,t,100),o.error(l,t,i),n(i)})),l.open(o.method,o.url,!0);for(const t in o.headers)l.setRequestHeader(t,o.headers[t]);l.send(a)}));function Dr(){var t;return new URL((null==(t=document.querySelector("base"))?void 0:t.href)??window.location.origin)}function jr(t={},e={}){e instanceof URL&&(e=e.search);const i=new URLSearchParams(e);for(const[n,s]of Object.entries(t))null!==s&&i.set(n,s);return i}function Er(t="",e={},i){return(t=Pr(t,i)).search=jr(e,t.search),t}function Lr(t){return null!==String(t).match(/^https?:\/\//)}function Tr(t){return Pr(t).origin===window.location.origin}function Br(t,e){if((t instanceof URL||t instanceof Location)&&(t=t.toString()),"string"!=typeof t)return!1;try{new URL(t,window.location)}catch{return!1}if(!0===e){return/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!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]))|(?:localhost)|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/i.test(t)}return!0}function qr(t,e){return!0===Lr(t)?t:(e=e??Dr(),(e=String(e).replaceAll(/\/$/g,""))+"/"+(t=String(t).replaceAll(/^\//g,"")))}function Pr(t,e){return t instanceof URL?t:new URL(qr(t,e))}const Nr={base:Dr,buildQuery:jr,buildUrl:Er,isAbsolute:Lr,isSameOrigin:Tr,isUrl:Br,makeAbsolute:qr,toObject:Pr},zr={install(t){t.prototype.$helper={array:Xa,clipboard:Za,clone:wt.clone,color:Qa,embed:ir,focus:ur,isComponent:dr,isUploadEvent:pr,debounce:Nt,field:sr,file:rr,keyboard:hr,link:kr,object:wt,page:br,pad:Ar.pad,ratio:vr,slug:Ar.slug,sort:Ka,string:Ar,upload:Ir,url:Nr,uuid:Ar.uuid},t.prototype.$esc=Ar.escapeHTML}},Fr={install(t){const e=(t,e,i)=>{!0!==i.context.disabled?t.dir=window.panel.language.direction:t.dir=null};t.directive("direction",{bind:e,update:e})}},Yr={install(t){window.panel.redirect=window.panel.redirect.bind(window.panel),window.panel.reload=window.panel.reload.bind(window.panel),window.panel.request=window.panel.request.bind(window.panel),window.panel.search=window.panel.search.bind(window.panel);const e=["api","config","direction","events","language","languages","license","menu","multilang","permissions","search","searches","system","t","translation","url","urls","user","view"];for(const i of e){const e=`$${i}`;t.prototype[e]=window.panel[e]=window.panel[i]}window.panel.$vue=window.panel.app}},Rr=/^#?([\da-f]{3}){1,2}$/i,Ur=/^#?([\da-f]{4}){1,2}$/i,Hr=/^rgba?\(\s*(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?$/i,Vr=/^hsla?\(\s*(\d{1,3}\.?\d*)(deg|rad|grad|turn)?(?:,|\s)+(\d{1,3})%(?:,|\s)+(\d{1,3})%(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?$/i;function Kr(t){return"string"==typeof t&&(Rr.test(t)||Ur.test(t))}function Wr(t){return vt(t)&&"r"in t&&"g"in t&&"b"in t}function Jr(t){return vt(t)&&"h"in t&&"s"in t&&"l"in t}function Gr({h:t,s:e,v:i,a:n}){if(0===i)return{h:t,s:0,l:0,a:n};if(0===e&&1===i)return{h:t,s:1,l:1,a:n};const s=i*(2-e)/2;return{h:t,s:e=i*e/(1-Math.abs(2*s-1)),l:s,a:n}}function Xr({h:t,s:e,l:i,a:n}){const s=e*(i<.5?i:1-i);return{h:t,s:e=0===s?0:2*s/(i+s),v:i+s,a:n}}function Zr(t){if(!0===Rr.test(t)||!0===Ur.test(t)){"#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.split("").reduce(((t,e)=>t+e+e),""));const e=parseInt(t,16);return!0===Rr.test(t)?{r:e>>16,g:e>>8&255,b:255&e,a:1}:{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:Math.round((255&e)/255*100)/100}}throw new Error(`unknown hex color: ${t}`)}function Qr({r:t,g:e,b:i,a:n=1}){let s="#"+(1<<24|t<<16|e<<8|i).toString(16).slice(1);return n<1&&(s+=(256|Math.round(255*n)).toString(16).slice(1)),s}function tu({h:t,s:e,l:i,a:n}){const s=e*Math.min(i,1-i),o=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return{r:255*o(0),g:255*o(8),b:255*o(4),a:n}}function eu({r:t,g:e,b:i,a:n}){t/=255,e/=255,i/=255;const s=Math.max(t,e,i),o=s-Math.min(t,e,i),l=1-Math.abs(s+s-o-1);let a=o&&(s==t?(e-i)/o:s==e?2+(i-t)/o:4+(t-e)/o);return a=60*(a<0?a+6:a),{h:a,s:l?o/l:0,l:(s+s-o)/2,a:n}}function iu(t){return Qr(tu(t))}function nu(t){return eu(Zr(t))}function su(t,e){return t=Number(t),"grad"===e?t*=.9:"rad"===e?t*=180/Math.PI:"turn"===e&&(t*=360),parseInt(t%360)}function ou(t,e){if(!0===Kr(t))switch("#"!==t[0]&&(t="#"+t),e){case"hex":return t;case"rgb":return Zr(t);case"hsl":return nu(t);case"hsv":return Xr(nu(t))}if(!0===Wr(t))switch(e){case"hex":return Qr(t);case"rgb":return t;case"hsl":return eu(t);case"hsv":return function({r:t,g:e,b:i,a:n}){t/=255,e/=255,i/=255;const s=Math.max(t,e,i),o=s-Math.min(t,e,i);let l=o&&(s==t?(e-i)/o:s==e?2+(i-t)/o:4+(t-e)/o);return l=60*(l<0?l+6:l),{h:l,s:s&&o/s,v:s,a:n}}(t)}if(!0===Jr(t))switch(e){case"hex":return iu(t);case"rgb":return tu(t);case"hsl":return t;case"hsv":return Xr(t)}if(!0===function(t){return vt(t)&&"h"in t&&"s"in t&&"v"in t}(t))switch(e){case"hex":return iu(Gr(t));case"rgb":return function({h:t,s:e,v:i,a:n}){const s=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return{r:255*s(5),g:255*s(3),b:255*s(1),a:n}}(t);case"hsl":return Gr(t);case"hsv":return t}throw new Error(`Invalid color conversion: ${JSON.stringify(t)} -> ${e}`)}function lu(t){let e;if(!t||"string"!=typeof t)return!1;if(!0===Kr(t))return"#"!==t[0]&&(t="#"+t),t;if(e=t.match(Hr)){const t={r:Number(e[1]),g:Number(e[3]),b:Number(e[5]),a:Number(e[7]||1)};return"%"===e[2]&&(t.r=Math.ceil(2.55*t.r)),"%"===e[4]&&(t.g=Math.ceil(2.55*t.g)),"%"===e[6]&&(t.b=Math.ceil(2.55*t.b)),"%"===e[8]&&(t.a=t.a/100),t}if(e=t.match(Vr)){let[t,i,n,s,o]=e.slice(1);const l={h:su(t,i),s:Number(n)/100,l:Number(s)/100,a:Number(o||1)};return"%"===e[6]&&(l.a=l.a/100),l}return null}const au={convert:ou,parse:lu,parseAs:function(t,e){const i=lu(t);return i&&e?ou(i,e):i},toString:function(t,e,i=!0){var n,s;let o=t;if("string"==typeof o&&(o=lu(t)),o&&e&&(o=ou(o,e)),!0===Kr(o))return!0!==i&&(5===o.length?o=o.slice(0,4):o.length>7&&(o=o.slice(0,7))),o.toLowerCase();if(!0===Wr(o)){const t=o.r.toFixed(),e=o.g.toFixed(),s=o.b.toFixed(),l=null==(n=o.a)?void 0:n.toFixed(2);return i&&l&&l<1?`rgb(${t} ${e} ${s} / ${l})`:`rgb(${t} ${e} ${s})`}if(!0===Jr(o)){const t=o.h.toFixed(),e=(100*o.s).toFixed(),n=(100*o.l).toFixed(),l=null==(s=o.a)?void 0:s.toFixed(2);return i&&l&&l<1?`hsl(${t} ${e}% ${n}% / ${l})`:`hsl(${t} ${e}% ${n}%)`}throw new Error(`Unsupported color: ${JSON.stringify(t)}`)}};T.extend(B),T.extend(((t,e,i)=>{i.interpret=(t,e="date")=>{const n={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 YYYY":!0,"MMM DD":!1,"MMM D":!1,"MM YYYY":!0,"M YYYY":!0,"MMMM DD YYYY":!0,"MMMM D YYYY":!0,"MMMM DD YY":!0,"MMMM D YY":!0,"MMMM DD, YYYY":!0,"MMMM D, YYYY":!0,"MMMM DD, YY":!0,"MMMM D, YY":!0,"MMMM DD. YYYY":!0,"MMMM D. YYYY":!0,"MMMM DD. YY":!0,"MMMM D. YY":!0,DDMMYYYY:!0,DDMMYY:!0,"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:{"HHmmss a":!1,"HHmm a":!1,"HH a":!1,HHmmss:!1,HHmm:!1,"HH:mm:ss a":!1,"HH:mm:ss":!1,"HH:mm a":!1,"HH:mm":!1,HH:!1}};if("string"==typeof t&&""!==t)for(const s in n[e]){const o=i(t,s,n[e][s]);if(!0===o.isValid())return o}return null}})),T.extend(((t,e,i)=>{const n=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(n(t))},i.iso=function(t,e){e&&(e=n(e)),e??(e=[n("datetime"),n("date"),n("time")]);const s=i(t,e);return s&&s.isValid()?s:null}})),T.extend(((t,e)=>{e.prototype.merge=function(t,e="date"){let i=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.hasOwn(t,e))throw new Error("Invalid merge unit alias");e=t[e]}for(const n of e)i=i.set(n,t.get(n));return i}})),T.extend(((t,e,i)=>{i.pattern=t=>new class{constructor(t,e){this.dayjs=t,this.pattern=e;const i={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 n=this.pattern.indexOf(t);return{index:e,unit:Object.keys(i)[Object.values(i).findIndex((e=>e.includes(t)))],start:n,end:n+(t.length-1)}}))}at(t,e=t){const i=this.parts.filter((i=>i.start<=t&&i.end>=e-1));return i[0]?i[0]:this.parts.filter((e=>e.start<=t)).pop()}format(t){return t&&t.isValid()?t.format(this.pattern):null}}(i,t)})),T.extend(((t,e)=>{e.prototype.round=function(t="date",e=1){const i=["second","minute","hour","date","month","year"];if("day"===t&&(t="date"),!1===i.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 n=this.clone();const s=i.indexOf(t),o=i.slice(0,s),l=o.pop();for(const a of o)n=n.startOf(a);if(l){const e={month:12,date:n.daysInMonth(),hour:24,minute:60,second:60}[l];Math.round(n.get(l)/e)*e===e&&(n=n.add(1,"date"===t?"day":t)),n=n.startOf(t)}return n=n.set(t,Math.round(n.get(t)/e)*e),n}})),T.extend(((t,e,i)=>{e.prototype.validate=function(t,e,n="day"){if(!this.isValid())return!1;if(!t)return!0;t=i.iso(t);const s={min:"isAfter",max:"isBefore"}[e];return this.isSame(t,n)||this[s](t,n)}}));const ru={install(t){t.prototype.$library={autosize:q,colors:au,dayjs:T}}},uu=()=>({close(){sessionStorage.setItem("kirby$activation$card","true"),this.isOpen=!1},isOpen:"true"!==sessionStorage.getItem("kirby$activation$card"),open(){sessionStorage.removeItem("kirby$activation$card"),this.isOpen=!0}}),cu=t=>({async changeName(e,i,n){return t.patch(this.url(e,i,"name"),{name:n})},async delete(e,i){return t.delete(this.url(e,i))},async get(e,i,n){let s=await t.get(this.url(e,i),n);return!0===Array.isArray(s.content)&&(s.content={}),s},id:t=>!0===t.startsWith("/@/file/")?t.replace("/@/file/","@"):!0===t.startsWith("file://")?t.replace("file://","@"):t,link(t,e,i){return"/"+this.url(t,e,i)},async update(e,i,n){return t.patch(this.url(e,i),n)},url(t,e,i){let n="files/"+this.id(e);return t&&(n=t+"/"+n),i&&(n+="/"+i),n}}),du=t=>({async blueprint(e){return t.get("pages/"+this.id(e)+"/blueprint")},async blueprints(e,i){return t.get("pages/"+this.id(e)+"/blueprints",{section:i})},async changeSlug(e,i){return t.patch("pages/"+this.id(e)+"/slug",{slug:i})},async changeStatus(e,i,n){return t.patch("pages/"+this.id(e)+"/status",{status:i,position:n})},async changeTemplate(e,i){return t.patch("pages/"+this.id(e)+"/template",{template:i})},async changeTitle(e,i){return t.patch("pages/"+this.id(e)+"/title",{title:i})},async children(e,i){return t.post("pages/"+this.id(e)+"/children/search",i)},async create(e,i){return null===e||"/"===e?t.post("site/children",i):t.post("pages/"+this.id(e)+"/children",i)},async delete(e,i){return t.delete("pages/"+this.id(e),i)},async duplicate(e,i,n){return t.post("pages/"+this.id(e)+"/duplicate",{slug:i,children:n.children??!1,files:n.files??!1})},async get(e,i){let n=await t.get("pages/"+this.id(e),i);return!0===Array.isArray(n.content)&&(n.content={}),n},id:t=>!0===t.startsWith("/@/page/")?t.replace("/@/page/","@"):!0===t.startsWith("page://")?t.replace("page://","@"):t.replace(/\//g,"+"),async files(e,i){return t.post("pages/"+this.id(e)+"/files/search",i)},link(t){return"/"+this.url(t)},async preview(t){return(await this.get(this.id(t),{select:"previewUrl"})).previewUrl},async search(e,i){return e?t.post("pages/"+this.id(e)+"/children/search?select=id,title,hasChildren",i):t.post("site/children/search?select=id,title,hasChildren",i)},async update(e,i){return t.patch("pages/"+this.id(e),i)},url(t,e){let i=null===t?"pages":"pages/"+String(t).replace(/\//g,"+");return e&&(i+="/"+e),i}});class pu extends Error{constructor(t,{request:e,response:i,cause:n}){super(i.json.message??t,{cause:n}),this.request=e,this.response=i}state(){return this.response.json}}class hu extends pu{}class mu extends pu{state(){return{message:this.message,text:this.response.text}}}const fu=t=>(window.location.href=qr(t),!1),gu=async(t,e={})=>{var i;(e={cache:"no-store",credentials:"same-origin",mode:"same-origin",...e}).body=((i=e.body)instanceof HTMLFormElement&&(i=new FormData(i)),i instanceof FormData&&(i=Object.fromEntries(i)),"object"==typeof i?JSON.stringify(i):i),e.headers=((t={},e={})=>{return{"content-type":"application/json","x-csrf":e.csrf??!1,"x-fiber":!0,"x-fiber-globals":(i=e.globals,!!i&&(!1===Array.isArray(i)?String(i):i.join(","))),"x-fiber-referrer":e.referrer??!1,...$t(t)};var i})(e.headers,e),e.url=Er(t,e.query);const n=new Request(e.url,e);return!1===Tr(n.url)?fu(n.url):await ku(n,await fetch(n))},ku=async(t,e)=>{var i;if(!1===e.headers.get("Content-Type").includes("application/json"))return fu(e.url);try{e.text=await e.text(),e.json=JSON.parse(e.text)}catch(n){throw new mu("Invalid JSON response",{cause:n,request:t,response:e})}if(401===e.status)throw new hu("Unauthenticated",{request:t,response:e});if("error"===(null==(i=e.json)?void 0:i.status))throw e.json;if(!1===e.ok)throw new pu(`The request to ${e.url} failed`,{request:t,response:e});return{request:t,response:e}},bu=t=>({blueprint:async e=>t.get("users/"+e+"/blueprint"),blueprints:async(e,i)=>t.get("users/"+e+"/blueprints",{section:i}),changeEmail:async(e,i)=>t.patch("users/"+e+"/email",{email:i}),changeLanguage:async(e,i)=>t.patch("users/"+e+"/language",{language:i}),changeName:async(e,i)=>t.patch("users/"+e+"/name",{name:i}),changePassword:async(e,i)=>t.patch("users/"+e+"/password",{password:i}),changeRole:async(e,i)=>t.patch("users/"+e+"/role",{role:i}),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,i)=>t.get("users/"+e,i),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,i)=>t.patch("users/"+e,i),url(t,e){let i=t?"users/"+t:"users";return e&&(i+="/"+e),i}}),vu=t=>{const e={csrf:t.system.csrf,endpoint:Cr(t.urls.api,"/"),methodOverwrite:!0,ping:null,requests:[],running:0},i=()=>{clearInterval(e.ping),e.ping=setInterval(e.auth.ping,3e5)};return e.request=async(n,s={},o=!1)=>{const l=n+"/"+JSON.stringify(s);e.requests.push(l),!1===o&&(t.isLoading=!0),e.language=t.language.code;try{return await(t=>async(e,i={})=>{i={cache:"no-store",credentials:"same-origin",mode:"same-origin",headers:{"content-type":"application/json","x-csrf":t.csrf,"x-language":t.language,...$t(i.headers??{})},...i},t.methodOverwrite&&"GET"!==i.method&&"POST"!==i.method&&(i.headers["x-http-method-override"]=i.method,i.method="POST"),i.url=Cr(t.endpoint,"/")+"/"+_r(e,"/");const n=new Request(i.url,i),{response:s}=await ku(n,await fetch(n));let o=s.json;return o.data&&"model"===o.type&&(o=o.data),o})(e)(n,s)}finally{i(),e.requests=e.requests.filter((t=>t!==l)),0===e.requests.length&&(t.isLoading=!1)}},e.auth=(t=>({async login(e){const i={long:e.remember??!1,email:e.email,password:e.password};return t.post("auth/login",i)},logout:async()=>t.post("auth/logout"),ping:async()=>t.post("auth/ping"),user:async e=>t.get("auth",e),verifyCode:async e=>t.post("auth/code",{code:e})}))(e),e.delete=(t=>async(e,i,n,s=!1)=>t.post(e,i,n,"DELETE",s))(e),e.files=cu(e),e.get=(t=>async(e,i,n,s=!1)=>(i&&(e+="?"+Object.keys(i).filter((t=>void 0!==i[t]&&null!==i[t])).map((t=>t+"="+i[t])).join("&")),t.request(e,Object.assign(n??{},{method:"GET"}),s)))(e),e.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,i)=>t.patch("languages/"+e,i)}))(e),e.pages=du(e),e.patch=(t=>async(e,i,n,s=!1)=>t.post(e,i,n,"PATCH",s))(e),e.post=(t=>async(e,i,n,s="POST",o=!1)=>t.request(e,Object.assign(n??{},{method:s,body:JSON.stringify(i)}),o))(e),e.roles=(t=>({list:async e=>t.get("roles",e),get:async e=>t.get("roles/"+e)}))(e),e.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)}))(e),e.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)}))(e),e.translations=(t=>({list:async()=>t.get("translations"),get:async e=>t.get("translations/"+e)}))(e),e.users=bu(e),i(),e},yu=()=>({addEventListener(t,e){"function"==typeof e&&(this.on[t]=e)},addEventListeners(t){if(!1!==vt(t))for(const e in t)this.addEventListener(e,t[e])},emit(t,...e){return this.hasEventListener(t)?this.on[t](...e):()=>{}},hasEventListener(t){return"function"==typeof this.on[t]},listeners(){return this.on},on:{}}),$u=(t,e={})=>({...e,key:()=>t,defaults:()=>e,reset(){return this.set(this.defaults())},set(t){this.validateState(t);for(const e in this.defaults())this[e]=t[e]??this.defaults()[e];return this.state()},state(){const t={};for(const e in this.defaults())t[e]=this[e]??this.defaults()[e];return t},validateState(t){if(!1===vt(t))throw new Error(`Invalid ${this.key()} state`);return!0}}),wu=(t,e,i)=>{const n=$u(e,i);return{...n,...yu(),async load(e,i={}){return!0!==i.silent&&(this.isLoading=!0),await t.open(e,i),this.isLoading=!1,this.addEventListeners(i.on),this.state()},async open(t,e={}){return"function"==typeof e&&(e={on:{submit:e}}),!0===Br(t)?this.load(t,e):(this.set(t),this.addEventListeners(e.on),this.emit("open",t,e),this.state())},async post(e,i={}){var n;if(!this.path)throw new Error(`The ${this.key()} cannot be posted`);this.isLoading=!0,e=e??(null==(n=this.props)?void 0:n.value)??{};try{return await t.post(this.path,e,i)}catch(s){t.error(s)}finally{this.isLoading=!1}return!1},async refresh(e={}){e.url=e.url??this.url();const i=(await t.get(e.url,e))["$"+this.key()];if(i&&i.component===this.component)return this.props=i.props,this.state()},async reload(t={}){if(!this.path)return!1;this.open(this.url(),t)},set(t){return n.set.call(this,t),this.on={},this.addEventListeners(t.on??{}),this.state()},url(){return t.url(this.path,this.query)}}},xu=(t,e,i)=>{const n=wu(t,e,i);return{...n,async cancel(){this.isOpen&&this.emit("cancel"),this.close()},async close(){!1!==this.isOpen&&(this.isOpen=!1,this.emit("close"),this.reset(),0===t.overlays().length&&(document.documentElement.removeAttribute("data-overlay"),document.documentElement.style.removeProperty("--scroll-top")))},focus(t){ur(`.k-${this.key()}-portal`,t)},input(t){!1!==this.isOpen&&(Vue.set(this.props,"value",t),this.emit("input",t))},isOpen:!1,listeners(){return{...this.on,cancel:this.cancel.bind(this),close:this.close.bind(this),input:this.input.bind(this),submit:this.submit.bind(this),success:this.success.bind(this)}},async open(e,i){return!1===this.isOpen&&t.notification.close(),await n.open.call(this,e,i),this.component&&(document.documentElement.setAttribute("data-overlay","true"),document.documentElement.style.setProperty("--scroll-top",window.scrollY+"px"),this.isOpen=!0),this.state()},async submit(t,e={}){if(t=t??this.props.value,this.hasEventListener("submit"))return this.emit("submit",t,e);if(!this.path)return this.close();const i=await this.post(t,e);return!1===vt(i)?i:this.success(i["$"+this.key()]??{})},success(e){return this.hasEventListener("success")?this.emit("success",e):("string"==typeof e&&t.notification.success(e),this.close(),this.successNotification(e),this.successEvents(e),this.successDispatch(e),e.route||e.redirect?this.successRedirect(e):t.view.reload(e.reload),e)},successDispatch(e){if(!1!==vt(e.dispatch))for(const i in e.dispatch){const n=e.dispatch[i];t.app.$store.dispatch(i,!0===Array.isArray(n)?[...n]:n)}},successEvents(e){if(e.event){const i=Array.wrap(e.event);for(const n of i)"string"==typeof n&&t.events.emit(n,e)}!1!==e.emit&&t.events.emit("success",e)},successNotification(e){e.message&&t.notification.success(e.message)},successRedirect(e){const i=e.route??e.redirect;return!!i&&("string"==typeof i?t.open(i):t.open(i.url,i.options))},get value(){var t;return null==(t=this.props)?void 0:t.value}}},_u=t=>{t.events.on("dialog.save",(e=>{var i;null==(i=null==e?void 0:e.preventDefault)||i.call(e),t.dialog.submit()}));const e=xu(t,"dialog",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,legacy:!1,ref:null});return{...e,async close(){this.ref&&(this.ref.visible=!1),e.close.call(this)},async open(t,i={}){return t instanceof window.Vue?this.openComponent(t):("string"==typeof t&&(t=`/dialogs/${t}`),e.open.call(this,t,i))},async openComponent(i){t.deprecated("Dialog components should no longer be used in your templates");const n=await e.open.call(this,{component:i.$options._componentTag,legacy:!0,props:{...i.$attrs,...i.$props},ref:i}),s=this.listeners();for(const t in s)i.$on(t,s[t]);return i.visible=!0,n}}},Cu=()=>({...$u("drag",{type:null,data:{}}),get isDragging(){return null!==this.type},start(t,e){this.type=t,this.data=e},stop(){this.type=null,this.data={}}}),Su=()=>({add(t){if(!t.id)throw new Error("The state needs an ID");!0!==this.has(t.id)&&this.milestones.push(t)},at(t){return this.milestones.at(t)},clear(){this.milestones=[]},get(t=null){return null===t?this.milestones:this.milestones.find((e=>e.id===t))},goto(t){const e=this.index(t);if(-1!==e)return this.milestones=this.milestones.slice(0,e+1),this.milestones[e]},has(t){return void 0!==this.get(t)},index(t){return this.milestones.findIndex((e=>e.id===t))},isEmpty(){return 0===this.milestones.length},last(){return this.milestones.at(-1)},milestones:[],remove(t=null){return null===t?this.removeLast():this.milestones=this.milestones.filter((e=>e.id!==t))},removeLast(){return this.milestones=this.milestones.slice(0,-1)},replace(t,e){-1===t&&(t=this.milestones.length-1),Vue.set(this.milestones,t,e)}}),Ou=t=>{const e=xu(t,"drawer",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,id:null});return t.events.on("drawer.save",(e=>{e.preventDefault(),t.drawer.submit()})),{...e,get breadcrumb(){return this.history.milestones},async close(t){if(!1!==this.isOpen&&(!0===t&&this.history.clear(),void 0===t||t===this.id)){if(this.history.removeLast(),!0!==this.history.isEmpty())return this.open(this.history.last());e.close.call(this)}},goTo(t){const e=this.history.goto(t);void 0!==e&&this.open(e)},history:Su(),get icon(){return this.props.icon??"box"},input(t){Vue.set(this.props,"value",t),this.emit("input",this.props.value)},listeners(){return{...this.on,cancel:this.cancel.bind(this),close:this.close.bind(this),crumb:this.goTo.bind(this),input:this.input.bind(this),submit:this.submit.bind(this),success:this.success.bind(this),tab:this.tab.bind(this)}},async open(t,i={}){"string"==typeof t&&(t=`/drawers/${t}`),await e.open.call(this,t,i),this.tab(t.tab);const n=this.state();return!0===t.replace?this.history.replace(-1,n):this.history.add(n),this.focus(),n},set(t){return e.set.call(this,t),this.id=this.id??Mr(),this.state()},tab(t){const e=this.props.tabs??{};if(!(t=t??Object.keys(e??{})[0]))return!1;Vue.set(this.props,"fields",e[t].fields),Vue.set(this.props,"tab",t),this.emit("tab",t),setTimeout((()=>{this.focus()}))}}},Mu=t=>{const e=wu(t,"dropdown",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null});return{...e,close(){this.emit("close"),this.reset()},open(t,i={}){return"string"==typeof t&&(t=`/dropdowns/${t}`),e.open.call(this,t,i)},openAsync(t,e={}){return async i=>{await this.open(t,e);const n=this.options();if(0===n.length)throw Error("The dropdown is empty");i(n)}},options(){return!1===Array.isArray(this.props.options)?[]:this.props.options.map((e=>e.dialog?(e.click=()=>{const i="string"==typeof e.dialog?e.dialog:e.dialog.url,n="object"==typeof e.dialog?e.dialog:{};return t.app.$dialog(i,n)},e):e))},set(t){return t.options&&(t.props={options:t.options}),e.set.call(this,t)}}},Au=t=>{const e=P();e.on("online",(()=>{t.isOffline=!1})),e.on("offline",(()=>{t.isOffline=!0})),e.on("keydown.cmd.s",(i=>{e.emit(t.context+".save",i)})),e.on("keydown.cmd.shift.f",(()=>t.search())),e.on("keydown.cmd./",(()=>t.search()));const i={document:{blur:!0,click:!1,copy:!0,focus:!0,paste:!0},window:{dragenter:!1,dragexit:!1,dragleave:!1,dragover:!1,drop:!1,keydown:!1,keyup:!1,offline:!1,online:!1,popstate:!1}};return{blur(t){this.emit("blur",t)},click(t){this.emit("click",t)},copy(t){this.emit("copy",t)},dragenter(t){this.entered=t.target,this.prevent(t),this.emit("dragenter",t)},dragexit(t){this.prevent(t),this.entered=null,this.emit("dragexit",t)},dragleave(t){this.prevent(t),this.entered===t.target&&(this.entered=null,this.emit("dragleave",t))},dragover(t){this.prevent(t),this.emit("dragover",t)},drop(t){this.prevent(t),this.entered=null,this.emit("drop",t)},emit:e.emit,entered:null,focus(t){this.emit("focus",t)},keychain(t,e){let i=[t];(e.metaKey||e.ctrlKey)&&i.push("cmd"),!0===e.altKey&&i.push("alt"),!0===e.shiftKey&&i.push("shift");let n=e.key?xr(e.key):null;const s={escape:"esc",arrowUp:"up",arrowDown:"down",arrowLeft:"left",arrowRight:"right"};return s[n]&&(n=s[n]),n&&!1===["alt","control","shift","meta"].includes(n)&&i.push(n),i.join(".")},keydown(t){this.emit(this.keychain("keydown",t),t),this.emit("keydown",t)},keyup(t){this.emit(this.keychain("keyup",t),t),this.emit("keyup",t)},off:e.off,offline(t){this.emit("offline",t)},on:e.on,online(t){this.emit("online",t)},paste(t){this.emit("paste",t)},popstate(t){this.emit("popstate",t)},prevent(t){t.stopPropagation(),t.preventDefault()},subscribe(){for(const t in i.document)document.addEventListener(t,this[t].bind(this),i.document[t]);for(const t in i.window)window.addEventListener(t,this[t].bind(this),i.window[t])},unsubscribe(){for(const t in i.document)document.removeEventListener(t,this[t]);for(const t in i.window)window.removeEventListener(t,this[t])},$on(...t){window.panel.deprecated("`events.$on` will be removed in a future version. Use `events.on` instead."),e.on(...t)},$emit(...t){window.panel.deprecated("`events.$emit` will be removed in a future version. Use `events.emit` instead."),e.emit(...t)},$off(...t){window.panel.deprecated("`events.$off` will be removed in a future version. Use `events.off` instead."),e.off(...t)}}},Iu={interval:null,start(t,e){this.stop(),t&&(this.interval=setInterval(e,t))},stop(){clearInterval(this.interval),this.interval=null}},Du=(t={})=>({...$u("notification",{context:null,details:null,icon:null,isOpen:!1,message:null,theme:null,timeout:null,type:null}),close(){return this.timer.stop(),this.reset(),this.state()},deprecated(t){console.warn("Deprecated: "+t)},error(e){if(e instanceof hu&&t.user.id)return t.redirect("logout");if(e instanceof mu)return this.fatal(e);if(e instanceof pu){const t=Object.values(e.response.json).find((t=>"string"==typeof(null==t?void 0:t.error)));t&&(e.message=t.error)}return"string"==typeof e&&(e={message:e}),e={message:e.message??"Something went wrong",details:e.details??{}},"view"===t.context&&t.dialog.open({component:"k-error-dialog",props:e}),this.open({message:e.message,icon:"alert",theme:"negative",type:"error"})},info(t={}){return"string"==typeof t&&(t={message:t}),this.open({icon:"info",theme:"info",...t})},get isFatal(){return"fatal"===this.type},fatal(t){return"string"==typeof t?this.open({message:t,type:"fatal"}):t instanceof mu?this.open({message:t.response.text,type:"fatal"}):this.open({message:t.message??"Something went wrong",type:"fatal"})},open(e){return this.timer.stop(),"string"==typeof e?this.success(e):("error"!==e.type&&"fatal"!==e.type&&(e.timeout??(e.timeout=4e3)),this.set({context:t.context,...e}),this.isOpen=!0,this.timer.start(this.timeout,(()=>this.close())),this.state())},success(t={}){return"string"==typeof t&&(t={message:t}),this.open({icon:"check",theme:"positive",...t})},timer:Iu}),ju=()=>({...$u("language",{code:null,default:!1,direction:"ltr",name:null,rules:null}),get isDefault(){return this.default}}),Eu=(t,e,i)=>{if(!i.template&&!i.render&&!i.extends)throw new Error(`Neither template nor render method provided. Nor extending a component when loading plugin component "${e}". The component has not been registered.`);return(i=Lu(t,e,i)).template&&(i.render=null),i=Tu(i),!0===dr(e)&&window.console.warn(`Plugin is replacing "${e}"`),t.component(e,i),i},Lu=(t,e,i)=>"string"!=typeof(null==i?void 0:i.extends)?i:!1===dr(i.extends)?(window.console.warn(`Problem with plugin trying to register component "${e}": cannot extend non-existent component "${i.extends}"`),i.extends=null,i):(i.extends=t.options.components[i.extends].extend({options:i,components:{...t.options.components,...i.components??{}}}),i),Tu=t=>{if(!1===Array.isArray(t.mixins))return t;const e={dialog:Et,drawer:fe,section:Nl};return t.mixins=t.mixins.map((t=>"string"==typeof t?e[t]:t)),t},Bu=(t,e={})=>((e={components:{},created:[],icons:{},login:null,textareaButtons:{},use:[],thirdParty:{},writerMarks:{},writerNodes:{},...e}).use=((t,e)=>{if(!1===Array.isArray(e))return[];for(const i of e)t.use(i);return e})(t,e.use),e.components=((t,e)=>{if(!1===vt(e))return;const i={};for(const[s,o]of Object.entries(e))try{i[s]=Eu(t,s,o)}catch(n){window.console.warn(n.message)}return i})(t,e.components),e),qu=t=>{var e;const i=$u("menu",{entries:[],hover:!1,isOpen:!1}),n=null==(e=window.matchMedia)?void 0:e.call(window,"(max-width: 60rem)"),s={...i,blur(t){const e=document.querySelector(".k-panel-menu");if(!e||!1===n.matches)return!1;!1===document.querySelector(".k-panel-menu-proxy").contains(t.target)&&!1===e.contains(t.target)&&this.close()},close(){this.isOpen=!1,!1===n.matches&&localStorage.setItem("kirby$menu",!0)},escape(){if(!1===n.matches)return!1;this.close()},open(){this.isOpen=!0,!1===n.matches&&localStorage.removeItem("kirby$menu")},resize(){if(n.matches)return this.close();null!==localStorage.getItem("kirby$menu")?this.isOpen=!1:this.isOpen=!0},set(t){return this.entries=t,this.resize(),this.state()},toggle(){this.isOpen?this.close():this.open()}};return t.events.on("keydown.esc",s.escape.bind(s)),t.events.on("click",s.blur.bind(s)),null==n||n.addEventListener("change",s.resize.bind(s)),s},Pu=t=>({controller:null,requests:0,get isLoading(){return this.requests>0},open(e){t.menu.escape(),t.dialog.open({component:"k-search-dialog",props:{type:e}})},async query(e,i,n){var s;if(null==(s=this.controller)||s.abort(),this.controller=new AbortController,i.length<2)return{results:null,pagination:{}};this.requests++;try{const{$search:s}=await t.get(`/search/${e}`,{query:{query:i,...n},signal:this.controller.signal});return s}catch(o){if("AbortError"!==o.name)return{results:[],pagination:{}}}finally{this.requests--}}}),Nu=()=>{const t=$u("translation",{code:null,data:{},direction:"ltr",name:null});return{...t,set(e){return t.set.call(this,e),document.documentElement.lang=this.code,document.body.dir=this.direction,this.state()},translate(t,e,i=null){if("string"!=typeof t)return;const n=this.data[t]??i;return"string"!=typeof n?n:Sr(n,e)}}};const zu=t=>{const e=$u("upload",{accept:"*",attributes:{},files:[],max:null,multiple:!0,preview:{},replacing:null,url:null});return{...e,...yu(),input:null,cancel(){this.emit("cancel"),this.completed.length>0&&(this.emit("complete",this.completed),t.view.reload()),this.reset()},get completed(){return this.files.filter((t=>t.completed)).map((t=>t.model))},done(){t.dialog.close(),this.completed.length>0&&(this.emit("done",this.completed),!1===t.drawer.isOpen&&(t.notification.success({context:"view"}),t.view.reload())),this.reset()},findDuplicate(t){return this.files.findLastIndex((e=>e.src.name===t.src.name&&e.src.type===t.src.type&&e.src.size===t.src.size&&e.src.lastModified===t.src.lastModified))},hasUniqueName(t){return this.files.filter((e=>e.name===t.name&&e.extension===t.extension)).length<2},file(t){const e=URL.createObjectURL(t);return{...this.preview,completed:!1,error:null,extension:or(t.name),filename:t.name,id:Mr(),model:null,name:lr(t.name),niceSize:ar(t.size),progress:0,size:t.size,src:t,type:t.type,url:e}},open(e,i){e instanceof FileList?(this.set(i),this.select(e)):this.set(e);const n={component:"k-upload-dialog",props:{preview:this.preview},on:{cancel:()=>this.cancel(),submit:async()=>{t.dialog.isLoading=!0,await this.submit(),t.dialog.isLoading=!1}}};this.replacing&&(n.component="k-upload-replace-dialog",n.props.original=this.replacing),t.dialog.open(n)},pick(t){this.set(t),this.input=document.createElement("input"),this.input.type="file",this.input.classList.add("sr-only"),this.input.value=null,this.input.accept=this.accept,this.input.multiple=this.multiple,this.input.click(),this.input.addEventListener("change",(e=>{!0===(null==t?void 0:t.immediate)?(this.set(t),this.select(e.target.files),this.submit()):this.open(e.target.files,t),this.input.remove()}))},remove(t){this.files=this.files.filter((e=>e.id!==t))},replace(e,i){this.pick({...i,url:t.urls.api+"/"+e.link,accept:"."+e.extension+","+e.mime,multiple:!1,replacing:e})},reset(){e.reset.call(this),this.files.splice(0)},select(t,e){if(this.set(e),t instanceof Event&&(t=t.target.files),t instanceof FileList==!1)throw new Error("Please provide a FileList");t=(t=[...t]).map((t=>this.file(t))),this.files=[...this.files,...t],this.files=this.files.filter(((t,e)=>this.findDuplicate(t)===e)),null!==this.max&&(this.files=this.files.slice(-1*this.max)),this.emit("select",this.files)},set(t){if(t)return e.set.call(this,t),this.on={},this.addEventListeners(t.on??{}),1===this.max&&(this.multiple=!1),!1===this.multiple&&(this.max=1),this.state()},async submit(){var e;if(!this.url)throw new Error("The upload URL is missing");const i=[];for(const n of this.files){if(!0===n.completed)continue;if(!1===this.hasUniqueName(n)){n.error=t.t("error.file.name.unique");continue}n.error=null,n.progress=0;const s={...this.attributes};i.push((async()=>await this.upload(n,s)));const o=null==(e=this.attributes)?void 0:e.sort;null!=o&&this.attributes.sort++}if(await async function(t,e=20){let i=0,n=0;return new Promise((s=>{const o=e=>n=>{t[e]=n,i--,l()},l=()=>{if(i{e.progress=n}});e.completed=!0,e.model=n.data}catch(n){t.error(n,!1),e.error=n.message,e.progress=0}}}},Fu=t=>{const e=wu(t,"view",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,breadcrumb:[],breadcrumbLabel:null,icon:null,id:null,link:null,search:"pages",title:null});return{...e,set(i){e.set.call(this,i),t.title=this.title;const n=this.url().toString();window.location.toString()!==n&&(window.history.pushState(null,null,n),window.scrollTo(0,0))},async submit(){throw new Error("Not yet implemented")}}},Yu={config:{},languages:[],license:"missing",multilang:!1,permissions:{},searches:{},urls:{}},Ru=["dialog","drawer"],Uu=["dropdown","language","menu","notification","system","translation","user"],Hu={create(t={}){return this.isLoading=!1,this.isOffline=!1,this.activation=uu(),this.drag=Cu(),this.events=Au(this),this.searcher=Pu(this),this.upload=zu(this),this.language=ju(),this.menu=qu(this),this.notification=Du(this),this.system=$u("system",{ascii:{},csrf:null,isLocal:null,locales:{},slugs:[],title:null}),this.translation=Nu(),this.user=$u("user",{email:null,id:null,language:null,role:null,username:null}),this.dropdown=Mu(this),this.view=Fu(this),this.drawer=Ou(this),this.dialog=_u(this),this.redirect=fu,this.reload=this.view.reload.bind(this.view),this.t=this.translation.translate.bind(this.translation),this.plugins=Bu(window.Vue,t),this.set(window.fiber),this.api=vu(this),Vue.reactive(this)},get context(){return this.dialog.isOpen?"dialog":this.drawer.isOpen?"drawer":"view"},get debug(){return!0===this.config.debug},deprecated(t){this.notification.deprecated(t)},get direction(){return this.translation.direction},error(t,e=!0){if(!0===this.debug&&console.error(t),!0===e)return this.notification.error(t)},async get(t,e={}){const{response:i}=await this.request(t,{method:"GET",...e});return(null==i?void 0:i.json)??{}},async open(t,e={}){try{if(!1===Br(t))this.set(t);else{this.isLoading=!0;const i=await this.get(t,e);this.set(i),this.isLoading=!1}return this.state()}catch(i){return this.error(i)}},overlays(){const t=[];return!0===this.drawer.isOpen&&t.push("drawer"),!0===this.dialog.isOpen&&t.push("dialog"),t},async post(t,e={},i={}){const{response:n}=await this.request(t,{method:"POST",body:e,...i});return n.json},async request(t,e={}){return gu(t,{referrer:this.view.path,csrf:this.system.csrf,...e})},async search(t,e,i){return void 0===e?this.searcher.open(t):this.searcher.query(t,e,i)},set(t={}){t=Object.fromEntries(Object.entries(t).map((([t,e])=>[t.replace("$",""),e])));for(const e in Yu){const i=t[e]??this[e]??Yu[e];typeof i==typeof Yu[e]&&(this[e]=i)}for(const e of Uu)(vt(t[e])||Array.isArray(t[e]))&&this[e].set(t[e]);for(const e of Ru)if(!0===vt(t[e])){if(t[e].redirect)return this.open(t[e].redirect);this[e].open(t[e])}else void 0!==t[e]&&this[e].close(!0);!0===vt(t.dropdown)?this.dropdown.open(t.dropdown):void 0!==t.dropdown&&this.dropdown.close(),!0===vt(t.view)&&this.view.open(t.view)},state(){const t={};for(const e in Yu)t[e]=this[e]??Yu[e];for(const e of Uu)t[e]=this[e].state();for(const e of Ru)t[e]=this[e].state();return t.dropdown=this.dropdown.state(),t.view=this.view.state(),t},get title(){return document.title},set title(t){!1===wr(this.system.title)&&(t+=" | "+this.system.title),document.title=t},url:(t="",e={},i)=>Er(t,e,i)},Vu=(t,e)=>{localStorage.setItem("kirby$content$"+t,JSON.stringify(e))},Ku={namespaced:!0,state:{current:null,models:{},status:{enabled:!0}},getters:{exists:t=>e=>Object.hasOwn(t.models,e),hasChanges:(t,e)=>t=>yt(e.model(t).changes)>0,isCurrent:t=>e=>t.current===e,id:t=>e=>((e=e??t.current)&&!1===e.includes("?language=")&&(e+="?language="+window.panel.language.code),e),model:(t,e)=>i=>(i=e.id(i),!0===e.exists(i)?t.models[i]:{api:null,originals:{},values:{},changes:{}}),originals:(t,e)=>t=>structuredClone(e.model(t).originals),values:(t,e)=>t=>({...e.originals(t),...e.changes(t)}),changes:(t,e)=>t=>structuredClone(e.model(t).changes)},mutations:{CLEAR(t){for(const e in t.models)t.models[e].changes={};for(const e in localStorage)e.startsWith("kirby$content$")&&localStorage.removeItem(e)},CREATE(t,[e,i]){if(!i)return!1;let n=t.models[e]?t.models[e].changes:i.changes;Vue.set(t.models,e,{api:i.api,originals:i.originals,changes:n??{}})},CURRENT(t,e){t.current=e},MOVE(t,[e,i]){const n=structuredClone(t.models[e]);Vue.del(t.models,e),Vue.set(t.models,i,n);const s=localStorage.getItem("kirby$content$"+e);localStorage.removeItem("kirby$content$"+e),localStorage.setItem("kirby$content$"+i,s)},REMOVE(t,e){Vue.del(t.models,e),localStorage.removeItem("kirby$content$"+e)},REVERT(t,e){t.models[e]&&(Vue.set(t.models[e],"changes",{}),localStorage.removeItem("kirby$content$"+e))},STATUS(t,e){Vue.set(t.status,"enabled",e)},UPDATE(t,[e,i,n]){if(!t.models[e])return!1;void 0===n&&(n=null),n=structuredClone(n);const s=JSON.stringify(n);JSON.stringify(t.models[e].originals[i]??null)==s?Vue.del(t.models[e].changes,i):Vue.set(t.models[e].changes,i,n),Vu(e,{api:t.models[e].api,originals:t.models[e].originals,changes:t.models[e].changes})}},actions:{init(t){for(const e in localStorage)if(e.startsWith("kirby$content$")){const i=e.split("kirby$content$")[1],n=localStorage.getItem("kirby$content$"+i);t.commit("CREATE",[i,JSON.parse(n)])}else if(e.startsWith("kirby$form$")){const i=e.split("kirby$form$")[1],n=localStorage.getItem("kirby$form$"+i);let s=null;try{s=JSON.parse(n)}catch{}if(!s||!s.api)return localStorage.removeItem("kirby$form$"+i),!1;const o={api:s.api,originals:s.originals,changes:s.values};t.commit("CREATE",[i,o]),Vu(i,o),localStorage.removeItem("kirby$form$"+i)}},clear(t){t.commit("CLEAR")},create(t,e){const i=structuredClone(e.content);if(Array.isArray(e.ignore))for(const s of e.ignore)delete i[s];e.id=t.getters.id(e.id);const n={api:e.api,originals:i,changes:{}};t.commit("CREATE",[e.id,n]),t.dispatch("current",e.id)},current(t,e){e=t.getters.id(e),t.commit("CURRENT",e)},disable(t){t.commit("STATUS",!1)},enable(t){t.commit("STATUS",!0)},move(t,[e,i]){e=t.getters.id(e),i=t.getters.id(i),t.commit("MOVE",[e,i])},remove(t,e){e=t.getters.id(e),t.commit("REMOVE",e),t.getters.isCurrent(e)&&t.commit("CURRENT",null)},revert(t,e){e=t.getters.id(e),t.commit("REVERT",e)},async save(t,e){if(e=t.getters.id(e),t.getters.isCurrent(e)&&!1===t.state.status.enabled)return!1;t.dispatch("disable");const i=t.getters.model(e),n={...i.originals,...i.changes};try{await window.panel.api.patch(i.api,n),t.commit("CREATE",[e,{...i,originals:n}]),t.dispatch("revert",e)}finally{t.dispatch("enable")}},update(t,[e,i,n]){if(n=n??t.state.current,null===e)for(const s in i)t.commit("UPDATE",[n,s,i[s]]);else t.commit("UPDATE",[n,e,i])}}},Wu={namespaced:!0,actions:{close(t,e){window.panel.deprecated("`$store.drawer` will be removed in a future version. Use `$panel.drawer` instead."),window.panel.drawer.close(e)},goto(t,e){window.panel.deprecated("`$store.drawer` will be removed in a future version. Use `$panel.drawer` instead."),window.panel.drawer.goto(e)},open(t,e){window.panel.deprecated("`$store.drawer` will be removed in a future version. Use `$panel.drawer` instead."),window.panel.drawer.goto(e)}}},Ju={namespaced:!0,actions:{close(){window.panel.deprecated("`$store.notification` will be removed in a future version. Use `$panel.notification` instead."),window.panel.notification.close()},deprecated(t,e){window.panel.deprecated("`$store.notification.deprecated` will be removed in a future version. Use `$panel.deprecated` instead."),window.panel.notification.deprecated(e)},error(t,e){window.panel.deprecated("`$store.notification` will be removed in a future version. Use `$panel.notification` instead."),window.panel.notification.error(e)},open(t,e){window.panel.deprecated("`$store.notification` will be removed in a future version. Use `$panel.notification` instead."),window.panel.notification.open(e)},success(t,e){window.panel.deprecated("`$store.notification` will be removed in a future version. Use `$panel.notification` instead."),window.panel.notification.success(e)}}};Vue.use(N);const Gu=new N.Store({strict:!1,actions:{dialog(t,e){window.panel.deprecated("`$store.dialog` will be removed in a future version. Use `$panel.dialog.open()` instead."),window.panel.dialog.open(e)},drag(t,e){window.panel.deprecated("`$store.drag` will be removed in a future version. Use `$panel.drag.start(type, data)` instead."),window.panel.drag.start(...e)},fatal(t,e){window.panel.deprecated("`$store.fatal` will be removed in a future version. Use `$panel.notification.fatal()` instead."),window.panel.notification.fatal(e)},isLoading(t,e){window.panel.deprecated("`$store.isLoading` will be removed in a future version. Use `$panel.isLoading` instead."),window.panel.isLoading=e},navigate(){window.panel.deprecated("`$store.navigate` will be removed in a future version."),window.panel.dialog.close(),window.panel.drawer.close()}},modules:{content:Ku,drawers:Wu,notification:Ju}});Vue.config.productionTip=!1,Vue.config.devtools=!0,Vue.use(zr),Vue.use(ru),Vue.use(z),Vue.use(Ha),window.panel=Vue.prototype.$panel=Hu.create(window.panel.plugins),Vue.prototype.$dialog=window.panel.dialog.open.bind(window.panel.dialog),Vue.prototype.$drawer=window.panel.drawer.open.bind(window.panel.drawer),Vue.prototype.$dropdown=window.panel.dropdown.openAsync.bind(window.panel.dropdown),Vue.prototype.$go=window.panel.view.open.bind(window.panel.view),Vue.prototype.$reload=window.panel.reload.bind(window.panel),window.panel.app=new Vue({store:Gu,render:()=>Vue.h(R)}),Vue.use(Fr),Vue.use(Va),Vue.use(Yr),!1===CSS.supports("container","foo / inline-size")&&Y((()=>import("./container-query-polyfill.modern.min.js")),[],import.meta.url),window.panel.app.$mount("#app");export{ut as n}; +import{v as t,I as e,P as i,S as s,F as n,N as o,s as a,l as r,w as l,a as c,b as u,c as d,e as p,t as h,d as m,f,g,h as k,i as b,k as v,D as y,j as $,E as w,m as x,n as _,o as C,T as S,u as O,p as M,q as A,r as I,x as D,y as j,z as E,A as L,B as T,C as B,G as q,H as P,J as N,V as z}from"./vendor.min.js";const F={},Y=function(t,e,i){let s=Promise.resolve();if(e&&e.length>0){const t=document.getElementsByTagName("link"),n=document.querySelector("meta[property=csp-nonce]"),o=(null==n?void 0:n.nonce)||(null==n?void 0:n.getAttribute("nonce"));s=Promise.allSettled(e.map((e=>{if(e=function(t,e){return new URL(t,e).href}(e,i),e in F)return;F[e]=!0;const s=e.endsWith(".css"),n=s?'[rel="stylesheet"]':"";if(!!i)for(let i=t.length-1;i>=0;i--){const n=t[i];if(n.href===e&&(!s||"stylesheet"===n.rel))return}else if(document.querySelector(`link[href="${e}"]${n}`))return;const a=document.createElement("link");return a.rel=s?"stylesheet":"modulepreload",s||(a.as="script"),a.crossOrigin="",a.href=e,o&&a.setAttribute("nonce",o),document.head.appendChild(a),s?new Promise(((t,i)=>{a.addEventListener("load",t),a.addEventListener("error",(()=>i(new Error(`Unable to preload CSS for ${e}`))))})):void 0})))}function n(t){const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=t,window.dispatchEvent(e),!e.defaultPrevented)throw t}return s.then((e=>{for(const t of e||[])"rejected"===t.status&&n(t.reason);return t().catch(n)}))},R={created(){this.$panel.events.subscribe();for(const t of this.$panel.plugins.created)t(this);this.$panel.events.on("popstate",(()=>{this.$panel.open(window.location.href)})),this.$panel.events.on("drop",(()=>{this.$panel.drag.stop()})),this.$store.dispatch("content/init")},destroyed(){this.$panel.events.unsubscribe()},render(t){if(this.$panel.view.component)return t(this.$panel.view.component,{key:this.$panel.view.component,props:this.$panel.view.props})}},U={props:{after:String}},H={props:{autocomplete:String}},V={props:{autofocus:Boolean}},K={props:{before:String}},W={props:{disabled:Boolean}},J={props:{font:String}},G={props:{help:String}},X={props:{id:{type:[Number,String],default(){return this._uid}}}},Z={props:{invalid:Boolean}},Q={props:{label:String}},tt={props:{layout:{type:String,default:"list"}}},et={props:{maxlength:Number}},it={props:{minlength:Number}},st={props:{name:[Number,String]}},nt={props:{options:{default:()=>[],type:Array}}},ot={props:{pattern:String}},at={props:{placeholder:[Number,String]}},rt={props:{required:Boolean}},lt={props:{spellcheck:{type:Boolean,default:!0}}};function ct(t,e,i,s,n,o,a,r){var l="function"==typeof t?t.options:t;return e&&(l.render=e,l.staticRenderFns=i,l._compiled=!0),{exports:t,options:l}}const ut={mixins:[tt],inheritAttrs:!1,props:{columns:{type:[Object,Array],default:()=>({})},fields:{type:Object,default:()=>({})},items:{type:Array,default:()=>[]},link:{type:Boolean,default:!0},sortable:Boolean,size:{type:String,default:"medium"},theme:String}};const dt=ct({mixins:[ut],props:{image:{type:[Object,Boolean],default:()=>({})}},emits:["change","hover","item","option","sort"],computed:{dragOptions(){return{sort:this.sortable,disabled:!1===this.sortable,draggable:".k-draggable-item"}},table(){return{columns:this.columns,fields:this.fields,rows:this.items,sortable:this.sortable}}},methods:{onDragStart(t,e){this.$panel.drag.start("text",e)},onOption(t,e,i){this.$emit("option",t,e,i)},imageOptions(t){let e=this.image,i=t.image;return!1!==e&&!1!==i&&("object"!=typeof e&&(e={}),"object"!=typeof i&&(i={}),{...i,...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},scopedSlots:t._u([t.$scopedSlots.options?{key:"options",fn:function({row:e,rowIndex:i}){return[t._t("options",null,null,{item:e,index:i})]}}:null],null,!0)},"k-table",t.table,!1)):e("k-draggable",{staticClass:"k-items",class:"k-"+t.layout+"-items",attrs:{"data-layout":t.layout,"data-size":t.size,handle:!0,list:t.items,options:t.dragOptions},on:{change:function(e){return t.$emit("change",e)},end:function(e){return t.$emit("sort",t.items,e)}}},[t._l(t.items,(function(i,s){return[t._t("default",(function(){return[e("k-item",t._b({key:i.id??s,class:{"k-draggable-item":t.sortable&&i.sortable},attrs:{image:t.imageOptions(i),layout:t.layout,link:!!t.link&&i.link,sortable:t.sortable&&i.sortable,theme:t.theme,width:i.column},on:{click:function(e){return t.$emit("item",i,s)},drag:function(e){return t.onDragStart(e,i.dragText)},option:function(e){return t.onOption(e,i,s)}},nativeOn:{mouseover:function(e){return t.$emit("hover",e,i,s)}},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options",null,null,{item:i,index:s})]},proxy:!0}],null,!0)},"k-item",i,!1))]}),null,{item:i,itemIndex:s})]}))],2)}),[]).exports;const pt=ct({mixins:[ut],props:{empty:{type:Object,default:()=>({})},help:String,pagination:{type:[Boolean,Object],default:!1}},emits:["action","change","empty","item","option","paginate","sort"],computed:{hasPagination(){return!1!==this.pagination&&(!0!==this.paginationOptions.hide&&!(this.pagination.total<=this.pagination.limit))},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"},[0===t.items.length?e("k-empty",t._g(t._b({attrs:{layout:t.layout}},"k-empty",t.empty,!1),t.$listeners.empty?{click:t.onEmpty}:{})):e("k-items",t._b({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,index:i}){return[t._t("options",null,null,{item:e,index:i})]}}],null,!0)},"k-items",{columns:t.columns,fields:t.fields,items:t.items,layout:t.layout,link:t.link,size:t.size,sortable:t.sortable,theme:t.theme},!1)),t.help||t.hasPagination?e("footer",{staticClass:"k-collection-footer"},[e("k-text",{staticClass:"k-help k-collection-help",attrs:{html:t.help}}),t.hasPagination?e("k-pagination",t._b({on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.paginationOptions,!1)):t._e()],1):t._e()],1)}),[]).exports;const ht=ct({mixins:[tt],props:{text:String,icon:String},emits:["click"],computed:{attrs(){const t={button:void 0!==this.$listeners.click,icon:this.icon,theme:"empty"};return"cardlets"!==this.layout&&"cards"!==this.layout||(t.align="center",t.height="var(--item-height-cardlet)"),t}}},(function(){var t=this;return(0,t._self._c)("k-box",t._b({staticClass:"k-empty",nativeOn:{click:function(e){return t.$emit("click",e)}}},"k-box",t.attrs,!1),[t._t("default",(function(){return[t._v(" "+t._s(t.text)+" ")]}))],2)}),[]).exports,mt={mixins:[tt],props:{image:[Object,Boolean],width:{type:String,default:"1/1"}}};const ft=ct({mixins:[mt],inheritAttrs:!1,computed:{attrs(){return{back:this.image.back??"gray-500",cover:!0,...this.image,ratio:"list"===this.layout?"auto":this.image.ratio,size:this.sizes}},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.src?e("k-image-frame",t._b({staticClass:"k-item-image"},"k-image-frame",t.attrs,!1)):e("k-icon-frame",t._b({staticClass:"k-item-image"},"k-icon-frame",t.attrs,!1))}),[]).exports;const gt=ct({mixins:[mt,tt],inheritAttrs:!1,props:{buttons:{type:Array,default:()=>[]},data:Object,info:String,link:{type:[Boolean,String,Function]},options:{type:[Array,Function,String]},sortable:Boolean,target:String,text:String,theme:String},emits:["action","click","drag","option"],computed:{hasFigure(){return!1!==this.image&&this.$helper.object.length(this.image)>0},title(){return this.$helper.string.stripHTML(this.$helper.string.unescapeHTML(this.text)).trim()}},methods:{onOption(t){this.$emit("action",t),this.$emit("option",t)}}},(function(){var t,e=this,i=e._self._c;return i("div",e._b({staticClass:"k-item",class:!!e.layout&&"k-"+e.layout+"-item",attrs:{"data-has-image":e.hasFigure,"data-layout":e.layout,"data-theme":e.theme},on:{click:function(t){return e.$emit("click",t)},dragstart:function(t){return e.$emit("drag",t)}}},"div",e.data,!1),[e._t("image",(function(){return[e.hasFigure?i("k-item-image",{attrs:{image:e.image,layout:e.layout,width:e.width}}):e._e()]})),e.sortable?i("k-sort-handle",{staticClass:"k-item-sort-handle",attrs:{tabindex:"-1"}}):e._e(),i("div",{staticClass:"k-item-content"},[i("h3",{staticClass:"k-item-title",attrs:{title:e.title}},[!1!==e.link?i("k-link",{attrs:{target:e.target,to:e.link}},[i("span",{domProps:{innerHTML:e._s(e.text??"–")}})]):i("span",{domProps:{innerHTML:e._s(e.text??"–")}})],1),e.info?i("p",{staticClass:"k-item-info",domProps:{innerHTML:e._s(e.info)}}):e._e()]),i("div",{staticClass:"k-item-options",attrs:{"data-only-option":!(null==(t=e.buttons)?void 0:t.length)||!e.options&&!e.$slots.options}},[e._l(e.buttons,(function(t,s){return i("k-button",e._b({key:"button-"+s},"k-button",t,!1))})),e._t("options",(function(){return[e.options?i("k-options-dropdown",{staticClass:"k-item-options-dropdown",attrs:{options:e.options},on:{option:e.onOption}}):e._e()]}))],2)],2)}),[]).exports,kt={install(t){t.component("k-collection",pt),t.component("k-empty",ht),t.component("k-item",gt),t.component("k-item-image",ft),t.component("k-items",dt)}};const bt=ct({},(function(){return(0,this._self._c)("div",{staticClass:"k-dialog-body"},[this._t("default")],2)}),[]).exports;function vt(t){return"object"==typeof t&&(null==t?void 0:t.constructor)===Object}function yt(t){return Object.keys(t??{}).length}function $t(t){return Object.keys(t).reduce(((e,i)=>(e[i.toLowerCase()]=t[i],e)),{})}const wt={clone:function(t){if(void 0!==t)return structuredClone(t)},isEmpty:function(t){return null==t||""===t||(!(!vt(t)||0!==yt(t))||0===t.length)},isObject:vt,length:yt,merge:function t(e,i={}){for(const s in i)i[s]instanceof Object&&Object.assign(i[s],t(e[s]??{},i[s]));return Object.assign(e??{},i),e},same:function(t,e){return JSON.stringify(t)===JSON.stringify(e)},toLowerKeys:$t},xt={props:{cancelButton:{default:!0,type:[Boolean,String,Object]},disabled:{default:!1,type:Boolean},icon:{default:"check",type:String},submitButton:{type:[Boolean,String,Object],default:!0},theme:{default:"positive",type:String}}};const _t=ct({mixins:[xt],emits:["cancel"],computed:{cancel(){return this.button(this.cancelButton,{click:()=>this.$emit("cancel"),class:"k-dialog-button-cancel",icon:"cancel",text:this.$t("cancel"),variant:"filled"})},submit(){return this.button(this.submitButton,{class:"k-dialog-button-submit",disabled:this.disabled||this.$panel.dialog.isLoading,icon:this.icon,text:this.$t("confirm"),theme:this.theme,type:"submit",variant:"filled"})}},methods:{button:(t,e)=>"string"==typeof t?{...e,text:t}:!1!==t&&(!1===vt(t)?e:{...e,...t})}},(function(){var t=this,e=t._self._c;return e("k-button-group",{staticClass:"k-dialog-buttons"},[t.cancel?e("k-button",t._b({},"k-button",t.cancel,!1)):t._e(),t.submit?e("k-button",t._b({attrs:{icon:t.$panel.dialog.isLoading?"loader":t.submit.icon}},"k-button",t.submit,!1)):t._e()],1)}),[]).exports,Ct={props:{empty:{default:()=>window.panel.$t("dialog.fields.empty"),type:String},fields:{default:()=>[],type:[Array,Object]},novalidate:{default:!0,type:Boolean},value:{default:()=>({}),type:Object}}};const St=ct({mixins:[Ct],emits:["input","submit"],computed:{hasFields(){return this.$helper.object.length(this.fields)>0}}},(function(){var t=this,e=t._self._c;return t.hasFields?e("k-fieldset",{staticClass:"k-dialog-fields",attrs:{novalidate:t.novalidate,fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[]).exports;const Ot=ct({},(function(){return(0,this._self._c)("footer",{staticClass:"k-dialog-footer"},[this._t("default")],2)}),[]).exports;const Mt=ct({},(function(){var t=this,e=t._self._c;return"dialog"===t.$panel.notification.context?e("k-notification",{staticClass:"k-dialog-notification"}):t._e()}),[]).exports;const At=ct({props:{autofocus:{default:!0,type:Boolean},placeholder:{type:String},value:{type:String}},emits:["search"]},(function(){var t=this;return(0,t._self._c)("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:t.autofocus,placeholder:t.placeholder,value:t.value,icon:"search",type:"search"},on:{input:function(e){return t.$emit("search",e)}}})}),[]).exports,It={props:{empty:{type:String,default:()=>window.panel.$t("dialog.text.empty")},text:{type:String}}};const Dt=ct({mixins:[It]},(function(){var t=this,e=t._self._c;return t.text?e("k-text",{attrs:{html:t.text}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[]).exports,jt={install(t){t.component("k-dialog-body",bt),t.component("k-dialog-buttons",_t),t.component("k-dialog-fields",St),t.component("k-dialog-footer",Ot),t.component("k-dialog-notification",Mt),t.component("k-dialog-search",At),t.component("k-dialog-text",Dt)}},Et={mixins:[xt],props:{size:{default:"default",type:String},visible:{default:!1,type:Boolean}},emits:["cancel","close","input","submit","success"],methods:{cancel(){this.$emit("cancel")},close(){this.$emit("close")},error(t){this.$panel.notification.error(t)},focus(t){this.$panel.dialog.focus(t)},input(t){this.$emit("input",t)},open(){this.$panel.dialog.open(this)},submit(){this.$emit("submit",this.value)},success(t){this.$emit("success",t)}}};const Lt=ct({mixins:[Et]},(function(){var t=this,e=t._self._c;return t.visible?e("portal",{attrs:{to:"dialog"}},[e("form",{staticClass:"k-dialog",class:t.$vnode.data.staticClass,attrs:{"data-has-footer":t.cancelButton||t.submitButton,"data-size":t.size,method:"dialog"},on:{click:function(t){t.stopPropagation()},submit:function(e){return e.preventDefault(),t.$emit("submit")}}},[t._t("header",(function(){return[e("k-dialog-notification")]})),t.$slots.default?e("k-dialog-body",[t._t("default")],2):t._e(),t._t("footer",(function(){return[t.cancelButton||t.submitButton?e("k-dialog-footer",[e("k-dialog-buttons",{attrs:{"cancel-button":t.cancelButton,disabled:t.disabled,icon:t.icon,"submit-button":t.submitButton,theme:t.theme},on:{cancel:function(e){return t.$emit("cancel")}}})],1):t._e()]}))],2)]):t._e()}),[]).exports;const Tt=ct({mixins:[Et],props:{cancelButton:{default:!1},changes:{type:Array},loading:{type:Boolean},size:{default:"medium"},submitButton:{default:!1}},computed:{ids(){return Object.keys(this.store).filter((t=>{var e;return this.$helper.object.length(null==(e=this.store[t])?void 0:e.changes)>0}))},store(){return this.$store.state.content.models}},watch:{ids:{handler(t){this.$panel.dialog.refresh({method:"POST",body:{ids:t}})},immediate:!0}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({staticClass:"k-changes-dialog"},"k-dialog",t.$props,!1),[!1===t.loading?[e("k-headline",[t._v(t._s(t.$t("lock.unsaved")))]),t.changes.length?e("k-items",{attrs:{items:t.changes,layout:"list"}}):e("k-empty",{attrs:{icon:"edit-line"}},[t._v(t._s(t.$t("lock.unsaved.empty")))])]:[e("k-icon",{attrs:{type:"loader"}})]],2)}),[]).exports;const Bt=ct({mixins:[Et,Ct],props:{fields:{default:()=>({href:{label:window.panel.$t("email"),type:"email",icon:"email"},title:{label:window.panel.$t("title"),type:"text",icon:"title"}})},size:{default:"medium"},submitButton:{default:()=>window.panel.$t("insert")}},data(){return{values:{href:"",title:null,...this.value}}},methods:{submit(){this.$emit("submit",this.values)}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",t._b({attrs:{value:t.values},on:{cancel:function(e){return t.$emit("cancel")},input:function(e){t.values=e},submit:t.submit}},"k-form-dialog",t.$props,!1))}),[]).exports;const qt=ct({mixins:[Et],props:{details:[Object,Array],message:String,size:{default:"medium",type:String}},emits:["cancel"],computed:{detailsList(){return Array.fromObject(this.details)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-error-dialog",attrs:{"cancel-button":!1,"submit-button":!1,size:t.size,visible:t.visible},on:{cancel:function(e){return t.$emit("cancel")}}},[e("k-text",[t._v(t._s(t.message))]),t.detailsList.length?e("dl",{staticClass:"k-error-details"},[t._l(t.detailsList,(function(i,s){return[e("dt",{key:"detail-label-"+s},[t._v(" "+t._s(i.label)+" ")]),e("dd",{key:"detail-message-"+s},["object"==typeof i.message?[e("ul",t._l(i.message,(function(i,s){return e("li",{key:s},[t._v(" "+t._s(i)+" ")])})),0)]:[t._v(" "+t._s(i.message)+" ")]],2)]}))],2):t._e()],1)}),[]).exports;const Pt=ct({},(function(){var t=this;return(0,t._self._c)(t.$panel.dialog.component,t._g(t._b({key:t.$panel.dialog.timestamp,tag:"component",attrs:{visible:!0}},"component",t.$panel.dialog.props,!1),t.$panel.dialog.listeners()))}),[]).exports,Nt=(t,e)=>{let i=null;return(...s)=>{clearTimeout(i),i=setTimeout((()=>t.apply(void 0,s)),e)}},zt={props:{delay:{default:200,type:Number},hasSearch:{default:!0,type:Boolean}},data:()=>({query:""}),watch:{query(){!1!==this.hasSearch&&this.search()}},created(){this.search=Nt(this.search,this.delay)},methods:{async search(){console.warn("Search mixin: Please implement a `search` method.")}}},Ft={props:{endpoint:String,empty:Object,fetchParams:Object,item:{type:Function,default:t=>t},max:Number,multiple:{type:Boolean,default:!0},size:{type:String,default:"medium"},value:{type:Array,default:()=>[]}}};const Yt=ct({mixins:[Et,zt,Ft],emits:["cancel","fetched","submit"],data(){return{models:[],selected:this.value.reduce(((t,e)=>({...t,[e]:{id:e}})),{}),pagination:{limit:20,page:1,total:0}}},computed:{items(){return this.models.map(this.item)}},watch:{fetchParams(t,e){!1===this.$helper.object.same(t,e)&&(this.pagination.page=1,this.fetch())}},mounted(){this.fetch()},methods:{async fetch(){const t={page:this.pagination.page,search:this.query,...this.fetchParams};try{this.$panel.dialog.isLoading=!0;const e=await this.$api.get(this.endpoint,t);this.models=e.data,this.pagination=e.pagination,this.$emit("fetched",e)}catch(e){this.$panel.error(e),this.models=[]}finally{this.$panel.dialog.isLoading=!1}},isSelected(t){return void 0!==this.selected[t.id]},paginate(t){this.pagination.page=t.page,this.pagination.limit=t.limit,this.fetch()},submit(){this.$emit("submit",Object.values(this.selected))},async search(){this.pagination.page=0,await this.fetch()},toggle(t){if(!1!==this.multiple&&1!==this.max||(this.selected={}),this.isSelected(t))return Vue.del(this.selected,t.id);this.max&&this.max<=this.$helper.object.length(this.selected)||Vue.set(this.selected,t.id,t)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({staticClass:"k-models-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},"k-dialog",t.$props,!1),[t._t("header"),t.hasSearch?e("k-dialog-search",{attrs:{value:t.query},on:{search:function(e){t.query=e}}}):t._e(),e("k-collection",{attrs:{empty:{...t.empty,text:t.$panel.dialog.isLoading?t.$t("loading"):t.empty.text},items:t.items,link:!1,pagination:{details:!0,dropdown:!1,align:"center",...t.pagination},sortable:!1,layout:"list"},on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:i}){return[e("k-choice-input",{attrs:{checked:t.isSelected(i),type:t.multiple&&1!==t.max?"checkbox":"radio",title:t.isSelected(i)?t.$t("remove"):t.$t("select")},on:{click:function(e){return e.stopPropagation(),t.toggle(i)}}}),t._t("options",null,null,{item:i})]}}],null,!0)})],2)}),[]).exports;const Rt=ct({mixins:[Et,Ft],props:{empty:{type:Object,default:()=>({icon:"image",text:window.panel.$t("dialog.files.empty")})}}},(function(){var t=this;return(0,t._self._c)("k-models-dialog",t._b({on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",e)}}},"k-models-dialog",t.$props,!1))}),[]).exports;const Ut=ct({mixins:[Et,Ct],props:{size:{default:"medium"},submitButton:{default:()=>window.panel.$t("save")},text:{type:String}},emits:["cancel","input","submit"]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-dialog",t.$props,!1),[t._t("default",(function(){return[t.text?e("k-dialog-text",{attrs:{text:t.text}}):t._e(),e("k-dialog-fields",{attrs:{fields:t.fields,novalidate:t.novalidate,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})]}))],2)}),[]).exports;const Ht=ct({extends:Ut,watch:{"value.name"(t){this.fields.code.disabled||this.onNameChanges(t)},"value.code"(t){this.fields.code.disabled||(this.value.code=this.$helper.slug(t,[this.$panel.system.ascii]),this.onCodeChanges(this.value.code))}},methods:{onCodeChanges(t){if(!t)return this.value.locale=null;if(t.length>=2)if(-1!==t.indexOf("-")){let e=t.split("-"),i=[e[0],e[1].toUpperCase()];this.value.locale=i.join("_")}else{let e=this.$panel.system.locales??[];this.value.locale=null==e?void 0:e[t]}},onNameChanges(t){this.value.code=this.$helper.slug(t,[this.value.rules,this.$panel.system.ascii]).substr(0,2)}}},null,null).exports;const Vt=ct({mixins:[{mixins:[Et],props:{license:Object,size:{default:"large"}}}]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-license-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-bar",{staticStyle:{"margin-bottom":"var(--spacing-2)"}},[e("h2",{staticClass:"k-headline"},[t._v(" "+t._s(t.$t("license"))+" ")])]),e("div",{staticClass:"k-table"},[e("table",{staticStyle:{"table-layout":"auto"}},[e("tbody",[e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("type")))]),e("td",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.license.type))])]),t.license.code?e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("license.code")))]),e("td",{staticClass:"k-text",attrs:{"data-mobile":"true"}},[e("code",[t._v(t._s(t.license.code))])])]):t._e(),t.license.info?e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("status")))]),e("td",{attrs:{"data-mobile":"true","data-theme":t.license.theme}},[e("p",{staticClass:"k-license-dialog-status"},[e("k-icon",{attrs:{type:t.license.icon}}),t._v(" "+t._s(t.license.info)+" ")],1)])]):t._e()])])])],1)}),[]).exports;const Kt=ct({mixins:[Et,Ct],props:{fields:{default:()=>({href:{label:window.panel.$t("link"),type:"link",placeholder:window.panel.$t("url.placeholder"),icon:"url"},title:{label:window.panel.$t("title"),type:"text",icon:"title"},target:{label:window.panel.$t("open.newWindow"),type:"toggle",text:[window.panel.$t("no"),window.panel.$t("yes")]}})},size:{default:"medium"},submitButton:{default:()=>window.panel.$t("insert")}},data(){return{values:{href:"",title:null,...this.value,target:Boolean(this.value.target??!1)}}},methods:{submit(){let t="/@/$1/";this.values.href.startsWith("page://")&&window.panel.language.code&&(t="/"+window.panel.language.code+t);const e=this.values.href.replace(/(file|page):\/\//,t);this.$emit("submit",{...this.values,href:e,target:this.values.target?"_blank":null})}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",t._b({attrs:{value:t.values},on:{cancel:function(e){return t.$emit("cancel")},input:function(e){t.values=e},submit:t.submit}},"k-form-dialog",t.$props,!1))}),[]).exports;const Wt=ct({mixins:[Ut],props:{blueprints:{type:Array},size:{default:"medium",type:String},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("save")},template:{type:String}},computed:{templates(){return this.blueprints.map((t=>({text:t.title,value:t.name})))}},methods:{pick(t){this.$panel.dialog.reload({query:{...this.$panel.dialog.query,slug:this.value.slug,template:t,title:this.value.title}})}}},(function(){var t=this,e=t._self._c;return e("k-form-dialog",t._b({ref:"dialog",staticClass:"k-page-create-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-form-dialog",t.$props,!1),[t.templates.length>1?e("k-select-field",{staticClass:"k-page-template-switch",attrs:{empty:!1,label:t.$t("template"),options:t.templates,required:!0,value:t.template},on:{input:function(e){return t.pick(e)}}}):t._e(),e("k-dialog-fields",{attrs:{fields:t.fields,novalidate:t.novalidate,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],1)}),[]).exports;const Jt=ct({mixins:[Et],props:{value:{default:()=>({}),type:Object}},emits:["cancel","input","submit"],methods:{select(t){this.$emit("input",{...this.value,parent:t.value})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-page-move-dialog",attrs:{"submit-button":{icon:"parent",text:t.$t("move")},size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-dialog",t.$props,!1),[e("k-headline",[t._v(t._s(t.$t("page.move")))]),e("div",{staticClass:"k-page-move-parent",attrs:{tabindex:"0","data-autofocus":""}},[e("k-page-tree",{attrs:{current:t.value.parent,move:t.value.move,identifier:"id"},on:{select:t.select}})],1)],1)}),[]).exports;const Gt=ct({mixins:[Et,Ft],props:{empty:{type:Object,default:()=>({icon:"page",text:window.panel.$t("dialog.pages.empty")})}},data:()=>({model:null,parent:null})},(function(){var t=this,e=t._self._c;return e("k-models-dialog",t._b({attrs:{"fetch-params":{parent:t.parent}},on:{cancel:function(e){return t.$emit("cancel")},fetched:function(e){t.model=e.model},submit:function(e){return t.$emit("submit",e)}},scopedSlots:t._u([t.model?{key:"header",fn:function(){return[e("header",{staticClass:"k-pages-dialog-navbar"},[e("k-button",{attrs:{disabled:!t.model.id,title:t.$t("back"),icon:"angle-left"},on:{click:function(e){t.parent=t.model.parent}}}),e("k-headline",[t._v(t._s(t.model.title))])],1)]},proxy:!0}:null,t.model?{key:"options",fn:function({item:i}){return[e("k-button",{staticClass:"k-pages-dialog-option",attrs:{disabled:!i.hasChildren,title:t.$t("open"),icon:"angle-right"},on:{click:function(e){e.stopPropagation(),t.parent=i.id}}})]}}:null],null,!0)},"k-models-dialog",t.$props,!1))}),[]).exports;const Xt=ct({mixins:[{mixins:[Et,It]}]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[t._t("default",(function(){return[e("k-dialog-text",{attrs:{text:t.text}})]}))],2)}),[]).exports;const Zt=ct({mixins:[Xt],props:{icon:{default:"trash"},submitButton:{default:()=>window.panel.$t("delete")},theme:{default:"negative"}}},(function(){var t=this;return(0,t._self._c)("k-text-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-text-dialog",t.$props,!1),[t._t("default")],2)}),[]).exports;const Qt=ct({mixins:[Et],props:{type:String},emits:["cancel"],data:()=>({results:null,pagination:{}}),methods:{focus(){var t;null==(t=this.$refs.search)||t.focus()},navigate(t){t&&(this.$go(t.link),this.close())},async search({type:t,query:e}){const i=await this.$panel.search(t,e);i&&(this.results=i.results,this.pagination=i.pagination)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{staticClass:"k-search-dialog",attrs:{"cancel-button":!1,"submit-button":!1,visible:!0,role:"search",size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[e("k-search-bar",{ref:"search",attrs:{"default-type":t.type??t.$panel.view.search,"is-loading":t.$panel.searcher.isLoading,pagination:t.pagination,results:t.results,types:t.$panel.searches},on:{close:t.close,more:function(e){return t.$go("search",{query:e})},navigate:t.navigate,search:t.search}})],1)}),[]).exports;const te=ct({mixins:[{mixins:[Et,Ct]}],props:{fields:null,qr:{type:String,required:!0},size:{default:"large"},submitButton:{default:()=>({text:window.panel.$t("activate"),icon:"lock",theme:"notice"})}},emits:["cancel","input","submit"]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-dialog-text",{staticClass:"k-totp-dialog-intro",attrs:{text:t.$t("login.totp.enable.intro")}}),e("div",{staticClass:"k-totp-dialog-grid"},[e("div",{staticClass:"k-totp-qrcode"},[e("k-info-field",{attrs:{label:t.$t("login.totp.enable.qr.label"),text:t.qr,help:t.$t("login.totp.enable.qr.help",{secret:t.value.secret}),theme:"passive"}})],1),e("k-dialog-fields",{staticClass:"k-totp-dialog-fields",attrs:{fields:{info:{label:t.$t("login.totp.enable.confirm.headline"),type:"info",text:t.$t("login.totp.enable.confirm.text"),theme:"none"},confirm:{label:t.$t("login.totp.enable.confirm.label"),type:"text",counter:!1,font:"monospace",required:!0,placeholder:t.$t("login.code.placeholder.totp"),help:t.$t("login.totp.enable.confirm.help")},secret:{type:"hidden"}},novalidate:!0,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],1)],1)}),[]).exports;const ee=ct({mixins:[Et],props:{submitButton:{type:[String,Boolean,Object],default:()=>({icon:"upload",text:window.panel.$t("upload")})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-upload-dialog",attrs:{disabled:t.disabled||0===t.$panel.upload.files.length},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-dropzone",{on:{drop:function(e){return t.$panel.upload.select(e)}}},[0===t.$panel.upload.files.length?e("k-empty",{attrs:{icon:"upload",layout:"cards"},on:{click:function(e){return t.$panel.upload.pick()}}},[t._v(" "+t._s(t.$t("files.empty"))+" ")]):e("k-upload-items",{attrs:{items:t.$panel.upload.files},on:{remove:e=>{t.$panel.upload.remove(e.id)},rename:(t,e)=>{t.name=e}}})],1)],1)}),[]).exports;const ie=ct({extends:ee,props:{original:Object,submitButton:{type:[String,Boolean,Object],default:()=>({icon:"upload",text:window.panel.$t("replace")})}},computed:{file(){return this.$panel.upload.files[0]}}},(function(){var t,e,i,s,n=this,o=n._self._c;return o("k-dialog",n._b({ref:"dialog",staticClass:"k-upload-dialog k-upload-replace-dialog",on:{cancel:function(t){return n.$emit("cancel")},submit:function(t){return n.$emit("submit")}}},"k-dialog",n.$props,!1),[o("ul",{staticClass:"k-upload-items"},[o("li",{staticClass:"k-upload-original"},[o("k-upload-item-preview",{attrs:{color:null==(t=n.original.image)?void 0:t.color,icon:null==(e=n.original.image)?void 0:e.icon,url:n.original.url,type:n.original.mime}})],1),o("li",[n._v("←")]),o("k-upload-item",n._b({attrs:{color:null==(i=n.original.image)?void 0:i.color,editable:!1,icon:null==(s=n.original.image)?void 0:s.icon,name:n.$helper.file.name(n.original.filename),removable:!1}},"k-upload-item",n.file,!1))],1)])}),[]).exports;const se=ct({mixins:[Et,Ft],props:{empty:{type:Object,default:()=>({icon:"users",text:window.panel.$t("dialog.users.empty")})},item:{type:Function,default:t=>({...t,key:t.email,info:t.info!==t.text?t.info:null})}}},(function(){var t=this;return(0,t._self._c)("k-models-dialog",t._b({on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",e)}}},"k-models-dialog",t.$props,!1))}),[]).exports,ne={install(t){t.use(jt),t.component("k-dialog",Lt),t.component("k-changes-dialog",Tt),t.component("k-email-dialog",Bt),t.component("k-error-dialog",qt),t.component("k-fiber-dialog",Pt),t.component("k-files-dialog",Rt),t.component("k-form-dialog",Ut),t.component("k-license-dialog",Vt),t.component("k-link-dialog",Kt),t.component("k-language-dialog",Ht),t.component("k-models-dialog",Yt),t.component("k-page-create-dialog",Wt),t.component("k-page-move-dialog",Jt),t.component("k-pages-dialog",Gt),t.component("k-remove-dialog",Zt),t.component("k-search-dialog",Qt),t.component("k-text-dialog",Xt),t.component("k-totp-dialog",te),t.component("k-upload-dialog",ee),t.component("k-upload-replace-dialog",ie),t.component("k-users-dialog",se)}};const oe=ct({},(function(){return(0,this._self._c)("div",{staticClass:"k-drawer-body scroll-y-auto"},[this._t("default")],2)}),[]).exports,ae={props:{empty:{type:String,default:()=>window.panel.$t("drawer.fields.empty")},fields:Object,novalidate:{type:Boolean,default:!0},value:Object}};const re=ct({mixins:[ae],emits:["input","submit"],computed:{hasFields(){return this.$helper.object.length(this.fields)>0}}},(function(){var t=this,e=t._self._c;return t.hasFields?e("k-fieldset",{staticClass:"k-drawer-fields",attrs:{novalidate:t.novalidate,fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[]).exports,le={props:{breadcrumb:{default:()=>[],type:Array},tab:{type:String},tabs:{default:()=>({}),type:Object}}};const ce=ct({mixins:[le],emits:["crumb","tab"]},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-drawer-header"},[e("nav",{staticClass:"k-breadcrumb k-drawer-breadcrumb"},[e("ol",t._l(t.breadcrumb,(function(i,s){return e("li",{key:i.id},[e("k-button",{staticClass:"k-breadcrumb-link",attrs:{icon:i.props.icon,text:i.props.title,current:s===t.breadcrumb.length-1,variant:"dimmed"},on:{click:function(e){return t.$emit("crumb",i.id)}}})],1)})),0)]),e("k-drawer-tabs",{attrs:{tab:t.tab,tabs:t.tabs},on:{open:function(e){return t.$emit("tab",e)}}}),e("nav",{staticClass:"k-drawer-options"},[t._t("default"),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"check",type:"submit"}})],2)],1)}),[]).exports;const ue=ct({},(function(){var t=this,e=t._self._c;return"drawer"===t.$panel.notification.context?e("k-notification",{staticClass:"k-drawer-notification"}):t._e()}),[]).exports;const de=ct({mixins:[{props:{tab:{type:String},tabs:{default:()=>({}),type:[Array,Object]}}}],emits:["open"],computed:{hasTabs(){return this.$helper.object.length(this.tabs)>1}}},(function(){var t=this,e=t._self._c;return t.hasTabs?e("nav",{staticClass:"k-drawer-tabs"},t._l(t.tabs,(function(i){return e("k-button",{key:i.name,staticClass:"k-drawer-tab",attrs:{current:t.tab===i.name,text:i.label},on:{click:function(e){return t.$emit("open",i.name)}}})})),1):t._e()}),[]).exports,pe={props:{empty:{type:String,default:()=>window.panel.$t("drawer.text.empty")},text:{type:String}}};const he=ct({mixins:[pe]},(function(){var t=this,e=t._self._c;return t.text?e("k-text",{attrs:{html:t.text}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[]).exports,me={install(t){t.component("k-drawer-body",oe),t.component("k-drawer-fields",re),t.component("k-drawer-header",ce),t.component("k-drawer-notification",ue),t.component("k-drawer-tabs",de),t.component("k-drawer-text",he)}},fe={mixins:[le],props:{disabled:{default:!1,type:Boolean},icon:String,id:String,options:{type:Array},title:String,visible:{default:!1,type:Boolean}}};const ge=ct({mixins:[fe],emits:["cancel","crumb","submit","tab"]},(function(){var t=this,e=t._self._c;return t.visible?e("portal",{attrs:{to:"drawer"}},[e("form",{staticClass:"k-drawer",class:t.$vnode.data.staticClass,attrs:{"aria-disabled":t.disabled,method:"dialog"},on:{submit:function(e){return e.preventDefault(),t.$emit("submit")}}},[e("k-drawer-notification"),e("k-drawer-header",{attrs:{breadcrumb:t.breadcrumb,tab:t.tab,tabs:t.tabs},on:{crumb:function(e){return t.$emit("crumb",e)},tab:function(e){return t.$emit("tab",e)}}},[t._t("options",(function(){return[t._l(t.options,(function(i,s){return[i.dropdown?[e("k-button",t._b({key:"btn-"+s,staticClass:"k-drawer-option",on:{click:function(e){t.$refs["dropdown-"+s][0].toggle()}}},"k-button",i,!1)),e("k-dropdown-content",{key:"dropdown-"+s,ref:"dropdown-"+s,refInFor:!0,attrs:{options:i.dropdown,"align-x":"end",theme:"light"}})]:e("k-button",t._b({key:s,staticClass:"k-drawer-option"},"k-button",i,!1))]}))]}))],2),e("k-drawer-body",[t._t("default")],2)],1)]):t._e()}),[]).exports,ke={props:{hidden:{type:Boolean},next:{type:Object},prev:{type:Object}}};const be=ct({mixins:[fe,ae,ke],emits:["cancel","crumb","input","next","prev","remove","show","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-form-drawer",t._b({ref:"drawer",staticClass:"k-block-drawer",on:{cancel:function(e){return t.$emit("cancel",e)},crumb:function(e){return t.$emit("crumb",e)},input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)},tab:function(e){return t.$emit("tab",e)}},scopedSlots:t._u([{key:"options",fn:function(){return[t.hidden?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 t.$emit("prev")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return t.$emit("next")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return t.$emit("remove")}}})]},proxy:!0}])},"k-form-drawer",t.$props,!1))}),[]).exports;const ve=ct({methods:{isCurrent(t){return this.$panel.drawer.id===t}}},(function(){var t=this,e=t._self._c;return e("div",t._l(t.$panel.drawer.history.milestones,(function(i){return e(i.component,t._g(t._b({key:i.id,tag:"component",attrs:{breadcrumb:t.$panel.drawer.breadcrumb,disabled:!1===t.isCurrent(i.id),visible:!0}},"component",t.isCurrent(i.id)?t.$panel.drawer.props:i.props,!1),t.isCurrent(i.id)?t.$panel.drawer.listeners():i.on))})),1)}),[]).exports;const ye=ct({mixins:[fe,ae],emits:["cancel","crumb","input","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-drawer",t._b({ref:"drawer",staticClass:"k-form-drawer",on:{cancel:function(e){return t.$emit("cancel")},crumb:function(e){return t.$emit("crumb",e)},submit:function(e){return t.$emit("submit",t.value)},tab:function(e){return t.$emit("tab",e)}}},"k-drawer",t.$props,!1),[t._t("options",null,{slot:"options"}),e("k-drawer-fields",{attrs:{fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],2)}),[]).exports;const $e=ct({mixins:[fe,ae,{props:{next:{type:Object},prev:{type:Object}}}],emits:["cancel","crumb","input","next","prev","remove","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-form-drawer",t._b({ref:"drawer",staticClass:"k-structure-drawer",on:{cancel:function(e){return t.$emit("cancel",e)},crumb:function(e){return t.$emit("crumb",e)},input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)},tab:function(e){return t.$emit("tab",e)}},scopedSlots:t._u([{key:"options",fn:function(){return[e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.prev,icon:"angle-left"},on:{click:function(e){return t.$emit("prev")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return t.$emit("next")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return t.$emit("remove")}}})]},proxy:!0}])},"k-form-drawer",t.$props,!1))}),[]).exports;const we=ct({mixins:[fe,pe],emits:["cancel","crumb","input","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-drawer",t._b({ref:"drawer",staticClass:"k-text-drawer",on:{cancel:function(e){return t.$emit("cancel")},crumb:function(e){return t.$emit("crumb",e)},submit:function(e){return t.$emit("submit",t.value)},tab:function(e){return t.$emit("tab",e)}}},"k-drawer",t.$props,!1),[t._t("options",null,{slot:"options"}),e("k-dialog-text",{attrs:{text:t.text}})],2)}),[]).exports,xe={install(t){t.use(me),t.component("k-drawer",ge),t.component("k-block-drawer",be),t.component("k-fiber-drawer",ve),t.component("k-form-drawer",ye),t.component("k-structure-drawer",$e),t.component("k-text-drawer",we)}};const _e=ct({mounted(){window.panel.deprecated(" will be removed in a future version. Since Kirby 4.0, you don't need it anymore as wrapper element. Use `` as standalone instead.")}},(function(){return(0,this._self._c)("span",{staticClass:"k-dropdown",on:{click:function(t){t.stopPropagation()}}},[this._t("default")],2)}),[]).exports;let Ce=null;const Se=ct({props:{align:{type:String},alignX:{type:String,default:"start"},alignY:{type:String,default:"bottom"},disabled:{type:Boolean,default:!1},navigate:{default:!0,type:Boolean},options:[Array,Function,String],theme:{type:String,default:"dark"}},emits:["action","close","open"],data(){return{axis:{x:this.alignX,y:this.alignY},position:{x:0,y:0},isOpen:!1,items:[],opener:null}},mounted(){this.align&&window.panel.deprecated(": `align` prop will be removed in a future version. Use the `alignX` prop instead.")},methods:{close(){var t;null==(t=this.$refs.dropdown)||t.close()},async fetchOptions(t){return this.options?"string"==typeof this.options?this.$dropdown(this.options)(t):"function"==typeof this.options?this.options(t):Array.isArray(this.options)?t(this.options):void 0:t(this.items)},focus(t=0){this.$refs.navigate.focus(t)},onClick(){this.close()},onClose(){this.resetPosition(),this.isOpen=Ce=!1,this.$emit("close"),window.removeEventListener("resize",this.setPosition)},async onOpen(){this.isOpen=!0;const t=window.scrollY;Ce=this,await this.$nextTick(),this.$el&&this.opener&&(window.addEventListener("resize",this.setPosition),await this.setPosition(),window.scrollTo(0,t),this.$emit("open"))},onOptionClick(t){return this.close(),"function"==typeof t.click?t.click.call(this):"string"==typeof t.click?this.$emit("action",t.click):void(t.click&&(t.click.name&&this.$emit(t.click.name,t.click.payload),t.click.global&&this.$events.emit(t.click.global,t.click.payload)))},open(t){var e,i;if(!0===this.disabled)return!1;Ce&&Ce!==this&&Ce.close(),this.opener=t??(null==(e=window.event)?void 0:e.target.closest("button"))??(null==(i=window.event)?void 0:i.target),this.fetchOptions((t=>{this.items=t,this.onOpen()}))},async setPosition(){this.axis={x:this.alignX??this.align,y:this.alignY},"right"===this.axis.x?this.axis.x="end":"left"===this.axis.x&&(this.axis.x="start"),"rtl"===this.$panel.direction&&("start"===this.axis.x?this.axis.x="end":"end"===this.axis.x&&(this.axis.x="start")),this.opener.$el&&(this.opener=this.opener.$el);const t=this.opener.getBoundingClientRect();this.position.x=t.left+window.scrollX+t.width,this.position.y=t.top+window.scrollY+t.height,!0!==this.$el.open&&this.$el.showModal(),await this.$nextTick();const e=this.$el.getBoundingClientRect(),i=10;"end"===this.axis.x?t.left-e.widthwindow.innerWidth-i&&e.width+ie.top&&(this.axis.y="bottom"):t.top+e.height>window.innerHeight-i&&e.height+i!0===t.default));t.push(this.item(e)),t.push("-");const i=this.languages.filter((t=>!1===t.default));for(const s of i)t.push(this.item(s));return t}},methods:{change(t){this.$reload({query:{language:t.code}})},item(t){return{click:()=>this.change(t),current:t.code===this.language.code,text:t.name}}}},(function(){var t=this,e=t._self._c;return t.languages.length>1?e("div",{staticClass:"k-languages-dropdown"},[e("k-button",{attrs:{dropdown:!0,text:t.code,icon:"translate",responsive:"text",size:"sm",variant:"filled"},on:{click:function(e){return t.$refs.languages.toggle()}}}),e("k-dropdown-content",{ref:"languages",attrs:{options:t.options}})],1):t._e()}),[]).exports;const Ae=ct({props:{align:{type:String,default:"right"},disabled:{type:Boolean},icon:{type:String,default:"dots"},options:{type:[Array,Function,String],default:()=>[]},text:{type:[Boolean,String],default:!0},theme:{type:String,default:"dark"},size:String,variant:String},emits:["action","option"],computed:{hasSingleOption(){return Array.isArray(this.options)&&1===this.options.length}},methods:{onAction(t,e,i){"function"==typeof t?t.call(this):(this.$emit("action",t,e,i),this.$emit("option",t,e,i))},toggle(t=this.$el){this.$refs.options.toggle(t)}}},(function(){var t=this,e=t._self._c;return t.hasSingleOption?e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{disabled:t.disabled,icon:t.options[0].icon??t.icon,size:t.options[0].size??t.size,title:t.options[0].title??t.options[0].tooltip??t.options[0].text,variant:t.options[0].variant??t.variant},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("div",{staticClass:"k-options-dropdown"},[e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{disabled:t.disabled,dropdown:!0,icon:t.icon,size:t.size,text:!0!==t.text&&!1!==t.text?t.text:null,title:t.$t("options"),variant:t.variant},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",staticClass:"k-options-dropdown-content",attrs:{"align-x":t.align,options:t.options},on:{action:t.onAction}})],1):t._e()}),[]).exports,Ie={mixins:[V,W,X,st,rt]},De={mixins:[Ie],inheritAttrs:!1,emits:["input"],methods:{focus(){this.$el.focus()}}},je={mixins:[V,W,nt,rt],props:{ignore:{default:()=>[],type:Array},max:Number,min:Number,search:{default:!0,type:[Object,Boolean]}}},Ee={mixins:[Ie,je],props:{create:{type:[Boolean,Object],default:!1},multiple:{type:Boolean,default:!0},value:{type:[Array,String],default:()=>[]}},emits:["create","escape","input"]};const Le=ct({mixins:[De,Ee],data(){return{display:this.search.display??!0,query:""}},computed:{choices(){let t=this.filteredOptions;return!0!==this.display&&(t=t.slice(0,this.display)),t.map((t=>({...t,disabled:t.disabled||this.isFull&&!1===this.value.includes(t.value),text:this.highlight(t.text)})))},filteredOptions(){if(!(this.query.length<(this.search.min??0)))return this.$helper.array.search(this.options,this.query,{field:"text"})},isFull(){return this.max&&this.value.length>=this.max},placeholder(){return this.search.placeholder?this.search.placeholder:this.options.length>0?this.$t("filter")+"…":this.$t("enter")+"…"},showCreate(){var t;if(!1===this.create)return!1;if(this.isFull)return!1;if(0===this.query.trim().length)return!1;if(!0===this.ignore.includes(this.query))return!1;if(!0===(null==(t=this.create.ignore)?void 0:t.includes(this.query)))return!1;return 0===this.options.filter((t=>t.text===this.query||t.value===this.query)).length},showEmpty(){return!1===this.create&&0===this.filteredOptions.length}},watch:{value:{handler(){this.$emit("invalid",this.$v.$invalid,this.$v)},immediate:!0}},methods:{add(){this.showCreate&&this.$emit("create",this.query)},enter(t){var e;null==(e=t.target)||e.click()},escape(){0===this.query.length?this.$emit("escape"):this.query=""},focus(){var t;this.$refs.search?this.$refs.search.focus():null==(t=this.$refs.options)||t.focus()},highlight(t){if(t=this.$helper.string.stripHTML(t),this.query.length>0){const e=new RegExp(`(${RegExp.escape(this.query)})`,"ig");return t.replace(e,"$1")}return t},input(t){this.$emit("input",t)}},validations(){return{value:{required:!this.required||t.required,minLength:!this.min||t.minLength(this.min),maxLength:!this.max||t.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("k-navigate",{staticClass:"k-picklist-input",attrs:{element:"nav",axis:"y",select:"input[type=search], label, .k-picklist-input-body button"},on:{prev:function(e){return t.$emit("escape")}}},[t.search?e("header",{staticClass:"k-picklist-input-header"},[e("div",{staticClass:"k-picklist-input-search"},[e("k-search-input",{ref:"search",attrs:{autofocus:t.autofocus,disabled:t.disabled,placeholder:t.placeholder,value:t.query},on:{input:function(e){t.query=e}},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"escape",void 0,e.key,void 0)?null:(e.preventDefault(),t.escape.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.add.apply(null,arguments))}]}}),t.showCreate?e("k-button",{staticClass:"k-picklist-input-create",attrs:{icon:"add",size:"xs"},on:{click:t.add}}):t._e()],1)]):t._e(),t.filteredOptions.length?[e("div",{staticClass:"k-picklist-input-body"},[e(t.multiple?"k-checkboxes-input":"k-radio-input",{ref:"options",tag:"component",staticClass:"k-picklist-input-options",attrs:{disabled:t.disabled,options:t.choices,value:t.value},on:{input:t.input},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.enter.apply(null,arguments))}}}),!0!==t.display&&t.filteredOptions.length>t.display?e("k-button",{staticClass:"k-picklist-input-more",attrs:{icon:"angle-down"},on:{click:function(e){t.display=!0}}},[t._v(" "+t._s(t.$t("options.all",{count:t.filteredOptions.length}))+" ")]):t._e()],1)]:t.showEmpty?[e("div",{staticClass:"k-picklist-input-body"},[e("p",{staticClass:"k-picklist-input-empty"},[t._v(" "+t._s(t.$t("options.none"))+" ")])])]:t._e()],2)}),[]).exports;const Te=ct({mixins:[Ee],emits:["create","input"],methods:{close(){this.$refs.dropdown.close()},add(t){this.$emit("create",t)},input(t){this.$emit("input",t)},open(t){this.$refs.dropdown.open(t)},toggle(){this.$refs.dropdown.toggle()}}},(function(){var t=this,e=t._self._c;return e("k-dropdown-content",{ref:"dropdown",staticClass:"k-picklist-dropdown",attrs:{"align-x":"start",disabled:t.disabled,navigate:!1},nativeOn:{click:function(t){t.stopPropagation()}}},[e("k-picklist-input",t._b({on:{create:t.add,input:t.input,escape:function(e){return t.$refs.dropdown.close()}},nativeOn:{click:function(t){t.stopPropagation()}}},"k-picklist-input",t.$props,!1))],1)}),[]).exports,Be={install(t){t.component("k-dropdown",_e),t.component("k-dropdown-content",Se),t.component("k-dropdown-item",Oe),t.component("k-languages-dropdown",Me),t.component("k-options-dropdown",Ae),t.component("k-picklist-dropdown",Te)}};const qe=ct({props:{html:{type:Boolean,default:!1},limit:{type:Number,default:10},skip:{type:Array,default:()=>[]},options:Array,query:String},emits:["leave","search","select"],data:()=>({matches:[],selected:{text:null}}),mounted(){window.panel.deprecated(" will be removed in a future version.")},methods:{close(){this.$refs.dropdown.close()},onSelect(t){this.$emit("select",t),this.$refs.dropdown.close()},search(t){const e=this.options.filter((t=>-1!==this.skip.indexOf(t.value)));this.matches=this.$helper.array.search(e,t,{field:"text",limit:this.limit}),this.$emit("search",t,this.matches),this.$refs.dropdown.open()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-autocomplete"},[t._t("default"),e("k-dropdown-content",{ref:"dropdown",attrs:{autofocus:!0},on:{leave:function(e){return t.$emit("leave")}}},t._l(t.matches,(function(i,s){return e("k-dropdown-item",t._b({key:s,nativeOn:{mousedown:function(e){return t.onSelect(i)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:(e.preventDefault(),t.onSelect(i))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onSelect(i))},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",i,!1),[e("span",{domProps:{innerHTML:t._s(t.html?i.text:t.$esc(i.text))}})])})),1),t._v(" "+t._s(t.query)+" ")],2)}),[]).exports;const Pe=ct({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.min&&t.max?[t._v(t._s(t.min)+"–"+t._s(t.max))]:t.min?[t._v("≥ "+t._s(t.min))]:t.max?[t._v("≤ "+t._s(t.max))]:t._e()],2):t._e()])}),[]).exports;const Ne=ct({props:{disabled:Boolean,config:Object,fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},emits:["focus","input","submit"],data:()=>({errors:{}}),methods:{focus(t){var e,i;null==(i=null==(e=this.$refs.fields)?void 0:e.focus)||i.call(e,t)},onFocus(t,e,i){this.$emit("focus",t,e,i)},onInput(t,e,i){this.$emit("input",t,e,i)},onInvalid(t){this.$emit("invalid",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",{ref:"fields",attrs:{disabled:t.disabled,fields:t.fields,novalidate:t.novalidate,value:t.value},on:{focus:t.onFocus,input:t.onInput,invalid:t.onInvalid,submit:t.onSubmit}})]})),t._t("footer"),e("input",{ref:"submitter",staticClass:"k-form-submitter",attrs:{type:"submit"}})],2)}),[]).exports;const ze=ct({props:{lock:[Boolean,Object]},data:()=>({isLoading:null,isLocking:null}),computed:{api(){return[this.$panel.view.path+"/lock",null,null,!0]},buttons(){return"unlock"===this.mode?[{icon:"check",text:this.$t("lock.isUnlocked"),click:()=>this.resolve()},{icon:"download",text:this.$t("download"),click:()=>this.download()}]:"lock"===this.mode?[{icon:this.lock.data.unlockable?"unlock":"loader",text:this.$t("lock.isLocked",{email:this.$esc(this.lock.data.email)}),title:this.$t("lock.unlock"),disabled:!this.lock.data.unlockable,click:()=>this.unlock()}]:"changes"===this.mode?[{icon:"undo",text:this.$t("revert"),click:()=>this.revert()},{icon:"check",text:this.$t("save"),click:()=>this.save()}]:[]},disabled(){return"unlock"!==this.mode&&("lock"===this.mode?!this.lock.data.unlockable:"changes"===this.mode&&this.isDisabled)},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":"changes"===this.mode?"notice":null}},watch:{hasChanges:{handler(t,e){!0===this.supportsLocking&&!1===this.isLocked&&!1===this.isUnlocked&&(!0===t?(this.locking(),this.isLocking=setInterval(this.locking,3e4)):e&&(clearInterval(this.isLocking),this.locking(!1)))},immediate:!0},isLocked(t){!1===t&&this.$events.emit("model.reload")}},mounted(){this.supportsLocking&&(this.isLoading=setInterval(this.check,1e4)),this.$events.on("view.save",this.save)},destroyed(){clearInterval(this.isLoading),clearInterval(this.isLocking),this.$events.off("view.save",this.save)},methods:{async check(){if(!1===this.$panel.isOffline){const{lock:t}=await this.$api.get(...this.api);Vue.set(this.$panel.view.props,"lock",t)}},download(){let t="";const e=this.$store.getters["content/changes"]();for(const s in e){const i=e[s];t+=s+": \n\n","object"==typeof i&&Object.keys(i).length||Array.isArray(i)&&i.length?t+=JSON.stringify(i,null,2):t+=i,t+="\n\n----\n\n"}let i=document.createElement("a");i.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),i.setAttribute("download",this.$panel.view.path+".txt"),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)},async locking(t=!0){if(!0!==this.$panel.isOffline)if(!0===t)try{await this.$api.patch(...this.api)}catch{clearInterval(this.isLocking),this.$store.dispatch("content/revert")}else clearInterval(this.isLocking),await this.$api.delete(...this.api)},async resolve(){await this.unlock(!1),this.$store.dispatch("content/revert")},revert(){this.$panel.dialog.open({component:"k-remove-dialog",props:{submitButton:{icon:"undo",text:this.$t("revert")},text:this.$t("revert.confirm")},on:{submit:()=>{this.$store.dispatch("content/revert"),this.$panel.dialog.close()}}})},async save(t){var e;null==(e=null==t?void 0:t.preventDefault)||e.call(t),await this.$store.dispatch("content/save"),this.$events.emit("model.update"),this.$panel.notification.success()},async unlock(t=!0){const e=[this.$panel.view.path+"/unlock",null,null,!0];!0!==t?(await this.$api.delete(...e),this.$reload({silent:!0})):this.$panel.dialog.open({component:"k-remove-dialog",props:{submitButton:{icon:"unlock",text:this.$t("lock.unlock")},text:this.$t("lock.unlock.submit",{email:this.$esc(this.lock.data.email)})},on:{submit:async()=>{await this.$api.patch(...e),this.$panel.dialog.close(),this.$reload({silent:!0})}}})}}},(function(){var t=this,e=t._self._c;return t.buttons.length>0?e("k-button-group",{staticClass:"k-form-buttons",attrs:{layout:"collapsed"}},t._l(t.buttons,(function(i){return e("k-button",t._b({key:i.icon,attrs:{size:"sm",variant:"filled",disabled:t.isDisabled,responsive:!0,theme:t.theme}},"k-button",i,!1))})),1):t._e()}),[]).exports,Fe={mixins:[W,G,X,Q,st,rt],props:{counter:[Boolean,Object],endpoints:Object,input:[String,Number],translate:Boolean,type:String}};const Ye=ct({mixins:[Fe],inheritAttrs:!1,emits:["blur","focus"]},(function(){var t=this,e=t._self._c;return e("div",{class:["k-field",`k-field-name-${t.name}`,`k-field-type-${t.type}`],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("k-label",{attrs:{input:t.input,required:t.required,title:t.label,type:"field"}},[t._v(" "+t._s(t.label)+" ")])]})),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-help k-field-help",attrs:{html:t.help}}):t._e()]}))],2):t._e()]}))],2)}),[]).exports;const Re=ct({props:{config:Object,disabled:Boolean,fields:{type:[Array,Object],default:()=>({})},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},emits:["focus","input","invalid","submit"],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]},onInvalid(t,e,i,s){this.errors[s]=e,this.$emit("invalid",this.errors)},onInput(t,e,i){const s=this.value;this.$set(s,i,t),this.$emit("input",s,e,i)},hasErrors(){return this.$helper.object.length(this.errors)>0}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-fieldset"},[e("k-grid",{attrs:{variant:"fields"}},[t._l(t.fields,(function(i,s){return[t.$helper.field.isVisible(i,t.value)?e("k-column",{key:i.signature,attrs:{width:i.width}},[t.hasFieldType(i.type)?e("k-"+i.type+"-field",t._b({ref:s,refInFor:!0,tag:"component",attrs:{disabled:t.disabled||i.disabled,"form-data":t.value,name:s,novalidate:t.novalidate,value:t.value[s]},on:{input:function(e){return t.onInput(e,i,s)},focus:function(e){return t.$emit("focus",e,i,s)},invalid:(e,n)=>t.onInvalid(e,n,i,s),submit:function(e){return t.$emit("submit",e,i,s)}}},"component",i,!1)):e("k-box",{attrs:{theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[t._v(" "+t._s(t.$t("error.field.type.missing",{name:s,type:i.type}))+" ")])],1)],1):t._e()]}))],2)],1)}),[]).exports,Ue={mixins:[U,K,W,Z],inheritAttrs:!1,props:{autofocus:Boolean,type:String,icon:[String,Boolean],novalidate:{type:Boolean,default:!1},value:{type:[String,Boolean,Number,Object,Array],default:null}}};const He=ct({mixins:[Ue],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}}},watch:{invalid(){this.isInvalid=this.invalid}},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 i,s,n;if("INPUT"===(null==(i=null==t?void 0:t.target)?void 0:i.tagName)&&"function"==typeof(null==(s=null==t?void 0:t.target)?void 0:s[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-type":t.type}},[t.$slots.before||t.before?e("span",{staticClass:"k-input-description 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-description 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()])}),[]).exports;const Ve=ct({props:{accept:{type:String,default:"*"},attributes:{type:Object},max:{type:Number},method:{type:String,default:"POST"},multiple:{type:Boolean,default:!0},url:{type:String}},emits:["success"],methods:{open(t){window.panel.deprecated(" will be removed in a future version. Use `$panel.upload.open()` instead."),this.$panel.upload.pick(this.params(t))},params(t){return{...this.$props,...t??{},on:{complete:(t,e)=>{this.$emit("success",t,e)}}}},select(t){this.$panel.upload.select(t.target.files)},drop(t,e){window.panel.deprecated(" will be removed in a future version. Use `$panel.upload.select()` instead."),this.$panel.upload.open(t,this.params(e))},upload(t,e){window.panel.deprecated(" will be removed in a future version. Use `$panel.upload.select()` instead."),this.$panel.upload.select(t,this.params(e)),this.$panel.upload.start()}},render:()=>""},null,null).exports,Ke={props:{content:{default:()=>({}),type:[Array,Object]},fieldset:{default:()=>({}),type:Object}}};const We=ct({mixins:[Ke],inheritAttrs:!1,computed:{icon(){return this.fieldset.icon??"box"},label(){if(!this.fieldset.label||0===this.fieldset.label.length)return!1;if(this.fieldset.label===this.name)return!1;let t=this.$helper.string.template(this.fieldset.label,this.content);return"…"!==t&&(t=this.$helper.string.stripHTML(t),this.$helper.string.unescapeHTML(t))},name(){return this.fieldset.name??this.fieldset.label}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-title"},[e("k-icon",{staticClass:"k-block-icon",attrs:{type:t.icon}}),t.name?e("span",{staticClass:"k-block-name"},[t._v(" "+t._s(t.name)+" ")]):t._e(),t.label?e("span",{staticClass:"k-block-label"},[t._v(" "+t._s(t.label)+" ")]):t._e()],1)}),[]).exports,Je={mixins:[Ke,W],props:{endpoints:{default:()=>({}),type:[Array,Object]},id:String}};const Ge=ct({mixins:[Je],inheritAttrs:!1,methods:{field(t,e=null){let i=null;for(const s of Object.values(this.fieldset.tabs??{}))s.fields[t]&&(i=s.fields[t]);return i??e},open(){this.$emit("open")},update(t){this.$emit("update",{...this.content,...t})}}},(function(){var t=this;return(0,t._self._c)("k-block-title",{attrs:{content:t.content,fieldset:t.fieldset},nativeOn:{dblclick:function(e){return t.$emit("open")}}})}),[]).exports,Xe={props:{isBatched:Boolean,isFull:Boolean,isHidden:Boolean,isMergable:Boolean}};const Ze=ct({mixins:[Xe],props:{isEditable:Boolean,isSplitable:Boolean},emits:["chooseToAppend","chooseToConvert","chooseToPrepend","copy","duplicate","hide","merge","open","paste","remove","removeSelected","show","split","sortDown","sortUp"],computed:{buttons(){return this.isBatched?[{icon:"template",title:this.$t("copy"),click:()=>this.$emit("copy")},{when:this.isMergable,icon:"merge",title:this.$t("merge"),click:()=>this.$emit("merge")},{icon:"trash",title:this.$t("remove"),click:()=>this.$emit("removeSelected")}]:[{when:this.isEditable,icon:"edit",title:this.$t("edit"),click:()=>this.$emit("open")},{icon:"add",title:this.$t("insert.after"),disabled:this.isFull,click:()=>this.$emit("chooseToAppend")},{icon:"trash",title:this.$t("delete"),click:()=>this.$emit("remove")},{icon:"sort",title:this.$t("sort.drag"),class:"k-sort-handle",key:t=>this.sort(t)},{icon:"dots",title:this.$t("more"),dropdown:[{icon:"angle-up",label:this.$t("insert.before"),disabled:this.isFull,click:()=>this.$emit("chooseToPrepend")},{icon:"angle-down",label:this.$t("insert.after"),disabled:this.isFull,click:()=>this.$emit("chooseToAppend")},"-",{when:this.isEditable,icon:"edit",label:this.$t("edit"),click:()=>this.$emit("open")},{icon:"refresh",label:this.$t("field.blocks.changeType"),click:()=>this.$emit("chooseToConvert")},{when:this.isSplitable,icon:"split",label:this.$t("split"),click:()=>this.$emit("split")},"-",{icon:"template",label:this.$t("copy"),click:()=>this.$emit("copy")},{icon:"download",label:this.$t("paste.after"),disabled:this.isFull,click:()=>this.$emit("paste")},"-",{icon:this.isHidden?"preview":"hidden",label:this.isHidden?this.$t("show"):this.$t("hide"),click:()=>this.$emit(this.isHidden?"show":"hide")},{icon:"copy",label:this.$t("duplicate"),click:()=>this.$emit("duplicate")},"-",{icon:"trash",label:this.$t("delete"),click:()=>this.$emit("remove")}]}]}},methods:{open(){this.$refs.options.open()},sort(t){switch(t.preventDefault(),t.key){case"ArrowUp":this.$emit("sortUp");break;case"ArrowDown":this.$emit("sortDown")}}}},(function(){return(0,this._self._c)("k-toolbar",{staticClass:"k-block-options",attrs:{buttons:this.buttons},nativeOn:{mousedown:function(t){t.preventDefault()}}})}),[]).exports;const Qe=ct({mixins:[Je,Xe],inheritAttrs:!1,props:{attrs:{default:()=>({}),type:[Array,Object]},isLastSelected:Boolean,isSelected:Boolean,name:String,next:Object,prev:Object,type:String},emits:["append","chooseToAppend","chooseToConvert","chooseToPrepend","close","copy","duplicate","focus","hide","merge","open","paste","prepend","remove","selectDown","selectUp","show","sortDown","sortUp","split","submit","update"],computed:{className(){let t=["k-block-type-"+this.type];return this.fieldset.preview&&this.fieldset.preview!==this.type&&t.push("k-block-type-"+this.fieldset.preview),!1===this.wysiwyg&&t.push("k-block-type-default"),t},containerType(){const t=this.fieldset.preview;return!1!==t&&(t&&this.$helper.isComponent("k-block-type-"+t)?t:!!this.$helper.isComponent("k-block-type-"+this.type)&&this.type)},customComponent(){return this.wysiwyg?this.wysiwygComponent:"k-block-type-default"},isDisabled(){return!0===this.disabled||!0===this.fieldset.disabled},isEditable(){return!1!==this.fieldset.editable},listeners(){return{append:t=>this.$emit("append",t),chooseToAppend:t=>this.$emit("chooseToAppend",t),chooseToConvert:t=>this.$emit("chooseToConvert",t),chooseToPrepend:t=>this.$emit("chooseToPrepend",t),close:()=>this.$emit("close"),copy:()=>this.$emit("copy"),duplicate:()=>this.$emit("duplicate"),focus:()=>this.$emit("focus"),hide:()=>this.$emit("hide"),merge:()=>this.$emit("merge"),open:t=>this.open(t),paste:()=>this.$emit("paste"),prepend:t=>this.$emit("prepend",t),remove:()=>this.remove(),removeSelected:()=>this.$emit("removeSelected"),show:()=>this.$emit("show"),sortDown:()=>this.$emit("sortDown"),sortUp:()=>this.$emit("sortUp"),split:t=>this.$emit("split",t),update:t=>this.$emit("update",t)}},tabs(){const t=this.fieldset.tabs??{};for(const[e,i]of Object.entries(t))for(const[s]of Object.entries(i.fields??{}))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};return t},wysiwyg(){return!1!==this.wysiwygComponent},wysiwygComponent(){return!!this.containerType&&"k-block-type-"+this.containerType}},methods:{backspace(t){if(t.target.matches("[contenteditable], input, textarea"))return!1;t.preventDefault(),this.remove()},close(){this.$panel.drawer.close(this.id)},focus(){var t,e;"function"==typeof(null==(t=this.$refs.editor)?void 0:t.focus)?this.$refs.editor.focus():null==(e=this.$refs.container)||e.focus()},goTo(t){var e;t&&(null==(e=t.$refs.container)||e.focus(),t.open(null,!0))},isSplitable(){var t;return!0!==this.isFull&&(!!this.$refs.editor&&((this.$refs.editor.isSplitable??!0)&&"function"==typeof(null==(t=this.$refs.editor)?void 0:t.split)))},onClose(){this.$emit("close"),this.focus()},onFocus(t){this.disabled||this.$emit("focus",t)},onFocusIn(t){var e,i;this.disabled||(null==(i=null==(e=this.$refs.options)?void 0:e.$el)?void 0:i.contains(t.target))||this.$emit("focus",t)},onInput(t){this.$emit("update",t)},open(t,e=!1){!this.isEditable||this.isBatched||this.isDisabled||(this.$panel.drawer.open({component:"k-block-drawer",id:this.id,tab:t,on:{close:this.onClose,input:this.onInput,next:()=>this.goTo(this.next),prev:()=>this.goTo(this.prev),remove:this.remove,show:this.show,submit:this.submit},props:{hidden:this.isHidden,icon:this.fieldset.icon??"box",next:this.next,prev:this.prev,tabs:this.tabs,title:this.fieldset.name,value:this.content},replace:e}),this.$emit("open"))},remove(){if(this.isBatched)return this.$emit("removeSelected");this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm")},on:{submit:()=>{this.$panel.dialog.close(),this.close(),this.$emit("remove",this.id)}}})},show(){this.$emit("show")},submit(){this.close(),this.$emit("submit")}}},(function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"k-block-container",class:["k-block-container-fieldset-"+t.type,t.containerType?"k-block-container-type-"+t.containerType:""],attrs:{"data-batched":t.isBatched,"data-disabled":t.isDisabled,"data-hidden":t.isHidden,"data-id":t.id,"data-last-selected":t.isLastSelected,"data-selected":t.isSelected,"data-translate":t.fieldset.translate,tabindex:t.isDisabled?null:0},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"j",void 0,e.key,void 0)?null:e.ctrlKey?(e.preventDefault(),e.stopPropagation(),t.$emit("merge")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.altKey?(e.preventDefault(),e.stopPropagation(),t.$emit("selectDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey&&e.altKey?(e.preventDefault(),e.stopPropagation(),t.$emit("selectUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),e.stopPropagation(),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(),e.stopPropagation(),t.$emit("sortUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:e.ctrlKey?(e.stopPropagation(),t.backspace.apply(null,arguments)):null}],focus:function(e){return e.stopPropagation(),t.onFocus.apply(null,arguments)},focusin:function(e){return e.stopPropagation(),t.onFocusIn.apply(null,arguments)}}},[e("div",{staticClass:"k-block",class:t.className,attrs:{"data-disabled":t.isDisabled}},[e(t.customComponent,t._g(t._b({ref:"editor",tag:"component",attrs:{tabs:t.tabs}},"component",t.$props,!1),t.listeners))],1),t.isDisabled?t._e():e("k-block-options",t._g(t._b({ref:"options"},"k-block-options",{isBatched:t.isBatched,isEditable:t.isEditable,isFull:t.isFull,isHidden:t.isHidden,isMergable:t.isMergable,isSplitable:t.isSplitable()},!1),{...t.listeners,split:()=>t.$refs.editor.split(),open:()=>{"function"==typeof t.$refs.editor.open?t.$refs.editor.open():t.open()}}))],1)}),[]).exports,ti={mixins:[V,W,X],props:{empty:String,endpoints:Object,fieldsets:Object,fieldsetGroups:Object,group:String,max:{type:Number,default:null},value:{type:Array,default:()=>[]}},emits:["input"]};const ei=ct({mixins:[ti],inheritAttrs:!1,data(){return{blocks:this.value??[],isEditing:!1,isMultiSelectKey:!1,selected:[]}},computed:{draggableOptions(){return{id:this.id,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 this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.blocks.length},isFull(){return null!==this.max&&this.blocks.length>=this.max},isMergable(){if(this.selected.length<2)return!1;const t=this.selected.map((t=>this.find(t)));return!(new Set(t.map((t=>t.type))).size>1)&&"function"==typeof this.ref(t[0]).$refs.editor.merge}},watch:{value(){this.blocks=this.value}},mounted(){!0===this.$props.autofocus&&setTimeout(this.focus,100),this.$events.on("blur",this.onBlur),this.$events.on("click",this.onClickGlobal),this.$events.on("copy",this.onCopy),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("click",this.onClickGlobal),this.$events.off("copy",this.onCopy),this.$events.off("keydown",this.onKey),this.$events.off("keyup",this.onKey),this.$events.off("paste",this.onPaste)},methods:{async add(t="text",e){const i=await this.$api.get(this.endpoints.field+"/fieldsets/"+t);this.blocks.splice(e,0,i),this.save(),await this.$nextTick(),this.focusOrOpen(i)},choose(t){if(1===this.$helper.object.length(this.fieldsets))return this.add(Object.values(this.fieldsets)[0].type,t);this.$panel.dialog.open({component:"k-block-selector",props:{fieldsetGroups:this.fieldsetGroups,fieldsets:this.fieldsets},on:{submit:e=>{this.add(e,t),this.$panel.dialog.close()},paste:e=>{this.paste(e,t)}}})},chooseToConvert(t){this.$panel.dialog.open({component:"k-block-selector",props:{disabledFieldsets:[t.type],fieldsetGroups:this.fieldsetGroups,fieldsets:this.fieldsets,headline:this.$t("field.blocks.changeType")},on:{submit:e=>{this.convert(e,t),this.$panel.dialog.close()},paste:this.paste}})},copy(t){if(0===this.blocks.length)return!1;if(0===this.selected.length)return!1;let e=[];for(const i of this.blocks)this.selected.includes(i.id)&&e.push(i);if(0===e.length)return!1;this.$helper.clipboard.write(e,t),this.selected=e.map((t=>t.id)),this.$panel.notification.success({message:this.$t("copy.success",{count:e.length}),icon:"template"})},copyAll(){this.selectAll(),this.copy(),this.deselectAll()},async convert(t,e){var i;const s=this.findIndex(e.id);if(-1===s)return!1;const n=t=>{let e={};for(const i of Object.values((null==t?void 0:t.tabs)??{}))e={...e,...i.fields};return e},o=this.blocks[s],a=await this.$api.get(this.endpoints.field+"/fieldsets/"+t),r=this.fieldsets[o.type],l=this.fieldsets[t];if(!l)return!1;let c=a.content;const u=n(l),d=n(r);for(const[p,h]of Object.entries(u)){const t=d[p];(null==t?void 0:t.type)===h.type&&(null==(i=null==o?void 0:o.content)?void 0:i[p])&&(c[p]=o.content[p])}this.blocks[s]={...a,id:o.id,content:c},this.save()},deselect(t){const e=this.selected.findIndex((e=>e===t.id));-1!==e&&this.selected.splice(e,1)},deselectAll(){this.selected=[]},async duplicate(t,e){const i={...structuredClone(t),id:this.$helper.uuid()};this.blocks.splice(e+1,0,i),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){const e=this.ref(t);this.selected=[(null==t?void 0:t.id)??this.blocks[0]],null==e||e.focus(),null==e||e.$el.scrollIntoView({block:"nearest"})},focusOrOpen(t){this.fieldsets[t.type].wysiwyg?this.focus(t):this.open(t)},hide(t){Vue.set(t,"isHidden",!0),this.save()},isInputEvent(){const t=document.querySelector(":focus");return null==t?void 0:t.matches("input, textarea, [contenteditable], .k-writer")},isLastSelected(t){const[e]=this.selected.slice(-1);return e&&t.id===e},isOnlyInstance:()=>1===document.querySelectorAll(".k-blocks").length,isSelected(t){return this.selected.includes(t.id)},async merge(){if(this.isMergable){const t=this.selected.map((t=>this.find(t)));this.ref(t[0]).$refs.editor.merge(t);for(const e of t.slice(1))this.remove(e);await this.$nextTick(),this.focus(t[0])}},move(t){if(t.from!==t.to){const e=t.draggedContext.element,i=t.relatedContext.component.componentData||t.relatedContext.component.$parent.componentData;if(!1===Object.keys(i.fieldsets).includes(e.type))return!1;if(!0===i.isFull)return!1}return!0},onBlur(){0===this.selected.length&&(this.isMultiSelectKey=!1)},onClickBlock(t,e){e&&this.isMultiSelectKey&&this.onKey(e),this.isMultiSelectKey&&(e.preventDefault(),e.stopPropagation(),this.isSelected(t)?this.deselect(t):this.select(t))},onClickGlobal(t){var e;if("function"==typeof t.target.closest&&(t.target.closest(".k-dialog")||t.target.closest(".k-drawer")))return;const i=document.querySelector(".k-overlay:last-of-type");!1!==this.$el.contains(t.target)||!1!==(null==i?void 0:i.contains(t.target))?i&&!1===(null==(e=this.$el.closest(".k-layout-column"))?void 0:e.contains(t.target))&&this.deselectAll():this.deselectAll()},onCopy(t){return!1!==this.$el.contains(t.target)&&!0!==this.isEditing&&!0!==this.$panel.dialog.isOpen&&!0!==this.isInputEvent(t)&&this.copy(t)},onFocus(t){!1===this.isMultiSelectKey&&(this.selected=[t.id])},async onKey(t){if(this.isMultiSelectKey=t.metaKey||t.ctrlKey||t.altKey,"Escape"===t.code&&this.selected.length>1){const t=this.find(this.selected[0]);await this.$nextTick(),this.focus(t)}},onPaste(t){return!0!==this.isInputEvent(t)&&(!0!==this.isEditing&&!0!==this.$panel.dialog.isOpen&&((0!==this.selected.length||!1!==this.$el.contains(t.target))&&this.paste(t)))},open(t){var e;null==(e=this.$refs["block-"+t.id])||e[0].open()},async paste(t,e){const i=this.$helper.clipboard.read(t);let s=await this.$api.post(this.endpoints.field+"/paste",{html:i});if(void 0===e){let t=this.selected[this.selected.length-1];-1===(e=this.findIndex(t))&&(e=this.blocks.length),e++}if(this.max){const t=this.max-this.blocks.length;s=s.slice(0,t)}this.blocks.splice(e,0,...s),this.save(),this.$panel.notification.success({message:this.$t("paste.success",{count:s.length}),icon:"download"})},pasteboard(){this.$panel.dialog.open({component:"k-block-pasteboard",on:{paste:this.paste}})},prevNext(t){var e;if(this.blocks[t])return null==(e=this.$refs["block-"+this.blocks[t].id])?void 0:e[0]},ref(t){var e,i;return null==(i=this.$refs["block-"+((null==t?void 0:t.id)??(null==(e=this.blocks[0])?void 0:e.id))])?void 0:i[0]},remove(t){const e=this.findIndex(t.id);-1!==e&&(this.deselect(t),this.$delete(this.blocks,e),this.save())},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm.all"),submitButton:this.$t("delete.all")},on:{submit:()=>{this.selected=[],this.blocks=[],this.save(),this.$panel.dialog.close()}}})},removeSelected(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm.selected")},on:{submit:()=>{for(const t of this.selected){const e=this.findIndex(t);-1!==e&&this.$delete(this.blocks,e)}this.deselectAll(),this.save(),this.$panel.dialog.close()}}})},save(){this.$emit("input",this.blocks)},select(t){!1===this.isSelected(t)&&this.selected.push(t.id)},selectDown(){const t=this.selected[this.selected.length-1],e=this.findIndex(t)+1;e=0&&this.select(this.blocks[e])},selectAll(){this.selected=Object.values(this.blocks).map((t=>t.id))},show(t){Vue.set(t,"isHidden",!1),this.save()},async sort(t,e,i){if(i<0)return;let s=structuredClone(this.blocks);s.splice(e,1),s.splice(i,0,t),this.blocks=s,this.save(),await this.$nextTick(),this.focus(t)},async split(t,e,i){const s=structuredClone(t);s.content={...s.content,...i[0]};const n=await this.$api.get(this.endpoints.field+"/fieldsets/"+t.type);n.content={...n.content,...s.content,...i[1]},this.blocks.splice(e,1,s,n),this.save(),await this.$nextTick(),this.focus(n)},update(t,e){const i=this.findIndex(t.id);if(-1!==i)for(const s in e)Vue.set(this.blocks[i].content,s,e[s]);this.save()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-blocks",attrs:{"data-disabled":t.disabled,"data-empty":0===t.blocks.length}},[t.hasFieldsets?[e("k-draggable",t._b({staticClass:"k-blocks-list",attrs:{"data-multi-select-key":t.isMultiSelectKey},on:{sort:t.save},scopedSlots:t._u([0===t.blocks.length?{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],null,!0)},"k-draggable",t.draggableOptions,!1),t._l(t.blocks,(function(i,s){return e("k-block",t._b({key:i.id,ref:"block-"+i.id,refInFor:!0,on:{append:function(e){return t.add(e,s+1)},chooseToAppend:function(e){return t.choose(s+1)},chooseToConvert:function(e){return t.chooseToConvert(i)},chooseToPrepend:function(e){return t.choose(s)},close:function(e){t.isEditing=!1},copy:function(e){return t.copy()},duplicate:function(e){return t.duplicate(i,s)},focus:function(e){return t.onFocus(i)},hide:function(e){return t.hide(i)},merge:function(e){return t.merge()},open:function(e){t.isEditing=!0},paste:function(e){return t.pasteboard()},prepend:function(e){return t.add(e,s)},remove:function(e){return t.remove(i)},removeSelected:t.removeSelected,show:function(e){return t.show(i)},selectDown:t.selectDown,selectUp:t.selectUp,sortDown:function(e){return t.sort(i,s,s+1)},sortUp:function(e){return t.sort(i,s,s-1)},split:function(e){return t.split(i,s,e)},update:function(e){return t.update(i,e)}},nativeOn:{click:function(e){return t.onClickBlock(i,e)}}},"k-block",{...i,disabled:t.disabled,endpoints:t.endpoints,fieldset:t.fieldset(i),isBatched:t.isSelected(i)&&t.selected.length>1,isFull:t.isFull,isHidden:!0===i.isHidden,isLastSelected:t.isLastSelected(i),isMergable:t.isMergable,isSelected:t.isSelected(i),next:t.prevNext(s+1),prev:t.prevNext(s-1)},!1))})),1)]:e("k-empty",{attrs:{icon:"box"}},[t._v(" "+t._s(t.$t("field.blocks.fieldsets.empty"))+" ")])],2)}),[]).exports;const ii=ct({inheritAttrs:!1,emits:["close","paste","submit"],computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{paste(t){this.$emit("close"),this.$emit("paste",t)}}},(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,visible:!0,size:"large"},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},[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.paste.apply(null,arguments)}}})])}),[]).exports;const si=ct({inheritAttrs:!1,props:{disabledFieldsets:{default:()=>[],type:Array},fieldsets:{type:Object},fieldsetGroups:{type:Object},headline:{type:String},size:{type:String,default:"medium"},value:{default:null,type:String}},emits:["cancel","input","paste","submit"],data:()=>({selected:null}),computed:{groups(){const t={};let e=0;const i=this.fieldsetGroups??{blocks:{label:this.$t("field.blocks.fieldsets.label"),sets:Object.keys(this.fieldsets)}};for(const s in i){const n=i[s];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[s]=n)}return t},shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},mounted(){this.$events.on("paste",this.paste)},destroyed(){this.$events.off("paste",this.paste)},methods:{paste(t){this.$emit("paste",t),this.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{staticClass:"k-block-selector",attrs:{"cancel-button":!1,size:t.size,"submit-button":!1,visible:!0},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},[t.headline?e("k-headline",[t._v(" "+t._s(t.headline)+" ")]):t._e(),t._l(t.groups,(function(i,s){return e("details",{key:s,attrs:{open:i.open}},[e("summary",[t._v(t._s(i.label))]),e("k-navigate",{staticClass:"k-block-types"},t._l(i.fieldsets,(function(i){return e("k-button",{key:i.name,attrs:{disabled:t.disabledFieldsets.includes(i.type),icon:i.icon??"box",text:i.name,size:"lg"},on:{click:function(e){return t.$emit("submit",i.type)}},nativeOn:{focus:function(e){return t.$emit("input",i.type)}}})})),1)],1)})),e("p",{staticClass:"k-clipboard-hint",domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}})],2)}),[]).exports;const ni=ct({props:{value:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-background-dropdown"},[e("k-button",{attrs:{dropdown:!0,size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.dropdown.toggle()}}},[e("k-color-frame",{attrs:{color:t.value,ratio:"1/1"}})],1),e("k-dropdown-content",{ref:"dropdown",attrs:{"align-x":"end",options:[{text:t.$t("field.blocks.figure.back.plain"),click:"var(--color-white)"},{text:t.$t("field.blocks.figure.back.pattern.light"),click:"var(--pattern-light)"},{text:t.$t("field.blocks.figure.back.pattern.dark"),click:"var(--pattern)"}]},on:{action:function(e){return t.$emit("input",e)}}})],1)}),[]).exports;const oi=ct({inheritAttrs:!1,props:{back:String,caption:String,captionMarks:{default:!0,type:[Boolean,Array]},disabled:Boolean,isEmpty:Boolean,emptyIcon:String,emptyText:String},emits:["open","update"]},(function(){var t=this,e=t._self._c;return e("figure",{staticClass:"k-block-figure",style:{"--block-figure-back":t.back},attrs:{"data-empty":t.isEmpty}},[t.isEmpty?e("k-button",{staticClass:"k-block-figure-empty",attrs:{disabled:t.disabled,icon:t.emptyIcon,text:t.emptyText},on:{click:function(e){return t.$emit("open")}}}):e("span",{staticClass:"k-block-figure-container",attrs:{"data-disabled":t.disabled},on:{dblclick:function(e){return t.$emit("open")}}},[t._t("default")],2),t.caption?e("k-block-figure-caption",{attrs:{disabled:t.disabled,marks:t.captionMarks,value:t.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}}):t._e()],1)}),[]).exports;const ai=ct({props:{disabled:Boolean,marks:[Array,Boolean],value:String}},(function(){var t=this,e=t._self._c;return e("figcaption",{staticClass:"k-block-figure-caption"},[e("k-writer",{attrs:{disabled:t.disabled,inline:!0,marks:t.marks,spellcheck:!1,value:t.value},on:{input:function(e){return t.$emit("input",e)}}})],1)}),[]).exports;const ri=ct({extends:Ge,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,disabled:t.disabled,placeholder:t.placeholder,spellcheck:!1,value:t.content.code,font:"monospace",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-input",{ref:"language",attrs:{disabled:t.disabled,empty:!1,options:t.languages,value:t.content.language,icon:"code",type:"select"},on:{input:function(e){return t.update({language:e})}}})],1):t._e()],1)}),[]).exports;const li=ct({extends:Ge,props:{tabs:Object},data(){return{collapsed:this.state(),tab:Object.keys(this.tabs)[0]}},computed:{fields(){var t;return null==(t=this.tabs[this.tab])?void 0:t.fields},values(){return Object.assign({},this.content)}},methods:{open(){this.$emit("open",this.tab)},state(t){const e=`kirby.fieldsBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return JSON.parse(sessionStorage.getItem(e));sessionStorage.setItem(e,t)},toggle(){this.collapsed=!this.collapsed,this.state(this.collapsed)}}},(function(){var t=this,e=t._self._c;return e("div",{attrs:{"data-collapsed":t.collapsed},on:{dblclick:function(e){!t.fieldset.wysiwyg&&t.$emit("open")}}},[e("header",{staticClass:"k-block-type-fields-header"},[e("k-block-title",{attrs:{content:t.values,fieldset:t.fieldset},nativeOn:{click:function(e){return t.toggle.apply(null,arguments)}}}),t.collapsed?t._e():e("k-drawer-tabs",{attrs:{tab:t.tab,tabs:t.fieldset.tabs},on:{open:function(e){t.tab=e}}})],1),t.collapsed?t._e():e("k-form",{ref:"form",staticClass:"k-block-type-fields-form",attrs:{autofocus:!0,disabled:t.disabled||!t.fieldset.wysiwyg,fields:t.fields,value:t.values},on:{input:function(e){return t.$emit("update",e)}}})],1)}),[]).exports;const ci=ct({extends:Ge,data(){return{back:this.onBack()??"white"}},computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop},isEmpty(){var t;return!(null==(t=this.content.images)?void 0:t.length)},ratio(){return this.content.ratio}},methods:{onBack(t){const e=`kirby.galleryBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return sessionStorage.getItem(e);this.back=t,sessionStorage.setItem(e,t)}}},(function(){var t=this,e=t._self._c;return e("figure",{style:{"--block-back":t.back},attrs:{"data-empty":t.isEmpty}},[e("ul",{on:{dblclick:t.open}},[t.isEmpty?t._l(3,(function(i){return e("li",{key:i,staticClass:"k-block-type-gallery-placeholder"},[e("k-image-frame",{attrs:{ratio:t.ratio}})],1)})):[t._l(t.content.images,(function(i){return e("li",{key:i.id},[e("k-image-frame",{attrs:{ratio:t.ratio,cover:t.crop,src:i.url,srcset:i.image.srcset,alt:i.alt}})],1)})),e("k-block-background-dropdown",{attrs:{value:t.back},on:{input:t.onBack}})]],2),t.content.caption?e("k-block-figure-caption",{attrs:{disabled:t.disabled,marks:t.captionMarks,value:t.content.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}}):t._e()],1)}),[]).exports;const ui=ct({extends:Ge,inheritAttrs:!1,emits:["append","open","split","update"],computed:{isSplitable(){return this.content.text.length>0&&!1===this.$refs.input.isCursorAtStart&&!1===this.$refs.input.isCursorAtEnd},keys(){return{Enter:()=>!0===this.$refs.input.isCursorAtEnd?this.$emit("append","text"):this.split(),"Mod-Enter":this.split}},levels(){return this.field("level",{options:[]}).options},textField(){return this.field("text",{marks:!0})}},methods:{focus(){this.$refs.input.focus()},merge(t){this.update({text:t.map((t=>t.content.text)).join(" ")})},split(){var t,e;const i=null==(e=(t=this.$refs.input).getSplitContent)?void 0:e.call(t);i&&this.$emit("split",[{text:i[0]},{level:"h"+Math.min(parseInt(this.content.level.slice(1))+1,6),text:i[1]}])}}},(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",t._b({ref:"input",attrs:{disabled:t.disabled,inline:!0,keys:t.keys,value:t.content.text},on:{input:function(e){return t.update({text:e})}}},"k-writer",t.textField,!1)),t.levels.length>1?e("k-input",{ref:"level",staticClass:"k-block-type-heading-level",attrs:{disabled:t.disabled,empty:!1,options:t.levels,value:t.content.level,type:"select"},on:{input:function(e){return t.update({level:e})}}}):t._e()],1)}),[]).exports;const di=ct({extends:Ge,data(){return{back:this.onBack()??"white"}},computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop??!1},src(){var t,e;return"web"===this.content.location?this.content.src:!!(null==(e=null==(t=this.content.image)?void 0:t[0])?void 0:e.url)&&this.content.image[0].url},ratio(){return this.content.ratio??!1}},methods:{onBack(t){const e=`kirby.imageBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return sessionStorage.getItem(e);this.back=t,sessionStorage.setItem(e,t)}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{attrs:{back:t.back,caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.image.placeholder")+" …",disabled:t.disabled,"is-empty":!t.src,"empty-icon":"image"},on:{open:t.open,update:t.update}},[t.src?[t.ratio?e("k-image-frame",{attrs:{ratio:t.ratio,cover:t.crop,alt:t.content.alt,src:t.src}}):e("img",{staticClass:"k-block-type-image-auto",attrs:{alt:t.content.alt,src:t.src}}),e("k-block-background-dropdown",{attrs:{value:t.back},on:{input:t.onBack}})]:t._e()],2)}),[]).exports;const pi=ct({},(function(){return this._self._c,this._m(0)}),[function(){var t=this._self._c;return t("div",[t("hr")])}]).exports;const hi=ct({extends:Ge,emits:["open","split","update"],computed:{isSplitable(){return this.content.text.length>0&&!1===this.input().isCursorAtStart&&!1===this.input().isCursorAtEnd},keys(){return{"Mod-Enter":this.split}},marks(){return this.field("text",{}).marks}},methods:{focus(){this.$refs.input.focus()},input(){return this.$refs.input.$refs.input.$refs.input},merge(t){this.update({text:t.map((t=>t.content.text)).join("").replaceAll("

      ","")})},split(){var t,e;const i=null==(e=(t=this.input()).getSplitContent)?void 0:e.call(t);i&&this.$emit("split",[{text:i[0].replace(/(
    • <\/p><\/li><\/ul>)$/,"

    ")},{text:i[1].replace(/^(
    • <\/p><\/li>)/,"

        ")}])}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-list-input",attrs:{disabled:t.disabled,keys:t.keys,marks:t.marks,value:t.content.text,type:"list"},on:{input:function(e){return t.update({text:e})}}})}),[]).exports;const mi=ct({extends:Ge,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,disabled:t.disabled,placeholder:t.placeholder,spellcheck:!1,value:t.content.text,font:"monospace",type:"textarea"},on:{input:function(e){return t.update({text:e})}}})}),[]).exports;const fi=ct({extends:Ge,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:{disabled:t.disabled,inline:t.textField.inline??!1,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:{disabled:t.disabled,inline:t.citationField.inline??!0,marks:t.citationField.marks,placeholder:t.citationField.placeholder,value:t.content.citation},on:{input:function(e){return t.update({citation:e})}}})],1)}),[]).exports;const gi=ct({extends:Ge,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)}}})}),[]).exports;const ki=ct({extends:Ge,emits:["open","split","update"],computed:{component(){const t="k-"+this.textField.type+"-input";return this.$helper.isComponent(t)?t:"k-writer-input"},isSplitable(){return this.content.text.length>0&&!1===this.input().isCursorAtStart&&!1===this.input().isCursorAtEnd},keys(){const t={"Mod-Enter":this.split};return!0===this.textField.inline&&(t.Enter=this.split),t},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.input.focus()},input(){return this.$refs.input.$refs.input},merge(t){this.update({text:t.map((t=>t.content.text)).join(this.textField.inline?" ":"")})},split(){var t,e;const i=null==(e=(t=this.input()).getSplitContent)?void 0:e.call(t);i&&("writer"===this.textField.type&&(i[0]=i[0].replace(/(

        <\/p>)$/,""),i[1]=i[1].replace(/^(

        <\/p>)/,"")),this.$emit("split",i.map((t=>({text:t})))))}}},(function(){var t=this;return(0,t._self._c)(t.component,t._b({ref:"input",tag:"component",staticClass:"k-block-type-text-input",attrs:{disabled:t.disabled,keys:t.keys,value:t.content.text},on:{input:function(e){return t.update({text:e})}}},"component",t.textField,!1))}),[]).exports;const bi=ct({extends:Ge,computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},location(){return this.content.location},poster(){var t,e;return null==(e=null==(t=this.content.poster)?void 0:t[0])?void 0:e.url},video(){var t,e;return"kirby"===this.content.location?null==(e=null==(t=this.content.video)?void 0:t[0])?void 0:e.url:this.$helper.embed.video(this.content.url??"",!0)}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{staticClass:"k-block-type-video-figure",attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,disabled:t.disabled,"empty-text":t.$t("field.blocks.video.placeholder")+" …","is-empty":!t.video,"empty-icon":"video"},on:{open:t.open,update:t.update}},[e("k-frame",{attrs:{ratio:"16/9"}},[t.video?["kirby"==t.location?e("video",{attrs:{src:t.video,poster:t.poster,controls:""}}):e("iframe",{attrs:{src:t.video,referrerpolicy:"strict-origin-when-cross-origin"}})]:t._e()],2)],1)}),[]).exports,vi={install(t){t.component("k-block",Qe),t.component("k-blocks",ei),t.component("k-block-options",Ze),t.component("k-block-pasteboard",ii),t.component("k-block-selector",si),t.component("k-block-background-dropdown",ni),t.component("k-block-figure",oi),t.component("k-block-figure-caption",ai),t.component("k-block-title",We),t.component("k-block-type-code",ri),t.component("k-block-type-default",Ge),t.component("k-block-type-fields",li),t.component("k-block-type-gallery",ci),t.component("k-block-type-heading",ui),t.component("k-block-type-image",di),t.component("k-block-type-line",pi),t.component("k-block-type-list",hi),t.component("k-block-type-markdown",mi),t.component("k-block-type-quote",fi),t.component("k-block-type-table",gi),t.component("k-block-type-text",ki),t.component("k-block-type-video",bi)}};const yi=ct({mixins:[Fe,ti],inheritAttrs:!1,data:()=>({opened:[]}),computed:{hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.value.length},isFull(){return this.max&&this.value.length>=this.max},options(){return[{click:()=>this.$refs.blocks.copyAll(),disabled:this.isEmpty,icon:"template",text:this.$t("copy.all")},{click:()=>this.$refs.blocks.pasteboard(),disabled:this.isFull,icon:"download",text:this.$t("paste")},"-",{click:()=>this.$refs.blocks.removeAll(),disabled:this.isEmpty,icon:"trash",text:this.$t("delete.all")}]}},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([!t.disabled&&t.hasFieldsets?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{staticClass:"input-focus",attrs:{autofocus:t.autofocus,disabled:t.isFull,responsive:!0,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}}),e("k-button",{attrs:{icon:"dots",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:t.options,"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-blocks",t._g(t._b({ref:"blocks",on:{close:function(e){t.opened=e},open:function(e){t.opened=e}}},"k-blocks",t.$props,!1),t.$listeners)),t.disabled||t.isEmpty||t.isFull||!t.hasFieldsets?t._e():e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}})],1)],1)}),[]).exports,$i={mixins:[Ie,nt],props:{columns:{default:1,type:Number},max:Number,min:Number,theme:String,value:{type:Array,default:()=>[]}}};const wi=ct({mixins:[De,$i],data:()=>({selected:[]}),computed:{choices(){return this.options.map(((t,e)=>({autofocus:this.autofocus&&0===e,checked:this.selected.includes(t.value),disabled:this.disabled||t.disabled,id:`${this.id}-${e}`,info:t.info,label:t.text,name:this.name??this.id,type:"checkbox",value:t.value})))}},watch:{value:{handler(t){this.selected=Array.isArray(t)?t:[],this.validate()},immediate:!0}},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},input(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)},select(){this.focus()},validate(){this.$emit("invalid",this.$v.$invalid,this.$v)}},validations(){return{selected:{required:!this.required||t.required,min:!this.min||t.minLength(this.min),max:!this.max||t.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-checkboxes-input k-grid",style:{"--columns":t.columns},attrs:{"data-variant":"choices"}},t._l(t.choices,(function(i,s){return e("li",{key:s},[e("k-choice-input",t._b({on:{input:function(e){return t.input(i.value,e)}}},"k-choice-input",i,!1))],1)})),0)}),[]).exports,xi={props:{counter:{type:Boolean,default:!0}},computed:{counterOptions(){const t=this.counterValue??this.value;return!(!1===this.counter||this.disabled||!t)&&{count:Array.isArray(t)?t.length:String(t).length,min:this.$props.min??this.$props.minlength,max:this.$props.max??this.$props.maxlength}},counterValue:()=>null}};const _i=ct({mixins:[Fe,Ue,$i,xi],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t,e=this,i=e._self._c;return i("k-field",e._b({staticClass:"k-checkboxes-field",attrs:{input:e.id+"-0",counter:e.counterOptions}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?i("k-checkboxes-input",e._g(e._b({ref:"input"},"k-checkboxes-input",e.$props,!1),e.$listeners)):i("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[]).exports,Ci={mixins:[Ie,H,J,et,it,ot,at,lt],props:{ariaLabel:String,type:{default:"text",type:String},value:{type:String}}};const Si=ct({mixins:[De,Ci]},(function(){var t=this;return(0,t._self._c)("input",t._b({directives:[{name:"direction",rawName:"v-direction"}],staticClass:"k-string-input",attrs:{"aria-label":t.ariaLabel,"data-font":t.font},on:{input:function(e){return t.$emit("input",e.target.value)}}},"input",{autocomplete:t.autocomplete,autofocus:t.autofocus,disabled:t.disabled,id:t.id,maxlength:t.maxlength,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))}),[]).exports,Oi={mixins:[Ci],props:{autocomplete:null,font:null,maxlength:null,minlength:null,pattern:null,spellcheck:null,alpha:{type:Boolean,default:!0},format:{type:String,default:"hex",validator:t=>["hex","rgb","hsl"].includes(t)}}};const Mi=ct({mixins:[Si,Oi],watch:{value(){this.validate()}},mounted(){this.validate()},methods:{convert(t){if(!t)return t;try{return this.$library.colors.toString(t,this.format,this.alpha)}catch{const e=document.createElement("div");return e.style.color=t,document.body.append(e),t=window.getComputedStyle(e).color,e.remove(),this.$library.colors.toString(t,this.format,this.alpha)}},convertAndEmit(t){this.emit(this.convert(t))},emit(t){this.$emit("input",t)},onBlur(){this.convertAndEmit(this.value)},onPaste(t){t instanceof ClipboardEvent&&(t=this.$helper.clipboard.read(t,!0)),this.convertAndEmit(t)},async onSave(){var t;this.convertAndEmit(this.value),await this.$nextTick(),null==(t=this.$el.form)||t.requestSubmit()},validate(){let t="";null===this.$library.colors.parse(this.value)&&(t=this.$t("error.validation.color",{format:this.format})),this.$el.setCustomValidity(t)}}},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-colorname-input",attrs:{spellcheck:!1,autocomplete:"off",type:"text"},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{blur:function(e){return t.onBlur.apply(null,arguments)},paste:function(e){return t.onPaste.apply(null,arguments)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?(e.stopPropagation(),e.preventDefault(),t.onSave.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onSave.apply(null,arguments)}]}},"k-string-input",t.$props,!1))}),[]).exports;const Ai=ct({mixins:[Fe,Ue,Oi],inheritAttrs:!1,props:{icon:{type:String,default:"pipette"},mode:{type:String,default:"picker",validator:t=>["picker","input","options"].includes(t)},options:{type:Array,default:()=>[]}},computed:{convertedOptions(){return this.options.map((t=>({...t,value:this.convert(t.value)})))},currentOption(){return this.convertedOptions.find((t=>t.value===this.value))}},methods:{convert(t){return this.$library.colors.toString(t,this.format,this.alpha)}}},(function(){var t,e=this,i=e._self._c;return i("k-field",e._b({staticClass:"k-color-field",attrs:{input:e.id}},"k-field",e.$props,!1),["options"===e.mode?i("k-coloroptions-input",e._b({staticClass:"k-color-field-options",attrs:{options:e.convertedOptions},on:{input:function(t){return e.$emit("input",t)}}},"k-coloroptions-input",e.$props,!1)):i("k-input",e._b({attrs:{type:"color"},scopedSlots:e._u([{key:"before",fn:function(){return["picker"===e.mode?[i("button",{staticClass:"k-color-field-picker-toggle",attrs:{disabled:e.disabled,type:"button"},on:{click:function(t){return e.$refs.picker.toggle()}}},[i("k-color-frame",{attrs:{color:e.value}})],1),i("k-dropdown-content",{ref:"picker",staticClass:"k-color-field-picker"},[i("k-colorpicker-input",e._b({ref:"color",attrs:{options:e.convertedOptions},on:{input:function(t){return e.$emit("input",t)}},nativeOn:{click:function(t){t.stopPropagation()}}},"k-colorpicker-input",e.$props,!1))],1)]:i("k-color-frame",{attrs:{color:e.value}})]},proxy:!0},{key:"default",fn:function(){return[i("k-colorname-input",e._b({on:{input:function(t){return e.$emit("input",t)}}},"k-colorname-input",e.$props,!1))]},proxy:!0},(null==(t=e.currentOption)?void 0:t.text)?{key:"after",fn:function(){return[i("span",{domProps:{innerHTML:e._s(e.currentOption.text)}})]},proxy:!0}:null,"picker"===e.mode?{key:"icon",fn:function(){return[i("k-button",{staticClass:"k-input-icon-button",attrs:{icon:e.icon},on:{click:function(t){return t.stopPropagation(),e.$refs.picker.toggle()}}})]},proxy:!0}:null],null,!0)},"k-input",e.$props,!1))],1)}),[]).exports,Ii={props:{max:String,min:String,value:String}},Di={mixins:[Ie,Ii],props:{display:{type:String,default:"DD.MM.YYYY"},step:{type:Object,default:()=>({size:1,unit:"day"})},type:{type:String,default:"date"}}};const ji=ct({mixins:[De,Di],emits:["input","focus","submit"],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}},methods:{async alter(t){let e=this.parse()??this.round(this.$library.dayjs()),i=this.rounding.unit,s=this.rounding.size;const n=this.selection();null!==n&&("meridiem"===n.unit?(t="pm"===e.format("a")?"subtract":"add",i="hour",s=12):(i=n.unit,i!==this.rounding.unit&&(s=1))),e=e[t](s,i).round(this.rounding.unit,this.rounding.size),this.commit(e),this.emit(e),await this.$nextTick(),this.select(n)},commit(t){this.dt=t,this.formatted=this.pattern.format(t),this.validate(),this.$emit("invalid",this.$v.$invalid,this.$v)},emit(t){this.$emit("input",this.toISO(t))},onArrowDown(){this.alter("subtract")},onArrowUp(){this.alter("add")},onBlur(){const t=this.parse();this.commit(t),this.emit(t)},async onEnter(){this.onBlur(),await this.$nextTick(),this.$emit("submit")},onInput(t){const e=this.parse(),i=this.pattern.format(e);if(!t||i==t)return this.commit(e),this.emit(e)},async onTab(t){if(""==this.$el.value)return;this.onBlur(),await this.$nextTick();const e=this.selection();if(this.$el&&e.start===this.$el.selectionStart&&e.end===this.$el.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{if(this.$el&&this.$el.selectionStart==e.end+1&&e.index==this.pattern.parts.length-1)return;if(this.$el&&this.$el.selectionEnd-1>e.end){const t=this.pattern.at(this.$el.selectionEnd,this.$el.selectionEnd);this.select(this.pattern.parts[t.index])}else this.select(this.pattern.parts[e.index])}t.preventDefault()},parse(){const t=this.$library.dayjs.interpret(this.$el.value,this.inputType);return this.round(t)},round(t){return null==t?void 0:t.round(this.rounding.unit,this.rounding.size)},select(t){var e;t??(t=this.selection()),null==(e=this.$el)||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.$el.selectionStart,this.$el.selectionEnd)},toDatetime(t){return this.round(this.$library.dayjs.iso(t,this.inputType))},toISO(t){return null==t?void 0:t.toISO(this.inputType)},validate(){var t,e,i;const s=[];this.required&&!this.dt&&s.push(this.$t("error.validation.required")),this.min&&!1===(null==(t=this.dt)?void 0:t.validate(this.min,"min",this.rounding.unit))&&s.push(this.$t("error.validation.date.after",{date:this.min})),this.max&&!1===(null==(e=this.dt)?void 0:e.validate(this.max,"max",this.rounding.unit))&&s.push(this.$t("error.validation.date.before",{date:this.max})),null==(i=this.$el)||i.setCustomValidity(s.join(", "))}},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:"direction",rawName:"v-direction"}],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){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,"s",void 0,e.key,void 0)?null:e.metaKey?(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.ctrlKey?(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:t.onTab.apply(null,arguments)}]}})}),[]).exports;const Ei=ct({mixins:[Fe,Ue,Di],inheritAttrs:!1,props:{calendar:{type:Boolean,default:!0},icon:{type:String,default:"calendar"},time:{type:[Boolean,Object],default:()=>({})},times:{type:Boolean,default:!0}},emits:["input","submit"],data(){return{isInvalid:!1,iso:this.toIso(this.value)}},computed:{isEmpty(){return this.time?!this.iso.date||!this.iso.time:!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())??"")},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.id}},"k-field",t.$props,!1),[e("div",{ref:"body",staticClass:"k-date-field-body",attrs:{"data-has-time":Boolean(t.time),"data-invalid":!t.novalidate&&t.isInvalid}},[e("k-input",t._b({ref:"dateInput",attrs:{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-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.icon,title:t.$t("date.select")},on:{click:function(e){return t.$refs.calendar.toggle()}}}),e("k-dropdown-content",{ref:"calendar",attrs:{"align-x":"end"}},[e("k-calendar",{attrs:{value:t.iso.date,min:t.min,max:t.max},on:{input:t.onDateInput}})],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,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-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.time.icon??"clock",title:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{"align-x":"end"}},[e("k-timeoptions-input",{attrs:{display:t.time.display,value:t.value},on:{input:t.onTimesInput}})],1)]},proxy:!0}:null],null,!0)}):t._e()],1)])}),[]).exports,Li={mixins:[Ie,J,et,it,ot,at,lt],props:{autocomplete:{type:[Boolean,String],default:"off"},preselect:Boolean,type:{type:String,default:"text"},value:String}};const Ti=ct({mixins:[De,Li],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:{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||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.maxLength(this.maxlength),email:"email"!==this.type||t.email,url:"url"!==this.type||t.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",attrs:{"data-font":t.font}},"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))}),[]).exports,Bi={mixins:[Li],props:{autocomplete:{type:String,default:"email"},placeholder:{type:String,default:()=>window.panel.$t("email.placeholder")},type:{type:String,default:"email"}}};const qi=ct({extends:Ti,mixins:[Bi]},null,null).exports;const Pi=ct({mixins:[Fe,Ue,Bi],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.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{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,title:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[]).exports;const Ni=ct({type:"model",mixins:[Fe,V,tt],inheritAttrs:!1,props:{empty:String,info:String,link:Boolean,max:Number,multiple:Boolean,parent:String,search:Boolean,size:String,text:String,value:{type:Array,default:()=>[]}},emits:["change","input"],data(){return{selected:this.value}},computed:{buttons(){return[{autofocus:this.autofocus,text:this.$t("select"),icon:"checklist",responsive:!0,click:()=>this.open()}]},collection(){return{empty:this.emptyProps,items:this.selected,layout:this.layout,link:this.link,size:this.size,sortable:!this.disabled&&this.selected.length>1,theme:this.disabled?"disabled":null}},hasDropzone:()=>!1,isInvalid(){return this.required&&0===this.selected.length||this.min&&this.selected.lengththis.max},more(){return!this.max||this.max>this.selected.length}},watch:{value(t){this.selected=t}},methods:{drop(){},focus(){},onInput(){this.$emit("input",this.selected)},open(){if(this.disabled)return!1;this.$panel.dialog.open({component:`k-${this.$options.type}-dialog`,props:{endpoint:this.endpoints.field,hasSearch:this.search,max:this.max,multiple:this.multiple,value:this.selected.map((t=>t.id))},on:{submit:t=>{this.select(t),this.$panel.dialog.close()}}})},remove(t){this.selected.splice(t,1),this.onInput()},removeById(t){this.selected=this.selected.filter((e=>e.id!==t)),this.onInput()},select(t){if(0===t.length)return this.selected=[],void this.onInput();this.selected=this.selected.filter((e=>t.find((t=>t.id===e.id))));for(const e of t)this.selected.find((t=>e.id===t.id))||this.selected.push(e);this.onInput()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:`k-models-field k-${t.$options.type}-field`,scopedSlots:t._u([t.disabled?null:{key:"options",fn:function(){return[e("k-button-group",{ref:"buttons",staticClass:"k-field-options",attrs:{buttons:t.buttons,layout:"collapsed",size:"xs",variant:"filled"}})]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-dropzone",{attrs:{disabled:!t.hasDropzone},on:{drop:t.drop}},[e("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([t.disabled?null:{key:"options",fn:function({index:i}){return[e("k-button",{attrs:{title:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(i)}}})]}}],null,!0)},"k-collection",t.collection,!1))],1)],1)}),[]).exports;const zi=ct({extends:Ni,type:"files",props:{uploads:[Boolean,Object,Array]},computed:{buttons(){const t=Ni.computed.buttons.call(this);return this.hasDropzone&&t.unshift({autofocus:this.autofocus,text:this.$t("upload"),responsive:!0,icon:"upload",click:()=>this.$panel.upload.pick(this.uploadOptions)}),t},emptyProps(){return{icon:"image",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.files.empty"):this.$t("field.files.empty.single"))}},hasDropzone(){return!this.disabled&&this.more&&this.uploads},uploadOptions(){return{accept:this.uploads.accept,max:this.max,multiple:this.multiple,preview:this.uploads.preview,url:this.$panel.urls.api+"/"+this.endpoints.field+"/upload",on:{done:t=>{!1===this.multiple&&(this.selected=[]);for(const e of t)void 0===this.selected.find((t=>t.id===e.id))&&this.selected.push(e);this.onInput(),this.$events.emit("file.upload"),this.$events.emit("model.update")}}}}},mounted(){this.$events.on("file.delete",this.removeById)},destroyed(){this.$events.off("file.delete",this.removeById)},methods:{drop(t){return!1!==this.uploads&&this.$panel.upload.open(t,this.uploadOptions)}}},null,null).exports;const Fi=ct({},(function(){return(0,this._self._c)("div",{staticClass:"k-field k-gap-field"})}),[]).exports;const Yi=ct({mixins:[G,Q],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-headline-field"},[e("k-headline",{staticClass:"h2"},[t._v(" "+t._s(t.label)+" ")]),t.help?e("footer",{staticClass:"k-field-footer"},[e("k-text",{staticClass:"k-help k-field-help",attrs:{html:t.help}})],1):t._e()],1)}),[]).exports;const Ri=ct({mixins:[G,Q],props:{icon:String,text:String,theme:{type:String,default:"info"}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-field k-info-field"},[t.label?e("k-headline",[t._v(t._s(t.label))]):t._e(),e("k-box",{attrs:{icon:t.icon,theme:t.theme}},[e("k-text",{attrs:{html:t.text}})],1),t.help?e("footer",{staticClass:"k-field-footer"},[e("k-text",{staticClass:"k-help k-field-help",attrs:{html:t.help}})],1):t._e()],1)}),[]).exports,Ui={props:{endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean}};const Hi=ct({mixins:[Ui],props:{blocks:Array,width:{type:String,default:"1/1"}},emits:["input"]},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column k-layout-column",style:{"--width":t.width},attrs:{id:t.id,tabindex:"0"},on:{dblclick:function(e){return t.$refs.blocks.choose(t.blocks.length)}}},[e("k-blocks",t._b({ref:"blocks",on:{input:function(e){return t.$emit("input",e)}},nativeOn:{dblclick:function(t){t.stopPropagation()}}},"k-blocks",{endpoints:t.endpoints,fieldsets:t.fieldsets,fieldsetGroups:t.fieldsetGroups,group:"layout",value:t.blocks},!1))],1)}),[]).exports,Vi={mixins:[Ui,W],props:{columns:Array,layouts:{type:Array,default:()=>[["1/1"]]},settings:Object}};const Ki=ct({mixins:[Vi],props:{attrs:[Array,Object]},emits:["append","change","copy","duplicate","prepend","remove","select","updateAttrs","updateColumn"],computed:{options(){return[{click:()=>this.$emit("prepend"),icon:"angle-up",text:this.$t("insert.before")},{click:()=>this.$emit("append"),icon:"angle-down",text:this.$t("insert.after")},"-",{click:()=>this.openSettings(),icon:"settings",text:this.$t("settings"),when:!1===this.$helper.object.isEmpty(this.settings)},{click:()=>this.$emit("duplicate"),icon:"copy",text:this.$t("duplicate")},{click:()=>this.$emit("change"),disabled:1===this.layouts.length,icon:"dashboard",text:this.$t("field.layout.change")},"-",{click:()=>this.$emit("copy"),icon:"template",text:this.$t("copy")},{click:()=>this.$emit("paste"),icon:"download",text:this.$t("paste.after")},"-",{click:()=>this.remove(),icon:"trash",text:this.$t("field.layout.delete")}]},tabs(){let t=this.settings.tabs;for(const[e,i]of Object.entries(t))for(const s in i.fields)t[e].fields[s].endpoints={field:this.endpoints.field+"/fields/"+s,section:this.endpoints.section,model:this.endpoints.model};return t}},methods:{openSettings(){this.$panel.drawer.open({component:"k-form-drawer",props:{icon:"settings",tabs:this.tabs,title:this.$t("settings"),value:this.attrs},on:{input:t=>this.$emit("updateAttrs",t)}})},remove(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.layout.delete.confirm")},on:{submit:()=>{this.$emit("remove"),this.$panel.dialog.close()}}})}}},(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(i,s){return e("k-layout-column",t._b({key:i.id,on:{input:function(e){return t.$emit("updateColumn",{column:i,columnIndex:s,blocks:e})}}},"k-layout-column",{...i,endpoints:t.endpoints,fieldsetGroups:t.fieldsetGroups,fieldsets:t.fieldsets},!1))})),1),t.disabled?t._e():e("nav",{staticClass:"k-layout-toolbar"},[t.settings?e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{title:t.$t("settings"),icon:"settings"},on:{click:t.openSettings}}):t._e(),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:{options:t.options,"align-x":"end"}}),e("k-sort-handle")],1)],1)}),[]).exports,Wi={mixins:[Vi,X],props:{empty:String,max:Number,selector:Object,value:{type:Array,default:()=>[]}}};const Ji=ct({mixins:[Wi],emits:["input"],data(){return{current:null,nextIndex:null,rows:this.value,selected:null}},computed:{draggableOptions(){return{id:this.id,handle:!0,list:this.rows}},hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0}},watch:{value(){this.rows=this.value}},methods:{copy(t,e){if(0===this.rows.length)return!1;const i=void 0!==e?this.rows[e]:this.rows;this.$helper.clipboard.write(JSON.stringify(i),t),this.$panel.notification.success({message:this.$t("copy.success",{count:i.length??1}),icon:"template"})},change(t,e){const i=e.columns.map((t=>t.width)),s=this.layouts.findIndex((t=>t.toString()===i.toString()));this.$panel.dialog.open({component:"k-layout-selector",props:{label:this.$t("field.layout.change"),layouts:this.layouts,selector:this.selector,value:this.layouts[s]},on:{submit:i=>{this.onChange(i,s,{rowIndex:t,layoutIndex:s,layout:e}),this.$panel.dialog.close()}}})},duplicate(t,e){const i=structuredClone(e),s=this.updateIds(i);this.rows.splice(t+1,0,...s),this.save()},async onAdd(t){let e=await this.$api.post(this.endpoints.field+"/layout",{columns:t});this.rows.splice(this.nextIndex,0,e),this.save()},async onChange(t,e,i){if(e===this.layouts[i.layoutIndex])return;const s=i.layout,n=await this.$api.post(this.endpoints.field+"/layout",{attrs:s.attrs,columns:t}),o=s.columns.filter((t=>{var e;return(null==(e=null==t?void 0:t.blocks)?void 0:e.length)>0})),a=[];if(0===o.length)a.push(n);else{const t=Math.ceil(o.length/n.columns.length)*n.columns.length;for(let e=0;e{var s;return t.blocks=(null==(s=o[i+e])?void 0:s.blocks)??[],t})),t.columns.filter((t=>{var e;return null==(e=null==t?void 0:t.blocks)?void 0:e.length})).length&&a.push(t)}}this.rows.splice(i.rowIndex,1,...a),this.save()},async paste(t,e=this.rows.length){let i=await this.$api.post(this.endpoints.field+"/layout/paste",{json:this.$helper.clipboard.read(t)});i.length&&(this.rows.splice(e,0,...i),this.save()),this.$panel.notification.success({message:this.$t("paste.success",{count:i.length}),icon:"download"})},pasteboard(t){this.$panel.dialog.open({component:"k-block-pasteboard",on:{paste:e=>this.paste(e,t)}})},remove(t){const e=this.rows.findIndex((e=>e.id===t.id));-1!==e&&this.$delete(this.rows,e),this.save()},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.layout.delete.confirm.all")},on:{submit:()=>{this.rows=[],this.save(),this.$panel.dialog.close()}}})},save(){this.$emit("input",this.rows)},select(t){if(this.nextIndex=t,1===this.layouts.length)return this.onAdd(this.layouts[0]);this.$panel.dialog.open({component:"k-layout-selector",props:{layouts:this.layouts,selector:this.selector,value:null},on:{submit:t=>{this.onAdd(t),this.$panel.dialog.close()}}})},updateAttrs(t,e){this.rows[t].attrs=e,this.save()},updateColumn(t){this.rows[t.index].columns[t.columnIndex].blocks=t.blocks,this.save()},updateIds(t){return!1===Array.isArray(t)&&(t=[t]),t.map((t=>(t.id=this.$helper.uuid(),t.columns=t.columns.map((t=>(t.id=this.$helper.uuid(),t.blocks=t.blocks.map((t=>(t.id=this.$helper.uuid(),t))),t))),t)))}}},(function(){var t=this,e=t._self._c;return e("div",[t.hasFieldsets&&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(i,s){return e("k-layout",t._b({key:i.id,on:{append:function(e){return t.select(s+1)},change:function(e){return t.change(s,i)},copy:function(e){return t.copy(e,s)},duplicate:function(e){return t.duplicate(s,i)},paste:function(e){return t.pasteboard(s+1)},prepend:function(e){return t.select(s)},remove:function(e){return t.remove(i)},select:function(e){t.selected=i.id},updateAttrs:function(e){return t.updateAttrs(s,e)},updateColumn:function(e){return t.updateColumn({layout:i,index:s,...e})}}},"k-layout",{...i,disabled:t.disabled,endpoints:t.endpoints,fieldsetGroups:t.fieldsetGroups,fieldsets:t.fieldsets,isSelected:t.selected===i.id,layouts:t.layouts,settings:t.settings},!1))})),1)]:!1===t.hasFieldsets?e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"}},[t._v(" "+t._s(t.$t("field.blocks.fieldsets.empty"))+" ")]):e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"},on:{click:function(e){return t.select(0)}}},[t._v(" "+t._s(t.empty??t.$t("field.layout.empty"))+" ")])],2)}),[]).exports;const Gi=ct({mixins:[Fe,Wi,V],inheritAttrs:!1,computed:{hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.value.length},options(){return[{click:()=>this.$refs.layouts.copy(),disabled:this.isEmpty,icon:"template",text:this.$t("copy.all")},{click:()=>this.$refs.layouts.pasteboard(),icon:"download",text:this.$t("paste")},"-",{click:()=>this.$refs.layouts.removeAll(),disabled:this.isEmpty,icon:"trash",text:this.$t("delete.all")}]}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-layout-field",scopedSlots:t._u([!t.disabled&&t.hasFieldsets?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{staticClass:"input-focus",attrs:{autofocus:t.autofocus,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.layouts.select(0)}}}),e("k-button",{attrs:{icon:"dots",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:t.options,"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-layouts",t._b({ref:"layouts",on:{input:function(e){return t.$emit("input",e)}}},"k-layouts",t.$props,!1)),!t.disabled&&t.hasFieldsets?e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.layouts.select(t.value.length)}}})],1):t._e()],1)}),[]).exports;const Xi=ct({},(function(){return(0,this._self._c)("hr",{staticClass:"k-line-field"})}),[]).exports;const Zi=ct({mixins:[{mixins:[Fe,Ue,Ie,nt],props:{value:{default:"",type:String}}}],inheritAttrs:!1,data:()=>({linkType:null,linkValue:null,expanded:!1,isInvalid:!1}),computed:{activeTypes(){return this.$helper.link.types(this.options)},activeTypesOptions(){const t=[];for(const e in this.activeTypes)t.push({click:()=>this.switchType(e),current:e===this.currentType.id,icon:this.activeTypes[e].icon,label:this.activeTypes[e].label});return t},currentType(){return this.activeTypes[this.linkType]??Object.values(this.activeTypes)[0]}},watch:{value:{async handler(t,e){if(t===e||t===this.linkValue)return;const i=this.$helper.link.detect(t,this.activeTypes);i&&(this.linkType=i.type,this.linkValue=i.link)},immediate:!0}},mounted(){this.$events.on("click",this.onOutsideClick)},destroyed(){this.$events.off("click",this.onOutsideClick)},methods:{clear(){this.linkValue="",this.$emit("input","")},focus(){var t;null==(t=this.$refs.input)||t.focus()},onInput(t){const e=(null==t?void 0:t.trim())??"";if(this.linkType??(this.linkType=this.currentType.id),this.linkValue=e,!e.length)return this.clear();this.$emit("input",this.currentType.value(e))},onInvalid(t){this.isInvalid=!!t},onOutsideClick(t){!1===this.$el.contains(t.target)&&(this.expanded=!1)},removeModel(){this.clear(),this.expanded=!1},selectModel(t){t.uuid?this.onInput(t.uuid):(this.switchType("url"),this.onInput(t.url))},async switchType(t){t!==this.currentType.id&&(this.isInvalid=!1,this.linkType=t,this.clear(),"page"===this.currentType.id||"file"===this.currentType.id?this.expanded=!0:this.expanded=!1,await this.$nextTick(),this.focus())},toggle(){this.expanded=!this.expanded}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-link-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({attrs:{invalid:t.isInvalid,icon:!1}},"k-input",t.$props,!1),[e("div",{staticClass:"k-link-input-header"},[e("k-button",{staticClass:"k-link-input-toggle",attrs:{disabled:t.disabled,dropdown:!t.disabled&&t.activeTypesOptions.length>1,icon:t.currentType.icon,variant:"filled"},on:{click:function(e){t.activeTypesOptions.length>1?t.$refs.types.toggle():t.toggle()}}},[t._v(" "+t._s(t.currentType.label)+" ")]),e("k-dropdown-content",{ref:"types",attrs:{options:t.activeTypesOptions}}),"page"===t.currentType.id||"file"===t.currentType.id?e("div",{staticClass:"k-link-input-model",on:{click:t.toggle}},[e("k-link-field-preview",{attrs:{removable:!0,type:t.currentType.id,value:t.value},on:{remove:t.removeModel},scopedSlots:t._u([{key:"placeholder",fn:function(){return[e("k-button",{staticClass:"k-link-input-model-placeholder"},[t._v(" "+t._s(t.currentType.placeholder)+" ")])]},proxy:!0}],null,!1,3171606015)}),e("k-button",{staticClass:"k-link-input-model-toggle",attrs:{icon:"bars"}})],1):e("k-"+t.currentType.input+"-input",{ref:"input",tag:"component",attrs:{id:t.id,disabled:t.disabled,pattern:t.currentType.pattern??null,placeholder:t.currentType.placeholder,value:t.linkValue},on:{invalid:t.onInvalid,input:t.onInput}})],1),"page"===t.currentType.id?e("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"k-link-input-body",attrs:{"data-type":"page"}},[e("div",{staticClass:"k-page-browser"},[e("k-page-tree",{attrs:{current:t.$helper.link.getPageUUID(t.value),root:!1},on:{select:function(e){return t.selectModel(e)}}})],1)]):"file"===t.currentType.id?e("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"k-link-input-body",attrs:{"data-type":"file"}},[e("k-file-browser",{attrs:{opened:t.$panel.view.props.model.uuid??t.$panel.view.props.model.id,selected:t.$helper.link.getFileUUID(t.value)},on:{select:function(e){return t.selectModel(e)}}})],1):t._e()])],1)}),[]).exports;const Qi=t=>({$from:e})=>((t,e)=>{for(let i=t.depth;i>0;i--){const s=t.node(i);if(e(s))return{pos:i>0?t.before(i):0,start:t.start(i),depth:i,node:s}}})(e,t),ts=t=>e=>{if((t=>t instanceof o)(e)){const{node:i,$from:s}=e;if(((t,e)=>Array.isArray(t)&&t.indexOf(e.type)>-1||e.type===t)(t,i))return{node:i,pos:s.pos,depth:s.depth}}},es=(t,e,i={})=>{const s=ts(e)(t.selection)||Qi((t=>t.type===e))(t.selection);return 0!==yt(i)&&s?s.node.hasMarkup(e,{...s.node.attrs,...i}):!!s};function is(t=null,e=null){if(!t||!e)return!1;const i=t.parent.childAfter(t.parentOffset);if(!i.node)return!1;const s=i.node.marks.find((t=>t.type===e));if(!s)return!1;let n=t.index(),o=t.start()+i.offset,a=n+1,r=o+i.node.nodeSize;for(;n>0&&s.isInSet(t.parent.child(n-1).marks);)n-=1,o-=t.parent.child(n).nodeSize;for(;a{n=[...n,...t.marks]}));const o=n.find((t=>t.type.name===e.name));return o?o.attrs:{}},getNodeAttrs:function(t,e){const{from:i,to:s}=t.selection;let n=[];t.doc.nodesBetween(i,s,(t=>{n=[...n,t]}));const o=n.reverse().find((t=>t.type.name===e.name));return o?o.attrs:{}},insertNode:function(t,e,i,s){return(n,o)=>{o(n.tr.replaceSelectionWith(t.create(e,i,s)).scrollIntoView())}},markInputRule:function(t,i,s){return new e(t,((t,e,n,o)=>{const a=s instanceof Function?s(e):s,{tr:r}=t,l=e.length-1;let c=o,u=n;if(e[l]){const s=n+e[0].indexOf(e[l-1]),a=s+e[l-1].length-1,d=s+e[l-1].lastIndexOf(e[l]),p=d+e[l].length,h=function(t,e,i){let s=[];return i.doc.nodesBetween(t,e,((t,e)=>{s=[...s,...t.marks.map((i=>({start:e,end:e+t.nodeSize,mark:i})))]})),s}(n,o,t).filter((t=>{const{excluded:e}=t.mark.type;return e.find((t=>t.name===i.name))})).filter((t=>t.end>s));if(h.length)return!1;ps&&r.delete(s,d),u=s,c=u+e[l].length}return r.addMark(u,c,i.create(a)),r.removeStoredMark(i),r}))},markIsActive:function(t,e){const{from:i,$from:s,to:n,empty:o}=t.selection;return o?!!e.isInSet(t.storedMarks||s.marks()):!!t.doc.rangeHasMark(i,n,e)},markPasteRule:function(t,e,o){const a=(i,s)=>{const r=[];return i.forEach((i=>{var n;if(i.isText){const{text:a,marks:l}=i;let c,u=0;const d=!!l.filter((t=>"link"===t.type.name))[0];for(;!d&&null!==(c=t.exec(a));)if((null==(n=null==s?void 0:s.type)?void 0:n.allowsMarkType(e))&&c[1]){const t=c.index,s=t+c[0].length,n=t+c[0].indexOf(c[1]),a=n+c[1].length,l=o instanceof Function?o(c):o;t>0&&r.push(i.cut(u,t)),r.push(i.cut(n,a).mark(e.create(l).addToSet(i.marks))),u=s}unew s(a(t.content),t.openStart,t.openEnd)}})},minMax:function(t=0,e=0,i=0){return Math.min(Math.max(parseInt(t,10),e),i)},nodeIsActive:es,nodeInputRule:function(t,i,s){return new e(t,((t,e,n,o)=>{const a=s instanceof Function?s(e):s,{tr:r}=t;return e[0]&&r.replaceWith(n,o,i.create(a)),r}))},pasteRule:function(t,e,o){const a=i=>{const s=[];return i.forEach((i=>{if(i.isText){const{text:n}=i;let a,r=0;do{if(a=t.exec(n),a){const t=a.index,n=t+a[0].length,l=o instanceof Function?o(a[0]):o;t>0&&s.push(i.cut(r,t)),s.push(i.cut(t,n).mark(e.create(l).addToSet(i.marks))),r=n}}while(a);rnew s(a(t.content),t.openStart,t.openEnd)}})},removeMark:function(t){return(e,i)=>{const{tr:s,selection:n}=e;let{from:o,to:a}=n;const{$from:r,empty:l}=n;if(l){const e=is(r,t);o=e.from,a=e.to}return s.removeMark(o,a,t),i(s)}},toggleBlockType:function(t,e,i={}){return(s,n,o)=>es(s,t,i)?a(e)(s,n,o):a(t,i)(s,n,o)},toggleList:function(t,e){return(i,s,n)=>{const{schema:o,selection:a}=i,{$from:c,$to:u}=a,d=c.blockRange(u);if(!d)return!1;const p=Qi((t=>ss(t,o)))(a);if(d.depth>=1&&p&&d.depth-p.depth<=1){if(p.node.type===t)return r(e)(i,s,n);if(ss(p.node,o)&&t.validContent(p.node.content)){const{tr:e}=i;return e.setNodeMarkup(p.pos,t),s&&s(e),!1}}return l(t)(i,s,n)}},toggleWrap:function(t,e={}){return(i,s,n)=>es(i,t,e)?c(i,s):u(t,e)(i,s,n)},updateMark:function(t,e){return(i,s)=>{const{tr:n,selection:o,doc:a}=i,{ranges:r,empty:l}=o;if(l){const{from:i,to:s}=is(o.$from,t);a.rangeHasMark(i,s,t)&&n.removeMark(i,s,t),n.addMark(i,s,t.create(e))}else r.forEach((i=>{const{$to:s,$from:o}=i;a.rangeHasMark(o.pos,s.pos,t)&&n.removeMark(o.pos,s.pos,t),n.addMark(o.pos,s.pos,t.create(e))}));return s(n)}}};class os{emit(t,...e){this._callbacks=this._callbacks??{};const i=this._callbacks[t]??[];for(const s of i)s.apply(this,e);return this}off(t,e){if(arguments.length){const i=this._callbacks?this._callbacks[t]:null;i&&(e?this._callbacks[t]=i.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}}class as{constructor(t=[],e){for(const i of t)i.bindEditor(e),i.init();this.extensions=t}commands({schema:t,view:e}){return this.extensions.filter((t=>t.commands)).reduce(((i,s)=>{const{name:n,type:o}=s,a={},r=s.commands({schema:t,utils:ns,...["node","mark"].includes(o)?{type:t[`${o}s`][n]}:{}}),l=(t,i)=>{a[t]=t=>{if("function"!=typeof i||!e.editable)return!1;e.focus();const s=i(t);return"function"==typeof s?s(e.state,e.dispatch,e):s}};if("object"==typeof r)for(const[t,e]of Object.entries(r))l(t,e);else l(n,r);return{...i,...a}}),{})}buttons(t="mark"){const e={};for(const i of this.extensions)if(i.type===t&&i.button)if(Array.isArray(i.button))for(const t of i.button)e[t.id??t.name]=t;else e[i.name]=i.button;return e}getAllowedExtensions(t){return t instanceof Array||!t?t instanceof Array?this.extensions.filter((e=>!t.includes(e.name))):this.extensions:[]}getFromExtensions(t,e,i=this.extensions){return i.filter((t=>["extension"].includes(t.type))).filter((e=>e[t])).map((i=>i[t]({...e,utils:ns})))}getFromNodesAndMarks(t,e,i=this.extensions){return i.filter((t=>["node","mark"].includes(t.type))).filter((e=>e[t])).map((i=>i[t]({...e,type:e.schema[`${i.type}s`][i.name],utils:ns})))}inputRules({schema:t,excludedExtensions:e}){const i=this.getAllowedExtensions(e);return[...this.getFromExtensions("inputRules",{schema:t},i),...this.getFromNodesAndMarks("inputRules",{schema:t},i)].reduce(((t,e)=>[...t,...e]),[])}keymaps({schema:t}){return[...this.getFromExtensions("keys",{schema:t}),...this.getFromNodesAndMarks("keys",{schema:t})].map((t=>v(t)))}get marks(){return this.extensions.filter((t=>"mark"===t.type)).reduce(((t,{name:e,schema:i})=>({...t,[e]:i})),{})}get markViews(){return this.extensions.filter((t=>["mark"].includes(t.type))).filter((t=>t.view)).reduce(((t,{name:e,view:i})=>({...t,[e]:i})),{})}get nodes(){return this.extensions.filter((t=>"node"===t.type)).reduce(((t,{name:e,schema:i})=>({...t,[e]:i})),{})}get nodeViews(){return this.extensions.filter((t=>["node"].includes(t.type))).filter((t=>t.view)).reduce(((t,{name:e,view:i})=>({...t,[e]:i})),{})}get options(){const{view:t}=this;return this.extensions.reduce(((e,i)=>({...e,[i.name]:new Proxy(i.options,{set(e,i,s){const n=e[i]!==s;return Object.assign(e,{[i]:s}),n&&t.updateState(t.state),!0}})})),{})}pasteRules({schema:t,excludedExtensions:e}){const i=this.getAllowedExtensions(e);return[...this.getFromExtensions("pasteRules",{schema:t},i),...this.getFromNodesAndMarks("pasteRules",{schema:t},i)].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 i?t:new i(t)))}}class rs{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 ls extends rs{constructor(t={}){super(t)}get type(){return"node"}get schema(){return{}}commands(){return{}}}class cs extends ls{get defaults(){return{inline:!1}}get name(){return"doc"}get schema(){return{content:this.options.inline?"inline*":"block+"}}}class us extends ls{get button(){return{id:this.name,icon:"paragraph",label:window.panel.$t("toolbar.button.paragraph"),name:this.name,separator:!0}}commands({utils:t,schema:e,type:i}){return{paragraph:()=>this.editor.activeNodes.includes("bulletList")?t.toggleList(e.nodes.bulletList,e.nodes.listItem):this.editor.activeNodes.includes("orderedList")?t.toggleList(e.nodes.orderedList,e.nodes.listItem):this.editor.activeNodes.includes("quote")?t.toggleWrap(e.nodes.quote):t.setBlockType(i)}}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}get name(){return"paragraph"}}let ds=class extends ls{get name(){return"text"}get schema(){return{group:"inline"}}};class ps extends os{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!0!==this.options.useBuiltInExtensions?[]:[new cs({inline:this.options.inline}),new ds,new us]}buttons(t){return this.extensions.buttons(t)}clearContent(t=!1){this.setContent(this.options.emptyDocument,t)}command(t,...e){var i,s;null==(s=(i=this.commands)[t])||s.call(i,...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(i){return window.console.warn("Invalid content.","Passed value:",t,"Error:",i),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"==typeof t){const i=`

        ${t}
        `,s=(new window.DOMParser).parseFromString(i,"text/html").body.firstElementChild;return y.fromSchema(this.schema).parse(s,e)}return!1}createEvents(){const t=this.options.events??{};for(const[e,i]of Object.entries(t))this.on(e,i);return t}createExtensions(){return new as([...this.builtInExtensions,...this.options.extensions],this)}createFocusEvents(){const t=(t,e,i=!0)=>{this.focused=i,this.emit(i?"focus":"blur",{event:e,state:t.state,view:t});const s=this.state.tr.setMeta("focused",i);this.view.dispatch(s)};return new i({props:{attributes:{tabindex:0},handleDOMEvents:{focus:(e,i)=>t(e,i,!0),blur:(e,i)=>t(e,i,!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}createMarkViews(){return this.extensions.markViews}createNodes(){return this.extensions.nodes}createNodeViews(){return this.extensions.nodeViews}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createPlugins(){return this.extensions.plugins({schema:this.schema})}createSchema(){return new $({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return w.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,x({rules:this.inputRules}),...this.pasteRules,...this.keymaps,v({Backspace:O}),v(M),this.createFocusEvents()]})}createView(){return new _(this.element,{dispatchTransaction:this.dispatchTransaction.bind(this),attributes:{class:"k-text"},editable:()=>this.options.editable,handlePaste:(t,e)=>{if("function"==typeof this.events.paste){const t=e.clipboardData.getData("text/html"),i=e.clipboardData.getData("text/plain");if(!0===this.events.paste(e,t,i))return!0}},handleDrop:(...t)=>{this.emit("drop",...t)},markViews:this.createMarkViews(),nodeViews:this.createNodeViews(),state:this.createState()})}destroy(){this.view&&this.view.destroy()}dispatchTransaction(t){const e=this.state,i=this.state.apply(t);this.view.updateState(i),this.setActiveNodesAndMarks();const s={editor:this,getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:t};this.emit("transaction",s),!t.docChanged&&t.getMeta("preventUpdate")||this.emit("update",s);const{from:n,to:o}=this.state.selection,a=!e||!e.selection.eq(i.selection);this.emit(i.selection.empty?"deselect":"select",{...s,from:n,hasChanged:a,to:o})}focus(t=null){if(this.view.focused&&null===t||!1===t)return;const{from:e,to:i}=this.selectionAtPosition(t);this.setSelection(e,i),setTimeout((()=>this.view.focus()),10)}getHTML(t=this.state.doc.content){const e=document.createElement("div"),i=C.fromSchema(this.schema).serializeFragment(t);return e.appendChild(i),this.options.inline&&e.querySelector("p")?e.querySelector("p").innerHTML:e.innerHTML}getHTMLStartToSelection(){const t=this.state.doc.slice(0,this.selection.head).content;return this.getHTML(t)}getHTMLSelectionToEnd(){const t=this.state.doc.slice(this.selection.head).content;return this.getHTML(t)}getHTMLStartToSelectionToEnd(){return[this.getHTMLStartToSelection(),this.getHTMLSelectionToEnd()]}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.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)}insertText(t,e=!1){const{tr:i}=this.state,s=i.insertText(t);if(this.view.dispatch(s),e){const e=i.selection.from,s=e-t.length;this.setSelection(s,e)}}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,i])=>({...t,[e]:(t={})=>i(t)})),{})}removeMark(t){if(this.schema.marks[t])return ns.removeMark(this.schema.marks[t])(this.state,this.view.dispatch)}get selection(){return this.state.selection}get selectionAtEnd(){return S.atEnd(this.state.doc)}get selectionIsAtEnd(){return this.selection.head===this.selectionAtEnd.head}get selectionAtStart(){return S.atStart(this.state.doc)}get selectionIsAtStart(){return this.selection.head===this.selectionAtStart.head}selectionAtPosition(t=null){return null===t?this.selection:"start"===t||!0===t?this.selectionAtStart:"end"===t?this.selectionAtEnd:{from:t,to:t}}setActiveNodesAndMarks(){this.activeMarks=Object.values(this.schema.marks).filter((t=>ns.markIsActive(this.state,t))).map((t=>t.name)),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce(((t,[e,i])=>({...t,[e]:ns.getMarkAttrs(this.state,i)})),{}),this.activeNodes=Object.values(this.schema.nodes).filter((t=>ns.nodeIsActive(this.state,t))).map((t=>t.name)),this.activeNodeAttrs=Object.entries(this.schema.nodes).reduce(((t,[e,i])=>({...t,[e]:ns.getNodeAttrs(this.state,i)})),{})}setContent(t={},e=!1,i){const{doc:s,tr:n}=this.state,o=this.createDocument(t,i),a=n.replaceWith(0,s.content.size,o).setMeta("preventUpdate",!e);this.view.dispatch(a)}setSelection(t=0,e=0){const{doc:i,tr:s}=this.state,n=ns.minMax(t,0,i.content.size),o=ns.minMax(e,0,i.content.size),a=S.create(i,n,o),r=s.setSelection(a);this.view.dispatch(r)}get state(){var t;return null==(t=this.view)?void 0:t.state}toggleMark(t){if(this.schema.marks[t])return ns.toggleMark(this.schema.marks[t])(this.state,this.view.dispatch)}updateMark(t,e){if(this.schema.marks[t])return ns.updateMark(this.schema.marks[t],e)(this.state,this.view.dispatch)}}class hs extends rs{command(){return()=>{}}remove(){this.editor.removeMark(this.name)}get schema(){return{}}get type(){return"mark"}toggle(){return this.editor.toggleMark(this.name)}update(t){this.editor.updateMark(this.name,t)}}class ms extends hs{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 fs extends hs{get button(){return{icon:"clear",label:window.panel.$t("toolbar.button.clear")}}commands(){return()=>this.clear()}clear(){const{state:t}=this.editor,{from:e,to:i}=t.tr.selection;for(const s of this.editor.activeMarks){const n=t.schema.marks[s],o=this.editor.state.tr.removeMark(e,i,n);this.editor.view.dispatch(o)}}get name(){return"clear"}}let gs=class extends hs{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 ks extends hs{get button(){return{icon:"email",label:window.panel.$t("toolbar.button.email")}}commands(){return{email:t=>{if(t.altKey||t.metaKey)return this.remove();this.editor.emit("email",this.editor)},insertEmail:(t={})=>{const{selection:e}=this.editor.state;if(e.empty&&this.editor.insertText(t.href,!0),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,i)=>{const s=this.editor.getMarkAttrs("email");s.href&&!0===i.altKey&&i.target instanceof HTMLAnchorElement&&(i.stopPropagation(),window.open(s.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 bs extends hs{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]}}}let vs=class extends hs{get button(){return{icon:"url",label:window.panel.$t("toolbar.button.link")}}commands(){return{link:t=>{if(t.altKey||t.metaKey)return this.remove();this.editor.emit("link",this.editor)},insertLink:(t={})=>{const{selection:e}=this.editor.state;if(e.empty&&!1===this.editor.activeMarks.includes("link")&&this.editor.insertText(t.href,!0),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,i)=>{const s=this.editor.getMarkAttrs("link");s.href&&!0===i.altKey&&i.target instanceof HTMLAnchorElement&&(i.stopPropagation(),window.open(s.href,s.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},0]}}};class ys extends hs{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]}}}let $s=class extends hs{get button(){return{icon:"superscript",label:window.panel.$t("toolbar.button.sup")}}commands(){return()=>this.toggle()}get name(){return"sup"}get schema(){return{parseDOM:[{tag:"sup"}],toDOM:()=>["sup",0]}}};class ws extends hs{get button(){return{icon:"subscript",label:window.panel.$t("toolbar.button.sub")}}commands(){return()=>this.toggle()}get name(){return"sub"}get schema(){return{parseDOM:[{tag:"sub"}],toDOM:()=>["sub",0]}}}class xs extends hs{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 _s extends ls{get button(){return{id:this.name,icon:"list-bullet",label:window.panel.$t("toolbar.button.ul"),name:this.name,when:["listItem","bulletList","orderedList","paragraph"]}}commands({type:t,schema:e,utils:i}){return()=>i.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^\s*([-+*])\s$/,t)]}keys({type:t,schema:e,utils:i}){return{"Shift-Ctrl-8":i.toggleList(t,e.nodes.listItem)}}get name(){return"bulletList"}get schema(){return{content:"listItem+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]}}}class Cs extends ls{commands({utils:t,type:e}){return()=>this.createHardBreak(t,e)}createHardBreak(t,e){return t.chainCommands(t.exitCode,t.insertNode(e))}get defaults(){return{enter:!1,text:!1}}keys({utils:t,type:e}){const i=this.createHardBreak(t,e);let s={"Mod-Enter":i,"Shift-Enter":i};return this.options.enter&&(s.Enter=i),s}get name(){return"hardBreak"}get schema(){return{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]}}}class Ss extends ls{get button(){const t=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"]})));return t[t.length-1].separator=!0,t}commands({type:t,schema:e,utils:i}){let s={toggleHeading:s=>i.toggleBlockType(t,e.nodes.paragraph,s)};for(const n of this.options.levels)s[`h${n}`]=()=>i.toggleBlockType(t,e.nodes.paragraph,{level:n});return s}get defaults(){return{levels:[1,2,3,4,5,6]}}inputRules({type:t,utils:e}){return this.options.levels.map((i=>e.textblockTypeInputRule(new RegExp(`^(#{1,${i}})\\s$`),t,(()=>({level:i})))))}keys({type:t,utils:e}){return this.options.levels.reduce(((i,s)=>({...i,[`Shift-Ctrl-${s}`]:e.setBlockType(t,{level:s})})),{})}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 Os extends ls{commands({type:t,utils:e}){return()=>e.insertNode(t)}inputRules({type:t,utils:e}){const i=e.nodeInputRule(/^(?:---|___\s|\*\*\*\s)$/,t),s=i.handler;return i.handler=(t,e,i,n)=>s(t,e,i,n).replaceWith(i-1,i,""),[i]}get name(){return"horizontalRule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}}class Ms extends ls{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 As extends ls{get button(){return{id:this.name,icon:"list-numbers",label:window.panel.$t("toolbar.button.ol"),name:this.name,when:["listItem","bulletList","orderedList","paragraph"],separator:!0}}commands({type:t,schema:e,utils:i}){return()=>i.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:i}){return{"Shift-Ctrl-9":i.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 Is extends ls{get button(){return{id:this.name,icon:"quote",label:window.panel.$t("field.blocks.quote.name"),name:this.name}}commands({type:t,utils:e}){return()=>e.toggleWrap(t)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^\s*>\s$/,t)]}keys({utils:t}){return{"Shift-Tab":(e,i)=>t.lift(e,i)}}get name(){return"quote"}get schema(){return{content:"block+",group:"block",defining:!0,draggable:!1,parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]}}}let Ds=class extends rs{commands(){return{undo:()=>A,redo:()=>I,undoDepth:()=>D,redoDepth:()=>j}}get defaults(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":A,"Mod-y":I,"Shift-Mod-z":I,"Mod-я":A,"Shift-Mod-я":I}}get name(){return"history"}plugins(){return[E({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}};class js extends rs{commands(){return{insertHtml:t=>(e,i)=>{let s=document.createElement("div");s.innerHTML=t.trim();const n=y.fromSchema(e.schema).parse(s);i(e.tr.replaceSelectionWith(n).scrollIntoView())}}}}class Es extends rs{keys(){const t={};for(const e in this.options)t[e]=()=>(this.options[e](),!0);return t}}let Ls=class extends rs{constructor(t){super(),this.writer=t}get component(){return this.writer.$refs.toolbar}init(){this.editor.on("deselect",(({event:t})=>{var e;return null==(e=this.component)?void 0:e.close(t)})),this.editor.on("select",(({hasChanged:t})=>{var e;!1!==t&&(null==(e=this.component)||e.open())}))}get type(){return"toolbar"}};const Ts={mixins:[V,W,at,lt],props:{breaks:Boolean,code:Boolean,emptyDocument:{type:Object,default:()=>({type:"doc",content:[]})},extensions:Array,headings:{default:()=>[1,2,3,4,5,6],type:[Array,Boolean]},inline:Boolean,keys:Object,marks:{type:[Array,Boolean],default:!0},nodes:{type:[Array,Boolean],default:()=>["heading","bulletList","orderedList"]},paste:{type:Function,default:()=>()=>!1},toolbar:{type:Object,default:()=>({inline:!0})},value:{type:String,default:""}}};const Bs=ct({mixins:[Ts],emits:["input"],data(){return{editor:null,json:{},html:this.value,isEmpty:!0}},computed:{isCursorAtEnd(){return this.editor.selectionIsAtEnd},isCursorAtStart(){return this.editor.selectionIsAtStart},toolbarOptions(){return{marks:Array.isArray(this.marks)?this.marks:void 0,...this.toolbar,editor:this.editor}}},watch:{value(t,e){t!==e&&t!==this.html&&(this.html=t,this.editor.setContent(this.html))}},mounted(){this.editor=new ps({autofocus:this.autofocus,content:this.value,editable:!this.disabled,element:this.$el,emptyDocument:this.emptyDocument,parseOptions:{preserveWhitespace:!0},events:{link:t=>{this.$panel.dialog.open({component:"k-link-dialog",props:{value:t.getMarkAttrs("link")},on:{cancel:()=>t.focus(),submit:e=>{this.$panel.dialog.close(),t.command("toggleLink",e)}}})},email:t=>{this.$panel.dialog.open({component:"k-email-dialog",props:{value:this.editor.getMarkAttrs("email")},on:{cancel:()=>t.focus(),submit:e=>{this.$panel.dialog.close(),t.command("toggleEmail",e)}}})},paste:this.paste,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 Es(this.keys),new Ds,new js,new Ls(this),...this.extensions||[]],inline:this.inline}),this.isEmpty=this.editor.isEmpty(),this.json=this.editor.getJSON(),this.$panel.events.on("click",this.onBlur),this.$panel.events.on("focus",this.onBlur)},beforeDestroy(){this.editor.destroy(),this.$panel.events.off("click",this.onBlur),this.$panel.events.off("focus",this.onBlur)},methods:{command(t,...e){this.editor.command(t,...e)},createMarks(){return this.filterExtensions({clear:new fs,code:new gs,underline:new xs,strike:new ys,link:new vs,email:new ks,bold:new ms,italic:new bs,sup:new $s,sub:new ws,...this.createMarksFromPanelPlugins()},this.marks)},createMarksFromPanelPlugins(){const t=window.panel.plugins.writerMarks??{},e={};for(const i in t)e[i]=Object.create(hs.prototype,Object.getOwnPropertyDescriptors({name:i,...t[i]}));return e},createNodes(){const t=new Cs({text:!0,enter:this.inline});return this.filterExtensions({bulletList:new _s,orderedList:new As,heading:new Ss({levels:this.headings}),horizontalRule:new Os,listItem:new Ms,quote:new Is,...this.createNodesFromPanelPlugins()},this.nodes,((e,i)=>((e.includes("bulletList")||e.includes("orderedList"))&&i.push(new Ms),!0===this.inline&&(i=i.filter((t=>!0===t.schema.inline))),i.push(t),i)))},createNodesFromPanelPlugins(){const t=window.panel.plugins.writerNodes??{},e={};for(const i in t)e[i]=Object.create(ls.prototype,Object.getOwnPropertyDescriptors({name:i,...t[i]}));return e},getHTML(){return this.editor.getHTML()},filterExtensions(t,e,i){!1===e?e=[]:!0!==e&&!1!==Array.isArray(e)||(e=Object.keys(t));let s=[];for(const n in t)e.includes(n)&&s.push(t[n]);return"function"==typeof i&&(s=i(e,s)),s},focus(){this.editor.focus()},getSplitContent(){return this.editor.getHTMLStartToSelectionToEnd()},onBlur(t){var e;!1===this.$el.contains(t.target)&&(null==(e=this.$refs.toolbar)||e.close())},onCommand(t,...e){this.editor.command(t,...e)}}},(function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"direction",rawName:"v-direction"}],ref:"editor",staticClass:"k-writer",attrs:{"data-disabled":t.disabled,"data-empty":t.isEmpty,"data-placeholder":t.placeholder,"data-toolbar-inline":Boolean(t.toolbar.inline??!0),spellcheck:t.spellcheck}},[t.editor&&!t.disabled?e("k-writer-toolbar",t._b({ref:"toolbar",on:{command:t.onCommand}},"k-writer-toolbar",t.toolbarOptions,!1)):t._e()],1)}),[]).exports,qs={mixins:[Ie,Ts,et,it]};const Ps=ct({mixins:[De,qs],computed:{counterValue(){const t=this.$helper.string.stripHTML(this.value??"");return this.$helper.string.unescapeHTML(t)}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)}},validations(){return{counterValue:{required:!this.required||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.maxLength(this.maxlength)}}}},(function(){var t=this;return(0,t._self._c)("k-writer",t._b({ref:"input",staticClass:"k-writer-input",on:{input:function(e){return t.$emit("input",e)}}},"k-writer",t.$props,!1))}),[]).exports;class Ns extends cs{get schema(){return{content:this.options.nodes.join("|")}}}const zs={mixins:[qs],inheritAttrs:!1,props:{nodes:{type:Array,default:()=>["bulletList","orderedList"]}}};const Fs=ct({mixins:[De,zs],data(){return{list:this.value,html:this.value}},computed:{listExtensions(){return[new Ns({inline:!0,nodes:this.nodes})]}},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.listExtensions,value:t.list},on:{input:t.onInput}},"k-writer",t.$props,!1))}),[]).exports;const Ys=ct({mixins:[Fe,Ue,zs],inheritAttrs:!1,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.id,counter:!1}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"list"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,Rs={mixins:[W,X,nt],inheritAttrs:!1,props:{layout:String,sort:{default:!1,type:Boolean},value:{default:()=>[],type:Array}}};const Us=ct({mixins:[Rs],props:{draggable:{default:!0,type:Boolean}},emits:["edit","input"],data:()=>({tags:[]}),computed:{dragOptions(){return{delay:1,disabled:!this.isDraggable,draggable:".k-tag",handle:".k-tag-text"}},isDraggable(){return!0!==this.sort&&!1!==this.draggable&&0!==this.tags.length&&!0!==this.disabled}},watch:{value:{handler(){let t=structuredClone(this.value);if(!0===this.sort){const e=[];for(const i of this.options){const s=t.indexOf(i.value);-1!==s&&(e.push(i),t.splice(s,1))}e.push(...t),t=e}this.tags=t.map(this.tag).filter((t=>t))},immediate:!0}},methods:{edit(t,e,i){!1===this.disabled&&this.$emit("edit",t,e,i)},focus(t="last"){this.$refs.navigate.move(t)},index(t){return this.tags.findIndex((e=>e.value===t.value))},input(){this.$emit("input",this.tags.map((t=>t.value)))},navigate(t){this.focus(t)},remove(t){this.tags.length<=1?this.navigate("last"):this.navigate("prev"),this.tags.splice(t,1),this.input()},option(t){return this.options.find((e=>e.value===t.value))},select(){this.focus()},tag(t){"object"!=typeof t&&(t={value:t});const e=this.option(t);return e||{text:this.$helper.string.escapeHTML(t.text??t.value),value:t.value}}}},(function(){var t=this,e=t._self._c;return e("k-navigate",{ref:"navigate",attrs:{axis:"list"===t.layout?"y":"x",select:":where(.k-tag, .k-tags-navigatable):not(:disabled)"}},[e("k-draggable",{staticClass:"k-tags",attrs:{list:t.tags,options:t.dragOptions,"data-layout":t.layout},on:{end:t.input},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("default")]},proxy:!0}],null,!0)},t._l(t.tags,(function(i,s){return e("k-tag",{key:s,attrs:{disabled:t.disabled,image:i.image,removable:!t.disabled,name:"tag"},on:{remove:function(e){return t.remove(s,i)}},nativeOn:{click:function(t){t.stopPropagation()},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.edit(s,i,e)},dblclick:function(e){return t.edit(s,i,e)}}},[e("span",{domProps:{innerHTML:t._s(i.text)}})])})),1)],1)}),[]).exports,Hs={mixins:[st,rt,Rs,je],props:{value:{default:()=>[],type:Array}},watch:{value:{handler(){this.$emit("invalid",this.$v.$invalid,this.$v)},immediate:!0}},validations(){return{value:{required:!this.required||t.required,minLength:!this.min||t.minLength(this.min),maxLength:!this.max||t.maxLength(this.max)}}},methods:{open(){this.$refs.dropdown.open(this.$el)}}};const Vs=ct({mixins:[De,Hs]},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-multiselect-input"},[e("k-tags",t._b({ref:"tags",on:{input:function(e){return t.$emit("input",e)}},nativeOn:{click:function(e){return e.stopPropagation(),t.open.apply(null,arguments)}}},"k-tags",t.$props,!1),[!t.max||t.value.length({editing:null}),computed:{canAdd(){return!this.max||this.value.length!1===this.value.includes(t.value)))},picklist(){return{disabled:this.disabled,create:this.showCreate,ignore:this.ignore,min:this.min,max:this.max,search:this.showSearch}},replacableOptions(){return this.options.filter((t=>{var e;return!1===this.value.includes(t.value)||t.value===(null==(e=this.editing)?void 0:e.tag.value)}))},showCreate(){return"options"!==this.accept&&(!this.editing||{submit:this.$t("replace.with")})},showSearch(){return!1!==this.search&&(this.editing?{placeholder:this.$t("replace.with"),...this.search}:"options"===this.accept?{placeholder:this.$t("filter"),...this.search}:this.search)}},methods:{create(t){const e=t.split(this.separator).map((t=>t.trim())),i=structuredClone(this.value);for(let s of e)s=this.$refs.tags.tag(s,this.separator),!0===this.isAllowed(s)&&i.push(s.value);this.$emit("input",i),this.$refs.create.close()},async edit(t,e){this.editing={index:t,tag:e},this.$refs.replace.open()},focus(){this.canAdd&&this.$refs.create.open()},isAllowed(t){return"object"==typeof t&&0!==t.value.trim().length&&(!("options"===this.accept&&!this.$refs.tags.option(t))&&!0!==this.value.includes(t.value))},pick(t){this.$emit("input",t),this.$refs.create.close()},replace(t){const{index:e}=this.editing,i=this.$refs.tags.tag(t);if(this.$refs.replace.close(),this.editing=null,!1===this.isAllowed(i))return!1;const s=structuredClone(this.value);s.splice(e,1,i.value),this.$emit("input",s),this.$refs.tags.navigate(e)},toggle(t){return!(t.metaKey||t.altKey||t.ctrlKey)&&("ArrowDown"===t.key?(this.$refs.create.open(),void t.preventDefault()):void(String.fromCharCode(t.keyCode).match(/(\w)/g)&&this.$refs.create.open()))}}},(function(){var t,e=this,i=e._self._c;return i("div",{staticClass:"k-tags-input",attrs:{"data-can-add":e.canAdd}},[i("k-tags",e._b({ref:"tags",on:{edit:e.edit,input:function(t){return e.$emit("input",t)}},nativeOn:{click:function(t){var i,s;t.stopPropagation(),null==(s=null==(i=e.$refs.toggle)?void 0:i.$el)||s.click()}}},"k-tags",e.$props,!1),[e.canAdd?i("k-button",{ref:"toggle",staticClass:"k-tags-input-toggle k-tags-navigatable input-focus",attrs:{id:e.id,autofocus:e.autofocus,disabled:e.disabled,size:"xs",icon:"add"},on:{click:function(t){return e.$refs.create.open()}},nativeOn:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:e.$refs.tags.focus("prev")},function(t){return e.toggle.apply(null,arguments)}]}}):e._e()],1),i("k-picklist-dropdown",e._b({ref:"replace",attrs:{multiple:!1,options:e.replacableOptions,value:(null==(t=e.editing)?void 0:t.tag.value)??""},on:{create:e.replace,input:e.replace}},"k-picklist-dropdown",e.picklist,!1)),i("k-picklist-dropdown",e._b({ref:"create",attrs:{options:e.creatableOptions,value:e.value},on:{create:e.create,input:e.pick}},"k-picklist-dropdown",e.picklist,!1))],1)}),[]).exports;const Js=ct({mixins:[Fe,Ue,Ks,xi],inheritAttrs:!1,computed:{hasNoOptions(){return 0===this.options.length&&"options"===this.accept}},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.id,counter:t.counterOptions}},"k-field",t.$props,!1),[t.hasNoOptions?e("k-empty",{attrs:{icon:t.icon,text:t.$t("options.none")}}):e("k-input",t._g(t._b({ref:"input",attrs:{type:"tags"}},"k-input",t.$props,!1),t.$listeners))],1)}),[]).exports;const Gs=ct({extends:Js,inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-multiselect-field",attrs:{input:t.id,counter:t.counterOptions}},"k-field",t.$props,!1),[t.hasNoOptions?e("k-empty",{attrs:{icon:t.icon,text:t.$t("options.none")}}):e("k-input",t._g(t._b({ref:"input",attrs:{type:"multiselect"}},"k-input",t.$props,!1),t.$listeners))],1)}),[]).exports,Xs={mixins:[Ie,at],props:{max:Number,min:Number,name:[Number,String],preselect:Boolean,step:[Number,String],value:{type:[Number,String],default:""}}};const Zs=ct({mixins:[De,Xs],data(){return{number:this.format(this.value),stepNumber:this.format(this.step),timeout:null,listeners:{...this.$listeners,input:t=>this.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)},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||t.required,min:!this.min||t.minValue(this.min),max:!this.max||t.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))}),[]).exports;const Qs=ct({mixins:[Fe,Ue,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-number-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"number"}},"k-input",t.$props,!1),t.$listeners))],1)}),[]).exports;const tn=ct({mixins:[Fe,Ue],props:{empty:String,fields:[Object,Array],value:[String,Object]},data:()=>({object:{}}),computed:{hasFields(){return this.$helper.object.length(this.fields)>0},isEmpty(){return null===this.object||0===this.$helper.object.length(this.object)},isInvalid(){return!0===this.required&&this.isEmpty}},watch:{value:{handler(t){this.object=this.valueToObject(t)},immediate:!0}},methods:{add(){this.object=this.$helper.field.form(this.fields),this.save(),this.open()},cell(t,e){this.$set(this.object,t,e),this.save()},form(t){const e=this.$helper.field.subfields(this,this.fields);if(t)for(const i in e)e[i].autofocus=i===t;return e},remove(){this.object={},this.save()},open(t){if(this.disabled)return!1;this.$panel.drawer.open({component:"k-form-drawer",props:{breadcrumb:[],icon:"box",tab:"object",tabs:{object:{fields:this.form(t)}},title:this.label,value:this.object},on:{input:t=>{for(const e in t)this.$set(this.object,e,t[e]);this.save()}}})},save(){this.$emit("input",this.object)},valueToObject:t=>"object"!=typeof t?{}:t}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-object-field",scopedSlots:t._u([!t.disabled&&t.hasFields?{key:"options",fn:function(){return[t.isEmpty?e("k-button",{attrs:{icon:"add",size:"xs",variant:"filled"},on:{click:t.add}}):e("k-button",{attrs:{icon:"remove",size:"xs",variant:"filled"},on:{click:t.remove}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[t.hasFields?[t.isEmpty?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"box"},on:{click:t.add}},[t._v(" "+t._s(t.empty??t.$t("field.object.empty"))+" ")]):e("table",{staticClass:"k-table k-object-field-table",attrs:{"aria-disabled":t.disabled,"data-invalid":t.isInvalid}},[e("tbody",[t._l(t.fields,(function(i){return[i.saveable&&t.$helper.field.isVisible(i,t.value)?e("tr",{key:i.name,on:{click:function(e){return t.open(i.name)}}},[e("th",{attrs:{"data-has-button":"","data-mobile":"true"}},[e("button",{attrs:{type:"button"}},[t._v(t._s(i.label))])]),e("k-table-cell",{attrs:{column:i,field:i,mobile:!0,value:t.object[i.name]},on:{input:function(e){return t.cell(i.name,e)}}})],1):t._e()]}))],2)])]:[e("k-empty",{attrs:{icon:"box"}},[t._v(t._s(t.$t("fields.empty")))])]],2)}),[]).exports;const en=ct({extends:Ni,type:"pages",computed:{emptyProps(){return{icon:"page",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.pages.empty"):this.$t("field.pages.empty.single"))}}}},null,null).exports,sn={mixins:[Li],props:{autocomplete:{type:String,default:"new-password"},type:{type:String,default:"password"}}};const nn=ct({extends:Ti,mixins:[sn]},null,null).exports;const on=ct({mixins:[Fe,Ue,sn,xi],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.id,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:{type:"password"}},"k-input",t.$props,!1),t.$listeners))],1)}),[]).exports,an={mixins:[Ie,nt],props:{columns:{default:1,type:Number},reset:{default:!0,type:Boolean},theme:String,value:[String,Number,Boolean]}};const rn=ct({mixins:[De,an],computed:{choices(){return this.options.map(((t,e)=>({autofocus:this.autofocus&&0===e,checked:this.value===t.value,disabled:this.disabled||t.disabled,id:`${this.id}-${e}`,info:t.info,label:t.text,name:this.name??this.id,type:"radio",value:t.value})))}},watch:{value:{handler(){this.validate()},immediate:!0}},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},select(){this.focus()},toggle(t){t===this.value&&this.reset&&!this.required&&this.$emit("input","")},validate(){this.$emit("invalid",this.$v.$invalid,this.$v)}},validations(){return{value:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-radio-input k-grid",style:{"--columns":t.columns},attrs:{"data-variant":"choices"}},t._l(t.choices,(function(i,s){return e("li",{key:s},[e("k-choice-input",t._b({on:{input:function(e){return t.$emit("input",i.value)}},nativeOn:{click:function(e){return e.stopPropagation(),t.toggle(i.value)}}},"k-choice-input",i,!1))],1)})),0)}),[]).exports;const ln=ct({mixins:[Fe,Ue,an],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t,e=this,i=e._self._c;return i("k-field",e._b({staticClass:"k-radio-field",attrs:{input:e.id+"-0"}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?i("k-radio-input",e._g(e._b({ref:"input"},"k-radio-input",e.$props,!1),e.$listeners)):i("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[]).exports,cn={mixins:[Ie],props:{default:[Number,String],max:{type:Number,default:100},min:{type:Number,default:0},step:{type:[Number,String],default:1},tooltip:{type:[Boolean,Object],default:()=>({before:null,after:null})},value:[Number,String]}};const un=ct({mixins:[De,cn],computed:{baseline(){return this.min<0?0:this.min},isEmpty(){return""===this.value||void 0===this.value||null===this.value},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()},value(){this.validate()}},mounted(){this.onInvalid(),this.validate(),this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},format(t){const e=document.lang?document.lang.replace("_","-"):"en",i=this.step.toString().split("."),s=i.length>1?i[1].length:0;return new Intl.NumberFormat(e,{minimumFractionDigits:s}).format(t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.$emit("input",t)},validate(){var t;const e=[];this.required&&!0===this.isEmpty&&e.push(this.$t("error.validation.required")),!1===this.isEmpty&&this.min&&this.valuethis.max&&e.push(this.$t("error.validation.max",{max:this.max})),null==(t=this.$refs.range)||t.setCustomValidity(e.join(", "))}},validations(){return{position:{required:!this.required||t.required,min:!this.min||t.minValue(this.min),max:!this.max||t.maxValue(this.max)}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-range-input",attrs:{"data-disabled":t.disabled}},[e("input",t._b({ref:"range",attrs:{type:"range"},domProps:{value:t.position},on:{input:function(e){return t.$emit("input",e.target.valueAsNumber)}}},"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.tooltip?e("output",{staticClass:"k-range-input-tooltip",attrs:{for:t.id}},[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()])}),[]).exports;const dn=ct({mixins:[Ue,Fe,cn],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.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"range"}},"k-input",t.$props,!1),t.$listeners))],1)}),[]).exports,pn={mixins:[Ie,nt,at],props:{ariaLabel:String,default:String,empty:{type:[Boolean,String],default:!0},value:{type:[String,Number,Boolean],default:""}}};const hn=ct({mixins:[De,pn],emits:["click","input"],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)},isEmpty(){return null===this.selected||void 0===this.selected||""===this.selected},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;for(const i of this.options)i.value==t&&(e=i.text);return e}},validations(){return{selected:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-select-input",attrs:{"data-disabled":t.disabled,"data-empty":t.isEmpty}},[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(i){return e("option",{key:i.value,attrs:{disabled:i.disabled},domProps:{value:i.value}},[t._v(" "+t._s(i.text)+" ")])}))],2),t._v(" "+t._s(t.label)+" ")])}),[]).exports;const mn=ct({mixins:[Fe,Ue,pn],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.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"select"}},"k-input",t.$props,!1),t.$listeners))],1)}),[]).exports,fn={mixins:[Li],props:{allow:{type:String,default:""},formData:{type:Object,default:()=>({})},sync:{type:String}}};const gn=ct({extends:Ti,mixins:[fn],data(){return{slug:this.sluggify(this.value),slugs:this.$panel.language.rules??this.$panel.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.$panel.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))}),[]).exports;const kn=ct({mixins:[Fe,Ue,fn],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;let e=null==(t=this.wizard)?void 0:t.field;if(e){const t=this.formData[e.toLowerCase()];t&&(this.slug=t)}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-slug-field",attrs:{input:t.id,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:"sparkling",size:"xs",variant:"filled"},on:{click:t.onWizard}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{value:t.slug,type:"slug"}},"k-input",t.$props,!1),t.$listeners))],1)}),[]).exports;const bn=ct({mixins:[Fe],inheritAttrs:!1,props:{autofocus:Boolean,columns:Object,duplicate:{type:Boolean,default:!0},empty:String,fields:[Array,Object],limit:Number,max:Number,min:Number,prepend:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},sortBy:String,value:{type:Array,default:()=>[]}},data:()=>({items:[],page:1}),computed:{dragOptions(){return{disabled:!this.isSortable,fallbackClass:"k-sortable-row-fallback"}},index(){return this.limit?(this.page-1)*this.limit+1:1},more(){return!0!==this.disabled&&!(this.max&&this.items.length>=this.max)},hasFields(){return this.$helper.object.length(this.fields)>0},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(){if(this.disabled)return[];let t=[],e=this.duplicate&&this.more;return t.push({icon:"edit",text:this.$t("edit"),click:"edit"}),t.push({disabled:!e,icon:"copy",text:this.$t("duplicate"),click:"duplicate"}),t.push("-"),t.push({icon:"trash",text:e?this.$t("delete"):null,click:"remove"}),t},paginatedItems(){return this.limit?this.items.slice(this.pagination.offset,this.pagination.offset+this.limit):this.items}},watch:{value:{handler(t){t!==this.items&&(this.items=this.toItems(t))},immediate:!0}},methods:{add(t=null){if(!1===this.more)return!1;(t=t??this.$helper.field.form(this.fields))._id=t._id??this.$helper.uuid(),!0===this.prepend?this.items.unshift(t):this.items.push(t),this.save(),this.open(t)},close(){this.$panel.drawer.close(this.id)},focus(){var t,e;null==(e=null==(t=this.$refs.add)?void 0:t.focus)||e.call(t)},form(t){const e=this.$helper.field.subfields(this,this.fields);if(t)for(const i in e)e[i].autofocus=i===t;return e},findIndex(t){return this.items.findIndex((e=>e._id===t._id))},navigate(t,e){const i=this.findIndex(t);!0!==this.disabled&&-1!==i&&this.open(this.items[i+e],null,!0)},open(t,e,i=!1){const s=this.findIndex(t);if(!0===this.disabled||-1===s)return!1;this.$panel.drawer.open({component:"k-structure-drawer",id:this.id,props:{icon:this.icon??"list-bullet",next:this.items[s+1],prev:this.items[s-1],tabs:{content:{fields:this.form(e)}},title:this.label,value:t},replace:i,on:{input:e=>{const i=this.findIndex(t);this.$panel.drawer.props.next=this.items[i+1],this.$panel.drawer.props.prev=this.items[i-1],this.$set(this.items,i,e),this.save()},next:()=>{this.navigate(t,1)},prev:()=>{this.navigate(t,-1)},remove:()=>{this.remove(t)}}})},option(t,e){switch(t){case"remove":this.remove(e);break;case"duplicate":this.add({...structuredClone(e),_id:this.$helper.uuid()});break;case"edit":this.open(e)}},paginate({page:t}){this.page=t},remove(t){const e=this.findIndex(t);this.disabled||-1===e||this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.structure.delete.confirm")},on:{submit:()=>{this.items.splice(e,1),this.save(),this.$panel.dialog.close(),this.close(),0===this.paginatedItems.length&&this.page>1&&this.page--}}})},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.structure.delete.confirm.all")},on:{submit:()=>{this.page=1,this.items=[],this.save(),this.$panel.dialog.close()}}})},save(t=this.items){this.$emit("input",t)},sort(t){return this.sortBy?this.$helper.array.sortBy(t,this.sortBy):t},toItems(t){return!1===Array.isArray(t)?[]:(t=t.map((t=>({_id:t._id??this.$helper.uuid(),...t}))),this.sort(t))}}},(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([t.hasFields&&!t.disabled?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{attrs:{autofocus:t.autofocus,disabled:!t.more,responsive:!0,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.add()}}}),e("k-button",{attrs:{icon:"dots",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:[{click:()=>t.add(),disabled:!t.more,icon:"add",text:t.$t("add")},{click:()=>t.removeAll(),disabled:0===t.items.length||t.disabled,icon:"trash",text:t.$t("delete.all")}],"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[t.hasFields?[0===t.items.length?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"list-bullet"},on:{click:function(e){return t.add()}}},[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,pagination:!!t.limit&&t.pagination,rows:t.paginatedItems,sortable:t.isSortable,"data-invalid":t.isInvalid},on:{cell:function(e){return t.open(e.row,e.columnIndex)},input:t.save,option:t.option,paginate:t.paginate}}),t.more?e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.add()}}})],1):t._e()]]:[e("k-empty",{attrs:{icon:"list-bullet"}},[t._v(t._s(t.$t("fields.empty")))])]],2)}),[]).exports,vn={mixins:[Li],props:{autocomplete:{default:"tel"},placeholder:{default:()=>window.panel.$t("tel.placeholder")},type:{default:"tel"}}};const yn=ct({extends:Ti,mixins:[vn]},null,null).exports;const $n=ct({mixins:[Fe,Ue,vn],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.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"tel"}},"k-input",t.$props,!1),t.$listeners))],1)}),[]).exports;const wn=ct({mixins:[Fe,Ue,Li,xi],inheritAttrs:!1,computed:{inputType(){return this.$helper.isComponent(`k-${this.type}-input`)?this.type:"text"}},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.id,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:{type:t.inputType}},"k-input",t.$props,!1),t.$listeners))],1)}),[]).exports,xn={props:{buttons:{type:[Array,Boolean],default:!0},uploads:[Boolean,Object,Array]}};const _n=ct({mixins:[xn],emits:["command"],computed:{commands(){return{headlines:{label:this.$t("toolbar.button.headings"),icon:"title",dropdown:[{label:this.$t("toolbar.button.heading.1"),icon:"h1",click:()=>this.command("prepend","#")},{label:this.$t("toolbar.button.heading.2"),icon:"h2",click:()=>this.command("prepend","##")},{label:this.$t("toolbar.button.heading.3"),icon:"h3",click:()=>this.command("prepend","###")}]},bold:{label:this.$t("toolbar.button.bold"),icon:"bold",click:()=>this.command("toggle","**"),shortcut:"b"},italic:{label:this.$t("toolbar.button.italic"),icon:"italic",click:()=>this.command("toggle","*"),shortcut:"i"},link:{label:this.$t("toolbar.button.link"),icon:"url",click:()=>this.command("dialog","link"),shortcut:"k"},email:{label:this.$t("toolbar.button.email"),icon:"email",click:()=>this.command("dialog","email"),shortcut:"e"},file:{label:this.$t("toolbar.button.file"),icon:"attachment",click:()=>this.command("file"),dropdown:this.uploads?[{label:this.$t("toolbar.button.file.select"),icon:"check",click:()=>this.command("file")},{label:this.$t("toolbar.button.file.upload"),icon:"upload",click:()=>this.command("upload")}]:void 0},code:{label:this.$t("toolbar.button.code"),icon:"code",click:()=>this.command("toggle","`")},ul:{label:this.$t("toolbar.button.ul"),icon:"list-bullet",click:()=>this.command("insert",((t,e)=>e.split("\n").map((t=>"- "+t)).join("\n")))},ol:{label:this.$t("toolbar.button.ol"),icon:"list-numbers",click:()=>this.command("insert",((t,e)=>e.split("\n").map(((t,e)=>e+1+". "+t)).join("\n")))}}},default:()=>["headlines","|","bold","italic","code","|","link","email","file","|","ul","ol"],layout(){if(!1===this.buttons)return[];const t=[],e=Array.isArray(this.buttons)?this.buttons:this.default,i={...this.commands,...window.panel.plugins.textareaButtons??{}};for(const s of e)if("|"===s)t.push("|");else if(i[s]){const e={...i[s],click:()=>{var t;null==(t=i[s].click)||t.call(this)}};t.push(e)}return t}},methods:{close(){this.$refs.toolbar.close()},command(t,...e){this.$emit("command",t,...e)},shortcut(t,e){var i;const s=this.layout.find((e=>e.shortcut===t));s&&(e.preventDefault(),null==(i=s.click)||i.call(s))}}},(function(){return(0,this._self._c)("k-toolbar",{ref:"toolbar",staticClass:"k-textarea-toolbar",attrs:{buttons:this.layout}})}),[]).exports,Cn={mixins:[xn,Ie,J,et,it,at,lt],props:{endpoints:Object,preselect:Boolean,size:String,theme:String,value:String}};const Sn=ct({mixins:[De,Cn],emits:["focus","input","submit"],data:()=>({over:!1}),computed:{uploadOptions(){const t=this.restoreSelectionCallback();return{url:this.$panel.urls.api+"/"+this.endpoints.field+"/upload",multiple:!1,on:{cancel:t,done:e=>{t((()=>this.insertUpload(e)))}}}}},watch:{async value(){this.onInvalid(),await this.$nextTick(),this.$library.autosize.update(this.$refs.input)}},async mounted(){await this.$nextTick(),this.$library.autosize(this.$refs.input),this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{dialog(t){const e=this.restoreSelectionCallback();this.$panel.dialog.open({component:"k-toolbar-"+t+"-dialog",props:{value:this.parseSelection()},on:{cancel:e,submit:t=>{this.$panel.dialog.close(),e((()=>this.insert(t)))}}})},file(){const t=this.restoreSelectionCallback();this.$panel.dialog.open({component:"k-files-dialog",props:{endpoint:this.endpoints.field+"/files",multiple:!1},on:{cancel:t,submit:e=>{t((()=>this.insertFile(e))),this.$panel.dialog.close()}}})},focus(){this.$refs.input.focus()},insert(t){const e=this.$refs.input,i=e.value;"function"==typeof t&&(t=t(this.$refs.input,this.selection())),setTimeout((()=>{if(e.focus(),document.execCommand("insertText",!1,t),e.value===i){const i=e.selectionStart,s=e.selectionEnd,n=i===s?"end":"select";e.setRangeText(t,i,s,n)}this.$emit("input",e.value)}))},insertFile(t){(null==t?void 0:t.length)>0&&this.insert(t.map((t=>t.dragText)).join("\n\n"))},insertUpload(t){this.insertFile(t),this.$events.emit("model.update")},onCommand(t,...e){if("function"!=typeof this[t])return console.warn(t+" is not a valid command");this[t](...e)},onDrop(t){if(this.uploads&&this.$helper.isUploadEvent(t))return this.$panel.upload.open(t.dataTransfer.files,this.uploadOptions);"text"===this.$panel.drag.type&&(this.focus(),this.insert(this.$panel.drag.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);"text"===this.$panel.drag.type&&(t.dataTransfer.dropEffect="copy",this.focus(),this.over=!0)},onShortcut(t){var e;!1!==this.buttons&&"Meta"!==t.key&&"Control"!==t.key&&(null==(e=this.$refs.toolbar)||e.shortcut(t.key,t))},onSubmit(t){return this.$emit("submit",t)},parseSelection(){const t=this.selection();if(0===(null==t?void 0:t.length))return{href:null,title:null};let e;e=this.$panel.config.kirbytext?/^\(link:\s*(?.*?)(?:\s*text:\s*(?.*?))?\)$/is:/^(\[(?.*?)\]\((?.*?)\))|(<(?.*?)>)$/is;const i=e.exec(t);return null!==i?{href:i.groups.url??i.groups.link,title:i.groups.text??null}:{href:null,title:t}},prepend(t){this.insert(t+" "+this.selection())},restoreSelectionCallback(){const t=this.$refs.input.selectionStart,e=this.$refs.input.selectionEnd;return i=>{setTimeout((()=>{this.$refs.input.setSelectionRange(t,e),i&&i()}))}},select(){this.$refs.select()},selection(){return this.$refs.input.value.substring(this.$refs.input.selectionStart,this.$refs.input.selectionEnd)},toggle(t,e){e=e??t;const i=this.selection();return i.startsWith(t)&&i.endsWith(e)?this.insert(i.slice(t.length).slice(0,i.length-t.length-e.length)):this.wrap(t,e)},upload(){this.$panel.upload.pick(this.uploadOptions)},wrap(t,e){this.insert(t+this.selection()+(e??t))}},validations(){return{value:{required:!this.required||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.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}},[e("div",{staticClass:"k-textarea-input-wrapper"},[t.buttons&&!t.disabled?e("k-textarea-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:function(e){var i;null==(i=t.$refs.toolbar)||i.close()},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?e.ctrlKey||e.shiftKey||e.altKey?null:t.onShortcut.apply(null,arguments):null},function(e){return e.ctrlKey?e.shiftKey||e.altKey||e.metaKey?null: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)])}),[]).exports;const On=ct({mixins:[Fe,Ue,Cn,xi],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.id,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"textarea"}},"k-input",t.$props,!1),t.$listeners))],1)}),[]).exports,Mn={props:{max:String,min:String,value:String}},An={mixins:[Mn],props:{display:{type:String,default:"HH:mm"},step:{type:Object,default:()=>({size:5,unit:"minute"})},type:{type:String,default:"time"}}};const In=ct({mixins:[ji,An],computed:{inputType:()=>"time"}},null,null).exports;const Dn=ct({mixins:[Fe,Ue,An],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.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"time"},on:{input:function(e){return t.$emit("input",e??"")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.icon??"clock",title:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{"align-x":"end"}},[e("k-timeoptions-input",{attrs:{display:t.display,value:t.value},on:{input:t.select}})],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1))],1)}),[]).exports,jn={props:{autofocus:Boolean,disabled:Boolean,id:[Number,String],text:{type:[Array,String]},required:Boolean,value:Boolean}};const En=ct({mixins:[De,jn],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:{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||t.required}}}},(function(){var t=this;return(0,t._self._c)("k-choice-input",{ref:"input",staticClass:"k-toggle-input",attrs:{id:t.id,checked:t.value,disabled:t.disabled,label:t.label,type:"checkbox",variant:"toggle"},on:{input:function(e){return t.$emit("input",e)}}})}),[]).exports;const Ln=ct({mixins:[Fe,Ue,jn],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.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"toggle"}},"k-input",t.$props,!1),t.$listeners))],1)}),[]).exports,Tn={mixins:[Ie],props:{columns:Number,grow:Boolean,labels:Boolean,options:Array,reset:Boolean,value:[String,Number,Boolean]}};const Bn=ct({mixins:[De,Tn],watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input[checked]")||this.$el.querySelector("input"))||t.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||t.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(i,s){return e("li",{key:s,attrs:{"data-disabled":t.disabled}},[e("input",{staticClass:"input-hidden",attrs:{id:t.id+"-"+s,"aria-label":i.text,disabled:t.disabled,name:t.id,type:"radio"},domProps:{value:i.value,checked:t.value===i.value},on:{click:function(e){return t.onClick(i.value)},change:function(e){return t.onInput(i.value)}}}),e("label",{attrs:{for:t.id+"-"+s,title:i.text}},[i.icon?e("k-icon",{attrs:{type:i.icon}}):t._e(),t.labels||!i.icon?e("span",{staticClass:"k-toggles-text",domProps:{innerHTML:t._s(i.text)}}):t._e()],1)])})),0)}),[]).exports;const qn=ct({mixins:[Fe,Ue,Tn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)}}},(function(){var t,e=this,i=e._self._c;return i("k-field",e._b({staticClass:"k-toggles-field",attrs:{input:e.id}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?i("k-input",e._g(e._b({ref:"input",class:{grow:e.grow},attrs:{type:"toggles"}},"k-input",e.$props,!1),e.$listeners)):i("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[]).exports,Pn={mixins:[Li],props:{autocomplete:{type:String,default:"url"},placeholder:{type:String,default:()=>window.panel.$t("url.placeholder")},type:{type:String,default:"url"}}};const Nn=ct({extends:Ti,mixins:[Pn]},null,null).exports;const zn=ct({mixins:[Fe,Ue,Pn],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"url"}},computed:{isValidUrl(){return""!==this.value&&!0===this.$helper.url.isUrl(this.value,!0)}},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.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"url"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link&&t.isValidUrl?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.value,title:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[]).exports;const Fn=ct({extends:Ni,type:"users",computed:{emptyProps(){return{icon:"users",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.users.empty"):this.$t("field.users.empty.single"))}}}},null,null).exports;const Yn=ct({mixins:[Fe,Ue,qs,xi],inheritAttrs:!1,computed:{counterValue(){const t=this.$helper.string.stripHTML(this.value??"");return this.$helper.string.unescapeHTML(t)}},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.id,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{after:t.after,before:t.before,icon:t.icon,type:"writer"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,Rn={install(t){t.component("k-blocks-field",yi),t.component("k-checkboxes-field",_i),t.component("k-color-field",Ai),t.component("k-date-field",Ei),t.component("k-email-field",Pi),t.component("k-files-field",zi),t.component("k-gap-field",Fi),t.component("k-headline-field",Yi),t.component("k-info-field",Ri),t.component("k-layout-field",Gi),t.component("k-line-field",Xi),t.component("k-link-field",Zi),t.component("k-list-field",Ys),t.component("k-multiselect-field",Gs),t.component("k-number-field",Qs),t.component("k-object-field",tn),t.component("k-pages-field",en),t.component("k-password-field",on),t.component("k-radio-field",ln),t.component("k-range-field",dn),t.component("k-select-field",mn),t.component("k-slug-field",kn),t.component("k-structure-field",bn),t.component("k-tags-field",Js),t.component("k-text-field",wn),t.component("k-textarea-field",On),t.component("k-tel-field",$n),t.component("k-time-field",Dn),t.component("k-toggle-field",Ln),t.component("k-toggles-field",qn),t.component("k-url-field",zn),t.component("k-users-field",Fn),t.component("k-writer-field",Yn)}},Un={mixins:[cn],props:{max:null,min:null,step:{default:.01,type:Number},tooltip:{default:!1,type:[Boolean,Object]}}};const Hn=ct({mixins:[un,Un]},(function(){var t=this;return(0,t._self._c)("k-range-input",t._b({staticClass:"k-alpha-input",attrs:{min:0,max:1},on:{input:function(e){return t.$emit("input",e)}}},"k-range-input",t.$props,!1))}),[]).exports;const Vn=ct({mixins:[Ie,Ii],data(){const t=this.$library.dayjs();return{maxdate:null,mindate:null,month:t.month(),selected:null,today:t,year:t.year()}},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,i)=>{t.push({value:i,text:e})})),t},years(){const t=this.year-20,e=this.year+20;return this.toOptions(t,e)}},watch:{max:{handler(t,e){t!==e&&(this.maxdate=this.$library.dayjs.interpret(t,"date"))},immediate:!0},min:{handler(t,e){t!==e&&(this.mindate=this.$library.dayjs.interpret(t,"date"))},immediate:!0},value:{handler(t,e){t!==e&&(this.selected=this.$library.dayjs.interpret(t,"date"),this.show(this.selected))},immediate:!0}},methods:{days(t){let e=[];const i=7*(t-1)+1,s=i+7;for(let n=i;nthis.numberOfDays;e.push(i?"":t)}return e},isDisabled(t){const e=this.toDate(t);return this.disabled||e.isBefore(this.mindate,"day")||e.isAfter(this.maxdate,"day")},isSelected(t){return this.toDate(t).isSame(this.selected,"day")},isToday(t){return this.toDate(t).isSame(this.today,"day")},onNext(){const t=this.toDate().add(1,"month");this.show(t)},onPrev(){const t=this.toDate().subtract(1,"month");this.show(t)},select(t){this.$emit("input",(null==t?void 0:t.toISO("date"))??null)},show(t){this.month=(t??this.today).month(),this.year=(t??this.today).year()},toDate(t=1,e){return this.$library.dayjs(`${this.year}-${(e??this.month)+1}-${t}`)},toOptions(t,e){for(var i=[],s=t;s<=e;s++)i.push({value:s,text:this.$helper.pad(s)});return i}}},(function(){var t=this,e=t._self._c;return e("fieldset",{staticClass:"k-calendar-input",on:{click:function(t){t.stopPropagation()}}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("date.select")))]),e("nav",[e("k-button",{attrs:{title:t.$t("prev"),icon:"angle-left"},on:{click:t.onPrev}}),e("span",{staticClass:"k-calendar-selects"},[e("k-select-input",{attrs:{"aria-label":t.$t("month"),autofocus:t.autofocus,options:t.months,empty:!1,required:!0,value:t.month},on:{input:function(e){t.month=Number(e)}}}),e("k-select-input",{attrs:{"aria-label":t.$t("year"),options:t.years,empty:!1,required:!0,value:t.year},on:{input:function(e){t.year=Number(e)}}})],1),e("k-button",{attrs:{title:t.$t("next"),icon:"angle-right"},on:{click:t.onNext}})],1),e("table",{key:t.year+"-"+t.month,staticClass:"k-calendar-table"},[e("thead",[e("tr",t._l(t.weekdays,(function(i){return e("th",{key:"weekday_"+i},[t._v(" "+t._s(i)+" ")])})),0)]),e("tbody",t._l(t.weeks,(function(i){return e("tr",{key:"week_"+i},t._l(t.days(i),(function(i,s){return e("td",{key:"day_"+s,staticClass:"k-calendar-day",attrs:{"aria-current":!!t.isToday(i)&&"date","aria-selected":!!t.isSelected(i)&&"date"}},[i?e("k-button",{attrs:{disabled:t.isDisabled(i),text:i},on:{click:function(e){t.select(t.toDate(i))}}}):t._e()],1)})),0)})),0),e("tfoot",[e("tr",[e("td",{staticClass:"k-calendar-today",attrs:{colspan:"7"}},[e("k-button",{attrs:{disabled:t.disabled,text:t.$t("today")},on:{click:function(e){t.show(t.today),t.select(t.today)}}})],1)])])]),e("input",{staticClass:"input-hidden",attrs:{id:t.id,disabled:t.disabled,min:t.min,max:t.max,name:t.name,required:t.required,tabindex:"-1",type:"date"},domProps:{value:t.value}})])}),[]).exports;const Kn=ct({mixins:[De,{mixins:[Ie],props:{checked:{type:Boolean},info:{type:String},label:{type:String},type:{default:"checkbox",type:String},value:{type:[Boolean,Number,String]},variant:{type:String}}}]},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-choice-input",attrs:{"aria-disabled":t.disabled}},[e("input",t._b({class:{"sr-only":"invisible"===t.variant},attrs:{"data-variant":t.variant},on:{input:function(e){return t.$emit("input",e.target.checked)}}},"input",{autofocus:t.autofocus,id:t.id,checked:t.checked,disabled:t.disabled,name:t.name,required:t.required,type:t.type,value:t.value},!1)),t.label||t.info?e("span",{staticClass:"k-choice-input-label"},[e("span",{staticClass:"k-choice-input-label-text",domProps:{innerHTML:t._s(t.label)}}),t.info?e("span",{staticClass:"k-choice-input-label-info",domProps:{innerHTML:t._s(t.info)}}):t._e()]):t._e()])}),[]).exports;const Wn=ct({extends:Kn},null,null).exports;const Jn=ct({mixins:[rn,{mixins:[an],props:{format:{type:String,default:"hex",validator:t=>["hex","rgb","hsl"].includes(t)},value:{type:String}}}],computed:{choices(){return this.options.map((t=>({...t,title:t.text??t.value,value:this.colorToString(t.value)})))}},methods:{colorToString(t){try{return this.$library.colors.toString(t,this.format)}catch{return t}}}},(function(){var t=this,e=t._self._c;return t.choices.length?e("fieldset",{staticClass:"k-coloroptions-input",attrs:{disabled:t.disabled}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("options")))]),e("ul",t._l(t.choices,(function(i,s){return e("li",{key:s},[e("label",{attrs:{title:i.title}},[e("input",{staticClass:"input-hidden",attrs:{autofocus:t.autofocus&&0===s,disabled:t.disabled,name:t.name??t.id,required:t.required,type:"radio"},domProps:{checked:i.value===t.value,value:i.value},on:{click:function(e){return t.toggle(i.value)},input:function(e){return t.$emit("input",i.value)}}}),e("k-color-frame",{attrs:{color:i.value}})],1)])})),0)]):t._e()}),[]).exports;const Gn=ct({mixins:[De,{mixins:[Ie,nt],props:{alpha:{default:!0,type:Boolean},format:{default:"hex",type:String,validator:t=>["hex","rgb","hsl"].includes(t)},value:{type:[Object,String]}}}],data:()=>({color:{h:0,s:0,v:1,a:1},formatted:null}),computed:{coords(){return this.value?{x:100*this.color.s,y:100*(1-this.color.v)}:null},hsl(){try{const t=this.$library.colors.convert(this.color,"hsl");return{h:t.h,s:(100*t.s).toFixed()+"%",l:(100*t.l).toFixed()+"%",a:t.a}}catch{return{h:0,s:"0%",l:"0%",a:1}}}},watch:{value:{handler(t,e){if(t===e||t===this.formatted)return;const i=this.$library.colors.parseAs(t??"","hsv");i?(this.formatted=this.$library.colors.toString(i,this.format),this.color=i):(this.formatted=null,this.color={h:0,s:0,v:1,a:1})},immediate:!0}},methods:{between:(t,e,i)=>Math.min(Math.max(t,e),i),emit(){return this.formatted=this.$library.colors.toString(this.color,this.format),this.$emit("input",this.formatted)},focus(){this.$refs.coords.focus()},setAlpha(t){this.color.a=this.alpha?this.between(Number(t),0,1):1,this.emit()},setCoords(t){if(!t)return this.$emit("input","");const e=Math.round(t.x),i=Math.round(t.y);this.color.s=this.between(e/100,0,1),this.color.v=this.between(1-i/100,0,1),this.emit()},setHue(t){this.color.h=this.between(Number(t),0,360),this.emit()}}},(function(){var t=this,e=t._self._c;return e("fieldset",{staticClass:"k-colorpicker-input",style:{"--h":t.hsl.h,"--s":t.hsl.s,"--l":t.hsl.l,"--a":t.hsl.a}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("color")))]),e("k-coords-input",{ref:"coords",attrs:{autofocus:t.autofocus,disabled:t.disabled,required:t.required,value:t.coords},on:{input:function(e){return t.setCoords(e)}}}),e("label",{attrs:{"aria-label":t.$t("hue")}},[e("k-hue-input",{attrs:{disabled:t.disabled,required:t.required,value:t.color.h},on:{input:function(e){return t.setHue(e)}}})],1),t.alpha?e("label",{attrs:{"aria-label":t.$t("alpha")}},[e("k-alpha-input",{attrs:{disabled:t.disabled,required:t.required,value:t.color.a},on:{input:function(e){return t.setAlpha(e)}}})],1):t._e(),e("k-coloroptions-input",{attrs:{disabled:t.disabled,format:t.format,options:t.options,required:t.required,value:t.value},on:{input:function(e){return t.$emit("input",e)}}}),e("input",{staticClass:"input-hidden",attrs:{name:t.name,required:t.required,tabindex:"-1",type:"text"},domProps:{value:t.formatted}})],1)}),[]).exports;const Xn=ct({mixins:[De,{mixins:[Ie],props:{reset:{default:!0,type:Boolean},value:{default:()=>({x:0,y:0}),type:Object}}}],data:()=>({x:0,y:0}),watch:{value:{handler(t){const e=this.parse(t);this.x=(null==e?void 0:e.x)??0,this.y=(null==e?void 0:e.y)??0},immediate:!0}},methods:{focus(){var t;null==(t=this.$el.querySelector("button"))||t.focus()},getCoords:(t,e)=>({x:Math.min(Math.max(t.clientX-e.left,0),e.width),y:Math.min(Math.max(t.clientY-e.top,0),e.height)}),onDelete(){this.reset&&!this.required&&this.$emit("input",null)},onDrag(t){if(0!==t.button)return;const e=t=>this.onMove(t),i=()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",i)};window.addEventListener("mousemove",e),window.addEventListener("mouseup",i)},onEnter(){var t;null==(t=this.$el.form)||t.requestSubmit()},onInput(t,e){if(t.preventDefault(),t.stopPropagation(),this.disabled)return!1;this.x=Math.min(Math.max(parseFloat(e.x??this.x??0),0),100),this.y=Math.min(Math.max(parseFloat(e.y??this.y??0),0),100),this.$emit("input",{x:this.x,y:this.y})},onKeys(t){const e=t.shiftKey?10:1,i={ArrowUp:{y:this.y-e},ArrowDown:{y:this.y+e},ArrowLeft:{x:this.x-e},ArrowRight:{x:this.x+e}};i[t.key]&&this.onInput(t,i[t.key])},async onMove(t){const e=this.$el.getBoundingClientRect(),i=this.getCoords(t,e),s=i.x/e.width*100,n=i.y/e.height*100;this.onInput(t,{x:s,y:n}),await this.$nextTick(),this.focus()},parse(t){if("object"==typeof t)return t;const e={"top left":{x:0,y:0},"top center":{x:50,y:0},"top right":{x:100,y:0},"center left":{x:0,y:50},center:{x:50,y:50},"center center":{x:50,y:50},"center right":{x:100,y:50},"bottom left":{x:0,y:100},"bottom center":{x:50,y:100},"bottom right":{x:100,y:100}};if(e[t])return e[t];const i=t.split(",").map((t=>t.trim()));return{x:i[0],y:i[1]??0}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-coords-input",attrs:{"aria-disabled":t.disabled,"data-empty":!t.value},on:{mousedown:t.onDrag,click:t.onMove,keydown:t.onKeys}},[t._t("default"),e("button",{staticClass:"k-coords-input-thumb",style:{left:`${t.x}%`,top:`${t.y}%`},attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onEnter.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:t.onDelete.apply(null,arguments)}]}}),e("input",{staticClass:"input-hidden",attrs:{name:t.name,required:t.required,tabindex:"-1",type:"text"},domProps:{value:t.value?[t.value.x,t.value.y]:null}})],2)}),[]).exports,Zn={mixins:[cn],props:{max:null,min:null,step:{default:1,type:Number},tooltip:{default:!1,type:[Boolean,Object]}}};const Qn=ct({mixins:[un,Zn]},(function(){var t=this;return(0,t._self._c)("k-range-input",t._b({staticClass:"k-hue-input",attrs:{min:0,max:360},on:{input:function(e){return t.$emit("input",e)}}},"k-range-input",t.$props,!1))}),[]).exports;const to=ct({mixins:[Si,{mixins:[Ci],props:{autocomplete:null,pattern:null,spellcheck:null,placeholder:{default:()=>window.panel.$t("search")+" …",type:String}}}]},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-search-input",attrs:{spellcheck:!1,autocomplete:"off",type:"search"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[]).exports;const eo=ct({mixins:[De,{mixins:[Ie,Mn]}],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:{focus(){this.$el.querySelector("button").focus()},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-timeoptions-input"},[e("div",[e("h3",[e("k-icon",{attrs:{type:"sun"}}),t._v(" "),e("span",{staticClass:"sr-only"},[t._v(t._s(t.$t("day")))])],1),e("ul",t._l(t.day,(function(i,s){return e("li",{key:i.select},["-"===i?e("hr"):e("k-button",{attrs:{autofocus:t.autofocus&&0===s,disabled:t.disabled,selected:i.select===t.value&&"time"},on:{click:function(e){return t.select(i.select)}}},[t._v(" "+t._s(i.display)+" ")])],1)})),0)]),e("div",[e("h3",[e("k-icon",{attrs:{type:"moon"}}),t._v(" "),e("span",{staticClass:"sr-only"},[t._v(t._s(t.$t("night")))])],1),e("ul",t._l(t.night,(function(i){return e("li",{key:i.select},["-"===i?e("hr"):e("k-button",{attrs:{disabled:t.disabled,selected:i.select===t.value&&"time"},on:{click:function(e){return t.select(i.select)}}},[t._v(" "+t._s(i.display)+" ")])],1)})),0)]),e("input",{staticClass:"input-hidden",attrs:{id:t.id,disabled:t.disabled,min:t.min,max:t.max,name:t.name,required:t.required,tabindex:"-1",type:"time"},domProps:{value:t.value}})])}),[]).exports,io={install(t){t.component("k-alpha-input",Hn),t.component("k-calendar-input",Vn),t.component("k-checkbox-input",Wn),t.component("k-checkboxes-input",wi),t.component("k-choice-input",Kn),t.component("k-colorname-input",Mi),t.component("k-coloroptions-input",Jn),t.component("k-colorpicker-input",Gn),t.component("k-coords-input",Xn),t.component("k-date-input",ji),t.component("k-email-input",qi),t.component("k-hue-input",Qn),t.component("k-list-input",Fs),t.component("k-multiselect-input",Vs),t.component("k-number-input",Zs),t.component("k-password-input",nn),t.component("k-picklist-input",Le),t.component("k-radio-input",rn),t.component("k-range-input",un),t.component("k-search-input",to),t.component("k-select-input",hn),t.component("k-slug-input",gn),t.component("k-string-input",Si),t.component("k-tags-input",Ws),t.component("k-tel-input",yn),t.component("k-text-input",Ti),t.component("k-textarea-input",Sn),t.component("k-time-input",In),t.component("k-timeoptions-input",eo),t.component("k-toggle-input",En),t.component("k-toggles-input",Bn),t.component("k-url-input",Nn),t.component("k-writer-input",Ps),t.component("k-calendar",Vn),t.component("k-times",eo)}};const so=ct({mixins:[Et],inheritAttrs:!1,props:{cancelButton:{default:!1},label:{default(){return this.$t("field.layout.select")},type:String},layouts:{type:Array},selector:Object,submitButton:{default:!1},value:{type:Array}},emits:["cancel","input","submit"]},(function(){var t,e,i=this,s=i._self._c;return s("k-dialog",i._b({staticClass:"k-layout-selector",attrs:{size:(null==(t=i.selector)?void 0:t.size)??"medium"},on:{cancel:function(t){return i.$emit("cancel")},submit:function(t){return i.$emit("submit",i.value)}}},"k-dialog",i.$props,!1),[s("h3",{staticClass:"k-label"},[i._v(i._s(i.label))]),s("k-navigate",{staticClass:"k-layout-selector-options",style:{"--columns":Number((null==(e=i.selector)?void 0:e.columns)??3)},attrs:{axis:"x"}},i._l(i.layouts,(function(t,e){return s("button",{key:e,staticClass:"k-layout-selector-option",attrs:{"aria-current":i.value===t,"aria-label":t.join(","),value:t},on:{click:function(e){return i.$emit("input",t)}}},[s("k-grid",{attrs:{"aria-hidden":""}},i._l(t,(function(t,e){return s("k-column",{key:e,attrs:{width:t}})})),1)],1)})),0)],1)}),[]).exports,no={install(t){t.component("k-layout",Ki),t.component("k-layout-column",Hi),t.component("k-layouts",Ji),t.component("k-layout-selector",so)}},oo={inheritAttrs:!1,props:{column:{default:()=>({}),type:Object},field:{default:()=>({}),type:Object},value:{}}},ao={props:{html:{type:Boolean}}};const ro=ct({mixins:[ao],inheritAttrs:!1,props:{bubbles:[Array,String]},computed:{items(){let t=this.bubbles;return"string"==typeof t&&(t=t.split(",")),t.map((t=>"string"===t?{text:t}:t))}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-bubbles"},t._l(t.items,(function(i,s){return e("li",{key:s},[e("k-bubble",t._b({attrs:{html:t.html}},"k-bubble",i,!1))],1)})),0)}),[]).exports;const lo=ct({mixins:[oo,ao],props:{value:{default:()=>[],type:[Array,String]}},computed:{bubbles(){let t=this.value;const e=this.column.options??this.field.options??[];return"string"==typeof t&&(t=t.split(",")),(t??[]).map((t=>{"string"==typeof t&&(t={value:t,text:t});for(const i of e)i.value===t.value&&(t.text=i.text);return 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,html:t.html}})],1)}),[]).exports;const co=ct({extends:lo,inheritAttrs:!1,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).exports;const uo=ct({mixins:[oo],props:{value:String},computed:{text(){var t;if(!this.value)return;const e=this.$library.colors.toString(this.value,this.field.format,this.field.alpha),i=null==(t=this.field.options)?void 0:t.find((t=>this.$library.colors.toString(t.value,this.field.format,this.field.alpha)===e));return i?i.text:null}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-color-field-preview"},[e("k-color-frame",{attrs:{color:t.value}}),t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2)}),[]).exports;const po=ct({mixins:[oo],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)}),[]).exports;const ho=ct({extends:po,props:{value:String},class:"k-date-field-preview",computed:{display(){return this.column.display??this.field.display},format(){var t;let e=this.display??"YYYY-MM-DD";return(null==(t=this.time)?void 0:t.display)&&(e+=" "+this.time.display),e},parsed(){return this.$library.dayjs(this.value)},text(){var t;return!1===this.parsed.isValid()?this.value:null==(t=this.parsed)?void 0:t.format(this.format)},time(){return this.column.time??this.field.time}}},null,null).exports;const mo=ct({mixins:[oo],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,attrs:{"data-link":t.link}},[t._v(" "+t._s(t.column.before)+" "),e("k-link",{attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[e("span",[t._v(t._s(t.text))])]),t._v(" "+t._s(t.column.after)+" ")],1)}),[]).exports;const fo=ct({extends:mo,class:"k-email-field-preview"},null,null).exports;const go=ct({extends:lo,class:"k-files-field-preview",props:{html:{type:Boolean,default:!0}},computed:{bubbles(){return this.value.map((t=>({text:t.filename,link:t.link,image:t.image})))}}},null,null).exports;const ko=ct({mixins:[oo],props:{value:Object},computed:{status(){var t;return{...this.$helper.page.status(null==(t=this.value)?void 0:t.status),...this.value}}}},(function(){var t=this,e=t._self._c;return t.value?e("k-button",t._b({staticClass:"k-flag-field-preview",attrs:{size:"md"}},"k-button",t.status,!1)):t._e()}),[]).exports;const bo=ct({mixins:[oo],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("k-text",{attrs:{html:t.html}}),t._v(" "+t._s(t.column.after)+" ")],1)}),[]).exports;const vo=ct({mixins:[oo],props:{value:[Object]}},(function(){var t=this,e=t._self._c;return t.value?e("k-item-image",{staticClass:"k-image-field-preview",attrs:{image:t.value}}):t._e()}),[]).exports;const yo=ct({mixins:[oo],inheritAttrs:!1,props:{removable:Boolean,type:String},emits:["remove"],data:()=>({model:null}),computed:{currentType(){return this.type??this.detected.type},detected(){return this.$helper.link.detect(this.value)},isLink(){return["url","email","tel"].includes(this.currentType)}},watch:{detected:{async handler(t,e){t!==e&&(this.model=await this.$helper.link.preview(this.detected))},immediate:!0},type(){this.model=null}}},(function(){var t=this,e=t._self._c;return e("div",{class:{"k-link-field-preview":!0,"k-url-field-preview":t.isLink}},["page"===t.currentType||"file"===t.currentType?[t.model?[e("k-tag",{attrs:{image:{...t.model.image,cover:!0},removable:t.removable,text:t.model.label},on:{remove:function(e){return t.$emit("remove",e)}}})]:t._t("placeholder")]:t.isLink?[e("p",{staticClass:"k-text"},[e("a",{attrs:{href:t.value,target:"_blank"}},[e("span",[t._v(t._s(t.detected.link))])])])]:[t._v(" "+t._s(t.detected.link)+" ")]],2)}),[]).exports;const $o=ct({extends:lo,class:"k-object-field-preview",props:{value:[Array,Object]},computed:{bubbles(){return this.value?[{text:"{ ... }"}]:[]}}},null,null).exports;const wo=ct({extends:lo,inheritAttrs:!1,class:"k-pages-field-preview",props:{html:{type:Boolean,default:!0}}},null,null).exports;const xo=ct({extends:ho,class:"k-time-field-preview",computed:{format(){return this.display??"HH:mm"},parsed(){return this.$library.dayjs.iso(this.value,"time")},text(){var t;return null==(t=this.parsed)?void 0:t.format(this.format)}}},null,null).exports;const _o=ct({mixins:[oo],props:{value:Boolean},emits:["input"],computed:{isEditable(){return!0!==this.field.disabled},text(){return!1!==this.column.text?this.field.text:null}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-toggle-field-preview"},[e("k-toggle-input",{attrs:{disabled:!t.isEditable,text:t.text,value:t.value},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{click:function(e){t.isEditable&&e.stopPropagation()}}})],1)}),[]).exports;const Co=ct({extends:lo,class:"k-users-field-preview",computed:{bubble(){return this.value.map((t=>({text:t.username,link:t.link,image:t.image})))}}},null,null).exports,So={install(t){t.component("k-array-field-preview",co),t.component("k-bubbles-field-preview",lo),t.component("k-color-field-preview",uo),t.component("k-date-field-preview",ho),t.component("k-email-field-preview",fo),t.component("k-files-field-preview",go),t.component("k-flag-field-preview",ko),t.component("k-html-field-preview",bo),t.component("k-image-field-preview",vo),t.component("k-link-field-preview",yo),t.component("k-object-field-preview",$o),t.component("k-pages-field-preview",wo),t.component("k-text-field-preview",po),t.component("k-toggle-field-preview",_o),t.component("k-time-field-preview",xo),t.component("k-url-field-preview",mo),t.component("k-users-field-preview",Co),t.component("k-list-field-preview",bo),t.component("k-writer-field-preview",bo),t.component("k-checkboxes-field-preview",lo),t.component("k-multiselect-field-preview",lo),t.component("k-radio-field-preview",lo),t.component("k-select-field-preview",lo),t.component("k-tags-field-preview",lo),t.component("k-toggles-field-preview",lo)}};const Oo=ct({mixins:[{props:{buttons:{type:Array,default:()=>[]},theme:{type:String,default:"light"}}}],methods:{close(){for(const t in this.$refs){const e=this.$refs[t][0];"function"==typeof(null==e?void 0:e.close)&&e.close()}}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-toolbar",attrs:{"data-theme":t.theme}},[t._l(t.buttons,(function(i,s){var n;return["|"===i?e("hr",{key:s}):i.when??1?e("k-button",{key:s,class:["k-toolbar-button",i.class],attrs:{current:i.current,disabled:i.disabled,icon:i.icon,title:i.label,tabindex:"0"},on:{click:function(e){var n,o;(null==(n=i.dropdown)?void 0:n.length)?t.$refs[s+"-dropdown"][0].toggle():null==(o=i.click)||o.call(i,e)}},nativeOn:{keydown:function(t){var e;null==(e=i.key)||e.call(i,t)}}}):t._e(),(i.when??1)&&(null==(n=i.dropdown)?void 0:n.length)?e("k-dropdown-content",{key:s+"-dropdown",ref:s+"-dropdown",refInFor:!0,attrs:{options:i.dropdown,theme:"dark"===t.theme?"light":"dark"}}):t._e()]}))],2)}),[]).exports;const Mo=ct({extends:Bt,props:{fields:{default:()=>{const t=Bt.props.fields.default();return t.title.label=window.panel.$t("link.text"),t}}},methods:{submit(){const t=this.values.href??"",e=this.values.title??"";return this.$panel.config.kirbytext?(null==e?void 0:e.length)>0?this.$emit("submit",`(email: ${t} text: ${e})`):this.$emit("submit",`(email: ${t})`):(null==e?void 0:e.length)>0?this.$emit("submit",`[${e}](mailto:${t})`):this.$emit("submit",`<${t}>`)}}},null,null).exports;const Ao=ct({extends:Kt,props:{fields:{default:()=>({href:{label:window.panel.$t("link"),type:"link",placeholder:window.panel.$t("url.placeholder"),icon:"url"},title:{label:window.panel.$t("link.text"),type:"text",icon:"title"}})}},methods:{submit(){const t=this.values.href??"",e=this.values.title??"";return this.$panel.config.kirbytext?(null==e?void 0:e.length)>0?this.$emit("submit",`(link: ${t} text: ${e})`):this.$emit("submit",`(link: ${t})`):(null==e?void 0:e.length)>0?this.$emit("submit",`[${e}](${t})`):this.$emit("submit",`<${t}>`)}}},null,null).exports,Io={install(t){t.component("k-toolbar",Oo),t.component("k-textarea-toolbar",_n),t.component("k-toolbar-email-dialog",Mo),t.component("k-toolbar-link-dialog",Ao)}};const Do=ct({props:{editor:{required:!0,type:Object},inline:{default:!0,type:Boolean},marks:{default:()=>["bold","italic","underline","strike","code","|","link","email","|","clear"],type:[Array,Boolean]},nodes:{default:!0,type:[Array,Boolean]}},emits:["command"],data:()=>({isOpen:!1,position:{x:0,y:0}}),computed:{activeNode(){return Object.values(this.nodeButtons).find((t=>this.isNodeActive(t)))??!1},buttons(){var t,e,i;const s=[];if(this.hasNodes){const n=[];let o=0;for(const s in this.nodeButtons){const a=this.nodeButtons[s];n.push({current:(null==(t=this.activeNode)?void 0:t.id)===a.id,disabled:!1===(null==(i=null==(e=this.activeNode)?void 0:e.when)?void 0:i.includes(a.name)),icon:a.icon,label:a.label,click:()=>this.command(a.command??s)}),!0===a.separator&&o!==Object.keys(this.nodeButtons).length-1&&n.push("-"),o++}s.push({current:Boolean(this.activeNode),icon:this.activeNode.icon??"title",dropdown:n})}if(this.hasNodes&&this.hasMarks&&s.push("|"),this.hasMarks)for(const n in this.markButtons){const t=this.markButtons[n];"|"!==t?s.push({current:this.editor.activeMarks.includes(n),icon:t.icon,label:t.label,click:e=>this.command(t.command??n,e)}):s.push("|")}return s},hasMarks(){return this.$helper.object.length(this.markButtons)>0},hasNodes(){return this.$helper.object.length(this.nodeButtons)>1},markButtons(){const t=this.editor.buttons("mark");if(!1===this.marks||0===this.$helper.object.length(t))return{};if(!0===this.marks)return t;const e={};for(const[i,s]of this.marks.entries())"|"===s?e["divider"+i]="|":t[s]&&(e[s]=t[s]);return e},nodeButtons(){const t=this.editor.buttons("node");if(!1===this.nodes||0===this.$helper.object.length(t))return{};if("block+"!==this.editor.nodes.doc.content&&t.paragraph&&delete t.paragraph,!0===this.nodes)return t;const e={};for(const i of this.nodes)t[i]&&(e[i]=t[i]);return e},positions(){return!1===this.inline?null:{top:this.position.y+"px",left:this.position.x+"px"}}},methods:{close(t){t&&!1!==this.$el.contains(t.relatedTarget)||(this.isOpen=!1)},command(t,...e){this.$emit("command",t,...e)},isNodeActive(t){if(!1===this.editor.activeNodes.includes(t.name))return!1;if("paragraph"===t.name)return!1===this.editor.activeNodes.includes("listItem")&&!1===this.editor.activeNodes.includes("quote");if(t.attrs){if(void 0===Object.values(this.editor.activeNodeAttrs).find((e=>JSON.stringify(e)===JSON.stringify(t.attrs))))return!1}return!0},open(){this.isOpen=!0,this.inline&&this.$nextTick(this.setPosition)},setPosition(){const t=this.$el.getBoundingClientRect(),e=this.editor.element.getBoundingClientRect(),i=document.querySelector(".k-panel-menu").getBoundingClientRect(),{from:s,to:n}=this.editor.selection,o=this.editor.view.coordsAtPos(s),a=this.editor.view.coordsAtPos(n,!0),r=new DOMRect(o.left,o.top,a.right-o.left,a.bottom-o.top);let l=r.x-e.x+r.width/2-t.width/2,c=r.y-e.y-t.height-5;if(t.widthe.width&&(l=e.width-t.width);else{const s=e.x+l,n=s+t.width,o=i.width+20,a=20;swindow.innerWidth-a&&(l-=n-(window.innerWidth-a))}this.position={x:l,y:c}}}},(function(){var t=this,e=t._self._c;return t.isOpen||!t.inline?e("k-toolbar",{ref:"toolbar",staticClass:"k-writer-toolbar",style:t.positions,attrs:{buttons:t.buttons,"data-inline":t.inline,theme:t.inline?"dark":"light"}}):t._e()}),[]).exports,jo={install(t){t.component("k-writer-toolbar",Do),t.component("k-writer",Bs)}},Eo={install(t){t.component("k-counter",Pe),t.component("k-autocomplete",qe),t.component("k-form",Ne),t.component("k-form-buttons",ze),t.component("k-field",Ye),t.component("k-fieldset",Re),t.component("k-input",He),t.component("k-upload",Ve),t.use(vi),t.use(io),t.use(Rn),t.use(no),t.use(So),t.use(Io),t.use(jo)}},Lo=()=>Y((()=>import("./IndexView.min.js")),__vite__mapDeps([0,1]),import.meta.url),To=()=>Y((()=>import("./DocsView.min.js")),__vite__mapDeps([2,3,1]),import.meta.url),Bo=()=>Y((()=>import("./PlaygroundView.min.js")),__vite__mapDeps([4,3,1]),import.meta.url),qo={install(t){t.component("k-lab-index-view",Lo),t.component("k-lab-docs-view",To),t.component("k-lab-playground-view",Bo)}};const Po=ct({props:{cover:Boolean,ratio:String},computed:{ratioPadding(){return this.$helper.ratio(this.ratio)}},mounted(){window.panel.deprecated(" will be removed in a future version. Use the instead.")}},(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)}),[]).exports;const No=ct({props:{align:{type:String,default:"start"}},mounted(){(this.$slots.left||this.$slots.center||this.$slots.right)&&window.panel.deprecated(": left/centre/right slots will be removed in a future version. Use with default slot only instead.")}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-bar",attrs:{"data-align":t.align}},[t.$slots.left||t.$slots.center||t.$slots.right?[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()]:t._t("default")],2)}),[]).exports;const zo=ct({props:{align:{type:String,default:"start"},button:Boolean,height:String,icon:String,theme:{type:String},text:String,html:{type:Boolean}},computed:{element(){return this.button?"button":"div"},type(){return this.button?"button":null}}},(function(){var t=this,e=t._self._c;return e(t.element,{tag:"component",staticClass:"k-box",style:t.height?{"--box-height":t.height}:null,attrs:{"data-align":t.align,"data-theme":t.theme,type:t.type}},[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),t._t("default",(function(){return[t.html?e("k-text",{attrs:{html:t.text}}):e("k-text",[t._v(" "+t._s(t.text)+" ")])]}),null,{html:t.html,text:t.text})],2)}),[]).exports;const Fo=ct({inheritAttrs:!1,props:{back:String,color:String,element:{type:String,default:"li"},html:{type:Boolean},image:Object,link:String,text:String},mounted(){this.back&&window.panel.deprecated(": `back` prop will be removed in a future version. Use the `--bubble-back` CSS property instead."),this.color&&window.panel.deprecated(": `color` prop will be removed in a future version. Use the `--bubble-text` CSS property instead.")}},(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,"data-has-text":Boolean(t.text)},nativeOn:{click:function(t){t.stopPropagation()}}},[t._t("image",(function(){var i;return[(null==(i=t.image)?void 0:i.src)?e("k-image-frame",t._b({},"k-image-frame",t.image,!1)):t.image?e("k-icon-frame",t._b({},"k-icon-frame",t.image,!1)):e("span")]})),t.text?[t.html?e("span",{staticClass:"k-bubble-text",domProps:{innerHTML:t._s(t.text)}}):e("span",{staticClass:"k-bubble-text"},[t._v(t._s(t.text))])]:t._e()],2)}),[]).exports;const Yo=ct({props:{width:{type:String,default:"1/1"},sticky:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column",style:{"--width":t.width},attrs:{"data-sticky":t.sticky}},[t.sticky?e("div",[t._t("default")],2):t._t("default")],2)}),[]).exports,Ro={props:{element:{type:String,default:"div"},fit:String,ratio:String,cover:Boolean,back:String,theme:String}};const Uo=ct({mixins:[Ro],inheritAttrs:!1,computed:{background(){return this.$helper.color(this.back)}}},(function(){var t=this;return(0,t._self._c)(t.element,{tag:"component",staticClass:"k-frame",style:{"--fit":t.fit??(t.cover?"cover":"contain"),"--ratio":t.ratio,"--back":t.background},attrs:{"data-theme":t.theme}},[t._t("default")],2)}),[]).exports;const Ho=ct({mixins:[{mixins:[Ro],props:{color:String}}],inheritAttrs:!1},(function(){var t=this;return(0,t._self._c)("k-frame",t._b({staticClass:"k-color-frame",style:{"--color-frame-back":t.color}},"k-frame",t.$props,!1),[t._t("default")],2)}),[]).exports;const Vo=ct({props:{disabled:{type:Boolean}},emits:["drop"],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)}),[]).exports;const Ko=ct({props:{gutter:String,variant:String},mounted(){this.gutter&&window.panel.deprecated(': the `gutter` prop will be removed in a future version. Use `style="gap: "` or `variant` prop instead.')}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-grid",attrs:{"data-gutter":t.gutter,"data-variant":t.variant}},[t._t("default")],2)}),[]).exports;const Wo=ct({props:{editable:{type:Boolean},tabs:Array},emits:["edit"],mounted(){this.tabs&&window.panel.deprecated(": `tabs` prop isn't supported anymore and has no effect. Use `` as standalone component instead."),(this.$slots.left||this.$slots.right)&&window.panel.deprecated(": left/right slots will be removed in a future version. Use `buttons` slot instead.")}},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-header",attrs:{"data-has-buttons":Boolean(t.$slots.buttons||t.$slots.left||t.$slots.right)}},[e("h1",{staticClass:"k-header-title"},[t.editable?e("button",{staticClass:"k-header-title-button",attrs:{type:"button"},on:{click:function(e){return t.$emit("edit")}}},[e("span",{staticClass:"k-header-title-text"},[t._t("default")],2),e("span",{staticClass:"k-header-title-icon"},[e("k-icon",{attrs:{type:"edit"}})],1)]):e("span",{staticClass:"k-header-title-text"},[t._t("default")],2)]),t.$slots.buttons||t.$slots.left||t.$slots.right?e("div",{staticClass:"k-header-buttons"},[t._t("buttons"),t._t("left"),t._t("right")],2):t._e()])}),[]).exports,Jo={props:{alt:String,color:String,type:String}};const Go=ct({mixins:[Jo],computed:{isEmoji(){return this.$helper.string.hasEmoji(this.type)}}},(function(){var t=this,e=t._self._c;return t.isEmoji?e("span",{attrs:{"data-type":"emoji"}},[t._v(t._s(t.type))]):e("svg",{staticClass:"k-icon",style:{color:t.$helper.color(t.color)},attrs:{"aria-label":t.alt,role:t.alt?"img":null,"aria-hidden":!t.alt,"data-type":t.type}},[e("use",{attrs:{"xlink:href":"#icon-"+t.type}})])}),[]).exports;const Xo=ct({mixins:[{mixins:[Ro,Jo],props:{type:null,icon:String}}],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-frame",t._b({staticClass:"k-icon-frame",attrs:{element:"figure"}},"k-frame",t.$props,!1),[e("k-icon",t._b({},"k-icon",{color:t.color,type:t.icon,alt:t.alt},!1))],1)}),[]).exports;const Zo=ct({mixins:[{mixins:[Ro],props:{alt:String,sizes:String,src:String,srcset:String}}],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-frame",t._g(t._b({staticClass:"k-image-frame k-image",attrs:{element:"figure"}},"k-frame",t.$props,!1),t.$listeners),[t.src?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()])}),[]).exports;const Qo=ct({mixins:[{props:{autofocus:{default:!0,type:Boolean},nested:{default:!1,type:Boolean},type:{default:"overlay",type:String},visible:{default:!1,type:Boolean}}}],inheritAttrs:!0,emits:["cancel","close","open"],watch:{visible(t,e){t!==e&&this.toggle()}},mounted(){this.toggle()},methods:{cancel(){this.$emit("cancel"),this.close()},close(){if(!1!==this.$refs.overlay.open)return this.nested?this.onClose():void this.$refs.overlay.close()},focus(){this.$helper.focus(this.$refs.overlay)},onCancel(t){this.nested&&(t.preventDefault(),this.cancel())},onClick(t){t.target.matches(".k-portal")&&this.cancel()},onClose(){this.$emit("close")},open(){!0!==this.$refs.overlay.open&&this.$refs.overlay.showModal(),setTimeout((()=>{!0===this.autofocus&&this.focus(),this.$emit("open")}))},toggle(){!0===this.visible?this.open():this.close()}}},(function(){var t=this;return(0,t._self._c)("dialog",{ref:"overlay",staticClass:"k-overlay",attrs:{"data-type":t.type},on:{cancel:t.onCancel,mousedown:t.onClick,touchdown:t.onClick,close:t.onClose}},[t._t("default")],2)}),[]).exports;const ta=ct({props:{label:String,value:String,icon:String,info:String,theme:String,link:String,click:Function,dialog:{type:[String,Object]}},computed:{component(){return null!==this.target?"k-link":"div"},target(){return this.link?this.link:this.click?this.click:this.dialog?()=>this.$dialog(this.dialog):null}}},(function(){var t=this,e=t._self._c;return e(t.component,{tag:"component",staticClass:"k-stat",attrs:{"data-theme":t.theme,to:t.target}},[t.label?e("dt",{staticClass:"k-stat-label"},[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),t._v(" "+t._s(t.label)+" ")],1):t._e(),t.value?e("dd",{staticClass:"k-stat-value"},[t._v(t._s(t.value))]):t._e(),t.info?e("dd",{staticClass:"k-stat-info"},[t._v(t._s(t.info))]):t._e()])}),[]).exports;const ea=ct({props:{reports:{type:Array,default:()=>[]},size:{type:String,default:"large"}},methods:{component(t){return null!==this.target(t)?"k-link":"div"},target(t){return t.link?t.link:t.click?t.click:t.dialog?()=>this.$dialog(t.dialog):null}}},(function(){var t=this,e=t._self._c;return e("dl",{staticClass:"k-stats",attrs:{"data-size":t.size}},t._l(t.reports,(function(i,s){return e("k-stat",t._b({key:s},"k-stat",i,!1))})),1)}),[]).exports;const ia=ct({inheritAttrs:!1,props:{columns:{type:Object,default:()=>({})},disabled:Boolean,fields:{type:Object,default:()=>({})},empty:String,index:{type:[Number,Boolean],default:1},rows:Array,options:{default:()=>[],type:[Array,Function]},pagination:[Object,Boolean],sortable:Boolean},emits:["cell","change","header","input","option","paginate","sort"],data(){return{values:this.rows}},computed:{colspan(){let t=this.columnsCount;return this.hasIndexColumn&&t++,this.hasOptions&&t++,t},columnsCount(){return this.$helper.object.length(this.columns)},dragOptions(){return{disabled:!this.sortable,draggable:".k-table-sortable-row",fallbackClass:"k-table-row-fallback",ghostClass:"k-table-row-ghost"}},hasIndexColumn(){return this.sortable||!1!==this.index},hasOptions(){var t;return this.$scopedSlots.options||(null==(t=this.options)?void 0:t.length)>0||Object.values(this.values).filter((t=>null==t?void 0: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:i}){this.values[e][t]=i,this.$emit("input",this.values)},onHeader(t){this.$emit("header",t)},onOption(t,e,i){this.$emit("option",t,e,i)},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("div",{staticClass:"k-table",attrs:{"aria-disabled":t.disabled}},[e("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":"true"}},[t._v(" # ")]):t._e(),t._l(t.columns,(function(i,s){return e("th",{key:s+"-header",staticClass:"k-table-column",style:{width:t.width(i.width)},attrs:{"data-align":i.align,"data-column-id":s,"data-mobile":i.mobile},on:{click:function(e){return t.onHeader({column:i,columnIndex:s})}}},[t._t("header",(function(){return[t._v(" "+t._s(t.label(i,s))+" ")]}),null,{column:i,columnIndex:s,label:t.label(i,s)})],2)})),t.hasOptions?e("th",{staticClass:"k-table-options-column",attrs:{"data-mobile":"true"}}):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.colspan}},[t._v(" "+t._s(t.empty)+" ")])]):t._l(t.values,(function(i,s){return e("tr",{key:s,class:{"k-table-sortable-row":t.sortable&&!1!==i.sortable}},[t.hasIndexColumn?e("td",{staticClass:"k-table-index-column",attrs:{"data-mobile":"true"}},[t._t("index",(function(){return[e("div",{staticClass:"k-table-index",domProps:{textContent:t._s(t.index+s)}})]}),null,{row:i,rowIndex:s}),t.sortable&&!1!==i.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:s+"-"+o,staticClass:"k-table-column",style:{width:t.width(n.width)},attrs:{id:o,column:n,field:t.fields[o],row:i,mobile:n.mobile,value:i[o]},on:{input:function(e){return t.onCellUpdate({columnIndex:o,rowIndex:s,value:e})}},nativeOn:{click:function(e){return t.onCell({row:i,rowIndex:s,column:n,columnIndex:o})}}})})),t.hasOptions?e("td",{staticClass:"k-table-options-column",attrs:{"data-mobile":"true"}},[t._t("options",(function(){return[e("k-options-dropdown",{attrs:{options:i.options??t.options,text:(i.options??t.options).length>1},on:{option:function(e){return t.onOption(e,i,s)}}})]}),null,{row:i,rowIndex:s})],2):t._e()],2)}))],2)],1),t.pagination?e("k-pagination",t._b({staticClass:"k-table-pagination",on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.pagination,!1)):t._e()],1)}),[]).exports;const sa=ct({inheritAttrs:!1,props:{column:Object,field:Object,id:String,mobile:{type:Boolean,default:!1},row:Object,value:{default:""}},emits:["input"],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":"object"==typeof this.value?"k-object-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",{staticClass:"k-table-cell",attrs:{"data-align":t.column.align,"data-column-id":t.id,"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()],1)}),[]).exports;const na=ct({props:{tab:String,tabs:{type:Array,default:()=>[]},theme:{type:String,default:"passive"}},data(){return{observer:null,visible:this.tabs,invisible:[]}},computed:{buttons(){return this.visible.map(this.button)},current(){const t=this.tabs.find((t=>t.name===this.tab))??this.tabs[0];return null==t?void 0:t.name},dropdown(){return this.invisible.map(this.button)}},watch:{tabs:{async handler(){var t;null==(t=this.observer)||t.disconnect(),await this.$nextTick(),this.$el instanceof Element&&(this.observer=new ResizeObserver(this.resize),this.observer.observe(this.$el))},immediate:!0}},destroyed(){var t;null==(t=this.observer)||t.disconnect()},methods:{button(t){return{...t,current:t.name===this.current,title:t.label,text:t.label??t.text??t.name}},async resize(){const t=this.$el.offsetWidth;this.visible=this.tabs,this.invisible=[],await this.$nextTick();const e=[...this.$refs.visible].map((t=>t.$el.offsetWidth));let i=32;for(let s=0;st)return this.visible=this.tabs.slice(0,s),void(this.invisible=this.tabs.slice(s))}}},(function(){var t=this,e=t._self._c;return t.tabs.length>1?e("nav",{staticClass:"k-tabs"},[t._l(t.buttons,(function(i){return e("div",{key:i.name,staticClass:"k-tabs-tab"},[e("k-button",t._b({ref:"visible",refInFor:!0,staticClass:"k-tab-button",attrs:{variant:"dimmed"}},"k-button",i,!1),[t._v(" "+t._s(i.text)+" ")]),i.badge?e("span",{staticClass:"k-tabs-badge",attrs:{"data-theme":t.theme}},[t._v(" "+t._s(i.badge)+" ")]):t._e()],1)})),t.invisible.length?[e("k-button",{staticClass:"k-tab-button k-tabs-dropdown-button",attrs:{current:!!t.invisible.find((e=>t.tab===e.name)),title:t.$t("more"),icon:"dots",variant:"dimmed"},on:{click:function(e){return e.stopPropagation(),t.$refs.more.toggle()}}}),e("k-dropdown-content",{ref:"more",staticClass:"k-tabs-dropdown",attrs:{options:t.dropdown,"align-x":"end"}})]:t._e()],2):t._e()}),[]).exports;const oa=ct({props:{align:String},mounted(){window.panel.deprecated(" will be removed in a future version.")}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-view",attrs:{"data-align":t.align}},[t._t("default")],2)}),[]).exports,aa={install(t){t.component("k-aspect-ratio",Po),t.component("k-bar",No),t.component("k-box",zo),t.component("k-bubble",Fo),t.component("k-bubbles",ro),t.component("k-color-frame",Ho),t.component("k-column",Yo),t.component("k-dropzone",Vo),t.component("k-frame",Uo),t.component("k-grid",Ko),t.component("k-header",Wo),t.component("k-icon-frame",Xo),t.component("k-image-frame",Zo),t.component("k-image",Zo),t.component("k-overlay",Qo),t.component("k-stat",ta),t.component("k-stats",ea),t.component("k-table",ia),t.component("k-table-cell",sa),t.component("k-tabs",na),t.component("k-view",oa)}};const ra=ct({components:{draggable:()=>Y((()=>import("./vuedraggable.min.js")),[],import.meta.url)},props:{data:Object,element:{type:String,default:"div"},handle:[String,Boolean],list:[Array,Object],move:Function,options:Object},emits:["change","end","sort","start"],computed:{dragOptions(){let t=this.handle;return!0===t&&(t=".k-sort-handle"),{fallbackClass:"k-sortable-fallback",fallbackOnBody:!0,forceFallback:!0,ghostClass:"k-sortable-ghost",handle:t,scroll:document.querySelector(".k-panel-main"),...this.options}}},methods:{onStart(t){this.$panel.drag.start("data",{}),this.$emit("start",t)},onEnd(t){this.$panel.drag.stop(),this.$emit("end",t)}}},(function(){var t=this;return(0,t._self._c)("draggable",t._b({staticClass:"k-draggable",attrs:{"component-data":t.data,tag:t.element,list:t.list,move:t.move},on:{change:function(e){return t.$emit("change",e)},end:t.onEnd,sort:function(e){return t.$emit("sort",e)},start:t.onStart},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("footer")]},proxy:!0}],null,!0)},"draggable",t.dragOptions,!1),[t._t("default")],2)}),[]).exports;const la=ct({data:()=>({error:null}),errorCaptured(t){return this.$panel.debug&&window.console.warn(t),this.error=t,!1},render(){return this.error?this.$slots.error?this.$slots.error[0]:this.$scopedSlots.error?this.$scopedSlots.error({error:this.error}):Vue.h("k-box",{attrs:{theme:"negative"}},this.error.message??this.error):this.$slots.default[0]}},null,null).exports;const ca=ct({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("k-overlay",{staticClass:"k-fatal",attrs:{visible:!0}},[e("div",{staticClass:"k-fatal-box"},[e("div",{staticClass:"k-notification",attrs:{"data-theme":"negative"}},[e("p",[t._v("The JSON response could not be parsed")]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return e.stopPropagation(),t.$panel.notification.close()}}})],1),e("iframe",{ref:"iframe",staticClass:"k-fatal-iframe"})])])}),[]).exports;const ua=ct({icons:window.panel.plugins.icons,methods:{viewbox(t,e){const i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.innerHTML=e,document.body.appendChild(i);const s=i.getBBox(),n=(s.width+2*s.x+(s.height+2*s.y))/2,o=Math.abs(n-16),a=Math.abs(n-24);return document.body.removeChild(i),o element with the corresponding viewBox attribute.`),"0 0 16 16"):"0 0 24 24"}}},(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(i,s){return e("symbol",{key:s,attrs:{id:"icon-"+s,viewBox:t.viewbox(s,i)},domProps:{innerHTML:t._s(i)}})})),0)])}),[]).exports;const da=ct({mounted(){window.panel.deprecated(' will be removed in a future version. Use instead.')}},(function(){var t=this._self._c;return t("span",{staticClass:"k-loader"},[t("k-icon",{staticClass:"k-loader-icon",attrs:{type:"loader"}})],1)}),[]).exports;const pa=ct({},(function(){var t=this,e=t._self._c;return t.$panel.notification.isOpen?e("div",{staticClass:"k-notification",attrs:{"data-theme":t.$panel.notification.theme}},[e("p",[t._v(t._s(t.$panel.notification.message))]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return t.$panel.notification.close()}}})],1):t._e()}),[]).exports;const ha=ct({},(function(){var t=this,e=t._self._c;return!t.$panel.system.isLocal&&t.$panel.isOffline?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()}),[]).exports,ma=(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};const fa=ct({props:{value:{type:Number,default:0,validator:ma}},data(){return{state:this.value}},watch:{value(t){this.state=t}},methods:{set(t){window.panel.deprecated(": `set` method will be removed in a future version. Use the `value` prop instead."),ma(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)+"%")])}),[]).exports;const ga=ct({},(function(){return(0,this._self._c)("k-button",{staticClass:"k-sort-handle k-sort-button",attrs:{title:this.$t("sort.drag"),icon:"sort","aria-hidden":"true"}})}),[]).exports,ka={install(t){t.component("k-draggable",ra),t.component("k-error-boundary",la),t.component("k-fatal",ca),t.component("k-icon",Go),t.component("k-icons",ua),t.component("k-loader",da),t.component("k-notification",pa),t.component("k-offline-warning",ha),t.component("k-progress",fa),t.component("k-sort-handle",ga)}};const ba=ct({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(){const t=[];return this.view&&t.push({link:this.view.link,label:this.view.label??this.view.breadcrumbLabel,icon:this.view.icon,loading:this.$panel.isLoading}),[...t,...this.crumbs]}},mounted(){this.view&&window.panel.deprecated(": `view` prop will be removed in a future version. Use `crumbs` instead.")}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-breadcrumb",attrs:{"aria-label":t.label}},[t.segments.length>1?e("div",{staticClass:"k-breadcrumb-dropdown"},[e("k-button",{attrs:{icon:"home"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.dropdown}})],1):t._e(),e("ol",t._l(t.segments,(function(i,s){return e("li",{key:s},[e("k-button",{staticClass:"k-breadcrumb-link",attrs:{icon:i.loading?"loader":i.icon,link:i.link,disabled:!i.link,text:i.text??i.label,title:i.text??i.label,current:s===t.segments.length-1&&"page",variant:"dimmed",size:"sm"}})],1)})),0)])}),[]).exports;const va=ct({props:{items:{type:Array},name:{default:"items",type:String},selected:{type:String},type:{default:"radio",type:String}},emits:["select"]},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-browser"},[e("div",{staticClass:"k-browser-items"},t._l(t.items,(function(i){return e("label",{key:i.value,staticClass:"k-browser-item",attrs:{"aria-selected":t.selected===i.value}},[e("input",{attrs:{name:t.name,type:t.type},domProps:{checked:t.selected===i.value},on:{change:function(e){return t.$emit("select",i)}}}),i.image?e("k-item-image",{staticClass:"k-browser-item-image",attrs:{image:{...i.image,cover:!0,back:"black"}}}):t._e(),e("span",{staticClass:"k-browser-item-info"},[t._v(" "+t._s(i.label)+" ")])],1)})),0)])}),[]).exports,ya={props:{disabled:Boolean,download:Boolean,rel:String,tabindex:[String,Number],target:String,title:String}};const $a=ct({mixins:[ya],props:{to:[String,Function]},emits:["click"],computed:{href(){return"function"==typeof this.to?"":"/"!==this.to[0]||this.target?!0===this.to.includes("@")&&!1===this.to.includes("/")&&!1===this.to.startsWith("mailto:")?"mailto:"+this.to:this.to:this.$url(this.to)},relAttr(){return"_blank"===this.target?"noreferrer noopener":this.rel}},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",{ref:"link",staticClass:"k-link",attrs:{download:t.download,href:t.href,rel:t.relAttr,tabindex:t.tabindex,target:t.target,title:t.title},on:{click:t.onClick}},[t._t("default")],2):e("span",{staticClass:"k-link",attrs:{title:t.title,"aria-disabled":""}},[t._t("default")],2)}),[]).exports;const wa=ct({mixins:[{mixins:[ya],props:{autofocus:Boolean,click:{type:Function,default:()=>{}},current:[String,Boolean],dialog:String,drawer:String,dropdown:Boolean,element:String,icon:String,id:[String,Number],link:String,responsive:[Boolean,String],role:String,selected:[String,Boolean],size:String,text:[String,Number],theme:String,tooltip:String,type:{type:String,default:"button"},variant:String}}],inheritAttrs:!1,emits:["click"],computed:{attrs(){const t={"aria-current":this.current,"aria-disabled":this.disabled,"aria-label":this.text??this.title,"aria-selected":this.selected,"data-responsive":this.responsive,"data-size":this.size,"data-theme":this.theme,"data-variant":this.variant,id:this.id,tabindex:this.tabindex,title:this.title??this.tooltip};return"k-link"===this.component?(t.disabled=this.disabled,t.download=this.download,t.to=this.link,t.rel=this.rel,t.target=this.target):"button"===this.component&&(t.autofocus=this.autofocus,t.role=this.role,t.type=this.type),this.dropdown&&(t["aria-haspopup"]="menu",t["data-dropdown"]=this.dropdown),t},component(){return this.element?this.element:this.link?"k-link":"button"}},mounted(){this.tooltip&&window.panel.deprecated(": the `tooltip` prop will be removed in a future version. Use the `title` prop instead.")},methods:{focus(){var t,e;null==(e=(t=this.$el).focus)||e.call(t)},onClick(t){var e;return this.disabled?(t.preventDefault(),!1):this.dialog?this.$dialog(this.dialog):this.drawer?this.$drawer(this.drawer):(null==(e=this.click)||e.call(this,t),void this.$emit("click",t))}}},(function(){var t=this,e=t._self._c;return e(t.component,t._b({tag:"component",staticClass:"k-button",attrs:{"data-has-icon":Boolean(t.icon),"data-has-text":Boolean(t.text||t.$slots.default)},on:{click:t.onClick}},"component",t.attrs,!1),[t.icon?e("span",{staticClass:"k-button-icon"},[e("k-icon",{attrs:{type:t.icon}})],1):t._e(),t.text||t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default",(function(){return[t._v(" "+t._s(t.text)+" ")]}))],2):t._e(),t.dropdown&&(t.text||t.$slots.default)?e("span",{staticClass:"k-button-arrow"},[e("k-icon",{attrs:{type:"angle-dropdown"}})],1):t._e()])}),[]).exports;const xa=ct({props:{buttons:Array,layout:String,variant:String,theme:String,size:String,responsive:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-button-group",attrs:{"data-layout":t.layout}},[t.$slots.default?t._t("default"):t._l(t.buttons,(function(i,s){return e("k-button",t._b({key:s},"k-button",{variant:t.variant,theme:t.theme,size:t.size,responsive:t.responsive,...i},!1))}))],2)}),[]).exports;const _a=ct({props:{limit:{default:50,type:Number},opened:{type:String},selected:{type:String}},emits:["select"],data(){return{files:[],page:null,pagination:null,view:this.opened?"files":"tree"}},methods:{paginate(t){this.selectPage(this.page,t.page)},selectFile(t){this.$emit("select",t)},async selectPage(t,e=1){this.page=t;const i="/"===t.id?"/site/files":"/pages/"+this.$api.pages.id(t.id)+"/files",{data:s,pagination:n}=await this.$api.get(i,{select:"filename,id,panelImage,url,uuid",limit:this.limit,page:e});this.pagination=n,this.files=s.map((t=>({label:t.filename,image:t.panelImage,id:t.id,url:t.url,uuid:t.uuid,value:t.uuid??t.url}))),this.view="files"},async togglePage(){await this.$nextTick(),this.$refs.tree.scrollIntoView({behaviour:"smooth",block:"nearest",inline:"nearest"})}}},(function(){var t,e,i=this,s=i._self._c;return s("div",{staticClass:"k-file-browser",attrs:{"data-view":i.view}},[s("div",{staticClass:"k-file-browser-layout"},[s("aside",{ref:"tree",staticClass:"k-file-browser-tree"},[s("k-page-tree",{attrs:{current:(null==(t=i.page)?void 0:t.value)??i.opened},on:{select:i.selectPage,toggleBranch:i.togglePage}})],1),s("div",{ref:"items",staticClass:"k-file-browser-items"},[s("k-button",{staticClass:"k-file-browser-back-button",attrs:{icon:"angle-left",text:null==(e=i.page)?void 0:e.label},on:{click:function(t){i.view="tree"}}}),i.files.length?s("k-browser",{attrs:{items:i.files,selected:i.selected},on:{select:i.selectFile}}):i._e()],1),s("div",{staticClass:"k-file-browser-pagination",on:{click:function(t){t.stopPropagation()}}},[i.pagination?s("k-pagination",i._b({attrs:{details:!0},on:{paginate:i.paginate}},"k-pagination",i.pagination,!1)):i._e()],1)])])}),[]).exports;const Ca=ct({props:{tab:String,tabs:{type:Array,default:()=>[]}},computed:{withBadges(){const t=Object.keys(this.$store.getters["content/changes"]());return this.tabs.map((e=>{const i=[];for(const t in e.columns)for(const s in e.columns[t].sections)if("fields"===e.columns[t].sections[s].type)for(const n in e.columns[t].sections[s].fields)i.push(n);return e.badge=i.filter((e=>t.includes(e.toLowerCase()))).length,e}))}}},(function(){var t=this;return(0,t._self._c)("k-tabs",{staticClass:"k-model-tabs",attrs:{tab:t.tab,tabs:t.withBadges,theme:"notice"}})}),[]).exports;const Sa=ct({props:{axis:String,disabled:Boolean,element:{type:String,default:"div"},select:{type:String,default:":where(button, a):not(:disabled)"}},emits:["next","prev"],computed:{keys(){switch(this.axis){case"x":return{ArrowLeft:this.prev,ArrowRight:this.next};case"y":return{ArrowUp:this.prev,ArrowDown:this.next};default:return{ArrowLeft:this.prev,ArrowRight:this.next,ArrowUp:this.prev,ArrowDown:this.next}}}},mounted(){this.$el.addEventListener("keydown",this.keydown)},destroyed(){this.$el.removeEventListener("keydown",this.keydown)},methods:{focus(t=0,e){this.move(t,e)},keydown(t){var e;if(this.disabled)return!1;null==(e=this.keys[t.key])||e.apply(this,[t])},move(t=0,e){var i;const s=[...this.$el.querySelectorAll(this.select)];let n=s.findIndex((t=>t===document.activeElement||t.contains(document.activeElement)));switch(-1===n&&(n=0),t){case"first":t=0;break;case"next":t=n+1;break;case"last":t=s.length-1;break;case"prev":t=n-1}t<0?this.$emit("prev"):t>=s.length?this.$emit("next"):null==(i=s[t])||i.focus(),null==e||e.preventDefault()},next(t){this.move("next",t)},prev(t){this.move("prev",t)}}},(function(){var t=this;return(0,t._self._c)(t.element,{tag:"component",staticClass:"k-navigate"},[t._t("default")],2)}),[]).exports;const Oa=ct({name:"k-tree",inheritAttrs:!1,props:{element:{type:String,default:"k-tree"},current:{type:String},items:{type:[Array,Object]},level:{default:0,type:Number}},emits:["close","open","select","toggle"],data(){return{state:this.items}},methods:{arrow:t=>!0===t.loading?"loader":t.open?"angle-down":"angle-right",close(t){this.$set(t,"open",!1),this.$emit("close",t)},isItem:(t,e)=>t.value===e,open(t){this.$set(t,"open",!0),this.$emit("open",t)},select(t){this.$emit("select",t)},toggle(t){this.$emit("toggle",t),!0===t.open?this.close(t):this.open(t)}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-tree",class:t.$options.name,style:{"--tree-level":t.level}},t._l(t.state,(function(i){return e("li",{key:i.value,attrs:{"aria-expanded":i.open,"aria-current":t.isItem(i,t.current)}},[e("p",{staticClass:"k-tree-branch",attrs:{"data-has-subtree":i.hasChildren&&i.open}},[e("button",{staticClass:"k-tree-toggle",attrs:{disabled:!i.hasChildren,type:"button"},on:{click:function(e){return t.toggle(i)}}},[e("k-icon",{attrs:{type:t.arrow(i)}})],1),e("button",{staticClass:"k-tree-folder",attrs:{disabled:i.disabled,type:"button"},on:{click:function(e){return t.select(i)},dblclick:function(e){return t.toggle(i)}}},[e("k-icon-frame",{attrs:{icon:i.icon??"folder"}}),e("span",{staticClass:"k-tree-folder-label"},[t._v(t._s(i.label))])],1)]),i.hasChildren&&i.open?[e(t.$options.name,t._b({ref:i.value,refInFor:!0,tag:"component",attrs:{items:i.children,level:t.level+1},on:{close:function(e){return t.$emit("close",e)},open:function(e){return t.$emit("open",e)},select:function(e){return t.$emit("select",e)},toggle:function(e){return t.$emit("toggle",e)}}},"component",t.$props,!1))]:t._e()],2)})),0)}),[]).exports;const Ma=ct({name:"k-page-tree",extends:Oa,inheritAttrs:!1,props:{current:{type:String},move:{type:String},root:{default:!0,type:Boolean}},data:()=>({state:[]}),async mounted(){if(this.items)this.state=this.items;else{const t=await this.load(null);await this.open(t[0]),this.state=this.root?t:t[0].children,this.current&&this.preselect(this.current)}},methods:{findItem(t){return this.state.find((e=>this.isItem(e,t)))},isItem:(t,e)=>t.value===e||t.uuid===e||t.id===e,async load(t){return await this.$panel.get("site/tree",{query:{move:this.move??null,parent:t}})},async open(t){if(t){if(!1===t.hasChildren)return!1;this.$set(t,"loading",!0),"string"==typeof t.children&&(t.children=await this.load(t.children)),this.$set(t,"open",!0),this.$set(t,"loading",!1)}},async preselect(t){const e=(await this.$panel.get("site/tree/parents",{query:{page:t,root:this.root}})).data;let i=this;for(let n=0;nPromise.resolve()}},emits:["paginate"],computed:{detailsText(){return 1===this.limit?this.start:this.start+"-"+this.end},end(){return Math.min(this.start-1+this.limit,this.total)},offset(){return this.start-1},pages(){return Math.ceil(this.total/this.limit)},start(){return(this.page-1)*this.limit+1}},methods:{async goTo(t){var e;try{await this.validate(t),null==(e=this.$refs.dropdown)||e.close();const i=((t=Math.max(1,Math.min(t,this.pages)))-1)*this.limit+1;this.$emit("paginate",{page:t,start:i,end:Math.min(i-1+this.limit,this.total),limit:this.limit,offset:i-1,total:this.total})}catch{}},prev(){this.goTo(this.page-1)},next(){this.goTo(this.page+1)}}},(function(){var t=this,e=t._self._c;return t.pages>1?e("k-button-group",{staticClass:"k-pagination",attrs:{layout:"collapsed"},nativeOn:{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.prev.apply(null,arguments)},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.next.apply(null,arguments)}]}},[e("k-button",{staticClass:"k-pagination-button",attrs:{disabled:t.start<=1,title:t.$t("prev"),icon:"angle-left",size:"xs",variant:"filled"},on:{click:t.prev}}),t.details?[e("k-button",{staticClass:"k-pagination-details",attrs:{disabled:t.total<=t.limit,text:t.total>1?`${t.detailsText} / ${t.total}`:t.total,size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",staticClass:"k-pagination-selector",attrs:{"align-x":"end"},nativeOn:{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:void e.stopPropagation()},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:void e.stopPropagation()}]}},[e("form",{attrs:{method:"dialog"},on:{click:function(t){t.stopPropagation()},submit:function(e){return t.goTo(t.$refs.page.value)}}},[e("label",[t._v(" "+t._s(t.$t("pagination.page"))+": "),e("select",{ref:"page",attrs:{autofocus:!0}},t._l(t.pages,(function(i){return e("option",{key:i,domProps:{selected:t.page===i,value:i}},[t._v(" "+t._s(i)+" ")])})),0)]),e("k-button",{attrs:{type:"submit",icon:"check"}})],1)])]:t._e(),e("k-button",{staticClass:"k-pagination-button",attrs:{disabled:t.end>=t.total,title:t.$t("next"),icon:"angle-right",size:"xs",variant:"filled"},on:{click:t.next}})],2):t._e()}),[]).exports;const Ia=ct({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"}]},isFullyDisabled(){return 0===this.buttons.filter((t=>!t.disabled)).length}},methods:{button:t=>t||{disabled:!0,link:"#"}}},(function(){var t=this,e=t._self._c;return t.isFullyDisabled?t._e():e("k-button-group",{staticClass:"k-prev-next",attrs:{buttons:t.buttons,layout:"collapsed",size:"xs"}})}),[]).exports;const Da=ct({mixins:[zt],props:{defaultType:String,isLoading:Boolean,pagination:{type:Object,default:()=>({})},results:Array,types:{type:Object,default:()=>({})}},emits:["close","more","navigate","search"],data(){return{selected:-1,type:this.types[this.defaultType]?this.defaultType:Object.keys(this.types)[0]}},computed:{typesDropdown(){return Object.values(this.types).map((t=>({...t,current:this.type===t.id,click:()=>{this.type=t.id,this.focus()}})))}},watch:{type(){this.search()}},methods:{focus(){var t;null==(t=this.$refs.input)||t.focus()},onDown(){this.select(Math.min(this.selected+1,this.results.length-1))},onEnter(){this.$emit("navigate",this.results[this.selected]??this.results[0])},onUp(){this.select(Math.max(this.selected-1,-1))},async search(){var t,e;null==(t=this.$refs.types)||t.close(),null==(e=this.select)||e.call(this,-1),this.$emit("search",{type:this.type,query:this.query})},select(t){var e;this.selected=t;const i=(null==(e=this.$refs.results)?void 0:e.$el.querySelectorAll(".k-item"))??[];for(const s of i)delete s.dataset.selected;t>=0&&(i[t].dataset.selected=!0)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-search-bar"},[e("div",{staticClass:"k-search-bar-input"},[t.typesDropdown.length>1?[e("k-button",{staticClass:"k-search-bar-types",attrs:{dropdown:!0,icon:t.types[t.type].icon,text:t.types[t.type].label,variant:"dimmed"},on:{click:function(e){return t.$refs.types.toggle()}}}),e("k-dropdown-content",{ref:"types",attrs:{options:t.typesDropdown}})]:t._e(),e("k-search-input",{ref:"input",attrs:{"aria-label":t.$t("search"),autofocus:!0,value:t.query},on:{input:function(e){t.query=e}},nativeOn:{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,"enter",13,e.key,"Enter")?null:t.onEnter.apply(null,arguments)}]}}),e("k-button",{staticClass:"k-search-bar-close",attrs:{icon:t.isLoading?"loader":"cancel",title:t.$t("close")},on:{click:function(e){return t.$emit("close")}}})],2),t.results?e("div",{staticClass:"k-search-bar-results"},[t.results.length?e("k-collection",{ref:"results",attrs:{items:t.results},nativeOn:{mouseout:function(e){return t.select(-1)}}}):t._e(),e("footer",{staticClass:"k-search-bar-footer"},[0===t.results.length?e("p",[t._v(" "+t._s(t.$t("search.results.none"))+" ")]):t._e(),t.results.length will be removed in a future version. Use instead.')}},(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)}),[]).exports;const La=ct({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},mounted(){window.panel.deprecated(' will be removed in a future version. Use instead.')},methods:{focus(){this.$el.focus()}}},(function(){var t=this,e=t._self._c;return e("k-link",{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.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)}),[]).exports;const Ta=ct({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"}},mounted(){window.panel.deprecated(" will be removed in a future version. Use instead.")}},(function(){var t=this,e=t._self._c;return e("button",{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.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)}),[]).exports,Ba={install(t){t.component("k-breadcrumb",ba),t.component("k-browser",va),t.component("k-button",wa),t.component("k-button-group",xa),t.component("k-file-browser",_a),t.component("k-link",$a),t.component("k-model-tabs",Ca),t.component("k-navigate",Sa),t.component("k-page-tree",Ma),t.component("k-pagination",Aa),t.component("k-prev-next",Ia),t.component("k-search-bar",Da),t.component("k-tag",ja),t.component("k-tags",Us),t.component("k-tree",Oa),t.component("k-button-disabled",Ea),t.component("k-button-link",La),t.component("k-button-native",Ta)}};const qa=ct({props:{buttons:Array,headline:String,invalid:Boolean,label:String,link:String,required:Boolean}},(function(){var t=this,e=t._self._c;return e("section",{staticClass:"k-section",attrs:{"data-invalid":t.invalid}},[t.label||t.headline||t.buttons||t.$slots.options?e("header",{staticClass:"k-section-header"},[e("k-label",{attrs:{invalid:t.invalid,link:t.link,required:t.required,title:t.label??t.headline,type:"section"}},[t._v(" "+t._s(t.label??t.headline)+" ")]),t._t("options",(function(){return[t.buttons?e("k-button-group",{staticClass:"k-section-buttons",attrs:{buttons:t.buttons,size:"xs",variant:"filled"}}):t._e()]}))],2):t._e(),t._t("default")],2)}),[]).exports;const Pa=ct({props:{empty:String,blueprint:String,lock:[Boolean,Object],parent:String,tab:Object},emits:["submit"],computed:{content(){return this.$store.getters["content/values"]()}},methods:{exists(t){return this.$helper.isComponent(`k-${t}-section`)}}},(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:{variant:"columns"}},t._l(t.tab.columns,(function(i,s){return e("k-column",{key:t.parent+"-column-"+s,attrs:{width:i.width,sticky:i.sticky}},[t._l(i.sections,(function(n,o){return[t.$helper.field.isVisible(n,t.content)?[t.exists(n.type)?e("k-"+n.type+"-section",t._b({key:t.parent+"-column-"+s+"-section-"+o+"-"+t.blueprint,tag:"component",class:"k-section-name-"+n.name,attrs:{column:i.width,lock:t.lock,name:n.name,parent:t.parent,timestamp:t.$panel.view.timestamp},on:{submit:function(e){return t.$emit("submit",e)}}},"component",n,!1)):[e("k-box",{key:t.parent+"-column-"+s+"-section-"+o,attrs:{text:t.$t("error.section.type.invalid",{type:n.type}),icon:"alert",theme:"negative"}})]]:t._e()]}))],2)})),1)}),[]).exports,Na={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)}}};const za=ct({mixins:[Na],inheritAttrs:!1,data:()=>({fields:{},isLoading:!0,issue:null}),computed:{values(){return this.$store.getters["content/values"]()}},watch:{timestamp(){this.fetch()}},mounted(){this.onInput=Nt(this.onInput,50),this.fetch()},methods:{async fetch(){try{const t=await this.load();this.fields=t.fields;for(const e in this.fields)this.fields[e].section=this.name,this.fields[e].endpoints={field:this.parent+"/fields/"+e,section:this.parent+"/sections/"+this.name,model:this.parent}}catch(t){this.issue=t}finally{this.isLoading=!1}},onInput(t,e,i){this.$store.dispatch("content/update",[i,t[i]])},onSubmit(t){this.$store.dispatch("content/update",[null,t]),this.$events.emit("keydown.cmd.s",t)}}},(function(){var t=this,e=t._self._c;return t.isLoading?t._e():e("k-section",{staticClass:"k-fields-section",attrs:{headline:t.issue?"Error":null}},[t.issue?e("k-box",{attrs:{text:t.issue.message,html:!1,icon:"alert",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.onInput,submit:t.onSubmit}})],1)}),[]).exports;const Fa=ct({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("filter"),click:this.onSearchToggle,responsive:!0}),this.canAdd&&t.push({icon:this.addIcon,text:this.$t("add"),click:this.onAdd,responsive:!0}),t},canAdd:()=>!0,canDrop:()=>!1,canSearch(){return this.options.search},collection(){return{columns:this.options.columns,empty:this.emptyPropsWithSearch,fields:this.options.fields,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(){this.search()},timestamp(){this.reload()}},mounted(){this.search=Nt(this.search,200),this.load()},methods:{async load(t){this.isProcessing=!0,t||(this.isLoading=!0);const e=this.pagination.page??localStorage.getItem(this.paginationId)??1;try{const t=await this.$api.get(this.parent+"/sections/"+this.name,{page:e,searchterm:this.searchterm});this.options=t.options,this.pagination=t.pagination,this.data=t.data}catch(i){this.error=i.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},async reload(){await this.load(!0)},async search(){this.pagination.page=0,await this.reload()},update(){this.reload(),this.$events.emit("model.update")}}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("k-section",{class:`k-models-section k-${t.type}-section`,attrs:{buttons:t.buttons,"data-processing":t.isProcessing,headline:t.options.headline??" ",invalid:t.isInvalid,link:t.options.link,required:Boolean(t.options.min)}},[t.error?e("k-box",{attrs:{icon:"alert",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("filter")+" …",value:t.searchterm,icon:"search",type:"text"},on:{input:function(e){t.searchterm=e},keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.onSearchToggle.apply(null,arguments)}}}):t._e(),e("k-collection",t._g(t._b({on:{action:t.onAction,change:t.onChange,sort:t.onSort,paginate:t.onPaginate}},"k-collection",t.collection,!1),t.canAdd?{empty:t.onAdd}:{}))],1)]],2):t._e()}),[]).exports;const Ya=ct({extends:Fa,computed:{addIcon:()=>"upload",canAdd(){return this.$panel.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",uploadOptions(){return{...this.options.upload,url:this.$panel.urls.api+"/"+this.options.upload.api,on:{complete:()=>{this.$panel.notification.success({context:"view"}),this.$events.emit("file.upload")}}}}},mounted(){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.$panel.upload.pick(this.uploadOptions)},onDrop(t){this.canAdd&&this.$panel.upload.open(t,this.uploadOptions)},async onSort(t){if(!1===this.options.sortable)return!1;this.isProcessing=!0;try{await this.$api.patch(this.options.apiUrl+"/sort",{files:t.map((t=>t.id)),index:this.pagination.offset}),this.$panel.notification.success(),this.$events.emit("file.sort")}catch(e){this.$panel.error(e),this.reload()}finally{this.isProcessing=!1}},replace(t){this.$panel.upload.replace(t,this.uploadOptions)}}},null,null).exports;const Ra=ct({mixins:[Na],inheritAttrs:!1,data:()=>({icon:null,label:null,text:null,theme:null}),async mounted(){const t=await this.load();this.icon=t.icon,this.label=t.label,this.text=t.text,this.theme=t.theme??"info"}},(function(){var t=this,e=t._self._c;return e("k-section",{staticClass:"k-info-section",attrs:{headline:t.label}},[e("k-box",{attrs:{html:!0,icon:t.icon,text:t.text,theme:t.theme}})],1)}),[]).exports;const Ua=ct({extends:Fa,computed:{canAdd(){return this.options.add&&this.$panel.permissions.pages.create},items(){return this.data.map((t=>{const e=!1===t.permissions.changeStatus,i=this.$helper.page.status(t.status,e);return i.click=()=>this.$dialog(t.link+"/changeStatus"),t.flag={status:t.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.buttons=[i,...t.buttons??[]],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}))},type:()=>"pages"},mounted(){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 s=t[e].element,n=t[e].newIndex+1+this.pagination.offset;try{await this.$api.pages.changeStatus(s.id,"listed",n),this.$panel.notification.success(),this.$events.emit("page.sort",s)}catch(i){this.$panel.error({message:i.message,details:i.details}),await this.reload()}finally{this.isProcessing=!1}}}}},null,null).exports;const Ha=ct({mixins:[Na],data:()=>({headline:null,isLoading:!0,reports:null,size:null}),async mounted(){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("k-section",{staticClass:"k-stats-section",attrs:{headline:t.headline}},[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.$t("stats.empty")))])],1):t._e()}),[]).exports,Va={install(t){t.component("k-section",qa),t.component("k-sections",Pa),t.component("k-fields-section",za),t.component("k-files-section",Ya),t.component("k-info-section",Ra),t.component("k-pages-section",Ua),t.component("k-stats-section",Ha)}};const Ka=ct({components:{"k-highlight":()=>Y((()=>import("./Highlight.min.js")),__vite__mapDeps([5,1]),import.meta.url)},props:{language:{type:String}}},(function(){var t=this,e=t._self._c;return e("k-highlight",[e("div",[e("pre",{staticClass:"k-code",attrs:{"data-language":t.language}},[e("code",{key:t.$slots.default[0].text+"-"+t.language,class:t.language?`language-${t.language}`:null},[t._t("default")],2)])])])}),[]).exports;const Wa=ct({props:{link:String,size:{type:String},tag:{type:String,default:"h2"},theme:{type:String}},emits:["click"],mounted(){this.size&&window.panel.deprecated(": the `size` prop will be removed in a future version. Use the `tag` prop instead."),this.theme&&window.panel.deprecated(": the `theme` prop will be removed in a future version.")}},(function(){var t=this,e=t._self._c;return e(t.tag,{tag:"component",staticClass:"k-headline",attrs:{"data-theme":t.theme,"data-size":t.size},on:{click:function(e){return t.$emit("click",e)}}},[t.link?e("k-link",{attrs:{to:t.link}},[t._t("default")],2):t._t("default")],2)}),[]).exports;const Ja=ct({props:{input:{type:[String,Number]},invalid:{type:Boolean},link:{type:String},required:{default:!1,type:Boolean},type:{default:"field",type:String}},computed:{element(){return"section"===this.type?"h2":"label"}}},(function(){var t=this,e=t._self._c;return e(t.element,{tag:"component",staticClass:"k-label",class:"k-"+t.type+"-label",attrs:{for:t.input,"data-invalid":t.invalid}},[t.link?e("k-link",{attrs:{to:t.link}},[e("span",{staticClass:"k-label-text"},[t._t("default")],2)]):e("span",{staticClass:"k-label-text"},[t._t("default")],2),t.required&&!t.invalid?e("abbr",{attrs:{title:t.$t(t.type+".required")}},[t._v("✶")]):t._e(),e("abbr",{staticClass:"k-label-invalid",attrs:{title:t.$t(t.type+".invalid")}},[t._v("×")])],1)}),[]).exports;const Ga=ct({props:{align:String,html:String,size:String,theme:String},computed:{attrs(){return{class:"k-text","data-align":this.align,"data-size":this.size,"data-theme":this.theme}}},mounted(){this.theme&&window.panel.deprecated(': the `theme` prop will be removed in a future version. For help text, add `.k-help "` CSS class instead.')}},(function(){var t=this,e=t._self._c;return t.html?e("div",t._b({domProps:{innerHTML:t._s(t.html)}},"div",t.attrs,!1)):e("div",t._b({},"div",t.attrs,!1),[t._t("default")],2)}),[]).exports,Xa={install(t){t.component("k-code",Ka),t.component("k-headline",Wa),t.component("k-label",Ja),t.component("k-text",Ga)}},Za={props:{back:String,color:String,cover:{type:Boolean,default:!0},icon:String,type:String,url:String}};const Qa=ct({mixins:[Za],computed:{fallbackColor(){var t,e,i;return(null==(t=this.type)?void 0:t.startsWith("image/"))?"orange-500":(null==(e=this.type)?void 0:e.startsWith("audio/"))?"aqua-500":(null==(i=this.type)?void 0:i.startsWith("video/"))?"yellow-500":"white"},fallbackIcon(){var t,e,i;return(null==(t=this.type)?void 0:t.startsWith("image/"))?"image":(null==(e=this.type)?void 0:e.startsWith("audio/"))?"audio":(null==(i=this.type)?void 0:i.startsWith("video/"))?"video":"file"},isPreviewable(){return["image/jpeg","image/jpg","image/gif","image/png","image/webp","image/avif","image/svg+xml"].includes(this.type)}}},(function(){var t=this,e=t._self._c;return e("a",{staticClass:"k-upload-item-preview",attrs:{href:t.url,target:"_blank"}},[t.isPreviewable?e("k-image",{attrs:{cover:t.cover,src:t.url,back:t.back??"pattern"}}):e("k-icon-frame",{attrs:{color:t.color??t.fallbackColor,icon:t.icon??t.fallbackIcon,back:t.back??"black",ratio:"1/1"}})],1)}),[]).exports;const tr=ct({mixins:[Za],props:{completed:Boolean,editable:{type:Boolean,default:!0},error:[String,Boolean],extension:String,id:String,name:String,niceSize:String,progress:Number,removable:{type:Boolean,default:!0}},emits:["remove","rename"]},(function(){var t=this,e=t._self._c;return e("li",{staticClass:"k-upload-item",attrs:{"data-completed":t.completed}},[e("k-upload-item-preview",{attrs:{back:t.back,color:t.color,cover:t.cover,icon:t.icon,type:t.type,url:t.url}}),e("k-input",{staticClass:"k-upload-item-input",attrs:{disabled:t.completed||!t.editable,after:"."+t.extension,novalidate:!0,required:!0,value:t.name,allow:"a-z0-9@._-",type:"slug"},on:{input:function(e){return t.$emit("rename",e)}}}),e("div",{staticClass:"k-upload-item-body"},[e("p",{staticClass:"k-upload-item-meta"},[t._v(" "+t._s(t.niceSize)+" "),t.progress?[t._v(" - "+t._s(t.progress)+"% ")]:t._e()],2),t.error?e("p",{staticClass:"k-upload-item-error"},[t._v(" "+t._s(t.error)+" ")]):t.progress?e("k-progress",{staticClass:"k-upload-item-progress",attrs:{value:t.progress}}):t._e()],1),e("div",{staticClass:"k-upload-item-toggle"},[t.completed||t.progress||!t.removable?!t.completed&&t.progress?e("k-button",{attrs:{disabled:!0,icon:"loader"}}):t.completed?e("k-button",{attrs:{icon:"check",theme:"positive"},on:{click:function(e){return t.$emit("remove")}}}):t._e():e("k-button",{attrs:{icon:"remove"},on:{click:function(e){return t.$emit("remove")}}})],1)],1)}),[]).exports;const er=ct({props:{items:Array},emits:["remove","rename"]},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-upload-items"},t._l(t.items,(function(i){return e("k-upload-item",t._b({key:i.id,on:{rename:function(e){return t.$emit("rename",i,e)},remove:function(e){return t.$emit("remove",i)}}},"k-upload-item",i,!1))})),1)}),[]).exports,ir={install(t){t.component("k-upload-item",tr),t.component("k-upload-item-preview",Qa),t.component("k-upload-items",er)}};const sr=ct({props:{status:{default:"missing",type:String}}},(function(){var t=this,e=t._self._c;return t.$panel.activation.isOpen?e("div",{staticClass:"k-activation"},[e("p",[e("strong",[t._v(t._s(t.$t(`license.status.${t.status}.bubble`)))]),"missing"===t.status?[e("a",{attrs:{href:"https://getkirby.com/buy",target:"_blank"}},[t._v(t._s(t.$t("license.buy")))]),t._v(" & "),e("button",{attrs:{type:"button"},on:{click:function(e){return t.$dialog("registration")}}},[t._v(" "+t._s(t.$t("license.activate"))+" ")])]:t._e()],2),e("k-button",{staticClass:"k-activation-toggle",attrs:{icon:"cancel-small"},on:{click:function(e){return t.$panel.activation.close()}}})],1):t._e()}),[]).exports;const nr=ct({computed:{notification(){return"view"!==this.$panel.notification.context||this.$panel.notification.isFatal?null:this.$panel.notification}}},(function(){var t=this,e=t._self._c;return e("k-panel",{staticClass:"k-panel-inside"},[e("k-panel-menu"),e("main",{staticClass:"k-panel-main"},[e("k-topbar",{attrs:{breadcrumb:t.$panel.view.breadcrumb,view:t.$panel.view}},[t._t("topbar")],2),t._t("default")],2),t.notification&&"error"!==t.notification.type?e("k-button",{staticClass:"k-panel-notification",attrs:{icon:t.notification.icon,text:t.notification.message,theme:t.notification.theme,variant:"filled"},on:{click:function(e){return t.notification.close()}}}):t._e()],1)}),[]).exports;const or=ct({data:()=>({over:!1}),computed:{activationButton(){return"missing"===this.$panel.license?{click:()=>this.$dialog("registration"),text:this.$t("activate")}:"legacy"===this.$panel.license&&{click:()=>this.$dialog("license"),text:this.$t("renew")}},hasSearch(){return this.$helper.object.length(this.$panel.searches)>0},menus(){return this.$helper.array.split(this.$panel.menu.entries,"-")}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-panel-menu",attrs:{"aria-label":t.$t("menu"),"data-hover":t.$panel.menu.hover},on:{mouseenter:function(e){t.$panel.menu.hover=!0},mouseleave:function(e){t.$panel.menu.hover=!1}}},[e("div",{staticClass:"k-panel-menu-body"},[t.hasSearch?e("k-button",{staticClass:"k-panel-menu-search k-panel-menu-button",attrs:{text:t.$t("search"),icon:"search"},on:{click:function(e){return t.$panel.search()}}}):t._e(),t._l(t.menus,(function(i,s){return e("menu",{key:s,staticClass:"k-panel-menu-buttons",attrs:{"data-second-last":s===t.menus.length-2}},t._l(i,(function(i){return e("k-button",t._b({key:i.id,staticClass:"k-panel-menu-button",attrs:{title:i.title??i.text}},"k-button",i,!1))})),1)})),t.activationButton?e("menu",[e("k-button",t._b({staticClass:"k-activation-button k-panel-menu-button",attrs:{icon:"key",theme:"love",variant:"filled"}},"k-button",t.activationButton,!1)),e("k-activation",{attrs:{status:t.$panel.license}})],1):t._e()],2),e("k-button",{staticClass:"k-panel-menu-toggle",attrs:{icon:t.$panel.menu.isOpen?"angle-left":"angle-right",title:t.$panel.menu.isOpen?t.$t("collapse"):t.$t("expand"),size:"xs"},on:{click:function(e){return t.$panel.menu.toggle()}}})],1)}),[]).exports;const ar=ct({},(function(){return(0,this._self._c)("k-panel",{staticClass:"k-panel-outside",attrs:{tabindex:"0"}},[this._t("default")],2)}),[]).exports;const rr=ct({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-panel",attrs:{"data-dragging":t.$panel.drag.isDragging,"data-loading":t.$panel.isLoading,"data-language":t.$panel.language.code,"data-language-default":t.$panel.language.isDefault,"data-menu":t.$panel.menu.isOpen?"true":"false","data-role":t.$panel.user.role,"data-translation":t.$panel.translation.code,"data-user":t.$panel.user.id,dir:t.$panel.direction}},[t._t("default"),t.$panel.dialog.isOpen&&!t.$panel.dialog.legacy?e("k-fiber-dialog"):t._e(),t.$panel.drawer.isOpen&&!t.$panel.drawer.legacy?e("k-fiber-drawer"):t._e(),t.$panel.notification.isFatal&&t.$panel.notification.isOpen?e("k-fatal",{attrs:{html:t.$panel.notification.message}}):t._e(),e("k-offline-warning"),e("k-icons"),e("k-overlay",{attrs:{nested:t.$panel.drawer.history.milestones.length>1,visible:t.$panel.drawer.isOpen,type:"drawer"},on:{close:function(e){return t.$panel.drawer.close()}}},[e("portal-target",{staticClass:"k-drawer-portal k-portal",attrs:{name:"drawer",multiple:""}})],1),e("k-overlay",{attrs:{visible:t.$panel.dialog.isOpen,type:"dialog"},on:{close:function(e){return t.$panel.dialog.close()}}},[e("portal-target",{staticClass:"k-dialog-portal k-portal",attrs:{name:"dialog",multiple:""}})],1),e("portal-target",{staticClass:"k-overlay-portal k-portal",attrs:{name:"overlay",multiple:""}})],2)}),[]).exports;const lr=ct({props:{breadcrumb:Array,view:Object},computed:{crumbs(){return[{link:this.view.link,label:this.view.label??this.view.breadcrumbLabel,icon:this.view.icon,loading:this.$panel.isLoading},...this.breadcrumb]}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-topbar"},[e("k-button",{staticClass:"k-panel-menu-proxy",attrs:{icon:"bars"},on:{click:function(e){return t.$panel.menu.toggle()}}}),e("k-breadcrumb",{staticClass:"k-topbar-breadcrumb",attrs:{crumbs:t.crumbs}}),e("div",{staticClass:"k-topbar-spacer"}),e("div",{staticClass:"k-topbar-signals"},[t._t("default")],2)],1)}),[]).exports,cr={install(t){t.component("k-activation",sr),t.component("k-panel",rr),t.component("k-panel-inside",nr),t.component("k-panel-menu",or),t.component("k-panel-outside",ar),t.component("k-topbar",lr),t.component("k-inside",nr),t.component("k-outside",ar)}};const ur=ct({props:{error:String,layout:String}},(function(){var t=this,e=t._self._c;return e(`k-panel-${t.layout}`,{tag:"component",staticClass:"k-error-view"},["outside"===t.layout?[e("div",[e("k-box",{attrs:{icon:"alert",theme:"negative"}},[t._v(t._s(t.error))])],1)]:[e("k-header",[t._v(t._s(t.$t("error")))]),e("k-box",{attrs:{icon:"alert",theme:"negative"}},[t._v(t._s(t.error))])]],2)}),[]).exports;const dr=ct({mixins:[zt],props:{type:{default:"pages",type:String}},data:()=>({query:new URLSearchParams(window.location.search).get("query"),pagination:{},results:[]}),computed:{currentType(){return this.$panel.searches[this.type]??Object.values(this.$panel.searches)[0]},empty(){return this.isLoading?this.$t("searching")+"…":this.query.length<2?this.$t("search.min",{min:2}):this.$t("search.results.none")},isLoading(){return this.$panel.searcher.isLoading},tabs(){const t=[];for(const e in this.$panel.searches){const i=this.$panel.searches[e];t.push({label:i.label,link:"/search/?type="+e+"&query="+this.query,name:e})}return t}},watch:{isLoading(t){this.$panel.isLoading=t},query:{handler(){this.search(1)},immediate:!0},type(){this.search()}},methods:{focus(){var t;null==(t=this.$refs.input)||t.focus()},onPaginate(t){this.search(t.page)},async search(t){t||(t=new URLSearchParams(window.location.search).get("page")??1);const e=this.$panel.url(window.location,{type:this.currentType.id,query:this.query,page:t});window.history.pushState("","",e.toString());const i=await this.$panel.search(this.currentType.id,this.query,{page:t,limit:15});i&&(this.results=i.results??[],this.pagination=i.pagination)}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-search-view"},[e("k-header",[t._v(" "+t._s(t.$t("search"))+" "),e("k-input",{ref:"input",staticClass:"k-search-view-input",attrs:{slot:"buttons","aria-label":t.$t("search"),autofocus:!0,icon:t.isLoading?"loader":"search",placeholder:t.$t("search")+" …",spellcheck:!1,value:t.query,type:"text"},on:{input:function(e){t.query=e}},slot:"buttons"})],1),e("k-tabs",{attrs:{tab:t.currentType.id,tabs:t.tabs}}),e("div",{staticClass:"k-search-view-results"},[e("k-collection",{attrs:{items:t.results,empty:{icon:t.isLoading?"loader":"search",text:t.empty},pagination:t.pagination},on:{paginate:t.onPaginate}})],1)],1)}),[]).exports;const pr=ct({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:{"$panel.view.timestamp":{handler(){this.$store.dispatch("content/create",{id:this.id,api:this.id,content:this.model.content,ignore:this.protectedFields})},immediate:!0}},mounted(){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:{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).exports;const hr=ct({extends:pr,props:{preview:Object},computed:{focus(){const t=this.$store.getters["content/values"]().focus;if(!t)return;const[e,i]=t.replaceAll("%","").split(" ");return{x:parseFloat(e),y:parseFloat(i)}}},methods:{action(t){if("replace"===t)return this.$panel.upload.replace({...this.preview,...this.model})},setFocus(t){!0===this.$helper.object.isObject(t)&&(t=`${t.x}% ${t.y}%`),this.$store.dispatch("content/update",["focus",t])}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-file-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-id":t.model.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{staticClass:"k-file-view-header",attrs:{editable:t.permissions.changeName&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-file-view-options",attrs:{link:t.preview.url,responsive:!0,title:t.$t("open"),icon:"open",size:"sm",target:"_blank",variant:"filled"}}),e("k-button",{staticClass:"k-file-view-options",attrs:{disabled:t.isLocked,dropdown:!0,title:t.$t("settings"),icon:"cog",size:"sm",variant:"filled"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id),"align-x":"end"},on:{action:t.action}}),e("k-languages-dropdown")],1),e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[t._v(" "+t._s(t.model.filename)+" ")]),e("k-file-preview",t._b({attrs:{focus:t.focus},on:{focus:t.setFocus}},"k-file-preview",t.preview,!1)),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),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}})],1)}),[]).exports;const mr=ct({props:{focus:Object},emits:["set"],methods:{set(){this.$emit("set",{x:50,y:50})},reset(){this.$emit("set",void 0)}}},(function(){var t=this;return(0,t._self._c)("k-button",{attrs:{icon:t.focus?"cancel-small":"preview",title:t.focus?t.$t("file.focus.reset"):void 0,size:"xs",variant:"filled"},on:{click:function(e){t.focus?t.reset():t.set()}}},[t.focus?[t._v(t._s(t.focus.x)+"% "+t._s(t.focus.y)+"%")]:[t._v(t._s(t.$t("file.focus.placeholder")))]],2)}),[]).exports;const fr=ct({props:{details:{default:()=>[],type:Array},focus:{type:Object},focusable:Boolean,image:{default:()=>({}),type:Object},url:String},emits:["focus"],computed:{options(){return[{icon:"open",text:this.$t("open"),link:this.url,target:"_blank"},{icon:"cancel",text:this.$t("file.focus.reset"),click:()=>this.$refs.focus.reset(),when:this.focusable&&this.focus},{icon:"preview",text:this.$t("file.focus.placeholder"),click:()=>this.$refs.focus.set(),when:this.focusable&&!this.focus}]}},methods:{setFocus(t){if(!t)return this.$emit("focus",null);this.$emit("focus",{x:t.x.toFixed(1),y:t.y.toFixed(1)})}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-file-preview",attrs:{"data-has-focus":Boolean(t.focus)}},[e("div",{staticClass:"k-file-preview-thumb-column"},[e("div",{staticClass:"k-file-preview-thumb"},[t.image.src?[e("k-coords-input",{attrs:{disabled:!t.focusable,value:t.focus},on:{input:function(e){return t.setFocus(e)}}},[e("img",t._b({on:{dragstart:function(t){t.preventDefault()}}},"img",t.image,!1))]),e("k-button",{staticStyle:{color:"var(--color-gray-500)"},attrs:{icon:"dots",size:"xs"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.options,theme:"light"}})]:e("k-icon",{staticClass:"k-item-icon",attrs:{color:t.$helper.color(t.image.color),type:t.image.icon}})],2)]),e("div",{staticClass:"k-file-preview-details"},[e("dl",[t._l(t.details,(function(i){return e("div",{key:i.title},[e("dt",[t._v(t._s(i.title))]),e("dd",[i.link?e("k-link",{attrs:{to:i.link,tabindex:"-1",target:"_blank"}},[t._v(" /"+t._s(i.text)+" ")]):[t._v(" "+t._s(i.text)+" ")]],2)])})),t.image.src?e("div",{staticClass:"k-file-preview-focus-info"},[e("dt",[t._v(t._s(t.$t("file.focus.title")))]),e("dd",[t.focusable?e("k-file-focus-button",{ref:"focus",attrs:{focus:t.focus},on:{set:t.setFocus}}):t.focus?[t._v(" "+t._s(t.focus.x)+"% "+t._s(t.focus.y)+"% ")]:[t._v("–")]],2)]):t._e()],2)])])}),[]).exports,gr={install(t){t.component("k-file-view",hr),t.component("k-file-preview",fr),t.component("k-file-focus-button",mr)}};const kr=ct({props:{isInstallable:Boolean,isInstalled:Boolean,isOk:Boolean,requirements:Object,translations:Array},data(){return{user:{name:"",email:"",language:this.$panel.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:"translate",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.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"})}catch(t){this.$panel.error(t)}}}},(function(){var t=this,e=t._self._c;return e("k-panel-outside",{staticClass:"k-installation-view"},[e("div",{staticClass:"k-dialog k-installation-dialog"},[e("k-dialog-body",[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,value:t.user},on:{input:function(e){t.user=e}}}),e("k-button",{attrs:{text:t.$t("install"),icon:"check",size:"lg",theme:"positive",type:"submit",variant:"filled"}})],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",size:"lg",theme:"positive",variant:"filled"},on:{click:t.$reload}})],1)],1)],1)])}),[]).exports,br={install(t){t.component("k-installation-view",kr)}};const vr=ct({props:{languages:{type:Array,default:()=>[]},variables:{type:Boolean,default:!0}},computed:{languagesCollection(){return this.languages.map((t=>({...t,image:{back:"black",color:"gray",icon:"translate"},link:()=>{if(!1===this.variables)return null;this.$go(`languages/${t.id}`)},options:[{icon:"edit",text:this.$t("edit"),disabled:!1===this.variables,click:()=>this.$go(`languages/${t.id}`)},{icon:"cog",text:this.$t("settings"),disabled:!this.$panel.permissions.languages.update,click:()=>this.$dialog(`languages/${t.id}/update`)},{when:t.deletable,icon:"trash",text:this.$t("delete"),disabled:!this.$panel.permissions.languages.delete,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-panel-inside",{staticClass:"k-languages-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.languages"))+" "),e("k-button-group",{attrs:{slot:"buttons"},slot:"buttons"},[e("k-button",{attrs:{disabled:!t.$panel.permissions.languages.create,text:t.$t("language.create"),icon:"add",size:"sm",variant:"filled"},on:{click:function(e){return t.$dialog("languages/create")}}})],1)],1),t.languages.length>0?[e("k-section",{attrs:{headline:t.$t("languages.default")}},[e("k-collection",{attrs:{items:t.primaryLanguage}})],1),e("k-section",{attrs:{headline:t.$t("languages.secondary")}},[t.secondaryLanguages.length?e("k-collection",{attrs:{items:t.secondaryLanguages}}):e("k-empty",{attrs:{icon:"translate",disabled:!t.$panel.permissions.languages.create},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:"translate",disabled:!t.$panel.permissions.languages.create},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.empty"))+" ")])]:t._e()],2)}),[]).exports;const yr=ct({props:{code:String,deletable:Boolean,direction:String,id:String,info:Array,next:Object,name:String,prev:Object,translations:Array,url:String},computed:{canUpdate(){return this.$panel.permissions.languages.update}},methods:{createTranslation(){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/create`)},option(t,e){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/${window.btoa(encodeURIComponent(e.key))}/${t}`)},remove(){this.$dialog(`languages/${this.id}/delete`)},update(t){this.$dialog(`languages/${this.id}/update`,{on:{ready:()=>{this.$panel.dialog.focus(t)}}})},updateTranslation({row:t}){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/${window.btoa(encodeURIComponent(t.key))}/update`)}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-language-view",scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{attrs:{editable:t.canUpdate},on:{edit:function(e){return t.update()}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[e("k-button",{attrs:{link:t.url,title:t.$t("open"),icon:"open",size:"sm",target:"_blank",variant:"filled"}}),e("k-button",{attrs:{disabled:!t.canUpdate,title:t.$t("settings"),icon:"cog",size:"sm",variant:"filled"},on:{click:function(e){return t.update()}}}),t.deletable?e("k-button",{attrs:{disabled:!t.$panel.permissions.languages.delete,title:t.$t("delete"),icon:"trash",size:"sm",variant:"filled"},on:{click:function(e){return t.remove()}}}):t._e()],1)]},proxy:!0}])},[t._v(" "+t._s(t.name)+" ")]),e("k-section",{attrs:{headline:t.$t("language.settings")}},[e("k-stats",{attrs:{reports:t.info,size:"small"}})],1),e("k-section",{attrs:{buttons:[{click:t.createTranslation,disabled:!t.canUpdate,icon:"add",text:t.$t("add")}],headline:t.$t("language.variables")}},[t.translations.length?[e("k-table",{attrs:{columns:{key:{label:t.$t("language.variable.key"),mobile:!0,width:"1/4"},value:{label:t.$t("language.variable.value"),mobile:!0}},disabled:!t.canUpdate,rows:t.translations},on:{cell:t.updateTranslation,option:t.option}})]:[e("k-empty",{attrs:{disabled:!t.canUpdate,icon:"translate"},on:{click:t.createTranslation}},[t._v(" "+t._s(t.$t("language.variables.empty"))+" ")])]],2)],1)}),[]).exports,$r={install(t){t.component("k-languages-view",vr),t.component("k-language-view",yr)}};const wr=ct({emits:["click"]},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-notification k-login-alert",attrs:{"data-theme":"error"}},[e("p",[t._t("default")],2),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return t.$emit("click")}}})],1)}),[]).exports,xr={props:{methods:{type:Array,default:()=>[]},pending:{type:Object,default:()=>({challenge:"email"})},value:String}};const _r=ct({mixins:[xr],emits:["error"],data(){return{code:this.value??"",isLoading:!1}},computed:{mode(){return this.methods.includes("password-reset")?"password-reset":"login"},submitText(){const t=this.isLoading?" …":"";return"password-reset"===this.mode?this.$t("login.reset")+t:this.$t("login")+t}},methods:{async login(){this.$emit("error",null),this.isLoading=!0;try{await this.$api.auth.verifyCode(this.code),this.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"}),"password-reset"===this.mode?this.$go("reset-password"):this.$reload()}catch(t){this.$emit("error",t)}finally{this.isLoading=!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)}}},[t.pending.email?e("k-user-info",{attrs:{user:t.pending.email}}):t._e(),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,value:t.code,autocomplete:"one-time-code",icon:"unlock",name:"code"},on:{input:function(e){t.code=e}}}),e("footer",{staticClass:"k-login-buttons"},[e("k-button",{staticClass:"k-login-button k-login-back-button",attrs:{text:t.$t("back"),icon:"angle-left",link:"/logout",size:"lg",variant:"filled"}}),e("k-button",{staticClass:"k-login-button",attrs:{text:t.submitText,icon:"check",size:"lg",type:"submit",theme:"positive",variant:"filled"}})],1)],1)}),[]).exports,Cr={props:{methods:{type:Array,default:()=>[]},value:{type:Object,default:()=>({})}}};const Sr=ct({mixins:[Cr],emits:["error"],data(){return{mode:null,isLoading:!1,user:{email:"",password:"",remember:!1,...this.value}}},computed:{alternateMode(){return"email-password"===this.form?"email":"email-password"},canToggle(){return null!==this.codeMode&&(!1!==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(){const 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.mode?this.mode:"password"===this.methods[0]?"email-password":"email"},isResetForm(){return"password-reset"===this.codeMode&&"email"===this.form},submitText(){const t=this.isLoading?" …":"";return this.isResetForm?this.$t("login.reset")+t:this.$t("login")+t},toggleText(){return this.$t("login.toggleText."+this.codeMode+"."+this.alternateMode)}},methods:{async login(){this.$emit("error",null),this.isLoading=!0;const t={...this.user};"email"===this.mode&&(t.password=null),!0===this.isResetForm&&(t.remember=!1);try{await this.$api.auth.login(t),this.$reload({globals:["$system","$translation"]}),this.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"})}catch(e){this.$emit("error",e)}finally{this.isLoading=!1}},toggle(){this.mode=this.alternateMode,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("div",{staticClass:"k-login-fields"},[!0===t.canToggle?e("button",{staticClass:"k-login-toggler",attrs:{type:"button"},on:{click:t.toggle}},[t._v(" "+t._s(t.toggleText)+" ")]):t._e(),e("k-fieldset",{ref:"fieldset",attrs:{novalidate:!0,fields:t.fields,value:t.user},on:{input:function(e){t.user=e}}})],1),e("footer",{staticClass:"k-login-buttons"},[!1===t.isResetForm?e("k-checkbox-input",{attrs:{label:t.$t("login.remember"),checked:t.user.remember,value:t.user.remember},on:{input:function(e){t.user.remember=e}}}):t._e(),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",size:"lg",theme:"positive",type:"submit",variant:"filled"}},[t._v(" "+t._s(t.submitText)+" ")])],1)])}),[]).exports;const Or=ct({components:{"k-login-plugin-form":window.panel.plugins.login},mixins:[xr,Cr],props:{value:{type:Object,default:()=>({code:"",email:"",password:""})}},data:()=>({issue:""}),computed:{component:()=>window.panel.plugins.login?"k-login-plugin-form":"k-login-form",form(){return this.pending.email?"code":"login"}},mounted(){this.$store.dispatch("content/clear")},methods:{async onError(t){null!==t?(!0===t.details.challengeDestroyed&&await this.$reload({globals:["$system"]}),this.issue=t.message):this.issue=null}}},(function(){var t=this,e=t._self._c;return e("k-panel-outside",{class:"code"===t.form?"k-login-code-view":"k-login-view"},[e("div",{staticClass:"k-dialog k-login k-login-dialog"},[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("login"))+" ")]),t.issue?e("k-login-alert",{nativeOn:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),e("k-dialog-body",["code"===t.form?e("k-login-code-form",t._b({on:{error:t.onError}},"k-login-code-form",{methods:t.methods,pending:t.pending,value:t.value.code},!1)):e(t.component,t._b({tag:"component",on:{error:t.onError}},"component",{methods:t.methods,value:t.value},!1))],1)],1)])}),[]).exports,Mr={install(t){t.component("k-login-alert",wr),t.component("k-login-code-form",_r),t.component("k-login-form",Sr),t.component("k-login-view",Or),t.component("k-login",Sr),t.component("k-login-code",_r)}};const Ar=ct({extends:pr,props:{status:Object},computed:{protectedFields:()=>["title"],statusBtn(){return{...this.$helper.page.status.call(this,this.model.status,!this.permissions.changeStatus||this.isLocked),responsive:!0,size:"sm",text:this.status.label,variant:"filled"}}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-page-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-id":t.model.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[t.model.id?e("k-prev-next",{attrs:{prev:t.prev,next:t.next}}):t._e()]},proxy:!0}])},[e("k-header",{staticClass:"k-page-view-header",attrs:{editable:t.permissions.changeTitle&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.id+"/changeTitle")}},scopedSlots:t._u([{key:"buttons",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,title:t.$t("open"),icon:"open",target:"_blank",variant:"filled",size:"sm"}}):t._e(),e("k-button",{staticClass:"k-page-view-options",attrs:{disabled:!0===t.isLocked,dropdown:!0,title:t.$t("settings"),icon:"cog",variant:"filled",size:"sm"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id),"align-x":"end"}}),e("k-languages-dropdown"),t.status?e("k-button",t._b({staticClass:"k-page-view-status",on:{click:function(e){return t.$dialog(t.id+"/changeStatus")}}},"k-button",t.statusBtn,!1)):t._e()],1),e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),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)}),[]).exports;const Ir=ct({extends:pr,emits:["submit"],computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-site-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-locked":t.isLocked,"data-id":"/","data-template":"site"}},[e("k-header",{staticClass:"k-site-view-header",attrs:{editable:t.permissions.changeTitle&&!t.isLocked},on:{edit:function(e){return t.$dialog("site/changeTitle")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-site-view-preview",attrs:{link:t.model.previewUrl,title:t.$t("open"),icon:"open",target:"_blank",variant:"filled",size:"sm"}}),e("k-languages-dropdown")],1),e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),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)}),[]).exports,Dr={install(t){t.component("k-page-view",Ar),t.component("k-site-view",Ir)}};const jr=ct({extends:pr,props:{canChangeEmail:Boolean,canChangeLanguage:Boolean,canChangeName:Boolean,canChangeRole:Boolean}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-user-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-id":t.model.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{staticClass:"k-user-view-header",attrs:{editable:t.canChangeName},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-user-view-options",attrs:{disabled:t.isLocked,dropdown:!0,title:t.$t("settings"),icon:"cog",size:"sm",variant:"filled"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{"align-x":"end",options:t.$dropdown(t.id)}}),e("k-languages-dropdown")],1),e("k-form-buttons",{attrs:{lock:t.lock}})]},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-user-profile",{attrs:{"can-change-email":t.canChangeEmail,"can-change-language":t.canChangeLanguage,"can-change-name":t.canChangeName,"can-change-role":t.canChangeRole,"is-locked":t.isLocked,model:t.model,permissions:t.permissions}}),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),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}})],1)}),[]).exports;const Er=ct({extends:jr,prevnext:!1},null,null).exports;const Lr=ct({data:()=>({isLoading:!1,values:{password:null,passwordConfirmation:null}}),computed:{fields(){return{password:{autofocus:!0,label:this.$t("user.changePassword.new"),icon:"key",type:"password",width:"1/2"},passwordConfirmation:{label:this.$t("user.changePassword.new.confirm"),icon:"key",type:"password",width:"1/2"}}}},mounted(){this.$panel.title=this.$t("view.resetPassword")},methods:{async submit(){if(!this.values.password||this.values.password.length<8)return this.$panel.notification.error(this.$t("error.user.password.invalid"));if(this.values.password!==this.values.passwordConfirmation)return this.$panel.notification.error(this.$t("error.user.password.notSame"));this.isLoading=!0;try{await this.$api.users.changePassword(this.$panel.user.id,this.values.password),this.$panel.notification.success(),this.$go("/")}catch(t){this.$panel.notification.error(t)}finally{this.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-password-reset-view"},[e("form",{on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[e("k-header",{scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button",{attrs:{icon:"check",theme:"notice",type:"submit",variant:"filled",size:"sm"}},[t._v(" "+t._s(t.$t("change"))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)]},proxy:!0}])},[t._v(" "+t._s(t.$t("view.resetPassword"))+" ")]),e("k-user-info",{attrs:{user:t.$panel.user}}),e("k-fieldset",{attrs:{fields:t.fields,value:t.values}})],1)])}),[]).exports;const Tr=ct({props:{isLocked:Boolean,model:Object},methods:{open(){this.model.avatar?this.$refs.dropdown.toggle():this.upload()},async remove(){await this.$api.users.deleteAvatar(this.model.id),this.$panel.notification.success(),this.$reload()},upload(){this.$panel.upload.pick({url:this.$panel.urls.api+"/"+this.model.link+"/avatar",accept:"image/*",immediate:!0,multiple:!1})}}},(function(){var t=this,e=t._self._c;return e("k-button",{staticClass:"k-user-view-image",attrs:{disabled:t.isLocked,title:t.$t("avatar")},on:{click:t.open}},[t.model.avatar?[e("k-image-frame",{attrs:{cover:!0,src:t.model.avatar}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:[{icon:"upload",text:t.$t("change"),click:t.upload},{icon:"trash",text:t.$t("delete"),click:t.remove}]}})]:e("k-icon-frame",{attrs:{icon:"user"}})],2)}),[]).exports;const Br=ct({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-frame",{attrs:{cover:!0,src:t.user.avatar.url,ratio:"1/1"}}):e("k-icon-frame",{attrs:{color:"white",back:"black",icon:"user"}}),t._v(" "+t._s(t.user.name??t.user.email??t.user)+" ")],1)}),[]).exports;const qr=ct({props:{canChangeEmail:Boolean,canChangeLanguage:Boolean,canChangeRole:Boolean,isLocked:Boolean,model:Object,permissions:Object}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-user-profile"},[e("k-user-avatar",{attrs:{disabled:t.isLocked,model:t.model}}),e("k-button-group",{attrs:{buttons:[{icon:"email",text:`${t.model.email}`,title:`${t.$t("email")}: ${t.model.email}`,disabled:!t.canChangeEmail,click:()=>t.$dialog(t.model.link+"/changeEmail")},{icon:"bolt",text:`${t.model.role}`,title:`${t.$t("role")}: ${t.model.role}`,disabled:!t.canChangeRole,click:()=>t.$dialog(t.model.link+"/changeRole")},{icon:"translate",text:`${t.model.language}`,title:`${t.$t("language")}: ${t.model.language}`,disabled:!t.canChangeLanguage,click:()=>t.$dialog(t.model.link+"/changeLanguage")}]}})],1)}),[]).exports;const Pr=ct({props:{canCreate:Boolean,role:Object,roles:Array,search:String,title:String,users:Object},computed:{empty(){return{icon:"users",text:this.$t("role.empty")}},items(){return this.users.data.map((t=>(t.options=this.$dropdown(t.link),t)))},tabs(){const t=[{name:"all",label:this.$t("role.all"),link:"/users"}];for(const e of this.roles)t.push({name:e.id,label:e.title,link:"/users?role="+e.id});return t}},methods:{create(){var t;this.$dialog("users/create",{query:{role:null==(t=this.role)?void 0:t.id}})},paginate(t){this.$reload({query:{page:t.page}})}}},(function(){var t,e=this,i=e._self._c;return i("k-panel-inside",{staticClass:"k-users-view"},[i("k-header",{staticClass:"k-users-view-header",scopedSlots:e._u([{key:"buttons",fn:function(){return[i("k-button",{attrs:{disabled:!e.canCreate,text:e.$t("user.create"),icon:"add",size:"sm",variant:"filled"},on:{click:e.create}})]},proxy:!0}])},[e._v(" "+e._s(e.$t("view.users"))+" ")]),i("k-tabs",{attrs:{tab:(null==(t=e.role)?void 0:t.id)??"all",tabs:e.tabs}}),i("k-collection",{attrs:{empty:e.empty,items:e.items,pagination:e.users.pagination},on:{paginate:e.paginate}})],1)}),[]).exports,Nr={install(t){t.component("k-account-view",Er),t.component("k-reset-password-view",Lr),t.component("k-user-avatar",Tr),t.component("k-user-info",Br),t.component("k-user-profile",qr),t.component("k-user-view",jr),t.component("k-users-view",Pr)}};const zr=ct({components:{Plugins:ct({props:{plugins:Array}},(function(){var t=this,e=t._self._c;return t.plugins.length?e("k-section",{attrs:{headline:t.$t("plugins"),link:"https://getkirby.com/plugins"}},[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"),type:"update-status",mobile:!0,width:"10rem"}},rows:t.plugins}})],1):t._e()}),[]).exports,Security:ct({props:{exceptions:Array,security:Array,urls:Object},data(){return{issues:structuredClone(this.security)}},async mounted(){console.info("Running system health checks for the Panel system view; failed requests in the following console output are expected behavior.");const t=(Promise.allSettled??Promise.all).bind(Promise),e=Object.entries(this.urls).map(this.check);await t([...e,this.testPatchRequests()]),console.info(`System health checks ended. ${this.issues.length-this.security.length} issues with accessible files/folders found (see the security list in the system view).`)},methods:{async check([t,e]){if(!e)return;const{status:i}=await fetch(e,{cache:"no-store"});i<400&&this.issues.push({id:t,text:this.$t("system.issues."+t),link:"https://getkirby.com/security/"+t,icon:"folder"})},retry(){this.$go(window.location.href)},async testPatchRequests(){const{status:t}=await this.$api.patch("system/method-test");"ok"!==t&&this.issues.push({id:"method-overwrite-text",text:this.$t("system.issues.api.methods"),link:"https://getkirby.com/docs/reference/system/options/api#methods-overwrite",icon:"protected"})}}},(function(){var t=this,e=t._self._c;return t.issues.length?e("k-section",{attrs:{headline:t.$t("security"),buttons:[{title:t.$t("retry"),icon:"refresh",click:t.retry}]}},[e("k-items",{attrs:{items:t.issues.map((t=>({image:{back:"var(--color-red-200)",icon:t.icon??"alert",color:"var(--color-red)"},target:"_blank",...t})))}})],1):t._e()}),[]).exports},props:{environment:Array,exceptions:Array,info:Object,plugins:Array,security:Array,urls:Object},mounted(){this.exceptions.length>0&&(console.info("The following errors occurred during the update check of Kirby and/or plugins:"),this.exceptions.map((t=>console.warn(t))),console.info("End of errors from the update check."))},methods:{copy(){const t=JSON.stringify({info:this.info,security:this.security.map((t=>t.text)),plugins:this.plugins.map((t=>({name:t.name.text,version:t.version.currentVersion})))},null,2);this.$helper.clipboard.write(t),this.$panel.notification.success({message:this.$t("system.info.copied")})}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-system-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.system"))+" ")]),e("k-section",{attrs:{headline:t.$t("environment"),buttons:[{text:t.$t("system.info.copy"),icon:"copy",responsive:!0,click:t.copy}]}},[e("k-stats",{staticClass:"k-system-info",attrs:{reports:t.environment,size:"medium"}})],1),e("security",{attrs:{security:t.security,urls:t.urls}}),e("plugins",{attrs:{plugins:t.plugins}})],1)}),[]).exports;const Fr=ct({props:{value:[String,Object]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-table-update-status-cell"},["string"==typeof t.value?e("span",{staticClass:"k-table-update-status-cell-version"},[t._v(" "+t._s(t.value)+" ")]):[e("k-button",{staticClass:"k-table-update-status-cell-button",attrs:{dropdown:!0,icon:t.value.icon,href:t.value.url,text:t.value.currentVersion,theme:t.value.theme,size:"xs",variant:"filled"},on:{click:function(e){return e.stopPropagation(),t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{"align-x":"end"}},[e("dl",{staticClass:"k-plugin-info"},[e("dt",[t._v(t._s(t.$t("plugin")))]),e("dd",[t._v(t._s(t.value.pluginName))]),e("dt",[t._v(t._s(t.$t("version.current")))]),e("dd",[t._v(t._s(t.value.currentVersion))]),e("dt",[t._v(t._s(t.$t("version.latest")))]),e("dd",[t._v(t._s(t.value.latestVersion))]),e("dt",[t._v(t._s(t.$t("system.updateStatus")))]),e("dd",{attrs:{"data-theme":t.value.theme}},[t._v(t._s(t.value.label))])]),t.value.url?[e("hr"),e("k-button",{attrs:{icon:"open",link:t.value.url}},[t._v(" "+t._s(t.$t("versionInformation"))+" ")])]:t._e()],2)]],2)}),[]).exports,Yr={install(t){t.component("k-system-view",zr),t.component("k-table-update-status-cell",Fr)}};const Rr=ct({props:{id:String},mounted(){window.panel.deprecated(" will be removed in a future version.")}},(function(){var t=this._self._c;return t("k-panel-inside",[t("k-"+this.id+"-plugin-view",{tag:"component"})],1)}),[]).exports,Ur={install(t){t.component("k-error-view",ur),t.component("k-search-view",dr),t.use(gr),t.use(br),t.use($r),t.use(Mr),t.use(Dr),t.use(Yr),t.use(Nr),t.component("k-plugin-view",Rr)}},Hr={install(t){t.use(kt),t.use(ne),t.use(xe),t.use(Be),t.use(Eo),t.use(qo),t.use(aa),t.use(ka),t.use(Ba),t.use(Va),t.use(Xa),t.use(ir),t.use(cr),t.use(Ur),t.use(L)}},Vr={install(t){window.onunhandledrejection=t=>{t.preventDefault(),window.panel.error(t.reason)},t.config.errorHandler=window.panel.error.bind(window.panel)}},Kr=(t={})=>{var e=t.desc?-1:1,i=-e,s=/^0/,n=/\s+/g,o=/^\s+|\s+$/g,a=/[^\x00-\x80]/,r=/^0x[0-9a-f]+$/i,l=/(0x[\da-fA-F]+|(^[\+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|\d+)/g,c=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,u=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(s)||1===e)&&parseFloat(t)||t.replace(n," ").replace(o,"")||0}return function(t,s){var n=u(t),o=u(s);if(!n&&!o)return 0;if(!n&&o)return i;if(n&&!o)return e;var l=d(n),h=d(o),m=parseInt(n.match(r),16)||1!==l.length&&Date.parse(n),f=parseInt(o.match(r),16)||m&&o.match(c)&&Date.parse(o)||null;if(f){if(mf)return e}for(var g=l.length,k=h.length,b=0,v=Math.max(g,k);b0)return e;if(w<0)return i;if(b===v-1)return 0}else{if(y<$)return i;if(y>$)return e}}return 0}};function Wr(t){return Array.isArray(t)?t:Object.values(t??{})}RegExp.escape=function(t){return t.replace(new RegExp("[-/\\\\^$*+?.()[\\]{}]","gu"),"\\$&")};function Jr(t,e){return t.reduce(((t,i)=>(i===e?t.push([]):t[t.length-1].push(i),t)),[[]])}function Gr(t){return Array.isArray(t)?t:[t]}Array.fromObject=Wr,Object.defineProperty(Array.prototype,"sortBy",{value:function(t){return t(this,t)},enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(Array.prototype,"split",{value:function(t){return Jr(this,t)},enumerable:!1,writable:!0,configurable:!0}),Array.wrap=Gr;const Xr={fromObject:Wr,search:(t,e,i={})=>{if((e??"").length<=(i.min??0))return t;const s=new RegExp(RegExp.escape(e),"ig"),n=i.field??"text",o=t.filter((t=>!!t[n]&&null!==t[n].match(s)));return i.limit?o.slice(0,i.limit):o},sortBy:function(t,e){const i=e.split(" "),s=i[0],n=i[1]??"asc",o=Kr({desc:"desc"===n,insensitive:!0});return t.sort(((t,e)=>{const i=String(t[s]??""),n=String(e[s]??"");return o(i,n)}))},split:Jr,wrap:Gr};const Zr={read:function(t,e=!1){if(!t)return null;if("string"==typeof t)return t;if(t instanceof ClipboardEvent){if(t.preventDefault(),!0===e)return t.clipboardData.getData("text/plain");const i=t.clipboardData.getData("text/html")||t.clipboardData.getData("text/plain")||null;if(i)return i.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 i=document.createElement("textarea");if(i.value=t,document.body.append(i),navigator.userAgent.match(/ipad|ipod|iphone/i)){i.contentEditable=!0,i.readOnly=!0;const t=document.createRange();t.selectNodeContents(i);const e=window.getSelection();e.removeAllRanges(),e.addRange(t),i.setSelectionRange(0,999999)}else i.select();return document.execCommand("copy"),i.remove(),!0}};function Qr(t){if("string"==typeof t){if("pattern"===(t=t.toLowerCase()))return"var(--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}}function tl(t,e=!1){if(!t.match("youtu"))return!1;let i=null;try{i=new URL(t)}catch{return!1}const s=i.pathname.split("/").filter((t=>""!==t)),n=s[0],o=s[1],a="https://"+(!0===e?"www.youtube-nocookie.com":i.host)+"/embed",r=t=>!!t&&null!==t.match(/^[a-zA-Z0-9_-]+$/);let l=i.searchParams,c=null;switch(s.join("/")){case"embed/videoseries":case"playlist":r(l.get("list"))&&(c=a+"/videoseries");break;case"watch":r(l.get("v"))&&(c=a+"/"+l.get("v"),l.has("t")&&l.set("start",l.get("t")),l.delete("v"),l.delete("t"));break;default:i.host.includes("youtu.be")&&r(n)?(c=!0===e?"https://www.youtube-nocookie.com/embed/"+n:"https://www.youtube.com/embed/"+n,l.has("t")&&l.set("start",l.get("t")),l.delete("t")):["embed","shorts"].includes(n)&&r(o)&&(c=a+"/"+o)}if(!c)return!1;const u=l.toString();return u.length&&(c+="?"+u),c}function el(t,e=!1){let i=null;try{i=new URL(t)}catch{return!1}const s=i.pathname.split("/").filter((t=>""!==t));let n=i.searchParams,o=null;switch(!0===e&&n.append("dnt",1),i.host){case"vimeo.com":case"www.vimeo.com":o=s[0];break;case"player.vimeo.com":o=s[1]}if(!o||!o.match(/^[0-9]*$/))return!1;let a="https://player.vimeo.com/video/"+o;const r=n.toString();return r.length&&(a+="?"+r),a}const il={youtube:tl,vimeo:el,video:function(t,e=!1){return!0===t.includes("youtu")?tl(t,e):!0===t.includes("vimeo")&&el(t,e)}};function sl(t){var e;if(void 0!==t.default)return structuredClone(t.default);const i=window.panel.app.$options.components[`k-${t.type}-field`],s=null==(e=null==i?void 0:i.options.props)?void 0:e.value;if(void 0===s)return;const n=null==s?void 0:s.default;return"function"==typeof n?n():void 0!==n?n:null}const nl={defaultValue:sl,form:function(t){const e={};for(const i in t){const s=sl(t[i]);void 0!==s&&(e[i]=s)}return e},isVisible:function(t,e){if("hidden"===t.type||!0===t.hidden)return!1;if(!t.when)return!0;for(const i in t.when){const s=e[i.toLowerCase()],n=t.when[i];if((void 0!==s||!(""===n||Array.isArray(n)&&0===n.length))&&s!==n)return!1}return!0},subfields:function(t,e){let i={};for(const s in e){const n=e[s];n.section=t.name,t.endpoints&&(n.endpoints={field:t.endpoints.field+"+"+s,section:t.endpoints.section,model:t.endpoints.model}),i[s]=n}return i}},ol=t=>t.split(".").slice(-1).join(""),al=t=>t.split(".").slice(0,-1).join("."),rl=t=>Intl.NumberFormat("en",{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow"}).format(t),ll={extension:ol,name:al,niceSize:rl};function cl(t,e){if("string"==typeof t&&(t=document.querySelector(t)),!t)return!1;if(!e&&t.contains(document.activeElement)&&t!==document.activeElement)return!1;const i=[":where([autofocus], [data-autofocus])",":where(input, textarea, select, [contenteditable=true], .input-focus)","[type=submit]","button"];e&&i.unshift(`[name="${e}"]`);const s=function(t,e){for(const i of e){const e=t.querySelector(i);if(!0===ul(e))return e}return null}(t,i);return s?(s.focus(),s):!0===ul(t)&&(t.focus(),t)}function ul(t){return!!t&&(!t.matches("[disabled], [aria-disabled], input[type=hidden]")&&(!t.closest("[aria-disabled]")&&!t.closest("[disabled]")&&"function"==typeof t.focus))}const dl=t=>"function"==typeof window.Vue.options.components[t],pl=t=>!!t.dataTransfer&&(!!t.dataTransfer.types&&(!0===t.dataTransfer.types.includes("Files")&&!1===t.dataTransfer.types.includes("text/plain")));const hl={metaKey:function(){return window.navigator.userAgent.indexOf("Mac")>-1?"cmd":"ctrl"}};function ml(t){return!0===t.startsWith("file://")||!0===t.startsWith("/@/file/")}function fl(t){return"site://"===t||!0===t.startsWith("page://")||null!==t.match(/^\/(.*\/)?@\/page\//)}function gl(t=[]){const e={url:{detect:t=>/^(http|https):\/\//.test(t),icon:"url",id:"url",label:window.panel.$t("url"),link:t=>t,placeholder:window.panel.$t("url.placeholder"),input:"url",value:t=>t},page:{detect:t=>!0===fl(t),icon:"page",id:"page",label:window.panel.$t("page"),link:t=>t,placeholder:window.panel.$t("select")+" …",input:"text",value:t=>t},file:{detect:t=>!0===ml(t),icon:"file",id:"file",label:window.panel.$t("file"),link:t=>t,placeholder:window.panel.$t("select")+" …",value:t=>t},email:{detect:t=>t.startsWith("mailto:"),icon:"email",id:"email",label:window.panel.$t("email"),link:t=>t.replace(/^mailto:/,""),placeholder:window.panel.$t("email.placeholder"),input:"email",value:t=>"mailto:"+t},tel:{detect:t=>t.startsWith("tel:"),icon:"phone",id:"tel",label:window.panel.$t("tel"),link:t=>t.replace(/^tel:/,""),pattern:"[+]{0,1}[0-9]+",placeholder:window.panel.$t("tel.placeholder"),input:"tel",value:t=>"tel:"+t},anchor:{detect:t=>t.startsWith("#"),icon:"anchor",id:"anchor",label:"Anchor",link:t=>t,pattern:"^#.+",placeholder:"#element",input:"text",value:t=>t},custom:{detect:()=>!0,icon:"title",id:"custom",label:window.panel.$t("custom"),link:t=>t,input:"text",value:t=>t}};if(!t.length)return e;const i={};for(const s of t)i[s]=e[s];return i}const kl={detect:function(t,e){if(t=t??"",e=e??gl(),0===t.length)return{type:Object.keys(e)[0]??"url",link:""};for(const i in e)if(!0===e[i].detect(t))return{type:i,link:e[i].link(t)}},getFileUUID:function(t){return t.replace("/@/file/","file://")},getPageUUID:function(t){return t.replace(/^\/(.*\/)?@\/page\//,"page://")},isFileUUID:ml,isPageUUID:fl,preview:async function({type:t,link:e},i){return"page"===t&&e?await async function(t,e=["title","panelImage"]){if("site://"===t)return{label:window.panel.$t("view.site")};try{const i=await window.panel.api.pages.get(t,{select:e.join(",")});return{label:i.title,image:i.panelImage}}catch{return null}}(e,i):"file"===t&&e?await async function(t,e=["filename","panelImage"]){try{const i=await window.panel.api.files.get(null,t,{select:e.join(",")});return{label:i.filename,image:i.panelImage}}catch{return null}}(e,i):e?{label:e}:null},types:gl};const bl={status:function(t,e=!1){const i={class:"k-status-icon",icon:"status-"+t,title:window.panel.$t("page.status")+": "+window.panel.$t("page.status."+t),disabled:e,size:"xs",style:"--icon-size: 15px"};return e&&(i.title+=` (${window.panel.$t("disabled")})`),i.theme="draft"===t?"negative-icon":"unlisted"===t?"info-icon":"positive-icon",i}},vl=(t="3/2",e="100%",i=!0)=>{const s=String(t).split("/");if(2!==s.length)return e;const n=Number(s[0]),o=Number(s[1]);let a=100;return 0!==n&&0!==o&&(a=i?a/n*o:a/o*n,a=parseFloat(String(a)).toFixed(2)),a+"%"},yl={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function $l(t){return String(t).replace(/[&<>"'`=/]/g,(t=>yl[t]))}function wl(t){return!t||0===String(t).length}function xl(t){const e=String(t);return e.charAt(0).toLowerCase()+e.slice(1)}function _l(t="",e=""){const i=new RegExp(`^(${RegExp.escape(e)})+`,"g");return t.replace(i,"")}function Cl(t="",e=""){const i=new RegExp(`(${RegExp.escape(e)})+$`,"g");return t.replace(i,"")}function Sl(t,e={}){const i=(t,e={})=>{const s=e[$l(t.shift())]??"…";return"…"===s||0===t.length?s:i(t,s)},s="[{]{1,2}[\\s]?",n="[\\s]?[}]{1,2}";return(t=t.replace(new RegExp(`${s}(.*?)${n}`,"gi"),((t,s)=>i(s.split("."),e)))).replace(new RegExp(`${s}.*${n}`,"gi"),"…")}function Ol(t){const e=String(t);return e.charAt(0).toUpperCase()+e.slice(1)}function Ml(){let t,e,i="";for(t=0;t<32;t++)e=16*Math.random()|0,8!=t&&12!=t&&16!=t&&20!=t||(i+="-"),i+=(12==t?4:16==t?3&e|8:e).toString(16);return i}const Al={camelToKebab:function(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()},escapeHTML:$l,hasEmoji:function(t){if("string"!=typeof t)return!1;if(!0===/^[a-z0-9_-]+$/.test(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},isEmpty:wl,lcfirst:xl,ltrim:_l,pad:function(t,e=2){t=String(t);let i="";for(;i.length]+)>)/gi,"")},template:Sl,ucfirst:Ol,ucwords:function(t){return String(t).split(/ /g).map((t=>Ol(t))).join(" ")},unescapeHTML:function(t){for(const e in yl)t=String(t).replaceAll(yl[e],e);return t},uuid:Ml},Il=async(t,e)=>new Promise(((i,s)=>{const n={url:"/",field:"file",method:"POST",filename:t.name,headers:{},attributes:{},complete:()=>{},error:()=>{},success:()=>{},progress:()=>{}},o=Object.assign(n,e),a=new XMLHttpRequest,r=new FormData;r.append(o.field,t,o.filename);for(const t in o.attributes){const e=o.attributes[t];null!=e&&r.append(t,e)}const l=e=>{if(e.lengthComputable&&o.progress){const i=Math.max(0,Math.min(100,Math.ceil(e.loaded/e.total*100)));o.progress(a,t,i)}};a.upload.addEventListener("loadstart",l),a.upload.addEventListener("progress",l),a.addEventListener("load",(e=>{let n=null;try{n=JSON.parse(e.target.response)}catch{n={status:"error",message:"The file could not be uploaded"}}"error"===n.status?(o.error(a,t,n),s(n)):(o.progress(a,t,100),o.success(a,t,n),i(n))})),a.addEventListener("error",(e=>{const i=JSON.parse(e.target.response);o.progress(a,t,100),o.error(a,t,i),s(i)})),a.open(o.method,o.url,!0);for(const t in o.headers)a.setRequestHeader(t,o.headers[t]);a.send(r)}));function Dl(){var t;return new URL((null==(t=document.querySelector("base"))?void 0:t.href)??window.location.origin)}function jl(t={},e={}){e instanceof URL&&(e=e.search);const i=new URLSearchParams(e);for(const[s,n]of Object.entries(t))null!==n&&i.set(s,n);return i}function El(t="",e={},i){return(t=Pl(t,i)).search=jl(e,t.search),t}function Ll(t){return null!==String(t).match(/^https?:\/\//)}function Tl(t){return Pl(t).origin===window.location.origin}function Bl(t,e){if((t instanceof URL||t instanceof Location)&&(t=t.toString()),"string"!=typeof t)return!1;try{new URL(t,window.location)}catch{return!1}if(!0===e){return/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!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]))|(?:localhost)|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/i.test(t)}return!0}function ql(t,e){return!0===Ll(t)?t:(e=e??Dl(),(e=String(e).replaceAll(/\/$/g,""))+"/"+(t=String(t).replaceAll(/^\//g,"")))}function Pl(t,e){return t instanceof URL?t:new URL(ql(t,e))}const Nl={base:Dl,buildQuery:jl,buildUrl:El,isAbsolute:Ll,isSameOrigin:Tl,isUrl:Bl,makeAbsolute:ql,toObject:Pl},zl={install(t){t.prototype.$helper={array:Xr,clipboard:Zr,clone:wt.clone,color:Qr,embed:il,focus:cl,isComponent:dl,isUploadEvent:pl,debounce:Nt,field:nl,file:ll,keyboard:hl,link:kl,object:wt,page:bl,pad:Al.pad,ratio:vl,slug:Al.slug,sort:Kr,string:Al,upload:Il,url:Nl,uuid:Al.uuid},t.prototype.$esc=Al.escapeHTML}},Fl={install(t){const e=(t,e,i)=>{!0!==i.context.disabled?t.dir=window.panel.language.direction:t.dir=null};t.directive("direction",{bind:e,update:e})}},Yl={install(t){window.panel.redirect=window.panel.redirect.bind(window.panel),window.panel.reload=window.panel.reload.bind(window.panel),window.panel.request=window.panel.request.bind(window.panel),window.panel.search=window.panel.search.bind(window.panel);const e=["api","config","direction","events","language","languages","license","menu","multilang","permissions","search","searches","system","t","translation","url","urls","user","view"];for(const i of e){const e=`$${i}`;t.prototype[e]=window.panel[e]=window.panel[i]}window.panel.$vue=window.panel.app}},Rl=/^#?([\da-f]{3}){1,2}$/i,Ul=/^#?([\da-f]{4}){1,2}$/i,Hl=/^rgba?\(\s*(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?$/i,Vl=/^hsla?\(\s*(\d{1,3}\.?\d*)(deg|rad|grad|turn)?(?:,|\s)+(\d{1,3})%(?:,|\s)+(\d{1,3})%(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?$/i;function Kl(t){return"string"==typeof t&&(Rl.test(t)||Ul.test(t))}function Wl(t){return vt(t)&&"r"in t&&"g"in t&&"b"in t}function Jl(t){return vt(t)&&"h"in t&&"s"in t&&"l"in t}function Gl({h:t,s:e,v:i,a:s}){if(0===i)return{h:t,s:0,l:0,a:s};if(0===e&&1===i)return{h:t,s:1,l:1,a:s};const n=i*(2-e)/2;return{h:t,s:e=i*e/(1-Math.abs(2*n-1)),l:n,a:s}}function Xl({h:t,s:e,l:i,a:s}){const n=e*(i<.5?i:1-i);return{h:t,s:e=0===n?0:2*n/(i+n),v:i+n,a:s}}function Zl(t){if(!0===Rl.test(t)||!0===Ul.test(t)){"#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.split("").reduce(((t,e)=>t+e+e),""));const e=parseInt(t,16);return!0===Rl.test(t)?{r:e>>16,g:e>>8&255,b:255&e,a:1}:{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:Math.round((255&e)/255*100)/100}}throw new Error(`unknown hex color: ${t}`)}function Ql({r:t,g:e,b:i,a:s=1}){let n="#"+(1<<24|t<<16|e<<8|i).toString(16).slice(1);return s<1&&(n+=(256|Math.round(255*s)).toString(16).slice(1)),n}function tc({h:t,s:e,l:i,a:s}){const n=e*Math.min(i,1-i),o=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return{r:255*o(0),g:255*o(8),b:255*o(4),a:s}}function ec({r:t,g:e,b:i,a:s}){t/=255,e/=255,i/=255;const n=Math.max(t,e,i),o=n-Math.min(t,e,i),a=1-Math.abs(n+n-o-1);let r=o&&(n==t?(e-i)/o:n==e?2+(i-t)/o:4+(t-e)/o);return r=60*(r<0?r+6:r),{h:r,s:a?o/a:0,l:(n+n-o)/2,a:s}}function ic(t){return Ql(tc(t))}function sc(t){return ec(Zl(t))}function nc(t,e){return t=Number(t),"grad"===e?t*=.9:"rad"===e?t*=180/Math.PI:"turn"===e&&(t*=360),parseInt(t%360)}function oc(t,e){if(!0===Kl(t))switch("#"!==t[0]&&(t="#"+t),e){case"hex":return t;case"rgb":return Zl(t);case"hsl":return sc(t);case"hsv":return Xl(sc(t))}if(!0===Wl(t))switch(e){case"hex":return Ql(t);case"rgb":return t;case"hsl":return ec(t);case"hsv":return function({r:t,g:e,b:i,a:s}){t/=255,e/=255,i/=255;const n=Math.max(t,e,i),o=n-Math.min(t,e,i);let a=o&&(n==t?(e-i)/o:n==e?2+(i-t)/o:4+(t-e)/o);return a=60*(a<0?a+6:a),{h:a,s:n&&o/n,v:n,a:s}}(t)}if(!0===Jl(t))switch(e){case"hex":return ic(t);case"rgb":return tc(t);case"hsl":return t;case"hsv":return Xl(t)}if(!0===function(t){return vt(t)&&"h"in t&&"s"in t&&"v"in t}(t))switch(e){case"hex":return ic(Gl(t));case"rgb":return function({h:t,s:e,v:i,a:s}){const n=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return{r:255*n(5),g:255*n(3),b:255*n(1),a:s}}(t);case"hsl":return Gl(t);case"hsv":return t}throw new Error(`Invalid color conversion: ${JSON.stringify(t)} -> ${e}`)}function ac(t){let e;if(!t||"string"!=typeof t)return!1;if(!0===Kl(t))return"#"!==t[0]&&(t="#"+t),t;if(e=t.match(Hl)){const t={r:Number(e[1]),g:Number(e[3]),b:Number(e[5]),a:Number(e[7]||1)};return"%"===e[2]&&(t.r=Math.ceil(2.55*t.r)),"%"===e[4]&&(t.g=Math.ceil(2.55*t.g)),"%"===e[6]&&(t.b=Math.ceil(2.55*t.b)),"%"===e[8]&&(t.a=t.a/100),t}if(e=t.match(Vl)){let[t,i,s,n,o]=e.slice(1);const a={h:nc(t,i),s:Number(s)/100,l:Number(n)/100,a:Number(o||1)};return"%"===e[6]&&(a.a=a.a/100),a}return null}const rc={convert:oc,parse:ac,parseAs:function(t,e){const i=ac(t);return i&&e?oc(i,e):i},toString:function(t,e,i=!0){var s,n;let o=t;if("string"==typeof o&&(o=ac(t)),o&&e&&(o=oc(o,e)),!0===Kl(o))return!0!==i&&(5===o.length?o=o.slice(0,4):o.length>7&&(o=o.slice(0,7))),o.toLowerCase();if(!0===Wl(o)){const t=o.r.toFixed(),e=o.g.toFixed(),n=o.b.toFixed(),a=null==(s=o.a)?void 0:s.toFixed(2);return i&&a&&a<1?`rgb(${t} ${e} ${n} / ${a})`:`rgb(${t} ${e} ${n})`}if(!0===Jl(o)){const t=o.h.toFixed(),e=(100*o.s).toFixed(),s=(100*o.l).toFixed(),a=null==(n=o.a)?void 0:n.toFixed(2);return i&&a&&a<1?`hsl(${t} ${e}% ${s}% / ${a})`:`hsl(${t} ${e}% ${s}%)`}throw new Error(`Unsupported color: ${JSON.stringify(t)}`)}};T.extend(B),T.extend(((t,e,i)=>{i.interpret=(t,e="date")=>{const s={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 YYYY":!0,"MMM DD":!1,"MMM D":!1,"MM YYYY":!0,"M YYYY":!0,"MMMM DD YYYY":!0,"MMMM D YYYY":!0,"MMMM DD YY":!0,"MMMM D YY":!0,"MMMM DD, YYYY":!0,"MMMM D, YYYY":!0,"MMMM DD, YY":!0,"MMMM D, YY":!0,"MMMM DD. YYYY":!0,"MMMM D. YYYY":!0,"MMMM DD. YY":!0,"MMMM D. YY":!0,DDMMYYYY:!0,DDMMYY:!0,"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:{"HHmmss a":!1,"HHmm a":!1,"HH a":!1,HHmmss:!1,HHmm:!1,"HH:mm:ss a":!1,"HH:mm:ss":!1,"HH:mm a":!1,"HH:mm":!1,HH:!1}};if("string"==typeof t&&""!==t)for(const n in s[e]){const o=i(t,n,s[e][n]);if(!0===o.isValid())return o}return null}})),T.extend(((t,e,i)=>{const s=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(s(t))},i.iso=function(t,e){e&&(e=s(e)),e??(e=[s("datetime"),s("date"),s("time")]);const n=i(t,e);return n&&n.isValid()?n:null}})),T.extend(((t,e)=>{e.prototype.merge=function(t,e="date"){let i=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.hasOwn(t,e))throw new Error("Invalid merge unit alias");e=t[e]}for(const s of e)i=i.set(s,t.get(s));return i}})),T.extend(((t,e,i)=>{i.pattern=t=>new class{constructor(t,e){this.dayjs=t,this.pattern=e;const i={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 s=this.pattern.indexOf(t);return{index:e,unit:Object.keys(i)[Object.values(i).findIndex((e=>e.includes(t)))],start:s,end:s+(t.length-1)}}))}at(t,e=t){const i=this.parts.filter((i=>i.start<=t&&i.end>=e-1));return i[0]?i[0]:this.parts.filter((e=>e.start<=t)).pop()}format(t){return t&&t.isValid()?t.format(this.pattern):null}}(i,t)})),T.extend(((t,e)=>{e.prototype.round=function(t="date",e=1){const i=["second","minute","hour","date","month","year"];if("day"===t&&(t="date"),!1===i.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 s=this.clone();const n=i.indexOf(t),o=i.slice(0,n),a=o.pop();for(const r of o)s=s.startOf(r);if(a){const e={month:12,date:s.daysInMonth(),hour:24,minute:60,second:60}[a];Math.round(s.get(a)/e)*e===e&&(s=s.add(1,"date"===t?"day":t)),s=s.startOf(t)}return s=s.set(t,Math.round(s.get(t)/e)*e),s}})),T.extend(((t,e,i)=>{e.prototype.validate=function(t,e,s="day"){if(!this.isValid())return!1;if(!t)return!0;t=i.iso(t);const n={min:"isAfter",max:"isBefore"}[e];return this.isSame(t,s)||this[n](t,s)}}));const lc={install(t){t.prototype.$library={autosize:q,colors:rc,dayjs:T}}},cc=()=>({close(){sessionStorage.setItem("kirby$activation$card","true"),this.isOpen=!1},isOpen:"true"!==sessionStorage.getItem("kirby$activation$card"),open(){sessionStorage.removeItem("kirby$activation$card"),this.isOpen=!0}}),uc=t=>({async changeName(e,i,s){return t.patch(this.url(e,i,"name"),{name:s})},async delete(e,i){return t.delete(this.url(e,i))},async get(e,i,s){let n=await t.get(this.url(e,i),s);return!0===Array.isArray(n.content)&&(n.content={}),n},id:t=>!0===t.startsWith("/@/file/")?t.replace("/@/file/","@"):!0===t.startsWith("file://")?t.replace("file://","@"):t,link(t,e,i){return"/"+this.url(t,e,i)},async update(e,i,s){return t.patch(this.url(e,i),s)},url(t,e,i){let s="files/"+this.id(e);return t&&(s=t+"/"+s),i&&(s+="/"+i),s}}),dc=t=>({async blueprint(e){return t.get("pages/"+this.id(e)+"/blueprint")},async blueprints(e,i){return t.get("pages/"+this.id(e)+"/blueprints",{section:i})},async changeSlug(e,i){return t.patch("pages/"+this.id(e)+"/slug",{slug:i})},async changeStatus(e,i,s){return t.patch("pages/"+this.id(e)+"/status",{status:i,position:s})},async changeTemplate(e,i){return t.patch("pages/"+this.id(e)+"/template",{template:i})},async changeTitle(e,i){return t.patch("pages/"+this.id(e)+"/title",{title:i})},async children(e,i){return t.post("pages/"+this.id(e)+"/children/search",i)},async create(e,i){return null===e||"/"===e?t.post("site/children",i):t.post("pages/"+this.id(e)+"/children",i)},async delete(e,i){return t.delete("pages/"+this.id(e),i)},async duplicate(e,i,s){return t.post("pages/"+this.id(e)+"/duplicate",{slug:i,children:s.children??!1,files:s.files??!1})},async get(e,i){let s=await t.get("pages/"+this.id(e),i);return!0===Array.isArray(s.content)&&(s.content={}),s},id:t=>!0===t.match(/^\/(.*\/)?@\/page\//)?t.replace(/^\/(.*\/)?@\/page\//,"@"):!0===t.startsWith("page://")?t.replace("page://","@"):t.replace(/\//g,"+"),async files(e,i){return t.post("pages/"+this.id(e)+"/files/search",i)},link(t){return"/"+this.url(t)},async preview(t){return(await this.get(this.id(t),{select:"previewUrl"})).previewUrl},async search(e,i){return e?t.post("pages/"+this.id(e)+"/children/search?select=id,title,hasChildren",i):t.post("site/children/search?select=id,title,hasChildren",i)},async update(e,i){return t.patch("pages/"+this.id(e),i)},url(t,e){let i=null===t?"pages":"pages/"+String(t).replace(/\//g,"+");return e&&(i+="/"+e),i}});class pc extends Error{constructor(t,{request:e,response:i,cause:s}){super(i.json.message??t,{cause:s}),this.request=e,this.response=i}state(){return this.response.json}}class hc extends pc{}class mc extends pc{state(){return{message:this.message,text:this.response.text}}}const fc=t=>(window.location.href=ql(t),!1),gc=async(t,e={})=>{var i;(e={cache:"no-store",credentials:"same-origin",mode:"same-origin",...e}).body=((i=e.body)instanceof HTMLFormElement&&(i=new FormData(i)),i instanceof FormData&&(i=Object.fromEntries(i)),"object"==typeof i?JSON.stringify(i):i),e.headers=((t={},e={})=>{return{"content-type":"application/json","x-csrf":e.csrf??!1,"x-fiber":!0,"x-fiber-globals":(i=e.globals,!!i&&(!1===Array.isArray(i)?String(i):i.join(","))),"x-fiber-referrer":e.referrer??!1,...$t(t)};var i})(e.headers,e),e.url=El(t,e.query);const s=new Request(e.url,e);return!1===Tl(s.url)?fc(s.url):await kc(s,await fetch(s))},kc=async(t,e)=>{var i;if(!1===e.headers.get("Content-Type").includes("application/json"))return fc(e.url);try{e.text=await e.text(),e.json=JSON.parse(e.text)}catch(s){throw new mc("Invalid JSON response",{cause:s,request:t,response:e})}if(401===e.status)throw new hc("Unauthenticated",{request:t,response:e});if("error"===(null==(i=e.json)?void 0:i.status))throw e.json;if(!1===e.ok)throw new pc(`The request to ${e.url} failed`,{request:t,response:e});return{request:t,response:e}},bc=t=>({blueprint:async e=>t.get("users/"+e+"/blueprint"),blueprints:async(e,i)=>t.get("users/"+e+"/blueprints",{section:i}),changeEmail:async(e,i)=>t.patch("users/"+e+"/email",{email:i}),changeLanguage:async(e,i)=>t.patch("users/"+e+"/language",{language:i}),changeName:async(e,i)=>t.patch("users/"+e+"/name",{name:i}),changePassword:async(e,i)=>t.patch("users/"+e+"/password",{password:i}),changeRole:async(e,i)=>t.patch("users/"+e+"/role",{role:i}),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,i)=>t.get("users/"+e,i),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,i)=>t.patch("users/"+e,i),url(t,e){let i=t?"users/"+t:"users";return e&&(i+="/"+e),i}}),vc=t=>{var e;const i={csrf:t.system.csrf,endpoint:Cl(t.urls.api,"/"),methodOverwrite:(null==(e=t.config.api)?void 0:e.methodOverwrite)??!1,ping:null,requests:[],running:0},s=()=>{clearInterval(i.ping),i.ping=setInterval(i.auth.ping,3e5)};return i.request=async(e,n={},o=!1)=>{const a=e+"/"+JSON.stringify(n);i.requests.push(a),!1===o&&(t.isLoading=!0),i.language=t.language.code;try{return await(t=>async(e,i={})=>{i={cache:"no-store",credentials:"same-origin",mode:"same-origin",headers:{"content-type":"application/json","x-csrf":t.csrf,"x-language":t.language,...$t(i.headers??{})},...i},t.methodOverwrite&&"GET"!==i.method&&"POST"!==i.method&&(i.headers["x-http-method-override"]=i.method,i.method="POST"),i.url=Cl(t.endpoint,"/")+"/"+_l(e,"/");const s=new Request(i.url,i),{response:n}=await kc(s,await fetch(s));let o=n.json;return o.data&&"model"===o.type&&(o=o.data),o})(i)(e,n)}finally{s(),i.requests=i.requests.filter((t=>t!==a)),0===i.requests.length&&(t.isLoading=!1)}},i.auth=(t=>({async login(e){const i={long:e.remember??!1,email:e.email,password:e.password};return t.post("auth/login",i)},logout:async()=>t.post("auth/logout"),ping:async()=>t.post("auth/ping"),user:async e=>t.get("auth",e),verifyCode:async e=>t.post("auth/code",{code:e})}))(i),i.delete=(t=>async(e,i,s,n=!1)=>t.post(e,i,s,"DELETE",n))(i),i.files=uc(i),i.get=(t=>async(e,i,s,n=!1)=>(i&&(e+="?"+Object.keys(i).filter((t=>void 0!==i[t]&&null!==i[t])).map((t=>t+"="+i[t])).join("&")),t.request(e,Object.assign(s??{},{method:"GET"}),n)))(i),i.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,i)=>t.patch("languages/"+e,i)}))(i),i.pages=dc(i),i.patch=(t=>async(e,i,s,n=!1)=>t.post(e,i,s,"PATCH",n))(i),i.post=(t=>async(e,i,s,n="POST",o=!1)=>t.request(e,Object.assign(s??{},{method:n,body:JSON.stringify(i)}),o))(i),i.roles=(t=>({list:async e=>t.get("roles",e),get:async e=>t.get("roles/"+e)}))(i),i.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)}))(i),i.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)}))(i),i.translations=(t=>({list:async()=>t.get("translations"),get:async e=>t.get("translations/"+e)}))(i),i.users=bc(i),s(),i},yc=()=>({addEventListener(t,e){"function"==typeof e&&(this.on[t]=e)},addEventListeners(t){if(!1!==vt(t))for(const e in t)this.addEventListener(e,t[e])},emit(t,...e){return this.hasEventListener(t)?this.on[t](...e):()=>{}},hasEventListener(t){return"function"==typeof this.on[t]},listeners(){return this.on},on:{}}),$c=(t,e={})=>({...e,key:()=>t,defaults:()=>e,reset(){return this.set(this.defaults())},set(t){this.validateState(t);for(const e in this.defaults())this[e]=t[e]??this.defaults()[e];return this.state()},state(){const t={};for(const e in this.defaults())t[e]=this[e]??this.defaults()[e];return t},validateState(t){if(!1===vt(t))throw new Error(`Invalid ${this.key()} state`);return!0}}),wc=(t,e,i)=>{const s=$c(e,i);return{...s,...yc(),async load(e,i={}){return!0!==i.silent&&(this.isLoading=!0),await t.open(e,i),this.isLoading=!1,this.addEventListeners(i.on),this.state()},async open(t,e={}){return"function"==typeof e&&(e={on:{submit:e}}),!0===Bl(t)?this.load(t,e):(this.set(t),this.addEventListeners(e.on),this.emit("open",t,e),this.state())},async post(e,i={}){var s;if(!this.path)throw new Error(`The ${this.key()} cannot be posted`);this.isLoading=!0,e=e??(null==(s=this.props)?void 0:s.value)??{};try{return await t.post(this.path,e,i)}catch(n){t.error(n)}finally{this.isLoading=!1}return!1},async refresh(e={}){e.url=e.url??this.url();const i=(await t.get(e.url,e))["$"+this.key()];if(i&&i.component===this.component)return this.props=i.props,this.state()},async reload(t={}){if(!this.path)return!1;this.open(this.url(),t)},set(t){return s.set.call(this,t),this.on={},this.addEventListeners(t.on??{}),this.state()},url(){return t.url(this.path,this.query)}}},xc=(t,e,i)=>{const s=wc(t,e,i);return{...s,async cancel(){this.isOpen&&this.emit("cancel"),this.close()},async close(){!1!==this.isOpen&&(this.isOpen=!1,this.emit("close"),this.reset(),0===t.overlays().length&&(document.documentElement.removeAttribute("data-overlay"),document.documentElement.style.removeProperty("--scroll-top")))},focus(t){cl(`.k-${this.key()}-portal`,t)},input(t){!1!==this.isOpen&&(Vue.set(this.props,"value",t),this.emit("input",t))},isOpen:!1,listeners(){return{...this.on,cancel:this.cancel.bind(this),close:this.close.bind(this),input:this.input.bind(this),submit:this.submit.bind(this),success:this.success.bind(this)}},async open(e,i){return!1===this.isOpen&&t.notification.close(),await s.open.call(this,e,i),this.component&&(document.documentElement.setAttribute("data-overlay","true"),document.documentElement.style.setProperty("--scroll-top",window.scrollY+"px"),this.isOpen=!0),this.state()},async submit(t,e={}){if(t=t??this.props.value,this.hasEventListener("submit"))return this.emit("submit",t,e);if(!this.path)return this.close();const i=await this.post(t,e);return!1===vt(i)?i:this.success(i["$"+this.key()]??{})},success(e){return this.hasEventListener("success")?this.emit("success",e):("string"==typeof e&&t.notification.success(e),this.close(),this.successNotification(e),this.successEvents(e),this.successDispatch(e),e.route||e.redirect?this.successRedirect(e):t.view.reload(e.reload),e)},successDispatch(e){if(!1!==vt(e.dispatch))for(const i in e.dispatch){const s=e.dispatch[i];t.app.$store.dispatch(i,!0===Array.isArray(s)?[...s]:s)}},successEvents(e){if(e.event){const i=Array.wrap(e.event);for(const s of i)"string"==typeof s&&t.events.emit(s,e)}!1!==e.emit&&t.events.emit("success",e)},successNotification(e){e.message&&t.notification.success(e.message)},successRedirect(e){const i=e.route??e.redirect;return!!i&&("string"==typeof i?t.open(i):t.open(i.url,i.options))},get value(){var t;return null==(t=this.props)?void 0:t.value}}},_c=t=>{t.events.on("dialog.save",(e=>{var i;null==(i=null==e?void 0:e.preventDefault)||i.call(e),t.dialog.submit()}));const e=xc(t,"dialog",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,legacy:!1,ref:null});return{...e,async close(){this.ref&&(this.ref.visible=!1),e.close.call(this)},async open(t,i={}){return t instanceof window.Vue?this.openComponent(t):("string"==typeof t&&(t=`/dialogs/${t}`),e.open.call(this,t,i))},async openComponent(i){t.deprecated("Dialog components should no longer be used in your templates");const s=await e.open.call(this,{component:i.$options._componentTag,legacy:!0,props:{...i.$attrs,...i.$props},ref:i}),n=this.listeners();for(const t in n)i.$on(t,n[t]);return i.visible=!0,s}}},Cc=()=>({...$c("drag",{type:null,data:{}}),get isDragging(){return null!==this.type},start(t,e){this.type=t,this.data=e},stop(){this.type=null,this.data={}}}),Sc=()=>({add(t){if(!t.id)throw new Error("The state needs an ID");!0!==this.has(t.id)&&this.milestones.push(t)},at(t){return this.milestones.at(t)},clear(){this.milestones=[]},get(t=null){return null===t?this.milestones:this.milestones.find((e=>e.id===t))},goto(t){const e=this.index(t);if(-1!==e)return this.milestones=this.milestones.slice(0,e+1),this.milestones[e]},has(t){return void 0!==this.get(t)},index(t){return this.milestones.findIndex((e=>e.id===t))},isEmpty(){return 0===this.milestones.length},last(){return this.milestones.at(-1)},milestones:[],remove(t=null){return null===t?this.removeLast():this.milestones=this.milestones.filter((e=>e.id!==t))},removeLast(){return this.milestones=this.milestones.slice(0,-1)},replace(t,e){-1===t&&(t=this.milestones.length-1),Vue.set(this.milestones,t,e)}}),Oc=t=>{const e=xc(t,"drawer",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,id:null});return t.events.on("drawer.save",(e=>{e.preventDefault(),t.drawer.submit()})),{...e,get breadcrumb(){return this.history.milestones},async close(t){if(!1!==this.isOpen&&(!0===t&&this.history.clear(),void 0===t||t===this.id)){if(this.history.removeLast(),!0!==this.history.isEmpty())return this.open(this.history.last());e.close.call(this)}},goTo(t){const e=this.history.goto(t);void 0!==e&&this.open(e)},history:Sc(),get icon(){return this.props.icon??"box"},input(t){Vue.set(this.props,"value",t),this.emit("input",this.props.value)},listeners(){return{...this.on,cancel:this.cancel.bind(this),close:this.close.bind(this),crumb:this.goTo.bind(this),input:this.input.bind(this),submit:this.submit.bind(this),success:this.success.bind(this),tab:this.tab.bind(this)}},async open(t,i={}){"string"==typeof t&&(t=`/drawers/${t}`),await e.open.call(this,t,i),this.tab(t.tab);const s=this.state();return!0===t.replace?this.history.replace(-1,s):this.history.add(s),this.focus(),s},set(t){return e.set.call(this,t),this.id=this.id??Ml(),this.state()},tab(t){const e=this.props.tabs??{};if(!(t=t??Object.keys(e??{})[0]))return!1;Vue.set(this.props,"fields",e[t].fields),Vue.set(this.props,"tab",t),this.emit("tab",t),setTimeout((()=>{this.focus()}))}}},Mc=t=>{const e=wc(t,"dropdown",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null});return{...e,close(){this.emit("close"),this.reset()},open(t,i={}){return"string"==typeof t&&(t=`/dropdowns/${t}`),e.open.call(this,t,i)},openAsync(t,e={}){return async i=>{await this.open(t,e);const s=this.options();if(0===s.length)throw Error("The dropdown is empty");i(s)}},options(){return!1===Array.isArray(this.props.options)?[]:this.props.options.map((e=>e.dialog?(e.click=()=>{const i="string"==typeof e.dialog?e.dialog:e.dialog.url,s="object"==typeof e.dialog?e.dialog:{};return t.app.$dialog(i,s)},e):e))},set(t){return t.options&&(t.props={options:t.options}),e.set.call(this,t)}}},Ac=t=>{const e=P();e.on("online",(()=>{t.isOffline=!1})),e.on("offline",(()=>{t.isOffline=!0})),e.on("keydown.cmd.s",(i=>{e.emit(t.context+".save",i)})),e.on("keydown.cmd.shift.f",(()=>t.search())),e.on("keydown.cmd./",(()=>t.search()));const i={document:{blur:!0,click:!1,copy:!0,focus:!0,paste:!0},window:{dragenter:!1,dragexit:!1,dragleave:!1,dragover:!1,drop:!1,keydown:!1,keyup:!1,offline:!1,online:!1,popstate:!1}};return{blur(t){this.emit("blur",t)},click(t){this.emit("click",t)},copy(t){this.emit("copy",t)},dragenter(t){this.entered=t.target,this.prevent(t),this.emit("dragenter",t)},dragexit(t){this.prevent(t),this.entered=null,this.emit("dragexit",t)},dragleave(t){this.prevent(t),this.entered===t.target&&(this.entered=null,this.emit("dragleave",t))},dragover(t){this.prevent(t),this.emit("dragover",t)},drop(t){this.prevent(t),this.entered=null,this.emit("drop",t)},emit:e.emit,entered:null,focus(t){this.emit("focus",t)},keychain(t,e){let i=[t];(e.metaKey||e.ctrlKey)&&i.push("cmd"),!0===e.altKey&&i.push("alt"),!0===e.shiftKey&&i.push("shift");let s=e.key?xl(e.key):null;const n={escape:"esc",arrowUp:"up",arrowDown:"down",arrowLeft:"left",arrowRight:"right"};return n[s]&&(s=n[s]),s&&!1===["alt","control","shift","meta"].includes(s)&&i.push(s),i.join(".")},keydown(t){this.emit(this.keychain("keydown",t),t),this.emit("keydown",t)},keyup(t){this.emit(this.keychain("keyup",t),t),this.emit("keyup",t)},off:e.off,offline(t){this.emit("offline",t)},on:e.on,online(t){this.emit("online",t)},paste(t){this.emit("paste",t)},popstate(t){this.emit("popstate",t)},prevent(t){t.stopPropagation(),t.preventDefault()},subscribe(){for(const t in i.document)document.addEventListener(t,this[t].bind(this),i.document[t]);for(const t in i.window)window.addEventListener(t,this[t].bind(this),i.window[t])},unsubscribe(){for(const t in i.document)document.removeEventListener(t,this[t]);for(const t in i.window)window.removeEventListener(t,this[t])},$on(...t){window.panel.deprecated("`events.$on` will be removed in a future version. Use `events.on` instead."),e.on(...t)},$emit(...t){window.panel.deprecated("`events.$emit` will be removed in a future version. Use `events.emit` instead."),e.emit(...t)},$off(...t){window.panel.deprecated("`events.$off` will be removed in a future version. Use `events.off` instead."),e.off(...t)}}},Ic={interval:null,start(t,e){this.stop(),t&&(this.interval=setInterval(e,t))},stop(){clearInterval(this.interval),this.interval=null}},Dc=(t={})=>({...$c("notification",{context:null,details:null,icon:null,isOpen:!1,message:null,theme:null,timeout:null,type:null}),close(){return this.timer.stop(),this.reset(),this.state()},deprecated(t){console.warn("Deprecated: "+t)},error(e){if(e instanceof hc&&t.user.id)return t.redirect("logout");if(e instanceof mc)return this.fatal(e);if(e instanceof pc){const t=Object.values(e.response.json).find((t=>"string"==typeof(null==t?void 0:t.error)));t&&(e.message=t.error)}return"string"==typeof e&&(e={message:e}),e={message:e.message??"Something went wrong",details:e.details??{}},"view"===t.context&&t.dialog.open({component:"k-error-dialog",props:e}),this.open({message:e.message,icon:"alert",theme:"negative",type:"error"})},info(t={}){return"string"==typeof t&&(t={message:t}),this.open({icon:"info",theme:"info",...t})},get isFatal(){return"fatal"===this.type},fatal(t){return"string"==typeof t?this.open({message:t,type:"fatal"}):t instanceof mc?this.open({message:t.response.text,type:"fatal"}):this.open({message:t.message??"Something went wrong",type:"fatal"})},open(e){return this.timer.stop(),"string"==typeof e?this.success(e):("error"!==e.type&&"fatal"!==e.type&&(e.timeout??(e.timeout=4e3)),this.set({context:t.context,...e}),this.isOpen=!0,this.timer.start(this.timeout,(()=>this.close())),this.state())},success(t={}){return"string"==typeof t&&(t={message:t}),this.open({icon:"check",theme:"positive",...t})},timer:Ic}),jc=()=>({...$c("language",{code:null,default:!1,direction:"ltr",name:null,rules:null}),get isDefault(){return this.default}}),Ec=(t,e,i)=>{if(!i.template&&!i.render&&!i.extends)throw new Error(`Neither template nor render method provided. Nor extending a component when loading plugin component "${e}". The component has not been registered.`);return(i=Lc(t,e,i)).template&&(i.render=null),i=Tc(i),!0===dl(e)&&window.console.warn(`Plugin is replacing "${e}"`),t.component(e,i),i},Lc=(t,e,i)=>"string"!=typeof(null==i?void 0:i.extends)?i:!1===dl(i.extends)?(window.console.warn(`Problem with plugin trying to register component "${e}": cannot extend non-existent component "${i.extends}"`),i.extends=null,i):(i.extends=t.options.components[i.extends].extend({options:i,components:{...t.options.components,...i.components??{}}}),i),Tc=t=>{if(!1===Array.isArray(t.mixins))return t;const e={dialog:Et,drawer:fe,section:Na};return t.mixins=t.mixins.map((t=>"string"==typeof t?e[t]:t)),t},Bc=(t,e={})=>((e={components:{},created:[],icons:{},login:null,textareaButtons:{},use:[],thirdParty:{},writerMarks:{},writerNodes:{},...e}).use=((t,e)=>{if(!1===Array.isArray(e))return[];for(const i of e)t.use(i);return e})(t,e.use),e.components=((t,e)=>{if(!1===vt(e))return;const i={};for(const[n,o]of Object.entries(e))try{i[n]=Ec(t,n,o)}catch(s){window.console.warn(s.message)}return i})(t,e.components),e),qc=t=>{var e;const i=$c("menu",{entries:[],hover:!1,isOpen:!1}),s=null==(e=window.matchMedia)?void 0:e.call(window,"(max-width: 60rem)"),n={...i,blur(t){const e=document.querySelector(".k-panel-menu");if(!e||!1===s.matches)return!1;!1===document.querySelector(".k-panel-menu-proxy").contains(t.target)&&!1===e.contains(t.target)&&this.close()},close(){this.isOpen=!1,!1===s.matches&&localStorage.setItem("kirby$menu",!0)},escape(){if(!1===s.matches)return!1;this.close()},open(){this.isOpen=!0,!1===s.matches&&localStorage.removeItem("kirby$menu")},resize(){if(s.matches)return this.close();null!==localStorage.getItem("kirby$menu")?this.isOpen=!1:this.isOpen=!0},set(t){return this.entries=t,this.resize(),this.state()},toggle(){this.isOpen?this.close():this.open()}};return t.events.on("keydown.esc",n.escape.bind(n)),t.events.on("click",n.blur.bind(n)),null==s||s.addEventListener("change",n.resize.bind(n)),n},Pc=t=>({controller:null,requests:0,get isLoading(){return this.requests>0},open(e){t.menu.escape(),t.dialog.open({component:"k-search-dialog",props:{type:e}})},async query(e,i,s){var n;if(null==(n=this.controller)||n.abort(),this.controller=new AbortController,i.length<2)return{results:null,pagination:{}};this.requests++;try{const{$search:n}=await t.get(`/search/${e}`,{query:{query:i,...s},signal:this.controller.signal});return n}catch(o){if("AbortError"!==o.name)return{results:[],pagination:{}}}finally{this.requests--}}}),Nc=()=>{const t=$c("translation",{code:null,data:{},direction:"ltr",name:null});return{...t,set(e){return t.set.call(this,e),document.documentElement.lang=this.code,document.body.dir=this.direction,this.state()},translate(t,e,i=null){if("string"!=typeof t)return;const s=this.data[t]??i;return"string"!=typeof s?s:Sl(s,e)}}};const zc=t=>{const e=$c("upload",{accept:"*",attributes:{},files:[],max:null,multiple:!0,preview:{},replacing:null,url:null});return{...e,...yc(),input:null,cancel(){this.emit("cancel"),this.completed.length>0&&(this.emit("complete",this.completed),t.view.reload()),this.reset()},get completed(){return this.files.filter((t=>t.completed)).map((t=>t.model))},done(){t.dialog.close(),this.completed.length>0&&(this.emit("done",this.completed),!1===t.drawer.isOpen&&(t.notification.success({context:"view"}),t.view.reload())),this.reset()},findDuplicate(t){return this.files.findLastIndex((e=>e.src.name===t.src.name&&e.src.type===t.src.type&&e.src.size===t.src.size&&e.src.lastModified===t.src.lastModified))},hasUniqueName(t){return this.files.filter((e=>e.name===t.name&&e.extension===t.extension)).length<2},file(t){const e=URL.createObjectURL(t);return{...this.preview,completed:!1,error:null,extension:ol(t.name),filename:t.name,id:Ml(),model:null,name:al(t.name),niceSize:rl(t.size),progress:0,size:t.size,src:t,type:t.type,url:e}},open(e,i){e instanceof FileList?(this.set(i),this.select(e)):this.set(e);const s={component:"k-upload-dialog",props:{preview:this.preview},on:{open:t=>this.emit("open",t),cancel:()=>this.cancel(),submit:async()=>{t.dialog.isLoading=!0,await this.submit(),t.dialog.isLoading=!1}}};this.replacing&&(s.component="k-upload-replace-dialog",s.props.original=this.replacing),t.dialog.open(s)},pick(t){this.set(t),this.input=document.createElement("input"),this.input.type="file",this.input.classList.add("sr-only"),this.input.value=null,this.input.accept=this.accept,this.input.multiple=this.multiple,this.input.click(),this.input.addEventListener("change",(e=>{!0===(null==t?void 0:t.immediate)?(this.set(t),this.select(e.target.files),this.submit()):this.open(e.target.files,t),this.input.remove()}))},remove(t){this.files=this.files.filter((e=>e.id!==t))},replace(e,i){this.pick({...i,url:t.urls.api+"/"+e.link,accept:"."+e.extension+","+e.mime,multiple:!1,replacing:e})},reset(){e.reset.call(this),this.files.splice(0)},select(t,e){if(this.set(e),t instanceof Event&&(t=t.target.files),t instanceof FileList==!1)throw new Error("Please provide a FileList");t=(t=[...t]).map((t=>this.file(t))),this.files=[...this.files,...t],this.files=this.files.filter(((t,e)=>this.findDuplicate(t)===e)),null!==this.max&&(this.files=this.files.slice(-1*this.max)),this.emit("select",this.files)},set(t){if(t)return e.set.call(this,t),this.on={},this.addEventListeners(t.on??{}),1===this.max&&(this.multiple=!1),!1===this.multiple&&(this.max=1),this.state()},async submit(){var e;if(!this.url)throw new Error("The upload URL is missing");const i=[];for(const s of this.files){if(!0===s.completed)continue;if(!1===this.hasUniqueName(s)){s.error=t.t("error.file.name.unique");continue}s.error=null,s.progress=0;const n={...this.attributes};i.push((async()=>await this.upload(s,n)));const o=null==(e=this.attributes)?void 0:e.sort;null!=o&&this.attributes.sort++}if(await async function(t,e=20){let i=0,s=0;return new Promise((n=>{const o=e=>s=>{t[e]=s,i--,a()},a=()=>{if(i{e.progress=s}});e.completed=!0,e.model=s.data}catch(s){t.error(s,!1),e.error=s.message,e.progress=0}}}},Fc=t=>{const e=wc(t,"view",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,breadcrumb:[],breadcrumbLabel:null,icon:null,id:null,link:null,search:"pages",title:null});return{...e,set(i){e.set.call(this,i),t.title=this.title;const s=this.url().toString();window.location.toString()!==s&&(window.history.pushState(null,null,s),window.scrollTo(0,0))},async submit(){throw new Error("Not yet implemented")}}},Yc={config:{},languages:[],license:"missing",multilang:!1,permissions:{},searches:{},urls:{}},Rc=["dialog","drawer"],Uc=["dropdown","language","menu","notification","system","translation","user"],Hc={create(t={}){return this.isLoading=!1,this.isOffline=!1,this.activation=cc(),this.drag=Cc(),this.events=Ac(this),this.searcher=Pc(this),this.upload=zc(this),this.language=jc(),this.menu=qc(this),this.notification=Dc(this),this.system=$c("system",{ascii:{},csrf:null,isLocal:null,locales:{},slugs:[],title:null}),this.translation=Nc(),this.user=$c("user",{email:null,id:null,language:null,role:null,username:null}),this.dropdown=Mc(this),this.view=Fc(this),this.drawer=Oc(this),this.dialog=_c(this),this.redirect=fc,this.reload=this.view.reload.bind(this.view),this.t=this.translation.translate.bind(this.translation),this.plugins=Bc(window.Vue,t),this.set(window.fiber),this.api=vc(this),Vue.reactive(this)},get context(){return this.dialog.isOpen?"dialog":this.drawer.isOpen?"drawer":"view"},get debug(){return!0===this.config.debug},deprecated(t){this.notification.deprecated(t)},get direction(){return this.translation.direction},error(t,e=!0){if(!0===this.debug&&console.error(t),!0===e)return this.notification.error(t)},async get(t,e={}){const{response:i}=await this.request(t,{method:"GET",...e});return(null==i?void 0:i.json)??{}},async open(t,e={}){try{if(!1===Bl(t))this.set(t);else{this.isLoading=!0;const i=await this.get(t,e);this.set(i),this.isLoading=!1}return this.state()}catch(i){return this.error(i)}},overlays(){const t=[];return!0===this.drawer.isOpen&&t.push("drawer"),!0===this.dialog.isOpen&&t.push("dialog"),t},async post(t,e={},i={}){const{response:s}=await this.request(t,{method:"POST",body:e,...i});return s.json},async request(t,e={}){return gc(t,{referrer:this.view.path,csrf:this.system.csrf,...e})},async search(t,e,i){return void 0===e?this.searcher.open(t):this.searcher.query(t,e,i)},set(t={}){t=Object.fromEntries(Object.entries(t).map((([t,e])=>[t.replace("$",""),e])));for(const e in Yc){const i=t[e]??this[e]??Yc[e];typeof i==typeof Yc[e]&&(this[e]=i)}for(const e of Uc)(vt(t[e])||Array.isArray(t[e]))&&this[e].set(t[e]);for(const e of Rc)if(!0===vt(t[e])){if(t[e].redirect)return this.open(t[e].redirect);this[e].open(t[e])}else void 0!==t[e]&&this[e].close(!0);!0===vt(t.dropdown)?this.dropdown.open(t.dropdown):void 0!==t.dropdown&&this.dropdown.close(),!0===vt(t.view)&&this.view.open(t.view)},state(){const t={};for(const e in Yc)t[e]=this[e]??Yc[e];for(const e of Uc)t[e]=this[e].state();for(const e of Rc)t[e]=this[e].state();return t.dropdown=this.dropdown.state(),t.view=this.view.state(),t},get title(){return document.title},set title(t){!1===wl(this.system.title)&&(t+=" | "+this.system.title),document.title=t},url:(t="",e={},i)=>El(t,e,i)},Vc=(t,e)=>{localStorage.setItem("kirby$content$"+t,JSON.stringify(e))},Kc={namespaced:!0,state:{current:null,models:{},status:{enabled:!0}},getters:{exists:t=>e=>Object.hasOwn(t.models,e),hasChanges:(t,e)=>t=>yt(e.model(t).changes)>0,isCurrent:t=>e=>t.current===e,id:t=>e=>((e=e??t.current)&&!1===e.includes("?language=")&&(e+="?language="+window.panel.language.code),e),model:(t,e)=>i=>(i=e.id(i),!0===e.exists(i)?t.models[i]:{api:null,originals:{},values:{},changes:{}}),originals:(t,e)=>t=>structuredClone(e.model(t).originals),values:(t,e)=>t=>({...e.originals(t),...e.changes(t)}),changes:(t,e)=>t=>structuredClone(e.model(t).changes)},mutations:{CLEAR(t){for(const e in t.models)t.models[e].changes={};for(const e in localStorage)e.startsWith("kirby$content$")&&localStorage.removeItem(e)},CREATE(t,[e,i]){if(!i)return!1;let s=t.models[e]?t.models[e].changes:i.changes;Vue.set(t.models,e,{api:i.api,originals:i.originals,changes:s??{}})},CURRENT(t,e){t.current=e},MOVE(t,[e,i]){const s=structuredClone(t.models[e]);Vue.del(t.models,e),Vue.set(t.models,i,s);const n=localStorage.getItem("kirby$content$"+e);localStorage.removeItem("kirby$content$"+e),localStorage.setItem("kirby$content$"+i,n)},REMOVE(t,e){Vue.del(t.models,e),localStorage.removeItem("kirby$content$"+e)},REVERT(t,e){t.models[e]&&(Vue.set(t.models[e],"changes",{}),localStorage.removeItem("kirby$content$"+e))},STATUS(t,e){Vue.set(t.status,"enabled",e)},UPDATE(t,[e,i,s]){if(!t.models[e])return!1;void 0===s&&(s=null),s=structuredClone(s);const n=JSON.stringify(s);JSON.stringify(t.models[e].originals[i]??null)==n?Vue.del(t.models[e].changes,i):Vue.set(t.models[e].changes,i,s),Vc(e,{api:t.models[e].api,originals:t.models[e].originals,changes:t.models[e].changes})}},actions:{init(t){for(const e in localStorage)if(e.startsWith("kirby$content$")){const i=e.split("kirby$content$")[1],s=localStorage.getItem("kirby$content$"+i);t.commit("CREATE",[i,JSON.parse(s)])}else if(e.startsWith("kirby$form$")){const i=e.split("kirby$form$")[1],s=localStorage.getItem("kirby$form$"+i);let n=null;try{n=JSON.parse(s)}catch{}if(!n||!n.api)return localStorage.removeItem("kirby$form$"+i),!1;const o={api:n.api,originals:n.originals,changes:n.values};t.commit("CREATE",[i,o]),Vc(i,o),localStorage.removeItem("kirby$form$"+i)}},clear(t){t.commit("CLEAR")},create(t,e){const i=structuredClone(e.content);if(Array.isArray(e.ignore))for(const n of e.ignore)delete i[n];e.id=t.getters.id(e.id);const s={api:e.api,originals:i,changes:{}};t.commit("CREATE",[e.id,s]),t.dispatch("current",e.id)},current(t,e){e=t.getters.id(e),t.commit("CURRENT",e)},disable(t){t.commit("STATUS",!1)},enable(t){t.commit("STATUS",!0)},move(t,[e,i]){e=t.getters.id(e),i=t.getters.id(i),t.commit("MOVE",[e,i])},remove(t,e){e=t.getters.id(e),t.commit("REMOVE",e),t.getters.isCurrent(e)&&t.commit("CURRENT",null)},revert(t,e){e=t.getters.id(e),t.commit("REVERT",e)},async save(t,e){if(e=t.getters.id(e),t.getters.isCurrent(e)&&!1===t.state.status.enabled)return!1;t.dispatch("disable");const i=t.getters.model(e),s={...i.originals,...i.changes};try{await window.panel.api.patch(i.api,s),t.commit("CREATE",[e,{...i,originals:s}]),t.dispatch("revert",e)}finally{t.dispatch("enable")}},update(t,[e,i,s]){if(s=s??t.state.current,null===e)for(const n in i)t.commit("UPDATE",[s,n,i[n]]);else t.commit("UPDATE",[s,e,i])}}},Wc={namespaced:!0,actions:{close(t,e){window.panel.deprecated("`$store.drawer` will be removed in a future version. Use `$panel.drawer` instead."),window.panel.drawer.close(e)},goto(t,e){window.panel.deprecated("`$store.drawer` will be removed in a future version. Use `$panel.drawer` instead."),window.panel.drawer.goto(e)},open(t,e){window.panel.deprecated("`$store.drawer` will be removed in a future version. Use `$panel.drawer` instead."),window.panel.drawer.goto(e)}}},Jc={namespaced:!0,actions:{close(){window.panel.deprecated("`$store.notification` will be removed in a future version. Use `$panel.notification` instead."),window.panel.notification.close()},deprecated(t,e){window.panel.deprecated("`$store.notification.deprecated` will be removed in a future version. Use `$panel.deprecated` instead."),window.panel.notification.deprecated(e)},error(t,e){window.panel.deprecated("`$store.notification` will be removed in a future version. Use `$panel.notification` instead."),window.panel.notification.error(e)},open(t,e){window.panel.deprecated("`$store.notification` will be removed in a future version. Use `$panel.notification` instead."),window.panel.notification.open(e)},success(t,e){window.panel.deprecated("`$store.notification` will be removed in a future version. Use `$panel.notification` instead."),window.panel.notification.success(e)}}};Vue.use(N);const Gc=new N.Store({strict:!1,actions:{dialog(t,e){window.panel.deprecated("`$store.dialog` will be removed in a future version. Use `$panel.dialog.open()` instead."),window.panel.dialog.open(e)},drag(t,e){window.panel.deprecated("`$store.drag` will be removed in a future version. Use `$panel.drag.start(type, data)` instead."),window.panel.drag.start(...e)},fatal(t,e){window.panel.deprecated("`$store.fatal` will be removed in a future version. Use `$panel.notification.fatal()` instead."),window.panel.notification.fatal(e)},isLoading(t,e){window.panel.deprecated("`$store.isLoading` will be removed in a future version. Use `$panel.isLoading` instead."),window.panel.isLoading=e},navigate(){window.panel.deprecated("`$store.navigate` will be removed in a future version."),window.panel.dialog.close(),window.panel.drawer.close()}},modules:{content:Kc,drawers:Wc,notification:Jc}});Vue.config.productionTip=!1,Vue.config.devtools=!0,Vue.use(zl),Vue.use(lc),Vue.use(z),Vue.use(Hr),window.panel=Vue.prototype.$panel=Hc.create(window.panel.plugins),Vue.prototype.$dialog=window.panel.dialog.open.bind(window.panel.dialog),Vue.prototype.$drawer=window.panel.drawer.open.bind(window.panel.drawer),Vue.prototype.$dropdown=window.panel.dropdown.openAsync.bind(window.panel.dropdown),Vue.prototype.$go=window.panel.view.open.bind(window.panel.view),Vue.prototype.$reload=window.panel.reload.bind(window.panel),window.panel.app=new Vue({store:Gc,render:()=>Vue.h(R)}),Vue.use(Fl),Vue.use(Vr),Vue.use(Yl),!1===CSS.supports("container","foo / inline-size")&&Y((()=>import("./container-query-polyfill.modern.min.js")),[],import.meta.url),window.panel.app.$mount("#app");export{ct as n}; diff --git a/panel/dist/js/vendor.min.js b/panel/dist/js/vendor.min.js index 8213c05264..5d67740199 100644 --- a/panel/dist/js/vendor.min.js +++ b/panel/dist/js/vendor.min.js @@ -1,4 +1,4 @@ -"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t={},n={},r={},o={},i={};function s(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 l(e){for(var t=1;t=+n}))};var M={};Object.defineProperty(M,"__esModule",{value:!0}),M.default=void 0;var O=(0,r.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);M.default=O;var C={};Object.defineProperty(C,"__esModule",{value:!0}),C.default=void 0;var N=r,D=(0,N.withParams)({type:"ipAddress"},(function(e){if(!(0,N.req)(e))return!0;if("string"!=typeof e)return!1;var t=e.split(".");return 4===t.length&&t.every(T)}));C.default=D;var T=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},A={};Object.defineProperty(A,"__esModule",{value:!0}),A.default=void 0;var $=r;A.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":";return(0,$.withParams)({type:"macAddress"},(function(t){if(!(0,$.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(E)}))};var E=function(e){return e.toLowerCase().match(/^[0-9a-f]{2}$/)},P={};Object.defineProperty(P,"__esModule",{value:!0}),P.default=void 0;var I=r;P.default=function(e){return(0,I.withParams)({type:"maxLength",max:e},(function(t){return!(0,I.req)(t)||(0,I.len)(t)<=e}))};var R={};Object.defineProperty(R,"__esModule",{value:!0}),R.default=void 0;var z=r;R.default=function(e){return(0,z.withParams)({type:"minLength",min:e},(function(t){return!(0,z.req)(t)||(0,z.len)(t)>=e}))};var _={};Object.defineProperty(_,"__esModule",{value:!0}),_.default=void 0;var B=r,V=(0,B.withParams)({type:"required"},(function(e){return(0,B.req)("string"==typeof e?e.trim():e)}));_.default=V;var j={};Object.defineProperty(j,"__esModule",{value:!0}),j.default=void 0;var F=r;j.default=function(e){return(0,F.withParams)({type:"requiredIf",prop:e},(function(t,n){return!(0,F.ref)(e,this,n)||(0,F.req)(t)}))};var L={};Object.defineProperty(L,"__esModule",{value:!0}),L.default=void 0;var W=r;L.default=function(e){return(0,W.withParams)({type:"requiredUnless",prop:e},(function(t,n){return!!(0,W.ref)(e,this,n)||(0,W.req)(t)}))};var q={};Object.defineProperty(q,"__esModule",{value:!0}),q.default=void 0;var J=r;q.default=function(e){return(0,J.withParams)({type:"sameAs",eq:e},(function(t,n){return t===(0,J.ref)(e,this,n)}))};var K={};Object.defineProperty(K,"__esModule",{value:!0}),K.default=void 0;var H=(0,r.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);K.default=H;var Y={};Object.defineProperty(Y,"__esModule",{value:!0}),Y.default=void 0;var U=r;Y.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 G={};Object.defineProperty(G,"__esModule",{value:!0}),G.default=void 0;var Z=r;G.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 X={};Object.defineProperty(X,"__esModule",{value:!0}),X.default=void 0;var Q=r;X.default=function(e){return(0,Q.withParams)({type:"not"},(function(t,n){return!(0,Q.req)(t)||!e.call(this,t,n)}))};var ee={};Object.defineProperty(ee,"__esModule",{value:!0}),ee.default=void 0;var te=r;ee.default=function(e){return(0,te.withParams)({type:"minValue",min:e},(function(t){return!(0,te.req)(t)||(!/\s/.test(t)||t instanceof Date)&&+t>=+e}))};var ne={};Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var re=r;ne.default=function(e){return(0,re.withParams)({type:"maxValue",max:e},(function(t){return!(0,re.req)(t)||(!/\s/.test(t)||t instanceof Date)&&+t<=+e}))};var oe={};Object.defineProperty(oe,"__esModule",{value:!0}),oe.default=void 0;var ie=(0,r.regex)("integer",/(^[0-9]*$)|(^-[0-9]+$)/);oe.default=ie;var se={};Object.defineProperty(se,"__esModule",{value:!0}),se.default=void 0;var le=(0,r.regex)("decimal",/^[-]?\d*(\.\d+)?$/);function ae(e){this.content=e}function ce(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let e=0;o.text[e]==i.text[e];e++)n++;return n}if(o.content.size||i.content.size){let e=ce(o.content,i.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function he(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=e.child(--o),l=t.child(--i),a=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let e=0,t=Math.min(s.text.length,l.text.length);for(;e>1}},ae.from=function(e){if(e instanceof ae)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new ae(t)};class ue{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let n=0;ne&&!1!==n(l,r+s,o||null,i)&&l.content.size){let o=s+1;l.nodesBetween(Math.max(0,e-o),Math.min(l.content.size,t-o),n,r+o)}s=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,((s,l)=>{let a=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&a||s.isTextblock)&&n&&(i?i=!1:o+=n),o+=a}),0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);oe)for(let o=0,i=0;ie&&((it)&&(s=s.isText?s.cut(Math.max(0,e-i),Math.min(s.text.length,t-i)):s.cut(Math.max(0,e-i-1),Math.min(s.content.size,t-i-1))),n.push(s),r+=s.nodeSize),i=l}return new ue(n,r)}cutByIndex(e,t){return e==t?ue.empty:0==e&&t==this.content.length?this:new ue(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new ue(r,o)}addToStart(e){return new ue([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ue(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 o=r+this.child(n).nodeSize;if(o>=e)return o==e||t>0?fe(n+1,o):fe(n,r);r=o}}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 ue.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ue(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ue.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(o)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;te.type.rank-t.type.rank)),t}}me.none=[];class ge extends Error{}class ye{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=we(this.content,e+this.openStart,t);return n&&new ye(n,this.openStart,this.openEnd)}removeBetween(e,t){return new ye(ve(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 ye.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 ye(ue.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)n++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)r++;return new ye(e,n,r)}}function ve(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:l}=e.findIndex(n);if(o==t||i.isText){if(l!=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,i.copy(ve(i.content,t-o-1,n-o-1)))}function we(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=we(s.content,t-i-1,n);return l&&e.replaceChild(o,s.copy(l))}function be(e,t,n){if(n.openStart>e.depth)throw new ge("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ge("Inconsistent open depths");return xe(e,t,n,0)}function xe(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r=0;o--)r=t.node(o).copy(ue.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Ce(i,Ne(e,o,s,t,r))}{let r=e.parent,o=r.content;return Ce(r,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return Ce(i,De(e,t,r))}function Se(e,t){if(!t.type.compatibleContent(e.type))throw new ge("Cannot join "+t.type.name+" onto "+e.type.name)}function ke(e,t,n){let r=e.node(n);return Se(r,t.node(n)),r}function Me(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 Oe(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(Me(e.nodeAfter,r),i++));for(let l=i;lo&&ke(e,t,o+1),s=r.depth>o&&ke(n,r,o+1),l=[];return Oe(null,e,o,l),i&&s&&t.index(o)==n.index(o)?(Se(i,s),Me(Ce(i,Ne(e,t,n,r,o+1)),l)):(i&&Me(Ce(i,De(e,t,o+1)),l),Oe(t,n,o,l),s&&Me(Ce(s,De(n,r,o+1)),l)),Oe(r,null,o,l),new ue(l)}function De(e,t,n){let r=[];if(Oe(null,e,n,r),e.depth>n){Me(Ce(ke(e,t,n+1),De(e,t,n+1)),r)}return Oe(t,null,n,r),new ue(r)}ye.empty=new ye(ue.empty,0,0);class Te{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 o=0;o0;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 Pe(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,o=t;for(let i=e;;){let{index:e,offset:t}=i.content.findIndex(o),s=o-t;if(n.push(i,e,r+t),!s)break;if(i=i.child(e),i.isText)break;o=s-1,r+=t+1}return new Te(t,n,o)}static resolveCached(e,t){let n=Ee.get(e);if(n)for(let o=0;oe&&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()+")"),_e(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=ue.empty,r=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let l=r;le.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;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=ue.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,r,n);return o.type.checkAttrs(o.attrs),o}}Re.prototype.text=void 0;class ze extends Re{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):_e(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 ze(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ze(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 _e(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Be{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new Ve(e,t);if(null==n.next)return Be.empty;let r=je(n);n.next&&n.err("Unexpected trailing text");let o=function(e){let t=Object.create(null);return n(Ke(e,0));function n(r){let o=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let i=t[r.join(",")]=new Be(r.indexOf(e.length-1)>-1);for(let e=0;ee.to=t))}function i(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(i(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),o(i(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return o(i(e.expr,t),s),o(i(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(i(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 o=0;o"+e.indexOf(t.next[o].next);return r})).join("\n")}}Be.empty=new Be(!0);class Ve{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 je(e){let t=[];do{t.push(Fe(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Fe(e){let t=[];do{t.push(Le(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Le(e){let t=function(e){if(e.eat("(")){let t=je(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 o=[];for(let i in n){let e=n[i];e.groups.indexOf(t)>-1&&o.push(e)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(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=qe(e,t)}return t}function We(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function qe(e,t){let n=We(e),r=n;return e.eat(",")&&(r="}"!=e.next?We(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function Je(e,t){return t-e}function Ke(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;tr[t]=new e(t,n,o)));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let e in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Xe{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let o=null===n?"null":typeof n;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Qe{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Ge(e,r.attrs),this.excluded=null;let o=He(this.attrs);this.instance=o?new me(this,o):null}create(e=null){return!e&&this.instance?this.instance:new me(this,Ye(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,o)=>n[e]=new Qe(e,r++,t,o))),n}removeFromSet(e){for(var t=0;t-1}}class et{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let r in e)t[r]=e[r];t.nodes=ae.from(e.nodes),t.marks=ae.from(e.marks||{}),this.nodes=Ze.compile(this.spec.nodes,this),this.marks=Qe.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let e=this.nodes[r],t=e.spec.content||"",o=e.spec.marks;if(e.contentMatch=n[t]||(n[t]=Be.parse(t,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!e.isInline||!e.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=e}e.markSet="_"==o?null:o?tt(this,o.split(" ")):""!=o&&e.inlineContent?null:[]}for(let r in this.marks){let e=this.marks[r],t=e.spec.excludes;e.excluded=null==t?[e]:""==t?[]:tt(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 Ze))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 ze(n,n.defaultAttrs,e,me.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Re.fromJSON(this,e)}markFromJSON(e){return me.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function tt(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 nt{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach((e=>{if(function(e){return null!=e.tag}(e))this.tags.push(e);else if(function(e){return null!=e.style}(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),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 at(this,t,!1);return n.addAll(e,me.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new at(this,t,!0);return n.addAll(e,me.none,t.from,t.to),ye.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;re.length&&(61!=i.charCodeAt(e.length)||i.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=ht(e)),e.mark||e.ignore||e.clearMark||(e.mark=r)}))}for(let r in e.nodes){let t=e.nodes[r].spec.parseDOM;t&&t.forEach((e=>{n(e=ht(e)),e.node||e.ignore||e.mark||(e.node=r)}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new nt(e,nt.schemaRules(e)))}}const rt={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},ot={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},it={ol:!0,ul:!0};function st(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class lt{constructor(e,t,n,r,o,i){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=i,this.content=[],this.activeMarks=me.none,this.match=o||(4&i?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(ue.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=ue.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(ue.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!rt.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class at{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,o=t.topNode,i=st(null,t.preserveWhitespace,0)|(n?4:0);r=o?new lt(o.type,o.attrs,me.none,!0,t.topMatch||o.type.contentMatch,i):new lt(n?null:e.schema.topNodeType,null,me.none,!0,null,i),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top;if(2&r.options||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(1&r.options)n=2&r.options?n.replace(/\r\n?/g,"\n"):n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],o=e.previousSibling;(!t||o&&"BR"==o.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r,o=e.nodeName.toLowerCase();it.hasOwnProperty(o)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&it.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(r=this.parser.matchTag(e,this,n));if(i?i.ignore:ot.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let n,r=this.top,s=this.needsBlock;if(rt.hasOwnProperty(o))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),n=!0,r.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e,t);let l=i&&i.skip?t:this.readStyles(e,t);l&&this.addAll(e,l),n&&this.sync(r),this.needsBlock=s}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,i,n,!1===i.consuming?r:void 0)}}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let r=0;r!r.clearMark(e))):t.concat(this.parser.schema.marks[r.mark].create(r.attrs)),!1!==r.consuming)break;n=r}}return t}addElementByRule(e,t,n,r){let o,i;if(t.node)if(i=this.parser.schema.nodes[t.node],i.isLeaf)this.insertNode(i.create(t.attrs),n)||this.leafFallback(e,n);else{let e=this.enter(i,t.attrs||null,n,t.preserveWhitespace);e&&(o=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e,n)));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n)}o&&this.sync(s)&&this.open--}addAll(e,t,n,r){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,t);this.findAtPoint(e,o)}findPlace(e,t){let n,r;for(let o=this.open;o>=0;o--){let t=this.nodes[o],i=t.findWrapping(e);if(i&&(!n||n.length>i.length)&&(n=i,r=t,!i.length))break;if(t.solid)break}if(!n)return null;this.sync(r);for(let o=0;o!(i.type?i.type.allowsMarkType(t.type):ut(t.type,e))||(l=t.addToSet(l),!1))),this.nodes.push(new lt(e,t,l,r,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.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),o=-(n?n.depth+1:0)+(r?0:1),i=(e,s)=>{for(;e>=0;e--){let l=t[e];if(""==l){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(i(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!e||e.name!=l&&-1==e.groups.indexOf(l))return!1;s--}}return!0};return i(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}}}function ct(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ht(e){let t={};for(let n in e)t[n]=e[n];return t}function ut(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=e=>{i.push(e);for(let n=0;n{if(o.length||e.marks.length){let n=0,i=0;for(;n=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&yt(pt(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return yt(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new dt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=ft(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return ft(e.marks)}}function ft(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function pt(e){return e.document||window.document}const mt=new WeakMap;function gt(e){let t=mt.get(e);return void 0===t&&mt.set(e,t=function(e){let t=null;function n(e){if(e&&"object"==typeof e)if(Array.isArray(e))if("string"==typeof e[0])t||(t=[]),t.push(e);else for(let t=0;t-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s,l=i.indexOf(" ");l>0&&(n=i.slice(0,l),i=i.slice(l+1));let a=n?e.createElementNS(n,i):e.createElement(i),c=t[1],h=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){h=2;for(let e in c)if(null!=c[e]){let t=e.indexOf(" ");t>0?a.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):a.setAttribute(e,c[e])}}for(let u=h;uh)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}{let{dom:t,contentDOM:i}=yt(e,o,n,r);if(a.appendChild(t),i){if(s)throw new RangeError("Multiple content holes");s=i}}}return{dom:a,contentDOM:s}}const vt=Math.pow(2,16);function wt(e){return 65535&e}class bt{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class xt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&xt.empty)return xt.empty}recover(e){let t=0,n=wt(e);if(!this.inverted)for(let r=0;re)break;let a=this.ranges[s+o],c=this.ranges[s+i],h=l+a;if(e<=h){let o=l+r+((a?e==l?-1:e==h?1:t:t)<0?0:c);if(n)return o;let i=e==(t<0?l:h)?null:s/3+(e-l)*vt,u=e==l?2:e==h?1:4;return(t<0?e!=l:e!=h)&&(u|=8),new bt(o,u,i)}r+=c-a}return n?e+r:new bt(e+r,0,null)}touches(e,t){let n=0,r=wt(t),o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;se)break;let l=this.ranges[s+o];if(e<=t+l&&s==3*r)return!0;n+=this.ranges[s+i]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=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 St;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;no&&te.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return Ot.fromReplace(e,this.from,this.to,o)}invert(){return new Dt(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 Nt(t.pos,n.pos,this.mark)}merge(e){return e instanceof Nt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Nt(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 Nt(t.from,t.to,e.markFromJSON(t.mark))}}Mt.jsonID("addMark",Nt);class Dt extends Mt{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 ye(Ct(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Ot.fromReplace(e,this.from,this.to,n)}invert(){return new Nt(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 Dt(t.pos,n.pos,this.mark)}merge(e){return e instanceof Dt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Dt(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 Dt(t.from,t.to,e.markFromJSON(t.mark))}}Mt.jsonID("removeMark",Dt);class Tt extends Mt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ot.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ot.fromReplace(e,this.pos,this.pos+1,new ye(ue.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;nn.pos?null:new Et(t.pos,n.pos,r,o,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 Et(t.from,t.to,t.gapFrom,t.gapTo,ye.fromJSON(e,t.slice),t.insert,!!t.structure)}}function Pt(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function It(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Rt(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(ni;c--,h--){let e=o.node(c),t=o.index(c);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount),i=r&&r[h+1];i&&(n=n.replaceChild(0,i.type.create(i.attrs)));let s=r&&r[h]||e;if(!e.canReplace(t+1,e.childCount)||!s.type.validContent(n))return!1}let l=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(l,l,a?a.type:o.node(i+1).type)}function Vt(e,t){let n=e.resolve(t),r=n.index();return o=n.nodeBefore,i=n.nodeAfter,!(!o||!i||o.isLeaf||!o.canAppend(i))&&n.parent.canReplace(r,r+1);var o,i}function jt(e,t,n=t,r=ye.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return Ft(o,i,r)?new $t(t,n,r):new Lt(o,i,r).fit()}function Ft(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Mt.jsonID("replaceAround",Et);class Lt{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=ue.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=ue.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 o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let l=new ye(o,i,s);return e>-1?new Et(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new $t(n.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Jt(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let o=e.firstChild;for(let i=this.depth;i>=0;i--){let e,{type:s,match:l}=this.frontier[i],a=null;if(1==t&&(o?l.matchType(o.type)||(a=l.fillBefore(ue.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:i,parent:r,inject:a};if(2==t&&o&&(e=l.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:i,parent:r,wrap:e};if(r&&l.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Jt(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new ye(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=Jt(e,t);if(r.childCount<=1&&t>0){let o=e.size-t<=t+r.size;this.unplaced=new ye(Wt(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new ye(Wt(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let p=0;p1||0==l||e.content.size)&&(h=t,c.push(Kt(e.mark(u.allowedMarks(e.marks)),1==a?l:0,a==s.childCount?d:-1)))}let f=a==s.childCount;f||(d=-1),this.placed=qt(this.placed,t,ue.from(c)),this.frontier[t].match=h,f&&d<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],o=t=0;n--){let{match:t,type:r}=this.frontier[n],o=Ht(e,n,r,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:i,move:o?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=qt(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=qt(this.placed,this.depth,ue.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(ue.empty,!0);e.childCount&&(this.placed=qt(this.placed,this.frontier.length,e))}}function Wt(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Wt(e.firstChild.content,t-1,n)))}function qt(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(qt(e.lastChild.content,t-1,n)))}function Jt(e,t){for(let n=0;n1&&(r=r.replaceChild(0,Kt(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(ue.empty,!0)))),e.copy(r)}function Ht(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,s);return l&&!function(e,t,n){for(let r=n;rr){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(ue.empty,!0))}return e}function Gt(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let o=e.start(r);if(ot.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}class Zt extends Mt{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ot.fail("No node at attribute step's position");let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Ot.fromReplace(e,this.pos,this.pos+1,new ye(ue.from(r),0,t.isLeaf?0:1))}getMap(){return xt.empty}invert(e){return new Zt(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Zt(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Zt(t.pos,t.attr,t.value)}}Mt.jsonID("attr",Zt);let Xt=class extends Error{};Xt=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Xt.prototype=Object.create(Error.prototype)).constructor=Xt,Xt.prototype.name="TransformError";class Qt{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new St}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Xt(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=ye.empty){let r=jt(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new ye(ue.from(n),0,0))}delete(e,t){return this.replace(e,t,ye.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 o=e.doc.resolve(t),i=e.doc.resolve(n);if(Ft(o,i,r))return e.step(new $t(t,n,r));let s=Gt(o,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let l=-(o.depth+1);s.unshift(l);for(let d=o.depth,f=o.pos-1;d>0;d--,f--){let e=o.node(d).type.spec;if(e.defining||e.definingAsContext||e.isolating)break;s.indexOf(d)>-1?l=d:o.before(d)==f&&s.splice(1,0,-d)}let a=s.indexOf(l),c=[],h=r.openStart;for(let d=r.content,f=0;;f++){let e=d.firstChild;if(c.push(e),f==r.openStart)break;d=e.content}for(let d=h-1;d>=0;d--){let e=c[d].type,t=Yt(e);if(t&&o.node(a).type!=e)h=d;else if(t||!e.isTextblock)break}for(let d=r.openStart;d>=0;d--){let t=(d+h+1)%(r.openStart+1),l=c[t];if(l)for(let c=0;c=0&&(e.replace(t,n,r),!(e.steps.length>u));d--){let e=s[d];e<0||(t=o.before(e),n=i.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 o=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 o=r.depth-1;o>=0;o--){let e=r.index(o);if(r.node(o).canReplaceWith(e,e,n))return r.before(o+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let e=r.indexAfter(o);if(r.node(o).canReplaceWith(e,e,n))return r.after(o+1);if(e0&&(n||r.node(t-1).canReplace(r.index(t-1),o.indexAfter(t-1))))return e.delete(r.before(t),o.after(t))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.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:o,depth:i}=t,s=r.before(i+1),l=o.after(i+1),a=s,c=l,h=ue.empty,u=0;for(let p=i,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,h=ue.from(r.node(p).copy(h)),u++):a--;let d=ue.empty,f=0;for(let p=i,m=!1;p>n;p--)m||o.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=ue.from(n[s].type.create(n[s].attrs,r))}let o=t.start,i=t.end;e.step(new Et(o,i,o,i,new ye(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,o)&&function(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(i).map(n),r)){e.clearIncompatible(e.mapping.slice(i).map(n,1),r);let s=e.mapping.slice(i),l=s.map(n,1),a=s.map(n+t.nodeSize,1);return e.step(new Et(l,a,l+1,a-1,new ye(ue.from(r.create(o,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,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Et(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new ye(ue.from(s),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Zt(e,t,n)),this}addNodeMark(e,t){return this.step(new Tt(e,t)),this}removeNodeMark(e,t){if(!(t instanceof me)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new At(e,t)),this}split(e,t=1,n){return function(e,t,n=1,r){let o=e.doc.resolve(t),i=ue.empty,s=ue.empty;for(let l=o.depth,a=o.depth-n,c=n-1;l>a;l--,c--){i=ue.from(o.node(l).copy(i));let e=r&&r[c];s=ue.from(e?e.type.create(e.attrs,s):o.node(l).copy(s))}e.step(new $t(t,t,new ye(i.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let o,i,s=[],l=[];e.doc.nodesBetween(t,n,((e,a,c)=>{if(!e.isInline)return;let h=e.marks;if(!r.isInSet(h)&&c.type.allowsMarkType(r.type)){let c=Math.max(a,t),u=Math.min(a+e.nodeSize,n),d=r.addToSet(h);for(let e=0;ee.step(t))),l.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let o=[],i=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;i++;let l=null;if(r instanceof Qe){let t,n=e.marks;for(;t=r.isInSet(n);)(l||(l=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(l=[r]):l=e.marks;if(l&&l.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;ee.step(new Dt(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,r=n.contentMatch){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let l=0;l=0;l--)e.step(i[l])}(this,e,t,n),this}}const en=Object.create(null);class tn{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new nn(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;o--){let r=t<0?dn(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):dn(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(r)return r}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new hn(e.node(0))}static atStart(e){return dn(e,e,0,0,1)||new hn(e)}static atEnd(e){return dn(e,e,e.content.size,e.childCount,-1)||new hn(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=en[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 en)throw new RangeError("Duplicate use of selection JSON ID "+e);return en[e]=t,t.prototype.jsonID=e,t}getBookmark(){return sn.between(this.$anchor,this.$head).getBookmark()}}tn.prototype.visible=!0;class nn{constructor(e,t){this.$from=e,this.$to=t}}let rn=!1;function on(e){rn||e.parent.inlineContent||(rn=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class sn extends tn{constructor(e,t=e){on(e),on(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 tn.near(n);let r=e.resolve(t.map(this.anchor));return new sn(r.parent.inlineContent?r:n,n)}replace(e,t=ye.empty){if(super.replace(e,t),t==ye.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof sn&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ln(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 sn(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=tn.findFrom(t,n,!0)||tn.findFrom(t,-n,!0);if(!e)return tn.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(tn.findFrom(e,-n,!0)||tn.findFrom(e,n,!0)).$anchor).posnew hn(e)};function dn(e,t,n,r,o,i=!1){if(t.inlineContent)return sn.create(e,n);for(let s=r-(o>0?0:1);o>0?s=0;s+=o){let r=t.child(s);if(r.isAtom){if(!i&&an.isSelectable(r))return an.create(e,n-(o<0?r.nodeSize:0))}else{let t=dn(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function fn(e,t,n){let r=e.steps.length-1;if(r{null==o&&(o=r)})),e.setSelection(tn.near(e.doc.resolve(o),n)))}class pn extends Qt{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 me.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)||me.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 o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(tn.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 mn(e,t){return t&&e?e.bind(t):e}class gn{constructor(e,t,n){this.name=e,this.init=mn(t.init,n),this.apply=mn(t.apply,n)}}const yn=[new gn("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new gn("selection",{init:(e,t)=>e.selection||tn.atStart(t.doc),apply:e=>e.selection}),new gn("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new gn("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class vn{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=yn.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 gn(e.key,e.spec.state,e))}))}}class wn{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],o=r.spec.state;o&&o.toJSON&&(t[n]=o.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 vn(e.schema,e.plugins),o=new wn(r);return r.fields.forEach((r=>{if("doc"==r.name)o.doc=Re.fromJSON(e.schema,t.doc);else if("selection"==r.name)o.selection=tn.fromJSON(o.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let i in n){let s=n[i],l=s.spec.state;if(s.key==r.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,i))return void(o[r.name]=l.fromJSON.call(s,e,t[i],o))}o[r.name]=r.init(e,o)}})),o}}function bn(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=bn(o,t,{})),n[r]=o}return n}class xn{constructor(e){this.spec=e,this.props={},e.props&&bn(e.props,this,this.props),this.key=e.key?e.key.key:kn("plugin")}getState(e){return e[this.key]}}const Sn=Object.create(null);function kn(e){return e in Sn?e+"$"+ ++Sn[e]:(Sn[e]=0,e+"$")}class Mn{constructor(e="key"){this.key=kn(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const On=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Cn=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let Nn=null;const Dn=function(e,t,n){let r=Nn||(Nn=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Tn=function(e,t,n,r){return n&&($n(e,t,n,r,-1)||$n(e,t,n,r,1))},An=/^(img|br|input|textarea|hr)$/i;function $n(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:En(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Pn(e)||An.test(e.nodeName)||"false"==e.contentEditable)return!1;t=On(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?En(e):0}}}function En(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Pn(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 In=function(e){return e.focusNode&&Tn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Rn(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const zn="undefined"!=typeof navigator?navigator:null,_n="undefined"!=typeof document?document:null,Bn=zn&&zn.userAgent||"",Vn=/Edge\/(\d+)/.exec(Bn),jn=/MSIE \d/.exec(Bn),Fn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Bn),Ln=!!(jn||Fn||Vn),Wn=jn?document.documentMode:Fn?+Fn[1]:Vn?+Vn[1]:0,qn=!Ln&&/gecko\/(\d+)/i.test(Bn);qn&&(/Firefox\/(\d+)/.exec(Bn)||[0,0])[1];const Jn=!Ln&&/Chrome\/(\d+)/.exec(Bn),Kn=!!Jn,Hn=Jn?+Jn[1]:0,Yn=!Ln&&!!zn&&/Apple Computer/.test(zn.vendor),Un=Yn&&(/Mobile\/\w+/.test(Bn)||!!zn&&zn.maxTouchPoints>2),Gn=Un||!!zn&&/Mac/.test(zn.platform),Zn=!!zn&&/Win/.test(zn.platform),Xn=/Android \d/.test(Bn),Qn=!!_n&&"webkitFontSmoothing"in _n.documentElement.style,er=Qn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function tr(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function nr(e,t){return"number"==typeof e?e:e[t]}function rr(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 or(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;s=Cn(s)){if(1!=s.nodeType)continue;let e=s,n=e==i.body,l=n?tr(i):rr(e),a=0,c=0;if(t.topl.bottom-nr(r,"bottom")&&(c=t.bottom-t.top>l.bottom-l.top?t.top+nr(o,"top")-l.top:t.bottom-l.bottom+nr(o,"bottom")),t.leftl.right-nr(r,"right")&&(a=t.right-l.right+nr(o,"right")),a||c)if(n)i.defaultView.scrollBy(a,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),a&&(e.scrollLeft+=a);let o=e.scrollLeft-n,i=e.scrollTop-r;t={left:t.left-o,top:t.top-i,right:t.right-o,bottom:t.bottom-i}}if(n||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function ir(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Cn(r));return t}function sr(e,t){for(let n=0;n=c){a=Math.max(f.bottom,a),c=Math.min(f.top,c);let e=f.left>t.left?f.left-t.left:f.right=(f.left+f.right)/2?1:0));continue}}else f.top>t.top&&!o&&f.left<=t.left&&f.right>=t.left&&(o=h,i={left:Math.max(f.left,Math.min(f.right,t.left)),top:f.top});!n&&(t.left>=f.right&&t.top>=f.top||t.left>=f.left&&t.top>=f.bottom)&&(l=u+1)}}return!n&&o&&(n=o,r=i,s=0),n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:e,offset:l}:ar(n,r)}function cr(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function hr(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&o++}let r;Qn&&o&&1==n.nodeType&&1==(r=n.childNodes[o-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=function(e,t,n,r){let o=-1;for(let i=t,s=!1;i!=e.dom;){let t=e.docView.nearestDesc(i,!0);if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent||!t.contentDOM)){let e=t.dom.getBoundingClientRect();if(t.node.isBlock&&t.parent&&(!s&&e.left>r.left||e.top>r.top?o=t.posBefore:(!s&&e.right-1?o:e.docView.posFromDOM(t,n,-1)}(e,n,o,t))}null==s&&(s=function(e,t,n){let{node:r,offset:o}=ar(t,n),i=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}(e,l,t));let a=e.docView.nearestDesc(l,!0);return{pos:s,inside:a?a.posAtStart-a.border:-1}}function dr(e){return e.top=0&&o==r.nodeValue.length?(e--,i=1):n<0?e--:t++,gr(fr(Dn(r,e,t),i),i<0)}{let e=fr(Dn(r,o,o),n);if(qn&&o&&/\s/.test(r.nodeValue[o-1])&&o=0)}if(null==i&&o&&(n<0||o==En(r))){let e=r.childNodes[o-1],t=3==e.nodeType?Dn(e,En(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return gr(fr(t,1),!1)}if(null==i&&o=0)}function gr(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 yr(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 vr(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}const wr=/[\u0590-\u08ac]/;let br=null,xr=null,Sr=!1;function kr(e,t,n){return br==t&&xr==n?Sr:(br=t,xr=n,Sr="up"==n||"down"==n?function(e,t,n){let r=t.selection,o="up"==n?r.$from:r.$to;return vr(e,t,(()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=mr(e,o.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=Dn(e,0,e.nodeValue.length).getClientRects()}for(let e=0;eo.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,l=e.domSelection();return l?wr.test(r.parent.textContent)&&l.modify?vr(e,t,(()=>{let{focusNode:t,focusOffset:o,anchorNode:i,anchorOffset:s}=e.domSelectionRange(),a=l.caretBidiLevel;l.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:h,focusOffset:u}=e.domSelectionRange(),d=h&&!c.contains(1==h.nodeType?h:h.parentNode)||t==h&&o==u;try{l.collapse(i,s),t&&(t!=i||o!=s)&&l.extend&&l.extend(t,o)}catch(f){}return null!=a&&(l.caretBidiLevel=a),d})):"left"==n||"backward"==n?i:s:r.pos==r.start()||r.pos==r.end()}(e,t,n))}class Mr{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;tOn(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 o,i=this.getDesc(r);if(i&&(!t||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;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 o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;te||t instanceof $r){r=e-o;break}o=i}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let o;n&&!(o=this.children[n-1]).size&&o instanceof Or&&o.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?On(e.dom)+1:0}}{let e,r=!0;for(;e=n=o&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=i;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=On(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||s==this.children.length-1)){t=l;for(let e=s+1;ef&&it){let e=s;s=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(s.node,s.offset),a.removeAllRanges(),a.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+o.border,s=i-o.border;if(e>=r&&t<=s)return this.dirty=e==n||t==i?2:1,void(e!=r||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-r,t-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirtyo?o.parent?o.parent.posBeforeChild(o):void 0:r))),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=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 Cr extends Mr{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 Nr extends Mr{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let o=r.nodeViews[t.type.name],i=o&&o(t,r,n);return i&&i.dom||(i=dt.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new Nr(e,t,i.dom,i.contentDOM||i.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}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&&(o=qr(o,0,e,n));for(let s=0;ss?s.parent?s.parent.posBeforeChild(s):void 0:i),n,r),c=a&&a.dom,h=a&&a.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 if(!c){let e=dt.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:h}=e)}h||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let u=c;return c=Vr(c,n,t),a?s=new Er(e,t,n,r,c,h||null,u,a,o,i+1):t.isText?new Ar(e,t,n,r,c,u,o):new Dr(e,t,n,r,c,h||null,u,o,i+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=()=>ue.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)&&jr(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,o=e.composing?this.localCompositionInfo(e,t):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,l=new Lr(this,i&&i.node,e);!function(e,t,n,r){let o=t.locals(e),i=0;if(0==o.length){for(let n=0;ni;)l.push(o[s++]);let p=i+d.nodeSize;if(d.isText){let e=p;s!e.inline)):l.slice(),t.forChild(i,d),f),i=p}}(this.node,this.innerDeco,((t,o,i)=>{t.spec.marks?l.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!i&&l.syncToMarks(o==this.node.childCount?me.none:this.node.child(o).marks,n,e),l.placeWidget(t,e,r)}),((t,i,a,c)=>{let h;l.syncToMarks(t.marks,n,e),l.findNodeMatch(t,i,a,c)||s&&e.state.selection.from>r&&e.state.selection.to-1&&l.updateNodeAt(t,i,a,h,e)||l.updateNextNode(t,i,a,e,c,r)||l.addNode(t,i,a,e,r),r+=t.nodeSize})),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(i&&this.protectLocalComposition(e,i),Pr(this.contentDOM,this.children,e),Un&&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 sn)||nt+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let o=0,i=0;o=n){if(i>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let e=l=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+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 o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new Cr(this,o,t,r);e.input.compositionNodes.push(i),this.children=qr(this.children,n,n+r.length,e,i)}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(jr(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=_r(this.dom,this.nodeDOM,zr(this.outerDeco,this.node,t),zr(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 Tr(e,t,n,r,o){Vr(r,t,e);let i=new Dr(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Ar extends Dr{constructor(e,t,n,r,o,i,s){super(e,t,n,r,o,null,i,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),o=document.createTextNode(r.text);return new Ar(this.parent,r,this.outerDeco,this.innerDeco,o,o,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}isText(e){return this.node.text==e}}class $r extends Mr{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 Er extends Dr{constructor(e,t,n,r,o,i,s,l,a,c){super(e,t,n,r,o,i,s,a,c),this.spec=l}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,r),o}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 Pr(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i0;){let l;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Nr)){l=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 a=l.node;if(a){if(a!=e.child(o-1))break;--o,i.set(l,o),s.push(l)}}return{index:o,matched:i,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n>1,i=Math.min(o,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=Nr.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let s=this.index,l=Math.min(this.top.children.length,s+5);s=n||h<=t?i.push(a):(cn&&i.push(a.slice(n-c,a.size,r)))}return i}function Jr(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l,a,c=r.resolve(s);if(In(n)){for(l=c;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&an.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,o=t==En(e);r||o;){if(e==n)return!0;let t=On(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==En(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;a=new an(s==e?c:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;l=r.resolve(t)}if(!a){a=eo(e,l,c,"pointer"==t||e.state.selection.head{n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Kr(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Yr=Yn||Kn&&Hn<63;function Ur(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=rr(e,t,n)))||sn.between(t,n,r)}function to(e){return!(e.editable&&!e.hasFocus())&&no(e)}function no(e){let t=e.domSelectionRange();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 ro(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&tn.findFrom(i,t)}function oo(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function io(e,t,n){let r=e.state.selection;if(!(r instanceof sn)){if(r instanceof an&&r.node.isInline)return oo(e,new sn(t>0?r.$to:r.$from));{let n=ro(e.state,t);return!!n&&oo(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,o=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=e.state.doc.resolve(n.pos+o.nodeSize*(t<0?-1:1));return oo(e,new sn(r.$anchor,i))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=ro(e.state,t);return!!(n&&n instanceof an)&&oo(e,n)}if(!(Gn&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=t<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(an.isSelectable(i)?oo(e,new an(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):!!Qn&&oo(e,new sn(e.state.doc.resolve(t<0?s:s+i.nodeSize))))}}function so(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function lo(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function ao(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;qn&&1==n.nodeType&&r0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(lo(e,-1))o=n,i=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(co(n))break;{let t=n.previousSibling;for(;t&&lo(t,-1);)o=n.parentNode,i=On(t),t=t.previousSibling;if(t)n=t,r=so(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?ho(e,n,r):o&&ho(e,o,i)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=so(n);for(;;)if(r{e.state==o&&Hr(e)}),50)}function uo(e,t){let n=e.state.doc.resolve(t);if(!Kn&&!Zn&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),o=(n.top+n.bottom)/2;if(o>r.top&&o1)return n.leftr.top&&o1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function fo(e,t,n){let r=e.state.selection;if(r instanceof sn&&!r.empty||n.indexOf("s")>-1)return!1;if(Gn&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=ro(e.state,t);if(n&&n instanceof an)return oo(e,n)}if(!o.parent.inlineContent){let n=t<0?o:i,s=r instanceof hn?tn.near(n,t):tn.findFrom(n,t);return!!s&&oo(e,s)}return!1}function po(e,t){if(!(e.state.selection instanceof sn))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=e.state.tr;return t<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),e.dispatch(r),!0}return!1}function mo(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function go(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);if(8==n||Gn&&72==n&&"c"==r)return po(e,-1)||ao(e,-1);if(46==n&&!t.shiftKey||Gn&&68==n&&"c"==r)return po(e,1)||ao(e,1);if(13==n||27==n)return!0;if(37==n||Gn&&66==n&&"c"==r){let t=37==n?"ltr"==uo(e,e.state.selection.from)?-1:1:-1;return io(e,t,r)||ao(e,t)}if(39==n||Gn&&70==n&&"c"==r){let t=39==n?"ltr"==uo(e,e.state.selection.from)?1:-1:1;return io(e,t,r)||ao(e,t)}return 38==n||Gn&&80==n&&"c"==r?fo(e,-1,r)||ao(e,-1):40==n||Gn&&78==n&&"c"==r?function(e){if(!Yn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;mo(e,n,"true"),setTimeout((()=>mo(e,n,"false")),20)}return!1}(e)||fo(e,1,r)||ao(e,1):r==(Gn?"m":"c")&&(66==n||73==n||89==n||90==n)}function yo(e,t){e.someProp("transformCopied",(n=>{t=n(t,e)}));let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;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")||dt.fromSchema(e.state.schema),l=No(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c,h=a.firstChild,u=0;for(;h&&1==h.nodeType&&(c=Oo[h.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=l.createElement(c[e]);for(;a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t),u++}h=a.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",`${o} ${i}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:a,text:e.someProp("clipboardTextSerializer",(n=>n(t,e)))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function vo(e,t,n,r,o){let i,s,l=o.parent.type.spec.code;if(!n&&!t)return null;let a=t&&(r||l||!n);if(a){if(e.someProp("transformPastedText",(n=>{t=n(t,l||r,e)})),l)return t?new ye(ue.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):ye.empty;let n=e.someProp("clipboardTextParser",(n=>n(t,o,r,e)));if(n)s=n;else{let n=o.marks(),{schema:r}=e.state,s=dt.fromSchema(r);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=i.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(t=>{n=t(n,e)})),i=function(e){let t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=No().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&Oo[o[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"")).reverse().join(""));if(r.innerHTML=e,n)for(let i=0;i0;u--){let e=i.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;i=e}if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||nt.fromSchema(e.state.schema);s=t.parseSlice(i,{preserveWhitespace:!(!a&&!h),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||wo.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(h)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(l){return e}let{content:o,openStart:i,openEnd:s}=e;for(let a=n.length-2;a>=0;a-=2){let e=r.nodes[n[a]];if(!e||e.hasRequiredAttrs())break;o=ue.from(e.create(n[a+1],o)),i++,s++}return new ye(o,i,s)}(Mo(s,+h[1],+h[2]),h[4]);else if(s=ye.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,o=t.node(n).contentMatchAt(t.index(n)),i=[];if(e.forEach((e=>{if(!i)return;let t,n=o.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&r.length&&xo(n,r,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=So(i[i.length-1],r.length));let t=bo(e,n);i.push(t),o=o.matchType(t.type),r=n}})),i)return ue.from(i)}return e}(s.content,o),!0),s.openStart||s.openEnd){let e=0,t=0;for(let n=s.content.firstChild;e{s=t(s,e)})),s}const wo=/^(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 bo(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,ue.from(e));return e}function xo(e,t,n,r,o){if(o1&&(i=0),o=n&&(l=t<0?s.contentMatchAt(0).fillBefore(l,i<=o).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(ue.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(l))}function Mo(e,t,n){return t{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Io(e,t))}))}function Io(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Ro(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 zo(e){return{left:e.clientX,top:e.clientY}}function _o(e,t,n,r,o){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,(t=>s>i.depth?t(e,n,i.nodeAfter,i.before(s),o,!0):t(e,n,i.node(s),i.before(s),o,!1))))return!0;return!1}function Bo(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Vo(e,t,n,r,o){return _o(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(o?function(e,t){if(-1==t)return!1;let n,r,o=e.state.selection;o instanceof an&&(n=o.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let e=s>i.depth?i.nodeAfter:i.node(s);if(an.isSelectable(e)){r=n&&o.$from.depth>0&&s>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(s);break}}return null!=r&&(Bo(e,an.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&&an.isSelectable(r))&&(Bo(e,new an(n),"pointer"),!0)}(e,n))}function jo(e,t,n,r){return _o(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Fo(e,t,n,r){return _o(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&&(Bo(e,sn.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(t);for(let i=o.depth+1;i>0;i--){let t=i>o.depth?o.nodeAfter:o.node(i),n=o.before(i);if(t.inlineContent)Bo(e,sn.create(r,n+1,n+1+t.content.size),"pointer");else{if(!an.isSelectable(t))continue;Bo(e,an.create(r,n),"pointer")}return!0}}(e,n,r)}function Lo(e){return Go(e)}To.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Jo(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Xn||!Kn||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Un||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||go(e,n)?n.preventDefault():Eo(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,Rn(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},To.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},To.keypress=(e,t)=>{let n=t;if(Jo(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Gn&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof sn&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);/[\r\n]/.test(t)||e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const Wo=Gn?"metaKey":"ctrlKey";Do.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Lo(e),o=Date.now(),i="singleClick";o-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[Wo]&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=e.posAtCoords(zo(n));s&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new qo(e,s,n,!!r)):("doubleClick"==i?jo:Fo)(e,s.pos,s.inside,n)?n.preventDefault():Eo(e,"pointer"))};class qo{constructor(e,t,n,r){let o,i;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[Wo],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),i=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,l=s?e.docView.nearestDesc(s,!0):null;this.target=l&&1==l.dom.nodeType?l.dom:null;let{selection:a}=e.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||a instanceof an&&a.from<=i&&a.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!qn||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)),Eo(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((()=>Hr(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(zo(e))),this.updateAllowDefault(e),this.allowDefault||!t?Eo(this.view,"pointer"):Vo(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Yn&&this.mightDrag&&!this.mightDrag.node.isAtom||Kn&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Bo(this.view,tn.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Eo(this.view,"pointer")}move(e){this.updateAllowDefault(e),Eo(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function Jo(e,t){return!!e.composing||!!(Yn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Do.touchstart=e=>{e.input.lastTouch=Date.now(),Lo(e),Eo(e,"pointer")},Do.touchmove=e=>{e.input.lastTouch=Date.now(),Eo(e,"pointer")},Do.contextmenu=e=>Lo(e);const Ko=Xn?5e3:-1;function Ho(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>Go(e)),t))}function Yo(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 Uo(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=En(e=e.childNodes[t-1])}else{if(!e.parentNode||Pn(e))return null;t=On(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t=0)){if(e.domObserver.forceFlush(),Yo(e),t||e.docView&&e.docView.dirty){let t=Jr(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}To.compositionstart=To.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof sn&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),Go(e,!0),e.markCursor=null;else if(Go(e),qn&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}Ho(e,Ko)},To.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then((()=>e.domObserver.flush())),e.input.compositionID++,Ho(e,20))};const Zo=Ln&&Wn<15||Un&&er<604;function Xo(e,t,n,r,o){let i=vo(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,o,i||ye.empty))))return!0;if(!i)return!1;let s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),l=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(i);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Qo(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Do.copy=To.cut=(e,t)=>{let n=t,r=e.state.selection,o="cut"==n.type;if(r.empty)return;let i=Zo?null:n.clipboardData,s=r.content(),{dom:l,text:a}=yo(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",a)):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(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,l),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},To.paste=(e,t)=>{let n=t;if(e.composing&&!Xn)return;let r=Zo?null:n.clipboardData,o=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&Xo(e,Qo(r),r.getData("text/html"),o,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();let o=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Xo(e,r.value,null,o,t):Xo(e,r.textContent,r.innerHTML,o,t)}),50)}(e,n)};class ei{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const ti=Gn?"altKey":"ctrlKey";Do.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o,i=e.state.selection,s=i.empty?null:e.posAtCoords(zo(n));if(s&&s.pos>=i.from&&s.pos<=(i instanceof an?i.to-1:i.to));else if(r&&r.mightDrag)o=an.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&&(o=an.create(e.state.doc,t.posBefore))}let l=(o||e.state.selection).content(),{dom:a,text:c,slice:h}=yo(e,l);(!n.dataTransfer.files.length||!Kn||Hn>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Zo?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Zo||n.dataTransfer.setData("text/plain",c),e.dragging=new ei(h,!n[ti],o)},Do.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},To.dragover=To.dragenter=(e,t)=>t.preventDefault(),To.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(zo(n));if(!o)return;let i=e.state.doc.resolve(o.pos),s=r&&r.slice;s?e.someProp("transformPasted",(t=>{s=t(s,e)})):s=vo(e,Qo(n.dataTransfer),Zo?null:n.dataTransfer.getData("text/html"),!1,i);let l=!(!r||n[ti]);if(e.someProp("handleDrop",(t=>t(e,n,s||ye.empty,l))))return void n.preventDefault();if(!s)return;n.preventDefault();let a=s?function(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let i=0;i=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),l=!1;if(1==i)l=s.canReplace(n,n,o);else{let e=s.contentMatchAt(n).findWrapping(o.firstChild.type);l=e&&s.canReplaceWith(n,n,e[0])}if(l)return 0==t?r.pos:t<0?r.before(e+1):r.after(e+1)}return null}(e.state.doc,i.pos,s):i.pos;null==a&&(a=i.pos);let c=e.state.tr;if(l){let{node:e}=r;e?e.replace(c):c.deleteSelection()}let h=c.mapping.map(a),u=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,d=c.doc;if(u?c.replaceRangeWith(h,h,s.content.firstChild):c.replaceRange(h,h,s),c.doc.eq(d))return;let f=c.doc.resolve(h);if(u&&an.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new an(f));else{let t=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,r,o)=>t=o)),c.setSelection(eo(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},Do.focus=e=>{e.input.lastFocus=Date.now(),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.domSelectionRange())&&Hr(e)}),20))},Do.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)},Do.beforeinput=(e,t)=>{if(Kn&&Xn&&"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,Rn(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 To)Do[os]=To[os];function ni(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 ri{constructor(e,t){this.toDOM=e,this.spec=t||ai,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new si(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof ri&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ni(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class oi{constructor(e,t){this.attrs=e,this.spec=t||ai}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new si(o,i,this)}valid(e,t){return t.from=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;ie){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,n,r+s,o)}}map(e,t,n){return this==hi||0==e.maps.length?this:this.mapInner(e,t,0,0,n||ai)}mapInner(e,t,n,r,o){let i;for(let s=0;s{let i=o-r-(n-t);for(let s=0;sr+h-e)continue;let o=l[s]+h-e;n>=o?l[s+1]=t<=o?-2:-1:t>=h&&i&&(l[s]+=i,l[s+1]+=i)}e+=i})),h=n.maps[c].map(h,-1)}let a=!1;for(let c=0;c=r.content.size){a=!0;continue}let u=n.map(e[c+1]+i,-1)-o,{index:d,offset:f}=r.content.findIndex(h),p=r.maybeChild(d);if(p&&f==h&&f+p.nodeSize==u){let r=l[c+2].mapInner(n,p,t+1,e[c]+i+1,s);r!=hi?(l[c]=h,l[c+1]=u,l[c+2]=r):(l[c+1]=-2,a=!0)}else a=!0}if(a){let a=function(e,t,n,r,o,i,s){function l(e,t){for(let i=0;i{let s,l=i+n;if(s=fi(t,e,l)){for(r||(r=this.children.slice());oi&&t.to=e){this.children[s]==e&&(n=this.children[s+2]);break}let o=e+1,i=o+t.content.size;for(let s=0;so&&e.type instanceof oi){let t=Math.max(o,e.from)-o,n=Math.min(i,e.to)-o;tn.map(e,t,ai)));return ui.from(n)}forChild(e,t){if(t.isLeaf)return ci.empty;let n=[];for(let r=0;re instanceof ci))?e:e.reduce(((e,t)=>e.concat(t instanceof ci?t:t.members)),[]))}}}function di(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;rn&&i.to{let l=fi(e,t,s+n);if(l){i=!0;let e=mi(l,t,n+s+1,r);e!=hi&&o.push(s,s+t.nodeSize,e)}}));let s=di(i?pi(e):e,-n).sort(gi);for(let l=0;l0;)t++;e.splice(t,0,n)}function wi(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=hi&&t.push(r)})),e.cursorWrapper&&t.push(ci.create(e.state.doc,[e.cursorWrapper.deco])),ui.from(t)}const bi={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},xi=Ln&&Wn<=11;class Si{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 ki{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Si,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,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()})),xi&&(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.takeRecords(),this.observer.observe(this.view.dom,bi)),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(to(this.view)){if(this.suppressingSelectionUpdates)return Hr(this.view);if(Ln&&Wn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Tn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let o=e.focusNode;o;o=Cn(o))n.add(o);for(let o=e.anchorNode;o;o=Cn(o))if(n.has(o)){t=o;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&to(e)&&!this.ignoreSelectionChange(n),o=-1,i=-1,s=!1,l=[];if(e.editable)for(let c=0;c"BR"==e.nodeName));if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;!t||"LI"!=t.nodeName||n&&Ni(e,n)==t||r.remove()}}}let a=null;o<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||r)&&(o>-1&&(e.docView.markDirty(o,i),function(e){if(Mi.has(e))return;if(Mi.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=qn,Oi)return;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."),Oi=!0}}(e)),this.handleDOMChange(o,i,s,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Hr(e),this.currentSelection.set(n))}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=Jr(e,t);if(n&&!e.state.selection.eq(n)){if(Kn&&Xn&&13===e.input.lastKeyCode&&Date.now()-100t(e,Rn(13,"Enter")))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),i&&r.setMeta("composition",i),e.dispatch(r)}return}let s=e.state.doc.resolve(t),l=s.sharedDepth(n);t=s.before(l+1),n=e.state.doc.resolve(n).after(l+1);let a,c,h=e.state.selection,u=function(e,t,n){let r,{node:o,fromOffset:i,toOffset:s,from:l,to:a}=e.docView.parseRange(t,n),c=e.domSelectionRange(),h=c.anchorNode;if(h&&e.dom.contains(1==h.nodeType?h:h.parentNode)&&(r=[{node:h,offset:c.anchorOffset}],In(c)||r.push({node:c.focusNode,offset:c.focusOffset})),Kn&&8===e.input.lastKeyCode)for(let g=s;g>i;g--){let e=o.childNodes[g-1],t=e.pmViewDesc;if("BR"==e.nodeName&&!t){s=g;break}if(!t||t.size)break}let u=e.state.doc,d=e.someProp("domParser")||nt.fromSchema(e.state.schema),f=u.resolve(l),p=null,m=d.parse(o,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Di,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+l,head:t+l}}return{doc:m,sel:p,from:l,to:a}}(e,t,n),d=e.state.doc,f=d.slice(u.from,u.to);8===e.input.lastKeyCode&&Date.now()-100=s?i-r:0;i-=e,i&&i=l?i-r:0;i-=t,i&&iDate.now()-225||Xn)&&o.some((e=>1==e.nodeType&&!Ti.test(e.nodeName)))&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",(t=>t(e,Rn(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!p){if(!(r&&h instanceof sn&&!h.empty&&h.$head.sameParent(h.$anchor))||e.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let t=$i(e,e.state.doc,u.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);i&&n.setMeta("composition",i),e.dispatch(n)}}return}p={start:h.from,endA:h.to,endB:h.to}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&p.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?p.start=e.state.selection.from:p.endA=e.state.selection.to-2&&e.state.selection.to<=u.to&&(p.endB+=e.state.selection.to-p.endA,p.endA=e.state.selection.to)),Ln&&Wn<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>u.from&&"  "==u.doc.textBetween(p.start-u.from-1,p.start-u.from+1)&&(p.start--,p.endA--,p.endB--);let m,g=u.doc.resolveNoCache(p.start-u.from),y=u.doc.resolveNoCache(p.endB-u.from),v=d.resolve(p.start),w=g.sameParent(y)&&g.parent.inlineContent&&v.end()>=p.endA;if((Un&&e.input.lastIOSEnter>Date.now()-225&&(!w||o.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!w&&g.post(e,Rn(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>p.start&&function(e,t,n,r,o){if(n-t<=o.pos-r.pos||Ei(r,!0,!1)n||Ei(s,!0,!1)t(e,Rn(8,"Backspace")))))return void(Xn&&Kn&&e.domObserver.suppressSelectionUpdates());Kn&&Xn&&p.endB==p.start&&(e.input.lastAndroidDelete=Date.now()),Xn&&!w&&g.start()!=y.start()&&0==y.parentOffset&&g.depth==y.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==p.endA&&(p.endB-=2,y=u.doc.resolveNoCache(p.endB-u.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,Rn(13,"Enter"))}))}),20));let b,x,S,k=p.start,M=p.endA;if(w)if(g.pos==y.pos)Ln&&Wn<=11&&0==g.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Hr(e)),20)),b=e.state.tr.delete(k,M),x=d.resolve(p.start).marksAcross(d.resolve(p.endA));else if(p.endA==p.endB&&(S=function(e,t){let n,r,o,i=e.firstChild.marks,s=t.firstChild.marks,l=i,a=s;for(let h=0;he.mark(r.addToSet(e.marks));else{if(0!=l.length||1!=a.length)return null;r=a[0],n="remove",o=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let h=0;hn(e,k,M,t))))return;b=e.state.tr.insertText(t,k,M)}if(b||(b=e.state.tr.replace(k,M,u.doc.slice(p.start-u.from,p.endB-u.from))),u.sel){let t=$i(e,b.doc,u.sel);t&&!(Kn&&Xn&&e.composing&&t.empty&&(p.start!=p.endB||e.input.lastAndroidDeletet.content.size?null:eo(e,t.resolve(n.anchor),t.resolve(n.head))}function Ei(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}function Pi(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class Ii{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 $o,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Vi),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=_i(this),zi(this),this.nodeViews=Bi(this),this.docView=Tr(this.state.doc,Ri(this),wi(this),this.dom,this),this.domObserver=new ki(this,((e,t,n,r)=>Ai(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in Do){let n=Do[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Ro(e,t)||Io(e,t)||!e.editable&&t.type in To||n(e,t)},Ao[t]?{passive:!0}:void 0)}Yn&&e.dom.addEventListener("input",(()=>null)),Po(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&&Po(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Vi),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}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._props)}updateStateInner(e,t){var n;let r=this.state,o=!1,i=!1;e.storedMarks&&this.composing&&(Yo(this),i=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Bi(this);(function(e,t){let n=0,r=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let o in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,o=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&Po(this),this.editable=_i(this),zi(this);let l=wi(this),a=Ri(this),c=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",h=o||!this.docView.matchesNode(e.doc,a,l);!h&&e.selection.eq(r.selection)||(i=!0);let u="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s=o-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:ir(e.dom)}}(this);if(i){this.domObserver.stop();let t=h&&(Ln||Kn)&&!this.composing&&!r.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)}(r.selection,e.selection);if(h){let n=Kn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Uo(this)),!o&&this.docView.update(e.doc,a,l,this)||(this.docView.updateOuterDeco(a),this.docView.destroy(),this.docView=Tr(e.doc,a,l,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Tn(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Hr(this,t):(Xr(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():u&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;sr(n,0==r?0:r-t)}(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof an){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&or(this,t.getBoundingClientRect(),e)}else or(this,this.coordsAtPos(this.state.selection.head,1),e)}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;t0&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new ei(e.slice,e.move,r<0?void 0:an.create(this.state.doc,r))}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let i=0;it.ownerDocument.getSelection()),this._root=t;return e||document}updateRoot(){this._root=null}posAtCoords(e){return ur(this,e)}coordsAtPos(e,t=1){return mr(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 kr(this,t||this.state,e)}pasteHTML(e,t){return Xo(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Xo(this,e,null,!0,t||new ClipboardEvent("paste"))}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,[],wi(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Nn=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Io(e,t)||!Do[t.type]||!e.editable&&t.type in To||Do[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Yn&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Ci(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?Ci(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Ri(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),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]))})),t.translate||(t.translate="no"),[si.node(0,e.state.doc.content.size,t)]}function zi(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:si.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function _i(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function Bi(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Vi(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 ji={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:"'"},Fi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Li="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Wi="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),qi="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ji=Wi||Li&&+Li[1]<57,Ki=0;Ki<10;Ki++)ji[48+Ki]=ji[96+Ki]=String(Ki);for(Ki=1;Ki<=24;Ki++)ji[Ki+111]="F"+Ki;for(Ki=65;Ki<=90;Ki++)ji[Ki]=String.fromCharCode(Ki+32),Fi[Ki]=String.fromCharCode(Ki);for(var Hi in ji)Fi.hasOwnProperty(Hi)||(Fi[Hi]=ji[Hi]);const Yi="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Ui(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let l=0;l127)&&(r=ji[n.keyCode])&&r!=o){let o=t[Gi(r,n)];if(o&&o(e.state,e.dispatch,e))return!0}}return!1}}const Qi=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function es(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 ts(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 ns(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{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&Rt(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)};function is(e){for(let t=0;t{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=is(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,s.createAndFill());o.setSelection(tn.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0};const ls=(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof an&&e.selection.node.isBlock)return!(!n.parentOffset||!Bt(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.parent.isBlock)return!1;if(t){let o=r.parentOffset==r.parent.content.size,i=e.tr;(e.selection instanceof sn||e.selection instanceof hn)&&i.deleteSelection();let s=0==n.depth?null:is(n.node(-1).contentMatchAt(n.indexAfter(-1))),l=as&&as(r.parent,o,n),a=l?[l]:o&&s?[{type:s}]:void 0,c=Bt(i.doc,i.mapping.map(n.pos),1,a);if(a||c||!Bt(i.doc,i.mapping.map(n.pos),1,s?[{type:s}]:void 0)||(s&&(a=[{type:s}]),c=!0),c&&(i.split(i.mapping.map(n.pos),1,a),!o&&!n.parentOffset&&n.parent.type!=s)){let e=i.mapping.map(n.before()),t=i.doc.resolve(e);s&&n.node(-1).canReplaceWith(t.index(),t.index()+1,s)&&i.setNodeMarkup(i.mapping.map(n.before()),s)}t(i.scrollIntoView())}return!0};var as;function cs(e,t,n,r){let o,i,s=t.nodeBefore,l=t.nodeAfter,a=s.type.spec.isolating||l.type.spec.isolating;if(!a&&function(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(i,i+1)||!o.isTextblock&&!Vt(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 c=!a&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(o=(i=s.contentMatchAt(s.childCount)).findWrapping(l.type))&&i.matchType(o[0]||l.type).validEnd){if(n){let r=t.pos+l.nodeSize,i=ue.empty;for(let e=o.length-1;e>=0;e--)i=ue.from(o[e].create(null,i));i=ue.from(s.copy(i));let a=e.tr.step(new Et(t.pos-1,r,t.pos,r,new ye(i,1,0),o.length,!0)),c=r+2*o.length;Vt(a.doc,c)&&a.join(c),n(a.scrollIntoView())}return!0}let h=l.type.spec.isolating||r>0&&a?null:tn.findFrom(t,1),u=h&&h.$from.blockRange(h.$to),d=u&&Rt(u);if(null!=d&&d>=t.depth)return n&&n(e.tr.lift(u,d).scrollIntoView()),!0;if(c&&es(l,"start",!0)&&es(s,"end")){let r=s,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let i=l,a=1;for(;!i.isTextblock;i=i.firstChild)a++;if(r.canReplace(r.childCount,r.childCount,i.content)){if(n){let r=ue.empty;for(let e=o.length-1;e>=0;e--)r=ue.from(o[e].copy(r));n(e.tr.step(new Et(t.pos-o.length,t.pos+l.nodeSize,t.pos+a,t.pos+l.nodeSize-a,new ye(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function hs(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(sn.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}const us=hs(-1),ds=hs(1);function fs(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=s&&zt(s,e,t);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}}function ps(e,t=null){return function(n,r){let o=!1;for(let i=0;i{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)o=!0;else{let t=n.doc.resolve(i),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}}))}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r{if(l||!r&&e.isAtom&&e.isInline&&t>=i.pos&&t+e.nodeSize<=s.pos)return!1;l=e.inlineContent&&e.type.allowsMarkType(n)})),l)return!0}return!1}(n.doc,a,e,o))return!1;if(i)if(l)e.isInSet(n.storedMarks||l.marks())?i(n.tr.removeStoredMark(e)):i(n.tr.addStoredMark(e.create(t)));else{let s,l=n.tr;o||(a=function(e){let t=[];for(let n=0;n{if(e.isAtom&&e.content.size&&e.isInline&&n>=r.pos&&n+e.nodeSize<=o.pos)return n+1>r.pos&&t.push(new nn(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+e.content.size),!1})),r.posn.doc.rangeHasMark(t.$from.pos,t.$to.pos,e))):!a.every((t=>{let n=!1;return l.doc.nodesBetween(t.$from.pos,t.$to.pos,((r,o,i)=>{if(n)return!1;n=!e.isInSet(r.marks)&&!!i&&i.type.allowsMarkType(e)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,t.$from.pos-o),Math.min(r.nodeSize,t.$to.pos-o))))})),!n}));for(let n=0;n{let r=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}(e,n);if(!r)return!1;let o=ts(r);if(!o){let n=r.blockRange(),o=n&&Rt(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(cs(e,o,t,-1))return!0;if(0==r.parent.content.size&&(es(i,"end")||an.isSelectable(i)))for(let s=r.depth;;s--){let n=jt(e.doc,r.before(s),r.after(s),ye.empty);if(n&&n.slice.size1)break}return!(!i.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0)}),((e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=ts(r)}let s=i&&i.nodeBefore;return!(!s||!an.isSelectable(s))&&(t&&t(e.tr.setSelection(an.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)})),vs=gs(Qi,((e,t,n)=>{let r=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset{let{$head:r,empty:o}=e.selection,i=r;if(!o)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:o}=n;if(n instanceof hn||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=is(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.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(Bt(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Rt(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)}),ls),"Mod-Enter":ss,Backspace:ys,"Mod-Backspace":ys,"Shift-Backspace":ys,Delete:vs,"Mod-Delete":vs,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new hn(e.doc))),!0)},bs={"Ctrl-h":ws.Backspace,"Alt-Backspace":ws["Mod-Backspace"],"Ctrl-d":ws.Delete,"Ctrl-Alt-Backspace":ws["Mod-Delete"],"Alt-Delete":ws["Mod-Delete"],"Alt-d":ws["Mod-Delete"],"Ctrl-a":us,"Ctrl-e":ds};for(let os in ws)bs[os]=ws[os];const xs=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?bs:ws;class Ss{constructor(e,t,n={}){var r;this.match=e,this.match=e,this.handler="string"==typeof t?(r=t,function(e,t,n,o){let i=r;if(t[1]){let e=t[0].lastIndexOf(t[1]);i+=t[0].slice(e+t[1].length);let r=(n+=e)-o;r>0&&(i=t[0].slice(e-r,e)+i,n=o)}return e.tr.insertText(i,n,o)}):t,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1}}const ks=500;function Ms({rules:e}){let t=new xn({state:{init:()=>null,apply(e,t){let n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(n,r,o,i)=>Os(n,r,o,i,e,t),handleDOMEvents:{compositionend:n=>{setTimeout((()=>{let{$cursor:r}=n.state.selection;r&&Os(n,r.pos,r.pos,"",e,t)}))}}},isInputRules:!0});return t}function Os(e,t,n,r,o,i){if(e.composing)return!1;let s=e.state,l=s.doc.resolve(t),a=l.parent.textBetween(Math.max(0,l.parentOffset-ks),l.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(o.text){let t=n.doc.resolve(o.from).marks();n.replaceWith(o.from,o.to,e.schema.text(o.text,t))}else n.delete(o.from,o.to);t(n)}return!0}}return!1};function Ns(e,t,n=null,r){return new Ss(e,((e,o,i,s)=>{let l=n instanceof Function?n(o):n,a=e.tr.delete(i,s),c=a.doc.resolve(i).blockRange(),h=c&&zt(c,t,l);if(!h)return null;a.wrap(c,h);let u=a.doc.resolve(i-1).nodeBefore;return u&&u.type==t&&Vt(a.doc,i-1)&&(!r||r(o,u))&&a.join(i-1),a}))}function Ds(e,t,n=null){return new Ss(e,((e,r,o,i)=>{let s=e.doc.resolve(o),l=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(o,i).setBlockType(o,o,t,l):null}))}new Ss(/--$/,"—"),new Ss(/\.\.\.$/,"…"),new Ss(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new Ss(/"$/,"”"),new Ss(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new Ss(/'$/,"’");const Ts=["ol",0],As=["ul",0],$s=["li",0],Es={attrs:{order:{default:1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs:e=>({order:e.hasAttribute("start")?+e.getAttribute("start"):1})}],toDOM:e=>1==e.attrs.order?Ts:["ol",{start:e.attrs.order},0]},Ps={parseDOM:[{tag:"ul"}],toDOM:()=>As},Is={parseDOM:[{tag:"li"}],toDOM:()=>$s,defining:!0};function Rs(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 zs(e,t,n){return e.append({ordered_list:Rs(Es,{content:"list_item+",group:n}),bullet_list:Rs(Ps,{content:"list_item+",group:n}),list_item:Rs(Is,{content:t})})}function _s(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=!1,a=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;let e=n.doc.resolve(s.start-2);a=new Pe(e,e,s.depth),s.endIndex=0;h--)i=ue.from(n[h].type.create(n[h].attrs,i));e.step(new Et(t.start-(r?2:0),t.end,t.start,t.end,new ye(i,0,0),n.length,!0));let s=0;for(let h=0;h=o.depth-3;e--)t=ue.from(o.node(e).copy(t));let s=o.indexAfter(-1){if(c>-1)return!1;e.isTextblock&&0==e.content.size&&(c=t+1)})),c>-1&&a.setSelection(tn.near(a.doc.resolve(c))),r(a.scrollIntoView())}return!0}let a=i.pos==o.end()?l.contentMatchAt(0).defaultType:null,c=n.tr.delete(o.pos,i.pos),h=a?[t?{type:e,attrs:t}:null,{type:a}]:void 0;return!!Bt(c.doc,o.pos,2,h)&&(r&&r(c.split(o.pos,2,h).scrollIntoView()),!0)}}function Vs(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));return!!i&&(!n||(r.node(i.depth-1).type==e?function(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);im;p--)f-=o.child(p).nodeSize,r.delete(f-1,f+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=0==n.startIndex,a=n.endIndex==o.childCount,c=i.node(-1),h=i.index(-1);if(!c.canReplace(h+(l?0:1),h+1,s.content.append(a?ue.empty:ue.from(o))))return!1;let u=i.pos,d=u+s.nodeSize;return r.step(new Et(u-(l?1:0),d+(a?1:0),u+1,d-1,new ye((l?ue.empty:ue.from(o.copy(ue.empty))).append(a?ue.empty:ue.from(o.copy(ue.empty))),l?0:1,a?0:1),l?0:1)),t(r.scrollIntoView()),!0}(t,n,i)))}}function js(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let l=i.parent,a=l.child(s-1);if(a.type!=e)return!1;if(n){let r=a.lastChild&&a.lastChild.type==l.type,o=ue.from(r?e.create():null),s=new ye(ue.from(e.create(null,ue.from(l.type.create(null,o)))),r?3:1,0),c=i.start,h=i.end;n(t.tr.step(new Et(c-(r?3:1),h,c,h,s,1,!0)).scrollIntoView())}return!0}}var Fs=200,Ls=function(){};Ls.prototype.append=function(e){return e.length?(e=Ls.from(e),!this.length&&e||e.length=t?Ls.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ls.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ls.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)},Ls.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},Ls.from=function(e){return e instanceof Ls?e:e&&e.length?new Ws(e):Ls.empty};var Ws=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 o=t;o=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Fs)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Fs)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}(Ls);Ls.empty=new Ws([]);var qs=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 eo&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(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}(Ls),Js=Ls;class Ks{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}t&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,l=e.tr,a=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(o,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new Hs(e.map));let t,o=e.step.map(n.slice(r));o&&l.maybeStep(o).doc&&(t=l.mapping.maps[l.mapping.maps.length-1],a.push(new Hs(t,void 0,void 0,a.length+c.length))),r--,t&&n.appendMap(t,r)}else l.maybeStep(e.step);return e.selection?(i=n?e.selection.map(n.slice(r)):e.selection,s=new Ks(this.items.slice(0,o).append(c.reverse().concat(a)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:i}}addTransform(e,t,n,r){let o=[],i=this.eventCount,s=this.items,l=!r&&s.length?s.get(s.length-1):null;for(let c=0;cUs&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,a),i-=a),new Ks(s.append(o),i)}remapping(e,t){let n=new St;return this.items.forEach(((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new Ks(this.items.append(e.map((e=>new Hs(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let l=t;this.items.forEach((t=>{let r=o.getMirror(--l);if(null==r)return;i=Math.min(i,r);let a=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(o.slice(l+1,r));c&&s++,n.push(new Hs(a,i,c))}else n.push(new Hs(a))}),r);let a=[];for(let u=t;u500&&(h=h.compress(this.items.length-n.length)),h}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=[],o=0;return this.items.forEach(((i,s)=>{if(s>=e)r.push(i),i.selection&&o++;else if(i.step){let e=i.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let l=i.selection&&i.selection.map(t.slice(n));l&&o++;let a,c=new Hs(s.invert(),e,l),h=r.length-1;(a=r.length&&r[h].merge(c))?r[h]=a:r.push(c)}}else i.map&&n--}),this.items.length,0),new Ks(Js.from(r.reverse()),o)}}Ks.empty=new Ks(Js.empty,0);class Hs{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 Hs(t.getMap().invert(),t,this.selection)}}}class Ys{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const Us=20;function Gs(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach(((e,n,r,o)=>t.push(r,o)));return t}function Zs(e,t){if(!e)return null;let n=[];for(let r=0;rnew Ys(Ks.empty,Ks.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let o,i=n.getMeta(tl);if(i)return i.historyState;n.getMeta(nl)&&(e=new Ys(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(tl))return s.getMeta(tl).redo?new Ys(e.done.addTransform(n,void 0,r,el(t)),e.undone,Gs(n.mapping.maps),e.prevTime,e.prevComposition):new Ys(e.done,e.undone.addTransform(n,void 0,r,el(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new Ys(e.done.rebased(n,o),e.undone.rebased(n,o),Zs(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Ys(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Zs(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),i=0==e.prevTime||!s&&e.prevComposition!=o&&(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 o=0;o=t[o]&&(n=!0)})),n}(n,e.prevRanges)),l=s?Zs(e.prevRanges,n.mapping):Gs(n.mapping.maps);return new Ys(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,el(t)),Ks.empty,l,n.time,null==o?e.prevComposition:o)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?il:"historyRedo"==n?sl:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function ol(e,t){return(n,r)=>{let o=tl.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let i=function(e,t,n){let r=el(t),o=tl.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),l=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),a=new Ys(n?l:i.remaining,n?i.remaining:l,null,0,-1);return i.transform.setSelection(s).setMeta(tl,{redo:n,historyState:a})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}const il=ol(!1,!0),sl=ol(!0,!0);function ll(e){let t=tl.getState(e);return t?t.done.eventCount:0}function al(e){let t=tl.getState(e);return t?t.undone.eventCount:0} +"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t={},n={},r={},o={},i={};function s(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 l(e){for(var t=1;t=+n}))};var M={};Object.defineProperty(M,"__esModule",{value:!0}),M.default=void 0;var O=(0,r.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);M.default=O;var C={};Object.defineProperty(C,"__esModule",{value:!0}),C.default=void 0;var N=r,D=(0,N.withParams)({type:"ipAddress"},(function(e){if(!(0,N.req)(e))return!0;if("string"!=typeof e)return!1;var t=e.split(".");return 4===t.length&&t.every(T)}));C.default=D;var T=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},A={};Object.defineProperty(A,"__esModule",{value:!0}),A.default=void 0;var $=r;A.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":";return(0,$.withParams)({type:"macAddress"},(function(t){if(!(0,$.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(E)}))};var E=function(e){return e.toLowerCase().match(/^[0-9a-f]{2}$/)},P={};Object.defineProperty(P,"__esModule",{value:!0}),P.default=void 0;var I=r;P.default=function(e){return(0,I.withParams)({type:"maxLength",max:e},(function(t){return!(0,I.req)(t)||(0,I.len)(t)<=e}))};var R={};Object.defineProperty(R,"__esModule",{value:!0}),R.default=void 0;var z=r;R.default=function(e){return(0,z.withParams)({type:"minLength",min:e},(function(t){return!(0,z.req)(t)||(0,z.len)(t)>=e}))};var _={};Object.defineProperty(_,"__esModule",{value:!0}),_.default=void 0;var B=r,V=(0,B.withParams)({type:"required"},(function(e){return(0,B.req)("string"==typeof e?e.trim():e)}));_.default=V;var j={};Object.defineProperty(j,"__esModule",{value:!0}),j.default=void 0;var F=r;j.default=function(e){return(0,F.withParams)({type:"requiredIf",prop:e},(function(t,n){return!(0,F.ref)(e,this,n)||(0,F.req)(t)}))};var L={};Object.defineProperty(L,"__esModule",{value:!0}),L.default=void 0;var W=r;L.default=function(e){return(0,W.withParams)({type:"requiredUnless",prop:e},(function(t,n){return!!(0,W.ref)(e,this,n)||(0,W.req)(t)}))};var q={};Object.defineProperty(q,"__esModule",{value:!0}),q.default=void 0;var J=r;q.default=function(e){return(0,J.withParams)({type:"sameAs",eq:e},(function(t,n){return t===(0,J.ref)(e,this,n)}))};var K={};Object.defineProperty(K,"__esModule",{value:!0}),K.default=void 0;var H=(0,r.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);K.default=H;var Y={};Object.defineProperty(Y,"__esModule",{value:!0}),Y.default=void 0;var U=r;Y.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 G={};Object.defineProperty(G,"__esModule",{value:!0}),G.default=void 0;var Z=r;G.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 X={};Object.defineProperty(X,"__esModule",{value:!0}),X.default=void 0;var Q=r;X.default=function(e){return(0,Q.withParams)({type:"not"},(function(t,n){return!(0,Q.req)(t)||!e.call(this,t,n)}))};var ee={};Object.defineProperty(ee,"__esModule",{value:!0}),ee.default=void 0;var te=r;ee.default=function(e){return(0,te.withParams)({type:"minValue",min:e},(function(t){return!(0,te.req)(t)||(!/\s/.test(t)||t instanceof Date)&&+t>=+e}))};var ne={};Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var re=r;ne.default=function(e){return(0,re.withParams)({type:"maxValue",max:e},(function(t){return!(0,re.req)(t)||(!/\s/.test(t)||t instanceof Date)&&+t<=+e}))};var oe={};Object.defineProperty(oe,"__esModule",{value:!0}),oe.default=void 0;var ie=(0,r.regex)("integer",/(^[0-9]*$)|(^-[0-9]+$)/);oe.default=ie;var se={};Object.defineProperty(se,"__esModule",{value:!0}),se.default=void 0;var le=(0,r.regex)("decimal",/^[-]?\d*(\.\d+)?$/);function ae(e){this.content=e}function ce(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let e=0;o.text[e]==i.text[e];e++)n++;return n}if(o.content.size||i.content.size){let e=ce(o.content,i.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function he(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=e.child(--o),l=t.child(--i),a=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let e=0,t=Math.min(s.text.length,l.text.length);for(;e>1}},ae.from=function(e){if(e instanceof ae)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new ae(t)};class ue{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let n=0;ne&&!1!==n(l,r+s,o||null,i)&&l.content.size){let o=s+1;l.nodesBetween(Math.max(0,e-o),Math.min(l.content.size,t-o),n,r+o)}s=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,((s,l)=>{let a=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&a||s.isTextblock)&&n&&(i?i=!1:o+=n),o+=a}),0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);oe)for(let o=0,i=0;ie&&((it)&&(s=s.isText?s.cut(Math.max(0,e-i),Math.min(s.text.length,t-i)):s.cut(Math.max(0,e-i-1),Math.min(s.content.size,t-i-1))),n.push(s),r+=s.nodeSize),i=l}return new ue(n,r)}cutByIndex(e,t){return e==t?ue.empty:0==e&&t==this.content.length?this:new ue(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new ue(r,o)}addToStart(e){return new ue([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ue(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 o=r+this.child(n).nodeSize;if(o>=e)return o==e||t>0?fe(n+1,o):fe(n,r);r=o}}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 ue.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ue(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ue.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(o)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;te.type.rank-t.type.rank)),t}}me.none=[];class ge extends Error{}class ye{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=we(this.content,e+this.openStart,t);return n&&new ye(n,this.openStart,this.openEnd)}removeBetween(e,t){return new ye(ve(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 ye.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 ye(ue.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)n++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)r++;return new ye(e,n,r)}}function ve(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:l}=e.findIndex(n);if(o==t||i.isText){if(l!=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,i.copy(ve(i.content,t-o-1,n-o-1)))}function we(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return e.cut(0,t).append(n).append(e.cut(t));let l=we(s.content,t-i-1,n);return l&&e.replaceChild(o,s.copy(l))}function be(e,t,n){if(n.openStart>e.depth)throw new ge("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ge("Inconsistent open depths");return xe(e,t,n,0)}function xe(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r=0;o--)r=t.node(o).copy(ue.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Ce(i,Ne(e,o,s,t,r))}{let r=e.parent,o=r.content;return Ce(r,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return Ce(i,De(e,t,r))}function Se(e,t){if(!t.type.compatibleContent(e.type))throw new ge("Cannot join "+t.type.name+" onto "+e.type.name)}function ke(e,t,n){let r=e.node(n);return Se(r,t.node(n)),r}function Me(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 Oe(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(Me(e.nodeAfter,r),i++));for(let l=i;lo&&ke(e,t,o+1),s=r.depth>o&&ke(n,r,o+1),l=[];return Oe(null,e,o,l),i&&s&&t.index(o)==n.index(o)?(Se(i,s),Me(Ce(i,Ne(e,t,n,r,o+1)),l)):(i&&Me(Ce(i,De(e,t,o+1)),l),Oe(t,n,o,l),s&&Me(Ce(s,De(n,r,o+1)),l)),Oe(r,null,o,l),new ue(l)}function De(e,t,n){let r=[];if(Oe(null,e,n,r),e.depth>n){Me(Ce(ke(e,t,n+1),De(e,t,n+1)),r)}return Oe(t,null,n,r),new ue(r)}ye.empty=new ye(ue.empty,0,0);class Te{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 o=0;o0;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 Pe(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,o=t;for(let i=e;;){let{index:e,offset:t}=i.content.findIndex(o),s=o-t;if(n.push(i,e,r+t),!s)break;if(i=i.child(e),i.isText)break;o=s-1,r+=t+1}return new Te(t,n,o)}static resolveCached(e,t){let n=Ee.get(e);if(n)for(let o=0;oe&&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()+")"),_e(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=ue.empty,r=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let l=r;le.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;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=ue.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,r,n);return o.type.checkAttrs(o.attrs),o}}Re.prototype.text=void 0;class ze extends Re{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):_e(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 ze(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ze(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 _e(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Be{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new Ve(e,t);if(null==n.next)return Be.empty;let r=je(n);n.next&&n.err("Unexpected trailing text");let o=function(e){let t=Object.create(null);return n(Ke(e,0));function n(r){let o=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let i=t[r.join(",")]=new Be(r.indexOf(e.length-1)>-1);for(let e=0;ee.to=t))}function i(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(i(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),o(i(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return o(i(e.expr,t),s),o(i(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(i(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 o=0;o"+e.indexOf(t.next[o].next);return r})).join("\n")}}Be.empty=new Be(!0);class Ve{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 je(e){let t=[];do{t.push(Fe(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Fe(e){let t=[];do{t.push(Le(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Le(e){let t=function(e){if(e.eat("(")){let t=je(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 o=[];for(let i in n){let e=n[i];e.groups.indexOf(t)>-1&&o.push(e)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(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=qe(e,t)}return t}function We(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function qe(e,t){let n=We(e),r=n;return e.eat(",")&&(r="}"!=e.next?We(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function Je(e,t){return t-e}function Ke(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;tr[t]=new e(t,n,o)));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let e in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Xe{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let o=null===n?"null":typeof n;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Qe{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Ge(e,r.attrs),this.excluded=null;let o=He(this.attrs);this.instance=o?new me(this,o):null}create(e=null){return!e&&this.instance?this.instance:new me(this,Ye(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,o)=>n[e]=new Qe(e,r++,t,o))),n}removeFromSet(e){for(var t=0;t-1}}class et{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let r in e)t[r]=e[r];t.nodes=ae.from(e.nodes),t.marks=ae.from(e.marks||{}),this.nodes=Ze.compile(this.spec.nodes,this),this.marks=Qe.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let e=this.nodes[r],t=e.spec.content||"",o=e.spec.marks;if(e.contentMatch=n[t]||(n[t]=Be.parse(t,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!e.isInline||!e.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=e}e.markSet="_"==o?null:o?tt(this,o.split(" ")):""!=o&&e.inlineContent?null:[]}for(let r in this.marks){let e=this.marks[r],t=e.spec.excludes;e.excluded=null==t?[e]:""==t?[]:tt(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 Ze))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 ze(n,n.defaultAttrs,e,me.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Re.fromJSON(this,e)}markFromJSON(e){return me.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function tt(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 nt{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach((e=>{if(function(e){return null!=e.tag}(e))this.tags.push(e);else if(function(e){return null!=e.style}(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),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 at(this,t,!1);return n.addAll(e,me.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new at(this,t,!0);return n.addAll(e,me.none,t.from,t.to),ye.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;re.length&&(61!=i.charCodeAt(e.length)||i.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=ht(e)),e.mark||e.ignore||e.clearMark||(e.mark=r)}))}for(let r in e.nodes){let t=e.nodes[r].spec.parseDOM;t&&t.forEach((e=>{n(e=ht(e)),e.node||e.ignore||e.mark||(e.node=r)}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new nt(e,nt.schemaRules(e)))}}const rt={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},ot={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},it={ol:!0,ul:!0};function st(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class lt{constructor(e,t,n,r,o,i){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=i,this.content=[],this.activeMarks=me.none,this.match=o||(4&i?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(ue.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=ue.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(ue.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!rt.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class at{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,o=t.topNode,i=st(null,t.preserveWhitespace,0)|(n?4:0);r=o?new lt(o.type,o.attrs,me.none,!0,t.topMatch||o.type.contentMatch,i):new lt(n?null:e.schema.topNodeType,null,me.none,!0,null,i),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top;if(2&r.options||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(1&r.options)n=2&r.options?n.replace(/\r\n?/g,"\n"):n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],o=e.previousSibling;(!t||o&&"BR"==o.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r,o=e.nodeName.toLowerCase();it.hasOwnProperty(o)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&it.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(r=this.parser.matchTag(e,this,n));if(i?i.ignore:ot.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let n,r=this.top,s=this.needsBlock;if(rt.hasOwnProperty(o))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),n=!0,r.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e,t);let l=i&&i.skip?t:this.readStyles(e,t);l&&this.addAll(e,l),n&&this.sync(r),this.needsBlock=s}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,i,n,!1===i.consuming?r:void 0)}}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let r=0;r!r.clearMark(e))):t.concat(this.parser.schema.marks[r.mark].create(r.attrs)),!1!==r.consuming)break;n=r}}return t}addElementByRule(e,t,n,r){let o,i;if(t.node)if(i=this.parser.schema.nodes[t.node],i.isLeaf)this.insertNode(i.create(t.attrs),n)||this.leafFallback(e,n);else{let e=this.enter(i,t.attrs||null,n,t.preserveWhitespace);e&&(o=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e,n)));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n)}o&&this.sync(s)&&this.open--}addAll(e,t,n,r){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,t);this.findAtPoint(e,o)}findPlace(e,t){let n,r;for(let o=this.open;o>=0;o--){let t=this.nodes[o],i=t.findWrapping(e);if(i&&(!n||n.length>i.length)&&(n=i,r=t,!i.length))break;if(t.solid)break}if(!n)return null;this.sync(r);for(let o=0;o!(i.type?i.type.allowsMarkType(t.type):ut(t.type,e))||(l=t.addToSet(l),!1))),this.nodes.push(new lt(e,t,l,r,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.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),o=-(n?n.depth+1:0)+(r?0:1),i=(e,s)=>{for(;e>=0;e--){let l=t[e];if(""==l){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(i(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!e||e.name!=l&&-1==e.groups.indexOf(l))return!1;s--}}return!0};return i(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}}}function ct(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ht(e){let t={};for(let n in e)t[n]=e[n];return t}function ut(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=e=>{i.push(e);for(let n=0;n{if(o.length||e.marks.length){let n=0,i=0;for(;n=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&yt(pt(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return yt(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new dt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=ft(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return ft(e.marks)}}function ft(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function pt(e){return e.document||window.document}const mt=new WeakMap;function gt(e){let t=mt.get(e);return void 0===t&&mt.set(e,t=function(e){let t=null;function n(e){if(e&&"object"==typeof e)if(Array.isArray(e))if("string"==typeof e[0])t||(t=[]),t.push(e);else for(let t=0;t-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s,l=i.indexOf(" ");l>0&&(n=i.slice(0,l),i=i.slice(l+1));let a=n?e.createElementNS(n,i):e.createElement(i),c=t[1],h=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){h=2;for(let e in c)if(null!=c[e]){let t=e.indexOf(" ");t>0?a.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):a.setAttribute(e,c[e])}}for(let u=h;uh)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}{let{dom:t,contentDOM:i}=yt(e,o,n,r);if(a.appendChild(t),i){if(s)throw new RangeError("Multiple content holes");s=i}}}return{dom:a,contentDOM:s}}const vt=Math.pow(2,16);function wt(e){return 65535&e}class bt{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class xt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&xt.empty)return xt.empty}recover(e){let t=0,n=wt(e);if(!this.inverted)for(let r=0;re)break;let a=this.ranges[s+o],c=this.ranges[s+i],h=l+a;if(e<=h){let o=l+r+((a?e==l?-1:e==h?1:t:t)<0?0:c);if(n)return o;let i=e==(t<0?l:h)?null:s/3+(e-l)*vt,u=e==l?2:e==h?1:4;return(t<0?e!=l:e!=h)&&(u|=8),new bt(o,u,i)}r+=c-a}return n?e+r:new bt(e+r,0,null)}touches(e,t){let n=0,r=wt(t),o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;se)break;let l=this.ranges[s+o];if(e<=t+l&&s==3*r)return!0;n+=this.ranges[s+i]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=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 St;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;no&&te.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return Ot.fromReplace(e,this.from,this.to,o)}invert(){return new Dt(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 Nt(t.pos,n.pos,this.mark)}merge(e){return e instanceof Nt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Nt(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 Nt(t.from,t.to,e.markFromJSON(t.mark))}}Mt.jsonID("addMark",Nt);class Dt extends Mt{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 ye(Ct(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Ot.fromReplace(e,this.from,this.to,n)}invert(){return new Nt(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 Dt(t.pos,n.pos,this.mark)}merge(e){return e instanceof Dt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Dt(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 Dt(t.from,t.to,e.markFromJSON(t.mark))}}Mt.jsonID("removeMark",Dt);class Tt extends Mt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ot.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ot.fromReplace(e,this.pos,this.pos+1,new ye(ue.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;nn.pos?null:new Et(t.pos,n.pos,r,o,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 Et(t.from,t.to,t.gapFrom,t.gapTo,ye.fromJSON(e,t.slice),t.insert,!!t.structure)}}function Pt(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function It(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Rt(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(ni;c--,h--){let e=o.node(c),t=o.index(c);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount),i=r&&r[h+1];i&&(n=n.replaceChild(0,i.type.create(i.attrs)));let s=r&&r[h]||e;if(!e.canReplace(t+1,e.childCount)||!s.type.validContent(n))return!1}let l=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(l,l,a?a.type:o.node(i+1).type)}function Vt(e,t){let n=e.resolve(t),r=n.index();return o=n.nodeBefore,i=n.nodeAfter,!(!o||!i||o.isLeaf||!o.canAppend(i))&&n.parent.canReplace(r,r+1);var o,i}function jt(e,t,n=t,r=ye.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return Ft(o,i,r)?new $t(t,n,r):new Lt(o,i,r).fit()}function Ft(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Mt.jsonID("replaceAround",Et);class Lt{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=ue.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=ue.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 o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let l=new ye(o,i,s);return e>-1?new Et(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new $t(n.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Jt(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let o=e.firstChild;for(let i=this.depth;i>=0;i--){let e,{type:s,match:l}=this.frontier[i],a=null;if(1==t&&(o?l.matchType(o.type)||(a=l.fillBefore(ue.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:i,parent:r,inject:a};if(2==t&&o&&(e=l.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:i,parent:r,wrap:e};if(r&&l.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Jt(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new ye(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=Jt(e,t);if(r.childCount<=1&&t>0){let o=e.size-t<=t+r.size;this.unplaced=new ye(Wt(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new ye(Wt(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let p=0;p1||0==l||e.content.size)&&(h=t,c.push(Kt(e.mark(u.allowedMarks(e.marks)),1==a?l:0,a==s.childCount?d:-1)))}let f=a==s.childCount;f||(d=-1),this.placed=qt(this.placed,t,ue.from(c)),this.frontier[t].match=h,f&&d<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],o=t=0;n--){let{match:t,type:r}=this.frontier[n],o=Ht(e,n,r,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:i,move:o?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=qt(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=qt(this.placed,this.depth,ue.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(ue.empty,!0);e.childCount&&(this.placed=qt(this.placed,this.frontier.length,e))}}function Wt(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Wt(e.firstChild.content,t-1,n)))}function qt(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(qt(e.lastChild.content,t-1,n)))}function Jt(e,t){for(let n=0;n1&&(r=r.replaceChild(0,Kt(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(ue.empty,!0)))),e.copy(r)}function Ht(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,s);return l&&!function(e,t,n){for(let r=n;rr){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(ue.empty,!0))}return e}function Gt(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let o=e.start(r);if(ot.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}class Zt extends Mt{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ot.fail("No node at attribute step's position");let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Ot.fromReplace(e,this.pos,this.pos+1,new ye(ue.from(r),0,t.isLeaf?0:1))}getMap(){return xt.empty}invert(e){return new Zt(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Zt(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Zt(t.pos,t.attr,t.value)}}Mt.jsonID("attr",Zt);let Xt=class extends Error{};Xt=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Xt.prototype=Object.create(Error.prototype)).constructor=Xt,Xt.prototype.name="TransformError";class Qt{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new St}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Xt(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=ye.empty){let r=jt(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new ye(ue.from(n),0,0))}delete(e,t){return this.replace(e,t,ye.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 o=e.doc.resolve(t),i=e.doc.resolve(n);if(Ft(o,i,r))return e.step(new $t(t,n,r));let s=Gt(o,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let l=-(o.depth+1);s.unshift(l);for(let d=o.depth,f=o.pos-1;d>0;d--,f--){let e=o.node(d).type.spec;if(e.defining||e.definingAsContext||e.isolating)break;s.indexOf(d)>-1?l=d:o.before(d)==f&&s.splice(1,0,-d)}let a=s.indexOf(l),c=[],h=r.openStart;for(let d=r.content,f=0;;f++){let e=d.firstChild;if(c.push(e),f==r.openStart)break;d=e.content}for(let d=h-1;d>=0;d--){let e=c[d].type,t=Yt(e);if(t&&o.node(a).type!=e)h=d;else if(t||!e.isTextblock)break}for(let d=r.openStart;d>=0;d--){let t=(d+h+1)%(r.openStart+1),l=c[t];if(l)for(let c=0;c=0&&(e.replace(t,n,r),!(e.steps.length>u));d--){let e=s[d];e<0||(t=o.before(e),n=i.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 o=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 o=r.depth-1;o>=0;o--){let e=r.index(o);if(r.node(o).canReplaceWith(e,e,n))return r.before(o+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let e=r.indexAfter(o);if(r.node(o).canReplaceWith(e,e,n))return r.after(o+1);if(e0&&(n||r.node(t-1).canReplace(r.index(t-1),o.indexAfter(t-1))))return e.delete(r.before(t),o.after(t))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.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:o,depth:i}=t,s=r.before(i+1),l=o.after(i+1),a=s,c=l,h=ue.empty,u=0;for(let p=i,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,h=ue.from(r.node(p).copy(h)),u++):a--;let d=ue.empty,f=0;for(let p=i,m=!1;p>n;p--)m||o.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=ue.from(n[s].type.create(n[s].attrs,r))}let o=t.start,i=t.end;e.step(new Et(o,i,o,i,new ye(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,o)&&function(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(i).map(n),r)){e.clearIncompatible(e.mapping.slice(i).map(n,1),r);let s=e.mapping.slice(i),l=s.map(n,1),a=s.map(n+t.nodeSize,1);return e.step(new Et(l,a,l+1,a-1,new ye(ue.from(r.create(o,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,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Et(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new ye(ue.from(s),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Zt(e,t,n)),this}addNodeMark(e,t){return this.step(new Tt(e,t)),this}removeNodeMark(e,t){if(!(t instanceof me)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new At(e,t)),this}split(e,t=1,n){return function(e,t,n=1,r){let o=e.doc.resolve(t),i=ue.empty,s=ue.empty;for(let l=o.depth,a=o.depth-n,c=n-1;l>a;l--,c--){i=ue.from(o.node(l).copy(i));let e=r&&r[c];s=ue.from(e?e.type.create(e.attrs,s):o.node(l).copy(s))}e.step(new $t(t,t,new ye(i.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let o,i,s=[],l=[];e.doc.nodesBetween(t,n,((e,a,c)=>{if(!e.isInline)return;let h=e.marks;if(!r.isInSet(h)&&c.type.allowsMarkType(r.type)){let c=Math.max(a,t),u=Math.min(a+e.nodeSize,n),d=r.addToSet(h);for(let e=0;ee.step(t))),l.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let o=[],i=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;i++;let l=null;if(r instanceof Qe){let t,n=e.marks;for(;t=r.isInSet(n);)(l||(l=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(l=[r]):l=e.marks;if(l&&l.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;ee.step(new Dt(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,r=n.contentMatch){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let l=0;l=0;l--)e.step(i[l])}(this,e,t,n),this}}const en=Object.create(null);class tn{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new nn(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;o--){let r=t<0?dn(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):dn(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(r)return r}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new hn(e.node(0))}static atStart(e){return dn(e,e,0,0,1)||new hn(e)}static atEnd(e){return dn(e,e,e.content.size,e.childCount,-1)||new hn(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=en[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 en)throw new RangeError("Duplicate use of selection JSON ID "+e);return en[e]=t,t.prototype.jsonID=e,t}getBookmark(){return sn.between(this.$anchor,this.$head).getBookmark()}}tn.prototype.visible=!0;class nn{constructor(e,t){this.$from=e,this.$to=t}}let rn=!1;function on(e){rn||e.parent.inlineContent||(rn=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class sn extends tn{constructor(e,t=e){on(e),on(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 tn.near(n);let r=e.resolve(t.map(this.anchor));return new sn(r.parent.inlineContent?r:n,n)}replace(e,t=ye.empty){if(super.replace(e,t),t==ye.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof sn&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ln(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 sn(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=tn.findFrom(t,n,!0)||tn.findFrom(t,-n,!0);if(!e)return tn.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(tn.findFrom(e,-n,!0)||tn.findFrom(e,n,!0)).$anchor).posnew hn(e)};function dn(e,t,n,r,o,i=!1){if(t.inlineContent)return sn.create(e,n);for(let s=r-(o>0?0:1);o>0?s=0;s+=o){let r=t.child(s);if(r.isAtom){if(!i&&an.isSelectable(r))return an.create(e,n-(o<0?r.nodeSize:0))}else{let t=dn(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function fn(e,t,n){let r=e.steps.length-1;if(r{null==o&&(o=r)})),e.setSelection(tn.near(e.doc.resolve(o),n)))}class pn extends Qt{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 me.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)||me.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 o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(tn.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 mn(e,t){return t&&e?e.bind(t):e}class gn{constructor(e,t,n){this.name=e,this.init=mn(t.init,n),this.apply=mn(t.apply,n)}}const yn=[new gn("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new gn("selection",{init:(e,t)=>e.selection||tn.atStart(t.doc),apply:e=>e.selection}),new gn("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new gn("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class vn{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=yn.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 gn(e.key,e.spec.state,e))}))}}class wn{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],o=r.spec.state;o&&o.toJSON&&(t[n]=o.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 vn(e.schema,e.plugins),o=new wn(r);return r.fields.forEach((r=>{if("doc"==r.name)o.doc=Re.fromJSON(e.schema,t.doc);else if("selection"==r.name)o.selection=tn.fromJSON(o.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let i in n){let s=n[i],l=s.spec.state;if(s.key==r.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,i))return void(o[r.name]=l.fromJSON.call(s,e,t[i],o))}o[r.name]=r.init(e,o)}})),o}}function bn(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=bn(o,t,{})),n[r]=o}return n}class xn{constructor(e){this.spec=e,this.props={},e.props&&bn(e.props,this,this.props),this.key=e.key?e.key.key:kn("plugin")}getState(e){return e[this.key]}}const Sn=Object.create(null);function kn(e){return e in Sn?e+"$"+ ++Sn[e]:(Sn[e]=0,e+"$")}class Mn{constructor(e="key"){this.key=kn(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const On=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Cn=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let Nn=null;const Dn=function(e,t,n){let r=Nn||(Nn=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Tn=function(e,t,n,r){return n&&($n(e,t,n,r,-1)||$n(e,t,n,r,1))},An=/^(img|br|input|textarea|hr)$/i;function $n(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:En(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Pn(e)||An.test(e.nodeName)||"false"==e.contentEditable)return!1;t=On(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?En(e):0}}}function En(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Pn(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 In=function(e){return e.focusNode&&Tn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Rn(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const zn="undefined"!=typeof navigator?navigator:null,_n="undefined"!=typeof document?document:null,Bn=zn&&zn.userAgent||"",Vn=/Edge\/(\d+)/.exec(Bn),jn=/MSIE \d/.exec(Bn),Fn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Bn),Ln=!!(jn||Fn||Vn),Wn=jn?document.documentMode:Fn?+Fn[1]:Vn?+Vn[1]:0,qn=!Ln&&/gecko\/(\d+)/i.test(Bn);qn&&(/Firefox\/(\d+)/.exec(Bn)||[0,0])[1];const Jn=!Ln&&/Chrome\/(\d+)/.exec(Bn),Kn=!!Jn,Hn=Jn?+Jn[1]:0,Yn=!Ln&&!!zn&&/Apple Computer/.test(zn.vendor),Un=Yn&&(/Mobile\/\w+/.test(Bn)||!!zn&&zn.maxTouchPoints>2),Gn=Un||!!zn&&/Mac/.test(zn.platform),Zn=!!zn&&/Win/.test(zn.platform),Xn=/Android \d/.test(Bn),Qn=!!_n&&"webkitFontSmoothing"in _n.documentElement.style,er=Qn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function tr(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function nr(e,t){return"number"==typeof e?e:e[t]}function rr(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 or(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;s=Cn(s)){if(1!=s.nodeType)continue;let e=s,n=e==i.body,l=n?tr(i):rr(e),a=0,c=0;if(t.topl.bottom-nr(r,"bottom")&&(c=t.bottom-t.top>l.bottom-l.top?t.top+nr(o,"top")-l.top:t.bottom-l.bottom+nr(o,"bottom")),t.leftl.right-nr(r,"right")&&(a=t.right-l.right+nr(o,"right")),a||c)if(n)i.defaultView.scrollBy(a,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),a&&(e.scrollLeft+=a);let o=e.scrollLeft-n,i=e.scrollTop-r;t={left:t.left-o,top:t.top-i,right:t.right-o,bottom:t.bottom-i}}if(n||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function ir(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Cn(r));return t}function sr(e,t){for(let n=0;n=c){a=Math.max(f.bottom,a),c=Math.min(f.top,c);let e=f.left>t.left?f.left-t.left:f.right=(f.left+f.right)/2?1:0));continue}}else f.top>t.top&&!o&&f.left<=t.left&&f.right>=t.left&&(o=h,i={left:Math.max(f.left,Math.min(f.right,t.left)),top:f.top});!n&&(t.left>=f.right&&t.top>=f.top||t.left>=f.left&&t.top>=f.bottom)&&(l=u+1)}}return!n&&o&&(n=o,r=i,s=0),n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:e,offset:l}:ar(n,r)}function cr(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function hr(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&o++}let r;Qn&&o&&1==n.nodeType&&1==(r=n.childNodes[o-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=function(e,t,n,r){let o=-1;for(let i=t,s=!1;i!=e.dom;){let t=e.docView.nearestDesc(i,!0);if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent||!t.contentDOM)){let e=t.dom.getBoundingClientRect();if(t.node.isBlock&&t.parent&&(!s&&e.left>r.left||e.top>r.top?o=t.posBefore:(!s&&e.right-1?o:e.docView.posFromDOM(t,n,-1)}(e,n,o,t))}null==s&&(s=function(e,t,n){let{node:r,offset:o}=ar(t,n),i=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}(e,l,t));let a=e.docView.nearestDesc(l,!0);return{pos:s,inside:a?a.posAtStart-a.border:-1}}function dr(e){return e.top=0&&o==r.nodeValue.length?(e--,i=1):n<0?e--:t++,gr(fr(Dn(r,e,t),i),i<0)}{let e=fr(Dn(r,o,o),n);if(qn&&o&&/\s/.test(r.nodeValue[o-1])&&o=0)}if(null==i&&o&&(n<0||o==En(r))){let e=r.childNodes[o-1],t=3==e.nodeType?Dn(e,En(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return gr(fr(t,1),!1)}if(null==i&&o=0)}function gr(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 yr(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 vr(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}const wr=/[\u0590-\u08ac]/;let br=null,xr=null,Sr=!1;function kr(e,t,n){return br==t&&xr==n?Sr:(br=t,xr=n,Sr="up"==n||"down"==n?function(e,t,n){let r=t.selection,o="up"==n?r.$from:r.$to;return vr(e,t,(()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=mr(e,o.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=Dn(e,0,e.nodeValue.length).getClientRects()}for(let e=0;eo.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,l=e.domSelection();return l?wr.test(r.parent.textContent)&&l.modify?vr(e,t,(()=>{let{focusNode:t,focusOffset:o,anchorNode:i,anchorOffset:s}=e.domSelectionRange(),a=l.caretBidiLevel;l.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:h,focusOffset:u}=e.domSelectionRange(),d=h&&!c.contains(1==h.nodeType?h:h.parentNode)||t==h&&o==u;try{l.collapse(i,s),t&&(t!=i||o!=s)&&l.extend&&l.extend(t,o)}catch(f){}return null!=a&&(l.caretBidiLevel=a),d})):"left"==n||"backward"==n?i:s:r.pos==r.start()||r.pos==r.end()}(e,t,n))}class Mr{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;tOn(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 o,i=this.getDesc(r);if(i&&(!t||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;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 o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;te||t instanceof $r){r=e-o;break}o=i}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let o;n&&!(o=this.children[n-1]).size&&o instanceof Or&&o.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?On(e.dom)+1:0}}{let e,r=!0;for(;e=n=o&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=i;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=On(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||s==this.children.length-1)){t=l;for(let e=s+1;ef&&it){let e=s;s=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(s.node,s.offset),a.removeAllRanges(),a.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+o.border,s=i-o.border;if(e>=r&&t<=s)return this.dirty=e==n||t==i?2:1,void(e!=r||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-r,t-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirtyo?o.parent?o.parent.posBeforeChild(o):void 0:r))),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=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 Cr extends Mr{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 Nr extends Mr{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let o=r.nodeViews[t.type.name],i=o&&o(t,r,n);return i&&i.dom||(i=dt.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new Nr(e,t,i.dom,i.contentDOM||i.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}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&&(o=qr(o,0,e,n));for(let s=0;ss?s.parent?s.parent.posBeforeChild(s):void 0:i),n,r),c=a&&a.dom,h=a&&a.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 if(!c){let e=dt.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:h}=e)}h||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let u=c;return c=Vr(c,n,t),a?s=new Er(e,t,n,r,c,h||null,u,a,o,i+1):t.isText?new Ar(e,t,n,r,c,u,o):new Dr(e,t,n,r,c,h||null,u,o,i+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=()=>ue.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)&&jr(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,o=e.composing?this.localCompositionInfo(e,t):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,l=new Lr(this,i&&i.node,e);!function(e,t,n,r){let o=t.locals(e),i=0;if(0==o.length){for(let n=0;ni;)l.push(o[s++]);let p=i+d.nodeSize;if(d.isText){let e=p;s!e.inline)):l.slice(),t.forChild(i,d),f),i=p}}(this.node,this.innerDeco,((t,o,i)=>{t.spec.marks?l.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!i&&l.syncToMarks(o==this.node.childCount?me.none:this.node.child(o).marks,n,e),l.placeWidget(t,e,r)}),((t,i,a,c)=>{let h;l.syncToMarks(t.marks,n,e),l.findNodeMatch(t,i,a,c)||s&&e.state.selection.from>r&&e.state.selection.to-1&&l.updateNodeAt(t,i,a,h,e)||l.updateNextNode(t,i,a,e,c,r)||l.addNode(t,i,a,e,r),r+=t.nodeSize})),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(i&&this.protectLocalComposition(e,i),Pr(this.contentDOM,this.children,e),Un&&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 sn)||nt+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let o=0,i=0;o=n){if(i>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let e=l=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+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 o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new Cr(this,o,t,r);e.input.compositionNodes.push(i),this.children=qr(this.children,n,n+r.length,e,i)}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(jr(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=_r(this.dom,this.nodeDOM,zr(this.outerDeco,this.node,t),zr(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 Tr(e,t,n,r,o){Vr(r,t,e);let i=new Dr(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Ar extends Dr{constructor(e,t,n,r,o,i,s){super(e,t,n,r,o,null,i,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),o=document.createTextNode(r.text);return new Ar(this.parent,r,this.outerDeco,this.innerDeco,o,o,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}isText(e){return this.node.text==e}}class $r extends Mr{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 Er extends Dr{constructor(e,t,n,r,o,i,s,l,a,c){super(e,t,n,r,o,i,s,a,c),this.spec=l}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,r),o}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 Pr(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i0;){let l;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Nr)){l=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 a=l.node;if(a){if(a!=e.child(o-1))break;--o,i.set(l,o),s.push(l)}}return{index:o,matched:i,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n>1,i=Math.min(o,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=Nr.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let s=this.index,l=Math.min(this.top.children.length,s+5);s=n||h<=t?i.push(a):(cn&&i.push(a.slice(n-c,a.size,r)))}return i}function Jr(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l,a,c=r.resolve(s);if(In(n)){for(l=s;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&an.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,o=t==En(e);r||o;){if(e==n)return!0;let t=On(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==En(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;a=new an(s==e?c:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,o=s;for(let r=0;r{n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Kr(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Yr=Yn||Kn&&Hn<63;function Ur(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=rr(e,t,n)))||sn.between(t,n,r)}function to(e){return!(e.editable&&!e.hasFocus())&&no(e)}function no(e){let t=e.domSelectionRange();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 ro(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&tn.findFrom(i,t)}function oo(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function io(e,t,n){let r=e.state.selection;if(!(r instanceof sn)){if(r instanceof an&&r.node.isInline)return oo(e,new sn(t>0?r.$to:r.$from));{let n=ro(e.state,t);return!!n&&oo(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,o=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=e.state.doc.resolve(n.pos+o.nodeSize*(t<0?-1:1));return oo(e,new sn(r.$anchor,i))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=ro(e.state,t);return!!(n&&n instanceof an)&&oo(e,n)}if(!(Gn&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=t<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(an.isSelectable(i)?oo(e,new an(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):!!Qn&&oo(e,new sn(e.state.doc.resolve(t<0?s:s+i.nodeSize))))}}function so(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function lo(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function ao(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;qn&&1==n.nodeType&&r0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(lo(e,-1))o=n,i=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(co(n))break;{let t=n.previousSibling;for(;t&&lo(t,-1);)o=n.parentNode,i=On(t),t=t.previousSibling;if(t)n=t,r=so(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?ho(e,n,r):o&&ho(e,o,i)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=so(n);for(;;)if(r{e.state==o&&Hr(e)}),50)}function uo(e,t){let n=e.state.doc.resolve(t);if(!Kn&&!Zn&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),o=(n.top+n.bottom)/2;if(o>r.top&&o1)return n.leftr.top&&o1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function fo(e,t,n){let r=e.state.selection;if(r instanceof sn&&!r.empty||n.indexOf("s")>-1)return!1;if(Gn&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=ro(e.state,t);if(n&&n instanceof an)return oo(e,n)}if(!o.parent.inlineContent){let n=t<0?o:i,s=r instanceof hn?tn.near(n,t):tn.findFrom(n,t);return!!s&&oo(e,s)}return!1}function po(e,t){if(!(e.state.selection instanceof sn))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=e.state.tr;return t<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),e.dispatch(r),!0}return!1}function mo(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function go(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);if(8==n||Gn&&72==n&&"c"==r)return po(e,-1)||ao(e,-1);if(46==n&&!t.shiftKey||Gn&&68==n&&"c"==r)return po(e,1)||ao(e,1);if(13==n||27==n)return!0;if(37==n||Gn&&66==n&&"c"==r){let t=37==n?"ltr"==uo(e,e.state.selection.from)?-1:1:-1;return io(e,t,r)||ao(e,t)}if(39==n||Gn&&70==n&&"c"==r){let t=39==n?"ltr"==uo(e,e.state.selection.from)?1:-1:1;return io(e,t,r)||ao(e,t)}return 38==n||Gn&&80==n&&"c"==r?fo(e,-1,r)||ao(e,-1):40==n||Gn&&78==n&&"c"==r?function(e){if(!Yn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;mo(e,n,"true"),setTimeout((()=>mo(e,n,"false")),20)}return!1}(e)||fo(e,1,r)||ao(e,1):r==(Gn?"m":"c")&&(66==n||73==n||89==n||90==n)}function yo(e,t){e.someProp("transformCopied",(n=>{t=n(t,e)}));let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;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")||dt.fromSchema(e.state.schema),l=No(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c,h=a.firstChild,u=0;for(;h&&1==h.nodeType&&(c=Oo[h.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=l.createElement(c[e]);for(;a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t),u++}h=a.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",`${o} ${i}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:a,text:e.someProp("clipboardTextSerializer",(n=>n(t,e)))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function vo(e,t,n,r,o){let i,s,l=o.parent.type.spec.code;if(!n&&!t)return null;let a=t&&(r||l||!n);if(a){if(e.someProp("transformPastedText",(n=>{t=n(t,l||r,e)})),l)return t?new ye(ue.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):ye.empty;let n=e.someProp("clipboardTextParser",(n=>n(t,o,r,e)));if(n)s=n;else{let n=o.marks(),{schema:r}=e.state,s=dt.fromSchema(r);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=i.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(t=>{n=t(n,e)})),i=function(e){let t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=No().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&Oo[o[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"")).reverse().join(""));if(r.innerHTML=function(e){let t=window.trustedTypes;return t?t.createPolicy("detachedDocument",{createHTML:e=>e}).createHTML(e):e}(e),n)for(let i=0;i0;u--){let e=i.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;i=e}if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||nt.fromSchema(e.state.schema);s=t.parseSlice(i,{preserveWhitespace:!(!a&&!h),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||wo.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(h)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(l){return e}let{content:o,openStart:i,openEnd:s}=e;for(let a=n.length-2;a>=0;a-=2){let e=r.nodes[n[a]];if(!e||e.hasRequiredAttrs())break;o=ue.from(e.create(n[a+1],o)),i++,s++}return new ye(o,i,s)}(Mo(s,+h[1],+h[2]),h[4]);else if(s=ye.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,o=t.node(n).contentMatchAt(t.index(n)),i=[];if(e.forEach((e=>{if(!i)return;let t,n=o.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&r.length&&xo(n,r,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=So(i[i.length-1],r.length));let t=bo(e,n);i.push(t),o=o.matchType(t.type),r=n}})),i)return ue.from(i)}return e}(s.content,o),!0),s.openStart||s.openEnd){let e=0,t=0;for(let n=s.content.firstChild;e{s=t(s,e)})),s}const wo=/^(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 bo(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,ue.from(e));return e}function xo(e,t,n,r,o){if(o1&&(i=0),o=n&&(l=t<0?s.contentMatchAt(0).fillBefore(l,i<=o).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(ue.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(l))}function Mo(e,t,n){return t{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Io(e,t))}))}function Io(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Ro(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 zo(e){return{left:e.clientX,top:e.clientY}}function _o(e,t,n,r,o){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,(t=>s>i.depth?t(e,n,i.nodeAfter,i.before(s),o,!0):t(e,n,i.node(s),i.before(s),o,!1))))return!0;return!1}function Bo(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function Vo(e,t,n,r,o){return _o(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(o?function(e,t){if(-1==t)return!1;let n,r,o=e.state.selection;o instanceof an&&(n=o.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let e=s>i.depth?i.nodeAfter:i.node(s);if(an.isSelectable(e)){r=n&&o.$from.depth>0&&s>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(s);break}}return null!=r&&(Bo(e,an.create(e.state.doc,r)),!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&&an.isSelectable(r))&&(Bo(e,new an(n)),!0)}(e,n))}function jo(e,t,n,r){return _o(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Fo(e,t,n,r){return _o(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&&(Bo(e,sn.create(r,0,r.content.size)),!0);let o=r.resolve(t);for(let i=o.depth+1;i>0;i--){let t=i>o.depth?o.nodeAfter:o.node(i),n=o.before(i);if(t.inlineContent)Bo(e,sn.create(r,n+1,n+1+t.content.size));else{if(!an.isSelectable(t))continue;Bo(e,an.create(r,n))}return!0}}(e,n,r)}function Lo(e){return Go(e)}To.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Jo(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Xn||!Kn||13!=n.keyCode))if(e.domObserver.selectionChanged(e.domSelectionRange())?e.domObserver.flush():229!=n.keyCode&&e.domObserver.forceFlush(),!Un||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||go(e,n)?n.preventDefault():Eo(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,Rn(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},To.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},To.keypress=(e,t)=>{let n=t;if(Jo(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Gn&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof sn&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);/[\r\n]/.test(t)||e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const Wo=Gn?"metaKey":"ctrlKey";Do.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Lo(e),o=Date.now(),i="singleClick";o-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[Wo]&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=e.posAtCoords(zo(n));s&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new qo(e,s,n,!!r)):("doubleClick"==i?jo:Fo)(e,s.pos,s.inside,n)?n.preventDefault():Eo(e,"pointer"))};class qo{constructor(e,t,n,r){let o,i;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[Wo],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),i=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,l=s?e.docView.nearestDesc(s,!0):null;this.target=l&&1==l.dom.nodeType?l.dom:null;let{selection:a}=e.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||a instanceof an&&a.from<=i&&a.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!qn||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)),Eo(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((()=>Hr(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(zo(e))),this.updateAllowDefault(e),this.allowDefault||!t?Eo(this.view,"pointer"):Vo(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Yn&&this.mightDrag&&!this.mightDrag.node.isAtom||Kn&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Bo(this.view,tn.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Eo(this.view,"pointer")}move(e){this.updateAllowDefault(e),Eo(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function Jo(e,t){return!!e.composing||!!(Yn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Do.touchstart=e=>{e.input.lastTouch=Date.now(),Lo(e),Eo(e,"pointer")},Do.touchmove=e=>{e.input.lastTouch=Date.now(),Eo(e,"pointer")},Do.contextmenu=e=>Lo(e);const Ko=Xn?5e3:-1;function Ho(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>Go(e)),t))}function Yo(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 Uo(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=En(e=e.childNodes[t-1])}else{if(!e.parentNode||Pn(e))return null;t=On(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t=0)){if(e.domObserver.forceFlush(),Yo(e),t||e.docView&&e.docView.dirty){let n=Jr(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||e.state.selection.empty?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}To.compositionstart=To.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof sn&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),Go(e,!0),e.markCursor=null;else if(Go(e,!t.selection.empty),qn&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}Ho(e,Ko)},To.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then((()=>e.domObserver.flush())),e.input.compositionID++,Ho(e,20))};const Zo=Ln&&Wn<15||Un&&er<604;function Xo(e,t,n,r,o){let i=vo(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,o,i||ye.empty))))return!0;if(!i)return!1;let s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),l=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(i);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Qo(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Do.copy=To.cut=(e,t)=>{let n=t,r=e.state.selection,o="cut"==n.type;if(r.empty)return;let i=Zo?null:n.clipboardData,s=r.content(),{dom:l,text:a}=yo(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",a)):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(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,l),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},To.paste=(e,t)=>{let n=t;if(e.composing&&!Xn)return;let r=Zo?null:n.clipboardData,o=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&Xo(e,Qo(r),r.getData("text/html"),o,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();let o=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Xo(e,r.value,null,o,t):Xo(e,r.textContent,r.innerHTML,o,t)}),50)}(e,n)};class ei{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const ti=Gn?"altKey":"ctrlKey";Do.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o,i=e.state.selection,s=i.empty?null:e.posAtCoords(zo(n));if(s&&s.pos>=i.from&&s.pos<=(i instanceof an?i.to-1:i.to));else if(r&&r.mightDrag)o=an.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&&(o=an.create(e.state.doc,t.posBefore))}let l=(o||e.state.selection).content(),{dom:a,text:c,slice:h}=yo(e,l);(!n.dataTransfer.files.length||!Kn||Hn>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Zo?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Zo||n.dataTransfer.setData("text/plain",c),e.dragging=new ei(h,!n[ti],o)},Do.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},To.dragover=To.dragenter=(e,t)=>t.preventDefault(),To.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(zo(n));if(!o)return;let i=e.state.doc.resolve(o.pos),s=r&&r.slice;s?e.someProp("transformPasted",(t=>{s=t(s,e)})):s=vo(e,Qo(n.dataTransfer),Zo?null:n.dataTransfer.getData("text/html"),!1,i);let l=!(!r||n[ti]);if(e.someProp("handleDrop",(t=>t(e,n,s||ye.empty,l))))return void n.preventDefault();if(!s)return;n.preventDefault();let a=s?function(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let i=0;i=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),l=!1;if(1==i)l=s.canReplace(n,n,o);else{let e=s.contentMatchAt(n).findWrapping(o.firstChild.type);l=e&&s.canReplaceWith(n,n,e[0])}if(l)return 0==t?r.pos:t<0?r.before(e+1):r.after(e+1)}return null}(e.state.doc,i.pos,s):i.pos;null==a&&(a=i.pos);let c=e.state.tr;if(l){let{node:e}=r;e?e.replace(c):c.deleteSelection()}let h=c.mapping.map(a),u=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,d=c.doc;if(u?c.replaceRangeWith(h,h,s.content.firstChild):c.replaceRange(h,h,s),c.doc.eq(d))return;let f=c.doc.resolve(h);if(u&&an.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new an(f));else{let t=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,r,o)=>t=o)),c.setSelection(eo(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},Do.focus=e=>{e.input.lastFocus=Date.now(),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.domSelectionRange())&&Hr(e)}),20))},Do.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)},Do.beforeinput=(e,t)=>{if(Kn&&Xn&&"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,Rn(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 To)Do[os]=To[os];function ni(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 ri{constructor(e,t){this.toDOM=e,this.spec=t||ai,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new si(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof ri&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ni(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class oi{constructor(e,t){this.attrs=e,this.spec=t||ai}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new si(o,i,this)}valid(e,t){return t.from=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;ie){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,n,r+s,o)}}map(e,t,n){return this==hi||0==e.maps.length?this:this.mapInner(e,t,0,0,n||ai)}mapInner(e,t,n,r,o){let i;for(let s=0;s{let i=o-r-(n-t);for(let s=0;sr+h-e)continue;let o=l[s]+h-e;n>=o?l[s+1]=t<=o?-2:-1:t>=h&&i&&(l[s]+=i,l[s+1]+=i)}e+=i})),h=n.maps[c].map(h,-1)}let a=!1;for(let c=0;c=r.content.size){a=!0;continue}let u=n.map(e[c+1]+i,-1)-o,{index:d,offset:f}=r.content.findIndex(h),p=r.maybeChild(d);if(p&&f==h&&f+p.nodeSize==u){let r=l[c+2].mapInner(n,p,t+1,e[c]+i+1,s);r!=hi?(l[c]=h,l[c+1]=u,l[c+2]=r):(l[c+1]=-2,a=!0)}else a=!0}if(a){let a=function(e,t,n,r,o,i,s){function l(e,t){for(let i=0;i{let s,l=i+n;if(s=fi(t,e,l)){for(r||(r=this.children.slice());oi&&t.to=e){this.children[s]==e&&(n=this.children[s+2]);break}let o=e+1,i=o+t.content.size;for(let s=0;so&&e.type instanceof oi){let t=Math.max(o,e.from)-o,n=Math.min(i,e.to)-o;tn.map(e,t,ai)));return ui.from(n)}forChild(e,t){if(t.isLeaf)return ci.empty;let n=[];for(let r=0;re instanceof ci))?e:e.reduce(((e,t)=>e.concat(t instanceof ci?t:t.members)),[]))}}forEachSet(e){for(let t=0;tn&&i.to{let l=fi(e,t,s+n);if(l){i=!0;let e=mi(l,t,n+s+1,r);e!=hi&&o.push(s,s+t.nodeSize,e)}}));let s=di(i?pi(e):e,-n).sort(gi);for(let l=0;l0;)t++;e.splice(t,0,n)}function wi(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=hi&&t.push(r)})),e.cursorWrapper&&t.push(ci.create(e.state.doc,[e.cursorWrapper.deco])),ui.from(t)}const bi={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},xi=Ln&&Wn<=11;class Si{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 ki{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Si,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,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()})),xi&&(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.takeRecords(),this.observer.observe(this.view.dom,bi)),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(to(this.view)){if(this.suppressingSelectionUpdates)return Hr(this.view);if(Ln&&Wn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Tn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let o=e.focusNode;o;o=Cn(o))n.add(o);for(let o=e.anchorNode;o;o=Cn(o))if(n.has(o)){t=o;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}selectionChanged(e){return!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&to(this.view)&&!this.ignoreSelectionChange(e)}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=this.selectionChanged(n),o=-1,i=-1,s=!1,l=[];if(e.editable)for(let c=0;c"BR"==e.nodeName));if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;!t||"LI"!=t.nodeName||n&&Ni(e,n)==t||r.remove()}}}let a=null;o<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||r)&&(o>-1&&(e.docView.markDirty(o,i),function(e){if(Mi.has(e))return;if(Mi.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=qn,Oi)return;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."),Oi=!0}}(e)),this.handleDOMChange(o,i,s,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Hr(e),this.currentSelection.set(n))}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=Jr(e,t);if(n&&!e.state.selection.eq(n)){if(Kn&&Xn&&13===e.input.lastKeyCode&&Date.now()-100t(e,Rn(13,"Enter")))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),i&&r.setMeta("composition",i),e.dispatch(r)}return}let s=e.state.doc.resolve(t),l=s.sharedDepth(n);t=s.before(l+1),n=e.state.doc.resolve(n).after(l+1);let a,c,h=e.state.selection,u=function(e,t,n){let r,{node:o,fromOffset:i,toOffset:s,from:l,to:a}=e.docView.parseRange(t,n),c=e.domSelectionRange(),h=c.anchorNode;if(h&&e.dom.contains(1==h.nodeType?h:h.parentNode)&&(r=[{node:h,offset:c.anchorOffset}],In(c)||r.push({node:c.focusNode,offset:c.focusOffset})),Kn&&8===e.input.lastKeyCode)for(let g=s;g>i;g--){let e=o.childNodes[g-1],t=e.pmViewDesc;if("BR"==e.nodeName&&!t){s=g;break}if(!t||t.size)break}let u=e.state.doc,d=e.someProp("domParser")||nt.fromSchema(e.state.schema),f=u.resolve(l),p=null,m=d.parse(o,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Di,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+l,head:t+l}}return{doc:m,sel:p,from:l,to:a}}(e,t,n),d=e.state.doc,f=d.slice(u.from,u.to);8===e.input.lastKeyCode&&Date.now()-100=s?i-r:0;i-=e,i&&i=l?i-r:0;i-=t,i&&iDate.now()-225||Xn)&&o.some((e=>1==e.nodeType&&!Ti.test(e.nodeName)))&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",(t=>t(e,Rn(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!p){if(!(r&&h instanceof sn&&!h.empty&&h.$head.sameParent(h.$anchor))||e.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let t=$i(e,e.state.doc,u.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);i&&n.setMeta("composition",i),e.dispatch(n)}}return}p={start:h.from,endA:h.to,endB:h.to}}e.state.selection.frome.state.selection.from&&p.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?p.start=e.state.selection.from:p.endA=e.state.selection.to-2&&e.state.selection.to<=u.to&&(p.endB+=e.state.selection.to-p.endA,p.endA=e.state.selection.to)),Ln&&Wn<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>u.from&&"  "==u.doc.textBetween(p.start-u.from-1,p.start-u.from+1)&&(p.start--,p.endA--,p.endB--);let m,g=u.doc.resolveNoCache(p.start-u.from),y=u.doc.resolveNoCache(p.endB-u.from),v=d.resolve(p.start),w=g.sameParent(y)&&g.parent.inlineContent&&v.end()>=p.endA;if((Un&&e.input.lastIOSEnter>Date.now()-225&&(!w||o.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!w&&g.post(e,Rn(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>p.start&&function(e,t,n,r,o){if(n-t<=o.pos-r.pos||Ei(r,!0,!1)n||Ei(s,!0,!1)t(e,Rn(8,"Backspace")))))return void(Xn&&Kn&&e.domObserver.suppressSelectionUpdates());Kn&&Xn&&p.endB==p.start&&(e.input.lastAndroidDelete=Date.now()),Xn&&!w&&g.start()!=y.start()&&0==y.parentOffset&&g.depth==y.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==p.endA&&(p.endB-=2,y=u.doc.resolveNoCache(p.endB-u.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,Rn(13,"Enter"))}))}),20));let b,x,S,k=p.start,M=p.endA;if(w)if(g.pos==y.pos)Ln&&Wn<=11&&0==g.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Hr(e)),20)),b=e.state.tr.delete(k,M),x=d.resolve(p.start).marksAcross(d.resolve(p.endA));else if(p.endA==p.endB&&(S=function(e,t){let n,r,o,i=e.firstChild.marks,s=t.firstChild.marks,l=i,a=s;for(let h=0;he.mark(r.addToSet(e.marks));else{if(0!=l.length||1!=a.length)return null;r=a[0],n="remove",o=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let h=0;hn(e,k,M,t))))return;b=e.state.tr.insertText(t,k,M)}if(b||(b=e.state.tr.replace(k,M,u.doc.slice(p.start-u.from,p.endB-u.from))),u.sel){let t=$i(e,b.doc,u.sel);t&&!(Kn&&Xn&&e.composing&&t.empty&&(p.start!=p.endB||e.input.lastAndroidDeletet.content.size?null:eo(e,t.resolve(n.anchor),t.resolve(n.head))}function Ei(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}function Pi(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class Ii{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 $o,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Vi),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=_i(this),zi(this),this.nodeViews=Bi(this),this.docView=Tr(this.state.doc,Ri(this),wi(this),this.dom,this),this.domObserver=new ki(this,((e,t,n,r)=>Ai(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in Do){let n=Do[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Ro(e,t)||Io(e,t)||!e.editable&&t.type in To||n(e,t)},Ao[t]?{passive:!0}:void 0)}Yn&&e.dom.addEventListener("input",(()=>null)),Po(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&&Po(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Vi),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}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._props)}updateStateInner(e,t){var n;let r=this.state,o=!1,i=!1;e.storedMarks&&this.composing&&(Yo(this),i=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Bi(this);(function(e,t){let n=0,r=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let o in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,o=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&Po(this),this.editable=_i(this),zi(this);let l=wi(this),a=Ri(this),c=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",h=o||!this.docView.matchesNode(e.doc,a,l);!h&&e.selection.eq(r.selection)||(i=!0);let u="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s=o-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:ir(e.dom)}}(this);if(i){this.domObserver.stop();let t=h&&(Ln||Kn)&&!this.composing&&!r.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)}(r.selection,e.selection);if(h){let n=Kn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Uo(this)),!o&&this.docView.update(e.doc,a,l,this)||(this.docView.updateOuterDeco(a),this.docView.destroy(),this.docView=Tr(e.doc,a,l,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Tn(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Hr(this,t):(Xr(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():u&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;sr(n,0==r?0:r-t)}(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof an){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&or(this,t.getBoundingClientRect(),e)}else or(this,this.coordsAtPos(this.state.selection.head,1),e)}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;t0&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new ei(e.slice,e.move,r<0?void 0:an.create(this.state.doc,r))}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let i=0;it.ownerDocument.getSelection()),this._root=t;return e||document}updateRoot(){this._root=null}posAtCoords(e){return ur(this,e)}coordsAtPos(e,t=1){return mr(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 kr(this,t||this.state,e)}pasteHTML(e,t){return Xo(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Xo(this,e,null,!0,t||new ClipboardEvent("paste"))}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,[],wi(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Nn=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Io(e,t)||!Do[t.type]||!e.editable&&t.type in To||Do[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Yn&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Ci(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?Ci(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Ri(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),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]))})),t.translate||(t.translate="no"),[si.node(0,e.state.doc.content.size,t)]}function zi(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:si.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function _i(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function Bi(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Vi(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 ji={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:"'"},Fi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Li="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Wi="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),qi="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ji=Wi||Li&&+Li[1]<57,Ki=0;Ki<10;Ki++)ji[48+Ki]=ji[96+Ki]=String(Ki);for(Ki=1;Ki<=24;Ki++)ji[Ki+111]="F"+Ki;for(Ki=65;Ki<=90;Ki++)ji[Ki]=String.fromCharCode(Ki+32),Fi[Ki]=String.fromCharCode(Ki);for(var Hi in ji)Fi.hasOwnProperty(Hi)||(Fi[Hi]=ji[Hi]);const Yi="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Ui(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let l=0;l127)&&(r=ji[n.keyCode])&&r!=o){let o=t[Gi(r,n)];if(o&&o(e.state,e.dispatch,e))return!0}}return!1}}const Qi=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function es(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 ts(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 ns(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{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&Rt(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)};function is(e){for(let t=0;t{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=is(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,s.createAndFill());o.setSelection(tn.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0};const ls=(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof an&&e.selection.node.isBlock)return!(!n.parentOffset||!Bt(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.parent.isBlock)return!1;if(t){let o=r.parentOffset==r.parent.content.size,i=e.tr;(e.selection instanceof sn||e.selection instanceof hn)&&i.deleteSelection();let s=0==n.depth?null:is(n.node(-1).contentMatchAt(n.indexAfter(-1))),l=o&&s?[{type:s}]:void 0,a=Bt(i.doc,i.mapping.map(n.pos),1,l);if(l||a||!Bt(i.doc,i.mapping.map(n.pos),1,s?[{type:s}]:void 0)||(s&&(l=[{type:s}]),a=!0),a&&(i.split(i.mapping.map(n.pos),1,l),!o&&!n.parentOffset&&n.parent.type!=s)){let e=i.mapping.map(n.before()),t=i.doc.resolve(e);s&&n.node(-1).canReplaceWith(t.index(),t.index()+1,s)&&i.setNodeMarkup(i.mapping.map(n.before()),s)}t(i.scrollIntoView())}return!0};function as(e,t,n,r){let o,i,s=t.nodeBefore,l=t.nodeAfter,a=s.type.spec.isolating||l.type.spec.isolating;if(!a&&function(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(i,i+1)||!o.isTextblock&&!Vt(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 c=!a&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(o=(i=s.contentMatchAt(s.childCount)).findWrapping(l.type))&&i.matchType(o[0]||l.type).validEnd){if(n){let r=t.pos+l.nodeSize,i=ue.empty;for(let e=o.length-1;e>=0;e--)i=ue.from(o[e].create(null,i));i=ue.from(s.copy(i));let a=e.tr.step(new Et(t.pos-1,r,t.pos,r,new ye(i,1,0),o.length,!0)),c=r+2*o.length;Vt(a.doc,c)&&a.join(c),n(a.scrollIntoView())}return!0}let h=l.type.spec.isolating||r>0&&a?null:tn.findFrom(t,1),u=h&&h.$from.blockRange(h.$to),d=u&&Rt(u);if(null!=d&&d>=t.depth)return n&&n(e.tr.lift(u,d).scrollIntoView()),!0;if(c&&es(l,"start",!0)&&es(s,"end")){let r=s,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let i=l,a=1;for(;!i.isTextblock;i=i.firstChild)a++;if(r.canReplace(r.childCount,r.childCount,i.content)){if(n){let r=ue.empty;for(let e=o.length-1;e>=0;e--)r=ue.from(o[e].copy(r));n(e.tr.step(new Et(t.pos-o.length,t.pos+l.nodeSize,t.pos+a,t.pos+l.nodeSize-a,new ye(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function cs(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(sn.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}const hs=cs(-1),us=cs(1);function ds(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=s&&zt(s,e,t);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}}function fs(e,t=null){return function(n,r){let o=!1;for(let i=0;i{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)o=!0;else{let t=n.doc.resolve(i),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}}))}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r{if(l||!r&&e.isAtom&&e.isInline&&t>=i.pos&&t+e.nodeSize<=s.pos)return!1;l=e.inlineContent&&e.type.allowsMarkType(n)})),l)return!0}return!1}(n.doc,a,e,o))return!1;if(i)if(l)e.isInSet(n.storedMarks||l.marks())?i(n.tr.removeStoredMark(e)):i(n.tr.addStoredMark(e.create(t)));else{let s,l=n.tr;o||(a=function(e){let t=[];for(let n=0;n{if(e.isAtom&&e.content.size&&e.isInline&&n>=r.pos&&n+e.nodeSize<=o.pos)return n+1>r.pos&&t.push(new nn(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+e.content.size),!1})),r.posn.doc.rangeHasMark(t.$from.pos,t.$to.pos,e))):!a.every((t=>{let n=!1;return l.doc.nodesBetween(t.$from.pos,t.$to.pos,((r,o,i)=>{if(n)return!1;n=!e.isInSet(r.marks)&&!!i&&i.type.allowsMarkType(e)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,t.$from.pos-o),Math.min(r.nodeSize,t.$to.pos-o))))})),!n}));for(let n=0;n{let r=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}(e,n);if(!r)return!1;let o=ts(r);if(!o){let n=r.blockRange(),o=n&&Rt(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(as(e,o,t,-1))return!0;if(0==r.parent.content.size&&(es(i,"end")||an.isSelectable(i)))for(let s=r.depth;;s--){let n=jt(e.doc,r.before(s),r.after(s),ye.empty);if(n&&n.slice.size1)break}return!(!i.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0)}),((e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=ts(r)}let s=i&&i.nodeBefore;return!(!s||!an.isSelectable(s))&&(t&&t(e.tr.setSelection(an.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)})),ys=ms(Qi,((e,t,n)=>{let r=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset{let{$head:r,empty:o}=e.selection,i=r;if(!o)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:o}=n;if(n instanceof hn||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=is(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.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(Bt(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Rt(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)}),ls),"Mod-Enter":ss,Backspace:gs,"Mod-Backspace":gs,"Shift-Backspace":gs,Delete:ys,"Mod-Delete":ys,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new hn(e.doc))),!0)},ws={"Ctrl-h":vs.Backspace,"Alt-Backspace":vs["Mod-Backspace"],"Ctrl-d":vs.Delete,"Ctrl-Alt-Backspace":vs["Mod-Delete"],"Alt-Delete":vs["Mod-Delete"],"Alt-d":vs["Mod-Delete"],"Ctrl-a":hs,"Ctrl-e":us};for(let os in vs)ws[os]=vs[os];const bs=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?ws:vs;class xs{constructor(e,t,n={}){var r;this.match=e,this.match=e,this.handler="string"==typeof t?(r=t,function(e,t,n,o){let i=r;if(t[1]){let e=t[0].lastIndexOf(t[1]);i+=t[0].slice(e+t[1].length);let r=(n+=e)-o;r>0&&(i=t[0].slice(e-r,e)+i,n=o)}return e.tr.insertText(i,n,o)}):t,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1}}function Ss({rules:e}){let t=new xn({state:{init:()=>null,apply(e,t){let n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(n,r,o,i)=>ks(n,r,o,i,e,t),handleDOMEvents:{compositionend:n=>{setTimeout((()=>{let{$cursor:r}=n.state.selection;r&&ks(n,r.pos,r.pos,"",e,t)}))}}},isInputRules:!0});return t}function ks(e,t,n,r,o,i){if(e.composing)return!1;let s=e.state,l=s.doc.resolve(t),a=l.parent.textBetween(Math.max(0,l.parentOffset-500),l.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(o.text){let t=n.doc.resolve(o.from).marks();n.replaceWith(o.from,o.to,e.schema.text(o.text,t))}else n.delete(o.from,o.to);t(n)}return!0}}return!1};function Os(e,t,n=null,r){return new xs(e,((e,o,i,s)=>{let l=n instanceof Function?n(o):n,a=e.tr.delete(i,s),c=a.doc.resolve(i).blockRange(),h=c&&zt(c,t,l);if(!h)return null;a.wrap(c,h);let u=a.doc.resolve(i-1).nodeBefore;return u&&u.type==t&&Vt(a.doc,i-1)&&(!r||r(o,u))&&a.join(i-1),a}))}function Cs(e,t,n=null){return new xs(e,((e,r,o,i)=>{let s=e.doc.resolve(o),l=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(o,i).setBlockType(o,o,t,l):null}))}new xs(/--$/,"—"),new xs(/\.\.\.$/,"…"),new xs(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new xs(/"$/,"”"),new xs(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new xs(/'$/,"’");const Ns=["ol",0],Ds=["ul",0],Ts=["li",0],As={attrs:{order:{default:1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs:e=>({order:e.hasAttribute("start")?+e.getAttribute("start"):1})}],toDOM:e=>1==e.attrs.order?Ns:["ol",{start:e.attrs.order},0]},$s={parseDOM:[{tag:"ul"}],toDOM:()=>Ds},Es={parseDOM:[{tag:"li"}],toDOM:()=>Ts,defining:!0};function Ps(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 Is(e,t,n){return e.append({ordered_list:Ps(As,{content:"list_item+",group:n}),bullet_list:Ps($s,{content:"list_item+",group:n}),list_item:Ps(Es,{content:t})})}function Rs(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=!1,a=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;let e=n.doc.resolve(s.start-2);a=new Pe(e,e,s.depth),s.endIndex=0;h--)i=ue.from(n[h].type.create(n[h].attrs,i));e.step(new Et(t.start-(r?2:0),t.end,t.start,t.end,new ye(i,0,0),n.length,!0));let s=0;for(let h=0;h=o.depth-3;e--)t=ue.from(o.node(e).copy(t));let s=o.indexAfter(-1){if(c>-1)return!1;e.isTextblock&&0==e.content.size&&(c=t+1)})),c>-1&&a.setSelection(tn.near(a.doc.resolve(c))),r(a.scrollIntoView())}return!0}let a=i.pos==o.end()?l.contentMatchAt(0).defaultType:null,c=n.tr.delete(o.pos,i.pos),h=a?[t?{type:e,attrs:t}:null,{type:a}]:void 0;return!!Bt(c.doc,o.pos,2,h)&&(r&&r(c.split(o.pos,2,h).scrollIntoView()),!0)}}function _s(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));return!!i&&(!n||(r.node(i.depth-1).type==e?function(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);im;p--)f-=o.child(p).nodeSize,r.delete(f-1,f+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=0==n.startIndex,a=n.endIndex==o.childCount,c=i.node(-1),h=i.index(-1);if(!c.canReplace(h+(l?0:1),h+1,s.content.append(a?ue.empty:ue.from(o))))return!1;let u=i.pos,d=u+s.nodeSize;return r.step(new Et(u-(l?1:0),d+(a?1:0),u+1,d-1,new ye((l?ue.empty:ue.from(o.copy(ue.empty))).append(a?ue.empty:ue.from(o.copy(ue.empty))),l?0:1,a?0:1),l?0:1)),t(r.scrollIntoView()),!0}(t,n,i)))}}function Bs(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let l=i.parent,a=l.child(s-1);if(a.type!=e)return!1;if(n){let r=a.lastChild&&a.lastChild.type==l.type,o=ue.from(r?e.create():null),s=new ye(ue.from(e.create(null,ue.from(l.type.create(null,o)))),r?3:1,0),c=i.start,h=i.end;n(t.tr.step(new Et(c-(r?3:1),h,c,h,s,1,!0)).scrollIntoView())}return!0}}var Vs=200,js=function(){};js.prototype.append=function(e){return e.length?(e=js.from(e),!this.length&&e||e.length=t?js.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},js.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},js.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)},js.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},js.from=function(e){return e instanceof js?e:e&&e.length?new Fs(e):js.empty};var Fs=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 o=t;o=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Vs)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Vs)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}(js);js.empty=new Fs([]);var Ls=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 eo&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(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}(js),Ws=js;class qs{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}t&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,l=e.tr,a=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(o,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new Js(e.map));let t,o=e.step.map(n.slice(r));o&&l.maybeStep(o).doc&&(t=l.mapping.maps[l.mapping.maps.length-1],a.push(new Js(t,void 0,void 0,a.length+c.length))),r--,t&&n.appendMap(t,r)}else l.maybeStep(e.step);return e.selection?(i=n?e.selection.map(n.slice(r)):e.selection,s=new qs(this.items.slice(0,o).append(c.reverse().concat(a)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:i}}addTransform(e,t,n,r){let o=[],i=this.eventCount,s=this.items,l=!r&&s.length?s.get(s.length-1):null;for(let c=0;cHs&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,a),i-=a),new qs(s.append(o),i)}remapping(e,t){let n=new St;return this.items.forEach(((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new qs(this.items.append(e.map((e=>new Js(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let l=t;this.items.forEach((t=>{let r=o.getMirror(--l);if(null==r)return;i=Math.min(i,r);let a=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(o.slice(l+1,r));c&&s++,n.push(new Js(a,i,c))}else n.push(new Js(a))}),r);let a=[];for(let u=t;u500&&(h=h.compress(this.items.length-n.length)),h}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=[],o=0;return this.items.forEach(((i,s)=>{if(s>=e)r.push(i),i.selection&&o++;else if(i.step){let e=i.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let l=i.selection&&i.selection.map(t.slice(n));l&&o++;let a,c=new Js(s.invert(),e,l),h=r.length-1;(a=r.length&&r[h].merge(c))?r[h]=a:r.push(c)}}else i.map&&n--}),this.items.length,0),new qs(Ws.from(r.reverse()),o)}}qs.empty=new qs(Ws.empty,0);class Js{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 Js(t.getMap().invert(),t,this.selection)}}}class Ks{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const Hs=20;function Ys(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach(((e,n,r,o)=>t.push(r,o)));return t}function Us(e,t){if(!e)return null;let n=[];for(let r=0;rnew Ks(qs.empty,qs.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let o,i=n.getMeta(Qs);if(i)return i.historyState;n.getMeta(el)&&(e=new Ks(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(Qs))return s.getMeta(Qs).redo?new Ks(e.done.addTransform(n,void 0,r,Xs(t)),e.undone,Ys(n.mapping.maps),e.prevTime,e.prevComposition):new Ks(e.done,e.undone.addTransform(n,void 0,r,Xs(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new Ks(e.done.rebased(n,o),e.undone.rebased(n,o),Us(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Ks(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Us(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),i=0==e.prevTime||!s&&e.prevComposition!=o&&(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 o=0;o=t[o]&&(n=!0)})),n}(n,e.prevRanges)),l=s?Us(e.prevRanges,n.mapping):Ys(n.mapping.maps);return new Ks(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,Xs(t)),qs.empty,l,n.time,null==o?e.prevComposition:o)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?rl:"historyRedo"==n?ol:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function nl(e,t){return(n,r)=>{let o=Qs.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let i=function(e,t,n){let r=Xs(t),o=Qs.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),l=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),a=new Ks(n?l:i.remaining,n?i.remaining:l,null,0,-1);return i.transform.setSelection(s).setMeta(Qs,{redo:n,historyState:a})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}const rl=nl(!1,!0),ol=nl(!0,!0);function il(e){let t=Qs.getState(e);return t?t.done.eventCount:0}function sl(e){let t=Qs.getState(e);return t?t.undone.eventCount:0} /*! * portal-vue © Thorsten Lünborg, 2019 * @@ -8,9 +8,9 @@ * * https://github.com/linusborg/portal-vue * - */function cl(e){return(cl="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)}function hl(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]&&arguments[1],n=e.to,r=e.from;if(n&&(r||!1!==t)&&this.transports[n])if(t)this.transports[n]=[];else{var o=this.$_getTransportIndex(e);if(o>=0){var i=this.transports[n].slice(0);i.splice(o,1),this.transports[n]=i}}},registerTarget:function(e,t,n){ul&&(this.trackInstances&&!n&&this.targets[e]&&console.warn("[portal-vue]: Target ".concat(e," already exists")),this.$set(this.targets,e,Object.freeze([t])))},unregisterTarget:function(e){this.$delete(this.targets,e)},registerSource:function(e,t,n){ul&&(this.trackInstances&&!n&&this.sources[e]&&console.warn("[portal-vue]: source ".concat(e," already exists")),this.$set(this.sources,e,Object.freeze([t])))},unregisterSource:function(e){this.$delete(this.sources,e)},hasTarget:function(e){return!(!this.targets[e]||!this.targets[e][0])},hasSource:function(e){return!(!this.sources[e]||!this.sources[e][0])},hasContentFor:function(e){return!!this.transports[e]&&!!this.transports[e].length},$_getTransportIndex:function(e){var t=e.to,n=e.from;for(var r in this.transports[t])if(this.transports[t][r].from===n)return+r;return-1}}}),yl=new gl(fl),vl=1,wl=Vue.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function(){return String(vl++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}}},created:function(){var e=this;this.$nextTick((function(){yl.registerSource(e.name,e)}))},mounted:function(){this.disabled||this.sendUpdate()},updated:function(){this.disabled?this.clear():this.sendUpdate()},beforeDestroy:function(){yl.unregisterSource(this.name),this.clear()},watch:{to:function(e,t){t&&t!==e&&this.clear(t),this.sendUpdate()}},methods:{clear:function(e){var t={from:this.name,to:e||this.to};yl.close(t)},normalizeSlots:function(){return this.$scopedSlots.default?[this.$scopedSlots.default]:this.$slots.default},normalizeOwnChildren:function(e){return"function"==typeof e?e(this.slotProps):e},sendUpdate:function(){var e=this.normalizeSlots();if(e){var t={from:this.name,to:this.to,passengers:hl(e),order:this.order};yl.open(t)}else this.clear()}},render:function(e){var t=this.$slots.default||this.$scopedSlots.default||[],n=this.tag;return t&&this.disabled?t.length<=1&&this.slim?this.normalizeOwnChildren(t)[0]:e(n,[this.normalizeOwnChildren(t)]):this.slim?e():e(n,{class:{"v-portal":!0},style:{display:"none"},key:"v-portal-placeholder"})}}),bl=Vue.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slim:{type:Boolean,default:!1},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function(){return{transports:yl.transports,firstRender:!0}},created:function(){var e=this;this.$nextTick((function(){yl.registerTarget(e.name,e)}))},watch:{ownTransports:function(){this.$emit("change",this.children().length>0)},name:function(e,t){yl.unregisterTarget(t),yl.registerTarget(e,this)}},mounted:function(){var e=this;this.transition&&this.$nextTick((function(){e.firstRender=!1}))},beforeDestroy:function(){yl.unregisterTarget(this.name)},computed:{ownTransports:function(){var e=this.transports[this.name]||[];return this.multiple?e:0===e.length?[]:[e[e.length-1]]},passengers:function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.reduce((function(e,n){var r=n.passengers[0],o="function"==typeof r?r(t):n.passengers;return e.concat(o)}),[])}(this.ownTransports,this.slotProps)}},methods:{children:function(){return 0!==this.passengers.length?this.passengers:this.$scopedSlots.default?this.$scopedSlots.default(this.slotProps):this.$slots.default||[]},noWrapper:function(){var e=this.slim&&!this.transition;return e&&this.children().length>1&&console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."),e}},render:function(e){var t=this.noWrapper(),n=this.children(),r=this.transition||this.tag;return t?n[0]:this.slim&&!r?e():e(r,{props:{tag:this.transition&&this.tag?this.tag:void 0},class:{"vue-portal-target":!0}},n)}}),xl=0,Sl=["disabled","name","order","slim","slotProps","tag","to"],kl=["multiple","transition"],Ml=Vue.extend({name:"MountingPortal",inheritAttrs:!1,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:!0},disabled:{type:Boolean},name:{type:String,default:function(){return"mounted_"+String(xl++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}},multiple:{type:Boolean,default:!1},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function(){if("undefined"!=typeof document){var e=document.querySelector(this.mountTo);if(e){var t=this.$props;if(yl.targets[t.name])t.bail?console.warn("[portal-vue]: Target ".concat(t.name," is already mounted.\n Aborting because 'bail: true' is set")):this.portalTarget=yl.targets[t.name];else{var n=t.append;if(n){var r="string"==typeof n?n:"DIV",o=document.createElement(r);e.appendChild(o),e=o}var i=dl(this.$props,kl);i.slim=this.targetSlim,i.tag=this.targetTag,i.slotProps=this.targetSlotProps,i.name=this.to,this.portalTarget=new bl({el:e,parent:this.$parent||this,propsData:i})}}else console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document"))}},beforeDestroy:function(){var e=this.portalTarget;if(this.append){var t=e.$el;t.parentNode.removeChild(t)}e.$destroy()},render:function(e){if(!this.portalTarget)return console.warn("[portal-vue] Target wasn't mounted"),e();if(!this.$scopedSlots.manual){var t=dl(this.$props,Sl);return e(wl,{props:t,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots.default)}var n=this.$scopedSlots.manual({to:this.to});return Array.isArray(n)&&(n=n[0]),n||e()}});var Ol={install:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.component(t.portalName||"Portal",wl),e.component(t.portalTargetName||"PortalTarget",bl),e.component(t.MountingPortalName||"MountingPortal",Ml)}},Cl=new Map;function Nl(e){var t=Cl.get(e);t&&t.destroy()}function Dl(e){var t=Cl.get(e);t&&t.update()}var Tl=null;"undefined"==typeof window?((Tl=function(e){return e}).destroy=function(e){return e},Tl.update=function(e){return e}):((Tl=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&&!Cl.has(e)){var t,n=null,r=window.getComputedStyle(e),o=(t=e.value,function(){s({testForHeightReduction:""===t||!e.value.startsWith(t),restoreTextAlign:null}),t=e.value}),i=function(t){e.removeEventListener("autosize:destroy",i),e.removeEventListener("autosize:update",l),e.removeEventListener("input",o),window.removeEventListener("resize",l),Object.keys(t).forEach((function(n){return e.style[n]=t[n]})),Cl.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,textAlign:e.style.textAlign,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",i),e.addEventListener("autosize:update",l),e.addEventListener("input",o),window.addEventListener("resize",l),e.style.overflowX="hidden",e.style.wordWrap="break-word",Cl.set(e,{destroy:i,update:l}),l()}function s(t){var o,i,l=t.restoreTextAlign,a=void 0===l?null:l,c=t.testForHeightReduction,h=void 0===c||c,u=r.overflowY;if(0!==e.scrollHeight&&("vertical"===r.resize?e.style.resize="none":"both"===r.resize&&(e.style.resize="horizontal"),h&&(o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push([e.parentNode,e.parentNode.scrollTop]),e=e.parentNode;return function(){return t.forEach((function(e){var t=e[0],n=e[1];t.style.scrollBehavior="auto",t.scrollTop=n,t.style.scrollBehavior=null}))}}(e),e.style.height=""),i="content-box"===r.boxSizing?e.scrollHeight-(parseFloat(r.paddingTop)+parseFloat(r.paddingBottom)):e.scrollHeight+parseFloat(r.borderTopWidth)+parseFloat(r.borderBottomWidth),"none"!==r.maxHeight&&i>parseFloat(r.maxHeight)?("hidden"===r.overflowY&&(e.style.overflow="scroll"),i=parseFloat(r.maxHeight)):"hidden"!==r.overflowY&&(e.style.overflow="hidden"),e.style.height=i+"px",a&&(e.style.textAlign=a),o&&o(),n!==i&&(e.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),n=i),u!==r.overflow&&!a)){var d=r.textAlign;"hidden"===r.overflow&&(e.style.textAlign="start"===d?"end":"start"),s({restoreTextAlign:d,testForHeightReduction:!0})}}function l(){s({testForHeightReduction:!0,restoreTextAlign:null})}}(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],Nl),e},Tl.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],Dl),e});var Al=Tl,$l={exports:{}};$l.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",o="second",i="minute",s="hour",l="day",a="week",c="month",h="quarter",u="year",d="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},y=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},v={s:y,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+y(r,2,"0")+":"+y(o,2,"0")},m:function e(t,n){if(t.date()1)return e(s[0])}else{var l=t.name;b[l]=t,o=l}return!r&&o&&(w=o),o||!r&&w},M=function(e,t){if(S(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new C(n)},O=v;O.l=k,O.i=S,O.w=function(e,t){return M(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function g(e){this.$L=k(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var y=g.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(O.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 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(t)}(e),this.init()},y.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()},y.$utils=function(){return O},y.isValid=function(){return!(this.$d.toString()===f)},y.isSame=function(e,t){var n=M(e);return this.startOf(t)<=n&&n<=this.endOf(t)},y.isAfter=function(e,t){return M(e)68?1900:2e3)},l=function(e){return function(t){this[e]=+t}},a=[/[+-]\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=i[e];return t&&(t.indexOf?t:t.s.concat(t.f))},h=function(e,t){var n,r=i.meridiem;if(r){for(var o=1;o<=24;o+=1)if(e.indexOf(r(o,0,t))>-1){n=o>12;break}}else n=e===(t?"pm":"PM");return n},u={A:[o,function(e){this.afternoon=h(e,!1)}],a:[o,function(e){this.afternoon=h(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,l("seconds")],ss:[r,l("seconds")],m:[r,l("minutes")],mm:[r,l("minutes")],H:[r,l("hours")],h:[r,l("hours")],HH:[r,l("hours")],hh:[r,l("hours")],D:[r,l("day")],DD:[n,l("day")],Do:[o,function(e){var t=i.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,l("month")],MM:[n,l("month")],MMM:[o,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:[o,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,l("year")],YY:[n,function(e){this.year=s(e)}],YYYY:[/\d{4}/,l("year")],Z:a,ZZ:a};function d(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(t,n,r){var i=r&&r.toUpperCase();return n||o[r]||e[r]||o[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),l=s.length,a=0;a-1)return new Date(("X"===t?1e3:1)*e);var r=d(t)(e),o=r.year,i=r.month,s=r.day,l=r.hours,a=r.minutes,c=r.seconds,h=r.milliseconds,u=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 y=l||0,v=a||0,w=c||0,b=h||0;return u?new Date(Date.UTC(m,g,p,y,v,w,b+60*u.offset*1e3)):n?new Date(Date.UTC(m,g,p,y,v,w,b)):new Date(m,g,p,y,v,w,b)}catch(x){return new Date("")}}(t,l,r),this.init(),u&&!0!==u&&(this.$L=this.locale(u).$L),h&&t!=this.format(l)&&(this.$d=new Date("")),i={}}else if(l instanceof Array)for(var f=l.length,p=1;p<=f;p+=1){s[1]=l[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,e)}}}();const Il=e(Pl.exports);function Rl(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)}))}}} + */function ll(e){return(ll="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)}function al(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]&&arguments[1],n=e.to,r=e.from;if(n&&(r||!1!==t)&&this.transports[n])if(t)this.transports[n]=[];else{var o=this.$_getTransportIndex(e);if(o>=0){var i=this.transports[n].slice(0);i.splice(o,1),this.transports[n]=i}}},registerTarget:function(e,t,n){cl&&(this.trackInstances&&!n&&this.targets[e]&&console.warn("[portal-vue]: Target ".concat(e," already exists")),this.$set(this.targets,e,Object.freeze([t])))},unregisterTarget:function(e){this.$delete(this.targets,e)},registerSource:function(e,t,n){cl&&(this.trackInstances&&!n&&this.sources[e]&&console.warn("[portal-vue]: source ".concat(e," already exists")),this.$set(this.sources,e,Object.freeze([t])))},unregisterSource:function(e){this.$delete(this.sources,e)},hasTarget:function(e){return!(!this.targets[e]||!this.targets[e][0])},hasSource:function(e){return!(!this.sources[e]||!this.sources[e][0])},hasContentFor:function(e){return!!this.transports[e]&&!!this.transports[e].length},$_getTransportIndex:function(e){var t=e.to,n=e.from;for(var r in this.transports[t])if(this.transports[t][r].from===n)return+r;return-1}}}),ml=new pl(ul),gl=1,yl=Vue.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function(){return String(gl++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}}},created:function(){var e=this;this.$nextTick((function(){ml.registerSource(e.name,e)}))},mounted:function(){this.disabled||this.sendUpdate()},updated:function(){this.disabled?this.clear():this.sendUpdate()},beforeDestroy:function(){ml.unregisterSource(this.name),this.clear()},watch:{to:function(e,t){t&&t!==e&&this.clear(t),this.sendUpdate()}},methods:{clear:function(e){var t={from:this.name,to:e||this.to};ml.close(t)},normalizeSlots:function(){return this.$scopedSlots.default?[this.$scopedSlots.default]:this.$slots.default},normalizeOwnChildren:function(e){return"function"==typeof e?e(this.slotProps):e},sendUpdate:function(){var e=this.normalizeSlots();if(e){var t={from:this.name,to:this.to,passengers:al(e),order:this.order};ml.open(t)}else this.clear()}},render:function(e){var t=this.$slots.default||this.$scopedSlots.default||[],n=this.tag;return t&&this.disabled?t.length<=1&&this.slim?this.normalizeOwnChildren(t)[0]:e(n,[this.normalizeOwnChildren(t)]):this.slim?e():e(n,{class:{"v-portal":!0},style:{display:"none"},key:"v-portal-placeholder"})}}),vl=Vue.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slim:{type:Boolean,default:!1},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function(){return{transports:ml.transports,firstRender:!0}},created:function(){var e=this;this.$nextTick((function(){ml.registerTarget(e.name,e)}))},watch:{ownTransports:function(){this.$emit("change",this.children().length>0)},name:function(e,t){ml.unregisterTarget(t),ml.registerTarget(e,this)}},mounted:function(){var e=this;this.transition&&this.$nextTick((function(){e.firstRender=!1}))},beforeDestroy:function(){ml.unregisterTarget(this.name)},computed:{ownTransports:function(){var e=this.transports[this.name]||[];return this.multiple?e:0===e.length?[]:[e[e.length-1]]},passengers:function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.reduce((function(e,n){var r=n.passengers[0],o="function"==typeof r?r(t):n.passengers;return e.concat(o)}),[])}(this.ownTransports,this.slotProps)}},methods:{children:function(){return 0!==this.passengers.length?this.passengers:this.$scopedSlots.default?this.$scopedSlots.default(this.slotProps):this.$slots.default||[]},noWrapper:function(){var e=this.slim&&!this.transition;return e&&this.children().length>1&&console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."),e}},render:function(e){var t=this.noWrapper(),n=this.children(),r=this.transition||this.tag;return t?n[0]:this.slim&&!r?e():e(r,{props:{tag:this.transition&&this.tag?this.tag:void 0},class:{"vue-portal-target":!0}},n)}}),wl=0,bl=["disabled","name","order","slim","slotProps","tag","to"],xl=["multiple","transition"],Sl=Vue.extend({name:"MountingPortal",inheritAttrs:!1,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:!0},disabled:{type:Boolean},name:{type:String,default:function(){return"mounted_"+String(wl++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}},multiple:{type:Boolean,default:!1},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function(){if("undefined"!=typeof document){var e=document.querySelector(this.mountTo);if(e){var t=this.$props;if(ml.targets[t.name])t.bail?console.warn("[portal-vue]: Target ".concat(t.name," is already mounted.\n Aborting because 'bail: true' is set")):this.portalTarget=ml.targets[t.name];else{var n=t.append;if(n){var r="string"==typeof n?n:"DIV",o=document.createElement(r);e.appendChild(o),e=o}var i=hl(this.$props,xl);i.slim=this.targetSlim,i.tag=this.targetTag,i.slotProps=this.targetSlotProps,i.name=this.to,this.portalTarget=new vl({el:e,parent:this.$parent||this,propsData:i})}}else console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document"))}},beforeDestroy:function(){var e=this.portalTarget;if(this.append){var t=e.$el;t.parentNode.removeChild(t)}e.$destroy()},render:function(e){if(!this.portalTarget)return console.warn("[portal-vue] Target wasn't mounted"),e();if(!this.$scopedSlots.manual){var t=hl(this.$props,bl);return e(yl,{props:t,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots.default)}var n=this.$scopedSlots.manual({to:this.to});return Array.isArray(n)&&(n=n[0]),n||e()}});var kl={install:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.component(t.portalName||"Portal",yl),e.component(t.portalTargetName||"PortalTarget",vl),e.component(t.MountingPortalName||"MountingPortal",Sl)}},Ml=new Map;function Ol(e){var t=Ml.get(e);t&&t.destroy()}function Cl(e){var t=Ml.get(e);t&&t.update()}var Nl=null;"undefined"==typeof window?((Nl=function(e){return e}).destroy=function(e){return e},Nl.update=function(e){return e}):((Nl=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&&!Ml.has(e)){var t,n=null,r=window.getComputedStyle(e),o=(t=e.value,function(){s({testForHeightReduction:""===t||!e.value.startsWith(t),restoreTextAlign:null}),t=e.value}),i=function(t){e.removeEventListener("autosize:destroy",i),e.removeEventListener("autosize:update",l),e.removeEventListener("input",o),window.removeEventListener("resize",l),Object.keys(t).forEach((function(n){return e.style[n]=t[n]})),Ml.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,textAlign:e.style.textAlign,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",i),e.addEventListener("autosize:update",l),e.addEventListener("input",o),window.addEventListener("resize",l),e.style.overflowX="hidden",e.style.wordWrap="break-word",Ml.set(e,{destroy:i,update:l}),l()}function s(t){var o,i,l=t.restoreTextAlign,a=void 0===l?null:l,c=t.testForHeightReduction,h=void 0===c||c,u=r.overflowY;if(0!==e.scrollHeight&&("vertical"===r.resize?e.style.resize="none":"both"===r.resize&&(e.style.resize="horizontal"),h&&(o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push([e.parentNode,e.parentNode.scrollTop]),e=e.parentNode;return function(){return t.forEach((function(e){var t=e[0],n=e[1];t.style.scrollBehavior="auto",t.scrollTop=n,t.style.scrollBehavior=null}))}}(e),e.style.height=""),i="content-box"===r.boxSizing?e.scrollHeight-(parseFloat(r.paddingTop)+parseFloat(r.paddingBottom)):e.scrollHeight+parseFloat(r.borderTopWidth)+parseFloat(r.borderBottomWidth),"none"!==r.maxHeight&&i>parseFloat(r.maxHeight)?("hidden"===r.overflowY&&(e.style.overflow="scroll"),i=parseFloat(r.maxHeight)):"hidden"!==r.overflowY&&(e.style.overflow="hidden"),e.style.height=i+"px",a&&(e.style.textAlign=a),o&&o(),n!==i&&(e.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),n=i),u!==r.overflow&&!a)){var d=r.textAlign;"hidden"===r.overflow&&(e.style.textAlign="start"===d?"end":"start"),s({restoreTextAlign:d,testForHeightReduction:!0})}}function l(){s({testForHeightReduction:!0,restoreTextAlign:null})}}(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],Ol),e},Nl.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],Cl),e});var Dl=Nl,Tl={exports:{}};Tl.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",o="second",i="minute",s="hour",l="day",a="week",c="month",h="quarter",u="year",d="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},y=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},v={s:y,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+y(r,2,"0")+":"+y(o,2,"0")},m:function e(t,n){if(t.date()1)return e(s[0])}else{var l=t.name;b[l]=t,o=l}return!r&&o&&(w=o),o||!r&&w},M=function(e,t){if(S(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new C(n)},O=v;O.l=k,O.i=S,O.w=function(e,t){return M(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function g(e){this.$L=k(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var y=g.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(O.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 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(t)}(e),this.init()},y.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()},y.$utils=function(){return O},y.isValid=function(){return!(this.$d.toString()===f)},y.isSame=function(e,t){var n=M(e);return this.startOf(t)<=n&&n<=this.endOf(t)},y.isAfter=function(e,t){return M(e)68?1900:2e3)},a=function(e){return function(t){this[e]=+t}},c=[/[+-]\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)}],h=function(e){var t=s[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=s.meridiem;if(r){for(var o=1;o<=24;o+=1)if(e.indexOf(r(o,0,t))>-1){n=o>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)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[o,a("seconds")],ss:[o,a("seconds")],m:[o,a("minutes")],mm:[o,a("minutes")],H:[o,a("hours")],h:[o,a("hours")],HH:[o,a("hours")],hh:[o,a("hours")],D:[o,a("day")],DD:[r,a("day")],Do:[i,function(e){var t=s.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)}],w:[o,a("week")],ww:[r,a("week")],M:[o,a("month")],MM:[r,a("month")],MMM:[i,function(e){var t=h("months"),n=(h("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=h("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,a("year")],YY:[r,function(e){this.year=l(e)}],YYYY:[/\d{4}/,a("year")],Z:c,ZZ:c};function f(n){var r,o;r=n,o=s&&s.formats;for(var i=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var i=r&&r.toUpperCase();return n||o[r]||e[r]||o[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),l=i.length,a=0;a-1)return new Date(("X"===t?1e3:1)*e);var o=f(t)(e),i=o.year,s=o.month,l=o.day,a=o.hours,c=o.minutes,h=o.seconds,u=o.milliseconds,d=o.zone,p=o.week,m=new Date,g=l||(i||s?1:m.getDate()),y=i||m.getFullYear(),v=0;i&&!s||(v=s>0?s-1:m.getMonth());var w,b=a||0,x=c||0,S=h||0,k=u||0;return d?new Date(Date.UTC(y,v,g,b,x,S,k+60*d.offset*1e3)):n?new Date(Date.UTC(y,v,g,b,x,S,k)):(w=new Date(y,v,g,b,x,S,k),p&&(w=r(w).week(p).toDate()),w)}catch(M){return new Date("")}}(t,l,r,n),this.init(),u&&!0!==u&&(this.$L=this.locale(u).$L),h&&t!=this.format(l)&&(this.$d=new Date("")),s={}}else if(l instanceof Array)for(var d=l.length,p=1;p<=d;p+=1){i[1]=l[p-1];var m=n.apply(this,i);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}p===d&&(this.$d=new Date(""))}else o.call(this,e)}}}();const El=e($l.exports);function Pl(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)}))}}} /*! * vuex v3.6.2 * (c) 2021 Evan You * @license MIT - */var zl=("undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function _l(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 o=Array.isArray(e)?[]:{};return t.push({original:e,copy:o}),Object.keys(e).forEach((function(n){o[n]=_l(e[n],t)})),o}function Bl(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}function Vl(e){return null!==e&&"object"==typeof e}var jl=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)||{}},Fl={namespaced:{configurable:!0}};Fl.namespaced.get=function(){return!!this._rawModule.namespaced},jl.prototype.addChild=function(e,t){this._children[e]=t},jl.prototype.removeChild=function(e){delete this._children[e]},jl.prototype.getChild=function(e){return this._children[e]},jl.prototype.hasChild=function(e){return e in this._children},jl.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)},jl.prototype.forEachChild=function(e){Bl(this._children,e)},jl.prototype.forEachGetter=function(e){this._rawModule.getters&&Bl(this._rawModule.getters,e)},jl.prototype.forEachAction=function(e){this._rawModule.actions&&Bl(this._rawModule.actions,e)},jl.prototype.forEachMutation=function(e){this._rawModule.mutations&&Bl(this._rawModule.mutations,e)},Object.defineProperties(jl.prototype,Fl);var Ll,Wl=function(e){this.register([],e,!1)};function ql(e,t,n){if(t.update(n),n.modules)for(var r in n.modules){if(!t.getChild(r))return;ql(e.concat(r),t.getChild(r),n.modules[r])}}Wl.prototype.get=function(e){return e.reduce((function(e,t){return e.getChild(t)}),this.root)},Wl.prototype.getNamespace=function(e){var t=this.root;return e.reduce((function(e,n){return e+((t=t.getChild(n)).namespaced?n+"/":"")}),"")},Wl.prototype.update=function(e){ql([],this.root,e)},Wl.prototype.register=function(e,t,n){var r=this;void 0===n&&(n=!0);var o=new jl(t,n);0===e.length?this.root=o:this.get(e.slice(0,-1)).addChild(e[e.length-1],o);t.modules&&Bl(t.modules,(function(t,o){r.register(e.concat(o),t,n)}))},Wl.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)},Wl.prototype.isRegistered=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1];return!!t&&t.hasChild(n)};var Jl=function(e){var t=this;void 0===e&&(e={}),!Ll&&"undefined"!=typeof window&&window.Vue&&Ql(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 Wl(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new Ll,this._makeLocalGettersCache=Object.create(null);var o=this,i=this.dispatch,s=this.commit;this.dispatch=function(e,t){return i.call(o,e,t)},this.commit=function(e,t,n){return s.call(o,e,t,n)},this.strict=r;var l=this._modules.root.state;Gl(this,l,[],this._modules.root),Ul(this,l),n.forEach((function(e){return e(t)})),(void 0!==e.devtools?e.devtools:Ll.config.devtools)&&function(e){zl&&(e._devtoolHook=zl,zl.emit("vuex:init",e),zl.on("vuex:travel-to-state",(function(t){e.replaceState(t)})),e.subscribe((function(e,t){zl.emit("vuex:mutation",e,t)}),{prepend:!0}),e.subscribeAction((function(e,t){zl.emit("vuex:action",e,t)}),{prepend:!0}))}(this)},Kl={state:{configurable:!0}};function Hl(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 Yl(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;Gl(e,n,[],e._modules.root,!0),Ul(e,n,t)}function Ul(e,t,n){var r=e._vm;e.getters={},e._makeLocalGettersCache=Object.create(null);var o=e._wrappedGetters,i={};Bl(o,(function(t,n){i[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=Ll.config.silent;Ll.config.silent=!0,e._vm=new Ll({data:{$$state:t},computed:i}),Ll.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})),Ll.nextTick((function(){return r.$destroy()})))}function Gl(e,t,n,r,o){var i=!n.length,s=e._modules.getNamespace(n);if(r.namespaced&&(e._modulesNamespaceMap[s],e._modulesNamespaceMap[s]=r),!i&&!o){var l=Zl(t,n.slice(0,-1)),a=n[n.length-1];e._withCommit((function(){Ll.set(l,a,r.state)}))}var c=r.context=function(e,t,n){var r=""===t,o={dispatch:r?e.dispatch:function(n,r,o){var i=Xl(n,r,o),s=i.payload,l=i.options,a=i.type;return l&&l.root||(a=t+a),e.dispatch(a,s)},commit:r?e.commit:function(n,r,o){var i=Xl(n,r,o),s=i.payload,l=i.options,a=i.type;l&&l.root||(a=t+a),e.commit(a,s,l)}};return Object.defineProperties(o,{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(o){if(o.slice(0,r)===t){var i=o.slice(r);Object.defineProperty(n,i,{get:function(){return e.getters[o]},enumerable:!0})}})),e._makeLocalGettersCache[t]=n}return e._makeLocalGettersCache[t]}(e,t)}},state:{get:function(){return Zl(e.state,n)}}}),o}(e,s,n);r.forEachMutation((function(t,n){!function(e,t,n,r){var o=e._mutations[t]||(e._mutations[t]=[]);o.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,o=t.handler||t;!function(e,t,n,r){var o=e._actions[t]||(e._actions[t]=[]);o.push((function(t){var o,i=n.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},t);return(o=i)&&"function"==typeof o.then||(i=Promise.resolve(i)),e._devtoolHook?i.catch((function(t){throw e._devtoolHook.emit("vuex:error",t),t})):i}))}(e,r,o,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,i){Gl(e,t,n.concat(i),r,o)}))}function Zl(e,t){return t.reduce((function(e,t){return e[t]}),e)}function Xl(e,t,n){return Vl(e)&&e.type&&(n=t,t=e,e=e.type),{type:e,payload:t,options:n}}function Ql(e){Ll&&e===Ll||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)}}(Ll=e)}Kl.state.get=function(){return this._vm._data.$$state},Kl.state.set=function(e){},Jl.prototype.commit=function(e,t,n){var r=this,o=Xl(e,t,n),i=o.type,s=o.payload,l={type:i,payload:s},a=this._mutations[i];a&&(this._withCommit((function(){a.forEach((function(e){e(s)}))})),this._subscribers.slice().forEach((function(e){return e(l,r.state)})))},Jl.prototype.dispatch=function(e,t){var n=this,r=Xl(e,t),o=r.type,i=r.payload,s={type:o,payload:i},l=this._actions[o];if(l){try{this._actionSubscribers.slice().filter((function(e){return e.before})).forEach((function(e){return e.before(s,n.state)}))}catch(c){}var a=l.length>1?Promise.all(l.map((function(e){return e(i)}))):l[0](i);return new Promise((function(e,t){a.then((function(t){try{n._actionSubscribers.filter((function(e){return e.after})).forEach((function(e){return e.after(s,n.state)}))}catch(c){}e(t)}),(function(e){try{n._actionSubscribers.filter((function(e){return e.error})).forEach((function(t){return t.error(s,n.state,e)}))}catch(c){}t(e)}))}))}},Jl.prototype.subscribe=function(e,t){return Hl(e,this._subscribers,t)},Jl.prototype.subscribeAction=function(e,t){return Hl("function"==typeof e?{before:e}:e,this._actionSubscribers,t)},Jl.prototype.watch=function(e,t,n){var r=this;return this._watcherVM.$watch((function(){return e(r.state,r.getters)}),t,n)},Jl.prototype.replaceState=function(e){var t=this;this._withCommit((function(){t._vm._data.$$state=e}))},Jl.prototype.registerModule=function(e,t,n){void 0===n&&(n={}),"string"==typeof e&&(e=[e]),this._modules.register(e,t),Gl(this,this.state,e,this._modules.get(e),n.preserveState),Ul(this,this.state)},Jl.prototype.unregisterModule=function(e){var t=this;"string"==typeof e&&(e=[e]),this._modules.unregister(e),this._withCommit((function(){var n=Zl(t.state,e.slice(0,-1));Ll.delete(n,e[e.length-1])})),Yl(this)},Jl.prototype.hasModule=function(e){return"string"==typeof e&&(e=[e]),this._modules.isRegistered(e)},Jl.prototype.hotUpdate=function(e){this._modules.update(e),Yl(this,!0)},Jl.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(Jl.prototype,Kl);var ea=ia((function(e,t){var n={};return oa(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){var t=this.$store.state,n=this.$store.getters;if(e){var r=sa(this.$store,"mapState",e);if(!r)return;t=r.context.state,n=r.context.getters}return"function"==typeof o?o.call(this,t,n):t[o]},n[r].vuex=!0})),n})),ta=ia((function(e,t){var n={};return oa(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=this.$store.commit;if(e){var i=sa(this.$store,"mapMutations",e);if(!i)return;r=i.context.commit}return"function"==typeof o?o.apply(this,[r].concat(t)):r.apply(this.$store,[o].concat(t))}})),n})),na=ia((function(e,t){var n={};return oa(t).forEach((function(t){var r=t.key,o=t.val;o=e+o,n[r]=function(){if(!e||sa(this.$store,"mapGetters",e))return this.$store.getters[o]},n[r].vuex=!0})),n})),ra=ia((function(e,t){var n={};return oa(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=this.$store.dispatch;if(e){var i=sa(this.$store,"mapActions",e);if(!i)return;r=i.context.dispatch}return"function"==typeof o?o.apply(this,[r].concat(t)):r.apply(this.$store,[o].concat(t))}})),n}));function oa(e){return function(e){return Array.isArray(e)||Vl(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 ia(e){return function(t,n){return"string"!=typeof t?(n=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,n)}}function sa(e,t,n){return e._modulesNamespaceMap[n]}function la(e,t,n){var r=n?e.groupCollapsed:e.group;try{r.call(e,t)}catch(o){e.log(t)}}function aa(e){try{e.groupEnd()}catch(t){e.log("—— log end ——")}}function ca(){var e=new Date;return" @ "+ha(e.getHours(),2)+":"+ha(e.getMinutes(),2)+":"+ha(e.getSeconds(),2)+"."+ha(e.getMilliseconds(),3)}function ha(e,t){return n="0",r=t-e.toString().length,new Array(r+1).join(n)+e;var n,r}const ua={Store:Jl,install:Ql,version:"3.6.2",mapState:ea,mapMutations:ta,mapGetters:na,mapActions:ra,createNamespacedHelpers:function(e){return{mapState:ea.bind(null,e),mapGetters:na.bind(null,e),mapMutations:ta.bind(null,e),mapActions:ra.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 o=e.mutationTransformer;void 0===o&&(o=function(e){return e});var i=e.actionFilter;void 0===i&&(i=function(e,t){return!0});var s=e.actionTransformer;void 0===s&&(s=function(e){return e});var l=e.logMutations;void 0===l&&(l=!0);var a=e.logActions;void 0===a&&(a=!0);var c=e.logger;return void 0===c&&(c=console),function(e){var h=_l(e.state);void 0!==c&&(l&&e.subscribe((function(e,i){var s=_l(i);if(n(e,h,s)){var l=ca(),a=o(e),u="mutation "+e.type+l;la(c,u,t),c.log("%c prev state","color: #9E9E9E; font-weight: bold",r(h)),c.log("%c mutation","color: #03A9F4; font-weight: bold",a),c.log("%c next state","color: #4CAF50; font-weight: bold",r(s)),aa(c)}h=s})),a&&e.subscribeAction((function(e,n){if(i(e,n)){var r=ca(),o=s(e),l="action "+e.type+r;la(c,l,t),c.log("%c action","color: #03A9F4; font-weight: bold",o),aa(c)}})))}}};var da={},fa={};function pa(e){return null==e}function ma(e){return null!=e}function ga(e,t){return t.tag===e.tag&&t.key===e.key}function ya(e){var t=e.tag;e.vm=new t({data:e.args})}function va(e,t,n){var r,o,i={};for(r=t;r<=n;++r)ma(o=e[r].key)&&(i[o]=r);return i}function wa(e,t,n){for(;t<=n;++t)ya(e[t])}function ba(e,t,n){for(;t<=n;++t){var r=e[t];ma(r)&&(r.vm.$destroy(),r.vm=null)}}function xa(e,t){e!==t&&(t.vm=e.vm,function(e){for(var t=Object.keys(e.args),n=0;nl?wa(t,s,h):s>h&&ba(e,i,l)}(e,t):ma(t)?wa(t,0,t.length-1):ma(e)&&ba(e,0,e.length-1)},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Vuelidate=C,e.validationMixin=e.default=void 0,Object.defineProperty(e,"withParams",{enumerable:!0,get:function(){return n.withParams}});var t=fa,n=i;function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?l:l.$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 o=r.constructor;this._indirectWatcher=new o(this,(function(){return e.runRule(t)}),null,{lazy:!0})}var i=this.getModel();if(!this._indirectWatcher.dirty&&this._lastModel===i)return this._indirectWatcher.depend(),r.value;this._lastModel=i,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[m]?!!e.v:!!e},$pending:function(){var e=this.run.output;return!!e[m]&&e.p}},destroyed:function(){this._indirectWatcher&&(this._indirectWatcher.teardown(),this._indirectWatcher=null)}}),s=o.extend({data:function(){return{dirty:!1,validations:null,lazyModel:null,model:null,prop:null,lazyParentModel:null,rootModel:null}},methods:l(l({},v),{},{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:l(l({},g),{},{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(w,(function(t){return{enumerable:!0,configurable:!0,get:function(){return e[t]}}})),r=u(b,(function(t){return{enumerable:!1,configurable:!0,get:function(){return e[t]}}})),o=this.hasIter()?{$iter:{enumerable:!0,value:Object.defineProperties({},l({},t))}}:{};return Object.defineProperties({},l(l(l(l({},t),o),{},{$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 y(e,t)}))),r(this.ruleKeys.map((function(t){return S(e,t)})))).filter(Boolean)}})}),a=s.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}}}}}),c=s.extend({computed:{keys:function(){var e=this.getModel();return f(e)?Object.keys(e):[]},tracker:function(){var e=this,t=this.validations.$trackBy;return t?function(n){return"".concat(p(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(),o=l({},n);delete o.$trackBy;var i={};return this.keys.map((function(n){var l=e.tracker(n);return i.hasOwnProperty(l)?null:(i[l]=!0,(0,t.h)(s,l,{validations:o,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}}}),y=function(e,n){if("$each"===n)return(0,t.h)(c,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 o=e.rootModel,i=u(r,(function(e){return function(){return p(o,o.$v,e)}}),(function(e){return Array.isArray(e)?e.join("."):e}));return(0,t.h)(a,n,{validations:i,lazyParentModel:h,prop:n,lazyModel:h,rootModel:o})}return(0,t.h)(s,n,{validations:r,lazyParentModel:e.getModel,prop:n,lazyModel:e.getModelKey,rootModel:e.rootModel})},S=function(e,n){return(0,t.h)(i,n,{rule:e.validations[n],lazyParentModel:e.lazyParentModel,lazyModel:e.getModel,rootModel:e.rootModel})};return x={VBase:o,Validation:s}},k=null;var M=function(e,n){var r=function(e){if(k)return k;for(var t=e.constructor;t.super;)t=t.super;return k=t,t}(e),o=S(r),i=o.Validation;return new(0,o.VBase)({computed:{children:function(){var r="function"==typeof n?n.call(e):n;return[(0,t.h)(i,"$v",{validations:r,lazyParentModel:h,prop:"$v",model:e,rootModel:e})]}}})},O={data:function(){var e=this.$options.validations;return e&&(this._vuelidate=M(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(O)}e.validationMixin=O;var N=C;e.default=N}(da);const Sa=e(da);export{Ol as A,El as B,Il as C,nt as D,wn as E,ue as F,Al as G,Rl as H,Ss as I,Sa as J,an as N,xn as P,ye as S,sn as T,ua as V,rs as a,fs as b,gs as c,Ns as d,ss as e,Ds as f,zs as g,Bs as h,js as i,et as j,Zi as k,Vs as l,Ms as m,Ii as n,dt as o,xs as p,il as q,sl as r,ps as s,ms as t,Cs as u,t as v,_s as w,ll as x,al as y,rl as z}; + */var Il=("undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function Rl(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 o=Array.isArray(e)?[]:{};return t.push({original:e,copy:o}),Object.keys(e).forEach((function(n){o[n]=Rl(e[n],t)})),o}function zl(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}function _l(e){return null!==e&&"object"==typeof e}var Bl=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)||{}},Vl={namespaced:{configurable:!0}};Vl.namespaced.get=function(){return!!this._rawModule.namespaced},Bl.prototype.addChild=function(e,t){this._children[e]=t},Bl.prototype.removeChild=function(e){delete this._children[e]},Bl.prototype.getChild=function(e){return this._children[e]},Bl.prototype.hasChild=function(e){return e in this._children},Bl.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)},Bl.prototype.forEachChild=function(e){zl(this._children,e)},Bl.prototype.forEachGetter=function(e){this._rawModule.getters&&zl(this._rawModule.getters,e)},Bl.prototype.forEachAction=function(e){this._rawModule.actions&&zl(this._rawModule.actions,e)},Bl.prototype.forEachMutation=function(e){this._rawModule.mutations&&zl(this._rawModule.mutations,e)},Object.defineProperties(Bl.prototype,Vl);var jl,Fl=function(e){this.register([],e,!1)};function Ll(e,t,n){if(t.update(n),n.modules)for(var r in n.modules){if(!t.getChild(r))return;Ll(e.concat(r),t.getChild(r),n.modules[r])}}Fl.prototype.get=function(e){return e.reduce((function(e,t){return e.getChild(t)}),this.root)},Fl.prototype.getNamespace=function(e){var t=this.root;return e.reduce((function(e,n){return e+((t=t.getChild(n)).namespaced?n+"/":"")}),"")},Fl.prototype.update=function(e){Ll([],this.root,e)},Fl.prototype.register=function(e,t,n){var r=this;void 0===n&&(n=!0);var o=new Bl(t,n);0===e.length?this.root=o:this.get(e.slice(0,-1)).addChild(e[e.length-1],o);t.modules&&zl(t.modules,(function(t,o){r.register(e.concat(o),t,n)}))},Fl.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)},Fl.prototype.isRegistered=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1];return!!t&&t.hasChild(n)};var Wl=function(e){var t=this;void 0===e&&(e={}),!jl&&"undefined"!=typeof window&&window.Vue&&Zl(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 Fl(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new jl,this._makeLocalGettersCache=Object.create(null);var o=this,i=this.dispatch,s=this.commit;this.dispatch=function(e,t){return i.call(o,e,t)},this.commit=function(e,t,n){return s.call(o,e,t,n)},this.strict=r;var l=this._modules.root.state;Yl(this,l,[],this._modules.root),Hl(this,l),n.forEach((function(e){return e(t)})),(void 0!==e.devtools?e.devtools:jl.config.devtools)&&function(e){Il&&(e._devtoolHook=Il,Il.emit("vuex:init",e),Il.on("vuex:travel-to-state",(function(t){e.replaceState(t)})),e.subscribe((function(e,t){Il.emit("vuex:mutation",e,t)}),{prepend:!0}),e.subscribeAction((function(e,t){Il.emit("vuex:action",e,t)}),{prepend:!0}))}(this)},ql={state:{configurable:!0}};function Jl(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 Kl(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;Yl(e,n,[],e._modules.root,!0),Hl(e,n,t)}function Hl(e,t,n){var r=e._vm;e.getters={},e._makeLocalGettersCache=Object.create(null);var o=e._wrappedGetters,i={};zl(o,(function(t,n){i[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=jl.config.silent;jl.config.silent=!0,e._vm=new jl({data:{$$state:t},computed:i}),jl.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})),jl.nextTick((function(){return r.$destroy()})))}function Yl(e,t,n,r,o){var i=!n.length,s=e._modules.getNamespace(n);if(r.namespaced&&(e._modulesNamespaceMap[s],e._modulesNamespaceMap[s]=r),!i&&!o){var l=Ul(t,n.slice(0,-1)),a=n[n.length-1];e._withCommit((function(){jl.set(l,a,r.state)}))}var c=r.context=function(e,t,n){var r=""===t,o={dispatch:r?e.dispatch:function(n,r,o){var i=Gl(n,r,o),s=i.payload,l=i.options,a=i.type;return l&&l.root||(a=t+a),e.dispatch(a,s)},commit:r?e.commit:function(n,r,o){var i=Gl(n,r,o),s=i.payload,l=i.options,a=i.type;l&&l.root||(a=t+a),e.commit(a,s,l)}};return Object.defineProperties(o,{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(o){if(o.slice(0,r)===t){var i=o.slice(r);Object.defineProperty(n,i,{get:function(){return e.getters[o]},enumerable:!0})}})),e._makeLocalGettersCache[t]=n}return e._makeLocalGettersCache[t]}(e,t)}},state:{get:function(){return Ul(e.state,n)}}}),o}(e,s,n);r.forEachMutation((function(t,n){!function(e,t,n,r){var o=e._mutations[t]||(e._mutations[t]=[]);o.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,o=t.handler||t;!function(e,t,n,r){var o=e._actions[t]||(e._actions[t]=[]);o.push((function(t){var o,i=n.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},t);return(o=i)&&"function"==typeof o.then||(i=Promise.resolve(i)),e._devtoolHook?i.catch((function(t){throw e._devtoolHook.emit("vuex:error",t),t})):i}))}(e,r,o,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,i){Yl(e,t,n.concat(i),r,o)}))}function Ul(e,t){return t.reduce((function(e,t){return e[t]}),e)}function Gl(e,t,n){return _l(e)&&e.type&&(n=t,t=e,e=e.type),{type:e,payload:t,options:n}}function Zl(e){jl&&e===jl||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)}}(jl=e)}ql.state.get=function(){return this._vm._data.$$state},ql.state.set=function(e){},Wl.prototype.commit=function(e,t,n){var r=this,o=Gl(e,t,n),i=o.type,s=o.payload,l={type:i,payload:s},a=this._mutations[i];a&&(this._withCommit((function(){a.forEach((function(e){e(s)}))})),this._subscribers.slice().forEach((function(e){return e(l,r.state)})))},Wl.prototype.dispatch=function(e,t){var n=this,r=Gl(e,t),o=r.type,i=r.payload,s={type:o,payload:i},l=this._actions[o];if(l){try{this._actionSubscribers.slice().filter((function(e){return e.before})).forEach((function(e){return e.before(s,n.state)}))}catch(c){}var a=l.length>1?Promise.all(l.map((function(e){return e(i)}))):l[0](i);return new Promise((function(e,t){a.then((function(t){try{n._actionSubscribers.filter((function(e){return e.after})).forEach((function(e){return e.after(s,n.state)}))}catch(c){}e(t)}),(function(e){try{n._actionSubscribers.filter((function(e){return e.error})).forEach((function(t){return t.error(s,n.state,e)}))}catch(c){}t(e)}))}))}},Wl.prototype.subscribe=function(e,t){return Jl(e,this._subscribers,t)},Wl.prototype.subscribeAction=function(e,t){return Jl("function"==typeof e?{before:e}:e,this._actionSubscribers,t)},Wl.prototype.watch=function(e,t,n){var r=this;return this._watcherVM.$watch((function(){return e(r.state,r.getters)}),t,n)},Wl.prototype.replaceState=function(e){var t=this;this._withCommit((function(){t._vm._data.$$state=e}))},Wl.prototype.registerModule=function(e,t,n){void 0===n&&(n={}),"string"==typeof e&&(e=[e]),this._modules.register(e,t),Yl(this,this.state,e,this._modules.get(e),n.preserveState),Hl(this,this.state)},Wl.prototype.unregisterModule=function(e){var t=this;"string"==typeof e&&(e=[e]),this._modules.unregister(e),this._withCommit((function(){var n=Ul(t.state,e.slice(0,-1));jl.delete(n,e[e.length-1])})),Kl(this)},Wl.prototype.hasModule=function(e){return"string"==typeof e&&(e=[e]),this._modules.isRegistered(e)},Wl.prototype.hotUpdate=function(e){this._modules.update(e),Kl(this,!0)},Wl.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(Wl.prototype,ql);var Xl=ra((function(e,t){var n={};return na(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){var t=this.$store.state,n=this.$store.getters;if(e){var r=oa(this.$store,"mapState",e);if(!r)return;t=r.context.state,n=r.context.getters}return"function"==typeof o?o.call(this,t,n):t[o]},n[r].vuex=!0})),n})),Ql=ra((function(e,t){var n={};return na(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=this.$store.commit;if(e){var i=oa(this.$store,"mapMutations",e);if(!i)return;r=i.context.commit}return"function"==typeof o?o.apply(this,[r].concat(t)):r.apply(this.$store,[o].concat(t))}})),n})),ea=ra((function(e,t){var n={};return na(t).forEach((function(t){var r=t.key,o=t.val;o=e+o,n[r]=function(){if(!e||oa(this.$store,"mapGetters",e))return this.$store.getters[o]},n[r].vuex=!0})),n})),ta=ra((function(e,t){var n={};return na(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=this.$store.dispatch;if(e){var i=oa(this.$store,"mapActions",e);if(!i)return;r=i.context.dispatch}return"function"==typeof o?o.apply(this,[r].concat(t)):r.apply(this.$store,[o].concat(t))}})),n}));function na(e){return function(e){return Array.isArray(e)||_l(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 ra(e){return function(t,n){return"string"!=typeof t?(n=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,n)}}function oa(e,t,n){return e._modulesNamespaceMap[n]}function ia(e,t,n){var r=n?e.groupCollapsed:e.group;try{r.call(e,t)}catch(o){e.log(t)}}function sa(e){try{e.groupEnd()}catch(t){e.log("—— log end ——")}}function la(){var e=new Date;return" @ "+aa(e.getHours(),2)+":"+aa(e.getMinutes(),2)+":"+aa(e.getSeconds(),2)+"."+aa(e.getMilliseconds(),3)}function aa(e,t){return n="0",r=t-e.toString().length,new Array(r+1).join(n)+e;var n,r}var ca={Store:Wl,install:Zl,version:"3.6.2",mapState:Xl,mapMutations:Ql,mapGetters:ea,mapActions:ta,createNamespacedHelpers:function(e){return{mapState:Xl.bind(null,e),mapGetters:ea.bind(null,e),mapMutations:Ql.bind(null,e),mapActions:ta.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 o=e.mutationTransformer;void 0===o&&(o=function(e){return e});var i=e.actionFilter;void 0===i&&(i=function(e,t){return!0});var s=e.actionTransformer;void 0===s&&(s=function(e){return e});var l=e.logMutations;void 0===l&&(l=!0);var a=e.logActions;void 0===a&&(a=!0);var c=e.logger;return void 0===c&&(c=console),function(e){var h=Rl(e.state);void 0!==c&&(l&&e.subscribe((function(e,i){var s=Rl(i);if(n(e,h,s)){var l=la(),a=o(e),u="mutation "+e.type+l;ia(c,u,t),c.log("%c prev state","color: #9E9E9E; font-weight: bold",r(h)),c.log("%c mutation","color: #03A9F4; font-weight: bold",a),c.log("%c next state","color: #4CAF50; font-weight: bold",r(s)),sa(c)}h=s})),a&&e.subscribeAction((function(e,n){if(i(e,n)){var r=la(),o=s(e),l="action "+e.type+r;ia(c,l,t),c.log("%c action","color: #03A9F4; font-weight: bold",o),sa(c)}})))}}},ha={},ua={};function da(e){return null==e}function fa(e){return null!=e}function pa(e,t){return t.tag===e.tag&&t.key===e.key}function ma(e){var t=e.tag;e.vm=new t({data:e.args})}function ga(e,t,n){var r,o,i={};for(r=t;r<=n;++r)fa(o=e[r].key)&&(i[o]=r);return i}function ya(e,t,n){for(;t<=n;++t)ma(e[t])}function va(e,t,n){for(;t<=n;++t){var r=e[t];fa(r)&&(r.vm.$destroy(),r.vm=null)}}function wa(e,t){e!==t&&(t.vm=e.vm,function(e){for(var t=Object.keys(e.args),n=0;nl?ya(t,s,h):s>h&&va(e,i,l)}(e,t):fa(t)?ya(t,0,t.length-1):fa(e)&&va(e,0,e.length-1)},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Vuelidate=C,e.validationMixin=e.default=void 0,Object.defineProperty(e,"withParams",{enumerable:!0,get:function(){return n.withParams}});var t=ua,n=i;function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?l:l.$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 o=r.constructor;this._indirectWatcher=new o(this,(function(){return e.runRule(t)}),null,{lazy:!0})}var i=this.getModel();if(!this._indirectWatcher.dirty&&this._lastModel===i)return this._indirectWatcher.depend(),r.value;this._lastModel=i,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[m]?!!e.v:!!e},$pending:function(){var e=this.run.output;return!!e[m]&&e.p}},destroyed:function(){this._indirectWatcher&&(this._indirectWatcher.teardown(),this._indirectWatcher=null)}}),s=o.extend({data:function(){return{dirty:!1,validations:null,lazyModel:null,model:null,prop:null,lazyParentModel:null,rootModel:null}},methods:l(l({},v),{},{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:l(l({},g),{},{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(w,(function(t){return{enumerable:!0,configurable:!0,get:function(){return e[t]}}})),r=u(b,(function(t){return{enumerable:!1,configurable:!0,get:function(){return e[t]}}})),o=this.hasIter()?{$iter:{enumerable:!0,value:Object.defineProperties({},l({},t))}}:{};return Object.defineProperties({},l(l(l(l({},t),o),{},{$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 y(e,t)}))),r(this.ruleKeys.map((function(t){return S(e,t)})))).filter(Boolean)}})}),a=s.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}}}}}),c=s.extend({computed:{keys:function(){var e=this.getModel();return f(e)?Object.keys(e):[]},tracker:function(){var e=this,t=this.validations.$trackBy;return t?function(n){return"".concat(p(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(),o=l({},n);delete o.$trackBy;var i={};return this.keys.map((function(n){var l=e.tracker(n);return i.hasOwnProperty(l)?null:(i[l]=!0,(0,t.h)(s,l,{validations:o,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}}}),y=function(e,n){if("$each"===n)return(0,t.h)(c,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 o=e.rootModel,i=u(r,(function(e){return function(){return p(o,o.$v,e)}}),(function(e){return Array.isArray(e)?e.join("."):e}));return(0,t.h)(a,n,{validations:i,lazyParentModel:h,prop:n,lazyModel:h,rootModel:o})}return(0,t.h)(s,n,{validations:r,lazyParentModel:e.getModel,prop:n,lazyModel:e.getModelKey,rootModel:e.rootModel})},S=function(e,n){return(0,t.h)(i,n,{rule:e.validations[n],lazyParentModel:e.lazyParentModel,lazyModel:e.getModel,rootModel:e.rootModel})};return x={VBase:o,Validation:s}},k=null;var M=function(e,n){var r=function(e){if(k)return k;for(var t=e.constructor;t.super;)t=t.super;return k=t,t}(e),o=S(r),i=o.Validation;return new(0,o.VBase)({computed:{children:function(){var r="function"==typeof n?n.call(e):n;return[(0,t.h)(i,"$v",{validations:r,lazyParentModel:h,prop:"$v",model:e,rootModel:e})]}}})},O={data:function(){var e=this.$options.validations;return e&&(this._vuelidate=M(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(O)}e.validationMixin=O;var N=C;e.default=N}(ha);const ba=e(ha);export{kl as A,Al as B,El as C,nt as D,wn as E,ue as F,Dl as G,Pl as H,xs as I,ca as J,an as N,xn as P,ye as S,sn as T,ba as V,rs as a,ds as b,ms as c,Os as d,ss as e,Cs as f,Is as g,zs as h,Bs as i,et as j,Zi as k,_s as l,Ss as m,Ii as n,dt as o,bs as p,rl as q,ol as r,fs as s,ps as t,Ms as u,t as v,Rs as w,il as x,sl as y,tl as z}; diff --git a/panel/dist/js/vuedraggable.min.js b/panel/dist/js/vuedraggable.min.js index 05b004fa8e..68f3aaa46c 100644 --- a/panel/dist/js/vuedraggable.min.js +++ b/panel/dist/js/vuedraggable.min.js @@ -4,4 +4,4 @@ * @author owenm * @license MIT */ -function t(e){return(t="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})(e)}function e(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n(){return n=Object.assign||function(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function r(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var a=r(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),l=r(/Edge/i),s=r(/firefox/i),c=r(/safari/i)&&!r(/chrome/i)&&!r(/android/i),d=r(/iP(ad|od|hone)/i),u=r(/chrome/i)&&r(/android/i),h={capture:!1,passive:!1};function f(t,e,n){t.addEventListener(e,n,!a&&h)}function p(t,e,n){t.removeEventListener(e,n,!a&&h)}function g(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(n){return!1}return!1}}function m(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function v(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&g(t,e):g(t,e))||o&&t===n)return t;if(t===n)break}while(t=m(t))}return null}var b,y=/\s+/g;function w(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(y," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(y," ")}}function E(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function D(t,e){var n="";if("string"==typeof t)n=t;else do{var o=E(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function _(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i=r:i<=r))return o;if(o===S())break;o=N(o,!1)}return!1}function T(t,e,n){for(var o=0,i=0,r=t.children;i2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,a=i(n,["evt"]);$.pluginEvent.bind(At)(t,e,o({dragEl:H,parentEl:W,ghostEl:V,rootEl:U,nextEl:z,lastDownEl:G,cloneEl:q,cloneHidden:J,dragStarted:ct,putSortable:nt,activeSortable:At.active,originalEvent:r,oldIndex:Z,oldDraggableIndex:Q,newIndex:K,newDraggableIndex:tt,hideGhostForTarget:It,unhideGhostForTarget:Mt,cloneNowHidden:function(){J=!0},cloneNowShown:function(){J=!1},dispatchSortableEvent:function(t){j({sortable:e,name:t,originalEvent:r})}},a))};function j(t){!function(t){var e=t.sortable,n=t.rootEl,i=t.name,r=t.targetEl,s=t.cloneEl,c=t.toEl,d=t.fromEl,u=t.oldIndex,h=t.newIndex,f=t.oldDraggableIndex,p=t.newDraggableIndex,g=t.originalEvent,m=t.putSortable,v=t.extraEventProperties;if(e=e||n&&n[R]){var b,y=e.options,w="on"+i.charAt(0).toUpperCase()+i.substr(1);!window.CustomEvent||a||l?(b=document.createEvent("Event")).initEvent(i,!0,!0):b=new CustomEvent(i,{bubbles:!0,cancelable:!0}),b.to=c||n,b.from=d||n,b.item=r||n,b.clone=s,b.oldIndex=u,b.newIndex=h,b.oldDraggableIndex=f,b.newDraggableIndex=p,b.originalEvent=g,b.pullMode=m?m.lastPutMode:void 0;var E=o({},v,$.getEventProperties(i,e));for(var D in E)b[D]=E[D];n&&n.dispatchEvent(b),y[w]&&y[w].call(e,b)}}(o({putSortable:nt,cloneEl:q,targetEl:H,rootEl:U,oldIndex:Z,oldDraggableIndex:Q,newIndex:K,newDraggableIndex:tt},t))}var H,W,V,U,z,G,q,J,Z,K,Q,tt,et,nt,ot,it,rt,at,lt,st,ct,dt,ut,ht,ft,pt=!1,gt=!1,mt=[],vt=!1,bt=!1,yt=[],wt=!1,Et=[],Dt="undefined"!=typeof document,_t=d,St=l||a?"cssFloat":"float",Ct=Dt&&!u&&!d&&"draggable"in document.createElement("div"),xt=function(){if(Dt){if(a)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Tt=function(t,e){var n=E(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=T(t,0,e),r=T(t,1,e),a=i&&E(i),l=r&&E(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+C(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+C(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){var d="left"===a.float?"left":"right";return!r||"both"!==l.clear&&l.clear!==d?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=o&&"none"===n[St]||r&&"none"===n[St]&&s+c>o)?"vertical":"horizontal"},Ot=function(e){function n(t,e){return function(o,i,r,a){var l=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==t&&(e||l))return!0;if(null==t||!1===t)return!1;if(e&&"clone"===t)return t;if("function"==typeof t)return n(t(o,i,r,a),e)(o,i,r,a);var s=(e?o:i).options.group.name;return!0===t||"string"==typeof t&&t===s||t.join&&t.indexOf(s)>-1}}var o={},i=e.group;i&&"object"==t(i)||(i={name:i}),o.name=i.name,o.checkPull=n(i.pull,!0),o.checkPut=n(i.put),o.revertClone=i.revertClone,e.group=o},It=function(){!xt&&V&&E(V,"display","none")},Mt=function(){!xt&&V&&E(V,"display","")};Dt&&document.addEventListener("click",(function(t){if(gt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),gt=!1,!1}),!0);var Nt=function(t){if(H){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,mt.some((function(t){if(!O(t)){var e=C(t),n=t[R].options.emptyInsertThreshold,o=i>=e.left-n&&i<=e.right+n,l=r>=e.top-n&&r<=e.bottom+n;return n&&o&&l?a=t:void 0}})),a);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[R]._onDragOver(n)}}var i,r,a},Pt=function(t){H&&H.parentNode[R]._isOutsideThisEl(t.target)};function At(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=n({},e),t[R]=this;var o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Tt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==At.supportPointer&&"PointerEvent"in window,emptyInsertThreshold:5};for(var i in $.initializePlugins(this,t,o),o)!(i in e)&&(e[i]=o[i]);for(var r in Ot(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Ct,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?f(t,"pointerdown",this._onTapStart):(f(t,"mousedown",this._onTapStart),f(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(f(t,"dragover",this),f(t,"dragenter",this)),mt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),n(this,X())}function kt(t,e,n,o,i,r,s,c){var d,u,h=t[R],f=h.options.onMove;return!window.CustomEvent||a||l?(d=document.createEvent("Event")).initEvent("move",!0,!0):d=new CustomEvent("move",{bubbles:!0,cancelable:!0}),d.to=e,d.from=t,d.dragged=n,d.draggedRect=o,d.related=i||e,d.relatedRect=r||C(e),d.willInsertAfter=c,d.originalEvent=s,t.dispatchEvent(d),f&&(u=f.call(h,d,s)),u}function Ft(t){t.draggable=!1}function Rt(){wt=!1}function Xt(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Lt(t){return setTimeout(t,0)}function Yt(t){return clearTimeout(t)}At.prototype={constructor:At,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(dt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,H):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,i=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,l=(a||t).target,s=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=o.filter;if(function(t){Et.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Et.push(o)}}(n),!H&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled||s.isContentEditable||(l=v(l,o.draggable,n,!1))&&l.animated||G===l)){if(Z=I(l),Q=I(l,o.draggable),"function"==typeof c){if(c.call(this,t,l,this))return j({sortable:e,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),B("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=v(s,o.trim(),n,!1))return j({sortable:e,rootEl:o,name:"filter",targetEl:l,fromEl:n,toEl:n}),B("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!v(s,o.handle,n,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,c=i.options,d=r.ownerDocument;if(n&&!H&&n.parentNode===r){var u=C(n);if(U=r,W=(H=n).parentNode,z=H.nextSibling,G=n,et=c.group,At.dragged=H,ot={target:H,clientX:(e||t).clientX,clientY:(e||t).clientY},lt=ot.clientX-u.left,st=ot.clientY-u.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,H.style["will-change"]="all",o=function(){B("delayEnded",i,{evt:t}),At.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!s&&i.nativeDraggable&&(H.draggable=!0),i._triggerDragStart(t,e),j({sortable:i,name:"choose",originalEvent:t}),w(H,c.chosenClass,!0))},c.ignore.split(",").forEach((function(t){_(H,t.trim(),Ft)})),f(d,"dragover",Nt),f(d,"mousemove",Nt),f(d,"touchmove",Nt),f(d,"mouseup",i._onDrop),f(d,"touchend",i._onDrop),f(d,"touchcancel",i._onDrop),s&&this.nativeDraggable&&(this.options.touchStartThreshold=4,H.draggable=!0),B("delayStart",this,{evt:t}),!c.delay||c.delayOnTouchOnly&&!e||this.nativeDraggable&&(l||a))o();else{if(At.eventCanceled)return void this._onDrop();f(d,"mouseup",i._disableDelayedDrag),f(d,"touchend",i._disableDelayedDrag),f(d,"touchcancel",i._disableDelayedDrag),f(d,"mousemove",i._delayedDragTouchMoveHandler),f(d,"touchmove",i._delayedDragTouchMoveHandler),c.supportPointer&&f(d,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,c.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){H&&Ft(H),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;p(t,"mouseup",this._disableDelayedDrag),p(t,"touchend",this._disableDelayedDrag),p(t,"touchcancel",this._disableDelayedDrag),p(t,"mousemove",this._delayedDragTouchMoveHandler),p(t,"touchmove",this._delayedDragTouchMoveHandler),p(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?f(document,"pointermove",this._onTouchMove):f(document,e?"touchmove":"mousemove",this._onTouchMove):(f(H,"dragend",this),f(U,"dragstart",this._onDragStart));try{document.selection?Lt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(pt=!1,U&&H){B("dragStarted",this,{evt:e}),this.nativeDraggable&&f(document,"dragover",Pt);var n=this.options;!t&&w(H,n.dragClass,!1),w(H,n.ghostClass,!0),At.active=this,t&&this._appendGhost(),j({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(it){this._lastX=it.clientX,this._lastY=it.clientY,It();for(var t=document.elementFromPoint(it.clientX,it.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(it.clientX,it.clientY))!==e;)e=t;if(H.parentNode[R]._isOutsideThisEl(t),e)do{if(e[R]){if(e[R]._onDragOver({clientX:it.clientX,clientY:it.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Mt()}},_onTouchMove:function(t){if(ot){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=V&&D(V,!0),a=V&&r&&r.a,l=V&&r&&r.d,s=_t&&ft&&M(ft),c=(i.clientX-ot.clientX+o.x)/(a||1)+(s?s[0]-yt[0]:0)/(a||1),d=(i.clientY-ot.clientY+o.y)/(l||1)+(s?s[1]-yt[1]:0)/(l||1);if(!At.active&&!pt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))o.right+i||t.clientX<=o.right&&t.clientY>o.bottom&&t.clientX>=o.left:t.clientX>o.right&&t.clientY>o.top||t.clientX<=o.right&&t.clientY>o.bottom+i}(t,r,this)&&!m.animated){if(m===H)return $(!1);if(m&&a===t.target&&(l=m),l&&(n=C(l)),!1!==kt(U,a,H,e,l,n,t,!!l))return Y(),a.appendChild(H),W=a,G(),$(!0)}else if(l.parentNode===a){n=C(l);var b,y,D,_=H.parentNode!==a,S=!function(t,e,n){var o=n?t.left:t.top,i=n?t.right:t.bottom,r=n?t.width:t.height,a=n?e.left:e.top,l=n?e.right:e.bottom,s=n?e.width:e.height;return o===a||i===l||o+r/2===a+s/2}(H.animated&&H.toRect||e,l.animated&&l.toRect||n,r),T=r?"top":"left",M=x(l,"top","top")||x(H,"top","top"),N=M?M.scrollTop:void 0;if(dt!==l&&(y=n[T],vt=!1,bt=!S&&s.invertSwap||_),b=function(t,e,n,o,i,r,a,l){var s=o?t.clientY:t.clientX,c=o?n.height:n.width,d=o?n.top:n.left,u=o?n.bottom:n.right,h=!1;if(!a)if(l&&htd+c*r/2:su-ht)return-ut}else if(s>d+c*(1-i)/2&&su-c*r/2))return s>d+c/2?1:-1;return 0}(t,l,n,r,S?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,bt,dt===l),0!==b){var P=I(H);do{P-=b,D=W.children[P]}while(D&&("none"===E(D,"display")||D===V))}if(0===b||D===l)return $(!1);dt=l,ut=b;var A=l.nextElementSibling,F=!1,X=kt(U,a,H,e,l,n,t,F=1===b);if(!1!==X)return 1!==X&&-1!==X||(F=1===X),wt=!0,setTimeout(Rt,30),Y(),F&&!A?a.appendChild(H):l.parentNode.insertBefore(H,F?A:l),M&&k(M,0,N-M.scrollTop),W=H.parentNode,void 0===y||bt||(ht=Math.abs(y-C(l)[T])),G(),$(!0)}if(a.contains(H))return $(!1)}return!1}function L(s,c){B(s,p,o({evt:t,isOwner:u,axis:r?"vertical":"horizontal",revert:i,dragRect:e,targetRect:n,canSort:h,fromSortable:f,target:l,completed:$,onMove:function(n,o){return kt(U,a,H,e,n,C(n),t,o)},changed:G},c))}function Y(){L("dragOverAnimationCapture"),p.captureAnimationState(),p!==f&&f.captureAnimationState()}function $(e){return L("dragOverCompleted",{insertion:e}),e&&(u?d._hideClone():d._showClone(p),p!==f&&(w(H,nt?nt.options.ghostClass:d.options.ghostClass,!1),w(H,s.ghostClass,!0)),nt!==p&&p!==At.active?nt=p:p===At.active&&nt&&(nt=null),f===p&&(p._ignoreWhileAnimating=l),p.animateAll((function(){L("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(l===H&&!H.animated||l===a&&!l.animated)&&(dt=null),s.dragoverBubble||t.rootEl||l===document||(H.parentNode[R]._isOutsideThisEl(t.target),!e&&Nt(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function G(){K=I(H),tt=I(H,s.draggable),j({sortable:p,name:"change",toEl:a,newIndex:K,newDraggableIndex:tt,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){p(document,"mousemove",this._onTouchMove),p(document,"touchmove",this._onTouchMove),p(document,"pointermove",this._onTouchMove),p(document,"dragover",Nt),p(document,"mousemove",Nt),p(document,"touchmove",Nt)},_offUpEvents:function(){var t=this.el.ownerDocument;p(t,"mouseup",this._onDrop),p(t,"touchend",this._onDrop),p(t,"pointerup",this._onDrop),p(t,"touchcancel",this._onDrop),p(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;K=I(H),tt=I(H,n.draggable),B("drop",this,{evt:t}),W=H&&H.parentNode,K=I(H),tt=I(H,n.draggable),At.eventCanceled||(pt=!1,bt=!1,vt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Yt(this.cloneId),Yt(this._dragStartId),this.nativeDraggable&&(p(document,"drop",this),p(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),c&&E(document.body,"user-select",""),E(H,"transform",""),t&&(ct&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),V&&V.parentNode&&V.parentNode.removeChild(V),(U===W||nt&&"clone"!==nt.lastPutMode)&&q&&q.parentNode&&q.parentNode.removeChild(q),H&&(this.nativeDraggable&&p(H,"dragend",this),Ft(H),H.style["will-change"]="",ct&&!pt&&w(H,nt?nt.options.ghostClass:this.options.ghostClass,!1),w(H,this.options.chosenClass,!1),j({sortable:this,name:"unchoose",toEl:W,newIndex:null,newDraggableIndex:null,originalEvent:t}),U!==W?(K>=0&&(j({rootEl:W,name:"add",toEl:W,fromEl:U,originalEvent:t}),j({sortable:this,name:"remove",toEl:W,originalEvent:t}),j({rootEl:W,name:"sort",toEl:W,fromEl:U,originalEvent:t}),j({sortable:this,name:"sort",toEl:W,originalEvent:t})),nt&&nt.save()):K!==Z&&K>=0&&(j({sortable:this,name:"update",toEl:W,originalEvent:t}),j({sortable:this,name:"sort",toEl:W,originalEvent:t})),At.active&&(null!=K&&-1!==K||(K=Z,tt=Q),j({sortable:this,name:"end",toEl:W,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){B("nulling",this),U=H=W=V=z=q=G=J=ot=it=ct=K=tt=Z=Q=dt=ut=nt=et=At.dragged=At.ghost=At.clone=At.active=null,Et.forEach((function(t){t.checked=!0})),Et.length=rt=at=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":H&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;ot.replace(ee,((t,e)=>e?e.toUpperCase():""))));function oe(t){null!==t.parentElement&&t.parentElement.removeChild(t)}function ie(t,e,n){const o=0===n?t.children[0]:t.children[n-1].nextSibling;t.insertBefore(e,o)}function re(t,e){this.$nextTick((()=>this.$emit(t.toLowerCase(),e)))}function ae(t){return e=>{null!==this.realList&&this["onDrag"+t](e),re.call(this,t,e)}}function le(t){return["transition-group","TransitionGroup"].includes(t)}function se(t,e,n){return t[n]||(e[n]?e[n]():void 0)}const ce=["Start","Add","Remove","Update","End"],de=["Choose","Unchoose","Sort","Filter","Clone"],ue=["Move",...ce,...de].map((t=>"on"+t));var he=null;const fe={name:"draggable",inheritAttrs:!1,props:{options:Object,list:{type:Array,required:!1,default:null},value:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:t=>t},element:{type:String,default:"div"},tag:{type:String,default:null},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},data:()=>({transitionMode:!1,noneFunctionalComponentMode:!1}),render(t){const e=this.$slots.default;this.transitionMode=function(t){if(!t||1!==t.length)return!1;const[{componentOptions:e}]=t;return!!e&&le(e.tag)}(e);const{children:n,headerOffset:o,footerOffset:i}=function(t,e,n){let o=0,i=0;const r=se(e,n,"header");r&&(o=r.length,t=t?[...r,...t]:[...r]);const a=se(e,n,"footer");return a&&(i=a.length,t=t?[...t,...a]:[...a]),{children:t,headerOffset:o,footerOffset:i}}(e,this.$slots,this.$scopedSlots);this.headerOffset=o,this.footerOffset=i;const r=function(t,e){let n=null;const o=(t,e)=>{n=function(t,e,n){return void 0===n||((t=t||{})[e]=n),t}(n,t,e)};if(o("attrs",Object.keys(t).filter((t=>"id"===t||t.startsWith("data-"))).reduce(((e,n)=>(e[n]=t[n],e)),{})),!e)return n;const{on:i,props:r,attrs:a}=e;return o("on",i),o("props",r),Object.assign(n.attrs,a),n}(this.$attrs,this.componentData);return t(this.getTag(),r,n)},created(){null!==this.list&&null!==this.value&&te.error("Value and list props are mutually exclusive! Please set one or another."),"div"!==this.element&&te.warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props"),void 0!==this.options&&te.warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props")},mounted(){if(this.noneFunctionalComponentMode=this.getTag().toLowerCase()!==this.$el.nodeName.toLowerCase()&&!this.getIsFunctional(),this.noneFunctionalComponentMode&&this.transitionMode)throw new Error(`Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ${this.getTag()}`);const t={};ce.forEach((e=>{t["on"+e]=ae.call(this,e)})),de.forEach((e=>{t["on"+e]=re.bind(this,e)}));const e=Object.keys(this.$attrs).reduce(((t,e)=>(t[ne(e)]=this.$attrs[e],t)),{}),n=Object.assign({},this.options,e,t,{onMove:(t,e)=>this.onDragMove(t,e)});!("draggable"in n)&&(n.draggable=">*"),this._sortable=new At(this.rootContainer,n),this.computeIndexes()},beforeDestroy(){void 0!==this._sortable&&this._sortable.destroy()},computed:{rootContainer(){return this.transitionMode?this.$el.children[0]:this.$el},realList(){return this.list?this.list:this.value}},watch:{options:{handler(t){this.updateOptions(t)},deep:!0},$attrs:{handler(t){this.updateOptions(t)},deep:!0},realList(){this.computeIndexes()}},methods:{getIsFunctional(){const{fnOptions:t}=this._vnode;return t&&t.functional},getTag(){return this.tag||this.element},updateOptions(t){for(var e in t){const n=ne(e);-1===ue.indexOf(n)&&this._sortable.option(n,t[e])}},getChildrenNodes(){if(this.noneFunctionalComponentMode)return this.$children[0].$slots.default;const t=this.$slots.default;return this.transitionMode?t[0].child.$slots.default:t},computeIndexes(){this.$nextTick((()=>{this.visibleIndexes=function(t,e,n,o){if(!t)return[];const i=t.map((t=>t.elm)),r=e.length-o,a=[...e].map(((t,e)=>e>=r?i.length:i.indexOf(t)));return n?a.filter((t=>-1!==t)):a}(this.getChildrenNodes(),this.rootContainer.children,this.transitionMode,this.footerOffset)}))},getUnderlyingVm(t){const e=function(t,e){return t.map((t=>t.elm)).indexOf(e)}(this.getChildrenNodes()||[],t);if(-1===e)return null;return{index:e,element:this.realList[e]}},getUnderlyingPotencialDraggableComponent:({__vue__:t})=>t&&t.$options&&le(t.$options._componentTag)?t.$parent:!("realList"in t)&&1===t.$children.length&&"realList"in t.$children[0]?t.$children[0]:t,emitChanges(t){this.$nextTick((()=>{this.$emit("change",t)}))},alterList(t){if(this.list)return void t(this.list);const e=[...this.value];t(e),this.$emit("input",e)},spliceList(){this.alterList((t=>t.splice(...arguments)))},updatePosition(t,e){this.alterList((n=>n.splice(e,0,n.splice(t,1)[0])))},getRelatedContextFromMoveEvent({to:t,related:e}){const n=this.getUnderlyingPotencialDraggableComponent(t);if(!n)return{component:n};const o=n.realList,i={list:o,component:n};if(t!==e&&o&&n.getUnderlyingVm){const t=n.getUnderlyingVm(e);if(t)return Object.assign(t,i)}return i},getVmIndex(t){const e=this.visibleIndexes,n=e.length;return t>n-1?n:e[t]},getComponent(){return this.$slots.default[0].componentInstance},resetTransitionData(t){if(!this.noTransitionOnDrag||!this.transitionMode)return;this.getChildrenNodes()[t].data=null;const e=this.getComponent();e.children=[],e.kept=void 0},onDragStart(t){this.context=this.getUnderlyingVm(t.item),t.item._underlying_vm_=this.clone(this.context.element),he=t.item},onDragAdd(t){const e=t.item._underlying_vm_;if(void 0===e)return;oe(t.item);const n=this.getVmIndex(t.newIndex);this.spliceList(n,0,e),this.computeIndexes();const o={element:e,newIndex:n};this.emitChanges({added:o})},onDragRemove(t){if(ie(this.rootContainer,t.item,t.oldIndex),"clone"===t.pullMode)return void oe(t.clone);const e=this.context.index;this.spliceList(e,1);const n={element:this.context.element,oldIndex:e};this.resetTransitionData(e),this.emitChanges({removed:n})},onDragUpdate(t){oe(t.item),ie(t.from,t.item,t.oldIndex);const e=this.context.index,n=this.getVmIndex(t.newIndex);this.updatePosition(e,n);const o={element:this.context.element,oldIndex:e,newIndex:n};this.emitChanges({moved:o})},updateProperty(t,e){t.hasOwnProperty(e)&&(t[e]+=this.headerOffset)},computeFutureIndex(t,e){if(!t.element)return 0;const n=[...e.to.children].filter((t=>"none"!==t.style.display)),o=n.indexOf(e.related),i=t.component.getVmIndex(o);return-1!==n.indexOf(he)||!e.willInsertAfter?i:i+1},onDragMove(t,e){const n=this.move;if(!n||!this.realList)return!0;const o=this.getRelatedContextFromMoveEvent(t),i=this.context,r=this.computeFutureIndex(o,t);Object.assign(i,{futureIndex:r});return n(Object.assign({},t,{relatedContext:o,draggedContext:i}),e)},onDragEnd(){this.computeIndexes(),he=null}}};"undefined"!=typeof window&&"Vue"in window&&window.Vue.component("draggable",fe);export{fe as default}; +function t(e){return(t="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})(e)}function e(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n(){return n=Object.assign||function(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function r(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var a=r(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),l=r(/Edge/i),s=r(/firefox/i),c=r(/safari/i)&&!r(/chrome/i)&&!r(/android/i),d=r(/iP(ad|od|hone)/i),u=r(/chrome/i)&&r(/android/i),h={capture:!1,passive:!1};function f(t,e,n){t.addEventListener(e,n,!a&&h)}function p(t,e,n){t.removeEventListener(e,n,!a&&h)}function g(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(n){return!1}return!1}}function m(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function v(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&g(t,e):g(t,e))||o&&t===n)return t;if(t===n)break}while(t=m(t))}return null}var b,y=/\s+/g;function w(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(y," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(y," ")}}function E(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function D(t,e){var n="";if("string"==typeof t)n=t;else do{var o=E(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function _(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i=C(o)[n]))return o;if(o===S())break;o=N(o,!1)}return!1}function T(t,e,n){for(var o=0,i=0,r=t.children;i2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,a=i(n,["evt"]);$.pluginEvent.bind(At)(t,e,o({dragEl:H,parentEl:W,ghostEl:V,rootEl:U,nextEl:z,lastDownEl:G,cloneEl:q,cloneHidden:J,dragStarted:ct,putSortable:nt,activeSortable:At.active,originalEvent:r,oldIndex:Z,oldDraggableIndex:Q,newIndex:K,newDraggableIndex:tt,hideGhostForTarget:It,unhideGhostForTarget:Mt,cloneNowHidden:function(){J=!0},cloneNowShown:function(){J=!1},dispatchSortableEvent:function(t){j({sortable:e,name:t,originalEvent:r})}},a))};function j(t){!function(t){var e=t.sortable,n=t.rootEl,i=t.name,r=t.targetEl,s=t.cloneEl,c=t.toEl,d=t.fromEl,u=t.oldIndex,h=t.newIndex,f=t.oldDraggableIndex,p=t.newDraggableIndex,g=t.originalEvent,m=t.putSortable,v=t.extraEventProperties;if(e=e||n&&n[R]){var b,y=e.options,w="on"+i.charAt(0).toUpperCase()+i.substr(1);!window.CustomEvent||a||l?(b=document.createEvent("Event")).initEvent(i,!0,!0):b=new CustomEvent(i,{bubbles:!0,cancelable:!0}),b.to=c||n,b.from=d||n,b.item=r||n,b.clone=s,b.oldIndex=u,b.newIndex=h,b.oldDraggableIndex=f,b.newDraggableIndex=p,b.originalEvent=g,b.pullMode=m?m.lastPutMode:void 0;var E=o({},v,$.getEventProperties(i,e));for(var D in E)b[D]=E[D];n&&n.dispatchEvent(b),y[w]&&y[w].call(e,b)}}(o({putSortable:nt,cloneEl:q,targetEl:H,rootEl:U,oldIndex:Z,oldDraggableIndex:Q,newIndex:K,newDraggableIndex:tt},t))}var H,W,V,U,z,G,q,J,Z,K,Q,tt,et,nt,ot,it,rt,at,lt,st,ct,dt,ut,ht,ft,pt=!1,gt=!1,mt=[],vt=!1,bt=!1,yt=[],wt=!1,Et=[],Dt="undefined"!=typeof document,_t=d,St=l||a?"cssFloat":"float",Ct=Dt&&!u&&!d&&"draggable"in document.createElement("div"),xt=function(){if(Dt){if(a)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Tt=function(t,e){var n=E(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=T(t,0,e),r=T(t,1,e),a=i&&E(i),l=r&&E(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+C(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+C(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){var d="left"===a.float?"left":"right";return!r||"both"!==l.clear&&l.clear!==d?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=o&&"none"===n[St]||r&&"none"===n[St]&&s+c>o)?"vertical":"horizontal"},Ot=function(e){function n(t,e){return function(o,i,r,a){var l=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==t&&(e||l))return!0;if(null==t||!1===t)return!1;if(e&&"clone"===t)return t;if("function"==typeof t)return n(t(o,i,r,a),e)(o,i,r,a);var s=(e?o:i).options.group.name;return!0===t||"string"==typeof t&&t===s||t.join&&t.indexOf(s)>-1}}var o={},i=e.group;i&&"object"==t(i)||(i={name:i}),o.name=i.name,o.checkPull=n(i.pull,!0),o.checkPut=n(i.put),o.revertClone=i.revertClone,e.group=o},It=function(){!xt&&V&&E(V,"display","none")},Mt=function(){!xt&&V&&E(V,"display","")};Dt&&document.addEventListener("click",(function(t){if(gt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),gt=!1,!1}),!0);var Nt=function(t){if(H){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,mt.some((function(t){if(!O(t)){var e=C(t),n=t[R].options.emptyInsertThreshold,o=i>=e.left-n&&i<=e.right+n,l=r>=e.top-n&&r<=e.bottom+n;return n&&o&&l?a=t:void 0}})),a);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[R]._onDragOver(n)}}var i,r,a},Pt=function(t){H&&H.parentNode[R]._isOutsideThisEl(t.target)};function At(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=n({},e),t[R]=this;var o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Tt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==At.supportPointer&&"PointerEvent"in window,emptyInsertThreshold:5};for(var i in $.initializePlugins(this,t,o),o)!(i in e)&&(e[i]=o[i]);for(var r in Ot(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Ct,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?f(t,"pointerdown",this._onTapStart):(f(t,"mousedown",this._onTapStart),f(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(f(t,"dragover",this),f(t,"dragenter",this)),mt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),n(this,X())}function kt(t,e,n,o,i,r,s,c){var d,u,h=t[R],f=h.options.onMove;return!window.CustomEvent||a||l?(d=document.createEvent("Event")).initEvent("move",!0,!0):d=new CustomEvent("move",{bubbles:!0,cancelable:!0}),d.to=e,d.from=t,d.dragged=n,d.draggedRect=o,d.related=i||e,d.relatedRect=r||C(e),d.willInsertAfter=c,d.originalEvent=s,t.dispatchEvent(d),f&&(u=f.call(h,d,s)),u}function Ft(t){t.draggable=!1}function Rt(){wt=!1}function Xt(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Lt(t){return setTimeout(t,0)}function Yt(t){return clearTimeout(t)}At.prototype={constructor:At,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(dt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,H):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,i=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,l=(a||t).target,s=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=o.filter;if(function(t){Et.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Et.push(o)}}(n),!H&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled||s.isContentEditable||(l=v(l,o.draggable,n,!1))&&l.animated||G===l)){if(Z=I(l),Q=I(l,o.draggable),"function"==typeof c){if(c.call(this,t,l,this))return j({sortable:e,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),B("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=v(s,o.trim(),n,!1))return j({sortable:e,rootEl:o,name:"filter",targetEl:l,fromEl:n,toEl:n}),B("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!v(s,o.handle,n,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,c=i.options,d=r.ownerDocument;if(n&&!H&&n.parentNode===r){var u=C(n);if(U=r,W=(H=n).parentNode,z=H.nextSibling,G=n,et=c.group,At.dragged=H,ot={target:H,clientX:(e||t).clientX,clientY:(e||t).clientY},lt=ot.clientX-u.left,st=ot.clientY-u.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,H.style["will-change"]="all",o=function(){B("delayEnded",i,{evt:t}),At.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!s&&i.nativeDraggable&&(H.draggable=!0),i._triggerDragStart(t,e),j({sortable:i,name:"choose",originalEvent:t}),w(H,c.chosenClass,!0))},c.ignore.split(",").forEach((function(t){_(H,t.trim(),Ft)})),f(d,"dragover",Nt),f(d,"mousemove",Nt),f(d,"touchmove",Nt),f(d,"mouseup",i._onDrop),f(d,"touchend",i._onDrop),f(d,"touchcancel",i._onDrop),s&&this.nativeDraggable&&(this.options.touchStartThreshold=4,H.draggable=!0),B("delayStart",this,{evt:t}),!c.delay||c.delayOnTouchOnly&&!e||this.nativeDraggable&&(l||a))o();else{if(At.eventCanceled)return void this._onDrop();f(d,"mouseup",i._disableDelayedDrag),f(d,"touchend",i._disableDelayedDrag),f(d,"touchcancel",i._disableDelayedDrag),f(d,"mousemove",i._delayedDragTouchMoveHandler),f(d,"touchmove",i._delayedDragTouchMoveHandler),c.supportPointer&&f(d,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,c.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){H&&Ft(H),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;p(t,"mouseup",this._disableDelayedDrag),p(t,"touchend",this._disableDelayedDrag),p(t,"touchcancel",this._disableDelayedDrag),p(t,"mousemove",this._delayedDragTouchMoveHandler),p(t,"touchmove",this._delayedDragTouchMoveHandler),p(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?f(document,"pointermove",this._onTouchMove):f(document,e?"touchmove":"mousemove",this._onTouchMove):(f(H,"dragend",this),f(U,"dragstart",this._onDragStart));try{document.selection?Lt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(pt=!1,U&&H){B("dragStarted",this,{evt:e}),this.nativeDraggable&&f(document,"dragover",Pt);var n=this.options;!t&&w(H,n.dragClass,!1),w(H,n.ghostClass,!0),At.active=this,t&&this._appendGhost(),j({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(it){this._lastX=it.clientX,this._lastY=it.clientY,It();for(var t=document.elementFromPoint(it.clientX,it.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(it.clientX,it.clientY))!==e;)e=t;if(H.parentNode[R]._isOutsideThisEl(t),e)do{if(e[R]){if(e[R]._onDragOver({clientX:it.clientX,clientY:it.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Mt()}},_onTouchMove:function(t){if(ot){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=V&&D(V,!0),a=V&&r&&r.a,l=V&&r&&r.d,s=_t&&ft&&M(ft),c=(i.clientX-ot.clientX+o.x)/(a||1)+(s?s[0]-yt[0]:0)/(a||1),d=(i.clientY-ot.clientY+o.y)/(l||1)+(s?s[1]-yt[1]:0)/(l||1);if(!At.active&&!pt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))o.right+i||t.clientX<=o.right&&t.clientY>o.bottom&&t.clientX>=o.left:t.clientX>o.right&&t.clientY>o.top||t.clientX<=o.right&&t.clientY>o.bottom+i}(t,r,this)&&!m.animated){if(m===H)return $(!1);if(m&&a===t.target&&(l=m),l&&(n=C(l)),!1!==kt(U,a,H,e,l,n,t,!!l))return Y(),a.appendChild(H),W=a,G(),$(!0)}else if(l.parentNode===a){n=C(l);var b,y,D,_=H.parentNode!==a,S=!function(t,e,n){var o=n?t.left:t.top,i=n?t.right:t.bottom,r=n?t.width:t.height,a=n?e.left:e.top,l=n?e.right:e.bottom,s=n?e.width:e.height;return o===a||i===l||o+r/2===a+s/2}(H.animated&&H.toRect||e,l.animated&&l.toRect||n,r),T=r?"top":"left",M=x(l,"top","top")||x(H,"top","top"),N=M?M.scrollTop:void 0;if(dt!==l&&(y=n[T],vt=!1,bt=!S&&s.invertSwap||_),b=function(t,e,n,o,i,r,a,l){var s=o?t.clientY:t.clientX,c=o?n.height:n.width,d=o?n.top:n.left,u=o?n.bottom:n.right,h=!1;if(!a)if(l&&htd+c*r/2:su-ht)return-ut}else if(s>d+c*(1-i)/2&&su-c*r/2))return s>d+c/2?1:-1;return 0}(t,l,n,r,S?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,bt,dt===l),0!==b){var P=I(H);do{P-=b,D=W.children[P]}while(D&&("none"===E(D,"display")||D===V))}if(0===b||D===l)return $(!1);dt=l,ut=b;var A=l.nextElementSibling,F=!1,X=kt(U,a,H,e,l,n,t,F=1===b);if(!1!==X)return 1!==X&&-1!==X||(F=1===X),wt=!0,setTimeout(Rt,30),Y(),F&&!A?a.appendChild(H):l.parentNode.insertBefore(H,F?A:l),M&&k(M,0,N-M.scrollTop),W=H.parentNode,void 0===y||bt||(ht=Math.abs(y-C(l)[T])),G(),$(!0)}if(a.contains(H))return $(!1)}return!1}function L(s,c){B(s,p,o({evt:t,isOwner:u,axis:r?"vertical":"horizontal",revert:i,dragRect:e,targetRect:n,canSort:h,fromSortable:f,target:l,completed:$,onMove:function(n,o){return kt(U,a,H,e,n,C(n),t,o)},changed:G},c))}function Y(){L("dragOverAnimationCapture"),p.captureAnimationState(),p!==f&&f.captureAnimationState()}function $(e){return L("dragOverCompleted",{insertion:e}),e&&(u?d._hideClone():d._showClone(p),p!==f&&(w(H,nt?nt.options.ghostClass:d.options.ghostClass,!1),w(H,s.ghostClass,!0)),nt!==p&&p!==At.active?nt=p:p===At.active&&nt&&(nt=null),f===p&&(p._ignoreWhileAnimating=l),p.animateAll((function(){L("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(l===H&&!H.animated||l===a&&!l.animated)&&(dt=null),s.dragoverBubble||t.rootEl||l===document||(H.parentNode[R]._isOutsideThisEl(t.target),!e&&Nt(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function G(){K=I(H),tt=I(H,s.draggable),j({sortable:p,name:"change",toEl:a,newIndex:K,newDraggableIndex:tt,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){p(document,"mousemove",this._onTouchMove),p(document,"touchmove",this._onTouchMove),p(document,"pointermove",this._onTouchMove),p(document,"dragover",Nt),p(document,"mousemove",Nt),p(document,"touchmove",Nt)},_offUpEvents:function(){var t=this.el.ownerDocument;p(t,"mouseup",this._onDrop),p(t,"touchend",this._onDrop),p(t,"pointerup",this._onDrop),p(t,"touchcancel",this._onDrop),p(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;K=I(H),tt=I(H,n.draggable),B("drop",this,{evt:t}),W=H&&H.parentNode,K=I(H),tt=I(H,n.draggable),At.eventCanceled||(pt=!1,bt=!1,vt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Yt(this.cloneId),Yt(this._dragStartId),this.nativeDraggable&&(p(document,"drop",this),p(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),c&&E(document.body,"user-select",""),E(H,"transform",""),t&&(ct&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),V&&V.parentNode&&V.parentNode.removeChild(V),(U===W||nt&&"clone"!==nt.lastPutMode)&&q&&q.parentNode&&q.parentNode.removeChild(q),H&&(this.nativeDraggable&&p(H,"dragend",this),Ft(H),H.style["will-change"]="",ct&&!pt&&w(H,nt?nt.options.ghostClass:this.options.ghostClass,!1),w(H,this.options.chosenClass,!1),j({sortable:this,name:"unchoose",toEl:W,newIndex:null,newDraggableIndex:null,originalEvent:t}),U!==W?(K>=0&&(j({rootEl:W,name:"add",toEl:W,fromEl:U,originalEvent:t}),j({sortable:this,name:"remove",toEl:W,originalEvent:t}),j({rootEl:W,name:"sort",toEl:W,fromEl:U,originalEvent:t}),j({sortable:this,name:"sort",toEl:W,originalEvent:t})),nt&&nt.save()):K!==Z&&K>=0&&(j({sortable:this,name:"update",toEl:W,originalEvent:t}),j({sortable:this,name:"sort",toEl:W,originalEvent:t})),At.active&&(null!=K&&-1!==K||(K=Z,tt=Q),j({sortable:this,name:"end",toEl:W,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){B("nulling",this),U=H=W=V=z=q=G=J=ot=it=ct=K=tt=Z=Q=dt=ut=nt=et=At.dragged=At.ghost=At.clone=At.active=null,Et.forEach((function(t){t.checked=!0})),Et.length=rt=at=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":H&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;ot.replace(ee,((t,e)=>e?e.toUpperCase():""))));function oe(t){null!==t.parentElement&&t.parentElement.removeChild(t)}function ie(t,e,n){const o=0===n?t.children[0]:t.children[n-1].nextSibling;t.insertBefore(e,o)}function re(t,e){this.$nextTick((()=>this.$emit(t.toLowerCase(),e)))}function ae(t){return e=>{null!==this.realList&&this["onDrag"+t](e),re.call(this,t,e)}}function le(t){return["transition-group","TransitionGroup"].includes(t)}function se(t,e,n){return t[n]||(e[n]?e[n]():void 0)}const ce=["Start","Add","Remove","Update","End"],de=["Choose","Unchoose","Sort","Filter","Clone"],ue=["Move",...ce,...de].map((t=>"on"+t));var he=null;const fe={name:"draggable",inheritAttrs:!1,props:{options:Object,list:{type:Array,required:!1,default:null},value:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:t=>t},element:{type:String,default:"div"},tag:{type:String,default:null},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},data:()=>({transitionMode:!1,noneFunctionalComponentMode:!1}),render(t){const e=this.$slots.default;this.transitionMode=function(t){if(!t||1!==t.length)return!1;const[{componentOptions:e}]=t;return!!e&&le(e.tag)}(e);const{children:n,headerOffset:o,footerOffset:i}=function(t,e,n){let o=0,i=0;const r=se(e,n,"header");r&&(o=r.length,t=t?[...r,...t]:[...r]);const a=se(e,n,"footer");return a&&(i=a.length,t=t?[...t,...a]:[...a]),{children:t,headerOffset:o,footerOffset:i}}(e,this.$slots,this.$scopedSlots);this.headerOffset=o,this.footerOffset=i;const r=function(t,e){let n=null;const o=(t,e)=>{n=function(t,e,n){return void 0===n||((t=t||{})[e]=n),t}(n,t,e)};if(o("attrs",Object.keys(t).filter((t=>"id"===t||t.startsWith("data-"))).reduce(((e,n)=>(e[n]=t[n],e)),{})),!e)return n;const{on:i,props:r,attrs:a}=e;return o("on",i),o("props",r),Object.assign(n.attrs,a),n}(this.$attrs,this.componentData);return t(this.getTag(),r,n)},created(){null!==this.list&&null!==this.value&&te.error("Value and list props are mutually exclusive! Please set one or another."),"div"!==this.element&&te.warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props"),void 0!==this.options&&te.warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props")},mounted(){if(this.noneFunctionalComponentMode=this.getTag().toLowerCase()!==this.$el.nodeName.toLowerCase()&&!this.getIsFunctional(),this.noneFunctionalComponentMode&&this.transitionMode)throw new Error(`Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ${this.getTag()}`);const t={};ce.forEach((e=>{t["on"+e]=ae.call(this,e)})),de.forEach((e=>{t["on"+e]=re.bind(this,e)}));const e=Object.keys(this.$attrs).reduce(((t,e)=>(t[ne(e)]=this.$attrs[e],t)),{}),n=Object.assign({},this.options,e,t,{onMove:(t,e)=>this.onDragMove(t,e)});!("draggable"in n)&&(n.draggable=">*"),this._sortable=new At(this.rootContainer,n),this.computeIndexes()},beforeDestroy(){void 0!==this._sortable&&this._sortable.destroy()},computed:{rootContainer(){return this.transitionMode?this.$el.children[0]:this.$el},realList(){return this.list?this.list:this.value}},watch:{options:{handler(t){this.updateOptions(t)},deep:!0},$attrs:{handler(t){this.updateOptions(t)},deep:!0},realList(){this.computeIndexes()}},methods:{getIsFunctional(){const{fnOptions:t}=this._vnode;return t&&t.functional},getTag(){return this.tag||this.element},updateOptions(t){for(var e in t){const n=ne(e);-1===ue.indexOf(n)&&this._sortable.option(n,t[e])}},getChildrenNodes(){if(this.noneFunctionalComponentMode)return this.$children[0].$slots.default;const t=this.$slots.default;return this.transitionMode?t[0].child.$slots.default:t},computeIndexes(){this.$nextTick((()=>{this.visibleIndexes=function(t,e,n,o){if(!t)return[];const i=t.map((t=>t.elm)),r=e.length-o,a=[...e].map(((t,e)=>e>=r?i.length:i.indexOf(t)));return n?a.filter((t=>-1!==t)):a}(this.getChildrenNodes(),this.rootContainer.children,this.transitionMode,this.footerOffset)}))},getUnderlyingVm(t){const e=function(t,e){return t.map((t=>t.elm)).indexOf(e)}(this.getChildrenNodes()||[],t);if(-1===e)return null;return{index:e,element:this.realList[e]}},getUnderlyingPotencialDraggableComponent:({__vue__:t})=>t&&t.$options&&le(t.$options._componentTag)?t.$parent:!("realList"in t)&&1===t.$children.length&&"realList"in t.$children[0]?t.$children[0]:t,emitChanges(t){this.$nextTick((()=>{this.$emit("change",t)}))},alterList(t){if(this.list)return void t(this.list);const e=[...this.value];t(e),this.$emit("input",e)},spliceList(){this.alterList((t=>t.splice(...arguments)))},updatePosition(t,e){this.alterList((n=>n.splice(e,0,n.splice(t,1)[0])))},getRelatedContextFromMoveEvent({to:t,related:e}){const n=this.getUnderlyingPotencialDraggableComponent(t);if(!n)return{component:n};const o=n.realList,i={list:o,component:n};if(t!==e&&o&&n.getUnderlyingVm){const t=n.getUnderlyingVm(e);if(t)return Object.assign(t,i)}return i},getVmIndex(t){const e=this.visibleIndexes,n=e.length;return t>n-1?n:e[t]},getComponent(){return this.$slots.default[0].componentInstance},resetTransitionData(t){if(!this.noTransitionOnDrag||!this.transitionMode)return;this.getChildrenNodes()[t].data=null;const e=this.getComponent();e.children=[],e.kept=void 0},onDragStart(t){this.context=this.getUnderlyingVm(t.item),t.item._underlying_vm_=this.clone(this.context.element),he=t.item},onDragAdd(t){const e=t.item._underlying_vm_;if(void 0===e)return;oe(t.item);const n=this.getVmIndex(t.newIndex);this.spliceList(n,0,e),this.computeIndexes();const o={element:e,newIndex:n};this.emitChanges({added:o})},onDragRemove(t){if(ie(this.rootContainer,t.item,t.oldIndex),"clone"===t.pullMode)return void oe(t.clone);const e=this.context.index;this.spliceList(e,1);const n={element:this.context.element,oldIndex:e};this.resetTransitionData(e),this.emitChanges({removed:n})},onDragUpdate(t){oe(t.item),ie(t.from,t.item,t.oldIndex);const e=this.context.index,n=this.getVmIndex(t.newIndex);this.updatePosition(e,n);const o={element:this.context.element,oldIndex:e,newIndex:n};this.emitChanges({moved:o})},updateProperty(t,e){t.hasOwnProperty(e)&&(t[e]+=this.headerOffset)},computeFutureIndex(t,e){if(!t.element)return 0;const n=[...e.to.children].filter((t=>"none"!==t.style.display)),o=n.indexOf(e.related),i=t.component.getVmIndex(o);return-1!==n.indexOf(he)||!e.willInsertAfter?i:i+1},onDragMove(t,e){const n=this.move;if(!n||!this.realList)return!0;const o=this.getRelatedContextFromMoveEvent(t),i=this.context,r=this.computeFutureIndex(o,t);Object.assign(i,{futureIndex:r});return n(Object.assign({},t,{relatedContext:o,draggedContext:i}),e)},onDragEnd(){this.computeIndexes(),he=null}}};"undefined"!=typeof window&&"Vue"in window&&window.Vue.component("draggable",fe);export{fe as default}; diff --git a/panel/dist/ui/ColoroptionsInput.json b/panel/dist/ui/ColoroptionsInput.json index 2e6fe1eab1..cd11956cc5 100644 --- a/panel/dist/ui/ColoroptionsInput.json +++ b/panel/dist/ui/ColoroptionsInput.json @@ -1 +1 @@ -{"displayName":"ColoroptionsInput","description":"","tags":{"since":[{"description":"4.0.0","title":"since"}],"examples":[{"title":"example","content":""}]},"props":[{"name":"autofocus","description":"Sets the focus on this field when the form loads. Only the first field with this label gets","type":{"name":"boolean"}},{"name":"disabled","description":"If `true`, the field is no longer editable and will not be saved","type":{"name":"boolean"}},{"name":"id","description":"A unique ID. The component `_uid` will be used as default.","type":{"name":"number|string"},"defaultValue":{"value":"function() {\n return this._uid;\n}"}},{"name":"name","description":"A unique name for the input","type":{"name":"number|string"}},{"name":"required","description":"If `true`, the field has to be filled in correctly to be submitted","type":{"name":"boolean"}},{"name":"options","description":"An array of option objects","tags":{"value":[{"description":"{ value, text, info }","title":"value"}]},"type":{"name":"array"},"defaultValue":{"value":"[]"}},{"name":"columns","type":{"name":"number"}},{"name":"reset","type":{"name":"boolean"},"defaultValue":{"value":"true"}},{"name":"theme","type":{"name":"string"}},{"name":"value","type":{"name":"string"}},{"name":"format","tags":{},"values":["\"hex\"","\"rgb\"","\"hsl\""],"type":{"name":"string"},"defaultValue":{"value":"\"hex\""}}],"events":[{"name":"input","type":{"names":["undefined"]}},{"name":"invalid","type":{"names":["undefined"]},"properties":[{"type":{"names":["undefined"]},"name":""}]}],"methods":[{"name":"focus","description":"Focuses the input element","tags":{"access":[{"description":"public"}]}}],"component":"k-coloroptions-input","sourceFile":"src/components/Forms/Input/ColoroptionsInput.vue"} \ No newline at end of file +{"displayName":"ColoroptionsInput","description":"","tags":{"since":[{"description":"4.0.0","title":"since"}],"examples":[{"title":"example","content":""}]},"props":[{"name":"autofocus","description":"Sets the focus on this field when the form loads. Only the first field with this label gets","type":{"name":"boolean"}},{"name":"disabled","description":"If `true`, the field is no longer editable and will not be saved","type":{"name":"boolean"}},{"name":"id","description":"A unique ID. The component `_uid` will be used as default.","type":{"name":"number|string"},"defaultValue":{"value":"function() {\n return this._uid;\n}"}},{"name":"name","description":"A unique name for the input","type":{"name":"number|string"}},{"name":"required","description":"If `true`, the field has to be filled in correctly to be submitted","type":{"name":"boolean"}},{"name":"options","description":"An array of option objects","tags":{"value":[{"description":"{ value, text, info }","title":"value"}]},"type":{"name":"array"},"defaultValue":{"value":"[]"}},{"name":"columns","type":{"name":"number"},"defaultValue":{"value":"1"}},{"name":"reset","type":{"name":"boolean"},"defaultValue":{"value":"true"}},{"name":"theme","type":{"name":"string"}},{"name":"value","type":{"name":"string"}},{"name":"format","tags":{},"values":["\"hex\"","\"rgb\"","\"hsl\""],"type":{"name":"string"},"defaultValue":{"value":"\"hex\""}}],"events":[{"name":"input","type":{"names":["undefined"]}},{"name":"invalid","type":{"names":["undefined"]},"properties":[{"type":{"names":["undefined"]},"name":""}]}],"methods":[{"name":"focus","description":"Focuses the input element","tags":{"access":[{"description":"public"}]}}],"component":"k-coloroptions-input","sourceFile":"src/components/Forms/Input/ColoroptionsInput.vue"} \ No newline at end of file diff --git a/panel/dist/ui/RadioField.json b/panel/dist/ui/RadioField.json index b713ffd2b9..fa7d335efc 100644 --- a/panel/dist/ui/RadioField.json +++ b/panel/dist/ui/RadioField.json @@ -1 +1 @@ -{"displayName":"RadioField","description":"Have a look at ``, `` and `` for additional information.","tags":{},"props":[{"name":"disabled","description":"If `true`, the field is no longer editable and will not be saved","type":{"name":"boolean"}},{"name":"help","description":"Optional help text below the field","type":{"name":"string"}},{"name":"id","description":"A unique ID. The component `_uid` will be used as default.","type":{"name":"number|string"},"defaultValue":{"value":"function() {\n return this._uid;\n}"}},{"name":"label","description":"A descriptive label for the field","type":{"name":"string"}},{"name":"name","description":"A unique name for the input","type":{"name":"number|string"}},{"name":"required","description":"If `true`, the field has to be filled in correctly to be submitted","type":{"name":"boolean"}},{"name":"counter","type":{"name":"boolean|object"}},{"name":"endpoints","type":{"name":"object"}},{"name":"input","type":{"name":"string|number"}},{"name":"translate","type":{"name":"boolean"}},{"name":"type","type":{"name":"string"}},{"name":"after","description":"Optional text that will be shown after the input","type":{"name":"string"}},{"name":"before","description":"Optional text that will be shown before the input","type":{"name":"string"}},{"name":"invalid","description":"Marks the field/input as invalid","type":{"name":"boolean"}},{"name":"autofocus","type":{"name":"boolean"}},{"name":"icon","type":{"name":"string|boolean"}},{"name":"novalidate","type":{"name":"boolean"},"defaultValue":{"value":"false"}},{"name":"value","type":{"name":"string|number|boolean"},"defaultValue":{"value":"null"}},{"name":"options","description":"An array of option objects","tags":{"value":[{"description":"{ value, text, info }","title":"value"}]},"type":{"name":"array"},"defaultValue":{"value":"[]"}},{"name":"columns","type":{"name":"number"}},{"name":"reset","type":{"name":"boolean"},"defaultValue":{"value":"true"}},{"name":"theme","type":{"name":"string"}}],"events":[{"name":"focus"},{"name":"blur"},{"name":"input"}],"slots":[{"name":"header"},{"name":"label"},{"name":"options"},{"name":"counter"},{"name":"default"},{"name":"footer"},{"name":"help"},{"name":"before"},{"name":"after"},{"name":"icon"}],"component":"k-radio-field","sourceFile":"src/components/Forms/Field/RadioField.vue"} \ No newline at end of file +{"displayName":"RadioField","description":"Have a look at ``, `` and `` for additional information.","tags":{},"props":[{"name":"disabled","description":"If `true`, the field is no longer editable and will not be saved","type":{"name":"boolean"}},{"name":"help","description":"Optional help text below the field","type":{"name":"string"}},{"name":"id","description":"A unique ID. The component `_uid` will be used as default.","type":{"name":"number|string"},"defaultValue":{"value":"function() {\n return this._uid;\n}"}},{"name":"label","description":"A descriptive label for the field","type":{"name":"string"}},{"name":"name","description":"A unique name for the input","type":{"name":"number|string"}},{"name":"required","description":"If `true`, the field has to be filled in correctly to be submitted","type":{"name":"boolean"}},{"name":"counter","type":{"name":"boolean|object"}},{"name":"endpoints","type":{"name":"object"}},{"name":"input","type":{"name":"string|number"}},{"name":"translate","type":{"name":"boolean"}},{"name":"type","type":{"name":"string"}},{"name":"after","description":"Optional text that will be shown after the input","type":{"name":"string"}},{"name":"before","description":"Optional text that will be shown before the input","type":{"name":"string"}},{"name":"invalid","description":"Marks the field/input as invalid","type":{"name":"boolean"}},{"name":"autofocus","type":{"name":"boolean"}},{"name":"icon","type":{"name":"string|boolean"}},{"name":"novalidate","type":{"name":"boolean"},"defaultValue":{"value":"false"}},{"name":"value","type":{"name":"string|number|boolean"},"defaultValue":{"value":"null"}},{"name":"options","description":"An array of option objects","tags":{"value":[{"description":"{ value, text, info }","title":"value"}]},"type":{"name":"array"},"defaultValue":{"value":"[]"}},{"name":"columns","type":{"name":"number"},"defaultValue":{"value":"1"}},{"name":"reset","type":{"name":"boolean"},"defaultValue":{"value":"true"}},{"name":"theme","type":{"name":"string"}}],"events":[{"name":"focus"},{"name":"blur"},{"name":"input"}],"slots":[{"name":"header"},{"name":"label"},{"name":"options"},{"name":"counter"},{"name":"default"},{"name":"footer"},{"name":"help"},{"name":"before"},{"name":"after"},{"name":"icon"}],"component":"k-radio-field","sourceFile":"src/components/Forms/Field/RadioField.vue"} \ No newline at end of file diff --git a/panel/dist/ui/RadioInput.json b/panel/dist/ui/RadioInput.json index ed4d6ad66b..d10da3207d 100644 --- a/panel/dist/ui/RadioInput.json +++ b/panel/dist/ui/RadioInput.json @@ -1 +1 @@ -{"displayName":"RadioInput","description":"","tags":{},"props":[{"name":"autofocus","description":"Sets the focus on this field when the form loads. Only the first field with this label gets","type":{"name":"boolean"}},{"name":"disabled","description":"If `true`, the field is no longer editable and will not be saved","type":{"name":"boolean"}},{"name":"id","description":"A unique ID. The component `_uid` will be used as default.","type":{"name":"number|string"},"defaultValue":{"value":"function() {\n return this._uid;\n}"}},{"name":"name","description":"A unique name for the input","type":{"name":"number|string"}},{"name":"required","description":"If `true`, the field has to be filled in correctly to be submitted","type":{"name":"boolean"}},{"name":"options","description":"An array of option objects","tags":{"value":[{"description":"{ value, text, info }","title":"value"}]},"type":{"name":"array"},"defaultValue":{"value":"[]"}},{"name":"columns","type":{"name":"number"}},{"name":"reset","type":{"name":"boolean"},"defaultValue":{"value":"true"}},{"name":"theme","type":{"name":"string"}},{"name":"value","type":{"name":"string|number|boolean"}}],"events":[{"name":"input","type":{"names":["undefined"]}},{"name":"invalid","type":{"names":["undefined"]},"properties":[{"type":{"names":["undefined"]},"name":""}]}],"methods":[{"name":"focus","description":"Focuses the input element","tags":{"access":[{"description":"public"}]}}],"component":"k-radio-input","sourceFile":"src/components/Forms/Input/RadioInput.vue"} \ No newline at end of file +{"displayName":"RadioInput","description":"","tags":{},"props":[{"name":"autofocus","description":"Sets the focus on this field when the form loads. Only the first field with this label gets","type":{"name":"boolean"}},{"name":"disabled","description":"If `true`, the field is no longer editable and will not be saved","type":{"name":"boolean"}},{"name":"id","description":"A unique ID. The component `_uid` will be used as default.","type":{"name":"number|string"},"defaultValue":{"value":"function() {\n return this._uid;\n}"}},{"name":"name","description":"A unique name for the input","type":{"name":"number|string"}},{"name":"required","description":"If `true`, the field has to be filled in correctly to be submitted","type":{"name":"boolean"}},{"name":"options","description":"An array of option objects","tags":{"value":[{"description":"{ value, text, info }","title":"value"}]},"type":{"name":"array"},"defaultValue":{"value":"[]"}},{"name":"columns","type":{"name":"number"},"defaultValue":{"value":"1"}},{"name":"reset","type":{"name":"boolean"},"defaultValue":{"value":"true"}},{"name":"theme","type":{"name":"string"}},{"name":"value","type":{"name":"string|number|boolean"}}],"events":[{"name":"input","type":{"names":["undefined"]}},{"name":"invalid","type":{"names":["undefined"]},"properties":[{"type":{"names":["undefined"]},"name":""}]}],"methods":[{"name":"focus","description":"Focuses the input element","tags":{"access":[{"description":"public"}]}}],"component":"k-radio-input","sourceFile":"src/components/Forms/Input/RadioInput.vue"} \ No newline at end of file diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 790316a719..b4c2097977 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,9 +1,9 @@ array( 'name' => 'getkirby/cms', - 'pretty_version' => '4.4.0', - 'version' => '4.4.0.0', - 'reference' => NULL, + 'pretty_version' => '4.5.0-rc.1', + 'version' => '4.5.0.0-RC1', + 'reference' => null, 'type' => 'kirby-cms', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -47,9 +47,9 @@ 'dev_requirement' => false, ), 'getkirby/cms' => array( - 'pretty_version' => '4.4.0', - 'version' => '4.4.0.0', - 'reference' => NULL, + 'pretty_version' => '4.5.0-rc.1', + 'version' => '4.5.0.0-RC1', + 'reference' => null, 'type' => 'kirby-cms', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), From ed8c8b688a09fc63ccc63035f2a53a2f893c982e Mon Sep 17 00:00:00 2001 From: Ahmet Bora Date: Tue, 12 Nov 2024 18:06:36 +0300 Subject: [PATCH 218/362] Update composer dependencies --- composer.json | 14 +- composer.lock | 119 ++++++++-------- vendor/bin/yaml-lint.bat | 5 + vendor/composer/autoload_classmap.php | 4 - vendor/composer/autoload_static.php | 4 - vendor/composer/installed.json | 127 +++++++++--------- vendor/composer/installed.php | 42 +++--- vendor/composer/semver/composer.json | 4 +- .../composer/semver/src/CompilingMatcher.php | 2 +- vendor/filp/whoops/composer.json | 8 +- .../src/Whoops/Handler/PrettyPageHandler.php | 2 +- vendor/filp/whoops/src/Whoops/Run.php | 2 +- .../whoops/src/Whoops/Util/TemplateHelper.php | 2 +- vendor/laminas/laminas-escaper/composer.json | 12 +- vendor/phpmailer/phpmailer/composer.json | 3 +- .../phpmailer/phpmailer/get_oauth_token.php | 6 +- .../phpmailer/language/phpmailer.lang-es.php | 13 +- .../phpmailer/language/phpmailer.lang-fr.php | 3 +- .../phpmailer/language/phpmailer.lang-ja.php | 14 +- .../phpmailer/language/phpmailer.lang-ku.php | 27 ++++ .../phpmailer/language/phpmailer.lang-ru.php | 22 ++- .../phpmailer/language/phpmailer.lang-tr.php | 9 +- .../phpmailer/language/phpmailer.lang-ur.php | 30 +++++ .../phpmailer/src/DSNConfigurator.php | 2 +- vendor/phpmailer/phpmailer/src/Exception.php | 2 +- vendor/phpmailer/phpmailer/src/OAuth.php | 4 +- .../phpmailer/src/OAuthTokenProvider.php | 2 +- vendor/phpmailer/phpmailer/src/PHPMailer.php | 48 +++---- vendor/phpmailer/phpmailer/src/POP3.php | 8 +- vendor/phpmailer/phpmailer/src/SMTP.php | 44 +++--- vendor/symfony/polyfill-intl-idn/Idn.php | 4 +- .../symfony/polyfill-intl-idn/composer.json | 5 +- vendor/symfony/polyfill-mbstring/Mbstring.php | 77 +++++++++-- .../symfony/polyfill-mbstring/bootstrap.php | 13 ++ .../symfony/polyfill-mbstring/bootstrap80.php | 14 +- .../symfony/polyfill-mbstring/composer.json | 2 +- vendor/symfony/yaml/Inline.php | 8 ++ 37 files changed, 439 insertions(+), 268 deletions(-) create mode 100644 vendor/bin/yaml-lint.bat create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php diff --git a/composer.json b/composer.json index e75b1e6fff..7a34d655eb 100644 --- a/composer.json +++ b/composer.json @@ -38,15 +38,15 @@ "ext-openssl": "*", "christian-riesen/base32": "1.6.0", "claviska/simpleimage": "4.2.0", - "composer/semver": "3.4.2", - "filp/whoops": "2.15.4", + "composer/semver": "3.4.3", + "filp/whoops": "2.16.0", "getkirby/composer-installer": "^1.2.1", - "laminas/laminas-escaper": "2.13.0", + "laminas/laminas-escaper": "2.14.0", "michelf/php-smartypants": "1.8.1", - "phpmailer/phpmailer": "6.9.1", - "symfony/polyfill-intl-idn": "1.30.0", - "symfony/polyfill-mbstring": "1.30.0", - "symfony/yaml": "6.4.11" + "phpmailer/phpmailer": "6.9.2", + "symfony/polyfill-intl-idn": "1.31.0", + "symfony/polyfill-mbstring": "1.31.0", + "symfony/yaml": "6.4.13" }, "replace": { "symfony/polyfill-php72": "*" diff --git a/composer.lock b/composer.lock index 580d9d07cd..787274848b 100644 --- a/composer.lock +++ b/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": "0cc5ffc791a52ffb1f139b57e2ae953f", + "content-hash": "0e221e037dadac76412edcfaab2ccb0f", "packages": [ { "name": "christian-riesen/base32", @@ -120,24 +120,24 @@ }, { "name": "composer/semver", - "version": "3.4.2", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", - "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { @@ -181,7 +181,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.2" + "source": "https://github.com/composer/semver/tree/3.4.3" }, "funding": [ { @@ -197,30 +197,30 @@ "type": "tidelift" } ], - "time": "2024-07-12T11:35:52+00:00" + "time": "2024-09-19T14:15:21+00:00" }, { "name": "filp/whoops", - "version": "2.15.4", + "version": "2.16.0", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546" + "reference": "befcdc0e5dce67252aa6322d82424be928214fa2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/a139776fa3f5985a50b509f2a02ff0f709d2a546", - "reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546", + "url": "https://api.github.com/repos/filp/whoops/zipball/befcdc0e5dce67252aa6322d82424be928214fa2", + "reference": "befcdc0e5dce67252aa6322d82424be928214fa2", "shasum": "" }, "require": { - "php": "^5.5.9 || ^7.0 || ^8.0", + "php": "^7.1 || ^8.0", "psr/log": "^1.0.1 || ^2.0 || ^3.0" }, "require-dev": { - "mockery/mockery": "^0.9 || ^1.0", - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3", - "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^4.0 || ^5.0" }, "suggest": { "symfony/var-dumper": "Pretty print complex values better with var-dumper available", @@ -260,7 +260,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.15.4" + "source": "https://github.com/filp/whoops/tree/2.16.0" }, "funding": [ { @@ -268,7 +268,7 @@ "type": "github" } ], - "time": "2023-11-03T12:00:00+00:00" + "time": "2024-09-25T12:00:00+00:00" }, { "name": "getkirby/composer-installer", @@ -319,33 +319,33 @@ }, { "name": "laminas/laminas-escaper", - "version": "2.13.0", + "version": "2.14.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-escaper.git", - "reference": "af459883f4018d0f8a0c69c7a209daef3bf973ba" + "reference": "0f7cb975f4443cf22f33408925c231225cfba8cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/af459883f4018d0f8a0c69c7a209daef3bf973ba", - "reference": "af459883f4018d0f8a0c69c7a209daef3bf973ba", + "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/0f7cb975f4443cf22f33408925c231225cfba8cb", + "reference": "0f7cb975f4443cf22f33408925c231225cfba8cb", "shasum": "" }, "require": { "ext-ctype": "*", "ext-mbstring": "*", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" }, "conflict": { "zendframework/zend-escaper": "*" }, "require-dev": { - "infection/infection": "^0.27.0", - "laminas/laminas-coding-standard": "~2.5.0", + "infection/infection": "^0.27.9", + "laminas/laminas-coding-standard": "~3.0.0", "maglnet/composer-require-checker": "^3.8.0", - "phpunit/phpunit": "^9.6.7", - "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.9" + "phpunit/phpunit": "^9.6.16", + "psalm/plugin-phpunit": "^0.19.0", + "vimeo/psalm": "^5.21.1" }, "type": "library", "autoload": { @@ -377,7 +377,7 @@ "type": "community_bridge" } ], - "time": "2023-10-10T08:35:13+00:00" + "time": "2024-10-24T10:12:53+00:00" }, { "name": "league/color-extractor", @@ -496,16 +496,16 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.9.1", + "version": "v6.9.2", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "039de174cd9c17a8389754d3b877a2ed22743e18" + "reference": "a7b17b42fa4887c92146243f3d2f4ccb962af17c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/039de174cd9c17a8389754d3b877a2ed22743e18", - "reference": "039de174cd9c17a8389754d3b877a2ed22743e18", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a7b17b42fa4887c92146243f3d2f4ccb962af17c", + "reference": "a7b17b42fa4887c92146243f3d2f4ccb962af17c", "shasum": "" }, "require": { @@ -565,7 +565,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.9.1" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.9.2" }, "funding": [ { @@ -573,7 +573,7 @@ "type": "github" } ], - "time": "2023-11-25T22:23:28+00:00" + "time": "2024-10-09T10:07:50+00:00" }, { "name": "psr/log", @@ -773,22 +773,21 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "a6e83bdeb3c84391d1dfe16f42e40727ce524a5c" + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a6e83bdeb3c84391d1dfe16f42e40727ce524a5c", - "reference": "a6e83bdeb3c84391d1dfe16f42e40727ce524a5c", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c36586dcf89a12315939e00ec9b4474adcb1d773", + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773", "shasum": "" }, "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" }, "suggest": { "ext-intl": "For best performance" @@ -837,7 +836,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.31.0" }, "funding": [ { @@ -853,7 +852,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-normalizer", @@ -938,20 +937,20 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", - "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -998,7 +997,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -1014,20 +1013,20 @@ "type": "tidelift" } ], - "time": "2024-06-19T12:30:46+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/yaml", - "version": "v6.4.11", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "be37e7f13195e05ab84ca5269365591edd240335" + "reference": "e99b4e94d124b29ee4cf3140e1b537d2dad8cec9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/be37e7f13195e05ab84ca5269365591edd240335", - "reference": "be37e7f13195e05ab84ca5269365591edd240335", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e99b4e94d124b29ee4cf3140e1b537d2dad8cec9", + "reference": "e99b4e94d124b29ee4cf3140e1b537d2dad8cec9", "shasum": "" }, "require": { @@ -1070,7 +1069,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.4.11" + "source": "https://github.com/symfony/yaml/tree/v6.4.13" }, "funding": [ { @@ -1086,13 +1085,13 @@ "type": "tidelift" } ], - "time": "2024-08-12T09:55:28+00:00" + "time": "2024-09-25T14:18:03+00:00" } ], "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -1109,7 +1108,7 @@ "ext-mbstring": "*", "ext-openssl": "*" }, - "platform-dev": [], + "platform-dev": {}, "platform-overrides": { "php": "8.1.0" }, diff --git a/vendor/bin/yaml-lint.bat b/vendor/bin/yaml-lint.bat new file mode 100644 index 0000000000..fbce06e043 --- /dev/null +++ b/vendor/bin/yaml-lint.bat @@ -0,0 +1,5 @@ +@ECHO OFF +setlocal DISABLEDELAYEDEXPANSION +SET BIN_TARGET=%~dp0/yaml-lint +SET COMPOSER_RUNTIME_BIN_DIR=%~dp0 +php "%BIN_TARGET%" %* diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index d2661b2b7b..db43972028 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -148,10 +148,6 @@ 'Kirby\\Cms\\UserRules' => $baseDir . '/src/Cms/UserRules.php', 'Kirby\\Cms\\Users' => $baseDir . '/src/Cms/Users.php', 'Kirby\\Cms\\Visitor' => $baseDir . '/src/Cms/Visitor.php', - 'Kirby\\ComposerInstaller\\CmsInstaller' => $vendorDir . '/getkirby/composer-installer/src/ComposerInstaller/CmsInstaller.php', - 'Kirby\\ComposerInstaller\\Installer' => $vendorDir . '/getkirby/composer-installer/src/ComposerInstaller/Installer.php', - 'Kirby\\ComposerInstaller\\Plugin' => $vendorDir . '/getkirby/composer-installer/src/ComposerInstaller/Plugin.php', - 'Kirby\\ComposerInstaller\\PluginInstaller' => $vendorDir . '/getkirby/composer-installer/src/ComposerInstaller/PluginInstaller.php', 'Kirby\\Content\\Content' => $baseDir . '/src/Content/Content.php', 'Kirby\\Content\\ContentStorage' => $baseDir . '/src/Content/ContentStorage.php', 'Kirby\\Content\\ContentStorageHandler' => $baseDir . '/src/Content/ContentStorageHandler.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 39345b8e1d..077cf12b68 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -269,10 +269,6 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35 'Kirby\\Cms\\UserRules' => __DIR__ . '/../..' . '/src/Cms/UserRules.php', 'Kirby\\Cms\\Users' => __DIR__ . '/../..' . '/src/Cms/Users.php', 'Kirby\\Cms\\Visitor' => __DIR__ . '/../..' . '/src/Cms/Visitor.php', - 'Kirby\\ComposerInstaller\\CmsInstaller' => __DIR__ . '/..' . '/getkirby/composer-installer/src/ComposerInstaller/CmsInstaller.php', - 'Kirby\\ComposerInstaller\\Installer' => __DIR__ . '/..' . '/getkirby/composer-installer/src/ComposerInstaller/Installer.php', - 'Kirby\\ComposerInstaller\\Plugin' => __DIR__ . '/..' . '/getkirby/composer-installer/src/ComposerInstaller/Plugin.php', - 'Kirby\\ComposerInstaller\\PluginInstaller' => __DIR__ . '/..' . '/getkirby/composer-installer/src/ComposerInstaller/PluginInstaller.php', 'Kirby\\Content\\Content' => __DIR__ . '/../..' . '/src/Content/Content.php', 'Kirby\\Content\\ContentStorage' => __DIR__ . '/../..' . '/src/Content/ContentStorage.php', 'Kirby\\Content\\ContentStorageHandler' => __DIR__ . '/../..' . '/src/Content/ContentStorageHandler.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index b9a7a7a7d1..4aa2164b65 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -120,27 +120,27 @@ }, { "name": "composer/semver", - "version": "3.4.2", - "version_normalized": "3.4.2.0", + "version": "3.4.3", + "version_normalized": "3.4.3.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", - "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, - "time": "2024-07-12T11:35:52+00:00", + "time": "2024-09-19T14:15:21+00:00", "type": "library", "extra": { "branch-alias": { @@ -184,7 +184,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.2" + "source": "https://github.com/composer/semver/tree/3.4.3" }, "funding": [ { @@ -204,33 +204,33 @@ }, { "name": "filp/whoops", - "version": "2.15.4", - "version_normalized": "2.15.4.0", + "version": "2.16.0", + "version_normalized": "2.16.0.0", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546" + "reference": "befcdc0e5dce67252aa6322d82424be928214fa2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/a139776fa3f5985a50b509f2a02ff0f709d2a546", - "reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546", + "url": "https://api.github.com/repos/filp/whoops/zipball/befcdc0e5dce67252aa6322d82424be928214fa2", + "reference": "befcdc0e5dce67252aa6322d82424be928214fa2", "shasum": "" }, "require": { - "php": "^5.5.9 || ^7.0 || ^8.0", + "php": "^7.1 || ^8.0", "psr/log": "^1.0.1 || ^2.0 || ^3.0" }, "require-dev": { - "mockery/mockery": "^0.9 || ^1.0", - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3", - "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^4.0 || ^5.0" }, "suggest": { "symfony/var-dumper": "Pretty print complex values better with var-dumper available", "whoops/soap": "Formats errors as SOAP responses" }, - "time": "2023-11-03T12:00:00+00:00", + "time": "2024-09-25T12:00:00+00:00", "type": "library", "extra": { "branch-alias": { @@ -266,7 +266,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.15.4" + "source": "https://github.com/filp/whoops/tree/2.16.0" }, "funding": [ { @@ -328,36 +328,36 @@ }, { "name": "laminas/laminas-escaper", - "version": "2.13.0", - "version_normalized": "2.13.0.0", + "version": "2.14.0", + "version_normalized": "2.14.0.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-escaper.git", - "reference": "af459883f4018d0f8a0c69c7a209daef3bf973ba" + "reference": "0f7cb975f4443cf22f33408925c231225cfba8cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/af459883f4018d0f8a0c69c7a209daef3bf973ba", - "reference": "af459883f4018d0f8a0c69c7a209daef3bf973ba", + "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/0f7cb975f4443cf22f33408925c231225cfba8cb", + "reference": "0f7cb975f4443cf22f33408925c231225cfba8cb", "shasum": "" }, "require": { "ext-ctype": "*", "ext-mbstring": "*", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" }, "conflict": { "zendframework/zend-escaper": "*" }, "require-dev": { - "infection/infection": "^0.27.0", - "laminas/laminas-coding-standard": "~2.5.0", + "infection/infection": "^0.27.9", + "laminas/laminas-coding-standard": "~3.0.0", "maglnet/composer-require-checker": "^3.8.0", - "phpunit/phpunit": "^9.6.7", - "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.9" + "phpunit/phpunit": "^9.6.16", + "psalm/plugin-phpunit": "^0.19.0", + "vimeo/psalm": "^5.21.1" }, - "time": "2023-10-10T08:35:13+00:00", + "time": "2024-10-24T10:12:53+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -514,17 +514,17 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.9.1", - "version_normalized": "6.9.1.0", + "version": "v6.9.2", + "version_normalized": "6.9.2.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "039de174cd9c17a8389754d3b877a2ed22743e18" + "reference": "a7b17b42fa4887c92146243f3d2f4ccb962af17c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/039de174cd9c17a8389754d3b877a2ed22743e18", - "reference": "039de174cd9c17a8389754d3b877a2ed22743e18", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a7b17b42fa4887c92146243f3d2f4ccb962af17c", + "reference": "a7b17b42fa4887c92146243f3d2f4ccb962af17c", "shasum": "" }, "require": { @@ -554,7 +554,7 @@ "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, - "time": "2023-11-25T22:23:28+00:00", + "time": "2024-10-09T10:07:50+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -586,7 +586,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.9.1" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.9.2" }, "funding": [ { @@ -803,28 +803,27 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.30.0", - "version_normalized": "1.30.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "a6e83bdeb3c84391d1dfe16f42e40727ce524a5c" + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a6e83bdeb3c84391d1dfe16f42e40727ce524a5c", - "reference": "a6e83bdeb3c84391d1dfe16f42e40727ce524a5c", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c36586dcf89a12315939e00ec9b4474adcb1d773", + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773", "shasum": "" }, "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" }, "suggest": { "ext-intl": "For best performance" }, - "time": "2024-05-31T15:07:36+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { "thanks": { @@ -870,7 +869,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.31.0" }, "funding": [ { @@ -974,21 +973,21 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.30.0", - "version_normalized": "1.30.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", - "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -996,7 +995,7 @@ "suggest": { "ext-mbstring": "For best performance" }, - "time": "2024-06-19T12:30:46+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { "thanks": { @@ -1037,7 +1036,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -1057,17 +1056,17 @@ }, { "name": "symfony/yaml", - "version": "v6.4.11", - "version_normalized": "6.4.11.0", + "version": "v6.4.13", + "version_normalized": "6.4.13.0", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "be37e7f13195e05ab84ca5269365591edd240335" + "reference": "e99b4e94d124b29ee4cf3140e1b537d2dad8cec9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/be37e7f13195e05ab84ca5269365591edd240335", - "reference": "be37e7f13195e05ab84ca5269365591edd240335", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e99b4e94d124b29ee4cf3140e1b537d2dad8cec9", + "reference": "e99b4e94d124b29ee4cf3140e1b537d2dad8cec9", "shasum": "" }, "require": { @@ -1081,7 +1080,7 @@ "require-dev": { "symfony/console": "^5.4|^6.0|^7.0" }, - "time": "2024-08-12T09:55:28+00:00", + "time": "2024-09-25T14:18:03+00:00", "bin": [ "Resources/bin/yaml-lint" ], @@ -1112,7 +1111,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.4.11" + "source": "https://github.com/symfony/yaml/tree/v6.4.13" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index b4c2097977..dbe8b48b35 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -29,18 +29,18 @@ 'dev_requirement' => false, ), 'composer/semver' => array( - 'pretty_version' => '3.4.2', - 'version' => '3.4.2.0', - 'reference' => 'c51258e759afdb17f1fd1fe83bc12baaef6309d6', + 'pretty_version' => '3.4.3', + 'version' => '3.4.3.0', + 'reference' => '4313d26ada5e0c4edfbd1dc481a92ff7bff91f12', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), 'dev_requirement' => false, ), 'filp/whoops' => array( - 'pretty_version' => '2.15.4', - 'version' => '2.15.4.0', - 'reference' => 'a139776fa3f5985a50b509f2a02ff0f709d2a546', + 'pretty_version' => '2.16.0', + 'version' => '2.16.0.0', + 'reference' => 'befcdc0e5dce67252aa6322d82424be928214fa2', 'type' => 'library', 'install_path' => __DIR__ . '/../filp/whoops', 'aliases' => array(), @@ -65,9 +65,9 @@ 'dev_requirement' => false, ), 'laminas/laminas-escaper' => array( - 'pretty_version' => '2.13.0', - 'version' => '2.13.0.0', - 'reference' => 'af459883f4018d0f8a0c69c7a209daef3bf973ba', + 'pretty_version' => '2.14.0', + 'version' => '2.14.0.0', + 'reference' => '0f7cb975f4443cf22f33408925c231225cfba8cb', 'type' => 'library', 'install_path' => __DIR__ . '/../laminas/laminas-escaper', 'aliases' => array(), @@ -98,9 +98,9 @@ 'dev_requirement' => false, ), 'phpmailer/phpmailer' => array( - 'pretty_version' => 'v6.9.1', - 'version' => '6.9.1.0', - 'reference' => '039de174cd9c17a8389754d3b877a2ed22743e18', + 'pretty_version' => 'v6.9.2', + 'version' => '6.9.2.0', + 'reference' => 'a7b17b42fa4887c92146243f3d2f4ccb962af17c', 'type' => 'library', 'install_path' => __DIR__ . '/../phpmailer/phpmailer', 'aliases' => array(), @@ -134,9 +134,9 @@ 'dev_requirement' => false, ), 'symfony/polyfill-intl-idn' => array( - 'pretty_version' => 'v1.30.0', - 'version' => '1.30.0.0', - 'reference' => 'a6e83bdeb3c84391d1dfe16f42e40727ce524a5c', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => 'c36586dcf89a12315939e00ec9b4474adcb1d773', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn', 'aliases' => array(), @@ -152,9 +152,9 @@ 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.30.0', - 'version' => '1.30.0.0', - 'reference' => 'fd22ab50000ef01661e2a31d850ebaa297f8e03c', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => '85181ba99b2345b0ef10ce42ecac37612d9fd341', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), @@ -167,9 +167,9 @@ ), ), 'symfony/yaml' => array( - 'pretty_version' => 'v6.4.11', - 'version' => '6.4.11.0', - 'reference' => 'be37e7f13195e05ab84ca5269365591edd240335', + 'pretty_version' => 'v6.4.13', + 'version' => '6.4.13.0', + 'reference' => 'e99b4e94d124b29ee4cf3140e1b537d2dad8cec9', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), diff --git a/vendor/composer/semver/composer.json b/vendor/composer/semver/composer.json index f3a6f4cc68..1fad9e5486 100644 --- a/vendor/composer/semver/composer.json +++ b/vendor/composer/semver/composer.json @@ -34,8 +34,8 @@ "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.2 || ^5", - "phpstan/phpstan": "^1.4" + "symfony/phpunit-bridge": "^3 || ^7", + "phpstan/phpstan": "^1.11" }, "autoload": { "psr-4": { diff --git a/vendor/composer/semver/src/CompilingMatcher.php b/vendor/composer/semver/src/CompilingMatcher.php index 45bce70a63..aea1d3b95c 100644 --- a/vendor/composer/semver/src/CompilingMatcher.php +++ b/vendor/composer/semver/src/CompilingMatcher.php @@ -64,7 +64,7 @@ public static function clear() * @phpstan-param Constraint::OP_* $operator * @param string $version * - * @return mixed + * @return bool */ public static function match(ConstraintInterface $constraint, $operator, $version) { diff --git a/vendor/filp/whoops/composer.json b/vendor/filp/whoops/composer.json index 06b5c756bf..c72fab0015 100644 --- a/vendor/filp/whoops/composer.json +++ b/vendor/filp/whoops/composer.json @@ -15,13 +15,13 @@ "test": "phpunit --testdox tests" }, "require": { - "php": "^5.5.9 || ^7.0 || ^8.0", + "php": "^7.1 || ^8.0", "psr/log": "^1.0.1 || ^2.0 || ^3.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3", - "mockery/mockery": "^0.9 || ^1.0", - "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", + "mockery/mockery": "^1.0", + "symfony/var-dumper": "^4.0 || ^5.0" }, "suggest": { "symfony/var-dumper": "Pretty print complex values better with var-dumper available", diff --git a/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php b/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php index 167407e81a..b739ac0696 100644 --- a/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php +++ b/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php @@ -383,7 +383,7 @@ public function addDataTableCallback($label, /* callable */ $callback) throw new InvalidArgumentException('Expecting callback argument to be callable'); } - $this->extraTables[$label] = function (\Whoops\Inspector\InspectorInterface $inspector = null) use ($callback) { + $this->extraTables[$label] = function (?\Whoops\Inspector\InspectorInterface $inspector = null) use ($callback) { try { $result = call_user_func($callback, $inspector); diff --git a/vendor/filp/whoops/src/Whoops/Run.php b/vendor/filp/whoops/src/Whoops/Run.php index 08627680fe..7be63affc2 100644 --- a/vendor/filp/whoops/src/Whoops/Run.php +++ b/vendor/filp/whoops/src/Whoops/Run.php @@ -81,7 +81,7 @@ final class Run implements RunInterface */ private $frameFilters = []; - public function __construct(SystemFacade $system = null) + public function __construct(?SystemFacade $system = null) { $this->system = $system ?: new SystemFacade; $this->inspectorFactory = new InspectorFactory(); diff --git a/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php b/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php index 8e4df32802..5612c0b771 100644 --- a/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php +++ b/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php @@ -233,7 +233,7 @@ public function slug($original) * * @param string $template */ - public function render($template, array $additionalVariables = null) + public function render($template, ?array $additionalVariables = null) { $variables = $this->getVariables(); diff --git a/vendor/laminas/laminas-escaper/composer.json b/vendor/laminas/laminas-escaper/composer.json index 16cf063377..38f386956a 100644 --- a/vendor/laminas/laminas-escaper/composer.json +++ b/vendor/laminas/laminas-escaper/composer.json @@ -29,17 +29,17 @@ "extra": { }, "require": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", "ext-ctype": "*", "ext-mbstring": "*" }, "require-dev": { - "infection/infection": "^0.27.0", - "laminas/laminas-coding-standard": "~2.5.0", + "infection/infection": "^0.27.9", + "laminas/laminas-coding-standard": "~3.0.0", "maglnet/composer-require-checker": "^3.8.0", - "phpunit/phpunit": "^9.6.7", - "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.9" + "phpunit/phpunit": "^9.6.16", + "psalm/plugin-phpunit": "^0.19.0", + "vimeo/psalm": "^5.21.1" }, "autoload": { "psr-4": { diff --git a/vendor/phpmailer/phpmailer/composer.json b/vendor/phpmailer/phpmailer/composer.json index fa170a0bbb..7b008b7c57 100644 --- a/vendor/phpmailer/phpmailer/composer.json +++ b/vendor/phpmailer/phpmailer/composer.json @@ -28,7 +28,8 @@ "config": { "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true - } + }, + "lock": false }, "require": { "php": ">=5.5.0", diff --git a/vendor/phpmailer/phpmailer/get_oauth_token.php b/vendor/phpmailer/phpmailer/get_oauth_token.php index cda0445c6b..0e54a00b63 100644 --- a/vendor/phpmailer/phpmailer/get_oauth_token.php +++ b/vendor/phpmailer/phpmailer/get_oauth_token.php @@ -12,7 +12,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -36,7 +36,7 @@ * Aliases for League Provider Classes * Make sure you have added these to your composer.json and run `composer install` * Plenty to choose from here: - * @see http://oauth2-client.thephpleague.com/providers/thirdparty/ + * @see https://oauth2-client.thephpleague.com/providers/thirdparty/ */ //@see https://github.com/thephpleague/oauth2-google use League\OAuth2\Client\Provider\Google; @@ -178,5 +178,5 @@ ); //Use this to interact with an API on the users behalf //Use this to get a new access token if the old one expires - echo 'Refresh Token: ', $token->getRefreshToken(); + echo 'Refresh Token: ', htmlspecialchars($token->getRefreshToken()); } diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php index 6992041873..4e74bfb7b8 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php @@ -5,27 +5,32 @@ * @package PHPMailer * @author Matt Sturdy * @author Crystopher Glodzienski Cardoso + * @author Daniel Cruz */ $PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.'; +$PHPMAILER_LANG['buggy_php'] = 'Tu versión de PHP está afectada por un bug que puede resultar en mensajes corruptos. Para arreglarlo, cambia a enviar usando SMTP, deshabilita la opción mail.add_x_header en tu php.ini, cambia a MacOS o Linux, o actualiza tu PHP a la versión 7.0.17+ o 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'Error SMTP: Imposible conectar al servidor SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.'; $PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío.'; $PHPMAILER_LANG['encoding'] = 'Codificación desconocida: '; $PHPMAILER_LANG['execute'] = 'Imposible ejecutar: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; $PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: '; $PHPMAILER_LANG['file_open'] = 'Error de Archivo: Imposible abrir el archivo: '; $PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: '; $PHPMAILER_LANG['instantiate'] = 'Imposible crear una instancia de la función Mail.'; $PHPMAILER_LANG['invalid_address'] = 'Imposible enviar: dirección de email inválido: '; +$PHPMAILER_LANG['invalid_header'] = 'Nombre o valor de encabezado no válido'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Hostentry inválido: '; +$PHPMAILER_LANG['invalid_host'] = 'Host inválido: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.'; $PHPMAILER_LANG['provide_address'] = 'Debe proporcionar al menos una dirección de email de destino.'; $PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: '; $PHPMAILER_LANG['signing'] = 'Error al firmar: '; +$PHPMAILER_LANG['smtp_code'] = 'Código del servidor SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Información adicional del servidor SMTP: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detalle: '; $PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; $PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; -$PHPMAILER_LANG['smtp_code'] = 'Código del servidor SMTP: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Información adicional del servidor SMTP: '; -$PHPMAILER_LANG['invalid_header'] = 'Nombre o valor de encabezado no válido'; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php index 0d367fcf88..a6d582d833 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php @@ -6,7 +6,6 @@ * Some French punctuation requires a thin non-breaking space (U+202F) character before it, * for example before a colon or exclamation mark. * There is one of these characters between these quotes: " " - * @see http://unicode.org/udhr/n/notes_fra.html */ $PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : échec de l’authentification.'; @@ -31,7 +30,7 @@ $PHPMAILER_LANG['signing'] = 'Erreur de signature : '; $PHPMAILER_LANG['smtp_code'] = 'Code SMTP : '; $PHPMAILER_LANG['smtp_code_ex'] = 'Informations supplémentaires SMTP : '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'La fonction SMTP connect() a échouée.'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'La fonction SMTP connect() a échoué.'; $PHPMAILER_LANG['smtp_detail'] = 'Détails : '; $PHPMAILER_LANG['smtp_error'] = 'Erreur du serveur SMTP : '; $PHPMAILER_LANG['variable_set'] = 'Impossible d’initialiser ou de réinitialiser une variable : '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php index c76f5264c9..d01869cec8 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php @@ -3,27 +3,35 @@ /** * Japanese PHPMailer language file: refer to English translation for definitive list * @package PHPMailer - * @author Mitsuhiro Yoshida + * @author Mitsuhiro Yoshida * @author Yoshi Sakai * @author Arisophy + * @author ARAKI Musashi */ $PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。'; +$PHPMAILER_LANG['buggy_php'] = 'ご利用のバージョンのPHPには不具合があり、メッセージが破損するおそれがあります。問題の解決は以下のいずれかを行ってください。SMTPでの送信に切り替える。php.iniのmail.add_x_headerをoffにする。MacOSまたはLinuxに切り替える。PHPバージョン7.0.17以降または7.1.3以降にアップグレードする。'; $PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。'; $PHPMAILER_LANG['empty_message'] = 'メール本文が空です。'; $PHPMAILER_LANG['encoding'] = '不明なエンコーディング: '; $PHPMAILER_LANG['execute'] = '実行できませんでした: '; +$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: '; $PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: '; $PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: '; $PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: '; $PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。'; $PHPMAILER_LANG['invalid_address'] = '不正なメールアドレス: '; -$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; +$PHPMAILER_LANG['invalid_header'] = '不正なヘッダー名またはその内容'; +$PHPMAILER_LANG['invalid_hostentry'] = '不正なホストエントリー: '; +$PHPMAILER_LANG['invalid_host'] = '不正なホスト: '; $PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。'; +$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: '; $PHPMAILER_LANG['signing'] = '署名エラー: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTPコード: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'SMTP追加情報: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP接続に失敗しました。'; +$PHPMAILER_LANG['smtp_detail'] = '詳細: '; $PHPMAILER_LANG['smtp_error'] = 'SMTPサーバーエラー: '; $PHPMAILER_LANG['variable_set'] = '変数が存在しません: '; -$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php new file mode 100644 index 0000000000..cf3bda69f2 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'هەڵەی SMTP : نەتوانرا کۆدەکە پشتڕاست بکرێتەوە '; +$PHPMAILER_LANG['connect_host'] = 'هەڵەی SMTP: نەتوانرا پەیوەندی بە سێرڤەرەوە بکات SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'هەڵەی SMTP: ئەو زانیاریانە قبوڵ نەکرا.'; +$PHPMAILER_LANG['empty_message'] = 'پەیامەکە بەتاڵە'; +$PHPMAILER_LANG['encoding'] = 'کۆدکردنی نەزانراو : '; +$PHPMAILER_LANG['execute'] = 'ناتوانرێت جێبەجێ بکرێت: '; +$PHPMAILER_LANG['file_access'] = 'ناتوانرێت دەستت بگات بە فایلەکە: '; +$PHPMAILER_LANG['file_open'] = 'هەڵەی پەڕگە(فایل): ناتوانرێت بکرێتەوە: '; +$PHPMAILER_LANG['from_failed'] = 'هەڵە لە ئاستی ناونیشانی نێرەر: '; +$PHPMAILER_LANG['instantiate'] = 'ناتوانرێت خزمەتگوزاری پۆستە پێشکەش بکرێت.'; +$PHPMAILER_LANG['invalid_address'] = 'نەتوانرا بنێردرێت ، چونکە ناونیشانی ئیمەیڵەکە نادروستە: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' مەیلەر پشتگیری ناکات'; +$PHPMAILER_LANG['provide_address'] = 'دەبێت ناونیشانی ئیمەیڵی لانیکەم یەک وەرگر دابین بکرێت.'; +$PHPMAILER_LANG['recipients_failed'] = ' هەڵەی SMTP: ئەم هەڵانەی خوارەوەشکستی هێنا لە ناردن بۆ هەردووکیان: '; +$PHPMAILER_LANG['signing'] = 'هەڵەی واژۆ: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect()پەیوەندی شکستی هێنا .'; +$PHPMAILER_LANG['smtp_error'] = 'هەڵەی ئاستی سێرڤەری SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'ناتوانرێت بیگۆڕیت یان دوبارە بینێریتەوە: '; +$PHPMAILER_LANG['extension_missing'] = 'درێژکراوە نەماوە: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php index 8c8c5e8177..8013f37c4d 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php @@ -5,24 +5,32 @@ * @package PHPMailer * @author Alexey Chumakov * @author Foster Snowhill + * @author ProjectSoft */ -$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; +$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: не удалось пройти аутентификацию.'; +$PHPMAILER_LANG['buggy_php'] = 'В вашей версии PHP есть ошибка, которая может привести к повреждению сообщений. Чтобы исправить, переключитесь на отправку по SMTP, отключите опцию mail.add_x_header в ваш php.ini, переключитесь на MacOS или Linux или обновите PHP до версии 7.0.17+ или 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к SMTP-серверу.'; $PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.'; +$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение'; $PHPMAILER_LANG['encoding'] = 'Неизвестная кодировка: '; $PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: '; +$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: '; $PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: '; $PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удаётся открыть файл: '; $PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: '; $PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail().'; -$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один email-адрес получателя.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.'; -$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: не удалась отправка таким адресатам: '; -$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение'; $PHPMAILER_LANG['invalid_address'] = 'Не отправлено из-за неправильного формата email-адреса: '; +$PHPMAILER_LANG['invalid_header'] = 'Неверное имя или значение заголовка'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Неверная запись хоста: '; +$PHPMAILER_LANG['invalid_host'] = 'Неверный хост: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.'; +$PHPMAILER_LANG['provide_address'] = 'Вы должны указать хотя бы один адрес электронной почты получателя.'; +$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: Ошибка следующих получателей: '; $PHPMAILER_LANG['signing'] = 'Ошибка подписи: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером'; +$PHPMAILER_LANG['smtp_code'] = 'Код SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Дополнительная информация SMTP: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером.'; +$PHPMAILER_LANG['smtp_detail'] = 'Детали: '; $PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: '; $PHPMAILER_LANG['variable_set'] = 'Невозможно установить или сбросить переменную: '; -$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php index f938f8020e..3c45bc1c35 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php @@ -11,21 +11,28 @@ */ $PHPMAILER_LANG['authenticate'] = 'SMTP Hatası: Oturum açılamadı.'; +$PHPMAILER_LANG['buggy_php'] = 'PHP sürümünüz iletilerin bozulmasına neden olabilecek bir hatadan etkileniyor. Bunu düzeltmek için, SMTP kullanarak göndermeye geçin, mail.add_x_header seçeneğini devre dışı bırakın php.ini dosyanızdaki mail.add_x_header seçeneğini devre dışı bırakın, MacOS veya Linux geçin veya PHP sürümünü 7.0.17+ veya 7.1.3+ sürümüne yükseltin,'; $PHPMAILER_LANG['connect_host'] = 'SMTP Hatası: SMTP sunucusuna bağlanılamadı.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP Hatası: Veri kabul edilmedi.'; $PHPMAILER_LANG['empty_message'] = 'Mesajın içeriği boş'; $PHPMAILER_LANG['encoding'] = 'Bilinmeyen karakter kodlama: '; $PHPMAILER_LANG['execute'] = 'Çalıştırılamadı: '; +$PHPMAILER_LANG['extension_missing'] = 'Eklenti bulunamadı: '; $PHPMAILER_LANG['file_access'] = 'Dosyaya erişilemedi: '; $PHPMAILER_LANG['file_open'] = 'Dosya Hatası: Dosya açılamadı: '; $PHPMAILER_LANG['from_failed'] = 'Belirtilen adreslere gönderme başarısız: '; $PHPMAILER_LANG['instantiate'] = 'Örnek e-posta fonksiyonu oluşturulamadı.'; $PHPMAILER_LANG['invalid_address'] = 'Geçersiz e-posta adresi: '; +$PHPMAILER_LANG['invalid_header'] = 'Geçersiz başlık adı veya değeri: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Geçersiz ana bilgisayar girişi: '; +$PHPMAILER_LANG['invalid_host'] = 'Geçersiz ana bilgisayar: '; $PHPMAILER_LANG['mailer_not_supported'] = ' e-posta kütüphanesi desteklenmiyor.'; $PHPMAILER_LANG['provide_address'] = 'En az bir alıcı e-posta adresi belirtmelisiniz.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Hatası: Belirtilen alıcılara ulaşılamadı: '; $PHPMAILER_LANG['signing'] = 'İmzalama hatası: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP kodu: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'ek SMTP bilgileri: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP connect() fonksiyonu başarısız.'; +$PHPMAILER_LANG['smtp_detail'] = 'SMTP SMTP Detayı: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP sunucu hatası: '; $PHPMAILER_LANG['variable_set'] = 'Değişken ayarlanamadı ya da sıfırlanamadı: '; -$PHPMAILER_LANG['extension_missing'] = 'Eklenti bulunamadı: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php new file mode 100644 index 0000000000..0b9de0f127 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php @@ -0,0 +1,30 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP خرابی: تصدیق کرنے سے قاصر۔'; +$PHPMAILER_LANG['connect_host'] = 'SMTP خرابی: سرور سے منسلک ہونے سے قاصر۔'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP خرابی: ڈیٹا قبول نہیں کیا گیا۔'; +$PHPMAILER_LANG['empty_message'] = 'پیغام کی باڈی خالی ہے۔'; +$PHPMAILER_LANG['encoding'] = 'نامعلوم انکوڈنگ: '; +$PHPMAILER_LANG['execute'] = 'عمل کرنے کے قابل نہیں '; +$PHPMAILER_LANG['file_access'] = 'فائل تک رسائی سے قاصر:'; +$PHPMAILER_LANG['file_open'] = 'فائل کی خرابی: فائل کو کھولنے سے قاصر:'; +$PHPMAILER_LANG['from_failed'] = 'درج ذیل بھیجنے والے کا پتہ ناکام ہو گیا:'; +$PHPMAILER_LANG['instantiate'] = 'میل فنکشن کی مثال بنانے سے قاصر۔'; +$PHPMAILER_LANG['invalid_address'] = 'بھیجنے سے قاصر: غلط ای میل پتہ:'; +$PHPMAILER_LANG['mailer_not_supported'] = ' میلر تعاون یافتہ نہیں ہے۔'; +$PHPMAILER_LANG['provide_address'] = 'آپ کو کم از کم ایک منزل کا ای میل پتہ فراہم کرنا چاہیے۔'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP خرابی: درج ذیل پتہ پر نہیں بھیجا جاسکا: '; +$PHPMAILER_LANG['signing'] = 'دستخط کی خرابی: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP ملنا ناکام ہوا'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP سرور کی خرابی: '; +$PHPMAILER_LANG['variable_set'] = 'متغیر سیٹ نہیں کیا جا سکا: '; +$PHPMAILER_LANG['extension_missing'] = 'ایکٹینشن موجود نہیں ہے۔ '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP سرور کوڈ: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'اضافی SMTP سرور کی معلومات:'; +$PHPMAILER_LANG['invalid_header'] = 'غلط ہیڈر کا نام یا قدر'; diff --git a/vendor/phpmailer/phpmailer/src/DSNConfigurator.php b/vendor/phpmailer/phpmailer/src/DSNConfigurator.php index 566c9618f5..7058c1f05e 100644 --- a/vendor/phpmailer/phpmailer/src/DSNConfigurator.php +++ b/vendor/phpmailer/phpmailer/src/DSNConfigurator.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2023 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. diff --git a/vendor/phpmailer/phpmailer/src/Exception.php b/vendor/phpmailer/phpmailer/src/Exception.php index 52eaf95158..09c1a2cfef 100644 --- a/vendor/phpmailer/phpmailer/src/Exception.php +++ b/vendor/phpmailer/phpmailer/src/Exception.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. diff --git a/vendor/phpmailer/phpmailer/src/OAuth.php b/vendor/phpmailer/phpmailer/src/OAuth.php index c1d5b77623..a7e958860c 100644 --- a/vendor/phpmailer/phpmailer/src/OAuth.php +++ b/vendor/phpmailer/phpmailer/src/OAuth.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -29,7 +29,7 @@ * OAuth - OAuth2 authentication wrapper class. * Uses the oauth2-client package from the League of Extraordinary Packages. * - * @see http://oauth2-client.thephpleague.com + * @see https://oauth2-client.thephpleague.com * * @author Marcus Bointon (Synchro/coolbru) */ diff --git a/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php b/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php index 1155507435..cbda1a1296 100644 --- a/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php +++ b/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. diff --git a/vendor/phpmailer/phpmailer/src/PHPMailer.php b/vendor/phpmailer/phpmailer/src/PHPMailer.php index ba4bcd4728..12da10354f 100644 --- a/vendor/phpmailer/phpmailer/src/PHPMailer.php +++ b/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -152,8 +152,7 @@ class PHPMailer * Only supported in simple alt or alt_inline message types * To generate iCal event structures, use classes like EasyPeasyICS or iCalcreator. * - * @see http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/ - * @see http://kigkonsult.se/iCalcreator/ + * @see https://kigkonsult.se/iCalcreator/ * * @var string */ @@ -358,7 +357,7 @@ class PHPMailer public $AuthType = ''; /** - * SMTP SMTPXClient command attibutes + * SMTP SMTPXClient command attributes * * @var array */ @@ -468,7 +467,7 @@ class PHPMailer * Only applicable when sending via SMTP. * * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path - * @see http://www.postfix.org/VERP_README.html Postfix VERP info + * @see https://www.postfix.org/VERP_README.html Postfix VERP info * * @var bool */ @@ -551,10 +550,10 @@ class PHPMailer * The function that handles the result of the send email action. * It is called out by send() for each email sent. * - * Value can be any php callable: http://www.php.net/is_callable + * Value can be any php callable: https://www.php.net/is_callable * * Parameters: - * bool $result result of the send action + * bool $result result of the send action * array $to email addresses of the recipients * array $cc cc email addresses * array $bcc bcc email addresses @@ -757,7 +756,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.9.1'; + const VERSION = '6.9.2'; /** * Error severity: message only, continue processing. @@ -903,7 +902,7 @@ protected function edebug($str) } //Is this a PSR-3 logger? if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) { - $this->Debugoutput->debug($str); + $this->Debugoutput->debug(rtrim($str, "\r\n")); return; } @@ -1072,7 +1071,7 @@ public function addReplyTo($address, $name = '') * be modified after calling this function), addition of such addresses is delayed until send(). * Addresses that have been added already return false, but do not throw exceptions. * - * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' + * @param string $kind One of 'to', 'cc', 'bcc', or 'Reply-To' * @param string $address The email address * @param string $name An optional username associated with the address * @@ -1212,7 +1211,7 @@ protected function addAnAddress($kind, $address, $name = '') * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available. * Note that quotes in the name part are removed. * - * @see http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation + * @see https://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation * * @param string $addrstr The address list string * @param bool $useimap Whether to use the IMAP extension to parse the list @@ -1407,7 +1406,6 @@ public static function validateAddress($address, $patternselect = null) * * IPv6 literals: 'first.last@[IPv6:a1::]' * Not all of these will necessarily work for sending! * - * @see http://squiloople.com/2009/12/20/email-address-validation/ * @copyright 2009-2010 Michael Rushton * Feel free to use and redistribute this code. But please keep this copyright notice. */ @@ -1734,9 +1732,8 @@ protected function sendmailSend($header, $body) //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver //A space after `-f` is optional, but there is a long history of its presence //causing problems, so we don't use one - //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html - //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html - //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html + //Exim docs: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html + //Sendmail docs: https://www.sendmail.org/~ca/email/man/sendmail.html //Example problem: https://www.drupal.org/node/1057954 //PHP 5.6 workaround @@ -1901,7 +1898,7 @@ protected static function fileIsAccessible($path) /** * Send mail using the PHP mail() function. * - * @see http://www.php.net/manual/en/book.mail.php + * @see https://www.php.net/manual/en/book.mail.php * * @param string $header The message headers * @param string $body The message body @@ -1931,9 +1928,8 @@ protected function mailSend($header, $body) //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver //A space after `-f` is optional, but there is a long history of its presence //causing problems, so we don't use one - //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html - //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html - //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html + //Exim docs: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html + //Sendmail docs: https://www.sendmail.org/~ca/email/man/sendmail.html //Example problem: https://www.drupal.org/node/1057954 //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. @@ -3634,7 +3630,7 @@ public function has8bitChars($text) * without breaking lines within a character. * Adapted from a function by paravoid. * - * @see http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 + * @see https://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 * * @param string $str multi-byte text to wrap encode * @param string $linebreak string to use as linefeed/end-of-line @@ -3690,7 +3686,7 @@ public function encodeQP($string) /** * Encode a string using Q encoding. * - * @see http://tools.ietf.org/html/rfc2047#section-4.2 + * @see https://www.rfc-editor.org/rfc/rfc2047#section-4.2 * * @param string $str the text to encode * @param string $position Where the text is going to be used, see the RFC for what that means @@ -4228,7 +4224,7 @@ protected function serverHostname() $result = $_SERVER['SERVER_NAME']; } elseif (function_exists('gethostname') && gethostname() !== false) { $result = gethostname(); - } elseif (php_uname('n') !== false) { + } elseif (php_uname('n') !== '') { $result = php_uname('n'); } if (!static::isValidHost($result)) { @@ -4253,7 +4249,7 @@ public static function isValidHost($host) empty($host) || !is_string($host) || strlen($host) > 256 - || !preg_match('/^([a-zA-Z\d.-]*|\[[a-fA-F\d:]+\])$/', $host) + || !preg_match('/^([a-z\d.-]*|\[[a-f\d:]+\])$/i', $host) ) { return false; } @@ -4267,8 +4263,8 @@ public static function isValidHost($host) //Is it a valid IPv4 address? return filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false; } - //Is it a syntactically valid hostname (when embeded in a URL)? - return filter_var('http://' . $host, FILTER_VALIDATE_URL) !== false; + //Is it a syntactically valid hostname (when embedded in a URL)? + return filter_var('https://' . $host, FILTER_VALIDATE_URL) !== false; } /** @@ -4679,7 +4675,7 @@ public static function filenameToType($filename) * Multi-byte-safe pathinfo replacement. * Drop-in replacement for pathinfo(), but multibyte- and cross-platform-safe. * - * @see http://www.php.net/manual/en/function.pathinfo.php#107461 + * @see https://www.php.net/manual/en/function.pathinfo.php#107461 * * @param string $path A filename or path, does not need to exist as a file * @param int|string $options Either a PATHINFO_* constant, diff --git a/vendor/phpmailer/phpmailer/src/POP3.php b/vendor/phpmailer/phpmailer/src/POP3.php index 7b25fdd7e8..697c96126f 100644 --- a/vendor/phpmailer/phpmailer/src/POP3.php +++ b/vendor/phpmailer/phpmailer/src/POP3.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -46,7 +46,7 @@ class POP3 * * @var string */ - const VERSION = '6.9.1'; + const VERSION = '6.9.2'; /** * Default POP3 port number. @@ -250,7 +250,9 @@ public function connect($host, $port = false, $tval = 30) //On Windows this will raise a PHP Warning error if the hostname doesn't exist. //Rather than suppress it with @fsockopen, capture it cleanly instead - set_error_handler([$this, 'catchWarning']); + set_error_handler(function () { + call_user_func_array([$this, 'catchWarning'], func_get_args()); + }); if (false === $port) { $port = static::DEFAULT_PORT; diff --git a/vendor/phpmailer/phpmailer/src/SMTP.php b/vendor/phpmailer/phpmailer/src/SMTP.php index 1b5b00771c..5b238b5279 100644 --- a/vendor/phpmailer/phpmailer/src/SMTP.php +++ b/vendor/phpmailer/phpmailer/src/SMTP.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -35,7 +35,7 @@ class SMTP * * @var string */ - const VERSION = '6.9.1'; + const VERSION = '6.9.2'; /** * SMTP line break constant. @@ -152,8 +152,8 @@ class SMTP /** * Whether to use VERP. * - * @see http://en.wikipedia.org/wiki/Variable_envelope_return_path - * @see http://www.postfix.org/VERP_README.html Info on VERP + * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path + * @see https://www.postfix.org/VERP_README.html Info on VERP * * @var bool */ @@ -164,7 +164,7 @@ class SMTP * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure. * - * @see http://tools.ietf.org/html/rfc2821#section-4.5.3.2 + * @see https://www.rfc-editor.org/rfc/rfc2821#section-4.5.3.2 * * @var int */ @@ -187,12 +187,12 @@ class SMTP */ protected $smtp_transaction_id_patterns = [ 'exim' => '/[\d]{3} OK id=(.*)/', - 'sendmail' => '/[\d]{3} 2.0.0 (.*) Message/', - 'postfix' => '/[\d]{3} 2.0.0 Ok: queued as (.*)/', - 'Microsoft_ESMTP' => '/[0-9]{3} 2.[\d].0 (.*)@(?:.*) Queued mail for delivery/', + 'sendmail' => '/[\d]{3} 2\.0\.0 (.*) Message/', + 'postfix' => '/[\d]{3} 2\.0\.0 Ok: queued as (.*)/', + 'Microsoft_ESMTP' => '/[0-9]{3} 2\.[\d]\.0 (.*)@(?:.*) Queued mail for delivery/', 'Amazon_SES' => '/[\d]{3} Ok (.*)/', 'SendGrid' => '/[\d]{3} Ok: queued as (.*)/', - 'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/', + 'CampaignMonitor' => '/[\d]{3} 2\.0\.0 OK:([a-zA-Z\d]{48})/', 'Haraka' => '/[\d]{3} Message Queued \((.*)\)/', 'ZoneMTA' => '/[\d]{3} Message queued as (.*)/', 'Mailjet' => '/[\d]{3} OK queued as (.*)/', @@ -280,7 +280,8 @@ protected function edebug($str, $level = 0) } //Is this a PSR-3 logger? if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) { - $this->Debugoutput->debug($str); + //Remove trailing line breaks potentially added by calls to SMTP::client_send() + $this->Debugoutput->debug(rtrim($str, "\r\n")); return; } @@ -293,6 +294,7 @@ protected function edebug($str, $level = 0) switch ($this->Debugoutput) { case 'error_log': //Don't output, just log + /** @noinspection ForgottenDebugOutputInspection */ error_log($str); break; case 'html': @@ -404,7 +406,9 @@ protected function getSMTPConnection($host, $port = null, $timeout = 30, $option $errstr = ''; if ($streamok) { $socket_context = stream_context_create($options); - set_error_handler([$this, 'errorHandler']); + set_error_handler(function () { + call_user_func_array([$this, 'errorHandler'], func_get_args()); + }); $connection = stream_socket_client( $host . ':' . $port, $errno, @@ -419,7 +423,9 @@ protected function getSMTPConnection($host, $port = null, $timeout = 30, $option 'Connection: stream_socket_client not available, falling back to fsockopen', self::DEBUG_CONNECTION ); - set_error_handler([$this, 'errorHandler']); + set_error_handler(function () { + call_user_func_array([$this, 'errorHandler'], func_get_args()); + }); $connection = fsockopen( $host, $port, @@ -483,7 +489,9 @@ public function startTLS() } //Begin encrypted connection - set_error_handler([$this, 'errorHandler']); + set_error_handler(function () { + call_user_func_array([$this, 'errorHandler'], func_get_args()); + }); $crypto_ok = stream_socket_enable_crypto( $this->smtp_conn, true, @@ -648,7 +656,7 @@ protected function hmac($data, $key) } //The following borrowed from - //http://php.net/manual/en/function.mhash.php#27225 + //https://www.php.net/manual/en/function.mhash.php#27225 //RFC 2104 HMAC implementation for php. //Creates an md5 HMAC. @@ -1162,7 +1170,9 @@ public function client_send($data, $command = '') } else { $this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT); } - set_error_handler([$this, 'errorHandler']); + set_error_handler(function () { + call_user_func_array([$this, 'errorHandler'], func_get_args()); + }); $result = fwrite($this->smtp_conn, $data); restore_error_handler(); @@ -1265,7 +1275,9 @@ protected function get_lines() while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) { //Must pass vars in here as params are by reference //solution for signals inspired by https://github.com/symfony/symfony/pull/6540 - set_error_handler([$this, 'errorHandler']); + set_error_handler(function () { + call_user_func_array([$this, 'errorHandler'], func_get_args()); + }); $n = stream_select($selR, $selW, $selW, $this->Timelimit); restore_error_handler(); diff --git a/vendor/symfony/polyfill-intl-idn/Idn.php b/vendor/symfony/polyfill-intl-idn/Idn.php index eb6bada0aa..334f8ee70b 100644 --- a/vendor/symfony/polyfill-intl-idn/Idn.php +++ b/vendor/symfony/polyfill-intl-idn/Idn.php @@ -145,7 +145,7 @@ final class Idn */ public static function idn_to_ascii($domainName, $options = self::IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = []) { - if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) { + if (self::INTL_IDNA_VARIANT_2003 === $variant) { @trigger_error('idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated', \E_USER_DEPRECATED); } @@ -198,7 +198,7 @@ public static function idn_to_ascii($domainName, $options = self::IDNA_DEFAULT, */ public static function idn_to_utf8($domainName, $options = self::IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = []) { - if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) { + if (self::INTL_IDNA_VARIANT_2003 === $variant) { @trigger_error('idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated', \E_USER_DEPRECATED); } diff --git a/vendor/symfony/polyfill-intl-idn/composer.json b/vendor/symfony/polyfill-intl-idn/composer.json index 12f75bcebe..760debcd2f 100644 --- a/vendor/symfony/polyfill-intl-idn/composer.json +++ b/vendor/symfony/polyfill-intl-idn/composer.json @@ -20,9 +20,8 @@ } ], "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Intl\\Idn\\": "" }, diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php index 1ad33a86b7..3d45c9d9af 100644 --- a/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -50,6 +50,9 @@ * - mb_substr_count - Count the number of substring occurrences * - mb_ucfirst - Make a string's first character uppercase * - mb_lcfirst - Make a string's first character lowercase + * - mb_trim - Strip whitespace (or other characters) from the beginning and end of a string + * - mb_ltrim - Strip whitespace (or other characters) from the beginning of a string + * - mb_rtrim - Strip whitespace (or other characters) from the end of a string * * Not implemented: * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) @@ -83,12 +86,6 @@ final class Mbstring public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { if (\is_array($s)) { - if (PHP_VERSION_ID < 70200) { - trigger_error('mb_convert_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING); - - return null; - } - $r = []; foreach ($s as $str) { $r[] = self::mb_convert_encoding($str, $toEncoding, $fromEncoding); @@ -427,12 +424,6 @@ public static function mb_encoding_aliases($encoding) public static function mb_check_encoding($var = null, $encoding = null) { - if (\PHP_VERSION_ID < 70200 && \is_array($var)) { - trigger_error('mb_check_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING); - - return null; - } - if (null === $encoding) { if (null === $var) { return false; @@ -980,17 +971,75 @@ private static function getEncoding($encoding) return $encoding; } + public static function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{^[%s]+|[%1$s]+$}Du', $string, $characters, $encoding, __FUNCTION__); + } + + public static function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{^[%s]+}Du', $string, $characters, $encoding, __FUNCTION__); + } + + public static function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{[%s]+$}D', $string, $characters, $encoding, __FUNCTION__); + } + + private static function mb_internal_trim(string $regex, string $string, ?string $characters, ?string $encoding, string $function): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, $function.'(): Argument #3 ($encoding) must be a valid encoding, "%s" given'); + } + + if ('' === $characters) { + return null === $encoding ? $string : self::mb_convert_encoding($string, $encoding); + } + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $string)) { + $string = @iconv('UTF-8', 'UTF-8//IGNORE', $string); + } + if (null !== $characters && !preg_match('//u', $characters)) { + $characters = @iconv('UTF-8', 'UTF-8//IGNORE', $characters); + } + } else { + $string = iconv($encoding, 'UTF-8//IGNORE', $string); + + if (null !== $characters) { + $characters = iconv($encoding, 'UTF-8//IGNORE', $characters); + } + } + + if (null === $characters) { + $characters = "\\0 \f\n\r\t\v\u{00A0}\u{1680}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200A}\u{2028}\u{2029}\u{202F}\u{205F}\u{3000}\u{0085}\u{180E}"; + } else { + $characters = preg_quote($characters); + } + + $string = preg_replace(sprintf($regex, $characters), '', $string); + + if (null === $encoding) { + return $string; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $string); + } + private static function assertEncoding(string $encoding, string $errorFormat): void { try { $validEncoding = @self::mb_check_encoding('', $encoding); } catch (\ValueError $e) { - throw new \ValueError(\sprintf($errorFormat, $encoding)); + throw new \ValueError(sprintf($errorFormat, $encoding)); } // BC for PHP 7.3 and lower if (!$validEncoding) { - throw new \ValueError(\sprintf($errorFormat, $encoding)); + throw new \ValueError(sprintf($errorFormat, $encoding)); } } } diff --git a/vendor/symfony/polyfill-mbstring/bootstrap.php b/vendor/symfony/polyfill-mbstring/bootstrap.php index 6e4b5fce84..ff51ae0796 100644 --- a/vendor/symfony/polyfill-mbstring/bootstrap.php +++ b/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -144,6 +144,19 @@ function mb_ucfirst(string $string, ?string $encoding = null): string { return p function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } } +if (!function_exists('mb_trim')) { + function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); } +} + +if (!function_exists('mb_ltrim')) { + function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); } +} + +if (!function_exists('mb_rtrim')) { + function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); } +} + + if (extension_loaded('mbstring')) { return; } diff --git a/vendor/symfony/polyfill-mbstring/bootstrap80.php b/vendor/symfony/polyfill-mbstring/bootstrap80.php index ec2ae42765..5be7d2018f 100644 --- a/vendor/symfony/polyfill-mbstring/bootstrap80.php +++ b/vendor/symfony/polyfill-mbstring/bootstrap80.php @@ -93,7 +93,7 @@ function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?strin function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } } if (!function_exists('mb_get_info')) { - function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); } + function mb_get_info(?string $type = 'all'): array|string|int|false|null { return p\Mbstring::mb_get_info((string) $type); } } if (!function_exists('mb_http_output')) { function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } @@ -140,6 +140,18 @@ function mb_ucfirst($string, ?string $encoding = null): string { return p\Mbstri function mb_lcfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } } +if (!function_exists('mb_trim')) { + function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); } +} + +if (!function_exists('mb_ltrim')) { + function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); } +} + +if (!function_exists('mb_rtrim')) { + function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); } +} + if (extension_loaded('mbstring')) { return; } diff --git a/vendor/symfony/polyfill-mbstring/composer.json b/vendor/symfony/polyfill-mbstring/composer.json index bd99d4b9d9..4ed241a33b 100644 --- a/vendor/symfony/polyfill-mbstring/composer.json +++ b/vendor/symfony/polyfill-mbstring/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" diff --git a/vendor/symfony/yaml/Inline.php b/vendor/symfony/yaml/Inline.php index 14f95d6244..e1553f9d24 100644 --- a/vendor/symfony/yaml/Inline.php +++ b/vendor/symfony/yaml/Inline.php @@ -353,11 +353,18 @@ private static function parseSequence(string $sequence, int $flags, int &$i = 0, ++$i; // [foo, bar, ...] + $lastToken = null; while ($i < $len) { if (']' === $sequence[$i]) { return $output; } if (',' === $sequence[$i] || ' ' === $sequence[$i]) { + if (',' === $sequence[$i] && (null === $lastToken || 'separator' === $lastToken)) { + $output[] = null; + } elseif (',' === $sequence[$i]) { + $lastToken = 'separator'; + } + ++$i; continue; @@ -401,6 +408,7 @@ private static function parseSequence(string $sequence, int $flags, int &$i = 0, $output[] = $value; + $lastToken = 'value'; ++$i; } From 1995ec2d89313119c6edf7c6c5c82d9a789f7b36 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 13 Nov 2024 14:01:25 +0100 Subject: [PATCH 219/362] Add the latest version of a translation automatically --- src/Content/Version.php | 14 +++++++++++++ tests/Content/VersionTest.php | 38 +++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/src/Content/Version.php b/src/Content/Version.php index 93228f09ff..ac622c64c0 100644 --- a/src/Content/Version.php +++ b/src/Content/Version.php @@ -95,6 +95,20 @@ public function create( Language|string $language = 'default' ): void { $language = Language::ensure($language); + $latest = $this->model->version(VersionId::latest()); + + // if the latest version of the translation does not exist yet, + // we have to copy over the content from the default language first. + if ( + $this->isLatest() === false && + $language->isDefault() === false && + $latest->exists($language) === false + ) { + $latest->create( + fields: $latest->read(Language::ensure('default')), + language: $language + ); + } // check if creating is allowed VersionRules::create($this, $fields, $language); diff --git a/tests/Content/VersionTest.php b/tests/Content/VersionTest.php index f59d12b50d..001a112819 100644 --- a/tests/Content/VersionTest.php +++ b/tests/Content/VersionTest.php @@ -188,6 +188,44 @@ public function testCreateMultiLanguage(): void $this->assertContentFileExists('de'); } + /** + * @covers ::create + */ + public function testCreateMultiLanguageWhenLatestTranslationIsMissing(): void + { + $this->setUpMultiLanguage(); + + $latest = new Version( + model: $this->model, + id: VersionId::latest() + ); + + $changes = new Version( + model: $this->model, + id: VersionId::changes() + ); + + $this->assertContentFileDoesNotExist('en', $latest->id()); + $this->assertContentFileDoesNotExist('en', $changes->id()); + $this->assertContentFileDoesNotExist('de', $latest->id()); + $this->assertContentFileDoesNotExist('de', $changes->id()); + + // create the latest version for the default translation + $latest->save([ + 'title' => 'Test' + ], $this->app->language('en')); + + // create a changes version in the other language + $changes->save([ + 'title' => 'Translated Test', + ], $this->app->language('de')); + + $this->assertContentFileExists('en', $latest->id()); + $this->assertContentFileDoesNotExist('en', $changes->id()); + $this->assertContentFileExists('de', $latest->id()); + $this->assertContentFileExists('de', $changes->id()); + } + /** * @covers ::create */ From a448c4be76b5be3a8d17916f44a952a7097d0a52 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 13 Nov 2024 15:27:15 +0100 Subject: [PATCH 220/362] Move lock wildcard into the Lock::for method --- src/Cms/ModelWithContent.php | 2 +- src/Content/Lock.php | 17 +++++++++++++++++ src/Content/Version.php | 11 ----------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/Cms/ModelWithContent.php b/src/Cms/ModelWithContent.php index 102c5f9399..21b89815ad 100644 --- a/src/Cms/ModelWithContent.php +++ b/src/Cms/ModelWithContent.php @@ -335,7 +335,7 @@ public function kirby(): App */ public function lock(): Lock { - return $this->version(VersionId::changes())->lock(); + return $this->version(VersionId::changes())->lock('*'); } /** diff --git a/src/Content/Lock.php b/src/Content/Lock.php index b420e49b5e..1eadec7244 100644 --- a/src/Content/Lock.php +++ b/src/Content/Lock.php @@ -4,6 +4,7 @@ use Kirby\Cms\App; use Kirby\Cms\Language; +use Kirby\Cms\Languages; use Kirby\Cms\User; use Kirby\Toolkit\Str; @@ -38,6 +39,22 @@ public static function for( Version $version, Language|string $language = 'default' ): static { + // wildcard to search for a lock in any language + // the first locked one will be preferred + if ($language === '*') { + foreach (Languages::ensure() as $language) { + $lock = static::for($version, $language); + + // return the first locked lock if any exists + if ($lock->isLocked() === true) { + return $lock; + } + } + + // return the last lock if no lock was found + return $lock; + } + $language = Language::ensure($language); // if the version does not exist, it cannot be locked diff --git a/src/Content/Version.php b/src/Content/Version.php index ac622c64c0..0513681fc8 100644 --- a/src/Content/Version.php +++ b/src/Content/Version.php @@ -233,17 +233,6 @@ public function isLatest(): bool */ public function isLocked(Language|string $language = 'default'): bool { - // check if the version is locked in any language - if ($language === '*') { - foreach (Languages::ensure() as $language) { - if ($this->isLocked($language) === true) { - return true; - } - } - - return false; - } - return $this->lock($language)->isLocked(); } From 16db1a90d0e368df43c6d6f341d4d19ed3f17b8b Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Wed, 13 Nov 2024 17:32:19 +0100 Subject: [PATCH 221/362] Add unit test --- tests/Content/LockTest.php | 49 +++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/tests/Content/LockTest.php b/tests/Content/LockTest.php index 1914b64de5..0055d3cbd1 100644 --- a/tests/Content/LockTest.php +++ b/tests/Content/LockTest.php @@ -3,6 +3,7 @@ namespace Kirby\Content; use Kirby\Cms\App; +use Kirby\Cms\Language; use Kirby\Cms\User; /** @@ -13,8 +14,9 @@ class LockTest extends TestCase { public const TMP = KIRBY_TMP_DIR . '/Content.LockTest'; - protected function createChangesVersion(): Version - { + protected function createChangesVersion( + Language|string $language = 'default' + ): Version { $version = new Version( model: $this->app->page('test'), id: VersionId::changes() @@ -22,13 +24,14 @@ protected function createChangesVersion(): Version $version->create([ 'title' => 'Test' - ]); + ], $language); return $version; } - protected function createLatestVersion(): Version - { + protected function createLatestVersion( + Language|string $language = 'default' + ): Version { $latest = new Version( model: $this->app->page('test'), id: VersionId::latest() @@ -36,7 +39,7 @@ protected function createLatestVersion(): Version $latest->create([ 'title' => 'Test' - ]); + ], $language); return $latest; } @@ -118,6 +121,40 @@ public function testForWithoutUser() $this->assertNull($lock->user()); } + /** + * @covers ::for + */ + public function testForWithLanguageWildcard() + { + $this->app = $this->app->clone([ + 'languages' => [ + [ + 'code' => 'en', + 'default' => true + ], + [ + 'code' => 'de' + ] + ] + ]); + + // create the version with the admin user + $this->app->impersonate('admin'); + + $this->createLatestVersion('en'); + $this->createLatestVersion('de'); + + $this->createChangesVersion('de'); + + // switch to a different user to simulate locked content + $this->app->impersonate('editor'); + + $changes = $this->app->page('test')->version('changes'); + $lock = Lock::for($changes, '*'); + + $this->assertSame('admin', $lock->user()->id()); + } + /** * @covers ::isActive */ From 695a4ab4605a895f0e3ce1ced08d8accac90cdde Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Wed, 13 Nov 2024 21:25:42 +0100 Subject: [PATCH 222/362] Fix `Lock::for()` --- src/Content/Lock.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Content/Lock.php b/src/Content/Lock.php index 1eadec7244..c0de6d74fa 100644 --- a/src/Content/Lock.php +++ b/src/Content/Lock.php @@ -72,7 +72,7 @@ public static function for( return new static( user: $user ?? null, - modified: $version->modified() + modified: $version->modified($language) ); } From 8d27f554440738484fdc689291d63520710be30b Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 14 Nov 2024 13:02:46 +0100 Subject: [PATCH 223/362] Compare form values in Version::isIdentical --- src/Content/Version.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Content/Version.php b/src/Content/Version.php index 0513681fc8..c91d04cb4d 100644 --- a/src/Content/Version.php +++ b/src/Content/Version.php @@ -8,6 +8,7 @@ use Kirby\Cms\ModelWithContent; use Kirby\Cms\Page; use Kirby\Exception\NotFoundException; +use Kirby\Form\Form; /** * The Version class handles all actions for a single @@ -217,6 +218,27 @@ public function isIdentical( ksort($a); ksort($b); + if ($a === $b) { + return true; + } + + $a = Form::for( + model: $this->model, + props: [ + 'values' => $a + ] + )->values(); + + $b = Form::for( + model: $this->model, + props: [ + 'values' => $b + ] + )->values(); + + ksort($a); + ksort($b); + return $a === $b; } From 95654dc73f2b6474fdbfdf36385e063b87aa2444 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 14 Nov 2024 13:13:42 +0100 Subject: [PATCH 224/362] Make sure to pass the language correctly in all places --- src/Api/Controller/Changes.php | 4 +++- src/Content/Version.php | 15 ++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/Api/Controller/Changes.php b/src/Api/Controller/Changes.php index 19ae55dc91..7ebe9cdf68 100644 --- a/src/Api/Controller/Changes.php +++ b/src/Api/Controller/Changes.php @@ -88,7 +88,9 @@ public static function save(ModelWithContent $model, array $input): array ); if ($changes->isIdentical(version: $latest, language: 'current')) { - $changes->delete(); + $changes->delete( + language: 'current' + ); } return [ diff --git a/src/Content/Version.php b/src/Content/Version.php index c91d04cb4d..e4d9c14197 100644 --- a/src/Content/Version.php +++ b/src/Content/Version.php @@ -192,7 +192,6 @@ public function isIdentical( $version = $this->model->version($version); } - if ($version->id()->is($this->id) === true) { return true; } @@ -214,25 +213,19 @@ public function isIdentical( $b['uuid'] ); - // ensure both arrays of fields are sorted the same - ksort($a); - ksort($b); - - if ($a === $b) { - return true; - } - $a = Form::for( model: $this->model, props: [ - 'values' => $a + 'language' => $language->code(), + 'values' => $a, ] )->values(); $b = Form::for( model: $this->model, props: [ - 'values' => $b + 'language' => $language->code(), + 'values' => $b ] )->values(); From 003ec3c9a7821d0ed29cc82a8942b5fab9f53953 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 14 Nov 2024 13:38:35 +0100 Subject: [PATCH 225/362] =?UTF-8?q?Don=E2=80=99t=20send=20API=20requests?= =?UTF-8?q?=20if=20there=E2=80=99s=20no=20api=20definition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- panel/src/panel/content.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/panel/src/panel/content.js b/panel/src/panel/content.js index df943ae661..6aea38469b 100644 --- a/panel/src/panel/content.js +++ b/panel/src/panel/content.js @@ -38,6 +38,11 @@ export default (panel) => { * Removes all unpublished changes */ async discard() { + // avoid requests if there is no API defined + if (!this.api) { + return; + } + if (this.isProcessing === true) { return; } @@ -86,6 +91,11 @@ export default (panel) => { * Publishes any changes */ async publish() { + // avoid requests if there is no API defined + if (!this.api) { + return; + } + if (this.isProcessing === true) { return; } @@ -112,6 +122,11 @@ export default (panel) => { * Saves any changes */ async save() { + // avoid requests if there is no API defined + if (!this.api) { + return; + } + this.isProcessing = true; // ensure to abort unfinished previous save request From cbcb705b01470f566bb87adc6b4ad44523240c30 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 14 Nov 2024 19:12:02 +0100 Subject: [PATCH 226/362] Revert `content.api` checks --- panel/src/panel/content.js | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/panel/src/panel/content.js b/panel/src/panel/content.js index 6aea38469b..df943ae661 100644 --- a/panel/src/panel/content.js +++ b/panel/src/panel/content.js @@ -38,11 +38,6 @@ export default (panel) => { * Removes all unpublished changes */ async discard() { - // avoid requests if there is no API defined - if (!this.api) { - return; - } - if (this.isProcessing === true) { return; } @@ -91,11 +86,6 @@ export default (panel) => { * Publishes any changes */ async publish() { - // avoid requests if there is no API defined - if (!this.api) { - return; - } - if (this.isProcessing === true) { return; } @@ -122,11 +112,6 @@ export default (panel) => { * Saves any changes */ async save() { - // avoid requests if there is no API defined - if (!this.api) { - return; - } - this.isProcessing = true; // ensure to abort unfinished previous save request From c102b12b79b8a67232968af093b92aabd9d8ed2e Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Sat, 19 Oct 2024 15:53:09 +0200 Subject: [PATCH 227/362] Fixed k-progress css --- panel/src/components/Misc/Progress.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/panel/src/components/Misc/Progress.vue b/panel/src/components/Misc/Progress.vue index 6212368ca0..d881a71801 100644 --- a/panel/src/components/Misc/Progress.vue +++ b/panel/src/components/Misc/Progress.vue @@ -36,6 +36,7 @@ progress { height: var(--progress-height); border-radius: var(--progress-height); overflow: hidden; + background: var(--progress-color-back); border: 0; } @@ -51,6 +52,7 @@ progress::-webkit-progress-value { progress::-moz-progress-bar { background: var(--progress-color-value); + border-radius: var(--progress-height); } /** Indeterminate **/ From ff6ba840cab3cb34ffffe3b4a24c943a6077a5a6 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Sat, 19 Oct 2024 15:54:39 +0200 Subject: [PATCH 228/362] Language dropdown prototype in lab --- .../dropdowns/5_languages/index.vue | 181 ++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 panel/lab/components/dropdowns/5_languages/index.vue diff --git a/panel/lab/components/dropdowns/5_languages/index.vue b/panel/lab/components/dropdowns/5_languages/index.vue new file mode 100644 index 0000000000..cb1479e881 --- /dev/null +++ b/panel/lab/components/dropdowns/5_languages/index.vue @@ -0,0 +1,181 @@ + + + + + From 4900e5cfdee978d25466e137b5d8f48e7dd1d5f3 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Sat, 9 Nov 2024 20:49:43 +0100 Subject: [PATCH 229/362] Integrate first parts into `k-languages-dropdown` --- .../components/Dropdowns/DropdownContent.vue | 2 +- .../View/Buttons/LanguagesDropdown.vue | 80 ++++++++++++++++++- src/Panel/Ui/Buttons/LanguagesDropdown.php | 5 +- 3 files changed, 84 insertions(+), 3 deletions(-) diff --git a/panel/src/components/Dropdowns/DropdownContent.vue b/panel/src/components/Dropdowns/DropdownContent.vue index 40916f082f..407dc47a7a 100644 --- a/panel/src/components/Dropdowns/DropdownContent.vue +++ b/panel/src/components/Dropdowns/DropdownContent.vue @@ -15,7 +15,7 @@ > - + + + diff --git a/src/Panel/Ui/Buttons/LanguagesDropdown.php b/src/Panel/Ui/Buttons/LanguagesDropdown.php index 606ceb3015..c8d12fe8df 100644 --- a/src/Panel/Ui/Buttons/LanguagesDropdown.php +++ b/src/Panel/Ui/Buttons/LanguagesDropdown.php @@ -64,8 +64,11 @@ public function option(Language $language): array return [ 'text' => $language->name(), 'code' => $language->code(), + 'link' => $this->model->panel()->url(true) . '?language=' . $language->code(), 'current' => $language->code() === $this->kirby->language()?->code(), - 'link' => $this->model->panel()->url(true) . '?language=' . $language->code() + 'default' => $language->isDefault(), + 'changes' => $this->model->version('changes')->exists($language), + 'lock' => $this->model->version('changes')->isLocked($language) ]; } From 6f048ecca8703713ea0729d78d5a037e94d7a289 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Wed, 13 Nov 2024 22:01:30 +0100 Subject: [PATCH 230/362] Languages dropdown: use i18n strings --- panel/src/components/View/Buttons/LanguagesDropdown.vue | 8 +++++--- src/Panel/Ui/Buttons/LanguagesDropdown.php | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/panel/src/components/View/Buttons/LanguagesDropdown.vue b/panel/src/components/View/Buttons/LanguagesDropdown.vue index 8725002982..39e99bee38 100644 --- a/panel/src/components/View/Buttons/LanguagesDropdown.vue +++ b/panel/src/components/View/Buttons/LanguagesDropdown.vue @@ -25,21 +25,23 @@ {{ language.text }} ({{ language.code }})

        - Primary language + + {{ $t("language.default") }} + - In editing + {{ $t("lock.unsaved") }} - Has changes + {{ $t("lock.unsaved") }}
        diff --git a/src/Panel/Ui/Buttons/LanguagesDropdown.php b/src/Panel/Ui/Buttons/LanguagesDropdown.php index c8d12fe8df..8b5341e5ea 100644 --- a/src/Panel/Ui/Buttons/LanguagesDropdown.php +++ b/src/Panel/Ui/Buttons/LanguagesDropdown.php @@ -61,14 +61,16 @@ public function hasChanges(): bool public function option(Language $language): array { + $changes = $this->model->version('changes'); + return [ 'text' => $language->name(), 'code' => $language->code(), 'link' => $this->model->panel()->url(true) . '?language=' . $language->code(), 'current' => $language->code() === $this->kirby->language()?->code(), 'default' => $language->isDefault(), - 'changes' => $this->model->version('changes')->exists($language), - 'lock' => $this->model->version('changes')->isLocked($language) + 'changes' => $changes->exists($language), + 'lock' => $changes->isLocked() ]; } From 4958308d6bb8a278b6139a206652ea7f1b362318 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Wed, 13 Nov 2024 22:06:34 +0100 Subject: [PATCH 231/362] Fix languages dropdown unit tests --- tests/Panel/Ui/Buttons/LanguagesDropdownTest.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/Panel/Ui/Buttons/LanguagesDropdownTest.php b/tests/Panel/Ui/Buttons/LanguagesDropdownTest.php index 1729d9a15a..5ebcc2a3fe 100644 --- a/tests/Panel/Ui/Buttons/LanguagesDropdownTest.php +++ b/tests/Panel/Ui/Buttons/LanguagesDropdownTest.php @@ -48,8 +48,11 @@ public function testOption() $this->assertSame([ 'text' => 'Deutsch', 'code' => 'de', + 'link' => '/pages/test?language=de', 'current' => false, - 'link' => '/pages/test?language=de' + 'default' => false, + 'changes' => false, + 'lock' => false ], $button->option($language)); } @@ -78,15 +81,21 @@ public function testOptionsMultiLang() [ 'text' => 'English', 'code' => 'en', + 'link' => '/pages/test?language=en', 'current' => true, - 'link' => '/pages/test?language=en' + 'default' => true, + 'changes' => false, + 'lock' => false ], '-', [ 'text' => 'Deutsch', 'code' => 'de', + 'link' => '/pages/test?language=de', 'current' => false, - 'link' => '/pages/test?language=de' + 'default' => false, + 'changes' => false, + 'lock' => false ] ], $button->options()); } From 3bc7e871972cd1e53cf4510b7d4f1f9564d74c29 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 14 Nov 2024 07:44:41 +0100 Subject: [PATCH 232/362] Dropdown content `item` slot --- .../components/Dropdowns/DropdownContent.vue | 17 ++++-- .../View/Buttons/LanguagesDropdown.vue | 57 ++++++++----------- 2 files changed, 35 insertions(+), 39 deletions(-) diff --git a/panel/src/components/Dropdowns/DropdownContent.vue b/panel/src/components/Dropdowns/DropdownContent.vue index 407dc47a7a..229ffcb5af 100644 --- a/panel/src/components/Dropdowns/DropdownContent.vue +++ b/panel/src/components/Dropdowns/DropdownContent.vue @@ -18,14 +18,19 @@ diff --git a/panel/src/components/View/Buttons/LanguagesDropdown.vue b/panel/src/components/View/Buttons/LanguagesDropdown.vue index 39e99bee38..431bfb42c2 100644 --- a/panel/src/components/View/Buttons/LanguagesDropdown.vue +++ b/panel/src/components/View/Buttons/LanguagesDropdown.vue @@ -12,41 +12,32 @@ align-x="end" @action="$emit('action', $event)" > - @@ -66,7 +63,7 @@ export default { changesBadge() { if (this.hasChanges || this.$panel.content.hasChanges) { return { - theme: "notice" + theme: this.$panel.content.lock.isLocked ? "red" : "orange" }; } @@ -77,31 +74,35 @@ export default { diff --git a/panel/src/panel/content.js b/panel/src/panel/content.js index df943ae661..82d9c4f76c 100644 --- a/panel/src/panel/content.js +++ b/panel/src/panel/content.js @@ -73,6 +73,13 @@ export default (panel) => { */ isSaved: true, + /** + * Get the lock info for the model view + */ + get lock() { + return panel.view.props.lock; + }, + /** * The last published state * diff --git a/src/Panel/Ui/Buttons/LanguagesDropdown.php b/src/Panel/Ui/Buttons/LanguagesDropdown.php index 8b5341e5ea..f8d02a9dd4 100644 --- a/src/Panel/Ui/Buttons/LanguagesDropdown.php +++ b/src/Panel/Ui/Buttons/LanguagesDropdown.php @@ -70,7 +70,7 @@ public function option(Language $language): array 'current' => $language->code() === $this->kirby->language()?->code(), 'default' => $language->isDefault(), 'changes' => $changes->exists($language), - 'lock' => $changes->isLocked() + 'lock' => $changes->isLocked('*') ]; } From 873c02e4083eb4e1a50333844f3426310b3f59fb Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 14 Nov 2024 16:46:07 +0100 Subject: [PATCH 234/362] Consider the lock status of any translation --- src/Panel/Ui/Buttons/LanguagesDropdown.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Panel/Ui/Buttons/LanguagesDropdown.php b/src/Panel/Ui/Buttons/LanguagesDropdown.php index f8d02a9dd4..5fdfe299c8 100644 --- a/src/Panel/Ui/Buttons/LanguagesDropdown.php +++ b/src/Panel/Ui/Buttons/LanguagesDropdown.php @@ -42,17 +42,13 @@ class: 'k-languages-dropdown', } /** - * Returns if any translation other than the current one has unsaved changes - * (the current will be considered dynamically in `` - * based on its state) + * Returns if any translation has unsaved changes */ public function hasChanges(): bool { foreach (Languages::ensure() as $language) { - if ($this->kirby->language()?->code() !== $language->code()) { - if ($this->model->version(VersionId::changes())->exists($language) === true) { - return true; - } + if ($this->model->version(VersionId::changes())->exists($language) === true) { + return true; } } From e95b22fedc9b56a221e712272a028aa6d4d87375 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 14 Nov 2024 16:51:27 +0100 Subject: [PATCH 235/362] Remove old Lab example --- .../dropdowns/5_languages/index.vue | 181 ------------------ 1 file changed, 181 deletions(-) delete mode 100644 panel/lab/components/dropdowns/5_languages/index.vue diff --git a/panel/lab/components/dropdowns/5_languages/index.vue b/panel/lab/components/dropdowns/5_languages/index.vue deleted file mode 100644 index cb1479e881..0000000000 --- a/panel/lab/components/dropdowns/5_languages/index.vue +++ /dev/null @@ -1,181 +0,0 @@ - - - - - From 1d2cbe64ba161c87c5d638551d3fd2750cc66a8a Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 14 Nov 2024 19:22:18 +0100 Subject: [PATCH 236/362] Revert "Consider the lock status of any translation" This reverts commit 873c02e4083eb4e1a50333844f3426310b3f59fb. --- src/Panel/Ui/Buttons/LanguagesDropdown.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Panel/Ui/Buttons/LanguagesDropdown.php b/src/Panel/Ui/Buttons/LanguagesDropdown.php index 5fdfe299c8..f8d02a9dd4 100644 --- a/src/Panel/Ui/Buttons/LanguagesDropdown.php +++ b/src/Panel/Ui/Buttons/LanguagesDropdown.php @@ -42,13 +42,17 @@ class: 'k-languages-dropdown', } /** - * Returns if any translation has unsaved changes + * Returns if any translation other than the current one has unsaved changes + * (the current will be considered dynamically in `` + * based on its state) */ public function hasChanges(): bool { foreach (Languages::ensure() as $language) { - if ($this->model->version(VersionId::changes())->exists($language) === true) { - return true; + if ($this->kirby->language()?->code() !== $language->code()) { + if ($this->model->version(VersionId::changes())->exists($language) === true) { + return true; + } } } From 65716d4dd87f99c82bedaed42bf1da192f478476 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 14 Nov 2024 19:27:47 +0100 Subject: [PATCH 237/362] Improve docblock `LanguagesDropdown::hasChanges` --- panel/src/components/View/Buttons/LanguagesDropdown.vue | 4 ++++ src/Panel/Ui/Buttons/LanguagesDropdown.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/panel/src/components/View/Buttons/LanguagesDropdown.vue b/panel/src/components/View/Buttons/LanguagesDropdown.vue index 418b71bb97..bb6cd3b4bb 100644 --- a/panel/src/components/View/Buttons/LanguagesDropdown.vue +++ b/panel/src/components/View/Buttons/LanguagesDropdown.vue @@ -61,6 +61,10 @@ export default { }, computed: { changesBadge() { + // `hasChanges` provides the state for all other than the current + // translation from the backend; for the current translation we need to + // check `content.hasChanges` as this state can change dynamically without + // any other backend request that would update `hasChanges` if (this.hasChanges || this.$panel.content.hasChanges) { return { theme: this.$panel.content.lock.isLocked ? "red" : "orange" diff --git a/src/Panel/Ui/Buttons/LanguagesDropdown.php b/src/Panel/Ui/Buttons/LanguagesDropdown.php index f8d02a9dd4..26d9775b35 100644 --- a/src/Panel/Ui/Buttons/LanguagesDropdown.php +++ b/src/Panel/Ui/Buttons/LanguagesDropdown.php @@ -43,8 +43,8 @@ class: 'k-languages-dropdown', /** * Returns if any translation other than the current one has unsaved changes - * (the current will be considered dynamically in `` - * based on its state) + * (the current language has to be handled in `k-languages-dropdown` as its + * state can change dynamically without another backend request) */ public function hasChanges(): bool { From e369e779982b6dd16238b1e6bc32ea00ca2e1b42 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 14 Nov 2024 19:55:04 +0100 Subject: [PATCH 238/362] FormControls: fix error for preview prop type --- panel/src/components/Forms/FormControls.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel/src/components/Forms/FormControls.vue b/panel/src/components/Forms/FormControls.vue index d64a5c6eb1..98ee086fec 100644 --- a/panel/src/components/Forms/FormControls.vue +++ b/panel/src/components/Forms/FormControls.vue @@ -64,7 +64,7 @@ export default { /** * Preview URL for changes */ - preview: String + preview: [String, Boolean] }, emits: ["discard", "submit"], computed: { From 8fef235f7f424ddb64158777bfd7c3fb29a26f25 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 14 Nov 2024 20:13:55 +0100 Subject: [PATCH 239/362] Improve test coverage --- src/Form/Fields.php | 2 +- tests/Form/FieldTest.php | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Form/Fields.php b/src/Form/Fields.php index e191622572..876029d748 100644 --- a/src/Form/Fields.php +++ b/src/Form/Fields.php @@ -73,7 +73,7 @@ public function defaults(): array public function errors(): array { if ($this->errors !== null) { - return $this->errors; + return $this->errors; // @codeCoverageIgnore } $this->errors = []; diff --git a/tests/Form/FieldTest.php b/tests/Form/FieldTest.php index f2b209114e..119a58a4c9 100644 --- a/tests/Form/FieldTest.php +++ b/tests/Form/FieldTest.php @@ -4,7 +4,6 @@ use Kirby\Cms\App; use Kirby\Cms\Page; -use Kirby\Data\Data; use Kirby\Exception\InvalidArgumentException; use Kirby\TestCase; @@ -36,6 +35,20 @@ public function tearDown(): void Field::$mixins = $this->originalMixins; } + /** + * @covers ::__construct + */ + public function testConstructInvalidType(): void + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Field "foo": The field type "test" does not exist'); + + new Field('test', [ + 'name' => 'foo', + 'type' => 'foo' + ]); + } + public function testAfter() { Field::$types = [ From d7e37fccaa47a8759e0ed3a6b7b493abe0e25dda Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 15 Nov 2024 11:47:39 +0100 Subject: [PATCH 240/362] Remove non-existing permissions check --- panel/src/components/Views/Pages/SiteView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel/src/components/Views/Pages/SiteView.vue b/panel/src/components/Views/Pages/SiteView.vue index 8527594275..235d16771e 100644 --- a/panel/src/components/Views/Pages/SiteView.vue +++ b/panel/src/components/Views/Pages/SiteView.vue @@ -20,7 +20,7 @@ :is-locked="isLocked" :is-unsaved="isUnsaved" :modified="modified" - :preview="permissions.preview ? api + '/preview/compare' : false" + :preview="api + '/preview/compare'" @discard="onDiscard" @submit="onSubmit" /> From 576ca968f8a42a228e3629e16bf1796344ef3909 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 15 Nov 2024 13:59:34 +0100 Subject: [PATCH 241/362] Fix the status button component --- src/Panel/Ui/Buttons/PageStatusButton.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Panel/Ui/Buttons/PageStatusButton.php b/src/Panel/Ui/Buttons/PageStatusButton.php index 410fb38314..44a2f7a3b2 100644 --- a/src/Panel/Ui/Buttons/PageStatusButton.php +++ b/src/Panel/Ui/Buttons/PageStatusButton.php @@ -32,6 +32,7 @@ public function __construct( parent::__construct( class: 'k-status-view-button k-page-status-button', + component: 'k-status-view-button', dialog: $page->panel()->url(true) . '/changeStatus', disabled: $disabled, icon: 'status-' . $status, From e56e1ed8de3304ff31f06f1c282d399d244bf06e Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 15 Nov 2024 16:09:39 +0100 Subject: [PATCH 242/362] Fix the unit test --- tests/Panel/Ui/Buttons/PageStatusButtonTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Panel/Ui/Buttons/PageStatusButtonTest.php b/tests/Panel/Ui/Buttons/PageStatusButtonTest.php index 235e5a5f7d..69d8fd46ec 100644 --- a/tests/Panel/Ui/Buttons/PageStatusButtonTest.php +++ b/tests/Panel/Ui/Buttons/PageStatusButtonTest.php @@ -20,7 +20,7 @@ public function testButtonDraftDisabled() $page = new Page(['slug' => 'test', 'isDraft' => true]); $button = new PageStatusButton($page); - $this->assertSame('k-view-button', $button->component); + $this->assertSame('k-status-view-button', $button->component); $this->assertSame('k-status-view-button k-page-status-button', $button->class); $this->assertSame('/pages/test/changeStatus', $button->dialog); $this->assertTrue($button->disabled); From 6e703114fd8e8b8bb947c123c8740efdb3a986c8 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 15 Nov 2024 12:49:31 +0100 Subject: [PATCH 243/362] Move content module logic into model views --- panel/src/components/Navigation/ModelTabs.vue | 3 +- panel/src/components/Views/Files/FileView.vue | 2 +- panel/src/components/Views/ModelView.vue | 79 ++++++++-- panel/src/components/Views/Pages/PageView.vue | 2 +- panel/src/components/Views/Pages/SiteView.vue | 2 +- panel/src/components/Views/PreviewView.vue | 16 -- panel/src/components/Views/Users/UserView.vue | 2 +- panel/src/panel/content.js | 149 ++---------------- 8 files changed, 87 insertions(+), 168 deletions(-) diff --git a/panel/src/components/Navigation/ModelTabs.vue b/panel/src/components/Navigation/ModelTabs.vue index ec9a41514c..1edbce7a3f 100644 --- a/panel/src/components/Navigation/ModelTabs.vue +++ b/panel/src/components/Navigation/ModelTabs.vue @@ -8,6 +8,7 @@ */ export default { props: { + changes: Object, tab: String, tabs: { type: Array, @@ -16,7 +17,7 @@ export default { }, computed: { withBadges() { - const changes = Object.keys(this.$panel.content.changes); + const changes = Object.keys(this.changes); return this.tabs.map((tab) => { // collect all fields per tab diff --git a/panel/src/components/Views/Files/FileView.vue b/panel/src/components/Views/Files/FileView.vue index 53a8556626..891b0994d5 100644 --- a/panel/src/components/Views/Files/FileView.vue +++ b/panel/src/components/Views/Files/FileView.vue @@ -38,7 +38,7 @@ @submit="onSubmit" /> - + +import { length } from "@/helpers/object"; import throttle from "@/helpers/throttle.js"; /** @@ -37,9 +38,25 @@ export default { }, uuid: String }, + data() { + return { + isSaved: true + }; + }, computed: { changes() { - return this.$panel.content.changes; + const changes = {}; + + for (const field in this.content) { + const changed = JSON.stringify(this.content[field]); + const original = JSON.stringify(this.originals[field]); + + if (changed !== original) { + changes[field] = this.content[field]; + } + } + + return changes; }, editor() { return this.lock.user.email; @@ -51,7 +68,7 @@ export default { return this.lock.isLocked; }, isUnsaved() { - return this.$panel.content.hasChanges; + return length(this.changes) > 0; }, modified() { return this.lock.modified; @@ -60,37 +77,62 @@ export default { return []; } }, + watch: { + // watch for view changes and + // trigger saving for changes that where + // not sent to the server yet + api() { + if (this.isSaved === false) { + this.save(); + } + } + }, mounted() { - this.autosave = throttle(this.autosave, 1000, { + // create a delayed version of save + // that we can use in the input event + this.autosave = throttle(this.save, 1000, { leading: true, trailing: true }); + this.$events.on("beforeunload", this.onBeforeUnload); this.$events.on("model.reload", this.$reload); this.$events.on("keydown.left", this.toPrev); this.$events.on("keydown.right", this.toNext); this.$events.on("view.save", this.onSave); }, destroyed() { + this.$events.off("beforeunload", this.onBeforeUnload); this.$events.off("model.reload", this.$reload); this.$events.off("keydown.left", this.toPrev); this.$events.off("keydown.right", this.toNext); this.$events.off("view.save", this.onSave); }, methods: { - autosave() { + async save() { if (this.isLocked === true) { return false; } - this.$panel.content.save(); + await this.$panel.content.save(this.api, this.content); + + // update the last modification timestamp + this.$panel.view.props.lock.modified = new Date(); + this.isSaved = true; + }, + onBeforeUnload(e) { + if (this.isSaved === false) { + e.preventDefault(); + e.returnValue = ""; + } }, async onDiscard() { if (this.isLocked === true) { return false; } - await this.$panel.content.discard(); + await this.$panel.content.discard(this.api); + this.$panel.view.props.content = this.$panel.view.props.originals; this.$panel.view.reload(); }, onInput(values) { @@ -98,7 +140,7 @@ export default { return false; } - this.$panel.content.update(values); + this.update(values); this.autosave(); }, onSave(e) { @@ -110,8 +152,15 @@ export default { return false; } - this.$panel.content.update(values); - await this.$panel.content.publish(); + this.update(values); + + await this.$panel.content.publish(this.api, this.content); + + this.$panel.view.props.originals = this.content; + this.$panel.notification.success(); + + this.$events.emit("model.update"); + await this.$panel.view.refresh(); }, toPrev(e) { @@ -123,6 +172,18 @@ export default { if (this.next && e.target.localName === "body") { this.$go(this.next.link); } + }, + update(values) { + if (length(values) === 0) { + return; + } + + this.$panel.view.props.content = { + ...this.originals, + ...values + }; + + this.isSaved = false; } } }; diff --git a/panel/src/components/Views/Pages/PageView.vue b/panel/src/components/Views/Pages/PageView.vue index 2bfb8c778c..eec194f4a2 100644 --- a/panel/src/components/Views/Pages/PageView.vue +++ b/panel/src/components/Views/Pages/PageView.vue @@ -31,7 +31,7 @@ - + - + 0) { return; } this.$panel.view.open(this.link); - }, - async onSubmit() { - if (this.isLocked === true) { - return false; - } - - await this.$panel.content.publish(); - await this.$panel.view.reload(); } } }; diff --git a/panel/src/components/Views/Users/UserView.vue b/panel/src/components/Views/Users/UserView.vue index b09d39aa06..531c8b1f09 100644 --- a/panel/src/components/Views/Users/UserView.vue +++ b/panel/src/components/Views/Users/UserView.vue @@ -49,7 +49,7 @@ :role="role" /> - + { - const content = reactive({ - /** - * API endpoint to handle content changes - */ - get api() { - return panel.view.props.api; - }, - - /** - * Returns all fields and their values that - * have been changed but not yet saved - * - * @returns {Object} - */ - get changes() { - const changes = {}; - - for (const field in panel.view.props.content) { - const changed = JSON.stringify(panel.view.props.content[field]); - const original = JSON.stringify(panel.view.props.originals[field]); - - if (changed !== original) { - changes[field] = panel.view.props.content[field]; - } - } - - return changes; - }, - + return reactive({ /** * Removes all unpublished changes */ - async discard() { + async discard(api) { if (this.isProcessing === true) { return; } @@ -45,54 +16,22 @@ export default (panel) => { this.isProcessing = true; try { - await panel.api.post(this.api + "/changes/discard"); - panel.view.props.content = panel.view.props.originals; + await panel.api.post(api + "/changes/discard"); } finally { this.isProcessing = false; } }, - /** - * Whether there are any changes - * - * @returns {Boolean} - */ - get hasChanges() { - return length(this.changes) > 0; - }, - /** * Whether content is currently being discarded, saved or published * @var {Boolean} */ isProcessing: false, - /** - * Whether all content updates have been successfully sent to the backend - * @var {Boolean} - */ - isSaved: true, - - /** - * Get the lock info for the model view - */ - get lock() { - return panel.view.props.lock; - }, - - /** - * The last published state - * - * @returns {Object} - */ - get originals() { - return panel.view.props.originals; - }, - /** * Publishes any changes */ - async publish() { + async publish(api, values) { if (this.isProcessing === true) { return; } @@ -101,15 +40,7 @@ export default (panel) => { // Send updated values to API try { - await panel.api.post( - this.api + "/changes/publish", - panel.view.props.content - ); - - panel.view.props.originals = panel.view.props.content; - - panel.events.emit("model.update"); - panel.notification.success(); + await panel.api.post(api + "/changes/publish", values); } finally { this.isProcessing = false; } @@ -118,7 +49,7 @@ export default (panel) => { /** * Saves any changes */ - async save() { + async save(api, values) { this.isProcessing = true; // ensure to abort unfinished previous save request @@ -127,18 +58,10 @@ export default (panel) => { this.saveAbortController = new AbortController(); try { - await panel.api.post( - this.api + "/changes/save", - panel.view.props.content, - { - signal: this.saveAbortController.signal - } - ); - - // update the last modification timestamp - panel.view.props.lock.modified = new Date(); + await panel.api.post(api + "/changes/save", values, { + signal: this.saveAbortController.signal + }); - this.isSaved = true; this.isProcessing = false; } catch (error) { // silent aborted requests, but throw all other errors @@ -153,56 +76,6 @@ export default (panel) => { * @internal * @var {AbortController} */ - saveAbortController: null, - - /** - * Updates the values of fields - * - * @param {Object} values - */ - update(values) { - if (length(values) === 0) { - return; - } - - panel.view.props.content = { - ...panel.view.props.originals, - ...values - }; - - this.isSaved = false; - }, - - /** - * Returns all fields and values incl. changes - * - * @returns {Object} - */ - get values() { - return panel.view.props.content; - } - }); - - // watch for view changes and - // trigger saving for changes that where - // not sent to the server yet - watch( - () => content.api, - () => { - if (content.isSaved === false) { - content.save(); - } - } - ); - - // if user tries to close tab with changes not - // sent to the server yet, trigger warning popup - panel.events.on("beforeunload", (e) => { - if (content.isSaved === false) { - e.preventDefault(); - e.returnValue = ""; - } + saveAbortController: null }); - - return content; }; From 23797fdaf161119add919cbfcfeba21063b4a881 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 15 Nov 2024 13:31:23 +0100 Subject: [PATCH 244/362] Bind api endpoint directly to call --- panel/src/components/Views/ModelView.vue | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/panel/src/components/Views/ModelView.vue b/panel/src/components/Views/ModelView.vue index a4a9963234..3a3a860c7b 100644 --- a/panel/src/components/Views/ModelView.vue +++ b/panel/src/components/Views/ModelView.vue @@ -77,16 +77,6 @@ export default { return []; } }, - watch: { - // watch for view changes and - // trigger saving for changes that where - // not sent to the server yet - api() { - if (this.isSaved === false) { - this.save(); - } - } - }, mounted() { // create a delayed version of save // that we can use in the input event @@ -109,15 +99,21 @@ export default { this.$events.off("view.save", this.onSave); }, methods: { - async save() { + async save(api, values) { if (this.isLocked === true) { return false; } - await this.$panel.content.save(this.api, this.content); + await this.$panel.content.save(api, values); // update the last modification timestamp - this.$panel.view.props.lock.modified = new Date(); + // if the view hasn't changed in the meantime, + // in which case the correct timestamp will come + // from the server + if (api === this.api) { + this.$panel.view.props.lock.modified = new Date(); + } + this.isSaved = true; }, onBeforeUnload(e) { @@ -141,7 +137,7 @@ export default { } this.update(values); - this.autosave(); + this.autosave(this.api, values); }, onSave(e) { e?.preventDefault?.(); From f0180fc1061d52dfe196067a46de5b25b8e4b5d2 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 15 Nov 2024 13:59:45 +0100 Subject: [PATCH 245/362] Reduce dependency on content module --- panel/src/components/View/Buttons/LanguagesDropdown.vue | 2 +- panel/src/components/View/Buttons/SettingsButton.vue | 2 +- panel/src/components/View/Buttons/StatusButton.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/panel/src/components/View/Buttons/LanguagesDropdown.vue b/panel/src/components/View/Buttons/LanguagesDropdown.vue index bb6cd3b4bb..f7361c0631 100644 --- a/panel/src/components/View/Buttons/LanguagesDropdown.vue +++ b/panel/src/components/View/Buttons/LanguagesDropdown.vue @@ -67,7 +67,7 @@ export default { // any other backend request that would update `hasChanges` if (this.hasChanges || this.$panel.content.hasChanges) { return { - theme: this.$panel.content.lock.isLocked ? "red" : "orange" + theme: this.$panel.view.props.lock.isLocked ? "red" : "orange" }; } diff --git a/panel/src/components/View/Buttons/SettingsButton.vue b/panel/src/components/View/Buttons/SettingsButton.vue index 5aa3d31d28..a25b85b883 100644 --- a/panel/src/components/View/Buttons/SettingsButton.vue +++ b/panel/src/components/View/Buttons/SettingsButton.vue @@ -1,7 +1,7 @@ diff --git a/panel/src/components/View/Buttons/StatusButton.vue b/panel/src/components/View/Buttons/StatusButton.vue index 64a2608e18..af71ef2193 100644 --- a/panel/src/components/View/Buttons/StatusButton.vue +++ b/panel/src/components/View/Buttons/StatusButton.vue @@ -1,7 +1,7 @@ From ea291b19311f73ad2db6ff09a15aa8a0fed121bb Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 15 Nov 2024 14:07:29 +0100 Subject: [PATCH 246/362] Keep requests silent --- panel/src/api/index.js | 2 +- panel/src/panel/content.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/panel/src/api/index.js b/panel/src/api/index.js index af39143a72..7a5422bac2 100644 --- a/panel/src/api/index.js +++ b/panel/src/api/index.js @@ -44,7 +44,7 @@ export default (panel) => { api.requests.push(id); // start the loader if it's not a silent request - if (silent === false) { + if (silent === false && options.silent !== true) { panel.isLoading = true; } diff --git a/panel/src/panel/content.js b/panel/src/panel/content.js index 2d3421849a..bee7cbd28f 100644 --- a/panel/src/panel/content.js +++ b/panel/src/panel/content.js @@ -59,7 +59,8 @@ export default (panel) => { try { await panel.api.post(api + "/changes/save", values, { - signal: this.saveAbortController.signal + signal: this.saveAbortController.signal, + silent: true }); this.isProcessing = false; From b017cccff4f7b6374370feda8de9175c466f54a5 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 18 Nov 2024 10:14:00 +0100 Subject: [PATCH 247/362] Make all content methods api dependent and add checks --- panel/src/components/Views/ModelView.vue | 65 ++++---------------- panel/src/panel/content.js | 77 ++++++++++++++++++++++-- 2 files changed, 85 insertions(+), 57 deletions(-) diff --git a/panel/src/components/Views/ModelView.vue b/panel/src/components/Views/ModelView.vue index 3a3a860c7b..0c01fcb9e2 100644 --- a/panel/src/components/Views/ModelView.vue +++ b/panel/src/components/Views/ModelView.vue @@ -80,7 +80,7 @@ export default { mounted() { // create a delayed version of save // that we can use in the input event - this.autosave = throttle(this.save, 1000, { + this.save = throttle(this.save, 1000, { leading: true, trailing: true }); @@ -89,76 +89,46 @@ export default { this.$events.on("model.reload", this.$reload); this.$events.on("keydown.left", this.toPrev); this.$events.on("keydown.right", this.toNext); - this.$events.on("view.save", this.onSave); + this.$events.on("view.save", this.onSubmitShortcut); }, destroyed() { this.$events.off("beforeunload", this.onBeforeUnload); this.$events.off("model.reload", this.$reload); this.$events.off("keydown.left", this.toPrev); this.$events.off("keydown.right", this.toNext); - this.$events.off("view.save", this.onSave); + this.$events.off("view.save", this.onSubmitShortcut); }, methods: { - async save(api, values) { - if (this.isLocked === true) { - return false; - } - - await this.$panel.content.save(api, values); - - // update the last modification timestamp - // if the view hasn't changed in the meantime, - // in which case the correct timestamp will come - // from the server - if (api === this.api) { - this.$panel.view.props.lock.modified = new Date(); - } - + async save(values) { + await this.$panel.content.save(values, this.api); this.isSaved = true; }, onBeforeUnload(e) { - if (this.isSaved === false) { + if (this.$panel.content.isProcessing === true || this.isSaved === false) { e.preventDefault(); e.returnValue = ""; } }, async onDiscard() { - if (this.isLocked === true) { - return false; - } - await this.$panel.content.discard(this.api); - this.$panel.view.props.content = this.$panel.view.props.originals; this.$panel.view.reload(); }, onInput(values) { - if (this.isLocked === true) { - return false; - } - this.update(values); - this.autosave(this.api, values); - }, - onSave(e) { - e?.preventDefault?.(); - this.onSubmit(); + this.save(values); }, async onSubmit(values = {}) { - if (this.isLocked === true) { - return false; - } - - this.update(values); + await this.$panel.content.publish(values, this.api); - await this.$panel.content.publish(this.api, this.content); - - this.$panel.view.props.originals = this.content; this.$panel.notification.success(); - this.$events.emit("model.update"); await this.$panel.view.refresh(); }, + onSubmitShortcut(e) { + e?.preventDefault?.(); + this.onSubmit(); + }, toPrev(e) { if (this.prev && e.target.localName === "body") { this.$go(this.prev.link); @@ -170,16 +140,7 @@ export default { } }, update(values) { - if (length(values) === 0) { - return; - } - - this.$panel.view.props.content = { - ...this.originals, - ...values - }; - - this.isSaved = false; + this.$panel.content.update(values, this.api); } } }; diff --git a/panel/src/panel/content.js b/panel/src/panel/content.js index bee7cbd28f..7684d7f20e 100644 --- a/panel/src/panel/content.js +++ b/panel/src/panel/content.js @@ -1,4 +1,5 @@ -import { reactive } from "vue"; +import { length } from "@/helpers/object"; +import { reactive, set } from "vue"; /** * @since 5.0.0 @@ -8,20 +9,50 @@ export default (panel) => { /** * Removes all unpublished changes */ - async discard(api) { + async discard(api = panel.view.props.api) { if (this.isProcessing === true) { return; } + if (this.isCurrent(api) === true && this.isLocked(api) === true) { + throw new Error("Cannot discard locked changes"); + } + this.isProcessing = true; try { await panel.api.post(api + "/changes/discard"); + + if (this.isCurrent(api)) { + panel.view.props.content = panel.view.props.originals; + } } finally { this.isProcessing = false; } }, + /** + * Whether the api endpoint belongs to the current view + * @var {Boolean} + */ + isCurrent(api) { + return panel.view.props.api === api; + }, + + /** + * Whether the current view is locked + * @var {Boolean} + */ + isLocked(api = panel.view.props.api) { + if (this.isCurrent(api) === false) { + throw new Error( + "The lock state cannot be detected for content from in another view" + ); + } + + return panel.view.props.lock.isLocked; + }, + /** * Whether content is currently being discarded, saved or published * @var {Boolean} @@ -31,16 +62,25 @@ export default (panel) => { /** * Publishes any changes */ - async publish(api, values) { + async publish(values, api = panel.view.props.api) { if (this.isProcessing === true) { return; } + if (this.isCurrent(api) === true && this.isLocked(api) === true) { + throw new Error("Cannot publish locked changes"); + } + this.isProcessing = true; + this.update(api, values); // Send updated values to API try { await panel.api.post(api + "/changes/publish", values); + + if (this.isCurrent(api)) { + panel.view.props.originals = panel.view.props.content; + } } finally { this.isProcessing = false; } @@ -49,7 +89,11 @@ export default (panel) => { /** * Saves any changes */ - async save(api, values) { + async save(values, api = panel.view.props.api) { + if (this.isCurrent(api) === true && this.isLocked(api) === true) { + throw new Error("Cannot save locked changes"); + } + this.isProcessing = true; // ensure to abort unfinished previous save request @@ -64,6 +108,11 @@ export default (panel) => { }); this.isProcessing = false; + + // update the lock info + if (this.isCurrent(api) === true) { + panel.view.props.lock.modified = new Date(); + } } catch (error) { // silent aborted requests, but throw all other errors if (error.name !== "AbortError") { @@ -77,6 +126,24 @@ export default (panel) => { * @internal * @var {AbortController} */ - saveAbortController: null + saveAbortController: null, + + /** + * Updates the form values of the current view + */ + update(values, api = panel.view.props.api) { + if (length(values) === 0) { + return; + } + + if (this.isCurrent(api) === false) { + throw new Error("The content in another view cannot be updated"); + } + + panel.view.props.content = { + ...panel.view.props.originals, + ...values + }; + } }); }; From cb01126df7c7fcba1467128a2c638845a2e4ae22 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 18 Nov 2024 11:06:52 +0100 Subject: [PATCH 248/362] Additional clean up and improvements --- .../View/Buttons/LanguagesDropdown.vue | 2 +- .../View/Buttons/SettingsButton.vue | 2 +- .../components/View/Buttons/StatusButton.vue | 2 +- panel/src/components/Views/Files/FileView.vue | 2 +- panel/src/components/Views/ModelView.vue | 58 +++++---------- panel/src/components/Views/Pages/PageView.vue | 7 +- panel/src/components/Views/Pages/SiteView.vue | 2 +- panel/src/components/Views/Users/UserView.vue | 2 +- panel/src/panel/content.js | 73 +++++++++++++++---- 9 files changed, 87 insertions(+), 63 deletions(-) diff --git a/panel/src/components/View/Buttons/LanguagesDropdown.vue b/panel/src/components/View/Buttons/LanguagesDropdown.vue index f7361c0631..0db8caa38e 100644 --- a/panel/src/components/View/Buttons/LanguagesDropdown.vue +++ b/panel/src/components/View/Buttons/LanguagesDropdown.vue @@ -67,7 +67,7 @@ export default { // any other backend request that would update `hasChanges` if (this.hasChanges || this.$panel.content.hasChanges) { return { - theme: this.$panel.view.props.lock.isLocked ? "red" : "orange" + theme: this.$panel.content.isLocked() ? "red" : "orange" }; } diff --git a/panel/src/components/View/Buttons/SettingsButton.vue b/panel/src/components/View/Buttons/SettingsButton.vue index a25b85b883..ac0d18388c 100644 --- a/panel/src/components/View/Buttons/SettingsButton.vue +++ b/panel/src/components/View/Buttons/SettingsButton.vue @@ -1,7 +1,7 @@ diff --git a/panel/src/components/View/Buttons/StatusButton.vue b/panel/src/components/View/Buttons/StatusButton.vue index af71ef2193..bf85503686 100644 --- a/panel/src/components/View/Buttons/StatusButton.vue +++ b/panel/src/components/View/Buttons/StatusButton.vue @@ -1,7 +1,7 @@ diff --git a/panel/src/components/Views/Files/FileView.vue b/panel/src/components/Views/Files/FileView.vue index 891b0994d5..9acf76fbcc 100644 --- a/panel/src/components/Views/Files/FileView.vue +++ b/panel/src/components/Views/Files/FileView.vue @@ -22,7 +22,7 @@ import { length } from "@/helpers/object"; -import throttle from "@/helpers/throttle.js"; /** * @internal @@ -45,80 +44,66 @@ export default { }, computed: { changes() { - const changes = {}; - - for (const field in this.content) { - const changed = JSON.stringify(this.content[field]); - const original = JSON.stringify(this.originals[field]); - - if (changed !== original) { - changes[field] = this.content[field]; - } - } - - return changes; + return this.$panel.content.changes(this.api); }, editor() { return this.lock.user.email; }, + hasChanges() { + return length(this.changes) > 0; + }, hasTabs() { return this.tabs.length > 1; }, isLocked() { return this.lock.isLocked; }, - isUnsaved() { - return length(this.changes) > 0; - }, modified() { return this.lock.modified; - }, - protectedFields() { - return []; } }, mounted() { - // create a delayed version of save - // that we can use in the input event - this.save = throttle(this.save, 1000, { - leading: true, - trailing: true - }); - this.$events.on("beforeunload", this.onBeforeUnload); - this.$events.on("model.reload", this.$reload); + this.$events.on("content.save", this.onContentSave); this.$events.on("keydown.left", this.toPrev); this.$events.on("keydown.right", this.toNext); + this.$events.on("model.reload", this.$reload); this.$events.on("view.save", this.onSubmitShortcut); }, destroyed() { this.$events.off("beforeunload", this.onBeforeUnload); - this.$events.off("model.reload", this.$reload); + this.$events.off("content.save", this.onContentSave); this.$events.off("keydown.left", this.toPrev); this.$events.off("keydown.right", this.toNext); + this.$events.off("model.reload", this.$reload); this.$events.off("view.save", this.onSubmitShortcut); }, methods: { - async save(values) { - await this.$panel.content.save(values, this.api); - this.isSaved = true; - }, onBeforeUnload(e) { if (this.$panel.content.isProcessing === true || this.isSaved === false) { e.preventDefault(); e.returnValue = ""; } }, + onContentSave({ api }) { + if (api === this.api) { + this.isSaved = true; + } + }, async onDiscard() { await this.$panel.content.discard(this.api); this.$panel.view.reload(); }, onInput(values) { - this.update(values); - this.save(values); + this.$panel.content.update(values, this.api); + this.$panel.content.saveLazy(values, this.api); }, async onSubmit(values = {}) { - await this.$panel.content.publish(values, this.api); + if (length(values) > 0) { + this.$panel.content.update(values, this.api); + } + + await this.$panel.content.publish(this.content, this.api); this.$panel.notification.success(); this.$events.emit("model.update"); @@ -138,9 +123,6 @@ export default { if (this.next && e.target.localName === "body") { this.$go(this.next.link); } - }, - update(values) { - this.$panel.content.update(values, this.api); } } }; diff --git a/panel/src/components/Views/Pages/PageView.vue b/panel/src/components/Views/Pages/PageView.vue index eec194f4a2..1ee689a32d 100644 --- a/panel/src/components/Views/Pages/PageView.vue +++ b/panel/src/components/Views/Pages/PageView.vue @@ -22,7 +22,7 @@ diff --git a/panel/src/components/Views/Pages/SiteView.vue b/panel/src/components/Views/Pages/SiteView.vue index 54c1df3ac5..4fdbcc6e23 100644 --- a/panel/src/components/Views/Pages/SiteView.vue +++ b/panel/src/components/Views/Pages/SiteView.vue @@ -18,7 +18,7 @@ { - return reactive({ + const content = reactive({ + /** + * Returns an object with all changed fields + * @param {String} api + * @returns {Object} + */ + changes(api = panel.view.props.api) { + if (this.isCurrent(api) === false) { + throw new Error("Cannot get changes from another view"); + } + + const changes = {}; + + for (const field in panel.view.props.content) { + const changed = JSON.stringify(panel.view.props.content[field]); + const original = JSON.stringify(panel.view.props.originals[field]); + + if (changed !== original) { + changes[field] = panel.view.props.content[field]; + } + } + + return changes; + }, + /** * Removes all unpublished changes */ @@ -26,6 +51,8 @@ export default (panel) => { if (this.isCurrent(api)) { panel.view.props.content = panel.view.props.originals; } + + panel.events.emit("content.discard", { api }); } finally { this.isProcessing = false; } @@ -33,7 +60,7 @@ export default (panel) => { /** * Whether the api endpoint belongs to the current view - * @var {Boolean} + * @var {String} api */ isCurrent(api) { return panel.view.props.api === api; @@ -41,16 +68,10 @@ export default (panel) => { /** * Whether the current view is locked - * @var {Boolean} + * @param {String} api */ isLocked(api = panel.view.props.api) { - if (this.isCurrent(api) === false) { - throw new Error( - "The lock state cannot be detected for content from in another view" - ); - } - - return panel.view.props.lock.isLocked; + return this.lock(api).isLocked; }, /** @@ -59,6 +80,20 @@ export default (panel) => { */ isProcessing: false, + /** + * Get the lock state for the current view + * @param {String} api + */ + lock(api = panel.view.props.api) { + if (this.isCurrent(api) === false) { + throw new Error( + "The lock state cannot be detected for content from in another view" + ); + } + + return panel.view.props.lock; + }, + /** * Publishes any changes */ @@ -72,7 +107,6 @@ export default (panel) => { } this.isProcessing = true; - this.update(api, values); // Send updated values to API try { @@ -81,6 +115,8 @@ export default (panel) => { if (this.isCurrent(api)) { panel.view.props.originals = panel.view.props.content; } + + panel.events.emit("content.publish", { api, values }); } finally { this.isProcessing = false; } @@ -109,10 +145,12 @@ export default (panel) => { this.isProcessing = false; - // update the lock info + // update the lock timestamp if (this.isCurrent(api) === true) { panel.view.props.lock.modified = new Date(); } + + panel.events.emit("content.save", { api, values }); } catch (error) { // silent aborted requests, but throw all other errors if (error.name !== "AbortError") { @@ -146,4 +184,13 @@ export default (panel) => { }; } }); + + // create a delayed version of save + // that we can use in the input event + content.saveLazy = throttle(content.save, 1000, { + leading: true, + trailing: true + }); + + return content; }; From 11f3bcbca021abf08800fbe842c3bd3b9471d6f4 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 18 Nov 2024 11:30:56 +0100 Subject: [PATCH 249/362] Fix PreviewView after new computed props --- panel/src/components/Views/PreviewView.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panel/src/components/Views/PreviewView.vue b/panel/src/components/Views/PreviewView.vue index f44a2a7e06..536122659d 100644 --- a/panel/src/components/Views/PreviewView.vue +++ b/panel/src/components/Views/PreviewView.vue @@ -81,7 +81,7 @@ - + {{ $t("lock.unsaved.empty") }} From d11d3ddbc020d96704276b06120325649544026b Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 18 Nov 2024 11:59:15 +0100 Subject: [PATCH 250/362] Improve inline docs and method names --- panel/src/components/Views/ModelView.vue | 31 ++++++++++++------------ panel/src/panel/content.js | 11 +++++++-- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/panel/src/components/Views/ModelView.vue b/panel/src/components/Views/ModelView.vue index 5eb2af3dcb..7684003554 100644 --- a/panel/src/components/Views/ModelView.vue +++ b/panel/src/components/Views/ModelView.vue @@ -68,7 +68,7 @@ export default { this.$events.on("keydown.left", this.toPrev); this.$events.on("keydown.right", this.toNext); this.$events.on("model.reload", this.$reload); - this.$events.on("view.save", this.onSubmitShortcut); + this.$events.on("view.save", this.onViewSave); }, destroyed() { this.$events.off("beforeunload", this.onBeforeUnload); @@ -76,7 +76,7 @@ export default { this.$events.off("keydown.left", this.toPrev); this.$events.off("keydown.right", this.toNext); this.$events.off("model.reload", this.$reload); - this.$events.off("view.save", this.onSubmitShortcut); + this.$events.off("view.save", this.onViewSave); }, methods: { onBeforeUnload(e) { @@ -92,37 +92,38 @@ export default { }, async onDiscard() { await this.$panel.content.discard(this.api); - this.$panel.view.reload(); + this.$panel.view.refresh(); }, onInput(values) { + // update the content for the current view + // this will also refresh the content prop this.$panel.content.update(values, this.api); - this.$panel.content.saveLazy(values, this.api); + // trigger a throttled save call with the updated content + this.$panel.content.saveLazy(this.content, this.api); }, - async onSubmit(values = {}) { - if (length(values) > 0) { - this.$panel.content.update(values, this.api); - } - + async onSubmit() { await this.$panel.content.publish(this.content, this.api); this.$panel.notification.success(); this.$events.emit("model.update"); + // the view needs to be refreshed to get an updated set of props + // this will also rerender sections if needed await this.$panel.view.refresh(); }, - onSubmitShortcut(e) { + onViewSave(e) { e?.preventDefault?.(); this.onSubmit(); }, - toPrev(e) { - if (this.prev && e.target.localName === "body") { - this.$go(this.prev.link); - } - }, toNext(e) { if (this.next && e.target.localName === "body") { this.$go(this.next.link); } + }, + toPrev(e) { + if (this.prev && e.target.localName === "body") { + this.$go(this.prev.link); + } } } }; diff --git a/panel/src/panel/content.js b/panel/src/panel/content.js index 01c83ff76d..8a9ed6c45c 100644 --- a/panel/src/panel/content.js +++ b/panel/src/panel/content.js @@ -13,6 +13,7 @@ export default (panel) => { * @returns {Object} */ changes(api = panel.view.props.api) { + // changes can only be computed for the current view if (this.isCurrent(api) === false) { throw new Error("Cannot get changes from another view"); } @@ -39,6 +40,8 @@ export default (panel) => { return; } + // In the current view, we can use the existing + // lock state to determine if we can discard if (this.isCurrent(api) === true && this.isLocked(api) === true) { throw new Error("Cannot discard locked changes"); } @@ -48,6 +51,7 @@ export default (panel) => { try { await panel.api.post(api + "/changes/discard"); + // update the props for the current view if (this.isCurrent(api)) { panel.view.props.content = panel.view.props.originals; } @@ -87,7 +91,7 @@ export default (panel) => { lock(api = panel.view.props.api) { if (this.isCurrent(api) === false) { throw new Error( - "The lock state cannot be detected for content from in another view" + "The lock state cannot be detected for content from another view" ); } @@ -102,6 +106,8 @@ export default (panel) => { return; } + // In the current view, we can use the existing + // lock state to determine if changes can be published if (this.isCurrent(api) === true && this.isLocked(api) === true) { throw new Error("Cannot publish locked changes"); } @@ -112,11 +118,12 @@ export default (panel) => { try { await panel.api.post(api + "/changes/publish", values); + // update the props for the current view if (this.isCurrent(api)) { panel.view.props.originals = panel.view.props.content; } - panel.events.emit("content.publish", { api, values }); + panel.events.emit("content.publish", { values, api }); } finally { this.isProcessing = false; } From 19a2a558d8d222179ebcf1615c8661912e603d4e Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 18 Nov 2024 20:18:53 +0100 Subject: [PATCH 251/362] Improve the wording MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nico Hoffmann ෴. --- panel/src/panel/content.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel/src/panel/content.js b/panel/src/panel/content.js index 8a9ed6c45c..0d0631d32f 100644 --- a/panel/src/panel/content.js +++ b/panel/src/panel/content.js @@ -15,7 +15,7 @@ export default (panel) => { changes(api = panel.view.props.api) { // changes can only be computed for the current view if (this.isCurrent(api) === false) { - throw new Error("Cannot get changes from another view"); + throw new Error("Cannot get changes for another view"); } const changes = {}; From 8d6133707a7a07bed1ad18e30b748a45493088a2 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 19 Nov 2024 12:48:37 +0100 Subject: [PATCH 252/362] Rename isUnsaved prop to hasChanges --- panel/lab/components/formcontrols/index.vue | 16 ++++++++-------- panel/src/components/Forms/FormControls.vue | 4 ++-- panel/src/components/Views/Files/FileView.vue | 2 +- panel/src/components/Views/Pages/PageView.vue | 2 +- panel/src/components/Views/Pages/SiteView.vue | 2 +- panel/src/components/Views/PreviewView.vue | 2 +- panel/src/components/Views/Users/UserView.vue | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/panel/lab/components/formcontrols/index.vue b/panel/lab/components/formcontrols/index.vue index dd316b8253..9185c55c8a 100644 --- a/panel/lab/components/formcontrols/index.vue +++ b/panel/lab/components/formcontrols/index.vue @@ -15,7 +15,7 @@ /> - + Date: Tue, 19 Nov 2024 13:02:32 +0100 Subject: [PATCH 253/362] Apply default api endpoint in method calls --- panel/src/panel/content.js | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/panel/src/panel/content.js b/panel/src/panel/content.js index 0d0631d32f..bd9032ad9a 100644 --- a/panel/src/panel/content.js +++ b/panel/src/panel/content.js @@ -12,7 +12,9 @@ export default (panel) => { * @param {String} api * @returns {Object} */ - changes(api = panel.view.props.api) { + changes(api) { + api ??= panel.view.props.api; + // changes can only be computed for the current view if (this.isCurrent(api) === false) { throw new Error("Cannot get changes for another view"); @@ -35,7 +37,9 @@ export default (panel) => { /** * Removes all unpublished changes */ - async discard(api = panel.view.props.api) { + async discard(api) { + api ??= panel.view.props.api; + if (this.isProcessing === true) { return; } @@ -74,8 +78,8 @@ export default (panel) => { * Whether the current view is locked * @param {String} api */ - isLocked(api = panel.view.props.api) { - return this.lock(api).isLocked; + isLocked(api) { + return this.lock(api ?? panel.view.props.api).isLocked; }, /** @@ -88,8 +92,8 @@ export default (panel) => { * Get the lock state for the current view * @param {String} api */ - lock(api = panel.view.props.api) { - if (this.isCurrent(api) === false) { + lock(api) { + if (this.isCurrent(api ?? panel.view.props.api) === false) { throw new Error( "The lock state cannot be detected for content from another view" ); @@ -101,7 +105,9 @@ export default (panel) => { /** * Publishes any changes */ - async publish(values, api = panel.view.props.api) { + async publish(values, api) { + api ??= panel.view.props.api; + if (this.isProcessing === true) { return; } @@ -132,7 +138,9 @@ export default (panel) => { /** * Saves any changes */ - async save(values, api = panel.view.props.api) { + async save(values, api) { + api ??= panel.view.props.api; + if (this.isCurrent(api) === true && this.isLocked(api) === true) { throw new Error("Cannot save locked changes"); } @@ -176,12 +184,12 @@ export default (panel) => { /** * Updates the form values of the current view */ - update(values, api = panel.view.props.api) { + update(values, api) { if (length(values) === 0) { return; } - if (this.isCurrent(api) === false) { + if (this.isCurrent(api ?? panel.view.props.api) === false) { throw new Error("The content in another view cannot be updated"); } From 43de043da4cda5455a0aff3d99ab97d30c2796eb Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 19 Nov 2024 17:35:55 +0100 Subject: [PATCH 254/362] Call save directly in update method --- panel/src/components/Views/ModelView.vue | 2 -- panel/src/panel/content.js | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/panel/src/components/Views/ModelView.vue b/panel/src/components/Views/ModelView.vue index 7684003554..6e847be6d6 100644 --- a/panel/src/components/Views/ModelView.vue +++ b/panel/src/components/Views/ModelView.vue @@ -98,8 +98,6 @@ export default { // update the content for the current view // this will also refresh the content prop this.$panel.content.update(values, this.api); - // trigger a throttled save call with the updated content - this.$panel.content.saveLazy(this.content, this.api); }, async onSubmit() { await this.$panel.content.publish(this.content, this.api); diff --git a/panel/src/panel/content.js b/panel/src/panel/content.js index bd9032ad9a..98f2306b20 100644 --- a/panel/src/panel/content.js +++ b/panel/src/panel/content.js @@ -197,6 +197,8 @@ export default (panel) => { ...panel.view.props.originals, ...values }; + + this.saveLazy(panel.view.props.content, api); } }); From 9f960f368487aeb1e31a6fc20986ab53ae8b0a57 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 20 Nov 2024 09:28:10 +0100 Subject: [PATCH 255/362] Simplify API routes --- config/api/routes/changes.php | 192 ++-------------------------------- 1 file changed, 6 insertions(+), 186 deletions(-) diff --git a/config/api/routes/changes.php b/config/api/routes/changes.php index bdab570d3d..2e35754315 100644 --- a/config/api/routes/changes.php +++ b/config/api/routes/changes.php @@ -4,214 +4,34 @@ use Kirby\Cms\App; use Kirby\Cms\Find; -// Files -$files = [ - 'discard' => [ - 'method' => 'POST', - 'action' => function (string $parent, string $filename) { - return Changes::discard( - model: Find::file($parent, $filename), - ); - } - ], - 'publish' => [ - 'method' => 'POST', - 'action' => function (string $parent, string $filename) { - return Changes::publish( - model: Find::file($parent, $filename), - input: App::instance()->request()->get() - ); - } - ], - 'save' => [ - 'method' => 'POST', - 'action' => function (string $parent, string $filename) { - return Changes::save( - model: Find::file($parent, $filename), - input: App::instance()->request()->get() - ); - } - ] -]; - return [ - // Page [ - 'pattern' => 'pages/(:any)/changes/discard', + 'pattern' => '(:all)/changes/discard', 'method' => 'POST', 'action' => function (string $path) { return Changes::discard( - model: Find::page($path), + model: Find::parent($path), ); } ], [ - 'pattern' => 'pages/(:any)/changes/publish', + 'pattern' => '(:all)/changes/publish', 'method' => 'POST', 'action' => function (string $path) { return Changes::publish( - model: Find::page($path), + model: Find::parent($path), input: App::instance()->request()->get() ); } ], [ - 'pattern' => 'pages/(:any)/changes/save', + 'pattern' => '(:all)/changes/save', 'method' => 'POST', 'action' => function (string $path) { return Changes::save( - model: Find::page($path), - input: App::instance()->request()->get() - ); - } - ], - - // Page Files - [ - ...$files['discard'], - 'pattern' => '(pages/.*?)/files/(:any)/changes/discard', - ], - [ - ...$files['publish'], - 'pattern' => '(pages/.*?)/files/(:any)/changes/publish', - ], - [ - ...$files['save'], - 'pattern' => '(pages/.*?)/files/(:any)/changes/save', - ], - - // Site - [ - 'pattern' => 'site/changes/discard', - 'method' => 'POST', - 'action' => function () { - return Changes::discard( - model: App::instance()->site(), - ); - } - ], - [ - 'pattern' => 'site/changes/publish', - 'method' => 'POST', - 'action' => function () { - return Changes::publish( - model: App::instance()->site(), - input: App::instance()->request()->get() - ); - } - ], - [ - 'pattern' => 'site/changes/save', - 'method' => 'POST', - 'action' => function () { - return Changes::save( - model: App::instance()->site(), + model: Find::parent($path), input: App::instance()->request()->get() ); } ], - - // Site Files - [ - ...$files['discard'], - 'pattern' => '(site)/files/(:any)/changes/discard', - ], - [ - ...$files['publish'], - 'pattern' => '(site)/files/(:any)/changes/publish', - ], - [ - ...$files['save'], - 'pattern' => '(site)/files/(:any)/changes/save', - ], - - // User - [ - 'pattern' => 'users/(:any)/changes/discard', - 'method' => 'POST', - 'action' => function (string $path) { - return Changes::discard( - model: Find::user($path), - ); - } - ], - [ - 'pattern' => 'users/(:any)/changes/publish', - 'method' => 'POST', - 'action' => function (string $path) { - return Changes::publish( - model: Find::user($path), - input: App::instance()->request()->get() - ); - } - ], - [ - 'pattern' => 'users/(:any)/changes/save', - 'method' => 'POST', - 'action' => function (string $path) { - return Changes::save( - model: Find::user($path), - input: App::instance()->request()->get() - ); - } - ], - - // User Files - [ - ...$files['discard'], - 'pattern' => '(users/.*?)/files/(:any)/changes/discard', - ], - [ - ...$files['publish'], - 'pattern' => '(users/.*?)/files/(:any)/changes/publish', - ], - [ - ...$files['save'], - 'pattern' => '(users/.*?)/files/(:any)/changes/save', - ], - - // Account - [ - 'pattern' => 'account/changes/discard', - 'method' => 'POST', - 'action' => function () { - return Changes::discard( - model: App::instance()->user() - ); - } - ], - [ - 'pattern' => 'account/changes/publish', - 'method' => 'POST', - 'action' => function () { - return Changes::publish( - model: App::instance()->user(), - input: App::instance()->request()->get() - ); - } - ], - [ - 'pattern' => 'account/changes/save', - 'method' => 'POST', - 'action' => function () { - return Changes::save( - model: App::instance()->user(), - input: App::instance()->request()->get() - ); - } - ], - - // Account Files - [ - ...$files['discard'], - 'pattern' => '(account)/files/(:any)/changes/discard', - ], - [ - ...$files['publish'], - 'pattern' => '(account)/files/(:any)/changes/publish', - ], - [ - ...$files['save'], - 'pattern' => '(account)/files/(:any)/changes/save', - ], ]; From a4c6d28936ec92eaca86618cf850bf48affa3d58 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 20 Nov 2024 09:40:36 +0100 Subject: [PATCH 256/362] Improve docblock --- src/Form/FieldClass.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Form/FieldClass.php b/src/Form/FieldClass.php index 8134a3c48a..3453676422 100644 --- a/src/Form/FieldClass.php +++ b/src/Form/FieldClass.php @@ -249,8 +249,8 @@ public function required(): bool } /** - * @deprecated 3.5.0 - * @todo remove when the general field class setup has been refactored + * Checks if the field is saveable + * @deprecated 5.0.0 Use `::isSaveable()` instead */ public function save(): bool { From d070cb1abdab953ca5de737132a9547c4c3cd8f5 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 20 Nov 2024 15:09:48 +0100 Subject: [PATCH 257/362] Reload latest iframe on publish --- panel/src/components/Views/PreviewView.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/panel/src/components/Views/PreviewView.vue b/panel/src/components/Views/PreviewView.vue index c6a5a7bf9f..a20c4e4fdf 100644 --- a/panel/src/components/Views/PreviewView.vue +++ b/panel/src/components/Views/PreviewView.vue @@ -53,7 +53,7 @@ /> - +
        - + {{ $t("lock.unsaved.empty") }} @@ -141,9 +141,11 @@ export default { }, mounted() { this.$events.on("keydown.esc", this.onExit); + this.$events.on("content.publish", this.onPublish); }, destroyed() { this.$events.off("keydown.esc", this.onExit); + this.$events.off("content.publish", this.onPublish); }, methods: { changeMode(mode) { @@ -159,6 +161,9 @@ export default { } this.$panel.view.open(this.link); + }, + onPublish() { + this.$refs.latest.contentWindow.location.reload(); } } }; From 5c90e4c48e693bd749f73eebc574a8f72b358ac8 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 20 Nov 2024 16:34:52 +0100 Subject: [PATCH 258/362] Update JS dependencies --- panel/package-lock.json | 374 +++++++++++++++++++++------------------- panel/package.json | 18 +- 2 files changed, 208 insertions(+), 184 deletions(-) diff --git a/panel/package-lock.json b/panel/package-lock.json index 1e1242ef4c..d91253e7a7 100644 --- a/panel/package-lock.json +++ b/panel/package-lock.json @@ -10,29 +10,29 @@ "dayjs": "^1.11.13", "mitt": "^3.0.1", "portal-vue": "^2.1.7", - "prosemirror-commands": "^1.6.0", + "prosemirror-commands": "^1.6.2", "prosemirror-history": "^1.4.1", "prosemirror-inputrules": "^1.4.0", "prosemirror-keymap": "^1.2.2", "prosemirror-model": "^1.22.3", "prosemirror-schema-list": "^1.4.1", - "prosemirror-view": "^1.34.3", + "prosemirror-view": "^1.36.0", "sortablejs": "^1.15.2", "vue": "^2.7.16" }, "devDependencies": { "@vitejs/plugin-vue2": "^2.3.1", - "eslint": "^9.11.1", + "eslint": "^9.15.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-vue": "^9.28.0", + "eslint-plugin-vue": "^9.31.0", "glob": "^11.0.0", "jsdom": "^25.0.1", "prettier": "^3.3.3", - "rollup-plugin-external-globals": "^0.12.0", - "terser": "^5.34.1", - "vite": "^5.4.8", - "vite-plugin-static-copy": "^1.0.6", - "vitest": "^2.1.1", + "rollup-plugin-external-globals": "^0.13.0", + "terser": "^5.36.0", + "vite": "^5.4.11", + "vite-plugin-static-copy": "^2.1.0", + "vitest": "^2.1.5", "vue-docgen-api": "^4.79.2", "vue-template-compiler": "^2.7.16" } @@ -505,9 +505,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", - "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, "license": "MIT", "engines": { @@ -515,9 +515,9 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", - "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.0.tgz", + "integrity": "sha512-zdHg2FPIFNKPdcHWtiNT+jEFCHYVplAXRDlQDyqy0zGx/q2parwh7brGJSiTxRk/TSMkbM//zt/f5CHgyTyaSQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -530,9 +530,9 @@ } }, "node_modules/@eslint/core": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.6.0.tgz", - "integrity": "sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.0.tgz", + "integrity": "sha512-7ATR9F0e4W85D/0w7cU0SNj7qkAexMG+bAHEZOjo9akvGuhHE2m7umzWzfnpa0XAg5Kxc1BWmtPMV67jJ+9VUg==", "dev": true, "license": "Apache-2.0", "engines": { @@ -540,9 +540,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", - "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", "dev": true, "license": "MIT", "dependencies": { @@ -564,9 +564,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.12.0.tgz", - "integrity": "sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==", + "version": "9.15.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.15.0.tgz", + "integrity": "sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==", "dev": true, "license": "MIT", "engines": { @@ -584,9 +584,9 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.0.tgz", - "integrity": "sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.3.tgz", + "integrity": "sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -597,9 +597,9 @@ } }, "node_modules/@humanfs/core": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.0.tgz", - "integrity": "sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -607,19 +607,33 @@ } }, "node_modules/@humanfs/node": { - "version": "0.16.5", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.5.tgz", - "integrity": "sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==", + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@humanfs/core": "^0.19.0", + "@humanfs/core": "^0.19.1", "@humanwhocodes/retry": "^0.3.0" }, "engines": { "node": ">=18.18.0" } }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -635,9 +649,9 @@ } }, "node_modules/@humanwhocodes/retry": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", - "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", + "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -1051,15 +1065,15 @@ } }, "node_modules/@vitest/expect": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.2.tgz", - "integrity": "sha512-FEgtlN8mIUSEAAnlvn7mP8vzaWhEaAEvhSXCqrsijM7K6QqjB11qoRZYEd4AKSCDz8p0/+yH5LzhZ47qt+EyPg==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.5.tgz", + "integrity": "sha512-nZSBTW1XIdpZvEJyoP/Sy8fUg0b8od7ZpGDkTUcfJ7wz/VoZAFzFfLyxVxGFhUjJzhYqSbIpfMtl/+k/dpWa3Q==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "2.1.2", - "@vitest/utils": "2.1.2", - "chai": "^5.1.1", + "@vitest/spy": "2.1.5", + "@vitest/utils": "2.1.5", + "chai": "^5.1.2", "tinyrainbow": "^1.2.0" }, "funding": { @@ -1067,22 +1081,21 @@ } }, "node_modules/@vitest/mocker": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.2.tgz", - "integrity": "sha512-ExElkCGMS13JAJy+812fw1aCv2QO/LBK6CyO4WOPAzLTmve50gydOlWhgdBJPx2ztbADUq3JVI0C5U+bShaeEA==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.5.tgz", + "integrity": "sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "^2.1.0-beta.1", + "@vitest/spy": "2.1.5", "estree-walker": "^3.0.3", - "magic-string": "^0.30.11" + "magic-string": "^0.30.12" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "@vitest/spy": "2.1.2", - "msw": "^2.3.5", + "msw": "^2.4.9", "vite": "^5.0.0" }, "peerDependenciesMeta": { @@ -1095,9 +1108,9 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.2.tgz", - "integrity": "sha512-FIoglbHrSUlOJPDGIrh2bjX1sNars5HbxlcsFKCtKzu4+5lpsRhOCVcuzp0fEhAGHkPZRIXVNzPcpSlkoZ3LuA==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.5.tgz", + "integrity": "sha512-4ZOwtk2bqG5Y6xRGHcveZVr+6txkH7M2e+nPFd6guSoN638v/1XQ0K06eOpi0ptVU/2tW/pIU4IoPotY/GZ9fw==", "dev": true, "license": "MIT", "dependencies": { @@ -1108,13 +1121,13 @@ } }, "node_modules/@vitest/runner": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.2.tgz", - "integrity": "sha512-UCsPtvluHO3u7jdoONGjOSil+uON5SSvU9buQh3lP7GgUXHp78guN1wRmZDX4wGK6J10f9NUtP6pO+SFquoMlw==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.5.tgz", + "integrity": "sha512-pKHKy3uaUdh7X6p1pxOkgkVAFW7r2I818vHDthYLvUyjRfkKOU6P45PztOch4DZarWQne+VOaIMwA/erSSpB9g==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "2.1.2", + "@vitest/utils": "2.1.5", "pathe": "^1.1.2" }, "funding": { @@ -1122,14 +1135,14 @@ } }, "node_modules/@vitest/snapshot": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.2.tgz", - "integrity": "sha512-xtAeNsZ++aRIYIUsek7VHzry/9AcxeULlegBvsdLncLmNCR6tR8SRjn8BbDP4naxtccvzTqZ+L1ltZlRCfBZFA==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.5.tgz", + "integrity": "sha512-zmYw47mhfdfnYbuhkQvkkzYroXUumrwWDGlMjpdUr4jBd3HZiV2w7CQHj+z7AAS4VOtWxI4Zt4bWt4/sKcoIjg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.2", - "magic-string": "^0.30.11", + "@vitest/pretty-format": "2.1.5", + "magic-string": "^0.30.12", "pathe": "^1.1.2" }, "funding": { @@ -1137,27 +1150,27 @@ } }, "node_modules/@vitest/spy": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.2.tgz", - "integrity": "sha512-GSUi5zoy+abNRJwmFhBDC0yRuVUn8WMlQscvnbbXdKLXX9dE59YbfwXxuJ/mth6eeqIzofU8BB5XDo/Ns/qK2A==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.5.tgz", + "integrity": "sha512-aWZF3P0r3w6DiYTVskOYuhBc7EMc3jvn1TkBg8ttylFFRqNN2XGD7V5a4aQdk6QiUzZQ4klNBSpCLJgWNdIiNw==", "dev": true, "license": "MIT", "dependencies": { - "tinyspy": "^3.0.0" + "tinyspy": "^3.0.2" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/utils": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.2.tgz", - "integrity": "sha512-zMO2KdYy6mx56btx9JvAqAZ6EyS3g49krMPPrgOp1yxGZiA93HumGk+bZ5jIZtOg5/VBYl5eBmGRQHqq4FG6uQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.5.tgz", + "integrity": "sha512-yfj6Yrp0Vesw2cwJbP+cl04OC+IHFsuQsrsJBL9pyGeQXE56v1UAOQco+SR55Vf1nQzfV0QJg1Qum7AaWUwwYg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.2", - "loupe": "^3.1.1", + "@vitest/pretty-format": "2.1.5", + "loupe": "^3.1.2", "tinyrainbow": "^1.2.0" }, "funding": { @@ -1244,9 +1257,9 @@ "license": "MIT" }, "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, "license": "MIT", "bin": { @@ -1508,9 +1521,9 @@ } }, "node_modules/chai": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.1.tgz", - "integrity": "sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", + "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", "dev": true, "license": "MIT", "dependencies": { @@ -1658,9 +1671,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "license": "MIT", "dependencies": { @@ -1858,6 +1871,13 @@ "node": ">= 0.4" } }, + "node_modules/es-module-lexer": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", + "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", + "dev": true, + "license": "MIT" + }, "node_modules/esbuild": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", @@ -1911,32 +1931,32 @@ } }, "node_modules/eslint": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.12.0.tgz", - "integrity": "sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==", + "version": "9.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.15.0.tgz", + "integrity": "sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.11.0", - "@eslint/config-array": "^0.18.0", - "@eslint/core": "^0.6.0", - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.12.0", - "@eslint/plugin-kit": "^0.2.0", - "@humanfs/node": "^0.16.5", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.9.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.15.0", + "@eslint/plugin-kit": "^0.2.3", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.3.1", + "@humanwhocodes/retry": "^0.4.1", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.5", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.1.0", - "eslint-visitor-keys": "^4.1.0", - "espree": "^10.2.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -1950,8 +1970,7 @@ "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" @@ -1985,9 +2004,9 @@ } }, "node_modules/eslint-plugin-vue": { - "version": "9.28.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.28.0.tgz", - "integrity": "sha512-ShrihdjIhOTxs+MfWun6oJWuk+g/LAhN+CiuOl/jjkG3l0F2AuK5NMTaWqyvBgkFtpYmyks6P4603mLmhNJW8g==", + "version": "9.31.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.31.0.tgz", + "integrity": "sha512-aYMUCgivhz1o4tLkRHj5oq9YgYPM4/EJc0M7TAKRLCUA5OYxRLAhYEVD2nLtTwLyixEFI+/QXSvKU9ESZFgqjQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2024,9 +2043,9 @@ } }, "node_modules/eslint-scope": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.1.0.tgz", - "integrity": "sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -2041,9 +2060,9 @@ } }, "node_modules/eslint-visitor-keys": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -2061,15 +2080,15 @@ "license": "Apache-2.0" }, "node_modules/espree": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz", - "integrity": "sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.12.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.1.0" + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2148,6 +2167,16 @@ "node": ">=0.10.0" } }, + "node_modules/expect-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.1.0.tgz", + "integrity": "sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -2995,9 +3024,9 @@ } }, "node_modules/magic-string": { - "version": "0.30.11", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz", - "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==", + "version": "0.30.13", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.13.tgz", + "integrity": "sha512-8rYBO+MsWkgjDSOvLomYnzhdwEG51olQ4zL5KXnNJWV5MNmrb4rTZdrtkhxjnD/QyZUqR/Z/XDsUs/4ej2nx0g==", "dev": true, "license": "MIT", "dependencies": { @@ -3409,14 +3438,14 @@ } }, "node_modules/prosemirror-commands": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.6.0.tgz", - "integrity": "sha512-xn1U/g36OqXn2tn5nGmvnnimAj/g1pUx2ypJJIe8WkVX83WyJVC5LTARaxZa2AtQRwntu9Jc5zXs9gL9svp/mg==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.6.2.tgz", + "integrity": "sha512-0nDHH++qcf/BuPLYvmqZTUUsPJUCPBUXt0J1ErTcDIS369CTp773itzLGIgIXG4LJXOlwYCr44+Mh4ii6MP1QA==", "license": "MIT", "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", - "prosemirror-transform": "^1.0.0" + "prosemirror-transform": "^1.10.2" } }, "node_modules/prosemirror-history": { @@ -3483,18 +3512,18 @@ } }, "node_modules/prosemirror-transform": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.10.0.tgz", - "integrity": "sha512-9UOgFSgN6Gj2ekQH5CTDJ8Rp/fnKR2IkYfGdzzp5zQMFsS4zDllLVx/+jGcX86YlACpG7UR5fwAXiWzxqWtBTg==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.10.2.tgz", + "integrity": "sha512-2iUq0wv2iRoJO/zj5mv8uDUriOHWzXRnOTVgCzSXnktS/2iQRa3UUQwVlkBlYZFtygw6Nh1+X4mGqoYBINn5KQ==", "license": "MIT", "dependencies": { "prosemirror-model": "^1.21.0" } }, "node_modules/prosemirror-view": { - "version": "1.34.3", - "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.34.3.tgz", - "integrity": "sha512-mKZ54PrX19sSaQye+sef+YjBbNu2voNwLS1ivb6aD2IRmxRGW64HU9B644+7OfJStGLyxvOreKqEgfvXa91WIA==", + "version": "1.36.0", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.36.0.tgz", + "integrity": "sha512-U0GQd5yFvV5qUtT41X1zCQfbw14vkbbKwLlQXhdylEmgpYVHkefXYcC4HHwWOfZa3x6Y8wxDLUBv7dxN5XQ3nA==", "license": "MIT", "dependencies": { "prosemirror-model": "^1.20.0", @@ -3775,9 +3804,9 @@ } }, "node_modules/rollup-plugin-external-globals": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-external-globals/-/rollup-plugin-external-globals-0.12.0.tgz", - "integrity": "sha512-65Tqhh/f7hDY0qHmT4lYTVdDkY/BZU5bUQwS+SPvy6seSlACpcFRu2HzOmbLozXJS0/mOjwFyLlzJjlT2MTt8g==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-external-globals/-/rollup-plugin-external-globals-0.13.0.tgz", + "integrity": "sha512-wBS3hmoF0OtEnA0lWsmTC6Nhnkk2zjZbfhaX2gLo8VnfNGFdGhiYKwMpIPQPrYbAw+mAYUYmoHYktAl1eZHgVw==", "dev": true, "license": "MIT", "dependencies": { @@ -3964,9 +3993,9 @@ "license": "MIT" }, "node_modules/std-env": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", - "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz", + "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==", "dev": true, "license": "MIT" }, @@ -4121,9 +4150,9 @@ "license": "MIT" }, "node_modules/terser": { - "version": "5.34.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.34.1.tgz", - "integrity": "sha512-FsJZ7iZLd/BXkz+4xrRTGJ26o/6VTjQytUk8b8OxkwcD2I+79VPJlz7qss1+zE7h8GNIScFqXcDyJ/KqBYZFVA==", + "version": "5.36.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz", + "integrity": "sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -4139,13 +4168,6 @@ "node": ">=10" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "license": "MIT" - }, "node_modules/tiny-invariant": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", @@ -4161,9 +4183,9 @@ "license": "MIT" }, "node_modules/tinyexec": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.0.tgz", - "integrity": "sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.1.tgz", + "integrity": "sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==", "dev": true, "license": "MIT" }, @@ -4340,9 +4362,9 @@ "license": "MIT" }, "node_modules/vite": { - "version": "5.4.8", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.8.tgz", - "integrity": "sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==", + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", "dev": true, "license": "MIT", "dependencies": { @@ -4400,14 +4422,15 @@ } }, "node_modules/vite-node": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.2.tgz", - "integrity": "sha512-HPcGNN5g/7I2OtPjLqgOtCRu/qhVvBxTUD3qzitmL0SrG1cWFzxzhMDWussxSbrRYWqnKf8P2jiNhPMSN+ymsQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.5.tgz", + "integrity": "sha512-rd0QIgx74q4S1Rd56XIiL2cYEdyWn13cunYBIuqh9mpmQr7gGS0IxXoP8R6OaZtNQQLyXSWbd4rXKYUbhFpK5w==", "dev": true, "license": "MIT", "dependencies": { "cac": "^6.7.14", - "debug": "^4.3.6", + "debug": "^4.3.7", + "es-module-lexer": "^1.5.4", "pathe": "^1.1.2", "vite": "^5.0.0" }, @@ -4422,9 +4445,9 @@ } }, "node_modules/vite-plugin-static-copy": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-1.0.6.tgz", - "integrity": "sha512-3uSvsMwDVFZRitqoWHj0t4137Kz7UynnJeq1EZlRW7e25h2068fyIZX4ORCCOAkfp1FklGxJNVJBkBOD+PZIew==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-2.1.0.tgz", + "integrity": "sha512-n8lEOIVM00Y/zronm0RG8RdPyFd0SAAFR0sii3NWmgG3PSCyYMsvUNRQTlb3onp1XeMrKIDwCrPGxthKvqX9OQ==", "dev": true, "license": "MIT", "dependencies": { @@ -4441,30 +4464,31 @@ } }, "node_modules/vitest": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.2.tgz", - "integrity": "sha512-veNjLizOMkRrJ6xxb+pvxN6/QAWg95mzcRjtmkepXdN87FNfxAss9RKe2far/G9cQpipfgP2taqg0KiWsquj8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/expect": "2.1.2", - "@vitest/mocker": "2.1.2", - "@vitest/pretty-format": "^2.1.2", - "@vitest/runner": "2.1.2", - "@vitest/snapshot": "2.1.2", - "@vitest/spy": "2.1.2", - "@vitest/utils": "2.1.2", - "chai": "^5.1.1", - "debug": "^4.3.6", - "magic-string": "^0.30.11", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.5.tgz", + "integrity": "sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "2.1.5", + "@vitest/mocker": "2.1.5", + "@vitest/pretty-format": "^2.1.5", + "@vitest/runner": "2.1.5", + "@vitest/snapshot": "2.1.5", + "@vitest/spy": "2.1.5", + "@vitest/utils": "2.1.5", + "chai": "^5.1.2", + "debug": "^4.3.7", + "expect-type": "^1.1.0", + "magic-string": "^0.30.12", "pathe": "^1.1.2", - "std-env": "^3.7.0", + "std-env": "^3.8.0", "tinybench": "^2.9.0", - "tinyexec": "^0.3.0", - "tinypool": "^1.0.0", + "tinyexec": "^0.3.1", + "tinypool": "^1.0.1", "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "2.1.2", + "vite-node": "2.1.5", "why-is-node-running": "^2.3.0" }, "bin": { @@ -4479,8 +4503,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.1.2", - "@vitest/ui": "2.1.2", + "@vitest/browser": "2.1.5", + "@vitest/ui": "2.1.5", "happy-dom": "*", "jsdom": "*" }, diff --git a/panel/package.json b/panel/package.json index a6f875a4b8..f2f34f9a7d 100644 --- a/panel/package.json +++ b/panel/package.json @@ -15,29 +15,29 @@ "dayjs": "^1.11.13", "mitt": "^3.0.1", "portal-vue": "^2.1.7", - "prosemirror-commands": "^1.6.0", + "prosemirror-commands": "^1.6.2", "prosemirror-history": "^1.4.1", "prosemirror-inputrules": "^1.4.0", "prosemirror-keymap": "^1.2.2", "prosemirror-model": "^1.22.3", "prosemirror-schema-list": "^1.4.1", - "prosemirror-view": "^1.34.3", + "prosemirror-view": "^1.36.0", "sortablejs": "^1.15.2", "vue": "^2.7.16" }, "devDependencies": { "@vitejs/plugin-vue2": "^2.3.1", - "eslint": "^9.11.1", + "eslint": "^9.15.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-vue": "^9.28.0", + "eslint-plugin-vue": "^9.31.0", "glob": "^11.0.0", "jsdom": "^25.0.1", "prettier": "^3.3.3", - "rollup-plugin-external-globals": "^0.12.0", - "terser": "^5.34.1", - "vite": "^5.4.8", - "vite-plugin-static-copy": "^1.0.6", - "vitest": "^2.1.1", + "rollup-plugin-external-globals": "^0.13.0", + "terser": "^5.36.0", + "vite": "^5.4.11", + "vite-plugin-static-copy": "^2.1.0", + "vitest": "^2.1.5", "vue-docgen-api": "^4.79.2", "vue-template-compiler": "^2.7.16" }, From 8d0f80c0df22048b3174584f0fceecacb5bcf993 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 20 Nov 2024 16:38:29 +0100 Subject: [PATCH 259/362] Update composer --- composer.lock | 139 +++++++------------------- vendor/composer/autoload_classmap.php | 21 +++- vendor/composer/autoload_static.php | 69 +++++++------ 3 files changed, 91 insertions(+), 138 deletions(-) diff --git a/composer.lock b/composer.lock index 580d9d07cd..3192634a63 100644 --- a/composer.lock +++ b/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": "0cc5ffc791a52ffb1f139b57e2ae953f", + "content-hash": "eb2b56fc295efd5f31cbee1371a5dece", "packages": [ { "name": "christian-riesen/base32", @@ -120,24 +120,24 @@ }, { "name": "composer/semver", - "version": "3.4.2", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", - "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { @@ -181,7 +181,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.2" + "source": "https://github.com/composer/semver/tree/3.4.3" }, "funding": [ { @@ -197,7 +197,7 @@ "type": "tidelift" } ], - "time": "2024-07-12T11:35:52+00:00" + "time": "2024-09-19T14:15:21+00:00" }, { "name": "filp/whoops", @@ -625,73 +625,6 @@ }, "time": "2024-09-11T13:17:53+00:00" }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-04-18T09:32:20+00:00" - }, { "name": "symfony/polyfill-ctype", "version": "v1.31.0", @@ -773,22 +706,21 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "a6e83bdeb3c84391d1dfe16f42e40727ce524a5c" + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a6e83bdeb3c84391d1dfe16f42e40727ce524a5c", - "reference": "a6e83bdeb3c84391d1dfe16f42e40727ce524a5c", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c36586dcf89a12315939e00ec9b4474adcb1d773", + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773", "shasum": "" }, "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" }, "suggest": { "ext-intl": "For best performance" @@ -837,7 +769,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.31.0" }, "funding": [ { @@ -853,7 +785,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-normalizer", @@ -938,20 +870,20 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", - "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -998,7 +930,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -1014,32 +946,31 @@ "type": "tidelift" } ], - "time": "2024-06-19T12:30:46+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/yaml", - "version": "v6.4.11", + "version": "v7.1.5", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "be37e7f13195e05ab84ca5269365591edd240335" + "reference": "4e561c316e135e053bd758bf3b3eb291d9919de4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/be37e7f13195e05ab84ca5269365591edd240335", - "reference": "be37e7f13195e05ab84ca5269365591edd240335", + "url": "https://api.github.com/repos/symfony/yaml/zipball/4e561c316e135e053bd758bf3b3eb291d9919de4", + "reference": "4e561c316e135e053bd758bf3b3eb291d9919de4", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-ctype": "^1.8" }, "conflict": { - "symfony/console": "<5.4" + "symfony/console": "<6.4" }, "require-dev": { - "symfony/console": "^5.4|^6.0|^7.0" + "symfony/console": "^6.4|^7.0" }, "bin": [ "Resources/bin/yaml-lint" @@ -1070,7 +1001,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.4.11" + "source": "https://github.com/symfony/yaml/tree/v7.1.5" }, "funding": [ { @@ -1086,7 +1017,7 @@ "type": "tidelift" } ], - "time": "2024-08-12T09:55:28+00:00" + "time": "2024-09-17T12:49:58+00:00" } ], "packages-dev": [], @@ -1096,7 +1027,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "php": "~8.2.0 || ~8.3.0", "ext-simplexml": "*", "ext-ctype": "*", "ext-curl": "*", @@ -1111,7 +1042,7 @@ }, "platform-dev": [], "platform-overrides": { - "php": "8.1.0" + "php": "8.2.0" }, "plugin-api-version": "2.6.0" } diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 1cad828351..765ee12590 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -23,6 +23,7 @@ 'Composer\\Semver\\VersionParser' => $vendorDir . '/composer/semver/src/VersionParser.php', 'Kirby\\Api\\Api' => $baseDir . '/src/Api/Api.php', 'Kirby\\Api\\Collection' => $baseDir . '/src/Api/Collection.php', + 'Kirby\\Api\\Controller\\Changes' => $baseDir . '/src/Api/Controller/Changes.php', 'Kirby\\Api\\Model' => $baseDir . '/src/Api/Model.php', 'Kirby\\Api\\Upload' => $baseDir . '/src/Api/Upload.php', 'Kirby\\Blueprint\\Collection' => $baseDir . '/src/Blueprint/Collection.php', @@ -151,16 +152,18 @@ 'Kirby\\ComposerInstaller\\PluginInstaller' => $vendorDir . '/getkirby/composer-installer/src/ComposerInstaller/PluginInstaller.php', 'Kirby\\Content\\Changes' => $baseDir . '/src/Content/Changes.php', 'Kirby\\Content\\Content' => $baseDir . '/src/Content/Content.php', - 'Kirby\\Content\\ContentStorageHandler' => $baseDir . '/src/Content/ContentStorageHandler.php', 'Kirby\\Content\\ContentTranslation' => $baseDir . '/src/Content/ContentTranslation.php', 'Kirby\\Content\\Field' => $baseDir . '/src/Content/Field.php', - 'Kirby\\Content\\ImmutableMemoryContentStorageHandler' => $baseDir . '/src/Content/ImmutableMemoryContentStorageHandler.php', - 'Kirby\\Content\\MemoryContentStorageHandler' => $baseDir . '/src/Content/MemoryContentStorageHandler.php', - 'Kirby\\Content\\PlainTextContentStorageHandler' => $baseDir . '/src/Content/PlainTextContentStorageHandler.php', + 'Kirby\\Content\\ImmutableMemoryStorage' => $baseDir . '/src/Content/ImmutableMemoryStorage.php', + 'Kirby\\Content\\Lock' => $baseDir . '/src/Content/Lock.php', + 'Kirby\\Content\\MemoryStorage' => $baseDir . '/src/Content/MemoryStorage.php', + 'Kirby\\Content\\PlainTextStorage' => $baseDir . '/src/Content/PlainTextStorage.php', + 'Kirby\\Content\\Storage' => $baseDir . '/src/Content/Storage.php', 'Kirby\\Content\\Translation' => $baseDir . '/src/Content/Translation.php', 'Kirby\\Content\\Translations' => $baseDir . '/src/Content/Translations.php', 'Kirby\\Content\\Version' => $baseDir . '/src/Content/Version.php', 'Kirby\\Content\\VersionId' => $baseDir . '/src/Content/VersionId.php', + 'Kirby\\Content\\VersionRules' => $baseDir . '/src/Content/VersionRules.php', 'Kirby\\Data\\Data' => $baseDir . '/src/Data/Data.php', 'Kirby\\Data\\Handler' => $baseDir . '/src/Data/Handler.php', 'Kirby\\Data\\Json' => $baseDir . '/src/Data/Json.php', @@ -202,9 +205,15 @@ 'Kirby\\Form\\Field\\LayoutField' => $baseDir . '/src/Form/Field/LayoutField.php', 'Kirby\\Form\\Fields' => $baseDir . '/src/Form/Fields.php', 'Kirby\\Form\\Form' => $baseDir . '/src/Form/Form.php', + 'Kirby\\Form\\Mixin\\Api' => $baseDir . '/src/Form/Mixin/Api.php', 'Kirby\\Form\\Mixin\\EmptyState' => $baseDir . '/src/Form/Mixin/EmptyState.php', 'Kirby\\Form\\Mixin\\Max' => $baseDir . '/src/Form/Mixin/Max.php', 'Kirby\\Form\\Mixin\\Min' => $baseDir . '/src/Form/Mixin/Min.php', + 'Kirby\\Form\\Mixin\\Model' => $baseDir . '/src/Form/Mixin/Model.php', + 'Kirby\\Form\\Mixin\\Translatable' => $baseDir . '/src/Form/Mixin/Translatable.php', + 'Kirby\\Form\\Mixin\\Validation' => $baseDir . '/src/Form/Mixin/Validation.php', + 'Kirby\\Form\\Mixin\\Value' => $baseDir . '/src/Form/Mixin/Value.php', + 'Kirby\\Form\\Mixin\\When' => $baseDir . '/src/Form/Mixin/When.php', 'Kirby\\Form\\Validations' => $baseDir . '/src/Form/Validations.php', 'Kirby\\Http\\Cookie' => $baseDir . '/src/Http/Cookie.php', 'Kirby\\Http\\Environment' => $baseDir . '/src/Http/Environment.php', @@ -247,7 +256,6 @@ 'Kirby\\Option\\OptionsQuery' => $baseDir . '/src/Option/OptionsQuery.php', 'Kirby\\Panel\\Assets' => $baseDir . '/src/Panel/Assets.php', 'Kirby\\Panel\\ChangesDialog' => $baseDir . '/src/Panel/ChangesDialog.php', - 'Kirby\\Panel\\Controller\\Changes' => $baseDir . '/src/Panel/Controller/Changes.php', 'Kirby\\Panel\\Controller\\PageTree' => $baseDir . '/src/Panel/Controller/PageTree.php', 'Kirby\\Panel\\Controller\\Search' => $baseDir . '/src/Panel/Controller/Search.php', 'Kirby\\Panel\\Dialog' => $baseDir . '/src/Panel/Dialog.php', @@ -280,6 +288,7 @@ 'Kirby\\Panel\\Ui\\Buttons\\LanguagesDropdown' => $baseDir . '/src/Panel/Ui/Buttons/LanguagesDropdown.php', 'Kirby\\Panel\\Ui\\Buttons\\PageStatusButton' => $baseDir . '/src/Panel/Ui/Buttons/PageStatusButton.php', 'Kirby\\Panel\\Ui\\Buttons\\PreviewButton' => $baseDir . '/src/Panel/Ui/Buttons/PreviewButton.php', + 'Kirby\\Panel\\Ui\\Buttons\\PreviewDropdownButton' => $baseDir . '/src/Panel/Ui/Buttons/PreviewDropdownButton.php', 'Kirby\\Panel\\Ui\\Buttons\\SettingsButton' => $baseDir . '/src/Panel/Ui/Buttons/SettingsButton.php', 'Kirby\\Panel\\Ui\\Buttons\\ViewButton' => $baseDir . '/src/Panel/Ui/Buttons/ViewButton.php', 'Kirby\\Panel\\Ui\\Buttons\\ViewButtons' => $baseDir . '/src/Panel/Ui/Buttons/ViewButtons.php', @@ -301,6 +310,8 @@ 'Kirby\\Parsley\\Schema\\Plain' => $baseDir . '/src/Parsley/Schema/Plain.php', 'Kirby\\Plugin\\Asset' => $baseDir . '/src/Plugin/Asset.php', 'Kirby\\Plugin\\Assets' => $baseDir . '/src/Plugin/Assets.php', + 'Kirby\\Plugin\\License' => $baseDir . '/src/Plugin/License.php', + 'Kirby\\Plugin\\LicenseStatus' => $baseDir . '/src/Plugin/LicenseStatus.php', 'Kirby\\Plugin\\Plugin' => $baseDir . '/src/Plugin/Plugin.php', 'Kirby\\Query\\Argument' => $baseDir . '/src/Query/Argument.php', 'Kirby\\Query\\Arguments' => $baseDir . '/src/Query/Arguments.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 579bdd0f85..1ef5089861 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -16,11 +16,11 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35 ); public static $prefixLengthsPsr4 = array ( - 'W' => + 'W' => array ( 'Whoops\\' => 7, ), - 'S' => + 'S' => array ( 'Symfony\\Polyfill\\Mbstring\\' => 26, 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33, @@ -28,97 +28,97 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35 'Symfony\\Polyfill\\Ctype\\' => 23, 'Symfony\\Component\\Yaml\\' => 23, ), - 'P' => + 'P' => array ( 'Psr\\Log\\' => 8, 'PHPMailer\\PHPMailer\\' => 20, ), - 'L' => + 'L' => array ( 'League\\ColorExtractor\\' => 22, 'Laminas\\Escaper\\' => 16, ), - 'K' => + 'K' => array ( 'Kirby\\' => 6, ), - 'C' => + 'C' => array ( 'Composer\\Semver\\' => 16, ), - 'B' => + 'B' => array ( 'Base32\\' => 7, ), ); public static $prefixDirsPsr4 = array ( - 'Whoops\\' => + 'Whoops\\' => array ( 0 => __DIR__ . '/..' . '/filp/whoops/src/Whoops', ), - 'Symfony\\Polyfill\\Mbstring\\' => + 'Symfony\\Polyfill\\Mbstring\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', ), - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => + 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer', ), - 'Symfony\\Polyfill\\Intl\\Idn\\' => + 'Symfony\\Polyfill\\Intl\\Idn\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-idn', ), - 'Symfony\\Polyfill\\Ctype\\' => + 'Symfony\\Polyfill\\Ctype\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', ), - 'Symfony\\Component\\Yaml\\' => + 'Symfony\\Component\\Yaml\\' => array ( 0 => __DIR__ . '/..' . '/symfony/yaml', ), - 'Psr\\Log\\' => + 'Psr\\Log\\' => array ( 0 => __DIR__ . '/..' . '/psr/log/src', ), - 'PHPMailer\\PHPMailer\\' => + 'PHPMailer\\PHPMailer\\' => array ( 0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src', ), - 'League\\ColorExtractor\\' => + 'League\\ColorExtractor\\' => array ( 0 => __DIR__ . '/..' . '/league/color-extractor/src', ), - 'Laminas\\Escaper\\' => + 'Laminas\\Escaper\\' => array ( 0 => __DIR__ . '/..' . '/laminas/laminas-escaper/src', ), - 'Kirby\\' => + 'Kirby\\' => array ( 0 => __DIR__ . '/../..' . '/src', 1 => __DIR__ . '/..' . '/getkirby/composer-installer/src', ), - 'Composer\\Semver\\' => + 'Composer\\Semver\\' => array ( 0 => __DIR__ . '/..' . '/composer/semver/src', ), - 'Base32\\' => + 'Base32\\' => array ( 0 => __DIR__ . '/..' . '/christian-riesen/base32/src', ), ); public static $prefixesPsr0 = array ( - 'c' => + 'c' => array ( - 'claviska' => + 'claviska' => array ( 0 => __DIR__ . '/..' . '/claviska/simpleimage/src', ), ), - 'M' => + 'M' => array ( - 'Michelf' => + 'Michelf' => array ( 0 => __DIR__ . '/..' . '/michelf/php-smartypants', ), @@ -143,6 +143,7 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35 'Composer\\Semver\\VersionParser' => __DIR__ . '/..' . '/composer/semver/src/VersionParser.php', 'Kirby\\Api\\Api' => __DIR__ . '/../..' . '/src/Api/Api.php', 'Kirby\\Api\\Collection' => __DIR__ . '/../..' . '/src/Api/Collection.php', + 'Kirby\\Api\\Controller\\Changes' => __DIR__ . '/../..' . '/src/Api/Controller/Changes.php', 'Kirby\\Api\\Model' => __DIR__ . '/../..' . '/src/Api/Model.php', 'Kirby\\Api\\Upload' => __DIR__ . '/../..' . '/src/Api/Upload.php', 'Kirby\\Blueprint\\Collection' => __DIR__ . '/../..' . '/src/Blueprint/Collection.php', @@ -271,16 +272,18 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35 'Kirby\\ComposerInstaller\\PluginInstaller' => __DIR__ . '/..' . '/getkirby/composer-installer/src/ComposerInstaller/PluginInstaller.php', 'Kirby\\Content\\Changes' => __DIR__ . '/../..' . '/src/Content/Changes.php', 'Kirby\\Content\\Content' => __DIR__ . '/../..' . '/src/Content/Content.php', - 'Kirby\\Content\\ContentStorageHandler' => __DIR__ . '/../..' . '/src/Content/ContentStorageHandler.php', 'Kirby\\Content\\ContentTranslation' => __DIR__ . '/../..' . '/src/Content/ContentTranslation.php', 'Kirby\\Content\\Field' => __DIR__ . '/../..' . '/src/Content/Field.php', - 'Kirby\\Content\\ImmutableMemoryContentStorageHandler' => __DIR__ . '/../..' . '/src/Content/ImmutableMemoryContentStorageHandler.php', - 'Kirby\\Content\\MemoryContentStorageHandler' => __DIR__ . '/../..' . '/src/Content/MemoryContentStorageHandler.php', - 'Kirby\\Content\\PlainTextContentStorageHandler' => __DIR__ . '/../..' . '/src/Content/PlainTextContentStorageHandler.php', + 'Kirby\\Content\\ImmutableMemoryStorage' => __DIR__ . '/../..' . '/src/Content/ImmutableMemoryStorage.php', + 'Kirby\\Content\\Lock' => __DIR__ . '/../..' . '/src/Content/Lock.php', + 'Kirby\\Content\\MemoryStorage' => __DIR__ . '/../..' . '/src/Content/MemoryStorage.php', + 'Kirby\\Content\\PlainTextStorage' => __DIR__ . '/../..' . '/src/Content/PlainTextStorage.php', + 'Kirby\\Content\\Storage' => __DIR__ . '/../..' . '/src/Content/Storage.php', 'Kirby\\Content\\Translation' => __DIR__ . '/../..' . '/src/Content/Translation.php', 'Kirby\\Content\\Translations' => __DIR__ . '/../..' . '/src/Content/Translations.php', 'Kirby\\Content\\Version' => __DIR__ . '/../..' . '/src/Content/Version.php', 'Kirby\\Content\\VersionId' => __DIR__ . '/../..' . '/src/Content/VersionId.php', + 'Kirby\\Content\\VersionRules' => __DIR__ . '/../..' . '/src/Content/VersionRules.php', 'Kirby\\Data\\Data' => __DIR__ . '/../..' . '/src/Data/Data.php', 'Kirby\\Data\\Handler' => __DIR__ . '/../..' . '/src/Data/Handler.php', 'Kirby\\Data\\Json' => __DIR__ . '/../..' . '/src/Data/Json.php', @@ -322,9 +325,15 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35 'Kirby\\Form\\Field\\LayoutField' => __DIR__ . '/../..' . '/src/Form/Field/LayoutField.php', 'Kirby\\Form\\Fields' => __DIR__ . '/../..' . '/src/Form/Fields.php', 'Kirby\\Form\\Form' => __DIR__ . '/../..' . '/src/Form/Form.php', + 'Kirby\\Form\\Mixin\\Api' => __DIR__ . '/../..' . '/src/Form/Mixin/Api.php', 'Kirby\\Form\\Mixin\\EmptyState' => __DIR__ . '/../..' . '/src/Form/Mixin/EmptyState.php', 'Kirby\\Form\\Mixin\\Max' => __DIR__ . '/../..' . '/src/Form/Mixin/Max.php', 'Kirby\\Form\\Mixin\\Min' => __DIR__ . '/../..' . '/src/Form/Mixin/Min.php', + 'Kirby\\Form\\Mixin\\Model' => __DIR__ . '/../..' . '/src/Form/Mixin/Model.php', + 'Kirby\\Form\\Mixin\\Translatable' => __DIR__ . '/../..' . '/src/Form/Mixin/Translatable.php', + 'Kirby\\Form\\Mixin\\Validation' => __DIR__ . '/../..' . '/src/Form/Mixin/Validation.php', + 'Kirby\\Form\\Mixin\\Value' => __DIR__ . '/../..' . '/src/Form/Mixin/Value.php', + 'Kirby\\Form\\Mixin\\When' => __DIR__ . '/../..' . '/src/Form/Mixin/When.php', 'Kirby\\Form\\Validations' => __DIR__ . '/../..' . '/src/Form/Validations.php', 'Kirby\\Http\\Cookie' => __DIR__ . '/../..' . '/src/Http/Cookie.php', 'Kirby\\Http\\Environment' => __DIR__ . '/../..' . '/src/Http/Environment.php', @@ -367,7 +376,6 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35 'Kirby\\Option\\OptionsQuery' => __DIR__ . '/../..' . '/src/Option/OptionsQuery.php', 'Kirby\\Panel\\Assets' => __DIR__ . '/../..' . '/src/Panel/Assets.php', 'Kirby\\Panel\\ChangesDialog' => __DIR__ . '/../..' . '/src/Panel/ChangesDialog.php', - 'Kirby\\Panel\\Controller\\Changes' => __DIR__ . '/../..' . '/src/Panel/Controller/Changes.php', 'Kirby\\Panel\\Controller\\PageTree' => __DIR__ . '/../..' . '/src/Panel/Controller/PageTree.php', 'Kirby\\Panel\\Controller\\Search' => __DIR__ . '/../..' . '/src/Panel/Controller/Search.php', 'Kirby\\Panel\\Dialog' => __DIR__ . '/../..' . '/src/Panel/Dialog.php', @@ -400,6 +408,7 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35 'Kirby\\Panel\\Ui\\Buttons\\LanguagesDropdown' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/LanguagesDropdown.php', 'Kirby\\Panel\\Ui\\Buttons\\PageStatusButton' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/PageStatusButton.php', 'Kirby\\Panel\\Ui\\Buttons\\PreviewButton' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/PreviewButton.php', + 'Kirby\\Panel\\Ui\\Buttons\\PreviewDropdownButton' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/PreviewDropdownButton.php', 'Kirby\\Panel\\Ui\\Buttons\\SettingsButton' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/SettingsButton.php', 'Kirby\\Panel\\Ui\\Buttons\\ViewButton' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/ViewButton.php', 'Kirby\\Panel\\Ui\\Buttons\\ViewButtons' => __DIR__ . '/../..' . '/src/Panel/Ui/Buttons/ViewButtons.php', @@ -421,6 +430,8 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35 'Kirby\\Parsley\\Schema\\Plain' => __DIR__ . '/../..' . '/src/Parsley/Schema/Plain.php', 'Kirby\\Plugin\\Asset' => __DIR__ . '/../..' . '/src/Plugin/Asset.php', 'Kirby\\Plugin\\Assets' => __DIR__ . '/../..' . '/src/Plugin/Assets.php', + 'Kirby\\Plugin\\License' => __DIR__ . '/../..' . '/src/Plugin/License.php', + 'Kirby\\Plugin\\LicenseStatus' => __DIR__ . '/../..' . '/src/Plugin/LicenseStatus.php', 'Kirby\\Plugin\\Plugin' => __DIR__ . '/../..' . '/src/Plugin/Plugin.php', 'Kirby\\Query\\Argument' => __DIR__ . '/../..' . '/src/Query/Argument.php', 'Kirby\\Query\\Arguments' => __DIR__ . '/../..' . '/src/Query/Arguments.php', From 672efd63fd2ae611e71b0705d9f87ce13714ecd0 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 20 Nov 2024 17:02:09 +0100 Subject: [PATCH 260/362] Update composer again --- composer.json | 8 +- composer.lock | 68 ++++++++--------- vendor/composer/installed.json | 74 +++++++++---------- vendor/composer/installed.php | 24 +++--- vendor/filp/whoops/composer.json | 8 +- .../src/Whoops/Handler/PrettyPageHandler.php | 2 +- vendor/filp/whoops/src/Whoops/Run.php | 2 +- .../whoops/src/Whoops/Util/TemplateHelper.php | 2 +- vendor/laminas/laminas-escaper/composer.json | 12 +-- vendor/phpmailer/phpmailer/composer.json | 3 +- .../phpmailer/phpmailer/get_oauth_token.php | 6 +- .../phpmailer/language/phpmailer.lang-es.php | 13 +++- .../phpmailer/language/phpmailer.lang-fr.php | 3 +- .../phpmailer/language/phpmailer.lang-ja.php | 14 +++- .../phpmailer/language/phpmailer.lang-ku.php | 27 +++++++ .../phpmailer/language/phpmailer.lang-ru.php | 22 ++++-- .../phpmailer/language/phpmailer.lang-tr.php | 9 ++- .../phpmailer/language/phpmailer.lang-ur.php | 30 ++++++++ .../phpmailer/src/DSNConfigurator.php | 2 +- vendor/phpmailer/phpmailer/src/Exception.php | 2 +- vendor/phpmailer/phpmailer/src/OAuth.php | 4 +- .../phpmailer/src/OAuthTokenProvider.php | 2 +- vendor/phpmailer/phpmailer/src/PHPMailer.php | 48 ++++++------ vendor/phpmailer/phpmailer/src/POP3.php | 8 +- vendor/phpmailer/phpmailer/src/SMTP.php | 44 +++++++---- 25 files changed, 266 insertions(+), 171 deletions(-) create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php diff --git a/composer.json b/composer.json index d8cf8f3506..9bd1481a5c 100644 --- a/composer.json +++ b/composer.json @@ -39,14 +39,14 @@ "christian-riesen/base32": "1.6.0", "claviska/simpleimage": "4.2.0", "composer/semver": "3.4.3", - "filp/whoops": "2.15.4", + "filp/whoops": "2.16.0", "getkirby/composer-installer": "^1.2.1", - "laminas/laminas-escaper": "2.13.0", + "laminas/laminas-escaper": "2.14.0", "michelf/php-smartypants": "1.8.1", - "phpmailer/phpmailer": "6.9.1", + "phpmailer/phpmailer": "6.9.2", "symfony/polyfill-intl-idn": "1.31.0", "symfony/polyfill-mbstring": "1.31.0", - "symfony/yaml": "7.1.5" + "symfony/yaml": "7.1.6" }, "replace": { "symfony/polyfill-php72": "*" diff --git a/composer.lock b/composer.lock index 3192634a63..3a3f857aeb 100644 --- a/composer.lock +++ b/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": "eb2b56fc295efd5f31cbee1371a5dece", + "content-hash": "b5808d2bb2e45e38633879f907895568", "packages": [ { "name": "christian-riesen/base32", @@ -201,26 +201,26 @@ }, { "name": "filp/whoops", - "version": "2.15.4", + "version": "2.16.0", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546" + "reference": "befcdc0e5dce67252aa6322d82424be928214fa2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/a139776fa3f5985a50b509f2a02ff0f709d2a546", - "reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546", + "url": "https://api.github.com/repos/filp/whoops/zipball/befcdc0e5dce67252aa6322d82424be928214fa2", + "reference": "befcdc0e5dce67252aa6322d82424be928214fa2", "shasum": "" }, "require": { - "php": "^5.5.9 || ^7.0 || ^8.0", + "php": "^7.1 || ^8.0", "psr/log": "^1.0.1 || ^2.0 || ^3.0" }, "require-dev": { - "mockery/mockery": "^0.9 || ^1.0", - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3", - "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^4.0 || ^5.0" }, "suggest": { "symfony/var-dumper": "Pretty print complex values better with var-dumper available", @@ -260,7 +260,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.15.4" + "source": "https://github.com/filp/whoops/tree/2.16.0" }, "funding": [ { @@ -268,7 +268,7 @@ "type": "github" } ], - "time": "2023-11-03T12:00:00+00:00" + "time": "2024-09-25T12:00:00+00:00" }, { "name": "getkirby/composer-installer", @@ -319,33 +319,33 @@ }, { "name": "laminas/laminas-escaper", - "version": "2.13.0", + "version": "2.14.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-escaper.git", - "reference": "af459883f4018d0f8a0c69c7a209daef3bf973ba" + "reference": "0f7cb975f4443cf22f33408925c231225cfba8cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/af459883f4018d0f8a0c69c7a209daef3bf973ba", - "reference": "af459883f4018d0f8a0c69c7a209daef3bf973ba", + "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/0f7cb975f4443cf22f33408925c231225cfba8cb", + "reference": "0f7cb975f4443cf22f33408925c231225cfba8cb", "shasum": "" }, "require": { "ext-ctype": "*", "ext-mbstring": "*", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" }, "conflict": { "zendframework/zend-escaper": "*" }, "require-dev": { - "infection/infection": "^0.27.0", - "laminas/laminas-coding-standard": "~2.5.0", + "infection/infection": "^0.27.9", + "laminas/laminas-coding-standard": "~3.0.0", "maglnet/composer-require-checker": "^3.8.0", - "phpunit/phpunit": "^9.6.7", - "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.9" + "phpunit/phpunit": "^9.6.16", + "psalm/plugin-phpunit": "^0.19.0", + "vimeo/psalm": "^5.21.1" }, "type": "library", "autoload": { @@ -377,7 +377,7 @@ "type": "community_bridge" } ], - "time": "2023-10-10T08:35:13+00:00" + "time": "2024-10-24T10:12:53+00:00" }, { "name": "league/color-extractor", @@ -496,16 +496,16 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.9.1", + "version": "v6.9.2", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "039de174cd9c17a8389754d3b877a2ed22743e18" + "reference": "a7b17b42fa4887c92146243f3d2f4ccb962af17c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/039de174cd9c17a8389754d3b877a2ed22743e18", - "reference": "039de174cd9c17a8389754d3b877a2ed22743e18", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a7b17b42fa4887c92146243f3d2f4ccb962af17c", + "reference": "a7b17b42fa4887c92146243f3d2f4ccb962af17c", "shasum": "" }, "require": { @@ -565,7 +565,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.9.1" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.9.2" }, "funding": [ { @@ -573,7 +573,7 @@ "type": "github" } ], - "time": "2023-11-25T22:23:28+00:00" + "time": "2024-10-09T10:07:50+00:00" }, { "name": "psr/log", @@ -950,16 +950,16 @@ }, { "name": "symfony/yaml", - "version": "v7.1.5", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "4e561c316e135e053bd758bf3b3eb291d9919de4" + "reference": "3ced3f29e4f0d6bce2170ff26719f1fe9aacc671" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/4e561c316e135e053bd758bf3b3eb291d9919de4", - "reference": "4e561c316e135e053bd758bf3b3eb291d9919de4", + "url": "https://api.github.com/repos/symfony/yaml/zipball/3ced3f29e4f0d6bce2170ff26719f1fe9aacc671", + "reference": "3ced3f29e4f0d6bce2170ff26719f1fe9aacc671", "shasum": "" }, "require": { @@ -1001,7 +1001,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v7.1.5" + "source": "https://github.com/symfony/yaml/tree/v7.1.6" }, "funding": [ { @@ -1017,7 +1017,7 @@ "type": "tidelift" } ], - "time": "2024-09-17T12:49:58+00:00" + "time": "2024-09-25T14:20:29+00:00" } ], "packages-dev": [], diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index af894f9d6e..a08668363e 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -204,33 +204,33 @@ }, { "name": "filp/whoops", - "version": "2.15.4", - "version_normalized": "2.15.4.0", + "version": "2.16.0", + "version_normalized": "2.16.0.0", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546" + "reference": "befcdc0e5dce67252aa6322d82424be928214fa2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/a139776fa3f5985a50b509f2a02ff0f709d2a546", - "reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546", + "url": "https://api.github.com/repos/filp/whoops/zipball/befcdc0e5dce67252aa6322d82424be928214fa2", + "reference": "befcdc0e5dce67252aa6322d82424be928214fa2", "shasum": "" }, "require": { - "php": "^5.5.9 || ^7.0 || ^8.0", + "php": "^7.1 || ^8.0", "psr/log": "^1.0.1 || ^2.0 || ^3.0" }, "require-dev": { - "mockery/mockery": "^0.9 || ^1.0", - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3", - "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^4.0 || ^5.0" }, "suggest": { "symfony/var-dumper": "Pretty print complex values better with var-dumper available", "whoops/soap": "Formats errors as SOAP responses" }, - "time": "2023-11-03T12:00:00+00:00", + "time": "2024-09-25T12:00:00+00:00", "type": "library", "extra": { "branch-alias": { @@ -266,7 +266,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.15.4" + "source": "https://github.com/filp/whoops/tree/2.16.0" }, "funding": [ { @@ -328,36 +328,36 @@ }, { "name": "laminas/laminas-escaper", - "version": "2.13.0", - "version_normalized": "2.13.0.0", + "version": "2.14.0", + "version_normalized": "2.14.0.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-escaper.git", - "reference": "af459883f4018d0f8a0c69c7a209daef3bf973ba" + "reference": "0f7cb975f4443cf22f33408925c231225cfba8cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/af459883f4018d0f8a0c69c7a209daef3bf973ba", - "reference": "af459883f4018d0f8a0c69c7a209daef3bf973ba", + "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/0f7cb975f4443cf22f33408925c231225cfba8cb", + "reference": "0f7cb975f4443cf22f33408925c231225cfba8cb", "shasum": "" }, "require": { "ext-ctype": "*", "ext-mbstring": "*", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" }, "conflict": { "zendframework/zend-escaper": "*" }, "require-dev": { - "infection/infection": "^0.27.0", - "laminas/laminas-coding-standard": "~2.5.0", + "infection/infection": "^0.27.9", + "laminas/laminas-coding-standard": "~3.0.0", "maglnet/composer-require-checker": "^3.8.0", - "phpunit/phpunit": "^9.6.7", - "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.9" + "phpunit/phpunit": "^9.6.16", + "psalm/plugin-phpunit": "^0.19.0", + "vimeo/psalm": "^5.21.1" }, - "time": "2023-10-10T08:35:13+00:00", + "time": "2024-10-24T10:12:53+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -514,17 +514,17 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.9.1", - "version_normalized": "6.9.1.0", + "version": "v6.9.2", + "version_normalized": "6.9.2.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "039de174cd9c17a8389754d3b877a2ed22743e18" + "reference": "a7b17b42fa4887c92146243f3d2f4ccb962af17c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/039de174cd9c17a8389754d3b877a2ed22743e18", - "reference": "039de174cd9c17a8389754d3b877a2ed22743e18", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a7b17b42fa4887c92146243f3d2f4ccb962af17c", + "reference": "a7b17b42fa4887c92146243f3d2f4ccb962af17c", "shasum": "" }, "require": { @@ -554,7 +554,7 @@ "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, - "time": "2023-11-25T22:23:28+00:00", + "time": "2024-10-09T10:07:50+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -586,7 +586,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.9.1" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.9.2" }, "funding": [ { @@ -986,17 +986,17 @@ }, { "name": "symfony/yaml", - "version": "v7.1.5", - "version_normalized": "7.1.5.0", + "version": "v7.1.6", + "version_normalized": "7.1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "4e561c316e135e053bd758bf3b3eb291d9919de4" + "reference": "3ced3f29e4f0d6bce2170ff26719f1fe9aacc671" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/4e561c316e135e053bd758bf3b3eb291d9919de4", - "reference": "4e561c316e135e053bd758bf3b3eb291d9919de4", + "url": "https://api.github.com/repos/symfony/yaml/zipball/3ced3f29e4f0d6bce2170ff26719f1fe9aacc671", + "reference": "3ced3f29e4f0d6bce2170ff26719f1fe9aacc671", "shasum": "" }, "require": { @@ -1009,7 +1009,7 @@ "require-dev": { "symfony/console": "^6.4|^7.0" }, - "time": "2024-09-17T12:49:58+00:00", + "time": "2024-09-25T14:20:29+00:00", "bin": [ "Resources/bin/yaml-lint" ], @@ -1040,7 +1040,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v7.1.5" + "source": "https://github.com/symfony/yaml/tree/v7.1.6" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 3d1cb149ca..4d6180ed13 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -38,9 +38,9 @@ 'dev_requirement' => false, ), 'filp/whoops' => array( - 'pretty_version' => '2.15.4', - 'version' => '2.15.4.0', - 'reference' => 'a139776fa3f5985a50b509f2a02ff0f709d2a546', + 'pretty_version' => '2.16.0', + 'version' => '2.16.0.0', + 'reference' => 'befcdc0e5dce67252aa6322d82424be928214fa2', 'type' => 'library', 'install_path' => __DIR__ . '/../filp/whoops', 'aliases' => array(), @@ -65,9 +65,9 @@ 'dev_requirement' => false, ), 'laminas/laminas-escaper' => array( - 'pretty_version' => '2.13.0', - 'version' => '2.13.0.0', - 'reference' => 'af459883f4018d0f8a0c69c7a209daef3bf973ba', + 'pretty_version' => '2.14.0', + 'version' => '2.14.0.0', + 'reference' => '0f7cb975f4443cf22f33408925c231225cfba8cb', 'type' => 'library', 'install_path' => __DIR__ . '/../laminas/laminas-escaper', 'aliases' => array(), @@ -98,9 +98,9 @@ 'dev_requirement' => false, ), 'phpmailer/phpmailer' => array( - 'pretty_version' => 'v6.9.1', - 'version' => '6.9.1.0', - 'reference' => '039de174cd9c17a8389754d3b877a2ed22743e18', + 'pretty_version' => 'v6.9.2', + 'version' => '6.9.2.0', + 'reference' => 'a7b17b42fa4887c92146243f3d2f4ccb962af17c', 'type' => 'library', 'install_path' => __DIR__ . '/../phpmailer/phpmailer', 'aliases' => array(), @@ -158,9 +158,9 @@ ), ), 'symfony/yaml' => array( - 'pretty_version' => 'v7.1.5', - 'version' => '7.1.5.0', - 'reference' => '4e561c316e135e053bd758bf3b3eb291d9919de4', + 'pretty_version' => 'v7.1.6', + 'version' => '7.1.6.0', + 'reference' => '3ced3f29e4f0d6bce2170ff26719f1fe9aacc671', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), diff --git a/vendor/filp/whoops/composer.json b/vendor/filp/whoops/composer.json index 06b5c756bf..c72fab0015 100644 --- a/vendor/filp/whoops/composer.json +++ b/vendor/filp/whoops/composer.json @@ -15,13 +15,13 @@ "test": "phpunit --testdox tests" }, "require": { - "php": "^5.5.9 || ^7.0 || ^8.0", + "php": "^7.1 || ^8.0", "psr/log": "^1.0.1 || ^2.0 || ^3.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3", - "mockery/mockery": "^0.9 || ^1.0", - "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", + "mockery/mockery": "^1.0", + "symfony/var-dumper": "^4.0 || ^5.0" }, "suggest": { "symfony/var-dumper": "Pretty print complex values better with var-dumper available", diff --git a/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php b/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php index 167407e81a..b739ac0696 100644 --- a/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php +++ b/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php @@ -383,7 +383,7 @@ public function addDataTableCallback($label, /* callable */ $callback) throw new InvalidArgumentException('Expecting callback argument to be callable'); } - $this->extraTables[$label] = function (\Whoops\Inspector\InspectorInterface $inspector = null) use ($callback) { + $this->extraTables[$label] = function (?\Whoops\Inspector\InspectorInterface $inspector = null) use ($callback) { try { $result = call_user_func($callback, $inspector); diff --git a/vendor/filp/whoops/src/Whoops/Run.php b/vendor/filp/whoops/src/Whoops/Run.php index 08627680fe..7be63affc2 100644 --- a/vendor/filp/whoops/src/Whoops/Run.php +++ b/vendor/filp/whoops/src/Whoops/Run.php @@ -81,7 +81,7 @@ final class Run implements RunInterface */ private $frameFilters = []; - public function __construct(SystemFacade $system = null) + public function __construct(?SystemFacade $system = null) { $this->system = $system ?: new SystemFacade; $this->inspectorFactory = new InspectorFactory(); diff --git a/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php b/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php index 8e4df32802..5612c0b771 100644 --- a/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php +++ b/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php @@ -233,7 +233,7 @@ public function slug($original) * * @param string $template */ - public function render($template, array $additionalVariables = null) + public function render($template, ?array $additionalVariables = null) { $variables = $this->getVariables(); diff --git a/vendor/laminas/laminas-escaper/composer.json b/vendor/laminas/laminas-escaper/composer.json index 16cf063377..38f386956a 100644 --- a/vendor/laminas/laminas-escaper/composer.json +++ b/vendor/laminas/laminas-escaper/composer.json @@ -29,17 +29,17 @@ "extra": { }, "require": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", "ext-ctype": "*", "ext-mbstring": "*" }, "require-dev": { - "infection/infection": "^0.27.0", - "laminas/laminas-coding-standard": "~2.5.0", + "infection/infection": "^0.27.9", + "laminas/laminas-coding-standard": "~3.0.0", "maglnet/composer-require-checker": "^3.8.0", - "phpunit/phpunit": "^9.6.7", - "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.9" + "phpunit/phpunit": "^9.6.16", + "psalm/plugin-phpunit": "^0.19.0", + "vimeo/psalm": "^5.21.1" }, "autoload": { "psr-4": { diff --git a/vendor/phpmailer/phpmailer/composer.json b/vendor/phpmailer/phpmailer/composer.json index fa170a0bbb..7b008b7c57 100644 --- a/vendor/phpmailer/phpmailer/composer.json +++ b/vendor/phpmailer/phpmailer/composer.json @@ -28,7 +28,8 @@ "config": { "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true - } + }, + "lock": false }, "require": { "php": ">=5.5.0", diff --git a/vendor/phpmailer/phpmailer/get_oauth_token.php b/vendor/phpmailer/phpmailer/get_oauth_token.php index cda0445c6b..0e54a00b63 100644 --- a/vendor/phpmailer/phpmailer/get_oauth_token.php +++ b/vendor/phpmailer/phpmailer/get_oauth_token.php @@ -12,7 +12,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -36,7 +36,7 @@ * Aliases for League Provider Classes * Make sure you have added these to your composer.json and run `composer install` * Plenty to choose from here: - * @see http://oauth2-client.thephpleague.com/providers/thirdparty/ + * @see https://oauth2-client.thephpleague.com/providers/thirdparty/ */ //@see https://github.com/thephpleague/oauth2-google use League\OAuth2\Client\Provider\Google; @@ -178,5 +178,5 @@ ); //Use this to interact with an API on the users behalf //Use this to get a new access token if the old one expires - echo 'Refresh Token: ', $token->getRefreshToken(); + echo 'Refresh Token: ', htmlspecialchars($token->getRefreshToken()); } diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php index 6992041873..4e74bfb7b8 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php @@ -5,27 +5,32 @@ * @package PHPMailer * @author Matt Sturdy * @author Crystopher Glodzienski Cardoso + * @author Daniel Cruz */ $PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.'; +$PHPMAILER_LANG['buggy_php'] = 'Tu versión de PHP está afectada por un bug que puede resultar en mensajes corruptos. Para arreglarlo, cambia a enviar usando SMTP, deshabilita la opción mail.add_x_header en tu php.ini, cambia a MacOS o Linux, o actualiza tu PHP a la versión 7.0.17+ o 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'Error SMTP: Imposible conectar al servidor SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.'; $PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío.'; $PHPMAILER_LANG['encoding'] = 'Codificación desconocida: '; $PHPMAILER_LANG['execute'] = 'Imposible ejecutar: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; $PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: '; $PHPMAILER_LANG['file_open'] = 'Error de Archivo: Imposible abrir el archivo: '; $PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: '; $PHPMAILER_LANG['instantiate'] = 'Imposible crear una instancia de la función Mail.'; $PHPMAILER_LANG['invalid_address'] = 'Imposible enviar: dirección de email inválido: '; +$PHPMAILER_LANG['invalid_header'] = 'Nombre o valor de encabezado no válido'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Hostentry inválido: '; +$PHPMAILER_LANG['invalid_host'] = 'Host inválido: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.'; $PHPMAILER_LANG['provide_address'] = 'Debe proporcionar al menos una dirección de email de destino.'; $PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: '; $PHPMAILER_LANG['signing'] = 'Error al firmar: '; +$PHPMAILER_LANG['smtp_code'] = 'Código del servidor SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Información adicional del servidor SMTP: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detalle: '; $PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; $PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; -$PHPMAILER_LANG['smtp_code'] = 'Código del servidor SMTP: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Información adicional del servidor SMTP: '; -$PHPMAILER_LANG['invalid_header'] = 'Nombre o valor de encabezado no válido'; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php index 0d367fcf88..a6d582d833 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php @@ -6,7 +6,6 @@ * Some French punctuation requires a thin non-breaking space (U+202F) character before it, * for example before a colon or exclamation mark. * There is one of these characters between these quotes: " " - * @see http://unicode.org/udhr/n/notes_fra.html */ $PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : échec de l’authentification.'; @@ -31,7 +30,7 @@ $PHPMAILER_LANG['signing'] = 'Erreur de signature : '; $PHPMAILER_LANG['smtp_code'] = 'Code SMTP : '; $PHPMAILER_LANG['smtp_code_ex'] = 'Informations supplémentaires SMTP : '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'La fonction SMTP connect() a échouée.'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'La fonction SMTP connect() a échoué.'; $PHPMAILER_LANG['smtp_detail'] = 'Détails : '; $PHPMAILER_LANG['smtp_error'] = 'Erreur du serveur SMTP : '; $PHPMAILER_LANG['variable_set'] = 'Impossible d’initialiser ou de réinitialiser une variable : '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php index c76f5264c9..d01869cec8 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php @@ -3,27 +3,35 @@ /** * Japanese PHPMailer language file: refer to English translation for definitive list * @package PHPMailer - * @author Mitsuhiro Yoshida + * @author Mitsuhiro Yoshida * @author Yoshi Sakai * @author Arisophy + * @author ARAKI Musashi */ $PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。'; +$PHPMAILER_LANG['buggy_php'] = 'ご利用のバージョンのPHPには不具合があり、メッセージが破損するおそれがあります。問題の解決は以下のいずれかを行ってください。SMTPでの送信に切り替える。php.iniのmail.add_x_headerをoffにする。MacOSまたはLinuxに切り替える。PHPバージョン7.0.17以降または7.1.3以降にアップグレードする。'; $PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。'; $PHPMAILER_LANG['empty_message'] = 'メール本文が空です。'; $PHPMAILER_LANG['encoding'] = '不明なエンコーディング: '; $PHPMAILER_LANG['execute'] = '実行できませんでした: '; +$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: '; $PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: '; $PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: '; $PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: '; $PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。'; $PHPMAILER_LANG['invalid_address'] = '不正なメールアドレス: '; -$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; +$PHPMAILER_LANG['invalid_header'] = '不正なヘッダー名またはその内容'; +$PHPMAILER_LANG['invalid_hostentry'] = '不正なホストエントリー: '; +$PHPMAILER_LANG['invalid_host'] = '不正なホスト: '; $PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。'; +$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: '; $PHPMAILER_LANG['signing'] = '署名エラー: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTPコード: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'SMTP追加情報: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP接続に失敗しました。'; +$PHPMAILER_LANG['smtp_detail'] = '詳細: '; $PHPMAILER_LANG['smtp_error'] = 'SMTPサーバーエラー: '; $PHPMAILER_LANG['variable_set'] = '変数が存在しません: '; -$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php new file mode 100644 index 0000000000..cf3bda69f2 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'هەڵەی SMTP : نەتوانرا کۆدەکە پشتڕاست بکرێتەوە '; +$PHPMAILER_LANG['connect_host'] = 'هەڵەی SMTP: نەتوانرا پەیوەندی بە سێرڤەرەوە بکات SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'هەڵەی SMTP: ئەو زانیاریانە قبوڵ نەکرا.'; +$PHPMAILER_LANG['empty_message'] = 'پەیامەکە بەتاڵە'; +$PHPMAILER_LANG['encoding'] = 'کۆدکردنی نەزانراو : '; +$PHPMAILER_LANG['execute'] = 'ناتوانرێت جێبەجێ بکرێت: '; +$PHPMAILER_LANG['file_access'] = 'ناتوانرێت دەستت بگات بە فایلەکە: '; +$PHPMAILER_LANG['file_open'] = 'هەڵەی پەڕگە(فایل): ناتوانرێت بکرێتەوە: '; +$PHPMAILER_LANG['from_failed'] = 'هەڵە لە ئاستی ناونیشانی نێرەر: '; +$PHPMAILER_LANG['instantiate'] = 'ناتوانرێت خزمەتگوزاری پۆستە پێشکەش بکرێت.'; +$PHPMAILER_LANG['invalid_address'] = 'نەتوانرا بنێردرێت ، چونکە ناونیشانی ئیمەیڵەکە نادروستە: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' مەیلەر پشتگیری ناکات'; +$PHPMAILER_LANG['provide_address'] = 'دەبێت ناونیشانی ئیمەیڵی لانیکەم یەک وەرگر دابین بکرێت.'; +$PHPMAILER_LANG['recipients_failed'] = ' هەڵەی SMTP: ئەم هەڵانەی خوارەوەشکستی هێنا لە ناردن بۆ هەردووکیان: '; +$PHPMAILER_LANG['signing'] = 'هەڵەی واژۆ: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect()پەیوەندی شکستی هێنا .'; +$PHPMAILER_LANG['smtp_error'] = 'هەڵەی ئاستی سێرڤەری SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'ناتوانرێت بیگۆڕیت یان دوبارە بینێریتەوە: '; +$PHPMAILER_LANG['extension_missing'] = 'درێژکراوە نەماوە: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php index 8c8c5e8177..8013f37c4d 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php @@ -5,24 +5,32 @@ * @package PHPMailer * @author Alexey Chumakov * @author Foster Snowhill + * @author ProjectSoft */ -$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; +$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: не удалось пройти аутентификацию.'; +$PHPMAILER_LANG['buggy_php'] = 'В вашей версии PHP есть ошибка, которая может привести к повреждению сообщений. Чтобы исправить, переключитесь на отправку по SMTP, отключите опцию mail.add_x_header в ваш php.ini, переключитесь на MacOS или Linux или обновите PHP до версии 7.0.17+ или 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к SMTP-серверу.'; $PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.'; +$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение'; $PHPMAILER_LANG['encoding'] = 'Неизвестная кодировка: '; $PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: '; +$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: '; $PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: '; $PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удаётся открыть файл: '; $PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: '; $PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail().'; -$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один email-адрес получателя.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.'; -$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: не удалась отправка таким адресатам: '; -$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение'; $PHPMAILER_LANG['invalid_address'] = 'Не отправлено из-за неправильного формата email-адреса: '; +$PHPMAILER_LANG['invalid_header'] = 'Неверное имя или значение заголовка'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Неверная запись хоста: '; +$PHPMAILER_LANG['invalid_host'] = 'Неверный хост: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.'; +$PHPMAILER_LANG['provide_address'] = 'Вы должны указать хотя бы один адрес электронной почты получателя.'; +$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: Ошибка следующих получателей: '; $PHPMAILER_LANG['signing'] = 'Ошибка подписи: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером'; +$PHPMAILER_LANG['smtp_code'] = 'Код SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Дополнительная информация SMTP: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером.'; +$PHPMAILER_LANG['smtp_detail'] = 'Детали: '; $PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: '; $PHPMAILER_LANG['variable_set'] = 'Невозможно установить или сбросить переменную: '; -$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php index f938f8020e..3c45bc1c35 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php @@ -11,21 +11,28 @@ */ $PHPMAILER_LANG['authenticate'] = 'SMTP Hatası: Oturum açılamadı.'; +$PHPMAILER_LANG['buggy_php'] = 'PHP sürümünüz iletilerin bozulmasına neden olabilecek bir hatadan etkileniyor. Bunu düzeltmek için, SMTP kullanarak göndermeye geçin, mail.add_x_header seçeneğini devre dışı bırakın php.ini dosyanızdaki mail.add_x_header seçeneğini devre dışı bırakın, MacOS veya Linux geçin veya PHP sürümünü 7.0.17+ veya 7.1.3+ sürümüne yükseltin,'; $PHPMAILER_LANG['connect_host'] = 'SMTP Hatası: SMTP sunucusuna bağlanılamadı.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP Hatası: Veri kabul edilmedi.'; $PHPMAILER_LANG['empty_message'] = 'Mesajın içeriği boş'; $PHPMAILER_LANG['encoding'] = 'Bilinmeyen karakter kodlama: '; $PHPMAILER_LANG['execute'] = 'Çalıştırılamadı: '; +$PHPMAILER_LANG['extension_missing'] = 'Eklenti bulunamadı: '; $PHPMAILER_LANG['file_access'] = 'Dosyaya erişilemedi: '; $PHPMAILER_LANG['file_open'] = 'Dosya Hatası: Dosya açılamadı: '; $PHPMAILER_LANG['from_failed'] = 'Belirtilen adreslere gönderme başarısız: '; $PHPMAILER_LANG['instantiate'] = 'Örnek e-posta fonksiyonu oluşturulamadı.'; $PHPMAILER_LANG['invalid_address'] = 'Geçersiz e-posta adresi: '; +$PHPMAILER_LANG['invalid_header'] = 'Geçersiz başlık adı veya değeri: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Geçersiz ana bilgisayar girişi: '; +$PHPMAILER_LANG['invalid_host'] = 'Geçersiz ana bilgisayar: '; $PHPMAILER_LANG['mailer_not_supported'] = ' e-posta kütüphanesi desteklenmiyor.'; $PHPMAILER_LANG['provide_address'] = 'En az bir alıcı e-posta adresi belirtmelisiniz.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Hatası: Belirtilen alıcılara ulaşılamadı: '; $PHPMAILER_LANG['signing'] = 'İmzalama hatası: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP kodu: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'ek SMTP bilgileri: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP connect() fonksiyonu başarısız.'; +$PHPMAILER_LANG['smtp_detail'] = 'SMTP SMTP Detayı: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP sunucu hatası: '; $PHPMAILER_LANG['variable_set'] = 'Değişken ayarlanamadı ya da sıfırlanamadı: '; -$PHPMAILER_LANG['extension_missing'] = 'Eklenti bulunamadı: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php new file mode 100644 index 0000000000..0b9de0f127 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php @@ -0,0 +1,30 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP خرابی: تصدیق کرنے سے قاصر۔'; +$PHPMAILER_LANG['connect_host'] = 'SMTP خرابی: سرور سے منسلک ہونے سے قاصر۔'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP خرابی: ڈیٹا قبول نہیں کیا گیا۔'; +$PHPMAILER_LANG['empty_message'] = 'پیغام کی باڈی خالی ہے۔'; +$PHPMAILER_LANG['encoding'] = 'نامعلوم انکوڈنگ: '; +$PHPMAILER_LANG['execute'] = 'عمل کرنے کے قابل نہیں '; +$PHPMAILER_LANG['file_access'] = 'فائل تک رسائی سے قاصر:'; +$PHPMAILER_LANG['file_open'] = 'فائل کی خرابی: فائل کو کھولنے سے قاصر:'; +$PHPMAILER_LANG['from_failed'] = 'درج ذیل بھیجنے والے کا پتہ ناکام ہو گیا:'; +$PHPMAILER_LANG['instantiate'] = 'میل فنکشن کی مثال بنانے سے قاصر۔'; +$PHPMAILER_LANG['invalid_address'] = 'بھیجنے سے قاصر: غلط ای میل پتہ:'; +$PHPMAILER_LANG['mailer_not_supported'] = ' میلر تعاون یافتہ نہیں ہے۔'; +$PHPMAILER_LANG['provide_address'] = 'آپ کو کم از کم ایک منزل کا ای میل پتہ فراہم کرنا چاہیے۔'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP خرابی: درج ذیل پتہ پر نہیں بھیجا جاسکا: '; +$PHPMAILER_LANG['signing'] = 'دستخط کی خرابی: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP ملنا ناکام ہوا'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP سرور کی خرابی: '; +$PHPMAILER_LANG['variable_set'] = 'متغیر سیٹ نہیں کیا جا سکا: '; +$PHPMAILER_LANG['extension_missing'] = 'ایکٹینشن موجود نہیں ہے۔ '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP سرور کوڈ: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'اضافی SMTP سرور کی معلومات:'; +$PHPMAILER_LANG['invalid_header'] = 'غلط ہیڈر کا نام یا قدر'; diff --git a/vendor/phpmailer/phpmailer/src/DSNConfigurator.php b/vendor/phpmailer/phpmailer/src/DSNConfigurator.php index 566c9618f5..7058c1f05e 100644 --- a/vendor/phpmailer/phpmailer/src/DSNConfigurator.php +++ b/vendor/phpmailer/phpmailer/src/DSNConfigurator.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2023 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. diff --git a/vendor/phpmailer/phpmailer/src/Exception.php b/vendor/phpmailer/phpmailer/src/Exception.php index 52eaf95158..09c1a2cfef 100644 --- a/vendor/phpmailer/phpmailer/src/Exception.php +++ b/vendor/phpmailer/phpmailer/src/Exception.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. diff --git a/vendor/phpmailer/phpmailer/src/OAuth.php b/vendor/phpmailer/phpmailer/src/OAuth.php index c1d5b77623..a7e958860c 100644 --- a/vendor/phpmailer/phpmailer/src/OAuth.php +++ b/vendor/phpmailer/phpmailer/src/OAuth.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -29,7 +29,7 @@ * OAuth - OAuth2 authentication wrapper class. * Uses the oauth2-client package from the League of Extraordinary Packages. * - * @see http://oauth2-client.thephpleague.com + * @see https://oauth2-client.thephpleague.com * * @author Marcus Bointon (Synchro/coolbru) */ diff --git a/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php b/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php index 1155507435..cbda1a1296 100644 --- a/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php +++ b/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. diff --git a/vendor/phpmailer/phpmailer/src/PHPMailer.php b/vendor/phpmailer/phpmailer/src/PHPMailer.php index ba4bcd4728..12da10354f 100644 --- a/vendor/phpmailer/phpmailer/src/PHPMailer.php +++ b/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -152,8 +152,7 @@ class PHPMailer * Only supported in simple alt or alt_inline message types * To generate iCal event structures, use classes like EasyPeasyICS or iCalcreator. * - * @see http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/ - * @see http://kigkonsult.se/iCalcreator/ + * @see https://kigkonsult.se/iCalcreator/ * * @var string */ @@ -358,7 +357,7 @@ class PHPMailer public $AuthType = ''; /** - * SMTP SMTPXClient command attibutes + * SMTP SMTPXClient command attributes * * @var array */ @@ -468,7 +467,7 @@ class PHPMailer * Only applicable when sending via SMTP. * * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path - * @see http://www.postfix.org/VERP_README.html Postfix VERP info + * @see https://www.postfix.org/VERP_README.html Postfix VERP info * * @var bool */ @@ -551,10 +550,10 @@ class PHPMailer * The function that handles the result of the send email action. * It is called out by send() for each email sent. * - * Value can be any php callable: http://www.php.net/is_callable + * Value can be any php callable: https://www.php.net/is_callable * * Parameters: - * bool $result result of the send action + * bool $result result of the send action * array $to email addresses of the recipients * array $cc cc email addresses * array $bcc bcc email addresses @@ -757,7 +756,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.9.1'; + const VERSION = '6.9.2'; /** * Error severity: message only, continue processing. @@ -903,7 +902,7 @@ protected function edebug($str) } //Is this a PSR-3 logger? if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) { - $this->Debugoutput->debug($str); + $this->Debugoutput->debug(rtrim($str, "\r\n")); return; } @@ -1072,7 +1071,7 @@ public function addReplyTo($address, $name = '') * be modified after calling this function), addition of such addresses is delayed until send(). * Addresses that have been added already return false, but do not throw exceptions. * - * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' + * @param string $kind One of 'to', 'cc', 'bcc', or 'Reply-To' * @param string $address The email address * @param string $name An optional username associated with the address * @@ -1212,7 +1211,7 @@ protected function addAnAddress($kind, $address, $name = '') * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available. * Note that quotes in the name part are removed. * - * @see http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation + * @see https://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation * * @param string $addrstr The address list string * @param bool $useimap Whether to use the IMAP extension to parse the list @@ -1407,7 +1406,6 @@ public static function validateAddress($address, $patternselect = null) * * IPv6 literals: 'first.last@[IPv6:a1::]' * Not all of these will necessarily work for sending! * - * @see http://squiloople.com/2009/12/20/email-address-validation/ * @copyright 2009-2010 Michael Rushton * Feel free to use and redistribute this code. But please keep this copyright notice. */ @@ -1734,9 +1732,8 @@ protected function sendmailSend($header, $body) //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver //A space after `-f` is optional, but there is a long history of its presence //causing problems, so we don't use one - //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html - //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html - //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html + //Exim docs: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html + //Sendmail docs: https://www.sendmail.org/~ca/email/man/sendmail.html //Example problem: https://www.drupal.org/node/1057954 //PHP 5.6 workaround @@ -1901,7 +1898,7 @@ protected static function fileIsAccessible($path) /** * Send mail using the PHP mail() function. * - * @see http://www.php.net/manual/en/book.mail.php + * @see https://www.php.net/manual/en/book.mail.php * * @param string $header The message headers * @param string $body The message body @@ -1931,9 +1928,8 @@ protected function mailSend($header, $body) //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver //A space after `-f` is optional, but there is a long history of its presence //causing problems, so we don't use one - //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html - //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html - //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html + //Exim docs: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html + //Sendmail docs: https://www.sendmail.org/~ca/email/man/sendmail.html //Example problem: https://www.drupal.org/node/1057954 //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. @@ -3634,7 +3630,7 @@ public function has8bitChars($text) * without breaking lines within a character. * Adapted from a function by paravoid. * - * @see http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 + * @see https://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 * * @param string $str multi-byte text to wrap encode * @param string $linebreak string to use as linefeed/end-of-line @@ -3690,7 +3686,7 @@ public function encodeQP($string) /** * Encode a string using Q encoding. * - * @see http://tools.ietf.org/html/rfc2047#section-4.2 + * @see https://www.rfc-editor.org/rfc/rfc2047#section-4.2 * * @param string $str the text to encode * @param string $position Where the text is going to be used, see the RFC for what that means @@ -4228,7 +4224,7 @@ protected function serverHostname() $result = $_SERVER['SERVER_NAME']; } elseif (function_exists('gethostname') && gethostname() !== false) { $result = gethostname(); - } elseif (php_uname('n') !== false) { + } elseif (php_uname('n') !== '') { $result = php_uname('n'); } if (!static::isValidHost($result)) { @@ -4253,7 +4249,7 @@ public static function isValidHost($host) empty($host) || !is_string($host) || strlen($host) > 256 - || !preg_match('/^([a-zA-Z\d.-]*|\[[a-fA-F\d:]+\])$/', $host) + || !preg_match('/^([a-z\d.-]*|\[[a-f\d:]+\])$/i', $host) ) { return false; } @@ -4267,8 +4263,8 @@ public static function isValidHost($host) //Is it a valid IPv4 address? return filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false; } - //Is it a syntactically valid hostname (when embeded in a URL)? - return filter_var('http://' . $host, FILTER_VALIDATE_URL) !== false; + //Is it a syntactically valid hostname (when embedded in a URL)? + return filter_var('https://' . $host, FILTER_VALIDATE_URL) !== false; } /** @@ -4679,7 +4675,7 @@ public static function filenameToType($filename) * Multi-byte-safe pathinfo replacement. * Drop-in replacement for pathinfo(), but multibyte- and cross-platform-safe. * - * @see http://www.php.net/manual/en/function.pathinfo.php#107461 + * @see https://www.php.net/manual/en/function.pathinfo.php#107461 * * @param string $path A filename or path, does not need to exist as a file * @param int|string $options Either a PATHINFO_* constant, diff --git a/vendor/phpmailer/phpmailer/src/POP3.php b/vendor/phpmailer/phpmailer/src/POP3.php index 7b25fdd7e8..697c96126f 100644 --- a/vendor/phpmailer/phpmailer/src/POP3.php +++ b/vendor/phpmailer/phpmailer/src/POP3.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -46,7 +46,7 @@ class POP3 * * @var string */ - const VERSION = '6.9.1'; + const VERSION = '6.9.2'; /** * Default POP3 port number. @@ -250,7 +250,9 @@ public function connect($host, $port = false, $tval = 30) //On Windows this will raise a PHP Warning error if the hostname doesn't exist. //Rather than suppress it with @fsockopen, capture it cleanly instead - set_error_handler([$this, 'catchWarning']); + set_error_handler(function () { + call_user_func_array([$this, 'catchWarning'], func_get_args()); + }); if (false === $port) { $port = static::DEFAULT_PORT; diff --git a/vendor/phpmailer/phpmailer/src/SMTP.php b/vendor/phpmailer/phpmailer/src/SMTP.php index 1b5b00771c..5b238b5279 100644 --- a/vendor/phpmailer/phpmailer/src/SMTP.php +++ b/vendor/phpmailer/phpmailer/src/SMTP.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -35,7 +35,7 @@ class SMTP * * @var string */ - const VERSION = '6.9.1'; + const VERSION = '6.9.2'; /** * SMTP line break constant. @@ -152,8 +152,8 @@ class SMTP /** * Whether to use VERP. * - * @see http://en.wikipedia.org/wiki/Variable_envelope_return_path - * @see http://www.postfix.org/VERP_README.html Info on VERP + * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path + * @see https://www.postfix.org/VERP_README.html Info on VERP * * @var bool */ @@ -164,7 +164,7 @@ class SMTP * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure. * - * @see http://tools.ietf.org/html/rfc2821#section-4.5.3.2 + * @see https://www.rfc-editor.org/rfc/rfc2821#section-4.5.3.2 * * @var int */ @@ -187,12 +187,12 @@ class SMTP */ protected $smtp_transaction_id_patterns = [ 'exim' => '/[\d]{3} OK id=(.*)/', - 'sendmail' => '/[\d]{3} 2.0.0 (.*) Message/', - 'postfix' => '/[\d]{3} 2.0.0 Ok: queued as (.*)/', - 'Microsoft_ESMTP' => '/[0-9]{3} 2.[\d].0 (.*)@(?:.*) Queued mail for delivery/', + 'sendmail' => '/[\d]{3} 2\.0\.0 (.*) Message/', + 'postfix' => '/[\d]{3} 2\.0\.0 Ok: queued as (.*)/', + 'Microsoft_ESMTP' => '/[0-9]{3} 2\.[\d]\.0 (.*)@(?:.*) Queued mail for delivery/', 'Amazon_SES' => '/[\d]{3} Ok (.*)/', 'SendGrid' => '/[\d]{3} Ok: queued as (.*)/', - 'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/', + 'CampaignMonitor' => '/[\d]{3} 2\.0\.0 OK:([a-zA-Z\d]{48})/', 'Haraka' => '/[\d]{3} Message Queued \((.*)\)/', 'ZoneMTA' => '/[\d]{3} Message queued as (.*)/', 'Mailjet' => '/[\d]{3} OK queued as (.*)/', @@ -280,7 +280,8 @@ protected function edebug($str, $level = 0) } //Is this a PSR-3 logger? if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) { - $this->Debugoutput->debug($str); + //Remove trailing line breaks potentially added by calls to SMTP::client_send() + $this->Debugoutput->debug(rtrim($str, "\r\n")); return; } @@ -293,6 +294,7 @@ protected function edebug($str, $level = 0) switch ($this->Debugoutput) { case 'error_log': //Don't output, just log + /** @noinspection ForgottenDebugOutputInspection */ error_log($str); break; case 'html': @@ -404,7 +406,9 @@ protected function getSMTPConnection($host, $port = null, $timeout = 30, $option $errstr = ''; if ($streamok) { $socket_context = stream_context_create($options); - set_error_handler([$this, 'errorHandler']); + set_error_handler(function () { + call_user_func_array([$this, 'errorHandler'], func_get_args()); + }); $connection = stream_socket_client( $host . ':' . $port, $errno, @@ -419,7 +423,9 @@ protected function getSMTPConnection($host, $port = null, $timeout = 30, $option 'Connection: stream_socket_client not available, falling back to fsockopen', self::DEBUG_CONNECTION ); - set_error_handler([$this, 'errorHandler']); + set_error_handler(function () { + call_user_func_array([$this, 'errorHandler'], func_get_args()); + }); $connection = fsockopen( $host, $port, @@ -483,7 +489,9 @@ public function startTLS() } //Begin encrypted connection - set_error_handler([$this, 'errorHandler']); + set_error_handler(function () { + call_user_func_array([$this, 'errorHandler'], func_get_args()); + }); $crypto_ok = stream_socket_enable_crypto( $this->smtp_conn, true, @@ -648,7 +656,7 @@ protected function hmac($data, $key) } //The following borrowed from - //http://php.net/manual/en/function.mhash.php#27225 + //https://www.php.net/manual/en/function.mhash.php#27225 //RFC 2104 HMAC implementation for php. //Creates an md5 HMAC. @@ -1162,7 +1170,9 @@ public function client_send($data, $command = '') } else { $this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT); } - set_error_handler([$this, 'errorHandler']); + set_error_handler(function () { + call_user_func_array([$this, 'errorHandler'], func_get_args()); + }); $result = fwrite($this->smtp_conn, $data); restore_error_handler(); @@ -1265,7 +1275,9 @@ protected function get_lines() while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) { //Must pass vars in here as params are by reference //solution for signals inspired by https://github.com/symfony/symfony/pull/6540 - set_error_handler([$this, 'errorHandler']); + set_error_handler(function () { + call_user_func_array([$this, 'errorHandler'], func_get_args()); + }); $n = stream_select($selR, $selW, $selW, $this->Timelimit); restore_error_handler(); From ceb3b5ef6d36bcdcd6fc0b77cbf7c21a645b2046 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 20 Nov 2024 17:02:55 +0100 Subject: [PATCH 261/362] Preflight for 5.0.0-alpha.4 --- composer.json | 2 +- composer.lock | 2 +- panel/dist/css/style.min.css | 2 +- panel/dist/img/icons.svg | 21 +++++++++++++++++++++ panel/dist/js/index.min.js | 2 +- panel/dist/js/sortable.esm.min.js | 4 ++-- panel/dist/js/vendor.min.js | 9 ++------- panel/dist/ui/Button.json | 2 +- panel/dist/ui/ChangesDialog.json | 2 +- panel/dist/ui/ColoroptionsInput.json | 2 +- panel/dist/ui/DropdownContent.json | 2 +- panel/dist/ui/FilePreview.json | 2 +- panel/dist/ui/FormButtons.json | 1 - panel/dist/ui/FormControls.json | 2 +- panel/dist/ui/ImageFilePreview.json | 2 +- panel/dist/ui/ModelTabs.json | 2 +- panel/dist/ui/RadioField.json | 2 +- panel/dist/ui/RadioInput.json | 2 +- vendor/composer/installed.php | 12 ++++++------ 19 files changed, 45 insertions(+), 30 deletions(-) delete mode 100644 panel/dist/ui/FormButtons.json diff --git a/composer.json b/composer.json index 9bd1481a5c..41d9a7de98 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "The Kirby core", "license": "proprietary", "type": "kirby-cms", - "version": "5.0.0-alpha.3", + "version": "5.0.0-alpha.4", "keywords": [ "kirby", "cms", diff --git a/composer.lock b/composer.lock index 3a3f857aeb..c3709619fa 100644 --- a/composer.lock +++ b/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": "b5808d2bb2e45e38633879f907895568", + "content-hash": "2b637dba1c867ecd6d5fbb08ca0563ed", "packages": [ { "name": "christian-riesen/base32", diff --git a/panel/dist/css/style.min.css b/panel/dist/css/style.min.css index a45326adf8..e26a0684d6 100644 --- a/panel/dist/css/style.min.css +++ b/panel/dist/css/style.min.css @@ -1 +1 @@ -.k-items{position:relative;display:grid;container-type:inline-size}.k-items[data-layout=list]{gap:2px}.k-items[data-layout=cardlets]{--items-size: 1fr;display:grid;gap:.75rem;grid-template-columns:repeat(auto-fill,minmax(var(--items-size),1fr))}@container (min-width: 15rem){.k-items[data-layout=cardlets]{--items-size: 15rem}}.k-items[data-layout=cards]{display:grid;gap:1.5rem;grid-template-columns:1fr}@container (min-width: 6rem){.k-items[data-layout=cards][data-size=tiny]{grid-template-columns:repeat(auto-fill,minmax(6rem,1fr))}}@container (min-width: 9rem){.k-items[data-layout=cards][data-size=small]{grid-template-columns:repeat(auto-fill,minmax(9rem,1fr))}}@container (min-width: 12rem){.k-items[data-layout=cards][data-size=auto],.k-items[data-layout=cards][data-size=medium]{grid-template-columns:repeat(auto-fill,minmax(12rem,1fr))}}@container (min-width: 15rem){.k-items[data-layout=cards][data-size=large]{grid-template-columns:repeat(auto-fill,minmax(15rem,1fr))}}@container (min-width: 18rem){.k-items[data-layout=cards][data-size=huge]{grid-template-columns:repeat(auto-fill,minmax(18rem,1fr))}}.k-collection-footer{display:flex;justify-content:space-between;align-items:flex-start;flex-wrap:nowrap;gap:var(--spacing-12);margin-top:var(--spacing-2)}.k-empty{max-width:100%}:root{--item-button-height: var(--height-md);--item-button-width: var(--height-md);--item-height: auto;--item-height-cardlet: calc(var(--height-md) * 3)}.k-item{position:relative;background:var(--color-white);box-shadow:var(--shadow);border-radius:var(--rounded);min-height:var(--item-height);container-type:inline-size}.k-item:has(a:focus){outline:2px solid var(--color-focus)}@supports not selector(:has(*)){.k-item:focus-within{outline:2px solid var(--color-focus)}}.k-item .k-icon-frame{--back: var(--color-gray-300)}.k-item-content{line-height:1.25;overflow:hidden;padding:var(--spacing-2)}.k-item-content a:focus{outline:0}.k-item-content a:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0}.k-item-info{color:var(--color-text-dimmed)}.k-item-options{transform:translate(0);z-index:1;display:flex;align-items:center;justify-content:space-between}.k-item-options[data-only-option=true]{justify-content:flex-end}.k-item-options .k-button{--button-height: var(--item-button-height);--button-width: var(--item-button-width)}.k-item .k-sort-button{position:absolute;z-index:2}.k-item:not(:hover):not(.k-sortable-fallback) .k-sort-button{opacity:0}.k-item[data-layout=list]{--item-height: var( --field-input-height );--item-button-height: var(--item-height);--item-button-width: auto;display:grid;align-items:center;grid-template-columns:1fr auto}.k-item[data-layout=list][data-has-image=true]{grid-template-columns:var(--item-height) 1fr auto}.k-item[data-layout=list] .k-frame{--ratio: 1/1;border-start-start-radius:var(--rounded);border-end-start-radius:var(--rounded);height:100%}.k-item[data-layout=list] .k-item-content{display:flex;min-width:0;flex-wrap:wrap;column-gap:var(--spacing-4);justify-content:space-between}.k-item[data-layout=list] .k-item-title,.k-item[data-layout=list] .k-item-info{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.k-item[data-layout=list] .k-sort-button{--button-width: calc(1.5rem + var(--spacing-1));--button-height: var(--item-height);left:calc(-1 * var(--button-width))}.k-item:is([data-layout=cardlets],[data-layout=cards]) .k-sort-button{top:var(--spacing-2);inset-inline-start:var(--spacing-2);background:hsla(0,0%,var(--color-l-max),50%);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);box-shadow:0 2px 5px #0003;--button-width: 1.5rem;--button-height: 1.5rem;--button-rounded: var(--rounded-sm);--button-padding: 0;--icon-size: 14px}.k-item:is([data-layout=cardlets],[data-layout=cards]) .k-sort-button:hover{background:hsla(0,0%,var(--color-l-max),95%)}.k-item[data-layout=cardlets]{--item-height: var(--item-height-cardlet);display:grid;grid-template-areas:"content" "options";grid-template-columns:1fr;grid-template-rows:1fr var(--height-md)}.k-item[data-layout=cardlets][data-has-image=true]{grid-template-areas:"image content" "image options";grid-template-columns:minmax(0,var(--item-height)) 1fr}.k-item[data-layout=cardlets] .k-frame{grid-area:image;border-start-start-radius:var(--rounded);border-end-start-radius:var(--rounded);aspect-ratio:auto}.k-item[data-layout=cardlets] .k-item-content{grid-area:content}.k-item[data-layout=cardlets] .k-item-info{margin-top:.125em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.k-item[data-layout=cardlets] .k-item-options{grid-area:options}.k-item[data-layout=cards]{display:flex;flex-direction:column}.k-item[data-layout=cards] .k-frame{border-start-start-radius:var(--rounded);border-start-end-radius:var(--rounded)}.k-item[data-layout=cards] .k-item-content{flex-grow:1;padding:var(--spacing-2)}.k-item[data-layout=cards] .k-item-info{margin-top:.125em}.k-item[data-theme=disabled]{background:transparent;box-shadow:none;outline:1px solid var(--color-border);outline-offset:-1px}.k-dialog-body{padding:var(--dialog-padding)}.k-dialog[data-has-footer=true] .k-dialog-body{padding-bottom:0}.k-button-group.k-dialog-buttons{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-3);--button-height: var(--height-lg)}.k-dialog-fields{padding-bottom:.5rem;container-type:inline-size}.k-dialog-footer{padding:var(--dialog-padding);line-height:1;flex-shrink:0}.k-dialog .k-notification{padding-block:.325rem;border-start-start-radius:var(--dialog-rounded);border-start-end-radius:var(--dialog-rounded);margin-top:-1px}.k-dialog-search{margin-bottom:.75rem;--input-color-border: transparent;--input-color-back: var(--color-gray-300)}:root{--dialog-color-back: var(--color-light);--dialog-color-text: currentColor;--dialog-margin: var(--spacing-6);--dialog-padding: var(--spacing-6);--dialog-rounded: var(--rounded-xl);--dialog-shadow: var(--shadow-xl);--dialog-width: 22rem}.k-dialog-portal{padding:var(--dialog-margin)}.k-dialog{position:relative;background:var(--dialog-color-back);color:var(--dialog-color-text);width:clamp(10rem,100%,var(--dialog-width));box-shadow:var(--dialog-shadow);border-radius:var(--dialog-rounded);line-height:1;display:flex;flex-direction:column;overflow:clip;container-type:inline-size}@media screen and (min-width: 20rem){.k-dialog[data-size=small]{--dialog-width: 20rem}}@media screen and (min-width: 22rem){.k-dialog[data-size=default]{--dialog-width: 22rem}}@media screen and (min-width: 30rem){.k-dialog[data-size=medium]{--dialog-width: 30rem}}@media screen and (min-width: 40rem){.k-dialog[data-size=large]{--dialog-width: 40rem}}@media screen and (min-width: 60rem){.k-dialog[data-size=huge]{--dialog-width: 60rem}}.k-dialog .k-pagination{margin-bottom:-1.5rem;display:flex;justify-content:center;align-items:center}.k-changes-dialog .k-headline{margin-top:-.5rem;margin-bottom:var(--spacing-3)}.k-error-details{background:var(--color-white);display:block;overflow:auto;padding:1rem;font-size:var(--text-sm);line-height:1.25em;margin-top:.75rem}.k-error-details dt{color:var(--color-red-500);margin-bottom:.25rem}.k-error-details dd{overflow:hidden;overflow-wrap:break-word;text-overflow:ellipsis}.k-error-details dd:not(:last-of-type){margin-bottom:1.5em}.k-error-details li{white-space:pre-line}.k-error-details li:not(:last-child){border-bottom:1px solid var(--color-light);padding-bottom:.25rem;margin-bottom:.25rem}.k-models-dialog .k-list-item{cursor:pointer}.k-models-dialog .k-choice-input{--choice-color-checked: var(--color-focus);display:flex;align-items:center;height:var(--item-button-height);margin-inline-end:var(--spacing-3)}.k-models-dialog .k-choice-input input{top:0}.k-models-dialog .k-collection-footer .k-pagination{margin-bottom:0}.k-license-dialog-status{display:flex;align-items:center;gap:var(--spacing-2)}.k-license-dialog .k-icon{color:var(--theme-color-700)}.k-page-template-switch{margin-bottom:var(--spacing-6);padding-bottom:var(--spacing-6);border-bottom:1px dashed var(--color-gray-300)}.k-page-move-dialog .k-headline{margin-bottom:var(--spacing-2)}.k-page-move-parent{--tree-color-back: var(--color-white);--tree-color-hover-back: var(--color-light);padding:var(--spacing-3);background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow)}.k-pages-dialog-navbar{display:flex;align-items:center;justify-content:center;margin-bottom:.5rem;padding-inline-end:38px}.k-pages-dialog-navbar .k-button[aria-disabled=true]{opacity:0}.k-pages-dialog-navbar .k-headline{flex-grow:1;text-align:center}.k-pages-dialog-option[aria-disabled=true]{opacity:.25}.k-search-dialog{--dialog-padding: 0;--dialog-rounded: var(--rounded);overflow:visible}.k-overlay[open][data-type=dialog]>.k-portal>.k-search-dialog{margin-top:0}.k-totp-dialog-headline{margin-bottom:var(--spacing-1)}.k-totp-dialog-intro{margin-bottom:var(--spacing-6)}.k-totp-dialog-grid{display:grid;gap:var(--spacing-6)}@media screen and (min-width: 40rem){.k-totp-dialog-grid{grid-template-columns:1fr 1fr;gap:var(--spacing-8)}}.k-totp-qrcode .k-box[data-theme]{padding:var(--box-padding-inline)}.k-totp-dialog-fields .k-field-name-confirm{--input-height: var(--height-xl);--input-rounded: var(--rounded);--input-font-size: var(--text-3xl)}.k-upload-dialog.k-dialog{--dialog-width: 40rem}.k-upload-replace-dialog .k-upload-items{display:flex;gap:var(--spacing-3);align-items:center}.k-upload-original{width:6rem;border-radius:var(--rounded);box-shadow:var(--shadow);overflow:hidden}.k-upload-replace-dialog .k-upload-item{flex-grow:1}.k-drawer-body{padding:var(--drawer-body-padding);flex-grow:1;background:var(--color-light)}.k-drawer-body .k-writer-input:focus-within .k-toolbar:not([data-inline=true]),.k-drawer-body .k-textarea-input-wrapper:focus-within .k-toolbar,.k-drawer-body .k-table th{top:-1.5rem}.k-drawer-header{--button-height: calc(var(--drawer-header-height) - var(--spacing-1));flex-shrink:0;height:var(--drawer-header-height);padding-inline-start:var(--drawer-header-padding);display:flex;align-items:center;line-height:1;justify-content:space-between;background:var(--color-white);font-size:var(--text-sm)}.k-drawer-breadcrumb{flex-grow:1}.k-drawer-options{display:flex;align-items:center;padding-inline-end:.75rem}.k-drawer-option{--button-width: var(--button-height)}.k-drawer-option[aria-disabled=true]{opacity:var(--opacity-disabled)}.k-notification.k-drawer-notification{padding:.625rem 1.5rem}.k-drawer-tabs{display:flex;align-items:center;line-height:1}.k-drawer-tab.k-button{--button-height: calc(var(--drawer-header-height) - var(--spacing-1));--button-padding: var(--spacing-3);display:flex;align-items:center;font-size:var(--text-xs);overflow-x:visible}.k-drawer-tab.k-button[aria-current=true]:after{position:absolute;bottom:-2px;inset-inline:var(--button-padding);content:"";background:var(--color-black);height:2px;z-index:1}:root{--drawer-body-padding: 1.5rem;--drawer-color-back: var(--color-light);--drawer-header-height: 2.5rem;--drawer-header-padding: 1rem;--drawer-shadow: var(--shadow-xl);--drawer-width: 50rem}.k-drawer-overlay+.k-drawer-overlay{--overlay-color-back: none}.k-drawer{--header-sticky-offset: calc(var(--drawer-body-padding) * -1);z-index:var(--z-toolbar);flex-basis:var(--drawer-width);position:relative;display:flex;flex-direction:column;background:var(--drawer-color-back);box-shadow:var(--drawer-shadow);container-type:inline-size}.k-drawer[aria-disabled=true]{display:none;pointer-events:none}:root{--dropdown-color-bg: var(--color-black);--dropdown-color-text: var(--color-white);--dropdown-color-hr: hsla(0, 0%, var(--color-l-max), .25);--dropdown-padding: var(--spacing-2);--dropdown-rounded: var(--rounded);--dropdown-shadow: var(--shadow-xl)}.k-panel[data-theme=dark]{--dropdown-color-hr: hsla(0, 0%, var(--color-l-max), .1)}.k-dropdown-content{--dropdown-x: 0;--dropdown-y: 0;position:absolute;inset-block-start:0;inset-inline-start:initial;left:0;width:max-content;padding:var(--dropdown-padding);background:var(--dropdown-color-bg);border-radius:var(--dropdown-rounded);color:var(--dropdown-color-text);box-shadow:var(--dropdown-shadow);text-align:start;transform:translate(var(--dropdown-x),var(--dropdown-y))}.k-dropdown-content::backdrop{background:none}.k-dropdown-content[data-align-x=end]{--dropdown-x: -100%}.k-dropdown-content[data-align-x=center]{--dropdown-x: -50%}.k-dropdown-content[data-align-y=top]{--dropdown-y: -100%}.k-dropdown-content hr{margin:.5rem 0;height:1px;background:var(--dropdown-color-hr)}.k-dropdown-content[data-theme=light]{--dropdown-color-bg: var(--color-white);--dropdown-color-text: var(--color-black);--dropdown-color-hr: var(--color-border-dimmed)}.k-dropdown-item.k-button{--button-align: flex-start;--button-color-text: var(--dropdown-color-text);--button-height: var(--height-sm);--button-rounded: var(--rounded-sm);--button-width: 100%;display:flex;gap:.75rem}.k-dropdown-item.k-button:focus{outline:var(--outline)}.k-dropdown-item.k-button[aria-current=true]{--button-color-text: var(--color-blue-500)}.k-dropdown-item.k-button:not([aria-disabled=true]):hover{--button-color-back: var(--dropdown-color-hr)}.k-options-dropdown{display:flex;justify-content:center;align-items:center}:root{--picklist-rounded: var(--rounded-sm);--picklist-highlight: var(--color-yellow-500)}.k-picklist-input{--choice-color-text: currentColor;--button-rounded: var(--picklist-rounded)}.k-picklist-input-header{--input-rounded: var(--picklist-rounded)}.k-picklist-input-search{display:flex;align-items:center;border-radius:var(--picklist-rounded)}.k-picklist-input-search .k-search-input{height:var(--button-height)}.k-picklist-input-search:focus-within{outline:var(--outline)}.k-picklist-dropdown .k-picklist-input-create:focus{outline:0}.k-picklist-dropdown .k-picklist-input-create[aria-disabled=true]{visibility:hidden}.k-picklist-input-options.k-grid{--columns: 1}.k-picklist-input-options li+li{margin-top:var(--spacing-1)}.k-picklist-input-options .k-choice-input{padding-inline:var(--spacing-2)}.k-picklist-input-options .k-choice-input{--choice-color-checked: var(--color-focus)}.k-picklist-input-options .k-choice-input:has(:checked){--choice-color-text: var(--color-focus)}.k-picklist-input-options .k-choice-input[aria-disabled=true]{--choice-color-text: var(--color-text-dimmed)}.k-picklist-input-options .k-choice-input:has(:focus-within){outline:var(--outline)}.k-picklist-input-options .k-choice-input b{font-weight:var(--font-normal);color:var(--picklist-highlight)}.k-picklist-input-more.k-button{--button-width: 100%;--button-align: start;--button-color-text: var(--color-text-dimmed);padding-inline:var(--spacing-2)}.k-picklist-input-more.k-button .k-button-icon{position:relative;inset-inline-start:-1px}.k-picklist-input-empty{height:var(--button-height);line-height:1.25rem;padding:var(--spacing-1) var(--spacing-2);color:var(--color-text-dimmed)}.k-picklist-dropdown{--color-text-dimmed: var(--color-gray-400);padding:0;max-width:30rem;min-width:8rem}.k-picklist-dropdown :where(.k-picklist-input-header,.k-picklist-input-body,.k-picklist-input-footer){padding:var(--dropdown-padding)}.k-picklist-dropdown .k-picklist-input-header{border-bottom:1px solid var(--dropdown-color-hr)}.k-picklist-dropdown .k-picklist-input-search{background:var(--dropdown-color-hr);padding-inline-end:var(--input-padding)}.k-picklist-dropdown .k-picklist-input-create{--button-rounded: 1rem;--button-height: 1.125rem}.k-picklist-dropdown .k-picklist-input-create:focus{--button-color-back: var(--color-blue-500);--button-color-text: var(--color-black)}.k-picklist-dropdown .k-picklist-input-body{max-height:calc(var(--button-height) * 9.5 + 2px * 9 + var(--dropdown-padding));overflow-y:auto;outline-offset:-2px;overscroll-behavior:contain;scroll-padding-top:var(--dropdown-padding);scroll-padding-bottom:var(--dropdown-padding)}.k-picklist-dropdown .k-picklist-input-options .k-choice-input{--choice-color-border: var(--dropdown-color-hr);--choice-color-back: var(--dropdown-color-hr);--choice-color-info: var(--color-text-dimmed);min-height:var(--button-height);border-radius:var(--picklist-rounded);padding-block:.375rem}.k-picklist-dropdown .k-picklist-input-options li+li{margin-top:0}.k-picklist-dropdown .k-picklist-input-options .k-choice-input[aria-disabled=true] input{--choice-color-border: var(--dropdown-color-hr);--choice-color-back: var(--dropdown-color-hr);--choice-color-checked: var(--dropdown-color-hr);opacity:var(--opacity-disabled)}.k-picklist-dropdown .k-picklist-input-options .k-choice-input:not([aria-disabled=true]):hover{background-color:var(--dropdown-color-hr)}.k-picklist-dropdown .k-picklist-input-options .k-choice-input:not([aria-disabled=true]):focus-within{--choice-color-text: var(--color-blue-500)}.k-picklist-dropdown .k-picklist-input-more.k-button:hover{--button-color-back: var(--dropdown-color-hr)}.k-picklist-dropdown .k-picklist-input-body+.k-picklist-input-footer{border-top:1px solid var(--dropdown-color-hr)}.k-counter{font-size:var(--text-xs);color:var(--color-gray-900)}.k-counter[data-invalid=true]{color:var(--color-red-700)}.k-counter-rules{color:var(--color-gray-600);padding-inline-start:.5rem}.k-form-submitter{display:none}.k-field[data-disabled=true]{cursor:not-allowed}.k-field[data-disabled=true] *{pointer-events:none}.k-field[data-disabled=true] .k-text[data-theme=help] *{pointer-events:initial}.k-field-header{display:flex;justify-content:space-between;align-items:center;gap:var(--spacing-6);position:relative;margin-bottom:var(--spacing-2)}.k-field-options{flex-shrink:0}.k-field:focus-within>.k-field-header>.k-field-counter{display:block}.k-field-footer{margin-top:var(--spacing-2)}.k-fieldset{border:0}:root{--input-color-back: var(--color-white);--input-color-border: var(--color-border);--input-color-description: var(--color-text-dimmed);--input-color-icon: currentColor;--input-color-placeholder: var(--color-gray-600);--input-color-text: currentColor;--input-font-family: var(--font-sans);--input-font-size: var(--text-sm);--input-height: 2.25rem;--input-leading: 1;--input-outline-focus: var(--outline);--input-padding: var(--spacing-2);--input-padding-multiline: .475rem var(--input-padding);--input-rounded: var(--rounded);--input-shadow: none}@media (pointer: coarse){:root{--input-font-size: var(--text-md);--input-padding-multiline: .375rem var(--input-padding)}}.k-input{display:flex;align-items:center;line-height:var(--input-leading);border:0;background:var(--input-color-back);border-radius:var(--input-rounded);outline:1px solid var(--input-color-border);color:var(--input-color-text);min-height:var(--input-height);box-shadow:var(--input-shadow);font-family:var(--input-font-family);font-size:var(--input-font-size)}.k-input:focus-within{outline:var(--input-outline-focus)}.k-input-element{flex-grow:1}.k-input-icon{color:var(--input-color-icon);display:flex;justify-content:center;align-items:center;width:var(--input-height)}.k-input-icon-button{width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-shrink:0}.k-input-description{color:var(--input-color-description);padding-inline:var(--input-padding)}.k-input-before{padding-inline-end:0}.k-input-after{padding-inline-start:0}.k-input :where(.k-input-description,.k-input-icon){align-self:stretch;display:flex;align-items:center;flex-shrink:0}.k-input[data-disabled=true]{--input-color-back: var(--color-light);--input-color-icon: var(--color-gray-600);pointer-events:none}.k-block-title{display:flex;align-items:center;min-width:0;padding-inline-end:.75rem;line-height:1;gap:var(--spacing-2)}.k-block-icon{--icon-color: var(--color-gray-600);width:1rem}.k-block-label{color:var(--color-text-dimmed);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.k-block-type-default .k-block-title{line-height:1.5em}.k-block-options{--toolbar-size: 30px;box-shadow:var(--shadow-toolbar)}.k-block-options>.k-button:not(:last-of-type){border-inline-end:1px solid var(--color-light)}.k-block-options .k-dropdown-content{margin-top:.5rem}.k-block-container{position:relative;padding:var(--spacing-3);background:var(--color-white);border-radius:var(--rounded)}.k-block-container:not(:last-of-type){border-bottom:1px dashed var(--color-border-dimmed)}.k-block-container:focus{outline:0}.k-block-container[data-selected=true]{z-index:2;outline:var(--outline);border-bottom-color:transparent}.k-block-container[data-batched=true]:after{position:absolute;top:0;right:0;bottom:0;left:0;content:"";background:#b1c2d82d;mix-blend-mode:multiply}.k-block-container .k-block-options{display:none;position:absolute;top:0;inset-inline-end:var(--spacing-3);margin-top:calc(-1.75rem + 2px)}.k-block-container[data-last-selected=true]>.k-block-options{display:flex}.k-block-container[data-hidden=true] .k-block{opacity:.25}.k-drawer-options .k-drawer-option[data-disabled=true]{vertical-align:middle;display:inline-grid}.k-block-container[data-disabled=true]{background:var(--color-light)}.k-block-container:is(.k-sortable-ghost,.k-sortable-fallback) .k-block{position:relative;max-height:4rem;overflow:hidden}.k-block-container:is(.k-sortable-ghost,.k-sortable-fallback) .k-block:after{position:absolute;bottom:0;content:"";height:2rem;width:100%;background:linear-gradient(to top,var(--color-white),transparent)}.k-blocks{border-radius:var(--rounded)}.k-blocks:not([data-empty=true],[data-disabled=true]){background:var(--color-white);box-shadow:var(--shadow)}.k-blocks[data-disabled=true]:not([data-empty=true]){border:1px solid var(--input-color-border)}.k-blocks-list[data-multi-select-key=true]>.k-block-container *{pointer-events:none}.k-blocks-list[data-multi-select-key=true]>.k-block-container .k-blocks *{pointer-events:all}.k-blocks .k-sortable-ghost{outline:2px solid var(--color-focus);box-shadow:#11111140 0 5px 10px;cursor:grabbing;cursor:-moz-grabbing;cursor:-webkit-grabbing}.k-blocks-list>.k-blocks-empty{display:flex;align-items:center}.k-block-importer .k-dialog-body{padding:0}.k-block-importer label{display:block;padding:var(--spacing-6) var(--spacing-6) 0;color:var(--color-text-dimmed);line-height:var(--leading-normal)}.k-block-importer label small{display:block;font-size:inherit}.k-block-importer textarea{width:100%;height:20rem;background:none;font:inherit;color:var(--color-white);border:0;padding:var(--spacing-6);resize:none}.k-block-importer textarea:focus{outline:0}.k-block-selector .k-headline{margin-bottom:1rem}.k-block-selector details+details{margin-top:var(--spacing-6)}.k-block-selector summary{font-size:var(--text-xs);cursor:pointer;color:var(--color-text-dimmed)}.k-block-selector details:only-of-type summary{pointer-events:none}.k-block-selector summary:focus{outline:0}.k-block-selector summary:focus-visible{color:var(--color-focus)}.k-block-types{display:grid;grid-gap:2px;margin-top:.75rem;grid-template-columns:repeat(1,1fr)}.k-block-types .k-button{--button-color-icon: var(--color-text);--button-color-back: var(--color-white);--button-padding: var(--spacing-3);width:100%;justify-content:start;gap:1rem;box-shadow:var(--shadow)}.k-block-types .k-button[aria-disabled=true]{opacity:var(--opacity-disabled);--button-color-back: var(--color-gray-200);box-shadow:none}.k-clipboard-hint{padding-top:1.5rem;line-height:var(--leading-normal);font-size:var(--text-xs);color:var(--color-text-dimmed)}.k-clipboard-hint small{display:block;font-size:inherit;color:var(--color-text-dimmed)}.k-block-background-dropdown>.k-button{--color-frame-rounded: 0;--color-frame-size: 1.5rem;--button-height: 1.5rem;--button-padding: 0 .125rem;--button-color-back: var(--color-white);gap:.25rem;box-shadow:var(--shadow-toolbar);border:1px solid var(--color-white)}.k-block-background-dropdown .k-color-frame{border-right:1px solid var(--color-gray-300)}.k-block-background-dropdown .k-color-frame:after{box-shadow:none}.k-block .k-block-background-dropdown{position:absolute;inset-inline-end:var(--spacing-3);bottom:var(--spacing-3);opacity:0;transition:opacity .2s ease-in-out}.k-block:hover .k-block-background-dropdown{opacity:1}.k-block-figure:not([data-empty=true]){--block-figure-back: var(--color-white);background:var(--block-figure-back)}.k-block-figure-container:not([data-disabled=true]){cursor:pointer}.k-block-figure iframe{border:0;pointer-events:none;background:var(--color-black)}.k-block-figure figcaption{padding-top:.5rem;color:var(--color-text-dimmed);font-size:var(--text-sm);text-align:center}.k-block-figure-empty{--button-width: 100%;--button-height: 6rem;--button-color-text: var(--color-text-dimmed);--button-color-back: var(--color-light)}.k-block-figure-empty,.k-block-figure-container>*{border-radius:var(--rounded-sm)}.k-block-figure-caption{display:flex;justify-content:center;padding-top:var(--spacing-3)}.k-block-figure-caption .k-writer{width:max-content;text-align:center}.k-block-figure-caption .k-writer .k-text{color:var(--color-gray-600);font-size:var(--text-sm);mix-blend-mode:exclusion}.k-block-type-code-editor{position:relative}.k-block-type-code-editor .k-input{--input-color-border: none;--input-color-back: var(--color-black);--input-color-text: var(--color-white);--input-font-family: var(--font-mono);--input-outline-focus: none;--input-padding: var(--spacing-3);--input-padding-multiline: var(--input-padding)}.k-panel[data-theme=dark] .k-block-type-code-editor .k-input{--input-color-back: var(--color-light);--input-color-text: var(--color-text)}.k-block-type-code-editor .k-input[data-type=textarea]{white-space:pre-wrap}.k-block-type-code-editor-language{--input-font-size: var(--text-xs);position:absolute;inset-inline-end:0;bottom:0}.k-block-type-code-editor-language .k-input-element{padding-inline-start:1.5rem}.k-block-type-code-editor-language .k-input-icon{inset-inline-start:0}.k-block-container.k-block-container-type-fields{padding-block:0}.k-block-container:not([data-hidden=true]) .k-block-type-fields>:not([data-collapsed=true]){padding-bottom:var(--spacing-3)}.k-block-type-fields-header{display:flex;justify-content:space-between}.k-block-type-fields-header .k-block-title{padding-block:var(--spacing-3);cursor:pointer;white-space:nowrap}.k-block-type-fields-form{background-color:var(--color-gray-200);padding:var(--spacing-6) var(--spacing-6) var(--spacing-8);border-radius:var(--rounded-sm);container:column / inline-size}.k-block-container-type-fields[data-hidden=true] :where(.k-drawer-tabs,.k-block-type-fields-form){display:none}.k-block-container.k-block-container-type-gallery{padding:0}.k-block-type-gallery>figure{padding:var(--spacing-3);border-radius:var(--rounded)}.k-block-type-gallery>figure:not([data-empty=true]){background:var(--block-back)}.k-block-type-gallery ul{display:grid;grid-gap:.75rem;grid-template-columns:repeat(auto-fit,minmax(6rem,1fr));line-height:0;align-items:center;justify-content:center}.k-block-type-gallery:not([data-disabled=true]) ul{cursor:pointer}.k-block-type-gallery ul .k-image-frame{border-radius:var(--rounded-sm)}.k-block-type-gallery[data-disabled=true] .k-block-type-gallery-placeholder{background:var(--color-gray-250)}.k-block-type-gallery-placeholder{background:var(--color-light)}.k-block-type-heading-input{display:flex;align-items:center;line-height:1.25em;font-size:var(--text-size);font-weight:var(--font-bold)}.k-block-type-heading-input[data-level=h1]{--text-size: var(--text-3xl);line-height:1.125em}.k-block-type-heading-input[data-level=h2]{--text-size: var(--text-2xl)}.k-block-type-heading-input[data-level=h3]{--text-size: var(--text-xl)}.k-block-type-heading-input[data-level=h4]{--text-size: var(--text-lg)}.k-block-type-heading-input[data-level=h5]{--text-size: var(--text-md);line-height:1.5em}.k-block-type-heading-input[data-level=h6]{--text-size: var(--text-sm);line-height:1.5em}.k-block-type-heading-input .k-writer-input .ProseMirror strong{font-weight:700}.k-block-type-heading-level{--input-color-back: transparent;--input-color-border: none;--input-color-text: var(--color-gray-600);font-weight:var(--font-bold);text-transform:uppercase}.k-block-container.k-block-container-type-image{padding:0}.k-block-type-image .k-block-figure{padding:var(--spacing-3);border-radius:var(--rounded)}.k-block-type-image .k-block-figure-container{text-align:center;line-height:0}.k-block-type-image .k-block-figure[data-empty=true]{padding:var(--spacing-3)}.k-block-type-image-auto{max-width:100%;max-height:30rem;margin-inline:auto}.k-block-type-image .k-background-dropdown{position:absolute;inset-inline-end:var(--spacing-3);bottom:var(--spacing-3);opacity:0;transition:opacity .2s ease-in-out}.k-block-type-image:hover .k-background-dropdown{opacity:1}.k-block-type-line hr{margin-block:.75rem;border:0;border-top:1px solid var(--color-border)}.k-block-type-list-input{--input-color-back: transparent;--input-color-border: none;--input-outline-focus: none}.k-block-type-markdown-input{--input-color-back: var(--color-light);--input-color-border: none;--input-outline-focus: none;--input-padding-multiline: var(--spacing-3)}.k-block-type-quote-editor{padding-inline-start:var(--spacing-3);border-inline-start:2px solid var(--color-black)}.k-block-type-quote-text{font-size:var(--text-xl);margin-bottom:var(--spacing-1);line-height:1.25em}.k-block-type-quote-citation{font-style:italic;color:var(--color-text-dimmed)}.k-block-type-table-preview{cursor:pointer;border:1px solid var(--color-gray-300);border-spacing:0;border-radius:var(--rounded-sm)}.k-block-type-table-preview :where(th,td){text-align:start;line-height:1.5em;font-size:var(--text-sm)}.k-block-type-table-preview th{padding:.5rem .75rem}.k-block-type-table-preview td:not(.k-table-index-column){padding:0 .75rem}.k-block-type-table-preview td>*,.k-block-type-table-preview td [class$=-field-preview]{padding:0}.k-block-type-text-input{line-height:1.5;height:100%}.k-block-container.k-block-container-type-text{padding:0}.k-block-type-text-input.k-writer-input[data-toolbar-inline=true]{padding:var(--spacing-3)}.k-block-type-text-input.k-writer-input:not([data-toolbar-inline=true])>.ProseMirror,.k-block-type-text-input.k-writer-input:not([data-toolbar-inline=true])[data-placeholder][data-empty=true]:before{padding:var(--spacing-3) var(--spacing-6)}.k-block-type-text-input.k-textarea-input .k-textarea-input-native{padding:var(--input-padding-multiline)}.k-block-type-video-figure video{pointer-events:none}.k-blocks-field{position:relative}.k-blocks-field>footer{display:flex;justify-content:center;margin-top:var(--spacing-3)}.k-string-input{padding:var(--input-padding);border-radius:var(--input-rounded)}.k-string-input:focus{outline:0}.k-string-input[data-font=monospace]{font-family:var(--font-mono)}.k-color-field{--color-frame-size: calc(var(--input-height) - var(--spacing-2))}.k-color-field .k-input-before{align-items:center;padding-inline-start:var(--spacing-1)}.k-color-field-options{--color-frame-size: var(--input-height)}.k-color-field-picker{padding:var(--spacing-3)}.k-color-field-picker-toggle{--color-frame-rounded: var(--rounded-sm);border-radius:var(--color-frame-rounded)}.k-color-field .k-colorname-input{padding-inline:var(--input-padding)}.k-color-field .k-colorname-input:focus{outline:0}.k-date-input:disabled::placeholder{opacity:0}.k-date-field-body{display:grid;gap:var(--spacing-2)}@container (min-width: 20rem){.k-date-field-body[data-has-time=true]{grid-template-columns:1fr minmax(6rem,9rem)}}.k-models-field[data-disabled=true] .k-item *{pointer-events:all!important}.k-headline-field{position:relative;padding-top:1.5rem}.k-fieldset>.k-grid .k-column:first-child .k-headline-field{padding-top:0}.k-headline-field h2.k-headline{font-weight:var(--font-normal)}.k-headline-field footer{margin-top:var(--spacing-2)}.k-info-field .k-headline{padding-bottom:.75rem;line-height:1.25rem}.k-layout-column{position:relative;height:100%;display:flex;flex-direction:column;background:var(--color-white);min-height:6rem}.k-layout-column:focus{outline:0}.k-layout-column>.k-blocks{background:none;box-shadow:none;padding:0;height:100%;background:var(--color-white);min-height:4rem}.k-layout-column>.k-blocks[data-empty=true]{min-height:6rem}.k-layout-column>.k-blocks>.k-blocks-list{display:flex;flex-direction:column;height:100%}.k-layout-column>.k-blocks>.k-blocks-list>.k-block-container:last-of-type{flex-grow:1}.k-layout-column>.k-blocks>.k-blocks-list>.k-blocks-empty.k-box{--box-color-back: transparent;position:absolute;top:0;right:0;bottom:0;left:0;justify-content:center;opacity:0;transition:opacity .3s;border:0}.k-layout-column>.k-blocks>.k-blocks-list>.k-blocks-empty:hover{opacity:1}.k-layout{--layout-border-color: var(--color-gray-300);--layout-toolbar-width: 2rem;position:relative;padding-inline-end:var(--layout-toolbar-width);background:#fff;box-shadow:var(--shadow)}[data-disabled=true] .k-layout{padding-inline-end:0}.k-layout:not(:last-of-type){margin-bottom:1px}.k-layout:focus{outline:0}.k-layout-toolbar{position:absolute;inset-block:0;inset-inline-end:0;width:var(--layout-toolbar-width);display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding-bottom:var(--spacing-2);font-size:var(--text-sm);background:var(--color-gray-100);border-inline-start:1px solid var(--color-light);color:var(--color-gray-500)}.k-layout-toolbar:hover{color:var(--color-black)}.k-layout-toolbar-button{width:var(--layout-toolbar-width);height:var(--layout-toolbar-width)}.k-layout-columns.k-grid{grid-gap:1px;background:var(--layout-border-color);background:var(--color-gray-300)}.k-layout:not(:first-child) .k-layout-columns.k-grid{border-top:0}.k-layouts .k-sortable-ghost{position:relative;box-shadow:#11111140 0 5px 10px;outline:2px solid var(--color-focus);cursor:grabbing;z-index:1}.k-layout-field>footer{display:flex;justify-content:center;margin-top:var(--spacing-3)}.k-line-field{position:relative;border:0;height:3rem;width:auto}.k-line-field:after{position:absolute;content:"";top:50%;margin-top:-1px;inset-inline:0;height:1px;background:var(--color-border)}.k-link-input-header{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:.25rem;height:var(--input-height);grid-area:header}.k-link-input-toggle.k-button{--button-height: var(--height-sm);--button-rounded: var(--rounded-sm);--button-color-back: var(--color-gray-200);margin-inline-start:.25rem}.k-link-input-model{display:flex;justify-content:space-between;margin-inline-end:var(--spacing-1)}.k-link-input-model-placeholder.k-button{--button-align: flex-start;--button-color-text: var(--color-gray-600);--button-height: var(--height-sm);--button-padding: var(--spacing-2);--button-rounded: var(--rounded-sm);flex-grow:1;overflow:hidden;white-space:nowrap;align-items:center}.k-link-field .k-link-field-preview{--tag-height: var(--height-sm);padding-inline:0}.k-link-field .k-link-field-preview .k-tag:focus{outline:0}.k-link-field .k-link-field-preview .k-tag:focus-visible{outline:var(--outline)}.k-link-field .k-link-field-preview .k-tag-text{font-size:var(--text-sm)}.k-link-input-model-toggle{align-self:center;--button-height: var(--height-sm);--button-width: var(--height-sm);--button-rounded: var(--rounded-sm)}.k-link-input-body{display:grid;overflow:hidden;border-top:1px solid var(--color-gray-300);background:var(--color-gray-100);--tree-color-back: var(--color-gray-100);--tree-color-hover-back: var(--color-gray-200)}.k-link-input-body[data-type=page] .k-page-browser{padding:var(--spacing-2);padding-bottom:calc(var(--spacing-2) - 1px);width:100%;container-type:inline-size;overflow:auto}.k-link-field .k-bubbles-field-preview{--tag-rounded: var(--rounded-sm);--tag-size: var(--height-sm);padding-inline:0}.k-link-field[data-disabled=true] .k-link-input-model-placeholder{display:none}.k-link-field[data-disabled=true] input::placeholder{opacity:0}.k-writer-input{position:relative;width:100%;display:grid;grid-template-areas:"content";gap:var(--spacing-1)}.k-writer-input .ProseMirror{overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;white-space:pre-wrap;font-variant-ligatures:none;grid-area:content;padding:var(--input-padding-multiline)}.k-writer-input .ProseMirror:focus{outline:0}.k-writer-input .ProseMirror *{caret-color:currentColor}.k-writer-input .ProseMirror hr.ProseMirror-selectednode{outline:var(--outline)}.k-writer-input[data-placeholder][data-empty=true]:before{grid-area:content;content:attr(data-placeholder);color:var(--input-color-placeholder);pointer-events:none;white-space:pre-wrap;word-wrap:break-word;line-height:var(--text-line-height);padding:var(--input-padding-multiline)}.k-list-input.k-writer-input[data-placeholder][data-empty=true]:before{padding-inline-start:2.5em}.k-list-field .k-list-input .ProseMirror,.k-list-field .k-list-input:before{padding:.475rem .5rem .475rem .75rem}:root{--tag-color-back: var(--color-black);--tag-color-text: var(--color-white);--tag-color-toggle: currentColor;--tag-color-disabled-back: var(--color-gray-600);--tag-color-disabled-text: var(--tag-color-text);--tag-height: var(--height-xs);--tag-rounded: var(--rounded-sm);--tag-text-size: var(--text-sm)}.k-tag[data-theme=light]{--tag-color-back: var(--color-light);--tag-color-text: var(--color-black);--tag-color-disabled-back: var(--color-gray-200);--tag-color-disabled-text: var(--color-gray-600)}.k-tag{position:relative;height:var(--tag-height);display:flex;align-items:center;justify-content:space-between;font-size:var(--tag-text-size);line-height:1;color:var(--tag-color-text);background-color:var(--tag-color-back);border-radius:var(--tag-rounded);-webkit-user-select:none;user-select:none}button.k-tag:not([aria-disabled=true]){cursor:pointer}.k-tag:not([aria-disabled=true]):focus{outline:var(--outline)}.k-tag-image{height:100%;border-radius:var(--rounded-xs);overflow:hidden;flex-shrink:0;border-radius:0;border-start-start-radius:var(--tag-rounded);border-end-start-radius:var(--tag-rounded);background-clip:padding-box}.k-tag-text{padding-inline:var(--spacing-2);line-height:var(--leading-tight);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.k-tag[data-has-toggle=true] .k-tag-text{padding-inline-end:0}.k-tag-toggle{--icon-size: 14px;width:var(--tag-height);height:var(--tag-height);filter:brightness(70%);flex-shrink:0}.k-tag-toggle:hover{filter:brightness(100%)}.k-tag:where([aria-disabled=true]){background-color:var(--tag-color-disabled-back);color:var(--tag-color-disabled-text);cursor:not-allowed}:root{--tags-gap: .375rem}.k-tags{display:inline-flex;gap:var(--tags-gap);align-items:center;flex-wrap:wrap}.k-tags .k-sortable-ghost{outline:var(--outline)}.k-tags[data-layout=list],.k-tags[data-layout=list] .k-tag{width:100%}.k-tags.k-draggable .k-tag-text{cursor:grab}.k-tags.k-draggable .k-tag-text:active{cursor:grabbing}.k-multiselect-input{padding:var(--tags-gap);cursor:pointer}.k-multiselect-input-toggle.k-button{opacity:0}.k-tags-input{padding:var(--tags-gap)}.k-tags-input[data-can-add=true]{cursor:pointer}.k-tags-input-toggle.k-button{--button-color-text: var(--input-color-placeholder);opacity:0}.k-tags-input-toggle.k-button:focus{--button-color-text: var(--input-color-text)}.k-tags-input:focus-within .k-tags-input-toggle{opacity:1}.k-tags-input .k-picklist-dropdown{margin-top:var(--spacing-1)}.k-tags-input .k-picklist-dropdown .k-choice-input{gap:0}.k-tags-input .k-picklist-dropdown .k-choice-input:focus-within{outline:var(--outline)}.k-tags-input .k-picklist-dropdown .k-choice-input input{opacity:0;width:0}.k-number-input{padding:var(--input-padding);border-radius:var(--input-rounded)}.k-number-input:focus{outline:0}.k-table.k-object-field-table{table-layout:auto}.k-table.k-object-field-table tbody td{max-width:0}@container (max-width: 40rem){.k-object-field{overflow:hidden}.k-object-field-table.k-table tbody :where(th):is([data-mobile=true]){width:1px!important;white-space:normal;word-break:normal}}.k-range-input{--range-track-height: 1px;--range-track-back: var(--color-gray-300);--range-tooltip-back: var(--color-black);display:flex;align-items:center;border-radius:var(--range-track-height)}.k-range-input input[type=range]:focus{outline:0}.k-range-input-tooltip{position:relative;display:flex;align-items:center;color:var(--color-white);font-size:var(--text-xs);font-variant-numeric:tabular-nums;line-height:1;text-align:center;border-radius:var(--rounded-sm);background:var(--range-tooltip-back);margin-inline-start:var(--spacing-3);padding:0 var(--spacing-1);white-space:nowrap}.k-range-input-tooltip:after{position:absolute;top:50%;inset-inline-start:-3px;width:0;height:0;transform:translateY(-50%);border-block:3px solid transparent;border-inline-end:3px solid var(--range-tooltip-back);content:""}.k-range-input-tooltip>*{padding:var(--spacing-1)}.k-range-input[data-disabled=true]{--range-tooltip-back: var(--color-gray-600)}.k-input[data-type=range] .k-range-input{padding-inline:var(--input-padding)}.k-select-input{position:relative;display:block;overflow:hidden;padding:var(--input-padding);border-radius:var(--input-rounded)}.k-select-input[data-empty=true]{color:var(--input-color-placeholder)}.k-select-input-native{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;z-index:1}.k-select-input-native[disabled]{cursor:default}.k-input[data-type=select]{position:relative}.k-input[data-type=select] .k-input-icon{position:absolute;inset-block:0;inset-inline-end:0}.k-structure-field:not([data-disabled=true]) td.k-table-column{cursor:pointer}.k-structure-field .k-table+footer{display:flex;justify-content:center;margin-top:var(--spacing-3)}.k-text-input{padding:var(--input-padding);border-radius:var(--input-rounded)}.k-text-input:focus{outline:0}.k-text-input[data-font=monospace]{font-family:var(--font-mono)}.k-text-input:disabled::placeholder{opacity:0}.k-field-counter{display:none}.k-text-field:focus-within .k-field-counter{display:block}.k-toolbar.k-textarea-toolbar{border-end-start-radius:0;border-end-end-radius:0;border-bottom:1px solid var(--toolbar-border)}.k-toolbar.k-textarea-toolbar>.k-button:first-child{border-end-start-radius:0}.k-toolbar.k-textarea-toolbar>.k-button:last-child{border-end-end-radius:0}.k-textarea-input[data-size=small]{--textarea-size: 7.5rem}.k-textarea-input[data-size=medium]{--textarea-size: 15rem}.k-textarea-input[data-size=large]{--textarea-size: 30rem}.k-textarea-input[data-size=huge]{--textarea-size: 45rem}.k-textarea-input-wrapper{position:relative;display:block}.k-textarea-input-native{resize:none;min-height:var(--textarea-size)}.k-textarea-input-native:focus{outline:0}.k-textarea-input-native[data-font=monospace]{font-family:var(--font-mono)}.k-input[data-type=textarea] .k-input-element{min-width:0}.k-input[data-type=textarea] .k-textarea-input-native{padding:var(--input-padding-multiline)}.k-time-input:disabled::placeholder{opacity:0}.k-choice-input{display:flex;gap:var(--spacing-3);min-width:0}.k-choice-input input{top:2px}.k-choice-input-label{display:flex;line-height:1.25rem;flex-direction:column;min-width:0;color:var(--choice-color-text)}.k-choice-input-label>*{display:block;overflow:hidden;text-overflow:ellipsis}.k-choice-input-label-info{color:var(--choice-color-info)}.k-choice-input[aria-disabled=true]{cursor:not-allowed}:where(.k-checkboxes-field,.k-radio-field) .k-choice-input{min-height:var(--input-height);padding-block:var(--spacing-2);padding-inline:var(--spacing-3);border-radius:var(--input-rounded)}:where(.k-checkboxes-field,.k-radio-field) .k-choice-input:not([aria-disabled=true]){background:var(--input-color-back);box-shadow:var(--shadow)}:where(.k-checkboxes-field,.k-radio-field) .k-choice-input[aria-disabled=true]{outline:1px solid var(--input-color-border)}.k-input[data-type=toggle]{--input-color-border: transparent;--input-shadow: var(--shadow)}.k-input[data-type=toggle] .k-input-before{padding-inline-end:calc(var(--input-padding) / 2)}.k-input[data-type=toggle] .k-toggle-input{padding-inline-start:var(--input-padding)}.k-input[data-type=toggle][data-disabled=true]{box-shadow:none;border:1px solid var(--color-border)}.k-input[data-type=toggles]{display:inline-flex}.k-input[data-type=toggles].grow{display:flex}.k-input[data-type=toggles]:has(.k-empty){outline:0;display:flex}.k-toggles-input ul{display:grid;grid-template-columns:repeat(var(--options),minmax(0,1fr));gap:1px;border-radius:var(--rounded);line-height:1;background:var(--color-border);overflow:hidden}.k-toggles-input li{height:var(--field-input-height);background:var(--color-white)}.k-toggles-input label{align-items:center;background:var(--color-white);cursor:pointer;display:flex;font-size:var(--text-sm);justify-content:center;line-height:1.25;padding:0 var(--spacing-3);height:100%}.k-toggles-input li[data-disabled=true] label{color:var(--color-text-dimmed);background:var(--color-light)}.k-toggles-input .k-icon+.k-toggles-text{margin-inline-start:var(--spacing-2)}.k-toggles-input input:focus:not(:checked)+label{background:var(--color-blue-200)}.k-toggles-input input:checked+label{background:var(--color-black);color:var(--color-white)}.k-alpha-input{--range-track-back: linear-gradient(to right, transparent, currentColor);--range-track-height: var(--range-thumb-size);color:#000;background:#fff var(--pattern-light)}.k-calendar-input{--button-height: var(--height-sm);--button-width: var(--button-height);--button-padding: 0;padding:var(--spacing-2);width:min-content}.k-calendar-table{table-layout:fixed;min-width:15rem}.k-calendar-input .k-button{justify-content:center}.k-calendar-input>nav{display:flex;direction:ltr;align-items:center;margin-bottom:var(--spacing-2)}.k-calendar-selects{flex-grow:1;display:flex;align-items:center;justify-content:center}[dir=ltr] .k-calendar-selects{direction:ltr}[dir=rtl] .k-calendar-selects{direction:rtl}.k-calendar-selects .k-select-input{display:flex;align-items:center;text-align:center;height:var(--button-height);padding:0 .5rem;border-radius:var(--input-rounded)}.k-calendar-selects .k-select-input:focus-within{outline:var(--outline)}.k-calendar-input th{padding-block:.5rem;color:var(--color-gray-500);font-size:var(--text-xs);text-align:center}.k-calendar-day{padding:2px}.k-calendar-day[aria-current=date] .k-button{text-decoration:underline}.k-calendar-day[aria-selected=date] .k-button,.k-calendar-day[aria-selected=date] .k-button:focus{--button-color-text: var(--color-text);--button-color-back: var(--color-blue-500)}.k-calendar-day[aria-selected=date] .k-button:focus-visible{outline-offset:2px}.k-calendar-today{padding-top:var(--spacing-2);text-align:center}.k-calendar-today .k-button{--button-width: auto;--button-padding: var(--spacing-3);font-size:var(--text-xs);text-decoration:underline}.k-coloroptions-input{--color-preview-size: var(--input-height)}.k-coloroptions-input ul{display:grid;grid-template-columns:repeat(auto-fill,var(--color-preview-size));gap:var(--spacing-2)}.k-coloroptions-input input:focus+.k-color-frame{outline:var(--outline)}.k-coloroptions-input[disabled] label{opacity:var(--opacity-disabled);cursor:not-allowed}.k-coloroptions-input input:checked+.k-color-frame{outline:1px solid var(--color-gray-600);outline-offset:2px}.k-colorpicker-input{--h: 0;--s: 0%;--l: 0%;--a: 1;--range-thumb-size: .75rem;--range-track-height: .75rem;display:flex;flex-direction:column;gap:var(--spacing-3);width:max-content}.k-colorpicker-input .k-coords-input{border-radius:var(--rounded-sm);aspect-ratio:1/1;background:linear-gradient(to bottom,transparent,#000),linear-gradient(to right,#fff,hsl(var(--h),100%,50%))}.k-colorpicker-input .k-alpha-input{color:hsl(var(--h),var(--s),var(--l))}.k-colorpicker-input .k-coloroptions-input ul{grid-template-columns:repeat(6,1fr)}.k-coords-input{position:relative;display:block!important}.k-coords-input img{width:100%}.k-coords-input-thumb{position:absolute;aspect-ratio:1/1;width:var(--range-thumb-size);background:var(--range-thumb-color);border-radius:var(--range-thumb-size);box-shadow:var(--range-thumb-shadow);transform:translate(-50%,-50%);cursor:move}.k-coords-input[data-empty=true] .k-coords-input-thumb{opacity:0}.k-coords-input-thumb:active{cursor:grabbing}.k-coords-input:focus-within{outline:var(--outline)}.k-coords-input[aria-disabled=true]{pointer-events:none;opacity:var(--opacity-disabled)}.k-coords-input .k-coords-input-thumb:focus{outline:var(--outline)}.k-hue-input{--range-track-back: linear-gradient( to right, hsl(0, 100%, 50%) 0%, hsl(60, 100%, 50%) 16.67%, hsl(120, 100%, 50%) 33.33%, hsl(180, 100%, 50%) 50%, hsl(240, 100%, 50%) 66.67%, hsl(320, 100%, 50%) 83.33%, hsl(360, 100%, 50%) 100% ) no-repeat;--range-track-height: var(--range-thumb-size)}.k-timeoptions-input{--button-height: var(--height-sm);display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-3)}.k-timeoptions-input h3{display:flex;align-items:center;padding-inline:var(--button-padding);height:var(--button-height);margin-bottom:var(--spacing-1)}.k-timeoptions-input hr{margin:var(--spacing-2) var(--spacing-3)}.k-timeoptions-input .k-button[aria-selected=time]{--button-color-text: var(--color-text);--button-color-back: var(--color-blue-500)}.k-layout-selector h3{margin-top:-.5rem;margin-bottom:var(--spacing-3)}.k-layout-selector-options{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--spacing-6)}@media screen and (min-width: 65em){.k-layout-selector-options{grid-template-columns:repeat(var(--columns),1fr)}}.k-layout-selector-option{--color-border: hsla(var(--color-gray-hs), 0%, 6%);--color-back: var(--color-white);border-radius:var(--rounded)}.k-layout-selector-option:focus-visible{outline:var(--outline);outline-offset:-1px}.k-layout-selector-option .k-grid{border:1px solid var(--color-border);gap:1px;grid-template-columns:repeat(var(--columns),1fr);cursor:pointer;background:var(--color-border);border-radius:var(--rounded);overflow:hidden;box-shadow:var(--shadow);height:5rem}.k-layout-selector-option .k-column{grid-column:span var(--span);background:var(--color-back);height:100%}.k-layout-selector-option:hover{--color-border: var(--color-gray-500);--color-back: var(--color-gray-100)}.k-layout-selector-option[aria-current=true]{--color-border: var(--color-focus);--color-back: var(--color-blue-300)}.k-tags-field-preview{--tags-gap: .25rem;--tag-text-size: var(--text-xs);padding:.375rem var(--table-cell-padding);overflow:hidden}.k-tags-field-preview .k-tags{flex-wrap:nowrap}.k-bubbles{display:flex;gap:.25rem}.k-bubbles-field-preview{--bubble-back: var(--color-light);--bubble-text: var(--color-black);padding:.375rem var(--table-cell-padding);overflow:hidden}.k-bubbles-field-preview .k-bubbles{gap:.375rem}.k-color-field-preview{--color-frame-rounded: var(--tag-rounded);--color-frame-size: var(--tag-height);padding:.375rem var(--table-cell-padding);display:flex;align-items:center;gap:var(--spacing-2)}.k-text-field-preview{padding:.325rem .75rem;overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.k-url-field-preview{padding-inline:var(--table-cell-padding)}.k-url-field-preview[data-link]{color:var(--link-color)}.k-url-field-preview a{display:inline-flex;align-items:center;height:var(--height-xs);padding-inline:var(--spacing-1);margin-inline:calc(var(--spacing-1) * -1);border-radius:var(--rounded);max-width:100%;min-width:0}.k-url-field-preview a>*{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-decoration:underline;text-underline-offset:var(--link-underline-offset)}.k-url-field-preview a:hover{color:var(--color-black)}.k-flag-field-preview{--button-height: var(--table-row-height);--button-width: 100%;outline-offset:-2px}.k-html-field-preview{padding:.375rem var(--table-cell-padding);overflow:hidden;text-overflow:ellipsis}.k-image-field-preview{height:100%}.k-link-field-preview{--tag-height: var(--height-xs);--tag-color-back: var(--color-gray-200);--tag-color-text: var(--color-black);--tag-color-toggle: var(--tag-color-text);--tag-color-toggle-border: var(--color-gray-300);--tag-color-focus-back: var(--tag-color-back);--tag-color-focus-text: var(--tag-color-text);padding-inline:var(--table-cell-padding);min-width:0}.k-link-field-preview .k-tag{min-width:0;max-width:100%}.k-link-field-preview .k-tag-text{font-size:var(--text-xs);min-width:0}.k-toggle-field-preview{padding-inline:var(--table-cell-padding)}:root{--toolbar-size: var(--height);--toolbar-text: var(--color-black);--toolbar-back: var(--color-white);--toolbar-hover: hsla(0, 0%, var(--color-l-min), .4);--toolbar-border: hsla(0, 100%, var(--color-l-min), .1);--toolbar-current: var(--color-focus)}.k-toolbar{display:flex;max-width:100%;height:var(--toolbar-size);align-items:center;overflow-x:auto;overflow-y:hidden;color:var(--toolbar-text);background:var(--toolbar-back);border-radius:var(--rounded)}.k-toolbar[data-theme=dark]{--toolbar-text: var(--color-white);--toolbar-back: var(--color-black);--toolbar-hover: hsla(0, 0%, var(--color-l-max), .2);--toolbar-border: var(--color-gray-800)}.k-toolbar>hr{height:var(--toolbar-size);width:1px;border-left:1px solid var(--toolbar-border)}.k-toolbar-button.k-button{--button-width: var(--toolbar-size);--button-height: var(--toolbar-size);--button-rounded: 0;outline-offset:-2px}.k-toolbar-button:hover{--button-color-back: var(--toolbar-hover)}.k-toolbar .k-button[aria-current=true]{--button-color-text: var(--toolbar-current)}.k-toolbar>.k-button:first-child{border-start-start-radius:var(--rounded);border-end-start-radius:var(--rounded)}.k-toolbar>.k-button:last-child{border-start-end-radius:var(--rounded);border-end-end-radius:var(--rounded)}:where(.k-textarea-input,.k-writer-input):not(:focus-within){--toolbar-text: var(--color-gray-400);--toolbar-border: var(--color-light)}:where(.k-textarea-input,.k-writer-input):focus-within .k-toolbar:not([data-inline=true]){position:sticky;top:var(--header-sticky-offset);inset-inline:0;z-index:1;box-shadow:#0000000d 0 2px 5px}.k-writer-input:not([data-toolbar-inline=true]):not([data-disabled=true]){grid-template-areas:"topbar" "content";grid-template-rows:var(--toolbar-size) 1fr;gap:0}.k-writer-input:not(:focus-within){--toolbar-current: currentColor}.k-writer-toolbar[data-inline=true]{position:absolute;z-index:calc(var(--z-dropdown) + 1);max-width:none;box-shadow:var(--shadow-toolbar)}.k-writer-toolbar:not([data-inline=true]){border-end-start-radius:0;border-end-end-radius:0;border-bottom:1px solid var(--toolbar-border)}.k-writer-toolbar:not([data-inline=true])>.k-button:first-child{border-end-start-radius:0}.k-writer-toolbar:not([data-inline=true])>.k-button:last-child{border-end-end-radius:0}:root{--bar-height: var(--height-xs)}.k-bar{display:flex;align-items:center;gap:var(--spacing-3);height:var(--bar-height);justify-content:space-between}.k-bar:where([data-align=center]){justify-content:center}.k-bar:where([data-align=end]):has(:first-child:last-child){justify-content:end}:root{--box-height: var( --field-input-height );--box-padding-inline: var(--spacing-2);--box-font-size: var(--text-sm);--box-color-back: none;--box-color-text: currentColor}.k-box{--icon-color: var(--box-color-icon);--text-font-size: var(--box-font-size);display:flex;width:100%;align-items:center;gap:var(--spacing-2);color:var(--box-color-text);background:var(--box-color-back);word-wrap:break-word}.k-box[data-theme]{--box-color-back: var(--theme-color-back);--box-color-text: var(--theme-color-text);--box-color-icon: var(--theme-color-700);min-height:var(--box-height);line-height:1.25;padding:.375rem var(--box-padding-inline);border-radius:var(--rounded)}.k-box[data-theme=text],.k-box[data-theme=white]{box-shadow:var(--shadow)}.k-box[data-theme=text]{padding:var(--spacing-6)}.k-box[data-theme=none]{padding:0}.k-box[data-align=center]{justify-content:center}:root{--bubble-size: 1.525rem;--bubble-back: var(--color-light);--bubble-rounded: var(--rounded-sm);--bubble-text: var(--color-black)}.k-bubble{width:min-content;height:var(--bubble-size);white-space:nowrap;line-height:1.5;background:var(--bubble-back);color:var(--bubble-text);border-radius:var(--bubble-rounded);overflow:hidden}.k-bubble .k-frame{width:var(--bubble-size);height:var(--bubble-size)}.k-bubble[data-has-text=true]{display:flex;gap:var(--spacing-2);align-items:center;padding-inline-end:.5rem;font-size:var(--text-xs)}.k-column{min-width:0}.k-column[data-sticky=true]{align-self:stretch}.k-column[data-sticky=true]>div{position:sticky;top:calc(var(--header-sticky-offset) + 2vh);z-index:2}.k-column[data-disabled=true]{cursor:not-allowed;opacity:.4}.k-column[data-disabled=true] *{pointer-events:none}.k-column[data-disabled=true] .k-text[data-theme=help] *{pointer-events:initial}.k-frame{--fit: contain;--ratio: 1/1;position:relative;display:flex;justify-content:center;align-items:center;aspect-ratio:var(--ratio);background:var(--back);overflow:hidden}.k-frame:where([data-theme]){--back: var(--theme-color-back);color:var(--theme-color-text)}.k-frame *:where(img,video,iframe,button){position:absolute;top:0;right:0;bottom:0;left:0;height:100%;width:100%;object-fit:var(--fit)}.k-frame>*{overflow:hidden;text-overflow:ellipsis;min-width:0;min-height:0}:root{--color-frame-back: none;--color-frame-pattern: var(--pattern-light);--color-frame-rounded: var(--rounded);--color-frame-size: 100%;--color-frame-darkness: 0%}.k-color-frame.k-frame{background:var(--color-frame-pattern);width:var(--color-frame-size);color:transparent;border-radius:var(--color-frame-rounded);overflow:hidden;background-clip:padding-box}.k-color-frame:after{border-radius:var(--color-frame-rounded);box-shadow:0 0 0 1px inset hsla(0,0%,var(--color-frame-darkness),.175);position:absolute;top:0;right:0;bottom:0;left:0;background:var(--color-frame-back);content:""}.k-panel[data-theme=dark]{--color-frame-pattern: var(--pattern-dark)}.k-dropzone{position:relative}.k-dropzone:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;display:none;pointer-events:none;z-index:1;border-radius:var(--rounded)}.k-dropzone[data-over=true]:after{display:block;background:hsla(var(--color-blue-hs),var(--color-blue-l-300),.6);outline:var(--outline)}.k-grid{--columns: 12;--grid-inline-gap: 0;--grid-block-gap: 0;display:grid;align-items:start;grid-column-gap:var(--grid-inline-gap);grid-row-gap:var(--grid-block-gap)}.k-grid>*{--width: calc(1 / var(--columns));--span: calc(var(--columns) * var(--width))}@container (min-width: 30rem){.k-grid{grid-template-columns:repeat(var(--columns),1fr)}.k-grid>*{grid-column:span var(--span)}}:root{--columns-inline-gap: clamp(.75rem, 6cqw, 6rem);--columns-block-gap: var(--spacing-8)}.k-grid[data-variant=columns]{--grid-inline-gap: var(--columns-inline-gap);--grid-block-gap: var(--columns-block-gap)}.k-grid:where([data-variant=columns],[data-variant=fields])>*{container:column / inline-size}.k-grid[data-variant=fields]{gap:var(--spacing-8)}.k-grid[data-variant=choices]{align-items:stretch;gap:2px}:root{--header-color-back: var(--color-light);--header-padding-block: var(--spacing-4);--header-sticky-offset: var(--scroll-top)}.k-header{position:relative;display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;column-gap:var(--spacing-3);border-bottom:1px solid var(--color-border);background:var(--header-color-back);padding-top:var(--header-padding-block);margin-bottom:var(--spacing-12);box-shadow:2px 0 0 0 var(--header-color-back),-2px 0 0 0 var(--header-color-back)}.k-header-title{font-size:var(--text-h1);font-weight:var(--font-h1);line-height:var(--leading-h1);margin-bottom:var(--header-padding-block);min-width:0}.k-header-title-button{display:inline-flex;text-align:start;gap:var(--spacing-2);align-items:baseline;max-width:100%;outline:0}.k-header-title-text{overflow-x:clip;text-overflow:ellipsis}.k-header-title-icon{--icon-color: var(--color-text-dimmed);border-radius:var(--rounded);transition:opacity .2s;display:grid;flex-shrink:0;place-items:center;height:var(--height-sm);width:var(--height-sm);opacity:0}.k-header-title-button:is(:hover,:focus) .k-header-title-icon{opacity:1}.k-header-title-button:is(:focus) .k-header-title-icon{outline:var(--outline)}.k-header-buttons{display:flex;gap:var(--spacing-2);margin-bottom:var(--header-padding-block)}.k-header[data-has-buttons=true]{position:sticky;top:var(--scroll-top);z-index:var(--z-toolbar)}:root:has(.k-header[data-has-buttons=true]){--header-sticky-offset: calc(var(--scroll-top) + 4rem)}:root{--icon-size: 18px;--icon-color: currentColor}.k-icon{width:var(--icon-size);height:var(--icon-size);flex-shrink:0;color:var(--icon-color)}.k-icon[data-type=loader]{animation:Spin 1.5s linear infinite}@media only screen and (-webkit-min-device-pixel-ratio: 2),not all,not all,not all,only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx){.k-button-icon [data-type=emoji]{font-size:1.25em}}.k-icon-frame [data-type=emoji]{overflow:visible}.k-image[data-back=pattern]{--back: var(--color-black) var(--pattern)}.k-image[data-back=black]{--back: var(--color-black)}.k-image[data-back=white]{--back: var(--color-white);color:var(--color-gray-900)}:root{--overlay-color-back: rgba(0, 0, 0, .6);--overlay-color-back-dimmed: rgba(0, 0, 0, .2)}.k-panel[data-theme=dark]{--overlay-color-back-dimmed: rgba(0, 0, 0, .8)}.k-overlay[open]{position:fixed;overscroll-behavior:contain;top:0;right:0;bottom:0;left:0;width:100%;height:100vh;height:100dvh;background:none;z-index:var(--z-dialog);transform:translateZ(0);overflow:hidden}.k-overlay[open]::backdrop{background:none}.k-overlay[open]>.k-portal{position:fixed;top:0;right:0;bottom:0;left:0;background:var(--overlay-color-back);overflow:auto}.k-overlay[open][data-type=dialog]>.k-portal{display:inline-flex}.k-overlay[open][data-type=dialog]>.k-portal>*{margin:auto}.k-overlay[open][data-type=drawer]>.k-portal{--overlay-color-back: var(--overlay-color-back-dimmed);display:flex;align-items:stretch;justify-content:flex-end}html[data-overlay=true]{overflow:hidden}html[data-overlay=true] body{overflow:scroll}:root{--stat-value-text-size: var(--text-2xl);--stat-info-text-color: var(--color-text-dimmed)}.k-stat{display:flex;flex-direction:column;padding:var(--spacing-3) var(--spacing-6);background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);line-height:var(--leading-normal)}.k-stat.k-link:hover{cursor:pointer;background:var(--color-gray-100)}.k-stat :where(dt,dd){display:block}.k-stat-value{order:1;font-size:var(--stat-value-text-size);margin-bottom:var(--spacing-1)}.k-stat-label{--icon-size: var(--text-sm);order:2;display:flex;justify-content:start;align-items:center;gap:var(--spacing-1);font-size:var(--text-xs)}.k-stat-info{order:3;font-size:var(--text-xs);color:var(--stat-info-text-color)}.k-stat:is([data-theme]) .k-stat-info{--stat-info-text-color: var(--theme-color-700)}.k-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(14rem,1fr));grid-auto-rows:1fr;grid-gap:var(--spacing-2px)}.k-stats[data-size=small]{--stat-value-text-size: var(--text-md)}.k-stats[data-size=medium]{--stat-value-text-size: var(--text-xl)}.k-stats[data-size=large]{--stat-value-text-size: var(--text-2xl)}.k-stats[data-size=huge]{--stat-value-text-size: var(--text-3xl)}:root{--table-cell-padding: var(--spacing-3);--table-color-back: var(--color-white);--table-color-border: var(--color-light);--table-color-hover: var(--color-gray-100);--table-color-th-back: var(--color-gray-100);--table-color-th-text: var(--color-text-dimmed);--table-row-height: var(--input-height)}.k-panel[data-theme=dark]{--table-color-border: var(--color-border)}.k-table{position:relative;background:var(--table-color-back);box-shadow:var(--shadow);border-radius:var(--rounded)}.k-table table{table-layout:fixed}.k-table th,.k-table td{padding-inline:var(--table-cell-padding);height:var(--table-row-height);overflow:hidden;text-overflow:ellipsis;width:100%;border-inline-end:1px solid var(--table-color-border);line-height:1.25}.k-table tr>*:last-child{border-inline-end:0}.k-table th,.k-table tr:not(:last-child) td{border-block-end:1px solid var(--table-color-border)}.k-table :where(td,th)[data-align]{text-align:var(--align)}.k-table th{padding-inline:var(--table-cell-padding);font-family:var(--font-mono);font-size:var(--text-xs);color:var(--table-color-th-text);background:var(--table-color-th-back)}.k-table th[data-has-button=true]{padding:0}.k-table th button{padding-inline:var(--table-cell-padding);height:100%;width:100%;border-radius:var(--rounded);text-align:start}.k-table th button:focus-visible{outline-offset:-2px}.k-table thead th:first-child{border-start-start-radius:var(--rounded)}.k-table thead th:last-child{border-start-end-radius:var(--rounded)}.k-table thead th{position:sticky;top:var(--header-sticky-offset);inset-inline:0;z-index:1}.k-table tbody tr:hover td{background:var(--table-color-hover)}.k-table tbody th{width:auto;white-space:nowrap;overflow:visible;border-radius:0}.k-table tbody tr:first-child th{border-start-start-radius:var(--rounded)}.k-table tbody tr:last-child th{border-end-start-radius:var(--rounded);border-block-end:0}.k-table-row-ghost{background:var(--color-white);outline:var(--outline);border-radius:var(--rounded);margin-bottom:2px;cursor:grabbing}.k-table-row-fallback{opacity:0!important}.k-table .k-table-index-column{width:var(--table-row-height);text-align:center}.k-table .k-table-index{font-size:var(--text-xs);color:var(--color-text-dimmed);line-height:1.1em}.k-table .k-table-index-column .k-sort-handle{--button-width: 100%;display:none}.k-table tr.k-table-sortable-row:hover .k-table-index-column .k-table-index{display:none}.k-table tr.k-table-sortable-row:hover .k-table-index-column .k-sort-handle{display:flex}.k-table .k-table-options-column{padding:0;width:var(--table-row-height);text-align:center}.k-table .k-table-options-column .k-options-dropdown-toggle{--button-width: 100%;--button-height: 100%;outline-offset:-2px}.k-table-empty{color:var(--color-text-dimmed);font-size:var(--text-sm)}.k-table[aria-disabled=true]{--table-color-back: transparent;--table-color-border: var(--color-border);--table-color-hover: transparent;--table-color-th-back: transparent;border:1px solid var(--table-color-border);box-shadow:none}.k-table[aria-disabled=true] thead th{position:static}@container (max-width: 40rem){.k-table{overflow-x:auto}.k-table thead th{position:static}.k-table .k-options-dropdown-toggle{aspect-ratio:auto!important}.k-table :where(th,td):not(.k-table-index-column,.k-table-options-column,[data-column-id=image],[data-column-id=flag]){width:auto!important}.k-table :where(th,td):not([data-mobile=true]){display:none}}.k-table-pagination{border-top:1px solid var(--table-color-border);height:var(--table-row-height);background:var(--table-color-th-back);display:flex;justify-content:center;border-end-start-radius:var(--rounded);border-end-end-radius:var(--rounded)}.k-table-pagination>.k-button{--button-color-back: transparent;border-left:0!important}.k-table .k-table-cell{padding:0}.k-tabs{--button-height: var(--height-md);--button-padding: var(--spacing-2);display:flex;gap:var(--spacing-1);margin-bottom:var(--spacing-12);margin-inline:calc(var(--button-padding) * -1)}.k-tabs-tab{position:relative}.k-tab-button.k-button{margin-block:2px;overflow-x:visible}.k-tab-button[aria-current=true]:after{position:absolute;content:"";height:2px;inset-inline:var(--button-padding);bottom:-2px;background:currentColor}.k-tabs-badge{position:absolute;top:2px;font-variant-numeric:tabular-nums;inset-inline-end:var(--button-padding);transform:translate(75%);line-height:1.5;padding:0 var(--spacing-1);border-radius:1rem;text-align:center;font-size:10px;box-shadow:var(--shadow-md);background:var(--theme-color-back);border:1px solid var(--theme-color-500);color:var(--theme-color-text);z-index:1}.k-fatal[open]{background:var(--overlay-color-back);padding:var(--spacing-6)}.k-fatal-box{position:relative;width:100%;box-shadow:var(--dialog-shadow);border-radius:var(--dialog-rounded);line-height:1;height:calc(100vh - 3rem);height:calc(100dvh - 3rem);display:flex;flex-direction:column;overflow:hidden}.k-fatal-iframe{border:0;width:100%;flex-grow:1;background:var(--color-white);padding:var(--spacing-3)}.k-icons{position:absolute;width:0;height:0}.k-notification{padding:.75rem 1.5rem;background:var(--color-gray-900);width:100%;line-height:1.25rem;color:var(--color-white);display:flex;flex-shrink:0;align-items:center}.k-notification[data-theme]{background:var(--theme-color-back);color:var(--color-black)}.k-notification p{flex-grow:1;word-wrap:break-word;overflow:hidden}.k-notification .k-button{display:flex;margin-inline-start:1rem}.k-offline-warning{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--z-offline);background:var(--overlay-color-back);display:flex;align-items:center;justify-content:center;line-height:1}.k-offline-warning p{display:flex;align-items:center;gap:.5rem;background:var(--color-white);box-shadow:var(--shadow);padding:.75rem;border-radius:var(--rounded)}.k-offline-warning p .k-icon{color:var(--color-red-400)}:root{--progress-height: var(--spacing-2);--progress-color-back: var(--color-gray-300);--progress-color-value: var(--color-focus)}progress{display:block;width:100%;height:var(--progress-height);border-radius:var(--progress-height);overflow:hidden;border:0}progress::-webkit-progress-bar{background:var(--progress-color-back)}progress::-webkit-progress-value{background:var(--progress-color-value);border-radius:var(--progress-height)}progress::-moz-progress-bar{background:var(--progress-color-value)}progress:not([value])::-webkit-progress-bar{background:var(--progress-color-value)}progress:not([value])::-moz-progress-bar{background:var(--progress-color-value)}.k-sort-handle{cursor:grab;z-index:1}.k-sort-handle:active{cursor:grabbing}.k-breadcrumb{--breadcrumb-divider: "/";overflow-x:clip;padding:2px}.k-breadcrumb ol{display:none;gap:.125rem;align-items:center}.k-breadcrumb ol li{display:flex;align-items:center;min-width:0;transition:flex-shrink .1s}.k-breadcrumb ol li:has(.k-icon){min-width:2.25rem}.k-breadcrumb ol li:not(:last-child):after{content:var(--breadcrumb-divider);opacity:.175;flex-shrink:0}.k-breadcrumb .k-icon[data-type=loader]{opacity:.5}.k-breadcrumb ol li:is(:hover,:focus-within){flex-shrink:0}.k-button.k-breadcrumb-link{flex-shrink:1;min-width:0;justify-content:flex-start}.k-breadcrumb-dropdown{display:grid}.k-breadcrumb-dropdown .k-dropdown-content{width:15rem}@container (min-width: 40em){.k-breadcrumb ol{display:flex}.k-breadcrumb-dropdown{display:none}}.k-browser{container-type:inline-size;font-size:var(--text-sm)}.k-browser-items{--browser-item-gap: 1px;--browser-item-size: 1fr;--browser-item-height: var(--height-sm);--browser-item-padding: .25rem;--browser-item-rounded: var(--rounded);display:grid;column-gap:var(--browser-item-gap);row-gap:var(--browser-item-gap);grid-template-columns:repeat(auto-fill,minmax(var(--browser-item-size),1fr))}.k-browser-item{display:flex;overflow:hidden;gap:.5rem;align-items:center;flex-shrink:0;height:var(--browser-item-height);padding-inline:calc(var(--browser-item-padding) + 1px);border-radius:var(--browser-item-rounded);white-space:nowrap;cursor:pointer}.k-browser-item-image{height:calc(var(--browser-item-height) - var(--browser-item-padding) * 2);aspect-ratio:1/1;border-radius:var(--rounded-sm);box-shadow:var(--shadow);flex-shrink:0}.k-browser-item-image.k-icon-frame{box-shadow:none;background:var(--color-white)}.k-browser-item-image svg{transform:scale(.8)}.k-browser-item input{position:absolute;box-shadow:var(--shadow);opacity:0;width:0}.k-browser-item[aria-selected]{background:var(--color-blue-300)}:root{--button-align: center;--button-height: var(--height-md);--button-width: auto;--button-color-back: none;--button-color-text: currentColor;--button-color-icon: currentColor;--button-padding: var(--spacing-2);--button-rounded: var(--spacing-1);--button-text-display: block;--button-icon-display: block}.k-button{position:relative;display:inline-flex;align-items:center;justify-content:var(--button-align);gap:.5rem;padding-inline:var(--button-padding);white-space:nowrap;line-height:1;border-radius:var(--button-rounded);background:var(--button-color-back);height:var(--button-height);width:var(--button-width);color:var(--button-color-text);font-variant-numeric:tabular-nums;overflow-x:clip;text-align:var(--button-align);flex-shrink:0}.k-button-icon{--icon-color: var(--button-color-icon);flex-shrink:0;display:var(--button-icon-display)}.k-button-text{text-overflow:ellipsis;overflow-x:clip;display:var(--button-text-display);min-width:0}.k-button:where([data-theme]){--button-color-icon: var(--theme-color-icon);--button-color-text: var(--theme-color-text)}.k-button:where([data-theme$=-icon]){--button-color-text: currentColor}.k-button:where([data-variant=dimmed]){--button-color-icon: var(--color-text);--button-color-text: var(--color-text-dimmed)}.k-button:where([data-variant=dimmed]):not([aria-disabled=true]):is(:hover,[aria-current=true]) .k-button-text{filter:brightness(75%)}.k-button:where([data-variant=dimmed][data-theme]){--button-color-icon: var(--theme-color-icon);--button-color-text: var(--theme-color-text-dimmed)}.k-button:where([data-variant=dimmed][data-theme$=-icon]){--button-color-text: var(--color-text-dimmed)}.k-button:where([data-variant=filled]){--button-color-back: var(--color-gray-300)}.k-button:where([data-variant=filled]):not([aria-disabled=true]):hover{filter:brightness(97%)}.k-panel[data-theme=dark] .k-button:where([data-variant=filled]):not([aria-disabled=true]):hover{filter:brightness(87%)}.k-button:where([data-variant=filled][data-theme]){--button-color-icon: var(--theme-color-700);--button-color-back: var(--theme-color-back)}.k-button:where([data-theme$=-icon][data-variant=filled]){--button-color-icon: hsl( var(--theme-color-hs), 57% );--button-color-back: var(--color-gray-300)}.k-button:not([data-has-text=true]){--button-padding: 0;aspect-ratio:1/1}@container (max-width: 30rem){.k-button[data-responsive=true][data-has-icon=true]{--button-padding: 0;aspect-ratio:1/1;--button-text-display: none}.k-button[data-responsive=text][data-has-text=true]{--button-icon-display: none}.k-button[data-responsive=true][data-has-icon=true] .k-button-arrow{display:none}}.k-button:not(button,a,summary,label,.k-link){pointer-events:none}.k-button:where([data-size=xs]){--button-height: var(--height-xs);--button-padding: .325rem}.k-button:where([data-size=sm]){--button-height: var(--height-sm);--button-padding: .5rem}.k-button:where([data-size=lg]){--button-height: var(--height-lg)}.k-button-arrow{width:max-content;margin-inline-start:-.25rem;margin-inline-end:-.125rem}.k-button:where([aria-disabled=true]){cursor:not-allowed}.k-button:where([aria-disabled=true])>*{opacity:var(--opacity-disabled)}.k-button-group{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}.k-button-group:where([data-layout=collapsed]){gap:0;flex-wrap:nowrap}.k-button-group[data-layout=collapsed]>.k-button[data-variant=filled]:not(:last-child){border-start-end-radius:0;border-end-end-radius:0}.k-button-group[data-layout=collapsed]>.k-button[data-variant=filled]:not(:first-child){border-start-start-radius:0;border-end-start-radius:0;border-left:1px solid var(--theme-color-500, var(--color-gray-400))}.k-button-group[data-layout=collapsed]>.k-button[data-variant=filled]:focus-visible{z-index:1;border-radius:var(--button-rounded)}.k-file-browser{container-type:inline-size;overflow:hidden}.k-file-browser-layout{display:grid;grid-template-columns:minmax(10rem,15rem) 1fr;grid-template-rows:1fr auto;grid-template-areas:"tree items" "tree pagination"}.k-file-browser-tree{grid-area:tree;padding:var(--spacing-2);border-right:1px solid var(--color-gray-300)}.k-file-browser-items{grid-area:items;padding:var(--spacing-2);background:var(--color-gray-100)}.k-file-browser-back-button{display:none}.k-file-browser-pagination{background:var(--color-gray-100);padding:var(--spacing-2);display:flex;justify-content:end}@container (max-width: 30rem){.k-file-browser-layout{grid-template-columns:minmax(0,1fr);min-height:10rem}.k-file-browser-back-button{width:100%;height:var(--height-sm);display:flex;align-items:center;justify-content:flex-start;padding-inline:.25rem;margin-bottom:.5rem;background:var(--color-gray-200);border-radius:var(--rounded)}.k-file-browser-tree{border-right:0}.k-file-browser-pagination{justify-content:start}.k-file-browser[data-view=files] .k-file-browser-layout{grid-template-rows:1fr auto;grid-template-areas:"items" "pagination"}.k-file-browser[data-view=files] .k-file-browser-tree,.k-file-browser[data-view=tree] .k-file-browser-items,.k-file-browser[data-view=tree] .k-file-browser-pagination{display:none}}:root{--tree-color-back: var(--color-gray-200);--tree-color-hover-back: var(--color-gray-300);--tree-color-selected-back: var(--color-blue-300);--tree-color-selected-text: var(--color-black);--tree-color-text: var(--color-gray-dimmed);--tree-level: 0;--tree-indentation: .6rem}.k-tree-branch{display:flex;align-items:center;padding-inline-start:calc(var(--tree-level) * var(--tree-indentation));margin-bottom:1px}.k-tree-branch[data-has-subtree=true]{inset-block-start:calc(var(--tree-level) * 1.5rem);z-index:calc(100 - var(--tree-level));background:var(--tree-color-back)}.k-tree-branch:hover,li[aria-current=true]>.k-tree-branch{--tree-color-text: var(--tree-color-selected-text);background:var(--tree-color-hover-back);border-radius:var(--rounded)}li[aria-current=true]>.k-tree-branch{background:var(--tree-color-selected-back)}.k-tree-toggle{--icon-size: 12px;width:1rem;aspect-ratio:1/1;display:grid;place-items:center;padding:0;border-radius:var(--rounded-sm);margin-inline-start:.25rem;flex-shrink:0}.k-tree-toggle:hover{background:#00000013}.k-tree-toggle[disabled]{visibility:hidden}.k-tree-folder{display:flex;height:var(--height-sm);border-radius:var(--rounded-sm);padding-inline:.25rem;width:100%;align-items:center;gap:.325rem;min-width:3rem;line-height:1.25;font-size:var(--text-sm)}@container (max-width: 15rem){.k-tree{--tree-indentation: .375rem}.k-tree-folder{padding-inline:.125rem}.k-tree-folder .k-icon{display:none}}.k-tree-folder>.k-frame{flex-shrink:0}.k-tree-folder-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:currentColor}.k-tree-folder[disabled]{opacity:var(--opacity-disabled)}.k-pagination{flex-shrink:0}.k-pagination-details{--button-padding: var(--spacing-3);font-size:var(--text-xs)}.k-pagination-selector{--button-height: var(--height);--dropdown-padding: 0;overflow:visible}.k-pagination-selector form{display:flex;align-items:center;justify-content:space-between}.k-pagination-selector label{display:flex;align-items:center;gap:var(--spacing-2);padding-inline-start:var(--spacing-3)}.k-pagination-selector select{--height: calc(var(--button-height) - .5rem);width:auto;min-width:var(--height);height:var(--height);text-align:center;background:var(--color-gray-800);color:var(--color-white);border-radius:var(--rounded-sm)}.k-prev-next{direction:ltr;flex-shrink:0}.k-search-bar-input{--button-height: var(--input-height);display:flex;align-items:center}.k-search-bar-types{flex-shrink:0;border-inline-end:1px solid var(--color-border)}.k-search-bar-input input{flex-grow:1;padding-inline:.75rem;height:var(--input-height);line-height:var(--input-height);border-radius:var(--rounded);font-size:var(--input-font-size)}.k-search-bar-input input:focus{outline:0}.k-search-bar-input .k-search-bar-close{flex-shrink:0}.k-search-bar-results{border-top:1px solid var(--color-border);padding:1rem}.k-search-bar-results .k-item[data-selected=true]{outline:var(--outline)}.k-search-bar-footer{text-align:center}.k-search-bar-footer p{color:var(--color-text-dimmed)}.k-search-bar-footer .k-button{margin-top:var(--spacing-4)}.k-section+.k-section{margin-top:var(--columns-block-gap)}.k-section-header{display:flex;justify-content:space-between;align-items:center;gap:var(--spacing-6);margin-bottom:var(--spacing-2)}.k-section-buttons{flex-shrink:0}.k-fields-section input[type=submit]{display:none}[data-locked=true] .k-fields-section{opacity:.2;pointer-events:none}.k-models-section[data-processing=true]{pointer-events:none}.k-models-section-search.k-input{--input-color-back: var(--color-gray-300);--input-color-border: transparent;margin-bottom:var(--spacing-3)}:root{--code-color-back: var(--color-black);--code-color-icon: var(--color-gray-500);--code-color-text: var(--color-gray-200, var(--color-white));--code-font-family: var(--font-mono);--code-font-size: 1em;--code-inline-color-back: var(--color-blue-300);--code-inline-color-border: var(--color-blue-400);--code-inline-color-text: var(--color-blue-900);--code-inline-font-size: .9em;--code-padding: var(--spacing-3)}.k-panel[data-theme=dark]{--code-color-back: var(--color-gray-100);--code-color-text: var(--color-text)}code{font-family:var(--code-font-family);font-size:var(--code-font-size);font-weight:var(--font-normal)}.k-code,.k-text pre{position:relative;display:block;max-width:100%;padding:var(--code-padding);border-radius:var(--rounded, .5rem);background:var(--code-color-back);color:var(--code-color-text);white-space:nowrap;overflow-y:hidden;overflow-x:auto;line-height:1.5;-moz-tab-size:2;tab-size:2}.k-code:not(code),.k-text pre{white-space:pre-wrap}.k-code:before{position:absolute;content:attr(data-language);inset-block-start:0;inset-inline-end:0;padding:.5rem .5rem .25rem .25rem;font-size:calc(.75 * var(--text-xs));background:var(--code-color-back);border-radius:var(--rounded, .5rem)}.k-text>code,.k-text *:not(pre)>code{display:inline-flex;padding-inline:var(--spacing-1);font-size:var(--code-inline-font-size);color:var(--code-inline-color-text);background:var(--code-inline-color-back);border-radius:var(--rounded);outline:1px solid var(--code-inline-color-border);outline-offset:-1px}:root{--text-h1: 2em;--text-h2: 1.75em;--text-h3: 1.5em;--text-h4: 1.25em;--text-h5: 1.125em;--text-h6: 1em;--font-h1: var(--font-semi);--font-h2: var(--font-semi);--font-h3: var(--font-semi);--font-h4: var(--font-semi);--font-h5: var(--font-semi);--font-h6: var(--font-semi);--leading-h1: 1.125;--leading-h2: 1.125;--leading-h3: 1.25;--leading-h4: 1.375;--leading-h5: 1.5;--leading-h6: 1.5}.k-headline{line-height:1.5em;font-weight:var(--font-bold)}.h1,.k-text h1,.k-headline[data-size=huge]{color:var(--color-h1, var(--color-h));font-family:var(--font-family-h1);font-size:var(--text-h1);font-weight:var(--font-h1);line-height:var(--leading-h1)}.h2,.k-text h2,.k-headline[data-size=large]{color:var(--color-h2, var(--color-h));font-family:var(--font-family-h2);font-size:var(--text-h2);font-weight:var(--font-h2);line-height:var(--leading-h2)}.h3,.k-text h3{color:var(--color-h3, var(--color-h));font-family:var(--font-family-h3);font-size:var(--text-h3);font-weight:var(--font-h3);line-height:var(--leading-h3)}.h4,.k-text h4,.k-headline[data-size=small]{color:var(--color-h4, var(--color-h));font-family:var(--font-family-h4);font-size:var(--text-h4);font-weight:var(--font-h4);line-height:var(--leading-h4)}.h5,.k-text h5{color:var(--color-h5, var(--color-h));font-family:var(--font-family-h5);font-size:var(--text-h5);font-weight:var(--font-h5);line-height:var(--leading-h5)}.h6,.k-text h6{color:var(--color-h6, var(--color-h));font-family:var(--font-family-h6);font-size:var(--text-h6);font-weight:var(--font-h6);line-height:var(--leading-h6)}.k-text>*+h6{margin-block-start:calc(var(--text-line-height) * 1.5em)}.k-label{position:relative;display:flex;align-items:center;height:var(--height-xs);font-weight:var(--font-semi);min-width:0;flex:1}[aria-disabled=true] .k-label{opacity:var(--opacity-disabled);cursor:not-allowed}.k-label>a{display:inline-flex;height:var(--height-xs);align-items:center;padding-inline:var(--spacing-2);margin-inline-start:calc(-1 * var(--spacing-2));border-radius:var(--rounded);min-width:0}.k-label-text{text-overflow:ellipsis;white-space:nowrap;overflow-x:clip;min-width:0}.k-label abbr{font-size:var(--text-xs);color:var(--color-gray-500);margin-inline-start:var(--spacing-1)}.k-label abbr.k-label-invalid{display:none;color:var(--color-red-700)}:where(.k-field:has(:invalid),.k-section:has([data-invalid=true]))>header>.k-label abbr.k-label-invalid{display:inline-block}.k-field:has(:invalid)>.k-field-header>.k-label abbr:has(+abbr.k-label-invalid){display:none}:root{--text-font-size: 1em;--text-line-height: 1.5;--link-color: var(--color-blue-800);--link-underline-offset: 2px}.k-text{font-size:var(--text-font-size);line-height:var(--text-line-height)}.k-text[data-size=tiny]{--text-font-size: var(--text-xs)}.k-text[data-size=small]{--text-font-size: var(--text-sm)}.k-text[data-size=medium]{--text-font-size: var(--text-md)}.k-text[data-size=large]{--text-font-size: var(--text-xl)}.k-text[data-align]{text-align:var(--align)}.k-text>:where(audio,blockquote,details,div,figure,h1,h2,h3,h4,h5,h6,hr,iframe,img,object,ol,p,picture,pre,table,ul)+*{margin-block-start:calc(var(--text-line-height) * 1em)}.k-text :where(.k-link,a){color:var(--link-color);text-decoration:underline;text-underline-offset:var(--link-underline-offset);border-radius:var(--rounded-xs);outline-offset:2px}.k-text ol,.k-text ul{padding-inline-start:1.75em}.k-text ol{list-style:numeric}.k-text ol>li{list-style:decimal}.k-text ul>li{list-style:disc}.k-text ul ul>li{list-style:circle}.k-text ul ul ul>li{list-style:square}.k-text blockquote{font-size:var(--text-lg);line-height:1.25;padding-inline-start:var(--spacing-4);border-inline-start:2px solid var(--color-black)}.k-text img{border-radius:var(--rounded)}.k-text iframe{width:100%;aspect-ratio:16/9;border-radius:var(--rounded)}.k-text hr{background:var(--color-border);height:1px}.k-help{color:var(--color-text-dimmed)}.k-upload-item-preview{--icon-size: 24px;grid-area:preview;display:flex;aspect-ratio:1/1;width:100%;height:100%;overflow:hidden;border-start-start-radius:var(--rounded);border-end-start-radius:var(--rounded)}.k-upload-item-preview:focus{border-radius:var(--rounded);outline:2px solid var(--color-focus);z-index:1}.k-upload-item{accent-color:var(--color-focus);display:grid;grid-template-areas:"preview input input" "preview body toggle";grid-template-columns:6rem 1fr auto;grid-template-rows:var(--input-height) 1fr;border-radius:var(--rounded);background:var(--color-white);box-shadow:var(--shadow);min-height:6rem}.k-upload-item-body{grid-area:body;display:flex;flex-direction:column;justify-content:space-between;padding:var(--spacing-2) var(--spacing-3);min-width:0}.k-upload-item-input.k-input{--input-color-border: transparent;--input-padding: var(--spacing-2) var(--spacing-3);--input-rounded: 0;grid-area:input;font-size:var(--text-sm);border-bottom:1px solid var(--color-light);border-start-end-radius:var(--rounded)}.k-upload-item-input.k-input:focus-within{outline:2px solid var(--color-focus);z-index:1;border-radius:var(--rounded)}.k-upload-item-input.k-input[data-disabled=true]{--input-color-back: var(--color-white)}.k-upload-item-input .k-input-after{color:var(--color-gray-600)}.k-upload-item-meta{font-size:var(--text-xs);color:var(--color-gray-600)}.k-upload-item-error{font-size:var(--text-xs);margin-top:.25rem;color:var(--color-red-700)}.k-upload-item-progress{--progress-height: .25rem;--progress-color-back: var(--color-light);margin-bottom:.3125rem}.k-upload-item-toggle{grid-area:toggle;align-self:end}.k-upload-item-toggle>*{padding:var(--spacing-3)}.k-upload-item[data-completed=true] .k-upload-item-progress{--progress-color-value: var(--color-green-400)}.k-upload-items{display:grid;gap:.25rem}.k-activation{position:relative;display:flex;color:var(--dropdown-color-text);background:var(--dropdown-color-bg);border-radius:var(--dropdown-rounded);box-shadow:var(--dropdown-shadow);justify-content:space-between}.k-activation p{padding-inline-start:var(--spacing-3);padding-inline-end:var(--spacing-2);padding-block:.425rem;line-height:1.25}.k-activation p strong{font-weight:var(--font-normal);margin-inline-end:var(--spacing-1)}.k-activation p :where(button,a){color:var(--color-pink-400);text-decoration:underline;text-decoration-color:currentColor;text-underline-offset:2px;border-radius:var(--rounded-sm)}.k-panel[data-theme=dark] .k-activation p :where(button,a){color:var(--color-pink-600)}.k-activation-toggle{--button-color-text: var(--color-gray-400);--button-rounded: 0;border-left:1px solid var(--dropdown-color-hr)}.k-activation-toggle:is(:hover,:focus){--button-color-text: var(--color-white)}.k-activation-toggle:focus{--button-rounded: var(--rounded)}:root{--main-padding-inline: clamp(var(--spacing-6), 5cqw, var(--spacing-24))}.k-panel-main{min-height:100vh;min-height:100dvh;padding:var(--spacing-3) var(--main-padding-inline) var(--spacing-24);container:main / inline-size;margin-inline-start:var(--main-start)}.k-panel-notification{--button-height: var(--height-md);--button-color-icon: var(--theme-color-900);--button-color-text: var(--theme-color-900);border:1px solid var(--theme-color-500);position:fixed;inset-block-end:var(--menu-padding);inset-inline-end:var(--menu-padding);box-shadow:var(--dropdown-shadow);z-index:var(--z-notification)}:root{--menu-button-height: var(--height);--menu-button-width: 100%;--menu-color-back: var(--color-gray-250);--menu-color-border: var(--color-gray-300);--menu-display: none;--menu-display-backdrop: block;--menu-padding: var(--spacing-3);--menu-shadow: var(--shadow-xl);--menu-toggle-height: var(--menu-button-height);--menu-toggle-width: 1rem;--menu-width-closed: calc( var(--menu-button-height) + 2 * var(--menu-padding) );--menu-width-open: 12rem;--menu-width: var(--menu-width-open)}.k-panel-menu{position:fixed;inset-inline-start:0;inset-block:0;z-index:var(--z-navigation);display:var(--menu-display);width:var(--menu-width);background-color:var(--menu-color-back);border-right:1px solid var(--menu-color-border);box-shadow:var(--menu-shadow)}.k-panel-menu-body{display:flex;flex-direction:column;gap:var(--spacing-4);padding:var(--menu-padding);overscroll-behavior:contain;overflow-x:hidden;overflow-y:auto;height:100%}.k-panel-menu-search{margin-bottom:var(--spacing-8)}.k-panel-menu-buttons{display:flex;flex-direction:column;width:100%}.k-panel-menu-buttons[data-second-last=true]{flex-grow:1}.k-panel-menu-buttons:last-child{justify-content:flex-end}.k-panel-menu-button{--button-align: flex-start;--button-height: var(--menu-button-height);--button-width: var(--menu-button-width);--button-padding: 7px;flex-shrink:0}.k-panel-menu-button[aria-current=true]{--button-color-back: var(--color-white);box-shadow:var(--shadow)}.k-panel[data-theme=dark] .k-panel-menu-button[aria-current=true]{--button-color-back: var(--color-gray-400)}.k-panel-menu-button:focus{z-index:1}.k-panel[data-menu=true]{--menu-button-width: 100%;--menu-display: block;--menu-width: var(--menu-width-open)}.k-panel[data-menu=true]:after{content:"";position:fixed;top:0;right:0;bottom:0;left:0;background:var(--overlay-color-back);display:var(--menu-display-backdrop);pointer-events:none}.k-panel-menu-toggle{--button-align: flex-start;--button-height: 100%;--button-width: var(--menu-toggle-width);position:absolute;inset-block:0;inset-inline-start:100%;align-items:flex-start;border-radius:0;overflow:visible;opacity:0;transition:opacity .2s}.k-panel-menu-toggle:focus{outline:0}.k-panel-menu-toggle .k-button-icon{display:grid;place-items:center;height:var(--menu-toggle-height);width:var(--menu-toggle-width);margin-top:var(--menu-padding);border-block:1px solid var(--menu-color-border);border-inline-end:1px solid var(--menu-color-border);background:var(--menu-color-back);border-start-end-radius:var(--button-rounded);border-end-end-radius:var(--button-rounded)}@media (max-width: 60rem){.k-panel-menu .k-activation-button{margin-bottom:var(--spacing-3)}.k-panel-menu .k-activation-toggle{display:none}}@media (min-width: 60rem){.k-panel{--menu-display: block;--menu-display-backdrop: none;--menu-shadow: none;--main-start: var(--menu-width)}.k-panel[data-menu=false]{--menu-button-width: var(--menu-button-height);--menu-width: var(--menu-width-closed)}.k-panel-menu-proxy{display:none}.k-panel-menu-toggle:focus-visible,.k-panel-menu[data-hover=true] .k-panel-menu-toggle{opacity:1}.k-panel-menu-toggle:focus-visible .k-button-icon{outline:var(--outline);border-radius:var(--button-rounded)}.k-panel-menu-search[aria-disabled=true]{opacity:0}.k-panel-menu .k-activation{position:absolute;bottom:var(--menu-padding);inset-inline-start:100%;height:var(--height-md);width:max-content;margin-left:var(--menu-padding)}.k-panel-menu .k-activation:before{position:absolute;content:"";top:50%;left:-4px;margin-top:-4px;border-top:4px solid transparent;border-right:4px solid var(--color-black);border-bottom:4px solid transparent}.k-panel-menu .k-activation p :where(button,a){padding-inline:var(--spacing-1)}.k-panel-menu .k-activation-toggle{border-left:1px solid var(--dropdown-color-hr)}}.k-panel.k-panel-outside{display:grid;grid-template-rows:1fr;place-items:center;min-height:100vh;min-height:100dvh;padding:var(--spacing-6)}:root{--scroll-top: 0rem}html{overflow-x:hidden;overflow-y:scroll;background:var(--color-light);color:var(--color-text)}body{font-size:var(--text-sm);color:var(--color-text)}.k-panel[data-loading=true]{animation:LoadingCursor .5s}.k-panel[data-loading=true]:after,.k-panel[data-dragging=true]{-webkit-user-select:none;user-select:none}.k-topbar{position:relative;margin-inline:calc(var(--button-padding) * -1);margin-bottom:var(--spacing-8);display:flex;align-items:center;gap:var(--spacing-1)}.k-topbar-breadcrumb{margin-inline-start:-2px;flex-shrink:1;min-width:0}.k-topbar-spacer{flex-grow:1}.k-topbar-signals{display:flex;align-items:center}.k-search-view .k-header{margin-bottom:0}.k-header+.k-search-view-results{margin-top:var(--spacing-12)}.k-search-view-input{--input-color-border: transparent;--input-color-back: var(--color-gray-300);--input-height: var(--height-md);width:40cqw}.k-file-view-header,.k-file-view[data-has-tabs=true] .k-file-preview{margin-bottom:0}:root{--file-preview-back: var(--color-gray-900);--file-preview-text: hsla(0, 100%, var(--color-l-max), .75)}.k-panel[data-theme=dark]{--file-preview-back: var(--color-gray-100);--file-preview-text: hsla(0, 100%, var(--color-l-min), .75)}.k-file-preview{display:grid;align-items:stretch;background:var(--file-preview-back);border-radius:var(--rounded-lg);margin-bottom:var(--spacing-12);overflow:hidden}.k-file-preview-details{display:grid}.k-file-preview-details dl{display:grid;grid-template-columns:repeat(auto-fill,minmax(14rem,1fr));grid-gap:var(--spacing-6) var(--spacing-12);align-self:center;line-height:1.5em;padding:var(--spacing-6)}.k-file-preview-details dt{font-size:var(--text-sm);font-weight:500;font-weight:var(--font-semi);color:var(--color-gray-500);margin-bottom:var(--spacing-1)}.k-file-preview-details :where(dd,a){font-size:var(--text-xs);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--file-preview-text);font-size:var(--text-sm)}.k-file-preview-frame-column{aspect-ratio:1/1;background:var(--pattern)}.k-file-preview-frame{display:flex;align-items:center;justify-content:center;height:100%;padding:var(--spacing-10);container-type:size}.k-file-preview-frame :where(img,audio,video){width:auto;max-width:100cqw;max-height:100cqh}.k-file-preview-frame>.k-button{position:absolute;top:var(--spacing-2);inset-inline-start:var(--spacing-2)}.k-button.k-file-preview-frame-dropdown-toggle{--button-color-icon: var(--color-gray-500)}.k-panel[data-theme=dark] .k-button.k-file-preview-frame-dropdown-toggle{--button-color-icon: var(--color-gray-700)}.k-default-file-preview .k-file-preview-frame>.k-icon{--icon-size: 3rem}@container (min-width: 36rem){.k-default-file-preview{grid-template-columns:50% auto}.k-default-file-preview-thumb-column{aspect-ratio:auto}}@container (min-width: 65rem){.k-default-file-preview{grid-template-columns:33.333% auto}.k-default-file-preview-thumb-column{aspect-ratio:1/1}}.k-audio-file-preview{display:block}.k-audio-file-preview audio{width:100%}.k-audio-file-preview audio::-webkit-media-controls-enclosure{border-radius:0}.k-image-file-preview .k-coords-input{--opacity-disabled: 1;--range-thumb-color: hsl(216 60% 60% / .75);--range-thumb-size: 1.25rem;--range-thumb-shadow: none;cursor:crosshair}.k-image-file-preview .k-coords-input-thumb:after{--size: .4rem;--pos: calc(50% - (var(--size) / 2));position:absolute;top:var(--pos);inset-inline-start:var(--pos);width:var(--size);height:var(--size);content:"";background:#fff;border-radius:50%}.k-image-file-preview:not([data-has-focus=true]) .k-coords-input-thumb{display:none}.k-image-file-preview-focus dd{display:flex;align-items:center}.k-image-file-preview-focus .k-button{--button-padding: var(--spacing-2);--button-color-back: var(--color-gray-800)}.k-video-file-preview .k-file-preview-frame-column{aspect-ratio:16/9}@container (min-width: 60rem){.k-video-file-preview{grid-template-columns:50% auto}}.k-installation-dialog{--dialog-color-back: var(--color-white);--dialog-shadow: var(--shadow);container-type:inline-size}.k-installation-view .k-button{margin-top:var(--spacing-3);width:100%}.k-installation-view form .k-button{margin-top:var(--spacing-10)}.k-installation-view .k-headline{font-weight:var(--font-semi);margin-top:-.5rem;margin-bottom:.75rem}.k-installation-issues{line-height:1.5em;font-size:var(--text-sm)}.k-installation-issues li{position:relative;padding:var(--spacing-6);background:var(--color-red-300);padding-inline-start:3.5rem;border-radius:var(--rounded)}.k-installation-issues .k-icon{position:absolute;top:calc(1.5rem + 2px);inset-inline-start:1.5rem}.k-installation-issues .k-icon{color:var(--color-red-700)}.k-installation-issues li:not(:last-child){margin-bottom:2px}.k-installation-issues li code{font:inherit;color:var(--color-red-700)}.k-login-code-form .k-user-info{margin-bottom:var(--spacing-6)}.k-login-form{position:relative}.k-login-form label abbr{visibility:hidden}.k-login-toggler{position:absolute;top:-2px;inset-inline-end:calc(var(--spacing-2) * -1);color:var(--link-color);text-decoration:underline;text-decoration-color:var(--link-color);text-underline-offset:1px;height:var(--height-xs);line-height:1;padding-inline:var(--spacing-2);border-radius:var(--rounded);z-index:1}.k-login{--dialog-color-back: var(--color-white);--dialog-shadow: var(--shadow);container-type:inline-size}.k-login-buttons{--button-padding: var(--spacing-3);display:flex;gap:1.5rem;align-items:center;justify-content:space-between;margin-top:var(--spacing-10)}.k-page-view[data-has-tabs=true] .k-page-view-header,.k-site-view[data-has-tabs=true] .k-site-view-header{margin-bottom:0}.k-user-name-placeholder{color:var(--color-gray-500);transition:color .3s}.k-user-view-header[data-editable=true] .k-user-name-placeholder:hover{color:var(--color-gray-900)}.k-user-view-header{margin-bottom:0;border-bottom:0}.k-user-view .k-user-profile{margin-bottom:var(--spacing-12)}.k-user-view[data-has-tabs=true] .k-user-profile{margin-bottom:0}.k-password-reset-view .k-user-info{margin-bottom:var(--spacing-8)}.k-user-view-image{padding:0}.k-user-view-image .k-frame{width:6rem;height:6rem;border-radius:var(--rounded);line-height:0}.k-user-view-image .k-icon-frame{--back: var(--color-black);--icon-color: var(--color-gray-200)}.k-user-info{display:flex;align-items:center;font-size:var(--text-sm);height:var(--height-lg);gap:.75rem;padding-inline:var(--spacing-2);background:var(--color-white);box-shadow:var(--shadow)}.k-user-info :where(.k-image-frame,.k-icon-frame){width:1.5rem;border-radius:var(--rounded-sm)}.k-user-profile{--button-height: auto;padding:var(--spacing-2);background:var(--color-white);border-radius:var(--rounded-lg);display:flex;align-items:center;gap:var(--spacing-3);box-shadow:var(--shadow)}.k-user-profile .k-button-group{display:flex;flex-direction:column;align-items:flex-start}.k-users-view-header{margin-bottom:0}.k-system-info .k-stat-label{color:var(--theme, var(--color-black))}.k-table-update-status-cell{padding:0 .75rem;display:flex;align-items:center;height:100%}.k-table-update-status-cell-version,.k-table-update-status-cell-button{font-variant-numeric:tabular-nums}.k-plugin-info{display:grid;column-gap:var(--spacing-3);row-gap:2px;padding:var(--button-padding)}.k-plugin-info dt{color:var(--color-gray-400)}.k-plugin-info dd[data-theme]{color:var(--theme-color-600)}@container (max-width: 30em){.k-plugin-info dd:not(:last-of-type){margin-bottom:var(--spacing-2)}}@container (min-width: 30em){.k-plugin-info{width:20rem;grid-template-columns:1fr auto}}:root{--color-l-max: 100%;--color-l-100: 98%;--color-l-200: 94%;--color-l-300: 88%;--color-l-400: 80%;--color-l-500: 70%;--color-l-600: 60%;--color-l-700: 45%;--color-l-800: 30%;--color-l-900: 15%;--color-l-min: 0%;--color-red-h: 0;--color-red-s: 80%;--color-red-hs: var(--color-red-h), var(--color-red-s);--color-red-boost: 3%;--color-red-l-100: calc(var(--color-l-100) + var(--color-red-boost));--color-red-l-200: calc(var(--color-l-200) + var(--color-red-boost));--color-red-l-300: calc(var(--color-l-300) + var(--color-red-boost));--color-red-l-400: calc(var(--color-l-400) + var(--color-red-boost));--color-red-l-500: calc(var(--color-l-500) + var(--color-red-boost));--color-red-l-600: calc(var(--color-l-600) + var(--color-red-boost));--color-red-l-700: calc(var(--color-l-700) + var(--color-red-boost));--color-red-l-800: calc(var(--color-l-800) + var(--color-red-boost));--color-red-l-900: calc(var(--color-l-900) + var(--color-red-boost));--color-red-100: hsl(var(--color-red-hs), var(--color-red-l-100));--color-red-200: hsl(var(--color-red-hs), var(--color-red-l-200));--color-red-300: hsl(var(--color-red-hs), var(--color-red-l-300));--color-red-400: hsl(var(--color-red-hs), var(--color-red-l-400));--color-red-500: hsl(var(--color-red-hs), var(--color-red-l-500));--color-red-600: hsl(var(--color-red-hs), var(--color-red-l-600));--color-red-700: hsl(var(--color-red-hs), var(--color-red-l-700));--color-red-800: hsl(var(--color-red-hs), var(--color-red-l-800));--color-red-900: hsl(var(--color-red-hs), var(--color-red-l-900));--color-orange-h: 28;--color-orange-s: 80%;--color-orange-hs: var(--color-orange-h), var(--color-orange-s);--color-orange-boost: 2.5%;--color-orange-l-100: calc(var(--color-l-100) + var(--color-orange-boost));--color-orange-l-200: calc(var(--color-l-200) + var(--color-orange-boost));--color-orange-l-300: calc(var(--color-l-300) + var(--color-orange-boost));--color-orange-l-400: calc(var(--color-l-400) + var(--color-orange-boost));--color-orange-l-500: calc(var(--color-l-500) + var(--color-orange-boost));--color-orange-l-600: calc(var(--color-l-600) + var(--color-orange-boost));--color-orange-l-700: calc(var(--color-l-700) + var(--color-orange-boost));--color-orange-l-800: calc(var(--color-l-800) + var(--color-orange-boost));--color-orange-l-900: calc(var(--color-l-900) + var(--color-orange-boost));--color-orange-100: hsl(var(--color-orange-hs), var(--color-orange-l-100));--color-orange-200: hsl(var(--color-orange-hs), var(--color-orange-l-200));--color-orange-300: hsl(var(--color-orange-hs), var(--color-orange-l-300));--color-orange-400: hsl(var(--color-orange-hs), var(--color-orange-l-400));--color-orange-500: hsl(var(--color-orange-hs), var(--color-orange-l-500));--color-orange-600: hsl(var(--color-orange-hs), var(--color-orange-l-600));--color-orange-700: hsl(var(--color-orange-hs), var(--color-orange-l-700));--color-orange-800: hsl(var(--color-orange-hs), var(--color-orange-l-800));--color-orange-900: hsl(var(--color-orange-hs), var(--color-orange-l-900));--color-yellow-h: 47;--color-yellow-s: 80%;--color-yellow-hs: var(--color-yellow-h), var(--color-yellow-s);--color-yellow-boost: 0%;--color-yellow-l-100: calc(var(--color-l-100) + var(--color-yellow-boost));--color-yellow-l-200: calc(var(--color-l-200) + var(--color-yellow-boost));--color-yellow-l-300: calc(var(--color-l-300) + var(--color-yellow-boost));--color-yellow-l-400: calc(var(--color-l-400) + var(--color-yellow-boost));--color-yellow-l-500: calc(var(--color-l-500) + var(--color-yellow-boost));--color-yellow-l-600: calc(var(--color-l-600) + var(--color-yellow-boost));--color-yellow-l-700: calc(var(--color-l-700) + var(--color-yellow-boost));--color-yellow-l-800: calc(var(--color-l-800) + var(--color-yellow-boost));--color-yellow-l-900: calc(var(--color-l-900) + var(--color-yellow-boost));--color-yellow-100: hsl(var(--color-yellow-hs), var(--color-yellow-l-100));--color-yellow-200: hsl(var(--color-yellow-hs), var(--color-yellow-l-200));--color-yellow-300: hsl(var(--color-yellow-hs), var(--color-yellow-l-300));--color-yellow-400: hsl(var(--color-yellow-hs), var(--color-yellow-l-400));--color-yellow-500: hsl(var(--color-yellow-hs), var(--color-yellow-l-500));--color-yellow-600: hsl(var(--color-yellow-hs), var(--color-yellow-l-600));--color-yellow-700: hsl(var(--color-yellow-hs), var(--color-yellow-l-700));--color-yellow-800: hsl(var(--color-yellow-hs), var(--color-yellow-l-800));--color-yellow-900: hsl(var(--color-yellow-hs), var(--color-yellow-l-900));--color-green-h: 80;--color-green-s: 60%;--color-green-hs: var(--color-green-h), var(--color-green-s);--color-green-boost: -2.5%;--color-green-l-100: calc(var(--color-l-100) + var(--color-green-boost));--color-green-l-200: calc(var(--color-l-200) + var(--color-green-boost));--color-green-l-300: calc(var(--color-l-300) + var(--color-green-boost));--color-green-l-400: calc(var(--color-l-400) + var(--color-green-boost));--color-green-l-500: calc(var(--color-l-500) + var(--color-green-boost));--color-green-l-600: calc(var(--color-l-600) + var(--color-green-boost));--color-green-l-700: calc(var(--color-l-700) + var(--color-green-boost));--color-green-l-800: calc(var(--color-l-800) + var(--color-green-boost));--color-green-l-900: calc(var(--color-l-900) + var(--color-green-boost));--color-green-100: hsl(var(--color-green-hs), var(--color-green-l-100));--color-green-200: hsl(var(--color-green-hs), var(--color-green-l-200));--color-green-300: hsl(var(--color-green-hs), var(--color-green-l-300));--color-green-400: hsl(var(--color-green-hs), var(--color-green-l-400));--color-green-500: hsl(var(--color-green-hs), var(--color-green-l-500));--color-green-600: hsl(var(--color-green-hs), var(--color-green-l-600));--color-green-700: hsl(var(--color-green-hs), var(--color-green-l-700));--color-green-800: hsl(var(--color-green-hs), var(--color-green-l-800));--color-green-900: hsl(var(--color-green-hs), var(--color-green-l-900));--color-aqua-h: 180;--color-aqua-s: 50%;--color-aqua-hs: var(--color-aqua-h), var(--color-aqua-s);--color-aqua-boost: 0%;--color-aqua-l-100: calc(var(--color-l-100) + var(--color-aqua-boost));--color-aqua-l-200: calc(var(--color-l-200) + var(--color-aqua-boost));--color-aqua-l-300: calc(var(--color-l-300) + var(--color-aqua-boost));--color-aqua-l-400: calc(var(--color-l-400) + var(--color-aqua-boost));--color-aqua-l-500: calc(var(--color-l-500) + var(--color-aqua-boost));--color-aqua-l-600: calc(var(--color-l-600) + var(--color-aqua-boost));--color-aqua-l-700: calc(var(--color-l-700) + var(--color-aqua-boost));--color-aqua-l-800: calc(var(--color-l-800) + var(--color-aqua-boost));--color-aqua-l-900: calc(var(--color-l-900) + var(--color-aqua-boost));--color-aqua-100: hsl(var(--color-aqua-hs), var(--color-aqua-l-100));--color-aqua-200: hsl(var(--color-aqua-hs), var(--color-aqua-l-200));--color-aqua-300: hsl(var(--color-aqua-hs), var(--color-aqua-l-300));--color-aqua-400: hsl(var(--color-aqua-hs), var(--color-aqua-l-400));--color-aqua-500: hsl(var(--color-aqua-hs), var(--color-aqua-l-500));--color-aqua-600: hsl(var(--color-aqua-hs), var(--color-aqua-l-600));--color-aqua-700: hsl(var(--color-aqua-hs), var(--color-aqua-l-700));--color-aqua-800: hsl(var(--color-aqua-hs), var(--color-aqua-l-800));--color-aqua-900: hsl(var(--color-aqua-hs), var(--color-aqua-l-900));--color-blue-h: 210;--color-blue-s: 65%;--color-blue-hs: var(--color-blue-h), var(--color-blue-s);--color-blue-boost: 3%;--color-blue-l-100: calc(var(--color-l-100) + var(--color-blue-boost));--color-blue-l-200: calc(var(--color-l-200) + var(--color-blue-boost));--color-blue-l-300: calc(var(--color-l-300) + var(--color-blue-boost));--color-blue-l-400: calc(var(--color-l-400) + var(--color-blue-boost));--color-blue-l-500: calc(var(--color-l-500) + var(--color-blue-boost));--color-blue-l-600: calc(var(--color-l-600) + var(--color-blue-boost));--color-blue-l-700: calc(var(--color-l-700) + var(--color-blue-boost));--color-blue-l-800: calc(var(--color-l-800) + var(--color-blue-boost));--color-blue-l-900: calc(var(--color-l-900) + var(--color-blue-boost));--color-blue-100: hsl(var(--color-blue-hs), var(--color-blue-l-100));--color-blue-200: hsl(var(--color-blue-hs), var(--color-blue-l-200));--color-blue-300: hsl(var(--color-blue-hs), var(--color-blue-l-300));--color-blue-400: hsl(var(--color-blue-hs), var(--color-blue-l-400));--color-blue-500: hsl(var(--color-blue-hs), var(--color-blue-l-500));--color-blue-600: hsl(var(--color-blue-hs), var(--color-blue-l-600));--color-blue-700: hsl(var(--color-blue-hs), var(--color-blue-l-700));--color-blue-800: hsl(var(--color-blue-hs), var(--color-blue-l-800));--color-blue-900: hsl(var(--color-blue-hs), var(--color-blue-l-900));--color-purple-h: 275;--color-purple-s: 60%;--color-purple-hs: var(--color-purple-h), var(--color-purple-s);--color-purple-boost: 0%;--color-purple-l-100: calc(var(--color-l-100) + var(--color-purple-boost));--color-purple-l-200: calc(var(--color-l-200) + var(--color-purple-boost));--color-purple-l-300: calc(var(--color-l-300) + var(--color-purple-boost));--color-purple-l-400: calc(var(--color-l-400) + var(--color-purple-boost));--color-purple-l-500: calc(var(--color-l-500) + var(--color-purple-boost));--color-purple-l-600: calc(var(--color-l-600) + var(--color-purple-boost));--color-purple-l-700: calc(var(--color-l-700) + var(--color-purple-boost));--color-purple-l-800: calc(var(--color-l-800) + var(--color-purple-boost));--color-purple-l-900: calc(var(--color-l-900) + var(--color-purple-boost));--color-purple-100: hsl(var(--color-purple-hs), var(--color-purple-l-100));--color-purple-200: hsl(var(--color-purple-hs), var(--color-purple-l-200));--color-purple-300: hsl(var(--color-purple-hs), var(--color-purple-l-300));--color-purple-400: hsl(var(--color-purple-hs), var(--color-purple-l-400));--color-purple-500: hsl(var(--color-purple-hs), var(--color-purple-l-500));--color-purple-600: hsl(var(--color-purple-hs), var(--color-purple-l-600));--color-purple-700: hsl(var(--color-purple-hs), var(--color-purple-l-700));--color-purple-800: hsl(var(--color-purple-hs), var(--color-purple-l-800));--color-purple-900: hsl(var(--color-purple-hs), var(--color-purple-l-900));--color-pink-h: 320;--color-pink-s: 70%;--color-pink-hs: var(--color-pink-h), var(--color-pink-s);--color-pink-boost: 0%;--color-pink-l-100: calc(var(--color-l-100) + var(--color-pink-boost));--color-pink-l-200: calc(var(--color-l-200) + var(--color-pink-boost));--color-pink-l-300: calc(var(--color-l-300) + var(--color-pink-boost));--color-pink-l-400: calc(var(--color-l-400) + var(--color-pink-boost));--color-pink-l-500: calc(var(--color-l-500) + var(--color-pink-boost));--color-pink-l-600: calc(var(--color-l-600) + var(--color-pink-boost));--color-pink-l-700: calc(var(--color-l-700) + var(--color-pink-boost));--color-pink-l-800: calc(var(--color-l-800) + var(--color-pink-boost));--color-pink-l-900: calc(var(--color-l-900) + var(--color-pink-boost));--color-pink-100: hsl(var(--color-pink-hs), var(--color-pink-l-100));--color-pink-200: hsl(var(--color-pink-hs), var(--color-pink-l-200));--color-pink-300: hsl(var(--color-pink-hs), var(--color-pink-l-300));--color-pink-400: hsl(var(--color-pink-hs), var(--color-pink-l-400));--color-pink-500: hsl(var(--color-pink-hs), var(--color-pink-l-500));--color-pink-600: hsl(var(--color-pink-hs), var(--color-pink-l-600));--color-pink-700: hsl(var(--color-pink-hs), var(--color-pink-l-700));--color-pink-800: hsl(var(--color-pink-hs), var(--color-pink-l-800));--color-pink-900: hsl(var(--color-pink-hs), var(--color-pink-l-900));--color-gray-h: 0;--color-gray-s: 0%;--color-gray-hs: var(--color-gray-h), var(--color-gray-s);--color-gray-boost: 0%;--color-gray-l-100: calc(var(--color-l-100) + var(--color-gray-boost));--color-gray-l-200: calc(var(--color-l-200) + var(--color-gray-boost));--color-gray-l-300: calc(var(--color-l-300) + var(--color-gray-boost));--color-gray-l-400: calc(var(--color-l-400) + var(--color-gray-boost));--color-gray-l-500: calc(var(--color-l-500) + var(--color-gray-boost));--color-gray-l-600: calc(var(--color-l-600) + var(--color-gray-boost));--color-gray-l-700: calc(var(--color-l-700) + var(--color-gray-boost));--color-gray-l-800: calc(var(--color-l-800) + var(--color-gray-boost));--color-gray-l-900: calc(var(--color-l-900) + var(--color-gray-boost));--color-gray-100: hsl(var(--color-gray-hs), var(--color-gray-l-100));--color-gray-200: hsl(var(--color-gray-hs), var(--color-gray-l-200));--color-gray-250: #e8e8e8;--color-gray-300: hsl(var(--color-gray-hs), var(--color-gray-l-300));--color-gray-400: hsl(var(--color-gray-hs), var(--color-gray-l-400));--color-gray-500: hsl(var(--color-gray-hs), var(--color-gray-l-500));--color-gray-600: hsl(var(--color-gray-hs), var(--color-gray-l-600));--color-gray-700: hsl(var(--color-gray-hs), var(--color-gray-l-700));--color-gray-800: hsl(var(--color-gray-hs), var(--color-gray-l-800));--color-gray-900: hsl(var(--color-gray-hs), var(--color-gray-l-900));--color-black: hsl(0, 0%, var(--color-l-min));--color-border: var(--color-gray-300);--color-border-dimmed: hsla(0, 0%, var(--color-l-min), .1);--color-dark: var(--color-gray-900);--color-focus: var(--color-blue-600);--color-light: var(--color-gray-200);--color-text: var(--color-black);--color-text-dimmed: var(--color-gray-700);--color-white: hsl(0, 0%, var(--color-l-max));--color-backdrop: rgba(0, 0, 0, .6);--color-background: var(--color-light);--color-gray: var(--color-gray-600);--color-red: var(--color-red-600);--color-orange: var(--color-orange-600);--color-yellow: var(--color-yellow-600);--color-green: var(--color-green-600);--color-aqua: var(--color-aqua-600);--color-blue: var(--color-blue-600);--color-purple: var(--color-purple-600);--color-focus-light: var(--color-focus);--color-focus-outline: var(--color-focus);--color-negative: var(--color-red-700);--color-negative-light: var(--color-red-500);--color-negative-outline: var(--color-red-900);--color-notice: var(--color-orange-700);--color-notice-light: var(--color-orange-500);--color-positive: var(--color-green-700);--color-positive-light: var(--color-green-500);--color-positive-outline: var(--color-green-900);--color-text-light: var(--color-text-dimmed)}:root:has(.k-panel[data-theme=dark]){--color-l-max: 0%;--color-l-100: 3%;--color-l-200: 10%;--color-l-300: 17%;--color-l-400: 25%;--color-l-500: 36%;--color-l-600: 52%;--color-l-700: 62%;--color-l-800: 70%;--color-l-900: 80%;--color-l-min: 97%;--color-gray-250: #0f0f0f;color-scheme:dark}:root{--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--font-mono: "SFMono-Regular", Consolas, Liberation Mono, Menlo, Courier, monospace}:root{--text-xs: .75rem;--text-sm: .875rem;--text-md: 1rem;--text-lg: 1.125rem;--text-xl: 1.25rem;--text-2xl: 1.5rem;--text-3xl: 1.75rem;--text-4xl: 2.5rem;--text-5xl: 3rem;--text-6xl: 4rem;--text-base: var(--text-md);--font-size-tiny: var(--text-xs);--font-size-small: var(--text-sm);--font-size-medium: var(--text-base);--font-size-large: var(--text-xl);--font-size-huge: var(--text-2xl);--font-size-monster: var(--text-3xl)}:root{--font-thin: 300;--font-normal: 400;--font-semi: 500;--font-bold: 600}:root{--height-xs: 1.5rem;--height-sm: 1.75rem;--height-md: 2rem;--height-lg: 2.25rem;--height-xl: 2.5rem;--height: var(--height-md)}:root{--opacity-disabled: .5}:root{--rounded-xs: 1px;--rounded-sm: .125rem;--rounded-md: .25rem;--rounded-lg: .375rem;--rounded-xl: .5rem;--rounded: var(--rounded-md)}:root{--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .05), 0 1px 2px 0 rgba(0, 0, 0, .025);--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .05);--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .05);--shadow: var(--shadow-sm);--shadow-toolbar: rgba(0, 0, 0, .1) -2px 0 5px, var(--shadow), var(--shadow-xl);--shadow-outline: var(--color-focus, currentColor) 0 0 0 2px;--shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, .06);--shadow-sticky: rgba(0, 0, 0, .05) 0 2px 5px;--box-shadow-dropdown: var(--shadow-dropdown);--box-shadow-item: var(--shadow);--box-shadow-focus: var(--shadow-xl);--shadow-dropdown: var(--shadow-lg);--shadow-item: var(--shadow-sm)}:root{--spacing-0: 0;--spacing-1: .25rem;--spacing-2: .5rem;--spacing-3: .75rem;--spacing-4: 1rem;--spacing-6: 1.5rem;--spacing-8: 2rem;--spacing-12: 3rem;--spacing-16: 4rem;--spacing-24: 6rem;--spacing-36: 9rem;--spacing-48: 12rem;--spacing-px: 1px;--spacing-2px: 2px;--spacing-5: 1.25rem;--spacing-10: 2.5rem;--spacing-20: 5rem}:root{--z-offline: 1200;--z-fatal: 1100;--z-loader: 1000;--z-notification: 900;--z-dialog: 800;--z-navigation: 700;--z-dropdown: 600;--z-drawer: 500;--z-dropzone: 400;--z-toolbar: 300;--z-content: 200;--z-background: 100}:root{--pattern-size: 16px;--pattern-light: repeating-conic-gradient( hsl(0, 0%, 100%) 0% 25%, hsl(0, 0%, 90%) 0% 50% ) 50% / var(--pattern-size) var(--pattern-size);--pattern-dark: repeating-conic-gradient( hsla(0, 0%, 15%) 0% 25%, hsl(0, 0%, 22%) 0% 50% ) 50% / var(--pattern-size) var(--pattern-size);--pattern: var(--pattern-dark)}.k-panel[data-theme=dark]{--pattern-light: repeating-conic-gradient( hsl(0, 0%, 90%) 0% 25%, hsl(0, 0%, 80%) 0% 50% ) 50% / var(--pattern-size) var(--pattern-size);--pattern-dark: repeating-conic-gradient( hsla(0, 0%, 9%) 0% 25%, hsl(0, 0%, 16%) 0% 50% ) 50% / var(--pattern-size) var(--pattern-size);--pattern: var(--pattern-dark)}:root{--container: 80rem;--leading-none: 1;--leading-tight: 1.25;--leading-snug: 1.375;--leading-normal: 1.5;--leading-relaxed: 1.625;--leading-loose: 2;--field-input-padding: var(--input-padding);--field-input-height: var(--input-height);--field-input-line-height: var(--input-leading);--field-input-font-size: var(--input-font-size);--bg-pattern: var(--pattern)}:root{--choice-color-back: var(--color-white);--choice-color-border: var(--color-gray-500);--choice-color-checked: var(--color-black);--choice-color-disabled: var(--color-gray-400);--choice-color-icon: var(--color-light);--choice-color-info: var(--color-text-dimmed);--choice-color-text: var(--color-text);--choice-color-toggle: var(--choice-color-disabled);--choice-height: 1rem;--choice-rounded: var(--rounded-sm)}input:where([type=checkbox],[type=radio]){position:relative;cursor:pointer;overflow:hidden;flex-shrink:0;height:var(--choice-height);aspect-ratio:1/1;border:1px solid var(--choice-color-border);-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:var(--choice-rounded);background:var(--choice-color-back);box-shadow:var(--shadow-sm)}input:where([type=checkbox],[type=radio]):after{position:absolute;content:"";display:none;place-items:center;text-align:center}input:where([type=checkbox],[type=radio]):focus{outline:var(--outline);outline-offset:-1px;color:var(--color-focus)}input:where([type=checkbox]):checked{border-color:var(--choice-color-checked)}input:where([type=checkbox],[type=radio]):checked:after{background:var(--choice-color-checked);display:grid}input:where([type=checkbox],[type=radio]):checked:focus{--choice-color-checked: var(--color-focus)}input:where([type=checkbox],[type=radio])[disabled]{--choice-color-back: none;--choice-color-border: var(--color-gray-300);--choice-color-checked: var(--choice-color-disabled);box-shadow:none;cursor:not-allowed}input[type=checkbox]:checked:after{content:"✓";top:0;right:0;bottom:0;left:0;font-weight:700;color:var(--choice-color-icon);line-height:1}input[type=radio]{--choice-rounded: 50%}input[type=radio]:after{top:3px;right:3px;bottom:3px;left:3px;font-size:9px;border-radius:var(--choice-rounded)}input[type=checkbox][data-variant=toggle]{--choice-rounded: var(--choice-height);width:calc(var(--choice-height) * 2);aspect-ratio:2/1}input[type=checkbox][data-variant=toggle]:after{background:var(--choice-color-toggle);display:grid;top:1px;right:1px;bottom:1px;left:1px;width:.8rem;font-size:7px;border-radius:var(--choice-rounded);transition:margin-inline-start 75ms ease-in-out,background .1s ease-in-out}input[type=checkbox][data-variant=toggle]:checked{border-color:var(--choice-color-border)}input[type=checkbox][data-variant=toggle]:checked:after{background:var(--choice-color-checked);margin-inline-start:50%}:root{--range-thumb-color: white;--range-thumb-focus-outline: var(--outline);--range-thumb-size: 1rem;--range-thumb-shadow: rgba(0, 0, 0, .1) 0 2px 4px 2px, rgba(0, 0, 0, .125) 0 0 0 1px;--range-track-back: var(--color-gray-250);--range-track-height: var(--range-thumb-size)}:where(input[type=range]){display:flex;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;height:var(--range-thumb-size);border-radius:var(--range-track-size);width:100%}:where(input[type=range])::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:var(--range-thumb-size);height:var(--range-thumb-size);border:0;background:var(--range-thumb-color);box-shadow:var(--range-thumb-shadow);transform:translateZ(0);margin-top:calc(((var(--range-thumb-size) - var(--range-track-height)) / 2) * -1);border-radius:50%;z-index:1;cursor:grab}:where(input[type=range])::-moz-range-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:var(--range-thumb-size);height:var(--range-thumb-size);border:0;background:var(--range-thumb-color);box-shadow:var(--range-thumb-shadow);border-radius:50%;transform:translateZ(0);z-index:1;cursor:grab}:where(input[type=range])::-webkit-slider-thumb:active{cursor:grabbing}:where(input[type=range])::-moz-range-thumb:active{cursor:grabbing}:where(input[type=range])::-webkit-slider-runnable-track{background:var(--range-track-back);height:var(--range-track-height);border-radius:var(--range-track-height)}:where(input[type=range])::-moz-range-track{background:var(--range-track-back);height:var(--range-track-height);border-radius:var(--range-track-height)}:where(input[type=range][disabled]){--range-thumb-color: rgba(255, 255, 255, .2)}:where(input[type=range][disabled])::-webkit-slider-thumb{cursor:not-allowed}:where(input[type=range][disabled])::-moz-range-thumb{cursor:not-allowed}:where(input[type=range]):focus{outline:var(--outline)}:where(input[type=range]):focus::-webkit-slider-thumb{outline:var(--range-thumb-focus-outline)}:where(input[type=range]):focus::-moz-range-thumb{outline:var(--range-thumb-focus-outline)}*,*:before,*:after{margin:0;padding:0;box-sizing:border-box}:where(b,strong){font-weight:var(--font-bold, 600)}:where([hidden]){display:none!important}:where(abbr){text-decoration:none}:where(input,button,textarea,select){border:0;font:inherit;line-height:inherit;color:inherit;background:none}:where(fieldset){border:0}:where(legend){width:100%;float:left}:where(legend+*){clear:both}:where(select){-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--color-white);color:var(--color-black);cursor:pointer}:where(textarea,select,input:not([type=checkbox],[type=radio],[type=reset],[type=submit])){width:100%;font-variant-numeric:tabular-nums}:where(textarea){resize:vertical;line-height:1.5}:where(input)::-webkit-calendar-picker-indicator{display:none}:where(input[type=search]){-webkit-appearance:none;-moz-appearance:none;appearance:none}:where(input)::-webkit-search-cancel-button{display:none}:where(button,label,select,summary,[role=button],[role=option]){cursor:pointer}:where(select[multiple]) option{display:flex;align-items:center}:where(input:-webkit-autofill){-webkit-text-fill-color:var(--input-color-text)!important;-webkit-background-clip:text}:where(:disabled){cursor:not-allowed}*::placeholder{color:var(--input-color-placeholder);opacity:1}:where(a){color:currentColor;text-decoration:none;text-underline-offset:.2ex}:where(ul,ol){list-style:none}:where(img,svg,video,canvas,audio,iframe,embed,object){display:block}:where(iframe){border:0}:where(img,picture,svg){max-inline-size:100%;block-size:auto}:where(p,h1,h2,h3,h4,h5,h6){overflow-wrap:break-word}:where(h1,h2,h3,h4,h5,h6){font:inherit}:where(:focus,:focus-visible,:focus-within){outline-color:var(--color-focus, currentColor);outline-offset:0}:where(:focus-visible){outline:var(--outline, 2px solid var(--color-focus, currentColor))}:where(:invalid){box-shadow:none;outline:0}:where(dialog){border:0;max-width:none;max-height:none}:where(hr){border:0}:where(table){font:inherit;width:100%;border-spacing:0;font-variant-numeric:tabular-nums}:where(table th){font:inherit;text-align:start}:where(svg){fill:currentColor}body{font-family:var(--font-sans, sans-serif);font-size:var(--text-sm);line-height:1;position:relative;accent-color:var(--color-focus, currentColor)}:where(sup,sub){position:relative;line-height:0;vertical-align:baseline;font-size:75%}:where(sup){top:-.5em}:where(sub){bottom:-.25em}:where(mark){background:var(--color-yellow-300)}:where(kbd){display:inline-block;padding-inline:var(--spacing-2);border-radius:var(--rounded);background:var(--color-white);box-shadow:var(--shadow)}[data-align=left]{--align: start}[data-align=center]{--align: center}[data-align=right]{--align: end}@keyframes LoadingCursor{to{cursor:progress}}@keyframes Spin{to{transform:rotate(360deg)}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}[data-theme]{--theme-color-h: 0;--theme-color-s: 0%;--theme-color-hs: var(--theme-color-h), var(--theme-color-s);--theme-color-boost: 3%;--theme-color-l-100: calc(var(--color-l-100) + var(--theme-color-boost));--theme-color-l-200: calc(var(--color-l-200) + var(--theme-color-boost));--theme-color-l-300: calc(var(--color-l-300) + var(--theme-color-boost));--theme-color-l-400: calc(var(--color-l-400) + var(--theme-color-boost));--theme-color-l-500: calc(var(--color-l-500) + var(--theme-color-boost));--theme-color-l-600: calc(var(--color-l-600) + var(--theme-color-boost));--theme-color-l-700: calc(var(--color-l-700) + var(--theme-color-boost));--theme-color-l-800: calc(var(--color-l-800) + var(--theme-color-boost));--theme-color-l-900: calc(var(--color-l-900) + var(--theme-color-boost));--theme-color-100: hsl(var(--theme-color-hs), var(--theme-color-l-100));--theme-color-200: hsl(var(--theme-color-hs), var(--theme-color-l-200));--theme-color-300: hsl(var(--theme-color-hs), var(--theme-color-l-300));--theme-color-400: hsl(var(--theme-color-hs), var(--theme-color-l-400));--theme-color-500: hsl(var(--theme-color-hs), var(--theme-color-l-500));--theme-color-600: hsl(var(--theme-color-hs), var(--theme-color-l-600));--theme-color-700: hsl(var(--theme-color-hs), var(--theme-color-l-700));--theme-color-800: hsl(var(--theme-color-hs), var(--theme-color-l-800));--theme-color-900: hsl(var(--theme-color-hs), var(--theme-color-l-900));--theme-color-text: var(--theme-color-900);--theme-color-text-dimmed: hsl( var(--theme-color-h), calc(var(--theme-color-s) - 60%), 50% );--theme-color-back: var(--theme-color-400);--theme-color-hover: var(--theme-color-500);--theme-color-icon: var(--theme-color-600)}[data-theme^=red],[data-theme^=error],[data-theme^=negative]{--theme-color-h: var(--color-red-h);--theme-color-s: var(--color-red-s);--theme-color-boost: var(--color-red-boost)}[data-theme^=orange],[data-theme^=notice]{--theme-color-h: var(--color-orange-h);--theme-color-s: var(--color-orange-s);--theme-color-boost: var(--color-orange-boost)}[data-theme^=yellow],[data-theme^=warning]{--theme-color-h: var(--color-yellow-h);--theme-color-s: var(--color-yellow-s);--theme-color-boost: var(--color-yellow-boost)}[data-theme^=blue],[data-theme^=info]{--theme-color-h: var(--color-blue-h);--theme-color-s: var(--color-blue-s);--theme-color-boost: var(--color-blue-boost)}[data-theme^=pink],[data-theme^=love]{--theme-color-h: var(--color-pink-h);--theme-color-s: var(--color-pink-s);--theme-color-boost: var(--color-pink-boost)}[data-theme^=green],[data-theme^=positive]{--theme-color-h: var(--color-green-h);--theme-color-s: var(--color-green-s);--theme-color-boost: var(--color-green-boost)}[data-theme^=aqua]{--theme-color-h: var(--color-aqua-h);--theme-color-s: var(--color-aqua-s);--theme-color-boost: var(--color-aqua-boost)}[data-theme^=purple]{--theme-color-h: var(--color-purple-h);--theme-color-s: var(--color-purple-s);--theme-color-boost: var(--color-purple-boost)}[data-theme^=gray],[data-theme^=passive]{--theme-color-h: var(--color-gray-h);--theme-color-s: var(--color-gray-s);--theme-color-boost: 10%}[data-theme^=white],[data-theme^=text]{--theme-color-back: var(--color-white);--theme-color-icon: var(--color-gray-800);--theme-color-text: var(--color-text);--color-h: var(--color-black)}[data-theme^=dark]{--theme-color-h: var(--color-gray-h);--theme-color-s: var(--color-gray-s);--theme-color-boost: var(--color-gray-boost);--theme-color-back: var(--color-gray-800);--theme-color-icon: var(--color-gray-500);--theme-color-text: var(--color-gray-200)}[data-theme=code]{--theme-color-back: var(--code-color-back);--theme-color-hover: var(--color-black);--theme-color-icon: var(--code-color-icon);--theme-color-text: var(--code-color-text);font-family:var(--code-font-family);font-size:var(--code-font-size)}[data-theme=empty]{--theme-color-back: var(--color-light);--theme-color-border: var(--color-gray-400);--theme-color-icon: var(--color-gray-600);--theme-color-text: var(--color-text-dimmed);border:1px dashed var(--theme-color-border)}[data-theme=none]{--theme-color-back: transparent;--theme-color-border: transparent;--theme-color-icon: var(--color-text);--theme-color-text: var(--color-text)}[data-theme]{--theme: var(--theme-color-700);--theme-light: var(--theme-color-500);--theme-bg: var(--theme-color-500)}:root{--outline: 2px solid var(--color-focus, currentColor)}.scroll-x,.scroll-x-auto,.scroll-y,.scroll-y-auto{-webkit-overflow-scrolling:touch;transform:translateZ(0)}.scroll-x{overflow-x:scroll;overflow-y:hidden}.scroll-x-auto{overflow-x:auto;overflow-y:hidden}.scroll-y{overflow-x:hidden;overflow-y:scroll}.scroll-y-auto{overflow-x:hidden;overflow-y:auto}.input-hidden{position:absolute;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:0;height:0;opacity:0}.k-lab-index-view .k-header{margin-bottom:0}.k-lab-index-view .k-panel-main>.k-box{margin-bottom:var(--spacing-8)}.k-lab-index-view .k-list-items{grid-template-columns:repeat(auto-fill,minmax(12rem,1fr))}.k-lab-docs-deprecated .k-box{box-shadow:var(--shadow)}.k-lab-docs-examples .k-code+.k-code{margin-top:var(--spacing-4)}.k-lab-docs-prop-values{font-size:var(--text-xs);border-left:2px solid var(--color-blue-300);padding-inline-start:var(--spacing-2)}.k-lab-docs-prop-values dl{font-weight:var(--font-bold)}.k-lab-docs-prop-values dl+dl{margin-top:var(--spacing-2)}.k-lab-docs-prop-values dd{display:inline-flex;flex-wrap:wrap;gap:var(--spacing-1)}.k-lab-docs-desc-header{display:flex;justify-content:space-between;align-items:center}.k-table .k-lab-docs-deprecated{--box-height: var(--height-xs);--text-font-size: var(--text-xs)}.k-labs-docs-params li{list-style:square;margin-inline-start:var(--spacing-3)}.k-labs-docs-params .k-lab-docs-types{margin-inline:1ch}.k-lab-docs-types{display:inline-flex;flex-wrap:wrap;gap:var(--spacing-1)}.k-lab-docs-types.k-text code{color:var(--color-gray-800);outline-color:var(--color-gray-400);background:var(--color-gray-300)}.k-lab-docs-types code:is([data-type=boolean],[data-type=Boolean]){color:var(--color-purple-800);outline-color:var(--color-purple-400);background:var(--color-purple-300)}.k-lab-docs-types code:is([data-type=string],[data-type=String]){color:var(--color-green-800);outline-color:var(--color-green-500);background:var(--color-green-300)}.k-lab-docs-types code:is([data-type=number],[data-type=Number]){color:var(--color-orange-800);outline-color:var(--color-orange-500);background:var(--color-orange-300)}.k-lab-docs-types code:is([data-type=array],[data-type=Array]){color:var(--color-aqua-800);outline-color:var(--color-aqua-500);background:var(--color-aqua-300)}.k-lab-docs-types code:is([data-type=object],[data-type=Object]){color:var(--color-yellow-800);outline-color:var(--color-yellow-500);background:var(--color-yellow-300)}.k-lab-docs-types code[data-type=func]{color:var(--color-pink-800);outline-color:var(--color-pink-400);background:var(--color-pink-300)}.k-lab-docs-section+.k-lab-docs-section{margin-top:var(--spacing-12)}.k-lab-docs-section .k-headline{margin-bottom:var(--spacing-3)}.k-lab-docs-section .k-table td{padding:.375rem var(--table-cell-padding);vertical-align:top;line-height:1.5;word-break:break-word}.k-lab-docs-description :where(.k-text,.k-box)+:where(.k-text,.k-box){margin-top:var(--spacing-3)}.k-lab-docs-required{margin-inline-start:var(--spacing-1);font-size:.7rem;vertical-align:super;color:var(--color-red-600)}.k-lab-docs-since{margin-top:var(--spacing-1);font-size:var(--text-xs);color:var(--color-gray-600)}.k-lab-example{position:relative;container-type:inline-size;max-width:100%;outline-offset:-2px;border-radius:var(--rounded);border:1px solid var(--color-gray-300)}.k-lab-example+.k-lab-example{margin-top:var(--spacing-12)}.k-lab-example-header{display:flex;justify-content:space-between;align-items:center;height:var(--height-md);padding-block:var(--spacing-3);padding-inline:var(--spacing-2);border-bottom:1px solid var(--color-gray-300)}.k-lab-example-label{font-size:12px;color:var(--color-text-dimmed)}.k-lab-example-canvas,.k-lab-example-code{padding:var(--spacing-16)}.k-lab-example[data-flex=true] .k-lab-example-canvas{display:flex;align-items:center;gap:var(--spacing-6)}.k-lab-example-inspector{--icon-size: 13px;--button-color-icon: var(--color-gray-500)}.k-lab-example-inspector .k-button:not([data-theme]):hover{--button-color-icon: var(--color-gray-600)}.k-lab-example-inspector .k-button:where([data-theme]){--button-color-icon: var(--color-gray-800)}.k-lab-examples>:where(.k-text,.k-box){margin-bottom:var(--spacing-6)}.k-lab-form>footer{border-top:1px dashed var(--color-border);padding-top:var(--spacing-6)}.k-lab-playground-view[data-has-tabs=true] .k-lab-playground-header{margin-bottom:0}.k-lab-examples h2{margin-bottom:var(--spacing-6)}.k-lab-examples *+h2{margin-top:var(--spacing-12)}:where(.k-lab-input-examples,.k-lab-field-examples) .k-lab-example:has(:invalid){outline:2px solid var(--color-red-500);outline-offset:-2px}.k-lab-input-examples-focus .k-lab-example-canvas>.k-button{margin-top:var(--spacing-6)}.k-lab-helpers-examples .k-lab-example .k-text{margin-bottom:var(--spacing-6)}.k-lab-helpers-examples h2{margin-bottom:var(--spacing-3);font-weight:var(--font-bold)}:root{--highlight-punctuation: var(--color-gray-500);--highlight-variable: var(--color-red-500);--highlight-constant: var(--color-orange-500);--highlight-keyword: var(--color-purple-500);--highlight-function: var(--color-blue-500);--highlight-operator: var(--color-aqua-500);--highlight-string: var(--color-green-500);--highlight-scope: var(--color-yellow-500)}.k-panel[data-theme=dark]{--highlight-punctuation: var(--color-gray-700);--highlight-variable: var(--color-red-700);--highlight-constant: var(--color-orange-700);--highlight-keyword: var(--color-purple-700);--highlight-function: var(--color-blue-700);--highlight-operator: var(--color-aqua-700);--highlight-string: var(--color-green-700);--highlight-scope: var(--color-yellow-700)}.token.punctuation,.token.comment,.token.doctype,.token.title .punctuation{color:var(--highlight-punctuation)}.token.tag,.token.markup,.token.variable,.token.this,.token.selector,.token.key,.token.kirbytag-bracket,.token.prolog,.token.delimiter{color:var(--highlight-variable)}.token.constant,.token.number,.token.boolean,.token.boolean.important,.token.attr-name,.token.kirbytag-attr,.token.kirbytag-name,.token.entity,.token.bold,.token.bold>.punctuation{color:var(--highlight-constant)}.token.keyword,.token.italic,.token.italic>.punctuation{color:var(--highlight-keyword)}.token.function{color:var(--highlight-function)}.token.operator,.token.title{color:var(--highlight-operator)}.token.string,.token.attr-value,.token.attr-value .punctuation,.token.list.punctuation{color:var(--highlight-string)}.token.scope,.token.class-name,.token.property,.token.url{color:var(--highlight-scope)}.token.title,.token.kirbytag-bracket,.token.list.punctuation,.token.bold{font-weight:var(--font-bold)}.token.italic{font-style:italic} +.k-items{position:relative;display:grid;container-type:inline-size}.k-items[data-layout=list]{gap:2px}.k-items[data-layout=cardlets]{--items-size: 1fr;display:grid;gap:.75rem;grid-template-columns:repeat(auto-fill,minmax(var(--items-size),1fr))}@container (min-width: 15rem){.k-items[data-layout=cardlets]{--items-size: 15rem}}.k-items[data-layout=cards]{display:grid;gap:1.5rem;grid-template-columns:1fr}@container (min-width: 6rem){.k-items[data-layout=cards][data-size=tiny]{grid-template-columns:repeat(auto-fill,minmax(6rem,1fr))}}@container (min-width: 9rem){.k-items[data-layout=cards][data-size=small]{grid-template-columns:repeat(auto-fill,minmax(9rem,1fr))}}@container (min-width: 12rem){.k-items[data-layout=cards][data-size=auto],.k-items[data-layout=cards][data-size=medium]{grid-template-columns:repeat(auto-fill,minmax(12rem,1fr))}}@container (min-width: 15rem){.k-items[data-layout=cards][data-size=large]{grid-template-columns:repeat(auto-fill,minmax(15rem,1fr))}}@container (min-width: 18rem){.k-items[data-layout=cards][data-size=huge]{grid-template-columns:repeat(auto-fill,minmax(18rem,1fr))}}.k-collection-footer{display:flex;justify-content:space-between;align-items:flex-start;flex-wrap:nowrap;gap:var(--spacing-12);margin-top:var(--spacing-2)}.k-empty{max-width:100%}:root{--item-button-height: var(--height-md);--item-button-width: var(--height-md);--item-height: auto;--item-height-cardlet: calc(var(--height-md) * 3)}.k-item{position:relative;background:var(--color-white);box-shadow:var(--shadow);border-radius:var(--rounded);min-height:var(--item-height);container-type:inline-size}.k-item:has(a:focus){outline:2px solid var(--color-focus)}@supports not selector(:has(*)){.k-item:focus-within{outline:2px solid var(--color-focus)}}.k-item .k-icon-frame{--back: var(--color-gray-300)}.k-item-content{line-height:1.25;overflow:hidden;padding:var(--spacing-2)}.k-item-content a:focus{outline:0}.k-item-content a:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0}.k-item-info{color:var(--color-text-dimmed)}.k-item-options{transform:translate(0);z-index:1;display:flex;align-items:center;justify-content:space-between}.k-item-options[data-only-option=true]{justify-content:flex-end}.k-item-options .k-button{--button-height: var(--item-button-height);--button-width: var(--item-button-width)}.k-item .k-sort-button{position:absolute;z-index:2}.k-item:not(:hover):not(.k-sortable-fallback) .k-sort-button{opacity:0}.k-item[data-layout=list]{--item-height: var( --field-input-height );--item-button-height: var(--item-height);--item-button-width: auto;display:grid;align-items:center;grid-template-columns:1fr auto}.k-item[data-layout=list][data-has-image=true]{grid-template-columns:var(--item-height) 1fr auto}.k-item[data-layout=list] .k-frame{--ratio: 1/1;border-start-start-radius:var(--rounded);border-end-start-radius:var(--rounded);height:100%}.k-item[data-layout=list] .k-item-content{display:flex;min-width:0;flex-wrap:wrap;column-gap:var(--spacing-4);justify-content:space-between}.k-item[data-layout=list] .k-item-title,.k-item[data-layout=list] .k-item-info{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.k-item[data-layout=list] .k-sort-button{--button-width: calc(1.5rem + var(--spacing-1));--button-height: var(--item-height);left:calc(-1 * var(--button-width))}.k-item:is([data-layout=cardlets],[data-layout=cards]) .k-sort-button{top:var(--spacing-2);inset-inline-start:var(--spacing-2);background:hsla(0,0%,var(--color-l-max),50%);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);box-shadow:0 2px 5px #0003;--button-width: 1.5rem;--button-height: 1.5rem;--button-rounded: var(--rounded-sm);--button-padding: 0;--icon-size: 14px}.k-item:is([data-layout=cardlets],[data-layout=cards]) .k-sort-button:hover{background:hsla(0,0%,var(--color-l-max),95%)}.k-item[data-layout=cardlets]{--item-height: var(--item-height-cardlet);display:grid;grid-template-areas:"content" "options";grid-template-columns:1fr;grid-template-rows:1fr var(--height-md)}.k-item[data-layout=cardlets][data-has-image=true]{grid-template-areas:"image content" "image options";grid-template-columns:minmax(0,var(--item-height)) 1fr}.k-item[data-layout=cardlets] .k-frame{grid-area:image;border-start-start-radius:var(--rounded);border-end-start-radius:var(--rounded);aspect-ratio:auto}.k-item[data-layout=cardlets] .k-item-content{grid-area:content}.k-item[data-layout=cardlets] .k-item-info{margin-top:.125em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.k-item[data-layout=cardlets] .k-item-options{grid-area:options}.k-item[data-layout=cards]{display:flex;flex-direction:column}.k-item[data-layout=cards] .k-frame{border-start-start-radius:var(--rounded);border-start-end-radius:var(--rounded)}.k-item[data-layout=cards] .k-item-content{flex-grow:1;padding:var(--spacing-2)}.k-item[data-layout=cards] .k-item-info{margin-top:.125em}.k-item[data-theme=disabled]{background:transparent;box-shadow:none;outline:1px solid var(--color-border);outline-offset:-1px}.k-dialog-body{padding:var(--dialog-padding)}.k-dialog[data-has-footer=true] .k-dialog-body{padding-bottom:0}.k-button-group.k-dialog-buttons{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-3);--button-height: var(--height-lg)}.k-dialog-fields{padding-bottom:.5rem;container-type:inline-size}.k-dialog-footer{padding:var(--dialog-padding);line-height:1;flex-shrink:0}.k-dialog .k-notification{padding-block:.325rem;border-start-start-radius:var(--dialog-rounded);border-start-end-radius:var(--dialog-rounded);margin-top:-1px}.k-dialog-search{margin-bottom:.75rem;--input-color-border: transparent;--input-color-back: var(--color-gray-300)}:root{--dialog-color-back: var(--color-light);--dialog-color-text: currentColor;--dialog-margin: var(--spacing-6);--dialog-padding: var(--spacing-6);--dialog-rounded: var(--rounded-xl);--dialog-shadow: var(--shadow-xl);--dialog-width: 22rem}.k-dialog-portal{padding:var(--dialog-margin)}.k-dialog{position:relative;background:var(--dialog-color-back);color:var(--dialog-color-text);width:clamp(10rem,100%,var(--dialog-width));box-shadow:var(--dialog-shadow);border-radius:var(--dialog-rounded);line-height:1;display:flex;flex-direction:column;overflow:clip;container-type:inline-size}@media screen and (min-width: 20rem){.k-dialog[data-size=small]{--dialog-width: 20rem}}@media screen and (min-width: 22rem){.k-dialog[data-size=default]{--dialog-width: 22rem}}@media screen and (min-width: 30rem){.k-dialog[data-size=medium]{--dialog-width: 30rem}}@media screen and (min-width: 40rem){.k-dialog[data-size=large]{--dialog-width: 40rem}}@media screen and (min-width: 60rem){.k-dialog[data-size=huge]{--dialog-width: 60rem}}.k-dialog .k-pagination{margin-bottom:-1.5rem;display:flex;justify-content:center;align-items:center}.k-changes-dialog section+section{margin-top:var(--spacing-6)}.k-changes-dialog .k-headline{margin-top:-.5rem;margin-bottom:var(--spacing-3)}.k-error-details{background:var(--color-white);display:block;overflow:auto;padding:1rem;font-size:var(--text-sm);line-height:1.25em;margin-top:.75rem}.k-error-details dt{color:var(--color-red-500);margin-bottom:.25rem}.k-error-details dd{overflow:hidden;overflow-wrap:break-word;text-overflow:ellipsis}.k-error-details dd:not(:last-of-type){margin-bottom:1.5em}.k-error-details li{white-space:pre-line}.k-error-details li:not(:last-child){border-bottom:1px solid var(--color-light);padding-bottom:.25rem;margin-bottom:.25rem}.k-models-dialog .k-list-item{cursor:pointer}.k-models-dialog .k-choice-input{--choice-color-checked: var(--color-focus);display:flex;align-items:center;height:var(--item-button-height);margin-inline-end:var(--spacing-3)}.k-models-dialog .k-choice-input input{top:0}.k-models-dialog .k-collection-footer .k-pagination{margin-bottom:0}.k-license-dialog-status{display:flex;align-items:center;gap:var(--spacing-2)}.k-license-dialog .k-icon{color:var(--theme-color-700)}.k-page-template-switch{margin-bottom:var(--spacing-6);padding-bottom:var(--spacing-6);border-bottom:1px dashed var(--color-gray-300)}.k-page-move-dialog .k-headline{margin-bottom:var(--spacing-2)}.k-page-move-parent{--tree-color-back: var(--color-white);--tree-color-hover-back: var(--color-light);padding:var(--spacing-3);background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow)}.k-pages-dialog-navbar{display:flex;align-items:center;justify-content:center;margin-bottom:.5rem;padding-inline-end:38px}.k-pages-dialog-navbar .k-button[aria-disabled=true]{opacity:0}.k-pages-dialog-navbar .k-headline{flex-grow:1;text-align:center}.k-pages-dialog-option[aria-disabled=true]{opacity:.25}.k-search-dialog{--dialog-padding: 0;--dialog-rounded: var(--rounded);overflow:visible}.k-overlay[open][data-type=dialog]>.k-portal>.k-search-dialog{margin-top:0}.k-totp-dialog-headline{margin-bottom:var(--spacing-1)}.k-totp-dialog-intro{margin-bottom:var(--spacing-6)}.k-totp-dialog-grid{display:grid;gap:var(--spacing-6)}@media screen and (min-width: 40rem){.k-totp-dialog-grid{grid-template-columns:1fr 1fr;gap:var(--spacing-8)}}.k-totp-qrcode .k-box[data-theme]{padding:var(--box-padding-inline)}.k-totp-dialog-fields .k-field-name-confirm{--input-height: var(--height-xl);--input-rounded: var(--rounded);--input-font-size: var(--text-3xl)}.k-upload-dialog.k-dialog{--dialog-width: 40rem}.k-upload-replace-dialog .k-upload-items{display:flex;gap:var(--spacing-3);align-items:center}.k-upload-original{width:6rem;border-radius:var(--rounded);box-shadow:var(--shadow);overflow:hidden}.k-upload-replace-dialog .k-upload-item{flex-grow:1}.k-drawer-body{padding:var(--drawer-body-padding);flex-grow:1;background:var(--color-light)}.k-drawer-body .k-writer-input:focus-within .k-toolbar:not([data-inline=true]),.k-drawer-body .k-textarea-input-wrapper:focus-within .k-toolbar,.k-drawer-body .k-table th{top:-1.5rem}.k-drawer-header{--button-height: calc(var(--drawer-header-height) - var(--spacing-1));flex-shrink:0;height:var(--drawer-header-height);padding-inline-start:var(--drawer-header-padding);display:flex;align-items:center;line-height:1;justify-content:space-between;background:var(--color-white);font-size:var(--text-sm)}.k-drawer-breadcrumb{flex-grow:1}.k-drawer-options{display:flex;align-items:center;padding-inline-end:.75rem}.k-drawer-option{--button-width: var(--button-height)}.k-drawer-option[aria-disabled=true]{opacity:var(--opacity-disabled)}.k-notification.k-drawer-notification{padding:.625rem 1.5rem}.k-drawer-tabs{display:flex;align-items:center;line-height:1}.k-drawer-tab.k-button{--button-height: calc(var(--drawer-header-height) - var(--spacing-1));--button-padding: var(--spacing-3);display:flex;align-items:center;font-size:var(--text-xs);overflow-x:visible}.k-drawer-tab.k-button[aria-current=true]:after{position:absolute;bottom:-2px;inset-inline:var(--button-padding);content:"";background:var(--color-black);height:2px;z-index:1}:root{--drawer-body-padding: 1.5rem;--drawer-color-back: var(--color-light);--drawer-header-height: 2.5rem;--drawer-header-padding: 1rem;--drawer-shadow: var(--shadow-xl);--drawer-width: 50rem}.k-drawer-overlay+.k-drawer-overlay{--overlay-color-back: none}.k-drawer{--header-sticky-offset: calc(var(--drawer-body-padding) * -1);z-index:var(--z-toolbar);flex-basis:var(--drawer-width);position:relative;display:flex;flex-direction:column;background:var(--drawer-color-back);box-shadow:var(--drawer-shadow);container-type:inline-size}.k-drawer[aria-disabled=true]{display:none;pointer-events:none}:root{--dropdown-color-bg: var(--color-black);--dropdown-color-current: var(--color-blue-500);--dropdown-color-hr: hsla(0, 0%, var(--color-l-max), .25);--dropdown-color-text: var(--color-white);--dropdown-padding: var(--spacing-2);--dropdown-rounded: var(--rounded);--dropdown-shadow: var(--shadow-xl)}.k-panel[data-theme=dark]{--dropdown-color-hr: hsla(0, 0%, var(--color-l-max), .1)}.k-dropdown-content{--dropdown-x: 0;--dropdown-y: 0;position:absolute;inset-block-start:0;inset-inline-start:initial;left:0;width:max-content;padding:var(--dropdown-padding);background:var(--dropdown-color-bg);border-radius:var(--dropdown-rounded);color:var(--dropdown-color-text);box-shadow:var(--dropdown-shadow);text-align:start;transform:translate(var(--dropdown-x),var(--dropdown-y))}.k-dropdown-content::backdrop{background:none}.k-dropdown-content[data-align-x=end]{--dropdown-x: -100%}.k-dropdown-content[data-align-x=center]{--dropdown-x: -50%}.k-dropdown-content[data-align-y=top]{--dropdown-y: -100%}.k-dropdown-content hr{margin:.5rem 0;height:1px;background:var(--dropdown-color-hr)}.k-dropdown-content[data-theme=light]{--dropdown-color-bg: var(--color-white);--dropdown-color-current: var(--color-blue-800);--dropdown-color-hr: var(--color-border-dimmed);--dropdown-color-text: var(--color-black)}.k-dropdown-item.k-button{--button-align: flex-start;--button-color-text: var(--dropdown-color-text);--button-height: var(--height-sm);--button-rounded: var(--rounded-sm);--button-width: 100%;display:flex}.k-dropdown-item.k-button:focus{outline:var(--outline)}.k-dropdown-item.k-button[aria-current=true]{--button-color-text: var(--dropdown-color-current)}.k-dropdown-item.k-button[aria-current]:after{margin-inline-start:auto;text-align:center;content:"✓";padding-inline-start:var(--spacing-1)}.k-dropdown-item.k-button:not([aria-disabled=true]):hover{--button-color-back: var(--dropdown-color-hr)}.k-options-dropdown{display:flex;justify-content:center;align-items:center}:root{--picklist-rounded: var(--rounded-sm);--picklist-highlight: var(--color-yellow-500)}.k-picklist-input{--choice-color-text: currentColor;--button-rounded: var(--picklist-rounded)}.k-picklist-input-header{--input-rounded: var(--picklist-rounded)}.k-picklist-input-search{display:flex;align-items:center;border-radius:var(--picklist-rounded)}.k-picklist-input-search .k-search-input{height:var(--button-height)}.k-picklist-input-search:focus-within{outline:var(--outline)}.k-picklist-dropdown .k-picklist-input-create:focus{outline:0}.k-picklist-dropdown .k-picklist-input-create[aria-disabled=true]{visibility:hidden}.k-picklist-input-options.k-grid{--columns: 1}.k-picklist-input-options li+li{margin-top:var(--spacing-1)}.k-picklist-input-options .k-choice-input{padding-inline:var(--spacing-2)}.k-picklist-input-options .k-choice-input{--choice-color-checked: var(--color-focus)}.k-picklist-input-options .k-choice-input:has(:checked){--choice-color-text: var(--color-focus)}.k-picklist-input-options .k-choice-input[aria-disabled=true]{--choice-color-text: var(--color-text-dimmed)}.k-picklist-input-options .k-choice-input:has(:focus-within){outline:var(--outline)}.k-picklist-input-options .k-choice-input b{font-weight:var(--font-normal);color:var(--picklist-highlight)}.k-picklist-input-more.k-button{--button-width: 100%;--button-align: start;--button-color-text: var(--color-text-dimmed);padding-inline:var(--spacing-2)}.k-picklist-input-more.k-button .k-button-icon{position:relative;inset-inline-start:-1px}.k-picklist-input-empty{height:var(--button-height);line-height:1.25rem;padding:var(--spacing-1) var(--spacing-2);color:var(--color-text-dimmed)}.k-picklist-dropdown{--color-text-dimmed: var(--color-gray-400);padding:0;max-width:30rem;min-width:8rem}.k-picklist-dropdown :where(.k-picklist-input-header,.k-picklist-input-body,.k-picklist-input-footer){padding:var(--dropdown-padding)}.k-picklist-dropdown .k-picklist-input-header{border-bottom:1px solid var(--dropdown-color-hr)}.k-picklist-dropdown .k-picklist-input-search{background:var(--dropdown-color-hr);padding-inline-end:var(--input-padding)}.k-picklist-dropdown .k-picklist-input-create{--button-rounded: 1rem;--button-height: 1.125rem}.k-picklist-dropdown .k-picklist-input-create:focus{--button-color-back: var(--color-blue-500);--button-color-text: var(--color-black)}.k-picklist-dropdown .k-picklist-input-body{max-height:calc(var(--button-height) * 9.5 + 2px * 9 + var(--dropdown-padding));overflow-y:auto;outline-offset:-2px;overscroll-behavior:contain;scroll-padding-top:var(--dropdown-padding);scroll-padding-bottom:var(--dropdown-padding)}.k-picklist-dropdown .k-picklist-input-options .k-choice-input{--choice-color-border: var(--dropdown-color-hr);--choice-color-back: var(--dropdown-color-hr);--choice-color-info: var(--color-text-dimmed);min-height:var(--button-height);border-radius:var(--picklist-rounded);padding-block:.375rem}.k-picklist-dropdown .k-picklist-input-options li+li{margin-top:0}.k-picklist-dropdown .k-picklist-input-options .k-choice-input[aria-disabled=true] input{--choice-color-border: var(--dropdown-color-hr);--choice-color-back: var(--dropdown-color-hr);--choice-color-checked: var(--dropdown-color-hr);opacity:var(--opacity-disabled)}.k-picklist-dropdown .k-picklist-input-options .k-choice-input:not([aria-disabled=true]):hover{background-color:var(--dropdown-color-hr)}.k-picklist-dropdown .k-picklist-input-options .k-choice-input:not([aria-disabled=true]):focus-within{--choice-color-text: var(--color-blue-500)}.k-picklist-dropdown .k-picklist-input-more.k-button:hover{--button-color-back: var(--dropdown-color-hr)}.k-picklist-dropdown .k-picklist-input-body+.k-picklist-input-footer{border-top:1px solid var(--dropdown-color-hr)}.k-counter{font-size:var(--text-xs);color:var(--color-gray-900)}.k-counter[data-invalid=true]{color:var(--color-red-700)}.k-counter-rules{color:var(--color-gray-600);padding-inline-start:.5rem}.k-field[data-disabled=true]{cursor:not-allowed}.k-field[data-disabled=true] *{pointer-events:none}.k-field[data-disabled=true] .k-text[data-theme=help] *{pointer-events:initial}.k-field-header{display:flex;justify-content:space-between;align-items:center;gap:var(--spacing-6);position:relative;margin-bottom:var(--spacing-2)}.k-field-options{flex-shrink:0}.k-field:focus-within>.k-field-header>.k-field-counter{display:block}.k-field-footer{margin-top:var(--spacing-2)}.k-fieldset{border:0}.k-form-submitter{display:none}.k-form-controls-dropdown{max-width:15rem}.k-form-controls-dropdown p{line-height:var(--leading-normal);padding:var(--spacing-1) var(--spacing-2)}.k-form-controls-dropdown dl div{padding:var(--spacing-1) var(--spacing-2);line-height:var(--leading-normal);display:flex;align-items:center;gap:.75rem;color:var(--color-gray-500)}:root{--input-color-back: var(--color-white);--input-color-border: var(--color-border);--input-color-description: var(--color-text-dimmed);--input-color-icon: currentColor;--input-color-placeholder: var(--color-gray-600);--input-color-text: currentColor;--input-font-family: var(--font-sans);--input-font-size: var(--text-sm);--input-height: 2.25rem;--input-leading: 1;--input-outline-focus: var(--outline);--input-padding: var(--spacing-2);--input-padding-multiline: .475rem var(--input-padding);--input-rounded: var(--rounded);--input-shadow: none}@media (pointer: coarse){:root{--input-font-size: var(--text-md);--input-padding-multiline: .375rem var(--input-padding)}}.k-input{display:flex;align-items:center;line-height:var(--input-leading);border:0;background:var(--input-color-back);border-radius:var(--input-rounded);outline:1px solid var(--input-color-border);color:var(--input-color-text);min-height:var(--input-height);box-shadow:var(--input-shadow);font-family:var(--input-font-family);font-size:var(--input-font-size)}.k-input:focus-within{outline:var(--input-outline-focus)}.k-input-element{flex-grow:1}.k-input-icon{color:var(--input-color-icon);display:flex;justify-content:center;align-items:center;width:var(--input-height)}.k-input-icon-button{width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-shrink:0}.k-input-description{color:var(--input-color-description);padding-inline:var(--input-padding)}.k-input-before{padding-inline-end:0}.k-input-after{padding-inline-start:0}.k-input :where(.k-input-description,.k-input-icon){align-self:stretch;display:flex;align-items:center;flex-shrink:0}.k-input[data-disabled=true]{--input-color-back: var(--color-light);--input-color-icon: var(--color-gray-600);pointer-events:none}.k-block-title{display:flex;align-items:center;min-width:0;padding-inline-end:.75rem;line-height:1;gap:var(--spacing-2)}.k-block-icon{--icon-color: var(--color-gray-600);width:1rem}.k-block-label{color:var(--color-text-dimmed);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.k-block-type-default .k-block-title{line-height:1.5em}.k-block-options{--toolbar-size: 30px;box-shadow:var(--shadow-toolbar)}.k-block-options>.k-button:not(:last-of-type){border-inline-end:1px solid var(--color-light)}.k-block-options .k-dropdown-content{margin-top:.5rem}.k-block-container{position:relative;padding:var(--spacing-3);background:var(--color-white);border-radius:var(--rounded)}.k-block-container:not(:last-of-type){border-bottom:1px dashed var(--color-border-dimmed)}.k-block-container:focus{outline:0}.k-block-container[data-selected=true]{z-index:2;outline:var(--outline);border-bottom-color:transparent}.k-block-container[data-batched=true]:after{position:absolute;top:0;right:0;bottom:0;left:0;content:"";background:#b1c2d82d;mix-blend-mode:multiply}.k-block-container .k-block-options{display:none;position:absolute;top:0;inset-inline-end:var(--spacing-3);margin-top:calc(-1.75rem + 2px)}.k-block-container[data-last-selected=true]>.k-block-options{display:flex}.k-block-container[data-hidden=true] .k-block{opacity:.25}.k-drawer-options .k-drawer-option[data-disabled=true]{vertical-align:middle;display:inline-grid}.k-block-container[data-disabled=true]{background:var(--color-light)}.k-block-container:is(.k-sortable-ghost,.k-sortable-fallback) .k-block{position:relative;max-height:4rem;overflow:hidden}.k-block-container:is(.k-sortable-ghost,.k-sortable-fallback) .k-block:after{position:absolute;bottom:0;content:"";height:2rem;width:100%;background:linear-gradient(to top,var(--color-white),transparent)}.k-blocks{border-radius:var(--rounded)}.k-blocks:not([data-empty=true],[data-disabled=true]){background:var(--color-white);box-shadow:var(--shadow)}.k-blocks[data-disabled=true]:not([data-empty=true]){border:1px solid var(--input-color-border)}.k-blocks-list[data-multi-select-key=true]>.k-block-container *{pointer-events:none}.k-blocks-list[data-multi-select-key=true]>.k-block-container .k-blocks *{pointer-events:all}.k-blocks .k-sortable-ghost{outline:2px solid var(--color-focus);box-shadow:#11111140 0 5px 10px;cursor:grabbing;cursor:-moz-grabbing;cursor:-webkit-grabbing}.k-blocks-list>.k-blocks-empty{display:flex;align-items:center}.k-block-importer .k-dialog-body{padding:0}.k-block-importer label{display:block;padding:var(--spacing-6) var(--spacing-6) 0;color:var(--color-text-dimmed);line-height:var(--leading-normal)}.k-block-importer label small{display:block;font-size:inherit}.k-block-importer textarea{width:100%;height:20rem;background:none;font:inherit;color:var(--color-white);border:0;padding:var(--spacing-6);resize:none}.k-block-importer textarea:focus{outline:0}.k-block-selector .k-headline{margin-bottom:1rem}.k-block-selector details+details{margin-top:var(--spacing-6)}.k-block-selector summary{font-size:var(--text-xs);cursor:pointer;color:var(--color-text-dimmed)}.k-block-selector details:only-of-type summary{pointer-events:none}.k-block-selector summary:focus{outline:0}.k-block-selector summary:focus-visible{color:var(--color-focus)}.k-block-types{display:grid;grid-gap:2px;margin-top:.75rem;grid-template-columns:repeat(1,1fr)}.k-block-types .k-button{--button-color-icon: var(--color-text);--button-color-back: var(--color-white);--button-padding: var(--spacing-3);width:100%;justify-content:start;gap:1rem;box-shadow:var(--shadow)}.k-block-types .k-button[aria-disabled=true]{opacity:var(--opacity-disabled);--button-color-back: var(--color-gray-200);box-shadow:none}.k-clipboard-hint{padding-top:1.5rem;line-height:var(--leading-normal);font-size:var(--text-xs);color:var(--color-text-dimmed)}.k-clipboard-hint small{display:block;font-size:inherit;color:var(--color-text-dimmed)}.k-block-background-dropdown>.k-button{--color-frame-rounded: 0;--color-frame-size: 1.5rem;--button-height: 1.5rem;--button-padding: 0 .125rem;--button-color-back: var(--color-white);gap:.25rem;box-shadow:var(--shadow-toolbar);border:1px solid var(--color-white)}.k-block-background-dropdown .k-color-frame{border-right:1px solid var(--color-gray-300)}.k-block-background-dropdown .k-color-frame:after{box-shadow:none}.k-block .k-block-background-dropdown{position:absolute;inset-inline-end:var(--spacing-3);bottom:var(--spacing-3);opacity:0;transition:opacity .2s ease-in-out}.k-block:hover .k-block-background-dropdown{opacity:1}.k-block-figure:not([data-empty=true]){--block-figure-back: var(--color-white);background:var(--block-figure-back)}.k-block-figure-container:not([data-disabled=true]){cursor:pointer}.k-block-figure iframe{border:0;pointer-events:none;background:var(--color-black)}.k-block-figure figcaption{padding-top:.5rem;color:var(--color-text-dimmed);font-size:var(--text-sm);text-align:center}.k-block-figure-empty{--button-width: 100%;--button-height: 6rem;--button-color-text: var(--color-text-dimmed);--button-color-back: var(--color-light)}.k-block-figure-empty,.k-block-figure-container>*{border-radius:var(--rounded-sm)}.k-block-figure-caption{display:flex;justify-content:center;padding-top:var(--spacing-3)}.k-block-figure-caption .k-writer{width:max-content;text-align:center}.k-block-figure-caption .k-writer .k-text{color:var(--color-gray-600);font-size:var(--text-sm);mix-blend-mode:exclusion}.k-block-type-code-editor{position:relative}.k-block-type-code-editor .k-input{--input-color-border: none;--input-color-back: var(--color-black);--input-color-text: var(--color-white);--input-font-family: var(--font-mono);--input-outline-focus: none;--input-padding: var(--spacing-3);--input-padding-multiline: var(--input-padding)}.k-panel[data-theme=dark] .k-block-type-code-editor .k-input{--input-color-back: var(--color-light);--input-color-text: var(--color-text)}.k-block-type-code-editor .k-input[data-type=textarea]{white-space:pre-wrap}.k-block-type-code-editor-language{--input-font-size: var(--text-xs);position:absolute;inset-inline-end:0;bottom:0}.k-block-type-code-editor-language .k-input-element{padding-inline-start:1.5rem}.k-block-type-code-editor-language .k-input-icon{inset-inline-start:0}.k-block-container.k-block-container-type-fields{padding-block:0}.k-block-container:not([data-hidden=true]) .k-block-type-fields>:not([data-collapsed=true]){padding-bottom:var(--spacing-3)}.k-block-type-fields-header{display:flex;justify-content:space-between}.k-block-type-fields-header .k-block-title{padding-block:var(--spacing-3);cursor:pointer;white-space:nowrap}.k-block-type-fields-form{background-color:var(--color-gray-200);padding:var(--spacing-6) var(--spacing-6) var(--spacing-8);border-radius:var(--rounded-sm);container:column / inline-size}.k-block-container-type-fields[data-hidden=true] :where(.k-drawer-tabs,.k-block-type-fields-form){display:none}.k-block-container.k-block-container-type-gallery{padding:0}.k-block-type-gallery>figure{padding:var(--spacing-3);border-radius:var(--rounded)}.k-block-type-gallery>figure:not([data-empty=true]){background:var(--block-back)}.k-block-type-gallery ul{display:grid;grid-gap:.75rem;grid-template-columns:repeat(auto-fit,minmax(6rem,1fr));line-height:0;align-items:center;justify-content:center}.k-block-type-gallery:not([data-disabled=true]) ul{cursor:pointer}.k-block-type-gallery ul .k-image-frame{border-radius:var(--rounded-sm)}.k-block-type-gallery[data-disabled=true] .k-block-type-gallery-placeholder{background:var(--color-gray-250)}.k-block-type-gallery-placeholder{background:var(--color-light)}.k-block-type-heading-input{display:flex;align-items:center;line-height:1.25em;font-size:var(--text-size);font-weight:var(--font-bold)}.k-block-type-heading-input[data-level=h1]{--text-size: var(--text-3xl);line-height:1.125em}.k-block-type-heading-input[data-level=h2]{--text-size: var(--text-2xl)}.k-block-type-heading-input[data-level=h3]{--text-size: var(--text-xl)}.k-block-type-heading-input[data-level=h4]{--text-size: var(--text-lg)}.k-block-type-heading-input[data-level=h5]{--text-size: var(--text-md);line-height:1.5em}.k-block-type-heading-input[data-level=h6]{--text-size: var(--text-sm);line-height:1.5em}.k-block-type-heading-input .k-writer-input .ProseMirror strong{font-weight:700}.k-block-type-heading-level{--input-color-back: transparent;--input-color-border: none;--input-color-text: var(--color-gray-600);font-weight:var(--font-bold);text-transform:uppercase}.k-block-container.k-block-container-type-image{padding:0}.k-block-type-image .k-block-figure{padding:var(--spacing-3);border-radius:var(--rounded)}.k-block-type-image .k-block-figure-container{text-align:center;line-height:0}.k-block-type-image .k-block-figure[data-empty=true]{padding:var(--spacing-3)}.k-block-type-image-auto{max-width:100%;max-height:30rem;margin-inline:auto}.k-block-type-image .k-background-dropdown{position:absolute;inset-inline-end:var(--spacing-3);bottom:var(--spacing-3);opacity:0;transition:opacity .2s ease-in-out}.k-block-type-image:hover .k-background-dropdown{opacity:1}.k-block-type-line hr{margin-block:.75rem;border:0;border-top:1px solid var(--color-border)}.k-block-type-list-input{--input-color-back: transparent;--input-color-border: none;--input-outline-focus: none}.k-block-type-markdown-input{--input-color-back: var(--color-light);--input-color-border: none;--input-outline-focus: none;--input-padding-multiline: var(--spacing-3)}.k-block-type-quote-editor{padding-inline-start:var(--spacing-3);border-inline-start:2px solid var(--color-black)}.k-block-type-quote-text{font-size:var(--text-xl);margin-bottom:var(--spacing-1);line-height:1.25em}.k-block-type-quote-citation{font-style:italic;color:var(--color-text-dimmed)}.k-block-type-table-preview{cursor:pointer;border:1px solid var(--color-gray-300);border-spacing:0;border-radius:var(--rounded-sm)}.k-block-type-table-preview :where(th,td){text-align:start;line-height:1.5em;font-size:var(--text-sm)}.k-block-type-table-preview th{padding:.5rem .75rem}.k-block-type-table-preview td:not(.k-table-index-column){padding:0 .75rem}.k-block-type-table-preview td>*,.k-block-type-table-preview td [class$=-field-preview]{padding:0}.k-block-type-text-input{line-height:1.5;height:100%}.k-block-container.k-block-container-type-text{padding:0}.k-block-type-text-input.k-writer-input[data-toolbar-inline=true]{padding:var(--spacing-3)}.k-block-type-text-input.k-writer-input:not([data-toolbar-inline=true])>.ProseMirror,.k-block-type-text-input.k-writer-input:not([data-toolbar-inline=true])[data-placeholder][data-empty=true]:before{padding:var(--spacing-3) var(--spacing-6)}.k-block-type-text-input.k-textarea-input .k-textarea-input-native{padding:var(--input-padding-multiline)}.k-block-type-video-figure video{pointer-events:none}.k-blocks-field{position:relative}.k-blocks-field>footer{display:flex;justify-content:center;margin-top:var(--spacing-3)}.k-string-input{padding:var(--input-padding);border-radius:var(--input-rounded)}.k-string-input:focus{outline:0}.k-string-input[data-font=monospace]{font-family:var(--font-mono)}.k-color-field{--color-frame-size: calc(var(--input-height) - var(--spacing-2))}.k-color-field .k-input-before{align-items:center;padding-inline-start:var(--spacing-1)}.k-color-field-options{--color-frame-size: var(--input-height)}.k-color-field-picker{padding:var(--spacing-3)}.k-color-field-picker-toggle{--color-frame-rounded: var(--rounded-sm);border-radius:var(--color-frame-rounded)}.k-color-field .k-colorname-input{padding-inline:var(--input-padding)}.k-color-field .k-colorname-input:focus{outline:0}.k-date-input:disabled::placeholder{opacity:0}.k-date-field-body{display:grid;gap:var(--spacing-2)}@container (min-width: 20rem){.k-date-field-body[data-has-time=true]{grid-template-columns:1fr minmax(6rem,9rem)}}.k-models-field[data-disabled=true] .k-item *{pointer-events:all!important}.k-headline-field{position:relative;padding-top:1.5rem}.k-fieldset>.k-grid .k-column:first-child .k-headline-field{padding-top:0}.k-headline-field h2.k-headline{font-weight:var(--font-normal)}.k-headline-field footer{margin-top:var(--spacing-2)}.k-info-field .k-headline{padding-bottom:.75rem;line-height:1.25rem}.k-layout-column{position:relative;height:100%;display:flex;flex-direction:column;background:var(--color-white);min-height:6rem}.k-layout-column:focus{outline:0}.k-layout-column>.k-blocks{background:none;box-shadow:none;padding:0;height:100%;background:var(--color-white);min-height:4rem}.k-layout-column>.k-blocks[data-empty=true]{min-height:6rem}.k-layout-column>.k-blocks>.k-blocks-list{display:flex;flex-direction:column;height:100%}.k-layout-column>.k-blocks>.k-blocks-list>.k-block-container:last-of-type{flex-grow:1}.k-layout-column>.k-blocks>.k-blocks-list>.k-blocks-empty.k-box{--box-color-back: transparent;position:absolute;top:0;right:0;bottom:0;left:0;justify-content:center;opacity:0;transition:opacity .3s;border:0}.k-layout-column>.k-blocks>.k-blocks-list>.k-blocks-empty:hover{opacity:1}.k-layout{--layout-border-color: var(--color-gray-300);--layout-toolbar-width: 2rem;position:relative;padding-inline-end:var(--layout-toolbar-width);background:#fff;box-shadow:var(--shadow)}[data-disabled=true] .k-layout{padding-inline-end:0}.k-layout:not(:last-of-type){margin-bottom:1px}.k-layout:focus{outline:0}.k-layout-toolbar{position:absolute;inset-block:0;inset-inline-end:0;width:var(--layout-toolbar-width);display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding-bottom:var(--spacing-2);font-size:var(--text-sm);background:var(--color-gray-100);border-inline-start:1px solid var(--color-light);color:var(--color-gray-500)}.k-layout-toolbar:hover{color:var(--color-black)}.k-layout-toolbar-button{width:var(--layout-toolbar-width);height:var(--layout-toolbar-width)}.k-layout-columns.k-grid{grid-gap:1px;background:var(--layout-border-color);background:var(--color-gray-300)}.k-layout:not(:first-child) .k-layout-columns.k-grid{border-top:0}.k-layouts .k-sortable-ghost{position:relative;box-shadow:#11111140 0 5px 10px;outline:2px solid var(--color-focus);cursor:grabbing;z-index:1}.k-layout-field>footer{display:flex;justify-content:center;margin-top:var(--spacing-3)}.k-line-field{position:relative;border:0;height:3rem;width:auto}.k-line-field:after{position:absolute;content:"";top:50%;margin-top:-1px;inset-inline:0;height:1px;background:var(--color-border)}.k-link-input-header{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:.25rem;height:var(--input-height);grid-area:header}.k-link-input-toggle.k-button{--button-height: var(--height-sm);--button-rounded: var(--rounded-sm);--button-color-back: var(--color-gray-200);margin-inline-start:.25rem}.k-link-input-model{display:flex;justify-content:space-between;margin-inline-end:var(--spacing-1)}.k-link-input-model-placeholder.k-button{--button-align: flex-start;--button-color-text: var(--color-gray-600);--button-height: var(--height-sm);--button-padding: var(--spacing-2);--button-rounded: var(--rounded-sm);flex-grow:1;overflow:hidden;white-space:nowrap;align-items:center}.k-link-field .k-link-field-preview{--tag-height: var(--height-sm);padding-inline:0}.k-link-field .k-link-field-preview .k-tag:focus{outline:0}.k-link-field .k-link-field-preview .k-tag:focus-visible{outline:var(--outline)}.k-link-field .k-link-field-preview .k-tag-text{font-size:var(--text-sm)}.k-link-input-model-toggle{align-self:center;--button-height: var(--height-sm);--button-width: var(--height-sm);--button-rounded: var(--rounded-sm)}.k-link-input-body{display:grid;overflow:hidden;border-top:1px solid var(--color-gray-300);background:var(--color-gray-100);--tree-color-back: var(--color-gray-100);--tree-color-hover-back: var(--color-gray-200)}.k-link-input-body[data-type=page] .k-page-browser{padding:var(--spacing-2);padding-bottom:calc(var(--spacing-2) - 1px);width:100%;container-type:inline-size;overflow:auto}.k-link-field .k-bubbles-field-preview{--tag-rounded: var(--rounded-sm);--tag-size: var(--height-sm);padding-inline:0}.k-link-field[data-disabled=true] .k-link-input-model-placeholder{display:none}.k-link-field[data-disabled=true] input::placeholder{opacity:0}.k-writer-input{position:relative;width:100%;display:grid;grid-template-areas:"content";gap:var(--spacing-1)}.k-writer-input .ProseMirror{overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;white-space:pre-wrap;font-variant-ligatures:none;grid-area:content;padding:var(--input-padding-multiline)}.k-writer-input .ProseMirror:focus{outline:0}.k-writer-input .ProseMirror *{caret-color:currentColor}.k-writer-input .ProseMirror hr.ProseMirror-selectednode{outline:var(--outline)}.k-writer-input[data-placeholder][data-empty=true]:before{grid-area:content;content:attr(data-placeholder);color:var(--input-color-placeholder);pointer-events:none;white-space:pre-wrap;word-wrap:break-word;line-height:var(--text-line-height);padding:var(--input-padding-multiline)}.k-list-input.k-writer-input[data-placeholder][data-empty=true]:before{padding-inline-start:2.5em}.k-list-field .k-list-input .ProseMirror,.k-list-field .k-list-input:before{padding:.475rem .5rem .475rem .75rem}:root{--tag-color-back: var(--color-black);--tag-color-text: var(--color-white);--tag-color-toggle: currentColor;--tag-color-disabled-back: var(--color-gray-600);--tag-color-disabled-text: var(--tag-color-text);--tag-height: var(--height-xs);--tag-rounded: var(--rounded-sm);--tag-text-size: var(--text-sm)}.k-tag[data-theme=light]{--tag-color-back: var(--color-light);--tag-color-text: var(--color-black);--tag-color-disabled-back: var(--color-gray-200);--tag-color-disabled-text: var(--color-gray-600)}.k-tag{position:relative;height:var(--tag-height);display:flex;align-items:center;justify-content:space-between;font-size:var(--tag-text-size);line-height:1;color:var(--tag-color-text);background-color:var(--tag-color-back);border-radius:var(--tag-rounded);-webkit-user-select:none;user-select:none}button.k-tag:not([aria-disabled=true]){cursor:pointer}.k-tag:not([aria-disabled=true]):focus{outline:var(--outline)}.k-tag-image{height:100%;border-radius:var(--rounded-xs);overflow:hidden;flex-shrink:0;border-radius:0;border-start-start-radius:var(--tag-rounded);border-end-start-radius:var(--tag-rounded);background-clip:padding-box}.k-tag-text{padding-inline:var(--spacing-2);line-height:var(--leading-tight);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.k-tag[data-has-toggle=true] .k-tag-text{padding-inline-end:0}.k-tag-toggle{--icon-size: 14px;width:var(--tag-height);height:var(--tag-height);filter:brightness(70%);flex-shrink:0}.k-tag-toggle:hover{filter:brightness(100%)}.k-tag:where([aria-disabled=true]){background-color:var(--tag-color-disabled-back);color:var(--tag-color-disabled-text);cursor:not-allowed}:root{--tags-gap: .375rem}.k-tags{display:inline-flex;gap:var(--tags-gap);align-items:center;flex-wrap:wrap}.k-tags .k-sortable-ghost{outline:var(--outline)}.k-tags[data-layout=list],.k-tags[data-layout=list] .k-tag{width:100%}.k-tags.k-draggable .k-tag-text{cursor:grab}.k-tags.k-draggable .k-tag-text:active{cursor:grabbing}.k-multiselect-input{padding:var(--tags-gap);cursor:pointer}.k-multiselect-input-toggle.k-button{opacity:0}.k-tags-input{padding:var(--tags-gap)}.k-tags-input[data-can-add=true]{cursor:pointer}.k-tags-input-toggle.k-button{--button-color-text: var(--input-color-placeholder);opacity:0}.k-tags-input-toggle.k-button:focus{--button-color-text: var(--input-color-text)}.k-tags-input:focus-within .k-tags-input-toggle{opacity:1}.k-tags-input .k-picklist-dropdown{margin-top:var(--spacing-1)}.k-tags-input .k-picklist-dropdown .k-choice-input:focus-within{outline:var(--outline)}.k-number-input{padding:var(--input-padding);border-radius:var(--input-rounded)}.k-number-input:focus{outline:0}.k-table.k-object-field-table{table-layout:auto}.k-table.k-object-field-table tbody td{max-width:0}@container (max-width: 40rem){.k-object-field{overflow:hidden}.k-object-field-table.k-table tbody :where(th):is([data-mobile=true]){width:1px!important;white-space:normal;word-break:normal}}.k-range-input{--range-track-height: 1px;--range-track-back: var(--color-gray-300);--range-tooltip-back: var(--color-black);display:flex;align-items:center;border-radius:var(--range-track-height)}.k-range-input input[type=range]:focus{outline:0}.k-range-input-tooltip{position:relative;display:flex;align-items:center;color:var(--color-white);font-size:var(--text-xs);font-variant-numeric:tabular-nums;line-height:1;text-align:center;border-radius:var(--rounded-sm);background:var(--range-tooltip-back);margin-inline-start:var(--spacing-3);padding:0 var(--spacing-1);white-space:nowrap}.k-range-input-tooltip:after{position:absolute;top:50%;inset-inline-start:-3px;width:0;height:0;transform:translateY(-50%);border-block:3px solid transparent;border-inline-end:3px solid var(--range-tooltip-back);content:""}.k-range-input-tooltip>*{padding:var(--spacing-1)}.k-range-input[data-disabled=true]{--range-tooltip-back: var(--color-gray-600)}.k-input[data-type=range] .k-range-input{padding-inline:var(--input-padding)}.k-select-input{position:relative;display:block;overflow:hidden;padding:var(--input-padding);border-radius:var(--input-rounded)}.k-select-input[data-empty=true]{color:var(--input-color-placeholder)}.k-select-input-native{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;z-index:1}.k-select-input-native[disabled]{cursor:default}.k-input[data-type=select]{position:relative}.k-input[data-type=select] .k-input-icon{position:absolute;inset-block:0;inset-inline-end:0}.k-structure-field:not([data-disabled=true]) td.k-table-column{cursor:pointer}.k-structure-field .k-table+footer{display:flex;justify-content:center;margin-top:var(--spacing-3)}.k-text-input{padding:var(--input-padding);border-radius:var(--input-rounded)}.k-text-input:focus{outline:0}.k-text-input[data-font=monospace]{font-family:var(--font-mono)}.k-text-input:disabled::placeholder{opacity:0}.k-field-counter{display:none}.k-text-field:focus-within .k-field-counter{display:block}.k-toolbar.k-textarea-toolbar{border-end-start-radius:0;border-end-end-radius:0;border-bottom:1px solid var(--toolbar-border)}.k-toolbar.k-textarea-toolbar>.k-button:first-child{border-end-start-radius:0}.k-toolbar.k-textarea-toolbar>.k-button:last-child{border-end-end-radius:0}.k-textarea-input[data-size=small]{--textarea-size: 7.5rem}.k-textarea-input[data-size=medium]{--textarea-size: 15rem}.k-textarea-input[data-size=large]{--textarea-size: 30rem}.k-textarea-input[data-size=huge]{--textarea-size: 45rem}.k-textarea-input-wrapper{position:relative;display:block}.k-textarea-input-native{resize:none;min-height:var(--textarea-size)}.k-textarea-input-native:focus{outline:0}.k-textarea-input-native[data-font=monospace]{font-family:var(--font-mono)}.k-input[data-type=textarea] .k-input-element{min-width:0}.k-input[data-type=textarea] .k-textarea-input-native{padding:var(--input-padding-multiline)}.k-time-input:disabled::placeholder{opacity:0}.k-choice-input{display:flex;gap:var(--spacing-3);min-width:0}.k-choice-input input{top:2px}.k-choice-input-label{display:flex;line-height:1.25rem;flex-direction:column;min-width:0;color:var(--choice-color-text)}.k-choice-input-label>*{display:block;overflow:hidden;text-overflow:ellipsis}.k-choice-input-label-info{color:var(--choice-color-info)}.k-choice-input[aria-disabled=true]{cursor:not-allowed}:where(.k-checkboxes-field,.k-radio-field) .k-choice-input{min-height:var(--input-height);padding-block:var(--spacing-2);padding-inline:var(--spacing-3);border-radius:var(--input-rounded)}:where(.k-checkboxes-field,.k-radio-field) .k-choice-input:not([aria-disabled=true]){background:var(--input-color-back);box-shadow:var(--shadow)}:where(.k-checkboxes-field,.k-radio-field) .k-choice-input[aria-disabled=true]{outline:1px solid var(--input-color-border)}.k-input[data-type=toggle]{--input-color-border: transparent;--input-shadow: var(--shadow)}.k-input[data-type=toggle] .k-input-before{padding-inline-end:calc(var(--input-padding) / 2)}.k-input[data-type=toggle] .k-toggle-input{padding-inline-start:var(--input-padding)}.k-input[data-type=toggle][data-disabled=true]{box-shadow:none;border:1px solid var(--color-border)}.k-input[data-type=toggles]{display:inline-flex}.k-input[data-type=toggles].grow{display:flex}.k-input[data-type=toggles]:has(.k-empty){outline:0;display:flex}.k-toggles-input ul{display:grid;grid-template-columns:repeat(var(--options),minmax(0,1fr));gap:1px;border-radius:var(--rounded);line-height:1;background:var(--color-border);overflow:hidden}.k-toggles-input li{height:var(--field-input-height);background:var(--color-white)}.k-toggles-input label{align-items:center;background:var(--color-white);cursor:pointer;display:flex;font-size:var(--text-sm);justify-content:center;line-height:1.25;padding:0 var(--spacing-3);height:100%}.k-toggles-input li[data-disabled=true] label{color:var(--color-text-dimmed);background:var(--color-light)}.k-toggles-input .k-icon+.k-toggles-text{margin-inline-start:var(--spacing-2)}.k-toggles-input input:focus:not(:checked)+label{background:var(--color-blue-200)}.k-toggles-input input:checked+label{background:var(--color-black);color:var(--color-white)}.k-alpha-input{--range-track-back: linear-gradient(to right, transparent, currentColor);--range-track-height: var(--range-thumb-size);color:#000;background:#fff var(--pattern-light)}.k-calendar-input{--button-height: var(--height-sm);--button-width: var(--button-height);--button-padding: 0;padding:var(--spacing-2);width:min-content}.k-calendar-table{table-layout:fixed;min-width:15rem}.k-calendar-input .k-button{justify-content:center}.k-calendar-input>nav{display:flex;direction:ltr;align-items:center;margin-bottom:var(--spacing-2)}.k-calendar-selects{flex-grow:1;display:flex;align-items:center;justify-content:center}[dir=ltr] .k-calendar-selects{direction:ltr}[dir=rtl] .k-calendar-selects{direction:rtl}.k-calendar-selects .k-select-input{display:flex;align-items:center;text-align:center;height:var(--button-height);padding:0 .5rem;border-radius:var(--input-rounded)}.k-calendar-selects .k-select-input:focus-within{outline:var(--outline)}.k-calendar-input th{padding-block:.5rem;color:var(--color-gray-500);font-size:var(--text-xs);text-align:center}.k-calendar-day{padding:2px}.k-calendar-day[aria-current=date] .k-button{text-decoration:underline}.k-calendar-day[aria-selected=date] .k-button,.k-calendar-day[aria-selected=date] .k-button:focus{--button-color-text: var(--color-text);--button-color-back: var(--color-blue-500)}.k-calendar-day[aria-selected=date] .k-button:focus-visible{outline-offset:2px}.k-calendar-today{padding-top:var(--spacing-2);text-align:center}.k-calendar-today .k-button{--button-width: auto;--button-padding: var(--spacing-3);font-size:var(--text-xs);text-decoration:underline}.k-coloroptions-input{--color-preview-size: var(--input-height)}.k-coloroptions-input ul{display:grid;grid-template-columns:repeat(auto-fill,var(--color-preview-size));gap:var(--spacing-2)}.k-coloroptions-input input:focus+.k-color-frame{outline:var(--outline)}.k-coloroptions-input[disabled] label{opacity:var(--opacity-disabled);cursor:not-allowed}.k-coloroptions-input input:checked+.k-color-frame{outline:1px solid var(--color-gray-600);outline-offset:2px}.k-colorpicker-input{--h: 0;--s: 0%;--l: 0%;--a: 1;--range-thumb-size: .75rem;--range-track-height: .75rem;display:flex;flex-direction:column;gap:var(--spacing-3);width:max-content}.k-colorpicker-input .k-coords-input{border-radius:var(--rounded-sm);aspect-ratio:1/1;background:linear-gradient(to bottom,transparent,#000),linear-gradient(to right,#fff,hsl(var(--h),100%,50%))}.k-colorpicker-input .k-alpha-input{color:hsl(var(--h),var(--s),var(--l))}.k-colorpicker-input .k-coloroptions-input ul{grid-template-columns:repeat(6,1fr)}.k-coords-input{position:relative;display:block!important}.k-coords-input img{width:100%}.k-coords-input-thumb{position:absolute;aspect-ratio:1/1;width:var(--range-thumb-size);background:var(--range-thumb-color);border-radius:var(--range-thumb-size);box-shadow:var(--range-thumb-shadow);transform:translate(-50%,-50%);cursor:move}.k-coords-input[data-empty=true] .k-coords-input-thumb{opacity:0}.k-coords-input-thumb:active{cursor:grabbing}.k-coords-input:focus-within{outline:var(--outline)}.k-coords-input[aria-disabled=true]{pointer-events:none;opacity:var(--opacity-disabled)}.k-coords-input .k-coords-input-thumb:focus{outline:var(--outline)}.k-hue-input{--range-track-back: linear-gradient( to right, hsl(0, 100%, 50%) 0%, hsl(60, 100%, 50%) 16.67%, hsl(120, 100%, 50%) 33.33%, hsl(180, 100%, 50%) 50%, hsl(240, 100%, 50%) 66.67%, hsl(320, 100%, 50%) 83.33%, hsl(360, 100%, 50%) 100% ) no-repeat;--range-track-height: var(--range-thumb-size)}.k-timeoptions-input{--button-height: var(--height-sm);display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-3)}.k-timeoptions-input h3{display:flex;align-items:center;padding-inline:var(--button-padding);height:var(--button-height);margin-bottom:var(--spacing-1)}.k-timeoptions-input hr{margin:var(--spacing-2) var(--spacing-3)}.k-timeoptions-input .k-button[aria-selected=time]{--button-color-text: var(--color-text);--button-color-back: var(--color-blue-500)}.k-layout-selector h3{margin-top:-.5rem;margin-bottom:var(--spacing-3)}.k-layout-selector-options{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--spacing-6)}@media screen and (min-width: 65em){.k-layout-selector-options{grid-template-columns:repeat(var(--columns),1fr)}}.k-layout-selector-option{--color-border: hsla(var(--color-gray-hs), 0%, 6%);--color-back: var(--color-white);border-radius:var(--rounded)}.k-layout-selector-option:focus-visible{outline:var(--outline);outline-offset:-1px}.k-layout-selector-option .k-grid{border:1px solid var(--color-border);gap:1px;grid-template-columns:repeat(var(--columns),1fr);cursor:pointer;background:var(--color-border);border-radius:var(--rounded);overflow:hidden;box-shadow:var(--shadow);height:5rem}.k-layout-selector-option .k-column{grid-column:span var(--span);background:var(--color-back);height:100%}.k-layout-selector-option:hover{--color-border: var(--color-gray-500);--color-back: var(--color-gray-100)}.k-layout-selector-option[aria-current=true]{--color-border: var(--color-focus);--color-back: var(--color-blue-300)}.k-tags-field-preview{--tags-gap: .25rem;--tag-text-size: var(--text-xs);padding:.375rem var(--table-cell-padding);overflow:hidden}.k-tags-field-preview .k-tags{flex-wrap:nowrap}.k-bubbles{display:flex;gap:.25rem}.k-bubbles-field-preview{--bubble-back: var(--color-light);--bubble-text: var(--color-black);padding:.375rem var(--table-cell-padding);overflow:hidden}.k-bubbles-field-preview .k-bubbles{gap:.375rem}.k-color-field-preview{--color-frame-rounded: var(--tag-rounded);--color-frame-size: var(--tag-height);padding:.375rem var(--table-cell-padding);display:flex;align-items:center;gap:var(--spacing-2)}.k-text-field-preview{padding:.325rem .75rem;overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.k-url-field-preview{padding-inline:var(--table-cell-padding)}.k-url-field-preview[data-link]{color:var(--link-color)}.k-url-field-preview a{display:inline-flex;align-items:center;height:var(--height-xs);padding-inline:var(--spacing-1);margin-inline:calc(var(--spacing-1) * -1);border-radius:var(--rounded);max-width:100%;min-width:0}.k-url-field-preview a>*{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-decoration:underline;text-underline-offset:var(--link-underline-offset)}.k-url-field-preview a:hover{color:var(--color-black)}.k-flag-field-preview{--button-height: var(--table-row-height);--button-width: 100%;outline-offset:-2px}.k-html-field-preview{padding:.375rem var(--table-cell-padding);overflow:hidden;text-overflow:ellipsis}.k-image-field-preview{height:100%}.k-link-field-preview{--tag-height: var(--height-xs);--tag-color-back: var(--color-gray-200);--tag-color-text: var(--color-black);--tag-color-toggle: var(--tag-color-text);--tag-color-toggle-border: var(--color-gray-300);--tag-color-focus-back: var(--tag-color-back);--tag-color-focus-text: var(--tag-color-text);padding-inline:var(--table-cell-padding);min-width:0}.k-link-field-preview .k-tag{min-width:0;max-width:100%}.k-link-field-preview .k-tag-text{font-size:var(--text-xs);min-width:0}.k-toggle-field-preview{padding-inline:var(--table-cell-padding)}:root{--toolbar-size: var(--height);--toolbar-text: var(--color-black);--toolbar-back: var(--color-white);--toolbar-hover: hsla(0, 0%, var(--color-l-min), .4);--toolbar-border: hsla(0, 100%, var(--color-l-min), .1);--toolbar-current: var(--color-focus)}.k-toolbar{display:flex;max-width:100%;height:var(--toolbar-size);align-items:center;overflow-x:auto;overflow-y:hidden;color:var(--toolbar-text);background:var(--toolbar-back);border-radius:var(--rounded)}.k-toolbar[data-theme=dark]{--toolbar-text: var(--color-white);--toolbar-back: var(--color-black);--toolbar-hover: hsla(0, 0%, var(--color-l-max), .2);--toolbar-border: var(--color-gray-800)}.k-toolbar>hr{height:var(--toolbar-size);width:1px;border-left:1px solid var(--toolbar-border)}.k-toolbar-button.k-button{--button-width: var(--toolbar-size);--button-height: var(--toolbar-size);--button-rounded: 0;outline-offset:-2px}.k-toolbar-button:hover{--button-color-back: var(--toolbar-hover)}.k-toolbar .k-button[aria-current=true]{--button-color-text: var(--toolbar-current)}.k-toolbar>.k-button:first-child{border-start-start-radius:var(--rounded);border-end-start-radius:var(--rounded)}.k-toolbar>.k-button:last-child{border-start-end-radius:var(--rounded);border-end-end-radius:var(--rounded)}:where(.k-textarea-input,.k-writer-input):not(:focus-within){--toolbar-text: var(--color-gray-400);--toolbar-border: var(--color-light)}:where(.k-textarea-input,.k-writer-input):focus-within .k-toolbar:not([data-inline=true]){position:sticky;top:var(--header-sticky-offset);inset-inline:0;z-index:1;box-shadow:#0000000d 0 2px 5px}.k-writer-input:not([data-toolbar-inline=true]):not([data-disabled=true]){grid-template-areas:"topbar" "content";grid-template-rows:var(--toolbar-size) 1fr;gap:0}.k-writer-input:not(:focus-within){--toolbar-current: currentColor}.k-writer-toolbar[data-inline=true]{position:absolute;z-index:calc(var(--z-dropdown) + 1);max-width:none;box-shadow:var(--shadow-toolbar)}.k-writer-toolbar:not([data-inline=true]){border-end-start-radius:0;border-end-end-radius:0;border-bottom:1px solid var(--toolbar-border)}.k-writer-toolbar:not([data-inline=true])>.k-button:first-child{border-end-start-radius:0}.k-writer-toolbar:not([data-inline=true])>.k-button:last-child{border-end-end-radius:0}:root{--bar-height: var(--height-xs)}.k-bar{display:flex;align-items:center;gap:var(--spacing-3);height:var(--bar-height);justify-content:space-between}.k-bar:where([data-align=center]){justify-content:center}.k-bar:where([data-align=end]):has(:first-child:last-child){justify-content:end}:root{--box-height: var( --field-input-height );--box-padding-inline: var(--spacing-2);--box-font-size: var(--text-sm);--box-color-back: none;--box-color-text: currentColor}.k-box{--icon-color: var(--box-color-icon);--text-font-size: var(--box-font-size);display:flex;width:100%;align-items:center;gap:var(--spacing-2);color:var(--box-color-text);background:var(--box-color-back);word-wrap:break-word}.k-box[data-theme]{--box-color-back: var(--theme-color-back);--box-color-text: var(--theme-color-text);--box-color-icon: var(--theme-color-700);min-height:var(--box-height);line-height:1.25;padding:.375rem var(--box-padding-inline);border-radius:var(--rounded)}.k-box[data-theme=text],.k-box[data-theme=white]{box-shadow:var(--shadow)}.k-box[data-theme=text]{padding:var(--spacing-6)}.k-box[data-theme=none]{padding:0}.k-box[data-align=center]{justify-content:center}:root{--bubble-size: 1.525rem;--bubble-back: var(--color-light);--bubble-rounded: var(--rounded-sm);--bubble-text: var(--color-black)}.k-bubble{width:min-content;height:var(--bubble-size);white-space:nowrap;line-height:1.5;background:var(--bubble-back);color:var(--bubble-text);border-radius:var(--bubble-rounded);overflow:hidden}.k-bubble .k-frame{width:var(--bubble-size);height:var(--bubble-size)}.k-bubble[data-has-text=true]{display:flex;gap:var(--spacing-2);align-items:center;padding-inline-end:.5rem;font-size:var(--text-xs)}.k-column{min-width:0}.k-column[data-sticky=true]{align-self:stretch}.k-column[data-sticky=true]>div{position:sticky;top:calc(var(--header-sticky-offset) + 2vh);z-index:2}.k-column[data-disabled=true]{cursor:not-allowed;opacity:.4}.k-column[data-disabled=true] *{pointer-events:none}.k-column[data-disabled=true] .k-text[data-theme=help] *{pointer-events:initial}.k-frame{--fit: contain;--ratio: 1/1;position:relative;display:flex;justify-content:center;align-items:center;aspect-ratio:var(--ratio);background:var(--back);overflow:hidden}.k-frame:where([data-theme]){--back: var(--theme-color-back);color:var(--theme-color-text)}.k-frame *:where(img,video,iframe,button){position:absolute;top:0;right:0;bottom:0;left:0;height:100%;width:100%;object-fit:var(--fit)}.k-frame>*{overflow:hidden;text-overflow:ellipsis;min-width:0;min-height:0}:root{--color-frame-back: none;--color-frame-pattern: var(--pattern-light);--color-frame-rounded: var(--rounded);--color-frame-size: 100%;--color-frame-darkness: 0%}.k-color-frame.k-frame{background:var(--color-frame-pattern);width:var(--color-frame-size);color:transparent;border-radius:var(--color-frame-rounded);overflow:hidden;background-clip:padding-box}.k-color-frame:after{border-radius:var(--color-frame-rounded);box-shadow:0 0 0 1px inset hsla(0,0%,var(--color-frame-darkness),.175);position:absolute;top:0;right:0;bottom:0;left:0;background:var(--color-frame-back);content:""}.k-panel[data-theme=dark]{--color-frame-pattern: var(--pattern-dark)}.k-dropzone{position:relative}.k-dropzone:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;display:none;pointer-events:none;z-index:1;border-radius:var(--rounded)}.k-dropzone[data-over=true]:after{display:block;background:hsla(var(--color-blue-hs),var(--color-blue-l-300),.6);outline:var(--outline)}.k-grid{--columns: 12;--grid-inline-gap: 0;--grid-block-gap: 0;display:grid;align-items:start;grid-column-gap:var(--grid-inline-gap);grid-row-gap:var(--grid-block-gap)}.k-grid>*{--width: calc(1 / var(--columns));--span: calc(var(--columns) * var(--width))}@container (min-width: 30rem){.k-grid{grid-template-columns:repeat(var(--columns),1fr)}.k-grid>*{grid-column:span var(--span)}}:root{--columns-inline-gap: clamp(.75rem, 6cqw, 6rem);--columns-block-gap: var(--spacing-8)}.k-grid[data-variant=columns]{--grid-inline-gap: var(--columns-inline-gap);--grid-block-gap: var(--columns-block-gap)}.k-grid:where([data-variant=columns],[data-variant=fields])>*{container:column / inline-size}.k-grid[data-variant=fields]{gap:var(--spacing-8)}.k-grid[data-variant=choices]{align-items:stretch;gap:2px}:root{--header-color-back: var(--color-light);--header-padding-block: var(--spacing-4);--header-sticky-offset: var(--scroll-top)}.k-header{position:relative;display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;column-gap:var(--spacing-3);border-bottom:1px solid var(--color-border);background:var(--header-color-back);padding-top:var(--header-padding-block);margin-bottom:var(--spacing-12);box-shadow:2px 0 0 0 var(--header-color-back),-2px 0 0 0 var(--header-color-back)}.k-header-title{font-size:var(--text-h1);font-weight:var(--font-h1);line-height:var(--leading-h1);margin-bottom:var(--header-padding-block);min-width:0}.k-header-title-button{display:inline-flex;text-align:start;gap:var(--spacing-2);align-items:baseline;max-width:100%;outline:0}.k-header-title-text{overflow-x:clip;text-overflow:ellipsis}.k-header-title-icon{--icon-color: var(--color-text-dimmed);border-radius:var(--rounded);transition:opacity .2s;display:grid;flex-shrink:0;place-items:center;height:var(--height-sm);width:var(--height-sm);opacity:0}.k-header-title-button:is(:hover,:focus) .k-header-title-icon{opacity:1}.k-header-title-button:is(:focus) .k-header-title-icon{outline:var(--outline)}.k-header-buttons{display:flex;gap:var(--spacing-2);margin-bottom:var(--header-padding-block)}.k-header[data-has-buttons=true]{position:sticky;top:var(--scroll-top);z-index:var(--z-toolbar)}:root:has(.k-header[data-has-buttons=true]){--header-sticky-offset: calc(var(--scroll-top) + 4rem)}:root{--icon-size: 18px;--icon-color: currentColor}.k-icon{width:var(--icon-size);height:var(--icon-size);flex-shrink:0;color:var(--icon-color)}.k-icon[data-type=loader]{animation:Spin 1.5s linear infinite}@media only screen and (-webkit-min-device-pixel-ratio: 2),not all,not all,not all,only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx){.k-button-icon [data-type=emoji]{font-size:1.25em}}.k-icon-frame [data-type=emoji]{overflow:visible}.k-image[data-back=pattern]{--back: var(--color-black) var(--pattern)}.k-image[data-back=black]{--back: var(--color-black)}.k-image[data-back=white]{--back: var(--color-white);color:var(--color-gray-900)}:root{--overlay-color-back: rgba(0, 0, 0, .6);--overlay-color-back-dimmed: rgba(0, 0, 0, .2)}.k-panel[data-theme=dark]{--overlay-color-back-dimmed: rgba(0, 0, 0, .8)}.k-overlay[open]{position:fixed;overscroll-behavior:contain;top:0;right:0;bottom:0;left:0;width:100%;height:100vh;height:100dvh;background:none;z-index:var(--z-dialog);transform:translateZ(0);overflow:hidden}.k-overlay[open]::backdrop{background:none}.k-overlay[open]>.k-portal{position:fixed;top:0;right:0;bottom:0;left:0;background:var(--overlay-color-back);overflow:auto}.k-overlay[open][data-type=dialog]>.k-portal{display:inline-flex}.k-overlay[open][data-type=dialog]>.k-portal>*{margin:auto}.k-overlay[open][data-type=drawer]>.k-portal{--overlay-color-back: var(--overlay-color-back-dimmed);display:flex;align-items:stretch;justify-content:flex-end}html[data-overlay=true]{overflow:hidden}html[data-overlay=true] body{overflow:scroll}:root{--stat-value-text-size: var(--text-2xl);--stat-info-text-color: var(--color-text-dimmed)}.k-stat{display:flex;flex-direction:column;padding:var(--spacing-3) var(--spacing-6);background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);line-height:var(--leading-normal)}.k-stat.k-link:hover{cursor:pointer;background:var(--color-gray-100)}.k-stat :where(dt,dd){display:block}.k-stat-value{order:1;font-size:var(--stat-value-text-size);margin-bottom:var(--spacing-1)}.k-stat-label{--icon-size: var(--text-sm);order:2;display:flex;justify-content:start;align-items:center;gap:var(--spacing-1);font-size:var(--text-xs)}.k-stat-info{order:3;font-size:var(--text-xs);color:var(--stat-info-text-color)}.k-stat:is([data-theme]) .k-stat-info{--stat-info-text-color: var(--theme-color-700)}.k-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(14rem,1fr));grid-auto-rows:1fr;grid-gap:var(--spacing-2px)}.k-stats[data-size=small]{--stat-value-text-size: var(--text-md)}.k-stats[data-size=medium]{--stat-value-text-size: var(--text-xl)}.k-stats[data-size=large]{--stat-value-text-size: var(--text-2xl)}.k-stats[data-size=huge]{--stat-value-text-size: var(--text-3xl)}:root{--table-cell-padding: var(--spacing-3);--table-color-back: var(--color-white);--table-color-border: var(--color-light);--table-color-hover: var(--color-gray-100);--table-color-th-back: var(--color-gray-100);--table-color-th-text: var(--color-text-dimmed);--table-row-height: var(--input-height)}.k-panel[data-theme=dark]{--table-color-border: var(--color-border)}.k-table{position:relative;background:var(--table-color-back);box-shadow:var(--shadow);border-radius:var(--rounded)}.k-table table{table-layout:fixed}.k-table th,.k-table td{padding-inline:var(--table-cell-padding);height:var(--table-row-height);overflow:hidden;text-overflow:ellipsis;width:100%;border-inline-end:1px solid var(--table-color-border);line-height:1.25}.k-table tr>*:last-child{border-inline-end:0}.k-table th,.k-table tr:not(:last-child) td{border-block-end:1px solid var(--table-color-border)}.k-table :where(td,th)[data-align]{text-align:var(--align)}.k-table th{padding-inline:var(--table-cell-padding);font-family:var(--font-mono);font-size:var(--text-xs);color:var(--table-color-th-text);background:var(--table-color-th-back)}.k-table th[data-has-button=true]{padding:0}.k-table th button{padding-inline:var(--table-cell-padding);height:100%;width:100%;border-radius:var(--rounded);text-align:start}.k-table th button:focus-visible{outline-offset:-2px}.k-table thead th:first-child{border-start-start-radius:var(--rounded)}.k-table thead th:last-child{border-start-end-radius:var(--rounded)}.k-table thead th{position:sticky;top:var(--header-sticky-offset);inset-inline:0;z-index:1}.k-table tbody tr:hover td{background:var(--table-color-hover)}.k-table tbody th{width:auto;white-space:nowrap;overflow:visible;border-radius:0}.k-table tbody tr:first-child th{border-start-start-radius:var(--rounded)}.k-table tbody tr:last-child th{border-end-start-radius:var(--rounded);border-block-end:0}.k-table-row-ghost{background:var(--color-white);outline:var(--outline);border-radius:var(--rounded);margin-bottom:2px;cursor:grabbing}.k-table-row-fallback{opacity:0!important}.k-table .k-table-index-column{width:var(--table-row-height);text-align:center}.k-table .k-table-index{font-size:var(--text-xs);color:var(--color-text-dimmed);line-height:1.1em}.k-table .k-table-index-column .k-sort-handle{--button-width: 100%;display:none}.k-table tr.k-table-sortable-row:hover .k-table-index-column .k-table-index{display:none}.k-table tr.k-table-sortable-row:hover .k-table-index-column .k-sort-handle{display:flex}.k-table .k-table-options-column{padding:0;width:var(--table-row-height);text-align:center}.k-table .k-table-options-column .k-options-dropdown-toggle{--button-width: 100%;--button-height: 100%;outline-offset:-2px}.k-table-empty{color:var(--color-text-dimmed);font-size:var(--text-sm)}.k-table[aria-disabled=true]{--table-color-back: transparent;--table-color-border: var(--color-border);--table-color-hover: transparent;--table-color-th-back: transparent;border:1px solid var(--table-color-border);box-shadow:none}.k-table[aria-disabled=true] thead th{position:static}@container (max-width: 40rem){.k-table{overflow-x:auto}.k-table thead th{position:static}.k-table .k-options-dropdown-toggle{aspect-ratio:auto!important}.k-table :where(th,td):not(.k-table-index-column,.k-table-options-column,[data-column-id=image],[data-column-id=flag]){width:auto!important}.k-table :where(th,td):not([data-mobile=true]){display:none}}.k-table-pagination{border-top:1px solid var(--table-color-border);height:var(--table-row-height);background:var(--table-color-th-back);display:flex;justify-content:center;border-end-start-radius:var(--rounded);border-end-end-radius:var(--rounded)}.k-table-pagination>.k-button{--button-color-back: transparent;border-left:0!important}.k-table .k-table-cell{padding:0}.k-tabs{--button-height: var(--height-md);--button-padding: var(--spacing-2);display:flex;gap:var(--spacing-1);margin-bottom:var(--spacing-12);margin-inline:calc(var(--button-padding) * -1)}.k-tabs-tab{position:relative}.k-tab-button.k-button{margin-block:2px;overflow-x:visible}.k-tab-button[aria-current=true]:after{position:absolute;content:"";height:2px;inset-inline:var(--button-padding);bottom:-2px;background:currentColor}.k-tab-button .k-button-badge{top:3px;inset-inline-end:calc(var(--button-padding) / 4)}.k-fatal[open]{background:var(--overlay-color-back);padding:var(--spacing-6)}.k-fatal-box{position:relative;width:100%;box-shadow:var(--dialog-shadow);border-radius:var(--dialog-rounded);line-height:1;height:calc(100vh - 3rem);height:calc(100dvh - 3rem);display:flex;flex-direction:column;overflow:hidden}.k-fatal-iframe{border:0;width:100%;flex-grow:1;background:var(--color-white);padding:var(--spacing-3)}.k-icons{position:absolute;width:0;height:0}.k-notification{padding:.75rem 1.5rem;background:var(--color-gray-900);width:100%;line-height:1.25rem;color:var(--color-white);display:flex;flex-shrink:0;align-items:center}.k-notification[data-theme]{background:var(--theme-color-back);color:var(--color-black)}.k-notification p{flex-grow:1;word-wrap:break-word;overflow:hidden}.k-notification .k-button{display:flex;margin-inline-start:1rem}.k-offline-warning{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--z-offline);background:var(--overlay-color-back);display:flex;align-items:center;justify-content:center;line-height:1}.k-offline-warning p{display:flex;align-items:center;gap:.5rem;background:var(--color-white);box-shadow:var(--shadow);padding:.75rem;border-radius:var(--rounded)}.k-offline-warning p .k-icon{color:var(--color-red-400)}:root{--progress-height: var(--spacing-2);--progress-color-back: var(--color-gray-300);--progress-color-value: var(--color-focus)}progress{display:block;width:100%;height:var(--progress-height);border-radius:var(--progress-height);overflow:hidden;background:var(--progress-color-back);border:0}progress::-webkit-progress-bar{background:var(--progress-color-back)}progress::-webkit-progress-value{background:var(--progress-color-value);border-radius:var(--progress-height)}progress::-moz-progress-bar{background:var(--progress-color-value);border-radius:var(--progress-height)}progress:not([value])::-webkit-progress-bar{background:var(--progress-color-value)}progress:not([value])::-moz-progress-bar{background:var(--progress-color-value)}.k-sort-handle{cursor:grab;z-index:1}.k-sort-handle:active{cursor:grabbing}.k-breadcrumb{--breadcrumb-divider: "/";overflow-x:clip;padding:2px}.k-breadcrumb ol{display:none;gap:.125rem;align-items:center}.k-breadcrumb ol li{display:flex;align-items:center;min-width:0;transition:flex-shrink .1s}.k-breadcrumb ol li:has(.k-icon){min-width:2.25rem}.k-breadcrumb ol li:not(:last-child):after{content:var(--breadcrumb-divider);opacity:.175;flex-shrink:0}.k-breadcrumb .k-icon[data-type=loader]{opacity:.5}.k-breadcrumb ol li:is(:hover,:focus-within){flex-shrink:0}.k-button.k-breadcrumb-link{flex-shrink:1;min-width:0;justify-content:flex-start}.k-breadcrumb-dropdown{display:grid}.k-breadcrumb-dropdown .k-dropdown-content{width:15rem}@container (min-width: 40em){.k-breadcrumb ol{display:flex}.k-breadcrumb-dropdown{display:none}}.k-browser{container-type:inline-size;font-size:var(--text-sm)}.k-browser-items{--browser-item-gap: 1px;--browser-item-size: 1fr;--browser-item-height: var(--height-sm);--browser-item-padding: .25rem;--browser-item-rounded: var(--rounded);display:grid;column-gap:var(--browser-item-gap);row-gap:var(--browser-item-gap);grid-template-columns:repeat(auto-fill,minmax(var(--browser-item-size),1fr))}.k-browser-item{display:flex;overflow:hidden;gap:.5rem;align-items:center;flex-shrink:0;height:var(--browser-item-height);padding-inline:calc(var(--browser-item-padding) + 1px);border-radius:var(--browser-item-rounded);white-space:nowrap;cursor:pointer}.k-browser-item-image{height:calc(var(--browser-item-height) - var(--browser-item-padding) * 2);aspect-ratio:1/1;border-radius:var(--rounded-sm);box-shadow:var(--shadow);flex-shrink:0}.k-browser-item-image.k-icon-frame{box-shadow:none;background:var(--color-white)}.k-browser-item-image svg{transform:scale(.8)}.k-browser-item input{position:absolute;box-shadow:var(--shadow);opacity:0;width:0}.k-browser-item[aria-selected]{background:var(--color-blue-300)}:root{--button-align: center;--button-height: var(--height-md);--button-width: auto;--button-color-back: none;--button-color-text: currentColor;--button-color-icon: currentColor;--button-padding: var(--spacing-2);--button-rounded: var(--spacing-1);--button-text-display: block;--button-icon-display: block}.k-button{position:relative;display:inline-flex;align-items:center;justify-content:var(--button-align);gap:.5rem;padding-inline:var(--button-padding);white-space:nowrap;line-height:1;border-radius:var(--button-rounded);background:var(--button-color-back);height:var(--button-height);width:var(--button-width);color:var(--button-color-text);font-variant-numeric:tabular-nums;text-align:var(--button-align);flex-shrink:0}.k-button-icon{--icon-color: var(--button-color-icon);flex-shrink:0;display:var(--button-icon-display)}.k-button-text{text-overflow:ellipsis;overflow-x:clip;display:var(--button-text-display);min-width:0}.k-button:where([data-theme]){--button-color-icon: var(--theme-color-icon);--button-color-text: var(--theme-color-text)}.k-button:where([data-theme$=-icon]){--button-color-text: currentColor}.k-button:where([data-variant=dimmed]){--button-color-icon: var(--color-text);--button-color-text: var(--color-text-dimmed)}.k-button:where([data-variant=dimmed]):not([aria-disabled=true]):is(:hover,[aria-current=true]) .k-button-text{filter:brightness(75%)}.k-button:where([data-variant=dimmed][data-theme]){--button-color-icon: var(--theme-color-icon);--button-color-text: var(--theme-color-text-dimmed)}.k-button:where([data-variant=dimmed][data-theme$=-icon]){--button-color-text: var(--color-text-dimmed)}.k-button:where([data-variant=filled]){--button-color-back: var(--color-gray-300)}.k-button:where([data-variant=filled]):not([aria-disabled=true]):hover{filter:brightness(97%)}.k-panel[data-theme=dark] .k-button:where([data-variant=filled]):not([aria-disabled=true]):hover{filter:brightness(87%)}.k-button:where([data-variant=filled][data-theme]){--button-color-icon: var(--theme-color-700);--button-color-back: var(--theme-color-back)}.k-button:where([data-theme$=-icon][data-variant=filled]){--button-color-icon: hsl( var(--theme-color-hs), 57% );--button-color-back: var(--color-gray-300)}.k-button:not([data-has-text=true]){--button-padding: 0;aspect-ratio:1/1}@container (max-width: 30rem){.k-button[data-responsive=true][data-has-icon=true]{--button-padding: 0;aspect-ratio:1/1;--button-text-display: none}.k-button[data-responsive=text][data-has-text=true]{--button-icon-display: none}.k-button[data-responsive=true][data-has-icon=true] .k-button-arrow{display:none}}.k-button:not(button,a,summary,label,.k-link){pointer-events:none}.k-button:where([data-size=xs]){--button-height: var(--height-xs);--button-padding: .325rem}.k-button:where([data-size=sm]){--button-height: var(--height-sm);--button-padding: .5rem}.k-button:where([data-size=lg]){--button-height: var(--height-lg)}.k-button-arrow{width:max-content;margin-inline-start:-.25rem;margin-inline-end:-.125rem}.k-button-badge{position:absolute;top:0;inset-inline-end:0;transform:translate(40%,-20%);min-width:1em;min-height:1em;font-variant-numeric:tabular-nums;line-height:1.5;padding:0 var(--spacing-1);border-radius:50%;text-align:center;font-size:.6rem;box-shadow:var(--shadow-md);background:var(--theme-color-back);border:1px solid var(--theme-color-500);color:var(--theme-color-text);z-index:1}.k-button:where([aria-disabled=true]){cursor:not-allowed}.k-button:where([aria-disabled=true])>*{opacity:var(--opacity-disabled)}.k-button-group{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}.k-button-group:where([data-layout=collapsed]){gap:0;flex-wrap:nowrap}.k-button-group[data-layout=collapsed]>.k-button[data-variant=filled]:not(:last-child){border-start-end-radius:0;border-end-end-radius:0}.k-button-group[data-layout=collapsed]>.k-button[data-variant=filled]:not(:first-child){border-start-start-radius:0;border-end-start-radius:0;border-left:1px solid var(--theme-color-500, var(--color-gray-400))}.k-button-group[data-layout=collapsed]>.k-button[data-variant=filled]:focus-visible{z-index:1;border-radius:var(--button-rounded)}.k-file-browser{container-type:inline-size;overflow:hidden}.k-file-browser-layout{display:grid;grid-template-columns:minmax(10rem,15rem) 1fr;grid-template-rows:1fr auto;grid-template-areas:"tree items" "tree pagination"}.k-file-browser-tree{grid-area:tree;padding:var(--spacing-2);border-right:1px solid var(--color-gray-300)}.k-file-browser-items{grid-area:items;padding:var(--spacing-2);background:var(--color-gray-100)}.k-file-browser-back-button{display:none}.k-file-browser-pagination{background:var(--color-gray-100);padding:var(--spacing-2);display:flex;justify-content:end}@container (max-width: 30rem){.k-file-browser-layout{grid-template-columns:minmax(0,1fr);min-height:10rem}.k-file-browser-back-button{width:100%;height:var(--height-sm);display:flex;align-items:center;justify-content:flex-start;padding-inline:.25rem;margin-bottom:.5rem;background:var(--color-gray-200);border-radius:var(--rounded)}.k-file-browser-tree{border-right:0}.k-file-browser-pagination{justify-content:start}.k-file-browser[data-view=files] .k-file-browser-layout{grid-template-rows:1fr auto;grid-template-areas:"items" "pagination"}.k-file-browser[data-view=files] .k-file-browser-tree,.k-file-browser[data-view=tree] .k-file-browser-items,.k-file-browser[data-view=tree] .k-file-browser-pagination{display:none}}:root{--tree-color-back: var(--color-gray-200);--tree-color-hover-back: var(--color-gray-300);--tree-color-selected-back: var(--color-blue-300);--tree-color-selected-text: var(--color-black);--tree-color-text: var(--color-gray-dimmed);--tree-level: 0;--tree-indentation: .6rem}.k-tree-branch{display:flex;align-items:center;padding-inline-start:calc(var(--tree-level) * var(--tree-indentation));margin-bottom:1px}.k-tree-branch[data-has-subtree=true]{inset-block-start:calc(var(--tree-level) * 1.5rem);z-index:calc(100 - var(--tree-level));background:var(--tree-color-back)}.k-tree-branch:hover,li[aria-current=true]>.k-tree-branch{--tree-color-text: var(--tree-color-selected-text);background:var(--tree-color-hover-back);border-radius:var(--rounded)}li[aria-current=true]>.k-tree-branch{background:var(--tree-color-selected-back)}.k-tree-toggle{--icon-size: 12px;width:1rem;aspect-ratio:1/1;display:grid;place-items:center;padding:0;border-radius:var(--rounded-sm);margin-inline-start:.25rem;flex-shrink:0}.k-tree-toggle:hover{background:#00000013}.k-tree-toggle[disabled]{visibility:hidden}.k-tree-folder{display:flex;height:var(--height-sm);border-radius:var(--rounded-sm);padding-inline:.25rem;width:100%;align-items:center;gap:.325rem;min-width:3rem;line-height:1.25;font-size:var(--text-sm)}@container (max-width: 15rem){.k-tree{--tree-indentation: .375rem}.k-tree-folder{padding-inline:.125rem}.k-tree-folder .k-icon{display:none}}.k-tree-folder>.k-frame{flex-shrink:0}.k-tree-folder-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:currentColor}.k-tree-folder[disabled]{opacity:var(--opacity-disabled)}.k-pagination{flex-shrink:0}.k-pagination-details{--button-padding: var(--spacing-3);font-size:var(--text-xs)}.k-pagination-selector{--button-height: var(--height);--dropdown-padding: 0;overflow:visible}.k-pagination-selector form{display:flex;align-items:center;justify-content:space-between}.k-pagination-selector label{display:flex;align-items:center;gap:var(--spacing-2);padding-inline-start:var(--spacing-3)}.k-pagination-selector select{--height: calc(var(--button-height) - .5rem);width:auto;min-width:var(--height);height:var(--height);text-align:center;background:var(--color-gray-800);color:var(--color-white);border-radius:var(--rounded-sm)}.k-prev-next{direction:ltr;flex-shrink:0}.k-search-bar-input{--button-height: var(--input-height);display:flex;align-items:center}.k-search-bar-types{flex-shrink:0;border-inline-end:1px solid var(--color-border)}.k-search-bar-input input{flex-grow:1;padding-inline:.75rem;height:var(--input-height);line-height:var(--input-height);border-radius:var(--rounded);font-size:var(--input-font-size)}.k-search-bar-input input:focus{outline:0}.k-search-bar-input .k-search-bar-close{flex-shrink:0}.k-search-bar-results{border-top:1px solid var(--color-border);padding:1rem}.k-search-bar-results .k-item[data-selected=true]{outline:var(--outline)}.k-search-bar-footer{text-align:center}.k-search-bar-footer p{color:var(--color-text-dimmed)}.k-search-bar-footer .k-button{margin-top:var(--spacing-4)}.k-section+.k-section{margin-top:var(--columns-block-gap)}.k-section-header{display:flex;justify-content:space-between;align-items:center;gap:var(--spacing-6);margin-bottom:var(--spacing-2)}.k-section-buttons{flex-shrink:0}.k-fields-section input[type=submit]{display:none}[data-locked=true] .k-fields-section{opacity:.2;pointer-events:none}.k-models-section[data-processing=true]{pointer-events:none}.k-models-section-search.k-input{--input-color-back: var(--color-gray-300);--input-color-border: transparent;margin-bottom:var(--spacing-3)}:root{--code-color-back: var(--color-black);--code-color-icon: var(--color-gray-500);--code-color-text: var(--color-gray-200, var(--color-white));--code-font-family: var(--font-mono);--code-font-size: 1em;--code-inline-color-back: var(--color-blue-300);--code-inline-color-border: var(--color-blue-400);--code-inline-color-text: var(--color-blue-900);--code-inline-font-size: .9em;--code-padding: var(--spacing-3)}.k-panel[data-theme=dark]{--code-color-back: var(--color-gray-100);--code-color-text: var(--color-text)}code{font-family:var(--code-font-family);font-size:var(--code-font-size);font-weight:var(--font-normal)}.k-code,.k-text pre{position:relative;display:block;max-width:100%;padding:var(--code-padding);border-radius:var(--rounded, .5rem);background:var(--code-color-back);color:var(--code-color-text);white-space:nowrap;overflow-y:hidden;overflow-x:auto;line-height:1.5;-moz-tab-size:2;tab-size:2}.k-code:not(code),.k-text pre{white-space:pre-wrap}.k-code:before{position:absolute;content:attr(data-language);inset-block-start:0;inset-inline-end:0;padding:.5rem .5rem .25rem .25rem;font-size:calc(.75 * var(--text-xs));background:var(--code-color-back);border-radius:var(--rounded, .5rem)}.k-text>code,.k-text *:not(pre)>code{display:inline-flex;padding-inline:var(--spacing-1);font-size:var(--code-inline-font-size);color:var(--code-inline-color-text);background:var(--code-inline-color-back);border-radius:var(--rounded);outline:1px solid var(--code-inline-color-border);outline-offset:-1px}:root{--text-h1: 2em;--text-h2: 1.75em;--text-h3: 1.5em;--text-h4: 1.25em;--text-h5: 1.125em;--text-h6: 1em;--font-h1: var(--font-semi);--font-h2: var(--font-semi);--font-h3: var(--font-semi);--font-h4: var(--font-semi);--font-h5: var(--font-semi);--font-h6: var(--font-semi);--leading-h1: 1.125;--leading-h2: 1.125;--leading-h3: 1.25;--leading-h4: 1.375;--leading-h5: 1.5;--leading-h6: 1.5}.k-headline{line-height:1.5em;font-weight:var(--font-bold)}.h1,.k-text h1,.k-headline[data-size=huge]{color:var(--color-h1, var(--color-h));font-family:var(--font-family-h1);font-size:var(--text-h1);font-weight:var(--font-h1);line-height:var(--leading-h1)}.h2,.k-text h2,.k-headline[data-size=large]{color:var(--color-h2, var(--color-h));font-family:var(--font-family-h2);font-size:var(--text-h2);font-weight:var(--font-h2);line-height:var(--leading-h2)}.h3,.k-text h3{color:var(--color-h3, var(--color-h));font-family:var(--font-family-h3);font-size:var(--text-h3);font-weight:var(--font-h3);line-height:var(--leading-h3)}.h4,.k-text h4,.k-headline[data-size=small]{color:var(--color-h4, var(--color-h));font-family:var(--font-family-h4);font-size:var(--text-h4);font-weight:var(--font-h4);line-height:var(--leading-h4)}.h5,.k-text h5{color:var(--color-h5, var(--color-h));font-family:var(--font-family-h5);font-size:var(--text-h5);font-weight:var(--font-h5);line-height:var(--leading-h5)}.h6,.k-text h6{color:var(--color-h6, var(--color-h));font-family:var(--font-family-h6);font-size:var(--text-h6);font-weight:var(--font-h6);line-height:var(--leading-h6)}.k-text>*+h6{margin-block-start:calc(var(--text-line-height) * 1.5em)}.k-label{position:relative;display:flex;align-items:center;height:var(--height-xs);font-weight:var(--font-semi);min-width:0;flex:1}[aria-disabled=true] .k-label{opacity:var(--opacity-disabled);cursor:not-allowed}.k-label>a{display:inline-flex;height:var(--height-xs);align-items:center;padding-inline:var(--spacing-2);margin-inline-start:calc(-1 * var(--spacing-2));border-radius:var(--rounded);min-width:0}.k-label-text{text-overflow:ellipsis;white-space:nowrap;overflow-x:clip;min-width:0}.k-label abbr{font-size:var(--text-xs);color:var(--color-gray-500);margin-inline-start:var(--spacing-1)}.k-label abbr.k-label-invalid{display:none;color:var(--color-red-700)}:where(.k-field:has(:invalid),.k-section:has([data-invalid=true]))>header>.k-label abbr.k-label-invalid{display:inline-block}.k-field:has(:invalid)>.k-field-header>.k-label abbr:has(+abbr.k-label-invalid){display:none}:root{--text-font-size: 1em;--text-line-height: 1.5;--link-color: var(--color-blue-800);--link-underline-offset: 2px}.k-text{font-size:var(--text-font-size);line-height:var(--text-line-height)}.k-text[data-size=tiny]{--text-font-size: var(--text-xs)}.k-text[data-size=small]{--text-font-size: var(--text-sm)}.k-text[data-size=medium]{--text-font-size: var(--text-md)}.k-text[data-size=large]{--text-font-size: var(--text-xl)}.k-text[data-align]{text-align:var(--align)}.k-text>:where(audio,blockquote,details,div,figure,h1,h2,h3,h4,h5,h6,hr,iframe,img,object,ol,p,picture,pre,table,ul)+*{margin-block-start:calc(var(--text-line-height) * 1em)}.k-text :where(.k-link,a){color:var(--link-color);text-decoration:underline;text-underline-offset:var(--link-underline-offset);border-radius:var(--rounded-xs);outline-offset:2px}.k-text ol,.k-text ul{padding-inline-start:1.75em}.k-text ol{list-style:numeric}.k-text ol>li{list-style:decimal}.k-text ul>li{list-style:disc}.k-text ul ul>li{list-style:circle}.k-text ul ul ul>li{list-style:square}.k-text blockquote{font-size:var(--text-lg);line-height:1.25;padding-inline-start:var(--spacing-4);border-inline-start:2px solid var(--color-black)}.k-text img{border-radius:var(--rounded)}.k-text iframe{width:100%;aspect-ratio:16/9;border-radius:var(--rounded)}.k-text hr{background:var(--color-border);height:1px}.k-help{color:var(--color-text-dimmed)}.k-upload-item-preview{--icon-size: 24px;grid-area:preview;display:flex;aspect-ratio:1/1;width:100%;height:100%;overflow:hidden;border-start-start-radius:var(--rounded);border-end-start-radius:var(--rounded)}.k-upload-item-preview:focus{border-radius:var(--rounded);outline:2px solid var(--color-focus);z-index:1}.k-upload-item{accent-color:var(--color-focus);display:grid;grid-template-areas:"preview input input" "preview body toggle";grid-template-columns:6rem 1fr auto;grid-template-rows:var(--input-height) 1fr;border-radius:var(--rounded);background:var(--color-white);box-shadow:var(--shadow);min-height:6rem}.k-upload-item-body{grid-area:body;display:flex;flex-direction:column;justify-content:space-between;padding:var(--spacing-2) var(--spacing-3);min-width:0}.k-upload-item-input.k-input{--input-color-border: transparent;--input-padding: var(--spacing-2) var(--spacing-3);--input-rounded: 0;grid-area:input;font-size:var(--text-sm);border-bottom:1px solid var(--color-light);border-start-end-radius:var(--rounded)}.k-upload-item-input.k-input:focus-within{outline:2px solid var(--color-focus);z-index:1;border-radius:var(--rounded)}.k-upload-item-input.k-input[data-disabled=true]{--input-color-back: var(--color-white)}.k-upload-item-input .k-input-after{color:var(--color-gray-600)}.k-upload-item-meta{font-size:var(--text-xs);color:var(--color-gray-600)}.k-upload-item-error{font-size:var(--text-xs);margin-top:.25rem;color:var(--color-red-700)}.k-upload-item-progress{--progress-height: .25rem;--progress-color-back: var(--color-light);margin-bottom:.3125rem}.k-upload-item-toggle{grid-area:toggle;align-self:end}.k-upload-item-toggle>*{padding:var(--spacing-3)}.k-upload-item[data-completed=true] .k-upload-item-progress{--progress-color-value: var(--color-green-400)}.k-upload-items{display:grid;gap:.25rem}.k-activation{position:relative;display:flex;color:var(--dropdown-color-text);background:var(--dropdown-color-bg);border-radius:var(--dropdown-rounded);box-shadow:var(--dropdown-shadow);justify-content:space-between}.k-activation p{padding-inline-start:var(--spacing-3);padding-inline-end:var(--spacing-2);padding-block:.425rem;line-height:1.25}.k-activation p strong{font-weight:var(--font-normal);margin-inline-end:var(--spacing-1)}.k-activation p :where(button,a){color:var(--color-pink-400);text-decoration:underline;text-decoration-color:currentColor;text-underline-offset:2px;border-radius:var(--rounded-sm)}.k-panel[data-theme=dark] .k-activation p :where(button,a){color:var(--color-pink-600)}.k-activation-toggle{--button-color-text: var(--color-gray-400);--button-rounded: 0;border-left:1px solid var(--dropdown-color-hr)}.k-activation-toggle:is(:hover,:focus){--button-color-text: var(--color-white)}.k-activation-toggle:focus{--button-rounded: var(--rounded)}.k-languages-dropdown-item:after{content:"✓";padding-inline-start:var(--spacing-1)}.k-languages-dropdown-item:not([aria-current]):after{visibility:hidden}.k-languages-dropdown-item .k-button-text{display:flex;flex-grow:1;justify-content:space-between;align-items:center;gap:var(--spacing-6);min-width:8rem}.k-languages-dropdown-item-info{display:flex;gap:var(--spacing-2);align-items:center}.k-languages-dropdown-item-icon{--icon-color: var(--color-orange-500);--icon-size: 1rem}.k-languages-dropdown-item-info[data-lock] .k-languages-dropdown-item-icon{--icon-color: var(--color-red-500)}.k-languages-dropdown-item-code{font-size:var(--text-xs);color:var(--color-gray-500)}:root{--main-padding-inline: clamp(var(--spacing-6), 5cqw, var(--spacing-24))}.k-panel-main{min-height:100vh;min-height:100dvh;padding:var(--spacing-3) var(--main-padding-inline) var(--spacing-24);container:main / inline-size;margin-inline-start:var(--main-start)}.k-panel-notification{--button-height: var(--height-md);--button-color-icon: var(--theme-color-900);--button-color-text: var(--theme-color-900);border:1px solid var(--theme-color-500);position:fixed;inset-block-end:var(--menu-padding);inset-inline-end:var(--menu-padding);box-shadow:var(--dropdown-shadow);z-index:var(--z-notification)}:root{--menu-button-height: var(--height);--menu-button-width: 100%;--menu-color-back: var(--color-gray-250);--menu-color-border: var(--color-gray-300);--menu-display: none;--menu-display-backdrop: block;--menu-padding: var(--spacing-3);--menu-shadow: var(--shadow-xl);--menu-toggle-height: var(--menu-button-height);--menu-toggle-width: 1rem;--menu-width-closed: calc( var(--menu-button-height) + 2 * var(--menu-padding) );--menu-width-open: 12rem;--menu-width: var(--menu-width-open)}.k-panel-menu{position:fixed;inset-inline-start:0;inset-block:0;z-index:var(--z-navigation);display:var(--menu-display);width:var(--menu-width);background-color:var(--menu-color-back);border-right:1px solid var(--menu-color-border);box-shadow:var(--menu-shadow)}.k-panel-menu-body{display:flex;flex-direction:column;gap:var(--spacing-4);padding:var(--menu-padding);overscroll-behavior:contain;overflow-x:hidden;overflow-y:auto;height:100%}.k-panel-menu-search{margin-bottom:var(--spacing-8)}.k-panel-menu-buttons{display:flex;flex-direction:column;width:100%}.k-panel-menu-buttons[data-second-last=true]{flex-grow:1}.k-panel-menu-buttons:last-child{justify-content:flex-end}.k-panel-menu-button{--button-align: flex-start;--button-height: var(--menu-button-height);--button-width: var(--menu-button-width);--button-padding: 7px;flex-shrink:0}.k-panel-menu-button[aria-current=true]{--button-color-back: var(--color-white);box-shadow:var(--shadow)}.k-panel[data-theme=dark] .k-panel-menu-button[aria-current=true]{--button-color-back: var(--color-gray-400)}.k-panel-menu-button:focus{z-index:1}.k-panel[data-menu=true]{--menu-button-width: 100%;--menu-display: block;--menu-width: var(--menu-width-open)}.k-panel[data-menu=true]:after{content:"";position:fixed;top:0;right:0;bottom:0;left:0;background:var(--overlay-color-back);display:var(--menu-display-backdrop);pointer-events:none}.k-panel-menu-toggle{--button-align: flex-start;--button-height: 100%;--button-width: var(--menu-toggle-width);position:absolute;inset-block:0;inset-inline-start:100%;align-items:flex-start;border-radius:0;overflow:visible;opacity:0;transition:opacity .2s}.k-panel-menu-toggle:focus{outline:0}.k-panel-menu-toggle .k-button-icon{display:grid;place-items:center;height:var(--menu-toggle-height);width:var(--menu-toggle-width);margin-top:var(--menu-padding);border-block:1px solid var(--menu-color-border);border-inline-end:1px solid var(--menu-color-border);background:var(--menu-color-back);border-start-end-radius:var(--button-rounded);border-end-end-radius:var(--button-rounded)}@media (max-width: 60rem){.k-panel-menu .k-activation-button{margin-bottom:var(--spacing-3)}.k-panel-menu .k-activation-toggle{display:none}}@media (min-width: 60rem){.k-panel{--menu-display: block;--menu-display-backdrop: none;--menu-shadow: none;--main-start: var(--menu-width)}.k-panel[data-menu=false]{--menu-button-width: var(--menu-button-height);--menu-width: var(--menu-width-closed)}.k-panel-menu-proxy{display:none}.k-panel-menu-toggle:focus-visible,.k-panel-menu[data-hover=true] .k-panel-menu-toggle{opacity:1}.k-panel-menu-toggle:focus-visible .k-button-icon{outline:var(--outline);border-radius:var(--button-rounded)}.k-panel-menu-search[aria-disabled=true]{opacity:0}.k-panel-menu .k-activation{position:absolute;bottom:var(--menu-padding);inset-inline-start:100%;height:var(--height-md);width:max-content;margin-left:var(--menu-padding)}.k-panel-menu .k-activation:before{position:absolute;content:"";top:50%;left:-4px;margin-top:-4px;border-top:4px solid transparent;border-right:4px solid var(--color-black);border-bottom:4px solid transparent}.k-panel-menu .k-activation p :where(button,a){padding-inline:var(--spacing-1)}.k-panel-menu .k-activation-toggle{border-left:1px solid var(--dropdown-color-hr)}}.k-panel.k-panel-outside{display:grid;grid-template-rows:1fr;place-items:center;min-height:100vh;min-height:100dvh;padding:var(--spacing-6)}:root{--scroll-top: 0rem}html{overflow-x:hidden;overflow-y:scroll;background:var(--color-light);color:var(--color-text)}body{font-size:var(--text-sm);color:var(--color-text)}.k-panel[data-loading=true]{animation:LoadingCursor .5s}.k-panel[data-loading=true]:after,.k-panel[data-dragging=true]{-webkit-user-select:none;user-select:none}.k-topbar{position:relative;margin-inline:calc(var(--button-padding) * -1);margin-bottom:var(--spacing-8);display:flex;align-items:center;gap:var(--spacing-1)}.k-topbar-breadcrumb{margin-inline-start:-2px;flex-shrink:1;min-width:0}.k-topbar-spacer{flex-grow:1}.k-topbar-signals{display:flex;align-items:center}.k-preview-view{position:fixed;top:0;right:0;bottom:0;left:0;height:100%;display:grid;grid-template-rows:auto 1fr}.k-preview-view-header{container-type:inline-size;display:flex;gap:var(--spacing-2);justify-content:space-between;align-items:center;padding:var(--spacing-2);border-bottom:1px solid var(--color-border)}.k-preview-view-grid{display:flex}@media screen and (max-width: 60rem){.k-preview-view-grid{flex-direction:column}}.k-preview-view-grid .k-preview-view-panel+.k-preview-view-panel{border-left:1px solid var(--color-border)}.k-preview-view-panel{flex-grow:1;flex-basis:50%;display:flex;flex-direction:column;padding:var(--spacing-6);background:var(--color-gray-200)}.k-preview-view-panel header{container-type:inline-size;display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--spacing-3)}.k-preview-view-panel iframe{width:100%;flex-grow:1;border-radius:var(--rounded-lg);box-shadow:var(--shadow-xl);background:var(--color-white)}.k-preview-view-panel .k-empty{flex-grow:1;justify-content:center;flex-direction:column;gap:var(--spacing-6);--button-color-text: var(--color-text)}.k-search-view .k-header{margin-bottom:0}.k-header+.k-search-view-results{margin-top:var(--spacing-12)}.k-search-view-input{--input-color-border: transparent;--input-color-back: var(--color-gray-300);--input-height: var(--height-md);width:40cqw}.k-file-view-header,.k-file-view[data-has-tabs=true] .k-file-preview{margin-bottom:0}:root{--file-preview-back: var(--color-gray-900);--file-preview-text: hsla(0, 100%, var(--color-l-max), .75)}.k-panel[data-theme=dark]{--file-preview-back: var(--color-gray-100);--file-preview-text: hsla(0, 100%, var(--color-l-min), .75)}.k-file-preview{display:grid;align-items:stretch;background:var(--file-preview-back);border-radius:var(--rounded-lg);margin-bottom:var(--spacing-12);overflow:hidden}.k-file-preview-details{display:grid}.k-file-preview-details dl{display:grid;grid-template-columns:repeat(auto-fill,minmax(14rem,1fr));grid-gap:var(--spacing-6) var(--spacing-12);align-self:center;line-height:1.5em;padding:var(--spacing-6)}.k-file-preview-details dt{font-size:var(--text-sm);font-weight:500;font-weight:var(--font-semi);color:var(--color-gray-500);margin-bottom:var(--spacing-1)}.k-file-preview-details :where(dd,a){font-size:var(--text-xs);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--file-preview-text);font-size:var(--text-sm)}.k-file-preview-frame-column{aspect-ratio:1/1;background:var(--pattern)}.k-file-preview-frame{display:flex;align-items:center;justify-content:center;height:100%;padding:var(--spacing-10);container-type:size}.k-file-preview-frame :where(img,audio,video){width:auto;max-width:100cqw;max-height:100cqh}.k-file-preview-frame>.k-button{position:absolute;top:var(--spacing-2);inset-inline-start:var(--spacing-2)}.k-button.k-file-preview-frame-dropdown-toggle{--button-color-icon: var(--color-gray-500)}.k-panel[data-theme=dark] .k-button.k-file-preview-frame-dropdown-toggle{--button-color-icon: var(--color-gray-700)}.k-default-file-preview .k-file-preview-frame>.k-icon{--icon-size: 3rem}@container (min-width: 36rem){.k-default-file-preview{grid-template-columns:50% auto}.k-default-file-preview-thumb-column{aspect-ratio:auto}}@container (min-width: 65rem){.k-default-file-preview{grid-template-columns:33.333% auto}.k-default-file-preview-thumb-column{aspect-ratio:1/1}}.k-audio-file-preview{display:block}.k-audio-file-preview audio{width:100%}.k-audio-file-preview audio::-webkit-media-controls-enclosure{border-radius:0}.k-image-file-preview .k-coords-input{--opacity-disabled: 1;--range-thumb-color: hsl(216 60% 60% / .75);--range-thumb-size: 1.25rem;--range-thumb-shadow: none;cursor:crosshair}.k-image-file-preview .k-coords-input-thumb:after{--size: .4rem;--pos: calc(50% - (var(--size) / 2));position:absolute;top:var(--pos);inset-inline-start:var(--pos);width:var(--size);height:var(--size);content:"";background:#fff;border-radius:50%}.k-image-file-preview:not([data-has-focus=true]) .k-coords-input-thumb{display:none}.k-image-file-preview-focus dd{display:flex;align-items:center}.k-image-file-preview-focus .k-button{--button-padding: var(--spacing-2);--button-color-back: var(--color-gray-800)}.k-video-file-preview .k-file-preview-frame-column{aspect-ratio:16/9}@container (min-width: 60rem){.k-video-file-preview{grid-template-columns:50% auto}}.k-installation-dialog{--dialog-color-back: var(--color-white);--dialog-shadow: var(--shadow);container-type:inline-size}.k-installation-view .k-button{margin-top:var(--spacing-3);width:100%}.k-installation-view form .k-button{margin-top:var(--spacing-10)}.k-installation-view .k-headline{font-weight:var(--font-semi);margin-top:-.5rem;margin-bottom:.75rem}.k-installation-issues{line-height:1.5em;font-size:var(--text-sm)}.k-installation-issues li{position:relative;padding:var(--spacing-6);background:var(--color-red-300);padding-inline-start:3.5rem;border-radius:var(--rounded)}.k-installation-issues .k-icon{position:absolute;top:calc(1.5rem + 2px);inset-inline-start:1.5rem}.k-installation-issues .k-icon{color:var(--color-red-700)}.k-installation-issues li:not(:last-child){margin-bottom:2px}.k-installation-issues li code{font:inherit;color:var(--color-red-700)}.k-login-code-form .k-user-info{margin-bottom:var(--spacing-6)}.k-login-form{position:relative}.k-login-form label abbr{visibility:hidden}.k-login-toggler{position:absolute;top:-2px;inset-inline-end:calc(var(--spacing-2) * -1);color:var(--link-color);text-decoration:underline;text-decoration-color:var(--link-color);text-underline-offset:1px;height:var(--height-xs);line-height:1;padding-inline:var(--spacing-2);border-radius:var(--rounded);z-index:1}.k-login{--dialog-color-back: var(--color-white);--dialog-shadow: var(--shadow);container-type:inline-size}.k-login-buttons{--button-padding: var(--spacing-3);display:flex;gap:1.5rem;align-items:center;justify-content:space-between;margin-top:var(--spacing-10)}.k-page-view[data-has-tabs=true] .k-page-view-header,.k-site-view[data-has-tabs=true] .k-site-view-header{margin-bottom:0}.k-user-name-placeholder{color:var(--color-gray-500);transition:color .3s}.k-user-view-header[data-editable=true] .k-user-name-placeholder:hover{color:var(--color-gray-900)}.k-user-view-header{margin-bottom:0;border-bottom:0}.k-user-view .k-user-profile{margin-bottom:var(--spacing-12)}.k-user-view[data-has-tabs=true] .k-user-profile{margin-bottom:0}.k-password-reset-view .k-user-info{margin-bottom:var(--spacing-8)}.k-user-view-image{padding:0}.k-user-view-image .k-frame{width:6rem;height:6rem;border-radius:var(--rounded);line-height:0}.k-user-view-image .k-icon-frame{--back: var(--color-black);--icon-color: var(--color-gray-200)}.k-user-info{display:flex;align-items:center;font-size:var(--text-sm);height:var(--height-lg);gap:.75rem;padding-inline:var(--spacing-2);background:var(--color-white);box-shadow:var(--shadow)}.k-user-info :where(.k-image-frame,.k-icon-frame){width:1.5rem;border-radius:var(--rounded-sm)}.k-user-profile{--button-height: auto;padding:var(--spacing-2);background:var(--color-white);border-radius:var(--rounded-lg);display:flex;align-items:center;gap:var(--spacing-3);box-shadow:var(--shadow)}.k-user-profile .k-button-group{display:flex;flex-direction:column;align-items:flex-start}.k-users-view-header{margin-bottom:0}.k-system-info .k-stat-label{color:var(--theme, var(--color-black))}.k-table-license-cell{padding:0 var(--spacing-1)}.k-table-update-status-cell{padding:0 .75rem;display:flex;align-items:center;height:100%}.k-table-update-status-cell-version,.k-table-update-status-cell-button{font-variant-numeric:tabular-nums}.k-plugin-info{display:grid;column-gap:var(--spacing-3);row-gap:2px;padding:var(--button-padding)}.k-plugin-info dt{color:var(--color-gray-400)}.k-plugin-info dd[data-theme]{color:var(--theme-color-600)}@container (max-width: 30em){.k-plugin-info dd:not(:last-of-type){margin-bottom:var(--spacing-2)}}@container (min-width: 30em){.k-plugin-info{width:20rem;grid-template-columns:1fr auto}}:root{--color-l-max: 100%;--color-l-100: 98%;--color-l-200: 94%;--color-l-300: 88%;--color-l-400: 80%;--color-l-500: 70%;--color-l-600: 60%;--color-l-700: 45%;--color-l-800: 30%;--color-l-900: 15%;--color-l-min: 0%;--color-red-h: 0;--color-red-s: 80%;--color-red-hs: var(--color-red-h), var(--color-red-s);--color-red-boost: 3%;--color-red-l-100: calc(var(--color-l-100) + var(--color-red-boost));--color-red-l-200: calc(var(--color-l-200) + var(--color-red-boost));--color-red-l-300: calc(var(--color-l-300) + var(--color-red-boost));--color-red-l-400: calc(var(--color-l-400) + var(--color-red-boost));--color-red-l-500: calc(var(--color-l-500) + var(--color-red-boost));--color-red-l-600: calc(var(--color-l-600) + var(--color-red-boost));--color-red-l-700: calc(var(--color-l-700) + var(--color-red-boost));--color-red-l-800: calc(var(--color-l-800) + var(--color-red-boost));--color-red-l-900: calc(var(--color-l-900) + var(--color-red-boost));--color-red-100: hsl(var(--color-red-hs), var(--color-red-l-100));--color-red-200: hsl(var(--color-red-hs), var(--color-red-l-200));--color-red-300: hsl(var(--color-red-hs), var(--color-red-l-300));--color-red-400: hsl(var(--color-red-hs), var(--color-red-l-400));--color-red-500: hsl(var(--color-red-hs), var(--color-red-l-500));--color-red-600: hsl(var(--color-red-hs), var(--color-red-l-600));--color-red-700: hsl(var(--color-red-hs), var(--color-red-l-700));--color-red-800: hsl(var(--color-red-hs), var(--color-red-l-800));--color-red-900: hsl(var(--color-red-hs), var(--color-red-l-900));--color-orange-h: 28;--color-orange-s: 80%;--color-orange-hs: var(--color-orange-h), var(--color-orange-s);--color-orange-boost: 2.5%;--color-orange-l-100: calc(var(--color-l-100) + var(--color-orange-boost));--color-orange-l-200: calc(var(--color-l-200) + var(--color-orange-boost));--color-orange-l-300: calc(var(--color-l-300) + var(--color-orange-boost));--color-orange-l-400: calc(var(--color-l-400) + var(--color-orange-boost));--color-orange-l-500: calc(var(--color-l-500) + var(--color-orange-boost));--color-orange-l-600: calc(var(--color-l-600) + var(--color-orange-boost));--color-orange-l-700: calc(var(--color-l-700) + var(--color-orange-boost));--color-orange-l-800: calc(var(--color-l-800) + var(--color-orange-boost));--color-orange-l-900: calc(var(--color-l-900) + var(--color-orange-boost));--color-orange-100: hsl(var(--color-orange-hs), var(--color-orange-l-100));--color-orange-200: hsl(var(--color-orange-hs), var(--color-orange-l-200));--color-orange-300: hsl(var(--color-orange-hs), var(--color-orange-l-300));--color-orange-400: hsl(var(--color-orange-hs), var(--color-orange-l-400));--color-orange-500: hsl(var(--color-orange-hs), var(--color-orange-l-500));--color-orange-600: hsl(var(--color-orange-hs), var(--color-orange-l-600));--color-orange-700: hsl(var(--color-orange-hs), var(--color-orange-l-700));--color-orange-800: hsl(var(--color-orange-hs), var(--color-orange-l-800));--color-orange-900: hsl(var(--color-orange-hs), var(--color-orange-l-900));--color-yellow-h: 47;--color-yellow-s: 80%;--color-yellow-hs: var(--color-yellow-h), var(--color-yellow-s);--color-yellow-boost: 0%;--color-yellow-l-100: calc(var(--color-l-100) + var(--color-yellow-boost));--color-yellow-l-200: calc(var(--color-l-200) + var(--color-yellow-boost));--color-yellow-l-300: calc(var(--color-l-300) + var(--color-yellow-boost));--color-yellow-l-400: calc(var(--color-l-400) + var(--color-yellow-boost));--color-yellow-l-500: calc(var(--color-l-500) + var(--color-yellow-boost));--color-yellow-l-600: calc(var(--color-l-600) + var(--color-yellow-boost));--color-yellow-l-700: calc(var(--color-l-700) + var(--color-yellow-boost));--color-yellow-l-800: calc(var(--color-l-800) + var(--color-yellow-boost));--color-yellow-l-900: calc(var(--color-l-900) + var(--color-yellow-boost));--color-yellow-100: hsl(var(--color-yellow-hs), var(--color-yellow-l-100));--color-yellow-200: hsl(var(--color-yellow-hs), var(--color-yellow-l-200));--color-yellow-300: hsl(var(--color-yellow-hs), var(--color-yellow-l-300));--color-yellow-400: hsl(var(--color-yellow-hs), var(--color-yellow-l-400));--color-yellow-500: hsl(var(--color-yellow-hs), var(--color-yellow-l-500));--color-yellow-600: hsl(var(--color-yellow-hs), var(--color-yellow-l-600));--color-yellow-700: hsl(var(--color-yellow-hs), var(--color-yellow-l-700));--color-yellow-800: hsl(var(--color-yellow-hs), var(--color-yellow-l-800));--color-yellow-900: hsl(var(--color-yellow-hs), var(--color-yellow-l-900));--color-green-h: 80;--color-green-s: 60%;--color-green-hs: var(--color-green-h), var(--color-green-s);--color-green-boost: -2.5%;--color-green-l-100: calc(var(--color-l-100) + var(--color-green-boost));--color-green-l-200: calc(var(--color-l-200) + var(--color-green-boost));--color-green-l-300: calc(var(--color-l-300) + var(--color-green-boost));--color-green-l-400: calc(var(--color-l-400) + var(--color-green-boost));--color-green-l-500: calc(var(--color-l-500) + var(--color-green-boost));--color-green-l-600: calc(var(--color-l-600) + var(--color-green-boost));--color-green-l-700: calc(var(--color-l-700) + var(--color-green-boost));--color-green-l-800: calc(var(--color-l-800) + var(--color-green-boost));--color-green-l-900: calc(var(--color-l-900) + var(--color-green-boost));--color-green-100: hsl(var(--color-green-hs), var(--color-green-l-100));--color-green-200: hsl(var(--color-green-hs), var(--color-green-l-200));--color-green-300: hsl(var(--color-green-hs), var(--color-green-l-300));--color-green-400: hsl(var(--color-green-hs), var(--color-green-l-400));--color-green-500: hsl(var(--color-green-hs), var(--color-green-l-500));--color-green-600: hsl(var(--color-green-hs), var(--color-green-l-600));--color-green-700: hsl(var(--color-green-hs), var(--color-green-l-700));--color-green-800: hsl(var(--color-green-hs), var(--color-green-l-800));--color-green-900: hsl(var(--color-green-hs), var(--color-green-l-900));--color-aqua-h: 180;--color-aqua-s: 50%;--color-aqua-hs: var(--color-aqua-h), var(--color-aqua-s);--color-aqua-boost: 0%;--color-aqua-l-100: calc(var(--color-l-100) + var(--color-aqua-boost));--color-aqua-l-200: calc(var(--color-l-200) + var(--color-aqua-boost));--color-aqua-l-300: calc(var(--color-l-300) + var(--color-aqua-boost));--color-aqua-l-400: calc(var(--color-l-400) + var(--color-aqua-boost));--color-aqua-l-500: calc(var(--color-l-500) + var(--color-aqua-boost));--color-aqua-l-600: calc(var(--color-l-600) + var(--color-aqua-boost));--color-aqua-l-700: calc(var(--color-l-700) + var(--color-aqua-boost));--color-aqua-l-800: calc(var(--color-l-800) + var(--color-aqua-boost));--color-aqua-l-900: calc(var(--color-l-900) + var(--color-aqua-boost));--color-aqua-100: hsl(var(--color-aqua-hs), var(--color-aqua-l-100));--color-aqua-200: hsl(var(--color-aqua-hs), var(--color-aqua-l-200));--color-aqua-300: hsl(var(--color-aqua-hs), var(--color-aqua-l-300));--color-aqua-400: hsl(var(--color-aqua-hs), var(--color-aqua-l-400));--color-aqua-500: hsl(var(--color-aqua-hs), var(--color-aqua-l-500));--color-aqua-600: hsl(var(--color-aqua-hs), var(--color-aqua-l-600));--color-aqua-700: hsl(var(--color-aqua-hs), var(--color-aqua-l-700));--color-aqua-800: hsl(var(--color-aqua-hs), var(--color-aqua-l-800));--color-aqua-900: hsl(var(--color-aqua-hs), var(--color-aqua-l-900));--color-blue-h: 210;--color-blue-s: 65%;--color-blue-hs: var(--color-blue-h), var(--color-blue-s);--color-blue-boost: 3%;--color-blue-l-100: calc(var(--color-l-100) + var(--color-blue-boost));--color-blue-l-200: calc(var(--color-l-200) + var(--color-blue-boost));--color-blue-l-300: calc(var(--color-l-300) + var(--color-blue-boost));--color-blue-l-400: calc(var(--color-l-400) + var(--color-blue-boost));--color-blue-l-500: calc(var(--color-l-500) + var(--color-blue-boost));--color-blue-l-600: calc(var(--color-l-600) + var(--color-blue-boost));--color-blue-l-700: calc(var(--color-l-700) + var(--color-blue-boost));--color-blue-l-800: calc(var(--color-l-800) + var(--color-blue-boost));--color-blue-l-900: calc(var(--color-l-900) + var(--color-blue-boost));--color-blue-100: hsl(var(--color-blue-hs), var(--color-blue-l-100));--color-blue-200: hsl(var(--color-blue-hs), var(--color-blue-l-200));--color-blue-300: hsl(var(--color-blue-hs), var(--color-blue-l-300));--color-blue-400: hsl(var(--color-blue-hs), var(--color-blue-l-400));--color-blue-500: hsl(var(--color-blue-hs), var(--color-blue-l-500));--color-blue-600: hsl(var(--color-blue-hs), var(--color-blue-l-600));--color-blue-700: hsl(var(--color-blue-hs), var(--color-blue-l-700));--color-blue-800: hsl(var(--color-blue-hs), var(--color-blue-l-800));--color-blue-900: hsl(var(--color-blue-hs), var(--color-blue-l-900));--color-purple-h: 275;--color-purple-s: 60%;--color-purple-hs: var(--color-purple-h), var(--color-purple-s);--color-purple-boost: 0%;--color-purple-l-100: calc(var(--color-l-100) + var(--color-purple-boost));--color-purple-l-200: calc(var(--color-l-200) + var(--color-purple-boost));--color-purple-l-300: calc(var(--color-l-300) + var(--color-purple-boost));--color-purple-l-400: calc(var(--color-l-400) + var(--color-purple-boost));--color-purple-l-500: calc(var(--color-l-500) + var(--color-purple-boost));--color-purple-l-600: calc(var(--color-l-600) + var(--color-purple-boost));--color-purple-l-700: calc(var(--color-l-700) + var(--color-purple-boost));--color-purple-l-800: calc(var(--color-l-800) + var(--color-purple-boost));--color-purple-l-900: calc(var(--color-l-900) + var(--color-purple-boost));--color-purple-100: hsl(var(--color-purple-hs), var(--color-purple-l-100));--color-purple-200: hsl(var(--color-purple-hs), var(--color-purple-l-200));--color-purple-300: hsl(var(--color-purple-hs), var(--color-purple-l-300));--color-purple-400: hsl(var(--color-purple-hs), var(--color-purple-l-400));--color-purple-500: hsl(var(--color-purple-hs), var(--color-purple-l-500));--color-purple-600: hsl(var(--color-purple-hs), var(--color-purple-l-600));--color-purple-700: hsl(var(--color-purple-hs), var(--color-purple-l-700));--color-purple-800: hsl(var(--color-purple-hs), var(--color-purple-l-800));--color-purple-900: hsl(var(--color-purple-hs), var(--color-purple-l-900));--color-pink-h: 320;--color-pink-s: 70%;--color-pink-hs: var(--color-pink-h), var(--color-pink-s);--color-pink-boost: 0%;--color-pink-l-100: calc(var(--color-l-100) + var(--color-pink-boost));--color-pink-l-200: calc(var(--color-l-200) + var(--color-pink-boost));--color-pink-l-300: calc(var(--color-l-300) + var(--color-pink-boost));--color-pink-l-400: calc(var(--color-l-400) + var(--color-pink-boost));--color-pink-l-500: calc(var(--color-l-500) + var(--color-pink-boost));--color-pink-l-600: calc(var(--color-l-600) + var(--color-pink-boost));--color-pink-l-700: calc(var(--color-l-700) + var(--color-pink-boost));--color-pink-l-800: calc(var(--color-l-800) + var(--color-pink-boost));--color-pink-l-900: calc(var(--color-l-900) + var(--color-pink-boost));--color-pink-100: hsl(var(--color-pink-hs), var(--color-pink-l-100));--color-pink-200: hsl(var(--color-pink-hs), var(--color-pink-l-200));--color-pink-300: hsl(var(--color-pink-hs), var(--color-pink-l-300));--color-pink-400: hsl(var(--color-pink-hs), var(--color-pink-l-400));--color-pink-500: hsl(var(--color-pink-hs), var(--color-pink-l-500));--color-pink-600: hsl(var(--color-pink-hs), var(--color-pink-l-600));--color-pink-700: hsl(var(--color-pink-hs), var(--color-pink-l-700));--color-pink-800: hsl(var(--color-pink-hs), var(--color-pink-l-800));--color-pink-900: hsl(var(--color-pink-hs), var(--color-pink-l-900));--color-gray-h: 0;--color-gray-s: 0%;--color-gray-hs: var(--color-gray-h), var(--color-gray-s);--color-gray-boost: 0%;--color-gray-l-100: calc(var(--color-l-100) + var(--color-gray-boost));--color-gray-l-200: calc(var(--color-l-200) + var(--color-gray-boost));--color-gray-l-300: calc(var(--color-l-300) + var(--color-gray-boost));--color-gray-l-400: calc(var(--color-l-400) + var(--color-gray-boost));--color-gray-l-500: calc(var(--color-l-500) + var(--color-gray-boost));--color-gray-l-600: calc(var(--color-l-600) + var(--color-gray-boost));--color-gray-l-700: calc(var(--color-l-700) + var(--color-gray-boost));--color-gray-l-800: calc(var(--color-l-800) + var(--color-gray-boost));--color-gray-l-900: calc(var(--color-l-900) + var(--color-gray-boost));--color-gray-100: hsl(var(--color-gray-hs), var(--color-gray-l-100));--color-gray-200: hsl(var(--color-gray-hs), var(--color-gray-l-200));--color-gray-250: #e8e8e8;--color-gray-300: hsl(var(--color-gray-hs), var(--color-gray-l-300));--color-gray-400: hsl(var(--color-gray-hs), var(--color-gray-l-400));--color-gray-500: hsl(var(--color-gray-hs), var(--color-gray-l-500));--color-gray-600: hsl(var(--color-gray-hs), var(--color-gray-l-600));--color-gray-700: hsl(var(--color-gray-hs), var(--color-gray-l-700));--color-gray-800: hsl(var(--color-gray-hs), var(--color-gray-l-800));--color-gray-900: hsl(var(--color-gray-hs), var(--color-gray-l-900));--color-black: hsl(0, 0%, var(--color-l-min));--color-border: var(--color-gray-300);--color-border-dimmed: hsla(0, 0%, var(--color-l-min), .1);--color-dark: var(--color-gray-900);--color-focus: var(--color-blue-600);--color-light: var(--color-gray-200);--color-text: var(--color-black);--color-text-dimmed: var(--color-gray-700);--color-white: hsl(0, 0%, var(--color-l-max));--color-backdrop: rgba(0, 0, 0, .6);--color-background: var(--color-light);--color-gray: var(--color-gray-600);--color-red: var(--color-red-600);--color-orange: var(--color-orange-600);--color-yellow: var(--color-yellow-600);--color-green: var(--color-green-600);--color-aqua: var(--color-aqua-600);--color-blue: var(--color-blue-600);--color-purple: var(--color-purple-600);--color-focus-light: var(--color-focus);--color-focus-outline: var(--color-focus);--color-negative: var(--color-red-700);--color-negative-light: var(--color-red-500);--color-negative-outline: var(--color-red-900);--color-notice: var(--color-orange-700);--color-notice-light: var(--color-orange-500);--color-positive: var(--color-green-700);--color-positive-light: var(--color-green-500);--color-positive-outline: var(--color-green-900);--color-text-light: var(--color-text-dimmed)}:root:has(.k-panel[data-theme=dark]){--color-l-max: 0%;--color-l-100: 3%;--color-l-200: 10%;--color-l-300: 17%;--color-l-400: 25%;--color-l-500: 36%;--color-l-600: 52%;--color-l-700: 62%;--color-l-800: 70%;--color-l-900: 80%;--color-l-min: 97%;--color-gray-250: #0f0f0f;color-scheme:dark}:root{--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--font-mono: "SFMono-Regular", Consolas, Liberation Mono, Menlo, Courier, monospace}:root{--text-xs: .75rem;--text-sm: .875rem;--text-md: 1rem;--text-lg: 1.125rem;--text-xl: 1.25rem;--text-2xl: 1.5rem;--text-3xl: 1.75rem;--text-4xl: 2.5rem;--text-5xl: 3rem;--text-6xl: 4rem;--text-base: var(--text-md);--font-size-tiny: var(--text-xs);--font-size-small: var(--text-sm);--font-size-medium: var(--text-base);--font-size-large: var(--text-xl);--font-size-huge: var(--text-2xl);--font-size-monster: var(--text-3xl)}:root{--font-thin: 300;--font-normal: 400;--font-semi: 500;--font-bold: 600}:root{--height-xs: 1.5rem;--height-sm: 1.75rem;--height-md: 2rem;--height-lg: 2.25rem;--height-xl: 2.5rem;--height: var(--height-md)}:root{--opacity-disabled: .5}:root{--rounded-xs: 1px;--rounded-sm: .125rem;--rounded-md: .25rem;--rounded-lg: .375rem;--rounded-xl: .5rem;--rounded: var(--rounded-md)}:root{--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .05), 0 1px 2px 0 rgba(0, 0, 0, .025);--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .05);--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .05);--shadow: var(--shadow-sm);--shadow-toolbar: rgba(0, 0, 0, .1) -2px 0 5px, var(--shadow), var(--shadow-xl);--shadow-outline: var(--color-focus, currentColor) 0 0 0 2px;--shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, .06);--shadow-sticky: rgba(0, 0, 0, .05) 0 2px 5px;--box-shadow-dropdown: var(--shadow-dropdown);--box-shadow-item: var(--shadow);--box-shadow-focus: var(--shadow-xl);--shadow-dropdown: var(--shadow-lg);--shadow-item: var(--shadow-sm)}:root{--spacing-0: 0;--spacing-1: .25rem;--spacing-2: .5rem;--spacing-3: .75rem;--spacing-4: 1rem;--spacing-6: 1.5rem;--spacing-8: 2rem;--spacing-12: 3rem;--spacing-16: 4rem;--spacing-24: 6rem;--spacing-36: 9rem;--spacing-48: 12rem;--spacing-px: 1px;--spacing-2px: 2px;--spacing-5: 1.25rem;--spacing-10: 2.5rem;--spacing-20: 5rem}:root{--z-offline: 1200;--z-fatal: 1100;--z-loader: 1000;--z-notification: 900;--z-dialog: 800;--z-navigation: 700;--z-dropdown: 600;--z-drawer: 500;--z-dropzone: 400;--z-toolbar: 300;--z-content: 200;--z-background: 100}:root{--pattern-size: 16px;--pattern-light: repeating-conic-gradient( hsl(0, 0%, 100%) 0% 25%, hsl(0, 0%, 90%) 0% 50% ) 50% / var(--pattern-size) var(--pattern-size);--pattern-dark: repeating-conic-gradient( hsla(0, 0%, 15%) 0% 25%, hsl(0, 0%, 22%) 0% 50% ) 50% / var(--pattern-size) var(--pattern-size);--pattern: var(--pattern-dark)}.k-panel[data-theme=dark]{--pattern-light: repeating-conic-gradient( hsl(0, 0%, 90%) 0% 25%, hsl(0, 0%, 80%) 0% 50% ) 50% / var(--pattern-size) var(--pattern-size);--pattern-dark: repeating-conic-gradient( hsla(0, 0%, 9%) 0% 25%, hsl(0, 0%, 16%) 0% 50% ) 50% / var(--pattern-size) var(--pattern-size);--pattern: var(--pattern-dark)}:root{--container: 80rem;--leading-none: 1;--leading-tight: 1.25;--leading-snug: 1.375;--leading-normal: 1.5;--leading-relaxed: 1.625;--leading-loose: 2;--field-input-padding: var(--input-padding);--field-input-height: var(--input-height);--field-input-line-height: var(--input-leading);--field-input-font-size: var(--input-font-size);--bg-pattern: var(--pattern)}:root{--choice-color-back: var(--color-white);--choice-color-border: var(--color-gray-500);--choice-color-checked: var(--color-black);--choice-color-disabled: var(--color-gray-400);--choice-color-icon: var(--color-light);--choice-color-info: var(--color-text-dimmed);--choice-color-text: var(--color-text);--choice-color-toggle: var(--choice-color-disabled);--choice-height: 1rem;--choice-rounded: var(--rounded-sm)}input:where([type=checkbox],[type=radio]){position:relative;cursor:pointer;overflow:hidden;flex-shrink:0;height:var(--choice-height);aspect-ratio:1/1;border:1px solid var(--choice-color-border);-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:var(--choice-rounded);background:var(--choice-color-back);box-shadow:var(--shadow-sm)}input:where([type=checkbox],[type=radio]):after{position:absolute;content:"";display:none;place-items:center;text-align:center}input:where([type=checkbox],[type=radio]):focus{outline:var(--outline);outline-offset:-1px;color:var(--color-focus)}input:where([type=checkbox]):checked{border-color:var(--choice-color-checked)}input:where([type=checkbox],[type=radio]):checked:after{background:var(--choice-color-checked);display:grid}input:where([type=checkbox],[type=radio]):checked:focus{--choice-color-checked: var(--color-focus)}input:where([type=checkbox],[type=radio])[disabled]{--choice-color-back: none;--choice-color-border: var(--color-gray-300);--choice-color-checked: var(--choice-color-disabled);box-shadow:none;cursor:not-allowed}input[type=checkbox]:checked:after{content:"✓";top:0;right:0;bottom:0;left:0;font-weight:700;color:var(--choice-color-icon);line-height:1}input[type=radio]{--choice-rounded: 50%}input[type=radio]:after{top:3px;right:3px;bottom:3px;left:3px;font-size:9px;border-radius:var(--choice-rounded)}input[type=checkbox][data-variant=toggle]{--choice-rounded: var(--choice-height);width:calc(var(--choice-height) * 2);aspect-ratio:2/1}input[type=checkbox][data-variant=toggle]:after{background:var(--choice-color-toggle);display:grid;top:1px;right:1px;bottom:1px;left:1px;width:.8rem;font-size:7px;border-radius:var(--choice-rounded);transition:margin-inline-start 75ms ease-in-out,background .1s ease-in-out}input[type=checkbox][data-variant=toggle]:checked{border-color:var(--choice-color-border)}input[type=checkbox][data-variant=toggle]:checked:after{background:var(--choice-color-checked);margin-inline-start:50%}:root{--range-thumb-color: white;--range-thumb-focus-outline: var(--outline);--range-thumb-size: 1rem;--range-thumb-shadow: rgba(0, 0, 0, .1) 0 2px 4px 2px, rgba(0, 0, 0, .125) 0 0 0 1px;--range-track-back: var(--color-gray-250);--range-track-height: var(--range-thumb-size)}:where(input[type=range]){display:flex;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;height:var(--range-thumb-size);border-radius:var(--range-track-size);width:100%}:where(input[type=range])::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:var(--range-thumb-size);height:var(--range-thumb-size);border:0;background:var(--range-thumb-color);box-shadow:var(--range-thumb-shadow);transform:translateZ(0);margin-top:calc(((var(--range-thumb-size) - var(--range-track-height)) / 2) * -1);border-radius:50%;z-index:1;cursor:grab}:where(input[type=range])::-moz-range-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:var(--range-thumb-size);height:var(--range-thumb-size);border:0;background:var(--range-thumb-color);box-shadow:var(--range-thumb-shadow);border-radius:50%;transform:translateZ(0);z-index:1;cursor:grab}:where(input[type=range])::-webkit-slider-thumb:active{cursor:grabbing}:where(input[type=range])::-moz-range-thumb:active{cursor:grabbing}:where(input[type=range])::-webkit-slider-runnable-track{background:var(--range-track-back);height:var(--range-track-height);border-radius:var(--range-track-height)}:where(input[type=range])::-moz-range-track{background:var(--range-track-back);height:var(--range-track-height);border-radius:var(--range-track-height)}:where(input[type=range][disabled]){--range-thumb-color: rgba(255, 255, 255, .2)}:where(input[type=range][disabled])::-webkit-slider-thumb{cursor:not-allowed}:where(input[type=range][disabled])::-moz-range-thumb{cursor:not-allowed}:where(input[type=range]):focus{outline:var(--outline)}:where(input[type=range]):focus::-webkit-slider-thumb{outline:var(--range-thumb-focus-outline)}:where(input[type=range]):focus::-moz-range-thumb{outline:var(--range-thumb-focus-outline)}*,*:before,*:after{margin:0;padding:0;box-sizing:border-box}:where(b,strong){font-weight:var(--font-bold, 600)}:where([hidden]){display:none!important}:where(abbr){text-decoration:none}:where(input,button,textarea,select){border:0;font:inherit;line-height:inherit;color:inherit;background:none}:where(fieldset){border:0}:where(legend){width:100%;float:left}:where(legend+*){clear:both}:where(select){-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--color-white);color:var(--color-black);cursor:pointer}:where(textarea,select,input:not([type=checkbox],[type=radio],[type=reset],[type=submit])){width:100%;font-variant-numeric:tabular-nums}:where(textarea){resize:vertical;line-height:1.5}:where(input)::-webkit-calendar-picker-indicator{display:none}:where(input[type=search]){-webkit-appearance:none;-moz-appearance:none;appearance:none}:where(input)::-webkit-search-cancel-button{display:none}:where(button,label,select,summary,[role=button],[role=option]){cursor:pointer}:where(select[multiple]) option{display:flex;align-items:center}:where(input:-webkit-autofill){-webkit-text-fill-color:var(--input-color-text)!important;-webkit-background-clip:text}:where(:disabled){cursor:not-allowed}*::placeholder{color:var(--input-color-placeholder);opacity:1}:where(a){color:currentColor;text-decoration:none;text-underline-offset:.2ex}:where(ul,ol){list-style:none}:where(img,svg,video,canvas,audio,iframe,embed,object){display:block}:where(iframe){border:0}:where(img,picture,svg){max-inline-size:100%;block-size:auto}:where(p,h1,h2,h3,h4,h5,h6){overflow-wrap:break-word}:where(h1,h2,h3,h4,h5,h6){font:inherit}:where(:focus,:focus-visible,:focus-within){outline-color:var(--color-focus, currentColor);outline-offset:0}:where(:focus-visible){outline:var(--outline, 2px solid var(--color-focus, currentColor))}:where(:invalid){box-shadow:none;outline:0}:where(dialog){border:0;max-width:none;max-height:none}:where(hr){border:0}:where(table){font:inherit;width:100%;border-spacing:0;font-variant-numeric:tabular-nums}:where(table th){font:inherit;text-align:start}:where(svg){fill:currentColor}body{font-family:var(--font-sans, sans-serif);font-size:var(--text-sm);line-height:1;position:relative;accent-color:var(--color-focus, currentColor)}:where(sup,sub){position:relative;line-height:0;vertical-align:baseline;font-size:75%}:where(sup){top:-.5em}:where(sub){bottom:-.25em}:where(mark){background:var(--color-yellow-300)}:where(kbd){display:inline-block;padding-inline:var(--spacing-2);border-radius:var(--rounded);background:var(--color-white);box-shadow:var(--shadow)}[data-align=left]{--align: start}[data-align=center]{--align: center}[data-align=right]{--align: end}@keyframes LoadingCursor{to{cursor:progress}}@keyframes Spin{to{transform:rotate(360deg)}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}[data-theme]{--theme-color-h: 0;--theme-color-s: 0%;--theme-color-hs: var(--theme-color-h), var(--theme-color-s);--theme-color-boost: 3%;--theme-color-l-100: calc(var(--color-l-100) + var(--theme-color-boost));--theme-color-l-200: calc(var(--color-l-200) + var(--theme-color-boost));--theme-color-l-300: calc(var(--color-l-300) + var(--theme-color-boost));--theme-color-l-400: calc(var(--color-l-400) + var(--theme-color-boost));--theme-color-l-500: calc(var(--color-l-500) + var(--theme-color-boost));--theme-color-l-600: calc(var(--color-l-600) + var(--theme-color-boost));--theme-color-l-700: calc(var(--color-l-700) + var(--theme-color-boost));--theme-color-l-800: calc(var(--color-l-800) + var(--theme-color-boost));--theme-color-l-900: calc(var(--color-l-900) + var(--theme-color-boost));--theme-color-100: hsl(var(--theme-color-hs), var(--theme-color-l-100));--theme-color-200: hsl(var(--theme-color-hs), var(--theme-color-l-200));--theme-color-300: hsl(var(--theme-color-hs), var(--theme-color-l-300));--theme-color-400: hsl(var(--theme-color-hs), var(--theme-color-l-400));--theme-color-500: hsl(var(--theme-color-hs), var(--theme-color-l-500));--theme-color-600: hsl(var(--theme-color-hs), var(--theme-color-l-600));--theme-color-700: hsl(var(--theme-color-hs), var(--theme-color-l-700));--theme-color-800: hsl(var(--theme-color-hs), var(--theme-color-l-800));--theme-color-900: hsl(var(--theme-color-hs), var(--theme-color-l-900));--theme-color-text: var(--theme-color-900);--theme-color-text-dimmed: hsl( var(--theme-color-h), calc(var(--theme-color-s) - 60%), 50% );--theme-color-back: var(--theme-color-400);--theme-color-hover: var(--theme-color-500);--theme-color-icon: var(--theme-color-600)}[data-theme^=red],[data-theme^=error],[data-theme^=negative]{--theme-color-h: var(--color-red-h);--theme-color-s: var(--color-red-s);--theme-color-boost: var(--color-red-boost)}[data-theme^=orange],[data-theme^=notice]{--theme-color-h: var(--color-orange-h);--theme-color-s: var(--color-orange-s);--theme-color-boost: var(--color-orange-boost)}[data-theme^=yellow],[data-theme^=warning]{--theme-color-h: var(--color-yellow-h);--theme-color-s: var(--color-yellow-s);--theme-color-boost: var(--color-yellow-boost)}[data-theme^=blue],[data-theme^=info]{--theme-color-h: var(--color-blue-h);--theme-color-s: var(--color-blue-s);--theme-color-boost: var(--color-blue-boost)}[data-theme^=pink],[data-theme^=love]{--theme-color-h: var(--color-pink-h);--theme-color-s: var(--color-pink-s);--theme-color-boost: var(--color-pink-boost)}[data-theme^=green],[data-theme^=positive]{--theme-color-h: var(--color-green-h);--theme-color-s: var(--color-green-s);--theme-color-boost: var(--color-green-boost)}[data-theme^=aqua]{--theme-color-h: var(--color-aqua-h);--theme-color-s: var(--color-aqua-s);--theme-color-boost: var(--color-aqua-boost)}[data-theme^=purple]{--theme-color-h: var(--color-purple-h);--theme-color-s: var(--color-purple-s);--theme-color-boost: var(--color-purple-boost)}[data-theme^=gray],[data-theme^=passive]{--theme-color-h: var(--color-gray-h);--theme-color-s: var(--color-gray-s);--theme-color-boost: 10%}[data-theme^=white],[data-theme^=text]{--theme-color-back: var(--color-white);--theme-color-icon: var(--color-gray-800);--theme-color-text: var(--color-text);--color-h: var(--color-black)}[data-theme^=dark]{--theme-color-h: var(--color-gray-h);--theme-color-s: var(--color-gray-s);--theme-color-boost: var(--color-gray-boost);--theme-color-back: var(--color-gray-800);--theme-color-icon: var(--color-gray-500);--theme-color-text: var(--color-gray-200)}[data-theme=code]{--theme-color-back: var(--code-color-back);--theme-color-hover: var(--color-black);--theme-color-icon: var(--code-color-icon);--theme-color-text: var(--code-color-text);font-family:var(--code-font-family);font-size:var(--code-font-size)}[data-theme=empty]{--theme-color-back: var(--color-light);--theme-color-border: var(--color-gray-400);--theme-color-icon: var(--color-gray-600);--theme-color-text: var(--color-text-dimmed);border:1px dashed var(--theme-color-border)}[data-theme=none]{--theme-color-back: transparent;--theme-color-border: transparent;--theme-color-icon: var(--color-text);--theme-color-text: var(--color-text)}[data-theme]{--theme: var(--theme-color-700);--theme-light: var(--theme-color-500);--theme-bg: var(--theme-color-500)}:root{--outline: 2px solid var(--color-focus, currentColor)}.scroll-x,.scroll-x-auto,.scroll-y,.scroll-y-auto{-webkit-overflow-scrolling:touch;transform:translateZ(0)}.scroll-x{overflow-x:scroll;overflow-y:hidden}.scroll-x-auto{overflow-x:auto;overflow-y:hidden}.scroll-y{overflow-x:hidden;overflow-y:scroll}.scroll-y-auto{overflow-x:hidden;overflow-y:auto}.input-hidden{position:absolute;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:0;height:0;opacity:0}.k-lab-index-view .k-header{margin-bottom:0}.k-lab-index-view .k-panel-main>.k-box{margin-bottom:var(--spacing-8)}.k-lab-index-view .k-list-items{grid-template-columns:repeat(auto-fill,minmax(12rem,1fr))}.k-lab-docs-deprecated .k-box{box-shadow:var(--shadow)}.k-lab-docs-examples .k-code+.k-code{margin-top:var(--spacing-4)}.k-lab-docs-prop-values{font-size:var(--text-xs);border-left:2px solid var(--color-blue-300);padding-inline-start:var(--spacing-2)}.k-lab-docs-prop-values dl{font-weight:var(--font-bold)}.k-lab-docs-prop-values dl+dl{margin-top:var(--spacing-2)}.k-lab-docs-prop-values dd{display:inline-flex;flex-wrap:wrap;gap:var(--spacing-1)}.k-lab-docs-desc-header{display:flex;justify-content:space-between;align-items:center}.k-table .k-lab-docs-deprecated{--box-height: var(--height-xs);--text-font-size: var(--text-xs)}.k-labs-docs-params li{list-style:square;margin-inline-start:var(--spacing-3)}.k-labs-docs-params .k-lab-docs-types{margin-inline:1ch}.k-lab-docs-types{display:inline-flex;flex-wrap:wrap;gap:var(--spacing-1)}.k-lab-docs-types.k-text code{color:var(--color-gray-800);outline-color:var(--color-gray-400);background:var(--color-gray-300)}.k-lab-docs-types code:is([data-type=boolean],[data-type=Boolean]){color:var(--color-purple-800);outline-color:var(--color-purple-400);background:var(--color-purple-300)}.k-lab-docs-types code:is([data-type=string],[data-type=String]){color:var(--color-green-800);outline-color:var(--color-green-500);background:var(--color-green-300)}.k-lab-docs-types code:is([data-type=number],[data-type=Number]){color:var(--color-orange-800);outline-color:var(--color-orange-500);background:var(--color-orange-300)}.k-lab-docs-types code:is([data-type=array],[data-type=Array]){color:var(--color-aqua-800);outline-color:var(--color-aqua-500);background:var(--color-aqua-300)}.k-lab-docs-types code:is([data-type=object],[data-type=Object]){color:var(--color-yellow-800);outline-color:var(--color-yellow-500);background:var(--color-yellow-300)}.k-lab-docs-types code[data-type=func]{color:var(--color-pink-800);outline-color:var(--color-pink-400);background:var(--color-pink-300)}.k-lab-docs-section+.k-lab-docs-section{margin-top:var(--spacing-12)}.k-lab-docs-section .k-headline{margin-bottom:var(--spacing-3)}.k-lab-docs-section .k-table td{padding:.375rem var(--table-cell-padding);vertical-align:top;line-height:1.5;word-break:break-word}.k-lab-docs-description :where(.k-text,.k-box)+:where(.k-text,.k-box){margin-top:var(--spacing-3)}.k-lab-docs-required{margin-inline-start:var(--spacing-1);font-size:.7rem;vertical-align:super;color:var(--color-red-600)}.k-lab-docs-since{margin-top:var(--spacing-1);font-size:var(--text-xs);color:var(--color-gray-600)}.k-lab-example{position:relative;container-type:inline-size;max-width:100%;outline-offset:-2px;border-radius:var(--rounded);border:1px solid var(--color-gray-300)}.k-lab-example+.k-lab-example{margin-top:var(--spacing-12)}.k-lab-example-header{display:flex;justify-content:space-between;align-items:center;height:var(--height-md);padding-block:var(--spacing-3);padding-inline:var(--spacing-2);border-bottom:1px solid var(--color-gray-300)}.k-lab-example-label{font-size:12px;color:var(--color-text-dimmed)}.k-lab-example-canvas,.k-lab-example-code{padding:var(--spacing-16)}.k-lab-example[data-flex=true] .k-lab-example-canvas{display:flex;align-items:center;gap:var(--spacing-6)}.k-lab-example-inspector{--icon-size: 13px;--button-color-icon: var(--color-gray-500)}.k-lab-example-inspector .k-button:not([data-theme]):hover{--button-color-icon: var(--color-gray-600)}.k-lab-example-inspector .k-button:where([data-theme]){--button-color-icon: var(--color-gray-800)}.k-lab-examples>:where(.k-text,.k-box){margin-bottom:var(--spacing-6)}.k-lab-form>footer{border-top:1px dashed var(--color-border);padding-top:var(--spacing-6)}.k-lab-playground-view[data-has-tabs=true] .k-lab-playground-header{margin-bottom:0}.k-lab-examples h2{margin-bottom:var(--spacing-6)}.k-lab-examples *+h2{margin-top:var(--spacing-12)}:where(.k-lab-input-examples,.k-lab-field-examples) .k-lab-example:has(:invalid){outline:2px solid var(--color-red-500);outline-offset:-2px}.k-lab-input-examples-focus .k-lab-example-canvas>.k-button{margin-top:var(--spacing-6)}.k-lab-helpers-examples .k-lab-example .k-text{margin-bottom:var(--spacing-6)}.k-lab-helpers-examples h2{margin-bottom:var(--spacing-3);font-weight:var(--font-bold)}:root{--highlight-punctuation: var(--color-gray-500);--highlight-variable: var(--color-red-500);--highlight-constant: var(--color-orange-500);--highlight-keyword: var(--color-purple-500);--highlight-function: var(--color-blue-500);--highlight-operator: var(--color-aqua-500);--highlight-string: var(--color-green-500);--highlight-scope: var(--color-yellow-500)}.k-panel[data-theme=dark]{--highlight-punctuation: var(--color-gray-700);--highlight-variable: var(--color-red-700);--highlight-constant: var(--color-orange-700);--highlight-keyword: var(--color-purple-700);--highlight-function: var(--color-blue-700);--highlight-operator: var(--color-aqua-700);--highlight-string: var(--color-green-700);--highlight-scope: var(--color-yellow-700)}.token.punctuation,.token.comment,.token.doctype,.token.title .punctuation{color:var(--highlight-punctuation)}.token.tag,.token.markup,.token.variable,.token.this,.token.selector,.token.key,.token.kirbytag-bracket,.token.prolog,.token.delimiter{color:var(--highlight-variable)}.token.constant,.token.number,.token.boolean,.token.boolean.important,.token.attr-name,.token.kirbytag-attr,.token.kirbytag-name,.token.entity,.token.bold,.token.bold>.punctuation{color:var(--highlight-constant)}.token.keyword,.token.italic,.token.italic>.punctuation{color:var(--highlight-keyword)}.token.function{color:var(--highlight-function)}.token.operator,.token.title{color:var(--highlight-operator)}.token.string,.token.attr-value,.token.attr-value .punctuation,.token.list.punctuation{color:var(--highlight-string)}.token.scope,.token.class-name,.token.property,.token.url{color:var(--highlight-scope)}.token.title,.token.kirbytag-bracket,.token.list.punctuation,.token.bold{font-weight:var(--font-bold)}.token.italic{font-style:italic} diff --git a/panel/dist/img/icons.svg b/panel/dist/img/icons.svg index 4ac88fe8b5..8ea8e714b4 100644 --- a/panel/dist/img/icons.svg +++ b/panel/dist/img/icons.svg @@ -36,6 +36,9 @@ + + + @@ -131,6 +134,9 @@ + + + @@ -179,6 +185,9 @@ + + + @@ -359,6 +368,15 @@ + + + + + + + + + @@ -643,6 +661,9 @@ + + + diff --git a/panel/dist/js/index.min.js b/panel/dist/js/index.min.js index c89bffd9cf..459700b5e9 100644 --- a/panel/dist/js/index.min.js +++ b/panel/dist/js/index.min.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./IndexView.min.js","./vendor.min.js","./DocsView.min.js","./Docs.min.js","./PlaygroundView.min.js","./Highlight.min.js"])))=>i.map(i=>d[i]); -var t=Object.defineProperty;import{I as e,P as s,S as i,F as n,N as o,s as r,l as a,w as l,a as c,b as u,c as p,e as d,t as h,d as m,f,g,h as k,i as b,k as y,D as v,j as $,E as x,m as w,n as _,o as S,T as C,u as O,p as A,q as M,r as D,v as j,x as E,y as T,z as I,A as L,B,C as q,G as P,H as N}from"./vendor.min.js";const F={created(){this.$panel.events.subscribe();for(const t of this.$panel.plugins.created)t(this);this.$panel.events.on("popstate",(()=>{this.$panel.open(window.location.href)})),this.$panel.events.on("drop",(()=>{this.$panel.drag.stop()})),this.$store.dispatch("content/init")},destroyed(){this.$panel.events.unsubscribe()},render(t){if(this.$panel.view.component)return t(this.$panel.view.component,{key:this.$panel.view.component,props:this.$panel.view.props})}},z={props:{after:String}},Y={props:{autocomplete:String}},R={props:{autofocus:Boolean}},V={props:{before:String}},H={props:{disabled:Boolean}},U={props:{font:String}},K={props:{help:String}},W={props:{id:{type:[Number,String],default(){return this._uid}}}},J={props:{label:String}},G={props:{layout:{type:String,default:"list"}}},X={props:{maxlength:Number}},Z={props:{minlength:Number}},Q={props:{name:[Number,String]}},tt={props:{options:{default:()=>[],type:Array}}},et={props:{pattern:String}},st={props:{placeholder:[Number,String]}},it={props:{required:Boolean}},nt={props:{spellcheck:{type:Boolean,default:!0}}};function ot(t,e,s,i,n,o,r,a){var l="function"==typeof t?t.options:t;return e&&(l.render=e,l.staticRenderFns=s,l._compiled=!0),{exports:t,options:l}}const rt={mixins:[G],inheritAttrs:!1,props:{columns:{type:[Object,Array],default:()=>({})},fields:{type:Object,default:()=>({})},items:{type:Array,default:()=>[]},link:{type:Boolean,default:!0},sortable:Boolean,size:{type:String,default:"medium"},theme:String}};const at=ot({mixins:[rt],props:{image:{type:[Object,Boolean],default:()=>({})}},emits:["change","hover","item","option","sort"],computed:{dragOptions(){return{sort:this.sortable,disabled:!1===this.sortable,draggable:".k-draggable-item"}},table(){return{columns:this.columns,fields:this.fields,rows:this.items,sortable:this.sortable}}},methods:{onDragStart(t,e){this.$panel.drag.start("text",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({class:t.$attrs.class,style:t.$attrs.style,on:{change:function(e){return t.$emit("change",e)},sort:function(e){return t.$emit("sort",e)},option:t.onOption},scopedSlots:t._u([t.$scopedSlots.options?{key:"options",fn:function({row:e,rowIndex:s}){return[t._t("options",null,null,{item:e,index:s})]}}:null],null,!0)},"k-table",t.table,!1)):e("k-draggable",{class:["k-items","k-"+t.layout+"-items",t.$attrs.class],style:t.$attrs.style,attrs:{"data-layout":t.layout,"data-size":t.size,handle:!0,list:t.items,options:t.dragOptions},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[t._t("default",(function(){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,theme:t.theme,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,index:i})]},proxy:!0}],null,!0)},"k-item",s,!1))]}),null,{item:s,itemIndex:i})]}))],2)}),[]).exports;const lt=ot({mixins:[rt],props:{empty:{type:Object,default:()=>({})},help:String,pagination:{type:[Boolean,Object],default:!1}},emits:["action","change","empty","item","option","paginate","sort"],computed:{hasPagination(){return!1!==this.pagination&&(!0!==this.paginationOptions.hide&&!(this.pagination.total<=this.pagination.limit))},listeners(){return this.$listeners.empty?{click:this.onEmpty}:{}},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"},[0===t.items.length?e("k-empty",t._g(t._b({attrs:{layout:t.layout}},"k-empty",t.empty,!1),t.listeners)):e("k-items",t._b({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,index:s}){return[t._t("options",null,null,{item:e,index:s})]}}],null,!0)},"k-items",{columns:t.columns,fields:t.fields,items:t.items,layout:t.layout,link:t.link,size:t.size,sortable:t.sortable,theme:t.theme},!1)),t.help||t.hasPagination?e("footer",{staticClass:"k-collection-footer"},[e("k-text",{staticClass:"k-help k-collection-help",attrs:{html:t.help}}),t.hasPagination?e("k-pagination",t._b({on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.paginationOptions,!1)):t._e()],1):t._e()],1)}),[]).exports;const ct=ot({mixins:[G],props:{text:String,icon:String},emits:["click"],computed:{attrs(){const t={button:void 0!==this.$listeners.click,icon:this.icon,theme:"empty"};return"cardlets"!==this.layout&&"cards"!==this.layout||(t.align="center",t.height="var(--item-height-cardlet)"),t}}},(function(){var t=this;return(0,t._self._c)("k-box",t._b({staticClass:"k-empty",nativeOn:{click:function(e){return t.$emit("click",e)}}},"k-box",t.attrs,!1),[t._t("default",(function(){return[t._v(" "+t._s(t.text)+" ")]}))],2)}),[]).exports,ut={mixins:[G],props:{image:[Object,Boolean],width:{type:String,default:"1/1"}}};const pt=ot({mixins:[ut],inheritAttrs:!1,computed:{attrs(){return{back:this.image.back??"gray-500",cover:!0,...this.image,ratio:"list"===this.layout?"auto":this.image.ratio,size:this.sizes}},component(){return this.image.src?"k-image-frame":"k-icon-frame"},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;return(0,t._self._c)(t.component,t._b({tag:"component",class:["k-item-image",t.$attrs.class],style:t.$attrs.style},"component",t.attrs,!1))}),[]).exports;const dt=ot({mixins:[ut,G],inheritAttrs:!1,props:{buttons:{type:Array,default:()=>[]},data:Object,info:String,link:{type:[Boolean,String,Function]},options:{type:[Array,Function,String]},sortable:Boolean,target:String,text:String,theme:String},emits:["action","click","drag","option"],computed:{hasFigure(){return!1!==this.image&&this.$helper.object.length(this.image)>0}},methods:{onOption(t){this.$emit("action",t),this.$emit("option",t)},title(t){return this.$helper.string.stripHTML(this.$helper.string.unescapeHTML(t)).trim()}}},(function(){var t,e,s=this,i=s._self._c;return i("div",s._b({class:["k-item",`k-${s.layout}-item`,s.$attrs.class],style:s.$attrs.style,attrs:{"data-has-image":s.hasFigure,"data-layout":s.layout,"data-theme":s.theme},on:{click:function(t){return s.$emit("click",t)},dragstart:function(t){return s.$emit("drag",t)}}},"div",s.data,!1),[s._t("image",(function(){return[s.hasFigure?i("k-item-image",{attrs:{image:s.image,layout:s.layout,width:s.width}}):s._e()]})),s.sortable?i("k-sort-handle",{staticClass:"k-item-sort-handle",attrs:{tabindex:"-1"}}):s._e(),i("div",{staticClass:"k-item-content"},[i("h3",{staticClass:"k-item-title",attrs:{title:s.title(s.text)}},[!1!==s.link?i("k-link",{attrs:{target:s.target,to:s.link}},[i("span",{domProps:{innerHTML:s._s(s.text??"–")}})]):i("span",{domProps:{innerHTML:s._s(s.text??"–")}})],1),s.info?i("p",{staticClass:"k-item-info",attrs:{title:s.title(s.info)},domProps:{innerHTML:s._s(s.info)}}):s._e()]),(null==(t=s.buttons)?void 0:t.length)||s.options||s.$slots.options?i("div",{staticClass:"k-item-options",attrs:{"data-only-option":!(null==(e=s.buttons)?void 0:e.length)||!s.options&&!s.$slots.options}},[s._l(s.buttons,(function(t,e){return i("k-button",s._b({key:"button-"+e},"k-button",t,!1))})),s._t("options",(function(){return[s.options?i("k-options-dropdown",{staticClass:"k-item-options-dropdown",attrs:{options:s.options},on:{option:s.onOption}}):s._e()]}))],2):s._e()],2)}),[]).exports,ht={install(t){t.component("k-collection",lt),t.component("k-empty",ct),t.component("k-item",dt),t.component("k-item-image",pt),t.component("k-items",at)}};const mt=ot({},(function(){return(0,this._self._c)("div",{staticClass:"k-dialog-body"},[this._t("default")],2)}),[]).exports;function ft(t){if(void 0!==t)return structuredClone(t)}function gt(t){return"object"==typeof t&&(null==t?void 0:t.constructor)===Object}function kt(t){return Object.keys(t??{}).length}function bt(t){return Object.keys(t).reduce(((e,s)=>(e[s.toLowerCase()]=t[s],e)),{})}const yt={clone:ft,isEmpty:function(t){return null==t||""===t||(!(!gt(t)||0!==kt(t))||0===t.length)},isObject:gt,length:kt,merge:function t(e,s={}){for(const i in s)s[i]instanceof Object&&Object.assign(s[i],t(e[i]??{},s[i]));return Object.assign(e??{},s),e},same:function(t,e){return JSON.stringify(t)===JSON.stringify(e)},toLowerKeys:bt},vt={props:{cancelButton:{default:!0,type:[Boolean,String,Object]},disabled:{default:!1,type:Boolean},icon:{default:"check",type:String},submitButton:{type:[Boolean,String,Object],default:!0},theme:{default:"positive",type:String}}};const $t=ot({mixins:[vt],emits:["cancel"],computed:{cancel(){return this.button(this.cancelButton,{click:()=>this.$emit("cancel"),class:"k-dialog-button-cancel",icon:"cancel",text:this.$t("cancel"),variant:"filled"})},submit(){return this.button(this.submitButton,{class:"k-dialog-button-submit",disabled:this.disabled||this.$panel.dialog.isLoading,icon:this.icon,text:this.$t("confirm"),theme:this.theme,type:"submit",variant:"filled"})}},methods:{button:(t,e)=>"string"==typeof t?{...e,text:t}:!1!==t&&(!1===gt(t)?e:{...e,...t})}},(function(){var t=this,e=t._self._c;return e("k-button-group",{staticClass:"k-dialog-buttons"},[t.cancel?e("k-button",t._b({},"k-button",t.cancel,!1)):t._e(),t.submit?e("k-button",t._b({attrs:{icon:t.$panel.dialog.isLoading?"loader":t.submit.icon}},"k-button",t.submit,!1)):t._e()],1)}),[]).exports,xt={props:{empty:{default:()=>window.panel.$t("dialog.fields.empty"),type:String},fields:{default:()=>[],type:[Array,Object]},value:{default:()=>({}),type:Object}}};const wt=ot({mixins:[xt],emits:["input","submit"],computed:{hasFields(){return this.$helper.object.length(this.fields)>0}}},(function(){var t=this,e=t._self._c;return t.hasFields?e("k-fieldset",{staticClass:"k-dialog-fields",attrs:{fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[]).exports;const _t=ot({},(function(){return(0,this._self._c)("footer",{staticClass:"k-dialog-footer"},[this._t("default")],2)}),[]).exports;const St=ot({},(function(){var t=this,e=t._self._c;return"dialog"===t.$panel.notification.context?e("k-notification",{staticClass:"k-dialog-notification"}):t._e()}),[]).exports;const Ct=ot({props:{autofocus:{default:!0,type:Boolean},placeholder:{type:String},value:{type:String}},emits:["search"]},(function(){var t=this;return(0,t._self._c)("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:t.autofocus,placeholder:t.placeholder,value:t.value,icon:"search",type:"search"},on:{input:function(e){return t.$emit("search",e)}}})}),[]).exports,Ot={props:{empty:{type:String,default:()=>window.panel.$t("dialog.text.empty")},text:{type:String}}};const At=ot({mixins:[Ot]},(function(){var t=this,e=t._self._c;return t.text?e("k-text",{attrs:{html:t.text}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[]).exports,Mt={install(t){t.component("k-dialog-body",mt),t.component("k-dialog-buttons",$t),t.component("k-dialog-fields",wt),t.component("k-dialog-footer",_t),t.component("k-dialog-notification",St),t.component("k-dialog-search",Ct),t.component("k-dialog-text",At)}},Dt={mixins:[vt],props:{size:{default:"default",type:String},visible:{default:!1,type:Boolean}},emits:["cancel","close","input","submit","success"],methods:{cancel(){this.$emit("cancel")},close(){this.$emit("close")},error(t){this.$panel.notification.error(t)},focus(t){this.$panel.dialog.focus(t)},input(t){this.$emit("input",t)},open(){this.$panel.dialog.open(this)},submit(){this.$emit("submit",this.value)},success(t){this.$emit("success",t)}}};const jt=ot({mixins:[Dt]},(function(){var t=this,e=t._self._c;return t.visible?e("portal",{attrs:{to:"dialog"}},[e("form",{class:["k-dialog",t.$vnode.data.class,t.$vnode.data.staticClass,t.$attrs.class],attrs:{"data-has-footer":t.cancelButton||t.submitButton,"data-size":t.size,method:"dialog"},on:{click:function(t){t.stopPropagation()},submit:function(e){return e.preventDefault(),t.$emit("submit")}}},[t._t("header",(function(){return[e("k-dialog-notification")]})),t.$slots.default?e("k-dialog-body",[t._t("default")],2):t._e(),t._t("footer",(function(){return[t.cancelButton||t.submitButton?e("k-dialog-footer",[e("k-dialog-buttons",{attrs:{"cancel-button":t.cancelButton,disabled:t.disabled,icon:t.icon,"submit-button":t.submitButton,theme:t.theme},on:{cancel:function(e){return t.$emit("cancel")}}})],1):t._e()]}))],2)]):t._e()}),[]).exports;const Et=ot({mixins:[Dt],props:{cancelButton:{default:!1},changes:{type:Array},loading:{type:Boolean},size:{default:"medium"},submitButton:{default:!1}},computed:{ids(){return Object.keys(this.store).filter((t=>{var e;return this.$helper.object.length(null==(e=this.store[t])?void 0:e.changes)>0}))},store(){return this.$store.state.content.models}},watch:{ids:{handler(t){this.$panel.dialog.refresh({method:"POST",body:{ids:t}})},immediate:!0}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({staticClass:"k-changes-dialog"},"k-dialog",t.$props,!1),[!1===t.loading?[e("k-headline",[t._v(t._s(t.$t("lock.unsaved")))]),t.changes.length?e("k-items",{attrs:{items:t.changes,layout:"list"}}):e("k-empty",{attrs:{icon:"edit-line"}},[t._v(t._s(t.$t("lock.unsaved.empty")))])]:[e("k-icon",{attrs:{type:"loader"}})]],2)}),[]).exports;const Tt=ot({mixins:[Dt,xt],props:{fields:{default:()=>({href:{label:window.panel.$t("email"),type:"email",icon:"email"},title:{label:window.panel.$t("title"),type:"text",icon:"title"}})},size:{default:"medium"},submitButton:{default:()=>window.panel.$t("insert")}},data(){return{values:{href:"",title:null,...this.value}}},methods:{submit(){this.$emit("submit",this.values)}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",t._b({attrs:{value:t.values},on:{cancel:function(e){return t.$emit("cancel")},input:function(e){t.values=e},submit:t.submit}},"k-form-dialog",t.$props,!1))}),[]).exports;const It=ot({mixins:[Dt],props:{details:[Object,Array],message:String,size:{default:"medium",type:String}},emits:["cancel"],computed:{detailsList(){return this.$helper.array.fromObject(this.details)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-error-dialog",attrs:{"cancel-button":!1,"submit-button":!1,size:t.size,visible:t.visible},on:{cancel:function(e){return t.$emit("cancel")}}},[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)}),[]).exports;const Lt=ot({},(function(){var t=this;return(0,t._self._c)(t.$panel.dialog.component,t._g(t._b({key:t.$panel.dialog.timestamp,tag:"component",attrs:{visible:!0}},"component",t.$panel.dialog.props,!1),t.$panel.dialog.listeners()))}),[]).exports,Bt=(t,e)=>{let s=null;return(...i)=>{clearTimeout(s),s=setTimeout((()=>t.apply(void 0,i)),e)}},qt={props:{delay:{default:200,type:Number},hasSearch:{default:!0,type:Boolean}},data:()=>({query:""}),watch:{query(){!1!==this.hasSearch&&this.search()}},created(){this.search=Bt(this.search,this.delay)},methods:{async search(){console.warn("Search mixin: Please implement a `search` method.")}}},Pt={props:{endpoint:String,empty:Object,fetchParams:Object,item:{type:Function,default:t=>t},max:Number,multiple:{type:Boolean,default:!0},size:{type:String,default:"medium"},value:{type:Array,default:()=>[]}}};const Nt=ot({mixins:[Dt,qt,Pt],emits:["cancel","fetched","submit"],data(){return{models:[],selected:this.value.reduce(((t,e)=>({...t,[e]:{id:e}})),{}),pagination:{limit:20,page:1,total:0}}},computed:{items(){return this.models.map(this.item)}},watch:{fetchParams(t,e){!1===this.$helper.object.same(t,e)&&(this.pagination.page=1,this.fetch())}},mounted(){this.fetch()},methods:{async fetch(){const t={page:this.pagination.page,search:this.query,...this.fetchParams};try{this.$panel.dialog.isLoading=!0;const e=await this.$api.get(this.endpoint,t);this.models=e.data,this.pagination=e.pagination,this.$emit("fetched",e)}catch(e){this.$panel.error(e),this.models=[]}finally{this.$panel.dialog.isLoading=!1}},isSelected(t){return void 0!==this.selected[t.id]},paginate(t){this.pagination.page=t.page,this.pagination.limit=t.limit,this.fetch()},submit(){this.$emit("submit",Object.values(this.selected))},async search(){this.pagination.page=0,await this.fetch()},toggle(t){if(!1!==this.multiple&&1!==this.max||(this.selected={}),this.isSelected(t))return Vue.del(this.selected,t.id);this.max&&this.max<=this.$helper.object.length(this.selected)||Vue.set(this.selected,t.id,t)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({staticClass:"k-models-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},"k-dialog",t.$props,!1),[t._t("header"),t.hasSearch?e("k-dialog-search",{attrs:{value:t.query},on:{search:function(e){t.query=e}}}):t._e(),e("k-collection",{attrs:{empty:{...t.empty,text:t.$panel.dialog.isLoading?t.$t("loading"):t.empty.text},items:t.items,link:!1,pagination:{details:!0,dropdown:!1,align:"center",...t.pagination},sortable:!1,layout:"list"},on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:s}){return[e("k-choice-input",{attrs:{checked:t.isSelected(s),type:t.multiple&&1!==t.max?"checkbox":"radio",title:t.isSelected(s)?t.$t("remove"):t.$t("select")},on:{click:function(e){return e.stopPropagation(),t.toggle(s)}}}),t._t("options",null,null,{item:s})]}}],null,!0)})],2)}),[]).exports;const Ft=ot({mixins:[Dt,Pt],props:{empty:{type:Object,default:()=>({icon:"image",text:window.panel.$t("dialog.files.empty")})}}},(function(){var t=this;return(0,t._self._c)("k-models-dialog",t._b({on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",e)}}},"k-models-dialog",t.$props,!1))}),[]).exports;const zt=ot({mixins:[Dt,xt],props:{size:{default:"medium"},submitButton:{default:()=>window.panel.$t("save")},text:{type:String}},emits:["cancel","input","submit"]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-dialog",t.$props,!1),[t._t("default",(function(){return[t.text?e("k-dialog-text",{attrs:{text:t.text}}):t._e(),e("k-dialog-fields",{attrs:{fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})]}))],2)}),[]).exports;const Yt=ot({extends:zt,watch:{"value.name"(t){this.fields.code.disabled||this.onNameChanges(t)},"value.code"(t){this.fields.code.disabled||(this.value.code=this.$helper.slug(t,[this.$panel.system.ascii]),this.onCodeChanges(this.value.code))}},methods:{onCodeChanges(t){if(!t)return this.value.locale=null;if(t.length>=2)if(-1!==t.indexOf("-")){let e=t.split("-"),s=[e[0],e[1].toUpperCase()];this.value.locale=s.join("_")}else{let e=this.$panel.system.locales??[];this.value.locale=null==e?void 0:e[t]}},onNameChanges(t){this.value.code=this.$helper.slug(t,[this.value.rules,this.$panel.system.ascii]).substr(0,2)}}},null,null).exports;const Rt=ot({mixins:[{mixins:[Dt],props:{license:Object,size:{default:"large"}}}]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-license-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-bar",{staticStyle:{"margin-bottom":"var(--spacing-2)"}},[e("h2",{staticClass:"k-headline"},[t._v(" "+t._s(t.$t("license"))+" ")])]),e("div",{staticClass:"k-table"},[e("table",{staticStyle:{"table-layout":"auto"}},[e("tbody",[e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("type")))]),e("td",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.license.type))])]),t.license.code?e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("license.code")))]),e("td",{staticClass:"k-text",attrs:{"data-mobile":"true"}},[e("code",[t._v(t._s(t.license.code))])])]):t._e(),t.license.info?e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("status")))]),e("td",{attrs:{"data-mobile":"true","data-theme":t.license.theme}},[e("p",{staticClass:"k-license-dialog-status"},[e("k-icon",{attrs:{type:t.license.icon}}),t._v(" "+t._s(t.license.info)+" ")],1)])]):t._e()])])])],1)}),[]).exports;const Vt=ot({mixins:[Dt,xt],props:{fields:{default:()=>({href:{label:window.panel.$t("link"),type:"link",placeholder:window.panel.$t("url.placeholder"),icon:"url"},title:{label:window.panel.$t("title"),type:"text",icon:"title"},target:{label:window.panel.$t("open.newWindow"),type:"toggle",text:[window.panel.$t("no"),window.panel.$t("yes")]}})},size:{default:"medium"},submitButton:{default:()=>window.panel.$t("insert")}},data(){return{values:{href:"",title:null,...this.value,target:Boolean(this.value.target??!1)}}},methods:{submit(){const t=this.values.href.replace("file://","/@/file/").replace("page://","/@/page/");this.$emit("submit",{...this.values,href:t,target:this.values.target?"_blank":null})}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",t._b({attrs:{value:t.values},on:{cancel:function(e){return t.$emit("cancel")},input:function(e){t.values=e},submit:t.submit}},"k-form-dialog",t.$props,!1))}),[]).exports;const Ht=ot({mixins:[zt],props:{blueprints:{type:Array},size:{default:"medium",type:String},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("save")},template:{type:String}},computed:{templates(){return this.blueprints.map((t=>({text:t.title,value:t.name})))}},methods:{pick(t){this.$panel.dialog.reload({query:{...this.$panel.dialog.query,slug:this.value.slug,template:t,title:this.value.title}})}}},(function(){var t=this,e=t._self._c;return e("k-form-dialog",t._b({ref:"dialog",staticClass:"k-page-create-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-form-dialog",t.$props,!1),[t.templates.length>1?e("k-select-field",{staticClass:"k-page-template-switch",attrs:{empty:!1,label:t.$t("template"),options:t.templates,required:!0,value:t.template},on:{input:function(e){return t.pick(e)}}}):t._e(),e("k-dialog-fields",{attrs:{fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],1)}),[]).exports;const Ut=ot({mixins:[Dt],props:{value:{default:()=>({}),type:Object}},emits:["cancel","input","submit"],methods:{select(t){this.$emit("input",{...this.value,parent:t.value})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-page-move-dialog",attrs:{"submit-button":{icon:"parent",text:t.$t("move")},size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-dialog",t.$props,!1),[e("k-headline",[t._v(t._s(t.$t("page.move")))]),e("div",{staticClass:"k-page-move-parent",attrs:{tabindex:"0","data-autofocus":""}},[e("k-page-tree",{attrs:{current:t.value.parent,move:t.value.move,identifier:"id"},on:{select:t.select}})],1)],1)}),[]).exports;const Kt=ot({mixins:[Dt,Pt],props:{empty:{type:Object,default:()=>({icon:"page",text:window.panel.$t("dialog.pages.empty")})}},data:()=>({model:null,parent:null})},(function(){var t=this,e=t._self._c;return e("k-models-dialog",t._b({attrs:{"fetch-params":{parent:t.parent}},on:{cancel:function(e){return t.$emit("cancel")},fetched:function(e){t.model=e.model},submit:function(e){return t.$emit("submit",e)}},scopedSlots:t._u([t.model?{key:"header",fn:function(){return[e("header",{staticClass:"k-pages-dialog-navbar"},[e("k-button",{attrs:{disabled:!t.model.id,title:t.$t("back"),icon:"angle-left"},on:{click:function(e){t.parent=t.model.parent}}}),e("k-headline",[t._v(t._s(t.model.title))])],1)]},proxy:!0}:null,t.model?{key:"options",fn:function({item:s}){return[e("k-button",{staticClass:"k-pages-dialog-option",attrs:{disabled:!s.hasChildren,title:t.$t("open"),icon:"angle-right"},on:{click:function(e){e.stopPropagation(),t.parent=s.id}}})]}}:null],null,!0)},"k-models-dialog",t.$props,!1))}),[]).exports;const Wt=ot({mixins:[{mixins:[Dt,Ot]}]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[t._t("default",(function(){return[e("k-dialog-text",{attrs:{text:t.text}})]}))],2)}),[]).exports;const Jt=ot({mixins:[Wt],props:{icon:{default:"trash"},submitButton:{default:()=>window.panel.$t("delete")},theme:{default:"negative"}}},(function(){var t=this;return(0,t._self._c)("k-text-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-text-dialog",t.$props,!1),[t._t("default")],2)}),[]).exports;const Gt=ot({mixins:[Dt],props:{type:String},emits:["cancel"],data:()=>({results:null,pagination:{}}),methods:{focus(){var t;null==(t=this.$refs.search)||t.focus()},navigate(t){t&&(this.$go(t.link),this.close())},async search({type:t,query:e}){const s=await this.$panel.search(t,e);s&&(this.results=s.results,this.pagination=s.pagination)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{staticClass:"k-search-dialog",attrs:{"cancel-button":!1,"submit-button":!1,visible:!0,role:"search",size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[e("k-search-bar",{ref:"search",attrs:{"default-type":t.type??t.$panel.view.search,"is-loading":t.$panel.searcher.isLoading,pagination:t.pagination,results:t.results,types:t.$panel.searches},on:{close:t.close,more:function(e){return t.$go("search",{query:e})},navigate:t.navigate,search:t.search}})],1)}),[]).exports;const Xt=ot({mixins:[{mixins:[Dt,xt]}],props:{fields:null,qr:{type:String,required:!0},size:{default:"large"},submitButton:{default:()=>({text:window.panel.$t("activate"),icon:"lock",theme:"notice"})}},emits:["cancel","input","submit"]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-dialog-text",{staticClass:"k-totp-dialog-intro",attrs:{text:t.$t("login.totp.enable.intro")}}),e("div",{staticClass:"k-totp-dialog-grid"},[e("div",{staticClass:"k-totp-qrcode"},[e("k-info-field",{attrs:{label:t.$t("login.totp.enable.qr.label"),text:t.qr,help:t.$t("login.totp.enable.qr.help",{secret:t.value.secret}),theme:"passive"}})],1),e("k-dialog-fields",{staticClass:"k-totp-dialog-fields",attrs:{fields:{info:{label:t.$t("login.totp.enable.confirm.headline"),type:"info",text:t.$t("login.totp.enable.confirm.text"),theme:"none"},confirm:{label:t.$t("login.totp.enable.confirm.label"),type:"text",counter:!1,font:"monospace",required:!0,placeholder:t.$t("login.code.placeholder.totp"),help:t.$t("login.totp.enable.confirm.help")},secret:{type:"hidden"}},value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],1)],1)}),[]).exports;const Zt=ot({mixins:[Dt],props:{submitButton:{type:[String,Boolean,Object],default:()=>({icon:"upload",text:window.panel.$t("upload")})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-upload-dialog",attrs:{disabled:t.disabled||0===t.$panel.upload.files.length},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-dropzone",{on:{drop:function(e){return t.$panel.upload.select(e)}}},[0===t.$panel.upload.files.length?e("k-empty",{attrs:{icon:"upload",layout:"cards"},on:{click:function(e){return t.$panel.upload.pick()}}},[t._v(" "+t._s(t.$t("files.empty"))+" ")]):e("k-upload-items",{attrs:{items:t.$panel.upload.files},on:{remove:e=>{t.$panel.upload.remove(e.id)},rename:(t,e)=>{t.name=e}}})],1)],1)}),[]).exports;const Qt=ot({extends:Zt,props:{original:Object,submitButton:{type:[String,Boolean,Object],default:()=>({icon:"upload",text:window.panel.$t("replace")})}},computed:{file(){return this.$panel.upload.files[0]}}},(function(){var t,e,s,i,n=this,o=n._self._c;return o("k-dialog",n._b({ref:"dialog",staticClass:"k-upload-dialog k-upload-replace-dialog",on:{cancel:function(t){return n.$emit("cancel")},submit:function(t){return n.$emit("submit")}}},"k-dialog",n.$props,!1),[o("ul",{staticClass:"k-upload-items"},[o("li",{staticClass:"k-upload-original"},[o("k-upload-item-preview",{attrs:{color:null==(t=n.original.image)?void 0:t.color,icon:null==(e=n.original.image)?void 0:e.icon,url:n.original.url,type:n.original.mime}})],1),o("li",[n._v("←")]),o("k-upload-item",n._b({attrs:{color:null==(s=n.original.image)?void 0:s.color,editable:!1,icon:null==(i=n.original.image)?void 0:i.icon,name:n.$helper.file.name(n.original.filename),removable:!1}},"k-upload-item",n.file,!1))],1)])}),[]).exports;const te=ot({mixins:[Dt,Pt],props:{empty:{type:Object,default:()=>({icon:"users",text:window.panel.$t("dialog.users.empty")})},item:{type:Function,default:t=>({...t,key:t.email,info:t.info!==t.text?t.info:null})}}},(function(){var t=this;return(0,t._self._c)("k-models-dialog",t._b({on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",e)}}},"k-models-dialog",t.$props,!1))}),[]).exports,ee={install(t){t.use(Mt),t.component("k-dialog",jt),t.component("k-changes-dialog",Et),t.component("k-email-dialog",Tt),t.component("k-error-dialog",It),t.component("k-fiber-dialog",Lt),t.component("k-files-dialog",Ft),t.component("k-form-dialog",zt),t.component("k-license-dialog",Rt),t.component("k-link-dialog",Vt),t.component("k-language-dialog",Yt),t.component("k-models-dialog",Nt),t.component("k-page-create-dialog",Ht),t.component("k-page-move-dialog",Ut),t.component("k-pages-dialog",Kt),t.component("k-remove-dialog",Jt),t.component("k-search-dialog",Gt),t.component("k-text-dialog",Wt),t.component("k-totp-dialog",Xt),t.component("k-upload-dialog",Zt),t.component("k-upload-replace-dialog",Qt),t.component("k-users-dialog",te)}};const se=ot({},(function(){return(0,this._self._c)("div",{staticClass:"k-drawer-body scroll-y-auto"},[this._t("default")],2)}),[]).exports,ie={props:{empty:{type:String,default:()=>window.panel.$t("drawer.fields.empty")},fields:Object,value:Object}};const ne=ot({mixins:[ie],emits:["input","submit"],computed:{hasFields(){return this.$helper.object.length(this.fields)>0}}},(function(){var t=this,e=t._self._c;return t.hasFields?e("k-fieldset",{staticClass:"k-drawer-fields",attrs:{fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[]).exports,oe={props:{breadcrumb:{default:()=>[],type:Array},tab:{type:String},tabs:{default:()=>({}),type:Object}}};const re=ot({mixins:[oe],emits:["crumb","tab"]},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-drawer-header"},[e("nav",{staticClass:"k-breadcrumb k-drawer-breadcrumb"},[e("ol",t._l(t.breadcrumb,(function(s,i){return e("li",{key:s.id},[e("k-button",{staticClass:"k-breadcrumb-link",attrs:{icon:s.props.icon,text:s.props.title,current:i===t.breadcrumb.length-1,variant:"dimmed"},on:{click:function(e){return t.$emit("crumb",s.id)}}})],1)})),0)]),e("k-drawer-tabs",{attrs:{tab:t.tab,tabs:t.tabs},on:{open:function(e){return t.$emit("tab",e)}}}),e("nav",{staticClass:"k-drawer-options"},[t._t("default"),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"check",type:"submit"}})],2)],1)}),[]).exports;const ae=ot({},(function(){var t=this,e=t._self._c;return"drawer"===t.$panel.notification.context?e("k-notification",{staticClass:"k-drawer-notification"}):t._e()}),[]).exports;const le=ot({mixins:[{props:{tab:{type:String},tabs:{default:()=>({}),type:[Array,Object]}}}],emits:["open"],computed:{hasTabs(){return this.$helper.object.length(this.tabs)>1}}},(function(){var t=this,e=t._self._c;return 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 t.$emit("open",s.name)}}})})),1):t._e()}),[]).exports,ce={props:{empty:{type:String,default:()=>window.panel.$t("drawer.text.empty")},text:{type:String}}};const ue=ot({mixins:[ce]},(function(){var t=this,e=t._self._c;return t.text?e("k-text",{attrs:{html:t.text}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[]).exports,pe={install(t){t.component("k-drawer-body",se),t.component("k-drawer-fields",ne),t.component("k-drawer-header",re),t.component("k-drawer-notification",ae),t.component("k-drawer-tabs",le),t.component("k-drawer-text",ue)}},de={mixins:[oe],props:{disabled:{default:!1,type:Boolean},icon:String,id:String,options:{type:Array},title:String,visible:{default:!1,type:Boolean}}};const he=ot({mixins:[de],emits:["cancel","crumb","submit","tab"]},(function(){var t=this,e=t._self._c;return t.visible?e("portal",{attrs:{to:"drawer"}},[e("form",{staticClass:"k-drawer",class:t.$vnode.data.staticClass,attrs:{"aria-disabled":t.disabled,method:"dialog"},on:{submit:function(e){return e.preventDefault(),t.$emit("submit")}}},[e("k-drawer-notification"),e("k-drawer-header",{attrs:{breadcrumb:t.breadcrumb,tab:t.tab,tabs:t.tabs},on:{crumb:function(e){return t.$emit("crumb",e)},tab:function(e){return t.$emit("tab",e)}}},[t._t("options",(function(){return[t._l(t.options,(function(s,i){return[s.dropdown?[e("k-button",t._b({key:"btn-"+i,staticClass:"k-drawer-option",on:{click:function(e){t.$refs["dropdown-"+i][0].toggle()}}},"k-button",s,!1)),e("k-dropdown-content",{key:"dropdown-"+i,ref:"dropdown-"+i,refInFor:!0,attrs:{options:s.dropdown,"align-x":"end",theme:"light"}})]:e("k-button",t._b({key:i,staticClass:"k-drawer-option"},"k-button",s,!1))]}))]}))],2),e("k-drawer-body",[t._t("default")],2)],1)]):t._e()}),[]).exports,me={props:{hidden:{type:Boolean},next:{type:Object},prev:{type:Object}}};const fe=ot({mixins:[de,ie,me],emits:["cancel","crumb","input","next","prev","remove","show","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-form-drawer",t._b({ref:"drawer",staticClass:"k-block-drawer",on:{cancel:function(e){return t.$emit("cancel",e)},crumb:function(e){return t.$emit("crumb",e)},input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)},tab:function(e){return t.$emit("tab",e)}},scopedSlots:t._u([{key:"options",fn:function(){return[t.hidden?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 t.$emit("prev")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return t.$emit("next")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return t.$emit("remove")}}})]},proxy:!0}])},"k-form-drawer",t.$props,!1))}),[]).exports;const ge=ot({methods:{isCurrent(t){return this.$panel.drawer.id===t}}},(function(){var t=this,e=t._self._c;return e("div",t._l(t.$panel.drawer.history.milestones,(function(s){return e(s.component,t._g(t._b({key:s.id,tag:"component",attrs:{breadcrumb:t.$panel.drawer.breadcrumb,disabled:!1===t.isCurrent(s.id),visible:!0}},"component",t.isCurrent(s.id)?t.$panel.drawer.props:s.props,!1),t.isCurrent(s.id)?t.$panel.drawer.listeners():s.on))})),1)}),[]).exports;const ke=ot({mixins:[de,ie],emits:["cancel","crumb","input","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-drawer",t._b({ref:"drawer",staticClass:"k-form-drawer",on:{cancel:function(e){return t.$emit("cancel")},crumb:function(e){return t.$emit("crumb",e)},submit:function(e){return t.$emit("submit",t.value)},tab:function(e){return t.$emit("tab",e)}}},"k-drawer",t.$props,!1),[t._t("options",null,{slot:"options"}),e("k-drawer-fields",{attrs:{fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],2)}),[]).exports;const be=ot({mixins:[de,ie,{props:{next:{type:Object},prev:{type:Object}}}],emits:["cancel","crumb","input","next","prev","remove","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-form-drawer",t._b({ref:"drawer",staticClass:"k-structure-drawer",on:{cancel:function(e){return t.$emit("cancel",e)},crumb:function(e){return t.$emit("crumb",e)},input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)},tab:function(e){return t.$emit("tab",e)}},scopedSlots:t._u([{key:"options",fn:function(){return[e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.prev,icon:"angle-left"},on:{click:function(e){return t.$emit("prev")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return t.$emit("next")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return t.$emit("remove")}}})]},proxy:!0}])},"k-form-drawer",t.$props,!1))}),[]).exports;const ye=ot({mixins:[de,ce],emits:["cancel","crumb","input","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-drawer",t._b({ref:"drawer",staticClass:"k-text-drawer",on:{cancel:function(e){return t.$emit("cancel")},crumb:function(e){return t.$emit("crumb",e)},submit:function(e){return t.$emit("submit",t.value)},tab:function(e){return t.$emit("tab",e)}}},"k-drawer",t.$props,!1),[t._t("options",null,{slot:"options"}),e("k-dialog-text",{attrs:{text:t.text}})],2)}),[]).exports,ve={install(t){t.use(pe),t.component("k-drawer",he),t.component("k-block-drawer",fe),t.component("k-fiber-drawer",ge),t.component("k-form-drawer",ke),t.component("k-structure-drawer",be),t.component("k-text-drawer",ye)}};let $e=null;const xe=ot({props:{align:{type:String},alignX:{type:String,default:"start"},alignY:{type:String,default:"bottom"},disabled:{type:Boolean,default:!1},navigate:{default:!0,type:Boolean},options:[Array,Function,String],theme:{type:String,default:"dark"}},emits:["action","close","open"],data(){return{axis:{x:this.alignX,y:this.alignY},position:{x:0,y:0},isOpen:!1,items:[],opener:null}},mounted(){this.align&&window.panel.deprecated(": `align` prop will be removed in a future version. Use the `alignX` prop instead.")},methods:{close(){var t;null==(t=this.$refs.dropdown)||t.close()},async fetchOptions(t){return this.options?"string"==typeof this.options?this.$dropdown(this.options)(t):"function"==typeof this.options?this.options(t):Array.isArray(this.options)?t(this.options):void 0:t(this.items)},focus(t=0){this.$refs.navigate.focus(t)},onClick(){this.close()},onClose(){this.resetPosition(),this.isOpen=$e=!1,this.$emit("close"),window.removeEventListener("resize",this.setPosition)},async onOpen(){this.isOpen=!0;const t=window.scrollY;$e=this,await this.$nextTick(),this.$el&&this.opener&&(window.addEventListener("resize",this.setPosition),await this.setPosition(),window.scrollTo(0,t),this.$emit("open"))},onOptionClick(t){return this.close(),"function"==typeof t.click?t.click.call(this):"string"==typeof t.click?this.$emit("action",t.click):void(t.click&&(t.click.name&&this.$emit(t.click.name,t.click.payload),t.click.global&&this.$events.emit(t.click.global,t.click.payload)))},open(t){var e,s;if(!0===this.disabled)return!1;$e&&$e!==this&&$e.close(),this.opener=t??(null==(e=window.event)?void 0:e.target.closest("button"))??(null==(s=window.event)?void 0:s.target),this.fetchOptions((t=>{this.items=t,this.onOpen()}))},async setPosition(){this.axis={x:this.alignX??this.align,y:this.alignY},"right"===this.axis.x?this.axis.x="end":"left"===this.axis.x&&(this.axis.x="start"),"rtl"===this.$panel.direction&&("start"===this.axis.x?this.axis.x="end":"end"===this.axis.x&&(this.axis.x="start")),this.opener.$el&&(this.opener=this.opener.$el);const t=this.opener.getBoundingClientRect();this.position.x=t.left+window.scrollX+t.width,this.position.y=t.top+window.scrollY+t.height,!0!==this.$el.open&&this.$el.showModal(),await this.$nextTick();const e=this.$el.getBoundingClientRect(),s=10;"end"===this.axis.x?t.left-e.widthwindow.innerWidth-s&&e.width+se.top&&(this.axis.y="bottom"):t.top+e.height>window.innerHeight-s&&e.height+s[]},text:{type:[Boolean,String],default:!0},theme:{type:String,default:"dark"},size:String,variant:String},emits:["action","option"],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(t=this.$el){this.$refs.options.toggle(t)}}},(function(){var t=this,e=t._self._c;return t.hasSingleOption?e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{disabled:t.disabled,icon:t.options[0].icon??t.icon,size:t.options[0].size??t.size,title:t.options[0].title??t.options[0].tooltip??t.options[0].text,variant:t.options[0].variant??t.variant},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("div",{staticClass:"k-options-dropdown"},[e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{disabled:t.disabled,dropdown:!0,icon:t.icon,size:t.size,text:!0!==t.text&&!1!==t.text?t.text:null,title:t.$t("options"),variant:t.variant},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",staticClass:"k-options-dropdown-content",attrs:{"align-x":t.align,options:t.options},on:{action:t.onAction}})],1):t._e()}),[]).exports,Se={mixins:[R,H,W,Q,it]},Ce={mixins:[Se],inheritAttrs:!1,emits:["input"],methods:{focus(){this.$el.focus()}}},Oe={mixins:[R,H,tt,it],props:{ignore:{default:()=>[],type:Array},max:Number,min:Number,search:{default:!0,type:[Object,Boolean]}}},Ae={mixins:[Se,Oe],props:{create:{type:[Boolean,Object],default:!1},multiple:{type:Boolean,default:!0},value:{type:[Array,String],default:()=>[]}},emits:["create","escape","input"]};const Me=ot({mixins:[Ce,Ae],data(){return{display:this.search.display??!0,query:""}},computed:{choices(){let t=this.filteredOptions;return!0!==this.display&&(t=t.slice(0,this.display)),t.map((t=>({...t,disabled:t.disabled||this.isFull&&!1===this.value.includes(t.value),text:this.highlight(t.text)})))},filteredOptions(){if(!(this.query.length<(this.search.min??0)))return this.$helper.array.search(this.options,this.query,{field:"text"})},isFull(){return this.max&&this.value.length>=this.max},placeholder(){return this.search.placeholder?this.search.placeholder:this.options.length>0?this.$t("filter")+"…":this.$t("enter")+"…"},showCreate(){var t;if(!1===this.create)return!1;if(this.isFull)return!1;if(0===this.query.trim().length)return!1;if(!0===this.ignore.includes(this.query))return!1;if(!0===(null==(t=this.create.ignore)?void 0:t.includes(this.query)))return!1;return 0===this.options.filter((t=>t.text===this.query||t.value===this.query)).length},showEmpty(){return!1===this.create&&0===this.filteredOptions.length}},methods:{add(){this.showCreate&&this.$emit("create",this.query)},enter(t){var e;null==(e=t.target)||e.click()},escape(){0===this.query.length?this.$emit("escape"):this.query=""},focus(){var t;this.$refs.search?this.$refs.search.focus():null==(t=this.$refs.options)||t.focus()},highlight(t){if(t=this.$helper.string.stripHTML(t),this.query.length>0){const e=new RegExp(`(${RegExp.escape(this.query)})`,"ig");return t.replace(e,"$1")}return t},input(t){this.$emit("input",t)}}},(function(){var t=this,e=t._self._c;return e("k-navigate",{class:["k-picklist-input",t.$attrs.class],style:t.$attrs.style,attrs:{element:"nav",axis:"y",select:"input[type=search], label, .k-picklist-input-body button"},on:{prev:function(e){return t.$emit("escape")}}},[t.search?e("header",{staticClass:"k-picklist-input-header"},[e("div",{staticClass:"k-picklist-input-search"},[e("k-search-input",{ref:"search",attrs:{autofocus:t.autofocus,disabled:t.disabled,placeholder:t.placeholder,value:t.query},on:{input:function(e){t.query=e}},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"escape",void 0,e.key,void 0)?null:(e.preventDefault(),t.escape.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.add.apply(null,arguments))}]}}),t.showCreate?e("k-button",{staticClass:"k-picklist-input-create",attrs:{icon:"add",size:"xs"},on:{click:t.add}}):t._e()],1)]):t._e(),t.filteredOptions.length?[e("div",{staticClass:"k-picklist-input-body"},[e("k-input-validator",t._b({attrs:{value:JSON.stringify(t.value)}},"k-input-validator",{min:t.min,max:t.max,required:t.required},!1),[e(t.multiple?"k-checkboxes-input":"k-radio-input",{ref:"options",tag:"component",staticClass:"k-picklist-input-options",attrs:{disabled:t.disabled,options:t.choices,value:t.value},on:{input:t.input},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.enter.apply(null,arguments))}}})],1),!0!==t.display&&t.filteredOptions.length>t.display?e("k-button",{staticClass:"k-picklist-input-more",attrs:{icon:"angle-down"},on:{click:function(e){t.display=!0}}},[t._v(" "+t._s(t.$t("options.all",{count:t.filteredOptions.length}))+" ")]):t._e()],1)]:t.showEmpty?[e("div",{staticClass:"k-picklist-input-body"},[e("p",{staticClass:"k-picklist-input-empty"},[t._v(" "+t._s(t.$t("options.none"))+" ")])])]:t._e()],2)}),[]).exports;const De=ot({mixins:[Ae],emits:["create","input"],methods:{close(){this.$refs.dropdown.close()},add(t){this.$emit("create",t)},input(t){this.$emit("input",t)},open(t){this.$refs.dropdown.open(t)},toggle(){this.$refs.dropdown.toggle()}}},(function(){var t=this,e=t._self._c;return e("k-dropdown-content",{ref:"dropdown",staticClass:"k-picklist-dropdown",attrs:{"align-x":"start",disabled:t.disabled,navigate:!1},nativeOn:{click:function(t){t.stopPropagation()}}},[e("k-picklist-input",t._b({on:{create:t.add,input:t.input,escape:function(e){return t.$refs.dropdown.close()}},nativeOn:{click:function(t){t.stopPropagation()}}},"k-picklist-input",t.$props,!1))],1)}),[]).exports,je={install(t){t.component("k-dropdown-content",xe),t.component("k-dropdown-item",we),t.component("k-options-dropdown",_e),t.component("k-picklist-dropdown",De)}};const Ee=ot({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.min&&t.max?[t._v(t._s(t.min)+"–"+t._s(t.max))]:t.min?[t._v("≥ "+t._s(t.min))]:t.max?[t._v("≤ "+t._s(t.max))]:t._e()],2):t._e()])}),[]).exports;const Te=ot({props:{disabled:Boolean,config:Object,fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},emits:["focus","input","submit"],data:()=>({errors:{}}),methods:{focus(t){var e,s;null==(s=null==(e=this.$refs.fields)?void 0:e.focus)||s.call(e,t)},onFocus(t,e,s){this.$emit("focus",t,e,s)},onInput(t,e,s){this.$emit("input",t,e,s)},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:{novalidate:t.novalidate,method:"POST",autocomplete:"off"},on:{submit:function(e){return e.preventDefault(),t.onSubmit.apply(null,arguments)}}},[t._t("header"),t._t("default",(function(){return[e("k-fieldset",{ref:"fields",attrs:{disabled:t.disabled,fields:t.fields,value:t.value},on:{focus:t.onFocus,input:t.onInput,submit:t.onSubmit}})]})),t._t("footer"),e("input",{ref:"submitter",staticClass:"k-form-submitter",attrs:{type:"submit"}})],2)}),[]).exports,Ie={emits:["discard","submit"],data:()=>({isLoading:null,isLocking:null}),computed:{api(){return[this.$panel.view.path+"/lock",null,null,!0]},buttons(){return"unlock"===this.mode?[{icon:"check",text:this.$t("lock.isUnlocked"),click:()=>this.resolve()},{icon:"download",text:this.$t("download"),click:()=>this.download()}]:"lock"===this.mode?[{icon:this.$panel.content.lock.unlockable?"unlock":"loader",text:this.$t("lock.isLocked",{email:this.$esc(this.$panel.content.lock.email)}),title:this.$t("lock.unlock"),disabled:!this.$panel.content.lock.unlockable,click:()=>this.unlock()}]:"changes"===this.mode?[{icon:"undo",text:this.$t("revert"),click:()=>this.revert()},{icon:"check",text:this.$t("save"),click:()=>this.$emit("submit")}]:[]},disabled(){return"unlock"!==this.mode&&("lock"===this.mode?!this.$panel.content.lock.unlockable:"changes"===this.mode&&this.$panel.content.isPublishing)},hasChanges(){return this.$panel.content.hasUnpublishedChanges},isLocked(){return this.$panel.content.isLocked},isUnlocked(){return"unlock"===this.lockState},mode(){return this.lockState?this.lockState:!0===this.hasChanges?"changes":null},lockState(){var t;return this.supportsLocking&&(null==(t=this.$panel.content.lock)?void 0:t.state)},supportsLocking(){return!1!==this.$panel.content.lock},theme(){return"lock"===this.mode?"negative":"unlock"===this.mode?"info":"changes"===this.mode?"notice":null}},watch:{hasChanges:{handler(t,e){!0===this.supportsLocking&&!1===this.$panel.content.isLocked&&!1===this.isUnlocked&&(!0===t?(this.locking(),this.isLocking=setInterval(this.locking,3e4)):e&&(clearInterval(this.isLocking),this.locking(!1)))},immediate:!0},isLocked(t){!1===t&&this.$events.emit("model.reload")}},mounted(){this.supportsLocking&&(this.isLoading=setInterval(this.check,1e4))},destroyed(){clearInterval(this.isLoading),clearInterval(this.isLocking)},methods:{async check(){if(!1===this.$panel.isOffline){const{lock:t}=await this.$api.get(...this.api);Vue.set(this.$panel.view.props,"lock",t)}},download(){let t="";const e=this.$panel.content.changes;for(const i in e){const s=e[i];t+=i+": \n\n","object"==typeof s&&Object.keys(s).length||Array.isArray(s)&&s.length?t+=JSON.stringify(s,null,2):t+=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.$panel.view.path+".txt"),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)},async locking(t=!0){if(!0!==this.$panel.isOffline)if(!0===t)try{await this.$api.patch(...this.api)}catch{clearInterval(this.isLocking),this.$emit("discard")}else clearInterval(this.isLocking),await this.$api.delete(...this.api)},async resolve(){await this.unlock(!1),this.$emit("discard")},revert(){this.$panel.dialog.open({component:"k-remove-dialog",props:{submitButton:{icon:"undo",text:this.$t("revert")},text:this.$t("revert.confirm")},on:{submit:()=>{this.$panel.dialog.close(),this.$emit("discard")}}})},async unlock(t=!0){const e=[this.$panel.view.path+"/unlock",null,null,!0];!0!==t?(await this.$api.delete(...e),this.$reload({silent:!0})):this.$panel.dialog.open({component:"k-remove-dialog",props:{submitButton:{icon:"unlock",text:this.$t("lock.unlock")},text:this.$t("lock.unlock.submit",{email:this.$esc(this.$panel.content.lock.email)})},on:{submit:async()=>{await this.$api.patch(...e),this.$panel.dialog.close(),this.$reload({silent:!0})}}})}}};const Le=ot(Ie,(function(){var t=this,e=t._self._c;return t.buttons.length>0?e("k-button-group",{staticClass:"k-form-buttons",attrs:{layout:"collapsed"}},t._l(t.buttons,(function(s){return e("k-button",t._b({key:s.icon,attrs:{size:"sm",variant:"filled",disabled:t.disabled,responsive:!0,theme:t.theme}},"k-button",s,!1))})),1):t._e()}),[]).exports;const Be=ot({props:{isDraft:Boolean,isLocked:[String,Boolean],isPublished:Boolean,isSaved:Boolean,preview:String},emits:["discard","publish","save"],computed:{buttons(){return this.isLocked?[{theme:"negative",text:this.isLocked,icon:"lock",click:()=>this.locked()}]:this.isPublished?[{theme:"passive",text:this.$t("published"),icon:"check",disabled:!0}]:[{theme:"positive",text:this.isSaved?this.$t("saved"):this.$t("save"),icon:this.isSaved?"check":"draft",disabled:this.isSaved,click:()=>this.$emit("save")},{theme:"positive",text:this.$t("publish"),icon:"live",click:()=>this.$emit("publish")}]},dropdown(){if(this.isPublished)return[];const t=[];return!1===this.isLocked&&!1===this.isDraft&&t.push({icon:"undo",text:this.$t("form.discard"),click:()=>this.discard()}),this.preview&&!1===this.isPublished&&t.push({icon:"preview",link:this.preview,text:this.isDraft?this.$t("form.preview.draft"):this.$t("form.preview"),target:"_blank"}),t}},methods:{discard(){this.$panel.dialog.open({component:"k-remove-dialog",props:{size:"medium",submitButton:{icon:"undo",text:this.$t("form.discard")},text:this.$t("form.discard.confirm")},on:{submit:()=>{this.$panel.dialog.close(),this.$emit("discard")}}})},locked(){this.$panel.notification.open({icon:"lock",theme:"negative",message:this.$t("form.locked")})}}},(function(){var t=this,e=t._self._c;return e("k-button-group",{staticClass:"k-form-controls",attrs:{layout:"collapsed"}},[t._l(t.buttons,(function(s){return e("k-button",t._b({key:s.text,attrs:{size:"sm",variant:"filled"}},"k-button",s,!1))})),t.dropdown.length?[e("k-button",{attrs:{theme:t.buttons[0].theme,icon:"angle-down",size:"sm",variant:"filled"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.dropdown,"align-x":"end"}})]:t._e()],2)}),[]).exports,qe={mixins:[H,K,W,J,Q,it],props:{counter:[Boolean,Object],endpoints:Object,input:[String,Number],translate:Boolean,type:String}};const Pe=ot({mixins:[qe],inheritAttrs:!1,emits:["blur","focus"]},(function(){var t=this,e=t._self._c;return e("div",{class:["k-field",`k-field-name-${t.name}`,`k-field-type-${t.type}`,t.$attrs.class],style:t.$attrs.style,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("k-label",{attrs:{input:t.input,required:t.required,title:t.label,type:"field"}},[t._v(" "+t._s(t.label)+" ")])]})),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-help k-field-help",attrs:{html:t.help}}):t._e()]}))],2):t._e()]}))],2)}),[]).exports,Ne={props:{config:Object,disabled:Boolean,fields:{type:[Array,Object],default:()=>({})},value:{type:Object,default:()=>({})}},emits:["focus","input","submit"],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]},onInput(t,e,s){const i=this.value;this.$set(i,s,t),this.$emit("input",i,e,s)}}};const Fe=ot(Ne,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-fieldset"},[e("k-grid",{attrs:{variant:"fields"}},[t._l(t.fields,(function(s,i){return[t.$helper.field.isVisible(s,t.value)?e("k-column",{key:s.signature,attrs:{width:s.width}},[t.hasFieldType(s.type)?e("k-"+s.type+"-field",t._b({ref:i,refInFor:!0,tag:"component",attrs:{disabled:t.disabled||s.disabled,"form-data":t.value,name:i,value:t.value[i]},on:{input:function(e){return t.onInput(e,s,i)},focus:function(e){return t.$emit("focus",e,s,i)},submit:function(e){return t.$emit("submit",e,s,i)}}},"component",s,!1)):e("k-box",{attrs:{theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[t._v(" "+t._s(t.$t("error.field.type.missing",{name:i,type:s.type}))+" ")])],1)],1):t._e()]}))],2)],1)}),[]).exports,ze={mixins:[z,V,H],inheritAttrs:!1,props:{autofocus:Boolean,type:String,icon:[String,Boolean],value:{type:[String,Boolean,Number,Object,Array],default:null}},emits:["input"]};const Ye=ot({mixins:[ze],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",{class:["k-input",t.$attrs.class],style:t.$attrs.style,attrs:{"data-disabled":t.disabled,"data-type":t.type}},[t.$slots.before||t.before?e("span",{staticClass:"k-input-description 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._b({ref:"input",tag:"component",attrs:{value:t.value},on:{input:function(e){return t.$emit("input",e)}}},"component",t.inputProps,!1))]}))],2),t.$slots.after||t.after?e("span",{staticClass:"k-input-description 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()])}),[]).exports,Re={props:{content:{default:()=>({}),type:[Array,Object]},fieldset:{default:()=>({}),type:Object}}};const Ve=ot({mixins:[Re],inheritAttrs:!1,computed:{icon(){return this.fieldset.icon??"box"},label(){if(!this.fieldset.label||0===this.fieldset.label.length)return!1;if(this.fieldset.label===this.name)return!1;let t=this.$helper.string.template(this.fieldset.label,this.content);return"…"!==t&&(t=this.$helper.string.stripHTML(t),this.$helper.string.unescapeHTML(t))},name(){return this.fieldset.name??this.fieldset.label}}},(function(){var t=this,e=t._self._c;return e("div",{class:["k-block-title",t.$attrs.class],style:t.$attrs.style},[e("k-icon",{staticClass:"k-block-icon",attrs:{type:t.icon}}),t.name?e("span",{staticClass:"k-block-name"},[t._v(" "+t._s(t.name)+" ")]):t._e(),t.label?e("span",{staticClass:"k-block-label"},[t._v(" "+t._s(t.label)+" ")]):t._e()],1)}),[]).exports,He={mixins:[Re,H],props:{endpoints:{default:()=>({}),type:[Array,Object]},id:String}};const Ue=ot({mixins:[He],inheritAttrs:!1,methods:{field(t,e=null){let s=null;for(const i of Object.values(this.fieldset.tabs??{}))i.fields[t]&&(s=i.fields[t]);return s??e},open(){this.$emit("open")},update(t){this.$emit("update",{...this.content,...t})}}},(function(){var t=this;return(0,t._self._c)("k-block-title",{class:t.$attrs.class,style:t.$attrs.style,attrs:{content:t.content,fieldset:t.fieldset},nativeOn:{dblclick:function(e){return t.$emit("open")}}})}),[]).exports,Ke={props:{isBatched:Boolean,isFull:Boolean,isHidden:Boolean,isMergable:Boolean}};const We=ot({mixins:[Ke],props:{isEditable:Boolean,isSplitable:Boolean},emits:["chooseToAppend","chooseToConvert","chooseToPrepend","copy","duplicate","hide","merge","open","paste","remove","removeSelected","show","split","sortDown","sortUp"],computed:{buttons(){return this.isBatched?[{icon:"template",title:this.$t("copy"),click:()=>this.$emit("copy")},{when:this.isMergable,icon:"merge",title:this.$t("merge"),click:()=>this.$emit("merge")},{icon:"trash",title:this.$t("remove"),click:()=>this.$emit("removeSelected")}]:[{when:this.isEditable,icon:"edit",title:this.$t("edit"),click:()=>this.$emit("open")},{icon:"add",title:this.$t("insert.after"),disabled:this.isFull,click:()=>this.$emit("chooseToAppend")},{icon:"trash",title:this.$t("delete"),click:()=>this.$emit("remove")},{icon:"sort",title:this.$t("sort.drag"),class:"k-sort-handle",key:t=>this.sort(t)},{icon:"dots",title:this.$t("more"),dropdown:[{icon:"angle-up",label:this.$t("insert.before"),disabled:this.isFull,click:()=>this.$emit("chooseToPrepend")},{icon:"angle-down",label:this.$t("insert.after"),disabled:this.isFull,click:()=>this.$emit("chooseToAppend")},"-",{when:this.isEditable,icon:"edit",label:this.$t("edit"),click:()=>this.$emit("open")},{icon:"refresh",label:this.$t("field.blocks.changeType"),click:()=>this.$emit("chooseToConvert")},{when:this.isSplitable,icon:"split",label:this.$t("split"),click:()=>this.$emit("split")},"-",{icon:"template",label:this.$t("copy"),click:()=>this.$emit("copy")},{icon:"download",label:this.$t("paste.after"),disabled:this.isFull,click:()=>this.$emit("paste")},"-",{icon:this.isHidden?"preview":"hidden",label:this.isHidden?this.$t("show"):this.$t("hide"),click:()=>this.$emit(this.isHidden?"show":"hide")},{icon:"copy",label:this.$t("duplicate"),click:()=>this.$emit("duplicate")},"-",{icon:"trash",label:this.$t("delete"),click:()=>this.$emit("remove")}]}]}},methods:{open(){this.$refs.options.open()},sort(t){switch(t.preventDefault(),t.key){case"ArrowUp":this.$emit("sortUp");break;case"ArrowDown":this.$emit("sortDown")}}}},(function(){return(0,this._self._c)("k-toolbar",{staticClass:"k-block-options",attrs:{buttons:this.buttons},nativeOn:{mousedown:function(t){t.preventDefault()}}})}),[]).exports,Je={mixins:[He,Ke],inheritAttrs:!1,props:{attrs:{default:()=>({}),type:[Array,Object]},isLastSelected:Boolean,isSelected:Boolean,name:String,next:Object,prev:Object,type:String},emits:["append","chooseToAppend","chooseToConvert","chooseToPrepend","close","copy","duplicate","focus","hide","merge","open","paste","prepend","remove","selectDown","selectUp","show","sortDown","sortUp","split","submit","update"],computed:{className(){let t=["k-block-type-"+this.type];return this.fieldset.preview&&this.fieldset.preview!==this.type&&t.push("k-block-type-"+this.fieldset.preview),!1===this.wysiwyg&&t.push("k-block-type-default"),t},containerType(){const t=this.fieldset.preview;return!1!==t&&(t&&this.$helper.isComponent("k-block-type-"+t)?t:!!this.$helper.isComponent("k-block-type-"+this.type)&&this.type)},customComponent(){return this.wysiwyg?this.wysiwygComponent:"k-block-type-default"},isDisabled(){return!0===this.disabled||!0===this.fieldset.disabled},isEditable(){return!1!==this.fieldset.editable},listeners(){return{append:t=>this.$emit("append",t),chooseToAppend:t=>this.$emit("chooseToAppend",t),chooseToConvert:t=>this.$emit("chooseToConvert",t),chooseToPrepend:t=>this.$emit("chooseToPrepend",t),close:()=>this.$emit("close"),copy:()=>this.$emit("copy"),duplicate:()=>this.$emit("duplicate"),focus:()=>this.$emit("focus"),hide:()=>this.$emit("hide"),merge:()=>this.$emit("merge"),open:t=>this.open(t),paste:()=>this.$emit("paste"),prepend:t=>this.$emit("prepend",t),remove:()=>this.remove(),removeSelected:()=>this.$emit("removeSelected"),show:()=>this.$emit("show"),sortDown:()=>this.$emit("sortDown"),sortUp:()=>this.$emit("sortUp"),split:t=>this.$emit("split",t),update:t=>this.$emit("update",t)}},listenersForOptions(){return{...this.listeners,split:()=>this.$refs.editor.split(),open:()=>{"function"==typeof this.$refs.editor.open?this.$refs.editor.open():this.open()}}},tabs(){const t=this.fieldset.tabs??{};for(const[e,s]of Object.entries(t))for(const[i]of Object.entries(s.fields??{}))t[e].fields[i].section=this.name,t[e].fields[i].endpoints={field:this.endpoints.field+"/fieldsets/"+this.type+"/fields/"+i,section:this.endpoints.section,model:this.endpoints.model};return t},wysiwyg(){return!1!==this.wysiwygComponent},wysiwygComponent(){return!!this.containerType&&"k-block-type-"+this.containerType}},methods:{backspace(t){if(t.target.matches("[contenteditable], input, textarea"))return!1;t.preventDefault(),this.remove()},close(){this.$panel.drawer.close(this.id)},focus(){var t,e;"function"==typeof(null==(t=this.$refs.editor)?void 0:t.focus)?this.$refs.editor.focus():null==(e=this.$refs.container)||e.focus()},goTo(t){var e;t&&(null==(e=t.$refs.container)||e.focus(),t.open(null,!0))},isSplitable(){var t;return!0!==this.isFull&&(!!this.$refs.editor&&((this.$refs.editor.isSplitable??!0)&&"function"==typeof(null==(t=this.$refs.editor)?void 0:t.split)))},onClose(){this.$emit("close"),this.focus()},onFocus(t){this.disabled||this.$emit("focus",t)},onFocusIn(t){var e,s;this.disabled||(null==(s=null==(e=this.$refs.options)?void 0:e.$el)?void 0:s.contains(t.target))||this.$emit("focus",t)},onInput(t){this.$emit("update",t)},open(t,e=!1){!this.isEditable||this.isBatched||this.isDisabled||(this.$panel.drawer.open({component:"k-block-drawer",id:this.id,tab:t,on:{close:this.onClose,input:this.onInput,next:()=>this.goTo(this.next),prev:()=>this.goTo(this.prev),remove:this.remove,show:this.show,submit:this.submit},props:{hidden:this.isHidden,icon:this.fieldset.icon??"box",next:this.next,prev:this.prev,tabs:this.tabs,title:this.fieldset.name,value:this.content},replace:e}),this.$emit("open"))},remove(){if(this.isBatched)return this.$emit("removeSelected");this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm")},on:{submit:()=>{this.$panel.dialog.close(),this.close(),this.$emit("remove",this.id)}}})},show(){this.$emit("show")},submit(){this.close(),this.$emit("submit")}}};const Ge=ot(Je,(function(){var t=this,e=t._self._c;return e("div",{ref:"container",class:["k-block-container","k-block-container-fieldset-"+t.type,t.containerType?"k-block-container-type-"+t.containerType:"",t.$attrs.class],style:t.$attrs.style,attrs:{"data-batched":t.isBatched,"data-disabled":t.isDisabled,"data-hidden":t.isHidden,"data-id":t.id,"data-last-selected":t.isLastSelected,"data-selected":t.isSelected,"data-translate":t.fieldset.translate,tabindex:t.isDisabled?null:0},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"j",void 0,e.key,void 0)?null:e.ctrlKey?(e.preventDefault(),e.stopPropagation(),t.$emit("merge")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.altKey?(e.preventDefault(),e.stopPropagation(),t.$emit("selectDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey&&e.altKey?(e.preventDefault(),e.stopPropagation(),t.$emit("selectUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),e.stopPropagation(),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(),e.stopPropagation(),t.$emit("sortUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:e.ctrlKey?(e.stopPropagation(),t.backspace.apply(null,arguments)):null}],focus:function(e){return e.stopPropagation(),t.onFocus.apply(null,arguments)},focusin:function(e){return e.stopPropagation(),t.onFocusIn.apply(null,arguments)}}},[e("div",{staticClass:"k-block",class:t.className,attrs:{"data-disabled":t.isDisabled}},[e(t.customComponent,t._g(t._b({ref:"editor",tag:"component",attrs:{tabs:t.tabs}},"component",t.$props,!1),t.listeners))],1),t.isDisabled?t._e():e("k-block-options",t._g(t._b({ref:"options"},"k-block-options",{isBatched:t.isBatched,isEditable:t.isEditable,isFull:t.isFull,isHidden:t.isHidden,isMergable:t.isMergable,isSplitable:t.isSplitable()},!1),t.listenersForOptions))],1)}),[]).exports,Xe={mixins:[R,H,W],props:{empty:String,endpoints:Object,fieldsets:Object,fieldsetGroups:Object,group:String,min:{type:Number,default:null},max:{type:Number,default:null},value:{type:Array,default:()=>[]}},emits:["input"]},Ze={mixins:[Xe],inheritAttrs:!1,data(){return{blocks:this.value??[],isEditing:!1,isMultiSelectKey:!1,selected:[]}},computed:{draggableOptions(){return{handle:".k-sort-handle",list:this.blocks,group:this.group,move:this.move,data:{fieldsets:this.fieldsets,isFull:this.isFull}}},hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.blocks.length},isFull(){return null!==this.max&&this.blocks.length>=this.max},isMergable(){if(this.selected.length<2)return!1;const t=this.selected.map((t=>this.find(t)));return!(new Set(t.map((t=>t.type))).size>1)&&"function"==typeof this.ref(t[0]).$refs.editor.merge}},watch:{value(){this.blocks=this.value}},mounted(){!0===this.$props.autofocus&&setTimeout(this.focus,100),this.$events.on("blur",this.onBlur),this.$events.on("click",this.onClickGlobal),this.$events.on("copy",this.onCopy),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("click",this.onClickGlobal),this.$events.off("copy",this.onCopy),this.$events.off("keydown",this.onKey),this.$events.off("keyup",this.onKey),this.$events.off("paste",this.onPaste)},methods:{async add(t="text",e){const s=await this.$api.get(this.endpoints.field+"/fieldsets/"+t);this.blocks.splice(e,0,s),this.save(),await this.$nextTick(),this.focusOrOpen(s)},choose(t){if(1===this.$helper.object.length(this.fieldsets))return this.add(Object.values(this.fieldsets)[0].type,t);this.$panel.dialog.open({component:"k-block-selector",props:{fieldsetGroups:this.fieldsetGroups,fieldsets:this.fieldsets},on:{submit:e=>{this.add(e,t),this.$panel.dialog.close()},paste:e=>{this.paste(e,t)}}})},chooseToConvert(t){this.$panel.dialog.open({component:"k-block-selector",props:{disabledFieldsets:[t.type],fieldsetGroups:this.fieldsetGroups,fieldsets:this.fieldsets,headline:this.$t("field.blocks.changeType")},on:{submit:e=>{this.convert(e,t),this.$panel.dialog.close()},paste:this.paste}})},copy(t){if(0===this.blocks.length)return!1;if(0===this.selected.length)return!1;let e=[];for(const s of this.blocks)this.selected.includes(s.id)&&e.push(s);if(0===e.length)return!1;this.$helper.clipboard.write(e,t),this.selected=e.map((t=>t.id)),this.$panel.notification.success({message:this.$t("copy.success",{count:e.length}),icon:"template"})},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=>{let e={};for(const s of Object.values((null==t?void 0:t.tabs)??{}))e={...e,...s.fields};return e},o=this.blocks[i],r=await this.$api.get(this.endpoints.field+"/fieldsets/"+t),a=this.fieldsets[o.type],l=this.fieldsets[t];if(!l)return!1;let c=r.content;const u=n(l),p=n(a);for(const[d,h]of Object.entries(u)){const t=p[d];(null==t?void 0:t.type)===h.type&&(null==(s=null==o?void 0:o.content)?void 0:s[d])&&(c[d]=o.content[d])}this.blocks[i]={...r,id:o.id,content:c},this.save()},deselect(t){const e=this.selected.findIndex((e=>e===t.id));-1!==e&&this.selected.splice(e,1)},deselectAll(){this.selected=[]},async duplicate(t,e){const s={...this.$helper.object.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){const e=this.ref(t);this.selected=[(null==t?void 0:t.id)??this.blocks[0]],null==e||e.focus(),null==e||e.$el.scrollIntoView({block:"nearest"})},focusOrOpen(t){this.fieldsets[t.type].wysiwyg?this.focus(t):this.open(t)},hide(t){Vue.set(t,"isHidden",!0),this.save()},isInputEvent(){const t=document.querySelector(":focus");return null==t?void 0:t.matches("input, textarea, [contenteditable], .k-writer-input")},isLastSelected(t){const[e]=this.selected.slice(-1);return e&&t.id===e},isOnlyInstance:()=>1===document.querySelectorAll(".k-blocks").length,isSelected(t){return this.selected.includes(t.id)},async merge(){if(this.isMergable){const t=this.selected.map((t=>this.find(t)));this.ref(t[0]).$refs.editor.merge(t);for(const e of t.slice(1))this.remove(e);await this.$nextTick(),this.focus(t[0])}},move(t){if(t.from!==t.to){const e=t.draggedData,s=t.toData;if(!1===Object.keys(s.fieldsets).includes(e.type))return!1;if(!0===s.isFull)return!1}return!0},onBlur(){0===this.selected.length&&(this.isMultiSelectKey=!1)},onClickBlock(t,e){e&&this.isMultiSelectKey&&this.onKey(e),this.isMultiSelectKey&&(e.preventDefault(),e.stopPropagation(),this.isSelected(t)?this.deselect(t):this.select(t))},onClickGlobal(t){var e;if("function"==typeof t.target.closest&&(t.target.closest(".k-dialog")||t.target.closest(".k-drawer")))return;const s=document.querySelector(".k-overlay:last-of-type");!1!==this.$el.contains(t.target)||!1!==(null==s?void 0:s.contains(t.target))?s&&!1===(null==(e=this.$el.closest(".k-layout-column"))?void 0:e.contains(t.target))&&this.deselectAll():this.deselectAll()},onCopy(t){return!1!==this.$el.contains(t.target)&&!0!==this.isEditing&&!0!==this.$panel.dialog.isOpen&&!0!==this.isInputEvent(t)&&this.copy(t)},onFocus(t){!1===this.isMultiSelectKey&&(this.selected=[t.id])},async onKey(t){if(this.isMultiSelectKey=t.metaKey||t.ctrlKey||t.altKey,"Escape"===t.code&&this.selected.length>1){const t=this.find(this.selected[0]);await this.$nextTick(),this.focus(t)}},onPaste(t){return!0!==this.isInputEvent(t)&&(!0!==this.isEditing&&!0!==this.$panel.dialog.isOpen&&((0!==this.selected.length||!1!==this.$el.contains(t.target))&&this.paste(t)))},open(t){var e;null==(e=this.$refs["block-"+t.id])||e[0].open()},async paste(t,e){const s=this.$helper.clipboard.read(t);let i=await this.$api.post(this.endpoints.field+"/paste",{html:s});if(void 0===e){let t=this.selected[this.selected.length-1];-1===(e=this.findIndex(t))&&(e=this.blocks.length),e++}if(this.max){const t=this.max-this.blocks.length;i=i.slice(0,t)}this.blocks.splice(e,0,...i),this.save(),this.$panel.notification.success({message:this.$t("paste.success",{count:i.length}),icon:"download"})},pasteboard(){this.$panel.dialog.open({component:"k-block-pasteboard",on:{paste:this.paste}})},prevNext(t){var e;if(this.blocks[t])return null==(e=this.$refs["block-"+this.blocks[t].id])?void 0:e[0]},ref(t){var e,s;return null==(s=this.$refs["block-"+((null==t?void 0:t.id)??(null==(e=this.blocks[0])?void 0:e.id))])?void 0:s[0]},remove(t){const e=this.findIndex(t.id);-1!==e&&(this.deselect(t),this.$delete(this.blocks,e),this.save())},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm.all"),submitButton:this.$t("delete.all")},on:{submit:()=>{this.selected=[],this.blocks=[],this.save(),this.$panel.dialog.close()}}})},removeSelected(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm.selected")},on:{submit:()=>{for(const t of this.selected){const e=this.findIndex(t);-1!==e&&this.$delete(this.blocks,e)}this.deselectAll(),this.save(),this.$panel.dialog.close()}}})},save(){this.$emit("input",this.blocks)},select(t){!1===this.isSelected(t)&&this.selected.push(t.id)},selectDown(){const t=this.selected[this.selected.length-1],e=this.findIndex(t)+1;e=0&&this.select(this.blocks[e])},selectAll(){this.selected=Object.values(this.blocks).map((t=>t.id))},show(t){Vue.set(t,"isHidden",!1),this.save()},async sort(t,e,s){if(s<0)return;let i=this.$helper.object.clone(this.blocks);i.splice(e,1),i.splice(s,0,t),this.blocks=i,this.save(),await this.$nextTick(),this.focus(t)},async split(t,e,s){const i=this.$helper.object.clone(t);i.content={...i.content,...s[0]};const n=await this.$api.get(this.endpoints.field+"/fieldsets/"+t.type);n.content={...n.content,...i.content,...s[1]},this.blocks.splice(e,1,i,n),this.save(),await this.$nextTick(),this.focus(n)},update(t,e){const s=this.findIndex(t.id);if(-1!==s)for(const i in e)Vue.set(this.blocks[s].content,i,e[i]);this.save()}}};const Qe=ot(Ze,(function(){var t=this,e=t._self._c;return e("div",{class:["k-blocks",t.$attrs.class],style:t.$attrs.style,attrs:{"data-disabled":t.disabled,"data-empty":0===t.blocks.length}},[t.hasFieldsets?[e("k-draggable",t._b({staticClass:"k-blocks-list",attrs:{"data-multi-select-key":t.isMultiSelectKey},on:{sort:t.save},scopedSlots:t._u([0===t.blocks.length?{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],null,!0)},"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,on:{append:function(e){return t.add(e,i+1)},chooseToAppend:function(e){return t.choose(i+1)},chooseToConvert:function(e){return t.chooseToConvert(s)},chooseToPrepend:function(e){return t.choose(i)},close:function(e){t.isEditing=!1},copy:function(e){return t.copy()},duplicate:function(e){return t.duplicate(s,i)},focus:function(e){return t.onFocus(s)},hide:function(e){return t.hide(s)},merge:function(e){return t.merge()},open:function(e){t.isEditing=!0},paste:function(e){return t.pasteboard()},prepend:function(e){return t.add(e,i)},remove:function(e){return t.remove(s)},removeSelected:t.removeSelected,show:function(e){return t.show(s)},selectDown:t.selectDown,selectUp:t.selectUp,sortDown:function(e){return t.sort(s,i,i+1)},sortUp:function(e){return t.sort(s,i,i-1)},split:function(e){return t.split(s,i,e)},update:function(e){return t.update(s,e)}},nativeOn:{click:function(e){return t.onClickBlock(s,e)}}},"k-block",{...s,disabled:t.disabled,endpoints:t.endpoints,fieldset:t.fieldset(s),isBatched:t.isSelected(s)&&t.selected.length>1,isFull:t.isFull,isHidden:!0===s.isHidden,isLastSelected:t.isLastSelected(s),isMergable:t.isMergable,isSelected:t.isSelected(s),next:t.prevNext(i+1),prev:t.prevNext(i-1)},!1))})),1)]:e("k-empty",{attrs:{icon:"box"}},[t._v(" "+t._s(t.$t("field.blocks.fieldsets.empty"))+" ")])],2)}),[]).exports;const ts=ot({inheritAttrs:!1,emits:["close","paste","submit"],computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{paste(t){this.$emit("close"),this.$emit("paste",t)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",class:["k-block-importer",t.$attrs.class],style:t.$attrs.style,attrs:{"cancel-button":!1,"submit-button":!1,visible:!0,size:"large"},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},[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.paste.apply(null,arguments)}}})])}),[]).exports,es={inheritAttrs:!1,props:{disabledFieldsets:{default:()=>[],type:Array},fieldsets:{type:Object},fieldsetGroups:{type:Object},headline:{type:String},size:{type:String,default:"medium"},value:{default:null,type:String}},emits:["cancel","input","paste","submit"],data:()=>({selected:null}),computed:{groups(){const t={};let e=0;const s=this.fieldsetGroups??{blocks:{label:this.$t("field.blocks.fieldsets.label"),sets:Object.keys(this.fieldsets)}};for(const i in s){const 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)}return t},shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},mounted(){this.$events.on("paste",this.paste)},destroyed(){this.$events.off("paste",this.paste)},methods:{paste(t){this.$emit("paste",t),this.close()}}};const ss=ot(es,(function(){var t=this,e=t._self._c;return e("k-dialog",{class:["k-block-selector",t.$attrs.class],style:t.$attrs.style,attrs:{"cancel-button":!1,size:t.size,"submit-button":!1,visible:!0},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},[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("k-navigate",{staticClass:"k-block-types"},t._l(s.fieldsets,(function(s){return e("k-button",{key:s.name,attrs:{disabled:t.disabledFieldsets.includes(s.type),icon:s.icon??"box",text:s.name,size:"lg"},on:{click:function(e){return t.$emit("submit",s.type)}},nativeOn:{focus:function(e){return t.$emit("input",s.type)}}})})),1)],1)})),e("p",{staticClass:"k-clipboard-hint",domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}})],2)}),[]).exports;const is=ot({props:{value:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-background-dropdown"},[e("k-button",{attrs:{dropdown:!0,size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.dropdown.toggle()}}},[e("k-color-frame",{attrs:{color:t.value,ratio:"1/1"}})],1),e("k-dropdown-content",{ref:"dropdown",attrs:{"align-x":"end",options:[{text:t.$t("field.blocks.figure.back.plain"),click:"var(--color-white)"},{text:t.$t("field.blocks.figure.back.pattern.light"),click:"var(--pattern-light)"},{text:t.$t("field.blocks.figure.back.pattern.dark"),click:"var(--pattern)"}]},on:{action:function(e){return t.$emit("input",e)}}})],1)}),[]).exports;const ns=ot({inheritAttrs:!1,props:{back:String,caption:String,captionMarks:{default:!0,type:[Boolean,Array]},disabled:Boolean,isEmpty:Boolean,emptyIcon:String,emptyText:String},emits:["open","update"]},(function(){var t=this,e=t._self._c;return e("figure",{class:["k-block-figure",t.$attrs.class],style:{"--block-figure-back":t.back,...t.$attrs.style},attrs:{"data-empty":t.isEmpty}},[t.isEmpty?e("k-button",{staticClass:"k-block-figure-empty",attrs:{disabled:t.disabled,icon:t.emptyIcon,text:t.emptyText},on:{click:function(e){return t.$emit("open")}}}):e("span",{staticClass:"k-block-figure-container",attrs:{"data-disabled":t.disabled},on:{dblclick:function(e){return t.$emit("open")}}},[t._t("default")],2),t.caption?e("k-block-figure-caption",{attrs:{disabled:t.disabled,marks:t.captionMarks,value:t.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}}):t._e()],1)}),[]).exports;const os=ot({props:{disabled:Boolean,marks:[Array,Boolean],value:String}},(function(){var t=this,e=t._self._c;return e("figcaption",{staticClass:"k-block-figure-caption"},[e("k-writer-input",{attrs:{disabled:t.disabled,inline:!0,marks:t.marks,spellcheck:!1,value:t.value},on:{input:function(e){return t.$emit("input",e)}}})],1)}),[]).exports;const rs=ot({extends:Ue,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,disabled:t.disabled,placeholder:t.placeholder,spellcheck:!1,value:t.content.code,font:"monospace",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-input",{ref:"language",attrs:{disabled:t.disabled,empty:!1,options:t.languages,value:t.content.language,icon:"code",type:"select"},on:{input:function(e){return t.update({language:e})}}})],1):t._e()],1)}),[]).exports;const as=ot({extends:Ue,props:{tabs:Object},data(){return{collapsed:this.state(),tab:Object.keys(this.tabs)[0]}},computed:{fields(){var t;return null==(t=this.tabs[this.tab])?void 0:t.fields},values(){return Object.assign({},this.content)}},methods:{open(){this.$emit("open",this.tab)},state(t){const e=`kirby.fieldsBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return JSON.parse(sessionStorage.getItem(e));sessionStorage.setItem(e,t)},toggle(){this.collapsed=!this.collapsed,this.state(this.collapsed)}}},(function(){var t=this,e=t._self._c;return e("div",{attrs:{"data-collapsed":t.collapsed},on:{dblclick:function(e){!t.fieldset.wysiwyg&&t.$emit("open")}}},[e("header",{staticClass:"k-block-type-fields-header"},[e("k-block-title",{attrs:{content:t.values,fieldset:t.fieldset},nativeOn:{click:function(e){return t.toggle.apply(null,arguments)}}}),t.collapsed?t._e():e("k-drawer-tabs",{attrs:{tab:t.tab,tabs:t.fieldset.tabs},on:{open:function(e){t.tab=e}}})],1),t.collapsed?t._e():e("k-form",{ref:"form",staticClass:"k-block-type-fields-form",attrs:{autofocus:!0,disabled:t.disabled||!t.fieldset.wysiwyg,fields:t.fields,value:t.values},on:{input:function(e){return t.$emit("update",e)}}})],1)}),[]).exports,ls={extends:Ue,data(){return{back:this.onBack()??"var(--color-white)"}},computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop},isEmpty(){var t;return!(null==(t=this.content.images)?void 0:t.length)},ratio(){return this.content.ratio}},methods:{onBack(t){const e=`kirby.galleryBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return sessionStorage.getItem(e);this.back=t,sessionStorage.setItem(e,t)}}};const cs=ot(ls,(function(){var t=this,e=t._self._c;return e("figure",{style:{"--block-back":t.back},attrs:{"data-empty":t.isEmpty}},[e("ul",{on:{dblclick:t.open}},[t.isEmpty?t._l(3,(function(s){return e("li",{key:s,staticClass:"k-block-type-gallery-placeholder"},[e("k-image-frame",{attrs:{ratio:t.ratio}})],1)})):[t._l(t.content.images,(function(s){return e("li",{key:s.id},[e("k-image-frame",{attrs:{ratio:t.ratio,cover:t.crop,src:s.url,srcset:s.image.srcset,alt:s.alt}})],1)})),e("k-block-background-dropdown",{attrs:{value:t.back},on:{input:t.onBack}})]],2),t.content.caption?e("k-block-figure-caption",{attrs:{disabled:t.disabled,marks:t.captionMarks,value:t.content.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}}):t._e()],1)}),[]).exports;const us=ot({extends:Ue,inheritAttrs:!1,emits:["append","open","split","update"],computed:{isSplitable(){return this.content.text.length>0&&!1===this.$refs.input.isCursorAtStart&&!1===this.$refs.input.isCursorAtEnd},keys(){return{Enter:()=>!0===this.$refs.input.isCursorAtEnd?this.$emit("append","text"):this.split(),"Mod-Enter":this.split}},levels(){return this.field("level",{options:[]}).options},textField(){return this.field("text",{marks:!0})}},methods:{focus(){this.$refs.input.focus()},merge(t){this.update({text:t.map((t=>t.content.text)).join(" ")})},split(){var t,e;const s=null==(e=(t=this.$refs.input).getSplitContent)?void 0:e.call(t);s&&this.$emit("split",[{text:s[0]},{level:"h"+Math.min(parseInt(this.content.level.slice(1))+1,6),text:s[1]}])}}},(function(){var t=this,e=t._self._c;return e("div",{class:["k-block-type-heading-input",t.$attrs.class],style:t.$attrs.style,attrs:{"data-level":t.content.level}},[e("k-writer-input",t._b({ref:"input",attrs:{disabled:t.disabled,inline:!0,keys:t.keys,value:t.content.text},on:{input:function(e){return t.update({text:e})}}},"k-writer-input",t.textField,!1)),t.levels.length>1?e("k-input",{ref:"level",staticClass:"k-block-type-heading-level",attrs:{disabled:t.disabled,empty:!1,options:t.levels,value:t.content.level,type:"select"},on:{input:function(e){return t.update({level:e})}}}):t._e()],1)}),[]).exports,ps={extends:Ue,data(){return{back:this.onBack()??"var(--color-white)"}},computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop??!1},src(){var t,e;return"web"===this.content.location?this.content.src:!!(null==(e=null==(t=this.content.image)?void 0:t[0])?void 0:e.url)&&this.content.image[0].url},ratio(){return this.content.ratio??!1}},methods:{onBack(t){const e=`kirby.imageBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return sessionStorage.getItem(e);this.back=t,sessionStorage.setItem(e,t)}}};const ds=ot(ps,(function(){var t=this,e=t._self._c;return e("k-block-figure",{attrs:{back:t.back,caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.image.placeholder")+" …",disabled:t.disabled,"is-empty":!t.src,"empty-icon":"image"},on:{open:t.open,update:t.update}},[t.src?[t.ratio?e("k-image-frame",{attrs:{ratio:t.ratio,cover:t.crop,alt:t.content.alt,src:t.src}}):e("img",{staticClass:"k-block-type-image-auto",attrs:{alt:t.content.alt,src:t.src}}),e("k-block-background-dropdown",{attrs:{value:t.back},on:{input:t.onBack}})]:t._e()],2)}),[]).exports;const hs=ot({},(function(){return this._self._c,this._m(0)}),[function(){var t=this._self._c;return t("div",[t("hr")])}]).exports;const ms=ot({extends:Ue,emits:["open","split","update"],computed:{isSplitable(){return this.content.text.length>0&&!1===this.input().isCursorAtStart&&!1===this.input().isCursorAtEnd},keys(){return{"Mod-Enter":this.split}},marks(){return this.field("text",{}).marks}},methods:{focus(){this.$refs.input.focus()},input(){return this.$refs.input.$refs.input.$refs.input},merge(t){this.update({text:t.map((t=>t.content.text)).join("").replaceAll("
        ","")})},split(){var t,e;const s=null==(e=(t=this.input()).getSplitContent)?void 0:e.call(t);s&&this.$emit("split",[{text:s[0].replace(/(
      • <\/p><\/li><\/ul>)$/,"

      ")},{text:s[1].replace(/^(
      • <\/p><\/li>)/,"

          ")}])}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-list-input",attrs:{disabled:t.disabled,keys:t.keys,marks:t.marks,value:t.content.text,type:"list"},on:{input:function(e){return t.update({text:e})}}})}),[]).exports;const fs=ot({extends:Ue,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,disabled:t.disabled,placeholder:t.placeholder,spellcheck:!1,value:t.content.text,font:"monospace",type:"textarea"},on:{input:function(e){return t.update({text:e})}}})}),[]).exports;const gs=ot({extends:Ue,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-input",{ref:"text",staticClass:"k-block-type-quote-text",attrs:{disabled:t.disabled,inline:t.textField.inline??!1,marks:t.textField.marks,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}}),e("k-writer-input",{ref:"citation",staticClass:"k-block-type-quote-citation",attrs:{disabled:t.disabled,inline:t.citationField.inline??!0,marks:t.citationField.marks,placeholder:t.citationField.placeholder,value:t.content.citation},on:{input:function(e){return t.update({citation:e})}}})],1)}),[]).exports;const ks=ot({extends:Ue,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",{class:["k-block-type-table-preview",t.$attrs.class],style:t.$attrs.style,attrs:{columns:t.columns,empty:t.$t("field.structure.empty"),rows:t.rows},nativeOn:{dblclick:function(e){return t.open.apply(null,arguments)}}})}),[]).exports;const bs=ot({extends:Ue,emits:["open","split","update"],computed:{component(){const t="k-"+this.textField.type+"-input";return this.$helper.isComponent(t)?t:"k-writer-input"},isSplitable(){return this.content.text.length>0&&!1===this.$refs.input.isCursorAtStart&&!1===this.$refs.input.isCursorAtEnd},keys(){const t={"Mod-Enter":this.split};return!0===this.textField.inline&&(t.Enter=this.split),t},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.input.focus()},merge(t){this.update({text:t.map((t=>t.content.text)).join(this.textField.inline?" ":"")})},split(){var t,e;const s=null==(e=(t=this.$refs.input).getSplitContent)?void 0:e.call(t);s&&("writer"===this.textField.type&&(s[0]=s[0].replace(/(

          <\/p>)$/,""),s[1]=s[1].replace(/^(

          <\/p>)/,"")),this.$emit("split",s.map((t=>({text:t})))))}}},(function(){var t=this;return(0,t._self._c)(t.component,t._b({ref:"input",tag:"component",staticClass:"k-block-type-text-input",attrs:{disabled:t.disabled,keys:t.keys,value:t.content.text},on:{input:function(e){return t.update({text:e})}}},"component",t.textField,!1))}),[]).exports;const ys=ot({extends:Ue,computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},location(){return this.content.location},poster(){var t,e;return null==(e=null==(t=this.content.poster)?void 0:t[0])?void 0:e.url},video(){var t,e;return"kirby"===this.content.location?null==(e=null==(t=this.content.video)?void 0:t[0])?void 0:e.url:this.$helper.embed.video(this.content.url??"",!0)}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{staticClass:"k-block-type-video-figure",attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,disabled:t.disabled,"empty-text":t.$t("field.blocks.video.placeholder")+" …","is-empty":!t.video,"empty-icon":"video"},on:{open:t.open,update:t.update}},[e("k-frame",{attrs:{ratio:"16/9"}},[t.video?["kirby"==t.location?e("video",{attrs:{src:t.video,poster:t.poster,controls:""}}):e("iframe",{attrs:{src:t.video,referrerpolicy:"strict-origin-when-cross-origin"}})]:t._e()],2)],1)}),[]).exports,vs={install(t){t.component("k-block",Ge),t.component("k-blocks",Qe),t.component("k-block-options",We),t.component("k-block-pasteboard",ts),t.component("k-block-selector",ss),t.component("k-block-background-dropdown",is),t.component("k-block-figure",ns),t.component("k-block-figure-caption",os),t.component("k-block-title",Ve),t.component("k-block-type-code",rs),t.component("k-block-type-default",Ue),t.component("k-block-type-fields",as),t.component("k-block-type-gallery",cs),t.component("k-block-type-heading",us),t.component("k-block-type-image",ds),t.component("k-block-type-line",hs),t.component("k-block-type-list",ms),t.component("k-block-type-markdown",fs),t.component("k-block-type-quote",gs),t.component("k-block-type-table",ks),t.component("k-block-type-text",bs),t.component("k-block-type-video",ys)}};const $s=ot({mixins:[qe,Xe],inheritAttrs:!1,data:()=>({opened:[]}),computed:{hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.value.length},isFull(){return this.max&&this.value.length>=this.max},options(){return[{click:()=>this.$refs.blocks.copyAll(),disabled:this.isEmpty,icon:"template",text:this.$t("copy.all")},{click:()=>this.$refs.blocks.pasteboard(),disabled:this.isFull,icon:"download",text:this.$t("paste")},"-",{click:()=>this.$refs.blocks.removeAll(),disabled:this.isEmpty,icon:"trash",text:this.$t("delete.all")}]}},methods:{focus(){this.$refs.blocks.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-blocks-field",t.$attrs.class],style:t.$attrs.style,scopedSlots:t._u([!t.disabled&&t.hasFieldsets?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{staticClass:"input-focus",attrs:{autofocus:t.autofocus,disabled:t.isFull,responsive:!0,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}}),e("k-button",{attrs:{icon:"dots",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:t.options,"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input-validator",t._b({attrs:{value:JSON.stringify(t.value)}},"k-input-validator",{min:t.min,max:t.max,required:t.required},!1),[e("k-blocks",t._b({ref:"blocks",on:{close:function(e){t.opened=e},open:function(e){t.opened=e},input:function(e){return t.$emit("input",e)}}},"k-blocks",t.$props,!1))],1),t.disabled||t.isEmpty||t.isFull||!t.hasFieldsets?t._e():e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}})],1)],1)}),[]).exports,xs={mixins:[Se,tt],props:{columns:{default:1,type:Number},max:Number,min:Number,theme:String,value:{type:Array,default:()=>[]}}},ws={mixins:[Ce,xs],data:()=>({selected:[]}),computed:{choices(){return this.options.map(((t,e)=>{const s=this.selected.includes(t.value);return{autofocus:this.autofocus&&0===e,checked:s,disabled:this.disabled||t.disabled||!s&&this.isFull,id:`${this.id}-${e}`,info:t.info,label:t.text,name:this.name??this.id,type:"checkbox",value:t.value}}))},isFull(){return this.max&&this.selected.length>=this.max}},watch:{value:{handler(t){this.selected=Array.isArray(t)?t:[]},immediate:!0}},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},input(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)},select(){this.focus()}}};const _s=ot(ws,(function(){var t=this,e=t._self._c;return e("fieldset",{class:["k-checkboxes-input",t.$attrs.class],style:t.$attrs.style,attrs:{disabled:t.disabled}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("options")))]),e("k-input-validator",t._b({attrs:{value:JSON.stringify(t.selected)}},"k-input-validator",{min:t.min,max:t.max,required:t.required},!1),[e("ul",{staticClass:"k-grid",style:{"--columns":t.columns},attrs:{"data-variant":"choices"}},t._l(t.choices,(function(s,i){return e("li",{key:i},[e("k-choice-input",t._b({on:{input:function(e){return t.input(s.value,e)}}},"k-choice-input",s,!1))],1)})),0)])],1)}),[]).exports,Ss={props:{counter:{type:Boolean,default:!0}},computed:{counterOptions(){const t=this.counterValue??this.value;return!(!1===this.counter||this.disabled||!t)&&{count:Array.isArray(t)?t.length:String(t).length,min:this.$props.min??this.$props.minlength,max:this.$props.max??this.$props.maxlength}},counterValue:()=>null}};const Cs=ot({mixins:[qe,ze,xs,Ss],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t,e=this,s=e._self._c;return s("k-field",e._b({class:["k-checkboxes-field",e.$attrs.class],style:e.$attrs.style,attrs:{counter:e.counterOptions,input:e.id+"-0"}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?s("k-checkboxes-input",e._b({ref:"input",on:{input:function(t){return e.$emit("input",t)}}},"k-checkboxes-input",e.$props,!1)):s("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[]).exports,Os={mixins:[Se,Y,R,U,X,Z,et,st,nt],props:{ariaLabel:String,preselect:Boolean,type:{default:"text",type:String},value:{type:String}}};const As=ot({mixins:[Ce,Os],mounted(){this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{select(){this.$el.select()}}},(function(){var t=this;return(0,t._self._c)("input",t._b({directives:[{name:"direction",rawName:"v-direction"}],class:["k-string-input",t.$attrs.class],style:t.$attrs.style,attrs:{"aria-label":t.ariaLabel,"data-font":t.font},on:{input:function(e){return t.$emit("input",e.target.value)}}},"input",{autocomplete:t.autocomplete,autofocus:t.autofocus,disabled:t.disabled,id:t.id,maxlength:t.maxlength,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))}),[]).exports,Ms={mixins:[Os],props:{autocomplete:null,font:null,maxlength:null,minlength:null,pattern:null,spellcheck:null,alpha:{type:Boolean,default:!0},format:{type:String,default:"hex",validator:t=>["hex","rgb","hsl"].includes(t)}}},Ds={mixins:[As,Ms],watch:{value(){this.validate()}},mounted(){this.validate()},methods:{convert(t){if(!t)return t;try{return this.$library.colors.toString(t,this.format,this.alpha)}catch{const e=document.createElement("div");return e.style.color=t,document.body.append(e),t=window.getComputedStyle(e).color,e.remove(),this.$library.colors.toString(t,this.format,this.alpha)}},convertAndEmit(t){this.emit(this.convert(t))},emit(t){this.$emit("input",t)},onBlur(){this.convertAndEmit(this.value)},onPaste(t){t instanceof ClipboardEvent&&(t=this.$helper.clipboard.read(t,!0)),this.convertAndEmit(t)},async onSave(){var t;this.convertAndEmit(this.value),await this.$nextTick(),null==(t=this.$el.form)||t.requestSubmit()},validate(){let t="";null===this.$library.colors.parse(this.value)&&(t=this.$t("error.validation.color",{format:this.format})),this.$el.setCustomValidity(t)}}};const js=ot(Ds,(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-colorname-input",attrs:{spellcheck:!1,autocomplete:"off",type:"text"},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{blur:function(e){return t.onBlur.apply(null,arguments)},paste:function(e){return t.onPaste.apply(null,arguments)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?(e.stopPropagation(),e.preventDefault(),t.onSave.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onSave.apply(null,arguments)}]}},"k-string-input",t.$props,!1))}),[]).exports,Es={mixins:[qe,ze,Ms],inheritAttrs:!1,props:{icon:{type:String,default:"pipette"},mode:{type:String,default:"picker",validator:t=>["picker","input","options"].includes(t)},options:{type:Array,default:()=>[]}},computed:{convertedOptions(){return this.options.map((t=>({...t,value:this.convert(t.value)})))},currentOption(){return this.convertedOptions.find((t=>t.value===this.value))}},methods:{convert(t){return this.$library.colors.toString(t,this.format,this.alpha)}}};const Ts=ot(Es,(function(){var t,e=this,s=e._self._c;return s("k-field",e._b({class:["k-color-field",e.$attrs.class],style:e.$attrs.style,attrs:{input:e.id}},"k-field",e.$props,!1),["options"===e.mode?s("k-coloroptions-input",e._b({staticClass:"k-color-field-options",attrs:{options:e.convertedOptions},on:{input:function(t){return e.$emit("input",t)}}},"k-coloroptions-input",e.$props,!1)):s("k-input",e._b({attrs:{type:"color"},scopedSlots:e._u([{key:"before",fn:function(){return["picker"===e.mode?[s("button",{staticClass:"k-color-field-picker-toggle",attrs:{disabled:e.disabled,type:"button"},on:{click:function(t){return e.$refs.picker.toggle()}}},[s("k-color-frame",{attrs:{color:e.value}})],1),s("k-dropdown-content",{ref:"picker",staticClass:"k-color-field-picker"},[s("k-colorpicker-input",e._b({ref:"color",attrs:{options:e.convertedOptions},on:{input:function(t){return e.$emit("input",t)}},nativeOn:{click:function(t){t.stopPropagation()}}},"k-colorpicker-input",e.$props,!1))],1)]:s("k-color-frame",{attrs:{color:e.value}})]},proxy:!0},{key:"default",fn:function(){return[s("k-colorname-input",e._b({on:{input:function(t){return e.$emit("input",t)}}},"k-colorname-input",e.$props,!1))]},proxy:!0},(null==(t=e.currentOption)?void 0:t.text)?{key:"after",fn:function(){return[s("span",{domProps:{innerHTML:e._s(e.currentOption.text)}})]},proxy:!0}:null,"picker"===e.mode?{key:"icon",fn:function(){return[s("k-button",{staticClass:"k-input-icon-button",attrs:{icon:e.icon},on:{click:function(t){return t.stopPropagation(),e.$refs.picker.toggle()}}})]},proxy:!0}:null],null,!0)},"k-input",e.$props,!1))],1)}),[]).exports,Is={props:{max:String,min:String,value:String}},Ls={mixins:[Se,Is],props:{display:{type:String,default:"DD.MM.YYYY"},step:{type:Object,default:()=>({size:1,unit:"day"})},type:{type:String,default:"date"}}},Bs={mixins:[Ce,Ls],emits:["input","focus","submit"],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}},methods:{async 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),await this.$nextTick(),this.select(n)},commit(t){this.dt=t,this.formatted=this.pattern.format(t),this.validate()},emit(t){this.$emit("input",this.toISO(t))},onArrowDown(){this.alter("subtract")},onArrowUp(){this.alter("add")},onBlur(){const t=this.parse();this.commit(t),this.emit(t)},async onEnter(){this.onBlur(),await 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)},async onTab(t){if(""==this.$el.value)return;this.onBlur(),await this.$nextTick();const e=this.selection();if(this.$el&&e.start===this.$el.selectionStart&&e.end===this.$el.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{if(this.$el&&this.$el.selectionStart==e.end+1&&e.index==this.pattern.parts.length-1)return;if(this.$el&&this.$el.selectionEnd-1>e.end){const t=this.pattern.at(this.$el.selectionEnd,this.$el.selectionEnd);this.select(this.pattern.parts[t.index])}else this.select(this.pattern.parts[e.index])}t.preventDefault()},parse(){const t=this.$library.dayjs.interpret(this.$el.value,this.inputType);return this.round(t)},round(t){return null==t?void 0:t.round(this.rounding.unit,this.rounding.size)},select(t){var e;t??(t=this.selection()),null==(e=this.$el)||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.$el.selectionStart,this.$el.selectionEnd)},toDatetime(t){return this.round(this.$library.dayjs.iso(t,this.inputType))},toISO(t){return null==t?void 0:t.toISO(this.inputType)},validate(){var t,e,s;const i=[];this.required&&!this.dt&&i.push(this.$t("error.validation.required")),this.min&&!1===(null==(t=this.dt)?void 0:t.validate(this.min,"min",this.rounding.unit))&&i.push(this.$t("error.validation.date.after",{date:this.min})),this.max&&!1===(null==(e=this.dt)?void 0:e.validate(this.max,"max",this.rounding.unit))&&i.push(this.$t("error.validation.date.before",{date:this.max})),null==(s=this.$el)||s.setCustomValidity(i.join(", "))}}};const qs=ot(Bs,(function(){var t=this;return(0,t._self._c)("input",{directives:[{name:"direction",rawName:"v-direction"}],class:["k-text-input",`k-${t.type}-input`,t.$attrs.class],style:t.$attrs.style,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){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,"s",void 0,e.key,void 0)?null:e.metaKey?(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.ctrlKey?(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:t.onTab.apply(null,arguments)}]}})}),[]).exports,Ps={mixins:[qe,ze,Ls],inheritAttrs:!1,props:{calendar:{type:Boolean,default:!0},icon:{type:String,default:"calendar"},time:{type:[Boolean,Object],default:()=>({})},times:{type:Boolean,default:!0}},emits:["input","submit"],data(){return{iso:this.toIso(this.value)}},computed:{isEmpty(){return this.time?!this.iso.date||!this.iso.time:!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())??"")},onDateInput(t){t&&!this.iso.time&&(this.iso.time=this.now().time),this.iso.date=t,this.onInput()},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}}}};const Ns=ot(Ps,(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-date-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("div",{ref:"body",staticClass:"k-date-field-body",attrs:{"data-has-time":Boolean(t.time)}},[e("k-input",t._b({ref:"dateInput",attrs:{type:"date"},on:{input:t.onDateInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.calendar?{key:"icon",fn:function(){return[e("k-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.icon,title:t.$t("date.select")},on:{click:function(e){return t.$refs.calendar.toggle()}}}),e("k-dropdown-content",{ref:"calendar",attrs:{"align-x":"end"}},[e("k-calendar",{attrs:{value:t.iso.date,min:t.min,max:t.max},on:{input:t.onDateInput}})],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,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-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.time.icon??"clock",title:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{"align-x":"end"}},[e("k-timeoptions-input",{attrs:{display:t.time.display,value:t.value},on:{input:t.onTimesInput}})],1)]},proxy:!0}:null],null,!0)}):t._e()],1)])}),[]).exports,Fs={mixins:[Os],props:{autocomplete:{type:String,default:"email"},placeholder:{type:String,default:()=>window.panel.$t("email.placeholder")}}};const zs=ot({mixins:[As,Fs]},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-email-input",attrs:{type:"email"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[]).exports;const Ys=ot({mixins:[qe,ze,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()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-email-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"email"},on:{input:function(e){return t.$emit("input",e)}},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,title:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1))],1)}),[]).exports,Rs={type:"model",mixins:[qe,R,G],inheritAttrs:!1,props:{empty:String,info:String,link:Boolean,max:Number,min:Number,multiple:Boolean,parent:String,search:Boolean,size:String,text:String,value:{type:Array,default:()=>[]}},emits:["change","input"],data(){return{selected:this.value}},computed:{buttons(){return[{autofocus:this.autofocus,text:this.$t("select"),icon:"checklist",responsive:!0,click:()=>this.open()}]},collection(){return{empty:this.emptyProps,items:this.selected,layout:this.layout,link:this.link,size:this.size,sortable:!this.disabled&&this.selected.length>1,theme:this.disabled?"disabled":null}},hasDropzone:()=>!1,more(){return!this.max||this.max>this.selected.length}},watch:{value(t){this.selected=t}},methods:{drop(){},focus(){},onInput(){this.$emit("input",this.selected)},open(){if(this.disabled)return!1;this.$panel.dialog.open({component:`k-${this.$options.type}-dialog`,props:{endpoint:this.endpoints.field,hasSearch:this.search,max:this.max,multiple:this.multiple,value:this.selected.map((t=>t.id))},on:{submit:t=>{this.select(t),this.$panel.dialog.close()}}})},remove(t){this.selected.splice(t,1),this.onInput()},removeById(t){this.selected=this.selected.filter((e=>e.id!==t)),this.onInput()},select(t){if(0===t.length)return this.selected=[],void this.onInput();this.selected=this.selected.filter((e=>t.find((t=>t.id===e.id))));for(const e of t)this.selected.find((t=>e.id===t.id))||this.selected.push(e);this.onInput()}}};const Vs=ot(Rs,(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-models-field",`k-${t.$options.type}-field`,t.$attrs.class],style:t.$attrs.style,scopedSlots:t._u([t.disabled?null:{key:"options",fn:function(){return[e("k-button-group",{ref:"buttons",staticClass:"k-field-options",attrs:{buttons:t.buttons,layout:"collapsed",size:"xs",variant:"filled"}})]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-dropzone",{attrs:{disabled:!t.hasDropzone},on:{drop:t.drop}},[e("k-input-validator",t._b({attrs:{value:JSON.stringify(t.value)}},"k-input-validator",{min:t.min,max:t.max,required:t.required},!1),[e("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([t.disabled?null:{key:"options",fn:function({index:s}){return[e("k-button",{attrs:{title:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(s)}}})]}}],null,!0)},"k-collection",t.collection,!1))],1)],1)],1)}),[]).exports;const Hs=ot({extends:Vs,type:"files",props:{uploads:[Boolean,Object,Array]},computed:{buttons(){const t=Vs.computed.buttons.call(this);return this.hasDropzone&&t.unshift({autofocus:this.autofocus,text:this.$t("upload"),responsive:!0,icon:"upload",click:()=>this.$panel.upload.pick(this.uploadOptions)}),t},emptyProps(){return{icon:"image",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.files.empty"):this.$t("field.files.empty.single"))}},hasDropzone(){return!this.disabled&&this.more&&this.uploads},uploadOptions(){return{accept:this.uploads.accept,max:this.max,multiple:this.multiple,preview:this.uploads.preview,url:this.$panel.urls.api+"/"+this.endpoints.field+"/upload",on:{done:t=>{!1===this.multiple&&(this.selected=[]);for(const e of t)void 0===this.selected.find((t=>t.id===e.id))&&this.selected.push(e);this.onInput(),this.$events.emit("file.upload"),this.$events.emit("model.update")}}}}},mounted(){this.$events.on("file.delete",this.removeById)},destroyed(){this.$events.off("file.delete",this.removeById)},methods:{drop(t){return!1!==this.uploads&&this.$panel.upload.open(t,this.uploadOptions)}}},null,null).exports;const Us=ot({},(function(){return(0,this._self._c)("div",{staticClass:"k-field k-gap-field"})}),[]).exports;const Ks=ot({mixins:[K,J],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("div",{class:["k-headline-field",t.$attrs.class],style:t.$attrs.style},[e("k-headline",{staticClass:"h2"},[t._v(" "+t._s(t.label)+" ")]),t.help?e("footer",{staticClass:"k-field-footer"},[e("k-text",{staticClass:"k-help k-field-help",attrs:{html:t.help}})],1):t._e()],1)}),[]).exports;const Ws=ot({mixins:[K,J],props:{icon:String,text:String,theme:{type:String,default:"info"}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-field k-info-field"},[t.label?e("k-headline",[t._v(t._s(t.label))]):t._e(),e("k-box",{attrs:{icon:t.icon,theme:t.theme}},[e("k-text",{attrs:{html:t.text}})],1),t.help?e("footer",{staticClass:"k-field-footer"},[e("k-text",{staticClass:"k-help k-field-help",attrs:{html:t.help}})],1):t._e()],1)}),[]).exports,Js={props:{endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean}};const Gs=ot({mixins:[Js],props:{blocks:Array,width:{type:String,default:"1/1"}},emits:["input"]},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column k-layout-column",style:{"--width":t.width},attrs:{id:t.id,tabindex:"0"},on:{dblclick:function(e){return t.$refs.blocks.choose(t.blocks.length)}}},[e("k-blocks",t._b({ref:"blocks",on:{input:function(e){return t.$emit("input",e)}},nativeOn:{dblclick:function(t){t.stopPropagation()}}},"k-blocks",{endpoints:t.endpoints,fieldsets:t.fieldsets,fieldsetGroups:t.fieldsetGroups,group:"layout",value:t.blocks},!1))],1)}),[]).exports,Xs={mixins:[Js,H],props:{columns:Array,layouts:{type:Array,default:()=>[["1/1"]]},settings:Object}};const Zs=ot({mixins:[Xs],props:{attrs:[Array,Object]},emits:["append","change","copy","duplicate","prepend","remove","select","updateAttrs","updateColumn"],computed:{options(){return[{click:()=>this.$emit("prepend"),icon:"angle-up",text:this.$t("insert.before")},{click:()=>this.$emit("append"),icon:"angle-down",text:this.$t("insert.after")},"-",{click:()=>this.openSettings(),icon:"settings",text:this.$t("settings"),when:!1===this.$helper.object.isEmpty(this.settings)},{click:()=>this.$emit("duplicate"),icon:"copy",text:this.$t("duplicate")},{click:()=>this.$emit("change"),disabled:1===this.layouts.length,icon:"dashboard",text:this.$t("field.layout.change")},"-",{click:()=>this.$emit("copy"),icon:"template",text:this.$t("copy")},{click:()=>this.$emit("paste"),icon:"download",text:this.$t("paste.after")},"-",{click:()=>this.remove(),icon:"trash",text:this.$t("field.layout.delete")}]},tabs(){let t=this.settings.tabs;for(const[e,s]of Object.entries(t))for(const i in s.fields)t[e].fields[i].endpoints={field:this.endpoints.field+"/fields/"+i,section:this.endpoints.section,model:this.endpoints.model};return t}},methods:{openSettings(){this.$panel.drawer.open({component:"k-form-drawer",props:{icon:"settings",tabs:this.tabs,title:this.$t("settings"),value:this.attrs},on:{input:t=>this.$emit("updateAttrs",t)}})},remove(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.layout.delete.confirm")},on:{submit:()=>{this.$emit("remove"),this.$panel.dialog.close()}}})}}},(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,on:{input:function(e){return t.$emit("updateColumn",{column:s,columnIndex:i,blocks:e})}}},"k-layout-column",{...s,endpoints:t.endpoints,fieldsetGroups:t.fieldsetGroups,fieldsets:t.fieldsets},!1))})),1),t.disabled?t._e():e("nav",{staticClass:"k-layout-toolbar"},[t.settings?e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{title:t.$t("settings"),icon:"settings"},on:{click:t.openSettings}}):t._e(),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:{options:t.options,"align-x":"end"}}),e("k-sort-handle")],1)],1)}),[]).exports,Qs={mixins:[Xs,W],props:{empty:String,min:Number,max:Number,selector:Object,value:{type:Array,default:()=>[]}}},ti={mixins:[Qs],emits:["input"],data(){return{current:null,nextIndex:null,rows:this.value,selected:null}},computed:{draggableOptions(){return{handle:!0,list:this.rows}},hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0}},watch:{value(){this.rows=this.value}},methods:{copy(t,e){if(0===this.rows.length)return!1;const s=void 0!==e?this.rows[e]:this.rows;this.$helper.clipboard.write(JSON.stringify(s),t),this.$panel.notification.success({message:this.$t("copy.success",{count:s.length??1}),icon:"template"})},change(t,e){const s=e.columns.map((t=>t.width)),i=this.layouts.findIndex((t=>t.toString()===s.toString()));this.$panel.dialog.open({component:"k-layout-selector",props:{label:this.$t("field.layout.change"),layouts:this.layouts,selector:this.selector,value:this.layouts[i]},on:{submit:s=>{this.onChange(s,i,{rowIndex:t,layoutIndex:i,layout:e}),this.$panel.dialog.close()}}})},duplicate(t,e){const s=this.$helper.object.clone(e),i=this.updateIds(s);this.rows.splice(t+1,0,...i),this.save()},async onAdd(t){let e=await this.$api.post(this.endpoints.field+"/layout",{columns:t});this.rows.splice(this.nextIndex,0,e),this.save()},async onChange(t,e,s){if(e===this.layouts[s.layoutIndex])return;const i=s.layout,n=await this.$api.post(this.endpoints.field+"/layout",{attrs:i.attrs,columns:t}),o=i.columns.filter((t=>{var e;return(null==(e=null==t?void 0:t.blocks)?void 0:e.length)>0})),r=[];if(0===o.length)r.push(n);else{const t=Math.ceil(o.length/n.columns.length)*n.columns.length;for(let e=0;e{var i;return t.blocks=(null==(i=o[s+e])?void 0:i.blocks)??[],t})),t.columns.filter((t=>{var e;return null==(e=null==t?void 0:t.blocks)?void 0:e.length})).length&&r.push(t)}}this.rows.splice(s.rowIndex,1,...r),this.save()},async paste(t,e=this.rows.length){let s=await this.$api.post(this.endpoints.field+"/layout/paste",{json:this.$helper.clipboard.read(t)});s.length&&(this.rows.splice(e,0,...s),this.save()),this.$panel.notification.success({message:this.$t("paste.success",{count:s.length}),icon:"download"})},pasteboard(t){this.$panel.dialog.open({component:"k-block-pasteboard",on:{paste:e=>this.paste(e,t)}})},remove(t){const e=this.rows.findIndex((e=>e.id===t.id));-1!==e&&this.$delete(this.rows,e),this.save()},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.layout.delete.confirm.all")},on:{submit:()=>{this.rows=[],this.save(),this.$panel.dialog.close()}}})},save(){this.$emit("input",this.rows)},select(t){if(this.nextIndex=t,1===this.layouts.length)return this.onAdd(this.layouts[0]);this.$panel.dialog.open({component:"k-layout-selector",props:{layouts:this.layouts,selector:this.selector,value:null},on:{submit:t=>{this.onAdd(t),this.$panel.dialog.close()}}})},updateAttrs(t,e){this.rows[t].attrs=e,this.save()},updateColumn(t){this.rows[t.index].columns[t.columnIndex].blocks=t.blocks,this.save()},updateIds(t){return!1===Array.isArray(t)&&(t=[t]),t.map((t=>(t.id=this.$helper.uuid(),t.columns=t.columns.map((t=>(t.id=this.$helper.uuid(),t.blocks=t.blocks.map((t=>(t.id=this.$helper.uuid(),t))),t))),t)))}}};const ei=ot(ti,(function(){var t=this,e=t._self._c;return e("div",[t.hasFieldsets&&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,on:{append:function(e){return t.select(i+1)},change:function(e){return t.change(i,s)},copy:function(e){return t.copy(e,i)},duplicate:function(e){return t.duplicate(i,s)},paste:function(e){return t.pasteboard(i+1)},prepend:function(e){return t.select(i)},remove:function(e){return t.remove(s)},select:function(e){t.selected=s.id},updateAttrs:function(e){return t.updateAttrs(i,e)},updateColumn:function(e){return t.updateColumn({layout:s,index:i,...e})}}},"k-layout",{...s,disabled:t.disabled,endpoints:t.endpoints,fieldsetGroups:t.fieldsetGroups,fieldsets:t.fieldsets,isSelected:t.selected===s.id,layouts:t.layouts,settings:t.settings},!1))})),1)]:!1===t.hasFieldsets?e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"}},[t._v(" "+t._s(t.$t("field.blocks.fieldsets.empty"))+" ")]):e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"},on:{click:function(e){return t.select(0)}}},[t._v(" "+t._s(t.empty??t.$t("field.layout.empty"))+" ")])],2)}),[]).exports;const si=ot({mixins:[qe,Qs,R],inheritAttrs:!1,computed:{hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.value.length},options(){return[{click:()=>this.$refs.layouts.copy(),disabled:this.isEmpty,icon:"template",text:this.$t("copy.all")},{click:()=>this.$refs.layouts.pasteboard(),icon:"download",text:this.$t("paste")},"-",{click:()=>this.$refs.layouts.removeAll(),disabled:this.isEmpty,icon:"trash",text:this.$t("delete.all")}]}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-layout-field",t.$attrs.class],style:t.$attrs.style,scopedSlots:t._u([!t.disabled&&t.hasFieldsets?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{staticClass:"input-focus",attrs:{autofocus:t.autofocus,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.layouts.select(0)}}}),e("k-button",{attrs:{icon:"dots",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:t.options,"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input-validator",t._b({attrs:{value:JSON.stringify(t.value)}},"k-input-validator",{min:t.min,max:t.max,required:t.required},!1),[e("k-layouts",t._b({ref:"layouts",on:{input:function(e){return t.$emit("input",e)}}},"k-layouts",t.$props,!1))],1),!t.disabled&&t.hasFieldsets?e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.layouts.select(t.value.length)}}})],1):t._e()],1)}),[]).exports;const ii=ot({},(function(){return(0,this._self._c)("hr",{staticClass:"k-line-field"})}),[]).exports,ni={mixins:[{mixins:[qe,ze,Se,tt],props:{value:{default:"",type:String}}}],inheritAttrs:!1,data:()=>({linkType:null,linkValue:null,expanded:!1}),computed:{activeTypes(){return this.$helper.link.types(this.options)},activeTypesOptions(){const t=[];for(const e in this.activeTypes)t.push({click:()=>this.switchType(e),current:e===this.currentType.id,icon:this.activeTypes[e].icon,label:this.activeTypes[e].label});return t},currentType(){return this.activeTypes[this.linkType]??Object.values(this.activeTypes)[0]}},watch:{value:{async handler(t,e){if(t===e||t===this.linkValue)return;const s=this.$helper.link.detect(t,this.activeTypes);s&&(this.linkType=s.type,this.linkValue=s.link)},immediate:!0}},mounted(){this.$events.on("click",this.onOutsideClick)},destroyed(){this.$events.off("click",this.onOutsideClick)},methods:{clear(){this.linkValue="",this.$emit("input","")},focus(){var t;null==(t=this.$refs.input)||t.focus()},onInput(t){const e=(null==t?void 0:t.trim())??"";if(this.linkType??(this.linkType=this.currentType.id),this.linkValue=e,!e.length)return this.clear();this.$emit("input",this.currentType.value(e))},onOutsideClick(t){!1===this.$el.contains(t.target)&&(this.expanded=!1)},removeModel(){this.clear(),this.expanded=!1},selectModel(t){t.uuid?this.onInput(t.uuid):(this.switchType("url"),this.onInput(t.url))},async switchType(t){t!==this.currentType.id&&(this.linkType=t,this.clear(),"page"===this.currentType.id||"file"===this.currentType.id?this.expanded=!0:this.expanded=!1,await this.$nextTick(),this.focus())},toggle(){this.expanded=!this.expanded}}};const oi=ot(ni,(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-link-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({attrs:{icon:!1}},"k-input",t.$props,!1),[e("div",{staticClass:"k-link-input-header"},[e("k-button",{staticClass:"k-link-input-toggle",attrs:{disabled:t.disabled,dropdown:!t.disabled&&t.activeTypesOptions.length>1,icon:t.currentType.icon,variant:"filled"},on:{click:function(e){t.activeTypesOptions.length>1?t.$refs.types.toggle():t.toggle()}}},[t._v(" "+t._s(t.currentType.label)+" ")]),e("k-dropdown-content",{ref:"types",attrs:{options:t.activeTypesOptions}}),"page"===t.currentType.id||"file"===t.currentType.id?e("div",{staticClass:"k-link-input-model",on:{click:t.toggle}},[e("k-link-field-preview",{attrs:{removable:!0,type:t.currentType.id,value:t.value},on:{remove:t.removeModel},scopedSlots:t._u([{key:"placeholder",fn:function(){return[e("k-button",{staticClass:"k-link-input-model-placeholder"},[t._v(" "+t._s(t.currentType.placeholder)+" ")])]},proxy:!0}],null,!1,3171606015)}),e("k-button",{staticClass:"k-link-input-model-toggle",attrs:{icon:"bars"}})],1):e("k-"+t.currentType.input+"-input",{ref:"input",tag:"component",attrs:{id:t.id,disabled:t.disabled,pattern:t.currentType.pattern??null,placeholder:t.currentType.placeholder,required:t.required,value:t.linkValue},on:{input:t.onInput}})],1),"page"===t.currentType.id?e("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"k-link-input-body",attrs:{"data-type":"page"}},[e("div",{staticClass:"k-page-browser"},[e("k-page-tree",{attrs:{current:t.$helper.link.getPageUUID(t.value),root:!1},on:{select:function(e){return t.selectModel(e)}}})],1)]):"file"===t.currentType.id?e("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"k-link-input-body",attrs:{"data-type":"file"}},[e("k-file-browser",{attrs:{opened:t.$panel.view.props.model.uuid??t.$panel.view.props.model.id,selected:t.$helper.link.getFileUUID(t.value)},on:{select:function(e){return t.selectModel(e)}}})],1):t._e()])],1)}),[]).exports;const ri=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),ai=t=>e=>{if((t=>t instanceof o)(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}}},li=(t,e,s={})=>{const i=ai(e)(t.selection)||ri((t=>t.type===e))(t.selection);return 0!==kt(s)&&i?i.node.hasMarkup(e,{...i.node.attrs,...s}):!!i};function ci(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,a=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:{}},insertNode:function(t,e,s,i){return(n,o)=>{o(n.tr.replaceSelectionWith(t.create(e,s,i)).scrollIntoView())}},markInputRule:function(t,s,i){return new e(t,((t,e,n,o)=>{const r=i instanceof Function?i(e):i,{tr:a}=t,l=e.length-1;let c=o,u=n;if(e[l]){const i=n+e[0].indexOf(e[l-1]),r=i+e[l-1].length-1,p=i+e[l-1].lastIndexOf(e[l]),d=p+e[l].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:e}=t.mark.type;return e.find((t=>t.name===s.name))})).filter((t=>t.end>i));if(h.length)return!1;di&&a.delete(i,p),u=i,c=u+e[l].length}return a.addMark(u,c,s.create(r)),a.removeStoredMark(s),a}))},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,o){const r=(s,i)=>{const a=[];return s.forEach((s=>{var n;if(s.isText){const{text:r,marks:l}=s;let c,u=0;const p=!!l.filter((t=>"link"===t.type.name))[0];for(;!p&&null!==(c=t.exec(r));)if((null==(n=null==i?void 0:i.type)?void 0:n.allowsMarkType(e))&&c[1]){const t=c.index,i=t+c[0].length,n=t+c[0].indexOf(c[1]),r=n+c[1].length,l=o instanceof Function?o(c):o;t>0&&a.push(s.cut(u,t)),a.push(s.cut(n,r).mark(e.create(l).addToSet(s.marks))),u=i}unew i(r(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:li,nodeInputRule:function(t,s,i){return new e(t,((t,e,n,o)=>{const r=i instanceof Function?i(e):i,{tr:a}=t;return e[0]&&a.replaceWith(n,o,s.create(r)),a}))},pasteRule:function(t,e,o){const r=s=>{const i=[];return s.forEach((s=>{if(s.isText){const{text:n}=s;let r,a=0;do{if(r=t.exec(n),r){const t=r.index,n=t+r[0].length,l=o instanceof Function?o(r[0]):o;t>0&&i.push(s.cut(a,t)),i.push(s.cut(t,n).mark(e.create(l).addToSet(s.marks))),a=n}}while(r);anew i(r(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:a,empty:l}=n;if(l){const e=ci(a,t);o=e.from,r=e.to}return i.removeMark(o,r,t),s(i)}},toggleBlockType:function(t,e,s={}){return(i,n,o)=>li(i,t,s)?r(e)(i,n,o):r(t,s)(i,n,o)},toggleList:function(t,e){return(s,i,n)=>{const{schema:o,selection:r}=s,{$from:c,$to:u}=r,p=c.blockRange(u);if(!p)return!1;const d=ri((t=>ui(t,o)))(r);if(p.depth>=1&&d&&p.depth-d.depth<=1){if(d.node.type===t)return a(e)(s,i,n);if(ui(d.node,o)&&t.validContent(d.node.content)){const{tr:e}=s;return e.setNodeMarkup(d.pos,t),i&&i(e),!1}}return l(t)(s,i,n)}},toggleWrap:function(t,e={}){return(s,i,n)=>li(s,t,e)?c(s,i):u(t,e)(s,i,n)},updateMark:function(t,e){return(s,i)=>{const{tr:n,selection:o,doc:r}=s,{ranges:a,empty:l}=o;if(l){const{from:s,to:i}=ci(o.$from,t);r.rangeHasMark(s,i,t)&&n.removeMark(s,i,t),n.addMark(s,i,t.create(e))}else a.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 di{emit(t,...e){this._callbacks=this._callbacks??{};const s=this._callbacks[t]??[];for(const i of s)i.apply(this,e);return 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}}class hi{constructor(t=[],e){for(const s of t)s.bindEditor(e),s.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={},a=i.commands({schema:t,utils:pi,...["node","mark"].includes(o)?{type:t[`${o}s`][n]}:{}}),l=(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}};if("object"==typeof a)for(const[t,e]of Object.entries(a))l(t,e);else l(n,a);return{...s,...r}}),{})}buttons(t="mark"){const e={};for(const s of this.extensions)if(s.type===t&&s.button)if(Array.isArray(s.button))for(const t of s.button)e[t.id??t.name]=t;else e[s.name]=s.button;return 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:pi})))}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:pi})))}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=>y(t)))}get marks(){return this.extensions.filter((t=>"mark"===t.type)).reduce(((t,{name:e,schema:s})=>({...t,[e]:s})),{})}get markViews(){return this.extensions.filter((t=>["mark"].includes(t.type))).filter((t=>t.view)).reduce(((t,{name:e,view:s})=>({...t,[e]:s})),{})}get nodes(){return this.extensions.filter((t=>"node"===t.type)).reduce(((t,{name:e,schema:s})=>({...t,[e]:s})),{})}get nodeViews(){return this.extensions.filter((t=>["node"].includes(t.type))).filter((t=>t.view)).reduce(((t,{name:e,view: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 s?t:new s(t)))}}class mi{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 fi extends mi{constructor(t={}){super(t)}get type(){return"node"}get schema(){return{}}commands(){return{}}}class gi extends fi{get defaults(){return{inline:!1}}get name(){return"doc"}get schema(){return{content:this.options.inline?"inline*":"block+"}}}class ki extends fi{get button(){return{id:this.name,icon:"paragraph",label:window.panel.$t("toolbar.button.paragraph"),name:this.name,separator:!0}}commands({utils:t,schema:e,type:s}){return{paragraph:()=>this.editor.activeNodes.includes("bulletList")?t.toggleList(e.nodes.bulletList,e.nodes.listItem):this.editor.activeNodes.includes("orderedList")?t.toggleList(e.nodes.orderedList,e.nodes.listItem):this.editor.activeNodes.includes("quote")?t.toggleWrap(e.nodes.quote):t.setBlockType(s)}}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}get name(){return"paragraph"}}let bi=class extends fi{get name(){return"text"}get schema(){return{group:"inline"}}};class yi extends di{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!0!==this.options.useBuiltInExtensions?[]:[new gi({inline:this.options.inline}),new bi,new ki]}buttons(t){return this.extensions.buttons(t)}clearContent(t=!1){this.setContent(this.options.emptyDocument,t)}command(t,...e){var s,i;null==(i=(s=this.commands)[t])||i.call(s,...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 v.fromSchema(this.schema).parse(i,e)}return!1}createEvents(){const t=this.options.events??{};for(const[e,s]of Object.entries(t))this.on(e,s);return t}createExtensions(){return new hi([...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 s({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}createMarkViews(){return this.extensions.markViews}createNodes(){return this.extensions.nodes}createNodeViews(){return this.extensions.nodeViews}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createPlugins(){return this.extensions.plugins({schema:this.schema})}createSchema(){return new $({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return x.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,w({rules:this.inputRules}),...this.pasteRules,...this.keymaps,y({Backspace:O}),y(A),this.createFocusEvents()]})}createView(){return new _(this.element,{dispatchTransaction:this.dispatchTransaction.bind(this),attributes:{class:"k-text"},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)},markViews:this.createMarkViews(),nodeViews:this.createNodeViews(),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.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(t=this.state.doc.content){const e=document.createElement("div"),s=S.fromSchema(this.schema).serializeFragment(t);return e.appendChild(s),this.options.inline&&e.querySelector("p")?e.querySelector("p").innerHTML:e.innerHTML}getHTMLStartToSelection(){const t=this.state.doc.slice(0,this.selection.head).content;return this.getHTML(t)}getHTMLSelectionToEnd(){const t=this.state.doc.slice(this.selection.head).content;return this.getHTML(t)}getHTMLStartToSelectionToEnd(){return[this.getHTMLStartToSelection(),this.getHTMLSelectionToEnd()]}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.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)}insertText(t,e=!1){const{tr:s}=this.state,i=s.insertText(t);if(this.view.dispatch(i),e){const e=s.selection.from,i=e-t.length;this.setSelection(i,e)}}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 pi.removeMark(this.schema.marks[t])(this.state,this.view.dispatch)}get selection(){return this.state.selection}get selectionAtEnd(){return C.atEnd(this.state.doc)}get selectionIsAtEnd(){return this.selection.head===this.selectionAtEnd.head}get selectionAtStart(){return C.atStart(this.state.doc)}get selectionIsAtStart(){return this.selection.head===this.selectionAtStart.head}selectionAtPosition(t=null){return null===t?this.selection:"start"===t||!0===t?this.selectionAtStart:"end"===t?this.selectionAtEnd:{from:t,to:t}}setActiveNodesAndMarks(){this.activeMarks=Object.values(this.schema.marks).filter((t=>pi.markIsActive(this.state,t))).map((t=>t.name)),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce(((t,[e,s])=>({...t,[e]:pi.getMarkAttrs(this.state,s)})),{}),this.activeNodes=Object.values(this.schema.nodes).filter((t=>pi.nodeIsActive(this.state,t))).map((t=>t.name)),this.activeNodeAttrs=Object.entries(this.schema.nodes).reduce(((t,[e,s])=>({...t,[e]:pi.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=pi.minMax(t,0,s.content.size),o=pi.minMax(e,0,s.content.size),r=C.create(s,n,o),a=i.setSelection(r);this.view.dispatch(a)}get state(){var t;return null==(t=this.view)?void 0:t.state}toggleMark(t){if(this.schema.marks[t])return pi.toggleMark(this.schema.marks[t])(this.state,this.view.dispatch)}updateMark(t,e){if(this.schema.marks[t])return pi.updateMark(this.schema.marks[t],e)(this.state,this.view.dispatch)}}class vi extends mi{command(){return()=>{}}remove(){this.editor.removeMark(this.name)}get schema(){return{}}get type(){return"mark"}toggle(){return this.editor.toggleMark(this.name)}update(t){this.editor.updateMark(this.name,t)}}class $i extends vi{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 xi extends vi{get button(){return{icon:"clear",label:window.panel.$t("toolbar.button.clear")}}commands(){return()=>this.clear()}clear(){const{state:t}=this.editor,{from:e,to:s}=t.tr.selection;for(const i of this.editor.activeMarks){const n=t.schema.marks[i],o=this.editor.state.tr.removeMark(e,s,n);this.editor.view.dispatch(o)}}get name(){return"clear"}}let wi=class extends vi{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 _i extends vi{get button(){return{icon:"email",label:window.panel.$t("toolbar.button.email")}}commands(){return{email:t=>{if(t.altKey||t.metaKey)return this.remove();this.editor.emit("email",this.editor)},insertEmail:(t={})=>{const{selection:e}=this.editor.state;if(e.empty&&this.editor.insertText(t.href,!0),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 Si extends vi{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]}}}let Ci=class extends vi{get button(){return{icon:"url",label:window.panel.$t("toolbar.button.link")}}commands(){return{link:t=>{if(t.altKey||t.metaKey)return this.remove();this.editor.emit("link",this.editor)},insertLink:(t={})=>{const{selection:e}=this.editor.state;if(e.empty&&!1===this.editor.activeMarks.includes("link")&&this.editor.insertText(t.href,!0),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},0]}}};class Oi extends vi{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]}}}let Ai=class extends vi{get button(){return{icon:"superscript",label:window.panel.$t("toolbar.button.sup")}}commands(){return()=>this.toggle()}get name(){return"sup"}get schema(){return{parseDOM:[{tag:"sup"}],toDOM:()=>["sup",0]}}};class Mi extends vi{get button(){return{icon:"subscript",label:window.panel.$t("toolbar.button.sub")}}commands(){return()=>this.toggle()}get name(){return"sub"}get schema(){return{parseDOM:[{tag:"sub"}],toDOM:()=>["sub",0]}}}class Di extends vi{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 fi{get button(){return{id:this.name,icon:"list-bullet",label:window.panel.$t("toolbar.button.ul"),name:this.name,when:["listItem","bulletList","orderedList","paragraph"]}}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 Ei extends fi{commands({utils:t,type:e}){return()=>this.createHardBreak(t,e)}createHardBreak(t,e){return t.chainCommands(t.exitCode,t.insertNode(e))}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 Ti extends fi{get button(){const t=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"]})));return t[t.length-1].separator=!0,t}commands({type:t,schema:e,utils:s}){let i={toggleHeading:i=>s.toggleBlockType(t,e.nodes.paragraph,i)};for(const n of this.options.levels)i[`h${n}`]=()=>s.toggleBlockType(t,e.nodes.paragraph,{level:n});return 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 Ii extends fi{commands({type:t,utils:e}){return()=>e.insertNode(t)}inputRules({type:t,utils:e}){const s=e.nodeInputRule(/^(?:---|___\s|\*\*\*\s)$/,t),i=s.handler;return s.handler=(t,e,s,n)=>i(t,e,s,n).replaceWith(s-1,s,""),[s]}get name(){return"horizontalRule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}}class Li extends fi{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 Bi extends fi{get button(){return{id:this.name,icon:"list-numbers",label:window.panel.$t("toolbar.button.ol"),name:this.name,when:["listItem","bulletList","orderedList","paragraph"],separator:!0}}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 qi extends fi{get button(){return{id:this.name,icon:"quote",label:window.panel.$t("field.blocks.quote.name"),name:this.name}}commands({type:t,utils:e}){return()=>e.toggleWrap(t)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^\s*>\s$/,t)]}keys({utils:t}){return{"Shift-Tab":(e,s)=>t.lift(e,s)}}get name(){return"quote"}get schema(){return{content:"block+",group:"block",defining:!0,draggable:!1,parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]}}}let Pi=class extends mi{commands(){return{undo:()=>M,redo:()=>D,undoDepth:()=>j,redoDepth:()=>E}}get defaults(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":M,"Mod-y":D,"Shift-Mod-z":D,"Mod-я":M,"Shift-Mod-я":D}}get name(){return"history"}plugins(){return[T({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}};class Ni extends mi{commands(){return{insertHtml:t=>(e,s)=>{let i=document.createElement("div");i.innerHTML=t.trim();const n=v.fromSchema(e.schema).parse(i);s(e.tr.replaceSelectionWith(n).scrollIntoView())}}}}class Fi extends mi{keys(){const t={};for(const e in this.options)t[e]=()=>(this.options[e](),!0);return t}}let zi=class extends mi{constructor(t){super(),this.writer=t}get component(){return this.writer.$refs.toolbar}init(){this.editor.on("deselect",(({event:t})=>{var e;return null==(e=this.component)?void 0:e.close(t)})),this.editor.on("select",(({hasChanged:t})=>{var e;!1!==t&&(null==(e=this.component)||e.open())}))}get type(){return"toolbar"}};const Yi={mixins:[Se,X,Z,st,nt],props:{breaks:Boolean,code:Boolean,emptyDocument:{type:Object,default:()=>({type:"doc",content:[]})},extensions:Array,headings:{default:()=>[1,2,3,4,5,6],type:[Array,Boolean]},inline:Boolean,keys:Object,marks:{type:[Array,Boolean],default:!0},nodes:{type:[Array,Boolean],default:()=>["heading","bulletList","orderedList"]},paste:{type:Function,default:()=>()=>!1},toolbar:{type:Object,default:()=>({inline:!0})},value:{type:String,default:""}}};const Ri=ot({mixins:[Ce,Yi],emits:["input"],data(){return{editor:null,json:{},html:this.value,isEmpty:!0}},computed:{characters(){const t=this.$helper.string.stripHTML(this.value??"");return this.$helper.string.unescapeHTML(t).length},isCursorAtEnd(){return this.editor.selectionIsAtEnd},isCursorAtStart(){return this.editor.selectionIsAtStart},toolbarOptions(){return{marks:Array.isArray(this.marks)?this.marks:void 0,...this.toolbar,editor:this.editor}}},watch:{value(t,e){t!==e&&t!==this.html&&(this.html=t,this.editor.setContent(this.html))}},mounted(){this.editor=new yi({autofocus:this.autofocus,content:this.value,editable:!this.disabled,element:this.$el,emptyDocument:this.emptyDocument,parseOptions:{preserveWhitespace:!0},events:{link:t=>{this.$panel.dialog.open({component:"k-link-dialog",props:{value:t.getMarkAttrs("link")},on:{cancel:()=>t.focus(),submit:e=>{this.$panel.dialog.close(),t.command("toggleLink",e)}}})},email:t=>{this.$panel.dialog.open({component:"k-email-dialog",props:{value:this.editor.getMarkAttrs("email")},on:{cancel:()=>t.focus(),submit:e=>{this.$panel.dialog.close(),t.command("toggleEmail",e)}}})},paste:this.paste,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),this.validate())}},extensions:[...this.createMarks(),...this.createNodes(),new Fi(this.keys),new Pi,new Ni,new zi(this),...this.extensions||[]],inline:this.inline}),this.isEmpty=this.editor.isEmpty(),this.json=this.editor.getJSON(),this.$panel.events.on("click",this.onBlur),this.$panel.events.on("focus",this.onBlur),this.validate(),this.$props.autofocus&&this.focus()},beforeDestroy(){this.editor.destroy(),this.$panel.events.off("click",this.onBlur),this.$panel.events.off("focus",this.onBlur)},methods:{command(t,...e){this.editor.command(t,...e)},createMarks(){return this.filterExtensions({clear:new xi,code:new wi,underline:new Di,strike:new Oi,link:new Ci,email:new _i,bold:new $i,italic:new Si,sup:new Ai,sub:new Mi,...this.createMarksFromPanelPlugins()},this.marks)},createMarksFromPanelPlugins(){const t=window.panel.plugins.writerMarks??{},e={};for(const s in t)e[s]=Object.create(vi.prototype,Object.getOwnPropertyDescriptors({name:s,...t[s]}));return e},createNodes(){const t=new Ei({text:!0,enter:this.inline});return this.filterExtensions({bulletList:new ji,orderedList:new Bi,heading:new Ti({levels:this.headings}),horizontalRule:new Ii,listItem:new Li,quote:new qi,...this.createNodesFromPanelPlugins()},this.nodes,((e,s)=>((e.includes("bulletList")||e.includes("orderedList"))&&s.push(new Li),!0===this.inline&&(s=s.filter((t=>!0===t.schema.inline))),s.push(t),s)))},createNodesFromPanelPlugins(){const t=window.panel.plugins.writerNodes??{},e={};for(const s in t)e[s]=Object.create(fi.prototype,Object.getOwnPropertyDescriptors({name:s,...t[s]}));return e},getHTML(){return this.editor.getHTML()},filterExtensions(t,e,s){!1===e?e=[]:!0!==e&&!1!==Array.isArray(e)||(e=Object.keys(t));let i=[];for(const n in t)e.includes(n)&&i.push(t[n]);return"function"==typeof s&&(i=s(e,i)),i},focus(){this.editor.focus()},getSplitContent(){return this.editor.getHTMLStartToSelectionToEnd()},onBlur(t){var e;!1===this.$el.contains(t.target)&&(null==(e=this.$refs.toolbar)||e.close())},onCommand(t,...e){this.editor.command(t,...e)},async validate(){var t;await new Promise((t=>setTimeout((()=>t("")),50)));let e="";!1===this.isEmpty&&this.minlength&&this.charactersthis.maxlength&&(e=this.$t("error.validation.maxlength",{max:this.maxlength})),null==(t=this.$refs.output)||t.setCustomValidity(e)}}},(function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"direction",rawName:"v-direction"}],ref:"editor",class:["k-writer","k-writer-input",t.$attrs.class],style:t.$attrs.style,attrs:{"data-disabled":t.disabled,"data-empty":t.isEmpty,"data-placeholder":t.placeholder,"data-toolbar-inline":Boolean(t.toolbar.inline??!0),spellcheck:t.spellcheck}},[t.editor&&!t.disabled?e("k-writer-toolbar",t._b({ref:"toolbar",on:{command:t.onCommand}},"k-writer-toolbar",t.toolbarOptions,!1)):t._e(),e("textarea",{ref:"output",staticClass:"input-hidden",attrs:{name:t.name,required:t.required,tabindex:"-1"},domProps:{value:t.value}})],1)}),[]).exports;class Vi extends gi{get schema(){return{content:this.options.nodes.join("|")}}}const Hi={mixins:[Yi],inheritAttrs:!1,props:{nodes:{type:Array,default:()=>["bulletList","orderedList"]}}};const Ui=ot({mixins:[Ce,Hi],data(){return{list:this.value,html:this.value}},computed:{listExtensions(){return[new Vi({inline:!0,nodes:this.nodes})]}},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-input",t._b({ref:"input",class:["k-list-input",t.$attrs.class],style:t.$attrs.style,attrs:{extensions:t.listExtensions,value:t.list},on:{input:t.onInput}},"k-writer-input",t.$props,!1))}),[]).exports;const Ki=ot({mixins:[qe,ze,Hi],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-list-field",t.$attrs.class],style:t.$attrs.style,attrs:{counter:!1,input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"list"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,Wi={props:{disabled:Boolean,html:{type:Boolean},removable:Boolean,theme:{type:String,default:"dark"}}};const Ji=ot({mixins:[Wi],props:{element:{type:String,default:"button"},image:{type:Object},text:String},emits:["remove"],computed:{isRemovable(){return this.removable&&!this.disabled}},methods:{remove(){this.isRemovable&&this.$emit("remove")},focus(){this.$el.focus()}}},(function(){var t=this,e=t._self._c;return e(t.element,{tag:"component",staticClass:"k-tag",attrs:{"aria-disabled":t.disabled,"data-has-image":Boolean(t.image),"data-has-toggle":t.isRemovable,"data-theme":t.theme,type:"button"},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))}}},[t._t("image",(function(){var s;return[(null==(s=t.image)?void 0:s.src)?e("k-image-frame",t._b({staticClass:"k-tag-image"},"k-image-frame",t.image,!1)):t.image?e("k-icon-frame",t._b({staticClass:"k-tag-image"},"k-icon-frame",t.image,!1)):t._e()]})),t.text?[t.html?e("span",{staticClass:"k-tag-text",domProps:{innerHTML:t._s(t.text)}}):e("span",{staticClass:"k-tag-text"},[t._v(t._s(t.text))])]:t.$slots.default?[e("span",{staticClass:"k-tag-text"},[t._t("default")],2)]:t._e(),t.isRemovable?e("k-icon-frame",{staticClass:"k-tag-toggle",attrs:{icon:"cancel-small"},nativeOn:{click:function(e){return e.stopPropagation(),t.remove.apply(null,arguments)}}}):t._e()],2)}),[]).exports,Gi={mixins:[Wi,W,tt],inheritAttrs:!1,props:{element:{type:String,default:"div"},elementTag:String,layout:String,sort:{default:!1,type:Boolean},value:{default:()=>[],type:Array}}};const Xi=ot({mixins:[Gi],props:{draggable:{default:!0,type:Boolean}},emits:["edit","input"],data:()=>({tags:[]}),computed:{dragOptions(){return{delay:1,disabled:!this.isDraggable,draggable:".k-tag",handle:".k-tag-text"}},isDraggable(){return!0!==this.sort&&!1!==this.draggable&&0!==this.tags.length&&!0!==this.disabled}},watch:{value:{handler(){let t=this.$helper.object.clone(this.value);if(!0===this.sort){const e=[];for(const s of this.options){const i=t.indexOf(s.value);-1!==i&&(e.push(s),t.splice(i,1))}e.push(...t),t=e}this.tags=t.map(this.tag).filter((t=>t))},immediate:!0}},methods:{edit(t,e,s){!1===this.disabled&&this.$emit("edit",t,e,s)},focus(t="last"){this.$refs.navigate.move(t)},index(t){return this.tags.findIndex((e=>e.value===t.value))},input(){this.$emit("input",this.tags.map((t=>t.value)))},navigate(t){this.focus(t)},remove(t){this.tags.length<=1?this.navigate("last"):this.navigate("prev"),this.tags.splice(t,1),this.input()},option(t){return this.options.find((e=>e.value===t.value))},select(){this.focus()},tag(t){"object"!=typeof t&&(t={value:t});const e=this.option(t);return e||{text:this.$helper.string.escapeHTML(t.text??t.value),value:t.value}}}},(function(){var t=this,e=t._self._c;return e("k-navigate",{ref:"navigate",attrs:{axis:"list"===t.layout?"y":"x",select:":where(.k-tag, .k-tags-navigatable):not(:disabled)"}},[e("k-draggable",{class:["k-tags",t.$attrs.class],style:t.$attrs.style,attrs:{"data-layout":t.layout,element:t.element,list:t.tags,options:t.dragOptions},on:{end:t.input},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("default")]},proxy:!0}],null,!0)},t._l(t.tags,(function(s,i){return e("k-tag",{key:s.id??s.value??s.text,attrs:{disabled:t.disabled,element:t.elementTag,html:t.html,image:s.image,removable:t.removable&&!t.disabled,theme:t.theme,name:"tag"},on:{remove:function(e){return t.remove(i,s)}},nativeOn:{click:function(t){t.stopPropagation()},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.edit(i,s,e)},dblclick:function(e){return t.edit(i,s,e)}}},[e("span",{domProps:{innerHTML:t._s(s.text)}})])})),1)],1)}),[]).exports,Zi={mixins:[Q,it,Gi,Oe],props:{value:{default:()=>[],type:Array}},methods:{open(){this.$refs.dropdown.open(this.$el)}}};const Qi=ot({mixins:[Ce,Zi]},(function(){var t=this,e=t._self._c;return e("div",{class:["k-multiselect-input",t.$attrs.class],style:t.$attrs.style},[e("k-input-validator",t._b({attrs:{value:JSON.stringify(t.value),anchor:".k-multiselect-input-toggle"}},"k-input-validator",{min:t.min,max:t.max,required:t.required},!1),[e("k-tags",t._b({ref:"tags",on:{input:function(e){return t.$emit("input",e)}},nativeOn:{click:function(e){return e.stopPropagation(),t.open.apply(null,arguments)}}},"k-tags",t.$props,!1),[!t.max||t.value.length({editing:null}),computed:{canAdd(){return!this.max||this.value.length!1===this.value.includes(t.value)))},picklist(){return{disabled:this.disabled,create:this.showCreate,ignore:this.ignore,min:this.min,max:this.max,search:this.showSearch}},replacableOptions(){return this.options.filter((t=>{var e;return!1===this.value.includes(t.value)||t.value===(null==(e=this.editing)?void 0:e.tag.value)}))},showCreate(){return"options"!==this.accept&&(!this.editing||{submit:this.$t("replace.with")})},showSearch(){return!1!==this.search&&(this.editing?{placeholder:this.$t("replace.with"),...this.search}:"options"===this.accept?{placeholder:this.$t("filter"),...this.search}:this.search)}},methods:{create(t){const e=t.split(this.separator).map((t=>t.trim())),s=this.$helper.object.clone(this.value);for(let i of e)i=this.$refs.tags.tag(i,this.separator),!0===this.isAllowed(i)&&s.push(i.value);this.$emit("input",s),this.$refs.create.close()},async edit(t,e){this.editing={index:t,tag:e},this.$refs.replace.open()},focus(){this.canAdd&&this.$refs.create.open()},isAllowed(t){return"object"==typeof t&&0!==t.value.trim().length&&(!("options"===this.accept&&!this.$refs.tags.option(t))&&!0!==this.value.includes(t.value))},pick(t){this.$emit("input",t),this.$refs.create.close()},replace(t){const{index:e}=this.editing,s=this.$refs.tags.tag(t);if(this.$refs.replace.close(),this.editing=null,!1===this.isAllowed(s))return!1;const i=this.$helper.object.clone(this.value);i.splice(e,1,s.value),this.$emit("input",i),this.$refs.tags.navigate(e)},toggle(t){return!(t.metaKey||t.altKey||t.ctrlKey)&&("ArrowDown"===t.key?(this.$refs.create.open(),void t.preventDefault()):void(String.fromCharCode(t.keyCode).match(/(\w)/g)&&this.$refs.create.open()))}}};const sn=ot(en,(function(){var t,e=this,s=e._self._c;return s("div",{staticClass:"k-tags-input",attrs:{"data-can-add":e.canAdd}},[s("k-input-validator",e._b({attrs:{value:JSON.stringify(e.value)}},"k-input-validator",{min:e.min,max:e.max,required:e.required},!1),[s("k-tags",e._b({ref:"tags",attrs:{removable:!0},on:{edit:e.edit,input:function(t){return e.$emit("input",t)}},nativeOn:{click:function(t){var s,i;t.stopPropagation(),null==(i=null==(s=e.$refs.toggle)?void 0:s.$el)||i.click()}}},"k-tags",e.$props,!1),[!e.max||e.value.length({object:{}}),computed:{hasFields(){return this.$helper.object.length(this.fields)>0},isEmpty(){return null===this.object||0===this.$helper.object.length(this.object)}},watch:{value:{handler(t){this.object=this.valueToObject(t)},immediate:!0}},methods:{add(){this.object=this.$helper.field.form(this.fields),this.save(),this.open()},cell(t,e){this.$set(this.object,t,e),this.save()},form(t){const e=this.$helper.field.subfields(this,this.fields);if(t)for(const s in e)e[s].autofocus=s===t;return e},remove(){this.object={},this.save()},open(t){if(this.disabled)return!1;this.$panel.drawer.open({component:"k-form-drawer",props:{breadcrumb:[],icon:"box",tab:"object",tabs:{object:{fields:this.form(t)}},title:this.label,value:this.object},on:{input:t=>{for(const e in t)this.$set(this.object,e,t[e]);this.save()}}})},save(){this.$emit("input",this.object)},valueToObject:t=>"object"!=typeof t?{}:t}};const pn=ot(un,(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-object-field",scopedSlots:t._u([!t.disabled&&t.hasFields?{key:"options",fn:function(){return[t.isEmpty?e("k-button",{attrs:{icon:"add",size:"xs",variant:"filled"},on:{click:t.add}}):e("k-button",{attrs:{icon:"remove",size:"xs",variant:"filled"},on:{click:t.remove}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[t.hasFields?[t.isEmpty?e("k-empty",{attrs:{icon:"box"},on:{click:t.add}},[t._v(" "+t._s(t.empty??t.$t("field.object.empty"))+" ")]):e("table",{staticClass:"k-table k-object-field-table",attrs:{"aria-disabled":t.disabled}},[e("tbody",[t._l(t.fields,(function(s){return[s.saveable&&t.$helper.field.isVisible(s,t.value)?e("tr",{key:s.name,on:{click:function(e){return t.open(s.name)}}},[e("th",{attrs:{"data-has-button":"","data-mobile":"true"}},[e("button",{attrs:{type:"button"}},[t._v(t._s(s.label))])]),e("k-table-cell",{attrs:{column:s,field:s,mobile:!0,value:t.object[s.name]},on:{input:function(e){return t.cell(s.name,e)}}})],1):t._e()]}))],2)])]:[e("k-empty",{attrs:{icon:"box"}},[t._v(t._s(t.$t("fields.empty")))])],e("input",{staticClass:"input-hidden",attrs:{type:"checkbox",required:t.required},domProps:{checked:!t.isEmpty}})],2)}),[]).exports;const dn=ot({extends:Vs,type:"pages",computed:{emptyProps(){return{icon:"page",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.pages.empty"):this.$t("field.pages.empty.single"))}}}},null,null).exports,hn={mixins:[Os],props:{autocomplete:{type:String,default:"new-password"}}};const mn=ot({mixins:[As,hn]},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-password-input",attrs:{type:"password"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[]).exports;const fn=ot({mixins:[qe,ze,hn,Ss],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({class:["k-password-field",t.$attrs.class],style:t.$attrs.style,attrs:{counter:t.counterOptions,input:t.id},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"password"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,gn={mixins:[Se,tt],props:{columns:Number,reset:{default:!0,type:Boolean},theme:String,value:[String,Number,Boolean]}},kn={mixins:[Ce,gn],computed:{choices(){return this.options.map(((t,e)=>({autofocus:this.autofocus&&0===e,checked:this.value===t.value,disabled:this.disabled||t.disabled,id:`${this.id}-${e}`,info:t.info,label:t.text,name:this.name??this.id,type:"radio",value:t.value})))}},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},select(){this.focus()},toggle(t){t===this.value&&this.reset&&!this.required&&this.$emit("input","")}}};const bn=ot(kn,(function(){var t=this,e=t._self._c;return e("fieldset",{class:["k-radio-input",t.$attrs.class],style:t.$attrs.style,attrs:{disabled:t.disabled}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("options")))]),e("k-input-validator",{attrs:{required:t.required,value:JSON.stringify(t.value)}},[e("ul",{staticClass:"k-grid",style:{"--columns":t.columns},attrs:{"data-variant":"choices"}},t._l(t.choices,(function(s,i){return e("li",{key:i},[e("k-choice-input",t._b({on:{input:function(e){return t.$emit("input",s.value)}},nativeOn:{click:function(e){return e.stopPropagation(),t.toggle(s.value)}}},"k-choice-input",s,!1))],1)})),0)])],1)}),[]).exports;const yn=ot({mixins:[qe,ze,gn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t,e=this,s=e._self._c;return s("k-field",e._b({class:["k-radio-field",e.$attrs.class],style:e.$attrs.style,attrs:{input:e.id+"-0"}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?s("k-radio-input",e._b({ref:"input",on:{input:function(t){return e.$emit("input",t)}}},"k-radio-input",e.$props,!1)):s("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[]).exports,vn={mixins:[Se],props:{default:[Number,String],max:{type:Number,default:100},min:{type:Number,default:0},step:{type:[Number,String],default:1},tooltip:{type:[Boolean,Object],default:()=>({before:null,after:null})},value:[Number,String]}},$n={mixins:[Ce,vn],computed:{baseline(){return this.min<0?0:this.min},isEmpty(){return""===this.value||void 0===this.value||null===this.value},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:{value:{handler(){this.validate()},immediate:!0}},mounted(){this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.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)},onInput(t){this.$emit("input",t)},validate(){var t;const e=[];this.required&&!0===this.isEmpty&&e.push(this.$t("error.validation.required")),!1===this.isEmpty&&this.min&&this.valuethis.max&&e.push(this.$t("error.validation.max",{max:this.max})),null==(t=this.$refs.range)||t.setCustomValidity(e.join(", "))}}};const xn=ot($n,(function(){var t=this,e=t._self._c;return e("div",{class:["k-range-input",t.$attrs.class],style:t.$attrs.style,attrs:{"data-disabled":t.disabled}},[e("input",t._b({ref:"range",attrs:{type:"range"},domProps:{value:t.position},on:{input:function(e){return t.$emit("input",e.target.valueAsNumber)}}},"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.tooltip?e("output",{staticClass:"k-range-input-tooltip",attrs:{for:t.id}},[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()])}),[]).exports;const wn=ot({mixins:[ze,qe,vn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-range-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"range"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,_n={mixins:[Se,tt,st],props:{ariaLabel:String,value:{type:[String,Number,Boolean],default:""}}},Sn={mixins:[Ce,_n],emits:["click","input"],computed:{empty(){return this.placeholder??"—"},hasEmptyOption(){return!this.required||this.isEmpty},isEmpty(){return null===this.value||void 0===this.value||""===this.value},label(){const t=this.text(this.value);return this.isEmpty||null===t?this.empty:t}},mounted(){this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onClick(t){t.stopPropagation(),this.$emit("click",t)},select(){this.focus()},text(t){let e=null;for(const s of this.options)s.value==t&&(e=s.text);return e}}};const Cn=ot(Sn,(function(){var t=this,e=t._self._c;return e("span",{class:["k-select-input",t.$attrs.class],style:t.$attrs.style,attrs:{"data-disabled":t.disabled,"data-empty":t.isEmpty}},[e("select",{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.value},on:{change:function(e){return t.$emit("input",e.target.value)},click:t.onClick}},[t.hasEmptyOption?e("option",{attrs:{disabled:t.required,value:""}},[t._v(" "+t._s(t.empty)+" ")]):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)+" ")])}),[]).exports;const On=ot({mixins:[qe,ze,_n],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({class:["k-select-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"select"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,An={mixins:[Os],props:{autocomplete:null,spellcheck:null,allow:{type:String,default:""},formData:{type:Object,default:()=>({})},sync:{type:String}}},Mn={extends:As,mixins:[An],data(){return{slug:this.sluggify(this.value),slugs:this.$panel.language.rules??this.$panel.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.$panel.system.ascii],this.allow)},onInput(t){this.slug=this.sluggify(t),this.$emit("input",this.slug)}}};const Dn=ot(Mn,(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-slug-input",attrs:{spellcheck:!1,value:t.slug,autocomplete:"off"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[]).exports,jn={mixins:[qe,ze,An],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;let e=null==(t=this.wizard)?void 0:t.field;if(e){const t=this.formData[e.toLowerCase()];t&&(this.slug=t)}}}};const En=ot(jn,(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-slug-field",t.$attrs.class],style:t.$attrs.style,attrs:{help:t.preview,input:t.id},scopedSlots:t._u([t.wizard&&t.wizard.text?{key:"options",fn:function(){return[e("k-button",{attrs:{text:t.wizard.text,icon:"sparkling",size:"xs",variant:"filled"},on:{click:t.onWizard}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{value:t.slug,type:"slug"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,Tn={mixins:[qe],inheritAttrs:!1,props:{autofocus:Boolean,columns:Object,duplicate:{type:Boolean,default:!0},empty:String,fields:[Array,Object],limit:Number,max:Number,min:Number,prepend:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},sortBy:String,value:{type:Array,default:()=>[]}},data:()=>({items:[],page:1}),computed:{index(){return this.limit?(this.page-1)*this.limit+1:1},more(){return!0!==this.disabled&&!(this.max&&this.items.length>=this.max)},hasFields(){return this.$helper.object.length(this.fields)>0},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(){if(this.disabled)return[];let t=[],e=this.duplicate&&this.more;return t.push({icon:"edit",text:this.$t("edit"),click:"edit"}),t.push({disabled:!e,icon:"copy",text:this.$t("duplicate"),click:"duplicate"}),t.push("-"),t.push({icon:"trash",text:e?this.$t("delete"):null,click:"remove"}),t},paginatedItems(){return this.limit?this.items.slice(this.pagination.offset,this.pagination.offset+this.limit):this.items}},watch:{value:{handler(t){t!==this.items&&(this.items=this.toItems(t))},immediate:!0}},methods:{add(t=null){if(!1===this.more)return!1;(t=t??this.$helper.field.form(this.fields))._id=t._id??this.$helper.uuid(),!0===this.prepend?this.items.unshift(t):this.items.push(t),this.save(),this.open(t)},close(){this.$panel.drawer.close(this.id)},focus(){var t,e;null==(e=null==(t=this.$refs.add)?void 0:t.focus)||e.call(t)},form(t){const e=this.$helper.field.subfields(this,this.fields);if(t)for(const s in e)e[s].autofocus=s===t;return e},findIndex(t){return this.items.findIndex((e=>e._id===t._id))},navigate(t,e){const s=this.findIndex(t);!0!==this.disabled&&-1!==s&&this.open(this.items[s+e],null,!0)},open(t,e,s=!1){const i=this.findIndex(t);if(!0===this.disabled||-1===i)return!1;this.$panel.drawer.open({component:"k-structure-drawer",id:this.id,props:{icon:this.icon??"list-bullet",next:this.items[i+1],prev:this.items[i-1],tabs:{content:{fields:this.form(e)}},title:this.label,value:t},replace:s,on:{input:e=>{const s=this.findIndex(t);this.$panel.drawer.props.next=this.items[s+1],this.$panel.drawer.props.prev=this.items[s-1],this.$set(this.items,s,e),this.save()},next:()=>{this.navigate(t,1)},prev:()=>{this.navigate(t,-1)},remove:()=>{this.remove(t)}}})},option(t,e){switch(t){case"remove":this.remove(e);break;case"duplicate":this.add({...this.$helper.object.clone(e),_id:this.$helper.uuid()});break;case"edit":this.open(e)}},paginate({page:t}){this.page=t},remove(t){const e=this.findIndex(t);this.disabled||-1===e||this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.structure.delete.confirm")},on:{submit:()=>{this.items.splice(e,1),this.save(),this.$panel.dialog.close(),this.close(),0===this.paginatedItems.length&&this.page>1&&this.page--}}})},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.structure.delete.confirm.all")},on:{submit:()=>{this.page=1,this.items=[],this.save(),this.$panel.dialog.close()}}})},save(t=this.items){this.$emit("input",t)},sort(t){return this.sortBy?this.$helper.array.sortBy(t,this.sortBy):t},toItems(t){return!1===Array.isArray(t)?[]:(t=t.map((t=>({_id:t._id??this.$helper.uuid(),...t}))),this.sort(t))}}};const In=ot(Tn,(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-structure-field",t.$attrs.class],style:t.$attrs.style,nativeOn:{click:function(t){t.stopPropagation()}},scopedSlots:t._u([t.hasFields&&!t.disabled?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{attrs:{autofocus:t.autofocus,disabled:!t.more,responsive:!0,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.add()}}}),e("k-button",{attrs:{icon:"dots",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:[{click:()=>t.add(),disabled:!t.more,icon:"add",text:t.$t("add")},{click:()=>t.removeAll(),disabled:0===t.items.length||t.disabled,icon:"trash",text:t.$t("delete.all")}],"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input-validator",t._b({attrs:{value:JSON.stringify(t.items)}},"k-input-validator",{min:t.min,max:t.max,required:t.required},!1),[t.hasFields?[0===t.items.length?e("k-empty",{attrs:{icon:"list-bullet"},on:{click:function(e){return t.add()}}},[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,pagination:!!t.limit&&t.pagination,rows:t.paginatedItems,sortable:t.isSortable},on:{cell:function(e){return t.open(e.row,e.columnIndex)},input:t.save,option:t.option,paginate:t.paginate}}),t.more?e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.add()}}})],1):t._e()]]:[e("k-empty",{attrs:{icon:"list-bullet"}},[t._v(t._s(t.$t("fields.empty")))])]],2)],1)}),[]).exports,Ln={mixins:[Os],props:{autocomplete:{default:"tel"},placeholder:{default:()=>window.panel.$t("tel.placeholder")}}};const Bn=ot({mixins:[As,Ln]},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-tel-input",attrs:{type:"tel"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[]).exports;const qn=ot({mixins:[qe,ze,Ln],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({class:["k-tel-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"tel"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,Pn={mixins:[Os]};const Nn=ot({mixins:[As,Pn]},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({class:["k-text-input",t.$attrs.class],attrs:{type:"text"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[]).exports;const Fn=ot({mixins:[qe,ze,Pn,Ss],inheritAttrs:!1,computed:{inputType(){return this.$helper.isComponent(`k-${this.type}-input`)?this.type:"text"}},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({class:["k-text-field",t.$attrs.class],style:t.$attrs.style,attrs:{counter:t.counterOptions,input:t.id},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:t.inputType},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,zn={props:{buttons:{type:[Array,Boolean],default:!0},uploads:[Boolean,Object,Array]}};const Yn=ot({mixins:[zn],emits:["command"],computed:{commands(){return{headlines:{label:this.$t("toolbar.button.headings"),icon:"title",dropdown:[{label:this.$t("toolbar.button.heading.1"),icon:"h1",click:()=>this.command("prepend","#")},{label:this.$t("toolbar.button.heading.2"),icon:"h2",click:()=>this.command("prepend","##")},{label:this.$t("toolbar.button.heading.3"),icon:"h3",click:()=>this.command("prepend","###")}]},bold:{label:this.$t("toolbar.button.bold"),icon:"bold",click:()=>this.command("toggle","**"),shortcut:"b"},italic:{label:this.$t("toolbar.button.italic"),icon:"italic",click:()=>this.command("toggle","*"),shortcut:"i"},link:{label:this.$t("toolbar.button.link"),icon:"url",click:()=>this.command("dialog","link"),shortcut:"k"},email:{label:this.$t("toolbar.button.email"),icon:"email",click:()=>this.command("dialog","email"),shortcut:"e"},file:{label:this.$t("toolbar.button.file"),icon:"attachment",click:()=>this.command("file"),dropdown:this.uploads?[{label:this.$t("toolbar.button.file.select"),icon:"check",click:()=>this.command("file")},{label:this.$t("toolbar.button.file.upload"),icon:"upload",click:()=>this.command("upload")}]:void 0},code:{label:this.$t("toolbar.button.code"),icon:"code",click:()=>this.command("toggle","`")},ul:{label:this.$t("toolbar.button.ul"),icon:"list-bullet",click:()=>this.command("insert",((t,e)=>e.split("\n").map((t=>"- "+t)).join("\n")))},ol:{label:this.$t("toolbar.button.ol"),icon:"list-numbers",click:()=>this.command("insert",((t,e)=>e.split("\n").map(((t,e)=>e+1+". "+t)).join("\n")))}}},default:()=>["headlines","|","bold","italic","code","|","link","email","file","|","ul","ol"],layout(){if(!1===this.buttons)return[];const t=[],e=Array.isArray(this.buttons)?this.buttons:this.default,s={...this.commands,...window.panel.plugins.textareaButtons??{}};for(const i of e)if("|"===i)t.push("|");else if(s[i]){const e={...s[i],click:()=>{var t;null==(t=s[i].click)||t.call(this)}};t.push(e)}return t}},methods:{close(){this.$refs.toolbar.close()},command(t,...e){this.$emit("command",t,...e)},shortcut(t,e){var s;const i=this.layout.find((e=>e.shortcut===t));i&&(e.preventDefault(),null==(s=i.click)||s.call(i))}}},(function(){return(0,this._self._c)("k-toolbar",{ref:"toolbar",staticClass:"k-textarea-toolbar",attrs:{buttons:this.layout}})}),[]).exports,Rn={mixins:[zn,Se,U,X,Z,st,nt],props:{endpoints:Object,preselect:Boolean,size:String,value:String}};const Vn=ot({mixins:[Ce,Rn],emits:["focus","input","submit"],data:()=>({over:!1}),computed:{uploadOptions(){const t=this.restoreSelectionCallback();return{url:this.$panel.urls.api+"/"+this.endpoints.field+"/upload",multiple:!1,on:{cancel:t,done:e=>{t((()=>this.insertUpload(e)))}}}}},watch:{async value(){await this.$nextTick(),this.$library.autosize.update(this.$refs.input)}},async mounted(){await this.$nextTick(),this.$library.autosize(this.$refs.input),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{dialog(t){const e=this.restoreSelectionCallback();this.$panel.dialog.open({component:"k-toolbar-"+t+"-dialog",props:{value:this.parseSelection()},on:{cancel:e,submit:t=>{this.$panel.dialog.close(),e((()=>this.insert(t)))}}})},file(){const t=this.restoreSelectionCallback();this.$panel.dialog.open({component:"k-files-dialog",props:{endpoint:this.endpoints.field+"/files",multiple:!1},on:{cancel:t,submit:e=>{t((()=>this.insertFile(e))),this.$panel.dialog.close()}}})},focus(){this.$refs.input.focus()},insert(t){const e=this.$refs.input,s=e.value;"function"==typeof t&&(t=t(this.$refs.input,this.selection())),setTimeout((()=>{if(e.focus(),document.execCommand("insertText",!1,t),e.value===s){const s=e.selectionStart,i=e.selectionEnd,n=s===i?"end":"select";e.setRangeText(t,s,i,n)}this.$emit("input",e.value)}))},insertFile(t){(null==t?void 0:t.length)>0&&this.insert(t.map((t=>t.dragText)).join("\n\n"))},insertUpload(t){this.insertFile(t),this.$events.emit("model.update")},onCommand(t,...e){if("function"!=typeof this[t])return console.warn(t+" is not a valid command");this[t](...e)},onDrop(t){if(this.uploads&&this.$helper.isUploadEvent(t))return this.$panel.upload.open(t.dataTransfer.files,this.uploadOptions);"text"===this.$panel.drag.type&&(this.focus(),this.insert(this.$panel.drag.data))},onFocus(t){this.$emit("focus",t)},onInput(t){this.$emit("input",t.target.value)},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);"text"===this.$panel.drag.type&&(t.dataTransfer.dropEffect="copy",this.focus(),this.over=!0)},onShortcut(t){var e;!1!==this.buttons&&"Meta"!==t.key&&"Control"!==t.key&&(null==(e=this.$refs.toolbar)||e.shortcut(t.key,t))},onSubmit(t){return this.$emit("submit",t)},parseSelection(){const t=this.selection();if(0===(null==t?void 0:t.length))return{href:null,title:null};let e;e=this.$panel.config.kirbytext?/^\(link:\s*(?.*?)(?:\s*text:\s*(?.*?))?\)$/is:/^(\[(?.*?)\]\((?.*?)\))|(<(?.*?)>)$/is;const s=e.exec(t);return null!==s?{href:s.groups.url??s.groups.link,title:s.groups.text??null}:{href:null,title:t}},prepend(t){this.insert(t+" "+this.selection())},restoreSelectionCallback(){const t=this.$refs.input.selectionStart,e=this.$refs.input.selectionEnd;return s=>{setTimeout((()=>{this.$refs.input.setSelectionRange(t,e),s&&s()}))}},select(){this.$refs.select()},selection(){return this.$refs.input.value.substring(this.$refs.input.selectionStart,this.$refs.input.selectionEnd)},toggle(t,e){e=e??t;const s=this.selection();return s.startsWith(t)&&s.endsWith(e)?this.insert(s.slice(t.length).slice(0,s.length-t.length-e.length)):this.wrap(t,e)},upload(){this.$panel.upload.pick(this.uploadOptions)},wrap(t,e){this.insert(t+this.selection()+(e??t))}}},(function(){var t=this,e=t._self._c;return e("div",{class:["k-textarea-input",t.$attrs.class],style:t.$attrs.style,attrs:{"data-over":t.over,"data-size":t.size}},[e("div",{staticClass:"k-textarea-input-wrapper"},[t.buttons&&!t.disabled?e("k-textarea-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:function(e){var s;null==(s=t.$refs.toolbar)||s.close()},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?e.ctrlKey||e.shiftKey||e.altKey?null:t.onShortcut.apply(null,arguments):null},function(e){return e.ctrlKey?e.shiftKey||e.altKey||e.metaKey?null: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)])}),[]).exports;const Hn=ot({mixins:[qe,ze,Rn,Ss],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-textarea-field",t.$attrs.class],style:t.$attrs.style,attrs:{counter:t.counterOptions,input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"textarea"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,Un={props:{max:String,min:String,value:String}},Kn={mixins:[Un],props:{display:{type:String,default:"HH:mm"},step:{type:Object,default:()=>({size:5,unit:"minute"})},type:{type:String,default:"time"}}};const Wn=ot({mixins:[qs,Kn],computed:{inputType:()=>"time"}},null,null).exports,Jn={mixins:[qe,ze,Kn],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()}}};const Gn=ot(Jn,(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-time-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"time"},on:{input:function(e){return t.$emit("input",e??"")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.icon??"clock",title:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{"align-x":"end"}},[e("k-timeoptions-input",{attrs:{display:t.display,value:t.value},on:{input:t.select}})],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1))],1)}),[]).exports,Xn={mixins:[Se],props:{checked:{type:Boolean},info:{type:String},label:{type:String},type:{default:"checkbox",type:String},value:{type:[Boolean,Number,String]},variant:{type:String}}};const Zn=ot({mixins:[Ce,Xn]},(function(){var t=this,e=t._self._c;return e("label",{class:["k-choice-input",t.$attrs.class],style:t.$attrs.style,attrs:{"aria-disabled":t.disabled}},[e("input",t._b({class:["invisible"===t.variant?"sr-only":null,t.$attrs.class],attrs:{"data-variant":t.variant},on:{input:function(e){return t.$emit("input",e.target.checked)}}},"input",{autofocus:t.autofocus,id:t.id,checked:t.checked,disabled:t.disabled,name:t.name,required:t.required,type:t.type,value:t.value},!1)),t.label||t.info?e("span",{staticClass:"k-choice-input-label"},[e("span",{staticClass:"k-choice-input-label-text",domProps:{innerHTML:t._s(t.label)}}),t.info?e("span",{staticClass:"k-choice-input-label-info",domProps:{innerHTML:t._s(t.info)}}):t._e()]):t._e()])}),[]).exports,Qn={mixins:[Xn],props:{text:{type:[Array,String]},value:Boolean}};const to=ot({mixins:[Ce,Qn],computed:{labelText(){const t=this.text??[this.$t("off"),this.$t("on")];return Array.isArray(t)?this.value?t[1]:t[0]:t}},mounted(){this.$props.autofocus&&this.focus()},methods:{onEnter(t){"Enter"===t.key&&this.$el.click()},onInput(t){this.$emit("input",t)},select(){this.$el.focus()}}},(function(){var t=this;return(0,t._self._c)("k-choice-input",t._b({class:["k-toggle-input",t.$attrs.class],style:t.$attrs.style,attrs:{checked:t.value,disabled:t.disabled,label:t.labelText,type:"checkbox",variant:"toggle"},on:{input:function(e){return t.$emit("input",e)}}},"k-choice-input",t.$props,!1))}),[]).exports;const eo=ot({mixins:[qe,ze,Qn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-toggle-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"toggle"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,so={mixins:[Se],props:{columns:Number,grow:Boolean,labels:Boolean,options:Array,reset:Boolean,value:[String,Number,Boolean]}},io={mixins:[Ce,so],mounted(){this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input[checked]")||this.$el.querySelector("input"))||t.focus()},onClick(t){t===this.value&&this.reset&&!this.required&&this.$emit("input","")},onInput(t){this.$emit("input",t)},select(){this.focus()}}};const no=ot(io,(function(){var t=this,e=t._self._c;return e("fieldset",{class:["k-toggles-input",t.$attrs.class],style:t.$attrs.style,attrs:{disabled:t.disabled}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("options")))]),e("k-input-validator",{attrs:{required:t.required,value:JSON.stringify(t.value)}},[e("ul",{style:{"--options":t.columns??t.options.length},attrs:{"data-labels":t.labels}},t._l(t.options,(function(s,i){return e("li",{key:i,attrs:{"data-disabled":t.disabled}},[e("input",{staticClass:"input-hidden",attrs:{id:t.id+"-"+i,"aria-label":s.text,disabled:t.disabled,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||!s.icon?e("span",{staticClass:"k-toggles-text",domProps:{innerHTML:t._s(s.text)}}):t._e()],1)])})),0)])],1)}),[]).exports,oo={mixins:[qe,ze,so],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)}}};const ro=ot(oo,(function(){var t,e=this,s=e._self._c;return s("k-field",e._b({class:["k-toggles-field",e.$attrs.class],style:e.$attrs.style,attrs:{input:e.id}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?s("k-input",e._b({ref:"input",class:{grow:e.grow},attrs:{type:"toggles"},on:{input:function(t){return e.$emit("input",t)}}},"k-input",e.$props,!1)):s("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[]).exports,ao={mixins:[Os],props:{autocomplete:{type:String,default:"url"},placeholder:{type:String,default:()=>window.panel.$t("url.placeholder")}}};const lo=ot({mixins:[As,ao],watch:{value:{handler(){this.validate()},immediate:!0}},methods:{validate(){var t;const e=[];this.value&&!1===this.$helper.url.isUrl(this.value,!0)&&e.push(this.$t("error.validation.url")),null==(t=this.$el)||t.setCustomValidity(e.join(", "))}}},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-url-input",attrs:{type:"url"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[]).exports;const co=ot({mixins:[qe,ze,ao],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"url"}},computed:{isValidUrl(){return""!==this.value&&!0===this.$helper.url.isUrl(this.value,!0)}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-url-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"url"},on:{input:function(e){return t.$emit("input",e)}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link&&t.isValidUrl?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.value,title:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1))],1)}),[]).exports;const uo=ot({extends:Vs,type:"users",computed:{emptyProps(){return{icon:"users",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.users.empty"):this.$t("field.users.empty.single"))}}}},null,null).exports;const po=ot({mixins:[qe,ze,Yi,Ss],inheritAttrs:!1,computed:{counterValue(){const t=this.$helper.string.stripHTML(this.value??"");return this.$helper.string.unescapeHTML(t)}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-writer-field",t.$attrs.class],style:t.$attrs.style,attrs:{counter:t.counterOptions,input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{after:t.after,before:t.before,icon:t.icon,type:"writer"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,ho={install(t){t.component("k-blocks-field",$s),t.component("k-checkboxes-field",Cs),t.component("k-color-field",Ts),t.component("k-date-field",Ns),t.component("k-email-field",Ys),t.component("k-files-field",Hs),t.component("k-gap-field",Us),t.component("k-headline-field",Ks),t.component("k-info-field",Ws),t.component("k-layout-field",si),t.component("k-line-field",ii),t.component("k-link-field",oi),t.component("k-list-field",Ki),t.component("k-multiselect-field",on),t.component("k-number-field",cn),t.component("k-object-field",pn),t.component("k-pages-field",dn),t.component("k-password-field",fn),t.component("k-radio-field",yn),t.component("k-range-field",wn),t.component("k-select-field",On),t.component("k-slug-field",En),t.component("k-structure-field",In),t.component("k-tags-field",nn),t.component("k-text-field",Fn),t.component("k-textarea-field",Hn),t.component("k-tel-field",qn),t.component("k-time-field",Gn),t.component("k-toggle-field",eo),t.component("k-toggles-field",ro),t.component("k-url-field",co),t.component("k-users-field",uo),t.component("k-writer-field",po)}},mo={mixins:[vn],props:{max:null,min:null,step:{default:.01,type:Number},tooltip:{default:!1,type:[Boolean,Object]}}};const fo=ot({mixins:[xn,mo]},(function(){var t=this;return(0,t._self._c)("k-range-input",t._b({staticClass:"k-alpha-input",attrs:{min:0,max:1},on:{input:function(e){return t.$emit("input",e)}}},"k-range-input",t.$props,!1))}),[]).exports,go=["sun","mon","tue","wed","thu","fri","sat"];const ko=ot({mixins:[Se,Is],data(){const t=this.$library.dayjs();return{maxdate:null,mindate:null,month:t.month(),selected:null,today:t,year:t.year()}},computed:{numberOfDays(){return this.toDate().daysInMonth()},firstWeekday(){const t=go[this.toDate().day()];return this.weekdays.indexOf(t)},weekdays(){const t=this.$panel.translation.weekday;return[...go.slice(t),...go.slice(0,t)]},weeks(){return Math.ceil((this.numberOfDays+this.firstWeekday)/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)=>{t.push({value:s,text:e})})),t},years(){const t=this.year-20,e=this.year+20;return this.toOptions(t,e)}},watch:{max:{handler(t,e){t!==e&&(this.maxdate=this.$library.dayjs.interpret(t,"date"))},immediate:!0},min:{handler(t,e){t!==e&&(this.mindate=this.$library.dayjs.interpret(t,"date"))},immediate:!0},value:{handler(t,e){t!==e&&(this.selected=this.$library.dayjs.interpret(t,"date"),this.show(this.selected))},immediate:!0}},methods:{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.mindate,"day")||e.isAfter(this.maxdate,"day")},isSelected(t){return this.toDate(t).isSame(this.selected,"day")},isToday(t){return this.toDate(t).isSame(this.today,"day")},onNext(){const t=this.toDate().add(1,"month");this.show(t)},onPrev(){const t=this.toDate().subtract(1,"month");this.show(t)},select(t){this.$emit("input",(null==t?void 0:t.toISO("date"))??null)},show(t){this.month=(t??this.today).month(),this.year=(t??this.today).year()},toDate(t=1,e){return this.$library.dayjs(`${this.year}-${(e??this.month)+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("fieldset",{class:["k-calendar-input",t.$attrs.class],style:t.$attrs.style,on:{click:function(t){t.stopPropagation()}}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("date.select")))]),e("nav",[e("k-button",{attrs:{title:t.$t("prev"),icon:"angle-left"},on:{click:t.onPrev}}),e("span",{staticClass:"k-calendar-selects"},[e("k-select-input",{attrs:{"aria-label":t.$t("month"),autofocus:t.autofocus,options:t.months,empty:!1,required:!0,value:t.month},on:{input:function(e){t.month=Number(e)}}}),e("k-select-input",{attrs:{"aria-label":t.$t("year"),options:t.years,empty:!1,required:!0,value:t.year},on:{input:function(e){t.year=Number(e)}}})],1),e("k-button",{attrs:{title:t.$t("next"),icon:"angle-right"},on:{click:t.onNext}})],1),e("table",{key:t.year+"-"+t.month,staticClass:"k-calendar-table"},[e("thead",[e("tr",t._l(t.weekdays,(function(s){return e("th",{key:"weekday_"+s},[t._v(" "+t._s(t.$t("days."+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){t.select(t.toDate(s))}}}):t._e()],1)})),0)})),0),e("tfoot",[e("tr",[e("td",{staticClass:"k-calendar-today",attrs:{colspan:"7"}},[e("k-button",{attrs:{disabled:t.disabled,text:t.$t("today")},on:{click:function(e){t.show(t.today),t.select(t.today)}}})],1)])])]),e("input",{staticClass:"input-hidden",attrs:{id:t.id,disabled:t.disabled,min:t.min,max:t.max,name:t.name,required:t.required,tabindex:"-1",type:"date"},domProps:{value:t.value}})])}),[]).exports;const bo=ot({extends:Zn},null,null).exports,yo={mixins:[bn,{mixins:[gn],props:{format:{type:String,default:"hex",validator:t=>["hex","rgb","hsl"].includes(t)},value:{type:String}}}],computed:{choices(){return this.options.map((t=>({...t,title:t.text??t.value,value:this.colorToString(t.value)})))}},methods:{colorToString(t){try{return this.$library.colors.toString(t,this.format)}catch{return t}}}};const vo=ot(yo,(function(){var t=this,e=t._self._c;return t.choices.length?e("fieldset",{staticClass:"k-coloroptions-input",attrs:{disabled:t.disabled}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("options")))]),e("ul",t._l(t.choices,(function(s,i){return e("li",{key:i},[e("label",{attrs:{title:s.title}},[e("input",{staticClass:"input-hidden",attrs:{autofocus:t.autofocus&&0===i,disabled:t.disabled,name:t.name??t.id,required:t.required,type:"radio"},domProps:{checked:s.value===t.value,value:s.value},on:{click:function(e){return t.toggle(s.value)},input:function(e){return t.$emit("input",s.value)}}}),e("k-color-frame",{attrs:{color:s.value}})],1)])})),0)]):t._e()}),[]).exports,$o={mixins:[Ce,{mixins:[Se,tt],props:{alpha:{default:!0,type:Boolean},format:{default:"hex",type:String,validator:t=>["hex","rgb","hsl"].includes(t)},value:{type:[Object,String]}}}],data:()=>({color:{h:0,s:0,v:1,a:1},formatted:null}),computed:{coords(){return this.value?{x:100*this.color.s,y:100*(1-this.color.v)}:null},hsl(){try{const t=this.$library.colors.convert(this.color,"hsl");return{h:t.h,s:(100*t.s).toFixed()+"%",l:(100*t.l).toFixed()+"%",a:t.a}}catch{return{h:0,s:"0%",l:"0%",a:1}}}},watch:{value:{handler(t,e){if(t===e||t===this.formatted)return;const s=this.$library.colors.parseAs(t??"","hsv");s?(this.formatted=this.$library.colors.toString(s,this.format),this.color=s):(this.formatted=null,this.color={h:0,s:0,v:1,a:1})},immediate:!0}},methods:{between:(t,e,s)=>Math.min(Math.max(t,e),s),emit(){return this.formatted=this.$library.colors.toString(this.color,this.format),this.$emit("input",this.formatted)},focus(){this.$refs.coords.focus()},setAlpha(t){this.color.a=this.alpha?this.between(Number(t),0,1):1,this.emit()},setCoords(t){if(!t)return this.$emit("input","");const e=Math.round(t.x),s=Math.round(t.y);this.color.s=this.between(e/100,0,1),this.color.v=this.between(1-s/100,0,1),this.emit()},setHue(t){this.color.h=this.between(Number(t),0,360),this.emit()}}};const xo=ot($o,(function(){var t=this,e=t._self._c;return e("fieldset",{class:["k-colorpicker-input",t.$attrs.class],style:{"--h":t.hsl.h,"--s":t.hsl.s,"--l":t.hsl.l,"--a":t.hsl.a,...t.$attrs.style}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("color")))]),e("k-coords-input",{ref:"coords",attrs:{autofocus:t.autofocus,disabled:t.disabled,required:t.required,value:t.coords},on:{input:function(e){return t.setCoords(e)}}}),e("label",{attrs:{"aria-label":t.$t("hue")}},[e("k-hue-input",{attrs:{disabled:t.disabled,required:t.required,value:t.color.h},on:{input:function(e){return t.setHue(e)}}})],1),t.alpha?e("label",{attrs:{"aria-label":t.$t("alpha")}},[e("k-alpha-input",{attrs:{disabled:t.disabled,required:t.required,value:t.color.a},on:{input:function(e){return t.setAlpha(e)}}})],1):t._e(),e("k-coloroptions-input",{attrs:{disabled:t.disabled,format:t.format,options:t.options,required:t.required,value:t.value},on:{input:function(e){return t.$emit("input",e)}}}),e("input",{staticClass:"input-hidden",attrs:{name:t.name,required:t.required,tabindex:"-1",type:"text"},domProps:{value:t.formatted}})],1)}),[]).exports,wo={mixins:[Ce,{mixins:[Se],props:{reset:{default:!0,type:Boolean},value:{default:()=>({x:0,y:0}),type:Object}}}],data:()=>({x:0,y:0}),watch:{value:{handler(t){const e=this.parse(t);this.x=(null==e?void 0:e.x)??0,this.y=(null==e?void 0:e.y)??0},immediate:!0}},methods:{focus(){var t;null==(t=this.$el.querySelector("button"))||t.focus()},getCoords:(t,e)=>({x:Math.min(Math.max(t.clientX-e.left,0),e.width),y:Math.min(Math.max(t.clientY-e.top,0),e.height)}),onDelete(){this.reset&&!this.required&&this.$emit("input",null)},onDrag(t){if(0!==t.button)return;const e=t=>this.onMove(t),s=()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",s)};window.addEventListener("mousemove",e),window.addEventListener("mouseup",s)},onEnter(){var t;null==(t=this.$el.form)||t.requestSubmit()},onInput(t,e){if(t.preventDefault(),t.stopPropagation(),this.disabled)return!1;this.x=Math.min(Math.max(parseFloat(e.x??this.x??0),0),100),this.y=Math.min(Math.max(parseFloat(e.y??this.y??0),0),100),this.$emit("input",{x:this.x,y:this.y})},onKeys(t){const e=t.shiftKey?10:1,s={ArrowUp:{y:this.y-e},ArrowDown:{y:this.y+e},ArrowLeft:{x:this.x-e},ArrowRight:{x:this.x+e}};s[t.key]&&this.onInput(t,s[t.key])},async onMove(t){const e=this.$el.getBoundingClientRect(),s=this.getCoords(t,e),i=s.x/e.width*100,n=s.y/e.height*100;this.onInput(t,{x:i,y:n}),await this.$nextTick(),this.focus()},parse(t){if("object"==typeof t)return t;const e={"top left":{x:0,y:0},"top center":{x:50,y:0},"top right":{x:100,y:0},"center left":{x:0,y:50},center:{x:50,y:50},"center center":{x:50,y:50},"center right":{x:100,y:50},"bottom left":{x:0,y:100},"bottom center":{x:50,y:100},"bottom right":{x:100,y:100}};if(e[t])return e[t];const s=t.split(",").map((t=>t.trim()));return{x:s[0],y:s[1]??0}}}};const _o=ot(wo,(function(){var t=this,e=t._self._c;return e("div",{class:["k-coords-input",t.$attrs.class],style:t.$attrs.style,attrs:{"aria-disabled":t.disabled,"data-empty":!t.value},on:{mousedown:t.onDrag,click:t.onMove,keydown:t.onKeys}},[t._t("default"),e("button",{staticClass:"k-coords-input-thumb",style:{left:`${t.x}%`,top:`${t.y}%`},attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onEnter.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:t.onDelete.apply(null,arguments)}]}}),e("input",{staticClass:"input-hidden",attrs:{name:t.name,required:t.required,tabindex:"-1",type:"text"},domProps:{value:t.value?[t.value.x,t.value.y]:null}})],2)}),[]).exports,So={mixins:[vn],props:{max:null,min:null,step:{default:1,type:Number},tooltip:{default:!1,type:[Boolean,Object]}}};const Co=ot({mixins:[xn,So]},(function(){var t=this;return(0,t._self._c)("k-range-input",t._b({staticClass:"k-hue-input",attrs:{min:0,max:360},on:{input:function(e){return t.$emit("input",e)}}},"k-range-input",t.$props,!1))}),[]).exports;const Oo=ot({mixins:[As,{mixins:[Os],props:{autocomplete:null,pattern:null,spellcheck:null,placeholder:{default:()=>window.panel.$t("search")+" …",type:String}}}]},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-search-input",attrs:{spellcheck:!1,autocomplete:"off",type:"search"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[]).exports;const Ao=ot({mixins:[Ce,{mixins:[Se,Un]}],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:{focus(){this.$el.querySelector("button").focus()},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",{class:["k-timeoptions-input",t.$attrs.class],style:t.$attrs.style},[e("div",[e("h3",[e("k-icon",{attrs:{type:"sun"}}),t._v(" "),e("span",{staticClass:"sr-only"},[t._v(t._s(t.$t("day")))])],1),e("ul",t._l(t.day,(function(s,i){return e("li",{key:s.select},["-"===s?e("hr"):e("k-button",{attrs:{autofocus:t.autofocus&&0===i,disabled:t.disabled,selected:s.select===t.value&&"time"},on:{click:function(e){return t.select(s.select)}}},[t._v(" "+t._s(s.display)+" ")])],1)})),0)]),e("div",[e("h3",[e("k-icon",{attrs:{type:"moon"}}),t._v(" "),e("span",{staticClass:"sr-only"},[t._v(t._s(t.$t("night")))])],1),e("ul",t._l(t.night,(function(s){return e("li",{key:s.select},["-"===s?e("hr"):e("k-button",{attrs:{disabled:t.disabled,selected:s.select===t.value&&"time"},on:{click:function(e){return t.select(s.select)}}},[t._v(" "+t._s(s.display)+" ")])],1)})),0)]),e("input",{staticClass:"input-hidden",attrs:{id:t.id,disabled:t.disabled,min:t.min,max:t.max,name:t.name,required:t.required,tabindex:"-1",type:"time"},domProps:{value:t.value}})])}),[]).exports;class Mo extends HTMLElement{static get observedAttributes(){return["min","max","required","value"]}attributeChangedCallback(t,e,s){this[t]=s}constructor(){super(),this.internals=this.attachInternals(),this.entries=[],this.max=null,this.min=null,this.required=!1}connectedCallback(){this.tabIndex=0,this.validate()}checkValidity(){return this.internals.checkValidity()}get form(){return this.internals.form}has(t){return this.entries.includes(t)}get isEmpty(){return 0===this.selected.length}get name(){return this.getAttribute("name")}reportValidity(){return this.internals.reportValidity()}get type(){return this.localName}validate(){const t=this.querySelector(this.getAttribute("anchor"))??this.querySelector("input, textarea, select, button")??this.querySelector(":scope > *"),e=parseInt(this.getAttribute("max")),s=parseInt(this.getAttribute("min"));this.hasAttribute("required")&&"false"!==this.getAttribute("required")&&0===this.entries.length?this.internals.setValidity({valueMissing:!0},window.panel.$t("error.validation.required"),t):this.hasAttribute("min")&&this.entries.lengthe?this.internals.setValidity({rangeOverflow:!0},window.panel.$t("error.validation.max",{max:e}),t):this.internals.setValidity({})}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get value(){return JSON.stringify(this.entries??[])}set value(t){this.entries=("string"==typeof t?JSON.parse(t):[])??[],this.validate()}get willValidate(){return this.internals.willValidate}}var Do;((e,s,i)=>{s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i})(Mo,"symbol"!=typeof(Do="formAssociated")?Do+"":Do,!0);const jo=ot({extends:"k-writer-input",created(){window.panel.deprecated("`k-writer` will be removed in a future version. Use `k-writer-input` instead.")}},null,null).exports,Eo={install(t){customElements.define("k-input-validator",Mo),t.component("k-alpha-input",fo),t.component("k-calendar-input",ko),t.component("k-checkbox-input",bo),t.component("k-checkboxes-input",_s),t.component("k-choice-input",Zn),t.component("k-colorname-input",js),t.component("k-coloroptions-input",vo),t.component("k-colorpicker-input",xo),t.component("k-coords-input",_o),t.component("k-date-input",qs),t.component("k-email-input",zs),t.component("k-hue-input",Co),t.component("k-list-input",Ui),t.component("k-multiselect-input",Qi),t.component("k-number-input",ln),t.component("k-password-input",mn),t.component("k-picklist-input",Me),t.component("k-radio-input",bn),t.component("k-range-input",xn),t.component("k-search-input",Oo),t.component("k-select-input",Cn),t.component("k-slug-input",Dn),t.component("k-string-input",As),t.component("k-tags-input",sn),t.component("k-tel-input",Bn),t.component("k-text-input",Nn),t.component("k-textarea-input",Vn),t.component("k-time-input",Wn),t.component("k-timeoptions-input",Ao),t.component("k-toggle-input",to),t.component("k-toggles-input",no),t.component("k-url-input",lo),t.component("k-writer-input",Ri),t.component("k-calendar",ko),t.component("k-times",Ao),t.component("k-writer",jo)}};const To=ot({mixins:[Dt],inheritAttrs:!1,props:{cancelButton:{default:!1},label:{default(){return this.$t("field.layout.select")},type:String},layouts:{type:Array},selector:Object,submitButton:{default:!1},value:{type:Array}},emits:["cancel","input","submit"]},(function(){var t,e,s=this,i=s._self._c;return i("k-dialog",s._b({class:["k-layout-selector",s.$attrs.class],style:s.$attrs.style,attrs:{size:(null==(t=s.selector)?void 0:t.size)??"medium"},on:{cancel:function(t){return s.$emit("cancel")},submit:function(t){return s.$emit("submit",s.value)}}},"k-dialog",s.$props,!1),[i("h3",{staticClass:"k-label"},[s._v(s._s(s.label))]),i("k-navigate",{staticClass:"k-layout-selector-options",style:{"--columns":Number((null==(e=s.selector)?void 0:e.columns)??3)},attrs:{axis:"x"}},s._l(s.layouts,(function(t,e){return i("button",{key:e,staticClass:"k-layout-selector-option",attrs:{"aria-current":s.value===t,"aria-label":t.join(","),value:t},on:{click:function(e){return s.$emit("input",t)}}},[i("k-grid",{attrs:{"aria-hidden":""}},s._l(t,(function(t,e){return i("k-column",{key:e,attrs:{width:t}})})),1)],1)})),0)],1)}),[]).exports,Io={install(t){t.component("k-layout",Zs),t.component("k-layout-column",Gs),t.component("k-layouts",ei),t.component("k-layout-selector",To)}},Lo={inheritAttrs:!1,props:{column:{default:()=>({}),type:Object},field:{default:()=>({}),type:Object},value:{}}};const Bo=ot({mixins:[Lo,Gi],props:{value:{default:()=>[],type:[Array,String]}},computed:{tags(){let t=this.value;const e=this.column.options??this.field.options??[];return"string"==typeof t&&(t=t.split(",")),(t??[]).map((t=>{"string"==typeof t&&(t={value:t,text:t});for(const s of e)s.value===t.value&&(t.text=s.text);return t}))}}},(function(){var t=this,e=t._self._c;return e("div",{class:["k-tags-field-preview",t.$options.class,t.$attrs.class],style:t.$attrs.style},[e("k-tags",{attrs:{draggable:!1,html:t.html,value:t.tags,element:"ul","element-tag":"li",theme:"light"}})],1)}),[]).exports;const qo=ot({extends:Bo,inheritAttrs:!1,class:"k-array-field-preview",computed:{tags(){return[{text:1===this.value.length?`1 ${this.$t("entry")}`:`${this.value.length} ${this.$t("entries")}`}]}}},null,null).exports,Po={props:{html:{type:Boolean}}};const No=ot({mixins:[Po],inheritAttrs:!1,props:{bubbles:[Array,String]},computed:{items(){let t=this.bubbles;return"string"==typeof t&&(t=t.split(",")),t.map((t=>"string"===t?{text:t}:t))}},mounted(){window.panel.deprecated(" will be removed in a future version. Use instead.")}},(function(){var t=this,e=t._self._c;return e("ul",{class:["k-bubbles",t.$attrs.class],style:t.$attrs.style},t._l(t.items,(function(s,i){return e("li",{key:i},[e("k-bubble",t._b({attrs:{html:t.html}},"k-bubble",s,!1))],1)})),0)}),[]).exports;const Fo=ot({mixins:[Lo,Po],props:{value:{default:()=>[],type:[Array,String]}},computed:{bubbles(){let t=this.value;const e=this.column.options??this.field.options??[];return"string"==typeof t&&(t=t.split(",")),(t??[]).map((t=>{"string"==typeof t&&(t={value:t,text:t});for(const s of e)s.value===t.value&&(t.text=s.text);return t}))}},mounted(){window.panel.deprecated(" will be removed in a future version. Use instead.")}},(function(){var t=this,e=t._self._c;return e("div",{class:["k-bubbles-field-preview",t.$options.class,t.$attrs.class],style:t.$attrs.style},[e("k-bubbles",{attrs:{bubbles:t.bubbles,html:t.html}})],1)}),[]).exports,zo={mixins:[Lo],props:{value:String},computed:{text(){var t;if(!this.value)return;const e=this.$library.colors.toString(this.value,this.field.format,this.field.alpha),s=null==(t=this.field.options)?void 0:t.find((t=>this.$library.colors.toString(t.value,this.field.format,this.field.alpha)===e));return s?s.text:null}}};const Yo=ot(zo,(function(){var t=this,e=t._self._c;return e("div",{class:["k-color-field-preview",t.$attrs.class],style:t.$attrs.style},[e("k-color-frame",{attrs:{color:t.value}}),t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2)}),[]).exports;const Ro=ot({mixins:[Lo],computed:{text(){return this.value}}},(function(){var t=this;return(0,t._self._c)("p",{class:["k-text-field-preview",t.$options.class,t.$attrs.class],style:t.$attrs.style},[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)}),[]).exports;const Vo=ot({extends:Ro,props:{value:String},class:"k-date-field-preview",computed:{display(){return this.column.display??this.field.display},format(){var t;let e=this.display??"YYYY-MM-DD";return(null==(t=this.time)?void 0:t.display)&&(e+=" "+this.time.display),e},parsed(){return this.$library.dayjs(this.value)},text(){var t;return!1===this.parsed.isValid()?this.value:null==(t=this.parsed)?void 0:t.format(this.format)},time(){return this.column.time??this.field.time}}},null,null).exports;const Ho=ot({mixins:[Lo],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",{class:["k-url-field-preview",t.$options.class,t.$attrs.class],style:t.$attrs.style,attrs:{"data-link":t.link}},[t._v(" "+t._s(t.column.before)+" "),e("k-link",{attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[e("span",[t._v(t._s(t.text))])]),t._v(" "+t._s(t.column.after)+" ")],1)}),[]).exports;const Uo=ot({extends:Ho,class:"k-email-field-preview"},null,null).exports;const Ko=ot({extends:Bo,class:"k-files-field-preview",props:{html:{type:Boolean,default:!0}},computed:{tags(){return this.value.map((t=>({text:t.filename,link:t.link,image:t.image})))}}},null,null).exports;const Wo=ot({mixins:[Lo],props:{value:Object},computed:{status(){var t;return{...this.$helper.page.status(null==(t=this.value)?void 0:t.status),...this.value}}}},(function(){var t=this,e=t._self._c;return t.value?e("k-button",t._b({class:["k-flag-field-preview",t.$attrs.class],style:t.$attrs.style,attrs:{size:"md"}},"k-button",t.status,!1)):t._e()}),[]).exports;const Jo=ot({mixins:[Lo],props:{value:String},computed:{html(){return this.value}}},(function(){var t=this,e=t._self._c;return e("div",{class:["k-html-field-preview",t.$options.class,t.$attrs.class],style:t.$attrs.style},[t._v(" "+t._s(t.column.before)+" "),e("k-text",{attrs:{html:t.html}}),t._v(" "+t._s(t.column.after)+" ")],1)}),[]).exports;const Go=ot({mixins:[Lo],props:{value:[Object]}},(function(){var t=this,e=t._self._c;return t.value?e("k-item-image",{class:["k-image-field-preview",t.$attrs.class],style:t.$attrs.style,attrs:{image:t.value}}):t._e()}),[]).exports,Xo={mixins:[Lo],props:{removable:Boolean,type:String},emits:["remove"],data:()=>({model:null}),computed:{currentType(){return this.type??this.detected.type},detected(){return this.$helper.link.detect(this.value)},isLink(){return["url","email","tel"].includes(this.currentType)}},watch:{detected:{async handler(t,e){t!==e&&(this.model=await this.$helper.link.preview(this.detected))},immediate:!0},type(){this.model=null}}};const Zo=ot(Xo,(function(){var t=this,e=t._self._c;return e("div",{class:{"k-link-field-preview":!0,"k-url-field-preview":t.isLink,[t.$attrs.class]:!0},style:t.$attrs.style},["page"===t.currentType||"file"===t.currentType?[t.model?[e("k-tag",{attrs:{image:{...t.model.image,cover:!0},removable:t.removable,text:t.model.label},on:{remove:function(e){return t.$emit("remove",e)}}})]:t._t("placeholder")]:t.isLink?[e("p",{staticClass:"k-text"},[e("a",{attrs:{href:t.value,target:"_blank"}},[e("span",[t._v(t._s(t.detected.link))])])])]:[t._v(" "+t._s(t.detected.link)+" ")]],2)}),[]).exports;const Qo=ot({extends:Bo,class:"k-object-field-preview",props:{value:[Array,Object]},computed:{tags(){return this.value?[{text:"{ ... }"}]:[]}}},null,null).exports;const tr=ot({extends:Bo,inheritAttrs:!1,class:"k-pages-field-preview",props:{html:{type:Boolean,default:!0}}},null,null).exports;const er=ot({extends:Vo,class:"k-time-field-preview",computed:{format(){return this.display??"HH:mm"},parsed(){return this.$library.dayjs.iso(this.value,"time")},text(){var t;return null==(t=this.parsed)?void 0:t.format(this.format)}}},null,null).exports;const sr=ot({mixins:[Lo],props:{value:Boolean},emits:["input"],computed:{isEditable(){return!0!==this.field.disabled},text(){return!1!==this.column.text?this.field.text:null}}},(function(){var t=this,e=t._self._c;return e("div",{class:["k-toggle-field-preview",t.$attrs.class],style:t.$attrs.style},[e("k-toggle-input",{attrs:{disabled:!t.isEditable,text:t.text,value:t.value},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{click:function(e){t.isEditable&&e.stopPropagation()}}})],1)}),[]).exports;const ir=ot({extends:Bo,class:"k-users-field-preview",computed:{bubble(){return this.value.map((t=>({text:t.username,link:t.link,image:t.image})))}}},null,null).exports,nr={install(t){t.component("k-array-field-preview",qo),t.component("k-bubbles-field-preview",Fo),t.component("k-color-field-preview",Yo),t.component("k-date-field-preview",Vo),t.component("k-email-field-preview",Uo),t.component("k-files-field-preview",Ko),t.component("k-flag-field-preview",Wo),t.component("k-html-field-preview",Jo),t.component("k-image-field-preview",Go),t.component("k-link-field-preview",Zo),t.component("k-object-field-preview",Qo),t.component("k-pages-field-preview",tr),t.component("k-tags-field-preview",Bo),t.component("k-text-field-preview",Ro),t.component("k-toggle-field-preview",sr),t.component("k-time-field-preview",er),t.component("k-url-field-preview",Ho),t.component("k-users-field-preview",ir),t.component("k-list-field-preview",Jo),t.component("k-writer-field-preview",Jo),t.component("k-checkboxes-field-preview",Fo),t.component("k-multiselect-field-preview",Fo),t.component("k-radio-field-preview",Fo),t.component("k-select-field-preview",Fo),t.component("k-toggles-field-preview",Fo)}};const or=ot({mixins:[{props:{buttons:{type:Array,default:()=>[]},theme:{type:String,default:"light"}}}],methods:{close(){for(const t in this.$refs){const e=this.$refs[t][0];"function"==typeof(null==e?void 0:e.close)&&e.close()}}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-toolbar",attrs:{"data-theme":t.theme}},[t._l(t.buttons,(function(s,i){var n;return["|"===s?e("hr",{key:i}):s.when??1?e("k-button",{key:i,class:["k-toolbar-button",s.class],attrs:{current:s.current,disabled:s.disabled,icon:s.icon,title:s.label,tabindex:"0"},on:{click:function(e){var n,o;(null==(n=s.dropdown)?void 0:n.length)?t.$refs[i+"-dropdown"][0].toggle():null==(o=s.click)||o.call(s,e)}},nativeOn:{keydown:function(t){var e;null==(e=s.key)||e.call(s,t)}}}):t._e(),(s.when??1)&&(null==(n=s.dropdown)?void 0:n.length)?e("k-dropdown-content",{key:i+"-dropdown",ref:i+"-dropdown",refInFor:!0,attrs:{options:s.dropdown,theme:"dark"===t.theme?"light":"dark"}}):t._e()]}))],2)}),[]).exports;const rr=ot({props:{editor:{required:!0,type:Object},inline:{default:!0,type:Boolean},marks:{default:()=>["bold","italic","underline","strike","code","|","link","email","|","clear"],type:[Array,Boolean]},nodes:{default:!0,type:[Array,Boolean]}},emits:["command"],data:()=>({isOpen:!1,position:{x:0,y:0}}),computed:{activeNode(){return Object.values(this.nodeButtons).find((t=>this.isNodeActive(t)))??!1},buttons(){var t,e,s;const i=[];if(this.hasNodes){const n=[];let o=0;for(const i in this.nodeButtons){const r=this.nodeButtons[i];n.push({current:(null==(t=this.activeNode)?void 0:t.id)===r.id,disabled:!1===(null==(s=null==(e=this.activeNode)?void 0:e.when)?void 0:s.includes(r.name)),icon:r.icon,label:r.label,click:()=>this.command(r.command??i)}),!0===r.separator&&o!==Object.keys(this.nodeButtons).length-1&&n.push("-"),o++}i.push({current:Boolean(this.activeNode),icon:this.activeNode.icon??"title",dropdown:n})}if(this.hasNodes&&this.hasMarks&&i.push("|"),this.hasMarks)for(const n in this.markButtons){const t=this.markButtons[n];"|"!==t?i.push({current:this.editor.activeMarks.includes(n),icon:t.icon,label:t.label,click:e=>this.command(t.command??n,e)}):i.push("|")}return i},hasMarks(){return this.$helper.object.length(this.markButtons)>0},hasNodes(){return this.$helper.object.length(this.nodeButtons)>1},markButtons(){const t=this.editor.buttons("mark");if(!1===this.marks||0===this.$helper.object.length(t))return{};if(!0===this.marks)return t;const e={};for(const[s,i]of this.marks.entries())"|"===i?e["divider"+s]="|":t[i]&&(e[i]=t[i]);return e},nodeButtons(){const t=this.editor.buttons("node");if(!1===this.nodes||0===this.$helper.object.length(t))return{};if("block+"!==this.editor.nodes.doc.content&&t.paragraph&&delete t.paragraph,!0===this.nodes)return t;const e={};for(const s of this.nodes)t[s]&&(e[s]=t[s]);return e},positions(){return!1===this.inline?null:{top:this.position.y+"px",left:this.position.x+"px"}}},methods:{close(t){t&&!1!==this.$el.contains(t.relatedTarget)||(this.isOpen=!1)},command(t,...e){this.$emit("command",t,...e)},isNodeActive(t){if(!1===this.editor.activeNodes.includes(t.name))return!1;if("paragraph"===t.name)return!1===this.editor.activeNodes.includes("listItem")&&!1===this.editor.activeNodes.includes("quote");if(t.attrs){if(void 0===Object.values(this.editor.activeNodeAttrs).find((e=>JSON.stringify(e)===JSON.stringify(t.attrs))))return!1}return!0},open(){this.isOpen=!0,this.inline&&this.$nextTick(this.setPosition)},setPosition(){const t=this.$el.getBoundingClientRect(),e=this.editor.element.getBoundingClientRect(),s=document.querySelector(".k-panel-menu").getBoundingClientRect(),{from:i,to:n}=this.editor.selection,o=this.editor.view.coordsAtPos(i),r=this.editor.view.coordsAtPos(n,!0),a=new DOMRect(o.left,o.top,r.right-o.left,r.bottom-o.top);let l=a.x-e.x+a.width/2-t.width/2,c=a.y-e.y-t.height-5;if(t.widthe.width&&(l=e.width-t.width);else{const i=e.x+l,n=i+t.width,o=s.width+20,r=20;iwindow.innerWidth-r&&(l-=n-(window.innerWidth-r))}this.position={x:l,y:c}}}},(function(){var t=this,e=t._self._c;return t.isOpen||!t.inline?e("k-toolbar",{ref:"toolbar",staticClass:"k-writer-toolbar",style:t.positions,attrs:{buttons:t.buttons,"data-inline":t.inline,theme:t.inline?"dark":"light"}}):t._e()}),[]).exports;const ar=ot({extends:Tt,props:{fields:{default:()=>{const t=Tt.props.fields.default();return t.title.label=window.panel.$t("link.text"),t}}},methods:{submit(){const t=this.values.href??"",e=this.values.title??"";return this.$panel.config.kirbytext?(null==e?void 0:e.length)>0?this.$emit("submit",`(email: ${t} text: ${e})`):this.$emit("submit",`(email: ${t})`):(null==e?void 0:e.length)>0?this.$emit("submit",`[${e}](mailto:${t})`):this.$emit("submit",`<${t}>`)}}},null,null).exports;const lr=ot({extends:Vt,props:{fields:{default:()=>({href:{label:window.panel.$t("link"),type:"link",placeholder:window.panel.$t("url.placeholder"),icon:"url"},title:{label:window.panel.$t("link.text"),type:"text",icon:"title"}})}},methods:{submit(){const t=this.values.href??"",e=this.values.title??"";return this.$panel.config.kirbytext?(null==e?void 0:e.length)>0?this.$emit("submit",`(link: ${t} text: ${e})`):this.$emit("submit",`(link: ${t})`):(null==e?void 0:e.length)>0?this.$emit("submit",`[${e}](${t})`):this.$emit("submit",`<${t}>`)}}},null,null).exports,cr={install(t){t.component("k-toolbar",or),t.component("k-textarea-toolbar",Yn),t.component("k-writer-toolbar",rr),t.component("k-toolbar-email-dialog",ar),t.component("k-toolbar-link-dialog",lr)}},ur={install(t){t.component("k-counter",Ee),t.component("k-form",Te),t.component("k-form-buttons",Le),t.component("k-form-controls",Be),t.component("k-field",Pe),t.component("k-fieldset",Fe),t.component("k-input",Ye),t.use(vs),t.use(Eo),t.use(ho),t.use(Io),t.use(nr),t.use(cr)}},pr={},dr=function(t,e,s){let i=Promise.resolve();if(e&&e.length>0){const t=document.getElementsByTagName("link"),n=document.querySelector("meta[property=csp-nonce]"),o=(null==n?void 0:n.nonce)||(null==n?void 0:n.getAttribute("nonce"));i=Promise.all(e.map((e=>{if(e=function(t,e){return new URL(t,e).href}(e,s),e in pr)return;pr[e]=!0;const i=e.endsWith(".css"),n=i?'[rel="stylesheet"]':"";if(!!s)for(let s=t.length-1;s>=0;s--){const n=t[s];if(n.href===e&&(!i||"stylesheet"===n.rel))return}else if(document.querySelector(`link[href="${e}"]${n}`))return;const r=document.createElement("link");return r.rel=i?"stylesheet":"modulepreload",i||(r.as="script",r.crossOrigin=""),r.href=e,o&&r.setAttribute("nonce",o),document.head.appendChild(r),i?new Promise(((t,s)=>{r.addEventListener("load",t),r.addEventListener("error",(()=>s(new Error(`Unable to preload CSS for ${e}`))))})):void 0})))}return i.then((()=>t())).catch((t=>{const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=t,window.dispatchEvent(e),!e.defaultPrevented)throw t}))},hr=()=>dr((()=>import("./IndexView.min.js")),__vite__mapDeps([0,1]),import.meta.url),mr=()=>dr((()=>import("./DocsView.min.js")),__vite__mapDeps([2,3,1]),import.meta.url),fr=()=>dr((()=>import("./PlaygroundView.min.js")),__vite__mapDeps([4,3,1]),import.meta.url),gr={install(t){t.component("k-lab-index-view",hr),t.component("k-lab-docs-view",mr),t.component("k-lab-playground-view",fr)}};const kr=ot({props:{align:{type:String,default:"start"}}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-bar",attrs:{"data-align":t.align}},[t._t("default")],2)}),[]).exports;const br=ot({props:{align:{type:String,default:"start"},button:Boolean,height:String,icon:String,theme:{type:String},text:String,html:{type:Boolean}},computed:{element(){return this.button?"button":"div"},type(){return this.button?"button":null}}},(function(){var t=this,e=t._self._c;return e(t.element,{tag:"component",staticClass:"k-box",style:t.height?{"--box-height":t.height}:null,attrs:{"data-align":t.align,"data-theme":t.theme,type:t.type}},[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),t._t("default",(function(){return[t.html?e("k-text",{attrs:{html:t.text}}):e("k-text",[t._v(" "+t._s(t.text)+" ")])]}),null,{html:t.html,text:t.text})],2)}),[]).exports;const yr=ot({inheritAttrs:!1,props:{back:String,color:String,element:{type:String,default:"li"},html:{type:Boolean},image:Object,link:String,text:String},mounted(){window.panel.deprecated(" will be removed in a future version. Use instead.")}},(function(){var t=this,e=t._self._c;return e(t.link?"k-link":"p",{tag:"component",class:["k-bubble",t.$attrs.class],style:{color:t.$helper.color(t.color),background:t.$helper.color(t.back),...t.$attrs.style},attrs:{"data-has-text":Boolean(t.text),to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[t._t("image",(function(){var s;return[(null==(s=t.image)?void 0:s.src)?e("k-image-frame",t._b({},"k-image-frame",t.image,!1)):t.image?e("k-icon-frame",t._b({},"k-icon-frame",t.image,!1)):e("span")]})),t.text?[t.html?e("span",{staticClass:"k-bubble-text",domProps:{innerHTML:t._s(t.text)}}):e("span",{staticClass:"k-bubble-text"},[t._v(t._s(t.text))])]:t._e()],2)}),[]).exports;const vr=ot({props:{width:{type:String,default:"1/1"},sticky:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column",style:{"--width":t.width},attrs:{"data-sticky":t.sticky}},[t.sticky?e("div",[t._t("default")],2):t._t("default")],2)}),[]).exports,$r={props:{element:{type:String,default:"div"},fit:String,ratio:String,cover:Boolean,back:String,theme:String}};const xr=ot({mixins:[$r],inheritAttrs:!1,computed:{background(){return this.$helper.color(this.back)}}},(function(){var t=this;return(0,t._self._c)(t.element,{tag:"component",class:["k-frame",t.$attrs.class],style:{"--fit":t.fit??(t.cover?"cover":"contain"),"--ratio":t.ratio,"--back":t.background,...t.$attrs.style},attrs:{"data-theme":t.theme}},[t._t("default")],2)}),[]).exports;const wr=ot({mixins:[{mixins:[$r],props:{color:String}}],inheritAttrs:!1},(function(){var t=this;return(0,t._self._c)("k-frame",t._b({class:["k-color-frame",t.$attrs.class],style:{"--color-frame-back":t.color,...t.$attrs.style}},"k-frame",t.$props,!1),[t._t("default")],2)}),[]).exports;const _r=ot({props:{disabled:{type:Boolean}},emits:["drop"],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)}),[]).exports;const Sr=ot({props:{variant:String}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-grid",attrs:{"data-variant":t.variant}},[t._t("default")],2)}),[]).exports;const Cr=ot({props:{editable:Boolean},emits:["edit"]},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-header",attrs:{"data-has-buttons":Boolean(t.$slots.buttons||t.$slots.left||t.$slots.right)}},[e("h1",{staticClass:"k-header-title"},[t.editable?e("button",{staticClass:"k-header-title-button",attrs:{type:"button"},on:{click:function(e){return t.$emit("edit")}}},[e("span",{staticClass:"k-header-title-text"},[t._t("default")],2),e("span",{staticClass:"k-header-title-icon"},[e("k-icon",{attrs:{type:"edit"}})],1)]):e("span",{staticClass:"k-header-title-text"},[t._t("default")],2)]),t.$slots.buttons?e("div",{staticClass:"k-header-buttons"},[t._t("buttons")],2):t._e()])}),[]).exports,Or={props:{alt:String,color:String,type:String}};const Ar=ot({mixins:[Or],computed:{isEmoji(){return this.$helper.string.hasEmoji(this.type)}}},(function(){var t=this,e=t._self._c;return t.isEmoji?e("span",{attrs:{"data-type":"emoji"}},[t._v(t._s(t.type))]):e("svg",{staticClass:"k-icon",style:{color:t.$helper.color(t.color)},attrs:{"aria-label":t.alt,role:t.alt?"img":null,"aria-hidden":!t.alt,"data-type":t.type}},[e("use",{attrs:{"xlink:href":"#icon-"+t.type}})])}),[]).exports;const Mr=ot({mixins:[{mixins:[$r,Or],props:{type:null,icon:String}}],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-frame",t._b({class:["k-icon-frame",t.$attrs.class],style:t.$attrs.style,attrs:{element:"figure"}},"k-frame",t.$props,!1),[e("k-icon",t._b({},"k-icon",{color:t.color,type:t.icon,alt:t.alt},!1))],1)}),[]).exports;const Dr=ot({mixins:[{mixins:[$r],props:{alt:String,sizes:String,src:String,srcset:String}}],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-frame",t._b({class:["k-image-frame","k-image",t.$attrs.class],style:t.$attrs.style,attrs:{element:"figure"}},"k-frame",t.$props,!1),[t.src?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()])}),[]).exports;const jr=ot({mixins:[{props:{autofocus:{default:!0,type:Boolean},nested:{default:!1,type:Boolean},type:{default:"overlay",type:String},visible:{default:!1,type:Boolean}}}],inheritAttrs:!0,emits:["cancel","close","open"],watch:{visible(t,e){t!==e&&this.toggle()}},mounted(){this.toggle()},methods:{cancel(){this.$emit("cancel"),this.close()},close(){if(!1!==this.$refs.overlay.open)return this.nested?this.onClose():void this.$refs.overlay.close()},focus(){this.$helper.focus(this.$refs.overlay)},onCancel(t){this.nested&&(t.preventDefault(),this.cancel())},onClick(t){t.target.matches(".k-portal")&&this.cancel()},onClose(){this.$emit("close")},open(){!0!==this.$refs.overlay.open&&this.$refs.overlay.showModal(),setTimeout((()=>{!0===this.autofocus&&this.focus(),this.$emit("open")}))},toggle(){!0===this.visible?this.open():this.close()}}},(function(){var t=this;return(0,t._self._c)("dialog",{ref:"overlay",staticClass:"k-overlay",attrs:{"data-type":t.type},on:{cancel:t.onCancel,mousedown:t.onClick,touchdown:t.onClick,close:t.onClose}},[t._t("default")],2)}),[]).exports;const Er=ot({props:{label:String,value:String,icon:String,info:String,theme:String,link:String,click:Function,dialog:{type:[String,Object]}},computed:{component(){return null!==this.target?"k-link":"div"},target(){return this.link?this.link:this.click?this.click:this.dialog?()=>this.$dialog(this.dialog):null}}},(function(){var t=this,e=t._self._c;return e(t.component,{tag:"component",staticClass:"k-stat",attrs:{"data-theme":t.theme,to:t.target}},[t.label?e("dt",{staticClass:"k-stat-label"},[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),t._v(" "+t._s(t.label)+" ")],1):t._e(),t.value?e("dd",{staticClass:"k-stat-value"},[t._v(t._s(t.value))]):t._e(),t.info?e("dd",{staticClass:"k-stat-info"},[t._v(t._s(t.info))]):t._e()])}),[]).exports;const Tr=ot({props:{reports:{type:Array,default:()=>[]},size:{type:String,default:"large"}},methods:{component(t){return null!==this.target(t)?"k-link":"div"},target(t){return t.link?t.link:t.click?t.click:t.dialog?()=>this.$dialog(t.dialog):null}}},(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("k-stat",t._b({key:i},"k-stat",s,!1))})),1)}),[]).exports,Ir={inheritAttrs:!1,props:{columns:{type:Object,default:()=>({})},disabled:Boolean,fields:{type:Object,default:()=>({})},empty:String,index:{type:[Number,Boolean],default:1},rows:Array,options:{default:()=>[],type:[Array,Function]},pagination:[Object,Boolean],sortable:Boolean},emits:["cell","change","header","input","option","paginate","sort"],data(){return{values:this.rows}},computed:{colspan(){let t=this.columnsCount;return this.hasIndexColumn&&t++,this.hasOptions&&t++,t},columnsCount(){return this.$helper.object.length(this.columns)},dragOptions(){return{disabled:!this.sortable||0===this.rows.length,draggable:".k-table-sortable-row",fallbackClass:"k-table-row-fallback",ghostClass:"k-table-row-ghost"}},hasIndexColumn(){return this.sortable||!1!==this.index},hasOptions(){var t;return this.$scopedSlots.options||(null==(t=this.options)?void 0:t.length)>0||Object.values(this.values).filter((t=>null==t?void 0: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)}}};const Lr=ot(Ir,(function(){var t=this,e=t._self._c;return e("div",{class:["k-table",t.$attrs.class],style:t.$attrs.style,attrs:{"aria-disabled":t.disabled}},[e("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":"true"}},[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-align":s.align,"data-column-id":i,"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":"true"}}):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.colspan}},[t._v(" "+t._s(t.empty)+" ")])]):t._l(t.values,(function(s,i){return e("tr",{key:s.id??s._id??s.value??JSON.stringify(s),class:{"k-table-sortable-row":t.sortable&&!1!==s.sortable}},[t.hasIndexColumn?e("td",{staticClass:"k-table-index-column",attrs:{"data-mobile":"true"}},[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:o,staticClass:"k-table-column",style:{width:t.width(n.width)},attrs:{id:o,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":"true"}},[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})],2):t._e()],2)}))],2)],1),t.pagination?e("k-pagination",t._b({staticClass:"k-table-pagination",on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.pagination,!1)):t._e()],1)}),[]).exports;const Br=ot({inheritAttrs:!1,props:{column:Object,field:Object,id:String,mobile:{type:Boolean,default:!1},row:Object,value:{default:""}},emits:["input"],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":"object"==typeof this.value?"k-object-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",{class:["k-table-cell",t.$attrs.class],style:t.$attrs.style,attrs:{"data-align":t.column.align,"data-column-id":t.id,"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()],1)}),[]).exports;const qr=ot({props:{tab:String,tabs:{type:Array,default:()=>[]},theme:{type:String,default:"passive"}},data(){return{observer:null,visible:this.tabs,invisible:[]}},computed:{buttons(){return this.visible.map(this.button)},current(){const t=this.tabs.find((t=>t.name===this.tab))??this.tabs[0];return null==t?void 0:t.name},dropdown(){return this.invisible.map(this.button)}},watch:{tabs:{async handler(){var t;null==(t=this.observer)||t.disconnect(),await this.$nextTick(),this.$el instanceof Element&&(this.observer=new ResizeObserver(this.resize),this.observer.observe(this.$el))},immediate:!0}},destroyed(){var t;null==(t=this.observer)||t.disconnect()},methods:{button(t){return{...t,current:t.name===this.current,title:t.label,text:t.label??t.text??t.name}},async resize(){const t=this.$el.offsetWidth;this.visible=this.tabs,this.invisible=[],await this.$nextTick();const e=[...this.$refs.visible].map((t=>t.$el.offsetWidth));let s=32;for(let i=0;it)return this.visible=this.tabs.slice(0,i),void(this.invisible=this.tabs.slice(i))}}},(function(){var t=this,e=t._self._c;return t.tabs.length>1?e("nav",{staticClass:"k-tabs"},[t._l(t.buttons,(function(s){return e("div",{key:s.name,staticClass:"k-tabs-tab"},[e("k-button",t._b({ref:"visible",refInFor:!0,staticClass:"k-tab-button",attrs:{variant:"dimmed"}},"k-button",s,!1),[t._v(" "+t._s(s.text)+" ")]),s.badge?e("span",{staticClass:"k-tabs-badge",attrs:{"data-theme":t.theme}},[t._v(" "+t._s(s.badge)+" ")]):t._e()],1)})),t.invisible.length?[e("k-button",{staticClass:"k-tab-button k-tabs-dropdown-button",attrs:{current:!!t.invisible.find((e=>t.tab===e.name)),title:t.$t("more"),icon:"dots",variant:"dimmed"},on:{click:function(e){return e.stopPropagation(),t.$refs.more.toggle()}}}),e("k-dropdown-content",{ref:"more",staticClass:"k-tabs-dropdown",attrs:{options:t.dropdown,"align-x":"end"}})]:t._e()],2):t._e()}),[]).exports,Pr={install(t){t.component("k-bar",kr),t.component("k-box",br),t.component("k-bubble",yr),t.component("k-bubbles",No),t.component("k-color-frame",wr),t.component("k-column",vr),t.component("k-dropzone",_r),t.component("k-frame",xr),t.component("k-grid",Sr),t.component("k-header",Cr),t.component("k-icon-frame",Mr),t.component("k-image-frame",Dr),t.component("k-image",Dr),t.component("k-overlay",jr),t.component("k-stat",Er),t.component("k-stats",Tr),t.component("k-table",Lr),t.component("k-table-cell",Br),t.component("k-tabs",qr)}};const Nr=ot({props:{data:Object,disabled:Boolean,element:{type:String,default:"div"},group:String,handle:[String,Boolean],list:Array,move:Function,options:{type:Object,default:()=>({})}},emits:["change","end","sort","start"],data:()=>({sortable:null}),computed:{dragOptions(){return{group:this.group,disabled:this.disabled,handle:!0===this.handle?".k-sort-handle":this.handle,draggable:">*",filter:".k-draggable-footer",ghostClass:"k-sortable-ghost",fallbackClass:"k-sortable-fallback",forceFallback:!0,fallbackOnBody:!0,scroll:document.querySelector(".k-panel-main"),...this.options}}},watch:{dragOptions:{handler(t,e){for(const s in t)t[s]!==e[s]&&this.sortable.option(s,t[s])},deep:!0}},mounted(){this.disableFooter(),this.create()},methods:{async create(){const t=(await dr((async()=>{const{default:t}=await import("./sortable.esm.min.js");return{default:t}}),[],import.meta.url)).default;this.sortable=t.create(this.$el,{...this.dragOptions,onStart:t=>{this.$panel.drag.start("data",{}),this.$emit("start",t)},onEnd:t=>{this.$panel.drag.stop(),this.$emit("end",t)},onAdd:t=>{if(this.list){const e=this.getInstance(t.from),s=t.oldDraggableIndex,i=t.newDraggableIndex,n=e.list[s];this.list.splice(i,0,n),this.$emit("change",{added:{element:n,newIndex:i}})}},onUpdate:t=>{if(this.list){const e=t.oldDraggableIndex,s=t.newDraggableIndex,i=this.list[e];this.list.splice(e,1),this.list.splice(s,0,i),this.$emit("change",{moved:{element:i,newIndex:s,oldIndex:e}})}},onRemove:t=>{if(this.list){const e=t.oldDraggableIndex,s=this.list[e];this.list.splice(e,1),this.$emit("change",{removed:{element:s,oldIndex:e}})}},onSort:t=>{this.$emit("sort",t)},onMove:t=>{if(t.dragged.classList.contains("k-draggable-footer"))return!1;if(this.move){const e=t.dragged.__vue__;t.draggedData=e.$props;const s=this.getInstance(t.from);t.fromData=s.$props.data;const i=this.getInstance(t.to);return t.toData=i.$props.data,this.move(t)}return!0}})},disableFooter(){var t;if(this.$slots.footer){const e=[...this.$el.childNodes].slice(-1*this.$slots.footer.length);for(const s of e)null==(t=s.classList)||t.add("k-draggable-footer")}},getInstance:t=>"list"in(t=t.__vue__)?t:1===t.$children.length&&"list"in t.$children[0]?t.$children[0]:"k-draggable"===t.$parent.$options._componentTag?t.$parent:void 0}},(function(){var t=this;return(0,t._self._c)(t.element,{tag:"component",class:{"k-draggable":!t.dragOptions.disabled}},[t._t("default"),t.$slots.footer?[t._t("footer")]:t._e()],2)}),[]).exports;const Fr=ot({data:()=>({error:null}),errorCaptured(t){return this.$panel.debug&&window.console.warn(t),this.error=t,!1},render(){return this.error?this.$slots.error?this.$slots.error[0]:this.$scopedSlots.error?this.$scopedSlots.error({error:this.error}):Vue.h("k-box",{attrs:{theme:"negative"}},this.error.message??this.error):this.$slots.default[0]}},null,null).exports;const zr=ot({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("k-overlay",{staticClass:"k-fatal",attrs:{visible:!0}},[e("div",{staticClass:"k-fatal-box"},[e("div",{staticClass:"k-notification",attrs:{"data-theme":"negative"}},[e("p",[t._v("The JSON response could not be parsed")]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return e.stopPropagation(),t.$panel.notification.close()}}})],1),e("iframe",{ref:"iframe",staticClass:"k-fatal-iframe"})])])}),[]).exports;const Yr=ot({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 24 24"},domProps:{innerHTML:t._s(s)}})})),0)])}),[]).exports;const Rr=ot({},(function(){var t=this,e=t._self._c;return t.$panel.notification.isOpen?e("div",{staticClass:"k-notification",attrs:{"data-theme":t.$panel.notification.theme}},[e("p",[t._v(t._s(t.$panel.notification.message))]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return t.$panel.notification.close()}}})],1):t._e()}),[]).exports;const Vr=ot({},(function(){var t=this,e=t._self._c;return!t.$panel.system.isLocal&&t.$panel.isOffline?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()}),[]).exports,Hr={props:{value:{type:Number,default:0,validator:t=>t>=0&&t<=100}}};const Ur=ot(Hr,(function(){var t=this;return(0,t._self._c)("progress",{staticClass:"k-progress",attrs:{max:"100"},domProps:{value:t.value}},[t._v(t._s(t.value)+"%")])}),[]).exports;const Kr=ot({},(function(){return(0,this._self._c)("k-button",{staticClass:"k-sort-handle k-sort-button",attrs:{title:this.$t("sort.drag"),icon:"sort","aria-hidden":"true"}})}),[]).exports,Wr={install(t){t.component("k-draggable",Nr),t.component("k-error-boundary",Fr),t.component("k-fatal",zr),t.component("k-icon",Ar),t.component("k-icons",Yr),t.component("k-notification",Rr),t.component("k-offline-warning",Vr),t.component("k-progress",Ur),t.component("k-sort-handle",Kr)}};const Jr=ot({props:{crumbs:{type:Array,default:()=>[]},label:{type:String,default:"Breadcrumb"}},computed:{dropdown(){return this.crumbs.map((t=>({...t,text:t.label,icon:"angle-right"})))}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-breadcrumb",attrs:{"aria-label":t.label}},[t.crumbs.length>1?e("div",{staticClass:"k-breadcrumb-dropdown"},[e("k-button",{attrs:{icon:"home"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.dropdown}})],1):t._e(),e("ol",t._l(t.crumbs,(function(s,i){return e("li",{key:i},[e("k-button",{staticClass:"k-breadcrumb-link",attrs:{icon:s.loading?"loader":s.icon,link:s.link,disabled:!s.link,text:s.text??s.label,title:s.text??s.label,current:i===t.crumbs.length-1&&"page",variant:"dimmed",size:"sm"}})],1)})),0)])}),[]).exports;const Gr=ot({props:{items:{type:Array},name:{default:"items",type:String},selected:{type:String},type:{default:"radio",type:String}},emits:["select"]},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-browser"},[e("div",{staticClass:"k-browser-items"},t._l(t.items,(function(s){return e("label",{key:s.value,staticClass:"k-browser-item",attrs:{"aria-selected":t.selected===s.value}},[e("input",{attrs:{name:t.name,type:t.type},domProps:{checked:t.selected===s.value},on:{change:function(e){return t.$emit("select",s)}}}),s.image?e("k-item-image",{staticClass:"k-browser-item-image",attrs:{image:{...s.image,cover:!0,back:"black"}}}):t._e(),e("span",{staticClass:"k-browser-item-info"},[t._v(" "+t._s(s.label)+" ")])],1)})),0)])}),[]).exports,Xr={props:{disabled:Boolean,download:Boolean,rel:String,tabindex:[String,Number],target:String,title:String}};const Zr=ot({mixins:[Xr],props:{to:[String,Function]},emits:["click"],computed:{downloadAttr(){return this.download?this.href.split("/").pop():void 0},href(){return"function"==typeof this.to?"":"/"!==this.to[0]||this.target?!0===this.to.includes("@")&&!1===this.to.includes("/")&&!1===this.to.startsWith("mailto:")?"mailto:"+this.to:this.to:this.$url(this.to)},relAttr(){return"_blank"===this.target?"noreferrer noopener":this.rel}},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",{ref:"link",staticClass:"k-link",attrs:{download:t.downloadAttr,href:t.href,rel:t.relAttr,tabindex:t.tabindex,target:t.target,title:t.title},on:{click:t.onClick}},[t._t("default")],2):e("span",{staticClass:"k-link",attrs:{title:t.title,"aria-disabled":""}},[t._t("default")],2)}),[]).exports,Qr={mixins:[Xr],props:{autofocus:Boolean,click:{type:Function,default:()=>{}},current:[String,Boolean],dialog:String,drawer:String,dropdown:Boolean,element:String,icon:String,id:[String,Number],link:String,responsive:[Boolean,String],role:String,selected:[String,Boolean],size:String,text:[String,Number],theme:String,type:{type:String,default:"button"},variant:String}};const ta=ot({mixins:[Qr],inheritAttrs:!1,emits:["click"],computed:{attrs(){const t={"aria-current":this.current,"aria-disabled":this.disabled,"aria-label":this.text??this.title,"aria-selected":this.selected,"data-responsive":this.responsive,"data-size":this.size,"data-theme":this.theme,"data-variant":this.variant,id:this.id,tabindex:this.tabindex,title:this.title};return"k-link"===this.component?(t.disabled=this.disabled,t.download=this.download,t.to=this.link,t.rel=this.rel,t.target=this.target):"button"===this.component&&(t.autofocus=this.autofocus,t.role=this.role,t.type=this.type),this.dropdown&&(t["aria-haspopup"]="menu",t["data-dropdown"]=this.dropdown),t},component(){return this.element?this.element:this.link?"k-link":"button"}},methods:{focus(){var t,e;null==(e=(t=this.$el).focus)||e.call(t)},onClick(t){var e;return this.disabled?(t.preventDefault(),!1):this.dialog?this.$dialog(this.dialog):this.drawer?this.$drawer(this.drawer):(null==(e=this.click)||e.call(this,t),void this.$emit("click",t))}}},(function(){var t=this,e=t._self._c;return e(t.component,t._b({tag:"component",class:["k-button",t.$attrs.class],style:t.$attrs.style,attrs:{"data-has-icon":Boolean(t.icon),"data-has-text":Boolean(t.text||t.$slots.default)},on:{click:t.onClick}},"component",t.attrs,!1),[t.icon?e("span",{staticClass:"k-button-icon"},[e("k-icon",{attrs:{type:t.icon}})],1):t._e(),t.text||t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default",(function(){return[t._v(" "+t._s(t.text)+" ")]}))],2):t._e(),t.dropdown&&(t.text||t.$slots.default)?e("span",{staticClass:"k-button-arrow"},[e("k-icon",{attrs:{type:"angle-dropdown"}})],1):t._e()])}),[]).exports;const ea=ot({props:{buttons:Array,layout:String,variant:String,theme:String,size:String,responsive:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-button-group",attrs:{"data-layout":t.layout}},[t.$slots.default?t._t("default"):t._l(t.buttons,(function(s,i){return e("k-button",t._b({key:i},"k-button",{variant:t.variant,theme:t.theme,size:t.size,responsive:t.responsive,...s},!1))}))],2)}),[]).exports;const sa=ot({props:{limit:{default:50,type:Number},opened:{type:String},selected:{type:String}},emits:["select"],data(){return{files:[],page:null,pagination:null,view:this.opened?"files":"tree"}},methods:{paginate(t){this.selectPage(this.page,t.page)},selectFile(t){this.$emit("select",t)},async selectPage(t,e=1){this.page=t;const s="/"===t.id?"/site/files":"/pages/"+this.$api.pages.id(t.id)+"/files",{data:i,pagination:n}=await this.$api.get(s,{select:"filename,id,panelImage,url,uuid",limit:this.limit,page:e});this.pagination=n,this.files=i.map((t=>({label:t.filename,image:t.panelImage,id:t.id,url:t.url,uuid:t.uuid,value:t.uuid??t.url}))),this.view="files"},async togglePage(){await this.$nextTick(),this.$refs.tree.scrollIntoView({behaviour:"smooth",block:"nearest",inline:"nearest"})}}},(function(){var t,e,s=this,i=s._self._c;return i("div",{staticClass:"k-file-browser",attrs:{"data-view":s.view}},[i("div",{staticClass:"k-file-browser-layout"},[i("aside",{ref:"tree",staticClass:"k-file-browser-tree"},[i("k-page-tree",{attrs:{current:(null==(t=s.page)?void 0:t.value)??s.opened},on:{select:s.selectPage,toggleBranch:s.togglePage}})],1),i("div",{ref:"items",staticClass:"k-file-browser-items"},[i("k-button",{staticClass:"k-file-browser-back-button",attrs:{icon:"angle-left",text:null==(e=s.page)?void 0:e.label},on:{click:function(t){s.view="tree"}}}),s.files.length?i("k-browser",{attrs:{items:s.files,selected:s.selected},on:{select:s.selectFile}}):s._e()],1),i("div",{staticClass:"k-file-browser-pagination",on:{click:function(t){t.stopPropagation()}}},[s.pagination?i("k-pagination",s._b({attrs:{details:!0},on:{paginate:s.paginate}},"k-pagination",s.pagination,!1)):s._e()],1)])])}),[]).exports;const ia=ot({props:{tab:String,tabs:{type:Array,default:()=>[]}},computed:{withBadges(){const t=Object.keys(this.$panel.content.changes);return this.tabs.map((e=>{const s=[];for(const t in e.columns)for(const i in e.columns[t].sections)if("fields"===e.columns[t].sections[i].type)for(const n in e.columns[t].sections[i].fields)s.push(n);return e.badge=s.filter((e=>t.includes(e.toLowerCase()))).length,e}))}}},(function(){var t=this;return(0,t._self._c)("k-tabs",{staticClass:"k-model-tabs",attrs:{tab:t.tab,tabs:t.withBadges,theme:"notice"}})}),[]).exports;const na=ot({props:{axis:String,disabled:Boolean,element:{type:String,default:"div"},select:{type:String,default:":where(button, a):not(:disabled)"}},emits:["next","prev"],computed:{keys(){switch(this.axis){case"x":return{ArrowLeft:this.prev,ArrowRight:this.next};case"y":return{ArrowUp:this.prev,ArrowDown:this.next};default:return{ArrowLeft:this.prev,ArrowRight:this.next,ArrowUp:this.prev,ArrowDown:this.next}}}},mounted(){this.$el.addEventListener("keydown",this.keydown)},destroyed(){this.$el.removeEventListener("keydown",this.keydown)},methods:{focus(t=0,e){this.move(t,e)},keydown(t){var e;if(this.disabled)return!1;null==(e=this.keys[t.key])||e.apply(this,[t])},move(t=0,e){var s;const i=[...this.$el.querySelectorAll(this.select)];let n=i.findIndex((t=>t===document.activeElement||t.contains(document.activeElement)));switch(-1===n&&(n=0),t){case"first":t=0;break;case"next":t=n+1;break;case"last":t=i.length-1;break;case"prev":t=n-1}t<0?this.$emit("prev"):t>=i.length?this.$emit("next"):null==(s=i[t])||s.focus(),null==e||e.preventDefault()},next(t){this.move("next",t)},prev(t){this.move("prev",t)}}},(function(){var t=this;return(0,t._self._c)(t.element,{tag:"component",staticClass:"k-navigate"},[t._t("default")],2)}),[]).exports;const oa=ot({name:"k-tree",inheritAttrs:!1,props:{element:{type:String,default:"k-tree"},current:{type:String},items:{type:[Array,Object]},level:{default:0,type:Number}},emits:["close","open","select","toggle"],data(){return{state:this.items}},methods:{arrow:t=>!0===t.loading?"loader":t.open?"angle-down":"angle-right",close(t){this.$set(t,"open",!1),this.$emit("close",t)},isItem:(t,e)=>t.value===e,open(t){this.$set(t,"open",!0),this.$emit("open",t)},select(t){this.$emit("select",t)},toggle(t){this.$emit("toggle",t),!0===t.open?this.close(t):this.open(t)}}},(function(){var t=this,e=t._self._c;return e("ul",{class:["k-tree",t.$options.name,t.$attrs.class],style:{"--tree-level":t.level,...t.$attrs.style}},t._l(t.state,(function(s){return e("li",{key:s.value,attrs:{"aria-expanded":s.open,"aria-current":t.isItem(s,t.current)}},[e("p",{staticClass:"k-tree-branch",attrs:{"data-has-subtree":s.hasChildren&&s.open}},[e("button",{staticClass:"k-tree-toggle",attrs:{disabled:!s.hasChildren,type:"button"},on:{click:function(e){return t.toggle(s)}}},[e("k-icon",{attrs:{type:t.arrow(s)}})],1),e("button",{staticClass:"k-tree-folder",attrs:{disabled:s.disabled,type:"button"},on:{click:function(e){return t.select(s)},dblclick:function(e){return t.toggle(s)}}},[e("k-icon-frame",{attrs:{icon:s.icon??"folder"}}),e("span",{staticClass:"k-tree-folder-label"},[t._v(t._s(s.label))])],1)]),s.hasChildren&&s.open?[e(t.$options.name,t._b({ref:s.value,refInFor:!0,tag:"component",attrs:{items:s.children,level:t.level+1},on:{close:function(e){return t.$emit("close",e)},open:function(e){return t.$emit("open",e)},select:function(e){return t.$emit("select",e)},toggle:function(e){return t.$emit("toggle",e)}}},"component",t.$props,!1))]:t._e()],2)})),0)}),[]).exports,ra={name:"k-page-tree",extends:oa,inheritAttrs:!1,props:{current:{type:String},move:{type:String},root:{default:!0,type:Boolean}},data:()=>({state:[]}),async mounted(){if(this.items)this.state=this.items;else{const t=await this.load(null);await this.open(t[0]),this.state=this.root?t:t[0].children,this.current&&this.preselect(this.current)}},methods:{findItem(t){return this.state.find((e=>this.isItem(e,t)))},isItem:(t,e)=>t.value===e||t.uuid===e||t.id===e,async load(t){return await this.$panel.get("site/tree",{query:{move:this.move??null,parent:t}})},async open(t){if(t){if(!1===t.hasChildren)return!1;this.$set(t,"loading",!0),"string"==typeof t.children&&(t.children=await this.load(t.children)),this.$set(t,"open",!0),this.$set(t,"loading",!1)}},async preselect(t){const e=(await this.$panel.get("site/tree/parents",{query:{page:t,root:this.root}})).data;let s=this;for(let n=0;nPromise.resolve()}},emits:["paginate"],computed:{detailsText(){return 1===this.limit?this.start:this.start+"-"+this.end},end(){return Math.min(this.start-1+this.limit,this.total)},offset(){return this.start-1},pages(){return Math.ceil(this.total/this.limit)},start(){return(this.page-1)*this.limit+1}},methods:{async goTo(t){var e;try{await this.validate(t),null==(e=this.$refs.dropdown)||e.close();const s=((t=Math.max(1,Math.min(t,this.pages)))-1)*this.limit+1;this.$emit("paginate",{page:t,start:s,end:Math.min(s-1+this.limit,this.total),limit:this.limit,offset:s-1,total:this.total})}catch{}},prev(){this.goTo(this.page-1)},next(){this.goTo(this.page+1)}}},(function(){var t=this,e=t._self._c;return t.pages>1?e("k-button-group",{staticClass:"k-pagination",attrs:{layout:"collapsed"},nativeOn:{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.prev.apply(null,arguments)},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.next.apply(null,arguments)}]}},[e("k-button",{staticClass:"k-pagination-button",attrs:{disabled:t.start<=1,title:t.$t("prev"),icon:"angle-left",size:"xs",variant:"filled"},on:{click:t.prev}}),t.details?[e("k-button",{staticClass:"k-pagination-details",attrs:{disabled:t.total<=t.limit,text:t.total>1?`${t.detailsText} / ${t.total}`:t.total,size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",staticClass:"k-pagination-selector",attrs:{"align-x":"end"},nativeOn:{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:void e.stopPropagation()},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:void e.stopPropagation()}]}},[e("form",{attrs:{method:"dialog"},on:{click:function(t){t.stopPropagation()},submit:function(e){return t.goTo(t.$refs.page.value)}}},[e("label",[t._v(" "+t._s(t.$t("pagination.page"))+": "),e("select",{ref:"page",attrs:{autofocus:!0}},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:{type:"submit",icon:"check"}})],1)])]:t._e(),e("k-button",{staticClass:"k-pagination-button",attrs:{disabled:t.end>=t.total,title:t.$t("next"),icon:"angle-right",size:"xs",variant:"filled"},on:{click:t.next}})],2):t._e()}),[]).exports;const ca=ot({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"}]},isFullyDisabled(){return 0===this.buttons.filter((t=>!t.disabled)).length}},methods:{button:t=>t||{disabled:!0,link:"#"}}},(function(){var t=this,e=t._self._c;return t.isFullyDisabled?t._e():e("k-button-group",{staticClass:"k-prev-next",attrs:{buttons:t.buttons,layout:"collapsed",size:"xs"}})}),[]).exports;const ua=ot({mixins:[qt],props:{defaultType:String,isLoading:Boolean,pagination:{type:Object,default:()=>({})},results:Array,types:{type:Object,default:()=>({})}},emits:["close","more","navigate","search"],data(){return{selected:-1,type:this.types[this.defaultType]?this.defaultType:Object.keys(this.types)[0]}},computed:{typesDropdown(){return Object.values(this.types).map((t=>({...t,current:this.type===t.id,click:()=>{this.type=t.id,this.focus()}})))}},watch:{type(){this.search()}},methods:{focus(){var t;null==(t=this.$refs.input)||t.focus()},onDown(){this.select(Math.min(this.selected+1,this.results.length-1))},onEnter(){this.$emit("navigate",this.results[this.selected]??this.results[0])},onUp(){this.select(Math.max(this.selected-1,-1))},async search(){var t,e;null==(t=this.$refs.types)||t.close(),null==(e=this.select)||e.call(this,-1),this.$emit("search",{type:this.type,query:this.query})},select(t){var e;this.selected=t;const s=(null==(e=this.$refs.results)?void 0:e.$el.querySelectorAll(".k-item"))??[];for(const i of s)delete i.dataset.selected;t>=0&&(s[t].dataset.selected=!0)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-search-bar"},[e("div",{staticClass:"k-search-bar-input"},[t.typesDropdown.length>1?[e("k-button",{staticClass:"k-search-bar-types",attrs:{dropdown:!0,icon:t.types[t.type].icon,text:t.types[t.type].label,variant:"dimmed"},on:{click:function(e){return t.$refs.types.toggle()}}}),e("k-dropdown-content",{ref:"types",attrs:{options:t.typesDropdown}})]:t._e(),e("k-search-input",{ref:"input",attrs:{"aria-label":t.$t("search"),autofocus:!0,value:t.query},on:{input:function(e){t.query=e}},nativeOn:{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,"enter",13,e.key,"Enter")?null:t.onEnter.apply(null,arguments)}]}}),e("k-button",{staticClass:"k-search-bar-close",attrs:{icon:t.isLoading?"loader":"cancel",title:t.$t("close")},on:{click:function(e){return t.$emit("close")}}})],2),t.results?e("div",{staticClass:"k-search-bar-results"},[t.results.length?e("k-collection",{ref:"results",attrs:{items:t.results},nativeOn:{mouseout:function(e){return t.select(-1)}}}):t._e(),e("footer",{staticClass:"k-search-bar-footer"},[0===t.results.length?e("p",[t._v(" "+t._s(t.$t("search.results.none"))+" ")]):t._e(),t.results.length({fields:{},isLoading:!0,issue:null}),watch:{timestamp(){this.fetch()}},mounted(){this.fetch()},methods:{async fetch(){try{const t=await this.load();this.fields=t.fields;for(const e in this.fields)this.fields[e].section=this.name,this.fields[e].endpoints={field:this.parent+"/fields/"+e,section:this.parent+"/sections/"+this.name,model:this.parent}}catch(t){this.issue=t}finally{this.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return t.isLoading?t._e():e("k-section",{class:["k-fields-section",t.$attrs.class],style:t.$attrs.style,attrs:{headline:t.issue?t.$t("error"):null}},[t.issue?e("k-box",{attrs:{text:t.issue.message,html:!1,icon:"alert",theme:"negative"}}):t._e(),e("k-form",{attrs:{fields:t.fields,validate:!0,value:t.content,disabled:t.lock&&"lock"===t.lock.state},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],1)}),[]).exports;const ga=ot({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("filter"),click:this.onSearchToggle,responsive:!0}),this.canAdd&&t.push({icon:this.addIcon,text:this.$t("add"),click:this.onAdd,responsive:!0}),t},canAdd:()=>!0,canDrop:()=>!1,canSearch(){return this.options.search},collection(){return{columns:this.options.columns,empty:this.emptyPropsWithSearch,fields:this.options.fields,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(){this.search()},timestamp(){this.reload()}},mounted(){this.search=Bt(this.search,200),this.load()},methods:{async load(t){this.isProcessing=!0,t||(this.isLoading=!0);const e=this.pagination.page??localStorage.getItem(this.paginationId)??1;try{const t=await this.$api.get(this.parent+"/sections/"+this.name,{page:e,searchterm:this.searchterm});this.options=t.options,this.pagination=t.pagination,this.data=t.data}catch(s){this.error=s.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},async reload(){await this.load(!0)},async search(){this.pagination.page=0,await this.reload()},update(){this.reload(),this.$events.emit("model.update")}}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("k-section",{class:["k-models-section",`k-${t.type}-section`,t.$attrs.class],style:t.$attrs.style,attrs:{buttons:t.buttons,"data-processing":t.isProcessing,headline:t.options.headline??" ",invalid:t.isInvalid,link:t.options.link,required:Boolean(t.options.min)}},[t.error?e("k-box",{attrs:{icon:"alert",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("filter")+" …",value:t.searchterm,icon:"search",type:"text"},on:{input:function(e){t.searchterm=e}},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.onSearchToggle.apply(null,arguments)}}}):t._e(),e("k-collection",t._g(t._b({on:{action:t.onAction,change:t.onChange,sort:t.onSort,paginate:t.onPaginate}},"k-collection",t.collection,!1),t.canAdd?{empty:t.onAdd}:{}))],1)]],2):t._e()}),[]).exports;const ka=ot({extends:ga,computed:{addIcon:()=>"upload",canAdd(){return this.$panel.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,column:this.column,data:{"data-id":t.id,"data-template":t.template},options:this.$dropdown(t.link,{query:{view:"list",delete:this.data.length>this.options.min}}),sortable:t.permissions.sort&&this.options.sortable})))},type:()=>"files",uploadOptions(){return{...this.options.upload,url:this.$panel.urls.api+"/"+this.options.upload.api,on:{complete:()=>{this.$panel.notification.success({context:"view"}),this.$events.emit("file.upload")}}}}},mounted(){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.$panel.upload.pick(this.uploadOptions)},onDrop(t){this.canAdd&&this.$panel.upload.open(t,this.uploadOptions)},async onSort(t){if(!1===this.options.sortable)return!1;this.isProcessing=!0;try{await this.$api.patch(this.options.apiUrl+"/sort",{files:t.map((t=>t.id)),index:this.pagination.offset}),this.$panel.notification.success(),this.$events.emit("file.sort")}catch(e){this.$panel.error(e),this.reload()}finally{this.isProcessing=!1}},replace(t){this.$panel.upload.replace(t,this.uploadOptions)}}},null,null).exports;const ba=ot({mixins:[ma],inheritAttrs:!1,data:()=>({icon:null,label:null,text:null,theme:null}),async mounted(){const t=await this.load();this.icon=t.icon,this.label=t.label,this.text=t.text,this.theme=t.theme??"info"}},(function(){var t=this,e=t._self._c;return e("k-section",{class:["k-info-section",t.$attrs.class],style:t.$attrs.style,attrs:{headline:t.label}},[e("k-box",{attrs:{html:!0,icon:t.icon,text:t.text,theme:t.theme}})],1)}),[]).exports;const ya=ot({extends:ga,computed:{canAdd(){return this.options.add&&this.$panel.permissions.pages.create},items(){return this.data.map((t=>{const e=t.permissions.sort&&this.options.sortable,s=this.data.length>this.options.min;return{...t,buttons:[{...this.$helper.page.status(t.status,!1===t.permissions.changeStatus),click:()=>this.$dialog(t.link+"/changeStatus")},...t.buttons??[]],column:this.column,data:{"data-id":t.id,"data-status":t.status,"data-template":t.template},deletable:s,options:this.$dropdown(t.link,{query:{view:"list",delete:s,sort:e}}),sortable:e}}))},type:()=>"pages"},mounted(){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.$panel.notification.success(),this.$events.emit("page.sort",i)}catch(s){this.$panel.error({message:s.message,details:s.details}),await this.reload()}finally{this.isProcessing=!1}}}}},null,null).exports;const va=ot({mixins:[ma],data:()=>({headline:null,isLoading:!0,reports:null,size:null}),async mounted(){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("k-section",{staticClass:"k-stats-section",attrs:{headline:t.headline}},[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.$t("stats.empty")))])],1):t._e()}),[]).exports,$a={install(t){t.component("k-section",da),t.component("k-sections",ha),t.component("k-fields-section",fa),t.component("k-files-section",ka),t.component("k-info-section",ba),t.component("k-pages-section",ya),t.component("k-stats-section",va)}};const xa=ot({components:{"k-highlight":()=>dr((()=>import("./Highlight.min.js")),__vite__mapDeps([5,1]),import.meta.url)},props:{language:{type:String}}},(function(){var t=this,e=t._self._c;return e("k-highlight",[e("div",[e("pre",{staticClass:"k-code",attrs:{"data-language":t.language}},[e("code",{key:t.$slots.default[0].text+"-"+t.language,class:t.language?`language-${t.language}`:null},[t._t("default")],2)])])])}),[]).exports;const wa=ot({props:{link:String,tag:{type:String,default:"h2"}},emits:["click"]},(function(){var t=this,e=t._self._c;return e(t.tag,{tag:"component",staticClass:"k-headline",on:{click:function(e){return t.$emit("click",e)}}},[t.link?e("k-link",{attrs:{to:t.link}},[t._t("default")],2):t._t("default")],2)}),[]).exports;const _a=ot({props:{input:{type:[String,Number]},invalid:{type:Boolean},link:{type:String},required:{default:!1,type:Boolean},type:{default:"field",type:String}},computed:{element(){return"section"===this.type?"h2":"label"}}},(function(){var t=this,e=t._self._c;return e(t.element,{tag:"component",staticClass:"k-label",class:"k-"+t.type+"-label",attrs:{for:t.input}},[t.link?e("k-link",{attrs:{to:t.link}},[e("span",{staticClass:"k-label-text"},[t._t("default")],2)]):e("span",{staticClass:"k-label-text"},[t._t("default")],2),t.required?e("abbr",{attrs:{title:t.$t(t.type+".required")}},[t._v("✶")]):t._e(),e("abbr",{staticClass:"k-label-invalid",attrs:{title:t.$t(t.type+".invalid")}},[t._v("×")])],1)}),[]).exports;const Sa=ot({props:{align:String,html:String,size:String},computed:{attrs(){return{class:"k-text","data-align":this.align,"data-size":this.size}}}},(function(){var t=this,e=t._self._c;return t.html?e("div",t._b({domProps:{innerHTML:t._s(t.html)}},"div",t.attrs,!1)):e("div",t._b({},"div",t.attrs,!1),[t._t("default")],2)}),[]).exports,Ca={install(t){t.component("k-code",xa),t.component("k-headline",wa),t.component("k-label",_a),t.component("k-text",Sa)}},Oa={props:{back:String,color:String,cover:{type:Boolean,default:!0},icon:String,type:String,url:String}};const Aa=ot({mixins:[Oa],computed:{fallbackColor(){var t,e,s;return(null==(t=this.type)?void 0:t.startsWith("image/"))?"orange-500":(null==(e=this.type)?void 0:e.startsWith("audio/"))?"aqua-500":(null==(s=this.type)?void 0:s.startsWith("video/"))?"yellow-500":"white"},fallbackIcon(){var t,e,s;return(null==(t=this.type)?void 0:t.startsWith("image/"))?"image":(null==(e=this.type)?void 0:e.startsWith("audio/"))?"audio":(null==(s=this.type)?void 0:s.startsWith("video/"))?"video":"file"},isPreviewable(){return["image/jpeg","image/jpg","image/gif","image/png","image/webp","image/avif","image/svg+xml"].includes(this.type)}}},(function(){var t=this,e=t._self._c;return e("a",{staticClass:"k-upload-item-preview",attrs:{href:t.url,target:"_blank"}},[t.isPreviewable?e("k-image",{attrs:{cover:t.cover,src:t.url,back:t.back??"pattern"}}):e("k-icon-frame",{attrs:{color:t.color??t.fallbackColor,icon:t.icon??t.fallbackIcon,back:t.back??"black",ratio:"1/1"}})],1)}),[]).exports;const Ma=ot({mixins:[Oa],props:{completed:Boolean,editable:{type:Boolean,default:!0},error:[String,Boolean],extension:String,id:String,name:String,niceSize:String,progress:Number,removable:{type:Boolean,default:!0}},emits:["remove","rename"]},(function(){var t=this,e=t._self._c;return e("li",{staticClass:"k-upload-item",attrs:{"data-completed":t.completed}},[e("k-upload-item-preview",{attrs:{back:t.back,color:t.color,cover:t.cover,icon:t.icon,type:t.type,url:t.url}}),e("k-input",{staticClass:"k-upload-item-input",attrs:{disabled:t.completed||!t.editable,after:"."+t.extension,required:!0,value:t.name,allow:"a-z0-9@._-",type:"slug"},on:{input:function(e){return t.$emit("rename",e)}}}),e("div",{staticClass:"k-upload-item-body"},[e("p",{staticClass:"k-upload-item-meta"},[t._v(" "+t._s(t.niceSize)+" "),t.progress?[t._v(" - "+t._s(t.progress)+"% ")]:t._e()],2),t.error?e("p",{staticClass:"k-upload-item-error"},[t._v(" "+t._s(t.error)+" ")]):t.progress?e("k-progress",{staticClass:"k-upload-item-progress",attrs:{value:t.progress}}):t._e()],1),e("div",{staticClass:"k-upload-item-toggle"},[t.completed||t.progress||!t.removable?!t.completed&&t.progress?e("k-button",{attrs:{disabled:!0,icon:"loader"}}):t.completed?e("k-button",{attrs:{icon:"check",theme:"positive"},on:{click:function(e){return t.$emit("remove")}}}):t._e():e("k-button",{attrs:{icon:"remove"},on:{click:function(e){return t.$emit("remove")}}})],1)],1)}),[]).exports;const Da=ot({props:{items:Array},emits:["remove","rename"]},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-upload-items"},t._l(t.items,(function(s){return e("k-upload-item",t._b({key:s.id,on:{rename:function(e){return t.$emit("rename",s,e)},remove:function(e){return t.$emit("remove",s)}}},"k-upload-item",s,!1))})),1)}),[]).exports,ja={install(t){t.component("k-upload-item",Ma),t.component("k-upload-item-preview",Aa),t.component("k-upload-items",Da)}};const Ea=ot({props:{status:{default:"missing",type:String}}},(function(){var t=this,e=t._self._c;return t.$panel.activation.isOpen?e("div",{staticClass:"k-activation"},[e("p",[e("strong",[t._v(t._s(t.$t(`license.status.${t.status}.bubble`)))]),"missing"===t.status?[e("a",{attrs:{href:"https://getkirby.com/buy",target:"_blank"}},[t._v(t._s(t.$t("license.buy")))]),t._v(" & "),e("button",{attrs:{type:"button"},on:{click:function(e){return t.$dialog("registration")}}},[t._v(" "+t._s(t.$t("license.activate"))+" ")])]:t._e()],2),e("k-button",{staticClass:"k-activation-toggle",attrs:{icon:"cancel-small"},on:{click:function(e){return t.$panel.activation.close()}}})],1):t._e()}),[]).exports;const Ta=ot({mixins:[Qr],props:{options:{type:Array,default:()=>[]}},computed:{languages(){return this.options.map((t=>"-"===t?t:{...t,click:()=>this.change(t)}))}},methods:{change(t){this.$reload({query:{language:t.code}})}}},(function(){var t=this;return(0,t._self._c)("k-view-button",t._b({attrs:{options:t.languages}},"k-view-button",t.$props,!1))}),[]).exports;const Ia=ot({extends:ta,props:{options:[Array,String],size:{default:"sm"},variant:{default:"filled"}},emits:["action","click"],computed:{hasDropdown(){return!0===Array.isArray(this.options)?this.options.length>0:Boolean(this.options)}},methods:{onClick(){if(this.hasDropdown)return this.$refs.dropdown.toggle();this.$emit("click")}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-view-button"},[e("k-button",t._b({attrs:{dropdown:t.dropdown||t.hasDropdown},on:{click:t.onClick}},"k-button",t.$props,!1)),t.hasDropdown?e("k-dropdown-content",{ref:"dropdown",attrs:{options:Array.isArray(t.options)?t.options:t.$dropdown(t.options),"align-x":"end"},on:{action:function(e){return t.$emit("action",e)}}}):t._e()],1)}),[]).exports;const La=ot({extends:Ia,emits:["action"]},(function(){var t=this;return(0,t._self._c)("k-view-button",t._b({attrs:{disabled:t.$panel.content.isLocked},on:{action:function(e){return t.$emit("action",e)}}},"k-view-button",t.$props,!1))}),[]).exports;const Ba=ot({extends:Ia},(function(){var t=this;return(0,t._self._c)("k-view-button",t._b({attrs:{disabled:t.disabled||t.$panel.content.isLocked}},"k-view-button",t.$props,!1))}),[]).exports;const qa=ot({computed:{current(){return this.$panel.theme.current},options(){return[{text:this.$t("theme.light"),icon:"sun",disabled:"light"===this.setting,click:()=>this.$panel.theme.set("light")},{text:this.$t("theme.dark"),icon:"moon",disabled:"dark"===this.setting,click:()=>this.$panel.theme.set("dark")},{text:this.$t("theme.automatic"),icon:"wand",disabled:null===this.setting,click:()=>this.$panel.theme.reset()}]},setting(){return this.$panel.theme.setting}}},(function(){var t=this;return(0,t._self._c)("k-view-button",{attrs:{icon:"light"===t.current?"sun":"moon",options:t.options,text:t.$t("theme")}})}),[]).exports;const Pa=ot({props:{buttons:{type:Array,default:()=>[]}},emits:["action"],methods:{component(t){return this.$helper.isComponent(t.component)?t.component:"k-view-button"}}},(function(){var t=this,e=t._self._c;return t.buttons.length?e("k-button-group",{staticClass:"k-view-buttons"},t._l(t.buttons,(function(s){return e(t.component(s),t._b({key:s.key,tag:"component",on:{action:function(e){return t.$emit("action",e)}}},"component",s.props,!1))})),1):t._e()}),[]).exports,Na={install(t){t.component("k-languages-dropdown",Ta),t.component("k-settings-view-button",La),t.component("k-status-view-button",Ba),t.component("k-theme-view-button",qa),t.component("k-view-button",Ia),t.component("k-view-buttons",Pa)}};const Fa=ot({computed:{notification(){return"view"!==this.$panel.notification.context||this.$panel.notification.isFatal?null:this.$panel.notification}}},(function(){var t=this,e=t._self._c;return e("k-panel",{staticClass:"k-panel-inside"},[e("k-panel-menu"),e("main",{staticClass:"k-panel-main"},[e("k-topbar",{attrs:{breadcrumb:t.$panel.view.breadcrumb,view:t.$panel.view}},[t._t("topbar")],2),t._t("default")],2),t.notification&&"error"!==t.notification.type?e("k-button",{staticClass:"k-panel-notification",attrs:{icon:t.notification.icon,text:t.notification.message,theme:t.notification.theme,variant:"filled"},on:{click:function(e){return t.notification.close()}}}):t._e()],1)}),[]).exports;const za=ot({data:()=>({over:!1}),computed:{activationButton(){return"missing"===this.$panel.license?{click:()=>this.$dialog("registration"),text:this.$t("activate")}:"legacy"===this.$panel.license&&{click:()=>this.$dialog("license"),text:this.$t("renew")}},hasSearch(){return this.$helper.object.length(this.$panel.searches)>0},menus(){return this.$helper.array.split(this.$panel.menu.entries,"-")}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-panel-menu",attrs:{"aria-label":t.$t("menu"),"data-hover":t.$panel.menu.hover},on:{mouseenter:function(e){t.$panel.menu.hover=!0},mouseleave:function(e){t.$panel.menu.hover=!1}}},[e("div",{staticClass:"k-panel-menu-body"},[t.hasSearch?e("k-button",{staticClass:"k-panel-menu-search k-panel-menu-button",attrs:{text:t.$t("search"),icon:"search"},on:{click:function(e){return t.$panel.search()}}}):t._e(),t._l(t.menus,(function(s,i){return e("menu",{key:i,staticClass:"k-panel-menu-buttons",attrs:{"data-second-last":i===t.menus.length-2}},t._l(s,(function(s){return e("k-button",t._b({key:s.id,staticClass:"k-panel-menu-button",attrs:{title:s.title??s.text}},"k-button",s,!1))})),1)})),t.activationButton?e("menu",[e("k-button",t._b({staticClass:"k-activation-button k-panel-menu-button",attrs:{icon:"key",theme:"love",variant:"filled"}},"k-button",t.activationButton,!1)),e("k-activation",{attrs:{status:t.$panel.license}})],1):t._e()],2),e("k-button",{staticClass:"k-panel-menu-toggle",attrs:{icon:t.$panel.menu.isOpen?"angle-left":"angle-right",title:t.$panel.menu.isOpen?t.$t("collapse"):t.$t("expand"),size:"xs"},on:{click:function(e){return t.$panel.menu.toggle()}}})],1)}),[]).exports;const Ya=ot({},(function(){return(0,this._self._c)("k-panel",{staticClass:"k-panel-outside",attrs:{tabindex:"0"}},[this._t("default")],2)}),[]).exports;const Ra=ot({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-panel",attrs:{"data-dragging":t.$panel.drag.isDragging,"data-loading":t.$panel.isLoading,"data-language":t.$panel.language.code,"data-language-default":t.$panel.language.isDefault,"data-menu":t.$panel.menu.isOpen?"true":"false","data-role":t.$panel.user.role,"data-theme":t.$panel.theme.current,"data-translation":t.$panel.translation.code,"data-user":t.$panel.user.id,dir:t.$panel.direction}},[t._t("default"),t.$panel.dialog.isOpen&&!t.$panel.dialog.legacy?e("k-fiber-dialog"):t._e(),t.$panel.drawer.isOpen&&!t.$panel.drawer.legacy?e("k-fiber-drawer"):t._e(),t.$panel.notification.isFatal&&t.$panel.notification.isOpen?e("k-fatal",{attrs:{html:t.$panel.notification.message}}):t._e(),e("k-offline-warning"),e("k-icons"),e("k-overlay",{attrs:{nested:t.$panel.drawer.history.milestones.length>1,visible:t.$panel.drawer.isOpen,type:"drawer"},on:{close:function(e){return t.$panel.drawer.close()}}},[e("portal-target",{staticClass:"k-drawer-portal k-portal",attrs:{name:"drawer",multiple:""}})],1),e("k-overlay",{attrs:{visible:t.$panel.dialog.isOpen,type:"dialog"},on:{close:function(e){return t.$panel.dialog.close()}}},[e("portal-target",{staticClass:"k-dialog-portal k-portal",attrs:{name:"dialog",multiple:""}})],1),e("portal-target",{staticClass:"k-overlay-portal k-portal",attrs:{name:"overlay",multiple:""}})],2)}),[]).exports;const Va=ot({props:{breadcrumb:Array,view:Object},computed:{crumbs(){return[{link:this.view.link,label:this.view.label??this.view.breadcrumbLabel,icon:this.view.icon,loading:this.$panel.isLoading},...this.breadcrumb]}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-topbar"},[e("k-button",{staticClass:"k-panel-menu-proxy",attrs:{icon:"bars"},on:{click:function(e){return t.$panel.menu.toggle()}}}),e("k-breadcrumb",{staticClass:"k-topbar-breadcrumb",attrs:{crumbs:t.crumbs}}),e("div",{staticClass:"k-topbar-spacer"}),e("div",{staticClass:"k-topbar-signals"},[t._t("default")],2)],1)}),[]).exports,Ha={install(t){t.use(Na),t.component("k-activation",Ea),t.component("k-panel",Ra),t.component("k-panel-inside",Fa),t.component("k-panel-menu",za),t.component("k-panel-outside",Ya),t.component("k-topbar",Va)}};const Ua=ot({props:{error:String,layout:String}},(function(){var t=this,e=t._self._c;return e(`k-panel-${t.layout}`,{tag:"component",staticClass:"k-error-view"},["outside"===t.layout?[e("div",[e("k-box",{attrs:{icon:"alert",theme:"negative"}},[t._v(t._s(t.error))])],1)]:[e("k-header",[t._v(t._s(t.$t("error")))]),e("k-box",{attrs:{icon:"alert",theme:"negative"}},[t._v(t._s(t.error))])]],2)}),[]).exports;const Ka=ot({mixins:[qt],props:{type:{default:"pages",type:String}},data:()=>({query:new URLSearchParams(window.location.search).get("query"),pagination:{},results:[]}),computed:{currentType(){return this.$panel.searches[this.type]??Object.values(this.$panel.searches)[0]},empty(){return this.isLoading?this.$t("searching")+"…":this.query.length<2?this.$t("search.min",{min:2}):this.$t("search.results.none")},isLoading(){return this.$panel.searcher.isLoading},tabs(){const t=[];for(const e in this.$panel.searches){const s=this.$panel.searches[e];t.push({label:s.label,link:"/search/?type="+e+"&query="+this.query,name:e})}return t}},watch:{isLoading(t){this.$panel.isLoading=t},query:{handler(){this.search(1)},immediate:!0},type(){this.search()}},methods:{focus(){var t;null==(t=this.$refs.input)||t.focus()},onPaginate(t){this.search(t.page)},async search(t){t||(t=new URLSearchParams(window.location.search).get("page")??1);const e=this.$panel.url(window.location,{type:this.currentType.id,query:this.query,page:t});window.history.pushState("","",e.toString());const s=await this.$panel.search(this.currentType.id,this.query,{page:t,limit:15});s&&(this.results=s.results??[],this.pagination=s.pagination)}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-search-view"},[e("k-header",[t._v(" "+t._s(t.$t("search"))+" "),e("k-input",{ref:"input",staticClass:"k-search-view-input",attrs:{slot:"buttons","aria-label":t.$t("search"),autofocus:!0,icon:t.isLoading?"loader":"search",placeholder:t.$t("search")+" …",spellcheck:!1,value:t.query,type:"text"},on:{input:function(e){t.query=e}},slot:"buttons"})],1),e("k-tabs",{attrs:{tab:t.currentType.id,tabs:t.tabs}}),e("div",{staticClass:"k-search-view-results"},[e("k-collection",{attrs:{items:t.results,empty:{icon:t.isLoading?"loader":"search",text:t.empty},pagination:t.pagination},on:{paginate:t.onPaginate}})],1)],1)}),[]).exports;const Wa=ot({props:{blueprint:String,buttons:Array,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:{content(){return this.$panel.content.values},id(){return this.model.link},isLocked(){return this.$panel.content.isLocked},protectedFields:()=>[]},watch:{"$panel.view.timestamp":{handler(){this.$store.dispatch("content/create",{id:this.id,api:this.id,content:this.model.content,ignore:this.protectedFields})},immediate:!0}},mounted(){this.onInput=Bt(this.onInput,50),this.$events.on("model.reload",this.$reload),this.$events.on("keydown.left",this.toPrev),this.$events.on("keydown.right",this.toNext),this.$events.on("view.save",this.onSave)},destroyed(){this.$events.off("model.reload",this.$reload),this.$events.off("keydown.left",this.toPrev),this.$events.off("keydown.right",this.toNext),this.$events.off("view.save",this.onSave)},methods:{onDiscard(){this.$panel.content.discard()},onInput(t){this.$panel.content.set(t)},onSave(t){var e;null==(e=null==t?void 0:t.preventDefault)||e.call(t),this.onSubmit()},onSubmit(t={}){this.$panel.content.set(t),this.$panel.content.publish()},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).exports;const Ja=ot({extends:Wa,props:{preview:Object},methods:{onAction(t){if("replace"===t)return this.$panel.upload.replace({...this.preview,...this.model})}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-file-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-id":t.model.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{staticClass:"k-file-view-header",attrs:{editable:t.permissions.changeName&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-view-buttons",{attrs:{buttons:t.buttons},on:{action:t.onAction}}),e("k-form-buttons",{on:{discard:t.onDiscard,submit:t.onSubmit}})]},proxy:!0}])},[t._v(" "+t._s(t.model.filename)+" ")]),e("k-file-preview",t._b({attrs:{content:t.content},on:{input:t.onInput,submit:t.onSubmit}},"k-file-preview",t.preview,!1)),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),e("k-sections",{attrs:{blueprint:t.blueprint,content:t.content,empty:t.$t("file.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab},on:{input:t.onInput,submit:t.onSubmit}})],1)}),[]).exports;const Ga=ot({props:{component:String,content:Object,props:Object},emits:["input","submit"],computed:{preview(){return this.$helper.isComponent(this.component)?this.component:"k-default-file-preview"}}},(function(){var t=this;return(0,t._self._c)(t.preview,t._b({tag:"component",staticClass:"k-file-preview",attrs:{content:t.content},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}},"component",t.props,!1))}),[]).exports;const Xa=ot({props:{details:{default:()=>[],type:Array}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-file-preview-details"},[e("dl",[t._l(t.details,(function(s){return e("div",{key:s.title},[e("dt",[t._v(t._s(s.title))]),e("dd",[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)])})),t._t("default")],2)])}),[]).exports;const Za=ot({props:{options:{default:()=>[],type:Array}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-file-preview-frame-column"},[e("div",{staticClass:"k-file-preview-frame"},[t._t("default"),t.options.length?[e("k-button",{staticClass:"k-file-preview-frame-dropdown-toggle",attrs:{icon:"dots",size:"xs"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.options,theme:"light"},on:{action:function(e){return t.$emit("action",e)}}})]:t._e()],2)])}),[]).exports;const Qa=ot({props:{details:Array,image:{default:()=>({}),type:Object}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-default-file-preview"},[e("k-file-preview-frame",[e("k-icon",{staticClass:"k-item-icon",attrs:{color:t.$helper.color(t.image.color),type:t.image.icon}})],1),e("k-file-preview-details",{attrs:{details:t.details}})],1)}),[]).exports;const tl=ot({props:{details:Array,url:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-audio-file-preview"},[e("audio",{attrs:{controls:"",preload:"metadata",src:t.url}}),e("k-file-preview-details",{attrs:{details:t.details}})],1)}),[]).exports;const el=ot({props:{content:Object,details:Array,focusable:Boolean,image:{default:()=>({}),type:Object},url:String},emits:["focus","input"],computed:{focus(){const t=this.content.focus;if(!t)return;const[e,s]=t.replaceAll("%","").split(" ");return{x:parseFloat(e),y:parseFloat(s)}},hasFocus(){return Boolean(this.focus)},options(){return[{icon:"open",text:this.$t("open"),link:this.url,target:"_blank"},{icon:"cancel",text:this.$t("file.focus.reset"),click:()=>this.setFocus(void 0),when:this.focusable&&this.hasFocus},{icon:"preview",text:this.$t("file.focus.placeholder"),click:()=>this.setFocus({x:50,y:50}),when:this.focusable&&!this.hasFocus}]}},methods:{setFocus(t){t?!0===this.$helper.object.isObject(t)&&(t=`${t.x.toFixed(1)}% ${t.y.toFixed(1)}%`):t=null,this.$emit("input",{focus:t})}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-default-file-preview k-image-file-preview",attrs:{"data-has-focus":t.hasFocus}},[e("k-file-preview-frame",{attrs:{options:t.options}},[e("k-coords-input",{attrs:{disabled:!t.focusable,value:t.focus},on:{input:function(e){return t.setFocus(e)}}},[e("img",t._b({on:{dragstart:function(t){t.preventDefault()}}},"img",t.image,!1))])],1),e("k-file-preview-details",{attrs:{details:t.details}},[t.image.src?e("div",{staticClass:"k-image-file-preview-focus"},[e("dt",[t._v(t._s(t.$t("file.focus.title")))]),e("dd",[t.focusable?e("k-button",{ref:"focus",attrs:{icon:t.focus?"cancel-small":"preview",title:t.focus?t.$t("file.focus.reset"):void 0,size:"xs",variant:"filled"},on:{click:function(e){t.focus?t.setFocus(void 0):t.setFocus({x:50,y:50})}}},[t.hasFocus?[t._v(t._s(t.focus.x)+"% "+t._s(t.focus.y)+"%")]:[t._v(t._s(t.$t("file.focus.placeholder")))]],2):t.hasFocus?[t._v(" "+t._s(t.focus.x)+"% "+t._s(t.focus.y)+"% ")]:[t._v("–")]],2)]):t._e()])],1)}),[]).exports;const sl=ot({props:{details:Array,url:String},computed:{options(){return[{icon:"download",text:this.$t("download"),link:this.url,download:!0}]}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-video-file-preview"},[e("k-file-preview-frame",{attrs:{options:t.options}},[e("video",{attrs:{controls:"",preload:"metadata",src:t.url}})]),e("k-file-preview-details",{attrs:{details:t.details}})],1)}),[]).exports,il={install(t){t.component("k-file-view",Ja),t.component("k-file-preview",Ga),t.component("k-file-preview-details",Xa),t.component("k-file-preview-frame",Za),t.component("k-default-file-preview",Qa),t.component("k-audio-file-preview",tl),t.component("k-image-file-preview",el),t.component("k-video-file-preview",sl)}};const nl=ot({props:{isInstallable:Boolean,isInstalled:Boolean,isOk:Boolean,requirements:Object,translations:Array},data(){return{user:{name:"",email:"",language:this.$panel.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:"translate",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.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"})}catch(t){this.$panel.error(t)}}}},(function(){var t=this,e=t._self._c;return e("k-panel-outside",{staticClass:"k-installation-view"},[e("div",{staticClass:"k-dialog k-installation-dialog"},[e("k-dialog-body",[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,value:t.user},on:{input:function(e){t.user=e}}}),e("k-button",{attrs:{text:t.$t("install"),icon:"check",size:"lg",theme:"positive",type:"submit",variant:"filled"}})],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",size:"lg",theme:"positive",variant:"filled"},on:{click:t.$reload}})],1)],1)],1)])}),[]).exports,ol={install(t){t.component("k-installation-view",nl)}};const rl=ot({props:{buttons:Array,languages:{type:Array,default:()=>[]},variables:{type:Boolean,default:!0}},computed:{languagesCollection(){return this.languages.map((t=>({...t,image:{back:"black",color:"gray",icon:"translate"},link:()=>{if(!1===this.variables)return null;this.$go(`languages/${t.id}`)},options:[{icon:"edit",text:this.$t("edit"),disabled:!1===this.variables,click:()=>this.$go(`languages/${t.id}`)},{icon:"cog",text:this.$t("settings"),disabled:!this.$panel.permissions.languages.update,click:()=>this.$dialog(`languages/${t.id}/update`)},{when:t.deletable,icon:"trash",text:this.$t("delete"),disabled:!this.$panel.permissions.languages.delete,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-panel-inside",{staticClass:"k-languages-view"},[e("k-header",{scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-view-buttons",{attrs:{buttons:t.buttons}})]},proxy:!0}])},[t._v(" "+t._s(t.$t("view.languages"))+" ")]),t.languages.length>0?[e("k-section",{attrs:{headline:t.$t("languages.default")}},[e("k-collection",{attrs:{items:t.primaryLanguage}})],1),e("k-section",{attrs:{headline:t.$t("languages.secondary")}},[t.secondaryLanguages.length?e("k-collection",{attrs:{items:t.secondaryLanguages}}):e("k-empty",{attrs:{icon:"translate",disabled:!t.$panel.permissions.languages.create},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:"translate",disabled:!t.$panel.permissions.languages.create},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.empty"))+" ")])]:t._e()],2)}),[]).exports;const al=ot({props:{buttons:Array,code:String,deletable:Boolean,direction:String,id:String,info:Array,next:Object,name:String,prev:Object,translations:Array,url:String},computed:{canUpdate(){return this.$panel.permissions.languages.update}},methods:{createTranslation(){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/create`)},option(t,e){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/${window.btoa(encodeURIComponent(e.key))}/${t}`)},updateTranslation({row:t}){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/${window.btoa(encodeURIComponent(t.key))}/update`)}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-language-view",scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{attrs:{editable:t.canUpdate},on:{edit:function(e){return t.$dialog(`languages/${t.id}/update`)}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-view-buttons",{attrs:{buttons:t.buttons}})]},proxy:!0}])},[t._v(" "+t._s(t.name)+" ")]),e("k-section",{attrs:{headline:t.$t("language.settings")}},[e("k-stats",{attrs:{reports:t.info,size:"small"}})],1),e("k-section",{attrs:{buttons:[{click:t.createTranslation,disabled:!t.canUpdate,icon:"add",text:t.$t("add")}],headline:t.$t("language.variables")}},[t.translations.length?[e("k-table",{attrs:{columns:{key:{label:t.$t("language.variable.key"),mobile:!0,width:"1/4"},value:{label:t.$t("language.variable.value"),mobile:!0}},disabled:!t.canUpdate,rows:t.translations},on:{cell:t.updateTranslation,option:t.option}})]:[e("k-empty",{attrs:{disabled:!t.canUpdate,icon:"translate"},on:{click:t.createTranslation}},[t._v(" "+t._s(t.$t("language.variables.empty"))+" ")])]],2)],1)}),[]).exports,ll={install(t){t.component("k-languages-view",rl),t.component("k-language-view",al)}};const cl=ot({emits:["click"]},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-notification k-login-alert",attrs:{"data-theme":"error"}},[e("p",[t._t("default")],2),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return t.$emit("click")}}})],1)}),[]).exports,ul={props:{methods:{type:Array,default:()=>[]},pending:{type:Object,default:()=>({challenge:"email"})},value:String}};const pl=ot({mixins:[ul],emits:["error"],data(){return{code:this.value??"",isLoading:!1}},computed:{mode(){return this.methods.includes("password-reset")?"password-reset":"login"},submitText(){const t=this.isLoading?" …":"";return"password-reset"===this.mode?this.$t("login.reset")+t:this.$t("login")+t}},methods:{async login(){this.$emit("error",null),this.isLoading=!0;try{await this.$api.auth.verifyCode(this.code),this.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"}),"password-reset"===this.mode?this.$go("reset-password"):this.$reload()}catch(t){this.$emit("error",t)}finally{this.isLoading=!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)}}},[t.pending.email?e("k-user-info",{attrs:{user:t.pending.email}}):t._e(),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),placeholder:t.$t("login.code.placeholder."+t.pending.challenge),required:!0,value:t.code,autocomplete:"one-time-code",icon:"unlock",name:"code"},on:{input:function(e){t.code=e}}}),e("footer",{staticClass:"k-login-buttons"},[e("k-button",{staticClass:"k-login-button k-login-back-button",attrs:{text:t.$t("back"),icon:"angle-left",link:"/logout",size:"lg",variant:"filled"}}),e("k-button",{staticClass:"k-login-button",attrs:{text:t.submitText,icon:"check",size:"lg",type:"submit",theme:"positive",variant:"filled"}})],1)],1)}),[]).exports,dl={props:{methods:{type:Array,default:()=>[]},value:{type:Object,default:()=>({})}}};const hl=ot({mixins:[dl],emits:["error"],data(){return{mode:null,isLoading:!1,user:{email:"",password:"",remember:!1,...this.value}}},computed:{alternateMode(){return"email-password"===this.form?"email":"email-password"},canToggle(){return null!==this.codeMode&&(!1!==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(){const 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.mode?this.mode:"password"===this.methods[0]?"email-password":"email"},isResetForm(){return"password-reset"===this.codeMode&&"email"===this.form},submitText(){const t=this.isLoading?" …":"";return this.isResetForm?this.$t("login.reset")+t:this.$t("login")+t},toggleText(){return this.$t("login.toggleText."+this.codeMode+"."+this.alternateMode)}},methods:{async login(){this.$emit("error",null),this.isLoading=!0;const t={...this.user};"email"===this.mode&&(t.password=null),!0===this.isResetForm&&(t.remember=!1);try{await this.$api.auth.login(t),this.$reload({globals:["$system","$translation"]}),this.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"})}catch(e){this.$emit("error",e)}finally{this.isLoading=!1}},toggle(){this.mode=this.alternateMode,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("div",{staticClass:"k-login-fields"},[!0===t.canToggle?e("button",{staticClass:"k-login-toggler",attrs:{type:"button"},on:{click:t.toggle}},[t._v(" "+t._s(t.toggleText)+" ")]):t._e(),e("k-fieldset",{ref:"fieldset",attrs:{fields:t.fields,value:t.user},on:{input:function(e){t.user=e}}})],1),e("footer",{staticClass:"k-login-buttons"},[!1===t.isResetForm?e("k-checkbox-input",{attrs:{label:t.$t("login.remember"),checked:t.user.remember,value:t.user.remember},on:{input:function(e){t.user.remember=e}}}):t._e(),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",size:"lg",theme:"positive",type:"submit",variant:"filled"}},[t._v(" "+t._s(t.submitText)+" ")])],1)])}),[]).exports;const ml=ot({components:{"k-login-plugin-form":window.panel.plugins.login},mixins:[ul,dl],props:{value:{type:Object,default:()=>({code:"",email:"",password:""})}},data:()=>({issue:""}),computed:{component:()=>window.panel.plugins.login?"k-login-plugin-form":"k-login-form",form(){return this.pending.email?"code":"login"}},mounted(){this.$store.dispatch("content/clear")},methods:{async onError(t){null!==t?(!0===t.details.challengeDestroyed&&await this.$reload({globals:["$system"]}),this.issue=t.message):this.issue=null}}},(function(){var t=this,e=t._self._c;return e("k-panel-outside",{class:"code"===t.form?"k-login-code-view":"k-login-view"},[e("div",{staticClass:"k-dialog k-login k-login-dialog"},[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("login"))+" ")]),t.issue?e("k-login-alert",{nativeOn:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),e("k-dialog-body",["code"===t.form?e("k-login-code-form",t._b({on:{error:t.onError}},"k-login-code-form",{methods:t.methods,pending:t.pending,value:t.value.code},!1)):e(t.component,t._b({tag:"component",on:{error:t.onError}},"component",{methods:t.methods,value:t.value},!1))],1)],1)])}),[]).exports,fl={install(t){t.component("k-login-alert",cl),t.component("k-login-code-form",pl),t.component("k-login-form",hl),t.component("k-login-view",ml),t.component("k-login",hl),t.component("k-login-code",pl)}};const gl=ot({extends:Wa,computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-page-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-id":t.model.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[t.model.id?e("k-prev-next",{attrs:{prev:t.prev,next:t.next}}):t._e()]},proxy:!0}])},[e("k-header",{staticClass:"k-page-view-header",attrs:{editable:t.permissions.changeTitle&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.id+"/changeTitle")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-view-buttons",{attrs:{buttons:t.buttons}}),e("k-form-buttons",{on:{discard:t.onDiscard,submit:t.onSubmit}})]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),e("k-sections",{attrs:{blueprint:t.blueprint,content:t.content,empty:t.$t("page.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab},on:{input:t.onInput,submit:t.onSubmit}})],1)}),[]).exports;const kl=ot({extends:Wa,emits:["submit"],computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-site-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-locked":t.isLocked,"data-id":"/","data-template":"site"}},[e("k-header",{staticClass:"k-site-view-header",attrs:{editable:t.permissions.changeTitle&&!t.isLocked},on:{edit:function(e){return t.$dialog("site/changeTitle")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-view-buttons",{attrs:{buttons:t.buttons}}),e("k-form-buttons",{on:{discard:t.onDiscard,submit:t.onSubmit}})]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),e("k-sections",{attrs:{blueprint:t.blueprint,content:t.content,empty:t.$t("site.blueprint"),lock:t.lock,tab:t.tab,parent:"site"},on:{input:t.onInput,submit:t.onSubmit}})],1)}),[]).exports,bl={install(t){t.component("k-page-view",gl),t.component("k-site-view",kl)}};const yl=ot({extends:Wa},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-user-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-id":t.model.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{staticClass:"k-user-view-header",attrs:{editable:t.permissions.changeName&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-view-buttons",{attrs:{buttons:t.buttons}}),e("k-form-buttons",{on:{discard:t.onDiscard,submit:t.onSubmit}})]},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-user-profile",{attrs:{"is-locked":t.isLocked,model:t.model,permissions:t.permissions}}),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),e("k-sections",{attrs:{blueprint:t.blueprint,content:t.content,empty:t.$t("user.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab},on:{input:t.onInput,submit:t.onSubmit}})],1)}),[]).exports;const vl=ot({extends:yl,prevnext:!1},null,null).exports;const $l=ot({data:()=>({isLoading:!1,values:{password:null,passwordConfirmation:null}}),computed:{fields(){return{password:{autofocus:!0,label:this.$t("user.changePassword.new"),icon:"key",type:"password",width:"1/2"},passwordConfirmation:{label:this.$t("user.changePassword.new.confirm"),icon:"key",type:"password",width:"1/2"}}}},mounted(){this.$panel.title=this.$t("view.resetPassword")},methods:{async submit(){if(!this.values.password||this.values.password.length<8)return this.$panel.notification.error(this.$t("error.user.password.invalid"));if(this.values.password!==this.values.passwordConfirmation)return this.$panel.notification.error(this.$t("error.user.password.notSame"));this.isLoading=!0;try{await this.$api.users.changePassword(this.$panel.user.id,this.values.password),this.$panel.notification.success(),this.$go("/")}catch(t){this.$panel.notification.error(t)}finally{this.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-password-reset-view"},[e("form",{on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[e("k-header",{scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button",{attrs:{icon:"check",theme:"notice",type:"submit",variant:"filled",size:"sm"}},[t._v(" "+t._s(t.$t("change"))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)]},proxy:!0}])},[t._v(" "+t._s(t.$t("view.resetPassword"))+" ")]),e("k-user-info",{attrs:{user:t.$panel.user}}),e("k-fieldset",{attrs:{fields:t.fields,value:t.values}})],1)])}),[]).exports;const xl=ot({props:{model:Object},methods:{open(){this.model.avatar?this.$refs.dropdown.toggle():this.upload()},async remove(){await this.$api.users.deleteAvatar(this.model.id),this.$panel.notification.success(),this.$reload()},upload(){this.$panel.upload.pick({url:this.$panel.urls.api+"/"+this.model.link+"/avatar",accept:"image/*",immediate:!0,multiple:!1})}}},(function(){var t=this,e=t._self._c;return e("k-button",{staticClass:"k-user-view-image",attrs:{title:t.$t("avatar")},on:{click:t.open}},[t.model.avatar?[e("k-image-frame",{attrs:{cover:!0,src:t.model.avatar}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:[{icon:"upload",text:t.$t("change"),click:t.upload},{icon:"trash",text:t.$t("delete"),click:t.remove}]}})]:e("k-icon-frame",{attrs:{icon:"user"}})],2)}),[]).exports;const wl=ot({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-frame",{attrs:{cover:!0,src:t.user.avatar.url,ratio:"1/1"}}):e("k-icon-frame",{attrs:{color:"white",back:"black",icon:"user"}}),t._v(" "+t._s(t.user.name??t.user.email??t.user)+" ")],1)}),[]).exports;const _l=ot({props:{isLocked:Boolean,model:Object,permissions:Object}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-user-profile"},[e("k-user-avatar",{attrs:{disabled:t.isLocked,model:t.model}}),e("k-button-group",{attrs:{buttons:[{icon:"email",text:`${t.model.email}`,title:`${t.$t("email")}: ${t.model.email}`,disabled:!t.permissions.changeEmail||t.isLocked,click:()=>t.$dialog(t.model.link+"/changeEmail")},{icon:"bolt",text:`${t.model.role}`,title:`${t.$t("role")}: ${t.model.role}`,disabled:!t.permissions.changeRole||t.isLocked,click:()=>t.$dialog(t.model.link+"/changeRole")},{icon:"translate",text:`${t.model.language}`,title:`${t.$t("language")}: ${t.model.language}`,disabled:!t.permissions.changeLanguage||t.isLocked,click:()=>t.$dialog(t.model.link+"/changeLanguage")}]}})],1)}),[]).exports;const Sl=ot({props:{buttons:Array,role:Object,roles:Array,search:String,title:String,users:Object},computed:{empty(){return{icon:"users",text:this.$t("role.empty")}},items(){return this.users.data.map((t=>(t.options=this.$dropdown(t.link),t)))},tabs(){const t=[{name:"all",label:this.$t("role.all"),link:"/users"}];for(const e of this.roles)t.push({name:e.id,label:e.title,link:"/users?role="+e.id});return t}},methods:{create(){var t;this.$dialog("users/create",{query:{role:null==(t=this.role)?void 0:t.id}})},paginate(t){this.$reload({query:{page:t.page}})}}},(function(){var t,e=this,s=e._self._c;return s("k-panel-inside",{staticClass:"k-users-view"},[s("k-header",{staticClass:"k-users-view-header",scopedSlots:e._u([{key:"buttons",fn:function(){return[s("k-view-buttons",{attrs:{buttons:e.buttons}})]},proxy:!0}])},[e._v(" "+e._s(e.$t("view.users"))+" ")]),s("k-tabs",{attrs:{tab:(null==(t=e.role)?void 0:t.id)??"all",tabs:e.tabs}}),s("k-collection",{attrs:{empty:e.empty,items:e.items,pagination:e.users.pagination},on:{paginate:e.paginate}})],1)}),[]).exports,Cl={install(t){t.component("k-account-view",vl),t.component("k-reset-password-view",$l),t.component("k-user-avatar",xl),t.component("k-user-info",wl),t.component("k-user-profile",_l),t.component("k-user-view",yl),t.component("k-users-view",Sl)}};const Ol=ot({props:{plugins:Array}},(function(){var t=this,e=t._self._c;return t.plugins.length?e("k-section",{attrs:{headline:t.$t("plugins"),link:"https://getkirby.com/plugins"}},[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"),type:"update-status",mobile:!0,width:"10rem"}},rows:t.plugins}})],1):t._e()}),[]).exports,Al={props:{exceptions:{type:Array,default:()=>[]},security:{type:Array,default:()=>[]},urls:{type:Object,default:()=>({})}},data(){return{issues:this.$helper.object.clone(this.security)}},async mounted(){console.info("Running system health checks for the Panel system view; failed requests in the following console output are expected behavior.");const t=(Promise.allSettled??Promise.all).bind(Promise),e=Object.entries(this.urls).map(this.check);await t(e),console.info(`System health checks ended. ${this.issues.length-this.security.length} issues with accessible files/folders found (see the security list in the system view).`)},methods:{async check([t,e]){if(!e)return;const{status:s}=await fetch(e,{cache:"no-store"});s<400&&this.issues.push({id:t,text:this.$t("system.issues."+t),link:"https://getkirby.com/security/"+t,icon:"folder"})},retry(){this.$go(window.location.href)}}};const Ml=ot({components:{Plugins:Ol,Security:ot(Al,(function(){var t=this,e=t._self._c;return t.issues.length?e("k-section",{attrs:{headline:t.$t("security"),buttons:[{title:t.$t("retry"),icon:"refresh",click:t.retry}]}},[e("k-items",{attrs:{items:t.issues.map((t=>({image:{back:"var(--color-red-200)",icon:t.icon??"alert",color:"var(--color-red)"},target:"_blank",...t})))}})],1):t._e()}),[]).exports},props:{buttons:Array,environment:Array,exceptions:Array,info:Object,plugins:Array,security:Array,urls:Object},mounted(){this.exceptions.length>0&&(console.info("The following errors occurred during the update check of Kirby and/or plugins:"),this.exceptions.map((t=>console.warn(t))),console.info("End of errors from the update check."))},methods:{copy(){const t=JSON.stringify({info:this.info,security:this.security.map((t=>t.text)),plugins:this.plugins.map((t=>({name:t.name.text,version:t.version.currentVersion})))},null,2);this.$helper.clipboard.write(t),this.$panel.notification.success({message:this.$t("system.info.copied")})}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-system-view"},[e("k-header",{scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-view-buttons",{attrs:{buttons:t.buttons}})]},proxy:!0}])},[t._v(" "+t._s(t.$t("view.system"))+" ")]),e("k-section",{attrs:{headline:t.$t("environment"),buttons:[{text:t.$t("system.info.copy"),icon:"copy",responsive:!0,click:t.copy}]}},[e("k-stats",{staticClass:"k-system-info",attrs:{reports:t.environment,size:"medium"}})],1),e("security",{attrs:{security:t.security,urls:t.urls}}),e("plugins",{attrs:{plugins:t.plugins}})],1)}),[]).exports;const Dl=ot({props:{value:[String,Object]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-table-update-status-cell"},["string"==typeof t.value?e("span",{staticClass:"k-table-update-status-cell-version"},[t._v(" "+t._s(t.value)+" ")]):[e("k-button",{staticClass:"k-table-update-status-cell-button",attrs:{dropdown:!0,icon:t.value.icon,href:t.value.url,text:t.value.currentVersion,theme:t.value.theme,size:"xs",variant:"filled"},on:{click:function(e){return e.stopPropagation(),t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{"align-x":"end"}},[e("dl",{staticClass:"k-plugin-info"},[e("dt",[t._v(t._s(t.$t("plugin")))]),e("dd",[t._v(t._s(t.value.pluginName))]),e("dt",[t._v(t._s(t.$t("version.current")))]),e("dd",[t._v(t._s(t.value.currentVersion))]),e("dt",[t._v(t._s(t.$t("version.latest")))]),e("dd",[t._v(t._s(t.value.latestVersion))]),e("dt",[t._v(t._s(t.$t("system.updateStatus")))]),e("dd",{attrs:{"data-theme":t.value.theme}},[t._v(t._s(t.value.label))])]),t.value.url?[e("hr"),e("k-button",{attrs:{icon:"open",link:t.value.url}},[t._v(" "+t._s(t.$t("versionInformation"))+" ")])]:t._e()],2)]],2)}),[]).exports,jl={install(t){t.component("k-system-view",Ml),t.component("k-table-update-status-cell",Dl)}},El={install(t){t.component("k-error-view",Ua),t.component("k-search-view",Ka),t.use(il),t.use(ol),t.use(ll),t.use(fl),t.use(bl),t.use(jl),t.use(Cl)}},Tl={install(t){t.use(ht),t.use(ee),t.use(ve),t.use(je),t.use(ur),t.use(gr),t.use(Pr),t.use(Wr),t.use(pa),t.use($a),t.use(Ca),t.use(ja),t.use(Ha),t.use(El),t.use(I)}},Il={install(t){window.onunhandledrejection=t=>{t.preventDefault(),window.panel.error(t.reason)},t.config.errorHandler=window.panel.error.bind(window.panel)}},Ll=(t={})=>{var e=t.desc?-1:1,s=-e,i=/^0/,n=/\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,c=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,u=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 p(t){return t.replace(l,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")}function d(t,e){return(!t.match(i)||1===e)&&parseFloat(t)||t.replace(n," ").replace(o,"")||0}return function(t,i){var n=u(t),o=u(i);if(!n&&!o)return 0;if(!n&&o)return s;if(n&&!o)return e;var l=p(n),h=p(o),m=parseInt(n.match(a),16)||1!==l.length&&Date.parse(n),f=parseInt(o.match(a),16)||m&&o.match(c)&&Date.parse(o)||null;if(f){if(mf)return e}for(var g=l.length,k=h.length,b=0,y=Math.max(g,k);b0)return e;if(x<0)return s;if(b===y-1)return 0}else{if(v<$)return s;if(v>$)return e}}return 0}};RegExp.escape=function(t){return t.replace(new RegExp("[-/\\\\^$*+?.()[\\]{}]","gu"),"\\$&")};function Bl(t){return Array.isArray(t)?t:[t]}const ql={fromObject:function(t){return Array.isArray(t)?t:Object.values(t??{})},search:(t,e,s={})=>{if((e??"").length<=(s.min??0))return t;const i=new RegExp(RegExp.escape(e),"ig"),n=s.field??"text",o=t.filter((t=>!!t[n]&&null!==t[n].match(i)));return s.limit?o.slice(0,s.limit):o},sortBy:function(t,e){const s=e.split(" "),i=s[0],n=s[1]??"asc",o=Ll({desc:"desc"===n,insensitive:!0});return t.sort(((t,e)=>{const s=String(t[i]??""),n=String(e[i]??"");return o(s,n)}))},split:function(t,e){return t.reduce(((t,s)=>(s===e?t.push([]):t[t.length-1].push(s),t)),[[]])},wrap:Bl};const Pl={read:function(t,e=!1){if(!t)return null;if("string"==typeof t)return t;if(t instanceof ClipboardEvent){if(t.preventDefault(),!0===e)return t.clipboardData.getData("text/plain");const s=t.clipboardData.getData("text/html")||t.clipboardData.getData("text/plain")||null;if(s)return s.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 Nl(t){if("string"==typeof t){if("pattern"===(t=t.toLowerCase()))return"var(--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}}function Fl(t,e=!1){if(!t.match("youtu"))return!1;let s=null;try{s=new URL(t)}catch{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",a=t=>!!t&&null!==t.match(/^[a-zA-Z0-9_-]+$/);let l=s.searchParams,c=null;switch(i.join("/")){case"embed/videoseries":case"playlist":a(l.get("list"))&&(c=r+"/videoseries");break;case"watch":a(l.get("v"))&&(c=r+"/"+l.get("v"),l.has("t")&&l.set("start",l.get("t")),l.delete("v"),l.delete("t"));break;default:s.host.includes("youtu.be")&&a(n)?(c=!0===e?"https://www.youtube-nocookie.com/embed/"+n:"https://www.youtube.com/embed/"+n,l.has("t")&&l.set("start",l.get("t")),l.delete("t")):["embed","shorts"].includes(n)&&a(o)&&(c=r+"/"+o)}if(!c)return!1;const u=l.toString();return u.length&&(c+="?"+u),c}function zl(t,e=!1){let s=null;try{s=new URL(t)}catch{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 a=n.toString();return a.length&&(r+="?"+a),r}const Yl={youtube:Fl,vimeo:zl,video:function(t,e=!1){return!0===t.includes("youtu")?Fl(t,e):!0===t.includes("vimeo")&&zl(t,e)}};function Rl(t){var e;if(void 0!==t.default)return ft(t.default);const s=window.panel.app.$options.components[`k-${t.type}-field`],i=null==(e=null==s?void 0:s.options.props)?void 0:e.value;if(void 0===i)return;const n=null==i?void 0:i.default;return"function"==typeof n?n():void 0!==n?n:null}const Vl={defaultValue:Rl,form:function(t){const e={};for(const s in t){const i=Rl(t[s]);void 0!==i&&(e[s]=i)}return e},isVisible:function(t,e){if("hidden"===t.type||!0===t.hidden)return!1;if(!t.when)return!0;for(const s in t.when){const i=e[s.toLowerCase()],n=t.when[s];if((void 0!==i||!(""===n||Array.isArray(n)&&0===n.length))&&i!==n)return!1}return!0},subfields:function(t,e){let s={};for(const i in e){const n=e[i];n.section=t.name,t.endpoints&&(n.endpoints={field:t.endpoints.field+"+"+i,section:t.endpoints.section,model:t.endpoints.model}),s[i]=n}return s}},Hl=t=>t.split(".").slice(-1).join(""),Ul=t=>t.split(".").slice(0,-1).join("."),Kl=t=>Intl.NumberFormat("en",{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow"}).format(t),Wl={extension:Hl,name:Ul,niceSize:Kl};function Jl(t,e){if("string"==typeof t&&(t=document.querySelector(t)),!t)return!1;if(!e&&t.contains(document.activeElement)&&t!==document.activeElement)return!1;const s=[":where([autofocus], [data-autofocus])",":where(input, textarea, select, [contenteditable=true], .input-focus)","[type=submit]","button"];e&&s.unshift(`[name="${e}"]`);const i=function(t,e){for(const s of e){const e=t.querySelector(s);if(!0===Gl(e))return e}return null}(t,s);return i?(i.focus(),i):!0===Gl(t)&&(t.focus(),t)}function Gl(t){return!!t&&(!t.matches("[disabled], [aria-disabled], input[type=hidden]")&&(!t.closest("[aria-disabled]")&&!t.closest("[disabled]")&&"function"==typeof t.focus))}const Xl=t=>"function"==typeof window.Vue.options.components[t],Zl=t=>!!t.dataTransfer&&(!!t.dataTransfer.types&&(!0===t.dataTransfer.types.includes("Files")&&!1===t.dataTransfer.types.includes("text/plain")));const Ql={metaKey:function(){return window.navigator.userAgent.indexOf("Mac")>-1?"cmd":"ctrl"}};function tc(t){return!0===t.startsWith("file://")||!0===t.startsWith("/@/file/")}function ec(t){return"site://"===t||!0===t.startsWith("page://")||!0===t.startsWith("/@/page/")}function sc(t=[]){const e={url:{detect:t=>/^(http|https):\/\//.test(t),icon:"url",id:"url",label:window.panel.$t("url"),link:t=>t,placeholder:window.panel.$t("url.placeholder"),input:"url",value:t=>t},page:{detect:t=>!0===ec(t),icon:"page",id:"page",label:window.panel.$t("page"),link:t=>t,placeholder:window.panel.$t("select")+" …",input:"text",value:t=>t},file:{detect:t=>!0===tc(t),icon:"file",id:"file",label:window.panel.$t("file"),link:t=>t,placeholder:window.panel.$t("select")+" …",value:t=>t},email:{detect:t=>t.startsWith("mailto:"),icon:"email",id:"email",label:window.panel.$t("email"),link:t=>t.replace(/^mailto:/,""),placeholder:window.panel.$t("email.placeholder"),input:"email",value:t=>"mailto:"+t},tel:{detect:t=>t.startsWith("tel:"),icon:"phone",id:"tel",label:window.panel.$t("tel"),link:t=>t.replace(/^tel:/,""),pattern:"[+]{0,1}[0-9]+",placeholder:window.panel.$t("tel.placeholder"),input:"tel",value:t=>"tel:"+t},anchor:{detect:t=>t.startsWith("#"),icon:"anchor",id:"anchor",label:"Anchor",link:t=>t,pattern:"^#.+",placeholder:"#element",input:"text",value:t=>t},custom:{detect:()=>!0,icon:"title",id:"custom",label:window.panel.$t("custom"),link:t=>t,input:"text",value:t=>t}};if(!t.length)return e;const s={};for(const i of t)s[i]=e[i];return s}const ic={detect:function(t,e){if(t=t??"",e=e??sc(),0===t.length)return{type:Object.keys(e)[0]??"url",link:""};for(const s in e)if(!0===e[s].detect(t))return{type:s,link:e[s].link(t)}},getFileUUID:function(t){return t.replace("/@/file/","file://")},getPageUUID:function(t){return t.replace("/@/page/","page://")},isFileUUID:tc,isPageUUID:ec,preview:async function({type:t,link:e},s){return"page"===t&&e?await async function(t,e=["title","panelImage"]){if("site://"===t)return{label:window.panel.$t("view.site")};try{const s=await window.panel.api.pages.get(t,{select:e.join(",")});return{label:s.title,image:s.panelImage}}catch{return null}}(e,s):"file"===t&&e?await async function(t,e=["filename","panelImage"]){try{const s=await window.panel.api.files.get(null,t,{select:e.join(",")});return{label:s.filename,image:s.panelImage}}catch{return null}}(e,s):e?{label:e}:null},types:sc};const nc={status:function(t,e=!1){const s={icon:"status-"+t,title:window.panel.$t("page.status")+": "+window.panel.$t("page.status."+t),disabled:e,size:"xs",style:"--icon-size: 15px"};return e&&(s.title+=` (${window.panel.$t("disabled")})`),s.theme="draft"===t?"negative-icon":"unlisted"===t?"info-icon":"positive-icon",s}},oc=(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+"%"},rc={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function ac(t){return String(t).replace(/[&<>"'`=/]/g,(t=>rc[t]))}function lc(t){return!t||0===String(t).length}function cc(t){const e=String(t);return e.charAt(0).toLowerCase()+e.slice(1)}function uc(t="",e=""){const s=new RegExp(`^(${RegExp.escape(e)})+`,"g");return t.replace(s,"")}function pc(t){let e="";const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(var i=0;i{const i=e[ac(t.shift())]??"…";return"…"===i||0===t.length?i:s(t,i)},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 mc(t){const e=String(t);return e.charAt(0).toUpperCase()+e.slice(1)}function fc(){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}const gc={camelToKebab:function(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()},escapeHTML:ac,hasEmoji:function(t){if("string"!=typeof t)return!1;if(!0===/^[a-z0-9_-]+$/.test(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},isEmpty:lc,lcfirst:cc,ltrim:uc,pad:function(t,e=2){t=String(t);let s="";for(;s.length]+)>)/gi,"")},template:hc,ucfirst:mc,ucwords:function(t){return String(t).split(/ /g).map((t=>mc(t))).join(" ")},unescapeHTML:function(t){for(const e in rc)t=String(t).replaceAll(rc[e],e);return t},uuid:fc};async function kc(t,e){return new Promise(((s,i)=>{var n;const o={url:"/",field:"file",method:"POST",filename:t.name,headers:{},attributes:{},complete:()=>{},error:()=>{},success:()=>{},progress:()=>{}},r=Object.assign(o,e),a=new XMLHttpRequest,l=new FormData;l.append(r.field,t,r.filename);for(const t in r.attributes){const e=r.attributes[t];null!=e&&l.append(t,e)}const c=e=>{if(e.lengthComputable&&r.progress){const s=Math.max(0,Math.min(100,Math.ceil(e.loaded/e.total*100)));r.progress(a,t,s)}};a.upload.addEventListener("loadstart",c),a.upload.addEventListener("progress",c),a.addEventListener("load",(e=>{let n=null;try{n=JSON.parse(e.target.response)}catch{n={status:"error",message:"The file could not be uploaded"}}"error"===n.status?(r.error(a,t,n),i(n)):(r.progress(a,t,100),r.success(a,t,n),s(n))})),a.addEventListener("error",(e=>{const s=JSON.parse(e.target.response);r.progress(a,t,100),r.error(a,t,s),i(s)})),a.open(r.method,r.url,!0);for(const t in r.headers)a.setRequestHeader(t,r.headers[t]);null==(n=r.abort)||n.addEventListener("abort",(()=>{a.abort()})),a.send(l)}))}function bc(){var t;return new URL((null==(t=document.querySelector("base"))?void 0:t.href)??window.location.origin)}function yc(t={},e={}){e instanceof URL&&(e=e.search);const s=new URLSearchParams(e);for(const[i,n]of Object.entries(t))null!==n&&s.set(i,n);return s}function vc(t="",e={},s){return(t=Sc(t,s)).search=yc(e,t.search),t}function $c(t){return null!==String(t).match(/^https?:\/\//)}function xc(t){return Sc(t).origin===window.location.origin}function wc(t,e){if((t instanceof URL||t instanceof Location)&&(t=t.toString()),"string"!=typeof t)return!1;try{new URL(t,window.location)}catch{return!1}if(!0===e){return/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!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]))|(?:localhost)|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/i.test(t)}return!0}function _c(t,e){return!0===$c(t)?t:(e=e??bc(),(e=String(e).replaceAll(/\/$/g,""))+"/"+(t=String(t).replaceAll(/^\//g,"")))}function Sc(t,e){return t instanceof URL?t:new URL(_c(t,e))}const Cc={base:bc,buildQuery:yc,buildUrl:vc,isAbsolute:$c,isSameOrigin:xc,isUrl:wc,makeAbsolute:_c,toObject:Sc},Oc={install(t){t.prototype.$helper={array:ql,clipboard:Pl,clone:yt.clone,color:Nl,embed:Yl,focus:Jl,isComponent:Xl,isUploadEvent:Zl,debounce:Bt,field:Vl,file:Wl,keyboard:Ql,link:ic,object:yt,page:nc,pad:gc.pad,ratio:oc,slug:gc.slug,sort:Ll,string:gc,upload:kc,url:Cc,uuid:gc.uuid},t.prototype.$esc=gc.escapeHTML}},Ac={install(t){const e=(t,e,s)=>{!0!==s.context.disabled?t.dir=window.panel.language.direction:t.dir=null};t.directive("direction",{bind:e,update:e})}},Mc={install(t){window.panel.redirect=window.panel.redirect.bind(window.panel),window.panel.reload=window.panel.reload.bind(window.panel),window.panel.request=window.panel.request.bind(window.panel),window.panel.search=window.panel.search.bind(window.panel);const e=["api","config","direction","events","language","languages","license","menu","multilang","permissions","search","searches","system","t","translation","url","urls","user","view"];for(const s of e){const e=`$${s}`;t.prototype[e]=window.panel[e]=window.panel[s]}t.prototype.$dialog=window.panel.dialog.open.bind(window.panel.dialog),t.prototype.$drawer=window.panel.drawer.open.bind(window.panel.drawer),t.prototype.$dropdown=window.panel.dropdown.openAsync.bind(window.panel.dropdown),t.prototype.$go=window.panel.view.open.bind(window.panel.view),t.prototype.$reload=window.panel.reload.bind(window.panel),window.panel.$vue=window.panel.app}},Dc=/^#?([\da-f]{3}){1,2}$/i,jc=/^#?([\da-f]{4}){1,2}$/i,Ec=/^rgba?\(\s*(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?$/i,Tc=/^hsla?\(\s*(\d{1,3}\.?\d*)(deg|rad|grad|turn)?(?:,|\s)+(\d{1,3})%(?:,|\s)+(\d{1,3})%(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?$/i;function Ic(t){return"string"==typeof t&&(Dc.test(t)||jc.test(t))}function Lc(t){return gt(t)&&"r"in t&&"g"in t&&"b"in t}function Bc(t){return gt(t)&&"h"in t&&"s"in t&&"l"in t}function qc({h:t,s:e,v:s,a:i}){if(0===s)return{h:t,s:0,l:0,a:i};if(0===e&&1===s)return{h:t,s:1,l:1,a:i};const n=s*(2-e)/2;return{h:t,s:e=s*e/(1-Math.abs(2*n-1)),l:n,a:i}}function Pc({h:t,s:e,l:s,a:i}){const n=e*(s<.5?s:1-s);return{h:t,s:e=0===n?0:2*n/(s+n),v:s+n,a:i}}function Nc(t){if(!0===Dc.test(t)||!0===jc.test(t)){"#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.split("").reduce(((t,e)=>t+e+e),""));const e=parseInt(t,16);return!0===Dc.test(t)?{r:e>>16,g:e>>8&255,b:255&e,a:1}:{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:Math.round((255&e)/255*100)/100}}throw new Error(`unknown hex color: ${t}`)}function Fc({r:t,g:e,b:s,a:i=1}){let n="#"+(1<<24|t<<16|e<<8|s).toString(16).slice(1);return i<1&&(n+=(256|Math.round(255*i)).toString(16).slice(1)),n}function zc({h:t,s:e,l:s,a:i}){const n=e*Math.min(s,1-s),o=(e,i=(e+t/30)%12)=>s-n*Math.max(Math.min(i-3,9-i,1),-1);return{r:255*o(0),g:255*o(8),b:255*o(4),a:i}}function Yc({r:t,g:e,b:s,a:i}){t/=255,e/=255,s/=255;const n=Math.max(t,e,s),o=n-Math.min(t,e,s),r=1-Math.abs(n+n-o-1);let a=o&&(n==t?(e-s)/o:n==e?2+(s-t)/o:4+(t-e)/o);return a=60*(a<0?a+6:a),{h:a,s:r?o/r:0,l:(n+n-o)/2,a:i}}function Rc(t){return Fc(zc(t))}function Vc(t){return Yc(Nc(t))}function Hc(t,e){return t=Number(t),"grad"===e?t*=.9:"rad"===e?t*=180/Math.PI:"turn"===e&&(t*=360),parseInt(t%360)}function Uc(t,e){if(!0===Ic(t))switch("#"!==t[0]&&(t="#"+t),e){case"hex":return t;case"rgb":return Nc(t);case"hsl":return Vc(t);case"hsv":return Pc(Vc(t))}if(!0===Lc(t))switch(e){case"hex":return Fc(t);case"rgb":return t;case"hsl":return Yc(t);case"hsv":return function({r:t,g:e,b:s,a:i}){t/=255,e/=255,s/=255;const n=Math.max(t,e,s),o=n-Math.min(t,e,s);let r=o&&(n==t?(e-s)/o:n==e?2+(s-t)/o:4+(t-e)/o);return r=60*(r<0?r+6:r),{h:r,s:n&&o/n,v:n,a:i}}(t)}if(!0===Bc(t))switch(e){case"hex":return Rc(t);case"rgb":return zc(t);case"hsl":return t;case"hsv":return Pc(t)}if(!0===function(t){return gt(t)&&"h"in t&&"s"in t&&"v"in t}(t))switch(e){case"hex":return Rc(qc(t));case"rgb":return function({h:t,s:e,v:s,a:i}){const n=(i,n=(i+t/60)%6)=>s-s*e*Math.max(Math.min(n,4-n,1),0);return{r:255*n(5),g:255*n(3),b:255*n(1),a:i}}(t);case"hsl":return qc(t);case"hsv":return t}throw new Error(`Invalid color conversion: ${JSON.stringify(t)} -> ${e}`)}function Kc(t){let e;if(!t||"string"!=typeof t)return!1;if(!0===Ic(t))return"#"!==t[0]&&(t="#"+t),t;if(e=t.match(Ec)){const t={r:Number(e[1]),g:Number(e[3]),b:Number(e[5]),a:Number(e[7]||1)};return"%"===e[2]&&(t.r=Math.ceil(2.55*t.r)),"%"===e[4]&&(t.g=Math.ceil(2.55*t.g)),"%"===e[6]&&(t.b=Math.ceil(2.55*t.b)),"%"===e[8]&&(t.a=t.a/100),t}if(e=t.match(Tc)){let[t,s,i,n,o]=e.slice(1);const r={h:Hc(t,s),s:Number(i)/100,l:Number(n)/100,a:Number(o||1)};return"%"===e[6]&&(r.a=r.a/100),r}return null}const Wc={convert:Uc,parse:Kc,parseAs:function(t,e){const s=Kc(t);return s&&e?Uc(s,e):s},toString:function(t,e,s=!0){var i,n;let o=t;if("string"==typeof o&&(o=Kc(t)),o&&e&&(o=Uc(o,e)),!0===Ic(o))return!0!==s&&(5===o.length?o=o.slice(0,4):o.length>7&&(o=o.slice(0,7))),o.toLowerCase();if(!0===Lc(o)){const t=o.r.toFixed(),e=o.g.toFixed(),n=o.b.toFixed(),r=null==(i=o.a)?void 0:i.toFixed(2);return s&&r&&r<1?`rgb(${t} ${e} ${n} / ${r})`:`rgb(${t} ${e} ${n})`}if(!0===Bc(o)){const t=o.h.toFixed(),e=(100*o.s).toFixed(),i=(100*o.l).toFixed(),r=null==(n=o.a)?void 0:n.toFixed(2);return s&&r&&r<1?`hsl(${t} ${e}% ${i}% / ${r})`:`hsl(${t} ${e}% ${i}%)`}throw new Error(`Unsupported color: ${JSON.stringify(t)}`)}};L.extend(B),L.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 YYYY":!0,"MMM DD":!1,"MMM D":!1,"MM YYYY":!0,"M YYYY":!0,"MMMM DD YYYY":!0,"MMMM D YYYY":!0,"MMMM DD YY":!0,"MMMM D YY":!0,"MMMM DD, YYYY":!0,"MMMM D, YYYY":!0,"MMMM DD, YY":!0,"MMMM D, YY":!0,"MMMM DD. YYYY":!0,"MMMM D. YYYY":!0,"MMMM DD. YY":!0,"MMMM D. YY":!0,DDMMYYYY:!0,DDMMYY:!0,"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:{"HHmmss a":!1,"HHmm a":!1,"HH a":!1,HHmmss:!1,HHmm:!1,"HH:mm:ss a":!1,"HH:mm:ss":!1,"HH:mm a":!1,"HH:mm":!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}})),L.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){e&&(e=i(e)),e??(e=[i("datetime"),i("date"),i("time")]);const n=s(t,e);return n&&n.isValid()?n:null}})),L.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.hasOwn(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}})),L.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)})),L.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();for(const a of o)i=i.startOf(a);if(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}})),L.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)}}));const Jc={install(t){t.prototype.$library={autosize:q,colors:Wc,dayjs:L}}},Gc=(t,e={})=>Vue.reactive({...e,key:()=>t,defaults:()=>e,reset(){return this.set(this.defaults())},set(t){this.validateState(t);for(const e in this.defaults())this[e]=t[e]??this.defaults()[e];return this.state()},state(){const t={};for(const e in this.defaults())t[e]=this[e]??this.defaults()[e];return t},validateState(t){if(!1===gt(t))throw new Error(`Invalid ${this.key()} state`);return!0}}),Xc=()=>{const t=Gc("activation",{isOpen:"true"!==sessionStorage.getItem("kirby$activation$card")});return Vue.reactive({...t,close(){sessionStorage.setItem("kirby$activation$card","true"),this.isOpen=!1},open(){sessionStorage.removeItem("kirby$activation$card"),this.isOpen=!0}})},Zc=t=>({async changeName(e,s,i){return t.patch(this.url(e,s,"name"),{name:i})},async delete(e,s){return t.delete(this.url(e,s))},async get(e,s,i){let n=await t.get(this.url(e,s),i);return!0===Array.isArray(n.content)&&(n.content={}),n},id:t=>!0===t.startsWith("/@/file/")?t.replace("/@/file/","@"):!0===t.startsWith("file://")?t.replace("file://","@"):t,link(t,e,s){return"/"+this.url(t,e,s)},async update(e,s,i){return t.patch(this.url(e,s),i)},url(t,e,s){let i="files/"+this.id(e);return t&&(i=t+"/"+i),s&&(i+="/"+s),i}}),Qc=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=>!0===t.startsWith("/@/page/")?t.replace("/@/page/","@"):!0===t.startsWith("page://")?t.replace("page://","@"):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}});class tu extends Error{constructor(t,{request:e,response:s,cause:i}){super(s.json.message??t,{cause:i}),this.request=e,this.response=s}state(){return this.response.json}}class eu extends tu{}class su extends tu{state(){return{message:this.message,text:this.response.text}}}const iu=t=>(window.location.href=_c(t),!1),nu=async(t,e={})=>{var s;(e={cache:"no-store",credentials:"same-origin",mode:"same-origin",...e}).body=((s=e.body)instanceof HTMLFormElement&&(s=new FormData(s)),s instanceof FormData&&(s=Object.fromEntries(s)),"object"==typeof s?JSON.stringify(s):s),e.headers=((t={},e={})=>{return{"content-type":"application/json","x-csrf":e.csrf??!1,"x-fiber":!0,"x-fiber-globals":(s=e.globals,!!s&&(!1===Array.isArray(s)?String(s):s.join(","))),"x-fiber-referrer":e.referrer??!1,...bt(t)};var s})(e.headers,e),e.url=vc(t,e.query);const i=new Request(e.url,e);return!1===xc(i.url)?iu(i.url):await ou(i,await fetch(i))},ou=async(t,e)=>{var s;if(!1===e.headers.get("Content-Type").includes("application/json"))return iu(e.url);try{e.text=await e.text(),e.json=JSON.parse(e.text)}catch(i){throw new su("Invalid JSON response",{cause:i,request:t,response:e})}if(401===e.status)throw new eu("Unauthenticated",{request:t,response:e});if("error"===(null==(s=e.json)?void 0:s.status))throw e.json;if(!1===e.ok)throw new tu(`The request to ${e.url} failed`,{request:t,response:e});return{request:t,response:e}},ru=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}}),au=t=>{const e={csrf:t.system.csrf,endpoint:dc(t.urls.api,"/"),methodOverwrite:!0,ping:null,requests:[],running:0},s=()=>{clearInterval(e.ping),e.ping=setInterval(e.auth.ping,3e5)};return e.request=async(i,n={},o=!1)=>{const r=i+"/"+JSON.stringify(n);e.requests.push(r),!1===o&&(t.isLoading=!0),e.language=t.language.code;try{return await(t=>async(e,s={})=>{s={cache:"no-store",credentials:"same-origin",mode:"same-origin",headers:{"content-type":"application/json","x-csrf":t.csrf,"x-language":t.language,...bt(s.headers??{})},...s},t.methodOverwrite&&"GET"!==s.method&&"POST"!==s.method&&(s.headers["x-http-method-override"]=s.method,s.method="POST");for(const t in s.headers)null===s.headers[t]&&delete s.headers[t];s.url=dc(t.endpoint,"/")+"/"+uc(e,"/");const i=new Request(s.url,s),{response:n}=await ou(i,await fetch(i));let o=n.json;return o.data&&"model"===o.type&&(o=o.data),o})(e)(i,n)}finally{s(),e.requests=e.requests.filter((t=>t!==r)),0===e.requests.length&&(t.isLoading=!1)}},e.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"),ping:async()=>t.post("auth/ping"),user:async e=>t.get("auth",e),verifyCode:async e=>t.post("auth/code",{code:e})}))(e),e.delete=(t=>async(e,s,i,n=!1)=>t.post(e,s,i,"DELETE",n))(e),e.files=Zc(e),e.get=(t=>async(e,s,i,n=!1)=>(s&&(e+="?"+Object.keys(s).filter((t=>void 0!==s[t]&&null!==s[t])).map((t=>t+"="+s[t])).join("&")),t.request(e,Object.assign(i??{},{method:"GET"}),n)))(e),e.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)}))(e),e.pages=Qc(e),e.patch=(t=>async(e,s,i,n=!1)=>t.post(e,s,i,"PATCH",n))(e),e.post=(t=>async(e,s,i,n="POST",o=!1)=>t.request(e,Object.assign(i??{},{method:n,body:JSON.stringify(s)}),o))(e),e.roles=(t=>({list:async e=>t.get("roles",e),get:async e=>t.get("roles/"+e)}))(e),e.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)}))(e),e.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)}))(e),e.translations=(t=>({list:async()=>t.get("translations"),get:async e=>t.get("translations/"+e)}))(e),e.users=ru(e),s(),e},lu=t=>Vue.reactive({get changes(){return t.app.$store.getters["content/changes"]()},discard(){t.app.$store.dispatch("content/revert")},get hasUnsavedChanges(){return!1},get hasUnpublishedChanges(){return t.app.$store.getters["content/hasChanges"]()},get isDraft(){return"draft"===t.view.props.model.status},isPublishing:!1,isSaving:!1,get isLocked(){var t;return"lock"===(null==(t=this.lock)?void 0:t.state)},get lock(){const e=t.view.props.lock;return!!e&&(null===e.state?null:{...e.data,state:e.state})},async publish(){this.isPublishing=!0,await t.app.$store.dispatch("content/save"),t.events.emit("model.update"),t.notification.success(),this.isPublishing=!1},get published(){return t.app.$store.getters["content/originals"]()},async save(){this.isSaving=!0,this.isSaving=!1},set(e){t.app.$store.dispatch("content/update",[null,e])},async unlock(){},get values(){return{...this.published,...this.changes}}}),cu=()=>({addEventListener(t,e){"function"==typeof e&&(this.on[t]=e)},addEventListeners(t){if(!1!==gt(t))for(const e in t)this.addEventListener(e,t[e])},emit(t,...e){return this.hasEventListener(t)?this.on[t](...e):()=>{}},hasEventListener(t){return"function"==typeof this.on[t]},listeners(){return this.on},on:{}}),uu=(t,e,s)=>{const i=Gc(e,s);return Vue.reactive({...i,...cu(),async load(e,s={}){return!0!==s.silent&&(this.isLoading=!0),await t.open(e,s),this.isLoading=!1,this.addEventListeners(s.on),this.state()},async open(t,e={}){return"function"==typeof e&&(e={on:{submit:e}}),!0===wc(t)?this.load(t,e):(this.set(t),this.addEventListeners(e.on),this.emit("open",t,e),this.state())},async post(e,s={}){var i;if(!this.path)throw new Error(`The ${this.key()} cannot be posted`);this.isLoading=!0,e=e??(null==(i=this.props)?void 0:i.value)??{};try{return await t.post(this.path,e,s)}catch(n){t.error(n)}finally{this.isLoading=!1}return!1},async refresh(e={}){e.url=e.url??this.url();const s=(await t.get(e.url,e))["$"+this.key()];if(s&&s.component===this.component)return this.props=s.props,this.state()},async reload(t={}){if(!this.path)return!1;this.open(this.url(),t)},set(t){return i.set.call(this,t),this.on={},this.addEventListeners(t.on??{}),this.state()},url(){return t.url(this.path,this.query)}})},pu=(t,e,s)=>{const i=uu(t,e,s);return Vue.reactive({...i,async cancel(){this.isOpen&&this.emit("cancel"),this.close()},async close(){!1!==this.isOpen&&(this.isOpen=!1,this.emit("close"),this.reset(),0===t.overlays().length&&(document.documentElement.removeAttribute("data-overlay"),document.documentElement.style.removeProperty("--scroll-top")))},focus(t){Jl(`.k-${this.key()}-portal`,t)},input(t){!1!==this.isOpen&&(Vue.set(this.props,"value",t),this.emit("input",t))},isOpen:!1,listeners(){return{...this.on,cancel:this.cancel.bind(this),close:this.close.bind(this),input:this.input.bind(this),submit:this.submit.bind(this),success:this.success.bind(this)}},async open(e,s){return!1===this.isOpen&&t.notification.close(),await i.open.call(this,e,s),this.component&&(document.documentElement.setAttribute("data-overlay","true"),document.documentElement.style.setProperty("--scroll-top",window.scrollY+"px"),this.isOpen=!0),this.state()},async submit(t,e={}){if(t=t??this.props.value,this.hasEventListener("submit"))return this.emit("submit",t,e);if(!this.path)return this.close();const s=await this.post(t,e);return!1===gt(s)?s:this.success(s["$"+this.key()]??{})},success(e){return this.hasEventListener("success")?this.emit("success",e):("string"==typeof e&&t.notification.success(e),this.close(),this.successNotification(e),this.successEvents(e),this.successDispatch(e),e.route||e.redirect?this.successRedirect(e):t.view.reload(e.reload),e)},successDispatch(e){if(!1!==gt(e.dispatch))for(const s in e.dispatch){const i=e.dispatch[s];t.app.$store.dispatch(s,!0===Array.isArray(i)?[...i]:i)}},successEvents(e){if(e.event){const s=Bl(e.event);for(const i of s)"string"==typeof i&&t.events.emit(i,e)}!1!==e.emit&&t.events.emit("success",e)},successNotification(e){e.message&&t.notification.success(e.message)},successRedirect(e){const s=e.route??e.redirect;return!!s&&("string"==typeof s?t.open(s):t.open(s.url,s.options))},get value(){var t;return null==(t=this.props)?void 0:t.value}})},du=t=>{t.events.on("dialog.save",(e=>{var s;null==(s=null==e?void 0:e.preventDefault)||s.call(e),t.dialog.submit()}));const e=pu(t,"dialog",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,legacy:!1,ref:null});return Vue.reactive({...e,async close(){this.ref&&(this.ref.visible=!1),e.close.call(this)},async open(t,s={}){return t instanceof window.Vue?this.openComponent(t):("string"==typeof t&&(t=`/dialogs/${t}`),e.open.call(this,t,s))},async openComponent(s){t.deprecated("Dialog components should no longer be used in your templates");const i=await e.open.call(this,{component:s.$options._componentTag,legacy:!0,props:{...s.$attrs,...s.$props},ref:s}),n=this.listeners();for(const t in n)s.$on(t,n[t]);return s.visible=!0,i}})},hu=()=>{const t=Gc("drag",{type:null,data:{}});return Vue.reactive({...t,get isDragging(){return null!==this.type},start(t,e){this.type=t,this.data=e},stop(){this.type=null,this.data={}}})},mu=()=>Vue.reactive({add(t){if(!t.id)throw new Error("The state needs an ID");!0!==this.has(t.id)&&this.milestones.push(t)},at(t){return this.milestones.at(t)},clear(){this.milestones=[]},get(t=null){return null===t?this.milestones:this.milestones.find((e=>e.id===t))},goto(t){const e=this.index(t);if(-1!==e)return this.milestones=this.milestones.slice(0,e+1),this.milestones[e]},has(t){return void 0!==this.get(t)},index(t){return this.milestones.findIndex((e=>e.id===t))},isEmpty(){return 0===this.milestones.length},last(){return this.milestones.at(-1)},milestones:[],remove(t=null){return null===t?this.removeLast():this.milestones=this.milestones.filter((e=>e.id!==t))},removeLast(){return this.milestones=this.milestones.slice(0,-1)},replace(t,e){-1===t&&(t=this.milestones.length-1),Vue.set(this.milestones,t,e)}}),fu=t=>{const e=pu(t,"drawer",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,id:null});return t.events.on("drawer.save",(e=>{e.preventDefault(),t.drawer.submit()})),Vue.reactive({...e,get breadcrumb(){return this.history.milestones},async close(t){if(!1!==this.isOpen&&(!0===t&&this.history.clear(),void 0===t||t===this.id)){if(this.history.removeLast(),!0!==this.history.isEmpty())return this.open(this.history.last());e.close.call(this)}},goTo(t){const e=this.history.goto(t);void 0!==e&&this.open(e)},history:mu(),get icon(){return this.props.icon??"box"},input(t){Vue.set(this.props,"value",t),this.emit("input",this.props.value)},listeners(){return{...this.on,cancel:this.cancel.bind(this),close:this.close.bind(this),crumb:this.goTo.bind(this),input:this.input.bind(this),submit:this.submit.bind(this),success:this.success.bind(this),tab:this.tab.bind(this)}},async open(t,s={}){"string"==typeof t&&(t=`/drawers/${t}`),await e.open.call(this,t,s),this.tab(t.tab);const i=this.state();return!0===t.replace?this.history.replace(-1,i):this.history.add(i),this.focus(),i},set(t){return e.set.call(this,t),this.id=this.id??fc(),this.state()},tab(t){const e=this.props.tabs??{};if(!(t=t??Object.keys(e??{})[0]))return!1;Vue.set(this.props,"fields",e[t].fields),Vue.set(this.props,"tab",t),this.emit("tab",t),setTimeout((()=>{this.focus()}))}})},gu=t=>{const e=uu(t,"dropdown",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null});return Vue.reactive({...e,close(){this.emit("close"),this.reset()},open(t,s={}){return"string"==typeof t&&(t=`/dropdowns/${t}`),e.open.call(this,t,s)},openAsync(t,e={}){return async s=>{await this.open(t,e);const i=this.options();if(0===i.length)throw Error("The dropdown is empty");s(i)}},options(){return!1===Array.isArray(this.props.options)?[]:this.props.options.map((e=>e.dialog?(e.click=()=>{const s="string"==typeof e.dialog?e.dialog:e.dialog.url,i="object"==typeof e.dialog?e.dialog:{};return t.app.$dialog(s,i)},e):e))},set(t){return t.options&&(t.props={options:t.options}),e.set.call(this,t)}})},ku=t=>{const e=P();e.on("online",(()=>{t.isOffline=!1})),e.on("offline",(()=>{t.isOffline=!0})),e.on("keydown.cmd.s",(s=>{e.emit(t.context+".save",s)})),e.on("keydown.cmd.shift.f",(()=>t.search())),e.on("keydown.cmd./",(()=>t.search()));const s={document:{blur:!0,click:!1,copy:!0,focus:!0,paste:!0},window:{dragenter:!1,dragexit:!1,dragleave:!1,dragover:!1,drop:!1,keydown:!1,keyup:!1,offline:!1,online:!1,popstate:!1}};return{blur(t){this.emit("blur",t)},click(t){this.emit("click",t)},copy(t){this.emit("copy",t)},dragenter(t){this.entered=t.target,this.prevent(t),this.emit("dragenter",t)},dragexit(t){this.prevent(t),this.entered=null,this.emit("dragexit",t)},dragleave(t){this.prevent(t),this.entered===t.target&&(this.entered=null,this.emit("dragleave",t))},dragover(t){this.prevent(t),this.emit("dragover",t)},drop(t){this.prevent(t),this.entered=null,this.emit("drop",t)},emit:e.emit,entered:null,focus(t){this.emit("focus",t)},keychain(t,e){let s=[t];(e.metaKey||e.ctrlKey)&&s.push("cmd"),!0===e.altKey&&s.push("alt"),!0===e.shiftKey&&s.push("shift");let i=e.key?cc(e.key):null;const n={escape:"esc",arrowUp:"up",arrowDown:"down",arrowLeft:"left",arrowRight:"right"};return n[i]&&(i=n[i]),i&&!1===["alt","control","shift","meta"].includes(i)&&s.push(i),s.join(".")},keydown(t){this.emit(this.keychain("keydown",t),t),this.emit("keydown",t)},keyup(t){this.emit(this.keychain("keyup",t),t),this.emit("keyup",t)},off:e.off,offline(t){this.emit("offline",t)},on:e.on,online(t){this.emit("online",t)},paste(t){this.emit("paste",t)},popstate(t){this.emit("popstate",t)},prevent(t){t.stopPropagation(),t.preventDefault()},subscribe(){for(const t in s.document)document.addEventListener(t,this[t].bind(this),s.document[t]);for(const t in s.window)window.addEventListener(t,this[t].bind(this),s.window[t])},unsubscribe(){for(const t in s.document)document.removeEventListener(t,this[t]);for(const t in s.window)window.removeEventListener(t,this[t])}}},bu={interval:null,start(t,e){this.stop(),t&&(this.interval=setInterval(e,t))},stop(){clearInterval(this.interval),this.interval=null}},yu=(t={})=>{const e=Gc("notification",{context:null,details:null,icon:null,isOpen:!1,message:null,theme:null,timeout:null,type:null});return Vue.reactive({...e,close(){return this.timer.stop(),this.reset(),this.state()},deprecated(t){console.warn("Deprecated: "+t)},error(e){if(e instanceof eu&&t.user.id)return t.redirect("logout");if(e instanceof su)return this.fatal(e);if(e instanceof tu){const t=Object.values(e.response.json).find((t=>"string"==typeof(null==t?void 0:t.error)));t&&(e.message=t.error)}return"string"==typeof e&&(e={message:e}),e={message:e.message??"Something went wrong",details:e.details??{}},"view"===t.context&&t.dialog.open({component:"k-error-dialog",props:e}),this.open({message:e.message,icon:"alert",theme:"negative",type:"error"})},info(t={}){return"string"==typeof t&&(t={message:t}),this.open({icon:"info",theme:"info",...t})},get isFatal(){return"fatal"===this.type},fatal(t){return"string"==typeof t?this.open({message:t,type:"fatal"}):t instanceof su?this.open({message:t.response.text,type:"fatal"}):this.open({message:t.message??"Something went wrong",type:"fatal"})},open(e){return this.timer.stop(),"string"==typeof e?this.success(e):("error"!==e.type&&"fatal"!==e.type&&(e.timeout??(e.timeout=4e3)),this.set({context:t.context,...e}),this.isOpen=!0,this.timer.start(this.timeout,(()=>this.close())),this.state())},success(t={}){return"string"==typeof t&&(t={message:t}),this.open({icon:"check",theme:"positive",...t})},timer:bu})},vu=()=>{const t=Gc("language",{code:null,default:!1,direction:"ltr",name:null,rules:null});return Vue.reactive({...t,get isDefault(){return this.default}})},$u=(t,e,s)=>{if(!s.template&&!s.render&&!s.extends)throw new Error(`Neither template nor render method provided. Nor extending a component when loading plugin component "${e}". The component has not been registered.`);return(s=xu(t,e,s)).template&&(s.render=null),s=wu(s),!0===Xl(e)&&window.console.warn(`Plugin is replacing "${e}"`),t.component(e,s),s},xu=(t,e,s)=>"string"!=typeof(null==s?void 0:s.extends)?s:!1===Xl(s.extends)?(window.console.warn(`Problem with plugin trying to register component "${e}": cannot extend non-existent component "${s.extends}"`),s.extends=null,s):(s.extends=t.options.components[s.extends].extend({options:s,components:{...t.options.components,...s.components??{}}}),s),wu=t=>{if(!1===Array.isArray(t.mixins))return t;const e={dialog:Dt,drawer:de,section:ma};return t.mixins=t.mixins.map((t=>"string"==typeof t?e[t]:t)),t},_u=(t,e={})=>((e={components:{},created:[],icons:{},login:null,textareaButtons:{},thirdParty:{},use:[],viewButtons:{},writerMarks:{},writerNodes:{},...e}).use=((t,e)=>{if(!1===Array.isArray(e))return[];for(const s of e)t.use(s);return e})(t,e.use),e.components=((t,e)=>{if(!1===gt(e))return;const s={};for(const[n,o]of Object.entries(e))try{s[n]=$u(t,n,o)}catch(i){window.console.warn(i.message)}return s})(t,e.components),e),Su=t=>{var e;const s=Gc("menu",{entries:[],hover:!1,isOpen:!1}),i=null==(e=window.matchMedia)?void 0:e.call(window,"(max-width: 60rem)"),n=Vue.reactive({...s,blur(t){const e=document.querySelector(".k-panel-menu");if(!e||!1===i.matches)return!1;!1===document.querySelector(".k-panel-menu-proxy").contains(t.target)&&!1===e.contains(t.target)&&this.close()},close(){this.isOpen=!1,!1===i.matches&&localStorage.setItem("kirby$menu",!0)},escape(){if(!1===i.matches)return!1;this.close()},open(){this.isOpen=!0,!1===i.matches&&localStorage.removeItem("kirby$menu")},resize(){if(i.matches)return this.close();null!==localStorage.getItem("kirby$menu")?this.isOpen=!1:this.isOpen=!0},set(t){return this.entries=t,this.resize(),this.state()},toggle(){this.isOpen?this.close():this.open()}});return t.events.on("keydown.esc",n.escape.bind(n)),t.events.on("click",n.blur.bind(n)),null==i||i.addEventListener("change",n.resize.bind(n)),n},Cu=t=>({controller:null,requests:0,get isLoading(){return this.requests>0},open(e){t.menu.escape(),t.dialog.open({component:"k-search-dialog",props:{type:e}})},async query(e,s,i){var n;if(null==(n=this.controller)||n.abort(),this.controller=new AbortController,s.length<2)return{results:null,pagination:{}};this.requests++;try{const{$search:n}=await t.get(`/search/${e}`,{query:{query:s,...i},signal:this.controller.signal});return n}catch(o){if("AbortError"!==o.name)return{results:[],pagination:{}}}finally{this.requests--}}}),Ou=()=>{const t=Gc("theme",{setting:localStorage.getItem("kirby$theme")});return Vue.reactive({...t,get current(){return this.setting??this.system},reset(){this.setting=null,localStorage.removeItem("kirby$theme")},set(t){this.setting=t,localStorage.setItem("kirby$theme",t)},get system(){var t;return(null==(t=window.matchMedia)?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light"}})},Au=()=>{const t=Gc("translation",{code:null,data:{},direction:"ltr",name:null,weekday:1});return Vue.reactive({...t,set(e){return t.set.call(this,e),document.documentElement.lang=this.code,document.body.dir=this.direction,this.state()},translate(t,e,s=null){if("string"!=typeof t)return;const i=this.data[t]??s;return"string"!=typeof i?i:hc(i,e)}})};const Mu=t=>{const e=Gc("upload",{abort:null,accept:"*",attributes:{},files:[],max:null,multiple:!0,preview:{},replacing:null,url:null});return Vue.reactive({...e,...cu(),input:null,cancel(){var e;this.emit("cancel"),null==(e=this.abort)||e.abort(),this.completed.length>0&&(this.emit("complete",this.completed),t.view.reload()),this.reset()},get completed(){return this.files.filter((t=>t.completed)).map((t=>t.model))},done(){t.dialog.close(),this.completed.length>0&&(this.emit("done",this.completed),!1===t.drawer.isOpen&&(t.notification.success({context:"view"}),t.view.reload())),this.reset()},findDuplicate(t){return this.files.findLastIndex((e=>e.src.name===t.src.name&&e.src.type===t.src.type&&e.src.size===t.src.size&&e.src.lastModified===t.src.lastModified))},hasUniqueName(t){return this.files.filter((e=>e.name===t.name&&e.extension===t.extension)).length<2},file(t){const e=URL.createObjectURL(t);return{...this.preview,completed:!1,error:null,extension:Hl(t.name),filename:t.name,id:fc(),model:null,name:Ul(t.name),niceSize:Kl(t.size),progress:0,size:t.size,src:t,type:t.type,url:e}},open(e,s){e instanceof FileList?(this.set(s),this.select(e)):this.set(e);const i={component:"k-upload-dialog",props:{preview:this.preview},on:{open:t=>this.emit("open",t),cancel:()=>this.cancel(),submit:async()=>{t.dialog.isLoading=!0,await this.submit(),t.dialog.isLoading=!1}}};this.replacing&&(i.component="k-upload-replace-dialog",i.props.original=this.replacing),t.dialog.open(i)},pick(t){this.set(t),this.input=document.createElement("input"),this.input.type="file",this.input.classList.add("sr-only"),this.input.value=null,this.input.accept=this.accept,this.input.multiple=this.multiple,this.input.click(),this.input.addEventListener("change",(e=>{!0===(null==t?void 0:t.immediate)?(this.set(t),this.select(e.target.files),this.submit()):this.open(e.target.files,t),this.input.remove()}))},remove(t){this.files=this.files.filter((e=>e.id!==t))},replace(e,s){this.pick({...s,url:t.urls.api+"/"+e.link,accept:"."+e.extension+","+e.mime,multiple:!1,replacing:e})},reset(){e.reset.call(this),this.files.splice(0)},select(t,e){if(this.set(e),t instanceof Event&&(t=t.target.files),t instanceof FileList==!1)throw new Error("Please provide a FileList");t=(t=[...t]).map((t=>this.file(t))),this.files=[...this.files,...t],this.files=this.files.filter(((t,e)=>this.findDuplicate(t)===e)),null!==this.max&&(this.files=this.files.slice(-1*this.max)),this.emit("select",this.files)},set(t){if(t)return e.set.call(this,t),this.on={},this.addEventListeners(t.on??{}),1===this.max&&(this.multiple=!1),!1===this.multiple&&(this.max=1),this.state()},async submit(){var e;if(!this.url)throw new Error("The upload URL is missing");this.abort=new AbortController;const s=[];for(const i of this.files){if(!0===i.completed)continue;if(!1===this.hasUniqueName(i)){i.error=t.t("error.file.name.unique");continue}i.error=null,i.progress=0;const n={...this.attributes};s.push((async()=>await this.upload(i,n)));const o=null==(e=this.attributes)?void 0:e.sort;null!=o&&this.attributes.sort++}if(await async function(t,e=20){let s=0,i=0;return new Promise((n=>{const o=e=>i=>{t[e]=i,s--,r()},r=()=>{if(s1?t.slice(i,l,t.type):t;n>1&&(e.headers={...e.headers,"Upload-Length":t.size,"Upload-Offset":i,"Upload-Id":o}),r=await kc(c,{...e,progress:(s,n,o)=>{const r=n.size*(o/100),a=(i+r)/t.size;e.progress(s,t,Math.round(100*a))}})}return r}(e.src,{abort:this.abort.signal,attributes:s,filename:e.name+"."+e.extension,headers:{"x-csrf":t.system.csrf},url:this.url,progress:(t,s,i)=>{e.progress=i}},t.config.upload);e.completed=!0,e.model=i.data}catch(i){t.error(i,!1),e.error=i.message,e.progress=0}}})},Du=t=>{const e=uu(t,"view",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,breadcrumb:[],breadcrumbLabel:null,icon:null,id:null,link:null,search:"pages",title:null});return Vue.reactive({...e,set(s){e.set.call(this,s),t.title=this.title;const i=this.url().toString();window.location.toString()!==i&&(window.history.pushState(null,null,i),window.scrollTo(0,0))},async submit(){throw new Error("Not yet implemented")}})},ju={config:{},languages:[],license:"missing",multilang:!1,permissions:{},searches:{},urls:{}},Eu=["dialog","drawer"],Tu=["dropdown","language","menu","notification","system","translation","user"],Iu={create(t={}){return this.isLoading=!1,this.isOffline=!1,this.activation=Xc(),this.content=lu(this),this.drag=hu(),this.events=ku(this),this.searcher=Cu(this),this.theme=Ou(),this.upload=Mu(this),this.language=vu(),this.menu=Su(this),this.notification=yu(this),this.system=Gc("system",{ascii:{},csrf:null,isLocal:null,locales:{},slugs:[],title:null}),this.translation=Au(),this.user=Gc("user",{email:null,id:null,language:null,role:null,username:null}),this.dropdown=gu(this),this.view=Du(this),this.drawer=fu(this),this.dialog=du(this),this.redirect=iu,this.reload=this.view.reload.bind(this.view),this.t=this.translation.translate.bind(this.translation),this.plugins=_u(window.Vue,t),this.set(window.fiber),this.api=au(this),Vue.reactive(this)},get context(){return this.dialog.isOpen?"dialog":this.drawer.isOpen?"drawer":"view"},get debug(){return!0===this.config.debug},deprecated(t){this.notification.deprecated(t)},get direction(){return this.translation.direction},error(t,e=!0){if(!0===this.debug&&console.error(t),!0===e)return this.notification.error(t)},async get(t,e={}){const{response:s}=await this.request(t,{method:"GET",...e});return(null==s?void 0:s.json)??{}},async open(t,e={}){try{if(!1===wc(t))this.set(t);else{this.isLoading=!0;const s=await this.get(t,e);this.set(s),this.isLoading=!1}return this.state()}catch(s){return this.error(s)}},overlays(){const t=[];return!0===this.drawer.isOpen&&t.push("drawer"),!0===this.dialog.isOpen&&t.push("dialog"),t},async post(t,e={},s={}){const{response:i}=await this.request(t,{method:"POST",body:e,...s});return i.json},async request(t,e={}){return nu(t,{referrer:this.view.path,csrf:this.system.csrf,...e})},async search(t,e,s){return void 0===e?this.searcher.open(t):this.searcher.query(t,e,s)},set(t={}){t=Object.fromEntries(Object.entries(t).map((([t,e])=>[t.replace("$",""),e])));for(const e in ju){const s=t[e]??this[e]??ju[e];typeof s==typeof ju[e]&&(this[e]=s)}for(const e of Tu)(gt(t[e])||Array.isArray(t[e]))&&this[e].set(t[e]);for(const e of Eu)if(!0===gt(t[e])){if(t[e].redirect)return this.open(t[e].redirect);this[e].open(t[e])}else void 0!==t[e]&&this[e].close(!0);!0===gt(t.dropdown)?this.dropdown.open(t.dropdown):void 0!==t.dropdown&&this.dropdown.close(),!0===gt(t.view)&&this.view.open(t.view)},state(){const t={};for(const e in ju)t[e]=this[e]??ju[e];for(const e of Tu)t[e]=this[e].state();for(const e of Eu)t[e]=this[e].state();return t.dropdown=this.dropdown.state(),t.view=this.view.state(),t},get title(){return document.title},set title(t){!1===lc(this.system.title)&&(t+=" | "+this.system.title),document.title=t},url:(t="",e={},s)=>vc(t,e,s)},Lu=(t,e)=>{localStorage.setItem("kirby$content$"+t,JSON.stringify(e))},Bu={namespaced:!0,state:{current:null,models:{},status:{enabled:!0}},getters:{exists:t=>e=>Object.hasOwn(t.models,e),hasChanges:(t,e)=>t=>kt(e.model(t).changes)>0,isCurrent:t=>e=>t.current===e,id:t=>e=>((e=e??t.current)&&!1===e.includes("?language=")&&(e+="?language="+window.panel.language.code),e),model:(t,e)=>s=>(s=e.id(s),!0===e.exists(s)?t.models[s]:{api:null,originals:{},values:{},changes:{}}),originals:(t,e)=>t=>ft(e.model(t).originals),values:(t,e)=>t=>({...e.originals(t),...e.changes(t)}),changes:(t,e)=>t=>ft(e.model(t).changes)},mutations:{CLEAR(t){for(const e in t.models)t.models[e].changes={};for(const e in localStorage)e.startsWith("kirby$content$")&&localStorage.removeItem(e)},CREATE(t,[e,s]){if(!s)return!1;let i=t.models[e]?t.models[e].changes:s.changes;Vue.set(t.models,e,{api:s.api,originals:s.originals,changes:i??{}})},CURRENT(t,e){t.current=e},MOVE(t,[e,s]){const i=ft(t.models[e]);Vue.del(t.models,e),Vue.set(t.models,s,i);const n=localStorage.getItem("kirby$content$"+e);localStorage.removeItem("kirby$content$"+e),localStorage.setItem("kirby$content$"+s,n)},REMOVE(t,e){Vue.del(t.models,e),localStorage.removeItem("kirby$content$"+e)},REVERT(t,e){t.models[e]&&(Vue.set(t.models[e],"changes",{}),localStorage.removeItem("kirby$content$"+e))},STATUS(t,e){Vue.set(t.status,"enabled",e)},UPDATE(t,[e,s,i]){if(!t.models[e])return!1;void 0===i&&(i=null),i=ft(i);const n=JSON.stringify(i);JSON.stringify(t.models[e].originals[s]??null)==n?Vue.del(t.models[e].changes,s):Vue.set(t.models[e].changes,s,i),Lu(e,{api:t.models[e].api,originals:t.models[e].originals,changes:t.models[e].changes})}},actions:{init(t){for(const e in localStorage)if(e.startsWith("kirby$content$")){const s=e.split("kirby$content$")[1],i=localStorage.getItem("kirby$content$"+s);t.commit("CREATE",[s,JSON.parse(i)])}else if(e.startsWith("kirby$form$")){const s=e.split("kirby$form$")[1],i=localStorage.getItem("kirby$form$"+s);let n=null;try{n=JSON.parse(i)}catch{}if(!n||!n.api)return localStorage.removeItem("kirby$form$"+s),!1;const o={api:n.api,originals:n.originals,changes:n.values};t.commit("CREATE",[s,o]),Lu(s,o),localStorage.removeItem("kirby$form$"+s)}},clear(t){t.commit("CLEAR")},create(t,e){const s=ft(e.content);if(Array.isArray(e.ignore))for(const n of e.ignore)delete s[n];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){e=t.getters.id(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){e=t.getters.id(e),t.commit("REMOVE",e),t.getters.isCurrent(e)&&t.commit("CURRENT",null)},revert(t,e){e=t.getters.id(e),t.commit("REVERT",e)},async save(t,e){if(e=t.getters.id(e),t.getters.isCurrent(e)&&!1===t.state.status.enabled)return!1;t.dispatch("disable");const s=t.getters.model(e),i={...s.originals,...s.changes};try{await window.panel.api.patch(s.api,i),t.commit("CREATE",[e,{...s,originals:i}]),t.dispatch("revert",e)}finally{t.dispatch("enable")}},update(t,[e,s,i]){if(i=i??t.state.current,null===e)for(const n in s)t.commit("UPDATE",[i,n,s[n]]);else t.commit("UPDATE",[i,e,s])}}};Vue.use(N);const qu=new N.Store({strict:!1,modules:{content:Bu}});Vue.config.productionTip=!1,Vue.config.devtools=!0,Vue.use(Oc),Vue.use(Jc),Vue.use(Tl),window.panel=Vue.prototype.$panel=Iu.create(window.panel.plugins),window.panel.app=new Vue({store:qu,render:()=>Vue.h(F)}),Vue.use(Ac),Vue.use(Il),Vue.use(Mc),window.panel.app.$mount("#app");export{ot as n}; +var t=Object.defineProperty;import{I as e,P as s,S as i,F as n,N as o,s as r,l as a,w as l,a as c,b as u,c as p,e as d,t as h,d as m,f,g,h as k,i as b,k as y,D as v,j as $,E as w,m as x,n as _,o as S,T as C,u as O,p as M,q as A,r as D,v as j,x as E,y as T,z as L,A as B,B as I,C as q,G as P}from"./vendor.min.js";const N={created(){this.$panel.events.subscribe();for(const t of this.$panel.plugins.created)t(this);this.$panel.events.on("popstate",(()=>{this.$panel.open(window.location.href)})),this.$panel.events.on("drop",(()=>{this.$panel.drag.stop()}))},destroyed(){this.$panel.events.unsubscribe()},render(t){if(this.$panel.view.component)return t(this.$panel.view.component,{key:this.$panel.view.component,props:this.$panel.view.props})}},F={props:{after:String}},z={props:{autocomplete:String}},Y={props:{autofocus:Boolean}},R={props:{before:String}},H={props:{disabled:Boolean}},V={props:{font:String}},U={props:{help:String}},K={props:{id:{type:[Number,String],default(){return this._uid}}}},W={props:{label:String}},J={props:{layout:{type:String,default:"list"}}},G={props:{maxlength:Number}},X={props:{minlength:Number}},Z={props:{name:[Number,String]}},Q={props:{options:{default:()=>[],type:Array}}},tt={props:{pattern:String}},et={props:{placeholder:[Number,String]}},st={props:{required:Boolean}},it={props:{spellcheck:{type:Boolean,default:!0}}};function nt(t,e,s,i,n,o,r,a){var l="function"==typeof t?t.options:t;return e&&(l.render=e,l.staticRenderFns=s,l._compiled=!0),{exports:t,options:l}}const ot={mixins:[J],inheritAttrs:!1,props:{columns:{type:[Object,Array],default:()=>({})},fields:{type:Object,default:()=>({})},items:{type:Array,default:()=>[]},link:{type:Boolean,default:!0},sortable:Boolean,size:{type:String,default:"medium"},theme:String}};const rt=nt({mixins:[ot],props:{image:{type:[Object,Boolean],default:()=>({})}},emits:["change","hover","item","option","sort"],computed:{dragOptions(){return{sort:this.sortable,disabled:!1===this.sortable,draggable:".k-draggable-item"}},table(){return{columns:this.columns,fields:this.fields,rows:this.items,sortable:this.sortable}}},methods:{onDragStart(t,e){this.$panel.drag.start("text",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({class:t.$attrs.class,style:t.$attrs.style,on:{change:function(e){return t.$emit("change",e)},sort:function(e){return t.$emit("sort",e)},option:t.onOption},scopedSlots:t._u([t.$scopedSlots.options?{key:"options",fn:function({row:e,rowIndex:s}){return[t._t("options",null,null,{item:e,index:s})]}}:null],null,!0)},"k-table",t.table,!1)):e("k-draggable",{class:["k-items","k-"+t.layout+"-items",t.$attrs.class],style:t.$attrs.style,attrs:{"data-layout":t.layout,"data-size":t.size,handle:!0,list:t.items,options:t.dragOptions},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[t._t("default",(function(){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,theme:t.theme,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,index:i})]},proxy:!0}],null,!0)},"k-item",s,!1))]}),null,{item:s,itemIndex:i})]}))],2)}),[]).exports;const at=nt({mixins:[ot],props:{empty:{type:Object,default:()=>({})},help:String,pagination:{type:[Boolean,Object],default:!1}},emits:["action","change","empty","item","option","paginate","sort"],computed:{hasPagination(){return!1!==this.pagination&&(!0!==this.paginationOptions.hide&&!(this.pagination.total<=this.pagination.limit))},listeners(){return this.$listeners.empty?{click:this.onEmpty}:{}},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"},[0===t.items.length?e("k-empty",t._g(t._b({attrs:{layout:t.layout}},"k-empty",t.empty,!1),t.listeners)):e("k-items",t._b({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,index:s}){return[t._t("options",null,null,{item:e,index:s})]}}],null,!0)},"k-items",{columns:t.columns,fields:t.fields,items:t.items,layout:t.layout,link:t.link,size:t.size,sortable:t.sortable,theme:t.theme},!1)),t.help||t.hasPagination?e("footer",{staticClass:"k-collection-footer"},[e("k-text",{staticClass:"k-help k-collection-help",attrs:{html:t.help}}),t.hasPagination?e("k-pagination",t._b({on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.paginationOptions,!1)):t._e()],1):t._e()],1)}),[]).exports;const lt=nt({mixins:[J],props:{text:String,icon:String},emits:["click"],computed:{attrs(){const t={button:void 0!==this.$listeners.click,icon:this.icon,theme:"empty"};return"cardlets"!==this.layout&&"cards"!==this.layout||(t.align="center",t.height="var(--item-height-cardlet)"),t}}},(function(){var t=this;return(0,t._self._c)("k-box",t._b({staticClass:"k-empty",nativeOn:{click:function(e){return t.$emit("click",e)}}},"k-box",t.attrs,!1),[t._t("default",(function(){return[t._v(" "+t._s(t.text)+" ")]}))],2)}),[]).exports,ct={mixins:[J],props:{image:[Object,Boolean],width:{type:String,default:"1/1"}}};const ut=nt({mixins:[ct],inheritAttrs:!1,computed:{attrs(){return{back:this.image.back??"gray-500",cover:!0,...this.image,ratio:"list"===this.layout?"auto":this.image.ratio,size:this.sizes}},component(){return this.image.src?"k-image-frame":"k-icon-frame"},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;return(0,t._self._c)(t.component,t._b({tag:"component",class:["k-item-image",t.$attrs.class],style:t.$attrs.style},"component",t.attrs,!1))}),[]).exports;const pt=nt({mixins:[ct,J],inheritAttrs:!1,props:{buttons:{type:Array,default:()=>[]},data:Object,info:String,link:{type:[Boolean,String,Function]},options:{type:[Array,Function,String]},sortable:Boolean,target:String,text:String,theme:String},emits:["action","click","drag","option"],computed:{hasFigure(){return!1!==this.image&&this.$helper.object.length(this.image)>0}},methods:{onOption(t){this.$emit("action",t),this.$emit("option",t)},title(t){return this.$helper.string.stripHTML(this.$helper.string.unescapeHTML(t)).trim()}}},(function(){var t,e,s=this,i=s._self._c;return i("div",s._b({class:["k-item",`k-${s.layout}-item`,s.$attrs.class],style:s.$attrs.style,attrs:{"data-has-image":s.hasFigure,"data-layout":s.layout,"data-theme":s.theme},on:{click:function(t){return s.$emit("click",t)},dragstart:function(t){return s.$emit("drag",t)}}},"div",s.data,!1),[s._t("image",(function(){return[s.hasFigure?i("k-item-image",{attrs:{image:s.image,layout:s.layout,width:s.width}}):s._e()]})),s.sortable?i("k-sort-handle",{staticClass:"k-item-sort-handle",attrs:{tabindex:"-1"}}):s._e(),i("div",{staticClass:"k-item-content"},[i("h3",{staticClass:"k-item-title",attrs:{title:s.title(s.text)}},[!1!==s.link?i("k-link",{attrs:{target:s.target,to:s.link}},[i("span",{domProps:{innerHTML:s._s(s.text??"–")}})]):i("span",{domProps:{innerHTML:s._s(s.text??"–")}})],1),s.info?i("p",{staticClass:"k-item-info",attrs:{title:s.title(s.info)},domProps:{innerHTML:s._s(s.info)}}):s._e()]),(null==(t=s.buttons)?void 0:t.length)||s.options||s.$slots.options?i("div",{staticClass:"k-item-options",attrs:{"data-only-option":!(null==(e=s.buttons)?void 0:e.length)||!s.options&&!s.$slots.options}},[s._l(s.buttons,(function(t,e){return i("k-button",s._b({key:"button-"+e},"k-button",t,!1))})),s._t("options",(function(){return[s.options?i("k-options-dropdown",{staticClass:"k-item-options-dropdown",attrs:{options:s.options},on:{option:s.onOption}}):s._e()]}))],2):s._e()],2)}),[]).exports,dt={install(t){t.component("k-collection",at),t.component("k-empty",lt),t.component("k-item",pt),t.component("k-item-image",ut),t.component("k-items",rt)}};const ht=nt({},(function(){return(0,this._self._c)("div",{staticClass:"k-dialog-body"},[this._t("default")],2)}),[]).exports;function mt(t){if(void 0!==t)return structuredClone(t)}function ft(t){return"object"==typeof t&&(null==t?void 0:t.constructor)===Object}function gt(t){return Object.keys(t??{}).length}function kt(t){return Object.keys(t).reduce(((e,s)=>(e[s.toLowerCase()]=t[s],e)),{})}const bt={clone:mt,isEmpty:function(t){return null==t||""===t||(!(!ft(t)||0!==gt(t))||0===t.length)},isObject:ft,length:gt,merge:function t(e,s={}){for(const i in s)s[i]instanceof Object&&Object.assign(s[i],t(e[i]??{},s[i]));return Object.assign(e??{},s),e},same:function(t,e){return JSON.stringify(t)===JSON.stringify(e)},toLowerKeys:kt},yt={props:{cancelButton:{default:!0,type:[Boolean,String,Object]},disabled:{default:!1,type:Boolean},icon:{default:"check",type:String},submitButton:{type:[Boolean,String,Object],default:!0},theme:{default:"positive",type:String}}};const vt=nt({mixins:[yt],emits:["cancel"],computed:{cancel(){return this.button(this.cancelButton,{click:()=>this.$emit("cancel"),class:"k-dialog-button-cancel",icon:"cancel",text:this.$t("cancel"),variant:"filled"})},submit(){return this.button(this.submitButton,{class:"k-dialog-button-submit",disabled:this.disabled||this.$panel.dialog.isLoading,icon:this.icon,text:this.$t("confirm"),theme:this.theme,type:"submit",variant:"filled"})}},methods:{button:(t,e)=>"string"==typeof t?{...e,text:t}:!1!==t&&(!1===ft(t)?e:{...e,...t})}},(function(){var t=this,e=t._self._c;return e("k-button-group",{staticClass:"k-dialog-buttons"},[t.cancel?e("k-button",t._b({},"k-button",t.cancel,!1)):t._e(),t.submit?e("k-button",t._b({attrs:{icon:t.$panel.dialog.isLoading?"loader":t.submit.icon}},"k-button",t.submit,!1)):t._e()],1)}),[]).exports,$t={props:{empty:{default:()=>window.panel.$t("dialog.fields.empty"),type:String},fields:{default:()=>[],type:[Array,Object]},value:{default:()=>({}),type:Object}}};const wt=nt({mixins:[$t],emits:["input","submit"],computed:{hasFields(){return this.$helper.object.length(this.fields)>0}}},(function(){var t=this,e=t._self._c;return t.hasFields?e("k-fieldset",{staticClass:"k-dialog-fields",attrs:{fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[]).exports;const xt=nt({},(function(){return(0,this._self._c)("footer",{staticClass:"k-dialog-footer"},[this._t("default")],2)}),[]).exports;const _t=nt({},(function(){var t=this,e=t._self._c;return"dialog"===t.$panel.notification.context?e("k-notification",{staticClass:"k-dialog-notification"}):t._e()}),[]).exports;const St=nt({props:{autofocus:{default:!0,type:Boolean},placeholder:{type:String},value:{type:String}},emits:["search"]},(function(){var t=this;return(0,t._self._c)("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:t.autofocus,placeholder:t.placeholder,value:t.value,icon:"search",type:"search"},on:{input:function(e){return t.$emit("search",e)}}})}),[]).exports,Ct={props:{empty:{type:String,default:()=>window.panel.$t("dialog.text.empty")},text:{type:String}}};const Ot=nt({mixins:[Ct]},(function(){var t=this,e=t._self._c;return t.text?e("k-text",{attrs:{html:t.text}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[]).exports,Mt={install(t){t.component("k-dialog-body",ht),t.component("k-dialog-buttons",vt),t.component("k-dialog-fields",wt),t.component("k-dialog-footer",xt),t.component("k-dialog-notification",_t),t.component("k-dialog-search",St),t.component("k-dialog-text",Ot)}},At={mixins:[yt],props:{size:{default:"default",type:String},visible:{default:!1,type:Boolean}},emits:["cancel","close","input","submit","success"],methods:{cancel(){this.$emit("cancel")},close(){this.$emit("close")},error(t){this.$panel.notification.error(t)},focus(t){this.$panel.dialog.focus(t)},input(t){this.$emit("input",t)},open(){this.$panel.dialog.open(this)},submit(){this.$emit("submit",this.value)},success(t){this.$emit("success",t)}}};const Dt=nt({mixins:[At]},(function(){var t=this,e=t._self._c;return t.visible?e("portal",{attrs:{to:"dialog"}},[e("form",{class:["k-dialog",t.$vnode.data.class,t.$vnode.data.staticClass,t.$attrs.class],attrs:{"data-has-footer":t.cancelButton||t.submitButton,"data-size":t.size,method:"dialog"},on:{click:function(t){t.stopPropagation()},submit:function(e){return e.preventDefault(),t.$emit("submit")}}},[t._t("header",(function(){return[e("k-dialog-notification")]})),t.$slots.default?e("k-dialog-body",[t._t("default")],2):t._e(),t._t("footer",(function(){return[t.cancelButton||t.submitButton?e("k-dialog-footer",[e("k-dialog-buttons",{attrs:{"cancel-button":t.cancelButton,disabled:t.disabled,icon:t.icon,"submit-button":t.submitButton,theme:t.theme},on:{cancel:function(e){return t.$emit("cancel")}}})],1):t._e()]}))],2)]):t._e()}),[]).exports;const jt=nt({mixins:[At],props:{cancelButton:{default:!1},files:{type:Array,default:()=>[]},pages:{type:Array,default:()=>[]},size:{default:"medium"},submitButton:{default:!1},users:{type:Array,default:()=>[]}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({staticClass:"k-changes-dialog"},"k-dialog",t.$props,!1),[t.pages.length?e("section",[e("k-headline",[t._v(t._s(t.$t("lock.unsaved.pages")))]),e("k-items",{attrs:{items:t.pages,layout:"list"}})],1):t._e(),t.files.length?e("section",[e("k-headline",[t._v(t._s(t.$t("lock.unsaved.files")))]),e("k-items",{attrs:{items:t.files,layout:"list"}})],1):t._e(),t.users.length?e("section",[e("k-headline",[t._v(t._s(t.$t("lock.unsaved.users")))]),e("k-items",{attrs:{items:t.users,layout:"list"}})],1):t._e(),t.pages.length||t.files.length||t.users.length?t._e():e("section",[e("k-headline",[t._v(t._s(t.$t("lock.unsaved")))]),e("k-empty",{attrs:{icon:"edit-line"}},[t._v(t._s(t.$t("lock.unsaved.empty")))])],1)])}),[]).exports;const Et=nt({mixins:[At,$t],props:{fields:{default:()=>({href:{label:window.panel.$t("email"),type:"email",icon:"email"},title:{label:window.panel.$t("title"),type:"text",icon:"title"}})},size:{default:"medium"},submitButton:{default:()=>window.panel.$t("insert")}},data(){return{values:{href:"",title:null,...this.value}}},methods:{submit(){this.$emit("submit",this.values)}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",t._b({attrs:{value:t.values},on:{cancel:function(e){return t.$emit("cancel")},input:function(e){t.values=e},submit:t.submit}},"k-form-dialog",t.$props,!1))}),[]).exports;const Tt=nt({mixins:[At],props:{details:[Object,Array],message:String,size:{default:"medium",type:String}},emits:["cancel"],computed:{detailsList(){return this.$helper.array.fromObject(this.details)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-error-dialog",attrs:{"cancel-button":!1,"submit-button":!1,size:t.size,visible:t.visible},on:{cancel:function(e){return t.$emit("cancel")}}},[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)}),[]).exports;const Lt=nt({},(function(){var t=this;return(0,t._self._c)(t.$panel.dialog.component,t._g(t._b({key:t.$panel.dialog.timestamp,tag:"component",attrs:{visible:!0}},"component",t.$panel.dialog.props,!1),t.$panel.dialog.listeners()))}),[]).exports,Bt=(t,e,s={leading:!1,trailing:!0})=>{let i=null,n=null;return!1===s.leading&&!1===s.trailing?()=>null:function(...o){!i&&s.leading?t.apply(this,o):n=o,clearTimeout(i),i=setTimeout((()=>{s.trailing&&n&&t.apply(this,n),i=null,n=null}),e)}},It={props:{delay:{default:200,type:Number},hasSearch:{default:!0,type:Boolean}},data:()=>({query:""}),watch:{query(){!1!==this.hasSearch&&this.search()}},created(){this.search=Bt(this.search,this.delay)},methods:{async search(){console.warn("Search mixin: Please implement a `search` method.")}}},qt={props:{endpoint:String,empty:Object,fetchParams:Object,item:{type:Function,default:t=>t},max:Number,multiple:{type:Boolean,default:!0},size:{type:String,default:"medium"},value:{type:Array,default:()=>[]}}};const Pt=nt({mixins:[At,It,qt],emits:["cancel","fetched","submit"],data(){return{models:[],selected:this.value.reduce(((t,e)=>({...t,[e]:{id:e}})),{}),pagination:{limit:20,page:1,total:0}}},computed:{items(){return this.models.map(this.item)}},watch:{fetchParams(t,e){!1===this.$helper.object.same(t,e)&&(this.pagination.page=1,this.fetch())}},mounted(){this.fetch()},methods:{async fetch(){const t={page:this.pagination.page,search:this.query,...this.fetchParams};try{this.$panel.dialog.isLoading=!0;const e=await this.$api.get(this.endpoint,t);this.models=e.data,this.pagination=e.pagination,this.$emit("fetched",e)}catch(e){this.$panel.error(e),this.models=[]}finally{this.$panel.dialog.isLoading=!1}},isSelected(t){return void 0!==this.selected[t.id]},paginate(t){this.pagination.page=t.page,this.pagination.limit=t.limit,this.fetch()},submit(){this.$emit("submit",Object.values(this.selected))},async search(){this.pagination.page=0,await this.fetch()},toggle(t){if(!1!==this.multiple&&1!==this.max||(this.selected={}),this.isSelected(t))return Vue.del(this.selected,t.id);this.max&&this.max<=this.$helper.object.length(this.selected)||Vue.set(this.selected,t.id,t)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({staticClass:"k-models-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},"k-dialog",t.$props,!1),[t._t("header"),t.hasSearch?e("k-dialog-search",{attrs:{value:t.query},on:{search:function(e){t.query=e}}}):t._e(),e("k-collection",{attrs:{empty:{...t.empty,text:t.$panel.dialog.isLoading?t.$t("loading"):t.empty.text},items:t.items,link:!1,pagination:{details:!0,dropdown:!1,align:"center",...t.pagination},sortable:!1,layout:"list"},on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:s}){return[e("k-choice-input",{attrs:{checked:t.isSelected(s),type:t.multiple&&1!==t.max?"checkbox":"radio",title:t.isSelected(s)?t.$t("remove"):t.$t("select")},on:{click:function(e){return e.stopPropagation(),t.toggle(s)}}}),t._t("options",null,null,{item:s})]}}],null,!0)})],2)}),[]).exports;const Nt=nt({mixins:[At,qt],props:{empty:{type:Object,default:()=>({icon:"image",text:window.panel.$t("dialog.files.empty")})}}},(function(){var t=this;return(0,t._self._c)("k-models-dialog",t._b({on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",e)}}},"k-models-dialog",t.$props,!1))}),[]).exports;const Ft=nt({mixins:[At,$t],props:{size:{default:"medium"},submitButton:{default:()=>window.panel.$t("save")},text:{type:String}},emits:["cancel","input","submit"]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-dialog",t.$props,!1),[t._t("default",(function(){return[t.text?e("k-dialog-text",{attrs:{text:t.text}}):t._e(),e("k-dialog-fields",{attrs:{fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})]}))],2)}),[]).exports;const zt=nt({extends:Ft,watch:{"value.name"(t){this.fields.code.disabled||this.onNameChanges(t)},"value.code"(t){this.fields.code.disabled||(this.value.code=this.$helper.slug(t,[this.$panel.system.ascii]),this.onCodeChanges(this.value.code))}},methods:{onCodeChanges(t){if(!t)return this.value.locale=null;if(t.length>=2)if(-1!==t.indexOf("-")){let e=t.split("-"),s=[e[0],e[1].toUpperCase()];this.value.locale=s.join("_")}else{let e=this.$panel.system.locales??[];this.value.locale=null==e?void 0:e[t]}},onNameChanges(t){this.value.code=this.$helper.slug(t,[this.value.rules,this.$panel.system.ascii]).substr(0,2)}}},null,null).exports;const Yt=nt({mixins:[{mixins:[At],props:{license:Object,size:{default:"large"}}}]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-license-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-bar",{staticStyle:{"margin-bottom":"var(--spacing-2)"}},[e("h2",{staticClass:"k-headline"},[t._v(" "+t._s(t.$t("license"))+" ")])]),e("div",{staticClass:"k-table"},[e("table",{staticStyle:{"table-layout":"auto"}},[e("tbody",[e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("type")))]),e("td",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.license.type))])]),t.license.code?e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("license.code")))]),e("td",{staticClass:"k-text",attrs:{"data-mobile":"true"}},[e("code",[t._v(t._s(t.license.code))])])]):t._e(),t.license.info?e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("status")))]),e("td",{attrs:{"data-mobile":"true","data-theme":t.license.theme}},[e("p",{staticClass:"k-license-dialog-status"},[e("k-icon",{attrs:{type:t.license.icon}}),t._v(" "+t._s(t.license.info)+" ")],1)])]):t._e()])])])],1)}),[]).exports;const Rt=nt({mixins:[At,$t],props:{fields:{default:()=>({href:{label:window.panel.$t("link"),type:"link",placeholder:window.panel.$t("url.placeholder"),icon:"url"},title:{label:window.panel.$t("title"),type:"text",icon:"title"},target:{label:window.panel.$t("open.newWindow"),type:"toggle",text:[window.panel.$t("no"),window.panel.$t("yes")]}})},size:{default:"medium"},submitButton:{default:()=>window.panel.$t("insert")}},data(){return{values:{href:"",title:null,...this.value,target:Boolean(this.value.target??!1)}}},methods:{submit(){let t="/@/$1/";this.values.href.startsWith("page://")&&window.panel.language.code&&(t="/"+window.panel.language.code+t);const e=this.values.href.replace(/(file|page):\/\//,t);this.$emit("submit",{...this.values,href:e,target:this.values.target?"_blank":null})}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",t._b({attrs:{value:t.values},on:{cancel:function(e){return t.$emit("cancel")},input:function(e){t.values=e},submit:t.submit}},"k-form-dialog",t.$props,!1))}),[]).exports;const Ht=nt({mixins:[Ft],props:{blueprints:{type:Array},size:{default:"medium",type:String},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("save")},template:{type:String}},computed:{templates(){return this.blueprints.map((t=>({text:t.title,value:t.name})))}},methods:{pick(t){this.$panel.dialog.reload({query:{...this.$panel.dialog.query,slug:this.value.slug,template:t,title:this.value.title}})}}},(function(){var t=this,e=t._self._c;return e("k-form-dialog",t._b({ref:"dialog",staticClass:"k-page-create-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-form-dialog",t.$props,!1),[t.templates.length>1?e("k-select-field",{staticClass:"k-page-template-switch",attrs:{empty:!1,label:t.$t("template"),options:t.templates,required:!0,value:t.template},on:{input:function(e){return t.pick(e)}}}):t._e(),e("k-dialog-fields",{attrs:{fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],1)}),[]).exports;const Vt=nt({mixins:[At],props:{value:{default:()=>({}),type:Object}},emits:["cancel","input","submit"],methods:{select(t){this.$emit("input",{...this.value,parent:t.value})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-page-move-dialog",attrs:{"submit-button":{icon:"parent",text:t.$t("move")},size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-dialog",t.$props,!1),[e("k-headline",[t._v(t._s(t.$t("page.move")))]),e("div",{staticClass:"k-page-move-parent",attrs:{tabindex:"0","data-autofocus":""}},[e("k-page-tree",{attrs:{current:t.value.parent,move:t.value.move,identifier:"id"},on:{select:t.select}})],1)],1)}),[]).exports;const Ut=nt({mixins:[At,qt],props:{empty:{type:Object,default:()=>({icon:"page",text:window.panel.$t("dialog.pages.empty")})}},data:()=>({model:null,parent:null})},(function(){var t=this,e=t._self._c;return e("k-models-dialog",t._b({attrs:{"fetch-params":{parent:t.parent}},on:{cancel:function(e){return t.$emit("cancel")},fetched:function(e){t.model=e.model},submit:function(e){return t.$emit("submit",e)}},scopedSlots:t._u([t.model?{key:"header",fn:function(){return[e("header",{staticClass:"k-pages-dialog-navbar"},[e("k-button",{attrs:{disabled:!t.model.id,title:t.$t("back"),icon:"angle-left"},on:{click:function(e){t.parent=t.model.parent}}}),e("k-headline",[t._v(t._s(t.model.title))])],1)]},proxy:!0}:null,t.model?{key:"options",fn:function({item:s}){return[e("k-button",{staticClass:"k-pages-dialog-option",attrs:{disabled:!s.hasChildren,title:t.$t("open"),icon:"angle-right"},on:{click:function(e){e.stopPropagation(),t.parent=s.id}}})]}}:null],null,!0)},"k-models-dialog",t.$props,!1))}),[]).exports;const Kt=nt({mixins:[{mixins:[At,Ct]}]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[t._t("default",(function(){return[e("k-dialog-text",{attrs:{text:t.text}})]}))],2)}),[]).exports;const Wt=nt({mixins:[Kt],props:{icon:{default:"trash"},submitButton:{default:()=>window.panel.$t("delete")},theme:{default:"negative"}}},(function(){var t=this;return(0,t._self._c)("k-text-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-text-dialog",t.$props,!1),[t._t("default")],2)}),[]).exports;const Jt=nt({mixins:[At],props:{type:String},emits:["cancel"],data:()=>({results:null,pagination:{}}),methods:{focus(){var t;null==(t=this.$refs.search)||t.focus()},navigate(t){t&&(this.$go(t.link),this.close())},async search({type:t,query:e}){const s=await this.$panel.search(t,e);s&&(this.results=s.results,this.pagination=s.pagination)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{staticClass:"k-search-dialog",attrs:{"cancel-button":!1,"submit-button":!1,visible:!0,role:"search",size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[e("k-search-bar",{ref:"search",attrs:{"default-type":t.type??t.$panel.view.search,"is-loading":t.$panel.searcher.isLoading,pagination:t.pagination,results:t.results,types:t.$panel.searches},on:{close:t.close,more:function(e){return t.$go("search",{query:e})},navigate:t.navigate,search:t.search}})],1)}),[]).exports;const Gt=nt({mixins:[{mixins:[At,$t]}],props:{fields:null,qr:{type:String,required:!0},size:{default:"large"},submitButton:{default:()=>({text:window.panel.$t("activate"),icon:"lock",theme:"notice"})}},emits:["cancel","input","submit"]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-dialog-text",{staticClass:"k-totp-dialog-intro",attrs:{text:t.$t("login.totp.enable.intro")}}),e("div",{staticClass:"k-totp-dialog-grid"},[e("div",{staticClass:"k-totp-qrcode"},[e("k-info-field",{attrs:{label:t.$t("login.totp.enable.qr.label"),text:t.qr,help:t.$t("login.totp.enable.qr.help",{secret:t.value.secret}),theme:"passive"}})],1),e("k-dialog-fields",{staticClass:"k-totp-dialog-fields",attrs:{fields:{info:{label:t.$t("login.totp.enable.confirm.headline"),type:"info",text:t.$t("login.totp.enable.confirm.text"),theme:"none"},confirm:{label:t.$t("login.totp.enable.confirm.label"),type:"text",counter:!1,font:"monospace",required:!0,placeholder:t.$t("login.code.placeholder.totp"),help:t.$t("login.totp.enable.confirm.help")},secret:{type:"hidden"}},value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],1)],1)}),[]).exports;const Xt=nt({mixins:[At],props:{submitButton:{type:[String,Boolean,Object],default:()=>({icon:"upload",text:window.panel.$t("upload")})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-upload-dialog",attrs:{disabled:t.disabled||0===t.$panel.upload.files.length},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-dropzone",{on:{drop:function(e){return t.$panel.upload.select(e)}}},[0===t.$panel.upload.files.length?e("k-empty",{attrs:{icon:"upload",layout:"cards"},on:{click:function(e){return t.$panel.upload.pick()}}},[t._v(" "+t._s(t.$t("files.empty"))+" ")]):e("k-upload-items",{attrs:{items:t.$panel.upload.files},on:{remove:e=>{t.$panel.upload.remove(e.id)},rename:(t,e)=>{t.name=e}}})],1)],1)}),[]).exports;const Zt=nt({extends:Xt,props:{original:Object,submitButton:{type:[String,Boolean,Object],default:()=>({icon:"upload",text:window.panel.$t("replace")})}},computed:{file(){return this.$panel.upload.files[0]}}},(function(){var t,e,s,i,n=this,o=n._self._c;return o("k-dialog",n._b({ref:"dialog",staticClass:"k-upload-dialog k-upload-replace-dialog",on:{cancel:function(t){return n.$emit("cancel")},submit:function(t){return n.$emit("submit")}}},"k-dialog",n.$props,!1),[o("ul",{staticClass:"k-upload-items"},[o("li",{staticClass:"k-upload-original"},[o("k-upload-item-preview",{attrs:{color:null==(t=n.original.image)?void 0:t.color,icon:null==(e=n.original.image)?void 0:e.icon,url:n.original.url,type:n.original.mime}})],1),o("li",[n._v("←")]),o("k-upload-item",n._b({attrs:{color:null==(s=n.original.image)?void 0:s.color,editable:!1,icon:null==(i=n.original.image)?void 0:i.icon,name:n.$helper.file.name(n.original.filename),removable:!1}},"k-upload-item",n.file,!1))],1)])}),[]).exports;const Qt=nt({mixins:[At,qt],props:{empty:{type:Object,default:()=>({icon:"users",text:window.panel.$t("dialog.users.empty")})},item:{type:Function,default:t=>({...t,key:t.email,info:t.info!==t.text?t.info:null})}}},(function(){var t=this;return(0,t._self._c)("k-models-dialog",t._b({on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",e)}}},"k-models-dialog",t.$props,!1))}),[]).exports,te={install(t){t.use(Mt),t.component("k-dialog",Dt),t.component("k-changes-dialog",jt),t.component("k-email-dialog",Et),t.component("k-error-dialog",Tt),t.component("k-fiber-dialog",Lt),t.component("k-files-dialog",Nt),t.component("k-form-dialog",Ft),t.component("k-license-dialog",Yt),t.component("k-link-dialog",Rt),t.component("k-language-dialog",zt),t.component("k-models-dialog",Pt),t.component("k-page-create-dialog",Ht),t.component("k-page-move-dialog",Vt),t.component("k-pages-dialog",Ut),t.component("k-remove-dialog",Wt),t.component("k-search-dialog",Jt),t.component("k-text-dialog",Kt),t.component("k-totp-dialog",Gt),t.component("k-upload-dialog",Xt),t.component("k-upload-replace-dialog",Zt),t.component("k-users-dialog",Qt)}};const ee=nt({},(function(){return(0,this._self._c)("div",{staticClass:"k-drawer-body scroll-y-auto"},[this._t("default")],2)}),[]).exports,se={props:{empty:{type:String,default:()=>window.panel.$t("drawer.fields.empty")},fields:Object,value:Object}};const ie=nt({mixins:[se],emits:["input","submit"],computed:{hasFields(){return this.$helper.object.length(this.fields)>0}}},(function(){var t=this,e=t._self._c;return t.hasFields?e("k-fieldset",{staticClass:"k-drawer-fields",attrs:{fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[]).exports,ne={props:{breadcrumb:{default:()=>[],type:Array},tab:{type:String},tabs:{default:()=>({}),type:Object}}};const oe=nt({mixins:[ne],emits:["crumb","tab"]},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-drawer-header"},[e("nav",{staticClass:"k-breadcrumb k-drawer-breadcrumb"},[e("ol",t._l(t.breadcrumb,(function(s,i){return e("li",{key:s.id},[e("k-button",{staticClass:"k-breadcrumb-link",attrs:{icon:s.props.icon,text:s.props.title,current:i===t.breadcrumb.length-1,variant:"dimmed"},on:{click:function(e){return t.$emit("crumb",s.id)}}})],1)})),0)]),e("k-drawer-tabs",{attrs:{tab:t.tab,tabs:t.tabs},on:{open:function(e){return t.$emit("tab",e)}}}),e("nav",{staticClass:"k-drawer-options"},[t._t("default"),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"check",type:"submit"}})],2)],1)}),[]).exports;const re=nt({},(function(){var t=this,e=t._self._c;return"drawer"===t.$panel.notification.context?e("k-notification",{staticClass:"k-drawer-notification"}):t._e()}),[]).exports;const ae=nt({mixins:[{props:{tab:{type:String},tabs:{default:()=>({}),type:[Array,Object]}}}],emits:["open"],computed:{hasTabs(){return this.$helper.object.length(this.tabs)>1}}},(function(){var t=this,e=t._self._c;return 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 t.$emit("open",s.name)}}})})),1):t._e()}),[]).exports,le={props:{empty:{type:String,default:()=>window.panel.$t("drawer.text.empty")},text:{type:String}}};const ce=nt({mixins:[le]},(function(){var t=this,e=t._self._c;return t.text?e("k-text",{attrs:{html:t.text}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[]).exports,ue={install(t){t.component("k-drawer-body",ee),t.component("k-drawer-fields",ie),t.component("k-drawer-header",oe),t.component("k-drawer-notification",re),t.component("k-drawer-tabs",ae),t.component("k-drawer-text",ce)}},pe={mixins:[ne],props:{disabled:{default:!1,type:Boolean},icon:String,id:String,options:{type:Array},title:String,visible:{default:!1,type:Boolean}}};const de=nt({mixins:[pe],emits:["cancel","crumb","submit","tab"]},(function(){var t=this,e=t._self._c;return t.visible?e("portal",{attrs:{to:"drawer"}},[e("form",{staticClass:"k-drawer",class:t.$vnode.data.staticClass,attrs:{"aria-disabled":t.disabled,method:"dialog"},on:{submit:function(e){return e.preventDefault(),t.$emit("submit")}}},[e("k-drawer-notification"),e("k-drawer-header",{attrs:{breadcrumb:t.breadcrumb,tab:t.tab,tabs:t.tabs},on:{crumb:function(e){return t.$emit("crumb",e)},tab:function(e){return t.$emit("tab",e)}}},[t._t("options",(function(){return[t._l(t.options,(function(s,i){return[s.dropdown?[e("k-button",t._b({key:"btn-"+i,staticClass:"k-drawer-option",on:{click:function(e){t.$refs["dropdown-"+i][0].toggle()}}},"k-button",s,!1)),e("k-dropdown-content",{key:"dropdown-"+i,ref:"dropdown-"+i,refInFor:!0,attrs:{options:s.dropdown,"align-x":"end",theme:"light"}})]:e("k-button",t._b({key:i,staticClass:"k-drawer-option"},"k-button",s,!1))]}))]}))],2),e("k-drawer-body",[t._t("default")],2)],1)]):t._e()}),[]).exports,he={props:{hidden:{type:Boolean},next:{type:Object},prev:{type:Object}}};const me=nt({mixins:[pe,se,he],emits:["cancel","crumb","input","next","prev","remove","show","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-form-drawer",t._b({ref:"drawer",staticClass:"k-block-drawer",on:{cancel:function(e){return t.$emit("cancel",e)},crumb:function(e){return t.$emit("crumb",e)},input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)},tab:function(e){return t.$emit("tab",e)}},scopedSlots:t._u([{key:"options",fn:function(){return[t.hidden?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 t.$emit("prev")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return t.$emit("next")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return t.$emit("remove")}}})]},proxy:!0}])},"k-form-drawer",t.$props,!1))}),[]).exports;const fe=nt({methods:{isCurrent(t){return this.$panel.drawer.id===t}}},(function(){var t=this,e=t._self._c;return e("div",t._l(t.$panel.drawer.history.milestones,(function(s){return e(s.component,t._g(t._b({key:s.id,tag:"component",attrs:{breadcrumb:t.$panel.drawer.breadcrumb,disabled:!1===t.isCurrent(s.id),visible:!0}},"component",t.isCurrent(s.id)?t.$panel.drawer.props:s.props,!1),t.isCurrent(s.id)?t.$panel.drawer.listeners():s.on))})),1)}),[]).exports;const ge=nt({mixins:[pe,se],emits:["cancel","crumb","input","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-drawer",t._b({ref:"drawer",staticClass:"k-form-drawer",on:{cancel:function(e){return t.$emit("cancel")},crumb:function(e){return t.$emit("crumb",e)},submit:function(e){return t.$emit("submit",t.value)},tab:function(e){return t.$emit("tab",e)}}},"k-drawer",t.$props,!1),[t._t("options",null,{slot:"options"}),e("k-drawer-fields",{attrs:{fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],2)}),[]).exports;const ke=nt({mixins:[pe,se,{props:{next:{type:Object},prev:{type:Object}}}],emits:["cancel","crumb","input","next","prev","remove","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-form-drawer",t._b({ref:"drawer",staticClass:"k-structure-drawer",on:{cancel:function(e){return t.$emit("cancel",e)},crumb:function(e){return t.$emit("crumb",e)},input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)},tab:function(e){return t.$emit("tab",e)}},scopedSlots:t._u([{key:"options",fn:function(){return[e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.prev,icon:"angle-left"},on:{click:function(e){return t.$emit("prev")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return t.$emit("next")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return t.$emit("remove")}}})]},proxy:!0}])},"k-form-drawer",t.$props,!1))}),[]).exports;const be=nt({mixins:[pe,le],emits:["cancel","crumb","input","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-drawer",t._b({ref:"drawer",staticClass:"k-text-drawer",on:{cancel:function(e){return t.$emit("cancel")},crumb:function(e){return t.$emit("crumb",e)},submit:function(e){return t.$emit("submit",t.value)},tab:function(e){return t.$emit("tab",e)}}},"k-drawer",t.$props,!1),[t._t("options",null,{slot:"options"}),e("k-dialog-text",{attrs:{text:t.text}})],2)}),[]).exports,ye={install(t){t.use(ue),t.component("k-drawer",de),t.component("k-block-drawer",me),t.component("k-fiber-drawer",fe),t.component("k-form-drawer",ge),t.component("k-structure-drawer",ke),t.component("k-text-drawer",be)}};let ve=null;const $e=nt({props:{align:{type:String},alignX:{type:String,default:"start"},alignY:{type:String,default:"bottom"},disabled:{type:Boolean,default:!1},navigate:{default:!0,type:Boolean},options:[Array,Function,String],theme:{type:String,default:"dark"}},emits:["action","close","open"],data(){return{axis:{x:this.alignX,y:this.alignY},position:{x:0,y:0},isOpen:!1,items:[],opener:null}},mounted(){this.align&&window.panel.deprecated(": `align` prop will be removed in a future version. Use the `alignX` prop instead.")},methods:{close(){var t;null==(t=this.$refs.dropdown)||t.close()},async fetchOptions(t){return this.options?"string"==typeof this.options?this.$dropdown(this.options)(t):"function"==typeof this.options?this.options(t):Array.isArray(this.options)?t(this.options):void 0:t(this.items)},focus(t=0){this.$refs.navigate.focus(t)},onClick(){this.close()},onClose(){this.resetPosition(),this.isOpen=ve=!1,this.$emit("close"),window.removeEventListener("resize",this.setPosition)},async onOpen(){this.isOpen=!0;const t=window.scrollY;ve=this,await this.$nextTick(),this.$el&&this.opener&&(window.addEventListener("resize",this.setPosition),await this.setPosition(),window.scrollTo(0,t),this.$emit("open"))},onOptionClick(t){return this.close(),"function"==typeof t.click?t.click.call(this):"string"==typeof t.click?this.$emit("action",t.click):void(t.click&&(t.click.name&&this.$emit(t.click.name,t.click.payload),t.click.global&&this.$events.emit(t.click.global,t.click.payload)))},open(t){var e,s;if(!0===this.disabled)return!1;ve&&ve!==this&&ve.close(),this.opener=t??(null==(e=window.event)?void 0:e.target.closest("button"))??(null==(s=window.event)?void 0:s.target),this.fetchOptions((t=>{this.items=t,this.onOpen()}))},async setPosition(){this.axis={x:this.alignX??this.align,y:this.alignY},"right"===this.axis.x?this.axis.x="end":"left"===this.axis.x&&(this.axis.x="start"),"rtl"===this.$panel.direction&&("start"===this.axis.x?this.axis.x="end":"end"===this.axis.x&&(this.axis.x="start")),this.opener.$el&&(this.opener=this.opener.$el);const t=this.opener.getBoundingClientRect();this.position.x=t.left+window.scrollX+t.width,this.position.y=t.top+window.scrollY+t.height,!0!==this.$el.open&&this.$el.showModal(),await this.$nextTick();const e=this.$el.getBoundingClientRect(),s=10;"end"===this.axis.x?t.left-e.widthwindow.innerWidth-s&&e.width+se.top&&(this.axis.y="bottom"):t.top+e.height>window.innerHeight-s&&e.height+s[]},text:{type:[Boolean,String],default:!0},theme:{type:String,default:"dark"},size:String,variant:String},emits:["action","option"],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(t=this.$el){this.$refs.options.toggle(t)}}},(function(){var t=this,e=t._self._c;return t.hasSingleOption?e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{disabled:t.disabled,icon:t.options[0].icon??t.icon,size:t.options[0].size??t.size,title:t.options[0].title??t.options[0].tooltip??t.options[0].text,variant:t.options[0].variant??t.variant},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("div",{staticClass:"k-options-dropdown"},[e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{disabled:t.disabled,dropdown:!0,icon:t.icon,size:t.size,text:!0!==t.text&&!1!==t.text?t.text:null,title:t.$t("options"),variant:t.variant},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",staticClass:"k-options-dropdown-content",attrs:{"align-x":t.align,options:t.options},on:{action:t.onAction}})],1):t._e()}),[]).exports,_e={mixins:[Y,H,K,Z,st]},Se={mixins:[_e],inheritAttrs:!1,emits:["input"],methods:{focus(){this.$el.focus()}}},Ce={mixins:[Y,H,Q,st],props:{ignore:{default:()=>[],type:Array},max:Number,min:Number,search:{default:!0,type:[Object,Boolean]}}},Oe={mixins:[_e,Ce],props:{create:{type:[Boolean,Object],default:!1},multiple:{type:Boolean,default:!0},value:{type:[Array,String],default:()=>[]}},emits:["create","escape","input"]};const Me=nt({mixins:[Se,Oe],data(){return{display:this.search.display??!0,query:""}},computed:{choices(){let t=this.filteredOptions;return!0!==this.display&&(t=t.slice(0,this.display)),t.map((t=>({...t,disabled:t.disabled||this.isFull&&!1===this.value.includes(t.value),text:this.highlight(t.text)})))},filteredOptions(){if(!(this.query.length<(this.search.min??0)))return this.$helper.array.search(this.options,this.query,{field:"text"})},isFull(){return this.max&&this.value.length>=this.max},placeholder(){return this.search.placeholder?this.search.placeholder:this.options.length>0?this.$t("filter")+"…":this.$t("enter")+"…"},showCreate(){var t;if(!1===this.create)return!1;if(this.isFull)return!1;if(0===this.query.trim().length)return!1;if(!0===this.ignore.includes(this.query))return!1;if(!0===(null==(t=this.create.ignore)?void 0:t.includes(this.query)))return!1;return 0===this.options.filter((t=>t.text===this.query||t.value===this.query)).length},showEmpty(){return!1===this.create&&0===this.filteredOptions.length}},methods:{add(){this.showCreate&&this.$emit("create",this.query)},enter(t){var e;null==(e=t.target)||e.click()},escape(){0===this.query.length?this.$emit("escape"):this.query=""},focus(){var t;this.$refs.search?this.$refs.search.focus():null==(t=this.$refs.options)||t.focus()},highlight(t){if(t=this.$helper.string.stripHTML(t),this.query.length>0){const e=new RegExp(`(${RegExp.escape(this.query)})`,"ig");return t.replace(e,"$1")}return t},input(t){this.$emit("input",t)}}},(function(){var t=this,e=t._self._c;return e("k-navigate",{class:["k-picklist-input",t.$attrs.class],style:t.$attrs.style,attrs:{element:"nav",axis:"y",select:"input[type=search], label, .k-picklist-input-body button"},on:{prev:function(e){return t.$emit("escape")}}},[t.search?e("header",{staticClass:"k-picklist-input-header"},[e("div",{staticClass:"k-picklist-input-search"},[e("k-search-input",{ref:"search",attrs:{autofocus:t.autofocus,disabled:t.disabled,placeholder:t.placeholder,value:t.query},on:{input:function(e){t.query=e}},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"escape",void 0,e.key,void 0)?null:(e.preventDefault(),t.escape.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.add.apply(null,arguments))}]}}),t.showCreate?e("k-button",{staticClass:"k-picklist-input-create",attrs:{icon:"add",size:"xs"},on:{click:t.add}}):t._e()],1)]):t._e(),t.filteredOptions.length?[e("div",{staticClass:"k-picklist-input-body"},[e("k-input-validator",t._b({attrs:{value:JSON.stringify(t.value)}},"k-input-validator",{min:t.min,max:t.max,required:t.required},!1),[e(t.multiple?"k-checkboxes-input":"k-radio-input",{ref:"options",tag:"component",staticClass:"k-picklist-input-options",attrs:{disabled:t.disabled,options:t.choices,value:t.value},on:{input:t.input},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.enter.apply(null,arguments))}}})],1),!0!==t.display&&t.filteredOptions.length>t.display?e("k-button",{staticClass:"k-picklist-input-more",attrs:{icon:"angle-down"},on:{click:function(e){t.display=!0}}},[t._v(" "+t._s(t.$t("options.all",{count:t.filteredOptions.length}))+" ")]):t._e()],1)]:t.showEmpty?[e("div",{staticClass:"k-picklist-input-body"},[e("p",{staticClass:"k-picklist-input-empty"},[t._v(" "+t._s(t.$t("options.none"))+" ")])])]:t._e()],2)}),[]).exports;const Ae=nt({mixins:[Oe],emits:["create","input"],methods:{close(){this.$refs.dropdown.close()},add(t){this.$emit("create",t)},input(t){this.$emit("input",t)},open(t){this.$refs.dropdown.open(t)},toggle(){this.$refs.dropdown.toggle()}}},(function(){var t=this,e=t._self._c;return e("k-dropdown-content",{ref:"dropdown",staticClass:"k-picklist-dropdown",attrs:{"align-x":"start",disabled:t.disabled,navigate:!1},nativeOn:{click:function(t){t.stopPropagation()}}},[e("k-picklist-input",t._b({on:{create:t.add,input:t.input,escape:function(e){return t.$refs.dropdown.close()}},nativeOn:{click:function(t){t.stopPropagation()}}},"k-picklist-input",t.$props,!1))],1)}),[]).exports,De={install(t){t.component("k-dropdown-content",$e),t.component("k-dropdown-item",we),t.component("k-options-dropdown",xe),t.component("k-picklist-dropdown",Ae)}};const je=nt({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.min&&t.max?[t._v(t._s(t.min)+"–"+t._s(t.max))]:t.min?[t._v("≥ "+t._s(t.min))]:t.max?[t._v("≤ "+t._s(t.max))]:t._e()],2):t._e()])}),[]).exports,Ee={mixins:[H,U,K,W,Z,st],props:{counter:[Boolean,Object],endpoints:Object,input:[String,Number],translate:Boolean,type:String}};const Te=nt({mixins:[Ee],inheritAttrs:!1,emits:["blur","focus"]},(function(){var t=this,e=t._self._c;return e("div",{class:["k-field",`k-field-name-${t.name}`,`k-field-type-${t.type}`,t.$attrs.class],style:t.$attrs.style,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("k-label",{attrs:{input:t.input,required:t.required,title:t.label,type:"field"}},[t._v(" "+t._s(t.label)+" ")])]})),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-help k-field-help",attrs:{html:t.help}}):t._e()]}))],2):t._e()]}))],2)}),[]).exports,Le={props:{config:Object,disabled:Boolean,fields:{type:[Array,Object],default:()=>({})},value:{type:Object,default:()=>({})}},emits:["focus","input","submit"],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]},onInput(t,e,s){const i=this.value;this.$set(i,s,t),this.$emit("input",i,e,s)}}};const Be=nt(Le,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-fieldset"},[e("k-grid",{attrs:{variant:"fields"}},[t._l(t.fields,(function(s,i){return[t.$helper.field.isVisible(s,t.value)?e("k-column",{key:i,attrs:{width:s.width}},[t.hasFieldType(s.type)?e("k-"+s.type+"-field",t._b({ref:i,refInFor:!0,tag:"component",attrs:{disabled:t.disabled||s.disabled,"form-data":t.value,name:i,value:t.value[i]},on:{input:function(e){return t.onInput(e,s,i)},focus:function(e){return t.$emit("focus",e,s,i)},submit:function(e){return t.$emit("submit",e,s,i)}}},"component",s,!1)):e("k-box",{attrs:{theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[t._v(" "+t._s(t.$t("error.field.type.missing",{name:i,type:s.type}))+" ")])],1)],1):t._e()]}))],2)],1)}),[]).exports;const Ie=nt({props:{disabled:Boolean,config:Object,fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},emits:["focus","input","submit"],data:()=>({errors:{}}),methods:{focus(t){var e,s;null==(s=null==(e=this.$refs.fields)?void 0:e.focus)||s.call(e,t)},onFocus(t,e,s){this.$emit("focus",t,e,s)},onInput(t,e,s){this.$emit("input",t,e,s)},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:{novalidate:t.novalidate,method:"POST",autocomplete:"off"},on:{submit:function(e){return e.preventDefault(),t.onSubmit.apply(null,arguments)}}},[t._t("header"),t._t("default",(function(){return[e("k-fieldset",{ref:"fields",attrs:{disabled:t.disabled,fields:t.fields,value:t.value},on:{focus:t.onFocus,input:t.onInput,submit:t.onSubmit}})]})),t._t("footer"),e("input",{ref:"submitter",staticClass:"k-form-submitter",attrs:{type:"submit"}})],2)}),[]).exports;const qe=nt({props:{editor:String,hasChanges:Boolean,isLocked:Boolean,modified:[String,Date],preview:[String,Boolean]},emits:["discard","submit"],computed:{buttons(){return!0===this.isLocked?[{theme:"negative",dropdown:!0,text:this.editor,icon:"lock",click:()=>this.$refs.dropdown.toggle()}]:!0===this.hasChanges?[{theme:"notice",text:this.$t("discard"),icon:"undo",click:()=>this.discard()},{theme:"notice",text:this.$t("save"),icon:"check",click:()=>this.$emit("submit")},{theme:"notice",icon:"dots",click:()=>this.$refs.dropdown.toggle()}]:[]}},methods:{discard(){this.$panel.dialog.open({component:"k-remove-dialog",props:{size:"medium",submitButton:{theme:"notice",icon:"undo",text:this.$t("form.discard")},text:this.$t("form.discard.confirm")},on:{submit:()=>{this.$panel.dialog.close(),this.$emit("discard")}}})}}},(function(){var t=this,e=t._self._c;return t.buttons.length?e("div",{staticClass:"k-form-controls"},[e("k-button-group",{attrs:{layout:"collapsed"}},t._l(t.buttons,(function(s){return e("k-button",t._b({key:s.text,attrs:{responsive:!0,size:"sm",variant:"filled"}},"k-button",s,!1))})),1),e("k-dropdown-content",{ref:"dropdown",staticClass:"k-form-controls-dropdown",attrs:{"align-x":"end"}},[t.isLocked?[e("p",[t._v(" "+t._s(t.$t("form.locked"))+" ")])]:[e("p",[t._v(" "+t._s(t.$t("form.unsaved"))+" ")])],t.editor||t.modified?[e("hr"),e("dl",[t.editor?e("div",[e("dt",[e("k-icon",{attrs:{type:"user"}})],1),e("dd",[t._v(t._s(t.editor))])]):t._e(),t.modified?e("div",[e("dt",[e("k-icon",{attrs:{type:"clock"}})],1),e("dd",[t._v(" "+t._s(t.$library.dayjs(t.modified).format("YYYY-MM-DD HH:mm:ss"))+" ")])]):t._e()])]:t._e(),t.preview?[e("hr"),e("k-dropdown-item",{attrs:{link:t.preview,icon:"window"}},[t._v(" "+t._s(t.$t("form.preview"))+" ")])]:t._e()],2)],1):t._e()}),[]).exports,Pe={mixins:[F,R,H],inheritAttrs:!1,props:{autofocus:Boolean,type:String,icon:[String,Boolean],value:{type:[String,Boolean,Number,Object,Array],default:null}},emits:["input"]};const Ne=nt({mixins:[Pe],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",{class:["k-input",t.$attrs.class],style:t.$attrs.style,attrs:{"data-disabled":t.disabled,"data-type":t.type}},[t.$slots.before||t.before?e("span",{staticClass:"k-input-description 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._b({ref:"input",tag:"component",attrs:{value:t.value},on:{input:function(e){return t.$emit("input",e)}}},"component",t.inputProps,!1))]}))],2),t.$slots.after||t.after?e("span",{staticClass:"k-input-description 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()])}),[]).exports,Fe={props:{content:{default:()=>({}),type:[Array,Object]},fieldset:{default:()=>({}),type:Object}}};const ze=nt({mixins:[Fe],inheritAttrs:!1,computed:{icon(){return this.fieldset.icon??"box"},label(){if(!this.fieldset.label||0===this.fieldset.label.length)return!1;if(this.fieldset.label===this.name)return!1;let t=this.$helper.string.template(this.fieldset.label,this.content);return"…"!==t&&(t=this.$helper.string.stripHTML(t),this.$helper.string.unescapeHTML(t))},name(){return this.fieldset.name??this.fieldset.label}}},(function(){var t=this,e=t._self._c;return e("div",{class:["k-block-title",t.$attrs.class],style:t.$attrs.style},[e("k-icon",{staticClass:"k-block-icon",attrs:{type:t.icon}}),t.name?e("span",{staticClass:"k-block-name"},[t._v(" "+t._s(t.name)+" ")]):t._e(),t.label?e("span",{staticClass:"k-block-label"},[t._v(" "+t._s(t.label)+" ")]):t._e()],1)}),[]).exports,Ye={mixins:[Fe,H],props:{endpoints:{default:()=>({}),type:[Array,Object]},id:String}};const Re=nt({mixins:[Ye],inheritAttrs:!1,methods:{field(t,e=null){let s=null;for(const i of Object.values(this.fieldset.tabs??{}))i.fields[t]&&(s=i.fields[t]);return s??e},open(){this.$emit("open")},update(t){this.$emit("update",{...this.content,...t})}}},(function(){var t=this;return(0,t._self._c)("k-block-title",{class:t.$attrs.class,style:t.$attrs.style,attrs:{content:t.content,fieldset:t.fieldset},nativeOn:{dblclick:function(e){return t.$emit("open")}}})}),[]).exports,He={props:{isBatched:Boolean,isFull:Boolean,isHidden:Boolean,isMergable:Boolean}};const Ve=nt({mixins:[He],props:{isEditable:Boolean,isSplitable:Boolean},emits:["chooseToAppend","chooseToConvert","chooseToPrepend","copy","duplicate","hide","merge","open","paste","remove","removeSelected","show","split","sortDown","sortUp"],computed:{buttons(){return this.isBatched?[{icon:"template",title:this.$t("copy"),click:()=>this.$emit("copy")},{when:this.isMergable,icon:"merge",title:this.$t("merge"),click:()=>this.$emit("merge")},{icon:"trash",title:this.$t("remove"),click:()=>this.$emit("removeSelected")}]:[{when:this.isEditable,icon:"edit",title:this.$t("edit"),click:()=>this.$emit("open")},{icon:"add",title:this.$t("insert.after"),disabled:this.isFull,click:()=>this.$emit("chooseToAppend")},{icon:"trash",title:this.$t("delete"),click:()=>this.$emit("remove")},{icon:"sort",title:this.$t("sort.drag"),class:"k-sort-handle",key:t=>this.sort(t)},{icon:"dots",title:this.$t("more"),dropdown:[{icon:"angle-up",label:this.$t("insert.before"),disabled:this.isFull,click:()=>this.$emit("chooseToPrepend")},{icon:"angle-down",label:this.$t("insert.after"),disabled:this.isFull,click:()=>this.$emit("chooseToAppend")},"-",{when:this.isEditable,icon:"edit",label:this.$t("edit"),click:()=>this.$emit("open")},{icon:"refresh",label:this.$t("field.blocks.changeType"),click:()=>this.$emit("chooseToConvert")},{when:this.isSplitable,icon:"split",label:this.$t("split"),click:()=>this.$emit("split")},"-",{icon:"template",label:this.$t("copy"),click:()=>this.$emit("copy")},{icon:"download",label:this.$t("paste.after"),disabled:this.isFull,click:()=>this.$emit("paste")},"-",{icon:this.isHidden?"preview":"hidden",label:this.isHidden?this.$t("show"):this.$t("hide"),click:()=>this.$emit(this.isHidden?"show":"hide")},{icon:"copy",label:this.$t("duplicate"),click:()=>this.$emit("duplicate")},"-",{icon:"trash",label:this.$t("delete"),click:()=>this.$emit("remove")}]}]}},methods:{open(){this.$refs.options.open()},sort(t){switch(t.preventDefault(),t.key){case"ArrowUp":this.$emit("sortUp");break;case"ArrowDown":this.$emit("sortDown")}}}},(function(){return(0,this._self._c)("k-toolbar",{staticClass:"k-block-options",attrs:{buttons:this.buttons},nativeOn:{mousedown:function(t){t.preventDefault()}}})}),[]).exports,Ue={mixins:[Ye,He],inheritAttrs:!1,props:{attrs:{default:()=>({}),type:[Array,Object]},isLastSelected:Boolean,isSelected:Boolean,name:String,next:Object,prev:Object,type:String},emits:["append","chooseToAppend","chooseToConvert","chooseToPrepend","close","copy","duplicate","focus","hide","merge","open","paste","prepend","remove","selectDown","selectUp","show","sortDown","sortUp","split","submit","update"],computed:{className(){let t=["k-block-type-"+this.type];return this.fieldset.preview&&this.fieldset.preview!==this.type&&t.push("k-block-type-"+this.fieldset.preview),!1===this.wysiwyg&&t.push("k-block-type-default"),t},containerType(){const t=this.fieldset.preview;return!1!==t&&(t&&this.$helper.isComponent("k-block-type-"+t)?t:!!this.$helper.isComponent("k-block-type-"+this.type)&&this.type)},customComponent(){return this.wysiwyg?this.wysiwygComponent:"k-block-type-default"},isDisabled(){return!0===this.disabled||!0===this.fieldset.disabled},isEditable(){return!1!==this.fieldset.editable},listeners(){return{append:t=>this.$emit("append",t),chooseToAppend:t=>this.$emit("chooseToAppend",t),chooseToConvert:t=>this.$emit("chooseToConvert",t),chooseToPrepend:t=>this.$emit("chooseToPrepend",t),close:()=>this.$emit("close"),copy:()=>this.$emit("copy"),duplicate:()=>this.$emit("duplicate"),focus:()=>this.$emit("focus"),hide:()=>this.$emit("hide"),merge:()=>this.$emit("merge"),open:t=>this.open(t),paste:()=>this.$emit("paste"),prepend:t=>this.$emit("prepend",t),remove:()=>this.remove(),removeSelected:()=>this.$emit("removeSelected"),show:()=>this.$emit("show"),sortDown:()=>this.$emit("sortDown"),sortUp:()=>this.$emit("sortUp"),split:t=>this.$emit("split",t),update:t=>this.$emit("update",t)}},listenersForOptions(){return{...this.listeners,split:()=>this.$refs.editor.split(),open:()=>{"function"==typeof this.$refs.editor.open?this.$refs.editor.open():this.open()}}},tabs(){const t=this.fieldset.tabs??{};for(const[e,s]of Object.entries(t))for(const[i]of Object.entries(s.fields??{}))t[e].fields[i].section=this.name,t[e].fields[i].endpoints={field:this.endpoints.field+"/fieldsets/"+this.type+"/fields/"+i,section:this.endpoints.section,model:this.endpoints.model};return t},wysiwyg(){return!1!==this.wysiwygComponent},wysiwygComponent(){return!!this.containerType&&"k-block-type-"+this.containerType}},methods:{backspace(t){if(t.target.matches("[contenteditable], input, textarea"))return!1;t.preventDefault(),this.remove()},close(){this.$panel.drawer.close(this.id)},focus(){var t,e;"function"==typeof(null==(t=this.$refs.editor)?void 0:t.focus)?this.$refs.editor.focus():null==(e=this.$refs.container)||e.focus()},goTo(t){var e;t&&(null==(e=t.$refs.container)||e.focus(),t.open(null,!0))},isSplitable(){var t;return!0!==this.isFull&&(!!this.$refs.editor&&((this.$refs.editor.isSplitable??!0)&&"function"==typeof(null==(t=this.$refs.editor)?void 0:t.split)))},onClose(){this.$emit("close"),this.focus()},onFocus(t){this.disabled||this.$emit("focus",t)},onFocusIn(t){var e,s;this.disabled||(null==(s=null==(e=this.$refs.options)?void 0:e.$el)?void 0:s.contains(t.target))||this.$emit("focus",t)},onInput(t){this.$emit("update",t)},open(t,e=!1){!this.isEditable||this.isBatched||this.isDisabled||(this.$panel.drawer.open({component:"k-block-drawer",id:this.id,tab:t,on:{close:this.onClose,input:this.onInput,next:()=>this.goTo(this.next),prev:()=>this.goTo(this.prev),remove:this.remove,show:this.show,submit:this.submit},props:{hidden:this.isHidden,icon:this.fieldset.icon??"box",next:this.next,prev:this.prev,tabs:this.tabs,title:this.fieldset.name,value:this.content},replace:e}),this.$emit("open"))},remove(){if(this.isBatched)return this.$emit("removeSelected");this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm")},on:{submit:()=>{this.$panel.dialog.close(),this.close(),this.$emit("remove",this.id)}}})},show(){this.$emit("show")},submit(){this.close(),this.$emit("submit")}}};const Ke=nt(Ue,(function(){var t=this,e=t._self._c;return e("div",{ref:"container",class:["k-block-container","k-block-container-fieldset-"+t.type,t.containerType?"k-block-container-type-"+t.containerType:"",t.$attrs.class],style:t.$attrs.style,attrs:{"data-batched":t.isBatched,"data-disabled":t.isDisabled,"data-hidden":t.isHidden,"data-id":t.id,"data-last-selected":t.isLastSelected,"data-selected":t.isSelected,"data-translate":t.fieldset.translate,tabindex:t.isDisabled?null:0},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"j",void 0,e.key,void 0)?null:e.ctrlKey?(e.preventDefault(),e.stopPropagation(),t.$emit("merge")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.altKey?(e.preventDefault(),e.stopPropagation(),t.$emit("selectDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey&&e.altKey?(e.preventDefault(),e.stopPropagation(),t.$emit("selectUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),e.stopPropagation(),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(),e.stopPropagation(),t.$emit("sortUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:e.ctrlKey?(e.stopPropagation(),t.backspace.apply(null,arguments)):null}],focus:function(e){return e.stopPropagation(),t.onFocus.apply(null,arguments)},focusin:function(e){return e.stopPropagation(),t.onFocusIn.apply(null,arguments)}}},[e("div",{staticClass:"k-block",class:t.className,attrs:{"data-disabled":t.isDisabled}},[e(t.customComponent,t._g(t._b({ref:"editor",tag:"component",attrs:{tabs:t.tabs}},"component",t.$props,!1),t.listeners))],1),t.isDisabled?t._e():e("k-block-options",t._g(t._b({ref:"options"},"k-block-options",{isBatched:t.isBatched,isEditable:t.isEditable,isFull:t.isFull,isHidden:t.isHidden,isMergable:t.isMergable,isSplitable:t.isSplitable()},!1),t.listenersForOptions))],1)}),[]).exports,We={mixins:[Y,H,K],props:{empty:String,endpoints:Object,fieldsets:Object,fieldsetGroups:Object,group:String,min:{type:Number,default:null},max:{type:Number,default:null},value:{type:Array,default:()=>[]}},emits:["input"]},Je={mixins:[We],inheritAttrs:!1,data(){return{blocks:this.value??[],isEditing:!1,isMultiSelectKey:!1,selected:[]}},computed:{draggableOptions(){return{handle:".k-sort-handle",list:this.blocks,group:this.group,move:this.move,data:{fieldsets:this.fieldsets,isFull:this.isFull}}},hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.blocks.length},isFull(){return null!==this.max&&this.blocks.length>=this.max},isMergable(){if(this.selected.length<2)return!1;const t=this.selected.map((t=>this.find(t)));return!(new Set(t.map((t=>t.type))).size>1)&&"function"==typeof this.ref(t[0]).$refs.editor.merge}},watch:{value(){this.blocks=this.value}},mounted(){!0===this.$props.autofocus&&setTimeout(this.focus,100),this.$events.on("blur",this.onBlur),this.$events.on("click",this.onClickGlobal),this.$events.on("copy",this.onCopy),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("click",this.onClickGlobal),this.$events.off("copy",this.onCopy),this.$events.off("keydown",this.onKey),this.$events.off("keyup",this.onKey),this.$events.off("paste",this.onPaste)},methods:{async add(t="text",e){const s=await this.$api.get(this.endpoints.field+"/fieldsets/"+t);this.blocks.splice(e,0,s),this.save(),await this.$nextTick(),this.focusOrOpen(s)},choose(t){if(1===this.$helper.object.length(this.fieldsets))return this.add(Object.values(this.fieldsets)[0].type,t);this.$panel.dialog.open({component:"k-block-selector",props:{fieldsetGroups:this.fieldsetGroups,fieldsets:this.fieldsets},on:{submit:e=>{this.add(e,t),this.$panel.dialog.close()},paste:e=>{this.paste(e,t)}}})},chooseToConvert(t){this.$panel.dialog.open({component:"k-block-selector",props:{disabledFieldsets:[t.type],fieldsetGroups:this.fieldsetGroups,fieldsets:this.fieldsets,headline:this.$t("field.blocks.changeType")},on:{submit:e=>{this.convert(e,t),this.$panel.dialog.close()},paste:this.paste}})},copy(t){if(0===this.blocks.length)return!1;if(0===this.selected.length)return!1;let e=[];for(const s of this.blocks)this.selected.includes(s.id)&&e.push(s);if(0===e.length)return!1;this.$helper.clipboard.write(e,t),this.selected=e.map((t=>t.id)),this.$panel.notification.success({message:this.$t("copy.success.multiple",{count:e.length}),icon:"template"})},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=>{let e={};for(const s of Object.values((null==t?void 0:t.tabs)??{}))e={...e,...s.fields};return e},o=this.blocks[i],r=await this.$api.get(this.endpoints.field+"/fieldsets/"+t),a=this.fieldsets[o.type],l=this.fieldsets[t];if(!l)return!1;let c=r.content;const u=n(l),p=n(a);for(const[d,h]of Object.entries(u)){const t=p[d];(null==t?void 0:t.type)===h.type&&(null==(s=null==o?void 0:o.content)?void 0:s[d])&&(c[d]=o.content[d])}this.blocks[i]={...r,id:o.id,content:c},this.save()},deselect(t){const e=this.selected.findIndex((e=>e===t.id));-1!==e&&this.selected.splice(e,1)},deselectAll(){this.selected=[]},async duplicate(t,e){const s={...this.$helper.object.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){const e=this.ref(t);this.selected=[(null==t?void 0:t.id)??this.blocks[0]],null==e||e.focus(),null==e||e.$el.scrollIntoView({block:"nearest"})},focusOrOpen(t){this.fieldsets[t.type].wysiwyg?this.focus(t):this.open(t)},hide(t){Vue.set(t,"isHidden",!0),this.save()},isInputEvent(){const t=document.querySelector(":focus");return null==t?void 0:t.matches("input, textarea, [contenteditable], .k-writer-input")},isLastSelected(t){const[e]=this.selected.slice(-1);return e&&t.id===e},isOnlyInstance:()=>1===document.querySelectorAll(".k-blocks").length,isSelected(t){return this.selected.includes(t.id)},async merge(){if(this.isMergable){const t=this.selected.map((t=>this.find(t)));this.ref(t[0]).$refs.editor.merge(t);for(const e of t.slice(1))this.remove(e);await this.$nextTick(),this.focus(t[0])}},move(t){if(t.from!==t.to){const e=t.draggedData,s=t.toData;if(!1===Object.keys(s.fieldsets).includes(e.type))return!1;if(!0===s.isFull)return!1}return!0},onBlur(){0===this.selected.length&&(this.isMultiSelectKey=!1)},onClickBlock(t,e){e&&this.isMultiSelectKey&&this.onKey(e),this.isMultiSelectKey&&(e.preventDefault(),e.stopPropagation(),this.isSelected(t)?this.deselect(t):this.select(t))},onClickGlobal(t){var e;if("function"==typeof t.target.closest&&(t.target.closest(".k-dialog")||t.target.closest(".k-drawer")))return;const s=document.querySelector(".k-overlay:last-of-type");!1!==this.$el.contains(t.target)||!1!==(null==s?void 0:s.contains(t.target))?s&&!1===(null==(e=this.$el.closest(".k-layout-column"))?void 0:e.contains(t.target))&&this.deselectAll():this.deselectAll()},onCopy(t){return!1!==this.$el.contains(t.target)&&!0!==this.isEditing&&!0!==this.$panel.dialog.isOpen&&!0!==this.isInputEvent(t)&&this.copy(t)},onFocus(t){!1===this.isMultiSelectKey&&(this.selected=[t.id])},async onKey(t){if(this.isMultiSelectKey=t.metaKey||t.ctrlKey||t.altKey,"Escape"===t.code&&this.selected.length>1){const t=this.find(this.selected[0]);await this.$nextTick(),this.focus(t)}},onPaste(t){return!0!==this.isInputEvent(t)&&(!0!==this.isEditing&&!0!==this.$panel.dialog.isOpen&&((0!==this.selected.length||!1!==this.$el.contains(t.target))&&this.paste(t)))},open(t){var e;null==(e=this.$refs["block-"+t.id])||e[0].open()},async paste(t,e){const s=this.$helper.clipboard.read(t);let i=await this.$api.post(this.endpoints.field+"/paste",{html:s});if(void 0===e){let t=this.selected[this.selected.length-1];-1===(e=this.findIndex(t))&&(e=this.blocks.length),e++}if(this.max){const t=this.max-this.blocks.length;i=i.slice(0,t)}this.blocks.splice(e,0,...i),this.save(),this.$panel.notification.success({message:this.$t("paste.success",{count:i.length}),icon:"download"})},pasteboard(){this.$panel.dialog.open({component:"k-block-pasteboard",on:{paste:this.paste}})},prevNext(t){var e;if(this.blocks[t])return null==(e=this.$refs["block-"+this.blocks[t].id])?void 0:e[0]},ref(t){var e,s;return null==(s=this.$refs["block-"+((null==t?void 0:t.id)??(null==(e=this.blocks[0])?void 0:e.id))])?void 0:s[0]},remove(t){const e=this.findIndex(t.id);-1!==e&&(this.deselect(t),this.$delete(this.blocks,e),this.save())},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm.all"),submitButton:this.$t("delete.all")},on:{submit:()=>{this.selected=[],this.blocks=[],this.save(),this.$panel.dialog.close()}}})},removeSelected(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm.selected")},on:{submit:()=>{for(const t of this.selected){const e=this.findIndex(t);-1!==e&&this.$delete(this.blocks,e)}this.deselectAll(),this.save(),this.$panel.dialog.close()}}})},save(){this.$emit("input",this.blocks)},select(t){!1===this.isSelected(t)&&this.selected.push(t.id)},selectDown(){const t=this.selected[this.selected.length-1],e=this.findIndex(t)+1;e=0&&this.select(this.blocks[e])},selectAll(){this.selected=Object.values(this.blocks).map((t=>t.id))},show(t){Vue.set(t,"isHidden",!1),this.save()},async sort(t,e,s){if(s<0)return;let i=this.$helper.object.clone(this.blocks);i.splice(e,1),i.splice(s,0,t),this.blocks=i,this.save(),await this.$nextTick(),this.focus(t)},async split(t,e,s){const i=this.$helper.object.clone(t);i.content={...i.content,...s[0]};const n=await this.$api.get(this.endpoints.field+"/fieldsets/"+t.type);n.content={...n.content,...i.content,...s[1]},this.blocks.splice(e,1,i,n),this.save(),await this.$nextTick(),this.focus(n)},update(t,e){const s=this.findIndex(t.id);if(-1!==s)for(const i in e)Vue.set(this.blocks[s].content,i,e[i]);this.save()}}};const Ge=nt(Je,(function(){var t=this,e=t._self._c;return e("div",{class:["k-blocks",t.$attrs.class],style:t.$attrs.style,attrs:{"data-disabled":t.disabled,"data-empty":0===t.blocks.length}},[t.hasFieldsets?[e("k-draggable",t._b({staticClass:"k-blocks-list",attrs:{"data-multi-select-key":t.isMultiSelectKey},on:{sort:t.save},scopedSlots:t._u([0===t.blocks.length?{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],null,!0)},"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,on:{append:function(e){return t.add(e,i+1)},chooseToAppend:function(e){return t.choose(i+1)},chooseToConvert:function(e){return t.chooseToConvert(s)},chooseToPrepend:function(e){return t.choose(i)},close:function(e){t.isEditing=!1},copy:function(e){return t.copy()},duplicate:function(e){return t.duplicate(s,i)},focus:function(e){return t.onFocus(s)},hide:function(e){return t.hide(s)},merge:function(e){return t.merge()},open:function(e){t.isEditing=!0},paste:function(e){return t.pasteboard()},prepend:function(e){return t.add(e,i)},remove:function(e){return t.remove(s)},removeSelected:t.removeSelected,show:function(e){return t.show(s)},selectDown:t.selectDown,selectUp:t.selectUp,sortDown:function(e){return t.sort(s,i,i+1)},sortUp:function(e){return t.sort(s,i,i-1)},split:function(e){return t.split(s,i,e)},update:function(e){return t.update(s,e)}},nativeOn:{click:function(e){return t.onClickBlock(s,e)}}},"k-block",{...s,disabled:t.disabled,endpoints:t.endpoints,fieldset:t.fieldset(s),isBatched:t.isSelected(s)&&t.selected.length>1,isFull:t.isFull,isHidden:!0===s.isHidden,isLastSelected:t.isLastSelected(s),isMergable:t.isMergable,isSelected:t.isSelected(s),next:t.prevNext(i+1),prev:t.prevNext(i-1)},!1))})),1)]:e("k-empty",{attrs:{icon:"box"}},[t._v(" "+t._s(t.$t("field.blocks.fieldsets.empty"))+" ")])],2)}),[]).exports;const Xe=nt({inheritAttrs:!1,emits:["close","paste","submit"],computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{paste(t){this.$emit("close"),this.$emit("paste",t)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",class:["k-block-importer",t.$attrs.class],style:t.$attrs.style,attrs:{"cancel-button":!1,"submit-button":!1,visible:!0,size:"large"},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},[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.paste.apply(null,arguments)}}})])}),[]).exports,Ze={inheritAttrs:!1,props:{disabledFieldsets:{default:()=>[],type:Array},fieldsets:{type:Object},fieldsetGroups:{type:Object},headline:{type:String},size:{type:String,default:"medium"},value:{default:null,type:String}},emits:["cancel","input","paste","submit"],data:()=>({selected:null}),computed:{groups(){const t={};let e=0;const s=this.fieldsetGroups??{blocks:{label:this.$t("field.blocks.fieldsets.label"),sets:Object.keys(this.fieldsets)}};for(const i in s){const 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)}return t},shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},mounted(){this.$events.on("paste",this.paste)},destroyed(){this.$events.off("paste",this.paste)},methods:{paste(t){this.$emit("paste",t),this.close()}}};const Qe=nt(Ze,(function(){var t=this,e=t._self._c;return e("k-dialog",{class:["k-block-selector",t.$attrs.class],style:t.$attrs.style,attrs:{"cancel-button":!1,size:t.size,"submit-button":!1,visible:!0},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},[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("k-navigate",{staticClass:"k-block-types"},t._l(s.fieldsets,(function(s){return e("k-button",{key:s.name,attrs:{disabled:t.disabledFieldsets.includes(s.type),icon:s.icon??"box",text:s.name,size:"lg"},on:{click:function(e){return t.$emit("submit",s.type)}},nativeOn:{focus:function(e){return t.$emit("input",s.type)}}})})),1)],1)})),e("p",{staticClass:"k-clipboard-hint",domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}})],2)}),[]).exports;const ts=nt({props:{value:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-background-dropdown"},[e("k-button",{attrs:{dropdown:!0,size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.dropdown.toggle()}}},[e("k-color-frame",{attrs:{color:t.value,ratio:"1/1"}})],1),e("k-dropdown-content",{ref:"dropdown",attrs:{"align-x":"end",options:[{text:t.$t("field.blocks.figure.back.plain"),click:"var(--color-white)"},{text:t.$t("field.blocks.figure.back.pattern.light"),click:"var(--pattern-light)"},{text:t.$t("field.blocks.figure.back.pattern.dark"),click:"var(--pattern)"}]},on:{action:function(e){return t.$emit("input",e)}}})],1)}),[]).exports;const es=nt({inheritAttrs:!1,props:{back:String,caption:String,captionMarks:{default:!0,type:[Boolean,Array]},disabled:Boolean,isEmpty:Boolean,emptyIcon:String,emptyText:String},emits:["open","update"]},(function(){var t=this,e=t._self._c;return e("figure",{class:["k-block-figure",t.$attrs.class],style:{"--block-figure-back":t.back,...t.$attrs.style},attrs:{"data-empty":t.isEmpty}},[t.isEmpty?e("k-button",{staticClass:"k-block-figure-empty",attrs:{disabled:t.disabled,icon:t.emptyIcon,text:t.emptyText},on:{click:function(e){return t.$emit("open")}}}):e("span",{staticClass:"k-block-figure-container",attrs:{"data-disabled":t.disabled},on:{dblclick:function(e){return t.$emit("open")}}},[t._t("default")],2),t.caption?e("k-block-figure-caption",{attrs:{disabled:t.disabled,marks:t.captionMarks,value:t.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}}):t._e()],1)}),[]).exports;const ss=nt({props:{disabled:Boolean,marks:[Array,Boolean],value:String}},(function(){var t=this,e=t._self._c;return e("figcaption",{staticClass:"k-block-figure-caption"},[e("k-writer-input",{attrs:{disabled:t.disabled,inline:!0,marks:t.marks,spellcheck:!1,value:t.value},on:{input:function(e){return t.$emit("input",e)}}})],1)}),[]).exports;const is=nt({extends:Re,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,disabled:t.disabled,placeholder:t.placeholder,spellcheck:!1,value:t.content.code,font:"monospace",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-input",{ref:"language",attrs:{disabled:t.disabled,empty:!1,options:t.languages,value:t.content.language,icon:"code",type:"select"},on:{input:function(e){return t.update({language:e})}}})],1):t._e()],1)}),[]).exports;const ns=nt({extends:Re,props:{tabs:Object},data(){return{collapsed:this.state(),tab:Object.keys(this.tabs)[0]}},computed:{fields(){var t;return null==(t=this.tabs[this.tab])?void 0:t.fields},values(){return Object.assign({},this.content)}},methods:{open(){this.$emit("open",this.tab)},state(t){const e=`kirby.fieldsBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return JSON.parse(sessionStorage.getItem(e));sessionStorage.setItem(e,t)},toggle(){this.collapsed=!this.collapsed,this.state(this.collapsed)}}},(function(){var t=this,e=t._self._c;return e("div",{attrs:{"data-collapsed":t.collapsed},on:{dblclick:function(e){!t.fieldset.wysiwyg&&t.$emit("open")}}},[e("header",{staticClass:"k-block-type-fields-header"},[e("k-block-title",{attrs:{content:t.values,fieldset:t.fieldset},nativeOn:{click:function(e){return t.toggle.apply(null,arguments)}}}),t.collapsed?t._e():e("k-drawer-tabs",{attrs:{tab:t.tab,tabs:t.fieldset.tabs},on:{open:function(e){t.tab=e}}})],1),t.collapsed?t._e():e("k-form",{ref:"form",staticClass:"k-block-type-fields-form",attrs:{autofocus:!0,disabled:t.disabled||!t.fieldset.wysiwyg,fields:t.fields,value:t.values},on:{input:function(e){return t.$emit("update",e)}}})],1)}),[]).exports,os={extends:Re,data(){return{back:this.onBack()??"var(--color-white)"}},computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop},isEmpty(){var t;return!(null==(t=this.content.images)?void 0:t.length)},ratio(){return this.content.ratio}},methods:{onBack(t){const e=`kirby.galleryBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return sessionStorage.getItem(e);this.back=t,sessionStorage.setItem(e,t)}}};const rs=nt(os,(function(){var t=this,e=t._self._c;return e("figure",{style:{"--block-back":t.back},attrs:{"data-empty":t.isEmpty}},[e("ul",{on:{dblclick:t.open}},[t.isEmpty?t._l(3,(function(s){return e("li",{key:s,staticClass:"k-block-type-gallery-placeholder"},[e("k-image-frame",{attrs:{ratio:t.ratio}})],1)})):[t._l(t.content.images,(function(s){return e("li",{key:s.id},[e("k-image-frame",{attrs:{ratio:t.ratio,cover:t.crop,src:s.url,srcset:s.image.srcset,alt:s.alt}})],1)})),e("k-block-background-dropdown",{attrs:{value:t.back},on:{input:t.onBack}})]],2),t.content.caption?e("k-block-figure-caption",{attrs:{disabled:t.disabled,marks:t.captionMarks,value:t.content.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}}):t._e()],1)}),[]).exports;const as=nt({extends:Re,inheritAttrs:!1,emits:["append","open","split","update"],computed:{isSplitable(){return this.content.text.length>0&&!1===this.$refs.input.isCursorAtStart&&!1===this.$refs.input.isCursorAtEnd},keys(){return{Enter:()=>!0===this.$refs.input.isCursorAtEnd?this.$emit("append","text"):this.split(),"Mod-Enter":this.split}},levels(){return this.field("level",{options:[]}).options},textField(){return this.field("text",{marks:!0})}},methods:{focus(){this.$refs.input.focus()},merge(t){this.update({text:t.map((t=>t.content.text)).join(" ")})},split(){var t,e;const s=null==(e=(t=this.$refs.input).getSplitContent)?void 0:e.call(t);s&&this.$emit("split",[{text:s[0]},{level:"h"+Math.min(parseInt(this.content.level.slice(1))+1,6),text:s[1]}])}}},(function(){var t=this,e=t._self._c;return e("div",{class:["k-block-type-heading-input",t.$attrs.class],style:t.$attrs.style,attrs:{"data-level":t.content.level}},[e("k-writer-input",t._b({ref:"input",attrs:{disabled:t.disabled,inline:!0,keys:t.keys,value:t.content.text},on:{input:function(e){return t.update({text:e})}}},"k-writer-input",t.textField,!1)),t.levels.length>1?e("k-input",{ref:"level",staticClass:"k-block-type-heading-level",attrs:{disabled:t.disabled,empty:!1,options:t.levels,value:t.content.level,type:"select"},on:{input:function(e){return t.update({level:e})}}}):t._e()],1)}),[]).exports,ls={extends:Re,data(){return{back:this.onBack()??"var(--color-white)"}},computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop??!1},src(){var t,e;return"web"===this.content.location?this.content.src:!!(null==(e=null==(t=this.content.image)?void 0:t[0])?void 0:e.url)&&this.content.image[0].url},ratio(){return this.content.ratio??!1}},methods:{onBack(t){const e=`kirby.imageBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return sessionStorage.getItem(e);this.back=t,sessionStorage.setItem(e,t)}}};const cs=nt(ls,(function(){var t=this,e=t._self._c;return e("k-block-figure",{attrs:{back:t.back,caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.image.placeholder")+" …",disabled:t.disabled,"is-empty":!t.src,"empty-icon":"image"},on:{open:t.open,update:t.update}},[t.src?[t.ratio?e("k-image-frame",{attrs:{ratio:t.ratio,cover:t.crop,alt:t.content.alt,src:t.src}}):e("img",{staticClass:"k-block-type-image-auto",attrs:{alt:t.content.alt,src:t.src}}),e("k-block-background-dropdown",{attrs:{value:t.back},on:{input:t.onBack}})]:t._e()],2)}),[]).exports;const us=nt({},(function(){return this._self._c,this._m(0)}),[function(){var t=this._self._c;return t("div",[t("hr")])}]).exports;const ps=nt({extends:Re,emits:["open","split","update"],computed:{isSplitable(){return this.content.text.length>0&&!1===this.input().isCursorAtStart&&!1===this.input().isCursorAtEnd},keys(){return{"Mod-Enter":this.split}},marks(){return this.field("text",{}).marks}},methods:{focus(){this.$refs.input.focus()},input(){return this.$refs.input.$refs.input.$refs.input},merge(t){this.update({text:t.map((t=>t.content.text)).join("").replaceAll("

          ","")})},split(){var t,e;const s=null==(e=(t=this.input()).getSplitContent)?void 0:e.call(t);s&&this.$emit("split",[{text:s[0].replace(/(
        • <\/p><\/li><\/ul>)$/,"

        ")},{text:s[1].replace(/^(
        • <\/p><\/li>)/,"

            ")}])}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-list-input",attrs:{disabled:t.disabled,keys:t.keys,marks:t.marks,value:t.content.text,type:"list"},on:{input:function(e){return t.update({text:e})}}})}),[]).exports;const ds=nt({extends:Re,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,disabled:t.disabled,placeholder:t.placeholder,spellcheck:!1,value:t.content.text,font:"monospace",type:"textarea"},on:{input:function(e){return t.update({text:e})}}})}),[]).exports;const hs=nt({extends:Re,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-input",{ref:"text",staticClass:"k-block-type-quote-text",attrs:{disabled:t.disabled,inline:t.textField.inline??!1,marks:t.textField.marks,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}}),e("k-writer-input",{ref:"citation",staticClass:"k-block-type-quote-citation",attrs:{disabled:t.disabled,inline:t.citationField.inline??!0,marks:t.citationField.marks,placeholder:t.citationField.placeholder,value:t.content.citation},on:{input:function(e){return t.update({citation:e})}}})],1)}),[]).exports;const ms=nt({extends:Re,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",{class:["k-block-type-table-preview",t.$attrs.class],style:t.$attrs.style,attrs:{columns:t.columns,empty:t.$t("field.structure.empty"),rows:t.rows},nativeOn:{dblclick:function(e){return t.open.apply(null,arguments)}}})}),[]).exports;const fs=nt({extends:Re,emits:["open","split","update"],computed:{component(){const t="k-"+this.textField.type+"-input";return this.$helper.isComponent(t)?t:"k-writer-input"},isSplitable(){return this.content.text.length>0&&!1===this.$refs.input.isCursorAtStart&&!1===this.$refs.input.isCursorAtEnd},keys(){const t={"Mod-Enter":this.split};return!0===this.textField.inline&&(t.Enter=this.split),t},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.input.focus()},merge(t){this.update({text:t.map((t=>t.content.text)).join(this.textField.inline?" ":"")})},split(){var t,e;const s=null==(e=(t=this.$refs.input).getSplitContent)?void 0:e.call(t);s&&("writer"===this.textField.type&&(s[0]=s[0].replace(/(

            <\/p>)$/,""),s[1]=s[1].replace(/^(

            <\/p>)/,"")),this.$emit("split",s.map((t=>({text:t})))))}}},(function(){var t=this;return(0,t._self._c)(t.component,t._b({ref:"input",tag:"component",staticClass:"k-block-type-text-input",attrs:{disabled:t.disabled,keys:t.keys,value:t.content.text},on:{input:function(e){return t.update({text:e})}}},"component",t.textField,!1))}),[]).exports;const gs=nt({extends:Re,computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},location(){return this.content.location},poster(){var t,e;return null==(e=null==(t=this.content.poster)?void 0:t[0])?void 0:e.url},video(){var t,e;return"kirby"===this.content.location?null==(e=null==(t=this.content.video)?void 0:t[0])?void 0:e.url:this.$helper.embed.video(this.content.url??"",!0)}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{staticClass:"k-block-type-video-figure",attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,disabled:t.disabled,"empty-text":t.$t("field.blocks.video.placeholder")+" …","is-empty":!t.video,"empty-icon":"video"},on:{open:t.open,update:t.update}},[e("k-frame",{attrs:{ratio:"16/9"}},[t.video?["kirby"==t.location?e("video",{attrs:{src:t.video,poster:t.poster,controls:""}}):e("iframe",{attrs:{src:t.video,referrerpolicy:"strict-origin-when-cross-origin"}})]:t._e()],2)],1)}),[]).exports,ks={install(t){t.component("k-block",Ke),t.component("k-blocks",Ge),t.component("k-block-options",Ve),t.component("k-block-pasteboard",Xe),t.component("k-block-selector",Qe),t.component("k-block-background-dropdown",ts),t.component("k-block-figure",es),t.component("k-block-figure-caption",ss),t.component("k-block-title",ze),t.component("k-block-type-code",is),t.component("k-block-type-default",Re),t.component("k-block-type-fields",ns),t.component("k-block-type-gallery",rs),t.component("k-block-type-heading",as),t.component("k-block-type-image",cs),t.component("k-block-type-line",us),t.component("k-block-type-list",ps),t.component("k-block-type-markdown",ds),t.component("k-block-type-quote",hs),t.component("k-block-type-table",ms),t.component("k-block-type-text",fs),t.component("k-block-type-video",gs)}};const bs=nt({mixins:[Ee,We],inheritAttrs:!1,data:()=>({opened:[]}),computed:{hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.value.length},isFull(){return this.max&&this.value.length>=this.max},options(){return[{click:()=>this.$refs.blocks.copyAll(),disabled:this.isEmpty,icon:"template",text:this.$t("copy.all")},{click:()=>this.$refs.blocks.pasteboard(),disabled:this.isFull,icon:"download",text:this.$t("paste")},"-",{click:()=>this.$refs.blocks.removeAll(),disabled:this.isEmpty,icon:"trash",text:this.$t("delete.all")}]}},methods:{focus(){this.$refs.blocks.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-blocks-field",t.$attrs.class],style:t.$attrs.style,scopedSlots:t._u([!t.disabled&&t.hasFieldsets?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{staticClass:"input-focus",attrs:{autofocus:t.autofocus,disabled:t.isFull,responsive:!0,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}}),e("k-button",{attrs:{icon:"dots",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:t.options,"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input-validator",t._b({attrs:{value:JSON.stringify(t.value)}},"k-input-validator",{min:t.min,max:t.max,required:t.required},!1),[e("k-blocks",t._b({ref:"blocks",on:{close:function(e){t.opened=e},open:function(e){t.opened=e},input:function(e){return t.$emit("input",e)}}},"k-blocks",t.$props,!1))],1),t.disabled||t.isEmpty||t.isFull||!t.hasFieldsets?t._e():e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}})],1)],1)}),[]).exports,ys={mixins:[_e,Q],props:{columns:{default:1,type:Number},max:Number,min:Number,theme:String,value:{type:Array,default:()=>[]}}},vs={mixins:[Se,ys],data:()=>({selected:[]}),computed:{choices(){return this.options.map(((t,e)=>{const s=this.selected.includes(t.value);return{autofocus:this.autofocus&&0===e,checked:s,disabled:this.disabled||t.disabled||!s&&this.isFull,id:`${this.id}-${e}`,info:t.info,label:t.text,name:this.name??this.id,type:"checkbox",value:t.value}}))},isFull(){return this.max&&this.selected.length>=this.max}},watch:{value:{handler(t){this.selected=Array.isArray(t)?t:[]},immediate:!0}},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},input(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)},select(){this.focus()}}};const $s=nt(vs,(function(){var t=this,e=t._self._c;return e("fieldset",{class:["k-checkboxes-input",t.$attrs.class],style:t.$attrs.style,attrs:{disabled:t.disabled}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("options")))]),e("k-input-validator",t._b({attrs:{value:JSON.stringify(t.selected)}},"k-input-validator",{min:t.min,max:t.max,required:t.required},!1),[e("ul",{staticClass:"k-grid",style:{"--columns":t.columns},attrs:{"data-variant":"choices"}},t._l(t.choices,(function(s,i){return e("li",{key:i},[e("k-choice-input",t._b({on:{input:function(e){return t.input(s.value,e)}}},"k-choice-input",s,!1))],1)})),0)])],1)}),[]).exports,ws={props:{counter:{type:Boolean,default:!0}},computed:{counterOptions(){const t=this.counterValue??this.value;return!(!1===this.counter||this.disabled||!t)&&{count:Array.isArray(t)?t.length:String(t).length,min:this.$props.min??this.$props.minlength,max:this.$props.max??this.$props.maxlength}},counterValue:()=>null}};const xs=nt({mixins:[Ee,Pe,ys,ws],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t,e=this,s=e._self._c;return s("k-field",e._b({class:["k-checkboxes-field",e.$attrs.class],style:e.$attrs.style,attrs:{counter:e.counterOptions,input:e.id+"-0"}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?s("k-checkboxes-input",e._b({ref:"input",on:{input:function(t){return e.$emit("input",t)}}},"k-checkboxes-input",e.$props,!1)):s("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[]).exports,_s={mixins:[_e,z,Y,V,G,X,tt,et,it],props:{ariaLabel:String,preselect:Boolean,type:{default:"text",type:String},value:{type:String}}};const Ss=nt({mixins:[Se,_s],mounted(){this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{select(){this.$el.select()}}},(function(){var t=this;return(0,t._self._c)("input",t._b({directives:[{name:"direction",rawName:"v-direction"}],class:["k-string-input",t.$attrs.class],style:t.$attrs.style,attrs:{"aria-label":t.ariaLabel,"data-font":t.font},on:{input:function(e){return t.$emit("input",e.target.value)}}},"input",{autocomplete:t.autocomplete,autofocus:t.autofocus,disabled:t.disabled,id:t.id,maxlength:t.maxlength,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))}),[]).exports,Cs={mixins:[_s],props:{autocomplete:null,font:null,maxlength:null,minlength:null,pattern:null,spellcheck:null,alpha:{type:Boolean,default:!0},format:{type:String,default:"hex",validator:t=>["hex","rgb","hsl"].includes(t)}}},Os={mixins:[Ss,Cs],watch:{value(){this.validate()}},mounted(){this.validate()},methods:{convert(t){if(!t)return t;try{return this.$library.colors.toString(t,this.format,this.alpha)}catch{const e=document.createElement("div");return e.style.color=t,document.body.append(e),t=window.getComputedStyle(e).color,e.remove(),this.$library.colors.toString(t,this.format,this.alpha)}},convertAndEmit(t){this.emit(this.convert(t))},emit(t){this.$emit("input",t)},onBlur(){this.convertAndEmit(this.value)},onPaste(t){t instanceof ClipboardEvent&&(t=this.$helper.clipboard.read(t,!0)),this.convertAndEmit(t)},async onSave(){var t;this.convertAndEmit(this.value),await this.$nextTick(),null==(t=this.$el.form)||t.requestSubmit()},validate(){let t="";null===this.$library.colors.parse(this.value)&&(t=this.$t("error.validation.color",{format:this.format})),this.$el.setCustomValidity(t)}}};const Ms=nt(Os,(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-colorname-input",attrs:{spellcheck:!1,autocomplete:"off",type:"text"},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{blur:function(e){return t.onBlur.apply(null,arguments)},paste:function(e){return t.onPaste.apply(null,arguments)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?(e.stopPropagation(),e.preventDefault(),t.onSave.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onSave.apply(null,arguments)}]}},"k-string-input",t.$props,!1))}),[]).exports,As={mixins:[Ee,Pe,Cs],inheritAttrs:!1,props:{icon:{type:String,default:"pipette"},mode:{type:String,default:"picker",validator:t=>["picker","input","options"].includes(t)},options:{type:Array,default:()=>[]}},computed:{convertedOptions(){return this.options.map((t=>({...t,value:this.convert(t.value)})))},currentOption(){return this.convertedOptions.find((t=>t.value===this.value))}},methods:{convert(t){return this.$library.colors.toString(t,this.format,this.alpha)}}};const Ds=nt(As,(function(){var t,e=this,s=e._self._c;return s("k-field",e._b({class:["k-color-field",e.$attrs.class],style:e.$attrs.style,attrs:{input:e.id}},"k-field",e.$props,!1),["options"===e.mode?s("k-coloroptions-input",e._b({staticClass:"k-color-field-options",attrs:{options:e.convertedOptions},on:{input:function(t){return e.$emit("input",t)}}},"k-coloroptions-input",e.$props,!1)):s("k-input",e._b({attrs:{type:"color"},scopedSlots:e._u([{key:"before",fn:function(){return["picker"===e.mode?[s("button",{staticClass:"k-color-field-picker-toggle",attrs:{disabled:e.disabled,type:"button"},on:{click:function(t){return e.$refs.picker.toggle()}}},[s("k-color-frame",{attrs:{color:e.value}})],1),s("k-dropdown-content",{ref:"picker",staticClass:"k-color-field-picker"},[s("k-colorpicker-input",e._b({ref:"color",attrs:{options:e.convertedOptions},on:{input:function(t){return e.$emit("input",t)}},nativeOn:{click:function(t){t.stopPropagation()}}},"k-colorpicker-input",e.$props,!1))],1)]:s("k-color-frame",{attrs:{color:e.value}})]},proxy:!0},{key:"default",fn:function(){return[s("k-colorname-input",e._b({on:{input:function(t){return e.$emit("input",t)}}},"k-colorname-input",e.$props,!1))]},proxy:!0},(null==(t=e.currentOption)?void 0:t.text)?{key:"after",fn:function(){return[s("span",{domProps:{innerHTML:e._s(e.currentOption.text)}})]},proxy:!0}:null,"picker"===e.mode?{key:"icon",fn:function(){return[s("k-button",{staticClass:"k-input-icon-button",attrs:{icon:e.icon},on:{click:function(t){return t.stopPropagation(),e.$refs.picker.toggle()}}})]},proxy:!0}:null],null,!0)},"k-input",e.$props,!1))],1)}),[]).exports,js={props:{max:String,min:String,value:String}},Es={mixins:[_e,js],props:{display:{type:String,default:"DD.MM.YYYY"},step:{type:Object,default:()=>({size:1,unit:"day"})},type:{type:String,default:"date"}}},Ts={mixins:[Se,Es],emits:["input","focus","submit"],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}},methods:{async 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),await this.$nextTick(),this.select(n)},commit(t){this.dt=t,this.formatted=this.pattern.format(t),this.validate()},emit(t){this.$emit("input",this.toISO(t))},onArrowDown(){this.alter("subtract")},onArrowUp(){this.alter("add")},onBlur(){const t=this.parse();this.commit(t),this.emit(t)},async onEnter(){this.onBlur(),await 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)},async onTab(t){if(""==this.$el.value)return;this.onBlur(),await this.$nextTick();const e=this.selection();if(this.$el&&e.start===this.$el.selectionStart&&e.end===this.$el.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{if(this.$el&&this.$el.selectionStart==e.end+1&&e.index==this.pattern.parts.length-1)return;if(this.$el&&this.$el.selectionEnd-1>e.end){const t=this.pattern.at(this.$el.selectionEnd,this.$el.selectionEnd);this.select(this.pattern.parts[t.index])}else this.select(this.pattern.parts[e.index])}t.preventDefault()},parse(){const t=this.$library.dayjs.interpret(this.$el.value,this.inputType);return this.round(t)},round(t){return null==t?void 0:t.round(this.rounding.unit,this.rounding.size)},select(t){var e;t??(t=this.selection()),null==(e=this.$el)||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.$el.selectionStart,this.$el.selectionEnd)},toDatetime(t){return this.round(this.$library.dayjs.iso(t,this.inputType))},toISO(t){return null==t?void 0:t.toISO(this.inputType)},validate(){var t,e,s;const i=[];this.required&&!this.dt&&i.push(this.$t("error.validation.required")),this.min&&!1===(null==(t=this.dt)?void 0:t.validate(this.min,"min",this.rounding.unit))&&i.push(this.$t("error.validation.date.after",{date:this.min})),this.max&&!1===(null==(e=this.dt)?void 0:e.validate(this.max,"max",this.rounding.unit))&&i.push(this.$t("error.validation.date.before",{date:this.max})),null==(s=this.$el)||s.setCustomValidity(i.join(", "))}}};const Ls=nt(Ts,(function(){var t=this;return(0,t._self._c)("input",{directives:[{name:"direction",rawName:"v-direction"}],class:["k-text-input",`k-${t.type}-input`,t.$attrs.class],style:t.$attrs.style,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){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,"s",void 0,e.key,void 0)?null:e.metaKey?(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.ctrlKey?(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:t.onTab.apply(null,arguments)}]}})}),[]).exports,Bs={mixins:[Ee,Pe,Es],inheritAttrs:!1,props:{calendar:{type:Boolean,default:!0},icon:{type:String,default:"calendar"},time:{type:[Boolean,Object],default:()=>({})},times:{type:Boolean,default:!0}},emits:["input","submit"],data(){return{iso:this.toIso(this.value)}},computed:{isEmpty(){return this.time?!this.iso.date||!this.iso.time:!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())??"")},onDateInput(t){t&&!this.iso.time&&(this.iso.time=this.now().time),this.iso.date=t,this.onInput()},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}}}};const Is=nt(Bs,(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-date-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("div",{ref:"body",staticClass:"k-date-field-body",attrs:{"data-has-time":Boolean(t.time)}},[e("k-input",t._b({ref:"dateInput",attrs:{type:"date"},on:{input:t.onDateInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.calendar?{key:"icon",fn:function(){return[e("k-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.icon,title:t.$t("date.select")},on:{click:function(e){return t.$refs.calendar.toggle()}}}),e("k-dropdown-content",{ref:"calendar",attrs:{"align-x":"end"}},[e("k-calendar",{attrs:{value:t.iso.date,min:t.min,max:t.max},on:{input:t.onDateInput}})],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,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-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.time.icon??"clock",title:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{"align-x":"end"}},[e("k-timeoptions-input",{attrs:{display:t.time.display,value:t.value},on:{input:t.onTimesInput}})],1)]},proxy:!0}:null],null,!0)}):t._e()],1)])}),[]).exports,qs={mixins:[_s],props:{autocomplete:{type:String,default:"email"},placeholder:{type:String,default:()=>window.panel.$t("email.placeholder")}}};const Ps=nt({mixins:[Ss,qs]},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-email-input",attrs:{type:"email"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[]).exports;const Ns=nt({mixins:[Ee,Pe,qs],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({class:["k-email-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"email"},on:{input:function(e){return t.$emit("input",e)}},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,title:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1))],1)}),[]).exports,Fs={type:"model",mixins:[Ee,Y,J],inheritAttrs:!1,props:{empty:String,info:String,link:Boolean,max:Number,min:Number,multiple:Boolean,parent:String,search:Boolean,size:String,text:String,value:{type:Array,default:()=>[]}},emits:["change","input"],data(){return{selected:this.value}},computed:{buttons(){return[{autofocus:this.autofocus,text:this.$t("select"),icon:"checklist",responsive:!0,click:()=>this.open()}]},collection(){return{empty:this.emptyProps,items:this.selected,layout:this.layout,link:this.link,size:this.size,sortable:!this.disabled&&this.selected.length>1,theme:this.disabled?"disabled":null}},hasDropzone:()=>!1,more(){return!this.max||this.max>this.selected.length}},watch:{value(t){this.selected=t}},methods:{drop(){},focus(){},onInput(){this.$emit("input",this.selected)},open(){if(this.disabled)return!1;this.$panel.dialog.open({component:`k-${this.$options.type}-dialog`,props:{endpoint:this.endpoints.field,hasSearch:this.search,max:this.max,multiple:this.multiple,value:this.selected.map((t=>t.id))},on:{submit:t=>{this.select(t),this.$panel.dialog.close()}}})},remove(t){this.selected.splice(t,1),this.onInput()},removeById(t){this.selected=this.selected.filter((e=>e.id!==t)),this.onInput()},select(t){if(0===t.length)return this.selected=[],void this.onInput();this.selected=this.selected.filter((e=>t.find((t=>t.id===e.id))));for(const e of t)this.selected.find((t=>e.id===t.id))||this.selected.push(e);this.onInput()}}};const zs=nt(Fs,(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-models-field",`k-${t.$options.type}-field`,t.$attrs.class],style:t.$attrs.style,scopedSlots:t._u([t.disabled?null:{key:"options",fn:function(){return[e("k-button-group",{ref:"buttons",staticClass:"k-field-options",attrs:{buttons:t.buttons,layout:"collapsed",size:"xs",variant:"filled"}})]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-dropzone",{attrs:{disabled:!t.hasDropzone},on:{drop:t.drop}},[e("k-input-validator",t._b({attrs:{value:JSON.stringify(t.value)}},"k-input-validator",{min:t.min,max:t.max,required:t.required},!1),[e("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([t.disabled?null:{key:"options",fn:function({index:s}){return[e("k-button",{attrs:{title:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(s)}}})]}}],null,!0)},"k-collection",t.collection,!1))],1)],1)],1)}),[]).exports;const Ys=nt({extends:zs,type:"files",props:{uploads:[Boolean,Object,Array]},computed:{buttons(){const t=zs.computed.buttons.call(this);return this.hasDropzone&&t.unshift({autofocus:this.autofocus,text:this.$t("upload"),responsive:!0,icon:"upload",click:()=>this.$panel.upload.pick(this.uploadOptions)}),t},emptyProps(){return{icon:"image",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.files.empty"):this.$t("field.files.empty.single"))}},hasDropzone(){return!this.disabled&&this.more&&this.uploads},uploadOptions(){return{accept:this.uploads.accept,max:this.max,multiple:this.multiple,preview:this.uploads.preview,url:this.$panel.urls.api+"/"+this.endpoints.field+"/upload",on:{done:t=>{!1===this.multiple&&(this.selected=[]);for(const e of t)void 0===this.selected.find((t=>t.id===e.id))&&this.selected.push(e);this.onInput(),this.$events.emit("file.upload"),this.$events.emit("model.update")}}}}},mounted(){this.$events.on("file.delete",this.removeById)},destroyed(){this.$events.off("file.delete",this.removeById)},methods:{drop(t){return!1!==this.uploads&&this.$panel.upload.open(t,this.uploadOptions)}}},null,null).exports;const Rs=nt({},(function(){return(0,this._self._c)("div",{staticClass:"k-field k-gap-field"})}),[]).exports;const Hs=nt({mixins:[U,W],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("div",{class:["k-headline-field",t.$attrs.class],style:t.$attrs.style},[e("k-headline",{staticClass:"h2"},[t._v(" "+t._s(t.label)+" ")]),t.help?e("footer",{staticClass:"k-field-footer"},[e("k-text",{staticClass:"k-help k-field-help",attrs:{html:t.help}})],1):t._e()],1)}),[]).exports;const Vs=nt({mixins:[U,W],props:{icon:String,text:String,theme:{type:String,default:"info"}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-field k-info-field"},[t.label?e("k-headline",[t._v(t._s(t.label))]):t._e(),e("k-box",{attrs:{icon:t.icon,theme:t.theme}},[e("k-text",{attrs:{html:t.text}})],1),t.help?e("footer",{staticClass:"k-field-footer"},[e("k-text",{staticClass:"k-help k-field-help",attrs:{html:t.help}})],1):t._e()],1)}),[]).exports,Us={props:{endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean}};const Ks=nt({mixins:[Us],props:{blocks:Array,width:{type:String,default:"1/1"}},emits:["input"]},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column k-layout-column",style:{"--width":t.width},attrs:{id:t.id,tabindex:"0"},on:{dblclick:function(e){return t.$refs.blocks.choose(t.blocks.length)}}},[e("k-blocks",t._b({ref:"blocks",on:{input:function(e){return t.$emit("input",e)}},nativeOn:{dblclick:function(t){t.stopPropagation()}}},"k-blocks",{endpoints:t.endpoints,fieldsets:t.fieldsets,fieldsetGroups:t.fieldsetGroups,group:"layout",value:t.blocks},!1))],1)}),[]).exports,Ws={mixins:[Us,H],props:{columns:Array,layouts:{type:Array,default:()=>[["1/1"]]},settings:Object}};const Js=nt({mixins:[Ws],props:{attrs:[Array,Object]},emits:["append","change","copy","duplicate","prepend","remove","select","updateAttrs","updateColumn"],computed:{options(){return[{click:()=>this.$emit("prepend"),icon:"angle-up",text:this.$t("insert.before")},{click:()=>this.$emit("append"),icon:"angle-down",text:this.$t("insert.after")},"-",{click:()=>this.openSettings(),icon:"settings",text:this.$t("settings"),when:!1===this.$helper.object.isEmpty(this.settings)},{click:()=>this.$emit("duplicate"),icon:"copy",text:this.$t("duplicate")},{click:()=>this.$emit("change"),disabled:1===this.layouts.length,icon:"dashboard",text:this.$t("field.layout.change")},"-",{click:()=>this.$emit("copy"),icon:"template",text:this.$t("copy")},{click:()=>this.$emit("paste"),icon:"download",text:this.$t("paste.after")},"-",{click:()=>this.remove(),icon:"trash",text:this.$t("field.layout.delete")}]},tabs(){let t=this.settings.tabs;for(const[e,s]of Object.entries(t))for(const i in s.fields)t[e].fields[i].endpoints={field:this.endpoints.field+"/fields/"+i,section:this.endpoints.section,model:this.endpoints.model};return t}},methods:{openSettings(){this.$panel.drawer.open({component:"k-form-drawer",props:{icon:"settings",tabs:this.tabs,title:this.$t("settings"),value:this.attrs},on:{input:t=>this.$emit("updateAttrs",t)}})},remove(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.layout.delete.confirm")},on:{submit:()=>{this.$emit("remove"),this.$panel.dialog.close()}}})}}},(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,on:{input:function(e){return t.$emit("updateColumn",{column:s,columnIndex:i,blocks:e})}}},"k-layout-column",{...s,endpoints:t.endpoints,fieldsetGroups:t.fieldsetGroups,fieldsets:t.fieldsets},!1))})),1),t.disabled?t._e():e("nav",{staticClass:"k-layout-toolbar"},[t.settings?e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{title:t.$t("settings"),icon:"settings"},on:{click:t.openSettings}}):t._e(),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:{options:t.options,"align-x":"end"}}),e("k-sort-handle")],1)],1)}),[]).exports,Gs={mixins:[Ws,K],props:{empty:String,min:Number,max:Number,selector:Object,value:{type:Array,default:()=>[]}}},Xs={mixins:[Gs],emits:["input"],data(){return{current:null,nextIndex:null,rows:this.value,selected:null}},computed:{draggableOptions(){return{handle:!0,list:this.rows}},hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0}},watch:{value(){this.rows=this.value}},methods:{copy(t,e){if(0===this.rows.length)return!1;const s=void 0!==e?this.rows[e]:this.rows;this.$helper.clipboard.write(JSON.stringify(s),t),this.$panel.notification.success({message:this.$t("copy.success.multiple",{count:s.length??1}),icon:"template"})},change(t,e){const s=e.columns.map((t=>t.width)),i=this.layouts.findIndex((t=>t.toString()===s.toString()));this.$panel.dialog.open({component:"k-layout-selector",props:{label:this.$t("field.layout.change"),layouts:this.layouts,selector:this.selector,value:this.layouts[i]},on:{submit:s=>{this.onChange(s,i,{rowIndex:t,layoutIndex:i,layout:e}),this.$panel.dialog.close()}}})},duplicate(t,e){const s=this.$helper.object.clone(e),i=this.updateIds(s);this.rows.splice(t+1,0,...i),this.save()},async onAdd(t){let e=await this.$api.post(this.endpoints.field+"/layout",{columns:t});this.rows.splice(this.nextIndex,0,e),this.save()},async onChange(t,e,s){if(e===this.layouts[s.layoutIndex])return;const i=s.layout,n=await this.$api.post(this.endpoints.field+"/layout",{attrs:i.attrs,columns:t}),o=i.columns.filter((t=>{var e;return(null==(e=null==t?void 0:t.blocks)?void 0:e.length)>0})),r=[];if(0===o.length)r.push(n);else{const t=Math.ceil(o.length/n.columns.length)*n.columns.length;for(let e=0;e{var i;return t.blocks=(null==(i=o[s+e])?void 0:i.blocks)??[],t})),t.columns.filter((t=>{var e;return null==(e=null==t?void 0:t.blocks)?void 0:e.length})).length&&r.push(t)}}this.rows.splice(s.rowIndex,1,...r),this.save()},async paste(t,e=this.rows.length){let s=await this.$api.post(this.endpoints.field+"/layout/paste",{json:this.$helper.clipboard.read(t)});s.length&&(this.rows.splice(e,0,...s),this.save()),this.$panel.notification.success({message:this.$t("paste.success",{count:s.length}),icon:"download"})},pasteboard(t){this.$panel.dialog.open({component:"k-block-pasteboard",on:{paste:e=>this.paste(e,t)}})},remove(t){const e=this.rows.findIndex((e=>e.id===t.id));-1!==e&&this.$delete(this.rows,e),this.save()},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.layout.delete.confirm.all")},on:{submit:()=>{this.rows=[],this.save(),this.$panel.dialog.close()}}})},save(){this.$emit("input",this.rows)},select(t){if(this.nextIndex=t,1===this.layouts.length)return this.onAdd(this.layouts[0]);this.$panel.dialog.open({component:"k-layout-selector",props:{layouts:this.layouts,selector:this.selector,value:null},on:{submit:t=>{this.onAdd(t),this.$panel.dialog.close()}}})},updateAttrs(t,e){this.rows[t].attrs=e,this.save()},updateColumn(t){this.rows[t.index].columns[t.columnIndex].blocks=t.blocks,this.save()},updateIds(t){return!1===Array.isArray(t)&&(t=[t]),t.map((t=>(t.id=this.$helper.uuid(),t.columns=t.columns.map((t=>(t.id=this.$helper.uuid(),t.blocks=t.blocks.map((t=>(t.id=this.$helper.uuid(),t))),t))),t)))}}};const Zs=nt(Xs,(function(){var t=this,e=t._self._c;return e("div",[t.hasFieldsets&&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,on:{append:function(e){return t.select(i+1)},change:function(e){return t.change(i,s)},copy:function(e){return t.copy(e,i)},duplicate:function(e){return t.duplicate(i,s)},paste:function(e){return t.pasteboard(i+1)},prepend:function(e){return t.select(i)},remove:function(e){return t.remove(s)},select:function(e){t.selected=s.id},updateAttrs:function(e){return t.updateAttrs(i,e)},updateColumn:function(e){return t.updateColumn({layout:s,index:i,...e})}}},"k-layout",{...s,disabled:t.disabled,endpoints:t.endpoints,fieldsetGroups:t.fieldsetGroups,fieldsets:t.fieldsets,isSelected:t.selected===s.id,layouts:t.layouts,settings:t.settings},!1))})),1)]:!1===t.hasFieldsets?e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"}},[t._v(" "+t._s(t.$t("field.blocks.fieldsets.empty"))+" ")]):e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"},on:{click:function(e){return t.select(0)}}},[t._v(" "+t._s(t.empty??t.$t("field.layout.empty"))+" ")])],2)}),[]).exports;const Qs=nt({mixins:[Ee,Gs,Y],inheritAttrs:!1,computed:{hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.value.length},options(){return[{click:()=>this.$refs.layouts.copy(),disabled:this.isEmpty,icon:"template",text:this.$t("copy.all")},{click:()=>this.$refs.layouts.pasteboard(),icon:"download",text:this.$t("paste")},"-",{click:()=>this.$refs.layouts.removeAll(),disabled:this.isEmpty,icon:"trash",text:this.$t("delete.all")}]}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-layout-field",t.$attrs.class],style:t.$attrs.style,scopedSlots:t._u([!t.disabled&&t.hasFieldsets?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{staticClass:"input-focus",attrs:{autofocus:t.autofocus,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.layouts.select(0)}}}),e("k-button",{attrs:{icon:"dots",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:t.options,"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input-validator",t._b({attrs:{value:JSON.stringify(t.value)}},"k-input-validator",{min:t.min,max:t.max,required:t.required},!1),[e("k-layouts",t._b({ref:"layouts",on:{input:function(e){return t.$emit("input",e)}}},"k-layouts",t.$props,!1))],1),!t.disabled&&t.hasFieldsets?e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.layouts.select(t.value.length)}}})],1):t._e()],1)}),[]).exports;const ti=nt({},(function(){return(0,this._self._c)("hr",{staticClass:"k-line-field"})}),[]).exports,ei={mixins:[{mixins:[Ee,Pe,_e,Q],props:{value:{default:"",type:String}}}],inheritAttrs:!1,data:()=>({linkType:null,linkValue:null,expanded:!1}),computed:{activeTypes(){return this.$helper.link.types(this.options)},activeTypesOptions(){const t=[];for(const e in this.activeTypes)t.push({click:()=>this.switchType(e),current:e===this.currentType.id,icon:this.activeTypes[e].icon,label:this.activeTypes[e].label});return t},currentType(){return this.activeTypes[this.linkType]??Object.values(this.activeTypes)[0]}},watch:{value:{async handler(t,e){if(t===e||t===this.linkValue)return;const s=this.$helper.link.detect(t,this.activeTypes);s&&(this.linkType=s.type,this.linkValue=s.link)},immediate:!0}},mounted(){this.$events.on("click",this.onOutsideClick)},destroyed(){this.$events.off("click",this.onOutsideClick)},methods:{clear(){this.linkValue="",this.$emit("input","")},focus(){var t;null==(t=this.$refs.input)||t.focus()},onInput(t){const e=(null==t?void 0:t.trim())??"";if(this.linkType??(this.linkType=this.currentType.id),this.linkValue=e,!e.length)return this.clear();this.$emit("input",this.currentType.value(e))},onOutsideClick(t){!1===this.$el.contains(t.target)&&(this.expanded=!1)},removeModel(){this.clear(),this.expanded=!1},selectModel(t){t.uuid?this.onInput(t.uuid):(this.switchType("url"),this.onInput(t.url))},async switchType(t){t!==this.currentType.id&&(this.linkType=t,this.clear(),"page"===this.currentType.id||"file"===this.currentType.id?this.expanded=!0:this.expanded=!1,await this.$nextTick(),this.focus())},toggle(){this.expanded=!this.expanded}}};const si=nt(ei,(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-link-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({attrs:{icon:!1}},"k-input",t.$props,!1),[e("div",{staticClass:"k-link-input-header"},[e("k-button",{staticClass:"k-link-input-toggle",attrs:{disabled:t.disabled,dropdown:!t.disabled&&t.activeTypesOptions.length>1,icon:t.currentType.icon,variant:"filled"},on:{click:function(e){t.activeTypesOptions.length>1?t.$refs.types.toggle():t.toggle()}}},[t._v(" "+t._s(t.currentType.label)+" ")]),e("k-dropdown-content",{ref:"types",attrs:{options:t.activeTypesOptions}}),"page"===t.currentType.id||"file"===t.currentType.id?e("div",{staticClass:"k-link-input-model",on:{click:t.toggle}},[e("k-link-field-preview",{attrs:{removable:!0,type:t.currentType.id,value:t.value},on:{remove:t.removeModel},scopedSlots:t._u([{key:"placeholder",fn:function(){return[e("k-button",{staticClass:"k-link-input-model-placeholder"},[t._v(" "+t._s(t.currentType.placeholder)+" ")])]},proxy:!0}],null,!1,3171606015)}),e("k-button",{staticClass:"k-link-input-model-toggle",attrs:{icon:"bars"}})],1):e("k-"+t.currentType.input+"-input",{ref:"input",tag:"component",attrs:{id:t.id,disabled:t.disabled,pattern:t.currentType.pattern??null,placeholder:t.currentType.placeholder,required:t.required,value:t.linkValue},on:{input:t.onInput}})],1),"page"===t.currentType.id?e("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"k-link-input-body",attrs:{"data-type":"page"}},[e("div",{staticClass:"k-page-browser"},[e("k-page-tree",{attrs:{current:t.$helper.link.getPageUUID(t.value),root:!1},on:{select:function(e){return t.selectModel(e)}}})],1)]):"file"===t.currentType.id?e("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"k-link-input-body",attrs:{"data-type":"file"}},[e("k-file-browser",{attrs:{opened:t.$panel.view.props.model.uuid??t.$panel.view.props.model.id,selected:t.$helper.link.getFileUUID(t.value)},on:{select:function(e){return t.selectModel(e)}}})],1):t._e()])],1)}),[]).exports;const ii=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),ni=t=>e=>{if((t=>t instanceof o)(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}}},oi=(t,e,s={})=>{const i=ni(e)(t.selection)||ii((t=>t.type===e))(t.selection);return 0!==gt(s)&&i?i.node.hasMarkup(e,{...i.node.attrs,...s}):!!i};function ri(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,a=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:{}},insertNode:function(t,e,s,i){return(n,o)=>{o(n.tr.replaceSelectionWith(t.create(e,s,i)).scrollIntoView())}},markInputRule:function(t,s,i){return new e(t,((t,e,n,o)=>{const r=i instanceof Function?i(e):i,{tr:a}=t,l=e.length-1;let c=o,u=n;if(e[l]){const i=n+e[0].indexOf(e[l-1]),r=i+e[l-1].length-1,p=i+e[l-1].lastIndexOf(e[l]),d=p+e[l].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:e}=t.mark.type;return e.find((t=>t.name===s.name))})).filter((t=>t.end>i));if(h.length)return!1;di&&a.delete(i,p),u=i,c=u+e[l].length}return a.addMark(u,c,s.create(r)),a.removeStoredMark(s),a}))},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,o){const r=(s,i)=>{const a=[];return s.forEach((s=>{var n;if(s.isText){const{text:r,marks:l}=s;let c,u=0;const p=!!l.filter((t=>"link"===t.type.name))[0];for(;!p&&null!==(c=t.exec(r));)if((null==(n=null==i?void 0:i.type)?void 0:n.allowsMarkType(e))&&c[1]){const t=c.index,i=t+c[0].length,n=t+c[0].indexOf(c[1]),r=n+c[1].length,l=o instanceof Function?o(c):o;t>0&&a.push(s.cut(u,t)),a.push(s.cut(n,r).mark(e.create(l).addToSet(s.marks))),u=i}unew i(r(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:oi,nodeInputRule:function(t,s,i){return new e(t,((t,e,n,o)=>{const r=i instanceof Function?i(e):i,{tr:a}=t;return e[0]&&a.replaceWith(n,o,s.create(r)),a}))},pasteRule:function(t,e,o){const r=s=>{const i=[];return s.forEach((s=>{if(s.isText){const{text:n}=s;let r,a=0;do{if(r=t.exec(n),r){const t=r.index,n=t+r[0].length,l=o instanceof Function?o(r[0]):o;t>0&&i.push(s.cut(a,t)),i.push(s.cut(t,n).mark(e.create(l).addToSet(s.marks))),a=n}}while(r);anew i(r(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:a,empty:l}=n;if(l){const e=ri(a,t);o=e.from,r=e.to}return i.removeMark(o,r,t),s(i)}},toggleBlockType:function(t,e,s={}){return(i,n,o)=>oi(i,t,s)?r(e)(i,n,o):r(t,s)(i,n,o)},toggleList:function(t,e){return(s,i,n)=>{const{schema:o,selection:r}=s,{$from:c,$to:u}=r,p=c.blockRange(u);if(!p)return!1;const d=ii((t=>ai(t,o)))(r);if(p.depth>=1&&d&&p.depth-d.depth<=1){if(d.node.type===t)return a(e)(s,i,n);if(ai(d.node,o)&&t.validContent(d.node.content)){const{tr:e}=s;return e.setNodeMarkup(d.pos,t),i&&i(e),!1}}return l(t)(s,i,n)}},toggleWrap:function(t,e={}){return(s,i,n)=>oi(s,t,e)?c(s,i):u(t,e)(s,i,n)},updateMark:function(t,e){return(s,i)=>{const{tr:n,selection:o,doc:r}=s,{ranges:a,empty:l}=o;if(l){const{from:s,to:i}=ri(o.$from,t);r.rangeHasMark(s,i,t)&&n.removeMark(s,i,t),n.addMark(s,i,t.create(e))}else a.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 ci{emit(t,...e){this._callbacks=this._callbacks??{};const s=this._callbacks[t]??[];for(const i of s)i.apply(this,e);return 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}}class ui{constructor(t=[],e){for(const s of t)s.bindEditor(e),s.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={},a=i.commands({schema:t,utils:li,...["node","mark"].includes(o)?{type:t[`${o}s`][n]}:{}}),l=(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}};if("object"==typeof a)for(const[t,e]of Object.entries(a))l(t,e);else l(n,a);return{...s,...r}}),{})}buttons(t="mark"){const e={};for(const s of this.extensions)if(s.type===t&&s.button)if(Array.isArray(s.button))for(const t of s.button)e[t.id??t.name]=t;else e[s.name]=s.button;return 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:li})))}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:li})))}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=>y(t)))}get marks(){return this.extensions.filter((t=>"mark"===t.type)).reduce(((t,{name:e,schema:s})=>({...t,[e]:s})),{})}get markViews(){return this.extensions.filter((t=>["mark"].includes(t.type))).filter((t=>t.view)).reduce(((t,{name:e,view:s})=>({...t,[e]:s})),{})}get nodes(){return this.extensions.filter((t=>"node"===t.type)).reduce(((t,{name:e,schema:s})=>({...t,[e]:s})),{})}get nodeViews(){return this.extensions.filter((t=>["node"].includes(t.type))).filter((t=>t.view)).reduce(((t,{name:e,view: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 s?t:new s(t)))}}class pi{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 di extends pi{constructor(t={}){super(t)}get type(){return"node"}get schema(){return{}}commands(){return{}}}class hi extends di{get defaults(){return{inline:!1}}get name(){return"doc"}get schema(){return{content:this.options.inline?"inline*":"block+"}}}class mi extends di{get button(){return{id:this.name,icon:"paragraph",label:window.panel.$t("toolbar.button.paragraph"),name:this.name,separator:!0}}commands({utils:t,schema:e,type:s}){return{paragraph:()=>this.editor.activeNodes.includes("bulletList")?t.toggleList(e.nodes.bulletList,e.nodes.listItem):this.editor.activeNodes.includes("orderedList")?t.toggleList(e.nodes.orderedList,e.nodes.listItem):this.editor.activeNodes.includes("quote")?t.toggleWrap(e.nodes.quote):t.setBlockType(s)}}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}get name(){return"paragraph"}}let fi=class extends di{get name(){return"text"}get schema(){return{group:"inline"}}};class gi extends ci{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!0!==this.options.useBuiltInExtensions?[]:[new hi({inline:this.options.inline}),new fi,new mi]}buttons(t){return this.extensions.buttons(t)}clearContent(t=!1){this.setContent(this.options.emptyDocument,t)}command(t,...e){var s,i;null==(i=(s=this.commands)[t])||i.call(s,...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 v.fromSchema(this.schema).parse(i,e)}return!1}createEvents(){const t=this.options.events??{};for(const[e,s]of Object.entries(t))this.on(e,s);return t}createExtensions(){return new ui([...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 s({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}createMarkViews(){return this.extensions.markViews}createNodes(){return this.extensions.nodes}createNodeViews(){return this.extensions.nodeViews}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createPlugins(){return this.extensions.plugins({schema:this.schema})}createSchema(){return new $({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return w.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,x({rules:this.inputRules}),...this.pasteRules,...this.keymaps,y({Backspace:O}),y(M),this.createFocusEvents()]})}createView(){return new _(this.element,{dispatchTransaction:this.dispatchTransaction.bind(this),attributes:{class:"k-text"},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)},markViews:this.createMarkViews(),nodeViews:this.createNodeViews(),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.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(t=this.state.doc.content){const e=document.createElement("div"),s=S.fromSchema(this.schema).serializeFragment(t);return e.appendChild(s),this.options.inline&&e.querySelector("p")?e.querySelector("p").innerHTML:e.innerHTML}getHTMLStartToSelection(){const t=this.state.doc.slice(0,this.selection.head).content;return this.getHTML(t)}getHTMLSelectionToEnd(){const t=this.state.doc.slice(this.selection.head).content;return this.getHTML(t)}getHTMLStartToSelectionToEnd(){return[this.getHTMLStartToSelection(),this.getHTMLSelectionToEnd()]}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.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)}insertText(t,e=!1){const{tr:s}=this.state,i=s.insertText(t);if(this.view.dispatch(i),e){const e=s.selection.from,i=e-t.length;this.setSelection(i,e)}}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 li.removeMark(this.schema.marks[t])(this.state,this.view.dispatch)}get selection(){return this.state.selection}get selectionAtEnd(){return C.atEnd(this.state.doc)}get selectionIsAtEnd(){return this.selection.head===this.selectionAtEnd.head}get selectionAtStart(){return C.atStart(this.state.doc)}get selectionIsAtStart(){return this.selection.head===this.selectionAtStart.head}selectionAtPosition(t=null){return null===t?this.selection:"start"===t||!0===t?this.selectionAtStart:"end"===t?this.selectionAtEnd:{from:t,to:t}}setActiveNodesAndMarks(){this.activeMarks=Object.values(this.schema.marks).filter((t=>li.markIsActive(this.state,t))).map((t=>t.name)),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce(((t,[e,s])=>({...t,[e]:li.getMarkAttrs(this.state,s)})),{}),this.activeNodes=Object.values(this.schema.nodes).filter((t=>li.nodeIsActive(this.state,t))).map((t=>t.name)),this.activeNodeAttrs=Object.entries(this.schema.nodes).reduce(((t,[e,s])=>({...t,[e]:li.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=li.minMax(t,0,s.content.size),o=li.minMax(e,0,s.content.size),r=C.create(s,n,o),a=i.setSelection(r);this.view.dispatch(a)}get state(){var t;return null==(t=this.view)?void 0:t.state}toggleMark(t){if(this.schema.marks[t])return li.toggleMark(this.schema.marks[t])(this.state,this.view.dispatch)}updateMark(t,e){if(this.schema.marks[t])return li.updateMark(this.schema.marks[t],e)(this.state,this.view.dispatch)}}class ki extends pi{command(){return()=>{}}remove(){this.editor.removeMark(this.name)}get schema(){return{}}get type(){return"mark"}toggle(){return this.editor.toggleMark(this.name)}update(t){this.editor.updateMark(this.name,t)}}class bi extends ki{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 yi extends ki{get button(){return{icon:"clear",label:window.panel.$t("toolbar.button.clear")}}commands(){return()=>this.clear()}clear(){const{state:t}=this.editor,{from:e,to:s}=t.tr.selection;for(const i of this.editor.activeMarks){const n=t.schema.marks[i],o=this.editor.state.tr.removeMark(e,s,n);this.editor.view.dispatch(o)}}get name(){return"clear"}}let vi=class extends ki{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 $i extends ki{get button(){return{icon:"email",label:window.panel.$t("toolbar.button.email")}}commands(){return{email:t=>{if(t.altKey||t.metaKey)return this.remove();this.editor.emit("email",this.editor)},insertEmail:(t={})=>{const{selection:e}=this.editor.state;if(e.empty&&this.editor.insertText(t.href,!0),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 wi extends ki{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]}}}let xi=class extends ki{get button(){return{icon:"url",label:window.panel.$t("toolbar.button.link")}}commands(){return{link:t=>{if(t.altKey||t.metaKey)return this.remove();this.editor.emit("link",this.editor)},insertLink:(t={})=>{const{selection:e}=this.editor.state;if(e.empty&&!1===this.editor.activeMarks.includes("link")&&this.editor.insertText(t.href,!0),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},0]}}};class _i extends ki{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]}}}let Si=class extends ki{get button(){return{icon:"superscript",label:window.panel.$t("toolbar.button.sup")}}commands(){return()=>this.toggle()}get name(){return"sup"}get schema(){return{parseDOM:[{tag:"sup"}],toDOM:()=>["sup",0]}}};class Ci extends ki{get button(){return{icon:"subscript",label:window.panel.$t("toolbar.button.sub")}}commands(){return()=>this.toggle()}get name(){return"sub"}get schema(){return{parseDOM:[{tag:"sub"}],toDOM:()=>["sub",0]}}}class Oi extends ki{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 Mi extends di{get button(){return{id:this.name,icon:"list-bullet",label:window.panel.$t("toolbar.button.ul"),name:this.name,when:["listItem","bulletList","orderedList","paragraph"]}}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 Ai extends di{commands({utils:t,type:e}){return()=>this.createHardBreak(t,e)}createHardBreak(t,e){return t.chainCommands(t.exitCode,t.insertNode(e))}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 Di extends di{get button(){const t=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"]})));return t[t.length-1].separator=!0,t}commands({type:t,schema:e,utils:s}){let i={toggleHeading:i=>s.toggleBlockType(t,e.nodes.paragraph,i)};for(const n of this.options.levels)i[`h${n}`]=()=>s.toggleBlockType(t,e.nodes.paragraph,{level:n});return 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 ji extends di{commands({type:t,utils:e}){return()=>e.insertNode(t)}inputRules({type:t,utils:e}){const s=e.nodeInputRule(/^(?:---|___\s|\*\*\*\s)$/,t),i=s.handler;return s.handler=(t,e,s,n)=>i(t,e,s,n).replaceWith(s-1,s,""),[s]}get name(){return"horizontalRule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}}class Ei extends di{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 Ti extends di{get button(){return{id:this.name,icon:"list-numbers",label:window.panel.$t("toolbar.button.ol"),name:this.name,when:["listItem","bulletList","orderedList","paragraph"],separator:!0}}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 Li extends di{get button(){return{id:this.name,icon:"quote",label:window.panel.$t("field.blocks.quote.name"),name:this.name}}commands({type:t,utils:e}){return()=>e.toggleWrap(t)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^\s*>\s$/,t)]}keys({utils:t}){return{"Shift-Tab":(e,s)=>t.lift(e,s)}}get name(){return"quote"}get schema(){return{content:"block+",group:"block",defining:!0,draggable:!1,parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]}}}let Bi=class extends pi{commands(){return{undo:()=>A,redo:()=>D,undoDepth:()=>j,redoDepth:()=>E}}get defaults(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":A,"Mod-y":D,"Shift-Mod-z":D,"Mod-я":A,"Shift-Mod-я":D}}get name(){return"history"}plugins(){return[T({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}};class Ii extends pi{commands(){return{insertHtml:t=>(e,s)=>{let i=document.createElement("div");i.innerHTML=t.trim();const n=v.fromSchema(e.schema).parse(i);s(e.tr.replaceSelectionWith(n).scrollIntoView())}}}}class qi extends pi{keys(){const t={};for(const e in this.options)t[e]=()=>(this.options[e](),!0);return t}}let Pi=class extends pi{constructor(t){super(),this.writer=t}get component(){return this.writer.$refs.toolbar}init(){this.editor.on("deselect",(({event:t})=>{var e;return null==(e=this.component)?void 0:e.close(t)})),this.editor.on("select",(({hasChanged:t})=>{var e;!1!==t&&(null==(e=this.component)||e.open())}))}get type(){return"toolbar"}};const Ni={mixins:[_e,G,X,et,it],props:{breaks:Boolean,code:Boolean,emptyDocument:{type:Object,default:()=>({type:"doc",content:[]})},extensions:Array,headings:{default:()=>[1,2,3,4,5,6],type:[Array,Boolean]},inline:Boolean,keys:Object,marks:{type:[Array,Boolean],default:!0},nodes:{type:[Array,Boolean],default:()=>["heading","bulletList","orderedList"]},paste:{type:Function,default:()=>()=>!1},toolbar:{type:Object,default:()=>({inline:!0})},value:{type:String,default:""}}};const Fi=nt({mixins:[Se,Ni],emits:["input"],data(){return{editor:null,json:{},html:this.value,isEmpty:!0}},computed:{characters(){const t=this.$helper.string.stripHTML(this.value??"");return this.$helper.string.unescapeHTML(t).length},isCursorAtEnd(){return this.editor.selectionIsAtEnd},isCursorAtStart(){return this.editor.selectionIsAtStart},toolbarOptions(){return{marks:Array.isArray(this.marks)?this.marks:void 0,...this.toolbar,editor:this.editor}}},watch:{value(t,e){t!==e&&t!==this.html&&(this.html=t,this.editor.setContent(this.html))}},mounted(){this.editor=new gi({autofocus:this.autofocus,content:this.value,editable:!this.disabled,element:this.$el,emptyDocument:this.emptyDocument,parseOptions:{preserveWhitespace:!0},events:{link:t=>{this.$panel.dialog.open({component:"k-link-dialog",props:{value:t.getMarkAttrs("link")},on:{cancel:()=>t.focus(),submit:e=>{this.$panel.dialog.close(),t.command("toggleLink",e)}}})},email:t=>{this.$panel.dialog.open({component:"k-email-dialog",props:{value:this.editor.getMarkAttrs("email")},on:{cancel:()=>t.focus(),submit:e=>{this.$panel.dialog.close(),t.command("toggleEmail",e)}}})},paste:this.paste,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),this.validate())}},extensions:[...this.createMarks(),...this.createNodes(),new qi(this.keys),new Bi,new Ii,new Pi(this),...this.extensions||[]],inline:this.inline}),this.isEmpty=this.editor.isEmpty(),this.json=this.editor.getJSON(),this.$panel.events.on("click",this.onBlur),this.$panel.events.on("focus",this.onBlur),this.validate(),this.$props.autofocus&&this.focus()},beforeDestroy(){this.editor.destroy(),this.$panel.events.off("click",this.onBlur),this.$panel.events.off("focus",this.onBlur)},methods:{command(t,...e){this.editor.command(t,...e)},createMarks(){return this.filterExtensions({clear:new yi,code:new vi,underline:new Oi,strike:new _i,link:new xi,email:new $i,bold:new bi,italic:new wi,sup:new Si,sub:new Ci,...this.createMarksFromPanelPlugins()},this.marks)},createMarksFromPanelPlugins(){const t=window.panel.plugins.writerMarks??{},e={};for(const s in t)e[s]=Object.create(ki.prototype,Object.getOwnPropertyDescriptors({name:s,...t[s]}));return e},createNodes(){const t=new Ai({text:!0,enter:this.inline});return this.filterExtensions({bulletList:new Mi,orderedList:new Ti,heading:new Di({levels:this.headings}),horizontalRule:new ji,listItem:new Ei,quote:new Li,...this.createNodesFromPanelPlugins()},this.nodes,((e,s)=>((e.includes("bulletList")||e.includes("orderedList"))&&s.push(new Ei),!0===this.inline&&(s=s.filter((t=>!0===t.schema.inline))),s.push(t),s)))},createNodesFromPanelPlugins(){const t=window.panel.plugins.writerNodes??{},e={};for(const s in t)e[s]=Object.create(di.prototype,Object.getOwnPropertyDescriptors({name:s,...t[s]}));return e},getHTML(){return this.editor.getHTML()},filterExtensions(t,e,s){!1===e?e=[]:!0!==e&&!1!==Array.isArray(e)||(e=Object.keys(t));let i=[];for(const n in t)e.includes(n)&&i.push(t[n]);return"function"==typeof s&&(i=s(e,i)),i},focus(){this.editor.focus()},getSplitContent(){return this.editor.getHTMLStartToSelectionToEnd()},onBlur(t){var e;!1===this.$el.contains(t.target)&&(null==(e=this.$refs.toolbar)||e.close())},onCommand(t,...e){this.editor.command(t,...e)},async validate(){var t;await new Promise((t=>setTimeout((()=>t("")),50)));let e="";!1===this.isEmpty&&this.minlength&&this.charactersthis.maxlength&&(e=this.$t("error.validation.maxlength",{max:this.maxlength})),null==(t=this.$refs.output)||t.setCustomValidity(e)}}},(function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"direction",rawName:"v-direction"}],ref:"editor",class:["k-writer","k-writer-input",t.$attrs.class],style:t.$attrs.style,attrs:{"data-disabled":t.disabled,"data-empty":t.isEmpty,"data-placeholder":t.placeholder,"data-toolbar-inline":Boolean(t.toolbar.inline??!0),spellcheck:t.spellcheck}},[t.editor&&!t.disabled?e("k-writer-toolbar",t._b({ref:"toolbar",on:{command:t.onCommand}},"k-writer-toolbar",t.toolbarOptions,!1)):t._e(),e("textarea",{ref:"output",staticClass:"input-hidden",attrs:{name:t.name,required:t.required,tabindex:"-1"},domProps:{value:t.value}})],1)}),[]).exports;class zi extends hi{get schema(){return{content:this.options.nodes.join("|")}}}const Yi={mixins:[Ni],inheritAttrs:!1,props:{nodes:{type:Array,default:()=>["bulletList","orderedList"]}}};const Ri=nt({mixins:[Se,Yi],data(){return{list:this.value,html:this.value}},computed:{listExtensions(){return[new zi({inline:!0,nodes:this.nodes})]}},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-input",t._b({ref:"input",class:["k-list-input",t.$attrs.class],style:t.$attrs.style,attrs:{extensions:t.listExtensions,value:t.list},on:{input:t.onInput}},"k-writer-input",t.$props,!1))}),[]).exports;const Hi=nt({mixins:[Ee,Pe,Yi],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-list-field",t.$attrs.class],style:t.$attrs.style,attrs:{counter:!1,input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"list"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,Vi={props:{disabled:Boolean,html:{type:Boolean},removable:Boolean,theme:{type:String,default:"dark"}}};const Ui=nt({mixins:[Vi],props:{element:{type:String,default:"button"},image:{type:Object},text:String},emits:["remove"],computed:{isRemovable(){return this.removable&&!this.disabled}},methods:{remove(){this.isRemovable&&this.$emit("remove")},focus(){this.$el.focus()}}},(function(){var t=this,e=t._self._c;return e(t.element,{tag:"component",staticClass:"k-tag",attrs:{"aria-disabled":t.disabled,"data-has-image":Boolean(t.image),"data-has-toggle":t.isRemovable,"data-theme":t.theme,type:"button"},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))}}},[t._t("image",(function(){var s;return[(null==(s=t.image)?void 0:s.src)?e("k-image-frame",t._b({staticClass:"k-tag-image"},"k-image-frame",t.image,!1)):t.image?e("k-icon-frame",t._b({staticClass:"k-tag-image"},"k-icon-frame",t.image,!1)):t._e()]})),t.text?[t.html?e("span",{staticClass:"k-tag-text",domProps:{innerHTML:t._s(t.text)}}):e("span",{staticClass:"k-tag-text"},[t._v(t._s(t.text))])]:t.$slots.default?[e("span",{staticClass:"k-tag-text"},[t._t("default")],2)]:t._e(),t.isRemovable?e("k-icon-frame",{staticClass:"k-tag-toggle",attrs:{icon:"cancel-small"},nativeOn:{click:function(e){return e.stopPropagation(),t.remove.apply(null,arguments)}}}):t._e()],2)}),[]).exports,Ki={mixins:[Vi,K,Q],inheritAttrs:!1,props:{element:{type:String,default:"div"},elementTag:String,layout:String,sort:{default:!1,type:Boolean},value:{default:()=>[],type:Array}}};const Wi=nt({mixins:[Ki],props:{draggable:{default:!0,type:Boolean}},emits:["edit","input"],data:()=>({tags:[]}),computed:{dragOptions(){return{delay:1,disabled:!this.isDraggable,draggable:".k-tag",handle:".k-tag-text"}},isDraggable(){return!0!==this.sort&&!1!==this.draggable&&0!==this.tags.length&&!0!==this.disabled}},watch:{value:{handler(){let t=this.$helper.object.clone(this.value);if(!0===this.sort){const e=[];for(const s of this.options){const i=t.indexOf(s.value);-1!==i&&(e.push(s),t.splice(i,1))}e.push(...t),t=e}this.tags=t.map(this.tag).filter((t=>t))},immediate:!0}},methods:{edit(t,e,s){!1===this.disabled&&this.$emit("edit",t,e,s)},focus(t="last"){this.$refs.navigate.move(t)},index(t){return this.tags.findIndex((e=>e.value===t.value))},input(){this.$emit("input",this.tags.map((t=>t.value)))},navigate(t){this.focus(t)},remove(t){this.tags.length<=1?this.navigate("last"):this.navigate("prev"),this.tags.splice(t,1),this.input()},option(t){return this.options.find((e=>e.value===t.value))},select(){this.focus()},tag(t){"object"!=typeof t&&(t={value:t});const e=this.option(t);return e||{text:this.$helper.string.escapeHTML(t.text??t.value),value:t.value}}}},(function(){var t=this,e=t._self._c;return e("k-navigate",{ref:"navigate",attrs:{axis:"list"===t.layout?"y":"x",select:":where(.k-tag, .k-tags-navigatable):not(:disabled)"}},[e("k-draggable",{class:["k-tags",t.$attrs.class],style:t.$attrs.style,attrs:{"data-layout":t.layout,element:t.element,list:t.tags,options:t.dragOptions},on:{end:t.input},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("default")]},proxy:!0}],null,!0)},t._l(t.tags,(function(s,i){return e("k-tag",{key:s.id??s.value??s.text,attrs:{disabled:t.disabled,element:t.elementTag,html:t.html,image:s.image,removable:t.removable&&!t.disabled,theme:t.theme,name:"tag"},on:{remove:function(e){return t.remove(i,s)}},nativeOn:{click:function(t){t.stopPropagation()},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.edit(i,s,e)},dblclick:function(e){return t.edit(i,s,e)}}},[e("span",{domProps:{innerHTML:t._s(s.text)}})])})),1)],1)}),[]).exports,Ji={mixins:[Z,st,Ki,Ce],props:{value:{default:()=>[],type:Array}},methods:{open(){this.$refs.dropdown.open(this.$el)}}};const Gi=nt({mixins:[Se,Ji]},(function(){var t=this,e=t._self._c;return e("div",{class:["k-multiselect-input",t.$attrs.class],style:t.$attrs.style},[e("k-input-validator",t._b({attrs:{value:JSON.stringify(t.value),anchor:".k-multiselect-input-toggle"}},"k-input-validator",{min:t.min,max:t.max,required:t.required},!1),[e("k-tags",t._b({ref:"tags",on:{input:function(e){return t.$emit("input",e)}},nativeOn:{click:function(e){return e.stopPropagation(),t.open.apply(null,arguments)}}},"k-tags",t.$props,!1),[!t.max||t.value.length({editing:null}),computed:{canAdd(){return!this.max||this.value.length!1===this.value.includes(t.value)))},picklist(){return{disabled:this.disabled,create:this.showCreate,ignore:this.ignore,min:this.min,max:this.max,search:this.showSearch}},replacableOptions(){return this.options.filter((t=>{var e;return!1===this.value.includes(t.value)||t.value===(null==(e=this.editing)?void 0:e.tag.value)}))},showCreate(){return"options"!==this.accept&&(!this.editing||{submit:this.$t("replace.with")})},showSearch(){return!1!==this.search&&(this.editing?{placeholder:this.$t("replace.with"),...this.search}:"options"===this.accept?{placeholder:this.$t("filter"),...this.search}:this.search)}},methods:{create(t){const e=t.split(this.separator).map((t=>t.trim())),s=this.$helper.object.clone(this.value);for(let i of e)i=this.$refs.tags.tag(i,this.separator),!0===this.isAllowed(i)&&s.push(i.value);this.$emit("input",s),this.$refs.create.close()},async edit(t,e){this.editing={index:t,tag:e},this.$refs.replace.open()},focus(){this.canAdd&&this.$refs.create.open()},isAllowed(t){return"object"==typeof t&&0!==t.value.trim().length&&(!("options"===this.accept&&!this.$refs.tags.option(t))&&!0!==this.value.includes(t.value))},pick(t){this.$emit("input",t),this.$refs.create.close()},replace(t){const{index:e}=this.editing,s=this.$refs.tags.tag(t);if(this.$refs.replace.close(),this.editing=null,!1===this.isAllowed(s))return!1;const i=this.$helper.object.clone(this.value);i.splice(e,1,s.value),this.$emit("input",i),this.$refs.tags.navigate(e)},toggle(t){return!(t.metaKey||t.altKey||t.ctrlKey)&&("ArrowDown"===t.key?(this.$refs.create.open(),void t.preventDefault()):void(String.fromCharCode(t.keyCode).match(/(\w)/g)&&this.$refs.create.open()))}}};const Qi=nt(Zi,(function(){var t,e=this,s=e._self._c;return s("div",{staticClass:"k-tags-input",attrs:{"data-can-add":e.canAdd}},[s("k-input-validator",e._b({attrs:{value:JSON.stringify(e.value)}},"k-input-validator",{min:e.min,max:e.max,required:e.required},!1),[s("k-tags",e._b({ref:"tags",attrs:{removable:!0},on:{edit:e.edit,input:function(t){return e.$emit("input",t)}},nativeOn:{click:function(t){var s,i;t.stopPropagation(),null==(i=null==(s=e.$refs.toggle)?void 0:s.$el)||i.click()}}},"k-tags",e.$props,!1),[!e.max||e.value.length({object:{}}),computed:{hasFields(){return this.$helper.object.length(this.fields)>0},isEmpty(){return null===this.object||0===this.$helper.object.length(this.object)}},watch:{value:{handler(t){this.object=this.valueToObject(t)},immediate:!0}},methods:{add(){this.object=this.$helper.field.form(this.fields),this.save(),this.open()},cell(t,e){this.$set(this.object,t,e),this.save()},form(t){const e=this.$helper.field.subfields(this,this.fields);if(t)for(const s in e)e[s].autofocus=s===t;return e},remove(){this.object={},this.save()},open(t){if(this.disabled)return!1;this.$panel.drawer.open({component:"k-form-drawer",props:{breadcrumb:[],icon:"box",tab:"object",tabs:{object:{fields:this.form(t)}},title:this.label,value:this.object},on:{input:t=>{for(const e in t)this.$set(this.object,e,t[e]);this.save()}}})},save(){this.$emit("input",this.object)},valueToObject:t=>"object"!=typeof t?{}:t}};const ln=nt(an,(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-object-field",scopedSlots:t._u([!t.disabled&&t.hasFields?{key:"options",fn:function(){return[t.isEmpty?e("k-button",{attrs:{icon:"add",size:"xs",variant:"filled"},on:{click:t.add}}):e("k-button",{attrs:{icon:"remove",size:"xs",variant:"filled"},on:{click:t.remove}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[t.hasFields?[t.isEmpty?e("k-empty",{attrs:{icon:"box"},on:{click:t.add}},[t._v(" "+t._s(t.empty??t.$t("field.object.empty"))+" ")]):e("table",{staticClass:"k-table k-object-field-table",attrs:{"aria-disabled":t.disabled}},[e("tbody",[t._l(t.fields,(function(s){return[s.saveable&&t.$helper.field.isVisible(s,t.value)?e("tr",{key:s.name,on:{click:function(e){return t.open(s.name)}}},[e("th",{attrs:{"data-has-button":"","data-mobile":"true"}},[e("button",{attrs:{type:"button"}},[t._v(t._s(s.label))])]),e("k-table-cell",{attrs:{column:s,field:s,mobile:!0,value:t.object[s.name]},on:{input:function(e){return t.cell(s.name,e)}}})],1):t._e()]}))],2)])]:[e("k-empty",{attrs:{icon:"box"}},[t._v(t._s(t.$t("fields.empty")))])],e("input",{staticClass:"input-hidden",attrs:{type:"checkbox",required:t.required},domProps:{checked:!t.isEmpty}})],2)}),[]).exports;const cn=nt({extends:zs,type:"pages",computed:{emptyProps(){return{icon:"page",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.pages.empty"):this.$t("field.pages.empty.single"))}}}},null,null).exports,un={mixins:[_s],props:{autocomplete:{type:String,default:"new-password"}}};const pn=nt({mixins:[Ss,un]},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-password-input",attrs:{type:"password"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[]).exports;const dn=nt({mixins:[Ee,Pe,un,ws],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({class:["k-password-field",t.$attrs.class],style:t.$attrs.style,attrs:{counter:t.counterOptions,input:t.id},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"password"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,hn={mixins:[_e,Q],props:{columns:{default:1,type:Number},reset:{default:!0,type:Boolean},theme:String,value:[String,Number,Boolean]}},mn={mixins:[Se,hn],computed:{choices(){return this.options.map(((t,e)=>({autofocus:this.autofocus&&0===e,checked:this.value===t.value,disabled:this.disabled||t.disabled,id:`${this.id}-${e}`,info:t.info,label:t.text,name:this.name??this.id,type:"radio",value:t.value})))}},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},select(){this.focus()},toggle(t){t===this.value&&this.reset&&!this.required&&this.$emit("input","")}}};const fn=nt(mn,(function(){var t=this,e=t._self._c;return e("fieldset",{class:["k-radio-input",t.$attrs.class],style:t.$attrs.style,attrs:{disabled:t.disabled}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("options")))]),e("k-input-validator",{attrs:{required:t.required,value:JSON.stringify(t.value)}},[e("ul",{staticClass:"k-grid",style:{"--columns":t.columns},attrs:{"data-variant":"choices"}},t._l(t.choices,(function(s,i){return e("li",{key:i},[e("k-choice-input",t._b({on:{input:function(e){return t.$emit("input",s.value)}},nativeOn:{click:function(e){return e.stopPropagation(),t.toggle(s.value)}}},"k-choice-input",s,!1))],1)})),0)])],1)}),[]).exports;const gn=nt({mixins:[Ee,Pe,hn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t,e=this,s=e._self._c;return s("k-field",e._b({class:["k-radio-field",e.$attrs.class],style:e.$attrs.style,attrs:{input:e.id+"-0"}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?s("k-radio-input",e._b({ref:"input",on:{input:function(t){return e.$emit("input",t)}}},"k-radio-input",e.$props,!1)):s("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[]).exports,kn={mixins:[_e],props:{default:[Number,String],max:{type:Number,default:100},min:{type:Number,default:0},step:{type:[Number,String],default:1},tooltip:{type:[Boolean,Object],default:()=>({before:null,after:null})},value:[Number,String]}},bn={mixins:[Se,kn],computed:{baseline(){return this.min<0?0:this.min},isEmpty(){return""===this.value||void 0===this.value||null===this.value},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:{value:{handler(){this.validate()},immediate:!0}},mounted(){this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.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)},onInput(t){this.$emit("input",t)},validate(){var t;const e=[];this.required&&!0===this.isEmpty&&e.push(this.$t("error.validation.required")),!1===this.isEmpty&&this.min&&this.valuethis.max&&e.push(this.$t("error.validation.max",{max:this.max})),null==(t=this.$refs.range)||t.setCustomValidity(e.join(", "))}}};const yn=nt(bn,(function(){var t=this,e=t._self._c;return e("div",{class:["k-range-input",t.$attrs.class],style:t.$attrs.style,attrs:{"data-disabled":t.disabled}},[e("input",t._b({ref:"range",attrs:{type:"range"},domProps:{value:t.position},on:{input:function(e){return t.$emit("input",e.target.valueAsNumber)}}},"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.tooltip?e("output",{staticClass:"k-range-input-tooltip",attrs:{for:t.id}},[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()])}),[]).exports;const vn=nt({mixins:[Pe,Ee,kn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-range-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"range"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,$n={mixins:[_e,Q,et],props:{ariaLabel:String,value:{type:[String,Number,Boolean],default:""}}},wn={mixins:[Se,$n],emits:["click","input"],computed:{empty(){return this.placeholder??"—"},hasEmptyOption(){return!this.required||this.isEmpty},isEmpty(){return null===this.value||void 0===this.value||""===this.value},label(){const t=this.text(this.value);return this.isEmpty||null===t?this.empty:t}},mounted(){this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onClick(t){t.stopPropagation(),this.$emit("click",t)},select(){this.focus()},text(t){let e=null;for(const s of this.options)s.value==t&&(e=s.text);return e}}};const xn=nt(wn,(function(){var t=this,e=t._self._c;return e("span",{class:["k-select-input",t.$attrs.class],style:t.$attrs.style,attrs:{"data-disabled":t.disabled,"data-empty":t.isEmpty}},[e("select",{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.value},on:{change:function(e){return t.$emit("input",e.target.value)},click:t.onClick}},[t.hasEmptyOption?e("option",{attrs:{disabled:t.required,value:""}},[t._v(" "+t._s(t.empty)+" ")]):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)+" ")])}),[]).exports;const _n=nt({mixins:[Ee,Pe,$n],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({class:["k-select-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"select"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,Sn={mixins:[_s],props:{autocomplete:null,spellcheck:null,allow:{type:String,default:""},formData:{type:Object,default:()=>({})},sync:{type:String}}},Cn={extends:Ss,mixins:[Sn],data(){return{slug:this.sluggify(this.value),slugs:this.$panel.language.rules??this.$panel.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.$panel.system.ascii],this.allow)},onInput(t){this.slug=this.sluggify(t),this.$emit("input",this.slug)}}};const On=nt(Cn,(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-slug-input",attrs:{spellcheck:!1,value:t.slug,autocomplete:"off"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[]).exports,Mn={mixins:[Ee,Pe,Sn],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;let e=null==(t=this.wizard)?void 0:t.field;if(e){const t=this.formData[e.toLowerCase()];t&&(this.slug=t)}}}};const An=nt(Mn,(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-slug-field",t.$attrs.class],style:t.$attrs.style,attrs:{help:t.preview,input:t.id},scopedSlots:t._u([t.wizard&&t.wizard.text?{key:"options",fn:function(){return[e("k-button",{attrs:{text:t.wizard.text,icon:"sparkling",size:"xs",variant:"filled"},on:{click:t.onWizard}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{value:t.slug,type:"slug"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,Dn={mixins:[Ee],inheritAttrs:!1,props:{autofocus:Boolean,columns:Object,duplicate:{type:Boolean,default:!0},empty:String,fields:[Array,Object],limit:Number,max:Number,min:Number,prepend:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},sortBy:String,value:{type:Array,default:()=>[]}},data:()=>({items:[],page:1}),computed:{index(){return this.limit?(this.page-1)*this.limit+1:1},more(){return!0!==this.disabled&&!(this.max&&this.items.length>=this.max)},hasFields(){return this.$helper.object.length(this.fields)>0},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(){if(this.disabled)return[];let t=[],e=this.duplicate&&this.more;return t.push({icon:"edit",text:this.$t("edit"),click:"edit"}),t.push({disabled:!e,icon:"copy",text:this.$t("duplicate"),click:"duplicate"}),t.push("-"),t.push({icon:"trash",text:e?this.$t("delete"):null,click:"remove"}),t},paginatedItems(){return this.limit?this.items.slice(this.pagination.offset,this.pagination.offset+this.limit):this.items}},watch:{value:{handler(t){t!==this.items&&(this.items=this.toItems(t))},immediate:!0}},methods:{add(t=null){if(!1===this.more)return!1;(t=t??this.$helper.field.form(this.fields))._id=t._id??this.$helper.uuid(),!0===this.prepend?this.items.unshift(t):this.items.push(t),this.save(),this.open(t)},close(){this.$panel.drawer.close(this.id)},focus(){var t,e;null==(e=null==(t=this.$refs.add)?void 0:t.focus)||e.call(t)},form(t){const e=this.$helper.field.subfields(this,this.fields);if(t)for(const s in e)e[s].autofocus=s===t;return e},findIndex(t){return this.items.findIndex((e=>e._id===t._id))},navigate(t,e){const s=this.findIndex(t);!0!==this.disabled&&-1!==s&&this.open(this.items[s+e],null,!0)},open(t,e,s=!1){const i=this.findIndex(t);if(!0===this.disabled||-1===i)return!1;this.$panel.drawer.open({component:"k-structure-drawer",id:this.id,props:{icon:this.icon??"list-bullet",next:this.items[i+1],prev:this.items[i-1],tabs:{content:{fields:this.form(e)}},title:this.label,value:t},replace:s,on:{input:e=>{const s=this.findIndex(t);this.$panel.drawer.props.next=this.items[s+1],this.$panel.drawer.props.prev=this.items[s-1],this.$set(this.items,s,e),this.save()},next:()=>{this.navigate(t,1)},prev:()=>{this.navigate(t,-1)},remove:()=>{this.remove(t)}}})},option(t,e){switch(t){case"remove":this.remove(e);break;case"duplicate":this.add({...this.$helper.object.clone(e),_id:this.$helper.uuid()});break;case"edit":this.open(e)}},paginate({page:t}){this.page=t},remove(t){const e=this.findIndex(t);this.disabled||-1===e||this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.structure.delete.confirm")},on:{submit:()=>{this.items.splice(e,1),this.save(),this.$panel.dialog.close(),this.close(),0===this.paginatedItems.length&&this.page>1&&this.page--}}})},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.structure.delete.confirm.all")},on:{submit:()=>{this.page=1,this.items=[],this.save(),this.$panel.dialog.close()}}})},save(t=this.items){this.$emit("input",t)},sort(t){return this.sortBy?this.$helper.array.sortBy(t,this.sortBy):t},toItems(t){return!1===Array.isArray(t)?[]:(t=t.map((t=>({_id:t._id??this.$helper.uuid(),...t}))),this.sort(t))}}};const jn=nt(Dn,(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-structure-field",t.$attrs.class],style:t.$attrs.style,nativeOn:{click:function(t){t.stopPropagation()}},scopedSlots:t._u([t.hasFields&&!t.disabled?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{attrs:{autofocus:t.autofocus,disabled:!t.more,responsive:!0,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.add()}}}),e("k-button",{attrs:{icon:"dots",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:[{click:()=>t.add(),disabled:!t.more,icon:"add",text:t.$t("add")},{click:()=>t.removeAll(),disabled:0===t.items.length||t.disabled,icon:"trash",text:t.$t("delete.all")}],"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input-validator",t._b({attrs:{value:JSON.stringify(t.items)}},"k-input-validator",{min:t.min,max:t.max,required:t.required},!1),[t.hasFields?[0===t.items.length?e("k-empty",{attrs:{icon:"list-bullet"},on:{click:function(e){return t.add()}}},[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,pagination:!!t.limit&&t.pagination,rows:t.paginatedItems,sortable:t.isSortable},on:{cell:function(e){return t.open(e.row,e.columnIndex)},input:t.save,option:t.option,paginate:t.paginate}}),t.more?e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.add()}}})],1):t._e()]]:[e("k-empty",{attrs:{icon:"list-bullet"}},[t._v(t._s(t.$t("fields.empty")))])]],2)],1)}),[]).exports,En={mixins:[_s],props:{autocomplete:{default:"tel"},placeholder:{default:()=>window.panel.$t("tel.placeholder")}}};const Tn=nt({mixins:[Ss,En]},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-tel-input",attrs:{type:"tel"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[]).exports;const Ln=nt({mixins:[Ee,Pe,En],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({class:["k-tel-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"tel"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,Bn={mixins:[_s]};const In=nt({mixins:[Ss,Bn]},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({class:["k-text-input",t.$attrs.class],attrs:{type:"text"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[]).exports;const qn=nt({mixins:[Ee,Pe,Bn,ws],inheritAttrs:!1,computed:{inputType(){return this.$helper.isComponent(`k-${this.type}-input`)?this.type:"text"}},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({class:["k-text-field",t.$attrs.class],style:t.$attrs.style,attrs:{counter:t.counterOptions,input:t.id},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:t.inputType},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,Pn={props:{buttons:{type:[Array,Boolean],default:!0},uploads:[Boolean,Object,Array]}};const Nn=nt({mixins:[Pn],emits:["command"],computed:{commands(){return{headlines:{label:this.$t("toolbar.button.headings"),icon:"title",dropdown:[{label:this.$t("toolbar.button.heading.1"),icon:"h1",click:()=>this.command("prepend","#")},{label:this.$t("toolbar.button.heading.2"),icon:"h2",click:()=>this.command("prepend","##")},{label:this.$t("toolbar.button.heading.3"),icon:"h3",click:()=>this.command("prepend","###")}]},bold:{label:this.$t("toolbar.button.bold"),icon:"bold",click:()=>this.command("toggle","**"),shortcut:"b"},italic:{label:this.$t("toolbar.button.italic"),icon:"italic",click:()=>this.command("toggle","*"),shortcut:"i"},link:{label:this.$t("toolbar.button.link"),icon:"url",click:()=>this.command("dialog","link"),shortcut:"k"},email:{label:this.$t("toolbar.button.email"),icon:"email",click:()=>this.command("dialog","email"),shortcut:"e"},file:{label:this.$t("toolbar.button.file"),icon:"attachment",click:()=>this.command("file"),dropdown:this.uploads?[{label:this.$t("toolbar.button.file.select"),icon:"check",click:()=>this.command("file")},{label:this.$t("toolbar.button.file.upload"),icon:"upload",click:()=>this.command("upload")}]:void 0},code:{label:this.$t("toolbar.button.code"),icon:"code",click:()=>this.command("toggle","`")},ul:{label:this.$t("toolbar.button.ul"),icon:"list-bullet",click:()=>this.command("insert",((t,e)=>e.split("\n").map((t=>"- "+t)).join("\n")))},ol:{label:this.$t("toolbar.button.ol"),icon:"list-numbers",click:()=>this.command("insert",((t,e)=>e.split("\n").map(((t,e)=>e+1+". "+t)).join("\n")))}}},default:()=>["headlines","|","bold","italic","code","|","link","email","file","|","ul","ol"],layout(){if(!1===this.buttons)return[];const t=[],e=Array.isArray(this.buttons)?this.buttons:this.default,s={...this.commands,...window.panel.plugins.textareaButtons??{}};for(const i of e)if("|"===i)t.push("|");else if(s[i]){const e={...s[i],click:()=>{var t;null==(t=s[i].click)||t.call(this)}};t.push(e)}return t}},methods:{close(){this.$refs.toolbar.close()},command(t,...e){this.$emit("command",t,...e)},shortcut(t,e){var s;const i=this.layout.find((e=>e.shortcut===t));i&&(e.preventDefault(),null==(s=i.click)||s.call(i))}}},(function(){return(0,this._self._c)("k-toolbar",{ref:"toolbar",staticClass:"k-textarea-toolbar",attrs:{buttons:this.layout}})}),[]).exports,Fn={mixins:[Pn,_e,V,G,X,et,it],props:{endpoints:Object,preselect:Boolean,size:String,value:String}};const zn=nt({mixins:[Se,Fn],emits:["focus","input","submit"],data:()=>({over:!1}),computed:{uploadOptions(){const t=this.restoreSelectionCallback();return{url:this.$panel.urls.api+"/"+this.endpoints.field+"/upload",multiple:!1,on:{cancel:t,done:e=>{t((()=>this.insertUpload(e)))}}}}},watch:{async value(){await this.$nextTick(),this.$library.autosize.update(this.$refs.input)}},async mounted(){await this.$nextTick(),this.$library.autosize(this.$refs.input),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{dialog(t){const e=this.restoreSelectionCallback();this.$panel.dialog.open({component:"k-toolbar-"+t+"-dialog",props:{value:this.parseSelection()},on:{cancel:e,submit:t=>{this.$panel.dialog.close(),e((()=>this.insert(t)))}}})},file(){const t=this.restoreSelectionCallback();this.$panel.dialog.open({component:"k-files-dialog",props:{endpoint:this.endpoints.field+"/files",multiple:!1},on:{cancel:t,submit:e=>{t((()=>this.insertFile(e))),this.$panel.dialog.close()}}})},focus(){this.$refs.input.focus()},insert(t){const e=this.$refs.input,s=e.value;"function"==typeof t&&(t=t(this.$refs.input,this.selection())),setTimeout((()=>{if(e.focus(),document.execCommand("insertText",!1,t),e.value===s){const s=e.selectionStart,i=e.selectionEnd,n=s===i?"end":"select";e.setRangeText(t,s,i,n)}this.$emit("input",e.value)}))},insertFile(t){(null==t?void 0:t.length)>0&&this.insert(t.map((t=>t.dragText)).join("\n\n"))},insertUpload(t){this.insertFile(t),this.$events.emit("model.update")},onCommand(t,...e){if("function"!=typeof this[t])return console.warn(t+" is not a valid command");this[t](...e)},onDrop(t){if(this.uploads&&this.$helper.isUploadEvent(t))return this.$panel.upload.open(t.dataTransfer.files,this.uploadOptions);"text"===this.$panel.drag.type&&(this.focus(),this.insert(this.$panel.drag.data))},onFocus(t){this.$emit("focus",t)},onInput(t){this.$emit("input",t.target.value)},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);"text"===this.$panel.drag.type&&(t.dataTransfer.dropEffect="copy",this.focus(),this.over=!0)},onShortcut(t){var e;!1!==this.buttons&&"Meta"!==t.key&&"Control"!==t.key&&(null==(e=this.$refs.toolbar)||e.shortcut(t.key,t))},onSubmit(t){return this.$emit("submit",t)},parseSelection(){const t=this.selection();if(0===(null==t?void 0:t.length))return{href:null,title:null};let e;e=this.$panel.config.kirbytext?/^\(link:\s*(?.*?)(?:\s*text:\s*(?.*?))?\)$/is:/^(\[(?.*?)\]\((?.*?)\))|(<(?.*?)>)$/is;const s=e.exec(t);return null!==s?{href:s.groups.url??s.groups.link,title:s.groups.text??null}:{href:null,title:t}},prepend(t){this.insert(t+" "+this.selection())},restoreSelectionCallback(){const t=this.$refs.input.selectionStart,e=this.$refs.input.selectionEnd;return s=>{setTimeout((()=>{this.$refs.input.setSelectionRange(t,e),s&&s()}))}},select(){this.$refs.select()},selection(){return this.$refs.input.value.substring(this.$refs.input.selectionStart,this.$refs.input.selectionEnd)},toggle(t,e){e=e??t;const s=this.selection();return s.startsWith(t)&&s.endsWith(e)?this.insert(s.slice(t.length).slice(0,s.length-t.length-e.length)):this.wrap(t,e)},upload(){this.$panel.upload.pick(this.uploadOptions)},wrap(t,e){this.insert(t+this.selection()+(e??t))}}},(function(){var t=this,e=t._self._c;return e("div",{class:["k-textarea-input",t.$attrs.class],style:t.$attrs.style,attrs:{"data-over":t.over,"data-size":t.size}},[e("div",{staticClass:"k-textarea-input-wrapper"},[t.buttons&&!t.disabled?e("k-textarea-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:function(e){var s;null==(s=t.$refs.toolbar)||s.close()},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?e.ctrlKey||e.shiftKey||e.altKey?null:t.onShortcut.apply(null,arguments):null},function(e){return e.ctrlKey?e.shiftKey||e.altKey||e.metaKey?null: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)])}),[]).exports;const Yn=nt({mixins:[Ee,Pe,Fn,ws],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-textarea-field",t.$attrs.class],style:t.$attrs.style,attrs:{counter:t.counterOptions,input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"textarea"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,Rn={props:{max:String,min:String,value:String}},Hn={mixins:[Rn],props:{display:{type:String,default:"HH:mm"},step:{type:Object,default:()=>({size:5,unit:"minute"})},type:{type:String,default:"time"}}};const Vn=nt({mixins:[Ls,Hn],computed:{inputType:()=>"time"}},null,null).exports,Un={mixins:[Ee,Pe,Hn],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()}}};const Kn=nt(Un,(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-time-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"time"},on:{input:function(e){return t.$emit("input",e??"")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.icon??"clock",title:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{"align-x":"end"}},[e("k-timeoptions-input",{attrs:{display:t.display,value:t.value},on:{input:t.select}})],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1))],1)}),[]).exports,Wn={mixins:[_e],props:{checked:{type:Boolean},info:{type:String},label:{type:String},type:{default:"checkbox",type:String},value:{type:[Boolean,Number,String]},variant:{type:String}}};const Jn=nt({mixins:[Se,Wn]},(function(){var t=this,e=t._self._c;return e("label",{class:["k-choice-input",t.$attrs.class],style:t.$attrs.style,attrs:{"aria-disabled":t.disabled}},[e("input",t._b({class:["invisible"===t.variant?"sr-only":null,t.$attrs.class],attrs:{"data-variant":t.variant},on:{input:function(e){return t.$emit("input",e.target.checked)}}},"input",{autofocus:t.autofocus,id:t.id,checked:t.checked,disabled:t.disabled,name:t.name,required:t.required,type:t.type,value:t.value},!1)),t.label||t.info?e("span",{staticClass:"k-choice-input-label"},[e("span",{staticClass:"k-choice-input-label-text",domProps:{innerHTML:t._s(t.label)}}),t.info?e("span",{staticClass:"k-choice-input-label-info",domProps:{innerHTML:t._s(t.info)}}):t._e()]):t._e()])}),[]).exports,Gn={mixins:[Wn],props:{text:{type:[Array,String]},value:Boolean}};const Xn=nt({mixins:[Se,Gn],computed:{labelText(){const t=this.text??[this.$t("off"),this.$t("on")];return Array.isArray(t)?this.value?t[1]:t[0]:t}},mounted(){this.$props.autofocus&&this.focus()},methods:{onEnter(t){"Enter"===t.key&&this.$el.click()},onInput(t){this.$emit("input",t)},select(){this.$el.focus()}}},(function(){var t=this;return(0,t._self._c)("k-choice-input",t._b({class:["k-toggle-input",t.$attrs.class],style:t.$attrs.style,attrs:{checked:t.value,disabled:t.disabled,label:t.labelText,type:"checkbox",variant:"toggle"},on:{input:function(e){return t.$emit("input",e)}}},"k-choice-input",t.$props,!1))}),[]).exports;const Zn=nt({mixins:[Ee,Pe,Gn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-toggle-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"toggle"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,Qn={mixins:[_e],props:{columns:Number,grow:Boolean,labels:Boolean,options:Array,reset:Boolean,value:[String,Number,Boolean]}},to={mixins:[Se,Qn],mounted(){this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input[checked]")||this.$el.querySelector("input"))||t.focus()},onClick(t){t===this.value&&this.reset&&!this.required&&this.$emit("input","")},onInput(t){this.$emit("input",t)},select(){this.focus()}}};const eo=nt(to,(function(){var t=this,e=t._self._c;return e("fieldset",{class:["k-toggles-input",t.$attrs.class],style:t.$attrs.style,attrs:{disabled:t.disabled}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("options")))]),e("k-input-validator",{attrs:{required:t.required,value:JSON.stringify(t.value)}},[e("ul",{style:{"--options":t.columns??t.options.length},attrs:{"data-labels":t.labels}},t._l(t.options,(function(s,i){return e("li",{key:i,attrs:{"data-disabled":t.disabled}},[e("input",{staticClass:"input-hidden",attrs:{id:t.id+"-"+i,"aria-label":s.text,disabled:t.disabled,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||!s.icon?e("span",{staticClass:"k-toggles-text",domProps:{innerHTML:t._s(s.text)}}):t._e()],1)])})),0)])],1)}),[]).exports,so={mixins:[Ee,Pe,Qn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)}}};const io=nt(so,(function(){var t,e=this,s=e._self._c;return s("k-field",e._b({class:["k-toggles-field",e.$attrs.class],style:e.$attrs.style,attrs:{input:e.id}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?s("k-input",e._b({ref:"input",class:{grow:e.grow},attrs:{type:"toggles"},on:{input:function(t){return e.$emit("input",t)}}},"k-input",e.$props,!1)):s("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[]).exports,no={mixins:[_s],props:{autocomplete:{type:String,default:"url"},placeholder:{type:String,default:()=>window.panel.$t("url.placeholder")}}};const oo=nt({mixins:[Ss,no],watch:{value:{handler(){this.validate()},immediate:!0}},methods:{validate(){var t;const e=[];this.value&&!1===this.$helper.url.isUrl(this.value,!0)&&e.push(this.$t("error.validation.url")),null==(t=this.$el)||t.setCustomValidity(e.join(", "))}}},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-url-input",attrs:{type:"url"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[]).exports;const ro=nt({mixins:[Ee,Pe,no],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"url"}},computed:{isValidUrl(){return""!==this.value&&!0===this.$helper.url.isUrl(this.value,!0)}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-url-field",t.$attrs.class],style:t.$attrs.style,attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"url"},on:{input:function(e){return t.$emit("input",e)}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link&&t.isValidUrl?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.value,title:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1))],1)}),[]).exports;const ao=nt({extends:zs,type:"users",computed:{emptyProps(){return{icon:"users",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.users.empty"):this.$t("field.users.empty.single"))}}}},null,null).exports;const lo=nt({mixins:[Ee,Pe,Ni,ws],inheritAttrs:!1,computed:{counterValue(){const t=this.$helper.string.stripHTML(this.value??"");return this.$helper.string.unescapeHTML(t)}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:["k-writer-field",t.$attrs.class],style:t.$attrs.style,attrs:{counter:t.counterOptions,input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{after:t.after,before:t.before,icon:t.icon,type:"writer"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[]).exports,co={install(t){t.component("k-blocks-field",bs),t.component("k-checkboxes-field",xs),t.component("k-color-field",Ds),t.component("k-date-field",Is),t.component("k-email-field",Ns),t.component("k-files-field",Ys),t.component("k-gap-field",Rs),t.component("k-headline-field",Hs),t.component("k-info-field",Vs),t.component("k-layout-field",Qs),t.component("k-line-field",ti),t.component("k-link-field",si),t.component("k-list-field",Hi),t.component("k-multiselect-field",en),t.component("k-number-field",rn),t.component("k-object-field",ln),t.component("k-pages-field",cn),t.component("k-password-field",dn),t.component("k-radio-field",gn),t.component("k-range-field",vn),t.component("k-select-field",_n),t.component("k-slug-field",An),t.component("k-structure-field",jn),t.component("k-tags-field",tn),t.component("k-text-field",qn),t.component("k-textarea-field",Yn),t.component("k-tel-field",Ln),t.component("k-time-field",Kn),t.component("k-toggle-field",Zn),t.component("k-toggles-field",io),t.component("k-url-field",ro),t.component("k-users-field",ao),t.component("k-writer-field",lo)}},uo={mixins:[kn],props:{max:null,min:null,step:{default:.01,type:Number},tooltip:{default:!1,type:[Boolean,Object]}}};const po=nt({mixins:[yn,uo]},(function(){var t=this;return(0,t._self._c)("k-range-input",t._b({staticClass:"k-alpha-input",attrs:{min:0,max:1},on:{input:function(e){return t.$emit("input",e)}}},"k-range-input",t.$props,!1))}),[]).exports,ho=["sun","mon","tue","wed","thu","fri","sat"];const mo=nt({mixins:[_e,js],data(){const t=this.$library.dayjs();return{maxdate:null,mindate:null,month:t.month(),selected:null,today:t,year:t.year()}},computed:{numberOfDays(){return this.toDate().daysInMonth()},firstWeekday(){const t=ho[this.toDate().day()];return this.weekdays.indexOf(t)},weekdays(){const t=this.$panel.translation.weekday;return[...ho.slice(t),...ho.slice(0,t)]},weeks(){return Math.ceil((this.numberOfDays+this.firstWeekday)/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)=>{t.push({value:s,text:e})})),t},years(){const t=this.year-20,e=this.year+20;return this.toOptions(t,e)}},watch:{max:{handler(t,e){t!==e&&(this.maxdate=this.$library.dayjs.interpret(t,"date"))},immediate:!0},min:{handler(t,e){t!==e&&(this.mindate=this.$library.dayjs.interpret(t,"date"))},immediate:!0},value:{handler(t,e){t!==e&&(this.selected=this.$library.dayjs.interpret(t,"date"),this.show(this.selected))},immediate:!0}},methods:{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.mindate,"day")||e.isAfter(this.maxdate,"day")},isSelected(t){return this.toDate(t).isSame(this.selected,"day")},isToday(t){return this.toDate(t).isSame(this.today,"day")},onNext(){const t=this.toDate().add(1,"month");this.show(t)},onPrev(){const t=this.toDate().subtract(1,"month");this.show(t)},select(t){this.$emit("input",(null==t?void 0:t.toISO("date"))??null)},show(t){this.month=(t??this.today).month(),this.year=(t??this.today).year()},toDate(t=1,e){return this.$library.dayjs(`${this.year}-${(e??this.month)+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("fieldset",{class:["k-calendar-input",t.$attrs.class],style:t.$attrs.style,on:{click:function(t){t.stopPropagation()}}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("date.select")))]),e("nav",[e("k-button",{attrs:{title:t.$t("prev"),icon:"angle-left"},on:{click:t.onPrev}}),e("span",{staticClass:"k-calendar-selects"},[e("k-select-input",{attrs:{"aria-label":t.$t("month"),autofocus:t.autofocus,options:t.months,empty:!1,required:!0,value:t.month},on:{input:function(e){t.month=Number(e)}}}),e("k-select-input",{attrs:{"aria-label":t.$t("year"),options:t.years,empty:!1,required:!0,value:t.year},on:{input:function(e){t.year=Number(e)}}})],1),e("k-button",{attrs:{title:t.$t("next"),icon:"angle-right"},on:{click:t.onNext}})],1),e("table",{key:t.year+"-"+t.month,staticClass:"k-calendar-table"},[e("thead",[e("tr",t._l(t.weekdays,(function(s){return e("th",{key:"weekday_"+s},[t._v(" "+t._s(t.$t("days."+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){t.select(t.toDate(s))}}}):t._e()],1)})),0)})),0),e("tfoot",[e("tr",[e("td",{staticClass:"k-calendar-today",attrs:{colspan:"7"}},[e("k-button",{attrs:{disabled:t.disabled,text:t.$t("today")},on:{click:function(e){t.show(t.today),t.select(t.today)}}})],1)])])]),e("input",{staticClass:"input-hidden",attrs:{id:t.id,disabled:t.disabled,min:t.min,max:t.max,name:t.name,required:t.required,tabindex:"-1",type:"date"},domProps:{value:t.value}})])}),[]).exports;const fo=nt({extends:Jn},null,null).exports,go={mixins:[fn,{mixins:[hn],props:{format:{type:String,default:"hex",validator:t=>["hex","rgb","hsl"].includes(t)},value:{type:String}}}],computed:{choices(){return this.options.map((t=>({...t,title:t.text??t.value,value:this.colorToString(t.value)})))}},methods:{colorToString(t){try{return this.$library.colors.toString(t,this.format)}catch{return t}}}};const ko=nt(go,(function(){var t=this,e=t._self._c;return t.choices.length?e("fieldset",{staticClass:"k-coloroptions-input",attrs:{disabled:t.disabled}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("options")))]),e("ul",t._l(t.choices,(function(s,i){return e("li",{key:i},[e("label",{attrs:{title:s.title}},[e("input",{staticClass:"input-hidden",attrs:{autofocus:t.autofocus&&0===i,disabled:t.disabled,name:t.name??t.id,required:t.required,type:"radio"},domProps:{checked:s.value===t.value,value:s.value},on:{click:function(e){return t.toggle(s.value)},input:function(e){return t.$emit("input",s.value)}}}),e("k-color-frame",{attrs:{color:s.value}})],1)])})),0)]):t._e()}),[]).exports,bo={mixins:[Se,{mixins:[_e,Q],props:{alpha:{default:!0,type:Boolean},format:{default:"hex",type:String,validator:t=>["hex","rgb","hsl"].includes(t)},value:{type:[Object,String]}}}],data:()=>({color:{h:0,s:0,v:1,a:1},formatted:null}),computed:{coords(){return this.value?{x:100*this.color.s,y:100*(1-this.color.v)}:null},hsl(){try{const t=this.$library.colors.convert(this.color,"hsl");return{h:t.h,s:(100*t.s).toFixed()+"%",l:(100*t.l).toFixed()+"%",a:t.a}}catch{return{h:0,s:"0%",l:"0%",a:1}}}},watch:{value:{handler(t,e){if(t===e||t===this.formatted)return;const s=this.$library.colors.parseAs(t??"","hsv");s?(this.formatted=this.$library.colors.toString(s,this.format),this.color=s):(this.formatted=null,this.color={h:0,s:0,v:1,a:1})},immediate:!0}},methods:{between:(t,e,s)=>Math.min(Math.max(t,e),s),emit(){return this.formatted=this.$library.colors.toString(this.color,this.format),this.$emit("input",this.formatted)},focus(){this.$refs.coords.focus()},setAlpha(t){this.color.a=this.alpha?this.between(Number(t),0,1):1,this.emit()},setCoords(t){if(!t)return this.$emit("input","");const e=Math.round(t.x),s=Math.round(t.y);this.color.s=this.between(e/100,0,1),this.color.v=this.between(1-s/100,0,1),this.emit()},setHue(t){this.color.h=this.between(Number(t),0,360),this.emit()}}};const yo=nt(bo,(function(){var t=this,e=t._self._c;return e("fieldset",{class:["k-colorpicker-input",t.$attrs.class],style:{"--h":t.hsl.h,"--s":t.hsl.s,"--l":t.hsl.l,"--a":t.hsl.a,...t.$attrs.style}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("color")))]),e("k-coords-input",{ref:"coords",attrs:{autofocus:t.autofocus,disabled:t.disabled,required:t.required,value:t.coords},on:{input:function(e){return t.setCoords(e)}}}),e("label",{attrs:{"aria-label":t.$t("hue")}},[e("k-hue-input",{attrs:{disabled:t.disabled,required:t.required,value:t.color.h},on:{input:function(e){return t.setHue(e)}}})],1),t.alpha?e("label",{attrs:{"aria-label":t.$t("alpha")}},[e("k-alpha-input",{attrs:{disabled:t.disabled,required:t.required,value:t.color.a},on:{input:function(e){return t.setAlpha(e)}}})],1):t._e(),e("k-coloroptions-input",{attrs:{disabled:t.disabled,format:t.format,options:t.options,required:t.required,value:t.value},on:{input:function(e){return t.$emit("input",e)}}}),e("input",{staticClass:"input-hidden",attrs:{name:t.name,required:t.required,tabindex:"-1",type:"text"},domProps:{value:t.formatted}})],1)}),[]).exports,vo={mixins:[Se,{mixins:[_e],props:{reset:{default:!0,type:Boolean},value:{default:()=>({x:0,y:0}),type:Object}}}],data:()=>({x:0,y:0}),watch:{value:{handler(t){const e=this.parse(t);this.x=(null==e?void 0:e.x)??0,this.y=(null==e?void 0:e.y)??0},immediate:!0}},methods:{focus(){var t;null==(t=this.$el.querySelector("button"))||t.focus()},getCoords:(t,e)=>({x:Math.min(Math.max(t.clientX-e.left,0),e.width),y:Math.min(Math.max(t.clientY-e.top,0),e.height)}),onDelete(){this.reset&&!this.required&&this.$emit("input",null)},onDrag(t){if(0!==t.button)return;const e=t=>this.onMove(t),s=()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",s)};window.addEventListener("mousemove",e),window.addEventListener("mouseup",s)},onEnter(){var t;null==(t=this.$el.form)||t.requestSubmit()},onInput(t,e){if(t.preventDefault(),t.stopPropagation(),this.disabled)return!1;this.x=Math.min(Math.max(parseFloat(e.x??this.x??0),0),100),this.y=Math.min(Math.max(parseFloat(e.y??this.y??0),0),100),this.$emit("input",{x:this.x,y:this.y})},onKeys(t){const e=t.shiftKey?10:1,s={ArrowUp:{y:this.y-e},ArrowDown:{y:this.y+e},ArrowLeft:{x:this.x-e},ArrowRight:{x:this.x+e}};s[t.key]&&this.onInput(t,s[t.key])},async onMove(t){const e=this.$el.getBoundingClientRect(),s=this.getCoords(t,e),i=s.x/e.width*100,n=s.y/e.height*100;this.onInput(t,{x:i,y:n}),await this.$nextTick(),this.focus()},parse(t){if("object"==typeof t)return t;const e={"top left":{x:0,y:0},"top center":{x:50,y:0},"top right":{x:100,y:0},"center left":{x:0,y:50},center:{x:50,y:50},"center center":{x:50,y:50},"center right":{x:100,y:50},"bottom left":{x:0,y:100},"bottom center":{x:50,y:100},"bottom right":{x:100,y:100}};if(e[t])return e[t];const s=t.split(",").map((t=>t.trim()));return{x:s[0],y:s[1]??0}}}};const $o=nt(vo,(function(){var t=this,e=t._self._c;return e("div",{class:["k-coords-input",t.$attrs.class],style:t.$attrs.style,attrs:{"aria-disabled":t.disabled,"data-empty":!t.value},on:{mousedown:t.onDrag,click:t.onMove,keydown:t.onKeys}},[t._t("default"),e("button",{staticClass:"k-coords-input-thumb",style:{left:`${t.x}%`,top:`${t.y}%`},attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onEnter.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:t.onDelete.apply(null,arguments)}]}}),e("input",{staticClass:"input-hidden",attrs:{name:t.name,required:t.required,tabindex:"-1",type:"text"},domProps:{value:t.value?[t.value.x,t.value.y]:null}})],2)}),[]).exports,wo={mixins:[kn],props:{max:null,min:null,step:{default:1,type:Number},tooltip:{default:!1,type:[Boolean,Object]}}};const xo=nt({mixins:[yn,wo]},(function(){var t=this;return(0,t._self._c)("k-range-input",t._b({staticClass:"k-hue-input",attrs:{min:0,max:360},on:{input:function(e){return t.$emit("input",e)}}},"k-range-input",t.$props,!1))}),[]).exports;const _o=nt({mixins:[Ss,{mixins:[_s],props:{autocomplete:null,pattern:null,spellcheck:null,placeholder:{default:()=>window.panel.$t("search")+" …",type:String}}}]},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-search-input",attrs:{spellcheck:!1,autocomplete:"off",type:"search"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[]).exports;const So=nt({mixins:[Se,{mixins:[_e,Rn]}],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:{focus(){this.$el.querySelector("button").focus()},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",{class:["k-timeoptions-input",t.$attrs.class],style:t.$attrs.style},[e("div",[e("h3",[e("k-icon",{attrs:{type:"sun"}}),t._v(" "),e("span",{staticClass:"sr-only"},[t._v(t._s(t.$t("day")))])],1),e("ul",t._l(t.day,(function(s,i){return e("li",{key:s.select},["-"===s?e("hr"):e("k-button",{attrs:{autofocus:t.autofocus&&0===i,disabled:t.disabled,selected:s.select===t.value&&"time"},on:{click:function(e){return t.select(s.select)}}},[t._v(" "+t._s(s.display)+" ")])],1)})),0)]),e("div",[e("h3",[e("k-icon",{attrs:{type:"moon"}}),t._v(" "),e("span",{staticClass:"sr-only"},[t._v(t._s(t.$t("night")))])],1),e("ul",t._l(t.night,(function(s){return e("li",{key:s.select},["-"===s?e("hr"):e("k-button",{attrs:{disabled:t.disabled,selected:s.select===t.value&&"time"},on:{click:function(e){return t.select(s.select)}}},[t._v(" "+t._s(s.display)+" ")])],1)})),0)]),e("input",{staticClass:"input-hidden",attrs:{id:t.id,disabled:t.disabled,min:t.min,max:t.max,name:t.name,required:t.required,tabindex:"-1",type:"time"},domProps:{value:t.value}})])}),[]).exports;class Co extends HTMLElement{static get observedAttributes(){return["min","max","required","value"]}attributeChangedCallback(t,e,s){this[t]=s}constructor(){super(),this.internals=this.attachInternals(),this.entries=[],this.max=null,this.min=null,this.required=!1}connectedCallback(){this.tabIndex=0,this.validate()}checkValidity(){return this.internals.checkValidity()}get form(){return this.internals.form}has(t){return this.entries.includes(t)}get isEmpty(){return 0===this.selected.length}get name(){return this.getAttribute("name")}reportValidity(){return this.internals.reportValidity()}get type(){return this.localName}validate(){const t=this.querySelector(this.getAttribute("anchor"))??this.querySelector("input, textarea, select, button")??this.querySelector(":scope > *"),e=parseInt(this.getAttribute("max")),s=parseInt(this.getAttribute("min"));this.hasAttribute("required")&&"false"!==this.getAttribute("required")&&0===this.entries.length?this.internals.setValidity({valueMissing:!0},window.panel.$t("error.validation.required"),t):this.hasAttribute("min")&&this.entries.lengthe?this.internals.setValidity({rangeOverflow:!0},window.panel.$t("error.validation.max",{max:e}),t):this.internals.setValidity({})}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get value(){return JSON.stringify(this.entries??[])}set value(t){this.entries=("string"==typeof t?JSON.parse(t):[])??[],this.validate()}get willValidate(){return this.internals.willValidate}}var Oo;((e,s,i)=>{s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i})(Co,"symbol"!=typeof(Oo="formAssociated")?Oo+"":Oo,!0);const Mo=nt({extends:"k-writer-input",created(){window.panel.deprecated("`k-writer` will be removed in a future version. Use `k-writer-input` instead.")}},null,null).exports,Ao={install(t){customElements.define("k-input-validator",Co),t.component("k-alpha-input",po),t.component("k-calendar-input",mo),t.component("k-checkbox-input",fo),t.component("k-checkboxes-input",$s),t.component("k-choice-input",Jn),t.component("k-colorname-input",Ms),t.component("k-coloroptions-input",ko),t.component("k-colorpicker-input",yo),t.component("k-coords-input",$o),t.component("k-date-input",Ls),t.component("k-email-input",Ps),t.component("k-hue-input",xo),t.component("k-list-input",Ri),t.component("k-multiselect-input",Gi),t.component("k-number-input",on),t.component("k-password-input",pn),t.component("k-picklist-input",Me),t.component("k-radio-input",fn),t.component("k-range-input",yn),t.component("k-search-input",_o),t.component("k-select-input",xn),t.component("k-slug-input",On),t.component("k-string-input",Ss),t.component("k-tags-input",Qi),t.component("k-tel-input",Tn),t.component("k-text-input",In),t.component("k-textarea-input",zn),t.component("k-time-input",Vn),t.component("k-timeoptions-input",So),t.component("k-toggle-input",Xn),t.component("k-toggles-input",eo),t.component("k-url-input",oo),t.component("k-writer-input",Fi),t.component("k-calendar",mo),t.component("k-times",So),t.component("k-writer",Mo)}};const Do=nt({mixins:[At],inheritAttrs:!1,props:{cancelButton:{default:!1},label:{default(){return this.$t("field.layout.select")},type:String},layouts:{type:Array},selector:Object,submitButton:{default:!1},value:{type:Array}},emits:["cancel","input","submit"]},(function(){var t,e,s=this,i=s._self._c;return i("k-dialog",s._b({class:["k-layout-selector",s.$attrs.class],style:s.$attrs.style,attrs:{size:(null==(t=s.selector)?void 0:t.size)??"medium"},on:{cancel:function(t){return s.$emit("cancel")},submit:function(t){return s.$emit("submit",s.value)}}},"k-dialog",s.$props,!1),[i("h3",{staticClass:"k-label"},[s._v(s._s(s.label))]),i("k-navigate",{staticClass:"k-layout-selector-options",style:{"--columns":Number((null==(e=s.selector)?void 0:e.columns)??3)},attrs:{axis:"x"}},s._l(s.layouts,(function(t,e){return i("button",{key:e,staticClass:"k-layout-selector-option",attrs:{"aria-current":s.value===t,"aria-label":t.join(","),value:t},on:{click:function(e){return s.$emit("input",t)}}},[i("k-grid",{attrs:{"aria-hidden":""}},s._l(t,(function(t,e){return i("k-column",{key:e,attrs:{width:t}})})),1)],1)})),0)],1)}),[]).exports,jo={install(t){t.component("k-layout",Js),t.component("k-layout-column",Ks),t.component("k-layouts",Zs),t.component("k-layout-selector",Do)}},Eo={inheritAttrs:!1,props:{column:{default:()=>({}),type:Object},field:{default:()=>({}),type:Object},value:{}}};const To=nt({mixins:[Eo,Ki],props:{value:{default:()=>[],type:[Array,String]}},computed:{tags(){let t=this.value;const e=this.column.options??this.field.options??[];return"string"==typeof t&&(t=t.split(",")),(t??[]).map((t=>{"string"==typeof t&&(t={value:t,text:t});for(const s of e)s.value===t.value&&(t.text=s.text);return t}))}}},(function(){var t=this,e=t._self._c;return e("div",{class:["k-tags-field-preview",t.$options.class,t.$attrs.class],style:t.$attrs.style},[e("k-tags",{attrs:{draggable:!1,html:t.html,value:t.tags,element:"ul","element-tag":"li",theme:"light"}})],1)}),[]).exports;const Lo=nt({extends:To,inheritAttrs:!1,class:"k-array-field-preview",computed:{tags(){return[{text:1===this.value.length?`1 ${this.$t("entry")}`:`${this.value.length} ${this.$t("entries")}`}]}}},null,null).exports,Bo={props:{html:{type:Boolean}}};const Io=nt({mixins:[Bo],inheritAttrs:!1,props:{bubbles:[Array,String]},computed:{items(){let t=this.bubbles;return"string"==typeof t&&(t=t.split(",")),t.map((t=>"string"===t?{text:t}:t))}},mounted(){window.panel.deprecated(" will be removed in a future version. Use instead.")}},(function(){var t=this,e=t._self._c;return e("ul",{class:["k-bubbles",t.$attrs.class],style:t.$attrs.style},t._l(t.items,(function(s,i){return e("li",{key:i},[e("k-bubble",t._b({attrs:{html:t.html}},"k-bubble",s,!1))],1)})),0)}),[]).exports;const qo=nt({mixins:[Eo,Bo],props:{value:{default:()=>[],type:[Array,String]}},computed:{bubbles(){let t=this.value;const e=this.column.options??this.field.options??[];return"string"==typeof t&&(t=t.split(",")),(t??[]).map((t=>{"string"==typeof t&&(t={value:t,text:t});for(const s of e)s.value===t.value&&(t.text=s.text);return t}))}},mounted(){window.panel.deprecated(" will be removed in a future version. Use instead.")}},(function(){var t=this,e=t._self._c;return e("div",{class:["k-bubbles-field-preview",t.$options.class,t.$attrs.class],style:t.$attrs.style},[e("k-bubbles",{attrs:{bubbles:t.bubbles,html:t.html}})],1)}),[]).exports,Po={mixins:[Eo],props:{value:String},computed:{text(){var t;if(!this.value)return;const e=this.$library.colors.toString(this.value,this.field.format,this.field.alpha),s=null==(t=this.field.options)?void 0:t.find((t=>this.$library.colors.toString(t.value,this.field.format,this.field.alpha)===e));return s?s.text:null}}};const No=nt(Po,(function(){var t=this,e=t._self._c;return e("div",{class:["k-color-field-preview",t.$attrs.class],style:t.$attrs.style},[e("k-color-frame",{attrs:{color:t.value}}),t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2)}),[]).exports;const Fo=nt({mixins:[Eo],computed:{text(){return this.value}}},(function(){var t=this;return(0,t._self._c)("p",{class:["k-text-field-preview",t.$options.class,t.$attrs.class],style:t.$attrs.style},[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)}),[]).exports;const zo=nt({extends:Fo,props:{value:String},class:"k-date-field-preview",computed:{display(){return this.column.display??this.field.display},format(){var t;let e=this.display??"YYYY-MM-DD";return(null==(t=this.time)?void 0:t.display)&&(e+=" "+this.time.display),e},parsed(){return this.$library.dayjs(this.value)},text(){var t;return!1===this.parsed.isValid()?this.value:null==(t=this.parsed)?void 0:t.format(this.format)},time(){return this.column.time??this.field.time}}},null,null).exports;const Yo=nt({mixins:[Eo],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",{class:["k-url-field-preview",t.$options.class,t.$attrs.class],style:t.$attrs.style,attrs:{"data-link":t.link}},[t._v(" "+t._s(t.column.before)+" "),e("k-link",{attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[e("span",[t._v(t._s(t.text))])]),t._v(" "+t._s(t.column.after)+" ")],1)}),[]).exports;const Ro=nt({extends:Yo,class:"k-email-field-preview"},null,null).exports;const Ho=nt({extends:To,class:"k-files-field-preview",props:{html:{type:Boolean,default:!0}},computed:{tags(){return this.value.map((t=>({text:t.filename,link:t.link,image:t.image})))}}},null,null).exports;const Vo=nt({mixins:[Eo],props:{value:Object},computed:{status(){var t;return{...this.$helper.page.status(null==(t=this.value)?void 0:t.status),...this.value}}}},(function(){var t=this,e=t._self._c;return t.value?e("k-button",t._b({class:["k-flag-field-preview",t.$attrs.class],style:t.$attrs.style,attrs:{size:"md"}},"k-button",t.status,!1)):t._e()}),[]).exports;const Uo=nt({mixins:[Eo],props:{value:String},computed:{html(){return this.value}}},(function(){var t=this,e=t._self._c;return e("div",{class:["k-html-field-preview",t.$options.class,t.$attrs.class],style:t.$attrs.style},[t._v(" "+t._s(t.column.before)+" "),e("k-text",{attrs:{html:t.html}}),t._v(" "+t._s(t.column.after)+" ")],1)}),[]).exports;const Ko=nt({mixins:[Eo],props:{value:[Object]}},(function(){var t=this,e=t._self._c;return t.value?e("k-item-image",{class:["k-image-field-preview",t.$attrs.class],style:t.$attrs.style,attrs:{image:t.value}}):t._e()}),[]).exports,Wo={mixins:[Eo],props:{removable:Boolean,type:String},emits:["remove"],data:()=>({model:null}),computed:{currentType(){return this.type??this.detected.type},detected(){return this.$helper.link.detect(this.value)},isLink(){return["url","email","tel"].includes(this.currentType)}},watch:{detected:{async handler(t,e){t!==e&&(this.model=await this.$helper.link.preview(this.detected))},immediate:!0},type(){this.model=null}}};const Jo=nt(Wo,(function(){var t=this,e=t._self._c;return e("div",{class:{"k-link-field-preview":!0,"k-url-field-preview":t.isLink,[t.$attrs.class]:!0},style:t.$attrs.style},["page"===t.currentType||"file"===t.currentType?[t.model?[e("k-tag",{attrs:{image:{...t.model.image,cover:!0},removable:t.removable,text:t.model.label},on:{remove:function(e){return t.$emit("remove",e)}}})]:t._t("placeholder")]:t.isLink?[e("p",{staticClass:"k-text"},[e("a",{attrs:{href:t.value,target:"_blank"}},[e("span",[t._v(t._s(t.detected.link))])])])]:[t._v(" "+t._s(t.detected.link)+" ")]],2)}),[]).exports;const Go=nt({extends:To,class:"k-object-field-preview",props:{value:[Array,Object]},computed:{tags(){return this.value?[{text:"{ ... }"}]:[]}}},null,null).exports;const Xo=nt({extends:To,inheritAttrs:!1,class:"k-pages-field-preview",props:{html:{type:Boolean,default:!0}}},null,null).exports;const Zo=nt({extends:zo,class:"k-time-field-preview",computed:{format(){return this.display??"HH:mm"},parsed(){return this.$library.dayjs.iso(this.value,"time")},text(){var t;return null==(t=this.parsed)?void 0:t.format(this.format)}}},null,null).exports;const Qo=nt({mixins:[Eo],props:{value:Boolean},emits:["input"],computed:{isEditable(){return!0!==this.field.disabled},text(){return!1!==this.column.text?this.field.text:null}}},(function(){var t=this,e=t._self._c;return e("div",{class:["k-toggle-field-preview",t.$attrs.class],style:t.$attrs.style},[e("k-toggle-input",{attrs:{disabled:!t.isEditable,text:t.text,value:t.value},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{click:function(e){t.isEditable&&e.stopPropagation()}}})],1)}),[]).exports;const tr=nt({extends:To,class:"k-users-field-preview",computed:{bubble(){return this.value.map((t=>({text:t.username,link:t.link,image:t.image})))}}},null,null).exports,er={install(t){t.component("k-array-field-preview",Lo),t.component("k-bubbles-field-preview",qo),t.component("k-color-field-preview",No),t.component("k-date-field-preview",zo),t.component("k-email-field-preview",Ro),t.component("k-files-field-preview",Ho),t.component("k-flag-field-preview",Vo),t.component("k-html-field-preview",Uo),t.component("k-image-field-preview",Ko),t.component("k-link-field-preview",Jo),t.component("k-object-field-preview",Go),t.component("k-pages-field-preview",Xo),t.component("k-tags-field-preview",To),t.component("k-text-field-preview",Fo),t.component("k-toggle-field-preview",Qo),t.component("k-time-field-preview",Zo),t.component("k-url-field-preview",Yo),t.component("k-users-field-preview",tr),t.component("k-list-field-preview",Uo),t.component("k-writer-field-preview",Uo),t.component("k-checkboxes-field-preview",qo),t.component("k-multiselect-field-preview",qo),t.component("k-radio-field-preview",qo),t.component("k-select-field-preview",qo),t.component("k-toggles-field-preview",qo)}};const sr=nt({mixins:[{props:{buttons:{type:Array,default:()=>[]},theme:{type:String,default:"light"}}}],methods:{close(){for(const t in this.$refs){const e=this.$refs[t][0];"function"==typeof(null==e?void 0:e.close)&&e.close()}}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-toolbar",attrs:{"data-theme":t.theme}},[t._l(t.buttons,(function(s,i){var n;return["|"===s?e("hr",{key:i}):s.when??1?e("k-button",{key:i,class:["k-toolbar-button",s.class],attrs:{current:s.current,disabled:s.disabled,icon:s.icon,title:s.label,tabindex:"0"},on:{click:function(e){var n,o;(null==(n=s.dropdown)?void 0:n.length)?t.$refs[i+"-dropdown"][0].toggle():null==(o=s.click)||o.call(s,e)}},nativeOn:{keydown:function(t){var e;null==(e=s.key)||e.call(s,t)}}}):t._e(),(s.when??1)&&(null==(n=s.dropdown)?void 0:n.length)?e("k-dropdown-content",{key:i+"-dropdown",ref:i+"-dropdown",refInFor:!0,attrs:{options:s.dropdown,theme:"dark"===t.theme?"light":"dark"}}):t._e()]}))],2)}),[]).exports;const ir=nt({props:{editor:{required:!0,type:Object},inline:{default:!0,type:Boolean},marks:{default:()=>["bold","italic","underline","strike","code","|","link","email","|","clear"],type:[Array,Boolean]},nodes:{default:!0,type:[Array,Boolean]}},emits:["command"],data:()=>({isOpen:!1,position:{x:0,y:0}}),computed:{activeNode(){return Object.values(this.nodeButtons).find((t=>this.isNodeActive(t)))??!1},buttons(){var t,e,s;const i=[];if(this.hasNodes){const n=[];let o=0;for(const i in this.nodeButtons){const r=this.nodeButtons[i];n.push({current:(null==(t=this.activeNode)?void 0:t.id)===r.id,disabled:!1===(null==(s=null==(e=this.activeNode)?void 0:e.when)?void 0:s.includes(r.name)),icon:r.icon,label:r.label,click:()=>this.command(r.command??i)}),!0===r.separator&&o!==Object.keys(this.nodeButtons).length-1&&n.push("-"),o++}i.push({current:Boolean(this.activeNode),icon:this.activeNode.icon??"title",dropdown:n})}if(this.hasNodes&&this.hasMarks&&i.push("|"),this.hasMarks)for(const n in this.markButtons){const t=this.markButtons[n];"|"!==t?i.push({current:this.editor.activeMarks.includes(n),icon:t.icon,label:t.label,click:e=>this.command(t.command??n,e)}):i.push("|")}return i},hasMarks(){return this.$helper.object.length(this.markButtons)>0},hasNodes(){return this.$helper.object.length(this.nodeButtons)>1},markButtons(){const t=this.editor.buttons("mark");if(!1===this.marks||0===this.$helper.object.length(t))return{};if(!0===this.marks)return t;const e={};for(const[s,i]of this.marks.entries())"|"===i?e["divider"+s]="|":t[i]&&(e[i]=t[i]);return e},nodeButtons(){const t=this.editor.buttons("node");if(!1===this.nodes||0===this.$helper.object.length(t))return{};if("block+"!==this.editor.nodes.doc.content&&t.paragraph&&delete t.paragraph,!0===this.nodes)return t;const e={};for(const s of this.nodes)t[s]&&(e[s]=t[s]);return e},positions(){return!1===this.inline?null:{top:this.position.y+"px",left:this.position.x+"px"}}},methods:{close(t){t&&!1!==this.$el.contains(t.relatedTarget)||(this.isOpen=!1)},command(t,...e){this.$emit("command",t,...e)},isNodeActive(t){if(!1===this.editor.activeNodes.includes(t.name))return!1;if("paragraph"===t.name)return!1===this.editor.activeNodes.includes("listItem")&&!1===this.editor.activeNodes.includes("quote");if(t.attrs){if(void 0===Object.values(this.editor.activeNodeAttrs).find((e=>JSON.stringify(e)===JSON.stringify(t.attrs))))return!1}return!0},open(){this.isOpen=!0,this.inline&&this.$nextTick(this.setPosition)},setPosition(){const t=this.$el.getBoundingClientRect(),e=this.editor.element.getBoundingClientRect(),s=document.querySelector(".k-panel-menu").getBoundingClientRect(),{from:i,to:n}=this.editor.selection,o=this.editor.view.coordsAtPos(i),r=this.editor.view.coordsAtPos(n,!0),a=new DOMRect(o.left,o.top,r.right-o.left,r.bottom-o.top);let l=a.x-e.x+a.width/2-t.width/2,c=a.y-e.y-t.height-5;if(t.widthe.width&&(l=e.width-t.width);else{const i=e.x+l,n=i+t.width,o=s.width+20,r=20;iwindow.innerWidth-r&&(l-=n-(window.innerWidth-r))}this.position={x:l,y:c}}}},(function(){var t=this,e=t._self._c;return t.isOpen||!t.inline?e("k-toolbar",{ref:"toolbar",staticClass:"k-writer-toolbar",style:t.positions,attrs:{buttons:t.buttons,"data-inline":t.inline,theme:t.inline?"dark":"light"}}):t._e()}),[]).exports;const nr=nt({extends:Et,props:{fields:{default:()=>{const t=Et.props.fields.default();return t.title.label=window.panel.$t("link.text"),t}}},methods:{submit(){const t=this.values.href??"",e=this.values.title??"";return this.$panel.config.kirbytext?(null==e?void 0:e.length)>0?this.$emit("submit",`(email: ${t} text: ${e})`):this.$emit("submit",`(email: ${t})`):(null==e?void 0:e.length)>0?this.$emit("submit",`[${e}](mailto:${t})`):this.$emit("submit",`<${t}>`)}}},null,null).exports;const or=nt({extends:Rt,props:{fields:{default:()=>({href:{label:window.panel.$t("link"),type:"link",placeholder:window.panel.$t("url.placeholder"),icon:"url"},title:{label:window.panel.$t("link.text"),type:"text",icon:"title"}})}},methods:{submit(){const t=this.values.href??"",e=this.values.title??"";return this.$panel.config.kirbytext?(null==e?void 0:e.length)>0?this.$emit("submit",`(link: ${t} text: ${e})`):this.$emit("submit",`(link: ${t})`):(null==e?void 0:e.length)>0?this.$emit("submit",`[${e}](${t})`):this.$emit("submit",`<${t}>`)}}},null,null).exports,rr={install(t){t.component("k-toolbar",sr),t.component("k-textarea-toolbar",Nn),t.component("k-writer-toolbar",ir),t.component("k-toolbar-email-dialog",nr),t.component("k-toolbar-link-dialog",or)}},ar={install(t){t.component("k-counter",je),t.component("k-field",Te),t.component("k-fieldset",Be),t.component("k-form",Ie),t.component("k-form-controls",qe),t.component("k-input",Ne),t.use(ks),t.use(Ao),t.use(co),t.use(jo),t.use(er),t.use(rr)}},lr={},cr=function(t,e,s){let i=Promise.resolve();if(e&&e.length>0){const t=document.getElementsByTagName("link"),n=document.querySelector("meta[property=csp-nonce]"),o=(null==n?void 0:n.nonce)||(null==n?void 0:n.getAttribute("nonce"));i=Promise.allSettled(e.map((e=>{if(e=function(t,e){return new URL(t,e).href}(e,s),e in lr)return;lr[e]=!0;const i=e.endsWith(".css"),n=i?'[rel="stylesheet"]':"";if(!!s)for(let s=t.length-1;s>=0;s--){const n=t[s];if(n.href===e&&(!i||"stylesheet"===n.rel))return}else if(document.querySelector(`link[href="${e}"]${n}`))return;const r=document.createElement("link");return r.rel=i?"stylesheet":"modulepreload",i||(r.as="script"),r.crossOrigin="",r.href=e,o&&r.setAttribute("nonce",o),document.head.appendChild(r),i?new Promise(((t,s)=>{r.addEventListener("load",t),r.addEventListener("error",(()=>s(new Error(`Unable to preload CSS for ${e}`))))})):void 0})))}function n(t){const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=t,window.dispatchEvent(e),!e.defaultPrevented)throw t}return i.then((e=>{for(const t of e||[])"rejected"===t.status&&n(t.reason);return t().catch(n)}))},ur=()=>cr((()=>import("./IndexView.min.js")),__vite__mapDeps([0,1]),import.meta.url),pr=()=>cr((()=>import("./DocsView.min.js")),__vite__mapDeps([2,3,1]),import.meta.url),dr=()=>cr((()=>import("./PlaygroundView.min.js")),__vite__mapDeps([4,3,1]),import.meta.url),hr={install(t){t.component("k-lab-index-view",ur),t.component("k-lab-docs-view",pr),t.component("k-lab-playground-view",dr)}};const mr=nt({props:{align:{type:String,default:"start"}}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-bar",attrs:{"data-align":t.align}},[t._t("default")],2)}),[]).exports;const fr=nt({props:{align:{type:String,default:"start"},button:Boolean,height:String,icon:String,theme:{type:String},text:String,html:{type:Boolean}},computed:{element(){return this.button?"button":"div"},type(){return this.button?"button":null}}},(function(){var t=this,e=t._self._c;return e(t.element,{tag:"component",staticClass:"k-box",style:t.height?{"--box-height":t.height}:null,attrs:{"data-align":t.align,"data-theme":t.theme,type:t.type}},[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),t._t("default",(function(){return[t.html?e("k-text",{attrs:{html:t.text}}):e("k-text",[t._v(" "+t._s(t.text)+" ")])]}),null,{html:t.html,text:t.text})],2)}),[]).exports;const gr=nt({inheritAttrs:!1,props:{back:String,color:String,element:{type:String,default:"li"},html:{type:Boolean},image:Object,link:String,text:String},mounted(){window.panel.deprecated(" will be removed in a future version. Use instead.")}},(function(){var t=this,e=t._self._c;return e(t.link?"k-link":"p",{tag:"component",class:["k-bubble",t.$attrs.class],style:{color:t.$helper.color(t.color),background:t.$helper.color(t.back),...t.$attrs.style},attrs:{"data-has-text":Boolean(t.text),to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[t._t("image",(function(){var s;return[(null==(s=t.image)?void 0:s.src)?e("k-image-frame",t._b({},"k-image-frame",t.image,!1)):t.image?e("k-icon-frame",t._b({},"k-icon-frame",t.image,!1)):e("span")]})),t.text?[t.html?e("span",{staticClass:"k-bubble-text",domProps:{innerHTML:t._s(t.text)}}):e("span",{staticClass:"k-bubble-text"},[t._v(t._s(t.text))])]:t._e()],2)}),[]).exports;const kr=nt({props:{width:{type:String,default:"1/1"},sticky:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column",style:{"--width":t.width},attrs:{"data-sticky":t.sticky}},[t.sticky?e("div",[t._t("default")],2):t._t("default")],2)}),[]).exports,br={props:{element:{type:String,default:"div"},fit:String,ratio:String,cover:Boolean,back:String,theme:String}};const yr=nt({mixins:[br],inheritAttrs:!1,computed:{background(){return this.$helper.color(this.back)}}},(function(){var t=this;return(0,t._self._c)(t.element,{tag:"component",class:["k-frame",t.$attrs.class],style:{"--fit":t.fit??(t.cover?"cover":"contain"),"--ratio":t.ratio,"--back":t.background,...t.$attrs.style},attrs:{"data-theme":t.theme}},[t._t("default")],2)}),[]).exports;const vr=nt({mixins:[{mixins:[br],props:{color:String}}],inheritAttrs:!1},(function(){var t=this;return(0,t._self._c)("k-frame",t._b({class:["k-color-frame",t.$attrs.class],style:{"--color-frame-back":t.color,...t.$attrs.style}},"k-frame",t.$props,!1),[t._t("default")],2)}),[]).exports;const $r=nt({props:{disabled:{type:Boolean}},emits:["drop"],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)}),[]).exports;const wr=nt({props:{variant:String}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-grid",attrs:{"data-variant":t.variant}},[t._t("default")],2)}),[]).exports;const xr=nt({props:{editable:Boolean},emits:["edit"]},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-header",attrs:{"data-has-buttons":Boolean(t.$slots.buttons||t.$slots.left||t.$slots.right)}},[e("h1",{staticClass:"k-header-title"},[t.editable?e("button",{staticClass:"k-header-title-button",attrs:{type:"button"},on:{click:function(e){return t.$emit("edit")}}},[e("span",{staticClass:"k-header-title-text"},[t._t("default")],2),e("span",{staticClass:"k-header-title-icon"},[e("k-icon",{attrs:{type:"edit"}})],1)]):e("span",{staticClass:"k-header-title-text"},[t._t("default")],2)]),t.$slots.buttons?e("div",{staticClass:"k-header-buttons"},[t._t("buttons")],2):t._e()])}),[]).exports,_r={props:{alt:String,color:String,type:String}};const Sr=nt({mixins:[_r],computed:{isEmoji(){return this.$helper.string.hasEmoji(this.type)}}},(function(){var t=this,e=t._self._c;return t.isEmoji?e("span",{attrs:{"data-type":"emoji"}},[t._v(t._s(t.type))]):e("svg",{staticClass:"k-icon",style:{color:t.$helper.color(t.color)},attrs:{"aria-label":t.alt,role:t.alt?"img":null,"aria-hidden":!t.alt,"data-type":t.type}},[e("use",{attrs:{"xlink:href":"#icon-"+t.type}})])}),[]).exports;const Cr=nt({mixins:[{mixins:[br,_r],props:{type:null,icon:String}}],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-frame",t._b({class:["k-icon-frame",t.$attrs.class],style:t.$attrs.style,attrs:{element:"figure"}},"k-frame",t.$props,!1),[e("k-icon",t._b({},"k-icon",{color:t.color,type:t.icon,alt:t.alt},!1))],1)}),[]).exports;const Or=nt({mixins:[{mixins:[br],props:{alt:String,sizes:String,src:String,srcset:String}}],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-frame",t._b({class:["k-image-frame","k-image",t.$attrs.class],style:t.$attrs.style,attrs:{element:"figure"}},"k-frame",t.$props,!1),[t.src?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()])}),[]).exports;const Mr=nt({mixins:[{props:{autofocus:{default:!0,type:Boolean},nested:{default:!1,type:Boolean},type:{default:"overlay",type:String},visible:{default:!1,type:Boolean}}}],inheritAttrs:!0,emits:["cancel","close","open"],watch:{visible(t,e){t!==e&&this.toggle()}},mounted(){this.toggle()},methods:{cancel(){this.$emit("cancel"),this.close()},close(){if(!1!==this.$refs.overlay.open)return this.nested?this.onClose():void this.$refs.overlay.close()},focus(){this.$helper.focus(this.$refs.overlay)},onCancel(t){this.nested&&(t.preventDefault(),this.cancel())},onClick(t){t.target.matches(".k-portal")&&this.cancel()},onClose(){this.$emit("close")},open(){!0!==this.$refs.overlay.open&&this.$refs.overlay.showModal(),setTimeout((()=>{!0===this.autofocus&&this.focus(),this.$emit("open")}))},toggle(){!0===this.visible?this.open():this.close()}}},(function(){var t=this;return(0,t._self._c)("dialog",{ref:"overlay",staticClass:"k-overlay",attrs:{"data-type":t.type},on:{cancel:t.onCancel,mousedown:t.onClick,touchdown:t.onClick,close:t.onClose}},[t._t("default")],2)}),[]).exports;const Ar=nt({props:{label:String,value:String,icon:String,info:String,theme:String,link:String,click:Function,dialog:{type:[String,Object]}},computed:{component(){return null!==this.target?"k-link":"div"},target(){return this.link?this.link:this.click?this.click:this.dialog?()=>this.$dialog(this.dialog):null}}},(function(){var t=this,e=t._self._c;return e(t.component,{tag:"component",staticClass:"k-stat",attrs:{"data-theme":t.theme,to:t.target}},[t.label?e("dt",{staticClass:"k-stat-label"},[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),t._v(" "+t._s(t.label)+" ")],1):t._e(),t.value?e("dd",{staticClass:"k-stat-value"},[t._v(t._s(t.value))]):t._e(),t.info?e("dd",{staticClass:"k-stat-info"},[t._v(t._s(t.info))]):t._e()])}),[]).exports;const Dr=nt({props:{reports:{type:Array,default:()=>[]},size:{type:String,default:"large"}},methods:{component(t){return null!==this.target(t)?"k-link":"div"},target(t){return t.link?t.link:t.click?t.click:t.dialog?()=>this.$dialog(t.dialog):null}}},(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("k-stat",t._b({key:i},"k-stat",s,!1))})),1)}),[]).exports,jr={inheritAttrs:!1,props:{columns:{type:Object,default:()=>({})},disabled:Boolean,fields:{type:Object,default:()=>({})},empty:String,index:{type:[Number,Boolean],default:1},rows:Array,options:{default:()=>[],type:[Array,Function]},pagination:[Object,Boolean],sortable:Boolean},emits:["cell","change","header","input","option","paginate","sort"],data(){return{values:this.rows}},computed:{colspan(){let t=this.columnsCount;return this.hasIndexColumn&&t++,this.hasOptions&&t++,t},columnsCount(){return this.$helper.object.length(this.columns)},dragOptions(){return{disabled:!this.sortable||0===this.rows.length,draggable:".k-table-sortable-row",fallbackClass:"k-table-row-fallback",ghostClass:"k-table-row-ghost"}},hasIndexColumn(){return this.sortable||!1!==this.index},hasOptions(){var t;return this.$scopedSlots.options||(null==(t=this.options)?void 0:t.length)>0||Object.values(this.values).filter((t=>null==t?void 0: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)}}};const Er=nt(jr,(function(){var t=this,e=t._self._c;return e("div",{class:["k-table",t.$attrs.class],style:t.$attrs.style,attrs:{"aria-disabled":t.disabled}},[e("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":"true"}},[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-align":s.align,"data-column-id":i,"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":"true"}}):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.colspan}},[t._v(" "+t._s(t.empty)+" ")])]):t._l(t.values,(function(s,i){return e("tr",{key:s.id??s._id??s.value??JSON.stringify(s),class:{"k-table-sortable-row":t.sortable&&!1!==s.sortable}},[t.hasIndexColumn?e("td",{staticClass:"k-table-index-column",attrs:{"data-mobile":"true"}},[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:o,staticClass:"k-table-column",style:{width:t.width(n.width)},attrs:{id:o,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":"true"}},[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})],2):t._e()],2)}))],2)],1),t.pagination?e("k-pagination",t._b({staticClass:"k-table-pagination",on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.pagination,!1)):t._e()],1)}),[]).exports;const Tr=nt({inheritAttrs:!1,props:{column:Object,field:Object,id:String,mobile:{type:Boolean,default:!1},row:Object,value:{default:""}},emits:["input"],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":"object"==typeof this.value?"k-object-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",{class:["k-table-cell",t.$attrs.class],style:t.$attrs.style,attrs:{"data-align":t.column.align,"data-column-id":t.id,"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()],1)}),[]).exports;const Lr=nt({props:{tab:String,tabs:{type:Array,default:()=>[]},theme:{type:String,default:"passive"}},data(){return{observer:null,visible:this.tabs,invisible:[]}},computed:{buttons(){return this.visible.map(this.button)},current(){const t=this.tabs.find((t=>t.name===this.tab))??this.tabs[0];return null==t?void 0:t.name},dropdown(){return this.invisible.map(this.button)}},watch:{tabs:{async handler(){var t;null==(t=this.observer)||t.disconnect(),await this.$nextTick(),this.$el instanceof Element&&(this.observer=new ResizeObserver(this.resize),this.observer.observe(this.$el))},immediate:!0}},destroyed(){var t;null==(t=this.observer)||t.disconnect()},methods:{button(t){const e={...t,current:t.name===this.current,title:t.label,text:t.label??t.text??t.name};return t.badge?e.badge={theme:this.theme,text:t.badge}:delete e.badge,e},async resize(){const t=this.$el.offsetWidth;this.visible=this.tabs,this.invisible=[],await this.$nextTick();const e=[...this.$refs.visible].map((t=>t.$el.offsetWidth));let s=32;for(let i=0;it)return this.visible=this.tabs.slice(0,i),void(this.invisible=this.tabs.slice(i))}}},(function(){var t=this,e=t._self._c;return t.tabs.length>1?e("nav",{staticClass:"k-tabs"},[t._l(t.buttons,(function(s){return e("div",{key:s.name,staticClass:"k-tabs-tab"},[e("k-button",t._b({ref:"visible",refInFor:!0,staticClass:"k-tab-button",attrs:{variant:"dimmed"}},"k-button",s,!1),[t._v(" "+t._s(s.text)+" ")])],1)})),t.invisible.length?[e("k-button",{staticClass:"k-tab-button k-tabs-dropdown-button",attrs:{current:!!t.invisible.find((e=>t.tab===e.name)),title:t.$t("more"),icon:"dots",variant:"dimmed"},on:{click:function(e){return e.stopPropagation(),t.$refs.more.toggle()}}}),e("k-dropdown-content",{ref:"more",staticClass:"k-tabs-dropdown",attrs:{options:t.dropdown,"align-x":"end"}})]:t._e()],2):t._e()}),[]).exports,Br={install(t){t.component("k-bar",mr),t.component("k-box",fr),t.component("k-bubble",gr),t.component("k-bubbles",Io),t.component("k-color-frame",vr),t.component("k-column",kr),t.component("k-dropzone",$r),t.component("k-frame",yr),t.component("k-grid",wr),t.component("k-header",xr),t.component("k-icon-frame",Cr),t.component("k-image-frame",Or),t.component("k-image",Or),t.component("k-overlay",Mr),t.component("k-stat",Ar),t.component("k-stats",Dr),t.component("k-table",Er),t.component("k-table-cell",Tr),t.component("k-tabs",Lr)}};const Ir=nt({props:{data:Object,disabled:Boolean,element:{type:String,default:"div"},group:String,handle:[String,Boolean],list:Array,move:Function,options:{type:Object,default:()=>({})}},emits:["change","end","sort","start"],data:()=>({sortable:null}),computed:{dragOptions(){return{group:this.group,disabled:this.disabled,handle:!0===this.handle?".k-sort-handle":this.handle,draggable:">*",filter:".k-draggable-footer",ghostClass:"k-sortable-ghost",fallbackClass:"k-sortable-fallback",forceFallback:!0,fallbackOnBody:!0,scroll:document.querySelector(".k-panel-main"),...this.options}}},watch:{dragOptions:{handler(t,e){for(const s in t)t[s]!==e[s]&&this.sortable.option(s,t[s])},deep:!0}},mounted(){this.disableFooter(),this.create()},methods:{async create(){const t=(await cr((async()=>{const{default:t}=await import("./sortable.esm.min.js");return{default:t}}),[],import.meta.url)).default;this.sortable=t.create(this.$el,{...this.dragOptions,onStart:t=>{this.$panel.drag.start("data",{}),this.$emit("start",t)},onEnd:t=>{this.$panel.drag.stop(),this.$emit("end",t)},onAdd:t=>{if(this.list){const e=this.getInstance(t.from),s=t.oldDraggableIndex,i=t.newDraggableIndex,n=e.list[s];this.list.splice(i,0,n),this.$emit("change",{added:{element:n,newIndex:i}})}},onUpdate:t=>{if(this.list){const e=t.oldDraggableIndex,s=t.newDraggableIndex,i=this.list[e];this.list.splice(e,1),this.list.splice(s,0,i),this.$emit("change",{moved:{element:i,newIndex:s,oldIndex:e}})}},onRemove:t=>{if(this.list){const e=t.oldDraggableIndex,s=this.list[e];this.list.splice(e,1),this.$emit("change",{removed:{element:s,oldIndex:e}})}},onSort:t=>{this.$emit("sort",t)},onMove:t=>{if(t.dragged.classList.contains("k-draggable-footer"))return!1;if(this.move){const e=t.dragged.__vue__;t.draggedData=e.$props;const s=this.getInstance(t.from);t.fromData=s.$props.data;const i=this.getInstance(t.to);return t.toData=i.$props.data,this.move(t)}return!0}})},disableFooter(){var t;if(this.$slots.footer){const e=[...this.$el.childNodes].slice(-1*this.$slots.footer.length);for(const s of e)null==(t=s.classList)||t.add("k-draggable-footer")}},getInstance:t=>"list"in(t=t.__vue__)?t:1===t.$children.length&&"list"in t.$children[0]?t.$children[0]:"k-draggable"===t.$parent.$options._componentTag?t.$parent:void 0}},(function(){var t=this;return(0,t._self._c)(t.element,{tag:"component",class:{"k-draggable":!t.dragOptions.disabled}},[t._t("default"),t.$slots.footer?[t._t("footer")]:t._e()],2)}),[]).exports;const qr=nt({data:()=>({error:null}),errorCaptured(t){return this.$panel.debug&&window.console.warn(t),this.error=t,!1},render(){return this.error?this.$slots.error?this.$slots.error[0]:this.$scopedSlots.error?this.$scopedSlots.error({error:this.error}):Vue.h("k-box",{attrs:{theme:"negative"}},this.error.message??this.error):this.$slots.default[0]}},null,null).exports;const Pr=nt({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("k-overlay",{staticClass:"k-fatal",attrs:{visible:!0}},[e("div",{staticClass:"k-fatal-box"},[e("div",{staticClass:"k-notification",attrs:{"data-theme":"negative"}},[e("p",[t._v("The JSON response could not be parsed")]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return e.stopPropagation(),t.$panel.notification.close()}}})],1),e("iframe",{ref:"iframe",staticClass:"k-fatal-iframe"})])])}),[]).exports;const Nr=nt({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 24 24"},domProps:{innerHTML:t._s(s)}})})),0)])}),[]).exports;const Fr=nt({},(function(){var t=this,e=t._self._c;return t.$panel.notification.isOpen?e("div",{staticClass:"k-notification",attrs:{"data-theme":t.$panel.notification.theme}},[e("p",[t._v(t._s(t.$panel.notification.message))]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return t.$panel.notification.close()}}})],1):t._e()}),[]).exports;const zr=nt({},(function(){var t=this,e=t._self._c;return!t.$panel.system.isLocal&&t.$panel.isOffline?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()}),[]).exports,Yr={props:{value:{type:Number,default:0,validator:t=>t>=0&&t<=100}}};const Rr=nt(Yr,(function(){var t=this;return(0,t._self._c)("progress",{staticClass:"k-progress",attrs:{max:"100"},domProps:{value:t.value}},[t._v(t._s(t.value)+"%")])}),[]).exports;const Hr=nt({},(function(){return(0,this._self._c)("k-button",{staticClass:"k-sort-handle k-sort-button",attrs:{title:this.$t("sort.drag"),icon:"sort","aria-hidden":"true"}})}),[]).exports,Vr={install(t){t.component("k-draggable",Ir),t.component("k-error-boundary",qr),t.component("k-fatal",Pr),t.component("k-icon",Sr),t.component("k-icons",Nr),t.component("k-notification",Fr),t.component("k-offline-warning",zr),t.component("k-progress",Rr),t.component("k-sort-handle",Hr)}};const Ur=nt({props:{crumbs:{type:Array,default:()=>[]},label:{type:String,default:"Breadcrumb"}},computed:{dropdown(){return this.crumbs.map((t=>({...t,text:t.label,icon:"angle-right"})))}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-breadcrumb",attrs:{"aria-label":t.label}},[t.crumbs.length>1?e("div",{staticClass:"k-breadcrumb-dropdown"},[e("k-button",{attrs:{icon:"home"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.dropdown}})],1):t._e(),e("ol",t._l(t.crumbs,(function(s,i){return e("li",{key:i},[e("k-button",{staticClass:"k-breadcrumb-link",attrs:{icon:s.loading?"loader":s.icon,link:s.link,disabled:!s.link,text:s.text??s.label,title:s.text??s.label,current:i===t.crumbs.length-1&&"page",variant:"dimmed",size:"sm"}})],1)})),0)])}),[]).exports;const Kr=nt({props:{items:{type:Array},name:{default:"items",type:String},selected:{type:String},type:{default:"radio",type:String}},emits:["select"]},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-browser"},[e("div",{staticClass:"k-browser-items"},t._l(t.items,(function(s){return e("label",{key:s.value,staticClass:"k-browser-item",attrs:{"aria-selected":t.selected===s.value}},[e("input",{attrs:{name:t.name,type:t.type},domProps:{checked:t.selected===s.value},on:{change:function(e){return t.$emit("select",s)}}}),s.image?e("k-item-image",{staticClass:"k-browser-item-image",attrs:{image:{...s.image,cover:!0,back:"black"}}}):t._e(),e("span",{staticClass:"k-browser-item-info"},[t._v(" "+t._s(s.label)+" ")])],1)})),0)])}),[]).exports,Wr={props:{disabled:Boolean,download:Boolean,rel:String,tabindex:[String,Number],target:String,title:String}};const Jr=nt({mixins:[Wr],props:{to:[String,Function]},emits:["click"],computed:{downloadAttr(){return this.download?this.href.split("/").pop():void 0},href(){return"function"==typeof this.to?"":"/"!==this.to[0]||this.target?!0===this.to.includes("@")&&!1===this.to.includes("/")&&!1===this.to.startsWith("mailto:")?"mailto:"+this.to:this.to:this.$url(this.to)},relAttr(){return"_blank"===this.target?"noreferrer noopener":this.rel}},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",{ref:"link",staticClass:"k-link",attrs:{download:t.downloadAttr,href:t.href,rel:t.relAttr,tabindex:t.tabindex,target:t.target,title:t.title},on:{click:t.onClick}},[t._t("default")],2):e("span",{staticClass:"k-link",attrs:{title:t.title,"aria-disabled":""}},[t._t("default")],2)}),[]).exports,Gr={mixins:[Wr],props:{autofocus:Boolean,badge:Object,click:{type:Function,default:()=>{}},current:[String,Boolean],dialog:String,drawer:String,dropdown:Boolean,element:String,icon:String,id:[String,Number],link:String,responsive:[Boolean,String],role:String,selected:[String,Boolean],size:String,text:[String,Number],theme:String,type:{type:String,default:"button"},variant:String}};const Xr=nt({mixins:[Gr],inheritAttrs:!1,emits:["click"],computed:{attrs(){const t={"aria-current":this.current,"aria-disabled":this.disabled,"aria-label":this.text??this.title,"aria-selected":this.selected,"data-responsive":this.responsive,"data-size":this.size,"data-theme":this.theme,"data-variant":this.variant,id:this.id,tabindex:this.tabindex,title:this.title};return"k-link"===this.component?(t.disabled=this.disabled,t.download=this.download,t.to=this.link,t.rel=this.rel,t.target=this.target):"button"===this.component&&(t.autofocus=this.autofocus,t.role=this.role,t.type=this.type),this.dropdown&&(t["aria-haspopup"]="menu",t["data-dropdown"]=this.dropdown),t},component(){return this.element?this.element:this.link?"k-link":"button"}},methods:{focus(){var t,e;null==(e=(t=this.$el).focus)||e.call(t)},onClick(t){var e;return this.disabled?(t.preventDefault(),!1):this.dialog?this.$dialog(this.dialog):this.drawer?this.$drawer(this.drawer):(null==(e=this.click)||e.call(this,t),void this.$emit("click",t))}}},(function(){var t=this,e=t._self._c;return e(t.component,t._b({tag:"component",class:["k-button",t.$attrs.class],style:t.$attrs.style,attrs:{"data-has-icon":Boolean(t.icon),"data-has-text":Boolean(t.text||t.$slots.default)},on:{click:t.onClick}},"component",t.attrs,!1),[t.icon?e("span",{staticClass:"k-button-icon"},[e("k-icon",{attrs:{type:t.icon}})],1):t._e(),t.text||t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default",(function(){return[t._v(" "+t._s(t.text)+" ")]}))],2):t._e(),t.dropdown&&(t.text||t.$slots.default)?e("span",{staticClass:"k-button-arrow"},[e("k-icon",{attrs:{type:"angle-dropdown"}})],1):t._e(),t.badge?e("span",{staticClass:"k-button-badge",attrs:{"data-theme":t.badge.theme??t.theme}},[t._v(" "+t._s(t.badge.text)+" ")]):t._e()])}),[]).exports;const Zr=nt({props:{buttons:Array,layout:String,variant:String,theme:String,size:String,responsive:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-button-group",attrs:{"data-layout":t.layout}},[t.$slots.default?t._t("default"):t._l(t.buttons,(function(s,i){return e("k-button",t._b({key:i},"k-button",{variant:t.variant,theme:t.theme,size:t.size,responsive:t.responsive,...s},!1))}))],2)}),[]).exports;const Qr=nt({props:{limit:{default:50,type:Number},opened:{type:String},selected:{type:String}},emits:["select"],data(){return{files:[],page:null,pagination:null,view:this.opened?"files":"tree"}},methods:{paginate(t){this.selectPage(this.page,t.page)},selectFile(t){this.$emit("select",t)},async selectPage(t,e=1){this.page=t;const s="/"===t.id?"/site/files":"/pages/"+this.$api.pages.id(t.id)+"/files",{data:i,pagination:n}=await this.$api.get(s,{select:"filename,id,panelImage,url,uuid",limit:this.limit,page:e});this.pagination=n,this.files=i.map((t=>({label:t.filename,image:t.panelImage,id:t.id,url:t.url,uuid:t.uuid,value:t.uuid??t.url}))),this.view="files"},async togglePage(){await this.$nextTick(),this.$refs.tree.scrollIntoView({behaviour:"smooth",block:"nearest",inline:"nearest"})}}},(function(){var t,e,s=this,i=s._self._c;return i("div",{staticClass:"k-file-browser",attrs:{"data-view":s.view}},[i("div",{staticClass:"k-file-browser-layout"},[i("aside",{ref:"tree",staticClass:"k-file-browser-tree"},[i("k-page-tree",{attrs:{current:(null==(t=s.page)?void 0:t.value)??s.opened},on:{select:s.selectPage,toggleBranch:s.togglePage}})],1),i("div",{ref:"items",staticClass:"k-file-browser-items"},[i("k-button",{staticClass:"k-file-browser-back-button",attrs:{icon:"angle-left",text:null==(e=s.page)?void 0:e.label},on:{click:function(t){s.view="tree"}}}),s.files.length?i("k-browser",{attrs:{items:s.files,selected:s.selected},on:{select:s.selectFile}}):s._e()],1),i("div",{staticClass:"k-file-browser-pagination",on:{click:function(t){t.stopPropagation()}}},[s.pagination?i("k-pagination",s._b({attrs:{details:!0},on:{paginate:s.paginate}},"k-pagination",s.pagination,!1)):s._e()],1)])])}),[]).exports;const ta=nt({props:{changes:Object,tab:String,tabs:{type:Array,default:()=>[]}},computed:{withBadges(){const t=Object.keys(this.changes);return this.tabs.map((e=>{const s=[];for(const t in e.columns)for(const i in e.columns[t].sections)if("fields"===e.columns[t].sections[i].type)for(const n in e.columns[t].sections[i].fields)s.push(n);return e.badge=s.filter((e=>t.includes(e.toLowerCase()))).length,e}))}}},(function(){var t=this;return(0,t._self._c)("k-tabs",{staticClass:"k-model-tabs",attrs:{tab:t.tab,tabs:t.withBadges,theme:"notice"}})}),[]).exports;const ea=nt({props:{axis:String,disabled:Boolean,element:{type:String,default:"div"},select:{type:String,default:":where(button, a):not(:disabled)"}},emits:["next","prev"],computed:{keys(){switch(this.axis){case"x":return{ArrowLeft:this.prev,ArrowRight:this.next};case"y":return{ArrowUp:this.prev,ArrowDown:this.next};default:return{ArrowLeft:this.prev,ArrowRight:this.next,ArrowUp:this.prev,ArrowDown:this.next}}}},mounted(){this.$el.addEventListener("keydown",this.keydown)},destroyed(){this.$el.removeEventListener("keydown",this.keydown)},methods:{focus(t=0,e){this.move(t,e)},keydown(t){var e;if(this.disabled)return!1;null==(e=this.keys[t.key])||e.apply(this,[t])},move(t=0,e){var s;const i=[...this.$el.querySelectorAll(this.select)];let n=i.findIndex((t=>t===document.activeElement||t.contains(document.activeElement)));switch(-1===n&&(n=0),t){case"first":t=0;break;case"next":t=n+1;break;case"last":t=i.length-1;break;case"prev":t=n-1}t<0?this.$emit("prev"):t>=i.length?this.$emit("next"):null==(s=i[t])||s.focus(),null==e||e.preventDefault()},next(t){this.move("next",t)},prev(t){this.move("prev",t)}}},(function(){var t=this;return(0,t._self._c)(t.element,{tag:"component",staticClass:"k-navigate"},[t._t("default")],2)}),[]).exports;const sa=nt({name:"k-tree",inheritAttrs:!1,props:{element:{type:String,default:"k-tree"},current:{type:String},items:{type:[Array,Object]},level:{default:0,type:Number}},emits:["close","open","select","toggle"],data(){return{state:this.items}},methods:{arrow:t=>!0===t.loading?"loader":t.open?"angle-down":"angle-right",close(t){this.$set(t,"open",!1),this.$emit("close",t)},isItem:(t,e)=>t.value===e,open(t){this.$set(t,"open",!0),this.$emit("open",t)},select(t){this.$emit("select",t)},toggle(t){this.$emit("toggle",t),!0===t.open?this.close(t):this.open(t)}}},(function(){var t=this,e=t._self._c;return e("ul",{class:["k-tree",t.$options.name,t.$attrs.class],style:{"--tree-level":t.level,...t.$attrs.style}},t._l(t.state,(function(s){return e("li",{key:s.value,attrs:{"aria-expanded":s.open,"aria-current":t.isItem(s,t.current)}},[e("p",{staticClass:"k-tree-branch",attrs:{"data-has-subtree":s.hasChildren&&s.open}},[e("button",{staticClass:"k-tree-toggle",attrs:{disabled:!s.hasChildren,type:"button"},on:{click:function(e){return t.toggle(s)}}},[e("k-icon",{attrs:{type:t.arrow(s)}})],1),e("button",{staticClass:"k-tree-folder",attrs:{disabled:s.disabled,type:"button"},on:{click:function(e){return t.select(s)},dblclick:function(e){return t.toggle(s)}}},[e("k-icon-frame",{attrs:{icon:s.icon??"folder"}}),e("span",{staticClass:"k-tree-folder-label"},[t._v(t._s(s.label))])],1)]),s.hasChildren&&s.open?[e(t.$options.name,t._b({ref:s.value,refInFor:!0,tag:"component",attrs:{items:s.children,level:t.level+1},on:{close:function(e){return t.$emit("close",e)},open:function(e){return t.$emit("open",e)},select:function(e){return t.$emit("select",e)},toggle:function(e){return t.$emit("toggle",e)}}},"component",t.$props,!1))]:t._e()],2)})),0)}),[]).exports,ia={name:"k-page-tree",extends:sa,inheritAttrs:!1,props:{current:{type:String},move:{type:String},root:{default:!0,type:Boolean}},data:()=>({state:[]}),async mounted(){if(this.items)this.state=this.items;else{const t=await this.load(null);await this.open(t[0]),this.state=this.root?t:t[0].children,this.current&&this.preselect(this.current)}},methods:{findItem(t){return this.state.find((e=>this.isItem(e,t)))},isItem:(t,e)=>t.value===e||t.uuid===e||t.id===e,async load(t){return await this.$panel.get("site/tree",{query:{move:this.move??null,parent:t}})},async open(t){if(t){if(!1===t.hasChildren)return!1;this.$set(t,"loading",!0),"string"==typeof t.children&&(t.children=await this.load(t.children)),this.$set(t,"open",!0),this.$set(t,"loading",!1)}},async preselect(t){const e=(await this.$panel.get("site/tree/parents",{query:{page:t,root:this.root}})).data;let s=this;for(let n=0;nPromise.resolve()}},emits:["paginate"],computed:{detailsText(){return 1===this.limit?this.start:this.start+"-"+this.end},end(){return Math.min(this.start-1+this.limit,this.total)},offset(){return this.start-1},pages(){return Math.ceil(this.total/this.limit)},start(){return(this.page-1)*this.limit+1}},methods:{async goTo(t){var e;try{await this.validate(t),null==(e=this.$refs.dropdown)||e.close();const s=((t=Math.max(1,Math.min(t,this.pages)))-1)*this.limit+1;this.$emit("paginate",{page:t,start:s,end:Math.min(s-1+this.limit,this.total),limit:this.limit,offset:s-1,total:this.total})}catch{}},prev(){this.goTo(this.page-1)},next(){this.goTo(this.page+1)}}},(function(){var t=this,e=t._self._c;return t.pages>1?e("k-button-group",{staticClass:"k-pagination",attrs:{layout:"collapsed"},nativeOn:{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.prev.apply(null,arguments)},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.next.apply(null,arguments)}]}},[e("k-button",{staticClass:"k-pagination-button",attrs:{disabled:t.start<=1,title:t.$t("prev"),icon:"angle-left",size:"xs",variant:"filled"},on:{click:t.prev}}),t.details?[e("k-button",{staticClass:"k-pagination-details",attrs:{disabled:t.total<=t.limit,text:t.total>1?`${t.detailsText} / ${t.total}`:t.total,size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",staticClass:"k-pagination-selector",attrs:{"align-x":"end"},nativeOn:{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:void e.stopPropagation()},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:void e.stopPropagation()}]}},[e("form",{attrs:{method:"dialog"},on:{click:function(t){t.stopPropagation()},submit:function(e){return t.goTo(t.$refs.page.value)}}},[e("label",[t._v(" "+t._s(t.$t("pagination.page"))+": "),e("select",{ref:"page",attrs:{autofocus:!0}},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:{type:"submit",icon:"check"}})],1)])]:t._e(),e("k-button",{staticClass:"k-pagination-button",attrs:{disabled:t.end>=t.total,title:t.$t("next"),icon:"angle-right",size:"xs",variant:"filled"},on:{click:t.next}})],2):t._e()}),[]).exports;const ra=nt({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"}]},isFullyDisabled(){return 0===this.buttons.filter((t=>!t.disabled)).length}},methods:{button:t=>t||{disabled:!0,link:"#"}}},(function(){var t=this,e=t._self._c;return t.isFullyDisabled?t._e():e("k-button-group",{staticClass:"k-prev-next",attrs:{buttons:t.buttons,layout:"collapsed",size:"xs"}})}),[]).exports;const aa=nt({mixins:[It],props:{defaultType:String,isLoading:Boolean,pagination:{type:Object,default:()=>({})},results:Array,types:{type:Object,default:()=>({})}},emits:["close","more","navigate","search"],data(){return{selected:-1,type:this.types[this.defaultType]?this.defaultType:Object.keys(this.types)[0]}},computed:{typesDropdown(){return Object.values(this.types).map((t=>({...t,current:this.type===t.id,click:()=>{this.type=t.id,this.focus()}})))}},watch:{type(){this.search()}},methods:{focus(){var t;null==(t=this.$refs.input)||t.focus()},onDown(){this.select(Math.min(this.selected+1,this.results.length-1))},onEnter(){this.$emit("navigate",this.results[this.selected]??this.results[0])},onUp(){this.select(Math.max(this.selected-1,-1))},async search(){var t,e;null==(t=this.$refs.types)||t.close(),null==(e=this.select)||e.call(this,-1),this.$emit("search",{type:this.type,query:this.query})},select(t){var e;this.selected=t;const s=(null==(e=this.$refs.results)?void 0:e.$el.querySelectorAll(".k-item"))??[];for(const i of s)delete i.dataset.selected;t>=0&&(s[t].dataset.selected=!0)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-search-bar"},[e("div",{staticClass:"k-search-bar-input"},[t.typesDropdown.length>1?[e("k-button",{staticClass:"k-search-bar-types",attrs:{dropdown:!0,icon:t.types[t.type].icon,text:t.types[t.type].label,variant:"dimmed"},on:{click:function(e){return t.$refs.types.toggle()}}}),e("k-dropdown-content",{ref:"types",attrs:{options:t.typesDropdown}})]:t._e(),e("k-search-input",{ref:"input",attrs:{"aria-label":t.$t("search"),autofocus:!0,value:t.query},on:{input:function(e){t.query=e}},nativeOn:{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,"enter",13,e.key,"Enter")?null:t.onEnter.apply(null,arguments)}]}}),e("k-button",{staticClass:"k-search-bar-close",attrs:{icon:t.isLoading?"loader":"cancel",title:t.$t("close")},on:{click:function(e){return t.$emit("close")}}})],2),t.results?e("div",{staticClass:"k-search-bar-results"},[t.results.length?e("k-collection",{ref:"results",attrs:{items:t.results},nativeOn:{mouseout:function(e){return t.select(-1)}}}):t._e(),e("footer",{staticClass:"k-search-bar-footer"},[0===t.results.length?e("p",[t._v(" "+t._s(t.$t("search.results.none"))+" ")]):t._e(),t.results.length({fields:{},isLoading:!0,issue:null}),watch:{timestamp(){this.fetch()}},mounted(){this.fetch()},methods:{async fetch(){try{const t=await this.load();this.fields=t.fields;for(const e in this.fields)this.fields[e].section=this.name,this.fields[e].endpoints={field:this.parent+"/fields/"+e,section:this.parent+"/sections/"+this.name,model:this.parent}}catch(t){this.issue=t}finally{this.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return t.isLoading?t._e():e("k-section",{class:["k-fields-section",t.$attrs.class],style:t.$attrs.style,attrs:{headline:t.issue?t.$t("error"):null}},[t.issue?e("k-box",{attrs:{text:t.issue.message,html:!1,icon:"alert",theme:"negative"}}):t._e(),e("k-form",{attrs:{fields:t.fields,validate:!0,value:t.content,disabled:t.lock&&"lock"===t.lock.state},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],1)}),[]).exports;const ha=nt({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("filter"),click:this.onSearchToggle,responsive:!0}),this.canAdd&&t.push({icon:this.addIcon,text:this.$t("add"),click:this.onAdd,responsive:!0}),t},canAdd:()=>!0,canDrop:()=>!1,canSearch(){return this.options.search},collection(){return{columns:this.options.columns,empty:this.emptyPropsWithSearch,fields:this.options.fields,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(){this.search()},timestamp(){this.reload()}},mounted(){this.search=Bt(this.search,200),this.load()},methods:{async load(t){this.isProcessing=!0,t||(this.isLoading=!0);const e=this.pagination.page??localStorage.getItem(this.paginationId)??1;try{const t=await this.$api.get(this.parent+"/sections/"+this.name,{page:e,searchterm:this.searchterm});this.options=t.options,this.pagination=t.pagination,this.data=t.data}catch(s){this.error=s.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},async reload(){await this.load(!0)},async search(){this.pagination.page=0,await this.reload()},update(){this.reload(),this.$events.emit("model.update")}}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("k-section",{class:["k-models-section",`k-${t.type}-section`,t.$attrs.class],style:t.$attrs.style,attrs:{buttons:t.buttons,"data-processing":t.isProcessing,headline:t.options.headline??" ",invalid:t.isInvalid,link:t.options.link,required:Boolean(t.options.min)}},[t.error?e("k-box",{attrs:{icon:"alert",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("filter")+" …",value:t.searchterm,icon:"search",type:"text"},on:{input:function(e){t.searchterm=e}},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.onSearchToggle.apply(null,arguments)}}}):t._e(),e("k-collection",t._g(t._b({on:{action:t.onAction,change:t.onChange,sort:t.onSort,paginate:t.onPaginate}},"k-collection",t.collection,!1),t.canAdd?{empty:t.onAdd}:{}))],1)]],2):t._e()}),[]).exports;const ma=nt({extends:ha,computed:{addIcon:()=>"upload",canAdd(){return this.$panel.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,column:this.column,data:{"data-id":t.id,"data-template":t.template},options:this.$dropdown(t.link,{query:{view:"list",delete:this.data.length>this.options.min}}),sortable:t.permissions.sort&&this.options.sortable})))},type:()=>"files",uploadOptions(){return{...this.options.upload,url:this.$panel.urls.api+"/"+this.options.upload.api,on:{complete:()=>{this.$panel.notification.success({context:"view"}),this.$events.emit("file.upload")}}}}},mounted(){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.$panel.upload.pick(this.uploadOptions)},onDrop(t){this.canAdd&&this.$panel.upload.open(t,this.uploadOptions)},async onSort(t){if(!1===this.options.sortable)return!1;this.isProcessing=!0;try{await this.$api.patch(this.options.apiUrl+"/sort",{files:t.map((t=>t.id)),index:this.pagination.offset}),this.$panel.notification.success(),this.$events.emit("file.sort")}catch(e){this.$panel.error(e),this.reload()}finally{this.isProcessing=!1}},replace(t){this.$panel.upload.replace(t,this.uploadOptions)}}},null,null).exports;const fa=nt({mixins:[pa],inheritAttrs:!1,data:()=>({icon:null,label:null,text:null,theme:null}),async mounted(){const t=await this.load();this.icon=t.icon,this.label=t.label,this.text=t.text,this.theme=t.theme??"info"}},(function(){var t=this,e=t._self._c;return e("k-section",{class:["k-info-section",t.$attrs.class],style:t.$attrs.style,attrs:{headline:t.label}},[e("k-box",{attrs:{html:!0,icon:t.icon,text:t.text,theme:t.theme}})],1)}),[]).exports;const ga=nt({extends:ha,computed:{canAdd(){return this.options.add&&this.$panel.permissions.pages.create},items(){return this.data.map((t=>{const e=t.permissions.sort&&this.options.sortable,s=this.data.length>this.options.min;return{...t,buttons:[{...this.$helper.page.status(t.status,!1===t.permissions.changeStatus),click:()=>this.$dialog(t.link+"/changeStatus")},...t.buttons??[]],column:this.column,data:{"data-id":t.id,"data-status":t.status,"data-template":t.template},deletable:s,options:this.$dropdown(t.link,{query:{view:"list",delete:s,sort:e}}),sortable:e}}))},type:()=>"pages"},mounted(){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.$panel.notification.success(),this.$events.emit("page.sort",i)}catch(s){this.$panel.error({message:s.message,details:s.details}),await this.reload()}finally{this.isProcessing=!1}}}}},null,null).exports;const ka=nt({mixins:[pa],data:()=>({headline:null,isLoading:!0,reports:null,size:null}),async mounted(){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("k-section",{staticClass:"k-stats-section",attrs:{headline:t.headline}},[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.$t("stats.empty")))])],1):t._e()}),[]).exports,ba={install(t){t.component("k-section",ca),t.component("k-sections",ua),t.component("k-fields-section",da),t.component("k-files-section",ma),t.component("k-info-section",fa),t.component("k-pages-section",ga),t.component("k-stats-section",ka)}};const ya=nt({components:{"k-highlight":()=>cr((()=>import("./Highlight.min.js")),__vite__mapDeps([5,1]),import.meta.url)},props:{language:{type:String}}},(function(){var t=this,e=t._self._c;return e("k-highlight",[e("div",[e("pre",{staticClass:"k-code",attrs:{"data-language":t.language}},[e("code",{key:t.$slots.default[0].text+"-"+t.language,class:t.language?`language-${t.language}`:null},[t._t("default")],2)])])])}),[]).exports;const va=nt({props:{link:String,tag:{type:String,default:"h2"}},emits:["click"]},(function(){var t=this,e=t._self._c;return e(t.tag,{tag:"component",staticClass:"k-headline",on:{click:function(e){return t.$emit("click",e)}}},[t.link?e("k-link",{attrs:{to:t.link}},[t._t("default")],2):t._t("default")],2)}),[]).exports;const $a=nt({props:{input:{type:[String,Number]},invalid:{type:Boolean},link:{type:String},required:{default:!1,type:Boolean},type:{default:"field",type:String}},computed:{element(){return"section"===this.type?"h2":"label"}}},(function(){var t=this,e=t._self._c;return e(t.element,{tag:"component",staticClass:"k-label",class:"k-"+t.type+"-label",attrs:{for:t.input}},[t.link?e("k-link",{attrs:{to:t.link}},[e("span",{staticClass:"k-label-text"},[t._t("default")],2)]):e("span",{staticClass:"k-label-text"},[t._t("default")],2),t.required?e("abbr",{attrs:{title:t.$t(t.type+".required")}},[t._v("✶")]):t._e(),e("abbr",{staticClass:"k-label-invalid",attrs:{title:t.$t(t.type+".invalid")}},[t._v("×")])],1)}),[]).exports;const wa=nt({props:{align:String,html:String,size:String},computed:{attrs(){return{class:"k-text","data-align":this.align,"data-size":this.size}}}},(function(){var t=this,e=t._self._c;return t.html?e("div",t._b({domProps:{innerHTML:t._s(t.html)}},"div",t.attrs,!1)):e("div",t._b({},"div",t.attrs,!1),[t._t("default")],2)}),[]).exports,xa={install(t){t.component("k-code",ya),t.component("k-headline",va),t.component("k-label",$a),t.component("k-text",wa)}},_a={props:{back:String,color:String,cover:{type:Boolean,default:!0},icon:String,type:String,url:String}};const Sa=nt({mixins:[_a],computed:{fallbackColor(){var t,e,s;return(null==(t=this.type)?void 0:t.startsWith("image/"))?"orange-500":(null==(e=this.type)?void 0:e.startsWith("audio/"))?"aqua-500":(null==(s=this.type)?void 0:s.startsWith("video/"))?"yellow-500":"white"},fallbackIcon(){var t,e,s;return(null==(t=this.type)?void 0:t.startsWith("image/"))?"image":(null==(e=this.type)?void 0:e.startsWith("audio/"))?"audio":(null==(s=this.type)?void 0:s.startsWith("video/"))?"video":"file"},isPreviewable(){return["image/jpeg","image/jpg","image/gif","image/png","image/webp","image/avif","image/svg+xml"].includes(this.type)}}},(function(){var t=this,e=t._self._c;return e("a",{staticClass:"k-upload-item-preview",attrs:{href:t.url,target:"_blank"}},[t.isPreviewable?e("k-image",{attrs:{cover:t.cover,src:t.url,back:t.back??"pattern"}}):e("k-icon-frame",{attrs:{color:t.color??t.fallbackColor,icon:t.icon??t.fallbackIcon,back:t.back??"black",ratio:"1/1"}})],1)}),[]).exports;const Ca=nt({mixins:[_a],props:{completed:Boolean,editable:{type:Boolean,default:!0},error:[String,Boolean],extension:String,id:String,name:String,niceSize:String,progress:Number,removable:{type:Boolean,default:!0}},emits:["remove","rename"]},(function(){var t=this,e=t._self._c;return e("li",{staticClass:"k-upload-item",attrs:{"data-completed":t.completed}},[e("k-upload-item-preview",{attrs:{back:t.back,color:t.color,cover:t.cover,icon:t.icon,type:t.type,url:t.url}}),e("k-input",{staticClass:"k-upload-item-input",attrs:{disabled:t.completed||!t.editable,after:"."+t.extension,required:!0,value:t.name,allow:"a-z0-9@._-",type:"slug"},on:{input:function(e){return t.$emit("rename",e)}}}),e("div",{staticClass:"k-upload-item-body"},[e("p",{staticClass:"k-upload-item-meta"},[t._v(" "+t._s(t.niceSize)+" "),t.progress?[t._v(" - "+t._s(t.progress)+"% ")]:t._e()],2),t.error?e("p",{staticClass:"k-upload-item-error"},[t._v(" "+t._s(t.error)+" ")]):t.progress?e("k-progress",{staticClass:"k-upload-item-progress",attrs:{value:t.progress}}):t._e()],1),e("div",{staticClass:"k-upload-item-toggle"},[t.completed||t.progress||!t.removable?!t.completed&&t.progress?e("k-button",{attrs:{disabled:!0,icon:"loader"}}):t.completed?e("k-button",{attrs:{icon:"check",theme:"positive"},on:{click:function(e){return t.$emit("remove")}}}):t._e():e("k-button",{attrs:{icon:"remove"},on:{click:function(e){return t.$emit("remove")}}})],1)],1)}),[]).exports;const Oa=nt({props:{items:Array},emits:["remove","rename"]},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-upload-items"},t._l(t.items,(function(s){return e("k-upload-item",t._b({key:s.id,on:{rename:function(e){return t.$emit("rename",s,e)},remove:function(e){return t.$emit("remove",s)}}},"k-upload-item",s,!1))})),1)}),[]).exports,Ma={install(t){t.component("k-upload-item",Ca),t.component("k-upload-item-preview",Sa),t.component("k-upload-items",Oa)}};const Aa=nt({props:{status:{default:"missing",type:String}}},(function(){var t=this,e=t._self._c;return t.$panel.activation.isOpen?e("div",{staticClass:"k-activation"},[e("p",[e("strong",[t._v(t._s(t.$t(`license.status.${t.status}.bubble`)))]),"missing"===t.status?[e("a",{attrs:{href:"https://getkirby.com/buy",target:"_blank"}},[t._v(t._s(t.$t("license.buy")))]),t._v(" & "),e("button",{attrs:{type:"button"},on:{click:function(e){return t.$dialog("registration")}}},[t._v(" "+t._s(t.$t("license.activate"))+" ")])]:t._e()],2),e("k-button",{staticClass:"k-activation-toggle",attrs:{icon:"cancel-small"},on:{click:function(e){return t.$panel.activation.close()}}})],1):t._e()}),[]).exports;const Da=nt({mixins:[Gr],props:{hasChanges:Boolean,options:String},computed:{changesBadge(){return this.hasChanges||this.$panel.content.hasChanges?{theme:this.$panel.content.isLocked()?"red":"orange"}:null}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-view-button k-languages-dropdown"},[e("k-button",t._b({attrs:{badge:t.changesBadge,dropdown:!0},on:{click:function(e){return t.$refs.dropdown.toggle()}}},"k-button",t.$props,!1)),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.$dropdown(t.options),"align-x":"end"},on:{action:function(e){return t.$emit("action",e)}},scopedSlots:t._u([{key:"item",fn:function({item:s,index:i}){return[e("k-button",t._b({key:"item-"+i,staticClass:"k-dropdown-item k-languages-dropdown-item"},"k-button",s,!1),[t._v(" "+t._s(s.text)+" "),e("span",{staticClass:"k-languages-dropdown-item-info",attrs:{"data-lock":s.lock}},[s.changes?e("k-icon",{staticClass:"k-languages-dropdown-item-icon",attrs:{alt:t.$t("lock.unsaved"),type:s.lock?"lock":"edit-line"}}):t._e(),e("span",{staticClass:"k-languages-dropdown-item-code"},[t._v(" "+t._s(s.code.toUpperCase())+" ")])],1)])]}}])})],1)}),[]).exports;const ja=nt({extends:Xr,props:{options:[Array,String],size:{default:"sm"},variant:{default:"filled"}},emits:["action","click"],computed:{hasDropdown(){return!0===Array.isArray(this.options)?this.options.length>0:Boolean(this.options)}},methods:{onClick(){if(this.hasDropdown)return this.$refs.dropdown.toggle();this.$emit("click")}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-view-button"},[e("k-button",t._b({attrs:{dropdown:t.dropdown||t.hasDropdown},on:{click:t.onClick}},"k-button",t.$props,!1)),t.hasDropdown?e("k-dropdown-content",{ref:"dropdown",attrs:{options:Array.isArray(t.options)?t.options:t.$dropdown(t.options),"align-x":"end"},on:{action:function(e){return t.$emit("action",e)}}}):t._e()],1)}),[]).exports;const Ea=nt({extends:ja,emits:["action"]},(function(){var t=this;return(0,t._self._c)("k-view-button",t._b({attrs:{disabled:t.$panel.content.isLocked()},on:{action:function(e){return t.$emit("action",e)}}},"k-view-button",t.$props,!1))}),[]).exports;const Ta=nt({extends:ja},(function(){var t=this;return(0,t._self._c)("k-view-button",t._b({attrs:{disabled:t.disabled||t.$panel.content.isLocked()}},"k-view-button",t.$props,!1))}),[]).exports;const La=nt({computed:{current(){return this.$panel.theme.current},options(){return[{text:this.$t("theme.light"),icon:"sun",disabled:"light"===this.setting,click:()=>this.$panel.theme.set("light")},{text:this.$t("theme.dark"),icon:"moon",disabled:"dark"===this.setting,click:()=>this.$panel.theme.set("dark")},{text:this.$t("theme.automatic"),icon:"wand",disabled:null===this.setting,click:()=>this.$panel.theme.reset()}]},setting(){return this.$panel.theme.setting}}},(function(){var t=this;return(0,t._self._c)("k-view-button",{attrs:{icon:"light"===t.current?"sun":"moon",options:t.options,text:t.$t("theme")}})}),[]).exports;const Ba=nt({props:{buttons:{type:Array,default:()=>[]}},emits:["action"],methods:{component(t){return this.$helper.isComponent(t.component)?t.component:"k-view-button"}}},(function(){var t=this,e=t._self._c;return t.buttons.length?e("k-button-group",{staticClass:"k-view-buttons"},t._l(t.buttons,(function(s){return e(t.component(s),t._b({key:s.key,tag:"component",on:{action:function(e){return t.$emit("action",e)}}},"component",s.props,!1))})),1):t._e()}),[]).exports,Ia={install(t){t.component("k-languages-dropdown",Da),t.component("k-settings-view-button",Ea),t.component("k-status-view-button",Ta),t.component("k-theme-view-button",La),t.component("k-view-button",ja),t.component("k-view-buttons",Ba)}};const qa=nt({computed:{notification(){return"view"!==this.$panel.notification.context||this.$panel.notification.isFatal?null:this.$panel.notification}}},(function(){var t=this,e=t._self._c;return e("k-panel",{staticClass:"k-panel-inside"},[e("k-panel-menu"),e("main",{staticClass:"k-panel-main"},[e("k-topbar",{attrs:{breadcrumb:t.$panel.view.breadcrumb,view:t.$panel.view}},[t._t("topbar")],2),t._t("default")],2),t.notification&&"error"!==t.notification.type?e("k-button",{staticClass:"k-panel-notification",attrs:{icon:t.notification.icon,text:t.notification.message,theme:t.notification.theme,variant:"filled"},on:{click:function(e){return t.notification.close()}}}):t._e()],1)}),[]).exports;const Pa=nt({data:()=>({over:!1}),computed:{activationButton(){return"missing"===this.$panel.license?{click:()=>this.$dialog("registration"),text:this.$t("activate")}:"legacy"===this.$panel.license&&{click:()=>this.$dialog("license"),text:this.$t("renew")}},hasSearch(){return this.$helper.object.length(this.$panel.searches)>0},menus(){return this.$helper.array.split(this.$panel.menu.entries,"-")}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-panel-menu",attrs:{"aria-label":t.$t("menu"),"data-hover":t.$panel.menu.hover},on:{mouseenter:function(e){t.$panel.menu.hover=!0},mouseleave:function(e){t.$panel.menu.hover=!1}}},[e("div",{staticClass:"k-panel-menu-body"},[t.hasSearch?e("k-button",{staticClass:"k-panel-menu-search k-panel-menu-button",attrs:{text:t.$t("search"),icon:"search"},on:{click:function(e){return t.$panel.search()}}}):t._e(),t._l(t.menus,(function(s,i){return e("menu",{key:i,staticClass:"k-panel-menu-buttons",attrs:{"data-second-last":i===t.menus.length-2}},t._l(s,(function(s){return e("k-button",t._b({key:s.id,staticClass:"k-panel-menu-button",attrs:{title:s.title??s.text}},"k-button",s,!1))})),1)})),t.activationButton?e("menu",[e("k-button",t._b({staticClass:"k-activation-button k-panel-menu-button",attrs:{icon:"key",theme:"love",variant:"filled"}},"k-button",t.activationButton,!1)),e("k-activation",{attrs:{status:t.$panel.license}})],1):t._e()],2),e("k-button",{staticClass:"k-panel-menu-toggle",attrs:{icon:t.$panel.menu.isOpen?"angle-left":"angle-right",title:t.$panel.menu.isOpen?t.$t("collapse"):t.$t("expand"),size:"xs"},on:{click:function(e){return t.$panel.menu.toggle()}}})],1)}),[]).exports;const Na=nt({},(function(){return(0,this._self._c)("k-panel",{staticClass:"k-panel-outside",attrs:{tabindex:"0"}},[this._t("default")],2)}),[]).exports;const Fa=nt({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-panel",attrs:{"data-dragging":t.$panel.drag.isDragging,"data-loading":t.$panel.isLoading,"data-language":t.$panel.language.code,"data-language-default":t.$panel.language.isDefault,"data-menu":t.$panel.menu.isOpen?"true":"false","data-role":t.$panel.user.role,"data-theme":t.$panel.theme.current,"data-translation":t.$panel.translation.code,"data-user":t.$panel.user.id,dir:t.$panel.direction}},[t._t("default"),t.$panel.dialog.isOpen&&!t.$panel.dialog.legacy?e("k-fiber-dialog"):t._e(),t.$panel.drawer.isOpen&&!t.$panel.drawer.legacy?e("k-fiber-drawer"):t._e(),t.$panel.notification.isFatal&&t.$panel.notification.isOpen?e("k-fatal",{attrs:{html:t.$panel.notification.message}}):t._e(),e("k-offline-warning"),e("k-icons"),e("k-overlay",{attrs:{nested:t.$panel.drawer.history.milestones.length>1,visible:t.$panel.drawer.isOpen,type:"drawer"},on:{close:function(e){return t.$panel.drawer.close()}}},[e("portal-target",{staticClass:"k-drawer-portal k-portal",attrs:{name:"drawer",multiple:""}})],1),e("k-overlay",{attrs:{visible:t.$panel.dialog.isOpen,type:"dialog"},on:{close:function(e){return t.$panel.dialog.close()}}},[e("portal-target",{staticClass:"k-dialog-portal k-portal",attrs:{name:"dialog",multiple:""}})],1),e("portal-target",{staticClass:"k-overlay-portal k-portal",attrs:{name:"overlay",multiple:""}})],2)}),[]).exports;const za=nt({props:{breadcrumb:Array,view:Object},computed:{crumbs(){return[{link:this.view.link,label:this.view.label??this.view.breadcrumbLabel,icon:this.view.icon,loading:this.$panel.isLoading},...this.breadcrumb]}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-topbar"},[e("k-button",{staticClass:"k-panel-menu-proxy",attrs:{icon:"bars"},on:{click:function(e){return t.$panel.menu.toggle()}}}),e("k-breadcrumb",{staticClass:"k-topbar-breadcrumb",attrs:{crumbs:t.crumbs}}),e("div",{staticClass:"k-topbar-spacer"}),e("div",{staticClass:"k-topbar-signals"},[t._t("default")],2)],1)}),[]).exports,Ya={install(t){t.use(Ia),t.component("k-activation",Aa),t.component("k-panel",Fa),t.component("k-panel-inside",qa),t.component("k-panel-menu",Pa),t.component("k-panel-outside",Na),t.component("k-topbar",za)}};const Ra=nt({props:{error:String,layout:String}},(function(){var t=this,e=t._self._c;return e(`k-panel-${t.layout}`,{tag:"component",staticClass:"k-error-view"},["outside"===t.layout?[e("div",[e("k-box",{attrs:{icon:"alert",theme:"negative"}},[t._v(t._s(t.error))])],1)]:[e("k-header",[t._v(t._s(t.$t("error")))]),e("k-box",{attrs:{icon:"alert",theme:"negative"}},[t._v(t._s(t.error))])]],2)}),[]).exports;const Ha=nt({props:{api:String,blueprint:String,buttons:Array,content:Object,id:String,link:String,lock:{type:[Boolean,Object]},model:Object,next:Object,originals:Object,prev:Object,permissions:{type:Object,default:()=>({})},tab:{type:Object,default:()=>({columns:[]})},tabs:{type:Array,default:()=>[]},uuid:String},data:()=>({isSaved:!0}),computed:{changes(){return this.$panel.content.changes(this.api)},editor(){return this.lock.user.email},hasChanges(){return gt(this.changes)>0},hasTabs(){return this.tabs.length>1},isLocked(){return this.lock.isLocked},modified(){return this.lock.modified}},mounted(){this.$events.on("beforeunload",this.onBeforeUnload),this.$events.on("content.save",this.onContentSave),this.$events.on("keydown.left",this.toPrev),this.$events.on("keydown.right",this.toNext),this.$events.on("model.reload",this.$reload),this.$events.on("view.save",this.onViewSave)},destroyed(){this.$events.off("beforeunload",this.onBeforeUnload),this.$events.off("content.save",this.onContentSave),this.$events.off("keydown.left",this.toPrev),this.$events.off("keydown.right",this.toNext),this.$events.off("model.reload",this.$reload),this.$events.off("view.save",this.onViewSave)},methods:{onBeforeUnload(t){!0!==this.$panel.content.isProcessing&&!1!==this.isSaved||(t.preventDefault(),t.returnValue="")},onContentSave({api:t}){t===this.api&&(this.isSaved=!0)},async onDiscard(){await this.$panel.content.discard(this.api),this.$panel.view.refresh()},onInput(t){this.$panel.content.update(t,this.api)},async onSubmit(){await this.$panel.content.publish(this.content,this.api),this.$panel.notification.success(),this.$events.emit("model.update"),await this.$panel.view.refresh()},onViewSave(t){var e;null==(e=null==t?void 0:t.preventDefault)||e.call(t),this.onSubmit()},toNext(t){this.next&&"body"===t.target.localName&&this.$go(this.next.link)},toPrev(t){this.prev&&"body"===t.target.localName&&this.$go(this.prev.link)}}},null,null).exports;const Va=nt({extends:Ha,props:{back:String,mode:String,src:Object,title:String},computed:{modes(){return{changes:{label:this.$t("version.changes"),icon:"layout-left",current:"changes"===this.mode,click:()=>this.changeMode("changes")},compare:{label:this.$t("version.compare"),icon:"layout-columns",current:"compare"===this.mode,click:()=>this.changeMode("compare")},latest:{label:this.$t("version.latest"),icon:"layout-right",current:"latest"===this.mode,click:()=>this.changeMode("latest")}}},dropdown(){return[this.modes.compare,"-",this.modes.latest,this.modes.changes]}},mounted(){this.$events.on("keydown.esc",this.onExit),this.$events.on("content.publish",this.onPublish)},destroyed(){this.$events.off("keydown.esc",this.onExit),this.$events.off("content.publish",this.onPublish)},methods:{changeMode(t){t&&this.modes[t]&&this.$panel.view.open(this.link+"/preview/"+t)},onExit(){this.$panel.overlays().length>0||this.$panel.view.open(this.link)},onPublish(){this.$refs.latest.contentWindow.location.reload()}}},(function(){var t=this,e=t._self._c;return e("k-panel",{staticClass:"k-panel-inside k-preview-view"},[e("header",{staticClass:"k-preview-view-header"},[e("k-button-group",[e("k-button",{attrs:{link:t.back,responsive:!0,title:t.$t("back"),icon:"angle-left",size:"sm",variant:"filled"}}),e("k-button",{attrs:{icon:"title",element:"span"}},[t._v(" "+t._s(t.title)+" ")])],1),e("k-button-group",[e("k-button",{attrs:{icon:t.modes[t.mode].icon,dropdown:!0,responsive:!0,title:t.modes[t.mode].label,size:"sm",variant:"filled"},on:{click:function(e){return t.$refs.view.toggle()}}}),e("k-dropdown-content",{ref:"view",attrs:{options:t.dropdown,"align-x":"end"}})],1)],1),e("main",{staticClass:"k-preview-view-grid",attrs:{"data-mode":t.mode}},["latest"===t.mode||"compare"===t.mode?e("section",{staticClass:"k-preview-view-panel"},[e("header",[e("k-headline",[t._v(t._s(t.modes.latest.label))]),e("k-button-group",[e("k-button",{attrs:{size:"sm",variant:"filled",icon:"compare"===t.mode?"expand-horizontal":"collapse-horizontal"},on:{click:function(e){return t.changeMode("compare"===t.mode?"latest":"compare")}}}),e("k-button",{attrs:{link:t.src.latest,icon:"open",size:"sm",target:"_blank",variant:"filled"}})],1)],1),e("iframe",{ref:"latest",attrs:{src:t.src.latest}})]):t._e(),"changes"===t.mode||"compare"===t.mode?e("section",{staticClass:"k-preview-view-panel"},[e("header",[e("k-headline",[t._v(t._s(t.modes.changes.label))]),e("k-button-group",[e("k-button",{attrs:{size:"sm",variant:"filled",icon:"compare"===t.mode?"expand-horizontal":"collapse-horizontal"},on:{click:function(e){return t.changeMode("compare"===t.mode?"changes":"compare")}}}),e("k-button",{attrs:{link:t.src.changes,icon:"open",size:"sm",target:"_blank",variant:"filled"}}),e("k-form-controls",{attrs:{editor:t.editor,"has-changes":t.hasChanges,"is-locked":t.isLocked,modified:t.modified,size:"sm"},on:{discard:t.onDiscard,submit:t.onSubmit}})],1)],1),t.hasChanges?e("iframe",{ref:"changes",attrs:{src:t.src.changes}}):e("k-empty",[t._v(" "+t._s(t.$t("lock.unsaved.empty"))+" "),e("k-button",{attrs:{icon:"edit",variant:"filled",link:t.back}},[t._v(" "+t._s(t.$t("edit"))+" ")])],1)],1):t._e()])])}),[]).exports;const Ua=nt({mixins:[It],props:{type:{default:"pages",type:String}},data:()=>({query:new URLSearchParams(window.location.search).get("query"),pagination:{},results:[]}),computed:{currentType(){return this.$panel.searches[this.type]??Object.values(this.$panel.searches)[0]},empty(){return this.isLoading?this.$t("searching")+"…":this.query.length<2?this.$t("search.min",{min:2}):this.$t("search.results.none")},isLoading(){return this.$panel.searcher.isLoading},tabs(){const t=[];for(const e in this.$panel.searches){const s=this.$panel.searches[e];t.push({label:s.label,link:"/search/?type="+e+"&query="+this.query,name:e})}return t}},watch:{isLoading(t){this.$panel.isLoading=t},query:{handler(){this.search(1)},immediate:!0},type(){this.search()}},methods:{focus(){var t;null==(t=this.$refs.input)||t.focus()},onPaginate(t){this.search(t.page)},async search(t){t||(t=new URLSearchParams(window.location.search).get("page")??1);const e=this.$panel.url(window.location,{type:this.currentType.id,query:this.query,page:t});window.history.pushState("","",e.toString());const s=await this.$panel.search(this.currentType.id,this.query,{page:t,limit:15});s&&(this.results=s.results??[],this.pagination=s.pagination)}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-search-view"},[e("k-header",[t._v(" "+t._s(t.$t("search"))+" "),e("k-input",{ref:"input",staticClass:"k-search-view-input",attrs:{slot:"buttons","aria-label":t.$t("search"),autofocus:!0,icon:t.isLoading?"loader":"search",placeholder:t.$t("search")+" …",spellcheck:!1,value:t.query,type:"text"},on:{input:function(e){t.query=e}},slot:"buttons"})],1),e("k-tabs",{attrs:{tab:t.currentType.id,tabs:t.tabs}}),e("div",{staticClass:"k-search-view-results"},[e("k-collection",{attrs:{items:t.results,empty:{icon:t.isLoading?"loader":"search",text:t.empty},pagination:t.pagination},on:{paginate:t.onPaginate}})],1)],1)}),[]).exports;const Ka=nt({extends:Ha,props:{extension:String,filename:String,mime:String,preview:Object,type:String,url:String},methods:{onAction(t){if("replace"===t)return this.$panel.upload.replace({extension:this.extension,filename:this.filename,image:this.preview.image,link:this.link,mime:this.mime,url:this.url})}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-file-view",attrs:{"data-has-tabs":t.hasTabs,"data-id":t.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{staticClass:"k-file-view-header",attrs:{editable:t.permissions.changeName&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.api+"/changeName")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-view-buttons",{attrs:{buttons:t.buttons},on:{action:t.onAction}}),e("k-form-controls",{attrs:{editor:t.editor,"has-changes":t.hasChanges,"is-locked":t.isLocked,modified:t.modified},on:{discard:t.onDiscard,submit:t.onSubmit}})]},proxy:!0}])},[t._v(" "+t._s(t.filename)+" ")]),e("k-file-preview",t._b({attrs:{content:t.content,"is-locked":t.isLocked},on:{input:t.onInput,submit:t.onSubmit}},"k-file-preview",t.preview,!1)),e("k-model-tabs",{attrs:{changes:t.changes,tab:t.tab.name,tabs:t.tabs}}),e("k-sections",{attrs:{blueprint:t.blueprint,content:t.content,empty:t.$t("file.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.api,tab:t.tab},on:{input:t.onInput,submit:t.onSubmit}})],1)}),[]).exports;const Wa=nt({props:{component:String,content:Object,isLocked:Boolean,props:Object},emits:["input","submit"],computed:{preview(){return this.$helper.isComponent(this.component)?this.component:"k-default-file-preview"}}},(function(){var t=this;return(0,t._self._c)(t.preview,t._b({tag:"component",staticClass:"k-file-preview",attrs:{content:t.content,"is-locked":t.isLocked},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}},"component",t.props,!1))}),[]).exports;const Ja=nt({props:{details:{default:()=>[],type:Array}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-file-preview-details"},[e("dl",[t._l(t.details,(function(s){return e("div",{key:s.title},[e("dt",[t._v(t._s(s.title))]),e("dd",[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)])})),t._t("default")],2)])}),[]).exports;const Ga=nt({props:{options:{default:()=>[],type:Array}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-file-preview-frame-column"},[e("div",{staticClass:"k-file-preview-frame"},[t._t("default"),t.options.length?[e("k-button",{staticClass:"k-file-preview-frame-dropdown-toggle",attrs:{icon:"dots",size:"xs"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.options,theme:"light"},on:{action:function(e){return t.$emit("action",e)}}})]:t._e()],2)])}),[]).exports;const Xa=nt({props:{details:Array,image:{default:()=>({}),type:Object}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-default-file-preview"},[e("k-file-preview-frame",[e("k-icon",{staticClass:"k-item-icon",attrs:{color:t.$helper.color(t.image.color),type:t.image.icon}})],1),e("k-file-preview-details",{attrs:{details:t.details}})],1)}),[]).exports;const Za=nt({props:{details:Array,url:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-audio-file-preview"},[e("audio",{attrs:{controls:"",preload:"metadata",src:t.url}}),e("k-file-preview-details",{attrs:{details:t.details}})],1)}),[]).exports;const Qa=nt({props:{content:{default:()=>({}),type:Object},details:Array,focusable:Boolean,image:{default:()=>({}),type:Object},isLocked:Boolean,url:String},emits:["focus","input"],computed:{focus(){const t=this.content.focus;if(!t)return;const[e,s]=t.replaceAll("%","").split(" ");return{x:parseFloat(e),y:parseFloat(s)}},hasFocus(){return Boolean(this.focus)},isFocusable(){return!0===this.focusable&&!0!==this.isLocked},options(){return[{icon:"open",text:this.$t("open"),link:this.url,target:"_blank"},{icon:"cancel",text:this.$t("file.focus.reset"),click:()=>this.setFocus(void 0),when:this.isFocusable&&this.hasFocus},{icon:"preview",text:this.$t("file.focus.placeholder"),click:()=>this.setFocus({x:50,y:50}),when:this.isFocusable&&!this.hasFocus}]}},methods:{setFocus(t){if(!1===this.isFocusable)return!1;t?!0===this.$helper.object.isObject(t)&&(t=`${t.x.toFixed(1)}% ${t.y.toFixed(1)}%`):t=null,this.$emit("input",{focus:t})}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-default-file-preview k-image-file-preview",attrs:{"data-has-focus":t.hasFocus}},[e("k-file-preview-frame",{attrs:{options:t.options}},[e("k-coords-input",{attrs:{disabled:!t.isFocusable,value:t.focus},on:{input:function(e){return t.setFocus(e)}}},[e("img",t._b({on:{dragstart:function(t){t.preventDefault()}}},"img",t.image,!1))])],1),e("k-file-preview-details",{attrs:{details:t.details}},[t.image.src?e("div",{staticClass:"k-image-file-preview-focus"},[e("dt",[t._v(t._s(t.$t("file.focus.title")))]),e("dd",[t.isFocusable?e("k-button",{ref:"focus",attrs:{icon:t.focus?"cancel-small":"preview",title:t.focus?t.$t("file.focus.reset"):void 0,size:"xs",variant:"filled"},on:{click:function(e){t.focus?t.setFocus(void 0):t.setFocus({x:50,y:50})}}},[t.hasFocus?[t._v(t._s(t.focus.x)+"% "+t._s(t.focus.y)+"%")]:[t._v(t._s(t.$t("file.focus.placeholder")))]],2):t.hasFocus?[t._v(" "+t._s(t.focus.x)+"% "+t._s(t.focus.y)+"% ")]:[t._v("–")]],2)]):t._e()])],1)}),[]).exports;const tl=nt({props:{details:Array,url:String},computed:{options(){return[{icon:"download",text:this.$t("download"),link:this.url,download:!0}]}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-video-file-preview"},[e("k-file-preview-frame",{attrs:{options:t.options}},[e("video",{attrs:{controls:"",preload:"metadata",src:t.url}})]),e("k-file-preview-details",{attrs:{details:t.details}})],1)}),[]).exports,el={install(t){t.component("k-file-view",Ka),t.component("k-file-preview",Wa),t.component("k-file-preview-details",Ja),t.component("k-file-preview-frame",Ga),t.component("k-default-file-preview",Xa),t.component("k-audio-file-preview",Za),t.component("k-image-file-preview",Qa),t.component("k-video-file-preview",tl)}};const sl=nt({props:{isInstallable:Boolean,isInstalled:Boolean,isOk:Boolean,requirements:Object,translations:Array},data(){return{user:{name:"",email:"",language:this.$panel.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:"translate",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.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"})}catch(t){this.$panel.error(t)}}}},(function(){var t=this,e=t._self._c;return e("k-panel-outside",{staticClass:"k-installation-view"},[e("div",{staticClass:"k-dialog k-installation-dialog"},[e("k-dialog-body",[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,value:t.user},on:{input:function(e){t.user=e}}}),e("k-button",{attrs:{text:t.$t("install"),icon:"check",size:"lg",theme:"positive",type:"submit",variant:"filled"}})],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",size:"lg",theme:"positive",variant:"filled"},on:{click:t.$reload}})],1)],1)],1)])}),[]).exports,il={install(t){t.component("k-installation-view",sl)}};const nl=nt({props:{buttons:Array,languages:{type:Array,default:()=>[]},variables:{type:Boolean,default:!0}},computed:{languagesCollection(){return this.languages.map((t=>({...t,image:{back:"black",color:"gray",icon:"translate"},link:()=>{if(!1===this.variables)return null;this.$go(`languages/${t.id}`)},options:[{icon:"edit",text:this.$t("edit"),disabled:!1===this.variables,click:()=>this.$go(`languages/${t.id}`)},{icon:"cog",text:this.$t("settings"),disabled:!this.$panel.permissions.languages.update,click:()=>this.$dialog(`languages/${t.id}/update`)},{when:t.deletable,icon:"trash",text:this.$t("delete"),disabled:!this.$panel.permissions.languages.delete,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-panel-inside",{staticClass:"k-languages-view"},[e("k-header",{scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-view-buttons",{attrs:{buttons:t.buttons}})]},proxy:!0}])},[t._v(" "+t._s(t.$t("view.languages"))+" ")]),t.languages.length>0?[e("k-section",{attrs:{headline:t.$t("languages.default")}},[e("k-collection",{attrs:{items:t.primaryLanguage}})],1),e("k-section",{attrs:{headline:t.$t("languages.secondary")}},[t.secondaryLanguages.length?e("k-collection",{attrs:{items:t.secondaryLanguages}}):e("k-empty",{attrs:{icon:"translate",disabled:!t.$panel.permissions.languages.create},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:"translate",disabled:!t.$panel.permissions.languages.create},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.empty"))+" ")])]:t._e()],2)}),[]).exports;const ol=nt({props:{buttons:Array,code:String,deletable:Boolean,direction:String,id:String,info:Array,next:Object,name:String,prev:Object,translations:Array,url:String},computed:{canUpdate(){return this.$panel.permissions.languages.update}},methods:{createTranslation(){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/create`)},option(t,e){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/${window.btoa(encodeURIComponent(e.key))}/${t}`)},updateTranslation({row:t}){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/${window.btoa(encodeURIComponent(t.key))}/update`)}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-language-view",scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{attrs:{editable:t.canUpdate},on:{edit:function(e){return t.$dialog(`languages/${t.id}/update`)}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-view-buttons",{attrs:{buttons:t.buttons}})]},proxy:!0}])},[t._v(" "+t._s(t.name)+" ")]),e("k-section",{attrs:{headline:t.$t("language.settings")}},[e("k-stats",{attrs:{reports:t.info,size:"small"}})],1),e("k-section",{attrs:{buttons:[{click:t.createTranslation,disabled:!t.canUpdate,icon:"add",text:t.$t("add")}],headline:t.$t("language.variables")}},[t.translations.length?[e("k-table",{attrs:{columns:{key:{label:t.$t("language.variable.key"),mobile:!0,width:"1/4"},value:{label:t.$t("language.variable.value"),mobile:!0}},disabled:!t.canUpdate,rows:t.translations},on:{cell:t.updateTranslation,option:t.option}})]:[e("k-empty",{attrs:{disabled:!t.canUpdate,icon:"translate"},on:{click:t.createTranslation}},[t._v(" "+t._s(t.$t("language.variables.empty"))+" ")])]],2)],1)}),[]).exports,rl={install(t){t.component("k-languages-view",nl),t.component("k-language-view",ol)}};const al=nt({emits:["click"]},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-notification k-login-alert",attrs:{"data-theme":"error"}},[e("p",[t._t("default")],2),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return t.$emit("click")}}})],1)}),[]).exports,ll={props:{methods:{type:Array,default:()=>[]},pending:{type:Object,default:()=>({challenge:"email"})},value:String}};const cl=nt({mixins:[ll],emits:["error"],data(){return{code:this.value??"",isLoading:!1}},computed:{mode(){return this.methods.includes("password-reset")?"password-reset":"login"},submitText(){const t=this.isLoading?" …":"";return"password-reset"===this.mode?this.$t("login.reset")+t:this.$t("login")+t}},methods:{async login(){this.$emit("error",null),this.isLoading=!0;try{await this.$api.auth.verifyCode(this.code),this.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"}),"password-reset"===this.mode?this.$go("reset-password"):this.$reload()}catch(t){this.$emit("error",t)}finally{this.isLoading=!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)}}},[t.pending.email?e("k-user-info",{attrs:{user:t.pending.email}}):t._e(),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),placeholder:t.$t("login.code.placeholder."+t.pending.challenge),required:!0,value:t.code,autocomplete:"one-time-code",icon:"unlock",name:"code"},on:{input:function(e){t.code=e}}}),e("footer",{staticClass:"k-login-buttons"},[e("k-button",{staticClass:"k-login-button k-login-back-button",attrs:{text:t.$t("back"),icon:"angle-left",link:"/logout",size:"lg",variant:"filled"}}),e("k-button",{staticClass:"k-login-button",attrs:{text:t.submitText,icon:"check",size:"lg",type:"submit",theme:"positive",variant:"filled"}})],1)],1)}),[]).exports,ul={props:{methods:{type:Array,default:()=>[]},value:{type:Object,default:()=>({})}}};const pl=nt({mixins:[ul],emits:["error"],data(){return{mode:null,isLoading:!1,user:{email:"",password:"",remember:!1,...this.value}}},computed:{alternateMode(){return"email-password"===this.form?"email":"email-password"},canToggle(){return null!==this.codeMode&&(!1!==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(){const 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.mode?this.mode:"password"===this.methods[0]?"email-password":"email"},isResetForm(){return"password-reset"===this.codeMode&&"email"===this.form},submitText(){const t=this.isLoading?" …":"";return this.isResetForm?this.$t("login.reset")+t:this.$t("login")+t},toggleText(){return this.$t("login.toggleText."+this.codeMode+"."+this.alternateMode)}},methods:{async login(){this.$emit("error",null),this.isLoading=!0;const t={...this.user};"email"===this.mode&&(t.password=null),!0===this.isResetForm&&(t.remember=!1);try{await this.$api.auth.login(t),this.$reload({globals:["$system","$translation"]}),this.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"})}catch(e){this.$emit("error",e)}finally{this.isLoading=!1}},toggle(){this.mode=this.alternateMode,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("div",{staticClass:"k-login-fields"},[!0===t.canToggle?e("button",{staticClass:"k-login-toggler",attrs:{type:"button"},on:{click:t.toggle}},[t._v(" "+t._s(t.toggleText)+" ")]):t._e(),e("k-fieldset",{ref:"fieldset",attrs:{fields:t.fields,value:t.user},on:{input:function(e){t.user=e}}})],1),e("footer",{staticClass:"k-login-buttons"},[!1===t.isResetForm?e("k-checkbox-input",{attrs:{label:t.$t("login.remember"),checked:t.user.remember,value:t.user.remember},on:{input:function(e){t.user.remember=e}}}):t._e(),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",size:"lg",theme:"positive",type:"submit",variant:"filled"}},[t._v(" "+t._s(t.submitText)+" ")])],1)])}),[]).exports;const dl=nt({components:{"k-login-plugin-form":window.panel.plugins.login},mixins:[ll,ul],props:{value:{type:Object,default:()=>({code:"",email:"",password:""})}},data:()=>({issue:""}),computed:{component:()=>window.panel.plugins.login?"k-login-plugin-form":"k-login-form",form(){return this.pending.email?"code":"login"}},methods:{async onError(t){null!==t?(!0===t.details.challengeDestroyed&&await this.$reload({globals:["$system"]}),this.issue=t.message):this.issue=null}}},(function(){var t=this,e=t._self._c;return e("k-panel-outside",{class:"code"===t.form?"k-login-code-view":"k-login-view"},[e("div",{staticClass:"k-dialog k-login k-login-dialog"},[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("login"))+" ")]),t.issue?e("k-login-alert",{nativeOn:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),e("k-dialog-body",["code"===t.form?e("k-login-code-form",t._b({on:{error:t.onError}},"k-login-code-form",{methods:t.methods,pending:t.pending,value:t.value.code},!1)):e(t.component,t._b({tag:"component",on:{error:t.onError}},"component",{methods:t.methods,value:t.value},!1))],1)],1)])}),[]).exports,hl={install(t){t.component("k-login-alert",al),t.component("k-login-code-form",cl),t.component("k-login-form",pl),t.component("k-login-view",dl),t.component("k-login",pl),t.component("k-login-code",cl)}};const ml=nt({extends:Ha,props:{title:String}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-page-view",attrs:{"data-has-tabs":t.hasTabs,"data-id":t.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{staticClass:"k-page-view-header",attrs:{editable:t.permissions.changeTitle&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.api+"/changeTitle")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-view-buttons",{attrs:{buttons:t.buttons}}),e("k-form-controls",{attrs:{editor:t.editor,"has-changes":t.hasChanges,"is-locked":t.isLocked,modified:t.modified,preview:!!t.permissions.preview&&t.api+"/preview/compare"},on:{discard:t.onDiscard,submit:t.onSubmit}})]},proxy:!0}])},[t._v(" "+t._s(t.title)+" ")]),e("k-model-tabs",{attrs:{changes:t.changes,tab:t.tab.name,tabs:t.tabs}}),e("k-sections",{attrs:{blueprint:t.blueprint,content:t.content,empty:t.$t("page.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.api,tab:t.tab},on:{input:t.onInput,submit:t.onSubmit}})],1)}),[]).exports;const fl=nt({extends:Ha,props:{title:String}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-site-view",attrs:{"data-has-tabs":t.hasTabs,"data-id":t.id,"data-locked":t.isLocked,"data-template":t.blueprint}},[e("k-header",{staticClass:"k-site-view-header",attrs:{editable:t.permissions.changeTitle&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.api+"/changeTitle")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-view-buttons",{attrs:{buttons:t.buttons}}),e("k-form-controls",{attrs:{editor:t.editor,"has-changes":t.hasChanges,"is-locked":t.isLocked,modified:t.modified,preview:t.api+"/preview/compare"},on:{discard:t.onDiscard,submit:t.onSubmit}})]},proxy:!0}])},[t._v(" "+t._s(t.title)+" ")]),e("k-model-tabs",{attrs:{changes:t.changes,tab:t.tab.name,tabs:t.tabs}}),e("k-sections",{attrs:{blueprint:t.blueprint,content:t.content,empty:t.$t("site.blueprint"),lock:t.lock,tab:t.tab,parent:"site"},on:{input:t.onInput,submit:t.onSubmit}})],1)}),[]).exports,gl={install(t){t.component("k-page-view",ml),t.component("k-site-view",fl)}};const kl=nt({extends:Ha,props:{avatar:String,canChangeEmail:Boolean,canChangeLanguage:Boolean,canChangeName:Boolean,canChangeRole:Boolean,email:String,language:String,name:String,role:String}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-user-view",attrs:{"data-has-tabs":t.hasTabs,"data-id":t.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{staticClass:"k-user-view-header",attrs:{editable:t.canChangeName},on:{edit:function(e){return t.$dialog(t.api+"/changeName")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-view-buttons",{attrs:{buttons:t.buttons}}),e("k-form-controls",{attrs:{editor:t.editor,"has-changes":t.hasChanges,"is-locked":t.isLocked,modified:t.modified},on:{discard:t.onDiscard,submit:t.onSubmit}})]},proxy:!0}])},[t.name&&0!==t.name.length?[t._v(" "+t._s(t.name)+" ")]:e("span",{staticClass:"k-user-name-placeholder"},[t._v(" "+t._s(t.$t("name"))+" … ")])],2),e("k-user-profile",{attrs:{id:t.id,api:t.api,avatar:t.avatar,email:t.email,"can-change-email":t.canChangeEmail,"can-change-language":t.canChangeLanguage,"can-change-name":t.canChangeName,"can-change-role":t.canChangeRole,"is-locked":t.isLocked,language:t.language,role:t.role}}),e("k-model-tabs",{attrs:{changes:t.changes,tab:t.tab.name,tabs:t.tabs}}),e("k-sections",{attrs:{blueprint:t.blueprint,content:t.content,empty:t.$t("user.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.api,tab:t.tab},on:{input:t.onInput,submit:t.onSubmit}})],1)}),[]).exports;const bl=nt({extends:kl,prevnext:!1},null,null).exports;const yl=nt({data:()=>({isLoading:!1,values:{password:null,passwordConfirmation:null}}),computed:{fields(){return{password:{autofocus:!0,label:this.$t("user.changePassword.new"),icon:"key",type:"password",width:"1/2"},passwordConfirmation:{label:this.$t("user.changePassword.new.confirm"),icon:"key",type:"password",width:"1/2"}}}},mounted(){this.$panel.title=this.$t("view.resetPassword")},methods:{async submit(){if(!this.values.password||this.values.password.length<8)return this.$panel.notification.error(this.$t("error.user.password.invalid"));if(this.values.password!==this.values.passwordConfirmation)return this.$panel.notification.error(this.$t("error.user.password.notSame"));this.isLoading=!0;try{await this.$api.users.changePassword(this.$panel.user.id,this.values.password),this.$panel.notification.success(),this.$go("/")}catch(t){this.$panel.notification.error(t)}finally{this.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-password-reset-view"},[e("form",{on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[e("k-header",{scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button",{attrs:{icon:"check",theme:"notice",type:"submit",variant:"filled",size:"sm"}},[t._v(" "+t._s(t.$t("change"))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)]},proxy:!0}])},[t._v(" "+t._s(t.$t("view.resetPassword"))+" ")]),e("k-user-info",{attrs:{user:t.$panel.user}}),e("k-fieldset",{attrs:{fields:t.fields,value:t.values}})],1)])}),[]).exports;const vl=nt({props:{api:String,avatar:String,id:String,isLocked:Boolean},methods:{open(){this.avatar?this.$refs.dropdown.toggle():this.upload()},async remove(){await this.$api.users.deleteAvatar(this.id),this.$panel.notification.success(),this.$reload()},upload(){this.$panel.upload.pick({url:this.$panel.urls.api+"/"+this.api+"/avatar",accept:"image/*",immediate:!0,multiple:!1})}}},(function(){var t=this,e=t._self._c;return e("k-button",{staticClass:"k-user-view-image",attrs:{disabled:t.isLocked,title:t.$t("avatar")},on:{click:t.open}},[t.avatar?[e("k-image-frame",{attrs:{cover:!0,src:t.avatar}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:[{icon:"upload",text:t.$t("change"),click:t.upload},{icon:"trash",text:t.$t("delete"),click:t.remove}]}})]:e("k-icon-frame",{attrs:{icon:"user"}})],2)}),[]).exports;const $l=nt({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-frame",{attrs:{cover:!0,src:t.user.avatar.url,ratio:"1/1"}}):e("k-icon-frame",{attrs:{color:"white",back:"black",icon:"user"}}),t._v(" "+t._s(t.user.name??t.user.email??t.user)+" ")],1)}),[]).exports;const wl=nt({props:{api:String,avatar:String,canChangeEmail:Boolean,canChangeLanguage:Boolean,canChangeRole:Boolean,email:String,id:String,isLocked:Boolean,language:String,role:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-user-profile"},[e("k-user-avatar",{attrs:{id:t.id,api:t.api,avatar:t.avatar,"is-locked":t.isLocked}}),e("k-button-group",{attrs:{buttons:[{icon:"email",text:t.email,title:`${t.$t("email")}: ${t.email}`,disabled:!t.canChangeEmail,click:()=>t.$dialog(t.api+"/changeEmail")},{icon:"bolt",text:t.role,title:`${t.$t("role")}: ${t.role}`,disabled:!t.canChangeRole,click:()=>t.$dialog(t.model.link+"/changeRole")},{icon:"translate",text:t.language,title:`${t.$t("language")}: ${t.language}`,disabled:!t.canChangeLanguage,click:()=>t.$dialog(t.api+"/changeLanguage")}]}})],1)}),[]).exports;const xl=nt({props:{buttons:Array,role:Object,roles:Array,search:String,title:String,users:Object},computed:{empty(){return{icon:"users",text:this.$t("role.empty")}},items(){return this.users.data.map((t=>(t.options=this.$dropdown(t.link),t)))},tabs(){const t=[{name:"all",label:this.$t("role.all"),link:"/users"}];for(const e of this.roles)t.push({name:e.id,label:e.title,link:"/users?role="+e.id});return t}},methods:{create(){var t;this.$dialog("users/create",{query:{role:null==(t=this.role)?void 0:t.id}})},paginate(t){this.$reload({query:{page:t.page}})}}},(function(){var t,e=this,s=e._self._c;return s("k-panel-inside",{staticClass:"k-users-view"},[s("k-header",{staticClass:"k-users-view-header",scopedSlots:e._u([{key:"buttons",fn:function(){return[s("k-view-buttons",{attrs:{buttons:e.buttons}})]},proxy:!0}])},[e._v(" "+e._s(e.$t("view.users"))+" ")]),s("k-tabs",{attrs:{tab:(null==(t=e.role)?void 0:t.id)??"all",tabs:e.tabs}}),s("k-collection",{attrs:{empty:e.empty,items:e.items,pagination:e.users.pagination},on:{paginate:e.paginate}})],1)}),[]).exports,_l={install(t){t.component("k-account-view",bl),t.component("k-reset-password-view",yl),t.component("k-user-avatar",vl),t.component("k-user-info",$l),t.component("k-user-profile",wl),t.component("k-user-view",kl),t.component("k-users-view",xl)}};const Sl=nt({props:{plugins:Array}},(function(){var t=this,e=t._self._c;return t.plugins.length?e("k-section",{attrs:{headline:t.$t("plugins"),link:"https://getkirby.com/plugins"}},[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"),type:"license"},version:{label:t.$t("version"),type:"update-status",mobile:!0,width:"10rem"}},rows:t.plugins}})],1):t._e()}),[]).exports,Cl={props:{exceptions:{type:Array,default:()=>[]},security:{type:Array,default:()=>[]},urls:{type:Object,default:()=>({})}},data(){return{issues:this.$helper.object.clone(this.security)}},async mounted(){console.info("Running system health checks for the Panel system view; failed requests in the following console output are expected behavior.");const t=(Promise.allSettled??Promise.all).bind(Promise),e=Object.entries(this.urls).map(this.check);await t([...e,this.testPatchRequests()]),console.info(`System health checks ended. ${this.issues.length-this.security.length} issues with accessible files/folders found (see the security list in the system view).`)},methods:{async check([t,e]){if(!e)return;const{status:s}=await fetch(e,{cache:"no-store"});s<400&&this.issues.push({id:t,text:this.$t("system.issues."+t),link:"https://getkirby.com/security/"+t,icon:"folder"})},retry(){this.$go(window.location.href)},async testPatchRequests(){const{status:t}=await this.$api.patch("system/method-test");"ok"!==t&&this.issues.push({id:"method-overwrite-text",text:this.$t("system.issues.api.methods"),link:"https://getkirby.com/docs/reference/system/options/api#methods-overwrite",icon:"protected"})}}};const Ol=nt({components:{Plugins:Sl,Security:nt(Cl,(function(){var t=this,e=t._self._c;return t.issues.length?e("k-section",{attrs:{headline:t.$t("security"),buttons:[{title:t.$t("retry"),icon:"refresh",click:t.retry}]}},[e("k-items",{attrs:{items:t.issues.map((t=>({image:{back:"var(--color-red-200)",icon:t.icon??"alert",color:"var(--color-red)"},target:"_blank",...t})))}})],1):t._e()}),[]).exports},props:{buttons:Array,environment:Array,exceptions:Array,info:Object,plugins:Array,security:Array,urls:Object},mounted(){this.exceptions.length>0&&(console.info("The following errors occurred during the update check of Kirby and/or plugins:"),this.exceptions.map((t=>console.warn(t))),console.info("End of errors from the update check."))},methods:{copy(){const t=JSON.stringify({info:this.info,security:this.security.map((t=>t.text)),plugins:this.plugins.map((t=>({name:t.name.text,version:t.version.currentVersion})))},null,2);this.$helper.clipboard.write(t),this.$panel.notification.success({message:this.$t("system.info.copied")})}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-system-view"},[e("k-header",{scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-view-buttons",{attrs:{buttons:t.buttons}})]},proxy:!0}])},[t._v(" "+t._s(t.$t("view.system"))+" ")]),e("k-section",{attrs:{headline:t.$t("environment"),buttons:[{text:t.$t("system.info.copy"),icon:"copy",responsive:!0,click:t.copy}]}},[e("k-stats",{staticClass:"k-system-info",attrs:{reports:t.environment,size:"medium"}})],1),e("security",{attrs:{security:t.security,urls:t.urls}}),e("plugins",{attrs:{plugins:t.plugins}})],1)}),[]).exports;const Ml=nt({inheritAttrs:!1,props:{value:Object}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-table-license-cell"},[e("k-button",{attrs:{element:t.value.link?"k-link":"span",icon:t.value.status.icon,link:t.value.link,theme:t.value.status.theme,title:t.value.status.label,size:"xs",target:"_blank"}},[t._v(" "+t._s(t.value.name)+" ")])],1)}),[]).exports;const Al=nt({props:{value:[String,Object]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-table-update-status-cell"},["string"==typeof t.value?e("span",{staticClass:"k-table-update-status-cell-version"},[t._v(" "+t._s(t.value)+" ")]):[e("k-button",{staticClass:"k-table-update-status-cell-button",attrs:{dropdown:!0,icon:t.value.icon,href:t.value.url,text:t.value.currentVersion,theme:t.value.theme,size:"xs",variant:"filled"},on:{click:function(e){return e.stopPropagation(),t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{"align-x":"end"}},[e("dl",{staticClass:"k-plugin-info"},[e("dt",[t._v(t._s(t.$t("plugin")))]),e("dd",[t._v(t._s(t.value.pluginName))]),e("dt",[t._v(t._s(t.$t("version.current")))]),e("dd",[t._v(t._s(t.value.currentVersion))]),e("dt",[t._v(t._s(t.$t("version.latest")))]),e("dd",[t._v(t._s(t.value.latestVersion))]),e("dt",[t._v(t._s(t.$t("system.updateStatus")))]),e("dd",{attrs:{"data-theme":t.value.theme}},[t._v(t._s(t.value.label))])]),t.value.url?[e("hr"),e("k-button",{attrs:{icon:"open",link:t.value.url}},[t._v(" "+t._s(t.$t("versionInformation"))+" ")])]:t._e()],2)]],2)}),[]).exports,Dl={install(t){t.component("k-system-view",Ol),t.component("k-table-license-cell",Ml),t.component("k-table-update-status-cell",Al)}},jl={install(t){t.component("k-error-view",Ra),t.component("k-preview-view",Va),t.component("k-search-view",Ua),t.use(el),t.use(il),t.use(rl),t.use(hl),t.use(gl),t.use(Dl),t.use(_l)}},El={install(t){t.use(dt),t.use(te),t.use(ye),t.use(De),t.use(ar),t.use(hr),t.use(Br),t.use(Vr),t.use(la),t.use(ba),t.use(xa),t.use(Ma),t.use(Ya),t.use(jl),t.use(L)}},Tl={install(t){window.onunhandledrejection=t=>{t.preventDefault(),window.panel.error(t.reason)},t.config.errorHandler=window.panel.error.bind(window.panel)}},Ll=(t={})=>{var e=t.desc?-1:1,s=-e,i=/^0/,n=/\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,c=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,u=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 p(t){return t.replace(l,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")}function d(t,e){return(!t.match(i)||1===e)&&parseFloat(t)||t.replace(n," ").replace(o,"")||0}return function(t,i){var n=u(t),o=u(i);if(!n&&!o)return 0;if(!n&&o)return s;if(n&&!o)return e;var l=p(n),h=p(o),m=parseInt(n.match(a),16)||1!==l.length&&Date.parse(n),f=parseInt(o.match(a),16)||m&&o.match(c)&&Date.parse(o)||null;if(f){if(mf)return e}for(var g=l.length,k=h.length,b=0,y=Math.max(g,k);b0)return e;if(w<0)return s;if(b===y-1)return 0}else{if(v<$)return s;if(v>$)return e}}return 0}};RegExp.escape=function(t){return t.replace(new RegExp("[-/\\\\^$*+?.()[\\]{}]","gu"),"\\$&")};function Bl(t){return Array.isArray(t)?t:[t]}const Il={fromObject:function(t){return Array.isArray(t)?t:Object.values(t??{})},search:(t,e,s={})=>{if((e??"").length<=(s.min??0))return t;const i=new RegExp(RegExp.escape(e),"ig"),n=s.field??"text",o=t.filter((t=>!!t[n]&&null!==t[n].match(i)));return s.limit?o.slice(0,s.limit):o},sortBy:function(t,e){const s=e.split(" "),i=s[0],n=s[1]??"asc",o=Ll({desc:"desc"===n,insensitive:!0});return t.sort(((t,e)=>{const s=String(t[i]??""),n=String(e[i]??"");return o(s,n)}))},split:function(t,e){return t.reduce(((t,s)=>(s===e?t.push([]):t[t.length-1].push(s),t)),[[]])},wrap:Bl};const ql={read:function(t,e=!1){if(!t)return null;if("string"==typeof t)return t;if(t instanceof ClipboardEvent){if(t.preventDefault(),!0===e)return t.clipboardData.getData("text/plain");const s=t.clipboardData.getData("text/html")||t.clipboardData.getData("text/plain")||null;if(s)return s.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 Pl(t){if("string"==typeof t){if("pattern"===(t=t.toLowerCase()))return"var(--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}}function Nl(t,e=!1){if(!t.match("youtu"))return!1;let s=null;try{s=new URL(t)}catch{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",a=t=>!!t&&null!==t.match(/^[a-zA-Z0-9_-]+$/);let l=s.searchParams,c=null;switch(i.join("/")){case"embed/videoseries":case"playlist":a(l.get("list"))&&(c=r+"/videoseries");break;case"watch":a(l.get("v"))&&(c=r+"/"+l.get("v"),l.has("t")&&l.set("start",l.get("t")),l.delete("v"),l.delete("t"));break;default:s.host.includes("youtu.be")&&a(n)?(c=!0===e?"https://www.youtube-nocookie.com/embed/"+n:"https://www.youtube.com/embed/"+n,l.has("t")&&l.set("start",l.get("t")),l.delete("t")):["embed","shorts"].includes(n)&&a(o)&&(c=r+"/"+o)}if(!c)return!1;const u=l.toString();return u.length&&(c+="?"+u),c}function Fl(t,e=!1){let s=null;try{s=new URL(t)}catch{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 a=n.toString();return a.length&&(r+="?"+a),r}const zl={youtube:Nl,vimeo:Fl,video:function(t,e=!1){return!0===t.includes("youtu")?Nl(t,e):!0===t.includes("vimeo")&&Fl(t,e)}};function Yl(t){var e;if(void 0!==t.default)return mt(t.default);const s=window.panel.app.$options.components[`k-${t.type}-field`],i=null==(e=null==s?void 0:s.options.props)?void 0:e.value;if(void 0===i)return;const n=null==i?void 0:i.default;return"function"==typeof n?n():void 0!==n?n:null}const Rl={defaultValue:Yl,form:function(t){const e={};for(const s in t){const i=Yl(t[s]);void 0!==i&&(e[s]=i)}return e},isVisible:function(t,e){if("hidden"===t.type||!0===t.hidden)return!1;if(!t.when)return!0;for(const s in t.when){const i=e[s.toLowerCase()],n=t.when[s];if((void 0!==i||!(""===n||Array.isArray(n)&&0===n.length))&&i!==n)return!1}return!0},subfields:function(t,e){let s={};for(const i in e){const n=e[i];n.section=t.name,t.endpoints&&(n.endpoints={field:t.endpoints.field+"+"+i,section:t.endpoints.section,model:t.endpoints.model}),s[i]=n}return s}},Hl=t=>t.split(".").slice(-1).join(""),Vl=t=>t.split(".").slice(0,-1).join("."),Ul=t=>Intl.NumberFormat("en",{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow"}).format(t),Kl={extension:Hl,name:Vl,niceSize:Ul};function Wl(t,e){if("string"==typeof t&&(t=document.querySelector(t)),!t)return!1;if(!e&&t.contains(document.activeElement)&&t!==document.activeElement)return!1;const s=[":where([autofocus], [data-autofocus])",":where(input, textarea, select, [contenteditable=true], .input-focus)","[type=submit]","button"];e&&s.unshift(`[name="${e}"]`);const i=function(t,e){for(const s of e){const e=t.querySelector(s);if(!0===Jl(e))return e}return null}(t,s);return i?(i.focus(),i):!0===Jl(t)&&(t.focus(),t)}function Jl(t){return!!t&&(!t.matches("[disabled], [aria-disabled], input[type=hidden]")&&(!t.closest("[aria-disabled]")&&!t.closest("[disabled]")&&"function"==typeof t.focus))}const Gl=t=>"function"==typeof window.Vue.options.components[t],Xl=t=>!!t.dataTransfer&&(!!t.dataTransfer.types&&(!0===t.dataTransfer.types.includes("Files")&&!1===t.dataTransfer.types.includes("text/plain")));const Zl={metaKey:function(){return window.navigator.userAgent.indexOf("Mac")>-1?"cmd":"ctrl"}};function Ql(t){return!0===t.startsWith("file://")||!0===t.startsWith("/@/file/")}function tc(t){return"site://"===t||!0===t.startsWith("page://")||null!==t.match(/^\/(.*\/)?@\/page\//)}function ec(t=[]){const e={url:{detect:t=>/^(http|https):\/\//.test(t),icon:"url",id:"url",label:window.panel.$t("url"),link:t=>t,placeholder:window.panel.$t("url.placeholder"),input:"url",value:t=>t},page:{detect:t=>!0===tc(t),icon:"page",id:"page",label:window.panel.$t("page"),link:t=>t,placeholder:window.panel.$t("select")+" …",input:"text",value:t=>t},file:{detect:t=>!0===Ql(t),icon:"file",id:"file",label:window.panel.$t("file"),link:t=>t,placeholder:window.panel.$t("select")+" …",value:t=>t},email:{detect:t=>t.startsWith("mailto:"),icon:"email",id:"email",label:window.panel.$t("email"),link:t=>t.replace(/^mailto:/,""),placeholder:window.panel.$t("email.placeholder"),input:"email",value:t=>"mailto:"+t},tel:{detect:t=>t.startsWith("tel:"),icon:"phone",id:"tel",label:window.panel.$t("tel"),link:t=>t.replace(/^tel:/,""),pattern:"[+]{0,1}[0-9]+",placeholder:window.panel.$t("tel.placeholder"),input:"tel",value:t=>"tel:"+t},anchor:{detect:t=>t.startsWith("#"),icon:"anchor",id:"anchor",label:"Anchor",link:t=>t,pattern:"^#.+",placeholder:"#element",input:"text",value:t=>t},custom:{detect:()=>!0,icon:"title",id:"custom",label:window.panel.$t("custom"),link:t=>t,input:"text",value:t=>t}};if(!t.length)return e;const s={};for(const i of t)s[i]=e[i];return s}const sc={detect:function(t,e){if(t=t??"",e=e??ec(),0===t.length)return{type:Object.keys(e)[0]??"url",link:""};for(const s in e)if(!0===e[s].detect(t))return{type:s,link:e[s].link(t)}},getFileUUID:function(t){return t.replace("/@/file/","file://")},getPageUUID:function(t){return t.replace(/^\/(.*\/)?@\/page\//,"page://")},isFileUUID:Ql,isPageUUID:tc,preview:async function({type:t,link:e},s){return"page"===t&&e?await async function(t,e=["title","panelImage"]){if("site://"===t)return{label:window.panel.$t("view.site")};try{const s=await window.panel.api.pages.get(t,{select:e.join(",")});return{label:s.title,image:s.panelImage}}catch{return null}}(e,s):"file"===t&&e?await async function(t,e=["filename","panelImage"]){try{const s=await window.panel.api.files.get(null,t,{select:e.join(",")});return{label:s.filename,image:s.panelImage}}catch{return null}}(e,s):e?{label:e}:null},types:ec};const ic={status:function(t,e=!1){const s={icon:"status-"+t,title:window.panel.$t("page.status")+": "+window.panel.$t("page.status."+t),disabled:e,size:"xs",style:"--icon-size: 15px"};return e&&(s.title+=` (${window.panel.$t("disabled")})`),s.theme="draft"===t?"negative-icon":"unlisted"===t?"info-icon":"positive-icon",s}},nc=(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+"%"},oc={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function rc(t){return String(t).replace(/[&<>"'`=/]/g,(t=>oc[t]))}function ac(t){return!t||0===String(t).length}function lc(t){const e=String(t);return e.charAt(0).toLowerCase()+e.slice(1)}function cc(t="",e=""){const s=new RegExp(`^(${RegExp.escape(e)})+`,"g");return t.replace(s,"")}function uc(t){let e="";const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(var i=0;i{const i=e[rc(t.shift())]??"…";return"…"===i||0===t.length?i:s(t,i)},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 hc(t){const e=String(t);return e.charAt(0).toUpperCase()+e.slice(1)}function mc(){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}const fc={camelToKebab:function(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()},escapeHTML:rc,hasEmoji:function(t){if("string"!=typeof t)return!1;if(!0===/^[a-z0-9_-]+$/.test(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},isEmpty:ac,lcfirst:lc,ltrim:cc,pad:function(t,e=2){t=String(t);let s="";for(;s.length]+)>)/gi,"")},template:dc,ucfirst:hc,ucwords:function(t){return String(t).split(/ /g).map((t=>hc(t))).join(" ")},unescapeHTML:function(t){for(const e in oc)t=String(t).replaceAll(oc[e],e);return t},uuid:mc},gc=(t,e,s={leading:!0,trailing:!1})=>{let i=null,n=null,o=null;return function(...r){if(i)return n=this,void(o=r);s.leading?t.call(this,...r):(n=this,o=r);const a=()=>{s.trailing&&o?(t.call(n,...o),n=null,o=null,i=setTimeout(a,e)):i=null};i=setTimeout(a,e)}};async function kc(t,e){return new Promise(((s,i)=>{var n;const o={url:"/",field:"file",method:"POST",filename:t.name,headers:{},attributes:{},complete:()=>{},error:()=>{},success:()=>{},progress:()=>{}},r=Object.assign(o,e),a=new XMLHttpRequest,l=new FormData;l.append(r.field,t,r.filename);for(const t in r.attributes){const e=r.attributes[t];null!=e&&l.append(t,e)}const c=e=>{if(e.lengthComputable&&r.progress){const s=Math.max(0,Math.min(100,Math.ceil(e.loaded/e.total*100)));r.progress(a,t,s)}};a.upload.addEventListener("loadstart",c),a.upload.addEventListener("progress",c),a.addEventListener("load",(e=>{let n=null;try{n=JSON.parse(e.target.response)}catch{n={status:"error",message:"The file could not be uploaded"}}"error"===n.status?(r.error(a,t,n),i(n)):(r.progress(a,t,100),r.success(a,t,n),s(n))})),a.addEventListener("error",(e=>{const s=JSON.parse(e.target.response);r.progress(a,t,100),r.error(a,t,s),i(s)})),a.open(r.method,r.url,!0);for(const t in r.headers)a.setRequestHeader(t,r.headers[t]);null==(n=r.abort)||n.addEventListener("abort",(()=>{a.abort()})),a.send(l)}))}function bc(){var t;return new URL((null==(t=document.querySelector("base"))?void 0:t.href)??window.location.origin)}function yc(t={},e={}){e instanceof URL&&(e=e.search);const s=new URLSearchParams(e);for(const[i,n]of Object.entries(t))null!==n&&s.set(i,n);return s}function vc(t="",e={},s){return(t=Sc(t,s)).search=yc(e,t.search),t}function $c(t){return null!==String(t).match(/^https?:\/\//)}function wc(t){return Sc(t).origin===window.location.origin}function xc(t,e){if((t instanceof URL||t instanceof Location)&&(t=t.toString()),"string"!=typeof t)return!1;try{new URL(t,window.location)}catch{return!1}if(!0===e){return/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!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]))|(?:localhost)|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/i.test(t)}return!0}function _c(t,e){return!0===$c(t)?t:(e=e??bc(),(e=String(e).replaceAll(/\/$/g,""))+"/"+(t=String(t).replaceAll(/^\//g,"")))}function Sc(t,e){return t instanceof URL?t:new URL(_c(t,e))}const Cc={base:bc,buildQuery:yc,buildUrl:vc,isAbsolute:$c,isSameOrigin:wc,isUrl:xc,makeAbsolute:_c,toObject:Sc},Oc={install(t){t.prototype.$helper={array:Il,clipboard:ql,clone:bt.clone,color:Pl,embed:zl,focus:Wl,isComponent:Gl,isUploadEvent:Xl,debounce:Bt,field:Rl,file:Kl,keyboard:Zl,link:sc,object:bt,page:ic,pad:fc.pad,ratio:nc,slug:fc.slug,sort:Ll,string:fc,throttle:gc,upload:kc,url:Cc,uuid:fc.uuid},t.prototype.$esc=fc.escapeHTML}},Mc={install(t){const e=(t,e,s)=>{!0!==s.context.disabled?t.dir=window.panel.language.direction:t.dir=null};t.directive("direction",{bind:e,update:e})}},Ac={install(t){window.panel.redirect=window.panel.redirect.bind(window.panel),window.panel.reload=window.panel.reload.bind(window.panel),window.panel.request=window.panel.request.bind(window.panel),window.panel.search=window.panel.search.bind(window.panel);const e=["api","config","direction","events","language","languages","license","menu","multilang","permissions","search","searches","system","t","translation","url","urls","user","view"];for(const s of e){const e=`$${s}`;t.prototype[e]=window.panel[e]=window.panel[s]}t.prototype.$dialog=window.panel.dialog.open.bind(window.panel.dialog),t.prototype.$drawer=window.panel.drawer.open.bind(window.panel.drawer),t.prototype.$dropdown=window.panel.dropdown.openAsync.bind(window.panel.dropdown),t.prototype.$go=window.panel.view.open.bind(window.panel.view),t.prototype.$reload=window.panel.reload.bind(window.panel),window.panel.$vue=window.panel.app}},Dc=/^#?([\da-f]{3}){1,2}$/i,jc=/^#?([\da-f]{4}){1,2}$/i,Ec=/^rgba?\(\s*(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?$/i,Tc=/^hsla?\(\s*(\d{1,3}\.?\d*)(deg|rad|grad|turn)?(?:,|\s)+(\d{1,3})%(?:,|\s)+(\d{1,3})%(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?$/i;function Lc(t){return"string"==typeof t&&(Dc.test(t)||jc.test(t))}function Bc(t){return ft(t)&&"r"in t&&"g"in t&&"b"in t}function Ic(t){return ft(t)&&"h"in t&&"s"in t&&"l"in t}function qc({h:t,s:e,v:s,a:i}){if(0===s)return{h:t,s:0,l:0,a:i};if(0===e&&1===s)return{h:t,s:1,l:1,a:i};const n=s*(2-e)/2;return{h:t,s:e=s*e/(1-Math.abs(2*n-1)),l:n,a:i}}function Pc({h:t,s:e,l:s,a:i}){const n=e*(s<.5?s:1-s);return{h:t,s:e=0===n?0:2*n/(s+n),v:s+n,a:i}}function Nc(t){if(!0===Dc.test(t)||!0===jc.test(t)){"#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.split("").reduce(((t,e)=>t+e+e),""));const e=parseInt(t,16);return!0===Dc.test(t)?{r:e>>16,g:e>>8&255,b:255&e,a:1}:{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:Math.round((255&e)/255*100)/100}}throw new Error(`unknown hex color: ${t}`)}function Fc({r:t,g:e,b:s,a:i=1}){let n="#"+(1<<24|t<<16|e<<8|s).toString(16).slice(1);return i<1&&(n+=(256|Math.round(255*i)).toString(16).slice(1)),n}function zc({h:t,s:e,l:s,a:i}){const n=e*Math.min(s,1-s),o=(e,i=(e+t/30)%12)=>s-n*Math.max(Math.min(i-3,9-i,1),-1);return{r:255*o(0),g:255*o(8),b:255*o(4),a:i}}function Yc({r:t,g:e,b:s,a:i}){t/=255,e/=255,s/=255;const n=Math.max(t,e,s),o=n-Math.min(t,e,s),r=1-Math.abs(n+n-o-1);let a=o&&(n==t?(e-s)/o:n==e?2+(s-t)/o:4+(t-e)/o);return a=60*(a<0?a+6:a),{h:a,s:r?o/r:0,l:(n+n-o)/2,a:i}}function Rc(t){return Fc(zc(t))}function Hc(t){return Yc(Nc(t))}function Vc(t,e){return t=Number(t),"grad"===e?t*=.9:"rad"===e?t*=180/Math.PI:"turn"===e&&(t*=360),parseInt(t%360)}function Uc(t,e){if(!0===Lc(t))switch("#"!==t[0]&&(t="#"+t),e){case"hex":return t;case"rgb":return Nc(t);case"hsl":return Hc(t);case"hsv":return Pc(Hc(t))}if(!0===Bc(t))switch(e){case"hex":return Fc(t);case"rgb":return t;case"hsl":return Yc(t);case"hsv":return function({r:t,g:e,b:s,a:i}){t/=255,e/=255,s/=255;const n=Math.max(t,e,s),o=n-Math.min(t,e,s);let r=o&&(n==t?(e-s)/o:n==e?2+(s-t)/o:4+(t-e)/o);return r=60*(r<0?r+6:r),{h:r,s:n&&o/n,v:n,a:i}}(t)}if(!0===Ic(t))switch(e){case"hex":return Rc(t);case"rgb":return zc(t);case"hsl":return t;case"hsv":return Pc(t)}if(!0===function(t){return ft(t)&&"h"in t&&"s"in t&&"v"in t}(t))switch(e){case"hex":return Rc(qc(t));case"rgb":return function({h:t,s:e,v:s,a:i}){const n=(i,n=(i+t/60)%6)=>s-s*e*Math.max(Math.min(n,4-n,1),0);return{r:255*n(5),g:255*n(3),b:255*n(1),a:i}}(t);case"hsl":return qc(t);case"hsv":return t}throw new Error(`Invalid color conversion: ${JSON.stringify(t)} -> ${e}`)}function Kc(t){let e;if(!t||"string"!=typeof t)return!1;if(!0===Lc(t))return"#"!==t[0]&&(t="#"+t),t;if(e=t.match(Ec)){const t={r:Number(e[1]),g:Number(e[3]),b:Number(e[5]),a:Number(e[7]||1)};return"%"===e[2]&&(t.r=Math.ceil(2.55*t.r)),"%"===e[4]&&(t.g=Math.ceil(2.55*t.g)),"%"===e[6]&&(t.b=Math.ceil(2.55*t.b)),"%"===e[8]&&(t.a=t.a/100),t}if(e=t.match(Tc)){let[t,s,i,n,o]=e.slice(1);const r={h:Vc(t,s),s:Number(i)/100,l:Number(n)/100,a:Number(o||1)};return"%"===e[6]&&(r.a=r.a/100),r}return null}const Wc={convert:Uc,parse:Kc,parseAs:function(t,e){const s=Kc(t);return s&&e?Uc(s,e):s},toString:function(t,e,s=!0){var i,n;let o=t;if("string"==typeof o&&(o=Kc(t)),o&&e&&(o=Uc(o,e)),!0===Lc(o))return!0!==s&&(5===o.length?o=o.slice(0,4):o.length>7&&(o=o.slice(0,7))),o.toLowerCase();if(!0===Bc(o)){const t=o.r.toFixed(),e=o.g.toFixed(),n=o.b.toFixed(),r=null==(i=o.a)?void 0:i.toFixed(2);return s&&r&&r<1?`rgb(${t} ${e} ${n} / ${r})`:`rgb(${t} ${e} ${n})`}if(!0===Ic(o)){const t=o.h.toFixed(),e=(100*o.s).toFixed(),i=(100*o.l).toFixed(),r=null==(n=o.a)?void 0:n.toFixed(2);return s&&r&&r<1?`hsl(${t} ${e}% ${i}% / ${r})`:`hsl(${t} ${e}% ${i}%)`}throw new Error(`Unsupported color: ${JSON.stringify(t)}`)}};B.extend(I),B.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 YYYY":!0,"MMM DD":!1,"MMM D":!1,"MM YYYY":!0,"M YYYY":!0,"MMMM DD YYYY":!0,"MMMM D YYYY":!0,"MMMM DD YY":!0,"MMMM D YY":!0,"MMMM DD, YYYY":!0,"MMMM D, YYYY":!0,"MMMM DD, YY":!0,"MMMM D, YY":!0,"MMMM DD. YYYY":!0,"MMMM D. YYYY":!0,"MMMM DD. YY":!0,"MMMM D. YY":!0,DDMMYYYY:!0,DDMMYY:!0,"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:{"HHmmss a":!1,"HHmm a":!1,"HH a":!1,HHmmss:!1,HHmm:!1,"HH:mm:ss a":!1,"HH:mm:ss":!1,"HH:mm a":!1,"HH:mm":!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}})),B.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){e&&(e=i(e)),e??(e=[i("datetime"),i("date"),i("time")]);const n=s(t,e);return n&&n.isValid()?n:null}})),B.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.hasOwn(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}})),B.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)})),B.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();for(const a of o)i=i.startOf(a);if(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}})),B.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)}}));const Jc={install(t){t.prototype.$library={autosize:q,colors:Wc,dayjs:B}}},Gc=(t,e={})=>Vue.reactive({...e,key:()=>t,defaults:()=>e,reset(){return this.set(this.defaults())},set(t){this.validateState(t);for(const e in this.defaults())this[e]=t[e]??this.defaults()[e];return this.state()},state(){const t={};for(const e in this.defaults())t[e]=this[e]??this.defaults()[e];return t},validateState(t){if(!1===ft(t))throw new Error(`Invalid ${this.key()} state`);return!0}}),Xc=()=>{const t=Gc("activation",{isOpen:"true"!==sessionStorage.getItem("kirby$activation$card")});return Vue.reactive({...t,close(){sessionStorage.setItem("kirby$activation$card","true"),this.isOpen=!1},open(){sessionStorage.removeItem("kirby$activation$card"),this.isOpen=!0}})},Zc=t=>({async changeName(e,s,i){return t.patch(this.url(e,s,"name"),{name:i})},async delete(e,s){return t.delete(this.url(e,s))},async get(e,s,i){let n=await t.get(this.url(e,s),i);return!0===Array.isArray(n.content)&&(n.content={}),n},id:t=>!0===t.startsWith("/@/file/")?t.replace("/@/file/","@"):!0===t.startsWith("file://")?t.replace("file://","@"):t,link(t,e,s){return"/"+this.url(t,e,s)},async update(e,s,i){return t.patch(this.url(e,s),i)},url(t,e,s){let i="files/"+this.id(e);return t&&(i=t+"/"+i),s&&(i+="/"+s),i}}),Qc=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=>!0===t.match(/^\/(.*\/)?@\/page\//)?t.replace(/^\/(.*\/)?@\/page\//,"@"):!0===t.startsWith("page://")?t.replace("page://","@"):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}});class tu extends Error{constructor(t,{request:e,response:s,cause:i}){super(s.json.message??t,{cause:i}),this.request=e,this.response=s}state(){return this.response.json}}class eu extends tu{}class su extends tu{state(){return{message:this.message,text:this.response.text}}}const iu=t=>(window.location.href=_c(t),!1),nu=async(t,e={})=>{var s;(e={cache:"no-store",credentials:"same-origin",mode:"same-origin",...e}).body=((s=e.body)instanceof HTMLFormElement&&(s=new FormData(s)),s instanceof FormData&&(s=Object.fromEntries(s)),"object"==typeof s?JSON.stringify(s):s),e.headers=((t={},e={})=>{return{"content-type":"application/json","x-csrf":e.csrf??!1,"x-fiber":!0,"x-fiber-globals":(s=e.globals,!!s&&(!1===Array.isArray(s)?String(s):s.join(","))),"x-fiber-referrer":e.referrer??!1,...kt(t)};var s})(e.headers,e),e.url=vc(t,e.query);const i=new Request(e.url,e);return!1===wc(i.url)?iu(i.url):await ou(i,await fetch(i))},ou=async(t,e)=>{var s;if(!1===e.headers.get("Content-Type").includes("application/json"))return iu(e.url);try{e.text=await e.text(),e.json=JSON.parse(e.text)}catch(i){throw new su("Invalid JSON response",{cause:i,request:t,response:e})}if(401===e.status)throw new eu("Unauthenticated",{request:t,response:e});if("error"===(null==(s=e.json)?void 0:s.status))throw e.json;if(!1===e.ok)throw new tu(`The request to ${e.url} failed`,{request:t,response:e});return{request:t,response:e}},ru=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}}),au=t=>{var e;const s={csrf:t.system.csrf,endpoint:pc(t.urls.api,"/"),methodOverwrite:(null==(e=t.config.api)?void 0:e.methodOverwrite)??!1,ping:null,requests:[],running:0},i=()=>{clearInterval(s.ping),s.ping=setInterval(s.auth.ping,3e5)};return s.request=async(e,n={},o=!1)=>{const r=e+"/"+JSON.stringify(n);s.requests.push(r),!1===o&&!0!==n.silent&&(t.isLoading=!0),s.language=t.language.code;try{return await(t=>async(e,s={})=>{s={cache:"no-store",credentials:"same-origin",mode:"same-origin",headers:{"content-type":"application/json","x-csrf":t.csrf,"x-language":t.language,...kt(s.headers??{})},...s},t.methodOverwrite&&"GET"!==s.method&&"POST"!==s.method&&(s.headers["x-http-method-override"]=s.method,s.method="POST");for(const t in s.headers)null===s.headers[t]&&delete s.headers[t];s.url=pc(t.endpoint,"/")+"/"+cc(e,"/");const i=new Request(s.url,s),{response:n}=await ou(i,await fetch(i));let o=n.json;return o.data&&"model"===o.type&&(o=o.data),o})(s)(e,n)}finally{i(),s.requests=s.requests.filter((t=>t!==r)),0===s.requests.length&&(t.isLoading=!1)}},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"),ping:async()=>t.post("auth/ping"),user:async e=>t.get("auth",e),verifyCode:async e=>t.post("auth/code",{code:e})}))(s),s.delete=(t=>async(e,s,i,n=!1)=>t.post(e,s,i,"DELETE",n))(s),s.files=Zc(s),s.get=(t=>async(e,s,i,n=!1)=>(s&&(e+="?"+Object.keys(s).filter((t=>void 0!==s[t]&&null!==s[t])).map((t=>t+"="+s[t])).join("&")),t.request(e,Object.assign(i??{},{method:"GET"}),n)))(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=Qc(s),s.patch=(t=>async(e,s,i,n=!1)=>t.post(e,s,i,"PATCH",n))(s),s.post=(t=>async(e,s,i,n="POST",o=!1)=>t.request(e,Object.assign(i??{},{method:n,body:JSON.stringify(s)}),o))(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=ru(s),i(),s},lu=t=>{const e=Vue.reactive({changes(e){if(e??(e=t.view.props.api),!1===this.isCurrent(e))throw new Error("Cannot get changes for another view");const s={};for(const i in t.view.props.content){JSON.stringify(t.view.props.content[i])!==JSON.stringify(t.view.props.originals[i])&&(s[i]=t.view.props.content[i])}return s},async discard(e){if(e??(e=t.view.props.api),!0!==this.isProcessing){if(!0===this.isCurrent(e)&&!0===this.isLocked(e))throw new Error("Cannot discard locked changes");this.isProcessing=!0;try{await t.api.post(e+"/changes/discard"),this.isCurrent(e)&&(t.view.props.content=t.view.props.originals),t.events.emit("content.discard",{api:e})}finally{this.isProcessing=!1}}},isCurrent:e=>t.view.props.api===e,isLocked(e){return this.lock(e??t.view.props.api).isLocked},isProcessing:!1,lock(e){if(!1===this.isCurrent(e??t.view.props.api))throw new Error("The lock state cannot be detected for content from another view");return t.view.props.lock},async publish(e,s){if(s??(s=t.view.props.api),!0!==this.isProcessing){if(!0===this.isCurrent(s)&&!0===this.isLocked(s))throw new Error("Cannot publish locked changes");this.isProcessing=!0;try{await t.api.post(s+"/changes/publish",e),this.isCurrent(s)&&(t.view.props.originals=t.view.props.content),t.events.emit("content.publish",{values:e,api:s})}finally{this.isProcessing=!1}}},async save(e,s){var i;if(s??(s=t.view.props.api),!0===this.isCurrent(s)&&!0===this.isLocked(s))throw new Error("Cannot save locked changes");this.isProcessing=!0,null==(i=this.saveAbortController)||i.abort(),this.saveAbortController=new AbortController;try{await t.api.post(s+"/changes/save",e,{signal:this.saveAbortController.signal,silent:!0}),this.isProcessing=!1,!0===this.isCurrent(s)&&(t.view.props.lock.modified=new Date),t.events.emit("content.save",{api:s,values:e})}catch(n){if("AbortError"!==n.name)throw this.isProcessing=!1,n}},saveAbortController:null,update(e,s){if(0!==gt(e)){if(!1===this.isCurrent(s??t.view.props.api))throw new Error("The content in another view cannot be updated");t.view.props.content={...t.view.props.originals,...e},this.saveLazy(t.view.props.content,s)}}});return e.saveLazy=gc(e.save,1e3,{leading:!0,trailing:!0}),e},cu=()=>({addEventListener(t,e){"function"==typeof e&&(this.on[t]=e)},addEventListeners(t){if(!1!==ft(t))for(const e in t)this.addEventListener(e,t[e])},emit(t,...e){return this.hasEventListener(t)?this.on[t](...e):()=>{}},hasEventListener(t){return"function"==typeof this.on[t]},listeners(){return this.on},on:{}}),uu=(t,e,s)=>{const i=Gc(e,s);return Vue.reactive({...i,...cu(),async load(e,s={}){return!0!==s.silent&&(this.isLoading=!0),await t.open(e,s),this.isLoading=!1,this.addEventListeners(s.on),this.state()},async open(t,e={}){return"function"==typeof e&&(e={on:{submit:e}}),!0===xc(t)?this.load(t,e):(this.set(t),this.addEventListeners(e.on),this.emit("open",t,e),this.state())},async post(e,s={}){var i;if(!this.path)throw new Error(`The ${this.key()} cannot be posted`);this.isLoading=!0,e=e??(null==(i=this.props)?void 0:i.value)??{};try{return await t.post(this.path,e,s)}catch(n){t.error(n)}finally{this.isLoading=!1}return!1},async refresh(e={}){e.url=e.url??this.url();const s=(await t.get(e.url,e))["$"+this.key()];if(s&&s.component===this.component)return this.props=s.props,this.state()},async reload(t={}){if(!this.path)return!1;this.open(this.url(),t)},set(t){return i.set.call(this,t),this.on={},this.addEventListeners(t.on??{}),this.state()},url(){return t.url(this.path,this.query)}})},pu=(t,e,s)=>{const i=uu(t,e,s);return Vue.reactive({...i,async cancel(){this.isOpen&&this.emit("cancel"),this.close()},async close(){!1!==this.isOpen&&(this.isOpen=!1,this.emit("close"),this.reset(),0===t.overlays().length&&(document.documentElement.removeAttribute("data-overlay"),document.documentElement.style.removeProperty("--scroll-top")))},focus(t){Wl(`.k-${this.key()}-portal`,t)},input(t){!1!==this.isOpen&&(Vue.set(this.props,"value",t),this.emit("input",t))},isOpen:!1,listeners(){return{...this.on,cancel:this.cancel.bind(this),close:this.close.bind(this),input:this.input.bind(this),submit:this.submit.bind(this),success:this.success.bind(this)}},async open(e,s){return!1===this.isOpen&&t.notification.close(),await i.open.call(this,e,s),this.component&&(document.documentElement.setAttribute("data-overlay","true"),document.documentElement.style.setProperty("--scroll-top",window.scrollY+"px"),this.isOpen=!0),this.state()},async submit(t,e={}){if(t=t??this.props.value,this.hasEventListener("submit"))return this.emit("submit",t,e);if(!this.path)return this.close();const s=await this.post(t,e);return!1===ft(s)?s:this.success(s["$"+this.key()]??{})},success(e){return this.hasEventListener("success")?this.emit("success",e):("string"==typeof e&&t.notification.success(e),this.close(),this.successNotification(e),this.successEvents(e),e.route||e.redirect?this.successRedirect(e):t.view.reload(e.reload),e)},successEvents(e){if(e.event){const s=Bl(e.event);for(const i of s)"string"==typeof i&&t.events.emit(i,e)}!1!==e.emit&&t.events.emit("success",e)},successNotification(e){e.message&&t.notification.success(e.message)},successRedirect(e){const s=e.route??e.redirect;return!!s&&("string"==typeof s?t.open(s):t.open(s.url,s.options))},get value(){var t;return null==(t=this.props)?void 0:t.value}})},du=t=>{t.events.on("dialog.save",(e=>{var s;null==(s=null==e?void 0:e.preventDefault)||s.call(e),t.dialog.submit()}));const e=pu(t,"dialog",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,legacy:!1,ref:null});return Vue.reactive({...e,async close(){this.ref&&(this.ref.visible=!1),e.close.call(this)},async open(t,s={}){return t instanceof window.Vue?this.openComponent(t):("string"==typeof t&&(t=`/dialogs/${t}`),e.open.call(this,t,s))},async openComponent(s){t.deprecated("Dialog components should no longer be used in your templates");const i=await e.open.call(this,{component:s.$options._componentTag,legacy:!0,props:{...s.$attrs,...s.$props},ref:s}),n=this.listeners();for(const t in n)s.$on(t,n[t]);return s.visible=!0,i}})},hu=()=>{const t=Gc("drag",{type:null,data:{}});return Vue.reactive({...t,get isDragging(){return null!==this.type},start(t,e){this.type=t,this.data=e},stop(){this.type=null,this.data={}}})},mu=()=>Vue.reactive({add(t){if(!t.id)throw new Error("The state needs an ID");!0!==this.has(t.id)&&this.milestones.push(t)},at(t){return this.milestones.at(t)},clear(){this.milestones=[]},get(t=null){return null===t?this.milestones:this.milestones.find((e=>e.id===t))},goto(t){const e=this.index(t);if(-1!==e)return this.milestones=this.milestones.slice(0,e+1),this.milestones[e]},has(t){return void 0!==this.get(t)},index(t){return this.milestones.findIndex((e=>e.id===t))},isEmpty(){return 0===this.milestones.length},last(){return this.milestones.at(-1)},milestones:[],remove(t=null){return null===t?this.removeLast():this.milestones=this.milestones.filter((e=>e.id!==t))},removeLast(){return this.milestones=this.milestones.slice(0,-1)},replace(t,e){-1===t&&(t=this.milestones.length-1),Vue.set(this.milestones,t,e)}}),fu=t=>{const e=pu(t,"drawer",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,id:null});return t.events.on("drawer.save",(e=>{e.preventDefault(),t.drawer.submit()})),Vue.reactive({...e,get breadcrumb(){return this.history.milestones},async close(t){if(!1!==this.isOpen&&(!0===t&&this.history.clear(),void 0===t||t===this.id)){if(this.history.removeLast(),!0!==this.history.isEmpty())return this.open(this.history.last());e.close.call(this)}},goTo(t){const e=this.history.goto(t);void 0!==e&&this.open(e)},history:mu(),get icon(){return this.props.icon??"box"},input(t){Vue.set(this.props,"value",t),this.emit("input",this.props.value)},listeners(){return{...this.on,cancel:this.cancel.bind(this),close:this.close.bind(this),crumb:this.goTo.bind(this),input:this.input.bind(this),submit:this.submit.bind(this),success:this.success.bind(this),tab:this.tab.bind(this)}},async open(t,s={}){"string"==typeof t&&(t=`/drawers/${t}`),await e.open.call(this,t,s),this.tab(t.tab);const i=this.state();return!0===t.replace?this.history.replace(-1,i):this.history.add(i),this.focus(),i},set(t){return e.set.call(this,t),this.id=this.id??mc(),this.state()},tab(t){const e=this.props.tabs??{};if(!(t=t??Object.keys(e??{})[0]))return!1;Vue.set(this.props,"fields",e[t].fields),Vue.set(this.props,"tab",t),this.emit("tab",t),setTimeout((()=>{this.focus()}))}})},gu=t=>{const e=uu(t,"dropdown",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null});return Vue.reactive({...e,close(){this.emit("close"),this.reset()},open(t,s={}){return"string"==typeof t&&(t=`/dropdowns/${t}`),e.open.call(this,t,s)},openAsync(t,e={}){return async s=>{await this.open(t,e);const i=this.options();if(0===i.length)throw Error("The dropdown is empty");s(i)}},options(){return!1===Array.isArray(this.props.options)?[]:this.props.options.map((e=>e.dialog?(e.click=()=>{const s="string"==typeof e.dialog?e.dialog:e.dialog.url,i="object"==typeof e.dialog?e.dialog:{};return t.app.$dialog(s,i)},e):e))},set(t){return t.options&&(t.props={options:t.options}),e.set.call(this,t)}})},ku=t=>{const e=P();e.on("online",(()=>{t.isOffline=!1})),e.on("offline",(()=>{t.isOffline=!0})),e.on("keydown.cmd.s",(s=>{e.emit(t.context+".save",s)})),e.on("keydown.cmd.shift.f",(()=>t.search())),e.on("keydown.cmd./",(()=>t.search())),e.on("clipboard.write",(async e=>{ql.write(e),t.notification.success(t.t("copy.success")+"!")}));const s={document:{blur:!0,click:!1,copy:!0,focus:!0,paste:!0},window:{beforeunload:!1,dragenter:!1,dragexit:!1,dragleave:!1,dragover:!1,drop:!1,keydown:!1,keyup:!1,offline:!1,online:!1,popstate:!1}};return{beforeunload(t){this.emit("beforeunload",t)},blur(t){this.emit("blur",t)},click(t){this.emit("click",t)},copy(t){this.emit("copy",t)},dragenter(t){this.entered=t.target,this.prevent(t),this.emit("dragenter",t)},dragexit(t){this.prevent(t),this.entered=null,this.emit("dragexit",t)},dragleave(t){this.prevent(t),this.entered===t.target&&(this.entered=null,this.emit("dragleave",t))},dragover(t){this.prevent(t),this.emit("dragover",t)},drop(t){this.prevent(t),this.entered=null,this.emit("drop",t)},emit:e.emit,entered:null,focus(t){this.emit("focus",t)},keychain(t,e){let s=[t];(e.metaKey||e.ctrlKey)&&s.push("cmd"),!0===e.altKey&&s.push("alt"),!0===e.shiftKey&&s.push("shift");let i=e.key?lc(e.key):null;const n={escape:"esc",arrowUp:"up",arrowDown:"down",arrowLeft:"left",arrowRight:"right"};return n[i]&&(i=n[i]),i&&!1===["alt","control","shift","meta"].includes(i)&&s.push(i),s.join(".")},keydown(t){this.emit(this.keychain("keydown",t),t),this.emit("keydown",t)},keyup(t){this.emit(this.keychain("keyup",t),t),this.emit("keyup",t)},off:e.off,offline(t){this.emit("offline",t)},on:e.on,online(t){this.emit("online",t)},paste(t){this.emit("paste",t)},popstate(t){this.emit("popstate",t)},prevent(t){t.stopPropagation(),t.preventDefault()},subscribe(){for(const t in s.document)document.addEventListener(t,this[t].bind(this),s.document[t]);for(const t in s.window)window.addEventListener(t,this[t].bind(this),s.window[t])},unsubscribe(){for(const t in s.document)document.removeEventListener(t,this[t]);for(const t in s.window)window.removeEventListener(t,this[t])}}},bu={interval:null,start(t,e){this.stop(),t&&(this.interval=setInterval(e,t))},stop(){clearInterval(this.interval),this.interval=null}},yu=(t={})=>{const e=Gc("notification",{context:null,details:null,icon:null,isOpen:!1,message:null,theme:null,timeout:null,type:null});return Vue.reactive({...e,close(){return this.timer.stop(),this.reset(),this.state()},deprecated(t){console.warn("Deprecated: "+t)},error(e){if(e instanceof eu&&t.user.id)return t.redirect("logout");if(e instanceof su)return this.fatal(e);if(e instanceof tu){const t=Object.values(e.response.json).find((t=>"string"==typeof(null==t?void 0:t.error)));t&&(e.message=t.error)}return"string"==typeof e&&(e={message:e}),e={message:e.message??"Something went wrong",details:e.details??{}},"view"===t.context&&t.dialog.open({component:"k-error-dialog",props:e}),this.open({message:e.message,icon:"alert",theme:"negative",type:"error"})},info(t={}){return"string"==typeof t&&(t={message:t}),this.open({icon:"info",theme:"info",...t})},get isFatal(){return"fatal"===this.type},fatal(t){return"string"==typeof t?this.open({message:t,type:"fatal"}):t instanceof su?this.open({message:t.response.text,type:"fatal"}):this.open({message:t.message??"Something went wrong",type:"fatal"})},open(e){return this.timer.stop(),"string"==typeof e?this.success(e):("error"!==e.type&&"fatal"!==e.type&&(e.timeout??(e.timeout=4e3)),this.set({context:t.context,...e}),this.isOpen=!0,this.timer.start(this.timeout,(()=>this.close())),this.state())},success(t={}){return"string"==typeof t&&(t={message:t}),this.open({icon:"check",theme:"positive",...t})},timer:bu})},vu=()=>{const t=Gc("language",{code:null,default:!1,direction:"ltr",name:null,rules:null});return Vue.reactive({...t,get isDefault(){return this.default}})},$u=(t,e,s)=>{if(!s.template&&!s.render&&!s.extends)throw new Error(`Neither template nor render method provided. Nor extending a component when loading plugin component "${e}". The component has not been registered.`);return(s=wu(t,e,s)).template&&(s.render=null),s=xu(s),!0===Gl(e)&&window.console.warn(`Plugin is replacing "${e}"`),t.component(e,s),s},wu=(t,e,s)=>"string"!=typeof(null==s?void 0:s.extends)?s:!1===Gl(s.extends)?(window.console.warn(`Problem with plugin trying to register component "${e}": cannot extend non-existent component "${s.extends}"`),s.extends=null,s):(s.extends=t.options.components[s.extends].extend({options:s,components:{...t.options.components,...s.components??{}}}),s),xu=t=>{if(!1===Array.isArray(t.mixins))return t;const e={dialog:At,drawer:pe,section:pa};return t.mixins=t.mixins.map((t=>"string"==typeof t?e[t]:t)),t},_u=(t,e={})=>((e={components:{},created:[],icons:{},login:null,textareaButtons:{},thirdParty:{},use:[],viewButtons:{},writerMarks:{},writerNodes:{},...e}).use=((t,e)=>{if(!1===Array.isArray(e))return[];for(const s of e)t.use(s);return e})(t,e.use),e.components=((t,e)=>{if(!1===ft(e))return;const s={};for(const[n,o]of Object.entries(e))try{s[n]=$u(t,n,o)}catch(i){window.console.warn(i.message)}return s})(t,e.components),e),Su=t=>{var e;const s=Gc("menu",{entries:[],hover:!1,isOpen:!1}),i=null==(e=window.matchMedia)?void 0:e.call(window,"(max-width: 60rem)"),n=Vue.reactive({...s,blur(t){const e=document.querySelector(".k-panel-menu");if(!e||!1===i.matches)return!1;!1===document.querySelector(".k-panel-menu-proxy").contains(t.target)&&!1===e.contains(t.target)&&this.close()},close(){this.isOpen=!1,!1===i.matches&&localStorage.setItem("kirby$menu",!0)},escape(){if(!1===i.matches)return!1;this.close()},open(){this.isOpen=!0,!1===i.matches&&localStorage.removeItem("kirby$menu")},resize(){if(i.matches)return this.close();null!==localStorage.getItem("kirby$menu")?this.isOpen=!1:this.isOpen=!0},set(t){return this.entries=t,this.resize(),this.state()},toggle(){this.isOpen?this.close():this.open()}});return t.events.on("keydown.esc",n.escape.bind(n)),t.events.on("click",n.blur.bind(n)),null==i||i.addEventListener("change",n.resize.bind(n)),n},Cu=t=>({controller:null,requests:0,get isLoading(){return this.requests>0},open(e){t.menu.escape(),t.dialog.open({component:"k-search-dialog",props:{type:e}})},async query(e,s,i){var n;if(null==(n=this.controller)||n.abort(),this.controller=new AbortController,s.length<2)return{results:null,pagination:{}};this.requests++;try{const{$search:n}=await t.get(`/search/${e}`,{query:{query:s,...i},signal:this.controller.signal});return n}catch(o){if("AbortError"!==o.name)return{results:[],pagination:{}}}finally{this.requests--}}}),Ou=()=>{const t=Gc("theme",{setting:localStorage.getItem("kirby$theme")});return Vue.reactive({...t,get current(){return this.setting??this.system},reset(){this.setting=null,localStorage.removeItem("kirby$theme")},set(t){this.setting=t,localStorage.setItem("kirby$theme",t)},get system(){var t;return(null==(t=window.matchMedia)?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light"}})},Mu=()=>{const t=Gc("translation",{code:null,data:{},direction:"ltr",name:null,weekday:1});return Vue.reactive({...t,set(e){return t.set.call(this,e),document.documentElement.lang=this.code,document.body.dir=this.direction,this.state()},translate(t,e,s=null){if("string"!=typeof t)return;const i=this.data[t]??s;return"string"!=typeof i?i:dc(i,e)}})};const Au=t=>{const e=Gc("upload",{abort:null,accept:"*",attributes:{},files:[],max:null,multiple:!0,preview:{},replacing:null,url:null});return Vue.reactive({...e,...cu(),input:null,cancel(){var e;this.emit("cancel"),null==(e=this.abort)||e.abort(),this.completed.length>0&&(this.emit("complete",this.completed),t.view.reload()),this.reset()},get completed(){return this.files.filter((t=>t.completed)).map((t=>t.model))},done(){t.dialog.close(),this.completed.length>0&&(this.emit("done",this.completed),!1===t.drawer.isOpen&&(t.notification.success({context:"view"}),t.view.reload())),this.reset()},findDuplicate(t){return this.files.findLastIndex((e=>e.src.name===t.src.name&&e.src.type===t.src.type&&e.src.size===t.src.size&&e.src.lastModified===t.src.lastModified))},hasUniqueName(t){return this.files.filter((e=>e.name===t.name&&e.extension===t.extension)).length<2},file(t){const e=URL.createObjectURL(t);return{...this.preview,completed:!1,error:null,extension:Hl(t.name),filename:t.name,id:mc(),model:null,name:Vl(t.name),niceSize:Ul(t.size),progress:0,size:t.size,src:t,type:t.type,url:e}},open(e,s){e instanceof FileList?(this.set(s),this.select(e)):this.set(e);const i={component:"k-upload-dialog",props:{preview:this.preview},on:{open:t=>this.emit("open",t),cancel:()=>this.cancel(),submit:async()=>{t.dialog.isLoading=!0,await this.submit(),t.dialog.isLoading=!1}}};this.replacing&&(i.component="k-upload-replace-dialog",i.props.original=this.replacing),t.dialog.open(i)},pick(t){this.set(t),this.input=document.createElement("input"),this.input.type="file",this.input.classList.add("sr-only"),this.input.value=null,this.input.accept=this.accept,this.input.multiple=this.multiple,this.input.click(),this.input.addEventListener("change",(e=>{!0===(null==t?void 0:t.immediate)?(this.set(t),this.select(e.target.files),this.submit()):this.open(e.target.files,t),this.input.remove()}))},remove(t){this.files=this.files.filter((e=>e.id!==t))},replace(e,s){this.pick({...s,url:t.urls.api+"/"+e.link,accept:"."+e.extension+","+e.mime,multiple:!1,replacing:e})},reset(){e.reset.call(this),this.files.splice(0)},select(t,e){if(this.set(e),t instanceof Event&&(t=t.target.files),t instanceof FileList==!1)throw new Error("Please provide a FileList");t=(t=[...t]).map((t=>this.file(t))),this.files=[...this.files,...t],this.files=this.files.filter(((t,e)=>this.findDuplicate(t)===e)),null!==this.max&&(this.files=this.files.slice(-1*this.max)),this.emit("select",this.files)},set(t){if(t)return e.set.call(this,t),this.on={},this.addEventListeners(t.on??{}),1===this.max&&(this.multiple=!1),!1===this.multiple&&(this.max=1),this.state()},async submit(){var e;if(!this.url)throw new Error("The upload URL is missing");this.abort=new AbortController;const s=[];for(const i of this.files){if(!0===i.completed)continue;if(!1===this.hasUniqueName(i)){i.error=t.t("error.file.name.unique");continue}i.error=null,i.progress=0;const n={...this.attributes};s.push((async()=>await this.upload(i,n)));const o=null==(e=this.attributes)?void 0:e.sort;null!=o&&this.attributes.sort++}if(await async function(t,e=20){let s=0,i=0;return new Promise((n=>{const o=e=>i=>{t[e]=i,s--,r()},r=()=>{if(s1?t.slice(i,l,t.type):t;n>1&&(e.headers={...e.headers,"Upload-Length":t.size,"Upload-Offset":i,"Upload-Id":o}),r=await kc(c,{...e,progress:(s,n,o)=>{const r=n.size*(o/100),a=(i+r)/t.size;e.progress(s,t,Math.round(100*a))}})}return r}(e.src,{abort:this.abort.signal,attributes:s,filename:e.name+"."+e.extension,headers:{"x-csrf":t.system.csrf},url:this.url,progress:(t,s,i)=>{e.progress=i}},t.config.upload);e.completed=!0,e.model=i.data}catch(i){t.error(i,!1),e.error=i.message,e.progress=0}}})},Du=t=>{const e=uu(t,"view",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,breadcrumb:[],breadcrumbLabel:null,icon:null,id:null,link:null,search:"pages",title:null});return Vue.reactive({...e,set(s){e.set.call(this,s),t.title=this.title;const i=this.url().toString();window.location.toString()!==i&&(window.history.pushState(null,null,i),window.scrollTo(0,0))},async submit(){throw new Error("Not yet implemented")}})},ju={config:{},languages:[],license:"missing",multilang:!1,permissions:{},searches:{},urls:{}},Eu=["dialog","drawer"],Tu=["dropdown","language","menu","notification","system","translation","user"],Lu={create(t={}){return this.isLoading=!1,this.isOffline=!1,this.activation=Xc(),this.drag=hu(),this.events=ku(this),this.searcher=Cu(this),this.theme=Ou(),this.upload=Au(this),this.language=vu(),this.menu=Su(this),this.notification=yu(this),this.system=Gc("system",{ascii:{},csrf:null,isLocal:null,locales:{},slugs:[],title:null}),this.translation=Mu(),this.user=Gc("user",{email:null,id:null,language:null,role:null,username:null}),this.dropdown=gu(this),this.view=Du(this),this.content=lu(this),this.drawer=fu(this),this.dialog=du(this),this.redirect=iu,this.reload=this.view.reload.bind(this.view),this.t=this.translation.translate.bind(this.translation),this.plugins=_u(window.Vue,t),this.set(window.fiber),this.api=au(this),Vue.reactive(this)},get context(){return this.dialog.isOpen?"dialog":this.drawer.isOpen?"drawer":"view"},get debug(){return!0===this.config.debug},deprecated(t){this.notification.deprecated(t)},get direction(){return this.translation.direction},error(t,e=!0){if(!0===this.debug&&console.error(t),!0===e)return this.notification.error(t)},async get(t,e={}){const{response:s}=await this.request(t,{method:"GET",...e});return(null==s?void 0:s.json)??{}},async open(t,e={}){try{if(!1===xc(t))this.set(t);else{this.isLoading=!0;const s=await this.get(t,e);this.set(s),this.isLoading=!1}return this.state()}catch(s){return this.error(s)}},overlays(){const t=[];return!0===this.drawer.isOpen&&t.push("drawer"),!0===this.dialog.isOpen&&t.push("dialog"),t},async post(t,e={},s={}){const{response:i}=await this.request(t,{method:"POST",body:e,...s});return i.json},async request(t,e={}){return nu(t,{referrer:this.view.path,csrf:this.system.csrf,...e})},async search(t,e,s){return void 0===e?this.searcher.open(t):this.searcher.query(t,e,s)},set(t={}){t=Object.fromEntries(Object.entries(t).map((([t,e])=>[t.replace("$",""),e])));for(const e in ju){const s=t[e]??this[e]??ju[e];typeof s==typeof ju[e]&&(this[e]=s)}for(const e of Tu)(ft(t[e])||Array.isArray(t[e]))&&this[e].set(t[e]);for(const e of Eu)if(!0===ft(t[e])){if(t[e].redirect)return this.open(t[e].redirect);this[e].open(t[e])}else void 0!==t[e]&&this[e].close(!0);!0===ft(t.dropdown)?this.dropdown.open(t.dropdown):void 0!==t.dropdown&&this.dropdown.close(),!0===ft(t.view)&&this.view.open(t.view)},state(){const t={};for(const e in ju)t[e]=this[e]??ju[e];for(const e of Tu)t[e]=this[e].state();for(const e of Eu)t[e]=this[e].state();return t.dropdown=this.dropdown.state(),t.view=this.view.state(),t},get title(){return document.title},set title(t){!1===ac(this.system.title)&&(t+=" | "+this.system.title),document.title=t},url:(t="",e={},s)=>vc(t,e,s)};Vue.config.productionTip=!1,Vue.config.devtools=!0,Vue.use(Oc),Vue.use(Jc),Vue.use(El),window.panel=Vue.prototype.$panel=Lu.create(window.panel.plugins),window.panel.app=new Vue({render:()=>Vue.h(N)}),Vue.use(Mc),Vue.use(Tl),Vue.use(Ac),window.panel.app.$mount("#app");export{nt as n}; diff --git a/panel/dist/js/sortable.esm.min.js b/panel/dist/js/sortable.esm.min.js index c437a61a07..d5e91186e6 100644 --- a/panel/dist/js/sortable.esm.min.js +++ b/panel/dist/js/sortable.esm.min.js @@ -1,7 +1,7 @@ /**! - * Sortable 1.15.2 + * Sortable 1.15.3 * @author RubaXa * @author owenm * @license MIT */ -function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function e(e){for(var n=1;n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function a(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var l=a(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),s=a(/Edge/i),c=a(/firefox/i),u=a(/safari/i)&&!a(/chrome/i)&&!a(/android/i),d=a(/iP(ad|od|hone)/i),h=a(/chrome/i)&&a(/android/i),f={capture:!1,passive:!1};function p(t,e,n){t.addEventListener(e,n,!l&&f)}function g(t,e,n){t.removeEventListener(e,n,!l&&f)}function v(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(n){return!1}return!1}}function m(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function b(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&v(t,e):v(t,e))||o&&t===n)return t;if(t===n)break}while(t=m(t))}return null}var y,w=/\s+/g;function E(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(w," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(w," ")}}function S(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function D(t,e){var n="";if("string"==typeof t)n=t;else do{var o=S(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function _(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i=C(o)[n]))return o;if(o===T())break;o=I(o,!1)}return!1}function O(t,e,n,o){for(var i=0,r=0,a=t.children;r2&&void 0!==arguments[2]?arguments[2]:{},i=o.evt,a=r(o,W);L.pluginEvent.bind(Yt)(t,n,e({dragEl:U,parentEl:V,ghostEl:q,rootEl:Z,nextEl:K,lastDownEl:Q,cloneEl:$,cloneHidden:J,dragStarted:ht,putSortable:rt,activeSortable:Yt.active,originalEvent:i,oldIndex:tt,oldDraggableIndex:nt,newIndex:et,newDraggableIndex:ot,hideGhostForTarget:It,unhideGhostForTarget:Pt,cloneNowHidden:function(){J=!0},cloneNowShown:function(){J=!1},dispatchSortableEvent:function(t){G({sortable:n,name:t,originalEvent:i})}},a))};function G(t){!function(t){var n=t.sortable,o=t.rootEl,i=t.name,r=t.targetEl,a=t.cloneEl,c=t.toEl,u=t.fromEl,d=t.oldIndex,h=t.newIndex,f=t.oldDraggableIndex,p=t.newDraggableIndex,g=t.originalEvent,v=t.putSortable,m=t.extraEventProperties;if(n=n||o&&o[B]){var b,y=n.options,w="on"+i.charAt(0).toUpperCase()+i.substr(1);!window.CustomEvent||l||s?(b=document.createEvent("Event")).initEvent(i,!0,!0):b=new CustomEvent(i,{bubbles:!0,cancelable:!0}),b.to=c||o,b.from=u||o,b.item=r||o,b.clone=a,b.oldIndex=d,b.newIndex=h,b.oldDraggableIndex=f,b.newDraggableIndex=p,b.originalEvent=g,b.pullMode=v?v.lastPutMode:void 0;var E=e(e({},m),L.getEventProperties(i,n));for(var S in E)b[S]=E[S];o&&o.dispatchEvent(b),y[w]&&y[w].call(n,b)}}(e({putSortable:rt,cloneEl:$,targetEl:U,rootEl:Z,oldIndex:tt,oldDraggableIndex:nt,newIndex:et,newDraggableIndex:ot},t))}var U,V,q,Z,K,Q,$,J,tt,et,nt,ot,it,rt,at,lt,st,ct,ut,dt,ht,ft,pt,gt,vt,mt=!1,bt=!1,yt=[],wt=!1,Et=!1,St=[],Dt=!1,_t=[],Tt="undefined"!=typeof document,Ct=d,xt=s||l?"cssFloat":"float",Ot=Tt&&!h&&!d&&"draggable"in document.createElement("div"),Mt=function(){if(Tt){if(l)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Nt=function(t,e){var n=S(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=O(t,0,e),r=O(t,1,e),a=i&&S(i),l=r&&S(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+C(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+C(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){var u="left"===a.float?"left":"right";return!r||"both"!==l.clear&&l.clear!==u?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=o&&"none"===n[xt]||r&&"none"===n[xt]&&s+c>o)?"vertical":"horizontal"},At=function(t){function e(t,n){return function(o,i,r,a){var l=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==t&&(n||l))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,i,r,a),n)(o,i,r,a);var s=(n?o:i).options.group.name;return!0===t||"string"==typeof t&&t===s||t.join&&t.indexOf(s)>-1}}var o={},i=t.group;i&&"object"==n(i)||(i={name:i}),o.name=i.name,o.checkPull=e(i.pull,!0),o.checkPut=e(i.put),o.revertClone=i.revertClone,t.group=o},It=function(){!Mt&&q&&S(q,"display","none")},Pt=function(){!Mt&&q&&S(q,"display","")};Tt&&!h&&document.addEventListener("click",(function(t){if(bt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),bt=!1,!1}),!0);var kt=function(t){if(U){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,yt.some((function(t){var e=t[B].options.emptyInsertThreshold;if(e&&!M(t)){var n=C(t),o=i>=n.left-e&&i<=n.right+e,l=r>=n.top-e&&r<=n.bottom+e;return o&&l?a=t:void 0}})),a);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[B]._onDragOver(n)}}var i,r,a},Xt=function(t){U&&U.parentNode[B]._isOutsideThisEl(t.target)};function Yt(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=i({},e),t[B]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Nt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Yt.supportPointer&&"PointerEvent"in window&&!u,emptyInsertThreshold:5};for(var o in L.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var r in At(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Ot,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?p(t,"pointerdown",this._onTapStart):(p(t,"mousedown",this._onTapStart),p(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(p(t,"dragover",this),p(t,"dragenter",this)),yt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),i(this,F())}function Rt(t,e,n,o,i,r,a,c){var u,d,h=t[B],f=h.options.onMove;return!window.CustomEvent||l||s?(u=document.createEvent("Event")).initEvent("move",!0,!0):u=new CustomEvent("move",{bubbles:!0,cancelable:!0}),u.to=e,u.from=t,u.dragged=n,u.draggedRect=o,u.related=i||e,u.relatedRect=r||C(e),u.willInsertAfter=c,u.originalEvent=a,t.dispatchEvent(u),f&&(d=f.call(h,u,a)),d}function Bt(t){t.draggable=!1}function Ft(){Dt=!1}function jt(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Ht(t){return setTimeout(t,0)}function Lt(t){return clearTimeout(t)}Yt.prototype={constructor:Yt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(ft=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,U):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,i=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,l=(a||t).target,s=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=o.filter;if(function(t){_t.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&_t.push(o)}}(n),!U&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!u||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=b(l,o.draggable,n,!1))&&l.animated||Q===l)){if(tt=N(l),nt=N(l,o.draggable),"function"==typeof c){if(c.call(this,t,l,this))return G({sortable:e,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),z("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=b(s,o.trim(),n,!1))return G({sortable:e,rootEl:o,name:"filter",targetEl:l,fromEl:n,toEl:n}),z("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!b(s,o.handle,n,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,u=r.ownerDocument;if(n&&!U&&n.parentNode===r){var d=C(n);if(Z=r,V=(U=n).parentNode,K=U.nextSibling,Q=n,it=a.group,Yt.dragged=U,at={target:U,clientX:(e||t).clientX,clientY:(e||t).clientY},ut=at.clientX-d.left,dt=at.clientY-d.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,U.style["will-change"]="all",o=function(){z("delayEnded",i,{evt:t}),Yt.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!c&&i.nativeDraggable&&(U.draggable=!0),i._triggerDragStart(t,e),G({sortable:i,name:"choose",originalEvent:t}),E(U,a.chosenClass,!0))},a.ignore.split(",").forEach((function(t){_(U,t.trim(),Bt)})),p(u,"dragover",kt),p(u,"mousemove",kt),p(u,"touchmove",kt),p(u,"mouseup",i._onDrop),p(u,"touchend",i._onDrop),p(u,"touchcancel",i._onDrop),c&&this.nativeDraggable&&(this.options.touchStartThreshold=4,U.draggable=!0),z("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(s||l))o();else{if(Yt.eventCanceled)return void this._onDrop();p(u,"mouseup",i._disableDelayedDrag),p(u,"touchend",i._disableDelayedDrag),p(u,"touchcancel",i._disableDelayedDrag),p(u,"mousemove",i._delayedDragTouchMoveHandler),p(u,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&p(u,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){U&&Bt(U),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;g(t,"mouseup",this._disableDelayedDrag),g(t,"touchend",this._disableDelayedDrag),g(t,"touchcancel",this._disableDelayedDrag),g(t,"mousemove",this._delayedDragTouchMoveHandler),g(t,"touchmove",this._delayedDragTouchMoveHandler),g(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?p(document,"pointermove",this._onTouchMove):p(document,e?"touchmove":"mousemove",this._onTouchMove):(p(U,"dragend",this),p(Z,"dragstart",this._onDragStart));try{document.selection?Ht((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(mt=!1,Z&&U){z("dragStarted",this,{evt:e}),this.nativeDraggable&&p(document,"dragover",Xt);var n=this.options;!t&&E(U,n.dragClass,!1),E(U,n.ghostClass,!0),Yt.active=this,t&&this._appendGhost(),G({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(lt){this._lastX=lt.clientX,this._lastY=lt.clientY,It();for(var t=document.elementFromPoint(lt.clientX,lt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(lt.clientX,lt.clientY))!==e;)e=t;if(U.parentNode[B]._isOutsideThisEl(t),e)do{if(e[B]){if(e[B]._onDragOver({clientX:lt.clientX,clientY:lt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Pt()}},_onTouchMove:function(t){if(at){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=q&&D(q,!0),a=q&&r&&r.a,l=q&&r&&r.d,s=Ct&&vt&&A(vt),c=(i.clientX-at.clientX+o.x)/(a||1)+(s?s[0]-St[0]:0)/(a||1),u=(i.clientY-at.clientY+o.y)/(l||1)+(s?s[1]-St[1]:0)/(l||1);if(!Yt.active&&!mt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))i.right+r||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>i.bottom+r||t.clientX>o.right&&t.clientY>o.top}(t,r,this)&&!v.animated){if(v===U)return W(!1);if(v&&a===t.target&&(l=v),l&&(o=C(l)),!1!==Rt(Z,a,U,n,l,o,t,!!l))return L(),v&&v.nextSibling?a.insertBefore(U,v.nextSibling):a.appendChild(U),V=a,Q(),W(!0)}else if(v&&function(t,e,n){var o=C(O(n.el,0,n.options,!0)),i=R(n.el,n.options,q),r=10;return e?t.clientXu+c*r/2:sd-gt)return-pt}else if(s>u+c*(1-i)/2&&sd-c*r/2))return s>u+c/2?1:-1;return 0}(t,l,o,r,T?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,Et,ft===l),0!==y){var k=N(U);do{k-=y,D=V.children[k]}while(D&&("none"===S(D,"display")||D===q))}if(0===y||D===l)return W(!1);ft=l,pt=y;var Y=l.nextElementSibling,F=!1,j=Rt(Z,a,U,n,l,o,t,F=1===y);if(!1!==j)return 1!==j&&-1!==j||(F=1===j),Dt=!0,setTimeout(Ft,30),L(),F&&!Y?a.appendChild(U):l.parentNode.insertBefore(U,F?Y:l),I&&X(I,0,P-I.scrollTop),V=U.parentNode,void 0===w||Et||(gt=Math.abs(w-C(l)[A])),Q(),W(!0)}if(a.contains(U))return W(!1)}return!1}function H(s,c){z(s,p,e({evt:t,isOwner:d,axis:r?"vertical":"horizontal",revert:i,dragRect:n,targetRect:o,canSort:h,fromSortable:f,target:l,completed:W,onMove:function(e,o){return Rt(Z,a,U,n,e,C(e),t,o)},changed:Q},c))}function L(){H("dragOverAnimationCapture"),p.captureAnimationState(),p!==f&&f.captureAnimationState()}function W(e){return H("dragOverCompleted",{insertion:e}),e&&(d?u._hideClone():u._showClone(p),p!==f&&(E(U,rt?rt.options.ghostClass:u.options.ghostClass,!1),E(U,s.ghostClass,!0)),rt!==p&&p!==Yt.active?rt=p:p===Yt.active&&rt&&(rt=null),f===p&&(p._ignoreWhileAnimating=l),p.animateAll((function(){H("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(l===U&&!U.animated||l===a&&!l.animated)&&(ft=null),s.dragoverBubble||t.rootEl||l===document||(U.parentNode[B]._isOutsideThisEl(t.target),!e&&kt(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function Q(){et=N(U),ot=N(U,s.draggable),G({sortable:p,name:"change",toEl:a,newIndex:et,newDraggableIndex:ot,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){g(document,"mousemove",this._onTouchMove),g(document,"touchmove",this._onTouchMove),g(document,"pointermove",this._onTouchMove),g(document,"dragover",kt),g(document,"mousemove",kt),g(document,"touchmove",kt)},_offUpEvents:function(){var t=this.el.ownerDocument;g(t,"mouseup",this._onDrop),g(t,"touchend",this._onDrop),g(t,"pointerup",this._onDrop),g(t,"touchcancel",this._onDrop),g(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;et=N(U),ot=N(U,n.draggable),z("drop",this,{evt:t}),V=U&&U.parentNode,et=N(U),ot=N(U,n.draggable),Yt.eventCanceled||(mt=!1,Et=!1,wt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Lt(this.cloneId),Lt(this._dragStartId),this.nativeDraggable&&(g(document,"drop",this),g(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),u&&S(document.body,"user-select",""),S(U,"transform",""),t&&(ht&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),q&&q.parentNode&&q.parentNode.removeChild(q),(Z===V||rt&&"clone"!==rt.lastPutMode)&&$&&$.parentNode&&$.parentNode.removeChild($),U&&(this.nativeDraggable&&g(U,"dragend",this),Bt(U),U.style["will-change"]="",ht&&!mt&&E(U,rt?rt.options.ghostClass:this.options.ghostClass,!1),E(U,this.options.chosenClass,!1),G({sortable:this,name:"unchoose",toEl:V,newIndex:null,newDraggableIndex:null,originalEvent:t}),Z!==V?(et>=0&&(G({rootEl:V,name:"add",toEl:V,fromEl:Z,originalEvent:t}),G({sortable:this,name:"remove",toEl:V,originalEvent:t}),G({rootEl:V,name:"sort",toEl:V,fromEl:Z,originalEvent:t}),G({sortable:this,name:"sort",toEl:V,originalEvent:t})),rt&&rt.save()):et!==tt&&et>=0&&(G({sortable:this,name:"update",toEl:V,originalEvent:t}),G({sortable:this,name:"sort",toEl:V,originalEvent:t})),Yt.active&&(null!=et&&-1!==et||(et=tt,ot=nt),G({sortable:this,name:"end",toEl:V,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){z("nulling",this),Z=U=V=q=K=$=Q=J=at=lt=ht=et=ot=tt=nt=ft=pt=rt=it=Yt.dragged=Yt.ghost=Yt.clone=Yt.active=null,_t.forEach((function(t){t.checked=!0})),_t.length=st=ct=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":U&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function a(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var l=a(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),s=a(/Edge/i),c=a(/firefox/i),u=a(/safari/i)&&!a(/chrome/i)&&!a(/android/i),d=a(/iP(ad|od|hone)/i),h=a(/chrome/i)&&a(/android/i),f={capture:!1,passive:!1};function p(t,e,n){t.addEventListener(e,n,!l&&f)}function g(t,e,n){t.removeEventListener(e,n,!l&&f)}function v(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(n){return!1}return!1}}function m(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function b(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&v(t,e):v(t,e))||o&&t===n)return t;if(t===n)break}while(t=m(t))}return null}var y,w=/\s+/g;function E(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(w," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(w," ")}}function S(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function D(t,e){var n="";if("string"==typeof t)n=t;else do{var o=S(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function _(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i=C(o)[n]))return o;if(o===T())break;o=I(o,!1)}return!1}function O(t,e,n,o){for(var i=0,r=0,a=t.children;r2&&void 0!==arguments[2]?arguments[2]:{},i=o.evt,a=r(o,W);L.pluginEvent.bind(Yt)(t,n,e({dragEl:U,parentEl:V,ghostEl:q,rootEl:Z,nextEl:K,lastDownEl:Q,cloneEl:$,cloneHidden:J,dragStarted:ht,putSortable:rt,activeSortable:Yt.active,originalEvent:i,oldIndex:tt,oldDraggableIndex:nt,newIndex:et,newDraggableIndex:ot,hideGhostForTarget:It,unhideGhostForTarget:Pt,cloneNowHidden:function(){J=!0},cloneNowShown:function(){J=!1},dispatchSortableEvent:function(t){G({sortable:n,name:t,originalEvent:i})}},a))};function G(t){!function(t){var n=t.sortable,o=t.rootEl,i=t.name,r=t.targetEl,a=t.cloneEl,c=t.toEl,u=t.fromEl,d=t.oldIndex,h=t.newIndex,f=t.oldDraggableIndex,p=t.newDraggableIndex,g=t.originalEvent,v=t.putSortable,m=t.extraEventProperties;if(n=n||o&&o[B]){var b,y=n.options,w="on"+i.charAt(0).toUpperCase()+i.substr(1);!window.CustomEvent||l||s?(b=document.createEvent("Event")).initEvent(i,!0,!0):b=new CustomEvent(i,{bubbles:!0,cancelable:!0}),b.to=c||o,b.from=u||o,b.item=r||o,b.clone=a,b.oldIndex=d,b.newIndex=h,b.oldDraggableIndex=f,b.newDraggableIndex=p,b.originalEvent=g,b.pullMode=v?v.lastPutMode:void 0;var E=e(e({},m),L.getEventProperties(i,n));for(var S in E)b[S]=E[S];o&&o.dispatchEvent(b),y[w]&&y[w].call(n,b)}}(e({putSortable:rt,cloneEl:$,targetEl:U,rootEl:Z,oldIndex:tt,oldDraggableIndex:nt,newIndex:et,newDraggableIndex:ot},t))}var U,V,q,Z,K,Q,$,J,tt,et,nt,ot,it,rt,at,lt,st,ct,ut,dt,ht,ft,pt,gt,vt,mt=!1,bt=!1,yt=[],wt=!1,Et=!1,St=[],Dt=!1,_t=[],Tt="undefined"!=typeof document,Ct=d,xt=s||l?"cssFloat":"float",Ot=Tt&&!h&&!d&&"draggable"in document.createElement("div"),Mt=function(){if(Tt){if(l)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Nt=function(t,e){var n=S(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=O(t,0,e),r=O(t,1,e),a=i&&S(i),l=r&&S(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+C(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+C(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){var u="left"===a.float?"left":"right";return!r||"both"!==l.clear&&l.clear!==u?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=o&&"none"===n[xt]||r&&"none"===n[xt]&&s+c>o)?"vertical":"horizontal"},At=function(t){function e(t,n){return function(o,i,r,a){var l=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==t&&(n||l))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,i,r,a),n)(o,i,r,a);var s=(n?o:i).options.group.name;return!0===t||"string"==typeof t&&t===s||t.join&&t.indexOf(s)>-1}}var o={},i=t.group;i&&"object"==n(i)||(i={name:i}),o.name=i.name,o.checkPull=e(i.pull,!0),o.checkPut=e(i.put),o.revertClone=i.revertClone,t.group=o},It=function(){!Mt&&q&&S(q,"display","none")},Pt=function(){!Mt&&q&&S(q,"display","")};Tt&&!h&&document.addEventListener("click",(function(t){if(bt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),bt=!1,!1}),!0);var kt=function(t){if(U){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,yt.some((function(t){var e=t[B].options.emptyInsertThreshold;if(e&&!M(t)){var n=C(t),o=i>=n.left-e&&i<=n.right+e,l=r>=n.top-e&&r<=n.bottom+e;return o&&l?a=t:void 0}})),a);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[B]._onDragOver(n)}}var i,r,a},Xt=function(t){U&&U.parentNode[B]._isOutsideThisEl(t.target)};function Yt(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=i({},e),t[B]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Nt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Yt.supportPointer&&"PointerEvent"in window&&!u,emptyInsertThreshold:5};for(var o in L.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var r in At(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Ot,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?p(t,"pointerdown",this._onTapStart):(p(t,"mousedown",this._onTapStart),p(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(p(t,"dragover",this),p(t,"dragenter",this)),yt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),i(this,F())}function Rt(t,e,n,o,i,r,a,c){var u,d,h=t[B],f=h.options.onMove;return!window.CustomEvent||l||s?(u=document.createEvent("Event")).initEvent("move",!0,!0):u=new CustomEvent("move",{bubbles:!0,cancelable:!0}),u.to=e,u.from=t,u.dragged=n,u.draggedRect=o,u.related=i||e,u.relatedRect=r||C(e),u.willInsertAfter=c,u.originalEvent=a,t.dispatchEvent(u),f&&(d=f.call(h,u,a)),d}function Bt(t){t.draggable=!1}function Ft(){Dt=!1}function jt(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Ht(t){return setTimeout(t,0)}function Lt(t){return clearTimeout(t)}Yt.prototype={constructor:Yt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(ft=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,U):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,i=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,l=(a||t).target,s=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=o.filter;if(function(t){_t.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&_t.push(o)}}(n),!U&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!u||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=b(l,o.draggable,n,!1))&&l.animated||Q===l)){if(tt=N(l),nt=N(l,o.draggable),"function"==typeof c){if(c.call(this,t,l,this))return G({sortable:e,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),z("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=b(s,o.trim(),n,!1))return G({sortable:e,rootEl:o,name:"filter",targetEl:l,fromEl:n,toEl:n}),z("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!b(s,o.handle,n,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,u=r.ownerDocument;if(n&&!U&&n.parentNode===r){var d=C(n);if(Z=r,V=(U=n).parentNode,K=U.nextSibling,Q=n,it=a.group,Yt.dragged=U,at={target:U,clientX:(e||t).clientX,clientY:(e||t).clientY},ut=at.clientX-d.left,dt=at.clientY-d.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,U.style["will-change"]="all",o=function(){z("delayEnded",i,{evt:t}),Yt.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!c&&i.nativeDraggable&&(U.draggable=!0),i._triggerDragStart(t,e),G({sortable:i,name:"choose",originalEvent:t}),E(U,a.chosenClass,!0))},a.ignore.split(",").forEach((function(t){_(U,t.trim(),Bt)})),p(u,"dragover",kt),p(u,"mousemove",kt),p(u,"touchmove",kt),p(u,"mouseup",i._onDrop),p(u,"touchend",i._onDrop),p(u,"touchcancel",i._onDrop),c&&this.nativeDraggable&&(this.options.touchStartThreshold=4,U.draggable=!0),z("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(s||l))o();else{if(Yt.eventCanceled)return void this._onDrop();p(u,"mouseup",i._disableDelayedDrag),p(u,"touchend",i._disableDelayedDrag),p(u,"touchcancel",i._disableDelayedDrag),p(u,"mousemove",i._delayedDragTouchMoveHandler),p(u,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&p(u,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){U&&Bt(U),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;g(t,"mouseup",this._disableDelayedDrag),g(t,"touchend",this._disableDelayedDrag),g(t,"touchcancel",this._disableDelayedDrag),g(t,"mousemove",this._delayedDragTouchMoveHandler),g(t,"touchmove",this._delayedDragTouchMoveHandler),g(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?p(document,"pointermove",this._onTouchMove):p(document,e?"touchmove":"mousemove",this._onTouchMove):(p(U,"dragend",this),p(Z,"dragstart",this._onDragStart));try{document.selection?Ht((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(mt=!1,Z&&U){z("dragStarted",this,{evt:e}),this.nativeDraggable&&p(document,"dragover",Xt);var n=this.options;!t&&E(U,n.dragClass,!1),E(U,n.ghostClass,!0),Yt.active=this,t&&this._appendGhost(),G({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(lt){this._lastX=lt.clientX,this._lastY=lt.clientY,It();for(var t=document.elementFromPoint(lt.clientX,lt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(lt.clientX,lt.clientY))!==e;)e=t;if(U.parentNode[B]._isOutsideThisEl(t),e)do{if(e[B]){if(e[B]._onDragOver({clientX:lt.clientX,clientY:lt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=m(e));Pt()}},_onTouchMove:function(t){if(at){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=q&&D(q,!0),a=q&&r&&r.a,l=q&&r&&r.d,s=Ct&&vt&&A(vt),c=(i.clientX-at.clientX+o.x)/(a||1)+(s?s[0]-St[0]:0)/(a||1),u=(i.clientY-at.clientY+o.y)/(l||1)+(s?s[1]-St[1]:0)/(l||1);if(!Yt.active&&!mt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))i.right+r||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>i.bottom+r||t.clientX>o.right&&t.clientY>o.top}(t,r,this)&&!v.animated){if(v===U)return W(!1);if(v&&a===t.target&&(l=v),l&&(o=C(l)),!1!==Rt(Z,a,U,n,l,o,t,!!l))return L(),v&&v.nextSibling?a.insertBefore(U,v.nextSibling):a.appendChild(U),V=a,Q(),W(!0)}else if(v&&function(t,e,n){var o=C(O(n.el,0,n.options,!0)),i=R(n.el,n.options,q),r=10;return e?t.clientXu+c*r/2:sd-gt)return-pt}else if(s>u+c*(1-i)/2&&sd-c*r/2))return s>u+c/2?1:-1;return 0}(t,l,o,r,T?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,Et,ft===l),0!==y){var k=N(U);do{k-=y,D=V.children[k]}while(D&&("none"===S(D,"display")||D===q))}if(0===y||D===l)return W(!1);ft=l,pt=y;var Y=l.nextElementSibling,F=!1,j=Rt(Z,a,U,n,l,o,t,F=1===y);if(!1!==j)return 1!==j&&-1!==j||(F=1===j),Dt=!0,setTimeout(Ft,30),L(),F&&!Y?a.appendChild(U):l.parentNode.insertBefore(U,F?Y:l),I&&X(I,0,P-I.scrollTop),V=U.parentNode,void 0===w||Et||(gt=Math.abs(w-C(l)[A])),Q(),W(!0)}if(a.contains(U))return W(!1)}return!1}function H(s,c){z(s,p,e({evt:t,isOwner:d,axis:r?"vertical":"horizontal",revert:i,dragRect:n,targetRect:o,canSort:h,fromSortable:f,target:l,completed:W,onMove:function(e,o){return Rt(Z,a,U,n,e,C(e),t,o)},changed:Q},c))}function L(){H("dragOverAnimationCapture"),p.captureAnimationState(),p!==f&&f.captureAnimationState()}function W(e){return H("dragOverCompleted",{insertion:e}),e&&(d?u._hideClone():u._showClone(p),p!==f&&(E(U,rt?rt.options.ghostClass:u.options.ghostClass,!1),E(U,s.ghostClass,!0)),rt!==p&&p!==Yt.active?rt=p:p===Yt.active&&rt&&(rt=null),f===p&&(p._ignoreWhileAnimating=l),p.animateAll((function(){H("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(l===U&&!U.animated||l===a&&!l.animated)&&(ft=null),s.dragoverBubble||t.rootEl||l===document||(U.parentNode[B]._isOutsideThisEl(t.target),!e&&kt(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function Q(){et=N(U),ot=N(U,s.draggable),G({sortable:p,name:"change",toEl:a,newIndex:et,newDraggableIndex:ot,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){g(document,"mousemove",this._onTouchMove),g(document,"touchmove",this._onTouchMove),g(document,"pointermove",this._onTouchMove),g(document,"dragover",kt),g(document,"mousemove",kt),g(document,"touchmove",kt)},_offUpEvents:function(){var t=this.el.ownerDocument;g(t,"mouseup",this._onDrop),g(t,"touchend",this._onDrop),g(t,"pointerup",this._onDrop),g(t,"touchcancel",this._onDrop),g(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;et=N(U),ot=N(U,n.draggable),z("drop",this,{evt:t}),V=U&&U.parentNode,et=N(U),ot=N(U,n.draggable),Yt.eventCanceled||(mt=!1,Et=!1,wt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Lt(this.cloneId),Lt(this._dragStartId),this.nativeDraggable&&(g(document,"drop",this),g(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),u&&S(document.body,"user-select",""),S(U,"transform",""),t&&(ht&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),q&&q.parentNode&&q.parentNode.removeChild(q),(Z===V||rt&&"clone"!==rt.lastPutMode)&&$&&$.parentNode&&$.parentNode.removeChild($),U&&(this.nativeDraggable&&g(U,"dragend",this),Bt(U),U.style["will-change"]="",ht&&!mt&&E(U,rt?rt.options.ghostClass:this.options.ghostClass,!1),E(U,this.options.chosenClass,!1),G({sortable:this,name:"unchoose",toEl:V,newIndex:null,newDraggableIndex:null,originalEvent:t}),Z!==V?(et>=0&&(G({rootEl:V,name:"add",toEl:V,fromEl:Z,originalEvent:t}),G({sortable:this,name:"remove",toEl:V,originalEvent:t}),G({rootEl:V,name:"sort",toEl:V,fromEl:Z,originalEvent:t}),G({sortable:this,name:"sort",toEl:V,originalEvent:t})),rt&&rt.save()):et!==tt&&et>=0&&(G({sortable:this,name:"update",toEl:V,originalEvent:t}),G({sortable:this,name:"sort",toEl:V,originalEvent:t})),Yt.active&&(null!=et&&-1!==et||(et=tt,ot=nt),G({sortable:this,name:"end",toEl:V,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){z("nulling",this),Z=U=V=q=K=$=Q=J=at=lt=ht=et=ot=tt=nt=ft=pt=rt=it=Yt.dragged=Yt.ghost=Yt.clone=Yt.active=null,_t.forEach((function(t){t.checked=!0})),_t.length=st=ct=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":U&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o>1}},t.from=function(e){if(e instanceof t)return e;var n=[];if(e)for(var r in e)n.push(r,e[r]);return new t(n)};class r{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let n=0;nt&&!1!==n(l,r+s,i||null,o)&&l.content.size){let i=s+1;l.nodesBetween(Math.max(0,t-i),Math.min(l.content.size,e-i),n,r+i)}s=a}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let i="",o=!0;return this.nodesBetween(t,e,((s,l)=>{let a=s.isText?s.text.slice(Math.max(t,l)-l,e-l):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&a||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=a}),0),i}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,i=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(i[i.length-1]=e.withText(e.text+n.text),o=1);ot)for(let r=0,o=0;ot&&((oe)&&(s=s.isText?s.cut(Math.max(0,t-o),Math.min(s.text.length,e-o)):s.cut(Math.max(0,t-o-1),Math.min(s.content.size,e-o-1))),n.push(s),i+=s.nodeSize),o=l}return new r(n,i)}cutByIndex(t,e){return t==e?r.empty:0==t&&e==this.content.length?this:new r(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let i=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return i[t]=e,new r(i,o)}addToStart(t){return new r([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new r(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;ethis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=t)return i==t||e>0?o(n+1,i):o(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((t=>t.toJSON())):null}static fromJSON(t,e){if(!e)return r.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new r(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return r.empty;let e,n=0;for(let r=0;rthis.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;et.type.rank-e.type.rank)),e}}l.none=[];class a extends Error{}class c{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=d(this.content,t+this.openStart,e);return n&&new c(n,this.openStart,this.openEnd)}removeBetween(t,e){return new c(h(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return c.empty;let n=e.openStart||0,i=e.openEnd||0;if("number"!=typeof n||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new c(r.fromJSON(t,e.content),n,i)}static maxOpen(t,e=!0){let n=0,r=0;for(let i=t.firstChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new c(t,n,r)}}function h(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(h(o.content,e-i-1,n-i-1)))}function d(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let l=d(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function u(t,e,n){if(n.openStart>t.depth)throw new a("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new a("Inconsistent open depths");return p(t,e,n,0)}function p(t,e,n,i){let o=t.index(i),s=t.node(i);if(o==e.index(i)&&i=0;o--)i=e.node(o).copy(r.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}(n,t);return w(s,v(t,o,l,e,i))}{let r=t.parent,i=r.content;return w(r,i.cut(0,t.parentOffset).append(n.content).append(i.cut(e.parentOffset)))}}return w(s,b(t,e,i))}function f(t,e){if(!e.type.compatibleContent(t.type))throw new a("Cannot join "+e.type.name+" onto "+t.type.name)}function m(t,e,n){let r=t.node(n);return f(r,e.node(n)),r}function g(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function y(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(g(t.nodeAfter,r),o++));for(let l=o;lo&&m(t,e,o+1),l=i.depth>o&&m(n,i,o+1),a=[];return y(null,t,o,a),s&&l&&e.index(o)==n.index(o)?(f(s,l),g(w(s,v(t,e,n,i,o+1)),a)):(s&&g(w(s,b(t,e,o+1)),a),y(e,n,o,a),l&&g(w(l,b(n,i,o+1)),a)),y(i,null,o,a),new r(a)}function b(t,e,n){let i=[];if(y(null,t,n,i),t.depth>n){g(w(m(t,e,n+1),b(t,e,n+1)),i)}return y(e,null,n,i),new r(i)}c.empty=new c(r.empty,0,0);class x{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let i=0;i0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new O(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,i=e;for(let o=t;;){let{index:t,offset:e}=o.content.findIndex(i),s=i-e;if(n.push(o,t,r+e),!s)break;if(o=o.child(t),o.isText)break;i=s-1,r+=e+1}return new x(e,n,i)}static resolveCached(t,e){let n=M.get(t);if(n)for(let i=0;it&&this.nodesBetween(t,e,(t=>(n.isInSet(t.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 t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),D(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=r.empty,i=0,o=n.childCount){let s=this.contentMatchAt(t).matchFragment(n,i,o),l=s&&s.matchFragment(this.content,e);if(!l||!l.validEnd)return!1;for(let r=i;rt.type.name))}`);this.content.forEach((t=>t.check()))}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((t=>t.toJSON()))),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let i=r.fromJSON(t,e.content),o=t.nodeType(e.type).create(e.attrs,i,n);return o.type.checkAttrs(o.attrs),o}}N.prototype.text=void 0;class T extends N{constructor(t,e,n,r){if(super(t,e,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):D(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new T(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new T(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function D(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class E{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new A(t,e);if(null==n.next)return E.empty;let r=$(n);n.next&&n.err("Unexpected trailing text");let i=function(t){let e=Object.create(null);return n(V(t,0));function n(r){let i=[];r.forEach((e=>{t[e].forEach((({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)}))}))}));let o=e[r.join(",")]=new E(r.indexOf(t.length-1)>-1);for(let t=0;tt.to=e))}function o(t,e){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(o(n,e))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(e,s),i(o(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return i(o(t.expr,e),s),i(o(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(e)].concat(o(t.expr,e));if("range"==t.type){let s=e;for(let e=0;et.createAndFill())));for(let t=0;t=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let r=0;r{let r=n+(e.validEnd?"*":" ")+" ";for(let i=0;i"+t.indexOf(e.next[i].next);return r})).join("\n")}}E.empty=new E(!0);class A{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.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(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function $(t){let e=[];do{e.push(I(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function I(t){let e=[];do{e.push(R(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function R(t){let e=function(t){if(t.eat("(")){let e=$(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let t=n[o];t.groups.indexOf(e)>-1&&i.push(t)}0==i.length&&t.err("No node type or group '"+e+"' found");return i}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=P(t,e)}return e}function z(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function P(t,e){let n=z(t),r=n;return t.eat(",")&&(r="}"!=t.next?z(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function B(t,e){return e-t}function V(t,e){let n=[];return function e(r){let i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(let t=0;t-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;er[e]=new t(e,n,i)));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let t in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class W{constructor(t,e,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(t,e,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}(t,e,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class q{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=j(t,r.attrs),this.excluded=null;let i=F(this.attrs);this.instance=i?new l(this,i):null}create(t=null){return!t&&this.instance?this.instance:new l(this,_(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach(((t,i)=>n[t]=new q(t,r++,e,i))),n}removeFromSet(t){for(var e=0;e-1}}class H{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let t in e)n[t]=e[t];n.nodes=t.from(e.nodes),n.marks=t.from(e.marks||{}),this.nodes=J.compile(this.spec.nodes,this),this.marks=q.compile(this.spec.marks,this);let r=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw new RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],n=e.spec.content||"",i=e.spec.marks;if(e.contentMatch=r[n]||(r[n]=E.parse(n,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!e.isInline||!e.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=e}e.markSet="_"==i?null:i?K(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:K(this,n.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(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof J))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new T(n,n.defaultAttrs,t,l.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return N.fromJSON(this,t)}markFromJSON(t){return l.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function K(t,e){let n=[];for(let r=0;r-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class Y{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let n=this.matchedStyles=[];e.forEach((t=>{if(function(t){return null!=t.tag}(t))this.tags.push(t);else if(function(t){return null!=t.style}(t)){let e=/[^=]*/.exec(t.style)[0];n.indexOf(e)<0&&n.push(e),this.styles.push(t)}})),this.normalizeLists=!this.tags.some((e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}parse(t,e={}){let n=new tt(this,e,!1);return n.addAll(t,l.none,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new tt(this,e,!0);return n.addAll(t,l.none,e.from,e.to),c.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;rt.length&&(61!=o.charCodeAt(t.length)||o.slice(t.length+1)!=e))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r{n(t=nt(t)),t.mark||t.ignore||t.clearMark||(t.mark=r)}))}for(let r in t.nodes){let e=t.nodes[r].spec.parseDOM;e&&e.forEach((t=>{n(t=nt(t)),t.node||t.ignore||t.mark||(t.node=r)}))}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Y(t,Y.schemaRules(t)))}}const U={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},G={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Z={ol:!0,ul:!0};function X(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class Q{constructor(t,e,n,r,i,o){this.type=t,this.attrs=e,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=l.none,this.match=i||(4&o?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(r.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=r.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(r.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!U.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class tt{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0;let r,i=e.topNode,o=X(null,e.preserveWhitespace,0)|(n?4:0);r=i?new Q(i.type,i.attrs,l.none,!0,e.topMatch||i.type.contentMatch,o):new Q(n?null:t.schema.topNodeType,null,l.none,!0,null,o),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){3==t.nodeType?this.addTextNode(t,e):1==t.nodeType&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,r=this.top;if(2&r.options||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(1&r.options)n=2&r.options?n.replace(/\r\n?/g,"\n"):n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let e=r.content[r.content.length-1],i=t.previousSibling;(!e||i&&"BR"==i.nodeName||e.isText&&/[ \t\r\n\u000c]$/.test(e.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),e),this.findInText(t)}else this.findInside(t)}addElement(t,e,n){let r,i=t.nodeName.toLowerCase();Z.hasOwnProperty(i)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&Z.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(r=this.parser.matchTag(t,this,n));if(o?o.ignore:G.hasOwnProperty(i))this.findInside(t),this.ignoreFallback(t,e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let n,r=this.top,s=this.needsBlock;if(U.hasOwnProperty(i))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),n=!0,r.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t,e);let l=o&&o.skip?e:this.readStyles(t,e);l&&this.addAll(t,l),n&&this.sync(r),this.needsBlock=s}else{let n=this.readStyles(t,e);n&&this.addElementByRule(t,o,n,!1===o.consuming?r:void 0)}}leafFallback(t,e){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"),e)}ignoreFallback(t,e){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),e)}readStyles(t,e){let n=t.style;if(n&&n.length)for(let r=0;r!r.clearMark(t))):e.concat(this.parser.schema.marks[r.mark].create(r.attrs)),!1!==r.consuming)break;n=r}}return e}addElementByRule(t,e,n,r){let i,o;if(e.node)if(o=this.parser.schema.nodes[e.node],o.isLeaf)this.insertNode(o.create(e.attrs),n)||this.leafFallback(t,n);else{let t=this.enter(o,e.attrs||null,n,e.preserveWhitespace);t&&(i=!0,n=t)}else{let t=this.parser.schema.marks[e.mark];n=n.concat(t.create(e.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,n,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((t=>this.insertNode(t,n)));else{let r=t;"string"==typeof e.contentElement?r=t.querySelector(e.contentElement):"function"==typeof e.contentElement?r=e.contentElement(t):e.contentElement&&(r=e.contentElement),this.findAround(t,r,!0),this.addAll(r,n)}i&&this.sync(s)&&this.open--}addAll(t,e,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,s=null==r?null:t.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o,e);this.findAtPoint(t,i)}findPlace(t,e){let n,r;for(let i=this.open;i>=0;i--){let e=this.nodes[i],o=e.findWrapping(t);if(o&&(!n||n.length>o.length)&&(n=o,r=e,!o.length))break;if(e.solid)break}if(!n)return null;this.sync(r);for(let i=0;i!(o.type?o.type.allowsMarkType(e.type):rt(e.type,t))||(a=e.addToSet(a),!1))),this.nodes.push(new Q(t,e,a,r,null,s)),this.open++,n}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));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(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.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=(t,s)=>{for(;t>=0;t--){let l=e[t];if(""==l){if(t==e.length-1||0==t)continue;for(;s>=i;s--)if(o(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!t||t.name!=l&&-1==t.groups.indexOf(l))return!1;s--}}return!0};return o(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function et(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function nt(t){let e={};for(let n in t)e[n]=t[n];return e}function rt(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=t=>{o.push(t);for(let n=0;n{if(i.length||t.marks.length){let n=0,o=0;for(;n=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&ct(st(n),r(t,e),null,t.attrs)}static renderSpec(t,e,n=null,r){return ct(t,e,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new it(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=ot(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return ot(t.marks)}}function ot(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function st(t){return t.document||window.document}const lt=new WeakMap;function at(t){let e=lt.get(t);return void 0===e&<.set(t,e=function(t){let e=null;function n(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])e||(e=[]),e.push(t);else for(let e=0;e-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s,l=o.indexOf(" ");l>0&&(n=o.slice(0,l),o=o.slice(l+1));let a=n?t.createElementNS(n,o):t.createElement(o),c=e[1],h=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){h=2;for(let t in c)if(null!=c[t]){let e=t.indexOf(" ");e>0?a.setAttributeNS(t.slice(0,e),t.slice(e+1),c[t]):a.setAttribute(t,c[t])}}for(let d=h;dh)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}{let{dom:e,contentDOM:o}=ct(t,i,n,r);if(a.appendChild(e),o){if(s)throw new RangeError("Multiple content holes");s=o}}}return{dom:a,contentDOM:s}}const ht=Math.pow(2,16);function dt(t){return 65535&t}class ut{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class pt{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&pt.empty)return pt.empty}recover(t){let e=0,n=dt(t);if(!this.inverted)for(let r=0;rt)break;let a=this.ranges[s+i],c=this.ranges[s+o],h=l+a;if(t<=h){let i=l+r+((a?t==l?-1:t==h?1:e:e)<0?0:c);if(n)return i;let o=t==(e<0?l:h)?null:s/3+(t-l)*ht,d=t==l?2:t==h?1:4;return(e<0?t!=l:t!=h)&&(d|=8),new ut(i,d,o)}r+=c-a}return n?t+r:new ut(t+r,0,null)}touches(t,e){let n=0,r=dt(e),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;st)break;let l=this.ranges[s+i];if(t<=e+l&&s==3*r)return!0;n+=this.ranges[s+o]-l}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new ft;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;ni&&et.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),r),e.openStart,e.openEnd);return yt.fromReplace(t,this.from,this.to,i)}invert(){return new bt(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new vt(e.pos,n.pos,this.mark)}merge(t){return t instanceof vt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new vt(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new vt(e.from,e.to,t.markFromJSON(e.mark))}}gt.jsonID("addMark",vt);class bt extends gt{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new c(wt(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return yt.fromReplace(t,this.from,this.to,n)}invert(){return new vt(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new bt(e.pos,n.pos,this.mark)}merge(t){return t instanceof bt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new bt(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new bt(e.from,e.to,t.markFromJSON(e.mark))}}gt.jsonID("removeMark",bt);class xt extends gt{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return yt.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return yt.fromReplace(t,this.pos,this.pos+1,new c(r.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;nn.pos?null:new Mt(e.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Mt(e.from,e.to,e.gapFrom,e.gapTo,c.fromJSON(t,e.slice),e.insert,!!e.structure)}}function Ot(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let t=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,i--}}return!1}function Ct(t,e,n,i=n.contentMatch,o=!0){let s=t.doc.nodeAt(e),l=[],a=e+1;for(let h=0;h=0;r--)t.step(l[r])}function Nt(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Tt(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),i=t.$from.index(n),o=t.$to.indexAfter(n);if(no;c--,h--){let t=i.node(c),e=i.index(c);if(t.type.spec.isolating)return!1;let n=t.content.cutByIndex(e,t.childCount),o=r&&r[h+1];o&&(n=n.replaceChild(0,o.type.create(o.attrs)));let s=r&&r[h]||t;if(!t.canReplace(e+1,t.childCount)||!s.type.validContent(n))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function $t(t,e){let n=t.resolve(e),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 It(t,e,n=e,r=c.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Rt(i,o,r)?new kt(e,n,r):new zt(i,o,r).fit()}function Rt(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}gt.jsonID("replaceAround",Mt);class zt{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=r.empty;for(let r=0;r<=t.depth;r++){let e=t.node(r);this.frontier.push({type:e.type,match:e.contentMatchAt(t.indexAfter(r))})}for(let i=t.depth;i>0;i--)this.placed=r.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(t<0?this.$to:n.doc.resolve(t));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 l=new c(i,o,s);return t>-1?new Mt(n.pos,t,this.$to.pos,this.$to.end(),l,e):l.size||n.pos!=this.$to.pos?new kt(n.pos,r.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(let e=1;e<=2;e++)for(let n=1==e?t:this.unplaced.openStart;n>=0;n--){let t,i=null;n?(i=Vt(this.unplaced.content,n-1).firstChild,t=i.content):t=this.unplaced.content;let o=t.firstChild;for(let s=this.depth;s>=0;s--){let t,{type:l,match:a}=this.frontier[s],c=null;if(1==e&&(o?a.matchType(o.type)||(c=a.fillBefore(r.from(o),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:s,parent:i,inject:c};if(2==e&&o&&(t=a.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:s,parent:i,wrap:t};if(i&&a.matchType(i.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Vt(t,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new c(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Vt(t,e);if(r.childCount<=1&&e>0){let i=t.size-e<=e+r.size;this.unplaced=new c(Pt(t,e-1,1),e-1,i?e-1:n)}else this.unplaced=new c(Pt(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:i,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let r=0;r1||0==a||t.content.size)&&(u=e,d.push(Ft(t.mark(p.allowedMarks(t.marks)),1==h?a:0,h==l.childCount?f:-1)))}let m=h==l.childCount;m||(f=-1),this.placed=Bt(this.placed,e,r.from(d)),this.frontier[e].match=u,m&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let r=0,c=l;r1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],i=e=0;n--){let{match:e,type:r}=this.frontier[n],i=_t(t,n,r,e,!0);if(!i||i.childCount)continue t}return{depth:e,fit:o,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Bt(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=Bt(this.placed,this.depth,r.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(r.empty,!0);t.childCount&&(this.placed=Bt(this.placed,this.frontier.length,t))}}function Pt(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Pt(t.firstChild.content,e-1,n)))}function Bt(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Bt(t.lastChild.content,e-1,n)))}function Vt(t,e){for(let n=0;n1&&(i=i.replaceChild(0,Ft(i.firstChild,e-1,1==i.childCount?n-1:0))),e>0&&(i=t.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(r.empty,!0)))),t.copy(i)}function _t(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!function(t,e,n){for(let r=n;ri){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(r.empty,!0))}return t}function jt(t,e){let n=[];for(let r=Math.min(t.depth,e.depth);r>=0;r--){let i=t.start(r);if(ie.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(i==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==i-1)&&n.push(r)}return n}class Jt extends gt{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return yt.fail("No node at attribute step's position");let n=Object.create(null);for(let r in e.attrs)n[r]=e.attrs[r];n[this.attr]=this.value;let i=e.type.create(n,null,e.marks);return yt.fromReplace(t,this.pos,this.pos+1,new c(r.from(i),0,e.isLeaf?0:1))}getMap(){return pt.empty}invert(t){return new Jt(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Jt(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Jt(e.pos,e.attr,e.value)}}gt.jsonID("attr",Jt);class Wt extends gt{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let r in t.attrs)e[r]=t.attrs[r];e[this.attr]=this.value;let n=t.type.create(e,t.content,t.marks);return yt.ok(n)}getMap(){return pt.empty}invert(t){return new Wt(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if("string"!=typeof e.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Wt(e.attr,e.value)}}gt.jsonID("docAttr",Wt);let qt=class extends Error{};qt=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(qt.prototype=Object.create(Error.prototype)).constructor=qt,qt.prototype.name="TransformError";class Ht{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ft}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new qt(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=c.empty){let r=It(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new c(r.from(n),0,0))}delete(t,e){return this.replace(t,e,c.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(Rt(i,o,r))return t.step(new kt(e,n,r));let s=jt(i,t.doc.resolve(n));0==s[s.length-1]&&s.pop();let l=-(i.depth+1);s.unshift(l);for(let c=i.depth,f=i.pos-1;c>0;c--,f--){let t=i.node(c).type.spec;if(t.defining||t.definingAsContext||t.isolating)break;s.indexOf(c)>-1?l=c:i.before(c)==f&&s.splice(1,0,-c)}let a=s.indexOf(l),h=[],d=r.openStart;for(let c=r.content,f=0;;f++){let t=c.firstChild;if(h.push(t),f==r.openStart)break;c=t.content}for(let c=d-1;c>=0;c--){let t=h[c],e=(u=t.type).spec.defining||u.spec.definingForContent;if(e&&!t.sameMarkup(i.node(Math.abs(l)-1)))d=c;else if(e||!t.type.isTextblock)break}var u;for(let f=r.openStart;f>=0;f--){let e=(f+d+1)%(r.openStart+1),l=h[e];if(l)for(let h=0;h=0&&(t.replace(e,n,r),!(t.steps.length>p));c--){let t=s[c];t<0||(e=i.before(t),n=o.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,i){if(!i.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let r=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let t=r.index(i);if(r.node(i).canReplaceWith(t,t,n))return r.before(i+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let t=r.indexAfter(i);if(r.node(i).canReplaceWith(t,t,n))return r.after(i+1);if(t0&&(n||r.node(e-1).canReplace(r.index(e-1),i.indexAfter(e-1))))return t.delete(r.before(e),i.after(e))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:i,$to:o,depth:s}=e,l=i.before(s+1),a=o.after(s+1),h=l,d=a,u=r.empty,p=0;for(let c=s,g=!1;c>n;c--)g||i.index(c)>0?(g=!0,u=r.from(i.node(c).copy(u)),p++):h--;let f=r.empty,m=0;for(let c=s,g=!1;c>n;c--)g||o.after(c+1)=0;l--){if(i.size){let t=n[l].type.contentMatch.matchFragment(i);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.from(n[l].type.create(n[l].attrs,i))}let o=e.start,s=e.end;t.step(new Mt(o,s,o,s,new c(i,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,i=null){return function(t,e,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,((e,n)=>{let l="function"==typeof o?o(e):o;if(e.isTextblock&&!e.hasMarkup(i,l)&&function(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(t.doc,t.mapping.slice(s).map(n),i)){let o=null;if(i.schema.linebreakReplacement){let t="pre"==i.whitespace,e=!!i.contentMatch.matchType(i.schema.linebreakReplacement);t&&!e?o=!1:!t&&e&&(o=!0)}!1===o&&function(t,e,n,r){e.forEach(((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=t.mapping.slice(r).map(n+1+o);t.replaceWith(i,i+1,e.type.schema.text("\n"))}}))}(t,e,n,s),Ct(t,t.mapping.slice(s).map(n,1),i,void 0,null===o);let a=t.mapping.slice(s),h=a.map(n,1),d=a.map(n+e.nodeSize,1);return t.step(new Mt(h,d,h+1,d-1,new c(r.from(i.create(l,null,e.marks)),0,0),1,!0)),!0===o&&function(t,e,n,r){e.forEach(((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let i=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(i,i+1,e.type.schema.linebreakReplacement.create())}}}))}(t,e,n,s),!1}}))}(this,t,e,n,i),this}setNodeMarkup(t,e,n=null,i){return function(t,e,n,i,o){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let l=n.create(i,null,o||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,l);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Mt(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new c(r.from(l),0,0),1,!0))}(this,t,e,n,i),this}setNodeAttribute(t,e,n){return this.step(new Jt(t,e,n)),this}setDocAttribute(t,e){return this.step(new Wt(t,e)),this}addNodeMark(t,e){return this.step(new xt(t,e)),this}removeNodeMark(t,e){if(!(e instanceof l)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new St(t,e)),this}split(t,e=1,n){return function(t,e,n=1,i){let o=t.doc.resolve(e),s=r.empty,l=r.empty;for(let a=o.depth,c=o.depth-n,h=n-1;a>c;a--,h--){s=r.from(o.node(a).copy(s));let t=i&&i[h];l=r.from(t?t.type.create(t.attrs,l):o.node(a).copy(l))}t.step(new kt(e,e,new c(s.append(l),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){return function(t,e,n,r){let i,o,s=[],l=[];t.doc.nodesBetween(e,n,((t,a,c)=>{if(!t.isInline)return;let h=t.marks;if(!r.isInSet(h)&&c.type.allowsMarkType(r.type)){let c=Math.max(a,e),d=Math.min(a+t.nodeSize,n),u=r.addToSet(h);for(let t=0;tt.step(e))),l.forEach((e=>t.step(e)))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,((t,s)=>{if(!t.isInline)return;o++;let l=null;if(r instanceof q){let e,n=t.marks;for(;e=r.isInSet(n);)(l||(l=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(l=[r]):l=t.marks;if(l&&l.length){let r=Math.min(s+t.nodeSize,n);for(let t=0;tt.step(new bt(e.from,e.to,e.style))))}(this,t,e,n),this}clearIncompatible(t,e,n){return Ct(this,t,e,n),this}}const Kt=Object.create(null);class Yt{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new Ut(t.min(e),t.max(e))]}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 t=this.ranges;for(let e=0;e=0;i--){let r=e<0?ie(t.node(0),t.node(i),t.before(i+1),t.index(i),e,n):ie(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,n);if(r)return r}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new ne(t.node(0))}static atStart(t){return ie(t,t,0,0,1)||new ne(t)}static atEnd(t){return ie(t,t,t.content.size,t.childCount,-1)||new ne(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Kt[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in Kt)throw new RangeError("Duplicate use of selection JSON ID "+t);return Kt[t]=e,e.prototype.jsonID=t,e}getBookmark(){return Xt.between(this.$anchor,this.$head).getBookmark()}}Yt.prototype.visible=!0;class Ut{constructor(t,e){this.$from=t,this.$to=e}}let Gt=!1;function Zt(t){Gt||t.parent.inlineContent||(Gt=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Xt extends Yt{constructor(t,e=t){Zt(t),Zt(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return Yt.near(n);let r=t.resolve(e.map(this.anchor));return new Xt(r.parent.inlineContent?r:n,n)}replace(t,e=c.empty){if(super.replace(t,e),e==c.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof Xt&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Qt(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Xt(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if(n&&!r||(n=r>=0?1:-1),!e.parent.inlineContent){let t=Yt.findFrom(e,n,!0)||Yt.findFrom(e,-n,!0);if(!t)return Yt.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(Yt.findFrom(t,-n,!0)||Yt.findFrom(t,n,!0)).$anchor).posnew ne(t)};function ie(t,e,n,r,i,o=!1){if(e.inlineContent)return Xt.create(t,n);for(let s=r-(i>0?0:1);i>0?s=0;s+=i){let r=e.child(s);if(r.isAtom){if(!o&&te.isSelectable(r))return te.create(t,n-(i<0?r.nodeSize:0))}else{let e=ie(t,r,n+i,i<0?r.childCount:0,i,o);if(e)return e}n+=r.nodeSize*i}return null}function oe(t,e,n){let r=t.steps.length-1;if(r{null==i&&(i=r)})),t.setSelection(Yt.near(t.doc.resolve(i),n)))}class se extends Ht{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return l.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||l.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);let i=this.storedMarks;if(!i){let t=this.doc.resolve(e);i=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),this.selection.empty||this.setSelection(Yt.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function le(t,e){return e&&t?t.bind(e):t}class ae{constructor(t,e,n){this.name=t,this.init=le(e.init,n),this.apply=le(e.apply,n)}}const ce=[new ae("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new ae("selection",{init:(t,e)=>t.selection||Yt.atStart(e.doc),apply:t=>t.selection}),new ae("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new ae("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class he{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ce.slice(),e&&e.forEach((t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new ae(t.key,t.spec.state,t))}))}}class de{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;nt.toJSON()))),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],i=r.spec.state;i&&i.toJSON&&(e[n]=i.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let r=new he(t.schema,t.plugins),i=new de(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=N.fromJSON(t.schema,e.doc);else if("selection"==r.name)i.selection=Yt.fromJSON(i.doc,e.selection);else if("storedMarks"==r.name)e.storedMarks&&(i.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],l=s.spec.state;if(s.key==r.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(e,o))return void(i[r.name]=l.fromJSON.call(s,t,e[o],i))}i[r.name]=r.init(t,i)}})),i}}function ue(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):"handleDOMEvents"==r&&(i=ue(i,e,{})),n[r]=i}return n}class pe{constructor(t){this.spec=t,this.props={},t.props&&ue(t.props,this,this.props),this.key=t.key?t.key.key:me("plugin")}getState(t){return t[this.key]}}const fe=Object.create(null);function me(t){return t in fe?t+"$"+ ++fe[t]:(fe[t]=0,t+"$")}class ge{constructor(t="key"){this.key=me(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const ye=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},we=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let ve=null;const be=function(t,e,n){let r=ve||(ve=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},xe=function(t,e,n,r){return n&&(ke(t,e,n,r,-1)||ke(t,e,n,r,1))},Se=/^(img|br|input|textarea|hr)$/i;function ke(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Me(t))){let n=t.parentNode;if(!n||1!=n.nodeType||Oe(t)||Se.test(t.nodeName)||"false"==t.contentEditable)return!1;e=ye(t)+(i<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(i<0?-1:0)]).contentEditable)return!1;e=i<0?Me(t):0}}}function Me(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Oe(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Ce=function(t){return t.focusNode&&xe(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Ne(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const Te="undefined"!=typeof navigator?navigator:null,De="undefined"!=typeof document?document:null,Ee=Te&&Te.userAgent||"",Ae=/Edge\/(\d+)/.exec(Ee),$e=/MSIE \d/.exec(Ee),Ie=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ee),Re=!!($e||Ie||Ae),ze=$e?document.documentMode:Ie?+Ie[1]:Ae?+Ae[1]:0,Pe=!Re&&/gecko\/(\d+)/i.test(Ee);Pe&&(/Firefox\/(\d+)/.exec(Ee)||[0,0])[1];const Be=!Re&&/Chrome\/(\d+)/.exec(Ee),Ve=!!Be,Fe=Be?+Be[1]:0,_e=!Re&&!!Te&&/Apple Computer/.test(Te.vendor),Le=_e&&(/Mobile\/\w+/.test(Ee)||!!Te&&Te.maxTouchPoints>2),je=Le||!!Te&&/Mac/.test(Te.platform),Je=!!Te&&/Win/.test(Te.platform),We=/Android \d/.test(Ee),qe=!!De&&"webkitFontSmoothing"in De.documentElement.style,He=qe?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Ke(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Ye(t,e){return"number"==typeof t?t:t[e]}function Ue(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Ge(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=we(s)){if(1!=s.nodeType)continue;let t=s,n=t==o.body,l=n?Ke(o):Ue(t),a=0,c=0;if(e.topl.bottom-Ye(r,"bottom")&&(c=e.bottom-e.top>l.bottom-l.top?e.top+Ye(i,"top")-l.top:e.bottom-l.bottom+Ye(i,"bottom")),e.leftl.right-Ye(r,"right")&&(a=e.right-l.right+Ye(i,"right")),a||c)if(n)o.defaultView.scrollBy(a,c);else{let n=t.scrollLeft,r=t.scrollTop;c&&(t.scrollTop+=c),a&&(t.scrollLeft+=a);let i=t.scrollLeft-n,o=t.scrollTop-r;e={left:e.left-i,top:e.top-o,right:e.right-i,bottom:e.bottom-o}}if(n||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function Ze(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=we(r));return e}function Xe(t,e){for(let n=0;n=c){a=Math.max(p.bottom,a),c=Math.min(p.top,c);let t=p.left>e.left?p.left-e.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!i&&p.left<=e.left&&p.right>=e.left&&(i=h,o={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(l=d+1)}}return!n&&i&&(n=i,r=o,s=0),n&&3==n.nodeType?function(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(n.left+n.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:t,offset:l}:tn(n,r)}function en(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function nn(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let r;qe&&i&&1==n.nodeType&&1==(r=n.childNodes[i-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=e.top&&i--,n==t.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?s=t.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(s=function(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let e=t.docView.nearestDesc(o,!0);if(!e)return null;if(1==e.dom.nodeType&&(e.node.isBlock&&e.parent||!e.contentDOM)){let t=e.dom.getBoundingClientRect();if(e.node.isBlock&&e.parent&&(!s&&t.left>r.left||t.top>r.top?i=e.posBefore:(!s&&t.right-1?i:t.docView.posFromDOM(e,n,-1)}(t,n,i,e))}null==s&&(s=function(t,e,n){let{node:r,offset:i}=tn(e,n),o=-1;if(1==r.nodeType&&!r.firstChild){let t=r.getBoundingClientRect();o=t.left!=t.right&&n.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}(t,l,e));let a=t.docView.nearestDesc(l,!0);return{pos:s,inside:a?a.posAtStart-a.border:-1}}function on(t){return t.top=0&&i==r.nodeValue.length?(t--,o=1):n<0?t--:e++,cn(sn(be(r,t,e),o),o<0)}{let t=sn(be(r,i,i),n);if(Pe&&i&&/\s/.test(r.nodeValue[i-1])&&i=0)}if(null==o&&i&&(n<0||i==Me(r))){let t=r.childNodes[i-1],e=3==t.nodeType?be(t,Me(t)-(s?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return cn(sn(e,1),!1)}if(null==o&&i=0)}function cn(t,e){if(0==t.width)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function hn(t,e){if(0==t.height)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function dn(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}const un=/[\u0590-\u08ac]/;let pn=null,fn=null,mn=!1;function gn(t,e,n){return pn==e&&fn==n?mn:(pn=e,fn=n,mn="up"==n||"down"==n?function(t,e,n){let r=e.selection,i="up"==n?r.$from:r.$to;return dn(t,e,(()=>{let{node:e}=t.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=t.docView.nearestDesc(e,!0);if(!n)break;if(n.node.isBlock){e=n.contentDOM||n.dom;break}e=n.dom.parentNode}let r=an(t,i.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=be(t,0,t.nodeValue.length).getClientRects()}for(let t=0;ti.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}))}(t,e,n):function(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=t.domSelection();return l?un.test(r.parent.textContent)&&l.modify?dn(t,e,(()=>{let{focusNode:e,focusOffset:i,anchorNode:o,anchorOffset:s}=t.domSelectionRange(),a=l.caretBidiLevel;l.modify("move",n,"character");let c=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:d}=t.domSelectionRange(),u=h&&!c.contains(1==h.nodeType?h:h.parentNode)||e==h&&i==d;try{l.collapse(o,s),e&&(e!=o||i!=s)&&l.extend&&l.extend(e,i)}catch(p){}return null!=a&&(l.caretBidiLevel=a),u})):"left"==n||"backward"==n?o:s:r.pos==r.start()||r.pos==r.end()}(t,e,n))}class yn{constructor(t,e,n,r){this.parent=t,this.children=e,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;eye(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!1;break}if(e.previousSibling)break}if(null==r&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!0;break}if(e.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let n=!0,r=t;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!e||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==t.nodeType?t:t.parentNode):i==t))return o;n=!1}}}getDesc(t){let e=t.pmViewDesc;for(let n=e;n;n=n.parent)if(n==this)return e}posFromDOM(t,e,n){for(let r=t;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(t,e,n)}return-1}descAt(t){for(let e=0,n=0;et||e instanceof Mn){r=t-i;break}i=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,e);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof wn&&i.side>=0;n--);if(e<=0){let t,r=!0;for(;t=n?this.children[n-1]:null,t&&t.dom.parentNode!=this.contentDOM;n--,r=!1);return t&&e&&r&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?ye(t.dom)+1:0}}{let t,r=!0;for(;t=n=i&&e<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(t,e,i);t=o;for(let e=s;e>0;e--){let n=this.children[e-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=ye(n.dom)+1;break}t-=n.size}-1==r&&(r=0)}if(r>-1&&(l>e||s==this.children.length-1)){e=l;for(let t=s+1;tp&&oe){let t=s;s=l,l=t}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(s.node,s.offset),a.removeAllRanges(),a.addRange(n)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let n=0,r=0;r=n:tn){let r=n+i.border,s=o-i.border;if(t>=r&&e<=s)return this.dirty=t==n||e==o?2:1,void(t!=r||e!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(t-r,e-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 t=1;for(let e=this.parent;e;e=e.parent,t++){let n=1==t?2:1;e.dirtyi?i.parent?i.parent.posBeforeChild(i):void 0:r))),!e.type.spec.raw){if(1!=o.nodeType){let t=document.createElement("span");t.appendChild(o),o=t}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(t,[],o,null),this.widget=e,this.widget=e,i=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.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 vn extends yn{constructor(t,e,n,r){super(t,[],e,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class bn extends yn{constructor(t,e,n,r){super(t,[],n,r),this.mark=e}static create(t,e,n,r){let i=r.nodeViews[e.type.name],o=i&&i(e,r,n);return o&&o.dom||(o=it.renderSpec(document,e.type.spec.toDOM(e,n),null,e.attrs)),new bn(t,e,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}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),0!=this.dirty){let t=this.parent;for(;!t.node;)t=t.parent;t.dirty0&&(i=Bn(i,0,t,n));for(let s=0;ss?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),c=a&&a.dom,h=a&&a.contentDOM;if(e.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(e.text);else if(!c){let t=it.renderSpec(document,e.type.spec.toDOM(e),null,e.attrs);({dom:c,contentDOM:h}=t)}h||e.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),e.type.spec.draggable&&(c.draggable=!0));let d=c;return c=$n(c,n,e),a?s=new On(t,e,n,r,c,h||null,d,a,i,o+1):e.isText?new kn(t,e,n,r,c,d,i):new xn(t,e,n,r,c,h||null,d,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>r.empty)}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(t,e,n){return 0==this.dirty&&t.eq(this.node)&&In(e,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let n=this.node.inlineContent,r=e,i=t.composing?this.localCompositionInfo(t,e):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new zn(this,o&&o.node,t);!function(t,e,n,r){let i=e.locals(t),o=0;if(0==i.length){for(let n=0;no;)l.push(i[s++]);let f=o+u.nodeSize;if(u.isText){let t=f;s!t.inline)):l.slice(),e.forChild(o,u),p),o=f}}(this.node,this.innerDeco,((e,i,o)=>{e.spec.marks?a.syncToMarks(e.spec.marks,n,t):e.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?l.none:this.node.child(i).marks,n,t),a.placeWidget(e,t,r)}),((e,o,l,c)=>{let h;a.syncToMarks(e.marks,n,t),a.findNodeMatch(e,o,l,c)||s&&t.state.selection.from>r&&t.state.selection.to-1&&a.updateNodeAt(e,o,l,h,t)||a.updateNextNode(e,o,l,t,c,r)||a.addNode(e,o,l,t,r),r+=e.nodeSize})),a.syncToMarks([],n,t),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(t,o),Cn(this.contentDOM,this.children,t),Le&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))}localCompositionInfo(t,e){let{from:n,to:r}=t.state.selection;if(!(t.state.selection instanceof Xt)||ne+this.node.content.size)return null;let i=t.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let t=i.nodeValue,o=function(t,e,n,r){for(let i=0,o=0;i=n){if(o>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let t=l=0&&t+e.length+l>=n)return l+t;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}(this.node.content,t,n-e,r-e);return o<0?null:{node:i,pos:o,text:t}}return{node:i,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:n,text:r}){if(this.getDesc(e))return;let i=e;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 vn(this,i,e,r);t.input.compositionNodes.push(o),this.children=Bn(this.children,n,n+r.length,t,o)}update(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)}updateInner(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(t){if(In(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=En(this.dom,this.nodeDOM,Dn(this.outerDeco,this.node,e),Dn(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}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 Sn(t,e,n,r,i){$n(r,e,t);let o=new xn(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class kn extends xn{constructor(t,e,n,r,i,o,s){super(t,e,n,r,i,null,o,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0)}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,n){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,n)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,n){let r=this.node.cut(t,e),i=document.createTextNode(r.text);return new kn(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(t){return this.node.text==t}}class Mn extends yn{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class On extends xn{constructor(t,e,n,r,i,o,s,l,a,c){super(t,e,n,r,i,o,s,a,c),this.spec=l}update(t,e,n,r){if(3==this.dirty)return!1;if(this.spec.update){let i=this.spec.update(t,e,n);return i&&this.updateInner(t,e,n,r),i}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,n,r){this.spec.setSelection?this.spec.setSelection(t,e,n):super.setSelection(t,e,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function Cn(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o0;){let l;for(;;)if(r){let t=n.children[r-1];if(!(t instanceof bn)){l=t,r--;break}n=t,r=t.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let n=t;n>1,o=Math.min(i,t.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=bn.create(this.top,t[i],e,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(t,e,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(t,e,n))o=this.top.children.indexOf(i,this.index);else for(let s=this.index,l=Math.min(this.top.children.length,s+5);s=n||h<=e?o.push(a):(cn&&o.push(a.slice(n-c,a.size,r)))}return o}function Vn(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l,a,c=r.resolve(s);if(Ce(n)){for(l=c;i&&!i.node;)i=i.parent;let t=i.node;if(i&&t.isAtom&&te.isSelectable(t)&&i.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,i=e==Me(t);r||i;){if(t==n)return!0;let e=ye(t);if(!(t=t.parentNode))return!1;r=r&&0==e,i=i&&e==Me(t)}}(n.focusNode,n.focusOffset,i.dom))){let t=i.posBefore;a=new te(s==t?c:r.resolve(t))}}else{let e=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(e<0)return null;l=r.resolve(e)}if(!a){a=Kn(t,l,c,"pointer"==e||t.state.selection.head{n.anchorNode==r&&n.anchorOffset==i||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{Fn(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Ln=_e||Ve&&Fe<63;function jn(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=rr(t,e,n)))||Xt.between(e,n,r)}function Yn(t){return!(t.editable&&!t.hasFocus())&&Un(t)}function Un(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(n){return!1}}function Gn(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&Yt.findFrom(o,e)}function Zn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Xn(t,e,n){let r=t.state.selection;if(!(r instanceof Xt)){if(r instanceof te&&r.node.isInline)return Zn(t,new Xt(e>0?r.$to:r.$from));{let n=Gn(t.state,e);return!!n&&Zn(t,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:e<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=t.state.doc.resolve(n.pos+i.nodeSize*(e<0?-1:1));return Zn(t,new Xt(r.$anchor,o))}if(!r.empty)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let n=Gn(t.state,e);return!!(n&&n instanceof te)&&Zn(t,n)}if(!(je&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=e<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=t.docView.descAt(s))&&!n.contentDOM)&&(te.isSelectable(o)?Zn(t,new te(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):!!qe&&Zn(t,new Xt(t.state.doc.resolve(e<0?s:s+o.nodeSize))))}}function Qn(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function tr(t,e){let n=t.pmViewDesc;return n&&0==n.size&&(e<0||t.nextSibling||"BR"!=t.nodeName)}function er(t,e){return e<0?function(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;Pe&&1==n.nodeType&&r0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(tr(t,-1))i=n,o=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(nr(n))break;{let e=n.previousSibling;for(;e&&tr(e,-1);)i=n.parentNode,o=ye(e),e=e.previousSibling;if(e)n=e,r=Qn(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?rr(t,n,r):i&&rr(t,i,o)}(t):function(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=Qn(n);for(;;)if(r{t.state==i&&_n(t)}),50)}function ir(t,e){let n=t.state.doc.resolve(e);if(!Ve&&!Je&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let n=t.coordsAtPos(e-1),i=(n.top+n.bottom)/2;if(i>r.top&&i1)return n.leftr.top&&i1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr"}function or(t,e,n){let r=t.state.selection;if(r instanceof Xt&&!r.empty||n.indexOf("s")>-1)return!1;if(je&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=Gn(t.state,e);if(n&&n instanceof te)return Zn(t,n)}if(!i.parent.inlineContent){let n=e<0?i:o,s=r instanceof ne?Yt.near(n,e):Yt.findFrom(n,e);return!!s&&Zn(t,s)}return!1}function sr(t,e){if(!(t.state.selection instanceof Xt))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=t.state.tr;return e<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),t.dispatch(r),!0}return!1}function lr(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function ar(t,e){let n=e.keyCode,r=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);if(8==n||je&&72==n&&"c"==r)return sr(t,-1)||er(t,-1);if(46==n&&!e.shiftKey||je&&68==n&&"c"==r)return sr(t,1)||er(t,1);if(13==n||27==n)return!0;if(37==n||je&&66==n&&"c"==r){let e=37==n?"ltr"==ir(t,t.state.selection.from)?-1:1:-1;return Xn(t,e,r)||er(t,e)}if(39==n||je&&70==n&&"c"==r){let e=39==n?"ltr"==ir(t,t.state.selection.from)?1:-1:1;return Xn(t,e,r)||er(t,e)}return 38==n||je&&80==n&&"c"==r?or(t,-1,r)||er(t,-1):40==n||je&&78==n&&"c"==r?function(t){if(!_e||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;lr(t,n,"true"),setTimeout((()=>lr(t,n,"false")),20)}return!1}(t)||or(t,1,r)||er(t,1):r==(je?"m":"c")&&(66==n||73==n||89==n||90==n)}function cr(t,e){t.someProp("transformCopied",(n=>{e=n(e,t)}));let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let s=t.someProp("clipboardSerializer")||it.fromSchema(t.state.schema),l=vr(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c,h=a.firstChild,d=0;for(;h&&1==h.nodeType&&(c=yr[h.nodeName.toLowerCase()]);){for(let t=c.length-1;t>=0;t--){let e=l.createElement(c[t]);for(;a.firstChild;)e.appendChild(a.firstChild);a.appendChild(e),d++}h=a.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:a,text:t.someProp("clipboardTextSerializer",(n=>n(e,t)))||e.content.textBetween(0,e.content.size,"\n\n"),slice:e}}function hr(t,e,n,i,o){let s,l,a=o.parent.type.spec.code;if(!n&&!e)return null;let h=e&&(i||a||!n);if(h){if(t.someProp("transformPastedText",(n=>{e=n(e,a||i,t)})),a)return e?new c(r.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):c.empty;let n=t.someProp("clipboardTextParser",(n=>n(e,o,i,t)));if(n)l=n;else{let n=o.marks(),{schema:r}=t.state,i=it.fromSchema(r);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=s.appendChild(document.createElement("p"));t&&e.appendChild(i.serializeNode(r.text(t,n)))}))}}else t.someProp("transformPastedHTML",(e=>{n=e(n,t)})),s=function(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=vr().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t);(n=i&&yr[i[1].toLowerCase()])&&(t=n.map((t=>"<"+t+">")).join("")+t+n.map((t=>"")).reverse().join(""));if(r.innerHTML=t,n)for(let o=0;o0;r--){let t=s.firstChild;for(;t&&1!=t.nodeType;)t=t.nextSibling;if(!t)break;s=t}if(!l){let e=t.someProp("clipboardParser")||t.someProp("domParser")||Y.fromSchema(t.state.schema);l=e.parseSlice(s,{preserveWhitespace:!(!h&&!u),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||dr.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(u)l=function(t,e){if(!t.size)return t;let n,i=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(a){return t}let{content:o,openStart:s,openEnd:l}=t;for(let c=n.length-2;c>=0;c-=2){let t=i.nodes[n[c]];if(!t||t.hasRequiredAttrs())break;o=r.from(t.create(n[c+1],o)),s++,l++}return new c(o,s,l)}(gr(l,+u[1],+u[2]),u[4]);else if(l=c.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i,o=e.node(n).contentMatchAt(e.index(n)),s=[];if(t.forEach((t=>{if(!s)return;let e,n=o.findWrapping(t.type);if(!n)return s=null;if(e=s.length&&i.length&&pr(n,i,t,s[s.length-1],0))s[s.length-1]=e;else{s.length&&(s[s.length-1]=fr(s[s.length-1],i.length));let e=ur(t,n);s.push(e),o=o.matchType(e.type),i=n}})),s)return r.from(s)}return t}(l.content,o),!0),l.openStart||l.openEnd){let t=0,e=0;for(let n=l.content.firstChild;t{l=e(l,t)})),l}const dr=/^(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 ur(t,e,n=0){for(let i=e.length-1;i>=n;i--)t=e[i].create(null,r.from(t));return t}function pr(t,e,n,i,o){if(o1&&(s=0),o=n&&(a=e<0?l.contentMatchAt(0).fillBefore(a,s<=o).append(a):a.append(l.contentMatchAt(l.childCount).fillBefore(r.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,l.copy(a))}function gr(t,e,n){return e{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=e=>Cr(t,e))}))}function Cr(t,e){return t.someProp("handleDOMEvents",(n=>{let r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function Nr(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Tr(t){return{left:t.clientX,top:t.clientY}}function Dr(t,e,n,r,i){if(-1==r)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,(e=>s>o.depth?e(t,n,o.nodeAfter,o.before(s),i,!0):e(t,n,o.node(s),o.before(s),i,!1))))return!0;return!1}function Er(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function Ar(t,e,n,r,i){return Dr(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(n=>n(t,e,r)))||(i?function(t,e){if(-1==e)return!1;let n,r,i=t.state.selection;i instanceof te&&(n=i.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let t=s>o.depth?o.nodeAfter:o.node(s);if(te.isSelectable(t)){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&&(Er(t,te.create(t.state.doc,r)),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&te.isSelectable(r))&&(Er(t,new te(n)),!0)}(t,n))}function $r(t,e,n,r){return Dr(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(n=>n(t,e,r)))}function Ir(t,e,n,r){return Dr(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(n=>n(t,e,r)))||function(t,e,n){if(0!=n.button)return!1;let r=t.state.doc;if(-1==e)return!!r.inlineContent&&(Er(t,Xt.create(r,0,r.content.size)),!0);let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let e=o>i.depth?i.nodeAfter:i.node(o),n=i.before(o);if(e.inlineContent)Er(t,Xt.create(r,n+1,n+1+e.content.size));else{if(!te.isSelectable(e))continue;Er(t,te.create(r,n))}return!0}}(t,n,r)}function Rr(t){return jr(t)}xr.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!Br(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!We||!Ve||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!Le||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||ar(t,n)?n.preventDefault():Mr(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,Ne(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},xr.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},xr.keypress=(t,e)=>{let n=e;if(Br(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||je&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof Xt&&r.$from.sameParent(r.$to))){let e=String.fromCharCode(n.charCode);/[\r\n]/.test(e)||t.someProp("handleTextInput",(n=>n(t,r.$from.pos,r.$to.pos,e)))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const zr=je?"metaKey":"ctrlKey";br.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Rr(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[zr]&&("singleClick"==t.input.lastClick.type?o="doubleClick":"doubleClick"==t.input.lastClick.type&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Tr(n));s&&("singleClick"==o?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Pr(t,s,n,!!r)):("doubleClick"==o?$r:Ir)(t,s.pos,s.inside,n)?n.preventDefault():Mr(t,"pointer"))};class Pr{constructor(t,e,n,r){let i,o;if(this.view=t,this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[zr],this.allowDefault=n.shiftKey,e.inside>-1)i=t.state.doc.nodeAt(e.inside),o=e.inside;else{let n=t.state.doc.resolve(e.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,l=s?t.docView.nearestDesc(s,!0):null;this.target=l&&1==l.dom.nodeType?l.dom:null;let{selection:a}=t.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||a instanceof te&&a.from<=o&&a.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Pe||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()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Mr(t,"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((()=>_n(this.view))),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Tr(t))),this.updateAllowDefault(t),this.allowDefault||!e?Mr(this.view,"pointer"):Ar(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||_e&&this.mightDrag&&!this.mightDrag.node.isAtom||Ve&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(Er(this.view,Yt.near(this.view.state.doc.resolve(e.pos))),t.preventDefault()):Mr(this.view,"pointer")}move(t){this.updateAllowDefault(t),Mr(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function Br(t,e){return!!t.composing||!!(_e&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}br.touchstart=t=>{t.input.lastTouch=Date.now(),Rr(t),Mr(t,"pointer")},br.touchmove=t=>{t.input.lastTouch=Date.now(),Mr(t,"pointer")},br.contextmenu=t=>Rr(t);const Vr=We?5e3:-1;function Fr(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>jr(t)),e))}function _r(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Lr(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=function(t,e){for(;;){if(3==t.nodeType&&e)return t;if(1==t.nodeType&&e>0){if("false"==t.contentEditable)return null;e=Me(t=t.childNodes[e-1])}else{if(!t.parentNode||Oe(t))return null;e=ye(t),t=t.parentNode}}}(e.focusNode,e.focusOffset),r=function(t,e){for(;;){if(3==t.nodeType&&e=0)){if(t.domObserver.forceFlush(),_r(t),e||t.docView&&t.docView.dirty){let e=Vn(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}xr.compositionstart=xr.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Xt&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))))t.markCursor=t.state.storedMarks||n.marks(),jr(t,!0),t.markCursor=null;else if(jr(t),Pe&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,r=e.focusOffset;n&&1==n.nodeType&&0!=r;){let e=r<0?n.lastChild:n.childNodes[r-1];if(!e)break;if(3==e.nodeType){let n=t.domSelection();n&&n.collapse(e,e.nodeValue.length);break}n=e,r=-1}}t.input.composing=!0}Fr(t,Vr)},xr.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then((()=>t.domObserver.flush())),t.input.compositionID++,Fr(t,20))};const Jr=Re&&ze<15||Le&&He<604;function Wr(t,e,n,r,i){let o=hr(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,i,o||c.empty))))return!0;if(!o)return!1;let s=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function qr(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}br.copy=xr.cut=(t,e)=>{let n=e,r=t.state.selection,i="cut"==n.type;if(r.empty)return;let o=Jr?null:n.clipboardData,s=r.content(),{dom:l,text:a}=cr(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):function(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},xr.paste=(t,e)=>{let n=e;if(t.composing&&!We)return;let r=Jr?null:n.clipboardData,i=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&Wr(t,qr(r),r.getData("text/html"),i,n)?n.preventDefault():function(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout((()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Wr(t,r.value,null,i,e):Wr(t,r.textContent,r.innerHTML,i,e)}),50)}(t,n)};class Hr{constructor(t,e,n){this.slice=t,this.move=e,this.node=n}}const Kr=je?"altKey":"ctrlKey";br.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i,o=t.state.selection,s=o.empty?null:t.posAtCoords(Tr(n));if(s&&s.pos>=o.from&&s.pos<=(o instanceof te?o.to-1:o.to));else if(r&&r.mightDrag)i=te.create(t.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&(i=te.create(t.state.doc,e.posBefore))}let l=(i||t.state.selection).content(),{dom:a,text:c,slice:h}=cr(t,l);(!n.dataTransfer.files.length||!Ve||Fe>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Jr?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Jr||n.dataTransfer.setData("text/plain",c),t.dragging=new Hr(h,!n[Kr],i)},br.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},xr.dragover=xr.dragenter=(t,e)=>e.preventDefault(),xr.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Tr(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",(e=>{s=e(s,t)})):s=hr(t,qr(n.dataTransfer),Jr?null:n.dataTransfer.getData("text/html"),!1,o);let l=!(!r||n[Kr]);if(t.someProp("handleDrop",(e=>e(t,n,s||c.empty,l))))return void n.preventDefault();if(!s)return;n.preventDefault();let a=s?function(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o=0;t--){let e=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,n=r.index(t)+(e>0?1:0),s=r.node(t),l=!1;if(1==o)l=s.canReplace(n,n,i);else{let t=s.contentMatchAt(n).findWrapping(i.firstChild.type);l=t&&s.canReplaceWith(n,n,t[0])}if(l)return 0==e?r.pos:e<0?r.before(t+1):r.after(t+1)}return null}(t.state.doc,o.pos,s):o.pos;null==a&&(a=o.pos);let h=t.state.tr;if(l){let{node:t}=r;t?t.replace(h):h.deleteSelection()}let d=h.mapping.map(a),u=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=h.doc;if(u?h.replaceRangeWith(d,d,s.content.firstChild):h.replaceRange(d,d,s),h.doc.eq(p))return;let f=h.doc.resolve(d);if(u&&te.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))h.setSelection(new te(f));else{let e=h.mapping.map(a);h.mapping.maps[h.mapping.maps.length-1].forEach(((t,n,r,i)=>e=i)),h.setSelection(Kn(t,f,h.doc.resolve(e)))}t.focus(),t.dispatch(h.setMeta("uiEvent","drop"))},br.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&_n(t)}),20))},br.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},br.beforeinput=(t,e)=>{if(Ve&&We&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,Ne(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let os in xr)br[os]=xr[os];function Yr(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Ur{constructor(t,e){this.toDOM=t,this.spec=e||ti,this.side=this.spec.side||0}map(t,e,n,r){let{pos:i,deleted:o}=t.mapResult(e.from+r,this.side<0?-1:1);return o?null:new Xr(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Ur&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Yr(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Gr{constructor(t,e){this.attrs=t,this.spec=e||ti}map(t,e,n,r){let i=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,o=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new Xr(i,o,this)}valid(t,e){return e.from=t&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;ot){let s=this.children[o]+1;this.children[o+2].findInner(t-s,e-s,n,r+s,i)}}map(t,e,n){return this==ni||0==t.maps.length?this:this.mapInner(t,e,0,0,n||ti)}mapInner(t,e,n,r,i){let o;for(let s=0;s{let o=i-r-(n-e);for(let s=0;sr+h-t)continue;let i=l[s]+h-t;n>=i?l[s+1]=e<=i?-2:-1:e>=h&&o&&(l[s]+=o,l[s+1]+=o)}t+=o})),h=n.maps[c].map(h,-1)}let a=!1;for(let c=0;c=r.content.size){a=!0;continue}let d=n.map(t[c+1]+o,-1)-i,{index:u,offset:p}=r.content.findIndex(h),f=r.maybeChild(u);if(f&&p==h&&p+f.nodeSize==d){let r=l[c+2].mapInner(n,f,e+1,t[c]+o+1,s);r!=ni?(l[c]=h,l[c+1]=d,l[c+2]=r):(l[c+1]=-2,a=!0)}else a=!0}if(a){let a=function(t,e,n,r,i,o,s){function l(t,e){for(let o=0;o{let s,l=o+n;if(s=oi(e,t,l)){for(r||(r=this.children.slice());io&&e.to=t){this.children[s]==t&&(n=this.children[s+2]);break}let i=t+1,o=i+e.content.size;for(let s=0;si&&t.type instanceof Gr){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;en.map(t,e,ti)));return ri.from(n)}forChild(t,e){if(e.isLeaf)return ei.empty;let n=[];for(let r=0;rt instanceof ei))?t:t.reduce(((t,e)=>t.concat(e instanceof ei?e:e.members)),[]))}}}function ii(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;rn&&o.to{let l=oi(t,e,s+n);if(l){o=!0;let t=li(l,e,n+s+1,r);t!=ni&&i.push(s,s+e.nodeSize,t)}}));let s=ii(o?si(t):t,-n).sort(ai);for(let l=0;l0;)e++;t.splice(e,0,n)}function di(t){let e=[];return t.someProp("decorations",(n=>{let r=n(t.state);r&&r!=ni&&e.push(r)})),t.cursorWrapper&&e.push(ei.create(t.state.doc,[t.cursorWrapper.deco])),ri.from(e)}const ui={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},pi=Re&&ze<=11;class fi{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class mi{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new fi,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver((t=>{for(let e=0;e"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),pi&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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.takeRecords(),this.observer.observe(this.view.dom,ui)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;ethis.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(Yn(this.view)){if(this.suppressingSelectionUpdates)return _n(this.view);if(Re&&ze<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&xe(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e,n=new Set;for(let i=t.focusNode;i;i=we(i))n.add(i);for(let i=t.anchorNode;i;i=we(i))if(n.has(i)){e=i;break}let r=e&&this.view.docView.nearestDesc(e);return r&&r.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.pendingRecords();e.length&&(this.queue=[]);let n=t.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Yn(t)&&!this.ignoreSelectionChange(n),i=-1,o=-1,s=!1,l=[];if(t.editable)for(let c=0;c"BR"==t.nodeName));if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of e){let e=r.parentNode;!e||"LI"!=e.nodeName||n&&vi(t,n)==e||r.remove()}}}let a=null;i<0&&r&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||r)&&(i>-1&&(t.docView.markDirty(i,o),function(t){if(gi.has(t))return;if(gi.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)){if(t.requiresGeckoHackNode=Pe,yi)return;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."),yi=!0}}(t)),this.handleDOMChange(i,o,s,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||_n(t),this.currentSelection.set(n))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(let n=0;nDate.now()-50?t.input.lastSelectionOrigin:null,n=Vn(t,e);if(n&&!t.state.selection.eq(n)){if(Ve&&We&&13===t.input.lastKeyCode&&Date.now()-100e(t,Ne(13,"Enter")))))return;let r=t.state.tr.setSelection(n);"pointer"==e?r.setMeta("pointer",!0):"key"==e&&r.scrollIntoView(),s&&r.setMeta("composition",s),t.dispatch(r)}return}let l=t.state.doc.resolve(e),a=l.sharedDepth(n);e=l.before(a+1),n=t.state.doc.resolve(n).after(a+1);let c,h,d=t.state.selection,u=function(t,e,n){let r,{node:i,fromOffset:o,toOffset:s,from:l,to:a}=t.docView.parseRange(e,n),c=t.domSelectionRange(),h=c.anchorNode;if(h&&t.dom.contains(1==h.nodeType?h:h.parentNode)&&(r=[{node:h,offset:c.anchorOffset}],Ce(c)||r.push({node:c.focusNode,offset:c.focusOffset})),Ve&&8===t.input.lastKeyCode)for(let g=s;g>o;g--){let t=i.childNodes[g-1],e=t.pmViewDesc;if("BR"==t.nodeName&&!e){s=g;break}if(!e||e.size)break}let d=t.state.doc,u=t.someProp("domParser")||Y.fromSchema(t.state.schema),p=d.resolve(l),f=null,m=u.parse(i,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:r,ruleFromNode:bi,context:p});if(r&&null!=r[0].pos){let t=r[0].pos,e=r[1]&&r[1].pos;null==e&&(e=t),f={anchor:t+l,head:e+l}}return{doc:m,sel:f,from:l,to:a}}(t,e,n),p=t.state.doc,f=p.slice(u.from,u.to);8===t.input.lastKeyCode&&Date.now()-100=s?o-r:0;o-=t,o&&o=l?o-r:0;o-=e,o&&oDate.now()-225||We)&&o.some((t=>1==t.nodeType&&!xi.test(t.nodeName)))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",(e=>e(t,Ne(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(!m){if(!(i&&d instanceof Xt&&!d.empty&&d.$head.sameParent(d.$anchor))||t.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let e=ki(t,t.state.doc,u.sel);if(e&&!e.eq(t.state.selection)){let n=t.state.tr.setSelection(e);s&&n.setMeta("composition",s),t.dispatch(n)}}return}m={start:d.from,endA:d.to,endB:d.to}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?m.start=t.state.selection.from:m.endA=t.state.selection.to-2&&t.state.selection.to<=u.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),Re&&ze<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>u.from&&"  "==u.doc.textBetween(m.start-u.from-1,m.start-u.from+1)&&(m.start--,m.endA--,m.endB--);let g,y=u.doc.resolveNoCache(m.start-u.from),w=u.doc.resolveNoCache(m.endB-u.from),v=p.resolve(m.start),b=y.sameParent(w)&&y.parent.inlineContent&&v.end()>=m.endA;if((Le&&t.input.lastIOSEnter>Date.now()-225&&(!b||o.some((t=>"DIV"==t.nodeName||"P"==t.nodeName)))||!b&&y.pose(t,Ne(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>m.start&&function(t,e,n,r,i){if(n-e<=i.pos-r.pos||Mi(r,!0,!1)n||Mi(s,!0,!1)e(t,Ne(8,"Backspace")))))return void(We&&Ve&&t.domObserver.suppressSelectionUpdates());Ve&&We&&m.endB==m.start&&(t.input.lastAndroidDelete=Date.now()),We&&!b&&y.start()!=w.start()&&0==w.parentOffset&&y.depth==w.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==m.endA&&(m.endB-=2,w=u.doc.resolveNoCache(m.endB-u.from),setTimeout((()=>{t.someProp("handleKeyDown",(function(e){return e(t,Ne(13,"Enter"))}))}),20));let x,S,k,M=m.start,O=m.endA;if(b)if(y.pos==w.pos)Re&&ze<=11&&0==y.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((()=>_n(t)),20)),x=t.state.tr.delete(M,O),S=p.resolve(m.start).marksAcross(p.resolve(m.endA));else if(m.endA==m.endB&&(k=function(t,e){let n,i,o,s=t.firstChild.marks,l=e.firstChild.marks,a=s,c=l;for(let r=0;rt.mark(i.addToSet(t.marks));else{if(0!=a.length||1!=c.length)return null;i=c[0],n="remove",o=t=>t.mark(i.removeFromSet(t.marks))}let h=[];for(let r=0;rn(t,M,O,e))))return;x=t.state.tr.insertText(e,M,O)}if(x||(x=t.state.tr.replace(M,O,u.doc.slice(m.start-u.from,m.endB-u.from))),u.sel){let e=ki(t,x.doc,u.sel);e&&!(Ve&&We&&t.composing&&e.empty&&(m.start!=m.endB||t.input.lastAndroidDeletee.content.size?null:Kn(t,e.resolve(n.anchor),e.resolve(n.head))}function Mi(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let e=t.node(r).maybeChild(t.indexAfter(r));for(;e&&!e.isLeaf;)e=e.firstChild,i++}return i}function Oi(t){if(2!=t.length)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class Ci{constructor(t,e){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 kr,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(Ai),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Di(this),Ti(this),this.nodeViews=Ei(this),this.docView=Sn(this.state.doc,Ni(this),di(this),this.dom,this),this.domObserver=new mi(this,((t,e,n,r)=>Si(this,t,e,n,r))),this.domObserver.start(),function(t){for(let e in br){let n=br[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=e=>{!Nr(t,e)||Cr(t,e)||!t.editable&&e.type in xr||n(t,e)},Sr[e]?{passive:!0}:void 0)}_e&&t.dom.addEventListener("input",(()=>null)),Or(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Or(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Ai),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let n in this._props)e[n]=this._props[n];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){var n;let r=this.state,i=!1,o=!1;t.storedMarks&&this.composing&&(_r(this),o=!0),this.state=t;let s=r.plugins!=t.plugins||this._props.plugins!=e.plugins;if(s||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let t=Ei(this);(function(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r})(t,this.nodeViews)&&(this.nodeViews=t,i=!0)}(s||e.handleDOMEvents!=this._props.handleDOMEvents)&&Or(this),this.editable=Di(this),Ti(this);let l=di(this),a=Ni(this),c=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",h=i||!this.docView.matchesNode(t.doc,a,l);!h&&t.selection.eq(r.selection)||(o=!0);let d="preserve"==c&&o&&null==this.dom.style.overflowAnchor&&function(t){let e,n,r=t.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s=i-20){e=r,n=l.top;break}}return{refDOM:e,refTop:n,stack:Ze(t.dom)}}(this);if(o){this.domObserver.stop();let e=h&&(Re||Ve)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&function(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}(r.selection,t.selection);if(h){let n=Ve?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Lr(this)),!i&&this.docView.update(t.doc,a,l,this)||(this.docView.updateOuterDeco(a),this.docView.destroy(),this.docView=Sn(t.doc,a,l,this.dom,this)),n&&!this.trackWrites&&(e=!0)}e||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return xe(e.node,e.offset,n.anchorNode,n.anchorOffset)}(this))?_n(this,e):(qn(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():d&&function({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Xe(n,0==r?0:r-e)}(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(t=>t(this))));else if(this.state.selection instanceof te){let e=this.docView.domAfterPos(this.state.selection.from);1==e.nodeType&&Ge(this,e.getBoundingClientRect(),t)}else Ge(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let e=0;e0&&this.state.doc.nodeAt(t))==n.node&&(r=t)}this.dragging=new Hr(t.slice,t.move,r<0?void 0:te.create(this.state.doc,r))}someProp(t,e){let n,r=this._props&&this._props[t];if(null!=r&&(n=e?e(r):r))return n;for(let o=0;oe.ownerDocument.getSelection()),this._root=e;return t||document}updateRoot(){this._root=null}posAtCoords(t){return rn(this,t)}coordsAtPos(t,e=1){return an(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,n=-1){let r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return gn(this,e||this.state,t)}pasteHTML(t,e){return Wr(this,"",t,!1,e||new ClipboardEvent("paste"))}pasteText(t,e){return Wr(this,t,null,!0,e||new ClipboardEvent("paste"))}destroy(){this.docView&&(!function(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],di(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,ve=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){return function(t,e){Cr(t,e)||!br[e.type]||!t.editable&&e.type in xr||br[e.type](t,e)}(this,t)}dispatch(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){let t=this.domSelection();return t?_e&&11===this.root.nodeType&&function(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom&&function(t,e){if(e.getComposedRanges){let n=e.getComposedRanges(t.root)[0];if(n)return wi(t,n)}let n;function r(t){t.preventDefault(),t.stopImmediatePropagation(),n=t.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?wi(t,n):null}(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Ni(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(t.state)),n)for(let t in n)"class"==t?e.class+=" "+n[t]:"style"==t?e.style=(e.style?e.style+";":"")+n[t]:e[t]||"contenteditable"==t||"nodeName"==t||(e[t]=String(n[t]))})),e.translate||(e.translate="no"),[Xr.node(0,t.state.doc.content.size,e)]}function Ti(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Xr.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Di(t){return!t.someProp("editable",(e=>!1===e(t.state)))}function Ei(t){let e=Object.create(null);function n(t){for(let n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Ai(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var $i={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:"'"},Ii={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ri="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),zi="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Pi=0;Pi<10;Pi++)$i[48+Pi]=$i[96+Pi]=String(Pi);for(Pi=1;Pi<=24;Pi++)$i[Pi+111]="F"+Pi;for(Pi=65;Pi<=90;Pi++)$i[Pi]=String.fromCharCode(Pi+32),Ii[Pi]=String.fromCharCode(Pi);for(var Bi in $i)Ii.hasOwnProperty(Bi)||(Ii[Bi]=$i[Bi]);const Vi="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Fi(t){let e,n,r,i,o=t.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let l=0;l127)&&(r=$i[n.keyCode])&&r!=i){let i=e[_i(r,n)];if(i&&i(t.state,t.dispatch,t))return!0}}return!1}}const Ji=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Wi(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function qi(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Hi(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Tt(i);return null!=o&&(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)};function Yi(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=Yi(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let r=n.after(),i=t.tr.replaceWith(r,r,s.createAndFill());i.setSelection(Yt.near(i.doc.resolve(r),1)),e(i.scrollIntoView())}return!0};const Gi=(t,e)=>{let{$from:n,$to:r}=t.selection;if(t.selection instanceof te&&t.selection.node.isBlock)return!(!n.parentOffset||!At(t.doc,n.pos)||(e&&e(t.tr.split(n.pos).scrollIntoView()),0));if(!n.parent.isBlock)return!1;if(e){let i=r.parentOffset==r.parent.content.size,o=t.tr;(t.selection instanceof Xt||t.selection instanceof ne)&&o.deleteSelection();let s=0==n.depth?null:Yi(n.node(-1).contentMatchAt(n.indexAfter(-1))),l=i&&s?[{type:s}]:void 0,a=At(o.doc,o.mapping.map(n.pos),1,l);if(l||a||!At(o.doc,o.mapping.map(n.pos),1,s?[{type:s}]:void 0)||(s&&(l=[{type:s}]),a=!0),a&&(o.split(o.mapping.map(n.pos),1,l),!i&&!n.parentOffset&&n.parent.type!=s)){let t=o.mapping.map(n.before()),e=o.doc.resolve(t);s&&n.node(-1).canReplaceWith(e.index(),e.index()+1,s)&&o.setNodeMarkup(o.mapping.map(n.before()),s)}e(o.scrollIntoView())}return!0};function Zi(t,e,n,i){let o,s,l=e.nodeBefore,a=e.nodeAfter,h=l.type.spec.isolating||a.type.spec.isolating;if(!h&&function(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(o,o+1)||!i.isTextblock&&!$t(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;let d=!h&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(o=(s=l.contentMatchAt(l.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let i=e.pos+a.nodeSize,s=r.empty;for(let t=o.length-1;t>=0;t--)s=r.from(o[t].create(null,s));s=r.from(l.copy(s));let h=t.tr.step(new Mt(e.pos-1,i,e.pos,i,new c(s,1,0),o.length,!0)),d=i+2*o.length;$t(h.doc,d)&&h.join(d),n(h.scrollIntoView())}return!0}let u=a.type.spec.isolating||i>0&&h?null:Yt.findFrom(e,1),p=u&&u.$from.blockRange(u.$to),f=p&&Tt(p);if(null!=f&&f>=e.depth)return n&&n(t.tr.lift(p,f).scrollIntoView()),!0;if(d&&Wi(a,"start",!0)&&Wi(l,"end")){let i=l,o=[];for(;o.push(i),!i.isTextblock;)i=i.lastChild;let s=a,h=1;for(;!s.isTextblock;s=s.firstChild)h++;if(i.canReplace(i.childCount,i.childCount,s.content)){if(n){let i=r.empty;for(let t=o.length-1;t>=0;t--)i=r.from(o[t].copy(i));n(t.tr.step(new Mt(e.pos-o.length,e.pos+a.nodeSize,e.pos+h,e.pos+a.nodeSize-h,new c(i,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Xi(t){return function(e,n){let r=e.selection,i=t<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(e.tr.setSelection(Xt.create(e.doc,t<0?i.start(o):i.end(o)))),!0)}}const Qi=Xi(-1),to=Xi(1);function eo(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&Dt(s,t,e);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}}function no(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)i=!0;else{let e=n.doc.resolve(o),r=e.index();i=e.parent.canReplaceWith(r,r+1,t)}}))}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r{if(l||!r&&t.isAtom&&t.isInline&&e>=o.pos&&e+t.nodeSize<=s.pos)return!1;l=t.inlineContent&&t.type.allowsMarkType(n)})),l)return!0}return!1}(n.doc,a,t,i))return!1;if(o)if(l)t.isInSet(n.storedMarks||l.marks())?o(n.tr.removeStoredMark(t)):o(n.tr.addStoredMark(t.create(e)));else{let s,l=n.tr;i||(a=function(t){let e=[];for(let n=0;n{if(t.isAtom&&t.content.size&&t.isInline&&n>=r.pos&&n+t.nodeSize<=i.pos)return n+1>r.pos&&e.push(new Ut(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+t.content.size),!1})),r.posn.doc.rangeHasMark(e.$from.pos,e.$to.pos,t))):!a.every((e=>{let n=!1;return l.doc.nodesBetween(e.$from.pos,e.$to.pos,((r,i,o)=>{if(n)return!1;n=!t.isInSet(r.marks)&&!!o&&o.type.allowsMarkType(t)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,e.$from.pos-i),Math.min(r.nodeSize,e.$to.pos-i))))})),!n}));for(let n=0;n{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}(t,n);if(!r)return!1;let i=qi(r);if(!i){let n=r.blockRange(),i=n&&Tt(n);return null!=i&&(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(Zi(t,i,e,-1))return!0;if(0==r.parent.content.size&&(Wi(o,"end")||te.isSelectable(o)))for(let s=r.depth;;s--){let n=It(t.doc,r.before(s),r.after(s),c.empty);if(n&&n.slice.size1)break}return!(!o.isAtom||i.depth!=r.depth-1)&&(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)}),((t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=qi(r)}let s=o&&o.nodeBefore;return!(!s||!te.isSelectable(s))&&(e&&e(t.tr.setSelection(te.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)})),so=io(Ji,((t,e,n)=>{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}),((t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof ne||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Yi(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let n=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(At(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Tt(r);return null!=i&&(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)}),Gi),"Mod-Enter":Ui,Backspace:oo,"Mod-Backspace":oo,"Shift-Backspace":oo,Delete:so,"Mod-Delete":so,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new ne(t.doc))),!0)},ao={"Ctrl-h":lo.Backspace,"Alt-Backspace":lo["Mod-Backspace"],"Ctrl-d":lo.Delete,"Ctrl-Alt-Backspace":lo["Mod-Delete"],"Alt-Delete":lo["Mod-Delete"],"Alt-d":lo["Mod-Delete"],"Ctrl-a":Qi,"Ctrl-e":to};for(let os in lo)ao[os]=lo[os];const co=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?ao:lo;class ho{constructor(t,e,n={}){var r;this.match=t,this.match=t,this.handler="string"==typeof e?(r=e,function(t,e,n,i){let o=r;if(e[1]){let t=e[0].lastIndexOf(e[1]);o+=e[0].slice(t+e[1].length);let r=(n+=t)-i;r>0&&(o=e[0].slice(t-r,t)+o,n=i)}return t.tr.insertText(o,n,i)}):e,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1}}const uo=500;function po({rules:t}){let e=new pe({state:{init:()=>null,apply(t,e){let n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:(n,r,i,o)=>fo(n,r,i,o,t,e),handleDOMEvents:{compositionend:n=>{setTimeout((()=>{let{$cursor:r}=n.state.selection;r&&fo(n,r.pos,r.pos,"",t,e)}))}}},isInputRules:!0});return e}function fo(t,e,n,r,i,o){if(t.composing)return!1;let s=t.state,l=s.doc.resolve(e),a=l.parent.textBetween(Math.max(0,l.parentOffset-uo),l.parentOffset,null,"")+r;for(let c=0;c{let n=t.plugins;for(let r=0;r=0;t--)n.step(r.steps[t].invert(r.docs[t]));if(i.text){let e=n.doc.resolve(i.from).marks();n.replaceWith(i.from,i.to,t.schema.text(i.text,e))}else n.delete(i.from,i.to);e(n)}return!0}}return!1};function go(t,e,n=null,r){return new ho(t,((t,i,o,s)=>{let l=n instanceof Function?n(i):n,a=t.tr.delete(o,s),c=a.doc.resolve(o).blockRange(),h=c&&Dt(c,e,l);if(!h)return null;a.wrap(c,h);let d=a.doc.resolve(o-1).nodeBefore;return d&&d.type==e&&$t(a.doc,o-1)&&(!r||r(i,d))&&a.join(o-1),a}))}function yo(t,e,n=null){return new ho(t,((t,r,i,o)=>{let s=t.doc.resolve(i),l=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e)?t.tr.delete(i,o).setBlockType(i,i,e,l):null}))}new ho(/--$/,"—"),new ho(/\.\.\.$/,"…"),new ho(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new ho(/"$/,"”"),new ho(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new ho(/'$/,"’");const wo=["ol",0],vo=["ul",0],bo=["li",0],xo={attrs:{order:{default:1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1==t.attrs.order?wo:["ol",{start:t.attrs.order},0]},So={parseDOM:[{tag:"ul"}],toDOM:()=>vo},ko={parseDOM:[{tag:"li"}],toDOM:()=>bo,defining:!0};function Mo(t,e){let n={};for(let r in t)n[r]=t[r];for(let r in e)n[r]=e[r];return n}function Oo(t,e,n){return t.append({ordered_list:Mo(xo,{content:"list_item+",group:n}),bullet_list:Mo(So,{content:"list_item+",group:n}),list_item:Mo(ko,{content:e})})}function Co(t,e=null){return function(n,i){let{$from:o,$to:s}=n.selection,l=o.blockRange(s),a=!1,h=l;if(!l)return!1;if(l.depth>=2&&o.node(l.depth-1).type.compatibleContent(t)&&0==l.startIndex){if(0==o.index(l.depth-1))return!1;let t=n.doc.resolve(l.start-2);h=new O(t,t,l.depth),l.endIndex=0;c--)s=r.from(n[c].type.create(n[c].attrs,s));t.step(new Mt(e.start-(i?2:0),e.end,e.start,e.end,new c(s,0,0),n.length,!0));let l=0;for(let r=0;r=o.depth-3;t--)e=r.from(o.node(t).copy(e));let l=o.indexAfter(-1){if(d>-1)return!1;t.isTextblock&&0==t.content.size&&(d=e+1)})),d>-1&&h.setSelection(Yt.near(h.doc.resolve(d))),i(h.scrollIntoView())}return!0}let h=s.pos==o.end()?a.contentMatchAt(0).defaultType:null,d=n.tr.delete(o.pos,s.pos),u=h?[e?{type:t,attrs:e}:null,{type:h}]:void 0;return!!At(d.doc,o.pos,2,u)&&(i&&i(d.split(o.pos,2,u).scrollIntoView()),!0)}}function To(t){return function(e,n){let{$from:i,$to:o}=e.selection,s=i.blockRange(o,(e=>e.childCount>0&&e.firstChild.type==t));return!!s&&(!n||(i.node(s.depth-1).type==t?function(t,e,n,i){let o=t.tr,s=i.end,l=i.$to.end(i.depth);sm;c--)r-=o.child(c).nodeSize,i.delete(r-1,r+1);let s=i.doc.resolve(n.start),l=s.nodeAfter;if(i.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,h=n.endIndex==o.childCount,d=s.node(-1),u=s.index(-1);if(!d.canReplace(u+(a?0:1),u+1,l.content.append(h?r.empty:r.from(o))))return!1;let p=s.pos,f=p+l.nodeSize;return i.step(new Mt(p-(a?1:0),f+(h?1:0),p+1,f-1,new c((a?r.empty:r.from(o.copy(r.empty))).append(h?r.empty:r.from(o.copy(r.empty))),a?0:1,h?0:1),a?0:1)),e(i.scrollIntoView()),!0}(e,n,s)))}}function Do(t){return function(e,n){let{$from:i,$to:o}=e.selection,s=i.blockRange(o,(e=>e.childCount>0&&e.firstChild.type==t));if(!s)return!1;let l=s.startIndex;if(0==l)return!1;let a=s.parent,h=a.child(l-1);if(h.type!=t)return!1;if(n){let i=h.lastChild&&h.lastChild.type==a.type,o=r.from(i?t.create():null),l=new c(r.from(t.create(null,r.from(a.type.create(null,o)))),i?3:1,0),d=s.start,u=s.end;n(e.tr.step(new Mt(d-(i?3:1),u,d,u,l,1,!0)).scrollIntoView())}return!0}}var Eo=200,Ao=function(){};Ao.prototype.append=function(t){return t.length?(t=Ao.from(t),!this.length&&t||t.length=e?Ao.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Ao.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Ao.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Ao.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},Ao.from=function(t){return t instanceof Ao?t:t&&t.length?new $o(t):Ao.empty};var $o=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var i=e;i=n;i--)if(!1===t(this.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=Eo)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=Eo)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Ao);Ao.empty=new $o([]);var Io=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return ti&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var i=this.left.length;return!(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,r+i))&&(!(n=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Ao);class Ro{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}e&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,l=t.tr,a=[],c=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(i,e+1),r=n.maps.length),r--,void c.push(t);if(n){c.push(new zo(t.map));let e,i=t.step.map(n.slice(r));i&&l.maybeStep(i).doc&&(e=l.mapping.maps[l.mapping.maps.length-1],a.push(new zo(e,void 0,void 0,a.length+c.length))),r--,e&&n.appendMap(e,r)}else l.maybeStep(t.step);return t.selection?(o=n?t.selection.map(n.slice(r)):t.selection,s=new Ro(this.items.slice(0,i).append(c.reverse().concat(a)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:o}}addTransform(t,e,n,r){let i=[],o=this.eventCount,s=this.items,l=!r&&s.length?s.get(s.length-1):null;for(let c=0;cBo&&(s=function(t,e){let n;return t.forEach(((t,r)=>{if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,a),o-=a),new Ro(s.append(i),o)}remapping(t,e){let n=new ft;return this.items.forEach(((e,r)=>{let i=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new Ro(this.items.append(t.map((t=>new zo(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),i=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),r);let l=e;this.items.forEach((e=>{let r=i.getMirror(--l);if(null==r)return;o=Math.min(o,r);let a=i.maps[r];if(e.step){let o=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(i.slice(l+1,r));c&&s++,n.push(new zo(a,o,c))}else n.push(new zo(a))}),r);let a=[];for(let d=e;d500&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=t)r.push(o),o.selection&&i++;else if(o.step){let t=o.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let l=o.selection&&o.selection.map(e.slice(n));l&&i++;let a,c=new zo(s.invert(),t,l),h=r.length-1;(a=r.length&&r[h].merge(c))?r[h]=a:r.push(c)}}else o.map&&n--}),this.items.length,0),new Ro(Ao.from(r.reverse()),i)}}Ro.empty=new Ro(Ao.empty,0);class zo{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new zo(e.getMap().invert(),e,this.selection)}}}class Po{constructor(t,e,n,r,i){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}const Bo=20;function Vo(t){let e=[];for(let n=t.length-1;n>=0&&0==e.length;n--)t[n].forEach(((t,n,r,i)=>e.push(r,i)));return e}function Fo(t,e){if(!t)return null;let n=[];for(let r=0;rnew Po(Ro.empty,Ro.empty,null,0,-1),apply:(e,n,r)=>function(t,e,n,r){let i,o=n.getMeta(Jo);if(o)return o.historyState;n.getMeta(Wo)&&(t=new Po(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(Jo))return s.getMeta(Jo).redo?new Po(t.done.addTransform(n,void 0,r,jo(e)),t.undone,Vo(n.mapping.maps),t.prevTime,t.prevComposition):new Po(t.done,t.undone.addTransform(n,void 0,r,jo(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new Po(t.done.rebased(n,i),t.undone.rebased(n,i),Fo(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Po(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Fo(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);{let i=n.getMeta("composition"),o=0==t.prevTime||!s&&t.prevComposition!=i&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach(((t,r)=>{for(let i=0;i=e[i]&&(n=!0)})),n}(n,t.prevRanges)),l=s?Fo(t.prevRanges,n.mapping):Vo(n.mapping.maps);return new Po(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,jo(e)),Ro.empty,l,n.time,null==i?t.prevComposition:i)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?Ko:"historyRedo"==n?Yo:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}function Ho(t,e){return(n,r)=>{let i=Jo.getState(n);if(!i||0==(t?i.undone:i.done).eventCount)return!1;if(r){let o=function(t,e,n){let r=jo(e),i=Jo.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),a=new Po(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(Jo,{redo:n,historyState:a})}(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Ko=Ho(!1,!0),Yo=Ho(!0,!0);function Uo(t){let e=Jo.getState(t);return e?e.done.eventCount:0}function Go(t){let e=Jo.getState(t);return e?e.undone.eventCount:0} +function e(e){this.content=e}function t(e,n,r){for(let i=0;;i++){if(i==e.childCount||i==n.childCount)return e.childCount==n.childCount?null:r;let o=e.child(i),s=n.child(i);if(o!=s){if(!o.sameMarkup(s))return r;if(o.isText&&o.text!=s.text){for(let e=0;o.text[e]==s.text[e];e++)r++;return r}if(o.content.size||s.content.size){let e=t(o.content,s.content,r+1);if(null!=e)return e}r+=o.nodeSize}else r+=o.nodeSize}}function n(e,t,r,i){for(let o=e.childCount,s=t.childCount;;){if(0==o||0==s)return o==s?null:{a:r,b:i};let l=e.child(--o),a=t.child(--s),h=l.nodeSize;if(l!=a){if(!l.sameMarkup(a))return{a:r,b:i};if(l.isText&&l.text!=a.text){let e=0,t=Math.min(l.text.length,a.text.length);for(;e>1}},e.from=function(t){if(t instanceof e)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new e(n)};class r{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let n=0;ne&&!1!==n(l,r+s,i||null,o)&&l.content.size){let i=s+1;l.nodesBetween(Math.max(0,e-i),Math.min(l.content.size,t-i),n,r+i)}s=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,l)=>{let a=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&a||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=a}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),o=1);oe)for(let r=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),i+=s.nodeSize),o=l}return new r(n,i)}cutByIndex(e,t){return e==t?r.empty:0==e&&t==this.content.length?this:new r(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new r(i,o)}addToStart(e){return new r([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new r(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?o(n+1,i):o(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 r.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new r(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return r.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}}l.none=[];class a extends Error{}class h{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=d(this.content,e+this.openStart,t);return n&&new h(n,this.openStart,this.openEnd)}removeBetween(e,t){return new h(c(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 h.empty;let n=t.openStart||0,i=t.openEnd||0;if("number"!=typeof n||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new h(r.fromJSON(e,t.content),n,i)}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 h(e,n,r)}}function c(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:l}=e.findIndex(n);if(i==t||o.isText){if(l!=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(c(o.content,t-i-1,n-i-1)))}function d(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return e.cut(0,t).append(n).append(e.cut(t));let l=d(s.content,t-o-1,n);return l&&e.replaceChild(i,s.copy(l))}function p(e,t,n){if(n.openStart>e.depth)throw new a("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new a("Inconsistent open depths");return u(e,t,n,0)}function u(e,t,n,i){let o=e.index(i),s=e.node(i);if(o==t.index(i)&&i=0;o--)i=t.node(o).copy(r.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}(n,e);return w(s,v(e,o,l,t,i))}{let r=e.parent,i=r.content;return w(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return w(s,x(e,t,i))}function f(e,t){if(!t.type.compatibleContent(e.type))throw new a("Cannot join "+t.type.name+" onto "+e.type.name)}function m(e,t,n){let r=e.node(n);return f(r,t.node(n)),r}function g(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 y(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&&(g(e.nodeAfter,r),o++));for(let l=o;lo&&m(e,t,o+1),l=i.depth>o&&m(n,i,o+1),a=[];return y(null,e,o,a),s&&l&&t.index(o)==n.index(o)?(f(s,l),g(w(s,v(e,t,n,i,o+1)),a)):(s&&g(w(s,x(e,t,o+1)),a),y(t,n,o,a),l&&g(w(l,x(n,i,o+1)),a)),y(i,null,o,a),new r(a)}function x(e,t,n){let i=[];if(y(null,e,n,i),e.depth>n){g(w(m(e,t,n+1),x(e,t,n+1)),i)}return y(t,null,n,i),new r(i)}h.empty=new h(r.empty,0,0);class b{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 C(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 b(t,n,i)}static resolveCached(e,t){let n=M.get(e);if(n)for(let i=0;ie&&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()+")"),D(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=r.empty,i=0,o=n.childCount){let s=this.contentMatchAt(e).matchFragment(n,i,o),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let r=i;re.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;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 i=r.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,n);return o.type.checkAttrs(o.attrs),o}}N.prototype.text=void 0;class T extends N{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):D(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 T(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new T(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 D(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class A{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new E(e,t);if(null==n.next)return A.empty;let r=$(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return n(V(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 A(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")}}A.empty=new A(!0);class E{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 $(e){let t=[];do{t.push(I(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function I(e){let t=[];do{t.push(R(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function R(e){let t=function(e){if(e.eat("(")){let t=$(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.isInGroup(t)&&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=P(e,t)}return t}function z(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function P(e,t){let n=z(e),r=n;return e.eat(",")&&(r="}"!=e.next?z(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function B(e,t){return t-e}function V(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}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:L(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new N(this,this.computeAttrs(e),r.from(t),l.setFrom(n))}createChecked(e=null,t,n){return t=r.from(t),this.checkContent(t),new N(this,this.computeAttrs(e),t,l.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=r.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(r.empty,!0);return o?new N(this,e,t.append(o),l.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;tr[t]=new e(t,n,i)));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let e in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class j{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class _{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=W(e,r.attrs),this.excluded=null;let i=F(this.attrs);this.instance=i?new l(this,i):null}create(e=null){return!e&&this.instance?this.instance:new l(this,L(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new _(e,r++,t,i))),n}removeFromSet(e){for(var t=0;t-1}}class K{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let e in t)n[e]=t[e];n.nodes=e.from(t.nodes),n.marks=e.from(t.marks||{}),this.nodes=q.compile(this.spec.nodes,this),this.marks=_.compile(this.spec.marks,this);let r=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],n=t.spec.content||"",i=t.spec.marks;if(t.contentMatch=r[n]||(r[n]=A.parse(n,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==i?null:i?H(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:H(this,n.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 q))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 T(n,n.defaultAttrs,e,l.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return N.fromJSON(this,e)}markFromJSON(e){return l.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function H(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 Y{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach((e=>{if(function(e){return null!=e.tag}(e))this.tags.push(e);else if(function(e){return null!=e.style}(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),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 ee(this,t,!1);return n.addAll(e,l.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new ee(this,t,!0);return n.addAll(e,l.none,t.from,t.to),h.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=ne(e)),e.mark||e.ignore||e.clearMark||(e.mark=r)}))}for(let r in e.nodes){let t=e.nodes[r].spec.parseDOM;t&&t.forEach((e=>{n(e=ne(e)),e.node||e.ignore||e.mark||(e.node=r)}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Y(e,Y.schemaRules(e)))}}const U={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},G={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Z={ol:!0,ul:!0};function X(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class Q{constructor(e,t,n,r,i,o){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=l.none,this.match=i||(4&o?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(r.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=r.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(r.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!U.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class ee{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,i=t.topNode,o=X(null,t.preserveWhitespace,0)|(n?4:0);r=i?new Q(i.type,i.attrs,l.none,!0,t.topMatch||i.type.contentMatch,o):new Q(n?null:e.schema.topNodeType,null,l.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top;if(2&r.options||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(1&r.options)n=2&r.options?n.replace(/\r\n?/g,"\n"):n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&"BR"==i.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r,i=e.nodeName.toLowerCase();Z.hasOwnProperty(i)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&Z.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(r=this.parser.matchTag(e,this,n));if(o?o.ignore:G.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let n,r=this.top,s=this.needsBlock;if(U.hasOwnProperty(i))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),n=!0,r.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e,t);let l=o&&o.skip?t:this.readStyles(e,t);l&&this.addAll(e,l),n&&this.sync(r),this.needsBlock=s}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,o,n,!1===o.consuming?r:void 0)}}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let r=0;r!r.clearMark(e))):t.concat(this.parser.schema.marks[r.mark].create(r.attrs)),!1!==r.consuming)break;n=r}}return t}addElementByRule(e,t,n,r){let i,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n)||this.leafFallback(e,n);else{let e=this.enter(o,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e,n)));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(s)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t){let n,r;for(let i=this.open;i>=0;i--){let t=this.nodes[i],o=t.findWrapping(e);if(o&&(!n||n.length>o.length)&&(n=o,r=t,!o.length))break;if(t.solid)break}if(!n)return null;this.sync(r);for(let i=0;i!(o.type?o.type.allowsMarkType(t.type):re(t.type,e))||(a=t.addToSet(a),!1))),this.nodes.push(new Q(e,t,a,r,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.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 l=t[e];if(""==l){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!=l&&!e.isInGroup(l))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}}}function te(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ne(e){let t={};for(let n in e)t[n]=e[n];return t}function re(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&&he(se(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return he(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ie(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=oe(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return oe(e.marks)}}function oe(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function se(e){return e.document||window.document}const le=new WeakMap;function ae(e){let t=le.get(e);return void 0===t&&le.set(e,t=function(e){let t=null;function n(e){if(e&&"object"==typeof e)if(Array.isArray(e))if("string"==typeof e[0])t||(t=[]),t.push(e);else for(let t=0;t-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s,l=o.indexOf(" ");l>0&&(n=o.slice(0,l),o=o.slice(l+1));let a=n?e.createElementNS(n,o):e.createElement(o),h=t[1],c=1;if(h&&"object"==typeof h&&null==h.nodeType&&!Array.isArray(h)){c=2;for(let e in h)if(null!=h[e]){let t=e.indexOf(" ");t>0?a.setAttributeNS(e.slice(0,t),e.slice(t+1),h[e]):a.setAttribute(e,h[e])}}for(let d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}{let{dom:t,contentDOM:o}=he(e,i,n,r);if(a.appendChild(t),o){if(s)throw new RangeError("Multiple content holes");s=o}}}return{dom:a,contentDOM:s}}const ce=Math.pow(2,16);function de(e){return 65535&e}class pe{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class ue{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&ue.empty)return ue.empty}recover(e){let t=0,n=de(e);if(!this.inverted)for(let r=0;re)break;let a=this.ranges[s+i],h=this.ranges[s+o],c=l+a;if(e<=c){let i=l+r+((a?e==l?-1:e==c?1:t:t)<0?0:h);if(n)return i;let o=e==(t<0?l:c)?null:s/3+(e-l)*ce,d=e==l?2:e==c?1:4;return(t<0?e!=l:e!=c)&&(d|=8),new pe(i,d,o)}r+=h-a}return n?e+r:new pe(e+r,0,null)}touches(e,t){let n=0,r=de(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;se)break;let l=this.ranges[s+i];if(e<=t+l&&s==3*r)return!0;n+=this.ranges[s+o]-l}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 fe;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 ye.fromReplace(e,this.from,this.to,i)}invert(){return new xe(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 ve(t.pos,n.pos,this.mark)}merge(e){return e instanceof ve&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ve(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 ve(t.from,t.to,e.markFromJSON(t.mark))}}ge.jsonID("addMark",ve);class xe extends ge{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 h(we(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return ye.fromReplace(e,this.from,this.to,n)}invert(){return new ve(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 xe(t.pos,n.pos,this.mark)}merge(e){return e instanceof xe&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new xe(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 xe(t.from,t.to,e.markFromJSON(t.mark))}}ge.jsonID("removeMark",xe);class be extends ge{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ye.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return ye.fromReplace(e,this.pos,this.pos+1,new h(r.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;nn.pos?null:new Me(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 Me(t.from,t.to,t.gapFrom,t.gapTo,h.fromJSON(e,t.slice),t.insert,!!t.structure)}}function Ce(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 Oe(e,t,n,i=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),l=[],a=t+1;for(let c=0;c=0;r--)e.step(l[r])}function Ne(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Te(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(n{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let i=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}}))}function $e(e,t,n,r){t.forEach(((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+o);e.replaceWith(i,i+1,t.type.schema.text("\n"))}}))}function Ie(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let h=i.depth-1,c=n-2;h>o;h--,c--){let e=i.node(h),t=i.index(h);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount),o=r&&r[c+1];o&&(n=n.replaceChild(0,o.type.create(o.attrs)));let s=r&&r[c]||e;if(!e.canReplace(t+1,e.childCount)||!s.type.validContent(n))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function Re(e,t){let n=e.resolve(t),r=n.index();return i=n.nodeBefore,o=n.nodeAfter,!(!i||!o||i.isLeaf||!function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i0;i--)this.placed=r.from(e.node(i).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 l=new h(i,o,s);return e>-1?new Me(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new ke(n.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,i=null;n?(i=Le(this.unplaced.content,n-1).firstChild,e=i.content):e=this.unplaced.content;let o=e.firstChild;for(let s=this.depth;s>=0;s--){let e,{type:l,match:a}=this.frontier[s],h=null;if(1==t&&(o?a.matchType(o.type)||(h=a.fillBefore(r.from(o),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:s,parent:i,inject:h};if(2==t&&o&&(e=a.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:s,parent:i,wrap:e};if(i&&a.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Le(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new h(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=Le(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new h(Ve(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new h(Ve(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let r=0;r1||0==a||e.content.size)&&(p=t,d.push(Je(e.mark(u.allowedMarks(e.marks)),1==c?a:0,c==l.childCount?f:-1)))}let m=c==l.childCount;m||(f=-1),this.placed=Fe(this.placed,t,r.from(d)),this.frontier[t].match=p,m&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let r=0,h=l;r1&&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=We(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=Fe(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 i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Fe(this.placed,this.depth,r.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(r.empty,!0);e.childCount&&(this.placed=Fe(this.placed,this.frontier.length,e))}}function Ve(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Ve(e.firstChild.content,t-1,n)))}function Fe(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Fe(e.lastChild.content,t-1,n)))}function Le(e,t){for(let n=0;n1&&(i=i.replaceChild(0,Je(i.firstChild,t-1,1==i.childCount?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(r.empty,!0)))),e.copy(i)}function We(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 l=r.fillBefore(o.content,!0,s);return l&&!function(e,t,n){for(let r=n;ri){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(r.empty,!0))}return e}function je(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}class _e extends ge{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return ye.fail("No node at attribute step's position");let n=Object.create(null);for(let r in t.attrs)n[r]=t.attrs[r];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return ye.fromReplace(e,this.pos,this.pos+1,new h(r.from(i),0,t.isLeaf?0:1))}getMap(){return ue.empty}invert(e){return new _e(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new _e(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new _e(t.pos,t.attr,t.value)}}ge.jsonID("attr",_e);class Ke extends ge{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return ye.ok(n)}getMap(){return ue.empty}invert(e){return new Ke(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ke(t.attr,t.value)}}ge.jsonID("docAttr",Ke);let He=class extends Error{};He=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(He.prototype=Object.create(Error.prototype)).constructor=He,He.prototype.name="TransformError";class Ye{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new fe}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new He(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=h.empty){let r=ze(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new h(r.from(n),0,0))}delete(e,t){return this.replace(e,t,h.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(Pe(i,o,r))return e.step(new ke(t,n,r));let s=je(i,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let l=-(i.depth+1);s.unshift(l);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?l=h:i.before(h)==f&&s.splice(1,0,-h)}let a=s.indexOf(l),c=[],d=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=d-1;h>=0;h--){let e=c[h],t=(p=e.type).spec.defining||p.spec.definingForContent;if(t&&!e.sameMarkup(i.node(Math.abs(l)-1)))d=h;else if(t||!e.type.isTextblock)break}var p;for(let f=r.openStart;f>=0;f--){let t=(f+d+1)%(r.openStart+1),l=c[t];if(l)for(let c=0;c=0&&(e.replace(t,n,r),!(e.steps.length>u));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,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=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&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))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:i,$to:o,depth:s}=t,l=i.before(s+1),a=o.after(s+1),c=l,d=a,p=r.empty,u=0;for(let h=s,g=!1;h>n;h--)g||i.index(h)>0?(g=!0,p=r.from(i.node(h).copy(p)),u++):c--;let f=r.empty,m=0;for(let h=s,g=!1;h>n;h--)g||o.after(h+1)=0;l--){if(i.size){let e=n[l].type.contentMatch.matchFragment(i);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.from(n[l].type.create(n[l].attrs,i))}let o=t.start,s=t.end;e.step(new Me(o,s,o,s,new h(i,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,i=null){return function(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{let l="function"==typeof o?o(t):o;if(t.isTextblock&&!t.hasMarkup(i,l)&&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(s).map(n),i)){let o=null;if(i.schema.linebreakReplacement){let e="pre"==i.whitespace,t=!!i.contentMatch.matchType(i.schema.linebreakReplacement);e&&!t?o=!1:!e&&t&&(o=!0)}!1===o&&$e(e,t,n,s),Oe(e,e.mapping.slice(s).map(n,1),i,void 0,null===o);let a=e.mapping.slice(s),c=a.map(n,1),d=a.map(n+t.nodeSize,1);return e.step(new Me(c,d,c+1,d-1,new h(r.from(i.create(l,null,t.marks)),0,0),1,!0)),!0===o&&Ee(e,t,n,s),!1}}))}(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return function(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let l=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,l);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Me(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new h(r.from(l),0,0),1,!0))}(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new _e(e,t,n)),this}setDocAttribute(e,t){return this.step(new Ke(e,t)),this}addNodeMark(e,t){return this.step(new be(e,t)),this}removeNodeMark(e,t){if(!(t instanceof l)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new Se(e,t)),this}split(e,t=1,n){return function(e,t,n=1,i){let o=e.doc.resolve(t),s=r.empty,l=r.empty;for(let a=o.depth,h=o.depth-n,c=n-1;a>h;a--,c--){s=r.from(o.node(a).copy(s));let e=i&&i[c];l=r.from(e?e.type.create(e.attrs,l):o.node(a).copy(l))}e.step(new ke(t,t,new h(s.append(l),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],l=[];e.doc.nodesBetween(t,n,((e,a,h)=>{if(!e.isInline)return;let c=e.marks;if(!r.isInSet(c)&&h.type.allowsMarkType(r.type)){let h=Math.max(a,t),d=Math.min(a+e.nodeSize,n),p=r.addToSet(c);for(let e=0;ee.step(t))),l.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 l=null;if(r instanceof _){let t,n=e.marks;for(;t=r.isInSet(n);)(l||(l=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(l=[r]):l=e.marks;if(l&&l.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;ee.step(new xe(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return Oe(this,e,t,n),this}}const Ue=Object.create(null);class Ge{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Ze(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?st(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):st(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 it(e.node(0))}static atStart(e){return st(e,e,0,0,1)||new it(e)}static atEnd(e){return st(e,e,e.content.size,e.childCount,-1)||new it(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Ue[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 Ue)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ue[e]=t,t.prototype.jsonID=e,t}getBookmark(){return et.between(this.$anchor,this.$head).getBookmark()}}Ge.prototype.visible=!0;class Ze{constructor(e,t){this.$from=e,this.$to=t}}let Xe=!1;function Qe(e){Xe||e.parent.inlineContent||(Xe=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class et extends Ge{constructor(e,t=e){Qe(e),Qe(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 Ge.near(n);let r=e.resolve(t.map(this.anchor));return new et(r.parent.inlineContent?r:n,n)}replace(e,t=h.empty){if(super.replace(e,t),t==h.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof et&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new tt(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 et(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=Ge.findFrom(t,n,!0)||Ge.findFrom(t,-n,!0);if(!e)return Ge.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(Ge.findFrom(e,-n,!0)||Ge.findFrom(e,n,!0)).$anchor).posnew it(e)};function st(e,t,n,r,i,o=!1){if(t.inlineContent)return et.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&&nt.isSelectable(r))return nt.create(e,n-(i<0?r.nodeSize:0))}else{let t=st(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function lt(e,t,n){let r=e.steps.length-1;if(r{null==i&&(i=r)})),e.setSelection(Ge.near(e.doc.resolve(i),n)))}class at extends Ye{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 l.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)||l.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(Ge.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 ht(e,t){return t&&e?e.bind(t):e}class ct{constructor(e,t,n){this.name=e,this.init=ht(t.init,n),this.apply=ht(t.apply,n)}}const dt=[new ct("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new ct("selection",{init:(e,t)=>e.selection||Ge.atStart(t.doc),apply:e=>e.selection}),new ct("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new ct("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class pt{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=dt.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 ct(e.key,e.spec.state,e))}))}}class ut{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 pt(e.schema,e.plugins),i=new ut(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=N.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=Ge.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],l=s.spec.state;if(s.key==r.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(i[r.name]=l.fromJSON.call(s,e,t[o],i))}i[r.name]=r.init(e,i)}})),i}}function ft(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=ft(i,t,{})),n[r]=i}return n}class mt{constructor(e){this.spec=e,this.props={},e.props&&ft(e.props,this,this.props),this.key=e.key?e.key.key:yt("plugin")}getState(e){return e[this.key]}}const gt=Object.create(null);function yt(e){return e in gt?e+"$"+ ++gt[e]:(gt[e]=0,e+"$")}class wt{constructor(e="key"){this.key=yt(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const vt=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},xt=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let bt=null;const St=function(e,t,n){let r=bt||(bt=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},kt=function(e,t,n,r){return n&&(Ct(e,t,n,r,-1)||Ct(e,t,n,r,1))},Mt=/^(img|br|input|textarea|hr)$/i;function Ct(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Ot(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Nt(e)||Mt.test(e.nodeName)||"false"==e.contentEditable)return!1;t=vt(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?Ot(e):0}}}function Ot(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Nt(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 Tt=function(e){return e.focusNode&&kt(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Dt(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const At="undefined"!=typeof navigator?navigator:null,Et="undefined"!=typeof document?document:null,$t=At&&At.userAgent||"",It=/Edge\/(\d+)/.exec($t),Rt=/MSIE \d/.exec($t),zt=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec($t),Pt=!!(Rt||zt||It),Bt=Rt?document.documentMode:zt?+zt[1]:It?+It[1]:0,Vt=!Pt&&/gecko\/(\d+)/i.test($t);Vt&&(/Firefox\/(\d+)/.exec($t)||[0,0])[1];const Ft=!Pt&&/Chrome\/(\d+)/.exec($t),Lt=!!Ft,Jt=Ft?+Ft[1]:0,Wt=!Pt&&!!At&&/Apple Computer/.test(At.vendor),qt=Wt&&(/Mobile\/\w+/.test($t)||!!At&&At.maxTouchPoints>2),jt=qt||!!At&&/Mac/.test(At.platform),_t=!!At&&/Win/.test(At.platform),Kt=/Android \d/.test($t),Ht=!!Et&&"webkitFontSmoothing"in Et.documentElement.style,Yt=Ht?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Ut(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Gt(e,t){return"number"==typeof e?e:e[t]}function Zt(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 Xt(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=xt(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,l=n?Ut(o):Zt(e),a=0,h=0;if(t.topl.bottom-Gt(r,"bottom")&&(h=t.bottom-t.top>l.bottom-l.top?t.top+Gt(i,"top")-l.top:t.bottom-l.bottom+Gt(i,"bottom")),t.leftl.right-Gt(r,"right")&&(a=t.right-l.right+Gt(i,"right")),a||h)if(n)o.defaultView.scrollBy(a,h);else{let n=e.scrollLeft,r=e.scrollTop;h&&(e.scrollTop+=h),a&&(e.scrollLeft+=a);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||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function Qt(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=xt(r));return t}function en(e,t){for(let n=0;n=h){a=Math.max(u.bottom,a),h=Math.min(u.top,h);let e=u.left>t.left?u.left-t.left:u.right=(u.left+u.right)/2?1:0));continue}}else u.top>t.top&&!i&&u.left<=t.left&&u.right>=t.left&&(i=c,o={left:Math.max(u.left,Math.min(u.right,t.left)),top:u.top});!n&&(t.left>=u.right&&t.top>=u.top||t.left>=u.left&&t.top>=u.bottom)&&(l=d+1)}}return!n&&i&&(n=i,r=o,s=0),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||s&&1==n.nodeType?{node:e,offset:l}:nn(n,r)}function rn(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function on(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&i++}let r;Ht&&i&&1==n.nodeType&&1==(r=n.childNodes[i-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&i--,n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(s=function(e,t,n,r){let i=-1;for(let o=t,s=!1;o!=e.dom;){let t=e.docView.nearestDesc(o,!0);if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent||!t.contentDOM)){let e=t.dom.getBoundingClientRect();if(t.node.isBlock&&t.parent&&(!s&&e.left>r.left||e.top>r.top?i=t.posBefore:(!s&&e.right-1?i:e.docView.posFromDOM(t,n,-1)}(e,n,i,t))}null==s&&(s=function(e,t,n){let{node:r,offset:i}=nn(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,l,t));let a=e.docView.nearestDesc(l,!0);return{pos:s,inside:a?a.posAtStart-a.border:-1}}function ln(e){return e.top=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,dn(an(St(r,e,t),o),o<0)}{let e=an(St(r,i,i),n);if(Vt&&i&&/\s/.test(r.nodeValue[i-1])&&i=0)}if(null==o&&i&&(n<0||i==Ot(r))){let e=r.childNodes[i-1],t=3==e.nodeType?St(e,Ot(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return dn(an(t,1),!1)}if(null==o&&i=0)}function dn(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 pn(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 un(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 fn=/[\u0590-\u08ac]/;let mn=null,gn=null,yn=!1;function wn(e,t,n){return mn==t&&gn==n?yn:(mn=t,gn=n,yn="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return un(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.contentDOM||n.dom;break}t=n.dom.parentNode}let r=cn(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=St(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,l=e.domSelection();return l?fn.test(r.parent.textContent)&&l.modify?un(e,t,(()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:s}=e.domSelectionRange(),a=l.caretBidiLevel;l.modify("move",n,"character");let h=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:c,focusOffset:d}=e.domSelectionRange(),p=c&&!h.contains(1==c.nodeType?c:c.parentNode)||t==c&&i==d;try{l.collapse(o,s),t&&(t!=o||i!=s)&&l.extend&&l.extend(t,i)}catch(u){}return null!=a&&(l.caretBidiLevel=a),p})):"left"==n||"backward"==n?o:s:r.pos==r.start()||r.pos==r.end()}(e,t,n))}class vn{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;tvt(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 On){r=e-i;break}i=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof xn&&i.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?vt(e.dom)+1:0}}{let e,r=!0;for(;e=n=i&&t<=l-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=vt(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||s==this.children.length-1)){t=l;for(let e=s+1;eu&&ot){let e=s;s=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(s.node,s.offset),a.removeAllRanges(),a.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 bn extends vn{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 Sn extends vn{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=ie.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new Sn(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}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=Fn(i,0,e,n));for(let s=0;ss?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),h=a&&a.dom,c=a&&a.contentDOM;if(t.isText)if(h){if(3!=h.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else h=document.createTextNode(t.text);else if(!h){let e=ie.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:h,contentDOM:c}=e)}c||t.isText||"BR"==h.nodeName||(h.hasAttribute("contenteditable")||(h.contentEditable="false"),t.type.spec.draggable&&(h.draggable=!0));let d=h;return h=Rn(h,n,t),a?s=new Nn(e,t,n,r,h,c||null,d,a,i,o+1):t.isText?new Cn(e,t,n,r,h,d,i):new kn(e,t,n,r,h,c||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=()=>r.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)&&zn(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 Bn(this,o&&o.node,e);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;no;)l.push(i[s++]);let f=o+p.nodeSize;if(p.isText){let e=f;s!e.inline)):l.slice(),t.forChild(o,p),u),o=f}}(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?l.none:this.node.child(i).marks,n,e),a.placeWidget(t,e,r)}),((t,o,l,h)=>{let c;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,o,l,h)||s&&e.state.selection.from>r&&e.state.selection.to-1&&a.updateNodeAt(t,o,l,c,e)||a.updateNextNode(t,o,l,e,h,r)||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),Tn(this.contentDOM,this.children,e),qt&&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 et)||nt+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,o=function(e,t,n,r){for(let i=0,o=0;i=n){if(o>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let e=l=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return o<0?null:{node:i,pos:o,text:e}}return{node:i,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 bn(this,i,t,r);e.input.compositionNodes.push(o),this.children=Fn(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(zn(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=$n(this.dom,this.nodeDOM,En(this.outerDeco,this.node,t),En(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 Mn(e,t,n,r,i){Rn(r,t,e);let o=new kn(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Cn extends kn{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 Cn(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}isText(e){return this.node.text==e}}class On extends vn{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 Nn extends kn{constructor(e,t,n,r,i,o,s,l,a,h){super(e,t,n,r,i,o,s,a,h),this.spec=l}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){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 Tn(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o0;){let l;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Sn)){l=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 a=l.node;if(a){if(a!=e.child(i-1))break;--i,o.set(l,i),s.push(l)}}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=Sn.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,l=Math.min(this.top.children.length,s+5);s=n||c<=t?o.push(a):(hn&&o.push(a.slice(n-h,a.size,r)))}return o}function Ln(e,t=null){let n=e.domSelectionRange(),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 l,a,h=r.resolve(s);if(Tt(n)){for(l=s;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&nt.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==Ot(e);r||i;){if(e==n)return!0;let t=vt(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==Ot(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;a=new nt(s==e?h:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,i=s;for(let r=0;r{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Jn(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const qn=Wt||Lt&&Jt<63;function jn(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=rr(e,t,n)))||et.between(t,n,r)}function Gn(e){return!(e.editable&&!e.hasFocus())&&Zn(e)}function Zn(e){let t=e.domSelectionRange();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 Xn(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&&Ge.findFrom(o,t)}function Qn(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function er(e,t,n){let r=e.state.selection;if(!(r instanceof et)){if(r instanceof nt&&r.node.isInline)return Qn(e,new et(t>0?r.$to:r.$from));{let n=Xn(e.state,t);return!!n&&Qn(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return Qn(e,new et(r.$anchor,o))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=Xn(e.state,t);return!!(n&&n instanceof nt)&&Qn(e,n)}if(!(jt&&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)&&(nt.isSelectable(o)?Qn(e,new nt(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!Ht&&Qn(e,new et(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function tr(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function nr(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function rr(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;Vt&&1==n.nodeType&&r0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(nr(e,-1))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(ir(n))break;{let t=n.previousSibling;for(;t&&nr(t,-1);)i=n.parentNode,o=vt(t),t=t.previousSibling;if(t)n=t,r=tr(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?or(e,n,r):i&&or(e,i,o)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=tr(n);for(;;)if(r{e.state==i&&Wn(e)}),50)}function sr(e,t){let n=e.state.doc.resolve(t);if(!Lt&&!_t&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i1)return n.leftr.top&&i1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function lr(e,t,n){let r=e.state.selection;if(r instanceof et&&!r.empty||n.indexOf("s")>-1)return!1;if(jt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Xn(e.state,t);if(n&&n instanceof nt)return Qn(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof it?Ge.near(n,t):Ge.findFrom(n,t);return!!s&&Qn(e,s)}return!1}function ar(e,t){if(!(e.state.selection instanceof et))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 hr(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function cr(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);if(8==n||jt&&72==n&&"c"==r)return ar(e,-1)||rr(e,-1);if(46==n&&!t.shiftKey||jt&&68==n&&"c"==r)return ar(e,1)||rr(e,1);if(13==n||27==n)return!0;if(37==n||jt&&66==n&&"c"==r){let t=37==n?"ltr"==sr(e,e.state.selection.from)?-1:1:-1;return er(e,t,r)||rr(e,t)}if(39==n||jt&&70==n&&"c"==r){let t=39==n?"ltr"==sr(e,e.state.selection.from)?1:-1:1;return er(e,t,r)||rr(e,t)}return 38==n||jt&&80==n&&"c"==r?lr(e,-1,r)||rr(e,-1):40==n||jt&&78==n&&"c"==r?function(e){if(!Wt||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;hr(e,n,"true"),setTimeout((()=>hr(e,n,"false")),20)}return!1}(e)||lr(e,1,r)||rr(e,1):r==(jt?"m":"c")&&(66==n||73==n||89==n||90==n)}function dr(e,t){e.someProp("transformCopied",(n=>{t=n(t,e)}));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")||ie.fromSchema(e.state.schema),l=br(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let h,c=a.firstChild,d=0;for(;c&&1==c.nodeType&&(h=vr[c.nodeName.toLowerCase()]);){for(let e=h.length-1;e>=0;e--){let t=l.createElement(h[e]);for(;a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t),d++}c=a.firstChild}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:a,text:e.someProp("clipboardTextSerializer",(n=>n(t,e)))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function pr(e,t,n,i,o){let s,l,a=o.parent.type.spec.code;if(!n&&!t)return null;let c=t&&(i||a||!n);if(c){if(e.someProp("transformPastedText",(n=>{t=n(t,a||i,e)})),a)return t?new h(r.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):h.empty;let n=e.someProp("clipboardTextParser",(n=>n(t,o,i,e)));if(n)l=n;else{let n=o.marks(),{schema:r}=e.state,i=ie.fromSchema(r);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(i.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(t=>{n=t(n,e)})),s=function(e){let t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=br().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&vr[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"")).reverse().join(""));if(r.innerHTML=function(e){let t=window.trustedTypes;if(!t)return e;Sr||(Sr=t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e}));return Sr.createHTML(e)}(e),n)for(let o=0;o0;r--){let e=s.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;s=e}if(!l){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Y.fromSchema(e.state.schema);l=t.parseSlice(s,{preserveWhitespace:!(!c&&!p),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||ur.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(p)l=function(e,t){if(!e.size)return e;let n,i=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(a){return e}let{content:o,openStart:s,openEnd:l}=e;for(let h=n.length-2;h>=0;h-=2){let e=i.nodes[n[h]];if(!e||e.hasRequiredAttrs())break;o=r.from(e.create(n[h+1],o)),s++,l++}return new h(o,s,l)}(wr(l,+p[1],+p[2]),p[4]);else if(l=h.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i,o=t.node(n).contentMatchAt(t.index(n)),s=[];if(e.forEach((e=>{if(!s)return;let t,n=o.findWrapping(e.type);if(!n)return s=null;if(t=s.length&&i.length&&mr(n,i,e,s[s.length-1],0))s[s.length-1]=t;else{s.length&&(s[s.length-1]=gr(s[s.length-1],i.length));let t=fr(e,n);s.push(t),o=o.matchType(t.type),i=n}})),s)return r.from(s)}return e}(l.content,o),!0),l.openStart||l.openEnd){let e=0,t=0;for(let n=l.content.firstChild;e{l=t(l,e)})),l}const ur=/^(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 fr(e,t,n=0){for(let i=t.length-1;i>=n;i--)e=t[i].create(null,r.from(e));return e}function mr(e,t,n,i,o){if(o1&&(s=0),o=n&&(a=t<0?l.contentMatchAt(0).fillBefore(a,s<=o).append(a):a.append(l.contentMatchAt(l.childCount).fillBefore(r.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(a))}function wr(e,t,n){return t{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Dr(e,t))}))}function Dr(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Ar(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 Er(e){return{left:e.clientX,top:e.clientY}}function $r(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 Ir(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function Rr(e,t,n,r,i){return $r(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 nt&&(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(nt.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&&(Ir(e,nt.create(e.state.doc,r)),!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&&nt.isSelectable(r))&&(Ir(e,new nt(n)),!0)}(e,n))}function zr(e,t,n,r){return $r(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Pr(e,t,n,r){return $r(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&&(Ir(e,et.create(r,0,r.content.size)),!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)Ir(e,et.create(r,n+1,n+1+t.content.size));else{if(!nt.isSelectable(t))continue;Ir(e,nt.create(r,n))}return!0}}(e,n,r)}function Br(e){return _r(e)}Mr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Lr(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Kt||!Lt||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!qt||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||cr(e,n)?n.preventDefault():Nr(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,Dt(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},Mr.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Mr.keypress=(e,t)=>{let n=t;if(Lr(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||jt&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof et&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);/[\r\n]/.test(t)||e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const Vr=jt?"metaKey":"ctrlKey";kr.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Br(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[Vr]&&("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(Er(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Fr(e,s,n,!!r)):("doubleClick"==o?zr:Pr)(e,s.pos,s.inside,n)?n.preventDefault():Nr(e,"pointer"))};class Fr{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[Vr],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,l=s?e.docView.nearestDesc(s,!0):null;this.target=l&&1==l.dom.nodeType?l.dom:null;let{selection:a}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||a instanceof nt&&a.from<=o&&a.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Vt||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)),Nr(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((()=>Wn(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(Er(e))),this.updateAllowDefault(e),this.allowDefault||!t?Nr(this.view,"pointer"):Rr(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Wt&&this.mightDrag&&!this.mightDrag.node.isAtom||Lt&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ir(this.view,Ge.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Nr(this.view,"pointer")}move(e){this.updateAllowDefault(e),Nr(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function Lr(e,t){return!!e.composing||!!(Wt&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}kr.touchstart=e=>{e.input.lastTouch=Date.now(),Br(e),Nr(e,"pointer")},kr.touchmove=e=>{e.input.lastTouch=Date.now(),Nr(e,"pointer")},kr.contextmenu=e=>Br(e);const Jr=Kt?5e3:-1;function Wr(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>_r(e)),t))}function qr(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 jr(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=Ot(e=e.childNodes[t-1])}else{if(!e.parentNode||Nt(e))return null;t=vt(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t=0)){if(e.domObserver.forceFlush(),qr(e),t||e.docView&&e.docView.dirty){let n=Ln(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||e.state.selection.empty?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}Mr.compositionstart=Mr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof et&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),_r(e,!0),e.markCursor=null;else if(_r(e,!t.selection.empty),Vt&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}Wr(e,Jr)},Mr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then((()=>e.domObserver.flush())),e.input.compositionID++,Wr(e,20))};const Kr=Pt&&Bt<15||qt&&Yt<604;function Hr(e,t,n,r,i){let o=pr(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,i,o||h.empty))))return!0;if(!o)return!1;let s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),l=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Yr(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}kr.copy=Mr.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=Kr?null:n.clipboardData,s=r.content(),{dom:l,text:a}=dr(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):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,l),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Mr.paste=(e,t)=>{let n=t;if(e.composing&&!Kt)return;let r=Kr?null:n.clipboardData,i=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&Hr(e,Yr(r),r.getData("text/html"),i,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();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Hr(e,r.value,null,i,t):Hr(e,r.textContent,r.innerHTML,i,t)}),50)}(e,n)};class Ur{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const Gr=jt?"altKey":"ctrlKey";kr.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i,o=e.state.selection,s=o.empty?null:e.posAtCoords(Er(n));if(s&&s.pos>=o.from&&s.pos<=(o instanceof nt?o.to-1:o.to));else if(r&&r.mightDrag)i=nt.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&&(i=nt.create(e.state.doc,t.posBefore))}let l=(i||e.state.selection).content(),{dom:a,text:h,slice:c}=dr(e,l);(!n.dataTransfer.files.length||!Lt||Jt>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Kr?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Kr||n.dataTransfer.setData("text/plain",h),e.dragging=new Ur(c,!n[Gr],i)},kr.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},Mr.dragover=Mr.dragenter=(e,t)=>t.preventDefault(),Mr.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Er(n));if(!i)return;let o=e.state.doc.resolve(i.pos),s=r&&r.slice;s?e.someProp("transformPasted",(t=>{s=t(s,e)})):s=pr(e,Yr(n.dataTransfer),Kr?null:n.dataTransfer.getData("text/html"),!1,o);let l=!(!r||n[Gr]);if(e.someProp("handleDrop",(t=>t(e,n,s||h.empty,l))))return void n.preventDefault();if(!s)return;n.preventDefault();let a=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),l=!1;if(1==o)l=s.canReplace(n,n,i);else{let e=s.contentMatchAt(n).findWrapping(i.firstChild.type);l=e&&s.canReplaceWith(n,n,e[0])}if(l)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==a&&(a=o.pos);let c=e.state.tr;if(l){let{node:e}=r;e?e.replace(c):c.deleteSelection()}let d=c.mapping.map(a),p=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,u=c.doc;if(p?c.replaceRangeWith(d,d,s.content.firstChild):c.replaceRange(d,d,s),c.doc.eq(u))return;let f=c.doc.resolve(d);if(p&&nt.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new nt(f));else{let t=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),c.setSelection(Un(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},kr.focus=e=>{e.input.lastFocus=Date.now(),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.domSelectionRange())&&Wn(e)}),20))},kr.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)},kr.beforeinput=(e,t)=>{if(Lt&&Kt&&"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,Dt(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 Mr)kr[os]=Mr[os];function Zr(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 Xr{constructor(e,t){this.toDOM=e,this.spec=t||ri,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 ti(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Xr&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Zr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Qr{constructor(e,t){this.attrs=e,this.spec=t||ri}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 ti(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==oi||0==e.maps.length?this:this.mapInner(e,t,0,0,n||ri)}mapInner(e,t,n,r,i){let o;for(let s=0;s{let o=i-r-(n-t);for(let s=0;sr+c-e)continue;let i=l[s]+c-e;n>=i?l[s+1]=t<=i?-2:-1:t>=c&&o&&(l[s]+=o,l[s+1]+=o)}e+=o})),c=n.maps[h].map(c,-1)}let a=!1;for(let h=0;h=r.content.size){a=!0;continue}let d=n.map(e[h+1]+o,-1)-i,{index:p,offset:u}=r.content.findIndex(c),f=r.maybeChild(p);if(f&&u==c&&u+f.nodeSize==d){let r=l[h+2].mapInner(n,f,t+1,e[h]+o+1,s);r!=oi?(l[h]=c,l[h+1]=d,l[h+2]=r):(l[h+1]=-2,a=!0)}else a=!0}if(a){let a=function(e,t,n,r,i,o,s){function l(e,t){for(let o=0;o{let s,l=o+n;if(s=ai(t,e,l)){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 Qr){let t=Math.max(i,e.from)-i,n=Math.min(o,e.to)-i;tn.map(e,t,ri)));return si.from(n)}forChild(e,t){if(t.isLeaf)return ii.empty;let n=[];for(let r=0;re instanceof ii))?e:e.reduce(((e,t)=>e.concat(t instanceof ii?t:t.members)),[]))}}forEachSet(e){for(let t=0;tn&&o.to{let l=ai(e,t,s+n);if(l){o=!0;let e=ci(l,t,n+s+1,r);e!=oi&&i.push(s,s+t.nodeSize,e)}}));let s=li(o?hi(e):e,-n).sort(di);for(let l=0;l0;)t++;e.splice(t,0,n)}function fi(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=oi&&t.push(r)})),e.cursorWrapper&&t.push(ii.create(e.state.doc,[e.cursorWrapper.deco])),si.from(t)}const mi={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},gi=Pt&&Bt<=11;class yi{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 wi{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new yi,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,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()})),gi&&(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.takeRecords(),this.observer.observe(this.view.dom,mi)),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(Gn(this.view)){if(this.suppressingSelectionUpdates)return Wn(this.view);if(Pt&&Bt<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&kt(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let i=e.focusNode;i;i=xt(i))n.add(i);for(let i=e.anchorNode;i;i=xt(i))if(n.has(i)){t=i;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Gn(e)&&!this.ignoreSelectionChange(n),i=-1,o=-1,s=!1,l=[];if(e.editable)for(let h=0;h"BR"==e.nodeName));if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;!t||"LI"!=t.nodeName||n&&Si(e,n)==t||r.remove()}}}let a=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||r)&&(i>-1&&(e.docView.markDirty(i,o),function(e){if(vi.has(e))return;if(vi.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=Vt,xi)return;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."),xi=!0}}(e)),this.handleDOMChange(i,o,s,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Wn(e),this.currentSelection.set(n))}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=Ln(e,t);if(n&&!e.state.selection.eq(n)){if(Lt&&Kt&&13===e.input.lastKeyCode&&Date.now()-100t(e,Dt(13,"Enter")))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),s&&r.setMeta("composition",s),e.dispatch(r)}return}let l=e.state.doc.resolve(t),a=l.sharedDepth(n);t=l.before(a+1),n=e.state.doc.resolve(n).after(a+1);let h,c,d=e.state.selection,p=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:l,to:a}=e.docView.parseRange(t,n),h=e.domSelectionRange(),c=h.anchorNode;if(c&&e.dom.contains(1==c.nodeType?c:c.parentNode)&&(r=[{node:c,offset:h.anchorOffset}],Tt(h)||r.push({node:h.focusNode,offset:h.focusOffset})),Lt&&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,p=e.someProp("domParser")||Y.fromSchema(e.state.schema),u=d.resolve(l),f=null,m=p.parse(i,{topNode:u.parent,topMatch:u.parent.contentMatchAt(u.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=u.parent.type.whitespace||"full",findPositions:r,ruleFromNode:ki,context:u});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+l,head:t+l}}return{doc:m,sel:f,from:l,to:a}}(e,t,n),u=e.state.doc,f=u.slice(p.from,p.to);8===e.input.lastKeyCode&&Date.now()-100=s?o-r:0;o-=e,o&&o=l?o-r:0;o-=t,o&&oDate.now()-225||Kt)&&o.some((e=>1==e.nodeType&&!Mi.test(e.nodeName)))&&(!m||m.endA>=m.endB)&&e.someProp("handleKeyDown",(t=>t(e,Dt(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!m){if(!(i&&d instanceof et&&!d.empty&&d.$head.sameParent(d.$anchor))||e.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){let t=Oi(e,e.state.doc,p.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);s&&n.setMeta("composition",s),e.dispatch(n)}}return}m={start:d.from,endA:d.to,endB:d.to}}e.state.selection.frome.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=p.from?m.start=e.state.selection.from:m.endA=e.state.selection.to-2&&e.state.selection.to<=p.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),Pt&&Bt<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>p.from&&"  "==p.doc.textBetween(m.start-p.from-1,m.start-p.from+1)&&(m.start--,m.endA--,m.endB--);let g,y=p.doc.resolveNoCache(m.start-p.from),w=p.doc.resolveNoCache(m.endB-p.from),v=u.resolve(m.start),x=y.sameParent(w)&&y.parent.inlineContent&&v.end()>=m.endA;if((qt&&e.input.lastIOSEnter>Date.now()-225&&(!x||o.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!x&&y.post(e,Dt(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>m.start&&function(e,t,n,r,i){if(n-t<=i.pos-r.pos||Ni(r,!0,!1)n||Ni(s,!0,!1)t(e,Dt(8,"Backspace")))))return void(Kt&&Lt&&e.domObserver.suppressSelectionUpdates());Lt&&Kt&&m.endB==m.start&&(e.input.lastAndroidDelete=Date.now()),Kt&&!x&&y.start()!=w.start()&&0==w.parentOffset&&y.depth==w.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==m.endA&&(m.endB-=2,w=p.doc.resolveNoCache(m.endB-p.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,Dt(13,"Enter"))}))}),20));let b,S,k,M=m.start,C=m.endA;if(x)if(y.pos==w.pos)Pt&&Bt<=11&&0==y.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Wn(e)),20)),b=e.state.tr.delete(M,C),S=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(k=function(e,t){let n,i,o,s=e.firstChild.marks,l=t.firstChild.marks,a=s,h=l;for(let r=0;re.mark(i.addToSet(e.marks));else{if(0!=a.length||1!=h.length)return null;i=h[0],n="remove",o=e=>e.mark(i.removeFromSet(e.marks))}let c=[];for(let r=0;rn(e,M,C,t))))return;b=e.state.tr.insertText(t,M,C)}if(b||(b=e.state.tr.replace(M,C,p.doc.slice(m.start-p.from,m.endB-p.from))),p.sel){let t=Oi(e,b.doc,p.sel);t&&!(Lt&&Kt&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastAndroidDeletet.content.size?null:Un(e,t.resolve(n.anchor),t.resolve(n.head))}function Ni(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}function Ti(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class Di{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 Or,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Ri),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=$i(this),Ei(this),this.nodeViews=Ii(this),this.docView=Mn(this.state.doc,Ai(this),fi(this),this.dom,this),this.domObserver=new wi(this,((e,t,n,r)=>Ci(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in kr){let n=kr[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Ar(e,t)||Dr(e,t)||!e.editable&&t.type in Mr||n(e,t)},Cr[t]?{passive:!0}:void 0)}Wt&&e.dom.addEventListener("input",(()=>null)),Tr(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&&Tr(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Ri),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}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._props)}updateStateInner(e,t){var n;let r=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(qr(this),o=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Ii(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,i=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&Tr(this),this.editable=$i(this),Ei(this);let l=fi(this),a=Ai(this),h=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",c=i||!this.docView.matchesNode(e.doc,a,l);!c&&e.selection.eq(r.selection)||(o=!0);let d="preserve"==h&&o&&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=l.top;break}}return{refDOM:t,refTop:n,stack:Qt(e.dom)}}(this);if(o){this.domObserver.stop();let t=c&&(Pt||Lt)&&!this.composing&&!r.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)}(r.selection,e.selection);if(c){let n=Lt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=jr(this)),!i&&this.docView.update(e.doc,a,l,this)||(this.docView.updateOuterDeco(a),this.docView.destroy(),this.docView=Mn(e.doc,a,l,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return kt(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Wn(this,t):(Hn(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==h?this.dom.scrollTop=0:"to selection"==h?this.scrollToSelection():d&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;en(n,0==r?0:r-t)}(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof nt){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&Xt(this,t.getBoundingClientRect(),e)}else Xt(this,this.coordsAtPos(this.state.selection.head,1),e)}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;t0&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new Ur(e.slice,e.move,r<0?void 0:nt.create(this.state.doc,r))}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let o=0;ot.ownerDocument.getSelection()),this._root=t;return e||document}updateRoot(){this._root=null}posAtCoords(e){return sn(this,e)}coordsAtPos(e,t=1){return cn(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 wn(this,t||this.state,e)}pasteHTML(e,t){return Hr(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Hr(this,e,null,!0,t||new ClipboardEvent("paste"))}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,[],fi(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,bt=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Dr(e,t)||!kr[t.type]||!e.editable&&t.type in Mr||kr[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Wt&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return bi(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?bi(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Ai(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),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]))})),t.translate||(t.translate="no"),[ti.node(0,e.state.doc.content.size,t)]}function Ei(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:ti.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function $i(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function Ii(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Ri(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 zi={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:"'"},Pi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Bi="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Vi="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Fi=0;Fi<10;Fi++)zi[48+Fi]=zi[96+Fi]=String(Fi);for(Fi=1;Fi<=24;Fi++)zi[Fi+111]="F"+Fi;for(Fi=65;Fi<=90;Fi++)zi[Fi]=String.fromCharCode(Fi+32),Pi[Fi]=String.fromCharCode(Fi);for(var Li in zi)Pi.hasOwnProperty(Li)||(Pi[Li]=zi[Li]);const Ji="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Wi(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let l=0;l127)&&(r=zi[n.keyCode])&&r!=i){let i=t[qi(r,n)];if(i&&i(e.state,e.dispatch,e))return!0}}return!1}}const Ki=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Hi(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 Yi(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 Ui(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{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Te(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)};function Zi(e){for(let t=0;t{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=Zi(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(Ge.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0};const Qi=(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof nt&&e.selection.node.isBlock)return!(!n.parentOffset||!Ie(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let i,o,s=[],l=!1,a=!1;for(let p=n.depth;;p--){if(n.node(p).isBlock){l=n.end(p)==n.pos+(n.depth-p),a=n.start(p)==n.pos-(n.depth-p),o=Zi(n.node(p-1).contentMatchAt(n.indexAfter(p-1))),s.unshift(l&&o?{type:o}:null),i=p;break}if(1==p)return!1;s.unshift(null)}let h=e.tr;(e.selection instanceof et||e.selection instanceof it)&&h.deleteSelection();let c=h.mapping.map(n.pos),d=Ie(h.doc,c,s.length,s);if(d||(s[0]=o?{type:o}:null,d=Ie(h.doc,c,s.length,s)),h.split(c,s.length,s),!l&&a&&n.node(i).type!=o){let e=h.mapping.map(n.before(i)),t=h.doc.resolve(e);o&&n.node(i-1).canReplaceWith(t.index(),t.index()+1,o)&&h.setNodeMarkup(h.mapping.map(n.before(i)),o)}return t&&t(h.scrollIntoView()),!0};function eo(e,t,n,i){let o,s,l=t.nodeBefore,a=t.nodeAfter,c=l.type.spec.isolating||a.type.spec.isolating;if(!c&&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&&!Re(e.doc,t.pos)||(n&&n(e.tr.join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let d=!c&&t.parent.canReplace(t.index(),t.index()+1);if(d&&(o=(s=l.contentMatchAt(l.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let i=t.pos+a.nodeSize,s=r.empty;for(let e=o.length-1;e>=0;e--)s=r.from(o[e].create(null,s));s=r.from(l.copy(s));let c=e.tr.step(new Me(t.pos-1,i,t.pos,i,new h(s,1,0),o.length,!0)),d=c.doc.resolve(i+2*o.length);d.nodeAfter&&d.nodeAfter.type==l.type&&Re(c.doc,d.pos)&&c.join(d.pos),n(c.scrollIntoView())}return!0}let p=a.type.spec.isolating||i>0&&c?null:Ge.findFrom(t,1),u=p&&p.$from.blockRange(p.$to),f=u&&Te(u);if(null!=f&&f>=t.depth)return n&&n(e.tr.lift(u,f).scrollIntoView()),!0;if(d&&Hi(a,"start",!0)&&Hi(l,"end")){let i=l,o=[];for(;o.push(i),!i.isTextblock;)i=i.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(i.canReplace(i.childCount,i.childCount,s.content)){if(n){let i=r.empty;for(let e=o.length-1;e>=0;e--)i=r.from(o[e].copy(i));n(e.tr.step(new Me(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new h(i,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function to(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(et.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const no=to(-1),ro=to(1);function io(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&De(s,e,t);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}}function oo(e,t=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)i=!0;else{let t=n.doc.resolve(o),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}))}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r{if(l||!r&&e.isAtom&&e.isInline&&t>=o.pos&&t+e.nodeSize<=s.pos)return!1;l=e.inlineContent&&e.type.allowsMarkType(n)})),l)return!0}return!1}(n.doc,a,e,i))return!1;if(o)if(l)e.isInSet(n.storedMarks||l.marks())?o(n.tr.removeStoredMark(e)):o(n.tr.addStoredMark(e.create(t)));else{let s,l=n.tr;i||(a=function(e){let t=[];for(let n=0;n{if(e.isAtom&&e.content.size&&e.isInline&&n>=r.pos&&n+e.nodeSize<=i.pos)return n+1>r.pos&&t.push(new Ze(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+e.content.size),!1})),r.posn.doc.rangeHasMark(t.$from.pos,t.$to.pos,e))):!a.every((t=>{let n=!1;return l.doc.nodesBetween(t.$from.pos,t.$to.pos,((r,i,o)=>{if(n)return!1;n=!e.isInSet(r.marks)&&!!o&&o.type.allowsMarkType(e)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,t.$from.pos-i),Math.min(r.nodeSize,t.$to.pos-i))))})),!n}));for(let n=0;n{let r=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}(e,n);if(!r)return!1;let i=Yi(r);if(!i){let n=r.blockRange(),i=n&&Te(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(eo(e,i,t,-1))return!0;if(0==r.parent.content.size&&(Hi(o,"end")||nt.isSelectable(o)))for(let s=r.depth;;s--){let n=ze(e.doc,r.before(s),r.after(s),h.empty);if(n&&n.slice.size1)break}return!(!o.isAtom||i.depth!=r.depth-1)&&(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)}),((e,t,n)=>{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=Yi(r)}let s=o&&o.nodeBefore;return!(!s||!nt.isSelectable(s))&&(t&&t(e.tr.setSelection(nt.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)})),ho=lo(Ki,((e,t,n)=>{let r=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.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 it||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Zi(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(Ie(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Te(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)}),Qi),"Mod-Enter":Xi,Backspace:ao,"Mod-Backspace":ao,"Shift-Backspace":ao,Delete:ho,"Mod-Delete":ho,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new it(e.doc))),!0)},po={"Ctrl-h":co.Backspace,"Alt-Backspace":co["Mod-Backspace"],"Ctrl-d":co.Delete,"Ctrl-Alt-Backspace":co["Mod-Delete"],"Alt-Delete":co["Mod-Delete"],"Alt-d":co["Mod-Delete"],"Ctrl-a":no,"Ctrl-e":ro};for(let os in co)po[os]=co[os];const uo=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?po:co;class fo{constructor(e,t,n={}){var r;this.match=e,this.match=e,this.handler="string"==typeof t?(r=t,function(e,t,n,i){let o=r;if(t[1]){let e=t[0].lastIndexOf(t[1]);o+=t[0].slice(e+t[1].length);let r=(n+=e)-i;r>0&&(o=t[0].slice(e-r,e)+o,n=i)}return e.tr.insertText(o,n,i)}):t,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1}}function mo({rules:e}){let t=new mt({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)=>go(n,r,i,o,e,t),handleDOMEvents:{compositionend:n=>{setTimeout((()=>{let{$cursor:r}=n.state.selection;r&&go(n,r.pos,r.pos,"",e,t)}))}}},isInputRules:!0});return t}function go(e,t,n,r,i,o){if(e.composing)return!1;let s=e.state,l=s.doc.resolve(t),a=l.parent.textBetween(Math.max(0,l.parentOffset-500),l.parentOffset,null,"")+r;for(let h=0;h{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 wo(e,t,n=null,r){return new fo(e,((e,i,o,s)=>{let l=n instanceof Function?n(i):n,a=e.tr.delete(o,s),h=a.doc.resolve(o).blockRange(),c=h&&De(h,t,l);if(!c)return null;a.wrap(h,c);let d=a.doc.resolve(o-1).nodeBefore;return d&&d.type==t&&Re(a.doc,o-1)&&(!r||r(i,d))&&a.join(o-1),a}))}function vo(e,t,n=null){return new fo(e,((e,r,i,o)=>{let s=e.doc.resolve(i),l=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,l):null}))}new fo(/--$/,"—"),new fo(/\.\.\.$/,"…"),new fo(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new fo(/"$/,"”"),new fo(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new fo(/'$/,"’");const xo=["ol",0],bo=["ul",0],So=["li",0],ko={attrs:{order:{default:1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs:e=>({order:e.hasAttribute("start")?+e.getAttribute("start"):1})}],toDOM:e=>1==e.attrs.order?xo:["ol",{start:e.attrs.order},0]},Mo={parseDOM:[{tag:"ul"}],toDOM:()=>bo},Co={parseDOM:[{tag:"li"}],toDOM:()=>So,defining:!0};function Oo(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 No(e,t,n){return e.append({ordered_list:Oo(ko,{content:"list_item+",group:n}),bullet_list:Oo(Mo,{content:"list_item+",group:n}),list_item:Oo(Co,{content:t})})}function To(e,t=null){return function(n,i){let{$from:o,$to:s}=n.selection,l=o.blockRange(s),a=!1,c=l;if(!l)return!1;if(l.depth>=2&&o.node(l.depth-1).type.compatibleContent(e)&&0==l.startIndex){if(0==o.index(l.depth-1))return!1;let e=n.doc.resolve(l.start-2);c=new C(e,e,l.depth),l.endIndex=0;h--)s=r.from(n[h].type.create(n[h].attrs,s));e.step(new Me(t.start-(i?2:0),t.end,t.start,t.end,new h(s,0,0),n.length,!0));let l=0;for(let r=0;r=o.depth-3;e--)t=r.from(o.node(e).copy(t));let l=o.indexAfter(-1){if(d>-1)return!1;e.isTextblock&&0==e.content.size&&(d=t+1)})),d>-1&&c.setSelection(Ge.near(c.doc.resolve(d))),i(c.scrollIntoView())}return!0}let c=s.pos==o.end()?a.contentMatchAt(0).defaultType:null,d=n.tr.delete(o.pos,s.pos),p=c?[t?{type:e,attrs:t}:null,{type:c}]:void 0;return!!Ie(d.doc,o.pos,2,p)&&(i&&i(d.split(o.pos,2,p).scrollIntoView()),!0)}}function Ao(e){return function(t,n){let{$from:i,$to:o}=t.selection,s=i.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));return!!s&&(!n||(i.node(s.depth-1).type==e?function(e,t,n,i){let o=e.tr,s=i.end,l=i.$to.end(i.depth);sm;h--)r-=o.child(h).nodeSize,i.delete(r-1,r+1);let s=i.doc.resolve(n.start),l=s.nodeAfter;if(i.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,c=n.endIndex==o.childCount,d=s.node(-1),p=s.index(-1);if(!d.canReplace(p+(a?0:1),p+1,l.content.append(c?r.empty:r.from(o))))return!1;let u=s.pos,f=u+l.nodeSize;return i.step(new Me(u-(a?1:0),f+(c?1:0),u+1,f-1,new h((a?r.empty:r.from(o.copy(r.empty))).append(c?r.empty:r.from(o.copy(r.empty))),a?0:1,c?0:1),a?0:1)),t(i.scrollIntoView()),!0}(t,n,s)))}}function Eo(e){return function(t,n){let{$from:i,$to:o}=t.selection,s=i.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));if(!s)return!1;let l=s.startIndex;if(0==l)return!1;let a=s.parent,c=a.child(l-1);if(c.type!=e)return!1;if(n){let i=c.lastChild&&c.lastChild.type==a.type,o=r.from(i?e.create():null),l=new h(r.from(e.create(null,r.from(a.type.create(null,o)))),i?3:1,0),d=s.start,p=s.end;n(t.tr.step(new Me(d-(i?3:1),p,d,p,l,1,!0)).scrollIntoView())}return!0}}var $o=200,Io=function(){};Io.prototype.append=function(e){return e.length?(e=Io.from(e),!this.length&&e||e.length<$o&&this.leafAppend(e)||this.length<$o&&e.leafPrepend(this)||this.appendInner(e)):this},Io.prototype.prepend=function(e){return e.length?Io.from(e).append(this):this},Io.prototype.appendInner=function(e){return new zo(this,e)},Io.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Io.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Io.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Io.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)},Io.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},Io.from=function(e){return e instanceof Io?e:e&&e.length?new Ro(e):Io.empty};var Ro=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<=$o)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=$o)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}(Io);Io.empty=new Ro([]);var zo=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}(Io);class Po{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,l=e.tr,a=[],h=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void h.push(e);if(n){h.push(new Bo(e.map));let t,i=e.step.map(n.slice(r));i&&l.maybeStep(i).doc&&(t=l.mapping.maps[l.mapping.maps.length-1],a.push(new Bo(t,void 0,void 0,a.length+h.length))),r--,t&&n.appendMap(t,r)}else l.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(r)):e.selection,s=new Po(this.items.slice(0,i).append(h.reverse().concat(a)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:o}}addTransform(e,t,n,r){let i=[],o=this.eventCount,s=this.items,l=!r&&s.length?s.get(s.length-1):null;for(let h=0;hFo&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,a),o-=a),new Po(s.append(i),o)}remapping(e,t){let n=new fe;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 Po(this.items.append(e.map((e=>new Bo(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 l=t;this.items.forEach((t=>{let r=i.getMirror(--l);if(null==r)return;o=Math.min(o,r);let a=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),h=t.selection&&t.selection.map(i.slice(l+1,r));h&&s++,n.push(new Bo(a,o,h))}else n.push(new Bo(a))}),r);let a=[];for(let d=t;d500&&(c=c.compress(this.items.length-n.length)),c}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 l=o.selection&&o.selection.map(t.slice(n));l&&i++;let a,h=new Bo(s.invert(),e,l),c=r.length-1;(a=r.length&&r[c].merge(h))?r[c]=a:r.push(h)}}else o.map&&n--}),this.items.length,0),new Po(Io.from(r.reverse()),i)}}Po.empty=new Po(Io.empty,0);class Bo{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 Bo(t.getMap().invert(),t,this.selection)}}}class Vo{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}const Fo=20;function Lo(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach(((e,n,r,i)=>t.push(r,i)));return t}function Jo(e,t){if(!e)return null;let n=[];for(let r=0;rnew Vo(Po.empty,Po.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let i,o=n.getMeta(_o);if(o)return o.historyState;n.getMeta(Ko)&&(e=new Vo(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(_o))return s.getMeta(_o).redo?new Vo(e.done.addTransform(n,void 0,r,jo(t)),e.undone,Lo(n.mapping.maps),e.prevTime,e.prevComposition):new Vo(e.done,e.undone.addTransform(n,void 0,r,jo(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new Vo(e.done.rebased(n,i),e.undone.rebased(n,i),Jo(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Vo(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Jo(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=i&&(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)),l=s?Jo(e.prevRanges,n.mapping):Lo(n.mapping.maps);return new Vo(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,jo(t)),Po.empty,l,n.time,null==i?e.prevComposition:i)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?Uo:"historyRedo"==n?Go:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Yo(e,t){return(n,r)=>{let i=_o.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let o=function(e,t,n){let r=jo(t),i=_o.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),a=new Vo(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(_o,{redo:n,historyState:a})}(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const Uo=Yo(!1,!0),Go=Yo(!0,!0);function Zo(e){let t=_o.getState(e);return t?t.done.eventCount:0}function Xo(e){let t=_o.getState(e);return t?t.undone.eventCount:0} /*! * portal-vue © Thorsten Lünborg, 2019 * @@ -8,9 +8,4 @@ function t(t){this.content=t}function e(t,n,r){for(let i=0;;i++){if(i==t.childCo * * https://github.com/linusborg/portal-vue * - */function Zo(t){return(Zo="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)}function Xo(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&void 0!==arguments[1]&&arguments[1],n=t.to,r=t.from;if(n&&(r||!1!==e)&&this.transports[n])if(e)this.transports[n]=[];else{var i=this.$_getTransportIndex(t);if(i>=0){var o=this.transports[n].slice(0);o.splice(i,1),this.transports[n]=o}}},registerTarget:function(t,e,n){Qo&&(this.trackInstances&&!n&&this.targets[t]&&console.warn("[portal-vue]: Target ".concat(t," already exists")),this.$set(this.targets,t,Object.freeze([e])))},unregisterTarget:function(t){this.$delete(this.targets,t)},registerSource:function(t,e,n){Qo&&(this.trackInstances&&!n&&this.sources[t]&&console.warn("[portal-vue]: source ".concat(t," already exists")),this.$set(this.sources,t,Object.freeze([e])))},unregisterSource:function(t){this.$delete(this.sources,t)},hasTarget:function(t){return!(!this.targets[t]||!this.targets[t][0])},hasSource:function(t){return!(!this.sources[t]||!this.sources[t][0])},hasContentFor:function(t){return!!this.transports[t]&&!!this.transports[t].length},$_getTransportIndex:function(t){var e=t.to,n=t.from;for(var r in this.transports[e])if(this.transports[e][r].from===n)return+r;return-1}}}),ss=new is(es),ls=1,as=Vue.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function(){return String(ls++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}}},created:function(){var t=this;this.$nextTick((function(){ss.registerSource(t.name,t)}))},mounted:function(){this.disabled||this.sendUpdate()},updated:function(){this.disabled?this.clear():this.sendUpdate()},beforeDestroy:function(){ss.unregisterSource(this.name),this.clear()},watch:{to:function(t,e){e&&e!==t&&this.clear(e),this.sendUpdate()}},methods:{clear:function(t){var e={from:this.name,to:t||this.to};ss.close(e)},normalizeSlots:function(){return this.$scopedSlots.default?[this.$scopedSlots.default]:this.$slots.default},normalizeOwnChildren:function(t){return"function"==typeof t?t(this.slotProps):t},sendUpdate:function(){var t=this.normalizeSlots();if(t){var e={from:this.name,to:this.to,passengers:Xo(t),order:this.order};ss.open(e)}else this.clear()}},render:function(t){var e=this.$slots.default||this.$scopedSlots.default||[],n=this.tag;return e&&this.disabled?e.length<=1&&this.slim?this.normalizeOwnChildren(e)[0]:t(n,[this.normalizeOwnChildren(e)]):this.slim?t():t(n,{class:{"v-portal":!0},style:{display:"none"},key:"v-portal-placeholder"})}}),cs=Vue.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slim:{type:Boolean,default:!1},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function(){return{transports:ss.transports,firstRender:!0}},created:function(){var t=this;this.$nextTick((function(){ss.registerTarget(t.name,t)}))},watch:{ownTransports:function(){this.$emit("change",this.children().length>0)},name:function(t,e){ss.unregisterTarget(e),ss.registerTarget(t,this)}},mounted:function(){var t=this;this.transition&&this.$nextTick((function(){t.firstRender=!1}))},beforeDestroy:function(){ss.unregisterTarget(this.name)},computed:{ownTransports:function(){var t=this.transports[this.name]||[];return this.multiple?t:0===t.length?[]:[t[t.length-1]]},passengers:function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.reduce((function(t,n){var r=n.passengers[0],i="function"==typeof r?r(e):n.passengers;return t.concat(i)}),[])}(this.ownTransports,this.slotProps)}},methods:{children:function(){return 0!==this.passengers.length?this.passengers:this.$scopedSlots.default?this.$scopedSlots.default(this.slotProps):this.$slots.default||[]},noWrapper:function(){var t=this.slim&&!this.transition;return t&&this.children().length>1&&console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."),t}},render:function(t){var e=this.noWrapper(),n=this.children(),r=this.transition||this.tag;return e?n[0]:this.slim&&!r?t():t(r,{props:{tag:this.transition&&this.tag?this.tag:void 0},class:{"vue-portal-target":!0}},n)}}),hs=0,ds=["disabled","name","order","slim","slotProps","tag","to"],us=["multiple","transition"],ps=Vue.extend({name:"MountingPortal",inheritAttrs:!1,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:!0},disabled:{type:Boolean},name:{type:String,default:function(){return"mounted_"+String(hs++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}},multiple:{type:Boolean,default:!1},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function(){if("undefined"!=typeof document){var t=document.querySelector(this.mountTo);if(t){var e=this.$props;if(ss.targets[e.name])e.bail?console.warn("[portal-vue]: Target ".concat(e.name," is already mounted.\n Aborting because 'bail: true' is set")):this.portalTarget=ss.targets[e.name];else{var n=e.append;if(n){var r="string"==typeof n?n:"DIV",i=document.createElement(r);t.appendChild(i),t=i}var o=ts(this.$props,us);o.slim=this.targetSlim,o.tag=this.targetTag,o.slotProps=this.targetSlotProps,o.name=this.to,this.portalTarget=new cs({el:t,parent:this.$parent||this,propsData:o})}}else console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document"))}},beforeDestroy:function(){var t=this.portalTarget;if(this.append){var e=t.$el;e.parentNode.removeChild(e)}t.$destroy()},render:function(t){if(!this.portalTarget)return console.warn("[portal-vue] Target wasn't mounted"),t();if(!this.$scopedSlots.manual){var e=ts(this.$props,ds);return t(as,{props:e,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots.default)}var n=this.$scopedSlots.manual({to:this.to});return Array.isArray(n)&&(n=n[0]),n||t()}});var fs={install:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.component(e.portalName||"Portal",as),t.component(e.portalTargetName||"PortalTarget",cs),t.component(e.MountingPortalName||"MountingPortal",ps)}},ms=new Map;function gs(t){var e=ms.get(t);e&&e.destroy()}function ys(t){var e=ms.get(t);e&&e.update()}var ws=null;"undefined"==typeof window?((ws=function(t){return t}).destroy=function(t){return t},ws.update=function(t){return t}):((ws=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&&!ms.has(t)){var e,n=null,r=window.getComputedStyle(t),i=(e=t.value,function(){s({testForHeightReduction:""===e||!t.value.startsWith(e),restoreTextAlign:null}),e=t.value}),o=function(e){t.removeEventListener("autosize:destroy",o),t.removeEventListener("autosize:update",l),t.removeEventListener("input",i),window.removeEventListener("resize",l),Object.keys(e).forEach((function(n){return t.style[n]=e[n]})),ms.delete(t)}.bind(t,{height:t.style.height,resize:t.style.resize,textAlign:t.style.textAlign,overflowY:t.style.overflowY,overflowX:t.style.overflowX,wordWrap:t.style.wordWrap});t.addEventListener("autosize:destroy",o),t.addEventListener("autosize:update",l),t.addEventListener("input",i),window.addEventListener("resize",l),t.style.overflowX="hidden",t.style.wordWrap="break-word",ms.set(t,{destroy:o,update:l}),l()}function s(e){var i,o,l=e.restoreTextAlign,a=void 0===l?null:l,c=e.testForHeightReduction,h=void 0===c||c,d=r.overflowY;if(0!==t.scrollHeight&&("vertical"===r.resize?t.style.resize="none":"both"===r.resize&&(t.style.resize="horizontal"),h&&(i=function(t){for(var e=[];t&&t.parentNode&&t.parentNode instanceof Element;)t.parentNode.scrollTop&&e.push([t.parentNode,t.parentNode.scrollTop]),t=t.parentNode;return function(){return e.forEach((function(t){var e=t[0],n=t[1];e.style.scrollBehavior="auto",e.scrollTop=n,e.style.scrollBehavior=null}))}}(t),t.style.height=""),o="content-box"===r.boxSizing?t.scrollHeight-(parseFloat(r.paddingTop)+parseFloat(r.paddingBottom)):t.scrollHeight+parseFloat(r.borderTopWidth)+parseFloat(r.borderBottomWidth),"none"!==r.maxHeight&&o>parseFloat(r.maxHeight)?("hidden"===r.overflowY&&(t.style.overflow="scroll"),o=parseFloat(r.maxHeight)):"hidden"!==r.overflowY&&(t.style.overflow="hidden"),t.style.height=o+"px",a&&(t.style.textAlign=a),i&&i(),n!==o&&(t.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),n=o),d!==r.overflow&&!a)){var u=r.textAlign;"hidden"===r.overflow&&(t.style.textAlign="start"===u?"end":"start"),s({restoreTextAlign:u,testForHeightReduction:!0})}}function l(){s({testForHeightReduction:!0,restoreTextAlign:null})}}(t)})),t}).destroy=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],gs),t},ws.update=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],ys),t});var vs=ws;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function bs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xs={exports:{}};xs.exports=function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",o="minute",s="hour",l="day",a="week",c="month",h="quarter",d="year",u="date",p="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},y=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},w={s:y,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function t(e,n){if(e.date()1)return t(s[0])}else{var l=e.name;b[l]=e,i=l}return!r&&i&&(v=i),i||!r&&v},M=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new C(n)},O=w;O.l=k,O.i=S,O.w=function(t,e){return M(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var C=function(){function g(t){this.$L=k(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[x]=!0}var y=g.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.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(f);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(e)}(t),this.init()},y.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()},y.$utils=function(){return O},y.isValid=function(){return!(this.$d.toString()===p)},y.isSame=function(t,e){var n=M(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return M(t)68?1900:2e3)},l=function(t){return function(e){this[t]=+e}},a=[/[+-]\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=o[t];return e&&(e.indexOf?e:e.s.concat(e.f))},h=function(t,e){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(t.indexOf(r(i,0,e))>-1){n=i>12;break}}else n=t===(e?"pm":"PM");return n},d={A:[i,function(t){this.afternoon=h(t,!1)}],a:[i,function(t){this.afternoon=h(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,l("seconds")],ss:[r,l("seconds")],m:[r,l("minutes")],mm:[r,l("minutes")],H:[r,l("hours")],h:[r,l("hours")],HH:[r,l("hours")],hh:[r,l("hours")],D:[r,l("day")],DD:[n,l("day")],Do:[i,function(t){var e=o.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,l("month")],MM:[n,l("month")],MMM:[i,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:[i,function(t){var e=c("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,l("year")],YY:[n,function(t){this.year=s(t)}],YYYY:[/\d{4}/,l("year")],Z:a,ZZ:a};function u(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(e,n,r){var o=r&&r.toUpperCase();return n||i[r]||t[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))).match(e),l=s.length,a=0;a-1)return new Date(("X"===e?1e3:1)*t);var r=u(e)(t),i=r.year,o=r.month,s=r.day,l=r.hours,a=r.minutes,c=r.seconds,h=r.milliseconds,d=r.zone,p=new Date,f=s||(i||o?1:p.getDate()),m=i||p.getFullYear(),g=0;i&&!o||(g=o>0?o-1:p.getMonth());var y=l||0,w=a||0,v=c||0,b=h||0;return d?new Date(Date.UTC(m,g,f,y,w,v,b+60*d.offset*1e3)):n?new Date(Date.UTC(m,g,f,y,w,v,b)):new Date(m,g,f,y,w,v,b)}catch(x){return new Date("")}}(e,l,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),h&&e!=this.format(l)&&(this.$d=new Date("")),o={}}else if(l instanceof Array)for(var p=l.length,f=1;f<=p;f+=1){s[1]=l[f-1];var m=n.apply(this,s);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}f===p&&(this.$d=new Date(""))}else i.call(this,t)}}}();const Ms=bs(ks.exports);function Os(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)}))}}} -/*! - * vuex v3.6.2 - * (c) 2021 Evan You - * @license MIT - */var Cs=("undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function Ns(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 i=Array.isArray(t)?[]:{};return e.push({original:t,copy:i}),Object.keys(t).forEach((function(n){i[n]=Ns(t[n],e)})),i}function Ts(t,e){Object.keys(t).forEach((function(n){return e(t[n],n)}))}function Ds(t){return null!==t&&"object"==typeof t}var Es=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)||{}},As={namespaced:{configurable:!0}};As.namespaced.get=function(){return!!this._rawModule.namespaced},Es.prototype.addChild=function(t,e){this._children[t]=e},Es.prototype.removeChild=function(t){delete this._children[t]},Es.prototype.getChild=function(t){return this._children[t]},Es.prototype.hasChild=function(t){return t in this._children},Es.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)},Es.prototype.forEachChild=function(t){Ts(this._children,t)},Es.prototype.forEachGetter=function(t){this._rawModule.getters&&Ts(this._rawModule.getters,t)},Es.prototype.forEachAction=function(t){this._rawModule.actions&&Ts(this._rawModule.actions,t)},Es.prototype.forEachMutation=function(t){this._rawModule.mutations&&Ts(this._rawModule.mutations,t)},Object.defineProperties(Es.prototype,As);var $s,Is=function(t){this.register([],t,!1)};function Rs(t,e,n){if(e.update(n),n.modules)for(var r in n.modules){if(!e.getChild(r))return;Rs(t.concat(r),e.getChild(r),n.modules[r])}}Is.prototype.get=function(t){return t.reduce((function(t,e){return t.getChild(e)}),this.root)},Is.prototype.getNamespace=function(t){var e=this.root;return t.reduce((function(t,n){return t+((e=e.getChild(n)).namespaced?n+"/":"")}),"")},Is.prototype.update=function(t){Rs([],this.root,t)},Is.prototype.register=function(t,e,n){var r=this;void 0===n&&(n=!0);var i=new Es(e,n);0===t.length?this.root=i:this.get(t.slice(0,-1)).addChild(t[t.length-1],i);e.modules&&Ts(e.modules,(function(e,i){r.register(t.concat(i),e,n)}))},Is.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)},Is.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];return!!e&&e.hasChild(n)};var zs=function(t){var e=this;void 0===t&&(t={}),!$s&&"undefined"!=typeof window&&window.Vue&&Js(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 Is(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new $s,this._makeLocalGettersCache=Object.create(null);var i=this,o=this.dispatch,s=this.commit;this.dispatch=function(t,e){return o.call(i,t,e)},this.commit=function(t,e,n){return s.call(i,t,e,n)},this.strict=r;var l=this._modules.root.state;_s(this,l,[],this._modules.root),Fs(this,l),n.forEach((function(t){return t(e)})),(void 0!==t.devtools?t.devtools:$s.config.devtools)&&function(t){Cs&&(t._devtoolHook=Cs,Cs.emit("vuex:init",t),Cs.on("vuex:travel-to-state",(function(e){t.replaceState(e)})),t.subscribe((function(t,e){Cs.emit("vuex:mutation",t,e)}),{prepend:!0}),t.subscribeAction((function(t,e){Cs.emit("vuex:action",t,e)}),{prepend:!0}))}(this)},Ps={state:{configurable:!0}};function Bs(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 Vs(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;_s(t,n,[],t._modules.root,!0),Fs(t,n,e)}function Fs(t,e,n){var r=t._vm;t.getters={},t._makeLocalGettersCache=Object.create(null);var i=t._wrappedGetters,o={};Ts(i,(function(e,n){o[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=$s.config.silent;$s.config.silent=!0,t._vm=new $s({data:{$$state:e},computed:o}),$s.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})),$s.nextTick((function(){return r.$destroy()})))}function _s(t,e,n,r,i){var o=!n.length,s=t._modules.getNamespace(n);if(r.namespaced&&(t._modulesNamespaceMap[s],t._modulesNamespaceMap[s]=r),!o&&!i){var l=Ls(e,n.slice(0,-1)),a=n[n.length-1];t._withCommit((function(){$s.set(l,a,r.state)}))}var c=r.context=function(t,e,n){var r=""===e,i={dispatch:r?t.dispatch:function(n,r,i){var o=js(n,r,i),s=o.payload,l=o.options,a=o.type;return l&&l.root||(a=e+a),t.dispatch(a,s)},commit:r?t.commit:function(n,r,i){var o=js(n,r,i),s=o.payload,l=o.options,a=o.type;l&&l.root||(a=e+a),t.commit(a,s,l)}};return Object.defineProperties(i,{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(i){if(i.slice(0,r)===e){var o=i.slice(r);Object.defineProperty(n,o,{get:function(){return t.getters[i]},enumerable:!0})}})),t._makeLocalGettersCache[e]=n}return t._makeLocalGettersCache[e]}(t,e)}},state:{get:function(){return Ls(t.state,n)}}}),i}(t,s,n);r.forEachMutation((function(e,n){!function(t,e,n,r){var i=t._mutations[e]||(t._mutations[e]=[]);i.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,i=e.handler||e;!function(t,e,n,r){var i=t._actions[e]||(t._actions[e]=[]);i.push((function(e){var i,o=n.call(t,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:t.getters,rootState:t.state},e);return(i=o)&&"function"==typeof i.then||(o=Promise.resolve(o)),t._devtoolHook?o.catch((function(e){throw t._devtoolHook.emit("vuex:error",e),e})):o}))}(t,r,i,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,o){_s(t,e,n.concat(o),r,i)}))}function Ls(t,e){return e.reduce((function(t,e){return t[e]}),t)}function js(t,e,n){return Ds(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}function Js(t){$s&&t===$s||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)}}($s=t)}Ps.state.get=function(){return this._vm._data.$$state},Ps.state.set=function(t){},zs.prototype.commit=function(t,e,n){var r=this,i=js(t,e,n),o=i.type,s=i.payload,l={type:o,payload:s},a=this._mutations[o];a&&(this._withCommit((function(){a.forEach((function(t){t(s)}))})),this._subscribers.slice().forEach((function(t){return t(l,r.state)})))},zs.prototype.dispatch=function(t,e){var n=this,r=js(t,e),i=r.type,o=r.payload,s={type:i,payload:o},l=this._actions[i];if(l){try{this._actionSubscribers.slice().filter((function(t){return t.before})).forEach((function(t){return t.before(s,n.state)}))}catch(c){}var a=l.length>1?Promise.all(l.map((function(t){return t(o)}))):l[0](o);return new Promise((function(t,e){a.then((function(e){try{n._actionSubscribers.filter((function(t){return t.after})).forEach((function(t){return t.after(s,n.state)}))}catch(c){}t(e)}),(function(t){try{n._actionSubscribers.filter((function(t){return t.error})).forEach((function(e){return e.error(s,n.state,t)}))}catch(c){}e(t)}))}))}},zs.prototype.subscribe=function(t,e){return Bs(t,this._subscribers,e)},zs.prototype.subscribeAction=function(t,e){return Bs("function"==typeof t?{before:t}:t,this._actionSubscribers,e)},zs.prototype.watch=function(t,e,n){var r=this;return this._watcherVM.$watch((function(){return t(r.state,r.getters)}),e,n)},zs.prototype.replaceState=function(t){var e=this;this._withCommit((function(){e._vm._data.$$state=t}))},zs.prototype.registerModule=function(t,e,n){void 0===n&&(n={}),"string"==typeof t&&(t=[t]),this._modules.register(t,e),_s(this,this.state,t,this._modules.get(t),n.preserveState),Fs(this,this.state)},zs.prototype.unregisterModule=function(t){var e=this;"string"==typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit((function(){var n=Ls(e.state,t.slice(0,-1));$s.delete(n,t[t.length-1])})),Vs(this)},zs.prototype.hasModule=function(t){return"string"==typeof t&&(t=[t]),this._modules.isRegistered(t)},zs.prototype.hotUpdate=function(t){this._modules.update(t),Vs(this,!0)},zs.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(zs.prototype,Ps);var Ws=Us((function(t,e){var n={};return Ys(e).forEach((function(e){var r=e.key,i=e.val;n[r]=function(){var e=this.$store.state,n=this.$store.getters;if(t){var r=Gs(this.$store,"mapState",t);if(!r)return;e=r.context.state,n=r.context.getters}return"function"==typeof i?i.call(this,e,n):e[i]},n[r].vuex=!0})),n})),qs=Us((function(t,e){var n={};return Ys(e).forEach((function(e){var r=e.key,i=e.val;n[r]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=this.$store.commit;if(t){var o=Gs(this.$store,"mapMutations",t);if(!o)return;r=o.context.commit}return"function"==typeof i?i.apply(this,[r].concat(e)):r.apply(this.$store,[i].concat(e))}})),n})),Hs=Us((function(t,e){var n={};return Ys(e).forEach((function(e){var r=e.key,i=e.val;i=t+i,n[r]=function(){if(!t||Gs(this.$store,"mapGetters",t))return this.$store.getters[i]},n[r].vuex=!0})),n})),Ks=Us((function(t,e){var n={};return Ys(e).forEach((function(e){var r=e.key,i=e.val;n[r]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=this.$store.dispatch;if(t){var o=Gs(this.$store,"mapActions",t);if(!o)return;r=o.context.dispatch}return"function"==typeof i?i.apply(this,[r].concat(e)):r.apply(this.$store,[i].concat(e))}})),n}));function Ys(t){return function(t){return Array.isArray(t)||Ds(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 Us(t){return function(e,n){return"string"!=typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function Gs(t,e,n){return t._modulesNamespaceMap[n]}function Zs(t,e,n){var r=n?t.groupCollapsed:t.group;try{r.call(t,e)}catch(i){t.log(e)}}function Xs(t){try{t.groupEnd()}catch(e){t.log("—— log end ——")}}function Qs(){var t=new Date;return" @ "+tl(t.getHours(),2)+":"+tl(t.getMinutes(),2)+":"+tl(t.getSeconds(),2)+"."+tl(t.getMilliseconds(),3)}function tl(t,e){return n="0",r=e-t.toString().length,new Array(r+1).join(n)+t;var n,r}var el={Store:zs,install:Js,version:"3.6.2",mapState:Ws,mapMutations:qs,mapGetters:Hs,mapActions:Ks,createNamespacedHelpers:function(t){return{mapState:Ws.bind(null,t),mapGetters:Hs.bind(null,t),mapMutations:qs.bind(null,t),mapActions:Ks.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 i=t.mutationTransformer;void 0===i&&(i=function(t){return t});var o=t.actionFilter;void 0===o&&(o=function(t,e){return!0});var s=t.actionTransformer;void 0===s&&(s=function(t){return t});var l=t.logMutations;void 0===l&&(l=!0);var a=t.logActions;void 0===a&&(a=!0);var c=t.logger;return void 0===c&&(c=console),function(t){var h=Ns(t.state);void 0!==c&&(l&&t.subscribe((function(t,o){var s=Ns(o);if(n(t,h,s)){var l=Qs(),a=i(t),d="mutation "+t.type+l;Zs(c,d,e),c.log("%c prev state","color: #9E9E9E; font-weight: bold",r(h)),c.log("%c mutation","color: #03A9F4; font-weight: bold",a),c.log("%c next state","color: #4CAF50; font-weight: bold",r(s)),Xs(c)}h=s})),a&&t.subscribeAction((function(t,n){if(o(t,n)){var r=Qs(),i=s(t),l="action "+t.type+r;Zs(c,l,e),c.log("%c action","color: #03A9F4; font-weight: bold",i),Xs(c)}})))}}};export{Ss as A,Ms as B,vs as C,Y as D,de as E,r as F,Os as G,el as H,ho as I,te as N,pe as P,c as S,Xt as T,Ki as a,eo as b,io as c,go as d,Ui as e,yo as f,Oo as g,No as h,Do as i,H as j,Li as k,To as l,po as m,Ci as n,it as o,co as p,Ko as q,Yo as r,no as s,ro as t,mo as u,Uo as v,Co as w,Go as x,qo as y,fs as z}; + */function Qo(e){return(Qo="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)}function es(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]&&arguments[1],n=e.to,r=e.from;if(n&&(r||!1!==t)&&this.transports[n])if(t)this.transports[n]=[];else{var i=this.$_getTransportIndex(e);if(i>=0){var o=this.transports[n].slice(0);o.splice(i,1),this.transports[n]=o}}},registerTarget:function(e,t,n){ts&&(this.trackInstances&&!n&&this.targets[e]&&console.warn("[portal-vue]: Target ".concat(e," already exists")),this.$set(this.targets,e,Object.freeze([t])))},unregisterTarget:function(e){this.$delete(this.targets,e)},registerSource:function(e,t,n){ts&&(this.trackInstances&&!n&&this.sources[e]&&console.warn("[portal-vue]: source ".concat(e," already exists")),this.$set(this.sources,e,Object.freeze([t])))},unregisterSource:function(e){this.$delete(this.sources,e)},hasTarget:function(e){return!(!this.targets[e]||!this.targets[e][0])},hasSource:function(e){return!(!this.sources[e]||!this.sources[e][0])},hasContentFor:function(e){return!!this.transports[e]&&!!this.transports[e].length},$_getTransportIndex:function(e){var t=e.to,n=e.from;for(var r in this.transports[t])if(this.transports[t][r].from===n)return+r;return-1}}}),as=new ls(rs),hs=1,cs=Vue.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function(){return String(hs++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}}},created:function(){var e=this;this.$nextTick((function(){as.registerSource(e.name,e)}))},mounted:function(){this.disabled||this.sendUpdate()},updated:function(){this.disabled?this.clear():this.sendUpdate()},beforeDestroy:function(){as.unregisterSource(this.name),this.clear()},watch:{to:function(e,t){t&&t!==e&&this.clear(t),this.sendUpdate()}},methods:{clear:function(e){var t={from:this.name,to:e||this.to};as.close(t)},normalizeSlots:function(){return this.$scopedSlots.default?[this.$scopedSlots.default]:this.$slots.default},normalizeOwnChildren:function(e){return"function"==typeof e?e(this.slotProps):e},sendUpdate:function(){var e=this.normalizeSlots();if(e){var t={from:this.name,to:this.to,passengers:es(e),order:this.order};as.open(t)}else this.clear()}},render:function(e){var t=this.$slots.default||this.$scopedSlots.default||[],n=this.tag;return t&&this.disabled?t.length<=1&&this.slim?this.normalizeOwnChildren(t)[0]:e(n,[this.normalizeOwnChildren(t)]):this.slim?e():e(n,{class:{"v-portal":!0},style:{display:"none"},key:"v-portal-placeholder"})}}),ds=Vue.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slim:{type:Boolean,default:!1},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function(){return{transports:as.transports,firstRender:!0}},created:function(){var e=this;this.$nextTick((function(){as.registerTarget(e.name,e)}))},watch:{ownTransports:function(){this.$emit("change",this.children().length>0)},name:function(e,t){as.unregisterTarget(t),as.registerTarget(e,this)}},mounted:function(){var e=this;this.transition&&this.$nextTick((function(){e.firstRender=!1}))},beforeDestroy:function(){as.unregisterTarget(this.name)},computed:{ownTransports:function(){var e=this.transports[this.name]||[];return this.multiple?e:0===e.length?[]:[e[e.length-1]]},passengers:function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.reduce((function(e,n){var r=n.passengers[0],i="function"==typeof r?r(t):n.passengers;return e.concat(i)}),[])}(this.ownTransports,this.slotProps)}},methods:{children:function(){return 0!==this.passengers.length?this.passengers:this.$scopedSlots.default?this.$scopedSlots.default(this.slotProps):this.$slots.default||[]},noWrapper:function(){var e=this.slim&&!this.transition;return e&&this.children().length>1&&console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."),e}},render:function(e){var t=this.noWrapper(),n=this.children(),r=this.transition||this.tag;return t?n[0]:this.slim&&!r?e():e(r,{props:{tag:this.transition&&this.tag?this.tag:void 0},class:{"vue-portal-target":!0}},n)}}),ps=0,us=["disabled","name","order","slim","slotProps","tag","to"],fs=["multiple","transition"],ms=Vue.extend({name:"MountingPortal",inheritAttrs:!1,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:!0},disabled:{type:Boolean},name:{type:String,default:function(){return"mounted_"+String(ps++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}},multiple:{type:Boolean,default:!1},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function(){if("undefined"!=typeof document){var e=document.querySelector(this.mountTo);if(e){var t=this.$props;if(as.targets[t.name])t.bail?console.warn("[portal-vue]: Target ".concat(t.name," is already mounted.\n Aborting because 'bail: true' is set")):this.portalTarget=as.targets[t.name];else{var n=t.append;if(n){var r="string"==typeof n?n:"DIV",i=document.createElement(r);e.appendChild(i),e=i}var o=ns(this.$props,fs);o.slim=this.targetSlim,o.tag=this.targetTag,o.slotProps=this.targetSlotProps,o.name=this.to,this.portalTarget=new ds({el:e,parent:this.$parent||this,propsData:o})}}else console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document"))}},beforeDestroy:function(){var e=this.portalTarget;if(this.append){var t=e.$el;t.parentNode.removeChild(t)}e.$destroy()},render:function(e){if(!this.portalTarget)return console.warn("[portal-vue] Target wasn't mounted"),e();if(!this.$scopedSlots.manual){var t=ns(this.$props,us);return e(cs,{props:t,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots.default)}var n=this.$scopedSlots.manual({to:this.to});return Array.isArray(n)&&(n=n[0]),n||e()}});var gs={install:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.component(t.portalName||"Portal",cs),e.component(t.portalTargetName||"PortalTarget",ds),e.component(t.MountingPortalName||"MountingPortal",ms)}},ys=new Map;function ws(e){var t=ys.get(e);t&&t.destroy()}function vs(e){var t=ys.get(e);t&&t.update()}var xs=null;"undefined"==typeof window?((xs=function(e){return e}).destroy=function(e){return e},xs.update=function(e){return e}):((xs=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&&!ys.has(e)){var t,n=null,r=window.getComputedStyle(e),i=(t=e.value,function(){s({testForHeightReduction:""===t||!e.value.startsWith(t),restoreTextAlign:null}),t=e.value}),o=function(t){e.removeEventListener("autosize:destroy",o),e.removeEventListener("autosize:update",l),e.removeEventListener("input",i),window.removeEventListener("resize",l),Object.keys(t).forEach((function(n){return e.style[n]=t[n]})),ys.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,textAlign:e.style.textAlign,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",o),e.addEventListener("autosize:update",l),e.addEventListener("input",i),window.addEventListener("resize",l),e.style.overflowX="hidden",e.style.wordWrap="break-word",ys.set(e,{destroy:o,update:l}),l()}function s(t){var i,o,l=t.restoreTextAlign,a=void 0===l?null:l,h=t.testForHeightReduction,c=void 0===h||h,d=r.overflowY;if(0!==e.scrollHeight&&("vertical"===r.resize?e.style.resize="none":"both"===r.resize&&(e.style.resize="horizontal"),c&&(i=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push([e.parentNode,e.parentNode.scrollTop]),e=e.parentNode;return function(){return t.forEach((function(e){var t=e[0],n=e[1];t.style.scrollBehavior="auto",t.scrollTop=n,t.style.scrollBehavior=null}))}}(e),e.style.height=""),o="content-box"===r.boxSizing?e.scrollHeight-(parseFloat(r.paddingTop)+parseFloat(r.paddingBottom)):e.scrollHeight+parseFloat(r.borderTopWidth)+parseFloat(r.borderBottomWidth),"none"!==r.maxHeight&&o>parseFloat(r.maxHeight)?("hidden"===r.overflowY&&(e.style.overflow="scroll"),o=parseFloat(r.maxHeight)):"hidden"!==r.overflowY&&(e.style.overflow="hidden"),e.style.height=o+"px",a&&(e.style.textAlign=a),i&&i(),n!==o&&(e.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),n=o),d!==r.overflow&&!a)){var p=r.textAlign;"hidden"===r.overflow&&(e.style.textAlign="start"===p?"end":"start"),s({restoreTextAlign:p,testForHeightReduction:!0})}}function l(){s({testForHeightReduction:!0,restoreTextAlign:null})}}(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],ws),e},xs.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],vs),e});var bs=xs;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Ss(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ks={exports:{}};ks.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",i="second",o="minute",s="hour",l="day",a="week",h="month",c="quarter",d="year",p="date",u="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},y=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},w={s:y,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function e(t,n){if(t.date()1)return e(s[0])}else{var l=t.name;x[l]=t,i=l}return!r&&i&&(v=i),i||!r&&v},M=function(e,t){if(S(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new O(n)},C=w;C.l=k,C.i=S,C.w=function(e,t){return M(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var O=function(){function g(e){this.$L=k(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[b]=!0}var y=g.prototype;return y.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(f);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.init()},y.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()},y.$utils=function(){return C},y.isValid=function(){return!(this.$d.toString()===u)},y.isSame=function(e,t){var n=M(e);return this.startOf(t)<=n&&n<=this.endOf(t)},y.isAfter=function(e,t){return M(e)68?1900:2e3)},a=function(e){return function(t){this[e]=+t}},h=[/[+-]\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=s[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=s.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},p={A:[o,function(e){this.afternoon=d(e,!1)}],a:[o,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,a("seconds")],ss:[i,a("seconds")],m:[i,a("minutes")],mm:[i,a("minutes")],H:[i,a("hours")],h:[i,a("hours")],HH:[i,a("hours")],hh:[i,a("hours")],D:[i,a("day")],DD:[r,a("day")],Do:[o,function(e){var t=s.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)}],w:[i,a("week")],ww:[r,a("week")],M:[i,a("month")],MM:[r,a("month")],MMM:[o,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:[o,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:[r,function(e){this.year=l(e)}],YYYY:[/\d{4}/,a("year")],Z:h,ZZ:h};function u(n){var r,i;r=n,i=s&&s.formats;for(var o=(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),l=o.length,a=0;a-1)return new Date(("X"===t?1e3:1)*e);var i=u(t)(e),o=i.year,s=i.month,l=i.day,a=i.hours,h=i.minutes,c=i.seconds,d=i.milliseconds,p=i.zone,f=i.week,m=new Date,g=l||(o||s?1:m.getDate()),y=o||m.getFullYear(),w=0;o&&!s||(w=s>0?s-1:m.getMonth());var v,x=a||0,b=h||0,S=c||0,k=d||0;return p?new Date(Date.UTC(y,w,g,x,b,S,k+60*p.offset*1e3)):n?new Date(Date.UTC(y,w,g,x,b,S,k)):(v=new Date(y,w,g,x,b,S,k),f&&(v=r(v).week(f).toDate()),v)}catch(M){return new Date("")}}(t,l,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),c&&t!=this.format(l)&&(this.$d=new Date("")),s={}}else if(l instanceof Array)for(var p=l.length,f=1;f<=p;f+=1){o[1]=l[f-1];var m=n.apply(this,o);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}f===p&&(this.$d=new Date(""))}else i.call(this,e)}}}();const Os=Ss(Cs.exports);function Ns(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)}))}}}export{Ms as A,Os as B,bs as C,Y as D,ut as E,r as F,Ns as G,fo as I,nt as N,mt as P,h as S,et as T,Gi as a,io as b,lo as c,wo as d,Xi as e,vo as f,No as g,Do as h,Eo as i,K as j,ji as k,Ao as l,mo as m,Di as n,ie as o,uo as p,Uo as q,Go as r,oo as s,so as t,yo as u,Zo as v,To as w,Xo as x,Ho as y,gs as z}; diff --git a/panel/dist/ui/Button.json b/panel/dist/ui/Button.json index 5bc3ddf901..c78a32c600 100644 --- a/panel/dist/ui/Button.json +++ b/panel/dist/ui/Button.json @@ -1 +1 @@ -{"displayName":"Button","description":"","tags":{"examples":[{"title":"example","content":"Save"},{"title":"example","content":"Save"}]},"props":[{"name":"disabled","description":"A disabled button/link will have no pointer events and\nthe opacity is be reduced.","type":{"name":"boolean"}},{"name":"download","description":"Whether the link should be downloaded directly","type":{"name":"boolean"}},{"name":"rel","description":"`rel` attribute for the link","type":{"name":"string"}},{"name":"tabindex","description":"Custom tabindex; only use if you really know\nhow to adjust the order properly","type":{"name":"string|number"}},{"name":"target","description":"Set the target of the link","type":{"name":"string"}},{"name":"title","description":"The title attribute can be used to add additional text\nto the button/link, which is shown on mouseover.","type":{"name":"string"}},{"name":"autofocus","description":"Sets autofocus on button (when supported by element)","type":{"name":"boolean"}},{"name":"click","description":"Pass instead of a link URL to be triggered on clicking the button","type":{"name":"func"},"defaultValue":{"value":"() => {}"}},{"name":"current","description":"Sets the `aria-current` attribute.\nEspecially useful in connection with the `link` attribute.","type":{"name":"string|boolean"}},{"name":"dialog","description":"Name/path of a dialog to open on click","type":{"name":"string"}},{"name":"drawer","description":"Name/path of a drawer to open on click","type":{"name":"string"}},{"name":"dropdown","description":"Whether the button opens a dropdown","type":{"name":"boolean"}},{"name":"element","description":"Force which HTML element to use","type":{"name":"string"}},{"name":"icon","description":"Adds an icon to the button.","type":{"name":"string"}},{"name":"id","description":"A unique id for the HTML element","type":{"name":"string|number"}},{"name":"link","description":"If the link attribute is set, the button will be represented\nas a proper `a` tag with `link`'s value as `href` attribute.","type":{"name":"string"}},{"name":"responsive","description":"A responsive button will hide the button text on smaller screens\nautomatically and only keep the icon. An icon must be set in this case.\nIf set to `text`, the icon will be hidden instead.","type":{"name":"boolean|string"}},{"name":"role","description":"`role` attribute for the button","type":{"name":"string"}},{"name":"selected","description":"Sets the `aria-selected` attribute.","type":{"name":"string|boolean"}},{"name":"size","description":"Specific sizes for button styling","tags":{"since":[{"description":"4.0.0","title":"since"}]},"values":["\"xs\"","\"sm\""],"type":{"name":"string"}},{"name":"text","description":"The button text","type":{"name":"string|number"}},{"name":"theme","description":"With the theme you can control the general design of the button.","type":{"name":"string"}},{"name":"type","description":"The type attribute sets the button type like in HTML.","tags":{},"values":["\"button\"","\"submit\"","\"reset\""],"type":{"name":"string"},"defaultValue":{"value":"\"button\""}},{"name":"variant","description":"Styling variants for the button","tags":{"since":[{"description":"4.0.0","title":"since"}]},"values":["\"filled\"","\"dimmed\""],"type":{"name":"string"}}],"events":[{"name":"click","type":{"names":["undefined"]},"description":"The button has been clicked","properties":[{"type":{"names":["PointerEvent"]},"name":"event","description":"the native click event"}]}],"methods":[{"name":"focus","description":"Focus the button","tags":{"access":[{"description":"public"}]}}],"slots":[{"name":"default","description":"The Button text. You can also use the `text` prop. Leave empty for icon buttons."}],"component":"k-button","sourceFile":"src/components/Navigation/Button.vue"} \ No newline at end of file +{"displayName":"Button","description":"","tags":{"examples":[{"title":"example","content":"Save"},{"title":"example","content":"Save"}]},"props":[{"name":"disabled","description":"A disabled button/link will have no pointer events and\nthe opacity is be reduced.","type":{"name":"boolean"}},{"name":"download","description":"Whether the link should be downloaded directly","type":{"name":"boolean"}},{"name":"rel","description":"`rel` attribute for the link","type":{"name":"string"}},{"name":"tabindex","description":"Custom tabindex; only use if you really know\nhow to adjust the order properly","type":{"name":"string|number"}},{"name":"target","description":"Set the target of the link","type":{"name":"string"}},{"name":"title","description":"The title attribute can be used to add additional text\nto the button/link, which is shown on mouseover.","type":{"name":"string"}},{"name":"autofocus","description":"Sets autofocus on button (when supported by element)","type":{"name":"boolean"}},{"name":"badge","description":"Display a (colored) badge on the top-right of the button","tags":{"value":[{"description":"{ text, theme }","title":"value"}],"example":[{"description":"{ text: 5, theme: \"positive\" }","title":"example"}],"since":[{"description":"5.0.0","title":"since"}]},"type":{"name":"object"}},{"name":"click","description":"Pass instead of a link URL to be triggered on clicking the button","type":{"name":"func"},"defaultValue":{"value":"() => {}"}},{"name":"current","description":"Sets the `aria-current` attribute.\nEspecially useful in connection with the `link` attribute.","type":{"name":"string|boolean"}},{"name":"dialog","description":"Name/path of a dialog to open on click","type":{"name":"string"}},{"name":"drawer","description":"Name/path of a drawer to open on click","type":{"name":"string"}},{"name":"dropdown","description":"Whether the button opens a dropdown","type":{"name":"boolean"}},{"name":"element","description":"Force which HTML element to use","type":{"name":"string"}},{"name":"icon","description":"Adds an icon to the button.","type":{"name":"string"}},{"name":"id","description":"A unique id for the HTML element","type":{"name":"string|number"}},{"name":"link","description":"If the link attribute is set, the button will be represented\nas a proper `a` tag with `link`'s value as `href` attribute.","type":{"name":"string"}},{"name":"responsive","description":"A responsive button will hide the button text on smaller screens\nautomatically and only keep the icon. An icon must be set in this case.\nIf set to `text`, the icon will be hidden instead.","type":{"name":"boolean|string"}},{"name":"role","description":"`role` attribute for the button","type":{"name":"string"}},{"name":"selected","description":"Sets the `aria-selected` attribute.","type":{"name":"string|boolean"}},{"name":"size","description":"Specific sizes for button styling","tags":{"since":[{"description":"4.0.0","title":"since"}]},"values":["\"xs\"","\"sm\""],"type":{"name":"string"}},{"name":"text","description":"The button text","type":{"name":"string|number"}},{"name":"theme","description":"With the theme you can control the general design of the button.","type":{"name":"string"}},{"name":"type","description":"The type attribute sets the button type like in HTML.","tags":{},"values":["\"button\"","\"submit\"","\"reset\""],"type":{"name":"string"},"defaultValue":{"value":"\"button\""}},{"name":"variant","description":"Styling variants for the button","tags":{"since":[{"description":"4.0.0","title":"since"}]},"values":["\"filled\"","\"dimmed\""],"type":{"name":"string"}}],"events":[{"name":"click","type":{"names":["undefined"]},"description":"The button has been clicked","properties":[{"type":{"names":["PointerEvent"]},"name":"event","description":"the native click event"}]}],"methods":[{"name":"focus","description":"Focus the button","tags":{"access":[{"description":"public"}]}}],"slots":[{"name":"default","description":"The Button text. You can also use the `text` prop. Leave empty for icon buttons."}],"component":"k-button","sourceFile":"src/components/Navigation/Button.vue"} \ No newline at end of file diff --git a/panel/dist/ui/ChangesDialog.json b/panel/dist/ui/ChangesDialog.json index 4db8c75f77..c1146b33e5 100644 --- a/panel/dist/ui/ChangesDialog.json +++ b/panel/dist/ui/ChangesDialog.json @@ -1 +1 @@ -{"displayName":"ChangesDialog","description":"","tags":{"since":[{"description":"4.0.0","title":"since"}]},"props":[{"name":"cancelButton","description":"Options for the cancel button","type":{"name":"boolean"},"defaultValue":{"value":"false"}},{"name":"disabled","description":"Whether to disable the submit button","tags":{"deprecated":[{"description":"4.0.0 use the `submit-button` prop instead","title":"deprecated"}]},"type":{"name":"boolean"},"defaultValue":{"value":"false"}},{"name":"icon","description":"The icon type for the submit button","tags":{"deprecated":[{"description":"4.0.0 use the `submit-button` prop instead","title":"deprecated"}]},"type":{"name":"string"},"defaultValue":{"value":"\"check\""}},{"name":"submitButton","description":"Options for the submit button","type":{"name":"boolean"},"defaultValue":{"value":"false"}},{"name":"theme","description":"The theme of the submit button","tags":{"deprecated":[{"description":"4.0.0 use the `submit-button` prop instead","title":"deprecated"}]},"values":["\"positive\"","\"negative\""],"type":{"name":"string"},"defaultValue":{"value":"\"positive\""}},{"name":"size","description":"Width of the dialog","tags":{},"values":["\"small\"","\"default\"","\"medium\"","\"large\"","\"huge\""],"type":{"name":"string"},"defaultValue":{"value":"\"medium\""}},{"name":"visible","type":{"name":"boolean"},"defaultValue":{"value":"false"}},{"name":"changes","type":{"name":"array"}},{"name":"loading","type":{"name":"boolean"}}],"events":[{"name":"cancel"},{"name":"close"},{"name":"input","type":{"names":["undefined"]}},{"name":"submit","type":{"names":["undefined"]},"description":"The submit button is clicked or the form is submitted."},{"name":"success","type":{"names":["undefined"]}}],"methods":[{"name":"cancel","description":"Triggers the `@cancel` event and closes the dialog.","tags":{"access":[{"description":"public"}]}},{"name":"close","description":"Triggers the `@close` event and closes the dialog.","tags":{"access":[{"description":"public"}]}},{"name":"focus","description":"Sets the focus on the first usable input\nor a given input by name","params":[{"name":"input","type":{"name":"String"}}],"tags":{"access":[{"description":"public"}],"params":[{"title":"param","type":{"name":"String"},"name":"input"}]}},{"name":"input","description":"Updates the dialog values","params":[{"name":"value","type":{"name":"Object"},"description":"new values"}],"tags":{"access":[{"description":"public"}],"params":[{"title":"param","type":{"name":"Object"},"name":"value","description":"new values"}]}},{"name":"open","description":"Opens the dialog and triggers the `@open` event.\nUse ready to fire events that should be run as\nsoon as the dialog is open","tags":{"access":[{"description":"public"}]}}],"component":"k-changes-dialog","sourceFile":"src/components/Dialogs/ChangesDialog.vue"} \ No newline at end of file +{"displayName":"ChangesDialog","description":"","tags":{"since":[{"description":"4.0.0","title":"since"}]},"props":[{"name":"cancelButton","description":"Options for the cancel button","type":{"name":"boolean"},"defaultValue":{"value":"false"}},{"name":"disabled","description":"Whether to disable the submit button","tags":{"deprecated":[{"description":"4.0.0 use the `submit-button` prop instead","title":"deprecated"}]},"type":{"name":"boolean"},"defaultValue":{"value":"false"}},{"name":"icon","description":"The icon type for the submit button","tags":{"deprecated":[{"description":"4.0.0 use the `submit-button` prop instead","title":"deprecated"}]},"type":{"name":"string"},"defaultValue":{"value":"\"check\""}},{"name":"submitButton","description":"Options for the submit button","type":{"name":"boolean"},"defaultValue":{"value":"false"}},{"name":"theme","description":"The theme of the submit button","tags":{"deprecated":[{"description":"4.0.0 use the `submit-button` prop instead","title":"deprecated"}]},"values":["\"positive\"","\"negative\""],"type":{"name":"string"},"defaultValue":{"value":"\"positive\""}},{"name":"size","description":"Width of the dialog","tags":{},"values":["\"small\"","\"default\"","\"medium\"","\"large\"","\"huge\""],"type":{"name":"string"},"defaultValue":{"value":"\"medium\""}},{"name":"visible","type":{"name":"boolean"},"defaultValue":{"value":"false"}},{"name":"files","type":{"name":"array"},"defaultValue":{"value":"[]"}},{"name":"pages","type":{"name":"array"},"defaultValue":{"value":"[]"}},{"name":"users","type":{"name":"array"},"defaultValue":{"value":"[]"}}],"events":[{"name":"cancel"},{"name":"close"},{"name":"input","type":{"names":["undefined"]}},{"name":"submit","type":{"names":["undefined"]},"description":"The submit button is clicked or the form is submitted."},{"name":"success","type":{"names":["undefined"]}}],"methods":[{"name":"cancel","description":"Triggers the `@cancel` event and closes the dialog.","tags":{"access":[{"description":"public"}]}},{"name":"close","description":"Triggers the `@close` event and closes the dialog.","tags":{"access":[{"description":"public"}]}},{"name":"focus","description":"Sets the focus on the first usable input\nor a given input by name","params":[{"name":"input","type":{"name":"String"}}],"tags":{"access":[{"description":"public"}],"params":[{"title":"param","type":{"name":"String"},"name":"input"}]}},{"name":"input","description":"Updates the dialog values","params":[{"name":"value","type":{"name":"Object"},"description":"new values"}],"tags":{"access":[{"description":"public"}],"params":[{"title":"param","type":{"name":"Object"},"name":"value","description":"new values"}]}},{"name":"open","description":"Opens the dialog and triggers the `@open` event.\nUse ready to fire events that should be run as\nsoon as the dialog is open","tags":{"access":[{"description":"public"}]}}],"component":"k-changes-dialog","sourceFile":"src/components/Dialogs/ChangesDialog.vue"} \ No newline at end of file diff --git a/panel/dist/ui/ColoroptionsInput.json b/panel/dist/ui/ColoroptionsInput.json index e8ab75be84..d75c3bde37 100644 --- a/panel/dist/ui/ColoroptionsInput.json +++ b/panel/dist/ui/ColoroptionsInput.json @@ -1 +1 @@ -{"displayName":"ColoroptionsInput","description":"","tags":{"since":[{"description":"4.0.0","title":"since"}],"examples":[{"title":"example","content":""}]},"props":[{"name":"autofocus","description":"Sets the focus on this field when the form loads. Only the first field with this label gets","type":{"name":"boolean"}},{"name":"disabled","description":"If `true`, the field is no longer editable and will not be saved","type":{"name":"boolean"}},{"name":"id","description":"A unique ID. The component `_uid` will be used as default.","type":{"name":"number|string"},"defaultValue":{"value":"function() {\n return this._uid;\n}"}},{"name":"name","description":"A unique name for the input","type":{"name":"number|string"}},{"name":"required","description":"If `true`, the field has to be filled in correctly to be submitted","type":{"name":"boolean"}},{"name":"options","description":"An array of option objects","tags":{"value":[{"description":"{ value, text, info }","title":"value"}]},"type":{"name":"array"},"defaultValue":{"value":"[]"}},{"name":"columns","type":{"name":"number"}},{"name":"reset","type":{"name":"boolean"},"defaultValue":{"value":"true"}},{"name":"theme","type":{"name":"string"}},{"name":"value","type":{"name":"string"}},{"name":"format","tags":{},"values":["\"hex\"","\"rgb\"","\"hsl\""],"type":{"name":"string"},"defaultValue":{"value":"\"hex\""}}],"events":[{"name":"input","type":{"names":["undefined"]}}],"methods":[{"name":"focus","description":"Focuses the input element","tags":{"access":[{"description":"public"}]}}],"component":"k-coloroptions-input","sourceFile":"src/components/Forms/Input/ColoroptionsInput.vue"} \ No newline at end of file +{"displayName":"ColoroptionsInput","description":"","tags":{"since":[{"description":"4.0.0","title":"since"}],"examples":[{"title":"example","content":""}]},"props":[{"name":"autofocus","description":"Sets the focus on this field when the form loads. Only the first field with this label gets","type":{"name":"boolean"}},{"name":"disabled","description":"If `true`, the field is no longer editable and will not be saved","type":{"name":"boolean"}},{"name":"id","description":"A unique ID. The component `_uid` will be used as default.","type":{"name":"number|string"},"defaultValue":{"value":"function() {\n return this._uid;\n}"}},{"name":"name","description":"A unique name for the input","type":{"name":"number|string"}},{"name":"required","description":"If `true`, the field has to be filled in correctly to be submitted","type":{"name":"boolean"}},{"name":"options","description":"An array of option objects","tags":{"value":[{"description":"{ value, text, info }","title":"value"}]},"type":{"name":"array"},"defaultValue":{"value":"[]"}},{"name":"columns","type":{"name":"number"},"defaultValue":{"value":"1"}},{"name":"reset","type":{"name":"boolean"},"defaultValue":{"value":"true"}},{"name":"theme","type":{"name":"string"}},{"name":"value","type":{"name":"string"}},{"name":"format","tags":{},"values":["\"hex\"","\"rgb\"","\"hsl\""],"type":{"name":"string"},"defaultValue":{"value":"\"hex\""}}],"events":[{"name":"input","type":{"names":["undefined"]}}],"methods":[{"name":"focus","description":"Focuses the input element","tags":{"access":[{"description":"public"}]}}],"component":"k-coloroptions-input","sourceFile":"src/components/Forms/Input/ColoroptionsInput.vue"} \ No newline at end of file diff --git a/panel/dist/ui/DropdownContent.json b/panel/dist/ui/DropdownContent.json index 3d2132df2f..acc36d4425 100644 --- a/panel/dist/ui/DropdownContent.json +++ b/panel/dist/ui/DropdownContent.json @@ -1 +1 @@ -{"description":"Dropdowns are constructed with two elements: `` holds any content shown when opening the dropdown: any number of `` elements or any other HTML; typically a `` then is used to call the `toggle()` method on ``.","tags":{"todo":[{"description":"rename to `k-dropdown` in v6 (with alias to old name)","title":"todo"}]},"displayName":"DropdownContent","props":[{"name":"align","tags":{"deprecated":[{"description":"4.0.0 Use `align-x` instead","title":"deprecated"}],"todo":[{"description":"rename `axis` data to `align` when removed","title":"todo"}]},"type":{"name":"string"}},{"name":"alignX","description":"Default horizontal alignment of the dropdown","tags":{"since":[{"description":"4.0.0","title":"since"}]},"values":["\"start\"","\"end\"","\"center\""],"type":{"name":"string"},"defaultValue":{"value":"\"start\""}},{"name":"alignY","description":"Default vertical alignment of the dropdown","tags":{"since":[{"description":"4.0.0","title":"since"}]},"values":["\"top\"","\"bottom\""],"type":{"name":"string"},"defaultValue":{"value":"\"bottom\""}},{"name":"disabled","tags":{"since":[{"description":"4.0.0","title":"since"}]},"type":{"name":"boolean"},"defaultValue":{"value":"false"}},{"name":"navigate","tags":{"since":[{"description":"4.0.0","title":"since"}]},"type":{"name":"boolean"},"defaultValue":{"value":"true"}},{"name":"options","type":{"name":"array|func|string"}},{"name":"theme","description":"Visual theme of the dropdown","tags":{},"values":["\"dark\"","\"light\""],"type":{"name":"string"},"defaultValue":{"value":"\"dark\""}}],"events":[{"name":"action","type":{"names":["undefined"]}},{"name":"close","description":"When the dropdown content is closed"},{"name":"open","description":"When the dropdown content is opened"}],"methods":[{"name":"close","description":"Closes the dropdown","tags":{"access":[{"description":"public"}]}},{"name":"open","description":"Opens the dropdown","params":[{"name":"opener"}],"tags":{"access":[{"description":"public"}]}},{"name":"toggle","description":"Toggles the open state of the dropdown","params":[{"name":"opener"}],"tags":{"access":[{"description":"public"}]}}],"slots":[{"name":"default","description":"Content of the dropdown which overrides passed `options` prop"}],"component":"k-dropdown-content","sourceFile":"src/components/Dropdowns/DropdownContent.vue"} \ No newline at end of file +{"description":"Dropdowns are constructed with two elements: `` holds any content shown when opening the dropdown: any number of `` elements or any other HTML; typically a `` then is used to call the `toggle()` method on ``.","tags":{"todo":[{"description":"rename to `k-dropdown` in v6 (with alias to old name)","title":"todo"}]},"displayName":"DropdownContent","props":[{"name":"align","tags":{"deprecated":[{"description":"4.0.0 Use `align-x` instead","title":"deprecated"}],"todo":[{"description":"rename `axis` data to `align` when removed","title":"todo"}]},"type":{"name":"string"}},{"name":"alignX","description":"Default horizontal alignment of the dropdown","tags":{"since":[{"description":"4.0.0","title":"since"}]},"values":["\"start\"","\"end\"","\"center\""],"type":{"name":"string"},"defaultValue":{"value":"\"start\""}},{"name":"alignY","description":"Default vertical alignment of the dropdown","tags":{"since":[{"description":"4.0.0","title":"since"}]},"values":["\"top\"","\"bottom\""],"type":{"name":"string"},"defaultValue":{"value":"\"bottom\""}},{"name":"disabled","tags":{"since":[{"description":"4.0.0","title":"since"}]},"type":{"name":"boolean"},"defaultValue":{"value":"false"}},{"name":"navigate","tags":{"since":[{"description":"4.0.0","title":"since"}]},"type":{"name":"boolean"},"defaultValue":{"value":"true"}},{"name":"options","type":{"name":"array|func|string"}},{"name":"theme","description":"Visual theme of the dropdown","tags":{},"values":["\"dark\"","\"light\""],"type":{"name":"string"},"defaultValue":{"value":"\"dark\""}}],"events":[{"name":"action","type":{"names":["undefined"]}},{"name":"close","description":"When the dropdown content is closed"},{"name":"open","description":"When the dropdown content is opened"}],"methods":[{"name":"close","description":"Closes the dropdown","tags":{"access":[{"description":"public"}]}},{"name":"open","description":"Opens the dropdown","params":[{"name":"opener"}],"tags":{"access":[{"description":"public"}]}},{"name":"toggle","description":"Toggles the open state of the dropdown","params":[{"name":"opener"}],"tags":{"access":[{"description":"public"}]}}],"slots":[{"name":"default","scoped":true,"description":"Content of the dropdown which overrides passed `options` prop","bindings":[{"name":"items","title":"binding"}]},{"name":"item","scoped":true,"bindings":[{"name":"item","title":"binding"},{"name":"index","title":"binding"}]}],"component":"k-dropdown-content","sourceFile":"src/components/Dropdowns/DropdownContent.vue"} \ No newline at end of file diff --git a/panel/dist/ui/FilePreview.json b/panel/dist/ui/FilePreview.json index be39e48508..7bc011aa7e 100644 --- a/panel/dist/ui/FilePreview.json +++ b/panel/dist/ui/FilePreview.json @@ -1 +1 @@ -{"description":"Wrapper for file view previews","tags":{"since":[{"description":"5.0.0","title":"since"}]},"displayName":"FilePreview","props":[{"name":"component","type":{"name":"string"}},{"name":"content","type":{"name":"object"}},{"name":"props","type":{"name":"object"}}],"events":[{"name":"input"},{"name":"submit"}],"component":"k-file-preview","sourceFile":"src/components/Views/Files/FilePreview.vue"} \ No newline at end of file +{"description":"Wrapper for file view previews","tags":{"since":[{"description":"5.0.0","title":"since"}]},"displayName":"FilePreview","props":[{"name":"component","type":{"name":"string"}},{"name":"content","type":{"name":"object"}},{"name":"isLocked","type":{"name":"boolean"}},{"name":"props","type":{"name":"object"}}],"events":[{"name":"input"},{"name":"submit"}],"component":"k-file-preview","sourceFile":"src/components/Views/Files/FilePreview.vue"} \ No newline at end of file diff --git a/panel/dist/ui/FormButtons.json b/panel/dist/ui/FormButtons.json deleted file mode 100644 index 20544a3630..0000000000 --- a/panel/dist/ui/FormButtons.json +++ /dev/null @@ -1 +0,0 @@ -{"displayName":"FormButtons","description":"","tags":{},"events":[{"name":"discard"},{"name":"submit"}],"component":"k-form-buttons","sourceFile":"src/components/Forms/FormButtons.vue"} \ No newline at end of file diff --git a/panel/dist/ui/FormControls.json b/panel/dist/ui/FormControls.json index 220374ffb9..a5f5ce381e 100644 --- a/panel/dist/ui/FormControls.json +++ b/panel/dist/ui/FormControls.json @@ -1 +1 @@ -{"description":"","displayName":"FormControls","tags":{"since":[{"description":"5.0.0","title":"since"}]},"props":[{"name":"isDraft","description":"Whether the model is currently a draft","type":{"name":"boolean"}},{"name":"isLocked","description":"Whether the content is locked, and if, by whom","type":{"name":"string|boolean"}},{"name":"isPublished","description":"Whether the content is fully published (no changes)","type":{"name":"boolean"}},{"name":"isSaved","description":"Whether all content are saved","type":{"name":"boolean"}},{"name":"preview","description":"Optional URL for preview dropdown entry","type":{"name":"string"}}],"events":[{"name":"discard"},{"name":"publish"},{"name":"save"}],"component":"k-form-controls","sourceFile":"src/components/Forms/Controls/Controls.vue"} \ No newline at end of file +{"description":"","displayName":"FormControls","tags":{"since":[{"description":"5.0.0","title":"since"}]},"props":[{"name":"editor","type":{"name":"string"}},{"name":"hasChanges","type":{"name":"boolean"}},{"name":"isLocked","type":{"name":"boolean"}},{"name":"modified","type":{"name":"string|date"}},{"name":"preview","description":"Preview URL for changes","type":{"name":"string|boolean"}}],"events":[{"name":"discard"},{"name":"submit"}],"component":"k-form-controls","sourceFile":"src/components/Forms/FormControls.vue"} \ No newline at end of file diff --git a/panel/dist/ui/ImageFilePreview.json b/panel/dist/ui/ImageFilePreview.json index 4abb20c859..5f1f03d97a 100644 --- a/panel/dist/ui/ImageFilePreview.json +++ b/panel/dist/ui/ImageFilePreview.json @@ -1 +1 @@ -{"description":"File view preview for image files","tags":{"since":[{"description":"5.0.0","title":"since"}]},"displayName":"ImageFilePreview","props":[{"name":"content","type":{"name":"object"}},{"name":"details","type":{"name":"array"}},{"name":"focusable","type":{"name":"boolean"}},{"name":"image","type":{"name":"object"},"defaultValue":{"value":"{}"}},{"name":"url","type":{"name":"string"}}],"events":[{"name":"focus"},{"name":"input","type":{"names":["undefined"]}}],"component":"k-image-file-preview","sourceFile":"src/components/Views/Files/ImageFilePreview.vue"} \ No newline at end of file +{"description":"File view preview for image files","tags":{"since":[{"description":"5.0.0","title":"since"}]},"displayName":"ImageFilePreview","props":[{"name":"content","type":{"name":"object"},"defaultValue":{"value":"{}"}},{"name":"details","type":{"name":"array"}},{"name":"focusable","type":{"name":"boolean"}},{"name":"image","type":{"name":"object"},"defaultValue":{"value":"{}"}},{"name":"isLocked","type":{"name":"boolean"}},{"name":"url","type":{"name":"string"}}],"events":[{"name":"focus"},{"name":"input","type":{"names":["undefined"]}}],"component":"k-image-file-preview","sourceFile":"src/components/Views/Files/ImageFilePreview.vue"} \ No newline at end of file diff --git a/panel/dist/ui/ModelTabs.json b/panel/dist/ui/ModelTabs.json index c5623924ca..b3e5cbaa32 100644 --- a/panel/dist/ui/ModelTabs.json +++ b/panel/dist/ui/ModelTabs.json @@ -1 +1 @@ -{"description":"","tags":{"since":[{"description":"4.0.0","title":"since"}]},"displayName":"ModelTabs","props":[{"name":"tab","type":{"name":"string"}},{"name":"tabs","type":{"name":"array"},"defaultValue":{"value":"[]"}}],"component":"k-model-tabs","sourceFile":"src/components/Navigation/ModelTabs.vue"} \ No newline at end of file +{"description":"","tags":{"since":[{"description":"4.0.0","title":"since"}]},"displayName":"ModelTabs","props":[{"name":"changes","type":{"name":"object"}},{"name":"tab","type":{"name":"string"}},{"name":"tabs","type":{"name":"array"},"defaultValue":{"value":"[]"}}],"component":"k-model-tabs","sourceFile":"src/components/Navigation/ModelTabs.vue"} \ No newline at end of file diff --git a/panel/dist/ui/RadioField.json b/panel/dist/ui/RadioField.json index 1313d51a04..33dd6dc437 100644 --- a/panel/dist/ui/RadioField.json +++ b/panel/dist/ui/RadioField.json @@ -1 +1 @@ -{"displayName":"RadioField","description":"Have a look at ``, `` and `` for additional information.","tags":{},"props":[{"name":"disabled","description":"If `true`, the field is no longer editable and will not be saved","type":{"name":"boolean"}},{"name":"help","description":"Optional help text below the field","type":{"name":"string"}},{"name":"id","description":"A unique ID. The component `_uid` will be used as default.","type":{"name":"number|string"},"defaultValue":{"value":"function() {\n return this._uid;\n}"}},{"name":"label","description":"A descriptive label for the field","type":{"name":"string"}},{"name":"name","description":"A unique name for the input","type":{"name":"number|string"}},{"name":"required","description":"If `true`, the field has to be filled in correctly to be submitted","type":{"name":"boolean"}},{"name":"counter","type":{"name":"boolean|object"}},{"name":"endpoints","type":{"name":"object"}},{"name":"input","type":{"name":"string|number"}},{"name":"translate","type":{"name":"boolean"}},{"name":"type","type":{"name":"string"}},{"name":"after","description":"Optional text that will be shown after the input","type":{"name":"string"}},{"name":"before","description":"Optional text that will be shown before the input","type":{"name":"string"}},{"name":"autofocus","type":{"name":"boolean"}},{"name":"icon","type":{"name":"string|boolean"}},{"name":"value","type":{"name":"string|number|boolean"},"defaultValue":{"value":"null"}},{"name":"options","description":"An array of option objects","tags":{"value":[{"description":"{ value, text, info }","title":"value"}]},"type":{"name":"array"},"defaultValue":{"value":"[]"}},{"name":"columns","type":{"name":"number"}},{"name":"reset","type":{"name":"boolean"},"defaultValue":{"value":"true"}},{"name":"theme","type":{"name":"string"}}],"events":[{"name":"input"},{"name":"focus"},{"name":"blur"}],"slots":[{"name":"header"},{"name":"label"},{"name":"options"},{"name":"counter"},{"name":"default"},{"name":"footer"},{"name":"help"},{"name":"before"},{"name":"after"},{"name":"icon"}],"component":"k-radio-field","sourceFile":"src/components/Forms/Field/RadioField.vue"} \ No newline at end of file +{"displayName":"RadioField","description":"Have a look at ``, `` and `` for additional information.","tags":{},"props":[{"name":"disabled","description":"If `true`, the field is no longer editable and will not be saved","type":{"name":"boolean"}},{"name":"help","description":"Optional help text below the field","type":{"name":"string"}},{"name":"id","description":"A unique ID. The component `_uid` will be used as default.","type":{"name":"number|string"},"defaultValue":{"value":"function() {\n return this._uid;\n}"}},{"name":"label","description":"A descriptive label for the field","type":{"name":"string"}},{"name":"name","description":"A unique name for the input","type":{"name":"number|string"}},{"name":"required","description":"If `true`, the field has to be filled in correctly to be submitted","type":{"name":"boolean"}},{"name":"counter","type":{"name":"boolean|object"}},{"name":"endpoints","type":{"name":"object"}},{"name":"input","type":{"name":"string|number"}},{"name":"translate","type":{"name":"boolean"}},{"name":"type","type":{"name":"string"}},{"name":"after","description":"Optional text that will be shown after the input","type":{"name":"string"}},{"name":"before","description":"Optional text that will be shown before the input","type":{"name":"string"}},{"name":"autofocus","type":{"name":"boolean"}},{"name":"icon","type":{"name":"string|boolean"}},{"name":"value","type":{"name":"string|number|boolean"},"defaultValue":{"value":"null"}},{"name":"options","description":"An array of option objects","tags":{"value":[{"description":"{ value, text, info }","title":"value"}]},"type":{"name":"array"},"defaultValue":{"value":"[]"}},{"name":"columns","type":{"name":"number"},"defaultValue":{"value":"1"}},{"name":"reset","type":{"name":"boolean"},"defaultValue":{"value":"true"}},{"name":"theme","type":{"name":"string"}}],"events":[{"name":"input"},{"name":"focus"},{"name":"blur"}],"slots":[{"name":"header"},{"name":"label"},{"name":"options"},{"name":"counter"},{"name":"default"},{"name":"footer"},{"name":"help"},{"name":"before"},{"name":"after"},{"name":"icon"}],"component":"k-radio-field","sourceFile":"src/components/Forms/Field/RadioField.vue"} \ No newline at end of file diff --git a/panel/dist/ui/RadioInput.json b/panel/dist/ui/RadioInput.json index 713a40fc77..86d32e750e 100644 --- a/panel/dist/ui/RadioInput.json +++ b/panel/dist/ui/RadioInput.json @@ -1 +1 @@ -{"displayName":"RadioInput","description":"","tags":{},"props":[{"name":"autofocus","description":"Sets the focus on this field when the form loads. Only the first field with this label gets","type":{"name":"boolean"}},{"name":"disabled","description":"If `true`, the field is no longer editable and will not be saved","type":{"name":"boolean"}},{"name":"id","description":"A unique ID. The component `_uid` will be used as default.","type":{"name":"number|string"},"defaultValue":{"value":"function() {\n return this._uid;\n}"}},{"name":"name","description":"A unique name for the input","type":{"name":"number|string"}},{"name":"required","description":"If `true`, the field has to be filled in correctly to be submitted","type":{"name":"boolean"}},{"name":"options","description":"An array of option objects","tags":{"value":[{"description":"{ value, text, info }","title":"value"}]},"type":{"name":"array"},"defaultValue":{"value":"[]"}},{"name":"columns","type":{"name":"number"}},{"name":"reset","type":{"name":"boolean"},"defaultValue":{"value":"true"}},{"name":"theme","type":{"name":"string"}},{"name":"value","type":{"name":"string|number|boolean"}}],"events":[{"name":"input","type":{"names":["undefined"]}}],"methods":[{"name":"focus","description":"Focuses the input element","tags":{"access":[{"description":"public"}]}}],"component":"k-radio-input","sourceFile":"src/components/Forms/Input/RadioInput.vue"} \ No newline at end of file +{"displayName":"RadioInput","description":"","tags":{},"props":[{"name":"autofocus","description":"Sets the focus on this field when the form loads. Only the first field with this label gets","type":{"name":"boolean"}},{"name":"disabled","description":"If `true`, the field is no longer editable and will not be saved","type":{"name":"boolean"}},{"name":"id","description":"A unique ID. The component `_uid` will be used as default.","type":{"name":"number|string"},"defaultValue":{"value":"function() {\n return this._uid;\n}"}},{"name":"name","description":"A unique name for the input","type":{"name":"number|string"}},{"name":"required","description":"If `true`, the field has to be filled in correctly to be submitted","type":{"name":"boolean"}},{"name":"options","description":"An array of option objects","tags":{"value":[{"description":"{ value, text, info }","title":"value"}]},"type":{"name":"array"},"defaultValue":{"value":"[]"}},{"name":"columns","type":{"name":"number"},"defaultValue":{"value":"1"}},{"name":"reset","type":{"name":"boolean"},"defaultValue":{"value":"true"}},{"name":"theme","type":{"name":"string"}},{"name":"value","type":{"name":"string|number|boolean"}}],"events":[{"name":"input","type":{"names":["undefined"]}}],"methods":[{"name":"focus","description":"Focuses the input element","tags":{"access":[{"description":"public"}]}}],"component":"k-radio-input","sourceFile":"src/components/Forms/Input/RadioInput.vue"} \ No newline at end of file diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 4d6180ed13..10b7bb04f9 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,9 +1,9 @@ array( 'name' => 'getkirby/cms', - 'pretty_version' => '5.0.0-alpha.3', - 'version' => '5.0.0.0-alpha3', - 'reference' => NULL, + 'pretty_version' => '5.0.0-alpha.4', + 'version' => '5.0.0.0-alpha4', + 'reference' => null, 'type' => 'kirby-cms', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -47,9 +47,9 @@ 'dev_requirement' => false, ), 'getkirby/cms' => array( - 'pretty_version' => '5.0.0-alpha.3', - 'version' => '5.0.0.0-alpha3', - 'reference' => NULL, + 'pretty_version' => '5.0.0-alpha.4', + 'version' => '5.0.0.0-alpha4', + 'reference' => null, 'type' => 'kirby-cms', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), From e419d79787e37f219b89d37a56c354349b021533 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Wed, 20 Nov 2024 18:10:10 +0100 Subject: [PATCH 262/362] User create dialog: Fix `role` default Fixes #6801 --- config/areas/users/dialogs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/areas/users/dialogs.php b/config/areas/users/dialogs.php index b26f21e47a..22a3180fff 100644 --- a/config/areas/users/dialogs.php +++ b/config/areas/users/dialogs.php @@ -54,7 +54,7 @@ 'email' => '', 'password' => '', 'translation' => $kirby->panelLanguage(), - 'role' => $role ?? $roles['options'][0]['value'] ?? null + 'role' => $role ?: $roles['options'][0]['value'] ?? null ] ] ]; From 6f09481bdfbff9fdd4eaca6f293ba817f8962857 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 15 Aug 2024 17:19:21 +0200 Subject: [PATCH 263/362] `Xml::attr()`: remove deprecated code --- src/Cms/Helpers.php | 8 +------- src/Toolkit/Xml.php | 10 ---------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/Cms/Helpers.php b/src/Cms/Helpers.php index 895c579cac..257c8d682f 100644 --- a/src/Cms/Helpers.php +++ b/src/Cms/Helpers.php @@ -43,13 +43,7 @@ class Helpers // Some of them can be replaced by using `Version` class methods instead // (see method comments). `Content\Translation::contentFile` should be avoided // entirely and has no recommended replacement. - 'translation-methods' => true, - - // Passing a single space as value to `Xml::attr()` has been - // deprecated. In a future version, passing a single space won't - // render an empty value anymore but a single space. - // To render an empty value, please pass an empty string. - 'xml-attr-single-space' => true, + 'translation-methods' => true ]; /** diff --git a/src/Toolkit/Xml.php b/src/Toolkit/Xml.php index fddb0a3079..15dc9eac25 100644 --- a/src/Toolkit/Xml.php +++ b/src/Toolkit/Xml.php @@ -2,7 +2,6 @@ namespace Kirby\Toolkit; -use Kirby\Cms\Helpers; use SimpleXMLElement; /** @@ -97,15 +96,6 @@ public static function attr( return null; } - // TODO: In 5.0, remove this block to render space as space - // @codeCoverageIgnoreStart - if ($value === ' ') { - Helpers::deprecated('Passing a single space as value to `Xml::attr()` has been deprecated. In a future version, passing a single space won\'t render an empty value anymore but a single space. To render an empty value, please pass an empty string.', 'xml-attr-single-space'); - - return $name . '=""'; - } - // @codeCoverageIgnoreEnd - if ($value === true) { return $name . '="' . $name . '"'; } From e2d0bafa0c64226ec43b0d42ff7ffee5faf7f96a Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 21 Nov 2024 19:41:20 +0100 Subject: [PATCH 264/362] Upgrade CI actions --- .github/workflows/backend.yml | 30 +++++++++++++++--------------- .github/workflows/frontend.yml | 8 ++++---- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index bb6accec6c..78961916c0 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -64,7 +64,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4 with: fetch-depth: 2 @@ -84,21 +84,21 @@ jobs: - name: Setup PHP cache environment id: ext-cache - uses: shivammathur/cache-extensions@f9643262bed1015eb7bfad95e63378b23bc2d319 # pin@v1 + uses: shivammathur/cache-extensions@b5046118b75df28d2b24c968b417e81a6211a7fc # pin@v1 with: php-version: ${{ matrix.php }} extensions: ${{ env.extensions }} key: php-v1 - name: Cache PHP extensions - uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # pin@v3 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # pin@v4 with: path: ${{ steps.ext-cache.outputs.dir }} key: ${{ steps.ext-cache.outputs.key }} restore-keys: ${{ steps.ext-cache.outputs.key }} - name: Setup PHP environment - uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # pin@v2 + uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # pin@v2 with: php-version: ${{ matrix.php }} extensions: ${{ env.extensions }} @@ -113,7 +113,7 @@ jobs: - name: Cache analysis data id: finishPrepare - uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # pin@v3 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # pin@v4 with: path: ~/.cache/psalm key: backend-analysis-${{ matrix.php }} @@ -135,7 +135,7 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} PHP: ${{ matrix.php }} if: env.token != '' - uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # pin@v3 + uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # pin@v5 with: token: ${{ secrets.CODECOV_TOKEN }} # for better reliability if the GitHub API is down fail_ci_if_error: true @@ -145,7 +145,7 @@ jobs: - name: Upload code scanning results to GitHub if: always() && steps.finishPrepare.outcome == 'success' && github.repository == 'getkirby/kirby' - uses: github/codeql-action/upload-sarif@4a8f20f6b9b5114f354129a1e2f391d75bfd640a # pin@v2 + uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # pin@v3 with: sarif_file: sarif @@ -177,21 +177,21 @@ jobs: steps: - name: Checkout - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4 - name: Preparations run: mkdir sarif - name: Setup PHP cache environment id: ext-cache - uses: shivammathur/cache-extensions@f9643262bed1015eb7bfad95e63378b23bc2d319 # pin@v1 + uses: shivammathur/cache-extensions@b5046118b75df28d2b24c968b417e81a6211a7fc # pin@v1 with: php-version: ${{ env.php }} extensions: ${{ env.extensions }} key: php-analysis-v1 - name: Cache PHP extensions - uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # pin@v3 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # pin@v4 with: path: ${{ steps.ext-cache.outputs.dir }} key: ${{ steps.ext-cache.outputs.key }} @@ -199,7 +199,7 @@ jobs: - name: Setup PHP environment id: finishPrepare - uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # pin@v2 + uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # pin@v2 with: php-version: ${{ env.php }} extensions: ${{ env.extensions }} @@ -226,7 +226,7 @@ jobs: - name: Upload code scanning results to GitHub if: always() && steps.finishPrepare.outcome == 'success' && github.repository == 'getkirby/kirby' - uses: github/codeql-action/upload-sarif@4a8f20f6b9b5114f354129a1e2f391d75bfd640a # pin@v2 + uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # pin@v3 with: sarif_file: sarif @@ -257,10 +257,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4 - name: Setup PHP environment - uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # pin@v2 + uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # pin@v2 with: php-version: ${{ env.php }} coverage: none @@ -268,7 +268,7 @@ jobs: - name: Cache analysis data id: finishPrepare - uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # pin@v3 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # pin@v4 with: path: ~/.php-cs-fixer key: coding-style diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 5ad1719fbc..f049d990bf 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -48,10 +48,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # pin@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4 - name: Set up Node.js problem matchers and cache npm dependencies - uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # pin@v3 + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # pin@v4 with: cache: "npm" cache-dependency-path: panel/package-lock.json @@ -93,10 +93,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4 - name: Set up Node.js problem matchers and cache npm dependencies - uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # pin@v3 + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # pin@v4 with: cache: "npm" cache-dependency-path: panel/package-lock.json From 41353f79c838270f0e82f5a87992ebd83704ce8d Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 26 Nov 2024 11:31:52 +0100 Subject: [PATCH 265/362] Fix file preview links --- src/Cms/File.php | 6 ------ tests/Cms/Files/FileTest.php | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Cms/File.php b/src/Cms/File.php index b91f6ee1c1..9937bdc642 100644 --- a/src/Cms/File.php +++ b/src/Cms/File.php @@ -630,12 +630,6 @@ public function previewUrl(): string|null case 'page': $preview = $parent->blueprint()->preview(); - // user has no permission to preview page, - // also return null for file preview - if ($preview === false) { - return null; - } - // the page has a custom preview setting, // thus the file is only accessible through // the direct media URL diff --git a/tests/Cms/Files/FileTest.php b/tests/Cms/Files/FileTest.php index d846448bd5..a523b01fad 100644 --- a/tests/Cms/Files/FileTest.php +++ b/tests/Cms/Files/FileTest.php @@ -769,7 +769,7 @@ public function testPreviewUrlUnauthenticated() ]); $file = $page->file('test.pdf'); - $this->assertNull($file->previewUrl()); + $this->assertSame('/media/pages/test/' . $file->mediaHash() . '/test.pdf', $file->previewUrl()); } public function testPreviewUrlForDraft() @@ -852,7 +852,7 @@ public function testPreviewUrlForPageWithDeniedPreviewSetting() $app->impersonate('test@getkirby.com'); $file = $app->file('test/test.pdf'); - $this->assertNull($file->previewUrl()); + $this->assertSame('/media/pages/test/' . $file->mediaHash() . '/test.pdf', $file->previewUrl()); } public function testPreviewUrlForPageWithCustomPreviewSetting() From 998e959633ee332a077281d384fcff57fa896426 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 26 Nov 2024 12:28:41 +0100 Subject: [PATCH 266/362] New legacy support for old .lock files --- src/Content/Lock.php | 54 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/src/Content/Lock.php b/src/Content/Lock.php index c0de6d74fa..1ffa28c4ac 100644 --- a/src/Content/Lock.php +++ b/src/Content/Lock.php @@ -6,6 +6,7 @@ use Kirby\Cms\Language; use Kirby\Cms\Languages; use Kirby\Cms\User; +use Kirby\Data\Data; use Kirby\Toolkit\Str; /** @@ -27,6 +28,7 @@ class Lock public function __construct( protected User|null $user = null, protected int|null $modified = null, + protected bool $legacy = false ) { } @@ -39,6 +41,11 @@ public static function for( Version $version, Language|string $language = 'default' ): static { + + if ($legacy = static::legacy($version)) { + return $legacy; + } + // wildcard to search for a lock in any language // the first locked one will be preferred if ($language === '*') { @@ -87,13 +94,21 @@ public function isActive(): bool } /** - * Check if content locking is enabled at all + * Checks if content locking is enabled at all */ public static function isEnabled(): bool { return App::instance()->option('content.locking', true) !== false; } + /** + * Checks if the lock is coming from an old .lock file + */ + public function isLegacy(): bool + { + return $this->legacy; + } + /** * Checks if the lock is actually locked */ @@ -124,6 +139,42 @@ public function isLocked(): bool return true; } + /** + * Looks for old .lock files and tries to create a + * usable lock instance from them + */ + public static function legacy(Version $version): static|null + { + $model = $version->model(); + $kirby = $model->kirby(); + $root = $model::CLASS_ALIAS === 'file' ? dirname($model->root()) : $model->root(); + $file = $root . '/.lock'; + $id = '/' . $model->id(); + + // no legacy lock file? no lock. + if (file_exists($file) === false) { + return null; + } + + $data = Data::read($file, 'yml', fail: false)[$id] ?? []; + + // no valid lock entry? no lock. + if (isset($data['lock']) === false) { + return null; + } + + // has the lock been unlocked? no lock. + if (isset($data['unlock']) === true) { + return null; + } + + return new static( + user: $kirby->user($data['lock']['user']), + modified: $data['lock']['time'], + legacy: true + ); + } + /** * Returns the timestamp when the locked content has * been updated. You can pass a format to get a useful, @@ -147,6 +198,7 @@ public function modified( public function toArray(): array { return [ + 'isLegacy' => $this->isLegacy(), 'isLocked' => $this->isLocked(), 'modified' => $this->modified('c'), 'user' => [ From 6a005e95461056389e39778d58456f9a74830a09 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 26 Nov 2024 12:29:03 +0100 Subject: [PATCH 267/362] Show special lock state for old locks in the preview view --- panel/src/components/Views/PreviewView.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/panel/src/components/Views/PreviewView.vue b/panel/src/components/Views/PreviewView.vue index a20c4e4fdf..27df5f55aa 100644 --- a/panel/src/components/Views/PreviewView.vue +++ b/panel/src/components/Views/PreviewView.vue @@ -91,10 +91,16 @@ - {{ $t("lock.unsaved.empty") }} - - {{ $t("edit") }} - + + @@ -223,6 +229,8 @@ export default { flex-grow: 1; justify-content: center; flex-direction: column; + text-align: center; + padding-inline: var(--spacing-3); gap: var(--spacing-6); --button-color-text: var(--color-text); } From 5d45af29ecb96a80171af03c689fc800658bad5a Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 26 Nov 2024 12:39:15 +0100 Subject: [PATCH 268/362] Clean up old lock files in the changes controller --- src/Api/Controller/Changes.php | 16 ++++++++++++++++ src/Content/Lock.php | 18 +++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/Api/Controller/Changes.php b/src/Api/Controller/Changes.php index 7ebe9cdf68..e525ee5c6d 100644 --- a/src/Api/Controller/Changes.php +++ b/src/Api/Controller/Changes.php @@ -3,7 +3,9 @@ namespace Kirby\Api\Controller; use Kirby\Cms\ModelWithContent; +use Kirby\Content\Lock; use Kirby\Content\VersionId; +use Kirby\Filesystem\F; use Kirby\Form\Form; /** @@ -18,6 +20,14 @@ */ class Changes { + /** + * Cleans up legacy lock files + */ + protected static function cleanup(ModelWithContent $model): void + { + F::remove(Lock::legacyFile($model)); + } + /** * Discards unsaved changes by deleting the changes version */ @@ -25,6 +35,8 @@ public static function discard(ModelWithContent $model): array { $model->version(VersionId::changes())->delete('current'); + static::cleanup($model); + return [ 'status' => 'ok' ]; @@ -41,6 +53,8 @@ public static function publish(ModelWithContent $model, array $input): array input: $input ); + static::cleanup($model); + // get the changes version $changes = $model->version(VersionId::changes()); @@ -77,6 +91,8 @@ public static function save(ModelWithContent $model, array $input): array $changes = $model->version(VersionId::changes()); $latest = $model->version(VersionId::latest()); + static::cleanup($model); + // combine the new field changes with the // last published state $changes->save( diff --git a/src/Content/Lock.php b/src/Content/Lock.php index 1ffa28c4ac..25a1580b73 100644 --- a/src/Content/Lock.php +++ b/src/Content/Lock.php @@ -5,6 +5,7 @@ use Kirby\Cms\App; use Kirby\Cms\Language; use Kirby\Cms\Languages; +use Kirby\Cms\ModelWithContent; use Kirby\Cms\User; use Kirby\Data\Data; use Kirby\Toolkit\Str; @@ -42,7 +43,7 @@ public static function for( Language|string $language = 'default' ): static { - if ($legacy = static::legacy($version)) { + if ($legacy = static::legacy($version->model())) { return $legacy; } @@ -143,12 +144,10 @@ public function isLocked(): bool * Looks for old .lock files and tries to create a * usable lock instance from them */ - public static function legacy(Version $version): static|null + public static function legacy(ModelWithContent $model): static|null { - $model = $version->model(); $kirby = $model->kirby(); - $root = $model::CLASS_ALIAS === 'file' ? dirname($model->root()) : $model->root(); - $file = $root . '/.lock'; + $file = static::legacyFile($model); $id = '/' . $model->id(); // no legacy lock file? no lock. @@ -175,6 +174,15 @@ public static function legacy(Version $version): static|null ); } + /** + * Returns the absolute path to a legacy lock file + */ + public static function legacyFile(ModelWithContent $model): string + { + $root = $model::CLASS_ALIAS === 'file' ? dirname($model->root()) : $model->root(); + return $root . '/.lock'; + } + /** * Returns the timestamp when the locked content has * been updated. You can pass a format to get a useful, From c2d056d64000e7e5edb31689792d4146729a1292 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Tue, 26 Nov 2024 12:49:09 +0100 Subject: [PATCH 269/362] Fix unit tests --- tests/Content/LockTest.php | 1 + tests/Panel/Areas/SiteTest.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/tests/Content/LockTest.php b/tests/Content/LockTest.php index 0055d3cbd1..0715106185 100644 --- a/tests/Content/LockTest.php +++ b/tests/Content/LockTest.php @@ -319,6 +319,7 @@ public function testToArray() ); $this->assertSame([ + 'isLegacy' => false, 'isLocked' => true, 'modified' => date('c', $modified), 'user' => [ diff --git a/tests/Panel/Areas/SiteTest.php b/tests/Panel/Areas/SiteTest.php index 05957c5989..d2f576f7ba 100644 --- a/tests/Panel/Areas/SiteTest.php +++ b/tests/Panel/Areas/SiteTest.php @@ -38,6 +38,7 @@ public function testPage(): void $this->assertSame('default', $props['blueprint']); $this->assertSame([ + 'isLegacy' => false, 'isLocked' => false, 'modified' => null, 'user' => [ @@ -95,6 +96,7 @@ public function testPageFile(): void $this->assertSame('image', $props['blueprint']); $this->assertSame([ + 'isLegacy' => false, 'isLocked' => false, 'modified' => null, 'user' => [ @@ -190,6 +192,7 @@ public function testSiteFile(): void $this->assertSame('image', $props['blueprint']); $this->assertSame([ + 'isLegacy' => false, 'isLocked' => false, 'modified' => null, 'user' => [ From c3e546fd72e96c65b6984e57fcd9c76a5216b199 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 27 Nov 2024 12:59:52 +0100 Subject: [PATCH 270/362] Unit tests for the new Lock methods --- tests/Content/LockTest.php | 95 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/tests/Content/LockTest.php b/tests/Content/LockTest.php index 0715106185..aec618c237 100644 --- a/tests/Content/LockTest.php +++ b/tests/Content/LockTest.php @@ -5,6 +5,7 @@ use Kirby\Cms\App; use Kirby\Cms\Language; use Kirby\Cms\User; +use Kirby\Data\Data; /** * @coversDefaultClass \Kirby\Content\Lock @@ -215,6 +216,18 @@ public function testIsEnabledWhenDisabled() $this->assertFalse(Lock::isEnabled()); } + /** + * @covers ::isLegacy + */ + public function testIsLegacy() + { + $lock = new Lock(); + $this->assertFalse($lock->isLegacy()); + + $lock = new Lock(legacy: true); + $this->assertTrue($lock->isLegacy()); + } + /** * @covers ::isLocked */ @@ -292,6 +305,88 @@ public function testIsLockedWithDifferentUserAndOldTimestamp() $this->assertFalse($lock->isLocked()); } + /** + * @covers ::legacy + */ + public function testLegacy() + { + $page = $this->app->page('test'); + $file = $page->root() . '/.lock'; + + Data::write($file, [ + '/' . $page->id() => [ + 'lock' => [ + 'user' => 'editor', + 'time' => $time = time() + ] + ] + ], 'yml'); + + $lock = Lock::legacy($page); + + $this->assertInstanceOf(Lock::class, $lock); + $this->assertTrue($lock->isLocked()); + $this->assertTrue($lock->isLegacy()); + $this->assertSame($this->app->user('editor'), $lock->user()); + $this->assertSame($time, $lock->modified()); + } + + /** + * @covers ::legacy + */ + public function testLegacyWithOutdatedFile() + { + $page = $this->app->page('test'); + $file = $page->root() . '/.lock'; + + Data::write($file, [ + '/' . $page->id() => [ + 'lock' => [ + 'user' => 'editor', + 'time' => time() - 60 * 60 * 24 + ], + ] + ], 'yml'); + + $lock = Lock::legacy($page); + + $this->assertInstanceOf(Lock::class, $lock); + $this->assertFalse($lock->isLocked()); + } + + /** + * @covers ::legacy + */ + public function testLegacyWithUnlockedFile() + { + $page = $this->app->page('test'); + $file = $page->root() . '/.lock'; + + Data::write($file, [ + '/' . $page->id() => [ + 'lock' => [ + 'user' => 'editor', + 'time' => time() + ], + 'unlock' => ['admin'] + ] + ], 'yml'); + + $lock = Lock::legacy($page); + $this->assertNull($lock); + } + + /** + * @covers ::legacyFile + */ + public function testLegacyFile() + { + $page = $this->app->page('test'); + $expected = $page->root() . '/.lock'; + + $this->assertSame($expected, Lock::legacyFile($page)); + } + /** * @covers ::modified */ From d40071ab2da76f965fb787cc146805cd889578d3 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 27 Nov 2024 13:04:53 +0100 Subject: [PATCH 271/362] Simplify code with match block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nico Hoffmann ෴. --- src/Content/Lock.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Content/Lock.php b/src/Content/Lock.php index 25a1580b73..5d70c26c15 100644 --- a/src/Content/Lock.php +++ b/src/Content/Lock.php @@ -179,7 +179,10 @@ public static function legacy(ModelWithContent $model): static|null */ public static function legacyFile(ModelWithContent $model): string { - $root = $model::CLASS_ALIAS === 'file' ? dirname($model->root()) : $model->root(); + $root = match ($model::CLASS_ALIAS) { + 'file' => dirname($model->root()), + default => $model->root() + }; return $root . '/.lock'; } From b9f78e3e1a61d8508384a342590899cb211a9ec6 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 27 Nov 2024 13:11:57 +0100 Subject: [PATCH 272/362] Add better inline comments to the controller --- src/Api/Controller/Changes.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Api/Controller/Changes.php b/src/Api/Controller/Changes.php index e525ee5c6d..99e207ca88 100644 --- a/src/Api/Controller/Changes.php +++ b/src/Api/Controller/Changes.php @@ -21,7 +21,13 @@ class Changes { /** - * Cleans up legacy lock files + * Cleans up legacy lock files. The `discard`, `publish` and `save` actions + * are perfect for this cleanup job. They will be stopped early if + * the lock is still active and otherwise, we can use them to clean + * up outdated .lock files to keep the content folders clean. This + * can be removed as soon as old .lock files should no longer be around. + * + * @todo Remove in 6.0.0 */ protected static function cleanup(ModelWithContent $model): void { @@ -35,6 +41,8 @@ public static function discard(ModelWithContent $model): array { $model->version(VersionId::changes())->delete('current'); + // Removes the old .lock file when it is no longer needed + // @todo Remove in 6.0.0 static::cleanup($model); return [ @@ -53,6 +61,8 @@ public static function publish(ModelWithContent $model, array $input): array input: $input ); + // Removes the old .lock file when it is no longer needed + // @todo Remove in 6.0.0 static::cleanup($model); // get the changes version @@ -91,6 +101,8 @@ public static function save(ModelWithContent $model, array $input): array $changes = $model->version(VersionId::changes()); $latest = $model->version(VersionId::latest()); + // Removes the old .lock file when it is no longer needed + // @todo Remove in 6.0.0 static::cleanup($model); // combine the new field changes with the From e15bd1fe33c3d4eb52f93d3266b3d8ff1020ada8 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 27 Nov 2024 13:22:47 +0100 Subject: [PATCH 273/362] Extend unit tests --- tests/Content/LockTest.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/Content/LockTest.php b/tests/Content/LockTest.php index aec618c237..d4871a87f4 100644 --- a/tests/Content/LockTest.php +++ b/tests/Content/LockTest.php @@ -156,6 +156,28 @@ public function testForWithLanguageWildcard() $this->assertSame('admin', $lock->user()->id()); } + /** + * @covers ::for + */ + public function testForWithLegacyLock() + { + $page = $this->app->page('test'); + $file = $page->root() . '/.lock'; + + Data::write($file, [ + '/' . $page->id() => [ + 'lock' => [ + 'user' => 'editor', + 'time' => $time = time() + ] + ] + ], 'yml'); + + $lock = Lock::for($page->version('changes')); + $this->assertInstanceOf(Lock::class, $lock); + $this->assertTrue($lock->isLocked()); + } + /** * @covers ::isActive */ @@ -331,6 +353,20 @@ public function testLegacy() $this->assertSame($time, $lock->modified()); } + /** + * @covers ::legacy + */ + public function testLegacyWithoutLockInfo() + { + $page = $this->app->page('test'); + $file = $page->root() . '/.lock'; + + Data::write($file, [], 'yml'); + + $lock = Lock::legacy($page); + $this->assertNull($lock); + } + /** * @covers ::legacy */ From 7512f22b46f8a065af3e22ba8ef942d6a0b21c9a Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Wed, 27 Nov 2024 14:20:40 +0100 Subject: [PATCH 274/362] Preflight for 4.5.0 --- cacert.pem | 32 ++++++++++++++++++++++++++- composer.json | 2 +- composer.lock | 6 ++--- vendor/composer/autoload_classmap.php | 4 ++++ vendor/composer/autoload_static.php | 4 ++++ vendor/composer/installed.php | 8 +++---- 6 files changed, 47 insertions(+), 9 deletions(-) diff --git a/cacert.pem b/cacert.pem index f2c24a589d..eb11b2fd1a 100644 --- a/cacert.pem +++ b/cacert.pem @@ -1,7 +1,7 @@ ## ## Bundle of CA Root Certificates ## -## Certificate data from Mozilla as of: Tue Sep 24 03:12:04 2024 GMT +## Certificate data from Mozilla as of: Tue Nov 26 13:58:25 2024 GMT ## ## Find updated versions here: https://curl.se/docs/caextract.html ## @@ -2602,6 +2602,36 @@ vLtoURMMA/cVi4RguYv/Uo7njLwcAjA8+RHUjE7AwWHCFUyqqx0LMV87HOIAl0Qx5v5zli/altP+ CAezNIm8BZ/3Hobui3A= -----END CERTIFICATE----- +GLOBALTRUST 2020 +================ +-----BEGIN CERTIFICATE----- +MIIFgjCCA2qgAwIBAgILWku9WvtPilv6ZeUwDQYJKoZIhvcNAQELBQAwTTELMAkGA1UEBhMCQVQx +IzAhBgNVBAoTGmUtY29tbWVyY2UgbW9uaXRvcmluZyBHbWJIMRkwFwYDVQQDExBHTE9CQUxUUlVT +VCAyMDIwMB4XDTIwMDIxMDAwMDAwMFoXDTQwMDYxMDAwMDAwMFowTTELMAkGA1UEBhMCQVQxIzAh +BgNVBAoTGmUtY29tbWVyY2UgbW9uaXRvcmluZyBHbWJIMRkwFwYDVQQDExBHTE9CQUxUUlVTVCAy +MDIwMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAri5WrRsc7/aVj6B3GyvTY4+ETUWi +D59bRatZe1E0+eyLinjF3WuvvcTfk0Uev5E4C64OFudBc/jbu9G4UeDLgztzOG53ig9ZYybNpyrO +VPu44sB8R85gfD+yc/LAGbaKkoc1DZAoouQVBGM+uq/ufF7MpotQsjj3QWPKzv9pj2gOlTblzLmM +CcpL3TGQlsjMH/1WljTbjhzqLL6FLmPdqqmV0/0plRPwyJiT2S0WR5ARg6I6IqIoV6Lr/sCMKKCm +fecqQjuCgGOlYx8ZzHyyZqjC0203b+J+BlHZRYQfEs4kUmSFC0iAToexIiIwquuuvuAC4EDosEKA +A1GqtH6qRNdDYfOiaxaJSaSjpCuKAsR49GiKweR6NrFvG5Ybd0mN1MkGco/PU+PcF4UgStyYJ9OR +JitHHmkHr96i5OTUawuzXnzUJIBHKWk7buis/UDr2O1xcSvy6Fgd60GXIsUf1DnQJ4+H4xj04KlG +DfV0OoIu0G4skaMxXDtG6nsEEFZegB31pWXogvziB4xiRfUg3kZwhqG8k9MedKZssCz3AwyIDMvU +clOGvGBG85hqwvG/Q/lwIHfKN0F5VVJjjVsSn8VoxIidrPIwq7ejMZdnrY8XD2zHc+0klGvIg5rQ +mjdJBKuxFshsSUktq6HQjJLyQUp5ISXbY9e2nKd+Qmn7OmMCAwEAAaNjMGEwDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFNwuH9FhN3nkq9XVsxJxaD1qaJwiMB8GA1Ud +IwQYMBaAFNwuH9FhN3nkq9XVsxJxaD1qaJwiMA0GCSqGSIb3DQEBCwUAA4ICAQCR8EICaEDuw2jA +VC/f7GLDw56KoDEoqoOOpFaWEhCGVrqXctJUMHytGdUdaG/7FELYjQ7ztdGl4wJCXtzoRlgHNQIw +4Lx0SsFDKv/bGtCwr2zD/cuz9X9tAy5ZVp0tLTWMstZDFyySCstd6IwPS3BD0IL/qMy/pJTAvoe9 +iuOTe8aPmxadJ2W8esVCgmxcB9CpwYhgROmYhRZf+I/KARDOJcP5YBugxZfD0yyIMaK9MOzQ0MAS +8cE54+X1+NZK3TTN+2/BT+MAi1bikvcoskJ3ciNnxz8RFbLEAwW+uxF7Cr+obuf/WEPPm2eggAe2 +HcqtbepBEX4tdJP7wry+UUTF72glJ4DjyKDUEuzZpTcdN3y0kcra1LGWge9oXHYQSa9+pTeAsRxS +vTOBTI/53WXZFM2KJVj04sWDpQmQ1GwUY7VA3+vA/MRYfg0UFodUJ25W5HCEuGwyEn6CMUO+1918 +oa2u1qsgEu8KwxCMSZY13At1XrFP1U80DhEgB3VDRemjEdqso5nCtnkn4rnvyOL2NSl6dPrFf4IF +YqYK6miyeUcGbvJXqBUzxvd4Sj1Ce2t+/vdG6tHrju+IaFvowdlxfv1k7/9nR4hYJS8+hge9+6jl +gqispdNpQ80xiEmEU5LAsTkbOYMBMMTyqfrQA71yN2BWHzZ8vTmR9W0Nv3vXkg== +-----END CERTIFICATE----- + ANF Secure Server Root CA ========================= -----BEGIN CERTIFICATE----- diff --git a/composer.json b/composer.json index 7a34d655eb..0cf0d0a7fc 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "The Kirby core", "license": "proprietary", "type": "kirby-cms", - "version": "4.5.0-rc.1", + "version": "4.5.0", "keywords": [ "kirby", "cms", diff --git a/composer.lock b/composer.lock index 787274848b..778013c748 100644 --- a/composer.lock +++ b/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": "0e221e037dadac76412edcfaab2ccb0f", + "content-hash": "f12b026f0a6ca67dc1bd0072f607d1eb", "packages": [ { "name": "christian-riesen/base32", @@ -1091,7 +1091,7 @@ "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -1108,7 +1108,7 @@ "ext-mbstring": "*", "ext-openssl": "*" }, - "platform-dev": {}, + "platform-dev": [], "platform-overrides": { "php": "8.1.0" }, diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index db43972028..d2661b2b7b 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -148,6 +148,10 @@ 'Kirby\\Cms\\UserRules' => $baseDir . '/src/Cms/UserRules.php', 'Kirby\\Cms\\Users' => $baseDir . '/src/Cms/Users.php', 'Kirby\\Cms\\Visitor' => $baseDir . '/src/Cms/Visitor.php', + 'Kirby\\ComposerInstaller\\CmsInstaller' => $vendorDir . '/getkirby/composer-installer/src/ComposerInstaller/CmsInstaller.php', + 'Kirby\\ComposerInstaller\\Installer' => $vendorDir . '/getkirby/composer-installer/src/ComposerInstaller/Installer.php', + 'Kirby\\ComposerInstaller\\Plugin' => $vendorDir . '/getkirby/composer-installer/src/ComposerInstaller/Plugin.php', + 'Kirby\\ComposerInstaller\\PluginInstaller' => $vendorDir . '/getkirby/composer-installer/src/ComposerInstaller/PluginInstaller.php', 'Kirby\\Content\\Content' => $baseDir . '/src/Content/Content.php', 'Kirby\\Content\\ContentStorage' => $baseDir . '/src/Content/ContentStorage.php', 'Kirby\\Content\\ContentStorageHandler' => $baseDir . '/src/Content/ContentStorageHandler.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 077cf12b68..39345b8e1d 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -269,6 +269,10 @@ class ComposerStaticInit0bf5c8a9cfa251a218fc581ac888fe35 'Kirby\\Cms\\UserRules' => __DIR__ . '/../..' . '/src/Cms/UserRules.php', 'Kirby\\Cms\\Users' => __DIR__ . '/../..' . '/src/Cms/Users.php', 'Kirby\\Cms\\Visitor' => __DIR__ . '/../..' . '/src/Cms/Visitor.php', + 'Kirby\\ComposerInstaller\\CmsInstaller' => __DIR__ . '/..' . '/getkirby/composer-installer/src/ComposerInstaller/CmsInstaller.php', + 'Kirby\\ComposerInstaller\\Installer' => __DIR__ . '/..' . '/getkirby/composer-installer/src/ComposerInstaller/Installer.php', + 'Kirby\\ComposerInstaller\\Plugin' => __DIR__ . '/..' . '/getkirby/composer-installer/src/ComposerInstaller/Plugin.php', + 'Kirby\\ComposerInstaller\\PluginInstaller' => __DIR__ . '/..' . '/getkirby/composer-installer/src/ComposerInstaller/PluginInstaller.php', 'Kirby\\Content\\Content' => __DIR__ . '/../..' . '/src/Content/Content.php', 'Kirby\\Content\\ContentStorage' => __DIR__ . '/../..' . '/src/Content/ContentStorage.php', 'Kirby\\Content\\ContentStorageHandler' => __DIR__ . '/../..' . '/src/Content/ContentStorageHandler.php', diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index dbe8b48b35..cba574729b 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,8 +1,8 @@ array( 'name' => 'getkirby/cms', - 'pretty_version' => '4.5.0-rc.1', - 'version' => '4.5.0.0-RC1', + 'pretty_version' => '4.5.0', + 'version' => '4.5.0.0', 'reference' => null, 'type' => 'kirby-cms', 'install_path' => __DIR__ . '/../../', @@ -47,8 +47,8 @@ 'dev_requirement' => false, ), 'getkirby/cms' => array( - 'pretty_version' => '4.5.0-rc.1', - 'version' => '4.5.0.0-RC1', + 'pretty_version' => '4.5.0', + 'version' => '4.5.0.0', 'reference' => null, 'type' => 'kirby-cms', 'install_path' => __DIR__ . '/../../', From dcb4ee739e32b2b9f3b08128106338c56c50f9e5 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 28 Nov 2024 18:02:56 +0100 Subject: [PATCH 275/362] First tests to create a theme without overwriting colors --- panel/src/components/Collection/Item.vue | 3 +- panel/src/components/Dialogs/Dialog.vue | 2 +- panel/src/components/Drawers/Drawer.vue | 2 +- .../src/components/Drawers/Elements/Body.vue | 2 +- .../components/Dropdowns/DropdownContent.vue | 4 -- panel/src/components/Forms/Blocks/Block.vue | 4 +- .../components/Forms/Blocks/BlockOptions.vue | 2 +- panel/src/components/Forms/Blocks/Blocks.vue | 6 ++- .../Elements/BlockBackgroundDropdown.vue | 2 +- .../Forms/Blocks/Elements/BlockFigure.vue | 2 +- .../components/Forms/Blocks/Types/Code.vue | 4 -- .../components/Forms/Blocks/Types/Gallery.vue | 2 +- .../components/Forms/Blocks/Types/Image.vue | 2 +- .../Forms/Blocks/Types/Markdown.vue | 2 +- panel/src/components/Forms/Input.vue | 4 +- .../components/Forms/Input/ChoiceInput.vue | 2 +- .../components/Forms/Input/TogglesInput.vue | 2 +- panel/src/components/Forms/Layouts/Layout.vue | 2 +- .../Forms/Previews/BubblesFieldPreview.vue | 2 +- .../src/components/Forms/Toolbar/Toolbar.vue | 2 +- panel/src/components/Layout/Box.vue | 2 +- panel/src/components/Layout/Bubble.vue | 2 +- .../components/Layout/Frame/ColorFrame.vue | 4 -- panel/src/components/Layout/Header.vue | 2 +- panel/src/components/Layout/Overlay.vue | 4 -- panel/src/components/Layout/Stat.vue | 8 ++-- panel/src/components/Layout/Table.vue | 12 ++---- panel/src/components/Navigation/Button.vue | 8 +--- .../src/components/Navigation/ButtonGroup.vue | 5 ++- panel/src/components/Text/Code.vue | 5 --- panel/src/components/Text/Text.vue | 2 +- panel/src/components/View/Activation.vue | 3 -- panel/src/components/View/Menu.vue | 9 ++--- panel/src/components/View/Panel.vue | 3 +- .../components/Views/Files/FilePreview.vue | 11 ++--- .../Views/Files/FilePreviewDetails.vue | 5 +-- .../Views/Files/FilePreviewFrame.vue | 3 -- panel/src/components/Views/Files/FileView.vue | 1 + .../components/Views/Users/UserProfile.vue | 2 +- panel/src/styles/config/colors.css | 40 +++++++++---------- panel/src/styles/config/pattern.css | 15 ------- panel/src/styles/reset/choice.css | 4 +- panel/src/styles/utilities/theme.css | 13 ++++-- 43 files changed, 86 insertions(+), 130 deletions(-) diff --git a/panel/src/components/Collection/Item.vue b/panel/src/components/Collection/Item.vue index af6e957c87..4ae3425864 100644 --- a/panel/src/components/Collection/Item.vue +++ b/panel/src/components/Collection/Item.vue @@ -140,13 +140,14 @@ export default { :root { --item-button-height: var(--height-md); --item-button-width: var(--height-md); + --item-color-back: light-dark(var(--color-white), var(--color-gray-950)); --item-height: auto; --item-height-cardlet: calc(var(--height-md) * 3); } .k-item { position: relative; - background: var(--color-white); + background: var(--item-color-back); box-shadow: var(--shadow); border-radius: var(--rounded); min-height: var(--item-height); diff --git a/panel/src/components/Dialogs/Dialog.vue b/panel/src/components/Dialogs/Dialog.vue index ab94a49d4d..4eb339646f 100644 --- a/panel/src/components/Dialogs/Dialog.vue +++ b/panel/src/components/Dialogs/Dialog.vue @@ -50,7 +50,7 @@ export default { diff --git a/panel/src/components/Forms/Blocks/Types/Image.vue b/panel/src/components/Forms/Blocks/Types/Image.vue index a5f419bf85..e152d09443 100644 --- a/panel/src/components/Forms/Blocks/Types/Image.vue +++ b/panel/src/components/Forms/Blocks/Types/Image.vue @@ -40,7 +40,7 @@ export default { extends: Block, data() { return { - back: this.onBack() ?? "var(--color-white)" + back: this.onBack() ?? "transparent" }; }, computed: { diff --git a/panel/src/components/Forms/Blocks/Types/Markdown.vue b/panel/src/components/Forms/Blocks/Types/Markdown.vue index aea08fae58..248e322eec 100644 --- a/panel/src/components/Forms/Blocks/Types/Markdown.vue +++ b/panel/src/components/Forms/Blocks/Types/Markdown.vue @@ -36,7 +36,7 @@ export default { diff --git a/panel/src/components/Layout/Header.vue b/panel/src/components/Layout/Header.vue index 0007354ba0..81c22b032a 100644 --- a/panel/src/components/Layout/Header.vue +++ b/panel/src/components/Layout/Header.vue @@ -60,7 +60,7 @@ export default { diff --git a/panel/src/components/Views/Files/FilePreviewFrame.vue b/panel/src/components/Views/Files/FilePreviewFrame.vue index e081439c98..451d050684 100644 --- a/panel/src/components/Views/Files/FilePreviewFrame.vue +++ b/panel/src/components/Views/Files/FilePreviewFrame.vue @@ -62,7 +62,4 @@ export default { .k-button.k-file-preview-frame-dropdown-toggle { --button-color-icon: var(--color-gray-500); } -.k-panel[data-theme="dark"] .k-button.k-file-preview-frame-dropdown-toggle { - --button-color-icon: var(--color-gray-700); -} diff --git a/panel/src/components/Views/Files/FileView.vue b/panel/src/components/Views/Files/FileView.vue index 2d0eaa404b..6aea0e57d3 100644 --- a/panel/src/components/Views/Files/FileView.vue +++ b/panel/src/components/Views/Files/FileView.vue @@ -87,6 +87,7 @@ export default { diff --git a/panel/src/components/Drawers/Elements/Header.vue b/panel/src/components/Drawers/Elements/Header.vue index 97cdd858d8..8d57627a57 100644 --- a/panel/src/components/Drawers/Elements/Header.vue +++ b/panel/src/components/Drawers/Elements/Header.vue @@ -68,7 +68,7 @@ export default { align-items: center; line-height: 1; justify-content: space-between; - background: var(--color-white); + background: light-dark(var(--color-white), var(--color-gray-850)); font-size: var(--text-sm); } diff --git a/panel/src/components/Forms/Blocks/Block.vue b/panel/src/components/Forms/Blocks/Block.vue index 11daefecf1..f3bdb36b2f 100644 --- a/panel/src/components/Forms/Blocks/Block.vue +++ b/panel/src/components/Forms/Blocks/Block.vue @@ -366,7 +366,7 @@ export default { border-radius: var(--rounded); } .k-block-container:not(:last-of-type) { - border-bottom: 1px dashed var(--color-border-dimmed); + border-bottom: 1px dashed var(--panel-color-back); } .k-block-container:focus { outline: 0; diff --git a/panel/src/components/Forms/Blocks/BlockSelector.vue b/panel/src/components/Forms/Blocks/BlockSelector.vue index b42cc5c0e7..40bc8cd8ce 100644 --- a/panel/src/components/Forms/Blocks/BlockSelector.vue +++ b/panel/src/components/Forms/Blocks/BlockSelector.vue @@ -157,7 +157,7 @@ export default { } .k-block-types .k-button { --button-color-icon: var(--color-text); - --button-color-back: var(--color-white); + --button-color-back: light-dark(var(--color-white), var(--color-gray-850)); --button-padding: var(--spacing-3); width: 100%; justify-content: start; diff --git a/panel/src/components/Forms/Blocks/Elements/BlockFigure.vue b/panel/src/components/Forms/Blocks/Elements/BlockFigure.vue index e35483fcd3..c67b912b7e 100644 --- a/panel/src/components/Forms/Blocks/Elements/BlockFigure.vue +++ b/panel/src/components/Forms/Blocks/Elements/BlockFigure.vue @@ -52,7 +52,7 @@ export default { diff --git a/panel/src/components/Layout/Stat.vue b/panel/src/components/Layout/Stat.vue index df424656a1..cd21873b96 100644 --- a/panel/src/components/Layout/Stat.vue +++ b/panel/src/components/Layout/Stat.vue @@ -83,7 +83,7 @@ export default { diff --git a/panel/src/components/Forms/Blocks/Block.vue b/panel/src/components/Forms/Blocks/Block.vue index f3bdb36b2f..d3e95fd133 100644 --- a/panel/src/components/Forms/Blocks/Block.vue +++ b/panel/src/components/Forms/Blocks/Block.vue @@ -418,6 +418,6 @@ export default { content: ""; height: 2rem; width: 100%; - background: linear-gradient(to top, var(--color-white), transparent); + background: linear-gradient(to top, var(--block-color-back), transparent); } diff --git a/panel/src/components/Forms/Blocks/BlockOptions.vue b/panel/src/components/Forms/Blocks/BlockOptions.vue index f7d090dcee..aefd6dc11e 100644 --- a/panel/src/components/Forms/Blocks/BlockOptions.vue +++ b/panel/src/components/Forms/Blocks/BlockOptions.vue @@ -203,11 +203,11 @@ export default { From 36a55003d89ac26f1909c3c3f5e191c371e3bcb6 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 29 Nov 2024 11:24:15 +0100 Subject: [PATCH 285/362] Various additional fixes --- .../lab/components/browsers/browser/index.vue | 6 ----- .../components/Forms/Blocks/Types/Fields.vue | 2 +- .../components/Forms/Blocks/Types/Gallery.vue | 2 +- .../components/Forms/Blocks/Types/Quote.vue | 2 +- .../components/Forms/Blocks/Types/Table.vue | 2 +- panel/src/components/Forms/Counter.vue | 10 +++---- .../src/components/Forms/Field/LinkField.vue | 11 ++++---- .../src/components/Forms/Input/RangeInput.vue | 1 - .../components/Forms/Input/TogglesInput.vue | 5 ++-- .../Forms/Previews/LinkFieldPreview.vue | 4 +-- panel/src/components/Lab/DocsTypes.vue | 26 +++++++++---------- panel/src/components/Lab/Example.vue | 4 +-- .../components/Layout/Frame/ColorFrame.vue | 3 +++ panel/src/components/Layout/Stat.vue | 2 +- panel/src/components/Misc/Progress.vue | 2 +- panel/src/components/Navigation/Browser.vue | 24 ++++++++++++----- panel/src/components/Navigation/Button.vue | 6 ++--- .../src/components/Navigation/FileBrowser.vue | 10 ++++--- panel/src/components/Navigation/Tree.vue | 23 +++++++++------- panel/src/components/Text/Code.vue | 2 +- panel/src/components/Text/Highlight.vue | 16 ++++++------ panel/src/components/Text/Label.vue | 4 +-- panel/src/components/Text/Text.vue | 2 +- panel/src/components/Uploads/UploadItem.vue | 19 +++++++------- panel/src/styles/reset/range.css | 2 +- panel/src/styles/utilities/theme.css | 4 ++- src/Panel/Lab/Docs.php | 2 +- src/Panel/Lab/Example.php | 2 +- 28 files changed, 108 insertions(+), 90 deletions(-) diff --git a/panel/lab/components/browsers/browser/index.vue b/panel/lab/components/browsers/browser/index.vue index 216d7851ec..caa9e9f415 100644 --- a/panel/lab/components/browsers/browser/index.vue +++ b/panel/lab/components/browsers/browser/index.vue @@ -32,10 +32,4 @@ export default { .k-lab-example .k-headline { margin-bottom: 0.5rem; } -.k-lab-example .k-browser { - border: 1px solid var(--color-border); - background: var(--color-white); - border-radius: var(--rounded); - padding: var(--spacing-2); -} diff --git a/panel/src/components/Forms/Blocks/Types/Fields.vue b/panel/src/components/Forms/Blocks/Types/Fields.vue index 6f17e0c007..5bdce1167e 100644 --- a/panel/src/components/Forms/Blocks/Types/Fields.vue +++ b/panel/src/components/Forms/Blocks/Types/Fields.vue @@ -102,7 +102,7 @@ export default { } .k-block-type-fields-form { - background-color: var(--color-gray-200); + background-color: var(--panel-color-back); padding: var(--spacing-6) var(--spacing-6) var(--spacing-8); border-radius: var(--rounded-sm); container: column / inline-size; diff --git a/panel/src/components/Forms/Blocks/Types/Gallery.vue b/panel/src/components/Forms/Blocks/Types/Gallery.vue index 071b0265cd..eb00a53518 100644 --- a/panel/src/components/Forms/Blocks/Types/Gallery.vue +++ b/panel/src/components/Forms/Blocks/Types/Gallery.vue @@ -104,7 +104,7 @@ export default { } .k-block-type-gallery[data-disabled="true"] .k-block-type-gallery-placeholder { - background: var(--color-gray-250); + background: light-dark(var(--color-gray-250), var(--color-gray-950)); } .k-block-type-gallery-placeholder { background: var(--panel-color-back); diff --git a/panel/src/components/Forms/Blocks/Types/Quote.vue b/panel/src/components/Forms/Blocks/Types/Quote.vue index 3b4e926c52..d0e1f124fa 100644 --- a/panel/src/components/Forms/Blocks/Types/Quote.vue +++ b/panel/src/components/Forms/Blocks/Types/Quote.vue @@ -50,7 +50,7 @@ export default { diff --git a/panel/src/components/Forms/Field/LinkField.vue b/panel/src/components/Forms/Field/LinkField.vue index cf5feca861..b3bb201e6d 100644 --- a/panel/src/components/Forms/Field/LinkField.vue +++ b/panel/src/components/Forms/Field/LinkField.vue @@ -275,7 +275,7 @@ export default { .k-link-input-toggle.k-button { --button-height: var(--height-sm); --button-rounded: var(--rounded-sm); - --button-color-back: var(--color-gray-200); + --button-color-back: var(--panel-color-back); margin-inline-start: 0.25rem; } @@ -320,10 +320,11 @@ export default { .k-link-input-body { display: grid; overflow: hidden; - border-top: 1px solid var(--color-gray-300); - background: var(--color-gray-100); - --tree-color-back: var(--color-gray-100); - --tree-color-hover-back: var(--color-gray-200); + border-top: 1px solid var(--color-border); + background: var(--input-color-back); + --tree-color-back: var(--input-color-back); + --tree-branch-color-back: var(--input-color-back); + --tree-branch-hover-color-back: var(--panel-color-back); } .k-link-input-body[data-type="page"] .k-page-browser { diff --git a/panel/src/components/Forms/Input/RangeInput.vue b/panel/src/components/Forms/Input/RangeInput.vue index 1f1a8c3856..88da874ad3 100644 --- a/panel/src/components/Forms/Input/RangeInput.vue +++ b/panel/src/components/Forms/Input/RangeInput.vue @@ -155,7 +155,6 @@ export default { diff --git a/panel/src/components/Forms/Previews/LinkFieldPreview.vue b/panel/src/components/Forms/Previews/LinkFieldPreview.vue index 6c9bb74f59..7f69ee0453 100644 --- a/panel/src/components/Forms/Previews/LinkFieldPreview.vue +++ b/panel/src/components/Forms/Previews/LinkFieldPreview.vue @@ -81,8 +81,8 @@ export default { diff --git a/panel/src/components/Misc/Progress.vue b/panel/src/components/Misc/Progress.vue index d881a71801..c78e89948d 100644 --- a/panel/src/components/Misc/Progress.vue +++ b/panel/src/components/Misc/Progress.vue @@ -26,7 +26,7 @@ export default { diff --git a/panel/src/components/Navigation/Button.vue b/panel/src/components/Navigation/Button.vue index 2cd4a34eb8..1700707556 100644 --- a/panel/src/components/Navigation/Button.vue +++ b/panel/src/components/Navigation/Button.vue @@ -385,13 +385,13 @@ export default { font-variant-numeric: tabular-nums; line-height: 1.5; padding: 0 var(--spacing-1); - border-radius: 50%; + border-radius: 1em; text-align: center; font-size: 0.6rem; box-shadow: var(--shadow-md); background: var(--theme-color-back); - border: 1px solid var(--theme-color-500); - color: var(--theme-color-text); + border: 1px solid light-dark(var(--theme-color-500), var(--color-black)); + color: var(--theme-color-text-highlight); z-index: 1; } diff --git a/panel/src/components/Navigation/FileBrowser.vue b/panel/src/components/Navigation/FileBrowser.vue index 2d23c3fdee..f3bf9ebbe7 100644 --- a/panel/src/components/Navigation/FileBrowser.vue +++ b/panel/src/components/Navigation/FileBrowser.vue @@ -112,6 +112,10 @@ export default { diff --git a/panel/src/styles/reset/range.css b/panel/src/styles/reset/range.css index 865873da27..9daa5896e3 100644 --- a/panel/src/styles/reset/range.css +++ b/panel/src/styles/reset/range.css @@ -4,7 +4,7 @@ --range-thumb-size: 1rem; --range-thumb-shadow: rgba(0, 0, 0, 0.1) 0 2px 4px 2px, rgba(0, 0, 0, 0.125) 0 0 0 1px; - --range-track-back: var(--color-gray-250); + --range-track-back: light-dark(var(--color-gray-300), var(--color-black)); --range-track-height: var(--range-thumb-size); } diff --git a/panel/src/styles/utilities/theme.css b/panel/src/styles/utilities/theme.css index ccdd7ef8ba..2d7397e67b 100644 --- a/panel/src/styles/utilities/theme.css +++ b/panel/src/styles/utilities/theme.css @@ -98,6 +98,8 @@ --theme-color-h: var(--color-gray-h); --theme-color-s: var(--color-gray-s); --theme-color-boost: 10%; + --theme-color-icon: var(--color-gray-600); + --theme-color-text: var(--color-black); } [data-theme^="white"], @@ -106,7 +108,7 @@ --theme-color-icon: var(--color-gray-800); --theme-color-text: var(--color-text); --theme-color-text-highlight: var(--theme-color-text); - --color-h: var(--color-black); + --color-h: var(--color-text); } /* Special Themes */ diff --git a/src/Panel/Lab/Docs.php b/src/Panel/Lab/Docs.php index 3e26a0f90a..62834dd1fb 100644 --- a/src/Panel/Lab/Docs.php +++ b/src/Panel/Lab/Docs.php @@ -52,7 +52,7 @@ function ($file) { return [ 'image' => [ 'icon' => 'book', - 'back' => 'white', + 'back' => 'light-dark(white, var(--color-gray-800))', ], 'text' => $component, 'link' => '/lab/docs/' . $component, diff --git a/src/Panel/Lab/Example.php b/src/Panel/Lab/Example.php index d4d74e6195..07ce6f2dde 100644 --- a/src/Panel/Lab/Example.php +++ b/src/Panel/Lab/Example.php @@ -173,7 +173,7 @@ public function toArray(): array return [ 'image' => [ 'icon' => $this->parent->icon(), - 'back' => 'white', + 'back' => 'light-dark(white, var(--color-gray-800))', ], 'text' => $this->title(), 'link' => $this->url() From 40753c13db25a5d53a98bf9f4fd4912499374aa1 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 29 Nov 2024 11:46:42 +0100 Subject: [PATCH 286/362] Better button variables --- panel/src/components/Navigation/Button.vue | 12 +++++------- panel/src/styles/utilities/theme.css | 7 ++++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/panel/src/components/Navigation/Button.vue b/panel/src/components/Navigation/Button.vue index 1700707556..92a1eeca51 100644 --- a/panel/src/components/Navigation/Button.vue +++ b/panel/src/components/Navigation/Button.vue @@ -240,6 +240,7 @@ export default { --button-rounded: var(--spacing-1); --button-text-display: block; --button-icon-display: block; + --button-filled-color-back: light-dark(var(--color-gray-300), var(--color-gray-950)); } .k-button { @@ -305,23 +306,20 @@ export default { /** Filled Buttons **/ .k-button:where([data-variant="filled"]) { - --button-color-back: light-dark(var(--color-gray-300), var(--color-gray-950)); + --button-color-back: var(--button-filled-color-back); } .k-button:where([data-variant="filled"]):not([aria-disabled="true"]):hover { filter: brightness(97%); } .k-button:where([data-variant="filled"][data-theme]) { - --button-color-icon: var(--theme-color-700); + --button-color-icon: var(--theme-color-icon-highlight); --button-color-back: var(--theme-color-back); --button-color-text: var(--theme-color-text-highlight); } .k-button:where([data-theme$="-icon"][data-variant="filled"]) { - --button-color-icon: hsl( - var(--theme-color-hs), - 57% - ); /* slightly improve the contrast */ - --button-color-back: light-dark(var(--color-gray-300), var(--color-gray-950)); + --button-color-icon: var(--theme-color-icon); + --button-color-back: var(--button-filled-color-back); --button-color-text: currentColor; } diff --git a/panel/src/styles/utilities/theme.css b/panel/src/styles/utilities/theme.css index 2d7397e67b..2d5ee1bdce 100644 --- a/panel/src/styles/utilities/theme.css +++ b/panel/src/styles/utilities/theme.css @@ -25,6 +25,10 @@ --theme-color-900: hsl(var(--theme-color-hs), var(--theme-color-l-900)); --theme-color-border: light-dark(var(--theme-color-500), var(--theme-color-600)); + --theme-color-back: light-dark(var(--theme-color-400), var(--theme-color-500)); + --theme-color-hover: var(--theme-color-600); + --theme-color-icon: var(--theme-color-600); + --theme-color-icon-highlight: var(--theme-color-700); --theme-color-text: light-dark(var(--theme-color-900), var(--theme-color-400)); --theme-color-text-dimmed: hsl( var(--theme-color-h), @@ -32,9 +36,6 @@ 50% ); --theme-color-text-highlight: var(--theme-color-900); - --theme-color-back: var(--theme-color-500); - --theme-color-hover: var(--theme-color-500); - --theme-color-icon: light-dark(var(--theme-color-700), var(--theme-color-600)); } /* Color themes */ From 0688d087a012bb27955bdc9f79d0c800b9c324a8 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 29 Nov 2024 11:48:59 +0100 Subject: [PATCH 287/362] Better link colors --- panel/src/components/Text/Text.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panel/src/components/Text/Text.vue b/panel/src/components/Text/Text.vue index dc975aca42..265e93cbe9 100644 --- a/panel/src/components/Text/Text.vue +++ b/panel/src/components/Text/Text.vue @@ -49,8 +49,8 @@ export default { :root { --text-font-size: 1em; --text-line-height: 1.5; - --link-color: light-dark(var(--color-blue-800), var(--color-blue-600)); - --link-color-hover: light-dark(var(--color-black), var(--color-white)); + --link-color: light-dark(var(--color-blue-800), var(--color-blue-500)); + --link-color-hover: light-dark(var(--color-blue-700), var(--color-blue-400)); --link-underline-offset: 2px; } From 11d2565503d8990d4ca2ab2a9f4b82af99dfc60f Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 29 Nov 2024 12:03:34 +0100 Subject: [PATCH 288/362] Adjusted color values --- panel/src/styles/config/colors.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panel/src/styles/config/colors.css b/panel/src/styles/config/colors.css index afbcc19ec7..2bd5629b56 100644 --- a/panel/src/styles/config/colors.css +++ b/panel/src/styles/config/colors.css @@ -299,11 +299,11 @@ --color-l-300: 85%; --color-l-400: 75%; --color-l-500: 65%; - --color-l-600: 50%; + --color-l-600: 52%; --color-l-700: 40%; - --color-l-750: 35%; - --color-l-800: 25%; - --color-l-850: 18%; + --color-l-750: 36%; + --color-l-800: 27%; + --color-l-850: 22%; --color-l-900: 13%; --color-l-950: 8%; --color-l-1000: 5%; From f48255bade44f0c35134efc90d0f5f6d04e00c74 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 29 Nov 2024 13:06:20 +0100 Subject: [PATCH 289/362] Fix choices in dark mode --- panel/src/styles/reset/choice.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panel/src/styles/reset/choice.css b/panel/src/styles/reset/choice.css index 9e4d6f259a..870d0d41c4 100644 --- a/panel/src/styles/reset/choice.css +++ b/panel/src/styles/reset/choice.css @@ -1,6 +1,6 @@ :root { - --choice-color-back: light-dark(var(--color-white), var(--color-gray-850)); - --choice-color-border: light-dark(var(--color-gray-500), var(--color-black)); + --choice-color-back: light-dark(var(--color-white), var(--color-gray-800)); + --choice-color-border: light-dark(var(--color-gray-500), var(--color-gray-600)); --choice-color-checked: var(--color-black); --choice-color-disabled: var(--color-gray-400); --choice-color-icon: var(--color-light); From e5d029387b8f51ba3d5b66096ebbf7b184687cd5 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 29 Nov 2024 13:08:39 +0100 Subject: [PATCH 290/362] Improve text color --- panel/src/styles/utilities/theme.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel/src/styles/utilities/theme.css b/panel/src/styles/utilities/theme.css index 2d5ee1bdce..cf572f1a50 100644 --- a/panel/src/styles/utilities/theme.css +++ b/panel/src/styles/utilities/theme.css @@ -29,7 +29,7 @@ --theme-color-hover: var(--theme-color-600); --theme-color-icon: var(--theme-color-600); --theme-color-icon-highlight: var(--theme-color-700); - --theme-color-text: light-dark(var(--theme-color-900), var(--theme-color-400)); + --theme-color-text: light-dark(var(--theme-color-800), var(--theme-color-500)); --theme-color-text-dimmed: hsl( var(--theme-color-h), calc(var(--theme-color-s) - 60%), From f4c2846bdbf9c9b8a8a28770465d90cdd958b345 Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Fri, 29 Nov 2024 20:53:39 +0100 Subject: [PATCH 291/362] Refactor page render tests out into separate class --- tests/Cms/Pages/PageCacheTest.php | 220 +------------- tests/Cms/Pages/PageRenderTest.php | 269 ++++++++++++++++++ tests/Cms/Pages/PageTest.php | 63 ---- .../cache-default.php} | 0 .../cache-disabled.php} | 0 .../cache-dynamic.php} | 0 .../cache-expiry.php} | 0 .../bar.php => PageRenderTest/hook-bar.php} | 0 .../foo.php => PageRenderTest/hook-foo.php} | 0 9 files changed, 284 insertions(+), 268 deletions(-) create mode 100644 tests/Cms/Pages/PageRenderTest.php rename tests/Cms/Pages/fixtures/{PageCacheTest/default.php => PageRenderTest/cache-default.php} (100%) rename tests/Cms/Pages/fixtures/{PageCacheTest/disabled.php => PageRenderTest/cache-disabled.php} (100%) rename tests/Cms/Pages/fixtures/{PageCacheTest/dynamic.php => PageRenderTest/cache-dynamic.php} (100%) rename tests/Cms/Pages/fixtures/{PageCacheTest/expiry.php => PageRenderTest/cache-expiry.php} (100%) rename tests/Cms/Pages/fixtures/{PageRenderHookTest/bar.php => PageRenderTest/hook-bar.php} (100%) rename tests/Cms/Pages/fixtures/{PageRenderHookTest/foo.php => PageRenderTest/hook-foo.php} (100%) diff --git a/tests/Cms/Pages/PageCacheTest.php b/tests/Cms/Pages/PageCacheTest.php index 73b8402cd6..22eede34ef 100644 --- a/tests/Cms/Pages/PageCacheTest.php +++ b/tests/Cms/Pages/PageCacheTest.php @@ -2,50 +2,25 @@ namespace Kirby\Cms; -use Kirby\Cache\Value; -use Kirby\Filesystem\Dir; use Kirby\TestCase; class PageCacheTest extends TestCase { - public const FIXTURES = __DIR__ . '/fixtures/PageCacheTest'; - public const TMP = KIRBY_TMP_DIR . '/Cms.PageCache'; + public const TMP = KIRBY_TMP_DIR . '/Cms.PageCache'; public function setUp(): void { $this->app = new App([ 'roots' => [ - 'index' => static::TMP, - 'templates' => static::FIXTURES + 'index' => static::TMP ], 'site' => [ 'children' => [ [ - 'slug' => 'default' + 'slug' => 'one' ], [ - 'slug' => 'expiry', - 'template' => 'expiry' - ], - [ - 'slug' => 'disabled', - 'template' => 'disabled' - ], - [ - 'slug' => 'dynamic-auth', - 'template' => 'dynamic' - ], - [ - 'slug' => 'dynamic-cookie', - 'template' => 'dynamic' - ], - [ - 'slug' => 'dynamic-session', - 'template' => 'dynamic' - ], - [ - 'slug' => 'dynamic-auth-session', - 'template' => 'dynamic' + 'slug' => 'another' ] ] ], @@ -53,19 +28,6 @@ public function setUp(): void 'cache.pages' => true ] ]); - - Dir::make(static::TMP); - } - - public function tearDown(): void - { - Dir::remove(static::TMP); - - unset( - $_COOKIE['foo'], - $_COOKIE['kirby_session'], - $_SERVER['HTTP_AUTHORIZATION'] - ); } public static function requestMethodProvider(): array @@ -91,7 +53,7 @@ public function testRequestMethod($method, $expected) ] ]); - $this->assertSame($expected, $app->page('default')->isCacheable()); + $this->assertSame($expected, $app->page('one')->isCacheable()); } /** @@ -106,7 +68,7 @@ public function testRequestData($method) ] ]); - $this->assertFalse($app->page('default')->isCacheable()); + $this->assertFalse($app->page('one')->isCacheable()); } public function testRequestParams() @@ -117,7 +79,7 @@ public function testRequestParams() ] ]); - $this->assertFalse($app->page('default')->isCacheable()); + $this->assertFalse($app->page('one')->isCacheable()); } public function testIgnoreId() @@ -126,14 +88,14 @@ public function testIgnoreId() 'options' => [ 'cache.pages' => [ 'ignore' => [ - 'expiry' + 'another' ] ] ] ]); - $this->assertTrue($app->page('default')->isCacheable()); - $this->assertFalse($app->page('expiry')->isCacheable()); + $this->assertTrue($app->page('one')->isCacheable()); + $this->assertFalse($app->page('another')->isCacheable()); } public function testIgnoreCallback() @@ -141,13 +103,13 @@ public function testIgnoreCallback() $app = $this->app->clone([ 'options' => [ 'cache.pages' => [ - 'ignore' => fn ($page) => $page->id() === 'default' + 'ignore' => fn ($page) => $page->id() === 'one' ] ] ]); - $this->assertFalse($app->page('default')->isCacheable()); - $this->assertTrue($app->page('expiry')->isCacheable()); + $this->assertFalse($app->page('one')->isCacheable()); + $this->assertTrue($app->page('another')->isCacheable()); } public function testDisabledCache() @@ -159,7 +121,7 @@ public function testDisabledCache() ] ]); - $this->assertFalse($app->page('default')->isCacheable()); + $this->assertFalse($app->page('one')->isCacheable()); // deactivate in array $app = $this->app->clone([ @@ -170,158 +132,6 @@ public function testDisabledCache() ] ]); - $this->assertFalse($app->page('default')->isCacheable()); - } - - public function testRenderCache() - { - $cache = $this->app->cache('pages'); - $page = $this->app->page('default'); - - $this->assertNull($cache->retrieve('default.html')); - - $html1 = $page->render(); - $this->assertStringStartsWith('This is a test:', $html1); - - $value = $cache->retrieve('default.html'); - $this->assertInstanceOf(Value::class, $value); - $this->assertSame($html1, $value->value()['html']); - $this->assertNull($value->expires()); - - $html2 = $page->render(); - $this->assertSame($html1, $html2); - } - - public function testRenderCacheCustomExpiry() - { - $cache = $this->app->cache('pages'); - $page = $this->app->page('expiry'); - - $this->assertNull($cache->retrieve('expiry.html')); - - $time = $page->render(); - - $value = $cache->retrieve('expiry.html'); - $this->assertInstanceOf(Value::class, $value); - $this->assertSame($time, $value->value()['html']); - $this->assertSame((int)$time, $value->expires()); - } - - public function testRenderCacheDisabled() - { - $cache = $this->app->cache('pages'); - $page = $this->app->page('disabled'); - - $this->assertNull($cache->retrieve('disabled.html')); - - $html1 = $page->render(); - $this->assertStringStartsWith('This is a test:', $html1); - - $this->assertNull($cache->retrieve('disabled.html')); - - $html2 = $page->render(); - $this->assertNotSame($html1, $html2); - } - - public static function dynamicProvider(): array - { - return [ - ['dynamic-auth', ['auth']], - ['dynamic-cookie', ['cookie']], - ['dynamic-session', ['session']], - ['dynamic-auth-session', ['auth', 'session']], - ]; - } - - /** - * @dataProvider dynamicProvider - */ - public function testRenderCacheDynamicNonActive(string $slug, array $dynamicElements) - { - $cache = $this->app->cache('pages'); - $page = $this->app->page($slug); - - $this->assertNull($cache->retrieve($slug . '.html')); - - $html1 = $page->render(); - $this->assertStringStartsWith('This is a test:', $html1); - - $cacheValue = $cache->retrieve($slug . '.html'); - $this->assertNotNull($cacheValue); - $this->assertSame(in_array('auth', $dynamicElements), $cacheValue->value()['usesAuth']); - if (in_array('cookie', $dynamicElements)) { - $this->assertSame(['foo'], $cacheValue->value()['usesCookies']); - } elseif (in_array('session', $dynamicElements)) { - $this->assertSame(['kirby_session'], $cacheValue->value()['usesCookies']); - } else { - $this->assertSame([], $cacheValue->value()['usesCookies']); - } - - // reset the Kirby Responder object - $this->setUp(); - $html2 = $page->render(); - $this->assertSame($html1, $html2); - } - - /** - * @dataProvider dynamicProvider - */ - public function testRenderCacheDynamicActiveOnFirstRender(string $slug, array $dynamicElements) - { - $_COOKIE['foo'] = $_COOKIE['kirby_session'] = 'bar'; - $this->app->clone([ - 'server' => [ - 'HTTP_AUTHORIZATION' => 'Bearer brown-bearer' - ] - ]); - - $cache = $this->app->cache('pages'); - $page = $this->app->page($slug); - - $this->assertNull($cache->retrieve($slug . '.html')); - - $html1 = $page->render(); - $this->assertStringStartsWith('This is a test:', $html1); - - $cacheValue = $cache->retrieve($slug . '.html'); - $this->assertNull($cacheValue); - - // reset the Kirby Responder object - $this->setUp(); - $html2 = $page->render(); - $this->assertNotSame($html1, $html2); - } - - /** - * @dataProvider dynamicProvider - */ - public function testRenderCacheDynamicActiveOnSecondRender(string $slug, array $dynamicElements) - { - $cache = $this->app->cache('pages'); - $page = $this->app->page($slug); - - $this->assertNull($cache->retrieve($slug . '.html')); - - $html1 = $page->render(); - $this->assertStringStartsWith('This is a test:', $html1); - - $cacheValue = $cache->retrieve($slug . '.html'); - $this->assertNotNull($cacheValue); - $this->assertSame(in_array('auth', $dynamicElements), $cacheValue->value()['usesAuth']); - if (in_array('cookie', $dynamicElements)) { - $this->assertSame(['foo'], $cacheValue->value()['usesCookies']); - } elseif (in_array('session', $dynamicElements)) { - $this->assertSame(['kirby_session'], $cacheValue->value()['usesCookies']); - } else { - $this->assertSame([], $cacheValue->value()['usesCookies']); - } - - $_COOKIE['foo'] = $_COOKIE['kirby_session'] = 'bar'; - $_SERVER['HTTP_AUTHORIZATION'] = 'Bearer brown-bearer'; - - // reset the Kirby Responder object - $this->setUp(); - $html2 = $page->render(); - $this->assertNotSame($html1, $html2); + $this->assertFalse($app->page('one')->isCacheable()); } } diff --git a/tests/Cms/Pages/PageRenderTest.php b/tests/Cms/Pages/PageRenderTest.php new file mode 100644 index 0000000000..0881d29ebe --- /dev/null +++ b/tests/Cms/Pages/PageRenderTest.php @@ -0,0 +1,269 @@ +app = new App([ + 'roots' => [ + 'index' => static::TMP, + 'templates' => static::FIXTURES + ], + 'site' => [ + 'children' => [ + [ + 'slug' => 'default', + 'template' => 'cache-default' + ], + [ + 'slug' => 'expiry', + 'template' => 'cache-expiry' + ], + [ + 'slug' => 'disabled', + 'template' => 'cache-disabled' + ], + [ + 'slug' => 'dynamic-auth', + 'template' => 'cache-dynamic' + ], + [ + 'slug' => 'dynamic-cookie', + 'template' => 'cache-dynamic' + ], + [ + 'slug' => 'dynamic-session', + 'template' => 'cache-dynamic' + ], + [ + 'slug' => 'dynamic-auth-session', + 'template' => 'cache-dynamic' + ], + [ + 'slug' => 'bar', + 'template' => 'hook-bar', + 'content' => [ + 'title' => 'Bar Title', + ] + ], + [ + 'slug' => 'foo', + 'template' => 'hook-foo', + 'content' => [ + 'title' => 'Foo Title', + ] + ] + ] + ], + 'options' => [ + 'cache.pages' => true + ] + ]); + + Dir::make(static::TMP); + } + + public function tearDown(): void + { + Dir::remove(static::TMP); + + unset( + $_COOKIE['foo'], + $_COOKIE['kirby_session'], + $_SERVER['HTTP_AUTHORIZATION'] + ); + } + + public function testCache() + { + $cache = $this->app->cache('pages'); + $page = $this->app->page('default'); + + $this->assertNull($cache->retrieve('default.html')); + + $html1 = $page->render(); + $this->assertStringStartsWith('This is a test:', $html1); + + $value = $cache->retrieve('default.html'); + $this->assertInstanceOf(Value::class, $value); + $this->assertSame($html1, $value->value()['html']); + $this->assertNull($value->expires()); + + $html2 = $page->render(); + $this->assertSame($html1, $html2); + } + + public function testCacheCustomExpiry() + { + $cache = $this->app->cache('pages'); + $page = $this->app->page('expiry'); + + $this->assertNull($cache->retrieve('expiry.html')); + + $time = $page->render(); + + $value = $cache->retrieve('expiry.html'); + $this->assertInstanceOf(Value::class, $value); + $this->assertSame($time, $value->value()['html']); + $this->assertSame((int)$time, $value->expires()); + } + + public function testCacheDisabled() + { + $cache = $this->app->cache('pages'); + $page = $this->app->page('disabled'); + + $this->assertNull($cache->retrieve('disabled.html')); + + $html1 = $page->render(); + $this->assertStringStartsWith('This is a test:', $html1); + + $this->assertNull($cache->retrieve('disabled.html')); + + $html2 = $page->render(); + $this->assertNotSame($html1, $html2); + } + + public static function dynamicProvider(): array + { + return [ + ['dynamic-auth', ['auth']], + ['dynamic-cookie', ['cookie']], + ['dynamic-session', ['session']], + ['dynamic-auth-session', ['auth', 'session']], + ]; + } + + /** + * @dataProvider dynamicProvider + */ + public function testCacheDynamicNonActive(string $slug, array $dynamicElements) + { + $cache = $this->app->cache('pages'); + $page = $this->app->page($slug); + + $this->assertNull($cache->retrieve($slug . '.html')); + + $html1 = $page->render(); + $this->assertStringStartsWith('This is a test:', $html1); + + $cacheValue = $cache->retrieve($slug . '.html'); + $this->assertNotNull($cacheValue); + $this->assertSame(in_array('auth', $dynamicElements), $cacheValue->value()['usesAuth']); + if (in_array('cookie', $dynamicElements)) { + $this->assertSame(['foo'], $cacheValue->value()['usesCookies']); + } elseif (in_array('session', $dynamicElements)) { + $this->assertSame(['kirby_session'], $cacheValue->value()['usesCookies']); + } else { + $this->assertSame([], $cacheValue->value()['usesCookies']); + } + + // reset the Kirby Responder object + $this->setUp(); + $html2 = $page->render(); + $this->assertSame($html1, $html2); + } + + /** + * @dataProvider dynamicProvider + */ + public function testCacheDynamicActiveOnFirstRender(string $slug, array $dynamicElements) + { + $_COOKIE['foo'] = $_COOKIE['kirby_session'] = 'bar'; + $this->app->clone([ + 'server' => [ + 'HTTP_AUTHORIZATION' => 'Bearer brown-bearer' + ] + ]); + + $cache = $this->app->cache('pages'); + $page = $this->app->page($slug); + + $this->assertNull($cache->retrieve($slug . '.html')); + + $html1 = $page->render(); + $this->assertStringStartsWith('This is a test:', $html1); + + $cacheValue = $cache->retrieve($slug . '.html'); + $this->assertNull($cacheValue); + + // reset the Kirby Responder object + $this->setUp(); + $html2 = $page->render(); + $this->assertNotSame($html1, $html2); + } + + /** + * @dataProvider dynamicProvider + */ + public function testCacheDynamicActiveOnSecondRender(string $slug, array $dynamicElements) + { + $cache = $this->app->cache('pages'); + $page = $this->app->page($slug); + + $this->assertNull($cache->retrieve($slug . '.html')); + + $html1 = $page->render(); + $this->assertStringStartsWith('This is a test:', $html1); + + $cacheValue = $cache->retrieve($slug . '.html'); + $this->assertNotNull($cacheValue); + $this->assertSame(in_array('auth', $dynamicElements), $cacheValue->value()['usesAuth']); + if (in_array('cookie', $dynamicElements)) { + $this->assertSame(['foo'], $cacheValue->value()['usesCookies']); + } elseif (in_array('session', $dynamicElements)) { + $this->assertSame(['kirby_session'], $cacheValue->value()['usesCookies']); + } else { + $this->assertSame([], $cacheValue->value()['usesCookies']); + } + + $_COOKIE['foo'] = $_COOKIE['kirby_session'] = 'bar'; + $_SERVER['HTTP_AUTHORIZATION'] = 'Bearer brown-bearer'; + + // reset the Kirby Responder object + $this->setUp(); + $html2 = $page->render(); + $this->assertNotSame($html1, $html2); + } + + public function testHookBefore() + { + $app = $this->app->clone([ + 'hooks' => [ + 'page.render:before' => function ($contentType, $data, $page) { + $data['bar'] = 'Test'; + return $data; + } + ] + ]); + + $page = $app->page('bar'); + $this->assertSame('Bar Title : Test', $page->render()); + } + + public function testHookAfter() + { + $app = $this->app->clone([ + 'hooks' => [ + 'page.render:after' => function ($contentType, $data, $html, $page) { + return str_replace(':', '-', $html); + } + ] + ]); + + $page = $app->page('foo'); + $this->assertSame('foo - Foo Title', $page->render()); + } +} diff --git a/tests/Cms/Pages/PageTest.php b/tests/Cms/Pages/PageTest.php index 868f043624..12044eb7eb 100644 --- a/tests/Cms/Pages/PageTest.php +++ b/tests/Cms/Pages/PageTest.php @@ -1138,67 +1138,4 @@ public function testToArray() $this->assertSame($expected, $page->toArray()); } - - public function testRenderBeforeHook() - { - $app = new App([ - 'roots' => [ - 'index' => static::TMP - ], - 'templates' => [ - 'bar' => static::FIXTURES . '/PageRenderHookTest/bar.php' - ], - 'site' => [ - 'children' => [ - [ - 'slug' => 'bar', - 'template' => 'bar', - 'content' => [ - 'title' => 'Bar Title', - ] - ] - ], - ], - 'hooks' => [ - 'page.render:before' => function ($contentType, $data, $page) { - $data['bar'] = 'Test'; - return $data; - } - ] - ]); - - $page = $app->page('bar'); - $this->assertSame('Bar Title : Test', $page->render()); - } - - public function testRenderAfterHook() - { - $app = new App([ - 'roots' => [ - 'index' => static::TMP - ], - 'templates' => [ - 'foo' => static::FIXTURES . '/PageRenderHookTest/foo.php' - ], - 'site' => [ - 'children' => [ - [ - 'slug' => 'foo', - 'template' => 'foo', - 'content' => [ - 'title' => 'Foo Title', - ] - ] - ], - ], - 'hooks' => [ - 'page.render:after' => function ($contentType, $data, $html, $page) { - return str_replace(':', '-', $html); - } - ] - ]); - - $page = $app->page('foo'); - $this->assertSame('foo - Foo Title', $page->render()); - } } diff --git a/tests/Cms/Pages/fixtures/PageCacheTest/default.php b/tests/Cms/Pages/fixtures/PageRenderTest/cache-default.php similarity index 100% rename from tests/Cms/Pages/fixtures/PageCacheTest/default.php rename to tests/Cms/Pages/fixtures/PageRenderTest/cache-default.php diff --git a/tests/Cms/Pages/fixtures/PageCacheTest/disabled.php b/tests/Cms/Pages/fixtures/PageRenderTest/cache-disabled.php similarity index 100% rename from tests/Cms/Pages/fixtures/PageCacheTest/disabled.php rename to tests/Cms/Pages/fixtures/PageRenderTest/cache-disabled.php diff --git a/tests/Cms/Pages/fixtures/PageCacheTest/dynamic.php b/tests/Cms/Pages/fixtures/PageRenderTest/cache-dynamic.php similarity index 100% rename from tests/Cms/Pages/fixtures/PageCacheTest/dynamic.php rename to tests/Cms/Pages/fixtures/PageRenderTest/cache-dynamic.php diff --git a/tests/Cms/Pages/fixtures/PageCacheTest/expiry.php b/tests/Cms/Pages/fixtures/PageRenderTest/cache-expiry.php similarity index 100% rename from tests/Cms/Pages/fixtures/PageCacheTest/expiry.php rename to tests/Cms/Pages/fixtures/PageRenderTest/cache-expiry.php diff --git a/tests/Cms/Pages/fixtures/PageRenderHookTest/bar.php b/tests/Cms/Pages/fixtures/PageRenderTest/hook-bar.php similarity index 100% rename from tests/Cms/Pages/fixtures/PageRenderHookTest/bar.php rename to tests/Cms/Pages/fixtures/PageRenderTest/hook-bar.php diff --git a/tests/Cms/Pages/fixtures/PageRenderHookTest/foo.php b/tests/Cms/Pages/fixtures/PageRenderTest/hook-foo.php similarity index 100% rename from tests/Cms/Pages/fixtures/PageRenderHookTest/foo.php rename to tests/Cms/Pages/fixtures/PageRenderTest/hook-foo.php From ce1cc6ea1d1672613d94fd08ccc6fad856991085 Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Fri, 29 Nov 2024 20:55:38 +0100 Subject: [PATCH 292/362] Extend page render unit tests --- tests/Cms/Pages/PageRenderTest.php | 135 +++++++++++++++++- .../PageRenderTest/controllers/controller.php | 7 + .../PageRenderTest/templates/cache-data.php | 1 + .../{ => templates}/cache-default.php | 0 .../{ => templates}/cache-disabled.php | 0 .../{ => templates}/cache-dynamic.php | 0 .../{ => templates}/cache-expiry.php | 0 .../templates/cache-metadata.php | 7 + .../PageRenderTest/templates/controller.php | 1 + .../{ => templates}/hook-bar.php | 0 .../{ => templates}/hook-foo.php | 0 .../templates/representation.json.php | 1 + .../templates/representation.php | 1 + 13 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 tests/Cms/Pages/fixtures/PageRenderTest/controllers/controller.php create mode 100644 tests/Cms/Pages/fixtures/PageRenderTest/templates/cache-data.php rename tests/Cms/Pages/fixtures/PageRenderTest/{ => templates}/cache-default.php (100%) rename tests/Cms/Pages/fixtures/PageRenderTest/{ => templates}/cache-disabled.php (100%) rename tests/Cms/Pages/fixtures/PageRenderTest/{ => templates}/cache-dynamic.php (100%) rename tests/Cms/Pages/fixtures/PageRenderTest/{ => templates}/cache-expiry.php (100%) create mode 100644 tests/Cms/Pages/fixtures/PageRenderTest/templates/cache-metadata.php create mode 100644 tests/Cms/Pages/fixtures/PageRenderTest/templates/controller.php rename tests/Cms/Pages/fixtures/PageRenderTest/{ => templates}/hook-bar.php (100%) rename tests/Cms/Pages/fixtures/PageRenderTest/{ => templates}/hook-foo.php (100%) create mode 100644 tests/Cms/Pages/fixtures/PageRenderTest/templates/representation.json.php create mode 100644 tests/Cms/Pages/fixtures/PageRenderTest/templates/representation.php diff --git a/tests/Cms/Pages/PageRenderTest.php b/tests/Cms/Pages/PageRenderTest.php index 0881d29ebe..2585e946ff 100644 --- a/tests/Cms/Pages/PageRenderTest.php +++ b/tests/Cms/Pages/PageRenderTest.php @@ -3,6 +3,7 @@ namespace Kirby\Cms; use Kirby\Cache\Value; +use Kirby\Exception\NotFoundException; use Kirby\Filesystem\Dir; use Kirby\TestCase; @@ -18,8 +19,9 @@ public function setUp(): void { $this->app = new App([ 'roots' => [ - 'index' => static::TMP, - 'templates' => static::FIXTURES + 'index' => static::TMP, + 'controllers' => static::FIXTURES . '/controllers', + 'templates' => static::FIXTURES . '/templates' ], 'site' => [ 'children' => [ @@ -27,10 +29,18 @@ public function setUp(): void 'slug' => 'default', 'template' => 'cache-default' ], + [ + 'slug' => 'data', + 'template' => 'cache-data' + ], [ 'slug' => 'expiry', 'template' => 'cache-expiry' ], + [ + 'slug' => 'metadata', + 'template' => 'cache-metadata', + ], [ 'slug' => 'disabled', 'template' => 'cache-disabled' @@ -51,6 +61,18 @@ public function setUp(): void 'slug' => 'dynamic-auth-session', 'template' => 'cache-dynamic' ], + [ + 'slug' => 'representation', + 'template' => 'representation' + ], + [ + 'slug' => 'invalid', + 'template' => 'invalid', + ], + [ + 'slug' => 'controller', + 'template' => 'controller', + ], [ 'slug' => 'bar', 'template' => 'hook-bar', @@ -120,6 +142,33 @@ public function testCacheCustomExpiry() $this->assertSame((int)$time, $value->expires()); } + public function testCacheMetadata() + { + $cache = $this->app->cache('pages'); + $page = $this->app->page('metadata'); + + $this->assertNull($cache->retrieve('metadata.html')); + + $html1 = $page->render(); + $this->assertStringStartsWith('This is a test:', $html1); + $this->assertSame(202, $this->app->response()->code()); + $this->assertSame(['Cache-Control' => 'private'], $this->app->response()->headers()); + $this->assertSame('text/plain', $this->app->response()->type()); + + // reset the Kirby Responder object + $this->setUp(); + $this->assertNull($this->app->response()->code()); + $this->assertSame([], $this->app->response()->headers()); + $this->assertNull($this->app->response()->type()); + + // ensure the Responder object is restored from cache + $html2 = $this->app->page('metadata')->render(); + $this->assertSame($html1, $html2); + $this->assertSame(202, $this->app->response()->code()); + $this->assertSame(['Cache-Control' => 'private'], $this->app->response()->headers()); + $this->assertSame('text/plain', $this->app->response()->type()); + } + public function testCacheDisabled() { $cache = $this->app->cache('pages'); @@ -133,6 +182,7 @@ public function testCacheDisabled() $this->assertNull($cache->retrieve('disabled.html')); $html2 = $page->render(); + $this->assertStringStartsWith('This is a test:', $html2); $this->assertNotSame($html1, $html2); } @@ -202,6 +252,7 @@ public function testCacheDynamicActiveOnFirstRender(string $slug, array $dynamic // reset the Kirby Responder object $this->setUp(); $html2 = $page->render(); + $this->assertStringStartsWith('This is a test:', $html2); $this->assertNotSame($html1, $html2); } @@ -235,9 +286,89 @@ public function testCacheDynamicActiveOnSecondRender(string $slug, array $dynami // reset the Kirby Responder object $this->setUp(); $html2 = $page->render(); + $this->assertStringStartsWith('This is a test:', $html2); $this->assertNotSame($html1, $html2); } + public function testCacheDataInitial() + { + $cache = $this->app->cache('pages'); + $page = $this->app->page('data'); + + $this->assertNull($cache->retrieve('data.html')); + + $html = $page->render(['test' => 'custom test']); + $this->assertStringStartsWith('This is a custom test:', $html); + + $this->assertNull($cache->retrieve('data.html')); + } + + public function testCacheDataPreCached() + { + $cache = $this->app->cache('pages'); + $page = $this->app->page('data'); + + $this->assertNull($cache->retrieve('data.html')); + + $html1 = $page->render(); + $this->assertStringStartsWith('This is a test:', $html1); + + $value = $cache->retrieve('data.html'); + $this->assertInstanceOf(Value::class, $value); + $this->assertSame($html1, $value->value()['html']); + $this->assertNull($value->expires()); + + $html2 = $page->render(['test' => 'custom test']); + $this->assertStringStartsWith('This is a custom test:', $html2); + + // cache still stores the non-custom result + $value = $cache->retrieve('data.html'); + $this->assertInstanceOf(Value::class, $value); + $this->assertSame($html1, $value->value()['html']); + $this->assertNull($value->expires()); + } + + public function testRepresentationDefault() + { + $page = $this->app->page('representation'); + + $this->assertSame('Some HTML: representation', $page->render()); + } + + public function testRepresentationOverride() + { + $page = $this->app->page('representation'); + + $this->assertSame('Some HTML: representation', $page->render(contentType: 'html')); + $this->assertSame('{"some json": "representation"}', $page->render(contentType: 'json')); + } + + public function testRepresentationMissing() + { + $this->expectException(NotFoundException::class); + $this->expectExceptionMessage('The content representation cannot be found'); + + $page = $this->app->page('representation'); + $page->render(contentType: 'txt'); + } + + public function testTemplateMissing() + { + $this->expectException(NotFoundException::class); + $this->expectExceptionMessage('The default template does not exist'); + + $page = $this->app->page('invalid'); + $page->render(); + } + + public function testController() + { + $page = $this->app->page('controller'); + + $this->assertSame('Data says TEST: controller and default!', $page->render()); + $this->assertSame('Data says TEST: controller and custom!', $page->render(['test' => 'override', 'test2' => 'custom'])); + } + public function testHookBefore() { $app = $this->app->clone([ diff --git a/tests/Cms/Pages/fixtures/PageRenderTest/controllers/controller.php b/tests/Cms/Pages/fixtures/PageRenderTest/controllers/controller.php new file mode 100644 index 0000000000..6580bf3e40 --- /dev/null +++ b/tests/Cms/Pages/fixtures/PageRenderTest/controllers/controller.php @@ -0,0 +1,7 @@ + 'TEST: ' . $page->title() + ]; +}; diff --git a/tests/Cms/Pages/fixtures/PageRenderTest/templates/cache-data.php b/tests/Cms/Pages/fixtures/PageRenderTest/templates/cache-data.php new file mode 100644 index 0000000000..d95089c9a1 --- /dev/null +++ b/tests/Cms/Pages/fixtures/PageRenderTest/templates/cache-data.php @@ -0,0 +1 @@ +This is a : diff --git a/tests/Cms/Pages/fixtures/PageRenderTest/cache-default.php b/tests/Cms/Pages/fixtures/PageRenderTest/templates/cache-default.php similarity index 100% rename from tests/Cms/Pages/fixtures/PageRenderTest/cache-default.php rename to tests/Cms/Pages/fixtures/PageRenderTest/templates/cache-default.php diff --git a/tests/Cms/Pages/fixtures/PageRenderTest/cache-disabled.php b/tests/Cms/Pages/fixtures/PageRenderTest/templates/cache-disabled.php similarity index 100% rename from tests/Cms/Pages/fixtures/PageRenderTest/cache-disabled.php rename to tests/Cms/Pages/fixtures/PageRenderTest/templates/cache-disabled.php diff --git a/tests/Cms/Pages/fixtures/PageRenderTest/cache-dynamic.php b/tests/Cms/Pages/fixtures/PageRenderTest/templates/cache-dynamic.php similarity index 100% rename from tests/Cms/Pages/fixtures/PageRenderTest/cache-dynamic.php rename to tests/Cms/Pages/fixtures/PageRenderTest/templates/cache-dynamic.php diff --git a/tests/Cms/Pages/fixtures/PageRenderTest/cache-expiry.php b/tests/Cms/Pages/fixtures/PageRenderTest/templates/cache-expiry.php similarity index 100% rename from tests/Cms/Pages/fixtures/PageRenderTest/cache-expiry.php rename to tests/Cms/Pages/fixtures/PageRenderTest/templates/cache-expiry.php diff --git a/tests/Cms/Pages/fixtures/PageRenderTest/templates/cache-metadata.php b/tests/Cms/Pages/fixtures/PageRenderTest/templates/cache-metadata.php new file mode 100644 index 0000000000..b56a59d50f --- /dev/null +++ b/tests/Cms/Pages/fixtures/PageRenderTest/templates/cache-metadata.php @@ -0,0 +1,7 @@ +response()->code(202); +$kirby->response()->header('Cache-Control', 'private'); +$kirby->response()->type('text/plain'); + +echo 'This is a test: ' . uniqid(); diff --git a/tests/Cms/Pages/fixtures/PageRenderTest/templates/controller.php b/tests/Cms/Pages/fixtures/PageRenderTest/templates/controller.php new file mode 100644 index 0000000000..bc3c982ccb --- /dev/null +++ b/tests/Cms/Pages/fixtures/PageRenderTest/templates/controller.php @@ -0,0 +1 @@ +Data says and ! \ No newline at end of file diff --git a/tests/Cms/Pages/fixtures/PageRenderTest/hook-bar.php b/tests/Cms/Pages/fixtures/PageRenderTest/templates/hook-bar.php similarity index 100% rename from tests/Cms/Pages/fixtures/PageRenderTest/hook-bar.php rename to tests/Cms/Pages/fixtures/PageRenderTest/templates/hook-bar.php diff --git a/tests/Cms/Pages/fixtures/PageRenderTest/hook-foo.php b/tests/Cms/Pages/fixtures/PageRenderTest/templates/hook-foo.php similarity index 100% rename from tests/Cms/Pages/fixtures/PageRenderTest/hook-foo.php rename to tests/Cms/Pages/fixtures/PageRenderTest/templates/hook-foo.php diff --git a/tests/Cms/Pages/fixtures/PageRenderTest/templates/representation.json.php b/tests/Cms/Pages/fixtures/PageRenderTest/templates/representation.json.php new file mode 100644 index 0000000000..ae0a94c3f4 --- /dev/null +++ b/tests/Cms/Pages/fixtures/PageRenderTest/templates/representation.json.php @@ -0,0 +1 @@ +{"some json": "title() ?>"} \ No newline at end of file diff --git a/tests/Cms/Pages/fixtures/PageRenderTest/templates/representation.php b/tests/Cms/Pages/fixtures/PageRenderTest/templates/representation.php new file mode 100644 index 0000000000..12abc0f002 --- /dev/null +++ b/tests/Cms/Pages/fixtures/PageRenderTest/templates/representation.php @@ -0,0 +1 @@ +Some HTML: title() ?> \ No newline at end of file From f307e86c48f59c394883554b3b57f38287b29852 Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Fri, 29 Nov 2024 21:24:42 +0100 Subject: [PATCH 293/362] Fix coverage detection --- tests/Cms/Pages/PageRenderTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Cms/Pages/PageRenderTest.php b/tests/Cms/Pages/PageRenderTest.php index 2585e946ff..a66b3dd38b 100644 --- a/tests/Cms/Pages/PageRenderTest.php +++ b/tests/Cms/Pages/PageRenderTest.php @@ -8,6 +8,7 @@ use Kirby\TestCase; /** + * @covers \Kirby\Cms\Page::cacheId * @covers \Kirby\Cms\Page::render */ class PageRenderTest extends TestCase From 62e211ee4df319fa00c03fb3ca05d38488fbe5d5 Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Sun, 1 Dec 2024 18:19:37 +0100 Subject: [PATCH 294/362] Move `isCacheable()` tests into `PageRenderTest` https://github.com/getkirby/kirby/pull/6821#pullrequestreview-2470845211 --- tests/Cms/Pages/PageCacheTest.php | 137 ------------------- tests/Cms/Pages/PageRenderTest.php | 212 ++++++++++++++++++++++++++--- 2 files changed, 194 insertions(+), 155 deletions(-) delete mode 100644 tests/Cms/Pages/PageCacheTest.php diff --git a/tests/Cms/Pages/PageCacheTest.php b/tests/Cms/Pages/PageCacheTest.php deleted file mode 100644 index 22eede34ef..0000000000 --- a/tests/Cms/Pages/PageCacheTest.php +++ /dev/null @@ -1,137 +0,0 @@ -app = new App([ - 'roots' => [ - 'index' => static::TMP - ], - 'site' => [ - 'children' => [ - [ - 'slug' => 'one' - ], - [ - 'slug' => 'another' - ] - ] - ], - 'options' => [ - 'cache.pages' => true - ] - ]); - } - - public static function requestMethodProvider(): array - { - return [ - ['GET', true], - ['HEAD', true], - ['POST', false], - ['DELETE', false], - ['PATCH', false], - ['PUT', false], - ]; - } - - /** - * @dataProvider requestMethodProvider - */ - public function testRequestMethod($method, $expected) - { - $app = $this->app->clone([ - 'request' => [ - 'method' => $method - ] - ]); - - $this->assertSame($expected, $app->page('one')->isCacheable()); - } - - /** - * @dataProvider requestMethodProvider - */ - public function testRequestData($method) - { - $app = $this->app->clone([ - 'request' => [ - 'method' => $method, - 'query' => ['foo' => 'bar'] - ] - ]); - - $this->assertFalse($app->page('one')->isCacheable()); - } - - public function testRequestParams() - { - $app = $this->app->clone([ - 'request' => [ - 'url' => 'https://getkirby.com/blog/page:2' - ] - ]); - - $this->assertFalse($app->page('one')->isCacheable()); - } - - public function testIgnoreId() - { - $app = $this->app->clone([ - 'options' => [ - 'cache.pages' => [ - 'ignore' => [ - 'another' - ] - ] - ] - ]); - - $this->assertTrue($app->page('one')->isCacheable()); - $this->assertFalse($app->page('another')->isCacheable()); - } - - public function testIgnoreCallback() - { - $app = $this->app->clone([ - 'options' => [ - 'cache.pages' => [ - 'ignore' => fn ($page) => $page->id() === 'one' - ] - ] - ]); - - $this->assertFalse($app->page('one')->isCacheable()); - $this->assertTrue($app->page('another')->isCacheable()); - } - - public function testDisabledCache() - { - // deactivate on top level - $app = $this->app->clone([ - 'options' => [ - 'cache.pages' => false - ] - ]); - - $this->assertFalse($app->page('one')->isCacheable()); - - // deactivate in array - $app = $this->app->clone([ - 'options' => [ - 'cache.pages' => [ - 'active' => false - ] - ] - ]); - - $this->assertFalse($app->page('one')->isCacheable()); - } -} diff --git a/tests/Cms/Pages/PageRenderTest.php b/tests/Cms/Pages/PageRenderTest.php index a66b3dd38b..402691952c 100644 --- a/tests/Cms/Pages/PageRenderTest.php +++ b/tests/Cms/Pages/PageRenderTest.php @@ -8,8 +8,7 @@ use Kirby\TestCase; /** - * @covers \Kirby\Cms\Page::cacheId - * @covers \Kirby\Cms\Page::render + * @coversDefaultClass \Kirby\Cms\Page */ class PageRenderTest extends TestCase { @@ -109,7 +108,130 @@ public function tearDown(): void ); } - public function testCache() + public static function requestMethodProvider(): array + { + return [ + ['GET', true], + ['HEAD', true], + ['POST', false], + ['DELETE', false], + ['PATCH', false], + ['PUT', false], + ]; + } + + /** + * @covers ::isCacheable + * @dataProvider requestMethodProvider + */ + public function testIsCacheableRequestMethod($method, $expected) + { + $app = $this->app->clone([ + 'request' => [ + 'method' => $method + ] + ]); + + $this->assertSame($expected, $app->page('default')->isCacheable()); + } + + /** + * @covers ::isCacheable + * @dataProvider requestMethodProvider + */ + public function testIsCacheableRequestData($method) + { + $app = $this->app->clone([ + 'request' => [ + 'method' => $method, + 'query' => ['foo' => 'bar'] + ] + ]); + + $this->assertFalse($app->page('default')->isCacheable()); + } + + /** + * @covers ::isCacheable + */ + public function testIsCacheableRequestParams() + { + $app = $this->app->clone([ + 'request' => [ + 'url' => 'https://getkirby.com/blog/page:2' + ] + ]); + + $this->assertFalse($app->page('default')->isCacheable()); + } + + /** + * @covers ::isCacheable + */ + public function testIsCacheableIgnoreId() + { + $app = $this->app->clone([ + 'options' => [ + 'cache.pages' => [ + 'ignore' => [ + 'data' + ] + ] + ] + ]); + + $this->assertTrue($app->page('default')->isCacheable()); + $this->assertFalse($app->page('data')->isCacheable()); + } + + /** + * @covers ::isCacheable + */ + public function testIsCacheableIgnoreCallback() + { + $app = $this->app->clone([ + 'options' => [ + 'cache.pages' => [ + 'ignore' => fn ($page) => $page->id() === 'default' + ] + ] + ]); + + $this->assertFalse($app->page('default')->isCacheable()); + $this->assertTrue($app->page('data')->isCacheable()); + } + + /** + * @covers ::isCacheable + */ + public function testIsCacheableDisabledCache() + { + // deactivate on top level + $app = $this->app->clone([ + 'options' => [ + 'cache.pages' => false + ] + ]); + + $this->assertFalse($app->page('default')->isCacheable()); + + // deactivate in array + $app = $this->app->clone([ + 'options' => [ + 'cache.pages' => [ + 'active' => false + ] + ] + ]); + + $this->assertFalse($app->page('default')->isCacheable()); + } + + /** + * @covers ::cacheId + * @covers ::render + */ + public function testRenderCache() { $cache = $this->app->cache('pages'); $page = $this->app->page('default'); @@ -128,7 +250,11 @@ public function testCache() $this->assertSame($html1, $html2); } - public function testCacheCustomExpiry() + /** + * @covers ::cacheId + * @covers ::render + */ + public function testRenderCacheCustomExpiry() { $cache = $this->app->cache('pages'); $page = $this->app->page('expiry'); @@ -143,7 +269,11 @@ public function testCacheCustomExpiry() $this->assertSame((int)$time, $value->expires()); } - public function testCacheMetadata() + /** + * @covers ::cacheId + * @covers ::render + */ + public function testRenderCacheMetadata() { $cache = $this->app->cache('pages'); $page = $this->app->page('metadata'); @@ -170,7 +300,11 @@ public function testCacheMetadata() $this->assertSame('text/plain', $this->app->response()->type()); } - public function testCacheDisabled() + /** + * @covers ::cacheId + * @covers ::render + */ + public function testRenderCacheDisabled() { $cache = $this->app->cache('pages'); $page = $this->app->page('disabled'); @@ -198,9 +332,11 @@ public static function dynamicProvider(): array } /** + * @covers ::cacheId + * @covers ::render * @dataProvider dynamicProvider */ - public function testCacheDynamicNonActive(string $slug, array $dynamicElements) + public function testRenderCacheDynamicNonActive(string $slug, array $dynamicElements) { $cache = $this->app->cache('pages'); $page = $this->app->page($slug); @@ -228,9 +364,11 @@ public function testCacheDynamicNonActive(string $slug, array $dynamicElements) } /** + * @covers ::cacheId + * @covers ::render * @dataProvider dynamicProvider */ - public function testCacheDynamicActiveOnFirstRender(string $slug, array $dynamicElements) + public function testRenderCacheDynamicActiveOnFirstRender(string $slug, array $dynamicElements) { $_COOKIE['foo'] = $_COOKIE['kirby_session'] = 'bar'; $this->app->clone([ @@ -258,9 +396,11 @@ public function testCacheDynamicActiveOnFirstRender(string $slug, array $dynamic } /** + * @covers ::cacheId + * @covers ::render * @dataProvider dynamicProvider */ - public function testCacheDynamicActiveOnSecondRender(string $slug, array $dynamicElements) + public function testRenderCacheDynamicActiveOnSecondRender(string $slug, array $dynamicElements) { $cache = $this->app->cache('pages'); $page = $this->app->page($slug); @@ -291,7 +431,11 @@ public function testCacheDynamicActiveOnSecondRender(string $slug, array $dynami $this->assertNotSame($html1, $html2); } - public function testCacheDataInitial() + /** + * @covers ::cacheId + * @covers ::render + */ + public function testRenderCacheDataInitial() { $cache = $this->app->cache('pages'); $page = $this->app->page('data'); @@ -304,7 +448,11 @@ public function testCacheDataInitial() $this->assertNull($cache->retrieve('data.html')); } - public function testCacheDataPreCached() + /** + * @covers ::cacheId + * @covers ::render + */ + public function testRenderCacheDataPreCached() { $cache = $this->app->cache('pages'); $page = $this->app->page('data'); @@ -329,14 +477,22 @@ public function testCacheDataPreCached() $this->assertNull($value->expires()); } - public function testRepresentationDefault() + /** + * @covers ::cacheId + * @covers ::render + */ + public function testRenderRepresentationDefault() { $page = $this->app->page('representation'); $this->assertSame('Some HTML: representation', $page->render()); } - public function testRepresentationOverride() + /** + * @covers ::cacheId + * @covers ::render + */ + public function testRenderRepresentationOverride() { $page = $this->app->page('representation'); @@ -344,7 +500,11 @@ public function testRepresentationOverride() $this->assertSame('{"some json": "representation"}', $page->render(contentType: 'json')); } - public function testRepresentationMissing() + /** + * @covers ::cacheId + * @covers ::render + */ + public function testRenderRepresentationMissing() { $this->expectException(NotFoundException::class); $this->expectExceptionMessage('The content representation cannot be found'); @@ -353,7 +513,11 @@ public function testRepresentationMissing() $page->render(contentType: 'txt'); } - public function testTemplateMissing() + /** + * @covers ::cacheId + * @covers ::render + */ + public function testRenderTemplateMissing() { $this->expectException(NotFoundException::class); $this->expectExceptionMessage('The default template does not exist'); @@ -362,7 +526,11 @@ public function testTemplateMissing() $page->render(); } - public function testController() + /** + * @covers ::cacheId + * @covers ::render + */ + public function testRenderController() { $page = $this->app->page('controller'); @@ -370,7 +538,11 @@ public function testController() $this->assertSame('Data says TEST: controller and custom!', $page->render(['test' => 'override', 'test2' => 'custom'])); } - public function testHookBefore() + /** + * @covers ::cacheId + * @covers ::render + */ + public function testRenderHookBefore() { $app = $this->app->clone([ 'hooks' => [ @@ -385,7 +557,11 @@ public function testHookBefore() $this->assertSame('Bar Title : Test', $page->render()); } - public function testHookAfter() + /** + * @covers ::cacheId + * @covers ::render + */ + public function testRenderHookAfter() { $app = $this->app->clone([ 'hooks' => [ From 8125515ae92ad42608aff960ce24305b0a010afe Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Fri, 29 Nov 2024 21:12:47 +0100 Subject: [PATCH 295/362] `$app->contentToken()`: Support null for `$model` --- src/Cms/App.php | 2 +- tests/Cms/App/AppTest.php | 30 ++++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/Cms/App.php b/src/Cms/App.php index 67980b3d7d..436f3854f5 100644 --- a/src/Cms/App.php +++ b/src/Cms/App.php @@ -438,7 +438,7 @@ public function contentToken(mixed $model, string $value): string { $default = $this->root('content'); - if (method_exists($model, 'id') === true) { + if (is_object($model) === true && method_exists($model, 'id') === true) { $default .= '/' . $model->id(); } diff --git a/tests/Cms/App/AppTest.php b/tests/Cms/App/AppTest.php index 52f3ef18a4..e076dca742 100644 --- a/tests/Cms/App/AppTest.php +++ b/tests/Cms/App/AppTest.php @@ -265,14 +265,28 @@ public function testCollectionWithOptions() */ public function testContentToken() { + $model = new class () { + public function id(): string + { + return 'some-id'; + } + + public function type(): string + { + return 'sea'; + } + }; + // without configured salt $app = new App([ 'roots' => [ 'index' => '/dev/null' ] ]); + $this->assertSame(hash_hmac('sha1', 'test', '/dev/null/content/some-id'), $app->contentToken($model, 'test')); $this->assertSame(hash_hmac('sha1', 'test', '/dev/null/content'), $app->contentToken('model', 'test')); $this->assertSame(hash_hmac('sha1', 'test', '/dev/null/content'), $app->contentToken($app, 'test')); + $this->assertSame(hash_hmac('sha1', 'test', '/dev/null/content'), $app->contentToken(null, 'test')); // with custom static salt $app = new App([ @@ -280,15 +294,27 @@ public function testContentToken() 'content.salt' => 'salt and pepper and chili' ] ]); + $this->assertSame(hash_hmac('sha1', 'test', 'salt and pepper and chili'), $app->contentToken($model, 'test')); $this->assertSame(hash_hmac('sha1', 'test', 'salt and pepper and chili'), $app->contentToken('model', 'test')); + $this->assertSame(hash_hmac('sha1', 'test', 'salt and pepper and chili'), $app->contentToken($app, 'test')); + $this->assertSame(hash_hmac('sha1', 'test', 'salt and pepper and chili'), $app->contentToken(null, 'test')); - // with callback + // with callback 1 $app = new App([ 'options' => [ - 'content.salt' => fn ($model) => 'salt ' . $model + 'content.salt' => fn (string $model) => 'salt ' . $model ] ]); $this->assertSame(hash_hmac('sha1', 'test', 'salt lake city'), $app->contentToken('lake city', 'test')); + + // with callback 2 + $app = new App([ + 'options' => [ + 'content.salt' => fn (object|null $model) => $model?->type() . ' salt' + ] + ]); + $this->assertSame(hash_hmac('sha1', 'test', 'sea salt'), $app->contentToken($model, 'test')); + $this->assertSame(hash_hmac('sha1', 'test', ' salt'), $app->contentToken(null, 'test')); } /** From efe8a512feee23693d099560e5ace91f5bca55a6 Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Sun, 17 Nov 2024 21:22:34 +0100 Subject: [PATCH 296/362] More secure token validation `hash_equals()` uses a fixed-time algorithm that mitigates timing attacks --- src/Cms/Page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cms/Page.php b/src/Cms/Page.php index aa3c31bb72..e404aabb87 100644 --- a/src/Cms/Page.php +++ b/src/Cms/Page.php @@ -789,7 +789,7 @@ public function isVerified(string|null $token = null): bool return false; } - return $this->token() === $token; + return hash_equals($this->token(), $token); } /** From 465233275f8225cc014a2ee8d47f409fdbb9008e Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Sun, 1 Dec 2024 18:25:19 +0100 Subject: [PATCH 297/362] `$app->contentToken()`: Stricter model type --- src/Cms/App.php | 6 +++--- tests/Cms/App/AppTest.php | 12 +----------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/Cms/App.php b/src/Cms/App.php index 436f3854f5..d8f11527ac 100644 --- a/src/Cms/App.php +++ b/src/Cms/App.php @@ -431,14 +431,14 @@ public function contentIgnore(): array * Generates a non-guessable token based on model * data and a configured salt * - * @param mixed $model Object to pass to the salt callback if configured + * @param object|null $model Object to pass to the salt callback if configured * @param string $value Model data to include in the generated token */ - public function contentToken(mixed $model, string $value): string + public function contentToken(object|null $model, string $value): string { $default = $this->root('content'); - if (is_object($model) === true && method_exists($model, 'id') === true) { + if ($model !== null && method_exists($model, 'id') === true) { $default .= '/' . $model->id(); } diff --git a/tests/Cms/App/AppTest.php b/tests/Cms/App/AppTest.php index e076dca742..06fb366ebb 100644 --- a/tests/Cms/App/AppTest.php +++ b/tests/Cms/App/AppTest.php @@ -284,7 +284,6 @@ public function type(): string ] ]); $this->assertSame(hash_hmac('sha1', 'test', '/dev/null/content/some-id'), $app->contentToken($model, 'test')); - $this->assertSame(hash_hmac('sha1', 'test', '/dev/null/content'), $app->contentToken('model', 'test')); $this->assertSame(hash_hmac('sha1', 'test', '/dev/null/content'), $app->contentToken($app, 'test')); $this->assertSame(hash_hmac('sha1', 'test', '/dev/null/content'), $app->contentToken(null, 'test')); @@ -295,19 +294,10 @@ public function type(): string ] ]); $this->assertSame(hash_hmac('sha1', 'test', 'salt and pepper and chili'), $app->contentToken($model, 'test')); - $this->assertSame(hash_hmac('sha1', 'test', 'salt and pepper and chili'), $app->contentToken('model', 'test')); $this->assertSame(hash_hmac('sha1', 'test', 'salt and pepper and chili'), $app->contentToken($app, 'test')); $this->assertSame(hash_hmac('sha1', 'test', 'salt and pepper and chili'), $app->contentToken(null, 'test')); - // with callback 1 - $app = new App([ - 'options' => [ - 'content.salt' => fn (string $model) => 'salt ' . $model - ] - ]); - $this->assertSame(hash_hmac('sha1', 'test', 'salt lake city'), $app->contentToken('lake city', 'test')); - - // with callback 2 + // with callback $app = new App([ 'options' => [ 'content.salt' => fn (object|null $model) => $model?->type() . ' salt' From eb83b87da055711519d0933944779ef92ce2b221 Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Sun, 1 Dec 2024 17:48:42 +0100 Subject: [PATCH 298/362] Move `$model->previewUrl()` to `$version->url()` --- src/Cms/Page.php | 27 +-- src/Cms/Site.php | 23 +-- src/Content/Version.php | 58 +++++++ tests/Content/TestCase.php | 14 +- tests/Content/VersionTest.php | 303 ++++++++++++++++++++++++++++++++++ 5 files changed, 377 insertions(+), 48 deletions(-) diff --git a/src/Cms/Page.php b/src/Cms/Page.php index e404aabb87..b890840f55 100644 --- a/src/Cms/Page.php +++ b/src/Cms/Page.php @@ -10,7 +10,6 @@ use Kirby\Exception\NotFoundException; use Kirby\Filesystem\Dir; use Kirby\Http\Response; -use Kirby\Http\Uri; use Kirby\Panel\Page as Panel; use Kirby\Template\Template; use Kirby\Toolkit\A; @@ -927,34 +926,12 @@ public function permissions(): PagePermissions } /** - * Draft preview Url + * Returns the preview URL with authentication for drafts * @internal */ public function previewUrl(VersionId|string $version = 'latest'): string|null { - $versionId = VersionId::from($version); - $url = $this->blueprint()->preview(); - - if ($url === false) { - return null; - } - - $url = match ($url) { - true, null => $this->url(), - default => $url - }; - - $uri = new Uri($url); - - if ($this->isDraft() === true) { - $uri->query->token = $this->token(); - } - - if ($versionId->is('changes') === true) { - $uri->query->_version = 'changes'; - } - - return $uri->toString(); + return $this->version($version)->url(); } /** diff --git a/src/Cms/Site.php b/src/Cms/Site.php index bb681c01e1..c781a8093c 100644 --- a/src/Cms/Site.php +++ b/src/Cms/Site.php @@ -6,7 +6,6 @@ use Kirby\Exception\InvalidArgumentException; use Kirby\Exception\LogicException; use Kirby\Filesystem\Dir; -use Kirby\Http\Uri; use Kirby\Panel\Site as Panel; use Kirby\Toolkit\A; @@ -350,30 +349,12 @@ public function permissions(): SitePermissions } /** - * Preview Url + * Returns the preview URL with authentication for drafts * @internal */ public function previewUrl(VersionId|string $versionId = 'latest'): string|null { - $versionId = VersionId::from($versionId); - $url = $this->blueprint()->preview(); - - if ($url === false) { - return null; - } - - $url = match ($url) { - true, null => $this->url(), - default => $url - }; - - $uri = new Uri($url); - - if ($versionId->is('changes') === true) { - $uri->query->_version = 'changes'; - } - - return $uri->toString(); + return $this->version($versionId)->url(); } /** diff --git a/src/Content/Version.php b/src/Content/Version.php index e4d9c14197..e87b041fcb 100644 --- a/src/Content/Version.php +++ b/src/Content/Version.php @@ -7,8 +7,11 @@ use Kirby\Cms\Languages; use Kirby\Cms\ModelWithContent; use Kirby\Cms\Page; +use Kirby\Cms\Site; +use Kirby\Exception\LogicException; use Kirby\Exception\NotFoundException; use Kirby\Form\Form; +use Kirby\Http\Uri; /** * The Version class handles all actions for a single @@ -388,6 +391,25 @@ protected function prepareFieldsForContent( return $fields; } + /** + * Returns a verification token for the authentication + * of draft previews + * @internal + */ + public function previewToken(): string + { + $id = match (true) { + $this->model instanceof Site => '', + $this->model instanceof Page => $this->model->id() . $this->model->template(), + default => throw new LogicException('Invalid model type') + }; + + return $this->model->kirby()->contentToken( + $this->model, + $id + ); + } + /** * This method can only be applied to the "changes" version. * It will copy all fields over to the "latest" version and delete @@ -519,4 +541,40 @@ public function update( fields: $this->prepareFieldsBeforeWrite($fields, $language) ); } + + /** + * Returns the preview URL with authentication for drafts + * @internal + */ + public function url(): string|null + { + if ( + ($this->model instanceof Page || $this->model instanceof Site) === false + ) { + throw new LogicException('Only pages and the site have a content preview URL'); + } + + $url = $this->model->blueprint()->preview(); + + if ($url === false) { + return null; + } + + $url = match ($url) { + true, null => $this->model->url(), + default => $url + }; + + $uri = new Uri($url); + + if ($this->model instanceof Page && $this->model->isDraft() === true) { + $uri->query->token = $this->previewToken(); + } + + if ($this->id->is('changes') === true) { + $uri->query->_version = 'changes'; + } + + return $uri->toString(); + } } diff --git a/tests/Content/TestCase.php b/tests/Content/TestCase.php index 02183e31db..9225254c29 100644 --- a/tests/Content/TestCase.php +++ b/tests/Content/TestCase.php @@ -87,7 +87,12 @@ public function setUpMultiLanguage( 'children' => [ [ 'slug' => 'a-page', - 'template' => 'article' + 'template' => 'article', + 'files' => [ + [ + 'filename' => 'a-file.jpg' + ] + ] ] ] ] @@ -106,7 +111,12 @@ public function setUpSingleLanguage( 'children' => [ [ 'slug' => 'a-page', - 'template' => 'article' + 'template' => 'article', + 'files' => [ + [ + 'filename' => 'a-file.jpg' + ] + ] ] ] ] diff --git a/tests/Content/VersionTest.php b/tests/Content/VersionTest.php index 001a112819..eb2aa473e1 100644 --- a/tests/Content/VersionTest.php +++ b/tests/Content/VersionTest.php @@ -3,6 +3,8 @@ namespace Kirby\Content; use Kirby\Cms\File; +use Kirby\Cms\Page; +use Kirby\Cms\Site; use Kirby\Data\Data; use Kirby\Exception\LogicException; use Kirby\Exception\NotFoundException; @@ -771,6 +773,46 @@ public function testMoveToVersion(): void $this->assertSame($content, Data::read($fileENLatest)); } + /** + * @covers ::previewToken + */ + public function testPreviewToken() + { + $this->setUpSingleLanguage(); + + // site + $version = new Version( + model: $this->app->site(), + id: VersionId::latest() + ); + $this->assertSame(hash_hmac('sha1', '', static::TMP . '/content/'), $version->previewToken()); + + // page + $version = new Version( + model: $this->model, + id: VersionId::latest() + ); + $this->assertSame(hash_hmac('sha1', 'a-pagedefault', static::TMP . '/content/a-page'), $version->previewToken()); + } + + /** + * @covers ::previewToken + */ + public function testPreviewTokenInvalidModel() + { + $this->expectException(LogicException::class); + $this->expectExceptionMessage('Invalid model type'); + + $this->setUpSingleLanguage(); + + $version = new Version( + model: $this->model->file(), + id: VersionId::latest() + ); + + $version->previewToken(); + } + /** * @covers ::publish */ @@ -1354,4 +1396,265 @@ public function testUpdateWithDirtyFields(): void $this->assertArrayHasKey('date', $version->read('en')); $this->assertArrayNotHasKey('date', $version->read('de')); } + + /** + * @covers ::url + */ + public function testUrlPage() + { + $this->setUpSingleLanguage(); + + // authenticate + $this->app->impersonate('kirby'); + + $version = new Version( + model: $this->model, + id: VersionId::latest() + ); + + $this->assertSame('/a-page', $version->url()); + } + + /** + * @covers ::url + */ + public function testUrlPageUnauthenticated() + { + $this->setUpSingleLanguage(); + + $version = new Version( + model: $this->model, + id: VersionId::latest() + ); + + $this->assertNull($version->url()); + } + + public static function pageUrlProvider(): array + { + return [ + // latest version + [null, '/test', false, 'latest'], + [null, '/test?{token}', true, 'latest'], + [true, '/test', false, 'latest'], + [true, '/test?{token}', true, 'latest'], + ['/something/different', '/something/different', false, 'latest'], + ['/something/different', '/something/different?{token}', true, 'latest'], + ['{{ site.url }}#{{ page.slug }}', '/#test', false, 'latest'], + ['{{ site.url }}#{{ page.slug }}', '/?{token}#test', true, 'latest'], + ['{{ page.url }}?preview=true', '/test?preview=true', false, 'latest'], + ['{{ page.url }}?preview=true', '/test?preview=true&{token}', true, 'latest'], + [false, null, false, 'latest'], + [false, null, true, 'latest'], + [null, null, false, 'latest', false], + + // changes version + [null, '/test?_version=changes', false, 'changes'], + [null, '/test?{token}&_version=changes', true, 'changes'], + [true, '/test?_version=changes', false, 'changes'], + [true, '/test?{token}&_version=changes', true, 'changes'], + ['/something/different', '/something/different?_version=changes', false, 'changes'], + ['/something/different', '/something/different?{token}&_version=changes', true, 'changes'], + ['{{ site.url }}#{{ page.slug }}', '/?_version=changes#test', false, 'changes'], + ['{{ site.url }}#{{ page.slug }}', '/?{token}&_version=changes#test', true, 'changes'], + ['{{ page.url }}?preview=true', '/test?preview=true&_version=changes', false, 'changes'], + ['{{ page.url }}?preview=true', '/test?preview=true&{token}&_version=changes', true, 'changes'], + [false, null, false, 'changes'], + [false, null, true, 'changes'], + [null, null, false, 'changes', false], + ]; + } + + /** + * @covers ::url + * @dataProvider pageUrlProvider + */ + public function testUrlPageCustom( + $input, + $expected, + bool $draft, + string $versionId, + bool $authenticated = true + ): void { + $this->setUpSingleLanguage(); + + $app = $this->app->clone([ + 'users' => [ + [ + 'id' => 'test', + 'email' => 'test@getkirby.com', + 'role' => 'editor' + ] + ], + 'roles' => [ + [ + 'id' => 'editor', + 'name' => 'editor', + ] + ] + ]); + + // authenticate + if ($authenticated === true) { + $app->impersonate('test@getkirby.com'); + } + + $options = []; + + if ($input !== null) { + $options = [ + 'preview' => $input + ]; + } + + $page = new Page([ + 'slug' => 'test', + 'isDraft' => $draft, + 'blueprint' => [ + 'name' => 'test', + 'options' => $options + ] + ]); + + if ($expected !== null) { + $expected = str_replace( + '{token}', + 'token=' . hash_hmac('sha1', $page->id() . $page->template(), $page->kirby()->root('content') . '/' . $page->id()), + $expected + ); + } + + $version = new Version( + model: $page, + id: VersionId::from($versionId) + ); + + $this->assertSame($expected, $version->url()); + } + + /** + * @covers ::url + */ + public function testUrlSite() + { + $this->setUpSingleLanguage(); + + // authenticate + $this->app->impersonate('kirby'); + + $version = new Version( + model: $this->app->site(), + id: VersionId::latest() + ); + + $this->assertSame('/', $version->url()); + } + + /** + * @covers ::url + */ + public function testUrlSiteUnauthenticated() + { + $this->setUpSingleLanguage(); + + $version = new Version( + model: $this->app->site(), + id: VersionId::latest() + ); + + $this->assertNull($version->url()); + } + + public static function siteUrlProvider(): array + { + return [ + // latest version + [null, '/', 'latest'], + ['https://test.com', 'https://test.com', 'latest'], + ['{{ site.url }}#test', '/#test', 'latest'], + [false, null, 'latest'], + [null, null, 'latest', false], + + // changes version + [null, '/?_version=changes', 'changes'], + ['https://test.com', 'https://test.com?_version=changes', 'changes'], + ['{{ site.url }}#test', '/?_version=changes#test', 'changes'], + [false, null, 'changes'], + [null, null, 'changes', false], + ]; + } + + /** + * @covers ::url + * @dataProvider siteUrlProvider + */ + public function testUrlSiteCustom( + $input, + $expected, + string $versionId, + bool $authenticated = true + ): void { + $this->setUpSingleLanguage(); + + $app = $this->app->clone([ + 'users' => [ + [ + 'id' => 'test', + 'email' => 'test@getkirby.com', + 'role' => 'editor' + ] + ], + 'roles' => [ + [ + 'id' => 'editor', + 'name' => 'editor', + ] + ] + ]); + + // authenticate + if ($authenticated === true) { + $app->impersonate('test@getkirby.com'); + } + + $options = []; + + if ($input !== null) { + $options = [ + 'preview' => $input + ]; + } + + $site = new Site([ + 'blueprint' => [ + 'name' => 'site', + 'options' => $options + ] + ]); + + $version = new Version( + model: $site, + id: VersionId::from($versionId) + ); + + $this->assertSame($expected, $version->url()); + } + + /** + * @covers ::url + */ + public function testUrlInvalidModel() + { + $this->expectException(LogicException::class); + $this->expectExceptionMessage('Only pages and the site have a content preview URL'); + + $this->setUpSingleLanguage(); + + $version = new Version( + model: $this->model->file(), + id: VersionId::latest() + ); + + $version->url(); + } } From 1c5cb5e95f1a300720d259ad22b957251c8f85fb Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Sun, 1 Dec 2024 17:49:28 +0100 Subject: [PATCH 299/362] Fix parameter name for consistency --- src/Cms/Page.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cms/Page.php b/src/Cms/Page.php index b890840f55..70ce936973 100644 --- a/src/Cms/Page.php +++ b/src/Cms/Page.php @@ -929,9 +929,9 @@ public function permissions(): PagePermissions * Returns the preview URL with authentication for drafts * @internal */ - public function previewUrl(VersionId|string $version = 'latest'): string|null + public function previewUrl(VersionId|string $versionId = 'latest'): string|null { - return $this->version($version)->url(); + return $this->version($versionId)->url(); } /** From 383706b42d38c84a466c5ede973561b4df86f568 Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Sun, 1 Dec 2024 18:05:01 +0100 Subject: [PATCH 300/362] Rename `token` query param for consistency --- src/Cms/App.php | 2 +- src/Content/Version.php | 2 +- tests/Cms/App/AppResolveTest.php | 37 ++++++++++++++++++++++++++++++++ tests/Cms/Pages/PageTest.php | 2 +- tests/Content/VersionTest.php | 2 +- 5 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/Cms/App.php b/src/Cms/App.php index d8f11527ac..800e126a20 100644 --- a/src/Cms/App.php +++ b/src/Cms/App.php @@ -1289,7 +1289,7 @@ public function resolve(string|null $path = null, string|null $language = null): if (!$page && $draft = $site->draft($path)) { if ( $this->user() || - $draft->isVerified($this->request()->get('token')) + $draft->isVerified($this->request()->get('_token')) ) { $page = $draft; } diff --git a/src/Content/Version.php b/src/Content/Version.php index e87b041fcb..79fcc24c55 100644 --- a/src/Content/Version.php +++ b/src/Content/Version.php @@ -568,7 +568,7 @@ public function url(): string|null $uri = new Uri($url); if ($this->model instanceof Page && $this->model->isDraft() === true) { - $uri->query->token = $this->previewToken(); + $uri->query->_token = $this->previewToken(); } if ($this->id->is('changes') === true) { diff --git a/tests/Cms/App/AppResolveTest.php b/tests/Cms/App/AppResolveTest.php index 309a788b7d..1da298a8d6 100644 --- a/tests/Cms/App/AppResolveTest.php +++ b/tests/Cms/App/AppResolveTest.php @@ -75,6 +75,43 @@ public function testResolveSubPage() $this->assertSame('test/subpage', $result->id()); } + public function testResolveDraft() + { + $app = new App([ + 'roots' => [ + 'index' => '/dev/null' + ], + 'site' => [ + 'children' => [ + [ + 'slug' => 'test', + 'drafts' => [ + [ + 'slug' => 'a-draft', + ] + ] + ] + ] + ] + ]); + + $result = $app->resolve('test/a-draft'); + $this->assertNull($result); + + $app = $app->clone([ + 'request' => [ + 'query' => [ + '_token' => $app->page('test/a-draft')->version()->previewToken() + ] + ] + ]); + + $result = $app->resolve('test/a-draft'); + + $this->assertIsPage($result); + $this->assertSame('test/a-draft', $result->id()); + } + public function testResolvePageRepresentation() { F::write($template = static::TMP . '/test.php', 'html'); diff --git a/tests/Cms/Pages/PageTest.php b/tests/Cms/Pages/PageTest.php index 12044eb7eb..2af53199de 100644 --- a/tests/Cms/Pages/PageTest.php +++ b/tests/Cms/Pages/PageTest.php @@ -680,7 +680,7 @@ public function testCustomPreviewUrl( if ($draft === true && $expected !== null) { $expected = str_replace( '{token}', - 'token=' . hash_hmac('sha1', $page->id() . $page->template(), $page->kirby()->root('content') . '/' . $page->id()), + '_token=' . hash_hmac('sha1', $page->id() . $page->template(), $page->kirby()->root('content') . '/' . $page->id()), $expected ); } diff --git a/tests/Content/VersionTest.php b/tests/Content/VersionTest.php index eb2aa473e1..4600f5988f 100644 --- a/tests/Content/VersionTest.php +++ b/tests/Content/VersionTest.php @@ -1519,7 +1519,7 @@ public function testUrlPageCustom( if ($expected !== null) { $expected = str_replace( '{token}', - 'token=' . hash_hmac('sha1', $page->id() . $page->template(), $page->kirby()->root('content') . '/' . $page->id()), + '_token=' . hash_hmac('sha1', $page->id() . $page->template(), $page->kirby()->root('content') . '/' . $page->id()), $expected ); } From b57e95e5363799a1edc1b0ace1d12a90770fbf88 Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Sun, 1 Dec 2024 18:09:56 +0100 Subject: [PATCH 301/362] New `VersionId::render()` method --- src/Content/VersionId.php | 19 ++++++ tests/Content/VersionIdTest.php | 116 ++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+) diff --git a/src/Content/VersionId.php b/src/Content/VersionId.php index 06d5c8220a..26f2f952d5 100644 --- a/src/Content/VersionId.php +++ b/src/Content/VersionId.php @@ -2,6 +2,7 @@ namespace Kirby\Content; +use Closure; use Kirby\Exception\InvalidArgumentException; use Stringable; @@ -104,6 +105,24 @@ public static function latest(): static return new static(static::LATEST); } + /** + * Temporarily sets the version ID for preview rendering + * only for the logic in the callback + */ + public static function render(VersionId|string $versionId, Closure $callback): mixed + { + $original = static::$render; + static::$render = static::from($versionId); + + try { + return $callback(); + } finally { + // ensure that the render version ID is *always* reset + // to the original value, even if an error occurred + static::$render = $original; + } + } + /** * Returns the ID value */ diff --git a/tests/Content/VersionIdTest.php b/tests/Content/VersionIdTest.php index a0ddd59734..9921305847 100644 --- a/tests/Content/VersionIdTest.php +++ b/tests/Content/VersionIdTest.php @@ -2,6 +2,7 @@ namespace Kirby\Content; +use Exception; use Kirby\Exception\InvalidArgumentException; use Kirby\TestCase; @@ -10,6 +11,13 @@ */ class VersionIdTest extends TestCase { + public function tearDown(): void + { + parent::tearDown(); + + VersionId::$render = null; + } + /** * @covers ::all */ @@ -88,6 +96,114 @@ public function testLatest() $this->assertSame('latest', $version->value()); } + /** + * @covers ::render + */ + public function testRenderString() + { + $executed = 0; + + $this->assertNull(VersionId::$render); + + $return = VersionId::render('latest', function () use (&$executed) { + $executed++; + $this->assertSame('latest', VersionId::$render->value()); + + return 'some string'; + }); + $this->assertSame('some string', $return); + + $this->assertNull(VersionId::$render); + + $return = VersionId::render('changes', function () use (&$executed) { + $executed += 2; + $this->assertSame('changes', VersionId::$render->value()); + + return 12345; + }); + $this->assertSame(12345, $return); + + $this->assertNull(VersionId::$render); + $this->assertSame(3, $executed); + } + + /** + * @covers ::render + */ + public function testRenderInstance() + { + $executed = 0; + + $this->assertNull(VersionId::$render); + + $return = VersionId::render(VersionId::latest(), function () use (&$executed) { + $executed++; + $this->assertSame('latest', VersionId::$render->value()); + + return 'some string'; + }); + $this->assertSame('some string', $return); + + $this->assertNull(VersionId::$render); + + $return = VersionId::render(VersionId::changes(), function () use (&$executed) { + $executed += 2; + $this->assertSame('changes', VersionId::$render->value()); + + return 12345; + }); + $this->assertSame(12345, $return); + + $this->assertNull(VersionId::$render); + $this->assertSame(3, $executed); + } + + /** + * @covers ::render + */ + public function testRenderPreviousValue() + { + $executed = 0; + + VersionId::$render = VersionId::latest(); + + $return = VersionId::render('changes', function () use (&$executed) { + $executed++; + $this->assertSame('changes', VersionId::$render->value()); + + return 'some string'; + }); + $this->assertSame('some string', $return); + + $this->assertSame('latest', VersionId::$render->value()); + $this->assertSame(1, $executed); + } + + /** + * @covers ::render + */ + public function testRenderException() + { + $executed = 0; + + $this->assertNull(VersionId::$render); + + try { + VersionId::render(VersionId::latest(), function () use (&$executed) { + $executed++; + $this->assertSame('latest', VersionId::$render->value()); + + throw new Exception('Something went wrong'); + }); + } catch (Exception $e) { + $executed += 2; + $this->assertSame('Something went wrong', $e->getMessage()); + } + + $this->assertNull(VersionId::$render); + $this->assertSame(3, $executed); + } + /** * @covers ::__toString */ From 1e1cb18ce748697926c14ad0937c695f7f0daff7 Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Sun, 1 Dec 2024 18:10:35 +0100 Subject: [PATCH 302/362] Move render version detection to `Page::render()` --- src/Cms/App.php | 12 -- src/Cms/Page.php | 77 +++++++----- tests/Cms/Pages/PageRenderTest.php | 111 ++++++++++++++++++ .../templates/version-exception.php | 13 ++ .../templates/version-recursive.php | 3 + .../PageRenderTest/templates/version.php | 2 + 6 files changed, 175 insertions(+), 43 deletions(-) create mode 100644 tests/Cms/Pages/fixtures/PageRenderTest/templates/version-exception.php create mode 100644 tests/Cms/Pages/fixtures/PageRenderTest/templates/version-recursive.php create mode 100644 tests/Cms/Pages/fixtures/PageRenderTest/templates/version.php diff --git a/src/Cms/App.php b/src/Cms/App.php index 800e126a20..bd97c940be 100644 --- a/src/Cms/App.php +++ b/src/Cms/App.php @@ -4,7 +4,6 @@ use Closure; use Generator; -use Kirby\Content\VersionId; use Kirby\Data\Data; use Kirby\Email\Email as BaseEmail; use Kirby\Exception\ErrorPageException; @@ -1218,17 +1217,6 @@ public function render( return null; } - /** - * TODO: very rough preview mode for changes. - * - * We need page token verification for this before v5 - * hits beta. This rough implementation will only help - * to get the panel integration up and running during the alpha - */ - if ($this->request()->get('_version') === 'changes') { - VersionId::$render = VersionId::changes(); - } - return $this->io($this->call($path, $method)); } diff --git a/src/Cms/Page.php b/src/Cms/Page.php index 70ce936973..45572684bc 100644 --- a/src/Cms/Page.php +++ b/src/Cms/Page.php @@ -942,13 +942,25 @@ public function previewUrl(VersionId|string $versionId = 'latest'): string|null * the default template. * * @param string $contentType + * @param \Kirby\Content\VersionId|string|null $versionId Optional override for the auto-detected version to render * @throws \Kirby\Exception\NotFoundException If the default template cannot be found */ - public function render(array $data = [], $contentType = 'html'): string - { + public function render( + array $data = [], + $contentType = 'html', + VersionId|string|null $versionId = null + ): string { $kirby = $this->kirby(); $cache = $cacheId = $html = null; + // if not manually overridden, first use a globally set + // version ID (e.g. when rendering within another render), + // otherwise auto-detect from the request; + // make sure to convert it to an object + $versionId ??= VersionId::$render; + $versionId ??= $this->kirby()->request()->get('_version') === 'changes' ? VersionId::changes() : VersionId::latest(); + $versionId = VersionId::from($versionId); + // try to get the page from cache if ($data === [] && $this->isCacheable() === true) { $cache = $kirby->cache('pages'); @@ -973,36 +985,39 @@ public function render(array $data = [], $contentType = 'html'): string // fetch the page regularly if ($html === null) { - $template = match ($contentType) { - 'html' => $this->template(), - default => $this->representation($contentType) - }; - - if ($template->exists() === false) { - throw new NotFoundException( - key: 'template.default.notFound' - ); - } + // set `VersionId::$render` to the intended version (only) while we render + $html = VersionId::render($versionId, function () use ($kirby, $data, $contentType) { + $template = match ($contentType) { + 'html' => $this->template(), + default => $this->representation($contentType) + }; - $kirby->data = $this->controller($data, $contentType); - - // trigger before hook and apply for `data` - $kirby->data = $kirby->apply('page.render:before', [ - 'contentType' => $contentType, - 'data' => $kirby->data, - 'page' => $this - ], 'data'); - - // render the page - $html = $template->render($kirby->data); - - // trigger after hook and apply for `html` - $html = $kirby->apply('page.render:after', [ - 'contentType' => $contentType, - 'data' => $kirby->data, - 'html' => $html, - 'page' => $this - ], 'html'); + if ($template->exists() === false) { + throw new NotFoundException( + key: 'template.default.notFound' + ); + } + + $kirby->data = $this->controller($data, $contentType); + + // trigger before hook and apply for `data` + $kirby->data = $kirby->apply('page.render:before', [ + 'contentType' => $contentType, + 'data' => $kirby->data, + 'page' => $this + ], 'data'); + + // render the page + $html = $template->render($kirby->data); + + // trigger after hook and apply for `html` + return $kirby->apply('page.render:after', [ + 'contentType' => $contentType, + 'data' => $kirby->data, + 'html' => $html, + 'page' => $this + ], 'html'); + }); // cache the result $response = $kirby->response(); diff --git a/tests/Cms/Pages/PageRenderTest.php b/tests/Cms/Pages/PageRenderTest.php index 402691952c..8cd050f04f 100644 --- a/tests/Cms/Pages/PageRenderTest.php +++ b/tests/Cms/Pages/PageRenderTest.php @@ -3,6 +3,8 @@ namespace Kirby\Cms; use Kirby\Cache\Value; +use Kirby\Content\VersionId; +use Kirby\Exception\Exception; use Kirby\Exception\NotFoundException; use Kirby\Filesystem\Dir; use Kirby\TestCase; @@ -86,6 +88,18 @@ public function setUp(): void 'content' => [ 'title' => 'Foo Title', ] + ], + [ + 'slug' => 'version', + 'template' => 'version' + ], + [ + 'slug' => 'version-exception', + 'template' => 'version-exception' + ], + [ + 'slug' => 'version-recursive', + 'template' => 'version-recursive' ] ] ], @@ -574,4 +588,101 @@ public function testRenderHookAfter() $page = $app->page('foo'); $this->assertSame('foo - Foo Title', $page->render()); } + + public function testVersionDetectedFromRequest() + { + // TODO: To be removed in the next PR when caching respects versions + $this->app = $this->app->clone([ + 'options' => [ + 'cache.pages' => false + ] + ]); + + $page = $this->app->page('version'); + $page->version('latest')->save(['title' => 'Latest Title']); + $page->version('changes')->save(['title' => 'Changes Title']); + + $this->assertSame("Version: latest\nContent: Latest Title", $page->render()); + + $this->app = $this->app->clone([ + 'request' => [ + 'query' => ['_version' => 'changes'] + ] + ]); + + $this->assertSame("Version: changes\nContent: Changes Title", $page->render()); + } + + public function testVersionDetectedRecursive() + { + // TODO: To be removed in the next PR when caching respects versions + $this->app = $this->app->clone([ + 'options' => [ + 'cache.pages' => false + ] + ]); + + $versionPage = $this->app->page('version'); + $versionPage->version('latest')->save(['title' => 'Latest Title']); + $versionPage->version('changes')->save(['title' => 'Changes Title']); + + $page = $this->app->page('version-recursive'); + + $this->assertSame("\nVersion: latest\nContent: Latest Title\n", $page->render()); + $this->assertSame("\nVersion: latest\nContent: Latest Title\n", $page->render(versionId: 'latest')); + + // the overridden version propagates to the lower level + $this->assertSame("\nVersion: changes\nContent: Changes Title\n", $page->render(versionId: 'changes')); + + // even if the request says something else + $this->app = $this->app->clone([ + 'request' => [ + 'query' => ['_version' => 'changes'] + ] + ]); + + $this->assertSame("\nVersion: latest\nContent: Latest Title\n", $page->render(versionId: 'latest')); + } + + public function testVersionManual() + { + // TODO: To be removed in the next PR when caching respects versions + $this->app = $this->app->clone([ + 'options' => [ + 'cache.pages' => false + ] + ]); + + $page = $this->app->page('version'); + $page->version('latest')->save(['title' => 'Latest Title']); + $page->version('changes')->save(['title' => 'Changes Title']); + + $this->assertSame("Version: latest\nContent: Latest Title", $page->render(versionId: 'latest')); + $this->assertSame("Version: latest\nContent: Latest Title", $page->render(versionId: VersionId::latest())); + $this->assertSame("Version: changes\nContent: Changes Title", $page->render(versionId: 'changes')); + $this->assertSame("Version: changes\nContent: Changes Title", $page->render(versionId: VersionId::changes())); + + $this->assertNull(VersionId::$render); + } + + public function testVersionException() + { + // TODO: To be removed in the next PR when caching respects versions + $this->app = $this->app->clone([ + 'options' => [ + 'cache.pages' => false + ] + ]); + + $page = $this->app->page('version-exception'); + + try { + $page->render(versionId: 'changes'); + } catch (Exception) { + // exception itself is not relevant for this test + } + + // global state always needs to be reset after rendering + $this->assertNull(VersionId::$render); + } } diff --git a/tests/Cms/Pages/fixtures/PageRenderTest/templates/version-exception.php b/tests/Cms/Pages/fixtures/PageRenderTest/templates/version-exception.php new file mode 100644 index 0000000000..f179ba1a03 --- /dev/null +++ b/tests/Cms/Pages/fixtures/PageRenderTest/templates/version-exception.php @@ -0,0 +1,13 @@ +value() !== 'changes') { + throw new AssertionFailedError('Version ID is not changes'); +} + +// this one is expected and used in the test +throw new Exception('Something went wrong'); diff --git a/tests/Cms/Pages/fixtures/PageRenderTest/templates/version-recursive.php b/tests/Cms/Pages/fixtures/PageRenderTest/templates/version-recursive.php new file mode 100644 index 0000000000..0d8219bcc7 --- /dev/null +++ b/tests/Cms/Pages/fixtures/PageRenderTest/templates/version-recursive.php @@ -0,0 +1,3 @@ + +render() . "\n" ?> + \ No newline at end of file diff --git a/tests/Cms/Pages/fixtures/PageRenderTest/templates/version.php b/tests/Cms/Pages/fixtures/PageRenderTest/templates/version.php new file mode 100644 index 0000000000..a4c531cdb9 --- /dev/null +++ b/tests/Cms/Pages/fixtures/PageRenderTest/templates/version.php @@ -0,0 +1,2 @@ +Version: value() ?? 'none') . "\n"?> +Content: title() ?> From 4ec62ad74808bf9e6399383b307840453f663e02 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Mon, 2 Dec 2024 20:19:31 +0100 Subject: [PATCH 303/362] Tweak color lightness values --- panel/src/styles/config/colors.css | 29 +++++++++++++++------------- panel/src/styles/utilities/theme.css | 22 ++++++++++++++------- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/panel/src/styles/config/colors.css b/panel/src/styles/config/colors.css index 2bd5629b56..63f04a9f54 100644 --- a/panel/src/styles/config/colors.css +++ b/panel/src/styles/config/colors.css @@ -257,7 +257,10 @@ /** Shortcuts **/ --color-black: hsl(0, 0%, var(--color-l-min)); --color-border: light-dark(var(--color-gray-300), var(--color-gray-800)); - --color-border-dimmed: light-dark(hsla(0, 0%, var(--color-l-min), 0.1), var(--color-gray-850)); + --color-border-dimmed: light-dark( + hsla(0, 0%, var(--color-l-min), 0.1), + var(--color-gray-850) + ); --color-dark: var(--color-gray-900); --color-focus: var(--color-blue-600); --color-light: var(--color-gray-200); @@ -293,19 +296,19 @@ color-scheme: dark; --color-l-max: 100%; - --color-l-100: 98%; - --color-l-200: 94%; - --color-l-250: 90%; - --color-l-300: 85%; - --color-l-400: 75%; - --color-l-500: 65%; + --color-l-100: 95%; + --color-l-200: 86%; + --color-l-250: 78%; + --color-l-300: 73%; + --color-l-400: 67%; + --color-l-500: 62%; --color-l-600: 52%; --color-l-700: 40%; - --color-l-750: 36%; - --color-l-800: 27%; - --color-l-850: 22%; - --color-l-900: 13%; - --color-l-950: 8%; - --color-l-1000: 5%; + --color-l-750: 33%; + --color-l-800: 26%; + --color-l-850: 19%; + --color-l-900: 11%; + --color-l-950: 6%; + --color-l-1000: 3%; --color-l-min: 0%; } diff --git a/panel/src/styles/utilities/theme.css b/panel/src/styles/utilities/theme.css index cf572f1a50..6ca00dd79d 100644 --- a/panel/src/styles/utilities/theme.css +++ b/panel/src/styles/utilities/theme.css @@ -24,16 +24,24 @@ --theme-color-800: hsl(var(--theme-color-hs), var(--theme-color-l-800)); --theme-color-900: hsl(var(--theme-color-hs), var(--theme-color-l-900)); - --theme-color-border: light-dark(var(--theme-color-500), var(--theme-color-600)); - --theme-color-back: light-dark(var(--theme-color-400), var(--theme-color-500)); + --theme-color-border: light-dark( + var(--theme-color-500), + var(--theme-color-600) + ); + --theme-color-back: light-dark( + var(--theme-color-400), + var(--theme-color-500) + ); --theme-color-hover: var(--theme-color-600); --theme-color-icon: var(--theme-color-600); --theme-color-icon-highlight: var(--theme-color-700); - --theme-color-text: light-dark(var(--theme-color-800), var(--theme-color-500)); - --theme-color-text-dimmed: hsl( - var(--theme-color-h), - calc(var(--theme-color-s) - 60%), - 50% + --theme-color-text: light-dark( + var(--theme-color-800), + var(--theme-color-500) + ); + --theme-color-text-dimmed: light-dark( + hsl(var(--theme-color-h), calc(var(--theme-color-s) - 60%), 50%), + hsl(var(--theme-color-h), calc(var(--theme-color-s) - 60%), 60%) ); --theme-color-text-highlight: var(--theme-color-900); } From f44228bed5d63e7cd5002edec37d81c3f9920d17 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Mon, 2 Dec 2024 20:57:37 +0100 Subject: [PATCH 304/362] Bunch of fixes --- panel/lab/basics/icons/1_iconset/index.vue | 1 + panel/lab/components/toolbar/3_writer/index.vue | 2 +- .../Forms/Previews/BubblesFieldPreview.vue | 2 +- panel/src/components/Layout/Frame/Frame.vue | 2 +- panel/src/components/Layout/Stat.vue | 5 ++++- panel/src/components/Navigation/Browser.vue | 12 +++++++++--- panel/src/components/Navigation/Tag.vue | 4 ++-- panel/src/components/Views/System/SystemSecurity.vue | 2 +- panel/src/styles/config/colors.css | 12 ++++++------ panel/src/styles/utilities/theme.css | 12 +++++++----- 10 files changed, 33 insertions(+), 21 deletions(-) diff --git a/panel/lab/basics/icons/1_iconset/index.vue b/panel/lab/basics/icons/1_iconset/index.vue index 8978558be4..4469d42530 100644 --- a/panel/lab/basics/icons/1_iconset/index.vue +++ b/panel/lab/basics/icons/1_iconset/index.vue @@ -36,6 +36,7 @@ export default { align-items: center; gap: 0.75rem; padding: var(--spacing-2); + color: var(--color-black); background: var(--color-white); border-radius: var(--rounded); box-shadow: var(--shadow); diff --git a/panel/lab/components/toolbar/3_writer/index.vue b/panel/lab/components/toolbar/3_writer/index.vue index b95dda0f11..4887925bd8 100644 --- a/panel/lab/components/toolbar/3_writer/index.vue +++ b/panel/lab/components/toolbar/3_writer/index.vue @@ -26,7 +26,7 @@ export default { diff --git a/panel/src/components/Forms/Previews/BubblesFieldPreview.vue b/panel/src/components/Forms/Previews/BubblesFieldPreview.vue index 531e70ca3f..9baf444ee9 100644 --- a/panel/src/components/Forms/Previews/BubblesFieldPreview.vue +++ b/panel/src/components/Forms/Previews/BubblesFieldPreview.vue @@ -62,7 +62,7 @@ export default { diff --git a/panel/src/components/Dialogs/index.js b/panel/src/components/Dialogs/index.js index e37b7449c5..21fb41398e 100644 --- a/panel/src/components/Dialogs/index.js +++ b/panel/src/components/Dialogs/index.js @@ -12,6 +12,7 @@ import FilesDialog from "./FilesDialog.vue"; import FormDialog from "./FormDialog.vue"; import LanguageDialog from "./LanguageDialog.vue"; import LicenseDialog from "./LicenseDialog.vue"; +import LockDialog from "./LockDialog.vue"; import LinkDialog from "./LinkDialog.vue"; import ModelsDialog from "./ModelsDialog.vue"; import PageCreateDialog from "./PageCreateDialog.vue"; @@ -38,6 +39,7 @@ export default { app.component("k-form-dialog", FormDialog); app.component("k-license-dialog", LicenseDialog); app.component("k-link-dialog", LinkDialog); + app.component("k-lock-dialog", LockDialog); app.component("k-language-dialog", LanguageDialog); app.component("k-models-dialog", ModelsDialog); app.component("k-page-create-dialog", PageCreateDialog); diff --git a/panel/src/panel/content.js b/panel/src/panel/content.js index f7a5b881d0..ec408cdfd6 100644 --- a/panel/src/panel/content.js +++ b/panel/src/panel/content.js @@ -59,6 +59,14 @@ export default (panel) => { } this.emit("discard", {}, env); + } catch (error) { + // handle locked states + if (error.key === "error.lock") { + return this.lockDialog(error.details); + } + + // let our regular error handler take over + throw error; } finally { this.isProcessing = false; } @@ -124,6 +132,26 @@ export default (panel) => { return panel.view.props.lock; }, + /** + * Opens the lock dialog to inform the current editor + * about edits from another user + */ + lockDialog(lock) { + this.dialog = panel.dialog; + this.dialog.open({ + component: "k-lock-dialog", + props: { + lock: lock + }, + on: { + close: () => { + this.dialog = null; + panel.view.reload(); + } + } + }); + }, + /** * Merge new content changes with the * original values and update the view props @@ -153,12 +181,6 @@ export default (panel) => { return; } - // In the current view, we can use the existing - // lock state to determine if changes can be published - if (this.isCurrent(env) === true && this.isLocked(env) === true) { - throw new Error("Cannot publish locked changes"); - } - this.isProcessing = true; // Send updated values to API @@ -175,6 +197,11 @@ export default (panel) => { this.emit("publish", { values }, env); } catch (error) { + // handle locked states + if (error.key === "error.lock") { + return this.lockDialog(error.details); + } + this.retry("publish", error, [values, env]); } finally { this.isProcessing = false; @@ -248,10 +275,6 @@ export default (panel) => { * Saves any changes */ async save(values = {}, env = {}) { - if (this.isCurrent(env) === true && this.isLocked(env) === true) { - throw new Error("Cannot save locked changes"); - } - this.isProcessing = true; // ensure to abort unfinished previous save request @@ -274,11 +297,23 @@ export default (panel) => { this.emit("save", { values }, env); } catch (error) { - // silent aborted requests, but throw all other errors - if (error.name !== "AbortError") { - this.isProcessing = false; - this.retry("save", error, [values, env]); + // handle aborted requests silently + if (error.name === "AbortError") { + return; } + + // processing must not be interrupted for aborted + // requests because the follow-up request is already + // in progress and setting the state to false here + // would be wrong + this.isProcessing = false; + + // handle locked states + if (error.key === "error.lock") { + return this.lockDialog(error.details); + } + + this.retry("save", error, [values, env]); } }, diff --git a/src/Content/LockException.php b/src/Content/LockException.php new file mode 100644 index 0000000000..897c758122 --- /dev/null +++ b/src/Content/LockException.php @@ -0,0 +1,32 @@ + + * @link https://getkirby.com + * @copyright Bastian Allgeier + * @license https://getkirby.com/license + */ +class LockException extends LogicException +{ + protected static string $defaultKey = 'lock'; + protected static string $defaultFallback = 'The version is locked'; + protected static int $defaultHttpCode = 423; + + public function __construct( + Lock $lock, + string|null $key = null, + string|null $message = null, + ) { + parent::__construct( + message: $message, + key: $key, + details: $lock->toArray() + ); + } + +} diff --git a/src/Content/VersionRules.php b/src/Content/VersionRules.php index a1a678f1c3..2f094037ac 100644 --- a/src/Content/VersionRules.php +++ b/src/Content/VersionRules.php @@ -68,7 +68,8 @@ public static function delete( Language $language ): void { if ($version->isLocked('*') === true) { - throw new LogicException( + throw new LockException( + lock: $version->lock('*'), message: 'The version is locked and cannot be deleted' ); } @@ -85,14 +86,16 @@ public static function move( // check if the source version is locked in any language if ($fromVersion->isLocked('*') === true) { - throw new LogicException( + throw new LockException( + lock: $fromVersion->lock('*'), message: 'The source version is locked and cannot be moved' ); } // check if the target version is locked in any language if ($toVersion->isLocked('*') === true) { - throw new LogicException( + throw new LockException( + lock: $toVersion->lock('*'), message: 'The target version is locked and cannot be overwritten' ); } @@ -114,7 +117,8 @@ public static function publish( // check if the version is locked in any language if ($version->isLocked('*') === true) { - throw new LogicException( + throw new LockException( + lock: $version->lock('*'), message: 'The version is locked and cannot be published' ); } @@ -137,7 +141,8 @@ public static function replace( // check if the version is locked in any language if ($version->isLocked('*') === true) { - throw new LogicException( + throw new LockException( + lock: $version->lock('*'), message: 'The version is locked and cannot be replaced' ); } @@ -158,7 +163,8 @@ public static function update( static::ensure($version, $language); if ($version->isLocked('*') === true) { - throw new LogicException( + throw new LockException( + lock: $version->lock('*'), message: 'The version is locked and cannot be updated' ); } From f94d149f41bee1c20fef7a96c1314eb3234dc649 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 5 Dec 2024 16:38:14 +0100 Subject: [PATCH 346/362] Add unit tests for the logic exception --- src/Content/LockException.php | 1 - tests/Content/LockExceptionTest.php | 54 +++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 tests/Content/LockExceptionTest.php diff --git a/src/Content/LockException.php b/src/Content/LockException.php index 897c758122..c2b79b831e 100644 --- a/src/Content/LockException.php +++ b/src/Content/LockException.php @@ -28,5 +28,4 @@ public function __construct( details: $lock->toArray() ); } - } diff --git a/tests/Content/LockExceptionTest.php b/tests/Content/LockExceptionTest.php new file mode 100644 index 0000000000..abd6fff97b --- /dev/null +++ b/tests/Content/LockExceptionTest.php @@ -0,0 +1,54 @@ + 'test']), + modified: $time = time() + ); + + $exception = new LockException( + lock: $lock + ); + + $this->assertSame('The version is locked', $exception->getMessage()); + $this->assertSame($lock->toArray(), $exception->getDetails()); + $this->assertSame(423, $exception->getHttpCode()); + $this->assertSame('error.lock', $exception->getCode()); + } + + /** + * @covers ::getMessage + */ + public function testCustomMessage() + { + $lock = new Lock( + user: new User(['username' => 'test']), + modified: $time = time() + ); + + $exception = new LockException( + lock: $lock, + message: $message = 'The version is locked and cannot be deleted' + ); + + $this->assertSame($message, $exception->getMessage()); + } +} From dfc02bdca762fd6a0f576c3695c47fe9b26b9152 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 5 Dec 2024 16:43:22 +0100 Subject: [PATCH 347/362] Try to fix covers annotation --- tests/Content/LockExceptionTest.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/Content/LockExceptionTest.php b/tests/Content/LockExceptionTest.php index abd6fff97b..022a891040 100644 --- a/tests/Content/LockExceptionTest.php +++ b/tests/Content/LockExceptionTest.php @@ -6,15 +6,14 @@ /** * @coversDefaultClass \Kirby\Content\LockException - * @covers ::__construct */ class LockExceptionTest extends TestCase { /** * @covers ::__construct - * @covers ::getCode * @covers ::getDetails * @covers ::getHttpCode + * @covers ::getKey * @covers ::getMessage */ public function testException() @@ -31,7 +30,7 @@ public function testException() $this->assertSame('The version is locked', $exception->getMessage()); $this->assertSame($lock->toArray(), $exception->getDetails()); $this->assertSame(423, $exception->getHttpCode()); - $this->assertSame('error.lock', $exception->getCode()); + $this->assertSame('error.lock', $exception->getKey()); } /** From db9968c4f963a553f324adc13c47ab2a6b13bb0a Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 5 Dec 2024 16:52:39 +0100 Subject: [PATCH 348/362] Those covers rules drive me crazy --- tests/Content/LockExceptionTest.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/Content/LockExceptionTest.php b/tests/Content/LockExceptionTest.php index 022a891040..269339abae 100644 --- a/tests/Content/LockExceptionTest.php +++ b/tests/Content/LockExceptionTest.php @@ -9,13 +9,6 @@ */ class LockExceptionTest extends TestCase { - /** - * @covers ::__construct - * @covers ::getDetails - * @covers ::getHttpCode - * @covers ::getKey - * @covers ::getMessage - */ public function testException() { $lock = new Lock( @@ -33,9 +26,6 @@ public function testException() $this->assertSame('error.lock', $exception->getKey()); } - /** - * @covers ::getMessage - */ public function testCustomMessage() { $lock = new Lock( From f158c58912067543b65f710805e7e7172bd3a358 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Fri, 6 Dec 2024 13:56:55 +0100 Subject: [PATCH 349/362] Rename to `LockedContentException` --- panel/src/panel/content.js | 6 +++--- ...{LockException.php => LockedContentException.php} | 4 ++-- src/Content/VersionRules.php | 12 ++++++------ ...eptionTest.php => LockedContentExceptionTest.php} | 10 +++++----- 4 files changed, 16 insertions(+), 16 deletions(-) rename src/Content/{LockException.php => LockedContentException.php} (84%) rename tests/Content/{LockExceptionTest.php => LockedContentExceptionTest.php} (72%) diff --git a/panel/src/panel/content.js b/panel/src/panel/content.js index ec408cdfd6..ad740925a1 100644 --- a/panel/src/panel/content.js +++ b/panel/src/panel/content.js @@ -61,7 +61,7 @@ export default (panel) => { this.emit("discard", {}, env); } catch (error) { // handle locked states - if (error.key === "error.lock") { + if (error.key === "error.content.lock") { return this.lockDialog(error.details); } @@ -198,7 +198,7 @@ export default (panel) => { this.emit("publish", { values }, env); } catch (error) { // handle locked states - if (error.key === "error.lock") { + if (error.key === "error.content.lock") { return this.lockDialog(error.details); } @@ -309,7 +309,7 @@ export default (panel) => { this.isProcessing = false; // handle locked states - if (error.key === "error.lock") { + if (error.key === "error.content.lock") { return this.lockDialog(error.details); } diff --git a/src/Content/LockException.php b/src/Content/LockedContentException.php similarity index 84% rename from src/Content/LockException.php rename to src/Content/LockedContentException.php index c2b79b831e..ecf678a632 100644 --- a/src/Content/LockException.php +++ b/src/Content/LockedContentException.php @@ -11,9 +11,9 @@ * @copyright Bastian Allgeier * @license https://getkirby.com/license */ -class LockException extends LogicException +class LockedContentException extends LogicException { - protected static string $defaultKey = 'lock'; + protected static string $defaultKey = 'content.lock'; protected static string $defaultFallback = 'The version is locked'; protected static int $defaultHttpCode = 423; diff --git a/src/Content/VersionRules.php b/src/Content/VersionRules.php index 2f094037ac..69b69033d6 100644 --- a/src/Content/VersionRules.php +++ b/src/Content/VersionRules.php @@ -68,7 +68,7 @@ public static function delete( Language $language ): void { if ($version->isLocked('*') === true) { - throw new LockException( + throw new LockedContentException( lock: $version->lock('*'), message: 'The version is locked and cannot be deleted' ); @@ -86,7 +86,7 @@ public static function move( // check if the source version is locked in any language if ($fromVersion->isLocked('*') === true) { - throw new LockException( + throw new LockedContentException( lock: $fromVersion->lock('*'), message: 'The source version is locked and cannot be moved' ); @@ -94,7 +94,7 @@ public static function move( // check if the target version is locked in any language if ($toVersion->isLocked('*') === true) { - throw new LockException( + throw new LockedContentException( lock: $toVersion->lock('*'), message: 'The target version is locked and cannot be overwritten' ); @@ -117,7 +117,7 @@ public static function publish( // check if the version is locked in any language if ($version->isLocked('*') === true) { - throw new LockException( + throw new LockedContentException( lock: $version->lock('*'), message: 'The version is locked and cannot be published' ); @@ -141,7 +141,7 @@ public static function replace( // check if the version is locked in any language if ($version->isLocked('*') === true) { - throw new LockException( + throw new LockedContentException( lock: $version->lock('*'), message: 'The version is locked and cannot be replaced' ); @@ -163,7 +163,7 @@ public static function update( static::ensure($version, $language); if ($version->isLocked('*') === true) { - throw new LockException( + throw new LockedContentException( lock: $version->lock('*'), message: 'The version is locked and cannot be updated' ); diff --git a/tests/Content/LockExceptionTest.php b/tests/Content/LockedContentExceptionTest.php similarity index 72% rename from tests/Content/LockExceptionTest.php rename to tests/Content/LockedContentExceptionTest.php index 269339abae..b987f34b6e 100644 --- a/tests/Content/LockExceptionTest.php +++ b/tests/Content/LockedContentExceptionTest.php @@ -5,9 +5,9 @@ use Kirby\Cms\User; /** - * @coversDefaultClass \Kirby\Content\LockException + * @coversDefaultClass \Kirby\Content\LockedContentException */ -class LockExceptionTest extends TestCase +class LockedContentExceptionTest extends TestCase { public function testException() { @@ -16,14 +16,14 @@ public function testException() modified: $time = time() ); - $exception = new LockException( + $exception = new LockedContentException( lock: $lock ); $this->assertSame('The version is locked', $exception->getMessage()); $this->assertSame($lock->toArray(), $exception->getDetails()); $this->assertSame(423, $exception->getHttpCode()); - $this->assertSame('error.lock', $exception->getKey()); + $this->assertSame('error.content.lock', $exception->getKey()); } public function testCustomMessage() @@ -33,7 +33,7 @@ public function testCustomMessage() modified: $time = time() ); - $exception = new LockException( + $exception = new LockedContentException( lock: $lock, message: $message = 'The version is locked and cannot be deleted' ); From 3fbab6905165e92ef029ef483e73ba68b5978bc1 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Fri, 6 Dec 2024 14:08:14 +0100 Subject: [PATCH 350/362] Translate VersionRules content lock error msgs --- i18n/translations/en.json | 6 ++++++ src/Content/VersionRules.php | 12 ++++++------ tests/Content/VersionRulesTest.php | 24 ++++++++++++------------ 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/i18n/translations/en.json b/i18n/translations/en.json index dfd99d62e6..02e14d34f6 100644 --- a/i18n/translations/en.json +++ b/i18n/translations/en.json @@ -92,6 +92,12 @@ "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.content.lock.delete": "The version is locked and cannot be deleted", + "error.content.lock.move": "The source version is locked and cannot be moved", + "error.content.lock.publish": "This version is already published", + "error.content.lock.replace": "The version is locked and cannot be replaced", + "error.content.lock.update": "The version is locked and cannot be updated", + "error.email.preset.notFound": "The email preset \"{name}\" cannot be found", "error.field.converter.invalid": "Invalid converter \"{converter}\"", diff --git a/src/Content/VersionRules.php b/src/Content/VersionRules.php index 69b69033d6..23c8f44ee5 100644 --- a/src/Content/VersionRules.php +++ b/src/Content/VersionRules.php @@ -70,7 +70,7 @@ public static function delete( if ($version->isLocked('*') === true) { throw new LockedContentException( lock: $version->lock('*'), - message: 'The version is locked and cannot be deleted' + key: 'content.lock.delete' ); } } @@ -88,7 +88,7 @@ public static function move( if ($fromVersion->isLocked('*') === true) { throw new LockedContentException( lock: $fromVersion->lock('*'), - message: 'The source version is locked and cannot be moved' + key: 'content.lock.move' ); } @@ -96,7 +96,7 @@ public static function move( if ($toVersion->isLocked('*') === true) { throw new LockedContentException( lock: $toVersion->lock('*'), - message: 'The target version is locked and cannot be overwritten' + key: 'content.lock.update' ); } } @@ -119,7 +119,7 @@ public static function publish( if ($version->isLocked('*') === true) { throw new LockedContentException( lock: $version->lock('*'), - message: 'The version is locked and cannot be published' + key: 'content.lock.publish' ); } } @@ -143,7 +143,7 @@ public static function replace( if ($version->isLocked('*') === true) { throw new LockedContentException( lock: $version->lock('*'), - message: 'The version is locked and cannot be replaced' + key: 'content.lock.replace' ); } } @@ -165,7 +165,7 @@ public static function update( if ($version->isLocked('*') === true) { throw new LockedContentException( lock: $version->lock('*'), - message: 'The version is locked and cannot be updated' + key: 'content.lock.update' ); } } diff --git a/tests/Content/VersionRulesTest.php b/tests/Content/VersionRulesTest.php index e8551572f0..ee0932a514 100644 --- a/tests/Content/VersionRulesTest.php +++ b/tests/Content/VersionRulesTest.php @@ -81,8 +81,8 @@ public function testDeleteWhenTheVersionIsLocked() id: VersionId::changes(), ); - $this->expectException(LogicException::class); - $this->expectExceptionMessage('The version is locked and cannot be deleted'); + $this->expectException(LockedContentException::class); + $this->expectExceptionCode('error.content.lock.delete'); VersionRules::delete($version, Language::ensure()); } @@ -196,8 +196,8 @@ public function testMoveWhenTheSourceVersionIsLocked() $source->save([]); $target->save([]); - $this->expectException(LogicException::class); - $this->expectExceptionMessage('The source version is locked and cannot be moved'); + $this->expectException(LockedContentException::class); + $this->expectExceptionCode('error.content.lock.move'); VersionRules::move($source, Language::ensure(), $target, Language::ensure()); } @@ -223,8 +223,8 @@ public function testMoveWhenTheTargetVersionIsLocked() // next logic issue $source->save([]); - $this->expectException(LogicException::class); - $this->expectExceptionMessage('The target version is locked and cannot be overwritten'); + $this->expectException(LockedContentException::class); + $this->expectExceptionCode('error.content.lock.update'); VersionRules::move($source, Language::ensure(), $target, Language::ensure()); } @@ -261,8 +261,8 @@ public function testPublishWhenTheVersionIsLocked() $version->save([]); - $this->expectException(LogicException::class); - $this->expectExceptionMessage('The version is locked and cannot be published'); + $this->expectException(LockedContentException::class); + $this->expectExceptionCode('error.content.lock.publish'); VersionRules::publish($version, Language::ensure()); } @@ -303,8 +303,8 @@ public function testReplaceWhenTheVersionIsLocked() $version->save([]); - $this->expectException(LogicException::class); - $this->expectExceptionMessage('The version is locked and cannot be replaced'); + $this->expectException(LockedContentException::class); + $this->expectExceptionCode('error.content.lock.replace'); VersionRules::replace($version, [], Language::ensure()); } @@ -345,8 +345,8 @@ public function testUpdateWhenTheVersionIsLocked() $version->save([]); - $this->expectException(LogicException::class); - $this->expectExceptionMessage('The version is locked and cannot be updated'); + $this->expectException(LockedContentException::class); + $this->expectExceptionCode('error.content.lock.update'); VersionRules::update($version, [], Language::ensure()); } From 4a3ad656428e2066fcba07b3850dd559c7c7bb6d Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Fri, 6 Dec 2024 14:09:38 +0100 Subject: [PATCH 351/362] Rname to `LockAlertDialog` --- .../Dialogs/{LockDialog.vue => LockAlertDialog.vue} | 8 ++++---- panel/src/components/Dialogs/index.js | 4 ++-- panel/src/panel/content.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) rename panel/src/components/Dialogs/{LockDialog.vue => LockAlertDialog.vue} (87%) diff --git a/panel/src/components/Dialogs/LockDialog.vue b/panel/src/components/Dialogs/LockAlertDialog.vue similarity index 87% rename from panel/src/components/Dialogs/LockDialog.vue rename to panel/src/components/Dialogs/LockAlertDialog.vue index 6ee952b1a6..2768fcca10 100644 --- a/panel/src/components/Dialogs/LockDialog.vue +++ b/panel/src/components/Dialogs/LockAlertDialog.vue @@ -2,7 +2,7 @@ @@ -43,10 +43,10 @@ export default { diff --git a/panel/src/components/Dialogs/index.js b/panel/src/components/Dialogs/index.js index 21fb41398e..2a898a5186 100644 --- a/panel/src/components/Dialogs/index.js +++ b/panel/src/components/Dialogs/index.js @@ -12,7 +12,7 @@ import FilesDialog from "./FilesDialog.vue"; import FormDialog from "./FormDialog.vue"; import LanguageDialog from "./LanguageDialog.vue"; import LicenseDialog from "./LicenseDialog.vue"; -import LockDialog from "./LockDialog.vue"; +import LockAlertDialog from "./LockAlertDialog.vue"; import LinkDialog from "./LinkDialog.vue"; import ModelsDialog from "./ModelsDialog.vue"; import PageCreateDialog from "./PageCreateDialog.vue"; @@ -39,7 +39,7 @@ export default { app.component("k-form-dialog", FormDialog); app.component("k-license-dialog", LicenseDialog); app.component("k-link-dialog", LinkDialog); - app.component("k-lock-dialog", LockDialog); + app.component("k-lock-alert-dialog", LockAlertDialog); app.component("k-language-dialog", LanguageDialog); app.component("k-models-dialog", ModelsDialog); app.component("k-page-create-dialog", PageCreateDialog); diff --git a/panel/src/panel/content.js b/panel/src/panel/content.js index ad740925a1..7192bf03d2 100644 --- a/panel/src/panel/content.js +++ b/panel/src/panel/content.js @@ -139,7 +139,7 @@ export default (panel) => { lockDialog(lock) { this.dialog = panel.dialog; this.dialog.open({ - component: "k-lock-dialog", + component: "k-lock-alert-dialog", props: { lock: lock }, From 10084258f3e10ee4204acc9c1535f3ce73817842 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Fri, 6 Dec 2024 14:13:46 +0100 Subject: [PATCH 352/362] Fix lock error matching in content JS module --- panel/src/panel/content.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/panel/src/panel/content.js b/panel/src/panel/content.js index 7192bf03d2..71ac5f6fff 100644 --- a/panel/src/panel/content.js +++ b/panel/src/panel/content.js @@ -61,7 +61,7 @@ export default (panel) => { this.emit("discard", {}, env); } catch (error) { // handle locked states - if (error.key === "error.content.lock") { + if (error.key.startsWith("error.content.lock")) { return this.lockDialog(error.details); } @@ -198,7 +198,7 @@ export default (panel) => { this.emit("publish", { values }, env); } catch (error) { // handle locked states - if (error.key === "error.content.lock") { + if (error.key.startsWith("error.content.lock")) { return this.lockDialog(error.details); } @@ -309,7 +309,7 @@ export default (panel) => { this.isProcessing = false; // handle locked states - if (error.key === "error.content.lock") { + if (error.key.startsWith("error.content.lock")) { return this.lockDialog(error.details); } From 334f130cde3ffa3e6b07466203b8e3a200fb1349 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Fri, 6 Dec 2024 14:14:00 +0100 Subject: [PATCH 353/362] LockAlertDialog: passive button theme --- panel/src/components/Dialogs/LockAlertDialog.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/panel/src/components/Dialogs/LockAlertDialog.vue b/panel/src/components/Dialogs/LockAlertDialog.vue index 2768fcca10..55189cc2f3 100644 --- a/panel/src/components/Dialogs/LockAlertDialog.vue +++ b/panel/src/components/Dialogs/LockAlertDialog.vue @@ -2,6 +2,8 @@ Date: Fri, 6 Dec 2024 17:13:48 +0100 Subject: [PATCH 354/362] Upgrade npm dependencies --- panel/package-lock.json | 1584 ++++++++++++++++++++++++++++++++------- panel/package.json | 24 +- 2 files changed, 1309 insertions(+), 299 deletions(-) diff --git a/panel/package-lock.json b/panel/package-lock.json index a6f2f07de4..7bb113933f 100644 --- a/panel/package-lock.json +++ b/panel/package-lock.json @@ -14,26 +14,26 @@ "prosemirror-history": "^1.4.1", "prosemirror-inputrules": "^1.4.0", "prosemirror-keymap": "^1.2.2", - "prosemirror-model": "^1.22.3", - "prosemirror-schema-list": "^1.4.1", - "prosemirror-view": "^1.36.0", - "sortablejs": "^1.15.2", + "prosemirror-model": "^1.24.0", + "prosemirror-schema-list": "^1.5.0", + "prosemirror-view": "^1.37.0", + "sortablejs": "^1.15.6", "vue": "^2.7.16" }, "devDependencies": { "@csstools/postcss-light-dark-function": "^2.0.7", - "@vitejs/plugin-vue2": "^2.3.1", - "eslint": "^9.15.0", + "@vitejs/plugin-vue2": "^2.3.3", + "eslint": "^9.16.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-vue": "^9.31.0", + "eslint-plugin-vue": "^9.32.0", "glob": "^11.0.0", "jsdom": "^25.0.1", - "prettier": "^3.3.3", + "prettier": "^3.4.2", "rollup-plugin-external-globals": "^0.13.0", - "terser": "^5.36.0", - "vite": "^5.4.11", - "vite-plugin-static-copy": "^2.1.0", - "vitest": "^2.1.5", + "terser": "^5.37.0", + "vite": "^6.0.3", + "vite-plugin-static-copy": "^2.2.0", + "vitest": "^2.1.8", "vue-docgen-api": "^4.79.2", "vue-template-compiler": "^2.7.16" } @@ -207,9 +207,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", - "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz", + "integrity": "sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==", "cpu": [ "ppc64" ], @@ -220,13 +220,13 @@ "aix" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", - "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.0.tgz", + "integrity": "sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==", "cpu": [ "arm" ], @@ -237,13 +237,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", - "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz", + "integrity": "sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==", "cpu": [ "arm64" ], @@ -254,13 +254,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", - "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.0.tgz", + "integrity": "sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==", "cpu": [ "x64" ], @@ -271,13 +271,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", - "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz", + "integrity": "sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==", "cpu": [ "arm64" ], @@ -288,13 +288,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", - "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz", + "integrity": "sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==", "cpu": [ "x64" ], @@ -305,13 +305,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", - "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz", + "integrity": "sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==", "cpu": [ "arm64" ], @@ -322,13 +322,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", - "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz", + "integrity": "sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==", "cpu": [ "x64" ], @@ -339,13 +339,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", - "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz", + "integrity": "sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==", "cpu": [ "arm" ], @@ -356,13 +356,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", - "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz", + "integrity": "sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==", "cpu": [ "arm64" ], @@ -373,13 +373,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", - "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz", + "integrity": "sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==", "cpu": [ "ia32" ], @@ -390,13 +390,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", - "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz", + "integrity": "sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==", "cpu": [ "loong64" ], @@ -407,13 +407,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", - "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz", + "integrity": "sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==", "cpu": [ "mips64el" ], @@ -424,13 +424,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", - "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz", + "integrity": "sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==", "cpu": [ "ppc64" ], @@ -441,13 +441,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", - "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz", + "integrity": "sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==", "cpu": [ "riscv64" ], @@ -458,13 +458,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", - "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz", + "integrity": "sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==", "cpu": [ "s390x" ], @@ -475,13 +475,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", - "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz", + "integrity": "sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==", "cpu": [ "x64" ], @@ -492,13 +492,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", - "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz", + "integrity": "sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==", "cpu": [ "x64" ], @@ -509,13 +509,30 @@ "netbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz", + "integrity": "sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", - "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz", + "integrity": "sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==", "cpu": [ "x64" ], @@ -526,13 +543,13 @@ "openbsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", - "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz", + "integrity": "sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==", "cpu": [ "x64" ], @@ -543,13 +560,13 @@ "sunos" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", - "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz", + "integrity": "sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==", "cpu": [ "arm64" ], @@ -560,13 +577,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", - "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz", + "integrity": "sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==", "cpu": [ "ia32" ], @@ -577,13 +594,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", - "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz", + "integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==", "cpu": [ "x64" ], @@ -594,7 +611,7 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@eslint-community/eslint-utils": { @@ -686,9 +703,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.15.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.15.0.tgz", - "integrity": "sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==", + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.16.0.tgz", + "integrity": "sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==", "dev": true, "license": "MIT", "engines": { @@ -1173,28 +1190,28 @@ "license": "MIT" }, "node_modules/@vitejs/plugin-vue2": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue2/-/plugin-vue2-2.3.1.tgz", - "integrity": "sha512-/ksaaz2SRLN11JQhLdEUhDzOn909WEk99q9t9w+N12GjQCljzv7GyvAbD/p20aBUjHkvpGOoQ+FCOkG+mjDF4A==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue2/-/plugin-vue2-2.3.3.tgz", + "integrity": "sha512-qexY6+bbwY8h0AZerzUuGywNTi0cLOkbiSbggr0R3WEW95iB2hblQFyv4MAkkc2vm4gZN1cO5kzT1Kp6xlVzZw==", "dev": true, "license": "MIT", "engines": { "node": "^14.18.0 || >= 16.0.0" }, "peerDependencies": { - "vite": "^3.0.0 || ^4.0.0 || ^5.0.0", + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0", "vue": "^2.7.0-0" } }, "node_modules/@vitest/expect": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.5.tgz", - "integrity": "sha512-nZSBTW1XIdpZvEJyoP/Sy8fUg0b8od7ZpGDkTUcfJ7wz/VoZAFzFfLyxVxGFhUjJzhYqSbIpfMtl/+k/dpWa3Q==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.8.tgz", + "integrity": "sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "2.1.5", - "@vitest/utils": "2.1.5", + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", "chai": "^5.1.2", "tinyrainbow": "^1.2.0" }, @@ -1202,37 +1219,10 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/mocker": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.5.tgz", - "integrity": "sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/spy": "2.1.5", - "estree-walker": "^3.0.3", - "magic-string": "^0.30.12" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "msw": "^2.4.9", - "vite": "^5.0.0" - }, - "peerDependenciesMeta": { - "msw": { - "optional": true - }, - "vite": { - "optional": true - } - } - }, "node_modules/@vitest/pretty-format": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.5.tgz", - "integrity": "sha512-4ZOwtk2bqG5Y6xRGHcveZVr+6txkH7M2e+nPFd6guSoN638v/1XQ0K06eOpi0ptVU/2tW/pIU4IoPotY/GZ9fw==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.8.tgz", + "integrity": "sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1243,13 +1233,13 @@ } }, "node_modules/@vitest/runner": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.5.tgz", - "integrity": "sha512-pKHKy3uaUdh7X6p1pxOkgkVAFW7r2I818vHDthYLvUyjRfkKOU6P45PztOch4DZarWQne+VOaIMwA/erSSpB9g==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.8.tgz", + "integrity": "sha512-17ub8vQstRnRlIU5k50bG+QOMLHRhYPAna5tw8tYbj+jzjcspnwnwtPtiOlkuKC4+ixDPTuLZiqiWWQ2PSXHVg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "2.1.5", + "@vitest/utils": "2.1.8", "pathe": "^1.1.2" }, "funding": { @@ -1257,13 +1247,13 @@ } }, "node_modules/@vitest/snapshot": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.5.tgz", - "integrity": "sha512-zmYw47mhfdfnYbuhkQvkkzYroXUumrwWDGlMjpdUr4jBd3HZiV2w7CQHj+z7AAS4VOtWxI4Zt4bWt4/sKcoIjg==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.8.tgz", + "integrity": "sha512-20T7xRFbmnkfcmgVEz+z3AU/3b0cEzZOt/zmnvZEctg64/QZbSDJEVm9fLnnlSi74KibmRsO9/Qabi+t0vCRPg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.5", + "@vitest/pretty-format": "2.1.8", "magic-string": "^0.30.12", "pathe": "^1.1.2" }, @@ -1272,9 +1262,9 @@ } }, "node_modules/@vitest/spy": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.5.tgz", - "integrity": "sha512-aWZF3P0r3w6DiYTVskOYuhBc7EMc3jvn1TkBg8ttylFFRqNN2XGD7V5a4aQdk6QiUzZQ4klNBSpCLJgWNdIiNw==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.8.tgz", + "integrity": "sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg==", "dev": true, "license": "MIT", "dependencies": { @@ -1285,13 +1275,13 @@ } }, "node_modules/@vitest/utils": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.5.tgz", - "integrity": "sha512-yfj6Yrp0Vesw2cwJbP+cl04OC+IHFsuQsrsJBL9pyGeQXE56v1UAOQco+SR55Vf1nQzfV0QJg1Qum7AaWUwwYg==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.8.tgz", + "integrity": "sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.5", + "@vitest/pretty-format": "2.1.8", "loupe": "^3.1.2", "tinyrainbow": "^1.2.0" }, @@ -2001,9 +1991,9 @@ "license": "MIT" }, "node_modules/esbuild": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", - "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz", + "integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -2011,32 +2001,33 @@ "esbuild": "bin/esbuild" }, "engines": { - "node": ">=12" + "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.5", - "@esbuild/android-arm": "0.21.5", - "@esbuild/android-arm64": "0.21.5", - "@esbuild/android-x64": "0.21.5", - "@esbuild/darwin-arm64": "0.21.5", - "@esbuild/darwin-x64": "0.21.5", - "@esbuild/freebsd-arm64": "0.21.5", - "@esbuild/freebsd-x64": "0.21.5", - "@esbuild/linux-arm": "0.21.5", - "@esbuild/linux-arm64": "0.21.5", - "@esbuild/linux-ia32": "0.21.5", - "@esbuild/linux-loong64": "0.21.5", - "@esbuild/linux-mips64el": "0.21.5", - "@esbuild/linux-ppc64": "0.21.5", - "@esbuild/linux-riscv64": "0.21.5", - "@esbuild/linux-s390x": "0.21.5", - "@esbuild/linux-x64": "0.21.5", - "@esbuild/netbsd-x64": "0.21.5", - "@esbuild/openbsd-x64": "0.21.5", - "@esbuild/sunos-x64": "0.21.5", - "@esbuild/win32-arm64": "0.21.5", - "@esbuild/win32-ia32": "0.21.5", - "@esbuild/win32-x64": "0.21.5" + "@esbuild/aix-ppc64": "0.24.0", + "@esbuild/android-arm": "0.24.0", + "@esbuild/android-arm64": "0.24.0", + "@esbuild/android-x64": "0.24.0", + "@esbuild/darwin-arm64": "0.24.0", + "@esbuild/darwin-x64": "0.24.0", + "@esbuild/freebsd-arm64": "0.24.0", + "@esbuild/freebsd-x64": "0.24.0", + "@esbuild/linux-arm": "0.24.0", + "@esbuild/linux-arm64": "0.24.0", + "@esbuild/linux-ia32": "0.24.0", + "@esbuild/linux-loong64": "0.24.0", + "@esbuild/linux-mips64el": "0.24.0", + "@esbuild/linux-ppc64": "0.24.0", + "@esbuild/linux-riscv64": "0.24.0", + "@esbuild/linux-s390x": "0.24.0", + "@esbuild/linux-x64": "0.24.0", + "@esbuild/netbsd-x64": "0.24.0", + "@esbuild/openbsd-arm64": "0.24.0", + "@esbuild/openbsd-x64": "0.24.0", + "@esbuild/sunos-x64": "0.24.0", + "@esbuild/win32-arm64": "0.24.0", + "@esbuild/win32-ia32": "0.24.0", + "@esbuild/win32-x64": "0.24.0" } }, "node_modules/escape-string-regexp": { @@ -2053,9 +2044,9 @@ } }, "node_modules/eslint": { - "version": "9.15.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.15.0.tgz", - "integrity": "sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw==", + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.16.0.tgz", + "integrity": "sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==", "dev": true, "license": "MIT", "dependencies": { @@ -2064,7 +2055,7 @@ "@eslint/config-array": "^0.19.0", "@eslint/core": "^0.9.0", "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "9.15.0", + "@eslint/js": "9.16.0", "@eslint/plugin-kit": "^0.2.3", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", @@ -2126,9 +2117,9 @@ } }, "node_modules/eslint-plugin-vue": { - "version": "9.31.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.31.0.tgz", - "integrity": "sha512-aYMUCgivhz1o4tLkRHj5oq9YgYPM4/EJc0M7TAKRLCUA5OYxRLAhYEVD2nLtTwLyixEFI+/QXSvKU9ESZFgqjQ==", + "version": "9.32.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.32.0.tgz", + "integrity": "sha512-b/Y05HYmnB/32wqVcjxjHZzNpwxj1onBOvqW89W+V+XNG1dRuaFbNd3vT9CLbr2LXjEoq+3vn8DanWf7XU22Ug==", "dev": true, "license": "MIT", "dependencies": { @@ -3454,9 +3445,9 @@ } }, "node_modules/picocolors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", - "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "license": "ISC" }, "node_modules/picomatch": { @@ -3482,9 +3473,9 @@ } }, "node_modules/postcss": { - "version": "8.4.47", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", - "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", + "version": "8.4.49", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", + "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", "funding": [ { "type": "opencollective", @@ -3502,7 +3493,7 @@ "license": "MIT", "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.1.0", + "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, "engines": { @@ -3541,9 +3532,9 @@ } }, "node_modules/prettier": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", "dev": true, "license": "MIT", "bin": { @@ -3610,18 +3601,18 @@ } }, "node_modules/prosemirror-model": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.23.0.tgz", - "integrity": "sha512-Q/fgsgl/dlOAW9ILu4OOhYWQbc7TQd4BwKH/RwmUjyVf8682Be4zj3rOYdLnYEcGzyg8LL9Q5IWYKD8tdToreQ==", + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.24.0.tgz", + "integrity": "sha512-Ft7epNnycoQSM+2ObF35SBbBX+5WY39v8amVlrtlAcpglhlHs2tCTnWl7RX5tbp/PsMKcRcWV9cXPuoBWq0AIQ==", "license": "MIT", "dependencies": { "orderedmap": "^2.0.0" } }, "node_modules/prosemirror-schema-list": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.4.1.tgz", - "integrity": "sha512-jbDyaP/6AFfDfu70VzySsD75Om2t3sXTOdl5+31Wlxlg62td1haUpty/ybajSfJ1pkGadlOfwQq9kgW5IMo1Rg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.5.0.tgz", + "integrity": "sha512-gg1tAfH1sqpECdhIHOA/aLg2VH3ROKBWQ4m8Qp9mBKrOxQRW61zc+gMCI8nh22gnBzd1t2u1/NPLmO3nAa3ssg==", "license": "MIT", "dependencies": { "prosemirror-model": "^1.0.0", @@ -3650,9 +3641,9 @@ } }, "node_modules/prosemirror-view": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.36.0.tgz", - "integrity": "sha512-U0GQd5yFvV5qUtT41X1zCQfbw14vkbbKwLlQXhdylEmgpYVHkefXYcC4HHwWOfZa3x6Y8wxDLUBv7dxN5XQ3nA==", + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.37.0.tgz", + "integrity": "sha512-z2nkKI1sJzyi7T47Ji/ewBPuIma1RNvQCCYVdV+MqWBV7o4Sa1n94UJCJJ1aQRF/xRkFfyqLGlGFWitIcCOtbg==", "license": "MIT", "dependencies": { "prosemirror-model": "^1.20.0", @@ -4080,9 +4071,9 @@ } }, "node_modules/sortablejs": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.15.3.tgz", - "integrity": "sha512-zdK3/kwwAK1cJgy1rwl1YtNTbRmc8qW/+vgXf75A7NHag5of4pyI6uK86ktmQETyWRH7IGaE73uZOOBcGxgqZg==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.15.6.tgz", + "integrity": "sha512-aNfiuwMEpfBM/CN6LY0ibyhxPfPbyFeBTYJKCvzkJ2GkUpazIt3H+QIPAMHwqQ7tMKaHz1Qj+rJJCqljnf4p3A==", "license": "MIT" }, "node_modules/source-map": { @@ -4279,9 +4270,9 @@ "license": "MIT" }, "node_modules/terser": { - "version": "5.36.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz", - "integrity": "sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==", + "version": "5.37.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz", + "integrity": "sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -4491,21 +4482,21 @@ "license": "MIT" }, "node_modules/vite": { - "version": "5.4.11", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", - "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.3.tgz", + "integrity": "sha512-Cmuo5P0ENTN6HxLSo6IHsjCLn/81Vgrp81oaiFFMRa8gGDj5xEjIcEpf2ZymZtZR8oU0P2JX5WuUp/rlXcHkAw==", "dev": true, "license": "MIT", "dependencies": { - "esbuild": "^0.21.3", - "postcss": "^8.4.43", - "rollup": "^4.20.0" + "esbuild": "^0.24.0", + "postcss": "^8.4.49", + "rollup": "^4.23.0" }, "bin": { "vite": "bin/vite.js" }, "engines": { - "node": "^18.0.0 || >=20.0.0" + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" }, "funding": { "url": "https://github.com/vitejs/vite?sponsor=1" @@ -4514,19 +4505,25 @@ "fsevents": "~2.3.3" }, "peerDependencies": { - "@types/node": "^18.0.0 || >=20.0.0", + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "jiti": ">=1.21.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", - "terser": "^5.4.0" + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" }, "peerDependenciesMeta": { "@types/node": { "optional": true }, + "jiti": { + "optional": true + }, "less": { "optional": true }, @@ -4547,13 +4544,19 @@ }, "terser": { "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true } } }, "node_modules/vite-node": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.5.tgz", - "integrity": "sha512-rd0QIgx74q4S1Rd56XIiL2cYEdyWn13cunYBIuqh9mpmQr7gGS0IxXoP8R6OaZtNQQLyXSWbd4rXKYUbhFpK5w==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.8.tgz", + "integrity": "sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==", "dev": true, "license": "MIT", "dependencies": { @@ -4573,87 +4576,1094 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/vite-plugin-static-copy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-2.1.0.tgz", - "integrity": "sha512-n8lEOIVM00Y/zronm0RG8RdPyFd0SAAFR0sii3NWmgG3PSCyYMsvUNRQTlb3onp1XeMrKIDwCrPGxthKvqX9OQ==", + "node_modules/vite-node/node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], "dev": true, "license": "MIT", - "dependencies": { - "chokidar": "^3.5.3", - "fast-glob": "^3.2.11", - "fs-extra": "^11.1.0", - "picocolors": "^1.0.0" - }, + "optional": true, + "os": [ + "aix" + ], "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "peerDependencies": { - "vite": "^5.0.0" + "node": ">=12" } }, - "node_modules/vitest": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.5.tgz", - "integrity": "sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A==", + "node_modules/vite-node/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], "dev": true, "license": "MIT", - "dependencies": { - "@vitest/expect": "2.1.5", - "@vitest/mocker": "2.1.5", - "@vitest/pretty-format": "^2.1.5", - "@vitest/runner": "2.1.5", - "@vitest/snapshot": "2.1.5", - "@vitest/spy": "2.1.5", - "@vitest/utils": "2.1.5", - "chai": "^5.1.2", - "debug": "^4.3.7", - "expect-type": "^1.1.0", - "magic-string": "^0.30.12", - "pathe": "^1.1.2", - "std-env": "^3.8.0", - "tinybench": "^2.9.0", - "tinyexec": "^0.3.1", - "tinypool": "^1.0.1", - "tinyrainbow": "^1.2.0", - "vite": "^5.0.0", - "vite-node": "2.1.5", - "why-is-node-running": "^2.3.0" - }, - "bin": { - "vitest": "vitest.mjs" - }, - "engines": { + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite-node/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/vite-node/node_modules/vite": { + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-plugin-static-copy": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-2.2.0.tgz", + "integrity": "sha512-ytMrKdR9iWEYHbUxs6x53m+MRl4SJsOSoMu1U1+Pfg0DjPeMlsRVx3RR5jvoonineDquIue83Oq69JvNsFSU5w==", + "dev": true, + "license": "MIT", + "dependencies": { + "chokidar": "^3.5.3", + "fast-glob": "^3.2.11", + "fs-extra": "^11.1.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0" + } + }, + "node_modules/vitest": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.8.tgz", + "integrity": "sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "2.1.8", + "@vitest/mocker": "2.1.8", + "@vitest/pretty-format": "^2.1.8", + "@vitest/runner": "2.1.8", + "@vitest/snapshot": "2.1.8", + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", + "chai": "^5.1.2", + "debug": "^4.3.7", + "expect-type": "^1.1.0", + "magic-string": "^0.30.12", + "pathe": "^1.1.2", + "std-env": "^3.8.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.1", + "tinypool": "^1.0.1", + "tinyrainbow": "^1.2.0", + "vite": "^5.0.0", + "vite-node": "2.1.8", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { "node": "^18.0.0 || >=20.0.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "@edge-runtime/vm": "*", - "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.1.5", - "@vitest/ui": "2.1.5", - "happy-dom": "*", - "jsdom": "*" + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "2.1.8", + "@vitest/ui": "2.1.8", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/@vitest/mocker": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.8.tgz", + "integrity": "sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.8", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.12" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0" }, "peerDependenciesMeta": { - "@edge-runtime/vm": { + "msw": { "optional": true }, + "vite": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/vitest/node_modules/vite": { + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { "@types/node": { "optional": true }, - "@vitest/browser": { + "less": { "optional": true }, - "@vitest/ui": { + "lightningcss": { "optional": true }, - "happy-dom": { + "sass": { "optional": true }, - "jsdom": { + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { "optional": true } } diff --git a/panel/package.json b/panel/package.json index 21c981d67d..7c8b6e24a4 100644 --- a/panel/package.json +++ b/panel/package.json @@ -19,26 +19,26 @@ "prosemirror-history": "^1.4.1", "prosemirror-inputrules": "^1.4.0", "prosemirror-keymap": "^1.2.2", - "prosemirror-model": "^1.22.3", - "prosemirror-schema-list": "^1.4.1", - "prosemirror-view": "^1.36.0", - "sortablejs": "^1.15.2", + "prosemirror-model": "^1.24.0", + "prosemirror-schema-list": "^1.5.0", + "prosemirror-view": "^1.37.0", + "sortablejs": "^1.15.6", "vue": "^2.7.16" }, "devDependencies": { "@csstools/postcss-light-dark-function": "^2.0.7", - "@vitejs/plugin-vue2": "^2.3.1", - "eslint": "^9.15.0", + "@vitejs/plugin-vue2": "^2.3.3", + "eslint": "^9.16.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-vue": "^9.31.0", + "eslint-plugin-vue": "^9.32.0", "glob": "^11.0.0", "jsdom": "^25.0.1", - "prettier": "^3.3.3", + "prettier": "^3.4.2", "rollup-plugin-external-globals": "^0.13.0", - "terser": "^5.36.0", - "vite": "^5.4.11", - "vite-plugin-static-copy": "^2.1.0", - "vitest": "^2.1.5", + "terser": "^5.37.0", + "vite": "^6.0.3", + "vite-plugin-static-copy": "^2.2.0", + "vitest": "^2.1.8", "vue-docgen-api": "^4.79.2", "vue-template-compiler": "^2.7.16" }, From 41779596b5f35c02f8810ada948778f6212c13fc Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Fri, 6 Dec 2024 21:47:45 +0100 Subject: [PATCH 355/362] Tweak color lightness boosts --- panel/src/styles/config/colors.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panel/src/styles/config/colors.css b/panel/src/styles/config/colors.css index 13943e6bd5..9776e04fde 100644 --- a/panel/src/styles/config/colors.css +++ b/panel/src/styles/config/colors.css @@ -46,7 +46,7 @@ --color-orange-h: 28; --color-orange-s: 80%; --color-orange-hs: var(--color-orange-h), var(--color-orange-s); - --color-orange-boost: 2.5%; + --color-orange-boost: 2%; --color-orange-l-100: calc(var(--color-l-100) + var(--color-orange-boost)); --color-orange-l-200: calc(var(--color-l-200) + var(--color-orange-boost)); @@ -71,7 +71,7 @@ --color-yellow-h: 47; --color-yellow-s: 80%; --color-yellow-hs: var(--color-yellow-h), var(--color-yellow-s); - --color-yellow-boost: 0%; + --color-yellow-boost: -4%; --color-yellow-l-100: calc(var(--color-l-100) + var(--color-yellow-boost)); --color-yellow-l-200: calc(var(--color-l-200) + var(--color-yellow-boost)); @@ -96,7 +96,7 @@ --color-green-h: 80; --color-green-s: 60%; --color-green-hs: var(--color-green-h), var(--color-green-s); - --color-green-boost: -2.5%; + --color-green-boost: -8%; --color-green-l-100: calc(var(--color-l-100) + var(--color-green-boost)); --color-green-l-200: calc(var(--color-l-200) + var(--color-green-boost)); @@ -121,7 +121,7 @@ --color-aqua-h: 180; --color-aqua-s: 50%; --color-aqua-hs: var(--color-aqua-h), var(--color-aqua-s); - --color-aqua-boost: 0%; + --color-aqua-boost: -4%; --color-aqua-l-100: calc(var(--color-l-100) + var(--color-aqua-boost)); --color-aqua-l-200: calc(var(--color-l-200) + var(--color-aqua-boost)); From b6bbe472e28a7991d42f0b013d911b1695151c9e Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Fri, 6 Dec 2024 22:07:19 +0100 Subject: [PATCH 356/362] Ignore Kirby URL params for the preview token --- src/Content/Version.php | 4 ++-- tests/Content/VersionTest.php | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Content/Version.php b/src/Content/Version.php index c0da2e3412..d7ab239f07 100644 --- a/src/Content/Version.php +++ b/src/Content/Version.php @@ -11,7 +11,6 @@ use Kirby\Exception\LogicException; use Kirby\Exception\NotFoundException; use Kirby\Form\Form; -use Kirby\Http\Query; use Kirby\Http\Uri; use Kirby\Toolkit\Str; @@ -435,7 +434,8 @@ protected function previewTokenFromUrl(string $url): string|null // get rid of all modifiers after the path $uri = new Uri($url); $uri->fragment = null; - $uri->query = new Query([]); + $uri->params = null; + $uri->query = null; $data = [ 'uri' => Str::after($uri->toString(), $localPrefix), diff --git a/tests/Content/VersionTest.php b/tests/Content/VersionTest.php index ef6a57428f..ff639d226f 100644 --- a/tests/Content/VersionTest.php +++ b/tests/Content/VersionTest.php @@ -1524,6 +1524,8 @@ public static function pageUrlProvider(): array ['{{ site.url }}#{{ page.slug }}', '/?{token}#test', '', true, 'latest'], ['{{ page.url }}?preview=true', '/test?preview=true', null, false, 'latest'], ['{{ page.url }}?preview=true', '/test?preview=true&{token}', 'test', true, 'latest'], + ['{{ page.url }}/param:something', '/test/param:something', null, false, 'latest'], + ['{{ page.url }}/param:something', '/test/param:something?{token}', 'test', true, 'latest'], [false, null, null, false, 'latest'], [false, null, null, true, 'latest'], [null, null, null, false, 'latest', false], @@ -1541,6 +1543,8 @@ public static function pageUrlProvider(): array ['{{ site.url }}#{{ page.slug }}', '/?{token}&_version=changes#test', '', true, 'changes'], ['{{ page.url }}?preview=true', '/test?preview=true&{token}&_version=changes', 'test', false, 'changes'], ['{{ page.url }}?preview=true', '/test?preview=true&{token}&_version=changes', 'test', true, 'changes'], + ['{{ page.url }}/param:something', '/test/param:something?{token}&_version=changes', 'test', false, 'changes'], + ['{{ page.url }}/param:something', '/test/param:something?{token}&_version=changes', 'test', true, 'changes'], [false, null, null, false, 'changes'], [false, null, null, true, 'changes'], [null, null, null, false, 'changes', false], From 7b25b4f249b3beb28451e632b58911ea4dfefafc Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Fri, 6 Dec 2024 22:08:18 +0100 Subject: [PATCH 357/362] Implement feedback from code review --- src/Content/Version.php | 6 +++--- tests/Content/VersionTest.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Content/Version.php b/src/Content/Version.php index d7ab239f07..4bf9af96fa 100644 --- a/src/Content/Version.php +++ b/src/Content/Version.php @@ -618,7 +618,7 @@ public function url(): string|null } // it wasn't, use the safer/more reliable model-based preview token - return $this->urlParams($this->model->url(), $this->previewToken()); + return $this->urlWithQueryParams($this->model->url(), $this->previewToken()); } /** @@ -630,7 +630,7 @@ protected function urlFromOption(string $url): string // try to determine a token for a local preview // (we cannot determine the token for external previews) if ($token = $this->previewTokenFromUrl($url)) { - return $this->urlParams($url, $token); + return $this->urlWithQueryParams($url, $token); } // fall back to the URL as defined in the blueprint @@ -641,7 +641,7 @@ protected function urlFromOption(string $url): string * Assembles the preview URL with the added `_token` and `_version` * query params, no matter if the base URL already contains query params */ - protected function urlParams(string $baseUrl, string $token): string + protected function urlWithQueryParams(string $baseUrl, string $token): string { $uri = new Uri($baseUrl); $uri->query->_token = $token; diff --git a/tests/Content/VersionTest.php b/tests/Content/VersionTest.php index ff639d226f..bb64cf2eae 100644 --- a/tests/Content/VersionTest.php +++ b/tests/Content/VersionTest.php @@ -1476,7 +1476,7 @@ public function testUpdateWithDirtyFields(): void /** * @covers ::url - * @covers ::urlParams + * @covers ::urlWithQueryParams */ public function testUrlPage() { @@ -1555,7 +1555,7 @@ public static function pageUrlProvider(): array * @covers ::previewTokenFromUrl * @covers ::url * @covers ::urlFromOption - * @covers ::urlParams + * @covers ::urlWithQueryParams * @dataProvider pageUrlProvider */ public function testUrlPageCustom( @@ -1633,7 +1633,7 @@ public function testUrlPageCustom( /** * @covers ::url - * @covers ::urlParams + * @covers ::urlWithQueryParams */ public function testUrlSite() { @@ -1688,7 +1688,7 @@ public static function siteUrlProvider(): array * @covers ::previewTokenFromUrl * @covers ::url * @covers ::urlFromOption - * @covers ::urlParams + * @covers ::urlWithQueryParams * @dataProvider siteUrlProvider */ public function testUrlSiteCustom( From f6f1e7634dfb56ff5debed7a7d082064433fe8cd Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Sun, 25 Aug 2024 14:59:51 +0200 Subject: [PATCH 358/362] Raise support to include PHP 8.4 --- .github/workflows/backend.yml | 2 +- bootstrap.php | 2 +- composer.json | 2 +- composer.lock | 4 ++-- src/Cms/System.php | 2 +- tests/Cms/System/UpdateStatusTest.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 78961916c0..c7b555a625 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -57,7 +57,7 @@ jobs: timeout-minutes: 5 strategy: matrix: - php: ["8.2", "8.3"] + php: ["8.2", "8.3", "8.4"] env: extensions: mbstring, ctype, curl, gd, apcu, memcached, redis ini: apc.enabled=1, apc.enable_cli=1, pcov.directory=., "pcov.exclude=\"~(vendor|tests)~\"" diff --git a/bootstrap.php b/bootstrap.php index f1fa6de800..70f27ce50e 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -6,7 +6,7 @@ */ if ( version_compare(PHP_VERSION, '8.2.0', '>=') === false || - version_compare(PHP_VERSION, '8.4.0', '<') === false + version_compare(PHP_VERSION, '8.5.0', '<') === false ) { die(include __DIR__ . '/views/php.php'); } diff --git a/composer.json b/composer.json index 41d9a7de98..0de24406fc 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "source": "https://github.com/getkirby/kirby" }, "require": { - "php": "~8.2.0 || ~8.3.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", "ext-SimpleXML": "*", "ext-ctype": "*", "ext-curl": "*", diff --git a/composer.lock b/composer.lock index c3709619fa..f78dc6508a 100644 --- a/composer.lock +++ b/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": "2b637dba1c867ecd6d5fbb08ca0563ed", + "content-hash": "1e072620f6c1829449a8461cd72c6156", "packages": [ { "name": "christian-riesen/base32", @@ -1027,7 +1027,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "~8.2.0 || ~8.3.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", "ext-simplexml": "*", "ext-ctype": "*", "ext-curl": "*", diff --git a/src/Cms/System.php b/src/Cms/System.php index fc5d8a1a48..4b8693ad32 100644 --- a/src/Cms/System.php +++ b/src/Cms/System.php @@ -370,7 +370,7 @@ public function php(): bool { return version_compare(PHP_VERSION, '8.2.0', '>=') === true && - version_compare(PHP_VERSION, '8.4.0', '<') === true; + version_compare(PHP_VERSION, '8.5.0', '<') === true; } /** diff --git a/tests/Cms/System/UpdateStatusTest.php b/tests/Cms/System/UpdateStatusTest.php index bad04834dc..9899b9dc27 100644 --- a/tests/Cms/System/UpdateStatusTest.php +++ b/tests/Cms/System/UpdateStatusTest.php @@ -72,7 +72,7 @@ public function testLoadData() '8.0' => '2023-11-26', '8.1' => '2024-11-25', '8.2' => '2025-12-08', - '8.3' => '2026-11-23' + '8.3' => '2026-11-23', ], 'incidents' => [], 'messages' => [], From fae7a7beba31ba38e50c7b37d29a3438fe30c396 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 21 Nov 2024 18:55:52 +0100 Subject: [PATCH 359/362] Fix Parsedown classes for PHP 8.4 --- dependencies/parsedown-extra/ParsedownExtra.php | 4 ++-- dependencies/parsedown/Parsedown.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dependencies/parsedown-extra/ParsedownExtra.php b/dependencies/parsedown-extra/ParsedownExtra.php index 2f9c62d192..390edd7ccf 100644 --- a/dependencies/parsedown-extra/ParsedownExtra.php +++ b/dependencies/parsedown-extra/ParsedownExtra.php @@ -17,7 +17,7 @@ class ParsedownExtra extends Parsedown { # ~ - public const version = '0.8.0-beta-1'; + public const version = '0.8.0-beta-2'; # ~ @@ -297,7 +297,7 @@ protected function blockMarkupComplete($Block) # # Setext - protected function blockSetextHeader($Line, array $Block = null) + protected function blockSetextHeader($Line, array|null $Block = null) { $Block = parent::blockSetextHeader($Line, $Block); diff --git a/dependencies/parsedown/Parsedown.php b/dependencies/parsedown/Parsedown.php index ab7222582c..76b2a7c205 100644 --- a/dependencies/parsedown/Parsedown.php +++ b/dependencies/parsedown/Parsedown.php @@ -17,7 +17,7 @@ class Parsedown { # ~ - public const version = '1.8.0-beta-7'; + public const version = '1.8.0-beta-8'; # ~ @@ -526,7 +526,7 @@ protected function blockHeader($Line) # # List - protected function blockList($Line, array $CurrentBlock = null) + protected function blockList($Line, array|null $CurrentBlock = null) { list($name, $pattern) = $Line['text'][0] <= '-' ? array('ul', '[*+-]') : array('ol', '[0-9]{1,9}+[.\)]'); @@ -741,7 +741,7 @@ protected function blockRule($Line) # # Setext - protected function blockSetextHeader($Line, array $Block = null) + protected function blockSetextHeader($Line, array|null $Block = null) { if (! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) { return; @@ -821,7 +821,7 @@ protected function blockReference($Line) # # Table - protected function blockTable($Line, array $Block = null) + protected function blockTable($Line, array|null $Block = null) { if (! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) { return; From 721b43d3f38c90f0319e58678ce92c446862ca7a Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 21 Nov 2024 19:25:02 +0100 Subject: [PATCH 360/362] Upgrade CI phpunit and psalm --- .github/workflows/backend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index c7b555a625..51c818a999 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -104,7 +104,7 @@ jobs: extensions: ${{ env.extensions }} ini-values: ${{ env.ini }} coverage: pcov - tools: phpunit:10.5.5, psalm:5.20.0 + tools: phpunit:11.4.3, psalm:5.26.1 - name: Setup problem matchers run: | From 472160d35dc5edd50f7296b1a5bc0d23834bdba4 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 22 Nov 2024 14:48:42 +0100 Subject: [PATCH 361/362] Upgrade simpleimage --- composer.json | 2 +- composer.lock | 14 ++++++------- .../simpleimage/src/claviska/SimpleImage.php | 20 +++++++++---------- vendor/composer/installed.json | 14 ++++++------- vendor/composer/installed.php | 10 +++++----- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/composer.json b/composer.json index 0de24406fc..a0e5280919 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "ext-mbstring": "*", "ext-openssl": "*", "christian-riesen/base32": "1.6.0", - "claviska/simpleimage": "4.2.0", + "claviska/simpleimage": "4.2.1", "composer/semver": "3.4.3", "filp/whoops": "2.16.0", "getkirby/composer-installer": "^1.2.1", diff --git a/composer.lock b/composer.lock index f78dc6508a..1cac39429e 100644 --- a/composer.lock +++ b/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": "1e072620f6c1829449a8461cd72c6156", + "content-hash": "b2a4343f6fbd666dd56873cfd0e7e91f", "packages": [ { "name": "christian-riesen/base32", @@ -67,16 +67,16 @@ }, { "name": "claviska/simpleimage", - "version": "4.2.0", + "version": "4.2.1", "source": { "type": "git", "url": "https://github.com/claviska/SimpleImage.git", - "reference": "dfbe53c01dae8467468ef2b817c09b786a7839d2" + "reference": "ec6d5021e5a7153a2520d64c59b86b6f3c4157c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/claviska/SimpleImage/zipball/dfbe53c01dae8467468ef2b817c09b786a7839d2", - "reference": "dfbe53c01dae8467468ef2b817c09b786a7839d2", + "url": "https://api.github.com/repos/claviska/SimpleImage/zipball/ec6d5021e5a7153a2520d64c59b86b6f3c4157c5", + "reference": "ec6d5021e5a7153a2520d64c59b86b6f3c4157c5", "shasum": "" }, "require": { @@ -108,7 +108,7 @@ "description": "A PHP class that makes working with images as simple as possible.", "support": { "issues": "https://github.com/claviska/SimpleImage/issues", - "source": "https://github.com/claviska/SimpleImage/tree/4.2.0" + "source": "https://github.com/claviska/SimpleImage/tree/4.2.1" }, "funding": [ { @@ -116,7 +116,7 @@ "type": "github" } ], - "time": "2024-04-15T16:07:16+00:00" + "time": "2024-11-22T13:25:03+00:00" }, { "name": "composer/semver", diff --git a/vendor/claviska/simpleimage/src/claviska/SimpleImage.php b/vendor/claviska/simpleimage/src/claviska/SimpleImage.php index c9c0c7b0bf..5c08c584c3 100644 --- a/vendor/claviska/simpleimage/src/claviska/SimpleImage.php +++ b/vendor/claviska/simpleimage/src/claviska/SimpleImage.php @@ -331,7 +331,7 @@ public function fromString(string $string): SimpleImage|static * * @throws Exception Thrown when WEBP support is not enabled or unsupported format. */ - public function generate(string $mimeType = null, array|int $options = 100): array + public function generate(string|null $mimeType = null, array|int $options = 100): array { // Format defaults to the original mime type $mimeType = $mimeType ?: $this->mimeType; @@ -473,7 +473,7 @@ public function generate(string $mimeType = null, array|int $options = 100): arr * * @throws Exception */ - public function toDataUri(string $mimeType = null, array|int $options = 100): string + public function toDataUri(string|null $mimeType = null, array|int $options = 100): string { $image = $this->generate($mimeType, $options); @@ -490,7 +490,7 @@ public function toDataUri(string $mimeType = null, array|int $options = 100): st * * @throws Exception */ - public function toDownload(string $filename, string $mimeType = null, array|int $options = 100): static + public function toDownload(string $filename, string|null $mimeType = null, array|int $options = 100): static { $image = $this->generate($mimeType, $options); @@ -517,7 +517,7 @@ public function toDownload(string $filename, string $mimeType = null, array|int * * @throws Exception Thrown if failed write to file. */ - public function toFile(string $file, string $mimeType = null, array|int $options = 100): static + public function toFile(string $file, string|null $mimeType = null, array|int $options = 100): static { $image = $this->generate($mimeType, $options); @@ -538,7 +538,7 @@ public function toFile(string $file, string $mimeType = null, array|int $options * * @throws Exception */ - public function toScreen(string $mimeType = null, array|int $options = 100): static + public function toScreen(string|null $mimeType = null, array|int $options = 100): static { $image = $this->generate($mimeType, $options); @@ -557,7 +557,7 @@ public function toScreen(string $mimeType = null, array|int $options = 100): sta * * @throws Exception */ - public function toString(string $mimeType = null, array|int $options = 100): string + public function toString(string|null $mimeType = null, array|int $options = 100): string { return $this->generate($mimeType, $options)['data']; } @@ -975,7 +975,7 @@ public function overlay(string|SimpleImage $overlay, string $anchor = 'center', * @param int|null $height The new image height. * @return SimpleImage */ - public function resize(int $width = null, int $height = null): static + public function resize(int|null $width = null, int|null $height = null): static { // No dimensions specified if (! $width && ! $height) { @@ -1027,7 +1027,7 @@ public function resize(int $width = null, int $height = null): static * @param int|null $res_y The vertical resolution in DPI * @return SimpleImage */ - public function resolution(int $res_x, int $res_y = null): static + public function resolution(int $res_x, int|null $res_y = null): static { if (is_null($res_y)) { imageresolution($this->image, $res_x); @@ -1087,7 +1087,7 @@ public function rotate(int $angle, string|array $backgroundColor = 'transparent' * * @throws Exception */ - public function text(string $text, array $options, array &$boundary = null): static + public function text(string $text, array $options, array|null &$boundary = null): static { // Check for freetype support if (! function_exists('imagettftext')) { @@ -2196,7 +2196,7 @@ public static function darkenColor(string|array $color, int $amount): array * * @throws Exception Thrown if library \League\ColorExtractor is missing. */ - public function extractColors(int $count = 5, string|array $backgroundColor = null): array + public function extractColors(int $count = 5, string|array|null $backgroundColor = null): array { // Check for required library if (! class_exists('\\'.ColorExtractor::class)) { diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index a08668363e..42decfba67 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -64,17 +64,17 @@ }, { "name": "claviska/simpleimage", - "version": "4.2.0", - "version_normalized": "4.2.0.0", + "version": "4.2.1", + "version_normalized": "4.2.1.0", "source": { "type": "git", "url": "https://github.com/claviska/SimpleImage.git", - "reference": "dfbe53c01dae8467468ef2b817c09b786a7839d2" + "reference": "ec6d5021e5a7153a2520d64c59b86b6f3c4157c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/claviska/SimpleImage/zipball/dfbe53c01dae8467468ef2b817c09b786a7839d2", - "reference": "dfbe53c01dae8467468ef2b817c09b786a7839d2", + "url": "https://api.github.com/repos/claviska/SimpleImage/zipball/ec6d5021e5a7153a2520d64c59b86b6f3c4157c5", + "reference": "ec6d5021e5a7153a2520d64c59b86b6f3c4157c5", "shasum": "" }, "require": { @@ -86,7 +86,7 @@ "laravel/pint": "^1.5", "phpstan/phpstan": "^1.10" }, - "time": "2024-04-15T16:07:16+00:00", + "time": "2024-11-22T13:25:03+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -108,7 +108,7 @@ "description": "A PHP class that makes working with images as simple as possible.", "support": { "issues": "https://github.com/claviska/SimpleImage/issues", - "source": "https://github.com/claviska/SimpleImage/tree/4.2.0" + "source": "https://github.com/claviska/SimpleImage/tree/4.2.1" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 10b7bb04f9..930cf32d7e 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'getkirby/cms', 'pretty_version' => '5.0.0-alpha.4', 'version' => '5.0.0.0-alpha4', - 'reference' => null, + 'reference' => NULL, 'type' => 'kirby-cms', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -20,9 +20,9 @@ 'dev_requirement' => false, ), 'claviska/simpleimage' => array( - 'pretty_version' => '4.2.0', - 'version' => '4.2.0.0', - 'reference' => 'dfbe53c01dae8467468ef2b817c09b786a7839d2', + 'pretty_version' => '4.2.1', + 'version' => '4.2.1.0', + 'reference' => 'ec6d5021e5a7153a2520d64c59b86b6f3c4157c5', 'type' => 'library', 'install_path' => __DIR__ . '/../claviska/simpleimage', 'aliases' => array(), @@ -49,7 +49,7 @@ 'getkirby/cms' => array( 'pretty_version' => '5.0.0-alpha.4', 'version' => '5.0.0.0-alpha4', - 'reference' => null, + 'reference' => NULL, 'type' => 'kirby-cms', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), From 958001340689cb1ca7209d64eeb7b11bdd9224e4 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Sat, 7 Dec 2024 14:31:54 +0100 Subject: [PATCH 362/362] Lower PHPUnit again and exclude Psalm for PHP 8.4 --- .github/workflows/backend.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 51c818a999..d40bdf1310 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -104,7 +104,7 @@ jobs: extensions: ${{ env.extensions }} ini-values: ${{ env.ini }} coverage: pcov - tools: phpunit:11.4.3, psalm:5.26.1 + tools: phpunit:10.5.38, psalm:5.26.1 - name: Setup problem matchers run: | @@ -127,7 +127,7 @@ jobs: run: phpunit --fail-on-skipped --coverage-clover ${{ github.workspace }}/clover.xml - name: Statically analyze using Psalm - if: always() && steps.finishPrepare.outcome == 'success' + if: always() && steps.finishPrepare.outcome == 'success' && matrix.php != '8.4' run: psalm --output-format=github --php-version=${{ matrix.php }} --report=sarif/psalm.sarif --report-show-info=false - name: Upload coverage results to Codecov @@ -144,7 +144,7 @@ jobs: env_vars: PHP - name: Upload code scanning results to GitHub - if: always() && steps.finishPrepare.outcome == 'success' && github.repository == 'getkirby/kirby' + if: always() && steps.finishPrepare.outcome == 'success' && github.repository == 'getkirby/kirby' && matrix.php != '8.4' uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # pin@v3 with: sarif_file: sarif