diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000..5008ddfcf5 Binary files /dev/null and b/.DS_Store differ diff --git a/bin/build_directus.sh b/bin/build_directus.sh new file mode 100644 index 0000000000..f99a927bcd --- /dev/null +++ b/bin/build_directus.sh @@ -0,0 +1,10 @@ +rm -rf .directus-build +git clone https://github.com/directus/directus.git .directus-build + +pushd .directus-build + npm install + gulp build + gulp deploy +popd + +rm -rf .directus-build diff --git a/bin/build_subtree.sh b/bin/build_subtree.sh new file mode 100644 index 0000000000..04dd71f2b3 --- /dev/null +++ b/bin/build_subtree.sh @@ -0,0 +1,27 @@ +git subsplit init git@github.com:directus/directus.git + +# Collection +git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Collection:git@github.com:directus/directus-collection.git + +# Config +git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Config:git@github.com:directus/directus-config.git + +# Permissions +git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Permissions:git@github.com:directus/directus-permissions.git + +# Database +git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Database:git@github.com:directus/directus-database.git + +# Filesystem +git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Filesystem:git@github.com:directus/directus-filesystem.git + +# Hash +git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Hash:git@github.com:directus/directus-hash.git + +# Hooks +git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Hook:git@github.com:directus/directus-hook.git + +# Utils +git subsplit publish --heads="version/6.4" --no-tags --debug api/core/Directus/Util:git@github.com:directus/directus-php-utils.git + +rm -rf .subsplit diff --git a/bin/directus b/bin/directus new file mode 100755 index 0000000000..0106175b11 --- /dev/null +++ b/bin/directus @@ -0,0 +1,11 @@ +#!/usr/bin/env php +run(); + +?> diff --git a/bin/runtests.sh b/bin/runtests.sh new file mode 100755 index 0000000000..75a898fed5 --- /dev/null +++ b/bin/runtests.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# +# Command line runner for unit tests for composer projects +# (c) Del 2015 http://www.babel.com.au/ +# No Rights Reserved +# + +# +# Clean up after any previous test runs +# +mkdir -p documents +rm -rf documents/coverage-html-new +rm -f documents/coverage.xml + +# +# Run phpunit +# +vendor/bin/phpunit --coverage-html documents/coverage-html-new --coverage-clover documents/coverage.xml + +if [ -d documents/coverage-html-new ]; then + rm -rf documents/coverage-html + mv documents/coverage-html-new documents/coverage-html +fi + diff --git a/config/api_sample.php b/config/api_sample.php new file mode 100644 index 0000000000..3a12c8f2a4 --- /dev/null +++ b/config/api_sample.php @@ -0,0 +1,155 @@ + [ + 'path' => '/', + 'env' => 'development', + 'debug' => true, + 'default_language' => 'en', + 'timezone' => 'America/New_York', + ], + + 'settings' => [ + 'debug' => true, + 'displayErrorDetails' => true, + 'logger' => [ + 'name' => 'directus-api', + 'level' => Monolog\Logger::DEBUG, + 'path' => __DIR__ . '/logs/app.log', + ], + ], + + 'database' => [ + 'type' => 'mysql', + 'host' => 'localhost', + 'port' => 3306, + 'name' => 'directus', + 'username' => 'root', + 'password' => 'pass', + 'prefix' => '', // not used + 'engine' => 'InnoDB', + 'charset' => 'utf8mb4' + ], + + 'cache' => [ + 'enabled' => false, + 'response_ttl' => 3600, // seconds + 'adapter' => 'filesystem', + 'path' => '/storage/cache', + // 'pool' => [ + // 'adapter' => 'apc' + // ], + // 'pool' => [ + // 'adapter' => 'apcu' + // ], + // 'pool' => [ + // 'adapter' => 'filesystem', + // 'path' => '../cache/', // relative to the api directory + // ], + // 'pool' => [ + // 'adapter' => 'memcached', + // 'host' => 'localhost', + // 'port' => 11211 + // ], + // 'pool' => [ + // 'adapter' => 'redis', + // 'host' => 'localhost', + // 'port' => 6379 + // ], + ], + + 'filesystem' => [ + 'adapter' => 'local', + // By default media directory are located at the same level of directus root + // To make them a level up outsite the root directory + // use this instead + // Ex: 'root' => realpath(ROOT_PATH.'/../storage/uploads'), + // Note: ROOT_PATH constant doesn't end with trailing slash + 'root' => 'storage/uploads', + // This is the url where all the media will be pointing to + // here all assets will be (yourdomain)/storage/uploads + // same with thumbnails (yourdomain)/storage/uploads/thumbs + 'root_url' => '/storage/uploads', + 'root_thumb_url' => '/storage/uploads/thumbs', + // 'key' => 's3-key', + // 'secret' => 's3-key', + // 'region' => 's3-region', + // 'version' => 's3-version', + // 'bucket' => 's3-bucket' + ], + + // HTTP Settings + 'http' => [ + 'emulate_enabled' => false, + // can be null, or an array list of method to be emulated + // Ex: ['PATH', 'DELETE', 'PUT'] + // 'emulate_methods' => null, + 'force_https' => false + ], + + 'mail' => [ + 'transport' => 'mail', + 'from' => 'admin@admin.com' + ], + + 'cors' => [ + 'enabled' => false, + 'origin' => ['*'], + 'headers' => [ + ['Access-Control-Allow-Headers', 'Authorization, Content-Type, Access-Control-Allow-Origin'], + ['Access-Control-Allow-Methods', 'GET,POST,PUT,PATCH,DELETE'], + ['Access-Control-Allow-Credentials', 'false'] + ] + ], + + 'rate_limit' => [ + 'enabled' => false, + 'limit' => 100, // number of request + 'interval' => 60, // seconds + 'adapter' => 'redis', + 'host' => '127.0.0.1', + 'port' => 6379, + 'timeout' => 10 + ], + + 'hooks' => [], + + 'filters' => [], + + 'feedback' => [ + 'token' => 'a-kind-of-unique-token', + 'login' => true + ], + + // These tables will not be loaded in the directus schema + 'tableBlacklist' => [], + + 'auth' => [ + 'secret_key' => '', + 'social_providers' => [ + // 'okta' => [ + // 'client_id' => '', + // 'client_secret' => '', + // 'base_url' => 'https://dev-000000.oktapreview.com/oauth2/default' + // ], + // 'github' => [ + // 'client_id' => '', + // 'client_secret' => '' + // ], + // 'facebook' => [ + // 'client_id' => '', + // 'client_secret' => '', + // 'graph_api_version' => 'v2.8', + // ], + // 'google' => [ + // 'client_id' => '', + // 'client_secret' => '', + // 'hosted_domain' => '*', + // ], + // 'twitter' => [ + // 'identifier' => '', + // 'secret' => '' + // ] + ] + ], +]; diff --git a/config/migrations.php b/config/migrations.php new file mode 100644 index 0000000000..5c747e8a76 --- /dev/null +++ b/config/migrations.php @@ -0,0 +1,15 @@ + [ + 'migrations' => '%%PHINX_CONFIG_DIR%%/../migrations/db/schemas', + 'seeds' => '%%PHINX_CONFIG_DIR%%/../migrations/db/seeds' + ], + + 'version_order' => 'creation', + + 'environments' => [ + 'default_migration_table' => 'directus_migrations', + 'default_database' => 'development' + ] +]; diff --git a/logs/.gitkeep b/logs/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/logs/error.2018-07-15.log b/logs/error.2018-07-15.log new file mode 100644 index 0000000000..d4092c06d1 --- /dev/null +++ b/logs/error.2018-07-15.log @@ -0,0 +1,108 @@ +[2018-07-15 08:14:21] api[_].ERROR: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'DT.managed' in 'field list' in /Users/rijkvanzanten/Development/api/vendor/zendframework/zend-db/src/Adapter/Driver/Pdo/Statement.php:239 +Stack trace: +#0 /Users/rijkvanzanten/Development/api/vendor/zendframework/zend-db/src/Adapter/Driver/Pdo/Statement.php(239): PDOStatement->execute() +#1 /Users/rijkvanzanten/Development/api/src/core/Directus/Database/Schema/Sources/MySQLSchema.php(101): Zend\Db\Adapter\Driver\Pdo\Statement->execute() +#2 /Users/rijkvanzanten/Development/api/src/core/Directus/Database/Schema/Sources/MySQLSchema.php(135): Directus\Database\Schema\Sources\MySQLSchema->getCollections(Array) +#3 /Users/rijkvanzanten/Development/api/src/core/Directus/Database/Schema/SchemaManager.php(122): Directus\Database\Schema\Sources\MySQLSchema->getCollection('directus_activi...') +#4 /Users/rijkvanzanten/Development/api/src/core/Directus/Database/SchemaService.php(146): Directus\Database\Schema\SchemaManager->getCollection('directus_activi...', Array, false) +#5 /Users/rijkvanzanten/Development/api/src/core/Directus/Application/CoreServicesProvider.php(268): Directus\Database\SchemaService::getCollection('directus_activi...') +#6 [internal function]: Directus\Application\CoreServicesProvider->Directus\Application\{closure}(Object(Directus\Hook\Payload)) +#7 /Users/rijkvanzanten/Development/api/src/core/Directus/Hook/Emitter.php(291): call_user_func_array(Object(Closure), Array) +#8 /Users/rijkvanzanten/Development/api/src/core/Directus/Hook/Emitter.php(151): Directus\Hook\Emitter->executeListeners(Array, Array, 1) +#9 /Users/rijkvanzanten/Development/api/src/core/Directus/Database/TableGateway/BaseTableGateway.php(1468): Directus\Hook\Emitter->apply('collection.inse...', Array, Array) +#10 /Users/rijkvanzanten/Development/api/src/core/Directus/Database/TableGateway/BaseTableGateway.php(763): Directus\Database\TableGateway\BaseTableGateway->applyHook('collection.inse...', Array, Array) +#11 /Users/rijkvanzanten/Development/api/vendor/zendframework/zend-db/src/TableGateway/AbstractTableGateway.php(276): Directus\Database\TableGateway\BaseTableGateway->executeInsert(Object(Zend\Db\Sql\Insert)) +#12 /Users/rijkvanzanten/Development/api/src/core/Directus/Database/TableGateway/DirectusActivityTableGateway.php(119): Zend\Db\TableGateway\AbstractTableGateway->insertWith(Object(Zend\Db\Sql\Insert)) +#13 /Users/rijkvanzanten/Development/api/src/core/Directus/Services/AuthService.php(56): Directus\Database\TableGateway\DirectusActivityTableGateway->recordLogin('1') +#14 /Users/rijkvanzanten/Development/api/src/endpoints/Auth.php(49): Directus\Services\AuthService->loginWithCredentials('admin@example.c...', 'password') +#15 [internal function]: Directus\Api\Routes\Auth->authenticate(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Array) +#16 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(41): call_user_func(Array, Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Array) +#17 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/Route.php(335): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Array) +#18 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#19 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/Route.php(313): Slim\Route->callMiddlewareStack(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#20 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/App.php(513): Slim\Route->run(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#21 /Users/rijkvanzanten/Development/api/src/core/Directus/Application/Http/Middleware/TableGatewayMiddleware.php(26): Slim\App->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#22 [internal function]: Directus\Application\Http\Middleware\TableGatewayMiddleware->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Directus\Application\Application)) +#23 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Directus\Application\Http\Middleware\TableGatewayMiddleware), Array) +#24 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Directus\Application\Application)) +#25 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Directus\Application\Application)) +#26 /Users/rijkvanzanten/Development/api/src/core/Directus/Application/Http/Middleware/AbstractRateLimitMiddleware.php(34): Slim\App->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#27 [internal function]: Directus\Application\Http\Middleware\AbstractRateLimitMiddleware->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#28 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Directus\Application\Http\Middleware\IpRateLimitMiddleware), Array) +#29 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#30 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#31 /Users/rijkvanzanten/Development/api/vendor/akrabat/rka-ip-address-middleware/src/IpAddress.php(93): Slim\App->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#32 [internal function]: RKA\Middleware\IpAddress->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#33 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(RKA\Middleware\IpAddress), Array) +#34 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#35 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#36 /Users/rijkvanzanten/Development/api/src/core/Directus/Application/Http/Middleware/CorsMiddleware.php(20): Slim\App->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#37 [internal function]: Directus\Application\Http\Middleware\CorsMiddleware->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#38 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Directus\Application\Http\Middleware\CorsMiddleware), Array) +#39 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#40 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#41 /Users/rijkvanzanten/Development/api/src/core/Directus/Application/Http/Middleware/ResponseCacheMiddleware.php(47): Slim\App->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#42 [internal function]: Directus\Application\Http\Middleware\ResponseCacheMiddleware->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#43 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Directus\Application\Http\Middleware\ResponseCacheMiddleware), Array) +#44 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#45 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#46 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#47 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/App.php(406): Slim\App->callMiddlewareStack(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#48 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/App.php(314): Slim\App->process(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#49 /Users/rijkvanzanten/Development/api/src/core/Directus/Application/Application.php(161): Slim\App->run(false) +#50 /Users/rijkvanzanten/Development/api/public/index.php(5): Directus\Application\Application->run() +#51 {main} + +Next Zend\Db\Adapter\Exception\InvalidQueryException: Statement could not be executed (42S22 - 1054 - Unknown column 'DT.managed' in 'field list') in /Users/rijkvanzanten/Development/api/vendor/zendframework/zend-db/src/Adapter/Driver/Pdo/Statement.php:244 +Stack trace: +#0 /Users/rijkvanzanten/Development/api/src/core/Directus/Database/Schema/Sources/MySQLSchema.php(101): Zend\Db\Adapter\Driver\Pdo\Statement->execute() +#1 /Users/rijkvanzanten/Development/api/src/core/Directus/Database/Schema/Sources/MySQLSchema.php(135): Directus\Database\Schema\Sources\MySQLSchema->getCollections(Array) +#2 /Users/rijkvanzanten/Development/api/src/core/Directus/Database/Schema/SchemaManager.php(122): Directus\Database\Schema\Sources\MySQLSchema->getCollection('directus_activi...') +#3 /Users/rijkvanzanten/Development/api/src/core/Directus/Database/SchemaService.php(146): Directus\Database\Schema\SchemaManager->getCollection('directus_activi...', Array, false) +#4 /Users/rijkvanzanten/Development/api/src/core/Directus/Application/CoreServicesProvider.php(268): Directus\Database\SchemaService::getCollection('directus_activi...') +#5 [internal function]: Directus\Application\CoreServicesProvider->Directus\Application\{closure}(Object(Directus\Hook\Payload)) +#6 /Users/rijkvanzanten/Development/api/src/core/Directus/Hook/Emitter.php(291): call_user_func_array(Object(Closure), Array) +#7 /Users/rijkvanzanten/Development/api/src/core/Directus/Hook/Emitter.php(151): Directus\Hook\Emitter->executeListeners(Array, Array, 1) +#8 /Users/rijkvanzanten/Development/api/src/core/Directus/Database/TableGateway/BaseTableGateway.php(1468): Directus\Hook\Emitter->apply('collection.inse...', Array, Array) +#9 /Users/rijkvanzanten/Development/api/src/core/Directus/Database/TableGateway/BaseTableGateway.php(763): Directus\Database\TableGateway\BaseTableGateway->applyHook('collection.inse...', Array, Array) +#10 /Users/rijkvanzanten/Development/api/vendor/zendframework/zend-db/src/TableGateway/AbstractTableGateway.php(276): Directus\Database\TableGateway\BaseTableGateway->executeInsert(Object(Zend\Db\Sql\Insert)) +#11 /Users/rijkvanzanten/Development/api/src/core/Directus/Database/TableGateway/DirectusActivityTableGateway.php(119): Zend\Db\TableGateway\AbstractTableGateway->insertWith(Object(Zend\Db\Sql\Insert)) +#12 /Users/rijkvanzanten/Development/api/src/core/Directus/Services/AuthService.php(56): Directus\Database\TableGateway\DirectusActivityTableGateway->recordLogin('1') +#13 /Users/rijkvanzanten/Development/api/src/endpoints/Auth.php(49): Directus\Services\AuthService->loginWithCredentials('admin@example.c...', 'password') +#14 [internal function]: Directus\Api\Routes\Auth->authenticate(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Array) +#15 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(41): call_user_func(Array, Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Array) +#16 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/Route.php(335): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Array) +#17 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#18 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/Route.php(313): Slim\Route->callMiddlewareStack(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#19 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/App.php(513): Slim\Route->run(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#20 /Users/rijkvanzanten/Development/api/src/core/Directus/Application/Http/Middleware/TableGatewayMiddleware.php(26): Slim\App->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#21 [internal function]: Directus\Application\Http\Middleware\TableGatewayMiddleware->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Directus\Application\Application)) +#22 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Directus\Application\Http\Middleware\TableGatewayMiddleware), Array) +#23 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Directus\Application\Application)) +#24 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Directus\Application\Application)) +#25 /Users/rijkvanzanten/Development/api/src/core/Directus/Application/Http/Middleware/AbstractRateLimitMiddleware.php(34): Slim\App->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#26 [internal function]: Directus\Application\Http\Middleware\AbstractRateLimitMiddleware->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#27 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Directus\Application\Http\Middleware\IpRateLimitMiddleware), Array) +#28 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#29 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#30 /Users/rijkvanzanten/Development/api/vendor/akrabat/rka-ip-address-middleware/src/IpAddress.php(93): Slim\App->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#31 [internal function]: RKA\Middleware\IpAddress->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#32 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(RKA\Middleware\IpAddress), Array) +#33 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#34 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#35 /Users/rijkvanzanten/Development/api/src/core/Directus/Application/Http/Middleware/CorsMiddleware.php(20): Slim\App->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#36 [internal function]: Directus\Application\Http\Middleware\CorsMiddleware->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#37 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Directus\Application\Http\Middleware\CorsMiddleware), Array) +#38 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#39 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#40 /Users/rijkvanzanten/Development/api/src/core/Directus/Application/Http/Middleware/ResponseCacheMiddleware.php(47): Slim\App->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#41 [internal function]: Directus\Application\Http\Middleware\ResponseCacheMiddleware->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#42 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Directus\Application\Http\Middleware\ResponseCacheMiddleware), Array) +#43 [internal function]: Slim\DeferredCallable->__invoke(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#44 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response), Object(Closure)) +#45 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#46 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/App.php(406): Slim\App->callMiddlewareStack(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#47 /Users/rijkvanzanten/Development/api/vendor/slim/slim/Slim/App.php(314): Slim\App->process(Object(Directus\Application\Http\Request), Object(Directus\Application\Http\Response)) +#48 /Users/rijkvanzanten/Development/api/src/core/Directus/Application/Application.php(161): Slim\App->run(false) +#49 /Users/rijkvanzanten/Development/api/public/index.php(5): Directus\Application\Application->run() +#50 {main} [] [] diff --git a/migrations/db/schemas/20180220023138_create_activity_table.php b/migrations/db/schemas/20180220023138_create_activity_table.php new file mode 100644 index 0000000000..5f4cd03473 --- /dev/null +++ b/migrations/db/schemas/20180220023138_create_activity_table.php @@ -0,0 +1,87 @@ +table('directus_activity', ['signed' => false]); + + $table->addColumn('type', 'string', [ + 'limit' => 45, + 'null' => false + ]); + + $table->addColumn('action', 'string', [ + 'limit' => 45, + 'null' => false + ]); + + $table->addColumn('user', 'integer', [ + 'signed' => false, + 'null' => false, + 'default' => 0 + ]); + + $table->addColumn('datetime', 'datetime', [ + 'default' => null + ]); + + $table->addColumn('ip', 'string', [ + 'limit' => 50, + 'default' => null + ]); + + $table->addColumn('user_agent', 'string', [ + 'limit' => 255 + ]); + + $table->addColumn('collection', 'string', [ + 'limit' => 64, + 'null' => false + ]); + + $table->addColumn('item', 'string',[ + 'limit' => 255 + ]); + + $table->addColumn('datetime_edited', 'datetime', [ + 'null' => true, + 'default' => null + ]); + + $table->addColumn('comment', 'text', [ + 'null' => true + ]); + + $table->addColumn('deleted_comment', 'boolean', [ + 'signed' => false, + 'null' => true, + 'default' => false + ]); + + $table->create(); + } +} diff --git a/migrations/db/schemas/20180220023144_create_activity_seen_table.php b/migrations/db/schemas/20180220023144_create_activity_seen_table.php new file mode 100644 index 0000000000..0247e3cbf4 --- /dev/null +++ b/migrations/db/schemas/20180220023144_create_activity_seen_table.php @@ -0,0 +1,60 @@ +table('directus_activity_seen', ['signed' => false]); + + $table->addColumn('activity', 'integer', [ + 'null' => false, + 'signed' => false + ]); + + $table->addColumn('user', 'integer', [ + 'signed' => false, + 'null' => false, + 'default' => 0 + ]); + + // TODO: Add the time when this was read? + // $table->addColumn('datetime', 'datetime', [ + // 'default' => null + // ]); + + $table->addColumn('seen', 'boolean', [ + 'signed' => false, + 'default' => false + ]); + + $table->addColumn('archived', 'boolean', [ + 'signed' => false, + 'default' => false + ]); + + $table->create(); + } +} diff --git a/migrations/db/schemas/20180220023152_create_collections_presets_table.php b/migrations/db/schemas/20180220023152_create_collections_presets_table.php new file mode 100644 index 0000000000..3581086c89 --- /dev/null +++ b/migrations/db/schemas/20180220023152_create_collections_presets_table.php @@ -0,0 +1,81 @@ +table('directus_collection_presets', ['signed' => false]); + + $table->addColumn('title', 'string', [ + 'limit' => 255, + 'null' => true, + 'default' => null + ]); + $table->addColumn('user', 'integer', [ + 'signed' => false, + 'null' => true + ]); + $table->addColumn('role', 'integer', [ + 'signed' => false, + 'null' => true + ]); + $table->addColumn('collection', 'string', [ + 'limit' => 64, + 'null' => false + ]); + $table->addColumn('search_query', 'string', [ + 'limit' => 100, + 'null' => true, + 'default' => null + ]); + $table->addColumn('filters', 'text', [ + 'null' => true, + 'default' => null + ]); + $table->addColumn('view_type', 'string', [ + 'limit' => 100, + 'null' => false + ]); + $table->addColumn('view_query', 'text', [ + 'null' => true, + 'default' => null + ]); + $table->addColumn('view_options', 'text', [ + 'null' => true, + 'default' => null + ]); + $table->addColumn('translation', 'text', [ + 'null' => true, + 'default' => null + ]); + $table->addIndex(['user', 'collection', 'title'], [ + 'unique' => true, + 'name' => 'idx_user_collection_title' + ]); + + $table->create(); + } +} diff --git a/migrations/db/schemas/20180220023157_create_collections_table.php b/migrations/db/schemas/20180220023157_create_collections_table.php new file mode 100644 index 0000000000..a6cb86c86e --- /dev/null +++ b/migrations/db/schemas/20180220023157_create_collections_table.php @@ -0,0 +1,81 @@ +table('directus_collections', [ + 'id' => false, + 'primary_key' => 'collection' + ]); + + $table->addColumn('collection', 'string', [ + 'limit' => 64, + 'null' => false + ]); + $table->addColumn('item_name_template', 'string', [ + 'limit' => 255, + 'null' => true, + 'default' => null + ]); + $table->addColumn('preview_url', 'string', [ + 'limit' => 255, + 'null' => true, + 'default' => null + ]); + $table->addColumn('managed', 'boolean', [ + 'signed' => false, + 'null' => false, + 'default' => true + ]); + $table->addColumn('hidden', 'boolean', [ + 'signed' => false, + 'null' => false, + 'default' => false + ]); + $table->addColumn('single', 'boolean', [ + 'signed' => false, + 'null' => false, + 'default' => false + ]); + $table->addColumn('translation', 'text', [ + 'null' => true, + 'default' => null + ]); + $table->addColumn('note', 'string', [ + 'limit' => 255, + 'null' => true, + 'default' => null + ]); + $table->addColumn('icon', 'string', [ + 'limit' => 20, + 'null' => true, + 'default' => null + ]); + + $table->create(); + } +} diff --git a/migrations/db/schemas/20180220023202_create_fields_table.php b/migrations/db/schemas/20180220023202_create_fields_table.php new file mode 100644 index 0000000000..80d2308d94 --- /dev/null +++ b/migrations/db/schemas/20180220023202_create_fields_table.php @@ -0,0 +1,114 @@ +table('directus_fields', ['signed' => false]); + + $table->addColumn('collection', 'string', [ + 'limit' => 64, + 'null' => false + ]); + $table->addColumn('field', 'string', [ + 'limit' => 64, + 'null' => false + ]); + $table->addColumn('type', 'string', [ + 'limit' => 64, + 'null' => false + ]); + $table->addColumn('interface', 'string', [ + 'limit' => 64, + 'null' => false + ]); + $table->addColumn('options', 'text', [ + 'null' => true, + 'default' => null + ]); + $table->addColumn('locked', 'boolean', [ + 'signed' => false, + 'null' => false, + 'default' => false + ]); + $table->addColumn('translation', 'text', [ + 'null' => true, + 'default' => null + ]); + $table->addColumn('readonly', 'boolean', [ + 'signed' => false, + 'null' => false, + 'default' => false + ]); + $table->addColumn('required', 'boolean', [ + 'signed' => false, + 'null' => false, + 'default' => false + ]); + $table->addColumn('sort', 'integer', [ + 'signed' => false, + 'null' => true, + 'default' => null + ]); + $table->addColumn('view_width', 'integer', [ + 'signed' => false, + 'null' => false, + 'default' => 4 + ]); + $table->addColumn('note', 'string', [ + 'limit' => 1024, + 'null' => true, + 'default' => null + ]); + $table->addColumn('hidden_input', 'boolean', [ + 'signed' => false, + 'null' => false, + 'default' => 0 + ]); + $table->addColumn('validation', 'string', [ + 'limit' => 255, + 'null' => true, + 'default' => null + ]); + $table->addColumn('hidden_list', 'boolean', [ + 'signed' => false, + 'null' => false, + 'default' => 0 + ]); + $table->addColumn('group', 'integer', [ + 'signed' => false, + 'null' => true, + 'default' => null + ]); + + $table->addIndex(['collection', 'field'], [ + 'unique' => true, + 'name' => 'idx_collection_field' + ]); + + $table->create(); + } +} diff --git a/migrations/db/schemas/20180220023208_create_files_table.php b/migrations/db/schemas/20180220023208_create_files_table.php new file mode 100644 index 0000000000..f149fb3aa4 --- /dev/null +++ b/migrations/db/schemas/20180220023208_create_files_table.php @@ -0,0 +1,116 @@ +table('directus_files', ['signed' => false]); + + $table->addColumn('filename', 'string', [ + 'limit' => 255, + 'null' => false, + 'default' => null + ]); + $table->addColumn('title', 'string', [ + 'limit' => 255, + 'null' => true, + 'default' => null + ]); + $table->addColumn('description', 'text', [ + 'null' => true, + 'default' => null + ]); + $table->addColumn('location', 'string', [ + 'limit' => 200, + 'null' => true, + 'default' => null + ]); + $table->addColumn('tags', 'string', [ + 'limit' => 255, + 'null' => true, + 'default' => null + ]); + $table->addColumn('width', 'integer', [ + 'signed' => false, + 'null' => true, + 'default' => null + ]); + $table->addColumn('height', 'integer', [ + 'signed' => false, + 'null' => true, + 'default' => null + ]); + $table->addColumn('filesize', 'integer', [ + 'signed' => false, + 'default' => 0 + ]); + $table->addColumn('duration', 'integer', [ + 'signed' => true, + 'null' => true, + 'default' => null + ]); + $table->addColumn('metadata', 'text', [ + 'null' => true, + 'default' => null + ]); + $table->addColumn('type', 'string', [ + 'limit' => 255, + 'null' => true, + 'default' => null // unknown type? + ]); + $table->addColumn('charset', 'string', [ + 'limit' => 50, + 'null' => true, + 'default' => null + ]); + $table->addColumn('embed', 'string', [ + 'limit' => 200, + 'null' => true, + 'default' => NULL + ]); + $table->addColumn('folder', 'integer', [ + 'signed' => false, + 'null' => true, + 'default' => null + ]); + $table->addColumn('upload_user', 'integer', [ + 'signed' => false, + 'null' => false + ]); + // TODO: Make directus set this value to whatever default is on the server (UTC) + // In MySQL 5.5 and below doesn't support CURRENT TIMESTAMP on datetime as default + $table->addColumn('upload_date', 'datetime', [ + 'null' => false + ]); + $table->addColumn('storage_adapter', 'string', [ + 'limit' => 50, + 'null' => false, + 'default' => 'local' + ]); + + $table->create(); + } +} diff --git a/migrations/db/schemas/20180220023213_create_folders_table.php b/migrations/db/schemas/20180220023213_create_folders_table.php new file mode 100644 index 0000000000..cb0596414d --- /dev/null +++ b/migrations/db/schemas/20180220023213_create_folders_table.php @@ -0,0 +1,50 @@ +table('directus_folders', ['signed' => false]); + + $table->addColumn('name', 'string', [ + 'limit' => 191, + 'null' => false, + 'encoding' => 'utf8mb4' + ]); + $table->addColumn('parent_folder', 'integer', [ + 'signed' => false, + 'null' => true, + 'default' => null + ]); + + $table->addIndex(['name', 'parent_folder'], [ + 'unique' => true, + 'name' => 'idx_name_parent_folder' + ]); + + $table->create(); + } +} diff --git a/migrations/db/schemas/20180220023217_create_roles_table.php b/migrations/db/schemas/20180220023217_create_roles_table.php new file mode 100644 index 0000000000..0d8c33599f --- /dev/null +++ b/migrations/db/schemas/20180220023217_create_roles_table.php @@ -0,0 +1,68 @@ +table('directus_roles', ['signed' => false]); + + $table->addColumn('external_id', 'string', [ + 'limit' => 255, + 'null' => true, + 'default' => null + ]); + + $table->addColumn('name', 'string', [ + 'limit' => 100, + 'null' => false + ]); + $table->addColumn('description', 'string', [ + 'limit' => 500, + 'null' => true, + 'default' => NULL + ]); + $table->addColumn('ip_whitelist', 'text', [ + 'null' => true, + 'default' => null + ]); + $table->addColumn('nav_blacklist', 'text', [ + 'null' => true, + 'default' => null + ]); + + $table->addIndex('name', [ + 'unique' => true, + 'name' => 'idx_group_name' + ]); + + $table->addIndex('external_id', [ + 'unique' => true, + 'name' => 'idx_users_external_id' + ]); + + $table->create(); + } +} diff --git a/migrations/db/schemas/20180220023226_create_permissions_table.php b/migrations/db/schemas/20180220023226_create_permissions_table.php new file mode 100644 index 0000000000..1fecc2c7f7 --- /dev/null +++ b/migrations/db/schemas/20180220023226_create_permissions_table.php @@ -0,0 +1,104 @@ +table('directus_permissions', ['signed' => false]); + + $table->addColumn('collection', 'string', [ + 'limit' => 64, + 'null' => false, + ]); + $table->addColumn('role', 'integer', [ + 'signed' => false, + 'null' => false + ]); + $table->addColumn('status', 'string', [ + 'length' => 64, + 'default' => null, + 'null' => true + ]); + $table->addColumn('status_blacklist', 'string', [ + 'length' => 1000, + 'default' => null, + 'null' => true + ]); + $table->addColumn('create', 'string', [ + 'signed' => false, + 'null' => true, + 'default' => null, + 'length' => 16, + ]); + $table->addColumn('read', 'string', [ + 'signed' => false, + 'null' => true, + 'default' => null, + 'length' => 16, + ]); + $table->addColumn('update', 'string', [ + 'signed' => false, + 'null' => true, + 'default' => null, + 'length' => 16, + ]); + $table->addColumn('delete', 'string', [ + 'signed' => false, + 'null' => true, + 'default' => null, + 'length' => 16, + ]); + $table->addColumn('navigate', 'boolean', [ + 'signed' => false, + 'null' => false, + 'default' => false, + ]); + $table->addColumn('comment', 'string', [ + 'limit' => 8, + 'null' => true, + 'default' => null + ]); + $table->addColumn('explain', 'string', [ + 'limit' => 8, + 'null' => true, + 'default' => null + ]); + $table->addColumn('read_field_blacklist', 'string', [ + 'limit' => 1000, + 'null' => true, + 'default' => null, + 'encoding' => 'utf8' + ]); + $table->addColumn('write_field_blacklist', 'string', [ + 'limit' => 1000, + 'null' => true, + 'default' => NULL, + 'encoding' => 'utf8', + ]); + + $table->create(); + } +} diff --git a/migrations/db/schemas/20180220023232_create_relations_table.php b/migrations/db/schemas/20180220023232_create_relations_table.php new file mode 100644 index 0000000000..c825bb06f8 --- /dev/null +++ b/migrations/db/schemas/20180220023232_create_relations_table.php @@ -0,0 +1,67 @@ +table('directus_relations', ['signed' => false]); + + $table->addColumn('collection_a', 'string', [ + 'limit' => 64, + 'null' => false + ]); + $table->addColumn('field_a', 'string', [ + 'limit' => 45, + 'null' => false + ]); + $table->addColumn('junction_key_a', 'string', [ + 'limit' => 64, + 'null' => true + ]); + $table->addColumn('junction_collection', 'string', [ + 'limit' => 64, + 'null' => true + ]); + $table->addColumn('junction_mixed_collections', 'string', [ + 'limit' => 64, + 'null' => true + ]); + $table->addColumn('junction_key_b', 'string', [ + 'limit' => 64, + 'null' => true + ]); + $table->addColumn('collection_b', 'string', [ + 'limit' => 64, + 'null' => true + ]); + $table->addColumn('field_b', 'string', [ + 'limit' => 64, + 'null' => true + ]); + + $table->create(); + } +} diff --git a/migrations/db/schemas/20180220023238_create_revisions_table.php b/migrations/db/schemas/20180220023238_create_revisions_table.php new file mode 100644 index 0000000000..f9531166ce --- /dev/null +++ b/migrations/db/schemas/20180220023238_create_revisions_table.php @@ -0,0 +1,66 @@ +table('directus_revisions', ['signed' => false]); + + $table->addColumn('activity', 'integer', [ + 'null' => false, + 'signed' => false + ]); + $table->addColumn('collection', 'string', [ + 'limit' => 64, + 'null' => false + ]); + $table->addColumn('item', 'string', [ + 'limit' => 255 + ]); + $table->addColumn('data', 'text', [ + 'limit' => 4294967295 + ]); + $table->addColumn('delta', 'text', [ + 'limit' => 4294967295, + 'null' => true + ]); + $table->addColumn('parent_item', 'string', [ + 'limit' => 255, + 'null' => true + ]); + $table->addColumn('parent_collection', 'string', [ + 'limit' => 64, + 'null' => true + ]); + $table->addColumn('parent_changed', 'boolean', [ + 'signed' => false, + 'default' => false, + 'null' => true + ]); + + $table->create(); + } +} diff --git a/migrations/db/schemas/20180220023243_create_settings_table.php b/migrations/db/schemas/20180220023243_create_settings_table.php new file mode 100644 index 0000000000..2617239879 --- /dev/null +++ b/migrations/db/schemas/20180220023243_create_settings_table.php @@ -0,0 +1,52 @@ +table('directus_settings', ['signed' => false]); + + $table->addColumn('scope', 'string', [ + 'limit' => 64, + 'default' => null + ]); + $table->addColumn('key', 'string', [ + 'limit' => 64, + 'null' => false + ]); + $table->addColumn('value', 'string', [ + 'limit' => 255, + 'default' => null + ]); + + $table->addIndex(['scope', 'key'], [ + 'unique' => true, + 'name' => 'idx_scope_name' + ]); + + $table->create(); + } +} diff --git a/migrations/db/schemas/20180220023248_create_users_table.php b/migrations/db/schemas/20180220023248_create_users_table.php new file mode 100644 index 0000000000..51572c9f3b --- /dev/null +++ b/migrations/db/schemas/20180220023248_create_users_table.php @@ -0,0 +1,133 @@ +table('directus_users', ['signed' => false]); + + $table->addColumn('status', 'integer', [ + 'signed' => false, + 'limit' => 1, + 'default' => 2 // Inactive + ]); + $table->addColumn('first_name', 'string', [ + 'limit' => 50, + 'null' => true, + 'default' => null + ]); + $table->addColumn('last_name', 'string', [ + 'limit' => 50, + 'null' => true, + 'default' => null + ]); + $table->addColumn('email', 'string', [ + 'limit' => 128, + 'null' => false + ]); + $table->addColumn('email_notifications', 'integer', [ + 'limit' => 1, + 'default' => 1 + ]); + $table->addColumn('password', 'string', [ + 'limit' => 255, + 'encoding' => 'utf8', + 'null' => true, + 'default' => null + ]); + $table->addColumn('avatar', 'integer', [ + 'signed' => false, + 'limit' => 11, + 'null' => true, + 'default' => null + ]); + $table->addColumn('company', 'string', [ + 'limit' => 191, + 'null' => true, + 'default' => null + ]); + $table->addColumn('title', 'string', [ + 'limit' => 191, + 'null' => true, + 'default' => null + ]); + $table->addColumn('locale', 'string', [ + 'limit' => 8, + 'null' => true, + 'default' => 'en-US' + ]); + $table->addColumn('high_contrast_mode', 'boolean', [ + 'signed' => false, + 'null' => true, + 'default' => false + ]); + $table->addColumn('locale_options', 'text', [ + 'null' => true, + 'default' => null + ]); + $table->addColumn('timezone', 'string', [ + 'limit' => 32, + 'default' => 'America/New_York' + ]); + $table->addColumn('last_access', 'datetime', [ + 'null' => true, + 'default' => null + ]); + $table->addColumn('last_page', 'string', [ + 'limit' => 45, + 'null' => true, + 'default' => null + ]); + $table->addColumn('token', 'string', [ + 'limit' => 255, + 'encoding' => 'utf8', + 'null' => true, + 'default' => null + ]); + $table->addColumn('external_id', 'string', [ + 'limit' => 255, + 'null' => true, + 'default' => null + ]); + + $table->addIndex('email', [ + 'unique' => true, + 'name' => 'idx_users_email' + ]); + + $table->addIndex('token', [ + 'unique' => true, + 'name' => 'idx_users_token' + ]); + + $table->addIndex('external_id', [ + 'unique' => true, + 'name' => 'idx_users_external_id' + ]); + + $table->create(); + } +} diff --git a/migrations/db/schemas/20180426173310_create_user_roles.php b/migrations/db/schemas/20180426173310_create_user_roles.php new file mode 100644 index 0000000000..299931c4d6 --- /dev/null +++ b/migrations/db/schemas/20180426173310_create_user_roles.php @@ -0,0 +1,52 @@ +table('directus_user_roles', ['signed' => false]); + + $table->addColumn('user', 'integer', [ + 'signed' => false, + 'null' => true, + 'default' => null + ]); + + $table->addColumn('role', 'integer', [ + 'signed' => false, + 'null' => true, + 'default' => null + ]); + + $table->addIndex(['user', 'role'], [ + 'unique' => true, + 'name' => 'idx_user_role' + ]); + + $table->create(); + } +} diff --git a/migrations/db/seeds/FieldsSeeder.php b/migrations/db/seeds/FieldsSeeder.php new file mode 100644 index 0000000000..3c48a5db1c --- /dev/null +++ b/migrations/db/seeds/FieldsSeeder.php @@ -0,0 +1,831 @@ + 'directus_activity', + 'field' => 'id', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'primary-key' + ], + [ + 'collection' => 'directus_activity', + 'field' => 'type', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_activity', + 'field' => 'action', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_activity', + 'field' => 'user', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'user' + ], + [ + 'collection' => 'directus_activity', + 'field' => 'datetime', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_DATETIME, + 'interface' => 'datetime' + ], + [ + 'collection' => 'directus_activity', + 'field' => 'ip', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_activity', + 'field' => 'user_agent', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_activity', + 'field' => 'collection', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_activity', + 'field' => 'item', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_activity', + 'field' => 'comment', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_TEXT, + 'interface' => 'markdown' + ], + // Activity Read + [ + 'collection' => 'directus_activity_read', + 'field' => 'id', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'primary-key' + ], + [ + 'collection' => 'directus_activity_read', + 'field' => 'activity', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'many-to-one' + ], + [ + 'collection' => 'directus_activity_read', + 'field' => 'user', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'user' + ], + [ + 'collection' => 'directus_activity_read', + 'field' => 'read', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + [ + 'collection' => 'directus_activity_read', + 'field' => 'archived', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + // Collections + [ + 'collection' => 'directus_collections', + 'field' => 'collection', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'primary-key' + ], + [ + 'collection' => 'directus_collections', + 'field' => 'item_name_template', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_collections', + 'field' => 'preview_url', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_collections', + 'field' => 'managed', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + [ + 'collection' => 'directus_collections', + 'field' => 'hidden', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + [ + 'collection' => 'directus_collections', + 'field' => 'single', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + [ + 'collection' => 'directus_collections', + 'field' => 'translation', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_JSON, + 'interface' => 'JSON' + ], + [ + 'collection' => 'directus_collections', + 'field' => 'note', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + // Collection Presets + [ + 'collection' => 'directus_collection_presets', + 'field' => 'id', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'primary-key' + ], + [ + 'collection' => 'directus_collection_presets', + 'field' => 'title', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_collection_presets', + 'field' => 'user', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'user' + ], + [ + 'collection' => 'directus_collection_presets', + 'field' => 'role', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'many-to-one' + ], + [ + 'collection' => 'directus_collection_presets', + 'field' => 'collection', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'many-to-one' + ], + [ + 'collection' => 'directus_collection_presets', + 'field' => 'search_query', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_collection_presets', + 'field' => 'filters', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_JSON, + 'interface' => 'json' + ], + [ + 'collection' => 'directus_collection_presets', + 'field' => 'view_options', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_JSON, + 'interface' => 'json' + ], + [ + 'collection' => 'directus_collection_presets', + 'field' => 'view_type', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_collection_presets', + 'field' => 'view_query', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_JSON, + 'interface' => 'json' + ], + [ + 'collection' => 'directus_collection_presets', + 'field' => 'translation', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_JSON, + 'interface' => 'JSON' + ], + // Fields + [ + 'collection' => 'directus_fields', + 'field' => 'id', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'primary-key' + ], + [ + 'collection' => 'directus_fields', + 'field' => 'collection', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'many-to-one' + ], + [ + 'collection' => 'directus_fields', + 'field' => 'field', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_fields', + 'field' => 'type', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_fields', + 'field' => 'interface', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_fields', + 'field' => 'options', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_JSON, + 'interface' => 'json' + ], + [ + 'collection' => 'directus_fields', + 'field' => 'locked', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + [ + 'collection' => 'directus_fields', + 'field' => 'translation', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_JSON, + 'interface' => 'JSON' + ], + [ + 'collection' => 'directus_fields', + 'field' => 'readonly', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + [ + 'collection' => 'directus_fields', + 'field' => 'required', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + [ + 'collection' => 'directus_fields', + 'field' => 'sort', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'sort' + ], + [ + 'collection' => 'directus_fields', + 'field' => 'note', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_fields', + 'field' => 'hidden_input', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + [ + 'collection' => 'directus_fields', + 'field' => 'hidden_list', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + [ + 'collection' => 'directus_fields', + 'field' => 'view_width', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'numeric' + ], + [ + 'collection' => 'directus_fields', + 'field' => 'group', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'many-to-one' + ], + // Files + [ + 'collection' => 'directus_files', + 'field' => 'id', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'primary-key' + ], + [ + 'collection' => 'directus_files', + 'field' => 'filename', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_files', + 'field' => 'title', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_files', + 'field' => 'description', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_TEXT, + 'interface' => 'textarea' + ], + [ + 'collection' => 'directus_files', + 'field' => 'location', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_files', + 'field' => 'tags', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_ARRAY, + 'interface' => 'tags' + ], + [ + 'collection' => 'directus_files', + 'field' => 'width', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'numeric' + ], + [ + 'collection' => 'directus_files', + 'field' => 'height', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'numeric' + ], + [ + 'collection' => 'directus_files', + 'field' => 'filesize', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'filesize' + ], + [ + 'collection' => 'directus_files', + 'field' => 'duration', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'numeric' + ], + [ + 'collection' => 'directus_files', + 'field' => 'metadata', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_JSON, + 'interface' => 'JSON' + ], + [ + 'collection' => 'directus_files', + 'field' => 'type', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_files', + 'field' => 'charset', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_files', + 'field' => 'embed', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_files', + 'field' => 'folder', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'many-to-one' + ], + [ + 'collection' => 'directus_files', + 'field' => 'upload_user', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'user' + ], + [ + 'collection' => 'directus_files', + 'field' => 'upload_date', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_DATETIME, + 'interface' => 'datetime' + ], + [ + 'collection' => 'directus_files', + 'field' => 'storage_adapter', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_files', + 'field' => 'data', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BLOB, + 'interface' => 'blob', + 'options' => '{ "nameField": "filename", "sizeField": "filesize", "typeField": "type" }' + ], + [ + 'collection' => 'directus_files', + 'field' => 'url', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_files', + 'field' => 'storage', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_ALIAS, + 'interface' => 'file-upload' + ], + // Folders + [ + 'collection' => 'directus_folders', + 'field' => 'id', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'primary-key' + ], + [ + 'collection' => 'directus_folders', + 'field' => 'name', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_folders', + 'field' => 'parent_folder', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'many-to-one' + ], + // Roles + [ + 'collection' => 'directus_roles', + 'field' => 'id', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'primary-key' + ], + [ + 'collection' => 'directus_roles', + 'field' => 'name', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_roles', + 'field' => 'description', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'textarea' + ], + [ + 'collection' => 'directus_roles', + 'field' => 'ip_whitelist', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_TEXT, + 'interface' => 'textarea' + ], + [ + 'collection' => 'directus_roles', + 'field' => 'nav_blacklist', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_TEXT, + 'interface' => 'textarea' + ], + // User Roles + [ + 'collection' => 'directus_user_roles', + 'field' => 'id', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'primary-key' + ], + [ + 'collection' => 'directus_user_roles', + 'field' => 'user', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'user' + ], + [ + 'collection' => 'directus_user_roles', + 'field' => 'role', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'many-to-one' + ], + // Users + [ + 'collection' => 'directus_users', + 'field' => 'id', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'primary-key' + ], + [ + 'collection' => 'directus_users', + 'field' => 'status', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'status', + 'options' => '{"status_mapping":[{"name": "draft"},{"name": "active"},{"name": "delete"}]}' + ], + [ + 'collection' => 'directus_users', + 'field' => 'first_name', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_users', + 'field' => 'last_name', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_users', + 'field' => 'email', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_users', + 'field' => 'roles', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_M2M, + 'interface' => 'm2m' + ], + [ + 'collection' => 'directus_users', + 'field' => 'email_notifications', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + [ + 'collection' => 'directus_users', + 'field' => 'password', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'password' + ], + [ + 'collection' => 'directus_users', + 'field' => 'avatar', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_FILE, + 'interface' => 'single-file' + ], + [ + 'collection' => 'directus_users', + 'field' => 'company', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_users', + 'field' => 'title', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_users', + 'field' => 'locale', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_users', + 'field' => 'locale_options', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_JSON, + 'interface' => 'json' + ], + [ + 'collection' => 'directus_users', + 'field' => 'timezone', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_users', + 'field' => 'last_ip', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_users', + 'field' => 'last_login', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_DATETIME, + 'interface' => 'datetime' + ], + [ + 'collection' => 'directus_users', + 'field' => 'last_access', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_DATETIME, + 'interface' => 'datetime' + ], + [ + 'collection' => 'directus_users', + 'field' => 'last_page', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_users', + 'field' => 'token', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + // Permissions + [ + 'collection' => 'directus_permissions', + 'field' => 'id', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'primary-key' + ], + [ + 'collection' => 'directus_permissions', + 'field' => 'collection', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'many-to-one' + ], + [ + 'collection' => 'directus_permissions', + 'field' => 'role', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'many-to-one' + ], + [ + 'collection' => 'directus_permissions', + 'field' => 'status', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_permissions', + 'field' => 'create', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + [ + 'collection' => 'directus_permissions', + 'field' => 'read', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + [ + 'collection' => 'directus_permissions', + 'field' => 'update', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + [ + 'collection' => 'directus_permissions', + 'field' => 'delete', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + [ + 'collection' => 'directus_permissions', + 'field' => 'navigate', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + [ + 'collection' => 'directus_permissions', + 'field' => 'explain', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_permissions', + 'field' => 'allow_statuses', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_ARRAY, + 'interface' => 'tags' + ], + [ + 'collection' => 'directus_permissions', + 'field' => 'read_field_blacklist', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'textarea' + ], + // Relations + [ + 'collection' => 'directus_relations', + 'field' => 'id', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'primary-key' + ], + [ + 'collection' => 'directus_relations', + 'field' => 'collection_a', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_relations', + 'field' => 'field_a', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_relations', + 'field' => 'junction_key_a', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_relations', + 'field' => 'junction_mixed_collections', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_relations', + 'field' => 'junction_key_b', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_relations', + 'field' => 'collection_b', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_relations', + 'field' => 'field_b', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + // Revisions + [ + 'collection' => 'directus_revisions', + 'field' => 'id', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'primary-key' + ], + [ + 'collection' => 'directus_revisions', + 'field' => 'activity', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'many-to-one' + ], + [ + 'collection' => 'directus_revisions', + 'field' => 'collection', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'many-to-one' + ], + [ + 'collection' => 'directus_revisions', + 'field' => 'item', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_revisions', + 'field' => 'data', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_LONG_JSON, + 'interface' => 'json' + ], + [ + 'collection' => 'directus_revisions', + 'field' => 'delta', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_LONG_JSON, + 'interface' => 'json' + ], + [ + 'collection' => 'directus_revisions', + 'field' => 'parent_item', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + [ + 'collection' => 'directus_revisions', + 'field' => 'parent_collection', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'many-to-one' + ], + [ + 'collection' => 'directus_revisions', + 'field' => 'parent_changed', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_BOOLEAN, + 'interface' => 'toggle' + ], + // Settings + [ + 'collection' => 'directus_settings', + 'field' => 'auto_sign_out', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_INT, + 'interface' => 'numeric' + ], + [ + 'collection' => 'directus_settings', + 'field' => 'youtube_api_key', + 'type' => \Directus\Database\Schema\DataTypes::TYPE_VARCHAR, + 'interface' => 'text-input' + ], + ]; + + $files = $this->table('directus_fields'); + $files->insert($data)->save(); + } +} diff --git a/migrations/db/seeds/FileSeeder.php b/migrations/db/seeds/FileSeeder.php new file mode 100644 index 0000000000..1d26519a7e --- /dev/null +++ b/migrations/db/seeds/FileSeeder.php @@ -0,0 +1,37 @@ + 1, + 'filename' => '00000000001.jpg', + 'title' => 'Mountain Range', + 'description' => 'A gorgeous view of this wooded mountain range', + 'location' => 'Earth', + 'tags' => 'trees,rocks,nature,mountains,forest', + 'width' => 1800, + 'height' => 1200, + 'filesize' => 602058, + 'type' => 'image/jpeg', + 'charset' => 'binary', + 'upload_user' => 1, + 'upload_date' => \Directus\Util\DateTimeUtils::nowInUTC()->toString(), + 'storage_adapter' => 'local' + ]; + + $files = $this->table('directus_files'); + $files->insert($data)->save(); + } +} diff --git a/migrations/db/seeds/RelationsSeeder.php b/migrations/db/seeds/RelationsSeeder.php new file mode 100644 index 0000000000..29756de4f0 --- /dev/null +++ b/migrations/db/seeds/RelationsSeeder.php @@ -0,0 +1,87 @@ + 'directus_activity', + 'field_a' => 'user', + 'collection_b' => 'directus_users' + ], + [ + 'collection_a' => 'directus_activity_read', + 'field_a' => 'user', + 'collection_b' => 'directus_users' + ], + [ + 'collection_a' => 'directus_activity_read', + 'field_a' => 'activity', + 'collection_b' => 'directus_activity' + ], + [ + 'collection_a' => 'directus_collections_presets', + 'field_a' => 'user', + 'collection_b' => 'directus_users' + ], + [ + 'collection_a' => 'directus_collections_presets', + 'field_a' => 'group', + 'collection_b' => 'directus_groups' + ], + [ + 'collection_a' => 'directus_files', + 'field_a' => 'upload_user', + 'collection_b' => 'directus_users' + ], + [ + 'collection_a' => 'directus_files', + 'field_a' => 'folder', + 'collection_b' => 'directus_folders' + ], + [ + 'collection_a' => 'directus_folders', + 'field_a' => 'parent_folder', + 'collection_b' => 'directus_folders' + ], + [ + 'collection_a' => 'directus_permissions', + 'field_a' => 'group', + 'collection_b' => 'directus_groups' + ], + [ + 'collection_a' => 'directus_revisions', + 'field_a' => 'activity', + 'collection_b' => 'directus_activity' + ], + [ + 'collection_a' => 'directus_users', + 'field_a' => 'roles', + 'junction_key_a' => 'user', + 'junction_collection' => 'directus_user_roles', + 'junction_key_b' => 'role', + 'field_b' => 'users', + 'collection_b' => 'directus_roles' + ], + [ + 'collection_a' => 'directus_users', + 'field_a' => 'avatar', + 'collection_b' => 'directus_files' + ] + ]; + + $files = $this->table('directus_relations'); + $files->insert($data)->save(); + } +} diff --git a/migrations/db/seeds/RolesSeeder.php b/migrations/db/seeds/RolesSeeder.php new file mode 100644 index 0000000000..ea2b7e1d90 --- /dev/null +++ b/migrations/db/seeds/RolesSeeder.php @@ -0,0 +1,33 @@ + 1, + 'name' => 'Administrator', + 'description' => 'Admins have access to all managed data within the system by default' + ], + [ + 'id' => 2, + 'name' => 'Public', + 'description' => 'This sets the data that is publicly available through the API without a token' + ] + ]; + + $groups = $this->table('directus_roles'); + $groups->insert($data)->save(); + } +} diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000000..d124ba6e99 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,36 @@ +# Comment this line if you are getting: "Option SymLinksIfOwnerMatch not allowed here" error +# in Apache +Options +SymLinksIfOwnerMatch + + + RewriteEngine On + # Uncomment this if you are getting routing errors: + # RewriteBase /api + + RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + + # Yield static media + RewriteCond %{REQUEST_FILENAME} !-f + + # Map extension requests to their front controller + # RewriteRule ^extensions/([^/]+) index.php?run_extension=$1&%{QUERY_STRING} [L] + + # Map all other requests to the main front controller, invoking the API router + RewriteRule ^ index.php?%{QUERY_STRING} [L] + + + + # Set CORS header for static files + Header set Access-Control-Allow-Origin "*" + + + + # Fix $HTTP_RAW_POST_DATA deprecated warning + php_value always_populate_raw_post_data -1 + + +# Prevent PageSpeed module from rewriting the templates files +# Avoiding it from breaking the template +# +# ModPagespeedDisallow "*/app/**/*.twig" +# diff --git a/public/extensions/core/.DS_Store b/public/extensions/core/.DS_Store new file mode 100644 index 0000000000..5008ddfcf5 Binary files /dev/null and b/public/extensions/core/.DS_Store differ diff --git a/public/extensions/core/auth/facebook/Provider.php b/public/extensions/core/auth/facebook/Provider.php new file mode 100644 index 0000000000..ef4a0e207d --- /dev/null +++ b/public/extensions/core/auth/facebook/Provider.php @@ -0,0 +1,41 @@ +provider = new Facebook([ + 'clientId' => $this->config->get('client_id'), + 'clientSecret' => $this->config->get('client_secret'), + 'redirectUri' => $this->getRedirectUrl(), + 'graphApiVersion' => $this->config->get('graph_api_version'), + ]); + + return $this->provider; + } +} diff --git a/public/extensions/core/auth/facebook/auth.php b/public/extensions/core/auth/facebook/auth.php new file mode 100644 index 0000000000..05ae212d88 --- /dev/null +++ b/public/extensions/core/auth/facebook/auth.php @@ -0,0 +1,5 @@ + \Directus\Authentication\Sso\Provider\facebook\Provider::class +]; diff --git a/public/extensions/core/auth/facebook/icon.svg b/public/extensions/core/auth/facebook/icon.svg new file mode 100644 index 0000000000..cad471a335 --- /dev/null +++ b/public/extensions/core/auth/facebook/icon.svg @@ -0,0 +1 @@ + diff --git a/public/extensions/core/auth/github/Provider.php b/public/extensions/core/auth/github/Provider.php new file mode 100644 index 0000000000..52e309046f --- /dev/null +++ b/public/extensions/core/auth/github/Provider.php @@ -0,0 +1,112 @@ +provider; + $ownerEmail = null; + $visible = []; + $primary = null; + + $url = $this->getResourceOwnerEmailUrl($token); + $request = $provider->getAuthenticatedRequest($provider::METHOD_GET, $url, $token); + $response = $provider->getParsedResponse($request); + + // Remove non-verified emails + $response = array_filter($response, function ($item) { + return ArrayUtils::get($item, 'verified') === true; + }); + + if (is_array($response) && count($response) > 0) { + // fallback to the first email on the list + $ownerEmail = $response[0]['email']; + + foreach ($response as $emailData) { + $email = ArrayUtils::get($emailData, 'email'); + + if (ArrayUtils::get($emailData, 'primary', false)) { + $primary = $email; + } + + if (ArrayUtils::get($emailData, 'visibility') === 'public') { + $visible[] = $email; + } + } + } + + // First try: pick primary email if it's visible + // Second try: pick the first visible email + // Third try: pick the primary email if exists + // Fourth try: pick the first email on the list + // Fifth try: fallback to null + if (in_array($primary, $visible)) { + $ownerEmail = $primary; + } else if (count($visible) > 0) { + $ownerEmail = array_shift($visible); + } else if ($primary) { + $ownerEmail = $primary; + } + + return $ownerEmail; + } + + /** + * Gets the resource owner email url + * + * @param AccessToken $token + * + * @return string + */ + protected function getResourceOwnerEmailUrl(AccessToken $token) + { + if ($this->provider->domain === 'https://github.com') { + $url = $this->provider->apiDomain . '/user/emails'; + } else { + $url = $this->provider->domain . '/api/v3/user/emails'; + } + + return $url; + } + + /** + * Creates the GitHub provider oAuth client + * + * @return Github + */ + protected function createProvider() + { + $this->provider = new Github([ + 'clientId' => $this->config->get('client_id'), + 'clientSecret' => $this->config->get('client_secret'), + 'redirectUri' => $this->getRedirectUrl(), + ]); + + return $this->provider; + } +} diff --git a/public/extensions/core/auth/github/auth.php b/public/extensions/core/auth/github/auth.php new file mode 100644 index 0000000000..4ec7a70817 --- /dev/null +++ b/public/extensions/core/auth/github/auth.php @@ -0,0 +1,5 @@ + \Directus\Authentication\Sso\Provider\github\Provider::class +]; diff --git a/public/extensions/core/auth/github/icon.svg b/public/extensions/core/auth/github/icon.svg new file mode 100644 index 0000000000..327dc84399 --- /dev/null +++ b/public/extensions/core/auth/github/icon.svg @@ -0,0 +1 @@ + diff --git a/public/extensions/core/auth/google/Provider.php b/public/extensions/core/auth/google/Provider.php new file mode 100644 index 0000000000..4049f4e161 --- /dev/null +++ b/public/extensions/core/auth/google/Provider.php @@ -0,0 +1,42 @@ +provider = new Google([ + 'clientId' => $this->config->get('client_id'), + 'clientSecret' => $this->config->get('client_secret'), + 'redirectUri' => $this->getRedirectUrl(), + 'hostedDomain' => $this->config->get('hosted_domain') + ]); + + return $this->provider; + } +} diff --git a/public/extensions/core/auth/google/auth.php b/public/extensions/core/auth/google/auth.php new file mode 100644 index 0000000000..7dd8e9873b --- /dev/null +++ b/public/extensions/core/auth/google/auth.php @@ -0,0 +1,5 @@ + \Directus\Authentication\Sso\Provider\google\Provider::class +]; diff --git a/public/extensions/core/auth/google/icon.svg b/public/extensions/core/auth/google/icon.svg new file mode 100644 index 0000000000..e47488aab8 --- /dev/null +++ b/public/extensions/core/auth/google/icon.svg @@ -0,0 +1 @@ + diff --git a/public/extensions/core/auth/okta/Provider.php b/public/extensions/core/auth/okta/Provider.php new file mode 100644 index 0000000000..6fbc94554e --- /dev/null +++ b/public/extensions/core/auth/okta/Provider.php @@ -0,0 +1,39 @@ +provider = new Okta([ + 'baseUrl' => $this->config->get('base_url'), + 'clientId' => $this->config->get('client_id'), + 'clientSecret' => $this->config->get('client_secret'), + 'redirectUri' => $this->getRedirectUrl() + ]); + + return $this->provider; + } +} diff --git a/public/extensions/core/auth/okta/auth.php b/public/extensions/core/auth/okta/auth.php new file mode 100644 index 0000000000..0acce0014d --- /dev/null +++ b/public/extensions/core/auth/okta/auth.php @@ -0,0 +1,5 @@ + \Directus\Authentication\Sso\Provider\okta\Provider::class +]; diff --git a/public/extensions/core/auth/okta/icon.svg b/public/extensions/core/auth/okta/icon.svg new file mode 100644 index 0000000000..e3e99799a0 --- /dev/null +++ b/public/extensions/core/auth/okta/icon.svg @@ -0,0 +1 @@ + diff --git a/public/extensions/core/auth/twitter/Provider.php b/public/extensions/core/auth/twitter/Provider.php new file mode 100644 index 0000000000..40f059b709 --- /dev/null +++ b/public/extensions/core/auth/twitter/Provider.php @@ -0,0 +1,38 @@ +provider = new Twitter([ + 'identifier' => $this->config->get('identifier'), + 'secret' => $this->config->get('secret'), + 'callback_uri' => $this->getRedirectUrl(), + ]); + + return $this->provider; + } + + /** + * @inheritdoc + */ + public function getScopes() + { + return null; + } +} diff --git a/public/extensions/core/auth/twitter/auth.php b/public/extensions/core/auth/twitter/auth.php new file mode 100644 index 0000000000..a159049264 --- /dev/null +++ b/public/extensions/core/auth/twitter/auth.php @@ -0,0 +1,5 @@ + \Directus\Authentication\Sso\Provider\twitter\Provider::class +]; diff --git a/public/extensions/core/auth/twitter/icon.svg b/public/extensions/core/auth/twitter/icon.svg new file mode 100644 index 0000000000..82b33cfc0a --- /dev/null +++ b/public/extensions/core/auth/twitter/icon.svg @@ -0,0 +1 @@ + diff --git a/public/extensions/core/interfaces/blob/interface.css b/public/extensions/core/interfaces/blob/interface.css new file mode 100644 index 0000000000..1a05433add --- /dev/null +++ b/public/extensions/core/interfaces/blob/interface.css @@ -0,0 +1 @@ +.filepond--assistant{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--browser{position:absolute;margin:0;padding:0;left:1em;top:1.75em;width:calc(100% - 2em);opacity:0;font-size:0}.filepond--drip{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;opacity:.1;pointer-events:none;border-radius:.5em;background:rgba(0,0,0,.01)}.filepond--drip-blob{transform-origin:center center;left:0;width:8em;height:8em;margin-left:-4em;margin-top:-4em;background:#292625;border-radius:50%}.filepond--drip-blob,.filepond--drop-label{position:absolute;top:0;will-change:transform,opacity}.filepond--drop-label{left:1em;right:1em;margin:0 0 1em;color:#4f4f4f}.filepond--drop-label label{display:block;padding:1em 0;margin:0;cursor:default;font-size:.875em;font-weight:400;text-align:center;line-height:1.5}.filepond--label-action{text-decoration:underline;-webkit-text-decoration-skip:ink;text-decoration-skip:ink;-webkit-text-decoration-color:#a7a4a4;text-decoration-color:#a7a4a4;cursor:pointer}.filepond--file-action-button{font-size:1em;width:1.625em;height:1.625em;cursor:auto;font-family:inherit;line-height:inherit;margin:0;padding:0;border:none;color:#fff;outline:none;border-radius:50%;background-color:rgba(0,0,0,.5);background-image:none;will-change:transform,opacity;box-shadow:0 0 0 0 hsla(0,0%,100%,0);transition:box-shadow .25s ease-in}.filepond--file-action-button svg{width:100%;height:100%}.filepond--file-action-button:focus,.filepond--file-action-button:hover{box-shadow:0 0 0 .125em hsla(0,0%,100%,.9)}.filepond--file-info{position:static;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start;-ms-flex:1;flex:1;margin:0 .5em 0 0;min-width:0;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-info *{margin:0}.filepond--file-info .filepond--file-info-main{font-size:.75em;line-height:1.2;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}.filepond--file-info .filepond--file-info-sub{font-size:.625em;opacity:.5}.filepond--file-info .filepond--file-info-sub:empty{display:none}.filepond--file-status{position:static;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:end;align-items:flex-end;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;margin:0;min-width:2.25em;text-align:right;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-status *{margin:0;white-space:nowrap}.filepond--file-status .filepond--file-status-main{font-size:.75em;line-height:1.2}.filepond--file-status .filepond--file-status-sub{font-size:.625em;opacity:.5}.filepond--file-wrapper{border:none;margin:0;padding:0;min-width:0;height:100%}.filepond--file-wrapper>legend{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file{position:static;display:-ms-flexbox;display:flex;height:100%;padding:.5625em;color:#fff;border-radius:.5em}.filepond--file .filepond--file-status{margin-left:auto;margin-right:2.25em}.filepond--file .filepond--file-action-button{position:absolute}.filepond--file .filepond--progress-indicator{position:absolute;top:.75em;right:.75em}.filepond--file .filepond--action-remove-item{left:.5625em}.filepond--file .filepond--file-action-button:not(.filepond--action-remove-item){right:.5625em}[data-filepond-item-state*=error] .filepond--file-info,[data-filepond-item-state*=invalid] .filepond--file-info,[data-filepond-item-state=cancelled] .filepond--file-info{margin-right:2.25em}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing svg{animation:fall .5s .125s linear both}[data-filepond-item-state*=error] .filepond--file-wrapper,[data-filepond-item-state*=error] .filepond--panel,[data-filepond-item-state*=invalid] .filepond--file-wrapper,[data-filepond-item-state*=invalid] .filepond--panel{animation:shake .65s linear both}[data-filepond-item-state*=busy] .filepond--progress-indicator svg{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes shake{10%,90%{transform:translateX(-.0625em)}20%,80%{transform:translateX(.125em)}30%,50%,70%{transform:translateX(-.25em)}40%,60%{transform:translateX(.25em)}}@keyframes fall{0%{opacity:0;transform:scale(.5);animation-timing-function:ease-out}70%{opacity:1;transform:scale(1.1);animation-timing-function:ease-in-out}to{transform:scale(1);animation-timing-function:ease-out}}.filepond--hopper[data-hopper-state=drag-over]>*{pointer-events:none}.filepond--progress-indicator{z-index:103}.filepond--file-action-button{z-index:102}.filepond--file-status{z-index:101}.filepond--file-info{z-index:100}.filepond--item{position:absolute;top:0;left:0;right:0;padding:0;margin:0 0 .5em;will-change:transform,opacity}.filepond--item>.filepond--panel{z-index:1}.filepond--item>.filepond--panel .filepond--panel-bottom{box-shadow:0 .0625em .125em -.0625em rgba(0,0,0,.25)}.filepond--item>.filepond--file-wrapper{position:relative;z-index:2}.filepond--item-panel{background-color:#64605e}[data-filepond-item-state=processing-complete] .filepond--item-panel{background-color:#369763}[data-filepond-item-state*=error] .filepond--item-panel,[data-filepond-item-state*=invalid] .filepond--item-panel{background-color:#c44e47}.filepond--item-panel{border-radius:.5em;transition:background-color .25s}.filepond--list-scroller{position:absolute;top:0;left:0;right:0;margin:0;will-change:transform}.filepond--list-scroller[data-state=overflow]{overflow-y:scroll;overflow-x:visible;-webkit-overflow-scrolling:touch}.filepond--list-scroller[data-state=overflow] .filepond--list{bottom:0;right:0}.filepond--list-scroller::-webkit-scrollbar{background:transparent}.filepond--list-scroller::-webkit-scrollbar:vertical{width:1em}.filepond--list-scroller::-webkit-scrollbar:horizontal{height:0}.filepond--list-scroller::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.3);border-radius:99999px;border:.3125em solid transparent;background-clip:content-box}.filepond--list{position:absolute;top:0;left:1em;right:1em;margin:0;padding:0;list-style-type:none;will-change:transform}.filepond--panel-root{border-radius:.5em;background-color:#f1f0ef}.filepond--panel{position:absolute;left:0;top:0;right:0;margin:0;height:auto!important;pointer-events:none}.filepond--panel[data-scalable=true]{transform-style:preserve-3d;background-color:transparent!important;border:none!important}.filepond--panel[data-scalable=false]{bottom:0}.filepond--panel[data-scalable=false]>div{display:none}.filepond--panel-bottom,.filepond--panel-center,.filepond--panel-top{position:absolute;left:0;top:0;right:0;margin:0;padding:0}.filepond--panel-bottom,.filepond--panel-top{height:.5em}.filepond--panel-top{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important;border-bottom:none!important}.filepond--panel-top:after{content:"";position:absolute;height:2px;left:0;right:0;bottom:-1px;background-color:inherit}.filepond--panel-bottom,.filepond--panel-center{will-change:transform;-webkit-backface-visibility:hidden;backface-visibility:hidden;transform-origin:left top;transform:translate3d(0,.5em,0)}.filepond--panel-bottom{border-top-left-radius:0!important;border-top-right-radius:0!important;border-top:none!important}.filepond--panel-bottom:before{content:"";position:absolute;height:2px;left:0;right:0;top:-1px;background-color:inherit}.filepond--panel-center{height:100px!important;border-top:none!important;border-bottom:none!important;border-radius:0!important}.filepond--panel-center:not([style]){visibility:hidden}.filepond--progress-indicator{position:static;width:1.25em;height:1.25em;color:#fff;margin:0;pointer-events:none;will-change:transform,opacity}.filepond--progress-indicator svg{width:100%;height:100%}.filepond--progress-indicator path{fill:none;stroke:currentColor}.filepond--list-scroller{z-index:6}.filepond--drop-label{z-index:5}.filepond--drip{z-index:3}.filepond--root>.filepond--panel{z-index:2}.filepond--browser{z-index:1}.filepond--root{box-sizing:border-box;position:relative;margin-bottom:1em;padding-top:1em;font-size:1rem;line-height:normal;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-weight:450;text-align:left;text-rendering:optimizeLegibility;direction:ltr;contain:layout style size}.filepond--root *{font-size:inherit;box-sizing:inherit;line-height:inherit}.filepond--image-preview-wrapper{z-index:2}.filepond--image-preview-overlay{display:block;position:absolute;left:0;top:0;width:100%;min-height:5rem;max-height:7rem;margin:0;opacity:0;z-index:1;mix-blend-mode:multiply;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--image-preview-overlay:nth-of-type(2),.filepond--image-preview-overlay:nth-of-type(3){mix-blend-mode:normal}@supports (-webkit-marquee-repetition:infinite) and (object-fit:fill){.filepond--image-preview-overlay{mix-blend-mode:normal}}.filepond--image-preview-wrapper{pointer-events:none;position:absolute;left:0;top:0;right:0;margin:0;border-radius:.45em;overflow:hidden;background:rgba(0,0,0,.01)}.filepond--image-preview{position:relative;z-index:1;display:block;width:100%;height:auto;pointer-events:none;transform-origin:center center;background:#222;will-change:transform,opacity}.filepond--image-preview div{position:relative;overflow:hidden;margin:0 auto}.filepond--image-preview canvas{position:absolute;left:0;top:0;will-change:transform} \ No newline at end of file diff --git a/public/extensions/core/interfaces/blob/interface.js b/public/extensions/core/interfaces/blob/interface.js new file mode 100644 index 0000000000..653006e35a --- /dev/null +++ b/public/extensions/core/interfaces/blob/interface.js @@ -0,0 +1,24 @@ +parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f1)for(var n=1;n2&&void 0!==arguments[2]?arguments[2]:null;if(null===n)return e.getAttribute(t)||e.hasAttribute(t);e.setAttribute(t,n)},c=["svg","path"],s=function(e){return c.includes(e)},f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"object"===(void 0===t?"undefined":r(t))&&(n=t,t=null);var o=s(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return t&&(s(e)?l(o,"class",t):o.className=t),a(n,function(e,t){l(o,e,t)}),o},p=function(e,t,n,r){var i=n[0]||e.left,a=n[1]||e.top,u=i+e.width,l=a+e.height*(r[1]||1),c={element:o({},e),inner:{left:e.left,top:e.top,right:e.right,bottom:e.bottom},outer:{left:i,top:a,right:u,bottom:l}};return t.filter(function(e){return!e.isRectIgnored()}).map(function(e){return e.rect}).forEach(function(e){d(c.inner,o({},e.inner)),d(c.outer,o({},e.outer))}),E(c.inner),c.outer.bottom+=c.element.marginBottom,c.outer.right+=c.element.marginRight,E(c.outer),c},d=function(e,t){t.top+=e.top,t.right+=e.left,t.bottom+=e.top,t.left+=e.left,t.bottom>e.bottom&&(e.bottom=t.bottom),t.right>e.right&&(e.right=t.right)},E=function(e){e.width=e.right-e.left,e.height=e.bottom-e.top},v=function(e){return"number"==typeof e},_=function(e){return e<.5?2*e*e:(4-2*e)*e-1},m={spring:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.stiffness,n=void 0===t?.5:t,r=e.damping,o=void 0===r?.75:r,i=e.mass,a=void 0===i?10:i,l=null,c=null,s=0,f=!1,p=u({interpolate:function(){if(!f){if(!v(l)||!v(c))return f=!0,void(s=0);!function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.001;return Math.abs(e-t)0&&void 0!==arguments[0]?arguments[0]:{},t=e.duration,n=void 0===t?500:t,r=e.easing,o=void 0===r?_:r,i=e.delay,a=void 0===i?0:i,l=null,c=void 0,s=void 0,f=!0,p=!1,d=null,E=u({interpolate:function(e){f||null===d||(null===l&&(l=e),e-l=0?o(p?1-s:s):0)*d)):(c=1,f=!0,s=p?0:1,E.onupdate(s*d),E.oncomplete(s*d))))},target:{get:function(){return p?0:d},set:function(e){if(null===d)return d=e,E.onupdate(e),void E.oncomplete(e);e3&&void 0!==arguments[3]&&arguments[3];(t=Array.isArray(t)?t:[t]).forEach(function(t){e.forEach(function(e){var i=e,a=function(){return n[e]},u=function(t){return n[e]=t};"object"===(void 0===e?"undefined":r(e))&&(i=e.key,a=e.getter||a,u=e.setter||u),t[i]&&!o||(t[i]={get:a,set:u})})})},h=function(e){return null==e},T=function(e){return!h(e)},y={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0},R=function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!0;for(var n in t)if(t[n]!==e[n])return!0;return!1},D=function(e,t){var n=t.opacity,r=t.translateX,o=t.translateY,i=t.scaleX,a=t.scaleY,u=t.rotateX,l=t.rotateY,c=t.rotateZ,s=t.height,f=[],p=[];(T(r)||T(o))&&f.push("translate3d("+(r||0)+"px, "+(o||0)+"px, 0)"),(T(i)||T(a))&&f.push("scale3d("+(T(i)?i:1)+", "+(T(a)?a:1)+", 1)"),(T(c)||T(l)||T(u))&&f.push("rotate3d("+(u||0)+", "+(l||0)+", "+(c||0)+", 360deg)"),f.length&&p.push("transform:"+f.join(" ")),T(n)&&(p.push("opacity:"+n),0===n&&p.push("visibility:hidden"),n<1&&p.push("pointer-events:none;")),T(s)&&p.push("height:"+s+"px");var d=e.getAttribute("style")||"",E=p.join(";");E.length===d.length&&E===d||e.setAttribute("style",E)},O={styles:function(e){var t=e.mixinConfig,n=e.viewProps,r=e.viewInternalAPI,a=e.viewExternalAPI,u=e.view,l=o({},n),c={};g(t,[r,a],n);var s=function(){return u.rect?p(u.rect,u.childViews,[n.translateX||0,n.translateY||0],[n.scaleX||0,n.scaleY||0]):null};return r.rect={get:s},a.rect={get:s},t.forEach(function(e){n[e]=void 0===l[e]?y[e]:l[e]}),{write:function(){if(R(c,n))return D(u.element,n),Object.assign.apply(Object,[c].concat(i(n))),!0},destroy:function(){}}},listeners:function(e){e.mixinConfig,e.viewProps,e.viewInternalAPI;var t,n=e.viewExternalAPI,r=(e.viewState,e.view),o=[],i=(t=r.element,function(e,n){t.addEventListener(e,n)}),a=function(e){return function(t,n){e.removeEventListener(t,n)}}(r.element);return n.on=function(e,t){o.push({type:e,fn:t}),i(e,t)},n.off=function(e,t){o.splice(o.findIndex(function(n){return n.type===e&&n.fn===t}),1),a(e,t)},{write:function(){return!0},destroy:function(){o.forEach(function(e){a(e.type,e.fn)})}}},animations:function(e){var t=e.mixinConfig,n=e.viewProps,r=e.viewInternalAPI,i=e.viewExternalAPI,u=o({},n),l=[],c=0;return a(t,function(e,t){var o=I(t);o&&(o.onupdate=function(t){n[e]=t},o.oncomplete=function(){c--},c++,o.target=u[e],g([{key:e,setter:function(e){o.target!==e&&(o.resting&&c++,o.target=e)},getter:function(){return n[e]}}],[r,i],n,!0),l.push(o))}),{write:function(e){return l.forEach(function(t){t.interpolate(e)}),0===c},destroy:function(){}}},apis:function(e){var t=e.mixinConfig,n=e.viewProps,r=e.viewExternalAPI;g(t,r,n)}},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.paddingTop=parseInt(n.paddingTop,10)||0,e.marginTop=parseInt(n.marginTop,10)||0,e.marginRight=parseInt(n.marginRight,10)||0,e.marginBottom=parseInt(n.marginBottom,10)||0,e.marginLeft=parseInt(n.marginLeft,10)||0,e.left=t.offsetLeft||0,e.top=t.offsetTop||0,e.width=t.offsetWidth||0,e.height=t.offsetHeight||0,e.right=e.left+e.width,e.bottom=e.top+e.height,e.scrollTop=t.scrollTop,e.hidden=null===t.offsetParent,e},S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.tag,n=void 0===t?"div":t,r=e.name,i=void 0===r?null:r,l=e.attributes,c=void 0===l?{}:l,s=e.read,d=void 0===s?function(){}:s,E=e.write,v=void 0===E?function(){}:E,_=e.create,m=void 0===_?function(){}:_,I=e.destroy,g=void 0===I?function(){}:I,h=e.filterFrameActionsForChild,T=void 0===h?function(e,t){return t}:h,y=e.didCreateView,R=void 0===y?function(){}:y,D=e.ignoreRect,S=void 0!==D&&D,A=e.mixins,L=void 0===A?[]:A;return function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=f(n,"filepond--"+i,c),s=window.getComputedStyle(l,null),E=b(),_=null,I=[],h=[],y={},D={},A=[v],w=[d],M=[g],P=function(){return l},C=function(){return[].concat(I)},N=function(){return _||(_=p(E,I,[0,0],[1,1]))},G={element:{get:P},style:{get:function(){return s}},childViews:{get:C}},B=o({},G,{rect:{get:N},ref:{get:function(){return y}},is:function(e){return i===e},appendChild:(t=l,function(e,n){void 0!==n&&t.children[n]?t.insertBefore(e,t.children[n]):t.appendChild(e)}),createChildView:function(e){return function(t,n){return t(e,n)}}(e),appendChildView:function(e,t){return function(e,n){return void 0!==n?t.splice(n,0,e):t.push(e),e}}(0,I),removeChildView:function(e,t){return function(n){return t.splice(t.indexOf(n),1),n.element.parentNode&&e.removeChild(n.element),n}}(l,I),registerWriter:function(e){return A.push(e)},registerReader:function(e){return w.push(e)},dispatch:e.dispatch,query:e.query}),x={element:{get:P},childViews:{get:C},rect:{get:N},isRectIgnored:function(){return S},_read:function(){_=null,I.forEach(function(e){return e._read()}),b(E,l,s),w.forEach(function(e){return e({root:q,props:r,rect:E})})},_write:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=0===t.length;return A.forEach(function(o){!1===o({props:r,root:q,actions:t,timestamp:e})&&(n=!1)}),h.forEach(function(t){!1===t.write(e)&&(n=!1)}),I.filter(function(e){return!!e.element.parentNode}).forEach(function(r){r._write(e,T(r,t))||(n=!1)}),I.filter(function(e){return!e.element.parentNode}).forEach(function(r,o){q.appendChild(r.element,o),r._read(),r._write(e,T(r,t)),n=!1}),n},_destroy:function(){h.forEach(function(e){return e.destroy()}),M.forEach(function(e){return e({root:q})}),I.forEach(function(e){return e._destroy()})}},F=o({},G,{rect:{get:function(){return E}}});a(L,function(e,t){var n=O[e]({mixinConfig:t,viewProps:r,viewState:D,viewInternalAPI:B,viewExternalAPI:x,view:u(F)});n&&h.push(n)});var q=u(B);m({root:q,props:r});var V=l.children.length;return I.forEach(function(e,t){q.appendChild(e.element,V+t)}),R(q),u(x)}},A=function(e){return function(t){var n=t.root,r=t.props,o=t.actions;(void 0===o?[]:o).filter(function(t){return e[t.type]}).forEach(function(t){return e[t.type]({root:n,props:r,action:t.data})})}},L=function(e,t){return t.parentNode.insertBefore(e,t)},w=function(e,t){return t.parentNode.insertBefore(e,t.nextSibling)},M=function(e){return Array.isArray(e)},P=function(e){return e.trim()},C=function(e){return""+e},N=function(e){return"boolean"==typeof e},G=function(e){return N(e)?e:"true"===e},B=function(e){return"string"==typeof e},x=function(e){return v(e)?e:B(e)?C(e).replace(/[a-z]+/gi,""):0},F=function(e){return parseInt(x(e),10)},q=function(e){return v(e)&&isFinite(e)&&Math.floor(e)===e},V=function(e){if(q(e))return e;var t=C(e).trim();return/MB$/i.test(t)?(t=t.replace(/MB$i/,"").trim(),1e3*F(t)*1e3):/KB/i.test(t)?(t=t.replace(/KB$i/,"").trim(),1e3*F(t)):F(t)},U={process:"POST",revert:"DELETE",fetch:"GET",restore:"GET",load:"GET"},Y=function(e,t,n,r){if(null===t)return null;if("function"==typeof t)return t;var o={url:"GET"===n?"?"+e+"=":"",method:n,headers:{},withCredentials:!1,timeout:r};if(B(t))return o.url=t,o;if(Object.assign(o,t),B(o.headers)){var i=o.headers.split(/:(.+)/);o.headers={header:i[0],value:i[1]}}return o.withCredentials=G(o.withCredentials),o},X=function(e){return"object"===(void 0===e?"undefined":r(e))&&null!==e},H=function(e){return M(e)?"array":function(e){return null===e}(e)?"null":q(e)?"int":/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(e)?"bytes":function(e){return X(e)&&B(e.url)&&X(e.process)&&X(e.revert)&&X(e.restore)&&X(e.fetch)}(e)?"api":void 0===e?"undefined":r(e)},j={array:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return h(e)?[]:M(e)?e:C(e).split(t).map(P).filter(function(e){return e.length})},boolean:G,int:function(e){return"bytes"===H(e)?V(e):F(e)},float:function(e){return parseFloat(x(e))},bytes:V,string:C,serverapi:function(e){return(n={}).url=B(t=e)?t:t.url||"",n.timeout=t.timeout?parseInt(t.timeout,10):7e3,a(U,function(e){n[e]=Y(e,t[e],U[e],n.timeout)}),n;var t,n},function:function(e){return function(e){for(var t=self,n=e.split("."),r=null;r=n.shift();)if(!(t=t[r]))return null;return t}(e)}},W=function(e,t,n){if(e===t)return e;var r,o=H(e);if(o!==n){var i=(r=e,j[n](r));if(o=H(i),null===i)throw'Trying to assign value with incorrect type to "'+option+'", allowed type: "'+n+'"';e=i}return e},z=function(e){var t={};return a(e,function(n){var r,o,i,a=e[n];t[n]=(r=a[0],o=a[1],i=r,{get:function(){return i},set:function(e){i=W(e,r,o)}})}),u(t)},k=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return e.split(/(?=[A-Z])/).map(function(e){return e.toLowerCase()}).join(t)},Q=1,$=2,Z=3,K=4,J=5,ee=function(){return Math.random().toString(36).substr(2,9)},te=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:75;return e.map(function(e,r){return new Promise(function(o,i){setTimeout(function(){t(e),o()},n*r)})})},ne=function(e,t){return e.splice(t,1)},re=function(){var e=[],t=function(t,n){ne(e,e.findIndex(function(e){return e.event===t&&(e.cb===n||!n)}))};return{fire:function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;oBrowse',ce.STRING],labelFileWaitingForSize:["Waiting for size",ce.STRING],labelFileSizeNotAvailable:["Size not available",ce.STRING],labelFileCountSingular:["file in list",ce.STRING],labelFileCountPlural:["files in list",ce.STRING],labelFileLoading:["Loading",ce.STRING],labelFileAdded:["Added",ce.STRING],labelFileRemoved:["Removed",ce.STRING],labelFileLoadError:["Error during load",ce.STRING],labelFileProcessing:["Uploading",ce.STRING],labelFileProcessingComplete:["Upload complete",ce.STRING],labelFileProcessingAborted:["Upload cancelled",ce.STRING],labelFileProcessingError:["Error during upload",ce.STRING],labelTapToCancel:["tap to cancel",ce.STRING],labelTapToRetry:["tap to retry",ce.STRING],labelTapToUndo:["tap to undo",ce.STRING],labelButtonRemoveItem:["Remove",ce.STRING],labelButtonAbortItemLoad:["Abort",ce.STRING],labelButtonRetryItemLoad:["Retry",ce.STRING],labelButtonAbortItemProcessing:["Cancel",ce.STRING],labelButtonUndoItemProcessing:["Undo",ce.STRING],labelButtonRetryItemProcessing:["Retry",ce.STRING],labelButtonProcessItem:["Upload",ce.STRING],iconRemove:['',ce.STRING],iconProcess:['',ce.STRING],iconRetry:['',ce.STRING],iconUndo:['',ce.STRING],oninit:[null,ce.FUNCTION],onwarning:[null,ce.FUNCTION],onerror:[null,ce.FUNCTION],onaddfilestart:[null,ce.FUNCTION],onaddfileprogress:[null,ce.FUNCTION],onaddfile:[null,ce.FUNCTION],onprocessfilestart:[null,ce.FUNCTION],onprocessfileprogress:[null,ce.FUNCTION],onprocessfileabort:[null,ce.FUNCTION],onprocessfilerevert:[null,ce.FUNCTION],onprocessfile:[null,ce.FUNCTION],onremovefile:[null,ce.FUNCTION],files:[[],ce.ARRAY]},_e=function(e,t){return h(t)?e[0]||null:q(t)?e[t]||null:("object"===(void 0===t?"undefined":r(t))&&(t=t.id),e.find(function(e){return e.id===t})||null)},me=function(e){return{GET_ITEM:function(t){return _e(e.items,t)},GET_ITEMS:function(t){return[].concat(i(e.items))},GET_ITEM_NAME:function(t){var n=_e(e.items,t);return n?n.filename:null},GET_ITEM_SIZE:function(t){var n=_e(e.items,t);return n?n.fileSize:null},GET_TOTAL_ITEMS:function(){return e.items.length},IS_ASYNC:function(){return X(e.options.server)&&(X(e.options.server.process)||"function"==typeof e.options.server.process)}}},Ie=function(e,t,n){return h(t)?null:void 0===n?(e.push(t),t):(r=n,o=0,i=e.length,function(e,t,n){e.splice(t,0,n)}(e,n=Math.max(Math.min(i,r),o),t),t);var r,o,i},ge=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(t+e).slice(-t.length)},he=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return e.getFullYear()+"-"+ge(e.getMonth()+1,"00")+"-"+ge(e.getDate(),"00")+"_"+ge(e.getHours(),"00")+"-"+ge(e.getMinutes(),"00")+"-"+ge(e.getSeconds(),"00")},Te=function(e){return/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(e)},ye=function(e){return e.split("/").pop().split("?").shift()},Re=function(e){return e.split(".").pop()},De=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o="string"==typeof n?e.slice(0,e.size,n):e.slice(0,e.size,e.type);return o.lastModifiedDate=new Date,t&&null===r&&Re(t)?o.name=t:(r=r||function(e){if("string"!=typeof e)return"";var t=e.split("/").pop();return/svg/.test(t)?"svg":/zip|compressed/.test(t)?"zip":/plain/.test(t)?"txt":/msword/.test(t)?"doc":/[a-z]+/.test(t)?"jpeg"===t?"jpg":t:""}(o.type),o.name=t+(r?"."+r:"")),o},Oe=function(e,t){var n=window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(n){var r=new n;return r.append(e),r.getBlob(t)}return new Blob([e],{type:t})},be=function(e){return(/^data:(.+);/.exec(e)||[])[1]||null},Se=function(e){var t=be(e);return function(e,t){for(var n=new ArrayBuffer(e.length),r=new Uint8Array(n),o=0;o=200&&c.status<300?r.onload(Me("load",c.status,c.response,c.getAllResponseHeaders())):r.onerror(Me("error",c.status,c.statusText))},c.onerror=function(){r.onerror(Me("error",c.status,c.statusText))},c.onabort=function(){a||(u=!0,r.onabort())},q(n.timeout)&&(i=setTimeout(function(){a=!0,r.onerror(Me("error",0,"timeout")),r.abort()},n.timeout)),c.open(n.method,t,!0),Object.keys(n.headers).forEach(function(e){c.setRequestHeader(e,n.headers[e])}),n.responseType&&(c.responseType=n.responseType),n.withCredentials&&(c.withCredentials=!0),c.send(e),r},Ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments[1];return"function"==typeof t?t:t&&B(t.url)?function(n,r,i,a,u,l){var c=Pe(n,e+t.url,o({},t,{responseType:"blob"}));return c.onload=function(e){e.body=De(e.body,Ae(e.headers)||ye(n)||he()),r(e)},c.onerror=i,c.onprogress=a,c.onabort=u,c.onheaders=l,c}:null},Ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e+Math.random()*(t-e)},Ge=function(e){var t={complete:!1,perceivedProgress:0,perceivedPerformanceUpdater:null,progress:null,timestamp:null,perceivedDuration:0,duration:0,request:null,response:null},n=function(){t.request&&(t.perceivedPerformanceUpdater.clear(),t.request.abort(),t.complete=!0,r.fire("abort",t.response?t.response.body:null))},r=o({},re(),{process:function(n,o){var i=function(){0!==t.duration&&null!==t.progress&&r.fire("progress",r.getProgress())},a=function(){t.complete=!0,r.fire("load",t.response.body)};r.fire("start"),t.timestamp=Date.now(),t.perceivedPerformanceUpdater=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:25,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,o=null,i=Date.now();return function a(){var u=Date.now()-i,l=Ne(n,r);u+l>t&&(l=u+l-t);var c=u/t;c>=1?e(1):(e(c),o=setTimeout(a,l))}(),{clear:function(){clearTimeout(o)}}}(function(e){t.perceivedProgress=e,t.perceivedDuration=Date.now()-t.timestamp,i(),1===e&&t.response&&!t.complete&&a()},Ne(750,1500)),t.request=e(n,o,function(e){t.response="string"==typeof e?{type:"load",code:200,body:e,headers:{}}:e,t.duration=Date.now()-t.timestamp,t.progress=1,1===t.perceivedProgress&&a()},function(e){t.perceivedPerformanceUpdater.clear(),r.fire("error","string"==typeof e?{type:"error",code:0,body:e}:e)},function(e,n,r){t.duration=Date.now()-t.timestamp,t.progress=e?n/r:null,i()},function(){t.perceivedPerformanceUpdater.clear(),r.fire("abort")})},abort:n,getProgress:function(){return t.progress?Math.min(t.progress,t.perceivedProgress):null},getDuration:function(){return Math.min(t.duration,t.perceivedDuration)},reset:function(){n(),t.complete=!1,t.perceivedProgress=0,t.progress=0,t.timestamp=null,t.perceivedDuration=0,t.duration=0,t.request=null,t.response=null}});return r},Be=function(e){return e.substr(0,e.lastIndexOf("."))||e},xe={INIT:1,IDLE:2,PROCESSING:3,PROCESSING_PAUSED:4,PROCESSING_COMPLETE:5,PROCESSING_ERROR:6,LOADING:7,LOAD_ERROR:8},Fe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=ee(),n={source:null,file:null,serverFileReference:e,status:e?xe.PROCESSING_COMPLETE:xe.INIT,activeLoader:null,activeProcessor:null},r={},i=function(e){return n.status=e},a=o({id:{get:function(){return t}},serverId:{get:function(){return n.serverFileReference}},status:{get:function(){return n.status}},filename:{get:function(){return n.file.name}},filenameWithoutExtension:{get:function(){return Be(n.file.name)}},fileExtension:{get:function(){return Re(n.file.name)}},fileType:{get:function(){return n.file.type}},fileSize:{get:function(){return n.file.size}},file:{get:function(){return n.file}},source:{get:function(){return n.source}},getMetadata:function(e){return e?r[e]:o({},r)},setMetadata:function(e,t){return r[e]=t},abortLoad:function(){n.activeLoader&&n.activeLoader.abort()},retryLoad:function(){n.activeLoader&&n.activeLoader.load()},abortProcessing:function(){n.activeProcessor&&n.activeProcessor.abort()},load:function(e,t,r){n.source=e,n.file=function(e){var t=[e.name,e.size,e.type];return e instanceof Blob||Te(e)?t[0]=he():Te(e)?(t[1]=e.length,t[2]=be(e)):e instanceof File||(t[0]=ye(e),t[1]=0,t[2]="application/octet-stream"),{name:t[0],size:t[1],type:t[2]}}(e),t.on("init",function(){a.fire("load-init")}),t.on("meta",function(e){n.file.size=e.size,n.file.filename=e.filename,a.fire("load-meta")}),t.on("progress",function(e){i(xe.LOADING),a.fire("load-progress",e)}),t.on("error",function(e){i(xe.LOAD_ERROR),a.fire("load-request-error",e)}),t.on("abort",function(){i(xe.INIT),a.fire("load-abort")}),t.on("load",function(e){n.activeLoader=null;var t=function(e){n.file=e,i(xe.IDLE),a.fire("load")};n.serverFileReference?t(e):r(e,t,function(t){n.file=e,a.fire("load-meta"),i(xe.LOAD_ERROR),a.fire("load-file-error",t)})}),t.setSource(e),n.activeLoader=t,t.load()},process:function e(t,u){n.file instanceof Blob?(t.on("load",function(e){n.activeProcessor=null,n.serverFileReference=e,i(xe.PROCESSING_COMPLETE),a.fire("process-complete",e)}),t.on("start",function(){a.fire("process-start")}),t.on("error",function(e){n.activeProcessor=null,i(xe.PROCESSING_ERROR),a.fire("process-error",e)}),t.on("abort",function(e){n.activeProcessor=null,n.serverFileReference=e,i(xe.IDLE),a.fire("process-abort")}),t.on("progress",function(e){i(xe.PROCESSING),a.fire("process-progress",e)}),u(n.file,function(e){t.process(e,o({},r))},function(e){}),n.activeProcessor=t):a.on("load",function(){e(t,u)})},revert:function(e){null!==n.serverFileReference&&(e(n.serverFileReference,function(){n.serverFileReference=null},function(e){}),i(xe.IDLE),a.fire("process-revert"))}},re());return u(a)},qe=function(e,t){var n=function(e,t){return h(t)?0:B(t)?e.findIndex(function(e){return e.id===t}):-1}(e,t);if(!(n<0))return e[n]||null},Ve=function(e,t,n,r,o,i){var a=Pe(null,e,{method:"GET",responseType:"blob"});return a.onload=function(n){n.body=De(n.body,Ae(n.headers)||ye(e)||he()),t(n)},a.onerror=n,a.onprogress=r,a.onabort=o,a.onheaders=i,a},Ue=function(e){return 0===e.indexOf("//")&&(e=location.protocol+e),e.toLowerCase().replace(/([a-z])?:\/\//,"$1").split("/")[0]},Ye=function(e,t){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.query,o=n.success,i=void 0===o?function(){}:o,a=n.failure,u=void 0===a?function(){}:a,l=_e(e.items,r);l?t(l,i,u):u({error:Me("error",0,"Item not found"),file:null})}},Xe=function(e,t,n){return{ABORT_ALL:function(){t("GET_ITEMS").forEach(function(e){e.abortLoad(),e.abortProcessing()})},DID_SET_FILES:function(t){var r=t.value,a=(void 0===r?[]:r).map(function(e){return{source:e.source?e.source:e,options:e.options}});[].concat(i(n.items)).forEach(function(t){a.find(function(e){return e.source===t.source})||e("REMOVE_ITEM",{query:t})}),a.forEach(function(t,r){[].concat(i(n.items)).find(function(e){return e.source===t.source})||e("ADD_ITEM",o({},t,{interactionMethod:J,index:r}))})},ADD_ITEM:function(r){var i=r.source,a=r.index,u=r.interactionMethod,l=r.success,c=void 0===l?function(){}:l,s=r.failure,f=void 0===s?function(){}:s,p=r.options,d=void 0===p?{}:p;if(h(i))f({error:Me("error",0,"No source"),file:null});else if(!(i instanceof Blob&&n.options.ignoredFiles.includes(i.name.toLowerCase()))){if(!function(e){var t=e.items.length;if(!e.options.allowMultiple)return 0===t;var n=e.options.maxFiles;return null===n||t=400&&t.code<500)return e("DID_THROW_ITEM_INVALID",{id:g,error:t,status:{main:n.options.labelFileLoadError,sub:t.code+" ("+t.body+")"}}),void f({error:t,file:ae(I)});e("DID_THROW_ITEM_LOAD_ERROR",{id:g,error:t,status:{main:n.options.labelFileLoadError,sub:n.options.labelTapToRetry}})}),I.on("load-file-error",function(t){e("DID_THROW_ITEM_INVALID",o({},t,{id:g}))}),I.on("load-abort",function(){e("REMOVE_ITEM",{query:g})}),I.on("load",function(){fe("DID_LOAD_ITEM",I,{query:t}).then(function(){e("DID_LOAD_ITEM",{id:g,error:null,serverFileReference:m?i:null}),c(ae(I)),v?e("DID_LOAD_LOCAL_ITEM",{id:g}):_?e("DID_COMPLETE_ITEM_PROCESSING",{id:g,error:null,serverFileReference:i}):t("IS_ASYNC")&&n.options.instantUpload&&e("REQUEST_ITEM_PROCESSING",{query:g})})}),I.on("process-start",function(){e("DID_START_ITEM_PROCESSING",{id:g})}),I.on("process-progress",function(t){e("DID_UPDATE_ITEM_PROCESS_PROGRESS",{id:g,progress:t})}),I.on("process-error",function(t){e("DID_THROW_ITEM_PROCESSING_ERROR",{id:g,error:t,status:{main:n.options.labelFileProcessingError,sub:n.options.labelTapToRetry}})}),I.on("process-abort",function(t){n.options.instantUpload?e("REMOVE_ITEM",{query:g}):e("DID_ABORT_ITEM_PROCESSING",{id:g}),e("REVERT_ITEM_PROCESSING",{query:g})}),I.on("process-complete",function(t){e("DID_COMPLETE_ITEM_PROCESSING",{id:g,error:null,serverFileReference:t})}),I.on("process-revert",function(){n.options.instantUpload?e("REMOVE_ITEM",{query:g}):e("DID_REVERT_ITEM_PROCESSING",{id:g})}),e("DID_ADD_ITEM",{id:g,index:a,interactionMethod:u});var T=n.options.server||{},y=T.url,R=T.load,D=T.restore,O=T.fetch;I.load(i,we(m?"limbo"===d.type?Ce(y,D):Ce(y,R):B(i)&&function(e){return(e.indexOf(":")>-1||e.indexOf("//")>-1)&&Ue(location.href)!==Ue(e)}(i)?Ce(y,O):Ve),function(e,n,r){fe("LOAD_FILE",e,{query:t}).then(n).catch(r)})}},RETRY_ITEM_LOAD:Ye(n,function(e){e.retryLoad()}),REQUEST_ITEM_PROCESSING:Ye(n,function(t){var n=t.id;e("DID_REQUEST_ITEM_PROCESSING",{id:n}),e("PROCESS_ITEM",{query:t},!0)}),PROCESS_ITEM:Ye(n,function(e,r,o){e.onOnce("process-complete",function(){r(ae(e))}),e.onOnce("process-error",function(t){o({error:t,file:ae(e)})}),e.process(Ge(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments[1],n=arguments[2];return"function"==typeof t?function(){for(var e=arguments.length,r=Array(e),o=0;o0&&void 0!==arguments[0]?arguments[0]:"",t=arguments[1];return"function"==typeof t?t:t&&B(t.url)?function(n,r,o){var i=Pe(n,e+t.url,t);return i.onload=r,i.onerror=o,i}:function(e,t){return t()}}(n.options.server.url,n.options.server.revert))}),SET_OPTIONS:function(t){var n=t.options;a(n,function(t,n){e("SET_"+k(t,"_").toUpperCase(),{value:n})})}}},He=function(e){return document.createElement(e)},je=function(e){return decodeURI(e)},We=function(e,t){var n=e.childNodes[0];n?t!==n.nodeValue&&(n.nodeValue=t):(n=document.createTextNode(t),e.appendChild(n))},ze=function(e,t,n,r){var o=(r%360-90)*Math.PI/180;return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}},ke=function(e,t,n,r,o){var i=1;return o>r&&o-r<=.5&&(i=0),r>o&&r-o>=.5&&(i=0),function(e,t,n,r,o,i){var a=ze(e,t,n,o),u=ze(e,t,n,r);return["M",a.x,a.y,"A",n,n,0,i,0,u.x,u.y].join(" ")}(e,t,n,360*Math.min(.9999,r),360*Math.min(.9999,o),i)},Qe=S({tag:"div",name:"progress-indicator",ignoreRect:!0,create:function(e){var t=e.root,n=e.props;n.spin=!1,n.progress=0,n.opacity=0;var r=f("svg");t.ref.path=f("path",{"stroke-width":2,"stroke-linecap":"round"}),r.appendChild(t.ref.path),t.ref.svg=r,t.appendChild(r)},write:function(e){var t=e.root,n=e.props;if(0!==n.opacity){var r=parseInt(l(t.ref.path,"stroke-width"),10),o=.5*t.rect.element.width,i=0,a=0;n.spin?(i=0,a=.5):(i=0,a=n.progress);var u=ke(o,o,o-r,i,a);l(t.ref.path,"d",u),l(t.ref.path,"stroke-opacity",n.spin||n.progress>0?1:0)}},mixins:{apis:["progress","spin"],styles:["opacity"],animations:{opacity:{type:"tween",duration:500},progress:{type:"spring",stiffness:.95,damping:.65,mass:10}}}}),$e=S({tag:"button",attributes:{type:"button"},ignoreRect:!0,name:"file-action-button",mixins:{apis:["label"],styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}},listeners:!0},create:function(e){var t=e.root,n=e.props;t.element.title=n.label,t.element.innerHTML=n.icon||"",n.disabled=!1},write:function(e){var t=e.root,n=e.props;0!==n.opacity||n.disabled?n.opacity>0&&n.disabled&&(n.disabled=!1,t.element.removeAttribute("disabled")):(n.disabled=!0,l(t.element,"disabled","disabled"))}}),Ze=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".";return(e=Math.round(Math.abs(e)))<1e3?e+" bytes":e-1?function(e,t,n){return e-1===t?n/6:e===t?n/2:e+1===t?-n/2:e+2===t?-n/6:0}(t,n.dragIndex,10):0),e.markedForRemoval||(e.scaleX=1,e.scaleY=1,e.opacity=1),i+=r.outer.height}),t.childViews.filter(function(e){return e.markedForRemoval&&0===e.opacity}).forEach(function(e){t.removeChildView(e),o=!1}),o},tag:"ul",name:"list",filterFrameActionsForChild:function(e,t){return t.filter(function(t){return!t.data||!t.data.id||e.id===t.data.id})},mixins:{apis:["dragIndex"]}}),wt=function(e,t){for(var n=0,r=e.childViews,o=r.length;n3&&void 0!==arguments[3]?arguments[3]:"";n?l(e,t,r):e.removeAttribute(t)},Nt=function(e){var t=e.root;t.query("GET_TOTAL_ITEMS")>0?Ct(t.element,"required",!1):t.query("GET_REQUIRED")&&Ct(t.element,"required",!0)},Gt=S({tag:"input",name:"browser",ignoreRect:!0,attributes:{type:"file"},create:function(e){var t=e.root,n=e.props;t.element.id="filepond--browser-"+n.id,l(t.element,"aria-controls","filepond--assistant-"+n.id),l(t.element,"aria-labelledby","filepond--drop-label-"+n.id),t.element.addEventListener("change",function(){if(t.element.value){var e=[].concat(i(t.element.files));setTimeout(function(){n.onload(e),function(e){if(e&&""!==e.value){try{e.value=""}catch(e){}if(e.value){var t=He("form"),n=e.parentNode,r=e.nextSibling;t.appendChild(e),t.reset(),r?n.insertBefore(e,r):n.appendChild(e)}}}(t.element)},250)}})},write:A({DID_ADD_ITEM:Nt,DID_REMOVE_ITEM:Nt,DID_SET_ALLOW_BROWSE:function(e){var t=e.root,n=e.action;Ct(t.element,"disabled",!n.value)},DID_SET_ALLOW_MULTIPLE:function(e){var t=e.root,n=e.action;Ct(t.element,"multiple",n.value)},DID_SET_ACCEPTED_FILE_TYPES:function(e){var t=e.root,n=e.action;Ct(t.element,"accept",!!n.value,n.value?n.value.join(","):"")},DID_SET_CAPTURE_METHOD:function(e){var t=e.root,n=e.action;Ct(t.element,"capture",!!n.value,!0===n.value?"":n.value)},DID_SET_REQUIRED:function(e){var t=e.root;e.action.value?0===t.query("GET_TOTAL_ITEMS")&&Ct(t.element,"required",!0):Ct(t.element,"required",!1)}})}),Bt=13,xt=32,Ft=S({name:"drop-label",create:function(e){var t=e.root,n=e.props,r=He("label");l(r,"for","filepond--browser-"+n.id),l(r,"id","filepond--drop-label-"+n.id),l(r,"aria-hidden","true"),r.addEventListener("keydown",function(e){e.keyCode!==Bt&&e.keyCode!==xt||(e.preventDefault(),t.ref.label.click())}),t.appendChild(r),t.ref.label=r},write:A({DID_SET_LABEL_IDLE:function(e){var t=e.root,n=e.action;e.props.caption=function(e,t){e.innerHTML=t;var n=e.querySelector(".filepond--label-action");return n&&l(n,"tabindex","0"),t}(t.ref.label,n.value)}}),mixins:{apis:["caption"],styles:["opacity","translateX","translateY"],animations:{opacity:{type:"tween",duration:150},translateX:"spring",translateY:"spring"}}}),qt=S({name:"drip-blob",ignoreRect:!0,mixins:{styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}}}}),Vt=A({DID_DRAG:function(e){var t=e.root,n=e.action;t.ref.blob?(t.ref.blob.translateX=n.position.scopeLeft,t.ref.blob.translateY=n.position.scopeTop,t.ref.blob.scaleX=1,t.ref.blob.scaleY=1,t.ref.blob.opacity=1):function(e){var t=e.root,n=.5*t.rect.element.width,r=.5*t.rect.element.height;t.ref.blob=t.appendChildView(t.createChildView(qt,{opacity:0,scaleX:2.5,scaleY:2.5,translateX:n,translateY:r}))}({root:t})},DID_DROP:function(e){var t=e.root;t.ref.blob&&(t.ref.blob.scaleX=2.5,t.ref.blob.scaleY=2.5,t.ref.blob.opacity=0)},DID_END_DRAG:function(e){var t=e.root;t.ref.blob&&(t.ref.blob.opacity=0)}}),Ut=S({ignoreRect:!0,name:"drip",write:function(e){var t=e.root,n=e.props,r=e.actions;Vt({root:t,props:n,actions:r});var o=t.ref.blob;0===r.length&&o&&0===o.opacity&&(t.removeChildView(o),t.ref.blob=null)}}),Yt=function(e){return new Promise(function(t,n){var r=$t(e);r.length?t(r):Xt(e).then(t)})},Xt=function(e){return new Promise(function(t,n){var r=(e.items?[].concat(i(e.items)):[]).filter(function(e){return Ht(e)}).map(function(e){return jt(e)});r.length?Promise.all(r).then(function(e){var n=[];e.forEach(function(e){n.push.apply(n,i(e))}),t(n.filter(function(e){return e}))}):t([].concat(i(e.files)))})},Ht=function(e){if(kt(e)){var t=Qt(e);if(t)return t.isFile||t.isDirectory}return"file"===e.kind},jt=function(e){return new Promise(function(t,n){zt(e)?Wt(Qt(e)).then(t):t([e.getAsFile()])})},Wt=function(e){return new Promise(function(t,n){var r=[],o=0;!function e(n){n.createReader().readEntries(function(n){n.forEach(function(n){n.isDirectory?e(n):(o++,n.file(function(e){r.push(e),o===r.length&&t(r)}))})})}(e)})},zt=function(e){return kt(e)&&(Qt(e)||{}).isDirectory},kt=function(e){return"webkitGetAsEntry"in e},Qt=function(e){return e.webkitGetAsEntry()},$t=function(e){var t=[];try{if((t=Kt(e)).length)return t;t=Zt(e)}catch(e){}return t},Zt=function(e){var t=e.getData("url");return"string"==typeof t&&t.length?[t]:[]},Kt=function(e){var t=e.getData("text/html");if("string"==typeof t&&t.length){var n=t.match(/src\s*=\s*"(.+?)"/);if(n)return[n[1]]}return[]},Jt=[],en=function(e){return{pageLeft:e.pageX,pageTop:e.pageY,scopeLeft:e.layerX||e.offsetX,scopeTop:e.layerY||e.offsetY}},tn=function(e){var t=Jt.find(function(t){return t.element===e});if(t)return t;var n=nn(e);return Jt.push(n),n},nn=function(e){var t=[],n={dragenter:un,dragover:ln,dragleave:sn,drop:cn},r={};a(n,function(n,o){r[n]=o(e,t),e.addEventListener(n,r[n],!1)});var o={element:e,addListener:function(i){return t.push(i),function(){t.splice(t.indexOf(i),1),0===t.length&&(Jt.splice(Jt.indexOf(o),1),a(n,function(t){e.removeEventListener(t,r[t],!1)}))}}};return o},rn=function(e,t){var n,r=("getRootNode"in(n=t)?n.getRootNode():document).elementFromPoint(e.pageX-window.pageXOffset,e.pageY-window.pageYOffset);return r===t||t.contains(r)},on=null,an=function(e,t){try{e.dropEffect=t}catch(e){}},un=function(e,t){return function(e){e.preventDefault(),on=e.target,t.forEach(function(t){var n=t.element,r=t.onenter;rn(e,n)&&(t.state="enter",r(en(e)))})}},ln=function(e,t){return function(e){e.preventDefault();var n=e.dataTransfer;Yt(n).then(function(r){var o=!1;t.some(function(t){var i=t.filterElement,a=t.element,u=t.onenter,l=t.onexit,c=t.ondrag,s=t.allowdrop;an(n,"copy");var f=s(r);if(f)if(rn(e,a)){if(o=!0,null===t.state)return t.state="enter",void u(en(e));if(t.state="over",i&&!f)return void an(n,"none");c(en(e))}else i&&!o&&an(n,"none"),t.state&&(t.state=null,l(en(e)));else an(n,"none")})})}},cn=function(e,t){return function(e){e.preventDefault();var n=e.dataTransfer;Yt(n).then(function(n){t.forEach(function(t){var r=t.filterElement,o=t.element,i=t.ondrop,a=t.onexit,u=t.allowdrop;t.state=null,u(n)?r&&!rn(e,o)||i(en(e),n):a(en(e))})})}},sn=function(e,t){return function(e){on===e.target&&t.forEach(function(t){var n=t.onexit;t.state=null,n(en(e))})}},fn=function(e,t,n){e.classList.add("filepond--hopper");var r=n.catchesDropsOnPage,o=n.requiresDropOnElement,i=function(e,t,n){var r=tn(t),o={element:e,filterElement:n,state:null,ondrop:function(){},onenter:function(){},ondrag:function(){},onexit:function(){},onload:function(){},allowdrop:function(){}};return o.destroy=r.addListener(o),o}(e,r?document.documentElement:e,o),a="",u="";i.allowdrop=function(e){return t(e)},i.ondrop=function(e,n){t(n)?(u="drag-drop",l.onload(n,e)):l.ondragend(e)},i.ondrag=function(e){l.ondrag(e)},i.onenter=function(e){u="drag-over",l.ondragstart(e)},i.onexit=function(e){u="drag-exit",l.ondragend(e)};var l={updateHopperState:function(){a!==u&&(e.dataset.hopperState=u,a=u)},onload:function(){},ondragstart:function(){},ondrag:function(){},ondragend:function(){},destroy:function(){i.destroy()}};return l},pn=!1,dn=[],En=function(e){Yt(e.clipboardData).then(function(e){e.length&&dn.forEach(function(t){return t(e)})})},vn=function(){var e=function(e){t.onload(e)},t={destroy:function(){var t;t=e,ne(dn,dn.indexOf(t)),0===dn.length&&(document.removeEventListener("paste",En),pn=!1)},onload:function(){}};return function(e){dn.includes(e)||(dn.push(e),pn||(pn=!0,document.addEventListener("paste",En)))}(e),t},_n=null,mn=null,In=[],gn=function(e,t){e.element.textContent=t},hn=function(e,t,n){var r=e.query("GET_TOTAL_ITEMS");gn(e,n+" "+t+", "+r+" "+(1===r?e.query("GET_LABEL_FILE_COUNT_SINGULAR"):e.query("GET_LABEL_FILE_COUNT_PLURAL"))),clearTimeout(mn),mn=setTimeout(function(){!function(e){e.element.textContent=""}(e)},1500)},Tn=function(e){return e.element.parentNode.contains(document.activeElement)},yn=function(e){var t=e.root,n=e.action,r=t.query("GET_ITEM",n.id).filename,o=t.query("GET_LABEL_FILE_PROCESSING_ABORTED");gn(t,r+" "+o)},Rn=function(e){var t=e.root,n=e.action,r=t.query("GET_ITEM",n.id).filename;gn(t,n.status.main+" "+r+" "+n.status.sub)},Dn=S({create:function(e){var t=e.root,n=e.props;t.element.id="filepond--assistant-"+n.id,l(t.element,"role","status"),l(t.element,"aria-live","polite"),l(t.element,"aria-relevant","additions")},ignoreRect:!0,write:A({DID_LOAD_ITEM:function(e){var t=e.root,n=e.action;if(Tn(t)){t.element.textContent="";var r=t.query("GET_ITEM",n.id);In.push(r.filename),clearTimeout(_n),_n=setTimeout(function(){hn(t,In.join(", "),t.query("GET_LABEL_FILE_ADDED")),In.length=0},750)}},DID_REMOVE_ITEM:function(e){var t=e.root,n=e.action;if(Tn(t)){var r=n.item;hn(t,r.filename,t.query("GET_LABEL_FILE_REMOVED"))}},DID_COMPLETE_ITEM_PROCESSING:function(e){var t=e.root,n=e.action,r=t.query("GET_ITEM",n.id).filename,o=t.query("GET_LABEL_FILE_PROCESSING_COMPLETE");gn(t,r+" "+o)},DID_ABORT_ITEM_PROCESSING:yn,DID_REVERT_ITEM_PROCESSING:yn,DID_THROW_ITEM_LOAD_ERROR:Rn,DID_THROW_ITEM_INVALID:Rn,DID_THROW_ITEM_PROCESSING_ERROR:Rn}),tag:"span",name:"assistant"}),On=function(e){return e.reduce(function(e,t){var n=t.rect.outer.bottom;return n>e&&(e=n),e},0)},bn=function(e,t){if(t.boxBounding)return t.boxBounding;var n=e.ref.measureHeight||null,r=parseInt(e.style.maxHeight,10)||null,o=0===n?null:n;return t.boxBounding={cappedHeight:r,fixedHeight:o},e.element.removeChild(e.ref.measure),e.ref.measure=null,t.boxBounding},Sn=function(e){return e.reduce(function(e,t){return e+t.rect.inner.bottom+t.rect.element.marginBottom},0)},An=A({DID_SET_ALLOW_BROWSE:function(e){var t=e.root,n=e.props;e.action.value?t.ref.browser=t.appendChildView(t.createChildView(Gt,o({},n,{onload:function(e){te(e,function(e){t.dispatch("ADD_ITEM",{interactionMethod:Z,source:e,index:0})})}})),0):t.ref.browser&&t.removeChildView(t.ref.browser)},DID_SET_ALLOW_DROP:function(e){var t=e.root,n=(e.props,e.action);if(n.value&&!t.ref.hopper){var r=fn(t.element,function(e){var n=t.query("GET_ALLOW_REPLACE"),r=t.query("GET_ALLOW_MULTIPLE"),o=t.query("GET_TOTAL_ITEMS"),i=t.query("GET_MAX_TOTAL_ITEMS"),a=e.length;return!(!r&&a>1)&&!(q(i=r?i:n?i:1)&&o+a>i)&&e.every(function(e){return pe("ALLOW_HOPPER_ITEM",e,{query:t.query}).every(function(e){return!0===e})})},{catchesDropsOnPage:t.query("GET_DROP_ON_PAGE"),requiresDropOnElement:t.query("GET_DROP_ON_ELEMENT")});r.onload=function(e,n){var r=t.ref.list.childViews[0],o=wt(r,{left:n.scopeLeft,top:n.scopeTop-t.ref.list.rect.outer.top+t.ref.list.element.scrollTop});te(e,function(e){t.dispatch("ADD_ITEM",{interactionMethod:$,source:e,index:o})}),t.dispatch("DID_DROP",{position:n}),t.dispatch("DID_END_DRAG",{position:n})},r.ondragstart=function(e){t.dispatch("DID_START_DRAG",{position:e})},r.ondrag=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=Date.now(),o=null;return function(){for(var i=arguments.length,a=Array(i),u=0;u0?.5*t.rect.element.paddingTop:0;if(I.fixedHeight)c.scalable=!1,c.height=I.fixedHeight+t.rect.element.paddingTop,l.overflow=g>c.height&&s?c.height:null;else if(I.cappedHeight){c.scalable=!0;var y=Math.min(I.cappedHeight,g);t.height=y+T,c.height=Math.min(I.cappedHeight+t.rect.element.paddingTop,h+T),l.overflow=g>c.height&&s?c.height:null}else c.scalable=!0,t.height=g+T+t.rect.element.paddingTop,c.height=h+T}},destroy:function(e){var t=e.root;t.ref.paster&&t.ref.paster.destroy(),t.ref.hopper&&t.ref.hopper.destroy()},mixins:{styles:["height"]}}),wn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null,n=Ee(),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=o({},e),i=[],a=[],u=function(e,t,n){n?a.push({type:e,data:t}):(f[e]&&f[e](t),i.push({type:e,data:t}))},l=function(e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(n,r){l.dispatch("ADD_ITEM",{interactionMethod:Q,source:e,index:t.index,success:n,failure:r})})},I=function(e){return l.dispatch("REMOVE_ITEM",{query:e}),null===l.query("GET_ITEM",e)},g=function(){return l.query("GET_ITEMS")},h=function(e){return new Promise(function(t,n){l.dispatch("PROCESS_ITEM",{query:e,success:t,failure:n})})},T=o({},re(),p,function(e,t){var n={};return a(t,function(t){n[t]={get:function(){return e.getState().options[t]},set:function(n){e.dispatch("SET_"+k(t,"_").toUpperCase(),{value:n})}}}),n}(l,n),{setOptions:function(e){return l.dispatch("SET_OPTIONS",{options:e})},addFile:m,addFiles:function(){for(var e=arguments.length,t=Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t={};return a(Ee(),function(e,n){t[e]=n[0]}),wn(o({},t,e))},Pn=function(e){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return e.replace(new RegExp(t+".","g"),function(e){return e.charAt(1).toUpperCase()})}(e.replace(/^data-/,""))},Cn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[].concat(i(e.attributes)).reduce(function(t,n){return t[Pn(n.name)]=l(e,n.name),t},{});return function e(t,n){a(n,function(n,r){a(t,function(e,o){var i=new RegExp(n);if(i.test(e)&&(delete t[e],!1!==r))if(B(r))t[r]=o;else{var a,u=r.group;X(r)&&!t[u]&&(t[u]={}),t[u][(a=e.replace(i,""),a.charAt(0).toLowerCase()+a.slice(1))]=o}}),r.mapping&&e(t[r.group],r.mapping)})}(n,t),n},Nn=function(){return(arguments.length<=0?void 0:arguments[0])instanceof HTMLElement?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={"^class$":"className","^multiple$":"allowMultiple","^capture$":"captureMethod","^server":{group:"server",mapping:{"^process":{group:"process"},"^revert":{group:"revert"},"^fetch":{group:"fetch"},"^restore":{group:"restore"},"^load":{group:"load"}}},"^type$":!1,"^files$":!1};pe("SET_ATTRIBUTE_TO_OPTION_MAP",n);var r=o({},Cn("FIELDSET"===e.nodeName?e.querySelector("input[type=file]"):e,n),t);r.files=(t.files||[]).concat([].concat(i(e.querySelectorAll("input:not([type=file])"))).map(function(e){return{source:e.value,options:{type:e.dataset.type}}}));var a=Mn(r);return e.files&&[].concat(i(e.files)).forEach(function(e){a.addFile(e)}),a.replaceElement(e),a}.apply(void 0,arguments):Mn.apply(void 0,arguments)},Gn=["fire","_read","_write"],Bn=function(e){var t={};return oe(e,t,Gn),t},xn=function(e,t){return e.replace(/(?:{([a-z]+)})/g,function(e,n){return t[n]})},Fn=["jpg","jpeg","png","gif","bmp","webp","svg","tiff"],qn=["css","csv","html","txt"],Vn={zip:"zip|compressed",epub:"application/epub+zip"},Un=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=e.toLowerCase(),Fn.includes(e)?"image/"+("jpg"===e?"jpeg":"svg"===e?"svg+xml":e):qn.includes(e)?"text/"+e:Vn[e]||null},Yn=function(e){var t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),n=URL.createObjectURL(t),r=new Worker(n);return{transfer:function(e,t){},post:function(e,t,n){var o=ee();r.onmessage=function(e){e.data.id===o&&t(e.data.message)},r.postMessage({id:o,message:e},n)},terminate:function(){r.terminate(),URL.revokeObjectURL(n)}}},Xn=function(e,t){return new Promise(function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=function(e){n(e)},r.src=e})},Hn=function(e){return Le(e,e.name)},jn=[],Wn=function(e){if(!jn.includes(e)){jn.push(e);var t,n=e({addFilter:de,utils:{Type:ce,forin:a,isString:B,toNaturalFileSize:Ze,replaceInString:xn,getExtensionFromFilename:Re,getFilenameWithoutExtension:Be,guesstimateMimeType:Un,getFileFromBlob:De,getFilenameFromURL:ye,createRoute:A,createWorker:Yn,createView:S,loadImage:Xn,copyFile:Hn,renameFile:Le,applyFilterChain:fe}});t=n.options,Object.assign(ve,t)}},zn={apps:[]},kn="undefined"!=typeof navigator;kn&&function(e){var t=1e3/(arguments.length>1&&void 0!==arguments[1]?arguments[1]:60),n=null,r=null;(function o(i){r=window.requestAnimationFrame(o),n||(n=i);var a=i-n;a<=t||(n=i-a%t,e(i))})(performance.now())}((pt=zn.apps,dt="_read",Et="_write",function(e){pt.forEach(function(e){return e[dt]()}),pt.forEach(function(t){return t[Et](e)})}),60);if(kn){var Qn=function e(){document.dispatchEvent(new CustomEvent("FilePond:loaded",{detail:{supported:rr,create:Jn,destroy:er,parse:tr,find:nr,registerPlugin:or,setOptions:ar}})),document.removeEventListener("DOMContentLoaded",e)};"loading"!==document.readyState?setTimeout(function(){return Qn()},0):document.addEventListener("DOMContentLoaded",Qn)}var $n=function(){return a(Ee(),function(e,t){Kn[e]=t[1]})},Zn=o({},xe),Kn={};$n();var Jn=function(){var e=Nn.apply(void 0,arguments);return e.on("destroy",er),zn.apps.push(e),Bn(e)},er=function(e){var t=zn.apps.findIndex(function(t){return t.isAttachedTo(e)});return t>=0&&(zn.apps.splice(t,1)[0].restoreElement(),!0)},tr=function(e){return[].concat(i(e.querySelectorAll(".filepond"))).filter(function(e){return!zn.apps.find(function(t){return t.isAttachedTo(e)})}).map(function(e){return Jn(e)})},nr=function(e){var t=zn.apps.find(function(t){return t.isAttachedTo(e)});return t?Bn(t):null},rr=function(){return!!kn&&!!("[object OperaMini]"!==Object.prototype.toString.call(window.operamini)&&"visibilityState"in document&&"Promise"in window&&"slice"in Blob.prototype&&"URL"in window&&"createObjectURL"in window.URL&&"performance"in window)},or=function(){for(var e=arguments.length,t=Array(e),n=0;n=5&&c<=8){var s=[d,l];l=s[0],d=s[1]}var f=o.getMetadata("crop")||{rect:{x:0,y:0,width:1,height:1},aspectRatio:d/l},E=window.devicePixelRatio,h=r.query("GET_IMAGE_PREVIEW_HEIGHT"),p=r.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),I=r.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),v=r.rect.inner.width,_=d/l,m=v,y=v*_,g=null!==h?h:Math.max(p,Math.min(d,I)),w=g/_,M=function(e,r,i,n){if(r=Math.round(r),i=Math.round(i),n>=5&&n<=8){var a=[i,r];r=a[0],i=a[1]}var o=document.createElement("canvas"),c=o.getContext("2d");return n>=5&&n<=8?(o.width=i,o.height=r):(o.width=r,o.height=i),c.save(),t(c,r,i,n),c.drawImage(e,0,0,r,i),c.restore(),"close"in e&&e.close(),o}(n.data,w*E,g*E,c),R=null!==h?h:Math.max(p,Math.min(v*f.aspectRatio,I)),T=R/f.aspectRatio;T>m&&(R=(T=m)*f.aspectRatio);var A=R/(y*f.rect.height);l=m*A,d=y*A;var D=-f.rect.x*m*A,G=-f.rect.y*y*A;r.ref.clip.style.cssText="\n width: "+Math.round(T)+"px;\n height: "+Math.round(R)+"px;\n ",M.style.cssText="\n width: "+Math.round(l)+"px;\n height: "+Math.round(d)+"px;\n transform: translate("+Math.round(D)+"px, "+Math.round(G)+"px) rotateZ(0.00001deg);\n ",r.ref.clip.appendChild(M),r.dispatch("DID_IMAGE_PREVIEW_DRAW",{id:a})}}),mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:r,scaleY:r,opacity:{type:"tween",duration:750}}}})},n=function(){self.onmessage=function(t){e(t.data.message,function(e){self.postMessage({id:t.data.id,message:e},[e])})};var e=function(e,t){fetch(e.file).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e)}).then(function(e){return t(e)})}},a=function(e){return-.5*(Math.cos(Math.PI*e)-1)},o=function(e,t,r,i,n){e.width=t,e.height=r;var o=e.getContext("2d"),c=.5*t,u=o.createRadialGradient(c,r+110,r-100,c,r+110,r+100);!function(e,t){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,c=1-o,u=t.join(","),l=0;l<=n;l++){var d=l/n,s=o+c*d;e.addColorStop(s,"rgba("+u+", "+i(d)*r+")")}}(u,i,n,void 0,8,.4),o.save(),o.translate(.5*-t,0),o.scale(2,1),o.fillStyle=u,o.fillRect(0,0,t,r),o.restore()},c="undefined"!=typeof navigator,u=c&&document.createElement("canvas"),l=c&&document.createElement("canvas"),d=c&&document.createElement("canvas");c&&(o(u,500,200,[40,40,40],.85),o(l,500,200,[196,78,71],1),o(d,500,200,[54,151,99],1));var s=function(e){var t=function(e){return e.utils.createView({name:"image-preview-overlay",tag:"canvas",ignoreRect:!0,create:function(e){var t,r,i=e.root,n=e.props;t=n.template,(r=i.element).width=t.width,r.height=t.height,r.getContext("2d").drawImage(t,0,0)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}})}(e),r=function(e){var t=e.root;t.ref.overlayShadow.opacity=1,t.ref.overlayError.opacity=0,t.ref.overlaySuccess.opacity=0},a=function(e){var t=e.root;t.ref.overlayShadow.opacity=.25,t.ref.overlayError.opacity=1};return e.utils.createView({name:"image-preview-wrapper",create:function(r){var n=r.root,a=r.props,o=i(e);n.ref.image=n.appendChildView(n.createChildView(o,{id:a.id,scaleX:1.25,scaleY:1.25,opacity:0})),n.ref.overlayShadow=n.appendChildView(n.createChildView(t,{template:u,opacity:0})),n.ref.overlaySuccess=n.appendChildView(n.createChildView(t,{template:d,opacity:0})),n.ref.overlayError=n.appendChildView(n.createChildView(t,{template:l,opacity:0}))},write:e.utils.createRoute({DID_IMAGE_PREVIEW_LOAD:function(e){e.root.ref.overlayShadow.opacity=1},DID_IMAGE_PREVIEW_DRAW:function(e){var t=e.root.ref.image;t.scaleX=1,t.scaleY=1,t.opacity=1},DID_IMAGE_PREVIEW_CONTAINER_CREATE:function(t){var r,i,a,o=t.root,c=t.props,u=e.utils,l=(u.createView,u.createWorker),d=u.loadImage,s=c.id,f=o.query("GET_ITEM",s),E=URL.createObjectURL(f.file),h=function(e,t,r,i){d(E).then(p)},p=function(e){URL.revokeObjectURL(E),o.dispatch("DID_IMAGE_PREVIEW_LOAD",{id:s,data:e})};r=E,i=function(e,t){if(o.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:s,width:e,height:t}),"createImageBitmap"in window){var r=l(n);r.post({file:E},function(e){r.terminate(),e?p(e):h()})}else h()},(a=new Image).onload=function(){var e=a.naturalWidth,t=a.naturalHeight;a=null,i(e,t)},a.src=r},DID_THROW_ITEM_LOAD_ERROR:a,DID_THROW_ITEM_PROCESSING_ERROR:a,DID_THROW_ITEM_INVALID:a,DID_COMPLETE_ITEM_PROCESSING:function(e){var t=e.root;t.ref.overlayShadow.opacity=.25,t.ref.overlaySuccess.opacity=1},DID_START_ITEM_PROCESSING:r,DID_REVERT_ITEM_PROCESSING:r})})},f=function(e){var t=e.addFilter,r=e.utils,i=r.Type,n=r.createRoute,a=s(e);return t("CREATE_VIEW",function(e){var t=e.is,r=e.view,i=e.query;if(t("file")&&i("GET_ALLOW_IMAGE_PREVIEW")){r.registerWriter(n({DID_LOAD_ITEM:function(e){var t=e.root,n=e.props.id,o=i("GET_ITEM",n);if(o){var c=o.file;if(function(e){return/^image/.test(e.type)&&!/svg/.test(e.type)}(c)){var u="createImageBitmap"in(window||{}),l=i("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");!u&&l&&c.size>l||(t.ref.imagePreview=r.appendChildView(r.createChildView(a,{id:n})),t.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:n}))}}},DID_IMAGE_PREVIEW_CALCULATE_SIZE:function(e){var t=e.root,r=e.props,i=e.action,n=t.query("GET_ITEM",{id:r.id}),a=(n.getMetadata("exif")||{}).orientation||-1,o=i.width,c=i.height;if(a>=5&&a<=8){var u=[c,o];o=u[0],c=u[1]}var l=n.getMetadata("crop")||{rect:{x:0,y:0,width:1,height:1},aspectRatio:c/o},d=t.query("GET_IMAGE_PREVIEW_HEIGHT"),s=t.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),f=t.query("GET_IMAGE_PREVIEW_MAX_HEIGHT");(o=(c=null!==d?d:Math.max(s,Math.min(c,f)))/l.aspectRatio)>t.rect.element.width&&(c=(o=t.rect.element.width)*l.aspectRatio),t.ref.imagePreview.element.style.cssText="height:"+Math.round(c)+"px"}}))}}),{options:{allowImagePreview:[!0,i.BOOLEAN],imagePreviewHeight:[null,i.INT],imagePreviewMinHeight:[44,i.INT],imagePreviewMaxHeight:[256,i.INT],imagePreviewMaxFileSize:[null,i.INT]}}};return"undefined"!=typeof navigator&&document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:f})),f}); +},{}],"F0BQ":[function(require,module,exports) { +var define; +var global = arguments[3]; +var e,t=arguments[3];!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof e&&e.amd?e(n):t.FilePondPluginFileEncode=n()}(this,function(){"use strict";var e=function(){self.onmessage=function(t){e(t.data.message,function(e){self.postMessage({id:t.data.id,message:e})})};var e=function(e,t){var n=e.file,a=new FileReader;a.onloadend=function(){t(a.result.replace("data:","").replace(/^.+,/,""))},a.readAsDataURL(n)}},t=function(t){var n=t.addFilter,a=t.utils,i=a.Type,o=a.createWorker,r=a.createRoute,d=a.applyFilterChain;return n("CREATE_VIEW",function(t){var n=t.is,a=t.view,i=t.query;if(n("file-wrapper")&&i("GET_ALLOW_FILE_ENCODE")){a.registerWriter(r({DID_LOAD_ITEM:function(e){var t=e.root,n=e.action;i("IS_ASYNC")||t.dispatch("FILE_ENCODE_ITEM",n,!0)},FILE_ENCODE_ITEM:function(t){var n=t.root,a=t.action,r=i("GET_ITEM",a.id),c=r.file;d("PREPARE_OUTPUT",c,{query:i,item:r}).then(function(t){o(e).post({file:t},function(e){var a={id:r.id,name:t.name,type:t.type,size:t.size,metadata:r.getMetadata(),data:e};n.ref.data.value=JSON.stringify(a),document.dispatchEvent(new CustomEvent("FilePond:encoded",{detail:a}))})}).catch(function(e){console.error(e)})}}))}}),{options:{allowFileEncode:[!0,i.BOOLEAN]}}};return document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:t})),t}); +},{}],"VtM+":[function(require,module,exports) { + +},{}],"QdEO":[function(require,module,exports) { +module.exports={props:{name:{type:String,required:!0},value:{type:null,default:null},type:{type:String,required:!0},length:{type:[String,Number],default:null},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},options:{type:Object,default:function(){return{}}},newItem:{type:Boolean,default:!1},relationship:{type:Object,default:null}}}; +},{}],"88WG":[function(require,module,exports) { +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("filepond"),i=u(e),t=require("filepond-plugin-image-preview"),n=r(t),s=require("filepond-plugin-file-encode"),l=r(s);require("filepond/dist/filepond.min.css"),require("filepond-plugin-image-preview/dist/filepond-plugin-image-preview.min.css");var d=require("../../../mixins/interface"),o=r(d);function r(e){return e&&e.__esModule?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);return i.default=e,i}i.registerPlugin(n.default,l.default),exports.default={mixins:[o.default],mounted:function(){this.pond=i.create(this.$refs.file),document.addEventListener("FilePond:encoded",this.processFile)},beforeDestroy:function(){this.pond.destroy()},methods:{processFile:function(e){this.options.nameField&&this.$emit("setfield",{field:this.options.nameField,value:e.detail.name}),this.options.sizeField&&this.$emit("setfield",{field:this.options.sizeField,value:e.detail.size}),this.options.typeField&&this.$emit("setfield",{field:this.options.typeField,value:e.detail.type}),this.$emit("input",e.detail.data)}}}; +(function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this.$createElement;return(this._self._c||e)("input",{ref:"file",staticClass:"filepond",attrs:{type:"file"}})},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})(); +},{"filepond":"mHsp","filepond-plugin-image-preview":"sRZf","filepond-plugin-file-encode":"F0BQ","filepond/dist/filepond.min.css":"VtM+","filepond-plugin-image-preview/dist/filepond-plugin-image-preview.min.css":"VtM+","../../../mixins/interface":"QdEO"}]},{},["88WG"], "__DirectusExtension__") \ No newline at end of file diff --git a/public/extensions/core/interfaces/blob/meta.json b/public/extensions/core/interfaces/blob/meta.json new file mode 100644 index 0000000000..ce630cc804 --- /dev/null +++ b/public/extensions/core/interfaces/blob/meta.json @@ -0,0 +1 @@ +{"name":"$t:blob","version":"1.0.0","datatypes":{"BLOB":null},"options":{"nameField":{"name":"$t:name_field","comment":"$t:name_field_comment","interface":"text-input"},"sizeField":{"name":"$t:size_field","comment":"$t:size_field_comment","interface":"text-input"},"typeField":{"name":"$t:type_field","comment":"$t:type_field_comment","interface":"text-input"}},"translation":{"en-US":{"blob":"Blob","name_field":"Name Field","name_field_comment":"Enter the name of the field that holds the file name","size_field":"Size Field","size_field_comment":"Enter the name of the field that holds the file size","type_field":"Type Field","type_field_comment":"Enter the name of the field that holds the file MIME type"}}} \ No newline at end of file diff --git a/public/extensions/core/interfaces/blob/readonly.js b/public/extensions/core/interfaces/blob/readonly.js new file mode 100644 index 0000000000..154b312fa1 --- /dev/null +++ b/public/extensions/core/interfaces/blob/readonly.js @@ -0,0 +1,6 @@ +parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f11)]},M:function(e,t){return o(e.getMonth(),!0,t)},S:function(t){return e(t.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(t){return e(t.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(t){return e(t.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(t){return e(t.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},d={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year"},s=function(e){var t=e.config,n=void 0===t?p:t,a=e.l10n,i=void 0===a?d:a;return function(e,t,a){if(void 0!==n.formatDate)return n.formatDate(e,t);var o=a||i;return t.split("").map(function(t,a,i){return c[t]&&"\\"!==i[a-1]?c[t](e,o,n):"\\"!==t?t:""}).join("")}},u=function(e){var t=e.config,n=void 0===t?p:t,a=e.l10n,i=void 0===a?d:a;return function(e,t,a,o){if(0===e||e){var c,d=o||i,s=e;if(e instanceof Date)c=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)c=new Date(e);else if("string"==typeof e){var u=t||(n||p).dateFormat,f=String(e).trim();if("today"===f)c=new Date,a=!0;else if(/Z$/.test(f)||/GMT$/.test(f))c=new Date(e);else if(n&&n.parseDate)c=n.parseDate(e,u);else{c=n&&n.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var m,g=[],h=0,v=0,D="";hMath.min(t,n)&&e",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};function h(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function v(e,t,n){var a=window.document.createElement(e);return t=t||"",n=n||"",a.className=t,void 0!==n&&(a.textContent=n),a}function D(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function w(e,t){var n=v("div","numInputWrapper"),a=v("input","numInput "+e),i=v("span","arrowUp"),o=v("span","arrowDown");if(a.type="text",a.pattern="\\d*",void 0!==t)for(var r in t)a.setAttribute(r,t[r]);return n.appendChild(a),n.appendChild(i),n.appendChild(o),n}"function"!=typeof Object.assign&&(Object.assign=function(e){if(!e)throw TypeError("Cannot convert undefined or null to object");for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;ar&&(u=i===c.hourElement?u-r-t(!c.amPM):o,m&&A(void 0,1,c.hourElement)),c.amPM&&f&&(1===l?u+d===23:Math.abs(u-d)>l)&&(c.amPM.textContent=c.l10n.amPM[t(c.amPM.textContent===c.l10n.amPM[0])]),i.value=e(u)}}(n);var a=c._input.value;x(),me(),c._input.value!==a&&c._debouncedChange()}}function x(){if(void 0!==c.hourElement&&void 0!==c.minuteElement){var e,n,a=(parseInt(c.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(c.minuteElement.value,10)||0)%60,o=void 0!==c.secondElement?(parseInt(c.secondElement.value,10)||0)%60:0;void 0!==c.amPM&&(e=a,n=c.amPM.textContent,a=e%12+12*t(n===c.l10n.amPM[1]));var r=void 0!==c.config.minTime||c.config.minDate&&c.minDateHasTime&&c.latestSelectedDateObj&&0===f(c.latestSelectedDateObj,c.config.minDate,!0);if(void 0!==c.config.maxTime||c.config.maxDate&&c.maxDateHasTime&&c.latestSelectedDateObj&&0===f(c.latestSelectedDateObj,c.config.maxDate,!0)){var l=void 0!==c.config.maxTime?c.config.maxTime:c.config.maxDate;(a=Math.min(a,l.getHours()))===l.getHours()&&(i=Math.min(i,l.getMinutes())),i===l.getMinutes()&&(o=Math.min(o,l.getSeconds()))}if(r){var d=void 0!==c.config.minTime?c.config.minTime:c.config.minDate;(a=Math.max(a,d.getHours()))===d.getHours()&&(i=Math.max(i,d.getMinutes())),i===d.getMinutes()&&(o=Math.max(o,d.getSeconds()))}k(a,i,o)}}function E(e){var t=e||c.latestSelectedDateObj;t&&k(t.getHours(),t.getMinutes(),t.getSeconds())}function T(){var e=c.config.defaultHour,t=c.config.defaultMinute,n=c.config.defaultSeconds;if(void 0!==c.config.minDate){var a=c.config.minDate.getHours(),i=c.config.minDate.getMinutes();(e=Math.max(e,a))===a&&(t=Math.max(i,t)),e===a&&t===i&&(n=c.config.minDate.getSeconds())}if(void 0!==c.config.maxDate){var o=c.config.maxDate.getHours(),r=c.config.maxDate.getMinutes();(e=Math.min(e,o))===o&&(t=Math.min(r,t)),e===o&&t===r&&(n=c.config.maxDate.getSeconds())}k(e,t,n)}function k(n,a,i){void 0!==c.latestSelectedDateObj&&c.latestSelectedDateObj.setHours(n%24,a,i||0,0),c.hourElement&&c.minuteElement&&!c.isMobile&&(c.hourElement.value=e(c.config.time_24hr?n:(12+n)%12+12*t(n%12==0)),c.minuteElement.value=e(a),void 0!==c.amPM&&(c.amPM.textContent=c.l10n.amPM[t(n>=12)]),void 0!==c.secondElement&&(c.secondElement.value=e(i)))}function I(e){var t=parseInt(e.target.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&z(t)}function O(e,t,n,a){return t instanceof Array?t.forEach(function(t){return O(e,t,n,a)}):e instanceof Array?e.forEach(function(e){return O(e,t,n,a)}):(e.addEventListener(t,n,a),void c._handlers.push({element:e,event:t,handler:n,options:a}))}function S(e){return function(t){1===t.which&&e(t)}}function _(){de("onChange")}function N(e){var t=void 0!==e?c.parseDate(e):c.latestSelectedDateObj||(c.config.minDate&&c.config.minDate>c.now?c.config.minDate:c.config.maxDate&&c.config.maxDate=0&&f(e,c.selectedDates[1])<=0}(t)&&!ue(t)&&o.classList.add("inRange"),c.weekNumbers&&1===c.config.showMonths&&"prevMonthDay"!==e&&n%7==1&&c.weekNumbers.insertAdjacentHTML("beforeend",""+c.config.getWeek(t)+""),de("onDayCreate",o),o}function j(e){e.focus(),"range"===c.config.mode&&Q(e)}function Y(e){for(var t=e>0?0:c.config.showMonths-1,n=e>0?c.config.showMonths:-1,a=t;a!=n;a+=e)for(var i=c.daysContainer.children[a],o=e>0?0:i.children.length-1,r=e>0?i.children.length:-1,l=o;l!=r;l+=e){var d=i.children[l];if(-1===d.className.indexOf("hidden")&&G(d.dateObj))return d}}function H(e,t){var n=V(document.activeElement),a=void 0!==e?e:n?document.activeElement:void 0!==c.selectedDateElem&&V(c.selectedDateElem)?c.selectedDateElem:void 0!==c.todayDateElem&&V(c.todayDateElem)?c.todayDateElem:Y(t>0?1:-1);return void 0===a?c._input.focus():n?void function(e,t){for(var n=-1===e.className.indexOf("Month")?e.dateObj.getMonth():c.currentMonth,a=t>0?c.config.showMonths:-1,i=t>0?1:-1,o=n-c.currentMonth;o!=a;o+=i)for(var r=c.daysContainer.children[o],l=n-c.currentMonth===o?e.$i+t:t<0?r.children.length-1:0,d=r.children.length,s=l;s>=0&&s0?d:-1);s+=i){var u=r.children[s];if(-1===u.className.indexOf("hidden")&&G(u.dateObj)&&Math.abs(e.$i-s)>=Math.abs(t))return j(u)}c.changeMonth(i),H(Y(i),0)}(a,t):j(a)}function L(e,t){for(var n=(new Date(e,t,1).getDay()-c.l10n.firstDayOfWeek+7)%7,a=c.utils.getDaysInMonth((t-1+12)%12),i=c.utils.getDaysInMonth(t),o=window.document.createDocumentFragment(),r=c.config.showMonths>1,l=r?"prevMonthDay hidden":"prevMonthDay",d=r?"nextMonthDay hidden":"nextMonthDay",s=a+1-n,u=0;s<=a;s++,u++)o.appendChild(P(l,new Date(e,t-1,s),s,u));for(s=1;s<=i;s++,u++)o.appendChild(P("",new Date(e,t,s),s,u));for(var f=i+1;f<=42-n&&(1===c.config.showMonths||u%7!=0);f++,u++)o.appendChild(P(d,new Date(e,t+1,f%i),f,u));var m=v("div","dayContainer");return m.appendChild(o),m}function W(){if(void 0!==c.daysContainer){D(c.daysContainer),c.weekNumbers&&D(c.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t0&&e\n "+t.join("")+"\n \n "}function U(e,t){void 0===t&&(t=!0);var n=t?e:e-c.currentMonth;n<0&&!0===c._hidePrevMonthArrow||n>0&&!0===c._hideNextMonthArrow||(c.currentMonth+=n,(c.currentMonth<0||c.currentMonth>11)&&(c.currentYear+=c.currentMonth>11?1:-1,c.currentMonth=(c.currentMonth+12)%12,de("onYearChange")),W(),de("onMonthChange"),fe())}function q(e){return!(!c.config.appendTo||!c.config.appendTo.contains(e))||c.calendarContainer.contains(e)}function $(e){if(c.isOpen&&!c.config.inline){var t=q(e.target),n=e.target===c.input||e.target===c.altInput||c.element.contains(e.target)||e.path&&e.path.indexOf&&(~e.path.indexOf(c.input)||~e.path.indexOf(c.altInput)),a="blur"===e.type?n&&e.relatedTarget&&!q(e.relatedTarget):!n&&!t,i=!c.config.ignoredFocusElements.some(function(t){return t.contains(e.target)});a&&i&&(c.close(),"range"===c.config.mode&&1===c.selectedDates.length&&(c.clear(!1),c.redraw()))}}function z(e){if(!(!e||c.config.minDate&&ec.config.maxDate.getFullYear())){var t=e,n=c.currentYear!==t;c.currentYear=t||c.currentYear,c.config.maxDate&&c.currentYear===c.config.maxDate.getFullYear()?c.currentMonth=Math.min(c.config.maxDate.getMonth(),c.currentMonth):c.config.minDate&&c.currentYear===c.config.minDate.getFullYear()&&(c.currentMonth=Math.max(c.config.minDate.getMonth(),c.currentMonth)),n&&(c.redraw(),de("onYearChange"))}}function G(e,t){void 0===t&&(t=!0);var n=c.parseDate(e,void 0,t);if(c.config.minDate&&n&&f(n,c.config.minDate,void 0!==t?t:!c.minDateHasTime)<0||c.config.maxDate&&n&&f(n,c.config.maxDate,void 0!==t?t:!c.maxDateHasTime)>0)return!1;if(0===c.config.enable.length&&0===c.config.disable.length)return!0;if(void 0===n)return!1;for(var a,i=c.config.enable.length>0,o=i?c.config.enable:c.config.disable,r=0;r=a.from.getTime()&&n.getTime()<=a.to.getTime())return i}return!i}function V(e){return void 0!==c.daysContainer&&(-1===e.className.indexOf("hidden")&&c.daysContainer.contains(e))}function Z(e){var t=e.target===c._input,n=c.config.allowInput,a=c.isOpen&&(!n||!t),i=c.config.inline&&t&&!n;if(13===e.keyCode&&t){if(n)return c.setDate(c._input.value,!0,e.target===c.altInput?c.config.altFormat:c.config.dateFormat),e.target.blur();c.open()}else if(q(e.target)||a||i){var o=!!c.timeContainer&&c.timeContainer.contains(e.target);switch(e.keyCode){case 13:o?M():oe(e);break;case 27:e.preventDefault(),ie();break;case 8:case 46:t&&!c.config.allowInput&&(e.preventDefault(),c.clear());break;case 37:case 39:if(o)c.hourElement&&c.hourElement.focus();else if(e.preventDefault(),void 0!==c.daysContainer&&(!1===n||V(document.activeElement))){var r=39===e.keyCode?1:-1;e.ctrlKey?(U(r),H(Y(1),0)):H(void 0,r)}break;case 38:case 40:e.preventDefault();var l=40===e.keyCode?1:-1;c.daysContainer?e.ctrlKey?(z(c.currentYear-l),H(Y(1),0)):o||H(void 0,7*l):c.config.enableTime&&(!o&&c.hourElement&&c.hourElement.focus(),M(e),c._debouncedChange());break;case 9:if(!o)break;var d=[c.hourElement,c.minuteElement,c.secondElement,c.amPM].filter(function(e){return e}),s=d.indexOf(e.target);if(-1!==s){var u=d[s+(e.shiftKey?-1:1)];void 0!==u&&(e.preventDefault(),u.focus())}}}if(void 0!==c.amPM&&e.target===c.amPM)switch(e.key){case c.l10n.amPM[0].charAt(0):case c.l10n.amPM[0].charAt(0).toLowerCase():c.amPM.textContent=c.l10n.amPM[0],x(),me();break;case c.l10n.amPM[1].charAt(0):case c.l10n.amPM[1].charAt(0).toLowerCase():c.amPM.textContent=c.l10n.amPM[1],x(),me()}de("onKeyDown",e)}function Q(e){if(1===c.selectedDates.length&&(!e||e.classList.contains("flatpickr-day")&&!e.classList.contains("disabled"))){for(var t=e?e.dateObj.getTime():c.days.firstElementChild.dateObj.getTime(),n=c.parseDate(c.selectedDates[0],void 0,!0).getTime(),a=Math.min(t,c.selectedDates[0].getTime()),i=Math.max(t,c.selectedDates[0].getTime()),o=c.daysContainer.lastChild.lastChild.dateObj.getTime(),r=!1,l=0,d=0,s=a;sa&&sl)?l=s:s>n&&(!d||s0&&s0&&s>d;return g?(o.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(e){o.classList.remove(e)}),"continue"):r&&!g?"continue":(["startRange","inRange","endRange","notAllowed"].forEach(function(e){o.classList.remove(e)}),void(void 0!==e&&(e.classList.add(t0&&p&&p.lastChild.dateObj.getTime()>=s||(nt&&s===n&&o.classList.add("endRange"),s>=l&&(0===d||s<=d)&&m(s,n,t)&&o.classList.add("inRange")))))},v=0,D=f.children.length;v0||n.getMinutes()>0||n.getSeconds()>0),c.selectedDates&&(c.selectedDates=c.selectedDates.filter(function(e){return G(e)}),c.selectedDates.length||"min"!==e||E(n),me()),c.daysContainer&&(ae(),void 0!==n?c.currentYearElement[e]=n.getFullYear().toString():c.currentYearElement.removeAttribute(e),c.currentYearElement.disabled=!!a&&void 0!==n&&a.getFullYear()===n.getFullYear())}}function te(){"object"!=typeof c.config.locale&&void 0===y.l10ns[c.config.locale]&&c.config.errorHandler(new Error("flatpickr: invalid locale "+c.config.locale)),c.l10n=Object.assign({},y.l10ns.default,"object"==typeof c.config.locale?c.config.locale:"default"!==c.config.locale?y.l10ns[c.config.locale]:void 0),l.K="("+c.l10n.amPM[0]+"|"+c.l10n.amPM[1]+"|"+c.l10n.amPM[0].toLowerCase()+"|"+c.l10n.amPM[1].toLowerCase()+")",c.formatDate=s(c),c.parseDate=u({config:c.config,l10n:c.l10n})}function ne(e){if(void 0!==c.calendarContainer){de("onPreCalendarPosition");var t=e||c._positionElement,n=Array.prototype.reduce.call(c.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),a=c.calendarContainer.offsetWidth,i=c.config.position.split(" "),o=i[0],r=i.length>1?i[1]:null,l=t.getBoundingClientRect(),d=window.innerHeight-l.bottom,s="above"===o||"below"!==o&&dn,u=window.pageYOffset+l.top+(s?-n-2:t.offsetHeight+2);if(h(c.calendarContainer,"arrowTop",!s),h(c.calendarContainer,"arrowBottom",s),!c.config.inline){var f=window.pageXOffset+l.left-(null!=r&&"center"===r?(a-l.width)/2:0),m=window.document.body.offsetWidth-l.right,g=f+a>window.document.body.offsetWidth;h(c.calendarContainer,"rightMost",g),c.config.static||(c.calendarContainer.style.top=u+"px",g?(c.calendarContainer.style.left="auto",c.calendarContainer.style.right=m+"px"):(c.calendarContainer.style.left=f+"px",c.calendarContainer.style.right="auto"))}}}function ae(){c.config.noCalendar||c.isMobile||(fe(),W())}function ie(){c._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(c.close,0):c.close()}function oe(e){e.preventDefault(),e.stopPropagation();var t=function e(t,n){return n(t)?t:t.parentNode?e(t.parentNode,n):void 0}(e.target,function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("disabled")&&!e.classList.contains("notAllowed")});if(void 0!==t){var n=t,a=c.latestSelectedDateObj=new Date(n.dateObj.getTime()),i=(a.getMonth()c.currentMonth+c.config.showMonths-1)&&"range"!==c.config.mode;if(c.selectedDateElem=n,"single"===c.config.mode)c.selectedDates=[a];else if("multiple"===c.config.mode){var o=ue(a);o?c.selectedDates.splice(parseInt(o),1):c.selectedDates.push(a)}else"range"===c.config.mode&&(2===c.selectedDates.length&&c.clear(!1),c.selectedDates.push(a),0!==f(a,c.selectedDates[0],!0)&&c.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(x(),i){var r=c.currentYear!==a.getFullYear();c.currentYear=a.getFullYear(),c.currentMonth=a.getMonth(),r&&de("onYearChange"),de("onMonthChange")}if(fe(),W(),me(),c.config.enableTime&&setTimeout(function(){return c.showTimeInput=!0},50),i||"range"===c.config.mode||1!==c.config.showMonths?c.selectedDateElem&&c.selectedDateElem.focus():j(n),void 0!==c.hourElement&&setTimeout(function(){return void 0!==c.hourElement&&c.hourElement.select()},451),c.config.closeOnSelect){var l="single"===c.config.mode&&!c.config.enableTime,d="range"===c.config.mode&&2===c.selectedDates.length&&!c.config.enableTime;(l||d)&&ie()}_()}}c.parseDate=u({config:c.config,l10n:c.l10n}),c._handlers=[],c._bind=O,c._setHoursFromDate=E,c._positionCalendar=ne,c.changeMonth=U,c.changeYear=z,c.clear=function(e){void 0===e&&(e=!0);c.input.value="",void 0!==c.altInput&&(c.altInput.value="");void 0!==c.mobileInput&&(c.mobileInput.value="");c.selectedDates=[],c.latestSelectedDateObj=void 0,c.showTimeInput=!1,!0===c.config.enableTime&&T();c.redraw(),e&&de("onChange")},c.close=function(){c.isOpen=!1,c.isMobile||(c.calendarContainer.classList.remove("open"),c._input.classList.remove("active"));de("onClose")},c._createElement=v,c.destroy=function(){void 0!==c.config&&de("onDestroy");for(var e=c._handlers.length;e--;){var t=c._handlers[e];t.element.removeEventListener(t.event,t.handler,t.options)}if(c._handlers=[],c.mobileInput)c.mobileInput.parentNode&&c.mobileInput.parentNode.removeChild(c.mobileInput),c.mobileInput=void 0;else if(c.calendarContainer&&c.calendarContainer.parentNode)if(c.config.static&&c.calendarContainer.parentNode){var n=c.calendarContainer.parentNode;for(n.lastChild&&n.removeChild(n.lastChild);n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}else c.calendarContainer.parentNode.removeChild(c.calendarContainer);c.altInput&&(c.input.type="text",c.altInput.parentNode&&c.altInput.parentNode.removeChild(c.altInput),delete c.altInput);c.input&&(c.input.type=c.input._type,c.input.classList.remove("flatpickr-input"),c.input.removeAttribute("readonly"),c.input.value="");["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete c[e]}catch(e){}})},c.isEnabled=G,c.jumpToDate=N,c.open=function(e,t){void 0===t&&(t=c._positionElement);if(!0===c.isMobile)return e&&(e.preventDefault(),e.target&&e.target.blur()),setTimeout(function(){void 0!==c.mobileInput&&c.mobileInput.focus()},0),void de("onOpen");if(c._input.disabled||c.config.inline)return;var n=c.isOpen;c.isOpen=!0,n||(c.calendarContainer.classList.add("open"),c._input.classList.add("active"),de("onOpen"),ne(t));!0===c.config.enableTime&&!0===c.config.noCalendar&&(0===c.selectedDates.length&&(c.setDate(void 0!==c.config.minDate?new Date(c.config.minDate.getTime()):new Date,!1),T(),me()),!1!==c.config.allowInput||void 0!==e&&c.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return c.hourElement.select()},50))},c.redraw=ae,c.set=function(e,t){null!==e&&"object"==typeof e?Object.assign(c.config,e):(c.config[e]=t,void 0!==re[e]&&re[e].forEach(function(e){return e()}));c.redraw(),N()},c.setDate=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=c.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return c.clear(t);le(e,n),c.showTimeInput=c.selectedDates.length>0,c.latestSelectedDateObj=c.selectedDates[0],c.redraw(),N(),E(),me(t),t&&de("onChange")},c.toggle=function(e){if(!0===c.isOpen)return c.close();c.open(e)};var re={locale:[te,B],showMonths:[K,C,J]};function le(e,t){var n=[];if(e instanceof Array)n=e.map(function(e){return c.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)n=[c.parseDate(e,t)];else if("string"==typeof e)switch(c.config.mode){case"single":case"time":n=[c.parseDate(e,t)];break;case"multiple":n=e.split(c.config.conjunction).map(function(e){return c.parseDate(e,t)});break;case"range":n=e.split(c.l10n.rangeSeparator).map(function(e){return c.parseDate(e,t)})}else c.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));c.selectedDates=n.filter(function(e){return e instanceof Date&&G(e,!1)}),"range"===c.config.mode&&c.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function ce(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?c.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:c.parseDate(e.from,void 0),to:c.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function de(e,t){var n=c.config[e];if(void 0!==n&&n.length>0)for(var a=0;n[a]&&ac.config.maxDate.getMonth():c.currentYear>c.config.maxDate.getFullYear()))}function me(e){if(void 0===e&&(e=!0),0===c.selectedDates.length)return c.clear(e);void 0!==c.mobileInput&&c.mobileFormatStr&&(c.mobileInput.value=void 0!==c.latestSelectedDateObj?c.formatDate(c.latestSelectedDateObj,c.mobileFormatStr):"");var t="range"!==c.config.mode?c.config.conjunction:c.l10n.rangeSeparator;c.input.value=c.selectedDates.map(function(e){return c.formatDate(e,c.config.dateFormat)}).join(t),void 0!==c.altInput&&(c.altInput.value=c.selectedDates.map(function(e){return c.formatDate(e,c.config.altFormat)}).join(t)),!1!==e&&de("onValueUpdate")}function ge(e){e.preventDefault();var t=c.prevMonthNav.contains(e.target),n=c.nextMonthNav.contains(e.target);t||n?U(t?-1:1):c.yearElements.indexOf(e.target)>=0?e.target.select():e.target.classList.contains("arrowUp")?c.changeYear(c.currentYear+1):e.target.classList.contains("arrowDown")&&c.changeYear(c.currentYear-1)}return function(){c.element=c.input=i,c.isOpen=!1,function(){var e=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],t=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],n=Object.assign({},r,JSON.parse(JSON.stringify(i.dataset||{}))),o={};c.config.parseDate=n.parseDate,c.config.formatDate=n.formatDate,Object.defineProperty(c.config,"enable",{get:function(){return c.config._enable},set:function(e){c.config._enable=ce(e)}}),Object.defineProperty(c.config,"disable",{get:function(){return c.config._disable},set:function(e){c.config._disable=ce(e)}});var l="time"===n.mode;n.dateFormat||!n.enableTime&&!l||(o.dateFormat=n.noCalendar||l?"H:i"+(n.enableSeconds?":S":""):y.defaultConfig.dateFormat+" H:i"+(n.enableSeconds?":S":"")),n.altInput&&(n.enableTime||l)&&!n.altFormat&&(o.altFormat=n.noCalendar||l?"h:i"+(n.enableSeconds?":S K":" K"):y.defaultConfig.altFormat+" h:i"+(n.enableSeconds?":S":"")+" K"),Object.defineProperty(c.config,"minDate",{get:function(){return c.config._minDate},set:ee("min")}),Object.defineProperty(c.config,"maxDate",{get:function(){return c.config._maxDate},set:ee("max")});var d=function(e){return function(t){c.config["min"===e?"_minTime":"_maxTime"]=c.parseDate(t,"H:i")}};Object.defineProperty(c.config,"minTime",{get:function(){return c.config._minTime},set:d("min")}),Object.defineProperty(c.config,"maxTime",{get:function(){return c.config._maxTime},set:d("max")}),"time"===n.mode&&(c.config.noCalendar=!0,c.config.enableTime=!0),Object.assign(c.config,o,n);for(var s=0;s0?c.selectedDates[0]:c.config.minDate&&c.config.minDate.getTime()>c.now.getTime()?c.config.minDate:c.config.maxDate&&c.config.maxDate.getTime()0&&(c.latestSelectedDateObj=c.selectedDates[0]),void 0!==c.config.minTime&&(c.config.minTime=c.parseDate(c.config.minTime,"H:i")),void 0!==c.config.maxTime&&(c.config.maxTime=c.parseDate(c.config.maxTime,"H:i")),c.minDateHasTime=!!c.config.minDate&&(c.config.minDate.getHours()>0||c.config.minDate.getMinutes()>0||c.config.minDate.getSeconds()>0),c.maxDateHasTime=!!c.config.maxDate&&(c.config.maxDate.getHours()>0||c.config.maxDate.getMinutes()>0||c.config.maxDate.getSeconds()>0),Object.defineProperty(c,"showTimeInput",{get:function(){return c._showTimeInput},set:function(e){c._showTimeInput=e,c.calendarContainer&&h(c.calendarContainer,"showTimeInput",e),c.isOpen&&ne()}})}(),c.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=c.currentMonth),void 0===t&&(t=c.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:c.l10n.daysInMonth[e]}},c.isMobile||function(){var n=window.document.createDocumentFragment();if(c.calendarContainer=v("div","flatpickr-calendar"),c.calendarContainer.tabIndex=-1,!c.config.noCalendar){if(n.appendChild((c.monthNav=v("div","flatpickr-months"),c.yearElements=[],c.monthElements=[],c.prevMonthNav=v("span","flatpickr-prev-month"),c.prevMonthNav.innerHTML=c.config.prevArrow,c.nextMonthNav=v("span","flatpickr-next-month"),c.nextMonthNav.innerHTML=c.config.nextArrow,K(),Object.defineProperty(c,"_hidePrevMonthArrow",{get:function(){return c.__hidePrevMonthArrow},set:function(e){c.__hidePrevMonthArrow!==e&&(h(c.prevMonthNav,"disabled",e),c.__hidePrevMonthArrow=e)}}),Object.defineProperty(c,"_hideNextMonthArrow",{get:function(){return c.__hideNextMonthArrow},set:function(e){c.__hideNextMonthArrow!==e&&(h(c.nextMonthNav,"disabled",e),c.__hideNextMonthArrow=e)}}),c.currentYearElement=c.yearElements[0],fe(),c.monthNav)),c.innerContainer=v("div","flatpickr-innerContainer"),c.config.weekNumbers){var a=function(){c.calendarContainer.classList.add("hasWeeks");var e=v("div","flatpickr-weekwrapper");e.appendChild(v("span","flatpickr-weekday",c.l10n.weekAbbreviation));var t=v("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),i=a.weekWrapper,o=a.weekNumbers;c.innerContainer.appendChild(i),c.weekNumbers=o,c.weekWrapper=i}c.rContainer=v("div","flatpickr-rContainer"),c.rContainer.appendChild(J()),c.daysContainer||(c.daysContainer=v("div","flatpickr-days"),c.daysContainer.tabIndex=-1),W(),c.rContainer.appendChild(c.daysContainer),c.innerContainer.appendChild(c.rContainer),n.appendChild(c.innerContainer)}c.config.enableTime&&n.appendChild(function(){c.calendarContainer.classList.add("hasTime"),c.config.noCalendar&&c.calendarContainer.classList.add("noCalendar"),c.timeContainer=v("div","flatpickr-time"),c.timeContainer.tabIndex=-1;var n=v("span","flatpickr-time-separator",":"),a=w("flatpickr-hour");c.hourElement=a.childNodes[0];var i=w("flatpickr-minute");if(c.minuteElement=i.childNodes[0],c.hourElement.tabIndex=c.minuteElement.tabIndex=-1,c.hourElement.value=e(c.latestSelectedDateObj?c.latestSelectedDateObj.getHours():c.config.time_24hr?c.config.defaultHour:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(c.config.defaultHour)),c.minuteElement.value=e(c.latestSelectedDateObj?c.latestSelectedDateObj.getMinutes():c.config.defaultMinute),c.hourElement.setAttribute("data-step",c.config.hourIncrement.toString()),c.minuteElement.setAttribute("data-step",c.config.minuteIncrement.toString()),c.hourElement.setAttribute("data-min",c.config.time_24hr?"0":"1"),c.hourElement.setAttribute("data-max",c.config.time_24hr?"23":"12"),c.minuteElement.setAttribute("data-min","0"),c.minuteElement.setAttribute("data-max","59"),c.timeContainer.appendChild(a),c.timeContainer.appendChild(n),c.timeContainer.appendChild(i),c.config.time_24hr&&c.timeContainer.classList.add("time24hr"),c.config.enableSeconds){c.timeContainer.classList.add("hasSeconds");var o=w("flatpickr-second");c.secondElement=o.childNodes[0],c.secondElement.value=e(c.latestSelectedDateObj?c.latestSelectedDateObj.getSeconds():c.config.defaultSeconds),c.secondElement.setAttribute("data-step",c.minuteElement.getAttribute("data-step")),c.secondElement.setAttribute("data-min",c.minuteElement.getAttribute("data-min")),c.secondElement.setAttribute("data-max",c.minuteElement.getAttribute("data-max")),c.timeContainer.appendChild(v("span","flatpickr-time-separator",":")),c.timeContainer.appendChild(o)}return c.config.time_24hr||(c.amPM=v("span","flatpickr-am-pm",c.l10n.amPM[t((c.latestSelectedDateObj?c.hourElement.value:c.config.defaultHour)>11)]),c.amPM.title=c.l10n.toggleTitle,c.amPM.tabIndex=-1,c.timeContainer.appendChild(c.amPM)),c.timeContainer}()),h(c.calendarContainer,"rangeMode","range"===c.config.mode),h(c.calendarContainer,"animate",!0===c.config.animate),h(c.calendarContainer,"multiMonth",c.config.showMonths>1),c.calendarContainer.appendChild(n);var r=void 0!==c.config.appendTo&&void 0!==c.config.appendTo.nodeType;if((c.config.inline||c.config.static)&&(c.calendarContainer.classList.add(c.config.inline?"inline":"static"),c.config.inline&&(!r&&c.element.parentNode?c.element.parentNode.insertBefore(c.calendarContainer,c._input.nextSibling):void 0!==c.config.appendTo&&c.config.appendTo.appendChild(c.calendarContainer)),c.config.static)){var l=v("div","flatpickr-wrapper");c.element.parentNode&&c.element.parentNode.insertBefore(l,c.element),l.appendChild(c.element),c.altInput&&l.appendChild(c.altInput),l.appendChild(c.calendarContainer)}c.config.static||c.config.inline||(void 0!==c.config.appendTo?c.config.appendTo:window.document.body).appendChild(c.calendarContainer)}(),function(){if(c.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(c.element.querySelectorAll("[data-"+e+"]"),function(t){return O(t,"click",c[e])})}),c.isMobile)!function(){var e=c.config.enableTime?c.config.noCalendar?"time":"datetime-local":"date";c.mobileInput=v("input",c.input.className+" flatpickr-mobile"),c.mobileInput.step=c.input.getAttribute("step")||"any",c.mobileInput.tabIndex=1,c.mobileInput.type=e,c.mobileInput.disabled=c.input.disabled,c.mobileInput.required=c.input.required,c.mobileInput.placeholder=c.input.placeholder,c.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",c.selectedDates.length>0&&(c.mobileInput.defaultValue=c.mobileInput.value=c.formatDate(c.selectedDates[0],c.mobileFormatStr)),c.config.minDate&&(c.mobileInput.min=c.formatDate(c.config.minDate,"Y-m-d")),c.config.maxDate&&(c.mobileInput.max=c.formatDate(c.config.maxDate,"Y-m-d")),c.input.type="hidden",void 0!==c.altInput&&(c.altInput.type="hidden");try{c.input.parentNode&&c.input.parentNode.insertBefore(c.mobileInput,c.input.nextSibling)}catch(e){}O(c.mobileInput,"change",function(e){c.setDate(e.target.value,!1,c.mobileFormatStr),de("onChange"),de("onClose")})}();else{var e=n(X,50);c._debouncedChange=n(_,b),c.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&O(c.daysContainer,"mouseover",function(e){"range"===c.config.mode&&Q(e.target)}),O(window.document.body,"keydown",Z),c.config.static||O(c._input,"keydown",Z),c.config.inline||c.config.static||O(window,"resize",e),void 0!==window.ontouchstart?O(window.document,"click",$):O(window.document,"mousedown",S($)),O(window.document,"focus",$,{capture:!0}),!0===c.config.clickOpens&&(O(c._input,"focus",c.open),O(c._input,"mousedown",S(c.open))),void 0!==c.daysContainer&&(O(c.monthNav,"mousedown",S(ge)),O(c.monthNav,["keyup","increment"],I),O(c.daysContainer,"mousedown",S(oe))),void 0!==c.timeContainer&&void 0!==c.minuteElement&&void 0!==c.hourElement&&(O(c.timeContainer,["increment"],M),O(c.timeContainer,"blur",M,{capture:!0}),O(c.timeContainer,"mousedown",S(F)),O([c.hourElement,c.minuteElement],["focus","click"],function(e){return e.target.select()}),void 0!==c.secondElement&&O(c.secondElement,"focus",function(){return c.secondElement&&c.secondElement.select()}),void 0!==c.amPM&&O(c.amPM,"mousedown",S(function(e){M(e),_()})))}}(),(c.selectedDates.length||c.config.noCalendar)&&(c.config.enableTime&&E(c.config.noCalendar?c.latestSelectedDateObj||c.config.minDate:void 0),me(!1)),C(),c.showTimeInput=c.selectedDates.length>0||c.config.noCalendar;var o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!c.isMobile&&o&&ne(),de("onReady")}(),c}function M(e,t){for(var n=Array.prototype.slice.call(e),a=[],i=0;i11)]},M:function(e,t){return o(e.getMonth(),!0,t)},S:function(t){return e(t.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(t){return e(t.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(t){return e(t.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(t){return e(t.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},d={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year"},s=function(e){var t=e.config,n=void 0===t?p:t,a=e.l10n,i=void 0===a?d:a;return function(e,t,a){if(void 0!==n.formatDate)return n.formatDate(e,t);var o=a||i;return t.split("").map(function(t,a,i){return c[t]&&"\\"!==i[a-1]?c[t](e,o,n):"\\"!==t?t:""}).join("")}},u=function(e){var t=e.config,n=void 0===t?p:t,a=e.l10n,i=void 0===a?d:a;return function(e,t,a,o){if(0===e||e){var c,d=o||i,s=e;if(e instanceof Date)c=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)c=new Date(e);else if("string"==typeof e){var u=t||(n||p).dateFormat,f=String(e).trim();if("today"===f)c=new Date,a=!0;else if(/Z$/.test(f)||/GMT$/.test(f))c=new Date(e);else if(n&&n.parseDate)c=n.parseDate(e,u);else{c=n&&n.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var m,g=[],h=0,v=0,D="";hMath.min(t,n)&&e",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};function h(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function v(e,t,n){var a=window.document.createElement(e);return t=t||"",n=n||"",a.className=t,void 0!==n&&(a.textContent=n),a}function D(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function w(e,t){var n=v("div","numInputWrapper"),a=v("input","numInput "+e),i=v("span","arrowUp"),o=v("span","arrowDown");if(a.type="text",a.pattern="\\d*",void 0!==t)for(var r in t)a.setAttribute(r,t[r]);return n.appendChild(a),n.appendChild(i),n.appendChild(o),n}"function"!=typeof Object.assign&&(Object.assign=function(e){if(!e)throw TypeError("Cannot convert undefined or null to object");for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;ar&&(u=i===c.hourElement?u-r-t(!c.amPM):o,m&&A(void 0,1,c.hourElement)),c.amPM&&f&&(1===l?u+d===23:Math.abs(u-d)>l)&&(c.amPM.textContent=c.l10n.amPM[t(c.amPM.textContent===c.l10n.amPM[0])]),i.value=e(u)}}(n);var a=c._input.value;x(),me(),c._input.value!==a&&c._debouncedChange()}}function x(){if(void 0!==c.hourElement&&void 0!==c.minuteElement){var e,n,a=(parseInt(c.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(c.minuteElement.value,10)||0)%60,o=void 0!==c.secondElement?(parseInt(c.secondElement.value,10)||0)%60:0;void 0!==c.amPM&&(e=a,n=c.amPM.textContent,a=e%12+12*t(n===c.l10n.amPM[1]));var r=void 0!==c.config.minTime||c.config.minDate&&c.minDateHasTime&&c.latestSelectedDateObj&&0===f(c.latestSelectedDateObj,c.config.minDate,!0);if(void 0!==c.config.maxTime||c.config.maxDate&&c.maxDateHasTime&&c.latestSelectedDateObj&&0===f(c.latestSelectedDateObj,c.config.maxDate,!0)){var l=void 0!==c.config.maxTime?c.config.maxTime:c.config.maxDate;(a=Math.min(a,l.getHours()))===l.getHours()&&(i=Math.min(i,l.getMinutes())),i===l.getMinutes()&&(o=Math.min(o,l.getSeconds()))}if(r){var d=void 0!==c.config.minTime?c.config.minTime:c.config.minDate;(a=Math.max(a,d.getHours()))===d.getHours()&&(i=Math.max(i,d.getMinutes())),i===d.getMinutes()&&(o=Math.max(o,d.getSeconds()))}k(a,i,o)}}function E(e){var t=e||c.latestSelectedDateObj;t&&k(t.getHours(),t.getMinutes(),t.getSeconds())}function T(){var e=c.config.defaultHour,t=c.config.defaultMinute,n=c.config.defaultSeconds;if(void 0!==c.config.minDate){var a=c.config.minDate.getHours(),i=c.config.minDate.getMinutes();(e=Math.max(e,a))===a&&(t=Math.max(i,t)),e===a&&t===i&&(n=c.config.minDate.getSeconds())}if(void 0!==c.config.maxDate){var o=c.config.maxDate.getHours(),r=c.config.maxDate.getMinutes();(e=Math.min(e,o))===o&&(t=Math.min(r,t)),e===o&&t===r&&(n=c.config.maxDate.getSeconds())}k(e,t,n)}function k(n,a,i){void 0!==c.latestSelectedDateObj&&c.latestSelectedDateObj.setHours(n%24,a,i||0,0),c.hourElement&&c.minuteElement&&!c.isMobile&&(c.hourElement.value=e(c.config.time_24hr?n:(12+n)%12+12*t(n%12==0)),c.minuteElement.value=e(a),void 0!==c.amPM&&(c.amPM.textContent=c.l10n.amPM[t(n>=12)]),void 0!==c.secondElement&&(c.secondElement.value=e(i)))}function I(e){var t=parseInt(e.target.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&z(t)}function O(e,t,n,a){return t instanceof Array?t.forEach(function(t){return O(e,t,n,a)}):e instanceof Array?e.forEach(function(e){return O(e,t,n,a)}):(e.addEventListener(t,n,a),void c._handlers.push({element:e,event:t,handler:n,options:a}))}function S(e){return function(t){1===t.which&&e(t)}}function _(){de("onChange")}function N(e){var t=void 0!==e?c.parseDate(e):c.latestSelectedDateObj||(c.config.minDate&&c.config.minDate>c.now?c.config.minDate:c.config.maxDate&&c.config.maxDate=0&&f(e,c.selectedDates[1])<=0}(t)&&!ue(t)&&o.classList.add("inRange"),c.weekNumbers&&1===c.config.showMonths&&"prevMonthDay"!==e&&n%7==1&&c.weekNumbers.insertAdjacentHTML("beforeend",""+c.config.getWeek(t)+""),de("onDayCreate",o),o}function j(e){e.focus(),"range"===c.config.mode&&Q(e)}function Y(e){for(var t=e>0?0:c.config.showMonths-1,n=e>0?c.config.showMonths:-1,a=t;a!=n;a+=e)for(var i=c.daysContainer.children[a],o=e>0?0:i.children.length-1,r=e>0?i.children.length:-1,l=o;l!=r;l+=e){var d=i.children[l];if(-1===d.className.indexOf("hidden")&&G(d.dateObj))return d}}function H(e,t){var n=V(document.activeElement),a=void 0!==e?e:n?document.activeElement:void 0!==c.selectedDateElem&&V(c.selectedDateElem)?c.selectedDateElem:void 0!==c.todayDateElem&&V(c.todayDateElem)?c.todayDateElem:Y(t>0?1:-1);return void 0===a?c._input.focus():n?void function(e,t){for(var n=-1===e.className.indexOf("Month")?e.dateObj.getMonth():c.currentMonth,a=t>0?c.config.showMonths:-1,i=t>0?1:-1,o=n-c.currentMonth;o!=a;o+=i)for(var r=c.daysContainer.children[o],l=n-c.currentMonth===o?e.$i+t:t<0?r.children.length-1:0,d=r.children.length,s=l;s>=0&&s0?d:-1);s+=i){var u=r.children[s];if(-1===u.className.indexOf("hidden")&&G(u.dateObj)&&Math.abs(e.$i-s)>=Math.abs(t))return j(u)}c.changeMonth(i),H(Y(i),0)}(a,t):j(a)}function L(e,t){for(var n=(new Date(e,t,1).getDay()-c.l10n.firstDayOfWeek+7)%7,a=c.utils.getDaysInMonth((t-1+12)%12),i=c.utils.getDaysInMonth(t),o=window.document.createDocumentFragment(),r=c.config.showMonths>1,l=r?"prevMonthDay hidden":"prevMonthDay",d=r?"nextMonthDay hidden":"nextMonthDay",s=a+1-n,u=0;s<=a;s++,u++)o.appendChild(P(l,new Date(e,t-1,s),s,u));for(s=1;s<=i;s++,u++)o.appendChild(P("",new Date(e,t,s),s,u));for(var f=i+1;f<=42-n&&(1===c.config.showMonths||u%7!=0);f++,u++)o.appendChild(P(d,new Date(e,t+1,f%i),f,u));var m=v("div","dayContainer");return m.appendChild(o),m}function W(){if(void 0!==c.daysContainer){D(c.daysContainer),c.weekNumbers&&D(c.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t0&&e\n "+t.join("")+"\n \n "}function U(e,t){void 0===t&&(t=!0);var n=t?e:e-c.currentMonth;n<0&&!0===c._hidePrevMonthArrow||n>0&&!0===c._hideNextMonthArrow||(c.currentMonth+=n,(c.currentMonth<0||c.currentMonth>11)&&(c.currentYear+=c.currentMonth>11?1:-1,c.currentMonth=(c.currentMonth+12)%12,de("onYearChange")),W(),de("onMonthChange"),fe())}function q(e){return!(!c.config.appendTo||!c.config.appendTo.contains(e))||c.calendarContainer.contains(e)}function $(e){if(c.isOpen&&!c.config.inline){var t=q(e.target),n=e.target===c.input||e.target===c.altInput||c.element.contains(e.target)||e.path&&e.path.indexOf&&(~e.path.indexOf(c.input)||~e.path.indexOf(c.altInput)),a="blur"===e.type?n&&e.relatedTarget&&!q(e.relatedTarget):!n&&!t,i=!c.config.ignoredFocusElements.some(function(t){return t.contains(e.target)});a&&i&&(c.close(),"range"===c.config.mode&&1===c.selectedDates.length&&(c.clear(!1),c.redraw()))}}function z(e){if(!(!e||c.config.minDate&&ec.config.maxDate.getFullYear())){var t=e,n=c.currentYear!==t;c.currentYear=t||c.currentYear,c.config.maxDate&&c.currentYear===c.config.maxDate.getFullYear()?c.currentMonth=Math.min(c.config.maxDate.getMonth(),c.currentMonth):c.config.minDate&&c.currentYear===c.config.minDate.getFullYear()&&(c.currentMonth=Math.max(c.config.minDate.getMonth(),c.currentMonth)),n&&(c.redraw(),de("onYearChange"))}}function G(e,t){void 0===t&&(t=!0);var n=c.parseDate(e,void 0,t);if(c.config.minDate&&n&&f(n,c.config.minDate,void 0!==t?t:!c.minDateHasTime)<0||c.config.maxDate&&n&&f(n,c.config.maxDate,void 0!==t?t:!c.maxDateHasTime)>0)return!1;if(0===c.config.enable.length&&0===c.config.disable.length)return!0;if(void 0===n)return!1;for(var a,i=c.config.enable.length>0,o=i?c.config.enable:c.config.disable,r=0;r=a.from.getTime()&&n.getTime()<=a.to.getTime())return i}return!i}function V(e){return void 0!==c.daysContainer&&(-1===e.className.indexOf("hidden")&&c.daysContainer.contains(e))}function Z(e){var t=e.target===c._input,n=c.config.allowInput,a=c.isOpen&&(!n||!t),i=c.config.inline&&t&&!n;if(13===e.keyCode&&t){if(n)return c.setDate(c._input.value,!0,e.target===c.altInput?c.config.altFormat:c.config.dateFormat),e.target.blur();c.open()}else if(q(e.target)||a||i){var o=!!c.timeContainer&&c.timeContainer.contains(e.target);switch(e.keyCode){case 13:o?M():oe(e);break;case 27:e.preventDefault(),ie();break;case 8:case 46:t&&!c.config.allowInput&&(e.preventDefault(),c.clear());break;case 37:case 39:if(o)c.hourElement&&c.hourElement.focus();else if(e.preventDefault(),void 0!==c.daysContainer&&(!1===n||V(document.activeElement))){var r=39===e.keyCode?1:-1;e.ctrlKey?(U(r),H(Y(1),0)):H(void 0,r)}break;case 38:case 40:e.preventDefault();var l=40===e.keyCode?1:-1;c.daysContainer?e.ctrlKey?(z(c.currentYear-l),H(Y(1),0)):o||H(void 0,7*l):c.config.enableTime&&(!o&&c.hourElement&&c.hourElement.focus(),M(e),c._debouncedChange());break;case 9:if(!o)break;var d=[c.hourElement,c.minuteElement,c.secondElement,c.amPM].filter(function(e){return e}),s=d.indexOf(e.target);if(-1!==s){var u=d[s+(e.shiftKey?-1:1)];void 0!==u&&(e.preventDefault(),u.focus())}}}if(void 0!==c.amPM&&e.target===c.amPM)switch(e.key){case c.l10n.amPM[0].charAt(0):case c.l10n.amPM[0].charAt(0).toLowerCase():c.amPM.textContent=c.l10n.amPM[0],x(),me();break;case c.l10n.amPM[1].charAt(0):case c.l10n.amPM[1].charAt(0).toLowerCase():c.amPM.textContent=c.l10n.amPM[1],x(),me()}de("onKeyDown",e)}function Q(e){if(1===c.selectedDates.length&&(!e||e.classList.contains("flatpickr-day")&&!e.classList.contains("disabled"))){for(var t=e?e.dateObj.getTime():c.days.firstElementChild.dateObj.getTime(),n=c.parseDate(c.selectedDates[0],void 0,!0).getTime(),a=Math.min(t,c.selectedDates[0].getTime()),i=Math.max(t,c.selectedDates[0].getTime()),o=c.daysContainer.lastChild.lastChild.dateObj.getTime(),r=!1,l=0,d=0,s=a;sa&&sl)?l=s:s>n&&(!d||s0&&s0&&s>d;return g?(o.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(e){o.classList.remove(e)}),"continue"):r&&!g?"continue":(["startRange","inRange","endRange","notAllowed"].forEach(function(e){o.classList.remove(e)}),void(void 0!==e&&(e.classList.add(t0&&p&&p.lastChild.dateObj.getTime()>=s||(nt&&s===n&&o.classList.add("endRange"),s>=l&&(0===d||s<=d)&&m(s,n,t)&&o.classList.add("inRange")))))},v=0,D=f.children.length;v0||n.getMinutes()>0||n.getSeconds()>0),c.selectedDates&&(c.selectedDates=c.selectedDates.filter(function(e){return G(e)}),c.selectedDates.length||"min"!==e||E(n),me()),c.daysContainer&&(ae(),void 0!==n?c.currentYearElement[e]=n.getFullYear().toString():c.currentYearElement.removeAttribute(e),c.currentYearElement.disabled=!!a&&void 0!==n&&a.getFullYear()===n.getFullYear())}}function te(){"object"!=typeof c.config.locale&&void 0===y.l10ns[c.config.locale]&&c.config.errorHandler(new Error("flatpickr: invalid locale "+c.config.locale)),c.l10n=Object.assign({},y.l10ns.default,"object"==typeof c.config.locale?c.config.locale:"default"!==c.config.locale?y.l10ns[c.config.locale]:void 0),l.K="("+c.l10n.amPM[0]+"|"+c.l10n.amPM[1]+"|"+c.l10n.amPM[0].toLowerCase()+"|"+c.l10n.amPM[1].toLowerCase()+")",c.formatDate=s(c),c.parseDate=u({config:c.config,l10n:c.l10n})}function ne(e){if(void 0!==c.calendarContainer){de("onPreCalendarPosition");var t=e||c._positionElement,n=Array.prototype.reduce.call(c.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),a=c.calendarContainer.offsetWidth,i=c.config.position.split(" "),o=i[0],r=i.length>1?i[1]:null,l=t.getBoundingClientRect(),d=window.innerHeight-l.bottom,s="above"===o||"below"!==o&&dn,u=window.pageYOffset+l.top+(s?-n-2:t.offsetHeight+2);if(h(c.calendarContainer,"arrowTop",!s),h(c.calendarContainer,"arrowBottom",s),!c.config.inline){var f=window.pageXOffset+l.left-(null!=r&&"center"===r?(a-l.width)/2:0),m=window.document.body.offsetWidth-l.right,g=f+a>window.document.body.offsetWidth;h(c.calendarContainer,"rightMost",g),c.config.static||(c.calendarContainer.style.top=u+"px",g?(c.calendarContainer.style.left="auto",c.calendarContainer.style.right=m+"px"):(c.calendarContainer.style.left=f+"px",c.calendarContainer.style.right="auto"))}}}function ae(){c.config.noCalendar||c.isMobile||(fe(),W())}function ie(){c._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(c.close,0):c.close()}function oe(e){e.preventDefault(),e.stopPropagation();var t=function e(t,n){return n(t)?t:t.parentNode?e(t.parentNode,n):void 0}(e.target,function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("disabled")&&!e.classList.contains("notAllowed")});if(void 0!==t){var n=t,a=c.latestSelectedDateObj=new Date(n.dateObj.getTime()),i=(a.getMonth()c.currentMonth+c.config.showMonths-1)&&"range"!==c.config.mode;if(c.selectedDateElem=n,"single"===c.config.mode)c.selectedDates=[a];else if("multiple"===c.config.mode){var o=ue(a);o?c.selectedDates.splice(parseInt(o),1):c.selectedDates.push(a)}else"range"===c.config.mode&&(2===c.selectedDates.length&&c.clear(!1),c.selectedDates.push(a),0!==f(a,c.selectedDates[0],!0)&&c.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(x(),i){var r=c.currentYear!==a.getFullYear();c.currentYear=a.getFullYear(),c.currentMonth=a.getMonth(),r&&de("onYearChange"),de("onMonthChange")}if(fe(),W(),me(),c.config.enableTime&&setTimeout(function(){return c.showTimeInput=!0},50),i||"range"===c.config.mode||1!==c.config.showMonths?c.selectedDateElem&&c.selectedDateElem.focus():j(n),void 0!==c.hourElement&&setTimeout(function(){return void 0!==c.hourElement&&c.hourElement.select()},451),c.config.closeOnSelect){var l="single"===c.config.mode&&!c.config.enableTime,d="range"===c.config.mode&&2===c.selectedDates.length&&!c.config.enableTime;(l||d)&&ie()}_()}}c.parseDate=u({config:c.config,l10n:c.l10n}),c._handlers=[],c._bind=O,c._setHoursFromDate=E,c._positionCalendar=ne,c.changeMonth=U,c.changeYear=z,c.clear=function(e){void 0===e&&(e=!0);c.input.value="",void 0!==c.altInput&&(c.altInput.value="");void 0!==c.mobileInput&&(c.mobileInput.value="");c.selectedDates=[],c.latestSelectedDateObj=void 0,c.showTimeInput=!1,!0===c.config.enableTime&&T();c.redraw(),e&&de("onChange")},c.close=function(){c.isOpen=!1,c.isMobile||(c.calendarContainer.classList.remove("open"),c._input.classList.remove("active"));de("onClose")},c._createElement=v,c.destroy=function(){void 0!==c.config&&de("onDestroy");for(var e=c._handlers.length;e--;){var t=c._handlers[e];t.element.removeEventListener(t.event,t.handler,t.options)}if(c._handlers=[],c.mobileInput)c.mobileInput.parentNode&&c.mobileInput.parentNode.removeChild(c.mobileInput),c.mobileInput=void 0;else if(c.calendarContainer&&c.calendarContainer.parentNode)if(c.config.static&&c.calendarContainer.parentNode){var n=c.calendarContainer.parentNode;for(n.lastChild&&n.removeChild(n.lastChild);n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}else c.calendarContainer.parentNode.removeChild(c.calendarContainer);c.altInput&&(c.input.type="text",c.altInput.parentNode&&c.altInput.parentNode.removeChild(c.altInput),delete c.altInput);c.input&&(c.input.type=c.input._type,c.input.classList.remove("flatpickr-input"),c.input.removeAttribute("readonly"),c.input.value="");["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete c[e]}catch(e){}})},c.isEnabled=G,c.jumpToDate=N,c.open=function(e,t){void 0===t&&(t=c._positionElement);if(!0===c.isMobile)return e&&(e.preventDefault(),e.target&&e.target.blur()),setTimeout(function(){void 0!==c.mobileInput&&c.mobileInput.focus()},0),void de("onOpen");if(c._input.disabled||c.config.inline)return;var n=c.isOpen;c.isOpen=!0,n||(c.calendarContainer.classList.add("open"),c._input.classList.add("active"),de("onOpen"),ne(t));!0===c.config.enableTime&&!0===c.config.noCalendar&&(0===c.selectedDates.length&&(c.setDate(void 0!==c.config.minDate?new Date(c.config.minDate.getTime()):new Date,!1),T(),me()),!1!==c.config.allowInput||void 0!==e&&c.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return c.hourElement.select()},50))},c.redraw=ae,c.set=function(e,t){null!==e&&"object"==typeof e?Object.assign(c.config,e):(c.config[e]=t,void 0!==re[e]&&re[e].forEach(function(e){return e()}));c.redraw(),N()},c.setDate=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=c.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return c.clear(t);le(e,n),c.showTimeInput=c.selectedDates.length>0,c.latestSelectedDateObj=c.selectedDates[0],c.redraw(),N(),E(),me(t),t&&de("onChange")},c.toggle=function(e){if(!0===c.isOpen)return c.close();c.open(e)};var re={locale:[te,B],showMonths:[K,C,J]};function le(e,t){var n=[];if(e instanceof Array)n=e.map(function(e){return c.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)n=[c.parseDate(e,t)];else if("string"==typeof e)switch(c.config.mode){case"single":case"time":n=[c.parseDate(e,t)];break;case"multiple":n=e.split(c.config.conjunction).map(function(e){return c.parseDate(e,t)});break;case"range":n=e.split(c.l10n.rangeSeparator).map(function(e){return c.parseDate(e,t)})}else c.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));c.selectedDates=n.filter(function(e){return e instanceof Date&&G(e,!1)}),"range"===c.config.mode&&c.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function ce(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?c.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:c.parseDate(e.from,void 0),to:c.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function de(e,t){var n=c.config[e];if(void 0!==n&&n.length>0)for(var a=0;n[a]&&ac.config.maxDate.getMonth():c.currentYear>c.config.maxDate.getFullYear()))}function me(e){if(void 0===e&&(e=!0),0===c.selectedDates.length)return c.clear(e);void 0!==c.mobileInput&&c.mobileFormatStr&&(c.mobileInput.value=void 0!==c.latestSelectedDateObj?c.formatDate(c.latestSelectedDateObj,c.mobileFormatStr):"");var t="range"!==c.config.mode?c.config.conjunction:c.l10n.rangeSeparator;c.input.value=c.selectedDates.map(function(e){return c.formatDate(e,c.config.dateFormat)}).join(t),void 0!==c.altInput&&(c.altInput.value=c.selectedDates.map(function(e){return c.formatDate(e,c.config.altFormat)}).join(t)),!1!==e&&de("onValueUpdate")}function ge(e){e.preventDefault();var t=c.prevMonthNav.contains(e.target),n=c.nextMonthNav.contains(e.target);t||n?U(t?-1:1):c.yearElements.indexOf(e.target)>=0?e.target.select():e.target.classList.contains("arrowUp")?c.changeYear(c.currentYear+1):e.target.classList.contains("arrowDown")&&c.changeYear(c.currentYear-1)}return function(){c.element=c.input=i,c.isOpen=!1,function(){var e=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],t=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],n=Object.assign({},r,JSON.parse(JSON.stringify(i.dataset||{}))),o={};c.config.parseDate=n.parseDate,c.config.formatDate=n.formatDate,Object.defineProperty(c.config,"enable",{get:function(){return c.config._enable},set:function(e){c.config._enable=ce(e)}}),Object.defineProperty(c.config,"disable",{get:function(){return c.config._disable},set:function(e){c.config._disable=ce(e)}});var l="time"===n.mode;n.dateFormat||!n.enableTime&&!l||(o.dateFormat=n.noCalendar||l?"H:i"+(n.enableSeconds?":S":""):y.defaultConfig.dateFormat+" H:i"+(n.enableSeconds?":S":"")),n.altInput&&(n.enableTime||l)&&!n.altFormat&&(o.altFormat=n.noCalendar||l?"h:i"+(n.enableSeconds?":S K":" K"):y.defaultConfig.altFormat+" h:i"+(n.enableSeconds?":S":"")+" K"),Object.defineProperty(c.config,"minDate",{get:function(){return c.config._minDate},set:ee("min")}),Object.defineProperty(c.config,"maxDate",{get:function(){return c.config._maxDate},set:ee("max")});var d=function(e){return function(t){c.config["min"===e?"_minTime":"_maxTime"]=c.parseDate(t,"H:i")}};Object.defineProperty(c.config,"minTime",{get:function(){return c.config._minTime},set:d("min")}),Object.defineProperty(c.config,"maxTime",{get:function(){return c.config._maxTime},set:d("max")}),"time"===n.mode&&(c.config.noCalendar=!0,c.config.enableTime=!0),Object.assign(c.config,o,n);for(var s=0;s0?c.selectedDates[0]:c.config.minDate&&c.config.minDate.getTime()>c.now.getTime()?c.config.minDate:c.config.maxDate&&c.config.maxDate.getTime()0&&(c.latestSelectedDateObj=c.selectedDates[0]),void 0!==c.config.minTime&&(c.config.minTime=c.parseDate(c.config.minTime,"H:i")),void 0!==c.config.maxTime&&(c.config.maxTime=c.parseDate(c.config.maxTime,"H:i")),c.minDateHasTime=!!c.config.minDate&&(c.config.minDate.getHours()>0||c.config.minDate.getMinutes()>0||c.config.minDate.getSeconds()>0),c.maxDateHasTime=!!c.config.maxDate&&(c.config.maxDate.getHours()>0||c.config.maxDate.getMinutes()>0||c.config.maxDate.getSeconds()>0),Object.defineProperty(c,"showTimeInput",{get:function(){return c._showTimeInput},set:function(e){c._showTimeInput=e,c.calendarContainer&&h(c.calendarContainer,"showTimeInput",e),c.isOpen&&ne()}})}(),c.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=c.currentMonth),void 0===t&&(t=c.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:c.l10n.daysInMonth[e]}},c.isMobile||function(){var n=window.document.createDocumentFragment();if(c.calendarContainer=v("div","flatpickr-calendar"),c.calendarContainer.tabIndex=-1,!c.config.noCalendar){if(n.appendChild((c.monthNav=v("div","flatpickr-months"),c.yearElements=[],c.monthElements=[],c.prevMonthNav=v("span","flatpickr-prev-month"),c.prevMonthNav.innerHTML=c.config.prevArrow,c.nextMonthNav=v("span","flatpickr-next-month"),c.nextMonthNav.innerHTML=c.config.nextArrow,K(),Object.defineProperty(c,"_hidePrevMonthArrow",{get:function(){return c.__hidePrevMonthArrow},set:function(e){c.__hidePrevMonthArrow!==e&&(h(c.prevMonthNav,"disabled",e),c.__hidePrevMonthArrow=e)}}),Object.defineProperty(c,"_hideNextMonthArrow",{get:function(){return c.__hideNextMonthArrow},set:function(e){c.__hideNextMonthArrow!==e&&(h(c.nextMonthNav,"disabled",e),c.__hideNextMonthArrow=e)}}),c.currentYearElement=c.yearElements[0],fe(),c.monthNav)),c.innerContainer=v("div","flatpickr-innerContainer"),c.config.weekNumbers){var a=function(){c.calendarContainer.classList.add("hasWeeks");var e=v("div","flatpickr-weekwrapper");e.appendChild(v("span","flatpickr-weekday",c.l10n.weekAbbreviation));var t=v("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),i=a.weekWrapper,o=a.weekNumbers;c.innerContainer.appendChild(i),c.weekNumbers=o,c.weekWrapper=i}c.rContainer=v("div","flatpickr-rContainer"),c.rContainer.appendChild(J()),c.daysContainer||(c.daysContainer=v("div","flatpickr-days"),c.daysContainer.tabIndex=-1),W(),c.rContainer.appendChild(c.daysContainer),c.innerContainer.appendChild(c.rContainer),n.appendChild(c.innerContainer)}c.config.enableTime&&n.appendChild(function(){c.calendarContainer.classList.add("hasTime"),c.config.noCalendar&&c.calendarContainer.classList.add("noCalendar"),c.timeContainer=v("div","flatpickr-time"),c.timeContainer.tabIndex=-1;var n=v("span","flatpickr-time-separator",":"),a=w("flatpickr-hour");c.hourElement=a.childNodes[0];var i=w("flatpickr-minute");if(c.minuteElement=i.childNodes[0],c.hourElement.tabIndex=c.minuteElement.tabIndex=-1,c.hourElement.value=e(c.latestSelectedDateObj?c.latestSelectedDateObj.getHours():c.config.time_24hr?c.config.defaultHour:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(c.config.defaultHour)),c.minuteElement.value=e(c.latestSelectedDateObj?c.latestSelectedDateObj.getMinutes():c.config.defaultMinute),c.hourElement.setAttribute("data-step",c.config.hourIncrement.toString()),c.minuteElement.setAttribute("data-step",c.config.minuteIncrement.toString()),c.hourElement.setAttribute("data-min",c.config.time_24hr?"0":"1"),c.hourElement.setAttribute("data-max",c.config.time_24hr?"23":"12"),c.minuteElement.setAttribute("data-min","0"),c.minuteElement.setAttribute("data-max","59"),c.timeContainer.appendChild(a),c.timeContainer.appendChild(n),c.timeContainer.appendChild(i),c.config.time_24hr&&c.timeContainer.classList.add("time24hr"),c.config.enableSeconds){c.timeContainer.classList.add("hasSeconds");var o=w("flatpickr-second");c.secondElement=o.childNodes[0],c.secondElement.value=e(c.latestSelectedDateObj?c.latestSelectedDateObj.getSeconds():c.config.defaultSeconds),c.secondElement.setAttribute("data-step",c.minuteElement.getAttribute("data-step")),c.secondElement.setAttribute("data-min",c.minuteElement.getAttribute("data-min")),c.secondElement.setAttribute("data-max",c.minuteElement.getAttribute("data-max")),c.timeContainer.appendChild(v("span","flatpickr-time-separator",":")),c.timeContainer.appendChild(o)}return c.config.time_24hr||(c.amPM=v("span","flatpickr-am-pm",c.l10n.amPM[t((c.latestSelectedDateObj?c.hourElement.value:c.config.defaultHour)>11)]),c.amPM.title=c.l10n.toggleTitle,c.amPM.tabIndex=-1,c.timeContainer.appendChild(c.amPM)),c.timeContainer}()),h(c.calendarContainer,"rangeMode","range"===c.config.mode),h(c.calendarContainer,"animate",!0===c.config.animate),h(c.calendarContainer,"multiMonth",c.config.showMonths>1),c.calendarContainer.appendChild(n);var r=void 0!==c.config.appendTo&&void 0!==c.config.appendTo.nodeType;if((c.config.inline||c.config.static)&&(c.calendarContainer.classList.add(c.config.inline?"inline":"static"),c.config.inline&&(!r&&c.element.parentNode?c.element.parentNode.insertBefore(c.calendarContainer,c._input.nextSibling):void 0!==c.config.appendTo&&c.config.appendTo.appendChild(c.calendarContainer)),c.config.static)){var l=v("div","flatpickr-wrapper");c.element.parentNode&&c.element.parentNode.insertBefore(l,c.element),l.appendChild(c.element),c.altInput&&l.appendChild(c.altInput),l.appendChild(c.calendarContainer)}c.config.static||c.config.inline||(void 0!==c.config.appendTo?c.config.appendTo:window.document.body).appendChild(c.calendarContainer)}(),function(){if(c.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(c.element.querySelectorAll("[data-"+e+"]"),function(t){return O(t,"click",c[e])})}),c.isMobile)!function(){var e=c.config.enableTime?c.config.noCalendar?"time":"datetime-local":"date";c.mobileInput=v("input",c.input.className+" flatpickr-mobile"),c.mobileInput.step=c.input.getAttribute("step")||"any",c.mobileInput.tabIndex=1,c.mobileInput.type=e,c.mobileInput.disabled=c.input.disabled,c.mobileInput.required=c.input.required,c.mobileInput.placeholder=c.input.placeholder,c.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",c.selectedDates.length>0&&(c.mobileInput.defaultValue=c.mobileInput.value=c.formatDate(c.selectedDates[0],c.mobileFormatStr)),c.config.minDate&&(c.mobileInput.min=c.formatDate(c.config.minDate,"Y-m-d")),c.config.maxDate&&(c.mobileInput.max=c.formatDate(c.config.maxDate,"Y-m-d")),c.input.type="hidden",void 0!==c.altInput&&(c.altInput.type="hidden");try{c.input.parentNode&&c.input.parentNode.insertBefore(c.mobileInput,c.input.nextSibling)}catch(e){}O(c.mobileInput,"change",function(e){c.setDate(e.target.value,!1,c.mobileFormatStr),de("onChange"),de("onClose")})}();else{var e=n(X,50);c._debouncedChange=n(_,b),c.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&O(c.daysContainer,"mouseover",function(e){"range"===c.config.mode&&Q(e.target)}),O(window.document.body,"keydown",Z),c.config.static||O(c._input,"keydown",Z),c.config.inline||c.config.static||O(window,"resize",e),void 0!==window.ontouchstart?O(window.document,"click",$):O(window.document,"mousedown",S($)),O(window.document,"focus",$,{capture:!0}),!0===c.config.clickOpens&&(O(c._input,"focus",c.open),O(c._input,"mousedown",S(c.open))),void 0!==c.daysContainer&&(O(c.monthNav,"mousedown",S(ge)),O(c.monthNav,["keyup","increment"],I),O(c.daysContainer,"mousedown",S(oe))),void 0!==c.timeContainer&&void 0!==c.minuteElement&&void 0!==c.hourElement&&(O(c.timeContainer,["increment"],M),O(c.timeContainer,"blur",M,{capture:!0}),O(c.timeContainer,"mousedown",S(F)),O([c.hourElement,c.minuteElement],["focus","click"],function(e){return e.target.select()}),void 0!==c.secondElement&&O(c.secondElement,"focus",function(){return c.secondElement&&c.secondElement.select()}),void 0!==c.amPM&&O(c.amPM,"mousedown",S(function(e){M(e),_()})))}}(),(c.selectedDates.length||c.config.noCalendar)&&(c.config.enableTime&&E(c.config.noCalendar?c.latestSelectedDateObj||c.config.minDate:void 0),me(!1)),C(),c.showTimeInput=c.selectedDates.length>0||c.config.noCalendar;var o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!c.isMobile&&o&&ne(),de("onReady")}(),c}function M(e,t){for(var n=Array.prototype.slice.call(e),a=[],i=0;ie.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),f=e=>e instanceof Array?e:[e],l=e=>Object.assign({},e);exports.default={name:"flat-pickr",props:{value:{default:null,required:!0,validator:function(e){return null===e||e instanceof Date||"string"==typeof e||e instanceof String||e instanceof Array||"number"==typeof e}},config:{type:Object,default:()=>({wrap:!1,defaultDate:null})},events:{type:Array,default:()=>o}},data:function(){return{fp:null}},mounted:function(){if(this.fp)return;let e=l(this.config);this.events.forEach(t=>{e[t]=f(e[t]||[]).concat((...e)=>{this.$emit(s(t),...e)})}),e.defaultDate=this.value||e.defaultDate,this.fp=new t.default(this.getElem(),e)},methods:{getElem:function(){return this.config.wrap?this.$el.parentNode:this.$el},onInput:function(e){this.$emit("input",e.target.value)}},watch:{config:{deep:!0,handler:function(e){let t=l(e);i.forEach(e=>{delete t[e]}),this.fp.set(t),r.forEach(e=>{void 0!==t[e]&&this.fp.set(e,t[e])})}},value:function(e){e!==this.$el.value&&this.fp&&this.fp.setDate(e,!0)}},beforeDestroy:function(){this.fp&&(this.fp.destroy(),this.fp=null)}}; +(function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this.$createElement;return(this._self._c||t)("input",{attrs:{type:"text","data-input":""},on:{input:this.onInput}})},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})(); +},{"flatpickr":"cdPm"}]},{},["XPxJ"], "__DirectusExtension__") \ No newline at end of file diff --git a/public/extensions/core/interfaces/calendar/readonly.js b/public/extensions/core/interfaces/calendar/readonly.js new file mode 100644 index 0000000000..64ceba3812 --- /dev/null +++ b/public/extensions/core/interfaces/calendar/readonly.js @@ -0,0 +1,10 @@ +parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f0?"-":"+")+i(100*Math.floor(Math.abs(N)/60)+Math.abs(N)%60,4),S:["th","st","nd","rd"][l%10>3?0:(l%100-l%10!=10)*l%10],W:p,N:H};return t.replace(a,function(e){return e in S?S[e]:e.slice(1,e.length-1)})});function i(e,t){for(e=String(e),t=t||2;e.length2&&(e.pop(),e.shift()),e}},methods:{updateValue:function(e){var t=[].concat(r(this.selection));t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),t.sort(),t=t.join(","),this.options.wrap&&t.length>0&&(t=","+t+","),"CSV"===this.type&&(t=t.split(",")),this.$emit("input",t)}}}; +(function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"interface-checkboxes"},e._l(e.options.choices,function(t,c){return n("v-checkbox",{key:t,attrs:{id:t,value:c,disabled:e.readonly,label:t,checked:e.selection.includes(c)},on:{change:function(t){e.updateValue(c,t)}}})}))},staticRenderFns:[],_compiled:!0,_scopeId:"data-v-531236",functional:void 0});})(); +},{"../../../mixins/interface":"QdEO"}]},{},["1O8a"], "__DirectusExtension__") \ No newline at end of file diff --git a/public/extensions/core/interfaces/checkboxes/meta.json b/public/extensions/core/interfaces/checkboxes/meta.json new file mode 100644 index 0000000000..4b0c964ae0 --- /dev/null +++ b/public/extensions/core/interfaces/checkboxes/meta.json @@ -0,0 +1 @@ +{"name":"$t:checkboxes","version":"1.0.0","datatypes":{"CSV":null,"VARCHAR":255},"fieldset":true,"options":{"choices":{"name":"$t:choices","comment":"$t:choices_comment","interface":"json","type":"JSON","default":{"value1":"$t:option 1","value2":"$t:option 2"}},"wrap":{"name":"$t:wrap","comment":"$t:wrap_comment","interface":"toggle","type":"BOOLEAN","default":true},"formatting":{"name":"$t:formatting","comment":"$t:formatting_comment","interface":"toggle","type":"BOOLEAN","default":true}},"translation":{"en-US":{"checkboxes":"Checkboxes","choices":"choices","choices_comment":"Enter JSON key value pairs with the saved value and text displayed.","wrap":"Wrap with Delimiter","wrap_comment":"Wrap the saved value in a delimiter (improves searchability).","option":"Option","formatting":"Show display text","formatting_comment":"Render the values as the display values","display_text":"Display Text","value":"Value"}}} \ No newline at end of file diff --git a/public/extensions/core/interfaces/checkboxes/readonly.js b/public/extensions/core/interfaces/checkboxes/readonly.js new file mode 100644 index 0000000000..0cdd385ab0 --- /dev/null +++ b/public/extensions/core/interfaces/checkboxes/readonly.js @@ -0,0 +1,6 @@ +parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f