From bd15dfb6c174ca164fb29196e15dce626073fc6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Bouch=C3=A9?= Date: Fri, 20 Oct 2023 09:36:50 +0200 Subject: [PATCH 01/15] Ibexa 4 support --- .gitignore | 1 + README.md | 2 +- composer.json | 24 ++++++--- src/Command/SchemaCommand.php | 6 --- src/DataTransformer/ImageMapTransformer.php | 2 +- .../OnisepImageMapExtension.php | 2 +- .../ImageMap/FieldValueConverter.php | 8 +-- .../ImageMapStorage/Gateway/LegacyStorage.php | 4 +- src/FieldType/ImageMap/Storage.php | 20 +++---- src/FieldType/ImageMap/Type.php | 6 +-- src/FieldType/ImageMap/Value.php | 2 +- src/Form/ImageMapType.php | 2 +- src/Form/LinkType.php | 2 +- src/FormMapper/ImageMapFormMapper.php | 14 ++--- src/Resources/config/services.yaml | 52 +++++++++---------- src/Twig/ImageMapRuntime.php | 8 +-- 16 files changed, 80 insertions(+), 75 deletions(-) diff --git a/.gitignore b/.gitignore index 1d4d367..31583b1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.idea vendor composer.lock .php-version diff --git a/README.md b/README.md index d9aed4b..887d562 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Onisep Ibexa Imagemap Bundle -This bundle provides an image map field type for Ibexa 3.3+. +This bundle provides an image map field type for Ibexa 4.0+. ## Installation diff --git a/composer.json b/composer.json index 7864c3f..e74cdb4 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "onisep/ibexa-imagemap-bundle", - "description": "Image map field type for Ibexa 3.3", + "description": "Image map field type for Ibexa 4.0+", "type": "symfony-bundle", "keywords": ["ibexa", "image map"], "license": "MIT", @@ -23,6 +23,16 @@ "homepage": "https://github.com/onisep/imagemap-bundle/graphs/contributors" } ], + "require": { + "php": "^7.4 || ^8.0", + "ext-json": "*", + "http-interop/http-factory-guzzle": "^1.2", + "ibexa/admin-ui": "^4.3", + "ibexa/core": "^4.3" + }, + "require-dev": { + "phpstan/phpstan": "^1.10" + }, "autoload": { "psr-4": { "Onisep\\IbexaImageMapBundle\\": "src/" @@ -33,15 +43,15 @@ "Onisep\\IbexaImageMapBundle\\Tests\\": "tests/" } }, - "require": { - "php": ">=7.4", - "ext-json": "*", - "ezsystems/ezplatform-admin-ui": "^2.3", - "ezsystems/ezplatform-kernel": "^1.3" + "scripts": { + "phpstan": "phpstan analyse -l 1 src" }, "minimum-stability": "dev", "prefer-stable": true, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "php-http/discovery": true + } } } diff --git a/src/Command/SchemaCommand.php b/src/Command/SchemaCommand.php index 2acf849..bf88d9e 100644 --- a/src/Command/SchemaCommand.php +++ b/src/Command/SchemaCommand.php @@ -28,9 +28,6 @@ public function __construct(Connection $connection) $this->connection = $connection; } - /** - * {@inheritdoc} - */ protected function configure() { $this @@ -40,9 +37,6 @@ protected function configure() ; } - /** - * {@inheritdoc} - */ protected function execute(InputInterface $input, OutputInterface $output) { $schemaProvider = new SchemaProvider(); diff --git a/src/DataTransformer/ImageMapTransformer.php b/src/DataTransformer/ImageMapTransformer.php index 7eaf5d3..434c291 100644 --- a/src/DataTransformer/ImageMapTransformer.php +++ b/src/DataTransformer/ImageMapTransformer.php @@ -4,7 +4,7 @@ namespace Onisep\IbexaImageMapBundle\DataTransformer; -use EzSystems\EzPlatformContentForms\FieldType\DataTransformer\ImageValueTransformer; +use Ibexa\ContentForms\FieldType\DataTransformer\ImageValueTransformer; use Onisep\IbexaImageMapBundle\FieldType\ImageMap\Value; class ImageMapTransformer extends ImageValueTransformer diff --git a/src/DependencyInjection/OnisepImageMapExtension.php b/src/DependencyInjection/OnisepImageMapExtension.php index 4eba4bf..f06a75e 100644 --- a/src/DependencyInjection/OnisepImageMapExtension.php +++ b/src/DependencyInjection/OnisepImageMapExtension.php @@ -24,7 +24,7 @@ public function prepend(ContainerBuilder $container) { $adminUiFormsConfigFile = __DIR__.'/../Resources/config/admin_ui_forms.yaml'; $config = Yaml::parseFile($adminUiFormsConfigFile); - $container->prependExtensionConfig('ezpublish', $config); + $container->prependExtensionConfig('ibexa', $config); $container->addResource(new FileResource($adminUiFormsConfigFile)); } } diff --git a/src/FieldType/ImageMap/FieldValueConverter.php b/src/FieldType/ImageMap/FieldValueConverter.php index 129cde0..4e3f38e 100644 --- a/src/FieldType/ImageMap/FieldValueConverter.php +++ b/src/FieldType/ImageMap/FieldValueConverter.php @@ -4,10 +4,10 @@ namespace Onisep\IbexaImageMapBundle\FieldType\ImageMap; -use eZ\Publish\Core\FieldType\FieldSettings; -use eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\ImageConverter; -use eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition; -use eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition; +use Ibexa\Contracts\Core\Persistence\Content\Type\FieldDefinition; +use Ibexa\Core\FieldType\FieldSettings; +use Ibexa\Core\Persistence\Legacy\Content\FieldValue\Converter\ImageConverter; +use Ibexa\Core\Persistence\Legacy\Content\StorageFieldDefinition; class FieldValueConverter extends ImageConverter { diff --git a/src/FieldType/ImageMap/ImageMapStorage/Gateway/LegacyStorage.php b/src/FieldType/ImageMap/ImageMapStorage/Gateway/LegacyStorage.php index 49a8f6e..b8c01b8 100644 --- a/src/FieldType/ImageMap/ImageMapStorage/Gateway/LegacyStorage.php +++ b/src/FieldType/ImageMap/ImageMapStorage/Gateway/LegacyStorage.php @@ -4,8 +4,8 @@ namespace Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway; -use eZ\Publish\SPI\Persistence\Content\Field; -use eZ\Publish\SPI\Persistence\Content\VersionInfo; +use Ibexa\Contracts\Core\Persistence\Content\Field; +use Ibexa\Contracts\Core\Persistence\Content\VersionInfo; use Onisep\IbexaImageMapBundle\Database\ImageMapRepository; class LegacyStorage diff --git a/src/FieldType/ImageMap/Storage.php b/src/FieldType/ImageMap/Storage.php index 81a3ec0..b366ddc 100644 --- a/src/FieldType/ImageMap/Storage.php +++ b/src/FieldType/ImageMap/Storage.php @@ -4,16 +4,16 @@ namespace Onisep\IbexaImageMapBundle\FieldType\ImageMap; -use eZ\Publish\Core\Base\Utils\DeprecationWarnerInterface as DeprecationWarner; -use eZ\Publish\Core\FieldType\Image\AliasCleanerInterface; -use eZ\Publish\Core\FieldType\Image\ImageStorage; -use eZ\Publish\Core\FieldType\Image\ImageStorage\Gateway as ImageStorageGateway; -use eZ\Publish\Core\FieldType\Image\PathGenerator; -use eZ\Publish\Core\IO\FilePathNormalizerInterface; -use eZ\Publish\Core\IO\IOServiceInterface; -use eZ\Publish\Core\IO\MetadataHandler; -use eZ\Publish\SPI\Persistence\Content\Field; -use eZ\Publish\SPI\Persistence\Content\VersionInfo; +use Ibexa\Contracts\Core\Persistence\Content\Field; +use Ibexa\Contracts\Core\Persistence\Content\VersionInfo; +use Ibexa\Core\Base\Utils\DeprecationWarnerInterface as DeprecationWarner; +use Ibexa\Core\FieldType\Image\AliasCleanerInterface; +use Ibexa\Core\FieldType\Image\ImageStorage; +use Ibexa\Core\FieldType\Image\ImageStorage\Gateway as ImageStorageGateway; +use Ibexa\Core\FieldType\Image\PathGenerator; +use Ibexa\Core\IO\FilePathNormalizerInterface; +use Ibexa\Core\IO\IOServiceInterface; +use Ibexa\Core\IO\MetadataHandler; use Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway\LegacyStorage as ImageMapStorageGateway; /** diff --git a/src/FieldType/ImageMap/Type.php b/src/FieldType/ImageMap/Type.php index 6bdc5f9..f152936 100755 --- a/src/FieldType/ImageMap/Type.php +++ b/src/FieldType/ImageMap/Type.php @@ -4,9 +4,9 @@ namespace Onisep\IbexaImageMapBundle\FieldType\ImageMap; -use eZ\Publish\Core\FieldType\Image\Type as ImageType; -use eZ\Publish\SPI\FieldType\Value as SPIValue; -use eZ\Publish\SPI\Persistence\Content\FieldValue as PersistenceValue; +use Ibexa\Contracts\Core\FieldType\Value as SPIValue; +use Ibexa\Contracts\Core\Persistence\Content\FieldValue as PersistenceValue; +use Ibexa\Core\FieldType\Image\Type as ImageType; /** * The ImageMap field type. diff --git a/src/FieldType/ImageMap/Value.php b/src/FieldType/ImageMap/Value.php index 86ad30d..28aa003 100755 --- a/src/FieldType/ImageMap/Value.php +++ b/src/FieldType/ImageMap/Value.php @@ -4,7 +4,7 @@ namespace Onisep\IbexaImageMapBundle\FieldType\ImageMap; -use eZ\Publish\Core\FieldType\Image\Value as ImageValue; +use Ibexa\Core\FieldType\Image\Value as ImageValue; /** * Value for ImageMap field type. diff --git a/src/Form/ImageMapType.php b/src/Form/ImageMapType.php index b0af862..a5b9a1f 100644 --- a/src/Form/ImageMapType.php +++ b/src/Form/ImageMapType.php @@ -4,7 +4,7 @@ namespace Onisep\IbexaImageMapBundle\Form; -use EzSystems\EzPlatformContentForms\Form\Type\FieldType\ImageFieldType; +use Ibexa\ContentForms\Form\Type\FieldType\ImageFieldType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; diff --git a/src/Form/LinkType.php b/src/Form/LinkType.php index 49188cd..b20d151 100644 --- a/src/Form/LinkType.php +++ b/src/Form/LinkType.php @@ -4,7 +4,7 @@ namespace Onisep\IbexaImageMapBundle\Form; -use eZ\Publish\API\Repository\ContentService; +use Ibexa\Contracts\Core\Repository\ContentService; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormInterface; diff --git a/src/FormMapper/ImageMapFormMapper.php b/src/FormMapper/ImageMapFormMapper.php index 988c329..38c4d61 100644 --- a/src/FormMapper/ImageMapFormMapper.php +++ b/src/FormMapper/ImageMapFormMapper.php @@ -4,13 +4,13 @@ namespace Onisep\IbexaImageMapBundle\FormMapper; -use eZ\Publish\API\Repository\ContentTypeService; -use eZ\Publish\API\Repository\FieldTypeService; -use eZ\Publish\API\Repository\LocationService; -use EzSystems\EzPlatformAdminUi\FieldType\Mapper\AbstractRelationFormMapper; -use EzSystems\EzPlatformAdminUi\Form\Data\FieldDefinitionData; -use EzSystems\EzPlatformContentForms\Data\Content\FieldData; -use EzSystems\EzPlatformContentForms\FieldType\FieldValueFormMapperInterface; +use Ibexa\AdminUi\FieldType\Mapper\AbstractRelationFormMapper; +use Ibexa\AdminUi\Form\Data\FieldDefinitionData; +use Ibexa\Contracts\ContentForms\Data\Content\FieldData; +use Ibexa\Contracts\ContentForms\FieldType\FieldValueFormMapperInterface; +use Ibexa\Contracts\Core\Repository\ContentTypeService; +use Ibexa\Contracts\Core\Repository\FieldTypeService; +use Ibexa\Contracts\Core\Repository\LocationService; use Onisep\IbexaImageMapBundle\DataTransformer\ImageMapTransformer; use Onisep\IbexaImageMapBundle\FieldType\ImageMap\Value; use Onisep\IbexaImageMapBundle\Form\ImageMapType; diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml index 5a4fe81..2e52741 100644 --- a/src/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -1,51 +1,51 @@ services: Onisep\IbexaImageMapBundle\FieldType\ImageMap\Type: arguments: - - ['@ezpublish.fieldType.validator.black_list', '@ezpublish.fieldType.validator.image'] - parent: ezpublish.fieldType + - ['@ibexa.fieldType.validator.black_list', '@ibexa.fieldType.validator.image'] + parent: ibexa.fieldType tags: - - { name: ezplatform.field_type, alias: imagemap } + - { name: ibexa.field_type, alias: imagemap } Onisep\IbexaImageMapBundle\FieldType\ImageMap\Storage: arguments: - - '@ezpublish.fieldType.ezimage.storage_gateway' - - '@ezpublish.fieldType.ezimage.io_service' - - '@ezpublish.fieldType.ezimage.pathGenerator' - - '@ezpublish.fieldType.metadataHandler.imagesize' - - '@ezpublish.utils.deprecation_warner' + - '@ibexa.fieldType.ezimage.storage_gateway' + - '@ibexa.fieldType.ezimage.io_service' + - '@ibexa.fieldType.ezimage.pathGenerator' + - '@ibexa.fieldType.metadataHandler.imagesize' + - '@ibexa.utils.deprecation_warner' - '@Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway\LegacyStorage' - - '@?ezpublish.image_alias.imagine.alias_cleaner' - - '@eZ\Publish\Core\IO\FilePathNormalizerInterface' + - '@?ibexa.image_alias.imagine.alias_cleaner' + - '@Ibexa\Core\IO\FilePathNormalizerInterface' tags: - - { name: ezplatform.field_type.external_storage_handler, alias: imagemap } + - { name: ibexa.field_type.external_storage_handler, alias: imagemap } Onisep\IbexaImageMapBundle\FieldType\ImageMap\FieldValueConverter: arguments: - - '@ezpublish.fieldType.ezimage.io_service' - - '@ezpublish.core.io.image_fieldtype.legacy_url_redecorator' + - '@ibexa.fieldType.ezimage.io_service' + - '@ibexa.core.io.image_fieldtype.legacy_url_redecorator' tags: - - { name: ezplatform.field_type.legacy_storage.converter, alias: imagemap, lazy: true, callback: '::create' } + - { name: ibexa.field_type.legacy_storage.converter, alias: imagemap, lazy: true, callback: '::create' } Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway\LegacyStorage: arguments: ['@Onisep\IbexaImageMapBundle\Database\ImageMapRepository'] tags: - - { name: ezplatform.field_type.external_storage_handler.gateway, alias: imagemap, identifier: LegacyStorage } + - { name: ibexa.field_type.external_storage_handler.gateway, alias: imagemap, identifier: LegacyStorage } Onisep\IbexaImageMapBundle\Database\ImageMapRepository: - arguments: ['@ezpublish.persistence.connection'] + arguments: ['@ibexa.persistence.connection'] Onisep\IbexaImageMapBundle\Twig\ImageMapExtension: tags: ['twig.extension'] Onisep\IbexaImageMapBundle\Twig\ImageMapRuntime: arguments: - $locationService: '@eZ\Publish\API\Repository\LocationService' - $contentService: '@eZ\Publish\API\Repository\ContentService' + $locationService: '@Ibexa\Contracts\Core\Repository\LocationService' + $contentService: '@Ibexa\Contracts\Core\Repository\ContentService' tags: ['twig.runtime'] Onisep\IbexaImageMapBundle\Form\LinkType: arguments: - $contentService: '@eZ\Publish\API\Repository\ContentService' + $contentService: '@Ibexa\Contracts\Core\Repository\ContentService' tags: ['form.type'] Onisep\IbexaImageMapBundle\Form\MapAreaType: @@ -59,19 +59,19 @@ services: Onisep\IbexaImageMapBundle\FormMapper\ImageMapFormMapper: arguments: - $contentTypeService: '@eZ\Publish\API\Repository\ContentTypeService' - $locationService: '@eZ\Publish\API\Repository\LocationService' - $fieldTypeService: '@eZ\Publish\API\Repository\FieldTypeService' + $contentTypeService: '@Ibexa\Contracts\Core\Repository\ContentTypeService' + $locationService: '@Ibexa\Contracts\Core\Repository\LocationService' + $fieldTypeService: '@Ibexa\Contracts\Core\Repository\FieldTypeService' tags: - - { name: ezplatform.field_type.form_mapper.definition, fieldType: imagemap } - - { name: ezplatform.field_type.form_mapper.value, fieldType: imagemap } + - { name: ibexa.field_type.form_mapper.definition, fieldType: imagemap } + - { name: ibexa.field_type.form_mapper.value, fieldType: imagemap } Onisep\IbexaImageMapBundle\Command\SchemaCommand: arguments: - $connection: '@ezpublish.persistence.connection' + $connection: '@ibexa.persistence.connection' tags: ['console.command'] onisep.imagemap.unindexed: class: eZ\Publish\Core\FieldType\Unindexed tags: - - { name: ezplatform.field_type.indexable, alias: imagemap } + - { name: ibexa.field_type.indexable, alias: imagemap } diff --git a/src/Twig/ImageMapRuntime.php b/src/Twig/ImageMapRuntime.php index ee4d95c..266958e 100644 --- a/src/Twig/ImageMapRuntime.php +++ b/src/Twig/ImageMapRuntime.php @@ -4,10 +4,10 @@ namespace Onisep\IbexaImageMapBundle\Twig; -use eZ\Publish\API\Repository\ContentService; -use eZ\Publish\API\Repository\LocationService; -use eZ\Publish\API\Repository\Values\Content\Field; -use eZ\Publish\Core\Base\Exceptions\NotFoundException; +use Ibexa\Contracts\Core\Repository\ContentService; +use Ibexa\Contracts\Core\Repository\LocationService; +use Ibexa\Contracts\Core\Repository\Values\Content\Field; +use Ibexa\Core\Base\Exceptions\NotFoundException; use Twig\Extension\RuntimeExtensionInterface; class ImageMapRuntime implements RuntimeExtensionInterface From 11935a6e4c80b26530b950acd79acf7a585644d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Bouch=C3=A9?= Date: Fri, 20 Oct 2023 09:42:08 +0200 Subject: [PATCH 02/15] Ibexa 4 support (2) --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index e74cdb4..33a1898 100644 --- a/composer.json +++ b/composer.json @@ -27,8 +27,8 @@ "php": "^7.4 || ^8.0", "ext-json": "*", "http-interop/http-factory-guzzle": "^1.2", - "ibexa/admin-ui": "^4.3", - "ibexa/core": "^4.3" + "ibexa/admin-ui": "^4.0", + "ibexa/core": "^4.0" }, "require-dev": { "phpstan/phpstan": "^1.10" From 8a97f154c098a9434b4fe86be969ce039cd8416b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Bouch=C3=A9?= Date: Fri, 20 Oct 2023 09:53:58 +0200 Subject: [PATCH 03/15] Ibexa 4 support (3) --- .../Compiler/AddDefaultViewTemplatePass.php | 4 ++-- src/Resources/config/services.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DependencyInjection/Compiler/AddDefaultViewTemplatePass.php b/src/DependencyInjection/Compiler/AddDefaultViewTemplatePass.php index 673d72b..b09529c 100644 --- a/src/DependencyInjection/Compiler/AddDefaultViewTemplatePass.php +++ b/src/DependencyInjection/Compiler/AddDefaultViewTemplatePass.php @@ -11,7 +11,7 @@ class AddDefaultViewTemplatePass implements CompilerPassInterface { public function process(ContainerBuilder $container) { - $parameter = $container->getParameter('ezsettings.default.content_view_defaults'); + $parameter = $container->getParameter('ibexasettings.default.content_view_defaults'); $parameter['imagemap_embed'] = [ 'default' => [ 'template' => '@ezdesign/default/content/imagemap_embed.html.twig', @@ -25,6 +25,6 @@ public function process(ContainerBuilder $container) ], ]; - $container->setParameter('ezsettings.default.content_view_defaults', $parameter); + $container->setParameter('ibexasettings.default.content_view_defaults', $parameter); } } diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml index 2e52741..01d5ef5 100644 --- a/src/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -72,6 +72,6 @@ services: tags: ['console.command'] onisep.imagemap.unindexed: - class: eZ\Publish\Core\FieldType\Unindexed + class: Ibexa\Core\FieldType\Unindexed tags: - { name: ibexa.field_type.indexable, alias: imagemap } From 1c8c88b95604e221d07e15750f591b7dfcb020e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Bouch=C3=A9?= Date: Fri, 20 Oct 2023 09:55:36 +0200 Subject: [PATCH 04/15] Ibexa 4 support (4) --- .../Compiler/AddDefaultViewTemplatePass.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DependencyInjection/Compiler/AddDefaultViewTemplatePass.php b/src/DependencyInjection/Compiler/AddDefaultViewTemplatePass.php index b09529c..5546593 100644 --- a/src/DependencyInjection/Compiler/AddDefaultViewTemplatePass.php +++ b/src/DependencyInjection/Compiler/AddDefaultViewTemplatePass.php @@ -11,7 +11,7 @@ class AddDefaultViewTemplatePass implements CompilerPassInterface { public function process(ContainerBuilder $container) { - $parameter = $container->getParameter('ibexasettings.default.content_view_defaults'); + $parameter = $container->getParameter('ibexa.default.content_view_defaults'); $parameter['imagemap_embed'] = [ 'default' => [ 'template' => '@ezdesign/default/content/imagemap_embed.html.twig', @@ -25,6 +25,6 @@ public function process(ContainerBuilder $container) ], ]; - $container->setParameter('ibexasettings.default.content_view_defaults', $parameter); + $container->setParameter('ibexa.default.content_view_defaults', $parameter); } } From 100f0a2c64d835c87a3b917e155d88b7a88084c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Bouch=C3=A9?= Date: Fri, 20 Oct 2023 10:12:37 +0200 Subject: [PATCH 05/15] Ibexa 4 support (5) --- .../Compiler/AddDefaultViewTemplatePass.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DependencyInjection/Compiler/AddDefaultViewTemplatePass.php b/src/DependencyInjection/Compiler/AddDefaultViewTemplatePass.php index 5546593..381cf0e 100644 --- a/src/DependencyInjection/Compiler/AddDefaultViewTemplatePass.php +++ b/src/DependencyInjection/Compiler/AddDefaultViewTemplatePass.php @@ -11,7 +11,7 @@ class AddDefaultViewTemplatePass implements CompilerPassInterface { public function process(ContainerBuilder $container) { - $parameter = $container->getParameter('ibexa.default.content_view_defaults'); + $parameter = $container->getParameter('ibexa.site_access.config.default.content_view_defaults'); $parameter['imagemap_embed'] = [ 'default' => [ 'template' => '@ezdesign/default/content/imagemap_embed.html.twig', @@ -25,6 +25,6 @@ public function process(ContainerBuilder $container) ], ]; - $container->setParameter('ibexa.default.content_view_defaults', $parameter); + $container->setParameter('ibexa.site_access.config.default.content_view_defaults', $parameter); } } From c09bd52dc4eb737d172d2e4c92ed0ff198f02650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Bouch=C3=A9?= Date: Fri, 20 Oct 2023 10:42:39 +0200 Subject: [PATCH 06/15] Ibexa 4 support (6) --- src/Resources/config/services.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml index 01d5ef5..2ca2fd7 100644 --- a/src/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -2,7 +2,6 @@ services: Onisep\IbexaImageMapBundle\FieldType\ImageMap\Type: arguments: - ['@ibexa.fieldType.validator.black_list', '@ibexa.fieldType.validator.image'] - parent: ibexa.fieldType tags: - { name: ibexa.field_type, alias: imagemap } From 3517f044fe325382235a89db04c4ff13e12b2cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Bouch=C3=A9?= Date: Fri, 20 Oct 2023 11:06:43 +0200 Subject: [PATCH 07/15] Ibexa 4 support (7) --- src/Resources/config/services.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml index 2ca2fd7..05b6488 100644 --- a/src/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -1,16 +1,16 @@ services: Onisep\IbexaImageMapBundle\FieldType\ImageMap\Type: arguments: - - ['@ibexa.fieldType.validator.black_list', '@ibexa.fieldType.validator.image'] + - ['@ibexa.field_type.validator.black_list', '@ibexa.field_type.validator.image'] tags: - { name: ibexa.field_type, alias: imagemap } Onisep\IbexaImageMapBundle\FieldType\ImageMap\Storage: arguments: - - '@ibexa.fieldType.ezimage.storage_gateway' - - '@ibexa.fieldType.ezimage.io_service' - - '@ibexa.fieldType.ezimage.pathGenerator' - - '@ibexa.fieldType.metadataHandler.imagesize' + - '@ibexa.field_type.ezimage.storage_gateway' + - '@ibexa.field_type.ezimage.io_service' + - '@ibexa.field_type.ezimage.pathGenerator' + - '@ibexa.field_type.metadataHandler.imagesize' - '@ibexa.utils.deprecation_warner' - '@Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway\LegacyStorage' - '@?ibexa.image_alias.imagine.alias_cleaner' @@ -20,7 +20,7 @@ services: Onisep\IbexaImageMapBundle\FieldType\ImageMap\FieldValueConverter: arguments: - - '@ibexa.fieldType.ezimage.io_service' + - '@ibexa.field_type.ezimage.io_service' - '@ibexa.core.io.image_fieldtype.legacy_url_redecorator' tags: - { name: ibexa.field_type.legacy_storage.converter, alias: imagemap, lazy: true, callback: '::create' } From d2800cf66664a8bab6fd4e39b11e8cedb810364c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Bouch=C3=A9?= Date: Fri, 20 Oct 2023 11:09:49 +0200 Subject: [PATCH 08/15] Ibexa 4 support (8) --- src/Resources/config/services.yaml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml index 05b6488..d3666b8 100644 --- a/src/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -1,7 +1,8 @@ services: Onisep\IbexaImageMapBundle\FieldType\ImageMap\Type: arguments: - - ['@ibexa.field_type.validator.black_list', '@ibexa.field_type.validator.image'] + - [ '@Ibexa\Core\FieldType\Validator\FileExtensionBlackListValidator', '@Ibexa\Core\FieldType\Validator\ImageValidator' ] + parent: Ibexa\Core\FieldType\FieldType tags: - { name: ibexa.field_type, alias: imagemap } @@ -26,35 +27,35 @@ services: - { name: ibexa.field_type.legacy_storage.converter, alias: imagemap, lazy: true, callback: '::create' } Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway\LegacyStorage: - arguments: ['@Onisep\IbexaImageMapBundle\Database\ImageMapRepository'] + arguments: [ '@Onisep\IbexaImageMapBundle\Database\ImageMapRepository' ] tags: - { name: ibexa.field_type.external_storage_handler.gateway, alias: imagemap, identifier: LegacyStorage } Onisep\IbexaImageMapBundle\Database\ImageMapRepository: - arguments: ['@ibexa.persistence.connection'] + arguments: [ '@ibexa.persistence.connection' ] Onisep\IbexaImageMapBundle\Twig\ImageMapExtension: - tags: ['twig.extension'] + tags: [ 'twig.extension' ] Onisep\IbexaImageMapBundle\Twig\ImageMapRuntime: arguments: $locationService: '@Ibexa\Contracts\Core\Repository\LocationService' $contentService: '@Ibexa\Contracts\Core\Repository\ContentService' - tags: ['twig.runtime'] + tags: [ 'twig.runtime' ] Onisep\IbexaImageMapBundle\Form\LinkType: arguments: $contentService: '@Ibexa\Contracts\Core\Repository\ContentService' - tags: ['form.type'] + tags: [ 'form.type' ] Onisep\IbexaImageMapBundle\Form\MapAreaType: - tags: ['form.type'] + tags: [ 'form.type' ] Onisep\IbexaImageMapBundle\Form\MapAreasType: - tags: ['form.type'] + tags: [ 'form.type' ] Onisep\IbexaImageMapBundle\Form\ImageMapType: - tags: ['form.type'] + tags: [ 'form.type' ] Onisep\IbexaImageMapBundle\FormMapper\ImageMapFormMapper: arguments: @@ -68,7 +69,7 @@ services: Onisep\IbexaImageMapBundle\Command\SchemaCommand: arguments: $connection: '@ibexa.persistence.connection' - tags: ['console.command'] + tags: [ 'console.command' ] onisep.imagemap.unindexed: class: Ibexa\Core\FieldType\Unindexed From 01d62189d109558c04b70283cc326abea0c701e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Bouch=C3=A9?= Date: Mon, 23 Oct 2023 10:27:09 +0200 Subject: [PATCH 09/15] Ibexa 4 support (9) --- src/Resources/config/services.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml index d3666b8..4bdfed2 100644 --- a/src/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -9,7 +9,7 @@ services: Onisep\IbexaImageMapBundle\FieldType\ImageMap\Storage: arguments: - '@ibexa.field_type.ezimage.storage_gateway' - - '@ibexa.field_type.ezimage.io_service' + - '@ibexa.field_type.ezimage.io' - '@ibexa.field_type.ezimage.pathGenerator' - '@ibexa.field_type.metadataHandler.imagesize' - '@ibexa.utils.deprecation_warner' @@ -21,15 +21,15 @@ services: Onisep\IbexaImageMapBundle\FieldType\ImageMap\FieldValueConverter: arguments: - - '@ibexa.field_type.ezimage.io_service' - - '@ibexa.core.io.image_fieldtype.legacy_url_redecorator' + - '@ibexa.field_type.ezimage.io' + - '@Ibexa\Core\IO\UrlRedecorator' tags: - - { name: ibexa.field_type.legacy_storage.converter, alias: imagemap, lazy: true, callback: '::create' } + - { name: ibexa.field_type.storage.legacy.converter, alias: imagemap, lazy: true, callback: '::create' } Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway\LegacyStorage: arguments: [ '@Onisep\IbexaImageMapBundle\Database\ImageMapRepository' ] tags: - - { name: ibexa.field_type.external_storage_handler.gateway, alias: imagemap, identifier: LegacyStorage } + - { name: ibexa.field_type.storage.external.handler.gateway, alias: imagemap, identifier: LegacyStorage } Onisep\IbexaImageMapBundle\Database\ImageMapRepository: arguments: [ '@ibexa.persistence.connection' ] From 35db03a841c20aebcae125def50f673adc4be6c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Bouch=C3=A9?= Date: Wed, 25 Oct 2023 14:58:04 +0200 Subject: [PATCH 10/15] Ibexa 4 support (10) --- src/Resources/config/services.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml index 4bdfed2..b256740 100644 --- a/src/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -8,16 +8,16 @@ services: Onisep\IbexaImageMapBundle\FieldType\ImageMap\Storage: arguments: - - '@ibexa.field_type.ezimage.storage_gateway' - - '@ibexa.field_type.ezimage.io' - - '@ibexa.field_type.ezimage.pathGenerator' - - '@ibexa.field_type.metadataHandler.imagesize' - - '@ibexa.utils.deprecation_warner' + - '@Ibexa\Core\FieldType\Image\ImageStorage\Gateway\DoctrineStorage' + - '@Ibexa\Core\FieldType\Image\IO\Legacy' + - '@Ibexa\Core\FieldType\Image\PathGenerator\LegacyPathGenerator' + - '@Ibexa\Core\IO\MetadataHandler\ImageSize' + - '@Ibexa\Core\Base\Utils\DeprecationWarner' - '@Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway\LegacyStorage' - - '@?ibexa.image_alias.imagine.alias_cleaner' + - '@Ibexa\Core\FieldType\Image\AliasCleanerInterface' - '@Ibexa\Core\IO\FilePathNormalizerInterface' tags: - - { name: ibexa.field_type.external_storage_handler, alias: imagemap } + - { name: ibexa.field_type.storage.external.handler, alias: imagemap } Onisep\IbexaImageMapBundle\FieldType\ImageMap\FieldValueConverter: arguments: From 99184c431299c2a8a932bdf1d2dae50f11cbdf1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Bouch=C3=A9?= Date: Mon, 6 Nov 2023 10:10:38 +0100 Subject: [PATCH 11/15] Ibexa 4 support (11) --- README.md | 2 +- .../Compiler/AddDefaultViewTemplatePass.php | 4 ++-- src/Resources/config/admin_ui_forms.yaml | 4 ++-- src/Resources/encore/ez.config.manager.js | 20 +++++++++---------- .../content/imagemap_form_fields.html.twig | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 887d562..ee7ddc3 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ $ bin/console onisep:imagemap:dump-schema --update To build admin assets: ```shell script -yarn encore prod --config-name=ezplatform +yarn encore prod --config-name=ibexa ``` For the front assets, you need to import the bundle files in your own entry points. For example, if your entry point is diff --git a/src/DependencyInjection/Compiler/AddDefaultViewTemplatePass.php b/src/DependencyInjection/Compiler/AddDefaultViewTemplatePass.php index 381cf0e..ac673cf 100644 --- a/src/DependencyInjection/Compiler/AddDefaultViewTemplatePass.php +++ b/src/DependencyInjection/Compiler/AddDefaultViewTemplatePass.php @@ -14,13 +14,13 @@ public function process(ContainerBuilder $container) $parameter = $container->getParameter('ibexa.site_access.config.default.content_view_defaults'); $parameter['imagemap_embed'] = [ 'default' => [ - 'template' => '@ezdesign/default/content/imagemap_embed.html.twig', + 'template' => '@ibexadesign/default/content/imagemap_embed.html.twig', 'match' => [], ], ]; $parameter['imagemap_popin'] = [ 'default' => [ - 'template' => '@ezdesign/default/content/imagemap_popin.html.twig', + 'template' => '@ibexadesign/default/content/imagemap_popin.html.twig', 'match' => [], ], ]; diff --git a/src/Resources/config/admin_ui_forms.yaml b/src/Resources/config/admin_ui_forms.yaml index b2d9884..fb38108 100644 --- a/src/Resources/config/admin_ui_forms.yaml +++ b/src/Resources/config/admin_ui_forms.yaml @@ -2,8 +2,8 @@ system: admin_group: admin_ui_forms: content_edit_form_templates: - - { template: '@ezdesign/content/imagemap_form_fields.html.twig', priority: 1 } + - { template: '@ibexadesign/content/imagemap_form_fields.html.twig', priority: 1 } default: field_templates: - - { template: '@ezdesign/fields/imagemap_content_fields.html.twig', priority: 0 } + - { template: '@ibexadesign/fields/imagemap_content_fields.html.twig', priority: 0 } diff --git a/src/Resources/encore/ez.config.manager.js b/src/Resources/encore/ez.config.manager.js index 3c40eed..449b53c 100644 --- a/src/Resources/encore/ez.config.manager.js +++ b/src/Resources/encore/ez.config.manager.js @@ -1,23 +1,23 @@ const path = require('path'); -module.exports = (eZConfig, eZConfigManager) => { - eZConfigManager.add({ - eZConfig, - entryName: 'ezplatform-admin-ui-content-edit-parts-js', +module.exports = (ibexaConfig, ibexaConfigManager) => { + ibexaConfigManager.add({ + ibexaConfig, + entryName: 'ibexa-admin-ui-content-edit-parts-js', newItems: [ path.resolve(__dirname, '../public/build/imagemap_edit.js'), ], }); - eZConfigManager.add({ - eZConfig, - entryName: 'ezplatform-admin-ui-layout-js', + ibexaConfigManager.add({ + ibexaConfig, + entryName: 'ibexa-admin-ui-layout-js', newItems: [ path.resolve(__dirname, '../public/build/imagemap.js'), ], }); - eZConfigManager.add({ - eZConfig, - entryName: 'ezplatform-admin-ui-layout-css', + ibexaConfigManager.add({ + ibexaConfig, + entryName: 'ibexa-admin-ui-layout-css', newItems: [ path.resolve(__dirname, '../public/build/imagemap_edit_styles.css'), path.resolve(__dirname, '../public/build/imagemap_styles.css'), diff --git a/src/Resources/views/themes/admin/content/imagemap_form_fields.html.twig b/src/Resources/views/themes/admin/content/imagemap_form_fields.html.twig index f5f8100..47a96ec 100644 --- a/src/Resources/views/themes/admin/content/imagemap_form_fields.html.twig +++ b/src/Resources/views/themes/admin/content/imagemap_form_fields.html.twig @@ -60,7 +60,7 @@
@@ -106,7 +106,7 @@
From 30a1ce14562ea6aecf29c1f3869943e04f2a5dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Bouch=C3=A9?= Date: Wed, 15 Nov 2023 10:40:38 +0100 Subject: [PATCH 12/15] Ibexa 4 support (12) --- composer.json | 4 ++-- src/FieldType/ImageMap/Storage.php | 14 ++++++-------- src/Resources/config/services.yaml | 15 +++++++-------- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index 33a1898..def15d5 100644 --- a/composer.json +++ b/composer.json @@ -27,8 +27,8 @@ "php": "^7.4 || ^8.0", "ext-json": "*", "http-interop/http-factory-guzzle": "^1.2", - "ibexa/admin-ui": "^4.0", - "ibexa/core": "^4.0" + "ibexa/admin-ui": "^4.5.3", + "ibexa/core": "^4.5.3" }, "require-dev": { "phpstan/phpstan": "^1.10" diff --git a/src/FieldType/ImageMap/Storage.php b/src/FieldType/ImageMap/Storage.php index b366ddc..33a6476 100644 --- a/src/FieldType/ImageMap/Storage.php +++ b/src/FieldType/ImageMap/Storage.php @@ -4,12 +4,11 @@ namespace Onisep\IbexaImageMapBundle\FieldType\ImageMap; +use Ibexa\Contracts\Core\FieldType\StorageGatewayInterface; use Ibexa\Contracts\Core\Persistence\Content\Field; use Ibexa\Contracts\Core\Persistence\Content\VersionInfo; -use Ibexa\Core\Base\Utils\DeprecationWarnerInterface as DeprecationWarner; use Ibexa\Core\FieldType\Image\AliasCleanerInterface; use Ibexa\Core\FieldType\Image\ImageStorage; -use Ibexa\Core\FieldType\Image\ImageStorage\Gateway as ImageStorageGateway; use Ibexa\Core\FieldType\Image\PathGenerator; use Ibexa\Core\IO\FilePathNormalizerInterface; use Ibexa\Core\IO\IOServiceInterface; @@ -24,16 +23,15 @@ class Storage extends ImageStorage private ImageMapStorageGateway $imageMapGateway; public function __construct( - ImageStorageGateway $baseGateway, - IOServiceInterface $IOService, + StorageGatewayInterface $gateway, + IOServiceInterface $ioService, PathGenerator $pathGenerator, MetadataHandler $imageSizeMetadataHandler, - DeprecationWarner $deprecationWarner, - ImageMapStorageGateway $imageMapGateway, AliasCleanerInterface $aliasCleaner, - FilePathNormalizerInterface $filePathNormalizer + FilePathNormalizerInterface $filePathNormalizer, + ImageMapStorageGateway $imageMapGateway ) { - parent::__construct($baseGateway, $IOService, $pathGenerator, $imageSizeMetadataHandler, $deprecationWarner, $aliasCleaner, $filePathNormalizer); + parent::__construct($gateway, $ioService, $pathGenerator, $imageSizeMetadataHandler, $aliasCleaner, $filePathNormalizer); $this->imageMapGateway = $imageMapGateway; } diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml index b256740..340d361 100644 --- a/src/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -8,14 +8,13 @@ services: Onisep\IbexaImageMapBundle\FieldType\ImageMap\Storage: arguments: - - '@Ibexa\Core\FieldType\Image\ImageStorage\Gateway\DoctrineStorage' - - '@Ibexa\Core\FieldType\Image\IO\Legacy' - - '@Ibexa\Core\FieldType\Image\PathGenerator\LegacyPathGenerator' - - '@Ibexa\Core\IO\MetadataHandler\ImageSize' - - '@Ibexa\Core\Base\Utils\DeprecationWarner' - - '@Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway\LegacyStorage' - - '@Ibexa\Core\FieldType\Image\AliasCleanerInterface' - - '@Ibexa\Core\IO\FilePathNormalizerInterface' + $gateway: '@Ibexa\Core\FieldType\Image\ImageStorage\Gateway\DoctrineStorage' + $ioService: '@Ibexa\Core\FieldType\Image\IO\Legacy' + $pathGenerator: '@Ibexa\Core\FieldType\Image\PathGenerator\LegacyPathGenerator' + $imageSizeMetadataHandler: '@Ibexa\Core\IO\MetadataHandler\ImageSize' + $aliasCleaner: '@Ibexa\Core\FieldType\Image\AliasCleanerInterface' + $filePathNormalizer: '@Ibexa\Core\IO\FilePathNormalizerInterface' + $imageMapGateway: '@Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway\LegacyStorage' tags: - { name: ibexa.field_type.storage.external.handler, alias: imagemap } From 3eafda25759f16d1048ceb970353a947ab9966f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20J?= Date: Fri, 8 Dec 2023 16:52:06 +0100 Subject: [PATCH 13/15] Fix edition --- assets/css/imagemap.contenttype.scss | 31 +++++++++++++++++-- assets/js/imagemap_edit.js | 16 +++++++++- .../ImageMapStorage/Gateway/LegacyStorage.php | 2 +- src/Resources/config/services.yaml | 4 +-- src/Resources/public/build/imagemap_edit.js | 2 +- .../public/build/imagemap_edit_styles.css | 2 +- .../content/imagemap_form_fields.html.twig | 28 ++++++++--------- .../default/content/imagemap_embed.html.twig | 2 +- .../default/content/imagemap_popin.html.twig | 2 +- .../fields/imagemap_content_fields.html.twig | 6 ++-- 10 files changed, 68 insertions(+), 27 deletions(-) diff --git a/assets/css/imagemap.contenttype.scss b/assets/css/imagemap.contenttype.scss index eac7a34..bea07b6 100644 --- a/assets/css/imagemap.contenttype.scss +++ b/assets/css/imagemap.contenttype.scss @@ -21,7 +21,7 @@ border: 1px solid black; svg { - fill: #17a2b8; + fill: #ae1164; width: 40px; height: 40px; } @@ -41,10 +41,37 @@ svg { width: 50px; height: 50px; - fill: #17a2b8; + fill: #ae1164; } } .imagemap-shape { cursor: pointer; } + +.imagemap-edit { + .ibexa-field-edit--with-preview .ibexa-field-edit-preview__visual { + grid-template-columns: 100% auto; + grid-template-rows: 40.125rem auto; + + .ibexa-field-edit-preview__details { + display: none; + } + + .ibexa-field-edit-preview__media { + max-height: 40rem; + } + } +} + +.imagemap-areas { + margin: 1rem 0 1rem 2.5rem; +} + +.imagemap-add { + margin-left: 2.5rem; +} + +.imagemap-draw-buttons { + margin-bottom: 1rem; +} diff --git a/assets/js/imagemap_edit.js b/assets/js/imagemap_edit.js index f7ed16f..e1638fc 100644 --- a/assets/js/imagemap_edit.js +++ b/assets/js/imagemap_edit.js @@ -106,7 +106,7 @@ const initImageMap = function (imageMap) { const prototype = areas.parentNode.dataset.prototype; const map = imageMap.querySelector('.imagemap-map'); - const image = imageMap.querySelector('.ez-field-edit-preview__media'); + const image = imageMap.querySelector('.ibexa-field-edit-preview__media'); const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); const draw = SVG(svg); const parent = image.parentNode; @@ -168,6 +168,20 @@ const initArea = function (area, map, draw) { target.querySelector('option[value="popin"]').hidden = true; } + area.querySelectorAll('.ibexa-dropdown').forEach((dropdownContainer) => { + const dropdownAlreadyInitialized = !!global.ibexa.helpers.objectInstances.getInstance(dropdownContainer); + + if (dropdownAlreadyInitialized) { + return; + } + + const dropdown = new global.ibexa.core.Dropdown({ + container: dropdownContainer, + }); + + dropdown.init(); + }); + recreateShape(area, draw); } diff --git a/src/FieldType/ImageMap/ImageMapStorage/Gateway/LegacyStorage.php b/src/FieldType/ImageMap/ImageMapStorage/Gateway/LegacyStorage.php index b8c01b8..4e0e456 100644 --- a/src/FieldType/ImageMap/ImageMapStorage/Gateway/LegacyStorage.php +++ b/src/FieldType/ImageMap/ImageMapStorage/Gateway/LegacyStorage.php @@ -29,7 +29,7 @@ public function saveMap(VersionInfo $versionInfo, Field $field): void $exists = $this->repository->get($fieldId, $version); - if ($exists) { + if ($exists !== null) { $this->repository->update($fieldId, $version, $field->value->data['map']); return; diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml index 340d361..00d3c0f 100644 --- a/src/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -62,8 +62,8 @@ services: $locationService: '@Ibexa\Contracts\Core\Repository\LocationService' $fieldTypeService: '@Ibexa\Contracts\Core\Repository\FieldTypeService' tags: - - { name: ibexa.field_type.form_mapper.definition, fieldType: imagemap } - - { name: ibexa.field_type.form_mapper.value, fieldType: imagemap } + - { name: ibexa.admin_ui.field_type.form.mapper.definition, fieldType: imagemap } + - { name: ibexa.admin_ui.field_type.form.mapper.value, fieldType: imagemap } Onisep\IbexaImageMapBundle\Command\SchemaCommand: arguments: diff --git a/src/Resources/public/build/imagemap_edit.js b/src/Resources/public/build/imagemap_edit.js index a6b357e..d645d07 100644 --- a/src/Resources/public/build/imagemap_edit.js +++ b/src/Resources/public/build/imagemap_edit.js @@ -1,2 +1,2 @@ /*! For license information please see imagemap_edit.js.LICENSE.txt */ -(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{edgeTarget:()=>pa,elements:()=>da,grid:()=>fa});const n=ReactDOM;var i=t.n(n);const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let o;const s=new Uint8Array(16);function a(){if(!o&&(o="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!o))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(s)}const l=[];for(let t=0;t<256;++t)l.push((t+256).toString(16).slice(1));function c(t,e=0){return(l[t[e+0]]+l[t[e+1]]+l[t[e+2]]+l[t[e+3]]+"-"+l[t[e+4]]+l[t[e+5]]+"-"+l[t[e+6]]+l[t[e+7]]+"-"+l[t[e+8]]+l[t[e+9]]+"-"+l[t[e+10]]+l[t[e+11]]+l[t[e+12]]+l[t[e+13]]+l[t[e+14]]+l[t[e+15]]).toLowerCase()}const u=function(t,e,n){if(r.randomUUID&&!e&&!t)return r.randomUUID();const i=(t=t||{}).random||(t.rng||a)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=i[t];return e}return c(i)},h={},p=[];function d(t,e){if(Array.isArray(t))for(const n of t)d(n,e);else if("object"!=typeof t)m(Object.getOwnPropertyNames(e)),h[t]=Object.assign(h[t]||{},e);else for(const e in t)d(e,t[e])}function f(t){return h[t]||{}}function m(t){p.push(...t)}function g(t,e){let n;const i=t.length,r=[];for(n=0;n=0;e--)X(t.children[e]);return t.id?(t.id=L(t.nodeName),t):t}function Y(t,e){let n,i;for(i=(t=Array.isArray(t)?t:[t]).length-1;i>=0;i--)for(n in e)t[i].prototype[n]=e[n]}function B(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}d("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=j(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=j(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=j(t)).before(this),this},insertAfter:function(t){return(t=j(t)).after(this),this}});const H=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,W=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,G=/rgb\((\d+),(\d+),(\d+)\)/,U=/(#[a-z_][a-z0-9\-_]*)/i,V=/\)\s*,?\s*/,$=/\s/g,K=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,Q=/^rgb\(/,Z=/^(\s+)?$/,J=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,tt=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,et=/[\s,]+/,nt=/[MLHVCSQTAZ]/i;function it(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function rt(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function ot(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}d("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(et)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),d("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=b(e);n[e]=this.node.style[t]}return n}if("string"==typeof t)return this.node.style[b(t)];if("object"==typeof t)for(const e in t)this.node.style[b(e)]=null==t[e]||Z.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[b(t)]=null==e||Z.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),d("Dom",{data:function(t,e,n){if(null==t)return this.data(g(y(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),d("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class st{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof st||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e,n){const{random:i,round:r,sin:o,PI:s}=Math;if("vibrant"===t){const t=24*i()+57,e=38*i()+45,n=360*i();return new st(t,e,n,"lch")}if("sine"===t){const t=r(80*o(2*s*(e=null==e?i():e)/.5+.01)+150),n=r(50*o(2*s*e/.5+4.6)+200),a=r(100*o(2*s*e/.5+2.3)+150);return new st(t,n,a)}if("pastel"===t){const t=8*i()+86,e=17*i()+9,n=360*i();return new st(t,e,n,"lch")}if("dark"===t){const t=10+10*i(),e=50*i()+86,n=360*i();return new st(t,e,n,"lch")}if("rgb"===t){const t=255*i(),e=255*i(),n=255*i();return new st(t,e,n)}if("lab"===t){const t=100*i(),e=256*i()-128,n=256*i()-128;return new st(t,e,n,"lab")}if("grey"===t){const t=255*i();return new st(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(K.test(t)||Q.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[i,r,o]=[t,e,n].map((t=>t/255)),s=Math.min(1-i,1-r,1-o);if(1===s)return new st(0,0,0,1,"cmyk");return new st((1-i-s)/(1-s),(1-r-s)/(1-s),(1-o-s)/(1-s),s,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[i,r,o]=[t,e,n].map((t=>t/255)),s=Math.max(i,r,o),a=Math.min(i,r,o),l=(s+a)/2,c=s===a,u=s-a;return new st(360*(c?0:s===i?((r-o)/u+(r.5?u/(2-s-a):u/(s+a)),100*l,"hsl")}init(t=0,e=0,n=0,i=0,r="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)r="string"==typeof i?i:r,i="string"==typeof i?0:i,Object.assign(this,{_a:t,_b:e,_c:n,_d:i,space:r});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=rt(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:rt(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:rt(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:rt(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:rt(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:rt(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(Q.test(t)){const e=t.replace($,""),[n,i,r]=G.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:i,_c:r,_d:0,space:"rgb"})}else{if(!K.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,i,r]=W.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:n,_b:i,_c:r,_d:0,space:"rgb"})}}const{_a:o,_b:s,_c:a,_d:l}=this,c="rgb"===this.space?{r:o,g:s,b:a}:"xyz"===this.space?{x:o,y:s,z:a}:"hsl"===this.space?{h:o,s,l:a}:"lab"===this.space?{l:o,a:s,b:a}:"lch"===this.space?{l:o,c:s,h:a}:"cmyk"===this.space?{c:o,m:s,y:a,k:l}:{};Object.assign(this,c)}lab(){const{x:t,y:e,z:n}=this.xyz();return new st(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),i=Math.sqrt(e**2+n**2);let r=180*Math.atan2(n,e)/Math.PI;r<0&&(r*=-1,r=360-r);return new st(t,i,r,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:i,a:r,b:o}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;r=t*Math.cos(n*e),o=t*Math.sin(n*e)}const s=(i+16)/116,a=r/500+s,l=s-o/200,c=16/116,u=.008856,h=7.787;t=.95047*(a**3>u?a**3:(a-c)/h),e=1*(s**3>u?s**3:(s-c)/h),n=1.08883*(l**3>u?l**3:(l-c)/h)}const i=3.2406*t+-1.5372*e+-.4986*n,r=-.9689*t+1.8758*e+.0415*n,o=.0557*t+-.204*e+1.057*n,s=Math.pow,a=.0031308,l=i>a?1.055*s(i,1/2.4)-.055:12.92*i,c=r>a?1.055*s(r,1/2.4)-.055:12.92*r,u=o>a?1.055*s(o,1/2.4)-.055:12.92*o;return new st(255*l,255*c,255*u)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e){n*=255;return new st(n,n,n)}const i=n<.5?n*(1+e):n+e-n*e,r=2*n-i,o=255*ot(r,i,t+1/3),s=255*ot(r,i,t),a=255*ot(r,i,t-1/3);return new st(o,s,a)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:i}=this,r=255*(1-Math.min(1,t*(1-i)+i)),o=255*(1-Math.min(1,e*(1-i)+i)),s=255*(1-Math.min(1,n*(1-i)+i));return new st(r,o,s)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:i,space:r}=this;return[t,e,n,i,r]}toHex(){const[t,e,n]=this._clamped().map(it);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[i,r,o]=[t,e,n].map((t=>t/255)),s=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,a=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,l=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,c=(.4124*s+.3576*a+.1805*l)/.95047,u=(.2126*s+.7152*a+.0722*l)/1,h=(.0193*s+.1192*a+.9505*l)/1.08883,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116,d=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116;return new st(p,d,f,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:i,min:r,round:o}=Math;return[t,e,n].map((t=>i(0,r(o(t),255))))}}class at{constructor(...t){this.init(...t)}clone(){return new at(this)}init(t,e){const n=0,i=0,r=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?n:r.x,this.y=null==r.y?i:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){ct.isMatrixLike(t)||(t=new ct(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function lt(t,e,n){return Math.abs(e-t)<(n||1e-6)}class ct{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,i=t.flip&&(e||"y"===t.flip)?-1:1,r=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,o=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,s=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,a=t.scale&&t.scale.length?t.scale[1]*i:isFinite(t.scale)?t.scale*i:isFinite(t.scaleY)?t.scaleY*i:i,l=t.shear||0,c=t.rotate||t.theta||0,u=new at(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),h=u.x,p=u.y,d=new at(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),f=d.x,m=d.y,g=new at(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,v=g.y,b=new at(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:s,scaleY:a,skewX:r,skewY:o,shear:l,theta:c,rx:b.x,ry:b.y,tx:y,ty:v,ox:h,oy:p,px:f,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const i=t.a*e.a+t.c*e.b,r=t.b*e.a+t.d*e.b,o=t.a*e.c+t.c*e.d,s=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,l=t.f+t.b*e.e+t.d*e.f;return n.a=i,n.b=r,n.c=o,n.d=s,n.e=a,n.f=l,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const i=t||0,r=e||0;return this.translateO(-i,-r).lmultiplyO(n).translateO(i,r)}clone(){return new ct(this)}decompose(t=0,e=0){const n=this.a,i=this.b,r=this.c,o=this.d,s=this.e,a=this.f,l=n*o-i*r,c=l>0?1:-1,u=c*Math.sqrt(n*n+i*i),h=Math.atan2(c*i,c*n),p=180/Math.PI*h,d=Math.cos(h),f=Math.sin(h),m=(n*r+i*o)/l,g=r*u/(m*n-i)||o*u/(m*i+n);return{scaleX:u,scaleY:g,shear:m,rotate:p,translateX:s-t+t*d*u+e*(m*d*u-f*g),translateY:a-e+t*f*u+e*(m*f*u+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new ct(t);return lt(this.a,e.a)&<(this.b,e.b)&<(this.c,e.c)&<(this.d,e.d)&<(this.e,e.e)&<(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=ct.fromArray([1,0,0,1,0,0]);return t=t instanceof Ct?t.matrixify():"string"==typeof t?ct.fromArray(t.split(et).map(parseFloat)):Array.isArray(t)?ct.fromArray(t):"object"==typeof t&&ct.isMatrixLike(t)?t:"object"==typeof t?(new ct).transform(t):6===arguments.length?ct.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,o=this.f,s=t*i-e*n;if(!s)throw new Error("Cannot invert "+this);const a=i/s,l=-e/s,c=-n/s,u=t/s,h=-(a*r+c*o),p=-(l*r+u*o);return this.a=a,this.b=l,this.c=c,this.d=u,this.e=h,this.f=p,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof ct?t:new ct(t);return ct.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof ct?t:new ct(t);return ct.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=v(t);const i=Math.cos(t),r=Math.sin(t),{a:o,b:s,c:a,d:l,e:c,f:u}=this;return this.a=o*i-s*r,this.b=s*i+o*r,this.c=a*i-l*r,this.d=l*i+a*r,this.e=c*i-u*r+n*r-e*i+e,this.f=u*i+c*r-e*r-n*i+n,this}scale(t,e,n,i){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,i=0){3===arguments.length&&(i=n,n=e,e=t);const{a:r,b:o,c:s,d:a,e:l,f:c}=this;return this.a=r*t,this.b=o*e,this.c=s*t,this.d=a*e,this.e=l*t-n*t+n,this.f=c*e-i*e+i,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:i,b:r,c:o,d:s,e:a,f:l}=this;return this.a=i+r*t,this.c=o+s*t,this.e=a+l*t-n*t,this}skew(t,e,n,i){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,i=0){3===arguments.length&&(i=n,n=e,e=t),t=v(t),e=v(e);const r=Math.tan(t),o=Math.tan(e),{a:s,b:a,c:l,d:c,e:u,f:h}=this;return this.a=s+a*r,this.b=a+s*o,this.c=l+c*r,this.d=c+l*o,this.e=u+h*r-i*r,this.f=h+u*o-n*o,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(ct.isMatrixLike(t)){return new ct(t).multiplyO(this)}const e=ct.formatTransforms(t),{x:n,y:i}=new at(e.ox,e.oy).transform(this),r=(new ct).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-i).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,i);if(isFinite(e.px)||isFinite(e.py)){const t=new at(n,i).transform(r),o=isFinite(e.px)?e.px-t.x:0,s=isFinite(e.py)?e.py-t.y:0;r.translateO(o,s)}return r.translateO(e.tx,e.ty),r}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function ut(){if(!ut.nodes){const t=j().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;ut.nodes={svg:t,path:e}}if(!ut.nodes.svg.node.parentNode){const t=A.document.body||A.document.documentElement;ut.nodes.svg.addTo(t)}return ut.nodes}function ht(t){return!(t.width||t.height||t.x||t.y)}z(ct,"Matrix");class pt{constructor(...t){this.init(...t)}addOffset(){return this.x+=A.window.pageXOffset,this.y+=A.window.pageYOffset,new pt(this)}init(t){return t="string"==typeof t?t.split(et).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return ht(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),i=Math.max(this.x+this.width,t.x+t.width)-e,r=Math.max(this.y+this.height,t.y+t.height)-n;return new pt(e,n,i,r)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof ct||(t=new ct(t));let e=1/0,n=-1/0,i=1/0,r=-1/0;return[new at(this.x,this.y),new at(this.x2,this.y),new at(this.x,this.y2),new at(this.x2,this.y2)].forEach((function(o){o=o.transform(t),e=Math.min(e,o.x),n=Math.max(n,o.x),i=Math.min(i,o.y),r=Math.max(r,o.y)})),new pt(e,i,n-e,r-i)}}function dt(t,e,n){let i;try{if(i=e(t.node),ht(i)&&((r=t.node)!==A.document&&!(A.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===A.document}).call(A.document.documentElement,r)))throw new Error("Element not in the dom")}catch(e){i=n(t)}var r;return i}d({viewbox:{viewbox(t,e,n,i){return null==t?new pt(this.attr("viewBox")):this.attr("viewBox",new pt(t,e,n,i))},zoom(t,e){let{width:n,height:i}=this.attr(["width","height"]);if((n||i)&&"string"!=typeof n&&"string"!=typeof i||(n=this.node.clientWidth,i=this.node.clientHeight),!n||!i)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const r=this.viewbox(),o=n/r.width,s=i/r.height,a=Math.min(o,s);if(null==t)return a;let l=a/t;l===1/0&&(l=Number.MAX_SAFE_INTEGER/100),e=e||new at(n/2/o+r.x,i/2/s+r.y);const c=new pt(r).transform(new ct({scale:l,origin:e}));return this.viewbox(c)}}}),z(pt,"Box");class ft extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}Y([ft],{each(t,...e){return"function"==typeof t?this.map(((e,n,i)=>t.call(e,e,n,i))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const mt=["toArray","constructor","each"];function gt(t,e){return new ft(g((e||A.document).querySelectorAll(t),(function(t){return R(t)})))}ft.extend=function(t){t=t.reduce(((t,e)=>(mt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),Y([ft],t)};let yt=0;const vt={};function bt(t){let e=t.getEventHolder();return e===A.window&&(e=vt),e.events||(e.events={}),e.events}function wt(t){return t.getEventTarget()}function xt(t,e,n,i,r){const o=n.bind(i||t),s=j(t),a=bt(s),l=wt(s);e=Array.isArray(e)?e:e.split(et),n._svgjsListenerId||(n._svgjsListenerId=++yt),e.forEach((function(t){const e=t.split(".")[0],i=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][i]=a[e][i]||{},a[e][i][n._svgjsListenerId]=o,l.addEventListener(e,o,r||!1)}))}function _t(t,e,n,i){const r=j(t),o=bt(r),s=wt(r);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(et)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let l,c;if(n)o[e]&&o[e][a||"*"]&&(s.removeEventListener(e,o[e][a||"*"][n],i||!1),delete o[e][a||"*"][n]);else if(e&&a){if(o[e]&&o[e][a]){for(c in o[e][a])_t(s,[e,a].join("."),c);delete o[e][a]}}else if(a)for(t in o)for(l in o[t])a===l&&_t(s,[t,a].join("."));else if(e){if(o[e]){for(l in o[e])_t(s,[e,l].join("."));delete o[e]}}else{for(t in o)_t(s,t);!function(t){let e=t.getEventHolder();e===A.window&&(e=vt),e.events&&(e.events={})}(r)}}))}class St extends P{addEventListener(){}dispatch(t,e,n){return function(t,e,n,i){const r=wt(t);return e instanceof A.window.Event||(e=new A.window.CustomEvent(e,{detail:n,cancelable:!0,...i})),r.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const e in n)for(const i in n[e])n[e][i](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return _t(this,t,e,n),this}on(t,e,n,i){return xt(this,t,e,n,i),this}removeEventListener(){}}function Et(){}z(St,"EventTarget");const Tt={duration:400,ease:">",delay:0},Ot={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class Mt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(et).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class Dt{constructor(...t){this.init(...t)}convert(t){return new Dt(this.value,t)}divide(t){return t=new Dt(t),new Dt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(H))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof Dt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new Dt(t),new Dt(this-t,this.unit||t.unit)}plus(t){return t=new Dt(t),new Dt(this+t,this.unit||t.unit)}times(t){return t=new Dt(t),new Dt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const At=[];class Pt extends St{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=j(t)).removeNamespace&&this.node instanceof A.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return j(t).put(this,e)}children(){return new ft(g(this.node.children,(function(t){return R(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0){return this.writeDataToDom(),new this.constructor(X(this.node.cloneNode(t)))}each(t,e){const n=this.children();let i,r;for(i=0,r=n.length;i=0}html(t,e){return this.xml(t,e,T)}id(t){return void 0!==t||this.node.id||(this.node.id=L(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return R(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=R(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=R(e.node.parentNode));return e}put(t,e){return t=j(t),this.add(t,e),t}putIn(t,e){return j(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=j(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,i=this.attr(e);for(const t in i)"number"==typeof i[t]&&(i[t]=Math.round(i[t]*n)/n);return this.attr(i),this}svg(t,e){return this.xml(t,e,E)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=R(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const i=k("wrapper",n),r=A.document.createDocumentFragment();i.innerHTML=t;for(let t=i.children.length;t--;)r.appendChild(i.firstElementChild);const o=this.parent();return e?this.replace(r)&&o:this.add(r)}}Y(Pt,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=J.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?Ot[t]:J.test(e)?parseFloat(e):e;"number"==typeof(e=At.reduce(((e,n)=>n(t,e,this)),e))?e=new Dt(e):st.isColor(e)?e=new st(e):e.constructor===Array&&(e=new Mt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return gt(t,this.node)},findOne:function(t){return R(this.node.querySelector(t))}}),z(Pt,"Dom");class Ct extends Pt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(JSON.parse(t.getAttribute("svgjs:data"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new Dt(t).plus(this.x()))}dy(t=0){return this.y(new Dt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=j(t));const n=new ft;let i=this;for(;(i=i.parent())&&i.node!==A.document&&"#document-fragment"!==i.nodeName&&(n.push(i),e||i.node!==t.node)&&(!e||!i.matches(t));)if(i.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(U);return e?j(e[1]):null}root(){const t=this.parent(C[I]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=_(this,t,e);return this.width(new Dt(n.width)).height(new Dt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}Y(Ct,{bbox:function(){const t=dt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(ut().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new pt(t)},rbox:function(t){const e=dt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new pt(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t=0;n--)null!=e[It[t][n]]&&this.attr(It.prefix(t,It[t][n]),e[It[t][n]]);return this},d(["Element","Runner"],e)})),d(["Element","Runner"],{matrix:function(t,e,n,i,r,o){return null==t?new ct(this):this.attr("transform",new ct(t,e,n,i,r,o))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,i){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:i},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,i){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:i},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),d("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new Dt(t)):this.rx(t).ry(e)}}),d("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new at(this.node.getPointAtLength(t))}}),d(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}});d("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),d("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){const t=(this.attr("transform")||"").split(V).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(et).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(ct.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new ct);return t},toParent:function(t,e){if(this===t)return this;const n=this.screenCTM(),i=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(i.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new ct(this).decompose();return null==t?e:e[t]}ct.isMatrixLike(t)||(t={...t,origin:S(t,this)});const n=new ct(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class kt extends Ct{flatten(t=this,e){return this.each((function(){if(this instanceof kt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,i){return i[i.length-n-1].toParent(t,e)})),this.remove()}}z(kt,"Container");class jt extends kt{constructor(t,e=t){super(N("defs",t),e)}flatten(){return this}ungroup(){return this}}z(jt,"Defs");class Nt extends Ct{}function Rt(t){return this.attr("rx",t)}function qt(t){return this.attr("ry",t)}function zt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Ft(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Lt(t){return this.attr("cx",t)}function Xt(t){return this.attr("cy",t)}function Yt(t){return null==t?2*this.rx():this.rx(new Dt(t).divide(2))}function Bt(t){return null==t?2*this.ry():this.ry(new Dt(t).divide(2))}z(Nt,"Shape");var Ht={__proto__:null,rx:Rt,ry:qt,x:zt,y:Ft,cx:Lt,cy:Xt,width:Yt,height:Bt};class Wt extends Nt{constructor(t,e=t){super(N("ellipse",t),e)}size(t,e){const n=_(this,t,e);return this.rx(new Dt(n.width).divide(2)).ry(new Dt(n.height).divide(2))}}Y(Wt,Ht),d("Container",{ellipse:B((function(t=0,e=t){return this.put(new Wt).size(t,e).move(0,0)}))}),z(Wt,"Ellipse");class Gt extends Pt{constructor(t=A.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new Pt(k("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function Ut(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new Dt(t),fy:new Dt(e)}):this.attr({x1:new Dt(t),y1:new Dt(e)})}function Vt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new Dt(t),cy:new Dt(e)}):this.attr({x2:new Dt(t),y2:new Dt(e)})}z(Gt,"Fragment");var $t,Kt={__proto__:null,from:Ut,to:Vt};class Qt extends kt{constructor(t,e){super(N(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new pt}targets(){return gt('svg [fill*="'+this.id()+'"]')}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return'url("#'+this.id()+'")'}}Y(Qt,Kt),d({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:B((function(t,e){return this.put(new Qt(t)).update(e)}))}}),z(Qt,"Gradient");class Zt extends kt{constructor(t,e=t){super(N("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new pt}targets(){return gt('svg [fill*="'+this.id()+'"]')}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return'url("#'+this.id()+'")'}}d({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:B((function(t,e,n){return this.put(new Zt).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),z(Zt,"Pattern");class Jt extends Nt{constructor(t,e=t){super(N("image",t),e)}load(t,e){if(!t)return this;const n=new A.window.Image;return xt(n,"load",(function(t){const i=this.parent(Zt);0===this.width()&&0===this.height()&&this.size(n.width,n.height),i instanceof Zt&&0===i.width()&&0===i.height()&&i.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),xt(n,"load error",(function(){_t(n)})),this.attr("href",n.src=t,M)}}$t=function(t,e,n){return"fill"!==t&&"stroke"!==t||tt.test(e)&&(e=n.root().defs().image(e)),e instanceof Jt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},At.push($t),d({Container:{image:B((function(t,e){return this.put(new Jt).size(0,0).load(t,e)}))}}),z(Jt,"Image");class te extends Mt{bbox(){let t=-1/0,e=-1/0,n=1/0,i=1/0;return this.forEach((function(r){t=Math.max(r[0],t),e=Math.max(r[1],e),n=Math.min(r[0],n),i=Math.min(r[1],i)})),new pt(n,i,t-n,e-i)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(et).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,i=t.length;n=0;n--)i.width&&(this[n][0]=(this[n][0]-i.x)*t/i.width+i.x),i.height&&(this[n][1]=(this[n][1]-i.y)*e/i.height+i.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,i){return function(r){return r<0?t>0?e/t*r:n>0?i/n*r:0:r>1?n<1?(1-i)/(1-n)*r+(i-n)/(1-n):t<1?(1-e)/(1-t)*r+(e-t)/(1-t):1:3*r*(1-r)**2*e+3*r**2*(1-r)*i+r**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(i,r=!1)=>{let o=Math.floor(i*t);const s=i*o%1==0;return"start"!==e&&"both"!==e||++o,r&&s&&--o,i>=0&&o<0&&(o=0),i<=1&&o>n&&(o=n),o/n}}};class se{done(){return!1}}class ae extends se{constructor(t=Tt.ease){super(),this.ease=oe[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class le extends se{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,i){return this.stepper(t,e,n,i)}}function ce(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,i=Math.log(e/100+1e-10),r=-i/Math.sqrt(n*n+i*i),o=3.9/(r*t);this.d=2*r*o,this.k=o*o}Y(class extends le{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,i){if("string"==typeof t)return t;if(i.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const r=i.velocity||0,o=-this.d*r-this.k*(t-e),s=t+r*n+o*n*n/2;return i.velocity=r+o*n,i.done=Math.abs(e-s)+Math.abs(r)<.002,i.done?e:s}},{duration:re("_duration",ce),overshoot:re("_overshoot",ce)});Y(class extends le{constructor(t=.1,e=.01,n=0,i=1e3){super(),this.p(t).i(e).d(n).windup(i)}step(t,e,n,i){if("string"==typeof t)return t;if(i.done=n===1/0,n===1/0)return e;if(0===n)return t;const r=e-t;let o=(i.integral||0)+r*n;const s=(r-(i.error||0))/n,a=this._windup;return!1!==a&&(o=Math.max(-a,Math.min(o,a))),i.error=r,i.integral=o,i.done=Math.abs(r)<.001,i.done?e:t+(this.P*r+this.I*o+this.D*s)}},{windup:re("_windup"),p:re("P"),i:re("I"),d:re("D")});const ue={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},he={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},pe="mlhvqtcsaz".split("");for(let t=0,e=pe.length;t=0;i--)n=this[i][0],"M"===n||"L"===n||"T"===n?(this[i][1]+=t,this[i][2]+=e):"H"===n?this[i][1]+=t:"V"===n?this[i][1]+=e:"C"===n||"S"===n||"Q"===n?(this[i][1]+=t,this[i][2]+=e,this[i][3]+=t,this[i][4]+=e,"C"===n&&(this[i][5]+=t,this[i][6]+=e)):"A"===n&&(this[i][6]+=t,this[i][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,i="";const r={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new at,p:new at};for(;r.lastToken=i,i=t.charAt(n++);)if(r.inSegment||!fe(r,i))if("."!==i)if(isNaN(parseInt(i)))if(" "!==i&&","!==i)if("-"!==i)if("E"!==i.toUpperCase()){if(nt.test(i)){if(r.inNumber)me(r,!1);else{if(!de(r))throw new Error("parser Error");ge(r)}--n}}else r.number+=i,r.hasExponent=!0;else{if(r.inNumber&&!ve(r)){me(r,!1),--n;continue}r.number+=i,r.inNumber=!0}else r.inNumber&&me(r,!1);else{if("0"===r.number||ye(r)){r.inNumber=!0,r.number=i,me(r,!0);continue}r.inNumber=!0,r.number+=i}else{if(r.pointSeen||r.hasExponent){me(r,!1),--n;continue}r.inNumber=!0,r.pointSeen=!0,r.number+=i}return r.inNumber&&me(r,!1),r.inSegment&&de(r)&&ge(r),r.segments}(t)}size(t,e){const n=this.bbox();let i,r;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]=(this[i][1]-n.x)*t/n.width+n.x,this[i][2]=(this[i][2]-n.y)*e/n.height+n.y):"H"===r?this[i][1]=(this[i][1]-n.x)*t/n.width+n.x:"V"===r?this[i][1]=(this[i][1]-n.y)*e/n.height+n.y:"C"===r||"S"===r||"Q"===r?(this[i][1]=(this[i][1]-n.x)*t/n.width+n.x,this[i][2]=(this[i][2]-n.y)*e/n.height+n.y,this[i][3]=(this[i][3]-n.x)*t/n.width+n.x,this[i][4]=(this[i][4]-n.y)*e/n.height+n.y,"C"===r&&(this[i][5]=(this[i][5]-n.x)*t/n.width+n.x,this[i][6]=(this[i][6]-n.y)*e/n.height+n.y)):"A"===r&&(this[i][1]=this[i][1]*t/n.width,this[i][2]=this[i][2]*e/n.height,this[i][6]=(this[i][6]-n.x)*t/n.width+n.x,this[i][7]=(this[i][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,i=t.length;n{const e=typeof t;return"number"===e?Dt:"string"===e?st.isColor(t)?st:et.test(t)?nt.test(t)?be:Mt:H.test(t)?Dt:_e:Oe.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Mt:"object"===e?Te:_e};class xe{constructor(t){this._stepper=t||new ae("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(we(t));let e=new this._type(t);return this._type===st&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Te&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class _e{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Se{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Se.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Se.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Ee=(t,e)=>t[0]e[0]?1:0;class Te{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,i=e.length;nt.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),i=e.shift(),r=e.shift(),o=e.splice(0,r);t[n]=new i(o)}return t}}const Oe=[_e,Se,Te];class Me extends Nt{constructor(t,e=t){super(N("path",t),e)}array(){return this._array||(this._array=new be(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new be(t))}size(t,e){const n=_(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}Me.prototype.MorphArray=be,d({Container:{path:B((function(t){return this.put(new Me).plot(t||new be)}))}}),z(Me,"Path");var De={__proto__:null,array:function(){return this._array||(this._array=new te(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new te(t))},size:function(t,e){const n=_(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}};class Ae extends Nt{constructor(t,e=t){super(N("polygon",t),e)}}d({Container:{polygon:B((function(t){return this.put(new Ae).plot(t||new te)}))}}),Y(Ae,ee),Y(Ae,De),z(Ae,"Polygon");class Pe extends Nt{constructor(t,e=t){super(N("polyline",t),e)}}d({Container:{polyline:B((function(t){return this.put(new Pe).plot(t||new te)}))}}),Y(Pe,ee),Y(Pe,De),z(Pe,"Polyline");class Ce extends Nt{constructor(t,e=t){super(N("rect",t),e)}}Y(Ce,{rx:Rt,ry:qt}),d({Container:{rect:B((function(t,e){return this.put(new Ce).size(t,e)}))}}),z(Ce,"Rect");class Ie{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const ke={nextDraw:null,frames:new Ie,timeouts:new Ie,immediates:new Ie,timer:()=>A.window.performance||A.window.Date,transforms:[],frame(t){const e=ke.frames.push({run:t});return null===ke.nextDraw&&(ke.nextDraw=A.window.requestAnimationFrame(ke._draw)),e},timeout(t,e){e=e||0;const n=ke.timer().now()+e,i=ke.timeouts.push({run:t,time:n});return null===ke.nextDraw&&(ke.nextDraw=A.window.requestAnimationFrame(ke._draw)),i},immediate(t){const e=ke.immediates.push(t);return null===ke.nextDraw&&(ke.nextDraw=A.window.requestAnimationFrame(ke._draw)),e},cancelFrame(t){null!=t&&ke.frames.remove(t)},clearTimeout(t){null!=t&&ke.timeouts.remove(t)},cancelImmediate(t){null!=t&&ke.immediates.remove(t)},_draw(t){let e=null;const n=ke.timeouts.last();for(;(e=ke.timeouts.shift())&&(t>=e.time?e.run():ke.timeouts.push(e),e!==n););let i=null;const r=ke.frames.last();for(;i!==r&&(i=ke.frames.shift());)i.run(t);let o=null;for(;o=ke.immediates.shift();)o();ke.nextDraw=ke.timeouts.first()||ke.frames.first()?A.window.requestAnimationFrame(ke._draw):null}},je=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},Ne=function(){const t=A.window;return(t.performance||t.Date).now()};class Re extends St{constructor(t=Ne){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(je);let i=0;const r=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)i=r;else if("absolute"===n||"start"===n)i=e,e=0;else if("now"===n)i=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(i=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();i=t?t.start:this._time}}t.unschedule(),t.timeline(this);const o=t.persist(),s={persist:null===o?this._persist:o,start:i+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(s),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return ke.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=ke.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const i=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=i,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],n=e.runner;this._time-e.start<=0&&n.reset()}let r=!1;for(let t=0,e=this._runners.length;t0?this._continue():(this.pause(),this.fire("finished")),this}}d({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Re,this._timeline):(this._timeline=t,this)}}});class qe extends St{constructor(t){super(),this.id=qe.id++,t="function"==typeof(t=null==t?Tt.duration:t)?new le(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof le,this._stepper=this._isDeclarative?t:new ae,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new ct,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let i=1,r=!1,o=0;return e=e||Tt.delay,n=n||"last","object"!=typeof(t=t||Tt.duration)||t instanceof se||(e=t.delay||e,n=t.when||n,r=t.swing||r,i=t.times||i,o=t.wait||o,t=t.duration||Tt.duration),{duration:t,delay:e,swing:r,times:i,wait:o,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const i=qe.sanitise(t,e,n),r=new qe(i.duration);return this._timeline&&r.timeline(this._timeline),this._element&&r.element(this._element),r.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new ct,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new ae(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,i=e*Math.floor(t)+this._duration*n;return this.time(i)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,i=this._wait,r=this._times,o=this._swing,s=this._reverse;let a;if(null==t){const t=function(t){const e=o*Math.floor(t%(2*(i+n))/(i+n)),r=e&&!s||!e&&s,a=Math.pow(-1,r)*(t%(i+n))/n+r;return Math.max(Math.min(a,1),0)},l=r*(i+n)-i;return a=e<=0?Math.round(t(1e-5)):e=0;this._lastPosition=e;const i=this.duration(),r=this._lastTime<=0&&this._time>0,o=this._lastTime=i;this._lastTime=this._time,r&&this.fire("start",this);const s=this._isDeclarative;this.done=!s&&!o&&this._time>=i,this._reseted=!1;let a=!1;return(n||s)&&(this._initialise(n),this.transforms=new ct,a=this._run(s?t:e),this.fire("step",this)),this.done=this.done||a&&s,o&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;et.lmultiplyO(e),Le=t=>t.transforms;function Xe(){const t=this._transformationRunners.runners.map(Le).reduce(Fe,new ct);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ye{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new ze).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;ee.id<=t.id)).map(Le).reduce(Fe,new ct)},_addRunner(t){this._transformationRunners.add(t),ke.cancelImmediate(this._frameId),this._frameId=ke.immediate(Xe.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ye).add(new ze(new ct(this))))}}});Y(qe,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let i=e;if(this._tryRetarget(t,i))return this;let r=new xe(this._stepper).to(i),o=Object.keys(i);return this.queue((function(){r=r.from(this.element()[t](o))}),(function(e){return this.element()[t](r.at(e).valueOf()),r.done()}),(function(e){const n=Object.keys(e),s=(a=o,n.filter((t=>!a.includes(t))));var a;if(s.length){const e=this.element()[t](s),n=new Te(r.from()).valueOf();Object.assign(n,e),r.from(n)}const l=new Te(r.to()).valueOf();Object.assign(l,e),r.to(l),o=n,i=e})),this._rememberMorpher(t,r),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new xe(this._stepper).to(new Dt(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,i){e=i,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const i=ct.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!i;const r=new xe(this._stepper).type(n?Se:ct);let o,s,a,l,c;return this.queue((function(){s=s||this.element(),o=o||S(t,s),c=new ct(e?void 0:s),s._addRunner(this),e||s._clearTransformRunnersBefore(this)}),(function(u){e||this.clearTransform();const{x:h,y:p}=new at(o).transform(s._currentTransform(this));let d=new ct({...t,origin:[h,p]}),f=this._isDeclarative&&a?a:c;if(n){d=d.decompose(h,p),f=f.decompose(h,p);const t=d.rotate,e=f.rotate,n=[t-360,t,t+360],i=n.map((t=>Math.abs(t-e))),r=Math.min(...i),o=i.indexOf(r);d.rotate=n[o]}e&&(i||(d.rotate=t.rotate||0),this._isDeclarative&&l&&(f.rotate=l)),r.from(f),r.to(d);const m=r.at(u);return l=m.rotate,a=new ct(m),this.addTransform(a),s._addRunner(this),r.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(o=S(e,s)),t={...e,origin:o}}),!0),this._isDeclarative&&this._rememberMorpher("transform",r),this},x(t,e){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new Dt(e),this._tryRetarget(t,e))return this;const n=new xe(this._stepper).to(e);let i=null;return this.queue((function(){i=this.element()[t](),n.from(i),n.to(i+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(i+new Dt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new xe(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new Dt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,i){if(4===arguments.length)return this.plot([t,e,n,i]);if(this._tryRetarget("plot",t))return this;const r=new xe(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){r.from(this._element.array())}),(function(t){return this._element.plot(r.at(t)),r.done()})),this._rememberMorpher("plot",r),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,i){return this._queueObject("viewbox",new pt(t,e,n,i))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),Y(qe,{rx:Rt,ry:qt,from:Ut,to:Vt}),z(qe,"Runner");class Be extends kt{constructor(t,e=t){super(N("svg",t),e),this.namespace()}defs(){return this.isRoot()?R(this.node.querySelector("defs"))||this.put(new jt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof A.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:E,version:"1.1"}).attr("xmlns:xlink",M,O).attr("xmlns:svgjs",D,O):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,O).attr("xmlns:svgjs",null,O)}root(){return this.isRoot()?this:super.root()}}d({Container:{nested:B((function(){return this.put(new Be)}))}}),z(Be,"Svg",!0);class He extends kt{constructor(t,e=t){super(N("symbol",t),e)}}d({Container:{symbol:B((function(){return this.put(new He)}))}}),z(He,"Symbol");var We={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(A.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class Ge extends Nt{constructor(t,e=t){super(N("text",t),e),this.dom.leading=new Dt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new Dt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(i){const r=A.window.getComputedStyle(this.node).getPropertyValue("font-size"),o=n*new Dt(r);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=o:(this.attr("dy",i?o+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new Dt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let i=0,r=e.length;i{let r;try{r=n.bbox()}catch(t){return}const o=new ct(n),s=o.translate(t,e).transform(o.inverse()),a=new at(r.x,r.y).transform(s);n.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const i=t-n.x,r=e-n.y;return this.dmove(i,r)},size:function(t,e,n=this.bbox()){const i=_(this,t,e,n),r=i.width/n.width,o=i.height/n.height;return this.children().forEach(((t,e)=>{const i=new at(n).transform(new ct(t).inverse());t.scale(r,o,i.x,i.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class Ze extends kt{constructor(t,e=t){super(N("g",t),e)}}Y(Ze,Qe),d({Container:{group:B((function(){return this.put(new Ze)}))}}),z(Ze,"G");class Je extends kt{constructor(t,e=t){super(N("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,M)}}Y(Je,Qe),d({Container:{link:B((function(t){return this.put(new Je).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Je,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),z(Je,"A");class tn extends kt{constructor(t,e=t){super(N("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return gt('svg [mask*="'+this.id()+'"]')}}d({Container:{mask:B((function(){return this.defs().put(new tn)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof tn?t:this.parent().mask().add(t);return this.attr("mask",'url("#'+e.id()+'")')},unmask(){return this.attr("mask",null)}}}),z(tn,"Mask");class en extends Ct{constructor(t,e=t){super(N("stop",t),e)}update(t){return("number"==typeof t||t instanceof Dt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new Dt(t.offset)),this}}d({Gradient:{stop:function(t,e,n){return this.put(new en).update(t,e,n)}}}),z(en,"Stop");class nn extends Ct{constructor(t,e=t){super(N("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const t in e)n+=w(t)+":"+e[t]+";";return n+="}",n}(t,e))}}d("Dom",{style(t,e){return this.put(new nn).rule(t,e)},fontface(t,e,n){return this.put(new nn).font(t,e,n)}}),z(nn,"Style");class rn extends Ge{constructor(t,e=t){super(N("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}d({Container:{textPath:B((function(t,e){return t instanceof Ge||(t=this.text(t)),t.path(e)}))},Text:{path:B((function(t,e=!0){const n=new rn;let i;if(t instanceof Me||(t=this.defs().path(t)),n.attr("href","#"+t,M),e)for(;i=this.node.firstChild;)n.node.appendChild(i);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:B((function(t){return t instanceof Ge||(t=(new Ge).addTo(this.parent()).text(t)),t.path(this)})),targets(){return gt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),rn.prototype.MorphArray=be,z(rn,"TextPath");class on extends Nt{constructor(t,e=t){super(N("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,M)}}d({Container:{use:B((function(t,e){return this.put(new on).use(t,e)}))}}),z(on,"Use");const sn=j;function an(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function ln(t){for(var e=1;e=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}Y([Be,He,Jt,Zt,ie],f("viewbox")),Y([ne,Pe,Ae,Me],f("marker")),Y(Ge,f("Text")),Y(Me,f("Path")),Y(jt,f("Defs")),Y([Ge,Ue],f("Tspan")),Y([Ce,Wt,Qt,qe],f("radius")),Y(St,f("EventTarget")),Y(Pt,f("Dom")),Y(Ct,f("Element")),Y(Nt,f("Shape")),Y([kt,Gt],f("Container")),Y(Qt,f("Gradient")),Y(qe,f("Runner")),ft.extend([...new Set(p)]),function(t=[]){Oe.push(...[].concat(t))}([Dt,st,pt,ct,Mt,te,be,at]),Y(Oe,{to(t){return(new xe).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,i,r){return this.fromArray(t.map((function(t,o){return i.step(t,e[o],n,r[o],r)})))}});function dn(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var fn=dn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),mn=dn(/Edge/i),gn=dn(/firefox/i),yn=dn(/safari/i)&&!dn(/chrome/i)&&!dn(/android/i),vn=dn(/iP(ad|od|hone)/i),bn=dn(/chrome/i)&&dn(/android/i),wn={capture:!1,passive:!1};function xn(t,e,n){t.addEventListener(e,n,!fn&&wn)}function _n(t,e,n){t.removeEventListener(e,n,!fn&&wn)}function Sn(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(t){return!1}return!1}}function En(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Tn(t,e,n,i){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&Sn(t,e):Sn(t,e))||i&&t===n)return t;if(t===n)break}while(t=En(t))}return null}var On,Mn=/\s+/g;function Dn(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(Mn," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(Mn," ")}}function An(t,e,n){var i=t&&t.style;if(i){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 i||-1!==e.indexOf("webkit")||(e="-webkit-"+e),i[e]=n+("string"==typeof n?"":"px")}}function Pn(t,e){var n="";if("string"==typeof t)n=t;else do{var i=An(t,"transform");i&&"none"!==i&&(n=i+" "+n)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function Cn(t,e,n){if(t){var i=t.getElementsByTagName(e),r=0,o=i.length;if(n)for(;r=o:r<=o))return i;if(i===In())break;i=Fn(i,!1)}return!1}function Nn(t,e,n,i){for(var r=0,o=0,s=t.children;o2&&void 0!==arguments[2]?arguments[2]:{},i=n.evt,r=pn(n,Kn);Vn.pluginEvent.bind(Bi)(t,e,ln({dragEl:Jn,parentEl:ti,ghostEl:ei,rootEl:ni,nextEl:ii,lastDownEl:ri,cloneEl:oi,cloneHidden:si,dragStarted:bi,putSortable:pi,activeSortable:Bi.active,originalEvent:i,oldIndex:ai,oldDraggableIndex:ci,newIndex:li,newDraggableIndex:ui,hideGhostForTarget:Fi,unhideGhostForTarget:Li,cloneNowHidden:function(){si=!0},cloneNowShown:function(){si=!1},dispatchSortableEvent:function(t){Zn({sortable:e,name:t,originalEvent:i})}},r))};function Zn(t){$n(ln({putSortable:pi,cloneEl:oi,targetEl:Jn,rootEl:ni,oldIndex:ai,oldDraggableIndex:ci,newIndex:li,newDraggableIndex:ui},t))}var Jn,ti,ei,ni,ii,ri,oi,si,ai,li,ci,ui,hi,pi,di,fi,mi,gi,yi,vi,bi,wi,xi,_i,Si,Ei=!1,Ti=!1,Oi=[],Mi=!1,Di=!1,Ai=[],Pi=!1,Ci=[],Ii="undefined"!=typeof document,ki=vn,ji=mn||fn?"cssFloat":"float",Ni=Ii&&!bn&&!vn&&"draggable"in document.createElement("div"),Ri=function(){if(Ii){if(fn)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),qi=function(t,e){var n=An(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),r=Nn(t,0,e),o=Nn(t,1,e),s=r&&An(r),a=o&&An(o),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+kn(r).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+kn(o).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(r&&s.float&&"none"!==s.float){var u="left"===s.float?"left":"right";return!o||"both"!==a.clear&&a.clear!==u?"horizontal":"vertical"}return r&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||l>=i&&"none"===n[ji]||o&&"none"===n[ji]&&l+c>i)?"vertical":"horizontal"},zi=function(t){function e(t,n){return function(i,r,o,s){var a=i.options.group.name&&r.options.group.name&&i.options.group.name===r.options.group.name;if(null==t&&(n||a))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(i,r,o,s),n)(i,r,o,s);var l=(n?i:r).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},i=t.group;i&&"object"==cn(i)||(i={name:i}),n.name=i.name,n.checkPull=e(i.pull,!0),n.checkPut=e(i.put),n.revertClone=i.revertClone,t.group=n},Fi=function(){!Ri&&ei&&An(ei,"display","none")},Li=function(){!Ri&&ei&&An(ei,"display","")};Ii&&!bn&&document.addEventListener("click",(function(t){if(Ti)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Ti=!1,!1}),!0);var Xi=function(t){if(Jn){var e=function(t,e){var n;return Oi.some((function(i){var r=i[Hn].options.emptyInsertThreshold;if(r&&!Rn(i)){var o=kn(i),s=t>=o.left-r&&t<=o.right+r,a=e>=o.top-r&&e<=o.bottom+r;return s&&a?n=i:void 0}})),n}((t=t.touches?t.touches[0]:t).clientX,t.clientY);if(e){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[Hn]._onDragOver(n)}}},Yi=function(t){Jn&&Jn.parentNode[Hn]._isOutsideThisEl(t.target)};function Bi(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=hn({},e),t[Hn]=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 qi(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!==Bi.supportPointer&&"PointerEvent"in window&&!yn,emptyInsertThreshold:5};for(var i in Vn.initializePlugins(this,t,n),n)!(i in e)&&(e[i]=n[i]);for(var r in zi(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Ni,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?xn(t,"pointerdown",this._onTapStart):(xn(t,"mousedown",this._onTapStart),xn(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(xn(t,"dragover",this),xn(t,"dragenter",this)),Oi.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),hn(this,Wn())}function Hi(t,e,n,i,r,o,s,a){var l,c,u=t[Hn],h=u.options.onMove;return!window.CustomEvent||fn||mn?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=i,l.related=r||e,l.relatedRect=o||kn(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),h&&(c=h.call(u,l,s)),c}function Wi(t){t.draggable=!1}function Gi(){Pi=!1}function Ui(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,i=0;n--;)i+=e.charCodeAt(n);return i.toString(36)}function Vi(t){return setTimeout(t,0)}function $i(t){return clearTimeout(t)}Bi.prototype={constructor:Bi,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(wi=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Jn):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,i=this.options,r=i.preventOnFilter,o=t.type,s=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(s||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=i.filter;if(function(t){Ci.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var i=e[n];i.checked&&Ci.push(i)}}(n),!Jn&&!(/mousedown|pointerdown/.test(o)&&0!==t.button||i.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!yn||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=Tn(a,i.draggable,n,!1))&&a.animated||ri===a)){if(ai=qn(a),ci=qn(a,i.draggable),"function"==typeof c){if(c.call(this,t,a,this))return Zn({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),Qn("filter",e,{evt:t}),void(r&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(i){if(i=Tn(l,i.trim(),n,!1))return Zn({sortable:e,rootEl:i,name:"filter",targetEl:a,fromEl:n,toEl:n}),Qn("filter",e,{evt:t}),!0}))))return void(r&&t.cancelable&&t.preventDefault());i.handle&&!Tn(l,i.handle,n,!1)||this._prepareDragStart(t,s,a)}}},_prepareDragStart:function(t,e,n){var i,r=this,o=r.el,s=r.options,a=o.ownerDocument;if(n&&!Jn&&n.parentNode===o){var l=kn(n);if(ni=o,ti=(Jn=n).parentNode,ii=Jn.nextSibling,ri=n,hi=s.group,Bi.dragged=Jn,di={target:Jn,clientX:(e||t).clientX,clientY:(e||t).clientY},yi=di.clientX-l.left,vi=di.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Jn.style["will-change"]="all",i=function(){Qn("delayEnded",r,{evt:t}),Bi.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!gn&&r.nativeDraggable&&(Jn.draggable=!0),r._triggerDragStart(t,e),Zn({sortable:r,name:"choose",originalEvent:t}),Dn(Jn,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){Cn(Jn,t.trim(),Wi)})),xn(a,"dragover",Xi),xn(a,"mousemove",Xi),xn(a,"touchmove",Xi),xn(a,"mouseup",r._onDrop),xn(a,"touchend",r._onDrop),xn(a,"touchcancel",r._onDrop),gn&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Jn.draggable=!0),Qn("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(mn||fn))i();else{if(Bi.eventCanceled)return void this._onDrop();xn(a,"mouseup",r._disableDelayedDrag),xn(a,"touchend",r._disableDelayedDrag),xn(a,"touchcancel",r._disableDelayedDrag),xn(a,"mousemove",r._delayedDragTouchMoveHandler),xn(a,"touchmove",r._delayedDragTouchMoveHandler),s.supportPointer&&xn(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(i,s.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(){Jn&&Wi(Jn),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;_n(t,"mouseup",this._disableDelayedDrag),_n(t,"touchend",this._disableDelayedDrag),_n(t,"touchcancel",this._disableDelayedDrag),_n(t,"mousemove",this._delayedDragTouchMoveHandler),_n(t,"touchmove",this._delayedDragTouchMoveHandler),_n(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?xn(document,"pointermove",this._onTouchMove):xn(document,e?"touchmove":"mousemove",this._onTouchMove):(xn(Jn,"dragend",this),xn(ni,"dragstart",this._onDragStart));try{document.selection?Vi((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(Ei=!1,ni&&Jn){Qn("dragStarted",this,{evt:e}),this.nativeDraggable&&xn(document,"dragover",Yi);var n=this.options;!t&&Dn(Jn,n.dragClass,!1),Dn(Jn,n.ghostClass,!0),Bi.active=this,t&&this._appendGhost(),Zn({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(fi){this._lastX=fi.clientX,this._lastY=fi.clientY,Fi();for(var t=document.elementFromPoint(fi.clientX,fi.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(fi.clientX,fi.clientY))!==e;)e=t;if(Jn.parentNode[Hn]._isOutsideThisEl(t),e)do{if(e[Hn]){if(e[Hn]._onDragOver({clientX:fi.clientX,clientY:fi.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Li()}},_onTouchMove:function(t){if(di){var e=this.options,n=e.fallbackTolerance,i=e.fallbackOffset,r=t.touches?t.touches[0]:t,o=ei&&Pn(ei,!0),s=ei&&o&&o.a,a=ei&&o&&o.d,l=ki&&Si&&zn(Si),c=(r.clientX-di.clientX+i.x)/(s||1)+(l?l[0]-Ai[0]:0)/(s||1),u=(r.clientY-di.clientY+i.y)/(a||1)+(l?l[1]-Ai[1]:0)/(a||1);if(!Bi.active&&!Ei){if(n&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))i.right+r||t.clientX<=i.right&&t.clientY>i.bottom&&t.clientX>=i.left:t.clientX>i.right&&t.clientY>i.top||t.clientX<=i.right&&t.clientY>i.bottom+r}(t,r,this)&&!m.animated){if(m===Jn)return C(!1);if(m&&o===t.target&&(s=m),s&&(n=kn(s)),!1!==Hi(ni,o,Jn,e,s,n,t,!!s))return P(),m&&m.nextSibling?o.insertBefore(Jn,m.nextSibling):o.appendChild(Jn),ti=o,I(),C(!0)}else if(m&&function(t,e,n){var i=kn(Nn(n.el,0,n.options,!0)),r=10;return e?t.clientXu+c*o/2:lh-_i)return-xi}else if(l>u+c*(1-r)/2&&lh-c*o/2))return l>u+c/2?1:-1;return 0}(t,s,n,r,x?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Di,wi===s),0!==y){var T=qn(Jn);do{T-=y,b=ti.children[T]}while(b&&("none"===An(b,"display")||b===ei))}if(0===y||b===s)return C(!1);wi=s,xi=y;var O=s.nextElementSibling,M=!1,D=Hi(ni,o,Jn,e,s,n,t,M=1===y);if(!1!==D)return 1!==D&&-1!==D||(M=1===D),Pi=!0,setTimeout(Gi,30),P(),M&&!O?o.appendChild(Jn):s.parentNode.insertBefore(Jn,M?O:s),S&&Yn(S,0,E-S.scrollTop),ti=Jn.parentNode,void 0===v||Di||(_i=Math.abs(v-kn(s)[_])),I(),C(!0)}if(o.contains(Jn))return C(!1)}return!1}function A(a,l){Qn(a,d,ln({evt:t,isOwner:u,axis:r?"vertical":"horizontal",revert:i,dragRect:e,targetRect:n,canSort:h,fromSortable:p,target:s,completed:C,onMove:function(n,i){return Hi(ni,o,Jn,e,n,kn(n),t,i)},changed:I},l))}function P(){A("dragOverAnimationCapture"),d.captureAnimationState(),d!==p&&p.captureAnimationState()}function C(e){return A("dragOverCompleted",{insertion:e}),e&&(u?c._hideClone():c._showClone(d),d!==p&&(Dn(Jn,pi?pi.options.ghostClass:c.options.ghostClass,!1),Dn(Jn,a.ghostClass,!0)),pi!==d&&d!==Bi.active?pi=d:d===Bi.active&&pi&&(pi=null),p===d&&(d._ignoreWhileAnimating=s),d.animateAll((function(){A("dragOverAnimationComplete"),d._ignoreWhileAnimating=null})),d!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(s===Jn&&!Jn.animated||s===o&&!s.animated)&&(wi=null),a.dragoverBubble||t.rootEl||s===document||(Jn.parentNode[Hn]._isOutsideThisEl(t.target),!e&&Xi(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function I(){li=qn(Jn),ui=qn(Jn,a.draggable),Zn({sortable:d,name:"change",toEl:o,newIndex:li,newDraggableIndex:ui,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){_n(document,"mousemove",this._onTouchMove),_n(document,"touchmove",this._onTouchMove),_n(document,"pointermove",this._onTouchMove),_n(document,"dragover",Xi),_n(document,"mousemove",Xi),_n(document,"touchmove",Xi)},_offUpEvents:function(){var t=this.el.ownerDocument;_n(t,"mouseup",this._onDrop),_n(t,"touchend",this._onDrop),_n(t,"pointerup",this._onDrop),_n(t,"touchcancel",this._onDrop),_n(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;li=qn(Jn),ui=qn(Jn,n.draggable),Qn("drop",this,{evt:t}),ti=Jn&&Jn.parentNode,li=qn(Jn),ui=qn(Jn,n.draggable),Bi.eventCanceled||(Ei=!1,Di=!1,Mi=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),$i(this.cloneId),$i(this._dragStartId),this.nativeDraggable&&(_n(document,"drop",this),_n(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),yn&&An(document.body,"user-select",""),An(Jn,"transform",""),t&&(bi&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),ei&&ei.parentNode&&ei.parentNode.removeChild(ei),(ni===ti||pi&&"clone"!==pi.lastPutMode)&&oi&&oi.parentNode&&oi.parentNode.removeChild(oi),Jn&&(this.nativeDraggable&&_n(Jn,"dragend",this),Wi(Jn),Jn.style["will-change"]="",bi&&!Ei&&Dn(Jn,pi?pi.options.ghostClass:this.options.ghostClass,!1),Dn(Jn,this.options.chosenClass,!1),Zn({sortable:this,name:"unchoose",toEl:ti,newIndex:null,newDraggableIndex:null,originalEvent:t}),ni!==ti?(li>=0&&(Zn({rootEl:ti,name:"add",toEl:ti,fromEl:ni,originalEvent:t}),Zn({sortable:this,name:"remove",toEl:ti,originalEvent:t}),Zn({rootEl:ti,name:"sort",toEl:ti,fromEl:ni,originalEvent:t}),Zn({sortable:this,name:"sort",toEl:ti,originalEvent:t})),pi&&pi.save()):li!==ai&&li>=0&&(Zn({sortable:this,name:"update",toEl:ti,originalEvent:t}),Zn({sortable:this,name:"sort",toEl:ti,originalEvent:t})),Bi.active&&(null!=li&&-1!==li||(li=ai,ui=ci),Zn({sortable:this,name:"end",toEl:ti,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Qn("nulling",this),ni=Jn=ti=ei=ii=oi=ri=si=di=fi=bi=li=ui=ai=ci=wi=xi=pi=hi=Bi.dragged=Bi.ghost=Bi.clone=Bi.active=null,Ci.forEach((function(t){t.checked=!0})),Ci.length=mi=gi=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Jn&&(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,i=0,r=n.length,o=this.options;i0&&yr(i.width)/t.offsetWidth||1,o=t.offsetHeight>0&&yr(i.height)/t.offsetHeight||1);var s=(pr(t)?hr(t):window).visualViewport,a=!br()&&n,l=(i.left+(a&&s?s.offsetLeft:0))/r,c=(i.top+(a&&s?s.offsetTop:0))/o,u=i.width/r,h=i.height/o;return{width:u,height:h,top:c,right:l+u,bottom:c+h,left:l,x:l,y:c}}function xr(t){var e=hr(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function _r(t){return t?(t.nodeName||"").toLowerCase():null}function Sr(t){return((pr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Er(t){return wr(Sr(t)).left+xr(t).scrollLeft}function Tr(t){return hr(t).getComputedStyle(t)}function Or(t){var e=Tr(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function Mr(t,e,n){void 0===n&&(n=!1);var i,r,o=dr(e),s=dr(e)&&function(t){var e=t.getBoundingClientRect(),n=yr(e.width)/t.offsetWidth||1,i=yr(e.height)/t.offsetHeight||1;return 1!==n||1!==i}(e),a=Sr(e),l=wr(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==_r(e)||Or(a))&&(c=(i=e)!==hr(i)&&dr(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:xr(i)),dr(e)?((u=wr(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):a&&(u.x=Er(a))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function Dr(t){var e=wr(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function Ar(t){return"html"===_r(t)?t:t.assignedSlot||t.parentNode||(fr(t)?t.host:null)||Sr(t)}function Pr(t){return["html","body","#document"].indexOf(_r(t))>=0?t.ownerDocument.body:dr(t)&&Or(t)?t:Pr(Ar(t))}function Cr(t,e){var n;void 0===e&&(e=[]);var i=Pr(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),o=hr(i),s=r?[o].concat(o.visualViewport||[],Or(i)?i:[]):i,a=e.concat(s);return r?a:a.concat(Cr(Ar(s)))}function Ir(t){return["table","td","th"].indexOf(_r(t))>=0}function kr(t){return dr(t)&&"fixed"!==Tr(t).position?t.offsetParent:null}function jr(t){for(var e=hr(t),n=kr(t);n&&Ir(n)&&"static"===Tr(n).position;)n=kr(n);return n&&("html"===_r(n)||"body"===_r(n)&&"static"===Tr(n).position)?e:n||function(t){var e=/firefox/i.test(vr());if(/Trident/i.test(vr())&&dr(t)&&"fixed"===Tr(t).position)return null;var n=Ar(t);for(fr(n)&&(n=n.host);dr(n)&&["html","body"].indexOf(_r(n))<0;){var i=Tr(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(t)||e}var Nr="top",Rr="bottom",qr="right",zr="left",Fr="auto",Lr=[Nr,Rr,qr,zr],Xr="start",Yr="end",Br="viewport",Hr="popper",Wr=Lr.reduce((function(t,e){return t.concat([e+"-"+Xr,e+"-"+Yr])}),[]),Gr=[].concat(Lr,[Fr]).reduce((function(t,e){return t.concat([e,e+"-"+Xr,e+"-"+Yr])}),[]),Ur=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Vr(t){var e=new Map,n=new Set,i=[];function r(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var i=e.get(t);i&&r(i)}})),i.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||r(t)})),i}function $r(t){var e;return function(){return e||(e=new Promise((function(n){Promise.resolve().then((function(){e=void 0,n(t())}))}))),e}}var Kr={placement:"bottom",modifiers:[],strategy:"absolute"};function Qr(){for(var t=arguments.length,e=new Array(t),n=0;n=0?"x":"y"}function ro(t){var e,n=t.reference,i=t.element,r=t.placement,o=r?eo(r):null,s=r?no(r):null,a=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(o){case Nr:e={x:a,y:n.y-i.height};break;case Rr:e={x:a,y:n.y+n.height};break;case qr:e={x:n.x+n.width,y:l};break;case zr:e={x:n.x-i.width,y:l};break;default:e={x:n.x,y:n.y}}var c=o?io(o):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case Xr:e[c]=e[c]-(n[u]/2-i[u]/2);break;case Yr:e[c]=e[c]+(n[u]/2-i[u]/2)}}return e}var oo={top:"auto",right:"auto",bottom:"auto",left:"auto"};function so(t){var e,n=t.popper,i=t.popperRect,r=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,h=t.isFixed,p=s.x,d=void 0===p?0:p,f=s.y,m=void 0===f?0:f,g="function"==typeof u?u({x:d,y:m}):{x:d,y:m};d=g.x,m=g.y;var y=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),b=zr,w=Nr,x=window;if(c){var _=jr(n),S="clientHeight",E="clientWidth";if(_===hr(n)&&"static"!==Tr(_=Sr(n)).position&&"absolute"===a&&(S="scrollHeight",E="scrollWidth"),r===Nr||(r===zr||r===qr)&&o===Yr)w=Rr,m-=(h&&_===x&&x.visualViewport?x.visualViewport.height:_[S])-i.height,m*=l?1:-1;if(r===zr||(r===Nr||r===Rr)&&o===Yr)b=qr,d-=(h&&_===x&&x.visualViewport?x.visualViewport.width:_[E])-i.width,d*=l?1:-1}var T,O=Object.assign({position:a},c&&oo),M=!0===u?function(t){var e=t.x,n=t.y,i=window.devicePixelRatio||1;return{x:yr(e*i)/i||0,y:yr(n*i)/i||0}}({x:d,y:m}):{x:d,y:m};return d=M.x,m=M.y,l?Object.assign({},O,((T={})[w]=v?"0":"",T[b]=y?"0":"",T.transform=(x.devicePixelRatio||1)<=1?"translate("+d+"px, "+m+"px)":"translate3d("+d+"px, "+m+"px, 0)",T)):Object.assign({},O,((e={})[w]=v?m+"px":"",e[b]=y?d+"px":"",e.transform="",e))}const ao={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,i=t.name,r=n.offset,o=void 0===r?[0,0]:r,s=Gr.reduce((function(t,n){return t[n]=function(t,e,n){var i=eo(t),r=[zr,Nr].indexOf(i)>=0?-1:1,o="function"==typeof n?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[zr,qr].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}(n,e.rects,o),t}),{}),a=s[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=s}};var lo={left:"right",right:"left",bottom:"top",top:"bottom"};function co(t){return t.replace(/left|right|bottom|top/g,(function(t){return lo[t]}))}var uo={start:"end",end:"start"};function ho(t){return t.replace(/start|end/g,(function(t){return uo[t]}))}function po(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&fr(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function fo(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mo(t,e,n){return e===Br?fo(function(t,e){var n=hr(t),i=Sr(t),r=n.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var c=br();(c||!c&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+Er(t),y:l}}(t,n)):pr(e)?function(t,e){var n=wr(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):fo(function(t){var e,n=Sr(t),i=xr(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=mr(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=mr(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+Er(t),l=-i.scrollTop;return"rtl"===Tr(r||n).direction&&(a+=mr(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(Sr(t)))}function go(t,e,n,i){var r="clippingParents"===e?function(t){var e=Cr(Ar(t)),n=["absolute","fixed"].indexOf(Tr(t).position)>=0&&dr(t)?jr(t):t;return pr(n)?e.filter((function(t){return pr(t)&&po(t,n)&&"body"!==_r(t)})):[]}(t):[].concat(e),o=[].concat(r,[n]),s=o[0],a=o.reduce((function(e,n){var r=mo(t,n,i);return e.top=mr(r.top,e.top),e.right=gr(r.right,e.right),e.bottom=gr(r.bottom,e.bottom),e.left=mr(r.left,e.left),e}),mo(t,s,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function yo(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function vo(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}function bo(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=void 0===i?t.placement:i,o=n.strategy,s=void 0===o?t.strategy:o,a=n.boundary,l=void 0===a?"clippingParents":a,c=n.rootBoundary,u=void 0===c?Br:c,h=n.elementContext,p=void 0===h?Hr:h,d=n.altBoundary,f=void 0!==d&&d,m=n.padding,g=void 0===m?0:m,y=yo("number"!=typeof g?g:vo(g,Lr)),v=p===Hr?"reference":Hr,b=t.rects.popper,w=t.elements[f?v:p],x=go(pr(w)?w:w.contextElement||Sr(t.elements.popper),l,u,s),_=wr(t.elements.reference),S=ro({reference:_,element:b,strategy:"absolute",placement:r}),E=fo(Object.assign({},b,S)),T=p===Hr?E:_,O={top:x.top-T.top+y.top,bottom:T.bottom-x.bottom+y.bottom,left:x.left-T.left+y.left,right:T.right-x.right+y.right},M=t.modifiersData.offset;if(p===Hr&&M){var D=M[r];Object.keys(O).forEach((function(t){var e=[qr,Rr].indexOf(t)>=0?1:-1,n=[Nr,Rr].indexOf(t)>=0?"y":"x";O[t]+=D[n]*e}))}return O}function wo(t,e,n){return mr(t,gr(e,n))}const xo={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,o=void 0===r||r,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,h=n.padding,p=n.tether,d=void 0===p||p,f=n.tetherOffset,m=void 0===f?0:f,g=bo(e,{boundary:l,rootBoundary:c,padding:h,altBoundary:u}),y=eo(e.placement),v=no(e.placement),b=!v,w=io(y),x="x"===w?"y":"x",_=e.modifiersData.popperOffsets,S=e.rects.reference,E=e.rects.popper,T="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,O="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),M=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,D={x:0,y:0};if(_){if(o){var A,P="y"===w?Nr:zr,C="y"===w?Rr:qr,I="y"===w?"height":"width",k=_[w],j=k+g[P],N=k-g[C],R=d?-E[I]/2:0,q=v===Xr?S[I]:E[I],z=v===Xr?-E[I]:-S[I],F=e.elements.arrow,L=d&&F?Dr(F):{width:0,height:0},X=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Y=X[P],B=X[C],H=wo(0,S[I],L[I]),W=b?S[I]/2-R-H-Y-O.mainAxis:q-H-Y-O.mainAxis,G=b?-S[I]/2+R+H+B+O.mainAxis:z+H+B+O.mainAxis,U=e.elements.arrow&&jr(e.elements.arrow),V=U?"y"===w?U.clientTop||0:U.clientLeft||0:0,$=null!=(A=null==M?void 0:M[w])?A:0,K=k+G-$,Q=wo(d?gr(j,k+W-$-V):j,k,d?mr(N,K):N);_[w]=Q,D[w]=Q-k}if(a){var Z,J="x"===w?Nr:zr,tt="x"===w?Rr:qr,et=_[x],nt="y"===x?"height":"width",it=et+g[J],rt=et-g[tt],ot=-1!==[Nr,zr].indexOf(y),st=null!=(Z=null==M?void 0:M[x])?Z:0,at=ot?it:et-S[nt]-E[nt]-st+O.altAxis,lt=ot?et+S[nt]+E[nt]-st-O.altAxis:rt,ct=d&&ot?function(t,e,n){var i=wo(t,e,n);return i>n?n:i}(at,et,lt):wo(d?at:it,et,d?lt:rt);_[x]=ct,D[x]=ct-et}e.modifiersData[i]=D}},requiresIfExists:["offset"]};const _o={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,i=t.name,r=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=eo(n.placement),l=io(a),c=[zr,qr].indexOf(a)>=0?"height":"width";if(o&&s){var u=function(t,e){return yo("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:vo(t,Lr))}(r.padding,n),h=Dr(o),p="y"===l?Nr:zr,d="y"===l?Rr:qr,f=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],m=s[l]-n.rects.reference[l],g=jr(o),y=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,v=f/2-m/2,b=u[p],w=y-h[c]-u[d],x=y/2-h[c]/2+v,_=wo(b,x,w),S=l;n.modifiersData[i]=((e={})[S]=_,e.centerOffset=_-x,e)}},effect:function(t){var e=t.state,n=t.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&po(e.elements.popper,i)&&(e.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function So(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Eo(t){return[Nr,qr,Rr,zr].some((function(e){return t[e]>=0}))}var To=Zr({defaultModifiers:[to,{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=ro({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,c={placement:eo(e.placement),variation:no(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,so(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,so(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];dr(r)&&_r(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(t){var e=i[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var i=e.elements[t],r=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});dr(i)&&_r(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]},ao,{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,h=n.rootBoundary,p=n.altBoundary,d=n.flipVariations,f=void 0===d||d,m=n.allowedAutoPlacements,g=e.options.placement,y=eo(g),v=l||(y===g||!f?[co(g)]:function(t){if(eo(t)===Fr)return[];var e=co(t);return[ho(t),e,ho(e)]}(g)),b=[g].concat(v).reduce((function(t,n){return t.concat(eo(n)===Fr?function(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?Gr:l,u=no(i),h=u?a?Wr:Wr.filter((function(t){return no(t)===u})):Lr,p=h.filter((function(t){return c.indexOf(t)>=0}));0===p.length&&(p=h);var d=p.reduce((function(e,n){return e[n]=bo(t,{placement:n,boundary:r,rootBoundary:o,padding:s})[eo(n)],e}),{});return Object.keys(d).sort((function(t,e){return d[t]-d[e]}))}(e,{placement:n,boundary:u,rootBoundary:h,padding:c,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),w=e.rects.reference,x=e.rects.popper,_=new Map,S=!0,E=b[0],T=0;T=0,P=A?"width":"height",C=bo(e,{placement:O,boundary:u,rootBoundary:h,altBoundary:p,padding:c}),I=A?D?qr:zr:D?Rr:Nr;w[P]>x[P]&&(I=co(I));var k=co(I),j=[];if(o&&j.push(C[M]<=0),a&&j.push(C[I]<=0,C[k]<=0),j.every((function(t){return t}))){E=O,S=!1;break}_.set(O,j)}if(S)for(var N=function(t){var e=b.find((function(e){var n=_.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return E=e,"break"},R=f?3:1;R>0;R--){if("break"===N(R))break}e.placement!==E&&(e.modifiersData[i]._skip=!0,e.placement=E,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},xo,_o,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=bo(e,{elementContext:"reference"}),a=bo(e,{altBoundary:!0}),l=So(s,i),c=So(a,r,o),u=Eo(l),h=Eo(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}}]});const Oo={init:function(t){const e=t;Oo.document=e.document,Oo.DocumentFragment=e.DocumentFragment||Mo,Oo.SVGElement=e.SVGElement||Mo,Oo.SVGSVGElement=e.SVGSVGElement||Mo,Oo.SVGElementInstance=e.SVGElementInstance||Mo,Oo.Element=e.Element||Mo,Oo.HTMLElement=e.HTMLElement||Oo.Element,Oo.Event=e.Event,Oo.Touch=e.Touch||Mo,Oo.PointerEvent=e.PointerEvent||e.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function Mo(){}const Do=Oo;const Ao=t=>!(!t||!t.Window)&&t instanceof t.Window;let Po,Co;function Io(t){Po=t;const e=t.document.createTextNode("");e.ownerDocument!==t.document&&"function"==typeof t.wrap&&t.wrap(e)===e&&(t=t.wrap(t)),Co=t}function ko(t){if(Ao(t))return t;return(t.ownerDocument||t).defaultView||Co.window}"undefined"!=typeof window&&window&&Io(window);const jo=t=>!!t&&"object"==typeof t,No=t=>"function"==typeof t,Ro={window:t=>t===Co||Ao(t),docFrag:t=>jo(t)&&11===t.nodeType,object:jo,func:No,number:t=>"number"==typeof t,bool:t=>"boolean"==typeof t,string:t=>"string"==typeof t,element:t=>{if(!t||"object"!=typeof t)return!1;const e=ko(t)||Co;return/object|function/.test(typeof Element)?t instanceof Element||t instanceof e.Element:1===t.nodeType&&"string"==typeof t.nodeName},plainObject:t=>jo(t)&&!!t.constructor&&/function Object\b/.test(t.constructor.toString()),array:t=>jo(t)&&void 0!==t.length&&No(t.splice)},qo={init:function(t){const e=Do.Element,n=t.navigator||{};qo.supportsTouch="ontouchstart"in t||Ro.func(t.DocumentTouch)&&Do.document instanceof t.DocumentTouch,qo.supportsPointerEvent=!1!==n.pointerEnabled&&!!Do.PointerEvent,qo.isIOS=/iP(hone|od|ad)/.test(n.platform),qo.isIOS7=/iP(hone|od|ad)/.test(n.platform)&&/OS 7[^\d]/.test(n.appVersion),qo.isIe9=/MSIE 9/.test(n.userAgent),qo.isOperaMobile="Opera"===n.appName&&qo.supportsTouch&&/Presto/.test(n.userAgent),qo.prefixedMatchesSelector="matches"in e.prototype?"matches":"webkitMatchesSelector"in e.prototype?"webkitMatchesSelector":"mozMatchesSelector"in e.prototype?"mozMatchesSelector":"oMatchesSelector"in e.prototype?"oMatchesSelector":"msMatchesSelector",qo.pEventTypes=qo.supportsPointerEvent?Do.PointerEvent===t.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,qo.wheelEvent=Do.document&&"onmousewheel"in Do.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null};const zo=qo,Fo=(t,e)=>{for(const n of e)t.push(n);return t},Lo=t=>Fo([],t),Xo=(t,e)=>{for(let n=0;nt[Xo(t,e)];function Bo(t){const e={};for(const n in t){const i=t[n];Ro.plainObject(i)?e[n]=Bo(i):Ro.array(i)?e[n]=Lo(i):e[n]=i}return e}function Ho(t,e){for(const n in e)t[n]=e[n];return t}let Wo,Go,Uo=0;const Vo={request:t=>Wo(t),cancel:t=>Go(t),init:function(t){if(Wo=t.requestAnimationFrame,Go=t.cancelAnimationFrame,!Wo){const e=["ms","moz","webkit","o"];for(const n of e)Wo=t[`${n}RequestAnimationFrame`],Go=t[`${n}CancelAnimationFrame`]||t[`${n}CancelRequestAnimationFrame`]}Wo=Wo&&Wo.bind(t),Go=Go&&Go.bind(t),Wo||(Wo=e=>{const n=Date.now(),i=Math.max(0,16-(n-Uo)),r=t.setTimeout((()=>{e(n+i)}),i);return Uo=n+i,r},Go=t=>clearTimeout(t))}};function $o(t,e,n){if(n=n||{},Ro.string(t)&&-1!==t.search(" ")&&(t=Ko(t)),Ro.array(t))return t.reduce(((t,i)=>Ho(t,$o(i,e,n))),n);if(Ro.object(t)&&(e=t,t=""),Ro.func(e))n[t]=n[t]||[],n[t].push(e);else if(Ro.array(e))for(const i of e)$o(t,i,n);else if(Ro.object(e))for(const i in e){$o(Ko(i).map((e=>`${t}${e}`)),e[i],n)}return n}function Ko(t){return t.trim().split(/ +/)}function Qo(t,e){for(const n of e){if(t.immediatePropagationStopped)break;n(t)}}class Zo{options;types={};propagationStopped=!1;immediatePropagationStopped=!1;global;constructor(t){this.options=Ho({},t||{})}fire(t){let e;const n=this.global;(e=this.types[t.type])&&Qo(t,e),!t.propagationStopped&&n&&(e=n[t.type])&&Qo(t,e)}on(t,e){const n=$o(t,e);for(t in n)this.types[t]=Fo(this.types[t]||[],n[t])}off(t,e){const n=$o(t,e);for(t in n){const e=this.types[t];if(e&&e.length)for(const i of n[t]){const t=e.indexOf(i);-1!==t&&e.splice(t,1)}}}getRect(t){return null}}function Jo(t,e){if(t.contains)return t.contains(e);for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function ts(t,e){for(;Ro.element(t);){if(ns(t,e))return t;t=es(t)}return null}function es(t){let e=t.parentNode;if(Ro.docFrag(e)){for(;(e=e.host)&&Ro.docFrag(e););return e}return e}function ns(t,e){return Co!==Po&&(e=e.replace(/\/deep\//g," ")),t[zo.prefixedMatchesSelector](e)}function is(t,e,n){for(;Ro.element(t);){if(ns(t,e))return!0;if((t=es(t))===n)return ns(t,e)}return!1}function rs(t){return t.correspondingUseElement||t}function os(t){const e=t instanceof Do.SVGElement?t.getBoundingClientRect():t.getClientRects()[0];return e&&{left:e.left,right:e.right,top:e.top,bottom:e.bottom,width:e.width||e.right-e.left,height:e.height||e.bottom-e.top}}function ss(t){const e=os(t);if(!zo.isIOS7&&e){const i={x:(n=(n=ko(t))||Co).scrollX||n.document.documentElement.scrollLeft,y:n.scrollY||n.document.documentElement.scrollTop};e.left+=i.x,e.right+=i.x,e.top+=i.y,e.bottom+=i.y}var n;return e}function as(t){return!!Ro.string(t)&&(Do.document.querySelector(t),!0)}function ls(t,e,n,i){let r=t;return Ro.string(r)?r=function(t,e,n){return"parent"===t?es(n):"self"===t?e.getRect(n):ts(n,t)}(r,e,n):Ro.func(r)&&(r=r(...i)),Ro.element(r)&&(r=ss(r)),r}function cs(t){return t&&{x:"x"in t?t.x:t.left,y:"y"in t?t.y:t.top}}function us(t){return!t||"x"in t&&"y"in t||((t=Ho({},t)).x=t.left||0,t.y=t.top||0,t.width=t.width||(t.right||0)-t.x,t.height=t.height||(t.bottom||0)-t.y),t}function hs(t,e,n){t.left&&(e.left+=n.x),t.right&&(e.right+=n.x),t.top&&(e.top+=n.y),t.bottom&&(e.bottom+=n.y),e.width=e.right-e.left,e.height=e.bottom-e.top}function ps(t,e,n){const i=t.options[n];return cs(ls(i&&i.origin||t.options.origin,t,e,[t&&e]))||{x:0,y:0}}const ds=(t,e)=>Math.sqrt(t*t+e*e);class fs{immediatePropagationStopped=!1;propagationStopped=!1;constructor(t){this._interaction=t}preventDefault(){}stopPropagation(){this.propagationStopped=!0}stopImmediatePropagation(){this.immediatePropagationStopped=this.propagationStopped=!0}}Object.defineProperty(fs.prototype,"interaction",{get(){return this._interaction._proxy},set(){}});const ms={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}};class gs extends fs{relatedTarget=null;screenX;screenY;button;buttons;ctrlKey;shiftKey;altKey;metaKey;page;client;delta;rect;x0;y0;t0;dt;duration;clientX0;clientY0;velocity;speed;swipe;axes;preEnd;constructor(t,e,n,i,r,o,s){super(t),r=r||t.element;const a=t.interactable,l=(a&&a.options||ms).deltaSource,c=ps(a,r,n),u="start"===i,h="end"===i,p=u?this:t.prevEvent,d=u?t.coords.start:h?{page:p.page,client:p.client,timeStamp:t.coords.cur.timeStamp}:t.coords.cur;this.page=Ho({},d.page),this.client=Ho({},d.client),this.rect=Ho({},t.rect),this.timeStamp=d.timeStamp,h||(this.page.x-=c.x,this.page.y-=c.y,this.client.x-=c.x,this.client.y-=c.y),this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.button=e.button,this.buttons=e.buttons,this.target=r,this.currentTarget=r,this.preEnd=o,this.type=s||n+(i||""),this.interactable=a,this.t0=u?t.pointers[t.pointers.length-1].downTime:p.t0,this.x0=t.coords.start.page.x-c.x,this.y0=t.coords.start.page.y-c.y,this.clientX0=t.coords.start.client.x-c.x,this.clientY0=t.coords.start.client.y-c.y,this.delta=u||h?{x:0,y:0}:{x:this[l].x-p[l].x,y:this[l].y-p[l].y},this.dt=t.coords.delta.timeStamp,this.duration=this.timeStamp-this.t0,this.velocity=Ho({},t.coords.velocity[l]),this.speed=ds(this.velocity.x,this.velocity.y),this.swipe=h||"inertiastart"===i?this.getSwipe():null}getSwipe(){const t=this._interaction;if(t.prevEvent.speed<600||this.timeStamp-t.prevEvent.timeStamp>150)return null;let e=180*Math.atan2(t.prevEvent.velocityY,t.prevEvent.velocityX)/Math.PI;e<0&&(e+=360);const n=112.5<=e&&e<247.5,i=202.5<=e&&e<337.5;return{up:i,down:!i&&22.5<=e&&e<157.5,left:n,right:!n&&(292.5<=e||e<67.5),angle:e,speed:t.prevEvent.speed,velocity:{x:t.prevEvent.velocityX,y:t.prevEvent.velocityY}}}preventDefault(){}stopImmediatePropagation(){this.immediatePropagationStopped=this.propagationStopped=!0}stopPropagation(){this.propagationStopped=!0}}function ys(t,e){let n=!1;return function(){return n||(Co.console.warn(e),n=!0),t.apply(this,arguments)}}function vs(t,e){return t.name=e.name,t.axis=e.axis,t.edges=e.edges,t}Object.defineProperties(gs.prototype,{pageX:{get(){return this.page.x},set(t){this.page.x=t}},pageY:{get(){return this.page.y},set(t){this.page.y=t}},clientX:{get(){return this.client.x},set(t){this.client.x=t}},clientY:{get(){return this.client.y},set(t){this.client.y=t}},dx:{get(){return this.delta.x},set(t){this.delta.x=t}},dy:{get(){return this.delta.y},set(t){this.delta.y=t}},velocityX:{get(){return this.velocity.x},set(t){this.velocity.x=t}},velocityY:{get(){return this.velocity.y},set(t){this.velocity.y=t}}});function bs(t,e){t.page=t.page||{},t.page.x=e.page.x,t.page.y=e.page.y,t.client=t.client||{},t.client.x=e.client.x,t.client.y=e.client.y,t.timeStamp=e.timeStamp}function ws(t){return t instanceof Do.Event||t instanceof Do.Touch}function xs(t,e,n){return t=t||"page",(n=n||{}).x=e[t+"X"],n.y=e[t+"Y"],n}function _s(t){return Ro.number(t.pointerId)?t.pointerId:t.identifier}function Ss(t,e,n){const i=e.length>1?Ts(e):e[0];!function(t,e){e=e||{x:0,y:0},zo.isOperaMobile&&ws(t)?(xs("screen",t,e),e.x+=window.scrollX,e.y+=window.scrollY):xs("page",t,e)}(i,t.page),function(t,e){e=e||{},zo.isOperaMobile&&ws(t)?xs("screen",t,e):xs("client",t,e)}(i,t.client),t.timeStamp=n}function Es(t){const e=[];return Ro.array(t)?(e[0]=t[0],e[1]=t[1]):"touchend"===t.type?1===t.touches.length?(e[0]=t.touches[0],e[1]=t.changedTouches[0]):0===t.touches.length&&(e[0]=t.changedTouches[0],e[1]=t.changedTouches[1]):(e[0]=t.touches[0],e[1]=t.touches[1]),e}function Ts(t){const e={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0};for(const n of t)for(const t in e)e[t]+=n[t];for(const n in e)e[n]/=t.length;return e}function Os(t){if(!t.length)return null;const e=Es(t),n=Math.min(e[0].pageX,e[1].pageX),i=Math.min(e[0].pageY,e[1].pageY),r=Math.max(e[0].pageX,e[1].pageX),o=Math.max(e[0].pageY,e[1].pageY);return{x:n,y:i,left:n,top:i,right:r,bottom:o,width:r-n,height:o-i}}function Ms(t,e){const n=e+"X",i=e+"Y",r=Es(t),o=r[0][n]-r[1][n],s=r[0][i]-r[1][i];return ds(o,s)}function Ds(t,e){const n=e+"X",i=e+"Y",r=Es(t),o=r[1][n]-r[0][n],s=r[1][i]-r[0][i];return 180*Math.atan2(s,o)/Math.PI}function As(t){const e=Ro.func(t.composedPath)?t.composedPath():t.path;return[rs(e?e[0]:t.target),rs(t.currentTarget)]}function Ps(t,e){if(e.phaselessTypes[t])return!0;for(const n in e.map)if(0===t.indexOf(n)&&t.substr(n.length)in e.phases)return!0;return!1}class Cs{get _defaults(){return{base:{},perAction:{},actions:{}}}options;_actions;target;events=new Zo;_context;_win;_doc;_scopeEvents;_rectChecker;constructor(t,e,n,i){this._actions=e.actions,this.target=t,this._context=e.context||n,this._win=ko(as(t)?this._context:t),this._doc=this._win.document,this._scopeEvents=i,this.set(e)}setOnEvents(t,e){return Ro.func(e.onstart)&&this.on(`${t}start`,e.onstart),Ro.func(e.onmove)&&this.on(`${t}move`,e.onmove),Ro.func(e.onend)&&this.on(`${t}end`,e.onend),Ro.func(e.oninertiastart)&&this.on(`${t}inertiastart`,e.oninertiastart),this}updatePerActionListeners(t,e,n){(Ro.array(e)||Ro.object(e))&&this.off(t,e),(Ro.array(n)||Ro.object(n))&&this.on(t,n)}setPerAction(t,e){const n=this._defaults;for(const i in e){const r=i,o=this.options[t],s=e[r];"listeners"===r&&this.updatePerActionListeners(t,o.listeners,s),Ro.array(s)?o[r]=Lo(s):Ro.plainObject(s)?(o[r]=Ho(o[r]||{},Bo(s)),Ro.object(n.perAction[r])&&"enabled"in n.perAction[r]&&(o[r].enabled=!1!==s.enabled)):Ro.bool(s)&&Ro.object(n.perAction[r])?o[r].enabled=s:o[r]=s}}getRect(t){return t=t||(Ro.element(this.target)?this.target:null),Ro.string(this.target)&&(t=t||this._context.querySelector(this.target)),ss(t)}rectChecker(t){return Ro.func(t)?(this._rectChecker=t,this.getRect=t=>{const e=Ho({},this._rectChecker(t));return"width"in e||(e.width=e.right-e.left,e.height=e.bottom-e.top),e},this):null===t?(delete this.getRect,delete this._rectChecker,this):this.getRect}_backCompatOption(t,e){if(as(e)||Ro.object(e)){this.options[t]=e;for(const n in this._actions.map)this.options[n][t]=e;return this}return this.options[t]}origin(t){return this._backCompatOption("origin",t)}deltaSource(t){return"page"===t||"client"===t?(this.options.deltaSource=t,this):this.options.deltaSource}context(){return this._context}inContext(t){return this._context===t.ownerDocument||Jo(this._context,t)}testIgnoreAllow(t,e,n){return!this.testIgnore(t.ignoreFrom,e,n)&&this.testAllow(t.allowFrom,e,n)}testAllow(t,e,n){return!t||!!Ro.element(n)&&(Ro.string(t)?is(n,t,e):!!Ro.element(t)&&Jo(t,n))}testIgnore(t,e,n){return!(!t||!Ro.element(n))&&(Ro.string(t)?is(n,t,e):!!Ro.element(t)&&Jo(t,n))}fire(t){return this.events.fire(t),this}_onOff(t,e,n,i){Ro.object(e)&&!Ro.array(e)&&(i=n,n=null);const r="on"===t?"add":"remove",o=$o(e,n);for(let e in o){"wheel"===e&&(e=zo.wheelEvent);for(const n of o[e])Ps(e,this._actions)?this.events[t](e,n):Ro.string(this.target)?this._scopeEvents[`${r}Delegate`](this.target,this._context,e,n,i):this._scopeEvents[r](this.target,e,n,i)}return this}on(t,e,n){return this._onOff("on",t,e,n)}off(t,e,n){return this._onOff("off",t,e,n)}set(t){const e=this._defaults;Ro.object(t)||(t={}),this.options=Bo(e.base);for(const n in this._actions.methodDict){const i=n,r=this._actions.methodDict[i];this.options[i]={},this.setPerAction(i,Ho(Ho({},e.perAction),e.actions[i])),this[r](t[i])}for(const e in t)Ro.func(this[e])&&this[e](t[e]);return this}unset(){if(Ro.string(this.target))for(const t in this._scopeEvents.delegatedEvents){const e=this._scopeEvents.delegatedEvents[t];for(let n=e.length-1;n>=0;n--){const{selector:i,context:r,listeners:o}=e[n];i===this.target&&r===this._context&&e.splice(n,1);for(let e=o.length-1;e>=0;e--)this._scopeEvents.removeDelegate(this.target,this._context,t,o[e][0],o[e][1])}}else this._scopeEvents.remove(this.target,"all")}}class Is{list=[];selectorMap={};scope;constructor(t){this.scope=t,t.addListeners({"interactable:unset":({interactable:t})=>{const{target:e,_context:n}=t,i=Ro.string(e)?this.selectorMap[e]:e[this.scope.id],r=Xo(i,(t=>t.context===n));i[r]&&(i[r].context=null,i[r].interactable=null),i.splice(r,1)}})}new(t,e){e=Ho(e||{},{actions:this.scope.actions});const n=new this.scope.Interactable(t,e,this.scope.document,this.scope.events),i={context:n._context,interactable:n};return this.scope.addDocument(n._doc),this.list.push(n),Ro.string(t)?(this.selectorMap[t]||(this.selectorMap[t]=[]),this.selectorMap[t].push(i)):(n.target[this.scope.id]||Object.defineProperty(t,this.scope.id,{value:[],configurable:!0}),t[this.scope.id].push(i)),this.scope.fire("interactable:new",{target:t,options:e,interactable:n,win:this.scope._win}),n}get(t,e){const n=e&&e.context||this.scope.document,i=Ro.string(t),r=i?this.selectorMap[t]:t[this.scope.id];if(!r)return null;const o=Yo(r,(e=>e.context===n&&(i||e.interactable.inContext(t))));return o&&o.interactable}forEachMatch(t,e){for(const n of this.list){let i;if((Ro.string(n.target)?Ro.element(t)&&ns(t,n.target):t===n.target)&&n.inContext(t)&&(i=e(n)),void 0!==i)return i}}}function ks(t,e){t.__set||={};for(const n in e)"function"!=typeof t[n]&&"__set"!==n&&Object.defineProperty(t,n,{get:()=>n in t.__set?t.__set[n]:t.__set[n]=e[n],set(e){t.__set[n]=e},configurable:!0});return t}class js{currentTarget;originalEvent;type;constructor(t){this.originalEvent=t,ks(this,t)}preventOriginalDefault(){this.originalEvent.preventDefault()}stopPropagation(){this.originalEvent.stopPropagation()}stopImmediatePropagation(){this.originalEvent.stopImmediatePropagation()}}function Ns(t){if(!Ro.object(t))return{capture:!!t,passive:!1};const e=Ho({},t);return e.capture=!!t.capture,e.passive=!!t.passive,e}const Rs={id:"events",install:function(t){var e;const n=[],i={},r=[],o={add:s,remove:a,addDelegate:function(t,e,n,o,a){const u=Ns(a);if(!i[n]){i[n]=[];for(const t of r)s(t,n,l),s(t,n,c,!0)}const h=i[n];let p=Yo(h,(n=>n.selector===t&&n.context===e));p||(p={selector:t,context:e,listeners:[]},h.push(p));p.listeners.push([o,u])},removeDelegate:function(t,e,n,r,o){const s=Ns(o),u=i[n];let h,p=!1;if(!u)return;for(h=u.length-1;h>=0;h--){const i=u[h];if(i.selector===t&&i.context===e){const{listeners:t}=i;for(let i=t.length-1;i>=0;i--){const[o,{capture:d,passive:f}]=t[i];if(o===r&&d===s.capture&&f===s.passive){t.splice(i,1),t.length||(u.splice(h,1),a(e,n,l),a(e,n,c,!0)),p=!0;break}}if(p)break}}},delegateListener:l,delegateUseCapture:c,delegatedEvents:i,documents:r,targets:n,supportsOptions:!1,supportsPassive:!1};function s(t,e,i,r){const s=Ns(r);let a=Yo(n,(e=>e.eventTarget===t));a||(a={eventTarget:t,events:{}},n.push(a)),a.events[e]||(a.events[e]=[]),t.addEventListener&&!((t,e)=>-1!==t.indexOf(e))(a.events[e],i)&&(t.addEventListener(e,i,o.supportsOptions?s:s.capture),a.events[e].push(i))}function a(t,e,i,r){const s=Ns(r),l=Xo(n,(e=>e.eventTarget===t)),c=n[l];if(!c||!c.events)return;if("all"===e){for(e in c.events)c.events.hasOwnProperty(e)&&a(t,e,"all");return}let u=!1;const h=c.events[e];if(h){if("all"===i){for(let n=h.length-1;n>=0;n--)a(t,e,h[n],s);return}for(let n=0;nn[t]});for(const t in Fs)Object.defineProperty(this._proxy,t,{value:(...e)=>n[t](...e)});this._scopeFire("interactions:new",{interaction:this})}pointerDown(t,e,n){const i=this.updatePointer(t,e,n,!0),r=this.pointers[i];this._scopeFire("interactions:down",{pointer:t,event:e,eventTarget:n,pointerIndex:i,pointerInfo:r,type:"down",interaction:this})}start(t,e,n){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<("gesture"===t.name?2:1)||!e.options[t.name].enabled)&&(vs(this.prepared,t),this.interactable=e,this.element=n,this.rect=e.getRect(n),this.edges=this.prepared.edges?Ho({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}pointerMove(t,e,n){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(t,e,n,!1);const i=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;let r,o;this.pointerIsDown&&!this.pointerWasMoved&&(r=this.coords.cur.client.x-this.coords.start.client.x,o=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=ds(r,o)>this.pointerMoveTolerance);const s=this.getPointerIndex(t),a={pointer:t,pointerIndex:s,pointerInfo:this.pointers[s],event:e,type:"move",eventTarget:n,dx:r,dy:o,duplicate:i,interaction:this};i||function(t,e){const n=Math.max(e.timeStamp/1e3,.001);t.page.x=e.page.x/n,t.page.y=e.page.y/n,t.client.x=e.client.x/n,t.client.y=e.client.y/n,t.timeStamp=n}(this.coords.velocity,this.coords.delta),this._scopeFire("interactions:move",a),i||this.simulation||(this.interacting()&&(a.type=null,this.move(a)),this.pointerWasMoved&&bs(this.coords.prev,this.coords.cur))}move(t){var e;t&&t.event||((e=this.coords.delta).page.x=0,e.page.y=0,e.client.x=0,e.client.y=0),(t=Ho({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},t||{})).phase="move",this._doPhase(t)}pointerUp(t,e,n,i){let r=this.getPointerIndex(t);-1===r&&(r=this.updatePointer(t,e,n,!1));const o=/cancel$/i.test(e.type)?"cancel":"up";this._scopeFire(`interactions:${o}`,{pointer:t,pointerIndex:r,pointerInfo:this.pointers[r],event:e,eventTarget:n,type:o,curEventTarget:i,interaction:this}),this.simulation||this.end(e),this.removePointer(t,e)}documentBlur(t){this.end(t),this._scopeFire("interactions:blur",{event:t,type:"blur",interaction:this})}end(t){let e;this._ending=!0,t=t||this._latestPointer.event,this.interacting()&&(e=this._doPhase({event:t,interaction:this,phase:"end"})),this._ending=!1,!0===e&&this.stop()}currentAction(){return this._interacting?this.prepared.name:null}interacting(){return this._interacting}stop(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}getPointerIndex(t){const e=_s(t);return"mouse"===this.pointerType||"pen"===this.pointerType?this.pointers.length-1:Xo(this.pointers,(t=>t.id===e))}getPointerInfo(t){return this.pointers[this.getPointerIndex(t)]}updatePointer(t,e,n,i){const r=_s(t);let o=this.getPointerIndex(t),s=this.pointers[o];return i=!1!==i&&(i||/(down|start)$/i.test(e.type)),s?s.pointer=t:(s=new qs(r,t,e,null,null),o=this.pointers.length,this.pointers.push(s)),Ss(this.coords.cur,this.pointers.map((t=>t.pointer)),this._now()),function(t,e,n){t.page.x=n.page.x-e.page.x,t.page.y=n.page.y-e.page.y,t.client.x=n.client.x-e.client.x,t.client.y=n.client.y-e.client.y,t.timeStamp=n.timeStamp-e.timeStamp}(this.coords.delta,this.coords.prev,this.coords.cur),i&&(this.pointerIsDown=!0,s.downTime=this.coords.cur.timeStamp,s.downTarget=n,ks(this.downPointer,t),this.interacting()||(bs(this.coords.start,this.coords.cur),bs(this.coords.prev,this.coords.cur),this.downEvent=e,this.pointerWasMoved=!1)),this._updateLatestPointer(t,e,n),this._scopeFire("interactions:update-pointer",{pointer:t,event:e,eventTarget:n,down:i,pointerInfo:s,pointerIndex:o,interaction:this}),o}removePointer(t,e){const n=this.getPointerIndex(t);if(-1===n)return;const i=this.pointers[n];this._scopeFire("interactions:remove-pointer",{pointer:t,event:e,eventTarget:null,pointerIndex:n,pointerInfo:i,interaction:this}),this.pointers.splice(n,1),this.pointerIsDown=!1}_updateLatestPointer(t,e,n){this._latestPointer.pointer=t,this._latestPointer.event=e,this._latestPointer.eventTarget=n}destroy(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}_createPreparedEvent(t,e,n,i){return new gs(this,t,this.prepared.name,e,this.element,n,i)}_fireEvent(t){var e;null==(e=this.interactable)||e.fire(t),(!this.prevEvent||t.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=t)}_doPhase(t){const{event:e,phase:n,preEnd:i,type:r}=t,{rect:o}=this;o&&"move"===n&&(hs(this.edges,o,this.coords.delta[this.interactable.options.deltaSource]),o.width=o.right-o.left,o.height=o.bottom-o.top);if(!1===this._scopeFire(`interactions:before-action-${n}`,t))return!1;const s=t.iEvent=this._createPreparedEvent(e,n,i,r);return this._scopeFire(`interactions:action-${n}`,t),"start"===n&&(this.prevEvent=s),this._fireEvent(s),this._scopeFire(`interactions:after-action-${n}`,t),!0}_now(){return Date.now()}};function Ys(t){return/^(always|never|auto)$/.test(t)?(this.options.preventDefault=t,this):Ro.bool(t)?(this.options.preventDefault=t?"always":"never",this):this.options.preventDefault}function Bs({interaction:t,event:e}){t.interactable&&t.interactable.checkAndPreventDefault(e)}const Hs={id:"core/interactablePreventDefault",install:function(t){const{Interactable:e}=t;e.prototype.preventDefault=Ys,e.prototype.checkAndPreventDefault=function(e){return function(t,e,n){const i=t.options.preventDefault;if("never"!==i)if("always"!==i){if(e.events.supportsPassive&&/^touch(start|move)$/.test(n.type)){const t=ko(n.target).document,i=e.getDocOptions(t);if(!i||!i.events||!1!==i.events.passive)return}/^(mouse|pointer|touch)*(down|start)/i.test(n.type)||Ro.element(n.target)&&ns(n.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||n.preventDefault()}else n.preventDefault()}(this,t,e)},t.interactions.docEvents.push({type:"dragstart",listener(e){for(const n of t.interactions.list)if(n.element&&(n.element===e.target||Jo(n.element,e.target)))return void n.interactable.checkAndPreventDefault(e)}})},listeners:["down","move","up","cancel"].reduce(((t,e)=>(t[`interactions:${e}`]=Bs,t)),{})},Ws={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search(t){for(const e of Ws.methodOrder){const n=Ws[e](t);if(n)return n}return null},simulationResume({pointerType:t,eventType:e,eventTarget:n,scope:i}){if(!/down|start/i.test(e))return null;for(const e of i.interactions.list){let i=n;if(e.simulation&&e.simulation.allowResume&&e.pointerType===t)for(;i;){if(i===e.element)return e;i=es(i)}}return null},mouseOrPen({pointerId:t,pointerType:e,eventType:n,scope:i}){if("mouse"!==e&&"pen"!==e)return null;let r;for(const n of i.interactions.list)if(n.pointerType===e){if(n.simulation&&!Gs(n,t))continue;if(n.interacting())return n;r||(r=n)}if(r)return r;for(const t of i.interactions.list)if(!(t.pointerType!==e||/down/i.test(n)&&t.simulation))return t;return null},hasPointer({pointerId:t,scope:e}){for(const n of e.interactions.list)if(Gs(n,t))return n;return null},idle({pointerType:t,scope:e}){for(const n of e.interactions.list){if(1===n.pointers.length){const t=n.interactable;if(t&&(!t.options.gesture||!t.options.gesture.enabled))continue}else if(n.pointers.length>=2)continue;if(!n.interacting()&&t===n.pointerType)return n}return null}};function Gs(t,e){return t.pointers.some((({id:t})=>t===e))}const Us=Ws,Vs=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function $s(t,e){return function(n){const i=e.interactions.list,r=function(t){return Ro.string(t.pointerType)?t.pointerType:Ro.number(t.pointerType)?[void 0,void 0,"touch","pen","mouse"][t.pointerType]:/touch/.test(t.type||"")||t instanceof Do.Touch?"touch":"mouse"}(n),[o,s]=As(n),a=[];if(/^touch/.test(n.type)){e.prevTouchTime=e.now();for(const t of n.changedTouches){const i={pointer:t,pointerId:_s(t),pointerType:r,eventType:n.type,eventTarget:o,curEventTarget:s,scope:e},l=Ks(i);a.push([i.pointer,i.eventTarget,i.curEventTarget,l])}}else{let t=!1;if(!zo.supportsPointerEvent&&/mouse/.test(n.type)){for(let e=0;eJo(t,n.downTarget)))||e.removePointer(n.pointer,n.event)}i=Do.PointerEvent?[{type:n.down,listener:r},{type:n.down,listener:e.pointerDown},{type:n.move,listener:e.pointerMove},{type:n.up,listener:e.pointerUp},{type:n.cancel,listener:e.pointerUp}]:[{type:"mousedown",listener:e.pointerDown},{type:"mousemove",listener:e.pointerMove},{type:"mouseup",listener:e.pointerUp},{type:"touchstart",listener:r},{type:"touchstart",listener:e.pointerDown},{type:"touchmove",listener:e.pointerMove},{type:"touchend",listener:e.pointerUp},{type:"touchcancel",listener:e.pointerUp}],i.push({type:"blur",listener(e){for(const n of t.interactions.list)n.documentBlur(e)}}),t.prevTouchTime=0,t.Interaction=class extends Xs{get pointerMoveTolerance(){return t.interactions.pointerMoveTolerance}set pointerMoveTolerance(e){t.interactions.pointerMoveTolerance=e}_now(){return t.now()}},t.interactions={list:[],new(e){e.scopeFire=(e,n)=>t.fire(e,n);const n=new t.Interaction(e);return t.interactions.list.push(n),n},listeners:e,docEvents:i,pointerMoveTolerance:1},t.usePlugin(Hs)},listeners:{"scope:add-document":t=>Qs(t,"add"),"scope:remove-document":t=>Qs(t,"remove"),"interactable:unset":({interactable:t},e)=>{for(let n=e.interactions.list.length-1;n>=0;n--){const i=e.interactions.list[n];i.interactable===t&&(i.stop(),e.fire("interactions:destroy",{interaction:i}),i.destroy(),e.interactions.list.length>2&&e.interactions.list.splice(n,1))}}},onDocSignal:Qs,doOnInteractions:$s,methodNames:Vs},Js=Zs;function ta(t){return t&&t.replace(/\/.*$/,"")}const ea=new class{id=`__interact_scope_${Math.floor(100*Math.random())}`;isInitialized=!1;listenerMaps=[];browser=zo;defaults=Bo(ms);Eventable=Zo;actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}};interactStatic=function(t){const e=(n,i)=>{let r=t.interactables.get(n,i);return r||(r=t.interactables.new(n,i),r.events.global=e.globalEvents),r};return e.getPointerAverage=Ts,e.getTouchBBox=Os,e.getTouchDistance=Ms,e.getTouchAngle=Ds,e.getElementRect=ss,e.getElementClientRect=os,e.matchesSelector=ns,e.closest=ts,e.globalEvents={},e.version="1.10.17",e.scope=t,e.use=function(t,e){return this.scope.usePlugin(t,e),this},e.isSet=function(t,e){return!!this.scope.interactables.get(t,e&&e.context)},e.on=ys((function(t,e,n){if(Ro.string(t)&&-1!==t.search(" ")&&(t=t.trim().split(/ +/)),Ro.array(t)){for(const i of t)this.on(i,e,n);return this}if(Ro.object(t)){for(const n in t)this.on(n,t[n],e);return this}return Ps(t,this.scope.actions)?this.globalEvents[t]?this.globalEvents[t].push(e):this.globalEvents[t]=[e]:this.scope.events.add(this.scope.document,t,e,{options:n}),this}),"The interact.on() method is being deprecated"),e.off=ys((function(t,e,n){if(Ro.string(t)&&-1!==t.search(" ")&&(t=t.trim().split(/ +/)),Ro.array(t)){for(const i of t)this.off(i,e,n);return this}if(Ro.object(t)){for(const n in t)this.off(n,t[n],e);return this}if(Ps(t,this.scope.actions)){let n;t in this.globalEvents&&-1!==(n=this.globalEvents[t].indexOf(e))&&this.globalEvents[t].splice(n,1)}else this.scope.events.remove(this.scope.document,t,e,n);return this}),"The interact.off() method is being deprecated"),e.debug=function(){return this.scope},e.supportsTouch=function(){return zo.supportsTouch},e.supportsPointerEvent=function(){return zo.supportsPointerEvent},e.stop=function(){for(const t of this.scope.interactions.list)t.stop();return this},e.pointerMoveTolerance=function(t){return Ro.number(t)?(this.scope.interactions.pointerMoveTolerance=t,this):this.scope.interactions.pointerMoveTolerance},e.addDocument=function(t,e){this.scope.addDocument(t,e)},e.removeDocument=function(t){this.scope.removeDocument(t)},e}(this);InteractEvent=gs;Interactable;interactables=new Is(this);_win;document;window;documents=[];_plugins={list:[],map:{}};constructor(){const t=this;this.Interactable=class extends Cs{get _defaults(){return t.defaults}set(e){return super.set(e),t.fire("interactable:set",{options:e,interactable:this}),this}unset(){super.unset();const e=t.interactables.list.indexOf(this);e<0||(super.unset(),t.interactables.list.splice(e,1),t.fire("interactable:unset",{interactable:this}))}}}addListeners(t,e){this.listenerMaps.push({id:e,map:t})}fire(t,e){for(const{map:{[t]:n}}of this.listenerMaps)if(n&&!1===n(e,this,t))return!1}onWindowUnload=t=>this.removeDocument(t.target);init(t){return this.isInitialized?this:function(t,e){t.isInitialized=!0,Ro.window(e)&&Io(e);return Do.init(e),zo.init(e),Vo.init(e),t.window=e,t.document=e.document,t.usePlugin(Js),t.usePlugin(Rs),t}(this,t)}pluginIsInstalled(t){return this._plugins.map[t.id]||-1!==this._plugins.list.indexOf(t)}usePlugin(t,e){if(!this.isInitialized)return this;if(this.pluginIsInstalled(t))return this;if(t.id&&(this._plugins.map[t.id]=t),this._plugins.list.push(t),t.install&&t.install(this,e),t.listeners&&t.before){let e=0;const n=this.listenerMaps.length,i=t.before.reduce(((t,e)=>(t[e]=!0,t[ta(e)]=!0,t)),{});for(;e{const{interaction:e,interactable:n,buttons:i}=t,r=n.options.drag;if(r&&r.enabled&&(!e.pointerIsDown||!/mouse|pointer/.test(e.pointerType)||0!=(i&n.options.drag.mouseButtons)))return t.action={name:"drag",axis:"start"===r.lockAxis?r.startAxis:r.lockAxis},!1}},draggable:function(t){return Ro.object(t)?(this.options.drag.enabled=!1!==t.enabled,this.setPerAction("drag",t),this.setOnEvents("drag",t),/^(xy|x|y|start)$/.test(t.lockAxis)&&(this.options.drag.lockAxis=t.lockAxis),/^(xy|x|y)$/.test(t.startAxis)&&(this.options.drag.startAxis=t.startAxis),this):Ro.bool(t)?(this.options.drag.enabled=t,this):this.options.drag},beforeMove:ra,move:oa,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:()=>"move"},aa=sa;function la(t,e,n,i,r,o,s){if(!e)return!1;if(!0===e){const e=Ro.number(o.width)?o.width:o.right-o.left,i=Ro.number(o.height)?o.height:o.bottom-o.top;if(s=Math.min(s,Math.abs(("left"===t||"right"===t?e:i)/2)),e<0&&("left"===t?t="right":"right"===t&&(t="left")),i<0&&("top"===t?t="bottom":"bottom"===t&&(t="top")),"left"===t){const t=e>=0?o.left:o.right;return n.x=0?o.top:o.bottom;return n.y(e>=0?o.right:o.left)-s;if("bottom"===t)return n.y>(i>=0?o.bottom:o.top)-s}return!!Ro.element(i)&&(Ro.element(e)?e===i:is(i,e,r))}function ca({iEvent:t,interaction:e}){if("resize"!==e.prepared.name||!e.resizeAxes)return;const n=t;e.interactable.options.resize.square?("y"===e.resizeAxes?n.delta.x=n.delta.y:n.delta.y=n.delta.x,n.axes="xy"):(n.axes=e.resizeAxes,"x"===e.resizeAxes?n.delta.y=0:"y"===e.resizeAxes&&(n.delta.x=0))}na.use(aa);const ua={id:"actions/resize",before:["actions/drag"],install:function(t){const{actions:e,browser:n,Interactable:i,defaults:r}=t;ua.cursors=function(t){return t.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(n),ua.defaultMargin=n.supportsTouch||n.supportsPointerEvent?20:10,i.prototype.resizable=function(e){return function(t,e,n){if(Ro.object(e))return t.options.resize.enabled=!1!==e.enabled,t.setPerAction("resize",e),t.setOnEvents("resize",e),Ro.string(e.axis)&&/^x$|^y$|^xy$/.test(e.axis)?t.options.resize.axis=e.axis:null===e.axis&&(t.options.resize.axis=n.defaults.actions.resize.axis),Ro.bool(e.preserveAspectRatio)?t.options.resize.preserveAspectRatio=e.preserveAspectRatio:Ro.bool(e.square)&&(t.options.resize.square=e.square),t;if(Ro.bool(e))return t.options.resize.enabled=e,t;return t.options.resize}(this,e,t)},e.map.resize=ua,e.methodDict.resize="resizable",r.actions.resize=ua.defaults},listeners:{"interactions:new":({interaction:t})=>{t.resizeAxes="xy"},"interactions:action-start":t=>{!function({iEvent:t,interaction:e}){if("resize"!==e.prepared.name||!e.prepared.edges)return;const n=t,i=e.rect;e._rects={start:Ho({},i),corrected:Ho({},i),previous:Ho({},i),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},n.edges=e.prepared.edges,n.rect=e._rects.corrected,n.deltaRect=e._rects.delta}(t),ca(t)},"interactions:action-move":t=>{!function({iEvent:t,interaction:e}){if("resize"!==e.prepared.name||!e.prepared.edges)return;const n=t,i=e.interactable.options.resize.invert,r="reposition"===i||"negate"===i,o=e.rect,{start:s,corrected:a,delta:l,previous:c}=e._rects;if(Ho(c,a),r){if(Ho(a,o),"reposition"===i){if(a.top>a.bottom){const t=a.top;a.top=a.bottom,a.bottom=t}if(a.left>a.right){const t=a.left;a.left=a.right,a.right=t}}}else a.top=Math.min(o.top,s.bottom),a.bottom=Math.max(o.bottom,s.top),a.left=Math.min(o.left,s.right),a.right=Math.max(o.right,s.left);a.width=a.right-a.left,a.height=a.bottom-a.top;for(const t in a)l[t]=a[t]-c[t];n.edges=e.prepared.edges,n.rect=a,n.deltaRect=l}(t),ca(t)},"interactions:action-end":function({iEvent:t,interaction:e}){if("resize"!==e.prepared.name||!e.prepared.edges)return;const n=t;n.edges=e.prepared.edges,n.rect=e._rects.corrected,n.deltaRect=e._rects.delta},"auto-start:check":function(t){const{interaction:e,interactable:n,element:i,rect:r,buttons:o}=t;if(!r)return;const s=Ho({},e.coords.cur.page),a=n.options.resize;if(a&&a.enabled&&(!e.pointerIsDown||!/mouse|pointer/.test(e.pointerType)||0!=(o&a.mouseButtons))){if(Ro.object(a.edges)){const n={left:!1,right:!1,top:!1,bottom:!1};for(const t in n)n[t]=la(t,a.edges[t],s,e._latestPointer.eventTarget,i,r,a.margin||ua.defaultMargin);n.left=n.left&&!n.right,n.top=n.top&&!n.bottom,(n.left||n.right||n.top||n.bottom)&&(t.action={name:"resize",edges:n})}else{const e="y"!==a.axis&&s.x>r.right-ua.defaultMargin,n="x"!==a.axis&&s.y>r.bottom-ua.defaultMargin;(e||n)&&(t.action={name:"resize",axes:(e?"x":"")+(n?"y":"")})}return!t.action&&void 0}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor({edges:t,axis:e,name:n}){const i=ua.cursors;let r=null;if(e)r=i[n+e];else if(t){let e="";for(const n of["top","bottom","left","right"])t[n]&&(e+=n);r=i[e]}return r},defaultMargin:null},ha=ua;na.use(ha);const pa=()=>{},da=()=>{},fa=t=>{const e=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter((([e,n])=>e in t||n in t)),n=(n,i)=>{const{range:r,limits:o={left:-1/0,right:1/0,top:-1/0,bottom:1/0},offset:s={x:0,y:0}}=t,a={range:r,grid:t,x:null,y:null};for(const[r,l]of e){const e=Math.round((n-s.x)/t[r]),c=Math.round((i-s.y)/t[l]);a[r]=Math.max(o.left,Math.min(o.right,e*t[r]+s.x)),a[l]=Math.max(o.top,Math.min(o.bottom,c*t[l]+s.y))}return a};return n.grid=t,n.coordFields=e,n},ma={id:"snappers",install(t){const{interactStatic:n}=t;n.snappers=Ho(n.snappers||{},e),n.createSnapGrid=n.snappers.grid}},ga=ma;class ya{states=[];startOffset={left:0,right:0,top:0,bottom:0};startDelta;result;endResult;edges;interaction;constructor(t){this.interaction=t,this.result=va()}start({phase:t},e){const{interaction:n}=this,i=function(t){const e=t.interactable.options[t.prepared.name],n=e.modifiers;if(n&&n.length)return n;return["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map((t=>{const n=e[t];return n&&n.enabled&&{options:n,methods:n._methods}})).filter((t=>!!t))}(n);this.prepareStates(i),this.edges=Ho({},n.edges),this.startOffset=function(t,e){return t?{left:e.x-t.left,top:e.y-t.top,right:t.right-e.x,bottom:t.bottom-e.y}:{left:0,top:0,right:0,bottom:0}}(n.rect,e),this.startDelta={x:0,y:0};const r=this.fillArg({phase:t,pageCoords:e,preEnd:!1});this.result=va(),this.startAll(r);return this.result=this.setAll(r)}fillArg(t){const{interaction:e}=this;return t.interaction=e,t.interactable=e.interactable,t.element=e.element,t.rect=t.rect||e.rect,t.edges=this.edges,t.startOffset=this.startOffset,t}startAll(t){for(const e of this.states)e.methods.start&&(t.state=e,e.methods.start(t))}setAll(t){const{phase:e,preEnd:n,skipModifiers:i,rect:r}=t;t.coords=Ho({},t.pageCoords),t.rect=Ho({},r);const o=i?this.states.slice(i):this.states,s=va(t.coords,t.rect);for(const i of o){var a;const{options:r}=i,o=Ho({},t.coords);let l=null;null!=(a=i.methods)&&a.set&&this.shouldDo(r,n,e)&&(t.state=i,l=i.methods.set(t),hs(this.interaction.edges,t.rect,{x:t.coords.x-o.x,y:t.coords.y-o.y})),s.eventProps.push(l)}s.delta.x=t.coords.x-t.pageCoords.x,s.delta.y=t.coords.y-t.pageCoords.y,s.rectDelta.left=t.rect.left-r.left,s.rectDelta.right=t.rect.right-r.right,s.rectDelta.top=t.rect.top-r.top,s.rectDelta.bottom=t.rect.bottom-r.bottom;const l=this.result.coords,c=this.result.rect;if(l&&c){const t=s.rect.left!==c.left||s.rect.right!==c.right||s.rect.top!==c.top||s.rect.bottom!==c.bottom;s.changed=t||l.x!==s.coords.x||l.y!==s.coords.y}return s}applyToInteraction(t){const{interaction:e}=this,{phase:n}=t,i=e.coords.cur,r=e.coords.start,{result:o,startDelta:s}=this,a=o.delta;"start"===n&&Ho(this.startDelta,o.delta);for(const[t,e]of[[r,s],[i,a]])t.page.x+=e.x,t.page.y+=e.y,t.client.x+=e.x,t.client.y+=e.y;const{rectDelta:l}=this.result,c=t.rect||e.rect;c.left+=l.left,c.right+=l.right,c.top+=l.top,c.bottom+=l.bottom,c.width=c.right-c.left,c.height=c.bottom-c.top}setAndApply(t){const{interaction:e}=this,{phase:n,preEnd:i,skipModifiers:r}=t,o=this.setAll(this.fillArg({preEnd:i,phase:n,pageCoords:t.modifiedCoords||e.coords.cur.page}));if(this.result=o,!o.changed&&(!r||rBo(t))),this.result=va(Ho({},t.result.coords),Ho({},t.result.rect))}destroy(){for(const t in this)this[t]=null}}function va(t,e){return{rect:e,coords:t,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function ba(t,e){const{defaults:n}=t,i={start:t.start,set:t.set,beforeEnd:t.beforeEnd,stop:t.stop},r=t=>{const r=t||{};r.enabled=!1!==r.enabled;for(const t in n)t in r||(r[t]=n[t]);const o={options:r,methods:i,name:e,enable:()=>(r.enabled=!0,o),disable:()=>(r.enabled=!1,o)};return o};return e&&"string"==typeof e&&(r._defaults=n,r._methods=i),r}function wa({iEvent:t,interaction:e}){const n=e.modification.result;n&&(t.modifiers=n.eventProps)}const xa={id:"modifiers/base",before:["actions"],install:t=>{t.defaults.perAction.modifiers=[]},listeners:{"interactions:new":({interaction:t})=>{t.modification=new ya(t)},"interactions:before-action-start":t=>{const e=t.interaction.modification;e.start(t,t.interaction.coords.start.page),t.interaction.edges=e.edges,e.applyToInteraction(t)},"interactions:before-action-move":t=>t.interaction.modification.setAndApply(t),"interactions:before-action-end":t=>t.interaction.modification.beforeEnd(t),"interactions:action-start":wa,"interactions:action-move":wa,"interactions:action-end":wa,"interactions:after-action-start":t=>t.interaction.modification.restoreInteractionCoords(t),"interactions:after-action-move":t=>t.interaction.modification.restoreInteractionCoords(t),"interactions:stop":t=>t.interaction.modification.stop(t)}},_a=xa,Sa={start(t){const{state:e,rect:n,edges:i,pageCoords:r}=t;let{ratio:o}=e.options;const{equalDelta:s,modifiers:a}=e.options;"preserve"===o&&(o=n.width/n.height),e.startCoords=Ho({},r),e.startRect=Ho({},n),e.ratio=o,e.equalDelta=s;const l=e.linkedEdges={top:i.top||i.left&&!i.bottom,left:i.left||i.top&&!i.right,bottom:i.bottom||i.right&&!i.top,right:i.right||i.bottom&&!i.left};if(e.xIsPrimaryAxis=!(!i.left&&!i.right),e.equalDelta){const t=(l.left?1:-1)*(l.top?1:-1);e.edgeSign={x:t,y:t}}else e.edgeSign={x:l.left?-1:1,y:l.top?-1:1};if(Ho(t.edges,l),!a||!a.length)return;const c=new ya(t.interaction);c.copyFrom(t.interaction.modification),c.prepareStates(a),e.subModification=c,c.startAll({...t})},set(t){const{state:e,rect:n,coords:i}=t,r=Ho({},i),o=e.equalDelta?Ea:Ta;if(o(e,e.xIsPrimaryAxis,i,n),!e.subModification)return null;const s=Ho({},n);hs(e.linkedEdges,s,{x:i.x-r.x,y:i.y-r.y});const a=e.subModification.setAll({...t,rect:s,edges:e.linkedEdges,pageCoords:i,prevCoords:i,prevRect:s}),{delta:l}=a;if(a.changed){o(e,Math.abs(l.x)>Math.abs(l.y),a.coords,a.rect),Ho(i,a.coords)}return a.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function Ea({startCoords:t,edgeSign:e},n,i){n?i.y=t.y+(i.x-t.x)*e.y:i.x=t.x+(i.y-t.y)*e.x}function Ta({startRect:t,startCoords:e,ratio:n,edgeSign:i},r,o,s){if(r){const r=s.width/n;o.y=e.y+(r-t.height)*i.y}else{const r=s.height*n;o.x=e.x+(r-t.width)*i.x}}const Oa=ba(Sa,"aspectRatio"),Ma=()=>{};Ma._defaults={};const Da=Ma;function Aa(t,e,n){return Ro.func(t)?ls(t,e.interactable,e.element,[n.x,n.y,e]):ls(t,e.interactable,e.element)}const Pa={start:function({rect:t,startOffset:e,state:n,interaction:i,pageCoords:r}){const{options:o}=n,{elementRect:s}=o,a=Ho({left:0,top:0,right:0,bottom:0},o.offset||{});if(t&&s){const n=Aa(o.restriction,i,r);if(n){const e=n.right-n.left-t.width,i=n.bottom-n.top-t.height;e<0&&(a.left+=e,a.right+=e),i<0&&(a.top+=i,a.bottom+=i)}a.left+=e.left-t.width*s.left,a.top+=e.top-t.height*s.top,a.right+=e.right-t.width*(1-s.right),a.bottom+=e.bottom-t.height*(1-s.bottom)}n.offset=a},set:function({coords:t,interaction:e,state:n}){const{options:i,offset:r}=n,o=Aa(i.restriction,e,t);if(!o)return;const s=function(t){return!t||"left"in t&&"top"in t||((t=Ho({},t)).left=t.x||0,t.top=t.y||0,t.right=t.right||t.left+t.width,t.bottom=t.bottom||t.top+t.height),t}(o);t.x=Math.max(Math.min(s.right-r.right,t.x),s.left+r.left),t.y=Math.max(Math.min(s.bottom-r.bottom,t.y),s.top+r.top)},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},Ca=ba(Pa,"restrict"),Ia={top:1/0,left:1/0,bottom:-1/0,right:-1/0},ka={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function ja(t,e){for(const n of["top","left","bottom","right"])n in t||(t[n]=e[n]);return t}const Na={noInner:Ia,noOuter:ka,start:function({interaction:t,startOffset:e,state:n}){const{options:i}=n;let r;if(i){r=cs(Aa(i.offset,t,t.coords.start.page))}r=r||{x:0,y:0},n.offset={top:r.y+e.top,left:r.x+e.left,bottom:r.y-e.bottom,right:r.x-e.right}},set:function({coords:t,edges:e,interaction:n,state:i}){const{offset:r,options:o}=i;if(!e)return;const s=Ho({},t),a=Aa(o.inner,n,s)||{},l=Aa(o.outer,n,s)||{};ja(a,Ia),ja(l,ka),e.top?t.y=Math.min(Math.max(l.top+r.top,s.y),a.top+r.top):e.bottom&&(t.y=Math.max(Math.min(l.bottom+r.bottom,s.y),a.bottom+r.bottom)),e.left?t.x=Math.min(Math.max(l.left+r.left,s.x),a.left+r.left):e.right&&(t.x=Math.max(Math.min(l.right+r.right,s.x),a.right+r.right))},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},Ra=ba(Na,"restrictEdges"),qa=Ho({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(t){}},Pa.defaults),za=ba({start:Pa.start,set:Pa.set,defaults:qa},"restrictRect"),Fa={width:-1/0,height:-1/0},La={width:1/0,height:1/0};const Xa={start:function(t){return Na.start(t)},set:function(t){const{interaction:e,state:n,rect:i,edges:r}=t,{options:o}=n;if(!r)return;const s=us(Aa(o.min,e,t.coords))||Fa,a=us(Aa(o.max,e,t.coords))||La;n.options={endOnly:o.endOnly,inner:Ho({},Na.noInner),outer:Ho({},Na.noOuter)},r.top?(n.options.inner.top=i.bottom-s.height,n.options.outer.top=i.bottom-a.height):r.bottom&&(n.options.inner.bottom=i.top+s.height,n.options.outer.bottom=i.top+a.height),r.left?(n.options.inner.left=i.right-s.width,n.options.outer.left=i.right-a.width):r.right&&(n.options.inner.right=i.left+s.width,n.options.outer.right=i.left+a.width),Na.set(t),n.options=o},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},Ya=ba(Xa,"restrictSize");const Ba={start:function(t){const{interaction:e,interactable:n,element:i,rect:r,state:o,startOffset:s}=t,{options:a}=o,l=a.offsetWithOrigin?function(t){const{element:e}=t.interaction,n=cs(ls(t.state.options.origin,null,null,[e]));return n||ps(t.interactable,e,t.interaction.prepared.name)}(t):{x:0,y:0};let c;if("startCoords"===a.offset)c={x:e.coords.start.page.x,y:e.coords.start.page.y};else{const t=ls(a.offset,n,i,[e]);c=cs(t)||{x:0,y:0},c.x+=l.x,c.y+=l.y}const{relativePoints:u}=a;o.offsets=r&&u&&u.length?u.map(((t,e)=>({index:e,relativePoint:t,x:s.left-r.width*t.x+c.x,y:s.top-r.height*t.y+c.y}))):[{index:0,relativePoint:null,x:c.x,y:c.y}]},set:function(t){const{interaction:e,coords:n,state:i}=t,{options:r,offsets:o}=i,s=ps(e.interactable,e.element,e.prepared.name),a=Ho({},n),l=[];r.offsetWithOrigin||(a.x-=s.x,a.y-=s.y);for(const t of o){const n=a.x-t.x,i=a.y-t.y;for(let o=0,s=r.targets.length;o=a)return!1;if(r.interactable===t){if(c+=i===n.name?1:0,c>=o)return!1;if(r.element===e&&(u++,i===n.name&&u>=s))return!1}}}return a>0}function ol(t,e){return Ro.number(t)?(e.autoStart.maxInteractions=t,this):e.autoStart.maxInteractions}function sl(t,e,n){const{cursorElement:i}=n.autoStart;i&&i!==t&&(i.style.cursor=""),t.ownerDocument.documentElement.style.cursor=e,t.style.cursor=e,n.autoStart.cursorElement=e?t:null}function al(t,e){const{interactable:n,element:i,prepared:r}=t;if("mouse"!==t.pointerType||!n||!n.options.styleCursor)return void(e.autoStart.cursorElement&&sl(e.autoStart.cursorElement,"",e));let o="";if(r.name){const s=n.options[r.name].cursorChecker;o=Ro.func(s)?s(r,n,i,t._interacting):e.actions.map[r.name].getCursor(r)}sl(t.element,o||"",e)}const ll={id:"auto-start/base",before:["actions"],install:function(t){const{interactStatic:e,defaults:n}=t;t.usePlugin(Ja),n.base.actionChecker=null,n.base.styleCursor=!0,Ho(n.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),e.maxInteractions=e=>ol(e,t),t.autoStart={maxInteractions:1/0,withinInteractionLimit:rl,cursorElement:null}},listeners:{"interactions:down":function({interaction:t,pointer:e,event:n,eventTarget:i},r){if(t.interacting())return;il(t,nl(t,e,n,i,r),r)},"interactions:move":(t,e)=>{!function({interaction:t,pointer:e,event:n,eventTarget:i},r){if("mouse"!==t.pointerType||t.pointerIsDown||t.interacting())return;il(t,nl(t,e,n,i,r),r)}(t,e),function(t,e){const{interaction:n}=t;if(!n.pointerIsDown||n.interacting()||!n.pointerWasMoved||!n.prepared.name)return;e.fire("autoStart:before-start",t);const{interactable:i}=n,r=n.prepared.name;r&&i&&(i.options[r].manualStart||!rl(i,n.element,n.prepared,e)?n.stop():(n.start(n.prepared,i,n.element),al(n,e)))}(t,e)},"interactions:stop":function({interaction:t},e){const{interactable:n}=t;n&&n.options.styleCursor&&sl(t.element,"",e)}},maxInteractions:ol,withinInteractionLimit:rl,validateAction:tl},cl=ll;const ul={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function({interaction:t,eventTarget:e,dx:n,dy:i},r){if("drag"!==t.prepared.name)return;const o=Math.abs(n),s=Math.abs(i),a=t.interactable.options.drag,l=a.startAxis,c=o>s?"x":o{t.autoStartHoldTimer=null},"autoStart:prepared":({interaction:t})=>{const e=hl(t);e>0&&(t.autoStartHoldTimer=setTimeout((()=>{t.start(t.prepared,t.interactable,t.element)}),e))},"interactions:move":({interaction:t,duplicate:e})=>{t.autoStartHoldTimer&&t.pointerWasMoved&&!e&&(clearTimeout(t.autoStartHoldTimer),t.autoStartHoldTimer=null)},"autoStart:before-start":({interaction:t})=>{hl(t)>0&&(t.prepared.name=null)}},getHoldDuration:hl},dl=pl,fl={id:"auto-start",install(t){t.usePlugin(cl),t.usePlugin(dl),t.usePlugin(ul)}};function ml(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function gl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var yl;na.use(fl),function(){function t(t,e,n){this.el=t,t.remember("_paintHandler",this);var i=this,r=this.getPlugin();for(var o in this.parent=t.parent(),this.p=this.parent.node.createSVGPoint(),this.m=null,this.startPoint=null,this.lastUpdateCall=null,this.options={},this.set=new Set,this.el.draw.defaults)this.options[o]=this.el.draw.defaults[o],void 0!==n[o]&&(this.options[o]=n[o]);for(var o in r.point&&(r.pointPlugin=r.point,delete r.point),r)this[o]=r[o];e||this.parent.on("click.draw",(function(t){i.start(t)}))}t.prototype.transformPoint=function(t,e){return this.p.x=t-(this.offset.x-window.pageXOffset),this.p.y=e-(this.offset.y-window.pageYOffset),this.p.matrixTransform(this.m)},t.prototype.start=function(t){var e=this;this.m=this.el.node.getScreenCTM().inverse(),this.offset={x:window.pageXOffset,y:window.pageYOffset},this.options.snapToGrid*=Math.sqrt(this.m.a*this.m.a+this.m.b*this.m.b),this.startPoint=this.snapToGrid(this.transformPoint(t.clientX,t.clientY)),this.init&&this.init(t),this.el.fire("drawstart",{event:t,p:this.p,m:this.m}),xt(window,"mousemove.draw",(function(t){e.update(t)})),this.start=this.point},t.prototype.point=function(t){return this.point!=this.start?this.start(t):this.pointPlugin?this.pointPlugin(t):void this.stop(t)},t.prototype.stop=function(t){t&&this.update(t),this.clean&&this.clean(),_t(window,"mousemove.draw"),this.parent.off("click.draw"),this.el.forget("_paintHandler"),this.el.draw=function(){},this.el.fire("drawstop")},t.prototype.update=function(t){!t&&this.lastUpdateCall&&(t=this.lastUpdateCall),this.lastUpdateCall=t,this.m=this.el.node.getScreenCTM().inverse(),this.calc(t),this.el.fire("drawupdate",{event:t,p:this.p,m:this.m})},t.prototype.done=function(){this.calc(),this.stop(),this.el.fire("drawdone")},t.prototype.cancel=function(){this.stop(),this.el.remove(),this.el.fire("drawcancel")},t.prototype.snapToGrid=function(t){var e=null;if(t.length)return e=[t[0]%this.options.snapToGrid,t[1]%this.options.snapToGrid],t[0]-=e[0]-1){var e=this.transformPoint(t.clientX,t.clientY),n=this.el.array().valueOf();return n.push(this.snapToGrid([e.x,e.y])),this.el.plot(n),this.drawCircles(),void this.el.fire("drawpoint",{event:t,p:{x:e.x,y:e.y},m:this.m})}this.stop(t)},clean:function(){this.set.forEach((function(t){t.remove()})),this.set.clear(),delete this.set},drawCircles:function(){var t=this.el.array().valueOf();this.set.forEach((function(t){t.remove()})),this.set.clear();for(var e=0;e');var s=e.querySelector("area:last-child");t.querySelectorAll(".imagemap-area-input").forEach((function(t){return Dl(t,s)})),t.querySelectorAll('select[data-prop="shape"], input[data-prop="coords"]').forEach((function(e){var i=e.onchange;e.onchange=function(){i(),Hl(t,n)}}));var a=t.querySelector("select.imagemap-area-target");a.onchange=function(){return t.querySelector(".imagemap-area-anchor").hidden="embed"!==a.value},"external"===i.value&&(a.querySelector('option[value="embed"]').hidden=!0,a.querySelector('option[value="popin"]').hidden=!0),Hl(t,n)},Dl=function(t,e){var n=t.dataset.prop;t.onchange=function(){return e[n]=t.value},t.onchange()},Al=function(t,e){var n=t.parentNode;e.findOne('*[data-uuid="'.concat(t.dataset.uuid,'"]')).remove(),t.remove(),Cl(n)},Pl=function(t,e,n,i){t.insertAdjacentHTML("beforeend",e.replace(/__name__/g,100)),Cl(t),Ml(t.querySelector(".imagemap-area:last-child"),n,i)},Cl=function(t){t.querySelectorAll(".imagemap-area").forEach((function(t,e){t.querySelectorAll("*[name]").forEach((function(t){return t.name=t.name.replace(/\[map]\[\d+]/g,"[map]["+e+"]")}))}))},Il=function(t){var e=t.querySelector(".imagemap-relation-internal"),n=t.querySelector(".imagemap-relation-external"),i=t.querySelector(".imagemap-relation-source"),r=t.querySelector(".imagemap-area-target");i.value="","internal"===this.value?(e.hidden=!1,e.querySelector(".imagemap-relation-name").textContent="",n.hidden=!0,"embed"!==r.value&&"popin"!==r.value||(r.value="_blank"),r.querySelector('option[value="embed"]').hidden=!0,r.querySelector('option[value="popin"]').hidden=!0):(n.hidden=!1,n.querySelector(".imagemap-relation-external-link").value="",e.hidden=!0,r.querySelector('option[value="embed"]').hidden=!1,r.querySelector('option[value="popin"]').hidden=!1)},kl=function(t,e,n){t.querySelector(".imagemap-relation-source").value="ezobject://"+n[0].ContentInfo.Content._id,t.querySelector(".imagemap-relation-name").textContent=n[0].ContentInfo.Content.TranslatedName,i().unmountComponentAtNode(e)},jl=function(t,e){var n=document.querySelector("#react-udw"),r=document.querySelector('meta[name="CSRF-Token"]').content,o=document.querySelector('meta[name="SiteAccess"]').content;i().render(React.createElement(eZ.modules.UniversalDiscovery,function(t){for(var e=1;e{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{edgeTarget:()=>pa,elements:()=>da,grid:()=>fa});const n=ReactDOM;var i=t.n(n);const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let o;const s=new Uint8Array(16);function a(){if(!o&&(o="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!o))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(s)}const l=[];for(let t=0;t<256;++t)l.push((t+256).toString(16).slice(1));function c(t,e=0){return(l[t[e+0]]+l[t[e+1]]+l[t[e+2]]+l[t[e+3]]+"-"+l[t[e+4]]+l[t[e+5]]+"-"+l[t[e+6]]+l[t[e+7]]+"-"+l[t[e+8]]+l[t[e+9]]+"-"+l[t[e+10]]+l[t[e+11]]+l[t[e+12]]+l[t[e+13]]+l[t[e+14]]+l[t[e+15]]).toLowerCase()}const u=function(t,e,n){if(r.randomUUID&&!e&&!t)return r.randomUUID();const i=(t=t||{}).random||(t.rng||a)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=i[t];return e}return c(i)},h={},p=[];function d(t,e){if(Array.isArray(t))for(const n of t)d(n,e);else if("object"!=typeof t)m(Object.getOwnPropertyNames(e)),h[t]=Object.assign(h[t]||{},e);else for(const e in t)d(e,t[e])}function f(t){return h[t]||{}}function m(t){p.push(...t)}function g(t,e){let n;const i=t.length,r=[];for(n=0;n=0;e--)X(t.children[e]);return t.id?(t.id=L(t.nodeName),t):t}function Y(t,e){let n,i;for(i=(t=Array.isArray(t)?t:[t]).length-1;i>=0;i--)for(n in e)t[i].prototype[n]=e[n]}function B(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}d("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=j(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=j(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=j(t)).before(this),this},insertAfter:function(t){return(t=j(t)).after(this),this}});const H=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,W=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,G=/rgb\((\d+),(\d+),(\d+)\)/,U=/(#[a-z_][a-z0-9\-_]*)/i,V=/\)\s*,?\s*/,$=/\s/g,K=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,Q=/^rgb\(/,Z=/^(\s+)?$/,J=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,tt=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,et=/[\s,]+/,nt=/[MLHVCSQTAZ]/i;function it(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function rt(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function ot(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}d("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(et)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),d("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=b(e);n[e]=this.node.style[t]}return n}if("string"==typeof t)return this.node.style[b(t)];if("object"==typeof t)for(const e in t)this.node.style[b(e)]=null==t[e]||Z.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[b(t)]=null==e||Z.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),d("Dom",{data:function(t,e,n){if(null==t)return this.data(g(y(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),d("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class st{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof st||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e,n){const{random:i,round:r,sin:o,PI:s}=Math;if("vibrant"===t){const t=24*i()+57,e=38*i()+45,n=360*i();return new st(t,e,n,"lch")}if("sine"===t){const t=r(80*o(2*s*(e=null==e?i():e)/.5+.01)+150),n=r(50*o(2*s*e/.5+4.6)+200),a=r(100*o(2*s*e/.5+2.3)+150);return new st(t,n,a)}if("pastel"===t){const t=8*i()+86,e=17*i()+9,n=360*i();return new st(t,e,n,"lch")}if("dark"===t){const t=10+10*i(),e=50*i()+86,n=360*i();return new st(t,e,n,"lch")}if("rgb"===t){const t=255*i(),e=255*i(),n=255*i();return new st(t,e,n)}if("lab"===t){const t=100*i(),e=256*i()-128,n=256*i()-128;return new st(t,e,n,"lab")}if("grey"===t){const t=255*i();return new st(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(K.test(t)||Q.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[i,r,o]=[t,e,n].map((t=>t/255)),s=Math.min(1-i,1-r,1-o);if(1===s)return new st(0,0,0,1,"cmyk");return new st((1-i-s)/(1-s),(1-r-s)/(1-s),(1-o-s)/(1-s),s,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[i,r,o]=[t,e,n].map((t=>t/255)),s=Math.max(i,r,o),a=Math.min(i,r,o),l=(s+a)/2,c=s===a,u=s-a;return new st(360*(c?0:s===i?((r-o)/u+(r.5?u/(2-s-a):u/(s+a)),100*l,"hsl")}init(t=0,e=0,n=0,i=0,r="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)r="string"==typeof i?i:r,i="string"==typeof i?0:i,Object.assign(this,{_a:t,_b:e,_c:n,_d:i,space:r});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=rt(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:rt(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:rt(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:rt(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:rt(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:rt(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(Q.test(t)){const e=t.replace($,""),[n,i,r]=G.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:i,_c:r,_d:0,space:"rgb"})}else{if(!K.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,i,r]=W.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:n,_b:i,_c:r,_d:0,space:"rgb"})}}const{_a:o,_b:s,_c:a,_d:l}=this,c="rgb"===this.space?{r:o,g:s,b:a}:"xyz"===this.space?{x:o,y:s,z:a}:"hsl"===this.space?{h:o,s,l:a}:"lab"===this.space?{l:o,a:s,b:a}:"lch"===this.space?{l:o,c:s,h:a}:"cmyk"===this.space?{c:o,m:s,y:a,k:l}:{};Object.assign(this,c)}lab(){const{x:t,y:e,z:n}=this.xyz();return new st(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),i=Math.sqrt(e**2+n**2);let r=180*Math.atan2(n,e)/Math.PI;r<0&&(r*=-1,r=360-r);return new st(t,i,r,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:i,a:r,b:o}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;r=t*Math.cos(n*e),o=t*Math.sin(n*e)}const s=(i+16)/116,a=r/500+s,l=s-o/200,c=16/116,u=.008856,h=7.787;t=.95047*(a**3>u?a**3:(a-c)/h),e=1*(s**3>u?s**3:(s-c)/h),n=1.08883*(l**3>u?l**3:(l-c)/h)}const i=3.2406*t+-1.5372*e+-.4986*n,r=-.9689*t+1.8758*e+.0415*n,o=.0557*t+-.204*e+1.057*n,s=Math.pow,a=.0031308,l=i>a?1.055*s(i,1/2.4)-.055:12.92*i,c=r>a?1.055*s(r,1/2.4)-.055:12.92*r,u=o>a?1.055*s(o,1/2.4)-.055:12.92*o;return new st(255*l,255*c,255*u)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e){n*=255;return new st(n,n,n)}const i=n<.5?n*(1+e):n+e-n*e,r=2*n-i,o=255*ot(r,i,t+1/3),s=255*ot(r,i,t),a=255*ot(r,i,t-1/3);return new st(o,s,a)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:i}=this,r=255*(1-Math.min(1,t*(1-i)+i)),o=255*(1-Math.min(1,e*(1-i)+i)),s=255*(1-Math.min(1,n*(1-i)+i));return new st(r,o,s)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:i,space:r}=this;return[t,e,n,i,r]}toHex(){const[t,e,n]=this._clamped().map(it);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[i,r,o]=[t,e,n].map((t=>t/255)),s=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,a=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,l=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,c=(.4124*s+.3576*a+.1805*l)/.95047,u=(.2126*s+.7152*a+.0722*l)/1,h=(.0193*s+.1192*a+.9505*l)/1.08883,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116,d=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116;return new st(p,d,f,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:i,min:r,round:o}=Math;return[t,e,n].map((t=>i(0,r(o(t),255))))}}class at{constructor(...t){this.init(...t)}clone(){return new at(this)}init(t,e){const n=0,i=0,r=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?n:r.x,this.y=null==r.y?i:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){ct.isMatrixLike(t)||(t=new ct(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function lt(t,e,n){return Math.abs(e-t)<(n||1e-6)}class ct{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,i=t.flip&&(e||"y"===t.flip)?-1:1,r=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,o=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,s=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,a=t.scale&&t.scale.length?t.scale[1]*i:isFinite(t.scale)?t.scale*i:isFinite(t.scaleY)?t.scaleY*i:i,l=t.shear||0,c=t.rotate||t.theta||0,u=new at(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),h=u.x,p=u.y,d=new at(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),f=d.x,m=d.y,g=new at(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,v=g.y,b=new at(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:s,scaleY:a,skewX:r,skewY:o,shear:l,theta:c,rx:b.x,ry:b.y,tx:y,ty:v,ox:h,oy:p,px:f,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const i=t.a*e.a+t.c*e.b,r=t.b*e.a+t.d*e.b,o=t.a*e.c+t.c*e.d,s=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,l=t.f+t.b*e.e+t.d*e.f;return n.a=i,n.b=r,n.c=o,n.d=s,n.e=a,n.f=l,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const i=t||0,r=e||0;return this.translateO(-i,-r).lmultiplyO(n).translateO(i,r)}clone(){return new ct(this)}decompose(t=0,e=0){const n=this.a,i=this.b,r=this.c,o=this.d,s=this.e,a=this.f,l=n*o-i*r,c=l>0?1:-1,u=c*Math.sqrt(n*n+i*i),h=Math.atan2(c*i,c*n),p=180/Math.PI*h,d=Math.cos(h),f=Math.sin(h),m=(n*r+i*o)/l,g=r*u/(m*n-i)||o*u/(m*i+n);return{scaleX:u,scaleY:g,shear:m,rotate:p,translateX:s-t+t*d*u+e*(m*d*u-f*g),translateY:a-e+t*f*u+e*(m*f*u+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new ct(t);return lt(this.a,e.a)&<(this.b,e.b)&<(this.c,e.c)&<(this.d,e.d)&<(this.e,e.e)&<(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=ct.fromArray([1,0,0,1,0,0]);return t=t instanceof Ct?t.matrixify():"string"==typeof t?ct.fromArray(t.split(et).map(parseFloat)):Array.isArray(t)?ct.fromArray(t):"object"==typeof t&&ct.isMatrixLike(t)?t:"object"==typeof t?(new ct).transform(t):6===arguments.length?ct.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,o=this.f,s=t*i-e*n;if(!s)throw new Error("Cannot invert "+this);const a=i/s,l=-e/s,c=-n/s,u=t/s,h=-(a*r+c*o),p=-(l*r+u*o);return this.a=a,this.b=l,this.c=c,this.d=u,this.e=h,this.f=p,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof ct?t:new ct(t);return ct.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof ct?t:new ct(t);return ct.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=v(t);const i=Math.cos(t),r=Math.sin(t),{a:o,b:s,c:a,d:l,e:c,f:u}=this;return this.a=o*i-s*r,this.b=s*i+o*r,this.c=a*i-l*r,this.d=l*i+a*r,this.e=c*i-u*r+n*r-e*i+e,this.f=u*i+c*r-e*r-n*i+n,this}scale(t,e,n,i){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,i=0){3===arguments.length&&(i=n,n=e,e=t);const{a:r,b:o,c:s,d:a,e:l,f:c}=this;return this.a=r*t,this.b=o*e,this.c=s*t,this.d=a*e,this.e=l*t-n*t+n,this.f=c*e-i*e+i,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:i,b:r,c:o,d:s,e:a,f:l}=this;return this.a=i+r*t,this.c=o+s*t,this.e=a+l*t-n*t,this}skew(t,e,n,i){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,i=0){3===arguments.length&&(i=n,n=e,e=t),t=v(t),e=v(e);const r=Math.tan(t),o=Math.tan(e),{a:s,b:a,c:l,d:c,e:u,f:h}=this;return this.a=s+a*r,this.b=a+s*o,this.c=l+c*r,this.d=c+l*o,this.e=u+h*r-i*r,this.f=h+u*o-n*o,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(ct.isMatrixLike(t)){return new ct(t).multiplyO(this)}const e=ct.formatTransforms(t),{x:n,y:i}=new at(e.ox,e.oy).transform(this),r=(new ct).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-i).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,i);if(isFinite(e.px)||isFinite(e.py)){const t=new at(n,i).transform(r),o=isFinite(e.px)?e.px-t.x:0,s=isFinite(e.py)?e.py-t.y:0;r.translateO(o,s)}return r.translateO(e.tx,e.ty),r}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function ut(){if(!ut.nodes){const t=j().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;ut.nodes={svg:t,path:e}}if(!ut.nodes.svg.node.parentNode){const t=A.document.body||A.document.documentElement;ut.nodes.svg.addTo(t)}return ut.nodes}function ht(t){return!(t.width||t.height||t.x||t.y)}z(ct,"Matrix");class pt{constructor(...t){this.init(...t)}addOffset(){return this.x+=A.window.pageXOffset,this.y+=A.window.pageYOffset,new pt(this)}init(t){return t="string"==typeof t?t.split(et).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return ht(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),i=Math.max(this.x+this.width,t.x+t.width)-e,r=Math.max(this.y+this.height,t.y+t.height)-n;return new pt(e,n,i,r)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof ct||(t=new ct(t));let e=1/0,n=-1/0,i=1/0,r=-1/0;return[new at(this.x,this.y),new at(this.x2,this.y),new at(this.x,this.y2),new at(this.x2,this.y2)].forEach((function(o){o=o.transform(t),e=Math.min(e,o.x),n=Math.max(n,o.x),i=Math.min(i,o.y),r=Math.max(r,o.y)})),new pt(e,i,n-e,r-i)}}function dt(t,e,n){let i;try{if(i=e(t.node),ht(i)&&((r=t.node)!==A.document&&!(A.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===A.document}).call(A.document.documentElement,r)))throw new Error("Element not in the dom")}catch(e){i=n(t)}var r;return i}d({viewbox:{viewbox(t,e,n,i){return null==t?new pt(this.attr("viewBox")):this.attr("viewBox",new pt(t,e,n,i))},zoom(t,e){let{width:n,height:i}=this.attr(["width","height"]);if((n||i)&&"string"!=typeof n&&"string"!=typeof i||(n=this.node.clientWidth,i=this.node.clientHeight),!n||!i)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const r=this.viewbox(),o=n/r.width,s=i/r.height,a=Math.min(o,s);if(null==t)return a;let l=a/t;l===1/0&&(l=Number.MAX_SAFE_INTEGER/100),e=e||new at(n/2/o+r.x,i/2/s+r.y);const c=new pt(r).transform(new ct({scale:l,origin:e}));return this.viewbox(c)}}}),z(pt,"Box");class ft extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}Y([ft],{each(t,...e){return"function"==typeof t?this.map(((e,n,i)=>t.call(e,e,n,i))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const mt=["toArray","constructor","each"];function gt(t,e){return new ft(g((e||A.document).querySelectorAll(t),(function(t){return R(t)})))}ft.extend=function(t){t=t.reduce(((t,e)=>(mt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),Y([ft],t)};let yt=0;const vt={};function bt(t){let e=t.getEventHolder();return e===A.window&&(e=vt),e.events||(e.events={}),e.events}function wt(t){return t.getEventTarget()}function xt(t,e,n,i,r){const o=n.bind(i||t),s=j(t),a=bt(s),l=wt(s);e=Array.isArray(e)?e:e.split(et),n._svgjsListenerId||(n._svgjsListenerId=++yt),e.forEach((function(t){const e=t.split(".")[0],i=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][i]=a[e][i]||{},a[e][i][n._svgjsListenerId]=o,l.addEventListener(e,o,r||!1)}))}function _t(t,e,n,i){const r=j(t),o=bt(r),s=wt(r);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(et)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let l,c;if(n)o[e]&&o[e][a||"*"]&&(s.removeEventListener(e,o[e][a||"*"][n],i||!1),delete o[e][a||"*"][n]);else if(e&&a){if(o[e]&&o[e][a]){for(c in o[e][a])_t(s,[e,a].join("."),c);delete o[e][a]}}else if(a)for(t in o)for(l in o[t])a===l&&_t(s,[t,a].join("."));else if(e){if(o[e]){for(l in o[e])_t(s,[e,l].join("."));delete o[e]}}else{for(t in o)_t(s,t);!function(t){let e=t.getEventHolder();e===A.window&&(e=vt),e.events&&(e.events={})}(r)}}))}class St extends P{addEventListener(){}dispatch(t,e,n){return function(t,e,n,i){const r=wt(t);return e instanceof A.window.Event||(e=new A.window.CustomEvent(e,{detail:n,cancelable:!0,...i})),r.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const e in n)for(const i in n[e])n[e][i](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return _t(this,t,e,n),this}on(t,e,n,i){return xt(this,t,e,n,i),this}removeEventListener(){}}function Et(){}z(St,"EventTarget");const Tt={duration:400,ease:">",delay:0},Ot={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class Mt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(et).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class Dt{constructor(...t){this.init(...t)}convert(t){return new Dt(this.value,t)}divide(t){return t=new Dt(t),new Dt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(H))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof Dt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new Dt(t),new Dt(this-t,this.unit||t.unit)}plus(t){return t=new Dt(t),new Dt(this+t,this.unit||t.unit)}times(t){return t=new Dt(t),new Dt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const At=[];class Pt extends St{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=j(t)).removeNamespace&&this.node instanceof A.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return j(t).put(this,e)}children(){return new ft(g(this.node.children,(function(t){return R(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0){return this.writeDataToDom(),new this.constructor(X(this.node.cloneNode(t)))}each(t,e){const n=this.children();let i,r;for(i=0,r=n.length;i=0}html(t,e){return this.xml(t,e,T)}id(t){return void 0!==t||this.node.id||(this.node.id=L(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return R(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=R(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=R(e.node.parentNode));return e}put(t,e){return t=j(t),this.add(t,e),t}putIn(t,e){return j(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=j(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,i=this.attr(e);for(const t in i)"number"==typeof i[t]&&(i[t]=Math.round(i[t]*n)/n);return this.attr(i),this}svg(t,e){return this.xml(t,e,E)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=R(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const i=k("wrapper",n),r=A.document.createDocumentFragment();i.innerHTML=t;for(let t=i.children.length;t--;)r.appendChild(i.firstElementChild);const o=this.parent();return e?this.replace(r)&&o:this.add(r)}}Y(Pt,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=J.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?Ot[t]:J.test(e)?parseFloat(e):e;"number"==typeof(e=At.reduce(((e,n)=>n(t,e,this)),e))?e=new Dt(e):st.isColor(e)?e=new st(e):e.constructor===Array&&(e=new Mt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return gt(t,this.node)},findOne:function(t){return R(this.node.querySelector(t))}}),z(Pt,"Dom");class Ct extends Pt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(JSON.parse(t.getAttribute("svgjs:data"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new Dt(t).plus(this.x()))}dy(t=0){return this.y(new Dt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=j(t));const n=new ft;let i=this;for(;(i=i.parent())&&i.node!==A.document&&"#document-fragment"!==i.nodeName&&(n.push(i),e||i.node!==t.node)&&(!e||!i.matches(t));)if(i.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(U);return e?j(e[1]):null}root(){const t=this.parent(C[I]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=_(this,t,e);return this.width(new Dt(n.width)).height(new Dt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}Y(Ct,{bbox:function(){const t=dt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(ut().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new pt(t)},rbox:function(t){const e=dt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new pt(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t=0;n--)null!=e[It[t][n]]&&this.attr(It.prefix(t,It[t][n]),e[It[t][n]]);return this},d(["Element","Runner"],e)})),d(["Element","Runner"],{matrix:function(t,e,n,i,r,o){return null==t?new ct(this):this.attr("transform",new ct(t,e,n,i,r,o))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,i){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:i},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,i){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:i},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),d("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new Dt(t)):this.rx(t).ry(e)}}),d("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new at(this.node.getPointAtLength(t))}}),d(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}});d("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),d("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){const t=(this.attr("transform")||"").split(V).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(et).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(ct.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new ct);return t},toParent:function(t,e){if(this===t)return this;const n=this.screenCTM(),i=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(i.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new ct(this).decompose();return null==t?e:e[t]}ct.isMatrixLike(t)||(t={...t,origin:S(t,this)});const n=new ct(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class kt extends Ct{flatten(t=this,e){return this.each((function(){if(this instanceof kt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,i){return i[i.length-n-1].toParent(t,e)})),this.remove()}}z(kt,"Container");class jt extends kt{constructor(t,e=t){super(N("defs",t),e)}flatten(){return this}ungroup(){return this}}z(jt,"Defs");class Nt extends Ct{}function Rt(t){return this.attr("rx",t)}function qt(t){return this.attr("ry",t)}function zt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Ft(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Lt(t){return this.attr("cx",t)}function Xt(t){return this.attr("cy",t)}function Yt(t){return null==t?2*this.rx():this.rx(new Dt(t).divide(2))}function Bt(t){return null==t?2*this.ry():this.ry(new Dt(t).divide(2))}z(Nt,"Shape");var Ht={__proto__:null,rx:Rt,ry:qt,x:zt,y:Ft,cx:Lt,cy:Xt,width:Yt,height:Bt};class Wt extends Nt{constructor(t,e=t){super(N("ellipse",t),e)}size(t,e){const n=_(this,t,e);return this.rx(new Dt(n.width).divide(2)).ry(new Dt(n.height).divide(2))}}Y(Wt,Ht),d("Container",{ellipse:B((function(t=0,e=t){return this.put(new Wt).size(t,e).move(0,0)}))}),z(Wt,"Ellipse");class Gt extends Pt{constructor(t=A.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new Pt(k("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function Ut(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new Dt(t),fy:new Dt(e)}):this.attr({x1:new Dt(t),y1:new Dt(e)})}function Vt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new Dt(t),cy:new Dt(e)}):this.attr({x2:new Dt(t),y2:new Dt(e)})}z(Gt,"Fragment");var $t,Kt={__proto__:null,from:Ut,to:Vt};class Qt extends kt{constructor(t,e){super(N(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new pt}targets(){return gt('svg [fill*="'+this.id()+'"]')}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return'url("#'+this.id()+'")'}}Y(Qt,Kt),d({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:B((function(t,e){return this.put(new Qt(t)).update(e)}))}}),z(Qt,"Gradient");class Zt extends kt{constructor(t,e=t){super(N("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new pt}targets(){return gt('svg [fill*="'+this.id()+'"]')}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return'url("#'+this.id()+'")'}}d({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:B((function(t,e,n){return this.put(new Zt).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),z(Zt,"Pattern");class Jt extends Nt{constructor(t,e=t){super(N("image",t),e)}load(t,e){if(!t)return this;const n=new A.window.Image;return xt(n,"load",(function(t){const i=this.parent(Zt);0===this.width()&&0===this.height()&&this.size(n.width,n.height),i instanceof Zt&&0===i.width()&&0===i.height()&&i.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),xt(n,"load error",(function(){_t(n)})),this.attr("href",n.src=t,M)}}$t=function(t,e,n){return"fill"!==t&&"stroke"!==t||tt.test(e)&&(e=n.root().defs().image(e)),e instanceof Jt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},At.push($t),d({Container:{image:B((function(t,e){return this.put(new Jt).size(0,0).load(t,e)}))}}),z(Jt,"Image");class te extends Mt{bbox(){let t=-1/0,e=-1/0,n=1/0,i=1/0;return this.forEach((function(r){t=Math.max(r[0],t),e=Math.max(r[1],e),n=Math.min(r[0],n),i=Math.min(r[1],i)})),new pt(n,i,t-n,e-i)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(et).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,i=t.length;n=0;n--)i.width&&(this[n][0]=(this[n][0]-i.x)*t/i.width+i.x),i.height&&(this[n][1]=(this[n][1]-i.y)*e/i.height+i.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,i){return function(r){return r<0?t>0?e/t*r:n>0?i/n*r:0:r>1?n<1?(1-i)/(1-n)*r+(i-n)/(1-n):t<1?(1-e)/(1-t)*r+(e-t)/(1-t):1:3*r*(1-r)**2*e+3*r**2*(1-r)*i+r**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(i,r=!1)=>{let o=Math.floor(i*t);const s=i*o%1==0;return"start"!==e&&"both"!==e||++o,r&&s&&--o,i>=0&&o<0&&(o=0),i<=1&&o>n&&(o=n),o/n}}};class se{done(){return!1}}class ae extends se{constructor(t=Tt.ease){super(),this.ease=oe[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class le extends se{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,i){return this.stepper(t,e,n,i)}}function ce(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,i=Math.log(e/100+1e-10),r=-i/Math.sqrt(n*n+i*i),o=3.9/(r*t);this.d=2*r*o,this.k=o*o}Y(class extends le{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,i){if("string"==typeof t)return t;if(i.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const r=i.velocity||0,o=-this.d*r-this.k*(t-e),s=t+r*n+o*n*n/2;return i.velocity=r+o*n,i.done=Math.abs(e-s)+Math.abs(r)<.002,i.done?e:s}},{duration:re("_duration",ce),overshoot:re("_overshoot",ce)});Y(class extends le{constructor(t=.1,e=.01,n=0,i=1e3){super(),this.p(t).i(e).d(n).windup(i)}step(t,e,n,i){if("string"==typeof t)return t;if(i.done=n===1/0,n===1/0)return e;if(0===n)return t;const r=e-t;let o=(i.integral||0)+r*n;const s=(r-(i.error||0))/n,a=this._windup;return!1!==a&&(o=Math.max(-a,Math.min(o,a))),i.error=r,i.integral=o,i.done=Math.abs(r)<.001,i.done?e:t+(this.P*r+this.I*o+this.D*s)}},{windup:re("_windup"),p:re("P"),i:re("I"),d:re("D")});const ue={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},he={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},pe="mlhvqtcsaz".split("");for(let t=0,e=pe.length;t=0;i--)n=this[i][0],"M"===n||"L"===n||"T"===n?(this[i][1]+=t,this[i][2]+=e):"H"===n?this[i][1]+=t:"V"===n?this[i][1]+=e:"C"===n||"S"===n||"Q"===n?(this[i][1]+=t,this[i][2]+=e,this[i][3]+=t,this[i][4]+=e,"C"===n&&(this[i][5]+=t,this[i][6]+=e)):"A"===n&&(this[i][6]+=t,this[i][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,i="";const r={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new at,p:new at};for(;r.lastToken=i,i=t.charAt(n++);)if(r.inSegment||!fe(r,i))if("."!==i)if(isNaN(parseInt(i)))if(" "!==i&&","!==i)if("-"!==i)if("E"!==i.toUpperCase()){if(nt.test(i)){if(r.inNumber)me(r,!1);else{if(!de(r))throw new Error("parser Error");ge(r)}--n}}else r.number+=i,r.hasExponent=!0;else{if(r.inNumber&&!ve(r)){me(r,!1),--n;continue}r.number+=i,r.inNumber=!0}else r.inNumber&&me(r,!1);else{if("0"===r.number||ye(r)){r.inNumber=!0,r.number=i,me(r,!0);continue}r.inNumber=!0,r.number+=i}else{if(r.pointSeen||r.hasExponent){me(r,!1),--n;continue}r.inNumber=!0,r.pointSeen=!0,r.number+=i}return r.inNumber&&me(r,!1),r.inSegment&&de(r)&&ge(r),r.segments}(t)}size(t,e){const n=this.bbox();let i,r;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]=(this[i][1]-n.x)*t/n.width+n.x,this[i][2]=(this[i][2]-n.y)*e/n.height+n.y):"H"===r?this[i][1]=(this[i][1]-n.x)*t/n.width+n.x:"V"===r?this[i][1]=(this[i][1]-n.y)*e/n.height+n.y:"C"===r||"S"===r||"Q"===r?(this[i][1]=(this[i][1]-n.x)*t/n.width+n.x,this[i][2]=(this[i][2]-n.y)*e/n.height+n.y,this[i][3]=(this[i][3]-n.x)*t/n.width+n.x,this[i][4]=(this[i][4]-n.y)*e/n.height+n.y,"C"===r&&(this[i][5]=(this[i][5]-n.x)*t/n.width+n.x,this[i][6]=(this[i][6]-n.y)*e/n.height+n.y)):"A"===r&&(this[i][1]=this[i][1]*t/n.width,this[i][2]=this[i][2]*e/n.height,this[i][6]=(this[i][6]-n.x)*t/n.width+n.x,this[i][7]=(this[i][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,i=t.length;n{const e=typeof t;return"number"===e?Dt:"string"===e?st.isColor(t)?st:et.test(t)?nt.test(t)?be:Mt:H.test(t)?Dt:_e:Oe.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Mt:"object"===e?Te:_e};class xe{constructor(t){this._stepper=t||new ae("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(we(t));let e=new this._type(t);return this._type===st&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Te&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class _e{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Se{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Se.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Se.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Ee=(t,e)=>t[0]e[0]?1:0;class Te{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,i=e.length;nt.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),i=e.shift(),r=e.shift(),o=e.splice(0,r);t[n]=new i(o)}return t}}const Oe=[_e,Se,Te];class Me extends Nt{constructor(t,e=t){super(N("path",t),e)}array(){return this._array||(this._array=new be(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new be(t))}size(t,e){const n=_(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}Me.prototype.MorphArray=be,d({Container:{path:B((function(t){return this.put(new Me).plot(t||new be)}))}}),z(Me,"Path");var De={__proto__:null,array:function(){return this._array||(this._array=new te(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new te(t))},size:function(t,e){const n=_(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}};class Ae extends Nt{constructor(t,e=t){super(N("polygon",t),e)}}d({Container:{polygon:B((function(t){return this.put(new Ae).plot(t||new te)}))}}),Y(Ae,ee),Y(Ae,De),z(Ae,"Polygon");class Pe extends Nt{constructor(t,e=t){super(N("polyline",t),e)}}d({Container:{polyline:B((function(t){return this.put(new Pe).plot(t||new te)}))}}),Y(Pe,ee),Y(Pe,De),z(Pe,"Polyline");class Ce extends Nt{constructor(t,e=t){super(N("rect",t),e)}}Y(Ce,{rx:Rt,ry:qt}),d({Container:{rect:B((function(t,e){return this.put(new Ce).size(t,e)}))}}),z(Ce,"Rect");class Ie{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const ke={nextDraw:null,frames:new Ie,timeouts:new Ie,immediates:new Ie,timer:()=>A.window.performance||A.window.Date,transforms:[],frame(t){const e=ke.frames.push({run:t});return null===ke.nextDraw&&(ke.nextDraw=A.window.requestAnimationFrame(ke._draw)),e},timeout(t,e){e=e||0;const n=ke.timer().now()+e,i=ke.timeouts.push({run:t,time:n});return null===ke.nextDraw&&(ke.nextDraw=A.window.requestAnimationFrame(ke._draw)),i},immediate(t){const e=ke.immediates.push(t);return null===ke.nextDraw&&(ke.nextDraw=A.window.requestAnimationFrame(ke._draw)),e},cancelFrame(t){null!=t&&ke.frames.remove(t)},clearTimeout(t){null!=t&&ke.timeouts.remove(t)},cancelImmediate(t){null!=t&&ke.immediates.remove(t)},_draw(t){let e=null;const n=ke.timeouts.last();for(;(e=ke.timeouts.shift())&&(t>=e.time?e.run():ke.timeouts.push(e),e!==n););let i=null;const r=ke.frames.last();for(;i!==r&&(i=ke.frames.shift());)i.run(t);let o=null;for(;o=ke.immediates.shift();)o();ke.nextDraw=ke.timeouts.first()||ke.frames.first()?A.window.requestAnimationFrame(ke._draw):null}},je=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},Ne=function(){const t=A.window;return(t.performance||t.Date).now()};class Re extends St{constructor(t=Ne){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(je);let i=0;const r=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)i=r;else if("absolute"===n||"start"===n)i=e,e=0;else if("now"===n)i=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(i=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();i=t?t.start:this._time}}t.unschedule(),t.timeline(this);const o=t.persist(),s={persist:null===o?this._persist:o,start:i+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(s),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return ke.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=ke.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const i=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=i,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],n=e.runner;this._time-e.start<=0&&n.reset()}let r=!1;for(let t=0,e=this._runners.length;t0?this._continue():(this.pause(),this.fire("finished")),this}}d({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Re,this._timeline):(this._timeline=t,this)}}});class qe extends St{constructor(t){super(),this.id=qe.id++,t="function"==typeof(t=null==t?Tt.duration:t)?new le(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof le,this._stepper=this._isDeclarative?t:new ae,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new ct,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let i=1,r=!1,o=0;return e=e||Tt.delay,n=n||"last","object"!=typeof(t=t||Tt.duration)||t instanceof se||(e=t.delay||e,n=t.when||n,r=t.swing||r,i=t.times||i,o=t.wait||o,t=t.duration||Tt.duration),{duration:t,delay:e,swing:r,times:i,wait:o,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const i=qe.sanitise(t,e,n),r=new qe(i.duration);return this._timeline&&r.timeline(this._timeline),this._element&&r.element(this._element),r.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new ct,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new ae(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,i=e*Math.floor(t)+this._duration*n;return this.time(i)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,i=this._wait,r=this._times,o=this._swing,s=this._reverse;let a;if(null==t){const t=function(t){const e=o*Math.floor(t%(2*(i+n))/(i+n)),r=e&&!s||!e&&s,a=Math.pow(-1,r)*(t%(i+n))/n+r;return Math.max(Math.min(a,1),0)},l=r*(i+n)-i;return a=e<=0?Math.round(t(1e-5)):e=0;this._lastPosition=e;const i=this.duration(),r=this._lastTime<=0&&this._time>0,o=this._lastTime=i;this._lastTime=this._time,r&&this.fire("start",this);const s=this._isDeclarative;this.done=!s&&!o&&this._time>=i,this._reseted=!1;let a=!1;return(n||s)&&(this._initialise(n),this.transforms=new ct,a=this._run(s?t:e),this.fire("step",this)),this.done=this.done||a&&s,o&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;et.lmultiplyO(e),Le=t=>t.transforms;function Xe(){const t=this._transformationRunners.runners.map(Le).reduce(Fe,new ct);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ye{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new ze).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;ee.id<=t.id)).map(Le).reduce(Fe,new ct)},_addRunner(t){this._transformationRunners.add(t),ke.cancelImmediate(this._frameId),this._frameId=ke.immediate(Xe.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ye).add(new ze(new ct(this))))}}});Y(qe,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let i=e;if(this._tryRetarget(t,i))return this;let r=new xe(this._stepper).to(i),o=Object.keys(i);return this.queue((function(){r=r.from(this.element()[t](o))}),(function(e){return this.element()[t](r.at(e).valueOf()),r.done()}),(function(e){const n=Object.keys(e),s=(a=o,n.filter((t=>!a.includes(t))));var a;if(s.length){const e=this.element()[t](s),n=new Te(r.from()).valueOf();Object.assign(n,e),r.from(n)}const l=new Te(r.to()).valueOf();Object.assign(l,e),r.to(l),o=n,i=e})),this._rememberMorpher(t,r),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new xe(this._stepper).to(new Dt(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,i){e=i,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const i=ct.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!i;const r=new xe(this._stepper).type(n?Se:ct);let o,s,a,l,c;return this.queue((function(){s=s||this.element(),o=o||S(t,s),c=new ct(e?void 0:s),s._addRunner(this),e||s._clearTransformRunnersBefore(this)}),(function(u){e||this.clearTransform();const{x:h,y:p}=new at(o).transform(s._currentTransform(this));let d=new ct({...t,origin:[h,p]}),f=this._isDeclarative&&a?a:c;if(n){d=d.decompose(h,p),f=f.decompose(h,p);const t=d.rotate,e=f.rotate,n=[t-360,t,t+360],i=n.map((t=>Math.abs(t-e))),r=Math.min(...i),o=i.indexOf(r);d.rotate=n[o]}e&&(i||(d.rotate=t.rotate||0),this._isDeclarative&&l&&(f.rotate=l)),r.from(f),r.to(d);const m=r.at(u);return l=m.rotate,a=new ct(m),this.addTransform(a),s._addRunner(this),r.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(o=S(e,s)),t={...e,origin:o}}),!0),this._isDeclarative&&this._rememberMorpher("transform",r),this},x(t,e){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new Dt(e),this._tryRetarget(t,e))return this;const n=new xe(this._stepper).to(e);let i=null;return this.queue((function(){i=this.element()[t](),n.from(i),n.to(i+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(i+new Dt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new xe(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new Dt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,i){if(4===arguments.length)return this.plot([t,e,n,i]);if(this._tryRetarget("plot",t))return this;const r=new xe(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){r.from(this._element.array())}),(function(t){return this._element.plot(r.at(t)),r.done()})),this._rememberMorpher("plot",r),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,i){return this._queueObject("viewbox",new pt(t,e,n,i))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),Y(qe,{rx:Rt,ry:qt,from:Ut,to:Vt}),z(qe,"Runner");class Be extends kt{constructor(t,e=t){super(N("svg",t),e),this.namespace()}defs(){return this.isRoot()?R(this.node.querySelector("defs"))||this.put(new jt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof A.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:E,version:"1.1"}).attr("xmlns:xlink",M,O).attr("xmlns:svgjs",D,O):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,O).attr("xmlns:svgjs",null,O)}root(){return this.isRoot()?this:super.root()}}d({Container:{nested:B((function(){return this.put(new Be)}))}}),z(Be,"Svg",!0);class He extends kt{constructor(t,e=t){super(N("symbol",t),e)}}d({Container:{symbol:B((function(){return this.put(new He)}))}}),z(He,"Symbol");var We={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(A.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class Ge extends Nt{constructor(t,e=t){super(N("text",t),e),this.dom.leading=new Dt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new Dt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(i){const r=A.window.getComputedStyle(this.node).getPropertyValue("font-size"),o=n*new Dt(r);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=o:(this.attr("dy",i?o+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new Dt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let i=0,r=e.length;i{let r;try{r=n.bbox()}catch(t){return}const o=new ct(n),s=o.translate(t,e).transform(o.inverse()),a=new at(r.x,r.y).transform(s);n.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const i=t-n.x,r=e-n.y;return this.dmove(i,r)},size:function(t,e,n=this.bbox()){const i=_(this,t,e,n),r=i.width/n.width,o=i.height/n.height;return this.children().forEach(((t,e)=>{const i=new at(n).transform(new ct(t).inverse());t.scale(r,o,i.x,i.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class Ze extends kt{constructor(t,e=t){super(N("g",t),e)}}Y(Ze,Qe),d({Container:{group:B((function(){return this.put(new Ze)}))}}),z(Ze,"G");class Je extends kt{constructor(t,e=t){super(N("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,M)}}Y(Je,Qe),d({Container:{link:B((function(t){return this.put(new Je).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Je,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),z(Je,"A");class tn extends kt{constructor(t,e=t){super(N("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return gt('svg [mask*="'+this.id()+'"]')}}d({Container:{mask:B((function(){return this.defs().put(new tn)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof tn?t:this.parent().mask().add(t);return this.attr("mask",'url("#'+e.id()+'")')},unmask(){return this.attr("mask",null)}}}),z(tn,"Mask");class en extends Ct{constructor(t,e=t){super(N("stop",t),e)}update(t){return("number"==typeof t||t instanceof Dt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new Dt(t.offset)),this}}d({Gradient:{stop:function(t,e,n){return this.put(new en).update(t,e,n)}}}),z(en,"Stop");class nn extends Ct{constructor(t,e=t){super(N("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const t in e)n+=w(t)+":"+e[t]+";";return n+="}",n}(t,e))}}d("Dom",{style(t,e){return this.put(new nn).rule(t,e)},fontface(t,e,n){return this.put(new nn).font(t,e,n)}}),z(nn,"Style");class rn extends Ge{constructor(t,e=t){super(N("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}d({Container:{textPath:B((function(t,e){return t instanceof Ge||(t=this.text(t)),t.path(e)}))},Text:{path:B((function(t,e=!0){const n=new rn;let i;if(t instanceof Me||(t=this.defs().path(t)),n.attr("href","#"+t,M),e)for(;i=this.node.firstChild;)n.node.appendChild(i);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:B((function(t){return t instanceof Ge||(t=(new Ge).addTo(this.parent()).text(t)),t.path(this)})),targets(){return gt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),rn.prototype.MorphArray=be,z(rn,"TextPath");class on extends Nt{constructor(t,e=t){super(N("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,M)}}d({Container:{use:B((function(t,e){return this.put(new on).use(t,e)}))}}),z(on,"Use");const sn=j;function an(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function ln(t){for(var e=1;e=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}Y([Be,He,Jt,Zt,ie],f("viewbox")),Y([ne,Pe,Ae,Me],f("marker")),Y(Ge,f("Text")),Y(Me,f("Path")),Y(jt,f("Defs")),Y([Ge,Ue],f("Tspan")),Y([Ce,Wt,Qt,qe],f("radius")),Y(St,f("EventTarget")),Y(Pt,f("Dom")),Y(Ct,f("Element")),Y(Nt,f("Shape")),Y([kt,Gt],f("Container")),Y(Qt,f("Gradient")),Y(qe,f("Runner")),ft.extend([...new Set(p)]),function(t=[]){Oe.push(...[].concat(t))}([Dt,st,pt,ct,Mt,te,be,at]),Y(Oe,{to(t){return(new xe).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,i,r){return this.fromArray(t.map((function(t,o){return i.step(t,e[o],n,r[o],r)})))}});function dn(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var fn=dn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),mn=dn(/Edge/i),gn=dn(/firefox/i),yn=dn(/safari/i)&&!dn(/chrome/i)&&!dn(/android/i),vn=dn(/iP(ad|od|hone)/i),bn=dn(/chrome/i)&&dn(/android/i),wn={capture:!1,passive:!1};function xn(t,e,n){t.addEventListener(e,n,!fn&&wn)}function _n(t,e,n){t.removeEventListener(e,n,!fn&&wn)}function Sn(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(t){return!1}return!1}}function En(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Tn(t,e,n,i){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&Sn(t,e):Sn(t,e))||i&&t===n)return t;if(t===n)break}while(t=En(t))}return null}var On,Mn=/\s+/g;function Dn(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(Mn," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(Mn," ")}}function An(t,e,n){var i=t&&t.style;if(i){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 i||-1!==e.indexOf("webkit")||(e="-webkit-"+e),i[e]=n+("string"==typeof n?"":"px")}}function Pn(t,e){var n="";if("string"==typeof t)n=t;else do{var i=An(t,"transform");i&&"none"!==i&&(n=i+" "+n)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function Cn(t,e,n){if(t){var i=t.getElementsByTagName(e),r=0,o=i.length;if(n)for(;r=o:r<=o))return i;if(i===In())break;i=Fn(i,!1)}return!1}function Nn(t,e,n,i){for(var r=0,o=0,s=t.children;o2&&void 0!==arguments[2]?arguments[2]:{},i=n.evt,r=pn(n,Kn);Vn.pluginEvent.bind(Bi)(t,e,ln({dragEl:Jn,parentEl:ti,ghostEl:ei,rootEl:ni,nextEl:ii,lastDownEl:ri,cloneEl:oi,cloneHidden:si,dragStarted:bi,putSortable:pi,activeSortable:Bi.active,originalEvent:i,oldIndex:ai,oldDraggableIndex:ci,newIndex:li,newDraggableIndex:ui,hideGhostForTarget:Fi,unhideGhostForTarget:Li,cloneNowHidden:function(){si=!0},cloneNowShown:function(){si=!1},dispatchSortableEvent:function(t){Zn({sortable:e,name:t,originalEvent:i})}},r))};function Zn(t){$n(ln({putSortable:pi,cloneEl:oi,targetEl:Jn,rootEl:ni,oldIndex:ai,oldDraggableIndex:ci,newIndex:li,newDraggableIndex:ui},t))}var Jn,ti,ei,ni,ii,ri,oi,si,ai,li,ci,ui,hi,pi,di,fi,mi,gi,yi,vi,bi,wi,xi,_i,Si,Ei=!1,Ti=!1,Oi=[],Mi=!1,Di=!1,Ai=[],Pi=!1,Ci=[],Ii="undefined"!=typeof document,ki=vn,ji=mn||fn?"cssFloat":"float",Ni=Ii&&!bn&&!vn&&"draggable"in document.createElement("div"),Ri=function(){if(Ii){if(fn)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),qi=function(t,e){var n=An(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),r=Nn(t,0,e),o=Nn(t,1,e),s=r&&An(r),a=o&&An(o),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+kn(r).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+kn(o).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(r&&s.float&&"none"!==s.float){var u="left"===s.float?"left":"right";return!o||"both"!==a.clear&&a.clear!==u?"horizontal":"vertical"}return r&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||l>=i&&"none"===n[ji]||o&&"none"===n[ji]&&l+c>i)?"vertical":"horizontal"},zi=function(t){function e(t,n){return function(i,r,o,s){var a=i.options.group.name&&r.options.group.name&&i.options.group.name===r.options.group.name;if(null==t&&(n||a))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(i,r,o,s),n)(i,r,o,s);var l=(n?i:r).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},i=t.group;i&&"object"==cn(i)||(i={name:i}),n.name=i.name,n.checkPull=e(i.pull,!0),n.checkPut=e(i.put),n.revertClone=i.revertClone,t.group=n},Fi=function(){!Ri&&ei&&An(ei,"display","none")},Li=function(){!Ri&&ei&&An(ei,"display","")};Ii&&!bn&&document.addEventListener("click",(function(t){if(Ti)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Ti=!1,!1}),!0);var Xi=function(t){if(Jn){var e=function(t,e){var n;return Oi.some((function(i){var r=i[Hn].options.emptyInsertThreshold;if(r&&!Rn(i)){var o=kn(i),s=t>=o.left-r&&t<=o.right+r,a=e>=o.top-r&&e<=o.bottom+r;return s&&a?n=i:void 0}})),n}((t=t.touches?t.touches[0]:t).clientX,t.clientY);if(e){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[Hn]._onDragOver(n)}}},Yi=function(t){Jn&&Jn.parentNode[Hn]._isOutsideThisEl(t.target)};function Bi(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=hn({},e),t[Hn]=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 qi(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!==Bi.supportPointer&&"PointerEvent"in window&&!yn,emptyInsertThreshold:5};for(var i in Vn.initializePlugins(this,t,n),n)!(i in e)&&(e[i]=n[i]);for(var r in zi(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Ni,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?xn(t,"pointerdown",this._onTapStart):(xn(t,"mousedown",this._onTapStart),xn(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(xn(t,"dragover",this),xn(t,"dragenter",this)),Oi.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),hn(this,Wn())}function Hi(t,e,n,i,r,o,s,a){var l,c,u=t[Hn],h=u.options.onMove;return!window.CustomEvent||fn||mn?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=i,l.related=r||e,l.relatedRect=o||kn(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),h&&(c=h.call(u,l,s)),c}function Wi(t){t.draggable=!1}function Gi(){Pi=!1}function Ui(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,i=0;n--;)i+=e.charCodeAt(n);return i.toString(36)}function Vi(t){return setTimeout(t,0)}function $i(t){return clearTimeout(t)}Bi.prototype={constructor:Bi,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(wi=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Jn):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,i=this.options,r=i.preventOnFilter,o=t.type,s=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(s||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=i.filter;if(function(t){Ci.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var i=e[n];i.checked&&Ci.push(i)}}(n),!Jn&&!(/mousedown|pointerdown/.test(o)&&0!==t.button||i.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!yn||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=Tn(a,i.draggable,n,!1))&&a.animated||ri===a)){if(ai=qn(a),ci=qn(a,i.draggable),"function"==typeof c){if(c.call(this,t,a,this))return Zn({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),Qn("filter",e,{evt:t}),void(r&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(i){if(i=Tn(l,i.trim(),n,!1))return Zn({sortable:e,rootEl:i,name:"filter",targetEl:a,fromEl:n,toEl:n}),Qn("filter",e,{evt:t}),!0}))))return void(r&&t.cancelable&&t.preventDefault());i.handle&&!Tn(l,i.handle,n,!1)||this._prepareDragStart(t,s,a)}}},_prepareDragStart:function(t,e,n){var i,r=this,o=r.el,s=r.options,a=o.ownerDocument;if(n&&!Jn&&n.parentNode===o){var l=kn(n);if(ni=o,ti=(Jn=n).parentNode,ii=Jn.nextSibling,ri=n,hi=s.group,Bi.dragged=Jn,di={target:Jn,clientX:(e||t).clientX,clientY:(e||t).clientY},yi=di.clientX-l.left,vi=di.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Jn.style["will-change"]="all",i=function(){Qn("delayEnded",r,{evt:t}),Bi.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!gn&&r.nativeDraggable&&(Jn.draggable=!0),r._triggerDragStart(t,e),Zn({sortable:r,name:"choose",originalEvent:t}),Dn(Jn,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){Cn(Jn,t.trim(),Wi)})),xn(a,"dragover",Xi),xn(a,"mousemove",Xi),xn(a,"touchmove",Xi),xn(a,"mouseup",r._onDrop),xn(a,"touchend",r._onDrop),xn(a,"touchcancel",r._onDrop),gn&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Jn.draggable=!0),Qn("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(mn||fn))i();else{if(Bi.eventCanceled)return void this._onDrop();xn(a,"mouseup",r._disableDelayedDrag),xn(a,"touchend",r._disableDelayedDrag),xn(a,"touchcancel",r._disableDelayedDrag),xn(a,"mousemove",r._delayedDragTouchMoveHandler),xn(a,"touchmove",r._delayedDragTouchMoveHandler),s.supportPointer&&xn(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(i,s.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(){Jn&&Wi(Jn),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;_n(t,"mouseup",this._disableDelayedDrag),_n(t,"touchend",this._disableDelayedDrag),_n(t,"touchcancel",this._disableDelayedDrag),_n(t,"mousemove",this._delayedDragTouchMoveHandler),_n(t,"touchmove",this._delayedDragTouchMoveHandler),_n(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?xn(document,"pointermove",this._onTouchMove):xn(document,e?"touchmove":"mousemove",this._onTouchMove):(xn(Jn,"dragend",this),xn(ni,"dragstart",this._onDragStart));try{document.selection?Vi((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(Ei=!1,ni&&Jn){Qn("dragStarted",this,{evt:e}),this.nativeDraggable&&xn(document,"dragover",Yi);var n=this.options;!t&&Dn(Jn,n.dragClass,!1),Dn(Jn,n.ghostClass,!0),Bi.active=this,t&&this._appendGhost(),Zn({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(fi){this._lastX=fi.clientX,this._lastY=fi.clientY,Fi();for(var t=document.elementFromPoint(fi.clientX,fi.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(fi.clientX,fi.clientY))!==e;)e=t;if(Jn.parentNode[Hn]._isOutsideThisEl(t),e)do{if(e[Hn]){if(e[Hn]._onDragOver({clientX:fi.clientX,clientY:fi.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Li()}},_onTouchMove:function(t){if(di){var e=this.options,n=e.fallbackTolerance,i=e.fallbackOffset,r=t.touches?t.touches[0]:t,o=ei&&Pn(ei,!0),s=ei&&o&&o.a,a=ei&&o&&o.d,l=ki&&Si&&zn(Si),c=(r.clientX-di.clientX+i.x)/(s||1)+(l?l[0]-Ai[0]:0)/(s||1),u=(r.clientY-di.clientY+i.y)/(a||1)+(l?l[1]-Ai[1]:0)/(a||1);if(!Bi.active&&!Ei){if(n&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))i.right+r||t.clientX<=i.right&&t.clientY>i.bottom&&t.clientX>=i.left:t.clientX>i.right&&t.clientY>i.top||t.clientX<=i.right&&t.clientY>i.bottom+r}(t,r,this)&&!m.animated){if(m===Jn)return C(!1);if(m&&o===t.target&&(s=m),s&&(n=kn(s)),!1!==Hi(ni,o,Jn,e,s,n,t,!!s))return P(),m&&m.nextSibling?o.insertBefore(Jn,m.nextSibling):o.appendChild(Jn),ti=o,I(),C(!0)}else if(m&&function(t,e,n){var i=kn(Nn(n.el,0,n.options,!0)),r=10;return e?t.clientXu+c*o/2:lh-_i)return-xi}else if(l>u+c*(1-r)/2&&lh-c*o/2))return l>u+c/2?1:-1;return 0}(t,s,n,r,x?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Di,wi===s),0!==y){var T=qn(Jn);do{T-=y,b=ti.children[T]}while(b&&("none"===An(b,"display")||b===ei))}if(0===y||b===s)return C(!1);wi=s,xi=y;var O=s.nextElementSibling,M=!1,D=Hi(ni,o,Jn,e,s,n,t,M=1===y);if(!1!==D)return 1!==D&&-1!==D||(M=1===D),Pi=!0,setTimeout(Gi,30),P(),M&&!O?o.appendChild(Jn):s.parentNode.insertBefore(Jn,M?O:s),S&&Yn(S,0,E-S.scrollTop),ti=Jn.parentNode,void 0===v||Di||(_i=Math.abs(v-kn(s)[_])),I(),C(!0)}if(o.contains(Jn))return C(!1)}return!1}function A(a,l){Qn(a,d,ln({evt:t,isOwner:u,axis:r?"vertical":"horizontal",revert:i,dragRect:e,targetRect:n,canSort:h,fromSortable:p,target:s,completed:C,onMove:function(n,i){return Hi(ni,o,Jn,e,n,kn(n),t,i)},changed:I},l))}function P(){A("dragOverAnimationCapture"),d.captureAnimationState(),d!==p&&p.captureAnimationState()}function C(e){return A("dragOverCompleted",{insertion:e}),e&&(u?c._hideClone():c._showClone(d),d!==p&&(Dn(Jn,pi?pi.options.ghostClass:c.options.ghostClass,!1),Dn(Jn,a.ghostClass,!0)),pi!==d&&d!==Bi.active?pi=d:d===Bi.active&&pi&&(pi=null),p===d&&(d._ignoreWhileAnimating=s),d.animateAll((function(){A("dragOverAnimationComplete"),d._ignoreWhileAnimating=null})),d!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(s===Jn&&!Jn.animated||s===o&&!s.animated)&&(wi=null),a.dragoverBubble||t.rootEl||s===document||(Jn.parentNode[Hn]._isOutsideThisEl(t.target),!e&&Xi(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function I(){li=qn(Jn),ui=qn(Jn,a.draggable),Zn({sortable:d,name:"change",toEl:o,newIndex:li,newDraggableIndex:ui,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){_n(document,"mousemove",this._onTouchMove),_n(document,"touchmove",this._onTouchMove),_n(document,"pointermove",this._onTouchMove),_n(document,"dragover",Xi),_n(document,"mousemove",Xi),_n(document,"touchmove",Xi)},_offUpEvents:function(){var t=this.el.ownerDocument;_n(t,"mouseup",this._onDrop),_n(t,"touchend",this._onDrop),_n(t,"pointerup",this._onDrop),_n(t,"touchcancel",this._onDrop),_n(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;li=qn(Jn),ui=qn(Jn,n.draggable),Qn("drop",this,{evt:t}),ti=Jn&&Jn.parentNode,li=qn(Jn),ui=qn(Jn,n.draggable),Bi.eventCanceled||(Ei=!1,Di=!1,Mi=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),$i(this.cloneId),$i(this._dragStartId),this.nativeDraggable&&(_n(document,"drop",this),_n(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),yn&&An(document.body,"user-select",""),An(Jn,"transform",""),t&&(bi&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),ei&&ei.parentNode&&ei.parentNode.removeChild(ei),(ni===ti||pi&&"clone"!==pi.lastPutMode)&&oi&&oi.parentNode&&oi.parentNode.removeChild(oi),Jn&&(this.nativeDraggable&&_n(Jn,"dragend",this),Wi(Jn),Jn.style["will-change"]="",bi&&!Ei&&Dn(Jn,pi?pi.options.ghostClass:this.options.ghostClass,!1),Dn(Jn,this.options.chosenClass,!1),Zn({sortable:this,name:"unchoose",toEl:ti,newIndex:null,newDraggableIndex:null,originalEvent:t}),ni!==ti?(li>=0&&(Zn({rootEl:ti,name:"add",toEl:ti,fromEl:ni,originalEvent:t}),Zn({sortable:this,name:"remove",toEl:ti,originalEvent:t}),Zn({rootEl:ti,name:"sort",toEl:ti,fromEl:ni,originalEvent:t}),Zn({sortable:this,name:"sort",toEl:ti,originalEvent:t})),pi&&pi.save()):li!==ai&&li>=0&&(Zn({sortable:this,name:"update",toEl:ti,originalEvent:t}),Zn({sortable:this,name:"sort",toEl:ti,originalEvent:t})),Bi.active&&(null!=li&&-1!==li||(li=ai,ui=ci),Zn({sortable:this,name:"end",toEl:ti,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Qn("nulling",this),ni=Jn=ti=ei=ii=oi=ri=si=di=fi=bi=li=ui=ai=ci=wi=xi=pi=hi=Bi.dragged=Bi.ghost=Bi.clone=Bi.active=null,Ci.forEach((function(t){t.checked=!0})),Ci.length=mi=gi=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Jn&&(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,i=0,r=n.length,o=this.options;i0&&yr(i.width)/t.offsetWidth||1,o=t.offsetHeight>0&&yr(i.height)/t.offsetHeight||1);var s=(pr(t)?hr(t):window).visualViewport,a=!br()&&n,l=(i.left+(a&&s?s.offsetLeft:0))/r,c=(i.top+(a&&s?s.offsetTop:0))/o,u=i.width/r,h=i.height/o;return{width:u,height:h,top:c,right:l+u,bottom:c+h,left:l,x:l,y:c}}function xr(t){var e=hr(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function _r(t){return t?(t.nodeName||"").toLowerCase():null}function Sr(t){return((pr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Er(t){return wr(Sr(t)).left+xr(t).scrollLeft}function Tr(t){return hr(t).getComputedStyle(t)}function Or(t){var e=Tr(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function Mr(t,e,n){void 0===n&&(n=!1);var i,r,o=dr(e),s=dr(e)&&function(t){var e=t.getBoundingClientRect(),n=yr(e.width)/t.offsetWidth||1,i=yr(e.height)/t.offsetHeight||1;return 1!==n||1!==i}(e),a=Sr(e),l=wr(t,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==_r(e)||Or(a))&&(c=(i=e)!==hr(i)&&dr(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:xr(i)),dr(e)?((u=wr(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):a&&(u.x=Er(a))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function Dr(t){var e=wr(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function Ar(t){return"html"===_r(t)?t:t.assignedSlot||t.parentNode||(fr(t)?t.host:null)||Sr(t)}function Pr(t){return["html","body","#document"].indexOf(_r(t))>=0?t.ownerDocument.body:dr(t)&&Or(t)?t:Pr(Ar(t))}function Cr(t,e){var n;void 0===e&&(e=[]);var i=Pr(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),o=hr(i),s=r?[o].concat(o.visualViewport||[],Or(i)?i:[]):i,a=e.concat(s);return r?a:a.concat(Cr(Ar(s)))}function Ir(t){return["table","td","th"].indexOf(_r(t))>=0}function kr(t){return dr(t)&&"fixed"!==Tr(t).position?t.offsetParent:null}function jr(t){for(var e=hr(t),n=kr(t);n&&Ir(n)&&"static"===Tr(n).position;)n=kr(n);return n&&("html"===_r(n)||"body"===_r(n)&&"static"===Tr(n).position)?e:n||function(t){var e=/firefox/i.test(vr());if(/Trident/i.test(vr())&&dr(t)&&"fixed"===Tr(t).position)return null;var n=Ar(t);for(fr(n)&&(n=n.host);dr(n)&&["html","body"].indexOf(_r(n))<0;){var i=Tr(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(t)||e}var Nr="top",Rr="bottom",qr="right",zr="left",Fr="auto",Lr=[Nr,Rr,qr,zr],Xr="start",Yr="end",Br="viewport",Hr="popper",Wr=Lr.reduce((function(t,e){return t.concat([e+"-"+Xr,e+"-"+Yr])}),[]),Gr=[].concat(Lr,[Fr]).reduce((function(t,e){return t.concat([e,e+"-"+Xr,e+"-"+Yr])}),[]),Ur=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Vr(t){var e=new Map,n=new Set,i=[];function r(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var i=e.get(t);i&&r(i)}})),i.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||r(t)})),i}function $r(t){var e;return function(){return e||(e=new Promise((function(n){Promise.resolve().then((function(){e=void 0,n(t())}))}))),e}}var Kr={placement:"bottom",modifiers:[],strategy:"absolute"};function Qr(){for(var t=arguments.length,e=new Array(t),n=0;n=0?"x":"y"}function ro(t){var e,n=t.reference,i=t.element,r=t.placement,o=r?eo(r):null,s=r?no(r):null,a=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(o){case Nr:e={x:a,y:n.y-i.height};break;case Rr:e={x:a,y:n.y+n.height};break;case qr:e={x:n.x+n.width,y:l};break;case zr:e={x:n.x-i.width,y:l};break;default:e={x:n.x,y:n.y}}var c=o?io(o):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case Xr:e[c]=e[c]-(n[u]/2-i[u]/2);break;case Yr:e[c]=e[c]+(n[u]/2-i[u]/2)}}return e}var oo={top:"auto",right:"auto",bottom:"auto",left:"auto"};function so(t){var e,n=t.popper,i=t.popperRect,r=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,h=t.isFixed,p=s.x,d=void 0===p?0:p,f=s.y,m=void 0===f?0:f,g="function"==typeof u?u({x:d,y:m}):{x:d,y:m};d=g.x,m=g.y;var y=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),b=zr,w=Nr,x=window;if(c){var _=jr(n),S="clientHeight",E="clientWidth";if(_===hr(n)&&"static"!==Tr(_=Sr(n)).position&&"absolute"===a&&(S="scrollHeight",E="scrollWidth"),r===Nr||(r===zr||r===qr)&&o===Yr)w=Rr,m-=(h&&_===x&&x.visualViewport?x.visualViewport.height:_[S])-i.height,m*=l?1:-1;if(r===zr||(r===Nr||r===Rr)&&o===Yr)b=qr,d-=(h&&_===x&&x.visualViewport?x.visualViewport.width:_[E])-i.width,d*=l?1:-1}var T,O=Object.assign({position:a},c&&oo),M=!0===u?function(t){var e=t.x,n=t.y,i=window.devicePixelRatio||1;return{x:yr(e*i)/i||0,y:yr(n*i)/i||0}}({x:d,y:m}):{x:d,y:m};return d=M.x,m=M.y,l?Object.assign({},O,((T={})[w]=v?"0":"",T[b]=y?"0":"",T.transform=(x.devicePixelRatio||1)<=1?"translate("+d+"px, "+m+"px)":"translate3d("+d+"px, "+m+"px, 0)",T)):Object.assign({},O,((e={})[w]=v?m+"px":"",e[b]=y?d+"px":"",e.transform="",e))}const ao={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,i=t.name,r=n.offset,o=void 0===r?[0,0]:r,s=Gr.reduce((function(t,n){return t[n]=function(t,e,n){var i=eo(t),r=[zr,Nr].indexOf(i)>=0?-1:1,o="function"==typeof n?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[zr,qr].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}(n,e.rects,o),t}),{}),a=s[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=s}};var lo={left:"right",right:"left",bottom:"top",top:"bottom"};function co(t){return t.replace(/left|right|bottom|top/g,(function(t){return lo[t]}))}var uo={start:"end",end:"start"};function ho(t){return t.replace(/start|end/g,(function(t){return uo[t]}))}function po(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&fr(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function fo(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mo(t,e,n){return e===Br?fo(function(t,e){var n=hr(t),i=Sr(t),r=n.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var c=br();(c||!c&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+Er(t),y:l}}(t,n)):pr(e)?function(t,e){var n=wr(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):fo(function(t){var e,n=Sr(t),i=xr(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=mr(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=mr(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+Er(t),l=-i.scrollTop;return"rtl"===Tr(r||n).direction&&(a+=mr(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(Sr(t)))}function go(t,e,n,i){var r="clippingParents"===e?function(t){var e=Cr(Ar(t)),n=["absolute","fixed"].indexOf(Tr(t).position)>=0&&dr(t)?jr(t):t;return pr(n)?e.filter((function(t){return pr(t)&&po(t,n)&&"body"!==_r(t)})):[]}(t):[].concat(e),o=[].concat(r,[n]),s=o[0],a=o.reduce((function(e,n){var r=mo(t,n,i);return e.top=mr(r.top,e.top),e.right=gr(r.right,e.right),e.bottom=gr(r.bottom,e.bottom),e.left=mr(r.left,e.left),e}),mo(t,s,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function yo(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function vo(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}function bo(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=void 0===i?t.placement:i,o=n.strategy,s=void 0===o?t.strategy:o,a=n.boundary,l=void 0===a?"clippingParents":a,c=n.rootBoundary,u=void 0===c?Br:c,h=n.elementContext,p=void 0===h?Hr:h,d=n.altBoundary,f=void 0!==d&&d,m=n.padding,g=void 0===m?0:m,y=yo("number"!=typeof g?g:vo(g,Lr)),v=p===Hr?"reference":Hr,b=t.rects.popper,w=t.elements[f?v:p],x=go(pr(w)?w:w.contextElement||Sr(t.elements.popper),l,u,s),_=wr(t.elements.reference),S=ro({reference:_,element:b,strategy:"absolute",placement:r}),E=fo(Object.assign({},b,S)),T=p===Hr?E:_,O={top:x.top-T.top+y.top,bottom:T.bottom-x.bottom+y.bottom,left:x.left-T.left+y.left,right:T.right-x.right+y.right},M=t.modifiersData.offset;if(p===Hr&&M){var D=M[r];Object.keys(O).forEach((function(t){var e=[qr,Rr].indexOf(t)>=0?1:-1,n=[Nr,Rr].indexOf(t)>=0?"y":"x";O[t]+=D[n]*e}))}return O}function wo(t,e,n){return mr(t,gr(e,n))}const xo={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,o=void 0===r||r,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,h=n.padding,p=n.tether,d=void 0===p||p,f=n.tetherOffset,m=void 0===f?0:f,g=bo(e,{boundary:l,rootBoundary:c,padding:h,altBoundary:u}),y=eo(e.placement),v=no(e.placement),b=!v,w=io(y),x="x"===w?"y":"x",_=e.modifiersData.popperOffsets,S=e.rects.reference,E=e.rects.popper,T="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,O="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),M=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,D={x:0,y:0};if(_){if(o){var A,P="y"===w?Nr:zr,C="y"===w?Rr:qr,I="y"===w?"height":"width",k=_[w],j=k+g[P],N=k-g[C],R=d?-E[I]/2:0,q=v===Xr?S[I]:E[I],z=v===Xr?-E[I]:-S[I],F=e.elements.arrow,L=d&&F?Dr(F):{width:0,height:0},X=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Y=X[P],B=X[C],H=wo(0,S[I],L[I]),W=b?S[I]/2-R-H-Y-O.mainAxis:q-H-Y-O.mainAxis,G=b?-S[I]/2+R+H+B+O.mainAxis:z+H+B+O.mainAxis,U=e.elements.arrow&&jr(e.elements.arrow),V=U?"y"===w?U.clientTop||0:U.clientLeft||0:0,$=null!=(A=null==M?void 0:M[w])?A:0,K=k+G-$,Q=wo(d?gr(j,k+W-$-V):j,k,d?mr(N,K):N);_[w]=Q,D[w]=Q-k}if(a){var Z,J="x"===w?Nr:zr,tt="x"===w?Rr:qr,et=_[x],nt="y"===x?"height":"width",it=et+g[J],rt=et-g[tt],ot=-1!==[Nr,zr].indexOf(y),st=null!=(Z=null==M?void 0:M[x])?Z:0,at=ot?it:et-S[nt]-E[nt]-st+O.altAxis,lt=ot?et+S[nt]+E[nt]-st-O.altAxis:rt,ct=d&&ot?function(t,e,n){var i=wo(t,e,n);return i>n?n:i}(at,et,lt):wo(d?at:it,et,d?lt:rt);_[x]=ct,D[x]=ct-et}e.modifiersData[i]=D}},requiresIfExists:["offset"]};const _o={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,i=t.name,r=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=eo(n.placement),l=io(a),c=[zr,qr].indexOf(a)>=0?"height":"width";if(o&&s){var u=function(t,e){return yo("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:vo(t,Lr))}(r.padding,n),h=Dr(o),p="y"===l?Nr:zr,d="y"===l?Rr:qr,f=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],m=s[l]-n.rects.reference[l],g=jr(o),y=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,v=f/2-m/2,b=u[p],w=y-h[c]-u[d],x=y/2-h[c]/2+v,_=wo(b,x,w),S=l;n.modifiersData[i]=((e={})[S]=_,e.centerOffset=_-x,e)}},effect:function(t){var e=t.state,n=t.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&po(e.elements.popper,i)&&(e.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function So(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Eo(t){return[Nr,qr,Rr,zr].some((function(e){return t[e]>=0}))}var To=Zr({defaultModifiers:[to,{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=ro({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,c={placement:eo(e.placement),variation:no(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,so(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,so(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];dr(r)&&_r(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(t){var e=i[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var i=e.elements[t],r=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});dr(i)&&_r(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]},ao,{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,h=n.rootBoundary,p=n.altBoundary,d=n.flipVariations,f=void 0===d||d,m=n.allowedAutoPlacements,g=e.options.placement,y=eo(g),v=l||(y===g||!f?[co(g)]:function(t){if(eo(t)===Fr)return[];var e=co(t);return[ho(t),e,ho(e)]}(g)),b=[g].concat(v).reduce((function(t,n){return t.concat(eo(n)===Fr?function(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?Gr:l,u=no(i),h=u?a?Wr:Wr.filter((function(t){return no(t)===u})):Lr,p=h.filter((function(t){return c.indexOf(t)>=0}));0===p.length&&(p=h);var d=p.reduce((function(e,n){return e[n]=bo(t,{placement:n,boundary:r,rootBoundary:o,padding:s})[eo(n)],e}),{});return Object.keys(d).sort((function(t,e){return d[t]-d[e]}))}(e,{placement:n,boundary:u,rootBoundary:h,padding:c,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),w=e.rects.reference,x=e.rects.popper,_=new Map,S=!0,E=b[0],T=0;T=0,P=A?"width":"height",C=bo(e,{placement:O,boundary:u,rootBoundary:h,altBoundary:p,padding:c}),I=A?D?qr:zr:D?Rr:Nr;w[P]>x[P]&&(I=co(I));var k=co(I),j=[];if(o&&j.push(C[M]<=0),a&&j.push(C[I]<=0,C[k]<=0),j.every((function(t){return t}))){E=O,S=!1;break}_.set(O,j)}if(S)for(var N=function(t){var e=b.find((function(e){var n=_.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return E=e,"break"},R=f?3:1;R>0;R--){if("break"===N(R))break}e.placement!==E&&(e.modifiersData[i]._skip=!0,e.placement=E,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},xo,_o,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=bo(e,{elementContext:"reference"}),a=bo(e,{altBoundary:!0}),l=So(s,i),c=So(a,r,o),u=Eo(l),h=Eo(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}}]});const Oo={init:function(t){const e=t;Oo.document=e.document,Oo.DocumentFragment=e.DocumentFragment||Mo,Oo.SVGElement=e.SVGElement||Mo,Oo.SVGSVGElement=e.SVGSVGElement||Mo,Oo.SVGElementInstance=e.SVGElementInstance||Mo,Oo.Element=e.Element||Mo,Oo.HTMLElement=e.HTMLElement||Oo.Element,Oo.Event=e.Event,Oo.Touch=e.Touch||Mo,Oo.PointerEvent=e.PointerEvent||e.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function Mo(){}const Do=Oo;const Ao=t=>!(!t||!t.Window)&&t instanceof t.Window;let Po,Co;function Io(t){Po=t;const e=t.document.createTextNode("");e.ownerDocument!==t.document&&"function"==typeof t.wrap&&t.wrap(e)===e&&(t=t.wrap(t)),Co=t}function ko(t){if(Ao(t))return t;return(t.ownerDocument||t).defaultView||Co.window}"undefined"!=typeof window&&window&&Io(window);const jo=t=>!!t&&"object"==typeof t,No=t=>"function"==typeof t,Ro={window:t=>t===Co||Ao(t),docFrag:t=>jo(t)&&11===t.nodeType,object:jo,func:No,number:t=>"number"==typeof t,bool:t=>"boolean"==typeof t,string:t=>"string"==typeof t,element:t=>{if(!t||"object"!=typeof t)return!1;const e=ko(t)||Co;return/object|function/.test(typeof Element)?t instanceof Element||t instanceof e.Element:1===t.nodeType&&"string"==typeof t.nodeName},plainObject:t=>jo(t)&&!!t.constructor&&/function Object\b/.test(t.constructor.toString()),array:t=>jo(t)&&void 0!==t.length&&No(t.splice)},qo={init:function(t){const e=Do.Element,n=t.navigator||{};qo.supportsTouch="ontouchstart"in t||Ro.func(t.DocumentTouch)&&Do.document instanceof t.DocumentTouch,qo.supportsPointerEvent=!1!==n.pointerEnabled&&!!Do.PointerEvent,qo.isIOS=/iP(hone|od|ad)/.test(n.platform),qo.isIOS7=/iP(hone|od|ad)/.test(n.platform)&&/OS 7[^\d]/.test(n.appVersion),qo.isIe9=/MSIE 9/.test(n.userAgent),qo.isOperaMobile="Opera"===n.appName&&qo.supportsTouch&&/Presto/.test(n.userAgent),qo.prefixedMatchesSelector="matches"in e.prototype?"matches":"webkitMatchesSelector"in e.prototype?"webkitMatchesSelector":"mozMatchesSelector"in e.prototype?"mozMatchesSelector":"oMatchesSelector"in e.prototype?"oMatchesSelector":"msMatchesSelector",qo.pEventTypes=qo.supportsPointerEvent?Do.PointerEvent===t.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,qo.wheelEvent=Do.document&&"onmousewheel"in Do.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null};const zo=qo,Fo=(t,e)=>{for(const n of e)t.push(n);return t},Lo=t=>Fo([],t),Xo=(t,e)=>{for(let n=0;nt[Xo(t,e)];function Bo(t){const e={};for(const n in t){const i=t[n];Ro.plainObject(i)?e[n]=Bo(i):Ro.array(i)?e[n]=Lo(i):e[n]=i}return e}function Ho(t,e){for(const n in e)t[n]=e[n];return t}let Wo,Go,Uo=0;const Vo={request:t=>Wo(t),cancel:t=>Go(t),init:function(t){if(Wo=t.requestAnimationFrame,Go=t.cancelAnimationFrame,!Wo){const e=["ms","moz","webkit","o"];for(const n of e)Wo=t[`${n}RequestAnimationFrame`],Go=t[`${n}CancelAnimationFrame`]||t[`${n}CancelRequestAnimationFrame`]}Wo=Wo&&Wo.bind(t),Go=Go&&Go.bind(t),Wo||(Wo=e=>{const n=Date.now(),i=Math.max(0,16-(n-Uo)),r=t.setTimeout((()=>{e(n+i)}),i);return Uo=n+i,r},Go=t=>clearTimeout(t))}};function $o(t,e,n){if(n=n||{},Ro.string(t)&&-1!==t.search(" ")&&(t=Ko(t)),Ro.array(t))return t.reduce(((t,i)=>Ho(t,$o(i,e,n))),n);if(Ro.object(t)&&(e=t,t=""),Ro.func(e))n[t]=n[t]||[],n[t].push(e);else if(Ro.array(e))for(const i of e)$o(t,i,n);else if(Ro.object(e))for(const i in e){$o(Ko(i).map((e=>`${t}${e}`)),e[i],n)}return n}function Ko(t){return t.trim().split(/ +/)}function Qo(t,e){for(const n of e){if(t.immediatePropagationStopped)break;n(t)}}class Zo{options;types={};propagationStopped=!1;immediatePropagationStopped=!1;global;constructor(t){this.options=Ho({},t||{})}fire(t){let e;const n=this.global;(e=this.types[t.type])&&Qo(t,e),!t.propagationStopped&&n&&(e=n[t.type])&&Qo(t,e)}on(t,e){const n=$o(t,e);for(t in n)this.types[t]=Fo(this.types[t]||[],n[t])}off(t,e){const n=$o(t,e);for(t in n){const e=this.types[t];if(e&&e.length)for(const i of n[t]){const t=e.indexOf(i);-1!==t&&e.splice(t,1)}}}getRect(t){return null}}function Jo(t,e){if(t.contains)return t.contains(e);for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function ts(t,e){for(;Ro.element(t);){if(ns(t,e))return t;t=es(t)}return null}function es(t){let e=t.parentNode;if(Ro.docFrag(e)){for(;(e=e.host)&&Ro.docFrag(e););return e}return e}function ns(t,e){return Co!==Po&&(e=e.replace(/\/deep\//g," ")),t[zo.prefixedMatchesSelector](e)}function is(t,e,n){for(;Ro.element(t);){if(ns(t,e))return!0;if((t=es(t))===n)return ns(t,e)}return!1}function rs(t){return t.correspondingUseElement||t}function os(t){const e=t instanceof Do.SVGElement?t.getBoundingClientRect():t.getClientRects()[0];return e&&{left:e.left,right:e.right,top:e.top,bottom:e.bottom,width:e.width||e.right-e.left,height:e.height||e.bottom-e.top}}function ss(t){const e=os(t);if(!zo.isIOS7&&e){const i={x:(n=(n=ko(t))||Co).scrollX||n.document.documentElement.scrollLeft,y:n.scrollY||n.document.documentElement.scrollTop};e.left+=i.x,e.right+=i.x,e.top+=i.y,e.bottom+=i.y}var n;return e}function as(t){return!!Ro.string(t)&&(Do.document.querySelector(t),!0)}function ls(t,e,n,i){let r=t;return Ro.string(r)?r=function(t,e,n){return"parent"===t?es(n):"self"===t?e.getRect(n):ts(n,t)}(r,e,n):Ro.func(r)&&(r=r(...i)),Ro.element(r)&&(r=ss(r)),r}function cs(t){return t&&{x:"x"in t?t.x:t.left,y:"y"in t?t.y:t.top}}function us(t){return!t||"x"in t&&"y"in t||((t=Ho({},t)).x=t.left||0,t.y=t.top||0,t.width=t.width||(t.right||0)-t.x,t.height=t.height||(t.bottom||0)-t.y),t}function hs(t,e,n){t.left&&(e.left+=n.x),t.right&&(e.right+=n.x),t.top&&(e.top+=n.y),t.bottom&&(e.bottom+=n.y),e.width=e.right-e.left,e.height=e.bottom-e.top}function ps(t,e,n){const i=t.options[n];return cs(ls(i&&i.origin||t.options.origin,t,e,[t&&e]))||{x:0,y:0}}const ds=(t,e)=>Math.sqrt(t*t+e*e);class fs{immediatePropagationStopped=!1;propagationStopped=!1;constructor(t){this._interaction=t}preventDefault(){}stopPropagation(){this.propagationStopped=!0}stopImmediatePropagation(){this.immediatePropagationStopped=this.propagationStopped=!0}}Object.defineProperty(fs.prototype,"interaction",{get(){return this._interaction._proxy},set(){}});const ms={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}};class gs extends fs{relatedTarget=null;screenX;screenY;button;buttons;ctrlKey;shiftKey;altKey;metaKey;page;client;delta;rect;x0;y0;t0;dt;duration;clientX0;clientY0;velocity;speed;swipe;axes;preEnd;constructor(t,e,n,i,r,o,s){super(t),r=r||t.element;const a=t.interactable,l=(a&&a.options||ms).deltaSource,c=ps(a,r,n),u="start"===i,h="end"===i,p=u?this:t.prevEvent,d=u?t.coords.start:h?{page:p.page,client:p.client,timeStamp:t.coords.cur.timeStamp}:t.coords.cur;this.page=Ho({},d.page),this.client=Ho({},d.client),this.rect=Ho({},t.rect),this.timeStamp=d.timeStamp,h||(this.page.x-=c.x,this.page.y-=c.y,this.client.x-=c.x,this.client.y-=c.y),this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.button=e.button,this.buttons=e.buttons,this.target=r,this.currentTarget=r,this.preEnd=o,this.type=s||n+(i||""),this.interactable=a,this.t0=u?t.pointers[t.pointers.length-1].downTime:p.t0,this.x0=t.coords.start.page.x-c.x,this.y0=t.coords.start.page.y-c.y,this.clientX0=t.coords.start.client.x-c.x,this.clientY0=t.coords.start.client.y-c.y,this.delta=u||h?{x:0,y:0}:{x:this[l].x-p[l].x,y:this[l].y-p[l].y},this.dt=t.coords.delta.timeStamp,this.duration=this.timeStamp-this.t0,this.velocity=Ho({},t.coords.velocity[l]),this.speed=ds(this.velocity.x,this.velocity.y),this.swipe=h||"inertiastart"===i?this.getSwipe():null}getSwipe(){const t=this._interaction;if(t.prevEvent.speed<600||this.timeStamp-t.prevEvent.timeStamp>150)return null;let e=180*Math.atan2(t.prevEvent.velocityY,t.prevEvent.velocityX)/Math.PI;e<0&&(e+=360);const n=112.5<=e&&e<247.5,i=202.5<=e&&e<337.5;return{up:i,down:!i&&22.5<=e&&e<157.5,left:n,right:!n&&(292.5<=e||e<67.5),angle:e,speed:t.prevEvent.speed,velocity:{x:t.prevEvent.velocityX,y:t.prevEvent.velocityY}}}preventDefault(){}stopImmediatePropagation(){this.immediatePropagationStopped=this.propagationStopped=!0}stopPropagation(){this.propagationStopped=!0}}function ys(t,e){let n=!1;return function(){return n||(Co.console.warn(e),n=!0),t.apply(this,arguments)}}function vs(t,e){return t.name=e.name,t.axis=e.axis,t.edges=e.edges,t}Object.defineProperties(gs.prototype,{pageX:{get(){return this.page.x},set(t){this.page.x=t}},pageY:{get(){return this.page.y},set(t){this.page.y=t}},clientX:{get(){return this.client.x},set(t){this.client.x=t}},clientY:{get(){return this.client.y},set(t){this.client.y=t}},dx:{get(){return this.delta.x},set(t){this.delta.x=t}},dy:{get(){return this.delta.y},set(t){this.delta.y=t}},velocityX:{get(){return this.velocity.x},set(t){this.velocity.x=t}},velocityY:{get(){return this.velocity.y},set(t){this.velocity.y=t}}});function bs(t,e){t.page=t.page||{},t.page.x=e.page.x,t.page.y=e.page.y,t.client=t.client||{},t.client.x=e.client.x,t.client.y=e.client.y,t.timeStamp=e.timeStamp}function ws(t){return t instanceof Do.Event||t instanceof Do.Touch}function xs(t,e,n){return t=t||"page",(n=n||{}).x=e[t+"X"],n.y=e[t+"Y"],n}function _s(t){return Ro.number(t.pointerId)?t.pointerId:t.identifier}function Ss(t,e,n){const i=e.length>1?Ts(e):e[0];!function(t,e){e=e||{x:0,y:0},zo.isOperaMobile&&ws(t)?(xs("screen",t,e),e.x+=window.scrollX,e.y+=window.scrollY):xs("page",t,e)}(i,t.page),function(t,e){e=e||{},zo.isOperaMobile&&ws(t)?xs("screen",t,e):xs("client",t,e)}(i,t.client),t.timeStamp=n}function Es(t){const e=[];return Ro.array(t)?(e[0]=t[0],e[1]=t[1]):"touchend"===t.type?1===t.touches.length?(e[0]=t.touches[0],e[1]=t.changedTouches[0]):0===t.touches.length&&(e[0]=t.changedTouches[0],e[1]=t.changedTouches[1]):(e[0]=t.touches[0],e[1]=t.touches[1]),e}function Ts(t){const e={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0};for(const n of t)for(const t in e)e[t]+=n[t];for(const n in e)e[n]/=t.length;return e}function Os(t){if(!t.length)return null;const e=Es(t),n=Math.min(e[0].pageX,e[1].pageX),i=Math.min(e[0].pageY,e[1].pageY),r=Math.max(e[0].pageX,e[1].pageX),o=Math.max(e[0].pageY,e[1].pageY);return{x:n,y:i,left:n,top:i,right:r,bottom:o,width:r-n,height:o-i}}function Ms(t,e){const n=e+"X",i=e+"Y",r=Es(t),o=r[0][n]-r[1][n],s=r[0][i]-r[1][i];return ds(o,s)}function Ds(t,e){const n=e+"X",i=e+"Y",r=Es(t),o=r[1][n]-r[0][n],s=r[1][i]-r[0][i];return 180*Math.atan2(s,o)/Math.PI}function As(t){const e=Ro.func(t.composedPath)?t.composedPath():t.path;return[rs(e?e[0]:t.target),rs(t.currentTarget)]}function Ps(t,e){if(e.phaselessTypes[t])return!0;for(const n in e.map)if(0===t.indexOf(n)&&t.substr(n.length)in e.phases)return!0;return!1}class Cs{get _defaults(){return{base:{},perAction:{},actions:{}}}options;_actions;target;events=new Zo;_context;_win;_doc;_scopeEvents;_rectChecker;constructor(t,e,n,i){this._actions=e.actions,this.target=t,this._context=e.context||n,this._win=ko(as(t)?this._context:t),this._doc=this._win.document,this._scopeEvents=i,this.set(e)}setOnEvents(t,e){return Ro.func(e.onstart)&&this.on(`${t}start`,e.onstart),Ro.func(e.onmove)&&this.on(`${t}move`,e.onmove),Ro.func(e.onend)&&this.on(`${t}end`,e.onend),Ro.func(e.oninertiastart)&&this.on(`${t}inertiastart`,e.oninertiastart),this}updatePerActionListeners(t,e,n){(Ro.array(e)||Ro.object(e))&&this.off(t,e),(Ro.array(n)||Ro.object(n))&&this.on(t,n)}setPerAction(t,e){const n=this._defaults;for(const i in e){const r=i,o=this.options[t],s=e[r];"listeners"===r&&this.updatePerActionListeners(t,o.listeners,s),Ro.array(s)?o[r]=Lo(s):Ro.plainObject(s)?(o[r]=Ho(o[r]||{},Bo(s)),Ro.object(n.perAction[r])&&"enabled"in n.perAction[r]&&(o[r].enabled=!1!==s.enabled)):Ro.bool(s)&&Ro.object(n.perAction[r])?o[r].enabled=s:o[r]=s}}getRect(t){return t=t||(Ro.element(this.target)?this.target:null),Ro.string(this.target)&&(t=t||this._context.querySelector(this.target)),ss(t)}rectChecker(t){return Ro.func(t)?(this._rectChecker=t,this.getRect=t=>{const e=Ho({},this._rectChecker(t));return"width"in e||(e.width=e.right-e.left,e.height=e.bottom-e.top),e},this):null===t?(delete this.getRect,delete this._rectChecker,this):this.getRect}_backCompatOption(t,e){if(as(e)||Ro.object(e)){this.options[t]=e;for(const n in this._actions.map)this.options[n][t]=e;return this}return this.options[t]}origin(t){return this._backCompatOption("origin",t)}deltaSource(t){return"page"===t||"client"===t?(this.options.deltaSource=t,this):this.options.deltaSource}context(){return this._context}inContext(t){return this._context===t.ownerDocument||Jo(this._context,t)}testIgnoreAllow(t,e,n){return!this.testIgnore(t.ignoreFrom,e,n)&&this.testAllow(t.allowFrom,e,n)}testAllow(t,e,n){return!t||!!Ro.element(n)&&(Ro.string(t)?is(n,t,e):!!Ro.element(t)&&Jo(t,n))}testIgnore(t,e,n){return!(!t||!Ro.element(n))&&(Ro.string(t)?is(n,t,e):!!Ro.element(t)&&Jo(t,n))}fire(t){return this.events.fire(t),this}_onOff(t,e,n,i){Ro.object(e)&&!Ro.array(e)&&(i=n,n=null);const r="on"===t?"add":"remove",o=$o(e,n);for(let e in o){"wheel"===e&&(e=zo.wheelEvent);for(const n of o[e])Ps(e,this._actions)?this.events[t](e,n):Ro.string(this.target)?this._scopeEvents[`${r}Delegate`](this.target,this._context,e,n,i):this._scopeEvents[r](this.target,e,n,i)}return this}on(t,e,n){return this._onOff("on",t,e,n)}off(t,e,n){return this._onOff("off",t,e,n)}set(t){const e=this._defaults;Ro.object(t)||(t={}),this.options=Bo(e.base);for(const n in this._actions.methodDict){const i=n,r=this._actions.methodDict[i];this.options[i]={},this.setPerAction(i,Ho(Ho({},e.perAction),e.actions[i])),this[r](t[i])}for(const e in t)Ro.func(this[e])&&this[e](t[e]);return this}unset(){if(Ro.string(this.target))for(const t in this._scopeEvents.delegatedEvents){const e=this._scopeEvents.delegatedEvents[t];for(let n=e.length-1;n>=0;n--){const{selector:i,context:r,listeners:o}=e[n];i===this.target&&r===this._context&&e.splice(n,1);for(let e=o.length-1;e>=0;e--)this._scopeEvents.removeDelegate(this.target,this._context,t,o[e][0],o[e][1])}}else this._scopeEvents.remove(this.target,"all")}}class Is{list=[];selectorMap={};scope;constructor(t){this.scope=t,t.addListeners({"interactable:unset":({interactable:t})=>{const{target:e,_context:n}=t,i=Ro.string(e)?this.selectorMap[e]:e[this.scope.id],r=Xo(i,(t=>t.context===n));i[r]&&(i[r].context=null,i[r].interactable=null),i.splice(r,1)}})}new(t,e){e=Ho(e||{},{actions:this.scope.actions});const n=new this.scope.Interactable(t,e,this.scope.document,this.scope.events),i={context:n._context,interactable:n};return this.scope.addDocument(n._doc),this.list.push(n),Ro.string(t)?(this.selectorMap[t]||(this.selectorMap[t]=[]),this.selectorMap[t].push(i)):(n.target[this.scope.id]||Object.defineProperty(t,this.scope.id,{value:[],configurable:!0}),t[this.scope.id].push(i)),this.scope.fire("interactable:new",{target:t,options:e,interactable:n,win:this.scope._win}),n}get(t,e){const n=e&&e.context||this.scope.document,i=Ro.string(t),r=i?this.selectorMap[t]:t[this.scope.id];if(!r)return null;const o=Yo(r,(e=>e.context===n&&(i||e.interactable.inContext(t))));return o&&o.interactable}forEachMatch(t,e){for(const n of this.list){let i;if((Ro.string(n.target)?Ro.element(t)&&ns(t,n.target):t===n.target)&&n.inContext(t)&&(i=e(n)),void 0!==i)return i}}}function ks(t,e){t.__set||={};for(const n in e)"function"!=typeof t[n]&&"__set"!==n&&Object.defineProperty(t,n,{get:()=>n in t.__set?t.__set[n]:t.__set[n]=e[n],set(e){t.__set[n]=e},configurable:!0});return t}class js{currentTarget;originalEvent;type;constructor(t){this.originalEvent=t,ks(this,t)}preventOriginalDefault(){this.originalEvent.preventDefault()}stopPropagation(){this.originalEvent.stopPropagation()}stopImmediatePropagation(){this.originalEvent.stopImmediatePropagation()}}function Ns(t){if(!Ro.object(t))return{capture:!!t,passive:!1};const e=Ho({},t);return e.capture=!!t.capture,e.passive=!!t.passive,e}const Rs={id:"events",install:function(t){var e;const n=[],i={},r=[],o={add:s,remove:a,addDelegate:function(t,e,n,o,a){const u=Ns(a);if(!i[n]){i[n]=[];for(const t of r)s(t,n,l),s(t,n,c,!0)}const h=i[n];let p=Yo(h,(n=>n.selector===t&&n.context===e));p||(p={selector:t,context:e,listeners:[]},h.push(p));p.listeners.push([o,u])},removeDelegate:function(t,e,n,r,o){const s=Ns(o),u=i[n];let h,p=!1;if(!u)return;for(h=u.length-1;h>=0;h--){const i=u[h];if(i.selector===t&&i.context===e){const{listeners:t}=i;for(let i=t.length-1;i>=0;i--){const[o,{capture:d,passive:f}]=t[i];if(o===r&&d===s.capture&&f===s.passive){t.splice(i,1),t.length||(u.splice(h,1),a(e,n,l),a(e,n,c,!0)),p=!0;break}}if(p)break}}},delegateListener:l,delegateUseCapture:c,delegatedEvents:i,documents:r,targets:n,supportsOptions:!1,supportsPassive:!1};function s(t,e,i,r){const s=Ns(r);let a=Yo(n,(e=>e.eventTarget===t));a||(a={eventTarget:t,events:{}},n.push(a)),a.events[e]||(a.events[e]=[]),t.addEventListener&&!((t,e)=>-1!==t.indexOf(e))(a.events[e],i)&&(t.addEventListener(e,i,o.supportsOptions?s:s.capture),a.events[e].push(i))}function a(t,e,i,r){const s=Ns(r),l=Xo(n,(e=>e.eventTarget===t)),c=n[l];if(!c||!c.events)return;if("all"===e){for(e in c.events)c.events.hasOwnProperty(e)&&a(t,e,"all");return}let u=!1;const h=c.events[e];if(h){if("all"===i){for(let n=h.length-1;n>=0;n--)a(t,e,h[n],s);return}for(let n=0;nn[t]});for(const t in Fs)Object.defineProperty(this._proxy,t,{value:(...e)=>n[t](...e)});this._scopeFire("interactions:new",{interaction:this})}pointerDown(t,e,n){const i=this.updatePointer(t,e,n,!0),r=this.pointers[i];this._scopeFire("interactions:down",{pointer:t,event:e,eventTarget:n,pointerIndex:i,pointerInfo:r,type:"down",interaction:this})}start(t,e,n){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<("gesture"===t.name?2:1)||!e.options[t.name].enabled)&&(vs(this.prepared,t),this.interactable=e,this.element=n,this.rect=e.getRect(n),this.edges=this.prepared.edges?Ho({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}pointerMove(t,e,n){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(t,e,n,!1);const i=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;let r,o;this.pointerIsDown&&!this.pointerWasMoved&&(r=this.coords.cur.client.x-this.coords.start.client.x,o=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=ds(r,o)>this.pointerMoveTolerance);const s=this.getPointerIndex(t),a={pointer:t,pointerIndex:s,pointerInfo:this.pointers[s],event:e,type:"move",eventTarget:n,dx:r,dy:o,duplicate:i,interaction:this};i||function(t,e){const n=Math.max(e.timeStamp/1e3,.001);t.page.x=e.page.x/n,t.page.y=e.page.y/n,t.client.x=e.client.x/n,t.client.y=e.client.y/n,t.timeStamp=n}(this.coords.velocity,this.coords.delta),this._scopeFire("interactions:move",a),i||this.simulation||(this.interacting()&&(a.type=null,this.move(a)),this.pointerWasMoved&&bs(this.coords.prev,this.coords.cur))}move(t){var e;t&&t.event||((e=this.coords.delta).page.x=0,e.page.y=0,e.client.x=0,e.client.y=0),(t=Ho({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},t||{})).phase="move",this._doPhase(t)}pointerUp(t,e,n,i){let r=this.getPointerIndex(t);-1===r&&(r=this.updatePointer(t,e,n,!1));const o=/cancel$/i.test(e.type)?"cancel":"up";this._scopeFire(`interactions:${o}`,{pointer:t,pointerIndex:r,pointerInfo:this.pointers[r],event:e,eventTarget:n,type:o,curEventTarget:i,interaction:this}),this.simulation||this.end(e),this.removePointer(t,e)}documentBlur(t){this.end(t),this._scopeFire("interactions:blur",{event:t,type:"blur",interaction:this})}end(t){let e;this._ending=!0,t=t||this._latestPointer.event,this.interacting()&&(e=this._doPhase({event:t,interaction:this,phase:"end"})),this._ending=!1,!0===e&&this.stop()}currentAction(){return this._interacting?this.prepared.name:null}interacting(){return this._interacting}stop(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}getPointerIndex(t){const e=_s(t);return"mouse"===this.pointerType||"pen"===this.pointerType?this.pointers.length-1:Xo(this.pointers,(t=>t.id===e))}getPointerInfo(t){return this.pointers[this.getPointerIndex(t)]}updatePointer(t,e,n,i){const r=_s(t);let o=this.getPointerIndex(t),s=this.pointers[o];return i=!1!==i&&(i||/(down|start)$/i.test(e.type)),s?s.pointer=t:(s=new qs(r,t,e,null,null),o=this.pointers.length,this.pointers.push(s)),Ss(this.coords.cur,this.pointers.map((t=>t.pointer)),this._now()),function(t,e,n){t.page.x=n.page.x-e.page.x,t.page.y=n.page.y-e.page.y,t.client.x=n.client.x-e.client.x,t.client.y=n.client.y-e.client.y,t.timeStamp=n.timeStamp-e.timeStamp}(this.coords.delta,this.coords.prev,this.coords.cur),i&&(this.pointerIsDown=!0,s.downTime=this.coords.cur.timeStamp,s.downTarget=n,ks(this.downPointer,t),this.interacting()||(bs(this.coords.start,this.coords.cur),bs(this.coords.prev,this.coords.cur),this.downEvent=e,this.pointerWasMoved=!1)),this._updateLatestPointer(t,e,n),this._scopeFire("interactions:update-pointer",{pointer:t,event:e,eventTarget:n,down:i,pointerInfo:s,pointerIndex:o,interaction:this}),o}removePointer(t,e){const n=this.getPointerIndex(t);if(-1===n)return;const i=this.pointers[n];this._scopeFire("interactions:remove-pointer",{pointer:t,event:e,eventTarget:null,pointerIndex:n,pointerInfo:i,interaction:this}),this.pointers.splice(n,1),this.pointerIsDown=!1}_updateLatestPointer(t,e,n){this._latestPointer.pointer=t,this._latestPointer.event=e,this._latestPointer.eventTarget=n}destroy(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}_createPreparedEvent(t,e,n,i){return new gs(this,t,this.prepared.name,e,this.element,n,i)}_fireEvent(t){var e;null==(e=this.interactable)||e.fire(t),(!this.prevEvent||t.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=t)}_doPhase(t){const{event:e,phase:n,preEnd:i,type:r}=t,{rect:o}=this;o&&"move"===n&&(hs(this.edges,o,this.coords.delta[this.interactable.options.deltaSource]),o.width=o.right-o.left,o.height=o.bottom-o.top);if(!1===this._scopeFire(`interactions:before-action-${n}`,t))return!1;const s=t.iEvent=this._createPreparedEvent(e,n,i,r);return this._scopeFire(`interactions:action-${n}`,t),"start"===n&&(this.prevEvent=s),this._fireEvent(s),this._scopeFire(`interactions:after-action-${n}`,t),!0}_now(){return Date.now()}};function Ys(t){return/^(always|never|auto)$/.test(t)?(this.options.preventDefault=t,this):Ro.bool(t)?(this.options.preventDefault=t?"always":"never",this):this.options.preventDefault}function Bs({interaction:t,event:e}){t.interactable&&t.interactable.checkAndPreventDefault(e)}const Hs={id:"core/interactablePreventDefault",install:function(t){const{Interactable:e}=t;e.prototype.preventDefault=Ys,e.prototype.checkAndPreventDefault=function(e){return function(t,e,n){const i=t.options.preventDefault;if("never"!==i)if("always"!==i){if(e.events.supportsPassive&&/^touch(start|move)$/.test(n.type)){const t=ko(n.target).document,i=e.getDocOptions(t);if(!i||!i.events||!1!==i.events.passive)return}/^(mouse|pointer|touch)*(down|start)/i.test(n.type)||Ro.element(n.target)&&ns(n.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||n.preventDefault()}else n.preventDefault()}(this,t,e)},t.interactions.docEvents.push({type:"dragstart",listener(e){for(const n of t.interactions.list)if(n.element&&(n.element===e.target||Jo(n.element,e.target)))return void n.interactable.checkAndPreventDefault(e)}})},listeners:["down","move","up","cancel"].reduce(((t,e)=>(t[`interactions:${e}`]=Bs,t)),{})},Ws={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search(t){for(const e of Ws.methodOrder){const n=Ws[e](t);if(n)return n}return null},simulationResume({pointerType:t,eventType:e,eventTarget:n,scope:i}){if(!/down|start/i.test(e))return null;for(const e of i.interactions.list){let i=n;if(e.simulation&&e.simulation.allowResume&&e.pointerType===t)for(;i;){if(i===e.element)return e;i=es(i)}}return null},mouseOrPen({pointerId:t,pointerType:e,eventType:n,scope:i}){if("mouse"!==e&&"pen"!==e)return null;let r;for(const n of i.interactions.list)if(n.pointerType===e){if(n.simulation&&!Gs(n,t))continue;if(n.interacting())return n;r||(r=n)}if(r)return r;for(const t of i.interactions.list)if(!(t.pointerType!==e||/down/i.test(n)&&t.simulation))return t;return null},hasPointer({pointerId:t,scope:e}){for(const n of e.interactions.list)if(Gs(n,t))return n;return null},idle({pointerType:t,scope:e}){for(const n of e.interactions.list){if(1===n.pointers.length){const t=n.interactable;if(t&&(!t.options.gesture||!t.options.gesture.enabled))continue}else if(n.pointers.length>=2)continue;if(!n.interacting()&&t===n.pointerType)return n}return null}};function Gs(t,e){return t.pointers.some((({id:t})=>t===e))}const Us=Ws,Vs=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function $s(t,e){return function(n){const i=e.interactions.list,r=function(t){return Ro.string(t.pointerType)?t.pointerType:Ro.number(t.pointerType)?[void 0,void 0,"touch","pen","mouse"][t.pointerType]:/touch/.test(t.type||"")||t instanceof Do.Touch?"touch":"mouse"}(n),[o,s]=As(n),a=[];if(/^touch/.test(n.type)){e.prevTouchTime=e.now();for(const t of n.changedTouches){const i={pointer:t,pointerId:_s(t),pointerType:r,eventType:n.type,eventTarget:o,curEventTarget:s,scope:e},l=Ks(i);a.push([i.pointer,i.eventTarget,i.curEventTarget,l])}}else{let t=!1;if(!zo.supportsPointerEvent&&/mouse/.test(n.type)){for(let e=0;eJo(t,n.downTarget)))||e.removePointer(n.pointer,n.event)}i=Do.PointerEvent?[{type:n.down,listener:r},{type:n.down,listener:e.pointerDown},{type:n.move,listener:e.pointerMove},{type:n.up,listener:e.pointerUp},{type:n.cancel,listener:e.pointerUp}]:[{type:"mousedown",listener:e.pointerDown},{type:"mousemove",listener:e.pointerMove},{type:"mouseup",listener:e.pointerUp},{type:"touchstart",listener:r},{type:"touchstart",listener:e.pointerDown},{type:"touchmove",listener:e.pointerMove},{type:"touchend",listener:e.pointerUp},{type:"touchcancel",listener:e.pointerUp}],i.push({type:"blur",listener(e){for(const n of t.interactions.list)n.documentBlur(e)}}),t.prevTouchTime=0,t.Interaction=class extends Xs{get pointerMoveTolerance(){return t.interactions.pointerMoveTolerance}set pointerMoveTolerance(e){t.interactions.pointerMoveTolerance=e}_now(){return t.now()}},t.interactions={list:[],new(e){e.scopeFire=(e,n)=>t.fire(e,n);const n=new t.Interaction(e);return t.interactions.list.push(n),n},listeners:e,docEvents:i,pointerMoveTolerance:1},t.usePlugin(Hs)},listeners:{"scope:add-document":t=>Qs(t,"add"),"scope:remove-document":t=>Qs(t,"remove"),"interactable:unset":({interactable:t},e)=>{for(let n=e.interactions.list.length-1;n>=0;n--){const i=e.interactions.list[n];i.interactable===t&&(i.stop(),e.fire("interactions:destroy",{interaction:i}),i.destroy(),e.interactions.list.length>2&&e.interactions.list.splice(n,1))}}},onDocSignal:Qs,doOnInteractions:$s,methodNames:Vs},Js=Zs;function ta(t){return t&&t.replace(/\/.*$/,"")}const ea=new class{id=`__interact_scope_${Math.floor(100*Math.random())}`;isInitialized=!1;listenerMaps=[];browser=zo;defaults=Bo(ms);Eventable=Zo;actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}};interactStatic=function(t){const e=(n,i)=>{let r=t.interactables.get(n,i);return r||(r=t.interactables.new(n,i),r.events.global=e.globalEvents),r};return e.getPointerAverage=Ts,e.getTouchBBox=Os,e.getTouchDistance=Ms,e.getTouchAngle=Ds,e.getElementRect=ss,e.getElementClientRect=os,e.matchesSelector=ns,e.closest=ts,e.globalEvents={},e.version="1.10.17",e.scope=t,e.use=function(t,e){return this.scope.usePlugin(t,e),this},e.isSet=function(t,e){return!!this.scope.interactables.get(t,e&&e.context)},e.on=ys((function(t,e,n){if(Ro.string(t)&&-1!==t.search(" ")&&(t=t.trim().split(/ +/)),Ro.array(t)){for(const i of t)this.on(i,e,n);return this}if(Ro.object(t)){for(const n in t)this.on(n,t[n],e);return this}return Ps(t,this.scope.actions)?this.globalEvents[t]?this.globalEvents[t].push(e):this.globalEvents[t]=[e]:this.scope.events.add(this.scope.document,t,e,{options:n}),this}),"The interact.on() method is being deprecated"),e.off=ys((function(t,e,n){if(Ro.string(t)&&-1!==t.search(" ")&&(t=t.trim().split(/ +/)),Ro.array(t)){for(const i of t)this.off(i,e,n);return this}if(Ro.object(t)){for(const n in t)this.off(n,t[n],e);return this}if(Ps(t,this.scope.actions)){let n;t in this.globalEvents&&-1!==(n=this.globalEvents[t].indexOf(e))&&this.globalEvents[t].splice(n,1)}else this.scope.events.remove(this.scope.document,t,e,n);return this}),"The interact.off() method is being deprecated"),e.debug=function(){return this.scope},e.supportsTouch=function(){return zo.supportsTouch},e.supportsPointerEvent=function(){return zo.supportsPointerEvent},e.stop=function(){for(const t of this.scope.interactions.list)t.stop();return this},e.pointerMoveTolerance=function(t){return Ro.number(t)?(this.scope.interactions.pointerMoveTolerance=t,this):this.scope.interactions.pointerMoveTolerance},e.addDocument=function(t,e){this.scope.addDocument(t,e)},e.removeDocument=function(t){this.scope.removeDocument(t)},e}(this);InteractEvent=gs;Interactable;interactables=new Is(this);_win;document;window;documents=[];_plugins={list:[],map:{}};constructor(){const t=this;this.Interactable=class extends Cs{get _defaults(){return t.defaults}set(e){return super.set(e),t.fire("interactable:set",{options:e,interactable:this}),this}unset(){super.unset();const e=t.interactables.list.indexOf(this);e<0||(super.unset(),t.interactables.list.splice(e,1),t.fire("interactable:unset",{interactable:this}))}}}addListeners(t,e){this.listenerMaps.push({id:e,map:t})}fire(t,e){for(const{map:{[t]:n}}of this.listenerMaps)if(n&&!1===n(e,this,t))return!1}onWindowUnload=t=>this.removeDocument(t.target);init(t){return this.isInitialized?this:function(t,e){t.isInitialized=!0,Ro.window(e)&&Io(e);return Do.init(e),zo.init(e),Vo.init(e),t.window=e,t.document=e.document,t.usePlugin(Js),t.usePlugin(Rs),t}(this,t)}pluginIsInstalled(t){return this._plugins.map[t.id]||-1!==this._plugins.list.indexOf(t)}usePlugin(t,e){if(!this.isInitialized)return this;if(this.pluginIsInstalled(t))return this;if(t.id&&(this._plugins.map[t.id]=t),this._plugins.list.push(t),t.install&&t.install(this,e),t.listeners&&t.before){let e=0;const n=this.listenerMaps.length,i=t.before.reduce(((t,e)=>(t[e]=!0,t[ta(e)]=!0,t)),{});for(;e{const{interaction:e,interactable:n,buttons:i}=t,r=n.options.drag;if(r&&r.enabled&&(!e.pointerIsDown||!/mouse|pointer/.test(e.pointerType)||0!=(i&n.options.drag.mouseButtons)))return t.action={name:"drag",axis:"start"===r.lockAxis?r.startAxis:r.lockAxis},!1}},draggable:function(t){return Ro.object(t)?(this.options.drag.enabled=!1!==t.enabled,this.setPerAction("drag",t),this.setOnEvents("drag",t),/^(xy|x|y|start)$/.test(t.lockAxis)&&(this.options.drag.lockAxis=t.lockAxis),/^(xy|x|y)$/.test(t.startAxis)&&(this.options.drag.startAxis=t.startAxis),this):Ro.bool(t)?(this.options.drag.enabled=t,this):this.options.drag},beforeMove:ra,move:oa,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:()=>"move"},aa=sa;function la(t,e,n,i,r,o,s){if(!e)return!1;if(!0===e){const e=Ro.number(o.width)?o.width:o.right-o.left,i=Ro.number(o.height)?o.height:o.bottom-o.top;if(s=Math.min(s,Math.abs(("left"===t||"right"===t?e:i)/2)),e<0&&("left"===t?t="right":"right"===t&&(t="left")),i<0&&("top"===t?t="bottom":"bottom"===t&&(t="top")),"left"===t){const t=e>=0?o.left:o.right;return n.x=0?o.top:o.bottom;return n.y(e>=0?o.right:o.left)-s;if("bottom"===t)return n.y>(i>=0?o.bottom:o.top)-s}return!!Ro.element(i)&&(Ro.element(e)?e===i:is(i,e,r))}function ca({iEvent:t,interaction:e}){if("resize"!==e.prepared.name||!e.resizeAxes)return;const n=t;e.interactable.options.resize.square?("y"===e.resizeAxes?n.delta.x=n.delta.y:n.delta.y=n.delta.x,n.axes="xy"):(n.axes=e.resizeAxes,"x"===e.resizeAxes?n.delta.y=0:"y"===e.resizeAxes&&(n.delta.x=0))}na.use(aa);const ua={id:"actions/resize",before:["actions/drag"],install:function(t){const{actions:e,browser:n,Interactable:i,defaults:r}=t;ua.cursors=function(t){return t.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(n),ua.defaultMargin=n.supportsTouch||n.supportsPointerEvent?20:10,i.prototype.resizable=function(e){return function(t,e,n){if(Ro.object(e))return t.options.resize.enabled=!1!==e.enabled,t.setPerAction("resize",e),t.setOnEvents("resize",e),Ro.string(e.axis)&&/^x$|^y$|^xy$/.test(e.axis)?t.options.resize.axis=e.axis:null===e.axis&&(t.options.resize.axis=n.defaults.actions.resize.axis),Ro.bool(e.preserveAspectRatio)?t.options.resize.preserveAspectRatio=e.preserveAspectRatio:Ro.bool(e.square)&&(t.options.resize.square=e.square),t;if(Ro.bool(e))return t.options.resize.enabled=e,t;return t.options.resize}(this,e,t)},e.map.resize=ua,e.methodDict.resize="resizable",r.actions.resize=ua.defaults},listeners:{"interactions:new":({interaction:t})=>{t.resizeAxes="xy"},"interactions:action-start":t=>{!function({iEvent:t,interaction:e}){if("resize"!==e.prepared.name||!e.prepared.edges)return;const n=t,i=e.rect;e._rects={start:Ho({},i),corrected:Ho({},i),previous:Ho({},i),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},n.edges=e.prepared.edges,n.rect=e._rects.corrected,n.deltaRect=e._rects.delta}(t),ca(t)},"interactions:action-move":t=>{!function({iEvent:t,interaction:e}){if("resize"!==e.prepared.name||!e.prepared.edges)return;const n=t,i=e.interactable.options.resize.invert,r="reposition"===i||"negate"===i,o=e.rect,{start:s,corrected:a,delta:l,previous:c}=e._rects;if(Ho(c,a),r){if(Ho(a,o),"reposition"===i){if(a.top>a.bottom){const t=a.top;a.top=a.bottom,a.bottom=t}if(a.left>a.right){const t=a.left;a.left=a.right,a.right=t}}}else a.top=Math.min(o.top,s.bottom),a.bottom=Math.max(o.bottom,s.top),a.left=Math.min(o.left,s.right),a.right=Math.max(o.right,s.left);a.width=a.right-a.left,a.height=a.bottom-a.top;for(const t in a)l[t]=a[t]-c[t];n.edges=e.prepared.edges,n.rect=a,n.deltaRect=l}(t),ca(t)},"interactions:action-end":function({iEvent:t,interaction:e}){if("resize"!==e.prepared.name||!e.prepared.edges)return;const n=t;n.edges=e.prepared.edges,n.rect=e._rects.corrected,n.deltaRect=e._rects.delta},"auto-start:check":function(t){const{interaction:e,interactable:n,element:i,rect:r,buttons:o}=t;if(!r)return;const s=Ho({},e.coords.cur.page),a=n.options.resize;if(a&&a.enabled&&(!e.pointerIsDown||!/mouse|pointer/.test(e.pointerType)||0!=(o&a.mouseButtons))){if(Ro.object(a.edges)){const n={left:!1,right:!1,top:!1,bottom:!1};for(const t in n)n[t]=la(t,a.edges[t],s,e._latestPointer.eventTarget,i,r,a.margin||ua.defaultMargin);n.left=n.left&&!n.right,n.top=n.top&&!n.bottom,(n.left||n.right||n.top||n.bottom)&&(t.action={name:"resize",edges:n})}else{const e="y"!==a.axis&&s.x>r.right-ua.defaultMargin,n="x"!==a.axis&&s.y>r.bottom-ua.defaultMargin;(e||n)&&(t.action={name:"resize",axes:(e?"x":"")+(n?"y":"")})}return!t.action&&void 0}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor({edges:t,axis:e,name:n}){const i=ua.cursors;let r=null;if(e)r=i[n+e];else if(t){let e="";for(const n of["top","bottom","left","right"])t[n]&&(e+=n);r=i[e]}return r},defaultMargin:null},ha=ua;na.use(ha);const pa=()=>{},da=()=>{},fa=t=>{const e=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter((([e,n])=>e in t||n in t)),n=(n,i)=>{const{range:r,limits:o={left:-1/0,right:1/0,top:-1/0,bottom:1/0},offset:s={x:0,y:0}}=t,a={range:r,grid:t,x:null,y:null};for(const[r,l]of e){const e=Math.round((n-s.x)/t[r]),c=Math.round((i-s.y)/t[l]);a[r]=Math.max(o.left,Math.min(o.right,e*t[r]+s.x)),a[l]=Math.max(o.top,Math.min(o.bottom,c*t[l]+s.y))}return a};return n.grid=t,n.coordFields=e,n},ma={id:"snappers",install(t){const{interactStatic:n}=t;n.snappers=Ho(n.snappers||{},e),n.createSnapGrid=n.snappers.grid}},ga=ma;class ya{states=[];startOffset={left:0,right:0,top:0,bottom:0};startDelta;result;endResult;edges;interaction;constructor(t){this.interaction=t,this.result=va()}start({phase:t},e){const{interaction:n}=this,i=function(t){const e=t.interactable.options[t.prepared.name],n=e.modifiers;if(n&&n.length)return n;return["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map((t=>{const n=e[t];return n&&n.enabled&&{options:n,methods:n._methods}})).filter((t=>!!t))}(n);this.prepareStates(i),this.edges=Ho({},n.edges),this.startOffset=function(t,e){return t?{left:e.x-t.left,top:e.y-t.top,right:t.right-e.x,bottom:t.bottom-e.y}:{left:0,top:0,right:0,bottom:0}}(n.rect,e),this.startDelta={x:0,y:0};const r=this.fillArg({phase:t,pageCoords:e,preEnd:!1});this.result=va(),this.startAll(r);return this.result=this.setAll(r)}fillArg(t){const{interaction:e}=this;return t.interaction=e,t.interactable=e.interactable,t.element=e.element,t.rect=t.rect||e.rect,t.edges=this.edges,t.startOffset=this.startOffset,t}startAll(t){for(const e of this.states)e.methods.start&&(t.state=e,e.methods.start(t))}setAll(t){const{phase:e,preEnd:n,skipModifiers:i,rect:r}=t;t.coords=Ho({},t.pageCoords),t.rect=Ho({},r);const o=i?this.states.slice(i):this.states,s=va(t.coords,t.rect);for(const i of o){var a;const{options:r}=i,o=Ho({},t.coords);let l=null;null!=(a=i.methods)&&a.set&&this.shouldDo(r,n,e)&&(t.state=i,l=i.methods.set(t),hs(this.interaction.edges,t.rect,{x:t.coords.x-o.x,y:t.coords.y-o.y})),s.eventProps.push(l)}s.delta.x=t.coords.x-t.pageCoords.x,s.delta.y=t.coords.y-t.pageCoords.y,s.rectDelta.left=t.rect.left-r.left,s.rectDelta.right=t.rect.right-r.right,s.rectDelta.top=t.rect.top-r.top,s.rectDelta.bottom=t.rect.bottom-r.bottom;const l=this.result.coords,c=this.result.rect;if(l&&c){const t=s.rect.left!==c.left||s.rect.right!==c.right||s.rect.top!==c.top||s.rect.bottom!==c.bottom;s.changed=t||l.x!==s.coords.x||l.y!==s.coords.y}return s}applyToInteraction(t){const{interaction:e}=this,{phase:n}=t,i=e.coords.cur,r=e.coords.start,{result:o,startDelta:s}=this,a=o.delta;"start"===n&&Ho(this.startDelta,o.delta);for(const[t,e]of[[r,s],[i,a]])t.page.x+=e.x,t.page.y+=e.y,t.client.x+=e.x,t.client.y+=e.y;const{rectDelta:l}=this.result,c=t.rect||e.rect;c.left+=l.left,c.right+=l.right,c.top+=l.top,c.bottom+=l.bottom,c.width=c.right-c.left,c.height=c.bottom-c.top}setAndApply(t){const{interaction:e}=this,{phase:n,preEnd:i,skipModifiers:r}=t,o=this.setAll(this.fillArg({preEnd:i,phase:n,pageCoords:t.modifiedCoords||e.coords.cur.page}));if(this.result=o,!o.changed&&(!r||rBo(t))),this.result=va(Ho({},t.result.coords),Ho({},t.result.rect))}destroy(){for(const t in this)this[t]=null}}function va(t,e){return{rect:e,coords:t,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function ba(t,e){const{defaults:n}=t,i={start:t.start,set:t.set,beforeEnd:t.beforeEnd,stop:t.stop},r=t=>{const r=t||{};r.enabled=!1!==r.enabled;for(const t in n)t in r||(r[t]=n[t]);const o={options:r,methods:i,name:e,enable:()=>(r.enabled=!0,o),disable:()=>(r.enabled=!1,o)};return o};return e&&"string"==typeof e&&(r._defaults=n,r._methods=i),r}function wa({iEvent:t,interaction:e}){const n=e.modification.result;n&&(t.modifiers=n.eventProps)}const xa={id:"modifiers/base",before:["actions"],install:t=>{t.defaults.perAction.modifiers=[]},listeners:{"interactions:new":({interaction:t})=>{t.modification=new ya(t)},"interactions:before-action-start":t=>{const e=t.interaction.modification;e.start(t,t.interaction.coords.start.page),t.interaction.edges=e.edges,e.applyToInteraction(t)},"interactions:before-action-move":t=>t.interaction.modification.setAndApply(t),"interactions:before-action-end":t=>t.interaction.modification.beforeEnd(t),"interactions:action-start":wa,"interactions:action-move":wa,"interactions:action-end":wa,"interactions:after-action-start":t=>t.interaction.modification.restoreInteractionCoords(t),"interactions:after-action-move":t=>t.interaction.modification.restoreInteractionCoords(t),"interactions:stop":t=>t.interaction.modification.stop(t)}},_a=xa,Sa={start(t){const{state:e,rect:n,edges:i,pageCoords:r}=t;let{ratio:o}=e.options;const{equalDelta:s,modifiers:a}=e.options;"preserve"===o&&(o=n.width/n.height),e.startCoords=Ho({},r),e.startRect=Ho({},n),e.ratio=o,e.equalDelta=s;const l=e.linkedEdges={top:i.top||i.left&&!i.bottom,left:i.left||i.top&&!i.right,bottom:i.bottom||i.right&&!i.top,right:i.right||i.bottom&&!i.left};if(e.xIsPrimaryAxis=!(!i.left&&!i.right),e.equalDelta){const t=(l.left?1:-1)*(l.top?1:-1);e.edgeSign={x:t,y:t}}else e.edgeSign={x:l.left?-1:1,y:l.top?-1:1};if(Ho(t.edges,l),!a||!a.length)return;const c=new ya(t.interaction);c.copyFrom(t.interaction.modification),c.prepareStates(a),e.subModification=c,c.startAll({...t})},set(t){const{state:e,rect:n,coords:i}=t,r=Ho({},i),o=e.equalDelta?Ea:Ta;if(o(e,e.xIsPrimaryAxis,i,n),!e.subModification)return null;const s=Ho({},n);hs(e.linkedEdges,s,{x:i.x-r.x,y:i.y-r.y});const a=e.subModification.setAll({...t,rect:s,edges:e.linkedEdges,pageCoords:i,prevCoords:i,prevRect:s}),{delta:l}=a;if(a.changed){o(e,Math.abs(l.x)>Math.abs(l.y),a.coords,a.rect),Ho(i,a.coords)}return a.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function Ea({startCoords:t,edgeSign:e},n,i){n?i.y=t.y+(i.x-t.x)*e.y:i.x=t.x+(i.y-t.y)*e.x}function Ta({startRect:t,startCoords:e,ratio:n,edgeSign:i},r,o,s){if(r){const r=s.width/n;o.y=e.y+(r-t.height)*i.y}else{const r=s.height*n;o.x=e.x+(r-t.width)*i.x}}const Oa=ba(Sa,"aspectRatio"),Ma=()=>{};Ma._defaults={};const Da=Ma;function Aa(t,e,n){return Ro.func(t)?ls(t,e.interactable,e.element,[n.x,n.y,e]):ls(t,e.interactable,e.element)}const Pa={start:function({rect:t,startOffset:e,state:n,interaction:i,pageCoords:r}){const{options:o}=n,{elementRect:s}=o,a=Ho({left:0,top:0,right:0,bottom:0},o.offset||{});if(t&&s){const n=Aa(o.restriction,i,r);if(n){const e=n.right-n.left-t.width,i=n.bottom-n.top-t.height;e<0&&(a.left+=e,a.right+=e),i<0&&(a.top+=i,a.bottom+=i)}a.left+=e.left-t.width*s.left,a.top+=e.top-t.height*s.top,a.right+=e.right-t.width*(1-s.right),a.bottom+=e.bottom-t.height*(1-s.bottom)}n.offset=a},set:function({coords:t,interaction:e,state:n}){const{options:i,offset:r}=n,o=Aa(i.restriction,e,t);if(!o)return;const s=function(t){return!t||"left"in t&&"top"in t||((t=Ho({},t)).left=t.x||0,t.top=t.y||0,t.right=t.right||t.left+t.width,t.bottom=t.bottom||t.top+t.height),t}(o);t.x=Math.max(Math.min(s.right-r.right,t.x),s.left+r.left),t.y=Math.max(Math.min(s.bottom-r.bottom,t.y),s.top+r.top)},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},Ca=ba(Pa,"restrict"),Ia={top:1/0,left:1/0,bottom:-1/0,right:-1/0},ka={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function ja(t,e){for(const n of["top","left","bottom","right"])n in t||(t[n]=e[n]);return t}const Na={noInner:Ia,noOuter:ka,start:function({interaction:t,startOffset:e,state:n}){const{options:i}=n;let r;if(i){r=cs(Aa(i.offset,t,t.coords.start.page))}r=r||{x:0,y:0},n.offset={top:r.y+e.top,left:r.x+e.left,bottom:r.y-e.bottom,right:r.x-e.right}},set:function({coords:t,edges:e,interaction:n,state:i}){const{offset:r,options:o}=i;if(!e)return;const s=Ho({},t),a=Aa(o.inner,n,s)||{},l=Aa(o.outer,n,s)||{};ja(a,Ia),ja(l,ka),e.top?t.y=Math.min(Math.max(l.top+r.top,s.y),a.top+r.top):e.bottom&&(t.y=Math.max(Math.min(l.bottom+r.bottom,s.y),a.bottom+r.bottom)),e.left?t.x=Math.min(Math.max(l.left+r.left,s.x),a.left+r.left):e.right&&(t.x=Math.max(Math.min(l.right+r.right,s.x),a.right+r.right))},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},Ra=ba(Na,"restrictEdges"),qa=Ho({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(t){}},Pa.defaults),za=ba({start:Pa.start,set:Pa.set,defaults:qa},"restrictRect"),Fa={width:-1/0,height:-1/0},La={width:1/0,height:1/0};const Xa={start:function(t){return Na.start(t)},set:function(t){const{interaction:e,state:n,rect:i,edges:r}=t,{options:o}=n;if(!r)return;const s=us(Aa(o.min,e,t.coords))||Fa,a=us(Aa(o.max,e,t.coords))||La;n.options={endOnly:o.endOnly,inner:Ho({},Na.noInner),outer:Ho({},Na.noOuter)},r.top?(n.options.inner.top=i.bottom-s.height,n.options.outer.top=i.bottom-a.height):r.bottom&&(n.options.inner.bottom=i.top+s.height,n.options.outer.bottom=i.top+a.height),r.left?(n.options.inner.left=i.right-s.width,n.options.outer.left=i.right-a.width):r.right&&(n.options.inner.right=i.left+s.width,n.options.outer.right=i.left+a.width),Na.set(t),n.options=o},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},Ya=ba(Xa,"restrictSize");const Ba={start:function(t){const{interaction:e,interactable:n,element:i,rect:r,state:o,startOffset:s}=t,{options:a}=o,l=a.offsetWithOrigin?function(t){const{element:e}=t.interaction,n=cs(ls(t.state.options.origin,null,null,[e]));return n||ps(t.interactable,e,t.interaction.prepared.name)}(t):{x:0,y:0};let c;if("startCoords"===a.offset)c={x:e.coords.start.page.x,y:e.coords.start.page.y};else{const t=ls(a.offset,n,i,[e]);c=cs(t)||{x:0,y:0},c.x+=l.x,c.y+=l.y}const{relativePoints:u}=a;o.offsets=r&&u&&u.length?u.map(((t,e)=>({index:e,relativePoint:t,x:s.left-r.width*t.x+c.x,y:s.top-r.height*t.y+c.y}))):[{index:0,relativePoint:null,x:c.x,y:c.y}]},set:function(t){const{interaction:e,coords:n,state:i}=t,{options:r,offsets:o}=i,s=ps(e.interactable,e.element,e.prepared.name),a=Ho({},n),l=[];r.offsetWithOrigin||(a.x-=s.x,a.y-=s.y);for(const t of o){const n=a.x-t.x,i=a.y-t.y;for(let o=0,s=r.targets.length;o=a)return!1;if(r.interactable===t){if(c+=i===n.name?1:0,c>=o)return!1;if(r.element===e&&(u++,i===n.name&&u>=s))return!1}}}return a>0}function ol(t,e){return Ro.number(t)?(e.autoStart.maxInteractions=t,this):e.autoStart.maxInteractions}function sl(t,e,n){const{cursorElement:i}=n.autoStart;i&&i!==t&&(i.style.cursor=""),t.ownerDocument.documentElement.style.cursor=e,t.style.cursor=e,n.autoStart.cursorElement=e?t:null}function al(t,e){const{interactable:n,element:i,prepared:r}=t;if("mouse"!==t.pointerType||!n||!n.options.styleCursor)return void(e.autoStart.cursorElement&&sl(e.autoStart.cursorElement,"",e));let o="";if(r.name){const s=n.options[r.name].cursorChecker;o=Ro.func(s)?s(r,n,i,t._interacting):e.actions.map[r.name].getCursor(r)}sl(t.element,o||"",e)}const ll={id:"auto-start/base",before:["actions"],install:function(t){const{interactStatic:e,defaults:n}=t;t.usePlugin(Ja),n.base.actionChecker=null,n.base.styleCursor=!0,Ho(n.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),e.maxInteractions=e=>ol(e,t),t.autoStart={maxInteractions:1/0,withinInteractionLimit:rl,cursorElement:null}},listeners:{"interactions:down":function({interaction:t,pointer:e,event:n,eventTarget:i},r){if(t.interacting())return;il(t,nl(t,e,n,i,r),r)},"interactions:move":(t,e)=>{!function({interaction:t,pointer:e,event:n,eventTarget:i},r){if("mouse"!==t.pointerType||t.pointerIsDown||t.interacting())return;il(t,nl(t,e,n,i,r),r)}(t,e),function(t,e){const{interaction:n}=t;if(!n.pointerIsDown||n.interacting()||!n.pointerWasMoved||!n.prepared.name)return;e.fire("autoStart:before-start",t);const{interactable:i}=n,r=n.prepared.name;r&&i&&(i.options[r].manualStart||!rl(i,n.element,n.prepared,e)?n.stop():(n.start(n.prepared,i,n.element),al(n,e)))}(t,e)},"interactions:stop":function({interaction:t},e){const{interactable:n}=t;n&&n.options.styleCursor&&sl(t.element,"",e)}},maxInteractions:ol,withinInteractionLimit:rl,validateAction:tl},cl=ll;const ul={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function({interaction:t,eventTarget:e,dx:n,dy:i},r){if("drag"!==t.prepared.name)return;const o=Math.abs(n),s=Math.abs(i),a=t.interactable.options.drag,l=a.startAxis,c=o>s?"x":o{t.autoStartHoldTimer=null},"autoStart:prepared":({interaction:t})=>{const e=hl(t);e>0&&(t.autoStartHoldTimer=setTimeout((()=>{t.start(t.prepared,t.interactable,t.element)}),e))},"interactions:move":({interaction:t,duplicate:e})=>{t.autoStartHoldTimer&&t.pointerWasMoved&&!e&&(clearTimeout(t.autoStartHoldTimer),t.autoStartHoldTimer=null)},"autoStart:before-start":({interaction:t})=>{hl(t)>0&&(t.prepared.name=null)}},getHoldDuration:hl},dl=pl,fl={id:"auto-start",install(t){t.usePlugin(cl),t.usePlugin(dl),t.usePlugin(ul)}};function ml(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function gl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var yl;na.use(fl),function(){function t(t,e,n){this.el=t,t.remember("_paintHandler",this);var i=this,r=this.getPlugin();for(var o in this.parent=t.parent(),this.p=this.parent.node.createSVGPoint(),this.m=null,this.startPoint=null,this.lastUpdateCall=null,this.options={},this.set=new Set,this.el.draw.defaults)this.options[o]=this.el.draw.defaults[o],void 0!==n[o]&&(this.options[o]=n[o]);for(var o in r.point&&(r.pointPlugin=r.point,delete r.point),r)this[o]=r[o];e||this.parent.on("click.draw",(function(t){i.start(t)}))}t.prototype.transformPoint=function(t,e){return this.p.x=t-(this.offset.x-window.pageXOffset),this.p.y=e-(this.offset.y-window.pageYOffset),this.p.matrixTransform(this.m)},t.prototype.start=function(t){var e=this;this.m=this.el.node.getScreenCTM().inverse(),this.offset={x:window.pageXOffset,y:window.pageYOffset},this.options.snapToGrid*=Math.sqrt(this.m.a*this.m.a+this.m.b*this.m.b),this.startPoint=this.snapToGrid(this.transformPoint(t.clientX,t.clientY)),this.init&&this.init(t),this.el.fire("drawstart",{event:t,p:this.p,m:this.m}),xt(window,"mousemove.draw",(function(t){e.update(t)})),this.start=this.point},t.prototype.point=function(t){return this.point!=this.start?this.start(t):this.pointPlugin?this.pointPlugin(t):void this.stop(t)},t.prototype.stop=function(t){t&&this.update(t),this.clean&&this.clean(),_t(window,"mousemove.draw"),this.parent.off("click.draw"),this.el.forget("_paintHandler"),this.el.draw=function(){},this.el.fire("drawstop")},t.prototype.update=function(t){!t&&this.lastUpdateCall&&(t=this.lastUpdateCall),this.lastUpdateCall=t,this.m=this.el.node.getScreenCTM().inverse(),this.calc(t),this.el.fire("drawupdate",{event:t,p:this.p,m:this.m})},t.prototype.done=function(){this.calc(),this.stop(),this.el.fire("drawdone")},t.prototype.cancel=function(){this.stop(),this.el.remove(),this.el.fire("drawcancel")},t.prototype.snapToGrid=function(t){var e=null;if(t.length)return e=[t[0]%this.options.snapToGrid,t[1]%this.options.snapToGrid],t[0]-=e[0]-1){var e=this.transformPoint(t.clientX,t.clientY),n=this.el.array().valueOf();return n.push(this.snapToGrid([e.x,e.y])),this.el.plot(n),this.drawCircles(),void this.el.fire("drawpoint",{event:t,p:{x:e.x,y:e.y},m:this.m})}this.stop(t)},clean:function(){this.set.forEach((function(t){t.remove()})),this.set.clear(),delete this.set},drawCircles:function(){var t=this.el.array().valueOf();this.set.forEach((function(t){t.remove()})),this.set.clear();for(var e=0;e');var a=n.querySelector("area:last-child");e.querySelectorAll(".imagemap-area-input").forEach((function(t){return Dl(t,a)})),e.querySelectorAll('select[data-prop="shape"], input[data-prop="coords"]').forEach((function(t){var n=t.onchange;t.onchange=function(){n(),Hl(e,i)}}));var l=e.querySelector("select.imagemap-area-target");l.onchange=function(){return e.querySelector(".imagemap-area-anchor").hidden="embed"!==l.value},"external"===r.value&&(l.querySelector('option[value="embed"]').hidden=!0,l.querySelector('option[value="popin"]').hidden=!0),e.querySelectorAll(".ibexa-dropdown").forEach((function(e){!!t.g.ibexa.helpers.objectInstances.getInstance(e)||new t.g.ibexa.core.Dropdown({container:e}).init()})),Hl(e,i)},Dl=function(t,e){var n=t.dataset.prop;t.onchange=function(){return e[n]=t.value},t.onchange()},Al=function(t,e){var n=t.parentNode;e.findOne('*[data-uuid="'.concat(t.dataset.uuid,'"]')).remove(),t.remove(),Cl(n)},Pl=function(t,e,n,i){t.insertAdjacentHTML("beforeend",e.replace(/__name__/g,100)),Cl(t),Ml(t.querySelector(".imagemap-area:last-child"),n,i)},Cl=function(t){t.querySelectorAll(".imagemap-area").forEach((function(t,e){t.querySelectorAll("*[name]").forEach((function(t){return t.name=t.name.replace(/\[map]\[\d+]/g,"[map]["+e+"]")}))}))},Il=function(t){var e=t.querySelector(".imagemap-relation-internal"),n=t.querySelector(".imagemap-relation-external"),i=t.querySelector(".imagemap-relation-source"),r=t.querySelector(".imagemap-area-target");i.value="","internal"===this.value?(e.hidden=!1,e.querySelector(".imagemap-relation-name").textContent="",n.hidden=!0,"embed"!==r.value&&"popin"!==r.value||(r.value="_blank"),r.querySelector('option[value="embed"]').hidden=!0,r.querySelector('option[value="popin"]').hidden=!0):(n.hidden=!1,n.querySelector(".imagemap-relation-external-link").value="",e.hidden=!0,r.querySelector('option[value="embed"]').hidden=!1,r.querySelector('option[value="popin"]').hidden=!1)},kl=function(t,e,n){t.querySelector(".imagemap-relation-source").value="ezobject://"+n[0].ContentInfo.Content._id,t.querySelector(".imagemap-relation-name").textContent=n[0].ContentInfo.Content.TranslatedName,i().unmountComponentAtNode(e)},jl=function(t,e){var n=document.querySelector("#react-udw"),r=document.querySelector('meta[name="CSRF-Token"]').content,o=document.querySelector('meta[name="SiteAccess"]').content;i().render(React.createElement(eZ.modules.UniversalDiscovery,function(t){for(var e=1;e - {% set label_wrapper_attr = label_wrapper_attr|default({})|merge({'class': (label_wrapper_attr.class|default('') ~ 'ez-field-edit__label-wrapper')|trim}) %} - {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' ez-field-edit__label')|trim}) %} + {% set label_wrapper_attr = label_wrapper_attr|default({})|merge({'class': (label_wrapper_attr.class|default('') ~ 'ibexa-field-edit__label-wrapper')|trim}) %} + {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' ibexa-field-edit__label')|trim}) %} {{- block('form_label') }}
-
- - - +
+ + + @@ -18,7 +18,7 @@ {% set preview_block_name = 'ezimage_preview' %} {% set max_file_size = max_upload_size|round %} {% set attr = attr|merge({'accept': 'image/*'}) %} - {% set wrapper_attr = {'class': 'ez-field-edit--ezimage'} %} + {% set wrapper_attr = {'class': 'ibexa-field-edit--ezimage'} %} {% set label_wrapper_attr = {'hidden': true} %} {{ block('binary_base_row') }} {{ form_row(form.map) }} @@ -50,7 +50,7 @@ {{ form_row(child) }} {% endfor %}
- +
{% endblock %} @@ -59,8 +59,8 @@
@@ -92,7 +92,7 @@ {% block imagemap_link_row %} {% set internal = content is not null %} -
@@ -105,12 +105,12 @@
- {{ content ? ez_content_name(content) : 'imagemap.link.no_content'|trans }} + {{ content ? ibexa_content_name(content) : 'imagemap.link.no_content'|trans }}
diff --git a/src/Resources/views/themes/standard/default/content/imagemap_embed.html.twig b/src/Resources/views/themes/standard/default/content/imagemap_embed.html.twig index 38133bf..7738cc7 100644 --- a/src/Resources/views/themes/standard/default/content/imagemap_embed.html.twig +++ b/src/Resources/views/themes/standard/default/content/imagemap_embed.html.twig @@ -1 +1 @@ -{{ ez_render_content(content, {'viewType': 'embed'}) }} +{{ ibexa_render_content(content, {'viewType': 'embed'}) }} diff --git a/src/Resources/views/themes/standard/default/content/imagemap_popin.html.twig b/src/Resources/views/themes/standard/default/content/imagemap_popin.html.twig index 38133bf..7738cc7 100644 --- a/src/Resources/views/themes/standard/default/content/imagemap_popin.html.twig +++ b/src/Resources/views/themes/standard/default/content/imagemap_popin.html.twig @@ -1 +1 @@ -{{ ez_render_content(content, {'viewType': 'embed'}) }} +{{ ibexa_render_content(content, {'viewType': 'embed'}) }} diff --git a/src/Resources/views/themes/standard/fields/imagemap_content_fields.html.twig b/src/Resources/views/themes/standard/fields/imagemap_content_fields.html.twig index 950146c..8c75384 100644 --- a/src/Resources/views/themes/standard/fields/imagemap_content_fields.html.twig +++ b/src/Resources/views/themes/standard/fields/imagemap_content_fields.html.twig @@ -23,7 +23,7 @@ {% elseif item.target == 'popin' %} {% set link = '#imagemap-target-' ~ field.id ~ '-' ~ item.content.id %} {% else %} - {% set link = path('ez_urlalias', {'contentId': item.content.id}) %} + {% set link = path('ibexa.url.alias', {'contentId': item.content.id}) %} {% endif %} {% endif %} @@ -39,7 +39,7 @@ {% for item in items|filter((item) => item.target == 'embed')|filter((item) => item.content is defined) %} {% set id = item.anchor ?: 'imagemap-target-' ~ field.id ~ '-' ~ item.content.id %} {% endfor %}
@@ -48,7 +48,7 @@
- {{ ez_render_content(item.content, {'viewType': 'imagemap_popin'}) }} + {{ ibexa_render_content(item.content, {'viewType': 'imagemap_popin'}) }}
From 315c7facf74121282a2661b0ef33be6014b3bb39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Bouch=C3=A9?= Date: Mon, 8 Jan 2024 16:37:55 +0100 Subject: [PATCH 14/15] Ibexa 4 support (14) --- src/FieldType/ImageMap/Type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FieldType/ImageMap/Type.php b/src/FieldType/ImageMap/Type.php index f152936..8b7e8c0 100755 --- a/src/FieldType/ImageMap/Type.php +++ b/src/FieldType/ImageMap/Type.php @@ -18,7 +18,7 @@ public function getFieldTypeIdentifier() return 'imagemap'; } - public function validateFieldSettings($fieldSettings) + public function validateFieldSettings($fieldSettings): array { return []; } From 05a8ae58b0976953f7fc7997a3c7ae6c5ce946b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20J?= Date: Wed, 31 Jul 2024 09:13:25 +0200 Subject: [PATCH 15/15] Restrict version below 4.6.2 as ImageStorage constructor got a new argument --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index def15d5..1922057 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "ext-json": "*", "http-interop/http-factory-guzzle": "^1.2", "ibexa/admin-ui": "^4.5.3", - "ibexa/core": "^4.5.3" + "ibexa/core": ">=4.5.3 <4.6.2" }, "require-dev": { "phpstan/phpstan": "^1.10"